diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 00000000..179a50ca --- /dev/null +++ b/CHANGELOG @@ -0,0 +1 @@ +changelog placeholder \ No newline at end of file diff --git a/CREDITS b/CREDITS new file mode 100644 index 00000000..19fcf2f4 --- /dev/null +++ b/CREDITS @@ -0,0 +1,52 @@ +== mooege Thanks/Credits file == + +The mooege project gives its thanks to the following people who have contributed to +the development of the source base in one way or another (in un-ordered list): + +* raistlinthewiz +* komiga +* Egris +* mdz444 +* fasbat +* Farmy +* DarkLotus +* BoyC +* tehCm +* BackAndForward +* Shadow^Dancer +* dark0ne +* dustinconrad +* [TOM_RUS] +* Wetwlly +* Cubido +* angerwin +* xsochor +* thesinx +* HDANILO +* Swiftsmoke +* flippy +* PeteGet27 +* Tharuler +* farces +* fortenbt +* rafal +* sqoou +* Xpload +* YasRavenheart +* raptium +* DrakeFish +* Reelix +* sku +* lb +* Wesko +* Weltmeyer +* carmack78 +* TeoMan +* RedBlueKnight +* chaoscode +* nickoneill +* kwyjibbo +* esdrubal + +Please DO NOT update this file, if you want too see your or someone other's nick here (given that the party is a +contributer), instead ask project maintainers (raistlinthewiz, komiga, egris) for so. \ No newline at end of file diff --git a/Compatibility b/Compatibility new file mode 100644 index 00000000..d96549fb --- /dev/null +++ b/Compatibility @@ -0,0 +1,14 @@ +== mooege Runtime/Framework Compatibility File == + +Currently supported: + +* Language: C# 4.0 +* .NET Framework Version: .NET FX 4.0 +* Microsoft Runtime: .NET 4.0 +* Mono Runtime: 2.10.5 +* Game Version: 1.0.2 (9991) + +Requirements: + +* OpenSSL-1.0.0.e +* SQLite \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..5685ca70 --- /dev/null +++ b/LICENSE @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 Library General +Public License instead of this License. \ No newline at end of file diff --git a/README.md b/README.md index 5ada4be2..19265275 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,39 @@ +###Current Status: +* You can Login, create characters and enter world. +* Client requires patching. + +*** + # Stay awhile and listen -* Read the fucking [FAQ](/raistlinthewiz/d3sharp/wiki/FAQ) before asking! -* Status: Will not you get you in-game yet. -* IRC: [#d3sharp/synirc](http://cbe002.chat.mibbit.com/?server=irc.synIRC.net&channel=%23d3sharp) \ No newline at end of file +* Read the [FAQ](http://wiki.mooege.org/FAQ) and check the [wiki](http://wiki.mooege.org/) before asking! +* Read the [WARNING](https://github.com/mooege/mooege/blob/master/WARNING) before starting to use this software! +* Check out [mooege.org](http://www.mooege.org) and the [forums](http://www.mooege.org/index). +* IRC (**irc.synirc.net**): + - **#mooege.chat** (general chat) + - **#mooege** (dev talk) + - **#mooege.announce** (_only_ announcements and the commit feed) +* [Twitter](http://twitter.com/#!/mooege), [Commit Feed](http://twitter.com/#!/mooegelog) + +# Welcome to mooege + +mooege (multi-node object oriented educational game emulator) is an open source reference game-server implementation +developed with C#. It can be compiled with Microsoft .NET or Mono, which means you can run it on Windows, MacOS, +and Linux. Please see the file LICENSE for license details. + +**Copyright (C) 2011 - 2012 mooege project** + +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. + diff --git a/WARNING b/WARNING new file mode 100644 index 00000000..ec9ce813 --- /dev/null +++ b/WARNING @@ -0,0 +1,10 @@ +mooege's focus is entirely on education, and we would like to keep it that way. + +Since any public and/or commercial use of this software is considered illegal +in many countries (please refer to your local law), the mooege team +will not provide any help nor support with such usage in any way. +Every user of this software is encouraged to make sure no law is being broken +in his/her country. + +The mooege team cannot take any responsibility for the use of this software +by end-users. diff --git a/assets/MPQ/IMPORTANT b/assets/MPQ/IMPORTANT new file mode 100644 index 00000000..64117366 --- /dev/null +++ b/assets/MPQ/IMPORTANT @@ -0,0 +1 @@ +Copy mpq files from Data_D3\PC\MPQs\ to here! \ No newline at end of file diff --git a/assets/config.ini b/assets/config.ini new file mode 100644 index 00000000..68afd4b0 --- /dev/null +++ b/assets/config.ini @@ -0,0 +1,103 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; ; +; Mooege Configuration File ; +; ; +;-----------------------------------------------------------------------------------------------------------------; +; ; +; This file is an example configuration and may require modification to suit your needs. ; +; ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; Settings for Bnet server +[MooNet-Server] +BindIP = 0.0.0.0 +BindIPv6 = ::1 +Port = 1119 +MOTD = Welcome to mooege development server! + +; Settings for game server +[Game-Server] +BindIP = 0.0.0.0 +BindIPv6 = ::1 +Port = 1999 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; Persistent storage settings +[Storage] +Root = Assets +MPQRoot=${Root}/MPQ +EnableTasks = true ; If you're running over mono and experience startup times > 1 min, try setting this to false. +LazyLoading = true ; Enable this to speed up server launch. If you run a proper public server or debugging MPQ fileformats + ; make sure you disable this. + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; Authentication settings +[Authentication] +DisablePasswordChecks=true; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; You can set here the command-prefix. Note: You can't use slash as a prefix. +[Commands] +CommandPrefix = ! + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; You can enable web-services here and use the provided contrib/web/LibMooge.php for communicating mooege over http. +[WebServices] +Enabled = false +Address = http://localhost:9000 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; Networking settings. +[Networking] +EnableIPv6 = false ; experimental!! + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; Network address translation settings. +; You only need to change this if you're running behind a dsl router or so. +; Important: If you enable NAT, LAN-clients will not able to connect in gs. +; (Will be fixed later with a proper implementation similar to one in pvpgn). +[NAT] +Enabled = false +PublicIP = 0.0.0.0 ; You need to change this to your router's public interface IP if you'd like to use NAT. + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; General logging settings +[Logging] +Root=logs + +; Settings for console logger +[ConsoleLog] +Enabled=true +Target=Console +IncludeTimeStamps=false +MinimumLevel=Trace +MaximumLevel=Fatal + +; Settings for server log file. +[ServerLog] +Enabled=true +Target=File +FileName="mooege.log" +IncludeTimeStamps=true +MinimumLevel=Trace +MaximumLevel=Fatal +ResetOnStartup=true + +; Settings for packet logger, only recommended for developers! +[PacketLog] +Enabled=true +Target=File +FileName="packet-dump.log" +IncludeTimeStamps=false +MinimumLevel=PacketDump +MaximumLevel=PacketDump +ResetOnStartup=true + + diff --git a/assets/database.Account - mysql.config b/assets/database.Account - mysql.config new file mode 100644 index 00000000..0953974a --- /dev/null +++ b/assets/database.Account - mysql.config @@ -0,0 +1,13 @@ + + + + NHibernate.Connection.DriverConnectionProvider + NHibernate.Dialect.MySQLDialect + NHibernate.Driver.MySqlDataDriver + true + + Server=localhost;Database=YOURDATABASENAME;User ID=root;Password=YOURPASSWORD + + 16 + + \ No newline at end of file diff --git a/assets/database.Account.config b/assets/database.Account.config new file mode 100644 index 00000000..eb712ce9 --- /dev/null +++ b/assets/database.Account.config @@ -0,0 +1,16 @@ + + + + NHibernate.Connection.DriverConnectionProvider + NHibernate.Driver.SQLite20Driver + + Data Source={$ASSETBASE}/accountDB.db;Version=3 + + NHibernate.Dialect.SQLiteDialect + true=1;false=0 + + + \ No newline at end of file diff --git a/assets/mooege.ico b/assets/mooege.ico new file mode 100644 index 00000000..63d009e6 Binary files /dev/null and b/assets/mooege.ico differ diff --git a/assets/mpqdata.db b/assets/mpqdata.db new file mode 100644 index 00000000..cd63d0df Binary files /dev/null and b/assets/mpqdata.db differ diff --git a/source/D3Sharp-win32.sln b/build/Mooege-Mono.sln similarity index 63% rename from source/D3Sharp-win32.sln rename to build/Mooege-Mono.sln index 64a1984d..c5cd42ff 100644 --- a/source/D3Sharp-win32.sln +++ b/build/Mooege-Mono.sln @@ -1,11 +1,9 @@  Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "D3Sharp", "D3Sharp\D3Sharp.csproj", "{41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mooege-Mono", "..\src\Mooege\Mooege-Mono.csproj", "{41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "D3Proto", "D3Proto\D3Proto.csproj", "{4CC19847-6F24-4453-9E31-126F94308AB9}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtoStringFixer", "ProtoStringFixer\ProtoStringFixer.csproj", "{1519D483-C89D-4B86-8A48-2E4F05440423}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibMooNet", "..\src\LibMooNet\LibMooNet.csproj", "{4CC19847-6F24-4453-9E31-126F94308AB9}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -18,11 +16,13 @@ Global EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Debug|Any CPU.ActiveCfg = Debug|x86 + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Debug|Any CPU.Build.0 = Debug|x86 {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Debug|Mixed Platforms.Build.0 = Debug|x86 {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Debug|x86.ActiveCfg = Debug|x86 {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Debug|x86.Build.0 = Debug|x86 {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Release|Any CPU.ActiveCfg = Release|x86 + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Release|Any CPU.Build.0 = Release|x86 {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Release|Mixed Platforms.ActiveCfg = Release|x86 {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Release|Mixed Platforms.Build.0 = Release|x86 {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Release|x86.ActiveCfg = Release|x86 @@ -32,26 +32,18 @@ Global {4CC19847-6F24-4453-9E31-126F94308AB9}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {4CC19847-6F24-4453-9E31-126F94308AB9}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {4CC19847-6F24-4453-9E31-126F94308AB9}.Debug|x86.ActiveCfg = Debug|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Debug|x86.Build.0 = Debug|Any CPU {4CC19847-6F24-4453-9E31-126F94308AB9}.Release|Any CPU.ActiveCfg = Release|Any CPU {4CC19847-6F24-4453-9E31-126F94308AB9}.Release|Any CPU.Build.0 = Release|Any CPU {4CC19847-6F24-4453-9E31-126F94308AB9}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {4CC19847-6F24-4453-9E31-126F94308AB9}.Release|Mixed Platforms.Build.0 = Release|Any CPU {4CC19847-6F24-4453-9E31-126F94308AB9}.Release|x86.ActiveCfg = Release|Any CPU - {1519D483-C89D-4B86-8A48-2E4F05440423}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1519D483-C89D-4B86-8A48-2E4F05440423}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1519D483-C89D-4B86-8A48-2E4F05440423}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {1519D483-C89D-4B86-8A48-2E4F05440423}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {1519D483-C89D-4B86-8A48-2E4F05440423}.Debug|x86.ActiveCfg = Debug|Any CPU - {1519D483-C89D-4B86-8A48-2E4F05440423}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1519D483-C89D-4B86-8A48-2E4F05440423}.Release|Any CPU.Build.0 = Release|Any CPU - {1519D483-C89D-4B86-8A48-2E4F05440423}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {1519D483-C89D-4B86-8A48-2E4F05440423}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {1519D483-C89D-4B86-8A48-2E4F05440423}.Release|x86.ActiveCfg = Release|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(MonoDevelopProperties) = preSolution + StartupItem = ..\src\Mooege\Mooege-Mono.csproj EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection - GlobalSection(MonoDevelopProperties) = preSolution - StartupItem = D3Sharp\D3Sharp.csproj - EndGlobalSection EndGlobal diff --git a/build/Mooege-VS2010.sln b/build/Mooege-VS2010.sln new file mode 100644 index 00000000..85d423c6 --- /dev/null +++ b/build/Mooege-VS2010.sln @@ -0,0 +1,45 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mooege-VS2010", "..\src\Mooege\Mooege-VS2010.csproj", "{41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibMooNet", "..\src\LibMooNet\LibMooNet.csproj", "{4CC19847-6F24-4453-9E31-126F94308AB9}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Debug|Any CPU.ActiveCfg = Debug|x86 + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Debug|x86.ActiveCfg = Debug|x86 + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Debug|x86.Build.0 = Debug|x86 + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Release|Any CPU.ActiveCfg = Release|x86 + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Release|Mixed Platforms.Build.0 = Release|x86 + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Release|x86.ActiveCfg = Release|x86 + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Release|x86.Build.0 = Release|x86 + {4CC19847-6F24-4453-9E31-126F94308AB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Debug|x86.ActiveCfg = Debug|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Release|Any CPU.Build.0 = Release|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Release|x86.ActiveCfg = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(MonoDevelopProperties) = preSolution + StartupItem = ..\src\Mooege\Mooege-VS2010.csproj + EndGlobalSection +EndGlobal diff --git a/build/build-mono.sh b/build/build-mono.sh new file mode 100644 index 00000000..4d3e8fd3 --- /dev/null +++ b/build/build-mono.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# Replaces mixed-mode SQLite path with managed path for Mono Linux/MacOS users + +SCRIPT="$(cd "${0%/*}" 2>/dev/null; echo "$PWD"/"${0##*/}")" +SCRIPTPATH=`dirname $SCRIPT` +echo $SCRIPTPATH + +sed -e 's/dep\\sqlite\\sqlite-mixed/dep\\sqlite\\sqlite-managed/g' $SCRIPTPATH/../src/Mooege/Mooege-VS2010.csproj > $SCRIPTPATH/../src/Mooege/Mooege-Mono.csproj + +xbuild $SCRIPTPATH/Mooege-Mono.sln + diff --git a/build/build-win.bat b/build/build-win.bat new file mode 100644 index 00000000..e95cf8c8 --- /dev/null +++ b/build/build-win.bat @@ -0,0 +1 @@ +%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe Mooege-VS2010.sln \ No newline at end of file diff --git a/build/tools/GameServer/GSPacketDumper.sln b/build/tools/GameServer/GSPacketDumper.sln new file mode 100644 index 00000000..ecb17d91 --- /dev/null +++ b/build/tools/GameServer/GSPacketDumper.sln @@ -0,0 +1,59 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mooege-VS2010", "..\..\..\src\Mooege\Mooege-VS2010.csproj", "{41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibMooNet", "..\..\..\src\LibMooNet\LibMooNet.csproj", "{4CC19847-6F24-4453-9E31-126F94308AB9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GSPacketDumper", "..\..\..\src\tools\GameServer\GSPacketDumper\GSPacketDumper.csproj", "{F8B009EE-3628-4A7A-B0BD-E131DDE0DC66}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Debug|Any CPU.ActiveCfg = Debug|x86 + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Debug|Any CPU.Build.0 = Debug|x86 + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Debug|x86.ActiveCfg = Debug|x86 + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Debug|x86.Build.0 = Debug|x86 + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Release|Any CPU.ActiveCfg = Release|x86 + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Release|Mixed Platforms.Build.0 = Release|x86 + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Release|x86.ActiveCfg = Release|x86 + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Release|x86.Build.0 = Release|x86 + {4CC19847-6F24-4453-9E31-126F94308AB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Debug|x86.ActiveCfg = Debug|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Release|Any CPU.Build.0 = Release|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Release|x86.ActiveCfg = Release|Any CPU + {F8B009EE-3628-4A7A-B0BD-E131DDE0DC66}.Debug|Any CPU.ActiveCfg = Debug|x86 + {F8B009EE-3628-4A7A-B0BD-E131DDE0DC66}.Debug|Any CPU.Build.0 = Debug|x86 + {F8B009EE-3628-4A7A-B0BD-E131DDE0DC66}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {F8B009EE-3628-4A7A-B0BD-E131DDE0DC66}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {F8B009EE-3628-4A7A-B0BD-E131DDE0DC66}.Debug|x86.ActiveCfg = Debug|x86 + {F8B009EE-3628-4A7A-B0BD-E131DDE0DC66}.Debug|x86.Build.0 = Debug|x86 + {F8B009EE-3628-4A7A-B0BD-E131DDE0DC66}.Release|Any CPU.ActiveCfg = Release|x86 + {F8B009EE-3628-4A7A-B0BD-E131DDE0DC66}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {F8B009EE-3628-4A7A-B0BD-E131DDE0DC66}.Release|Mixed Platforms.Build.0 = Release|x86 + {F8B009EE-3628-4A7A-B0BD-E131DDE0DC66}.Release|x86.ActiveCfg = Release|x86 + {F8B009EE-3628-4A7A-B0BD-E131DDE0DC66}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(MonoDevelopProperties) = preSolution + StartupItem = ..\..\..\src\tools\GameServer\GSPacketDumper\GSPacketDumper.csproj + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/build/tools/GameServer/GameMessageViewer.sln b/build/tools/GameServer/GameMessageViewer.sln new file mode 100644 index 00000000..eb07b93b --- /dev/null +++ b/build/tools/GameServer/GameMessageViewer.sln @@ -0,0 +1,54 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GameMessageViewer", "..\..\..\src\tools\GameServer\MessageViewer\GameMessageViewer.csproj", "{A36F30DF-2C60-40EB-9196-C56DDECB8E34}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mooege-VS2010", "..\..\..\src\Mooege\Mooege-VS2010.csproj", "{41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibMooNet", "..\..\..\src\LibMooNet\LibMooNet.csproj", "{4CC19847-6F24-4453-9E31-126F94308AB9}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A36F30DF-2C60-40EB-9196-C56DDECB8E34}.Debug|Any CPU.ActiveCfg = Debug|x86 + {A36F30DF-2C60-40EB-9196-C56DDECB8E34}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {A36F30DF-2C60-40EB-9196-C56DDECB8E34}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {A36F30DF-2C60-40EB-9196-C56DDECB8E34}.Debug|x86.ActiveCfg = Debug|x86 + {A36F30DF-2C60-40EB-9196-C56DDECB8E34}.Debug|x86.Build.0 = Debug|x86 + {A36F30DF-2C60-40EB-9196-C56DDECB8E34}.Release|Any CPU.ActiveCfg = Release|x86 + {A36F30DF-2C60-40EB-9196-C56DDECB8E34}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {A36F30DF-2C60-40EB-9196-C56DDECB8E34}.Release|Mixed Platforms.Build.0 = Release|x86 + {A36F30DF-2C60-40EB-9196-C56DDECB8E34}.Release|x86.ActiveCfg = Release|x86 + {A36F30DF-2C60-40EB-9196-C56DDECB8E34}.Release|x86.Build.0 = Release|x86 + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Debug|Any CPU.ActiveCfg = Debug|x86 + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Debug|x86.ActiveCfg = Debug|x86 + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Debug|x86.Build.0 = Debug|x86 + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Release|Any CPU.ActiveCfg = Release|x86 + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Release|Mixed Platforms.Build.0 = Release|x86 + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Release|x86.ActiveCfg = Release|x86 + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Release|x86.Build.0 = Release|x86 + {4CC19847-6F24-4453-9E31-126F94308AB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Debug|x86.ActiveCfg = Debug|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Release|Any CPU.Build.0 = Release|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Release|x86.ActiveCfg = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/build/tools/GameServer/TypeExtractor.sln b/build/tools/GameServer/TypeExtractor.sln new file mode 100644 index 00000000..2cc9e50a --- /dev/null +++ b/build/tools/GameServer/TypeExtractor.sln @@ -0,0 +1,59 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "D3ClassGenerator", "..\..\..\src\tools\GameServer\TypeExtractor\D3ClassGenerator\D3ClassGenerator.csproj", "{D716B26C-469E-4292-A0DB-C6A2FD058E0C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "D3TypeDescriptor", "..\..\..\src\tools\GameServer\TypeExtractor\D3TypeDescriptor\D3TypeDescriptor.csproj", "{F4367152-8294-4CF1-A984-3CD7B58DDEAD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "D3TypeDump", "..\..\..\src\tools\GameServer\TypeExtractor\D3TypeDump\D3TypeDump.csproj", "{940EE21E-198E-4FFC-A0C0-55F3317CF20D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {940EE21E-198E-4FFC-A0C0-55F3317CF20D}.Debug|Any CPU.ActiveCfg = Debug|x86 + {940EE21E-198E-4FFC-A0C0-55F3317CF20D}.Debug|Any CPU.Build.0 = Debug|x86 + {940EE21E-198E-4FFC-A0C0-55F3317CF20D}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {940EE21E-198E-4FFC-A0C0-55F3317CF20D}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {940EE21E-198E-4FFC-A0C0-55F3317CF20D}.Debug|x86.ActiveCfg = Debug|x86 + {940EE21E-198E-4FFC-A0C0-55F3317CF20D}.Debug|x86.Build.0 = Debug|x86 + {940EE21E-198E-4FFC-A0C0-55F3317CF20D}.Release|Any CPU.ActiveCfg = Release|x86 + {940EE21E-198E-4FFC-A0C0-55F3317CF20D}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {940EE21E-198E-4FFC-A0C0-55F3317CF20D}.Release|Mixed Platforms.Build.0 = Release|x86 + {940EE21E-198E-4FFC-A0C0-55F3317CF20D}.Release|x86.ActiveCfg = Release|x86 + {940EE21E-198E-4FFC-A0C0-55F3317CF20D}.Release|x86.Build.0 = Release|x86 + {D716B26C-469E-4292-A0DB-C6A2FD058E0C}.Debug|Any CPU.ActiveCfg = Debug|x86 + {D716B26C-469E-4292-A0DB-C6A2FD058E0C}.Debug|Any CPU.Build.0 = Debug|x86 + {D716B26C-469E-4292-A0DB-C6A2FD058E0C}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {D716B26C-469E-4292-A0DB-C6A2FD058E0C}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {D716B26C-469E-4292-A0DB-C6A2FD058E0C}.Debug|x86.ActiveCfg = Debug|x86 + {D716B26C-469E-4292-A0DB-C6A2FD058E0C}.Debug|x86.Build.0 = Debug|x86 + {D716B26C-469E-4292-A0DB-C6A2FD058E0C}.Release|Any CPU.ActiveCfg = Release|x86 + {D716B26C-469E-4292-A0DB-C6A2FD058E0C}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {D716B26C-469E-4292-A0DB-C6A2FD058E0C}.Release|Mixed Platforms.Build.0 = Release|x86 + {D716B26C-469E-4292-A0DB-C6A2FD058E0C}.Release|x86.ActiveCfg = Release|x86 + {D716B26C-469E-4292-A0DB-C6A2FD058E0C}.Release|x86.Build.0 = Release|x86 + {F4367152-8294-4CF1-A984-3CD7B58DDEAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F4367152-8294-4CF1-A984-3CD7B58DDEAD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F4367152-8294-4CF1-A984-3CD7B58DDEAD}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {F4367152-8294-4CF1-A984-3CD7B58DDEAD}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {F4367152-8294-4CF1-A984-3CD7B58DDEAD}.Debug|x86.ActiveCfg = Debug|Any CPU + {F4367152-8294-4CF1-A984-3CD7B58DDEAD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F4367152-8294-4CF1-A984-3CD7B58DDEAD}.Release|Any CPU.Build.0 = Release|Any CPU + {F4367152-8294-4CF1-A984-3CD7B58DDEAD}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {F4367152-8294-4CF1-A984-3CD7B58DDEAD}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {F4367152-8294-4CF1-A984-3CD7B58DDEAD}.Release|x86.ActiveCfg = Release|Any CPU + EndGlobalSection + GlobalSection(MonoDevelopProperties) = preSolution + StartupItem = ..\..\..\src\tools\GameServer\TypeExtractor\D3TypeDump\D3TypeDump.csproj + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/build/tools/MooNet/MooNet-Tools.sln b/build/tools/MooNet/MooNet-Tools.sln new file mode 100644 index 00000000..6f985629 --- /dev/null +++ b/build/tools/MooNet/MooNet-Tools.sln @@ -0,0 +1,83 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MooNetHelpers", "..\..\..\src\tools\MooNet\Helpers\MooNetHelpers.csproj", "{1519D483-C89D-4B86-8A48-2E4F05440423}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StringViewer", "..\..\..\src\tools\MooNet\StringViewer\StringViewer.csproj", "{16031196-6376-47C3-AC91-0BBA17F1F7C6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibMooNet", "..\..\..\src\LibMooNet\LibMooNet.csproj", "{4CC19847-6F24-4453-9E31-126F94308AB9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeaderViewer", "..\..\..\src\tools\MooNet\HeaderViewer\HeaderViewer.csproj", "{19F1717B-23ED-475F-AC31-1ACD1155B590}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtoExtractor", "..\..\..\src\tools\MooNet\ProtoExtractor\ProtoExtractor.csproj", "{5CAAB5DB-0280-47B0-B867-ACF2B01D37AE}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1519D483-C89D-4B86-8A48-2E4F05440423}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1519D483-C89D-4B86-8A48-2E4F05440423}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1519D483-C89D-4B86-8A48-2E4F05440423}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {1519D483-C89D-4B86-8A48-2E4F05440423}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {1519D483-C89D-4B86-8A48-2E4F05440423}.Debug|x86.ActiveCfg = Debug|Any CPU + {1519D483-C89D-4B86-8A48-2E4F05440423}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1519D483-C89D-4B86-8A48-2E4F05440423}.Release|Any CPU.Build.0 = Release|Any CPU + {1519D483-C89D-4B86-8A48-2E4F05440423}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {1519D483-C89D-4B86-8A48-2E4F05440423}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {1519D483-C89D-4B86-8A48-2E4F05440423}.Release|x86.ActiveCfg = Release|Any CPU + {16031196-6376-47C3-AC91-0BBA17F1F7C6}.Debug|Any CPU.ActiveCfg = Debug|x86 + {16031196-6376-47C3-AC91-0BBA17F1F7C6}.Debug|Any CPU.Build.0 = Debug|x86 + {16031196-6376-47C3-AC91-0BBA17F1F7C6}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {16031196-6376-47C3-AC91-0BBA17F1F7C6}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {16031196-6376-47C3-AC91-0BBA17F1F7C6}.Debug|x86.ActiveCfg = Debug|x86 + {16031196-6376-47C3-AC91-0BBA17F1F7C6}.Debug|x86.Build.0 = Debug|x86 + {16031196-6376-47C3-AC91-0BBA17F1F7C6}.Release|Any CPU.ActiveCfg = Release|x86 + {16031196-6376-47C3-AC91-0BBA17F1F7C6}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {16031196-6376-47C3-AC91-0BBA17F1F7C6}.Release|Mixed Platforms.Build.0 = Release|x86 + {16031196-6376-47C3-AC91-0BBA17F1F7C6}.Release|x86.ActiveCfg = Release|x86 + {16031196-6376-47C3-AC91-0BBA17F1F7C6}.Release|x86.Build.0 = Release|x86 + {4CC19847-6F24-4453-9E31-126F94308AB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Debug|x86.ActiveCfg = Debug|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Release|Any CPU.Build.0 = Release|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {4CC19847-6F24-4453-9E31-126F94308AB9}.Release|x86.ActiveCfg = Release|Any CPU + {19F1717B-23ED-475F-AC31-1ACD1155B590}.Debug|Any CPU.ActiveCfg = Debug|x86 + {19F1717B-23ED-475F-AC31-1ACD1155B590}.Debug|Any CPU.Build.0 = Debug|x86 + {19F1717B-23ED-475F-AC31-1ACD1155B590}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {19F1717B-23ED-475F-AC31-1ACD1155B590}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {19F1717B-23ED-475F-AC31-1ACD1155B590}.Debug|x86.ActiveCfg = Debug|x86 + {19F1717B-23ED-475F-AC31-1ACD1155B590}.Debug|x86.Build.0 = Debug|x86 + {19F1717B-23ED-475F-AC31-1ACD1155B590}.Release|Any CPU.ActiveCfg = Release|x86 + {19F1717B-23ED-475F-AC31-1ACD1155B590}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {19F1717B-23ED-475F-AC31-1ACD1155B590}.Release|Mixed Platforms.Build.0 = Release|x86 + {19F1717B-23ED-475F-AC31-1ACD1155B590}.Release|x86.ActiveCfg = Release|x86 + {19F1717B-23ED-475F-AC31-1ACD1155B590}.Release|x86.Build.0 = Release|x86 + {5CAAB5DB-0280-47B0-B867-ACF2B01D37AE}.Debug|Any CPU.ActiveCfg = Debug|x86 + {5CAAB5DB-0280-47B0-B867-ACF2B01D37AE}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {5CAAB5DB-0280-47B0-B867-ACF2B01D37AE}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {5CAAB5DB-0280-47B0-B867-ACF2B01D37AE}.Debug|x86.ActiveCfg = Debug|x86 + {5CAAB5DB-0280-47B0-B867-ACF2B01D37AE}.Debug|x86.Build.0 = Debug|x86 + {5CAAB5DB-0280-47B0-B867-ACF2B01D37AE}.Release|Any CPU.ActiveCfg = Release|x86 + {5CAAB5DB-0280-47B0-B867-ACF2B01D37AE}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {5CAAB5DB-0280-47B0-B867-ACF2B01D37AE}.Release|Mixed Platforms.Build.0 = Release|x86 + {5CAAB5DB-0280-47B0-B867-ACF2B01D37AE}.Release|x86.ActiveCfg = Release|x86 + {5CAAB5DB-0280-47B0-B867-ACF2B01D37AE}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(MonoDevelopProperties) = preSolution + StartupItem = ..\..\..\src\tools\MooNet\HeaderViewer\HeaderViewer.csproj + EndGlobalSection +EndGlobal diff --git a/contrib/mpq-fix/.gitignore b/contrib/mpq-fix/.gitignore new file mode 100644 index 00000000..630ddabd --- /dev/null +++ b/contrib/mpq-fix/.gitignore @@ -0,0 +1,2 @@ +/*.MPQ +/*.mpq diff --git a/contrib/mpq-fix/fix-mpq.bat b/contrib/mpq-fix/fix-mpq.bat new file mode 100644 index 00000000..338edb3e --- /dev/null +++ b/contrib/mpq-fix/fix-mpq.bat @@ -0,0 +1,9 @@ +wget.exe http://ak.worldofwarcraft.com.edgesuite.net/d3-pod-retail/NA/8370.direct/Data_D3/PC/MPQs/base-Win.mpq +wget.exe http://ak.worldofwarcraft.com.edgesuite.net/d3-pod-retail/NA/8370.direct/Data_D3/PC/MPQs/ClientData.mpq +wget.exe http://ak.worldofwarcraft.com.edgesuite.net/d3-pod-retail/NA/8370.direct/Data_D3/PC/MPQs/CoreData.mpq +mkdir base +wget.exe -P base http://ak.worldofwarcraft.com.edgesuite.net/d3-pod-retail/NA/8370.direct/Data_D3/PC/MPQs/base/d3-update-base-9558.MPQ +wget.exe -P base http://ak.worldofwarcraft.com.edgesuite.net/d3-pod-retail/NA/8370.direct/Data_D3/PC/MPQs/base/d3-update-base-9749.MPQ +wget.exe -P base http://ak.worldofwarcraft.com.edgesuite.net/d3-pod-retail/NA/8370.direct/Data_D3/PC/MPQs/base/d3-update-base-9858.MPQ +wget.exe -P base http://ak.worldofwarcraft.com.edgesuite.net/d3-pod-retail/NA/8370.direct/Data_D3/PC/MPQs/base/d3-update-base-9950.MPQ +wget.exe -P base http://ak.worldofwarcraft.com.edgesuite.net/d3-pod-retail/NA/8370.direct/Data_D3/PC/MPQs/base/d3-update-base-9991.MPQ \ No newline at end of file diff --git a/contrib/mpq-fix/fix-mpq.sh b/contrib/mpq-fix/fix-mpq.sh new file mode 100644 index 00000000..94ed3254 --- /dev/null +++ b/contrib/mpq-fix/fix-mpq.sh @@ -0,0 +1,9 @@ +wget http://ak.worldofwarcraft.com.edgesuite.net/d3-pod-retail/NA/8370.direct/Data_D3/PC/MPQs/base-Win.mpq +wget http://ak.worldofwarcraft.com.edgesuite.net/d3-pod-retail/NA/8370.direct/Data_D3/PC/MPQs/ClientData.mpq +wget http://ak.worldofwarcraft.com.edgesuite.net/d3-pod-retail/NA/8370.direct/Data_D3/PC/MPQs/CoreData.mpq +mkdir base +wget -P base http://ak.worldofwarcraft.com.edgesuite.net/d3-pod-retail/NA/8370.direct/Data_D3/PC/MPQs/base/d3-update-base-9558.MPQ +wget -P base http://ak.worldofwarcraft.com.edgesuite.net/d3-pod-retail/NA/8370.direct/Data_D3/PC/MPQs/base/d3-update-base-9749.MPQ +wget -P base http://ak.worldofwarcraft.com.edgesuite.net/d3-pod-retail/NA/8370.direct/Data_D3/PC/MPQs/base/d3-update-base-9858.MPQ +wget -P base http://ak.worldofwarcraft.com.edgesuite.net/d3-pod-retail/NA/8370.direct/Data_D3/PC/MPQs/base/d3-update-base-9950.MPQ +wget -P base http://ak.worldofwarcraft.com.edgesuite.net/d3-pod-retail/NA/8370.direct/Data_D3/PC/MPQs/base/d3-update-base-9991.MPQ \ No newline at end of file diff --git a/contrib/mpq-fix/wget.exe b/contrib/mpq-fix/wget.exe new file mode 100644 index 00000000..f2a11c17 Binary files /dev/null and b/contrib/mpq-fix/wget.exe differ diff --git a/contrib/patcher/.gitignore b/contrib/patcher/.gitignore new file mode 100644 index 00000000..3575c990 --- /dev/null +++ b/contrib/patcher/.gitignore @@ -0,0 +1,7 @@ +*.suo +bin/ +obj/ +/*.csproj.user +/_ReSharper.loader/ +/_ReSharper.patcher/ +/_ReSharper.PonyPatcher/ diff --git a/contrib/patcher/LibPony/LibPony.csproj b/contrib/patcher/LibPony/LibPony.csproj new file mode 100644 index 00000000..aa402034 --- /dev/null +++ b/contrib/patcher/LibPony/LibPony.csproj @@ -0,0 +1,57 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {F6092522-5F0B-4111-A8BF-FCCDA2D6DB71} + Library + Properties + PonyLib + PonyLib + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/contrib/patcher/LibPony/PatchInfo.cs b/contrib/patcher/LibPony/PatchInfo.cs new file mode 100644 index 00000000..dbf139fc --- /dev/null +++ b/contrib/patcher/LibPony/PatchInfo.cs @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; + +namespace PonyLib +{ + public static class PatchInfo + { + #region current + + // Build 1.0.3.10057 + + /// + /// Offset for server-ip check. + /// + public const Int32 ServerIPCheckOffset = 0x000BC2CC; + + /// + /// Offset for second challenge check. + /// + public const Int32 SecondChallengeCheckOffset = 0x000BC289; + + /// + /// Required bnet module version. + /// + public const string RequiredBnetModuleVersion = "ab0ebd5e2c"; + + #endregion + + #region old offsets + + // add previous offset information to here once you update current region! + + //1.2.9991 + //public const Int32 ServerIPCheckOffset = 0x000BC25C; + //public const Int32 SecondChallengeCheckOffset = 0x000BC219; + //public const string RequiredBnetModuleVersion = "24e2d13e54"; + + // 1.0.2.9858, 1.0.2.9950 + //public const Int32 ServerIPCheckOffset = 0x000BA8A2; + //public const Int32 SecondChallengeCheckOffset = 0x000BA863; + + // 1.0.2.9749 + //static Int32 offset = 0x000BA802; + //static string version = "8018401a9c"; + + // 1.0.1.9558 + //static Int32 offset = 0x000B5952; + //static string version = "31c8df955a"; + + // Beta 0.11.0.9327, Beta 0.11.0.9359 + //static Int32 offset = 0x000B5605; + //static string version = "8eac7d44dc"; + + // Beta 0.10.0.9183 + //static Int32 offset = 0x000B5505; + + // Beta 0.9.0.8896 + //static Int32 offset = 0x000B4475; + //static string version = "bcd3e50524"; // DLL Battle.net Aurora bcd3e50524_public/329 (Mar 14 2012 10:28:16) + + #endregion + } +} diff --git a/contrib/patcher/LibPony/Patcher.cs b/contrib/patcher/LibPony/Patcher.cs new file mode 100644 index 00000000..99c8dcad --- /dev/null +++ b/contrib/patcher/LibPony/Patcher.cs @@ -0,0 +1,188 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Diagnostics; +using System.Linq; +using System.Runtime.InteropServices; + +namespace PonyLib +{ + /// + /// Pony feeder library! + /// + public static class Patcher + { + private static Process _process; // the client process. + private static IntPtr _processhWnd; // the hWnd for the opened process. + private static bool _isProcessOpen = false; + private static bool _isAlreadyPatched = false; + private static int _serverIpCheckAddr = 0x0; + private static int _secondChallengeCheckAddr = 0x0; + + private static readonly byte[] JmpOpcode = new byte[] { 0xeb }; // Jmp opcode fix for ponies ;) + + /// + /// Returns true if client is running. + /// + /// value. + public static bool IsClientRunning() + { + return Process.GetProcesses().FirstOrDefault(process => process.ProcessName.Trim() == "Diablo III")!=null; + } + + /// + /// Returns true if client is already patched, false if not. + /// + /// value. + public static bool IsAlreadyPatched() + { + if(!IsClientRunning()) // make sure the client is running. + return false; + + if(!_isProcessOpen) // if we didn't open the process yet, + FindAndOpenProcess(); // make it so. + + return _isAlreadyPatched; // FindAndOpenProcess() will check if the process and write it to _isAlreadyPatched. + } + + /// + /// Function that patches the client and disables server IP and second challenge checks. + /// + /// + public static bool Patch() + { + if (!IsClientRunning()) // make sure the client is running. + return false; + + if (!_isProcessOpen) // if we didn't open the process yet, + FindAndOpenProcess(); // make it so. + + if (IsAlreadyPatched()) // make sure process is not already patched! + throw new Exception("Process is already patched!"); + + var bytesWritten = IntPtr.Zero; + + // patch thumbprint (game server ip check). + var retVal = Win32.WriteProcessMemory(_processhWnd, new IntPtr(_serverIpCheckAddr), JmpOpcode, 1, out bytesWritten); + if(!retVal) // see if we hit an win32 error. + { + var win32ErrorCode = Marshal.GetLastWin32Error(); + throw new Exception(string.Format("Failed to write to process [win32 error code: 0x{0:X}]", win32ErrorCode)); + } + else if (bytesWritten.ToInt32() < 1) // make sure we've actually written the byte. + { + throw new Exception("Failed to write to process."); + } + + // patch second challenge check. + retVal = Win32.WriteProcessMemory(_processhWnd, new IntPtr(_secondChallengeCheckAddr), JmpOpcode, 1, out bytesWritten); + if (!retVal) // see if we hit an win32 error. + { + var win32ErrorCode = Marshal.GetLastWin32Error(); + throw new Exception(string.Format("Failed to write to process [win32 error code: {0}", win32ErrorCode)); + } + else if (bytesWritten.ToInt32() < 1) // make sure we've actually written the byte. + { + throw new Exception("Failed to write to process."); + } + + return true; // ponies should be happy now! + } + + /// + /// Executes any necessary cleanup operations. + /// + public static void Cleanup() + { + if (_isProcessOpen && _processhWnd != IntPtr.Zero) // if process is still open. + Win32.CloseHandle(_processhWnd); // close it. + + _isProcessOpen = false; + _processhWnd = IntPtr.Zero; + } + + /// + /// Internal function that finds the client process and opens it. + /// + private static void FindAndOpenProcess() + { + _processhWnd = IntPtr.Zero; + + _process = Process.GetProcesses().FirstOrDefault(process => process.ProcessName.Trim() == "Diablo III"); // find the process. + if (_process == null) + { + _isProcessOpen = false; + throw new Exception("Can not find client process!"); + } + + _processhWnd = Win32.OpenProcess(0x001F0FFF, false, _process.Id); // open the process with all access - 0x001F0FFF = PROCESS_ALL_ACCESS + if (_processhWnd == IntPtr.Zero) + { + _isProcessOpen = false; + throw new Exception("Failed to open client process!"); + } + + _isProcessOpen = true; + + var processModules = _process.Modules; // get process' modules. + ProcessModule bnetModule = null; + + foreach (ProcessModule module in processModules) // enumurate all modules. + { + if (module.ModuleName != "battle.net.dll") + continue; + + // find the battle.net.dll module and check for module version. + if (module.FileVersionInfo.FileDescription != PatchInfo.RequiredBnetModuleVersion) + throw new Exception("battle.net.dll module version is different than expected!"); + + bnetModule = module; + break; + } + + var baseAddr = IntPtr.Zero; + baseAddr = bnetModule.BaseAddress; + + if (baseAddr == IntPtr.Zero) + throw new Exception("Failed to locate battle.net.dll"); + + _serverIpCheckAddr = baseAddr.ToInt32() + PatchInfo.ServerIPCheckOffset; // calculate the address for server IP check. + _secondChallengeCheckAddr = baseAddr.ToInt32() + PatchInfo.SecondChallengeCheckOffset; // calculate the address for second challenge check. + + var serverIPCheckByte = ReadByte(_processhWnd, _serverIpCheckAddr); // read current opcode for server IP check. + var secondChallengeCheckByte = ReadByte(_processhWnd, _secondChallengeCheckAddr); // read current opcode for second challenge check. + + if (serverIPCheckByte != 0x75 || secondChallengeCheckByte != 0x74) // see if process is already patched. + _isAlreadyPatched = true; + } + + /// + /// Internal function to read a byte from process memory. + /// + /// The process' handle to read from. + /// The offset to read from. + /// + private static byte ReadByte(IntPtr handle, int offset) + { + byte result = 0; + Win32.ReadProcessMemory(handle, offset, out result, 1, IntPtr.Zero); + return result; + } + } +} diff --git a/contrib/patcher/LibPony/Properties/AssemblyInfo.cs b/contrib/patcher/LibPony/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..0b4daf23 --- /dev/null +++ b/contrib/patcher/LibPony/Properties/AssemblyInfo.cs @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using PonyLib; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("LibPony")] +[assembly: AssemblyDescription("mooege - an educational game server emulator.")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("mooege.org")] +[assembly: AssemblyProduct("LibPony")] +[assembly: AssemblyCopyright("Copyright © 2011 - 2012, mooege project.")] +[assembly: AssemblyTrademark("LibPony")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("dab4ba4d-5a09-48d1-a735-b6c2c5559683")] + +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// The form "{Major}.{Minor}.*" will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}.*" will update just the revision. + +// Set the assembly version from VersionInfo.cs file. +[assembly: AssemblyVersion(VersionInfo.Assembly.Version)] \ No newline at end of file diff --git a/contrib/patcher/LibPony/VersionInfo.cs b/contrib/patcher/LibPony/VersionInfo.cs new file mode 100644 index 00000000..0eddf7b3 --- /dev/null +++ b/contrib/patcher/LibPony/VersionInfo.cs @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace PonyLib +{ + /// + /// Supported versions info for PonyLib. + /// + public static class VersionInfo + { + /// + /// Main assembly versions info. + /// + public static class Assembly + { + /// + /// Main assemblies version. + /// + public const string Version = "1.10057.0.0"; + } + + /// + /// Client version info. + /// + public static class Client + { + /// + /// Required client version. + /// + public const int RequiredClientVersion = 10057; + } + } +} \ No newline at end of file diff --git a/contrib/patcher/LibPony/Win32.cs b/contrib/patcher/LibPony/Win32.cs new file mode 100644 index 00000000..a8a59eb2 --- /dev/null +++ b/contrib/patcher/LibPony/Win32.cs @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Runtime.InteropServices; + +namespace PonyLib +{ + /// + /// Win32 native API calls to be used by internally by LibPony. + /// + internal static class Win32 + { + [DllImport("kernel32.dll", ExactSpelling = true)] + internal static extern IntPtr OpenProcess(uint dwDesiredAccess, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle, int dwProcessId); + + [DllImport("kernel32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + internal static extern bool CloseHandle(IntPtr hObject); + + [DllImport("kernel32.dll", SetLastError = true)] + internal static extern bool WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, byte[] lpBuffer, uint nSize, out IntPtr lpNumberOfBytesWritten); + + [DllImport("kernel32.dll", SetLastError = true)] + internal static extern bool ReadProcessMemory(IntPtr hProcess, int lpBaseAddress, out byte lpBuffer, int dwSize, IntPtr lpNumberOfBytesRead); + } +} diff --git a/contrib/patcher/PonyPatcher.sln b/contrib/patcher/PonyPatcher.sln new file mode 100644 index 00000000..5bc4c47c --- /dev/null +++ b/contrib/patcher/PonyPatcher.sln @@ -0,0 +1,42 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibPony", "LibPony\LibPony.csproj", "{F6092522-5F0B-4111-A8BF-FCCDA2D6DB71}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PonyPatcher", "PonyPatcher\PonyPatcher.csproj", "{B30D37BA-120C-41F0-89B7-4DDE1E204B91}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F6092522-5F0B-4111-A8BF-FCCDA2D6DB71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F6092522-5F0B-4111-A8BF-FCCDA2D6DB71}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F6092522-5F0B-4111-A8BF-FCCDA2D6DB71}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {F6092522-5F0B-4111-A8BF-FCCDA2D6DB71}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {F6092522-5F0B-4111-A8BF-FCCDA2D6DB71}.Debug|x86.ActiveCfg = Debug|Any CPU + {F6092522-5F0B-4111-A8BF-FCCDA2D6DB71}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F6092522-5F0B-4111-A8BF-FCCDA2D6DB71}.Release|Any CPU.Build.0 = Release|Any CPU + {F6092522-5F0B-4111-A8BF-FCCDA2D6DB71}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {F6092522-5F0B-4111-A8BF-FCCDA2D6DB71}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {F6092522-5F0B-4111-A8BF-FCCDA2D6DB71}.Release|x86.ActiveCfg = Release|Any CPU + {B30D37BA-120C-41F0-89B7-4DDE1E204B91}.Debug|Any CPU.ActiveCfg = Debug|x86 + {B30D37BA-120C-41F0-89B7-4DDE1E204B91}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {B30D37BA-120C-41F0-89B7-4DDE1E204B91}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {B30D37BA-120C-41F0-89B7-4DDE1E204B91}.Debug|x86.ActiveCfg = Debug|x86 + {B30D37BA-120C-41F0-89B7-4DDE1E204B91}.Debug|x86.Build.0 = Debug|x86 + {B30D37BA-120C-41F0-89B7-4DDE1E204B91}.Release|Any CPU.ActiveCfg = Release|x86 + {B30D37BA-120C-41F0-89B7-4DDE1E204B91}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {B30D37BA-120C-41F0-89B7-4DDE1E204B91}.Release|Mixed Platforms.Build.0 = Release|x86 + {B30D37BA-120C-41F0-89B7-4DDE1E204B91}.Release|x86.ActiveCfg = Release|x86 + {B30D37BA-120C-41F0-89B7-4DDE1E204B91}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/contrib/patcher/PonyPatcher/.gitignore b/contrib/patcher/PonyPatcher/.gitignore new file mode 100644 index 00000000..3575c990 --- /dev/null +++ b/contrib/patcher/PonyPatcher/.gitignore @@ -0,0 +1,7 @@ +*.suo +bin/ +obj/ +/*.csproj.user +/_ReSharper.loader/ +/_ReSharper.patcher/ +/_ReSharper.PonyPatcher/ diff --git a/contrib/patcher/PonyPatcher/AboutForm.Designer.cs b/contrib/patcher/PonyPatcher/AboutForm.Designer.cs new file mode 100644 index 00000000..7adbeaa7 --- /dev/null +++ b/contrib/patcher/PonyPatcher/AboutForm.Designer.cs @@ -0,0 +1,96 @@ +namespace PonyPatcher +{ + partial class AboutForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutForm)); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.labelVersion = new System.Windows.Forms.Label(); + this.textBox1 = new System.Windows.Forms.TextBox(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.SuspendLayout(); + // + // pictureBox1 + // + this.pictureBox1.Image = global::PonyPatcher.Properties.Resources.pony; + this.pictureBox1.Location = new System.Drawing.Point(12, 12); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(64, 64); + this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.pictureBox1.TabIndex = 0; + this.pictureBox1.TabStop = false; + // + // labelVersion + // + this.labelVersion.Font = new System.Drawing.Font("Tahoma", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(162))); + this.labelVersion.Location = new System.Drawing.Point(82, 12); + this.labelVersion.Name = "labelVersion"; + this.labelVersion.Size = new System.Drawing.Size(269, 64); + this.labelVersion.TabIndex = 1; + this.labelVersion.Text = "version"; + this.labelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // textBox1 + // + this.textBox1.Font = new System.Drawing.Font("Tahoma", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(162))); + this.textBox1.HideSelection = false; + this.textBox1.Location = new System.Drawing.Point(12, 82); + this.textBox1.Multiline = true; + this.textBox1.Name = "textBox1"; + this.textBox1.ReadOnly = true; + this.textBox1.Size = new System.Drawing.Size(339, 121); + this.textBox1.TabIndex = 3; + this.textBox1.TabStop = false; + this.textBox1.Text = resources.GetString("textBox1.Text"); + // + // AboutForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(361, 214); + this.Controls.Add(this.textBox1); + this.Controls.Add(this.labelVersion); + this.Controls.Add(this.pictureBox1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Name = "AboutForm"; + this.Text = "Pony Patcher"; + this.Load += new System.EventHandler(this.AboutForm_Load); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.PictureBox pictureBox1; + private System.Windows.Forms.Label labelVersion; + private System.Windows.Forms.TextBox textBox1; + } +} \ No newline at end of file diff --git a/contrib/patcher/PonyPatcher/AboutForm.cs b/contrib/patcher/PonyPatcher/AboutForm.cs new file mode 100644 index 00000000..d779d91e --- /dev/null +++ b/contrib/patcher/PonyPatcher/AboutForm.cs @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Reflection; +using System.Windows.Forms; + +namespace PonyPatcher +{ + public partial class AboutForm : Form + { + public AboutForm() + { + InitializeComponent(); + } + + private void AboutForm_Load(object sender, EventArgs e) + { + labelVersion.Text = string.Format("v{0}", Assembly.GetExecutingAssembly().GetName().Version); + } + } +} diff --git a/contrib/patcher/PonyPatcher/AboutForm.resx b/contrib/patcher/PonyPatcher/AboutForm.resx new file mode 100644 index 00000000..5757df9b --- /dev/null +++ b/contrib/patcher/PonyPatcher/AboutForm.resx @@ -0,0 +1,1516 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + mooege's focus is entirely on education, and we would like to keep it that way. + +Since any public and/or commercial use of this software is considered illegal +in many countries (please refer to your local law), the mooege team +will not provide any help nor support with such usage in any way. +Every user of this software is encouraged to make sure no law is being broken +in his/her country. + +The mooege team cannot take any responsibility for the use of this software +by end-users. + + + + + AAABAAQAgIAAAAEAIAAoCAEARgAAADAwAAABACAAqCUAAG4IAQAgIAAAAQAgAKgQAAAWLgEAEBAAAAEA + IABoBAAAvj4BACgAAACAAAAAAAEAAAEAIAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA365sA9+ubC3frmxX365sfN+ta5berGqo3qxpsd6s + abTerGm13qxpst6saq3erWuj365slN+ubILfrmxp365sSd+ubEvfrmx6365sld6saqveq2i83atozN6r + adneq2ng3atp492raOXdq2nk3qxp4N6ta9bfrmzB365soN+ubGffrmwdAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+u + bFrfrmzD361r+N2raf/erGr/4LBu/+K1c//kuHf/5bp5/+W6ef/luHf/47Z0/+Gycf/frmz/3ato/96s + av/frmz+365s99+ubP/frWv/5Ld2/+nBgf/sxYf/7siJ/+7Iif/txoj/68SF/+i/gP/luHf/4bFw/96s + av/dq2n/361r/9+ubObfrmxeAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADfrmxn365s/9+ta//frmz/6L+A//DOkf/11pn/99md//ja + n//425//+Nuf//jan//42p7/9teb//PSlf/tx4j/47Z0/9+tav/frmz+3axp/+zFh//53KD/+dyh//nc + oP/53KH/+dyh//ncoP/53KH/+dyg//jan//215r/8c6Q/+i+fv/frmz/3qxq/9+ubO/frmwZ365sBd+u + bBbfrmwt365sP9+ua1XfrWtm361qct+taoLfrWqP361qlt+tapjfrWqR361qgd+ta2zfrmtS365sKt+u + bAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+u + bK7frmv/361r//DMj//53aL/+Nug//janv/32Z7/99md//fZnf/32Z3/99md//fZnf/32p7/+Nuf//nd + of/32Z3/47R0/96sav/erGr/8c+S//jboP/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//ja + nv/426D/+dyh//LRk//is3L/3q1r/t+tasLfrWnO361q59+ua/ffrm3+37Bv/+Cwcf/gsXP/4bJ1/+Gz + dv/hs3f/4bN3/+Gzd//hsnX/4LBx/+Cvbv/frWr3361qxt+ubGHfrmwCAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA365sad6tav/is3H/99md//fanv/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//ncof/nvXz/3atp/9+sav/xzpH/+Nug//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+t6j/+zFhv/dqmn/4rR5/+O3 + f//kuYT/5LqI/+W8i//mvo3/5r2P/+a+kP/mvpH/5r+S/+a/kv/mv5L/5r+S/+a/kf/mvpD/5r2N/+S6 + h//hs3b/365r/9+ubF0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+ubAXfrmwP365sHt+u + bCvfrmxW3q1r+OCvbv/11Zn/+Nqf//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/+dyh/+rCgv/dq2j/3qxq//DNjv/43KD/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/53KH/68SE/96sbP/mvpH/5sCU/+a/kv/mv5L/5r+R/+a+kf/mvpH/5r6Q/+a+ + kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpH/5sCU/+W8jf/frmz/365sYwAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAA0JMACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADfrmwK365sKN+u + bEffrmxm365sht+ubKTfrmy3365szd+ubN/frmzs365r9t+ta/rfrWv+3qxq//HNkP/53KD/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/53KH/7siJ/92raf/dq2n/78uM//jc + oP/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//ncof/qwoL/3q5u/+a+ + kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+ + kP/mv5H/5buK/9+ubP7frmw8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQkwA00JMAnc+Q + AB0AAAAA4K9yDN+ubELfrmx9365sr9+ubNnfrmz1365r/9+ta//frWr/361q/9+tav/frWr/361r/9+u + bP/fr27/4LBx/+Cwcf/dq2j/68OF//ncof/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//jcoP/xzpD/3qxq/92raf/uyIr/+dyg//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/+dyg/+nAf//ernD/5r6R/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+ + kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a/k//juIH/361p4N+ubA8AAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTAAvQkwA/0JMAetCTAKbQkwC70JMAqtCTAIrQkwBN0JMADQAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTAArPkgDj0ZUN2t2qXo7gr3DW365s/t+tav/frWn/361p/9+u + a//fr27/4LBy/+Gzdv/itHv/47d//+O4g//kuof/5byL/+W9jf/mvpD/5byM/9+sav/luXj/+Nuf//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nuf//PSlf/frmz/3ato/+zF + hv/53KH/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/53KD/5759/+Cv + cv/mv5H/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+ + kP/mvpH/5r+R/+Cxcv/frWqXAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0JMADtCT + ACrQkwA40JMAYNCTALbQkwD/0JMA/9CTAP/QkwDU0JMAZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANOX + FLHeq2P/4K9w/9+tav/frmv/4LBx/+K0ev/juIH/5buI/+W9jf/mvpD/5r+S/+a/k//mv5P/5r+S/+a/ + kv/mv5H/5r6R/+a+kf/mv5L/4bJ0/+Cwbf/21pn/99qe//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/42p7/9taa/+Gxb//dqmj/6sGC//ncof/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//ncoP/nvHr/4LF0/+a/kv/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+ + kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a/k//jt3//361p+N+ubDIAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTAEXQkwDb0JMA/9CT + AP/QkwD/0JMArNCTABYAAAAAAAAAAAAAAAAAAAAA16I6nuCxdv/frWv/4bN4/+S7if/mvpH/5r+S/+a/ + k//mv5L/5r+R/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a/k//juIL/3atn//DN + j//426D/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/42Z3/47V0/92p + Z//ovX7/+dyg//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+dug/+a5 + ef/gsnf/5r+S/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+ + kP/mv5P/5LmF/9+ua//frmuNAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTACPQkwDV0JMA/9CTAP/QkwD/0JMAxtCTABcAAAAAAAAAAAAA + AADWmyeX4K9x/+CvcP/mvpD/5r+T/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+ + kP/mvpD/5r6Q/+a+kP/mvpD/5r+R/+a8jP/dq2r/6sGC//ncoP/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//jbn//munr/3Klm/+a6ef/426D/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/425//5bh2/+Gzef/mv5L/5r+S/+a+kP/mvpD/5r6Q/+a+ + kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mv5H/5r+T/+O4g//grmv/365rv9+ubA0AAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANCT + ACjQkwDl0JMA/9CTAP/QkwD/0JMAttCTAAYAAAAAAAAAAMyWEKLgrGT/4LBw/+a9jf/mvpH/5r6Q/+a+ + kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r+S/+Cw + dP/jtnT/+Nqe//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+dyg/+nA + gf/cqWf/47Z1//fanv/32Z7/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//jb + n//luHX/4bR8/+W8jf/kuYb/5r6R/+a/k//mv5H/5r6Q/+a+kP/mvpD/5r6Q/+a+kf/mv5L/5r+T/+W8 + jP/is3j/361q/9+ua77frmwZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTAA7QkwAJAAAAANCTAFPQkwD+0JMA/9CTAP/QkwD/0JMAfAAA + AAAAAAAAzJIBudyjQf/hr3D/47mD/+a/k//mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+ + kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mv5P/47eC/9+uav/01Jf/+Nuf//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/53KD/7MWH/92qZ//is3L/9tic//janv/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md/+O1dP/htX7/58CU/+O4g//hsnT/47eB/+W8 + jP/mvpD/5r+R/+a/kv/mvpH/5r2O/+S6h//itHr/4K5t/9+tavrfrmyP365sDQAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0JMAEtCT + AITQkwAkAAAAANCTAKfQkwD/0JMA/9CTAP/QkwD00JMAKNGTAAbUkQDgnKlC/9awcv/jsHL/5r6R/+a+ + kf/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a/ + kf/mvYz/3qxq/+7Iiv/53KD/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//jc + oP/vy43/3ato/+Cwbv/11Zj/+Nqf//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nv/32Z3/47Ry/+K2gf/mv5L/5r+S/+S6h//gsHH/361r/+CwcP/hsnX/4bJ3/+GxdP/gr2//361r/9+t + avHfrmuq365sPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0JMAX9CTAN3QkwAl0JMAHtCTAPTQkwD/0JMA/9CT + AP/QkwCW0ZMAOtOSAf1TuWT/lbl3/+uqZv/jt4H/5r+T/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+ + kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a/kv/fsHP/5rt6//ncoP/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nuf//LQk//frWv/361r//TSlf/425//99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99qe//fZnP/is3D/47eD/+a/kv/mvpD/5r+S/+W+ + kP/jt4D/4bBy/9+tav/frWr/361q1N+ua6Hfrmxm365sJQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADQkwAF0JMA3dGUAN3RlAAY0JMAktCTAP/QkwD/0JMA/9CTAOnWkQC8upoX/z7Bev9Hwn7/0LJx/+Wt + av/lvIv/5r+S/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+ + kP/mvpH/57+U/+O2gP/hsW7/9teb//fZnv/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/42p//9dWY/+Cwbv/eq2r/8c6R//jbn//32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/42p7/9tib/+Kxb//kuYX/5r+S/+a+kP/mvpD/5r6R/+a/kv/mv5P/47iD/9+tav/frmyBAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADRlQCDx4YO/9CSA8XRlQBG0JMA9NCT + AP/QkwD/0JMA/9qQAP+JqkD/OMSC/zfBef+G0af/57Bw/+Kvb//lvo//5r+R/+a+kP/mvpD/5r6Q/+a+ + kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r+T/+W8i//lu4j/5b2N/96tav/xzo//+Nyf//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fanv/22Jz/4rRy/92qZ//vyYv/+Nyg//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//janv/21pr/4bFv/+S6iP/mv5L/5r6Q/+a+ + kP/mvpD/5r6Q/+a+kf/mvpD/4LBx/9+ua9DfrmwHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAANOXAEDAfBr+p1g7/9abAKPRlQC60JMA/9CTAP/SkwD/zpQF/1S8bP88w3//Pr5z/1DT + of+33MP/5Klh/+Kwcv/lvpD/5r+S/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6R/+a/ + k//ku4j/4K9v/+S7if/mwJP/369y/+nAf//53KD/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//jan//luXn/3Khm/+zFhv/53KD/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/+Nqe//XVmP/hsW//5buK/+a/kf/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a/k//jtX3/361q/d+u + bDsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0JQAD9OXAt+ONVr/oE9C/NSZ + ANvRlQD/0JMA/9GTAP/UkgP/ZLZf/zrDgP9CwHn/P8B2/37w4/+92Lz/5Kdg/+OvcP/lvY7/5r+T/+a+ + kP/mvpD/5r6Q/+a+kP/mvpD/5r6R/+a/k//mvpD/4rZ9/96saP/is3b/5r+S/+a/k//itn//4rRx//fZ + nv/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+dyg/+i+fv/cqGb/6cCB//nc + oP/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/42p//9NSW/+Cwb//lu4v/5r+R/+a+ + kP/mvpD/5r6Q/+a+kP/mvpD/5r+S/+W7iP/frmv/365sfQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAA1psAnrFnLf9yDX3/olFB/9WaAP/RlAD/0JMA/9qQAP+eoy//OcSB/0LB + e/89vXL/XNKi/5f///+z3MP/361r/+WqZf/lt4P/5r6R/+a/k//mv5L/5r+T/+a/kv/lvY7/47iC/+Cv + bv/frGj/4bN2/+a9jv/mv5H/5r6R/+W8i//frWv/89GU//jbn//32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/53KD/68OF/9yoZv/nu3z/+Nyg//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//jbn//z0pX/4K9v/+W8jf/mvpH/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6P/+Cw + cP/frmu4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADSlgBJzI0I/4Up + Zf91Enj/tGop/9abAP/QkwD/05IA/8uVCP9QvG//PcN+/0HAef9Av3f/hOve/5f///+i7OL/ycWV/96u + a//lrGn/6LJz/+66eP/vunX/7Ldv/+Cvbv/frmv/4bN2/+S6h//mv5H/5r6R/+a+kP/mvpD/5r+R/9+v + cv/sxIT/+dyh//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//jcof/uyov/3Klm/+S3 + dv/32p7/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nuf//LRk//fr2//5r2O/+a+ + kf/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mv5L/4rN4/9+tauTfrmwTAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTAAjWnADTpVY8/3QRef+HK2L/zpAH/9KWAP/QkwD/2pAA/4Wr + Qv84xIP/QsF6/z2+c/9Yz5r/m/r+/5X7//+T+///oO7l/7Pew/+2xKr/nJSc/5qWoP+Jka7/z6d1/+a3 + fP/mwJX/5r+S/+a+kP/mvpD/5r6Q/+a+kP/nv5P/4rV+/+S3df/42p//99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/+Nug//LPkv/eq2n/4rNy//bYnP/32p7/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/426D/8c6Q/9+vcf/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a/ + k//jt4D/361q/N+ubDcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANOX + AHbHhhD/fyJr/3YTd/+sYTP/1pwA/9CTAP/VkQD/vpkT/0TBef8/wnz/QsF5/zy+cv975s//nvv//5b3 + //+U+v//k/3//5P8//9Flv//H2n//zh48v/SqXT/6LqB/+a/kv/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a/ + kf/lu4v/4LBu//TUl//325//99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/4257/9NSX/9+u + bP/gr27/9dWY//jan//32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//jboP/wzY//4K9x/+a+ + kf/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r+S/+S6h//frWr/365sVgAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0JMAG9acAOuhUUH/dRJ4/4YqY//MjQn/0pYA/9CT + AP/ZkAD/d7BQ/zjEg/9CwXr/Pr91/0zHiP+V9vb/mfj//5f3/v+X9/7/m/3//4zp/f80fPn/THnd/9+v + a//mu4X/5r+S/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a/kf/fr3L/7siJ//ncoP/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//janv/215v/4bFw/96tav/z0pT/+Nuf//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/+Nyg//DMjf/gsHL/5r6R/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+ + kP/mv5H/5byL/9+vbf/frmxuAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA05cAjsmIDv+BI2n/dhR3/6VWPP/XnAD/0JMA/9eRAP+5mhj/QcF8/0DCfP9CwXr/O71w/2jZ + s/+e+///l/f//5f3/v+X9/7/nv///3jW//9hiNL/4q5n/+W8if/mv5L/5r6Q/+a+kP/mvpD/5r6Q/+a+ + kP/mvpD/5r+T/+K0ff/nu3r/+dyg//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//ja + nv/jtnb/3apn//DOkP/43KD/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/43KD/78qL/+Cw + df/mv5L/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a/kf/lvY7/4K9v/9+ua4cAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQkwAl15wA8adZOv92E3f/fyBs/8WC + Ff/UmQD/0JMA/9qPAP92sFH/OMWD/0LBev9BwHj/QMB3/4Xr3/+c+v//l/f+/5f3/v+X9/7/l////6XX + zf/iqmb/5byL/+a/kf/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mv5H/5buJ/+GycP/215r/99qe//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+dyg/+e8fP/cqGb/7siK//jcoP/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//jcoP/tyIj/4LF3/+a/kv/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+ + kP/mvpD/5r6R/+W9jv/gr2//361rkQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAADSlgCRzZAI/4csYv92Enj/lUBR/9SaAf/RlAD/1pEA/72ZFv9DwXr/P8J8/0LB + ev89vnT/UcuQ/5j3+f+Z+P//l/f+/5f3/v+T/P//sOLK/+OqZf/lvIv/5r+R/+a+kP/mvpD/5r6Q/+a+ + kP/mvpD/5r6Q/+a+kP/mv5H/37Bz//DMjf/426D/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/53KD/6sKD/9yoZf/qw4T/+Nyg//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nyg/+zF + hf/gsXb/5r+T/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpH/5b2O/+Cvbv/frWuNAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTAB/WmwDqtGop/3kX + dP95F3T/sWkr/9acAP/QkwD/25AA/4CtSP83xYP/QsF6/0LBev87vXD/atm0/578//+X9///l/f+/5P8 + //+u38n/46pl/+W8i//mv5H/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a/kv/hsXf/6L59//nc + oP/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//jcoP/uyIr/3Khm/+i+fv/43KD/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/43KD/7MSF/96raf/lu4r/5r+S/+a+kP/mvpD/5r6Q/+a+ + kP/mvpD/5r6Q/+a/kf/lvYz/4K9t/9+ubHkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAANGUAHfUmAH/lD5R/3YUd/+DJmf/yYkO/9OYAP/UkQD/xpYN/0u+ + c/89wn7/QsF6/0HAeP8+v3T/f+jV/537//+X9/7/k/v//63hzf/jqmX/5buK/+a/kv/mvpD/5r6Q/+a+ + kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/9+wcP/isnD/99id//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/+Nyg//HOkf/dqWf/5rl4//jbn//32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//nc + oP/rxIX/3Kll/+G0eP/mv5L/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r+S/+S6h//frWv/365sXQAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0JMADNSY + ANHFgxT/fyBs/3YUd/+XQ07/1JoA/9CUAP/bjwD/laY2/zfEg/9CwXr/QsF6/z6/df9IxIL/kPLt/5v5 + //+T+///qeXU/+KrZv/luof/5r+S/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a/kv/lvIv/361s/96s + av/yz5H/+Nyg//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/42p//89OW/96ta//jtHP/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+dyg/+nCgv/isnD/365r/+W8i//mv5L/5r6Q/+a+ + kP/mvpD/5r6Q/+a+kP/mv5L/47eA/9+taf3frmw4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0JMAR9edAP2sYTP/dxV1/3gXdf+uZDH/150A/9KS + AP/VkgP/Yrdh/znEgf9CwXr/QsF6/zy9cf9Wzpj/mfj6/5b7//+i7OH/361q/+S4g//mv5L/5r6Q/+a+ + kP/mvpD/5r6Q/+a+kP/mvpD/5r+S/+O4g//gsG7/5rp6/+nAgf/53KD/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//janv/215r/4LFv/+Cwbv/21pr/+Nqe//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/43KD/6L59/+7Iif/jtXP/4bR7/+a/k//mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kf/hsnT/361q29+u + bA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA0ZQAldSYAv+VP1H/dhR3/34fbv/BfRn/1ZsA/9eQAP+6mhj/QsF6/z7Cff9CwXr/QsF6/zu9 + cP9k1qz/nPz//5z09P/Ys3X/5LR7/+a/k//mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mv5P/4bN6/+K0 + cf/yz5L/47V1//fZnf/32p3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//janv/jtXT/36xq//PS + lv/425//99md//fZnf/32Z3/99md//fZnf/32Z3/99md//jboP/nu3v/8c6Q/+7Jiv/erW3/5r6P/+a+ + kf/mvpD/5r6Q/+a+kP/mv5L/5LqG/9+ta//frmyWAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQkwAR05gA08mJD/+EJ2b/dhR2/4ku + YP/Njwr/0pcA/9uPAP+Tpzn/N8SD/0HBev9CwXr/QsF5/zu8cf9s3Lv/m/7//86/jP/lr2//5r+T/+a+ + kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a/kf/gsHP/5Lh2//jcoP/jtnX/8s+S//jboP/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/+Nyf/+a6ev/cqmj/8c6R//jboP/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/+Nuf/+W6ef/yz5P/99id/+CvbP/kuYb/5r+S/+a+kP/mvpD/5r+R/+a+kf/hsXL/361q+9+u + bDYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAADQkwA51psA9LhxJP96GXL/dhR3/5dDTv/UmAH/05QA/9eQAf9ts1f/N8WD/0LB + ev9CwXr/QcB4/zy+cv9p48P/wtS2/+arZ//lvo//5r+R/+a+kP/mvpD/5r6Q/+a+kP/mvpH/5r2P/9+t + bv/ovn3/+t+k/+rBgv/qwYL/+dyg//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/53KH/6cCB/9yo + Zv/uyYv/+Nyg//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32p7/5rt8/+7Jg//xz4T/57t8/+Gz + ef/mwJP/5r6Q/+a+kf/mv5L/4bN5/9+taf/frmyfAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQkwBq1pwA/6dZ + Ov93Fnb/dxZ1/6VWPf/WnAD/1pIA/8mVC/9UvGz/OsSB/0PBev9CwXr/QcB4/zjBeP93yZT/5K1q/+S5 + hf/mv5L/5r6Q/+a+kP/mvpD/5r6Q/+a/kf/lvY3/3qxq/+vDg//63qP/8tCS/+S3dv/32p7/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//ncoP/txoj/26hl/+vDhP/53KH/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fanf/ovoP/3qxG/+vDav/uyY7/3q5v/+a+kv/mwJP/5b6P/+KzeP/frWn/365s2d+u + bBkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADRlQCS1ZkB/5lGTP93FHb/eRhz/65jMf/XnQD/2JAA/7qa + Gf9HwHf/PMN//0LBev9CwXr/QMF5/zvAd/++sW3/6rJ1/+a/kv/mvpD/5r6Q/+a+kP/mvpD/5r+S/+W8 + i//erGn/7MaH//ncof/32Z3/5Ld2//LSlP/425//99md//fZnf/32Z3/99md//fZnf/32Z3/+Nyg//DM + jv/cqGb/6L5+//ncoP/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99qh/+O2cf/PkAn/7MZw//TT + mv/erGr/4bJ1/+K1e//gsHL/361q/9+ubMffrmwqAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANCT + AAfTlwCx0JMH/483Wf92FHb/ehpx/7ZtKP/XnQD/2pAA/66eI/9BwXz/PMN//0LBev9CwXr/OMJ7/3O7 + df/qrGr/5bqI/+a/k//mvpD/5r6Q/+a+kP/mv5L/5LuJ/96raP/uyYr/+Nyg//ncoP/pwYH/68SF//jc + oP/32Z3/99md//fZnf/32Z3/99md//fZnf/425//89GU/96raf7kuXf++Nuf//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/53Kb/3apH/8yLAP/qwWn/99mi/+Cvbv/frGmp361qj9+ta4HfrmxM365sCAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTABLUmQDCyosO/4guYP92FHb/fR1v/7hy + I//WnQD/248A/6mgJv9CwXr/O8OA/0PBev9BwXr/OsJ7/6+zb//tr3H/5b6Q/+a/kf/mvpD/5r6Q/+a/ + kv/kuoj/3qto/+7Ki//43KD/+Nug//HOkf/muHn/+Nuf//fZnf/32Z3/99md//fZnf/32Z3/99md//ja + n//11Zj/4K9u/+K0cv/32Zz/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nuh//XVlP/TmRX/y4sA/+Cw + RP/53ab/4rNz/96ta2MAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAANCTABnVmgDIx4YS/4YqY/92FHf/fh5t/7hxJP/XngD/25AA/7CeIP9LvnL/OMWC/0PB + ev89wnr/S8B6/8qwa//ssXX/5b6R/+a/kv/mvpD/5r+S/+S6iP/eq2j/7sqL//jcoP/32p3/9tic/+S2 + df/005b/99uf//fZnf/32Z3/99md//fZnf/32Z3/99qe//bXm//luHj/5LZ2//TUl//42p//99md//fZ + nf/32Z3/99md//fZnf/63aj/5rpQ/714D/+uYij/26Qa//fanf/kuHj/3qxqjwAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTABnWmgDEx4US/4cr + Y/92E3f/fBxv/7NqLP/XnQD/2pEA/8KXE/9ktl//N8WE/z/Cff86wnv/U794/8mwbP/vsHP/57yL/+a/ + k//mwJT/5byL/96raf/uyIr/+Nyg//fZnf/53KH/6b+A/+zGh//43KD/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md/+nAgf/qwYP/8c+S//jbn//32Z3/99md//fZnf/32Z3/99qf//bXmf/ZoxD/qFwv/400 + Wf/TmAH/8c+E/+e9gP/dq2igAAAAAAAAAADfrmwL365sId+ubDnfrmxQ365sX9+ubHLfrmuA361rg9+t + a4PfrWt4365sYt+ubEXfrmwaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0JMAAdCT + AAwAAAAAAAAAAAAAAAAAAAAAAAAAANCTABXVmgC1yIgR/4swXf91E3f/ehly/6ldOP/VmwD/2ZQA/9SR + Av+PqDz/RMF4/zjEgv84w33/ScB5/6O1cP/gr23/7rN7/++4h//ttoD/3qtp/+zFh//53KD/99md//nc + oP/wzY//5rp5//jcn//32Z3/99md//fZnf/32Z3/99md//fZnf/32p7/7MWH//HOkf/wzY//+Nuf//fZ + nf/32Z3/99md//fZnf/63ab/7cd0/9KWAP+WQU3/extw/8WCCP/qwVv/6b+G/9+ubNHitHSP4LBvud6t + a9fdq2nv3qtp/N6ta//frmz/369t/+Cvbf/gr23/4K9u/+Cvbf/erGv/3atp/96raenfrWuj365sKQAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0JMAPtCTAGnQkwADAAAAAAAAAAAAAAAAAAAAANCT + AAvVmgCbzI0M/5M9Uv92E3j/dxV2/5tJSP/NkAn/15oA/9uQAP++mRb/dLFS/z/BfP8zxYP/NsN+/1m+ + d/+HuHL/oLVw/6W1cP/Zq2n/7MKD//ncoP/32Z3/99md//bYnP/kt3b/9NSY//fanv/32Z3/99md//fZ + nf/32Z3/99md//fanv/wzY//9dea//PSlf/32p7/99md//fZnf/32Z3/99md//reqP/kt0z/yokA/4cr + Y/93E3f/r2Qk/+KxLf/ovYH/5Ld3//fbn//11Zj/8s+T/+3Iiv/nvXz/4LBv/92qZ//hsnD/8tCS//XV + mP/01Jf/9NOW//HPk//uyoz/5719/9+ubP/frWvj365sKQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADQkwAD0JMAjtCTAMTQkwBEAAAAAAAAAAAAAAAAAAAAAAAAAADTmAB50pYD+6RVP/96GHP/dBF5/4ku + X/+8dx//1pwA/9mVAP/YkAD/tZsc/3SxUf9FwHb/McWB/y/EgP8xw3z/M8J7/8KubP/uvHz/+Nyg//fZ + nf/32Z3/+dyg/+i/f//tyIn/+dyg//fZnf/32Z3/99md//fZnf/32Z3/99md//bXm//32Z3/99ic//fZ + nf/32Z3/99qf//fZnv/32Z3/+t2l/+CuMv+8dxL/fR1v/3kXdP+XQ0n/2KAL/+K0bP/luXv/+Nyg//ja + nv/425//+Nyg//ncoP/11pr/6sKC/92qaP/nvX3/+dyg//jan//425//+Nuf//jcoP/53aL/8MyO/9+u + bP/frWuNAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQkwAG0JMAu9CTAP/QkwC20JMAVNCT + AA8AAAAAAAAAAAAAAADSlQBG15wA2blzI/+ILWH/dBB4/3YUcf+YQkb/wX8R/9GTAP/XkAD/2ZAA/8KZ + Fv+VqT3/bLZf/1C+df9Vvnf/wq9r/+q2df/42p7/99md//fZnf/43KD/8MyO/+e8e//526D/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//janv/01JP/9tic//fZnv/32qD/3Kgh/7hx + G/94F3T/extx/4UoZP/Liwb/26ZH/+i+g//53KD/99md//fZnf/32Z3/99md//jbn//63qL/7MSF/92q + aP/y0JL/+Nuf//fZnf/32Z3/99md//fZnv/425//47V0/96saqEAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAADQkwAU0JMAztCTAP/SlQD/1JgA3NGVAJvQkwBd0JMAM9CTABDQkwAs1ZoAwM2O + A/+lVz3/jzht/51Nc/+5dWP/2KNN/9uoVv/dql3/46xf/+ioWv/jqFv/2rBs/+G0cv/jr23/4LBu//XW + mf/42p7/99md//fZnf/215z/5LZ1//TUl//42p7/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/+dyl/+nBav/uynz/+d2l//fZnf/Xnx7/0ZQB/6NVPf94FnX/ehly/7hxHP/ZoSP/68SJ//nc + oP/32Z3/99md//fZnf/32Z3/99md//jbn//01Jf/3qtp/+zHiP/43KH/99md//fZnf/32Z3/+Nuf//XW + mv/hsXD/3q1rcwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQkwAh0pUA18OA + FP+5cyH/zpAG/9SZAP/WmwD61pwA7NOXAN3Qkwjl2KIz/+CuVP/is23/68J4/+7IhP/uyY//8c+W//PS + l//jtnf/3axr/+rAgv/41Zn/+dqe//DLjv/dqmj/8c6Q//jboP/32Z3/99md//janv/wzI//9daZ//ja + nv/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/63qf/5rpb/96uQ//636n/99md/9ae + H//QkgD/1ZkA/5hETP9yD3z/oVE8/9abCP/uyIj/+dyi//fZnf/32Z3/99md//fZnf/32Z3/+d2h//HN + kP/dqmf/78uN//jcoP/32Z3/99md//jbn//53KD/6L5+/96raeXfrmwcAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADRlQAkzpAJ16BPQ/+CJWj/kTtV/6FRQf+oWTT/uHEv/96r + WP/jtHn/7smN//bXmf/425//+dyg//jcoP/63qL/68OE/9ypZv/tx4n/+dyh//jbn//425//9daa/9+t + bP/pwYL/+Nyh//fZnf/32Z3/99md//jbn//32Z7/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//rep//nvWH/0JQN//XWlv/53KP/16Ek/86QAP/TmAD/zY8K/4MmaP+JLl7/z5EA/+7I + eP/53aX/99md//fZnf/32Z3/99md//jbn//215v/4rNy/+Gycf/32Jz/+Nqe//jan//53aH/9taa/+e7 + fP/dq2ni365sPQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADRlQAi1ZoAy7JpLf+BI2n/cQ59/3ALeP+5dnP/57pz//TTlv/53aL/+Nqf//fZnf/32Z3/99qe//TU + l//erGr/57x8//ndof/32Z3/99md//fZnf/43KD/5bp6/+Gzcf/32Z7/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+d6n/+nAZf/LigD/57xe//zi + r//bpzL/zo8A/9CTAP/WnAD/tW0o/3oYc//AfA3/5rlM//reqf/32Z3/99md//fZnf/32p7/9dWY/+Ky + cP/dqmf/89GU//rdov/32Z3/89KW/+rBgv/frWv/3Khl/96racjerGmL3qxplN6sao/erGqL3qxqh96s + aoPerGqA3qxqfd6sannerGp23qxqdd6sanLerGpx3qxqcN6sanDerGpx3q1qc9+ta3ffrWuA365sXt+u + bBgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQlAAV1pwAqM2OCv+nWTf/hy1j/9CY + bP/pv3n/+dyh//fZnf/32Z3/99md//fZnf/43KD/78qM/9yoZf/vyoz/+dyh//fZnf/32Z3/99md//jc + oP/vy4z/3apn//LPkv/43KD/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/53af/6sJr/8yMAP/Wnhv/+t6n/+CwRP/NjgD/0JMA/9GUAP/UmQH/jzdZ/6hb + Lv/dqB3/+Nug//fZnv/32Z3/99md//fZnf/32Jz/78qL/+Kzcv/luHj/9NSW//XWmv/rxIX/5719/+e9 + fv/nvX3/57x8/+a6ev/muXn/5bh4/+W3d//ktnb/5LZ2/+S2dv/ktnb/5LZ2/+S2dv/ktnX/5LZ1/+O2 + df/jtXT/47V0/+O0c//is3L/4bFw/9+vbf/erGr/3qxq3t+ubEkAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAA0pYAcdabAO3Mjgj/2qVc/+Kzdf/11pn/+Nyg//fZnf/32Z3/99md//jc + oP/wzZD/3Klm/+vDhf/53aP/99md//fZnf/32Z3/99me//fYnP/gsG7/57x8//ncof/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//ndpf/sxXP/zo8A/82O + AP/qwmz/6cBn/82OAP/QkwD/0JMA/9WZAP+3cST/lkFM/9SZAv/xzoX/+dyj//fZnf/32Z3/99md//fZ + nf/53KH/9tic/+i9ff/erWv/7caI//reo//53aL/+Nug//jboP/426D/+Nuf//jbn//42p7/99qe//fa + nv/32Z7/99me//fZnv/32Z7/99me//fZnv/32Z7/99md//fZnf/22Z3/9tic//bXm//11pn/9NSX//HP + kf/muXn/36xq4t+ubBUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAz5EALNCT + AKPWnCf1361w/+a6e//32Jz/+d2h//jbn//32Z3/99qe//janf/kt3b/3axq//LQkv/43KD/99md//fZ + nf/32Z3/+dyh/+vEhf/dq2j/9NSX//jbn//32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/+d2k//DLgf/PkgH/zpAA/9SbGf/pwGj/0JMF/9CTAP/QkwD/0JMA/9GU + Av+dSkb/x4YD/+i8Wv/63qf/99md//fZnf/32Z3/99md//fZnf/42p7/+d2h//DMjv/frWv/5rt6//fZ + nf/426D/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99me//fZnv/32p7/99qe//janv/425//+t+j/+7Ki//dq2n8365sKwAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM+RBCbUmyRy3qxpxeKzcvftyIn/9NWX//fZ + nf/42p7/+Nqe//bYm//luHj/3apn/+zGh//42p//99md//fZnf/32p7/9teb/9+ubP/ovn7/+dyg//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/42qD/9taY/9Sa + FP/PkQD/z5EA/9OZEf/RlQX/0JMA/9CTAP/QkwD/1ZkA/7VsKP+6dBb/3qst//nco//32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/+d2h//XVmP/itHL/4rNy//XVmf/43KD/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fa + nv/53KH/5rt8/96sas3frmwIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgr3EE4LB0COCw + cxDerWgc3atjJtehPjTerGhm3app1dyoZv/erWv/47Z1/+vCg//005b/9tea/+S2df/nvHz/9dWZ//ja + nv/32Z3/99md//fZnf/53KH/7ceH/92qaP/z0ZP/+Nyg//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/63qj/4K9F/82OAP/QkwD/z5EA/9CTAP/QkwD/0JMA/9CT + AP/SlQD/yYkM/7t2Gv/Vmwr/9NOQ//jbof/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nuf//fZ + nf/lunr/4K9t//TTlv/43KD/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/425//+Nyg/+vEhP/eq2n9365sTwAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+ubAffrmwh365sO9+t + a1ferWtt3qxqiN6saZ3eq2mq3atput6raMjdq2jT3atp396sa+/erGz44K9y/uGxcP/ktnb/6L9//+3I + if/y0JP/99md//PSlP/gr23/6cGB//jcoP/425//99md//fZnf/32Z3/99md//fanv/42p7/5LV1/+O1 + dP/42p7/+Nqe//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//nc + pP/wzIH/z5ID/8+SAP/QkwD/0JMA/9CTAP/QkwD/0JMA/9CTAP/QkwD/y40G/86PAP/sxXP/+d2m//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nqf//jcoP/nvX3/365s//PUl//426D/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/425//+d2h//TV + mP/nu3v/3qtp+N+ubGoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA365sK9+ua2zerGqn3qtp0d6rafDerWr9369t/+GycP/jtHT/5bh4/+e8fP/ovn//6cGC/+vD + hP/sxYf/7ciJ/+/Ljv/z0pT/9tea//janv/53KD/+Nyg//reo//z0pX/361r/+rCgv/53aH/99qe//fZ + nf/32Z3/99md//fZnf/32Z3/99md//ndov/uyYr/3Khl/+rCgv/53aH/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//ncpP/bpi//zo8A/9CTAP/QkwD/0JMA/9CT + AP/QkwD/0JMA/9CTAP/RlAD/zo4A/+GyT//63qf/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99qe//nboP/munn/4bFv//bYnP/42p//99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//janv/43KD/+Nyg//TUl//qwoP/4K9t/92raczfrmxDAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA365sLd6ta6vdq2n04K5t/+S2df/pv4D/7ciJ//HP + kf/005b/9teb//fZnf/425//+dyg//ncoP/53KD/+dyg//ncof/53KH/+Nyg//jbn//42p7/99md//fZ + nf/43KD/9NOW/96ta//ovn//+d2h//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/425//9NKV/+Gw + b//erWvT3qxp/u7Ki//53aH/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/+d2m/+zEcv/OkAD/0ZIA/9OSAP/QkwD/0JMA/9CTAP/QkwD/0JMA/9CTAP/PkQD/1p4w//PT + m//425//99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nqf//fZnf/isnH/5bt6//jc + oP/32p3/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nuf//ncof/526D/9tea/+/Ljf/nvHv/4K9s/92r + aNjerWtw365sDQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+u + bDjerGro4LBu/+vEhf/005b/+Nqe//jcoP/43KD/+Nug//jbn//42p7/99me//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nuf//bXmv/gsG7/5bh5//jbn//32p7/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99me//jbnv/kt3f/3qtp29+ubBjerWua3q1r/+/Ljv/426D/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/42p//+Nug/9qhI//FkgT/wpgQ/9iQ + AP/QkwD/0JMA/9CTAP/QkwD/0JMA/8+RAP/UmiXk5rt/+fjboP/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/+Nyg//LRlP/dq2j/78qM//ncoP/32Z3/99qe//jbn//53KD/+dyg//fa + nv/005b/7smK/+e8fP/hsm//3axp9d6sabferWte365sEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3q1rr+Cwbv/z0pX/+d2i//jbn//32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fa + nv/43J//5Lh3/+Cxb//32Jz/+Nuf//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/53KD/7sqM/92r + aP/frmxlAAAAAN+ubAverWuy3q5s//PTlf/425//99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/63qj/68Bp/82PAP90sVL/sp0e/9qQAP/QkwD/0JMA/9CTAP/QkwD/0JIA/9SZ + HKDerG2w8MyO//ncoP/32Z3/99md//fZnf/32Z3/99md//janv/32Z3/99md//fZnf/32Z3/+dyh/+e8 + fP/isnH/99qe//fYnf/11pr/89KU/+7Ji//pv3//47V0/+CubP/dq2ns3qtptt6ta3LfrmwsAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADerWu+4bBv//XVmf/43KH/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+d2h/+3HiP/cqmf/8c+S//ncof/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//janv/ktnX/3qxp1d+ubAoAAAAAAAAAAN+ubBHdqmjc7ciJ//nc + of/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//jaoP/32Z7/35oX/5yg + Kv9DwXn/vJkW/9iQAP/QkwD/0JMA/9CTAP/QkgD/0ZUJmd6tbD7jtXX899me//fanv/32Z3/99md//fZ + nf/21pr/9NSX//jcoP/32Z3/99md//fZnf/53KD/8c+S/96raP/z0ZP/9teb/+a6ef/dqmj/3apn796r + aanerGp/365rTt+ubB4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+ubHferGr/47V0//XVmP/53aH/99qe//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//jb + nv/11pn/3q1r/+m/f//53KH/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/43KD/8c+R/96t + av/frmxxAAAAAAAAAAAAAAAAAAAAAN6raa3ovn//+dyg//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//reqP/pvF7/z44A/1G8bf9OvXH/ypYM/9WRAP/QkwD/0JMA/9CT + AP/QkgOgAAAAAN6sb7Lsx4f/+dyg//fZnf/32Z3/99md//janv/qw4P/7ciJ//ncoP/42p//99md//fa + nv/215r/369s/+zGh//53aL/9tib/+zGh//hsG/v3atoid+tayEAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA365sDt+ubLzerGn/4LFu/+7Jiv/32p7/+d2h//janv/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+dyg/+rCg//erGr/9dWY//jbn//32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//ncoP/ovn//3qtp7t+ubB4AAAAAAAAAAAAAAAAAAAAA3qxqhOS2 + dP/42Z7/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nuh//XX + l//dlQ3/kqUz/yzIjP9stFj/1pAB/9GSAP/QkwD/0JMA/8+RAJcAAAAA365yOuGxb/r21pr/+Nqe//fZ + nf/32Z3/+Nqf//bXmv/hsW//57x8//bWmv/53aH/99uf//bYnP/gsG7/68SF//jcof/32p7/+d2h//XW + mf/ov3//3qxq896raabfrmxB365sAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA365sE9+ubJ7erWr/3atp/+O1 + dP/tyIr/9daa//jcoP/43KH/+Nuf//janv/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//ja + nv/22Zz/4LBv/+e+ff/53aH/99md//fZnf/32Z3/99md//janv/215r/99md//fZnf/32p7/9teb/+Gy + cf/frGurAAAAAAAAAAAAAAAAAAAAAAAAAADfrWtX4K9t//XVmP/425//99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+t6p/+eySf/Akgb/R8B2/zTFhf+Vpjb/248A/9CT + AP/QkwD/0JMAigAAAAAAAAAA3qtqqerBgv/53aH/99md//fZnf/32Z3/+dyg/+/Ljf/cqGb/4LBv/+zG + iP/42p7/9dSX/92saf/uyov/+dyg//fZnf/32Z3/+Nuf//ncof/y0JP/5bh4/96sav7dq2m+3q1qX9+u + bBIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+ubEffrmyx3qxq9t2raf/gsG//57t7/+3Iif/y0JP/9tea//ja + nv/425//+dyg//ncoP/43KH/+Nyh//jcoP/426D/+Nyg//PQk//dq2n/8M6Q//jcoP/32Z3/99md//fZ + nf/53KH/78qM//LRlP/42p7/99md//jbn//wzY//3qxq/9+ubF4AAAAAAAAAAAAAAAAAAAAAAAAAAN+u + bDPdq2n78M2P//jcoP/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99qe//fa + nv/53aT/8c6F/9iQAP9uslP/NcWF/0e/df/BmBL/1pEA/9CTAP/QkwBzAAAAAAAAAADfrm4y365s9/PT + lv/425//99md//fZnf/32p7/99ug/+W5ef/frWv/4LBu/+Cxb//isnD/4K9t//XWmf/32p7/99md//fZ + nf/32Z3/99md//jcoP/425//8dCS/+nAgP/isnD/3atp3d6saYnfrWszAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADfrmwr365sb96ta7Deq2nf3atp+t+ta//hsnD/5Ld2/+a8e//pwYH/68SE/+3Gh//tyIn/7ceI/+zF + hv/215r/78uN/96ua//11Zn/+Nqe//fZnf/32Z3/+d2h/+zHiP/nvHv/+Nuf//fZnf/32Z3/+dyg/+m/ + f//dq2nv365sHwAAAAAAAAAAAAAAAAAAAAAAAAAA365sEd2raOHrxIT/+dyh//fZnf/32Z3/99md//fZ + nf/42p7/+Nug//jcof/53KD/+Nuf//fZnv/22Jz/9tib//bYnf/426L/46Aj/5ueJP8vxYH/LsWD/2yz + Vf/YkAD/0ZMA/9CTAF4AAAAAAAAAAAAAAADdq2ie5rt7//jcoP/32Z3/99md//fZnf/425//8tGT/9+t + a//uyYr/7ceJ/+S4d//uyYv/+duf//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/425//+dyg//bX + nP/vy43/5rp6/9+ubPndqmi63q1qYd+ubBUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+ubA/frmwz365sVt6t + a3TerGqR3qtpod6raardq2ii3atpr9ypZvvdqmf/68OD//jboP/vyoz/4K9u//bYm//42p7/99qe//nd + of/tyIn/3qtp//LQk//426D/99md//fanf/32Z3/4rRz/96sar0AAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADfrmwB3atpvua6ef/43J//99md//fanv/43KD/+dug//XWmv/wzY//6sOD/+e7e//ktnb/4rNy/+Gx + cP/hsW//4LFv/+KzdP/gql7/0aRL/5C1cP9tu3b/RcJ//6KgJf/WjwD/z5IARwAAAAAAAAAAAAAAAN+t + bCneq2nz8c2Q//jcoP/32Z3/99md//fZnf/53KH/5rt7/+GxcP/425//+dyh//jbn//32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nqe//jcoP/426D/9NOW/+rBg//hsnD/3ato4t6s + apHfrmw2AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+tayvdq2i147R0/vLQ + k//53KH/+Nyg//LRkv/frWv/9NOW//ncof/43KD/68SF/9ypZ//luXj/+Nyg//fZnf/32Z3/+Nuf//LR + lP/frWv/365sgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADerWqY4rJx//fYnP/53KH/+Nmd//DL + jf/luXn/365s/9+ubP/jtXT/6L5//+zFhv/uyYv/8MyO//DMj//vy47/7cmK/+zGiv/swIX/77Z1/+iu + bP/Prm7/v6xg/9aZI/rVnSsyAAAAAAAAAAAAAAAAAAAAAN2sapHjtnX/99qe//fanv/32Z3/99md//jb + n//z0pb/3apo/+vEhf/43KH/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/425//+d2h//bXm//uyIr/5LV1/96safnerGmy365sTN+ubAIAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAN+ubBPdq2mA361s7uvDhP/32Z3/+dyg//fZnf/32p7/99md/+Kycf/qwYP/99qe/+e9 + ff/dqmf/3qxp//DLjf/43KD/99md//fZnf/53KH/7caH/92raf/frmxHAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAN+ubGrfrmz/89GT/+/Kjf/hsXD/3apo/+S4d//uyYv/9dWZ//jan//63qP/+t+k//rf + o//636T/+d2i//jcoP/43KD/+dyg//ncoP/42p7/9dSY//HHif/quHv/365u/t+tcMvfr3BYAAAAAAAA + AAAAAAAA365sIN2raeztx4n/+dyh//fZnf/32Z3/99md//ncof/munr/4K9t//bXm//32Z7/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nqe//nc + oP/32p7/8M2P/+a5ef/erGr/3qxpwd+ubFEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+ubAnerWtm3ato2eW4d//z0ZT/+dyh//fa + nv/32Z3/99md//fZnf/53KD/78qN/96saf/fr23/3q1r/+a7e//itHL/99ic//jZnf/32Z3/99md//jb + oP/munr/3qtp6d+ubBcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA365sON+ubP3gsW//3apn/+W5 + eP/y0ZT/+Nyg//jcoP/425//+dyg//PRlP/rxIX/6b+A/+zFh//z05b/+dyg//fZnf/32Z3/99md//fZ + nf/42p//+Nyg//fan//xz5L/5bd4/92raP/erWuz365sJgAAAAAAAAAA3qxqg+GxcP/215v/+Nqe//fZ + nf/32Z3/+Nyg//DNj//dqWf/7smK//jcoP/32p7/+Nuf//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fanv/426D/+Nuf//HPkf/munn/3qxq/96s + abrfrmw+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADfrmxR3atpyd+vbf/sx4f/+Nqe//jboP/32Z3/99md//fZnf/32Z3/99md//fZnf/43KD/6cCB/+W4 + eP/01Jf/5rt6/+i+fv/43KD/99md//fZnf/32p7/9teb/+GycP/frWu8AAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAADfrmxo3atp/OCwbv/vy43/+dyg//jbn//32Z3/99md//jboP/qwoL/4bJw/+e8 + fP/qwYL/5rx8/+Gycf/qwYP/+Nqf//fZnf/32Z3/99md//fZnf/32Z3/99md//jcoP/42p//7MaH/9+u + a//erGri365sSQAAAADfrmwV3apo5erBgf/53aH/99md//fZnf/32Z3/9tic/+Cwb//munr/+d2h//PT + lv/wzY7/+dyh//jan//32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/+Nug//jcoP/xzZD/47V1/92raPnfrWuI365sCQAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADfrmxA3qxquN2raf/nu3v/9NSY//ncof/32p7/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/425//+d2h//XVl//erGn/8s+R//jcoP/32Z3/99md//jb + n//yz5H/3qxq/9+ubIYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA365sd92raP7kt3f/9dWZ//nc + of/32Z3/99md//fZnf/426D/7ceJ/+a7fP/215v/+d2h//ncof/53aH/9taa/+e8fP/sxIX/+Nug//fZ + nf/32Z3/99md//fZnf/32Z3/99md//rcn//+4aX/9dOV/+GycP/erGn1365sWgAAAADfrWt0361r//PS + lf/425//99md//fZnf/43KD/5rt7/+GycP/42Z7/9tic/+Kzcv/nvX3/9taa//ncof/32p7/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//nc + of/32Z7/7MWH/9+ubP/erGq4365sFwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADfrmwo361rod2q + aP3isnH/78uN//jcoP/425//99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/53KH/68KE/+Cwbv/22Jz/99md//fZnf/32Z3/+dyh/+zEhv/dq2n/365sTgAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAN+ubHPdq2j/5rt7//fZnf/426D/99md//fZnf/32Z3/99qe//bXm//qw4P/99qe//jb + n//32Z3/99md//fZnf/42p7/+Nuf/+zGh//11pr/99me//fZnf/32Z3/99id//rbnv//5qb/99ue/+jN + lP/02p///+Gh/+m5dv/dq2n4365sTd+ubAXdq2nZ5bp6//ncoP/32Z7/99md//jcoP/qw4T/369t//bX + m//53aH/78qN/9ynZf/hsW7/7MaH//fYnP/53KH/+Nuf//fanv/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fanv/53aL/89GU/+Kycv/erGq7365sCgAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAADfrmwO365se96saeverGr/6b+A//bXm//53KH/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//jbn//jtXX/5rp6//ncoP/32Z3/99md//fZ + nf/425//5bp6/96rae7frmwdAAAAAAAAAAAAAAAAAAAAAAAAAADfrmxU3ato/OW6ev/42p//+Nqe//fZ + nf/32Z3/99md//fZnf/42p7/9NSX//PSlf/53KD/99md//fZnf/32Z3/99md//fanv/53aH/99md//bX + m//32Z7/99md//fZnf/63Z7//OCg/5SGYf83MST/GRcQ/ywnHf90ak7/3cOK/++9eP/erGrs365sId+u + bFnerGn/7ciK//ndof/426D/+d6i/+rBgf/hsnH/99qe//fanv/43KD/6cB//9ypZv/dq2j/47Ny/+zF + hv/z0pb/9tmd//jcoP/53KD/+Nug//jan//32Z7/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/43KH/9NOX/+Gxb//frWtyAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA365sSd+ta83dq2j/4rNz//HO + kP/53aH/+Nqe//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fa + nv/32p7/9daa/9+ubP/rxIX/+dyg//fZnf/32Z3/+Nqe//bXmv/hsXD/361rv9+ubAEAAAAAAAAAAAAA + AAAAAAAA365sJt6raerjtXT/99mc//7go///4qP//t+h//janf/32Z3/99md//fanv/115r/9tic//bX + mv/22Jz/99md//fZnf/32p7/9dSX/+rBg//215r/+Nqe//fZnf/32Z3/+duc//vcp/9uWln/AAAA/wAA + AP8AAAD/AAAA/wAAAP8gHxj/r5do/++7df/frmvG365sDd+ua8jerGr/5719//LQk//z0ZT/4K9t/+vC + g//53KD/99md//janv/42p7/5rt7/92qZ//erGrQ3atptt+ubPfitHP/5rx8/+zFh//xzZD/9NSY//fZ + nf/425//+dyg//ncoP/426D/+Nuf//janv/32p7/99qe//fZnv/32Z7/99qe//jbn//736T/6L19/92r + adsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA365sE9+ubJTerGr/3qxq/+nBgv/22Jz/+dyg//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/42p//9NWY//bXmv/z05b/3qxp/+7KjP/43KD/99md//fZ + nf/425//8s+S/96tav/frmyCAAAAAAAAAAAAAAAAAAAAAN+ubAPerWu3365s//nYmf//56j/4seQ/8q1 + gv/exY///+Ol//7gov/32Jz/99md//fanf/22Jz/5bl5//LQk//425//99md//fZnv/32Z7/6cCB/+zG + iP/43KD/99md//fZnf//4p3/z6+y/wQAF/8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8LCgj/pYZX/+24 + cv/frmxy365sRN+ua//erWv/4bJw/+Kzcf/nvX3/99ic//janv/32Z3/99md//janv/32p7/6L5//92r + aOverWto365sKN6samndq2mq3ato296savrgr27/47Vz/+a7ev/qwoL/7siJ//HNkP/z0ZX/9dSY//bX + mv/22Jz/99md//fZnf/215v/9NSY/+3Hif/gsG//3q1r3wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+ubDrfrmzR3ato/+Kzcf/wzpD/+d2h//ja + nv/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nug//XW + mf/rxIX/+Nue//PSlf/dq2n/78uN//jcoP/32Z3/99md//ndof/sxYb/3qtp/t+ubD8AAAAAAAAAAAAA + AAAAAAAA365sXd2qaP/30ZD/6NOb/2leRP8VEg3/BQQD/xEPC/9eVD3/3smR///kpf/32J3/99md//bY + nP/z0pX/99md//fZnf/32Z3/99md//fZnv/32Z3/9NWZ//fanv/32Z3/99ma///itf+Xhan/AAAA/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8RDgn/xJpf/+i1cO/frmwj365rrOCwbv/y0ZT/99qe//jb + oP/32p7/99md//fZnf/32Z3/99md//janv/43KD/7ceI/9+ta//erGp+AAAAAAAAAADfrmwM365sMd+t + a1PerGp13qtpm92rabfdq2nQ3qxq5d+ubPXgsG794bJw/+O0c//jtXT/47V0/+Kzcf/gr23/3qtp/N+t + a9XfrmxQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADfrmxl361r8t2qaP/nvHv/9teb//jcof/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//ncof/115r/47V1//DMjv/53aH/9NWY/96sa//sxYb/+t2i//fZ + nf/425//9tic/+K0c//frGrX365sCgAAAAAAAAAAAAAAAN+ubAzdq2nX7cB+/+LNlv8wLCD/AAAA/wAA + AP8AAAD/AAAA/wAAAP8lIRj/1cCL///kpP/32J3/99md//jan//32Z3/99md//fZnf/32Z3/99md//fZ + nv/32p7/99md//fZnf/73Zj/9NPZ/2hag/8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP9QPif/7Lhy/9+ubJDfrmwY3axp5OS4d//425//+Nqf//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/53aH/8tCS/+Kycf/dq2ms365sFQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+ubAffrmwW365sKt+t + az3erWtO3qxqWN6sal/erGpi3q1rX9+ta1Tfrmw4365sDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA365set6tav/erGr/7MWG//jboP/425//99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//jbn//53KD/8M2P/+Cv + bf/luXj/+dyg//fanf/425//5Ld2/+Gxb//21pr/+d2i//bXm//muXn/3atp/9+ubIwAAAAAAAAAAAAA + AAAAAAAA361sZ+KvbP/x0pL/Qj4u/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8wKx//7tWa//ve + oP/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nqd//XZmv+6eNn/RCVi/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wQDAv+2jVj/6rZx8d+ubBbfrmw63ato7+e7 + e//42p7/+Nuf//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/53KH/9daa/+W6ef/dq2jR361rMgAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+u + bG/erGr/365t//DNj//53aH/99me//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99me//jcoP/43KD/89GU/+a8fP/dq2j9361r//TVl//425//99md//jbn//y0JP/3atp/+Cw + bv/nvHz/4bBv/96saf/frmz6365sNAAAAAAAAAAAAAAAAN+ubAfdq2nM9MiA/66Ojv8AAAH/AAAA/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP95bE7//+in//fZnf/32Z3/99qe//jbn//426D/+Nyg//nc + oP/32p7/99md//fZnf/+4qL/wrCA/4tIwv9LJ2f/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/1VCKf/suHH/365tewAAAADfrmxG3ato6+a7e//32Z3/+Nyg//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/425//+Nuf/+vDhP/drGrr3qxqWQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADfrmw53q1q+N+ubP/yz5L/+d2h//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nuf//ndof/32p7/8c6Q/+e7e//erWvW3qtpo92q + aOztyIn/+Nyh//fZnf/32Z3/99md//jcoP/xz5H/4rRz/+Cvbf/ovn7/4rNy/9+ta7UAAAAAAAAAAAAA + AAAAAAAA361sRN+vaP/2zZ//f02d/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/xEQ + C//expD//d+i//fZnf/21pn/8s+R//DLjv/uyIr/7MaH//HOkP/32p7/99md///npf+ZimL/eDmx/1ss + gv8AAAD/AAAA/wAAAP8AAAD/AAAA/xsbG/8BAQH/AAAA/wAAAP8AAAD/BgMD/8udZ//ls27P365sBQAA + AADfrmw43ato3eO2dP/01Jf/+dyh//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32p7/+dyh//DM + jv/fr23/3qxpgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA365sAd+u + bK/erGr/78qM//ndof/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//janv/426D/+dyh//ja + nv/z05X/68WG/+O2dfberGq43qtpVt+uazTdq2jD5rt7/vjboP/32p7/99md//fZnf/32Z3/99md//jb + oP/32Z7/+Nuf/+7KjP/frW78365uQgAAAAAAAAAAAAAAAAAAAADerGqW6b5w/9+sv/90Oqn/AAAA/wAA + AP8AAAD/AAAA/wAAAP8DAwP/AAAA/wAAAP8AAAD/AAAA/4V4V///6Kj/99md//bYm//yz5H/7siJ/+3I + if/xzpH/9tib//fZnv/32Z3//+in/4R3UP9IC4z/WBab/wAAAP8AAAD/AAAA/wMDA/+Li4v/7Ozs/1FR + Uf8AAAD/GBgY/1dYV/8tKzv/l2Jx/+u6bfzfrmw2AAAAAAAAAADfrmwk3qtpweCwbv/wyo3/+dyg//ja + n//32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+dyh//PSlf/is3L/3atopN+ubBAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADfrmwR3atq5uW5ef/53aH/99qe//fanv/32p7/+Nqe//jb + n//426D/+Nyh//jcoP/42Z7/9NWY//DNj//pwYL/5LZ2+9+ua8jdq2h73qxqLgAAAADfrmwW3qxp0uKz + cv/215v/+Nqf//fZnf/32Z3/99md//fZnf/32Z3/99md//ncof/z0pb/361l/9uoVaQAAAAAAAAAAAAA + AAAAAAAA365sDN6raNr00YX/vYXR/2AYrP8CAQP/AAAA/wAAAP8TExP/pKSk/7u7u/8LCwv/AAAA/wkJ + Cf8EBAX/Mi0e//neof/6257/99md//jbn//426D/+dyg//jbn//32Z3/99md//fZnf//6Kf/eW9I/zYD + cP9oGrb/CwIT/wAAAP8AAAD/Ozs7////////////RkZG/zw8PP/c3Nz//////+rp8v+cYbL/3qpp/9+v + bHUAAAAAAAAAAAAAAADfrmwL3q1rjd6raf/ovX7/9dWZ//ndof/32p7/99md//fZnf/32Z3/99md//fZ + nf/32Z3/+Nyg//bWmv/luHf/3atow9+ubCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+u + bA3drGrg5bh4//bXm//32Jz/99id//bYnP/11Zn/89KV//DNj//txof/6L5//+O2df/gsG723qxqxN6r + aX/erGo3361rBAAAAAAAAAAA365sIN6tatjfrmz/89GU//jcoP/32Z3/99md//fZnf/32Z3/99md//fZ + nf/426D/9NWZ/+Kzdf/cqFv00ZQGtNGVBgcAAAAAAAAAAAAAAADfrmw6361p/fzknv++lOH/Yg26/w4E + F/8AAAD/AAAA/3d3d///////4uLi/wUFBf9NTU3/0NDQ/8nKyv80MzH/zbeC//7ho//32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md///oqP98ckr/KQFZ/2wcvP8rC0r/AAAA/wAAAP8nJyf/xcXF/3l5 + ef8zMzP/7u7u/////////////////7yT4//EiHP/47RpsAAAAAAAAAAAAAAAAAAAAAAAAAAA365sTt2r + aNjgsG//7caH//fZnf/53KH/99qe//fZnf/32Z3/99md//fZnf/32Z3/+Nuf//fanv/nvXz/3ato19+u + bCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+ubHverWv/4bBv/+K0c//itHP/4bNy/+Cw + b//frWz/3qxq+d2radfdq2ml3qxqZt+tayvfrmwCAAAAAAAAAAAAAAAAAAAAAN+ubCDfrWvV3qxp/+/L + jf/53aH/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nuf//fYm//ktXT/365y9NqlS23PkQD50JMAfgAA + AAAAAAAAAAAAAN6sa3Dis2///+61/8us6/9wE83/JQlA/wAAAP8AAAD/LS0t/5SUlP8wMDD/Pz8///f3 + 9////////////5mbnf+ejWP//+Wl//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3//+io/4l9 + Uv8bAD7/XRek/08ViP8EAQj/AAAA/wAAAP8CAgL/AAAA/8bGxv//////////////////////vpjt/7d6 + jv/ltmba365sCgAAAAAAAAAAAAAAAAAAAAAAAAAA365sGN6ta5Ldq2j547Rz/+/KjP/32Z7/+dyh//ja + nv/32Z3/99md//fZnf/32Z3/+Nqf//jbn//ovn//3ato3d+ubCsAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAN+ubFPfrWub3qxqr96saq3erWqf361rf9+ubFffrmww365sCwAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAADfrmwX365szd6raP/rxYb/+dyh//fZnf/32Z3/99md//fZnf/32Z3/99md//jb + n//22Zz/5bh3/92qaf/hsHVm1JshIs+RAP7QkwD30JMAOQAAAAAAAAAA3qxqoOe7d///88b/3872/3gd + 0f9JEYD/AAAA/wAAAP8AAAD/AAAA/wICAv/R0dH/////////////////xMbJ/4R2V///5KT/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf//56f/l4pd/yYXOf9QGIr/VxeW/y0MTv8AAAD/AAAA/wAA + AP9TU1P///////////////////////////+vguf/yJqz/+S1ZvXfrmwoAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAN+ubDverGq23atp/+O1dP/ux4n/9tea//ncof/426D/99qe//fZnf/32Z3/+Nqe//jb + n//mu3r/3atp2t+ubB0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA365sDd+ubLzdq2j/6cGB//jc + oP/32Z7/99md//fZnf/32Z3/99md//fZnf/425//9tic/+S4d//dq2j/4K9xhQAAAADPkgAu0JIA+dSU + AP/TkwDUz5IDEwAAAADerG3C7MOA///y0f/49P//gjXO/2wWv/8RBR3/AAAA/wAAAP8AAAD/VVVV//// + ///////////////////LzdH/Z11G//7io//42Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md///l + pf+unW3/RkVJ/142iP9BDXf/TxaI/x0IMv8AAAD/AAAA/6ioqP///////////////////////fz+/5JV + 1//hydb/47Rr/9+takMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADfrmxM3qxqvN2r + af/hsXD/6sCB//HPkv/22Z3/+dyg//ncoP/425//+d2h//bYnf/hsnD/3q1rr9+ubAUAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAN+ubALfrmyl3apo/+e8fP/426D/99qe//fZnf/32Z3/99md//fZnf/32Z3/+Nyg//bX + mv/ktnb/3ato/9+ubI4AAAAAAAAAAM+RAC3UlAD4qos//8mRE//SkQCm1p81CN+uctfvyYf//fPZ//// + //+gaNf/cBLO/0wUgf8AAAD/AAAA/wAAAP+hoaH//////////////////////7m7vP9GQC7/+d6g//na + nv/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3//+Gj/8u1gf86PTX/kH6l/y8DXf9EFHP/SBV9/yEH + O/8ICAr/09TS///////////////////////Vve3/hD/M//nz8P/jtnb/361pXQAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA365sRd6ta6Xdq2ns3q1q/+K0c//ov3//7smL//LQ + k//005b/8MyO/+Gyb//erWv0365sGgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA365sgt2raP/kt3f/99me//ja + n//32Z3/99md//fZnf/32Z3/99md//ncof/01Jf/4rRz/92raf/frmyJAAAAAAAAAAAAAAAA0JMAJdqV + APN5g4n/doOU/9yUAP/Umh2V365x4PHNjP/989v//////9C06/9qEcH/dx/N/ywMTP8AAAD/AQIA/8PD + xP//////////////////////fnyH/y0mHv/3253/+tuf//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/73J//79OY/zEuIv+4t7z/TTBv/y4IVv89E2r/QhB2/0Qbbv/m4ur///////////////////7//39A + vv+kdtX////+/+W6f//vuG9qAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAN+ubCDfrmxj3qxqqN2radjdq2n03q1r/N+ubP3erGr0361rwN+ubE7frmwCAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAN+ubFTeq2n+4rRy//bWmv/425//99md//fZnf/32Z3/99md//fZnf/53KH/8c+S/+Cw + b//eq2n/365sfAAAAAAAAAAAAAAAAAAAAADQkwAZ25UA54mGc/8mdP//pItN/9uUAP/Yo0L+89KX//3y + 2v//////+vb9/4U/y/9rFML/bB66/yMIP/8AAgD/xcfC/////////////////+3r8P80HVT/LiUj//XY + m//63J//99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf//5ab/UEYv/4uOjv/Duc7/IgNF/y8N + VP82EF7/Ow1p/9LG3v////////////////+ifsb/Uwub/+XZ8v/9/fz/8seK/+CsaHA4LBsMAAAAEQAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA365sC9+u + bCXfrmw7365sPN+ubCTfrmwCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADfrmwh3qxq5+Cxb//01Jf/+Nug//fZ + nf/32Z3/99md//fZnf/42p7/+Nyg/+3Iif/frmv/3qxq79+ubF8AAAAAAAAAAAAAAAAAAAAAAAAAANCT + AAzZlQDamIld/yd0//88eOb/vI4p/9iSAP/ovmT///Xh////////////yq3n/18Nsv9lHLH/YBun/ywG + Vf+jnKr////////////9/P3/dV6M/xUAOP8wKSL/9dea//rcn//32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md///np/+VhFz/OTs9//////+RhKD/GgA6/ysMTf8rB1H/ak6H/+Hc5//e1+b/imur/zUA + df+hgMH//////8DBwP9cSC3/OCsZ1AAAAKMAAABMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAN6ta6nerWv/8c6Q//ncof/32Z3/99md//fZnf/32Z3/+dyg//fZnf/ov3//3atp/96t + a9Dfrmw3AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0JMAA9iVAMatjT//Mnb4/yx1//9Me9H/yZAY/9aR + AP/t1Jr////////////+/v7/kWDC/00Ilf9VGpL/TBKI/1kuhv/IvNT/zMPV/2tVgv8cADz/KBRD/z85 + L//12Jr/+tuf//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3//d+h/9/Fjv8ZFxP/zc7P//// + //+PhJz/Hgc8/x0APf8jAkb/NRNa/zMMXP8hAFT/fFud//n4+v//////i4qL/2JcQP+4nGr/mXZHhwAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADfrmxA3qtp/erCgv/53aH/99md//fZ + nf/32Z3/+Nqf//ncof/yz5L/4rR0/92raP/frmya365sFQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA1JMArMKQGv8/eOb/NHf3/yt1//9Zfr7/zpAP/9WUCP/v26z////////////v6vX/bz+g/zsE + df9DFXL/Nw5i/zENWP8tDk7/GQA5/yYNQv+Qi5z/UEw6//XanP/5257/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/42Z3//+am/1FGL/9jZWj////////////FwMv/YlR1/zchUv8xFU//STBn/56O + sf/7+/v///////7+//9saWP/6MyQ///kpP/yv3j/4K5rfAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAN6sapzhsnD/9tib//jbn//32Z3/+Nuf//ndof/21pr/6sGB/9+ta//erGrQ365sTwAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADRkwCH1ZQB/1d9v/8udf7/Nnfz/yp1 + //9dfrf/zY8O/9aSA//s1J3////////////r5vH/dlaY/y8GWf8lAkr/IAJA/xgANf8qFUX/tay//7W3 + uf9VTDf//eOk//jZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf//5KX/u6Z2/xES + Ev/e3t//////////////////7ezv/+bk6f/4+Pn/////////////////5Obp/2FbSv//5qT//+qq//TP + kP/grWr/47FuXQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3qxqo+GycP/11Zn/+dyh//jb + n//01Jf/68SE/+Cxb//dq2jc361rdN+ubA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAANCTAFzblQD/fYSG/yt1//82d/P/Nnfz/yp1//9Xfb7/yI8W/9aQAP/mx4T///////// + ////////wLbL/39tkf9rWX3/jH+a/9vW3///////b3F0/3VnR///6Kf/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//nanv/95KX/Qjom/11eYv////////////////////////////// + //////////////////+vr7H/HBoS/2NYP/+djWf/3MWP/+q9fP/frGrs365sJQAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAADfrmwi3q1rseKycfjnvHv/5Lh3/eCvbezdq2i23q1rZN+ubBQAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0JMAMdiVAPqpjET/L3X7/zZ3 + 9P82d/P/N3fz/yt1//9Oe8//vo8m/9iNAP/gt2H//Pjw//////////////////////////////////b2 + 9/8uLi3/uaZ1///jpP/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md///i + pP/Kt4P/CgkH/7e4uv///////////////////////////////////////////1tZV/+bjGL/j4Bd/2BW + Pv9TTDj/kHpU/9+ta//gr2yqAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3q1rLN2r + aUnerGo9361rHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAADQkwAJ0pMA1s2SDf9Hetj/MXb6/zZ38/82d/P/Nnfz/y11//8/eeH/qItI/9mN + AP/apjT/9erQ////////////////////////////oqOm/yomGf/z2p3//N+m//reqP/53qf/+t6o//re + p//53aX/+Nui//fZnv/32Z3/99md//fZnf/32Z3/+Nmd///oqP+Fd1P/FBUY/9vb3P////////////// + //////////////////+lp6v/XlQ8///tq///56f//+Wm//Tanf/qz5b/5Ll4/96saf3frmw+AAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTAAbQkwAXAAAAAAAAAADQkwCd25UA/3aD + kv8rdf//Nnfz/zZ38/82d/P/N3fy/zB2/P8xdvj/hYV8/9OOAP/Zlwz/69CX//////////////////f4 + +P8pKi3/iXpW///oqP/rwm7/47VP/+KzSf/itUz/6LlZ/+7CbP/00In/+Nug//reqP/426H/99md//fZ + nf/32Z3/+duf///lpf9mWj7/Hh8i/8XGyP//////////////////////v8DB/xgYGf9FPSr/8tue//ze + of/32Z3/+due//veov/xzpD/3qxq/9+ubKsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA0JMABdCTAIHQkwAjAAAAANCTAFTYlAD/rYxA/zB2+/81d/X/Nnfz/zZ38/82d/P/Nnfy/zN2 + 9/8qdf//XH64/7yNJ//ajgD/37JP//ju2f//////f4KG/x8bEP/v1pv//N6j/+3Gdv/UmRn/yokA/82N + AP/HmRr/xp0q/8+XFv/cnib/6rRO//XRjP/636j/+dyj//fZnf/32Z3/+tyg///kpf+BdVH/GxoX/1td + Yf+cnaD/nJ6h/1pbX/8bGRX/r55w/4F3Vv9WTTj/996h//jYm//32Z7/99md//fanv/jtnX/3qxq9N+u + bCQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0JMAf9CTALbQkwAB0JMAENGT + AOLTkwb/UnzJ/y92/f82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/8sdf//Onjq/4yGc//PjAD/4p8O/9G0 + c/8YGBf/q5p0///nqP/32Jz/+d6l//fZm//isk3/0Y4B/8GlN/+f6dD/mfHi/6fUpf+5sFP/0Jga/+So + OP/zz4X/+t+o//jbof/32Jz/+due///op//Uvoj/dGZG/0tDL/9AOSj/W1A2/8y2gv//6Kj//+em/4B0 + U/+PgV7/+daX//PQk//425//+dyh/+zFh//dq2n/365sbAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAADQkwA60JMA/9CTAIUAAAAA0ZUKjduUAP+Nh3D/K3X//zZ38/82d/P/Nnfz/zZ3 + 8/82d/P/Nnfz/zd38v8ydvn/KnX//1J8xv+liUX/04sA/8CEAP/uxnD/+d2k//ndp//32Z7/+Nqg//re + qP/uyHn/2JgX/8mVGf+l3LT/j////5P+//+d6tT/tbdj/9GUD//mrkH/9daW//reqP/32Z7/99mc///g + ov//56f//eKj//rfof//5qb//+Gj//fYnP/5257//eCi/9e/iv/01Zr/6b9///fZnf/426D/9NKV/9+u + bP/frWuvAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTAAvQkwDb0JMA/9KW + C1/bp1WN1ZQE/8SQGP8+eOb/Mnb5/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/L3b+/y92 + /f9gfrP/spBA/9eRAP/foCH/7cVz//jcov/63qf/+Nqg//rep//22Jn/4qs9/9CKAP+vyIf/k/7//5T8 + //+T/v//oOTE/8CkOf/ZkhD/7MJt//reqP/426H/99mc//fZnf/42p7/+dqe//jZnf/32Z3/99md//fZ + nf/42p7//d6h//ncoP/ovn//7smL//ncoP/42p7/47Z0/96satvfrmwMAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTAJnQkwD/0ZIA+NumS/DXoDX/2pMA/3WCkv8rdf//Nnfz/zZ3 + 8/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/NXf1/yx1//8wdfn/YoKy/7ymRv/RkAT/3Zsd/+zA + Z//32Jr/+t+o//rep//636j/68Bp/9aOBv+yv3X/k/7//5b4//+U/P//lfr5/7DDfv/PjAT/4qs+//fa + nf/53aT/99mc//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+dyg/+/Ji//kt3f/+duf//nc + of/ovn7/3qtp9t+ubCsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0JMATNCT + AP/Jkg3/1pQA/92qQf/bnA//to0s/zR38/80d/b/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ3 + 8/82d/P/Nnfz/zV39f8ob///ZLv+/6nryP+2uWn/yJcc/9mWF//nsEX/882B//ncof/95LP/9dKN/9ya + Gv+xvnX/k/7//5f4//+W+f//kv///6Teuv/IlRv/25oa//PRiv/63qj/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/425//9NOX/+Cwbv/01Jf/+t2i/+zGh//eq2n/365sQwAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQkwAN15QA2Z+KU/+Rh2X/3ZYA/9aYB//ZlAD/aX+l/yt1 + //82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zR08/83evX/h+n//5f/ + //+Z8uv/qNSk/7mwUf/LnB3/3Z8p/+qzS//2zYT/+deV/+SnNf+vyYn/kv///5f3//+X9///k/7//5zu + 2//BozT/1o8I/+7Idv/636n/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnv/32Jz/4bJw/+7J + i//63qP/78yN/96sav/frmxQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADUlACDxJEZ/zt35/93go3/05MI/+CWAP+yjTb/Mnb2/zR39v82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ3 + 8/82d/P/Nnfz/zZ38/82d/P/Nnfz/y9u8v9SnPf/nf7//5b6//+U/v//k/3//5nw5/+l16n/tLpo/8Wl + O//WpDH/5Kc3/9iLAP+q06P/lPz//5f3//+X9///lPz//5f38P+7sFP/1YkA/+rBaf/636r/99me//fZ + nf/32Z3/99md//fZnf/32Z3/99md//jbn//ktnT/6cCB//reo//xzpD/3qxq/9+ubFUAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTACbblQDze4OI/x1y//9WfcL/t442/+aX + AP9tgKH/K3X//zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/NXbz/zBv + 8v92y/v/nv///5f3//+X9///lvn//5T9//+T/v//lfj6/5vp1v+l1qr/tcJ9/7a/d/+Y9fP/lvj//5f3 + //+X9///lfr//5T8+/+5uGf/04gA/+m+Y//63qf/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nug/+a5 + ef/mvHz/+t6j//HOkP/erGr/365sTQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAANWSAJvAkCD/O3jr/yl1//82d/H/g4WC/6eLTv86eOr/NHf3/zZ38/82d/P/Nnfz/zZ3 + 8/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/MnPy/z6B9P+R7v7/mvv//5f3//+X9///l/f//5f3 + //+X+P//lfr//5T9//+T////lfv//5f3/f+X9///l/f//5f3//+X9///lvr//5T9//+2vXL/04oA/+a5 + Xv/2157/99qe//fZnf/32Z3/99md//fZnf/53KD/6L1+/+a6ef/63qP/78yO/96sav3frmw7AAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA1ZsiMt2WAPl/hIT/KnX//zR3 + 9/8rdf//QXnh/z146P81d/X/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ3 + 8/82d/P/L27y/1ej9/+d/v//mPj//5f3//+X9///l/f//5f3//+X9///l/f//5f3//+X9///l/f//5f3 + //+X9///l/f//5f3//+X9///lvn//5P+//+1vXD/1YwD/+7IiP/53KH/99md//fZnf/32Z3/99md//nc + of/pwH//5rt7//rfpP/txoj/3qtp7d+ubB0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAADhsXgK2p8r3cmQD/9Fetr/MHj8/zZ38/8zdvj/NXf1/zZ38/82d/P/Nnfz/zZ3 + 8/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/81dvP/MG7y/3TH+v+f////l/f//5f3 + //+X9///l/f//5f3//+X9///l/f//5f3//+X9///l/f//5f3//+X9///l/f//5f3//+X9///lvn//5P9 + //+2u23/57Jj//nco//32Z3/99md//fZnf/32Z3/+dyg/+nAgf/ovn//+t+k/+m/f//eq2nN365sBQAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADdrGe63JgE/51/ + Uf8tZ/3/NXv1/zZ48/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ3 + 8/82d/P/Nnfz/zZ38/8zc/P/OHrz/4rk/f+c/v//l/f//5f3//+X9///l/f//5f3//+X9///l/f//5f3 + //+X9///l/f//5f3//+X9///l/f//5f3//+X9///lvn//5T5+//SvIP/+NKU//fbnv/32Z3/99md//fZ + nf/53KD/6cCB/+zFh//53aL/5Ld2/96sap8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAOCwdITbpUb/2JMA/25emv8pVP//N3fy/zZ78/82d/P/Nnfz/zZ3 + 8/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/8wb/L/SI71/5b2 + //+a+v//l/f//5f3//+X9///l/f//5f3//+X9///l/f//5f3//+X9///l/f//5f3//+X9///l/f//5f3 + //+X9///kv3//8HHof/zxIH/+dyh//fZnf/32Z3/99md//nboP/qwYL/8tCT//bXmv/gr23/361rYwAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA365tQ+Cv + c//boij/yo0N/0tIz/8tQ/z/Nmjx/zZ78/82efP/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ3 + 8/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/8vbfL/Wqb3/53+//+Y+P//l/f//5f3//+X9///l/f//5f3 + //+X9///l/f//5f3//+X9///l/f//5f3//+X9///l/f//5f3//+S/P//tNW7/+q1cP/526D/99md//fZ + nf/32Z3/99qe/+/Ljv/32p7/78uN/92rafTfrmwmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADfrmwL361t2OS4dv/foxT/tYIq/zg/6v8vOvf/NlTw/zZy + 8v82e/P/Nnjz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zV2 + 8/8ubfL/a7v5/6D///+X9///l/f//5f3//+X9///l/f//5f3//+X9///l/f//5f3//+X9///l/f//5f3 + //+X9///l/f//5T6//+l59z/4a1q//XTlv/4257/99md//fZnf/32Z3/99md//ncof/nvHz/3atpvN+u + bAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADerWuG4rN2/+3Iff/dnAP/o3lJ/zE+9P8xOfX/NkLu/zZd8f82dvL/Nnvz/zZ48/82d/P/Nnfz/zZ3 + 8/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zR18/8ycfL/dsv6/5////+X9///l/f//5f3 + //+X9///l/f//5f3//+X9///l/f//5f3//+X9///l/f//5f3//+X9///lvj//5b5///StoD/7sGA//nc + of/32Z3/99md//fZnf/425//9dWY/+Cwbv/frmtnAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+ubCfdq2jz7smQ/+3IdP/blwD/l3Rd/y49 + +f8yPfT/Njzu/zVI8P82ZfL/Nnnz/zZ68/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ3 + 8/82d/P/Nnfz/zNz8/80dfL/fdX7/5////+X9///l/f//5f3//+X9///l/f//5f3//+X9///l/f//5f3 + //+X9///l/f//5f3//+T////ouC//9WmTf/ks3T/99md//janv/32Z3/99md//ndof/rxIX/3ato5N+u + bBUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAN6saprhsXD/+dyn/+rBZ//algD/k3Fj/y08+f8xPfX/NT7u/zU87/82TfD/Nmvy/zZ6 + 8/82efP/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zJz8/83efP/gtr8/5// + //+X9///l/f//5f3//+X9///l/f//5f3//+X9///l/f//5f3//+X9///kv///6Piwv/NlRX/1pUT196s + bPTuyYz/+Nyh//fZnf/42p7/9deb/+GycP/frGp+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA365tJN2qaO/qwYL//OKt/+m+ + Yv/alwD/mHRb/zI+8/8vPfj/NkDu/zU97/81Pu//NlTw/zZw8v82e/P/Nnnz/zZ38/82d/P/Nnfz/zZ3 + 8/82d/P/Nnfz/zZ38/82d/P/Nnfz/zJy8/85e/T/g9r8/5////+X9///l/f//5f3//+X9///l/f//5f3 + //+X9///l/j//5L///+m3LP/z5UU/9KNAMLVnCkd365wo+K0c//32Z3/+Nug//ndof/pwID/3qto2d+u + bBEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAA365vct6tav/yz5P//OGs/+vCav/cmQD/pXpD/ztD5v8sO/3/NUDu/zU/ + 7/81PO//NkHv/zZZ8f82c/L/Nnvz/zZ48/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zJx + 8/84efP/fdX7/5////+X+P//l/f//5f3//+X9///l/f//5b5//+T/v//rdCX/9GRCf/SjwC5z5EAFQAA + AADhsXYi3qtp5OrBgv/42p//7MWG/96savjfrmtGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADfrm4C361wtOKz + cv/215v/++Cr/+/Lfv/eoA//t4In/0xMzf8pOf//NUDw/zVA7/81P+//NTzv/zZD8P82XfH/Nnbz/zZ7 + 8/82ePP/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zJy8/80dfP/dMn7/6D///+Y+f//l/f//5f3 + //+U/P//lfv4/7e/df/UjQD/0pEApNCTAA4AAAAAAAAAAAAAAADfrmw2361r1OGycP/erGrq361rWAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAADQkwAMz5EAN9SZHQnbqFQK365zzeW5ev/32p7/++Cp//TUk//kqyf/yo4R/2lc + oP8qOv7/MT72/zVA7v81QO//NT7v/zU87/82RfD/NmHx/zZ38/82e/P/Nnjz/zZ38/82d/P/Nnfz/zZ3 + 8/82d/P/Nnfz/zNz8/8xcfL/aLf5/539//+a/P//kv7//5zt2f/Cq0X/1YsA/9GSAIXQkwACAAAAAAAA + AAAAAAAAAAAAAAAAAADfrmwT3q1rV9+ubCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTAAPQkwBCz5EAptCS + AnTZo0NE3qxqz+e7gf/22J7/++Cq//faof/epzz92ZYA95NyZf86Quj/Kjr+/zRA8P81QO//NUDv/zU+ + 7/81PO//Nknw/zZk8v82efP/Nnvz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zV18/8vbfL/T5///4rt + //+t16P/zJkb/9SMAO7QkwBhAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQkwAo0JIAus+RAOzTmBjX1589/uCvYv/vyor/6sGG/+Gy + f+LXny852pcAob2JKv1gV7H/Kjr9/y89+P81QO//NUDv/zVA7/81Pu//NT3v/zZL8P82Z/L/Nnnz/zZ6 + 8/82d/P/Nnfz/zZ38/82d/P/M3b4/yl0//9Bc9f/ppRX/9eSAP/SkADK0JMANAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA0JMAbM+SAOvPkQD/z5EC/8ySHP/Yni3/5Kk0ytyeFC3VlQAO2pkASdqYAKucd1vyRUjV/yk5 + //8yPvT/NUDu/zVA7/81QO//NT3v/zU97/82TfD/Nmny/zZ78/82evP/M3b5/yp1//86d+v/gISE/8yS + Ff/YkgD90JIAjtCTAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0JMAJNCTAKHTlAD+uIYm/4Fn + d/9+Znj9nnhP+7iGMOHGjhO5z5MFot+bANPRlBL/im1z/0VI1f8yP/L/NUDv/zVA7/81QO//NUDv/zU9 + 7/80PfH/Lkz6/ytm//89eeb/d4OO/7+QJv/clQD/1JQAytCTAEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTAELUlQC2w4sd/4RqfP9GSs//Lz32/zZA7f9FSdj/U1HC/2NZ + rP9xYJb/WFK7/zM/8f80P/H/Mz/y/zA99v8sO/z/Kjr//zM/8/9STMT/i25x/8ORHf/blQD/1pQA49CT + AHPQkwALAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADTlQBF25kArs+TCvSnfEr/c2GW/0xMz/80QPD/KTn//yU3//8oOf//Ljz5/zE+9f83Qez/RknW/2FY + r/+IbXX/s4Q3/9OVA//bmAD/1ZQA4NCTAIDQkwAbAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0pQALNmYAH3bmQDI0pUE+cKM + Hf+ygzf/p31K/6F6Uv+le07/roE+/7yIKP/MkQ3/2JcA/9uZAP/XlwD10ZQAu9CTAGXQkwAWAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTAATRlAAv1JUAZteXAJvZmAC92ZgA1NmYAOHYlwDh1pYA19KU + AL/RkwCb0JMAY9CTACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA///////wA8AB////////////////AAAAAH///////////////gAAAAA/wP////////////wA + AAAAAAAP///////////+AAAAAAAAB////////////gAAAAAAAAf//////////gAAAAAAAAAH//////// + 98AAAAAAAAAAB//////+H/AAAAAAAAAAAAf//////wfwAAAAAAAAAAAP///////B8AAAAAAAAAAAD/// + ////4PAAAAAAAAAAAB////////BwAAAAAAAAAAA////////4cAAAAAAAAAAAf///////2DAAAAAAAAAA + Af///////+wQAAAAAAAAAA/////////kAAAAAAAAAAAf////////4gAAAAAAAAAAH/////////AAAAAA + AAAAAB/////////wAAAAAAAAAAAf////////8AAAAAAAAAAAD/////////gAAAAAAAAAAA/////////4 + AAAAAAAAAAAP/////////AAAAAAAAAAAD/////////wAAAAAAAAAAA/////////8AAAAAAAAAAAH//// + /////gAAAAAAAAAAB/////////4AAAAAAAAAAAf/////////AAAAAAAAAAAP/////////4AAAAAAAAAA + D/////////+AAAAAAAAAAA//////////wAAAAAAAAAAP/////////8AAAAAAAAAAD//////////gAAAA + AAAAAB//////////8AAAAAAAAAAf//////////gAAAAAAAAAP//////////4AAAAAAAAAH////////// + /AAAAAAAAAH///////////4AAAAAAAAP////////////AAAAAAAAB////////////4AAAAAAAAf4//// + ///////AAAAAAAAAAAf/////////4AAAAAAAAAAD////////8/gAAAAAAAAAAf////////j8AAAAAAAA + AAH////////8HgAAAAAAAAAD/////////gAAAAAAAAAAA/////////8AAAAAAAAAAAf/////////gAAA + AAAAAAAAD/7//////8AAAAAAAAAAAAAAP//////wAAAAAAAAAAAAAB//////+AAAAAAAAAAAAAAf//// + //8AAAAAAAAAAAAAH///////gAAAAAAAAAAAAD/////8AAAAAAAAAAAAAAB/////AAAAAAAAAAAAAAAA + ////+AAAAAAAAAAAAAAAA/////AAAAAAIAAAAAAAAA/////gAAAAAHAAAAAAAAB/////4AAAAAB4AAAB + AAAH//////AAAAAA+AAAAQAAB//////wAAAAAPgAAAGAAAH/////+AAAAAD8AAABgAAAf/////4AAAAB + /AAAA8AAAA//////wAAAAfwAAAPAAAAD//////4AAAH8AAAD4AAAAH//////4AAB/AAAA+AAAAAf//// + /4AAA/4AAAHwAAAAB/////8AAAP+AAAAcAAAAAH////8AAAD/gAAADgAAAAAf///8AAAA/wAAAAcAAAA + AD///8AAAAf4AAAADAAAAAAf//+AAAAH8AAAAAYAAAAAH//+AAAAB+AAAAACAAAAAA//+AAAAAfAAAAA + AwAHAAAP//AAAAAPwAAAAAEAA/gAH//gAAAAD4AAAAAAgAD/////wAAAAA+AAAAAAMAAf////4AAAAAf + AAAAAADgAD////8AAAAAHwAAAAAAcAAP///+AAAYAD4AAAAAAHgAB////gAA8AA+AAAAAAB8AAP///4A + B+AAPgAAAAAAPwAB////AD/AAL4AAAAAAD+AAP///4f/gAGcAAAAAAA/4AB//////wABjAAAAAAAP/gA + P/////4AA4QAAAAAAD/+AD/////8AAeAAAAAAAA//8B//////AAfgAAAAAAAP/////////gAP4AAAAAA + AA/////////wAH+AAAAAAAAP////////8AD/gAAAAAAAD////////+AD/4AAAAAAAAf////////gD//A + AAAAAAAD////////8D//wAAAAAAAAf///////////8AAAAAAAAH////////////AAAAAAAAA//////// + ///+4AAAAAAAAP///////////2AAAAAAAAD///////////8gAAAAAAAAf///////////IAAAAAAAAH// + /////////wAAAAAAAAB///////////+AAAAAAAAAf///////////gAAAAAAAAH///////////4AAAAAA + AAB////////////AAAAAAAAAf///////////wAAAAAAAAH///////////+AAAAAAAAB////////////g + AAAAAAAAf///////////4AAAAAAAAH///////////+AAAAAAAAD////////////wAAAAAAAA//////// + ////8AAAAAAAAP////////////AAAAAAAAH////////////4AAAAAAAB////////////+AAAAAAAA/// + //////////wAAAAAAgP////////////+AAAAAAcH/////////////gAAAAAPj/////////////8AAAAA + H//////////////9gAAAAH///////////////gEAAAD///////////////+BwAAB//////////////// + wAAAB/////////////////AAAB/////////////////8AAA//////////////////4AB//////////// + ///////wD/////////8oAAAAMAAAAGAAAAABACAAAAAAAAAkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADMigAB0ZUFAQAAAAAAAAAAAAAAAM+RAALapEkB4LBzA9+uagTfrmwE365sBQAAAADfrmw0361sseS3 + d9nnvn3l6L1+5eW5eN/fr23J365tzei+fufsxIXy6sKD9ue8fPLgsG/j3qxqZgAAAADerWkT3q1pHt+t + aSffrWkm3q1pFQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTAAPQkwACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA365sAwAA + AADdq2iM7MWG//ncoPv4257/+Nqe//ndof/tyIr/4rNy//ncof/53KD/+dyg//jbn/711Jf/4rR07+Gy + d8ritn3k47eA7OO4gvLjuILx47Z+6+CwcabfrmsKAAAAAN+ubAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAOjKggHMigAR0ZUFDgAAAADQkwABAAAAAM6QACPZpEgO4K9xL9+t + Z2LfrWqJ365rpN+vbrndrGre7MWH//ndof332Jv+99mc/vjboP7z0pX94rRz/ffZnf732Jz/99ic//fZ + nf/42p395ryB/eW+kv/nv5P/57+T/+a/k//mv5H958CW/+K1fOXerWkOAAAAAN+ubAEAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOjKggXMigA90ZUFpNCTALTQkwEoAAAAANKX + E23drGXs4bJ4+OK2fv/kuYT/5buJ/+W9jf/kuov/5rt8//jbnv/32Z3/99md//janv/11Zj/47R0//bX + m//32p7/99md//fZnv/32Jr/5buA/+W+kf3mvpD95r6P/ua+j/vmv5L45byM/9+vbo4AAAAA365sAwAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOjKggEAAAAA0ZUEB9CT + ALLQkwH7zpIAHtGYG1PmtHz/5cCU/Oa/kvvmv5L75r+S/Oa+kfzmv5L947d+//XVl//42p//99md//fZ + nf/32Z3/5LZ1//TUl//42p//99md//fZnv/215r/5bqB/+W8jf/mvo//5r+T/+a/kv3lu4n/4LBxxd+t + ahAAAAAA365sAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOjK + ggEAAAAA0ZUFGNGVAEHQlALk05IAvMOWCn7EsGj/7LyP++S/kf/mvo7/5r6P/+a+jv/nwJP/47iF//DM + jf/53KD/99ic//fZnf/426D/5bl5//LPkv/426D/99ic//fanv/21pn/5bqD/+S7i//itXz/4rR4+eGx + dMrfrmt4365qDAAAAADfrmwBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAA0pYDA8uMCJ3OlAix3JIA/pqhKfNaxYn/6LZ9/+i8jP/kwJX/5L2S/+a/ + k//mv5D/47iG/+rChf/53KD/99ic//fYnP/53aH/5719/+/Ljf/53KH/99ic//janv/11Zf/5bqD/+a/ + k/7mv5H/4bN28d6saB4AAAAA365sAt+ubAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADMigAEAAAAAMiHDmuiVUD/25IA+J+iLf8yx4n/nNm3/+K5 + g//qtoD/8sKF/+a8hv/htHn/5LuK/+W7g//32Jr/99me//fYnP/53aL/6sKE/+zGiP/53aH/9tic//ja + n//11Jb/5LqE/+a+kf/mv5L85LqH/9+talwAAAAA365sBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADMigACAAAAANieAByaSErurF40/9ef + AP1MtWX/VNer/6T18/+y2L//h5S3/86pgf/qv4v/5r+U/+S4hf/y0JL/+Nug//bYnP/53aH/7ciK/+rC + gv/53aH/9tic//jbn//005X/5LmF/+a/kv/mvpD75b2N/9+vbpMAAAAA365sAwAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0JQFAwAA + AADGhRKZiDFg/9qNAPuRqj3/MsB7/3/n0v+a////acHz/8yri//swpD/5b6R/+S6i//sx4r/+dyg//bY + nP/43KD/8c2Q/+i+fv/53aH/9tic//jbn//z0pT/5LqH/+a/kv/mvpD85r6Q/+Cxca4AAAAA365sAgAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA0ZUFAgAAAADYngAroVFB9aBMRP/WoQL+S7hu/0fHh/+W9fb/pPbu/967hP/ovpD/5r6Q/+W9 + kP/mvYP/99qc//fZnf/425//89KV/+e8fP/425//99ic//jboP/y0JH/47eC/+fAk//mvpD85r6Q/+Cw + ca8AAAAA365sAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTAAMAAAAA0ZQFiIUuYv/GdBn7pK0u/y+/e/9f06L/n/b2/9u7 + h//ovY//5r6Q/+a+kf/hs3f/9NOV//jan//32Z3/9tea/+e7e//32Jz/99md//jbn//y0JL/4rV3/+W+ + kP/mv5H65byN/9+ubY0AAAAA365sBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTAAEAAAAA1ZoADL14HtCEKWX/144F/HC3 + V/8vv3r/bNy1/9fFmv/ou4r/5sCS/+S7i//nvX7/8c6Q//jbn//32Jz/99qe/+e8fP/11Zn/99qe//ja + nv/y0ZX/68SD/+S6iP7nwZb/4rV7/9+taj0AAAAA365sAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQkwACAAAAANie + ADGoXTjykDNY/9CcB/1VvGz/K8OB/5u7ef/zuor/4sCU/+K4hf/tyIj/8M2Q//bYm//32Z3/+dyg/+i+ + fv/y0ZT/+Nue//ncov/vy4b/5rph/+W7hPnitXz7361rhQAAAADfr20B365sAd+ubAPfrmwBAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA0JMAAwAAAADYngBOm0xI+5k6Tv7IoQ38UL9t/zvAgf/Utnn/97+T/+W4hv/vyov/8tGU//PS + lf/32p7/+dyh/+vDhP/wzI7/+Nqe//vgqf/hs1j82aQ9/+e8f7Hbp2IB365sAQAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTABkAAAAA15wAQppLSPKVN1P/y5QQ/nG6T/9Ovnr/sbyB/9O1 + ff/tyIr/9teb//DMjv/425//+Nqe//HPkv/y0ZP/99mg//7jmv+7eD79s2s//+3FddXjtXl84bFvsd+u + a8LmuXjJ5LZ2w9+ubYzfrWsSAAAAAN+ubAIAAAAAAAAAAAAAAADfrmwBAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADPkQACAAAAANCTATXPkgGT0pYBHd6nAC2sYy/QjC9R/8Zy + Fv6uoij/a7Rf/2+0bP/ow4P/+t2h/+7Ji//32Jz/99md//fYnP/32Zz/9tef//veh/+oW0L/jjVQ/+vA + X//53Kf/9tib/+vDhP/wzpD/+t+k/PPRlP/frmx0AAAAAN+vbQQAAAAAAAAAAN+vbQEAAAAA365sAt+u + bAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0ZQIAgAAAADRlQBjv3sc/7Jo + KcjRlBTA1aBg/9qvjv/1w3v/8LVw//DNjv/pwIH/+Nqf//TUl//22Jv/99md//fYm//53KT/7MZ1/+/K + ev/PkxX/kDdF/9mlVv784KX7+Nuf/O7Jivzvyoz7+dyg/urCgvPcqWc6AAAAAN2raQIAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgsHMC3qxlA9ii + PgYAAAAAzI0DUaBOMvPEhnL//+ik/v/np//qxYn/78+T//zip//rw4T/89GU//ncoP/32Z3/99md//bY + m//636n/5bpe/+CxT//eqRv/uHAS/8GBR//945z/9tie/+rCgv/vyoz+8MyP/+e7fO7nvH3F57x8y+e7 + fMfnu3zF5rt7w+a7esLluXjK4rJwl9+tawsAAAAA3KdgAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+u + agIAAAAAAAAAAAAAAADerGwBAAAAANmhEhXXny6G57x/6vPSlf/xzpD+6L9///jcoP/y0JP/68SF/fnc + of332Jz/99md//bYm//53ab/68Rx/9GVDv/UmxX/zpAA/797Hv/00oj++Nui//jbn//vy43/7ceJ//ne + o//53KD/+Nyg//jboP/425//+Nuf//jboP774ab/7MSF+t2raCcAAAAA3KdgAgAAAAAAAAAAAAAAAAAA + AAAAAAAA4LBvAQAAAADdq2gd3qxpU9+va3rhs3GT5Ld7p+S3fq7kt3O26L186vDMj//txoj+8c6Q//fZ + nf/53KH/68OE/vLQk//53KH/99ic//fZnf/32p7/99ib/9SaGf/RjwD/0JYE/8uLAP/ovmf/+t6n/vbX + mv/53aH/8c6R/+vEhP732p7999md/ffanv3425/9+dyg/vbYm//sxYb54K5tawAAAADgsG8CAAAAAAAA + AAAAAAAAAAAAAAAAAADcp2ACAAAAAOCvbXHrwoP38c6R//TUmP7215v/99mc//janf/426H/++Cm/+7J + i//wy47/+d2h//fZnf332Z3/47V0uuGycbT215r/99qe/ffZnf/22Jr/+96o/+W5Wv/BkgX/1pMF/82Q + AP/cqELt+Nyl/PfZm//32Jz/+t+k/+7KjP/vyoz/+Nme//TTlv7wzY//6cCA5OGycJbdq2gqAAAAAN+u + bAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADcqGACAAAAAOCwbrP01Zj/++Cl+vncoPf42p7499md+PfZ + nPv425/88c6R/uvDhf/53aH/99ic//ncof7uyYr/3atpPd2qaBjsxYf3+d2h//fYnP732Jv/9tqg//7S + jv+YqkH/qZ8n/duPAP/RmiaQ7siQ1PrdoP/005b+89OV//ncof/rxIX+8c+S/+GycdXcp2RK3apnAQAA + AADgr20B365sBd+ubAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADcp2ABAAAAAN6tax7frmy46cGB/fLQ + k//215r/+Nqe//jan//42p7/6sOE//XVmP/426D/9dWY/fjcoP/luXjR3qxqA96sagTnvX3T+dyg//ja + nv353KD/9tmd///ep//Vt1X/TbRa/MOXDf/VkwVl369oavbXnP/42p376L19/+vDhP/qwoP/+Nyg//XW + mf3qwYLa4bJwht2raS0AAAAAAAAAAN+vbQHgr28DAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADfrmwB3atoLd6ta2rhsnGF4rRykOS2deHwzY//7MWG/vjbn//sxYb/89OW+/XWmf/fr22NAAAAAAAA + AADjtHSs+Nuf//PRlPzuyov/7smL/+3LkP/xvHH/krZs/JaoRv/ZkwlW2qlfAunBg+P636T/8c+R/ee9 + ff/21pn/99md//fZnv/53KH/9tic/+7KjPnluXi63qxqV92raAkAAAAA3KhgA+/XtwEAAAAAAAAAAAAA + AAAAAAAAAAAAAN+ubALfrmwE4K9uAQAAAADdqWcY4rNylvHNkPj53KH/7smL/ua7e//nvXz/+t6j/e/K + jP/dq2lOAAAAAAAAAADerWt+6L5+/+3GiPvyz5H/7smL/+/Mjv/115z//tWb/u7Ii//kt3XO3qtrJtys + al300pX/+dyh/OrBg//11pn/+Nyg//jan/722Jv799md+vncoP7425/+8tCS/+e8e9nerWxe26ZeAgAA + AAAAAAAAAAAAAAAAAAAAAAAA4K9vAd+ubAMAAAAA3qtpF9+ubJLsxYb3+Nqf//jcoP732Zz/+Nqe/+3H + if/wy43++t+j/+i+f/Hdq2ghAAAAANupZyLktnXW8tKV//fcoP3y0JT/89GU//LQkv/z0ZT/9dme//3k + pf7x1pz/6sKC+eaybFfjuHjD++Gm/+7Jiv3uyoz/7MWG//PSlf/53aL/+dyg//jbn/z42p75+Nyg+fnc + of3y0JT/4K1np+/WtgMAAAAAAAAAAAAAAADcp2AB4LBvAQAAAADdqmhi5bl46PTTl//53KH999md/PbY + nP732Z7/+d2h/+zGiP/y0ZT9+dyg/+O1dMcAAAAA3atqCe6+e8r42p3//OOl/frdoP/y0pX/+Nqf//bY + nP/x0JT//+Sk/7egff8YFhD8MS4j/7qWYeXos22B6MKD/uzFhv7005f+8c+Q/9+vbezmu3u+7ceJ8vHO + kf/01Jj+9teb//fYnP/64Kb878iF/+7VtWQAAAAAAAAAAO/XtwEAAAAA365tEN6taq3sxof/+Nuf/vja + nvv215v799md/Pndov/11Zj/8tCS/+vEhf/01Jf789OV/9+ta4gAAAAA6rhxf66Xaf8jIRr6Rj4t/+PO + lf/7253/9deb//fZnv/z1ZX//+Oz/1FFU/8AAAD/AAAA+xsWD//SpGav5LJurfLSlf/525/6+Nuf/vPS + lf/gsG+d26dkJN+ta0Lfr21s4rJxiOO2dZ3kt3ei3qpjk+/XtycAAAAA////AQAAAADcp18H4LFwvvHP + kv/53aL3+Nqe+vjbn//53KH/99md/+7Ji+TjtnXx9dea//PRlP7pv3/+5bh7/d6tbi/hr2gG3K+B5B0Z + Hv8AAAD9AAAA/0dALf//5KX/9NSY//LQlv/+4pv/0Kql/ykQRf8AAAD/FRQU/wAAAP9rUjH77rpyR+G1 + drv215v/+Nug+/jbn/v32Z3/57x8w92raBkAAAAA3q1rAQAAAAAAAAAAAAAAAAAAAAAAAAAA////BAAA + AADbpF1X78uO//reo/z21pr+9NOX/+/LjvnpwIHI4rNyYdypZYjwzI79+dug//nbn/r01Jn/3atZsgAA + AADpu2tXv4uq/wAAFfxMTkb/Q0JD/xwdHv/OuIb//96f/+7OlP//6J//ooKE/x8ATv8cIRf/kpCT/3R4 + dvuxnq//2aNsggAAAADer2+i78yO//jbn/753KD5+Nyg/+rCg+jdq2g+AAAAAN+ubAXgr28D3KdgBO/X + twIAAAAA////AgAAAADcp2Ah47V1ruO1dbzis3Gb365sZN2raSoAAAAA3KlnXe3GiP/53KD/+Nqe+vfY + m//kt3nM05QQqtOUFiLpwnOIz6TZ/xoAQfwlKx7/lpSW/+3w9P+9ron//+Cf//PWnf//56T/oIxy/zoH + dP8HAQv/U1RQ//////zgz/f/zZl+vwAAAAAAAAAA4K1qT+W5edfxzpD/99md/fzgpv/uyYr13q1qRwAA + AADgr28CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA365sAwAAAADdq2hW6cCB//jc + oP3425/59taZ/+O3e+LdpUoVw5EYr7yMJsjtwGe27tv1/1kWnf0CAQP/09TQ//b3/f+ekXf//9+e//PV + m///4aP/wbB+/1c8ef8cAEb/nZii//////26nOX/8cen1IdnOAdfSjADAAAAAN+tagndrGld4rV0u+rB + guftx4j/4K9tmQAAAADgsG8CAAAAAAAAAAAAAAAAAAAAAAAAAADcp2AB4K9vAt+ubAHfrmwFAAAAAN2r + aSjmu3rv+Nug/vndofry0ZT/4bJvzd6tciMAAAAAvI4fmVd6tf/Yojj7///o/55p3v8yAGj/2NXa/5iM + rf9sWE///+qm//LVm///4KP/1r2F/5SSkf9KLW3/ZEqA/56Itf6sktD/wbCO9SsdDEMAAAAAV0QqBeu4 + cwEAAAAAAAAAAN2raBTdq2ge365sAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADfrmwCAAAAAOGxcKb32p7/99qe/OzFhvnerWqO365wCt2qXQMAAAAA1ZQAekd72P9Xdq376LtU//Tv + 9P9vS6j/NBFS/1VGcP+ilXr//+Gg//TXnf/22J7/+NmZ/5CJc//f4Ob/jX+b/6aXtv/j5On9opZ0/9qx + csa8kVkLAAAAAOCvbAHfrmwD365sAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAADfrmwBAAAAAOCwblznvX274rRyjN2rZywAAAAA365qAtOYGAUAAAAA3JYATnqE + jf8gdP/8WnWk/9iwVf/79NT/5OX7/8XIy/+zoXP//+Sk//nXnP/715z//+iu/72rd/+Xl5b///////// + //+ysa//n5Bm+8mue//qtnCHAAAAAN+ubAMAAAAAAAAAAN+ubAHfrmwCAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgsHID1ZwnAgAA + AADPkwQi2JQAM6qLQuAydvn/L3j//kFyy/+uk1n//+in/5GMfv/hyZD/4q09/8qvTP/XyYH/9MV2///m + p/+voHf/ko6H/6Cem/+Eel3/1LyG/v/jpf/it3jo3KtoFgAAAADfrmwBAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+ubAPfr20C365rBOCv + cAIAAAAA0JMCAgAAAADPkwAq0ZQCm9mZErxPe8v/Mnb5/TN4+f8vdPX/Y3SP/7OTR//7znf/+c+K/9u6 + X/+f16v/o9+7/9m5YP//2pH/4syW/9a7gf/536D/4seP//LQk/3vyoz/3atoUAAAAADfrmwDAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTAwIAAAAAxpEStdSaJP+fi1z8KHT//zp47f84ePP/LHf//zp5 + 7f+cwaD/zsh4/+3Gdf/ts03/qN+7/5Lz7//BuGX/+cp4///nsP/115v//N6i/+/Ji/vxzpD/365seAAA + AADfrmwEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM+RAQMAAAAA0ZEAUW2Alf+ciV/9UXvK/zB2 + /P83d/H/Onnv/y5v9f9Oov//mP/7/5fn2f+v27T/uMeG/5j39P+R/P7/tr94//C/aP/426P/99qe/+/L + jfvvy43/4LFvfQAAAADfrmwEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANmkRgEAAAAA5Kc8CKuQ + VtosdPL/Q33i/TR19f82d/L/Nnfz/zh58/8vbO//c8X5/5////+P+v//k/3//5j2/f+Y9/7/kP3+/7fG + h//30I3/+N2j//HNj/zuyIr/4K9tXAAAAADfrmwEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADgsHMCAAAAAOmtRah4b4X/JWb//Dt+7v82ePP/Nnbz/zd48/81dvP/Nnfz/4ni+/+d/fz/lvP9/5f3 + //+X9v7/l/n//5b08f7nzZX9+9uf/vTUl//rxIX63qxpKgAAAADfrmwCAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAADfrmsDAAAAAOGxdFnjrUb/WlCr/ClT//86d+7/Nnvz/zZ38/83ePP/MnLy/0GF + 9P+T8P7/m/v//5X1//+X9/7/mfb9/pD7//3SyJX//NeY+fjcof/luXnFAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADfrWoBAAAAANyqaQbrwoTN4rRT/1VHq/0nPf/9OWPu/Td5 + 8f82evP/OHnz/zBv8v9HjfX/lfP+/538/f+W9fz8kv///63NkPXXnTeq9NKb+vLQkv/erGlWAAAAAN+u + bAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0pYOAgAAAADXoUtR9M+X9ezD + Yv1vXpv+JjP//zBG+P83ZvH/Nnnz/zh98/8yb+//R4ry/ofp//uW/fz/tsB4+dOKAFoAAAAA4rV6iuGx + boIAAAAA365sAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANCS + AAPPkgA91JsryunBe//nrzvAonlJsExK0P41PO//OE7t/zRo9P0weP39I23//luJzP/Gqjva1YsAOQAA + AADYo0ADAAAAAAAAAADfrmwBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAANCTAQEAAAAA0JIAKsiLCaybd1zmkHFoz4Bog/Y8ReP/LDn8/zk/6v5ZZLz/moxc89GQ + B4rTjgAQAAAAAM+RAAPYoj8B4LB0At+uagIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQkwABAAAAAAAAAADPkgU5roE5oJZ0XtiVdGPxn3lS87uI + JtbXkwKM3JUAJgAAAADPlAMC0JMBAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//4AH///AAD//AAAH/8AAP/gAAAf/wAA5wAAAB// + AADzAAAAP/8AAPkAAAD//wAA8AAAAf//AAD4AAAB//8AAPgAAAD//wAA+AAAAP//AAD8AAAA//8AAPwA + AAD//wAA/gAAAf//AAD/AAAB//8AAP+AAAf//wAA/8AABB//AAD/YAAAH/8AAP+AAAAf/wAA/8AAAAAf + AAD/4AAAAB8AAP8AAAAAPwAA+AAAAAB/AADwADAAA/8AAPgAMAYA/wAA/wAwBgA/AAD/gHgDAA8AAP4A + cAEAAwAA/ABgAAADAADwAGAAAcMAAOAAwABA/wAA4EDAACB/AADjwIAAOD8AAP+CAAA+HwAA/wYAAD// + AAD+DwAAH/8AAP8/AAAP/wAA//8AAA//AAD//gAAD/8AAP/+AAAP/wAA//8AAA//AAD//wAAD/8AAP// + AAAP/wAA//+AAA//AAD//4AAH/8AAP//wAGf/wAA///AA///AAD//+AH//8AAP//+B///wAAKAAAACAA + AABAAAAAAQAgAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANCUAwMAAAAAAAAAAAAA + AADfrmoCAAAAAN+tajflunnb7ceJ7u7Iiu/munng5Ld25PHNj/bvyo356L9/9d+ubHnfr21H4LBwaeCw + cG7fr21R365sDAAAAADfrmwBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANScFA3PkQATAAAAAM+R + AArVnjAT4K9xKd+taVffr21p3qxrsPHOkP/53aP9+d2i//LRlP/qwYL/+t6j//jboP/32p3/5ruD/+W8 + jf/mvY3/5r6P/eW7iv/frm1NAAAAAN+ubAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA1JwUF8+R + AIvQkwKDz5IACN6oVM3juYb/5LqG/uW9jP/juor+68SH/fjbnv732Z3+9NOX/urAgf74257/99mc//bX + mf7mvYf+5r+T/ue/k/znv5T/47Z+3N+tahAAAAAA365sAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPz4 + 7QIAAAAAz5EAH9OXA9fNkQCFzapT1uq/lv/kwJT75b6S++a+kv3nvof/99mc//fanv/215v/6sGB//fZ + nf/32p7/9taZ/+W8hv7kuYb/47eA8uGydrPfrWoqAAAAAN+ubAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA/PftAgAAAADOkAAnx4QTxM2VAvhjvHD71L+P/++3gv/uwoz/5LyL/+O5g//005b/+Nqf//fZ + nv/qwoP/9tea//jan//11Zj/5byJ/Oa+kv/hsXS+AAAAAN+ubQLfrmwBAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAA05oWAQAAAACqYDXCxXUb/2m5T/x03sP/xdO9/7Slmv/luYL/5LuM/+/K + jv/425//+Nuf/+vEhf/01Jf/+Nug//TUl//lvIn+58CU/+O4g+7frWoYAAAAAN+ubAEAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADTmxUDAAAAAMeJEFWmSkH/sqAb/ELIjP+J/P//lcbR/+m5 + hf/kvpP/6cKK//janf/43KD/7ceJ//LQk//53KH/89OW/+W7if7nv5P/5LqH/d+taiwAAAAA365sAgAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKxjMsG4YC3/dLg//E/X + tv++5tH/6biD/+XAlP/kuYL/9NSW//ndov/vy43/8M2P//ndov/z0pT/5LmC/ufAlf/juYT1361qHwAA + AADfrmwCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM+RAAIAAAAA05kAMaBJ + RPa1fib/SMdp/XHMpP/wu4n/4r6R/+a9gv/z0ZP/+d2h//HOkf/vyoz/+d2i//TUlv/ov3785b2O/+Gy + dK8AAAAA369tA9+ubAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANCT + AwMAAAAAyo8MUJ9BR/+nizD/Q8ls/qy9iP/6u5D/7cSJ//LRk//42p7/89OW/+3HiP/74Kj/7MV1/+Gx + V/3gsHRs3apnC96sagHdq2gBAAAAAN+ubAHfrmwB365sAd+ubAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAM+RAQ3UmAAcyo8NSaZKPOmidyn/cLJP/pK1dP/awoT/99SW//TUmP/32Zz/8tCU///o + pv/Giln/unZK/vHMg6zkuHnC57t72OvChNXhsnBbAAAAAN+vbQIAAAAAAAAAAN+vbQEAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAADVmyECAAAAAM+RAGHFgw6vwIEivMeCZP/lrVz+vb1x/9zFhv/51pn/9NWY//ja + nv/22J3/9taJ/8uQRP+iUj//+t2U//bXnf/vyoz7+Nqf/+Gxb4wAAAAA3atoBd2raAHdqmgBAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADdqmACAAAAAMF+FVPBf0Xg/eSe/PLSmv/60JX/9NCT//LQ + k/343KD+9tib//ncpP/jtlv/3Kcg/7p0FP/owID7+Nue/O3HiP3uyYv87MaH2uzFhtbsxIbT7MSGzO3H + iOHktnaRAAAAAOK1eAIAAAAAAAAAAOK1dgEAAAAA3qtpDt+ubkDis3li5LZoX+OzWI/pwIPy78qL/+/O + kP722Z3+7siJ//janv/22Jv/+t6n/+jAaf/RjwD/zYwA/96vT//74an+9tea/+/Mjv/22Jz/+t+k//vg + pf/63qP+89OW/+O0c3cAAAAA4rV4AwAAAAD9+fUCAAAAAN2qZx/qwoTs9tea//bXmf732J//+dym//TT + lv/wzI7/+d2h/vbWmv/gsG6O7ceJ2/ncoP/22Z3++tib/8OjLP7MkAD/2p8p5fbYofX32Zz/99mc/+/L + jf3yz5L96cCAx+S3doDerWssAAAAAN6taQIAAAAAAAAAAP359QEAAAAA3qtoDOW4eLXwzpD/9teb//fZ + nP3115n87sqL//fZnf74257/7ceI6dunZQHmuXmX+d2i//bZnPv/3KP/y8Jx/ICiLf/UjwaX6MF+qPja + n//tx4j87ciJ/vLRlP/nvHy33q1rOQAAAAAAAAAA3q1qAeK1eAMAAAAAAAAAAAAAAAAAAAAA3q1qAt6s + aiPfrmxK47Rzqe/Ljf/vy43+7ceJ+/XWmv/munmpAAAAAN+wb2rvzI//8MyO++7Ljv/xyIb7r710/86i + NpbeqWEq89Sa/+/KjP/wzI7/+t+k//ncof711Zn/7MaH3OK0c3rcqWUVAAAAAP369QEAAAAA4rR4Ad6t + agMAAAAA3qtpGuW4eJPy0JTy+dyg//LPkf7sxYb79teb/+Cxb2sAAAAA67p2i/fTlP/x0ZX88c6Q//PS + lv//3qP+8NKb/+W2dZLrvn2l9dec/+7Ji/zxzpD/99ic/vreov/636T++dyh/+7JifHkuHxWAAAAAP35 + 9QEAAAAA3apmAt+vbXjtyIn2+Nqf//ncof753KD/8tGU//LRlP/y0JH/3KpoIui3clHDqHb/2sWR/f3f + of/01pz/+NiZ/+7Tn/8vKyX/Mywd/9SmZ6vtxIPp9NSY/+/KjP/jtXTB6L5+qu3Hid/wzZDt89KU/+rE + itL79/IEAAAAAOGzdgPjtXOu9tab//vfpf343KD/9dWZ9OvEhe/y0JL+78qM/+O5f8jns24HtJBn1wAC + Bf8OCwX9172H//rZnv//4Zz/rYyR/wIADP4AAAL/W0Uq4+67dIbtzZP8++Cl//LQk+/gr21jAAAAAN6t + axfdqmYk4bN2EQAAAAAAAAAA4bN2M+zGhv/y0ZT37MWH2ue9fYjfrWtt7MSG7PvgpP3xz5P/1586bu++ + bjd/WIH/HR0k/U5QVP+rnX3//tud///km/97Vnn/EQQk/36EePy7sLz/26ZzWvG+cz7ux4jq+Nug//nc + oP/mvHuVAAAAAAAAAAAAAAAAAAAAAAAAAADitXgC3qtnKt6saigAAAAA26dkGunAgdv74KX/8tKX/+Gv + YoC/iAuY7L9Xq7mR2v8RACX92ODX/8a8rP/w0ZP//+Wg/6CIg/8UAED/qqyo+/bj///Fmn6RAAAAANOk + ZRbktHJ968WG1u/KjP/gr21ZAAAAAOK1eAQAAAAAAAAAAAAAAADerGkBAAAAAN6sagnpwIDR+t+k/+/K + ivjfsXpxAAAAAJWFU7eRkof//uDI/GA1qP+Bcpb/g3Jy//ncnP/93qL/ybiI/3ttkv98Y5P9v63U/6eU + c9UpHQ4QAAAAAAAAAADaqGcG3qxqF9+ubQcAAAAAAAAAAAAAAAAAAAAAAAAAAN6saQQAAAAA3qxqHOrC + gsbnvXyk3qxtLQAAAAAAAAAAu5AmjC5w6v+fnYj76Mqq/5+Wvv+poIv/+NmU///anP/rzZH/rq+h/+7v + +v/Mzs38sJ5y/+69eJEAAAAA3q5sBt+vbQEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAADgr24BAAAAAM2RABLalgBzXIC8/x9s//+AkKT/0L+N/9e3df/sulf/wcWA/+fW + kf/buH3/trGe/66gfv7exIz/7ciJ8t2qaB0AAAAA365sAt+ubAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAN+ubAHfrmsB4LBzA9qmTAMAAAAAz5IAB9KVDMOjjVz/Mnb6/it0/f83atH/o7Od/+XQ + gP/Vv23/n926/8vQj//6zH7//OGl//TVmPzvyoz/4K9uTgAAAADfrmwDAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANCUCgQAAAAAu5EuenGDmP9IfNv8Nnf1/zF0 + +f86if//kvL1/6zlyv+m48n/jPr//7vLkf/2zof+9tie/O3Hif/hsXBRAAAAAN+ubAMAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA361qAgAAAADqsFYufn6R/SZr + //87fvD/OHny/zFs8P9bqPn/m////5P4/v+Z9///jvj7/dPWqv392Jr97MiL+9+taygAAAAA365sAgAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADqtF7HamKn/yRV//w5evH+OX3y/y9t8v9ruvf/ov/8/5j2/PyP////wc2d9/7Xl//pwoTCAAAAAN+v + bQEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADWnSsDAAAAAN6rUFfvxHf/emil/C1E9/41ZvX/OXzv/zFz8v1juv38lP7//7PDed3WmCQ+572DsOCw + bUMAAAAA365sAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAM+RAAEAAAAAzY8AFNulMb3WpkvrhWd10TpA6P8rR//+MWf5/lJ6xP+4n0Ky1Y0AGAAA + AADernEB3q1qAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTAgEAAAAAz5AAB7yGGmGhe0+/f2iC9HpiiPamfETH1JUFVAAA + AADNkgAB1Z0rA+CwdALfrmoCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/wD///4AB/8gA + Af/gAAP/4AAH/+AAB//wAAf/8AAH//gAB//8AB///gAB//wAAP/+AAAH/gAAD+AAAB/gCAA//AwID/gY + AAPwGAABwBAAP8IwAw/8AAHP+MAB//nAAP//4AD//8AA///gAP//4AD//+AA///wBf//8A////w//ygA + AAAQAAAAIAAAAAEAIAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAADmxXcHzIsAC9WaHgjesHAk3q5sYvDM + jfPvy4307siK9vLQk/rjtny247iEzeGydXgAAAAA369uAwAAAAAAAAAA5sV4Bs6MAGPSojCY6rqK/+a7 + h/7x0Jb/99ib//LPkv/42p7+5r6L/+S6iPPgsXJRAAAAAN+vbgMAAAAAAAAAAAAAAADLegBrlp9A/7LR + r/zftZD+7MaM//bYnP/xzpH/9tea++a9jP/gsXNyAAAAAN+ubQQAAAAAAAAAAAAAAAAAAAAAy4UAG6hu + Ku1h2KX/xsy5/u+7hP/015r/8tCS//XWmfvnwJH/4rV7iwAAAADfrmwF369uAQAAAAAAAAAA5cN3AwAA + AADMexRghoNC/4/Eg/7svIn/89SW//PSlv7y0ZH/47Z04N6tbjUAAAAA365sAgAAAAAAAAAAAAAAAOjJ + gwEAAAAA0pgDC75uGayomFT/ycR//fjUmP3636H+26xq/8+YYuDyz47e5rt7pwAAAADfr20M3apkBQAA + AAAAAAAA3qtoDd6sXTLXo06X9cqP//TRk/7005b++t+n/9ulMP/XnDX/+dyl//DNjvfxz5Li78yP59+t + aD0AAAAAAAAAAOGwa2jz0pn/9taa8/HRlP/y0ZTo4rZ2jfrbpP/bw23/u5cV2fbPkNny0pb/8M2P6+K0 + dFIAAAAA7tOwAe7UsQEAAAAA4bNxWvDNj+3y0ZP/6cKCsuq4czj72Zn/79KX/9e/dNfpu3ag8tCT//LR + lPT01Jjz6b98sO/Vsh8AAAAA5bh0mPbXnP/z05bu8dCU//DAf3eLcEm1oI9l///urPxwYFj/UkEm2/7V + kNnz0ZT8571+j+i8eZfw2LVF7tOwFOa5dZblunlt78mN3enFguTkrlWBXEhq+YSCfP//5ab/UDxW/pSK + nv/Em3BJ3rh5l+7GiMPbpV8OAAAAAO7UsQMAAAAA47V0Y+zIkcPdoTYUko1uw6ubvv+xmJX999eP/7+p + lvy5ss//nodimQAAAADktHIb3aplDgAAAADu1LAB3aljBOCwcQkAAAAA2ZMABJiHVcdCf+n/paed/dvM + ef/N0Jj+3cON/u/Oj/jls3AlAAAAAN2qZAIAAAAAAAAAAAAAAAAAAAAA3KtlBQAAAACslG6pJ2v4/y97 + +vyR3Ob+mfvy/Mfjw//4z4/83a5tJgAAAADdqmQCAAAAAAAAAAAAAAAAAAAAANqmTAMAAAAA36pQTIR/ + rv8tXfb9OoX+/oTo//+6z5jL67p2lwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANKU + AATYnB2DdWCT6FVfvPenj0OI2pYSBgAAAADfrmwBAAAAAAAAAAAAAAAA+B8AAMAfAADAPwAAwB8AAOA/ + AADgDwAA4AMAAMAHAADiAQAAhAEAAKATAADoDwAA+A8AAPgPAAD8DwAA/D8AAA== + + + \ No newline at end of file diff --git a/contrib/patcher/PonyPatcher/MainForm.Designer.cs b/contrib/patcher/PonyPatcher/MainForm.Designer.cs new file mode 100644 index 00000000..01d4f25f --- /dev/null +++ b/contrib/patcher/PonyPatcher/MainForm.Designer.cs @@ -0,0 +1,110 @@ +namespace PonyPatcher +{ + partial class MainForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); + this.buttonPatch = new System.Windows.Forms.Button(); + this.labelStatus = new System.Windows.Forms.Label(); + this.buttonAbout = new System.Windows.Forms.Button(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.SuspendLayout(); + // + // buttonPatch + // + this.buttonPatch.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.buttonPatch.Location = new System.Drawing.Point(12, 90); + this.buttonPatch.Name = "buttonPatch"; + this.buttonPatch.Size = new System.Drawing.Size(273, 23); + this.buttonPatch.TabIndex = 0; + this.buttonPatch.Text = "&Patch!"; + this.buttonPatch.UseVisualStyleBackColor = true; + this.buttonPatch.Click += new System.EventHandler(this.buttonPatch_Click); + // + // labelStatus + // + this.labelStatus.Location = new System.Drawing.Point(82, 9); + this.labelStatus.Name = "labelStatus"; + this.labelStatus.Size = new System.Drawing.Size(234, 67); + this.labelStatus.TabIndex = 4; + this.labelStatus.Text = "status"; + this.labelStatus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // buttonAbout + // + this.buttonAbout.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.buttonAbout.Location = new System.Drawing.Point(291, 90); + this.buttonAbout.Name = "buttonAbout"; + this.buttonAbout.Size = new System.Drawing.Size(25, 23); + this.buttonAbout.TabIndex = 1; + this.buttonAbout.Text = "?"; + this.buttonAbout.UseVisualStyleBackColor = true; + this.buttonAbout.Click += new System.EventHandler(this.buttonAbout_Click); + // + // pictureBox1 + // + this.pictureBox1.Image = global::PonyPatcher.Properties.Resources.pony; + this.pictureBox1.Location = new System.Drawing.Point(12, 12); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(64, 64); + this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.pictureBox1.TabIndex = 5; + this.pictureBox1.TabStop = false; + // + // MainForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(327, 123); + this.Controls.Add(this.pictureBox1); + this.Controls.Add(this.buttonAbout); + this.Controls.Add(this.labelStatus); + this.Controls.Add(this.buttonPatch); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "MainForm"; + this.Text = "Pony Patcher"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing); + this.Load += new System.EventHandler(this.MainForm_Load); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button buttonPatch; + private System.Windows.Forms.Label labelStatus; + private System.Windows.Forms.Button buttonAbout; + private System.Windows.Forms.PictureBox pictureBox1; + } +} \ No newline at end of file diff --git a/contrib/patcher/PonyPatcher/MainForm.cs b/contrib/patcher/PonyPatcher/MainForm.cs new file mode 100644 index 00000000..a7be949a --- /dev/null +++ b/contrib/patcher/PonyPatcher/MainForm.cs @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Drawing; +using System.Windows.Forms; +using PonyLib; + +namespace PonyPatcher +{ + public partial class MainForm : Form + { + public MainForm() + { + InitializeComponent(); + } + + private void MainForm_Load(object sender, EventArgs e) + { + this.Text = string.Format("Pony Patcher [v{0}]", VersionInfo.Client.RequiredClientVersion); + this.buttonPatch.Enabled = false; + + try + { + if (Patcher.IsAlreadyPatched()) // check if process is already patched.. + { + labelStatus.Text = "Process is already patched!"; + labelStatus.ForeColor = Color.Red; + buttonPatch.Enabled = false; + } + else if (Patcher.IsClientRunning()) // check if process is running.. + { + labelStatus.Text = "Client is running and ready for patching.."; + labelStatus.ForeColor = Color.DarkGoldenrod; + buttonPatch.Enabled = true; + } + else + { + labelStatus.Text = "Client is not running. Please run it first!"; + labelStatus.ForeColor = Color.Red; + buttonPatch.Enabled = false; + } + } + catch(Exception exception) + { + labelStatus.Text = exception.Message; + labelStatus.ForeColor = Color.Red; + buttonPatch.Enabled = false; + Patcher.Cleanup(); // let LibPony to cleanup stuff. + } + } + + private void buttonPatch_Click(object sender, EventArgs e) + { + buttonPatch.Enabled = false; + + try + { + if (Patcher.Patch()) // try patching. + { + labelStatus.Text = "Patch successful!"; + labelStatus.ForeColor = Color.DarkGreen; + } + else + { + labelStatus.Text = "Can not patch the client!"; + labelStatus.ForeColor = Color.Red; + } + } + catch (Exception exception) // catch LibPony exceptions. + { + labelStatus.Text = exception.Message; + labelStatus.ForeColor = Color.Red; + } + finally + { + Patcher.Cleanup(); // we finally need to let LibPony to cleanup. + } + } + + private void MainForm_FormClosing(object sender, FormClosingEventArgs e) + { + Patcher.Cleanup(); // make sure LibPony cleanup's it's dirt. + } + + private void buttonAbout_Click(object sender, EventArgs e) + { + var aboutForm = new AboutForm(); + aboutForm.ShowDialog(); + } + } +} diff --git a/contrib/patcher/PonyPatcher/MainForm.resx b/contrib/patcher/PonyPatcher/MainForm.resx new file mode 100644 index 00000000..9a311598 --- /dev/null +++ b/contrib/patcher/PonyPatcher/MainForm.resx @@ -0,0 +1,1504 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + AAABAAQAgIAAAAEAIAAoCAEARgAAADAwAAABACAAqCUAAG4IAQAgIAAAAQAgAKgQAAAWLgEAEBAAAAEA + IABoBAAAvj4BACgAAACAAAAAAAEAAAEAIAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA365sA9+ubC3frmxX365sfN+ta5berGqo3qxpsd6s + abTerGm13qxpst6saq3erWuj365slN+ubILfrmxp365sSd+ubEvfrmx6365sld6saqveq2i83atozN6r + adneq2ng3atp492raOXdq2nk3qxp4N6ta9bfrmzB365soN+ubGffrmwdAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+u + bFrfrmzD361r+N2raf/erGr/4LBu/+K1c//kuHf/5bp5/+W6ef/luHf/47Z0/+Gycf/frmz/3ato/96s + av/frmz+365s99+ubP/frWv/5Ld2/+nBgf/sxYf/7siJ/+7Iif/txoj/68SF/+i/gP/luHf/4bFw/96s + av/dq2n/361r/9+ubObfrmxeAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADfrmxn365s/9+ta//frmz/6L+A//DOkf/11pn/99md//ja + n//425//+Nuf//jan//42p7/9teb//PSlf/tx4j/47Z0/9+tav/frmz+3axp/+zFh//53KD/+dyh//nc + oP/53KH/+dyh//ncoP/53KH/+dyg//jan//215r/8c6Q/+i+fv/frmz/3qxq/9+ubO/frmwZ365sBd+u + bBbfrmwt365sP9+ua1XfrWtm361qct+taoLfrWqP361qlt+tapjfrWqR361qgd+ta2zfrmtS365sKt+u + bAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+u + bK7frmv/361r//DMj//53aL/+Nug//janv/32Z7/99md//fZnf/32Z3/99md//fZnf/32p7/+Nuf//nd + of/32Z3/47R0/96sav/erGr/8c+S//jboP/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//ja + nv/426D/+dyh//LRk//is3L/3q1r/t+tasLfrWnO361q59+ua/ffrm3+37Bv/+Cwcf/gsXP/4bJ1/+Gz + dv/hs3f/4bN3/+Gzd//hsnX/4LBx/+Cvbv/frWr3361qxt+ubGHfrmwCAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA365sad6tav/is3H/99md//fanv/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//ncof/nvXz/3atp/9+sav/xzpH/+Nug//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+t6j/+zFhv/dqmn/4rR5/+O3 + f//kuYT/5LqI/+W8i//mvo3/5r2P/+a+kP/mvpH/5r+S/+a/kv/mv5L/5r+S/+a/kf/mvpD/5r2N/+S6 + h//hs3b/365r/9+ubF0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+ubAXfrmwP365sHt+u + bCvfrmxW3q1r+OCvbv/11Zn/+Nqf//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/+dyh/+rCgv/dq2j/3qxq//DNjv/43KD/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/53KH/68SE/96sbP/mvpH/5sCU/+a/kv/mv5L/5r+R/+a+kf/mvpH/5r6Q/+a+ + kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpH/5sCU/+W8jf/frmz/365sYwAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAA0JMACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADfrmwK365sKN+u + bEffrmxm365sht+ubKTfrmy3365szd+ubN/frmzs365r9t+ta/rfrWv+3qxq//HNkP/53KD/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/53KH/7siJ/92raf/dq2n/78uM//jc + oP/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//ncof/qwoL/3q5u/+a+ + kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+ + kP/mv5H/5buK/9+ubP7frmw8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQkwA00JMAnc+Q + AB0AAAAA4K9yDN+ubELfrmx9365sr9+ubNnfrmz1365r/9+ta//frWr/361q/9+tav/frWr/361r/9+u + bP/fr27/4LBx/+Cwcf/dq2j/68OF//ncof/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//jcoP/xzpD/3qxq/92raf/uyIr/+dyg//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/+dyg/+nAf//ernD/5r6R/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+ + kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a/k//juIH/361p4N+ubA8AAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTAAvQkwA/0JMAetCTAKbQkwC70JMAqtCTAIrQkwBN0JMADQAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTAArPkgDj0ZUN2t2qXo7gr3DW365s/t+tav/frWn/361p/9+u + a//fr27/4LBy/+Gzdv/itHv/47d//+O4g//kuof/5byL/+W9jf/mvpD/5byM/9+sav/luXj/+Nuf//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nuf//PSlf/frmz/3ato/+zF + hv/53KH/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/53KD/5759/+Cv + cv/mv5H/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+ + kP/mvpH/5r+R/+Cxcv/frWqXAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0JMADtCT + ACrQkwA40JMAYNCTALbQkwD/0JMA/9CTAP/QkwDU0JMAZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANOX + FLHeq2P/4K9w/9+tav/frmv/4LBx/+K0ev/juIH/5buI/+W9jf/mvpD/5r+S/+a/k//mv5P/5r+S/+a/ + kv/mv5H/5r6R/+a+kf/mv5L/4bJ0/+Cwbf/21pn/99qe//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/42p7/9taa/+Gxb//dqmj/6sGC//ncof/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//ncoP/nvHr/4LF0/+a/kv/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+ + kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a/k//jt3//361p+N+ubDIAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTAEXQkwDb0JMA/9CT + AP/QkwD/0JMArNCTABYAAAAAAAAAAAAAAAAAAAAA16I6nuCxdv/frWv/4bN4/+S7if/mvpH/5r+S/+a/ + k//mv5L/5r+R/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a/k//juIL/3atn//DN + j//426D/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/42Z3/47V0/92p + Z//ovX7/+dyg//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+dug/+a5 + ef/gsnf/5r+S/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+ + kP/mv5P/5LmF/9+ua//frmuNAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTACPQkwDV0JMA/9CTAP/QkwD/0JMAxtCTABcAAAAAAAAAAAAA + AADWmyeX4K9x/+CvcP/mvpD/5r+T/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+ + kP/mvpD/5r6Q/+a+kP/mvpD/5r+R/+a8jP/dq2r/6sGC//ncoP/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//jbn//munr/3Klm/+a6ef/426D/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/425//5bh2/+Gzef/mv5L/5r+S/+a+kP/mvpD/5r6Q/+a+ + kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mv5H/5r+T/+O4g//grmv/365rv9+ubA0AAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANCT + ACjQkwDl0JMA/9CTAP/QkwD/0JMAttCTAAYAAAAAAAAAAMyWEKLgrGT/4LBw/+a9jf/mvpH/5r6Q/+a+ + kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r+S/+Cw + dP/jtnT/+Nqe//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+dyg/+nA + gf/cqWf/47Z1//fanv/32Z7/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//jb + n//luHX/4bR8/+W8jf/kuYb/5r6R/+a/k//mv5H/5r6Q/+a+kP/mvpD/5r6Q/+a+kf/mv5L/5r+T/+W8 + jP/is3j/361q/9+ua77frmwZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTAA7QkwAJAAAAANCTAFPQkwD+0JMA/9CTAP/QkwD/0JMAfAAA + AAAAAAAAzJIBudyjQf/hr3D/47mD/+a/k//mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+ + kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mv5P/47eC/9+uav/01Jf/+Nuf//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/53KD/7MWH/92qZ//is3L/9tic//janv/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md/+O1dP/htX7/58CU/+O4g//hsnT/47eB/+W8 + jP/mvpD/5r+R/+a/kv/mvpH/5r2O/+S6h//itHr/4K5t/9+tavrfrmyP365sDQAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0JMAEtCT + AITQkwAkAAAAANCTAKfQkwD/0JMA/9CTAP/QkwD00JMAKNGTAAbUkQDgnKlC/9awcv/jsHL/5r6R/+a+ + kf/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a/ + kf/mvYz/3qxq/+7Iiv/53KD/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//jc + oP/vy43/3ato/+Cwbv/11Zj/+Nqf//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nv/32Z3/47Ry/+K2gf/mv5L/5r+S/+S6h//gsHH/361r/+CwcP/hsnX/4bJ3/+GxdP/gr2//361r/9+t + avHfrmuq365sPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0JMAX9CTAN3QkwAl0JMAHtCTAPTQkwD/0JMA/9CT + AP/QkwCW0ZMAOtOSAf1TuWT/lbl3/+uqZv/jt4H/5r+T/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+ + kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a/kv/fsHP/5rt6//ncoP/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nuf//LQk//frWv/361r//TSlf/425//99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99qe//fZnP/is3D/47eD/+a/kv/mvpD/5r+S/+W+ + kP/jt4D/4bBy/9+tav/frWr/361q1N+ua6Hfrmxm365sJQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADQkwAF0JMA3dGUAN3RlAAY0JMAktCTAP/QkwD/0JMA/9CTAOnWkQC8upoX/z7Bev9Hwn7/0LJx/+Wt + av/lvIv/5r+S/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+ + kP/mvpH/57+U/+O2gP/hsW7/9teb//fZnv/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/42p//9dWY/+Cwbv/eq2r/8c6R//jbn//32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/42p7/9tib/+Kxb//kuYX/5r+S/+a+kP/mvpD/5r6R/+a/kv/mv5P/47iD/9+tav/frmyBAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADRlQCDx4YO/9CSA8XRlQBG0JMA9NCT + AP/QkwD/0JMA/9qQAP+JqkD/OMSC/zfBef+G0af/57Bw/+Kvb//lvo//5r+R/+a+kP/mvpD/5r6Q/+a+ + kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r+T/+W8i//lu4j/5b2N/96tav/xzo//+Nyf//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fanv/22Jz/4rRy/92qZ//vyYv/+Nyg//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//janv/21pr/4bFv/+S6iP/mv5L/5r6Q/+a+ + kP/mvpD/5r6Q/+a+kf/mvpD/4LBx/9+ua9DfrmwHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAANOXAEDAfBr+p1g7/9abAKPRlQC60JMA/9CTAP/SkwD/zpQF/1S8bP88w3//Pr5z/1DT + of+33MP/5Klh/+Kwcv/lvpD/5r+S/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6R/+a/ + k//ku4j/4K9v/+S7if/mwJP/369y/+nAf//53KD/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//jan//luXn/3Khm/+zFhv/53KD/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/+Nqe//XVmP/hsW//5buK/+a/kf/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a/k//jtX3/361q/d+u + bDsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0JQAD9OXAt+ONVr/oE9C/NSZ + ANvRlQD/0JMA/9GTAP/UkgP/ZLZf/zrDgP9CwHn/P8B2/37w4/+92Lz/5Kdg/+OvcP/lvY7/5r+T/+a+ + kP/mvpD/5r6Q/+a+kP/mvpD/5r6R/+a/k//mvpD/4rZ9/96saP/is3b/5r+S/+a/k//itn//4rRx//fZ + nv/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+dyg/+i+fv/cqGb/6cCB//nc + oP/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/42p//9NSW/+Cwb//lu4v/5r+R/+a+ + kP/mvpD/5r6Q/+a+kP/mvpD/5r+S/+W7iP/frmv/365sfQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAA1psAnrFnLf9yDX3/olFB/9WaAP/RlAD/0JMA/9qQAP+eoy//OcSB/0LB + e/89vXL/XNKi/5f///+z3MP/361r/+WqZf/lt4P/5r6R/+a/k//mv5L/5r+T/+a/kv/lvY7/47iC/+Cv + bv/frGj/4bN2/+a9jv/mv5H/5r6R/+W8i//frWv/89GU//jbn//32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/53KD/68OF/9yoZv/nu3z/+Nyg//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//jbn//z0pX/4K9v/+W8jf/mvpH/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6P/+Cw + cP/frmu4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADSlgBJzI0I/4Up + Zf91Enj/tGop/9abAP/QkwD/05IA/8uVCP9QvG//PcN+/0HAef9Av3f/hOve/5f///+i7OL/ycWV/96u + a//lrGn/6LJz/+66eP/vunX/7Ldv/+Cvbv/frmv/4bN2/+S6h//mv5H/5r6R/+a+kP/mvpD/5r+R/9+v + cv/sxIT/+dyh//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//jcof/uyov/3Klm/+S3 + dv/32p7/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nuf//LRk//fr2//5r2O/+a+ + kf/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mv5L/4rN4/9+tauTfrmwTAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTAAjWnADTpVY8/3QRef+HK2L/zpAH/9KWAP/QkwD/2pAA/4Wr + Qv84xIP/QsF6/z2+c/9Yz5r/m/r+/5X7//+T+///oO7l/7Pew/+2xKr/nJSc/5qWoP+Jka7/z6d1/+a3 + fP/mwJX/5r+S/+a+kP/mvpD/5r6Q/+a+kP/nv5P/4rV+/+S3df/42p//99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/+Nug//LPkv/eq2n/4rNy//bYnP/32p7/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/426D/8c6Q/9+vcf/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a/ + k//jt4D/361q/N+ubDcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANOX + AHbHhhD/fyJr/3YTd/+sYTP/1pwA/9CTAP/VkQD/vpkT/0TBef8/wnz/QsF5/zy+cv975s//nvv//5b3 + //+U+v//k/3//5P8//9Flv//H2n//zh48v/SqXT/6LqB/+a/kv/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a/ + kf/lu4v/4LBu//TUl//325//99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/4257/9NSX/9+u + bP/gr27/9dWY//jan//32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//jboP/wzY//4K9x/+a+ + kf/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r+S/+S6h//frWr/365sVgAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0JMAG9acAOuhUUH/dRJ4/4YqY//MjQn/0pYA/9CT + AP/ZkAD/d7BQ/zjEg/9CwXr/Pr91/0zHiP+V9vb/mfj//5f3/v+X9/7/m/3//4zp/f80fPn/THnd/9+v + a//mu4X/5r+S/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a/kf/fr3L/7siJ//ncoP/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//janv/215v/4bFw/96tav/z0pT/+Nuf//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/+Nyg//DMjf/gsHL/5r6R/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+ + kP/mv5H/5byL/9+vbf/frmxuAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA05cAjsmIDv+BI2n/dhR3/6VWPP/XnAD/0JMA/9eRAP+5mhj/QcF8/0DCfP9CwXr/O71w/2jZ + s/+e+///l/f//5f3/v+X9/7/nv///3jW//9hiNL/4q5n/+W8if/mv5L/5r6Q/+a+kP/mvpD/5r6Q/+a+ + kP/mvpD/5r+T/+K0ff/nu3r/+dyg//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//ja + nv/jtnb/3apn//DOkP/43KD/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/43KD/78qL/+Cw + df/mv5L/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a/kf/lvY7/4K9v/9+ua4cAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQkwAl15wA8adZOv92E3f/fyBs/8WC + Ff/UmQD/0JMA/9qPAP92sFH/OMWD/0LBev9BwHj/QMB3/4Xr3/+c+v//l/f+/5f3/v+X9/7/l////6XX + zf/iqmb/5byL/+a/kf/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mv5H/5buJ/+GycP/215r/99qe//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+dyg/+e8fP/cqGb/7siK//jcoP/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//jcoP/tyIj/4LF3/+a/kv/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+ + kP/mvpD/5r6R/+W9jv/gr2//361rkQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAADSlgCRzZAI/4csYv92Enj/lUBR/9SaAf/RlAD/1pEA/72ZFv9DwXr/P8J8/0LB + ev89vnT/UcuQ/5j3+f+Z+P//l/f+/5f3/v+T/P//sOLK/+OqZf/lvIv/5r+R/+a+kP/mvpD/5r6Q/+a+ + kP/mvpD/5r6Q/+a+kP/mv5H/37Bz//DMjf/426D/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/53KD/6sKD/9yoZf/qw4T/+Nyg//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nyg/+zF + hf/gsXb/5r+T/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpH/5b2O/+Cvbv/frWuNAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTAB/WmwDqtGop/3kX + dP95F3T/sWkr/9acAP/QkwD/25AA/4CtSP83xYP/QsF6/0LBev87vXD/atm0/578//+X9///l/f+/5P8 + //+u38n/46pl/+W8i//mv5H/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a/kv/hsXf/6L59//nc + oP/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//jcoP/uyIr/3Khm/+i+fv/43KD/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/43KD/7MSF/96raf/lu4r/5r+S/+a+kP/mvpD/5r6Q/+a+ + kP/mvpD/5r6Q/+a/kf/lvYz/4K9t/9+ubHkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAANGUAHfUmAH/lD5R/3YUd/+DJmf/yYkO/9OYAP/UkQD/xpYN/0u+ + c/89wn7/QsF6/0HAeP8+v3T/f+jV/537//+X9/7/k/v//63hzf/jqmX/5buK/+a/kv/mvpD/5r6Q/+a+ + kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/9+wcP/isnD/99id//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/+Nyg//HOkf/dqWf/5rl4//jbn//32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//nc + oP/rxIX/3Kll/+G0eP/mv5L/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r+S/+S6h//frWv/365sXQAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0JMADNSY + ANHFgxT/fyBs/3YUd/+XQ07/1JoA/9CUAP/bjwD/laY2/zfEg/9CwXr/QsF6/z6/df9IxIL/kPLt/5v5 + //+T+///qeXU/+KrZv/luof/5r+S/+a+kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a/kv/lvIv/361s/96s + av/yz5H/+Nyg//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/42p//89OW/96ta//jtHP/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+dyg/+nCgv/isnD/365r/+W8i//mv5L/5r6Q/+a+ + kP/mvpD/5r6Q/+a+kP/mv5L/47eA/9+taf3frmw4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0JMAR9edAP2sYTP/dxV1/3gXdf+uZDH/150A/9KS + AP/VkgP/Yrdh/znEgf9CwXr/QsF6/zy9cf9Wzpj/mfj6/5b7//+i7OH/361q/+S4g//mv5L/5r6Q/+a+ + kP/mvpD/5r6Q/+a+kP/mvpD/5r+S/+O4g//gsG7/5rp6/+nAgf/53KD/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//janv/215r/4LFv/+Cwbv/21pr/+Nqe//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/43KD/6L59/+7Iif/jtXP/4bR7/+a/k//mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kf/hsnT/361q29+u + bA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA0ZQAldSYAv+VP1H/dhR3/34fbv/BfRn/1ZsA/9eQAP+6mhj/QsF6/z7Cff9CwXr/QsF6/zu9 + cP9k1qz/nPz//5z09P/Ys3X/5LR7/+a/k//mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a+kP/mv5P/4bN6/+K0 + cf/yz5L/47V1//fZnf/32p3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//janv/jtXT/36xq//PS + lv/425//99md//fZnf/32Z3/99md//fZnf/32Z3/99md//jboP/nu3v/8c6Q/+7Jiv/erW3/5r6P/+a+ + kf/mvpD/5r6Q/+a+kP/mv5L/5LqG/9+ta//frmyWAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQkwAR05gA08mJD/+EJ2b/dhR2/4ku + YP/Njwr/0pcA/9uPAP+Tpzn/N8SD/0HBev9CwXr/QsF5/zu8cf9s3Lv/m/7//86/jP/lr2//5r+T/+a+ + kP/mvpD/5r6Q/+a+kP/mvpD/5r6Q/+a/kf/gsHP/5Lh2//jcoP/jtnX/8s+S//jboP/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/+Nyf/+a6ev/cqmj/8c6R//jboP/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/+Nuf/+W6ef/yz5P/99id/+CvbP/kuYb/5r+S/+a+kP/mvpD/5r+R/+a+kf/hsXL/361q+9+u + bDYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAADQkwA51psA9LhxJP96GXL/dhR3/5dDTv/UmAH/05QA/9eQAf9ts1f/N8WD/0LB + ev9CwXr/QcB4/zy+cv9p48P/wtS2/+arZ//lvo//5r+R/+a+kP/mvpD/5r6Q/+a+kP/mvpH/5r2P/9+t + bv/ovn3/+t+k/+rBgv/qwYL/+dyg//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/53KH/6cCB/9yo + Zv/uyYv/+Nyg//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32p7/5rt8/+7Jg//xz4T/57t8/+Gz + ef/mwJP/5r6Q/+a+kf/mv5L/4bN5/9+taf/frmyfAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQkwBq1pwA/6dZ + Ov93Fnb/dxZ1/6VWPf/WnAD/1pIA/8mVC/9UvGz/OsSB/0PBev9CwXr/QcB4/zjBeP93yZT/5K1q/+S5 + hf/mv5L/5r6Q/+a+kP/mvpD/5r6Q/+a/kf/lvY3/3qxq/+vDg//63qP/8tCS/+S3dv/32p7/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//ncoP/txoj/26hl/+vDhP/53KH/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fanf/ovoP/3qxG/+vDav/uyY7/3q5v/+a+kv/mwJP/5b6P/+KzeP/frWn/365s2d+u + bBkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADRlQCS1ZkB/5lGTP93FHb/eRhz/65jMf/XnQD/2JAA/7qa + Gf9HwHf/PMN//0LBev9CwXr/QMF5/zvAd/++sW3/6rJ1/+a/kv/mvpD/5r6Q/+a+kP/mvpD/5r+S/+W8 + i//erGn/7MaH//ncof/32Z3/5Ld2//LSlP/425//99md//fZnf/32Z3/99md//fZnf/32Z3/+Nyg//DM + jv/cqGb/6L5+//ncoP/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99qh/+O2cf/PkAn/7MZw//TT + mv/erGr/4bJ1/+K1e//gsHL/361q/9+ubMffrmwqAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANCT + AAfTlwCx0JMH/483Wf92FHb/ehpx/7ZtKP/XnQD/2pAA/66eI/9BwXz/PMN//0LBev9CwXr/OMJ7/3O7 + df/qrGr/5bqI/+a/k//mvpD/5r6Q/+a+kP/mv5L/5LuJ/96raP/uyYr/+Nyg//ncoP/pwYH/68SF//jc + oP/32Z3/99md//fZnf/32Z3/99md//fZnf/425//89GU/96raf7kuXf++Nuf//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/53Kb/3apH/8yLAP/qwWn/99mi/+Cvbv/frGmp361qj9+ta4HfrmxM365sCAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTABLUmQDCyosO/4guYP92FHb/fR1v/7hy + I//WnQD/248A/6mgJv9CwXr/O8OA/0PBev9BwXr/OsJ7/6+zb//tr3H/5b6Q/+a/kf/mvpD/5r6Q/+a/ + kv/kuoj/3qto/+7Ki//43KD/+Nug//HOkf/muHn/+Nuf//fZnf/32Z3/99md//fZnf/32Z3/99md//ja + n//11Zj/4K9u/+K0cv/32Zz/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nuh//XVlP/TmRX/y4sA/+Cw + RP/53ab/4rNz/96ta2MAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAANCTABnVmgDIx4YS/4YqY/92FHf/fh5t/7hxJP/XngD/25AA/7CeIP9LvnL/OMWC/0PB + ev89wnr/S8B6/8qwa//ssXX/5b6R/+a/kv/mvpD/5r+S/+S6iP/eq2j/7sqL//jcoP/32p3/9tic/+S2 + df/005b/99uf//fZnf/32Z3/99md//fZnf/32Z3/99qe//bXm//luHj/5LZ2//TUl//42p//99md//fZ + nf/32Z3/99md//fZnf/63aj/5rpQ/714D/+uYij/26Qa//fanf/kuHj/3qxqjwAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTABnWmgDEx4US/4cr + Y/92E3f/fBxv/7NqLP/XnQD/2pEA/8KXE/9ktl//N8WE/z/Cff86wnv/U794/8mwbP/vsHP/57yL/+a/ + k//mwJT/5byL/96raf/uyIr/+Nyg//fZnf/53KH/6b+A/+zGh//43KD/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md/+nAgf/qwYP/8c+S//jbn//32Z3/99md//fZnf/32Z3/99qf//bXmf/ZoxD/qFwv/400 + Wf/TmAH/8c+E/+e9gP/dq2igAAAAAAAAAADfrmwL365sId+ubDnfrmxQ365sX9+ubHLfrmuA361rg9+t + a4PfrWt4365sYt+ubEXfrmwaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0JMAAdCT + AAwAAAAAAAAAAAAAAAAAAAAAAAAAANCTABXVmgC1yIgR/4swXf91E3f/ehly/6ldOP/VmwD/2ZQA/9SR + Av+PqDz/RMF4/zjEgv84w33/ScB5/6O1cP/gr23/7rN7/++4h//ttoD/3qtp/+zFh//53KD/99md//nc + oP/wzY//5rp5//jcn//32Z3/99md//fZnf/32Z3/99md//fZnf/32p7/7MWH//HOkf/wzY//+Nuf//fZ + nf/32Z3/99md//fZnf/63ab/7cd0/9KWAP+WQU3/extw/8WCCP/qwVv/6b+G/9+ubNHitHSP4LBvud6t + a9fdq2nv3qtp/N6ta//frmz/369t/+Cvbf/gr23/4K9u/+Cvbf/erGv/3atp/96raenfrWuj365sKQAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0JMAPtCTAGnQkwADAAAAAAAAAAAAAAAAAAAAANCT + AAvVmgCbzI0M/5M9Uv92E3j/dxV2/5tJSP/NkAn/15oA/9uQAP++mRb/dLFS/z/BfP8zxYP/NsN+/1m+ + d/+HuHL/oLVw/6W1cP/Zq2n/7MKD//ncoP/32Z3/99md//bYnP/kt3b/9NSY//fanv/32Z3/99md//fZ + nf/32Z3/99md//fanv/wzY//9dea//PSlf/32p7/99md//fZnf/32Z3/99md//reqP/kt0z/yokA/4cr + Y/93E3f/r2Qk/+KxLf/ovYH/5Ld3//fbn//11Zj/8s+T/+3Iiv/nvXz/4LBv/92qZ//hsnD/8tCS//XV + mP/01Jf/9NOW//HPk//uyoz/5719/9+ubP/frWvj365sKQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADQkwAD0JMAjtCTAMTQkwBEAAAAAAAAAAAAAAAAAAAAAAAAAADTmAB50pYD+6RVP/96GHP/dBF5/4ku + X/+8dx//1pwA/9mVAP/YkAD/tZsc/3SxUf9FwHb/McWB/y/EgP8xw3z/M8J7/8KubP/uvHz/+Nyg//fZ + nf/32Z3/+dyg/+i/f//tyIn/+dyg//fZnf/32Z3/99md//fZnf/32Z3/99md//bXm//32Z3/99ic//fZ + nf/32Z3/99qf//fZnv/32Z3/+t2l/+CuMv+8dxL/fR1v/3kXdP+XQ0n/2KAL/+K0bP/luXv/+Nyg//ja + nv/425//+Nyg//ncoP/11pr/6sKC/92qaP/nvX3/+dyg//jan//425//+Nuf//jcoP/53aL/8MyO/9+u + bP/frWuNAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQkwAG0JMAu9CTAP/QkwC20JMAVNCT + AA8AAAAAAAAAAAAAAADSlQBG15wA2blzI/+ILWH/dBB4/3YUcf+YQkb/wX8R/9GTAP/XkAD/2ZAA/8KZ + Fv+VqT3/bLZf/1C+df9Vvnf/wq9r/+q2df/42p7/99md//fZnf/43KD/8MyO/+e8e//526D/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//janv/01JP/9tic//fZnv/32qD/3Kgh/7hx + G/94F3T/extx/4UoZP/Liwb/26ZH/+i+g//53KD/99md//fZnf/32Z3/99md//jbn//63qL/7MSF/92q + aP/y0JL/+Nuf//fZnf/32Z3/99md//fZnv/425//47V0/96saqEAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAADQkwAU0JMAztCTAP/SlQD/1JgA3NGVAJvQkwBd0JMAM9CTABDQkwAs1ZoAwM2O + A/+lVz3/jzht/51Nc/+5dWP/2KNN/9uoVv/dql3/46xf/+ioWv/jqFv/2rBs/+G0cv/jr23/4LBu//XW + mf/42p7/99md//fZnf/215z/5LZ1//TUl//42p7/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/+dyl/+nBav/uynz/+d2l//fZnf/Xnx7/0ZQB/6NVPf94FnX/ehly/7hxHP/ZoSP/68SJ//nc + oP/32Z3/99md//fZnf/32Z3/99md//jbn//01Jf/3qtp/+zHiP/43KH/99md//fZnf/32Z3/+Nuf//XW + mv/hsXD/3q1rcwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQkwAh0pUA18OA + FP+5cyH/zpAG/9SZAP/WmwD61pwA7NOXAN3Qkwjl2KIz/+CuVP/is23/68J4/+7IhP/uyY//8c+W//PS + l//jtnf/3axr/+rAgv/41Zn/+dqe//DLjv/dqmj/8c6Q//jboP/32Z3/99md//janv/wzI//9daZ//ja + nv/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/63qf/5rpb/96uQ//636n/99md/9ae + H//QkgD/1ZkA/5hETP9yD3z/oVE8/9abCP/uyIj/+dyi//fZnf/32Z3/99md//fZnf/32Z3/+d2h//HN + kP/dqmf/78uN//jcoP/32Z3/99md//jbn//53KD/6L5+/96raeXfrmwcAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADRlQAkzpAJ16BPQ/+CJWj/kTtV/6FRQf+oWTT/uHEv/96r + WP/jtHn/7smN//bXmf/425//+dyg//jcoP/63qL/68OE/9ypZv/tx4n/+dyh//jbn//425//9daa/9+t + bP/pwYL/+Nyh//fZnf/32Z3/99md//jbn//32Z7/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//rep//nvWH/0JQN//XWlv/53KP/16Ek/86QAP/TmAD/zY8K/4MmaP+JLl7/z5EA/+7I + eP/53aX/99md//fZnf/32Z3/99md//jbn//215v/4rNy/+Gycf/32Jz/+Nqe//jan//53aH/9taa/+e7 + fP/dq2ni365sPQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADRlQAi1ZoAy7JpLf+BI2n/cQ59/3ALeP+5dnP/57pz//TTlv/53aL/+Nqf//fZnf/32Z3/99qe//TU + l//erGr/57x8//ndof/32Z3/99md//fZnf/43KD/5bp6/+Gzcf/32Z7/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+d6n/+nAZf/LigD/57xe//zi + r//bpzL/zo8A/9CTAP/WnAD/tW0o/3oYc//AfA3/5rlM//reqf/32Z3/99md//fZnf/32p7/9dWY/+Ky + cP/dqmf/89GU//rdov/32Z3/89KW/+rBgv/frWv/3Khl/96racjerGmL3qxplN6sao/erGqL3qxqh96s + aoPerGqA3qxqfd6sannerGp23qxqdd6sanLerGpx3qxqcN6sanDerGpx3q1qc9+ta3ffrWuA365sXt+u + bBgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQlAAV1pwAqM2OCv+nWTf/hy1j/9CY + bP/pv3n/+dyh//fZnf/32Z3/99md//fZnf/43KD/78qM/9yoZf/vyoz/+dyh//fZnf/32Z3/99md//jc + oP/vy4z/3apn//LPkv/43KD/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/53af/6sJr/8yMAP/Wnhv/+t6n/+CwRP/NjgD/0JMA/9GUAP/UmQH/jzdZ/6hb + Lv/dqB3/+Nug//fZnv/32Z3/99md//fZnf/32Jz/78qL/+Kzcv/luHj/9NSW//XWmv/rxIX/5719/+e9 + fv/nvX3/57x8/+a6ev/muXn/5bh4/+W3d//ktnb/5LZ2/+S2dv/ktnb/5LZ2/+S2dv/ktnX/5LZ1/+O2 + df/jtXT/47V0/+O0c//is3L/4bFw/9+vbf/erGr/3qxq3t+ubEkAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAA0pYAcdabAO3Mjgj/2qVc/+Kzdf/11pn/+Nyg//fZnf/32Z3/99md//jc + oP/wzZD/3Klm/+vDhf/53aP/99md//fZnf/32Z3/99me//fYnP/gsG7/57x8//ncof/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//ndpf/sxXP/zo8A/82O + AP/qwmz/6cBn/82OAP/QkwD/0JMA/9WZAP+3cST/lkFM/9SZAv/xzoX/+dyj//fZnf/32Z3/99md//fZ + nf/53KH/9tic/+i9ff/erWv/7caI//reo//53aL/+Nug//jboP/426D/+Nuf//jbn//42p7/99qe//fa + nv/32Z7/99me//fZnv/32Z7/99me//fZnv/32Z7/99md//fZnf/22Z3/9tic//bXm//11pn/9NSX//HP + kf/muXn/36xq4t+ubBUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAz5EALNCT + AKPWnCf1361w/+a6e//32Jz/+d2h//jbn//32Z3/99qe//janf/kt3b/3axq//LQkv/43KD/99md//fZ + nf/32Z3/+dyh/+vEhf/dq2j/9NSX//jbn//32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/+d2k//DLgf/PkgH/zpAA/9SbGf/pwGj/0JMF/9CTAP/QkwD/0JMA/9GU + Av+dSkb/x4YD/+i8Wv/63qf/99md//fZnf/32Z3/99md//fZnf/42p7/+d2h//DMjv/frWv/5rt6//fZ + nf/426D/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99me//fZnv/32p7/99qe//janv/425//+t+j/+7Ki//dq2n8365sKwAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM+RBCbUmyRy3qxpxeKzcvftyIn/9NWX//fZ + nf/42p7/+Nqe//bYm//luHj/3apn/+zGh//42p//99md//fZnf/32p7/9teb/9+ubP/ovn7/+dyg//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/42qD/9taY/9Sa + FP/PkQD/z5EA/9OZEf/RlQX/0JMA/9CTAP/QkwD/1ZkA/7VsKP+6dBb/3qst//nco//32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/+d2h//XVmP/itHL/4rNy//XVmf/43KD/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fa + nv/53KH/5rt8/96sas3frmwIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgr3EE4LB0COCw + cxDerWgc3atjJtehPjTerGhm3app1dyoZv/erWv/47Z1/+vCg//005b/9tea/+S2df/nvHz/9dWZ//ja + nv/32Z3/99md//fZnf/53KH/7ceH/92qaP/z0ZP/+Nyg//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/63qj/4K9F/82OAP/QkwD/z5EA/9CTAP/QkwD/0JMA/9CT + AP/SlQD/yYkM/7t2Gv/Vmwr/9NOQ//jbof/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nuf//fZ + nf/lunr/4K9t//TTlv/43KD/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/425//+Nyg/+vEhP/eq2n9365sTwAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+ubAffrmwh365sO9+t + a1ferWtt3qxqiN6saZ3eq2mq3atput6raMjdq2jT3atp396sa+/erGz44K9y/uGxcP/ktnb/6L9//+3I + if/y0JP/99md//PSlP/gr23/6cGB//jcoP/425//99md//fZnf/32Z3/99md//fanv/42p7/5LV1/+O1 + dP/42p7/+Nqe//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//nc + pP/wzIH/z5ID/8+SAP/QkwD/0JMA/9CTAP/QkwD/0JMA/9CTAP/QkwD/y40G/86PAP/sxXP/+d2m//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nqf//jcoP/nvX3/365s//PUl//426D/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/425//+d2h//TV + mP/nu3v/3qtp+N+ubGoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA365sK9+ua2zerGqn3qtp0d6rafDerWr9369t/+GycP/jtHT/5bh4/+e8fP/ovn//6cGC/+vD + hP/sxYf/7ciJ/+/Ljv/z0pT/9tea//janv/53KD/+Nyg//reo//z0pX/361r/+rCgv/53aH/99qe//fZ + nf/32Z3/99md//fZnf/32Z3/99md//ndov/uyYr/3Khl/+rCgv/53aH/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//ncpP/bpi//zo8A/9CTAP/QkwD/0JMA/9CT + AP/QkwD/0JMA/9CTAP/RlAD/zo4A/+GyT//63qf/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99qe//nboP/munn/4bFv//bYnP/42p//99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//janv/43KD/+Nyg//TUl//qwoP/4K9t/92raczfrmxDAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA365sLd6ta6vdq2n04K5t/+S2df/pv4D/7ciJ//HP + kf/005b/9teb//fZnf/425//+dyg//ncoP/53KD/+dyg//ncof/53KH/+Nyg//jbn//42p7/99md//fZ + nf/43KD/9NOW/96ta//ovn//+d2h//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/425//9NKV/+Gw + b//erWvT3qxp/u7Ki//53aH/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/+d2m/+zEcv/OkAD/0ZIA/9OSAP/QkwD/0JMA/9CTAP/QkwD/0JMA/9CTAP/PkQD/1p4w//PT + m//425//99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nqf//fZnf/isnH/5bt6//jc + oP/32p3/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nuf//ncof/526D/9tea/+/Ljf/nvHv/4K9s/92r + aNjerWtw365sDQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+u + bDjerGro4LBu/+vEhf/005b/+Nqe//jcoP/43KD/+Nug//jbn//42p7/99me//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nuf//bXmv/gsG7/5bh5//jbn//32p7/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99me//jbnv/kt3f/3qtp29+ubBjerWua3q1r/+/Ljv/426D/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/42p//+Nug/9qhI//FkgT/wpgQ/9iQ + AP/QkwD/0JMA/9CTAP/QkwD/0JMA/8+RAP/UmiXk5rt/+fjboP/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/+Nyg//LRlP/dq2j/78qM//ncoP/32Z3/99qe//jbn//53KD/+dyg//fa + nv/005b/7smK/+e8fP/hsm//3axp9d6sabferWte365sEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3q1rr+Cwbv/z0pX/+d2i//jbn//32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fa + nv/43J//5Lh3/+Cxb//32Jz/+Nuf//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/53KD/7sqM/92r + aP/frmxlAAAAAN+ubAverWuy3q5s//PTlf/425//99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/63qj/68Bp/82PAP90sVL/sp0e/9qQAP/QkwD/0JMA/9CTAP/QkwD/0JIA/9SZ + HKDerG2w8MyO//ncoP/32Z3/99md//fZnf/32Z3/99md//janv/32Z3/99md//fZnf/32Z3/+dyh/+e8 + fP/isnH/99qe//fYnf/11pr/89KU/+7Ji//pv3//47V0/+CubP/dq2ns3qtptt6ta3LfrmwsAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADerWu+4bBv//XVmf/43KH/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+d2h/+3HiP/cqmf/8c+S//ncof/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//janv/ktnX/3qxp1d+ubAoAAAAAAAAAAN+ubBHdqmjc7ciJ//nc + of/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//jaoP/32Z7/35oX/5yg + Kv9DwXn/vJkW/9iQAP/QkwD/0JMA/9CTAP/QkgD/0ZUJmd6tbD7jtXX899me//fanv/32Z3/99md//fZ + nf/21pr/9NSX//jcoP/32Z3/99md//fZnf/53KD/8c+S/96raP/z0ZP/9teb/+a6ef/dqmj/3apn796r + aanerGp/365rTt+ubB4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+ubHferGr/47V0//XVmP/53aH/99qe//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//jb + nv/11pn/3q1r/+m/f//53KH/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/43KD/8c+R/96t + av/frmxxAAAAAAAAAAAAAAAAAAAAAN6raa3ovn//+dyg//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//reqP/pvF7/z44A/1G8bf9OvXH/ypYM/9WRAP/QkwD/0JMA/9CT + AP/QkgOgAAAAAN6sb7Lsx4f/+dyg//fZnf/32Z3/99md//janv/qw4P/7ciJ//ncoP/42p//99md//fa + nv/215r/369s/+zGh//53aL/9tib/+zGh//hsG/v3atoid+tayEAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA365sDt+ubLzerGn/4LFu/+7Jiv/32p7/+d2h//janv/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+dyg/+rCg//erGr/9dWY//jbn//32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//ncoP/ovn//3qtp7t+ubB4AAAAAAAAAAAAAAAAAAAAA3qxqhOS2 + dP/42Z7/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nuh//XX + l//dlQ3/kqUz/yzIjP9stFj/1pAB/9GSAP/QkwD/0JMA/8+RAJcAAAAA365yOuGxb/r21pr/+Nqe//fZ + nf/32Z3/+Nqf//bXmv/hsW//57x8//bWmv/53aH/99uf//bYnP/gsG7/68SF//jcof/32p7/+d2h//XW + mf/ov3//3qxq896raabfrmxB365sAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA365sE9+ubJ7erWr/3atp/+O1 + dP/tyIr/9daa//jcoP/43KH/+Nuf//janv/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//ja + nv/22Zz/4LBv/+e+ff/53aH/99md//fZnf/32Z3/99md//janv/215r/99md//fZnf/32p7/9teb/+Gy + cf/frGurAAAAAAAAAAAAAAAAAAAAAAAAAADfrWtX4K9t//XVmP/425//99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+t6p/+eySf/Akgb/R8B2/zTFhf+Vpjb/248A/9CT + AP/QkwD/0JMAigAAAAAAAAAA3qtqqerBgv/53aH/99md//fZnf/32Z3/+dyg/+/Ljf/cqGb/4LBv/+zG + iP/42p7/9dSX/92saf/uyov/+dyg//fZnf/32Z3/+Nuf//ncof/y0JP/5bh4/96sav7dq2m+3q1qX9+u + bBIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+ubEffrmyx3qxq9t2raf/gsG//57t7/+3Iif/y0JP/9tea//ja + nv/425//+dyg//ncoP/43KH/+Nyh//jcoP/426D/+Nyg//PQk//dq2n/8M6Q//jcoP/32Z3/99md//fZ + nf/53KH/78qM//LRlP/42p7/99md//jbn//wzY//3qxq/9+ubF4AAAAAAAAAAAAAAAAAAAAAAAAAAN+u + bDPdq2n78M2P//jcoP/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99qe//fa + nv/53aT/8c6F/9iQAP9uslP/NcWF/0e/df/BmBL/1pEA/9CTAP/QkwBzAAAAAAAAAADfrm4y365s9/PT + lv/425//99md//fZnf/32p7/99ug/+W5ef/frWv/4LBu/+Cxb//isnD/4K9t//XWmf/32p7/99md//fZ + nf/32Z3/99md//jcoP/425//8dCS/+nAgP/isnD/3atp3d6saYnfrWszAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADfrmwr365sb96ta7Deq2nf3atp+t+ta//hsnD/5Ld2/+a8e//pwYH/68SE/+3Gh//tyIn/7ceI/+zF + hv/215r/78uN/96ua//11Zn/+Nqe//fZnf/32Z3/+d2h/+zHiP/nvHv/+Nuf//fZnf/32Z3/+dyg/+m/ + f//dq2nv365sHwAAAAAAAAAAAAAAAAAAAAAAAAAA365sEd2raOHrxIT/+dyh//fZnf/32Z3/99md//fZ + nf/42p7/+Nug//jcof/53KD/+Nuf//fZnv/22Jz/9tib//bYnf/426L/46Aj/5ueJP8vxYH/LsWD/2yz + Vf/YkAD/0ZMA/9CTAF4AAAAAAAAAAAAAAADdq2ie5rt7//jcoP/32Z3/99md//fZnf/425//8tGT/9+t + a//uyYr/7ceJ/+S4d//uyYv/+duf//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/425//+dyg//bX + nP/vy43/5rp6/9+ubPndqmi63q1qYd+ubBUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+ubA/frmwz365sVt6t + a3TerGqR3qtpod6raardq2ii3atpr9ypZvvdqmf/68OD//jboP/vyoz/4K9u//bYm//42p7/99qe//nd + of/tyIn/3qtp//LQk//426D/99md//fanf/32Z3/4rRz/96sar0AAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADfrmwB3atpvua6ef/43J//99md//fanv/43KD/+dug//XWmv/wzY//6sOD/+e7e//ktnb/4rNy/+Gx + cP/hsW//4LFv/+KzdP/gql7/0aRL/5C1cP9tu3b/RcJ//6KgJf/WjwD/z5IARwAAAAAAAAAAAAAAAN+t + bCneq2nz8c2Q//jcoP/32Z3/99md//fZnf/53KH/5rt7/+GxcP/425//+dyh//jbn//32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nqe//jcoP/426D/9NOW/+rBg//hsnD/3ato4t6s + apHfrmw2AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+tayvdq2i147R0/vLQ + k//53KH/+Nyg//LRkv/frWv/9NOW//ncof/43KD/68SF/9ypZ//luXj/+Nyg//fZnf/32Z3/+Nuf//LR + lP/frWv/365sgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADerWqY4rJx//fYnP/53KH/+Nmd//DL + jf/luXn/365s/9+ubP/jtXT/6L5//+zFhv/uyYv/8MyO//DMj//vy47/7cmK/+zGiv/swIX/77Z1/+iu + bP/Prm7/v6xg/9aZI/rVnSsyAAAAAAAAAAAAAAAAAAAAAN2sapHjtnX/99qe//fanv/32Z3/99md//jb + n//z0pb/3apo/+vEhf/43KH/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/425//+d2h//bXm//uyIr/5LV1/96safnerGmy365sTN+ubAIAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAN+ubBPdq2mA361s7uvDhP/32Z3/+dyg//fZnf/32p7/99md/+Kycf/qwYP/99qe/+e9 + ff/dqmf/3qxp//DLjf/43KD/99md//fZnf/53KH/7caH/92raf/frmxHAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAN+ubGrfrmz/89GT/+/Kjf/hsXD/3apo/+S4d//uyYv/9dWZ//jan//63qP/+t+k//rf + o//636T/+d2i//jcoP/43KD/+dyg//ncoP/42p7/9dSY//HHif/quHv/365u/t+tcMvfr3BYAAAAAAAA + AAAAAAAA365sIN2raeztx4n/+dyh//fZnf/32Z3/99md//ncof/munr/4K9t//bXm//32Z7/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nqe//nc + oP/32p7/8M2P/+a5ef/erGr/3qxpwd+ubFEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+ubAnerWtm3ato2eW4d//z0ZT/+dyh//fa + nv/32Z3/99md//fZnf/53KD/78qN/96saf/fr23/3q1r/+a7e//itHL/99ic//jZnf/32Z3/99md//jb + oP/munr/3qtp6d+ubBcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA365sON+ubP3gsW//3apn/+W5 + eP/y0ZT/+Nyg//jcoP/425//+dyg//PRlP/rxIX/6b+A/+zFh//z05b/+dyg//fZnf/32Z3/99md//fZ + nf/42p//+Nyg//fan//xz5L/5bd4/92raP/erWuz365sJgAAAAAAAAAA3qxqg+GxcP/215v/+Nqe//fZ + nf/32Z3/+Nyg//DNj//dqWf/7smK//jcoP/32p7/+Nuf//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fanv/426D/+Nuf//HPkf/munn/3qxq/96s + abrfrmw+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADfrmxR3atpyd+vbf/sx4f/+Nqe//jboP/32Z3/99md//fZnf/32Z3/99md//fZnf/43KD/6cCB/+W4 + eP/01Jf/5rt6/+i+fv/43KD/99md//fZnf/32p7/9teb/+GycP/frWu8AAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAADfrmxo3atp/OCwbv/vy43/+dyg//jbn//32Z3/99md//jboP/qwoL/4bJw/+e8 + fP/qwYL/5rx8/+Gycf/qwYP/+Nqf//fZnf/32Z3/99md//fZnf/32Z3/99md//jcoP/42p//7MaH/9+u + a//erGri365sSQAAAADfrmwV3apo5erBgf/53aH/99md//fZnf/32Z3/9tic/+Cwb//munr/+d2h//PT + lv/wzY7/+dyh//jan//32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/+Nug//jcoP/xzZD/47V1/92raPnfrWuI365sCQAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADfrmxA3qxquN2raf/nu3v/9NSY//ncof/32p7/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/425//+d2h//XVl//erGn/8s+R//jcoP/32Z3/99md//jb + n//yz5H/3qxq/9+ubIYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA365sd92raP7kt3f/9dWZ//nc + of/32Z3/99md//fZnf/426D/7ceJ/+a7fP/215v/+d2h//ncof/53aH/9taa/+e8fP/sxIX/+Nug//fZ + nf/32Z3/99md//fZnf/32Z3/99md//rcn//+4aX/9dOV/+GycP/erGn1365sWgAAAADfrWt0361r//PS + lf/425//99md//fZnf/43KD/5rt7/+GycP/42Z7/9tic/+Kzcv/nvX3/9taa//ncof/32p7/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//nc + of/32Z7/7MWH/9+ubP/erGq4365sFwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADfrmwo361rod2q + aP3isnH/78uN//jcoP/425//99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/53KH/68KE/+Cwbv/22Jz/99md//fZnf/32Z3/+dyh/+zEhv/dq2n/365sTgAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAN+ubHPdq2j/5rt7//fZnf/426D/99md//fZnf/32Z3/99qe//bXm//qw4P/99qe//jb + n//32Z3/99md//fZnf/42p7/+Nuf/+zGh//11pr/99me//fZnf/32Z3/99id//rbnv//5qb/99ue/+jN + lP/02p///+Gh/+m5dv/dq2n4365sTd+ubAXdq2nZ5bp6//ncoP/32Z7/99md//jcoP/qw4T/369t//bX + m//53aH/78qN/9ynZf/hsW7/7MaH//fYnP/53KH/+Nuf//fanv/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fanv/53aL/89GU/+Kycv/erGq7365sCgAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAADfrmwO365se96saeverGr/6b+A//bXm//53KH/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//jbn//jtXX/5rp6//ncoP/32Z3/99md//fZ + nf/425//5bp6/96rae7frmwdAAAAAAAAAAAAAAAAAAAAAAAAAADfrmxU3ato/OW6ev/42p//+Nqe//fZ + nf/32Z3/99md//fZnf/42p7/9NSX//PSlf/53KD/99md//fZnf/32Z3/99md//fanv/53aH/99md//bX + m//32Z7/99md//fZnf/63Z7//OCg/5SGYf83MST/GRcQ/ywnHf90ak7/3cOK/++9eP/erGrs365sId+u + bFnerGn/7ciK//ndof/426D/+d6i/+rBgf/hsnH/99qe//fanv/43KD/6cB//9ypZv/dq2j/47Ny/+zF + hv/z0pb/9tmd//jcoP/53KD/+Nug//jan//32Z7/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/43KH/9NOX/+Gxb//frWtyAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA365sSd+ta83dq2j/4rNz//HO + kP/53aH/+Nqe//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fa + nv/32p7/9daa/9+ubP/rxIX/+dyg//fZnf/32Z3/+Nqe//bXmv/hsXD/361rv9+ubAEAAAAAAAAAAAAA + AAAAAAAA365sJt6raerjtXT/99mc//7go///4qP//t+h//janf/32Z3/99md//fanv/115r/9tic//bX + mv/22Jz/99md//fZnf/32p7/9dSX/+rBg//215r/+Nqe//fZnf/32Z3/+duc//vcp/9uWln/AAAA/wAA + AP8AAAD/AAAA/wAAAP8gHxj/r5do/++7df/frmvG365sDd+ua8jerGr/5719//LQk//z0ZT/4K9t/+vC + g//53KD/99md//janv/42p7/5rt7/92qZ//erGrQ3atptt+ubPfitHP/5rx8/+zFh//xzZD/9NSY//fZ + nf/425//+dyg//ncoP/426D/+Nuf//janv/32p7/99qe//fZnv/32Z7/99qe//jbn//736T/6L19/92r + adsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA365sE9+ubJTerGr/3qxq/+nBgv/22Jz/+dyg//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/42p//9NWY//bXmv/z05b/3qxp/+7KjP/43KD/99md//fZ + nf/425//8s+S/96tav/frmyCAAAAAAAAAAAAAAAAAAAAAN+ubAPerWu3365s//nYmf//56j/4seQ/8q1 + gv/exY///+Ol//7gov/32Jz/99md//fanf/22Jz/5bl5//LQk//425//99md//fZnv/32Z7/6cCB/+zG + iP/43KD/99md//fZnf//4p3/z6+y/wQAF/8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8LCgj/pYZX/+24 + cv/frmxy365sRN+ua//erWv/4bJw/+Kzcf/nvX3/99ic//janv/32Z3/99md//janv/32p7/6L5//92r + aOverWto365sKN6samndq2mq3ato296savrgr27/47Vz/+a7ev/qwoL/7siJ//HNkP/z0ZX/9dSY//bX + mv/22Jz/99md//fZnf/215v/9NSY/+3Hif/gsG//3q1r3wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+ubDrfrmzR3ato/+Kzcf/wzpD/+d2h//ja + nv/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nug//XW + mf/rxIX/+Nue//PSlf/dq2n/78uN//jcoP/32Z3/99md//ndof/sxYb/3qtp/t+ubD8AAAAAAAAAAAAA + AAAAAAAA365sXd2qaP/30ZD/6NOb/2leRP8VEg3/BQQD/xEPC/9eVD3/3smR///kpf/32J3/99md//bY + nP/z0pX/99md//fZnf/32Z3/99md//fZnv/32Z3/9NWZ//fanv/32Z3/99ma///itf+Xhan/AAAA/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8RDgn/xJpf/+i1cO/frmwj365rrOCwbv/y0ZT/99qe//jb + oP/32p7/99md//fZnf/32Z3/99md//janv/43KD/7ceI/9+ta//erGp+AAAAAAAAAADfrmwM365sMd+t + a1PerGp13qtpm92rabfdq2nQ3qxq5d+ubPXgsG794bJw/+O0c//jtXT/47V0/+Kzcf/gr23/3qtp/N+t + a9XfrmxQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADfrmxl361r8t2qaP/nvHv/9teb//jcof/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//ncof/115r/47V1//DMjv/53aH/9NWY/96sa//sxYb/+t2i//fZ + nf/425//9tic/+K0c//frGrX365sCgAAAAAAAAAAAAAAAN+ubAzdq2nX7cB+/+LNlv8wLCD/AAAA/wAA + AP8AAAD/AAAA/wAAAP8lIRj/1cCL///kpP/32J3/99md//jan//32Z3/99md//fZnf/32Z3/99md//fZ + nv/32p7/99md//fZnf/73Zj/9NPZ/2hag/8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP9QPif/7Lhy/9+ubJDfrmwY3axp5OS4d//425//+Nqf//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/53aH/8tCS/+Kycf/dq2ms365sFQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+ubAffrmwW365sKt+t + az3erWtO3qxqWN6sal/erGpi3q1rX9+ta1Tfrmw4365sDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA365set6tav/erGr/7MWG//jboP/425//99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//jbn//53KD/8M2P/+Cv + bf/luXj/+dyg//fanf/425//5Ld2/+Gxb//21pr/+d2i//bXm//muXn/3atp/9+ubIwAAAAAAAAAAAAA + AAAAAAAA361sZ+KvbP/x0pL/Qj4u/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8wKx//7tWa//ve + oP/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nqd//XZmv+6eNn/RCVi/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wQDAv+2jVj/6rZx8d+ubBbfrmw63ato7+e7 + e//42p7/+Nuf//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/53KH/9daa/+W6ef/dq2jR361rMgAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+u + bG/erGr/365t//DNj//53aH/99me//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99me//jcoP/43KD/89GU/+a8fP/dq2j9361r//TVl//425//99md//jbn//y0JP/3atp/+Cw + bv/nvHz/4bBv/96saf/frmz6365sNAAAAAAAAAAAAAAAAN+ubAfdq2nM9MiA/66Ojv8AAAH/AAAA/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP95bE7//+in//fZnf/32Z3/99qe//jbn//426D/+Nyg//nc + oP/32p7/99md//fZnf/+4qL/wrCA/4tIwv9LJ2f/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/1VCKf/suHH/365tewAAAADfrmxG3ato6+a7e//32Z3/+Nyg//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/425//+Nuf/+vDhP/drGrr3qxqWQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADfrmw53q1q+N+ubP/yz5L/+d2h//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nuf//ndof/32p7/8c6Q/+e7e//erWvW3qtpo92q + aOztyIn/+Nyh//fZnf/32Z3/99md//jcoP/xz5H/4rRz/+Cvbf/ovn7/4rNy/9+ta7UAAAAAAAAAAAAA + AAAAAAAA361sRN+vaP/2zZ//f02d/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/xEQ + C//expD//d+i//fZnf/21pn/8s+R//DLjv/uyIr/7MaH//HOkP/32p7/99md///npf+ZimL/eDmx/1ss + gv8AAAD/AAAA/wAAAP8AAAD/AAAA/xsbG/8BAQH/AAAA/wAAAP8AAAD/BgMD/8udZ//ls27P365sBQAA + AADfrmw43ato3eO2dP/01Jf/+dyh//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32p7/+dyh//DM + jv/fr23/3qxpgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA365sAd+u + bK/erGr/78qM//ndof/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//janv/426D/+dyh//ja + nv/z05X/68WG/+O2dfberGq43qtpVt+uazTdq2jD5rt7/vjboP/32p7/99md//fZnf/32Z3/99md//jb + oP/32Z7/+Nuf/+7KjP/frW78365uQgAAAAAAAAAAAAAAAAAAAADerGqW6b5w/9+sv/90Oqn/AAAA/wAA + AP8AAAD/AAAA/wAAAP8DAwP/AAAA/wAAAP8AAAD/AAAA/4V4V///6Kj/99md//bYm//yz5H/7siJ/+3I + if/xzpH/9tib//fZnv/32Z3//+in/4R3UP9IC4z/WBab/wAAAP8AAAD/AAAA/wMDA/+Li4v/7Ozs/1FR + Uf8AAAD/GBgY/1dYV/8tKzv/l2Jx/+u6bfzfrmw2AAAAAAAAAADfrmwk3qtpweCwbv/wyo3/+dyg//ja + n//32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+dyh//PSlf/is3L/3atopN+ubBAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADfrmwR3atq5uW5ef/53aH/99qe//fanv/32p7/+Nqe//jb + n//426D/+Nyh//jcoP/42Z7/9NWY//DNj//pwYL/5LZ2+9+ua8jdq2h73qxqLgAAAADfrmwW3qxp0uKz + cv/215v/+Nqf//fZnf/32Z3/99md//fZnf/32Z3/99md//ncof/z0pb/361l/9uoVaQAAAAAAAAAAAAA + AAAAAAAA365sDN6raNr00YX/vYXR/2AYrP8CAQP/AAAA/wAAAP8TExP/pKSk/7u7u/8LCwv/AAAA/wkJ + Cf8EBAX/Mi0e//neof/6257/99md//jbn//426D/+dyg//jbn//32Z3/99md//fZnf//6Kf/eW9I/zYD + cP9oGrb/CwIT/wAAAP8AAAD/Ozs7////////////RkZG/zw8PP/c3Nz//////+rp8v+cYbL/3qpp/9+v + bHUAAAAAAAAAAAAAAADfrmwL3q1rjd6raf/ovX7/9dWZ//ndof/32p7/99md//fZnf/32Z3/99md//fZ + nf/32Z3/+Nyg//bWmv/luHf/3atow9+ubCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+u + bA3drGrg5bh4//bXm//32Jz/99id//bYnP/11Zn/89KV//DNj//txof/6L5//+O2df/gsG723qxqxN6r + aX/erGo3361rBAAAAAAAAAAA365sIN6tatjfrmz/89GU//jcoP/32Z3/99md//fZnf/32Z3/99md//fZ + nf/426D/9NWZ/+Kzdf/cqFv00ZQGtNGVBgcAAAAAAAAAAAAAAADfrmw6361p/fzknv++lOH/Yg26/w4E + F/8AAAD/AAAA/3d3d///////4uLi/wUFBf9NTU3/0NDQ/8nKyv80MzH/zbeC//7ho//32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md///oqP98ckr/KQFZ/2wcvP8rC0r/AAAA/wAAAP8nJyf/xcXF/3l5 + ef8zMzP/7u7u/////////////////7yT4//EiHP/47RpsAAAAAAAAAAAAAAAAAAAAAAAAAAA365sTt2r + aNjgsG//7caH//fZnf/53KH/99qe//fZnf/32Z3/99md//fZnf/32Z3/+Nuf//fanv/nvXz/3ato19+u + bCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+ubHverWv/4bBv/+K0c//itHP/4bNy/+Cw + b//frWz/3qxq+d2radfdq2ml3qxqZt+tayvfrmwCAAAAAAAAAAAAAAAAAAAAAN+ubCDfrWvV3qxp/+/L + jf/53aH/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nuf//fYm//ktXT/365y9NqlS23PkQD50JMAfgAA + AAAAAAAAAAAAAN6sa3Dis2///+61/8us6/9wE83/JQlA/wAAAP8AAAD/LS0t/5SUlP8wMDD/Pz8///f3 + 9////////////5mbnf+ejWP//+Wl//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3//+io/4l9 + Uv8bAD7/XRek/08ViP8EAQj/AAAA/wAAAP8CAgL/AAAA/8bGxv//////////////////////vpjt/7d6 + jv/ltmba365sCgAAAAAAAAAAAAAAAAAAAAAAAAAA365sGN6ta5Ldq2j547Rz/+/KjP/32Z7/+dyh//ja + nv/32Z3/99md//fZnf/32Z3/+Nqf//jbn//ovn//3ato3d+ubCsAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAN+ubFPfrWub3qxqr96saq3erWqf361rf9+ubFffrmww365sCwAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAADfrmwX365szd6raP/rxYb/+dyh//fZnf/32Z3/99md//fZnf/32Z3/99md//jb + n//22Zz/5bh3/92qaf/hsHVm1JshIs+RAP7QkwD30JMAOQAAAAAAAAAA3qxqoOe7d///88b/3872/3gd + 0f9JEYD/AAAA/wAAAP8AAAD/AAAA/wICAv/R0dH/////////////////xMbJ/4R2V///5KT/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//fZnf//56f/l4pd/yYXOf9QGIr/VxeW/y0MTv8AAAD/AAAA/wAA + AP9TU1P///////////////////////////+vguf/yJqz/+S1ZvXfrmwoAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAN+ubDverGq23atp/+O1dP/ux4n/9tea//ncof/426D/99qe//fZnf/32Z3/+Nqe//jb + n//mu3r/3atp2t+ubB0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA365sDd+ubLzdq2j/6cGB//jc + oP/32Z7/99md//fZnf/32Z3/99md//fZnf/425//9tic/+S4d//dq2j/4K9xhQAAAADPkgAu0JIA+dSU + AP/TkwDUz5IDEwAAAADerG3C7MOA///y0f/49P//gjXO/2wWv/8RBR3/AAAA/wAAAP8AAAD/VVVV//// + ///////////////////LzdH/Z11G//7io//42Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md///l + pf+unW3/RkVJ/142iP9BDXf/TxaI/x0IMv8AAAD/AAAA/6ioqP///////////////////////fz+/5JV + 1//hydb/47Rr/9+takMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADfrmxM3qxqvN2r + af/hsXD/6sCB//HPkv/22Z3/+dyg//ncoP/425//+d2h//bYnf/hsnD/3q1rr9+ubAUAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAN+ubALfrmyl3apo/+e8fP/426D/99qe//fZnf/32Z3/99md//fZnf/32Z3/+Nyg//bX + mv/ktnb/3ato/9+ubI4AAAAAAAAAAM+RAC3UlAD4qos//8mRE//SkQCm1p81CN+uctfvyYf//fPZ//// + //+gaNf/cBLO/0wUgf8AAAD/AAAA/wAAAP+hoaH//////////////////////7m7vP9GQC7/+d6g//na + nv/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3//+Gj/8u1gf86PTX/kH6l/y8DXf9EFHP/SBV9/yEH + O/8ICAr/09TS///////////////////////Vve3/hD/M//nz8P/jtnb/361pXQAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA365sRd6ta6Xdq2ns3q1q/+K0c//ov3//7smL//LQ + k//005b/8MyO/+Gyb//erWv0365sGgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA365sgt2raP/kt3f/99me//ja + n//32Z3/99md//fZnf/32Z3/99md//ncof/01Jf/4rRz/92raf/frmyJAAAAAAAAAAAAAAAA0JMAJdqV + APN5g4n/doOU/9yUAP/Umh2V365x4PHNjP/989v//////9C06/9qEcH/dx/N/ywMTP8AAAD/AQIA/8PD + xP//////////////////////fnyH/y0mHv/3253/+tuf//fZnf/32Z3/99md//fZnf/32Z3/99md//fZ + nf/73J//79OY/zEuIv+4t7z/TTBv/y4IVv89E2r/QhB2/0Qbbv/m4ur///////////////////7//39A + vv+kdtX////+/+W6f//vuG9qAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAN+ubCDfrmxj3qxqqN2radjdq2n03q1r/N+ubP3erGr0361rwN+ubE7frmwCAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAN+ubFTeq2n+4rRy//bWmv/425//99md//fZnf/32Z3/99md//fZnf/53KH/8c+S/+Cw + b//eq2n/365sfAAAAAAAAAAAAAAAAAAAAADQkwAZ25UA54mGc/8mdP//pItN/9uUAP/Yo0L+89KX//3y + 2v//////+vb9/4U/y/9rFML/bB66/yMIP/8AAgD/xcfC/////////////////+3r8P80HVT/LiUj//XY + m//63J//99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf//5ab/UEYv/4uOjv/Duc7/IgNF/y8N + VP82EF7/Ow1p/9LG3v////////////////+ifsb/Uwub/+XZ8v/9/fz/8seK/+CsaHA4LBsMAAAAEQAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA365sC9+u + bCXfrmw7365sPN+ubCTfrmwCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADfrmwh3qxq5+Cxb//01Jf/+Nug//fZ + nf/32Z3/99md//fZnf/42p7/+Nyg/+3Iif/frmv/3qxq79+ubF8AAAAAAAAAAAAAAAAAAAAAAAAAANCT + AAzZlQDamIld/yd0//88eOb/vI4p/9iSAP/ovmT///Xh////////////yq3n/18Nsv9lHLH/YBun/ywG + Vf+jnKr////////////9/P3/dV6M/xUAOP8wKSL/9dea//rcn//32Z3/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md///np/+VhFz/OTs9//////+RhKD/GgA6/ysMTf8rB1H/ak6H/+Hc5//e1+b/imur/zUA + df+hgMH//////8DBwP9cSC3/OCsZ1AAAAKMAAABMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAN6ta6nerWv/8c6Q//ncof/32Z3/99md//fZnf/32Z3/+dyg//fZnf/ov3//3atp/96t + a9Dfrmw3AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0JMAA9iVAMatjT//Mnb4/yx1//9Me9H/yZAY/9aR + AP/t1Jr////////////+/v7/kWDC/00Ilf9VGpL/TBKI/1kuhv/IvNT/zMPV/2tVgv8cADz/KBRD/z85 + L//12Jr/+tuf//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3//d+h/9/Fjv8ZFxP/zc7P//// + //+PhJz/Hgc8/x0APf8jAkb/NRNa/zMMXP8hAFT/fFud//n4+v//////i4qL/2JcQP+4nGr/mXZHhwAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADfrmxA3qtp/erCgv/53aH/99md//fZ + nf/32Z3/+Nqf//ncof/yz5L/4rR0/92raP/frmya365sFQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA1JMArMKQGv8/eOb/NHf3/yt1//9Zfr7/zpAP/9WUCP/v26z////////////v6vX/bz+g/zsE + df9DFXL/Nw5i/zENWP8tDk7/GQA5/yYNQv+Qi5z/UEw6//XanP/5257/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/42Z3//+am/1FGL/9jZWj////////////FwMv/YlR1/zchUv8xFU//STBn/56O + sf/7+/v///////7+//9saWP/6MyQ///kpP/yv3j/4K5rfAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAN6sapzhsnD/9tib//jbn//32Z3/+Nuf//ndof/21pr/6sGB/9+ta//erGrQ365sTwAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADRkwCH1ZQB/1d9v/8udf7/Nnfz/yp1 + //9dfrf/zY8O/9aSA//s1J3////////////r5vH/dlaY/y8GWf8lAkr/IAJA/xgANf8qFUX/tay//7W3 + uf9VTDf//eOk//jZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf//5KX/u6Z2/xES + Ev/e3t//////////////////7ezv/+bk6f/4+Pn/////////////////5Obp/2FbSv//5qT//+qq//TP + kP/grWr/47FuXQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3qxqo+GycP/11Zn/+dyh//jb + n//01Jf/68SE/+Cxb//dq2jc361rdN+ubA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAANCTAFzblQD/fYSG/yt1//82d/P/Nnfz/yp1//9Xfb7/yI8W/9aQAP/mx4T///////// + ////////wLbL/39tkf9rWX3/jH+a/9vW3///////b3F0/3VnR///6Kf/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/32Z3/99md//nanv/95KX/Qjom/11eYv////////////////////////////// + //////////////////+vr7H/HBoS/2NYP/+djWf/3MWP/+q9fP/frGrs365sJQAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAADfrmwi3q1rseKycfjnvHv/5Lh3/eCvbezdq2i23q1rZN+ubBQAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0JMAMdiVAPqpjET/L3X7/zZ3 + 9P82d/P/N3fz/yt1//9Oe8//vo8m/9iNAP/gt2H//Pjw//////////////////////////////////b2 + 9/8uLi3/uaZ1///jpP/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/99md///i + pP/Kt4P/CgkH/7e4uv///////////////////////////////////////////1tZV/+bjGL/j4Bd/2BW + Pv9TTDj/kHpU/9+ta//gr2yqAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3q1rLN2r + aUnerGo9361rHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAADQkwAJ0pMA1s2SDf9Hetj/MXb6/zZ38/82d/P/Nnfz/y11//8/eeH/qItI/9mN + AP/apjT/9erQ////////////////////////////oqOm/yomGf/z2p3//N+m//reqP/53qf/+t6o//re + p//53aX/+Nui//fZnv/32Z3/99md//fZnf/32Z3/+Nmd///oqP+Fd1P/FBUY/9vb3P////////////// + //////////////////+lp6v/XlQ8///tq///56f//+Wm//Tanf/qz5b/5Ll4/96saf3frmw+AAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTAAbQkwAXAAAAAAAAAADQkwCd25UA/3aD + kv8rdf//Nnfz/zZ38/82d/P/N3fy/zB2/P8xdvj/hYV8/9OOAP/Zlwz/69CX//////////////////f4 + +P8pKi3/iXpW///oqP/rwm7/47VP/+KzSf/itUz/6LlZ/+7CbP/00In/+Nug//reqP/426H/99md//fZ + nf/32Z3/+duf///lpf9mWj7/Hh8i/8XGyP//////////////////////v8DB/xgYGf9FPSr/8tue//ze + of/32Z3/+due//veov/xzpD/3qxq/9+ubKsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA0JMABdCTAIHQkwAjAAAAANCTAFTYlAD/rYxA/zB2+/81d/X/Nnfz/zZ38/82d/P/Nnfy/zN2 + 9/8qdf//XH64/7yNJ//ajgD/37JP//ju2f//////f4KG/x8bEP/v1pv//N6j/+3Gdv/UmRn/yokA/82N + AP/HmRr/xp0q/8+XFv/cnib/6rRO//XRjP/636j/+dyj//fZnf/32Z3/+tyg///kpf+BdVH/GxoX/1td + Yf+cnaD/nJ6h/1pbX/8bGRX/r55w/4F3Vv9WTTj/996h//jYm//32Z7/99md//fanv/jtnX/3qxq9N+u + bCQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0JMAf9CTALbQkwAB0JMAENGT + AOLTkwb/UnzJ/y92/f82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/8sdf//Onjq/4yGc//PjAD/4p8O/9G0 + c/8YGBf/q5p0///nqP/32Jz/+d6l//fZm//isk3/0Y4B/8GlN/+f6dD/mfHi/6fUpf+5sFP/0Jga/+So + OP/zz4X/+t+o//jbof/32Jz/+due///op//Uvoj/dGZG/0tDL/9AOSj/W1A2/8y2gv//6Kj//+em/4B0 + U/+PgV7/+daX//PQk//425//+dyh/+zFh//dq2n/365sbAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAADQkwA60JMA/9CTAIUAAAAA0ZUKjduUAP+Nh3D/K3X//zZ38/82d/P/Nnfz/zZ3 + 8/82d/P/Nnfz/zd38v8ydvn/KnX//1J8xv+liUX/04sA/8CEAP/uxnD/+d2k//ndp//32Z7/+Nqg//re + qP/uyHn/2JgX/8mVGf+l3LT/j////5P+//+d6tT/tbdj/9GUD//mrkH/9daW//reqP/32Z7/99mc///g + ov//56f//eKj//rfof//5qb//+Gj//fYnP/5257//eCi/9e/iv/01Zr/6b9///fZnf/426D/9NKV/9+u + bP/frWuvAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTAAvQkwDb0JMA/9KW + C1/bp1WN1ZQE/8SQGP8+eOb/Mnb5/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/L3b+/y92 + /f9gfrP/spBA/9eRAP/foCH/7cVz//jcov/63qf/+Nqg//rep//22Jn/4qs9/9CKAP+vyIf/k/7//5T8 + //+T/v//oOTE/8CkOf/ZkhD/7MJt//reqP/426H/99mc//fZnf/42p7/+dqe//jZnf/32Z3/99md//fZ + nf/42p7//d6h//ncoP/ovn//7smL//ncoP/42p7/47Z0/96satvfrmwMAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTAJnQkwD/0ZIA+NumS/DXoDX/2pMA/3WCkv8rdf//Nnfz/zZ3 + 8/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/NXf1/yx1//8wdfn/YoKy/7ymRv/RkAT/3Zsd/+zA + Z//32Jr/+t+o//rep//636j/68Bp/9aOBv+yv3X/k/7//5b4//+U/P//lfr5/7DDfv/PjAT/4qs+//fa + nf/53aT/99mc//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnf/32Z3/+dyg/+/Ji//kt3f/+duf//nc + of/ovn7/3qtp9t+ubCsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0JMATNCT + AP/Jkg3/1pQA/92qQf/bnA//to0s/zR38/80d/b/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ3 + 8/82d/P/Nnfz/zV39f8ob///ZLv+/6nryP+2uWn/yJcc/9mWF//nsEX/882B//ncof/95LP/9dKN/9ya + Gv+xvnX/k/7//5f4//+W+f//kv///6Teuv/IlRv/25oa//PRiv/63qj/99md//fZnf/32Z3/99md//fZ + nf/32Z3/99md//fZnf/425//9NOX/+Cwbv/01Jf/+t2i/+zGh//eq2n/365sQwAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQkwAN15QA2Z+KU/+Rh2X/3ZYA/9aYB//ZlAD/aX+l/yt1 + //82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zR08/83evX/h+n//5f/ + //+Z8uv/qNSk/7mwUf/LnB3/3Z8p/+qzS//2zYT/+deV/+SnNf+vyYn/kv///5f3//+X9///k/7//5zu + 2//BozT/1o8I/+7Idv/636n/99md//fZnf/32Z3/99md//fZnf/32Z3/99md//fZnv/32Jz/4bJw/+7J + i//63qP/78yN/96sav/frmxQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADUlACDxJEZ/zt35/93go3/05MI/+CWAP+yjTb/Mnb2/zR39v82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ3 + 8/82d/P/Nnfz/zZ38/82d/P/Nnfz/y9u8v9SnPf/nf7//5b6//+U/v//k/3//5nw5/+l16n/tLpo/8Wl + O//WpDH/5Kc3/9iLAP+q06P/lPz//5f3//+X9///lPz//5f38P+7sFP/1YkA/+rBaf/636r/99me//fZ + nf/32Z3/99md//fZnf/32Z3/99md//jbn//ktnT/6cCB//reo//xzpD/3qxq/9+ubFUAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTACbblQDze4OI/x1y//9WfcL/t442/+aX + AP9tgKH/K3X//zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/NXbz/zBv + 8v92y/v/nv///5f3//+X9///lvn//5T9//+T/v//lfj6/5vp1v+l1qr/tcJ9/7a/d/+Y9fP/lvj//5f3 + //+X9///lfr//5T8+/+5uGf/04gA/+m+Y//63qf/99md//fZnf/32Z3/99md//fZnf/32Z3/+Nug/+a5 + ef/mvHz/+t6j//HOkP/erGr/365sTQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAANWSAJvAkCD/O3jr/yl1//82d/H/g4WC/6eLTv86eOr/NHf3/zZ38/82d/P/Nnfz/zZ3 + 8/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/MnPy/z6B9P+R7v7/mvv//5f3//+X9///l/f//5f3 + //+X+P//lfr//5T9//+T////lfv//5f3/f+X9///l/f//5f3//+X9///lvr//5T9//+2vXL/04oA/+a5 + Xv/2157/99qe//fZnf/32Z3/99md//fZnf/53KD/6L1+/+a6ef/63qP/78yO/96sav3frmw7AAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA1ZsiMt2WAPl/hIT/KnX//zR3 + 9/8rdf//QXnh/z146P81d/X/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ3 + 8/82d/P/L27y/1ej9/+d/v//mPj//5f3//+X9///l/f//5f3//+X9///l/f//5f3//+X9///l/f//5f3 + //+X9///l/f//5f3//+X9///lvn//5P+//+1vXD/1YwD/+7IiP/53KH/99md//fZnf/32Z3/99md//nc + of/pwH//5rt7//rfpP/txoj/3qtp7d+ubB0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAADhsXgK2p8r3cmQD/9Fetr/MHj8/zZ38/8zdvj/NXf1/zZ38/82d/P/Nnfz/zZ3 + 8/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/81dvP/MG7y/3TH+v+f////l/f//5f3 + //+X9///l/f//5f3//+X9///l/f//5f3//+X9///l/f//5f3//+X9///l/f//5f3//+X9///lvn//5P9 + //+2u23/57Jj//nco//32Z3/99md//fZnf/32Z3/+dyg/+nAgf/ovn//+t+k/+m/f//eq2nN365sBQAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADdrGe63JgE/51/ + Uf8tZ/3/NXv1/zZ48/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ3 + 8/82d/P/Nnfz/zZ38/8zc/P/OHrz/4rk/f+c/v//l/f//5f3//+X9///l/f//5f3//+X9///l/f//5f3 + //+X9///l/f//5f3//+X9///l/f//5f3//+X9///lvn//5T5+//SvIP/+NKU//fbnv/32Z3/99md//fZ + nf/53KD/6cCB/+zFh//53aL/5Ld2/96sap8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAOCwdITbpUb/2JMA/25emv8pVP//N3fy/zZ78/82d/P/Nnfz/zZ3 + 8/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/8wb/L/SI71/5b2 + //+a+v//l/f//5f3//+X9///l/f//5f3//+X9///l/f//5f3//+X9///l/f//5f3//+X9///l/f//5f3 + //+X9///kv3//8HHof/zxIH/+dyh//fZnf/32Z3/99md//nboP/qwYL/8tCT//bXmv/gr23/361rYwAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA365tQ+Cv + c//boij/yo0N/0tIz/8tQ/z/Nmjx/zZ78/82efP/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ3 + 8/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/8vbfL/Wqb3/53+//+Y+P//l/f//5f3//+X9///l/f//5f3 + //+X9///l/f//5f3//+X9///l/f//5f3//+X9///l/f//5f3//+S/P//tNW7/+q1cP/526D/99md//fZ + nf/32Z3/99qe/+/Ljv/32p7/78uN/92rafTfrmwmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADfrmwL361t2OS4dv/foxT/tYIq/zg/6v8vOvf/NlTw/zZy + 8v82e/P/Nnjz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zV2 + 8/8ubfL/a7v5/6D///+X9///l/f//5f3//+X9///l/f//5f3//+X9///l/f//5f3//+X9///l/f//5f3 + //+X9///l/f//5T6//+l59z/4a1q//XTlv/4257/99md//fZnf/32Z3/99md//ncof/nvHz/3atpvN+u + bAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADerWuG4rN2/+3Iff/dnAP/o3lJ/zE+9P8xOfX/NkLu/zZd8f82dvL/Nnvz/zZ48/82d/P/Nnfz/zZ3 + 8/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zR18/8ycfL/dsv6/5////+X9///l/f//5f3 + //+X9///l/f//5f3//+X9///l/f//5f3//+X9///l/f//5f3//+X9///lvj//5b5///StoD/7sGA//nc + of/32Z3/99md//fZnf/425//9dWY/+Cwbv/frmtnAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+ubCfdq2jz7smQ/+3IdP/blwD/l3Rd/y49 + +f8yPfT/Njzu/zVI8P82ZfL/Nnnz/zZ68/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ3 + 8/82d/P/Nnfz/zNz8/80dfL/fdX7/5////+X9///l/f//5f3//+X9///l/f//5f3//+X9///l/f//5f3 + //+X9///l/f//5f3//+T////ouC//9WmTf/ks3T/99md//janv/32Z3/99md//ndof/rxIX/3ato5N+u + bBUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAN6saprhsXD/+dyn/+rBZ//algD/k3Fj/y08+f8xPfX/NT7u/zU87/82TfD/Nmvy/zZ6 + 8/82efP/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zJz8/83efP/gtr8/5// + //+X9///l/f//5f3//+X9///l/f//5f3//+X9///l/f//5f3//+X9///kv///6Piwv/NlRX/1pUT196s + bPTuyYz/+Nyh//fZnf/42p7/9deb/+GycP/frGp+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA365tJN2qaO/qwYL//OKt/+m+ + Yv/alwD/mHRb/zI+8/8vPfj/NkDu/zU97/81Pu//NlTw/zZw8v82e/P/Nnnz/zZ38/82d/P/Nnfz/zZ3 + 8/82d/P/Nnfz/zZ38/82d/P/Nnfz/zJy8/85e/T/g9r8/5////+X9///l/f//5f3//+X9///l/f//5f3 + //+X9///l/j//5L///+m3LP/z5UU/9KNAMLVnCkd365wo+K0c//32Z3/+Nug//ndof/pwID/3qto2d+u + bBEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAA365vct6tav/yz5P//OGs/+vCav/cmQD/pXpD/ztD5v8sO/3/NUDu/zU/ + 7/81PO//NkHv/zZZ8f82c/L/Nnvz/zZ48/82d/P/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zJx + 8/84efP/fdX7/5////+X+P//l/f//5f3//+X9///l/f//5b5//+T/v//rdCX/9GRCf/SjwC5z5EAFQAA + AADhsXYi3qtp5OrBgv/42p//7MWG/96savjfrmtGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADfrm4C361wtOKz + cv/215v/++Cr/+/Lfv/eoA//t4In/0xMzf8pOf//NUDw/zVA7/81P+//NTzv/zZD8P82XfH/Nnbz/zZ7 + 8/82ePP/Nnfz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zJy8/80dfP/dMn7/6D///+Y+f//l/f//5f3 + //+U/P//lfv4/7e/df/UjQD/0pEApNCTAA4AAAAAAAAAAAAAAADfrmw2361r1OGycP/erGrq361rWAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAADQkwAMz5EAN9SZHQnbqFQK365zzeW5ev/32p7/++Cp//TUk//kqyf/yo4R/2lc + oP8qOv7/MT72/zVA7v81QO//NT7v/zU87/82RfD/NmHx/zZ38/82e/P/Nnjz/zZ38/82d/P/Nnfz/zZ3 + 8/82d/P/Nnfz/zNz8/8xcfL/aLf5/539//+a/P//kv7//5zt2f/Cq0X/1YsA/9GSAIXQkwACAAAAAAAA + AAAAAAAAAAAAAAAAAADfrmwT3q1rV9+ubCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTAAPQkwBCz5EAptCS + AnTZo0NE3qxqz+e7gf/22J7/++Cq//faof/epzz92ZYA95NyZf86Quj/Kjr+/zRA8P81QO//NUDv/zU+ + 7/81PO//Nknw/zZk8v82efP/Nnvz/zZ38/82d/P/Nnfz/zZ38/82d/P/Nnfz/zV18/8vbfL/T5///4rt + //+t16P/zJkb/9SMAO7QkwBhAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQkwAo0JIAus+RAOzTmBjX1589/uCvYv/vyor/6sGG/+Gy + f+LXny852pcAob2JKv1gV7H/Kjr9/y89+P81QO//NUDv/zVA7/81Pu//NT3v/zZL8P82Z/L/Nnnz/zZ6 + 8/82d/P/Nnfz/zZ38/82d/P/M3b4/yl0//9Bc9f/ppRX/9eSAP/SkADK0JMANAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA0JMAbM+SAOvPkQD/z5EC/8ySHP/Yni3/5Kk0ytyeFC3VlQAO2pkASdqYAKucd1vyRUjV/yk5 + //8yPvT/NUDu/zVA7/81QO//NT3v/zU97/82TfD/Nmny/zZ78/82evP/M3b5/yp1//86d+v/gISE/8yS + Ff/YkgD90JIAjtCTAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0JMAJNCTAKHTlAD+uIYm/4Fn + d/9+Znj9nnhP+7iGMOHGjhO5z5MFot+bANPRlBL/im1z/0VI1f8yP/L/NUDv/zVA7/81QO//NUDv/zU9 + 7/80PfH/Lkz6/ytm//89eeb/d4OO/7+QJv/clQD/1JQAytCTAEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTAELUlQC2w4sd/4RqfP9GSs//Lz32/zZA7f9FSdj/U1HC/2NZ + rP9xYJb/WFK7/zM/8f80P/H/Mz/y/zA99v8sO/z/Kjr//zM/8/9STMT/i25x/8ORHf/blQD/1pQA49CT + AHPQkwALAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADTlQBF25kArs+TCvSnfEr/c2GW/0xMz/80QPD/KTn//yU3//8oOf//Ljz5/zE+9f83Qez/RknW/2FY + r/+IbXX/s4Q3/9OVA//bmAD/1ZQA4NCTAIDQkwAbAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0pQALNmYAH3bmQDI0pUE+cKM + Hf+ygzf/p31K/6F6Uv+le07/roE+/7yIKP/MkQ3/2JcA/9uZAP/XlwD10ZQAu9CTAGXQkwAWAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTAATRlAAv1JUAZteXAJvZmAC92ZgA1NmYAOHYlwDh1pYA19KU + AL/RkwCb0JMAY9CTACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA///////wA8AB////////////////AAAAAH///////////////gAAAAA/wP////////////wA + AAAAAAAP///////////+AAAAAAAAB////////////gAAAAAAAAf//////////gAAAAAAAAAH//////// + 98AAAAAAAAAAB//////+H/AAAAAAAAAAAAf//////wfwAAAAAAAAAAAP///////B8AAAAAAAAAAAD/// + ////4PAAAAAAAAAAAB////////BwAAAAAAAAAAA////////4cAAAAAAAAAAAf///////2DAAAAAAAAAA + Af///////+wQAAAAAAAAAA/////////kAAAAAAAAAAAf////////4gAAAAAAAAAAH/////////AAAAAA + AAAAAB/////////wAAAAAAAAAAAf////////8AAAAAAAAAAAD/////////gAAAAAAAAAAA/////////4 + AAAAAAAAAAAP/////////AAAAAAAAAAAD/////////wAAAAAAAAAAA/////////8AAAAAAAAAAAH//// + /////gAAAAAAAAAAB/////////4AAAAAAAAAAAf/////////AAAAAAAAAAAP/////////4AAAAAAAAAA + D/////////+AAAAAAAAAAA//////////wAAAAAAAAAAP/////////8AAAAAAAAAAD//////////gAAAA + AAAAAB//////////8AAAAAAAAAAf//////////gAAAAAAAAAP//////////4AAAAAAAAAH////////// + /AAAAAAAAAH///////////4AAAAAAAAP////////////AAAAAAAAB////////////4AAAAAAAAf4//// + ///////AAAAAAAAAAAf/////////4AAAAAAAAAAD////////8/gAAAAAAAAAAf////////j8AAAAAAAA + AAH////////8HgAAAAAAAAAD/////////gAAAAAAAAAAA/////////8AAAAAAAAAAAf/////////gAAA + AAAAAAAAD/7//////8AAAAAAAAAAAAAAP//////wAAAAAAAAAAAAAB//////+AAAAAAAAAAAAAAf//// + //8AAAAAAAAAAAAAH///////gAAAAAAAAAAAAD/////8AAAAAAAAAAAAAAB/////AAAAAAAAAAAAAAAA + ////+AAAAAAAAAAAAAAAA/////AAAAAAIAAAAAAAAA/////gAAAAAHAAAAAAAAB/////4AAAAAB4AAAB + AAAH//////AAAAAA+AAAAQAAB//////wAAAAAPgAAAGAAAH/////+AAAAAD8AAABgAAAf/////4AAAAB + /AAAA8AAAA//////wAAAAfwAAAPAAAAD//////4AAAH8AAAD4AAAAH//////4AAB/AAAA+AAAAAf//// + /4AAA/4AAAHwAAAAB/////8AAAP+AAAAcAAAAAH////8AAAD/gAAADgAAAAAf///8AAAA/wAAAAcAAAA + AD///8AAAAf4AAAADAAAAAAf//+AAAAH8AAAAAYAAAAAH//+AAAAB+AAAAACAAAAAA//+AAAAAfAAAAA + AwAHAAAP//AAAAAPwAAAAAEAA/gAH//gAAAAD4AAAAAAgAD/////wAAAAA+AAAAAAMAAf////4AAAAAf + AAAAAADgAD////8AAAAAHwAAAAAAcAAP///+AAAYAD4AAAAAAHgAB////gAA8AA+AAAAAAB8AAP///4A + B+AAPgAAAAAAPwAB////AD/AAL4AAAAAAD+AAP///4f/gAGcAAAAAAA/4AB//////wABjAAAAAAAP/gA + P/////4AA4QAAAAAAD/+AD/////8AAeAAAAAAAA//8B//////AAfgAAAAAAAP/////////gAP4AAAAAA + AA/////////wAH+AAAAAAAAP////////8AD/gAAAAAAAD////////+AD/4AAAAAAAAf////////gD//A + AAAAAAAD////////8D//wAAAAAAAAf///////////8AAAAAAAAH////////////AAAAAAAAA//////// + ///+4AAAAAAAAP///////////2AAAAAAAAD///////////8gAAAAAAAAf///////////IAAAAAAAAH// + /////////wAAAAAAAAB///////////+AAAAAAAAAf///////////gAAAAAAAAH///////////4AAAAAA + AAB////////////AAAAAAAAAf///////////wAAAAAAAAH///////////+AAAAAAAAB////////////g + AAAAAAAAf///////////4AAAAAAAAH///////////+AAAAAAAAD////////////wAAAAAAAA//////// + ////8AAAAAAAAP////////////AAAAAAAAH////////////4AAAAAAAB////////////+AAAAAAAA/// + //////////wAAAAAAgP////////////+AAAAAAcH/////////////gAAAAAPj/////////////8AAAAA + H//////////////9gAAAAH///////////////gEAAAD///////////////+BwAAB//////////////// + wAAAB/////////////////AAAB/////////////////8AAA//////////////////4AB//////////// + ///////wD/////////8oAAAAMAAAAGAAAAABACAAAAAAAAAkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADMigAB0ZUFAQAAAAAAAAAAAAAAAM+RAALapEkB4LBzA9+uagTfrmwE365sBQAAAADfrmw0361sseS3 + d9nnvn3l6L1+5eW5eN/fr23J365tzei+fufsxIXy6sKD9ue8fPLgsG/j3qxqZgAAAADerWkT3q1pHt+t + aSffrWkm3q1pFQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTAAPQkwACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA365sAwAA + AADdq2iM7MWG//ncoPv4257/+Nqe//ndof/tyIr/4rNy//ncof/53KD/+dyg//jbn/711Jf/4rR07+Gy + d8ritn3k47eA7OO4gvLjuILx47Z+6+CwcabfrmsKAAAAAN+ubAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAOjKggHMigAR0ZUFDgAAAADQkwABAAAAAM6QACPZpEgO4K9xL9+t + Z2LfrWqJ365rpN+vbrndrGre7MWH//ndof332Jv+99mc/vjboP7z0pX94rRz/ffZnf732Jz/99ic//fZ + nf/42p395ryB/eW+kv/nv5P/57+T/+a/k//mv5H958CW/+K1fOXerWkOAAAAAN+ubAEAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOjKggXMigA90ZUFpNCTALTQkwEoAAAAANKX + E23drGXs4bJ4+OK2fv/kuYT/5buJ/+W9jf/kuov/5rt8//jbnv/32Z3/99md//janv/11Zj/47R0//bX + m//32p7/99md//fZnv/32Jr/5buA/+W+kf3mvpD95r6P/ua+j/vmv5L45byM/9+vbo4AAAAA365sAwAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOjKggEAAAAA0ZUEB9CT + ALLQkwH7zpIAHtGYG1PmtHz/5cCU/Oa/kvvmv5L75r+S/Oa+kfzmv5L947d+//XVl//42p//99md//fZ + nf/32Z3/5LZ1//TUl//42p//99md//fZnv/215r/5bqB/+W8jf/mvo//5r+T/+a/kv3lu4n/4LBxxd+t + ahAAAAAA365sAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOjK + ggEAAAAA0ZUFGNGVAEHQlALk05IAvMOWCn7EsGj/7LyP++S/kf/mvo7/5r6P/+a+jv/nwJP/47iF//DM + jf/53KD/99ic//fZnf/426D/5bl5//LPkv/426D/99ic//fanv/21pn/5bqD/+S7i//itXz/4rR4+eGx + dMrfrmt4365qDAAAAADfrmwBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAA0pYDA8uMCJ3OlAix3JIA/pqhKfNaxYn/6LZ9/+i8jP/kwJX/5L2S/+a/ + k//mv5D/47iG/+rChf/53KD/99ic//fYnP/53aH/5719/+/Ljf/53KH/99ic//janv/11Zf/5bqD/+a/ + k/7mv5H/4bN28d6saB4AAAAA365sAt+ubAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADMigAEAAAAAMiHDmuiVUD/25IA+J+iLf8yx4n/nNm3/+K5 + g//qtoD/8sKF/+a8hv/htHn/5LuK/+W7g//32Jr/99me//fYnP/53aL/6sKE/+zGiP/53aH/9tic//ja + n//11Jb/5LqE/+a+kf/mv5L85LqH/9+talwAAAAA365sBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADMigACAAAAANieAByaSErurF40/9ef + AP1MtWX/VNer/6T18/+y2L//h5S3/86pgf/qv4v/5r+U/+S4hf/y0JL/+Nug//bYnP/53aH/7ciK/+rC + gv/53aH/9tic//jbn//005X/5LmF/+a/kv/mvpD75b2N/9+vbpMAAAAA365sAwAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0JQFAwAA + AADGhRKZiDFg/9qNAPuRqj3/MsB7/3/n0v+a////acHz/8yri//swpD/5b6R/+S6i//sx4r/+dyg//bY + nP/43KD/8c2Q/+i+fv/53aH/9tic//jbn//z0pT/5LqH/+a/kv/mvpD85r6Q/+Cxca4AAAAA365sAgAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA0ZUFAgAAAADYngAroVFB9aBMRP/WoQL+S7hu/0fHh/+W9fb/pPbu/967hP/ovpD/5r6Q/+W9 + kP/mvYP/99qc//fZnf/425//89KV/+e8fP/425//99ic//jboP/y0JH/47eC/+fAk//mvpD85r6Q/+Cw + ca8AAAAA365sAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTAAMAAAAA0ZQFiIUuYv/GdBn7pK0u/y+/e/9f06L/n/b2/9u7 + h//ovY//5r6Q/+a+kf/hs3f/9NOV//jan//32Z3/9tea/+e7e//32Jz/99md//jbn//y0JL/4rV3/+W+ + kP/mv5H65byN/9+ubY0AAAAA365sBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTAAEAAAAA1ZoADL14HtCEKWX/144F/HC3 + V/8vv3r/bNy1/9fFmv/ou4r/5sCS/+S7i//nvX7/8c6Q//jbn//32Jz/99qe/+e8fP/11Zn/99qe//ja + nv/y0ZX/68SD/+S6iP7nwZb/4rV7/9+taj0AAAAA365sAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQkwACAAAAANie + ADGoXTjykDNY/9CcB/1VvGz/K8OB/5u7ef/zuor/4sCU/+K4hf/tyIj/8M2Q//bYm//32Z3/+dyg/+i+ + fv/y0ZT/+Nue//ncov/vy4b/5rph/+W7hPnitXz7361rhQAAAADfr20B365sAd+ubAPfrmwBAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA0JMAAwAAAADYngBOm0xI+5k6Tv7IoQ38UL9t/zvAgf/Utnn/97+T/+W4hv/vyov/8tGU//PS + lf/32p7/+dyh/+vDhP/wzI7/+Nqe//vgqf/hs1j82aQ9/+e8f7Hbp2IB365sAQAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTABkAAAAA15wAQppLSPKVN1P/y5QQ/nG6T/9Ovnr/sbyB/9O1 + ff/tyIr/9teb//DMjv/425//+Nqe//HPkv/y0ZP/99mg//7jmv+7eD79s2s//+3FddXjtXl84bFvsd+u + a8LmuXjJ5LZ2w9+ubYzfrWsSAAAAAN+ubAIAAAAAAAAAAAAAAADfrmwBAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADPkQACAAAAANCTATXPkgGT0pYBHd6nAC2sYy/QjC9R/8Zy + Fv6uoij/a7Rf/2+0bP/ow4P/+t2h/+7Ji//32Jz/99md//fYnP/32Zz/9tef//veh/+oW0L/jjVQ/+vA + X//53Kf/9tib/+vDhP/wzpD/+t+k/PPRlP/frmx0AAAAAN+vbQQAAAAAAAAAAN+vbQEAAAAA365sAt+u + bAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0ZQIAgAAAADRlQBjv3sc/7Jo + KcjRlBTA1aBg/9qvjv/1w3v/8LVw//DNjv/pwIH/+Nqf//TUl//22Jv/99md//fYm//53KT/7MZ1/+/K + ev/PkxX/kDdF/9mlVv784KX7+Nuf/O7Jivzvyoz7+dyg/urCgvPcqWc6AAAAAN2raQIAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgsHMC3qxlA9ii + PgYAAAAAzI0DUaBOMvPEhnL//+ik/v/np//qxYn/78+T//zip//rw4T/89GU//ncoP/32Z3/99md//bY + m//636n/5bpe/+CxT//eqRv/uHAS/8GBR//945z/9tie/+rCgv/vyoz+8MyP/+e7fO7nvH3F57x8y+e7 + fMfnu3zF5rt7w+a7esLluXjK4rJwl9+tawsAAAAA3KdgAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+u + agIAAAAAAAAAAAAAAADerGwBAAAAANmhEhXXny6G57x/6vPSlf/xzpD+6L9///jcoP/y0JP/68SF/fnc + of332Jz/99md//bYm//53ab/68Rx/9GVDv/UmxX/zpAA/797Hv/00oj++Nui//jbn//vy43/7ceJ//ne + o//53KD/+Nyg//jboP/425//+Nuf//jboP774ab/7MSF+t2raCcAAAAA3KdgAgAAAAAAAAAAAAAAAAAA + AAAAAAAA4LBvAQAAAADdq2gd3qxpU9+va3rhs3GT5Ld7p+S3fq7kt3O26L186vDMj//txoj+8c6Q//fZ + nf/53KH/68OE/vLQk//53KH/99ic//fZnf/32p7/99ib/9SaGf/RjwD/0JYE/8uLAP/ovmf/+t6n/vbX + mv/53aH/8c6R/+vEhP732p7999md/ffanv3425/9+dyg/vbYm//sxYb54K5tawAAAADgsG8CAAAAAAAA + AAAAAAAAAAAAAAAAAADcp2ACAAAAAOCvbXHrwoP38c6R//TUmP7215v/99mc//janf/426H/++Cm/+7J + i//wy47/+d2h//fZnf332Z3/47V0uuGycbT215r/99qe/ffZnf/22Jr/+96o/+W5Wv/BkgX/1pMF/82Q + AP/cqELt+Nyl/PfZm//32Jz/+t+k/+7KjP/vyoz/+Nme//TTlv7wzY//6cCA5OGycJbdq2gqAAAAAN+u + bAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADcqGACAAAAAOCwbrP01Zj/++Cl+vncoPf42p7499md+PfZ + nPv425/88c6R/uvDhf/53aH/99ic//ncof7uyYr/3atpPd2qaBjsxYf3+d2h//fYnP732Jv/9tqg//7S + jv+YqkH/qZ8n/duPAP/RmiaQ7siQ1PrdoP/005b+89OV//ncof/rxIX+8c+S/+GycdXcp2RK3apnAQAA + AADgr20B365sBd+ubAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADcp2ABAAAAAN6tax7frmy46cGB/fLQ + k//215r/+Nqe//jan//42p7/6sOE//XVmP/426D/9dWY/fjcoP/luXjR3qxqA96sagTnvX3T+dyg//ja + nv353KD/9tmd///ep//Vt1X/TbRa/MOXDf/VkwVl369oavbXnP/42p376L19/+vDhP/qwoP/+Nyg//XW + mf3qwYLa4bJwht2raS0AAAAAAAAAAN+vbQHgr28DAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADfrmwB3atoLd6ta2rhsnGF4rRykOS2deHwzY//7MWG/vjbn//sxYb/89OW+/XWmf/fr22NAAAAAAAA + AADjtHSs+Nuf//PRlPzuyov/7smL/+3LkP/xvHH/krZs/JaoRv/ZkwlW2qlfAunBg+P636T/8c+R/ee9 + ff/21pn/99md//fZnv/53KH/9tic/+7KjPnluXi63qxqV92raAkAAAAA3KhgA+/XtwEAAAAAAAAAAAAA + AAAAAAAAAAAAAN+ubALfrmwE4K9uAQAAAADdqWcY4rNylvHNkPj53KH/7smL/ua7e//nvXz/+t6j/e/K + jP/dq2lOAAAAAAAAAADerWt+6L5+/+3GiPvyz5H/7smL/+/Mjv/115z//tWb/u7Ii//kt3XO3qtrJtys + al300pX/+dyh/OrBg//11pn/+Nyg//jan/722Jv799md+vncoP7425/+8tCS/+e8e9nerWxe26ZeAgAA + AAAAAAAAAAAAAAAAAAAAAAAA4K9vAd+ubAMAAAAA3qtpF9+ubJLsxYb3+Nqf//jcoP732Zz/+Nqe/+3H + if/wy43++t+j/+i+f/Hdq2ghAAAAANupZyLktnXW8tKV//fcoP3y0JT/89GU//LQkv/z0ZT/9dme//3k + pf7x1pz/6sKC+eaybFfjuHjD++Gm/+7Jiv3uyoz/7MWG//PSlf/53aL/+dyg//jbn/z42p75+Nyg+fnc + of3y0JT/4K1np+/WtgMAAAAAAAAAAAAAAADcp2AB4LBvAQAAAADdqmhi5bl46PTTl//53KH999md/PbY + nP732Z7/+d2h/+zGiP/y0ZT9+dyg/+O1dMcAAAAA3atqCe6+e8r42p3//OOl/frdoP/y0pX/+Nqf//bY + nP/x0JT//+Sk/7egff8YFhD8MS4j/7qWYeXos22B6MKD/uzFhv7005f+8c+Q/9+vbezmu3u+7ceJ8vHO + kf/01Jj+9teb//fYnP/64Kb878iF/+7VtWQAAAAAAAAAAO/XtwEAAAAA365tEN6taq3sxof/+Nuf/vja + nvv215v799md/Pndov/11Zj/8tCS/+vEhf/01Jf789OV/9+ta4gAAAAA6rhxf66Xaf8jIRr6Rj4t/+PO + lf/7253/9deb//fZnv/z1ZX//+Oz/1FFU/8AAAD/AAAA+xsWD//SpGav5LJurfLSlf/525/6+Nuf/vPS + lf/gsG+d26dkJN+ta0Lfr21s4rJxiOO2dZ3kt3ei3qpjk+/XtycAAAAA////AQAAAADcp18H4LFwvvHP + kv/53aL3+Nqe+vjbn//53KH/99md/+7Ji+TjtnXx9dea//PRlP7pv3/+5bh7/d6tbi/hr2gG3K+B5B0Z + Hv8AAAD9AAAA/0dALf//5KX/9NSY//LQlv/+4pv/0Kql/ykQRf8AAAD/FRQU/wAAAP9rUjH77rpyR+G1 + drv215v/+Nug+/jbn/v32Z3/57x8w92raBkAAAAA3q1rAQAAAAAAAAAAAAAAAAAAAAAAAAAA////BAAA + AADbpF1X78uO//reo/z21pr+9NOX/+/LjvnpwIHI4rNyYdypZYjwzI79+dug//nbn/r01Jn/3atZsgAA + AADpu2tXv4uq/wAAFfxMTkb/Q0JD/xwdHv/OuIb//96f/+7OlP//6J//ooKE/x8ATv8cIRf/kpCT/3R4 + dvuxnq//2aNsggAAAADer2+i78yO//jbn/753KD5+Nyg/+rCg+jdq2g+AAAAAN+ubAXgr28D3KdgBO/X + twIAAAAA////AgAAAADcp2Ah47V1ruO1dbzis3Gb365sZN2raSoAAAAA3KlnXe3GiP/53KD/+Nqe+vfY + m//kt3nM05QQqtOUFiLpwnOIz6TZ/xoAQfwlKx7/lpSW/+3w9P+9ron//+Cf//PWnf//56T/oIxy/zoH + dP8HAQv/U1RQ//////zgz/f/zZl+vwAAAAAAAAAA4K1qT+W5edfxzpD/99md/fzgpv/uyYr13q1qRwAA + AADgr28CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA365sAwAAAADdq2hW6cCB//jc + oP3425/59taZ/+O3e+LdpUoVw5EYr7yMJsjtwGe27tv1/1kWnf0CAQP/09TQ//b3/f+ekXf//9+e//PV + m///4aP/wbB+/1c8ef8cAEb/nZii//////26nOX/8cen1IdnOAdfSjADAAAAAN+tagndrGld4rV0u+rB + guftx4j/4K9tmQAAAADgsG8CAAAAAAAAAAAAAAAAAAAAAAAAAADcp2AB4K9vAt+ubAHfrmwFAAAAAN2r + aSjmu3rv+Nug/vndofry0ZT/4bJvzd6tciMAAAAAvI4fmVd6tf/Yojj7///o/55p3v8yAGj/2NXa/5iM + rf9sWE///+qm//LVm///4KP/1r2F/5SSkf9KLW3/ZEqA/56Itf6sktD/wbCO9SsdDEMAAAAAV0QqBeu4 + cwEAAAAAAAAAAN2raBTdq2ge365sAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADfrmwCAAAAAOGxcKb32p7/99qe/OzFhvnerWqO365wCt2qXQMAAAAA1ZQAekd72P9Xdq376LtU//Tv + 9P9vS6j/NBFS/1VGcP+ilXr//+Gg//TXnf/22J7/+NmZ/5CJc//f4Ob/jX+b/6aXtv/j5On9opZ0/9qx + csa8kVkLAAAAAOCvbAHfrmwD365sAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAADfrmwBAAAAAOCwblznvX274rRyjN2rZywAAAAA365qAtOYGAUAAAAA3JYATnqE + jf8gdP/8WnWk/9iwVf/79NT/5OX7/8XIy/+zoXP//+Sk//nXnP/715z//+iu/72rd/+Xl5b///////// + //+ysa//n5Bm+8mue//qtnCHAAAAAN+ubAMAAAAAAAAAAN+ubAHfrmwCAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgsHID1ZwnAgAA + AADPkwQi2JQAM6qLQuAydvn/L3j//kFyy/+uk1n//+in/5GMfv/hyZD/4q09/8qvTP/XyYH/9MV2///m + p/+voHf/ko6H/6Cem/+Eel3/1LyG/v/jpf/it3jo3KtoFgAAAADfrmwBAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN+ubAPfr20C365rBOCv + cAIAAAAA0JMCAgAAAADPkwAq0ZQCm9mZErxPe8v/Mnb5/TN4+f8vdPX/Y3SP/7OTR//7znf/+c+K/9u6 + X/+f16v/o9+7/9m5YP//2pH/4syW/9a7gf/536D/4seP//LQk/3vyoz/3atoUAAAAADfrmwDAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTAwIAAAAAxpEStdSaJP+fi1z8KHT//zp47f84ePP/LHf//zp5 + 7f+cwaD/zsh4/+3Gdf/ts03/qN+7/5Lz7//BuGX/+cp4///nsP/115v//N6i/+/Ji/vxzpD/365seAAA + AADfrmwEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM+RAQMAAAAA0ZEAUW2Alf+ciV/9UXvK/zB2 + /P83d/H/Onnv/y5v9f9Oov//mP/7/5fn2f+v27T/uMeG/5j39P+R/P7/tr94//C/aP/426P/99qe/+/L + jfvvy43/4LFvfQAAAADfrmwEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANmkRgEAAAAA5Kc8CKuQ + VtosdPL/Q33i/TR19f82d/L/Nnfz/zh58/8vbO//c8X5/5////+P+v//k/3//5j2/f+Y9/7/kP3+/7fG + h//30I3/+N2j//HNj/zuyIr/4K9tXAAAAADfrmwEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADgsHMCAAAAAOmtRah4b4X/JWb//Dt+7v82ePP/Nnbz/zd48/81dvP/Nnfz/4ni+/+d/fz/lvP9/5f3 + //+X9v7/l/n//5b08f7nzZX9+9uf/vTUl//rxIX63qxpKgAAAADfrmwCAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAADfrmsDAAAAAOGxdFnjrUb/WlCr/ClT//86d+7/Nnvz/zZ38/83ePP/MnLy/0GF + 9P+T8P7/m/v//5X1//+X9/7/mfb9/pD7//3SyJX//NeY+fjcof/luXnFAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADfrWoBAAAAANyqaQbrwoTN4rRT/1VHq/0nPf/9OWPu/Td5 + 8f82evP/OHnz/zBv8v9HjfX/lfP+/538/f+W9fz8kv///63NkPXXnTeq9NKb+vLQkv/erGlWAAAAAN+u + bAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0pYOAgAAAADXoUtR9M+X9ezD + Yv1vXpv+JjP//zBG+P83ZvH/Nnnz/zh98/8yb+//R4ry/ofp//uW/fz/tsB4+dOKAFoAAAAA4rV6iuGx + boIAAAAA365sAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANCS + AAPPkgA91JsryunBe//nrzvAonlJsExK0P41PO//OE7t/zRo9P0weP39I23//luJzP/Gqjva1YsAOQAA + AADYo0ADAAAAAAAAAADfrmwBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAANCTAQEAAAAA0JIAKsiLCaybd1zmkHFoz4Bog/Y8ReP/LDn8/zk/6v5ZZLz/moxc89GQ + B4rTjgAQAAAAAM+RAAPYoj8B4LB0At+uagIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQkwABAAAAAAAAAADPkgU5roE5oJZ0XtiVdGPxn3lS87uI + JtbXkwKM3JUAJgAAAADPlAMC0JMBAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//4AH///AAD//AAAH/8AAP/gAAAf/wAA5wAAAB// + AADzAAAAP/8AAPkAAAD//wAA8AAAAf//AAD4AAAB//8AAPgAAAD//wAA+AAAAP//AAD8AAAA//8AAPwA + AAD//wAA/gAAAf//AAD/AAAB//8AAP+AAAf//wAA/8AABB//AAD/YAAAH/8AAP+AAAAf/wAA/8AAAAAf + AAD/4AAAAB8AAP8AAAAAPwAA+AAAAAB/AADwADAAA/8AAPgAMAYA/wAA/wAwBgA/AAD/gHgDAA8AAP4A + cAEAAwAA/ABgAAADAADwAGAAAcMAAOAAwABA/wAA4EDAACB/AADjwIAAOD8AAP+CAAA+HwAA/wYAAD// + AAD+DwAAH/8AAP8/AAAP/wAA//8AAA//AAD//gAAD/8AAP/+AAAP/wAA//8AAA//AAD//wAAD/8AAP// + AAAP/wAA//+AAA//AAD//4AAH/8AAP//wAGf/wAA///AA///AAD//+AH//8AAP//+B///wAAKAAAACAA + AABAAAAAAQAgAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANCUAwMAAAAAAAAAAAAA + AADfrmoCAAAAAN+tajflunnb7ceJ7u7Iiu/munng5Ld25PHNj/bvyo356L9/9d+ubHnfr21H4LBwaeCw + cG7fr21R365sDAAAAADfrmwBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANScFA3PkQATAAAAAM+R + AArVnjAT4K9xKd+taVffr21p3qxrsPHOkP/53aP9+d2i//LRlP/qwYL/+t6j//jboP/32p3/5ruD/+W8 + jf/mvY3/5r6P/eW7iv/frm1NAAAAAN+ubAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA1JwUF8+R + AIvQkwKDz5IACN6oVM3juYb/5LqG/uW9jP/juor+68SH/fjbnv732Z3+9NOX/urAgf74257/99mc//bX + mf7mvYf+5r+T/ue/k/znv5T/47Z+3N+tahAAAAAA365sAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPz4 + 7QIAAAAAz5EAH9OXA9fNkQCFzapT1uq/lv/kwJT75b6S++a+kv3nvof/99mc//fanv/215v/6sGB//fZ + nf/32p7/9taZ/+W8hv7kuYb/47eA8uGydrPfrWoqAAAAAN+ubAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA/PftAgAAAADOkAAnx4QTxM2VAvhjvHD71L+P/++3gv/uwoz/5LyL/+O5g//005b/+Nqf//fZ + nv/qwoP/9tea//jan//11Zj/5byJ/Oa+kv/hsXS+AAAAAN+ubQLfrmwBAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAA05oWAQAAAACqYDXCxXUb/2m5T/x03sP/xdO9/7Slmv/luYL/5LuM/+/K + jv/425//+Nuf/+vEhf/01Jf/+Nug//TUl//lvIn+58CU/+O4g+7frWoYAAAAAN+ubAEAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADTmxUDAAAAAMeJEFWmSkH/sqAb/ELIjP+J/P//lcbR/+m5 + hf/kvpP/6cKK//janf/43KD/7ceJ//LQk//53KH/89OW/+W7if7nv5P/5LqH/d+taiwAAAAA365sAgAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKxjMsG4YC3/dLg//E/X + tv++5tH/6biD/+XAlP/kuYL/9NSW//ndov/vy43/8M2P//ndov/z0pT/5LmC/ufAlf/juYT1361qHwAA + AADfrmwCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM+RAAIAAAAA05kAMaBJ + RPa1fib/SMdp/XHMpP/wu4n/4r6R/+a9gv/z0ZP/+d2h//HOkf/vyoz/+d2i//TUlv/ov3785b2O/+Gy + dK8AAAAA369tA9+ubAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANCT + AwMAAAAAyo8MUJ9BR/+nizD/Q8ls/qy9iP/6u5D/7cSJ//LRk//42p7/89OW/+3HiP/74Kj/7MV1/+Gx + V/3gsHRs3apnC96sagHdq2gBAAAAAN+ubAHfrmwB365sAd+ubAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAM+RAQ3UmAAcyo8NSaZKPOmidyn/cLJP/pK1dP/awoT/99SW//TUmP/32Zz/8tCU///o + pv/Giln/unZK/vHMg6zkuHnC57t72OvChNXhsnBbAAAAAN+vbQIAAAAAAAAAAN+vbQEAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAADVmyECAAAAAM+RAGHFgw6vwIEivMeCZP/lrVz+vb1x/9zFhv/51pn/9NWY//ja + nv/22J3/9taJ/8uQRP+iUj//+t2U//bXnf/vyoz7+Nqf/+Gxb4wAAAAA3atoBd2raAHdqmgBAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADdqmACAAAAAMF+FVPBf0Xg/eSe/PLSmv/60JX/9NCT//LQ + k/343KD+9tib//ncpP/jtlv/3Kcg/7p0FP/owID7+Nue/O3HiP3uyYv87MaH2uzFhtbsxIbT7MSGzO3H + iOHktnaRAAAAAOK1eAIAAAAAAAAAAOK1dgEAAAAA3qtpDt+ubkDis3li5LZoX+OzWI/pwIPy78qL/+/O + kP722Z3+7siJ//janv/22Jv/+t6n/+jAaf/RjwD/zYwA/96vT//74an+9tea/+/Mjv/22Jz/+t+k//vg + pf/63qP+89OW/+O0c3cAAAAA4rV4AwAAAAD9+fUCAAAAAN2qZx/qwoTs9tea//bXmf732J//+dym//TT + lv/wzI7/+d2h/vbWmv/gsG6O7ceJ2/ncoP/22Z3++tib/8OjLP7MkAD/2p8p5fbYofX32Zz/99mc/+/L + jf3yz5L96cCAx+S3doDerWssAAAAAN6taQIAAAAAAAAAAP359QEAAAAA3qtoDOW4eLXwzpD/9teb//fZ + nP3115n87sqL//fZnf74257/7ceI6dunZQHmuXmX+d2i//bZnPv/3KP/y8Jx/ICiLf/UjwaX6MF+qPja + n//tx4j87ciJ/vLRlP/nvHy33q1rOQAAAAAAAAAA3q1qAeK1eAMAAAAAAAAAAAAAAAAAAAAA3q1qAt6s + aiPfrmxK47Rzqe/Ljf/vy43+7ceJ+/XWmv/munmpAAAAAN+wb2rvzI//8MyO++7Ljv/xyIb7r710/86i + NpbeqWEq89Sa/+/KjP/wzI7/+t+k//ncof711Zn/7MaH3OK0c3rcqWUVAAAAAP369QEAAAAA4rR4Ad6t + agMAAAAA3qtpGuW4eJPy0JTy+dyg//LPkf7sxYb79teb/+Cxb2sAAAAA67p2i/fTlP/x0ZX88c6Q//PS + lv//3qP+8NKb/+W2dZLrvn2l9dec/+7Ji/zxzpD/99ic/vreov/636T++dyh/+7JifHkuHxWAAAAAP35 + 9QEAAAAA3apmAt+vbXjtyIn2+Nqf//ncof753KD/8tGU//LRlP/y0JH/3KpoIui3clHDqHb/2sWR/f3f + of/01pz/+NiZ/+7Tn/8vKyX/Mywd/9SmZ6vtxIPp9NSY/+/KjP/jtXTB6L5+qu3Hid/wzZDt89KU/+rE + itL79/IEAAAAAOGzdgPjtXOu9tab//vfpf343KD/9dWZ9OvEhe/y0JL+78qM/+O5f8jns24HtJBn1wAC + Bf8OCwX9172H//rZnv//4Zz/rYyR/wIADP4AAAL/W0Uq4+67dIbtzZP8++Cl//LQk+/gr21jAAAAAN6t + axfdqmYk4bN2EQAAAAAAAAAA4bN2M+zGhv/y0ZT37MWH2ue9fYjfrWtt7MSG7PvgpP3xz5P/1586bu++ + bjd/WIH/HR0k/U5QVP+rnX3//tud///km/97Vnn/EQQk/36EePy7sLz/26ZzWvG+cz7ux4jq+Nug//nc + oP/mvHuVAAAAAAAAAAAAAAAAAAAAAAAAAADitXgC3qtnKt6saigAAAAA26dkGunAgdv74KX/8tKX/+Gv + YoC/iAuY7L9Xq7mR2v8RACX92ODX/8a8rP/w0ZP//+Wg/6CIg/8UAED/qqyo+/bj///Fmn6RAAAAANOk + ZRbktHJ968WG1u/KjP/gr21ZAAAAAOK1eAQAAAAAAAAAAAAAAADerGkBAAAAAN6sagnpwIDR+t+k/+/K + ivjfsXpxAAAAAJWFU7eRkof//uDI/GA1qP+Bcpb/g3Jy//ncnP/93qL/ybiI/3ttkv98Y5P9v63U/6eU + c9UpHQ4QAAAAAAAAAADaqGcG3qxqF9+ubQcAAAAAAAAAAAAAAAAAAAAAAAAAAN6saQQAAAAA3qxqHOrC + gsbnvXyk3qxtLQAAAAAAAAAAu5AmjC5w6v+fnYj76Mqq/5+Wvv+poIv/+NmU///anP/rzZH/rq+h/+7v + +v/Mzs38sJ5y/+69eJEAAAAA3q5sBt+vbQEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAADgr24BAAAAAM2RABLalgBzXIC8/x9s//+AkKT/0L+N/9e3df/sulf/wcWA/+fW + kf/buH3/trGe/66gfv7exIz/7ciJ8t2qaB0AAAAA365sAt+ubAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAN+ubAHfrmsB4LBzA9qmTAMAAAAAz5IAB9KVDMOjjVz/Mnb6/it0/f83atH/o7Od/+XQ + gP/Vv23/n926/8vQj//6zH7//OGl//TVmPzvyoz/4K9uTgAAAADfrmwDAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANCUCgQAAAAAu5EuenGDmP9IfNv8Nnf1/zF0 + +f86if//kvL1/6zlyv+m48n/jPr//7vLkf/2zof+9tie/O3Hif/hsXBRAAAAAN+ubAMAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA361qAgAAAADqsFYufn6R/SZr + //87fvD/OHny/zFs8P9bqPn/m////5P4/v+Z9///jvj7/dPWqv392Jr97MiL+9+taygAAAAA365sAgAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADqtF7HamKn/yRV//w5evH+OX3y/y9t8v9ruvf/ov/8/5j2/PyP////wc2d9/7Xl//pwoTCAAAAAN+v + bQEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADWnSsDAAAAAN6rUFfvxHf/emil/C1E9/41ZvX/OXzv/zFz8v1juv38lP7//7PDed3WmCQ+572DsOCw + bUMAAAAA365sAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAM+RAAEAAAAAzY8AFNulMb3WpkvrhWd10TpA6P8rR//+MWf5/lJ6xP+4n0Ky1Y0AGAAA + AADernEB3q1qAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAANCTAgEAAAAAz5AAB7yGGmGhe0+/f2iC9HpiiPamfETH1JUFVAAA + AADNkgAB1Z0rA+CwdALfrmoCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/wD///4AB/8gA + Af/gAAP/4AAH/+AAB//wAAf/8AAH//gAB//8AB///gAB//wAAP/+AAAH/gAAD+AAAB/gCAA//AwID/gY + AAPwGAABwBAAP8IwAw/8AAHP+MAB//nAAP//4AD//8AA///gAP//4AD//+AA///wBf//8A////w//ygA + AAAQAAAAIAAAAAEAIAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAADmxXcHzIsAC9WaHgjesHAk3q5sYvDM + jfPvy4307siK9vLQk/rjtny247iEzeGydXgAAAAA369uAwAAAAAAAAAA5sV4Bs6MAGPSojCY6rqK/+a7 + h/7x0Jb/99ib//LPkv/42p7+5r6L/+S6iPPgsXJRAAAAAN+vbgMAAAAAAAAAAAAAAADLegBrlp9A/7LR + r/zftZD+7MaM//bYnP/xzpH/9tea++a9jP/gsXNyAAAAAN+ubQQAAAAAAAAAAAAAAAAAAAAAy4UAG6hu + Ku1h2KX/xsy5/u+7hP/015r/8tCS//XWmfvnwJH/4rV7iwAAAADfrmwF369uAQAAAAAAAAAA5cN3AwAA + AADMexRghoNC/4/Eg/7svIn/89SW//PSlv7y0ZH/47Z04N6tbjUAAAAA365sAgAAAAAAAAAAAAAAAOjJ + gwEAAAAA0pgDC75uGayomFT/ycR//fjUmP3636H+26xq/8+YYuDyz47e5rt7pwAAAADfr20M3apkBQAA + AAAAAAAA3qtoDd6sXTLXo06X9cqP//TRk/7005b++t+n/9ulMP/XnDX/+dyl//DNjvfxz5Li78yP59+t + aD0AAAAAAAAAAOGwa2jz0pn/9taa8/HRlP/y0ZTo4rZ2jfrbpP/bw23/u5cV2fbPkNny0pb/8M2P6+K0 + dFIAAAAA7tOwAe7UsQEAAAAA4bNxWvDNj+3y0ZP/6cKCsuq4czj72Zn/79KX/9e/dNfpu3ag8tCT//LR + lPT01Jjz6b98sO/Vsh8AAAAA5bh0mPbXnP/z05bu8dCU//DAf3eLcEm1oI9l///urPxwYFj/UkEm2/7V + kNnz0ZT8571+j+i8eZfw2LVF7tOwFOa5dZblunlt78mN3enFguTkrlWBXEhq+YSCfP//5ab/UDxW/pSK + nv/Em3BJ3rh5l+7GiMPbpV8OAAAAAO7UsQMAAAAA47V0Y+zIkcPdoTYUko1uw6ubvv+xmJX999eP/7+p + lvy5ss//nodimQAAAADktHIb3aplDgAAAADu1LAB3aljBOCwcQkAAAAA2ZMABJiHVcdCf+n/paed/dvM + ef/N0Jj+3cON/u/Oj/jls3AlAAAAAN2qZAIAAAAAAAAAAAAAAAAAAAAA3KtlBQAAAACslG6pJ2v4/y97 + +vyR3Ob+mfvy/Mfjw//4z4/83a5tJgAAAADdqmQCAAAAAAAAAAAAAAAAAAAAANqmTAMAAAAA36pQTIR/ + rv8tXfb9OoX+/oTo//+6z5jL67p2lwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANKU + AATYnB2DdWCT6FVfvPenj0OI2pYSBgAAAADfrmwBAAAAAAAAAAAAAAAA+B8AAMAfAADAPwAAwB8AAOA/ + AADgDwAA4AMAAMAHAADiAQAAhAEAAKATAADoDwAA+A8AAPgPAAD8DwAA/D8AAA== + + + \ No newline at end of file diff --git a/contrib/patcher/PonyPatcher/PonyPatcher.csproj b/contrib/patcher/PonyPatcher/PonyPatcher.csproj new file mode 100644 index 00000000..40fb7d63 --- /dev/null +++ b/contrib/patcher/PonyPatcher/PonyPatcher.csproj @@ -0,0 +1,108 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {B30D37BA-120C-41F0-89B7-4DDE1E204B91} + WinExe + Properties + PonyPatcher + PonyPatcher + v4.0 + + + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + pony.ico + + + + + + + + + + + + + + + Form + + + AboutForm.cs + + + Form + + + MainForm.cs + + + + + True + True + Resources.resx + + + + + + + + AboutForm.cs + + + MainForm.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + + + + + + {F6092522-5F0B-4111-A8BF-FCCDA2D6DB71} + LibPony + + + + + \ No newline at end of file diff --git a/contrib/patcher/PonyPatcher/PonyPatcher.sln b/contrib/patcher/PonyPatcher/PonyPatcher.sln new file mode 100644 index 00000000..03096fc4 --- /dev/null +++ b/contrib/patcher/PonyPatcher/PonyPatcher.sln @@ -0,0 +1,42 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PonyPatcher", "PonyPatcher.csproj", "{B30D37BA-120C-41F0-89B7-4DDE1E204B91}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibPony", "LibPony\LibPony.csproj", "{F6092522-5F0B-4111-A8BF-FCCDA2D6DB71}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B30D37BA-120C-41F0-89B7-4DDE1E204B91}.Debug|Any CPU.ActiveCfg = Debug|x86 + {B30D37BA-120C-41F0-89B7-4DDE1E204B91}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {B30D37BA-120C-41F0-89B7-4DDE1E204B91}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {B30D37BA-120C-41F0-89B7-4DDE1E204B91}.Debug|x86.ActiveCfg = Debug|x86 + {B30D37BA-120C-41F0-89B7-4DDE1E204B91}.Debug|x86.Build.0 = Debug|x86 + {B30D37BA-120C-41F0-89B7-4DDE1E204B91}.Release|Any CPU.ActiveCfg = Release|x86 + {B30D37BA-120C-41F0-89B7-4DDE1E204B91}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {B30D37BA-120C-41F0-89B7-4DDE1E204B91}.Release|Mixed Platforms.Build.0 = Release|x86 + {B30D37BA-120C-41F0-89B7-4DDE1E204B91}.Release|x86.ActiveCfg = Release|x86 + {B30D37BA-120C-41F0-89B7-4DDE1E204B91}.Release|x86.Build.0 = Release|x86 + {F6092522-5F0B-4111-A8BF-FCCDA2D6DB71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F6092522-5F0B-4111-A8BF-FCCDA2D6DB71}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F6092522-5F0B-4111-A8BF-FCCDA2D6DB71}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {F6092522-5F0B-4111-A8BF-FCCDA2D6DB71}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {F6092522-5F0B-4111-A8BF-FCCDA2D6DB71}.Debug|x86.ActiveCfg = Debug|Any CPU + {F6092522-5F0B-4111-A8BF-FCCDA2D6DB71}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F6092522-5F0B-4111-A8BF-FCCDA2D6DB71}.Release|Any CPU.Build.0 = Release|Any CPU + {F6092522-5F0B-4111-A8BF-FCCDA2D6DB71}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {F6092522-5F0B-4111-A8BF-FCCDA2D6DB71}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {F6092522-5F0B-4111-A8BF-FCCDA2D6DB71}.Release|x86.ActiveCfg = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/contrib/patcher/PonyPatcher/Program.cs b/contrib/patcher/PonyPatcher/Program.cs new file mode 100644 index 00000000..06c96f37 --- /dev/null +++ b/contrib/patcher/PonyPatcher/Program.cs @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Globalization; +using System.Threading; +using System.Windows.Forms; + +namespace PonyPatcher +{ + public class Program + { + static void Main(string[] args) + { + Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; + Application.Run(new MainForm()); + } + } +} diff --git a/contrib/patcher/PonyPatcher/Properties/AssemblyInfo.cs b/contrib/patcher/PonyPatcher/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..04609fcc --- /dev/null +++ b/contrib/patcher/PonyPatcher/Properties/AssemblyInfo.cs @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using PonyLib; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("PonyPatcher")] +[assembly: AssemblyDescription("mooege - an educational game server emulator.")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("mooege.org")] +[assembly: AssemblyProduct("PonyPatcher")] +[assembly: AssemblyCopyright("Copyright © 2011 - 2012, mooege project.")] +[assembly: AssemblyTrademark("PonyPatcher")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("52ca2c50-25ca-4120-a951-f98f5fdddd5d")] + +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// The form "{Major}.{Minor}.*" will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}.*" will update just the revision. + +// Set the assembly version from VersionInfo.cs file. +[assembly: AssemblyVersion(VersionInfo.Assembly.Version)] diff --git a/contrib/patcher/PonyPatcher/Properties/Resources.Designer.cs b/contrib/patcher/PonyPatcher/Properties/Resources.Designer.cs new file mode 100644 index 00000000..1e40b367 --- /dev/null +++ b/contrib/patcher/PonyPatcher/Properties/Resources.Designer.cs @@ -0,0 +1,70 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.261 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace PonyPatcher.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PonyPatcher.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + internal static System.Drawing.Bitmap pony { + get { + object obj = ResourceManager.GetObject("pony", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/contrib/patcher/PonyPatcher/Properties/Resources.resx b/contrib/patcher/PonyPatcher/Properties/Resources.resx new file mode 100644 index 00000000..cf86aa63 --- /dev/null +++ b/contrib/patcher/PonyPatcher/Properties/Resources.resx @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\assets\pony.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/contrib/patcher/PonyPatcher/README.md b/contrib/patcher/PonyPatcher/README.md new file mode 100644 index 00000000..9cfc9648 --- /dev/null +++ b/contrib/patcher/PonyPatcher/README.md @@ -0,0 +1 @@ +Patcher for battle.net.dll to bypass thumbprint and second-challenge checks. \ No newline at end of file diff --git a/source/D3Sharp/app.config b/contrib/patcher/PonyPatcher/app.config similarity index 100% rename from source/D3Sharp/app.config rename to contrib/patcher/PonyPatcher/app.config diff --git a/contrib/patcher/PonyPatcher/assets/pony.ico b/contrib/patcher/PonyPatcher/assets/pony.ico new file mode 100644 index 00000000..dcaf5ff3 Binary files /dev/null and b/contrib/patcher/PonyPatcher/assets/pony.ico differ diff --git a/contrib/patcher/PonyPatcher/assets/pony.png b/contrib/patcher/PonyPatcher/assets/pony.png new file mode 100644 index 00000000..cc642eee Binary files /dev/null and b/contrib/patcher/PonyPatcher/assets/pony.png differ diff --git a/contrib/patcher/PonyPatcher/pony.ico b/contrib/patcher/PonyPatcher/pony.ico new file mode 100644 index 00000000..dcaf5ff3 Binary files /dev/null and b/contrib/patcher/PonyPatcher/pony.ico differ diff --git a/contrib/protocompiler/README.txt b/contrib/protocompiler/README.txt new file mode 100644 index 00000000..90b74cd0 --- /dev/null +++ b/contrib/protocompiler/README.txt @@ -0,0 +1,7 @@ +Field names in proto definitions may collide with default properties for objects in C#. +This causes ProtoBuffer to crash because of ambigious names. + +An example is QuestReward, which has a field 'Item' that collides with the hidden (in c#) property +item for collections that is generated for .net languages that dont support indexers... + +Easiest way to fix it is to just rename these fields. \ No newline at end of file diff --git a/contrib/protocompiler/bin/csharp/.gitignore b/contrib/protocompiler/bin/csharp/.gitignore new file mode 100644 index 00000000..a709314a --- /dev/null +++ b/contrib/protocompiler/bin/csharp/.gitignore @@ -0,0 +1,3 @@ +/*.cs +/bnet/ +/D3/ diff --git a/contrib/protocompiler/bin/csharp/csharp b/contrib/protocompiler/bin/csharp/csharp new file mode 100644 index 00000000..5b6c0696 --- /dev/null +++ b/contrib/protocompiler/bin/csharp/csharp @@ -0,0 +1 @@ +csharp classes will be generated to here. \ No newline at end of file diff --git a/contrib/protocompiler/compilers/Google.ProtocolBuffers.dll b/contrib/protocompiler/compilers/Google.ProtocolBuffers.dll new file mode 100644 index 00000000..bf78aa05 Binary files /dev/null and b/contrib/protocompiler/compilers/Google.ProtocolBuffers.dll differ diff --git a/contrib/protocompiler/compilers/protoc.exe b/contrib/protocompiler/compilers/protoc.exe new file mode 100644 index 00000000..2c2877b9 Binary files /dev/null and b/contrib/protocompiler/compilers/protoc.exe differ diff --git a/contrib/protocompiler/compilers/protogen_csharp.exe b/contrib/protocompiler/compilers/protogen_csharp.exe new file mode 100644 index 00000000..c3fc082c Binary files /dev/null and b/contrib/protocompiler/compilers/protogen_csharp.exe differ diff --git a/contrib/protocompiler/definitions/Account.proto b/contrib/protocompiler/definitions/Account.proto new file mode 100644 index 00000000..e3240aa5 --- /dev/null +++ b/contrib/protocompiler/definitions/Account.proto @@ -0,0 +1,53 @@ +import "AttributeSerializer.proto"; +import "Items.proto"; +import "OnlineService.proto"; +import "ItemCrafting.proto"; + +package D3.Account; + +message BannerConfiguration +{ + required uint32 banner_shape = 1 [default = 0]; + required uint32 sigil_main = 2 [default = 0]; + required uint32 sigil_accent = 3 [default = 0]; + required uint32 pattern_color = 4 [default = 0]; + required uint32 background_color = 5 [default = 0]; + required uint32 sigil_color = 6 [default = 0]; + required uint32 sigil_placement = 7 [default = 0]; + required uint32 pattern = 8 [default = 0]; + required bool use_sigil_variant = 9 [default = false]; + optional uint32 epic_banner = 10 [default = 0]; +} + +message Digest +{ + enum Flags + { + HARDCORE_HERO_UNLOCKED = 1; + } + + required uint32 version = 1; + required .D3.OnlineService.EntityId last_played_hero_id = 2; + required .D3.Account.BannerConfiguration banner_configuration = 3; + required uint32 flags = 4 [default = 0]; +} + +message SavedDefinition +{ + required uint32 version = 1; + optional .D3.Account.Digest digest = 2; + required .D3.AttributeSerializer.SavedAttributes saved_attributes = 3; + optional .D3.AttributeSerializer.SavedAttributes saved_attributes_hardcore = 4; + optional .D3.Items.ItemList normal_shared_saved_items = 5; + optional .D3.Items.ItemList hardcore_shared_saved_items = 6; + optional .D3.ItemCrafting.CrafterSavedData crafter_normal_data = 7; + optional .D3.ItemCrafting.CrafterSavedData crafter_hardcore_data = 8; + optional bytes seen_tutorials = 9; + optional sfixed64 num_vote_kicks_participated_in = 10; + optional sfixed64 num_vote_kicks_initiated = 11; + optional sfixed64 num_public_games_no_kick = 12; + optional sfixed64 times_vote_kicked = 13; + optional .D3.OnlineService.EntityId gold_id_normal = 14; + optional .D3.OnlineService.EntityId gold_id_hardcore = 15; +} + diff --git a/contrib/protocompiler/definitions/AttributeSerializer.proto b/contrib/protocompiler/definitions/AttributeSerializer.proto new file mode 100644 index 00000000..8ad286af --- /dev/null +++ b/contrib/protocompiler/definitions/AttributeSerializer.proto @@ -0,0 +1,16 @@ +import "GBHandle.proto"; + +package D3.AttributeSerializer; + +message SavedAttribute +{ + required sint32 key = 1; + required sint32 value = 2; +} + +message SavedAttributes +{ + required .D3.GameBalance.Handle gb_handle = 1; + repeated .D3.AttributeSerializer.SavedAttribute attributes = 2; +} + diff --git a/contrib/protocompiler/definitions/AuctionHouse.proto b/contrib/protocompiler/definitions/AuctionHouse.proto new file mode 100644 index 00000000..5d901c78 --- /dev/null +++ b/contrib/protocompiler/definitions/AuctionHouse.proto @@ -0,0 +1,65 @@ +import "GBHandle.proto"; +import "OnlineService.proto"; +import "Items.proto"; +import "Hero.proto"; + +package D3.AuctionHouse; + +message InventoryOperation +{ + enum Operation + { + REMOVE = 0; + UPDATE = 1; + } + + required .D3.AuctionHouse.InventoryOperation.Operation operation = 1; + required .D3.OnlineService.EntityId transaction_hero_id = 2; + required .D3.OnlineService.ItemId id = 3; + optional sint32 item_slot = 4; + optional sint32 square_index = 5; + optional .D3.Items.Generator generator = 6; +} + +message InventoryOperations +{ + repeated .D3.AuctionHouse.InventoryOperation operations = 1; +} + +message Item +{ + required .D3.OnlineService.ItemId id = 1; + required .D3.Items.Generator generator = 2; +} + +message Escrow +{ + enum Version + { + CURRENT_VERSION = 1; + } + + required uint32 version = 1; + optional .D3.AuctionHouse.Item auction_item = 2; + optional .D3.Hero.SavedData hero = 3; + repeated .D3.OnlineService.EntityId serviced_tokens = 4; +} + +message AuthorizeInfo +{ + required .D3.OnlineService.EntityId location_id = 1; + required .D3.OnlineService.EntityId transaction_hero_id = 2; + optional .D3.OnlineService.ItemId item_id = 3; +} + +message ClaimInfo +{ + required .D3.OnlineService.EntityId transaction_hero_id = 1; +} + +message AccountInfo +{ + required .D3.OnlineService.EntityId account_id = 1; + required .D3.OnlineService.EntityId escrow_id = 2; +} + diff --git a/contrib/protocompiler/definitions/CS.proto b/contrib/protocompiler/definitions/CS.proto new file mode 100644 index 00000000..3252e2a7 --- /dev/null +++ b/contrib/protocompiler/definitions/CS.proto @@ -0,0 +1,62 @@ +import "AttributeSerializer.proto"; +import "Items.proto"; +import "OnlineService.proto"; +import "ItemCrafting.proto"; +import "Hero.proto"; +import "Account.proto"; +import "Profile.proto"; + +package D3.CS; + +message ToolTip +{ + required .D3.OnlineService.ItemId itemId = 1; + required uint32 ItemQualityLevel = 2; + required string Name = 3; + required string Type = 4; + required int32 SetItem = 5; + required string Flavor = 6; + required string Cost = 7; + required string Durability = 8; + required string ClassReqs = 9; + required string Requirements = 10; + required string Enhancement = 11; + required uint64 StackCount = 12; + required uint32 NumSockets = 13; + required uint32 FilledSockets = 14; + required string DisplayName = 15; +} + +message TooltipList +{ + repeated .D3.CS.ToolTip tooltips = 1; +} + +message FallenHero +{ + required .D3.Profile.HeroProfile profile = 1; + required .D3.Hero.Digest digest = 2; + required string time = 3; +} + +message Snapshot +{ + required uint64 version = 1; + required .D3.Account.SavedDefinition definition = 2; + repeated .D3.Hero.SavedDefinition heros = 3; + required .D3.Profile.AccountProfile account_profile = 4; + required .D3.Profile.HeroProfileList hero_profiles = 5; + repeated .D3.CS.FallenHero fallen_heros = 6; +} + +message SnapshotVersion +{ + required uint64 version = 1; + required .D3.CS.Snapshot snapshot = 2; +} + +message SnapshotVersions +{ + repeated .D3.CS.SnapshotVersion versions = 1; +} + diff --git a/contrib/protocompiler/definitions/GBHandle.proto b/contrib/protocompiler/definitions/GBHandle.proto new file mode 100644 index 00000000..4b40f168 --- /dev/null +++ b/contrib/protocompiler/definitions/GBHandle.proto @@ -0,0 +1,8 @@ +package D3.GameBalance; + +message Handle +{ + required sint32 game_balance_type = 1 [default = -1]; + required sfixed32 gbid = 2 [default = -1]; +} + diff --git a/contrib/protocompiler/definitions/GameMessage.proto b/contrib/protocompiler/definitions/GameMessage.proto new file mode 100644 index 00000000..fe274c52 --- /dev/null +++ b/contrib/protocompiler/definitions/GameMessage.proto @@ -0,0 +1,277 @@ +import "Hero.proto"; +import "OnlineService.proto"; +import "Settings.proto"; +import "Account.proto"; +import "Items.proto"; +import "CS.proto"; + +package D3.GameMessage; + +message HeroDigestList +{ + required .D3.OnlineService.EntityId account_id = 1; + repeated .D3.Hero.Digest digest_list = 2; +} + +message ClientToonSettings +{ + required .D3.OnlineService.EntityId toon_id = 1; + required .D3.Client.ToonSettings client_toon_settings = 2; +} + +message HeroDigestListRequest +{ + required .D3.OnlineService.EntityId account_id = 1; + repeated .D3.OnlineService.EntityId toon_id = 2; +} + +message HeroDigestResponse +{ + required .D3.OnlineService.EntityId toon_id = 1; + required bool success = 2; + optional .D3.Hero.Digest hero_digest = 3; +} + +message HeroDigestListResponse +{ + repeated .D3.GameMessage.HeroDigestResponse digest_list = 1; +} + +message PlayerBanner +{ + required uint32 player_index = 1; + required .D3.Account.BannerConfiguration banner = 2; +} + +message SaveBannerConfiguration +{ + required .D3.Account.BannerConfiguration banner = 1; + optional uint32 slot_index = 2 [default = 0]; + optional bool make_active = 3 [default = true]; +} + +message HeroDigestBanner +{ + required .D3.Hero.Digest hero_digest = 1; + required .D3.Account.BannerConfiguration banner = 2; +} + +message GameCurrentPlayers +{ + repeated .D3.GameMessage.HeroDigestBanner players = 1; +} + +message AccountVersionList +{ + required .D3.OnlineService.EntityId account_id = 1; + optional bool return_snapshots = 2 [default = false]; +} + +message AccountVersionSync +{ + required .D3.OnlineService.EntityId account_id = 1; + required uint64 version = 2; +} + +message TooltipIds +{ + required uint32 locale = 1; + repeated .D3.OnlineService.ItemId ids = 2; +} + +message TooltipGenerators +{ + required uint32 locale = 1; + required .D3.Items.ItemList items = 2; +} + +message TutorialMessage +{ + required uint32 tutorial_sno = 1; + optional string ui_anchor_name = 2; +} + +message TutorialState +{ + required bytes seen_tutorials = 1; +} + +message DeleteHero +{ + required .D3.OnlineService.EntityId hero_id = 1; +} + +message UndeleteHero +{ + required .D3.OnlineService.EntityId undelete_hero_id = 1; + optional .D3.OnlineService.EntityId replace_hero_id = 2; +} + +message GetFallenHeros +{ + required .D3.OnlineService.EntityId account_id = 1; +} + +message ArchiveHardcore +{ + required .D3.OnlineService.EntityId hero_id = 1; + required string epitaph = 2; +} + +message DeleteFallenHero +{ + required .D3.OnlineService.EntityId hero_id = 1; +} + +message ServerDeleteHero +{ + required .D3.OnlineService.EntityId account_id = 1; + required .D3.OnlineService.EntityId hero_id = 2; +} + +message ServerUndeleteHero +{ + required .D3.OnlineService.EntityId account_id = 1; + required .D3.OnlineService.EntityId undelete_hero_id = 2; + optional .D3.OnlineService.EntityId replace_hero_id = 3; +} + +message ServerForceRenameHero +{ + required .D3.OnlineService.EntityId account_id = 1; + required .D3.OnlineService.EntityId hero_id = 2; +} + +message ServerFetchHeros +{ + required .D3.OnlineService.EntityId account_id = 1; +} + +message ServerFetchInventory +{ + required .D3.OnlineService.EntityId account_id = 1; + required .D3.OnlineService.EntityId hero_id = 2; +} + +message ServerSnapshot +{ + required .D3.OnlineService.EntityId account_id = 1; +} + +message ServerSnapshotResponse +{ + required .D3.OnlineService.EntityId account_id = 1; + required uint64 version = 2; +} + +message ServerFetchSnapshot +{ + required .D3.OnlineService.EntityId account_id = 1; + required uint64 version = 2; +} + +message ServerRevokeItem +{ + required .D3.OnlineService.EntityId account_id = 1; + required .D3.OnlineService.EntityId hero_id = 2; + required .D3.OnlineService.ItemId item_id = 3; +} + +message RenameHero +{ + required .D3.OnlineService.EntityId hero_id = 1; + required string new_name = 2; +} + +message GetGameAccountSettings +{ +} + +message SetGameAccountSettings +{ + required .D3.Client.GameAccountSettings settings = 1; +} + +message GetToonSettings +{ + required .D3.OnlineService.EntityId hero_id = 1; +} + +message SetToonSettings +{ + required .D3.OnlineService.EntityId hero_id = 1; + required .D3.Client.ToonSettings settings = 2; +} + +message GetAccountDigest +{ +} + +message GetHeroItems +{ + required .D3.OnlineService.EntityId hero_id = 1; +} + +message GetAccountItems +{ + required bool hardcore = 1; +} + +message GetAccountProfile +{ + required .D3.OnlineService.EntityId account_id = 1; +} + +message GetHeroProfiles +{ + required .D3.OnlineService.EntityId account_id = 1; + repeated .D3.OnlineService.EntityId hero_ids = 2; +} + +message GetAccountPrefs +{ +} + +message SetAccountPrefs +{ + required .D3.Client.Preferences prefs = 1; +} + +message GetHeroDigest +{ + required .D3.OnlineService.EntityId account_id = 1; + required .D3.OnlineService.EntityId hero_id = 2; +} + +message GetHeroIds +{ + required .D3.OnlineService.EntityId account_id = 1; +} + +message GetDeletedHero +{ +} + +message CSGetSnapshots +{ +} + +message CSPullSnapshot +{ + required uint64 version = 1; +} + +message CSPushSnapshot +{ + required .D3.CS.Snapshot data = 1; +} + +message CSRestoreToSnapshot +{ + required uint64 version = 1; +} + +message CSWriteSnapshot +{ +} + diff --git a/contrib/protocompiler/definitions/Hero.proto b/contrib/protocompiler/definitions/Hero.proto new file mode 100644 index 00000000..b75e6185 --- /dev/null +++ b/contrib/protocompiler/definitions/Hero.proto @@ -0,0 +1,165 @@ +import "AttributeSerializer.proto"; +import "Hireling.proto"; +import "Items.proto"; +import "OnlineService.proto"; + +package D3.Hero; + +message VisualItem +{ + optional sfixed32 gbid = 1 [default = -1]; + optional sint32 dye_type = 2 [default = 0]; + optional sint32 item_effect_type = 3 [default = 0]; + optional sint32 effect_level = 4 [default = -1]; +} + +message VisualEquipment +{ + repeated .D3.Hero.VisualItem visual_item = 1; +} + +message QuestHistoryEntry +{ + required sfixed32 sno_quest = 1 [default = -1]; + required sint32 difficulty = 2 [default = 0]; + optional sint32 highest_played_quest_step = 3 [default = -3]; +} + +message QuestRewardHistoryEntry +{ + required sfixed32 sno_quest = 1 [default = -1]; + required sint32 step_uid = 2 [default = -1]; + required sint32 difficulty = 3 [default = 0]; +} + +message Digest +{ + required uint32 version = 1; + required .D3.OnlineService.EntityId hero_id = 2; + optional string hero_name = 3; + required sfixed32 gbid_class = 4; + required sint32 level = 5; + required uint32 player_flags = 6; + required .D3.Hero.VisualEquipment visual_equipment = 7; + repeated .D3.Hero.QuestHistoryEntry quest_history = 8; + required sint32 last_played_act = 9; + required sint32 highest_unlocked_act = 10; + required sint32 last_played_difficulty = 11; + required sint32 highest_unlocked_difficulty = 12; + required sfixed32 last_played_quest = 13; + required sint32 last_played_quest_step = 14; + required uint32 time_played = 15 [default = 0]; + optional sint32 highest_completed_difficulty = 16 [default = -1]; + optional uint32 create_time = 17; + optional uint32 last_played_time = 18; + optional uint32 delete_time = 19; +} + +message DigestUI +{ + required sint32 last_played_act = 1; + required sint32 highest_unlocked_act = 2; + required sint32 last_played_difficulty = 3; + required sint32 highest_unlocked_difficulty = 4; + required sfixed32 last_played_quest = 5; + required sint32 last_played_quest_step = 6; + required uint32 time_played = 7 [default = 0]; + optional sint32 highest_completed_difficulty = 8; +} + +message SavedQuest +{ + required sfixed32 sno_quest = 1 [default = -1]; + required sint32 difficulty = 2 [default = 0]; + required sint32 current_step_uid = 3 [default = -1]; + repeated sint32 objective_state = 4 [packed=true]; + repeated sint32 failure_condition_state = 5 [packed=true]; +} + +message LearnedLore +{ + repeated sfixed32 sno_lore_learned = 1; +} + +message SavedConversations +{ + required bytes played_conversations_bitfield = 1; + repeated sfixed32 sno_saved_conversations = 2; +} + +message SavePointData_Proto +{ + required sfixed32 sno_world = 1 [default = -1]; + required sint32 savepoint_number = 2 [default = -1]; + required uint32 creates_portal = 3 [default = 0]; +} + +message SkillWithRune +{ + required sfixed32 sno_skill = 1 [default = -1]; + optional sint32 rune_type = 2 [default = -1]; +} + +message SavedData +{ + required uint32 time_played = 1 [default = 0]; + required uint32 activated_waypoints = 2 [default = 0]; + required .D3.Hireling.SavedData hireling_saved_data = 3; + required uint32 last_level_time = 4 [default = 0]; + required .D3.Hero.LearnedLore learned_lore = 5; + required .D3.Hero.SavedConversations saved_conversations = 6; + repeated sfixed32 sno_traits = 7; + required .D3.Hero.SavePointData_Proto save_point = 8; + required sfixed32 gbid_potion_button = 9 [default = -1]; + repeated .D3.Hero.SkillWithRune active_skills = 10; + required bytes skill_slot_ever_assigned = 11; + required uint32 skill_version = 12 [default = 0]; +} + +message Timestamps +{ + required sint64 create_time = 1; + optional sint64 delete_time = 2; +} + +message SavedDefinition +{ + required uint32 version = 1; + optional .D3.Hero.Digest digest = 2; + required .D3.AttributeSerializer.SavedAttributes saved_attributes = 3; + optional .D3.Hero.SavedData saved_data = 4; + repeated .D3.Hero.SavedQuest saved_quest = 5; + optional .D3.Items.ItemList items = 6; + repeated .D3.Hero.QuestRewardHistoryEntry quest_reward_history = 7; +} + +message NameText +{ + required string name = 1; +} + +message HeroList +{ + repeated .D3.OnlineService.EntityId hero_ids = 1; +} + +message DigestList +{ + repeated .D3.Hero.Digest digests = 1; +} + +message QuestHistoryList +{ + repeated .D3.Hero.QuestHistoryEntry history = 1; +} + +message SavedQuestList +{ + repeated .D3.Hero.SavedQuest saved_quests = 1; +} + +message QuestRewardHistoryList +{ + repeated .D3.Hero.QuestRewardHistoryEntry reward_history = 1; +} + diff --git a/contrib/protocompiler/definitions/Hireling.proto b/contrib/protocompiler/definitions/Hireling.proto new file mode 100644 index 00000000..d58942bd --- /dev/null +++ b/contrib/protocompiler/definitions/Hireling.proto @@ -0,0 +1,19 @@ +package D3.Hireling; + +message Info +{ + required sint32 hireling_class = 1 [default = 0]; + required sfixed32 gbid_name = 2 [default = -1]; + required sint32 level = 3; + required uint32 attribute_experience_next = 4; + repeated sint32 power_key_params = 5; + required bool dead = 6; +} + +message SavedData +{ + repeated .D3.Hireling.Info hirelings = 1; + required uint32 active_hireling = 2 [default = 0]; + required uint32 available_hirelings_bitfield = 3 [default = 0]; +} + diff --git a/contrib/protocompiler/definitions/ItemCrafting.proto b/contrib/protocompiler/definitions/ItemCrafting.proto new file mode 100644 index 00000000..a6a48a67 --- /dev/null +++ b/contrib/protocompiler/definitions/ItemCrafting.proto @@ -0,0 +1,15 @@ +package D3.ItemCrafting; + +message CrafterData +{ + repeated sfixed32 recipes = 1; + repeated sfixed32 deprecated_available_enchants = 2; + required int32 level = 3; + required sfixed64 cooldown_end = 4; +} + +message CrafterSavedData +{ + repeated .D3.ItemCrafting.CrafterData crafter_data = 1; +} + diff --git a/contrib/protocompiler/definitions/Items.proto b/contrib/protocompiler/definitions/Items.proto new file mode 100644 index 00000000..101651dd --- /dev/null +++ b/contrib/protocompiler/definitions/Items.proto @@ -0,0 +1,55 @@ +import "GBHandle.proto"; +import "OnlineService.proto"; + +package D3.Items; + +message RareItemName +{ + required bool item_name_is_prefix = 1 [default = false]; + required sfixed32 sno_affix_string_list = 2 [default = -1]; + required sint32 affix_string_list_index = 3 [default = -1]; + required sint32 item_string_list_index = 4 [default = -1]; +} + +message Generator +{ + required uint32 seed = 1 [default = 0]; + required .D3.GameBalance.Handle gb_handle = 2; + repeated sfixed32 base_affixes = 3; + optional .D3.Items.RareItemName rare_item_name = 4; + optional sfixed32 enchant_affix = 5 [default = -1]; + required uint32 flags = 6 [default = 0]; + required uint32 durability = 7; + required uint64 stack_size = 8; + optional uint32 dye_type = 9 [default = 0]; + optional sint32 item_quality_level = 10 [default = 1]; + optional sint32 item_binding_level = 11 [default = 0]; + optional uint32 max_durability = 12 [default = 0]; + repeated .D3.Items.EmbeddedGenerator contents = 13; + optional uint64 item_unlock_timestamp = 14 [default = 0]; + optional uint32 enchant_range_val = 15 [default = 0]; +} + +message EmbeddedGenerator +{ + required .D3.OnlineService.ItemId id = 1; + required .D3.Items.Generator generator = 2; +} + +message SavedItem +{ + required .D3.OnlineService.ItemId id = 1; + optional .D3.OnlineService.EntityId owner_entity_id = 2; + optional .D3.OnlineService.ItemId socket_id = 3; + required sint32 hireling_class = 4; + required sint32 item_slot = 5; + required sint32 square_index = 6; + required uint32 used_socket_count = 7 [default = 0]; + optional .D3.Items.Generator generator = 8; +} + +message ItemList +{ + repeated .D3.Items.SavedItem items = 1; +} + diff --git a/contrib/protocompiler/definitions/OnlineService.proto b/contrib/protocompiler/definitions/OnlineService.proto new file mode 100644 index 00000000..9ad230ef --- /dev/null +++ b/contrib/protocompiler/definitions/OnlineService.proto @@ -0,0 +1,54 @@ +package D3.OnlineService; + +message EntityId +{ + required uint64 id_high = 1 [default = 0]; + required uint64 id_low = 2 [default = 0]; +} + +message GameId +{ + required uint64 factory = 1 [default = 0]; + required uint64 id_high = 2 [default = 0]; + required uint64 id_low = 3 [default = 0]; +} + +message ItemId +{ + required uint64 id_high = 1 [default = 0]; + required uint64 id_low = 2 [default = 0]; +} + +message CoopCreateParams +{ + required int32 difficulty_level = 1 [default = -1]; + required sint32 act = 2 [default = 0]; + required sfixed32 sno_quest = 3 [default = -1]; + required int32 quest_step_id = 4 [default = -1]; + optional .D3.OnlineService.EntityId resume_from_save_hero_id = 5; + required bool open_to_friends = 6 [default = false]; + optional string open_to_friends_message = 7; +} + +message PvPCreateParams +{ + required sfixed32 sno_world = 1 [default = -1]; +} + +message GameCreateParams +{ + required sint32 game_type = 1; + required uint32 creation_flags = 2 [default = 0]; + optional .D3.OnlineService.CoopCreateParams coop = 3; + optional .D3.OnlineService.PvPCreateParams pvp = 4; + optional string name = 5; +} + +message HeroCreateParams +{ + required string name = 1; + required sfixed32 gbid_class = 2 [default = -1]; + required bool is_hardcore = 3 [default = false]; + required bool is_female = 4 [default = false]; +} + diff --git a/contrib/protocompiler/definitions/PartyMessage.proto b/contrib/protocompiler/definitions/PartyMessage.proto new file mode 100644 index 00000000..17e1ec9a --- /dev/null +++ b/contrib/protocompiler/definitions/PartyMessage.proto @@ -0,0 +1,30 @@ +import "OnlineService.proto"; + +package D3.PartyMessage; + +message ScreenStatus +{ + required int32 screen = 1; + required int32 status = 2; +} + +message SearchForPublicGameParams +{ + optional sint64 start_time = 1; + optional uint32 seconds_to_search = 2; + optional .D3.OnlineService.GameCreateParams game_params = 3; + optional int32 remove_reason = 4; +} + +message EnterGamePartyMember +{ + required .D3.OnlineService.EntityId account_id = 1; + required .D3.OnlineService.EntityId hero_id = 2; +} + +message EnterGamePartyMemberList +{ + repeated .D3.PartyMessage.EnterGamePartyMember member = 1; + optional int32 requester_index = 2; +} + diff --git a/contrib/protocompiler/definitions/Profile.proto b/contrib/protocompiler/definitions/Profile.proto new file mode 100644 index 00000000..51db08af --- /dev/null +++ b/contrib/protocompiler/definitions/Profile.proto @@ -0,0 +1,94 @@ +import "AttributeSerializer.proto"; +import "Items.proto"; +import "OnlineService.proto"; +import "GBHandle.proto"; + +package D3.Profile; + +message ClassInfo +{ + optional uint64 playtime = 1 [default = 0]; + optional uint32 highest_level = 2 [default = 0]; + optional uint32 highest_difficulty = 3 [default = 0]; +} + +message SkillWithRune +{ + required sfixed32 skill = 1 [default = -1]; + optional sint32 rune_type = 2 [default = -1]; +} + +message SkillsWithRunes +{ + repeated .D3.Profile.SkillWithRune runes = 1; +} + +message PassiveSkills +{ + repeated sfixed32 sno_traits = 1; +} + +message KillerInfo +{ + optional int32 sno_killer = 1 [default = -1]; + optional uint32 rarity = 2; + repeated int32 rare_name_gbids = 3; +} + +message HeroProfile +{ + optional uint64 monsters_killed = 1; + optional uint64 elites_killed = 2; + optional uint64 gold_collected = 3; + optional uint32 highest_level = 4; + optional uint32 highest_difficulty = 5; + optional uint32 create_time = 6; + optional bool hardcore = 7 [default = false]; + optional uint32 strength = 8; + optional uint32 dexterity = 9; + optional uint32 intelligence = 10; + optional uint32 vitality = 11; + optional uint32 armor = 12; + optional float dps = 13; + optional uint32 resist_arcane = 14; + optional uint32 resist_fire = 15; + optional uint32 resist_lightning = 16; + optional uint32 resist_poison = 17; + optional uint32 resist_cold = 18; + optional .D3.Items.ItemList equipment = 19; + optional .D3.Profile.SkillsWithRunes sno_active_skills = 20; + optional .D3.Profile.PassiveSkills sno_traits = 21; + optional uint32 death_time = 22; + optional .D3.Profile.KillerInfo killer_info = 23; + optional uint32 sno_kill_location = 24; + optional .D3.OnlineService.EntityId hero_id = 27; + optional float damage_increase = 28; + optional float crit_chance = 29; + optional float damage_reduction = 30; + optional uint32 life = 31; +} + +message HeroProfileList +{ + repeated .D3.Profile.HeroProfile heros = 1; +} + +message AccountProfile +{ + optional uint32 highest_difficulty = 1; + optional uint32 highest_boss_difficulty_1 = 2; + optional uint32 highest_boss_difficulty_2 = 3; + optional uint32 highest_boss_difficulty_3 = 4; + optional uint32 highest_boss_difficulty_4 = 5; + optional uint64 monsters_killed = 6 [default = 0]; + optional uint64 elites_killed = 7 [default = 0]; + optional uint64 gold_collected = 8 [default = 0]; + optional uint64 highest_hardcore_level = 9; + optional uint64 hardcore_monsters_killed = 10; + optional .D3.Profile.ClassInfo class_barbarian = 11; + optional .D3.Profile.ClassInfo class_demonhunter = 12; + optional .D3.Profile.ClassInfo class_monk = 13; + optional .D3.Profile.ClassInfo class_witchdoctor = 14; + optional .D3.Profile.ClassInfo class_wizard = 15; +} + diff --git a/contrib/protocompiler/definitions/Quest.proto b/contrib/protocompiler/definitions/Quest.proto new file mode 100644 index 00000000..f875a73d --- /dev/null +++ b/contrib/protocompiler/definitions/Quest.proto @@ -0,0 +1,18 @@ +import "Items.proto"; + +package D3.Quests; + +message QuestReward +{ + optional int32 xp_granted = 1 [default = 0]; + optional int32 gold_granted = 2 [default = 0]; + optional .D3.Items.Generator item_granted = 3; + optional sfixed32 sno_quest = 4 [default = -1]; +} + +message QuestStepComplete +{ + required bool is_quest_complete = 1; + optional .D3.Quests.QuestReward reward = 2; +} + diff --git a/contrib/protocompiler/definitions/Settings.proto b/contrib/protocompiler/definitions/Settings.proto new file mode 100644 index 00000000..f7ed19a3 --- /dev/null +++ b/contrib/protocompiler/definitions/Settings.proto @@ -0,0 +1,132 @@ +package D3.Client; + +message ToonSettings +{ + optional uint32 ui_flags = 1 [default = 0]; +} + +message ActionBinding +{ + required int32 key_1 = 1 [default = -1]; + required uint32 key_modifier_flags_1 = 2 [default = 0]; + required int32 key_2 = 3 [default = -1]; + required uint32 key_modifier_flags_2 = 4 [default = 0]; +} + +message GameAccountSettings +{ + optional int32 use_last_hero = 1 [default = 0]; + optional int32 show_offline_toast = 2 [default = 0]; + optional string rmt_last_used_currency = 3; + optional int32 coop_last_create_game_privacy = 4 [default = 1]; + optional string rmt_preferred_currency = 5; + repeated string auto_join_channels = 6; +} + +message Preferences +{ + enum Flags + { + SHOW_ITEM_TOOLTIP_ON_DROP = 1; + SHOW_MONSTER_HP_BARS = 2; + SHOW_PLAYER_HP_BARS = 3; + SHOW_ITEMS_ON_GROUND = 6; + SHOW_DAMAGE_NUMBERS = 8; + SHOW_CRITICALS = 9; + SHOW_DEFENSIVE_MESSAGES = 10; + INVENTORY_ZOOM = 11; + AUTO_EQUIP_ITEMS = 12; + SHOW_TUTORIALS = 13; + SHOW_BREAD_CRUMB = 14; + DISABLE_OS_SHORTCUTS = 17; + SHOW_HEAL_NUMBERS = 18; + SHOW_PLAYER_NAMES = 19; + SHOW_HP_BAR_NUMBERS = 20; + SHOW_CLOCK = 21; + SHOW_ADVANCED_TOOLTIPS = 22; + ELECTIVE_MODE = 23; + NOTIFY_FRIEND_ONLINE = 24; + NOTIFY_FRIEND_OFFLINE = 25; + NOTIFY_FRIEND_REQUEST = 26; + NOTIFY_FRIEND_ACHIEVEMENT = 27; + NOTIFY_DISPLAY_WINDOW = 28; + MATURE_LANGUAGE_FILTER = 29; + ALLOW_QUICK_JOIN = 30; + } + + enum Flags2 + { + USE_COMMAND_AS_CONTROL = 1; + USE_COMMAND_CLICK_AS_RIGHT_CLICK = 2; + } + + required int32 version = 1; + optional uint32 flags = 2 [default = 0]; + optional uint32 items_on_ground_setting = 3 [default = 0]; + optional .D3.Client.ActionBinding action_binding_inventory = 4; + optional .D3.Client.ActionBinding action_binding_hireling = 5; + optional .D3.Client.ActionBinding action_binding_skills = 6; + optional .D3.Client.ActionBinding action_binding_quests = 74; + optional .D3.Client.ActionBinding action_binding_lore = 8; + optional .D3.Client.ActionBinding action_binding_social = 9; + optional .D3.Client.ActionBinding action_binding_worldmap = 10; + optional .D3.Client.ActionBinding action_binding_help = 11; + optional .D3.Client.ActionBinding action_binding_recentplayers = 12; + optional .D3.Client.ActionBinding action_binding_chatlobby = 13; + optional .D3.Client.ActionBinding action_binding_achievements = 14; + optional .D3.Client.ActionBinding action_binding_profile = 15; + optional .D3.Client.ActionBinding action_binding_auctionhouse = 16; + optional .D3.Client.ActionBinding action_binding_clear = 17; + optional .D3.Client.ActionBinding action_binding_console = 18; + optional .D3.Client.ActionBinding action_binding_map = 19; + optional .D3.Client.ActionBinding action_binding_skillcycle = 20; + optional .D3.Client.ActionBinding action_binding_togglemonsterhpbars = 21; + optional .D3.Client.ActionBinding action_binding_toggleplayerhpbars = 22; + optional .D3.Client.ActionBinding action_binding_toggledamagenumbers = 23; + optional .D3.Client.ActionBinding action_binding_toggleitemsonground = 24; + optional .D3.Client.ActionBinding action_binding_rewhisper = 25; + optional .D3.Client.ActionBinding action_binding_whisperreply = 26; + optional .D3.Client.ActionBinding action_binding_voiceptt = 27; + optional .D3.Client.ActionBinding action_binding_skill1 = 28; + optional .D3.Client.ActionBinding action_binding_skill2 = 29; + optional .D3.Client.ActionBinding action_binding_skill3 = 30; + optional .D3.Client.ActionBinding action_binding_skill4 = 31; + optional .D3.Client.ActionBinding action_binding_potion = 32; + optional .D3.Client.ActionBinding action_binding_bannerdrop = 33; + optional .D3.Client.ActionBinding action_binding_zoom = 34; + optional .D3.Client.ActionBinding action_binding_emotefollow = 35; + optional .D3.Client.ActionBinding action_binding_emotegive = 36; + optional .D3.Client.ActionBinding action_binding_emotethanks = 37; + optional .D3.Client.ActionBinding action_binding_emotesorry = 38; + optional .D3.Client.ActionBinding action_binding_emotebye = 39; + optional .D3.Client.ActionBinding action_binding_emotedie = 40; + optional .D3.Client.ActionBinding action_binding_emoterun = 41; + optional .D3.Client.ActionBinding action_binding_emotewait = 42; + optional .D3.Client.ActionBinding action_binding_emotego = 43; + optional .D3.Client.ActionBinding action_binding_emotehelp = 44; + optional .D3.Client.ActionBinding action_binding_emoteyes = 45; + optional .D3.Client.ActionBinding action_binding_emoteno = 46; + optional .D3.Client.ActionBinding action_binding_emotestay = 47; + optional .D3.Client.ActionBinding action_binding_emoteattack = 48; + optional .D3.Client.ActionBinding action_binding_emoteretreat = 49; + optional .D3.Client.ActionBinding action_binding_emotehold = 50; + optional .D3.Client.ActionBinding action_binding_emotetakeobjective = 51; + optional .D3.Client.ActionBinding action_binding_emotelaugh = 52; + optional .D3.Client.ActionBinding action_binding_holdposition = 53; + optional .D3.Client.ActionBinding action_binding_systemmastervolumeup = 54; + optional .D3.Client.ActionBinding action_binding_systemmastervolumedown = 55; + optional .D3.Client.ActionBinding action_binding_systemtogglemusic = 56; + optional .D3.Client.ActionBinding action_binding_systemtogglesound = 57; + optional .D3.Client.ActionBinding action_binding_systemscreenshot = 58; + optional .D3.Client.ActionBinding action_binding_stoneofrecall = 59; + optional .D3.Client.ActionBinding action_binding_bannerscreen = 60; + optional .D3.Client.ActionBinding action_binding_lmb = 61; + optional .D3.Client.ActionBinding action_binding_rmb = 62; + optional .D3.Client.ActionBinding action_binding_walk = 63; + optional .D3.Client.ActionBinding action_binding_systemtogglefps = 64; + optional .D3.Client.ActionBinding action_binding_chatpageup = 65; + optional .D3.Client.ActionBinding action_binding_chatpagedown = 66; + optional uint32 notify_duration = 100 [default = 0]; + optional uint32 flags2 = 200 [default = 0]; +} + diff --git a/contrib/protocompiler/definitions/bnet/account_types.proto b/contrib/protocompiler/definitions/bnet/account_types.proto new file mode 100644 index 00000000..015a1eca --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/account_types.proto @@ -0,0 +1,116 @@ +package bnet.protocol.account; + +message AccountId +{ + required fixed32 id = 1; +} + +message AccountLicense +{ + required uint32 id = 1; + optional uint64 expires = 2; +} + +message AccountCredential +{ + required uint32 id = 1; + optional bytes data = 2; +} + +message AccountBlob +{ + required fixed32 id = 2; + required uint32 region = 3; + repeated string email = 4; + required uint64 flags = 5; + optional uint64 secure_release = 6; + optional uint64 whitelist_start = 7; + optional uint64 whitelist_end = 8; + required string full_name = 10; + repeated .bnet.protocol.account.AccountLicense licenses = 20; + repeated .bnet.protocol.account.AccountCredential credentials = 21; + repeated .bnet.protocol.account.GameAccountLink account_links = 22; + optional string battle_tag = 23; + optional fixed32 default_currency = 25; + optional uint32 legal_region = 26; + optional fixed32 legal_locale = 27; + required uint64 cache_expiration = 30; +} + +message AccountBlobList +{ + repeated .bnet.protocol.account.AccountBlob blob = 1; +} + +message GameAccountHandle +{ + required fixed32 id = 1; + required fixed32 program = 2; + required uint32 region = 3; +} + +message GameAccountLink +{ + required .bnet.protocol.account.GameAccountHandle game_account = 1; + required string name = 2; +} + +message GameAccountBlob +{ + required .bnet.protocol.account.GameAccountHandle game_account = 1; + optional string name = 2 [default = ""]; + optional uint32 realm_permissions = 3 [default = 0]; + required uint32 status = 4; + optional uint64 flags = 5 [default = 0]; + optional uint32 billing_flags = 6 [default = 0]; + required uint64 cache_expiration = 7; + optional uint64 subscription_expiration = 10; + optional uint32 units_remaining = 11; + repeated .bnet.protocol.account.AccountLicense licenses = 20; +} + +message GameAccountBlobList +{ + repeated .bnet.protocol.account.GameAccountBlob blob = 1; +} + +message AccountReference +{ + optional fixed32 id = 1; + optional string email = 2; + optional .bnet.protocol.account.GameAccountHandle handle = 3; + optional string battle_tag = 4; + optional uint32 region = 10 [default = 0]; +} + +message Wallet +{ + required uint32 region = 1; + required uint64 wallet_id = 2; + required uint32 wallet_type = 3; + optional string description = 4; + required uint32 country_id = 5; + optional string state = 6; + optional string city = 7; + optional string postal_code = 8; + optional bytes payment_info = 9; + optional string bin = 10; + optional string locale_id = 11; + optional string street = 12; + optional string first_name = 13; + optional string last_name = 14; + optional uint64 birth_date = 15; +} + +message Wallets +{ + repeated .bnet.protocol.account.Wallet wallets = 1; +} + +message CurrencyRestriction +{ + required string currency = 1; + required string authenticator_cap = 2; + required string soft_cap = 3; +} + diff --git a/contrib/protocompiler/definitions/bnet/achievements_service.proto b/contrib/protocompiler/definitions/bnet/achievements_service.proto new file mode 100644 index 00000000..e5264061 --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/achievements_service.proto @@ -0,0 +1,247 @@ +import "bnet/rpc.proto"; +import "bnet/entity.proto"; +import "bnet/content_handle.proto"; + +package bnet.protocol.achievements; + +option cc_generic_services = false; + +message AchievementUpdateRecord +{ + required uint64 achievement_id = 1; + required int32 completion = 2; +} + +message CriteriaUpdateRecord +{ + required uint32 criteria_Id_32_and_flags_8 = 1; + optional uint32 start_time_32 = 2 [default = 0]; + optional uint32 quantity_32 = 3 [default = 0]; +} + +message PostUpdateRecord +{ + required .bnet.protocol.EntityId target_id = 1; + repeated .bnet.protocol.achievements.CriteriaUpdateRecord criteria = 2; +} + +message PostUpdateRequest +{ + repeated .bnet.protocol.achievements.PostUpdateRecord post_update_record = 1; + optional fixed32 program_id = 2 [default = 0]; + optional uint32 ati_id = 3 [default = 0]; +} + +message PostUpdateResponse +{ + repeated uint32 error_code = 1; +} + +message RegisterWithServiceRequest +{ + required .bnet.protocol.EntityId target_id = 1; + required uint64 object_id = 2; + optional uint32 registration_flags = 3; + optional fixed32 program_id = 4 [default = 0]; + optional uint32 ati_id = 5 [default = 0]; +} + +message RegisterWithServiceResponse +{ + optional .bnet.protocol.achievements.Snapshot snapshot = 1; + optional uint32 registration_flags = 2; +} + +message UnregisterFromServiceRequest +{ + required .bnet.protocol.EntityId target_id = 1; + required uint64 object_id = 2; + optional uint32 ati_id = 3 [default = 0]; +} + +message Snapshot +{ + repeated .bnet.protocol.achievements.AchievementUpdateRecord achievement_snapshot = 1; + repeated .bnet.protocol.achievements.CriteriaUpdateRecord criteria_snapshot = 2; + optional uint64 header = 3 [default = 0]; +} + +message RequestSnapshotRequest +{ + required .bnet.protocol.EntityId entity_id = 1; + required uint32 filter = 2; + optional fixed32 program_id = 3 [default = 0]; +} + +message RequestSnapshotResponse +{ + optional .bnet.protocol.achievements.Snapshot snapshot = 1; +} + +message InitializeRequest +{ + optional fixed32 program_id = 1 [default = 0]; + required uint64 object_id = 2; +} + +message InitializeResponse +{ + required .bnet.protocol.ContentHandle content_handle = 1; + optional uint32 max_records_per_update = 2 [default = 0]; + optional uint32 max_criteria_per_record = 3 [default = 0]; + optional uint32 max_achievements_per_record = 4 [default = 0]; + optional uint32 max_registrations = 5 [default = 0]; + optional uint64 flush_frequency = 6 [default = 0]; +} + +message StaticDataHash +{ + required fixed32 program_id = 1; + required string hash = 2; +} + +message ValidateStaticDataRequest +{ + repeated .bnet.protocol.achievements.StaticDataHash static_data_hash = 1; +} + +message SnapshotUpdateNotification +{ + required .bnet.protocol.EntityId target_id = 1; + required .bnet.protocol.achievements.Snapshot snapshot = 2; +} + +message FlushFrequencyUpdateNotification +{ + required uint64 flush_frequency = 1; +} + +message AchievementStats +{ + required uint64 id = 1; + required uint64 count = 2; +} + +message GetAchievementStatsRequest +{ + required fixed32 program_id = 1; +} + +message GetAchievementStatsResponse +{ + repeated .bnet.protocol.achievements.AchievementStats stats = 1; +} + +message GetCriteriaStatsRequest +{ + required fixed32 program_id = 1; +} + +message GetCriteriaStatsResponse +{ + repeated .bnet.protocol.achievements.AchievementStats stats = 1; +} + +message RevokeAchievementRequest +{ + required .bnet.protocol.EntityId entity_id = 1; + required uint64 id = 2; +} + +message RevokeAchievementResponse +{ + optional uint32 revoked_count = 1 [default = 0]; +} + +message UpdateCriteriaRequest +{ + required .bnet.protocol.EntityId entity_id = 1; + required uint64 id = 2; + required uint64 quantity = 3; + optional uint32 flags = 4 [default = 0]; +} + +message GrantAchievementRequest +{ + required .bnet.protocol.EntityId entity_id = 1; + required uint64 id = 2; +} + +message GrantAchievementResponse +{ + optional uint32 granted_count = 1 [default = 0]; +} + +message CacheKillRequest +{ + optional .bnet.protocol.EntityId entity_id = 1; +} + +service AchievementsService +{ + rpc PostUpdate(.bnet.protocol.achievements.PostUpdateRequest) returns(.bnet.protocol.achievements.PostUpdateResponse) + { + option (method_id) = 1; + } + rpc RegisterWithService(.bnet.protocol.achievements.RegisterWithServiceRequest) returns(.bnet.protocol.achievements.RegisterWithServiceResponse) + { + option (method_id) = 2; + } + rpc RequestSnapshot(.bnet.protocol.achievements.RequestSnapshotRequest) returns(.bnet.protocol.achievements.RequestSnapshotResponse) + { + option (method_id) = 3; + } + rpc UnregisterFromService(.bnet.protocol.achievements.UnregisterFromServiceRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 4; + } + rpc Initialize(.bnet.protocol.achievements.InitializeRequest) returns(.bnet.protocol.achievements.InitializeResponse) + { + option (method_id) = 5; + } + rpc ValidateStaticData(.bnet.protocol.achievements.ValidateStaticDataRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 6; + } +} + +service AchievementsNotify +{ + rpc NotifySnapshotUpdate(.bnet.protocol.achievements.SnapshotUpdateNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 1; + } + rpc NotifyFlushFrequencyUpdate(.bnet.protocol.achievements.FlushFrequencyUpdateNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 2; + } +} + +service AchievementsUtils +{ + rpc GetAchievementStats(.bnet.protocol.achievements.GetAchievementStatsRequest) returns(.bnet.protocol.achievements.GetAchievementStatsResponse) + { + option (method_id) = 1; + } + rpc GetCriteriaStats(.bnet.protocol.achievements.GetCriteriaStatsRequest) returns(.bnet.protocol.achievements.GetCriteriaStatsResponse) + { + option (method_id) = 2; + } + rpc RevokeAchievement(.bnet.protocol.achievements.RevokeAchievementRequest) returns(.bnet.protocol.achievements.RevokeAchievementResponse) + { + option (method_id) = 3; + } + rpc UpdateCriteria(.bnet.protocol.achievements.UpdateCriteriaRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 4; + } + rpc GrantAchievement(.bnet.protocol.achievements.GrantAchievementRequest) returns(.bnet.protocol.achievements.GrantAchievementResponse) + { + option (method_id) = 5; + } + rpc CacheKill(.bnet.protocol.achievements.CacheKillRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 6; + } +} + diff --git a/contrib/protocompiler/definitions/bnet/achievements_static_data.proto b/contrib/protocompiler/definitions/bnet/achievements_static_data.proto new file mode 100644 index 00000000..b60d123c --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/achievements_static_data.proto @@ -0,0 +1,74 @@ +package bnet.protocol.achievements; + +message Attribute +{ + required string key = 1; + required string value = 2; +} + +message CriteriaModifier +{ + required uint64 necessary_condition = 1; + required fixed32 target = 2; + required uint32 operand = 3; + required uint64 comparand = 4; +} + +message CriteriaEvent +{ + required uint64 id = 1; + optional uint64 comparand = 2 [default = 0]; + repeated .bnet.protocol.achievements.CriteriaModifier modifier = 3; + optional uint32 timer_duration = 4; +} + +message StaticCategoryDefinition +{ + required uint32 id = 1; + optional uint64 parent_id = 2; + optional uint64 OBSOLETE_featured_achievement_id = 3; + required uint32 order_hint = 4; + repeated .bnet.protocol.achievements.Attribute attributes = 5; +} + +message StaticAchievementDefinition +{ + required uint64 id = 1; + optional uint64 superseding_achievement_id = 2; + required uint32 category_id = 3; + optional uint32 minimum_criteria = 4; + required uint32 points_value = 5; + required uint32 flags = 6; + required uint32 order_hint = 7; + optional uint64 criteria_shared_with_achievement_id = 8; + repeated .bnet.protocol.achievements.Attribute attributes = 9; +} + +message StaticCriteriaDefinition +{ + required uint64 criteria_id = 1; + required uint64 parent_achievement_id = 2; + optional .bnet.protocol.achievements.CriteriaEvent start_event = 3; + optional .bnet.protocol.achievements.CriteriaEvent advance_event = 4; + optional .bnet.protocol.achievements.CriteriaEvent fail_event = 5; + required uint64 necessary_quantity = 6; + optional uint32 order_hint = 7; + required fixed32 evalutation_class = 8; + required uint32 flags = 9; + repeated .bnet.protocol.achievements.Attribute attributes = 10; +} + +message AchievementFile +{ + repeated .bnet.protocol.achievements.StaticCategoryDefinition category = 1; + repeated .bnet.protocol.achievements.StaticAchievementDefinition achievement = 2; + repeated .bnet.protocol.achievements.StaticCriteriaDefinition criteria = 3; + repeated .bnet.protocol.achievements.Attribute attributes = 4; +} + +enum ModiferTargetType +{ + SUBJECT = 1400201834; + OBJECT = 5202538; +} + diff --git a/contrib/protocompiler/definitions/bnet/attribute.proto b/contrib/protocompiler/definitions/bnet/attribute.proto new file mode 100644 index 00000000..a4ee297a --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/attribute.proto @@ -0,0 +1,37 @@ +import "bnet/entity.proto"; + +package bnet.protocol.attribute; + +message Variant +{ + optional bool bool_value = 2; + optional int64 int_value = 3; + optional double float_value = 4; + optional string string_value = 5; + optional bytes blob_value = 6; + optional bytes message_value = 7; + optional string fourcc_value = 8; + optional uint64 uint_value = 9; + optional .bnet.protocol.EntityId entityid_value = 10; +} + +message Attribute +{ + required string name = 1; + required .bnet.protocol.attribute.Variant value = 2; +} + +message AttributeFilter +{ + enum Operation + { + MATCH_NONE = 0; + MATCH_ANY = 1; + MATCH_ALL = 2; + MATCH_ALL_MOST_SPECIFIC = 3; + } + + required .bnet.protocol.attribute.AttributeFilter.Operation op = 1; + repeated .bnet.protocol.attribute.Attribute attribute = 2; +} + diff --git a/contrib/protocompiler/definitions/bnet/authentication_service.proto b/contrib/protocompiler/definitions/bnet/authentication_service.proto new file mode 100644 index 00000000..fbb8288c --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/authentication_service.proto @@ -0,0 +1,129 @@ +import "bnet/account_types.proto"; +import "bnet/rpc.proto"; +import "bnet/content_handle.proto"; +import "bnet/entity.proto"; + +package bnet.protocol.authentication; + +option cc_generic_services = false; + +message ModuleLoadRequest +{ + required .bnet.protocol.ContentHandle module_handle = 1; + optional bytes message = 2; +} + +message ModuleNotification +{ + optional int32 module_id = 2; + optional uint32 result = 3; +} + +message ModuleMessageRequest +{ + required int32 module_id = 1; + optional bytes message = 2; +} + +message LogonRequest +{ + optional string program = 1; + optional string platform = 2; + optional string locale = 3; + optional string email = 4; + optional string version = 5; + optional int32 application_version = 6; + optional bool cookie_only = 7; +} + +message LogonResult +{ + required uint32 error_code = 1; + optional .bnet.protocol.EntityId account = 2; + repeated .bnet.protocol.EntityId game_account = 3; +} + +message LogonUpdateRequest +{ + required uint32 error_code = 1; +} + +message AccountSettingsNotification +{ + repeated .bnet.protocol.account.AccountLicense licenses = 1; + optional bool is_using_rid = 2; + optional bool is_playing_from_igr = 3; + optional bool can_receive_voice = 4; + optional bool can_send_voice = 5; +} + +message ServerStateChangeRequest +{ + required uint32 state = 1; + required uint64 event_time = 2; +} + +message MemModuleLoadRequest +{ + required .bnet.protocol.ContentHandle handle = 1; + required bytes key = 2; + required bytes input = 3; +} + +message MemModuleLoadResponse +{ + required bytes data = 1; +} + +service AuthenticationClient +{ + rpc ModuleLoad(.bnet.protocol.authentication.ModuleLoadRequest) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 1; + } + rpc ModuleMessage(.bnet.protocol.authentication.ModuleMessageRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 2; + } + rpc AccountSettings(.bnet.protocol.authentication.AccountSettingsNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 3; + } + rpc ServerStateChange(.bnet.protocol.authentication.ServerStateChangeRequest) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 4; + } + rpc LogonComplete(.bnet.protocol.authentication.LogonResult) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 5; + } + rpc MemModuleLoad(.bnet.protocol.authentication.MemModuleLoadRequest) returns(.bnet.protocol.authentication.MemModuleLoadResponse) + { + option (method_id) = 6; + } + rpc LogonUpdate(.bnet.protocol.authentication.LogonUpdateRequest) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 10; + } +} + +service AuthenticationServer +{ + rpc Logon(.bnet.protocol.authentication.LogonRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 1; + } + rpc ModuleNotify(.bnet.protocol.authentication.ModuleNotification) returns(.bnet.protocol.NoData) + { + option (method_id) = 2; + } + rpc ModuleMessage(.bnet.protocol.authentication.ModuleMessageRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 3; + } + rpc SelectGameAccount(.bnet.protocol.EntityId) returns(.bnet.protocol.NoData) + { + option (method_id) = 4; + } +} + diff --git a/contrib/protocompiler/definitions/bnet/challenge_service.proto b/contrib/protocompiler/definitions/bnet/challenge_service.proto new file mode 100644 index 00000000..7e942c01 --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/challenge_service.proto @@ -0,0 +1,74 @@ +import "bnet/attribute.proto"; +import "bnet/entity.proto"; +import "bnet/rpc.proto"; +import "bnet/field_options.proto"; + +package bnet.protocol.challenge; + +option cc_generic_services = false; + +message Challenge +{ + required fixed32 type = 1; + optional string info = 2; + optional string answer = 3; + optional uint32 retries = 4; +} + +message ChallengePickedRequest +{ + required fixed32 challenge = 1; +} + +message ChallengeAnsweredRequest +{ + required string answer = 1; +} + +message SendChallengeToUserRequest +{ + optional .bnet.protocol.ProcessId peer_id = 1; + optional .bnet.protocol.EntityId game_account_id = 2; + repeated .bnet.protocol.challenge.Challenge challenges = 3; + required fixed32 context = 4; +} + +message SendChallengeToUserResponse +{ + required .bnet.protocol.challenge.Challenge challenge = 1; +} + +message ChallengeUserRequest +{ + repeated .bnet.protocol.challenge.Challenge challenges = 1; + required fixed32 context = 2; +} + +service ChallengeService +{ + rpc ChallengePicked(.bnet.protocol.challenge.ChallengePickedRequest) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 1; + } + rpc ChallengeAnswered(.bnet.protocol.challenge.ChallengeAnsweredRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 2; + } + rpc ChallengeCancelled(.bnet.protocol.NoData) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 3; + } + rpc SendChallengeToUser(.bnet.protocol.challenge.SendChallengeToUserRequest) returns(.bnet.protocol.challenge.SendChallengeToUserResponse) + { + option (method_id) = 4; + } +} + +service ChallengeNotify +{ + rpc ChallengeUser(.bnet.protocol.challenge.ChallengeUserRequest) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 1; + } +} + diff --git a/contrib/protocompiler/definitions/bnet/channel_invitation.proto b/contrib/protocompiler/definitions/bnet/channel_invitation.proto new file mode 100644 index 00000000..1f4897c9 --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/channel_invitation.proto @@ -0,0 +1,134 @@ +import "google/protobuf/csharp_options.proto"; +import "bnet/entity.proto"; +import "bnet/invitation_types.proto"; +import "bnet/rpc.proto"; +import "bnet/channel_service.proto"; +import "bnet/channel_invitation_types.proto"; +import "bnet/channel_types.proto"; + +package bnet.protocol.channel_invitation; + +option cc_generic_services = false; +option (google.protobuf.csharp_file_options).umbrella_classname = "ChannelInvitationService"; + +message AcceptInvitationRequest +{ + optional .bnet.protocol.EntityId agent_id = 1; + optional .bnet.protocol.channel.MemberState member_state = 2; + required fixed64 invitation_id = 3; + required uint64 object_id = 4; +} + +message AcceptInvitationResponse +{ + required uint64 object_id = 1; +} + +message SubscribeRequest +{ + optional .bnet.protocol.EntityId agent_id = 1; + required uint64 object_id = 2; +} + +message SubscribeResponse +{ + repeated .bnet.protocol.channel_invitation.InvitationCollection collection = 1; + repeated .bnet.protocol.invitation.Invitation received_invitation = 2; +} + +message UnsubscribeRequest +{ + optional .bnet.protocol.EntityId agent_id = 1; +} + +message SuggestInvitationRequest +{ + optional .bnet.protocol.EntityId agent_id = 1; + required .bnet.protocol.EntityId channel_id = 2; + required .bnet.protocol.EntityId target_id = 3; + optional .bnet.protocol.EntityId approval_id = 4; + optional .bnet.protocol.Identity agent_identity = 5; + optional .bnet.protocol.AccountInfo agent_info = 6; +} + +message RevokeInvitationRequest +{ + optional .bnet.protocol.EntityId agent_id = 1; + optional .bnet.protocol.EntityId target_id = 2; + required fixed64 invitation_id = 3; + required .bnet.protocol.EntityId channel_id = 4; +} + +message HasRoomForInvitationRequest +{ + required uint32 service_type = 1; +} + +message InvitationAddedNotification +{ + required .bnet.protocol.invitation.Invitation invitation = 1; +} + +message InvitationRemovedNotification +{ + required .bnet.protocol.invitation.Invitation invitation = 1; + optional uint32 reason = 2; +} + +message SuggestionAddedNotification +{ + required .bnet.protocol.invitation.Suggestion suggestion = 1; +} + +service ChannelInvitationService +{ + rpc Subscribe(.bnet.protocol.channel_invitation.SubscribeRequest) returns(.bnet.protocol.channel_invitation.SubscribeResponse) + { + option (method_id) = 1; + } + rpc Unsubscribe(.bnet.protocol.channel_invitation.UnsubscribeRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 2; + } + rpc SendInvitation(.bnet.protocol.invitation.SendInvitationRequest) returns(.bnet.protocol.invitation.SendInvitationResponse) + { + option (method_id) = 3; + } + rpc AcceptInvitation(.bnet.protocol.channel_invitation.AcceptInvitationRequest) returns(.bnet.protocol.channel_invitation.AcceptInvitationResponse) + { + option (method_id) = 4; + } + rpc DeclineInvitation(.bnet.protocol.invitation.GenericRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 5; + } + rpc RevokeInvitation(.bnet.protocol.channel_invitation.RevokeInvitationRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 6; + } + rpc SuggestInvitation(.bnet.protocol.channel_invitation.SuggestInvitationRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 7; + } +} + +service ChannelInvitationNotify +{ + rpc NotifyReceivedInvitationAdded(.bnet.protocol.channel_invitation.InvitationAddedNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 1; + } + rpc NotifyReceivedInvitationRemoved(.bnet.protocol.channel_invitation.InvitationRemovedNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 2; + } + rpc NotifyReceivedSuggestionAdded(.bnet.protocol.channel_invitation.SuggestionAddedNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 3; + } + rpc HasRoomForInvitation(.bnet.protocol.channel_invitation.HasRoomForInvitationRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 4; + } +} + diff --git a/contrib/protocompiler/definitions/bnet/channel_invitation_types.proto b/contrib/protocompiler/definitions/bnet/channel_invitation_types.proto new file mode 100644 index 00000000..b2399516 --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/channel_invitation_types.proto @@ -0,0 +1,38 @@ +import "bnet/invitation_types.proto"; +import "bnet/entity.proto"; +import "bnet/channel_types.proto"; + +package bnet.protocol.channel_invitation; + +message ChannelInvitation +{ + required .bnet.protocol.channel.ChannelDescription channel_description = 1; + optional bool reserved = 2 [default = false]; + optional bool rejoin = 3 [default = false]; + required uint32 service_type = 4; + extend .bnet.protocol.invitation.Invitation + { + optional .bnet.protocol.channel_invitation.ChannelInvitation channel_invitation = 105; + } +} + +message ChannelInvitationParams +{ + required .bnet.protocol.EntityId channel_id = 1; + optional bool reserved = 2; + optional bool rejoin = 3; + required uint32 service_type = 4; + extend .bnet.protocol.invitation.InvitationParams + { + optional .bnet.protocol.channel_invitation.ChannelInvitationParams channel_params = 105; + } +} + +message InvitationCollection +{ + optional uint32 service_type = 1; + optional uint32 max_received_invitations = 2; + optional uint64 object_id = 3; + repeated .bnet.protocol.invitation.Invitation received_invitation = 4; +} + diff --git a/contrib/protocompiler/definitions/bnet/channel_owner.proto b/contrib/protocompiler/definitions/bnet/channel_owner.proto new file mode 100644 index 00000000..9f2d19fb --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/channel_owner.proto @@ -0,0 +1,95 @@ +import "bnet/attribute.proto"; +import "bnet/entity.proto"; +import "bnet/rpc.proto"; +import "bnet/channel_types.proto"; + +package bnet.protocol.channel; + +option cc_generic_services = false; + +message GetChannelIdRequest +{ +} + +message GetChannelIdResponse +{ + optional .bnet.protocol.EntityId channel_id = 1; +} + +message CreateChannelRequest +{ + optional .bnet.protocol.Identity agent_identity = 1; + optional .bnet.protocol.channel.MemberState member_state = 2; + optional .bnet.protocol.channel.ChannelState channel_state = 3; + optional .bnet.protocol.EntityId channel_id = 4; + optional uint64 object_id = 5; +} + +message CreateChannelResponse +{ + required uint64 object_id = 1; + optional .bnet.protocol.EntityId channel_id = 2; +} + +message JoinChannelRequest +{ + optional .bnet.protocol.Identity agent_identity = 1; + optional .bnet.protocol.channel.MemberState member_state = 2; + required .bnet.protocol.EntityId channel_id = 3; + required uint64 object_id = 4; + repeated .bnet.protocol.EntityId friend_account_id = 5; +} + +message JoinChannelResponse +{ + optional uint64 object_id = 1; + optional bool require_friend_validation = 2 [default = false]; + repeated .bnet.protocol.EntityId privileged_account = 3; +} + +message FindChannelRequest +{ + optional .bnet.protocol.Identity agent_identity = 1; + required .bnet.protocol.channel.FindChannelOptions options = 2; +} + +message FindChannelResponse +{ + repeated .bnet.protocol.channel.ChannelDescription channel = 1; +} + +message GetChannelInfoRequest +{ + optional .bnet.protocol.EntityId agent_id = 1; + required .bnet.protocol.EntityId channel_id = 2; +} + +message GetChannelInfoResponse +{ + optional .bnet.protocol.channel.ChannelInfo channel_info = 1; +} + +service ChannelOwner +{ + rpc GetChannelId(.bnet.protocol.channel.GetChannelIdRequest) returns(.bnet.protocol.channel.GetChannelIdResponse) + { + option (method_id) = 1; + } + rpc CreateChannel(.bnet.protocol.channel.CreateChannelRequest) returns(.bnet.protocol.channel.CreateChannelResponse) + { + option (method_id) = 2; + } + rpc JoinChannel(.bnet.protocol.channel.JoinChannelRequest) returns(.bnet.protocol.channel.JoinChannelResponse) + { + option (method_id) = 3; + } + rpc FindChannel(.bnet.protocol.channel.FindChannelRequest) returns(.bnet.protocol.channel.FindChannelResponse) + { + option (method_id) = 4; + } + rpc GetChannelInfo(.bnet.protocol.channel.GetChannelInfoRequest) returns(.bnet.protocol.channel.GetChannelInfoResponse) + { + option (method_id) = 5; + } +} + diff --git a/contrib/protocompiler/definitions/bnet/channel_service.proto b/contrib/protocompiler/definitions/bnet/channel_service.proto new file mode 100644 index 00000000..06dcbfd9 --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/channel_service.proto @@ -0,0 +1,165 @@ +import "bnet/attribute.proto"; +import "bnet/entity.proto"; +import "bnet/rpc.proto"; +import "bnet/channel_types.proto"; + +package bnet.protocol.channel; + +option cc_generic_services = false; + +message AddMemberRequest +{ + optional .bnet.protocol.EntityId agent_id = 1; + required .bnet.protocol.Identity member_identity = 2; + required .bnet.protocol.channel.MemberState member_state = 3; + required uint64 object_id = 4; +} + +message RemoveMemberRequest +{ + optional .bnet.protocol.EntityId agent_id = 1; + required .bnet.protocol.EntityId member_id = 2; + optional uint32 reason = 3; +} + +message SendMessageRequest +{ + optional .bnet.protocol.EntityId agent_id = 1; + required .bnet.protocol.channel.Message message = 2; + optional uint64 required_privileges = 3 [default = 0]; +} + +message UpdateChannelStateRequest +{ + optional .bnet.protocol.EntityId agent_id = 1; + required .bnet.protocol.channel.ChannelState state_change = 2; +} + +message UpdateMemberStateRequest +{ + optional .bnet.protocol.EntityId agent_id = 1; + repeated .bnet.protocol.channel.Member state_change = 2; +} + +message DissolveRequest +{ + optional .bnet.protocol.EntityId agent_id = 1; + optional uint32 reason = 2; +} + +message SetRolesRequest +{ + optional .bnet.protocol.EntityId agent_id = 1; + repeated uint32 role = 2 [packed=true]; + repeated .bnet.protocol.EntityId member_id = 3; +} + +message AddNotification +{ + optional .bnet.protocol.channel.Member self = 1; + repeated .bnet.protocol.channel.Member member = 2; + required .bnet.protocol.channel.ChannelState channel_state = 3; +} + +message JoinNotification +{ + required .bnet.protocol.channel.Member member = 1; +} + +message RemoveNotification +{ + optional .bnet.protocol.EntityId agent_id = 1; + required .bnet.protocol.EntityId member_id = 2; + optional uint32 reason = 3; +} + +message LeaveNotification +{ + optional .bnet.protocol.EntityId agent_id = 1; + required .bnet.protocol.EntityId member_id = 2; + optional uint32 reason = 3; +} + +message SendMessageNotification +{ + optional .bnet.protocol.EntityId agent_id = 1; + required .bnet.protocol.channel.Message message = 2; + optional uint64 required_privileges = 3 [default = 0]; +} + +message UpdateChannelStateNotification +{ + optional .bnet.protocol.EntityId agent_id = 1; + required .bnet.protocol.channel.ChannelState state_change = 2; +} + +message UpdateMemberStateNotification +{ + optional .bnet.protocol.EntityId agent_id = 1; + repeated .bnet.protocol.channel.Member state_change = 2; +} + +service Channel +{ + rpc AddMember(.bnet.protocol.channel.AddMemberRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 1; + } + rpc RemoveMember(.bnet.protocol.channel.RemoveMemberRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 2; + } + rpc SendMessage(.bnet.protocol.channel.SendMessageRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 3; + } + rpc UpdateChannelState(.bnet.protocol.channel.UpdateChannelStateRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 4; + } + rpc UpdateMemberState(.bnet.protocol.channel.UpdateMemberStateRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 5; + } + rpc Dissolve(.bnet.protocol.channel.DissolveRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 6; + } + rpc SetRoles(.bnet.protocol.channel.SetRolesRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 7; + } +} + +service ChannelSubscriber +{ + rpc NotifyAdd(.bnet.protocol.channel.AddNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 1; + } + rpc NotifyJoin(.bnet.protocol.channel.JoinNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 2; + } + rpc NotifyRemove(.bnet.protocol.channel.RemoveNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 3; + } + rpc NotifyLeave(.bnet.protocol.channel.LeaveNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 4; + } + rpc NotifySendMessage(.bnet.protocol.channel.SendMessageNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 5; + } + rpc NotifyUpdateChannelState(.bnet.protocol.channel.UpdateChannelStateNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 6; + } + rpc NotifyUpdateMemberState(.bnet.protocol.channel.UpdateMemberStateNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 7; + } +} + diff --git a/contrib/protocompiler/definitions/bnet/channel_types.proto b/contrib/protocompiler/definitions/bnet/channel_types.proto new file mode 100644 index 00000000..7c51b564 --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/channel_types.proto @@ -0,0 +1,77 @@ +import "bnet/attribute.proto"; +import "bnet/entity.proto"; +import "bnet/invitation_types.proto"; + +package bnet.protocol.channel; + +message Message +{ + repeated .bnet.protocol.attribute.Attribute attribute = 1; + optional uint32 role = 2; + extensions 100 to 10000; +} + +message FindChannelOptions +{ + optional uint32 start_index = 1 [default = 0]; + optional uint32 max_results = 2 [default = 16]; + optional string name = 3; + optional fixed32 program = 4; + optional fixed32 locale = 5; + optional uint32 capacity_full = 6; + required .bnet.protocol.attribute.AttributeFilter attribute_filter = 7; + extensions 100 to 10000; +} + +message ChannelDescription +{ + required .bnet.protocol.EntityId channel_id = 1; + optional uint32 current_members = 2; + optional .bnet.protocol.channel.ChannelState state = 3; +} + +message ChannelInfo +{ + required .bnet.protocol.channel.ChannelDescription description = 1; + repeated .bnet.protocol.channel.Member member = 2; + extensions 100 to 10000; +} + +message ChannelState +{ + enum PrivacyLevel + { + PRIVACY_LEVEL_OPEN = 1; + PRIVACY_LEVEL_OPEN_INVITATION_AND_FRIEND = 2; + PRIVACY_LEVEL_OPEN_INVITATION = 3; + PRIVACY_LEVEL_CLOSED = 4; + } + + optional uint32 max_members = 1; + optional uint32 min_members = 2; + repeated .bnet.protocol.attribute.Attribute attribute = 3; + repeated .bnet.protocol.invitation.Invitation invitation = 4; + optional uint32 max_invitations = 5; + optional uint32 reason = 6; + optional .bnet.protocol.channel.ChannelState.PrivacyLevel privacy_level = 7 [default = PRIVACY_LEVEL_OPEN]; + optional string name = 8; + optional string delegate_name = 9; + optional string channel_type = 10 [default = "default"]; + extensions 100 to 10000; +} + +message MemberState +{ + repeated .bnet.protocol.attribute.Attribute attribute = 1; + repeated uint32 role = 2 [packed=true]; + optional uint64 privileges = 3 [default = 0]; + optional .bnet.protocol.AccountInfo info = 4; + extensions 100 to 10000; +} + +message Member +{ + required .bnet.protocol.Identity identity = 1; + required .bnet.protocol.channel.MemberState state = 2; +} + diff --git a/contrib/protocompiler/definitions/bnet/chat_types.proto b/contrib/protocompiler/definitions/bnet/chat_types.proto new file mode 100644 index 00000000..4762b133 --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/chat_types.proto @@ -0,0 +1,17 @@ +import "bnet/channel_types.proto"; + +package bnet.protocol.chat; + +message ChannelState +{ + optional string identity = 1; + optional fixed32 program = 2; + optional fixed32 locale = 3; + optional bool public = 4 [default = false]; + optional uint32 bucket_index = 5; + extend .bnet.protocol.channel.ChannelState + { + optional .bnet.protocol.chat.ChannelState chat = 100; + } +} + diff --git a/contrib/protocompiler/definitions/bnet/connection_service.proto b/contrib/protocompiler/definitions/bnet/connection_service.proto new file mode 100644 index 00000000..3bc2fc06 --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/connection_service.proto @@ -0,0 +1,108 @@ +import "bnet/content_handle.proto"; +import "bnet/rpc.proto"; + +package bnet.protocol.connection; + +option cc_generic_services = false; + +message ConnectRequest +{ + optional .bnet.protocol.ProcessId client_id = 1; + optional .bnet.protocol.connection.BindRequest bind_request = 2; +} + +message ConnectionMeteringContentHandles +{ + repeated .bnet.protocol.ContentHandle content_handle = 1; +} + +message ConnectResponse +{ + required .bnet.protocol.ProcessId server_id = 1; + optional .bnet.protocol.ProcessId client_id = 2; + optional uint32 bind_result = 3; + optional .bnet.protocol.connection.BindResponse bind_response = 4; + optional .bnet.protocol.connection.ConnectionMeteringContentHandles content_handle_array = 5; +} + +message BoundService +{ + required fixed32 hash = 1; + required uint32 id = 2; +} + +message BindRequest +{ + repeated fixed32 imported_service_hash = 1 [packed=true]; + repeated .bnet.protocol.connection.BoundService exported_service = 2; +} + +message BindResponse +{ + repeated uint32 imported_service_id = 1 [packed=true]; +} + +message EchoRequest +{ + optional fixed64 time = 1; + optional bool network_only = 2 [default = false]; + optional bytes payload = 3; +} + +message EchoResponse +{ + optional fixed64 time = 1; + optional bytes payload = 2; +} + +message DisconnectRequest +{ + required uint32 error_code = 1; +} + +message DisconnectNotification +{ + required uint32 error_code = 1; + optional string reason = 2; +} + +message NullRequest +{ +} + +message EncryptRequest +{ +} + +service ConnectionService +{ + rpc Connect(.bnet.protocol.connection.ConnectRequest) returns(.bnet.protocol.connection.ConnectResponse) + { + option (method_id) = 1; + } + rpc Bind(.bnet.protocol.connection.BindRequest) returns(.bnet.protocol.connection.BindResponse) + { + option (method_id) = 2; + } + rpc Echo(.bnet.protocol.connection.EchoRequest) returns(.bnet.protocol.connection.EchoResponse) + { + option (method_id) = 3; + } + rpc ForceDisconnect(.bnet.protocol.connection.DisconnectNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 4; + } + rpc Null(.bnet.protocol.connection.NullRequest) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 5; + } + rpc Encrypt(.bnet.protocol.connection.EncryptRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 6; + } + rpc RequestDisconnect(.bnet.protocol.connection.DisconnectRequest) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 7; + } +} + diff --git a/contrib/protocompiler/definitions/bnet/content_handle.proto b/contrib/protocompiler/definitions/bnet/content_handle.proto new file mode 100644 index 00000000..661740fe --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/content_handle.proto @@ -0,0 +1,10 @@ +package bnet.protocol; + +message ContentHandle +{ + required fixed32 region = 1; + required fixed32 usage = 2; + required bytes hash = 3; + optional string proto_url = 4; +} + diff --git a/contrib/protocompiler/definitions/bnet/entity.proto b/contrib/protocompiler/definitions/bnet/entity.proto new file mode 100644 index 00000000..57dcfd57 --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/entity.proto @@ -0,0 +1,24 @@ +import "bnet/field_options.proto"; + +package bnet.protocol; + +message EntityId +{ + required fixed64 high = 1; + required fixed64 low = 2; +} + +message Identity +{ + optional .bnet.protocol.EntityId account_id = 1; + optional .bnet.protocol.EntityId game_account_id = 2; +} + +message AccountInfo +{ + optional bool account_paid = 1 [default = false]; + optional fixed32 country_id = 2 [default = 0]; + optional string battle_tag = 3; + optional bool manual_review = 4 [default = false]; +} + diff --git a/contrib/protocompiler/definitions/bnet/exchange.proto b/contrib/protocompiler/definitions/bnet/exchange.proto new file mode 100644 index 00000000..7b22db2b --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/exchange.proto @@ -0,0 +1,47 @@ +import "bnet/field_options.proto"; + +package bnet.protocol.exchange; + +option cc_generic_services = false; + +message PartitionId +{ + required fixed64 high = 1; + required fixed64 low = 2; +} + +message BlobFrom +{ + required fixed32 source = 1; + required bytes data = 2; + optional bytes extra_data = 3; +} + +message BlobOfType +{ + required string type = 1; + optional bytes data = 2; + optional bytes extra_data = 3; +} + +message BlobFromOfType +{ + required fixed32 source = 1; + required string type = 2; + required bytes data = 3; +} + +message ActionResultDetail +{ + required uint32 category = 1; + optional uint32 result_reason = 2; +} + +message BillingAddress +{ + required int32 country_id = 1; + optional string city = 2; + optional string state = 3; + optional string postal_code = 4; +} + diff --git a/contrib/protocompiler/definitions/bnet/exchange_object_provider_types.proto b/contrib/protocompiler/definitions/bnet/exchange_object_provider_types.proto new file mode 100644 index 00000000..3b2ce903 --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/exchange_object_provider_types.proto @@ -0,0 +1,78 @@ +import "bnet/entity.proto"; +import "bnet/exchange.proto"; + +package bnet.protocol.exchange_object_provider; + +option cc_generic_services = false; + +message ReportAuthorizeRequest +{ + required .bnet.protocol.exchange.PartitionId partition_id = 1; + required .bnet.protocol.exchange.PartitionId token = 2; + required uint64 result = 3; + optional .bnet.protocol.exchange.BlobFromOfType auth_handle = 4; + optional bool defer_delivery = 5; + required .bnet.protocol.EntityId bnet_account_id = 6; + optional .bnet.protocol.exchange.ActionResultDetail result_detail = 7; + optional string avs_result = 8; + optional string cvv_result = 9; + optional .bnet.protocol.exchange.BlobFrom notification_extra_info = 10; +} + +message ReportSettleRequest +{ + required .bnet.protocol.exchange.PartitionId partition_id = 1; + required .bnet.protocol.exchange.PartitionId token = 2; + required uint64 result = 3; + optional .bnet.protocol.exchange.BlobFrom notification_extra_info = 4; + optional .bnet.protocol.exchange.ActionResultDetail result_detail = 5; +} + +message ReportCancelRequest +{ + required .bnet.protocol.exchange.PartitionId partition_id = 1; + required .bnet.protocol.exchange.PartitionId token = 2; + required uint64 result = 3; + optional .bnet.protocol.exchange.BlobFrom notification_extra_info = 4; + optional .bnet.protocol.exchange.ActionResultDetail result_detail = 5; +} + +message ReportRefundRequest +{ + required .bnet.protocol.exchange.PartitionId partition_id = 1; + required .bnet.protocol.exchange.PartitionId token = 2; + required uint64 result = 3; + optional .bnet.protocol.exchange.BlobFrom notification_extra_info = 4; + optional .bnet.protocol.exchange.ActionResultDetail result_detail = 5; +} + +message GetPaymentMethodsRequest +{ + optional .bnet.protocol.EntityId bnet_account = 1; + optional .bnet.protocol.EntityId game_account = 2; + required string currency = 3; + required uint32 cash_in_out_mask = 4; + optional bool refresh_payment_method_cache = 5 [default = false]; + optional bool refresh_e_balance_cache = 6 [default = false]; + optional bool sms_enable = 7 [default = false]; +} + +message PaymentMethod +{ + required .bnet.protocol.exchange.BlobFrom account = 1; + optional string description = 2; + optional uint64 amount = 3; + optional uint32 cash_in_out_mask = 4 [default = 3]; + optional .bnet.protocol.exchange.BillingAddress billing_address = 5; + required uint64 wallet_id = 6; + optional uint32 cap_restriction = 7; + optional uint64 authenticator_cap = 8; + optional uint64 soft_cap = 9; + optional bool active = 10 [default = true]; +} + +message GetPaymentMethodsResponse +{ + repeated .bnet.protocol.exchange_object_provider.PaymentMethod methods = 1; +} + diff --git a/contrib/protocompiler/definitions/bnet/exchange_risk_types.proto b/contrib/protocompiler/definitions/bnet/exchange_risk_types.proto new file mode 100644 index 00000000..0b2f1a32 --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/exchange_risk_types.proto @@ -0,0 +1,29 @@ +import "bnet/exchange.proto"; + +package bnet.protocol.exchange_risk; + +option cc_generic_services = false; + +message ReportAuthorizeRiskVerdictRequest +{ + required .bnet.protocol.exchange.PartitionId partition_id = 1; + required uint64 auth_id = 2; + required uint64 result = 3; + optional uint64 verdict = 4; +} + +message ReportSettleRiskVerdictRequest +{ + required .bnet.protocol.exchange.PartitionId partition_id = 1; + required uint64 settle_id = 2; + required uint64 result = 3; + optional uint64 verdict = 4; +} + +message DelaySettleRiskVerdictRequest +{ + required .bnet.protocol.exchange.PartitionId partition_id = 1; + required uint64 settle_id = 2; + optional uint64 delay_in_min = 3; +} + diff --git a/contrib/protocompiler/definitions/bnet/exchange_service.proto b/contrib/protocompiler/definitions/bnet/exchange_service.proto new file mode 100644 index 00000000..a2a322f9 --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/exchange_service.proto @@ -0,0 +1,609 @@ +import "bnet/rpc.proto"; +import "bnet/exchange.proto"; +import "bnet/exchange_object_provider_types.proto"; +import "bnet/exchange_risk_types.proto"; +import "bnet/entity.proto"; +import "bnet/account_types.proto"; +import "bnet/exchange_types.proto"; + +package bnet.protocol.exchange; + +option cc_generic_services = false; + +message CreateOrderBookRequest +{ + required .bnet.protocol.exchange.PartitionId partition_id = 1; + required .bnet.protocol.exchange.OrderBook order_book = 2; +} + +message CreateOrderBookResponse +{ + optional uint64 order_book_id = 1; +} + +message PlaceOfferOnOrderBookRequest +{ + required .bnet.protocol.exchange.PartitionId partition_id = 1; + required .bnet.protocol.exchange.OfferCreation offer_creation = 2; +} + +message PlaceOfferOnOrderBookResponse +{ + optional uint64 order_book_id = 1; + optional uint64 offer_id = 2; +} + +message PlaceOfferCreateOrderBookIfNeededRequest +{ + required .bnet.protocol.exchange.PartitionId partition_id = 1; + required .bnet.protocol.exchange.OrderBook order_book = 2; + required .bnet.protocol.exchange.OfferCreation offer_creation = 3; +} + +message PlaceOfferCreateOrderBookIfNeededResponse +{ + optional uint64 order_book_id = 1; + optional uint64 offer_id = 2; +} + +message PlaceBidOnOrderBookRequest +{ + required .bnet.protocol.exchange.PartitionId partition_id = 1; + required .bnet.protocol.exchange.BidCreation bid_creation = 2; +} + +message PlaceBidOnOrderBookResponse +{ + optional uint64 order_book_id = 1; + optional uint64 bid_id = 2; +} + +message PlaceBidCreateOrderBookIfNeededRequest +{ + required .bnet.protocol.exchange.PartitionId partition_id = 1; + required .bnet.protocol.exchange.OrderBook order_book = 2; + required .bnet.protocol.exchange.BidCreation bid_creation = 3; +} + +message PlaceBidCreateOrderBookIfNeededResponse +{ + optional uint64 order_book_id = 1; + optional uint64 bid_id = 2; +} + +message QueryOffersByOrderBookRequest +{ + required .bnet.protocol.exchange.PartitionId partition_id = 1; + required .bnet.protocol.exchange.QueryFilterByOrderId filter = 2; + required int32 status = 3; +} + +message QueryOffersByOrderBookResponse +{ + repeated .bnet.protocol.exchange.OfferExtended offers = 1; + required uint32 total_count = 2; +} + +message QueryBidsByOrderBookRequest +{ + required .bnet.protocol.exchange.PartitionId partition_id = 1; + required .bnet.protocol.exchange.QueryFilterByOrderId filter = 2; + required int32 status = 3; +} + +message QueryBidsByOrderBookResponse +{ + repeated .bnet.protocol.exchange.BidExtended bids = 1; + required uint32 total_count = 2; +} + +message QueryOffersByAccountForItemRequest +{ + required .bnet.protocol.exchange.BlobFrom account_for_item = 1; + required .bnet.protocol.exchange.QueryFilterByCreatedTime filter = 2; + optional .bnet.protocol.EntityId bnet_account = 3; +} + +message QueryOffersByAccountForItemResponse +{ + repeated .bnet.protocol.exchange.OfferExtended offers = 1; + required uint32 total_count = 2; +} + +message QueryBidsByAccountForItemRequest +{ + required .bnet.protocol.exchange.BlobFrom account_for_item = 1; + required .bnet.protocol.exchange.QueryFilterByCreatedTime filter = 2; + optional .bnet.protocol.EntityId bnet_account = 3; +} + +message QueryBidsByAccountForItemResponse +{ + repeated .bnet.protocol.exchange.BidExtended bids = 1; + required uint32 total_count = 2; +} + +message QueryOrderBooksSummaryRequest +{ + repeated .bnet.protocol.exchange.OrderBookHandle handles = 1; +} + +message QueryOrderBooksSummaryResponse +{ + repeated .bnet.protocol.exchange.OrderBookSummary order_books = 1; +} + +message SubscribeOrderBookStatusChangeRequest +{ + required uint64 object_id = 1; + required .bnet.protocol.exchange.PartitionId min_partition_id = 2; + required .bnet.protocol.exchange.PartitionId max_partition_id = 3; + required fixed32 program = 4; + required int32 status = 5; + required string currency = 6; + required int32 specialist = 7; + optional bool bootstrap = 8; + optional uint64 bootstrap_oldest_created_time = 9; +} + +message UnsubscribeOrderBookStatusChangeRequest +{ +} + +message SubscribeOrderUpdateRequest +{ + required .bnet.protocol.EntityId agent_id = 1; + required uint64 object_id = 2; +} + +message UnsubscribeOrderUpdateRequest +{ + required .bnet.protocol.EntityId agent_id = 1; + required uint64 object_id = 2; +} + +message SubscribeAdvancedOrderUpdateRequest +{ + required uint64 object_id = 1; + required .bnet.protocol.exchange.PartitionId min_partition_id = 2; + required .bnet.protocol.exchange.PartitionId max_partition_id = 3; + repeated .bnet.protocol.exchange.AdvancedSubscription filters = 4; +} + +message UnsubscribeAdvancedOrderUpdateRequest +{ +} + +message ClaimRequest +{ + optional .bnet.protocol.exchange.PartitionId partition_id = 1; + optional uint64 order_id = 2; + optional fixed32 program = 3; + optional .bnet.protocol.EntityId bnet_account = 4; + optional .bnet.protocol.exchange.BlobFrom information = 5; +} + +message CancelRequest +{ + required .bnet.protocol.exchange.PartitionId partition_id = 1; + required uint64 order_id = 2; + optional uint32 reason = 3; + optional .bnet.protocol.EntityId bnet_account = 4; +} + +message RefundRequest +{ + required .bnet.protocol.exchange.PartitionId partition_id = 1; + required uint64 order_id = 2; + required string cs_notes = 3; + required uint64 cs_user_id = 4; +} + +message GetConfigurationRequest +{ + required fixed32 program = 1; +} + +message GetConfigurationResponse +{ + repeated .bnet.protocol.exchange.SpecialistConfig configs = 1; + optional .bnet.protocol.account.AccountLicense rmt_restricted_by_license = 2; + optional string recommended_default_rmt_currency = 3; +} + +message GetOfferFeeEstimationRequest +{ + required .bnet.protocol.exchange.PartitionId partition_id = 1; + required .bnet.protocol.exchange.FeeEstimationData data = 2; +} + +message GetBidFeeEstimationRequest +{ + required .bnet.protocol.exchange.PartitionId partition_id = 1; + required .bnet.protocol.exchange.FeeEstimationData data = 2; +} + +message GetFeeEstimationResponse +{ + required uint64 fee_amount = 1; + repeated .bnet.protocol.exchange.FeeDetail fee_details = 2; +} + +message OrderBookNotificationRequest +{ + repeated .bnet.protocol.exchange.OrderBookNotification notifications = 1; + optional bool boot_strap_last = 2; +} + +message OfferNotificationRequest +{ + required .bnet.protocol.exchange.OfferExtended offer = 1; + required uint32 event = 2; + optional uint32 object_type = 3; + optional uint32 claim_result = 4; + optional uint32 claim_result_reason = 5; +} + +message BidNotificationRequest +{ + required .bnet.protocol.exchange.BidExtended bid = 1; + required uint32 event = 2; + optional uint32 object_type = 3; + optional uint32 claim_result = 4; + optional uint32 claim_result_reason = 5; +} + +message CustomNotificationRequest +{ + required .bnet.protocol.exchange.OrderBookHandle handle = 1; + required uint64 order_id = 2; + required .bnet.protocol.exchange.BlobFrom info = 3; +} + +message QueryOrdersByAccountForItemRequest +{ + required .bnet.protocol.exchange.BlobFrom account_for_item = 1; + optional .bnet.protocol.EntityId bnet_account = 2; + required .bnet.protocol.exchange.QueryOrderFilter filter = 3; +} + +message QueryOrdersByAccountForItemResponse +{ + repeated .bnet.protocol.exchange.OrderExtended orders = 1; + required uint32 total_count = 2; +} + +message GetFeeDetailsRequest +{ + required .bnet.protocol.exchange.PartitionId partition_id = 1; + required uint64 order_id = 2; + optional .bnet.protocol.EntityId bnet_account = 3; +} + +message GetFeeDetailsResponse +{ + repeated .bnet.protocol.exchange.FeeDetail fee_details_in = 1; + repeated .bnet.protocol.exchange.FeeDetail fee_details_out = 2; +} + +message GetOrderBookStatisticsRequest +{ + required .bnet.protocol.exchange.PartitionId partition_id = 1; + required uint32 order_type = 2; + required uint64 quantity = 3; + required uint32 last_trades = 4; + required uint32 last_days = 5; +} + +message GetOrderBookStatisticsResponse +{ + repeated .bnet.protocol.exchange.PriceDetail price_details = 1; + required uint64 last_trades_average = 2; + required uint64 last_days_average = 3; +} + +message GetBidDetailsRequest +{ + required uint64 order_id = 1; + required .bnet.protocol.exchange.PartitionId partition_id = 2; +} + +message GetBidDetailsResponse +{ + required .bnet.protocol.exchange.OrderExtended bid = 1; +} + +message GetOfferDetailsRequest +{ + required uint64 order_id = 1; + required .bnet.protocol.exchange.PartitionId partition_id = 2; +} + +message GetOfferDetailsResponse +{ + required .bnet.protocol.exchange.OrderExtended offer = 1; +} + +message GetSystemTimeResponse +{ + required uint64 time = 1; +} + +message CreateCSTradeRequest +{ + optional .bnet.protocol.exchange.PartitionId partition_id = 1; + required .bnet.protocol.exchange.OrderBook order_book = 2; + required uint32 amount = 3; + required .bnet.protocol.EntityId bnet_account = 4; + optional .bnet.protocol.EntityId game_account = 5; + required .bnet.protocol.exchange.BlobFrom account_for_item = 6; + required string cs_notes = 7; + required uint64 cs_user_id = 8; +} + +message CreateCSTradeItemRequest +{ + optional .bnet.protocol.exchange.PartitionId partition_id = 1; + required .bnet.protocol.exchange.OrderBook order_book = 2; + required uint32 amount = 3; + required .bnet.protocol.EntityId bnet_account = 4; + optional .bnet.protocol.EntityId game_account = 5; + required .bnet.protocol.exchange.BlobFrom account_for_item = 6; + required string cs_notes = 7; + required uint64 cs_user_id = 8; +} + +message CreateCSTradeMoneyRequest +{ + optional .bnet.protocol.exchange.PartitionId partition_id = 1; + required .bnet.protocol.exchange.OrderBook order_book = 2; + required uint32 amount = 3; + required .bnet.protocol.EntityId bnet_account = 4; + optional .bnet.protocol.EntityId game_account = 5; + required .bnet.protocol.exchange.BlobFrom account_for_item = 6; + required string cs_notes = 7; + required uint64 cs_user_id = 8; + optional .bnet.protocol.exchange.BlobFrom account_for_money = 9; +} + +message CreateCSTradeResponse +{ + optional uint64 order_book_id = 1; +} + +message GetOrderCountRequest +{ + optional string currency = 1; + optional fixed32 source = 2; + optional .bnet.protocol.EntityId bnet_account = 3; + optional bool not_closed_offer_count = 4 [default = false]; + optional bool order_with_claimable_count = 5 [default = false]; +} + +message GetOrderCountResponse +{ + optional .bnet.protocol.exchange.Count not_closed_offer_count = 1; + optional .bnet.protocol.exchange.Count order_with_claimable_count = 2; +} + +message HistoriesForCSRequest +{ + required .bnet.protocol.EntityId bnet_account = 1; + required fixed32 program = 2; + required uint64 lower_time = 3; + required uint64 higher_time = 4; +} + +message HistoriesForCSResponse +{ + repeated .bnet.protocol.exchange.HistoryData history_data = 1; +} + +service ExchangeService +{ + rpc CreateOrderBook(.bnet.protocol.exchange.CreateOrderBookRequest) returns(.bnet.protocol.exchange.CreateOrderBookResponse) + { + option (method_id) = 1; + } + rpc PlaceOfferOnOrderBook(.bnet.protocol.exchange.PlaceOfferOnOrderBookRequest) returns(.bnet.protocol.exchange.PlaceOfferOnOrderBookResponse) + { + option (method_id) = 2; + } + rpc PlaceOfferCreateOrderBookIfNeeded(.bnet.protocol.exchange.PlaceOfferCreateOrderBookIfNeededRequest) returns(.bnet.protocol.exchange.PlaceOfferCreateOrderBookIfNeededResponse) + { + option (method_id) = 3; + } + rpc PlaceBidOnOrderBook(.bnet.protocol.exchange.PlaceBidOnOrderBookRequest) returns(.bnet.protocol.exchange.PlaceBidOnOrderBookResponse) + { + option (method_id) = 4; + } + rpc PlaceBidCreateOrderBookIfNeeded(.bnet.protocol.exchange.PlaceBidCreateOrderBookIfNeededRequest) returns(.bnet.protocol.exchange.PlaceBidCreateOrderBookIfNeededResponse) + { + option (method_id) = 5; + } + rpc QueryOffersByOrderBook(.bnet.protocol.exchange.QueryOffersByOrderBookRequest) returns(.bnet.protocol.exchange.QueryOffersByOrderBookResponse) + { + option (method_id) = 6; + } + rpc QueryBidsByOrderBook(.bnet.protocol.exchange.QueryBidsByOrderBookRequest) returns(.bnet.protocol.exchange.QueryBidsByOrderBookResponse) + { + option (method_id) = 7; + } + rpc QueryOffersByAccountForItem(.bnet.protocol.exchange.QueryOffersByAccountForItemRequest) returns(.bnet.protocol.exchange.QueryOffersByAccountForItemResponse) + { + option (method_id) = 8; + } + rpc QueryBidsByAccountForItem(.bnet.protocol.exchange.QueryBidsByAccountForItemRequest) returns(.bnet.protocol.exchange.QueryBidsByAccountForItemResponse) + { + option (method_id) = 9; + } + rpc QueryOrderBooksSummary(.bnet.protocol.exchange.QueryOrderBooksSummaryRequest) returns(.bnet.protocol.exchange.QueryOrderBooksSummaryResponse) + { + option (method_id) = 11; + } + rpc ReportAuthorize(.bnet.protocol.exchange_object_provider.ReportAuthorizeRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 13; + } + rpc ReportSettle(.bnet.protocol.exchange_object_provider.ReportSettleRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 14; + } + rpc ReportCancel(.bnet.protocol.exchange_object_provider.ReportCancelRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 15; + } + rpc SubscribeOrderBookStatusChange(.bnet.protocol.exchange.SubscribeOrderBookStatusChangeRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 16; + } + rpc UnsubscribeOrderBookStatusChange(.bnet.protocol.exchange.UnsubscribeOrderBookStatusChangeRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 17; + } + rpc SubscribeOrderUpdate(.bnet.protocol.exchange.SubscribeOrderUpdateRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 18; + } + rpc UnsubscribeOrderUpdate(.bnet.protocol.exchange.UnsubscribeOrderUpdateRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 19; + } + rpc GetPaymentMethods(.bnet.protocol.exchange_object_provider.GetPaymentMethodsRequest) returns(.bnet.protocol.exchange_object_provider.GetPaymentMethodsResponse) + { + option (method_id) = 20; + } + rpc ClaimBidItem(.bnet.protocol.exchange.ClaimRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 21; + } + rpc ClaimBidMoney(.bnet.protocol.exchange.ClaimRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 22; + } + rpc ClaimOfferItem(.bnet.protocol.exchange.ClaimRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 23; + } + rpc ClaimOfferMoney(.bnet.protocol.exchange.ClaimRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 24; + } + rpc CancelBid(.bnet.protocol.exchange.CancelRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 25; + } + rpc CancelOffer(.bnet.protocol.exchange.CancelRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 26; + } + rpc GetConfiguration(.bnet.protocol.exchange.GetConfigurationRequest) returns(.bnet.protocol.exchange.GetConfigurationResponse) + { + option (method_id) = 27; + } + rpc GetBidFeeEstimation(.bnet.protocol.exchange.GetBidFeeEstimationRequest) returns(.bnet.protocol.exchange.GetFeeEstimationResponse) + { + option (method_id) = 28; + } + rpc GetOfferFeeEstimation(.bnet.protocol.exchange.GetOfferFeeEstimationRequest) returns(.bnet.protocol.exchange.GetFeeEstimationResponse) + { + option (method_id) = 29; + } + rpc QueryOrdersByAccountForItem(.bnet.protocol.exchange.QueryOrdersByAccountForItemRequest) returns(.bnet.protocol.exchange.QueryOrdersByAccountForItemResponse) + { + option (method_id) = 30; + } + rpc ReportAuthorizeRiskVerdict(.bnet.protocol.exchange_risk.ReportAuthorizeRiskVerdictRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 31; + } + rpc ReportSettleRiskVerdict(.bnet.protocol.exchange_risk.ReportSettleRiskVerdictRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 32; + } + rpc DelaySettleRiskVerdict(.bnet.protocol.exchange_risk.DelaySettleRiskVerdictRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 33; + } + rpc GetFeeDetails(.bnet.protocol.exchange.GetFeeDetailsRequest) returns(.bnet.protocol.exchange.GetFeeDetailsResponse) + { + option (method_id) = 34; + } + rpc GetOrderBookStatistics(.bnet.protocol.exchange.GetOrderBookStatisticsRequest) returns(.bnet.protocol.exchange.GetOrderBookStatisticsResponse) + { + option (method_id) = 35; + } + rpc GetBidDetails(.bnet.protocol.exchange.GetBidDetailsRequest) returns(.bnet.protocol.exchange.GetBidDetailsResponse) + { + option (method_id) = 36; + } + rpc GetOfferDetails(.bnet.protocol.exchange.GetOfferDetailsRequest) returns(.bnet.protocol.exchange.GetOfferDetailsResponse) + { + option (method_id) = 37; + } + rpc GetSystemTime(.bnet.protocol.NoData) returns(.bnet.protocol.exchange.GetSystemTimeResponse) + { + option (method_id) = 38; + } + rpc CreateCSTrade(.bnet.protocol.exchange.CreateCSTradeRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 39; + } + rpc RefundBid(.bnet.protocol.exchange.RefundRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 40; + } + rpc ReportRefund(.bnet.protocol.exchange_object_provider.ReportRefundRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 41; + } + rpc GetOrderCount(.bnet.protocol.exchange.GetOrderCountRequest) returns(.bnet.protocol.exchange.GetOrderCountResponse) + { + option (method_id) = 42; + } + rpc SubscribeAdvancedOrderUpdate(.bnet.protocol.exchange.SubscribeAdvancedOrderUpdateRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 43; + } + rpc UnsubscribeAdvancedOrderUpdate(.bnet.protocol.exchange.UnsubscribeAdvancedOrderUpdateRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 44; + } + rpc SettleHistoriesForCS(.bnet.protocol.exchange.HistoriesForCSRequest) returns(.bnet.protocol.exchange.HistoriesForCSResponse) + { + option (method_id) = 45; + } + rpc CancelHistoriesForCS(.bnet.protocol.exchange.HistoriesForCSRequest) returns(.bnet.protocol.exchange.HistoriesForCSResponse) + { + option (method_id) = 46; + } + rpc CreateCSTradeItem(.bnet.protocol.exchange.CreateCSTradeItemRequest) returns(.bnet.protocol.exchange.CreateCSTradeResponse) + { + option (method_id) = 47; + } + rpc CreateCSTradeMoney(.bnet.protocol.exchange.CreateCSTradeMoneyRequest) returns(.bnet.protocol.exchange.CreateCSTradeResponse) + { + option (method_id) = 48; + } +} + +service ExchangeNotify +{ + rpc NotifyOrderBookStatusChange(.bnet.protocol.exchange.OrderBookNotificationRequest) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 1; + } + rpc NotifyOfferUpdate(.bnet.protocol.exchange.OfferNotificationRequest) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 2; + } + rpc NotifyBidUpdate(.bnet.protocol.exchange.BidNotificationRequest) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 3; + } + rpc NotifyCustomMessage(.bnet.protocol.exchange.CustomNotificationRequest) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 4; + } +} + diff --git a/contrib/protocompiler/definitions/bnet/exchange_types.proto b/contrib/protocompiler/definitions/bnet/exchange_types.proto new file mode 100644 index 00000000..1f46c679 --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/exchange_types.proto @@ -0,0 +1,284 @@ +import "bnet/entity.proto"; +import "bnet/exchange.proto"; + +package bnet.protocol.exchange; + +message OrderBook +{ + required .bnet.protocol.exchange.BlobOfType object = 1; + required fixed32 program = 2; + required uint32 compatibility = 3; + required string currency = 4; + required int32 specialist = 5; + required uint32 allowed_realm = 6; +} + +message OrderBookHandle +{ + required .bnet.protocol.exchange.PartitionId partition_id = 1; + required uint64 order_book_id = 2; +} + +message OrderBookNotification +{ + required .bnet.protocol.exchange.OrderBook order_book = 1; + required .bnet.protocol.exchange.PartitionId partition_id = 2; + required uint64 order_book_id = 3; + optional uint64 trade_now_price = 4 [default = 0]; + optional uint64 winning_price = 5 [default = 0]; + required uint32 status = 6; + required uint64 update_time = 7; + optional uint64 closed_time = 8 [default = 0]; + required uint64 filled_amount = 9; +} + +message OrderBookSummary +{ + required .bnet.protocol.exchange.PartitionId partition_id = 1; + required uint64 order_book_id = 2; + required uint32 result = 3; + optional .bnet.protocol.exchange.OrderBook order_book = 4; + optional uint64 amount = 5; + optional uint64 best_offer_price = 6; + optional uint64 best_bid_price = 7; + optional uint64 end_time = 8; + optional int32 status = 9; + optional uint64 created_time = 10; + optional uint64 active_time = 11; + optional uint64 closed_time = 12; + optional uint32 reason = 13; + optional uint64 out_bid_unit_price = 14; +} + +message Order +{ + required uint32 amount = 1; + optional uint64 start_time = 2; + optional uint64 end_time = 3; + optional .bnet.protocol.exchange.BlobFrom account_for_money = 4; + optional .bnet.protocol.exchange.BlobFrom account_for_item = 5; + optional .bnet.protocol.EntityId bnet_account = 6; + optional .bnet.protocol.EntityId game_account = 7; + optional .bnet.protocol.exchange.PartitionId session_id = 8; +} + +message Extension +{ + required .bnet.protocol.exchange.PartitionId partition_id = 1; + required uint64 order_book_id = 2; + required uint64 order_id = 3; + optional uint64 filled_amount = 4; + optional int32 order_status = 5; + optional uint64 authorized_time = 6; + optional uint64 created_time = 7; + optional uint64 closed_time = 8; + optional uint32 reason = 9; + optional .bnet.protocol.exchange.OrderBook order_book = 10; + optional uint64 order_book_status = 11; + optional uint64 money_to_claim = 12; + optional uint64 items_to_claim = 13; + optional bool risk_delayed = 14 [default = false]; + optional uint32 fail_order_action = 15; + optional uint32 fail_object_type = 16; + optional uint32 fail_error_code = 17; + optional uint32 fail_extra_error_code = 18; + optional uint64 refunded = 19; + optional uint64 filled_fund_amount = 20; +} + +message Offer +{ + required .bnet.protocol.exchange.Order order = 1; + optional uint64 trade_now_price = 2; + optional uint64 reserve_price = 3; + optional uint64 out_bid_price = 4; +} + +message OfferExtended +{ + required .bnet.protocol.exchange.Offer offer = 1; + required .bnet.protocol.exchange.Extension extension = 2; + optional uint64 current_winning_price = 3; +} + +message OfferCreation +{ + required .bnet.protocol.exchange.Offer offer = 1; + optional uint64 auction_duration = 2; + optional uint64 auction_start_delay = 3; + optional .bnet.protocol.exchange.BillingAddress billing_address = 4; +} + +message Bid +{ + required .bnet.protocol.exchange.Order order = 1; + optional uint64 current_unit_price = 2; + optional uint64 max_unit_price = 3; +} + +message BidExtended +{ + required .bnet.protocol.exchange.Bid bid = 1; + required .bnet.protocol.exchange.Extension extension = 2; + optional uint64 offer_out_bid_price = 3; + optional uint64 offer_trade_now_price = 4; + optional uint64 offer_current_winning_price = 5; + optional uint64 bid_current_unit_price = 6; + optional uint64 bid_max_unit_price = 7; +} + +message BidCreation +{ + required .bnet.protocol.exchange.Bid bid = 1; + optional uint64 auction_duration = 2; + optional uint64 auction_start_delay = 3; + optional .bnet.protocol.exchange.BillingAddress billing_address = 4; + optional bool fill_or_kill = 5 [default = false]; +} + +message OrderExtended +{ + required uint32 order_type = 1; + optional .bnet.protocol.exchange.BidExtended bid_extended = 2; + optional .bnet.protocol.exchange.OfferExtended offer_extended = 3; +} + +message QueryFilterByOrderId +{ + required uint32 max_result = 1; + optional uint64 ref_order_id = 2; + optional uint64 ref_price = 3; +} + +message QueryFilterByCreatedTime +{ + required uint32 max_result = 1; + optional uint64 ref_created_time = 2; + optional string currency = 3; +} + +message QueryOrderFilter +{ + optional string currency = 1; + optional uint32 specialist = 2; + optional uint32 order_type = 3; + optional uint32 claimable = 4 [default = 0]; + optional uint32 order_status_mask = 5; + optional bool rollup = 6 [default = false]; + required .bnet.protocol.exchange.QueryFilterByCreatedTime time_filter = 7; + optional uint32 order_book_status = 8; +} + +message CurrencyConfig +{ + required string currency = 1; + optional uint64 tick_size = 2; + optional uint64 min_unit_price = 3; + optional uint64 max_unit_price = 4; + optional uint64 min_total_price = 5; + optional uint64 max_total_price = 6; +} + +message SpecialistConfig +{ + required int32 specialist = 1; + repeated uint64 auction_durations = 2 [packed=true]; + repeated uint64 auction_start_delays = 3 [packed=true]; + optional uint64 anti_sniping_extension_delay = 4; + optional uint64 max_items_amount = 5 [default = 0]; + optional int32 starting_unit_price_rule = 6; + optional int32 reserved_unit_price_rule = 7; + optional int32 trade_now_unit_price_rule = 8; + optional int32 current_unit_price_rule = 9; + optional int32 maximum_unit_price_rule = 10; + repeated .bnet.protocol.exchange.CurrencyConfig currency_config = 11; + optional int32 fill_or_kill_rule = 12; +} + +message FeeEstimationData +{ + required fixed32 program = 1; + required int32 specialist = 2; + required string currency = 3; + required fixed32 source = 4; + required uint64 money_amount = 5; + required uint64 item_amount = 6; + optional .bnet.protocol.EntityId bnet_account = 7; + optional .bnet.protocol.exchange.BillingAddress billing_address = 8; +} + +message FeeDetail +{ + required uint64 rownum = 1; + required uint64 fee_auth_detail_id = 2; + optional uint64 fee_id = 3; + optional uint64 fee_amount = 4; + optional uint64 discount_amount = 5; + optional uint64 fee_group_id = 6; + optional string fee_group_name = 7; + optional uint64 flat_fee_amount = 8; + optional float scaling_fee_rate = 9; + optional uint64 max_fee_amount = 10; + optional string fee_description = 11; + required bool is_tax = 12; + optional uint64 coupon_book_id = 13; + optional uint64 coupon_type = 14; + optional string coupon_description = 15; + optional uint64 left_over_coupon_credit = 16; + optional uint64 left_over_coupon_charge = 17; +} + +message PriceDetail +{ + required uint64 trade_price = 1; + required uint64 amount = 2; +} + +message Count +{ + required uint32 count = 1; + optional uint32 limit = 2; +} + +message AdvancedSubscription +{ + required fixed32 program = 1; + required uint32 event = 2; + repeated uint32 reason = 3; +} + +message HistoryData +{ + required uint64 order_book_id = 1; + required .bnet.protocol.exchange.PartitionId partition_id = 2; + required uint64 action_id = 3; + optional uint64 parent_settle_id = 4; + optional bool parent_settled = 5; + required uint64 authorized_amount = 6; + optional uint64 authorized_fee_amount = 7; + required uint64 amount = 8; + optional uint64 fee_amount = 9; + required bool deferred = 10; + required bool has_been_deferred = 11; + required uint64 progress = 12; + required uint64 created = 13; + optional uint64 risk_completed = 14; + optional uint64 risk_result = 15; + optional uint64 risk_verdict = 16; + optional uint64 completed = 17; + optional uint64 result_code = 18; + required .bnet.protocol.exchange.BlobFrom account_for_item = 19; + required .bnet.protocol.exchange.BlobFrom account_for_money = 20; + required uint32 order_type = 21; + required uint64 order_id = 22; + required uint64 auth_id = 23; + required uint32 auth_object_type = 24; + required string trans_direction = 25; + required uint64 auth_complete_progress = 26; + required uint64 auth_filled_progress = 27; + required uint64 auth_total_progress = 28; + required .bnet.protocol.exchange.BlobFromOfType auth_handle = 29; + required bool auth_deferred = 30; + required .bnet.protocol.exchange.PartitionId token = 31; +} + diff --git a/contrib/protocompiler/definitions/bnet/field_options.proto b/contrib/protocompiler/definitions/bnet/field_options.proto new file mode 100644 index 00000000..cd226559 --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/field_options.proto @@ -0,0 +1,15 @@ +import "google/protobuf/descriptor.proto"; + +package bnet.protocol; + +enum LogOption +{ + HIDDEN = 1; + HEX = 2; +} + +extend .google.protobuf.FieldOptions +{ + optional .bnet.protocol.LogOption log = 50000; +} + diff --git a/contrib/protocompiler/definitions/bnet/friends_service.proto b/contrib/protocompiler/definitions/bnet/friends_service.proto new file mode 100644 index 00000000..4ffb348c --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/friends_service.proto @@ -0,0 +1,174 @@ +import "bnet/friends_types.proto"; +import "bnet/invitation_types.proto"; +import "bnet/role_set.proto"; +import "bnet/attribute.proto"; +import "bnet/entity.proto"; +import "bnet/rpc.proto"; + +package bnet.protocol.friends; + +option cc_generic_services = false; + +message SubscribeToFriendsRequest +{ + optional .bnet.protocol.EntityId agent_id = 1; + required uint64 object_id = 2; +} + +message SubscribeToFriendsResponse +{ + optional uint32 max_friends = 1; + optional uint32 max_received_invitations = 2; + optional uint32 max_sent_invitations = 3; + repeated .bnet.protocol.Role role = 4; + repeated .bnet.protocol.friends.Friend friends = 5; + repeated .bnet.protocol.invitation.Invitation sent_invitations = 6; + repeated .bnet.protocol.invitation.Invitation received_invitations = 7; +} + +message UnsubscribeToFriendsRequest +{ + optional .bnet.protocol.EntityId agent_id = 1; + optional uint64 object_id = 2; +} + +message GenericFriendRequest +{ + optional .bnet.protocol.EntityId agent_id = 1; + required .bnet.protocol.EntityId target_id = 2; +} + +message GenericFriendResponse +{ + optional .bnet.protocol.friends.Friend target_friend = 1; +} + +message AssignRoleRequest +{ + optional .bnet.protocol.EntityId agent_id = 1; + required .bnet.protocol.EntityId target_id = 2; + repeated int32 role = 3; +} + +message ViewFriendsRequest +{ + optional .bnet.protocol.EntityId agent_id = 1; + required .bnet.protocol.EntityId target_id = 2; + required .bnet.protocol.attribute.AttributeFilter filter = 3; + optional uint32 start_index = 4 [default = 0]; + optional uint32 max_results = 5 [default = 100]; +} + +message ViewFriendsResponse +{ + repeated .bnet.protocol.friends.Friend friends = 1; + optional uint32 total_results = 2; +} + +message UpdateFriendStateRequest +{ + optional .bnet.protocol.EntityId agent_id = 1; + required .bnet.protocol.EntityId target_id = 2; + repeated .bnet.protocol.attribute.Attribute attribute = 3; + optional uint64 attributes_epoch = 4; +} + +message FriendNotification +{ + required .bnet.protocol.friends.Friend target = 1; + optional .bnet.protocol.EntityId game_account_id = 2; +} + +message UpdateFriendStateNotification +{ + required .bnet.protocol.friends.Friend changed_friend = 1; + optional .bnet.protocol.EntityId game_account_id = 2; +} + +message InvitationNotification +{ + required .bnet.protocol.invitation.Invitation invitation = 1; + optional .bnet.protocol.EntityId game_account_id = 2; + optional uint32 reason = 3 [default = 0]; +} + +service FriendsService +{ + rpc SubscribeToFriends(.bnet.protocol.friends.SubscribeToFriendsRequest) returns(.bnet.protocol.friends.SubscribeToFriendsResponse) + { + option (method_id) = 1; + } + rpc SendInvitation(.bnet.protocol.invitation.SendInvitationRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 2; + } + rpc AcceptInvitation(.bnet.protocol.invitation.GenericRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 3; + } + rpc RevokeInvitation(.bnet.protocol.invitation.GenericRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 4; + } + rpc DeclineInvitation(.bnet.protocol.invitation.GenericRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 5; + } + rpc IgnoreInvitation(.bnet.protocol.invitation.GenericRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 6; + } + rpc AssignRole(.bnet.protocol.friends.AssignRoleRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 7; + } + rpc RemoveFriend(.bnet.protocol.friends.GenericFriendRequest) returns(.bnet.protocol.friends.GenericFriendResponse) + { + option (method_id) = 8; + } + rpc ViewFriends(.bnet.protocol.friends.ViewFriendsRequest) returns(.bnet.protocol.friends.ViewFriendsResponse) + { + option (method_id) = 9; + } + rpc UpdateFriendState(.bnet.protocol.friends.UpdateFriendStateRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 10; + } + rpc UnsubscribeToFriends(.bnet.protocol.friends.UnsubscribeToFriendsRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 11; + } +} + +service FriendsNotify +{ + rpc NotifyFriendAdded(.bnet.protocol.friends.FriendNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 1; + } + rpc NotifyFriendRemoved(.bnet.protocol.friends.FriendNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 2; + } + rpc NotifyReceivedInvitationAdded(.bnet.protocol.friends.InvitationNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 3; + } + rpc NotifyReceivedInvitationRemoved(.bnet.protocol.friends.InvitationNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 4; + } + rpc NotifySentInvitationAdded(.bnet.protocol.friends.InvitationNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 5; + } + rpc NotifySentInvitationRemoved(.bnet.protocol.friends.InvitationNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 6; + } + rpc NotifyUpdateFriendState(.bnet.protocol.friends.UpdateFriendStateNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 7; + } +} + diff --git a/contrib/protocompiler/definitions/bnet/friends_types.proto b/contrib/protocompiler/definitions/bnet/friends_types.proto new file mode 100644 index 00000000..2b70cdfb --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/friends_types.proto @@ -0,0 +1,39 @@ +import "bnet/attribute.proto"; +import "bnet/entity.proto"; +import "bnet/invitation_types.proto"; + +package bnet.protocol.friends; + +message Friend +{ + required .bnet.protocol.EntityId id = 1; + repeated .bnet.protocol.attribute.Attribute attribute = 2; + repeated uint32 role = 3 [packed=true]; + optional uint64 privileges = 4 [default = 0]; + optional uint64 attributes_epoch = 5; +} + +message FriendInvitation +{ + optional bool first_received = 1 [default = false]; + repeated uint32 role = 2 [packed=true]; + extend .bnet.protocol.invitation.Invitation + { + optional .bnet.protocol.friends.FriendInvitation friend_invitation = 103; + } +} + +message FriendInvitationParams +{ + optional string target_email = 1; + optional string target_battle_tag = 2; + optional string inviter_battle_tag = 3; + optional string inviter_full_name = 4; + optional string invitee_display_name = 5; + repeated uint32 role = 6 [packed=true]; + extend .bnet.protocol.invitation.InvitationParams + { + optional .bnet.protocol.friends.FriendInvitationParams friend_params = 103; + } +} + diff --git a/contrib/protocompiler/definitions/bnet/game_factory.proto b/contrib/protocompiler/definitions/bnet/game_factory.proto new file mode 100644 index 00000000..fc4d2e7d --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/game_factory.proto @@ -0,0 +1,14 @@ +import "bnet/attribute.proto"; +import "bnet/entity.proto"; + +package bnet.protocol.game_master; + +message GameProperties +{ + repeated .bnet.protocol.attribute.Attribute creation_attributes = 1; + optional .bnet.protocol.attribute.AttributeFilter filter = 2; + optional bool create = 3 [default = false]; + optional bool open = 4 [default = true]; + optional fixed32 program_id = 5; +} + diff --git a/contrib/protocompiler/definitions/bnet/game_master_service.proto b/contrib/protocompiler/definitions/bnet/game_master_service.proto new file mode 100644 index 00000000..df250dbe --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/game_master_service.proto @@ -0,0 +1,235 @@ +import "bnet/game_factory.proto"; +import "bnet/server_pool_service.proto"; +import "bnet/attribute.proto"; +import "bnet/entity.proto"; +import "bnet/rpc.proto"; +import "bnet/game_master_types.proto"; + +package bnet.protocol.game_master; + +option cc_generic_services = false; + +message JoinGameRequest +{ + required .bnet.protocol.game_master.GameHandle game_handle = 1; + repeated .bnet.protocol.game_master.Player player = 2; +} + +message JoinGameResponse +{ + optional fixed64 request_id = 1; + optional bool queued = 2 [default = false]; + repeated .bnet.protocol.game_master.ConnectInfo connect_info = 3; +} + +message ListFactoriesRequest +{ + required .bnet.protocol.attribute.AttributeFilter filter = 1; + optional uint32 start_index = 2 [default = 0]; + optional uint32 max_results = 3 [default = 100]; +} + +message ListFactoriesResponse +{ + repeated .bnet.protocol.game_master.GameFactoryDescription description = 1; + optional uint32 total_results = 2; +} + +message FindGameRequest +{ + repeated .bnet.protocol.game_master.Player player = 1; + optional fixed64 factory_id = 2; + optional .bnet.protocol.game_master.GameProperties properties = 3; + optional uint64 factory_object_id = 4; + optional fixed64 request_id = 5; +} + +message FindGameResponse +{ + optional fixed64 request_id = 1; + optional fixed64 factory_id = 2; + optional bool queued = 3 [default = false]; +} + +message GameEndedNotification +{ + required .bnet.protocol.game_master.GameHandle game_handle = 1; + optional uint32 reason = 2 [default = 0]; +} + +message PlayerLeftNotification +{ + required .bnet.protocol.game_master.GameHandle game_handle = 1; + required .bnet.protocol.EntityId member_id = 2; + optional uint32 reason = 3 [default = 1]; +} + +message RegisterServerRequest +{ + repeated .bnet.protocol.attribute.Attribute attribute = 1; + optional .bnet.protocol.server_pool.ServerState state = 2; + required fixed32 program_id = 3; +} + +message UnregisterServerRequest +{ +} + +message RegisterUtilitiesRequest +{ + repeated .bnet.protocol.attribute.Attribute attribute = 1; + optional .bnet.protocol.server_pool.ServerState state = 2; + required fixed32 program_id = 3; +} + +message UnregisterUtilitiesRequest +{ +} + +message SubscribeRequest +{ + required uint64 object_id = 1; +} + +message SubscribeResponse +{ + optional uint64 subscription_id = 1; +} + +message UnsubscribeRequest +{ + required uint64 subscription_id = 1; +} + +message ChangeGameRequest +{ + required .bnet.protocol.game_master.GameHandle game_handle = 1; + optional bool open = 2; + repeated .bnet.protocol.attribute.Attribute attribute = 3; + optional bool replace = 4 [default = false]; +} + +message GetFactoryInfoRequest +{ + required fixed64 factory_id = 1; +} + +message GetFactoryInfoResponse +{ + repeated .bnet.protocol.attribute.Attribute attribute = 1; + repeated .bnet.protocol.game_master.GameStatsBucket stats_bucket = 2; +} + +message GetGameStatsRequest +{ + required fixed64 factory_id = 1; + required .bnet.protocol.attribute.AttributeFilter filter = 2; +} + +message GetGameStatsResponse +{ + repeated .bnet.protocol.game_master.GameStatsBucket stats_bucket = 1; +} + +message FactoryUpdateNotification +{ + enum Operation + { + ADD = 1; + REMOVE = 2; + CHANGE = 3; + } + + required .bnet.protocol.game_master.FactoryUpdateNotification.Operation op = 1; + required .bnet.protocol.game_master.GameFactoryDescription description = 2; + optional fixed32 program_id = 3; +} + +message GameFoundNotification +{ + required fixed64 request_id = 1; + optional uint32 error_code = 2 [default = 0]; + optional .bnet.protocol.game_master.GameHandle game_handle = 3; + repeated .bnet.protocol.game_master.ConnectInfo connect_info = 4; +} + +service GameMaster +{ + rpc JoinGame(.bnet.protocol.game_master.JoinGameRequest) returns(.bnet.protocol.game_master.JoinGameResponse) + { + option (method_id) = 1; + } + rpc ListFactories(.bnet.protocol.game_master.ListFactoriesRequest) returns(.bnet.protocol.game_master.ListFactoriesResponse) + { + option (method_id) = 2; + } + rpc FindGame(.bnet.protocol.game_master.FindGameRequest) returns(.bnet.protocol.game_master.FindGameResponse) + { + option (method_id) = 3; + } + rpc CancelGameEntry(.bnet.protocol.game_master.CancelGameEntryRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 4; + } + rpc GameEnded(.bnet.protocol.game_master.GameEndedNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 5; + } + rpc PlayerLeft(.bnet.protocol.game_master.PlayerLeftNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 6; + } + rpc RegisterServer(.bnet.protocol.game_master.RegisterServerRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 7; + } + rpc UnregisterServer(.bnet.protocol.game_master.UnregisterServerRequest) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 8; + } + rpc RegisterUtilities(.bnet.protocol.game_master.RegisterUtilitiesRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 9; + } + rpc UnregisterUtilities(.bnet.protocol.game_master.UnregisterUtilitiesRequest) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 10; + } + rpc Subscribe(.bnet.protocol.game_master.SubscribeRequest) returns(.bnet.protocol.game_master.SubscribeResponse) + { + option (method_id) = 11; + } + rpc Unsubscribe(.bnet.protocol.game_master.UnsubscribeRequest) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 12; + } + rpc ChangeGame(.bnet.protocol.game_master.ChangeGameRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 13; + } + rpc GetFactoryInfo(.bnet.protocol.game_master.GetFactoryInfoRequest) returns(.bnet.protocol.game_master.GetFactoryInfoResponse) + { + option (method_id) = 14; + } + rpc GetGameStats(.bnet.protocol.game_master.GetGameStatsRequest) returns(.bnet.protocol.game_master.GetGameStatsResponse) + { + option (method_id) = 15; + } +} + +service GameMasterSubscriber +{ + rpc NotifyFactoryUpdate(.bnet.protocol.game_master.FactoryUpdateNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 1; + } +} + +service GameFactorySubscriber +{ + rpc NotifyGameFound(.bnet.protocol.game_master.GameFoundNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 1; + } +} + diff --git a/contrib/protocompiler/definitions/bnet/game_master_types.proto b/contrib/protocompiler/definitions/bnet/game_master_types.proto new file mode 100644 index 00000000..761cbf4a --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/game_master_types.proto @@ -0,0 +1,61 @@ +import "bnet/attribute.proto"; +import "bnet/entity.proto"; + +package bnet.protocol.game_master; + +message Player +{ + enum Type + { + HUMAN = 0; + COMPUTER = 1; + } + + optional .bnet.protocol.game_master.Player.Type type = 1 [default = HUMAN]; + optional .bnet.protocol.Identity identity = 2; + repeated .bnet.protocol.attribute.Attribute attribute = 3; +} + +message ConnectInfo +{ + required .bnet.protocol.EntityId member_id = 1; + required string host = 2; + required int32 port = 3; + optional bytes token = 4; + repeated .bnet.protocol.attribute.Attribute attribute = 5; +} + +message GameStatsBucket +{ + optional float bucket_min = 1 [default = 0]; + optional float bucket_max = 2 [default = 4.2949673e+009]; + optional uint32 wait_milliseconds = 3 [default = 0]; + optional uint32 games_per_hour = 4 [default = 0]; + optional uint32 active_games = 5 [default = 0]; + optional uint32 active_players = 6 [default = 0]; + optional uint32 forming_games = 7 [default = 0]; + optional uint32 waiting_players = 8 [default = 0]; +} + +message GameFactoryDescription +{ + required fixed64 id = 1; + optional string name = 2; + repeated .bnet.protocol.attribute.Attribute attribute = 3; + repeated .bnet.protocol.game_master.GameStatsBucket stats_bucket = 4; + optional fixed64 unseeded_id = 5 [default = 0]; +} + +message GameHandle +{ + required fixed64 factory_id = 1; + required .bnet.protocol.EntityId game_id = 2; +} + +message CancelGameEntryRequest +{ + required fixed64 request_id = 1; + optional fixed64 factory_id = 2; + repeated .bnet.protocol.game_master.Player player = 3; +} + diff --git a/contrib/protocompiler/definitions/bnet/game_utilities_service.proto b/contrib/protocompiler/definitions/bnet/game_utilities_service.proto new file mode 100644 index 00000000..059323b3 --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/game_utilities_service.proto @@ -0,0 +1,111 @@ +import "bnet/game_master_service.proto"; +import "bnet/server_pool_service.proto"; +import "bnet/attribute.proto"; +import "bnet/entity.proto"; +import "bnet/rpc.proto"; + +package bnet.protocol.game_utilities; + +option cc_generic_services = false; + +message ClientRequest +{ + repeated .bnet.protocol.attribute.Attribute attribute = 1; + optional .bnet.protocol.ProcessId host = 2; + optional .bnet.protocol.EntityId bnet_account_id = 3; + optional .bnet.protocol.EntityId game_account_id = 4; +} + +message ClientResponse +{ + repeated .bnet.protocol.attribute.Attribute attribute = 1; +} + +message ServerRequest +{ + repeated .bnet.protocol.attribute.Attribute attribute = 1; + required fixed32 program = 2; + optional .bnet.protocol.ProcessId host = 3; +} + +message ServerResponse +{ + repeated .bnet.protocol.attribute.Attribute attribute = 1; +} + +message PresenceChannelCreatedRequest +{ + required .bnet.protocol.EntityId id = 1; + optional .bnet.protocol.EntityId game_account_id = 3; + optional .bnet.protocol.EntityId bnet_account_id = 4; + optional .bnet.protocol.ProcessId host = 5; +} + +message PlayerVariablesRequest +{ + required .bnet.protocol.EntityId bnet_account_id = 1; + required .bnet.protocol.EntityId game_account_id = 2; + repeated string variable = 4; + optional .bnet.protocol.ProcessId host = 5; +} + +message GameVariablesRequest +{ + repeated .bnet.protocol.attribute.Attribute attribute = 1; + repeated string variable = 2; + optional .bnet.protocol.ProcessId host = 3; +} + +message VariablesResponse +{ + repeated float value = 1 [packed=true]; +} + +message GameAccountOnlineNotification +{ + required .bnet.protocol.EntityId game_account_id = 1; + optional .bnet.protocol.ProcessId host = 2; +} + +message GameAccountOfflineNotification +{ + required .bnet.protocol.EntityId game_account_id = 1; + optional .bnet.protocol.ProcessId host = 2; +} + +service GameUtilities +{ + rpc ProcessClientRequest(.bnet.protocol.game_utilities.ClientRequest) returns(.bnet.protocol.game_utilities.ClientResponse) + { + option (method_id) = 1; + } + rpc PresenceChannelCreated(.bnet.protocol.game_utilities.PresenceChannelCreatedRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 2; + } + rpc GetPlayerVariables(.bnet.protocol.game_utilities.PlayerVariablesRequest) returns(.bnet.protocol.game_utilities.VariablesResponse) + { + option (method_id) = 3; + } + rpc GetGameVariables(.bnet.protocol.game_utilities.GameVariablesRequest) returns(.bnet.protocol.game_utilities.VariablesResponse) + { + option (method_id) = 4; + } + rpc GetLoad(.bnet.protocol.server_pool.GetLoadRequest) returns(.bnet.protocol.server_pool.ServerState) + { + option (method_id) = 5; + } + rpc ProcessServerRequest(.bnet.protocol.game_utilities.ServerRequest) returns(.bnet.protocol.game_utilities.ServerResponse) + { + option (method_id) = 6; + } + rpc NotifyGameAccountOnline(.bnet.protocol.game_utilities.GameAccountOnlineNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 7; + } + rpc NotifyGameAccountOffline(.bnet.protocol.game_utilities.GameAccountOfflineNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 8; + } +} + diff --git a/contrib/protocompiler/definitions/bnet/invitation_types.proto b/contrib/protocompiler/definitions/bnet/invitation_types.proto new file mode 100644 index 00000000..9d1de929 --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/invitation_types.proto @@ -0,0 +1,66 @@ +import "bnet/attribute.proto"; +import "bnet/entity.proto"; + +package bnet.protocol.invitation; + +message Invitation +{ + required fixed64 id = 1; + required .bnet.protocol.Identity inviter_identity = 2; + required .bnet.protocol.Identity invitee_identity = 3; + optional string inviter_name = 4; + optional string invitee_name = 5; + optional string invitation_message = 6; + optional uint64 creation_time = 7; + optional uint64 expiration_time = 8; + extensions 100 to 10000; +} + +message Suggestion +{ + optional .bnet.protocol.EntityId channel_id = 1; + required .bnet.protocol.EntityId suggester_id = 2; + required .bnet.protocol.EntityId suggestee_id = 3; + optional string suggester_name = 4; + optional string suggestee_name = 5; + optional .bnet.protocol.EntityId suggester_account_id = 6; +} + +message InvitationParams +{ + optional string invitation_message = 1; + optional uint64 expiration_time = 2 [default = 0]; + extensions 100 to 10000; +} + +message SendInvitationRequest +{ + optional .bnet.protocol.Identity agent_identity = 1; + required .bnet.protocol.EntityId target_id = 2; + required .bnet.protocol.invitation.InvitationParams params = 3; + optional .bnet.protocol.AccountInfo agent_info = 4; +} + +message SendInvitationResponse +{ + optional .bnet.protocol.invitation.Invitation invitation = 2; +} + +message UpdateInvitationRequest +{ + optional .bnet.protocol.Identity agent_identity = 1; + required fixed64 invitation_id = 2; + required .bnet.protocol.invitation.InvitationParams params = 3; +} + +message GenericRequest +{ + optional .bnet.protocol.EntityId agent_id = 1; + optional .bnet.protocol.EntityId target_id = 2; + required fixed64 invitation_id = 3; + optional string invitee_name = 4; + optional string inviter_name = 5; + repeated uint32 previous_role = 6 [packed=true]; + repeated uint32 desired_role = 7 [packed=true]; +} + diff --git a/contrib/protocompiler/definitions/bnet/locale.proto b/contrib/protocompiler/definitions/bnet/locale.proto new file mode 100644 index 00000000..f4084335 --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/locale.proto @@ -0,0 +1,14 @@ +package bnet.protocol.config; + +message Locale +{ + required string identifier = 1; + required string description = 2; + repeated string flag = 3; +} + +message Locales +{ + repeated .bnet.protocol.config.Locale locale = 1; +} + diff --git a/contrib/protocompiler/definitions/bnet/notification_service.proto b/contrib/protocompiler/definitions/bnet/notification_service.proto new file mode 100644 index 00000000..8780ee24 --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/notification_service.proto @@ -0,0 +1,72 @@ +import "bnet/attribute.proto"; +import "bnet/entity.proto"; +import "bnet/rpc.proto"; + +package bnet.protocol.notification; + +option cc_generic_services = false; + +message Notification +{ + optional .bnet.protocol.EntityId sender_id = 1; + required .bnet.protocol.EntityId target_id = 2; + required string type = 3; + repeated .bnet.protocol.attribute.Attribute attribute = 4; + optional .bnet.protocol.EntityId sender_account_id = 5; + optional .bnet.protocol.EntityId target_account_id = 6; + optional string sender_battle_tag = 7; +} + +message FindClientRequest +{ + required .bnet.protocol.EntityId entity_id = 1; +} + +message FindClientResponse +{ + required uint32 label = 1; + optional .bnet.protocol.ProcessId client_process_id = 2; +} + +message RegisterClientRequest +{ + required .bnet.protocol.EntityId entity_id = 1; +} + +message UnregisterClientRequest +{ + required .bnet.protocol.EntityId entity_id = 1; +} + +service NotificationService +{ + rpc SendNotification(.bnet.protocol.notification.Notification) returns(.bnet.protocol.NoData) + { + option (method_id) = 1; + } + rpc RegisterClient(.bnet.protocol.notification.RegisterClientRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 2; + } + rpc UnregisterClient(.bnet.protocol.notification.UnregisterClientRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 3; + } + rpc FindClient(.bnet.protocol.notification.FindClientRequest) returns(.bnet.protocol.notification.FindClientResponse) + { + option (method_id) = 4; + } +} + +service NotificationListener +{ + rpc OnNotificationReceived(.bnet.protocol.notification.Notification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 1; + } + rpc OnNotificationSent(.bnet.protocol.notification.Notification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 2; + } +} + diff --git a/contrib/protocompiler/definitions/bnet/presence_service.proto b/contrib/protocompiler/definitions/bnet/presence_service.proto new file mode 100644 index 00000000..4862e28c --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/presence_service.proto @@ -0,0 +1,82 @@ +import "bnet/attribute.proto"; +import "bnet/entity.proto"; +import "bnet/rpc.proto"; +import "bnet/presence_types.proto"; + +package bnet.protocol.presence; + +option cc_generic_services = false; + +message SubscribeRequest +{ + optional .bnet.protocol.EntityId agent_id = 1; + required .bnet.protocol.EntityId entity_id = 2; + required uint64 object_id = 3; +} + +message SubscribeNotificationRequest +{ + required .bnet.protocol.EntityId entity_id = 1; +} + +message UnsubscribeRequest +{ + optional .bnet.protocol.EntityId agent_id = 1; + required .bnet.protocol.EntityId entity_id = 2; +} + +message UpdateRequest +{ + required .bnet.protocol.EntityId entity_id = 1; + repeated .bnet.protocol.presence.FieldOperation field_operation = 2; +} + +message QueryRequest +{ + required .bnet.protocol.EntityId entity_id = 1; + repeated .bnet.protocol.presence.FieldKey key = 2; +} + +message QueryResponse +{ + repeated .bnet.protocol.presence.Field field = 2; +} + +message OwnershipRequest +{ + required .bnet.protocol.EntityId entity_id = 1; + optional bool release_ownership = 2 [default = false]; +} + +service PresenceService +{ + rpc Subscribe(.bnet.protocol.presence.SubscribeRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 1; + } + rpc Unsubscribe(.bnet.protocol.presence.UnsubscribeRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 2; + } + rpc Update(.bnet.protocol.presence.UpdateRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 3; + } + rpc Query(.bnet.protocol.presence.QueryRequest) returns(.bnet.protocol.presence.QueryResponse) + { + option (method_id) = 4; + } + rpc Ownership(.bnet.protocol.presence.OwnershipRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 5; + } + rpc Heal(.bnet.protocol.presence.UpdateRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 6; + } + rpc SubscribeNotification(.bnet.protocol.presence.SubscribeNotificationRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 7; + } +} + diff --git a/contrib/protocompiler/definitions/bnet/presence_types.proto b/contrib/protocompiler/definitions/bnet/presence_types.proto new file mode 100644 index 00000000..a3645ee9 --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/presence_types.proto @@ -0,0 +1,50 @@ +import "bnet/attribute.proto"; +import "bnet/entity.proto"; +import "bnet/channel_types.proto"; + +package bnet.protocol.presence; + +message RichPresence +{ + required fixed32 program_id = 1; + required fixed32 stream_id = 2; + required uint32 index = 3; +} + +message FieldKey +{ + required uint32 program = 1; + required uint32 group = 2; + required uint32 field = 3; + optional uint64 index = 4 [default = 0]; +} + +message Field +{ + required .bnet.protocol.presence.FieldKey key = 1; + required .bnet.protocol.attribute.Variant value = 2; +} + +message FieldOperation +{ + enum OperationType + { + SET = 0; + CLEAR = 1; + } + + required .bnet.protocol.presence.Field field = 1; + optional .bnet.protocol.presence.FieldOperation.OperationType operation = 2 [default = SET]; +} + +message ChannelState +{ + optional .bnet.protocol.EntityId entity_id = 1; + repeated .bnet.protocol.presence.FieldOperation field_operation = 2; + optional bool healing = 3 [default = false]; + extend .bnet.protocol.channel.ChannelState + { + optional .bnet.protocol.presence.ChannelState presence = 101; + } +} + diff --git a/contrib/protocompiler/definitions/bnet/profanity.proto b/contrib/protocompiler/definitions/bnet/profanity.proto new file mode 100644 index 00000000..4f074cf9 --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/profanity.proto @@ -0,0 +1,13 @@ +package bnet.protocol.profanity; + +message WordFilter +{ + required string type = 1; + required string regex = 2; +} + +message WordFilters +{ + repeated .bnet.protocol.profanity.WordFilter filters = 1; +} + diff --git a/contrib/protocompiler/definitions/bnet/report_service.proto b/contrib/protocompiler/definitions/bnet/report_service.proto new file mode 100644 index 00000000..855f605d --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/report_service.proto @@ -0,0 +1,31 @@ +import "bnet/attribute.proto"; +import "bnet/entity.proto"; +import "bnet/rpc.proto"; + +package bnet.protocol.report; + +option cc_generic_services = false; + +message Report +{ + required string report_type = 1; + repeated .bnet.protocol.attribute.Attribute attribute = 2; + optional int32 report_qos = 3 [default = 0]; + optional .bnet.protocol.EntityId reporting_account = 4; + optional .bnet.protocol.EntityId reporting_game_account = 5; + optional fixed64 report_timestamp = 6; +} + +message SendReportRequest +{ + required .bnet.protocol.report.Report report = 1; +} + +service ReportService +{ + rpc SendReport(.bnet.protocol.report.SendReportRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 1; + } +} + diff --git a/contrib/protocompiler/definitions/bnet/resource_service.proto b/contrib/protocompiler/definitions/bnet/resource_service.proto new file mode 100644 index 00000000..18b835b0 --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/resource_service.proto @@ -0,0 +1,22 @@ +import "bnet/content_handle.proto"; +import "bnet/rpc.proto"; + +package bnet.protocol.resources; + +option cc_generic_services = false; + +message ContentHandleRequest +{ + required fixed32 program_id = 1; + required fixed32 stream_id = 2; + optional fixed32 locale = 3 [default = 1701729619]; +} + +service Resources +{ + rpc GetContentHandle(.bnet.protocol.resources.ContentHandleRequest) returns(.bnet.protocol.ContentHandle) + { + option (method_id) = 1; + } +} + diff --git a/contrib/protocompiler/definitions/bnet/resource_types.proto b/contrib/protocompiler/definitions/bnet/resource_types.proto new file mode 100644 index 00000000..6144396b --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/resource_types.proto @@ -0,0 +1,35 @@ +import "bnet/content_handle.proto"; +import "bnet/attribute.proto"; + +package bnet.protocol; + +message Payload +{ + required string content_handle = 1; + required uint32 data_size = 2; + repeated .bnet.protocol.attribute.Attribute custom = 3; +} + +message Dependency +{ + required string resource_handle = 1; + repeated .bnet.protocol.attribute.Attribute custom = 2; +} + +message Metadata +{ + repeated .bnet.protocol.Dependency dependency = 1; + repeated .bnet.protocol.Payload payload = 2; +} + +message IndexEntry +{ + required string name = 1; + required string url = 2; +} + +message ResourceIndex +{ + repeated .bnet.protocol.IndexEntry entry = 1; +} + diff --git a/contrib/protocompiler/definitions/bnet/role_set.proto b/contrib/protocompiler/definitions/bnet/role_set.proto new file mode 100644 index 00000000..eb64f102 --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/role_set.proto @@ -0,0 +1,39 @@ +import "bnet/attribute.proto"; + +package bnet.protocol; + +message Privilege +{ + required string name = 1; + required uint32 value = 2; +} + +message RoleSetConfig +{ + repeated .bnet.protocol.Privilege privilege = 1; + required .bnet.protocol.RoleSet role_set = 2; +} + +message Role +{ + required uint32 id = 1; + required string name = 2; + repeated string privilege = 3; + repeated uint32 assignable_role = 4 [packed=true]; + optional bool required = 5 [default = false]; + optional bool unique = 6 [default = false]; + optional uint32 relegation_role = 7; + repeated .bnet.protocol.attribute.Attribute attribute = 8; +} + +message RoleSet +{ + required string program = 1; + required string service = 2; + optional string subtype = 3 [default = "default"]; + repeated .bnet.protocol.Role role = 4; + repeated uint32 default_role = 5 [packed=true]; + optional int32 max_members = 6; + repeated .bnet.protocol.attribute.Attribute attribute = 7; +} + diff --git a/contrib/protocompiler/definitions/bnet/rpc.proto b/contrib/protocompiler/definitions/bnet/rpc.proto new file mode 100644 index 00000000..59580610 --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/rpc.proto @@ -0,0 +1,54 @@ +import "google/protobuf/descriptor.proto"; + +package bnet.protocol; + +message NO_RESPONSE +{ +} + +message Address +{ + required string address = 1; + optional uint32 port = 2; +} + +message ProcessId +{ + required uint32 label = 1; + required uint32 epoch = 2; +} + +message ObjectAddress +{ + required .bnet.protocol.ProcessId host = 1; + optional uint64 object_id = 2 [default = 0]; +} + +message NoData +{ +} + +message ErrorInfo +{ + required .bnet.protocol.ObjectAddress object_address = 1; + required uint32 status = 2; + required uint32 service_hash = 3; + required uint32 method_id = 4; +} + +message Header +{ + required uint32 service_id = 1; + optional uint32 method_id = 2; + required uint32 token = 3; + optional uint64 object_id = 4 [default = 0]; + optional uint32 size = 5 [default = 0]; + optional uint32 status = 6 [default = 0]; + repeated .bnet.protocol.ErrorInfo error = 7; +} + +extend .google.protobuf.MethodOptions +{ + optional uint32 method_id = 50000; +} + diff --git a/contrib/protocompiler/definitions/bnet/rpc_config.proto b/contrib/protocompiler/definitions/bnet/rpc_config.proto new file mode 100644 index 00000000..c8981d7f --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/rpc_config.proto @@ -0,0 +1,28 @@ +import "bnet/rpc.proto"; + +package bnet.protocol.config; + +message RPCMethodConfig +{ + optional string service_name = 1; + optional string method_name = 2; + optional uint32 fixed_call_cost = 3 [default = 1]; + optional uint32 fixed_packet_size = 4 [default = 0]; + optional float variable_multiplier = 5 [default = 0]; + optional float multiplier = 6 [default = 1]; + optional uint32 rate_limit_count = 7; + optional uint32 rate_limit_seconds = 8; + optional uint32 max_packet_size = 9; + optional uint32 max_encoded_size = 10; + optional float timeout = 11; +} + +message RPCMeterConfig +{ + repeated .bnet.protocol.config.RPCMethodConfig method = 1; + optional uint32 income_per_second = 2 [default = 1]; + optional uint32 initial_balance = 3; + optional uint32 cap_balance = 4; + optional float startup_period = 5 [default = 0]; +} + diff --git a/contrib/protocompiler/definitions/bnet/search_service.proto b/contrib/protocompiler/definitions/bnet/search_service.proto new file mode 100644 index 00000000..879ec3bd --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/search_service.proto @@ -0,0 +1,71 @@ +import "bnet/rpc.proto"; +import "bnet/search_types.proto"; + +package bnet.protocol.search; + +option cc_generic_services = false; + +message FindMatchesRequest +{ + required string universe = 1; + repeated .bnet.protocol.search.Filter filters = 2; + optional uint32 starting_index = 3 [default = 0]; + optional uint32 count = 4 [default = 0]; +} + +message FindMatchesResponse +{ + required uint32 total_count_capped = 1; + repeated .bnet.protocol.search.Object objects = 2; + optional uint32 total_count_uncapped = 3; +} + +message SetObjectRequest +{ + repeated .bnet.protocol.search.Object objects = 1; +} + +message RemoveObjectsRequest +{ + required bytes start_id = 1; + required bytes end_id = 2; +} + +message IndexBlacklistConfig +{ + repeated uint64 index = 1; +} + +message SearchConfig +{ + optional .bnet.protocol.search.IndexBlacklistConfig index_blacklist = 1; +} + +message SearchUniverseLicenseConfig +{ + required string universe = 1; + optional uint32 search_enabled_license = 2 [default = 0]; + optional uint32 search_disabled_license = 3 [default = 0]; +} + +message SearchLicenseConfig +{ + repeated .bnet.protocol.search.SearchUniverseLicenseConfig universe_licenses = 1; +} + +service SearchService +{ + rpc FindMatches(.bnet.protocol.search.FindMatchesRequest) returns(.bnet.protocol.search.FindMatchesResponse) + { + option (method_id) = 1; + } + rpc SetObject(.bnet.protocol.search.SetObjectRequest) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 2; + } + rpc RemoveObjects(.bnet.protocol.search.RemoveObjectsRequest) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 3; + } +} + diff --git a/contrib/protocompiler/definitions/bnet/search_types.proto b/contrib/protocompiler/definitions/bnet/search_types.proto new file mode 100644 index 00000000..12e08832 --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/search_types.proto @@ -0,0 +1,37 @@ +package bnet.protocol.search; + +message Statistic +{ + optional uint64 id = 1 [default = 0]; + required int32 value = 2; +} + +message Filter +{ + enum Comparand + { + EQUALS = 0; + LESS_THAN = 1; + LESS_THAN_OR_EQUALS = 2; + GREATER_THAN = 3; + GREATER_THAN_OR_EQUALS = 4; + } + + enum SortDirection + { + ASC = 0; + DESC = 1; + } + + required .bnet.protocol.search.Statistic statistic = 1; + required .bnet.protocol.search.Filter.Comparand comparand = 2; + optional .bnet.protocol.search.Filter.SortDirection sort_direction = 3 [default = ASC]; +} + +message Object +{ + required bytes id = 1; + optional bytes data = 2; + repeated .bnet.protocol.search.Statistic statistics = 3; +} + diff --git a/contrib/protocompiler/definitions/bnet/server_pool_service.proto b/contrib/protocompiler/definitions/bnet/server_pool_service.proto new file mode 100644 index 00000000..4b9e3c6c --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/server_pool_service.proto @@ -0,0 +1,44 @@ +import "bnet/attribute.proto"; +import "bnet/rpc.proto"; + +package bnet.protocol.server_pool; + +option cc_generic_services = false; + +message GetLoadRequest +{ +} + +message ServerState +{ + optional float current_load = 1 [default = 1]; + optional uint32 game_count = 2 [default = 0]; + optional uint32 player_count = 3 [default = 0]; +} + +message ServerInfo +{ + required .bnet.protocol.ProcessId host = 1; + optional bool replace = 2 [default = false]; + optional .bnet.protocol.server_pool.ServerState state = 3; + repeated .bnet.protocol.attribute.Attribute attribute = 4; + optional fixed32 program_id = 5; +} + +message PoolStateRequest +{ +} + +message PoolStateResponse +{ + repeated .bnet.protocol.server_pool.ServerInfo info = 1; +} + +service ServerPoolService +{ + rpc GetPoolState(.bnet.protocol.server_pool.PoolStateRequest) returns(.bnet.protocol.server_pool.PoolStateResponse) + { + option (method_id) = 1; + } +} + diff --git a/contrib/protocompiler/definitions/bnet/session_service.proto b/contrib/protocompiler/definitions/bnet/session_service.proto new file mode 100644 index 00000000..f0f4d233 --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/session_service.proto @@ -0,0 +1,27 @@ +import "bnet/attribute.proto"; +import "bnet/rpc.proto"; +import "bnet/entity.proto"; + +package bnet.protocol.session; + +option cc_generic_services = false; + +message SessionNotification +{ + required uint32 session_type = 1; + optional fixed64 expiration_timestamp = 2; + optional uint32 minutes_remaining = 3; + optional uint32 cais_played_minutes = 4; + optional uint32 cais_rested_minutes = 5; + optional bool benefactor = 6; + optional uint32 billing_minutes_remaining = 7; +} + +service SessionNotify +{ + rpc Update(.bnet.protocol.session.SessionNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 1; + } +} + diff --git a/contrib/protocompiler/definitions/bnet/user_manager_service.proto b/contrib/protocompiler/definitions/bnet/user_manager_service.proto new file mode 100644 index 00000000..058da05c --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/user_manager_service.proto @@ -0,0 +1,125 @@ +import "bnet/user_manager_types.proto"; +import "bnet/entity.proto"; +import "bnet/role_set.proto"; +import "bnet/rpc.proto"; + +package bnet.protocol.user_manager; + +option cc_generic_services = false; + +message SubscribeToUserManagerRequest +{ + optional .bnet.protocol.EntityId agent_id = 1; + required uint64 object_id = 2; +} + +message SubscribeToUserManagerResponse +{ + repeated .bnet.protocol.user_manager.BlockedEntity blocked_entities = 1; + repeated .bnet.protocol.user_manager.RecentPlayer recent_players = 2; + repeated .bnet.protocol.Role role = 3; +} + +message AddRecentPlayersRequest +{ + repeated .bnet.protocol.user_manager.RecentPlayer players = 1; +} + +message AddRecentPlayersResponse +{ + repeated .bnet.protocol.user_manager.RecentPlayer players_added = 1; + repeated fixed32 players_removed = 3; +} + +message ClearRecentPlayersResponse +{ + repeated fixed32 players_removed = 1; +} + +message BlockEntityRequest +{ + optional .bnet.protocol.EntityId agent_id = 1; + required .bnet.protocol.EntityId target_id = 2; + optional uint32 role = 3; +} + +message UnblockEntityRequest +{ + optional .bnet.protocol.EntityId agent_id = 1; + required .bnet.protocol.EntityId target_id = 2; +} + +message EntityBlockedNotification +{ + required .bnet.protocol.user_manager.BlockedEntity blocked_entity = 1; + optional .bnet.protocol.EntityId game_account_id = 2; +} + +message EntityUnblockedNotification +{ + required .bnet.protocol.user_manager.BlockedEntity unblocked_entity = 1; + optional .bnet.protocol.EntityId game_account_id = 2; +} + +message RecentPlayersAddedNotification +{ + repeated .bnet.protocol.user_manager.RecentPlayer added_players = 1; +} + +message RecentPlayersRemovedNotification +{ + repeated .bnet.protocol.user_manager.RecentPlayer removed_players = 1; +} + +service UserManagerService +{ + rpc SubscribeToUserManager(.bnet.protocol.user_manager.SubscribeToUserManagerRequest) returns(.bnet.protocol.user_manager.SubscribeToUserManagerResponse) + { + option (method_id) = 1; + } + rpc AddRecentPlayers(.bnet.protocol.user_manager.AddRecentPlayersRequest) returns(.bnet.protocol.user_manager.AddRecentPlayersResponse) + { + option (method_id) = 10; + } + rpc ClearRecentPlayers(.bnet.protocol.NoData) returns(.bnet.protocol.user_manager.ClearRecentPlayersResponse) + { + option (method_id) = 11; + } + rpc BlockEntity(.bnet.protocol.user_manager.BlockEntityRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 20; + } + rpc UnblockEntity(.bnet.protocol.user_manager.UnblockEntityRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 21; + } + rpc BlockEntityForSession(.bnet.protocol.user_manager.BlockEntityRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 40; + } + rpc LoadBlockList(.bnet.protocol.EntityId) returns(.bnet.protocol.NoData) + { + option (method_id) = 50; + } +} + +service UserManagerNotify +{ + rpc NotifyEntityBlocked(.bnet.protocol.user_manager.EntityBlockedNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 1; + } + rpc NotifyEntityUnblocked(.bnet.protocol.user_manager.EntityUnblockedNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 2; + } + rpc NotifyRecentPlayersAdded(.bnet.protocol.user_manager.RecentPlayersAddedNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 11; + } + rpc NotifyRecentPlayersRemoved(.bnet.protocol.user_manager.RecentPlayersRemovedNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 12; + } +} + diff --git a/contrib/protocompiler/definitions/bnet/user_manager_types.proto b/contrib/protocompiler/definitions/bnet/user_manager_types.proto new file mode 100644 index 00000000..cdacdbda --- /dev/null +++ b/contrib/protocompiler/definitions/bnet/user_manager_types.proto @@ -0,0 +1,23 @@ +import "bnet/entity.proto"; +import "bnet/attribute.proto"; + +package bnet.protocol.user_manager; + +message RecentPlayer +{ + required .bnet.protocol.EntityId entity = 1; + optional string program_id = 2; + optional fixed64 timestamp_played = 3; + repeated .bnet.protocol.attribute.Attribute attributes = 4; + optional fixed32 id = 5 [default = 0]; + optional fixed32 counter = 6 [default = 0]; +} + +message BlockedEntity +{ + required .bnet.protocol.EntityId id = 1; + optional string name = 2; + repeated uint32 role = 3 [packed=true]; + optional uint64 privileges = 4 [default = 0]; +} + diff --git a/contrib/protocompiler/definitions/google/protobuf/csharp_options.proto b/contrib/protocompiler/definitions/google/protobuf/csharp_options.proto new file mode 100644 index 00000000..a4460546 --- /dev/null +++ b/contrib/protocompiler/definitions/google/protobuf/csharp_options.proto @@ -0,0 +1,73 @@ +// Extra options for C# generator + +import "google/protobuf/descriptor.proto"; + +package google.protobuf; + +message CSharpFileOptions { + + // Namespace for generated classes; defaults to the package. + optional string namespace = 1; + + // Name of the "umbrella" class used for metadata about all + // the messages within this file. Default is based on the name + // of the file. + optional string umbrella_classname = 2; + + // Whether classes should be public (true) or internal (false) + optional bool public_classes = 3 [default = true]; + + // Whether to generate a single file for everything within the + // .proto file (false), or one file per message (true). + // This option is not currently honored; please log a feature + // request if you really want it. + optional bool multiple_files = 4; + + // Whether to nest messages within a single umbrella class (true) + // or create the umbrella class as a peer, with messages as + // top-level classes in the namespace (false) + optional bool nest_classes = 5; + + // Generate appropriate support for Code Contracts + // (Ongoing; support should improve over time) + optional bool code_contracts = 6; + + // Create subdirectories for namespaces, e.g. namespace "Foo.Bar" + // would generate files within [output directory]/Foo/Bar + optional bool expand_namespace_directories = 7; + + // Generate attributes indicating non-CLS-compliance + optional bool cls_compliance = 8 [default = true]; + + // The extension that should be appended to the umbrella_classname when creating files. + optional string file_extension = 221 [default = ".cs"]; + + // A nested namespace for the umbrella class. Helpful for name collisions caused by + // umbrella_classname conflicting with an existing type. This will be automatically + // set to 'Proto' if a collision is detected with types being generated. This value + // is ignored when nest_classes == true + optional string umbrella_namespace = 222; + + // The output path for the source file(s) generated + optional string output_directory = 223 [default = "."]; + + // Will ignore the type generations and remove dependencies for the descriptor proto + // files that declare their package to be "google.protobuf" + optional bool ignore_google_protobuf = 224 [default = false]; +} + +extend FileOptions { + optional CSharpFileOptions csharp_file_options = 1000; +} + +extend FieldOptions { + optional CSharpFieldOptions csharp_field_options = 1000; +} + +message CSharpFieldOptions { + // Provides the ability to override the name of the property + // generated for this field. This is applied to all properties + // and methods to do with this field, including HasFoo, FooCount, + // FooList etc. + optional string property_name = 1; +} \ No newline at end of file diff --git a/contrib/protocompiler/definitions/google/protobuf/descriptor.proto b/contrib/protocompiler/definitions/google/protobuf/descriptor.proto new file mode 100644 index 00000000..4d689483 --- /dev/null +++ b/contrib/protocompiler/definitions/google/protobuf/descriptor.proto @@ -0,0 +1,195 @@ +package google.protobuf; + +option java_package = "com.google.protobuf"; +option java_outer_classname = "DescriptorProtos"; +option optimize_for = SPEED; + +message FileDescriptorSet +{ + repeated .google.protobuf.FileDescriptorProto file = 1; +} + +message FileDescriptorProto +{ + optional string name = 1; + optional string package = 2; + repeated string dependency = 3; + repeated .google.protobuf.DescriptorProto message_type = 4; + repeated .google.protobuf.EnumDescriptorProto enum_type = 5; + repeated .google.protobuf.ServiceDescriptorProto service = 6; + repeated .google.protobuf.FieldDescriptorProto extension = 7; + optional .google.protobuf.FileOptions options = 8; +} + +message DescriptorProto +{ + message ExtensionRange + { + optional int32 start = 1; + optional int32 end = 2; + } + + optional string name = 1; + repeated .google.protobuf.FieldDescriptorProto field = 2; + repeated .google.protobuf.FieldDescriptorProto extension = 6; + repeated .google.protobuf.DescriptorProto nested_type = 3; + repeated .google.protobuf.EnumDescriptorProto enum_type = 4; + repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; + optional .google.protobuf.MessageOptions options = 7; +} + +message FieldDescriptorProto +{ + enum Type + { + TYPE_DOUBLE = 1; + TYPE_FLOAT = 2; + TYPE_INT64 = 3; + TYPE_UINT64 = 4; + TYPE_INT32 = 5; + TYPE_FIXED64 = 6; + TYPE_FIXED32 = 7; + TYPE_BOOL = 8; + TYPE_STRING = 9; + TYPE_GROUP = 10; + TYPE_MESSAGE = 11; + TYPE_BYTES = 12; + TYPE_UINT32 = 13; + TYPE_ENUM = 14; + TYPE_SFIXED32 = 15; + TYPE_SFIXED64 = 16; + TYPE_SINT32 = 17; + TYPE_SINT64 = 18; + } + + enum Label + { + LABEL_OPTIONAL = 1; + LABEL_REQUIRED = 2; + LABEL_REPEATED = 3; + } + + optional string name = 1; + optional int32 number = 3; + optional .google.protobuf.FieldDescriptorProto.Label label = 4; + optional .google.protobuf.FieldDescriptorProto.Type type = 5; + optional string type_name = 6; + optional string extendee = 2; + optional string default_value = 7; + optional .google.protobuf.FieldOptions options = 8; +} + +message EnumDescriptorProto +{ + optional string name = 1; + repeated .google.protobuf.EnumValueDescriptorProto value = 2; + optional .google.protobuf.EnumOptions options = 3; +} + +message EnumValueDescriptorProto +{ + optional string name = 1; + optional int32 number = 2; + optional .google.protobuf.EnumValueOptions options = 3; +} + +message ServiceDescriptorProto +{ + optional string name = 1; + repeated .google.protobuf.MethodDescriptorProto method = 2; + optional .google.protobuf.ServiceOptions options = 3; +} + +message MethodDescriptorProto +{ + optional string name = 1; + optional string input_type = 2; + optional string output_type = 3; + optional .google.protobuf.MethodOptions options = 4; +} + +message FileOptions +{ + enum OptimizeMode + { + SPEED = 1; + CODE_SIZE = 2; + LITE_RUNTIME = 3; + } + + optional string java_package = 1; + optional string java_outer_classname = 8; + optional bool java_multiple_files = 10 [default = false]; + optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; + optional bool cc_generic_services = 16 [default = true]; + optional bool java_generic_services = 17 [default = true]; + optional bool py_generic_services = 18 [default = true]; + repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + extensions 1000 to max; +} + +message MessageOptions +{ + optional bool message_set_wire_format = 1 [default = false]; + optional bool no_standard_descriptor_accessor = 2 [default = false]; + repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + extensions 1000 to max; +} + +message FieldOptions +{ + enum CType + { + STRING = 0; + CORD = 1; + STRING_PIECE = 2; + } + + optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; + optional bool packed = 2; + optional bool deprecated = 3 [default = false]; + optional string experimental_map_key = 9; + repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + extensions 1000 to max; +} + +message EnumOptions +{ + repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + extensions 1000 to max; +} + +message EnumValueOptions +{ + repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + extensions 1000 to max; +} + +message ServiceOptions +{ + repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + extensions 1000 to max; +} + +message MethodOptions +{ + repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + extensions 1000 to max; +} + +message UninterpretedOption +{ + message NamePart + { + required string name_part = 1; + required bool is_extension = 2; + } + + repeated .google.protobuf.UninterpretedOption.NamePart name = 2; + optional string identifier_value = 3; + optional uint64 positive_int_value = 4; + optional int64 negative_int_value = 5; + optional double double_value = 6; + optional bytes string_value = 7; +} + diff --git a/contrib/protocompiler/generate.bat b/contrib/protocompiler/generate.bat new file mode 100644 index 00000000..242aa24f --- /dev/null +++ b/contrib/protocompiler/generate.bat @@ -0,0 +1,74 @@ +@ECHO Have you made the following changes: +@ECHO QuestProto.QuestReward - 'item' ^> 'item_granted' +@ECHO HeroProto.QuestHistoryList - 'quest_history' ^> 'history' +@ECHO HeroProto.QuestRewardHistoryList - 'quest_reward_history' ^> 'reward_history' +@ECHO AuctionHouseProto.Escrow - 'item' ^> 'auction_item' + +@CHOICE /C:YN +@IF ERRORLEVEL 2 goto :end + +CD definitions +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\rpc_config.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\profanity.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\attribute.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\content_handle.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\entity.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\exchange.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\exchange_object_provider_types.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\exchange_risk_types.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\invitation_types.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\resource_types.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\rpc.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\connection_service.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\account_types.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\achievements_service.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\achievements_static_data.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\authentication_service.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\challenge_service.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\channel_invitation.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\channel_invitation_types.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\channel_owner.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\channel_service.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\channel_types.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\chat_types.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\exchange_service.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\field_options.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\exchange_types.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\friends_service.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\friends_types.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\game_factory.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\game_master_service.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\game_master_types.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\game_utilities_service.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\locale.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\notification_service.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\presence_service.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\presence_types.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\report_service.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\resource_service.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\role_set.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\search_service.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\search_types.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\server_pool_service.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\session_service.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\user_manager_service.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ bnet\user_manager_types.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ Account.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ AttributeSerializer.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ AuctionHouse.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ CS.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ GameMessage.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ GBHandle.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ Hero.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ Hireling.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ ItemCrafting.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ Items.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ OnlineService.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ PartyMessage.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ Profile.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ Quest.proto +"../compilers/protogen_csharp.exe" --proto_path=./ --include_imports -expand_namespace_directories=true -cls_compliance=false -ignore_google_protobuf=true -service_generator_type=GENERIC -output_directory=../bin/csharp/ Settings.proto + +pause + +:end diff --git a/contrib/web/lib/LibMooege.php b/contrib/web/lib/LibMooege.php new file mode 100644 index 00000000..5bd77f2a --- /dev/null +++ b/contrib/web/lib/LibMooege.php @@ -0,0 +1,327 @@ +servicesAddress="$address:$port"; + $this->CreateSOAPClients($default_timeout); + } + + /** + * Creates soap-clients used for communicating mooege web-services. + */ + private function CreateSOAPClients($timeout) + { + try + { + $this->core = new SoapClient($this->servicesAddress.'/Core?wsdl', array( + 'connection_timeout' => $timeout)); + + $this->moonet = new SoapClient($this->servicesAddress.'/MooNet?wsdl', array( + 'connection_timeout' => $timeout)); + + $this->gameserver = new SoapClient($this->servicesAddress.'/GS?wsdl', array( + 'connection_timeout' => $timeout)); + + $this->accounts = new SoapClient($this->servicesAddress.'/Accounts?wsdl', array( + 'connection_timeout' => $timeout)); + + $this->connected=true; + } + catch(Exception $e) + { + $this->connected=false; + } + } + + /** + * Returns mooege version. + * @return type string + */ + public function Version() + { + if(!$this->connected) + return "N/A"; + + try { + $response=$this->core->Version(); + } + catch(Exception $e) { + return "N/A"; + } + + return $response->VersionResult; + } + /** + * Returns uptime statistics for mooege. + * @return type string + */ + public function Uptime() + { + if(!$this->connected) + return "N/A"; + + try { + $response=$this->core->Uptime(); + } + catch(Exception $e) { + return "N/A"; + } + + return $response->UptimeResult; + } + + /** + * Returns true if MooNet is online. + * @return type bool + */ + public function IsMooNetServerOnline() + { + if(!$this->connected) + return false; + + try { + $response=$this->moonet->Ping(); + } + catch(Exception $e) { + return false; + } + + return $response->PingResult; + } + + /** + * Returns count of online players. + * @return type int + */ + public function OnlinePlayerCount() + { + if(!$this->connected) + return -1; + + try { + $response = $this->moonet->OnlinePlayersCount(); + } + catch(Exception $e) { + return -1; + } + + return $response->OnlinePlayersCountResult; + } + + /** + * Returns list of online players. + * @return type array. + */ + public function OnlinePlayersList() + { + if(!$this->connected) + return array(); + + try { + $response = $this->moonet->OnlinePlayersList(); + } + catch(Exception $e) { + return array(); + } + + if(property_exists($response->OnlinePlayersListResult, "string")) + return $response->OnlinePlayersListResult->string; + else + return $response->OnlinePlayersListResult; + } + + /** + * Returns true if game-server is online. + * @return type bool + */ + public function IsGameServerOnline() + { + if(!$this->connected) + return false; + + try { + $response=$this->gameserver->Ping(); + } + catch(Exception $e) { + return false; + } + + return $response->PingResult; + } + + /** + * Creates a new account over mooege database. + * Returns true if the call was successful, false otherwhise. + * @param type $email + * @param type $password + * @return type bool + */ + public function CreateAccount($email, $password, $battleTag) + { + if(!$this->connected) + return false; + + try { + $response=$this->accounts->CreateAccount(array('email' => $email, 'password' => $password, 'battleTag' => $battleTag)); + } + catch(Exception $e) { + return false; + } + + return $response->CreateAccountResult; + } + + public function ChangePassword($email, $password) + { + if(!$this->connected) + return false; + + return $response=$this->accounts->ChangePassword(array('email' => $email, 'password' => $password)); + } + + /** + * Returns true if an account exists for given email address, false otherwise. + * @param type $email + * @return type bool + */ + public function AccountExists($email) + { + if(!$this->connected) + return false; + + try { + $response=$this->accounts->AccountExists(array('email' => $email)); + } + catch(Exception $e) { + return false; + } + + return $response->AccountExistsResult; + } + + /** + * Returns true if password is correct, false otherwise. + * @param type $email + * @param type $password + * @return type bool + */ + public function VerifyPassword($email, $password) + { + if(!$this->connected) + return false; + + try { + $response=$this->accounts->VerifyPassword(array('email' => $email, 'password' => $password)); + } + catch(Exception $e) { + return false; + } + + return $response->VerifyPasswordResult; + } + + /** + * Returns count of total accounts. + * @return type int + */ + public function TotalAccounts() + { + if(!$this->connected) + return -1; + + try { + $response = $this->accounts->TotalAccounts(); + } + catch(Exception $e) { + return -1; + } + + return $response->TotalAccountsResult; + } + + /** + * Returns count of total toons. + * @return type int + */ + public function TotalToons() + { + if(!$this->connected) + return -1; + + try { + $response = $this->accounts->TotalToons(); + } + catch(Exception $e) { + return -1; + } + + return $response->TotalToonsResult; + } +} +?> \ No newline at end of file diff --git a/contrib/web/lib/debug.php b/contrib/web/lib/debug.php new file mode 100644 index 00000000..16e97393 --- /dev/null +++ b/contrib/web/lib/debug.php @@ -0,0 +1,62 @@ +CreateAccount("debug@","12345678"); + $exists=$mooege->AccountExists("debug@"); + $verified=$mooege->VerifyPassword("debug@","12345678"); +?> + connected):?> + Connected to servicesAddress?>. +
    +
  • Create account: debug@:12345678 [TrueFalse]
  • +
  • Account Exists: debug@ [TrueFalse]
  • +
  • Verify Password: 12345678 [TrueFalse]
  • +
+ + Not connected to mooege web-services! + + + + + + + + + + + +
ServiceQueryResult
CoreVersionVersion()?>
CoreUptimeUptime()?>
MooNetIsMooNetServerOnlineIsMooNetServerOnline()?>
MooNetTotalAccountsTotalAccounts()?>
MooNetTotalToonsTotalToons()?>
MooNetOnlinePlayerCountOnlinePlayerCount()?>
MooNetOnlinePlayersListOnlinePlayersList())?>
GameServerIsGameServerOnlineIsGameServerOnline()?>
+ \ No newline at end of file diff --git a/contrib/web/login.php b/contrib/web/login.php new file mode 100644 index 00000000..64513451 --- /dev/null +++ b/contrib/web/login.php @@ -0,0 +1,69 @@ +connected) // check if we have a succesfull connection there. + die("Can not connect to mooege!"); + + $verified=$mooege->VerifyPassword($email,$password); + + if($verified) + echo "Login succesful!"; + else + echo "Login failed!"; +} +?> + + +
+ mooege login +
+ E-mail:     
+ Password:
+
+

+
+
+
+ \ No newline at end of file diff --git a/contrib/web/register.php b/contrib/web/register.php new file mode 100644 index 00000000..37fb6ca2 --- /dev/null +++ b/contrib/web/register.php @@ -0,0 +1,80 @@ +connected) // check if we have a succesfull connection there. + die("Can not connect to mooege!"); + + $exists=$mooege->AccountExists($email); + + if($exists) + die("An account already exists for email address: $email!"); + + $created=$mooege->CreateAccount($email,$password,$battleTag); + + if($created) + echo "Account created successfully!"; + else + echo "Error creating account!"; +} +?> + + +
+ mooege login +
+ E-mail:     
+ Password:
+ BattleTag:
+
+

+
+
+
+ \ No newline at end of file diff --git a/contrib/web/stats.php b/contrib/web/stats.php new file mode 100644 index 00000000..d1abff41 --- /dev/null +++ b/contrib/web/stats.php @@ -0,0 +1,36 @@ + + + + + + + + + + + +
ServiceQueryResult
CoreVersionVersion()?>
CoreUptimeUptime()?>
MooNetIsMooNetServerOnlineIsMooNetServerOnline()?>
MooNetTotalAccountsTotalAccounts()?>
MooNetTotalToonsTotalToons()?>
MooNetOnlinePlayerCountOnlinePlayerCount()?>
MooNetOnlinePlayersListOnlinePlayersList())?>
GameServerIsGameServerOnlineIsGameServerOnline()?>
\ No newline at end of file diff --git a/dep/astar/AStar.dll b/dep/astar/AStar.dll new file mode 100644 index 00000000..b5fb1291 Binary files /dev/null and b/dep/astar/AStar.dll differ diff --git a/dep/astar/AStar.pdb b/dep/astar/AStar.pdb new file mode 100644 index 00000000..d34b109e Binary files /dev/null and b/dep/astar/AStar.pdb differ diff --git a/dep/astar/AStar/AStar.csproj b/dep/astar/AStar/AStar.csproj new file mode 100644 index 00000000..537a57f8 --- /dev/null +++ b/dep/astar/AStar/AStar.csproj @@ -0,0 +1,61 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {09D5631F-FC27-4DFD-BF33-14FEF038A385} + Library + Properties + AStar + AStar + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dep/astar/AStar/Algorithm/AuthorAttribute.cs b/dep/astar/AStar/Algorithm/AuthorAttribute.cs new file mode 100644 index 00000000..da0e4f8f --- /dev/null +++ b/dep/astar/AStar/Algorithm/AuthorAttribute.cs @@ -0,0 +1,24 @@ +// +// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY +// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR +// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER +// REMAINS UNCHANGED. +// +// Email: gustavo_franco@hotmail.com +// +// Copyright (C) 2006 Franco, Gustavo +// +using System; + +namespace Algorithms +{ + internal class AuthorAttribute : Attribute + { + #region Constructors + public AuthorAttribute(string authorName) + { + } + #endregion + } +} diff --git a/dep/astar/AStar/Algorithm/HighResolutionTime.cs b/dep/astar/AStar/Algorithm/HighResolutionTime.cs new file mode 100644 index 00000000..9a58238e --- /dev/null +++ b/dep/astar/AStar/Algorithm/HighResolutionTime.cs @@ -0,0 +1,56 @@ +// +// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY +// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR +// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER +// REMAINS UNCHANGED. +// +// Email: gustavo_franco@hotmail.com +// +// Copyright (C) 2006 Franco, Gustavo +// +using System; +using System.Collections.Generic; +using System.Text; + +namespace Algorithms +{ + /*public static class HighResolutionTime + { + #region Win32APIs + [System.Runtime.InteropServices.DllImport("Kernel32.dll")] + private static extern bool QueryPerformanceCounter(out long perfcount); + + [System.Runtime.InteropServices.DllImport("Kernel32.dll")] + private static extern bool QueryPerformanceFrequency(out long freq); + #endregion + + #region Variables Declaration + private static long mStartCounter; + private static long mFrequency; + #endregion + + #region Constuctors + static HighResolutionTime() + { + QueryPerformanceFrequency(out mFrequency); + } + #endregion + + #region Methods + public static void Start() + { + QueryPerformanceCounter(out mStartCounter); + } + + public static double GetTime() + { + long endCounter; + QueryPerformanceCounter(out endCounter); + long elapsed = endCounter - mStartCounter; + return (double) elapsed / mFrequency; + } + #endregion + }*/ +} + diff --git a/dep/astar/AStar/Algorithm/IPathFinder.cs b/dep/astar/AStar/Algorithm/IPathFinder.cs new file mode 100644 index 00000000..fdf4e42c --- /dev/null +++ b/dep/astar/AStar/Algorithm/IPathFinder.cs @@ -0,0 +1,106 @@ +// +// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY +// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR +// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER +// REMAINS UNCHANGED. +// +// Email: gustavo_franco@hotmail.com +// +// Copyright (C) 2006 Franco, Gustavo +// +using System; +using System.Collections.Generic; +using System.Text; +using Algorithms; +using System.Drawing; + +namespace Algorithms +{ + [Author("Franco, Gustavo")] + public interface IPathFinder + { + #region Events + event PathFinderDebugHandler PathFinderDebug; + #endregion + + #region Properties + bool Stopped + { + get; + } + + HeuristicFormula Formula + { + get; + set; + } + + bool Diagonals + { + get; + set; + } + + bool HeavyDiagonals + { + get; + set; + } + + int HeuristicEstimate + { + get; + set; + } + + bool PunishChangeDirection + { + get; + set; + } + + bool ReopenCloseNodes + { + get; + set; + } + + bool TieBreaker + { + get; + set; + } + + int SearchLimit + { + get; + set; + } + + double CompletedTime + { + get; + set; + } + + bool DebugProgress + { + get; + set; + } + + bool DebugFoundPath + { + get; + set; + } + #endregion + + #region Methods + void FindPathStop(); + List FindPath(Point start, Point end); + #endregion + + } +} diff --git a/dep/astar/AStar/Algorithm/PathFinder.cs b/dep/astar/AStar/Algorithm/PathFinder.cs new file mode 100644 index 00000000..788841d7 --- /dev/null +++ b/dep/astar/AStar/Algorithm/PathFinder.cs @@ -0,0 +1,417 @@ +// +// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY +// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR +// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER +// REMAINS UNCHANGED. +// +// Email: gustavo_franco@hotmail.com +// +// Copyright (C) 2006 Franco, Gustavo +// +//#define DEBUGON + +using System; +using System.Text; +using System.Drawing; +using System.Threading; +using System.Collections; +using System.Drawing.Drawing2D; +using System.Collections.Generic; +using System.Runtime.InteropServices; + +namespace Algorithms +{ + #region Structs + [Author("Franco, Gustavo")] + public struct PathFinderNode + { + #region Variables Declaration + public int F; + public int G; + public int H; // f = gone + heuristic + public int X; + public int Y; + public int PX; // Parent + public int PY; + #endregion + } + #endregion + + #region Enum + [Author("Franco, Gustavo")] + public enum PathFinderNodeType + { + Start = 1, + End = 2, + Open = 4, + Close = 8, + Current = 16, + Path = 32 + } + + public enum HeuristicFormula + { + Manhattan = 1, + MaxDXDY = 2, + DiagonalShortCut = 3, + Euclidean = 4, + EuclideanNoSQR = 5, + Custom1 = 6 + } + #endregion + + #region Delegates + public delegate void PathFinderDebugHandler(int fromX, int fromY, int x, int y, PathFinderNodeType type, int totalCost, int cost); + #endregion + + [Author("Franco, Gustavo")] + public class PathFinder : IPathFinder + { + //Commented out by DarkLotus + //[System.Runtime.InteropServices.DllImport("KERNEL32.DLL", EntryPoint="RtlZeroMemory")] + //public unsafe static extern bool ZeroMemory(byte* destination, int length); + + #region Events + public event PathFinderDebugHandler PathFinderDebug; + #endregion + + #region Variables Declaration + private byte[,] mGrid = null; + private PriorityQueueB mOpen = new PriorityQueueB(new ComparePFNode()); + private List mClose = new List(); + private bool mStop = false; + private bool mStopped = true; + private int mHoriz = 0; + private HeuristicFormula mFormula = HeuristicFormula.Manhattan; + private bool mDiagonals = true; + private int mHEstimate = 2; + private bool mPunishChangeDirection = false; + private bool mReopenCloseNodes = false; + private bool mTieBreaker = false; + private bool mHeavyDiagonals = false; + private int mSearchLimit = 2000; + private double mCompletedTime = 0; + private bool mDebugProgress = false; + private bool mDebugFoundPath = false; + #endregion + + #region Constructors + public PathFinder(byte[,] grid) + { + if (grid == null) + throw new Exception("Grid cannot be null"); + + mGrid = grid; + } + #endregion + + #region Properties + public bool Stopped + { + get { return mStopped; } + } + + public HeuristicFormula Formula + { + get { return mFormula; } + set { mFormula = value; } + } + + public bool Diagonals + { + get { return mDiagonals; } + set { mDiagonals = value; } + } + + public bool HeavyDiagonals + { + get { return mHeavyDiagonals; } + set { mHeavyDiagonals = value; } + } + + public int HeuristicEstimate + { + get { return mHEstimate; } + set { mHEstimate = value; } + } + + public bool PunishChangeDirection + { + get { return mPunishChangeDirection; } + set { mPunishChangeDirection = value; } + } + + public bool ReopenCloseNodes + { + get { return mReopenCloseNodes; } + set { mReopenCloseNodes = value; } + } + + public bool TieBreaker + { + get { return mTieBreaker; } + set { mTieBreaker = value; } + } + + public int SearchLimit + { + get { return mSearchLimit; } + set { mSearchLimit = value; } + } + + public double CompletedTime + { + get { return mCompletedTime; } + set { mCompletedTime = value; } + } + + public bool DebugProgress + { + get { return mDebugProgress; } + set { mDebugProgress = value; } + } + + public bool DebugFoundPath + { + get { return mDebugFoundPath; } + set { mDebugFoundPath = value; } + } + #endregion + + #region Methods + public void FindPathStop() + { + mStop = true; + } + + public List FindPath(Point start, Point end) + { + //HighResolutionTime.Start(); + + PathFinderNode parentNode; + bool found = false; + int gridX = mGrid.GetUpperBound(0); + int gridY = mGrid.GetUpperBound(1); + + mStop = false; + mStopped = false; + mOpen.Clear(); + mClose.Clear(); + + #if DEBUGON + if (mDebugProgress && PathFinderDebug != null) + PathFinderDebug(0, 0, start.X, start.Y, PathFinderNodeType.Start, -1, -1); + if (mDebugProgress && PathFinderDebug != null) + PathFinderDebug(0, 0, end.X, end.Y, PathFinderNodeType.End, -1, -1); + #endif + + sbyte[,] direction; + if (mDiagonals) + direction = new sbyte[8,2]{ {0,-1} , {1,0}, {0,1}, {-1,0}, {1,-1}, {1,1}, {-1,1}, {-1,-1}}; + else + direction = new sbyte[4,2]{ {0,-1} , {1,0}, {0,1}, {-1,0}}; + + parentNode.G = 0; + parentNode.H = mHEstimate; + parentNode.F = parentNode.G + parentNode.H; + parentNode.X = start.X; + parentNode.Y = start.Y; + parentNode.PX = parentNode.X; + parentNode.PY = parentNode.Y; + mOpen.Push(parentNode); + while(mOpen.Count > 0 && !mStop) + { + parentNode = mOpen.Pop(); + + #if DEBUGON + if (mDebugProgress && PathFinderDebug != null) + PathFinderDebug(0, 0, parentNode.X, parentNode.Y, PathFinderNodeType.Current, -1, -1); + #endif + + if (parentNode.X == end.X && parentNode.Y == end.Y) + { + mClose.Add(parentNode); + found = true; + break; + } + + if (mClose.Count > mSearchLimit) + { + mStopped = true; + return null; + } + + if (mPunishChangeDirection) + mHoriz = (parentNode.X - parentNode.PX); + + //Lets calculate each successors + for (int i=0; i<(mDiagonals ? 8 : 4); i++) + { + PathFinderNode newNode; + newNode.X = parentNode.X + direction[i,0]; + newNode.Y = parentNode.Y + direction[i,1]; + + if (newNode.X < 0 || newNode.Y < 0 || newNode.X >= gridX || newNode.Y >= gridY) + continue; + + int newG; + if (mHeavyDiagonals && i>3) + newG = parentNode.G + (int) (mGrid[newNode.X, newNode.Y] * 2.41); + else + newG = parentNode.G + mGrid[newNode.X, newNode.Y]; + + + if (newG == parentNode.G) + { + //Unbrekeable + continue; + } + + if (mPunishChangeDirection) + { + if ((newNode.X - parentNode.X) != 0) + { + if (mHoriz == 0) + newG += 20; + } + if ((newNode.Y - parentNode.Y) != 0) + { + if (mHoriz != 0) + newG += 20; + + } + } + + int foundInOpenIndex = -1; + for(int j=0; j=0; i--) + { + if (fNode.PX == mClose[i].X && fNode.PY == mClose[i].Y || i == mClose.Count - 1) + { + #if DEBUGON + if (mDebugFoundPath && PathFinderDebug != null) + PathFinderDebug(fNode.X, fNode.Y, mClose[i].X, mClose[i].Y, PathFinderNodeType.Path, mClose[i].F, mClose[i].G); + #endif + fNode = mClose[i]; + } + else + mClose.RemoveAt(i); + } + mStopped = true; + return mClose; + } + mStopped = true; + return null; + } + #endregion + + #region Inner Classes + [Author("Franco, Gustavo")] + internal class ComparePFNode : IComparer + { + #region IComparer Members + public int Compare(PathFinderNode x, PathFinderNode y) + { + if (x.F > y.F) + return 1; + else if (x.F < y.F) + return -1; + return 0; + } + #endregion + } + #endregion + } +} diff --git a/dep/astar/AStar/Algorithm/PathFinderFast.cs b/dep/astar/AStar/Algorithm/PathFinderFast.cs new file mode 100644 index 00000000..acad60f8 --- /dev/null +++ b/dep/astar/AStar/Algorithm/PathFinderFast.cs @@ -0,0 +1,470 @@ +// +// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY +// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR +// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER +// REMAINS UNCHANGED. +// +// Email: gustavo_franco@hotmail.com +// +// Copyright (C) 2006 Franco, Gustavo +// +//#define DEBUGON + +using System; +using System.Text; +using System.Drawing; +using System.Threading; +using System.Collections; +using System.Drawing.Drawing2D; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Algorithms; + +namespace Algorithms +{ + [Author("Franco, Gustavo")] + public class PathFinderFast : IPathFinder + { + #region Structs + [Author("Franco, Gustavo")] + [StructLayout(LayoutKind.Sequential, Pack=1)] + internal struct PathFinderNodeFast + { + #region Variables Declaration + public int F; // f = gone + heuristic + public int G; + public ushort PX; // Parent + public ushort PY; + public byte Status; + #endregion + } + #endregion + + #region Win32APIs + //Commented out by DarkLotus + //[System.Runtime.InteropServices.DllImport("KERNEL32.DLL", EntryPoint="RtlZeroMemory")] + //public unsafe static extern bool ZeroMemory(byte* destination, int length); + #endregion + + #region Events + public event PathFinderDebugHandler PathFinderDebug; + #endregion + + #region Variables Declaration + // Heap variables are initializated to default, but I like to do it anyway + private byte[,] mGrid = null; + private PriorityQueueB mOpen = null; + private List mClose = new List(); + private bool mStop = false; + private bool mStopped = true; + private int mHoriz = 0; + private HeuristicFormula mFormula = HeuristicFormula.Manhattan; + private bool mDiagonals = true; + private int mHEstimate = 2; + private bool mPunishChangeDirection = false; + private bool mReopenCloseNodes = true; + private bool mTieBreaker = false; + private bool mHeavyDiagonals = false; + private int mSearchLimit = 2000; + private double mCompletedTime = 0; + private bool mDebugProgress = false; + private bool mDebugFoundPath = false; + private PathFinderNodeFast[] mCalcGrid = null; + private byte mOpenNodeValue = 1; + private byte mCloseNodeValue = 2; + + //Promoted local variables to member variables to avoid recreation between calls + private int mH = 0; + private int mLocation = 0; + private int mNewLocation = 0; + private ushort mLocationX = 0; + private ushort mLocationY = 0; + private ushort mNewLocationX = 0; + private ushort mNewLocationY = 0; + private int mCloseNodeCounter = 0; + private ushort mGridX = 0; + private ushort mGridY = 0; + private ushort mGridXMinus1 = 0; + private ushort mGridYLog2 = 0; + private bool mFound = false; + private sbyte[,] mDirection = new sbyte[8,2]{{0,-1} , {1,0}, {0,1}, {-1,0}, {1,-1}, {1,1}, {-1,1}, {-1,-1}}; + private int mEndLocation = 0; + private int mNewG = 0; + #endregion + + #region Constructors + public PathFinderFast(byte[,] grid) + { + if (grid == null) + throw new Exception("Grid cannot be null"); + + mGrid = grid; + mGridX = (ushort) (mGrid.GetUpperBound(0) + 1); + mGridY = (ushort) (mGrid.GetUpperBound(1) + 1); + mGridXMinus1 = (ushort) (mGridX - 1); + mGridYLog2 = (ushort) Math.Log(mGridY, 2); + + // This should be done at the constructor, for now we leave it here. + if (Math.Log(mGridX, 2) != (int) Math.Log(mGridX, 2) || + Math.Log(mGridY, 2) != (int) Math.Log(mGridY, 2)) + throw new Exception("Invalid Grid, size in X and Y must be power of 2"); + + if (mCalcGrid == null || mCalcGrid.Length != (mGridX * mGridY)) + mCalcGrid = new PathFinderNodeFast[mGridX * mGridY]; + + mOpen = new PriorityQueueB(new ComparePFNodeMatrix(mCalcGrid)); + } + #endregion + + #region Properties + public bool Stopped + { + get { return mStopped; } + } + + public HeuristicFormula Formula + { + get { return mFormula; } + set { mFormula = value; } + } + + public bool Diagonals + { + get { return mDiagonals; } + set + { + mDiagonals = value; + if (mDiagonals) + mDirection = new sbyte[8,2]{{0,-1} , {1,0}, {0,1}, {-1,0}, {1,-1}, {1,1}, {-1,1}, {-1,-1}}; + else + mDirection = new sbyte[4,2]{{0,-1} , {1,0}, {0,1}, {-1,0}}; + } + } + + public bool HeavyDiagonals + { + get { return mHeavyDiagonals; } + set { mHeavyDiagonals = value; } + } + + public int HeuristicEstimate + { + get { return mHEstimate; } + set { mHEstimate = value; } + } + + public bool PunishChangeDirection + { + get { return mPunishChangeDirection; } + set { mPunishChangeDirection = value; } + } + + public bool ReopenCloseNodes + { + get { return mReopenCloseNodes; } + set { mReopenCloseNodes = value; } + } + + public bool TieBreaker + { + get { return mTieBreaker; } + set { mTieBreaker = value; } + } + + public int SearchLimit + { + get { return mSearchLimit; } + set { mSearchLimit = value; } + } + + public double CompletedTime + { + get { return mCompletedTime; } + set { mCompletedTime = value; } + } + + public bool DebugProgress + { + get { return mDebugProgress; } + set { mDebugProgress = value; } + } + + public bool DebugFoundPath + { + get { return mDebugFoundPath; } + set { mDebugFoundPath = value; } + } + #endregion + + #region Methods + public void FindPathStop() + { + mStop = true; + } + + public List FindPath(Point start, Point end) + { + lock(this) + { + //HighResolutionTime.Start(); + + // Is faster if we don't clear the matrix, just assign different values for open and close and ignore the rest + // I could have user Array.Clear() but using unsafe code is faster, no much but it is. + //fixed (PathFinderNodeFast* pGrid = tmpGrid) + // ZeroMemory((byte*) pGrid, sizeof(PathFinderNodeFast) * 1000000); + + mFound = false; + mStop = false; + mStopped = false; + mCloseNodeCounter = 0; + mOpenNodeValue += 2; + mCloseNodeValue += 2; + mOpen.Clear(); + mClose.Clear(); + + #if DEBUGON + if (mDebugProgress && PathFinderDebug != null) + PathFinderDebug(0, 0, start.X, start.Y, PathFinderNodeType.Start, -1, -1); + if (mDebugProgress && PathFinderDebug != null) + PathFinderDebug(0, 0, end.X, end.Y, PathFinderNodeType.End, -1, -1); + #endif + + mLocation = (start.Y << mGridYLog2) + start.X; + mEndLocation = (end.Y << mGridYLog2) + end.X; + mCalcGrid[mLocation].G = 0; + mCalcGrid[mLocation].F = mHEstimate; + mCalcGrid[mLocation].PX = (ushort) start.X; + mCalcGrid[mLocation].PY = (ushort) start.Y; + mCalcGrid[mLocation].Status = mOpenNodeValue; + + mOpen.Push(mLocation); + while(mOpen.Count > 0 && !mStop) + { + mLocation = mOpen.Pop(); + + //Is it in closed list? means this node was already processed + if (mCalcGrid[mLocation].Status == mCloseNodeValue) + continue; + + mLocationX = (ushort) (mLocation & mGridXMinus1); + mLocationY = (ushort) (mLocation >> mGridYLog2); + + #if DEBUGON + if (mDebugProgress && PathFinderDebug != null) + PathFinderDebug(0, 0, mLocation & mGridXMinus1, mLocation >> mGridYLog2, PathFinderNodeType.Current, -1, -1); + #endif + + if (mLocation == mEndLocation) + { + mCalcGrid[mLocation].Status = mCloseNodeValue; + mFound = true; + break; + } + + if (mCloseNodeCounter > mSearchLimit) + { + mStopped = true; + //mCompletedTime = HighResolutionTime.GetTime(); + return null; + } + + if (mPunishChangeDirection) + mHoriz = (mLocationX - mCalcGrid[mLocation].PX); + + //Lets calculate each successors + for (int i=0; i<(mDiagonals ? 8 : 4); i++) + { + mNewLocationX = (ushort) (mLocationX + mDirection[i,0]); + mNewLocationY = (ushort) (mLocationY + mDirection[i,1]); + mNewLocation = (mNewLocationY << mGridYLog2) + mNewLocationX; + + if (mNewLocationX >= mGridX || mNewLocationY >= mGridY) + continue; + + if (mCalcGrid[mNewLocation].Status == mCloseNodeValue && !mReopenCloseNodes) + continue; + + // Unbreakeable? + if (mGrid[mNewLocationX, mNewLocationY] == 0) + continue; + + if (mHeavyDiagonals && i>3) + mNewG = mCalcGrid[mLocation].G + (int) (mGrid[mNewLocationX, mNewLocationY] * 2.41); + else + mNewG = mCalcGrid[mLocation].G + mGrid[mNewLocationX, mNewLocationY]; + + if (mPunishChangeDirection) + { + if ((mNewLocationX - mLocationX) != 0) + { + if (mHoriz == 0) + mNewG += Math.Abs(mNewLocationX - end.X) + Math.Abs(mNewLocationY - end.Y); + } + if ((mNewLocationY - mLocationY) != 0) + { + if (mHoriz != 0) + mNewG += Math.Abs(mNewLocationX - end.X) + Math.Abs(mNewLocationY - end.Y); + } + } + + //Is it open or closed? + if (mCalcGrid[mNewLocation].Status == mOpenNodeValue || mCalcGrid[mNewLocation].Status == mCloseNodeValue) + { + // The current node has less code than the previous? then skip this node + if (mCalcGrid[mNewLocation].G <= mNewG) + continue; + } + + mCalcGrid[mNewLocation].PX = mLocationX; + mCalcGrid[mNewLocation].PY = mLocationY; + mCalcGrid[mNewLocation].G = mNewG; + + switch(mFormula) + { + default: + case HeuristicFormula.Manhattan: + mH = mHEstimate * (Math.Abs(mNewLocationX - end.X) + Math.Abs(mNewLocationY - end.Y)); + break; + case HeuristicFormula.MaxDXDY: + mH = mHEstimate * (Math.Max(Math.Abs(mNewLocationX - end.X), Math.Abs(mNewLocationY - end.Y))); + break; + case HeuristicFormula.DiagonalShortCut: + int h_diagonal = Math.Min(Math.Abs(mNewLocationX - end.X), Math.Abs(mNewLocationY - end.Y)); + int h_straight = (Math.Abs(mNewLocationX - end.X) + Math.Abs(mNewLocationY - end.Y)); + mH = (mHEstimate * 2) * h_diagonal + mHEstimate * (h_straight - 2 * h_diagonal); + break; + case HeuristicFormula.Euclidean: + mH = (int) (mHEstimate * Math.Sqrt(Math.Pow((mNewLocationY - end.X) , 2) + Math.Pow((mNewLocationY - end.Y), 2))); + break; + case HeuristicFormula.EuclideanNoSQR: + mH = (int) (mHEstimate * (Math.Pow((mNewLocationX - end.X) , 2) + Math.Pow((mNewLocationY - end.Y), 2))); + break; + case HeuristicFormula.Custom1: + Point dxy = new Point(Math.Abs(end.X - mNewLocationX), Math.Abs(end.Y - mNewLocationY)); + int Orthogonal = Math.Abs(dxy.X - dxy.Y); + int Diagonal = Math.Abs(((dxy.X + dxy.Y) - Orthogonal) / 2); + mH = mHEstimate * (Diagonal + Orthogonal + dxy.X + dxy.Y); + break; + } + if (mTieBreaker) + { + int dx1 = mLocationX - end.X; + int dy1 = mLocationY - end.Y; + int dx2 = start.X - end.X; + int dy2 = start.Y - end.Y; + int cross = Math.Abs(dx1 * dy2 - dx2 * dy1); + mH = (int) (mH + cross * 0.001); + } + mCalcGrid[mNewLocation].F = mNewG + mH; + + #if DEBUGON + if (mDebugProgress && PathFinderDebug != null) + PathFinderDebug(mLocationX, mLocationY, mNewLocationX, mNewLocationY, PathFinderNodeType.Open, mCalcGrid[mNewLocation].F, mCalcGrid[mNewLocation].G); + #endif + + //It is faster if we leave the open node in the priority queue + //When it is removed, it will be already closed, it will be ignored automatically + //if (tmpGrid[newLocation].Status == 1) + //{ + // //int removeX = newLocation & gridXMinus1; + // //int removeY = newLocation >> gridYLog2; + // mOpen.RemoveLocation(newLocation); + //} + + //if (tmpGrid[newLocation].Status != 1) + //{ + mOpen.Push(mNewLocation); + //} + mCalcGrid[mNewLocation].Status = mOpenNodeValue; + } + + mCloseNodeCounter++; + mCalcGrid[mLocation].Status = mCloseNodeValue; + + #if DEBUGON + if (mDebugProgress && PathFinderDebug != null) + PathFinderDebug(0, 0, mLocationX, mLocationY, PathFinderNodeType.Close, mCalcGrid[mLocation].F, mCalcGrid[mLocation].G); + #endif + } + + //mCompletedTime = HighResolutionTime.GetTime(); + if (mFound) + { + mClose.Clear(); + int posX = end.X; + int posY = end.Y; + + PathFinderNodeFast fNodeTmp = mCalcGrid[(end.Y << mGridYLog2) + end.X]; + PathFinderNode fNode; + fNode.F = fNodeTmp.F; + fNode.G = fNodeTmp.G; + fNode.H = 0; + fNode.PX = fNodeTmp.PX; + fNode.PY = fNodeTmp.PY; + fNode.X = end.X; + fNode.Y = end.Y; + + while(fNode.X != fNode.PX || fNode.Y != fNode.PY) + { + mClose.Add(fNode); + #if DEBUGON + if (mDebugFoundPath && PathFinderDebug != null) + PathFinderDebug(fNode.PX, fNode.PY, fNode.X, fNode.Y, PathFinderNodeType.Path, fNode.F, fNode.G); + #endif + posX = fNode.PX; + posY = fNode.PY; + fNodeTmp = mCalcGrid[(posY << mGridYLog2) + posX]; + fNode.F = fNodeTmp.F; + fNode.G = fNodeTmp.G; + fNode.H = 0; + fNode.PX = fNodeTmp.PX; + fNode.PY = fNodeTmp.PY; + fNode.X = posX; + fNode.Y = posY; + } + + mClose.Add(fNode); + #if DEBUGON + if (mDebugFoundPath && PathFinderDebug != null) + PathFinderDebug(fNode.PX, fNode.PY, fNode.X, fNode.Y, PathFinderNodeType.Path, fNode.F, fNode.G); + #endif + + mStopped = true; + return mClose; + } + mStopped = true; + return null; + } + } + #endregion + + #region Inner Classes + [Author("Franco, Gustavo")] + internal class ComparePFNodeMatrix : IComparer + { + #region Variables Declaration + PathFinderNodeFast[] mMatrix; + #endregion + + #region Constructors + public ComparePFNodeMatrix(PathFinderNodeFast[] matrix) + { + mMatrix = matrix; + } + #endregion + + #region IComparer Members + public int Compare(int a, int b) + { + if (mMatrix[a].F > mMatrix[b].F) + return 1; + else if (mMatrix[a].F < mMatrix[b].F) + return -1; + return 0; + } + #endregion + } + #endregion + } +} diff --git a/dep/astar/AStar/Algorithm/PriorityQueueB.cs b/dep/astar/AStar/Algorithm/PriorityQueueB.cs new file mode 100644 index 00000000..b8a1a7c3 --- /dev/null +++ b/dep/astar/AStar/Algorithm/PriorityQueueB.cs @@ -0,0 +1,213 @@ +// +// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY +// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR +// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER +// REMAINS UNCHANGED. +// +// Email: gustavo_franco@hotmail.com +// +// Copyright (C) 2006 Franco, Gustavo +// +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; + +namespace Algorithms +{ + #region Interfaces + [Author("Franco, Gustavo")] + public interface IPriorityQueue + { + #region Methods + int Push(T item); + T Pop(); + T Peek(); + void Update(int i); + #endregion + } + #endregion + + [Author("Franco, Gustavo")] + public class PriorityQueueB : IPriorityQueue + { + #region Variables Declaration + protected List InnerList = new List(); + protected IComparer mComparer; + #endregion + + #region Contructors + public PriorityQueueB() + { + mComparer = Comparer.Default; + } + + public PriorityQueueB(IComparer comparer) + { + mComparer = comparer; + } + + public PriorityQueueB(IComparer comparer, int capacity) + { + mComparer = comparer; + InnerList.Capacity = capacity; + } + #endregion + + #region Methods + protected void SwitchElements(int i, int j) + { + T h = InnerList[i]; + InnerList[i] = InnerList[j]; + InnerList[j] = h; + } + + protected virtual int OnCompare(int i, int j) + { + return mComparer.Compare(InnerList[i],InnerList[j]); + } + + /// + /// Push an object onto the PQ + /// + /// The new object + /// The index in the list where the object is _now_. This will change when objects are taken from or put onto the PQ. + public int Push(T item) + { + int p = InnerList.Count,p2; + InnerList.Add(item); // E[p] = O + do + { + if(p==0) + break; + p2 = (p-1)/2; + if(OnCompare(p,p2)<0) + { + SwitchElements(p,p2); + p = p2; + } + else + break; + }while(true); + return p; + } + + /// + /// Get the smallest object and remove it. + /// + /// The smallest object + public T Pop() + { + T result = InnerList[0]; + int p = 0,p1,p2,pn; + InnerList[0] = InnerList[InnerList.Count-1]; + InnerList.RemoveAt(InnerList.Count-1); + do + { + pn = p; + p1 = 2*p+1; + p2 = 2*p+2; + if(InnerList.Count>p1 && OnCompare(p,p1)>0) // links kleiner + p = p1; + if(InnerList.Count>p2 && OnCompare(p,p2)>0) // rechts noch kleiner + p = p2; + + if(p==pn) + break; + SwitchElements(p,pn); + }while(true); + + return result; + } + + /// + /// Notify the PQ that the object at position i has changed + /// and the PQ needs to restore order. + /// Since you dont have access to any indexes (except by using the + /// explicit IList.this) you should not call this function without knowing exactly + /// what you do. + /// + /// The index of the changed object. + public void Update(int i) + { + int p = i,pn; + int p1,p2; + do // aufsteigen + { + if(p==0) + break; + p2 = (p-1)/2; + if(OnCompare(p,p2)<0) + { + SwitchElements(p,p2); + p = p2; + } + else + break; + }while(true); + if(pp1 && OnCompare(p,p1)>0) // links kleiner + p = p1; + if(InnerList.Count>p2 && OnCompare(p,p2)>0) // rechts noch kleiner + p = p2; + + if(p==pn) + break; + SwitchElements(p,pn); + }while(true); + } + + /// + /// Get the smallest object without removing it. + /// + /// The smallest object + public T Peek() + { + if(InnerList.Count>0) + return InnerList[0]; + return default(T); + } + + public void Clear() + { + InnerList.Clear(); + } + + public int Count + { + get{ return InnerList.Count; } + } + + public void RemoveLocation(T item) + { + int index = -1; + for(int i=0; i + + + CrystalMpq + + + + Exposes with the data contained in an . + + + Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read. + An array of bytes. When this method returns, the buffer contains the specified byte array with the values between and ( + - 1) replaced by the bytes read from the current source. + The zero-based byte offset in at which to begin storing the data read from the current stream. + The maximum number of bytes to be read from the current stream. + The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero (0) if the end of the stream has been reached. + + + + This enumeraction gives information about the format of a given MPQ archive + + + + Original MPQ format. + + + Extended MPQ format introduced with WoW - Brurning Crusade. + These archives can exceed the file size of 2 Gb, and possesses additionnal attributes for the contained files. + + + Enhanced MPQ format introduced with WoW - Cataclysm. + These archives can provide increased performance via the new hash table format. + + + Enhanced MPQ format introduced with WoW - Cataclysm. + These archives build upon the previous format, providing more reliability and a potentially reduced file size. + + + This class represents a file stored in an . + + + Opens the file for reading. + Returns a Stream object which can be used to read data in the file. + Files can only be opened once, so don't forget to close the stream after you've used it. + + + Opens a patched file for reading. + A base stream. + Returns a Stream object which can be used to read data in the file. + + This method should only be used for explicitly providing a base stream when the is a patch. + Files can only be opened once, so don't forget to close the stream after you've used it. + + This instance of is not a patch. + is null. + + + Gets the archive to whom this file belongs. + + + Gets the name for this file, or null if the filename is not known. + + + Gets the offset of this file in the archive. + + + Gets the size of this file. + + + Gets the compressed size of this file. + If the file is not compressed, CompressedSize will return the same value than Size. + + + Gets the flags that apply to this file. + + + Gets a value indicating whether this file is encrypted. + true if this file is encrypted; otherwise, false. + + + Gets a value indicating whether this file is compressed. + true if this file is compressed; otherwise, false. + + + Gets a value indicating whether this file is a patch. + true if this file is a patch; otherwise, false. + + + Gets a value indicating whether this file has been deleted. + The deleted status indicates that the file has been deleted in the current mpq patch archive. + true if this file has been deleted; otherwise, false. + + + Gets the index of the file in the block table. + This property is for internal use only. + + + Gets the seed associated with this file. + The seed is a value that is used internally to decrypt some files. + The seed associated with this file. + + + Gets a value indicating whether the file was found in the list file of the archive. + This can only be true if the list file was parsed. + true if this instance is listed; otherwise, false. + + + + This class is used to read MPQ archives. + It gives you access to all files contained in the archive. + + + + Initializes a new instance of the class. + + The file is opened for read access and shares read access. + For safety, it is impossible to write to the file as long as it is open. + If you wish to allow write access to the file (at your own risk), please use one of the constructors taking a . + The listfile will be parsed if present in the archive. + + The MPQ archive's filename. + The specified file is not a valid MPQ archive, or the archive is corrupt. + + + Initializes a new instance of the class. + + The file is opened for read access and shares read access. + For safety, it is impossible to write to the file as long as it is open. + If you wish to allow write access to the file (at your own risk), please use one of the constructors taking a . + + The MPQ archive's filename. + Determines if the listfile will be parsed. + The to use for caching filenames. + The specified file is not a valid MPQ archive, or the archive is corrupt. + + + Initializes a new instance of the class. + The listfile will be parsed if present. + A containing the MPQ archive. + The specified stream does not contain a valid MPQ archive, or the archive is corrupt. + + + Initializes a new instance of the class. + A containing the MPQ archive. + Determines if the listfile will be parsed. + The specified stream does not contain a valid MPQ archive, or the archive is corrupt. + + + Reads the encrypted table at the specified offset in the archive. + + This method will place the bytes in their native order. + Reading must be done by pinning the buffer and accessing it as an buffer. + The only purpose of this method is to share code between the hash table and block table reading methods. + Because of its specific behavior, it should not be used anywhere else… + + The destination buffer. + Length of the table in units of 16 bytes. + The offset in the archive. + Length of the data to read. + The hash to use for decrypting the data. + The compressed read buffer to use for holding temporary data. + + + Parses the listfile if it has not already been done. + + Once the list file has been parsed, calls this function will just do nothing. + The list file will always be parsed by default, but you can override this behavior using an appropriate constructor. + Please note that parsing the list file can take some time, and is not required if you already know the filenames. + Also, this operation is irreversible. Once the filenames are present in memory, the only way to free the memory is to close the archive. + + + + Associate the specified filename with files in the archive. + + The filename will only be associated to matching files. If no file corresponds to the specified filename, nothing will happen. + This function may be useful when you don't have a listfile for a given MPQ archive or when you just want to find some hidden files. + + The filename to associate. + If set to true, the name was found in the listfile. + + + Associate the specified filename with files in the archive. + + The filename will only be associated to matching files. If no file corresponds to the specified filename, nothing will happen. + This function may be useful when you don't have a listfile for a given MPQ archive or when you just want to find some hidden files. + + The filename you want to try + + + Opens a file with the specified filename. + + This function will only open the first result found. + Modern MPQ archives should never contain more than one entry with the same filename. + This method is perfectly safe for modern games such as WoW, SII or D3. + + The filename of the file to open. + An instance. + No file with the specified name could be found in the archive. + + + Opens a file with the specified filename and LCID. + The filename of the file to open. + The LCID of file to open. + An instance. + No file with the specified name could be found in the archive. + + + Finds files with the specified filename. + + This function will return all s matching the given filename. + There might be more than one returned because of the localization. + + The filename of the files to find. + Returns an array of , containing zero or more . + + + Finds one file the specified filename and LCID. + The filename of the file to find. + The LCID of file to find. + Returns an object if file is found, or null otherwise. + + + Finds a file with the specified filename. + This function will only return the first result found. + The filename of the file to find. + Returns an object if file is found, or null otherwise. + + + Sets the preferred culture to use when searching files in the archive. + It might happen that a given file exists for different culture in the same MPQ archive, but it is more likely that your MPQ archive is already localized itself… + The LCID for the desired culture. + + + Resolves the data corresponding to the base file of a given patch . + The patch file. + A containing the data for the base file if it was found; otherwise null. + + + Reads a sequence of bytes from the inner stream and advances the position within the stream by the number of bytes read. + An array of bytes. When this method returns, the buffer contains the specified byte array with the values between and ( + - 1) replaced by the bytes read from the current source. + The zero-based byte offset in at which to begin storing the data read from the current stream. + The position in the stream where reading should start. + The maximum number of bytes to be read from the current stream. + The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero (0) if the end of the stream has been reached. + + + Gets the user data stream. + A to be used for accessing user data. + + + Gets a value that indicate whether the current archive has a weak siganture. + Some archives may be signed, which allows us to check archive integrity. + if the current archive has a weak siganture; otherwise, . + + + Occurs when the base file for a given should be resolved. + + This event will be raised when opening an which is a patch file. + Because patch files should be applied to a base file, it is needed to access to this file. + The application is responsible for providing a stream containing valid data for this to work. + + + + Gets a value that indicate whether the current archive has a listfile. + + Having a listfile is not required for an archive to be readable. + However, you need to know the filenames if you want to read the files. + + if the current archive has a listfile; otherwise, . + + + Gets the size of blocks in the archive. + + + Gets a collection containing reference to all the files in the archive. + + + Gets the size of the MPQ archive. + + + Gets the size of the MPQ archive. + + + Gets the size of the MPQ archive. + + + Gets the size of the MPQ archive. + + + Gets a flag indicating the format of the archive. + + + Gets a value indicating whether the current archive contains user data. + if the current archive contains user data; otherwise, . + + + Represents a collection of in an . + + + Gets an enumerator for the collection. + Returns an enumerator for the current collection. + + + Gets a file from the collection. + Index of the desired item. + Returns the at the specified index. + + + Gets the number of items in the collection. + + + Gets a buffer of at least bytes. + + While actively using the buffer, you must make sure to not call any other method using the same shared buffer. + Also, no references to the buffer should be leaked after the method requesting the buffer has returned. + Not following these rules carefully will likely lead to a crash. + + Minimum required length. + A buffer of at least bytes. + + + Gets a shared implementation. + The shared object should be used with care, with the same rules as the shared buffer. + A object that can be used to compute a hash. + + + Gets a shared implementation. + The shared object should be used with care, with the same rules as the shared buffer. + A object that can be used to compute a hash. + + + Represents a file system composed of multiple MPQ archives. + When searching a file, the first archives are always searched first. + + + Initializes a new instance of the class. + + MPQ patches have the possibility to delete files, making them unavailable in further versions. + This constructor will enforce the restriction and prevent you from getting access to deleted files. + The files marked as deleted are likely to go away after a major game update, so accessing them is not recommended. + If you really need to get access to those files, you can use the other constructor and access them as if they were never deleted. + + + + Initializes a new instance of the class. + if set to , files deleted in a patch will be retrieved. + + + Gets the collection of . + Archives should be added to this collection for being searched. + The archive list. + + + + The exception that is thrown when an error in input stream occurs during decoding. + + + + + The exception that is thrown when the value of an argument is outside the allowable range. + + + + + Callback progress. + + + input size. -1 if unknown. + + + output size. -1 if unknown. + + + + + Codes streams. + + + input Stream. + + + output Stream. + + + input Size. -1 if unknown. + + + output Size. -1 if unknown. + + + callback progress reference. + + + if input stream is not valid + + + + + Provides the fields that represent properties idenitifiers for compressing. + + + + + Specifies default property. + + + + + Specifies size of dictionary. + + + + + Specifies size of memory for PPM*. + + + + + Specifies order for PPM methods. + + + + + Specifies Block Size. + + + + + Specifies number of postion state bits for LZMA (0 <= x <= 4). + + + + + Specifies number of literal context bits for LZMA (0 <= x <= 8). + + + + + Specifies number of literal position bits for LZMA (0 <= x <= 4). + + + + + Specifies number of fast bytes for LZ*. + + + + + Specifies match finder. LZMA: "BT2", "BT4" or "BT4B". + + + + + Specifies the number of match finder cyckes. + + + + + Specifies number of passes. + + + + + Specifies number of algorithm. + + + + + Specifies the number of threads. + + + + + Specifies mode with end marker. + + + + Represents a bit buffer. + + This structure is designed for internal use in CrystalMpq. + Incorrect usage of the structure will lead to bugs or even worse, memory leaks. + The structure shall always be initialized using this constructor. + Once created, there shall never be more than one living copy of the structure. + The structure shall always be passed as a reference parameter and never as a value parameter. + Once the structure have been used for its purposes, it shall be released using the method. + After the structure has been disposed, the instance shall never be used again. + + + + Initializes a new instance of the struct. + The structure shall always be initialized using this constructor. + Array of bit containing the data + Position of data in the array + Size of data in the array + + + Called internally when the name has been detected. + Detected filename. + If set to true, remember the filename. + If set to true, the name was detected from the listfile. + Right now, the method will only update the seed when needed. + + + Flags which can be applied to files in a MPQ archive. + + + The file is compressed using DCL compression only. + + + The file is compressed using Blizzard's multiple compression system. + + + The file is compressed using either method. + + + The file is encrypted with a seed. + + + The encryption seed is altered with the file offset. + + + The file is a patch. + This should only be found whithin patch archives. + + + The file is stored as a single unit and not in multiple blocks. + This was added with Burning Crusade. + + + The file was deleted in a patch. + + + The file has a CRC for each sector. + + + The file exists. This flag should always be set for valid files. + + + Exception thrown when the MPQ version is not recognized by the library. + + + Initializes a new instance of the class. + + + is used for applying a patch. + It is the responsibility to provide a valid stream. + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + Transfers the stream ownership to the caller. + + This method will return the value of and set the property to null afterwards. + After a call to this method, the caller becomes responsible for managing the stream. + + The previously contained in this instance. + + + Gets or sets the stream containing the data for the base file. + The instance of will take ownership of the stream. + The stream. + + + Thrown when the seed for a file is not known. + The seed is needed for reading encrypted files. + + + Thrown when a compression is not handled by the library. + Known but unsupported compressions will be reported by their name. + + + Gets the id of the unsupported compression method. + The compression method id. + + + Gets the name of the unsupported compression method. + The name of the compression method. + + + diff --git a/dep/gibbed.io/Gibbed.IO.License b/dep/gibbed.io/Gibbed.IO.License new file mode 100644 index 00000000..617e44f5 --- /dev/null +++ b/dep/gibbed.io/Gibbed.IO.License @@ -0,0 +1,20 @@ +Copyright (c) 2011 Rick (rick 'at' gibbed 'dot' us) + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would + be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and must not + be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source + distribution. \ No newline at end of file diff --git a/dep/gibbed.io/Gibbed.IO.dll b/dep/gibbed.io/Gibbed.IO.dll new file mode 100644 index 00000000..29be3624 Binary files /dev/null and b/dep/gibbed.io/Gibbed.IO.dll differ diff --git a/dep/gibbed.io/uplink b/dep/gibbed.io/uplink new file mode 100644 index 00000000..9c535e28 --- /dev/null +++ b/dep/gibbed.io/uplink @@ -0,0 +1 @@ +http://svn.gib.me/public/gibbed2/trunk/ \ No newline at end of file diff --git a/dep/nhibernate/FluentNHibernate.dll b/dep/nhibernate/FluentNHibernate.dll new file mode 100644 index 00000000..799419af Binary files /dev/null and b/dep/nhibernate/FluentNHibernate.dll differ diff --git a/dep/nhibernate/Iesi.Collections.dll b/dep/nhibernate/Iesi.Collections.dll new file mode 100644 index 00000000..3537f7c9 Binary files /dev/null and b/dep/nhibernate/Iesi.Collections.dll differ diff --git a/dep/nhibernate/NHibernate.dll b/dep/nhibernate/NHibernate.dll new file mode 100644 index 00000000..85762c82 Binary files /dev/null and b/dep/nhibernate/NHibernate.dll differ diff --git a/dep/nini/Nini.Licence b/dep/nini/Nini.Licence new file mode 100644 index 00000000..a6a946dc --- /dev/null +++ b/dep/nini/Nini.Licence @@ -0,0 +1,24 @@ +Nini Configuration Project. +Copyright (c) 2004 Brent R. Matzelle + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/dep/nini/Nini.dll b/dep/nini/Nini.dll new file mode 100644 index 00000000..cbe10501 Binary files /dev/null and b/dep/nini/Nini.dll differ diff --git a/dep/openssl/ManagedOpenSsl.License b/dep/openssl/ManagedOpenSsl.License new file mode 100644 index 00000000..a2c4adcb --- /dev/null +++ b/dep/openssl/ManagedOpenSsl.License @@ -0,0 +1,127 @@ + + LICENSE ISSUES + ============== + + The OpenSSL toolkit stays under a dual license, i.e. both the conditions of + the OpenSSL License and the original SSLeay license apply to the toolkit. + See below for the actual license texts. Actually both licenses are BSD-style + Open Source licenses. In case of any license issues related to OpenSSL + please contact openssl-core@openssl.org. + + OpenSSL License + --------------- + +/* ==================================================================== + * Copyright (c) 1998-2008 The OpenSSL Project. 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. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED 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 OpenSSL PROJECT OR + * ITS 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. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + + Original SSLeay License + ----------------------- + +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * 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 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 AUTHOR 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. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + diff --git a/dep/openssl/ManagedOpenSsl.XML b/dep/openssl/ManagedOpenSsl.XML new file mode 100644 index 00000000..c6e14fef --- /dev/null +++ b/dep/openssl/ManagedOpenSsl.XML @@ -0,0 +1,4883 @@ + + + + ManagedOpenSsl + + + + + Wraps the DSA_* functions + + + + + Base class for all openssl wrapped objects. + Contains the raw unmanaged pointer and has a Handle property to get access to it. + Also overloads the ToString() method with a BIO print. + + + + + Constructor which takes the raw unmanged pointer. + This is the only way to construct this object and all dervied types. + + + + + + + This finalizer just calls Dispose(). + + + + + This method is used by the ToString() implementation. A great number of + openssl objects support printing, so this is a conveinence method. + Dervied types should override this method and not ToString(). + + The BIO stream object to print into + + + + Override of ToString() which uses Print() into a BIO memory buffer. + + + + + + This method must be implemented in derived classes. + + + + + Do nothing in the base class. + + + + + + Implementation of the IDisposable interface. + If the native pointer is not null, we haven't been disposed, and we are the owner, + then call the virtual OnDispose() method. + + + + + Throws NotImplementedException + + + + + Raw unmanaged pointer + + + + + If this object is the owner, then call the appropriate native free function. + + + + + This is to prevent double-deletion issues. + + + + + gets/sets whether the object owns the Native pointer + + + + + Access to the raw unmanaged pointer. + + + + + Calls DSA_new() then DSA_generate_parameters_ex() + + + + + Calls DSA_new() then DSA_generate_parameters_ex() + + + + + + + + Calls DSA_new() then DSA_generate_parameters_ex() + + + + + + + + + + Returns PEM_read_bio_DSA_PUBKEY() + + + + + + + Returns PEM_read_bio_DSA_PUBKEY() + + + + + + + Returns PEM_read_bio_DSAPrivateKey() + + + + + + + Returns PEM_read_bio_DSAPrivateKey() + + + + + + + Calls DSA_generate_key() + + + + + Returns DSA_sign() + + + + + + + Returns DSA_verify() + + + + + + + + Calls PEM_write_bio_DSA_PUBKEY() + + + + + + Calls PEM_write_bio_DSAPrivateKey() + + + + + + + + + Calls DSA_print() + + + + + + Calls DSA_free() + + + + + If both objects have a private key, those are compared. + Otherwise just the params and public keys are compared. + + + + + + + Xor of the params, public key, and optionally the private key + + + + + + Returns the p field + + + + + Returns the q field + + + + + Returns the g field + + + + + Returns DSA_size() + + + + + Returns the pub_key field + + + + + Returns the priv_key field + + + + + Returns the pub_key field as a PEM string + + + + + Returns the priv_key field as a PEM string + + + + + Returns the counter + + + + + Returns the h value + + + + + Accessor for the FlagNoExpConstTime flag + + + + + Wraps ASN1_STRING_* + + + + + Helper base class that handles the AddRef() method by using a _dup() method. + + + + + Derived classes must use a _dup() method to make a copy of the underlying native data structure. + + + + + + Calls ASN1_STRING_type_new() + + + + + Wrap existing native pointer + + + + + + + Calls ASN1_STRING_set() + + + + + + Calls ASN1_STRING_free() + + + + + Returns ASN1_STRING_cmp() + + + + + + + Returns ASN1_STRING_length() + + + + + Returns ASN1_STRING_data() + + + + + Override to implement client/server specific handshake processing + + + + + + Renegotiate session keys - calls SSL_renegotiate + + + + + Calls SSL_new() + + + + + + Calls SSL_free() + + + + + Wraps the X509_EXTENSION object + + + + + The Stack class can only contain objects marked with this interface. + + + + + Calls X509_EXTENSION_new() + + + + + Calls X509V3_EXT_conf_nid() + + + + + + + + + + Calls X509_EXTENSION_free() + + + + + Calls X509V3_EXT_print() + + + + + + Calls X509_EXTENSION_dup() + + + + + + Uses X509_EXTENSION_get_object() and OBJ_nid2ln() + + + + + Uses X509_EXTENSION_get_object() and OBJ_obj2nid() + + + + + returns X509_EXTENSION_get_critical() + + + + + Returns X509_EXTENSION_get_data() + + + + + X509 Extension entry + + + + + + + + + + + + + + + + + + + + + + + + Dictionary for X509 v3 extensions - Name, Value + + + + + Encapsultes the sk_* functions + + + + + + Calls sk_new_null() + + + + + Calls sk_shift() + + + + + + Calls sk_free() + + + + + Calls sk_dup() + + + + + + Returns sk_find() + + + + + + + Calls sk_insert() + + + + + + + Calls sk_delete() + + + + + + Calls sk_push() + + + + + + Clear all items from the stack + + + + + Returns true if the specified item exists in this stack. + + + + + + + Not implemented + + + + + + + Calls sk_delete_ptr() + + + + + + + Returns an enumerator for this stack + + + + + + Indexer that returns sk_value() or calls sk_insert() + + + + + + + Returns sk_num() + + + + + Returns false. + + + + + Wraps the RSA_* functions + + + + + Calls RSA_new() + + + + + Calls PEM_read_bio_RSA_PUBKEY() + + + + + + + Calls PEM_read_bio_RSAPrivateKey() + + + + + + + Calls PEM_read_bio_RSA_PUBKEY() + + + + + + + + + Calls PEM_read_bio_RSAPrivateKey() + + + + + + + + + Calls RSA_generate_key_ex() + + + + + + + + + Calls RSA_public_encrypt() + + + + + + + + Calls RSA_private_encrypt() + + + + + + + + Calls RSA_public_decrypt() + + + + + + + + Calls RSA_private_decrypt() + + + + + + + + Calls PEM_write_bio_RSA_PUBKEY() + + + + + + Calls PEM_write_bio_RSAPrivateKey() + + + + + + + + + Returns RSA_check_key() + + + + + + Calls RSA_print() + + + + + + Calls RSA_free() + + + + + Returns RSA_size() + + + + + Not finished + + + + + Accessor for the e field + + + + + Accessor for the n field + + + + + Accessor for the d field + + + + + Accessor for the p field + + + + + Accessor for the q field + + + + + Accessor for the dmp1 field. + d mod (p-1) + + + + + Accessor for the dmq1 field. + d mod (q-1) + + + + + Accessor for the iqmp field. + q^-1 mod p + + + + + Returns the public key field as a PEM string + + + + + Returns the private key field as a PEM string + + + + + RSA padding scheme + + + + + RSA_PKCS1_PADDING + + + + + RSA_SSLV23_PADDING + + + + + RSA_NO_PADDING + + + + + RSA_PKCS1_OAEP_PADDING + Optimal Asymmetric Encryption Padding + + + + + RSA_X931_PADDING + + + + + Exposes the RAND_* functions. + + + + + Calls RAND_seed() + + + + + + Calls RAND_seed() + + + + + + Calls RAND_pseudo_bytes() + + + + + + + Calls RAND_cleanup() + + + + + Calls RAND_bytes() + + + + + + + Calls RAND_add() + + + + + + + Calls RAND_load_file() + + + + + + + Calls RAND_write_file() + + + + + + Calls RAND_file_name() + + + + + + Calls RAND_query_egd_bytes() + + + + + + + + Calls RAND_egd() + + + + + + Calls RAND_egd_bytes() + + + + + + + Calls RAND_poll() + + + + + Calls BN_rand() + + + + + + + + + Calls BN_rand_range() + + + + + + + Calls BN_pseudo_rand() + + + + + + + + + Calls BN_pseudo_rand_range() + + + + + + + Returns RAND_status() + + + + + Callback prototype. Must return the password or prompt for one. + + + + + + + + Simple password callback that returns the contained password. + + + + + Constructs a PasswordCallback + + + + + + Suitable callback to be used as a PasswordHandler + + + + + + + + Simple encapsulation of a local identity. + This includes the private key and the X509Certificate. + + + + + Construct an Identity with a private key + + + + + + Create a X509Request for this identity, using the specified name. + + + + + + + Create a X509Request for this identity, using the specified name and digest. + + + + + + + + Verify that the specified chain can be trusted. + + + + + + + + Returns the embedded public key of the X509Certificate + + + + + Returns the private key + + + + + Returns the X509Certificate + + + + + Wraps the X509_STORE_CTX object + + + + + Calls X509_STORE_CTX_new() + + + + + Calls X509_STORE_CTX_init() + + + + + + + + Returns X509_verify_cert() + + + + + + Calls X509_STORE_CTX_free() + + + + + Returns X509_STORE_CTX_get_current_cert() + + + + + Returns X509_STORE_CTX_get_error_depth() + + + + + Getter returns X509_STORE_CTX_get_error(), setter calls X509_STORE_CTX_set_error() + + + + + Returns an X509Store based on this context + + + + + Returns X509_verify_cert_error_string() + + + + + V_CRYPTO_MDEBUG_* + + + + + V_CRYPTO_MDEBUG_TIME + + + + + V_CRYPTO_MDEBUG_THREAD + + + + + V_CRYPTO_MDEBUG_ALL + + + + + CRYPTO_MEM_CHECK_* + + + + + CRYPTO_MEM_CHECK_OFF + for applications + + + + + CRYPTO_MEM_CHECK_ON + for applications + + + + + CRYPTO_MEM_CHECK_ENABLE + for library-internal use + + + + + CRYPTO_MEM_CHECK_DISABLE + for library-internal use + + + + + Exposes the CRYPTO_* functions + + + + + Calls CRYPTO_malloc_debug_init() + + + + + Calls CRYPTO_dbg_set_options() + + + + + + Calls CRYPTO_mem_ctrl() + + + + + + Calls CRYPTO_cleanup_all_ex_data() + + + + + Calls ERR_remove_state() + + + + + + Calls CRYPTO_mem_leaks_cb() + + + + + + Returns MD2_options() + + + + + Returns RC4_options() + + + + + Returns DES_options() + + + + + Returns idea_options() + + + + + Returns BF_options() + + + + + CRYPTO_MEM_LEAK_CB + + + + + + + + + + Wraps the X509_OBJECT: a glorified union + + + + + Calls X509_OBJECT_up_ref_count() + + + + + Calls X509_OBJECT_free_contents() + + + + + Returns a Certificate if the type is X509_LU_X509 + + + + + Returns the PrivateKey if the type is X509_LU_PKEY + + + + + Useful for tracking down memory leaks + + + + + Begins memory tracking + + + + + Stops memory tracking and reports any leaks found since Start() was called. + + + + + Returns the number of bytes leaked between Start() and Finish() + + + + + Wraps the X509_STORE object + + + + + Helper type that handles the AddRef() method. + Derived classes must implement the LockType and RawReferenceType properties + + + + + Prints the current underlying reference count + + + + + Derived classes must return a CryptoLockTypes for this type + + + + + Derived classes must return a Type that matches the underlying type + + + + + Calls X509_STORE_new() + + + + + Initializes the X509Store object with a pre-existing native X509_STORE pointer + + + + + + + Calls X509_STORE_new() and then adds the specified chain as trusted. + + + + + + Calls X509_STORE_new() and then adds the specified chaing as trusted. + + + + + + + Returns the trusted state of the specified certificate + + + + + + + + Adds a chain to the trusted list. + + + + + + Adds a certificate to the trusted list, calls X509_STORE_add_cert() + + + + + + Add an untrusted certificate + + + + + + Calls X509_STORE_free() + + + + + Wraps the objs member on the raw X509_STORE structure + + + + + Accessor to the untrusted list + + + + + Wraps a X509_REQ object. + + + + + Calls X509_REQ_new() + + + + + Calls X509_REQ_new() and then initializes version, subject, and key. + + + + + + + + Calls PEM_read_bio_X509_REQ() + + + + + + Creates a X509_REQ from a PEM formatted string. + + + + + + Sign this X509Request using the supplied key and digest. + + + + + + + Verify this X509Request against the supplied key. + + + + + + + Calls X509_REQ_print() + + + + + + Calls PEM_write_bio_X509_REQ() + + + + + + Converts this request into a certificate using X509_REQ_to_X509(). + + + + + + + + Calls X509_REQ_free() + + + + + Accessor to the version field. The settor calls X509_REQ_set_version(). + + + + + Accessor to the pubkey field. Uses X509_REQ_get_pubkey() and X509_REQ_set_pubkey() + + + + + Accessor to the subject field. Setter calls X509_REQ_set_subject_name(). + + + + + Returns the PEM formatted string for this object. + + + + + Encapsulates the X509_NAME_* functions + + + + + Calls X509_NAME_new() + + + + + Calls X509_NAME_dup() + + + + + + Calls X509_NAME_new() + + + + + + Parses the string and returns an X509Name based on value. + + + + + + + Calls X509_NAME_add_entry_by_NID after converting the + name to a NID using OBJ_txt2nid() + + + + + + + Calls X509_NAME_add_entry_by_NID() + + + + + + + Returns X509_NAME_get_text_by_NID() + + + + + + + Returns X509_NAME_get_text_by_NID() after converting the name + into a NID using OBJ_txt2nid() + + + + + + + Calls X509_NAME_get_index_by_NID() + + + + + + + + Returns the index of a name entry using GetIndexByNid() + + + + + + + + Returns the index of a name entry using GetIndexByNid() + + + + + + + Returns true if the name entry with the specified name exists. + + + + + + + Returns X509_NAME_digest() + + + + + + + + Calls X509_NAME_print_ex() + + + + + + Calls X509_NAME_free() + + + + + Returns CompareTo(rhs) == 0 + + + + + Returns ToString().GetHashCode() + + + + + Returns X509_NAME_cmp() + + + + + + + Returns X509_NAME_oneline() + + + + + Accessor to the name entry for 'CN' + + + + + Accessor to the name entry for 'C' + + + + + Accessor to the name entry for 'L' + + + + + Accessor to the name entry for 'ST' + + + + + Accessor to the name entry for 'O' + + + + + Accessor to the name entry for 'OU' + + + + + Accessor to the name entry for 'G' + + + + + Accessor to the name entry for 'S' + + + + + Accessor to the name entry for 'I' + + + + + Accessor to the name entry for 'UID' + + + + + Accessor to the name entry for 'SN' + + + + + Accessor to the name entry for 'T' + + + + + Accessor to the name entry for 'D' + + + + + Accessor to the name entry for 'X509' + + + + + Returns X509_NAME_entry_count() + + + + + Indexer to a name entry by name + + + + + + + Indexer to a name entry by index + + + + + + + Used for generating sequence numbers by the CertificateAuthority + + + + + Returns the next available sequence number + + + + + + Implements the ISequenceNumber interface. + The sequence number is read from a file, incremented, + then written back to the file + + + + + Constructs a FileSerialNumber. The path specifies where + the serial number should be read and written to. + + + + + + Implements the Next() method of the ISequenceNumber interface. + The sequence number is read from a file, incremented, + then written back to the file + + + + + + Simple implementation of the ISequenceNumber interface. + + + + + Construct a SimpleSerialNumber with the initial sequence number set to 0. + + + + + Construct a SimpleSerialNumber with the initial sequence number + set to the value specified by the seed parameter. + + + + + + Returns the next available sequence number. + This implementation simply increments the current + sequence number and returns it. + + + + + + High-level interface which does the job of a CA (Certificate Authority) + Duties include processing incoming X509 requests and responding + with signed X509 certificates, signed by this CA's private key. + + + + + Factory method which creates a X509CertifiateAuthority where + the internal certificate is self-signed + + + + + + + + + + + Factory method that creates a X509CertificateAuthority instance with + an internal self signed certificate + + + + + + + + + + + + + Factory method that creates a X509CertificateAuthority instance with + an internal self signed certificate. This method allows creation without + the need for the Configuration file, X509V3Extensions may be added + with the X509V3ExtensionList parameter + + + + + + + + + + + + + Constructs a X509CertifcateAuthority with the specified parameters. + + + + + + + + + Process and X509Request. This includes creating a new X509Certificate + and signing this certificate with this CA's private key. + + + + + + + + + Process and X509Request. This includes creating a new X509Certificate + and signing this certificate with this CA's private key. + + + + + + + + + + Dispose the key, certificate, and the configuration + + + + + Accessor to the CA's X509 Certificate + + + + + Accessor to the CA's key used for signing. + + + + + Wraps the EVP_MD object + + + + + Creates a EVP_MD struct + + + + + + + Prints MessageDigest + + + + + + Not implemented, these objects should never be disposed. + + + + + Calls EVP_get_digestbyname() + + + + + + + EVP_md_null() + + + + + EVP_md4() + + + + + EVP_md5() + + + + + EVP_sha() + + + + + EVP_sha1() + + + + + EVP_sha224() + + + + + EVP_sha256() + + + + + EVP_sha384() + + + + + EVP_sha512() + + + + + EVP_dss() + + + + + EVP_dss1() + + + + + EVP_ripemd160() + + + + + Calls OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH) + + + + + Calls OBJ_NAME_do_all(OBJ_NAME_TYPE_CIPHER_METH) + + + + + Returns the block_size field + + + + + Returns the md_size field + + + + + Returns the type field using OBJ_nid2ln() + + + + + Returns the type field using OBJ_nid2sn() + + + + + Wraps the EVP_MD_CTX object + + + + + Calls BIO_get_md_ctx() then BIO_get_md() + + + + + + Calls EVP_MD_CTX_create() then EVP_MD_CTX_init() + + + + + + Prints the long name + + + + + + Calls EVP_DigestInit_ex(), EVP_DigestUpdate(), and EVP_DigestFinal_ex() + + + + + + + Calls EVP_DigestInit_ex() + + + + + Calls EVP_DigestUpdate() + + + + + + Calls EVP_DigestFinal_ex() + + + + + + Calls EVP_SignFinal() + + + + + + + Calls EVP_VerifyFinal() + + + + + + + + Calls EVP_DigestInit_ex(), EVP_DigestUpdate(), and EVP_SignFinal() + + + + + + + + Calls EVP_SignFinal() + + + + + + + + + Calls EVP_DigestInit_ex(), EVP_DigestUpdate(), and EVP_VerifyFinal() + + + + + + + + + Calls EVP_VerifyFinal() + + + + + + + + + + Calls EVP_MD_CTX_cleanup() and EVP_MD_CTX_destroy() + + + + + Wraps X509V3_CTX + + + + + Calls OPENSSL_malloc() + + + + + Calls X509V3_set_ctx() + + + + + + + + X509V3_set_ctx_nodb - sets the db pointer to NULL + + + + + Calls X509V3_set_nconf() + + + + + + Calls OPENSSL_free() + + + + + Wraps the NCONF_* functions + + + + + Calls NCONF_new() + + + + + Calls NCONF_load() + + + + + + Calls NCONF_load() + + + + + + Creates a X509v3Context(), calls X509V3_set_ctx() on it, then calls + X509V3_EXT_add_nconf() + + + + + + + + + Calls NCONF_free() + + + + + Wraps HMAC + + + + + Calls OPENSSL_malloc() and then HMAC_CTX_init() + + + + + Calls HMAC() + + + + + + + + + Calls HMAC_Init_ex() + + + + + + + Calls HMAC_Update() + + + + + + Calls HMAC_Update() + + + + + + + + Calls HMAC_Final() + + + + + + Calls HMAC_CTX_cleanup() and then OPENSSL_free() + + + + + Implements the CopyRef() method + + + + + + Wraps the X509 object + + + + + Calls X509_new() + + + + + Calls PEM_read_bio_X509() + + + + + + Factory method that returns a X509 using d2i_X509_bio() + + + + + + + Factory method to create a X509Certificate from a PKCS7 encoded in PEM + + + + + + + Factory method to create a X509Certificate from a PKCS7 encoded in DER + + + + + + + Factory method to create a X509Certificate from a PKCS12 + + + + + + + + Creates a new X509 certificate + + + + + + + + + + + Calls X509_sign() + + + + + + + Returns X509_check_private_key() + + + + + + + Returns X509_check_trust() + + + + + + + + Returns X509_verify() + + + + + + + Returns X509_digest() + + + + + + + + Returns X509_pubkey_digest() + + + + + + + + Calls PEM_write_bio_X509() + + + + + + Calls i2d_X509_bio() + + + + + + Calls X509_print() + + + + + + Converts a X509 into a request using X509_to_X509_REQ() + + + + + + + + Calls X509_add_ext() + + + + + + Calls X509_add1_ext_i2d() + + + + + + + + + + + + + + + Calls X509_free() + + + + + Compares X509Certificate + + + + + + + Returns the hash code of the issuer's oneline xor'd with the serial number + + + + + + Returns X509_cmp() + + + + + + + Uses X509_get_subject_name() and X509_set_issuer_name() + + + + + Uses X509_get_issuer_name() and X509_set_issuer_name() + + + + + Uses X509_get_serialNumber() and X509_set_serialNumber() + + + + + Uses the notBefore field and X509_set_notBefore() + + + + + Uses the notAfter field and X509_set_notAfter() + + + + + Uses the version field and X509_set_version() + + + + + Uses X509_get_pubkey() and X509_set_pubkey() + + + + + Returns whether or not a Private Key is attached to this Certificate + + + + + Gets and Sets the Private Key for this Certificate. + The Private Key MUST match the Public Key. + + + + + Returns the PEM formatted string of this object + + + + + Returns the DER formatted byte array for this object + + + + + + + + + + This is a struct that contains a uint for the native openssl error code. + It provides helper methods to convert this error code into strings. + + + + + Constructs an OpenSslError object. + + The native error code + + + + Returns the native error code + + + + + Returns the result of ERR_lib_error_string() + + + + + Returns the results of ERR_reason_error_string() + + + + + Returns the results of ERR_func_error_string() + + + + + Returns the results of ERR_error_string_n() + + + + + Exception class to provide OpenSSL specific information when errors occur. + + + + + When this class is instantiated, GetErrorMessage() is called automatically. + This will call ERR_get_error() on the native openssl interface, once for every + error that is in the current context. The exception message is the concatination + of each of these errors turned into strings using ERR_error_string_n(). + + + + + Returns the list of errors associated with this exception. + + + + + + + + + + + + + + + + + + + + + + + + + + + Implments an AuthenticatedStream and is the main interface to the SSL library. + + + + + Create an SslStream based on an existing stream. + + + + + + Create an SslStream based on an existing stream. + + + + + + + Create an SslStream based on an existing stream. + + + + + + + + Create an SslStream based on an existing stream. + + + + + + + + + Clears all buffers for this stream and causes any buffered data to be written to the underlying device. + + + + + Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read. + + + + + + + + + Begins an asynchronous read operation. + + + + + + + + + + + Waits for the pending asynchronous read to complete. + + + + + + + Not supported + + + + + + + + Sets the length of the current stream. + + + + + + Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written. + + + + + + + + Begins an asynchronous write operation. + + + + + + + + + + + Ends an asynchronous write operation. + + + + + + Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns whether authentication was successful. + + + + + Indicates whether data sent using this SslStream is encrypted. + + + + + Indicates whether both server and client have been authenticated. + + + + + Indicates whether the local side of the connection was authenticated as the server. + + + + + Indicates whether the data sent using this stream is signed. + + + + + Gets a value indicating whether the current stream supports reading. + + + + + Gets a value indicating whether the current stream supports seeking. + + + + + Gets a value indicating whether the current stream supports writing. + + + + + Gets the length in bytes of the stream. + + + + + Gets or sets the position within the current stream. + + + + + Gets or sets a value, in miliseconds, that determines how long the stream will attempt to read before timing out. + + + + + Gets or sets a value, in miliseconds, that determines how long the stream will attempt to write before timing out. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns SSL_CIPHER_name() + + + + + Returns SSL_CIPHER_description() + + + + + Returns SSL_CIPHER_get_bits() + + + + + Wraps the EVP_CIPHER object. + + + + + Prints the LongName of this cipher. + + + + + + Not implemented, these objects should never be disposed + + + + + Returns EVP_get_cipherbyname() + + + + + + + EVP_enc_null() + + + + + EVP_des_ecb() + + + + + EVP_des_ede() + + + + + EVP_des_ede3() + + + + + EVP_des_ede_ecb() + + + + + EVP_des_ede3_ecb() + + + + + EVP_des_cfb64() + + + + + EVP_des_cfb1() + + + + + EVP_des_cfb8() + + + + + EVP_des_ede_cfb64() + + + + + EVP_des_ede3_cfb64() + + + + + EVP_des_ede3_cfb1() + + + + + EVP_des_ede3_cfb8() + + + + + EVP_des_ofb() + + + + + EVP_ded_ede_ofb() + + + + + EVP_des_ede3_ofb() + + + + + EVP_des_cbc() + + + + + EVP_des_ede_cbc() + + + + + EVP_des_ede3_cbc() + + + + + EVP_desx_cbc() + + + + + EVP_rc4() + + + + + EVP_rc4_40() + + + + + EVP_idea_ecb() + + + + + EVP_idea_cfb64() + + + + + EVP_idea_ofb() + + + + + EVP_idea_cbc() + + + + + EVP_rc2_ecb() + + + + + EVP_rc2_cbc() + + + + + EVP_rc2_40_cbc() + + + + + EVP_rc2_64_cbc() + + + + + EVP_rc2_cfb64() + + + + + EVP_rc2_ofb() + + + + + EVP_bf_ecb() + + + + + EVP_bf_cbc() + + + + + EVP_bf_cfb64() + + + + + EVP_bf_ofb() + + + + + EVP_cast5_ecb() + + + + + EVP_cast5_cbc() + + + + + EVP_cast5_cfb64() + + + + + EVP_cast5_ofb() + + + + + EVP_aes_128_ecb() + + + + + EVP_aes_128_cbc() + + + + + EVP_aes_128_cfb1() + + + + + EVP_aes_128_cfb8() + + + + + EVP_aes_128_cfb128() + + + + + EVP_aes_128_ofb() + + + + + EVP_aes_192_ecb() + + + + + EVP_aes_192_cbc() + + + + + EVP_aes_192_cfb1() + + + + + EVP_aes_192_cfb8() + + + + + EVP_aes_192_cfb128() + + + + + EVP_aes_192_ofb() + + + + + EVP_aes_256_ecb() + + + + + EVP_aes_256_cbc() + + + + + EVP_aes_256_cfb1() + + + + + EVP_aes_256_cfb8() + + + + + EVP_aes_256_cfb128() + + + + + EVP_aes_256_ofb() + + + + + Calls OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH) + + + + + Calls OBJ_NAME_do_all(OBJ_NAME_TYPE_CIPHER_METH) + + + + + Returns the key_len field + + + + + Returns the iv_len field + + + + + Returns the block_size field + + + + + Returns the flags field + + + + + Returns the long name for the nid field using OBJ_nid2ln() + + + + + Returns the name for the nid field using OBJ_nid2sn() + + + + + Returns EVP_CIPHER_type() + + + + + Returns the long name for the type using OBJ_nid2ln() + + + + + Simple struct to encapsulate common parameters for crypto functions + + + + + The key for a crypto operation + + + + + The IV (Initialization Vector) + + + + + The payload (contains plaintext or ciphertext) + + + + + Wraps the EVP_CIPHER_CTX object. + + + + + Calls OPENSSL_malloc() and initializes the buffer using EVP_CIPHER_CTX_init() + + + + + + Returns the cipher's LongName + + + + + + Calls EVP_OpenInit() and EVP_OpenFinal() + + + + + + + + + Calls EVP_SealInit() and EVP_SealFinal() + + + + + + + + Encrypts or decrypts the specified payload. + + + + + + + + + + Calls EVP_CipherInit_ex(), EVP_CipherUpdate(), and EVP_CipherFinal_ex() + + + + + + + + + + + Encrypts the specified plaintext + + + + + + + + + Decrypts the specified ciphertext + + + + + + + + + Encrypts the specified plaintext + + + + + + + + + + Decrypts the specified ciphertext + + + + + + + + + + Calls EVP_BytesToKey + + + + + + + + + + + Calls EVP_CIPHER_CTX_clean() and then OPENSSL_free() + + + + + Returns the EVP_CIPHER for this context. + + + + + Contains the set of elements that make up a Version. + MNNFFPPS: major minor fix patch status + + + + + Create a Version from a raw uint value + + + + + + Conversion to a string. + + + + + + Calls SSLeay_version() + + + + + + Returns the current version of the native library. + + + + + Returns the version that this wrapper is built for. + + + + + Major portion of the Version. + + + + + Minor portion of the Version. + + + + + Fix portion of the Version. + + + + + Patch portion of the Version. These should start at 'a' and continue to 'z'. + + + + + Status portion of the Version. + + + + + The raw uint value. + + + + + Returns the raw status portion of a Version. + + + + + The kinds of status that + + + + + The status nibble has the value 0 + + + + + The status nibble is 1 to 14 (0x0e) + + + + + The status nibble is 0x0f + + + + + SSLEAY_* constants used for with GetVersion() + + + + + SSLEAY_VERSION + + + + + SSLEAY_CFLAGS + + + + + SSLEAY_BUILT_ON + + + + + SSLEAY_PLATFORM + + + + + SSLEAY_DIR + + + + + Wraps the native OpenSSL EVP_PKEY object + + + + + Calls EVP_PKEY_new() + + + + + Calls PEM_read_bio_PUBKEY() + + + + + + + + Calls PEM_read_bio_PUBKEY() + + + + + + + + Calls PEM_read_bio_PUBKEY() + + + + + + + + + Calls PEM_read_bio_PrivateKey() + + + + + + + + Calls PEM_read_bio_PrivateKey() + + + + + + + + Calls PEM_read_bio_PrivateKey() + + + + + + + + + Calls EVP_PKEY_set1_DSA() + + + + + + Calls EVP_PKEY_set1_RSA() + + + + + + Calls EVP_PKEY_set1_DH() + + + + + + Calls EVP_PKEY_assign() + + + + + + + Returns EVP_PKEY_get1_DSA() + + + + + + Returns EVP_PKEY_get1_DH() + + + + + + Returns EVP_PKEY_get1_RSA() + + + + + + Calls PEM_write_bio_PKCS8PrivateKey + + + + + + + + Calls PEM_write_bio_PKCS8PrivateKey + + + + + + + + + Calls EVP_PKEY_free() + + + + + Returns CompareTo(obj) + + + + + + + + + + + + + Calls appropriate Print() based on the type. + + + + + + Returns EVP_PKEY_type() + + + + + Returns EVP_PKEY_bits() + + + + + Returns EVP_PKEY_size() + + + + + Set of types that this CryptoKey can be. + + + + + EVP_PKEY_RSA + + + + + EVP_PKEY_DSA + + + + + EVP_PKEY_DH + + + + + EVP_PKEY_EC + + + + + Wraps the SSL_METHOD structure and methods + + + + + Throws NotImplementedException() + + + + + SSLv3_method() + + + + + SSLv3_server_method() + + + + + SSLv3_client_method() + + + + + SSLv23_method() + + + + + SSLv23_server_method() + + + + + SSLv23_client_method() + + + + + TLSv1_method() + + + + + TLSv1_server_method() + + + + + TLSv1_client_method() + + + + + DTLSv1_method() + + + + + DTLSv1_server_method() + + + + + DTLSv1_client_method() + + + + + Encapsulates the native openssl Diffie-Hellman functions (DH_*) + + + + + Constant generator value of 2. + + + + + Constant generator value of 5. + + + + + Calls DH_generate_parameters() + + + + + + + Calls DH_generate_parameters_ex() + + + + + + + + + Calls DH_new(). + + + + + Calls DH_new(). + + + + + + + Calls DH_new(). + + + + + + + + + Factory method that calls FromParametersPEM() to deserialize + a DH object from a PEM-formatted string. + + + + + + + Factory method that calls PEM_read_bio_DHparams() to deserialize + a DH object from a PEM-formatted string using the BIO interface. + + + + + + + Factory method that calls XXX() to deserialize + a DH object from a DER-formatted buffer using the BIO interface. + + + + + + + Calls DH_generate_key(). + + + + + Calls DH_compute_key(). + + + + + + + Calls PEM_write_bio_DHparams(). + + + + + + Calls ASN1_i2d_bio() with the i2d = i2d_DHparams(). + + + + + + Calls DHparams_print(). + + + + + + Calls DH_check(). + + + + + + Calls DH_free(). + + + + + Accessor for the p value. + + + + + Accessor for the g value. + + + + + Accessor for the pub_key value. + + + + + Accessor for the priv_key value. + + + + + Creates a BIO.MemoryBuffer(), calls WriteParametersPEM() into this buffer, + then returns the buffer as a string. + + + + + Creates a BIO.MemoryBuffer(), calls WriteParametersDER() into this buffer, + then returns the buffer. + + + + + Sets or clears the FlagNoExpConstTime bit in the flags field. + + + + + Flags for the return value of DH_check(). + + + + + + + + + + + + + + + + + + + + + + + + + Encapsulates the BIO_* functions. + + + + + Calls BIO_new_mem_buf() from the specified buffer. + + + + + + Calls BIO_new_mem_buf() from the specified string. + + + + + + Calls BIO_new(BIO_s_mem()) + + + + + + + Factory method that calls BIO_new() with BIO_s_mem() + + + + + + Factory method that calls BIO_new_file() + + + + + + + + Factory method that calls BIO_new() with BIO_f_md() + + + + + + + Calls BIO_set_close() + + + + + + Calls BIO_push() + + + + + + Calls BIO_write() + + + + + + Calls BIO_write() + + + + + + + Calls BIO_write() + + + + + + Calls BIO_write() + + + + + + Calls BIO_write() + + + + + + Calls BIO_puts() + + + + + + Calls BIO_read() + + + + + + + Calls BIO_gets() + + + + + + Returns the MessageDigestContext if this BIO's type if BIO_f_md() + + + + + + Calls BIO_free() + + + + + Returns BIO_number_read() + + + + + Returns BIO_number_written() + + + + + Returns number of bytes buffered in the BIO - calls BIO_ctrl_pending + + + + + BIO Close Options + + + + + Don't close on free + + + + + Close on freee + + + + + Wraps PKCS7 + + + + + Calls d2i_PKCS7_bio() + + + + + + + Calls PEM_read_bio_PKCS7() + + + + + + + Calls PKCS7_free() + + + + + Extracts the X509Chain of certifcates from the internal PKCS7 structure + + + + + X509_V_* + + + + + X509_V_OK + + + + + X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT + + + + + X509_V_ERR_UNABLE_TO_GET_CRL + + + + + X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE + + + + + X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE + + + + + X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY + + + + + X509_V_ERR_CERT_SIGNATURE_FAILURE + + + + + X509_V_ERR_CRL_SIGNATURE_FAILURE + + + + + X509_V_ERR_CERT_NOT_YET_VALID + + + + + X509_V_ERR_CERT_HAS_EXPIRED + + + + + X509_V_ERR_CRL_NOT_YET_VALID + + + + + X509_V_ERR_CRL_HAS_EXPIRED + + + + + X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD + + + + + X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD + + + + + X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD + + + + + X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD + + + + + X509_V_ERR_OUT_OF_MEM + + + + + X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT + + + + + X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN + + + + + X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY + + + + + X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE + + + + + X509_V_ERR_CERT_CHAIN_TOO_LONG + + + + + X509_V_ERR_CERT_REVOKED + + + + + X509_V_ERR_INVALID_CA + + + + + X509_V_ERR_PATH_LENGTH_EXCEEDED + + + + + X509_V_ERR_INVALID_PURPOSE + + + + + X509_V_ERR_CERT_UNTRUSTED + + + + + X509_V_ERR_CERT_REJECTED + + + + + X509_V_ERR_SUBJECT_ISSUER_MISMATCH + + + + + X509_V_ERR_AKID_SKID_MISMATCH + + + + + X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH + + + + + X509_V_ERR_KEYUSAGE_NO_CERTSIGN + + + + + X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER + + + + + X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION + + + + + X509_V_ERR_KEYUSAGE_NO_CRL_SIGN + + + + + X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION + + + + + X509_V_ERR_INVALID_NON_CA + + + + + X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED + + + + + X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE + + + + + X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED + + + + + X509_V_ERR_APPLICATION_VERIFICATION + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SSL_FILETYPE_PEM + + + + + SSL_FILETYPE_ASN1 + + + + + Options enumeration for Options property + + + + + Wraps the BN_* set of functions. + + + + + Creates a BigNumber object by calling BN_value_one() + + + + + Calls BN_new() + + + + + Calls BN_dup() on the BigNumber passed in. + + + + + + Creates a BigNumber by calling BN_set_word() + + + + + + Calls BN_dec2bn() + + + + + + + Calls BN_hex2bn() + + + + + + + Calls BN_bin2bn() + + + + + + + Calls BN_bn2dec() + + + + + + Calls BN_bn2hex() + + + + + + Calls BN_get_word() + + + + + + + Creates a new BigNumber object from a uint. + + + + + + + Calls BN_bn2bin() + + + + + + + Calls BN_clear() + + + + + Calls BN_add() + + + + + + + + Calls BN_sub() + + + + + + + + Determines if lhs is by-value equal to rhs + + + + + + + + Determines if lhs is by-value different than rhs + + + + + + + + Calls BN_cmp() + + + + + + + Creates a hash code by converting this object to a decimal string and + returns the hash code of that string. + + + + + + Calls BN_print() + + + + + + Calls BN_free() + + + + + Calls BN_cmp() + + + + + + + Calls BN_options() + + + + + Returns BN_num_bits() + + + + + Converts the result of Bits into the number of bytes. + + + + + Generator callback. Used mostly for status indications for long- + running generator functions. + + + + + + + + + Wraps the SST_CTX structure and methods + + + + + Calls SSL_CTX_new() + + + + + + Sets the certificate store for the context - calls SSL_CTX_set_cert_store + The X509Store object and contents will be freed when the context is disposed. + Ensure that the store object and it's contents have IsOwner set to false + before assigning them into the context. + + + + + + Sets the certificate verification mode and callback - calls SSL_CTX_set_verify + + + + + + + Sets the certificate verification depth - calls SSL_CTX_set_verify_depth + + + + + + base override - calls SSL_CTX_free() + + + + + Calls SSL_CTX_set_options + + + + + Calls SSL_CTX_set_client_CA_list/SSL_CTX_get_client_CA_list + The Stack and the X509Name objects contined within them + are freed when the context is disposed. Make sure that + the Stack and X509Name objects have set IsOwner to false + before assigning them to the context. + + + + + Wraps PCKS12_* + + + + + Calls PKCS12_create() + + + + + + + + + Calls PKCS12_create() with more options + + + friendly name + + + + How to encrypt the key + How to encrypt the certificate + # of iterations during encryption + + + + Calls d2i_PKCS12_bio() and then PKCS12_parse() + + + + + + + Calls i2d_PKCS12_bio() + + + + + + Calls PKCS12_free() + + + + + Returns the Certificate, with the PrivateKey attached if there is one. + + + + + Returns the PrivateKey + + + + + Returns a stack of CA Certificates + + + + + Password-Based Encryption (from PKCS #5) + + + + + + + + + + NID_pbeWithMD2AndDES_CBC + + + + + NID_pbeWithMD5AndDES_CBC + + + + + NID_pbeWithMD2AndRC2_CBC + + + + + NID_pbeWithMD5AndRC2_CBC + + + + + NID_pbeWithSHA1AndDES_CBC + + + + + NID_pbeWithSHA1AndRC2_CBC + + + + + NID_pbe_WithSHA1And128BitRC4 + + + + + NID_pbe_WithSHA1And40BitRC4 + + + + + NID_pbe_WithSHA1And3_Key_TripleDES_CBC + + + + + NID_pbe_WithSHA1And2_Key_TripleDES_CBC + + + + + NID_pbe_WithSHA1And128BitRC2_CBC + + + + + NID_pbe_WithSHA1And40BitRC2_CBC + + + + + + + + + + + + + + + static class for initialize OpenSSL/Crypto libraries for threading + + + + + Calls Native.InitializeThreads() + + + + + Calls Native.UninitializeThreads() + + + + + This is the low-level C-style interface to the crypto API. + Use this interface with caution. + + + + + This is the name of the DLL that P/Invoke loads and tries to bind all of + these native functions to. + + + + + #define OPENSSL_free(addr) CRYPTO_free(addr) + + + + + + #define OPENSSL_malloc(num) CRYPTO_malloc((int)num,__FILE__,__LINE__) + + + + + + + #define SSL_CTX_ctrl in ssl.h - calls SSL_CTX_ctrl() + + + + + + + + #define SSL_CTX_set_options in ssl.h - calls SSL_CTX_ctrl + + + + + + + + #define SSL_CTX_get_mode in ssl.h - calls SSL_CTX_ctrl + + + + + + + #define SSL_CTX_get_options in ssl.h - calls SSL_CTX_ctrl + + + Int32 representation of options set in the context + + + To handle binary (in)compatibility + + + callback-specific data + + + + Contains a chain X509_INFO objects. + + + + + Default null constructor + + + + + Creates a chain from a BIO. Expects the stream to contain + a collection of X509_INFO objects in PEM format by calling + PEM_X509_INFO_read_bio() + + + + + + Creates a new chain from the specified PEM-formatted string + + + + + + Returns X509_find_by_issuer_and_serial() + + + + + + + + Returns X509_find_by_subject() + + + + + + + A List for X509Certificate types. + + + + + Creates an empty X509List + + + + + Calls PEM_x509_INFO_read_bio() + + + + + + Populates this list from a PEM-formatted string + + + + + + Populates this list from a DER buffer. + + + + + diff --git a/dep/openssl/ManagedOpenSsl.dll b/dep/openssl/ManagedOpenSsl.dll new file mode 100644 index 00000000..253c2fd1 Binary files /dev/null and b/dep/openssl/ManagedOpenSsl.dll differ diff --git a/dep/openssl/ManagedOpenSsl.dll.config b/dep/openssl/ManagedOpenSsl.dll.config new file mode 100644 index 00000000..1a3e9fd6 --- /dev/null +++ b/dep/openssl/ManagedOpenSsl.dll.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/dep/openssl/libeay32.dll b/dep/openssl/libeay32.dll new file mode 100644 index 00000000..acd00c92 Binary files /dev/null and b/dep/openssl/libeay32.dll differ diff --git a/dep/openssl/src/.gitignore b/dep/openssl/src/.gitignore new file mode 100644 index 00000000..c88a0068 --- /dev/null +++ b/dep/openssl/src/.gitignore @@ -0,0 +1,4 @@ +/_ReSharper.openssl.net-2010/ +/bin/ +/*.net-2010.6.0.ReSharper.user +/*.net-2010.suo diff --git a/dep/openssl/src/LICENSE b/dep/openssl/src/LICENSE new file mode 100644 index 00000000..a2c4adcb --- /dev/null +++ b/dep/openssl/src/LICENSE @@ -0,0 +1,127 @@ + + LICENSE ISSUES + ============== + + The OpenSSL toolkit stays under a dual license, i.e. both the conditions of + the OpenSSL License and the original SSLeay license apply to the toolkit. + See below for the actual license texts. Actually both licenses are BSD-style + Open Source licenses. In case of any license issues related to OpenSSL + please contact openssl-core@openssl.org. + + OpenSSL License + --------------- + +/* ==================================================================== + * Copyright (c) 1998-2008 The OpenSSL Project. 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. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED 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 OpenSSL PROJECT OR + * ITS 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. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + + Original SSLeay License + ----------------------- + +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * 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 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 AUTHOR 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. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + diff --git a/dep/openssl/src/ManagedOpenSsl.XML b/dep/openssl/src/ManagedOpenSsl.XML new file mode 100644 index 00000000..265f27c2 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl.XML @@ -0,0 +1,4763 @@ + + + + ManagedOpenSsl + + + + + Wraps HMAC + + + + + Base class for all openssl wrapped objects. + Contains the raw unmanaged pointer and has a Handle property to get access to it. + Also overloads the ToString() method with a BIO print. + + + + + Constructor which takes the raw unmanged pointer. + This is the only way to construct this object and all dervied types. + + + + + + + This finalizer just calls Dispose(). + + + + + This method is used by the ToString() implementation. A great number of + openssl objects support printing, so this is a conveinence method. + Dervied types should override this method and not ToString(). + + The BIO stream object to print into + + + + Override of ToString() which uses Print() into a BIO memory buffer. + + + + + + This method must be implemented in derived classes. + + + + + Do nothing in the base class. + + + + + + Implementation of the IDisposable interface. + If the native pointer is not null, we haven't been disposed, and we are the owner, + then call the virtual OnDispose() method. + + + + + Throws NotImplementedException + + + + + Raw unmanaged pointer + + + + + If this object is the owner, then call the appropriate native free function. + + + + + This is to prevent double-deletion issues. + + + + + gets/sets whether the object owns the Native pointer + + + + + Access to the raw unmanaged pointer. + + + + + Calls OPENSSL_malloc() and then HMAC_CTX_init() + + + + + Calls HMAC() + + + + + + + + + Calls HMAC_Init_ex() + + + + + + + Calls HMAC_Update() + + + + + + Calls HMAC_Update() + + + + + + + + Calls HMAC_Final() + + + + + + Calls HMAC_CTX_cleanup() and then OPENSSL_free() + + + + + Helper type that handles the AddRef() method. + Derived classes must implement the LockType and RawReferenceType properties + + + + + Prints the current underlying reference count + + + + + Derived classes must return a CryptoLockTypes for this type + + + + + Derived classes must return a Type that matches the underlying type + + + + + Implements the CopyRef() method + + + + + + Helper base class that handles the AddRef() method by using a _dup() method. + + + + + Derived classes must use a _dup() method to make a copy of the underlying native data structure. + + + + + + Wraps a X509_REQ object. + + + + + Calls X509_REQ_new() + + + + + Calls X509_REQ_new() and then initializes version, subject, and key. + + + + + + + + Calls PEM_read_bio_X509_REQ() + + + + + + Creates a X509_REQ from a PEM formatted string. + + + + + + Sign this X509Request using the supplied key and digest. + + + + + + + Verify this X509Request against the supplied key. + + + + + + + Calls X509_REQ_print() + + + + + + Calls PEM_write_bio_X509_REQ() + + + + + + Converts this request into a certificate using X509_REQ_to_X509(). + + + + + + + + Calls X509_REQ_free() + + + + + Accessor to the version field. The settor calls X509_REQ_set_version(). + + + + + Accessor to the pubkey field. Uses X509_REQ_get_pubkey() and X509_REQ_set_pubkey() + + + + + Accessor to the subject field. Setter calls X509_REQ_set_subject_name(). + + + + + Returns the PEM formatted string for this object. + + + + + + + + + + + + + + + + + + + + + + + + + + + Implments an AuthenticatedStream and is the main interface to the SSL library. + + + + + Create an SslStream based on an existing stream. + + + + + + Create an SslStream based on an existing stream. + + + + + + + Create an SslStream based on an existing stream. + + + + + + + + Create an SslStream based on an existing stream. + + + + + + + + + Clears all buffers for this stream and causes any buffered data to be written to the underlying device. + + + + + Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read. + + + + + + + + + Begins an asynchronous read operation. + + + + + + + + + + + Waits for the pending asynchronous read to complete. + + + + + + + Not supported + + + + + + + + Sets the length of the current stream. + + + + + + Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written. + + + + + + + + Begins an asynchronous write operation. + + + + + + + + + + + Ends an asynchronous write operation. + + + + + + Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns whether authentication was successful. + + + + + Indicates whether data sent using this SslStream is encrypted. + + + + + Indicates whether both server and client have been authenticated. + + + + + Indicates whether the local side of the connection was authenticated as the server. + + + + + Indicates whether the data sent using this stream is signed. + + + + + Gets a value indicating whether the current stream supports reading. + + + + + Gets a value indicating whether the current stream supports seeking. + + + + + Gets a value indicating whether the current stream supports writing. + + + + + Gets the length in bytes of the stream. + + + + + Gets or sets the position within the current stream. + + + + + Gets or sets a value, in miliseconds, that determines how long the stream will attempt to read before timing out. + + + + + Gets or sets a value, in miliseconds, that determines how long the stream will attempt to write before timing out. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The Stack class can only contain objects marked with this interface. + + + + + Returns SSL_CIPHER_name() + + + + + Returns SSL_CIPHER_description() + + + + + Returns SSL_CIPHER_get_bits() + + + + + This is a struct that contains a uint for the native openssl error code. + It provides helper methods to convert this error code into strings. + + + + + Constructs an OpenSslError object. + + The native error code + + + + Returns the native error code + + + + + Returns the result of ERR_lib_error_string() + + + + + Returns the results of ERR_reason_error_string() + + + + + Returns the results of ERR_func_error_string() + + + + + Returns the results of ERR_error_string_n() + + + + + Exception class to provide OpenSSL specific information when errors occur. + + + + + When this class is instantiated, GetErrorMessage() is called automatically. + This will call ERR_get_error() on the native openssl interface, once for every + error that is in the current context. The exception message is the concatination + of each of these errors turned into strings using ERR_error_string_n(). + + + + + Returns the list of errors associated with this exception. + + + + + Wraps the DSA_* functions + + + + + Calls DSA_new() then DSA_generate_parameters_ex() + + + + + Calls DSA_new() then DSA_generate_parameters_ex() + + + + + + + + Calls DSA_new() then DSA_generate_parameters_ex() + + + + + + + + + + Returns PEM_read_bio_DSA_PUBKEY() + + + + + + + Returns PEM_read_bio_DSA_PUBKEY() + + + + + + + Returns PEM_read_bio_DSAPrivateKey() + + + + + + + Returns PEM_read_bio_DSAPrivateKey() + + + + + + + Calls DSA_generate_key() + + + + + Returns DSA_sign() + + + + + + + Returns DSA_verify() + + + + + + + + Calls PEM_write_bio_DSA_PUBKEY() + + + + + + Calls PEM_write_bio_DSAPrivateKey() + + + + + + + + + Calls DSA_print() + + + + + + Calls DSA_free() + + + + + If both objects have a private key, those are compared. + Otherwise just the params and public keys are compared. + + + + + + + Xor of the params, public key, and optionally the private key + + + + + + Returns the p field + + + + + Returns the q field + + + + + Returns the g field + + + + + Returns DSA_size() + + + + + Returns the pub_key field + + + + + Returns the priv_key field + + + + + Returns the pub_key field as a PEM string + + + + + Returns the priv_key field as a PEM string + + + + + Returns the counter + + + + + Returns the h value + + + + + Accessor for the FlagNoExpConstTime flag + + + + + Wraps ASN1_STRING_* + + + + + Calls ASN1_STRING_type_new() + + + + + Wrap existing native pointer + + + + + + + Calls ASN1_STRING_set() + + + + + + Calls ASN1_STRING_free() + + + + + Returns ASN1_STRING_cmp() + + + + + + + Returns ASN1_STRING_length() + + + + + Returns ASN1_STRING_data() + + + + + Encapsulates the BIO_* functions. + + + + + Calls BIO_new_mem_buf() from the specified buffer. + + + + + + Calls BIO_new_mem_buf() from the specified string. + + + + + + Calls BIO_new(BIO_s_mem()) + + + + + + + Factory method that calls BIO_new() with BIO_s_mem() + + + + + + Factory method that calls BIO_new_file() + + + + + + + + Factory method that calls BIO_new() with BIO_f_md() + + + + + + + Calls BIO_set_close() + + + + + + Calls BIO_push() + + + + + + Calls BIO_write() + + + + + + Calls BIO_write() + + + + + + + Calls BIO_write() + + + + + + Calls BIO_write() + + + + + + Calls BIO_write() + + + + + + Calls BIO_puts() + + + + + + Calls BIO_read() + + + + + + + Calls BIO_gets() + + + + + + Returns the MessageDigestContext if this BIO's type if BIO_f_md() + + + + + + Calls BIO_free() + + + + + Returns BIO_number_read() + + + + + Returns BIO_number_written() + + + + + Returns number of bytes buffered in the BIO - calls BIO_ctrl_pending + + + + + BIO Close Options + + + + + Don't close on free + + + + + Close on freee + + + + + Encapsultes the sk_* functions + + + + + + Calls sk_new_null() + + + + + Calls sk_shift() + + + + + + Calls sk_free() + + + + + Calls sk_dup() + + + + + + Returns sk_find() + + + + + + + Calls sk_insert() + + + + + + + Calls sk_delete() + + + + + + Calls sk_push() + + + + + + Clear all items from the stack + + + + + Returns true if the specified item exists in this stack. + + + + + + + Not implemented + + + + + + + Calls sk_delete_ptr() + + + + + + + Returns an enumerator for this stack + + + + + + Indexer that returns sk_value() or calls sk_insert() + + + + + + + Returns sk_num() + + + + + Returns false. + + + + + Wraps the SSL_METHOD structure and methods + + + + + Throws NotImplementedException() + + + + + SSLv3_method() + + + + + SSLv3_server_method() + + + + + SSLv3_client_method() + + + + + SSLv23_method() + + + + + SSLv23_server_method() + + + + + SSLv23_client_method() + + + + + TLSv1_method() + + + + + TLSv1_server_method() + + + + + TLSv1_client_method() + + + + + DTLSv1_method() + + + + + DTLSv1_server_method() + + + + + DTLSv1_client_method() + + + + + Wraps the RSA_* functions + + + + + Calls RSA_new() + + + + + Calls PEM_read_bio_RSA_PUBKEY() + + + + + + + Calls PEM_read_bio_RSAPrivateKey() + + + + + + + Calls PEM_read_bio_RSA_PUBKEY() + + + + + + + + + Calls PEM_read_bio_RSAPrivateKey() + + + + + + + + + Calls RSA_generate_key_ex() + + + + + + + + + Calls RSA_public_encrypt() + + + + + + + + Calls RSA_private_encrypt() + + + + + + + + Calls RSA_public_decrypt() + + + + + + + + Calls RSA_private_decrypt() + + + + + + + + Calls PEM_write_bio_RSA_PUBKEY() + + + + + + Calls PEM_write_bio_RSAPrivateKey() + + + + + + + + + Returns RSA_check_key() + + + + + + Calls RSA_print() + + + + + + Calls RSA_free() + + + + + Returns RSA_size() + + + + + Not finished + + + + + Accessor for the e field + + + + + Accessor for the n field + + + + + Accessor for the d field + + + + + Accessor for the p field + + + + + Accessor for the q field + + + + + Accessor for the dmp1 field. + d mod (p-1) + + + + + Accessor for the dmq1 field. + d mod (q-1) + + + + + Accessor for the iqmp field. + q^-1 mod p + + + + + Returns the public key field as a PEM string + + + + + Returns the private key field as a PEM string + + + + + RSA padding scheme + + + + + RSA_PKCS1_PADDING + + + + + RSA_SSLV23_PADDING + + + + + RSA_NO_PADDING + + + + + RSA_PKCS1_OAEP_PADDING + Optimal Asymmetric Encryption Padding + + + + + RSA_X931_PADDING + + + + + Encapsulates the native openssl Diffie-Hellman functions (DH_*) + + + + + Constant generator value of 2. + + + + + Constant generator value of 5. + + + + + Calls DH_generate_parameters() + + + + + + + Calls DH_generate_parameters_ex() + + + + + + + + + Calls DH_new(). + + + + + Calls DH_new(). + + + + + + + Calls DH_new(). + + + + + + + + + Factory method that calls FromParametersPEM() to deserialize + a DH object from a PEM-formatted string. + + + + + + + Factory method that calls PEM_read_bio_DHparams() to deserialize + a DH object from a PEM-formatted string using the BIO interface. + + + + + + + Factory method that calls XXX() to deserialize + a DH object from a DER-formatted buffer using the BIO interface. + + + + + + + Calls DH_generate_key(). + + + + + Calls DH_compute_key(). + + + + + + + Calls PEM_write_bio_DHparams(). + + + + + + Calls ASN1_i2d_bio() with the i2d = i2d_DHparams(). + + + + + + Calls DHparams_print(). + + + + + + Calls DH_check(). + + + + + + Calls DH_free(). + + + + + Accessor for the p value. + + + + + Accessor for the g value. + + + + + Accessor for the pub_key value. + + + + + Accessor for the priv_key value. + + + + + Creates a BIO.MemoryBuffer(), calls WriteParametersPEM() into this buffer, + then returns the buffer as a string. + + + + + Creates a BIO.MemoryBuffer(), calls WriteParametersDER() into this buffer, + then returns the buffer. + + + + + Sets or clears the FlagNoExpConstTime bit in the flags field. + + + + + Flags for the return value of DH_check(). + + + + + + + + + + + + + + + + + + + + + + + + + Wraps the X509_STORE object + + + + + Calls X509_STORE_new() + + + + + Initializes the X509Store object with a pre-existing native X509_STORE pointer + + + + + + + Calls X509_STORE_new() and then adds the specified chain as trusted. + + + + + + Calls X509_STORE_new() and then adds the specified chaing as trusted. + + + + + + + Returns the trusted state of the specified certificate + + + + + + + + Adds a chain to the trusted list. + + + + + + Adds a certificate to the trusted list, calls X509_STORE_add_cert() + + + + + + Add an untrusted certificate + + + + + + Calls X509_STORE_free() + + + + + Wraps the objs member on the raw X509_STORE structure + + + + + Accessor to the untrusted list + + + + + Used for generating sequence numbers by the CertificateAuthority + + + + + Returns the next available sequence number + + + + + + Implements the ISequenceNumber interface. + The sequence number is read from a file, incremented, + then written back to the file + + + + + Constructs a FileSerialNumber. The path specifies where + the serial number should be read and written to. + + + + + + Implements the Next() method of the ISequenceNumber interface. + The sequence number is read from a file, incremented, + then written back to the file + + + + + + Simple implementation of the ISequenceNumber interface. + + + + + Construct a SimpleSerialNumber with the initial sequence number set to 0. + + + + + Construct a SimpleSerialNumber with the initial sequence number + set to the value specified by the seed parameter. + + + + + + Returns the next available sequence number. + This implementation simply increments the current + sequence number and returns it. + + + + + + High-level interface which does the job of a CA (Certificate Authority) + Duties include processing incoming X509 requests and responding + with signed X509 certificates, signed by this CA's private key. + + + + + Factory method which creates a X509CertifiateAuthority where + the internal certificate is self-signed + + + + + + + + + + + Factory method that creates a X509CertificateAuthority instance with + an internal self signed certificate + + + + + + + + + + + + + Factory method that creates a X509CertificateAuthority instance with + an internal self signed certificate. This method allows creation without + the need for the Configuration file, X509V3Extensions may be added + with the X509V3ExtensionList parameter + + + + + + + + + + + + + Constructs a X509CertifcateAuthority with the specified parameters. + + + + + + + + + Process and X509Request. This includes creating a new X509Certificate + and signing this certificate with this CA's private key. + + + + + + + + + Process and X509Request. This includes creating a new X509Certificate + and signing this certificate with this CA's private key. + + + + + + + + + + Dispose the key, certificate, and the configuration + + + + + Accessor to the CA's X509 Certificate + + + + + Accessor to the CA's key used for signing. + + + + + Override to implement client/server specific handshake processing + + + + + + Renegotiate session keys - calls SSL_renegotiate + + + + + Wraps the native OpenSSL EVP_PKEY object + + + + + Calls EVP_PKEY_new() + + + + + Calls PEM_read_bio_PUBKEY() + + + + + + + + Calls PEM_read_bio_PUBKEY() + + + + + + + + Calls PEM_read_bio_PUBKEY() + + + + + + + + + Calls PEM_read_bio_PrivateKey() + + + + + + + + Calls PEM_read_bio_PrivateKey() + + + + + + + + Calls PEM_read_bio_PrivateKey() + + + + + + + + + Calls EVP_PKEY_set1_DSA() + + + + + + Calls EVP_PKEY_set1_RSA() + + + + + + Calls EVP_PKEY_set1_DH() + + + + + + Calls EVP_PKEY_assign() + + + + + + + Returns EVP_PKEY_get1_DSA() + + + + + + Returns EVP_PKEY_get1_DH() + + + + + + Returns EVP_PKEY_get1_RSA() + + + + + + Calls PEM_write_bio_PKCS8PrivateKey + + + + + + + + Calls PEM_write_bio_PKCS8PrivateKey + + + + + + + + + Calls EVP_PKEY_free() + + + + + Returns CompareTo(obj) + + + + + + + + + + + + + Calls appropriate Print() based on the type. + + + + + + Returns EVP_PKEY_type() + + + + + Returns EVP_PKEY_bits() + + + + + Returns EVP_PKEY_size() + + + + + Set of types that this CryptoKey can be. + + + + + EVP_PKEY_RSA + + + + + EVP_PKEY_DSA + + + + + EVP_PKEY_DH + + + + + EVP_PKEY_EC + + + + + Wraps the BN_* set of functions. + + + + + Creates a BigNumber object by calling BN_value_one() + + + + + Calls BN_new() + + + + + Calls BN_dup() on the BigNumber passed in. + + + + + + Creates a BigNumber by calling BN_set_word() + + + + + + Calls BN_dec2bn() + + + + + + + Calls BN_hex2bn() + + + + + + + Calls BN_bin2bn() + + + + + + + Calls BN_bn2dec() + + + + + + Calls BN_bn2hex() + + + + + + Calls BN_get_word() + + + + + + + Creates a new BigNumber object from a uint. + + + + + + + Calls BN_bn2bin() + + + + + + + Calls BN_clear() + + + + + Calls BN_add() + + + + + + + + Calls BN_sub() + + + + + + + + Determines if lhs is by-value equal to rhs + + + + + + + + Determines if lhs is by-value different than rhs + + + + + + + + Calls BN_cmp() + + + + + + + Creates a hash code by converting this object to a decimal string and + returns the hash code of that string. + + + + + + Calls BN_print() + + + + + + Calls BN_free() + + + + + Calls BN_cmp() + + + + + + + Calls BN_options() + + + + + Returns BN_num_bits() + + + + + Converts the result of Bits into the number of bytes. + + + + + Generator callback. Used mostly for status indications for long- + running generator functions. + + + + + + + + + Wraps PCKS12_* + + + + + Calls PKCS12_create() + + + + + + + + + Calls PKCS12_create() with more options + + + friendly name + + + + How to encrypt the key + How to encrypt the certificate + # of iterations during encryption + + + + Calls d2i_PKCS12_bio() and then PKCS12_parse() + + + + + + + Calls i2d_PKCS12_bio() + + + + + + Calls PKCS12_free() + + + + + Returns the Certificate, with the PrivateKey attached if there is one. + + + + + Returns the PrivateKey + + + + + Returns a stack of CA Certificates + + + + + Password-Based Encryption (from PKCS #5) + + + + + + + + + + NID_pbeWithMD2AndDES_CBC + + + + + NID_pbeWithMD5AndDES_CBC + + + + + NID_pbeWithMD2AndRC2_CBC + + + + + NID_pbeWithMD5AndRC2_CBC + + + + + NID_pbeWithSHA1AndDES_CBC + + + + + NID_pbeWithSHA1AndRC2_CBC + + + + + NID_pbe_WithSHA1And128BitRC4 + + + + + NID_pbe_WithSHA1And40BitRC4 + + + + + NID_pbe_WithSHA1And3_Key_TripleDES_CBC + + + + + NID_pbe_WithSHA1And2_Key_TripleDES_CBC + + + + + NID_pbe_WithSHA1And128BitRC2_CBC + + + + + NID_pbe_WithSHA1And40BitRC2_CBC + + + + + + + + + + + + + + + static class for initialize OpenSSL/Crypto libraries for threading + + + + + Calls Native.InitializeThreads() + + + + + Calls Native.UninitializeThreads() + + + + + This is the low-level C-style interface to the crypto API. + Use this interface with caution. + + + + + This is the name of the DLL that P/Invoke loads and tries to bind all of + these native functions to. + + + + + #define OPENSSL_free(addr) CRYPTO_free(addr) + + + + + + #define OPENSSL_malloc(num) CRYPTO_malloc((int)num,__FILE__,__LINE__) + + + + + + + #define SSL_CTX_ctrl in ssl.h - calls SSL_CTX_ctrl() + + + + + + + + #define SSL_CTX_set_options in ssl.h - calls SSL_CTX_ctrl + + + + + + + + #define SSL_CTX_get_mode in ssl.h - calls SSL_CTX_ctrl + + + + + + + #define SSL_CTX_get_options in ssl.h - calls SSL_CTX_ctrl + + + Int32 representation of options set in the context + + + To handle binary (in)compatibility + + + callback-specific data + + + + Wraps the X509_OBJECT: a glorified union + + + + + Calls X509_OBJECT_up_ref_count() + + + + + Calls X509_OBJECT_free_contents() + + + + + Returns a Certificate if the type is X509_LU_X509 + + + + + Returns the PrivateKey if the type is X509_LU_PKEY + + + + + Simple encapsulation of a local identity. + This includes the private key and the X509Certificate. + + + + + Construct an Identity with a private key + + + + + + Create a X509Request for this identity, using the specified name. + + + + + + + Create a X509Request for this identity, using the specified name and digest. + + + + + + + + Verify that the specified chain can be trusted. + + + + + + + + Returns the embedded public key of the X509Certificate + + + + + Returns the private key + + + + + Returns the X509Certificate + + + + + Wraps the X509_EXTENSION object + + + + + Calls X509_EXTENSION_new() + + + + + Calls X509V3_EXT_conf_nid() + + + + + + + + + + Calls X509_EXTENSION_free() + + + + + Calls X509V3_EXT_print() + + + + + + Calls X509_EXTENSION_dup() + + + + + + Uses X509_EXTENSION_get_object() and OBJ_nid2ln() + + + + + Uses X509_EXTENSION_get_object() and OBJ_obj2nid() + + + + + returns X509_EXTENSION_get_critical() + + + + + Returns X509_EXTENSION_get_data() + + + + + X509 Extension entry + + + + + + + + + + + + + + + + + + + + + + + + Dictionary for X509 v3 extensions - Name, Value + + + + + Callback prototype. Must return the password or prompt for one. + + + + + + + + Simple password callback that returns the contained password. + + + + + Constructs a PasswordCallback + + + + + + Suitable callback to be used as a PasswordHandler + + + + + + + + Encapsulates the X509_NAME_* functions + + + + + Calls X509_NAME_new() + + + + + Calls X509_NAME_dup() + + + + + + Calls X509_NAME_new() + + + + + + Parses the string and returns an X509Name based on value. + + + + + + + Calls X509_NAME_add_entry_by_NID after converting the + name to a NID using OBJ_txt2nid() + + + + + + + Calls X509_NAME_add_entry_by_NID() + + + + + + + Returns X509_NAME_get_text_by_NID() + + + + + + + Returns X509_NAME_get_text_by_NID() after converting the name + into a NID using OBJ_txt2nid() + + + + + + + Calls X509_NAME_get_index_by_NID() + + + + + + + + Returns the index of a name entry using GetIndexByNid() + + + + + + + + Returns the index of a name entry using GetIndexByNid() + + + + + + + Returns true if the name entry with the specified name exists. + + + + + + + Returns X509_NAME_digest() + + + + + + + + Calls X509_NAME_print_ex() + + + + + + Calls X509_NAME_free() + + + + + Returns CompareTo(rhs) == 0 + + + + + Returns ToString().GetHashCode() + + + + + Returns X509_NAME_cmp() + + + + + + + Returns X509_NAME_oneline() + + + + + Accessor to the name entry for 'CN' + + + + + Accessor to the name entry for 'C' + + + + + Accessor to the name entry for 'L' + + + + + Accessor to the name entry for 'ST' + + + + + Accessor to the name entry for 'O' + + + + + Accessor to the name entry for 'OU' + + + + + Accessor to the name entry for 'G' + + + + + Accessor to the name entry for 'S' + + + + + Accessor to the name entry for 'I' + + + + + Accessor to the name entry for 'UID' + + + + + Accessor to the name entry for 'SN' + + + + + Accessor to the name entry for 'T' + + + + + Accessor to the name entry for 'D' + + + + + Accessor to the name entry for 'X509' + + + + + Returns X509_NAME_entry_count() + + + + + Indexer to a name entry by name + + + + + + + Indexer to a name entry by index + + + + + + + Contains the set of elements that make up a Version. + MNNFFPPS: major minor fix patch status + + + + + Create a Version from a raw uint value + + + + + + Conversion to a string. + + + + + + Calls SSLeay_version() + + + + + + Returns the current version of the native library. + + + + + Returns the version that this wrapper is built for. + + + + + Major portion of the Version. + + + + + Minor portion of the Version. + + + + + Fix portion of the Version. + + + + + Patch portion of the Version. These should start at 'a' and continue to 'z'. + + + + + Status portion of the Version. + + + + + The raw uint value. + + + + + Returns the raw status portion of a Version. + + + + + The kinds of status that + + + + + The status nibble has the value 0 + + + + + The status nibble is 1 to 14 (0x0e) + + + + + The status nibble is 0x0f + + + + + SSLEAY_* constants used for with GetVersion() + + + + + SSLEAY_VERSION + + + + + SSLEAY_CFLAGS + + + + + SSLEAY_BUILT_ON + + + + + SSLEAY_PLATFORM + + + + + SSLEAY_DIR + + + + + Wraps the EVP_MD object + + + + + Creates a EVP_MD struct + + + + + + + Prints MessageDigest + + + + + + Not implemented, these objects should never be disposed. + + + + + Calls EVP_get_digestbyname() + + + + + + + EVP_md_null() + + + + + EVP_md4() + + + + + EVP_md5() + + + + + EVP_sha() + + + + + EVP_sha1() + + + + + EVP_sha224() + + + + + EVP_sha256() + + + + + EVP_sha384() + + + + + EVP_sha512() + + + + + EVP_dss() + + + + + EVP_dss1() + + + + + EVP_ripemd160() + + + + + Calls OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH) + + + + + Calls OBJ_NAME_do_all(OBJ_NAME_TYPE_CIPHER_METH) + + + + + Returns the block_size field + + + + + Returns the md_size field + + + + + Returns the type field using OBJ_nid2ln() + + + + + Returns the type field using OBJ_nid2sn() + + + + + Wraps the EVP_MD_CTX object + + + + + Calls BIO_get_md_ctx() then BIO_get_md() + + + + + + Calls EVP_MD_CTX_create() then EVP_MD_CTX_init() + + + + + + Prints the long name + + + + + + Calls EVP_DigestInit_ex(), EVP_DigestUpdate(), and EVP_DigestFinal_ex() + + + + + + + Calls EVP_DigestInit_ex() + + + + + Calls EVP_DigestUpdate() + + + + + + Calls EVP_DigestFinal_ex() + + + + + + Calls EVP_SignFinal() + + + + + + + Calls EVP_VerifyFinal() + + + + + + + + Calls EVP_DigestInit_ex(), EVP_DigestUpdate(), and EVP_SignFinal() + + + + + + + + Calls EVP_SignFinal() + + + + + + + + + Calls EVP_DigestInit_ex(), EVP_DigestUpdate(), and EVP_VerifyFinal() + + + + + + + + + Calls EVP_VerifyFinal() + + + + + + + + + + Calls EVP_MD_CTX_cleanup() and EVP_MD_CTX_destroy() + + + + + Useful for tracking down memory leaks + + + + + Begins memory tracking + + + + + Stops memory tracking and reports any leaks found since Start() was called. + + + + + Returns the number of bytes leaked between Start() and Finish() + + + + + Wraps the X509 object + + + + + Calls X509_new() + + + + + Calls PEM_read_bio_X509() + + + + + + Factory method that returns a X509 using d2i_X509_bio() + + + + + + + Factory method to create a X509Certificate from a PKCS7 encoded in PEM + + + + + + + Factory method to create a X509Certificate from a PKCS7 encoded in DER + + + + + + + Factory method to create a X509Certificate from a PKCS12 + + + + + + + + Creates a new X509 certificate + + + + + + + + + + + Calls X509_sign() + + + + + + + Returns X509_check_private_key() + + + + + + + Returns X509_check_trust() + + + + + + + + Returns X509_verify() + + + + + + + Returns X509_digest() + + + + + + + + Returns X509_pubkey_digest() + + + + + + + + Calls PEM_write_bio_X509() + + + + + + Calls i2d_X509_bio() + + + + + + Calls X509_print() + + + + + + Converts a X509 into a request using X509_to_X509_REQ() + + + + + + + + Calls X509_add_ext() + + + + + + Calls X509_add1_ext_i2d() + + + + + + + + + + + + + + + Calls X509_free() + + + + + Compares X509Certificate + + + + + + + Returns the hash code of the issuer's oneline xor'd with the serial number + + + + + + Returns X509_cmp() + + + + + + + Uses X509_get_subject_name() and X509_set_issuer_name() + + + + + Uses X509_get_issuer_name() and X509_set_issuer_name() + + + + + Uses X509_get_serialNumber() and X509_set_serialNumber() + + + + + Uses the notBefore field and X509_set_notBefore() + + + + + Uses the notAfter field and X509_set_notAfter() + + + + + Uses the version field and X509_set_version() + + + + + Uses X509_get_pubkey() and X509_set_pubkey() + + + + + Returns whether or not a Private Key is attached to this Certificate + + + + + Gets and Sets the Private Key for this Certificate. + The Private Key MUST match the Public Key. + + + + + Returns the PEM formatted string of this object + + + + + Returns the DER formatted byte array for this object + + + + + + + + + + Exposes the RAND_* functions. + + + + + Calls RAND_seed() + + + + + + Calls RAND_seed() + + + + + + Calls RAND_pseudo_bytes() + + + + + + + Calls RAND_cleanup() + + + + + Calls RAND_bytes() + + + + + + + Calls RAND_add() + + + + + + + Calls RAND_load_file() + + + + + + + Calls RAND_write_file() + + + + + + Calls RAND_file_name() + + + + + + Calls RAND_query_egd_bytes() + + + + + + + + Calls RAND_egd() + + + + + + Calls RAND_egd_bytes() + + + + + + + Calls RAND_poll() + + + + + Calls BN_rand() + + + + + + + + + Calls BN_rand_range() + + + + + + + Calls BN_pseudo_rand() + + + + + + + + + Calls BN_pseudo_rand_range() + + + + + + + Returns RAND_status() + + + + + Wraps X509V3_CTX + + + + + Calls OPENSSL_malloc() + + + + + Calls X509V3_set_ctx() + + + + + + + + X509V3_set_ctx_nodb - sets the db pointer to NULL + + + + + Calls X509V3_set_nconf() + + + + + + Calls OPENSSL_free() + + + + + Wraps the NCONF_* functions + + + + + Calls NCONF_new() + + + + + Calls NCONF_load() + + + + + + Calls NCONF_load() + + + + + + Creates a X509v3Context(), calls X509V3_set_ctx() on it, then calls + X509V3_EXT_add_nconf() + + + + + + + + + Calls NCONF_free() + + + + + X509_V_* + + + + + X509_V_OK + + + + + X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT + + + + + X509_V_ERR_UNABLE_TO_GET_CRL + + + + + X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE + + + + + X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE + + + + + X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY + + + + + X509_V_ERR_CERT_SIGNATURE_FAILURE + + + + + X509_V_ERR_CRL_SIGNATURE_FAILURE + + + + + X509_V_ERR_CERT_NOT_YET_VALID + + + + + X509_V_ERR_CERT_HAS_EXPIRED + + + + + X509_V_ERR_CRL_NOT_YET_VALID + + + + + X509_V_ERR_CRL_HAS_EXPIRED + + + + + X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD + + + + + X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD + + + + + X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD + + + + + X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD + + + + + X509_V_ERR_OUT_OF_MEM + + + + + X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT + + + + + X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN + + + + + X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY + + + + + X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE + + + + + X509_V_ERR_CERT_CHAIN_TOO_LONG + + + + + X509_V_ERR_CERT_REVOKED + + + + + X509_V_ERR_INVALID_CA + + + + + X509_V_ERR_PATH_LENGTH_EXCEEDED + + + + + X509_V_ERR_INVALID_PURPOSE + + + + + X509_V_ERR_CERT_UNTRUSTED + + + + + X509_V_ERR_CERT_REJECTED + + + + + X509_V_ERR_SUBJECT_ISSUER_MISMATCH + + + + + X509_V_ERR_AKID_SKID_MISMATCH + + + + + X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH + + + + + X509_V_ERR_KEYUSAGE_NO_CERTSIGN + + + + + X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER + + + + + X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION + + + + + X509_V_ERR_KEYUSAGE_NO_CRL_SIGN + + + + + X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION + + + + + X509_V_ERR_INVALID_NON_CA + + + + + X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED + + + + + X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE + + + + + X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED + + + + + X509_V_ERR_APPLICATION_VERIFICATION + + + + + Calls SSL_new() + + + + + + Calls SSL_free() + + + + + V_CRYPTO_MDEBUG_* + + + + + V_CRYPTO_MDEBUG_TIME + + + + + V_CRYPTO_MDEBUG_THREAD + + + + + V_CRYPTO_MDEBUG_ALL + + + + + CRYPTO_MEM_CHECK_* + + + + + CRYPTO_MEM_CHECK_OFF + for applications + + + + + CRYPTO_MEM_CHECK_ON + for applications + + + + + CRYPTO_MEM_CHECK_ENABLE + for library-internal use + + + + + CRYPTO_MEM_CHECK_DISABLE + for library-internal use + + + + + Exposes the CRYPTO_* functions + + + + + Calls CRYPTO_malloc_debug_init() + + + + + Calls CRYPTO_dbg_set_options() + + + + + + Calls CRYPTO_mem_ctrl() + + + + + + Calls CRYPTO_cleanup_all_ex_data() + + + + + Calls ERR_remove_state() + + + + + + Calls CRYPTO_mem_leaks_cb() + + + + + + Returns MD2_options() + + + + + Returns RC4_options() + + + + + Returns DES_options() + + + + + Returns idea_options() + + + + + Returns BF_options() + + + + + CRYPTO_MEM_LEAK_CB + + + + + + + + + + Contains a chain X509_INFO objects. + + + + + Default null constructor + + + + + Creates a chain from a BIO. Expects the stream to contain + a collection of X509_INFO objects in PEM format by calling + PEM_X509_INFO_read_bio() + + + + + + Creates a new chain from the specified PEM-formatted string + + + + + + Returns X509_find_by_issuer_and_serial() + + + + + + + + Returns X509_find_by_subject() + + + + + + + A List for X509Certificate types. + + + + + Creates an empty X509List + + + + + Calls PEM_x509_INFO_read_bio() + + + + + + Populates this list from a PEM-formatted string + + + + + + Populates this list from a DER buffer. + + + + + + Wraps PKCS7 + + + + + Calls d2i_PKCS7_bio() + + + + + + + Calls PEM_read_bio_PKCS7() + + + + + + + Calls PKCS7_free() + + + + + Extracts the X509Chain of certifcates from the internal PKCS7 structure + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SSL_FILETYPE_PEM + + + + + SSL_FILETYPE_ASN1 + + + + + Options enumeration for Options property + + + + + Wraps the EVP_CIPHER object. + + + + + Prints the LongName of this cipher. + + + + + + Not implemented, these objects should never be disposed + + + + + Returns EVP_get_cipherbyname() + + + + + + + EVP_enc_null() + + + + + EVP_des_ecb() + + + + + EVP_des_ede() + + + + + EVP_des_ede3() + + + + + EVP_des_ede_ecb() + + + + + EVP_des_ede3_ecb() + + + + + EVP_des_cfb64() + + + + + EVP_des_cfb1() + + + + + EVP_des_cfb8() + + + + + EVP_des_ede_cfb64() + + + + + EVP_des_ede3_cfb64() + + + + + EVP_des_ede3_cfb1() + + + + + EVP_des_ede3_cfb8() + + + + + EVP_des_ofb() + + + + + EVP_ded_ede_ofb() + + + + + EVP_des_ede3_ofb() + + + + + EVP_des_cbc() + + + + + EVP_des_ede_cbc() + + + + + EVP_des_ede3_cbc() + + + + + EVP_desx_cbc() + + + + + EVP_rc4() + + + + + EVP_rc4_40() + + + + + EVP_idea_ecb() + + + + + EVP_idea_cfb64() + + + + + EVP_idea_ofb() + + + + + EVP_idea_cbc() + + + + + EVP_rc2_ecb() + + + + + EVP_rc2_cbc() + + + + + EVP_rc2_40_cbc() + + + + + EVP_rc2_64_cbc() + + + + + EVP_rc2_cfb64() + + + + + EVP_rc2_ofb() + + + + + EVP_bf_ecb() + + + + + EVP_bf_cbc() + + + + + EVP_bf_cfb64() + + + + + EVP_bf_ofb() + + + + + EVP_cast5_ecb() + + + + + EVP_cast5_cbc() + + + + + EVP_cast5_cfb64() + + + + + EVP_cast5_ofb() + + + + + EVP_aes_128_ecb() + + + + + EVP_aes_128_cbc() + + + + + EVP_aes_128_cfb1() + + + + + EVP_aes_128_cfb8() + + + + + EVP_aes_128_cfb128() + + + + + EVP_aes_128_ofb() + + + + + EVP_aes_192_ecb() + + + + + EVP_aes_192_cbc() + + + + + EVP_aes_192_cfb1() + + + + + EVP_aes_192_cfb8() + + + + + EVP_aes_192_cfb128() + + + + + EVP_aes_192_ofb() + + + + + EVP_aes_256_ecb() + + + + + EVP_aes_256_cbc() + + + + + EVP_aes_256_cfb1() + + + + + EVP_aes_256_cfb8() + + + + + EVP_aes_256_cfb128() + + + + + EVP_aes_256_ofb() + + + + + Calls OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH) + + + + + Calls OBJ_NAME_do_all(OBJ_NAME_TYPE_CIPHER_METH) + + + + + Returns the key_len field + + + + + Returns the iv_len field + + + + + Returns the block_size field + + + + + Returns the flags field + + + + + Returns the long name for the nid field using OBJ_nid2ln() + + + + + Returns the name for the nid field using OBJ_nid2sn() + + + + + Returns EVP_CIPHER_type() + + + + + Returns the long name for the type using OBJ_nid2ln() + + + + + Simple struct to encapsulate common parameters for crypto functions + + + + + The key for a crypto operation + + + + + The IV (Initialization Vector) + + + + + The payload (contains plaintext or ciphertext) + + + + + Wraps the EVP_CIPHER_CTX object. + + + + + Calls OPENSSL_malloc() and initializes the buffer using EVP_CIPHER_CTX_init() + + + + + + Returns the cipher's LongName + + + + + + Calls EVP_OpenInit() and EVP_OpenFinal() + + + + + + + + + Calls EVP_SealInit() and EVP_SealFinal() + + + + + + + + Encrypts or decrypts the specified payload. + + + + + + + + + + Calls EVP_CipherInit_ex(), EVP_CipherUpdate(), and EVP_CipherFinal_ex() + + + + + + + + + + + Encrypts the specified plaintext + + + + + + + + + Decrypts the specified ciphertext + + + + + + + + + Encrypts the specified plaintext + + + + + + + + + + Decrypts the specified ciphertext + + + + + + + + + + Calls EVP_BytesToKey + + + + + + + + + + + Calls EVP_CIPHER_CTX_clean() and then OPENSSL_free() + + + + + Returns the EVP_CIPHER for this context. + + + + + Wraps the X509_STORE_CTX object + + + + + Calls X509_STORE_CTX_new() + + + + + Calls X509_STORE_CTX_init() + + + + + + + + Returns X509_verify_cert() + + + + + + Calls X509_STORE_CTX_free() + + + + + Returns X509_STORE_CTX_get_current_cert() + + + + + Returns X509_STORE_CTX_get_error_depth() + + + + + Getter returns X509_STORE_CTX_get_error(), setter calls X509_STORE_CTX_set_error() + + + + + Returns an X509Store based on this context + + + + + Returns X509_verify_cert_error_string() + + + + + Wraps the SST_CTX structure and methods + + + + + Calls SSL_CTX_new() + + + + + + Sets the certificate store for the context - calls SSL_CTX_set_cert_store + The X509Store object and contents will be freed when the context is disposed. + Ensure that the store object and it's contents have IsOwner set to false + before assigning them into the context. + + + + + + Sets the certificate verification mode and callback - calls SSL_CTX_set_verify + + + + + + + Sets the certificate verification depth - calls SSL_CTX_set_verify_depth + + + + + + base override - calls SSL_CTX_free() + + + + + Calls SSL_CTX_set_options + + + + + Calls SSL_CTX_set_client_CA_list/SSL_CTX_get_client_CA_list + The Stack and the X509Name objects contined within them + are freed when the context is disposed. Make sure that + the Stack and X509Name objects have set IsOwner to false + before assigning them to the context. + + + + diff --git a/dep/openssl/src/ManagedOpenSsl/.gitignore b/dep/openssl/src/ManagedOpenSsl/.gitignore new file mode 100644 index 00000000..4ded7c4c --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/.gitignore @@ -0,0 +1,2 @@ +/bin/ +/obj/ diff --git a/dep/openssl/src/ManagedOpenSsl/App.config b/dep/openssl/src/ManagedOpenSsl/App.config new file mode 100644 index 00000000..c45cecf0 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/App.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/dep/openssl/src/ManagedOpenSsl/Core/Asn1DateTime.cs b/dep/openssl/src/ManagedOpenSsl/Core/Asn1DateTime.cs new file mode 100644 index 00000000..4eb60f32 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/Core/Asn1DateTime.cs @@ -0,0 +1,96 @@ +// Copyright (c) 2009 Frank Laub +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Globalization; + +namespace OpenSSL.Core +{ + class Asn1DateTime : Base + { + internal Asn1DateTime(IntPtr ptr, bool takeOwnership) + : base(ptr, takeOwnership) + { } + + public Asn1DateTime() + : base(Native.ASN1_TIME_new(), true) + { } + + public Asn1DateTime(DateTime dateTime) + : this() + { + this.DateTime = dateTime; + } + + protected override void OnDispose() + { + Native.ASN1_TIME_free(this.ptr); + } + + public DateTime DateTime + { + get + { + return ToDateTime(this.ptr); + } + set + { + long time_t = DateTimeToTimeT(value.ToUniversalTime()); + Native.ASN1_TIME_set(this.ptr, time_t); + } + } + + public static DateTime ToDateTime(IntPtr ptr) + { + return AsnTimeToDateTime(ptr).ToLocalTime(); + } + + private long DateTimeToTimeT(DateTime value) + { + DateTime dt1970 = new DateTime(1970, 1, 1, 0, 0, 0, 0); + // # of 100 nanoseconds since 1970 + long ticks = (value.Ticks - dt1970.Ticks) / 10000000L; + return ticks; + } + + private static DateTime AsnTimeToDateTime(IntPtr ptr) + { + string str; + using (BIO bio = BIO.MemoryBuffer()) + { + Native.ExpectSuccess(Native.ASN1_UTCTIME_print(bio.Handle, ptr)); + str = bio.ReadString(); + } + string[] fmts = + { + "MMM d HH:mm:ss yyyy G\\MT", + "MMM dd HH:mm:ss yyyy G\\MT" + }; + return DateTime.ParseExact(str, fmts, new DateTimeFormatInfo(), DateTimeStyles.AssumeUniversal | DateTimeStyles.AdjustToUniversal); + } + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/Core/Asn1Integer.cs b/dep/openssl/src/ManagedOpenSsl/Core/Asn1Integer.cs new file mode 100644 index 00000000..8140056b --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/Core/Asn1Integer.cs @@ -0,0 +1,65 @@ +// Copyright (c) 2009 Frank Laub +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Globalization; + +namespace OpenSSL.Core +{ + class Asn1Integer : Base + { + internal Asn1Integer(IntPtr ptr, bool takeOwnership) + : base(ptr, takeOwnership) + { } + + public Asn1Integer() + : base(Native.ASN1_INTEGER_new(), true) + { } + + public Asn1Integer(int value) + : this() + { + this.Value = value; + } + + protected override void OnDispose() + { + Native.ASN1_TIME_free(this.ptr); + } + + public int Value + { + get { return Native.ASN1_INTEGER_get(this.ptr); } + set { Native.ExpectSuccess(Native.ASN1_INTEGER_set(this.ptr, value)); } + } + + public static int ToInt32(IntPtr ptr) + { + return Native.ASN1_INTEGER_get(ptr); + } + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/Core/Asn1String.cs b/dep/openssl/src/ManagedOpenSsl/Core/Asn1String.cs new file mode 100644 index 00000000..a63642b2 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/Core/Asn1String.cs @@ -0,0 +1,123 @@ +// Copyright (c) 2009 Frank Laub +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; + +namespace OpenSSL.Core +{ + /// + /// Wraps ASN1_STRING_* + /// + public class Asn1String : BaseValueType, IComparable + { + #region Intialization + /// + /// Calls ASN1_STRING_type_new() + /// + public Asn1String() + : base(Native.ASN1_STRING_type_new(Native.V_ASN1_OCTET_STRING), true) + { + } + + /// + /// Wrap existing native pointer + /// + /// + /// + internal Asn1String(IntPtr ptr, bool takeOwnership) + : base(ptr, takeOwnership) + { + } + + /// + /// Calls ASN1_STRING_set() + /// + /// + public Asn1String(byte[] data) + : this() + { + Native.ExpectSuccess(Native.ASN1_STRING_set(this.ptr, data, data.Length)); + } + #endregion + + #region Properties + /// + /// Returns ASN1_STRING_length() + /// + public int Length + { + get { return Native.ASN1_STRING_length(this.ptr); } + } + + /// + /// Returns ASN1_STRING_data() + /// + public byte[] Data + { + get + { + IntPtr pData = Native.ASN1_STRING_data(this.ptr); + byte[] ret = new byte[this.Length]; + Marshal.Copy(pData, ret, 0, ret.Length); + return ret; + } + } + #endregion + + #region Overrides + + internal override IntPtr DuplicateHandle() + { + return Native.ASN1_STRING_dup(this.ptr); + } + + /// + /// Calls ASN1_STRING_free() + /// + protected override void OnDispose() + { + Native.ASN1_STRING_free(this.ptr); + } + + #endregion + + #region IComparable Members + + /// + /// Returns ASN1_STRING_cmp() + /// + /// + /// + public int CompareTo(Asn1String other) + { + return Native.ASN1_STRING_cmp(this.ptr, other.Handle); + } + + #endregion + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/Core/BIO.cs b/dep/openssl/src/ManagedOpenSsl/Core/BIO.cs new file mode 100644 index 00000000..174d1d20 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/Core/BIO.cs @@ -0,0 +1,309 @@ +// Copyright (c) 2006-2007 Frank Laub +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using OpenSSL.Crypto; + +namespace OpenSSL.Core +{ + /// + /// Encapsulates the BIO_* functions. + /// + public class BIO : Base + { + #region Initialization + internal BIO(IntPtr ptr, bool owner) : base(ptr, owner) { } + + /// + /// Calls BIO_new_mem_buf() from the specified buffer. + /// + /// + public BIO(byte[] buf) + : base(Native.ExpectNonNull(Native.BIO_new_mem_buf(buf, buf.Length)), true) + { + } + + /// + /// Calls BIO_new_mem_buf() from the specified string. + /// + /// + public BIO(string str) + : this(Encoding.ASCII.GetBytes(str)) + { + } + + /// + /// Calls BIO_new(BIO_s_mem()) + /// + /// + /// + public static BIO MemoryBuffer(bool takeOwnership) + { + IntPtr ptr = Native.ExpectNonNull(Native.BIO_new(Native.BIO_s_mem())); + return new BIO(ptr, takeOwnership); + } + + /// + /// Factory method that calls BIO_new() with BIO_s_mem() + /// + /// + public static BIO MemoryBuffer() + { + return MemoryBuffer(true); + } + + /// + /// Factory method that calls BIO_new_file() + /// + /// + /// + /// + public static BIO File(string filename, string mode) + { + IntPtr ptr = Native.ExpectNonNull(Native.BIO_new_file(filename, mode)); + return new BIO(ptr, true); + } + + private const int FD_STDIN = 0; + private const int FD_STDOUT = 1; + private const int FD_STDERR = 2; + + /// + /// Factory method that calls BIO_new() with BIO_f_md() + /// + /// + /// + public static BIO MessageDigest(MessageDigest md) + { + IntPtr ptr = Native.ExpectNonNull(Native.BIO_new(Native.BIO_f_md())); + Native.BIO_set_md(ptr, md.Handle); + return new BIO(ptr, true); + } + + //public static BIO MessageDigestContext(MessageDigestContext ctx) + //{ + // IntPtr ptr = Native.ExpectNonNull(Native.BIO_new(Native.BIO_f_md())); + // //IntPtr ptr = Native.ExpectNonNull(Native.BIO_new(Native.BIO_f_null())); + // Native.BIO_set_md_ctx(ptr, ctx.Handle); + // return new BIO(ptr); + //} + #endregion + + #region Properties + /// + /// Returns BIO_number_read() + /// + public uint NumberRead + { + get { return Native.BIO_number_read(this.Handle); } + } + + /// + /// Returns BIO_number_written() + /// + public uint NumberWritten + { + get { return Native.BIO_number_written(this.Handle); } + } + + /// + /// Returns number of bytes buffered in the BIO - calls BIO_ctrl_pending + /// + public uint BytesPending + { + get { return Native.BIO_ctrl_pending(this.Handle); } + } + + #endregion + + #region Methods + + /// + /// BIO Close Options + /// + public enum CloseOption + { + /// + /// Don't close on free + /// + NoClose = 0, + /// + /// Close on freee + /// + Close = 1 + } + + /// + /// Calls BIO_set_close() + /// + /// + public void SetClose(CloseOption opt) + { + Native.BIO_set_close(this.ptr, (int)opt); + } + + /// + /// Calls BIO_push() + /// + /// + public void Push(BIO bio) + { + Native.ExpectNonNull(Native.BIO_push(this.ptr, bio.Handle)); + } + + /// + /// Calls BIO_write() + /// + /// + public void Write(byte[] buf) + { + if (Native.BIO_write(this.ptr, buf, buf.Length) != buf.Length) + throw new OpenSslException(); + } + + /// + /// Calls BIO_write() + /// + /// + /// + public void Write(byte[] buf, int len) + { + if (Native.BIO_write(this.ptr, buf, len) != len) + throw new OpenSslException(); + } + + /// + /// Calls BIO_write() + /// + /// + public void Write(byte value) + { + byte[] buf = new byte[1]; + buf[0] = value; + Write(buf); + } + + /// + /// Calls BIO_write() + /// + /// + public void Write(ushort value) + { + MemoryStream ms = new MemoryStream(); + BinaryWriter br = new BinaryWriter(ms); + br.Write(value); + byte[] buf = ms.ToArray(); + Write(buf); + } + + /// + /// Calls BIO_write() + /// + /// + public void Write(uint value) + { + MemoryStream ms = new MemoryStream(); + BinaryWriter br = new BinaryWriter(ms); + br.Write(value); + byte[] buf = ms.ToArray(); + Write(buf); + } + + /// + /// Calls BIO_puts() + /// + /// + public void Write(string str) + { + byte[] buf = Encoding.ASCII.GetBytes(str); + if (Native.BIO_puts(this.ptr, buf) != buf.Length) + throw new OpenSslException(); + } + + /// + /// Calls BIO_read() + /// + /// + /// + public ArraySegment ReadBytes(int count) + { + byte[] buf = new byte[count]; + int ret = Native.BIO_read(this.ptr, buf, buf.Length); + if (ret < 0) + throw new OpenSslException(); + + return new ArraySegment(buf, 0, ret); + } + + /// + /// Calls BIO_gets() + /// + /// + public string ReadString() + { + StringBuilder sb = new StringBuilder(); + const int BLOCK_SIZE = 64; + byte[] buf = new byte[BLOCK_SIZE]; + int ret = 0; + while (true) + { + ret = Native.BIO_gets(this.ptr, buf, buf.Length); + if (ret == 0) + break; + if (ret < 0) + throw new OpenSslException(); + + sb.Append(Encoding.ASCII.GetString(buf, 0, ret)); + } + return sb.ToString(); + } + + /// + /// Returns the MessageDigestContext if this BIO's type if BIO_f_md() + /// + /// + public MessageDigestContext GetMessageDigestContext() + { + return new MessageDigestContext(this); + } + + #endregion + + #region Overrides + + /// + /// Calls BIO_free() + /// + protected override void OnDispose() + { + Native.BIO_free(this.ptr); + } + + #endregion + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/Core/Base.cs b/dep/openssl/src/ManagedOpenSsl/Core/Base.cs new file mode 100644 index 00000000..43e0154f --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/Core/Base.cs @@ -0,0 +1,269 @@ +// Copyright (c) 2006-2009 Frank Laub +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.Reflection; + +namespace OpenSSL.Core +{ + /// + /// Base class for all openssl wrapped objects. + /// Contains the raw unmanaged pointer and has a Handle property to get access to it. + /// Also overloads the ToString() method with a BIO print. + /// + public abstract class Base : IDisposable + { + /// + /// Constructor which takes the raw unmanged pointer. + /// This is the only way to construct this object and all dervied types. + /// + /// + /// + protected Base(IntPtr ptr, bool takeOwnership) + { + this.ptr = ptr; + this.owner = takeOwnership; + if (this.ptr != IntPtr.Zero) + { + this.OnNewHandle(this.ptr); + } + } + + /// + /// This finalizer just calls Dispose(). + /// + ~Base() + { + Dispose(); + } + + /// + /// This method is used by the ToString() implementation. A great number of + /// openssl objects support printing, so this is a conveinence method. + /// Dervied types should override this method and not ToString(). + /// + /// The BIO stream object to print into + public virtual void Print(BIO bio) { } + + /// + /// Override of ToString() which uses Print() into a BIO memory buffer. + /// + /// + public override string ToString() { + try { + if (this.ptr == IntPtr.Zero) + return "(null)"; + + using (BIO bio = BIO.MemoryBuffer()) { + this.Print(bio); + return bio.ReadString(); + } + } + catch (Exception) { + return ""; + } + } + + /// + /// This method must be implemented in derived classes. + /// + protected abstract void OnDispose(); + + /// + /// Do nothing in the base class. + /// + /// + internal virtual void OnNewHandle(IntPtr ptr) + { + } + + #region IDisposable Members + + /// + /// Implementation of the IDisposable interface. + /// If the native pointer is not null, we haven't been disposed, and we are the owner, + /// then call the virtual OnDispose() method. + /// + public void Dispose() { + if (!this.isDisposed && this.owner && this.ptr != IntPtr.Zero) { + this.OnDispose(); + DoAfterDispose(); + } + this.isDisposed = true; + } + + #endregion + + /// + /// gets/sets whether the object owns the Native pointer + /// + public virtual bool IsOwner + { + get { return owner; } + internal set { owner = value; } + } + + /// + /// Access to the raw unmanaged pointer. + /// + public virtual IntPtr Handle + { + get { return this.ptr; } + } + + /// + /// Throws NotImplementedException + /// + internal virtual void AddRef() + { + throw new NotImplementedException(); + } + + private void DoAfterDispose() + { + this.ptr = IntPtr.Zero; + GC.SuppressFinalize(this); + } + + /// + /// Raw unmanaged pointer + /// + protected IntPtr ptr; + + /// + /// If this object is the owner, then call the appropriate native free function. + /// + protected bool owner = false; + + /// + /// This is to prevent double-deletion issues. + /// + protected bool isDisposed = false; + + } + + /// + /// Helper type that handles the AddRef() method. + /// Derived classes must implement the LockType and RawReferenceType properties + /// + public abstract class BaseReferenceType : Base + { + internal BaseReferenceType(IntPtr ptr, bool takeOwnership) + : base(ptr, takeOwnership) + { + this.baseOffset = Marshal.OffsetOf(RawReferenceType, "references"); + } + + internal override void AddRef() + { + IntPtr offset = GetReferencesOffset(); + Native.CRYPTO_add_lock(offset, 1, LockType, "Base.cs", 0); + } + + /// + /// Prints the current underlying reference count + /// + public void PrintRefCount() + { + IntPtr offset = GetReferencesOffset(); + int count = Marshal.ReadInt32(offset); + Console.WriteLine("{0} ptr: {1}, ref_count: {2}", this.GetType().Name, this.ptr, count); + } + + private IntPtr GetReferencesOffset() + { + return new IntPtr((long)this.ptr + (long)this.baseOffset); + } + + /// + /// Derived classes must return a CryptoLockTypes for this type + /// + internal abstract CryptoLockTypes LockType { get; } + + /// + /// Derived classes must return a Type that matches the underlying type + /// + internal abstract Type RawReferenceType { get; } + + private IntPtr baseOffset; + } + + /// + /// Implements the CopyRef() method + /// + /// + public abstract class BaseCopyableRef : BaseReferenceType where T : BaseCopyableRef + { + internal BaseCopyableRef(IntPtr ptr, bool takeOwnership) + : base(ptr, takeOwnership) + { + } + + internal T CopyRef() + { + object[] args = new object[] { + this.ptr, + true + }; + BindingFlags flags = + BindingFlags.NonPublic | + BindingFlags.Public | + BindingFlags.Instance; + T ret = (T)Activator.CreateInstance(typeof(T), flags, null, args, null); + ret.AddRef(); + return ret; + } + } + + /// + /// Helper base class that handles the AddRef() method by using a _dup() method. + /// + public abstract class BaseValueType : Base + { + internal BaseValueType(IntPtr ptr, bool takeOwnership) + : base(ptr, takeOwnership) + { + } + + internal override void AddRef() + { + this.ptr = DuplicateHandle(); + this.owner = true; + if (this.ptr != IntPtr.Zero) + { + this.OnNewHandle(this.ptr); + } + } + + /// + /// Derived classes must use a _dup() method to make a copy of the underlying native data structure. + /// + /// + internal abstract IntPtr DuplicateHandle(); + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/Core/BigNum.cs b/dep/openssl/src/ManagedOpenSsl/Core/BigNum.cs new file mode 100644 index 00000000..5a75dfa0 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/Core/BigNum.cs @@ -0,0 +1,376 @@ +// Copyright (c) 2006-2007 Frank Laub +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.Diagnostics; + +namespace OpenSSL.Core +{ + /// + /// Wraps the BN_* set of functions. + /// + public class BigNumber : Base, IComparable + { + #region Predefined Values + /// + /// Creates a BigNumber object by calling BN_value_one() + /// + public static BigNumber One = new BigNumber(Native.BN_value_one(), false); + + /// + /// Calls BN_options() + /// + public static string Options + { + get { return Native.BN_options(); } + } + #endregion + + #region Initialization + internal BigNumber(IntPtr ptr, bool owner) : base(ptr, owner) { } + /// + /// Calls BN_new() + /// + public BigNumber() + : base(Native.ExpectNonNull(Native.BN_new()), true) + { + } + + /// + /// Calls BN_dup() on the BigNumber passed in. + /// + /// + public BigNumber(BigNumber rhs) + : base(Native.BN_dup(rhs.ptr), true) + { + } + + /// + /// Creates a BigNumber by calling BN_set_word() + /// + /// + public BigNumber(uint value) + : this() + { + Native.ExpectSuccess(Native.BN_set_word(this.ptr, value)); + } + #endregion + + #region Conversion + /// + /// Calls BN_dec2bn() + /// + /// + /// + public static BigNumber FromDecimalString(string str) + { + byte[] buf = Encoding.ASCII.GetBytes(str); + IntPtr ptr; + int ret = Native.BN_dec2bn(out ptr, buf); + if (ret <= 0) + throw new OpenSslException(); + return new BigNumber(ptr, true); + } + + /// + /// Calls BN_hex2bn() + /// + /// + /// + public static BigNumber FromHexString(string str) + { + byte[] buf = Encoding.ASCII.GetBytes(str); + IntPtr ptr; + int ret = Native.BN_hex2bn(out ptr, buf); + if (ret <= 0) + throw new OpenSslException(); + return new BigNumber(ptr, true); + } + + /// + /// Calls BN_bin2bn() + /// + /// + /// + public static BigNumber FromArray(byte[] buf) + { + IntPtr ptr = Native.BN_bin2bn(buf, buf.Length, IntPtr.Zero); + return new BigNumber(Native.ExpectNonNull(ptr), true); + } + + /// + /// Calls BN_bn2dec() + /// + /// + public string ToDecimalString() + { + return Native.PtrToStringAnsi(Native.BN_bn2dec(this.ptr), true); + } + + /// + /// Calls BN_bn2hex() + /// + /// + public string ToHexString() + { + return Native.PtrToStringAnsi(Native.BN_bn2hex(this.ptr), true); + } + + /// + /// Calls BN_get_word() + /// + /// + /// + public static implicit operator uint(BigNumber rhs) + { + return Native.BN_get_word(rhs.ptr); + } + + /// + /// Creates a new BigNumber object from a uint. + /// + /// + /// + public static implicit operator BigNumber(uint value) + { + return new BigNumber(value); + } + + /// + /// Calls BN_bn2bin() + /// + /// + /// + public static implicit operator byte[](BigNumber rhs) + { + byte[] bytes = new byte[rhs.Bytes]; + int ret = Native.BN_bn2bin(rhs.ptr, bytes); + return bytes; + } + + #endregion + + #region Properties + /// + /// Returns BN_num_bits() + /// + public int Bits + { + get { return Native.BN_num_bits(this.ptr); } + } + + /// + /// Converts the result of Bits into the number of bytes. + /// + public int Bytes + { + get { return (this.Bits + 7) / 8; } + } + #endregion + + #region Methods + /// + /// Calls BN_clear() + /// + public void Clear() + { + Native.BN_clear(this.ptr); + } + #endregion + + #region Operators + /// + /// Calls BN_add() + /// + /// + /// + /// + public static BigNumber operator + (BigNumber lhs, BigNumber rhs) + { + BigNumber ret = new BigNumber(); + Native.ExpectSuccess(Native.BN_add(ret.Handle, lhs.Handle, rhs.Handle)); + return ret; + } + + /// + /// Calls BN_sub() + /// + /// + /// + /// + public static BigNumber operator -(BigNumber lhs, BigNumber rhs) + { + BigNumber ret = new BigNumber(); + Native.ExpectSuccess(Native.BN_sub(ret.Handle, lhs.Handle, rhs.Handle)); + return ret; + } + + /// + /// Determines if lhs is by-value equal to rhs + /// + /// + /// + /// + public static bool operator ==(BigNumber lhs, BigNumber rhs) + { + if (object.ReferenceEquals(lhs, rhs)) + return true; + if ((object)lhs == null || (object)rhs == null) + return false; + return lhs.Equals(rhs); + } + + /// + /// Determines if lhs is by-value different than rhs + /// + /// + /// + /// + public static bool operator !=(BigNumber lhs, BigNumber rhs) + { + return !(lhs == rhs); + } + #endregion + + #region Overrides + /// + /// Calls BN_cmp() + /// + /// + /// + public override bool Equals(object obj) + { + BigNumber rhs = obj as BigNumber; + if ((object)rhs == null) + return false; + return Native.BN_cmp(this.ptr, rhs.ptr) == 0; + } + + /// + /// Creates a hash code by converting this object to a decimal string and + /// returns the hash code of that string. + /// + /// + public override int GetHashCode() + { + return ToDecimalString().GetHashCode(); + } + + /// + /// Calls BN_print() + /// + /// + public override void Print(BIO bio) + { + Native.ExpectSuccess(Native.BN_print(bio.Handle, this.ptr)); + } + #endregion + + #region IDisposable Members + + /// + /// Calls BN_free() + /// + protected override void OnDispose() { + Native.BN_free(this.ptr); + } + + #endregion + + #region IComparable Members + + /// + /// Calls BN_cmp() + /// + /// + /// + public int CompareTo(BigNumber other) + { + return Native.BN_cmp(this.ptr, other.ptr); + } + + #endregion + + #region Callbacks + + /// + /// Generator callback. Used mostly for status indications for long- + /// running generator functions. + /// + /// + /// + /// + /// + public delegate int GeneratorHandler(int p, int n, object arg); + + internal class GeneratorThunk + { + private Native.bn_gencb_st gencb = new Native.bn_gencb_st(); + private GeneratorHandler OnGenerator; + private object arg; + + public Native.bn_gencb_st CallbackStruct + { + get { return this.gencb; } + } + + public GeneratorThunk(GeneratorHandler client, object arg) + { + this.OnGenerator = client; + this.arg = arg; + + this.gencb.ver = 2; + this.gencb.arg = IntPtr.Zero; + this.gencb.cb = this.OnGeneratorThunk; + } + + internal int OnGeneratorThunk(int p, int n, IntPtr arg) + { + if (OnGenerator != null) + { + try + { + return OnGenerator(p, n, this.arg); + } + catch (Exception) + { + return 0; + } + } + else + { + // return 1 to allow generation to succeed with + // no user callback + return 1; + } + } + } + + #endregion + } +} \ No newline at end of file diff --git a/dep/openssl/src/ManagedOpenSsl/Core/Crypto.cs b/dep/openssl/src/ManagedOpenSsl/Core/Crypto.cs new file mode 100644 index 00000000..6d8e79a2 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/Core/Crypto.cs @@ -0,0 +1,193 @@ +// Copyright (c) 2006-2007 Frank Laub +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; + +namespace OpenSSL.Core +{ + /// + /// V_CRYPTO_MDEBUG_* + /// + [Flags] + public enum DebugOptions + { + /// + /// V_CRYPTO_MDEBUG_TIME + /// + Time = 0x01, + + /// + /// V_CRYPTO_MDEBUG_THREAD + /// + Thread = 0x02, + + /// + /// V_CRYPTO_MDEBUG_ALL + /// + All = Time | Thread, + } + + /// + /// CRYPTO_MEM_CHECK_* + /// + public enum MemoryCheck + { + /// + /// CRYPTO_MEM_CHECK_OFF + /// for applications + /// + Off = 0x00, + + /// + /// CRYPTO_MEM_CHECK_ON + /// for applications + /// + On = 0x01, + + /// + /// CRYPTO_MEM_CHECK_ENABLE + /// for library-internal use + /// + Enable = 0x02, + + /// + /// CRYPTO_MEM_CHECK_DISABLE + /// for library-internal use + /// + Disable = 0x03, + } + + /// + /// Exposes the CRYPTO_* functions + /// + public class CryptoUtil + { + /// + /// Returns MD2_options() + /// + public static string MD2_Options + { + get { return Native.MD2_options(); } + } + + /// + /// Returns RC4_options() + /// + public static string RC4_Options + { + get { return Native.RC4_options(); } + } + + /// + /// Returns DES_options() + /// + public static string DES_Options + { + get { return Native.DES_options(); } + } + + /// + /// Returns idea_options() + /// + public static string Idea_Options + { + get { return Native.idea_options(); } + } + + /// + /// Returns BF_options() + /// + public static string Blowfish_Options + { + get { return Native.BF_options(); } + } + + /// + /// Calls CRYPTO_malloc_debug_init() + /// + public static void MallocDebugInit() + { + Native.CRYPTO_malloc_debug_init(); + } + + /// + /// Calls CRYPTO_dbg_set_options() + /// + /// + public static void SetDebugOptions(DebugOptions options) + { + Native.CRYPTO_dbg_set_options((int)options); + } + + /// + /// Calls CRYPTO_mem_ctrl() + /// + /// + public static void SetMemoryCheck(MemoryCheck options) + { + Native.CRYPTO_mem_ctrl((int)options); + } + + /// + /// Calls CRYPTO_cleanup_all_ex_data() + /// + public static void Cleanup() + { + Native.CRYPTO_cleanup_all_ex_data(); + } + + /// + /// Calls ERR_remove_state() + /// + /// + public static void RemoveState(uint value) + { + Native.ERR_remove_state(value); + } + + /// + /// CRYPTO_MEM_LEAK_CB + /// + /// + /// + /// + /// + /// + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void MemoryLeakHandler(uint order, IntPtr file, int line, int num_bytes, IntPtr addr); + + /// + /// Calls CRYPTO_mem_leaks_cb() + /// + /// + public static void CheckMemoryLeaks(MemoryLeakHandler callback) + { + Native.CRYPTO_mem_leaks_cb(callback); + } + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/Core/MemoryTracker.cs b/dep/openssl/src/ManagedOpenSsl/Core/MemoryTracker.cs new file mode 100644 index 00000000..f1f239a9 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/Core/MemoryTracker.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; + +namespace OpenSSL.Core +{ + /// + /// Useful for tracking down memory leaks + /// + public class MemoryTracker + { + private static int leaked = 0; + + /// + /// Returns the number of bytes leaked between Start() and Finish() + /// + public static int Leaked { get { return leaked; } } + + /// + /// Begins memory tracking + /// + public static void Start() + { + leaked = 0; + CryptoUtil.MallocDebugInit(); + CryptoUtil.SetDebugOptions(DebugOptions.All); + CryptoUtil.SetMemoryCheck(MemoryCheck.On); + } + + /// + /// Stops memory tracking and reports any leaks found since Start() was called. + /// + public static void Finish() + { + GC.Collect(); + GC.WaitForPendingFinalizers(); + GC.Collect(); + + CryptoUtil.Cleanup(); + CryptoUtil.RemoveState(0); + + CryptoUtil.SetMemoryCheck(MemoryCheck.Off); + + CryptoUtil.CheckMemoryLeaks(OnMemoryLeak); + if (leaked > 0) + Console.WriteLine("Leaked total bytes: {0}", leaked); + } + + private static void OnMemoryLeak(uint order, IntPtr file, int line, int num_bytes, IntPtr addr) + { + string filename; + if(file != IntPtr.Zero) + { + filename = Native.PtrToStringAnsi(file, false); + } + else + { + filename = ""; + } + + Console.WriteLine("[{0}] file: {1} line: {2} bytes: {3}", order, filename, line, num_bytes); + leaked += num_bytes; + } + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/Core/Native.cs b/dep/openssl/src/ManagedOpenSsl/Core/Native.cs new file mode 100644 index 00000000..007a0d53 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/Core/Native.cs @@ -0,0 +1,2258 @@ +// Copyright (c) 2006-2011 Frank Laub +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System.Text; +using System; +using System.Security.Cryptography; +using System.Runtime.InteropServices; +using System.Globalization; +using System.Reflection; +using System.Collections.Generic; +using System.Threading; + +namespace OpenSSL.Core +{ + /// + /// + /// + public static class FIPS + { + /// + /// + /// + public static bool Enabled { get; set; } + } + + internal enum CryptoLockTypes + { + CRYPTO_LOCK_ERR = 1, + CRYPTO_LOCK_EX_DATA = 2, + CRYPTO_LOCK_X509 = 3, + CRYPTO_LOCK_X509_INFO = 4, + CRYPTO_LOCK_X509_PKEY = 5, + CRYPTO_LOCK_X509_CRL = 6, + CRYPTO_LOCK_X509_REQ = 7, + CRYPTO_LOCK_DSA = 8, + CRYPTO_LOCK_RSA = 9, + CRYPTO_LOCK_EVP_PKEY = 10, + CRYPTO_LOCK_X509_STORE = 11, + CRYPTO_LOCK_SSL_CTX = 12, + CRYPTO_LOCK_SSL_CERT = 13, + CRYPTO_LOCK_SSL_SESSION = 14, + CRYPTO_LOCK_SSL_SESS_CERT = 15, + CRYPTO_LOCK_SSL = 16, + CRYPTO_LOCK_SSL_METHOD = 17, + CRYPTO_LOCK_RAND = 18, + CRYPTO_LOCK_RAND2 = 19, + CRYPTO_LOCK_MALLOC = 20, + CRYPTO_LOCK_BIO = 21, + CRYPTO_LOCK_GETHOSTBYNAME = 22, + CRYPTO_LOCK_GETSERVBYNAME = 23, + CRYPTO_LOCK_READDIR = 24, + CRYPTO_LOCK_RSA_BLINDING = 25, + CRYPTO_LOCK_DH = 26, + CRYPTO_LOCK_MALLOC2 = 27, + CRYPTO_LOCK_DSO = 28, + CRYPTO_LOCK_DYNLOCK = 29, + CRYPTO_LOCK_ENGINE = 30, + CRYPTO_LOCK_UI = 31, + CRYPTO_LOCK_ECDSA = 32, + CRYPTO_LOCK_EC = 33, + CRYPTO_LOCK_ECDH = 34, + CRYPTO_LOCK_BN = 35, + CRYPTO_LOCK_EC_PRE_COMP = 36, + CRYPTO_LOCK_STORE = 37, + CRYPTO_LOCK_COMP = 38, + CRYPTO_LOCK_FIPS = 39, + CRYPTO_LOCK_FIPS2 = 40, + CRYPTO_NUM_LOCKS = 41, + } + + /// + /// static class for initialize OpenSSL/Crypto libraries for threading + /// + public class ThreadInitialization + { + /// + /// Calls Native.InitializeThreads() + /// + public static void InitializeThreads() + { + Native.InitializeThreads(); + } + + /// + /// Calls Native.UninitializeThreads() + /// + public static void UninitializeThreads() + { + Native.UninitializeThreads(); + } + } + + /// + /// This is the low-level C-style interface to the crypto API. + /// Use this interface with caution. + /// + internal class Native + { + /// + /// This is the name of the DLL that P/Invoke loads and tries to bind all of + /// these native functions to. + /// + const string DLLNAME = "libeay32"; + const string SSLDLLNAME = "ssleay32"; + + #region Delegates + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int pem_password_cb(IntPtr buf, int size, int rwflag, IntPtr userdata); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int GeneratorHandler(int p, int n, IntPtr arg); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void ObjectNameHandler(IntPtr name, IntPtr arg); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void CRYPTO_locking_callback(int mode, int type, string file, int line); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate uint CRYPTO_id_callback(); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int VerifyCertCallback(int ok, IntPtr x509_store_ctx); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int client_cert_cb(IntPtr ssl, out IntPtr x509, out IntPtr pkey); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int psk_client_callback(IntPtr ssl, IntPtr hint, IntPtr identity, uint max_identity_len, IntPtr psk, uint max_psk_len); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int psk_server_callback(IntPtr ssl, IntPtr identity, IntPtr psk, uint max_psk_len); + #endregion + + #region Initialization + static Native() + { + Version lib = Version.Library; + Version wrapper = Version.Wrapper; + uint mmf = lib.Raw & 0xfff00000; + if (mmf != wrapper.Raw) + throw new Exception(string.Format("Invalid version of {0}, expecting {1}, got: {2}", + DLLNAME, wrapper, lib)); + + // Enable FIPS mode + if (FIPS.Enabled) + { + if (FIPS_mode_set(1) == 0) + { + throw new Exception("Failed to initialize FIPS mode"); + } + } + + ERR_load_crypto_strings(); + SSL_load_error_strings(); + + OPENSSL_add_all_algorithms_noconf(); + + // Initialize SSL library + Native.ExpectSuccess(SSL_library_init()); + + byte[] seed = new byte[128]; + RandomNumberGenerator rng = RandomNumberGenerator.Create(); + rng.GetBytes(seed); + RAND_seed(seed, seed.Length); + } + + public static void InitializeThreads() + { + // Initialize the threading locks + int nLocks = CRYPTO_num_locks(); + lock_objects = new List(nLocks); + for (int i = 0; i < nLocks; i++) + { + Object obj = new Object(); + lock_objects.Add(obj); + } + // Initialize the internal thread id stack + threadIDs = new System.Collections.Generic.Stack(); + // Initialize the delegate for the locking callback + CRYPTO_locking_callback_delegate = new CRYPTO_locking_callback(LockingCallback); + CRYPTO_set_locking_callback(CRYPTO_locking_callback_delegate); + // Initialze the thread id callback + CRYPTO_id_callback_delegate = new CRYPTO_id_callback(ThreadIDCallback); + CRYPTO_set_id_callback(CRYPTO_id_callback_delegate); + } + + public static void UninitializeThreads() + { + // Cleanup the thread lock objects + CRYPTO_set_locking_callback(null); + lock_objects.Clear(); + CRYPTO_set_id_callback(null); + // Clean up error state for each thread that was used by OpenSSL + if (threadIDs != null) + { + foreach (uint id in threadIDs) + { + Native.ERR_remove_state(id); + } + } + } + + #endregion + + #region Version + public const uint Wrapper = 0x10000000; + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static string SSLeay_version(int type); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static uint SSLeay(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static string BN_options(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static string MD2_options(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static string RC4_options(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static string DES_options(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static string idea_options(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static string BF_options(); + + #endregion + + #region Threading + private static List lock_objects; + private static CRYPTO_locking_callback CRYPTO_locking_callback_delegate; + private static CRYPTO_id_callback CRYPTO_id_callback_delegate; + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void CRYPTO_set_id_callback(CRYPTO_id_callback cb); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void CRYPTO_set_locking_callback(CRYPTO_locking_callback cb); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int CRYPTO_num_locks(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int CRYPTO_add_lock(IntPtr ptr, int amount, CryptoLockTypes type, string file, int line); + + public const int CRYPTO_LOCK = 1; + + public static void LockingCallback(int mode, int type, string file, int line) + { + if ((mode & CRYPTO_LOCK) == CRYPTO_LOCK) + { + Monitor.Enter(lock_objects[type]); + } + else + { + Monitor.Exit(lock_objects[type]); + } + } + + private static System.Collections.Generic.Stack threadIDs; + + public static uint ThreadIDCallback() + { + uint threadID = (uint)Thread.CurrentThread.ManagedThreadId; + if (!threadIDs.Contains(threadID)) + { + threadIDs.Push(threadID); + } + return threadID; + } + + #endregion + + #region CRYPTO + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void OPENSSL_add_all_algorithms_noconf(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void OPENSSL_add_all_algorithms_conf(); + + /// + /// #define OPENSSL_free(addr) CRYPTO_free(addr) + /// + /// + public static void OPENSSL_free(IntPtr p) + { + CRYPTO_free(p); + } + + /// + /// #define OPENSSL_malloc(num) CRYPTO_malloc((int)num,__FILE__,__LINE__) + /// + /// + /// + public static IntPtr OPENSSL_malloc(int cbSize) + { + return CRYPTO_malloc(cbSize, Assembly.GetExecutingAssembly().FullName, 0); + } + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void CRYPTO_free(IntPtr p); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr CRYPTO_malloc(int num, string file, int line); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr CRYPTO_realloc(IntPtr ptr, int num, string file, int line); + + private static MallocFunctionPtr ptr_CRYPTO_dbg_malloc = CRYPTO_dbg_malloc; + private static ReallocFunctionPtr ptr_CRYPTO_dbg_realloc = CRYPTO_dbg_realloc; + private static FreeFunctionPtr ptr_CRYPTO_dbg_free = CRYPTO_dbg_free; + private static SetOptionsFunctionPtr ptr_CRYPTO_dbg_set_options = CRYPTO_dbg_set_options; + private static GetOptionsFunctionPtr ptr_CRYPTO_dbg_get_options = CRYPTO_dbg_get_options; + + //!! - Expose the default CRYPTO_malloc_debug_init() - this method hooks up the default + //!! - debug functions in the crypto library, this allows us to utilize the MemoryTracker + //!! - on non-Windows systems as well. + public static void CRYPTO_malloc_debug_init() { + CRYPTO_set_mem_debug_functions( + ptr_CRYPTO_dbg_malloc, + ptr_CRYPTO_dbg_realloc, + ptr_CRYPTO_dbg_free, + ptr_CRYPTO_dbg_set_options, + ptr_CRYPTO_dbg_get_options); + } + + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void MallocFunctionPtr(IntPtr addr, int num, IntPtr file, int line, int before_p); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void ReallocFunctionPtr(IntPtr addr1, IntPtr addr2, int num, IntPtr file, int line, int before_p); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void FreeFunctionPtr(IntPtr addr, int before_p); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void SetOptionsFunctionPtr(int bits); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int GetOptionsFunctionPtr(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void CRYPTO_dbg_malloc(IntPtr addr, int num, IntPtr file, int line, int before_p); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void CRYPTO_dbg_realloc(IntPtr addr1, IntPtr addr2, int num, IntPtr file, int line, int before_p); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void CRYPTO_dbg_free(IntPtr addr, int before_p); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void CRYPTO_dbg_set_options(int bits); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int CRYPTO_dbg_get_options(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int CRYPTO_set_mem_debug_functions( + MallocFunctionPtr m, + ReallocFunctionPtr r, + FreeFunctionPtr f, + SetOptionsFunctionPtr so, + GetOptionsFunctionPtr go); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int CRYPTO_mem_ctrl(int mode); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void CRYPTO_cleanup_all_ex_data(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void CRYPTO_mem_leaks(IntPtr bio); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void CRYPTO_mem_leaks_cb(CryptoUtil.MemoryLeakHandler cb); + + #endregion + + #region OBJ + public const int NID_undef = 0; + + public const int OBJ_undef = 0; + + public const int OBJ_NAME_TYPE_UNDEF = 0x00; + public const int OBJ_NAME_TYPE_MD_METH = 0x01; + public const int OBJ_NAME_TYPE_CIPHER_METH = 0x02; + public const int OBJ_NAME_TYPE_PKEY_METH = 0x03; + public const int OBJ_NAME_TYPE_COMP_METH = 0x04; + public const int OBJ_NAME_TYPE_NUM = 0x05; + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void OBJ_NAME_do_all(int type, ObjectNameHandler fn, IntPtr arg); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void OBJ_NAME_do_all_sorted(int type, ObjectNameHandler fn, IntPtr arg); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int OBJ_txt2nid(string s); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr OBJ_nid2obj(int n); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr OBJ_nid2ln(int n); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr OBJ_nid2sn(int n); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int OBJ_obj2nid(IntPtr o); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr OBJ_txt2obj(byte[] s, int no_name); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int OBJ_ln2nid(byte[] s); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int OBJ_sn2nid(byte[] s); + #endregion + + #region stack + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr sk_new_null(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int sk_num(IntPtr stack); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int sk_find(IntPtr stack, IntPtr data); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int sk_insert(IntPtr stack, IntPtr data, int where); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr sk_shift(IntPtr stack); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int sk_unshift(IntPtr stack, IntPtr data); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int sk_push(IntPtr stack, IntPtr data); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr sk_pop(IntPtr stack); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr sk_delete(IntPtr stack, int loc); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr sk_delete_ptr(IntPtr stack, IntPtr p); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr sk_value(IntPtr stack, int index); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr sk_set(IntPtr stack, int index, IntPtr data); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr sk_dup(IntPtr stack); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void sk_zero(IntPtr stack); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void sk_free(IntPtr stack); + + #endregion + + #region SHA + public const int SHA_DIGEST_LENGTH = 20; + #endregion + + #region ASN1 + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr ASN1_INTEGER_new(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void ASN1_INTEGER_free(IntPtr x); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int ASN1_INTEGER_set(IntPtr a, int v); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int ASN1_INTEGER_get(IntPtr a); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr ASN1_TIME_set(IntPtr s, long t); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int ASN1_UTCTIME_print(IntPtr bp, IntPtr a); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr ASN1_TIME_new(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void ASN1_TIME_free(IntPtr x); + + public const int V_ASN1_OCTET_STRING = 4; + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr ASN1_STRING_type_new(int type); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr ASN1_STRING_dup(IntPtr a); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void ASN1_STRING_free(IntPtr a); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int ASN1_STRING_cmp(IntPtr a, IntPtr b); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int ASN1_STRING_set(IntPtr str, byte[] data, int len); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr ASN1_STRING_data(IntPtr x); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int ASN1_STRING_length(IntPtr x); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void ASN1_OBJECT_free(IntPtr obj); + + #endregion + + #region X509_REQ + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr X509_REQ_new(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_REQ_set_version(IntPtr x, int version); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_REQ_set_pubkey(IntPtr x, IntPtr pkey); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr X509_REQ_get_pubkey(IntPtr req); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_REQ_set_subject_name(IntPtr x, IntPtr name); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_REQ_sign(IntPtr x, IntPtr pkey, IntPtr md); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_REQ_verify(IntPtr x, IntPtr pkey); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_REQ_digest(IntPtr data, IntPtr type, byte[] md, ref uint len); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void X509_REQ_free(IntPtr a); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr X509_REQ_to_X509(IntPtr r, int days, IntPtr pkey); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_REQ_print_ex(IntPtr bp, IntPtr x, uint nmflag, uint cflag); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_REQ_print(IntPtr bp, IntPtr x); + #endregion + + #region X509 + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr X509_new(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr X509_dup(IntPtr x509); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_cmp(IntPtr a, IntPtr b); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_sign(IntPtr x, IntPtr pkey, IntPtr md); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_check_private_key(IntPtr x509, IntPtr pkey); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_verify(IntPtr x, IntPtr pkey); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_pubkey_digest(IntPtr data, IntPtr type, byte[] md, ref uint len); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_digest(IntPtr data, IntPtr type, byte[] md, ref uint len); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_set_version(IntPtr x, int version); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_set_serialNumber(IntPtr x, IntPtr serial); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr X509_get_serialNumber(IntPtr x); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_set_issuer_name(IntPtr x, IntPtr name); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr X509_get_issuer_name(IntPtr a); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_set_subject_name(IntPtr x, IntPtr name); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr X509_get_subject_name(IntPtr a); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_set_notBefore(IntPtr x, IntPtr tm); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_set_notAfter(IntPtr x, IntPtr tm); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_set_pubkey(IntPtr x, IntPtr pkey); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr X509_get_pubkey(IntPtr x); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void X509_free(IntPtr x); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_verify_cert(IntPtr ctx); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr X509_verify_cert_error_string(int n); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr X509_to_X509_REQ(IntPtr x, IntPtr pkey, IntPtr md); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_print_ex(IntPtr bp, IntPtr x, uint nmflag, uint cflag); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_print(IntPtr bp, IntPtr x); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr X509_find_by_issuer_and_serial(IntPtr sk, IntPtr name, IntPtr serial); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr X509_find_by_subject(IntPtr sk, IntPtr name); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_check_trust(IntPtr x, int id, int flags); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr X509_time_adj(IntPtr s, int adj, ref long t); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr X509_gmtime_adj(IntPtr s, int adj); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr d2i_X509_bio(IntPtr bp, ref IntPtr x509); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int i2d_X509_bio(IntPtr bp, IntPtr x509); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void X509_PUBKEY_free(IntPtr pkey); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void X509_OBJECT_up_ref_count(IntPtr a); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void X509_OBJECT_free_contents(IntPtr a); + + #endregion + + #region X509_EXTENSION + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr X509_EXTENSION_new(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void X509_EXTENSION_free(IntPtr x); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr X509_EXTENSION_dup(IntPtr ex); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509V3_EXT_print(IntPtr bio, IntPtr ext, uint flag, int indent); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr X509V3_EXT_get_nid(int nid); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_add_ext(IntPtr x, IntPtr ex, int loc); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_add1_ext_i2d(IntPtr x, int nid, byte[] value, int crit, uint flags); + + //X509_EXTENSION* X509V3_EXT_conf_nid(LHASH* conf, X509V3_CTX* ctx, int ext_nid, char* value); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr X509V3_EXT_conf_nid(IntPtr conf, IntPtr ctx, int ext_nid, string value); + + //X509_EXTENSION* X509_EXTENSION_create_by_NID(X509_EXTENSION** ex, int nid, int crit, ASN1_OCTET_STRING* data); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr X509_EXTENSION_create_by_NID(IntPtr ex, int nid, int crit, IntPtr data); + + //X509_EXTENSION* X509_EXTENSION_create_by_OBJ(X509_EXTENSION** ex, ASN1_OBJECT* obj, int crit, ASN1_OCTET_STRING* data); + //int X509_EXTENSION_set_object(X509_EXTENSION* ex, ASN1_OBJECT* obj); + //int X509_EXTENSION_set_critical(X509_EXTENSION* ex, int crit); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_EXTENSION_set_critical(IntPtr ex, int crit); + + //int X509_EXTENSION_set_data(X509_EXTENSION* ex, ASN1_OCTET_STRING* data); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_EXTENSION_set_data(IntPtr ex, IntPtr data); + + //ASN1_OBJECT* X509_EXTENSION_get_object(X509_EXTENSION* ex); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr X509_EXTENSION_get_object(IntPtr ex); + + //ASN1_OCTET_STRING* X509_EXTENSION_get_data(X509_EXTENSION* ne); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr X509_EXTENSION_get_data(IntPtr ne); + + //int X509_EXTENSION_get_critical(X509_EXTENSION* ex); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_EXTENSION_get_critical(IntPtr ex); + + #endregion + + #region X509_STORE + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr X509_STORE_new(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_STORE_add_cert(IntPtr ctx, IntPtr x); + + //[DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + //void X509_STORE_set_flags(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void X509_STORE_free(IntPtr x); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr X509_STORE_CTX_new(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_STORE_CTX_init(IntPtr ctx, IntPtr store, IntPtr x509, IntPtr chain); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void X509_STORE_CTX_free(IntPtr x); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr X509_STORE_CTX_get_current_cert(IntPtr x509_store_ctx); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_STORE_CTX_get_error_depth(IntPtr x509_store_ctx); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_STORE_CTX_get_error(IntPtr x509_store_ctx); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void X509_STORE_CTX_set_error(IntPtr x509_store_ctx, int error); + + #endregion + + #region X509_INFO + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void X509_INFO_free(IntPtr a); + #endregion + + #region X509_NAME + public const int MBSTRING_FLAG = 0x1000; + + public const int MBSTRING_ASC = MBSTRING_FLAG | 1; + + public const int ASN1_STRFLGS_RFC2253 = + ASN1_STRFLGS_ESC_2253 | + ASN1_STRFLGS_ESC_CTRL | + ASN1_STRFLGS_ESC_MSB | + ASN1_STRFLGS_UTF8_CONVERT | + ASN1_STRFLGS_DUMP_UNKNOWN | + ASN1_STRFLGS_DUMP_DER; + + public const int ASN1_STRFLGS_ESC_2253 = 1; + public const int ASN1_STRFLGS_ESC_CTRL = 2; + public const int ASN1_STRFLGS_ESC_MSB = 4; + public const int ASN1_STRFLGS_ESC_QUOTE = 8; + public const int ASN1_STRFLGS_UTF8_CONVERT = 0x10; + public const int ASN1_STRFLGS_DUMP_UNKNOWN = 0x100; + public const int ASN1_STRFLGS_DUMP_DER = 0x200; + public const int XN_FLAG_SEP_COMMA_PLUS = (1 << 16); + public const int XN_FLAG_FN_SN = 0; + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr X509_NAME_new(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void X509_NAME_free(IntPtr a); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr X509_NAME_dup(IntPtr xn); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_NAME_cmp(IntPtr a, IntPtr b); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_NAME_entry_count(IntPtr name); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_NAME_add_entry_by_NID(IntPtr name, int nid, int type, byte[] bytes, int len, int loc, int set); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_NAME_add_entry_by_txt(IntPtr name, byte[] field, int type, byte[] bytes, int len, int loc, int set); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_NAME_get_text_by_NID(IntPtr name, int nid, byte[] buf, int len); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr X509_NAME_get_entry(IntPtr name, int loc); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr X509_NAME_delete_entry(IntPtr name, int loc); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_NAME_get_index_by_NID(IntPtr name, int nid, int lastpos); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_NAME_digest(IntPtr data, IntPtr type, byte[] md, ref uint len); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr X509_NAME_oneline(IntPtr a, byte[] buf, int size); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_NAME_print(IntPtr bp, IntPtr name, int obase); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509_NAME_print_ex(IntPtr bp, IntPtr nm, int indent, uint flags); + #endregion + + #region RAND + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void RAND_cleanup(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void RAND_seed(byte[] buf, int len); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int RAND_pseudo_bytes(byte[] buf, int len); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int RAND_bytes(byte[] buf, int num); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void RAND_add(byte[] buf, int num, double entropy); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int RAND_load_file(string file, int max_bytes); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int RAND_write_file(string file); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static string RAND_file_name(byte[] buf, uint num); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int RAND_status(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int RAND_query_egd_bytes(string path, byte[] buf, int bytes); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int RAND_egd(string path); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int RAND_egd_bytes(string path, int bytes); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int RAND_poll(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int BN_rand(IntPtr rnd, int bits, int top, int bottom); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int BN_pseudo_rand(IntPtr rnd, int bits, int top, int bottom); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int BN_rand_range(IntPtr rnd, IntPtr range); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int BN_pseudo_rand_range(IntPtr rnd, IntPtr range); + #endregion + + #region DSA + //[DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + //public extern static IntPtr DSA_generate_parameters(int bits, byte[] seed, int seed_len, IntPtr counter_ret, IntPtr h_ret, IntPtr callback, IntPtr cb_arg); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int DSA_generate_parameters_ex(IntPtr dsa, int bits, byte[] seed, int seed_len, out int counter_ret, out int h_ret, bn_gencb_st callback); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int DSA_generate_key(IntPtr dsa); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr DSA_new(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void DSA_free(IntPtr dsa); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int DSA_size(IntPtr dsa); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int DSAparams_print(IntPtr bp, IntPtr x); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int DSA_print(IntPtr bp, IntPtr x, int off); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int DSA_sign(int type, byte[] dgst, int dlen, byte[] sig, out uint siglen, IntPtr dsa); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int DSA_verify(int type, byte[] dgst, int dgst_len, byte[] sigbuf, int siglen, IntPtr dsa); + #endregion + + #region RSA + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr RSA_new(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void RSA_free(IntPtr rsa); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int RSA_size(IntPtr rsa); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int RSA_generate_key_ex(IntPtr rsa, int bits, IntPtr e, bn_gencb_st cb); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int RSA_check_key(IntPtr rsa); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int RSA_public_encrypt(int flen, byte[] from, byte[] to, IntPtr rsa, int padding); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int RSA_private_encrypt(int flen, byte[] from, byte[] to, IntPtr rsa, int padding); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int RSA_public_decrypt(int flen, byte[] from, byte[] to, IntPtr rsa, int padding); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int RSA_private_decrypt(int flen, byte[] from, byte[] to, IntPtr rsa, int padding); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int RSA_sign(int type, byte[] m, uint m_length, byte[] sigret, out uint siglen, IntPtr rsa); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int RSA_verify(int type, byte[] m, uint m_length, byte[] sigbuf, uint siglen, IntPtr rsa); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int RSA_print(IntPtr bp, IntPtr r, int offset); + #endregion + + #region DH + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr DH_generate_parameters(int prime_len, int generator, IntPtr callback, IntPtr cb_arg); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int DH_generate_parameters_ex(IntPtr dh, int prime_len, int generator, bn_gencb_st cb); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int DH_generate_key(IntPtr dh); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int DH_compute_key(byte[] key, IntPtr pub_key, IntPtr dh); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr DH_new(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void DH_free(IntPtr dh); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int DH_check(IntPtr dh, out int codes); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int DHparams_print(IntPtr bp, IntPtr x); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int DH_size(IntPtr dh); + + #endregion + + #region BIGNUM + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr BN_value_one(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr BN_new(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void BN_free(IntPtr a); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void BN_init(IntPtr a); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr BN_bin2bn(byte[] s, int len, IntPtr ret); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int BN_bn2bin(IntPtr a, byte[] to); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void BN_clear_free(IntPtr a); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void BN_clear(IntPtr a); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr BN_dup(IntPtr a); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr BN_copy(IntPtr a, IntPtr b); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void BN_swap(IntPtr a, IntPtr b); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int BN_cmp(IntPtr a, IntPtr b); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int BN_sub(IntPtr r, IntPtr a, IntPtr b); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int BN_add(IntPtr r, IntPtr a, IntPtr b); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int BN_mul(IntPtr r, IntPtr a, IntPtr b, IntPtr ctx); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int BN_num_bits(IntPtr a); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int BN_sqr(IntPtr r, IntPtr a, IntPtr ctx); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int BN_div(IntPtr dv, IntPtr rem, IntPtr m, IntPtr d, IntPtr ctx); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int BN_print(IntPtr fp, IntPtr a); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr BN_bn2hex(IntPtr a); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr BN_bn2dec(IntPtr a); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int BN_hex2bn(out IntPtr a, byte[] str); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int BN_dec2bn(out IntPtr a, byte[] str); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static uint BN_mod_word(IntPtr a, uint w); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static uint BN_div_word(IntPtr a, uint w); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int BN_mul_word(IntPtr a, uint w); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int BN_add_word(IntPtr a, uint w); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int BN_sub_word(IntPtr a, uint w); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int BN_set_word(IntPtr a, uint w); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static uint BN_get_word(IntPtr a); + //#define BN_GENCB_set(gencb, callback, cb_arg) { \ + // BN_GENCB *tmp_gencb = (gencb); \ + // tmp_gencb->ver = 2; \ + // tmp_gencb->arg = (cb_arg); \ + // tmp_gencb->cb.cb_2 = (callback); } + + [StructLayout(LayoutKind.Sequential)] + public class bn_gencb_st + { + public uint ver; /// To handle binary (in)compatibility + public IntPtr arg; /// callback-specific data + public GeneratorHandler cb; + } + #endregion + + #region DER + //#define d2i_DHparams_bio(bp,x) ASN1_d2i_bio_of(DH,DH_new,d2i_DHparams,bp,x) + //#define i2d_DHparams_bio(bp,x) ASN1_i2d_bio_of_const(DH,i2d_DHparams,bp,x) + + //#define ASN1_d2i_bio_of(type,xnew,d2i,in,x) \ + // ((type*)ASN1_d2i_bio( CHECKED_NEW_OF(type, xnew), \ + // CHECKED_D2I_OF(type, d2i), \ + // in, \ + // CHECKED_PPTR_OF(type, x))) + + //#define ASN1_i2d_bio_of_const(type,i2d,out,x) \ + // (ASN1_i2d_bio(CHECKED_I2D_OF(const type, i2d), \ + // out, \ + // CHECKED_PTR_OF(const type, x))) + + //#define CHECKED_I2D_OF(type, i2d) \ + // ((i2d_of_void*) (1 ? i2d : ((I2D_OF(type))0))) + + //#define I2D_OF(type) int (*)(type *,unsigned char **) + + //#define CHECKED_PTR_OF(type, p) \ + // ((void*) (1 ? p : (type*)0)) + + //!! + //DH * d2i_DHparams(DH **a,const unsigned char **pp, long length); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public static extern IntPtr d2i_DHparams(out IntPtr a, IntPtr pp, int length); + + //int i2d_DHparams(const DH *a,unsigned char **pp); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int i2d_DHparams(IntPtr a, IntPtr pp); + + //void *ASN1_d2i_bio(void *(*xnew)(void), d2i_of_void *d2i, BIO *in, void **x); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr ASN1_d2i_bio(IntPtr xnew, IntPtr d2i, IntPtr bp, IntPtr x); + + //int ASN1_i2d_bio(i2d_of_void *i2d,BIO *out, unsigned char *x); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int ASN1_i2d_bio(IntPtr i2d, IntPtr bp, IntPtr x); + #endregion + + #region PEM + + #region X509 + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int PEM_write_bio_X509(IntPtr bp, IntPtr x); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr PEM_read_bio_X509(IntPtr bp, IntPtr x, pem_password_cb cb, IntPtr u); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr PEM_read_bio_PKCS7(IntPtr bp, IntPtr x, pem_password_cb cb, IntPtr u); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr d2i_PKCS7_bio(IntPtr bp, IntPtr p7); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void PKCS7_free(IntPtr p7); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr d2i_PKCS12_bio(IntPtr bp, IntPtr p12); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int i2d_PKCS12_bio(IntPtr bp, IntPtr p12); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + //PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert, STACK_OF(X509) *ca, int nid_key, int nid_cert, int iter, int mac_iter, int keytype); + public extern static IntPtr PKCS12_create(string pass, string name, IntPtr pkey, IntPtr cert, IntPtr ca, int nid_key, int nid_cert, int iter, int mac_iter, int keytype); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + //int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca); + public extern static int PKCS12_parse(IntPtr p12, string pass, out IntPtr pkey, out IntPtr cert, out IntPtr ca); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void PKCS12_free(IntPtr p12); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + //!!int PEM_write_bio_PKCS8PrivateKey(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc, char *kstr, int klen, pem_password_cb *cb, void *u); + public extern static int PEM_write_bio_PKCS8PrivateKey(IntPtr bp, IntPtr evp_pkey, IntPtr evp_cipher, IntPtr kstr, int klen, pem_password_cb cb, IntPtr user_data); + + #endregion + + #region X509_INFO + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int PEM_write_bio_X509_INFO(IntPtr bp, IntPtr x); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr PEM_read_bio_X509_INFO(IntPtr bp, IntPtr x, pem_password_cb cb, IntPtr u); + #endregion + + #region X509_AUX + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int PEM_write_bio_X509_AUX(IntPtr bp, IntPtr x); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr PEM_read_bio_X509_AUX(IntPtr bp, IntPtr x, pem_password_cb cb, IntPtr u); + #endregion + + #region X509_REQ + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int PEM_write_bio_X509_REQ(IntPtr bp, IntPtr x); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr PEM_read_bio_X509_REQ(IntPtr bp, IntPtr x, pem_password_cb cb, IntPtr u); + #endregion + + #region X509_REQ_NEW + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int PEM_write_bio_X509_REQ_NEW(IntPtr bp, IntPtr x); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr PEM_read_bio_X509_REQ_NEW(IntPtr bp, IntPtr x, pem_password_cb cb, IntPtr u); + #endregion + + #region X509_CRL + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int PEM_write_bio_X509_CRL(IntPtr bp, IntPtr x); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr PEM_read_bio_X509_CRL(IntPtr bp, IntPtr x, pem_password_cb cb, IntPtr u); + #endregion + + #region X509Chain + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr PEM_X509_INFO_read_bio(IntPtr bp, IntPtr sk, pem_password_cb cb, IntPtr u); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int PEM_X509_INFO_write_bio(IntPtr bp, IntPtr xi, IntPtr enc, byte[] kstr, int klen, IntPtr cd, IntPtr u); + #endregion + + #region DSA + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int PEM_write_bio_DSAPrivateKey(IntPtr bp, IntPtr x, IntPtr enc, byte[] kstr, int klen, pem_password_cb cb, IntPtr u); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr PEM_read_bio_DSAPrivateKey(IntPtr bp, IntPtr x, pem_password_cb cb, IntPtr u); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int PEM_write_bio_DSA_PUBKEY(IntPtr bp, IntPtr x); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr PEM_read_bio_DSA_PUBKEY(IntPtr bp, IntPtr x, pem_password_cb cb, IntPtr u); + #endregion + + #region DSAparams + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int PEM_write_bio_DSAparams(IntPtr bp, IntPtr x); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr PEM_read_bio_DSAparams(IntPtr bp, IntPtr x, pem_password_cb cb, IntPtr u); + #endregion + + #region RSA + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int PEM_write_bio_RSA_PUBKEY(IntPtr bp, IntPtr x); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr PEM_read_bio_RSA_PUBKEY(IntPtr bp, IntPtr x, pem_password_cb cb, IntPtr u); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int PEM_write_bio_RSAPrivateKey(IntPtr bp, IntPtr x, IntPtr enc, byte[] kstr, int klen, pem_password_cb cb, IntPtr u); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr PEM_read_bio_RSAPrivateKey(IntPtr bp, IntPtr x, pem_password_cb cb, IntPtr u); + #endregion + + #region DHparams + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int PEM_write_bio_DHparams(IntPtr bp, IntPtr x); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr PEM_read_bio_DHparams(IntPtr bp, IntPtr x, pem_password_cb cb, IntPtr u); + #endregion + + #region PrivateKey + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int PEM_write_bio_PrivateKey(IntPtr bp, IntPtr x, IntPtr enc, byte[] kstr, int klen, pem_password_cb cb, IntPtr u); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr PEM_read_bio_PrivateKey(IntPtr bp, IntPtr x, pem_password_cb cb, IntPtr u); + #endregion + + #region PUBKEY + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int PEM_write_bio_PUBKEY(IntPtr bp, IntPtr x); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr PEM_read_bio_PUBKEY(IntPtr bp, IntPtr x, pem_password_cb cb, IntPtr u); + #endregion + + #endregion + + #region EVP + + #region Constants + public const int EVP_MAX_MD_SIZE = 64; //!!(16+20); + public const int EVP_MAX_KEY_LENGTH = 32; + public const int EVP_MAX_IV_LENGTH = 16; + public const int EVP_MAX_BLOCK_LENGTH = 32; + + public const int EVP_CIPH_STREAM_CIPHER = 0x0; + public const int EVP_CIPH_ECB_MODE = 0x1; + public const int EVP_CIPH_CBC_MODE = 0x2; + public const int EVP_CIPH_CFB_MODE = 0x3; + public const int EVP_CIPH_OFB_MODE = 0x4; + public const int EVP_CIPH_MODE = 0x7; + public const int EVP_CIPH_VARIABLE_LENGTH = 0x8; + public const int EVP_CIPH_CUSTOM_IV = 0x10; + public const int EVP_CIPH_ALWAYS_CALL_INIT = 0x20; + public const int EVP_CIPH_CTRL_INIT = 0x40; + public const int EVP_CIPH_CUSTOM_KEY_LENGTH = 0x80; + public const int EVP_CIPH_NO_PADDING = 0x100; + public const int EVP_CIPH_FLAG_FIPS = 0x400; + public const int EVP_CIPH_FLAG_NON_FIPS_ALLOW = 0x800; + #endregion + + #region Message Digests + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_md_null(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_md2(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_md4(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_md5(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_sha(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_sha1(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_sha224(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_sha256(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_sha384(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_sha512(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_dss(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_dss1(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_mdc2(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_ripemd160(); + #endregion + + #region HMAC + public const int HMAC_MAX_MD_CBLOCK = 128; + + //!!void HMAC_CTX_init(HMAC_CTX *ctx); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void HMAC_CTX_init(IntPtr ctx); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void HMAC_CTX_set_flags(IntPtr ctx, uint flags); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void HMAC_CTX_cleanup(IntPtr ctx); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void HMAC_Init(IntPtr ctx, byte[] key, int len, IntPtr md); /* deprecated */ + //!!public extern static void HMAC_Init_ex(IntPtr ctx, const void *key, int len, const EVP_MD *md, ENGINE *impl); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void HMAC_Init_ex(IntPtr ctx, byte[] key, int len, IntPtr md, IntPtr engine_impl); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void HMAC_Update(IntPtr ctx, byte[] data, int len); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void HMAC_Final(IntPtr ctx, byte[] md, ref uint len); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr HMAC(IntPtr evp_md, byte[] key, int key_len, byte[] d, int n, byte[] md, ref uint md_len); + + + #endregion + + #region Ciphers + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_get_cipherbyname(byte[] name); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_enc_null(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_des_ecb(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_des_ede(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_des_ede3(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_des_ede_ecb(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_des_ede3_ecb(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_des_cfb64(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_des_cfb1(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_des_cfb8(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_des_ede_cfb64(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_des_ede3_cfb64(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_des_ede3_cfb1(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_des_ede3_cfb8(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_des_ofb(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_des_ede_ofb(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_des_ede3_ofb(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_des_cbc(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_des_ede_cbc(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_des_ede3_cbc(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_desx_cbc(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_rc4(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_rc4_40(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_idea_ecb(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_idea_cfb64(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_idea_ofb(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_idea_cbc(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_rc2_ecb(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_rc2_cbc(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_rc2_40_cbc(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_rc2_64_cbc(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_rc2_cfb64(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_rc2_ofb(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_bf_ecb(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_bf_cbc(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_bf_cfb64(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_bf_ofb(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_cast5_ecb(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_cast5_cbc(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_cast5_cfb64(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_cast5_ofb(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_rc5_32_12_16_cbc(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_rc5_32_12_16_ecb(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_rc5_32_12_16_cfb64(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_rc5_32_12_16_ofb(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_aes_128_ecb(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_aes_128_cbc(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_aes_128_cfb1(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_aes_128_cfb8(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_aes_128_cfb128(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_aes_128_ofb(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_aes_192_ecb(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_aes_192_cbc(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_aes_192_cfb1(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_aes_192_cfb8(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_aes_192_cfb128(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_aes_192_ofb(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_aes_256_ecb(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_aes_256_cbc(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_aes_256_cfb1(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_aes_256_cfb8(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_aes_256_cfb128(); + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_aes_256_ofb(); + + #endregion + + #region EVP_PKEY + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_PKEY_new(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void EVP_PKEY_free(IntPtr pkey); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_PKEY_cmp(IntPtr a, IntPtr b); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_PKEY_decrypt(byte[] dec_key, byte[] enc_key, int enc_key_len, IntPtr private_key); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_PKEY_encrypt(byte[] enc_key, byte[] key, int key_len, IntPtr pub_key); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_PKEY_type(int type); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_PKEY_bits(IntPtr pkey); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_PKEY_size(IntPtr pkey); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_PKEY_assign(IntPtr pkey, int type, byte[] key); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_PKEY_set1_DSA(IntPtr pkey, IntPtr key); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_PKEY_get1_DSA(IntPtr pkey); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_PKEY_set1_RSA(IntPtr pkey, IntPtr key); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_PKEY_get1_RSA(IntPtr pkey); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_PKEY_set1_DH(IntPtr pkey, IntPtr key); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_PKEY_get1_DH(IntPtr pkey); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_PKEY_copy_parameters(IntPtr to, IntPtr from); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_PKEY_missing_parameters(IntPtr pkey); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_PKEY_save_parameters(IntPtr pkey, int mode); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_PKEY_cmp_parameters(IntPtr a, IntPtr b); + + #endregion + + #region EVP_CIPHER + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void EVP_CIPHER_CTX_init(IntPtr a); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_CIPHER_CTX_set_padding(IntPtr x, int padding); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_CIPHER_CTX_set_key_length(IntPtr x, int keylen); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_CIPHER_CTX_ctrl(IntPtr ctx, int type, int arg, IntPtr ptr); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_CIPHER_CTX_cleanup(IntPtr a); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_CIPHER_type(IntPtr ctx); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_CipherInit_ex(IntPtr ctx, IntPtr type, IntPtr impl, byte[] key, byte[] iv, int enc); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_CipherUpdate(IntPtr ctx, byte[] outb, out int outl, byte[] inb, int inl); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_CipherFinal_ex(IntPtr ctx, byte[] outm, ref int outl); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_OpenInit(IntPtr ctx, IntPtr type, byte[] ek, int ekl, byte[] iv, IntPtr priv); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_OpenFinal(IntPtr ctx, byte[] outb, out int outl); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_SealInit(IntPtr ctx, IntPtr type, byte[][] ek, int[] ekl, byte[] iv, IntPtr[] pubk, int npubk); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_SealFinal(IntPtr ctx, byte[] outb, out int outl); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_DecryptUpdate(IntPtr ctx, byte[] output, out int outl, byte[] input, int inl); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_EncryptUpdate(IntPtr ctx, byte[] output, out int outl, byte[] input, int inl); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_BytesToKey(IntPtr type, IntPtr md, byte[] salt, byte[] data, int datal, int count, byte[] key, byte[] iv); + + #endregion + + #region EVP_MD + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_get_digestbyname(byte[] name); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void EVP_MD_CTX_init(IntPtr ctx); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_MD_CTX_cleanup(IntPtr ctx); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr EVP_MD_CTX_create(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void EVP_MD_CTX_destroy(IntPtr ctx); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_DigestInit_ex(IntPtr ctx, IntPtr type, IntPtr impl); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_DigestUpdate(IntPtr ctx, byte[] d, uint cnt); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_DigestFinal_ex(IntPtr ctx, byte[] md, ref uint s); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_Digest(byte[] data, uint count, byte[] md, ref uint size, IntPtr type, IntPtr impl); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_SignFinal(IntPtr ctx, byte[] md, ref uint s, IntPtr pkey); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int EVP_VerifyFinal(IntPtr ctx, byte[] sigbuf, uint siglen, IntPtr pkey); + + #endregion + + #endregion EVP + + #region BIO + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + //!!public extern static IntPtr BIO_new_file(byte[] filename, byte[] mode); + public extern static IntPtr BIO_new_file(string filename, string mode); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr BIO_new_mem_buf(byte[] buf, int len); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr BIO_s_mem(); + + // Unsupported! + //[DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + //public extern static IntPtr BIO_s_fd(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr BIO_f_md(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr BIO_f_null(); + + const int BIO_C_SET_FD = 104; + const int BIO_C_SET_MD = 111; + const int BIO_C_GET_MD = 112; + const int BIO_C_GET_MD_CTX = 120; + const int BIO_C_SET_MD_CTX = 148; + + public const int BIO_NOCLOSE = 0x00; + public const int BIO_CLOSE = 0x01; + + public static void BIO_set_md(IntPtr bp, IntPtr md) + { + Native.ExpectSuccess(BIO_ctrl(bp, BIO_C_SET_MD, 0, md)); + } + + // Unsupported! + //public static void BIO_set_fd(IntPtr bp, int fd, int c) + //{ + // Native.ExpectSuccess(BIO_int_ctrl(bp, BIO_C_SET_FD, c, fd)); + //} + + public static IntPtr BIO_get_md(IntPtr bp) + { + IntPtr ptr = Marshal.AllocHGlobal(4); + try + { + ExpectSuccess(BIO_ctrl(bp, BIO_C_GET_MD, 0, ptr)); + return Marshal.ReadIntPtr(ptr); + } + finally + { + Marshal.FreeHGlobal(ptr); + } + } + + public static IntPtr BIO_get_md_ctx(IntPtr bp) + { + IntPtr ptr = Marshal.AllocHGlobal(4); + try + { + ExpectSuccess(BIO_ctrl(bp, BIO_C_GET_MD_CTX, 0, ptr)); + return Marshal.ReadIntPtr(ptr); + } + finally + { + Marshal.FreeHGlobal(ptr); + } + } + + public static void BIO_set_md_ctx(IntPtr bp, IntPtr mdcp) + { + Native.ExpectSuccess(BIO_ctrl(bp, BIO_C_SET_MD_CTX, 0, mdcp)); + } + + const int BIO_CTRL_SET_CLOSE = 9; /* man - set the 'close' on free */ + + //#define BIO_set_close(b,c) (int)BIO_ctrl(b,BIO_CTRL_SET_CLOSE,(c),NULL) + public static int BIO_set_close(IntPtr bp, int arg) + { + return BIO_ctrl(bp, BIO_CTRL_SET_CLOSE, arg, IntPtr.Zero); + } + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr BIO_push(IntPtr bp, IntPtr append); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int BIO_ctrl(IntPtr bp, int cmd, int larg, IntPtr parg); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int BIO_int_ctrl(IntPtr bp, int cmd, int larg, int parg); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr BIO_new(IntPtr type); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int BIO_read(IntPtr b, byte[] buf, int len); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int BIO_write(IntPtr b, byte[] buf, int len); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int BIO_puts(IntPtr b, byte[] buf); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int BIO_gets(IntPtr b, byte[] buf, int len); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void BIO_free(IntPtr bio); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static uint BIO_number_read(IntPtr bio); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static uint BIO_number_written(IntPtr bio); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static uint BIO_ctrl_pending(IntPtr bio); + + #endregion + + #region ERR + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void ERR_load_crypto_strings(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static uint ERR_get_error(); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void ERR_error_string_n(uint e, byte[] buf, int len); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr ERR_lib_error_string(uint e); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr ERR_func_error_string(uint e); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr ERR_reason_error_string(uint e); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void ERR_remove_state(uint pid); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void ERR_clear_error(); + + #endregion ERR + + #region NCONF + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr NCONF_new(IntPtr meth); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void NCONF_free(IntPtr conf); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + //!!public extern static int NCONF_load(IntPtr conf, byte[] file, ref int eline); + public extern static int NCONF_load(IntPtr conf, string file, ref int eline); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr NCONF_get_string(IntPtr conf, byte[] group, byte[] name); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void X509V3_set_ctx(IntPtr ctx, IntPtr issuer, IntPtr subject, IntPtr req, IntPtr crl, int flags); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void X509V3_set_nconf(IntPtr ctx, IntPtr conf); + + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int X509V3_EXT_add_nconf(IntPtr conf, IntPtr ctx, byte[] section, IntPtr cert); + + #endregion + + #region FIPS + [DllImport(DLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int FIPS_mode_set(int onoff); + + #endregion + + #region SSL Routines + #region Initialization + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void SSL_load_error_strings(); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int SSL_library_init(); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void ERR_free_strings(); + + #endregion + + #region SSL Methods + + // these methods have been removed in openssl 1.0.0.e /raist. + //[DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + //public extern static IntPtr SSLv2_method(); + + //[DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + //public extern static IntPtr SSLv2_server_method(); + + //[DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + //public extern static IntPtr SSLv2_client_method(); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr SSLv3_method(); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr SSLv3_server_method(); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr SSLv3_client_method(); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr SSLv23_method(); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr SSLv23_server_method(); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr SSLv23_client_method(); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr TLSv1_method(); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr TLSv1_client_method(); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr TLSv1_server_method(); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr DTLSv1_method(); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr DTLSv1_client_method(); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr DTLSv1_server_method(); + + #endregion + + #region SSL_CTX + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr SSL_CTX_new(IntPtr sslMethod); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void SSL_CTX_free(IntPtr ctx); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int SSL_CTX_ctrl(IntPtr ctx, int cmd, int arg, IntPtr parg); + + public const int SSL_CTRL_OPTIONS = 32; + public const int SSL_CTRL_MODE = 33; + + public const int SSL_OP_MICROSOFT_SESS_ID_BUG = 0x00000001; + public const int SSL_OP_NETSCAPE_CHALLENGE_BUG = 0x00000002; + public const int SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG = 0x00000008; + public const int SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG = 0x00000010; + public const int SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER = 0x00000020; + public const int SSL_OP_MSIE_SSLV2_RSA_PADDING = 0x00000040; /* no effect since 0.9.7h and 0.9.8b */ + public const int SSL_OP_SSLEAY_080_CLIENT_DH_BUG = 0x00000080; + public const int SSL_OP_TLS_D5_BUG = 0x00000100; + public const int SSL_OP_TLS_BLOCK_PADDING_BUG = 0x00000200; + + /* Disable SSL 3.0/TLS 1.0 CBC vulnerability workaround that was added + * in OpenSSL 0.9.6d. Usually (depending on the application protocol) + * the workaround is not needed. Unfortunately some broken SSL/TLS + * implementations cannot handle it at all, which is why we include + * it in SSL_OP_ALL. */ + public const int SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS = 0x00000800; /* added in 0.9.6e */ + + /* SSL_OP_ALL: various bug workarounds that should be rather harmless. + * This used to be 0x000FFFFFL before 0.9.7. */ + public const int SSL_OP_ALL = (0x00000FFF ^ SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG); + + /* As server, disallow session resumption on renegotiation */ + public const int SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION = 0x00010000; + /* If set, always create a new key when using tmp_dh parameters */ + public const int SSL_OP_SINGLE_DH_USE = 0x00100000; + /* Set to always use the tmp_rsa key when doing RSA operations, + * even when this violates protocol specs */ + public const int SSL_OP_EPHEMERAL_RSA = 0x00200000; + /* Set on servers to choose the cipher according to the server's + * preferences */ + public const int SSL_OP_CIPHER_SERVER_PREFERENCE = 0x00400000; + /* If set, a server will allow a client to issue a SSLv3.0 version number + * as latest version supported in the premaster secret, even when TLSv1.0 + * (version 3.1) was announced in the client hello. Normally this is + * forbidden to prevent version rollback attacks. */ + public const int SSL_OP_TLS_ROLLBACK_BUG = 0x00800000; + + public const int SSL_OP_NO_SSLv2 = 0x01000000; + public const int SSL_OP_NO_SSLv3 = 0x02000000; + public const int SSL_OP_NO_TLSv1 = 0x04000000; + + /* The next flag deliberately changes the ciphertest, this is a check + * for the PKCS#1 attack */ + public const int SSL_OP_PKCS1_CHECK_1 = 0x08000000; + public const int SSL_OP_PKCS1_CHECK_2 = 0x10000000; + public const int SSL_OP_NETSCAPE_CA_DN_BUG = 0x20000000; + public const int SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG = 0x40000000; + + + /* Allow SSL_write(..., n) to return r with 0 < r < n (i.e. report success + * when just a single record has been written): */ + public const int SSL_MODE_ENABLE_PARTIAL_WRITE = 0x00000001; + /* Make it possible to retry SSL_write() with changed buffer location + * (buffer contents must stay the same!); this is not the default to avoid + * the misconception that non-blocking SSL_write() behaves like + * non-blocking write(): */ + public const int SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER = 0x00000002; + /* Never bother the application with retries if the transport + * is blocking: */ + public const int SSL_MODE_AUTO_RETRY = 0x00000004; + /* Don't attempt to automatically build certificate chain */ + public const int SSL_MODE_NO_AUTO_CHAIN = 0x00000008; + + /// + /// #define SSL_CTX_ctrl in ssl.h - calls SSL_CTX_ctrl() + /// + /// + /// + /// + public static int SSL_CTX_set_mode(IntPtr ctx, int op) + { + return SSL_CTX_ctrl(ctx, SSL_CTRL_MODE, op, IntPtr.Zero); + } + + /// + /// #define SSL_CTX_set_options in ssl.h - calls SSL_CTX_ctrl + /// + /// + /// + /// + public static int SSL_CTX_set_options(IntPtr ctx, int op) + { + return SSL_CTX_ctrl(ctx, SSL_CTRL_OPTIONS, op, IntPtr.Zero); + } + + /// + /// #define SSL_CTX_get_mode in ssl.h - calls SSL_CTX_ctrl + /// + /// + /// + public static int SSL_CTX_get_mode(IntPtr ctx) + { + return SSL_CTX_ctrl(ctx, SSL_CTRL_OPTIONS, 0, IntPtr.Zero); + } + + /// + /// #define SSL_CTX_get_options in ssl.h - calls SSL_CTX_ctrl + /// + /// + /// Int32 representation of options set in the context + public static int SSL_CTX_get_options(IntPtr ctx) + { + return SSL_CTX_ctrl(ctx, SSL_CTRL_OPTIONS, 0, IntPtr.Zero); + } + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void SSL_CTX_set_cert_store(IntPtr ctx, IntPtr cert_store); + + public const int SSL_VERIFY_NONE = 0x00; + public const int SSL_VERIFY_PEER = 0x01; + public const int SSL_VERIFY_FAIL_IF_NO_PEER_CERT = 0x02; + public const int SSL_VERIFY_CLIENT_ONCE = 0x04; + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void SSL_CTX_set_verify(IntPtr ctx, int mode, VerifyCertCallback callback); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void SSL_CTX_set_verify_depth(IntPtr ctx, int depth); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void SSL_CTX_set_client_CA_list(IntPtr ctx, IntPtr name_list); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr SSL_CTX_get_client_CA_list(IntPtr ctx); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int SSL_CTX_load_verify_locations(IntPtr ctx, string file, string path); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int SSL_CTX_set_default_verify_paths(IntPtr ctx); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int SSL_CTX_set_cipher_list(IntPtr ctx, string cipher_string); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int SSL_CTX_use_certificate_chain_file(IntPtr ctx, string file); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int SSL_CTX_use_certificate(IntPtr ctx, IntPtr cert); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int SSL_CTX_use_PrivateKey(IntPtr ctx, IntPtr pkey); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int SSL_CTX_use_PrivateKey_file(IntPtr ctx, string file, int type); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int SSL_CTX_check_private_key(IntPtr ctx); + + public const int SSL_MAX_SID_CTX_LENGTH = 32; + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int SSL_CTX_set_session_id_context(IntPtr ctx, byte[] sid_ctx, uint sid_ctx_len); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void SSL_CTX_set_default_passwd_cb_userdata(IntPtr ssl, IntPtr data); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void SSL_CTX_set_default_passwd_cb(IntPtr ssl, pem_password_cb callback); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void SSL_CTX_set_client_cert_cb(IntPtr ssl_ctx, client_cert_cb callback); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void SSL_CTX_set_psk_client_callback(IntPtr ssl_ctx, psk_client_callback callback); + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void SSL_CTX_set_psk_server_callback(IntPtr ssl_ctx, psk_server_callback callback); + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void SSL_CTX_use_psk_identity_hint(IntPtr ssl_ctx, IntPtr identity_hint); + #endregion + + #region SSL functions + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr SSL_CIPHER_description(IntPtr ssl_cipher, byte[] buf, int buf_len); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static string SSL_CIPHER_name(IntPtr ssl_cipher); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int SSL_CIPHER_get_bits(IntPtr ssl_cipher, out int alg_bits); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr SSL_get_current_cipher(IntPtr ssl); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int SSL_get_verify_result(IntPtr ssl); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int SSL_set_verify_result(IntPtr ssl, int v); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr SSL_get_peer_certificate(IntPtr ssl); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int SSL_get_error(IntPtr ssl, int ret_code); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int SSL_accept(IntPtr ssl); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int SSL_shutdown(IntPtr ssl); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int SSL_write(IntPtr ssl, byte[] buf, int len); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int SSL_read(IntPtr ssl, byte[] buf, int len); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int SSL_renegotiate(IntPtr ssl); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int SSL_set_session_id_context(IntPtr ssl, byte[] sid_ctx, uint sid_ctx_len); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int SSL_do_handshake(IntPtr ssl); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void SSL_set_connect_state(IntPtr ssl); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void SSL_set_accept_state(IntPtr ssl); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int SSL_connect(IntPtr ssl); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr SSL_new(IntPtr ctx); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void SSL_free(IntPtr ssl); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void SSL_set_bio(IntPtr ssl, IntPtr read_bio, IntPtr write_bio); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int SSL_use_certificate_file(IntPtr ssl, string file, int type); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int SSL_use_PrivateKey_file(IntPtr ssl, string file, int type); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int SSL_clear(IntPtr ssl); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr SSL_load_client_CA_file(string file); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr SSL_get_client_CA_list(IntPtr ssl); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static void SSL_set_client_CA_list(IntPtr ssl, IntPtr name_list); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static IntPtr SSL_get_certificate(IntPtr ssl); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int SSL_use_certificate(IntPtr ssl, IntPtr x509); + + [DllImport(SSLDLLNAME, CallingConvention=CallingConvention.Cdecl)] + public extern static int SSL_use_PrivateKey(IntPtr ssl, IntPtr evp_pkey); + + #endregion + + #endregion + + #region Utilties + public static string PtrToStringAnsi(IntPtr ptr, bool hasOwnership) + { + int len = 0; + for (int i = 0; i < 1024; i++, len++) + { + byte octet = Marshal.ReadByte(ptr, i); + if (octet == 0) + break; + } + + if (len == 1024) + return "Invalid string"; + + byte[] buf = new byte[len]; + Marshal.Copy(ptr, buf, 0, len); + if (hasOwnership) + Native.OPENSSL_free(ptr); + return Encoding.ASCII.GetString(buf, 0, len); + } + + public static IntPtr ExpectNonNull(IntPtr ptr) + { + if (ptr == IntPtr.Zero) + throw new OpenSslException(); + return ptr; + } + + public static int ExpectSuccess(int ret) + { + if (ret <= 0) + throw new OpenSslException(); + return ret; + } + + public static int TextToNID(string text) + { + int nid = Native.OBJ_txt2nid(text); + if (nid == Native.NID_undef) + throw new OpenSslException(); + return nid; + } + #endregion + } + + class NameCollector + { + [StructLayout(LayoutKind.Sequential)] + struct OBJ_NAME + { + public int type; + public int alias; + public IntPtr name; + public IntPtr data; + }; + + private List list = new List(); + public List Result { get { return this.list; } } + + public NameCollector(int type, bool isSorted) + { + if (isSorted) + Native.OBJ_NAME_do_all_sorted(type, this.OnObjectName, IntPtr.Zero); + else + Native.OBJ_NAME_do_all(type, this.OnObjectName, IntPtr.Zero); + } + + private void OnObjectName(IntPtr ptr, IntPtr arg) + { + OBJ_NAME name = (OBJ_NAME)Marshal.PtrToStructure(ptr, typeof(OBJ_NAME)); + string str = Native.PtrToStringAnsi(name.name, false); + this.list.Add(str); + } + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/Core/OpenSslException.cs b/dep/openssl/src/ManagedOpenSsl/Core/OpenSslException.cs new file mode 100644 index 00000000..f97763b1 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/Core/OpenSslException.cs @@ -0,0 +1,165 @@ +// Copyright (c) 2006-2007 Frank Laub +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Text; +using System.Collections.Generic; + +namespace OpenSSL.Core +{ + /// + /// This is a struct that contains a uint for the native openssl error code. + /// It provides helper methods to convert this error code into strings. + /// + public struct OpenSslError + { + private uint err; + + /// + /// Constructs an OpenSslError object. + /// + /// The native error code + public OpenSslError(uint err) + { + this.err = err; + } + + /// + /// Returns the native error code + /// + public uint ErrorCode + { + get { return this.err; } + } + + /// + /// Returns the result of ERR_lib_error_string() + /// + public string Library + { + get { return Native.PtrToStringAnsi(Native.ERR_lib_error_string(this.err), false); } + } + + /// + /// Returns the results of ERR_reason_error_string() + /// + public string Reason + { + get { return Native.PtrToStringAnsi(Native.ERR_reason_error_string(this.err), false); } + } + + /// + /// Returns the results of ERR_func_error_string() + /// + public string Function + { + get { return Native.PtrToStringAnsi(Native.ERR_func_error_string(this.err), false); } + } + + /// + /// Returns the results of ERR_error_string_n() + /// + public string Message + { + get + { + byte[] buf = new byte[1024]; + int offset = 0; + Native.ERR_error_string_n(err, buf, buf.Length - 1); + // ERR_error_string_n doesn't return a length so we interate the string + // to find the end to prevent sending trailing nulls + for (int i = buf.Length - 1; i >= 0; i--) + { + offset = i; + if (buf[i] != (byte)0) break; + } + return Encoding.ASCII.GetString(buf, 0, offset + 1); + } + } + } + + /// + /// Exception class to provide OpenSSL specific information when errors occur. + /// + public class OpenSslException : Exception + { + private List errors = new List(); + + private OpenSslException(List context) + : base(GetErrorMessage(context)) + { + this.errors = context; + } + + /// + /// When this class is instantiated, GetErrorMessage() is called automatically. + /// This will call ERR_get_error() on the native openssl interface, once for every + /// error that is in the current context. The exception message is the concatination + /// of each of these errors turned into strings using ERR_error_string_n(). + /// + public OpenSslException() + : this(GetCurrentContext()) + { + } + + private static List GetCurrentContext() + { + List ret = new List(); + while (true) + { + uint err = Native.ERR_get_error(); + if (err == 0) + break; + + ret.Add(new OpenSslError(err)); + } + return ret; + } + + private static string GetErrorMessage(List context) + { + StringBuilder sb = new StringBuilder(); + bool isFirst = true; + foreach (OpenSslError err in context) + { + if (isFirst) + isFirst = false; + else + sb.Append("\n"); + sb.Append(err.Message); + } + + return sb.ToString(); + } + + /// + /// Returns the list of errors associated with this exception. + /// + public List Errors + { + get { return this.errors; } + } + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/Core/Password.cs b/dep/openssl/src/ManagedOpenSsl/Core/Password.cs new file mode 100644 index 00000000..1c4be18a --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/Core/Password.cs @@ -0,0 +1,110 @@ +// Copyright (c) 2009 Frank Laub +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; + +namespace OpenSSL.Core +{ + /// + /// Callback prototype. Must return the password or prompt for one. + /// + /// + /// + /// + public delegate string PasswordHandler(bool verify, object userdata); + + /// + /// Simple password callback that returns the contained password. + /// + public class PasswordCallback + { + private string password; + /// + /// Constructs a PasswordCallback + /// + /// + public PasswordCallback(string password) + { + this.password = password; + } + + /// + /// Suitable callback to be used as a PasswordHandler + /// + /// + /// + /// + public string OnPassword(bool verify, object userdata) + { + return this.password; + } + } + + internal class PasswordThunk + { + private PasswordHandler OnPassword; + private object arg; + + public Native.pem_password_cb Callback + { + get + { + if (this.OnPassword == null) + return null; + return this.OnPasswordThunk; + } + } + + public PasswordThunk(PasswordHandler client, object arg) + { + this.OnPassword = client; + this.arg = arg; + } + + internal int OnPasswordThunk(IntPtr buf, int size, int rwflag, IntPtr userdata) + { + try + { + string ret = OnPassword(rwflag != 0, this.arg); + byte[] pass = Encoding.ASCII.GetBytes(ret); + int len = pass.Length; + if (len > size) + len = size; + + Marshal.Copy(pass, 0, buf, len); + return len; + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + return -1; + } + } + } + +} diff --git a/dep/openssl/src/ManagedOpenSsl/Core/Random.cs b/dep/openssl/src/ManagedOpenSsl/Core/Random.cs new file mode 100644 index 00000000..aa3700a8 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/Core/Random.cs @@ -0,0 +1,225 @@ +// Copyright (c) 2006-2007 Frank Laub +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenSSL.Core +{ + /// + /// Exposes the RAND_* functions. + /// + public class Random + { + /// + /// Calls RAND_seed() + /// + /// + public static void Seed(byte[] seed) + { + Native.RAND_seed(seed, seed.Length); + } + + /// + /// Calls RAND_seed() + /// + /// + public static void Seed(string seed) + { + byte[] tmp = Encoding.ASCII.GetBytes(seed); + Native.RAND_seed(tmp, tmp.Length); + } + + /// + /// Calls RAND_pseudo_bytes() + /// + /// + /// + public static byte[] PseudoBytes(int len) + { + byte[] buf = new byte[len]; + Native.ExpectSuccess(Native.RAND_pseudo_bytes(buf, buf.Length)); + return buf; + } + + /// + /// Calls RAND_cleanup() + /// + public static void Cleanup() + { + Native.RAND_cleanup(); + } + + /// + /// Calls RAND_bytes() + /// + /// + /// + public static byte[] Bytes(int len) + { + byte[] buf = new byte[len]; + Native.ExpectSuccess(Native.RAND_bytes(buf, len)); + return buf; + } + + /// + /// Calls RAND_add() + /// + /// + /// + public static void Add(byte[] buf, double entropy) + { + Native.RAND_add(buf, buf.Length, entropy); + } + + /// + /// Calls RAND_load_file() + /// + /// + /// + public static void LoadFile(string filename, int max_bytes) + { + Native.ExpectSuccess(Native.RAND_load_file(filename, max_bytes)); + } + + /// + /// Calls RAND_write_file() + /// + /// + public static void WriteFile(string filename) + { + Native.ExpectSuccess(Native.RAND_write_file(filename)); + } + + /// + /// Calls RAND_file_name() + /// + /// + public static string GetFilename() + { + byte[] buf = new byte[1024]; + return Native.RAND_file_name(buf, (uint)buf.Length); + } + + /// + /// Returns RAND_status() + /// + public static int Status + { + get { return Native.RAND_status(); } + } + + /// + /// Calls RAND_query_egd_bytes() + /// + /// + /// + /// + public static void GatherEntropy(string path, byte[] buf, int bytes) + { + Native.ExpectSuccess(Native.RAND_query_egd_bytes(path, buf, bytes)); + } + + /// + /// Calls RAND_egd() + /// + /// + public static void GatherEntropy(string path) + { + Native.ExpectSuccess(Native.RAND_egd(path)); + } + + /// + /// Calls RAND_egd_bytes() + /// + /// + /// + public static void GatherEntropy(string path, int bytes) + { + Native.ExpectSuccess(Native.RAND_egd_bytes(path, bytes)); + } + + /// + /// Calls RAND_poll() + /// + public static void Poll() + { + Native.ExpectSuccess(Native.RAND_poll()); + } + + /// + /// Calls BN_rand() + /// + /// + /// + /// + /// + public static BigNumber Next(int bits, int top, int bottom) + { + BigNumber bn = new BigNumber(); + Native.ExpectSuccess(Native.BN_rand(bn.Handle, bits, top, bottom)); + return bn; + } + + /// + /// Calls BN_rand_range() + /// + /// + /// + public static BigNumber NextRange(BigNumber range) + { + BigNumber bn = new BigNumber(); + Native.ExpectSuccess(Native.BN_rand_range(bn.Handle, range.Handle)); + return bn; + } + + /// + /// Calls BN_pseudo_rand() + /// + /// + /// + /// + /// + public static BigNumber PseudoNext(int bits, int top, int bottom) + { + BigNumber bn = new BigNumber(); + Native.ExpectSuccess(Native.BN_pseudo_rand(bn.Handle, bits, top, bottom)); + return bn; + } + + /// + /// Calls BN_pseudo_rand_range() + /// + /// + /// + public static BigNumber PseudoNextRange(BigNumber range) + { + BigNumber bn = new BigNumber(); + Native.ExpectSuccess(Native.BN_pseudo_rand_range(bn.Handle, range.Handle)); + return bn; + } + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/Core/Stack.cs b/dep/openssl/src/ManagedOpenSsl/Core/Stack.cs new file mode 100644 index 00000000..36e98d81 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/Core/Stack.cs @@ -0,0 +1,367 @@ +// Copyright (c) 2006-2007 Frank Laub +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.Reflection; + +namespace OpenSSL.Core +{ + /// + /// The Stack class can only contain objects marked with this interface. + /// + public interface IStackable + { + } + + internal interface IStack + { + } + + /// + /// Encapsultes the sk_* functions + /// + /// + public class Stack : BaseValueType, IStack, IList where T : Base, IStackable + { + #region Initialization + internal Stack(IntPtr ptr, bool owner) + : base(ptr, owner) + { + } + + /// + /// Calls sk_new_null() + /// + public Stack() + : base(Native.ExpectNonNull(Native.sk_new_null()), true) + { + } + + #endregion + + #region Methods + + /// + /// Calls sk_shift() + /// + /// + public T Shift() + { + IntPtr ptr = Native.sk_shift(this.ptr); + return CreateInstance(ptr); + } + + #endregion + + #region Enumerator + class Enumerator : IEnumerator + { + private Stack parent; + private int index = -1; + public Enumerator(Stack parent) + { + this.parent = parent; + } + + #region IEnumerator Members + + public T Current + { + get + { + if (this.index < 0 || this.index >= this.parent.Count) + throw new InvalidOperationException(); + + IntPtr ptr = Native.ExpectNonNull(Native.sk_value(this.parent.Handle, index)); + // Create a new item + T item = parent.CreateInstance(ptr); + // Addref the item + item.AddRef(); + // return it + return item; + } + } + + #endregion + + #region IDisposable Members + public void Dispose() + { + } + #endregion + + #region IEnumerator Members + + object System.Collections.IEnumerator.Current + { + get { return this.Current; } + } + + public bool MoveNext() + { + this.index++; + if (this.index < this.parent.Count) + return true; + return false; + } + + public void Reset() + { + this.index = -1; + } + + #endregion + } + #endregion + + #region Overrides + /// + /// Calls sk_free() + /// + protected override void OnDispose() + { + // Free the items + Clear(); + + Native.sk_free(this.ptr); + } + + /// + /// Calls sk_dup() + /// + /// + internal override IntPtr DuplicateHandle() + { + return Native.sk_dup(this.ptr); + } + + #endregion + + #region IList Members + + /// + /// Returns sk_find() + /// + /// + /// + public int IndexOf(T item) + { + return Native.sk_find(this.ptr, item.Handle); + } + + /// + /// Calls sk_insert() + /// + /// + /// + public void Insert(int index, T item) + { + // Insert the item into the stack + Native.ExpectSuccess(Native.sk_insert(this.ptr, item.Handle, index)); + // Addref the item + item.AddRef(); + } + + /// + /// Calls sk_delete() + /// + /// + public void RemoveAt(int index) + { + Native.ExpectNonNull(Native.sk_delete(this.ptr, index)); + } + + /// + /// Indexer that returns sk_value() or calls sk_insert() + /// + /// + /// + public T this[int index] + { + get + { + // Get the native pointer from the stack + IntPtr ptr = Native.ExpectNonNull(Native.sk_value(this.ptr, index)); + // Create a new object + T item = CreateInstance(ptr); + // Addref the object + item.AddRef(); + // Return the managed object + return item; + } + set + { + // Insert the item in the stack + int ret = Native.sk_insert(this.ptr, value.Handle, index); + if (ret < 0) + throw new OpenSslException(); + // Addref the native pointer + value.AddRef(); + } + } + + #endregion + + #region ICollection Members + + /// + /// Calls sk_push() + /// + /// + public void Add(T item) + { + // Add the item to the stack + if (Native.sk_push(this.ptr, item.Handle) <= 0) + throw new OpenSslException(); + // Addref the native pointer + item.AddRef(); + } + + /// + /// Clear all items from the stack + /// + public void Clear() + { + IntPtr value_ptr = Native.sk_shift(this.ptr); + while (value_ptr != IntPtr.Zero) + { + T item = CreateInstance(value_ptr); + item.Dispose(); + value_ptr = Native.sk_shift(this.ptr); + } + } + + /// + /// Returns true if the specified item exists in this stack. + /// + /// + /// + public bool Contains(T item) + { + foreach (T element in this) + { + if (element.Equals(item)) + return true; + } + return false; + //int ret = Native.sk_find(this.ptr, item.Handle); + //if (ret >= 0 && ret < this.Count) + // return true; + //return false; + } + + /// + /// Not implemented + /// + /// + /// + public void CopyTo(T[] array, int arrayIndex) + { + throw new Exception("The method or operation is not implemented."); + } + + /// + /// Returns sk_num() + /// + public int Count + { + get + { + int ret = Native.sk_num(this.ptr); + if (ret < 0) + throw new OpenSslException(); + return ret; + } + } + + /// + /// Returns false. + /// + public bool IsReadOnly + { + get { return false; } + } + + /// + /// Calls sk_delete_ptr() + /// + /// + /// + public bool Remove(T item) + { + IntPtr ptr = Native.sk_delete_ptr(this.ptr, item.Handle); + if (ptr != IntPtr.Zero) + { + return true; + } + return false; + } + + #endregion + + #region IEnumerable Members + + /// + /// Returns an enumerator for this stack + /// + /// + public IEnumerator GetEnumerator() + { + return new Enumerator(this); + } + + #endregion + + #region IEnumerable Members + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return new Enumerator(this); + } + + #endregion + + #region Helpers + + private T CreateInstance(IntPtr ptr) + { + object[] args = new object[] { + (IStack)this, + ptr + }; + BindingFlags flags = + BindingFlags.NonPublic | + BindingFlags.Public | + BindingFlags.Instance; + T item = (T)Activator.CreateInstance(typeof(T), flags, null, args, null); + return item; + } + + #endregion + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/Core/Version.cs b/dep/openssl/src/ManagedOpenSsl/Core/Version.cs new file mode 100644 index 00000000..74574136 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/Core/Version.cs @@ -0,0 +1,209 @@ +// Copyright (c) 2006-2007 Frank Laub +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenSSL.Core +{ + /// + /// Contains the set of elements that make up a Version. + /// MNNFFPPS: major minor fix patch status + /// + public class Version + { + private uint raw; + + /// + /// The kinds of status that + /// + public enum StatusType + { + /// + /// The status nibble has the value 0 + /// + Development, + + /// + /// The status nibble is 1 to 14 (0x0e) + /// + Beta, + + /// + /// The status nibble is 0x0f + /// + Release, + } + + /// + /// Returns the current version of the native library. + /// + public static Version Library + { + get { return new Version(Native.SSLeay()); } + } + + /// + /// Returns the version that this wrapper is built for. + /// + public static Version Wrapper + { + get { return new Version(Native.Wrapper); } + } + + /// + /// Create a Version from a raw uint value + /// + /// + public Version(uint raw) + { + this.raw = raw; + } + + /// + /// Major portion of the Version. + /// + public uint Major + { + get { return (this.raw >> 28) & 0xff; } + } + + /// + /// Minor portion of the Version. + /// + public uint Minor + { + get { return (this.raw >> 20) & 0xff; } + } + + /// + /// Fix portion of the Version. + /// + public uint Fix + { + get { return (this.raw >> 12) & 0xff; } + } + + /// + /// Patch portion of the Version. These should start at 'a' and continue to 'z'. + /// + public char Patch + { + get + { + uint patch = (this.raw >> 4) & 0xff; + + byte a = Encoding.ASCII.GetBytes("a")[0]; + uint x = a + patch; + char ch = Encoding.ASCII.GetString(new byte[] { (byte)x })[0]; + return ch; + } + } + + /// + /// Status portion of the Version. + /// + public StatusType Status + { + get + { + uint status = this.RawStatus; + if (status == 0) + return StatusType.Development; + else if (status == 0xf) + return StatusType.Release; + else + return StatusType.Beta; + } + } + + /// + /// The raw uint value. + /// + public uint Raw + { + get { return this.raw; } + } + + /// + /// Returns the raw status portion of a Version. + /// + public uint RawStatus + { + get { return this.raw & 0x0000000f; } + } + + /// + /// Conversion to a string. + /// + /// + public override string ToString() + { + return string.Format("{0}.{1}.{2}{3} {4}", + Major, + Minor, + Fix, + Patch, + Status); + } + + /// + /// SSLEAY_* constants used for with GetVersion() + /// + public enum Format + { + /// + /// SSLEAY_VERSION + /// + Text = 0, + /// + /// SSLEAY_CFLAGS + /// + CompilerFlags = 2, + /// + /// SSLEAY_BUILT_ON + /// + BuildDate = 3, + /// + /// SSLEAY_PLATFORM + /// + Platform = 4, + /// + /// SSLEAY_DIR + /// + BuildDirectory = 5, + } + + /// + /// Calls SSLeay_version() + /// + /// + public static string GetText(Format format) + { + return Native.SSLeay_version((int)format); + } + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/Crypto/Cipher.cs b/dep/openssl/src/ManagedOpenSsl/Crypto/Cipher.cs new file mode 100644 index 00000000..3884c6b9 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/Crypto/Cipher.cs @@ -0,0 +1,846 @@ +// Copyright (c) 2006-2007 Frank Laub +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.IO; +using OpenSSL.Core; + +namespace OpenSSL.Crypto +{ + #region Cipher + /// + /// Wraps the EVP_CIPHER object. + /// + public class Cipher : Base + { + private EVP_CIPHER raw; + internal Cipher(IntPtr ptr, bool owner) : base(ptr, owner) + { + this.raw = (EVP_CIPHER)Marshal.PtrToStructure(this.ptr, typeof(EVP_CIPHER)); + } + + /// + /// Prints the LongName of this cipher. + /// + /// + public override void Print(BIO bio) + { + bio.Write(this.LongName); + } + + /// + /// Not implemented, these objects should never be disposed + /// + protected override void OnDispose() { + throw new NotImplementedException(); + } + + /// + /// Returns EVP_get_cipherbyname() + /// + /// + /// + public static Cipher CreateByName(string name) + { + byte[] buf = Encoding.ASCII.GetBytes(name); + IntPtr ptr = Native.EVP_get_cipherbyname(buf); + if(ptr == IntPtr.Zero) + return null; + return new Cipher(ptr, false); + } + + /// + /// Calls OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH) + /// + public static string[] AllNamesSorted + { + get { return new NameCollector(Native.OBJ_NAME_TYPE_CIPHER_METH, true).Result.ToArray(); } + } + + /// + /// Calls OBJ_NAME_do_all(OBJ_NAME_TYPE_CIPHER_METH) + /// + public static string[] AllNames + { + get { return new NameCollector(Native.OBJ_NAME_TYPE_CIPHER_METH, false).Result.ToArray(); } + } + + #region EVP_CIPHER + [StructLayout(LayoutKind.Sequential)] + struct EVP_CIPHER + { + public int nid; + public int block_size; + public int key_len; + public int iv_len; + public uint flags; + public IntPtr init; + public IntPtr do_cipher; + public IntPtr cleanup; + public int ctx_size; + public IntPtr set_asn1_parameters; + public IntPtr get_asn1_parameters; + public IntPtr ctrl; + public IntPtr app_data; + } + #endregion + + #region Ciphers + /// + /// EVP_enc_null() + /// + public static Cipher Null = new Cipher(Native.EVP_enc_null(), false); + + /// + /// EVP_des_ecb() + /// + public static Cipher DES_ECB = new Cipher(Native.EVP_des_ecb(), false); + + /// + /// EVP_des_ede() + /// + public static Cipher DES_EDE = new Cipher(Native.EVP_des_ede(), false); + + /// + /// EVP_des_ede3() + /// + public static Cipher DES_EDE3 = new Cipher(Native.EVP_des_ede3(), false); + + /// + /// EVP_des_ede_ecb() + /// + public static Cipher DES_EDE_ECB = new Cipher(Native.EVP_des_ede_ecb(), false); + + /// + /// EVP_des_ede3_ecb() + /// + public static Cipher DES_EDE3_ECB = new Cipher(Native.EVP_des_ede3_ecb(), false); + + /// + /// EVP_des_cfb64() + /// + public static Cipher DES_CFB64 = new Cipher(Native.EVP_des_cfb64(), false); + + /// + /// EVP_des_cfb1() + /// + public static Cipher DES_CFB1 = new Cipher(Native.EVP_des_cfb1(), false); + + /// + /// EVP_des_cfb8() + /// + public static Cipher DES_CFB8 = new Cipher(Native.EVP_des_cfb8(), false); + + /// + /// EVP_des_ede_cfb64() + /// + public static Cipher DES_EDE_CFB64 = new Cipher(Native.EVP_des_ede_cfb64(), false); + + /// + /// EVP_des_ede3_cfb64() + /// + public static Cipher DES_EDE3_CFB64 = new Cipher(Native.EVP_des_ede3_cfb64(), false); + + /// + /// EVP_des_ede3_cfb1() + /// + public static Cipher DES_EDE3_CFB1 = new Cipher(Native.EVP_des_ede3_cfb1(), false); + + /// + /// EVP_des_ede3_cfb8() + /// + public static Cipher DES_EDE3_CFB8 = new Cipher(Native.EVP_des_ede3_cfb8(), false); + + /// + /// EVP_des_ofb() + /// + public static Cipher DES_OFB = new Cipher(Native.EVP_des_ofb(), false); + + /// + /// EVP_ded_ede_ofb() + /// + public static Cipher DES_EDE_OFB = new Cipher(Native.EVP_des_ede_ofb(), false); + + /// + /// EVP_des_ede3_ofb() + /// + public static Cipher DES_EDE3_OFB = new Cipher(Native.EVP_des_ede3_ofb(), false); + + /// + /// EVP_des_cbc() + /// + public static Cipher DES_CBC = new Cipher(Native.EVP_des_cbc(), false); + + /// + /// EVP_des_ede_cbc() + /// + public static Cipher DES_EDE_CBC = new Cipher(Native.EVP_des_ede_cbc(), false); + + /// + /// EVP_des_ede3_cbc() + /// + public static Cipher DES_EDE3_CBC = new Cipher(Native.EVP_des_ede3_cbc(), false); + + /// + /// EVP_desx_cbc() + /// + public static Cipher DESX_CBC = new Cipher(Native.EVP_desx_cbc(), false); + + /// + /// EVP_rc4() + /// + public static Cipher RC4 = new Cipher(Native.EVP_rc4(), false); + + /// + /// EVP_rc4_40() + /// + public static Cipher RC4_40 = new Cipher(Native.EVP_rc4_40(), false); + + /// + /// EVP_idea_ecb() + /// + public static Cipher Idea_ECB = new Cipher(Native.EVP_idea_ecb(), false); + + /// + /// EVP_idea_cfb64() + /// + public static Cipher Idea_CFB64 = new Cipher(Native.EVP_idea_cfb64(), false); + + /// + /// EVP_idea_ofb() + /// + public static Cipher Idea_OFB = new Cipher(Native.EVP_idea_ofb(), false); + + /// + /// EVP_idea_cbc() + /// + public static Cipher Idea_CBC = new Cipher(Native.EVP_idea_cbc(), false); + + /// + /// EVP_rc2_ecb() + /// + public static Cipher RC2_ECB = new Cipher(Native.EVP_rc2_ecb(), false); + + /// + /// EVP_rc2_cbc() + /// + public static Cipher RC2_CBC = new Cipher(Native.EVP_rc2_cbc(), false); + + /// + /// EVP_rc2_40_cbc() + /// + public static Cipher RC2_40_CBC = new Cipher(Native.EVP_rc2_40_cbc(), false); + + /// + /// EVP_rc2_64_cbc() + /// + public static Cipher RC2_64_CBC = new Cipher(Native.EVP_rc2_64_cbc(), false); + + /// + /// EVP_rc2_cfb64() + /// + public static Cipher RC2_CFB64 = new Cipher(Native.EVP_rc2_cfb64(), false); + + /// + /// EVP_rc2_ofb() + /// + public static Cipher RC2_OFB = new Cipher(Native.EVP_rc2_ofb(), false); + + /// + /// EVP_bf_ecb() + /// + public static Cipher Blowfish_ECB = new Cipher(Native.EVP_bf_ecb(), false); + + /// + /// EVP_bf_cbc() + /// + public static Cipher Blowfish_CBC = new Cipher(Native.EVP_bf_cbc(), false); + + /// + /// EVP_bf_cfb64() + /// + public static Cipher Blowfish_CFB64 = new Cipher(Native.EVP_bf_cfb64(), false); + + /// + /// EVP_bf_ofb() + /// + public static Cipher Blowfish_OFB = new Cipher(Native.EVP_bf_ofb(), false); + + /// + /// EVP_cast5_ecb() + /// + public static Cipher Cast5_ECB = new Cipher(Native.EVP_cast5_ecb(), false); + + /// + /// EVP_cast5_cbc() + /// + public static Cipher Cast5_CBC = new Cipher(Native.EVP_cast5_cbc(), false); + + /// + /// EVP_cast5_cfb64() + /// + public static Cipher Cast5_OFB64 = new Cipher(Native.EVP_cast5_cfb64(), false); + + /// + /// EVP_cast5_ofb() + /// + public static Cipher Cast5_OFB = new Cipher(Native.EVP_cast5_ofb(), false); + +#if OPENSSL_RC5_SUPPORT + public static Cipher RC5_32_12_16_CBC = new Cipher(Native.EVP_rc5_32_12_16_cbc(), false); + public static Cipher RC5_32_12_16_ECB = new Cipher(Native.EVP_rc5_32_12_16_ecb(), false); + public static Cipher RC5_32_12_16_CFB64 = new Cipher(Native.EVP_rc5_32_12_16_cfb64(), false); + public static Cipher RC5_32_12_16_OFB = new Cipher(Native.EVP_rc5_32_12_16_ofb(), false); +#endif + + /// + /// EVP_aes_128_ecb() + /// + public static Cipher AES_128_ECB = new Cipher(Native.EVP_aes_128_ecb(), false); + + /// + /// EVP_aes_128_cbc() + /// + public static Cipher AES_128_CBC = new Cipher(Native.EVP_aes_128_cbc(), false); + + /// + /// EVP_aes_128_cfb1() + /// + public static Cipher AES_128_CFB1 = new Cipher(Native.EVP_aes_128_cfb1(), false); + + /// + /// EVP_aes_128_cfb8() + /// + public static Cipher AES_128_CFB8 = new Cipher(Native.EVP_aes_128_cfb8(), false); + + /// + /// EVP_aes_128_cfb128() + /// + public static Cipher AES_128_CFB128 = new Cipher(Native.EVP_aes_128_cfb128(), false); + + /// + /// EVP_aes_128_ofb() + /// + public static Cipher AES_128_OFB = new Cipher(Native.EVP_aes_128_ofb(), false); + + /// + /// EVP_aes_192_ecb() + /// + public static Cipher AES_192_ECB = new Cipher(Native.EVP_aes_192_ecb(), false); + + /// + /// EVP_aes_192_cbc() + /// + public static Cipher AES_192_CBC = new Cipher(Native.EVP_aes_192_cbc(), false); + + /// + /// EVP_aes_192_cfb1() + /// + public static Cipher AES_192_CFB1 = new Cipher(Native.EVP_aes_192_cfb1(), false); + + /// + /// EVP_aes_192_cfb8() + /// + public static Cipher AES_192_CFB8 = new Cipher(Native.EVP_aes_192_cfb8(), false); + + /// + /// EVP_aes_192_cfb128() + /// + public static Cipher AES_192_CFB128 = new Cipher(Native.EVP_aes_192_cfb128(), false); + + /// + /// EVP_aes_192_ofb() + /// + public static Cipher AES_192_OFB = new Cipher(Native.EVP_aes_192_ofb(), false); + + /// + /// EVP_aes_256_ecb() + /// + public static Cipher AES_256_ECB = new Cipher(Native.EVP_aes_256_ecb(), false); + + /// + /// EVP_aes_256_cbc() + /// + public static Cipher AES_256_CBC = new Cipher(Native.EVP_aes_256_cbc(), false); + + /// + /// EVP_aes_256_cfb1() + /// + public static Cipher AES_256_CFB1 = new Cipher(Native.EVP_aes_256_cfb1(), false); + + /// + /// EVP_aes_256_cfb8() + /// + public static Cipher AES_256_CFB8 = new Cipher(Native.EVP_aes_256_cfb8(), false); + + /// + /// EVP_aes_256_cfb128() + /// + public static Cipher AES_256_CFB128 = new Cipher(Native.EVP_aes_256_cfb128(), false); + + /// + /// EVP_aes_256_ofb() + /// + public static Cipher AES_256_OFB = new Cipher(Native.EVP_aes_256_ofb(), false); + + #endregion + + #region Properties + + /// + /// Returns the key_len field + /// + public int KeyLength + { + get { return this.raw.key_len; } + } + + /// + /// Returns the iv_len field + /// + public int IVLength + { + get { return this.raw.iv_len; } + } + + /// + /// Returns the block_size field + /// + public int BlockSize + { + get { return this.raw.block_size; } + } + + /// + /// Returns the flags field + /// + public uint Flags + { + get { return this.raw.flags; } + } + + /// + /// Returns the long name for the nid field using OBJ_nid2ln() + /// + public string LongName + { + get { return Native.PtrToStringAnsi(Native.OBJ_nid2ln(this.raw.nid), false); } + } + + /// + /// Returns the name for the nid field using OBJ_nid2sn() + /// + public string Name + { + get { return Native.PtrToStringAnsi(Native.OBJ_nid2sn(this.raw.nid), false); } + } + + /// + /// Returns EVP_CIPHER_type() + /// + public int Type + { + get { return Native.EVP_CIPHER_type(this.ptr); } + } + + /// + /// Returns the long name for the type using OBJ_nid2ln() + /// + public string TypeName + { + get { return Native.PtrToStringAnsi(Native.OBJ_nid2ln(this.Type), false); } + } + #endregion + } + #endregion + + /// + /// Simple struct to encapsulate common parameters for crypto functions + /// + public struct Envelope + { + /// + /// The key for a crypto operation + /// + public ArraySegment[] Keys; + + /// + /// The IV (Initialization Vector) + /// + public byte[] IV; + + /// + /// The payload (contains plaintext or ciphertext) + /// + public byte[] Data; + } + + /// + /// Wraps the EVP_CIPHER_CTX object. + /// + public class CipherContext : Base, IDisposable + { + #region EVP_CIPHER_CTX + [StructLayout(LayoutKind.Sequential)] + struct EVP_CIPHER_CTX + { + public IntPtr cipher; + public IntPtr engine; /* functional reference if 'cipher' is ENGINE-provided */ + public int encrypt; /* encrypt or decrypt */ + public int buf_len; /* number we have left */ + + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Native.EVP_MAX_IV_LENGTH)] + public byte[] oiv; /* original iv */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Native.EVP_MAX_IV_LENGTH)] + public byte[] iv; /* working iv */ + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Native.EVP_MAX_BLOCK_LENGTH)] + public byte[] buf;/* saved partial block */ + public int num; /* used by cfb/ofb mode */ + + public IntPtr app_data; /* application stuff */ + public int key_len; /* May change for variable length cipher */ + public uint flags; /* Various flags */ + public IntPtr cipher_data; /* per EVP data */ + public int final_used; + public int block_mask; + + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Native.EVP_MAX_BLOCK_LENGTH)] + public byte[] final;/* possible final block */ + } + #endregion + + private Cipher cipher; + + /// + /// Calls OPENSSL_malloc() and initializes the buffer using EVP_CIPHER_CTX_init() + /// + /// + public CipherContext(Cipher cipher) + : base(Native.OPENSSL_malloc(Marshal.SizeOf(typeof(EVP_CIPHER_CTX))), true) + { + Native.EVP_CIPHER_CTX_init(this.ptr); + this.cipher = cipher; + } + + /// + /// Returns the cipher's LongName + /// + /// + public override void Print(BIO bio) + { + bio.Write("CipherContext: " + this.cipher.LongName); + } + + #region Methods + + /// + /// Calls EVP_OpenInit() and EVP_OpenFinal() + /// + /// + /// + /// + /// + public byte[] Open(byte[] input, byte[] iv, CryptoKey pkey) + { + Native.ExpectSuccess(Native.EVP_OpenInit( + this.ptr, this.cipher.Handle, input, input.Length, iv, pkey.Handle)); + + int len; + Native.ExpectSuccess(Native.EVP_OpenFinal(this.ptr, null, out len)); + + byte[] output = new byte[len]; + Native.ExpectSuccess(Native.EVP_OpenFinal(this.ptr, output, out len)); + + return output; + } + + /// + /// Calls EVP_SealInit() and EVP_SealFinal() + /// + /// + /// + /// + public Envelope Seal(CryptoKey[] pkeys, bool needsIV) + { + Envelope ret = new Envelope(); + byte[][] bufs = new byte[pkeys.Length][]; + int[] lens = new int[pkeys.Length]; + IntPtr[] pubkeys = new IntPtr[pkeys.Length]; + ret.Keys = new ArraySegment[pkeys.Length]; + for (int i = 0; i < pkeys.Length; ++i) + { + bufs[i] = new byte[pkeys[i].Size]; + lens[i] = pkeys[i].Size; + pubkeys[i] = pkeys[i].Handle; + } + + if(needsIV) + ret.IV = new byte[this.cipher.IVLength]; + + int len; + Native.ExpectSuccess(Native.EVP_SealInit( + this.ptr, this.cipher.Handle, bufs, lens, ret.IV, pubkeys, pubkeys.Length)); + for (int i = 0; i < pkeys.Length; ++i) + { + ret.Keys[i] = new ArraySegment(bufs[i], 0, lens[i]); + } + + Native.ExpectSuccess(Native.EVP_SealFinal(this.ptr, null, out len)); + + ret.Data = new byte[len]; + Native.ExpectSuccess(Native.EVP_SealFinal(this.ptr, ret.Data, out len)); + + return ret; + } + + /// + /// Encrypts or decrypts the specified payload. + /// + /// + /// + /// + /// + /// + public byte[] Crypt(byte[] input, byte[] key, byte[] iv, bool doEncrypt) + { + return this.Crypt(input, key, iv, doEncrypt, -1); + } + + private byte[] SetupKey(byte[] key) + { + byte[] real_key; + bool isStreamCipher = (this.cipher.Flags & Native.EVP_CIPH_MODE) == Native.EVP_CIPH_STREAM_CIPHER; + if (isStreamCipher) + { + real_key = new byte[this.Cipher.KeyLength]; + if (key == null) + real_key.Initialize(); + else + Buffer.BlockCopy(key, 0, real_key, 0, Math.Min(key.Length, real_key.Length)); + } + else + { + if (key == null) + { + real_key = new byte[this.Cipher.KeyLength]; + real_key.Initialize(); + } + else + { + if (this.Cipher.KeyLength != key.Length) + { + real_key = new byte[this.Cipher.KeyLength]; + real_key.Initialize(); + Buffer.BlockCopy(key, 0, real_key, 0, Math.Min(key.Length, real_key.Length)); + } + else + { + real_key = key; + } + } + // FIXME: what was this for?? +// total += this.cipher.BlockSize; + } + return real_key; + } + + private byte[] SetupIV(byte[] iv) + { + if (this.cipher.IVLength > iv.Length) + { + byte[] ret = new byte[this.cipher.IVLength]; + ret.Initialize(); + Buffer.BlockCopy(iv, 0, ret, 0, iv.Length); + return ret; + } + return iv; + } + + /// + /// Calls EVP_CipherInit_ex(), EVP_CipherUpdate(), and EVP_CipherFinal_ex() + /// + /// + /// + /// + /// + /// + /// + public byte[] Crypt(byte[] input, byte[] key, byte[] iv, bool doEncrypt, int padding) + { + int enc = doEncrypt ? 1 : 0; + + int total = input.Length; + byte[] real_key = SetupKey(key); + byte[] real_iv = SetupIV(iv); + + byte[] buf = new byte[total]; + MemoryStream memory = new MemoryStream(total); + + Native.ExpectSuccess(Native.EVP_CipherInit_ex( + this.ptr, this.cipher.Handle, IntPtr.Zero, null, null, enc)); + Native.ExpectSuccess(Native.EVP_CIPHER_CTX_set_key_length(this.ptr, real_key.Length)); + if (padding >= 0) + Native.ExpectSuccess(Native.EVP_CIPHER_CTX_set_padding(this.ptr, padding)); + + bool isStreamCipher = (this.cipher.Flags & Native.EVP_CIPH_MODE) == Native.EVP_CIPH_STREAM_CIPHER; + if (isStreamCipher) + { + for (int i = 0; i < Math.Min(real_key.Length, iv.Length); i++) + { + real_key[i] ^= iv[i]; + } + + Native.ExpectSuccess(Native.EVP_CipherInit_ex( + this.ptr, this.cipher.Handle, IntPtr.Zero, real_key, null, enc)); + } + else + { + Native.ExpectSuccess(Native.EVP_CipherInit_ex( + this.ptr, this.cipher.Handle, IntPtr.Zero, real_key, real_iv, enc)); + } + + int len = buf.Length; + Native.ExpectSuccess(Native.EVP_CipherUpdate( + this.ptr, buf, out len, input, input.Length)); + + memory.Write(buf, 0, len); + + len = buf.Length; + Native.EVP_CipherFinal_ex(this.ptr, buf, ref len); + + memory.Write(buf, 0, len); + + return memory.ToArray(); + } + + /// + /// Encrypts the specified plaintext + /// + /// + /// + /// + /// + public byte[] Encrypt(byte[] input, byte[] key, byte[] iv) + { + return this.Crypt(input, key, iv, true); + } + + /// + /// Decrypts the specified ciphertext + /// + /// + /// + /// + /// + public byte[] Decrypt(byte[] input, byte[] key, byte[] iv) + { + return this.Crypt(input, key, iv, false); + } + + /// + /// Encrypts the specified plaintext + /// + /// + /// + /// + /// + /// + public byte[] Encrypt(byte[] input, byte[] key, byte[] iv, int padding) + { + return this.Crypt(input, key, iv, true, padding); + } + + /// + /// Decrypts the specified ciphertext + /// + /// + /// + /// + /// + /// + public byte[] Decrypt(byte[] input, byte[] key, byte[] iv, int padding) + { + return this.Crypt(input, key, iv, false, padding); + } + + /// + /// Calls EVP_BytesToKey + /// + /// + /// + /// + /// + /// + /// + public byte[] BytesToKey(MessageDigest md, byte[] salt, byte[] data, int count, out byte[] iv) + { + byte[] key = new byte[this.cipher.KeyLength]; + iv = new byte[this.cipher.IVLength]; + Native.ExpectSuccess(Native.EVP_BytesToKey( + this.cipher.Handle, + md.Handle, + salt, + data, + data.Length, + count, + key, + iv)); + return key; + } + + #endregion + + #region Properties + /// + /// Returns the EVP_CIPHER for this context. + /// + public Cipher Cipher + { + get { return this.cipher; } + } + + private EVP_CIPHER_CTX Raw + { + get { return (EVP_CIPHER_CTX)Marshal.PtrToStructure(this.ptr, typeof(EVP_CIPHER_CTX)); } + set { Marshal.StructureToPtr(value, this.ptr, false); } + } + #endregion + + #region IDisposable Members + + /// + /// Calls EVP_CIPHER_CTX_clean() and then OPENSSL_free() + /// + protected override void OnDispose() { + Native.EVP_CIPHER_CTX_cleanup(this.ptr); + Native.OPENSSL_free(this.ptr); + } + + #endregion + } +} \ No newline at end of file diff --git a/dep/openssl/src/ManagedOpenSsl/Crypto/CryptoKey.cs b/dep/openssl/src/ManagedOpenSsl/Crypto/CryptoKey.cs new file mode 100644 index 00000000..b7629a37 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/Crypto/CryptoKey.cs @@ -0,0 +1,398 @@ +// Copyright (c) 2006-2007 Frank Laub +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using OpenSSL.Core; + +namespace OpenSSL.Crypto +{ + /// + /// Wraps the native OpenSSL EVP_PKEY object + /// + public class CryptoKey : BaseCopyableRef + { + /// + /// Set of types that this CryptoKey can be. + /// + public enum KeyType + { + /// + /// EVP_PKEY_RSA + /// + RSA = 6, + /// + /// EVP_PKEY_DSA + /// + DSA = 116, + /// + /// EVP_PKEY_DH + /// + DH = 28, + /// + /// EVP_PKEY_EC + /// + EC = 408 + } + + const int EVP_PKEY_RSA = 6; + const int EVP_PKEY_DSA = 116; + const int EVP_PKEY_DH = 28; + const int EVP_PKEY_EC = 408; + + [StructLayout(LayoutKind.Sequential)] + struct EVP_PKEY + { + public int type; + int save_type; + int references; + IntPtr ptr; + int save_parameters; + IntPtr attributes; + } + + #region Initialization + internal CryptoKey(IntPtr ptr, bool owner) + : base(ptr, owner) + { } + + /// + /// Calls EVP_PKEY_new() + /// + public CryptoKey() + : base(Native.ExpectNonNull(Native.EVP_PKEY_new()), true) + { } + + /// + /// Calls PEM_read_bio_PUBKEY() + /// + /// + /// + /// + public static CryptoKey FromPublicKey(string pem, string password) + { + using (BIO bio = new BIO(pem)) + { + return FromPublicKey(bio, password); + } + } + + /// + /// Calls PEM_read_bio_PUBKEY() + /// + /// + /// + /// + public static CryptoKey FromPublicKey(BIO bio, string password) + { + PasswordCallback callback = new PasswordCallback(password); + return FromPublicKey(bio, callback.OnPassword, null); + } + + /// + /// Calls PEM_read_bio_PUBKEY() + /// + /// + /// + /// + /// + public static CryptoKey FromPublicKey(BIO bio, PasswordHandler handler, object arg) + { + PasswordThunk thunk = new PasswordThunk(handler, arg); + IntPtr ptr = Native.ExpectNonNull(Native.PEM_read_bio_PUBKEY( + bio.Handle, + IntPtr.Zero, + thunk.Callback, + IntPtr.Zero + )); + + return new CryptoKey(ptr, true); + } + + /// + /// Calls PEM_read_bio_PrivateKey() + /// + /// + /// + /// + public static CryptoKey FromPrivateKey(string pem, string password) + { + using (BIO bio = new BIO(pem)) + { + return FromPrivateKey(bio, password); + } + } + + /// + /// Calls PEM_read_bio_PrivateKey() + /// + /// + /// + /// + public static CryptoKey FromPrivateKey(BIO bio, string passwd) + { + PasswordCallback callback = new PasswordCallback(passwd); + return FromPrivateKey(bio, callback.OnPassword, null); + } + + /// + /// Calls PEM_read_bio_PrivateKey() + /// + /// + /// + /// + /// + public static CryptoKey FromPrivateKey(BIO bio, PasswordHandler handler, object arg) + { + PasswordThunk thunk = new PasswordThunk(handler, arg); + IntPtr ptr = Native.ExpectNonNull(Native.PEM_read_bio_PrivateKey( + bio.Handle, + IntPtr.Zero, + thunk.Callback, + IntPtr.Zero + )); + + return new CryptoKey(ptr, true); + } + + /// + /// Calls EVP_PKEY_set1_DSA() + /// + /// + public CryptoKey(DSA dsa) + : this() + { + Native.ExpectSuccess(Native.EVP_PKEY_set1_DSA(this.ptr, dsa.Handle)); + } + + /// + /// Calls EVP_PKEY_set1_RSA() + /// + /// + public CryptoKey(RSA rsa) + : this() + { + Native.ExpectSuccess(Native.EVP_PKEY_set1_RSA(this.ptr, rsa.Handle)); + } + + /// + /// Calls EVP_PKEY_set1_DH() + /// + /// + public CryptoKey(DH dh) + : this() + { + Native.ExpectSuccess(Native.EVP_PKEY_set1_DH(this.ptr, dh.Handle)); + } + #endregion + + #region Properties + private EVP_PKEY Raw + { + get { return (EVP_PKEY)Marshal.PtrToStructure(this.ptr, typeof(EVP_PKEY)); } + } + + /// + /// Returns EVP_PKEY_type() + /// + public KeyType Type + { + get + { + int ret = Native.EVP_PKEY_type(this.Raw.type); + switch (ret) + { + case EVP_PKEY_EC: + return KeyType.EC; + case EVP_PKEY_DH: + return KeyType.DH; + case EVP_PKEY_DSA: + return KeyType.DSA; + case EVP_PKEY_RSA: + return KeyType.RSA; + default: + throw new NotSupportedException(); + } + } + } + + /// + /// Returns EVP_PKEY_bits() + /// + public int Bits + { + get { return Native.EVP_PKEY_bits(this.ptr); } + } + + /// + /// Returns EVP_PKEY_size() + /// + public int Size + { + get { return Native.EVP_PKEY_size(this.ptr); } + } + #endregion + + #region Methods + + /// + /// Calls EVP_PKEY_assign() + /// + /// + /// + public void Assign(int type, byte[] key) + { + Native.ExpectSuccess(Native.EVP_PKEY_assign(this.ptr, type, key)); + } + + /// + /// Returns EVP_PKEY_get1_DSA() + /// + /// + public DSA GetDSA() + { + if (this.Type != KeyType.DSA) + throw new InvalidOperationException(); + return new DSA(Native.ExpectNonNull(Native.EVP_PKEY_get1_DSA(this.ptr)), true); + } + + /// + /// Returns EVP_PKEY_get1_DH() + /// + /// + public DH GetDH() + { + if (this.Type != KeyType.DH) + throw new InvalidOperationException(); + return new DH(Native.ExpectNonNull(Native.EVP_PKEY_get1_DH(this.ptr)), false); + } + + /// + /// Returns EVP_PKEY_get1_RSA() + /// + /// + public RSA GetRSA() + { + if (this.Type != KeyType.RSA) + throw new InvalidOperationException(); + return new RSA(Native.ExpectNonNull(Native.EVP_PKEY_get1_RSA(this.ptr)), false); + } + + /// + /// Calls PEM_write_bio_PKCS8PrivateKey + /// + /// + /// + /// + public void WritePrivateKey(BIO bp, Cipher cipher, string password) + { + PasswordCallback callback = new PasswordCallback(password); + WritePrivateKey(bp, cipher, callback.OnPassword, null); + } + + /// + /// Calls PEM_write_bio_PKCS8PrivateKey + /// + /// + /// + /// + /// + public void WritePrivateKey(BIO bp, Cipher cipher, PasswordHandler handler, object arg) + { + PasswordThunk thunk = new PasswordThunk(handler, null); + Native.ExpectSuccess(Native.PEM_write_bio_PKCS8PrivateKey(bp.Handle, this.ptr, cipher.Handle, IntPtr.Zero, 0, thunk.Callback, IntPtr.Zero)); + } + + #endregion + + #region Overrides + + /// + /// Calls EVP_PKEY_free() + /// + protected override void OnDispose() + { + Native.EVP_PKEY_free(this.ptr); + } + + /// + /// Returns CompareTo(obj) + /// + /// + /// + public override bool Equals(object obj) + { + CryptoKey rhs = obj as CryptoKey; + if (rhs == null) + return false; + return Native.EVP_PKEY_cmp(this.ptr, rhs.Handle) == 1; + } + + /// + /// + /// + /// + public override int GetHashCode() + { + return base.GetHashCode(); + } + + internal override CryptoLockTypes LockType + { + get { return CryptoLockTypes.CRYPTO_LOCK_X509_PKEY; } + } + + internal override Type RawReferenceType + { + get { return typeof(EVP_PKEY); } + } + + /// + /// Calls appropriate Print() based on the type. + /// + /// + public override void Print(BIO bio) + { + switch (this.Type) + { + case KeyType.RSA: + GetRSA().Print(bio); + break; + case KeyType.DSA: + GetDSA().Print(bio); + break; + case KeyType.EC: + break; + case KeyType.DH: + GetDH().Print(bio); + break; + } + } + + #endregion + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/Crypto/DH.cs b/dep/openssl/src/ManagedOpenSsl/Crypto/DH.cs new file mode 100644 index 00000000..f7b6360f --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/Crypto/DH.cs @@ -0,0 +1,448 @@ +// Copyright (c) 2006-2007 Frank Laub +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using OpenSSL.Core; + +namespace OpenSSL.Crypto +{ + /// + /// Encapsulates the native openssl Diffie-Hellman functions (DH_*) + /// + public class DH : Base + { + /// + /// Constant generator value of 2. + /// + public const int Generator2 = 2; + + /// + /// Constant generator value of 5. + /// + public const int Generator5 = 5; + + private const int FlagCacheMont_P = 0x01; + private const int FlagNoExpConstTime = 0x02; + + /// + /// Flags for the return value of DH_check(). + /// + [Flags] + public enum CheckCode + { + /// + /// + /// + CheckP_NotPrime = 1, + + /// + /// + /// + CheckP_NotSafePrime = 2, + + /// + /// + /// + UnableToCheckGenerator = 4, + + /// + /// + /// + NotSuitableGenerator = 8, + } + + private BigNumber.GeneratorThunk thunk = null; + + #region dh_st + + [StructLayout(LayoutKind.Sequential)] + struct dh_st + { + public int pad; + public int version; + public IntPtr p; + public IntPtr g; + public int length; + public IntPtr pub_key; + public IntPtr priv_key; + + public int flags; + public IntPtr method_mont_p; + public IntPtr q; + public IntPtr j; + public IntPtr seed; + public int seedlen; + public IntPtr counter; + + public int references; + #region CRYPTO_EX_DATA ex_data; + public IntPtr ex_data_sk; + public int ex_data_dummy; + #endregion + public IntPtr meth; + public IntPtr engine; + } + #endregion + + #region Initialization + internal DH(IntPtr ptr, bool owner) : base(ptr, owner) { } + /// + /// Calls DH_generate_parameters() + /// + /// + /// + public DH(int primeLen, int generator) + : base(Native.ExpectNonNull(Native.DH_generate_parameters(primeLen, generator, IntPtr.Zero, IntPtr.Zero)), true) + { + } + + /// + /// Calls DH_generate_parameters_ex() + /// + /// + /// + /// + /// + public DH(int primeLen, int generator, BigNumber.GeneratorHandler callback, object arg) + : base(Native.ExpectNonNull(Native.DH_new()), true) + { + this.thunk = new BigNumber.GeneratorThunk(callback, arg); + Native.ExpectSuccess(Native.DH_generate_parameters_ex( + this.ptr, + primeLen, + generator, + this.thunk.CallbackStruct) + ); + } + + /// + /// Calls DH_new(). + /// + public DH() + : base(Native.ExpectNonNull(Native.DH_new()), true) + { + dh_st raw = this.Raw; + raw.p = Native.BN_dup(BigNumber.One.Handle); + raw.g = Native.BN_dup(BigNumber.One.Handle); + this.Raw = raw; + } + + /// + /// Calls DH_new(). + /// + /// + /// + public DH(BigNumber p, BigNumber g) + : base(Native.ExpectNonNull(Native.DH_new()), true) + { + dh_st raw = this.Raw; + raw.p = Native.BN_dup(p.Handle); + raw.g = Native.BN_dup(g.Handle); + this.Raw = raw; + } + + /// + /// Calls DH_new(). + /// + /// + /// + /// + /// + public DH(BigNumber p, BigNumber g, BigNumber pub_key, BigNumber priv_key) + : base(Native.ExpectNonNull(Native.DH_new()), true) + { + dh_st raw = this.Raw; + raw.p = Native.BN_dup(p.Handle); + raw.g = Native.BN_dup(g.Handle); + raw.pub_key = Native.BN_dup(pub_key.Handle); + raw.priv_key = Native.BN_dup(priv_key.Handle); + this.Raw = raw; + } + + /// + /// Factory method that calls FromParametersPEM() to deserialize + /// a DH object from a PEM-formatted string. + /// + /// + /// + public static DH FromParameters(string pem) + { + return FromParametersPEM(new BIO(pem)); + } + + /// + /// Factory method that calls PEM_read_bio_DHparams() to deserialize + /// a DH object from a PEM-formatted string using the BIO interface. + /// + /// + /// + public static DH FromParametersPEM(BIO bio) + { + IntPtr ptr = Native.ExpectNonNull(Native.PEM_read_bio_DHparams( + bio.Handle, IntPtr.Zero, null, IntPtr.Zero)); + return new DH(ptr, true); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate IntPtr DH_new_delegate(); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate IntPtr d2i_DHparams_delegate(out IntPtr a, IntPtr pp, int length); + + private static IntPtr Managed_DH_new() + { + return Native.DH_new(); + } + + private static IntPtr Managed_d2i_DHparams(out IntPtr a, IntPtr pp, int length) + { + return Native.d2i_DHparams(out a, pp, length); + } + /// + /// Factory method that calls XXX() to deserialize + /// a DH object from a DER-formatted buffer using the BIO interface. + /// + /// + /// + public static DH FromParametersDER(BIO bio) + { + DH_new_delegate dh_new = new DH_new_delegate(Managed_DH_new); + d2i_DHparams_delegate d2i_DHparams = new d2i_DHparams_delegate(Managed_d2i_DHparams); + IntPtr dh_new_ptr = Marshal.GetFunctionPointerForDelegate(dh_new); + IntPtr d2i_DHparams_ptr = Marshal.GetFunctionPointerForDelegate(d2i_DHparams); + IntPtr ptr = Native.ExpectNonNull(Native.ASN1_d2i_bio(dh_new_ptr, d2i_DHparams_ptr, bio.Handle, IntPtr.Zero)); + DH dh = new DH(ptr, true); + return dh; + } + #endregion + + #region Methods + /// + /// Calls DH_generate_key(). + /// + public void GenerateKeys() + { + Native.ExpectSuccess(Native.DH_generate_key(this.ptr)); + } + + /// + /// Calls DH_compute_key(). + /// + /// + /// + public byte[] ComputeKey(BigNumber pubkey) + { + int len = Native.DH_size(this.ptr); + byte[] key = new byte[len]; + Native.DH_compute_key(key, pubkey.Handle, this.ptr); + return key; + } + + /// + /// Calls PEM_write_bio_DHparams(). + /// + /// + public void WriteParametersPEM(BIO bio) + { + Native.ExpectSuccess(Native.PEM_write_bio_DHparams(bio.Handle, this.ptr)); + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate int i2d_DHparams_delegate(IntPtr a, IntPtr pp); + + private int Managed_i2d_DHparams(IntPtr a, IntPtr pp) + { + return Native.i2d_DHparams(a, pp); + } + + /// + /// Calls ASN1_i2d_bio() with the i2d = i2d_DHparams(). + /// + /// + public void WriteParametersDER(BIO bio) + { + i2d_DHparams_delegate i2d_DHparams = new i2d_DHparams_delegate(Managed_i2d_DHparams); + IntPtr i2d_DHparams_ptr = Marshal.GetFunctionPointerForDelegate(i2d_DHparams); + Native.ExpectSuccess(Native.ASN1_i2d_bio(i2d_DHparams_ptr, bio.Handle, this.ptr)); + //!! + /* + IntPtr hModule = Native.LoadLibrary(Native.DLLNAME); + IntPtr i2d = Native.GetProcAddress(hModule, "i2d_DHparams"); + Native.FreeLibrary(hModule); + + Native.ExpectSuccess(Native.ASN1_i2d_bio(i2d, bio.Handle, this.ptr)); + */ + } + + /// + /// Calls DHparams_print(). + /// + /// + public override void Print(BIO bio) + { + Native.ExpectSuccess(Native.DHparams_print(bio.Handle, this.ptr)); + } + + /// + /// Calls DH_check(). + /// + /// + public CheckCode Check() + { + int codes = 0; + Native.ExpectSuccess(Native.DH_check(this.ptr, out codes)); + return (CheckCode)codes; + } + #endregion + + #region Properties + private dh_st Raw + { + get { return (dh_st)Marshal.PtrToStructure(this.ptr, typeof(dh_st)); } + set { Marshal.StructureToPtr(value, this.ptr, false); } + } + + /// + /// Accessor for the p value. + /// + public BigNumber P + { + get { return new BigNumber(this.Raw.p, false); } + set + { + dh_st raw = this.Raw; + raw.p = Native.BN_dup(value.Handle); + this.Raw = raw; + } + } + + /// + /// Accessor for the g value. + /// + public BigNumber G + { + get { return new BigNumber(this.Raw.g, false); } + set + { + dh_st raw = this.Raw; + raw.g = Native.BN_dup(value.Handle); + this.Raw = raw; + } + } + + /// + /// Accessor for the pub_key value. + /// + public BigNumber PublicKey + { + get { return new BigNumber(this.Raw.pub_key, false); } + set + { + dh_st raw = this.Raw; + raw.pub_key = Native.BN_dup(value.Handle); + this.Raw = raw; + } + } + + /// + /// Accessor for the priv_key value. + /// + public BigNumber PrivateKey + { + get { return new BigNumber(this.Raw.priv_key, false); } + set + { + dh_st raw = this.Raw; + raw.priv_key = Native.BN_dup(value.Handle); + this.Raw = raw; + } + } + + /// + /// Creates a BIO.MemoryBuffer(), calls WriteParametersPEM() into this buffer, + /// then returns the buffer as a string. + /// + public string PEM + { + get + { + using (BIO bio = BIO.MemoryBuffer()) + { + this.WriteParametersPEM(bio); + return bio.ReadString(); + } + } + } + + /// + /// Creates a BIO.MemoryBuffer(), calls WriteParametersDER() into this buffer, + /// then returns the buffer. + /// + public byte[] DER + { + get + { + using (BIO bio = BIO.MemoryBuffer()) + { + this.WriteParametersDER(bio); + return bio.ReadBytes((int)bio.NumberWritten).Array; + } + } + } + + /// + /// Sets or clears the FlagNoExpConstTime bit in the flags field. + /// + public bool NoExpConstantTime + { + get { return (this.Raw.flags & FlagNoExpConstTime) != 0; } + set + { + dh_st raw = this.Raw; + if (value) + raw.flags |= FlagNoExpConstTime; + else + raw.flags &= ~FlagNoExpConstTime; + this.Raw = raw; + } + } + + #endregion + + #region IDisposable Members + + /// + /// Calls DH_free(). + /// + protected override void OnDispose() { + Native.DH_free(this.ptr); + } + + #endregion + } +} \ No newline at end of file diff --git a/dep/openssl/src/ManagedOpenSsl/Crypto/DSA.cs b/dep/openssl/src/ManagedOpenSsl/Crypto/DSA.cs new file mode 100644 index 00000000..c0a63060 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/Crypto/DSA.cs @@ -0,0 +1,461 @@ +// Copyright (c) 2006-2008 Frank Laub +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using OpenSSL.Core; + +namespace OpenSSL.Crypto +{ + /// + /// Wraps the DSA_* functions + /// + public class DSA : Base + { + #region dsa_st + + [StructLayout(LayoutKind.Sequential)] + struct dsa_st + { + public int pad; + public int version; + public int write_params; + public IntPtr p; + public IntPtr q; + public IntPtr g; + + public IntPtr pub_key; + public IntPtr priv_key; + + public IntPtr kinv; + public IntPtr r; + + public int flags; + public IntPtr method_mont_p; + public int references; + #region CRYPTO_EX_DATA ex_data; + public IntPtr ex_data_sk; + public int ex_data_dummy; + #endregion + public IntPtr meth; + public IntPtr engine; + } + #endregion + + private const int FlagCacheMont_P = 0x01; + private const int FlagNoExpConstTime = 0x02; + private int counter = 0; + private int h = 0; + private BigNumber.GeneratorThunk thunk = null; + + #region Initialization + + internal DSA(IntPtr ptr, bool owner) : base(ptr, owner) {} + + /// + /// Calls DSA_new() then DSA_generate_parameters_ex() + /// + public DSA(bool generateKeys) + : base(Native.ExpectNonNull(Native.DSA_new()), true) + { + Native.ExpectSuccess(Native.DSA_generate_parameters_ex( + this.ptr, + 512, + null, 0, + out this.counter, + out this.h, + null) + ); + if (generateKeys) + this.GenerateKeys(); + } + + /// + /// Calls DSA_new() then DSA_generate_parameters_ex() + /// + /// + /// + /// + public DSA(int bits, BigNumber.GeneratorHandler callback, object arg) + : base(Native.ExpectNonNull(Native.DSA_new()), true) + { + this.thunk = new BigNumber.GeneratorThunk(callback, arg); + Native.ExpectSuccess(Native.DSA_generate_parameters_ex( + this.ptr, + bits, + null, 0, + out this.counter, + out this.h, + this.thunk.CallbackStruct) + ); + } + + /// + /// Calls DSA_new() then DSA_generate_parameters_ex() + /// + /// + /// + /// + /// + /// + public DSA(int bits, byte[] seed, int counter, BigNumber.GeneratorHandler callback, object arg) + : base(Native.ExpectNonNull(Native.DSA_new()), true) + { + this.counter = counter; + this.thunk = new BigNumber.GeneratorThunk(callback, arg); + Native.ExpectSuccess(Native.DSA_generate_parameters_ex( + this.ptr, + bits, + seed, seed.Length, + out this.counter, + out this.h, + this.thunk.CallbackStruct) + ); + } + + /// + /// Returns PEM_read_bio_DSA_PUBKEY() + /// + /// + /// + public static DSA FromPublicKey(string pem) + { + return FromPublicKey(new BIO(pem)); + } + + /// + /// Returns PEM_read_bio_DSA_PUBKEY() + /// + /// + /// + public static DSA FromPublicKey(BIO bio) + { + return new DSA(Native.ExpectNonNull(Native.PEM_read_bio_DSA_PUBKEY(bio.Handle, IntPtr.Zero, null, IntPtr.Zero)), true); + } + + /// + /// Returns PEM_read_bio_DSAPrivateKey() + /// + /// + /// + public static DSA FromPrivateKey(string pem) + { + return FromPrivateKey(new BIO(pem)); + } + + /// + /// Returns PEM_read_bio_DSAPrivateKey() + /// + /// + /// + public static DSA FromPrivateKey(BIO bio) + { + return new DSA(Native.ExpectNonNull(Native.PEM_read_bio_DSAPrivateKey(bio.Handle, IntPtr.Zero, null, IntPtr.Zero)), true); + } + + #endregion + + #region Properites + private dsa_st Raw + { + get { return (dsa_st)Marshal.PtrToStructure(this.ptr, typeof(dsa_st)); } + set { Marshal.StructureToPtr(value, this.ptr, false); } + } + + /// + /// Returns the p field + /// + public BigNumber P + { + get { return new BigNumber(this.Raw.p, false); } + } + + /// + /// Returns the q field + /// + public BigNumber Q + { + get { return new BigNumber(this.Raw.q, false); } + } + + /// + /// Returns the g field + /// + public BigNumber G + { + get { return new BigNumber(this.Raw.g, false); } + } + + /// + /// Returns DSA_size() + /// + public int Size + { + get { return Native.ExpectSuccess(Native.DSA_size(this.ptr)); } + } + + /// + /// Returns the pub_key field + /// + public BigNumber PublicKey + { + get { return new BigNumber(this.Raw.pub_key, false); } + set + { + dsa_st raw = this.Raw; + raw.pub_key = Native.BN_dup(value.Handle); + this.Raw = raw; + } + } + + /// + /// Returns the priv_key field + /// + public BigNumber PrivateKey + { + get + { + IntPtr pKey = this.Raw.priv_key; + if (pKey == IntPtr.Zero) + return null; + return new BigNumber(pKey, false); + } + set + { + dsa_st raw = this.Raw; + raw.priv_key = Native.BN_dup(value.Handle); + this.Raw = raw; + } + } + + /// + /// Returns the pub_key field as a PEM string + /// + public string PublicKeyAsPEM + { + get + { + using (BIO bio = BIO.MemoryBuffer()) + { + this.WritePublicKey(bio); + return bio.ReadString(); + } + } + } + + /// + /// Returns the priv_key field as a PEM string + /// + public string PrivateKeyAsPEM + { + get + { + using (BIO bio = BIO.MemoryBuffer()) + { + this.WritePrivateKey(bio, null, null, null); + return bio.ReadString(); + } + } + } + + /// + /// Returns the counter + /// + public int Counter + { + get { return this.counter; } + } + + /// + /// Returns the h value + /// + public int H + { + get { return this.h; } + } + + /// + /// Accessor for the FlagNoExpConstTime flag + /// + public bool ConstantTime + { + get { return (this.Raw.flags & FlagNoExpConstTime) != 0; } + set + { + dsa_st raw = this.Raw; + if (value) + raw.flags |= FlagNoExpConstTime; + else + raw.flags &= ~FlagNoExpConstTime; + this.Raw = raw; + } + } + #endregion + + #region Methods + /// + /// Calls DSA_generate_key() + /// + public void GenerateKeys() + { + Native.ExpectSuccess(Native.DSA_generate_key(this.ptr)); + } + + /// + /// Returns DSA_sign() + /// + /// + /// + public byte[] Sign(byte[] msg) + { + byte[] sig = new byte[this.Size]; + uint siglen; + Native.ExpectSuccess(Native.DSA_sign(0, msg, msg.Length, sig, out siglen, this.ptr)); + if (sig.Length != siglen) + { + byte[] ret = new byte[siglen]; + Buffer.BlockCopy(sig, 0, ret, 0, (int)siglen); + return ret; + } + return sig; + } + + /// + /// Returns DSA_verify() + /// + /// + /// + /// + public bool Verify(byte[] msg, byte[] sig) + { + return Native.ExpectSuccess( + Native.DSA_verify(0, msg, msg.Length, sig, sig.Length, this.ptr) + ) == 1; + } + + /// + /// Calls PEM_write_bio_DSA_PUBKEY() + /// + /// + public void WritePublicKey(BIO bio) + { + Native.ExpectSuccess(Native.PEM_write_bio_DSA_PUBKEY(bio.Handle, this.ptr)); + } + + /// + /// Calls PEM_write_bio_DSAPrivateKey() + /// + /// + /// + /// + /// + public void WritePrivateKey(BIO bio, Cipher enc, PasswordHandler passwd, object arg) + { + PasswordThunk thunk = new PasswordThunk(passwd, arg); + Native.ExpectSuccess(Native.PEM_write_bio_DSAPrivateKey( + bio.Handle, + this.ptr, + enc == null ? IntPtr.Zero : enc.Handle, + null, + 0, + thunk.Callback, + IntPtr.Zero)); + } + + #endregion + + #region Overrides + + /// + /// Calls DSA_print() + /// + /// + public override void Print(BIO bio) + { + Native.ExpectSuccess(Native.DSA_print(bio.Handle, this.ptr, 0)); + } + + /// + /// Calls DSA_free() + /// + protected override void OnDispose() + { + Native.DSA_free(this.ptr); + } + + /// + /// If both objects have a private key, those are compared. + /// Otherwise just the params and public keys are compared. + /// + /// + /// + public override bool Equals(object obj) + { + DSA rhs = obj as DSA; + if (rhs == null) + return false; + + bool paramsEqual = ( + this.P == rhs.P && + this.Q == rhs.Q && + this.G == rhs.G + ); + + if (!paramsEqual) + return false; + + if (this.PublicKey != rhs.PublicKey) + return false; + + BigNumber lhsPrivateKey = this.PrivateKey; + BigNumber rhsPrivateKey = rhs.PrivateKey; + + if (lhsPrivateKey == null || rhsPrivateKey == null) + return true; + + return lhsPrivateKey == rhsPrivateKey; + } + + /// + /// Xor of the params, public key, and optionally the private key + /// + /// + public override int GetHashCode() + { + int code = + this.P.GetHashCode() ^ + this.Q.GetHashCode() ^ + this.G.GetHashCode() ^ + this.PublicKey.GetHashCode(); + if (this.PrivateKey != null) + code ^= this.PrivateKey.GetHashCode(); + return code; + } + + #endregion + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/Crypto/HMAC.cs b/dep/openssl/src/ManagedOpenSsl/Crypto/HMAC.cs new file mode 100644 index 00000000..a8e1b429 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/Crypto/HMAC.cs @@ -0,0 +1,164 @@ +// Copyright (c) 2009 Ben Henderson +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using OpenSSL.Core; + +namespace OpenSSL.Crypto +{ + /// + /// Wraps HMAC + /// + public class HMAC : Base + { + #region Raw Structures + [StructLayout(LayoutKind.Sequential)] + struct HMAC_CTX + { + IntPtr md; //const EVP_MD *md; + EVP_MD_CTX md_ctx; + EVP_MD_CTX i_ctx; + EVP_MD_CTX o_ctx; + uint key_length; //unsigned int key_length; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Native.HMAC_MAX_MD_CBLOCK)] + byte[] key; + } + #endregion + + #region Initialization + /// + /// Calls OPENSSL_malloc() and then HMAC_CTX_init() + /// + public HMAC() + : base(IntPtr.Zero, true) { + // Allocate the context + this.ptr = Native.OPENSSL_malloc(Marshal.SizeOf(typeof(HMAC_CTX))); + // Initialize the context + Native.HMAC_CTX_init(this.ptr); + } + #endregion + + #region Methods + + /// + /// Calls HMAC() + /// + /// + /// + /// + /// + public static byte[] Digest(MessageDigest digest, byte[] key, byte[] data) { + byte[] hash_value = new byte[digest.Size]; + uint hash_value_length = Native.EVP_MAX_MD_SIZE; + Native.HMAC(digest.Handle, key, key.Length, data, data.Length, hash_value, ref hash_value_length); + return hash_value; + } + + /// + /// Calls HMAC_Init_ex() + /// + /// + /// + public void Init(byte[] key, MessageDigest digest) { + Native.HMAC_Init_ex(this.ptr, key, key.Length, digest.Handle, IntPtr.Zero); + this.digest_size = digest.Size; + this.initialized = true; + } + + /// + /// Calls HMAC_Update() + /// + /// + public void Update(byte[] data) { + if (!initialized) { + throw new Exception("Failed to call Initialize before calling Update"); + } + Native.HMAC_Update(this.ptr, data, data.Length); + } + + /// + /// Calls HMAC_Update() + /// + /// + /// + /// + public void Update(byte[] data, int offset, int count) { + if (!initialized) { + throw new Exception("Failed to call Initialize before calling Update"); + } + if (data == null) { + throw new ArgumentNullException("data"); + } + if (count <= 0) { + throw new ArgumentException("count must be greater than 0"); + } + if (offset < 0) { + throw new ArgumentException("offset must be 0 or greater"); + } + if (data.Length < (count - offset)) { + throw new ArgumentException("invalid length specified. Count is greater than buffer length."); + } + ArraySegment seg = new ArraySegment(data, offset, count); + Native.HMAC_Update(this.ptr, seg.Array, seg.Count); + } + + /// + /// Calls HMAC_Final() + /// + /// + public byte[] DigestFinal() { + if (!initialized) { + throw new Exception("Failed to call Initialize before calling DigestFinal"); + } + byte[] hash_value = new byte[digest_size]; + uint hash_value_length = Native.EVP_MAX_MD_SIZE; + + Native.HMAC_Final(this.ptr, hash_value, ref hash_value_length); + return hash_value; + } + + #endregion + + #region Overrides + /// + /// Calls HMAC_CTX_cleanup() and then OPENSSL_free() + /// + protected override void OnDispose() { + // Clean up the context + Native.HMAC_CTX_cleanup(this.ptr); + // Free the structure allocation + Native.OPENSSL_free(this.ptr); + } + #endregion + + #region Fields + private bool initialized = false; + private int digest_size = 0; + #endregion + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/Crypto/MessageDigest.cs b/dep/openssl/src/ManagedOpenSsl/Crypto/MessageDigest.cs new file mode 100644 index 00000000..e9dddf26 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/Crypto/MessageDigest.cs @@ -0,0 +1,441 @@ +// Copyright (c) 2006-2011 Frank Laub +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using OpenSSL.Core; + +namespace OpenSSL.Crypto +{ + #region MessageDigest + /// + /// Wraps the EVP_MD object + /// + public class MessageDigest : Base + { + private EVP_MD raw; + /// + /// Creates a EVP_MD struct + /// + /// + /// + internal MessageDigest(IntPtr ptr, bool owner) : base(ptr, owner) + { + this.raw = (EVP_MD)Marshal.PtrToStructure(this.ptr, typeof(EVP_MD)); + } + + /// + /// Prints MessageDigest + /// + /// + public override void Print(BIO bio) + { + bio.Write("MessageDigest"); + } + + /// + /// Not implemented, these objects should never be disposed. + /// + protected override void OnDispose() { + throw new NotImplementedException(); + } + + /// + /// Calls EVP_get_digestbyname() + /// + /// + /// + public static MessageDigest CreateByName(string name) { + byte[] buf = Encoding.ASCII.GetBytes(name); + IntPtr ptr = Native.EVP_get_digestbyname(buf); + if (ptr == IntPtr.Zero) + return null; + return new MessageDigest(ptr, false); + } + + /// + /// Calls OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH) + /// + public static string[] AllNamesSorted + { + get { return new NameCollector(Native.OBJ_NAME_TYPE_MD_METH, true).Result.ToArray(); } + } + + /// + /// Calls OBJ_NAME_do_all(OBJ_NAME_TYPE_CIPHER_METH) + /// + public static string[] AllNames + { + get { return new NameCollector(Native.OBJ_NAME_TYPE_MD_METH, false).Result.ToArray(); } + } + + #region EVP_MD + [StructLayout(LayoutKind.Sequential)] + struct EVP_MD + { + public int type; + public int pkey_type; + public int md_size; + public uint flags; + public IntPtr init; + public IntPtr update; + public IntPtr final; + public IntPtr copy; + public IntPtr cleanup; + public IntPtr sign; + public IntPtr verify; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] + public int[] required_pkey_type; + public int block_size; + public int ctx_size; + } + #endregion + + #region MessageDigests + /// + /// EVP_md_null() + /// + public static MessageDigest Null = new MessageDigest(Native.EVP_md_null(), false); + + /// + /// EVP_md4() + /// + public static MessageDigest MD4 = new MessageDigest(Native.EVP_md4(), false); + + /// + /// EVP_md5() + /// + public static MessageDigest MD5 = new MessageDigest(Native.EVP_md5(), false); + + /// + /// EVP_sha() + /// + public static MessageDigest SHA = new MessageDigest(Native.EVP_sha(), false); + + /// + /// EVP_sha1() + /// + public static MessageDigest SHA1 = new MessageDigest(Native.EVP_sha1(), false); + + /// + /// EVP_sha224() + /// + public static MessageDigest SHA224 = new MessageDigest(Native.EVP_sha224(), false); + + /// + /// EVP_sha256() + /// + public static MessageDigest SHA256 = new MessageDigest(Native.EVP_sha256(), false); + + /// + /// EVP_sha384() + /// + public static MessageDigest SHA384 = new MessageDigest(Native.EVP_sha384(), false); + + /// + /// EVP_sha512() + /// + public static MessageDigest SHA512 = new MessageDigest(Native.EVP_sha512(), false); + + /// + /// EVP_dss() + /// + public static MessageDigest DSS = new MessageDigest(Native.EVP_dss(), false); + + /// + /// EVP_dss1() + /// + public static MessageDigest DSS1 = new MessageDigest(Native.EVP_dss1(), false); + + /// + /// EVP_ripemd160() + /// + public static MessageDigest RipeMD160 = new MessageDigest(Native.EVP_ripemd160(), false); + #endregion + + #region Properties + /// + /// Returns the block_size field + /// + public int BlockSize + { + get { return this.raw.block_size; } + } + + /// + /// Returns the md_size field + /// + public int Size + { + get { return this.raw.md_size; } + } + + /// + /// Returns the type field using OBJ_nid2ln() + /// + public string LongName + { + get { return Native.PtrToStringAnsi(Native.OBJ_nid2ln(this.raw.type), false); } + } + + /// + /// Returns the type field using OBJ_nid2sn() + /// + public string Name + { + get { return Native.PtrToStringAnsi(Native.OBJ_nid2sn(this.raw.type), false); } + } + + #endregion + } + #endregion + + #region EVP_MD_CTX + [StructLayout(LayoutKind.Sequential)] + struct EVP_MD_CTX + { + public IntPtr digest; + public IntPtr engine; + public uint flags; + public IntPtr md_data; + public IntPtr pctx; + public IntPtr update; + } + #endregion + + /// + /// Wraps the EVP_MD_CTX object + /// + public class MessageDigestContext : Base + { + private MessageDigest md; + + /// + /// Calls BIO_get_md_ctx() then BIO_get_md() + /// + /// + public MessageDigestContext(BIO bio) + : base(Native.ExpectNonNull(Native.BIO_get_md_ctx(bio.Handle)), false) + { + this.md = new MessageDigest(Native.ExpectNonNull(Native.BIO_get_md(bio.Handle)), false); + } + + /// + /// Calls EVP_MD_CTX_create() then EVP_MD_CTX_init() + /// + /// + public MessageDigestContext(MessageDigest md) + : base(Native.EVP_MD_CTX_create(), true) + { + Native.EVP_MD_CTX_init(this.ptr); + this.md = md; + } + + /// + /// Prints the long name + /// + /// + public override void Print(BIO bio) + { + bio.Write("MessageDigestContext: " + this.md.LongName); + } + + #region Methods + + /// + /// Calls EVP_DigestInit_ex(), EVP_DigestUpdate(), and EVP_DigestFinal_ex() + /// + /// + /// + public byte[] Digest(byte[] msg) + { + byte[] digest = new byte[this.md.Size]; + uint len = (uint)digest.Length; + Native.ExpectSuccess(Native.EVP_DigestInit_ex(this.ptr, this.md.Handle, IntPtr.Zero)); + Native.ExpectSuccess(Native.EVP_DigestUpdate(this.ptr, msg, (uint)msg.Length)); + Native.ExpectSuccess(Native.EVP_DigestFinal_ex(this.ptr, digest, ref len)); + return digest; + } + + /// + /// Calls EVP_DigestInit_ex() + /// + public void Init() + { + Native.ExpectSuccess(Native.EVP_DigestInit_ex(this.ptr, this.md.Handle, IntPtr.Zero)); + } + + /// + /// Calls EVP_DigestUpdate() + /// + /// + public void Update(byte[] msg) + { + Native.ExpectSuccess(Native.EVP_DigestUpdate(this.ptr, msg, (uint)msg.Length)); + } + + /// + /// Calls EVP_DigestFinal_ex() + /// + /// + public byte[] DigestFinal() + { + byte[] digest = new byte[this.md.Size]; + uint len = (uint)digest.Length; + Native.ExpectSuccess(Native.EVP_DigestFinal_ex(this.ptr, digest, ref len)); + return digest; + } + + /// + /// Calls EVP_SignFinal() + /// + /// + /// + public byte[] SignFinal(CryptoKey pkey) + { + byte[] digest = new byte[this.md.Size]; + byte[] sig = new byte[pkey.Size]; + uint len = (uint)sig.Length; + Native.ExpectSuccess(Native.EVP_SignFinal(this.ptr, sig, ref len, pkey.Handle)); + return sig; + } + + /// + /// Calls EVP_VerifyFinal() + /// + /// + /// + /// + public bool VerifyFinal(byte[] sig, CryptoKey pkey) + { + int ret = Native.ExpectSuccess(Native.EVP_VerifyFinal(this.ptr, sig, (uint)sig.Length, pkey.Handle)); + return ret == 1; + } + + /// + /// Calls EVP_DigestInit_ex(), EVP_DigestUpdate(), and EVP_SignFinal() + /// + /// + /// + /// + public byte[] Sign(byte[] msg, CryptoKey pkey) + { + byte[] sig = new byte[pkey.Size]; + uint len = (uint)sig.Length; + Native.ExpectSuccess(Native.EVP_DigestInit_ex(this.ptr, this.md.Handle, IntPtr.Zero)); + Native.ExpectSuccess(Native.EVP_DigestUpdate(this.ptr, msg, (uint)msg.Length)); + Native.ExpectSuccess(Native.EVP_SignFinal(this.ptr, sig, ref len, pkey.Handle)); + byte[] ret = new byte[len]; + Buffer.BlockCopy(sig, 0, ret, 0, (int)len); + return ret; + } + + /// + /// Calls EVP_SignFinal() + /// + /// + /// + /// + /// + public static byte[] Sign(MessageDigest md, BIO bio, CryptoKey pkey) + { + BIO bmd = BIO.MessageDigest(md); + bmd.Push(bio); + + while (true) + { + ArraySegment bytes = bmd.ReadBytes(1024 * 4); + if (bytes.Count == 0) + break; + } + + MessageDigestContext ctx = new MessageDigestContext(bmd); + + byte[] sig = new byte[pkey.Size]; + uint len = (uint)sig.Length; + Native.ExpectSuccess(Native.EVP_SignFinal(ctx.Handle, sig, ref len, pkey.Handle)); + byte[] ret = new byte[len]; + Buffer.BlockCopy(sig, 0, ret, 0, (int)len); + return ret; + } + + /// + /// Calls EVP_DigestInit_ex(), EVP_DigestUpdate(), and EVP_VerifyFinal() + /// + /// + /// + /// + /// + public bool Verify(byte[] msg, byte[] sig, CryptoKey pkey) + { + Native.ExpectSuccess(Native.EVP_DigestInit_ex(this.ptr, this.md.Handle, IntPtr.Zero)); + Native.ExpectSuccess(Native.EVP_DigestUpdate(this.ptr, msg, (uint)msg.Length)); + int ret = Native.ExpectSuccess(Native.EVP_VerifyFinal(this.ptr, sig, (uint)sig.Length, pkey.Handle)); + return ret == 1; + } + + /// + /// Calls EVP_VerifyFinal() + /// + /// + /// + /// + /// + /// + public static bool Verify(MessageDigest md, BIO bio, byte[] sig, CryptoKey pkey) + { + BIO bmd = BIO.MessageDigest(md); + bmd.Push(bio); + + while (true) + { + ArraySegment bytes = bmd.ReadBytes(1024 * 4); + if (bytes.Count == 0) + break; + } + + MessageDigestContext ctx = new MessageDigestContext(bmd); + + int ret = Native.ExpectSuccess(Native.EVP_VerifyFinal(ctx.Handle, sig, (uint)sig.Length, pkey.Handle)); + return ret == 1; + } + + #endregion + + #region IDisposable Members + + /// + /// Calls EVP_MD_CTX_cleanup() and EVP_MD_CTX_destroy() + /// + protected override void OnDispose() { + Native.EVP_MD_CTX_cleanup(this.ptr); + Native.EVP_MD_CTX_destroy(this.ptr); + } + + #endregion + } +} \ No newline at end of file diff --git a/dep/openssl/src/ManagedOpenSsl/Crypto/RSA.cs b/dep/openssl/src/ManagedOpenSsl/Crypto/RSA.cs new file mode 100644 index 00000000..0ea0b955 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/Crypto/RSA.cs @@ -0,0 +1,499 @@ +// Copyright (c) 2006-2007 Frank Laub +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using OpenSSL.Core; + +namespace OpenSSL.Crypto +{ + /// + /// Wraps the RSA_* functions + /// + public class RSA : Base, IDisposable + { + #region rsa_st + [StructLayout(LayoutKind.Sequential)] + struct rsa_st + { + public int pad; + public int version; + public IntPtr meth; + + public IntPtr engine; + public IntPtr n; + public IntPtr e; + public IntPtr d; + public IntPtr p; + public IntPtr q; + public IntPtr dmp1; + public IntPtr dmq1; + public IntPtr iqmp; + + #region CRYPTO_EX_DATA ex_data; + public IntPtr ex_data_sk; + public int ex_data_dummy; + #endregion + public int references; + public int flags; + + public IntPtr _method_mod_n; + public IntPtr _method_mod_p; + public IntPtr _method_mod_q; + + public IntPtr bignum_data; + public IntPtr blinding; + public IntPtr mt_blinding; + } + #endregion + + #region Enums + /// + /// RSA padding scheme + /// + public enum Padding + { + /// + /// RSA_PKCS1_PADDING + /// + PKCS1 = 1, + /// + /// RSA_SSLV23_PADDING + /// + SSLv23 = 2, + /// + /// RSA_NO_PADDING + /// + None = 3, + /// + /// RSA_PKCS1_OAEP_PADDING + /// Optimal Asymmetric Encryption Padding + /// + OAEP = 4, + /// + /// RSA_X931_PADDING + /// + X931 = 5, + } + #endregion + + #region Constants + private const int FlagCacheMont_P = 0x01; + private const int FlagNoExpConstTime = 0x02; + private const int FlagNoConstTime = 0x100; + #endregion + + #region Initialization + internal RSA(IntPtr ptr, bool owner) + : base(ptr, owner) + { } + + /// + /// Calls RSA_new() + /// + public RSA() + : base(Native.ExpectNonNull(Native.RSA_new()), true) + { } + + /// + /// Calls PEM_read_bio_RSA_PUBKEY() + /// + /// + /// + public static RSA FromPublicKey(BIO bio) + { + return FromPublicKey(bio, null, null); + } + + /// + /// Calls PEM_read_bio_RSAPrivateKey() + /// + /// + /// + public static RSA FromPrivateKey(BIO bio) + { + return FromPrivateKey(bio, null, null); + } + + /// + /// Calls PEM_read_bio_RSA_PUBKEY() + /// + /// + /// + /// + /// + public static RSA FromPublicKey(BIO bio, PasswordHandler callback, object arg) + { + PasswordThunk thunk = new PasswordThunk(callback, arg); + IntPtr ptr = Native.PEM_read_bio_RSA_PUBKEY(bio.Handle, IntPtr.Zero, thunk.Callback, IntPtr.Zero); + return new RSA(Native.ExpectNonNull(ptr), true); + } + + /// + /// Calls PEM_read_bio_RSAPrivateKey() + /// + /// + /// + /// + /// + public static RSA FromPrivateKey(BIO bio, PasswordHandler callback, object arg) + { + PasswordThunk thunk = new PasswordThunk(callback, arg); + IntPtr ptr = Native.PEM_read_bio_RSAPrivateKey(bio.Handle, IntPtr.Zero, thunk.Callback, IntPtr.Zero); + return new RSA(Native.ExpectNonNull(ptr), true); + } + + #endregion + + #region Properties + private rsa_st Raw + { + get { return (rsa_st)Marshal.PtrToStructure(this.ptr, typeof(rsa_st)); } + set { Marshal.StructureToPtr(value, this.ptr, false); } + } + + /// + /// Returns RSA_size() + /// + public int Size + { + get { return Native.ExpectSuccess(Native.RSA_size(this.ptr)); } + } + + /// + /// Not finished + /// + public bool ConstantTime + { + get { return false; } + set + { + } + } + + /// + /// Accessor for the e field + /// + public BigNumber PublicExponent + { + get { return new BigNumber(this.Raw.e, false); } + set + { + rsa_st raw = this.Raw; + raw.e = Native.BN_dup(value.Handle); + this.Raw = raw; + } + } + + /// + /// Accessor for the n field + /// + public BigNumber PublicModulus + { + get { return new BigNumber(this.Raw.n, false); } + set + { + rsa_st raw = this.Raw; + raw.n = Native.BN_dup(value.Handle); + this.Raw = raw; + } + } + + /// + /// Accessor for the d field + /// + public BigNumber PrivateExponent + { + get { return new BigNumber(this.Raw.d, false); } + set + { + rsa_st raw = this.Raw; + raw.d = Native.BN_dup(value.Handle); + this.Raw = raw; + } + } + + /// + /// Accessor for the p field + /// + public BigNumber SecretPrimeFactorP + { + get { return new BigNumber(this.Raw.p, false); } + set + { + rsa_st raw = this.Raw; + raw.p = Native.BN_dup(value.Handle); + this.Raw = raw; + } + } + + /// + /// Accessor for the q field + /// + public BigNumber SecretPrimeFactorQ + { + get { return new BigNumber(this.Raw.q, false); } + set + { + rsa_st raw = this.Raw; + raw.q = Native.BN_dup(value.Handle); + this.Raw = raw; + } + } + + /// + /// Accessor for the dmp1 field. + /// d mod (p-1) + /// + public BigNumber DmodP1 + { + get { return new BigNumber(this.Raw.dmp1, false); } + set + { + rsa_st raw = this.Raw; + raw.dmp1 = Native.BN_dup(value.Handle); + this.Raw = raw; + } + } + + /// + /// Accessor for the dmq1 field. + /// d mod (q-1) + /// + public BigNumber DmodQ1 + { + get { return new BigNumber(this.Raw.dmq1, false); } + set + { + rsa_st raw = this.Raw; + raw.dmq1 = Native.BN_dup(value.Handle); + this.Raw = raw; + } + } + + /// + /// Accessor for the iqmp field. + /// q^-1 mod p + /// + public BigNumber IQmodP + { + get { return new BigNumber(this.Raw.iqmp, false); } + set + { + rsa_st raw = this.Raw; + raw.iqmp = Native.BN_dup(value.Handle); + this.Raw = raw; + } + } + + /// + /// Returns the public key field as a PEM string + /// + public string PublicKeyAsPEM + { + get + { + using (BIO bio = BIO.MemoryBuffer()) + { + this.WritePublicKey(bio); + return bio.ReadString(); + } + } + } + + /// + /// Returns the private key field as a PEM string + /// + public string PrivateKeyAsPEM + { + get + { + using (BIO bio = BIO.MemoryBuffer()) + { + this.WritePrivateKey(bio, null, null, null); + return bio.ReadString(); + } + } + } + #endregion + + #region Methods + /// + /// Calls RSA_generate_key_ex() + /// + /// + /// + /// + /// + public void GenerateKeys(int bits, BigNumber e, BigNumber.GeneratorHandler callback, object arg) + { + this.thunk = new BigNumber.GeneratorThunk(callback, arg); + Native.ExpectSuccess(Native.RSA_generate_key_ex(this.ptr, bits, e.Handle, this.thunk.CallbackStruct)); + } + + /// + /// Calls RSA_public_encrypt() + /// + /// + /// + /// + public byte[] PublicEncrypt(byte[] msg, Padding padding) + { + byte[] ret = new byte[this.Size]; + int len = Native.ExpectSuccess(Native.RSA_public_encrypt(msg.Length, msg, ret, this.ptr, (int)padding)); + if (len != ret.Length) + { + byte[] tmp = new byte[len]; + Buffer.BlockCopy(ret, 0, tmp, 0, len); + return tmp; + } + return ret; + } + + /// + /// Calls RSA_private_encrypt() + /// + /// + /// + /// + public byte[] PrivateEncrypt(byte[] msg, Padding padding) + { + byte[] ret = new byte[this.Size]; + int len = Native.ExpectSuccess(Native.RSA_private_encrypt(msg.Length, msg, ret, this.ptr, (int)padding)); + if (len != ret.Length) + { + byte[] tmp = new byte[len]; + Buffer.BlockCopy(ret, 0, tmp, 0, len); + return tmp; + } + return ret; + } + + /// + /// Calls RSA_public_decrypt() + /// + /// + /// + /// + public byte[] PublicDecrypt(byte[] msg, Padding padding) + { + byte[] ret = new byte[this.Size]; + int len = Native.ExpectSuccess(Native.RSA_public_decrypt(msg.Length, msg, ret, this.ptr, (int)padding)); + if (len != ret.Length) + { + byte[] tmp = new byte[len]; + Buffer.BlockCopy(ret, 0, tmp, 0, len); + return tmp; + } + return ret; + } + + /// + /// Calls RSA_private_decrypt() + /// + /// + /// + /// + public byte[] PrivateDecrypt(byte[] msg, Padding padding) + { + byte[] ret = new byte[this.Size]; + int len = Native.ExpectSuccess(Native.RSA_private_decrypt(msg.Length, msg, ret, this.ptr, (int)padding)); + if (len != ret.Length) + { + byte[] tmp = new byte[len]; + Buffer.BlockCopy(ret, 0, tmp, 0, len); + return tmp; + } + return ret; + } + + /// + /// Calls PEM_write_bio_RSA_PUBKEY() + /// + /// + public void WritePublicKey(BIO bio) + { + Native.ExpectSuccess(Native.PEM_write_bio_RSA_PUBKEY(bio.Handle, this.ptr)); + } + + /// + /// Calls PEM_write_bio_RSAPrivateKey() + /// + /// + /// + /// + /// + public void WritePrivateKey(BIO bio, Cipher enc, PasswordHandler passwd, object arg) + { + PasswordThunk thunk = new PasswordThunk(passwd, arg); + Native.ExpectSuccess(Native.PEM_write_bio_RSAPrivateKey( + bio.Handle, + this.ptr, + enc == null ? IntPtr.Zero : enc.Handle, + null, + 0, + thunk.Callback, + IntPtr.Zero)); + } + + /// + /// Returns RSA_check_key() + /// + /// + public bool Check() + { + int ret = Native.ExpectSuccess(Native.RSA_check_key(this.ptr)); + return ret == 1; + } + + /// + /// Calls RSA_print() + /// + /// + public override void Print(BIO bio) + { + Native.ExpectSuccess(Native.RSA_print(bio.Handle, this.ptr, 0)); + } + + #endregion + + #region IDisposable Members + + /// + /// Calls RSA_free() + /// + protected override void OnDispose() { + Native.RSA_free(this.ptr); + } + + #endregion + + #region Fields + private BigNumber.GeneratorThunk thunk = null; + #endregion + } +} \ No newline at end of file diff --git a/dep/openssl/src/ManagedOpenSsl/Enums.cs b/dep/openssl/src/ManagedOpenSsl/Enums.cs new file mode 100644 index 00000000..579602ef --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/Enums.cs @@ -0,0 +1,250 @@ +// Copyright (c) 2009 Ben Henderson +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenSSL +{ + /// + /// + /// + public enum CipherAlgorithmType + { + None, + Rc2, + Rc4, + Des, + Idea, + Fortezza, + Camellia128, + Camellia256, + Seed, + TripleDes, + Aes, + Aes128, + Aes192, + Aes256, + eGOST2814789CNT, + Aes128GCM, + Aes256GCM + } + + /// + /// + /// + public enum HashAlgorithmType + { + None, + Md5, + Sha1, + Gost94, + Gost89MAC, + Sha256, + Sha384 + } + + /// + /// + /// + public enum ExchangeAlgorithmType + { + None, + RsaSign, + RsaKeyX, + DiffieHellman, + Kerberos, + Fortezza, + ECDiffieHellman, + PSK, + GOST, + SRP + } + + /// + /// + /// + public enum SslProtocols + { + /// + /// + /// + None = 0, + /// + /// + /// + Ssl2 = 1, + /// + /// + /// + Ssl3 = 2, + /// + /// + /// + Tls = 4, + /// + /// + /// + Default = 16 + } + + /// + /// + /// + public enum SslStrength + { + /// + /// + /// + High = 4, //256 + /// + /// + /// + Medium = 2, //128 + /// + /// + /// + Low = 1, //40 + /// + /// + /// + All = High | Medium | Low + } + + enum SslFileType + { + /// + /// SSL_FILETYPE_PEM + /// + PEM = 1, + /// + /// SSL_FILETYPE_ASN1 + /// + ASN1 = 2 + } + + enum AuthenticationMethod + { + None, + Rsa, + Dss, + DiffieHellman, + Kerberos, + ECDsa, + PSK, + GOST + } + + enum HandshakeState + { + None, + Renegotiate, + InProcess, + RenegotiateInProcess, + Complete + } + + + /// + /// Options enumeration for Options property + /// + enum SslOptions + { + SSL_OP_MICROSOFT_SESS_ID_BUG = 0x00000001, + SSL_OP_NETSCAPE_CHALLENGE_BUG = 0x00000002, + SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG = 0x00000008, + SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG = 0x00000010, + SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER = 0x00000020, + SSL_OP_MSIE_SSLV2_RSA_PADDING = 0x00000040, /* no effect since 0.9.7h and 0.9.8b */ + SSL_OP_SSLEAY_080_CLIENT_DH_BUG = 0x00000080, + SSL_OP_TLS_D5_BUG = 0x00000100, + SSL_OP_TLS_BLOCK_PADDING_BUG = 0x00000200, + + /* Disable SSL 3.0/TLS 1.0 CBC vulnerability workaround that was added + * in OpenSSL 0.9.6d. Usually (depending on the application protocol) + * the workaround is not needed. Unfortunately some broken SSL/TLS + * implementations cannot handle it at all, which is why we include + * it in SSL_OP_ALL. */ + SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS = 0x00000800, /* added in 0.9.6e */ + + /* SSL_OP_ALL: various bug workarounds that should be rather harmless. + * This used to be 0x000FFFFFL before 0.9.7. */ + SSL_OP_ALL = (0x00000FFF ^ SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG), + + /* As server, disallow session resumption on renegotiation */ + SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION = 0x00010000, + /* If set, always create a new key when using tmp_dh parameters */ + SSL_OP_SINGLE_DH_USE = 0x00100000, + /* Set to always use the tmp_rsa key when doing RSA operations, + * even when this violates protocol specs */ + SSL_OP_EPHEMERAL_RSA = 0x00200000, + /* Set on servers to choose the cipher according to the server's + * preferences */ + SSL_OP_CIPHER_SERVER_PREFERENCE = 0x00400000, + /* If set, a server will allow a client to issue a SSLv3.0 version number + * as latest version supported in the premaster secret, even when TLSv1.0 + * (version 3.1) was announced in the client hello. Normally this is + * forbidden to prevent version rollback attacks. */ + SSL_OP_TLS_ROLLBACK_BUG = 0x00800000, + + SSL_OP_NO_SSLv2 = 0x01000000, + SSL_OP_NO_SSLv3 = 0x02000000, + SSL_OP_NO_TLSv1 = 0x04000000, + + /* The next flag deliberately changes the ciphertest, this is a check + * for the PKCS#1 attack */ + SSL_OP_PKCS1_CHECK_1 = 0x08000000, + SSL_OP_PKCS1_CHECK_2 = 0x10000000, + SSL_OP_NETSCAPE_CA_DN_BUG = 0x20000000, + SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG = 0x40000000, + } + + enum SslMode + { + /* Allow SSL_write(..., n) to return r with 0 < r < n (i.e. report success + * when just a single record has been written): */ + SSL_MODE_ENABLE_PARTIAL_WRITE = 0x00000001, + /* Make it possible to retry SSL_write() with changed buffer location + * (buffer contents must stay the same!); this is not the default to avoid + * the misconception that non-blocking SSL_write() behaves like + * non-blocking write(): */ + SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER = 0x00000002, + /* Never bother the application with retries if the transport + * is blocking: */ + SSL_MODE_AUTO_RETRY = 0x00000004, + /* Don't attempt to automatically build certificate chain */ + SSL_MODE_NO_AUTO_CHAIN = 0x00000008 + } + + enum VerifyMode + { + SSL_VERIFY_NONE = 0x00, + SSL_VERIFY_PEER = 0x01, + SSL_VERIFY_FAIL_IF_NO_PEER_CERT = 0x02, + SSL_VERIFY_CLIENT_ONCE = 0x04, + } + +} diff --git a/dep/openssl/src/ManagedOpenSsl/ManagedOpenSsl-2010.csproj b/dep/openssl/src/ManagedOpenSsl/ManagedOpenSsl-2010.csproj new file mode 100644 index 00000000..3f4df07e --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/ManagedOpenSsl-2010.csproj @@ -0,0 +1,163 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {73DCC218-655B-485F-8EAC-0CE5F2F7343D} + Library + Properties + OpenSSL + ManagedOpenSsl + + + 3.5 + + + v2.0 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + ..\bin\Debug\ + DEBUG;TRACE + prompt + 4 + ..\bin\Debug\ManagedOpenSsl.XML + x86 + AllRules.ruleset + + + pdbonly + true + ..\bin\Release\ + TRACE + prompt + 4 + ..\bin\Release\ManagedOpenSsl.XML + x86 + AllRules.ruleset + + + true + bin\x64\Debug\ + DEBUG;TRACE + ..\ManagedOpenSsl.XML + full + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + bin\x64\Release\ + TRACE + ..\ManagedOpenSsl.XML + true + pdbonly + x64 + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + \ No newline at end of file diff --git a/dep/openssl/src/ManagedOpenSsl/Properties/AssemblyInfo.cs b/dep/openssl/src/ManagedOpenSsl/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..1721979a --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/Properties/AssemblyInfo.cs @@ -0,0 +1,60 @@ +// Copyright (c) 2006-2009 Frank Laub +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("OpenSSL.NET")] +[assembly: AssemblyDescription("A managed wrapper for OpenSSL")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Blue Tree Labs")] +[assembly: AssemblyProduct("OpenSSL.NET")] +[assembly: AssemblyCopyright("Copyright (c) 2006-2009")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("0e663de8-2722-46c7-b0ca-1dac0d60644a")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("0.4.3.0")] +[assembly: AssemblyFileVersion("0.4.3.0")] diff --git a/dep/openssl/src/ManagedOpenSsl/Ssl.cs b/dep/openssl/src/ManagedOpenSsl/Ssl.cs new file mode 100644 index 00000000..63512246 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/Ssl.cs @@ -0,0 +1,427 @@ +// Copyright (c) 2009 Ben Henderson +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using OpenSSL.Core; +using OpenSSL.X509; + +namespace OpenSSL +{ + enum SslError + { + SSL_ERROR_NONE = 0, + SSL_ERROR_SSL = 1, + SSL_ERROR_WANT_READ = 2, + SSL_ERROR_WANT_WRITE = 3, + SSL_ERROR_WANT_X509_LOOKUP = 4, + SSL_ERROR_SYSCALL = 5, /* look at error stack/return value/errno */ + SSL_ERROR_ZERO_RETURN = 6, + SSL_ERROR_WANT_CONNECT = 7, + SSL_ERROR_WANT_ACCEPT = 8 + } + + class Ssl : Base, IDisposable + { + internal const int SSL_ST_CONNECT = 0x1000; + internal const int SSL_ST_ACCEPT = 0x2000; + + #region ssl_st + + [StructLayout(LayoutKind.Sequential)] + struct ssl_st + { + /* protocol version + * (one of SSL2_VERSION, SSL3_VERSION, TLS1_VERSION, DTLS1_VERSION) + */ + public int version; + public int type; /* SSL_ST_CONNECT or SSL_ST_ACCEPT */ + + public IntPtr method; //SSL_METHOD *method; /* SSLv3 */ + + /* There are 2 BIO's even though they are normally both the + * same. This is so data can be read and written to different + * handlers */ + +#if ! OPENSSL_NO_BIO + public IntPtr rbio; //BIO *rbio; /* used by SSL_read */ + public IntPtr wbio; //BIO *wbio; /* used by SSL_write */ + public IntPtr bbio; //BIO *bbio; /* used during session-id reuse to concatenate messages */ +#else + char *rbio; /* used by SSL_read */ + char *wbio; /* used by SSL_write */ + char *bbio; +#endif + /* This holds a variable that indicates what we were doing + * when a 0 or -1 is returned. This is needed for + * non-blocking IO so we know what request needs re-doing when + * in SSL_accept or SSL_connect */ + public int rwstate; + + /* true when we are actually in SSL_accept() or SSL_connect() */ + public int in_handshake; + public IntPtr handshake_func; //int (*handshake_func)(SSL *); + + /* Imagine that here's a boolean member "init" that is + * switched as soon as SSL_set_{accept/connect}_state + * is called for the first time, so that "state" and + * "handshake_func" are properly initialized. But as + * handshake_func is == 0 until then, we use this + * test instead of an "init" member. + */ + + public int server; /* are we the server side? - mostly used by SSL_clear*/ + + public int new_session;/* 1 if we are to use a new session. + * 2 if we are a server and are inside a handshake + * (i.e. not just sending a HelloRequest) + * NB: For servers, the 'new' session may actually be a previously + * cached session or even the previous session unless + * SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION is set */ + public int quiet_shutdown;/* don't send shutdown packets */ + public int shutdown; /* we have shut things down, 0x01 sent, 0x02 for received */ + public int state; /* where we are */ + public int rstate; /* where we are when reading */ + + public IntPtr init_buf; //BUF_MEM *init_buf; /* buffer used during init */ + public IntPtr init_msg; //void *init_msg; /* pointer to handshake message body, set by ssl3_get_message() */ + public int init_num; /* amount read/written */ + public int init_off; /* amount read/written */ + + /* used internally to point at a raw packet */ + public IntPtr packet; //unsigned char *packet; + public uint packet_length; //unsigned int packet_length; + + public IntPtr s2; //struct ssl2_state_st *s2; /* SSLv2 variables */ + public IntPtr s3; //struct ssl3_state_st *s3; /* SSLv3 variables */ + public IntPtr d1; //struct dtls1_state_st *d1; /* DTLSv1 variables */ + + public int read_ahead; /* Read as many input bytes as possible (for non-blocking reads) */ + + /* callback that allows applications to peek at protocol messages */ + public IntPtr msg_callback; //void (*msg_callback)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg); + public IntPtr msg_callback_arg; //void *msg_callback_arg; + + public int hit; /* reusing a previous session */ + + public IntPtr param; //X509_VERIFY_PARAM *param; + +#if FALSE // #if 0 + int purpose; /* Purpose setting */ + int trust; /* Trust setting */ +#endif + + /* crypto */ + public IntPtr cipher_list; //STACK_OF(SSL_CIPHER) *cipher_list; + public IntPtr cipher_list_by_id; //STACK_OF(SSL_CIPHER) *cipher_list_by_id; + + /* These are the ones being used, the ones in SSL_SESSION are + * the ones to be 'copied' into these ones */ + + public IntPtr enc_read_ctx; //EVP_CIPHER_CTX *enc_read_ctx; /* cryptographic state */ + public IntPtr read_hash; //const EVP_MD *read_hash; /* used for mac generation */ +#if ! OPENSSL_NO_COMP + public IntPtr expand; //COMP_CTX *expand; /* uncompress */ +#else + char *expand; +#endif + + public IntPtr enc_write_ctx; //EVP_CIPHER_CTX *enc_write_ctx; /* cryptographic state */ + public IntPtr write_hash; //const EVP_MD *write_hash; /* used for mac generation */ +#if ! OPENSSL_NO_COMP + public IntPtr compress; //COMP_CTX *compress; /* compression */ +#else + char *compress; +#endif + + /* session info */ + + /* client cert? */ + /* This is used to hold the server certificate used */ + public IntPtr cert; //struct cert_st /* CERT */ *cert; + + /* the session_id_context is used to ensure sessions are only reused + * in the appropriate context */ + public uint sid_ctx_length; //unsigned int sid_ctx_length; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Native.SSL_MAX_SID_CTX_LENGTH)] + public byte[] sid_ctx; //unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH]; + + /* This can also be in the session once a session is established */ + public IntPtr session; //SSL_SESSION *session; + + /* Default generate session ID callback. */ + public IntPtr generate_session_id; //GEN_SESSION_CB generate_session_id; + + /* Used in SSL2 and SSL3 */ + public int verify_mode; /* 0 don't care about verify failure. + * 1 fail if verify fails */ + public IntPtr verify_callback; //int (*verify_callback)(int ok,X509_STORE_CTX *ctx); /* fail if callback returns 0 */ + + public IntPtr info_callback; //void (*info_callback)(const SSL *ssl,int type,int val); /* optional informational callback */ + + public int error; /* error bytes to be written */ + public int error_code; /* actual code */ + +#if !OPENSSL_NO_KRB5 + public IntPtr kssl_ctx; //KSSL_CTX *kssl_ctx; /* Kerberos 5 context */ +#endif // OPENSSL_NO_KRB5 + + public IntPtr ctx; //SSL_CTX *ctx; + /* set this flag to 1 and a sleep(1) is put into all SSL_read() + * and SSL_write() calls, good for nbio debuging :-) */ + public int debug; + + /* extra application data */ + public int verify_result; //long verify_result; + // CRYPTO_EX_DATA ex_data; + #region CRYPTO_EX_DATA ex_data; + public IntPtr ex_data_sk; + public int ex_data_dummy; + #endregion + + /* for server side, keep the list of CA_dn we can use */ + public IntPtr client_CA; //STACK_OF(X509_NAME) *client_CA; + + public int references; + public uint options; //unsigned long options; /* protocol behaviour */ + public uint mode; //unsigned long mode; /* API behaviour */ + public int max_cert_list; //long max_cert_list; + public int first_packet; + public int client_version; /* what was passed, used for + * SSLv3/TLS rollback check */ +#if ! OPENSSL_NO_TLSEXT + /* TLS extension debug callback */ + public IntPtr tlsext_debug_cb; //void (*tlsext_debug_cb)(SSL *s, int client_server, int type, unsigned char *data, int len, void *arg); + public IntPtr tlsext_debug_arg; //void *tlsext_debug_arg; + public IntPtr tlsext_hostname; //char *tlsext_hostname; + public int servername_done; /* no further mod of servername + 0 : call the servername extension callback. + 1 : prepare 2, allow last ack just after in server callback. + 2 : don't call servername callback, no ack in server hello + */ + /* certificate status request info */ + /* Status type or -1 if no status type */ + public int tlsext_status_type; + /* Expect OCSP CertificateStatus message */ + public int tlsext_status_expected; + /* OCSP status request only */ + public IntPtr tlsext_ocsp_ids; //STACK_OF(OCSP_RESPID) *tlsext_ocsp_ids; + public IntPtr tlsext_ocsp_exts; //X509_EXTENSIONS *tlsext_ocsp_exts; + /* OCSP response received or to be sent */ + public IntPtr tlsext_ocsp_resp; //unsigned char *tlsext_ocsp_resp; + public int tlsext_ocsp_resplen; + + /* RFC4507 session ticket expected to be received or sent */ + public int tlsext_ticket_expected; + public IntPtr initial_ctx; //SSL_CTX * initial_ctx; /* initial ctx, used to store sessions */ +#endif //! OPENSSL_NO_TLSEXT + } + + #endregion + + #region Initialization + + /// + /// Calls SSL_new() + /// + /// + public Ssl(SslContext ctx) : + base(Native.ExpectNonNull(Native.SSL_new(ctx.Handle)), true) + { } + + internal Ssl(IntPtr ptr, bool takeOwnership) + : base(ptr, takeOwnership) + { } + + #endregion + + #region Properties + public int State + { + get + { + int offset = (int)Marshal.OffsetOf(typeof(ssl_st), "state"); + IntPtr offset_ptr = new IntPtr((int)this.ptr + offset); + return Marshal.ReadInt32(offset_ptr); + } + set + { + int offset = (int)Marshal.OffsetOf(typeof(ssl_st), "state"); + IntPtr offset_ptr = new IntPtr((int)this.ptr + offset); + Marshal.WriteInt32(offset_ptr, value); + } + } + + public SslCipher CurrentCipher + { + get { return new SslCipher(Native.SSL_get_current_cipher(this.Handle), false); } + } + + public Core.Stack CAList + { + get + { + IntPtr ptr = Native.SSL_get_client_CA_list(this.ptr); + Core.Stack name_stack = new Core.Stack(ptr, false); + return name_stack; + } + set + { + Native.SSL_set_client_CA_list(this.ptr, value.Handle); + } + } + + public X509Certificate LocalCertificate + { + get + { + IntPtr cert = Native.ExpectNonNull(Native.SSL_get_certificate(this.ptr)); + return new X509Certificate(cert, false); + } + set + { + Native.ExpectSuccess(Native.SSL_use_certificate(this.ptr, value.Handle)); + } + } + + public X509Certificate RemoteCertificate + { + get { return GetPeerCertificate(); } + } + + #endregion + + #region Methods + + public int Accept() + { + return Native.SSL_accept(this.ptr); + } + + public int Connect() + { + return Native.SSL_connect(this.ptr); + } + + public SslError GetError(int ret_code) + { + return (SslError)Native.SSL_get_error(this.ptr, ret_code); + } + + public X509Certificate GetPeerCertificate() + { + IntPtr cert_ptr = Native.ExpectNonNull(Native.SSL_get_peer_certificate(this.ptr)); + X509Certificate cert = new X509Certificate(cert_ptr, true); + return cert; + } + + public VerifyResult GetVerifyResult() + { + return (VerifyResult)Native.SSL_get_verify_result(this.ptr); + } + + public void SetVerifyResult(VerifyResult result) + { + Native.SSL_set_verify_result(this.ptr, (int)result); + } + + public int Shutdown() + { + return Native.SSL_shutdown(this.ptr); + } + + public int Write(byte[] buf, int len) + { + return Native.SSL_write(this.ptr, buf, len); + } + + public int Read(byte[] buf, int len) + { + return Native.SSL_read(this.ptr, buf, len); + } + + public int SetSessionIdContext(byte[] sid_ctx, uint sid_ctx_len) + { + return Native.ExpectSuccess(Native.SSL_set_session_id_context(this.ptr, sid_ctx, sid_ctx_len)); + } + + public int Renegotiate() + { + return Native.ExpectSuccess(Native.SSL_renegotiate(this.ptr)); + } + + public int DoHandshake() + { + return Native.SSL_do_handshake(this.ptr); + } + + public void SetAcceptState() + { + Native.SSL_set_accept_state(this.ptr); + } + + public void SetConnectState() + { + Native.SSL_set_connect_state(this.ptr); + } + + public void SetBIO(BIO read, BIO write) + { + Native.SSL_set_bio(this.ptr, read.Handle, write.Handle); + } + + public int UseCertificateFile(string filename, SslFileType type) + { + return Native.ExpectSuccess(Native.SSL_use_certificate_file(this.ptr, filename, (int)type)); + } + + public int UsePrivateKeyFile(string filename, SslFileType type) + { + return Native.ExpectSuccess(Native.SSL_use_PrivateKey_file(this.ptr, filename, (int)type)); + } + + public int Clear() + { + return Native.ExpectSuccess(Native.SSL_clear(this.ptr)); + } + + #endregion + + #region Overrides + + /// + /// Calls SSL_free() + /// + protected override void OnDispose() + { + Native.SSL_free(this.Handle); + } + + #endregion + + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/SslCipher.cs b/dep/openssl/src/ManagedOpenSsl/SslCipher.cs new file mode 100644 index 00000000..39ac651a --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/SslCipher.cs @@ -0,0 +1,543 @@ +// Copyright (c) 2009 Ben Henderson +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using OpenSSL.Core; + +namespace OpenSSL +{ + class SslCipher : Base, IStackable + { + #region SSL_CIPHER + [StructLayout(LayoutKind.Sequential)] + struct SSL_CIPHER + { + public int valid; + public IntPtr name; // text name + public uint id; // id, 4 bytes, first is version + public uint algorithm_mkey; /* key exchange algorithm */ + public uint algorithm_auth; /* server authentication */ + public uint algorithm_enc; /* symmetric encryption */ + public uint algorithm_mac; /* symmetric authentication */ + public uint algorithm_ssl; /* (major) protocol version */ + public uint algo_strength; // strength and export flags + public uint algorithm2; // extra flags + public int strength_bits; // number of bits really used + public int alg_bits; // number of bits for algorithm +// public uint mask; // used for matching +// public uint mask_strength; // also used for matching + } + #endregion + + bool isInitialized = false; + private SSL_CIPHER raw; + private CipherAlgorithmType cipherAlgorithm = CipherAlgorithmType.None; + private int cipherStrength = 0; + private HashAlgorithmType hashAlgorithm = HashAlgorithmType.None; + private ExchangeAlgorithmType keyExchangeAlgorithm = ExchangeAlgorithmType.None; + private AuthenticationMethod authMethod = AuthenticationMethod.None; + private int keyExchangeStrength = 0; + private SslProtocols sslProtocol = SslProtocols.None; + + public SslCipher() : + this(IntPtr.Zero, false) + { + } + + public SslCipher(IntPtr ptr, bool owner) : + base(ptr, owner) + { + Initialize(); + } + + internal SslCipher(IStack stack, IntPtr ptr) : + base(ptr, true) + { + Initialize(); + } + + /// + /// Returns SSL_CIPHER_name() + /// + public string Name + { + get { return Native.SSL_CIPHER_name(this.ptr); } + } + + /// + /// Returns SSL_CIPHER_description() + /// + public string Description + { + get + { + byte[] buf = new byte[512]; + Native.SSL_CIPHER_description(this.ptr, buf, buf.Length); + string ret = Encoding.ASCII.GetString(buf); + return ret; + } + } + + /// + /// Returns SSL_CIPHER_get_bits() + /// + public int Strength + { + get + { + Initialize(); + if (cipherStrength == 0) + { + int nAlgBits = 0; + return Native.SSL_CIPHER_get_bits(this.Handle, out nAlgBits); + } + return cipherStrength; + } + } + + public const int SSL_EXPORT = 0x00000002; + public const int SSL_EXP40 = 0x00000008; + public const int SSL_EXP56 = 0x00000010; + + private bool IsExport(uint algo_strength) + { + return (algo_strength & SSL_EXPORT) > 0; + } + + private int ExportPrivateKeyLength(uint algo_strength) + { + if ((algo_strength & SSL_EXP40) > 0) + { + return 512; + } + return 1024; + } + + // [D3Inferno] + // I don't think this method is up to date. + private int ExportKeyLength(uint algorithm_enc, uint algo_strength) + { + if ((algo_strength & SSL_EXP40) > 0) + { + return 5; + } + else + { + if ((algorithm_enc & SSL_DES) > 0) + { + return 8; + } + return 7; + } + } + + // [D3Inferno] + // These definitions come from ssl/ssl_locl.h + // WARNING: The "algorithms" value was broken up into 5 variables in version 0.9.9. + + /* Bits for algorithm_mkey (key exchange algorithm) */ + public const int SSL_kRSA = 0x00000001; /* RSA key exchange */ + public const int SSL_kDHr = 0x00000002; /* DH cert, RSA CA cert */ /* no such ciphersuites supported! */ + public const int SSL_kDHd = 0x00000004; /* DH cert, DSA CA cert */ /* no such ciphersuite supported! */ + public const int SSL_kEDH = 0x00000008; /* tmp DH key no DH cert */ + public const int SSL_kKRB5 = 0x00000010; /* Kerberos5 key exchange */ + public const int SSL_kECDHr = 0x00000020; /* ECDH cert, RSA CA cert */ + public const int SSL_kECDHe = 0x00000040; /* ECDH cert, ECDSA CA cert */ + public const int SSL_kEECDH = 0x00000080; /* ephemeral ECDH */ + public const int SSL_kPSK = 0x00000100; /* PSK */ + public const int SSL_kGOST= 0x00000200; /* GOST key exchange */ + public const int SSL_kSRP= 0x00000400; /* SRP */ + + /* Bits for algorithm_auth (server authentication) */ + public const int SSL_aRSA = 0x00000001; /* RSA auth */ + public const int SSL_aDSS = 0x00000002; /* DSS auth */ + public const int SSL_aNULL = 0x00000004; /* no auth (i.e. use ADH or AECDH) */ + public const int SSL_aDH = 0x00000008; /* Fixed DH auth (kDHd or kDHr) */ /* no such ciphersuites supported! */ + public const int SSL_aECDH = 0x00000010; /* Fixed ECDH auth (kECDHe or kECDHr) */ + public const int SSL_aKRB5 = 0x00000020; /* KRB5 auth */ + public const int SSL_aECDSA= 0x00000040; /* ECDSA auth*/ + public const int SSL_aPSK = 0x00000080; /* PSK auth */ + public const int SSL_aGOST94= 0x00000100; /* GOST R 34.10-94 signature auth */ + public const int SSL_aGOST01 = 0x00000200; /* GOST R 34.10-2001 signature auth */ + +/* + public const int SSL_NULL = (SSL_eNULL); + public const int SSL_ADH = (SSL_kEDH | SSL_aNULL); + public const int SSL_RSA = (SSL_kRSA | SSL_aRSA); + public const int SSL_DH = (SSL_kDHr | SSL_kDHd | SSL_kEDH); + public const int SSL_ECDH = (SSL_kECDH | SSL_kECDHE); + public const int SSL_FZA = (SSL_aFZA | SSL_kFZA | SSL_eFZA); + public const int SSL_KRB5 = (SSL_kKRB5 | SSL_aKRB5); +*/ + + /* Bits for algorithm_enc (symmetric encryption) */ + public const int SSL_DES = 0x00000001; + public const int SSL_3DES = 0x00000002; + public const int SSL_RC4 = 0x00000004; + public const int SSL_RC2 = 0x00000008; + public const int SSL_IDEA = 0x00000010; + public const int SSL_eNULL = 0x00000020; + public const int SSL_AES128 = 0x00000040; + public const int SSL_AES256 = 0x00000080; + public const int SSL_CAMELLIA128 = 0x00000100; + public const int SSL_CAMELLIA256 = 0x00000200; + public const int SSL_eGOST2814789CNT = 0x00000400; + public const int SSL_SEED = 0x00000800; + public const int SSL_AES128GCM = 0x00001000; + public const int SSL_AES256GCM = 0x00002000; + + public const int SSL_AES = (SSL_AES128|SSL_AES256|SSL_AES128GCM|SSL_AES256GCM); + public const int SSL_CAMELLIA = (SSL_CAMELLIA128|SSL_CAMELLIA256); + + /* Bits for algorithm_mac (symmetric authentication) */ + public const int SSL_MD5 = 0x00000001; + public const int SSL_SHA1 = 0x00000002; + public const int SSL_GOST94 = 0x00000004; + public const int SSL_GOST89MAC = 0x00000008; + public const int SSL_SHA256 = 0x00000010; + public const int SSL_SHA384 = 0x00000020; + /* Not a real MAC, just an indication it is part of cipher */ + public const int SSL_AEAD = 0x00000040; + public const int SSL_SHA = (SSL_SHA1); + + /* Bits for algorithm_ssl (protocol version) */ + public const int SSL_SSLV2 = 0x00000001; + public const int SSL_SSLV3 = 0x00000002; + public const int SSL_TLSV1 = SSL_SSLV3; /* for now */ + public const int SSL_TLSV1_2 = 0x00000004; + + /* Bits for algorithm2 (handshake digests and other extra flags) */ + public const int SSL_HANDSHAKE_MAC_MD5 = 0x10; + public const int SSL_HANDSHAKE_MAC_SHA = 0x20; + public const int SSL_HANDSHAKE_MAC_GOST94 = 0x40; + public const int SSL_HANDSHAKE_MAC_SHA256 = 0x80; + public const int SSL_HANDSHAKE_MAC_SHA384 = 0x100; + public const int SSL_HANDSHAKE_MAC_DEFAULT = (SSL_HANDSHAKE_MAC_MD5 | SSL_HANDSHAKE_MAC_SHA); + + /* Flags for the SSL_CIPHER.algorithm2 field */ + public const int SSL2_CF_5_BYTE_ENC = 0x01; + public const int SSL2_CF_8_BYTE_ENC = 0x02; + + private void Initialize() + { + if (this.ptr == IntPtr.Zero || isInitialized) + { + return; + } + + isInitialized = true; + + // marshal the structure + raw = (SSL_CIPHER)Marshal.PtrToStructure(ptr, typeof(SSL_CIPHER)); + // start picking the data out + bool isExport = IsExport(raw.algo_strength); + int privateKeyLength = ExportPrivateKeyLength(raw.algo_strength); + int keyLength = ExportKeyLength(raw.algorithm_enc, raw.algo_strength); + + // Get the SSL Protocol version + if ((raw.algorithm_ssl & SSL_SSLV2) == SSL_SSLV2) + { + sslProtocol = SslProtocols.Ssl2; + } + else if ((raw.algorithm_ssl & SSL_SSLV3) == SSL_SSLV3) + { + sslProtocol = SslProtocols.Tls; // SSL3 & TLS are the same here... + } + else if ((raw.algorithm_ssl & SSL_TLSV1_2) == SSL_TLSV1_2) + { + sslProtocol = SslProtocols.Tls; // WARNING: TLSV1_2 support not fully implemented + } + + // set the keyExchange strength + keyExchangeStrength = privateKeyLength; + + // Get the Key Exchange cipher and strength + switch (raw.algorithm_mkey) + { + case SSL_kRSA: + keyExchangeAlgorithm = ExchangeAlgorithmType.RsaKeyX; + break; + case SSL_kDHr: + case SSL_kDHd: + case SSL_kEDH: + keyExchangeAlgorithm = ExchangeAlgorithmType.DiffieHellman; + break; + case SSL_kKRB5: + keyExchangeAlgorithm = ExchangeAlgorithmType.Kerberos; + break; + case SSL_kECDHr: + case SSL_kECDHe: + case SSL_kEECDH: + keyExchangeAlgorithm = ExchangeAlgorithmType.ECDiffieHellman; + break; + case SSL_kPSK: + keyExchangeAlgorithm = ExchangeAlgorithmType.PSK; + break; + case SSL_kGOST: + keyExchangeAlgorithm = ExchangeAlgorithmType.GOST; + break; + case SSL_kSRP: + keyExchangeAlgorithm = ExchangeAlgorithmType.SRP; + break; + } + + // Get the authentication method + switch (raw.algorithm_auth) + { + case SSL_aRSA: + authMethod = AuthenticationMethod.Rsa; + break; + case SSL_aDSS: + authMethod = AuthenticationMethod.Dss; + break; + case SSL_aDH: + authMethod = AuthenticationMethod.DiffieHellman; + break; + case SSL_aKRB5: /* VRS */ + authMethod = AuthenticationMethod.Kerberos; + break; + case SSL_aNULL: + authMethod = AuthenticationMethod.None; + break; + case SSL_aECDSA: + authMethod = AuthenticationMethod.ECDsa; + break; + case SSL_aPSK: + authMethod = AuthenticationMethod.PSK; + break; + case SSL_aGOST94: + authMethod = AuthenticationMethod.GOST; + break; + case SSL_aGOST01: + authMethod = AuthenticationMethod.GOST; + break; + } + // Get the symmetric encryption cipher info + switch (raw.algorithm_enc) + { + case SSL_DES: + cipherAlgorithm = CipherAlgorithmType.Des; + if (isExport && keyLength == 5) + { + cipherStrength = 40; + } + else + { + cipherStrength = 56; + } + break; + case SSL_3DES: + cipherAlgorithm = CipherAlgorithmType.TripleDes; + cipherStrength = 168; + break; + case SSL_RC4: + cipherAlgorithm = CipherAlgorithmType.Rc4; + if (isExport) + { + if (keyLength == 5) + { + cipherStrength = 40; + } + else + { + cipherStrength = 56; + } + } + else + { + if ((raw.algorithm2 & SSL2_CF_8_BYTE_ENC) == SSL2_CF_8_BYTE_ENC) + { + cipherStrength = 64; + } + else + { + cipherStrength = 128; + } + } + break; + case SSL_RC2: + cipherAlgorithm = CipherAlgorithmType.Rc2; + if (isExport) + { + if (keyLength == 5) + { + cipherStrength = 40; + } + else + { + cipherStrength = 56; + } + } + else + { + cipherStrength = 128; + } + break; + case SSL_IDEA: + cipherAlgorithm = CipherAlgorithmType.Idea; + cipherStrength = 128; + break; + case SSL_eNULL: + cipherAlgorithm = CipherAlgorithmType.None; + break; + case SSL_AES128: + cipherAlgorithm = CipherAlgorithmType.Aes128; + cipherStrength = 128; + break; + case SSL_AES256: + cipherAlgorithm = CipherAlgorithmType.Aes256; + cipherStrength = 256; + break; + case SSL_AES128GCM: + cipherAlgorithm = CipherAlgorithmType.Aes128GCM; + cipherStrength = 128; + break; + case SSL_AES256GCM: + cipherAlgorithm = CipherAlgorithmType.Aes256GCM; + cipherStrength = 256; + break; +/* + switch (raw.strength_bits) + { + case 128: cipherAlgorithm = CipherAlgorithmType.Aes128; break; + case 192: cipherAlgorithm = CipherAlgorithmType.Aes192; break; + case 256: cipherAlgorithm = CipherAlgorithmType.Aes256; break; + } +*/ + case SSL_CAMELLIA128: + cipherAlgorithm = CipherAlgorithmType.Seed; + cipherStrength = 128; + break; + case SSL_CAMELLIA256: + cipherAlgorithm = CipherAlgorithmType.Seed; + cipherStrength = 128; + break; +/* + switch (raw.strength_bits) + { + case 128: cipherAlgorithm = CipherAlgorithmType.Camellia128; break; + case 256: cipherAlgorithm = CipherAlgorithmType.Camellia256; break; + } +*/ + case SSL_eGOST2814789CNT: + cipherAlgorithm = CipherAlgorithmType.eGOST2814789CNT; + cipherStrength = 128; // ??? + break; + case SSL_SEED: + cipherAlgorithm = CipherAlgorithmType.Seed; + cipherStrength = 128; + break; + } + + // Get the MAC info + switch (raw.algorithm_mac) + { + case SSL_MD5: + hashAlgorithm = HashAlgorithmType.Md5; + break; + case SSL_SHA1: + hashAlgorithm = HashAlgorithmType.Sha1; + break; + case SSL_GOST94: + hashAlgorithm = HashAlgorithmType.Gost94; + break; + case SSL_GOST89MAC: + hashAlgorithm = HashAlgorithmType.Gost89MAC; + break; + case SSL_SHA256: + hashAlgorithm = HashAlgorithmType.Sha256; + break; + case SSL_SHA384: + hashAlgorithm = HashAlgorithmType.Sha384; + break; + default: + hashAlgorithm = HashAlgorithmType.None; + break; + } + } + + public CipherAlgorithmType CipherAlgorithm + { + get + { + Initialize(); + return cipherAlgorithm; + } + } + + public HashAlgorithmType HashAlgorithm + { + get + { + Initialize(); + return hashAlgorithm; + } + } + + public ExchangeAlgorithmType KeyExchangeAlgorithm + { + get + { + Initialize(); + return keyExchangeAlgorithm; + } + } + + public int KeyExchangeStrength + { + get + { + Initialize(); + return keyExchangeStrength; + } + } + + public SslProtocols SslProtocol + { + get + { + Initialize(); + return sslProtocol; + } + } + + public AuthenticationMethod AuthenticateionMethod + { + get + { + Initialize(); + return authMethod; + } + } + + protected override void OnDispose() + { + Native.OPENSSL_free(this.ptr); + } + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/SslContext.cs b/dep/openssl/src/ManagedOpenSsl/SslContext.cs new file mode 100644 index 00000000..41006b15 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/SslContext.cs @@ -0,0 +1,649 @@ +// Copyright (c) 2009 Ben Henderson +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using OpenSSL.Core; +using OpenSSL.Crypto; +using OpenSSL.X509; + +namespace OpenSSL +{ + delegate int ClientCertCallbackHandler(Ssl ssl, out X509Certificate cert, out CryptoKey key); + + #region PSK delegates + delegate int PskClientCallbackHandler(Ssl ssl, String hint, out String identity, uint max_identity_len, out byte[] psk, uint max_psk_len); + delegate int PskServerCallbackHandler(Ssl ssl, String identity, out byte[] psk, uint max_psk_len); + #endregion + /// + /// Wraps the SST_CTX structure and methods + /// + internal class SslContext : Base, IDisposable + { + #region SSL_CTX + [StructLayout(LayoutKind.Sequential)] + private struct SSL_CTX + { + public IntPtr method; //SSL_METHOD + public IntPtr cipher_list; // STACK_OF(SSL_CIPHER) + public IntPtr cipher_list_by_id; // STACK_OF(SSL_CIPHER) + public IntPtr cert_store; //X509_STORE + public IntPtr sessions; //lhash_st of SSL_SESSION + public int session_cache_size; + public IntPtr session_cache_head; //ssl_session_st + public IntPtr session_cache_tail; // ssl_session_st + public int session_cache_mode; + public int session_timeout; + public IntPtr new_session_cb; // int (*new_session_cb)(SSL*, SSL_SESSION*) + public IntPtr remove_session_cb; // void (*remove_session_cb)(SSL*,SSL_SESSION*) + public IntPtr get_session_cb; // SSL_SESSION*(*get_session_cb)(SSL*, uchar* data, int len, int* copy) + #region stats + public int stats_sess_connect; /* SSL new conn - started */ + public int stats_sess_connect_renegotiate;/* SSL reneg - requested */ + public int stats_sess_connect_good; /* SSL new conne/reneg - finished */ + public int stats_sess_accept; /* SSL new accept - started */ + public int stats_sess_accept_renegotiate;/* SSL reneg - requested */ + public int stats_sess_accept_good; /* SSL accept/reneg - finished */ + public int stats_sess_miss; /* session lookup misses */ + public int stats_sess_timeout; /* reuse attempt on timeouted session */ + public int stats_sess_cache_full; /* session removed due to full cache */ + public int stats_sess_hit; /* session reuse actually done */ + public int stats_sess_cb_hit; /* session-id that was not in the cache was passed back via the callback. This + * indicates that the application is supplying session-id's from other processes - spooky :-) */ + #endregion + public int references; + public IntPtr app_verify_callback; //int (*app_verify_callback)(X509_STORE_CTX *, void *) + public IntPtr app_verify_arg; + public IntPtr default_passwd_callback; //pem_password_cb + public IntPtr default_passwd_callback_userdata; + public IntPtr client_cert_cb; //int (*client_cert_cb)(SSL *ssl, X509 **x509, EVP_PKEY **pkey) + public IntPtr app_gen_cookie_cb; //int (*app_gen_cookie_cb)(SSL *ssl, unsigned char *cookie, unsigned int *cookie_len); + public IntPtr app_verify_cookie_cb; //int (*app_verify_cookie_cb)(SSL *ssl, unsigned char *cookie, unsigned int cookie_len); + #region CRYPTO_EX_DATA ex_data; + public IntPtr ex_data_sk; + public int ex_data_dummy; + #endregion + public IntPtr rsa_md5; //EVP_MD + public IntPtr md5; //EVP_MD + public IntPtr sha1; //EVP_MD + public IntPtr extra_certs; //STACK_OF(X509) + public IntPtr comp_methods; //STACK_OF(SSL_COMP) + public IntPtr info_callback; //void (*info_callback)(const SSL *ssl,int type,int val) + public IntPtr client_CA; //STACK_OF(X509_NAME) + public uint options; + public uint mode; + public int max_cert_list; + public IntPtr cert; //cert_st + public int read_ahead; + public IntPtr msg_callback; //void (*msg_callback)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg); + public IntPtr msg_callback_arg; + public int verify_mode; + public uint sid_ctx_length; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Native.SSL_MAX_SID_CTX_LENGTH)] + public byte[] sid_ctx; + public IntPtr default_verify_callback; //int (*default_verify_callback)(int ok,X509_STORE_CTX *ctx) + public IntPtr generate_session_id; //typedef int (*GEN_SESSION_CB)(const SSL *ssl, unsigned char *id,unsigned int *id_len); + #region X509_VERIFY_PARAM + public IntPtr x509_verify_param_name; + public long x509_verify_param_check_time; + public int x509_verify_param_inh_flags; + public int x509_verify_param_flags; + public int x509_verify_param_purpose; + public int x509_verify_param_trust; + public int x509_verify_param_depth; + public IntPtr x509_verify_param_policies; + #endregion +#if __UNUSED__ + int purpose; /* Purpose setting */ + int trust; /* Trust setting */ +#endif + public int quiet_shutdown; + //#if (! OPENSSL_ENGINE) + // Engine to pass requests for client certs to + public IntPtr client_cert_engine; + //#endif + //#if (! OPENSSL_NO_TLSEXT) + public IntPtr tlsext_servername_callback; //int (*tlsext_servername_callback)(SSL*, int *, void *) + public IntPtr tlsext_servername_arg; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public byte[] tlsext_tick_key_name; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public byte[] tlsext_tick_hmac_key; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public byte[] tlsext_tick_aes_key; + public IntPtr tlsext_ticket_key_cb; //int (*tlsext_ticket_key_cb)(SSL *ssl,unsigned char *name, unsigned char *iv,EVP_CIPHER_CTX *ectx,HMAC_CTX *hctx, int enc); + public IntPtr tlsext_status_cb; //int (*tlsext_status_cb)(SSL *ssl, void *arg); + public IntPtr tlsext_status_arg; + // ************************** WARNING ************************** + // This StructLayout is not correct! Do not use it directly! + // Only use the provided callbacks to interact with the SslContext. + // ***************************************************************** + public IntPtr tlsext_opaque_prf_input_callback; // int (*tlsext_opaque_prf_input_callback)(SSL *, void *peerinput, size_t len, void *arg); + public IntPtr tlsext_opaque_prf_input_callback_arg; // void *tlsext_opaque_prf_input_callback_arg; + //#endif + // Note that you should not set these values directly, but use the provided callback setters. + //#ifndef OPENSSL_NO_PSK + public IntPtr psk_identity_hint; //char *psk_identity_hint; + public IntPtr psk_client_callback; //unsigned int (*psk_client_callback)(SSL *ssl, const char *hint, char *identity, unsigned int max_identity_len, unsigned char *psk, unsigned int max_psk_len); + public IntPtr psk_server_callback; //unsigned int (*psk_server_callback)(SSL *ssl, const char *identity, unsigned char *psk, unsigned int max_psk_len); + //#endif + } + #endregion + + #region PSK Callbacks + private PskClientCallbackThunk _pskClientCallbackThunk; + private PskServerCallbackThunk _pskServerCallbackThunk; + #endregion + #region Members + + //private SSL_CTX raw; + private VerifyCertCallbackThunk _verifyCertCallbackThunk; + private ClientCertCallbackThunk _clientCertCallbackThunk; + #endregion + + /// + /// Calls SSL_CTX_new() + /// + /// + public SslContext(SslMethod sslMethod) : + base(Native.ExpectNonNull(Native.SSL_CTX_new(sslMethod.Handle)), true) + { + } + + #region Properties + + /// + /// Calls SSL_CTX_set_options + /// + public SslOptions Options + { + set { Native.ExpectSuccess(Native.SSL_CTX_set_options(this.ptr, (int)value)); } + get { return (SslOptions)Native.SSL_CTX_get_options(this.ptr); } + } + + public SslMode Mode + { + set { Native.ExpectSuccess(Native.SSL_CTX_set_mode(this.ptr, (int)value)); } + get { return (SslMode)Native.SSL_CTX_get_mode(this.ptr); } + } + + #endregion + + internal class ClientCertCallbackThunk + { + private ClientCertCallbackHandler OnClientCertCallback; + private Native.client_cert_cb nativeCallback; + + public Native.client_cert_cb Callback + { + get + { + if (this.OnClientCertCallback == null) + { + return null; + } + if (this.nativeCallback != null) + { + return this.nativeCallback; + } + else + { + this.nativeCallback = new Native.client_cert_cb(this.OnClientCertThunk); + return this.nativeCallback; + } + } + } + + public ClientCertCallbackThunk(ClientCertCallbackHandler callback) + { + this.OnClientCertCallback = callback; + } + + internal int OnClientCertThunk(IntPtr ssl_ptr, out IntPtr cert_ptr, out IntPtr key_ptr) + { + X509Certificate cert = null; + CryptoKey key = null; + Ssl ssl = new Ssl(ssl_ptr, false); + cert_ptr = IntPtr.Zero; + key_ptr = IntPtr.Zero; + + int nRet = OnClientCertCallback(ssl, out cert, out key); + if (nRet != 0) + { + if (cert != null) + { + cert_ptr = cert.Handle; + } + if (key != null) + { + key_ptr = key.Handle; + } + } + return nRet; + } + + } + + internal class VerifyCertCallbackThunk + { + private RemoteCertificateValidationHandler OnVerifyCert; + private Native.VerifyCertCallback nativeCallback; + + public Native.VerifyCertCallback Callback + { + get + { + if (this.OnVerifyCert == null) + { + return null; + } + if (this.nativeCallback != null) + { + return this.nativeCallback; + } + else + { + this.nativeCallback = new Native.VerifyCertCallback(OnVerifyCertThunk); + return this.nativeCallback; + } + } + } + + public VerifyCertCallbackThunk(RemoteCertificateValidationHandler callback) + { + this.OnVerifyCert = callback; + } + + internal int OnVerifyCertThunk(int ok, IntPtr store_ctx) + { + X509StoreContext ctx = new X509StoreContext(store_ctx, false); + X509Certificate cert = ctx.CurrentCert; + int depth = ctx.ErrorDepth; + VerifyResult result = (VerifyResult)ctx.Error; + // build the X509Chain from the store + X509Store store = ctx.Store; + Core.Stack objStack = store.Objects; + X509Chain chain = new X509Chain(); + foreach (X509Object obj in objStack) + { + X509Certificate objCert = obj.Certificate; + if (objCert != null) + { + chain.Add(objCert); + } + } + // Call the managed delegate + if (OnVerifyCert(this, cert, chain, depth, result)) + { + return 1; + } + else + { + return 0; + } + } + } + + #region Methods + + /// + /// Sets the certificate store for the context - calls SSL_CTX_set_cert_store + /// The X509Store object and contents will be freed when the context is disposed. + /// Ensure that the store object and it's contents have IsOwner set to false + /// before assigning them into the context. + /// + /// + public void SetCertificateStore(X509Store store) + { + // Remove the native pointer ownership from the object + // Reference counts don't work for the X509_STORE, so + // we just remove ownership from the X509Store object + store.IsOwner = false; + Native.SSL_CTX_set_cert_store(this.ptr, store.Handle); + } + + /// + /// Sets the certificate verification mode and callback - calls SSL_CTX_set_verify + /// + /// + /// + public void SetVerify(VerifyMode mode, RemoteCertificateValidationHandler callback) + { + this._verifyCertCallbackThunk = new VerifyCertCallbackThunk(callback); + Native.SSL_CTX_set_verify(this.ptr, (int)mode, _verifyCertCallbackThunk.Callback); + } + + /// + /// Sets the certificate verification depth - calls SSL_CTX_set_verify_depth + /// + /// + public void SetVerifyDepth(int depth) + { + Native.SSL_CTX_set_verify_depth(this.ptr, depth); + } + + public Core.Stack LoadClientCAFile(string filename) + { + IntPtr stack = Native.SSL_load_client_CA_file(filename); + Core.Stack name_stack = new Core.Stack(stack, true); + return name_stack; + } + + /// + /// Calls SSL_CTX_set_client_CA_list/SSL_CTX_get_client_CA_list + /// The Stack and the X509Name objects contined within them + /// are freed when the context is disposed. Make sure that + /// the Stack and X509Name objects have set IsOwner to false + /// before assigning them to the context. + /// + public Core.Stack CAList + { + get + { + IntPtr ptr = Native.SSL_CTX_get_client_CA_list(this.ptr); + Core.Stack name_stack = new Core.Stack(ptr, false); + return name_stack; + } + set + { + // Remove the native pointer ownership from the Stack object + value.IsOwner = false; + Native.SSL_CTX_set_client_CA_list(this.ptr, value.Handle); + } + } + + public int LoadVerifyLocations(string caFile, string caPath) + { + return Native.ExpectSuccess(Native.SSL_CTX_load_verify_locations(this.ptr, caFile, caPath)); + } + + public int SetDefaultVerifyPaths() + { + return Native.ExpectSuccess(Native.SSL_CTX_set_default_verify_paths(this.ptr)); + } + + public int SetCipherList(string cipherList) + { + return Native.ExpectSuccess(Native.SSL_CTX_set_cipher_list(this.ptr, cipherList)); + } + + public int UseCertificate(X509Certificate cert) + { + return Native.ExpectSuccess(Native.SSL_CTX_use_certificate(this.ptr, cert.Handle)); + } + + public int UseCertificateChainFile(string filename) + { + return Native.ExpectSuccess(Native.SSL_CTX_use_certificate_chain_file(this.ptr, filename)); + } + + public int UsePrivateKey(CryptoKey key) + { + return Native.ExpectSuccess(Native.SSL_CTX_use_PrivateKey(this.ptr, key.Handle)); + } + + public int UsePrivateKeyFile(string filename, SslFileType type) + { + return Native.ExpectSuccess(Native.SSL_CTX_use_PrivateKey_file(this.ptr, filename, (int)type)); + } + + public int CheckPrivateKey() + { + return Native.ExpectSuccess(Native.SSL_CTX_check_private_key(this.ptr)); + } + + public int SetSessionIdContext(byte[] sid_ctx) + { + return Native.ExpectSuccess(Native.SSL_CTX_set_session_id_context(this.ptr, sid_ctx, (uint)sid_ctx.Length)); + } + + public void SetClientCertCallback(ClientCertCallbackHandler callback) + { + _clientCertCallbackThunk = new ClientCertCallbackThunk(callback); + Native.SSL_CTX_set_client_cert_cb(this.ptr, _clientCertCallbackThunk.Callback); + } + + public List GetCipherList() + { + List ret = new List(); + SSL_CTX raw = (SSL_CTX)Marshal.PtrToStructure(ptr, typeof(SSL_CTX)); + Core.Stack stack = new Core.Stack(raw.cipher_list, false); + foreach (SslCipher cipher in stack) + { + IntPtr cipher_ptr = Native.SSL_CIPHER_description(cipher.Handle, null, 0); + if (cipher_ptr != IntPtr.Zero) + { + string strCipher = Marshal.PtrToStringAnsi(cipher_ptr); + ret.Add(strCipher); + Native.OPENSSL_free(cipher_ptr); + } + } + return ret; + } + + #endregion + + #region PSK callback functions + internal class PskClientCallbackThunk + { + private PskClientCallbackHandler OnPskClientCallback; + private Native.psk_client_callback nativeCallback; + + public Native.psk_client_callback Callback + { + get + { + if (this.OnPskClientCallback == null) + { + return null; + } + if (this.nativeCallback != null) + { + return this.nativeCallback; + } + else + { + this.nativeCallback = new Native.psk_client_callback(this.OnPskClientThunk); + return this.nativeCallback; + } + } + } + + public PskClientCallbackThunk(PskClientCallbackHandler callback) + { + this.OnPskClientCallback = callback; + } + + // void SSL_CTX_set_psk_client_callback(SSL_CTX *ctx, unsigned int (*psk_client_callback) + // (SSL *ssl, const char *hint, char *identity, unsigned int max_identity_len, unsigned char *psk, unsigned int max_psk_len)); + // return psk_len; + // + // Note that the buffers where we will put the results were allocated by the native code. + internal int OnPskClientThunk(IntPtr ssl_ptr, IntPtr hint_ptr, IntPtr identity_ptr, uint max_identity_len, IntPtr psk_ptr, uint max_psk_len) + { + // Note that the ssl reference is not needed by this function. + + String hint = null; // hint passed by server for selecting identity; ignore it (not used by bnet) + String identity = null; + byte[] psk = null; + + int nRet = OnPskClientCallback(null, hint, out identity, max_identity_len, out psk, max_psk_len); + if (nRet == 0) + return nRet; + + if (psk == null) + throw new ArgumentNullException("PSK Client callback psk cannot be set to null."); + + if (identity.Length > max_identity_len - 1) // need 1 byte for NULL terminator + throw new ArgumentOutOfRangeException("PSK Client callback identity length (" + identity.Length + ") is greater than max_identity_len (" + (max_identity_len-1) + ")."); + if (psk.Length > max_psk_len) + throw new ArgumentOutOfRangeException("PSK Client callback psk length (" + psk.Length + ") is greater than max_psk_len (" + max_psk_len + ")."); + + CopyStringValueToNativeCharBuffer(identity, identity_ptr); + CopyBytesToNativeCharBuffer(psk, psk_ptr); + + // Must return the length of the psk. + return psk.Length; + } + } + + internal class PskServerCallbackThunk + { + private PskServerCallbackHandler OnPskServerCallback; + private Native.psk_server_callback nativeCallback; + + public Native.psk_server_callback Callback + { + get + { + if (this.OnPskServerCallback == null) + { + return null; + } + if (this.nativeCallback != null) + { + return this.nativeCallback; + } + else + { + this.nativeCallback = new Native.psk_server_callback(this.OnPskServerThunk); + return this.nativeCallback; + } + } + } + + public PskServerCallbackThunk(PskServerCallbackHandler callback) + { + this.OnPskServerCallback = callback; + } + + // void SSL_CTX_set_psk_server_callback(SSL_CTX *ctx, unsigned int (*psk_server_callback) + // (SSL *ssl, const char *identity, unsigned char *psk, unsigned int max_psk_len)); + // return psk_len; + // + // Note that the buffers where we will put the results were allocated by the native code. + internal int OnPskServerThunk(IntPtr ssl_ptr, IntPtr identity_ptr, IntPtr psk_ptr, uint max_psk_len) + { + // Note that the ssl reference is not needed by this function. + + byte[] psk = null; + + // Convert the raw C char buffer into a string. + // Note that the trailing NULLs (0x00) need to be stripped. + const int max_identity_len = 0x80; + byte[] identity_bytes = new byte[max_identity_len]; + Marshal.Copy(identity_ptr, identity_bytes, 0, max_identity_len); + int index = Array.FindIndex(identity_bytes, 0, (b) => b == 0); + if (index > max_identity_len ) + throw new ArgumentOutOfRangeException("PSK Server callback identity could not be determined from native char buffer."); + + byte[] identity_bytes_null_stripped = new byte[index]; + for (int i = 0; i < index; i++) + { + identity_bytes_null_stripped[i] = identity_bytes[i]; + } + String identity = System.Text.ASCIIEncoding.ASCII.GetString(identity_bytes_null_stripped); + + int nRet = OnPskServerCallback(null, identity, out psk, max_psk_len); + if (nRet == 0) + return nRet; + + if (psk == null) + throw new ArgumentNullException("PSK Server callback psk cannot be set to null."); + + if (psk.Length > max_psk_len) + throw new ArgumentOutOfRangeException("PSK Server callback psk length (" + psk.Length + ") is greater than max_psk_len (" + max_psk_len + ")."); + + CopyBytesToNativeCharBuffer(psk, psk_ptr); + + // Must return the length of the psk. + return psk.Length; + } + } + + public void SetPskClientCallback(PskClientCallbackHandler callback) + { + _pskClientCallbackThunk = new PskClientCallbackThunk(callback); + Native.SSL_CTX_set_psk_client_callback(this.ptr, _pskClientCallbackThunk.Callback); + } + + public void SetPskServerCallback(PskServerCallbackHandler callback) + { + _pskServerCallbackThunk = new PskServerCallbackThunk(callback); + Native.SSL_CTX_set_psk_server_callback(this.ptr, _pskServerCallbackThunk.Callback); + } + + + // Copy the given Managed byte array into a pre-allocated native char buffer. + private static void CopyBytesToNativeCharBuffer(byte[] bytes, IntPtr intPtr) + { + Marshal.Copy(bytes, 0, intPtr, bytes.Length); + } + + // Copy the value of the given Managed string into a pre-allocated native char buffer. + private static void CopyStringValueToNativeCharBuffer(string str, IntPtr intPtr) + { + if (str == null) + { + Marshal.Copy(new byte[] { 0x00 } , 0, intPtr, 1); + } + else + { + Marshal.Copy(ConvertStringToBytes(str), 0, intPtr, str.Length + 1); + } + } + + // Convert the given string into a null-terminated byte array. + private static byte[] ConvertStringToBytes(string str) + { + byte[] bytes = new byte[str.Length + 1]; // add 1 for null terminator + + int i = 0; + foreach (char c in str) + { + bytes[i] = (byte)c; + i++; + } + bytes[i] = 0x00; // null terminate + + return bytes; + } + + #endregion + #region IDisposable Members + + /// + /// base override - calls SSL_CTX_free() + /// + protected override void OnDispose() + { + Native.SSL_CTX_free(this.ptr); + } + + #endregion + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/SslMethod.cs b/dep/openssl/src/ManagedOpenSsl/SslMethod.cs new file mode 100644 index 00000000..9753516a --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/SslMethod.cs @@ -0,0 +1,127 @@ +// Copyright (c) 2009 Ben Henderson +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using OpenSSL.Core; + +namespace OpenSSL +{ + /// + /// Wraps the SSL_METHOD structure and methods + /// + public class SslMethod : Base + { + private SslMethod(IntPtr ptr, bool owner) : + base(ptr, owner) + { + } + + /// + /// Throws NotImplementedException() + /// + protected override void OnDispose() { + throw new NotImplementedException(); + } + + // these methods have been removed in openssl 1.0.0.e /raist. + ///// + ///// SSLv2_method() + ///// + //public static SslMethod SSLv2_method = new SslMethod(Native.SSLv2_method(), false); + + ///// + ///// SSLv2_server_method() + ///// + //public static SslMethod SSLv2_server_method = new SslMethod(Native.SSLv2_server_method(), false); + + ///// + ///// SSLv2_client_method() + ///// + //public static SslMethod SSLv2_client_method = new SslMethod(Native.SSLv2_client_method(), false); + + /// + /// SSLv3_method() + /// + public static SslMethod SSLv3_method = new SslMethod(Native.SSLv3_method(), false); + + /// + /// SSLv3_server_method() + /// + public static SslMethod SSLv3_server_method = new SslMethod(Native.SSLv3_server_method(), false); + + /// + /// SSLv3_client_method() + /// + public static SslMethod SSLv3_client_method = new SslMethod(Native.SSLv3_client_method(), false); + + /// + /// SSLv23_method() + /// + public static SslMethod SSLv23_method = new SslMethod(Native.SSLv23_method(), false); + + /// + /// SSLv23_server_method() + /// + public static SslMethod SSLv23_server_method = new SslMethod(Native.SSLv23_server_method(), false); + + /// + /// SSLv23_client_method() + /// + public static SslMethod SSLv23_client_method = new SslMethod(Native.SSLv23_client_method(), false); + + /// + /// TLSv1_method() + /// + public static SslMethod TLSv1_method = new SslMethod(Native.TLSv1_method(), false); + + /// + /// TLSv1_server_method() + /// + public static SslMethod TLSv1_server_method = new SslMethod(Native.TLSv1_server_method(), false); + + /// + /// TLSv1_client_method() + /// + public static SslMethod TLSv1_client_method = new SslMethod(Native.TLSv1_client_method(), false); + + /// + /// DTLSv1_method() + /// + public static SslMethod DTLSv1_method = new SslMethod(Native.DTLSv1_method(), false); + + /// + /// DTLSv1_server_method() + /// + public static SslMethod DTLSv1_server_method = new SslMethod(Native.DTLSv1_server_method(), false); + + /// + /// DTLSv1_client_method() + /// + public static SslMethod DTLSv1_client_method = new SslMethod(Native.DTLSv1_client_method(), false); + + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/SslStream.cs b/dep/openssl/src/ManagedOpenSsl/SslStream.cs new file mode 100644 index 00000000..398b5321 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/SslStream.cs @@ -0,0 +1,790 @@ +// Copyright (c) 2009 Ben Henderson +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Net.Security; +using System.IO; +using OpenSSL.X509; + +namespace OpenSSL +{ + /// + /// + /// + /// + /// + /// + /// + /// + /// + public delegate bool RemoteCertificateValidationHandler(Object sender, X509Certificate cert, X509Chain chain, int depth, VerifyResult result); + + /// + /// + /// + /// + /// + /// + /// + /// + /// + public delegate X509Certificate LocalCertificateSelectionHandler(Object sender, string targetHost, X509List localCerts, X509Certificate remoteCert, string[] acceptableIssuers); + + /// + /// Implments an AuthenticatedStream and is the main interface to the SSL library. + /// + public class SslStream : AuthenticatedStream + { + #region Initialization + + /// + /// Create an SslStream based on an existing stream. + /// + /// + public SslStream(Stream stream) + : this(stream, false) + { + } + + /// + /// Create an SslStream based on an existing stream. + /// + /// + /// + public SslStream(Stream stream, bool leaveInnerStreamOpen) + : base(stream, leaveInnerStreamOpen) + { + remoteCertificateValidationCallback = null; + localCertificateSelectionCallback = null; + } + + /// + /// Create an SslStream based on an existing stream. + /// + /// + /// + /// + public SslStream(Stream stream, bool leaveInnerStreamOpen, RemoteCertificateValidationHandler remote_callback) + : this(stream, leaveInnerStreamOpen, remote_callback, null) + { + } + + /// + /// Create an SslStream based on an existing stream. + /// + /// + /// + /// + /// + public SslStream(Stream stream, bool leaveInnerStreamOpen, RemoteCertificateValidationHandler remote_callback, LocalCertificateSelectionHandler local_callback) + : base(stream, leaveInnerStreamOpen) + { + remoteCertificateValidationCallback = remote_callback; + localCertificateSelectionCallback = local_callback; + } + #endregion + + #region AuthenticatedStream Members + /// + /// Returns whether authentication was successful. + /// + public override bool IsAuthenticated + { + get { return sslStream != null; } + } + + /// + /// Indicates whether data sent using this SslStream is encrypted. + /// + public override bool IsEncrypted + { + get { return IsAuthenticated; } + } + + /// + /// Indicates whether both server and client have been authenticated. + /// + public override bool IsMutuallyAuthenticated + { + get + { + if (IsAuthenticated && (IsServer ? sslStream.RemoteCertificate != null : sslStream.LocalCertificate != null)) + { + return true; + } + return false; + } + } + + /// + /// Indicates whether the local side of the connection was authenticated as the server. + /// + public override bool IsServer + { + get { return sslStream is SslStreamServer; } + } + + /// + /// Indicates whether the data sent using this stream is signed. + /// + public override bool IsSigned + { + get { return IsAuthenticated; } + } + + #endregion + + #region Stream Members + /// + /// Gets a value indicating whether the current stream supports reading. + /// + public override bool CanRead + { + get { return InnerStream.CanRead; } + } + + /// + /// Gets a value indicating whether the current stream supports seeking. + /// + public override bool CanSeek + { + get { return InnerStream.CanSeek; } + } + + /// + /// Gets a value indicating whether the current stream supports writing. + /// + public override bool CanWrite + { + get { return InnerStream.CanWrite; } + } + + /// + /// Clears all buffers for this stream and causes any buffered data to be written to the underlying device. + /// + public override void Flush() + { + InnerStream.Flush(); + } + + /// + /// Gets the length in bytes of the stream. + /// + public override long Length + { + get { return InnerStream.Length; } + } + + /// + /// Gets or sets the position within the current stream. + /// + public override long Position + { + get { return InnerStream.Position; } + set { throw new NotSupportedException(); } + } + + /// + /// Gets or sets a value, in miliseconds, that determines how long the stream will attempt to read before timing out. + /// + public override int ReadTimeout + { + get { return InnerStream.ReadTimeout; } + set { InnerStream.ReadTimeout = value; } + } + + /// + /// Gets or sets a value, in miliseconds, that determines how long the stream will attempt to write before timing out. + /// + public override int WriteTimeout + { + get { return InnerStream.WriteTimeout; } + set { InnerStream.WriteTimeout = value; } + } + + /// + /// Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read. + /// + /// + /// + /// + /// + public override int Read(byte[] buffer, int offset, int count) + { + return EndRead(BeginRead(buffer, offset, count, null, null)); + } + + /// + /// Begins an asynchronous read operation. + /// + /// + /// + /// + /// + /// + /// + public override IAsyncResult BeginRead( + byte[] buffer, + int offset, + int count, + AsyncCallback asyncCallback, + Object asyncState) + { + TestConnectionIsValid(); + + return sslStream.BeginRead(buffer, offset, count, asyncCallback, asyncState); + } + + /// + /// Waits for the pending asynchronous read to complete. + /// + /// + /// + public override int EndRead(IAsyncResult asyncResult) + { + TestConnectionIsValid(); + + return sslStream.EndRead(asyncResult); + } + + /// + /// Not supported + /// + /// + /// + /// + public override long Seek(long offset, System.IO.SeekOrigin origin) + { + throw new NotSupportedException(); + } + + /// + /// Sets the length of the current stream. + /// + /// + public override void SetLength(long value) + { + InnerStream.SetLength(value); + } + + /// + /// Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written. + /// + /// + /// + /// + public override void Write(byte[] buffer, int offset, int count) + { + TestConnectionIsValid(); + + EndWrite(BeginWrite(buffer, offset, count, null, null)); + } + + /// + /// Begins an asynchronous write operation. + /// + /// + /// + /// + /// + /// + /// + public override IAsyncResult BeginWrite( + byte[] buffer, + int offset, + int count, + AsyncCallback asyncCallback, + Object asyncState) + { + TestConnectionIsValid(); + + return sslStream.BeginWrite(buffer, offset, count, asyncCallback, asyncState); + } + + /// + /// Ends an asynchronous write operation. + /// + /// + public override void EndWrite(IAsyncResult asyncResult) + { + TestConnectionIsValid(); + + sslStream.EndWrite(asyncResult); + } + + /// + /// Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream. + /// + public override void Close() + { + TestConnectionIsValid(); + + base.Close(); + sslStream.Close(); + } + #endregion + + #region Properties + + /// + /// + /// + public bool CheckCertificateRevocationStatus + { + get + { + if (!IsAuthenticated) + return false; + return sslStream.CheckCertificateRevocationStatus; + } + } + + /// + /// + /// + public CipherAlgorithmType CipherAlgorithm + { + get + { + if (!IsAuthenticated) + return CipherAlgorithmType.None; + return sslStream.CipherAlgorithm; + } + } + + /// + /// + /// + public int CipherStrength + { + get + { + if (!IsAuthenticated) + return 0; + return sslStream.CipherStrength; + } + } + + /// + /// + /// + public HashAlgorithmType HashAlgorithm + { + get + { + if (!IsAuthenticated) + return HashAlgorithmType.None; + return sslStream.HashAlgorithm; + } + } + + /// + /// + /// + public int HashStrength + { + get + { + if (!IsAuthenticated) + return 0; + return sslStream.HashStrength; + } + } + + /// + /// + /// + public ExchangeAlgorithmType KeyExchangeAlgorithm + { + get + { + if (!IsAuthenticated) + return ExchangeAlgorithmType.None; + return sslStream.KeyExchangeAlgorithm; + } + } + + /// + /// + /// + public int KeyExchangeStrength + { + get + { + if (!IsAuthenticated) + return 0; + return sslStream.KeyExchangeStrength; + } + } + + /// + /// + /// + public X509Certificate LocalCertificate + { + get + { + if (!IsAuthenticated) + return null; + return sslStream.LocalCertificate; + } + } + + /// + /// + /// + public virtual X509Certificate RemoteCertificate + { + get + { + if (!IsAuthenticated) + return null; + return sslStream.RemoteCertificate; + } + } + + /// + /// + /// + public SslProtocols SslProtocol + { + get + { + if (!IsAuthenticated) + return SslProtocols.None; + return sslStream.SslProtocol; + } + } + + /// + /// + /// + public List CipherList + { + get { return sslStream.CipherList; } + } + + public string CipherDescription + { + get + { + if (!IsAuthenticated) + return null; + return sslStream.CipherDescription; + } + } + + #endregion //Properties + + #region Methods + /// + /// + /// + /// + public virtual void AuthenticateAsClient(string targetHost) + { + AuthenticateAsClient(targetHost, null, null, SslProtocols.Default, SslStrength.Medium, false); + } + + /// + /// + /// + /// + /// + /// + /// + /// + /// + public virtual void AuthenticateAsClient( + string targetHost, + X509List certificates, + X509Chain caCertificates, + SslProtocols enabledSslProtocols, + SslStrength sslStrength, + bool checkCertificateRevocation) + { + EndAuthenticateAsClient(BeginAuthenticateAsClient(targetHost, certificates, caCertificates, enabledSslProtocols, sslStrength, checkCertificateRevocation, null, null)); + } + + /// + /// + /// + /// + /// + /// + /// + public virtual IAsyncResult BeginAuthenticateAsClient(string targetHost, AsyncCallback asyncCallback, Object asyncState) + { + return BeginAuthenticateAsClient(targetHost, null, null, SslProtocols.Default, SslStrength.Medium, false, asyncCallback, asyncState); + } + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public virtual IAsyncResult BeginAuthenticateAsClient( + string targetHost, + X509List clientCertificates, + X509Chain caCertificates, + SslProtocols enabledSslProtocols, + SslStrength sslStrength, + bool checkCertificateRevocation, + AsyncCallback asyncCallback, + Object asyncState) + { + if (IsAuthenticated) + { + throw new InvalidOperationException("SslStream is already authenticated"); + } + + // Create the stream + SslStreamClient client_stream = new SslStreamClient(InnerStream, false, targetHost, clientCertificates, caCertificates, enabledSslProtocols, sslStrength, checkCertificateRevocation, remoteCertificateValidationCallback, localCertificateSelectionCallback); + // set the internal stream + sslStream = client_stream; + // start the write operation + return BeginWrite(new byte[0], 0, 0, asyncCallback, asyncState); + } + // PSK authentication + public virtual IAsyncResult BeginAuthenticateAsClientUsingPsk( + string targetHost, + string pskCiphers, + string pskIdentity, + byte[] pskPsk, + AsyncCallback asyncCallback, + Object asyncState) + { + if (IsAuthenticated) + { + throw new InvalidOperationException("SslStream is already authenticated"); + } + + // Create the stream + SslStreamClient client_stream = new SslStreamClient(InnerStream, false, targetHost, pskCiphers, pskIdentity, pskPsk); + // set the internal stream + sslStream = client_stream; + // start the write operation + return BeginWrite(new byte[0], 0, 0, asyncCallback, asyncState); + } + + /// + /// + /// + /// + public virtual void EndAuthenticateAsClient(IAsyncResult ar) + { + TestConnectionIsValid(); + + // Finish the async authentication. The EndRead/EndWrite will complete successfully, or throw exception + EndWrite(ar); + } + + /// + /// + /// + /// + public virtual void AuthenticateAsServer(X509Certificate serverCertificate) + { + AuthenticateAsServer(serverCertificate, false, null, SslProtocols.Default, SslStrength.Medium, false); + } + + /// + /// + /// + /// + /// + /// + /// + /// + /// + public virtual void AuthenticateAsServer( + X509Certificate serverCertificate, + bool clientCertificateRequired, + X509Chain caCertificates, + SslProtocols enabledSslProtocols, + SslStrength sslStrength, + bool checkCertificateRevocation) + { + EndAuthenticateAsServer(BeginAuthenticateAsServer(serverCertificate, clientCertificateRequired, caCertificates, enabledSslProtocols, sslStrength, checkCertificateRevocation, null, null)); + } + + /// + /// + /// + /// + /// + /// + /// + public virtual IAsyncResult BeginAuthenticateAsServer( + X509Certificate serverCertificate, + AsyncCallback asyncCallback, + Object asyncState) + { + return BeginAuthenticateAsServer(serverCertificate, false, null, SslProtocols.Default, SslStrength.Medium, false, asyncCallback, asyncState); + } + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public virtual IAsyncResult BeginAuthenticateAsServer( + X509Certificate serverCertificate, + bool clientCertificateRequired, + X509Chain caCerts, + SslProtocols enabledSslProtocols, + SslStrength sslStrength, + bool checkCertificateRevocation, + AsyncCallback asyncCallback, + Object asyncState) + { + if (IsAuthenticated) + { + throw new InvalidOperationException("SslStream is already authenticated"); + } + // Initialize the server stream + SslStreamServer server_stream = new SslStreamServer(InnerStream, false, serverCertificate, clientCertificateRequired, caCerts, enabledSslProtocols, sslStrength, checkCertificateRevocation, remoteCertificateValidationCallback); + // Set the internal sslStream + sslStream = server_stream; + // Start the read operation + return BeginRead(new byte[0], 0, 0, asyncCallback, asyncState); + } + // PSK authentication + public virtual IAsyncResult BeginAuthenticateAsServerUsingPsk( + string pskCiphers, + byte[] pskPsk, + AsyncCallback asyncCallback, + Object asyncState) + { + if (IsAuthenticated) + { + throw new InvalidOperationException("SslStream is already authenticated"); + } + // Initialize the server stream + SslStreamServer server_stream = new SslStreamServer(InnerStream, false, pskCiphers, pskPsk); + // Set the internal sslStream + sslStream = server_stream; + // Start the read operation + return BeginRead(new byte[0], 0, 0, asyncCallback, asyncState); + } + + /// + /// + /// + /// + public virtual void EndAuthenticateAsServer(IAsyncResult ar) + { + TestConnectionIsValid(); + + // Finish the async AuthenticateAsServer call - EndRead/Write call will throw exception on error + EndRead(ar); + } + + /// + /// + /// + public void Renegotiate() + { + TestConnectionIsValid(); + + EndRenegotiate(BeginRenegotiate(null, null)); + } + + /// + /// + /// + /// + /// + /// + public IAsyncResult BeginRenegotiate(AsyncCallback callback, object state) + { + TestConnectionIsValid(); + + sslStream.Renegotiate(); + + if (sslStream is SslStreamClient) + { + return BeginWrite(new byte[0], 0, 0, callback, state); + } + else + { + return BeginRead(new byte[0], 0, 0, callback, state); + } + } + + /// + /// + /// + /// + public void EndRenegotiate(IAsyncResult asyncResult) + { + TestConnectionIsValid(); + + if (sslStream is SslStreamClient) + { + EndWrite(asyncResult); + } + else + { + EndRead(asyncResult); + } + } + + #endregion + + #region Helpers + private void TestConnectionIsValid() + { + if (sslStream == null) + { + throw new InvalidOperationException("SslStream has not been authenticated"); + } + } + #endregion + + #region Fields + SslStreamBase sslStream; + internal RemoteCertificateValidationHandler remoteCertificateValidationCallback = null; + internal LocalCertificateSelectionHandler localCertificateSelectionCallback = null; + internal bool m_bCheckCertRevocationStatus = false; + #endregion + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/SslStreamBase.cs b/dep/openssl/src/ManagedOpenSsl/SslStreamBase.cs new file mode 100644 index 00000000..872e2914 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/SslStreamBase.cs @@ -0,0 +1,1202 @@ +// Copyright (c) 2009 Ben Henderson +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.Threading; +using OpenSSL.Core; +using OpenSSL.X509; + +namespace OpenSSL +{ + internal abstract class SslStreamBase : Stream, IDisposable + { + internal Stream innerStream; + internal bool ownStream; + private volatile bool disposed = false; + internal SslContext sslContext; + internal Ssl ssl; + internal BIO read_bio; + internal BIO write_bio; + private byte[] read_buffer; // for reading from the stream + private MemoryStream decrypted_data_stream; // decrypted data from Ssl.Read + //private volatile bool inHandshakeLoop; + private const int SSL3_RT_HEADER_LENGTH = 5; + private const int SSL3_RT_MAX_PLAIN_LENGTH = 16384; + private const int SSL3_RT_MAX_COMPRESSED_LENGTH = (1024 + SSL3_RT_MAX_PLAIN_LENGTH); + private const int SSL3_RT_MAX_ENCRYPTED_LENGTH = (1024 + SSL3_RT_MAX_COMPRESSED_LENGTH); + private const int SSL3_RT_MAX_PACKET_SIZE = (SSL3_RT_MAX_ENCRYPTED_LENGTH + SSL3_RT_HEADER_LENGTH); + private const int WaitTimeOut = 300 * 1000; // 5 minutes + protected LocalCertificateSelectionHandler localCertificateSelectionCallback; + protected RemoteCertificateValidationHandler remoteCertificateSelectionCallback; + protected bool checkCertificateRevocationStatus = false; + protected HandshakeState handShakeState = HandshakeState.None; + protected OpenSslException handshakeException = null; + + // PSK attributes + protected string pskCiphers = null; + protected string pskIdentity = null; + protected byte[] pskPsk = null; + + /// + /// Override to implement client/server specific handshake processing + /// + /// + internal protected abstract bool ProcessHandshake(); + + #region InternalAsyncResult class + + private class InternalAsyncResult : IAsyncResult + { + private object locker = new object(); + private AsyncCallback userCallback; + private object userState; + private Exception asyncException; + private ManualResetEvent asyncWaitHandle; + private bool isCompleted; + private int bytesRead; + private bool isWriteOperation; + private bool continueAfterHandshake; + + private byte[] buffer; + private int offset; + private int count; + + public InternalAsyncResult(AsyncCallback userCallback, object userState, byte[] buffer, int offset, int count, bool isWriteOperation, bool continueAfterHandshake) + { + this.userCallback = userCallback; + this.userState = userState; + this.buffer = buffer; + this.offset = offset; + this.count = count; + this.isWriteOperation = isWriteOperation; + this.continueAfterHandshake = continueAfterHandshake; + } + + public bool ContinueAfterHandshake + { + get { return this.continueAfterHandshake; } + } + + public bool IsWriteOperation + { + get { return this.isWriteOperation; } + set { this.isWriteOperation = value; } + } + + public byte[] Buffer + { + get { return this.buffer; } + } + + public int Offset + { + get { return this.offset; } + } + + public int Count + { + get { return this.count; } + } + + public int BytesRead + { + get { return this.bytesRead; } + } + + public object AsyncState + { + get { return this.userState; } + } + + public Exception AsyncException + { + get { return this.asyncException; } + } + + public bool CompletedWithError + { + get + { + if (IsCompleted == false) + { + return false; + } + return (null != asyncException); + } + } + + public WaitHandle AsyncWaitHandle + { + get + { + lock (locker) + { + // Create the event if we haven't already done so + if (this.asyncWaitHandle == null) + { + this.asyncWaitHandle = new ManualResetEvent(isCompleted); + } + } + return this.asyncWaitHandle; + } + } + + public bool CompletedSynchronously + { + get { return false; } + } + + public bool IsCompleted + { + get + { + lock (locker) + { + return this.isCompleted; + } + } + } + + private void SetComplete(Exception ex, int bytesRead) + { + lock (locker) + { + if (this.isCompleted) + { + return; + } + + this.isCompleted = true; + this.asyncException = ex; + this.bytesRead = bytesRead; + // If the wait handle isn't null, we should set the event + // rather than fire a callback + if (this.asyncWaitHandle != null) + { + this.asyncWaitHandle.Set(); + } + } + // If we have a callback method, invoke it + if (this.userCallback != null) + { + this.userCallback.BeginInvoke(this, null, null); + } + } + + public void SetComplete(Exception ex) + { + SetComplete(ex, 0); + } + + public void SetComplete(int bytesRead) + { + SetComplete(null, bytesRead); + } + + public void SetComplete() + { + SetComplete(null, 0); + } + } + #endregion + + public SslStreamBase(Stream stream, bool ownStream) + { + if (stream == null) + { + throw new ArgumentNullException("stream"); + } + if (!stream.CanRead || !stream.CanWrite) + { + throw new ArgumentException("Stream must allow read and write capabilities", "stream"); + } + innerStream = stream; + this.ownStream = ownStream; + read_buffer = new byte[16384]; + //inHandshakeLoop = false; + decrypted_data_stream = new MemoryStream(); + } + + public bool HandshakeComplete + { + get { return handShakeState == HandshakeState.Complete; } + } + + private bool NeedHandshake + { + get { return ((handShakeState == HandshakeState.None) || (handShakeState == HandshakeState.Renegotiate)); } + } + + public bool CheckCertificateRevocationStatus + { + get { return checkCertificateRevocationStatus; } + set { checkCertificateRevocationStatus = value; } + } + + public LocalCertificateSelectionHandler LocalCertSelectionCallback + { + get { return localCertificateSelectionCallback; } + set { localCertificateSelectionCallback = value; } + } + + public RemoteCertificateValidationHandler RemoteCertValidationCallback + { + get { return remoteCertificateSelectionCallback; } + set { remoteCertificateSelectionCallback = value; } + } + + public X509Certificate LocalCertificate + { + get { return ssl.LocalCertificate; } + } + + public X509Certificate RemoteCertificate + { + get { return ssl.RemoteCertificate; } + } + + public CipherAlgorithmType CipherAlgorithm + { + get { return ssl.CurrentCipher.CipherAlgorithm; } + } + + public int CipherStrength + { + get { return ssl.CurrentCipher.Strength; } + } + + public HashAlgorithmType HashAlgorithm + { + get { return ssl.CurrentCipher.HashAlgorithm; } + } + + public int HashStrength + { + get + { + switch (HashAlgorithm) + { + case HashAlgorithmType.Md5: + return 128; + case HashAlgorithmType.Sha1: + return 160; + default: + return 0; + } + } + } + + public ExchangeAlgorithmType KeyExchangeAlgorithm + { + get { return ssl.CurrentCipher.KeyExchangeAlgorithm; } + } + + public int KeyExchangeStrength + { + get { return ssl.CurrentCipher.KeyExchangeStrength; } + } + + public SslProtocols SslProtocol + { + get { return ssl.CurrentCipher.SslProtocol; } + } + + public List CipherList + { + get { return sslContext.GetCipherList(); } + } + + public string CipherDescription + { + get { return ssl.CurrentCipher.Description; } + } + + #region Stream methods + public override bool CanRead + { + get { return innerStream.CanRead; } + } + + public override bool CanSeek + { + get { return innerStream.CanSeek; } + } + + public override bool CanWrite + { + get { return innerStream.CanWrite; } + } + + public override void Flush() + { + if (disposed) + { + throw new ObjectDisposedException("SslStreamBase"); + } + innerStream.Flush(); + } + + public override long Length + { + get { return innerStream.Length; } + } + + public override long Position + { + get { return innerStream.Position; } + set { throw new NotSupportedException(); } + } + + public override int ReadTimeout + { + get { return innerStream.ReadTimeout; } + set { innerStream.ReadTimeout = value; } + } + + public override int WriteTimeout + { + get { return innerStream.WriteTimeout; } + set { innerStream.WriteTimeout = value; } + } + + public override long Seek(long offset, SeekOrigin origin) + { + throw new NotImplementedException(); + } + + public override void SetLength(long value) + { + innerStream.SetLength(value); + } + + //!! - not implementing blocking read, but using BeginRead with no callbacks + public override int Read(byte[] buffer, int offset, int count) + { + throw new NotImplementedException(); + } + /* + public override int Read(byte[] buffer, int offset, int count) + { + // Check to see if we need to reset the decrypted data stream + if (decrypted_data_stream.Position == decrypted_data_stream.Length) + { + // reset the stream + decrypted_data_stream.Seek(0, SeekOrigin.Begin); + decrypted_data_stream.SetLength(0); + } + // Check to see if we have data in the decrypted memory stream, if so return it + if (decrypted_data_stream.Position > 0 && (decrypted_data_stream.Position != decrypted_data_stream.Length)) + { + return decrypted_data_stream.Read(buffer, offset, count); + } + + // No pre-existing data in the stream, read from the innerStream + int bytesRead = 0; + bool haveDataToReturn = false; + + while (! haveDataToReturn) + { + try + { + bytesRead = innerStream.Read(read_buffer, 0, read_buffer.Length); + } + catch(System.IO.IOException ex) + { + //!!TODO - log exception + return 0; + } + // if we have data, let's process it + if (bytesRead > 0) + { + // Copy encrypted data into the SSL read_bio + read_bio.Write(read_buffer, bytesRead); + if (inHandshakeLoop) + { + if (ProcessHandshake()) + { + inHandshakeLoop = false; + } + } + //!!else -- Process data in read_bio after handshake if there is any + { + uint nBytesPending = read_bio.BytesPending; + byte[] decrypted_buf = new byte[SSL3_RT_MAX_PACKET_SIZE]; + while (nBytesPending > 0) + { + int decryptedBytesRead = ssl.Read(decrypted_buf, decrypted_buf.Length); + if (decryptedBytesRead <= 0) + { + SslError lastError = ssl.GetError(decryptedBytesRead); + if (lastError == SslError.SSL_ERROR_WANT_READ) + { + // Renogiated requested by the client + if (write_bio.BytesPending > 0) + { + inHandshakeLoop = true; + if (ProcessHandshake()) + { + inHandshakeLoop = false; + } + } + //!!break; -- continue processing the handshake data + } + else if (lastError == SslError.SSL_ERROR_WANT_WRITE) + { + // unexpected error! + //!!TODO debug log + } + else if (lastError == SslError.SSL_ERROR_ZERO_RETURN) + { + // Shutdown alert + SendShutdownAlert(); + break; + } + else + { + //!!TODO - log last error, throw expection + break; + } + } + // Write decrypted data to memory stream + long pos = decrypted_data_stream.Position; + decrypted_data_stream.Seek(0, SeekOrigin.End); + decrypted_data_stream.Write(decrypted_buf, 0, decrypted_buf.Length); + decrypted_data_stream.Seek(pos, SeekOrigin.Begin); + haveDataToReturn = true; + + // See if we have more data to process + nBytesPending = read_bio.BytesPending; + } + } + } + } + // Read data from the decrypted data stream into the user buffer + return decrypted_data_stream.Read(buffer, offset, count); + } + */ + + public void SendShutdownAlert() + { + int nShutdownRet = ssl.Shutdown(); + if (nShutdownRet == 0) + { + uint nBytesToWrite = write_bio.BytesPending; + if (nBytesToWrite <= 0) + { + // unexpected error + //!!TODO log error + return; + } + ArraySegment buf = write_bio.ReadBytes((int)nBytesToWrite); + if (buf.Count <= 0) + { + //!!TODO - log error + } + else + { + // Write the shutdown alert to the stream + innerStream.Write(buf.Array, 0, buf.Count); + } + } + } + + public override IAsyncResult BeginRead( + byte[] buffer, + int offset, + int count, + AsyncCallback asyncCallback, + Object asyncState) + { + if (buffer == null) + { + throw new ArgumentNullException("buffer", "buffer can't be null"); + } + if (offset < 0) + { + throw new ArgumentOutOfRangeException("offset", "offset less than 0"); + } + if (offset > buffer.Length) + { + throw new ArgumentOutOfRangeException("offset", "offset must be less than buffer length"); + } + if (count < 0) + { + throw new ArgumentOutOfRangeException("count", "count less than 0"); + } + if (count > (buffer.Length - offset)) + { + throw new ArgumentOutOfRangeException("count", "count is greater than buffer length - offset"); + } + + bool proceedAfterHandshake = true; + if (count == 0) proceedAfterHandshake = false; + + InternalAsyncResult internalAsyncResult = new InternalAsyncResult(asyncCallback, asyncState, buffer, offset, count, false, proceedAfterHandshake); + + if (NeedHandshake) + { + //inHandshakeLoop = true; + BeginHandshake(internalAsyncResult); + } + else + { + InternalBeginRead(internalAsyncResult); + } + + return internalAsyncResult; + } + + private void InternalBeginRead(InternalAsyncResult asyncResult) + { + // Check to see if the decrypted data stream should be reset + if (decrypted_data_stream.Position == decrypted_data_stream.Length) + { + decrypted_data_stream.Seek(0, SeekOrigin.Begin); + decrypted_data_stream.SetLength(0); + } + // Check to see if we have data waiting in the decrypted data stream + if (decrypted_data_stream.Length > 0 && (decrypted_data_stream.Position != decrypted_data_stream.Length)) + { + // Process the pre-existing data + int bytesRead = decrypted_data_stream.Read(asyncResult.Buffer, asyncResult.Offset, asyncResult.Count); + asyncResult.SetComplete(bytesRead); + return; + } + // Start the async read from the inner stream + innerStream.BeginRead(read_buffer, 0, read_buffer.Length, new AsyncCallback(InternalReadCallback), asyncResult); + } + + private void InternalReadCallback(IAsyncResult asyncResult) + { + InternalAsyncResult internalAsyncResult = (InternalAsyncResult)asyncResult.AsyncState; + bool haveDataToReturn = false; + + try + { + int bytesRead = 0; + try + { + bytesRead = innerStream.EndRead(asyncResult); + } + catch (Exception ex) + { + // Set the exception into the internal async result + internalAsyncResult.SetComplete(ex); + } + if (bytesRead <= 0) + { + // Zero byte read most likely indicates connection closed (if it's a network stream) + internalAsyncResult.SetComplete(0); + return; + } + else + { + // Copy encrypted data into the SSL read_bio + read_bio.Write(read_buffer, bytesRead); + if (handShakeState == HandshakeState.InProcess || + handShakeState == HandshakeState.RenegotiateInProcess) + { + // We are in the handshake, complete the async operation to fire the async + // handshake callback for processing + internalAsyncResult.SetComplete(bytesRead); + return; + } + uint nBytesPending = read_bio.BytesPending; + byte[] decrypted_buf = new byte[SSL3_RT_MAX_PACKET_SIZE]; + while (nBytesPending > 0) + { + int decryptedBytesRead = ssl.Read(decrypted_buf, decrypted_buf.Length); + if (decryptedBytesRead <= 0) + { + SslError lastError = ssl.GetError(decryptedBytesRead); + if (lastError == SslError.SSL_ERROR_WANT_READ) + { + // if we have bytes pending in the write bio. + // the client has requested a renegotiation + if (write_bio.BytesPending > 0) + { + // Start the renegotiation by writing the write_bio data, and use the RenegotiationWriteCallback + // to handle the rest of the renegotiation + ArraySegment buf = write_bio.ReadBytes((int)write_bio.BytesPending); + innerStream.BeginWrite(buf.Array, 0, buf.Count, new AsyncCallback(RenegotiationWriteCallback), internalAsyncResult); + return; + } + // no data in the out bio, we just need more data to complete the record + //break; + } + else if (lastError == SslError.SSL_ERROR_WANT_WRITE) + { + // unexpected error! + //!!TODO debug log + } + else if (lastError == SslError.SSL_ERROR_ZERO_RETURN) + { + // Shutdown alert + SendShutdownAlert(); + break; + } + else + { + throw new OpenSslException(); + } + } + if (decryptedBytesRead > 0) + { + // Write decrypted data to memory stream + long pos = decrypted_data_stream.Position; + decrypted_data_stream.Seek(0, SeekOrigin.End); + decrypted_data_stream.Write(decrypted_buf, 0, decryptedBytesRead); + decrypted_data_stream.Seek(pos, SeekOrigin.Begin); + haveDataToReturn = true; + } + + // See if we have more data to process + nBytesPending = read_bio.BytesPending; + } + // Check to see if we have data to return, if not, fire the async read again + if (!haveDataToReturn) + { + innerStream.BeginRead(read_buffer, 0, read_buffer.Length, new AsyncCallback(InternalReadCallback), internalAsyncResult); + } + else + { + int bytesReadIntoUserBuffer = 0; + + // Read the data into the buffer provided by the user (now hosted in the InternalAsyncResult) + bytesReadIntoUserBuffer = decrypted_data_stream.Read(internalAsyncResult.Buffer, internalAsyncResult.Offset, internalAsyncResult.Count); + + internalAsyncResult.SetComplete(bytesReadIntoUserBuffer); + } + } + } + catch (Exception ex) + { + internalAsyncResult.SetComplete(ex); + } + } + + public override int EndRead(IAsyncResult asyncResult) + { + InternalAsyncResult internalAsyncResult = asyncResult as InternalAsyncResult; + if (internalAsyncResult == null) + { + throw new ArgumentException("AsyncResult was not obtained via BeginRead", "asyncResult"); + } + // Check to see if the operation is complete, if not -- let's wait for it + if (!internalAsyncResult.IsCompleted) + { + if (!internalAsyncResult.AsyncWaitHandle.WaitOne(WaitTimeOut, false)) + { + throw new IOException("Failed to complete read operation"); + } + } + + // If we completed with an error, throw the exceptions + if (internalAsyncResult.CompletedWithError) + { + throw internalAsyncResult.AsyncException; + } + + // Success, return the bytes read + return internalAsyncResult.BytesRead; + } + + //!! - not implmenting blocking Write, use BeginWrite with no callback + public override void Write(byte[] buffer, int offset, int count) + { + throw new NotImplementedException(); + } + /* + public override void Write(byte[] buffer, int offset, int count) + { + if (buffer == null) + { + throw new ArgumentNullException("buffer"); + } + if (offset < 0) + { + throw new ArgumentOutOfRangeException("offset", "Offset must be greater than or equal to 0"); + } + if (offset > buffer.Length) + { + throw new ArgumentOutOfRangeException("offset", "Offset is greater than length of the buffer"); + } + if (count < 0) + { + throw new ArgumentOutOfRangeException("count", "Count must be greater than 0"); + } + if (count > (buffer.Length - offset)) + { + throw new ArgumentOutOfRangeException("count", "Count is greater than buffer length - offset"); + } + + byte[] new_buffer = buffer; + if (offset != 0) + { + byte[] temp = new byte[count]; + Array.Copy(buffer, offset, temp, 0, count); + new_buffer = temp; + } + + int bytesWritten = ssl.Write(new_buffer, count); + if (bytesWritten <= 0) + { + SslError lastError = ssl.GetError(bytesWritten); + if (lastError == SslError.SSL_ERROR_WANT_READ) + { + //!!TODO - Log - unexpected renogiation request + } + throw new OpenSslException((uint)lastError); + } + uint bytesPending = write_bio.BytesPending; + while (bytesPending > 0) + { + ArraySegment buf = write_bio.ReadBytes((int)bytesPending); + innerStream.Write(buf.Array, 0, buf.Count); + bytesPending = write_bio.BytesPending; + } + } + */ + + public override IAsyncResult BeginWrite( + byte[] buffer, + int offset, + int count, + AsyncCallback asyncCallback, + Object asyncState) + { + if (buffer == null) + { + throw new ArgumentNullException("buffer", "buffer can't be null"); + } + if (offset < 0) + { + throw new ArgumentOutOfRangeException("offset", "offset less than 0"); + } + if (offset > buffer.Length) + { + throw new ArgumentOutOfRangeException("offset", "offset must be less than buffer length"); + } + if (count < 0) + { + throw new ArgumentOutOfRangeException("count", "count less than 0"); + } + if (count > (buffer.Length - offset)) + { + throw new ArgumentOutOfRangeException("count", "count is greater than buffer length - offset"); + } + + bool proceedAfterHandshake = true; + if (count == 0) proceedAfterHandshake = false; + + InternalAsyncResult asyncResult = new InternalAsyncResult(asyncCallback, asyncState, buffer, offset, count, true, proceedAfterHandshake); + + if (NeedHandshake) + { + //inHandshakeLoop = true; + // Start the handshake + BeginHandshake(asyncResult); + } + else + { + InternalBeginWrite(asyncResult); + } + + return asyncResult; + } + + private void InternalBeginWrite(InternalAsyncResult asyncResult) + { + byte[] new_buffer = asyncResult.Buffer; + + if (asyncResult.Offset != 0 && asyncResult.Count != 0) + { + new_buffer = new byte[asyncResult.Count]; + Array.Copy(asyncResult.Buffer, asyncResult.Offset, new_buffer, 0, asyncResult.Count); + } + + // Only write to the SSL object if we have data + if (asyncResult.Count != 0) + { + int bytesWritten = ssl.Write(new_buffer, asyncResult.Count); + if (bytesWritten < 0) + { + SslError lastError = ssl.GetError(bytesWritten); + if (lastError == SslError.SSL_ERROR_WANT_READ) + { + //!!TODO - Log - unexpected renogiation request + } + throw new OpenSslException(); + } + } + uint bytesPending = write_bio.BytesPending; + //!!while (bytesPending > 0) + { + ArraySegment buf = write_bio.ReadBytes((int)bytesPending); + innerStream.BeginWrite(buf.Array, 0, buf.Count, new AsyncCallback(InternalWriteCallback), asyncResult); + //!!bytesPending = write_bio.BytesPending; + } + } + + private void InternalWriteCallback(IAsyncResult asyncResult) + { + InternalAsyncResult internalAsyncResult = (InternalAsyncResult)asyncResult.AsyncState; + + try + { + innerStream.EndWrite(asyncResult); + internalAsyncResult.SetComplete(); + } + catch (Exception ex) + { + internalAsyncResult.SetComplete(ex); + } + } + + public override void EndWrite(IAsyncResult asyncResult) + { + InternalAsyncResult internalAsyncResult = asyncResult as InternalAsyncResult; + + if (internalAsyncResult == null) + { + throw new ArgumentException("AsyncResult object was not obtained from SslStream.BeginWrite", "asyncResult"); + } + + if (!internalAsyncResult.IsCompleted) + { + if (!internalAsyncResult.AsyncWaitHandle.WaitOne(WaitTimeOut, false)) + { + throw new IOException("Failed to complete the Write operation"); + } + } + + if (internalAsyncResult.CompletedWithError) + { + throw internalAsyncResult.AsyncException; + } + } + + private void RenegotiationWriteCallback(IAsyncResult asyncResult) + { + InternalAsyncResult readwriteAsyncResult = (InternalAsyncResult)asyncResult.AsyncState; + + innerStream.EndWrite(asyncResult); + + // Now start the read with the original asyncresult, as the ssl.Read will handle the renegoiation + InternalBeginRead(readwriteAsyncResult); + } + + /* + public abstract virtual bool ProcessRenegotiation(); + + private IAsyncResult BeginRenegotiate(InternalAsyncResult readwriteAsyncResult) + { + Console.WriteLine("BeginRenegotiate"); + + handShakeState = HandshakeState.Renegotiate; + + // Wrap the readwriteAsyncResult in the renegotiateAsyncResult + InternalAsyncResult renegotiateAsyncResult = new InternalAsyncResult(new AsyncCallback(RenegotiateComplete), readwriteAsyncResult, null, 0, 0, readwriteAsyncResult.IsWriteOperation, readwriteAsyncResult.ContinueAfterHandshake); + + if (ProcessRenegotiation()) + { + handShakeState = HandshakeState.Complete; + renegotiateAsyncResult.SetComplete(); + } + else + { + //!! if (readwriteAsyncResult.IsWriteOperation) + if (write_bio.BytesPending > 0) + { + renegotiateAsyncResult.IsWriteOperation = true; + BeginWrite(new byte[0], 0, 0, new AsyncCallback(RenegotiateCallback), renegotiateAsyncResult); + } + else + { + renegotiateAsyncResult.IsWriteOperation = false; + BeginRead(new byte[0], 0, 0, new AsyncCallback(RenegotiateCallback), renegotiateAsyncResult); + } + } + return renegotiateAsyncResult; + } + + private void RenegotiateCallback(IAsyncResult asyncResult) + { + InternalAsyncResult renegotiateAsyncResult = asyncResult.AsyncState as InternalAsyncResult; + } + */ + + private IAsyncResult BeginHandshake(InternalAsyncResult readwriteAsyncResult) + { + //!! + // Move the handshake state to the next state + //if (handShakeState == HandshakeState.Renegotiate) + //{ + // handShakeState = HandshakeState.RenegotiateInProcess; + //} + //else + if (handShakeState != HandshakeState.Renegotiate) + { + handShakeState = HandshakeState.InProcess; + } + + // Wrap the read/write InternalAsyncResult in the Handshake InternalAsyncResult instance + InternalAsyncResult handshakeAsyncResult = new InternalAsyncResult(new AsyncCallback(AsyncHandshakeComplete), readwriteAsyncResult, null, 0, 0, readwriteAsyncResult.IsWriteOperation, readwriteAsyncResult.ContinueAfterHandshake); + + if (ProcessHandshake()) + { + //inHandshakeLoop = false; + handShakeState = HandshakeState.Complete; + handshakeAsyncResult.SetComplete(); + } + else + { + //!! if (readwriteAsyncResult.IsWriteOperation) + if (write_bio.BytesPending > 0) + { + handshakeAsyncResult.IsWriteOperation = true; + BeginWrite(new byte[0], 0, 0, new AsyncCallback(AsyncHandshakeCallback), handshakeAsyncResult); + } + else + { + handshakeAsyncResult.IsWriteOperation = false; + BeginRead(new byte[0], 0, 0, new AsyncCallback(AsyncHandshakeCallback), handshakeAsyncResult); + } + } + return handshakeAsyncResult; + } + + private void AsyncHandshakeCallback(IAsyncResult asyncResult) + { + // Get the handshake internal result instance + InternalAsyncResult internalAsyncResult = (InternalAsyncResult)asyncResult.AsyncState; + int bytesRead = 0; + + if (internalAsyncResult.IsWriteOperation) + { + EndWrite(asyncResult); + // Check to see if the handshake is complete (this could have been + // the last response packet from the server. If so, we want to finalize + // the async operation and call the HandshakeComplete callback + if (handShakeState == HandshakeState.Complete) + { + internalAsyncResult.SetComplete(); + return; + } + // Check to see if we saved an exception from the last Handshake process call + // the if the client gets an error code, it needs to send the alert, and then + // throw the exception here. + if (handshakeException != null) + { + internalAsyncResult.SetComplete(handshakeException); + return; + } + // We wrote out the handshake data, now read to get the response + internalAsyncResult.IsWriteOperation = false; + BeginRead(new byte[0], 0, 0, new AsyncCallback(AsyncHandshakeCallback), internalAsyncResult); + } + else + { + try + { + bytesRead = EndRead(asyncResult); + if (bytesRead > 0) + { + if (ProcessHandshake()) + { + //inHandshakeLoop = false; + handShakeState = HandshakeState.Complete; + // We have completed the handshake, but need to send the + // last response packet. + if (write_bio.BytesPending > 0) + { + internalAsyncResult.IsWriteOperation = true; + BeginWrite(new byte[0], 0, 0, new AsyncCallback(AsyncHandshakeCallback), internalAsyncResult); + } + else + { + internalAsyncResult.SetComplete(); + return; + } + } + else + { + // Not complete with the handshake yet, write the handshake packet out + internalAsyncResult.IsWriteOperation = true; + BeginWrite(new byte[0], 0, 0, new AsyncCallback(AsyncHandshakeCallback), internalAsyncResult); + } + } + else + { + // Read read 0 bytes, the remote socket has been closed, so complete the operation + internalAsyncResult.SetComplete(new IOException("The remote stream has been closed")); + } + } + catch (Exception ex) + { + internalAsyncResult.SetComplete(ex); + } + } + } + + private void AsyncHandshakeComplete(IAsyncResult asyncResult) + { + EndHandshake(asyncResult); + } + + private void EndHandshake(IAsyncResult asyncResult) + { + InternalAsyncResult handshakeAsyncResult = asyncResult as InternalAsyncResult; + InternalAsyncResult readwriteAsyncResult = asyncResult.AsyncState as InternalAsyncResult; + + if (!handshakeAsyncResult.IsCompleted) + { + handshakeAsyncResult.AsyncWaitHandle.WaitOne(WaitTimeOut, false); + } + if (handshakeAsyncResult.CompletedWithError) + { + // if there's a handshake error, pass it to the read asyncresult instance + readwriteAsyncResult.SetComplete(handshakeAsyncResult.AsyncException); + return; + } + if (readwriteAsyncResult.ContinueAfterHandshake) + { + // We should continue the read/write operation since the handshake is complete + if (readwriteAsyncResult.IsWriteOperation) + { + InternalBeginWrite(readwriteAsyncResult); + } + else + { + InternalBeginRead(readwriteAsyncResult); + } + } + else + { + // If we aren't continuing, we're done + readwriteAsyncResult.SetComplete(); + } + } + + public override void Close() + { + //base.Close(); + if (ssl != null) + { + ssl.Dispose(); + ssl = null; + } + if (sslContext != null) + { + sslContext.Dispose(); + sslContext = null; + } + } + + #endregion + + /// + /// Renegotiate session keys - calls SSL_renegotiate + /// + public void Renegotiate() + { + if (ssl != null) + { + // Call the SSL_renegotiate to reset the SSL object state + // to start handshake + Native.ExpectSuccess(Native.SSL_renegotiate(ssl.Handle)); + handShakeState = HandshakeState.Renegotiate; + } + } + + #region IDisposable Members + + void IDisposable.Dispose() + { + if (!disposed) + { + } + } + + #endregion + + internal string GetCipherString(bool FIPSmode, SslProtocols sslProtocols, SslStrength sslStrength) + { + string str = ""; + + if (FIPSmode || ((sslStrength & SslStrength.High) == SslStrength.High)) + { + str = "HIGH"; + } + if (FIPSmode || ((sslStrength & SslStrength.Medium) == SslStrength.Medium)) + { + if (String.IsNullOrEmpty(str)) + { + str = "MEDIUM"; + } + else + { + str += ":MEDIUM"; + } + } + if (!FIPSmode && ((sslStrength & SslStrength.Low) == SslStrength.Low)) + { + if (String.IsNullOrEmpty(str)) + { + str = "LOW"; + } + else + { + str += ":LOW"; + } + } + if ((sslProtocols == SslProtocols.Default) || + (sslProtocols == SslProtocols.Tls) || + (sslProtocols == SslProtocols.Ssl3)) + { + if (String.IsNullOrEmpty(str)) + { + str = "!SSLv2"; + } + else + { + str += ":!SSLv2"; + } + } + if (FIPSmode) + { + str += ":AES:3DES:SHA:!DES:!MD5:!IDEA:!RC2:!RC4"; + } + + // Now format the return string + string cipherString = String.Format("{0}:!ADH:!aNULL:!eNULL:@STRENGTH", str); + return cipherString; + } + + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/SslStreamClient.cs b/dep/openssl/src/ManagedOpenSsl/SslStreamClient.cs new file mode 100644 index 00000000..e5264748 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/SslStreamClient.cs @@ -0,0 +1,266 @@ +// Copyright (c) 2009 Ben Henderson +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using OpenSSL.Core; +using OpenSSL.Crypto; +using OpenSSL.X509; + +namespace OpenSSL +{ + class SslStreamClient : SslStreamBase + { + string targetHost; + X509List clientCertificates; + X509Chain caCertificates; + // Internal callback for client certificate selection + protected ClientCertCallbackHandler internalCertificateSelectionCallback; + + // Internal callbacks for PSK + protected PskClientCallbackHandler internalPskClientCallback; + // Constructor to use for PSK + public SslStreamClient(Stream stream, + bool ownStream, + string targetHost, + string pskCiphers, + string pskIdentity, + byte[] pskPsk) + : base(stream, ownStream) + { + this.targetHost = targetHost; + this.pskCiphers = pskCiphers; + this.pskIdentity = pskIdentity; + this.pskPsk = pskPsk; + + this.internalPskClientCallback = new PskClientCallbackHandler(InternalPskClientCallback); + + InitializeClientContextUsingPsk(this.pskCiphers); + } + + public SslStreamClient(Stream stream, + bool ownStream, + string targetHost, + X509List clientCertificates, + X509Chain caCertificates, + SslProtocols enabledSslProtocols, + SslStrength sslStrength, + bool checkCertificateRevocation, + RemoteCertificateValidationHandler remoteCallback, + LocalCertificateSelectionHandler localCallback) + : base(stream, ownStream) + { + this.targetHost = targetHost; + this.clientCertificates = clientCertificates; + this.caCertificates = caCertificates; + this.checkCertificateRevocationStatus = checkCertificateRevocationStatus; + this.remoteCertificateSelectionCallback = remoteCallback; + this.localCertificateSelectionCallback = localCallback; + this.internalCertificateSelectionCallback = new ClientCertCallbackHandler(InternalClientCertificateSelectionCallback); + InitializeClientContext(clientCertificates, enabledSslProtocols, sslStrength, checkCertificateRevocation); + } + + protected void InitializeClientContext(X509List certificates, SslProtocols enabledSslProtocols, SslStrength sslStrength, bool checkCertificateRevocation) + { + // Initialize the context with the specified ssl version + // Initialize the context + sslContext = new SslContext(SslMethod.SSLv23_client_method); + + // Remove support for protocols not specified in the enabledSslProtocols + if ((enabledSslProtocols & SslProtocols.Ssl2) != SslProtocols.Ssl2) + { + sslContext.Options |= SslOptions.SSL_OP_NO_SSLv2; + } + if ((enabledSslProtocols & SslProtocols.Ssl3) != SslProtocols.Ssl3 && + ((enabledSslProtocols & SslProtocols.Default) != SslProtocols.Default)) + { + // no SSLv3 support + sslContext.Options |= SslOptions.SSL_OP_NO_SSLv3; + } + if ((enabledSslProtocols & SslProtocols.Tls) != SslProtocols.Tls && + (enabledSslProtocols & SslProtocols.Default) != SslProtocols.Default) + { + sslContext.Options |= SslOptions.SSL_OP_NO_TLSv1; + } + + // Set the Local certificate selection callback + sslContext.SetClientCertCallback(this.internalCertificateSelectionCallback); + // Set the enabled cipher list + sslContext.SetCipherList(GetCipherString(false, enabledSslProtocols, sslStrength)); + // Set the callbacks for remote cert verification and local cert selection + if (remoteCertificateSelectionCallback != null) + { + sslContext.SetVerify(VerifyMode.SSL_VERIFY_PEER | VerifyMode.SSL_VERIFY_FAIL_IF_NO_PEER_CERT, remoteCertificateSelectionCallback); + } + // Set the CA list into the store + if (caCertificates != null) + { + X509Store store = new X509Store(caCertificates); + sslContext.SetCertificateStore(store); + } + // Set up the read/write bio's + read_bio = BIO.MemoryBuffer(false); + write_bio = BIO.MemoryBuffer(false); + ssl = new Ssl(sslContext); + ssl.SetBIO(read_bio, write_bio); + read_bio.SetClose(BIO.CloseOption.Close); + write_bio.SetClose(BIO.CloseOption.Close); + // Set the Ssl object into Client mode + ssl.SetConnectState(); + } + + protected void InitializeClientContextUsingPsk(string pskCiphers) + { + // Initialize the context with the specified ssl version + //sslContext = new SslContext(SslMethod.SSLv23_client_method); + sslContext = new SslContext(SslMethod.TLSv1_client_method); + //sslContext = new SslContext(SslMethod.SSLv3_client_method); + + // Remove support for protocols that should not be supported + sslContext.Options |= SslOptions.SSL_OP_NO_SSLv2; + sslContext.Options |= SslOptions.SSL_OP_NO_SSLv3; + + // Set the enabled cipher list + // WARNING: Using PSK ciphers requires that the PSK callback be set and initialize the identity and psk value. + // Failure to do this will cause the PSK ciphers to be skipped when picking a shared cipher. + // The result will be an error because of "no shared ciphers". +// sslContext.SetCipherList("PSK-AES256-CBC-SHA:PSK-3DES-EDE-CBC-SHA:PSK-AES128-CBC-SHA:PSK-RC4-SHA"); + sslContext.SetCipherList(pskCiphers); + + // Set the PSK callbacks + sslContext.SetPskClientCallback(this.internalPskClientCallback); + + // Set up the read/write bio's + read_bio = BIO.MemoryBuffer(false); + write_bio = BIO.MemoryBuffer(false); + ssl = new Ssl(sslContext); + ssl.SetBIO(read_bio, write_bio); + read_bio.SetClose(BIO.CloseOption.Close); + write_bio.SetClose(BIO.CloseOption.Close); + ssl.SetConnectState(); + } + + internal protected override bool ProcessHandshake() + { + bool ret = false; + + // Check to see if we have an exception from the previous call + //!!if (handshakeException != null) + //!!{ + //!! throw handshakeException; + //!!} + + int nRet = 0; + if (handShakeState == HandshakeState.InProcess) + { + nRet = ssl.Connect(); + } + else if (handShakeState == HandshakeState.RenegotiateInProcess || + handShakeState == HandshakeState.Renegotiate) + { + handShakeState = HandshakeState.RenegotiateInProcess; + nRet = ssl.DoHandshake(); + } + if (nRet <= 0) + { + SslError lastError = ssl.GetError(nRet); + if (lastError == SslError.SSL_ERROR_WANT_READ) + { + // Do nothing -- the base stream will write the data from the bio + // when this call returns + } + else if (lastError == SslError.SSL_ERROR_WANT_WRITE) + { + // unexpected error + //!!TODO - debug log + } + else + { + // We should have alert data in the bio that needs to be written + // We'll save the exception, allow the write to start, and then throw the exception + // when we come back into the AsyncHandshakeCall + if (write_bio.BytesPending > 0) + { + handshakeException = new OpenSslException(); + } + else + { + throw new OpenSslException(); + } + } + } + else + { + // Successful handshake + ret = true; + } + return ret; + } + + public int InternalClientCertificateSelectionCallback(Ssl ssl, out X509Certificate x509_cert, out CryptoKey key) + { + int nRet = 0; + x509_cert = null; + key = null; + + Core.Stack name_stack = ssl.CAList; + string[] strIssuers = new string[name_stack.Count]; + int count = 0; + + foreach (X509Name name in name_stack) + { + strIssuers[count++] = name.OneLine; + } + + if (localCertificateSelectionCallback != null) + { + X509Certificate cert = localCertificateSelectionCallback(this, targetHost, clientCertificates, ssl.GetPeerCertificate(), strIssuers); + if (cert != null && cert.HasPrivateKey) + { + x509_cert = cert; + key = cert.PrivateKey; + // Addref the cert and private key + x509_cert.AddRef(); + key.AddRef(); + // return success + nRet = 1; + } + } + + return nRet; + } + + // PSK client callback + public int InternalPskClientCallback(Ssl ssl, String hint, out String identity, uint max_identity_len, out byte[] psk, uint max_psk_len) + { + identity = this.pskIdentity; + psk = this.pskPsk; + + return 1; // success + } + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/SslStreamServer.cs b/dep/openssl/src/ManagedOpenSsl/SslStreamServer.cs new file mode 100644 index 00000000..2bef28ef --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/SslStreamServer.cs @@ -0,0 +1,279 @@ +// Copyright (c) 2009 Ben Henderson +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using OpenSSL.Core; +using OpenSSL.X509; + +namespace OpenSSL +{ + class SslStreamServer : SslStreamBase + { + // Internal callbacks for PSK + protected PskServerCallbackHandler internalPskServerCallback; + + public SslStreamServer( + Stream stream, + bool ownStream, + X509Certificate serverCertificate, + bool clientCertificateRequired, + X509Chain caCerts, + SslProtocols enabledSslProtocols, + SslStrength sslStrength, + bool checkCertificateRevocation, + RemoteCertificateValidationHandler remote_callback) + : base(stream, ownStream) + { + this.checkCertificateRevocationStatus = checkCertificateRevocation; + this.remoteCertificateSelectionCallback = remote_callback; + + // Initialize the SslContext object + InitializeServerContext(serverCertificate, clientCertificateRequired, caCerts, enabledSslProtocols, sslStrength, checkCertificateRevocation); + + ssl = new Ssl(sslContext); + // Initialze the read/write bio + read_bio = BIO.MemoryBuffer(false); + write_bio = BIO.MemoryBuffer(false); + // Set the read/write bio's into the the Ssl object + ssl.SetBIO(read_bio, write_bio); + read_bio.SetClose(BIO.CloseOption.Close); + write_bio.SetClose(BIO.CloseOption.Close); + // Set the Ssl object into server mode + ssl.SetAcceptState(); + } + + public SslStreamServer( + Stream stream, + bool ownStream, + string pskCiphers, + byte[] pskPsk) + : base(stream, ownStream) + { + this.pskCiphers = pskCiphers; + this.pskPsk = pskPsk; + + this.internalPskServerCallback = new PskServerCallbackHandler(InternalPskServerCallback); + + // Initialize the SslContext object + InitializeServerContextUsingPsk(this.pskCiphers); + + // Initalize the Ssl object + ssl = new Ssl(sslContext); + // Initialze the read/write bio + read_bio = BIO.MemoryBuffer(false); + write_bio = BIO.MemoryBuffer(false); + // Set the read/write bio's into the the Ssl object + ssl.SetBIO(read_bio, write_bio); + read_bio.SetClose(BIO.CloseOption.Close); + write_bio.SetClose(BIO.CloseOption.Close); + // Set the Ssl object into server mode + ssl.SetAcceptState(); + } + + internal protected override bool ProcessHandshake() + { + bool bRet = false; + int nRet = 0; + + if (handShakeState == HandshakeState.InProcess) + { + nRet = ssl.Accept(); + } + else if (handShakeState == HandshakeState.RenegotiateInProcess) + { + nRet = ssl.DoHandshake(); + } + else if (handShakeState == HandshakeState.Renegotiate) + { + nRet = ssl.DoHandshake(); + ssl.State = Ssl.SSL_ST_ACCEPT; + handShakeState = HandshakeState.RenegotiateInProcess; + } + SslError lastError = ssl.GetError(nRet); + if (lastError == SslError.SSL_ERROR_WANT_READ || lastError == SslError.SSL_ERROR_WANT_WRITE || lastError == SslError.SSL_ERROR_NONE) + { + if (nRet == 1) // success + { + bRet = true; + } + } + else + { + // Check to see if we have alert data in the write_bio that needs to be sent + if (write_bio.BytesPending > 0) + { + // We encountered an error, but need to send the alert + // set the handshakeException so that it will be processed + // and thrown after the alert is sent + handshakeException = new OpenSslException(); + } + else + { + // No alert to send, throw the exception + throw new OpenSslException(); + } + } + return bRet; + } + + private void InitializeServerContext( + X509Certificate serverCertificate, + bool clientCertificateRequired, + X509Chain caCerts, + SslProtocols enabledSslProtocols, + SslStrength sslStrength, + bool checkCertificateRevocation) + { + if (serverCertificate == null) + { + throw new ArgumentNullException("serverCertificate", "Server certificate cannot be null"); + } + if (!serverCertificate.HasPrivateKey) + { + throw new ArgumentException("Server certificate must have a private key", "serverCertificate"); + } + + // Initialize the context + sslContext = new SslContext(SslMethod.SSLv23_server_method); + + // Remove support for protocols not specified in the enabledSslProtocols + if ((enabledSslProtocols & SslProtocols.Ssl2) != SslProtocols.Ssl2) + { + sslContext.Options |= SslOptions.SSL_OP_NO_SSLv2; + } + if ((enabledSslProtocols & SslProtocols.Ssl3) != SslProtocols.Ssl3 && + ((enabledSslProtocols & SslProtocols.Default) != SslProtocols.Default)) + { + // no SSLv3 support + sslContext.Options |= SslOptions.SSL_OP_NO_SSLv3; + } + if ((enabledSslProtocols & SslProtocols.Tls) != SslProtocols.Tls && + (enabledSslProtocols & SslProtocols.Default) != SslProtocols.Default) + { + sslContext.Options |= SslOptions.SSL_OP_NO_TLSv1; + } + /* + // Initialize the context with the specified ssl version + switch (enabledSslProtocols) + { + case SslProtocols.None: + throw new ArgumentException("SslProtocol.None is not supported", "enabledSslProtocols"); + break; + case SslProtocols.Ssl2: + sslContext = new SslContext(SslMethod.SSLv2_server_method); + break; + case SslProtocols.Ssl3: + case SslProtocols.Default: + sslContext = new SslContext(SslMethod.SSLv3_server_method); + break; + case SslProtocols.Tls: + sslContext = new SslContext(SslMethod.TLSv1_server_method); + break; + } + */ + // Set the context mode + sslContext.Mode = SslMode.SSL_MODE_AUTO_RETRY; + // Set the workaround options + sslContext.Options = SslOptions.SSL_OP_ALL; + // Set the client certificate verification callback if we are requiring client certs + if (clientCertificateRequired) + { + sslContext.SetVerify(VerifyMode.SSL_VERIFY_PEER | VerifyMode.SSL_VERIFY_FAIL_IF_NO_PEER_CERT, remoteCertificateSelectionCallback); + } + else + { + sslContext.SetVerify(VerifyMode.SSL_VERIFY_NONE, null); + } + + // Set the client certificate max verification depth + sslContext.SetVerifyDepth(10); + // Set the certificate store and ca list + if (caCerts != null) + { + // Don't take ownership of the X509Store IntPtr. When we + // SetCertificateStore, the context takes ownership of the store pointer. + X509Store cert_store = new X509Store(caCerts, false); + sslContext.SetCertificateStore(cert_store); + Core.Stack name_stack = new Core.Stack(); + foreach (X509Certificate cert in caCerts) + { + X509Name subject = cert.Subject; + name_stack.Add(subject); + } + // Assign the stack to the context + sslContext.CAList = name_stack; + } + // Set the cipher string + sslContext.SetCipherList(GetCipherString(false, enabledSslProtocols, sslStrength)); + // Set the certificate + sslContext.UseCertificate(serverCertificate); + // Set the private key + sslContext.UsePrivateKey(serverCertificate.PrivateKey); + // Set the session id context + sslContext.SetSessionIdContext(Encoding.ASCII.GetBytes(AppDomain.CurrentDomain.FriendlyName)); + } + private void InitializeServerContextUsingPsk(string pskCiphers) + { + // Initialize the context + //sslContext = new SslContext(SslMethod.SSLv23_server_method); + sslContext = new SslContext(SslMethod.TLSv1_server_method); + //sslContext = new SslContext(SslMethod.SSLv3_server_method); + + // Remove support for protocols that should not be supported + sslContext.Options |= SslOptions.SSL_OP_NO_SSLv2; + sslContext.Options |= SslOptions.SSL_OP_NO_SSLv3; + + // Set the context mode + sslContext.Mode = SslMode.SSL_MODE_AUTO_RETRY; + // Set the workaround options + sslContext.Options = SslOptions.SSL_OP_ALL; + sslContext.SetVerify(VerifyMode.SSL_VERIFY_NONE, null); + + // Set the cipher string + // WARNING: Using PSK ciphers requires that the PSK callback be set and initialize the identity and psk value. + // Failure to do this will cause the PSK ciphers to be skipped when picking a shared cipher. + // The result will be an error because of "no shared ciphers". +// sslContext.SetCipherList("PSK-AES256-CBC-SHA:PSK-3DES-EDE-CBC-SHA:PSK-AES128-CBC-SHA:PSK-RC4-SHA"); + sslContext.SetCipherList(pskCiphers); + + // Set the session id context + sslContext.SetSessionIdContext(Encoding.ASCII.GetBytes(AppDomain.CurrentDomain.FriendlyName)); + + // Set the PSK callbacks + sslContext.SetPskServerCallback(this.internalPskServerCallback); + } + + // PSK client callback + public int InternalPskServerCallback(Ssl ssl, String identity, out byte[] psk, uint max_psk_len) + { + psk = this.pskPsk; + + return 1; // success + } + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/VerifyResult.cs b/dep/openssl/src/ManagedOpenSsl/VerifyResult.cs new file mode 100644 index 00000000..6a6f84b4 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/VerifyResult.cs @@ -0,0 +1,207 @@ +// Copyright (c) 2009 Ben Henderson +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenSSL +{ + /// + /// X509_V_* + /// + public enum VerifyResult + { + /// + /// X509_V_OK + /// + X509_V_OK = 0, + /* illegal error (for uninitialized values, to avoid X509_V_OK): 1 */ + /// + /// X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT + /// + X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT = 2, + /// + /// X509_V_ERR_UNABLE_TO_GET_CRL + /// + X509_V_ERR_UNABLE_TO_GET_CRL = 3, + /// + /// X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE + /// + X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE = 4, + /// + /// X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE + /// + X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE = 5, + /// + /// X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY + /// + X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY = 6, + /// + /// X509_V_ERR_CERT_SIGNATURE_FAILURE + /// + X509_V_ERR_CERT_SIGNATURE_FAILURE = 7, + /// + /// X509_V_ERR_CRL_SIGNATURE_FAILURE + /// + X509_V_ERR_CRL_SIGNATURE_FAILURE = 8, + /// + /// X509_V_ERR_CERT_NOT_YET_VALID + /// + X509_V_ERR_CERT_NOT_YET_VALID = 9, + /// + /// X509_V_ERR_CERT_HAS_EXPIRED + /// + X509_V_ERR_CERT_HAS_EXPIRED = 10, + /// + /// X509_V_ERR_CRL_NOT_YET_VALID + /// + X509_V_ERR_CRL_NOT_YET_VALID = 11, + /// + /// X509_V_ERR_CRL_HAS_EXPIRED + /// + X509_V_ERR_CRL_HAS_EXPIRED = 12, + /// + /// X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD + /// + X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD = 13, + /// + /// X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD + /// + X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD = 14, + /// + /// X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD + /// + X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD = 15, + /// + /// X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD + /// + X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD = 16, + /// + /// X509_V_ERR_OUT_OF_MEM + /// + X509_V_ERR_OUT_OF_MEM = 17, + /// + /// X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT + /// + X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT = 18, + /// + /// X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN + /// + X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN = 19, + /// + /// X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY + /// + X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY = 20, + /// + /// X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE + /// + X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE = 21, + /// + /// X509_V_ERR_CERT_CHAIN_TOO_LONG + /// + X509_V_ERR_CERT_CHAIN_TOO_LONG = 22, + /// + /// X509_V_ERR_CERT_REVOKED + /// + X509_V_ERR_CERT_REVOKED = 23, + /// + /// X509_V_ERR_INVALID_CA + /// + X509_V_ERR_INVALID_CA = 24, + /// + /// X509_V_ERR_PATH_LENGTH_EXCEEDED + /// + X509_V_ERR_PATH_LENGTH_EXCEEDED = 25, + /// + /// X509_V_ERR_INVALID_PURPOSE + /// + X509_V_ERR_INVALID_PURPOSE = 26, + /// + /// X509_V_ERR_CERT_UNTRUSTED + /// + X509_V_ERR_CERT_UNTRUSTED = 27, + /// + /// X509_V_ERR_CERT_REJECTED + /// + X509_V_ERR_CERT_REJECTED = 28, + + /* These are 'informational' when looking for issuer cert */ + /// + /// X509_V_ERR_SUBJECT_ISSUER_MISMATCH + /// + X509_V_ERR_SUBJECT_ISSUER_MISMATCH = 29, + /// + /// X509_V_ERR_AKID_SKID_MISMATCH + /// + X509_V_ERR_AKID_SKID_MISMATCH = 30, + /// + /// X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH + /// + X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH = 31, + /// + /// X509_V_ERR_KEYUSAGE_NO_CERTSIGN + /// + X509_V_ERR_KEYUSAGE_NO_CERTSIGN = 32, + + /// + /// X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER + /// + X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER = 33, + /// + /// X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION + /// + X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION = 34, + /// + /// X509_V_ERR_KEYUSAGE_NO_CRL_SIGN + /// + X509_V_ERR_KEYUSAGE_NO_CRL_SIGN = 35, + /// + /// X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION + /// + X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION = 36, + /// + /// X509_V_ERR_INVALID_NON_CA + /// + X509_V_ERR_INVALID_NON_CA = 37, + /// + /// X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED + /// + X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED = 38, + /// + /// X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE + /// + X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE = 39, + /// + /// X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED + /// + X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED = 40, + /// + /// X509_V_ERR_APPLICATION_VERIFICATION + /// + X509_V_ERR_APPLICATION_VERIFICATION = 50 + } + +} diff --git a/dep/openssl/src/ManagedOpenSsl/X509/Configuration.cs b/dep/openssl/src/ManagedOpenSsl/X509/Configuration.cs new file mode 100644 index 00000000..7e2c6402 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/X509/Configuration.cs @@ -0,0 +1,198 @@ +// Copyright (c) 2006-2007 Frank Laub +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using OpenSSL.Core; + +namespace OpenSSL.X509 +{ + #region X509v3Context + + /// + /// Wraps X509V3_CTX + /// + class X509V3Context : Base + { + #region X509V3_CTX + [StructLayout(LayoutKind.Sequential)] + struct X509V3_CTX + { + public int flags; + public IntPtr issuer_cert; + public IntPtr subject_cert; + public IntPtr subject_req; + public IntPtr crl; + public IntPtr db_meth; + public IntPtr db; + } + #endregion + + #region Initialization + + /// + /// Calls OPENSSL_malloc() + /// + private X509V3Context() + : base(Native.OPENSSL_malloc(Marshal.SizeOf(typeof(X509V3_CTX))), true) + { } + + /// + /// Calls X509V3_set_ctx() + /// + /// + /// + /// + public X509V3Context(X509Certificate issuer, X509Certificate subject, X509Request request) + : this() + { + Native.X509V3_set_ctx( + this.ptr, + issuer != null ? issuer.Handle : IntPtr.Zero, + subject != null ? subject.Handle : IntPtr.Zero, + request != null ? request.Handle : IntPtr.Zero, + IntPtr.Zero, + 0); + } + + #endregion + + #region Methods + + /// + /// X509V3_set_ctx_nodb - sets the db pointer to NULL + /// + public void SetNoDB() + { + int db_offset = (int)Marshal.OffsetOf(typeof(X509V3_CTX), "db"); + IntPtr db_param = new IntPtr((int)this.ptr + db_offset); + Marshal.WriteIntPtr(db_param, IntPtr.Zero); + } + + /// + /// Calls X509V3_set_nconf() + /// + /// + public void SetConfiguration(Configuration cfg) + { + Native.X509V3_set_nconf(this.ptr, cfg.Handle); + } + + #endregion + + #region Overrides + + /// + /// Calls OPENSSL_free() + /// + protected override void OnDispose() + { + Native.OPENSSL_free(this.ptr); + } + + #endregion + } + #endregion + + /// + /// Wraps the NCONF_* functions + /// + public class Configuration : Base + { + #region Initialization + + /// + /// Calls NCONF_new() + /// + private Configuration() + : base(Native.NCONF_new(IntPtr.Zero), true) + { } + + /// + /// Calls NCONF_load() + /// + /// + public Configuration(string filename) + : this() + { + this.Load(filename); + } + + #endregion + + #region Methods + + /// + /// Calls NCONF_load() + /// + /// + public void Load(string filename) + { + int eline = 0; + Native.ExpectSuccess(Native.NCONF_load(this.ptr, filename, ref eline)); + } + + /// + /// Creates a X509v3Context(), calls X509V3_set_ctx() on it, then calls + /// X509V3_EXT_add_nconf() + /// + /// + /// + /// + /// + public void ApplyExtensions( + string section, + X509Certificate issuer, + X509Certificate subject, + X509Request request) + { + using (X509V3Context ctx = new X509V3Context(issuer, subject, request)) + { + ctx.SetConfiguration(this); + Native.ExpectSuccess(Native.X509V3_EXT_add_nconf( + this.ptr, + ctx.Handle, + Encoding.ASCII.GetBytes(section), + subject.Handle)); + } + } + + #endregion + + #region Overrides + + /// + /// Calls NCONF_free() + /// + protected override void OnDispose() + { + Native.NCONF_free(this.ptr); + } + + #endregion + } +} \ No newline at end of file diff --git a/dep/openssl/src/ManagedOpenSsl/X509/Identity.cs b/dep/openssl/src/ManagedOpenSsl/X509/Identity.cs new file mode 100644 index 00000000..2b980e2d --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/X509/Identity.cs @@ -0,0 +1,119 @@ +// Copyright (c) 2006-2007 Frank Laub +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using OpenSSL.Crypto; + +namespace OpenSSL.X509 +{ + /// + /// Simple encapsulation of a local identity. + /// This includes the private key and the X509Certificate. + /// + public class Identity + { + private CryptoKey key; + private X509Certificate cert; + + /// + /// Construct an Identity with a private key + /// + /// + public Identity(CryptoKey key) + { + this.key = key; + } + + #region Properties + + /// + /// Returns the embedded public key of the X509Certificate + /// + public CryptoKey PublicKey + { + get { return this.cert.PublicKey; } + } + + /// + /// Returns the private key + /// + public CryptoKey PrivateKey + { + get { return this.key; } + } + + /// + /// Returns the X509Certificate + /// + public X509Certificate Certificate + { + get { return this.cert; } + } + #endregion + + #region Methods + /// + /// Create a X509Request for this identity, using the specified name. + /// + /// + /// + public X509Request CreateRequest(string name) + { + return CreateRequest(name, MessageDigest.DSS1); + } + + /// + /// Create a X509Request for this identity, using the specified name and digest. + /// + /// + /// + /// + public X509Request CreateRequest(string name, MessageDigest digest) + { + X509Name subject = new X509Name(name); + X509Request request = new X509Request(2, subject, this.key); + + request.Sign(key, digest); + + return request; + } + + /// + /// Verify that the specified chain can be trusted. + /// + /// + /// + /// + public bool VerifyResponse(X509Chain chain, out string error) + { + this.cert = chain[0]; + X509Store store = new X509Store(chain); + return store.Verify(cert, out error); + } + #endregion + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/X509/PKCS12.cs b/dep/openssl/src/ManagedOpenSsl/X509/PKCS12.cs new file mode 100644 index 00000000..3a3ee84b --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/X509/PKCS12.cs @@ -0,0 +1,283 @@ +// Copyright (c) 2009-2011 Frank Laub +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Text; +using System.Runtime.InteropServices; +using OpenSSL.Core; +using OpenSSL.Crypto; + +namespace OpenSSL.X509 +{ + /// + /// Wraps PCKS12_* + /// + public class PKCS12 : Base + { + #region PKCS12 structure + + [StructLayout(LayoutKind.Sequential)] + struct _PKCS12 + { + IntPtr version; //ASN1_INTEGER *version; + IntPtr mac; //PKCS12_MAC_DATA *mac; + IntPtr authsafes; //PKCS7 *authsafes; + } + #endregion + + /// + /// Password-Based Encryption (from PKCS #5) + /// + public enum PBE + { + /// + /// + /// + Default = 0, + /// + /// NID_pbeWithMD2AndDES_CBC + /// + MD2_DES = 9, + /// + /// NID_pbeWithMD5AndDES_CBC + /// + MD5_DES = 10, + /// + /// NID_pbeWithMD2AndRC2_CBC + /// + MD2_RC2_64 = 168, + /// + /// NID_pbeWithMD5AndRC2_CBC + /// + MD5_RC2_64 = 169, + /// + /// NID_pbeWithSHA1AndDES_CBC + /// + SHA1_DES = 170, + /// + /// NID_pbeWithSHA1AndRC2_CBC + /// + SHA1_RC2_64 = 68, + /// + /// NID_pbe_WithSHA1And128BitRC4 + /// + SHA1_RC4_128 = 144, + /// + /// NID_pbe_WithSHA1And40BitRC4 + /// + SHA1_RC4_40 = 145, + /// + /// NID_pbe_WithSHA1And3_Key_TripleDES_CBC + /// + SHA1_3DES = 146, + /// + /// NID_pbe_WithSHA1And2_Key_TripleDES_CBC + /// + SHA1_2DES = 147, + /// + /// NID_pbe_WithSHA1And128BitRC2_CBC + /// + SHA1_RC2_128 = 148, + /// + /// NID_pbe_WithSHA1And40BitRC2_CBC + /// + SHA1_RC2_40 = 149 + } + + #region Initialization + + /// + /// Calls PKCS12_create() + /// + /// + /// + /// + /// + public PKCS12(string password, CryptoKey key, X509Certificate cert, Stack ca) : + base(Create(password, null, key, cert, ca, PBE.Default, PBE.Default, 0), true) { + Init(password); + } + + /// + /// Calls PKCS12_create() with more options + /// + /// + /// friendly name + /// + /// + /// + /// How to encrypt the key + /// How to encrypt the certificate + /// # of iterations during encryption + public PKCS12(string password, string name, CryptoKey key, X509Certificate cert, Stack ca, PBE keyPbe, PBE certPbe, int iterations) : + base(Create(password, name, key, cert, ca, keyPbe, certPbe, iterations), true) { + Init(password); + } + + private static IntPtr Create( + string password, + string name, + CryptoKey key, + X509Certificate cert, + Stack ca, + PBE keyType, + PBE certType, + int iterations) { + return Native.ExpectNonNull(Native.PKCS12_create( + password, + name, + key.Handle, + cert.Handle, + ca.Handle, + (int)keyType, + (int)certType, + iterations, + 1, + (int)key.Type)); + } + + /// + /// Calls d2i_PKCS12_bio() and then PKCS12_parse() + /// + /// + /// + public PKCS12(BIO bio, string password) + : base(Native.ExpectNonNull(Native.d2i_PKCS12_bio(bio.Handle, IntPtr.Zero)), true) { + Init(password); + } + + private void Init(string password) { + IntPtr cert; + IntPtr pkey; + IntPtr cacerts; + + // Parse the PKCS12 object and get privatekey, cert, cacerts if available + Native.ExpectSuccess(Native.PKCS12_parse(this.ptr, password, out pkey, out cert, out cacerts)); + + if (cert != IntPtr.Zero) { + this.certificate = new X509Certificate(cert, true); + if (pkey != IntPtr.Zero) { + this.privateKey = new CryptoKey(pkey, true); + + // We have a private key, assign it to the cert + this.certificate.PrivateKey = this.privateKey.CopyRef(); + } + } + + if (cacerts != IntPtr.Zero) { + this.caCertificates = new Stack(cacerts, true); + } + else { + this.caCertificates = new Stack(); + } + } + + #endregion + + /// + /// Calls i2d_PKCS12_bio() + /// + /// + public void Write(BIO bio) { + Native.ExpectSuccess(Native.i2d_PKCS12_bio(bio.Handle, this.Handle)); + } + + #region Properties + + /// + /// Returns the Certificate, with the PrivateKey attached if there is one. + /// + public X509Certificate Certificate + { + get + { + if (certificate != null) + { + X509Certificate cert = this.certificate.CopyRef(); + if (privateKey != null) + cert.PrivateKey = this.privateKey.CopyRef(); + return cert; + } + return null; + } + } + + /// + /// Returns the PrivateKey + /// + public CryptoKey PrivateKey + { + get + { + if (privateKey != null) + return this.privateKey.CopyRef(); + return null; + } + } + + /// + /// Returns a stack of CA Certificates + /// + public Stack CACertificates + { + get { return caCertificates; } + } + + #endregion + + #region Overrides + + /// + /// Calls PKCS12_free() + /// + protected override void OnDispose() + { + if (certificate != null) + { + certificate.Dispose(); + certificate = null; + } + if (privateKey != null) + { + privateKey.Dispose(); + privateKey = null; + } + if (caCertificates != null) + { + caCertificates.Dispose(); + caCertificates = null; + } + Native.PKCS12_free(this.ptr); + } + + #endregion + + #region Fields + private CryptoKey privateKey; + private X509Certificate certificate; + private Stack caCertificates; + #endregion + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/X509/PKCS7.cs b/dep/openssl/src/ManagedOpenSsl/X509/PKCS7.cs new file mode 100644 index 00000000..84332db1 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/X509/PKCS7.cs @@ -0,0 +1,197 @@ +// Copyright (c) 2009 Frank Laub +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using OpenSSL.Core; + +namespace OpenSSL.X509 +{ + /// + /// Wraps PKCS7 + /// + public class PKCS7 : Base + { + #region PKCS7 structures + const int NID_pkcs7_signed = 22; // from obj_mac.h + const int NID_pkcs7_signedAndEnveloped = 24; // from obj_mac.h + + // State definitions + const int PKCS7_S_HEADER = 0; + const int PKCS7_S_BODY = 1; + const int PKCS7_S_TAIL = 2; + + [StructLayout(LayoutKind.Sequential)] + private struct _PKCS7 + { + /* The following is non NULL if it contains ASN1 encoding of + * this structure */ + public IntPtr asn1; //unsigned char *asn1; + public int length; //long length; + public int state; /* used during processing */ + public int detached; + public IntPtr type; //ASN1_OBJECT *type; + /* content as defined by the type */ + /* all encryption/message digests are applied to the 'contents', + * leaving out the 'type' field. */ + public IntPtr ptr; //char *ptr; + } + + [StructLayout(LayoutKind.Sequential)] + private struct PKCS7_SIGNED + { + public IntPtr version; //ASN1_INTEGER *version; /* version 1 */ + public IntPtr md_algs; //STACK_OF(X509_ALGOR) *md_algs; /* md used */ + public IntPtr cert; //STACK_OF(X509) *cert; /* [ 0 ] */ + public IntPtr crl; //STACK_OF(X509_CRL) *crl; /* [ 1 ] */ + public IntPtr signer_info; //STACK_OF(PKCS7_SIGNER_INFO) *signer_info; + public IntPtr contents; //struct pkcs7_st *contents; + } + + [StructLayout(LayoutKind.Sequential)] + private struct PKCS7_SIGN_ENVELOPE + { + public IntPtr version; //ASN1_INTEGER *version; /* version 1 */ + public IntPtr md_algs; //STACK_OF(X509_ALGOR) *md_algs; /* md used */ + public IntPtr cert; //STACK_OF(X509) *cert; /* [ 0 ] */ + public IntPtr crl; //STACK_OF(X509_CRL) *crl; /* [ 1 ] */ + public IntPtr signer_info; //STACK_OF(PKCS7_SIGNER_INFO) *signer_info; + public IntPtr enc_data; //PKCS7_ENC_CONTENT *enc_data; + public IntPtr recipientinfo; //STACK_OF(PKCS7_RECIP_INFO) *recipientinfo; + } + + #endregion + + #region Initialization + + private PKCS7(IntPtr ptr) + : base(ptr, true) + { } + + /// + /// Calls d2i_PKCS7_bio() + /// + /// + /// + public static PKCS7 FromDER(BIO bio) + { + return new PKCS7(Native.ExpectNonNull(Native.d2i_PKCS7_bio(bio.Handle, IntPtr.Zero))); + } + + /// + /// Calls PEM_read_bio_PKCS7() + /// + /// + /// + public static PKCS7 FromPEM(BIO bio) + { + return new PKCS7(Native.ExpectNonNull(Native.PEM_read_bio_PKCS7(bio.Handle, IntPtr.Zero, null, IntPtr.Zero))); + } + + #endregion + + #region Properties + + /// + /// Extracts the X509Chain of certifcates from the internal PKCS7 structure + /// + public X509Chain Certificates + { + get + { + if (this.stack == null) + { + int type = Native.OBJ_obj2nid(this.raw.type); + switch (type) + { + case NID_pkcs7_signed: + this.stack = GetStackFromSigned(); + break; + case NID_pkcs7_signedAndEnveloped: + this.stack = GetStackFromSignedAndEnveloped(); + break; + default: + throw new NotSupportedException(); + } + } + + // Can we remove this and just use a Chain to begin with? + X509Chain chain = null; + if (this.stack != null) + { + chain = new X509Chain(); + // We have a stack of certificates, build the chain object and return + foreach (X509Certificate cert in this.stack) + { + chain.Add(cert); + } + } + return chain; + } + } + + #endregion + + #region Helpers + + private Core.Stack GetStackFromSigned() + { + PKCS7_SIGNED signed = (PKCS7_SIGNED)Marshal.PtrToStructure(raw.ptr, typeof(PKCS7_SIGNED)); + return new Core.Stack(signed.cert, false); + } + + private Core.Stack GetStackFromSignedAndEnveloped() + { + PKCS7_SIGN_ENVELOPE envelope = (PKCS7_SIGN_ENVELOPE)Marshal.PtrToStructure(raw.ptr, typeof(PKCS7_SIGN_ENVELOPE)); + return new Core.Stack(envelope.cert, false); + } + + #endregion + + #region Overrides + + /// + /// Calls PKCS7_free() + /// + protected override void OnDispose() + { + Native.PKCS7_free(this.ptr); + } + + internal override void OnNewHandle(IntPtr ptr) + { + this.raw = (_PKCS7)Marshal.PtrToStructure(ptr, typeof(_PKCS7)); + } + + #endregion + + #region Fields + private _PKCS7 raw; + private Core.Stack stack; + #endregion + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/X509/X509Certificate.cs b/dep/openssl/src/ManagedOpenSsl/X509/X509Certificate.cs new file mode 100644 index 00000000..48933340 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/X509/X509Certificate.cs @@ -0,0 +1,613 @@ +// Copyright (c) 2006-2010 Frank Laub +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using OpenSSL.Core; +using OpenSSL.Crypto; + +namespace OpenSSL.X509 +{ + /// + /// Wraps the X509 object + /// + public class X509Certificate : BaseCopyableRef, IComparable, IStackable + { + #region Initialization + internal X509Certificate(IStack stack, IntPtr ptr) + : base(ptr, true) + { } + + internal X509Certificate(IntPtr ptr, bool owner) + : base(ptr, owner) + { } + + /// + /// Calls X509_new() + /// + public X509Certificate() + : base(Native.ExpectNonNull(Native.X509_new()), true) + { } + + /// + /// Calls PEM_read_bio_X509() + /// + /// + public X509Certificate(BIO bio) + : base(Native.ExpectNonNull(Native.PEM_read_bio_X509(bio.Handle, IntPtr.Zero, null, IntPtr.Zero)), true) + { } + + /// + /// Factory method that returns a X509 using d2i_X509_bio() + /// + /// + /// + public static X509Certificate FromDER(BIO bio) + { + IntPtr pX509 = IntPtr.Zero; + IntPtr ptr = Native.ExpectNonNull(Native.d2i_X509_bio(bio.Handle, ref pX509)); + return new X509Certificate(ptr, true); + } + + /// + /// Factory method to create a X509Certificate from a PKCS7 encoded in PEM + /// + /// + /// + public static X509Certificate FromPKCS7_PEM(BIO bio) + { + PKCS7 pkcs7 = PKCS7.FromPEM(bio); + X509Chain chain = pkcs7.Certificates; + if (chain != null && chain.Count > 0) + { + return new X509Certificate(chain[0].Handle, false); + } + else + { + throw new OpenSslException(); + } + } + + /// + /// Factory method to create a X509Certificate from a PKCS7 encoded in DER + /// + /// + /// + public static X509Certificate FromPKCS7_DER(BIO bio) + { + PKCS7 pkcs7 = PKCS7.FromDER(bio); + X509Chain chain = pkcs7.Certificates; + if (chain != null && chain.Count > 0) + { + return new X509Certificate(chain[0].Handle, false); + } + return null; + } + + /// + /// Factory method to create a X509Certificate from a PKCS12 + /// + /// + /// + /// + public static X509Certificate FromPKCS12(BIO bio, string password) + { + using (PKCS12 p12 = new PKCS12(bio, password)) + { + return p12.Certificate; + } + } + + /// + /// Creates a new X509 certificate + /// + /// + /// + /// + /// + /// + /// + public X509Certificate( + int serial, + X509Name subject, + X509Name issuer, + CryptoKey pubkey, + DateTime start, + DateTime end) + : this() + { + this.Version = 2; + this.SerialNumber = serial; + this.Subject = subject; + this.Issuer = issuer; + this.PublicKey = pubkey; + this.NotBefore = start; + this.NotAfter = end; + } + + #endregion + + #region Raw Structures + + #region X509_VAL + [StructLayout(LayoutKind.Sequential)] + private struct X509_VAL + { + public IntPtr notBefore; + public IntPtr notAfter; + } + #endregion + + #region X509_CINF + [StructLayout(LayoutKind.Sequential)] + private struct X509_CINF + { + public IntPtr version; + public IntPtr serialNumber; + public IntPtr signature; + public IntPtr issuer; + public IntPtr validity; + public IntPtr subject; + public IntPtr key; + public IntPtr issuerUID; + public IntPtr subjectUID; + public IntPtr extensions; + } + #endregion + + #region X509 + [StructLayout(LayoutKind.Sequential)] + private struct X509 + { + public IntPtr cert_info; + public IntPtr sig_alg; + public IntPtr signature; + public int valid; + public int references; + public IntPtr name; + #region CRYPTO_EX_DATA ex_data + public IntPtr ex_data_sk; + public int ex_data_dummy; + #endregion + public int ex_pathlen; + public int ex_pcpathlen; + public uint ex_flags; + public uint ex_kusage; + public uint ex_xkusage; + public uint ex_nscert; + public IntPtr skid; + public IntPtr akid; + public IntPtr policy_cache; + public IntPtr rfc3779_addr; + public IntPtr rfc3779_asid; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Native.SHA_DIGEST_LENGTH)] + public byte[] sha1_hash; + public IntPtr aux; + } + #endregion + + #endregion + + #region Properties + private X509 Raw + { + get { return (X509)Marshal.PtrToStructure(this.ptr, typeof(X509)); } + } + + private X509_CINF RawCertInfo + { + get { return (X509_CINF)Marshal.PtrToStructure(this.Raw.cert_info, typeof(X509_CINF)); } + } + + private X509_VAL RawValidity + { + get { return (X509_VAL)Marshal.PtrToStructure(this.RawCertInfo.validity, typeof(X509_VAL)); } + } + + /// + /// Uses X509_get_subject_name() and X509_set_issuer_name() + /// + public X509Name Subject + { + get + { + // Get the native pointer for the subject name + IntPtr name_ptr = Native.ExpectNonNull(Native.X509_get_subject_name(this.ptr)); + X509Name ret = new X509Name(name_ptr, true); + // Duplicate the native pointer, as the X509_get_subject_name returns a pointer + // that is owned by the X509 object + ret.AddRef(); + return ret; + } + set { Native.ExpectSuccess(Native.X509_set_subject_name(this.ptr, value.Handle)); } + } + + /// + /// Uses X509_get_issuer_name() and X509_set_issuer_name() + /// + public X509Name Issuer + { + get + { + IntPtr name_ptr = Native.ExpectNonNull(Native.X509_get_issuer_name(this.ptr)); + X509Name name = new X509Name(name_ptr, true); + name.AddRef(); + return name; + } + set { Native.ExpectSuccess(Native.X509_set_issuer_name(this.ptr, value.Handle)); } + } + + /// + /// Uses X509_get_serialNumber() and X509_set_serialNumber() + /// + public int SerialNumber + { + get { return Asn1Integer.ToInt32(Native.X509_get_serialNumber(this.ptr)); } + set + { + using (Asn1Integer asnInt = new Asn1Integer(value)) + { + Native.ExpectSuccess(Native.X509_set_serialNumber(this.ptr, asnInt.Handle)); + } + } + } + + /// + /// Uses the notBefore field and X509_set_notBefore() + /// + public DateTime NotBefore + { + get { return Asn1DateTime.ToDateTime(this.RawValidity.notBefore); } + set + { + using (Asn1DateTime asnDateTime = new Asn1DateTime(value)) + { + Native.ExpectSuccess(Native.X509_set_notBefore(this.ptr, asnDateTime.Handle)); + } + } + } + + /// + /// Uses the notAfter field and X509_set_notAfter() + /// + public DateTime NotAfter + { + get { return Asn1DateTime.ToDateTime(this.RawValidity.notAfter); } + set + { + using (Asn1DateTime asnDateTime = new Asn1DateTime(value)) + { + Native.ExpectSuccess(Native.X509_set_notAfter(this.ptr, asnDateTime.Handle)); + } + } + } + + /// + /// Uses the version field and X509_set_version() + /// + public int Version + { + get { return Native.ASN1_INTEGER_get(this.RawCertInfo.version); } + set { Native.ExpectSuccess(Native.X509_set_version(this.ptr, value)); } + } + + /// + /// Uses X509_get_pubkey() and X509_set_pubkey() + /// + public CryptoKey PublicKey + { + get + { + // X509_get_pubkey() will increment the refcount internally + IntPtr key_ptr = Native.ExpectNonNull(Native.X509_get_pubkey(this.ptr)); + return new CryptoKey(key_ptr, true); + } + set { Native.ExpectSuccess(Native.X509_set_pubkey(this.ptr, value.Handle)); } + } + + /// + /// Returns whether or not a Private Key is attached to this Certificate + /// + public bool HasPrivateKey + { + get { return privateKey != null; } + } + + /// + /// Gets and Sets the Private Key for this Certificate. + /// The Private Key MUST match the Public Key. + /// + public CryptoKey PrivateKey + { + get { return privateKey.CopyRef(); } + set + { + if (CheckPrivateKey(value)) + { + privateKey = value.CopyRef(); + } + else + { + throw new ArgumentException("Private key doesn't correspond to the this certificate"); + } + } + } + + /// + /// Returns the PEM formatted string of this object + /// + public string PEM + { + get + { + using (BIO bio = BIO.MemoryBuffer()) + { + this.Write(bio); + return bio.ReadString(); + } + } + } + + /// + /// Returns the DER formatted byte array for this object + /// + public byte[] DER { + get { + using (BIO bio = BIO.MemoryBuffer()) { + this.Write_DER(bio); + return bio.ReadBytes((int)bio.NumberWritten).Array; + } + } + } + #endregion + + #region Methods + /// + /// Calls X509_sign() + /// + /// + /// + public void Sign(CryptoKey pkey, MessageDigest digest) + { + if (Native.X509_sign(this.ptr, pkey.Handle, digest.Handle) == 0) + throw new OpenSslException(); + } + + /// + /// Returns X509_check_private_key() + /// + /// + /// + public bool CheckPrivateKey(CryptoKey pkey) + { + return Native.X509_check_private_key(this.ptr, pkey.Handle) == 1; + } + + /// + /// Returns X509_check_trust() + /// + /// + /// + /// + public bool CheckTrust(int id, int flags) + { + return Native.X509_check_trust(this.ptr, id, flags) == 1; + } + + /// + /// Returns X509_verify() + /// + /// + /// + public bool Verify(CryptoKey pkey) + { + int ret = Native.X509_verify(this.ptr, pkey.Handle); + if (ret < 0) + throw new OpenSslException(); + return ret == 1; + } + + /// + /// Returns X509_digest() + /// + /// + /// + /// + public ArraySegment Digest(IntPtr type, byte[] digest) + { + uint len = (uint)digest.Length; + Native.ExpectSuccess(Native.X509_digest(this.ptr, type, digest, ref len)); + return new ArraySegment(digest, 0, (int)len); + } + + /// + /// Returns X509_pubkey_digest() + /// + /// + /// + /// + public ArraySegment DigestPublicKey(IntPtr type, byte[] digest) + { + uint len = (uint)digest.Length; + Native.ExpectSuccess(Native.X509_pubkey_digest(this.ptr, type, digest, ref len)); + return new ArraySegment(digest, 0, (int)len); + } + + /// + /// Calls PEM_write_bio_X509() + /// + /// + public void Write(BIO bio) + { + Native.ExpectSuccess(Native.PEM_write_bio_X509(bio.Handle, this.ptr)); + } + + /// + /// Calls i2d_X509_bio() + /// + /// + public void Write_DER(BIO bio) { + Native.ExpectSuccess(Native.i2d_X509_bio(bio.Handle, this.ptr)); + } + + /// + /// Calls X509_print() + /// + /// + public override void Print(BIO bio) + { + Native.ExpectSuccess(Native.X509_print(bio.Handle, this.ptr)); + } + + /// + /// Converts a X509 into a request using X509_to_X509_REQ() + /// + /// + /// + /// + public X509Request CreateRequest(CryptoKey pkey, MessageDigest digest) + { + return new X509Request(Native.ExpectNonNull(Native.X509_to_X509_REQ(this.ptr, pkey.Handle, digest.Handle)), true); + } + + /// + /// Calls X509_add_ext() + /// + /// + public void AddExtension(X509Extension ext) + { + Native.ExpectSuccess(Native.X509_add_ext(this.ptr, ext.Handle, -1)); + } + + /// + /// Calls X509_add1_ext_i2d() + /// + /// + /// + /// + /// + public void AddExtension(string name, byte[] value, int crit, uint flags) + { + Native.ExpectSuccess(Native.X509_add1_ext_i2d(this.ptr, Native.TextToNID(name), value, crit, flags)); + } + + /// + /// + /// + public Core.Stack Extensions + { + get + { + if (RawCertInfo.extensions != IntPtr.Zero) + { + return new Core.Stack(RawCertInfo.extensions, false); + } + return null; + } + } + + /// + /// + /// + /// + public void AddExtensions(Core.Stack sk_ext) + { + foreach (X509Extension ext in sk_ext) + { + AddExtension(ext); + } + } + + #endregion + + #region Overrides + /// + /// Calls X509_free() + /// + protected override void OnDispose() + { + Native.X509_free(this.ptr); + if (privateKey != null) + { + privateKey.Dispose(); + privateKey = null; + } + } + + /// + /// Compares X509Certificate + /// + /// + /// + public override bool Equals(object obj) + { + X509Certificate rhs = obj as X509Certificate; + if (rhs == null) + return false; + return this.CompareTo(rhs) == 0; + } + + /// + /// Returns the hash code of the issuer's oneline xor'd with the serial number + /// + /// + public override int GetHashCode() + { + return this.Issuer.OneLine.GetHashCode() ^ this.SerialNumber; + } + + internal override CryptoLockTypes LockType + { + get { return CryptoLockTypes.CRYPTO_LOCK_X509; } + } + + internal override Type RawReferenceType + { + get { return typeof(X509); } + } + + #endregion + + #region IComparable Members + + /// + /// Returns X509_cmp() + /// + /// + /// + public int CompareTo(X509Certificate other) + { + return Native.X509_cmp(this.ptr, other.ptr); + } + + #endregion + + #region Fields + private CryptoKey privateKey; + #endregion + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/X509/X509CertificateAuthority.cs b/dep/openssl/src/ManagedOpenSsl/X509/X509CertificateAuthority.cs new file mode 100644 index 00000000..361574b7 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/X509/X509CertificateAuthority.cs @@ -0,0 +1,392 @@ +// Copyright (c) 2006-2008 Frank Laub +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading; +using OpenSSL.Crypto; + +namespace OpenSSL.X509 +{ + /// + /// Used for generating sequence numbers by the CertificateAuthority + /// + public interface ISequenceNumber + { + /// + /// Returns the next available sequence number + /// + /// + int Next(); + } + + /// + /// Implements the ISequenceNumber interface. + /// The sequence number is read from a file, incremented, + /// then written back to the file + /// + public class FileSerialNumber : ISequenceNumber + { + private FileInfo serialFile; + /// + /// Constructs a FileSerialNumber. The path specifies where + /// the serial number should be read and written to. + /// + /// + public FileSerialNumber(string path) + { + this.serialFile = new FileInfo(path); + } + + #region ISequenceNumber Members + /// + /// Implements the Next() method of the ISequenceNumber interface. + /// The sequence number is read from a file, incremented, + /// then written back to the file + /// + /// + public int Next() + { + string name = this.serialFile.FullName.Replace('\\', '/'); + using (Mutex mutex = new Mutex(true, name)) + { + mutex.WaitOne(); + int serial = 1; + if (this.serialFile.Exists) + { + using (StreamReader sr = new StreamReader(this.serialFile.FullName)) + { + string text = sr.ReadToEnd(); + serial = Convert.ToInt32(text); + ++serial; + } + } + + using(StreamWriter sr = new StreamWriter(this.serialFile.FullName)) + { + sr.Write(serial.ToString()); + } + + return serial; + } + } + #endregion + } + + /// + /// Simple implementation of the ISequenceNumber interface. + /// + public class SimpleSerialNumber : ISequenceNumber + { + private int seq; + + /// + /// Construct a SimpleSerialNumber with the initial sequence number set to 0. + /// + public SimpleSerialNumber() { this.seq = 0; } + + /// + /// Construct a SimpleSerialNumber with the initial sequence number + /// set to the value specified by the seed parameter. + /// + /// + public SimpleSerialNumber(int seed) { this.seq = seed; } + + #region ISequenceNumber Members + + /// + /// Returns the next available sequence number. + /// This implementation simply increments the current + /// sequence number and returns it. + /// + /// + public int Next() + { + return ++seq; + } + + #endregion + } + + /// + /// High-level interface which does the job of a CA (Certificate Authority) + /// Duties include processing incoming X509 requests and responding + /// with signed X509 certificates, signed by this CA's private key. + /// + public class X509CertificateAuthority : IDisposable + { + #region Self-Signed Factory Methods + + /// + /// Factory method which creates a X509CertifiateAuthority where + /// the internal certificate is self-signed + /// + /// + /// + /// + /// + /// + /// + public static X509CertificateAuthority SelfSigned( + Configuration cfg, + ISequenceNumber seq, + X509Name subject, + DateTime start, + TimeSpan validity) + { + CryptoKey key; + using (DSA dsa = new DSA(true)) + { + key = new CryptoKey(dsa); + // Dispose the DSA key, the CryptoKey assignment increments the reference count + } + X509Certificate cert = new X509Certificate( + seq.Next(), + subject, + subject, + key, + start, + start + validity); + + if(cfg != null) + cfg.ApplyExtensions("v3_ca", cert, cert, null); + + cert.Sign(key, MessageDigest.DSS1); + + return new X509CertificateAuthority(cert, key, seq, cfg); + } + + /// + /// Factory method that creates a X509CertificateAuthority instance with + /// an internal self signed certificate + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static X509CertificateAuthority SelfSigned( + Configuration cfg, + ISequenceNumber seq, + CryptoKey key, + MessageDigest digest, + X509Name subject, + DateTime start, + TimeSpan validity) + { + X509Certificate cert = new X509Certificate( + seq.Next(), + subject, + subject, + key, + start, + start + validity); + + if (cfg != null) + cfg.ApplyExtensions("v3_ca", cert, cert, null); + + cert.Sign(key, digest); + + return new X509CertificateAuthority(cert, key, seq, cfg); + } + + /// + /// Factory method that creates a X509CertificateAuthority instance with + /// an internal self signed certificate. This method allows creation without + /// the need for the Configuration file, X509V3Extensions may be added + /// with the X509V3ExtensionList parameter + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static X509CertificateAuthority SelfSigned( + ISequenceNumber seq, + CryptoKey key, + MessageDigest digest, + X509Name subject, + DateTime start, + TimeSpan validity, + X509V3ExtensionList extensions) + { + X509Certificate cert = new X509Certificate( + seq.Next(), + subject, + subject, + key, + start, + start + validity); + + if (null != extensions) + { + foreach (X509V3ExtensionValue extValue in extensions) + { + X509Extension ext = new X509Extension(cert, cert, extValue.Name, extValue.IsCritical, extValue.Value); + cert.AddExtension(ext); + } + } + + cert.Sign(key, digest); + + return new X509CertificateAuthority(cert, key, seq, null); + } + + #endregion + + #region Initialization + + /// + /// Constructs a X509CertifcateAuthority with the specified parameters. + /// + /// + /// + /// + /// + public X509CertificateAuthority(X509Certificate caCert, CryptoKey caKey, ISequenceNumber serial, Configuration cfg) + { + if (!caCert.CheckPrivateKey(caKey)) + throw new Exception("The specified CA Private Key does match the specified CA Certificate"); + this.caCert = caCert; + this.caKey = caKey; + this.serial = serial; + this.cfg = cfg; + } + + #endregion + + #region Properties + + /// + /// Accessor to the CA's X509 Certificate + /// + public X509Certificate Certificate + { + get { return this.caCert; } + } + + /// + /// Accessor to the CA's key used for signing. + /// + public CryptoKey Key + { + get { return this.caKey; } + } + + #endregion + + #region Methods + + /// + /// Process and X509Request. This includes creating a new X509Certificate + /// and signing this certificate with this CA's private key. + /// + /// + /// + /// + /// + public X509Certificate ProcessRequest(X509Request request, DateTime startTime, DateTime endTime) + { + return ProcessRequest(request, startTime, endTime, MessageDigest.DSS1); + } + + /// + /// Process and X509Request. This includes creating a new X509Certificate + /// and signing this certificate with this CA's private key. + /// + /// + /// + /// + /// + /// + public X509Certificate ProcessRequest(X509Request request, DateTime startTime, DateTime endTime, MessageDigest digest) + { + //using (CryptoKey pkey = request.PublicKey) + //{ + // if (!request.Verify(pkey)) + // throw new Exception("Request signature validation failed"); + //} + + X509Certificate cert = new X509Certificate( + serial.Next(), + request.Subject, + this.caCert.Subject, + request.PublicKey, + startTime, + endTime); + + if (this.cfg != null) + this.cfg.ApplyExtensions("v3_ca", this.caCert, cert, request); + + cert.Sign(this.caKey, digest); + + return cert; + } + + #endregion + + #region IDisposable Members + + /// + /// Dispose the key, certificate, and the configuration + /// + public void Dispose() + { + if (this.caKey != null) + { + this.caKey.Dispose(); + this.caKey = null; + } + + if (this.caCert != null) + { + this.caCert.Dispose(); + this.caCert = null; + } + + if (this.cfg != null) + { + this.cfg.Dispose(); + this.cfg = null; + } + } + + #endregion + + #region Fields + private X509Certificate caCert; + private CryptoKey caKey; + private ISequenceNumber serial; + private Configuration cfg; + #endregion + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/X509/X509CertificateInfo.cs b/dep/openssl/src/ManagedOpenSsl/X509/X509CertificateInfo.cs new file mode 100644 index 00000000..b36d370d --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/X509/X509CertificateInfo.cs @@ -0,0 +1,115 @@ +// Copyright (c) 2009 Frank Laub +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using OpenSSL.Core; +using OpenSSL.Crypto; + +namespace OpenSSL.X509 +{ + internal class X509CertificateInfo : BaseReferenceType, IStackable + { + #region X509_INFO + [StructLayout(LayoutKind.Sequential)] + struct X509_INFO + { + public IntPtr x509; + public IntPtr crl; + public IntPtr x_pkey; + #region EVP_CIPHER_INFO enc_cipher; + public IntPtr cipher; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Native.EVP_MAX_IV_LENGTH)] + public byte[] iv; + #endregion + public int enc_len; + public IntPtr enc_data; + public int references; + } + #endregion + + #region Initialization + internal X509CertificateInfo(IStack stack, IntPtr ptr) + : base(ptr, true) + { + } + #endregion + + #region Properties + + public X509Certificate Certificate + { + get + { + X509Certificate ret = new X509Certificate(this.raw.x509, true); + ret.AddRef(); + return ret; + } + } + + public CryptoKey Key + { + get + { + CryptoKey ret = new CryptoKey(this.raw.x_pkey, true); + ret.AddRef(); + return ret; + } + } + + #endregion + + #region Overrides + + internal override void OnNewHandle(IntPtr ptr) + { + this.raw = (X509_INFO)Marshal.PtrToStructure(this.ptr, typeof(X509_INFO)); + } + + protected override void OnDispose() + { + Native.X509_INFO_free(this.ptr); + } + + internal override CryptoLockTypes LockType + { + get { return CryptoLockTypes.CRYPTO_LOCK_X509_INFO; } + } + + internal override Type RawReferenceType + { + get { return typeof(X509_INFO); } + } + + #endregion + + #region Fields + private X509_INFO raw; + #endregion + } + +} diff --git a/dep/openssl/src/ManagedOpenSsl/X509/X509Chain.cs b/dep/openssl/src/ManagedOpenSsl/X509/X509Chain.cs new file mode 100644 index 00000000..d6a5ca9b --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/X509/X509Chain.cs @@ -0,0 +1,175 @@ +// Copyright (c) 2006-2007 Frank Laub +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using OpenSSL.Core; + +namespace OpenSSL.X509 +{ + /// + /// Contains a chain X509_INFO objects. + /// + public class X509Chain : Core.Stack + { + #region Initialization + /// + /// Default null constructor + /// + public X509Chain() { } + + /// + /// Creates a chain from a BIO. Expects the stream to contain + /// a collection of X509_INFO objects in PEM format by calling + /// PEM_X509_INFO_read_bio() + /// + /// + public X509Chain(BIO bio) + { + IntPtr sk = Native.ExpectNonNull(Native.PEM_X509_INFO_read_bio(bio.Handle, IntPtr.Zero, null, IntPtr.Zero)); + using (Core.Stack stack = new Core.Stack(sk, true)) + { + while (stack.Count > 0) + { + using (X509CertificateInfo xi = stack.Shift()) + { + X509Certificate cert = xi.Certificate; + if (cert != null) + { + this.Add(cert); + } + } + } + } + } + + /// + /// Creates a new chain from the specified PEM-formatted string + /// + /// + public X509Chain(string pem) + : this(new BIO(pem)) + { + } + #endregion + + #region Methods + /// + /// Returns X509_find_by_issuer_and_serial() + /// + /// + /// + /// + public X509Certificate FindByIssuerAndSerial(X509Name issuer, int serial) + { + using (Asn1Integer asnInt = new Asn1Integer(serial)) + { + IntPtr ptr = Native.X509_find_by_issuer_and_serial(this.ptr, issuer.Handle, asnInt.Handle); + if (ptr == IntPtr.Zero) + return null; + X509Certificate cert = new X509Certificate(ptr, true); + // Increase the reference count for the native pointer + cert.AddRef(); + return cert; + } + } + + /// + /// Returns X509_find_by_subject() + /// + /// + /// + public X509Certificate FindBySubject(X509Name subject) + { + IntPtr ptr = Native.X509_find_by_subject(this.ptr, subject.Handle); + if (ptr == IntPtr.Zero) + return null; + X509Certificate cert = new X509Certificate(ptr, true); + // Increase the reference count for the native pointer + cert.AddRef(); + return cert; + } + #endregion + } + + /// + /// A List for X509Certificate types. + /// + public class X509List : List + { + #region Initialization + /// + /// Creates an empty X509List + /// + public X509List() { } + + /// + /// Calls PEM_x509_INFO_read_bio() + /// + /// + public X509List(BIO bio) + { + IntPtr sk = Native.ExpectNonNull( + Native.PEM_X509_INFO_read_bio(bio.Handle, IntPtr.Zero, null, IntPtr.Zero)); + using (Core.Stack stack = new Core.Stack(sk, true)) + { + while (stack.Count > 0) + { + using (X509CertificateInfo xi = stack.Shift()) + { + if (xi.Certificate != null) + this.Add(xi.Certificate); + } + } + } + } + + /// + /// Populates this list from a PEM-formatted string + /// + /// + public X509List(string pem) + : this(new BIO(pem)) + { + } + + /// + /// Populates this list from a DER buffer. + /// + /// + public X509List(byte[] der) + { + BIO bio = new BIO(der); + while (bio.NumberRead < der.Length) + { + X509Certificate x509 = X509Certificate.FromDER(bio); + this.Add(x509); + } + } + #endregion + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/X509/X509Extension.cs b/dep/openssl/src/ManagedOpenSsl/X509/X509Extension.cs new file mode 100644 index 00000000..c22ec523 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/X509/X509Extension.cs @@ -0,0 +1,213 @@ +// Copyright (c) 2009 Frank Laub +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using OpenSSL.Core; + +namespace OpenSSL.X509 +{ + /// + /// Wraps the X509_EXTENSION object + /// + public class X509Extension : BaseValueType, IStackable + { + #region Initialization + + /// + /// Calls X509_EXTENSION_new() + /// + public X509Extension() + : base(Native.ExpectNonNull(Native.X509_EXTENSION_new()), true) + { } + + internal X509Extension(IStack stack, IntPtr ptr) + : base(ptr, true) + { } + + /// + /// Calls X509V3_EXT_conf_nid() + /// + /// + /// + /// + /// + /// + public X509Extension(X509Certificate issuer, X509Certificate subject, string name, bool critical, string value) + : base(IntPtr.Zero, true) + { + using (X509V3Context ctx = new X509V3Context(issuer, subject, null)) + { + this.ptr = Native.ExpectNonNull(Native.X509V3_EXT_conf_nid(IntPtr.Zero, ctx.Handle, Native.TextToNID(name), value)); + } + } + + #endregion + + #region Properties + + /// + /// Uses X509_EXTENSION_get_object() and OBJ_nid2ln() + /// + public string Name + { + get { return Marshal.PtrToStringAnsi(Native.OBJ_nid2ln(this.NID)); } + } + + /// + /// Uses X509_EXTENSION_get_object() and OBJ_obj2nid() + /// + public int NID + { + get + { + // Don't free the obj_ptr + IntPtr obj_ptr = Native.X509_EXTENSION_get_object(this.ptr); + if (obj_ptr != IntPtr.Zero) + return Native.OBJ_obj2nid(obj_ptr); + return 0; + } + } + + /// + /// returns X509_EXTENSION_get_critical() + /// + public bool IsCritical + { + get + { + int nCritical = Native.X509_EXTENSION_get_critical(this.ptr); + return (nCritical == 1); + } + } + + /// + /// Returns X509_EXTENSION_get_data() + /// + public byte[] Data + { + get + { + using (Asn1String str = new Asn1String(Native.X509_EXTENSION_get_data(this.ptr), false)) + { + return str.Data; + } + } + } + + #endregion + + #region Overrides + + /// + /// Calls X509_EXTENSION_free() + /// + protected override void OnDispose() + { + Native.X509_EXTENSION_free(this.ptr); + } + + /// + /// Calls X509V3_EXT_print() + /// + /// + public override void Print(BIO bio) + { + Native.X509V3_EXT_print(bio.Handle, this.ptr, 0, 0); + } + + /// + /// Calls X509_EXTENSION_dup() + /// + /// + internal override IntPtr DuplicateHandle() + { + return Native.X509_EXTENSION_dup(this.ptr); + } + + #endregion + } + + /// + /// X509 Extension entry + /// + public class X509V3ExtensionValue + { + #region Initialization + /// + /// + /// + /// + /// + public X509V3ExtensionValue(string name, bool critical, string value) + { + this.name = name; + this.critical = critical; + this.value = value; + } + #endregion + + #region Properties + + /// + /// + public string Name + { + get { return name; } + } + + /// + /// + public bool IsCritical + { + get { return critical; } + } + + /// + /// + public string Value + { + get { return this.value; } + } + + #endregion + + #region Fields + private bool critical; + private string value; + private string name; + #endregion + } + + /// + /// Dictionary for X509 v3 extensions - Name, Value + /// + public class X509V3ExtensionList : List + { + } + +} diff --git a/dep/openssl/src/ManagedOpenSsl/X509/X509Name.cs b/dep/openssl/src/ManagedOpenSsl/X509/X509Name.cs new file mode 100644 index 00000000..17c4fe1b --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/X509/X509Name.cs @@ -0,0 +1,459 @@ +// Copyright (c) 2006-2007 Frank Laub +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using OpenSSL.Core; +using OpenSSL.Crypto; + +namespace OpenSSL.X509 +{ + /// + /// Encapsulates the X509_NAME_* functions + /// + public class X509Name : BaseValueType, IComparable, IStackable + { + #region Initialization + internal X509Name(IntPtr ptr, bool owner) + : base(ptr, owner) + { } + + /// + /// Calls X509_NAME_new() + /// + public X509Name() + : base(Native.ExpectNonNull(Native.X509_NAME_new()), true) + { } + + /// + /// Calls X509_NAME_dup() + /// + /// + public X509Name(X509Name rhs) + : base(Native.ExpectNonNull(Native.X509_NAME_dup(rhs.ptr)), true) + { + } + + internal X509Name(IStack stack, IntPtr ptr) + : base(ptr, true) + { } + + /// + /// Calls X509_NAME_new() + /// + /// + public X509Name(string str) + : this() + { + if (str.IndexOf('/') == -1 && + str.IndexOf('=') == -1) + { + this.Common = str; + return; + } + + string[] parts = str.Split('/'); + foreach (string part in parts) + { + if (part == "") + continue; + string[] nv = part.Split('='); + string name = nv[0]; + string value = nv[1]; + this.AddEntryByName(name, value); + } + } + + /// + /// Parses the string and returns an X509Name based on value. + /// + /// + /// + public static implicit operator X509Name(string value) + { + return new X509Name(value); + } + #endregion + + #region Properties + + /// + /// Returns X509_NAME_oneline() + /// + public string OneLine + { + get { return Native.PtrToStringAnsi(Native.X509_NAME_oneline(this.ptr, null, 0), true); } + } + + /// + /// Accessor to the name entry for 'CN' + /// + public string Common + { + get { return this.GetTextByName("CN"); } + set { this.AddEntryByName("CN", value); } + } + + /// + /// Accessor to the name entry for 'C' + /// + public string Country + { + get { return this.GetTextByName("C"); } + set { this.AddEntryByName("C", value); } + } + + /// + /// Accessor to the name entry for 'L' + /// + public string Locality + { + get { return this.GetTextByName("L"); } + set { this.AddEntryByName("L", value); } + } + + /// + /// Accessor to the name entry for 'ST' + /// + public string StateOrProvince + { + get { return this.GetTextByName("ST"); } + set { this.AddEntryByName("ST", value); } + } + + /// + /// Accessor to the name entry for 'O' + /// + public string Organization + { + get { return this.GetTextByName("O"); } + set { this.AddEntryByName("O", value); } + } + + /// + /// Accessor to the name entry for 'OU' + /// + public string OrganizationUnit + { + get { return this.GetTextByName("OU"); } + set { this.AddEntryByName("OU", value); } + } + + /// + /// Accessor to the name entry for 'G' + /// + public string Given + { + get { return this.GetTextByName("G"); } + set { this.AddEntryByName("G", value); } + } + + /// + /// Accessor to the name entry for 'S' + /// + public string Surname + { + get { return this.GetTextByName("S"); } + set { this.AddEntryByName("S", value); } + } + + /// + /// Accessor to the name entry for 'I' + /// + public string Initials + { + get { return this.GetTextByName("I"); } + set { this.AddEntryByName("I", value); } + } + + /// + /// Accessor to the name entry for 'UID' + /// + public string UniqueIdentifier + { + get { return this.GetTextByName("UID"); } + set { this.AddEntryByName("UID", value); } + } + + /// + /// Accessor to the name entry for 'SN' + /// + public string SerialNumber + { + get { return this.GetTextByName("SN"); } + set { this.AddEntryByName("SN", value); } + } + + /// + /// Accessor to the name entry for 'T' + /// + public string Title + { + get { return this.GetTextByName("T"); } + set { this.AddEntryByName("T", value); } + } + + /// + /// Accessor to the name entry for 'D' + /// + public string Description + { + get { return this.GetTextByName("D"); } + set { this.AddEntryByName("D", value); } + } + + /// + /// Accessor to the name entry for 'X509' + /// + public string X509 + { + get { return this.GetTextByName("X509"); } + set { this.AddEntryByName("X509", value); } + } + + /// + /// Returns X509_NAME_entry_count() + /// + public int Count + { + get { return Native.X509_NAME_entry_count(this.ptr); } + } + + /// + /// Indexer to a name entry by name + /// + /// + /// + public string this[string name] + { + get { return this.GetTextByName(name); } + set { this.AddEntryByName(name, value); } + } + + /// + /// Indexer to a name entry by index + /// + /// + /// + public string this[int index] + { + get + { + IntPtr pEntry = Native.X509_NAME_get_entry(this.ptr, index); + return null; + } + } + #endregion + + #region Methods + /// + /// Calls X509_NAME_add_entry_by_NID after converting the + /// name to a NID using OBJ_txt2nid() + /// + /// + /// + public void AddEntryByName(string name, string value) + { + this.AddEntryByNid(Native.TextToNID(name), value); + } + + /// + /// Calls X509_NAME_add_entry_by_NID() + /// + /// + /// + public void AddEntryByNid(int nid, string value) + { + byte[] buf = Encoding.ASCII.GetBytes(value); + Native.ExpectSuccess(Native.X509_NAME_add_entry_by_NID( + this.ptr, + nid, + Native.MBSTRING_ASC, + buf, + buf.Length, + -1, + 0)); + } + + /// + /// Returns X509_NAME_get_text_by_NID() + /// + /// + /// + public string GetTextByNid(int nid) + { + if (this.GetIndexByNid(nid, -1) == -1) + return null; + + byte[] buf = new byte[1024]; + int len = Native.X509_NAME_get_text_by_NID(this.ptr, nid, buf, buf.Length); + if (len <= 0) + throw new OpenSslException(); + return Encoding.ASCII.GetString(buf, 0, len); + } + + /// + /// Returns X509_NAME_get_text_by_NID() after converting the name + /// into a NID using OBJ_txt2nid() + /// + /// + /// + public string GetTextByName(string name) + { + return this.GetTextByNid(Native.TextToNID(name)); + } + + /// + /// Calls X509_NAME_get_index_by_NID() + /// + /// + /// + /// + public int GetIndexByNid(int nid, int lastpos) + { + int ret = Native.X509_NAME_get_index_by_NID(this.ptr, nid, lastpos); + if (ret == lastpos) + return lastpos; + if (ret < 0) + throw new OpenSslException(); + return ret; + } + + /// + /// Returns the index of a name entry using GetIndexByNid() + /// + /// + /// + /// + public int IndexOf(string name, int lastpos) + { + return GetIndexByNid(Native.TextToNID(name), lastpos); + } + + /// + /// Returns the index of a name entry using GetIndexByNid() + /// + /// + /// + public int IndexOf(string name) + { + return this.IndexOf(name, -1); + } + + /// + /// Returns true if the name entry with the specified name exists. + /// + /// + /// + public bool Contains(string name) + { + return this.IndexOf(name) >= 0; + } + + /// + /// Returns X509_NAME_digest() + /// + /// + /// + /// + public ArraySegment Digest(MessageDigest type, int cbSize) + { + byte[] buf = new byte[cbSize]; + uint len = (uint)cbSize; + Native.ExpectSuccess(Native.X509_NAME_digest(this.ptr, type.Handle, buf, ref len)); + return new ArraySegment(buf, 0, (int)len); + } + + /// + /// Calls X509_NAME_print_ex() + /// + /// + public override void Print(BIO bio) + { + const int flags = + Native.ASN1_STRFLGS_RFC2253 | + Native.ASN1_STRFLGS_ESC_QUOTE | + Native.XN_FLAG_SEP_COMMA_PLUS | + Native.XN_FLAG_FN_SN; + int ret = Native.X509_NAME_print_ex(bio.Handle, this.Handle, 0, flags); + if (ret <= 0) + throw new OpenSslException(); + } + + #endregion + + #region Overrides + + /// + /// Calls X509_NAME_free() + /// + protected override void OnDispose() + { + Native.X509_NAME_free(this.ptr); + } + + internal override IntPtr DuplicateHandle() + { + return Native.X509_NAME_dup(this.ptr); + } + + /// + /// Returns CompareTo(rhs) == 0 + /// + public override bool Equals(object rhs) + { + X509Name other = rhs as X509Name; + if(other == null) + return false; + + return this.CompareTo(other) == 0; + } + + /// + /// Returns ToString().GetHashCode() + /// + public override int GetHashCode() + { + return ToString().GetHashCode(); + } + + #endregion + + #region IComparable Members + + /// + /// Returns X509_NAME_cmp() + /// + /// + /// + public int CompareTo(X509Name other) + { + return Native.X509_NAME_cmp(this.ptr, other.ptr); + } + + #endregion + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/X509/X509Object.cs b/dep/openssl/src/ManagedOpenSsl/X509/X509Object.cs new file mode 100644 index 00000000..09cbec54 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/X509/X509Object.cs @@ -0,0 +1,127 @@ +// Copyright (c) 2009 Frank Laub +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using OpenSSL.Core; +using OpenSSL.Crypto; + +namespace OpenSSL.X509 +{ + /// + /// Wraps the X509_OBJECT: a glorified union + /// + public class X509Object : Base, IStackable + { + #region X509_OBJECT + const int X509_LU_RETRY = -1; + const int X509_LU_FAIL = 0; + const int X509_LU_X509 = 1; + const int X509_LU_CRL = 2; + const int X509_LU_PKEY = 3; + + [StructLayout(LayoutKind.Sequential)] + struct X509_OBJECT + { + /* one of the above types */ + public int type; + public IntPtr ptr; + } + + #endregion + + #region Initialization + + internal X509Object(IStack stack, IntPtr ptr) + : base(ptr, true) + { + } + + #endregion + + #region Properties + + /// + /// Returns a Certificate if the type is X509_LU_X509 + /// + public X509Certificate Certificate + { + get + { + if (raw.type == X509_LU_X509) + return new X509Certificate(raw.ptr, false); + return null; + } + } + + /// + /// Returns the PrivateKey if the type is X509_LU_PKEY + /// + public CryptoKey PrivateKey + { + get + { + if (raw.type == X509_LU_PKEY) + return new CryptoKey(raw.ptr, false); + return null; + } + } + + #endregion + + //!! TODO - Add support for CRL + + #region Overrides + + /// + /// Calls X509_OBJECT_up_ref_count() + /// + internal override void AddRef() + { + Native.X509_OBJECT_up_ref_count(this.ptr); + } + + /// + /// Calls X509_OBJECT_free_contents() + /// + protected override void OnDispose() + { + Native.X509_OBJECT_free_contents(this.ptr); + } + + internal override void OnNewHandle(IntPtr ptr) + { + this.raw = (X509_OBJECT)Marshal.PtrToStructure(this.ptr, typeof(X509_OBJECT)); + } + + #endregion + + #region Fields + private X509_OBJECT raw; + #endregion + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/X509/X509Request.cs b/dep/openssl/src/ManagedOpenSsl/X509/X509Request.cs new file mode 100644 index 00000000..7e667320 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/X509/X509Request.cs @@ -0,0 +1,237 @@ +// Copyright (c) 2006-2007 Frank Laub +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using OpenSSL.Core; +using OpenSSL.Crypto; + +namespace OpenSSL.X509 +{ + /// + /// Wraps a X509_REQ object. + /// + public class X509Request : Base + { + #region Initialization + /// + /// Calls X509_REQ_new() + /// + public X509Request() + : base(Native.ExpectNonNull(Native.X509_REQ_new()), true) + { } + + internal X509Request(IntPtr ptr, bool owner) + : base(ptr, owner) + { } + + /// + /// Calls X509_REQ_new() and then initializes version, subject, and key. + /// + /// + /// + /// + public X509Request(int version, X509Name subject, CryptoKey key) + : this() + { + this.Version = version; + this.Subject = subject; + this.PublicKey = key; + } + + /// + /// Calls PEM_read_bio_X509_REQ() + /// + /// + public X509Request(BIO bio) + : base(Native.ExpectNonNull(Native.PEM_read_bio_X509_REQ(bio.Handle, IntPtr.Zero, null, IntPtr.Zero)), true) + { } + + /// + /// Creates a X509_REQ from a PEM formatted string. + /// + /// + public X509Request(string pem) + : this(new BIO(pem)) + { } + #endregion + + #region X509_REQ_INFO + [StructLayout(LayoutKind.Sequential)] + private struct X509_REQ_INFO + { + #region ASN1_ENCODING enc; + public IntPtr enc_enc; + public int enc_len; + public int enc_modified; + #endregion + public IntPtr version; + public IntPtr subject; + public IntPtr pubkey; + public IntPtr attributes; + } + #endregion + + #region X509_REQ + [StructLayout(LayoutKind.Sequential)] + private struct X509_REQ + { + public IntPtr req_info; + public IntPtr sig_alg; + public IntPtr signature; + public int references; + } + #endregion + + #region Properties + private X509_REQ Raw + { + get { return (X509_REQ)Marshal.PtrToStructure(this.ptr, typeof(X509_REQ)); } + } + + private X509_REQ_INFO RawInfo + { + get { return (X509_REQ_INFO)Marshal.PtrToStructure(this.Raw.req_info, typeof(X509_REQ_INFO)); } + } + + /// + /// Accessor to the version field. The settor calls X509_REQ_set_version(). + /// + public int Version + { + get { return Native.ASN1_INTEGER_get(this.RawInfo.version); } + set { Native.ExpectSuccess(Native.X509_REQ_set_version(this.ptr, value)); } + } + + /// + /// Accessor to the pubkey field. Uses X509_REQ_get_pubkey() and X509_REQ_set_pubkey() + /// + public CryptoKey PublicKey + { + get { return new CryptoKey(Native.ExpectNonNull(Native.X509_REQ_get_pubkey(this.ptr)), true); } + set { Native.ExpectSuccess(Native.X509_REQ_set_pubkey(this.ptr, value.Handle)); } + } + + /// + /// Accessor to the subject field. Setter calls X509_REQ_set_subject_name(). + /// + public X509Name Subject + { + get { return new X509Name(Native.X509_NAME_dup(this.RawInfo.subject), true); } + set { Native.ExpectSuccess(Native.X509_REQ_set_subject_name(this.ptr, value.Handle)); } + } + + /// + /// Returns the PEM formatted string for this object. + /// + public string PEM + { + get + { + using (BIO bio = BIO.MemoryBuffer()) + { + this.Write(bio); + return bio.ReadString(); + } + } + } + #endregion + + #region Methods + /// + /// Sign this X509Request using the supplied key and digest. + /// + /// + /// + public void Sign(CryptoKey pkey, MessageDigest digest) + { + if (Native.X509_REQ_sign(this.ptr, pkey.Handle, digest.Handle) == 0) + throw new OpenSslException(); + } + + /// + /// Verify this X509Request against the supplied key. + /// + /// + /// + public bool Verify(CryptoKey pkey) + { + int ret = Native.X509_REQ_verify(this.ptr, pkey.Handle); + if (ret < 0) + throw new OpenSslException(); + return ret == 1; + } + + //public ArraySegment Digest(IntPtr type, byte[] digest) + //{ + // uint len = (uint)digest.Length; + // Native.ExpectSuccess(Native.X509_REQ_digest(this.ptr, type, digest, ref len)); + // return new ArraySegment(digest, 0, (int)len); + //} + + /// + /// Calls X509_REQ_print() + /// + /// + public override void Print(BIO bio) + { + Native.ExpectSuccess(Native.X509_REQ_print(bio.Handle, this.ptr)); + } + + /// + /// Calls PEM_write_bio_X509_REQ() + /// + /// + public void Write(BIO bio) + { + Native.ExpectSuccess(Native.PEM_write_bio_X509_REQ(bio.Handle, this.ptr)); + } + + /// + /// Converts this request into a certificate using X509_REQ_to_X509(). + /// + /// + /// + /// + public X509Certificate CreateCertificate(int days, CryptoKey pkey) + { + return new X509Certificate(Native.ExpectNonNull(Native.X509_REQ_to_X509(this.ptr, days, pkey.Handle)), true); + } + #endregion + + #region Overrides Members + + /// + /// Calls X509_REQ_free() + /// + protected override void OnDispose() { + Native.X509_REQ_free(this.ptr); + } + + #endregion + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/X509/X509Store.cs b/dep/openssl/src/ManagedOpenSsl/X509/X509Store.cs new file mode 100644 index 00000000..55455452 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/X509/X509Store.cs @@ -0,0 +1,225 @@ +// Copyright (c) 2006-2009 Frank Laub +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using OpenSSL.Core; + +namespace OpenSSL.X509 +{ + /// + /// Wraps the X509_STORE object + /// + public class X509Store : BaseReferenceType + { + #region X509_STORE + [StructLayout(LayoutKind.Sequential)] + struct X509_STORE + { + /* The following is a cache of trusted certs */ + public int cache; /* if true, stash any hits */ + public IntPtr objs; //STACK_OF(X509_OBJECT) *objs; /* Cache of all objects */ + + /* These are external lookup methods */ + public IntPtr get_cert_methods; //STACK_OF(X509_LOOKUP) *get_cert_methods; + + IntPtr param; // X509_VERIFY_PARAM* param; + + /* Callbacks for various operations */ + public IntPtr verify; //int (*verify)(X509_STORE_CTX *ctx); /* called to verify a certificate */ + public IntPtr verify_cb; //int (*verify_cb)(int ok,X509_STORE_CTX *ctx); /* error callback */ + public IntPtr get_issuer; //int (*get_issuer)(X509 **issuer, X509_STORE_CTX *ctx, X509 *x); /* get issuers cert from ctx */ + public IntPtr check_issued; //int (*check_issued)(X509_STORE_CTX *ctx, X509 *x, X509 *issuer); /* check issued */ + public IntPtr check_revocation; //int (*check_revocation)(X509_STORE_CTX *ctx); /* Check revocation status of chain */ + public IntPtr get_crl; //int (*get_crl)(X509_STORE_CTX *ctx, X509_CRL **crl, X509 *x); /* retrieve CRL */ + public IntPtr check_crl; //int (*check_crl)(X509_STORE_CTX *ctx, X509_CRL *crl); /* Check CRL validity */ + public IntPtr cert_crl; //int (*cert_crl)(X509_STORE_CTX *ctx, X509_CRL *crl, X509 *x); /* Check certificate against CRL */ + public IntPtr cleanup; //int (*cleanup)(X509_STORE_CTX *ctx); + #region CRYPTO_EX_DATA ex_data; + public IntPtr ex_data_sk; + public int ex_data_dummy; + #endregion + public int references; + } + #endregion + + #region Initialization + + /// + /// Calls X509_STORE_new() + /// + public X509Store() + : base(Native.ExpectNonNull(Native.X509_STORE_new()), true) + { } + + /// + /// Initializes the X509Store object with a pre-existing native X509_STORE pointer + /// + /// + /// + internal X509Store(IntPtr ptr, bool takeOwnership) : + base(ptr, takeOwnership) + { } + + /// + /// Calls X509_STORE_new() and then adds the specified chain as trusted. + /// + /// + public X509Store(X509Chain chain) + : this(chain, true) + { } + + /// + /// Calls X509_STORE_new() and then adds the specified chaing as trusted. + /// + /// + /// + public X509Store(X509Chain chain, bool takeOwnership) + : base(Native.ExpectNonNull(Native.X509_STORE_new()), takeOwnership) + { + foreach (X509Certificate cert in chain) + { + this.AddTrusted(cert); + } + } + + #endregion + + #region Properties + + /// + /// Wraps the objs member on the raw X509_STORE structure + /// + public Core.Stack Objects + { + get + { + X509_STORE raw = (X509_STORE)Marshal.PtrToStructure(this.ptr, typeof(X509_STORE)); + Core.Stack stack = new Core.Stack(raw.objs, false); + return stack; + } + } + + /// + /// Accessor to the untrusted list + /// + public X509Chain Untrusted + { + get { return this.untrusted; } + set { this.untrusted = value; } + } + + #endregion + + #region Methods + + /// + /// Returns the trusted state of the specified certificate + /// + /// + /// + /// + public bool Verify(X509Certificate cert, out string error) + { + using (X509StoreContext ctx = new X509StoreContext()) + { + ctx.Init(this, cert, this.untrusted); + if (ctx.Verify()) + { + error = ""; + return true; + } + error = ctx.ErrorString; + } + return false; + } + + /// + /// Adds a chain to the trusted list. + /// + /// + public void AddTrusted(X509Chain chain) + { + foreach (X509Certificate cert in chain) + { + AddTrusted(cert); + } + } + + /// + /// Adds a certificate to the trusted list, calls X509_STORE_add_cert() + /// + /// + public void AddTrusted(X509Certificate cert) + { + // Don't Addref here -- X509_STORE_add_cert increases the refcount of the certificate pointer + Native.ExpectSuccess(Native.X509_STORE_add_cert(this.ptr, cert.Handle)); + } + + /// + /// Add an untrusted certificate + /// + /// + public void AddUntrusted(X509Certificate cert) + { + this.untrusted.Add(cert); + } + + #endregion + + #region Overrides + + /// + /// Calls X509_STORE_free() + /// + protected override void OnDispose() + { + Native.X509_STORE_free(this.ptr); + if (this.untrusted != null) + { + this.untrusted.Dispose(); + this.untrusted = null; + } + } + + internal override CryptoLockTypes LockType + { + get { return CryptoLockTypes.CRYPTO_LOCK_X509_STORE; } + } + + internal override Type RawReferenceType + { + get { return typeof(X509_STORE); } + } + + #endregion + + #region Fields + private X509Chain untrusted = new X509Chain(); + #endregion + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/X509/X509StoreContext.cs b/dep/openssl/src/ManagedOpenSsl/X509/X509StoreContext.cs new file mode 100644 index 00000000..e5cb1253 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/X509/X509StoreContext.cs @@ -0,0 +1,191 @@ +// Copyright (c) 2009 Frank Laub +// 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 name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using OpenSSL.Core; + +namespace OpenSSL.X509 +{ + /// + /// Wraps the X509_STORE_CTX object + /// + public class X509StoreContext : Base + { + #region X509_STORE_CONTEXT + [StructLayout(LayoutKind.Sequential)] + struct X509_STORE_CONTEXT + { + public IntPtr ctx; + public int current_method; + public IntPtr cert; + public IntPtr untrusted; + public int purpose; + public int trust; +#if PocketPC + public uint check_time; +#else + public long check_time; +#endif + public uint flags; + public IntPtr other_ctx; + public IntPtr verify; + public IntPtr verify_cb; + public IntPtr get_issuer; + public IntPtr check_issued; + public IntPtr check_revocation; + public IntPtr get_crl; + public IntPtr check_crl; + public IntPtr cert_crl; + public IntPtr cleanup; + public int depth; + public int valid; + public int last_untrusted; + public IntPtr chain; + public int error_depth; + public int error; + public IntPtr current_cert; + public IntPtr current_issuer; + public IntPtr current_crl; + #region CRYPTO_EX_DATA ex_data; + public IntPtr ex_data_sk; + public int ex_data_dummy; + #endregion + } + #endregion + + #region Initialization + /// + /// Calls X509_STORE_CTX_new() + /// + public X509StoreContext() + : base(Native.ExpectNonNull(Native.X509_STORE_CTX_new()), true) + { + } + + internal X509StoreContext(IntPtr ptr, bool isOwner) + : base(ptr, isOwner) + { + } + #endregion + + #region Properties + + /// + /// Returns X509_STORE_CTX_get_current_cert() + /// + public X509Certificate CurrentCert + { + get + { + IntPtr cert = Native.X509_STORE_CTX_get_current_cert(this.ptr); + return new X509Certificate(cert, false); + } + } + + /// + /// Returns X509_STORE_CTX_get_error_depth() + /// + public int ErrorDepth + { + get { return Native.X509_STORE_CTX_get_error_depth(this.ptr); } + } + + /// + /// Getter returns X509_STORE_CTX_get_error(), setter calls X509_STORE_CTX_set_error() + /// + public int Error + { + get { return Native.X509_STORE_CTX_get_error(this.ptr); } + set { Native.X509_STORE_CTX_set_error(this.ptr, value); } + } + + /// + /// Returns an X509Store based on this context + /// + public X509Store Store + { + get { return new X509Store(this.Raw.ctx, false); } + } + + /// + /// Returns X509_verify_cert_error_string() + /// + public string ErrorString + { + get { return Native.PtrToStringAnsi(Native.X509_verify_cert_error_string(this.Raw.error), false); } + } + + private X509_STORE_CONTEXT Raw + { + get { return (X509_STORE_CONTEXT)Marshal.PtrToStructure(this.ptr, typeof(X509_STORE_CONTEXT)); } + } + #endregion + + #region Methods + /// + /// Calls X509_STORE_CTX_init() + /// + /// + /// + /// + public void Init(X509Store store, X509Certificate cert, X509Chain uchain) + { + Native.ExpectSuccess(Native.X509_STORE_CTX_init( + this.ptr, + store.Handle, + cert != null ? cert.Handle : IntPtr.Zero, + uchain.Handle)); + } + + /// + /// Returns X509_verify_cert() + /// + /// + public bool Verify() + { + int ret = Native.X509_verify_cert(this.ptr); + if (ret < 0) + throw new OpenSslException(); + return ret == 1; + } + + #endregion + + #region Overrides + + /// + /// Calls X509_STORE_CTX_free() + /// + protected override void OnDispose() + { + Native.X509_STORE_CTX_free(this.ptr); + } + + #endregion + } +} diff --git a/dep/openssl/src/openssl.net-2010.sln b/dep/openssl/src/openssl.net-2010.sln new file mode 100644 index 00000000..368290fc --- /dev/null +++ b/dep/openssl/src/openssl.net-2010.sln @@ -0,0 +1,19 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedOpenSsl-2010", "ManagedOpenSsl\ManagedOpenSsl-2010.csproj", "{73DCC218-655B-485F-8EAC-0CE5F2F7343D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {73DCC218-655B-485F-8EAC-0CE5F2F7343D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {73DCC218-655B-485F-8EAC-0CE5F2F7343D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {73DCC218-655B-485F-8EAC-0CE5F2F7343D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {73DCC218-655B-485F-8EAC-0CE5F2F7343D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/dep/openssl/ssleay32.dll b/dep/openssl/ssleay32.dll new file mode 100644 index 00000000..5f0b69f4 Binary files /dev/null and b/dep/openssl/ssleay32.dll differ diff --git a/dep/pcapnet/PcapDotNet.Analysis.dll b/dep/pcapnet/PcapDotNet.Analysis.dll new file mode 100644 index 00000000..74e19666 Binary files /dev/null and b/dep/pcapnet/PcapDotNet.Analysis.dll differ diff --git a/dep/pcapnet/PcapDotNet.Analysis.xml b/dep/pcapnet/PcapDotNet.Analysis.xml new file mode 100644 index 00000000..11a127e4 --- /dev/null +++ b/dep/pcapnet/PcapDotNet.Analysis.xml @@ -0,0 +1,45 @@ + + + + PcapDotNet.Analysis + + + + + Used to send PreEmptive Runtime Intelligence Data. + + + + + Initializes the Runtime Intelligence and make sures it will be closed on ProcessExit. + + + + + Counts a packet sent event. + + + + + Counts a packet sent events according to the given . + + The number of packet sent event to count. + + + + Counts a packet received event. + + + + + Counts a packet received events according to the given . + + The number of packet sent event to count. + + + + Choose whether to send PreEmptive Runtime Intelligence Data or not. + + + + diff --git a/dep/pcapnet/PcapDotNet.Base.XML b/dep/pcapnet/PcapDotNet.Base.XML new file mode 100644 index 00000000..17e867a8 --- /dev/null +++ b/dep/pcapnet/PcapDotNet.Base.XML @@ -0,0 +1,1291 @@ + + + + PcapDotNet.Base + + + + + Extension method for UInt structure. + + + + + Returns the number of digits the number will be represented by according to a specific base. + + The number to check for number of digits. + The base of the digits. + The number of digits the number will be represented by according to a specific base. + + + + A 24 bit unsigned integer. + + + + + The number of bytes this type will take. + + + + + The maximum value of this type. + + + + + Converts a 32 bit signed integer to a 24 bit unsigned integer by taking the 24 least significant bits. + + The 32 bit value to convert. + The 24 bit value created by taking the 24 least significant bits of the 32 bit value. + + + + Converts the 24 bits unsigned integer to a 32 bits signed integer. + + The 24 bit value to convert. + The 32 bit value converted from the 24 bit value. + + + + Returns true iff the two values represent the same value. + + The value to compare to. + True iff the two values represent the same value. + + + + Indicates whether this instance and a specified object are equal. + + + true if and this instance are the same type and represent the same value; otherwise, false. + + Another object to compare to. 2 + + + + Returns true iff the two values represent the same value. + + The first value to compare. + The second value to compare. + True iff the two values represent the same value. + + + + Returns true iff the two values represent different values. + + The first value to compare. + The second value to compare. + True iff the two values represent different values. + + + + Returns the hash code for this instance. + + + A 32-bit signed integer that is the hash code for this instance. + + 2 + + + + Returns the fully qualified type name of this instance. + + + A containing a fully qualified type name. + + 2 + + + + Extension methods for IEnumerable of type T. + + + + + Concatenates a sequence with more values. + + The type of an element in the sequence. + The sequence to concatenate. + The values that will be concatenated with the sequence. + A sequence containing all the original sequence elements cocatenated with values elements. + + + + Returns the bitwise xor of all the elements in the sequence. + + The elements to xor. + The bitwise xor of all the elements in the sequence. + + + + Returns the bitwise xor of all the elements in the sequence. + + The elements to xor. + The bitwise xor of all the elements in the sequence. + + + + Returns the bitwise xor of all the selected values of the elements in the sequence. + + The elements to select values to xor. + The selector used to select the values. + The bitwise xor of all the selected values of the elements in the sequence. + + + + Returns the bitwise xor of all the selected values of the elements in the sequence. + + The elements to select values to xor. + The selector used to select the values. + The bitwise xor of all the selected values of the elements in the sequence. + + + + Converts a sequence to a string by converting each element to a string. + + The type of an element in the sequence. + The sequence with the elements to translate to string. + A separator between the elements. + Prefix to the entire string. + Suffix to the entire string. + A string of all the elements. + + + + Converts a sequence to a string by converting each element to a string. + + The type of an element in the sequence. + The sequence with the elements to translate to string. + A separator between the elements. + Prefix to the entire string. + A string of all the elements. + + + + Converts a sequence to a string by converting each element to a string. + + The type of an element in the sequence. + The sequence with the elements to translate to string. + A separator between the elements. + A string of all the elements. + + + + Converts a sequence to a string by converting each element to a string. + + The type of an element in the sequence. + The sequence with the elements to translate to string. + A separator between the elements. + A string of all the elements. + + + + Converts a sequence to a string by converting each element to a string. + + The type of an element in the sequence. + The sequence with the elements to translate to string. + A string of all the elements. + + + + Returns a string by converting all the bytes to a hexadecimal string. + + The bytes to convert to a string. + The string to put between every two bytes. + The string resulted by converting all the bytes to hexadecimal strings and putting the separator between them. + + + + Returns a string by converting all the bytes to a hexadecimal string. + + The bytes to convert to a string. + The string resulted by converting all the bytes to hexadecimal strings. + + + + Creates a hash code by xoring the hash codes of the elements in the sequence. + + The type of the elements in the sequence. + The sequence with the elements to create the hash code for. + The hash code created by xoring all the hash codes of the elements in the sequence. + + + + Returns a hash code by xoring all the bytes. + Each byte is xored with the next 8 bits of the integer. + + The bytes to xor. + The hash code resulted by xoring all the bytes. + + + + Returns a hash code by xoring all the ushorts. + Each ushort is xored with the next 16 bits of the integer. + + The ushorts to xor. + The hash code resulted by xoring all the ushorts. + + + + Counts the number of types the given value is contained in the given sequence. + + The type of the elements in the sequence. + The sequence to look for the value in. + The value to look for in the sequence. + The number of types the given value is contained in the given sequence. + + + + Extension methods for char structure. + + + + + True iff the given character is one of the capital english letters. + + The input character to check. + True for capital english letters. + + + + Extension methods for Type. + + + + + Returns all the possible values for the given enum type. + + + + + Extension methods for MemberInfo. + + + + + When overridden in a derived class, returns a sequence of custom attributes identified by System.Type. + + TThe type of attribute to search for. Only attributes that are assignable to this type are returned. + The memberInfo to look the attributes on. + Specifies whether to search this member's inheritance chain to find the attributes. + A sequence of custom attributes applied to this member, or a sequence with zero (0) elements if no attributes have been applied. + + + + Extension methods for IList of type T. + + + + + Wraps a list with a ReadOnlyCollection. + + The type of an element in the collection. + The list to wrap in a ReadOnlyCollection. + + + + + Returns an enumerable of all the elements in the given list starting in a specific offset and taking no more than a specific count. + + The type of an element in the collection. + The list to take the elements from. + The offset of the first element to take. + The maximum number of elements to take. + An enumerable of all the elements in the given list starting in a specific offset and taking no more than a specific count. + + + + Extension methods for IDictionary<TKey,TValue> interface. + + + + + Tests for equality between dictionaries. + Two dictionaries are equal if they have the same pairs. + Keys are compared using Equals() and values are compared using the given comparator. + + The type of the key of the dictionary. + The type of the value of the dictionary. + The first dictionary to compare. + The second dictionary to compare. + The comparator to check for values equality. + True iff the dictionaries are equal. + + + + Tests for equality between dictionaries. + Two dictionaries are equal if they have the same pairs. + Keys are compared using Equals() and values are compared using the default EqualityComparer. + + The type of the key of the dictionary. + The type of the value of the dictionary. + The first dictionary to compare. + The second dictionary to compare. + True iff the dictionaries are equal. + + + + Extension methods for PropertyInfo. + + + + + Returns the value of the given instance's non-indexed property. + + + + + A 128 bit unsigned integer. + + + + + The number of bytes this type will take. + + + + + The minimum UInt128 value. + + + + + The maximum value of this type. + + + + + A Zero UInt128 value. + + + + + Creates a value using two 64 bit values. + + The most significant 64 bits of the value. + The least significant 64 bits of the value. + + + + Conversion of a object to an unsigned 128-bit integer value. + + The value to convert to an unsigned 128-bit integer. + The parameter represents a number less than or greater than . + + + + Defines an explicit conversion of a object to an unsigned 128-bit integer value. + + The value to convert to an unsigned 128-bit integer. + The 128 bit value created by equivalent to . + The parameter represents a number less than or greater than . + + + + Converts the 128 bits unsigned integer to a . + + The 128 bit value to convert. + The value converted from the 128 bit value. + + + + Converts a 64 bit unsigned integer to a 128 bit unsigned integer by taking all the 64 bits. + + The 64 bit value to convert. + The 128 bit value created by taking all the 64 bits of the 64 bit value. + + + + Converts the 128 bits unsigned integer to a 64 bits unsigned integer. + + The 128 bit value to convert. + The 64 bit value converted from the 128 bit value. + + + + Converts the string representation of a number in a specified style and culture-specific format to its equivalent. + + A string that contains a number to convert. + + A bitwise combination of the enumeration values that specify the permitted format of value. + + An object that provides culture-specific formatting information about . + A value that is equivalent to the number specified in the value parameter. + is not a value or includes the or flag along with another value. + is null. + does not comply with the input pattern specified by . + The parameter represents a number less than or greater than . + + The parameter defines the style elements + (such as white space, the positive or negative sign symbol, the group separator symbol, or the decimal point symbol) + that are allowed in the parameter for the parse operation to succeed. + must be a combination of bit flags from the enumeration. + The parameter makes this method overload useful when contains the string representation of a hexadecimal value, + when the number system (decimal or hexadecimal) represented by value is known only at run time, or when you want to disallow white space or a sign symbol in value. + Depending on the value of , the parameter may include the following elements: + [ws][$][sign][digits,]digits[.fractional_digits][E[sign]exponential_digits][ws] + If includes , the parameter may include the following elements: + [ws]hexdigits[ws] + Elements in square brackets ([ and ]) are optional. The following table describes each element. + + + Element + Description + + + ws + + Optional white space. + White space can appear at the start of value if includes the flag, + and it can appear at the end of value if includes the flag. + + + + $ + + A culture-specific currency symbol. + Its position in the string is defined by the and properties of the culture indicated by the parameter. + The current culture's currency symbol can appear in value if includes the flag. + + + + sign + + An optional sign. + The sign can appear at the start of if includes the flag, + and it can appear at the end of if includes the flag. + Parentheses can be used in to indicate a negative value if includes the flag. + + + + digits, fractional_digits, exponential_digits + A sequence of digits from 0 through 9. A sequence of digits from 0 through 9. For fractional_digits, only the digit 0 is valid. + + + , + + A culture-specific group separator symbol. + The group separator symbol of the culture specified by can appear in if includes the flag. + + + + . + + A culture-specific decimal point symbol. + The decimal point symbol of the culture designated by can appear in if includes the flag. + Only the digit 0 can appear as a fractional digit for the parse operation to succeed; + if fractional_digits includes any other digit, a is thrown. + + + + E + + The "e" or "E" character, which indicates that the value is represented in exponential (scientific) notation. + The parameter can represent a number in exponential notation if includes the flag. + + + + hexdigits + A sequence of hexadecimal digits from 0 through f, or 0 through F. + + + If you use the method to round-trip the string representation of a value that was output by the method, + you should use the method with the "R" format specifier to generate the string representation of the value. + Otherwise, the string representation of the preserves only the 50 most significant digits of the original value, and data may be lost when you use the method to restore the value. + + Unlike the other values, which allow for but do not require the presence of particular style elements in , + the style value means that the individual numeric characters in are always interpreted as hexadecimal characters. + Valid hexadecimal characters are 0-9, A-F, and a-f. + The only other flags that can be combined with the parameter are and . + (The enumeration includes a composite number style, , that includes both white-space flags.) + + + If is the string representation of a hexadecimal number, it cannot be preceded by any decoration (such as 0x or &h) that differentiates it as a hexadecimal number. + This causes the conversion to fail. + + If is a hexadecimal string, the method interprets as a negative number stored by using two's complement representation if its first two hexadecimal digits are greater than or equal to 0x80. + In other words, the method interprets the highest-order bit of the first byte in as the sign bit. + To make sure that a hexadecimal string is correctly interpreted as a positive number, the first digit in must have a value of zero. + For example, the method interprets 0x80 as a negative value, but it interprets either 0x080 or 0x0080 as a positive value. + + The parameter is an implementation. + Its method returns a object that provides culture-specific information about the format of value. + Typically, can be any one of the following: + + + A object that represents the culture that provides numeric formatting information. + Its method returns the object that provides numeric formatting information. + + A object that provides formatting information. (Its implementation of just returns itself.) + + A custom object that implements and uses the method + to instantiate and return the object that provides formatting information. + + + If is , the object for the current culture is used. + + + + + + Converts the string representation of a number in a specified culture-specific format to its equivalent. + Uses style. + + A string that contains a number to convert. + An object that provides culture-specific formatting information about . + A value that is equivalent to the number specified in the value parameter. + is null. + The parameter represents a number less than or greater than . + + See important remarks in + + + + + Converts the string representation of a number in a specified style to its equivalent. + Uses as the format provider. + + A string that contains a number to convert. + A bitwise combination of the enumeration values that specify the permitted format of value. + A value that is equivalent to the number specified in the value parameter. + is not a value or includes the or flag along with another value. + is null. + does not comply with the input pattern specified by . + The parameter represents a number less than or greater than . + + See important remarks in + + + + + Converts the string representation of a number in a specified style to its equivalent. + Uses style. + Uses as the format provider. + + A string that contains a number to convert. + A value that is equivalent to the number specified in the value parameter. + is null. + The parameter represents a number less than or greater than . + + See important remarks in + + + + + Tries to convert the string representation of a number in a specified style and culture-specific format to its equivalent, + and returns a value that indicates whether the conversion succeeded. + + The string representation of a number. The string is interpreted using the style specified by . + + A bitwise combination of enumeration values that indicates the style elements that can be present in . + A typical value to specify is . + + An object that supplies culture-specific formatting information about . + + When this method returns, contains the equivalent to the number that is contained in value, or if the conversion failed. + The conversion fails if the value parameter is , is not in a format that is compliant with or represents a number that is less than or greater than . + This parameter is passed uninitialized. + true if the parameter was converted successfully; otherwise, false. + + The method is like the method, + except that it does not throw an exception if the conversion fails. + This method eliminates the need to use exception handling to test for a if is invalid and cannot be parsed successfully. + For more information see + + + + + Tries to convert the string representation of a number to its equivalent, + and returns a value that indicates whether the conversion succeeded. + + The string representation of a number. + + When this method returns, contains the equivalent to the number that is contained in value, or if the conversion failed. + The conversion fails if the value parameter is or represents a number that is less than or greater than . + This parameter is passed uninitialized. + true if the parameter was converted successfully; otherwise, false. + + The method is like the method, + except that it does not throw an exception if the conversion fails. + This method eliminates the need to use exception handling to test for a if is invalid and cannot be parsed successfully. + For more information see + + + + + Returns true iff the two values represent the same value. + + The value to compare to. + True iff the two values represent the same value. + + + + Indicates whether this instance and a specified object are equal. + + + true if and this instance are the same type and represent the same value; otherwise, false. + + Another object to compare to. 2 + + + + Returns true iff the two values represent the same value. + + The first value to compare. + The second value to compare. + True iff the two values represent the same value. + + + + Returns true iff the two values represent different values. + + The first value to compare. + The second value to compare. + True iff the two values represent different values. + + + + Shifts its first operand right by the number of bits specified by its second operand. + + The value to shift. + The number of bits to shift. + The value after it was shifted by the given number of bits. + + + + Shifts its first operand right by the number of bits specified by its second operand. + + The value to shift. + The number of bits to shift. + The value after it was shifted by the given number of bits. + + + + Bitwise ands between two values. + + The first value to do bitwise and. + The second value to do bitwise and. + The two values after they were bitwise anded. + + + + Bitwise ands between two values. + + The first value to do bitwise and. + The second value to do bitwise and. + The two values after they were bitwise anded. + + + + Returns the hash code for this instance. + + + A 32-bit signed integer that is the hash code for this instance. + + 2 + + + + Converts the numeric value of the current object to its equivalent string representation by using the specified format and culture-specific format information. + + A standard or custom numeric format string. + An object that supplies culture-specific formatting information. + The string representation of the current value as specified by the and parameters. + is not a valid format string. + + The parameter can be any valid standard numeric format specifier, or any combination of custom numeric format specifiers. + If is equal to or is , the return value of the current object is formatted with the general format specifier ("G"). + If is any other value, the method throws a . + + The parameter is an implementation. + Its method returns a object that provides culture-specific information about the format of the string returned by this method. + When the method is invoked, it calls the parameter's method and passes it a object that represents the type. + The method then returns the object that provides information for formatting the object, such as the negative sign symbol, the group separator symbol, or the decimal point symbol. + There are three ways to use the parameter to supply formatting information to the method: + + + You can pass a object that represents the culture that provides numeric formatting information. + Its method returns the object that provides numeric formatting information. + + You can pass the actual object that provides formatting information. (Its implementation of just returns itself.) + + You can pas a custom object that implements and uses the method + to instantiate and return the object that provides formatting information. + + + If is , the formatting of the returned string is based on the object of the current culture. + + + + + + Converts the numeric value of the current object to its equivalent string representation by using the specified format. + Uses as the format provider. + + A standard or custom numeric format string. + The string representation of the current value as specified by the parameter. + is not a valid format string. + + See for remarks. + + + + + Converts the numeric value of the current object to its equivalent string representation by using the specified culture-specific format information. + Uses "G" format. + + An object that supplies culture-specific formatting information. + The string representation of the current value as specified by the parameter. + + See for remarks. + + + + + Converts the numeric value of the current object to its equivalent string representation. + Uses "G" format. + Uses as the format provider. + + The string representation of the current value. + + See for remarks. + + + + + Extension methods for TimeSpan. + + + + + Divides the TimeSpan by a given value. + + The TimeSpan to divide. + The value to divide the TimeSpan by. + A TimeSpan value equals to the given TimeSpan divided by the given value. + + + + Multiplies the TimeSpan by a given value. + + The TimeSpan to multiply. + The value to multiply the TimeSpan by. + A TimeSpan value equals to the given TimeSpan multiplied by the given value. + + + + A 48 bit unsigned integer. + + + + + The number of bytes this type will take. + + + + + The minimum value of this type. + + + + + The maximum value of this type. + + + + + Converts the string representation of a number to its 48-bit unsigned integer equivalent. + + A string that represents the number to convert. + A 48-bit unsigned integer equivalent to the number contained in . + The parameter is . + The parameter is not in the correct format. + The parameter represents a number less than or greater than . + + The parameter should be the string representation of a number in the following form. + [ws][sign]digits[ws] + Elements in square brackets ([ and ]) are optional. The following table describes each element. + + + Element + Description + + wsOptional white space. + + sign + + An optional sign. + Valid sign characters are determined by the and properties of the current culture. + However, the negative sign symbol can be used only with zero; otherwise, the method throws an . + + + digitsA sequence of digits from 0 through 9. Any leading zeros are ignored. + + + The parameter is interpreted using the style. + It cannot contain any group separators or decimal separator, and it cannot have a decimal portion. + + The parameter is parsed by using the formatting information in a object that is initialized for the current system culture. + For more information, see . + To parse a string by using the formatting information of a specific culture, use the method. + + + + + Converts the string representation of a number in a specified culture-specific format to its 48-bit unsigned integer equivalent. + + A string that represents the number to convert. + An object that supplies culture-specific formatting information about . + A 48-bit unsigned integer equivalent to the number specified in . + The parameter is . + The parameter is not in the correct style. + + The parameter represents a number less than or greater than . + + + This overload of the Parse(String, IFormatProvider) method is typically used to convert text that can be formatted in a variety of ways to a value. + For example, it can be used to convert the text entered by a user into an HTML text box to a numeric value. + The parameter contains a number of the form: + [ws][sign]digits[ws] + + Elements in square brackets ([ and ]) are optional. + The following table describes each element: + + + + Element + Description + + wsOptional white space. + + sign + An optional positive sign, or a negative sign if represents the value zero. + + digitsA sequence of digits from 0 through 9. + + The parameter is interpreted using the style. + In addition to the unsigned integer value's decimal digits, only leading and trailing spaces along with a leading sign is allowed. + (If the negative sign is present, must represent a value of zero, or the method throws an .) + To explicitly define the style elements together with the culture-specific formatting information that can be present in , use the method. + + The parameter is an implementation whose method returns a object that provides culture-specific information about the format of . + There are three ways to use the parameter to supply custom formatting information to the parse operation: + + + You can pass the actual object that provides formatting information. (Its implementation of simply returns itself.) + You can pass a object that specifies the culture whose formatting is to be used. Its property provides formatting information. + You can pass a custom implementation. Its method must instantiate and return the object that provides formatting information. + + If provider is , the object for the current culture is used. + + + + + Converts the string representation of a number in a specified style to its 48-bit unsigned integer equivalent. + + + A string that represents the number to convert. + The string is interpreted by using the style specified by the parameter. + + + A bitwise combination of the enumeration values that specifies the permitted format of . + A typical value to specify is . + + A 48-bit unsigned integer equivalent to the number specified in . + The parameter is . + + is not a value. + -or- + is not a combination of and values. + + The parameter is not in a format compliant with . + + The parameter represents a number less than or greater than . + -or- + includes non-zero, fractional digits. + + + The parameter defines the style elements (such as white space, the positive or negative sign symbol, the group separator symbol, or the decimal point symbol) that are allowed in the s parameter for the parse operation to succeed. + It must be a combination of bit flags from the enumeration. + Depending on the value of style, the parameter may include the following elements: + [ws][$][sign][digits,]digits[.fractional_digits][E[sign]exponential_digits][ws] + + Elements in square brackets ([ and ]) are optional. + If includes , the parameter may contain the following elements: + + [ws]hexdigits[ws] + The following table describes each element. + + + Element + Description + + + ws + + Optional white space. + White space can appear at the start of if includes the flag, + and it can appear at the end of if includes the flag. + + + + $ + + A culture-specific currency symbol. + Its position in the string is defined by the and properties of the current culture. + The current culture's currency symbol can appear in if includes the flag. + + + + sign + + An optional sign. + The sign can appear at the start of if includes the flag, and it can appear at the end of if includes the flag. + Parentheses can be used in to indicate a negative value if includes the flag. + However, the negative sign symbol can be used only with zero; otherwise, the method throws an . + + + + digits + A sequence of digits from 0 through 9. + + + . + + A culture-specific decimal point symbol. + The current culture's decimal point symbol can appear in if includes the flag. + + + + , + + A culture-specific group separator symbol. + The current culture's group separator can appear in if includes the flag. + + + fractional_digits + + One or more occurrences of the digit 0-9 if includes the flag, + or one or more occurrences of the digit 0 if it does not. + Fractional digits can appear in only if includes the flag. + + + + E + + The "e" or "E" character, which indicates that the value is represented in exponential (scientific) notation. + The parameter can represent a number in exponential notation if includes the flag. + + + + exponential_digits + + A sequence of digits from 0 through 9. + The parameter can represent a number in exponential notation if includes the flag. + + + hexdigitsA sequence of hexadecimal digits from 0 through f, or 0 through F. + + A string with decimal digits only (which corresponds to the style) always parses successfully. + Most of the remaining members control elements that may be present, but are not required to be present, in this input string. + The following table indicates how individual members affect the elements that may be present in . + + + value + Elements permitted in in addition to digits + + The digits element only. + The decimal point (.) and fractional_digits elements. However, if does not include the flag, fractional_digits must consist of only one or more 0 digits; otherwise, an is thrown. + The "e" or "E" character, which indicates exponential notation, along with exponential_digits. + The ws element at the start of . + The ws element at the end of . + The sign element at the start of . + The sign element at the end of . + The sign element in the form of parentheses enclosing the numeric value. + The group separator (,) element. + The currency ($) element. + All elements. However, cannot represent a hexadecimal number or a number in exponential notation. + The ws element at the start or end of , sign at the start of , and the decimal point (.) symbol. The parameter can also use exponential notation. + The ws, sign, group separator (,), and decimal point (.) elements. + All elements. However, cannot represent a hexadecimal number. + + Unlike the other values, which allow for, but do not require, the presence of particular style elements in , the style value means that the individual numeric characters in are always interpreted as hexadecimal characters. + Valid hexadecimal characters are 0-9, A-F, and a-f. + The only other flags that can be combined with the parameter are and . + (The enumeration includes a composite number style, , that includes both white-space flags.) + + If is the string representation of a hexadecimal number, it cannot be preceded by any decoration (such as 0x or &h) that differentiates it as a hexadecimal number. + This causes the conversion to fail. + + The parameter is parsed by using the formatting information in a object that is initialized for the current system culture. + To specify the culture whose formatting information is used for the parse operation, call the overload. + + + + + Converts the string representation of a number in a specified style and culture-specific format to its 48-bit unsigned integer equivalent. + + + A string that represents the number to convert. + The string is interpreted by using the style specified by the parameter. + + + A bitwise combination of enumeration values that indicates the style elements that can be present in . + A typical value to specify is . + + An object that supplies culture-specific formatting information about . + A 48-bit unsigned integer equivalent to the number specified in . + The parameter is . + + is not a value. + -or- + is not a combination of and values. + + The parameter is not in a format compliant with . + + The parameter represents a number less than or greater than . + -or- + includes non-zero, fractional digits. + + + The parameter defines the style elements (such as white space, the positive or negative sign symbol, the group separator symbol, or the decimal point symbol) that are allowed in the s parameter for the parse operation to succeed. + It must be a combination of bit flags from the enumeration. + Depending on the value of style, the parameter may include the following elements: + [ws][$][sign][digits,]digits[.fractional_digits][E[sign]exponential_digits][ws] + + Elements in square brackets ([ and ]) are optional. + If includes , the parameter may contain the following elements: + + [ws]hexdigits[ws] + The following table describes each element. + + + Element + Description + + + ws + + Optional white space. + White space can appear at the start of if includes the flag, + and it can appear at the end of if includes the flag. + + + + $ + + A culture-specific currency symbol. + Its position in the string is defined by the and properties of the object that is returned by the method of the provider parameter. + The currency symbol can appear in if includes the flag. + + + + sign + + An optional sign. + The sign can appear at the start of if includes the flag, and it can appear at the end of if includes the flag. + Parentheses can be used in to indicate a negative value if includes the flag. + However, the negative sign symbol can be used only with zero; otherwise, the method throws an . + + + digitsA sequence of digits from 0 through 9. + + . + + A culture-specific decimal point symbol. + The current culture's decimal point symbol can appear in if includes the flag. + + + + , + + A culture-specific group separator symbol. + The current culture's group separator can appear in if includes the flag. + + + fractional_digits + + One or more occurrences of the digit 0-9 if includes the flag, + or one or more occurrences of the digit 0 if it does not. + Fractional digits can appear in only if includes the flag. + + + + E + + The "e" or "E" character, which indicates that the value is represented in exponential (scientific) notation. + The parameter can represent a number in exponential notation if includes the flag. + + + + exponential_digits + + A sequence of digits from 0 through 9. + The parameter can represent a number in exponential notation if includes the flag. + + + hexdigitsA sequence of hexadecimal digits from 0 through f, or 0 through F. + + A string with decimal digits only (which corresponds to the style) always parses successfully. + Most of the remaining members control elements that may be present, but are not required to be present, in this input string. + The following table indicates how individual members affect the elements that may be present in . + + + value + Elements permitted in in addition to digits + + The digits element only. + The decimal point (.) and fractional_digits elements. However, if does not include the flag, fractional_digits must consist of only one or more 0 digits; otherwise, an is thrown. + The "e" or "E" character, which indicates exponential notation, along with exponential_digits. + The ws element at the start of . + The ws element at the end of . + The sign element at the start of . + The sign element at the end of . + The sign element in the form of parentheses enclosing the numeric value. + The group separator (,) element. + The currency ($) element. + All elements. However, cannot represent a hexadecimal number or a number in exponential notation. + The ws element at the start or end of , sign at the start of , and the decimal point (.) symbol. The parameter can also use exponential notation. + The ws, sign, group separator (,), and decimal point (.) elements. + All elements. However, cannot represent a hexadecimal number. + + Unlike the other values, which allow for, but do not require, the presence of particular style elements in , the style value means that the individual numeric characters in are always interpreted as hexadecimal characters. + Valid hexadecimal characters are 0-9, A-F, and a-f. + The only other flags that can be combined with the parameter are and . + (The enumeration includes a composite number style, , that includes both white-space flags.) + + If is the string representation of a hexadecimal number, it cannot be preceded by any decoration (such as 0x or &h) that differentiates it as a hexadecimal number. + This causes the conversion to fail. + + The parameter is an implementation whose method returns a object that provides culture-specific information about the format of . + There are three ways to use the parameter to supply custom formatting information to the parse operation: + + You can pass the actual object that provides formatting information. (Its implementation of simply returns itself.) + You can pass a object that specifies the culture whose formatting is to be used. Its property provides formatting information. + You can pass a custom implementation. Its method must instantiate and return the object that provides formatting information. + + If provider is , the object for the current culture is used. + + + + + Converts a 32 bit unsigned integer to a 48 bit unsigned integer by taking all the 32 bits. + + The 32 bit value to convert. + The 48 bit value created by taking all the 32 bits of the 32bit value. + + + + Converts a 64 bit signed integer to a 48 bit unsigned integer by taking the 48 least significant bits. + + The 64 bit value to convert. + The 48 bit value created by taking the 48 least significant bits of the 64 bit value. + + + + Converts a 64 bit unsigned integer to a 48 bit unsigned integer by taking the 48 least significant bits. + + The 64 bit value to convert. + The 48 bit value created by taking the 48 least significant bits of the 64 bit value. + + + + Converts the 48 bits unsigned integer to a 64 bits signed integer. + + The 48 bit value to convert. + The 64 bit value converted from the 48 bit value. + + + + Converts the 48 bits unsigned integer to a 64 bits unsigned integer. + + The 48 bit value to convert. + The 64 bit value converted from the 48 bit value. + + + + Converts the 48 bits unsigned integer to an 8 bits unsigned integer. + + The 48 bit value to convert. + The 8 bit value converted from the 48 bit value. + + + + Returns true iff the two values represent the same value. + + The value to compare to. + True iff the two values represent the same value. + + + + Indicates whether this instance and a specified object are equal. + + + true if and this instance are the same type and represent the same value; otherwise, false. + + Another object to compare to. 2 + + + + Returns true iff the two values represent the same value. + + The first value to compare. + The second value to compare. + True iff the two values represent the same value. + + + + Returns true iff the two values represent different values. + + The first value to compare. + The second value to compare. + True iff the two values represent different values. + + + + Returns the hash code for this instance. + + + A 32-bit signed integer that is the hash code for this instance. + + 2 + + + + Returns the fully qualified type name of this instance. + + + A containing a fully qualified type name. + + 2 + + + + Extension methods for Match class. + + + + + Returns all the values that were captured for a given group name. + + The match to take the captured values from. + The name of the capture group to take the values of. + All the values that were captured for a given group name. + + + + Extension methods for Func of type T. + + + + + Generates an array of a given size by generating elements using the given delegate. + + The type of the array to create. + The delegate to generate elements with. + The size of the array to create. + An array of a given size with elements generated by the given delegate. + + + diff --git a/dep/pcapnet/PcapDotNet.Base.dll b/dep/pcapnet/PcapDotNet.Base.dll new file mode 100644 index 00000000..1396a32b Binary files /dev/null and b/dep/pcapnet/PcapDotNet.Base.dll differ diff --git a/dep/pcapnet/PcapDotNet.Core.Extensions.XML b/dep/pcapnet/PcapDotNet.Core.Extensions.XML new file mode 100644 index 00000000..a3cbb807 --- /dev/null +++ b/dep/pcapnet/PcapDotNet.Core.Extensions.XML @@ -0,0 +1,96 @@ + + + + PcapDotNet.Core.Extensions + + + + + Extension methods for LivePacketDevice class. + + + + + Returns the GUID (NetCfgInstanceId) for a instance. + The GUID is parsed from the property. + + The instance. + The GUID (NetCfgInstanceId) of the instance. + When the doesn't match the expectations. + + + + Returns the PNPDeviceID for a instance. + The PNPDeviceID is retrieved by querying the registry. + + The instance. + The PNPDeviceID of the instance. + When the PNPDeviceID cannot be retrieved from the registry. + + + + Returns the network interface of the packet device. + The interface is found using its id. + If no interface is found, null is returned. + + The LivePacketDevice to look for a matching network interface for. + The network interface found according to the given device or null if none is found. + + + + Returns the of the network interface of the given device. + If no interface matches the given packet device, an exception is thrown. + We first look for the device using and if that fails we look for them using WMI. + + The packet device to look for the matching interface. + The of the given device's matching interface. + + + + Returns the for a instance. + The is retrieved through using WMI. + + The instance. + The of the instance. + When the cannot be retrieved using WMI. + + + + Different extension methods for PacketCommunicator class. + + + + + + Collect a group of packets. + Similar to ReceivePackets() except instead of calling a callback the packets are returned as an IEnumerable. + + + + The PacketCommunicator to work on + Number of packets to process. A negative count causes ReceivePackets() to loop until the IEnumerable break (or until an error occurs). + An IEnumerable of Packets to process. + Thrown if the mode is not Capture or an error occurred. + + Only the first bytes of data from the packet might be in the received packet (which won't necessarily be the entire packet; to capture the entire packet, you will have to provide a value for snapshortLength in your call to PacketDevice.Open() that is sufficiently large to get all of the packet's data - a value of 65536 should be sufficient on most if not all networks). + If a break is called on the returned Enumerable before the number of packets asked for received, the packet that was handled while breaking the enumerable may not be the last packet read. More packets might be read. This is because this method actually loops over calls to ReceiveSomePackets() + + + + + Collect a group of packets. + Similar to ReceivePackets() except instead of calling a callback the packets are returned as an IEnumerable. + Loops until the IEnumerable break (or until an error occurs). + + + + The PacketCommunicator to work on + An IEnumerable of Packets to process. + Thrown if the mode is not Capture or an error occurred. + + Only the first bytes of data from the packet might be in the received packet (which won't necessarily be the entire packet; to capture the entire packet, you will have to provide a value for snapshortLength in your call to PacketDevice.Open() that is sufficiently large to get all of the packet's data - a value of 65536 should be sufficient on most if not all networks). + If a break is called on the returned Enumerable, the packet that was handled while breaking the enumerable may not be the last packet read. More packets might be read. This is because this method actually loops over calls to ReceiveSomePackets() + + + + diff --git a/dep/pcapnet/PcapDotNet.Core.Extensions.dll b/dep/pcapnet/PcapDotNet.Core.Extensions.dll new file mode 100644 index 00000000..66632e11 Binary files /dev/null and b/dep/pcapnet/PcapDotNet.Core.Extensions.dll differ diff --git a/dep/pcapnet/PcapDotNet.Core.dll b/dep/pcapnet/PcapDotNet.Core.dll new file mode 100644 index 00000000..846e9cec Binary files /dev/null and b/dep/pcapnet/PcapDotNet.Core.dll differ diff --git a/dep/pcapnet/PcapDotNet.Core.xml b/dep/pcapnet/PcapDotNet.Core.xml new file mode 100644 index 00000000..f639b9bf --- /dev/null +++ b/dep/pcapnet/PcapDotNet.Core.xml @@ -0,0 +1,1153 @@ + + + + "PcapDotNet.Core" + + + + +The Pcap library version. + + + + +This class holds methods for general pcap library functionality. + + + + +Send a buffer of packets to the network. +This function transmits the content of a queue to the wire. + + Contains the packets to send. + Determines if the send operation must be synchronized: if it is true, the packets are sent respecting the timestamps, otherwise they are sent as fast as possible. + An error occurred during the send. The error can be caused by a driver/adapter problem or by an inconsistent/bogus send buffer.. + + + Using this function is more efficient than issuing a series of SendPacket(), because the packets are buffered in the kernel driver, so the number of context switches is reduced. Therefore, expect a better throughput when using Transmit(). + When isSync is true, the packets are synchronized in the kernel with a high precision timestamp. This requires a non-negligible amount of CPU, but allows normally to send the packets with a precision of some microseconds (depending on the accuracy of the performance counter of the machine). Such a precision cannot be reached sending the packets with SendPacket(). + + + + + +Statistics on current capture. +The values represent packet statistics from the start of the run to the time of the call. + + Thrown if there is an error or the underlying packet capture doesn't support packet statistics. + + + +A network device packet communicator. + + + + +Open a generic source in order to capture / send (WinPcap only) traffic. + + Length of the packet that has to be retained. For each packet received by the filter, only the first 'snapshotLength' bytes are stored in the buffer and passed to the user application. For instance, snaplen equal to 100 means that only the first 100 bytes of each packet are stored. + Keeps several flags that can be needed for capturing packets. + Read timeout in milliseconds. The read timeout is used to arrange that the read not necessarily return immediately when a packet is seen, but that it waits for some amount of time to allow more packets to arrive and to read multiple packets from the OS kernel in one operation. Not all platforms support a read timeout; on platforms that don't, the read timeout is ignored. + Thrown on failure. + + + +List of addresses for the interface. + + + + +Interface flags. Currently the only possible flag is Loopback, that is set if the interface is a loopback interface. + + + + +if not null, a string giving a human-readable description of the device. + + + + +A string giving a name for the device. + + + + +Create a list of local machine network devices that can be opened with Open(). +Platform independent. + + +A readonly collection of LivePacketDevices. + + +Thrown if some errors occurred. +An error could be due to several reasons: + libpcap/WinPcap was not installed on the local/remote host.The user does not have enough privileges to list the devices.A network problem.other errors (not enough memory and others). + +There may be network devices that cannot be opened with Open() by the process calling AllLocalMachine, because, for example, that process might not have sufficient privileges to open them for capturing; if so, those devices will not appear on the list. + + + + +A live interface. + + + + +No sampling has to be done on the current capture. +In this case, no sampling algorithms are applied to the current capture. + + + + +Open a generic source in order to capture / send (WinPcap only) traffic. + + length of the packet that has to be retained. For each packet received by the filter, only the first 'snapshotLength' bytes are stored in the buffer and passed to the user application. For instance, snaplen equal to 100 means that only the first 100 bytes of each packet are stored. + Keeps several flags that can be needed for capturing packets. + Read timeout in milliseconds. The read timeout is used to arrange that the read not necessarily return immediately when a packet is seen, but that it waits for some amount of time to allow more packets to arrive and to read multiple packets from the OS kernel in one operation. Not all platforms support a read timeout; on platforms that don't, the read timeout is ignored. + Thrown on failure. + + + +List of addresses for the interface. + + + + +Interface flags. Currently the only possible flag is Loopback, that is set if the interface is a loopback interface. + + + + +if not null, a string giving a human-readable description of the device. + + + + +A string giving a name for the device. + + + + +Creates a device object from a pcap file. +The device can opened to read packets from. + + The name of the pcap file. + + + +An offline interface - a pcap file to read packets from. + + + + +Open a generic source in order to capture / send (WinPcap only) traffic. +Uses maxmimum snapshotLength (65536), promiscuous mode and 1 second read timeout. + + + + +Open a generic source in order to capture / send (WinPcap only) traffic. + + Length of the packet that has to be retained. For each packet received by the filter, only the first 'snapshotLength' bytes are stored in the buffer and passed to the user application. For instance, snaplen equal to 100 means that only the first 100 bytes of each packet are stored. + Keeps several flags that can be needed for capturing packets. + Read timeout in milliseconds. The read timeout is used to arrange that the read not necessarily return immediately when a packet is seen, but that it waits for some amount of time to allow more packets to arrive and to read multiple packets from the OS kernel in one operation. Not all platforms support a read timeout; on platforms that don't, the read timeout is ignored. + Thrown on failure. + + + +List of addresses for the interface. + + + + +Interface flags. Currently the only possible flag is Loopback, that is set if the interface is a loopback interface. + + + + +if not null, a string giving a human-readable description of the device. + + + + +A string giving a name for the device. + + + + +This snapshort length value should be sufficient, on most if not all networks, to capture all the data available from the packet. + + + + +The base class of a live or offline interface. + + + + +Open a generic source in order to capture / send (WinPcap only) traffic. +Uses maxmimum snapshotLength (65536), promiscuous mode and 1 second read timeout. + + + + +Open a generic source in order to capture / send (WinPcap only) traffic. + + Length of the packet that has to be retained. For each packet received by the filter, only the first 'snapshotLength' bytes are stored in the buffer and passed to the user application. For instance, snaplen equal to 100 means that only the first 100 bytes of each packet are stored. + Keeps several flags that can be needed for capturing packets. + Read timeout in milliseconds. The read timeout is used to arrange that the read not necessarily return immediately when a packet is seen, but that it waits for some amount of time to allow more packets to arrive and to read multiple packets from the OS kernel in one operation. Not all platforms support a read timeout; on platforms that don't, the read timeout is ignored. + Thrown on failure. + + + +List of addresses for the interface. + + + + +Interface flags. Currently the only possible flag is Loopback, that is set if the interface is a loopback interface. + + + + +if not null, a string giving a human-readable description of the device. + + + + +A string giving a name for the device. +The name of the device is returned directly by the network card driver. + + + + +Represents a live or offline interface. + + + + +Attributes of a device. + + + + +Interface is loopback. + + + + +No attributes apply. + + + + +Transmit is not supported on offline captures. + + Thrown always. + + + +TotalStatistics is not supported on offline captures. + + Thrown always. + + + +Close the files associated with the capture and deallocates resources. + + + + +Open a file to write packets. +Called to open an offline capture for writing. The name "-" in a synonym for stdout. + + Specifies the name of the file to open. + +A dump file to dump packets capture by the communicator. + + Thrown on failure. + +The created dump file should be disposed by the user. + + + + +Compile and associate a filter to a capture. +This method actually wraps a call to CreateFilter(), SetFilter() and Dispose(). + + A high level filtering expression (see WinPcap Filtering expression syntax). + Thrown on failure. + + + +Associate a filter to a capture. + + The filter to associate. Usually the result of a call to CreateFilter(). + Thrown on failure. + + + +Compile a packet filter according to the communicator IPv4 netmask. + todo bug in documentation + + A high level filtering expression (see WinPcap Filtering expression syntax) + +The compiled filter that can be applied on the communicator. + + An error occurred. + +The created filter should be disposed by the user. + + + + +Send a buffer of packets to the network. +This function transmits the content of a queue to the wire. + + Contains the packets to send. + Determines if the send operation must be synchronized: if it is true, the packets are sent respecting the timestamps, otherwise they are sent as fast as possible. + Trying to transmit to an offline device or an error occurred during the send. The error can be caused by a driver/adapter problem or by an inconsistent/bogus send buffer. + + + Using this function is more efficient than issuing a series of SendPacket(), because the packets are buffered in the kernel driver, so the number of context switches is reduced. Therefore, expect a better throughput when using Transmit(). + When isSync is true, the packets are synchronized in the kernel with a high precision timestamp. This requires a non-negligible amount of CPU, but allows normally to send the packets with a precision of some microseconds (depending on the accuracy of the performance counter of the machine). Such a precision cannot be reached sending the packets with SendPacket(). + + + + + +Send a raw packet. +This function allows to send a raw packet to the network. + + The packet to send (including the various protocol headers). The MAC CRC doesn't need to be included, because it is transparently calculated and added by the network interface driver. + The packet wasn't successfully sent. + + + +Set a flag that will force ReceiveSomePackets(), ReceivePackets() or ReceiveStatistics() to return rather than looping. +They will return the number of packets/statistics that have been processed so far, with return value BreakLoop. + + + + This routine is safe to use inside a signal handler on UNIX or a console control handler on Windows, as it merely sets a flag that is checked within the loop. + The flag is checked in loops reading packets from the OS - a signal by itself will not necessarily terminate those loops - as well as in loops processing a set of packets/statistics returned by the OS. + Note that if you are catching signals on UNIX systems that support restarting system calls after a signal, and calling Break() in the signal handler, you must specify, when catching those signals, that system calls should NOT be restarted by that signal. Otherwise, if the signal interrupted a call reading packets in a live capture, when your signal handler returns after calling Break(), the call will be restarted, and the loop will not terminate until more packets arrive and the call completes. + ReceivePacket() will, on some platforms, loop reading packets from the OS; that loop will not necessarily be terminated by a signal, so Break() should be used to terminate packet processing even if ReceivePacket() is being used. + Break() does not guarantee that no further packets/statistics will be processed by ReceiveSomePackets(), ReceivePackets() or ReceiveStatistics() after it is called; at most one more packet might be processed. + If BreakLoop is returned from ReceiveSomePackets(), ReceivePackets() or ReceiveStatistics(), the flag is cleared, so a subsequent call will resume reading packets. If a different return value is returned, the flag is not cleared, so a subsequent call will return BreakLoop and clear the flag. + + + + + +Collect a group of statistics every readTimeout given in LivePacketDevice.Open(). + + Number of statistics to process. A negative count causes ReceiveStatistics() to loop forever (or at least until an error occurs). + Specifies a routine to be called with one argument: the statistics received. + + + + Return value + description + + + Ok + Count is exhausted + + + BreakLoop + Indicates that the loop terminated due to a call to Break() before count statistics were processed. + + + + Thrown if the mode is not Statistics or an error occurred. + + + +Receives a single statistics data on packets from an interface instead of receiving the packets. +The statistics can be received in the resolution set by readTimeout when calling LivePacketDevice.Open(). + + The received statistics if it was read without problems. null otherwise. + + + + Return value + description + + + Ok + The statistics has been read without problems. In statistics mode the readTimeout is always used and it never runs on offline captures so Ok is the only valid result. + + + + Thrown if the mode is not Statistics or an error occurred. + + + +Collect a group of packets. +Similar to ReceiveSomePackets() except it keeps reading packets until conut packets are processed or an error occurs. It does not return when live read timeouts occur. + + Number of packets to process. A negative count causes ReceivePackets() to loop forever (or at least until an error occurs). + Specifies a routine to be called with one argument: the packet received. + + + + Return value + description + + + Ok + Count is exhausted + + + Eof + Count wasn't exhausted and EOF was reached reading from an offline capture. + + + BreakLoop + Indicates that the loop terminated due to a call to Break() before count packets were processed. + + + + Thrown if the mode is not Capture or an error occurred. + + + +Collect a group of packets. +Used to collect and process packets. + + + + Specifies the maximum number of packets to process before returning. + This is not a minimum number; when reading a live capture, only one bufferful of packets is read at a time, so fewer than maxPackets packets may be processed. + + A maxPackets of -1 processes all the packets received in one buffer when reading a live capture, or all the packets in the file when reading an offline capture. + + Specifies a routine to be called with one argument: the packet received. + + The number of packets read is returned. + 0 is returned if no packets were read from a live capture (if, for example, they were discarded because they didn't pass the packet filter, or if, on platforms that support a read timeout that starts before any packets arrive, the timeout expires before any packets arrive, or if the communicator is in non-blocking mode and no packets were available to be read) or if no more packets are available in an offline capture. + + + + + Return value + description + + + Ok + countGot packets has been read without problems. This includes the case where a read timeout occurred and the case the communicator is in non-blocking mode and no packets were available + + + Eof + EOF was reached reading from an offline capture. + + + BreakLoop + Indicates that the loop terminated due to a call to Break() before any packets were processed. + + + + Thrown if the mode is not Capture or an error occurred. + + Only the first bytes of data from the packet might be in the received packet (which won't necessarily be the entire packet; to capture the entire packet, you will have to provide a value for snapshortLength in your call to PacketDevice.Open() that is sufficiently large to get all of the packet's data - a value of 65536 should be sufficient on most if not all networks). + When reading a live capture, ReceiveSomePackets() will not necessarily return when the read times out; on some platforms, the read timeout isn't supported, and, on other platforms, the timer doesn't start until at least one packet arrives. This means that the read timeout should NOT be used in, for example, an interactive application, to allow the packet capture loop to ``poll'' for user input periodically, as there's no guarantee that ReceiveSomePackets() will return after the timeout expires. + + + + +Read a packet from an interface or from an offline capture. +This function is used to retrieve the next available packet, bypassing the callback method traditionally provided. +The method fills the packet parameter with the next captured packet. + + The received packet if it was read without problems. null otherwise. + + + + Return value + description + + + Ok + The packet has been read without problems. + + + Timeout + The timeout set with LivePacketDevice.Open() has elapsed. In this case the packet out parameter will be null. + + + Eof + EOF was reached reading from an offline capture. In this case the packet out parameter will be null. + + + + Thrown if the mode is not Capture or an error occurred. + + + +Define a sampling method for packet capture. +This function allows applying a sampling method to the packet capture process. +The mtthod will be applied as soon as the capture starts. + + +Warning: Sampling parameters cannot be changed when a capture is active. These parameters must be applied before starting the capture. If they are applied when the capture is in progress, the new settings are ignored. +Warning: Sampling works only when capturing data on Win32 or reading from a file. It has not been implemented on other platforms. Sampling works on remote machines provided that the probe (i.e. the capturing device) is a Win32 workstation. + + The sampling method to be applied + + + +Set the minumum amount of data received by the kernel in a single call. +Changes the minimum amount of data in the kernel buffer that causes a read from the application to return (unless the timeout expires). +If the value of size is large, the kernel is forced to wait the arrival of several packets before copying the data to the user. +This guarantees a low number of system calls, i.e. low processor usage, and is a good setting for applications like packet-sniffers and protocol analyzers. +Vice versa, in presence of a small value for this variable, the kernel will copy the packets as soon as the application is ready to receive them. +This is useful for real time applications that need the best responsiveness from the kernel. + + minimum number of bytes to copy + Thrown on failure. + + + +Set the size of the kernel buffer associated with an adapter. +If an old buffer was already created with a previous call to pcap_setbuff(), it is deleted and its content is discarded. +LivePacketDevice.Open() creates a 1 MByte buffer by default. + + the size of the buffer in bytes + Thrown on failure. + + + +Switch between blocking and nonblocking mode. +Puts a live communicator into "non-blocking" mode, or takes it out of "non-blocking" mode. +In "non-blocking" mode, an attempt to read from the communicator with ReceiveSomePackets will, if no packets are currently available to be read, return immediately rather than blocking waiting for packets to arrive. +ReceivePacket and ReceivePackets will not work in "non-blocking" mode. + + Thrown if there is an error. + + + +The working mode of the interface. + + + + +Statistics on current capture. +The values represent packet statistics from the start of the run to the time of the call. +Supported only on live captures, not on offline. No statistics are stored in offline, so no statistics are available when reading from an offline device. + + Thrown if there is an error or the underlying packet capture doesn't support packet statistics. + + + +The minor version number of the pcap library used to write the file. + + + + +The major version number of the pcap library used to write the file. + + + + +True if the current file uses a different byte order than the current system. + + + + +The IPv4 netmask of the network on which packets are being captured; useful for filters when checking for IPv4 broadcast addresses in the filter program. If the netmask of the network on which packets are being captured isn't known to the program, or if packets are being captured on the Linux "any" pseudo-interface that can capture on more than one network, the value will be null and a filter that tests for IPv4 broadcast addreses won't be done correctly, but all other tests in the filter program will be OK. + + + + +The dimension of the packet portion (in bytes) that is delivered to the application. + + + + +List of the supported data link types of the interface associated with the packet communicator. +This property is currently unsupported to avoid memory leakage until a bug fix will be released in winpcap. + + Thrown on failure. + + + +The link layer of an adapter. + + Thrown when setting the datalink fails. + + + +Used to receive and send packets accross the network or to read and write packets to a pcap file. + + + + +The different return values when receiving from a packet communicator. + + + + This return value should never be returned + + + The loop has been broken by a call to Break() before all the requested packets could be read. + + + EOF was reached reading from an offline capture. + + + The timeout set with Open() has elapsed when trying to read packets. + + + The packets/statistics have been read without problems. + + + +Working modes for packet communicator. + + + + Kernel dump working mode. + + + Kernel monitoring mode. + + + Statistical working mode. + + + Capture working mode. + + + +Win32 specific. Number of packets captured, i.e number of packets that are accepted by the filter, that find place in the kernel buffer and therefore that actually reach the application. + + + + +Number of packets dropped by the interface. + + + + +Number of packets dropped by the driver. + + + + +Number of packets transited on the network. + + + + +Statistics on capture from the start of the run. + + + + +Flags to use when openning a device to send and receive packets. + + + + +This flag configures the adapter for maximum responsiveness. + + + + +Defines if the local adapter will capture its own generated traffic. + + + + +Defines if the remote probe will capture its own generated traffic. + + + + +Defines if the data trasfer (in case of a remote capture) has to be done with UDP protocol. + + + + +Defines if the adapter has to go in promiscuous mode. + + + + +No flags. + + + + +Closes a savefile. + + + + +Return the file position for a "savefile". +Returns the current file position for the "savefile", representing the number of bytes written by PacketCommunicator.OpenDump() and Dump(). + + Thrown on error. + + + +Flushes the output buffer to the ``savefile,'' so that any packets written with Dump() but not yet written to the ``savefile'' will be written. + + Thrown on error. + + + +Save a packet to disk. +Outputs a packet to the "savefile" opened with PacketCommunicator.OpenDump(). + + The packet to write to disk. + + + +Creates a dump file and saves the given packets to disk. +This method is useful when you've got packets to save but no device. + + The name of the dump file. + The data link of the packets saved globally in the dump file. + The dimension of the packet portion (in bytes) that is used when writing the packets. 65536 guarantees that the whole packet will be captured on all the link layers. + The packets to save to the dump file. + + + +A file to write packets. + + + + +The description of the datalink. + + + + +The name of the datalink. + + + + +The pcap value of the datalink. + + + + +The kind of the datalink. + + + + +Create the datalink its name. + + The name of the pcap datalink. + + + +Create the datalink from an int value (pcap value). + + The pcap value of the datalink. + + + +Create the datalink from one of the well defined datalink kinds. + + The kind of datalink to create. + + + +A packet communicator datalink. + + + + +Free a filter. +Used to free up allocated memory when that BPF program is no longer needed, for example after it has been made the filter program for a packet communicator by a call to PacketCommunicator.SetFilter(). + + + + +Returns if a given filter applies to an offline packet. +This method is used to apply a filter to a packet that is currently in memory. +This process does not need to open an adapter; we need just to create the proper filter (by settings parameters like the snapshot length, or the link-layer type) by means of the Pcap. +The current API of libpcap does not allow to receive a packet and to filter the packet after it has been received. However, this can be useful in case you want to filter packets in the application, instead of into the receiving process. This function allows you to do the job. + + The packet that has to be filtered. + +True iff the given packet satisfies the filter. + + + + +Returns if a given filter applies to an offline packet. +This method is used to apply a filter to a packet that is currently in memory. +This process does not need to open an adapter; we need just to create the proper filter (by settings parameters like the snapshot length, or the link-layer type) by means of the Pcap. +The current API of libpcap does not allow to receive a packet and to filter the packet after it has been received. However, this can be useful in case you want to filter packets in the application, instead of into the receiving process. This function allows you to do the job. + + The length of the bytes that are currently available into the packet if the packet satisfies the filter, 0 otherwise. + The packet that has to be filtered. + +True iff the given packet satisfies the filter. + + + + +Compile a packet filter without the need of opening an adapter. +This constructor converts a high level filtering expression (see WinPcap Filtering expression syntax) in a program that can be interpreted by the kernel-level filtering engine. +Assumes the netmask of the network on which packets are being captured isn't known to the program, or that packets are being captured on the Linux "any" pseudo-interface that can capture on more than one network. +Tests for IPv4 broadcast addreses won't be done correctly, but all other tests in the filter program will be OK. + + A high level filtering expression (see WinPcap Filtering expression syntax) + Length of the packet that has to be retained of the communicator this filter will be applied on. + The link layer of an adapter that this filter will apply upon. + Indicates an error. Probably caused by bad syntax. + +If the purpose of this filter is to apply it on a communicator and not to test packets in memory, it would be simpler to call to PacketCommunicator.CreateFilter() or to directly call PacketCommunicator.SetFilter(). + + + + +Compile a packet filter without the need of opening an adapter. +This constructor converts a high level filtering expression (see WinPcap Filtering expression syntax) in a program that can be interpreted by the kernel-level filtering engine. + + A high level filtering expression (see WinPcap Filtering expression syntax) + Length of the packet that has to be retained of the communicator this filter will be applied on. + The link layer of an adapter that this filter will apply upon. + Specifies the IPv4 netmask of the network on which packets are being captured; it is used only when checking for IPv4 broadcast addresses in the filter program. If the netmask of the network on which packets are being captured isn't known to the program, or if packets are being captured on the Linux "any" pseudo-interface that can capture on more than one network, null can be supplied; tests for IPv4 broadcast addreses won't be done correctly, but all other tests in the filter program will be OK. + Indicates an error. Probably caused by bad syntax. + +If the purpose of this filter is to apply it on a communicator and not to test packets in memory, it would be simpler to call to PacketCommunicator.CreateFilter() or to directly call PacketCommunicator.SetFilter(). + + + + +A packet filter, converting a high level filtering expression (see WinPcap Filtering expression syntax) in a program that can be interpreted by the kernel-level filtering engine. +The user must dispose instances of this class to deallocate resources. + + + + +Deletes a send buffer and frees all the memory associated with it. + + + + +Adds a raw packet at the end of the send buffer. +'Raw packet' means that the sending application will have to include the protocol headers, since every packet is sent to the network 'as is'. The CRC of the packets needs not to be calculated, because it will be transparently added by the network interface. + + The packet to be added to the buffer + Thrown on failure. + + + +This function allocates a send buffer, i.e. a buffer containing a set of raw packets that will be transimtted on the network with PacketCommunicator.Transmit(). + + The size, in bytes, of the buffer, therefore it determines the maximum amount of data that the buffer will contain. + + + +Represents a buffer of packets to be sent. +Note that transmitting a send buffer is much more efficient than performing a series of Send(), because the send buffer is buffered at kernel level drastically decreasing the number of context switches. + + + + +The ip version 6 address. + + + + +An internet protocol version 6 address for a device. + + + + +The ip version 4 address. + + + + +An internet protocol version 4 address for a device. + + + + +if not null, the destination address corresponding to the address in Address; may be null if the interface isn't a point-to-point interface + + + + +if not null, the broadcast address corresponding to the address in Address; may be null if the interface doesn't support broadcasts. + + + + +if not null, the netmask corresponding to the address in Address. + + + + +The Device Address. + + + + +Representation of an interface address. + + + + +Family (type) of the socket address. + + + + +The base of all device addresses. +Contains the family (type) of the address. + + + + +The type of socket address for a device address. + + + + +Bluetooth RFCOMM/L2CAP protocols + + + + +Network Designers OSI & gateway + + + + +IrDA + + + + +IEEE 1284.4 WG AF + + + + +Microsoft Wolfpack + + + + +Internetwork Version 6 + + + + +Native ATM Services + + + + +Banyan + + + + +Somebody is using this! + + + + +Protocols from Firefox + + + + +VoiceView + + + + +NetBios-style addresses + + + + +AppleTalk + + + + +NSC Hyperchannel + + + + +LAT + + + + +Direct data link interface + + + + +DECnet + + + + +IBM SNA + + + + +CCITT protocols, X.25 etc + + + + +datakit protocols + + + + +european computer manufacturers + + + + +OSI is ISO + + + + +ISO protocols + + + + +IPX protocols: IPX, SPX, etc. + + + + +XEROX NS protocols + + + + +mit CHAOS protocols + + + + +pup protocols: e.g. BSP + + + + +arpanet imp addresses + + + + +internetwork: UDP, TCP, etc. + + + + +local to host (pipes, portals) + + + + +unspecified + + + + +Indicates the number of packets (minus 1) that must be discarded before one packet got accepted. +In other words, if 'value = 10', the first packet is returned to the caller, while the following 9 are discarded. + + + + +Constructs by giving a count. + + 1 packet out of count packets will be sampled (for each sampled packet, count-1 will be discarded). + The given count is non-positive. + + + +Defines that only 1 out of count packets must be returned to the user. +In other words, if the count is set to 10, the first packet is returned to the caller, while the following 9 are discarded. + + + + +Indicates the 'waiting time' in milliseconds before one packet got accepted. +In other words, if 'value = 10', the first packet is returned to the caller; the next returned one will be the first packet that arrives when 10ms have elapsed. + + + + +Constructs by giving an interval as TimeSpan. + + The time to wait between packets sampled. + The interval is negative or larger than 2^31 milliseconds. + + + +Constructs by giving an interval in milliseconds. + + The number of milliseconds to wait between packets sampled. + The given number of milliseconds is negative. + + + +This sampling method defines that we have to return 1 packet every given time-interval. +In other words, if the interval is set to 10 milliseconds, the first packet is returned to the caller; the next returned one will be the first packet that arrives when 10ms have elapsed. + + + + +This is the base sampling method class. +Every sampling method is defined by a method and an optional value, both for internal usage. + + + + +The maximum legal timestamp to put in a packet. + + + + +The minimum legal timestamp to put in a packet. + + + + +The number of bytes received during the last interval. + + + + +The number of packets received during the last interval. + + + + +The time the statistics was received. + + + + +Represents a statistics value when running in statistics mode. + + + + \ No newline at end of file diff --git a/dep/pcapnet/PcapDotNet.License b/dep/pcapnet/PcapDotNet.License new file mode 100644 index 00000000..9d803bf9 --- /dev/null +++ b/dep/pcapnet/PcapDotNet.License @@ -0,0 +1,12 @@ +Copyright (c) 2009, Boaz Brickner +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +* 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. + +* Neither the name of Pcap.Net nor the names of its contributors may 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. \ No newline at end of file diff --git a/dep/pcapnet/PcapDotNet.Packets.XML b/dep/pcapnet/PcapDotNet.Packets.XML new file mode 100644 index 00000000..b9069be2 --- /dev/null +++ b/dep/pcapnet/PcapDotNet.Packets.XML @@ -0,0 +1,13995 @@ + + + + PcapDotNet.Packets + + + + + An enum for all the different tcp option types. + + + + + End of Option List (RFC793) + + + + + No-Operation (RFC793) + + + + + Maximum Segment Size (RFC793) + + + + + WSOPT - Window Scale (RFC1323) + + + + + SACK Permitted (RFC2018) + + + + + SACK (RFC2018) + + + + + Echo (obsoleted by option 8) (RFC1072) + + + + + Echo Reply (obsoleted by option 8) (RFC1072) + + + + + TSOPT - Time Stamp Option (RFC1323) + + + + + Partial Order Connection Permitted (RFC1693) + + + + + Partial Order Service Profile (RFC1693) + + + + + CC (RFC1644) + + + + + CC.NEW (RFC1644) + + + + + CC.ECHO (RFC1644) + + + + + TCP Alternate Checksum Request (RFC1146) + + + + + TCP Alternate Checksum Data (RFC1146) + + + + + MD5 Signature Option (RFC2385) + + + + + Denote Packet Mood (RFC5841) + + + + + Quick-Start Response (RFC4782) + + + + + User Timeout Option (RFC5482) + + + + + This field specifies the (U.S.) classification level at which the datagram must be protected. + The information in the datagram must be protected at this level. + The bit string values in this table were chosen to achieve a minimum Hamming distance of four (4) between any two valid values. + This specific assignment of classification level names to values has been defined for compatibility + with security devices which have already been developed and deployed. + + + + + An invalid value for a classification level. + + + + + Top Secret + + + + + Secret + + + + + Confidential + + + + + Unclassified + + + + + Record Route +
+            +--------+--------+--------+---------//--------+
+            |00000111| length | pointer|     route data    |
+            +--------+--------+--------+---------//--------+
+             Type=7
+            
+ + + The record route option provides a means to record the route of an internet datagram. + + + + The option begins with the option type code. + The second octet is the option length which includes the option type code and the length octet, + the pointer octet, and length-3 octets of route data. + The third octet is the pointer into the route data indicating the octet which begins the next area to store a route address. + The pointer is relative to this option, and the smallest legal value for the pointer is 4. + + + + A recorded route is composed of a series of internet addresses. + Each internet address is 32 bits or 4 octets. + If the pointer is greater than the length, the recorded route data area is full. + The originating host must compose this option with a large enough route data area to hold all the address expected. + The size of the option does not change due to adding addresses. + The intitial contents of the route data area must be zero. + + + + When an internet module routes a datagram it checks to see if the record route option is present. + If it is, it inserts its own internet address as known in the environment into which this datagram is being forwarded + into the recorded route begining at the octet indicated by the pointer, + and increments the pointer by four. + + + + If the route data area is already full (the pointer exceeds the length) + the datagram is forwarded without inserting the address into the recorded route. + If there is some room but not enough room for a full address to be inserted, + the original datagram is considered to be in error and is discarded. + In either case an ICMP parameter problem message may be sent to the source host. + + + + Not copied on fragmentation, goes in first fragment only. + Appears at most once in a datagram. + +
+
+ + + The base class for route tracking options (loose, strict, record). + + + + + Represents a complex IPv4 option. + Complex option means that it contains data and not just the type. + + + + + Represents an ip option according to rfc 791. + + + + + A generic option (for IPv4 and TCP). + The option is read from buffer and can be of different length. + + + + + Checks whether two options have equivalent type. + Useful to check if an option that must appear at most once appears in the list. + + + + + The number of bytes this option will take. + + + + + True iff this option may appear at most once in a datagram. + + + + + Checks whether two options have equivalent type. + Useful to check if an option that must appear at most once appears in the list. + + + + + Checks if the two options are exactly the same - including type and value. + + + + + Checks if the two options are exactly the same - including type and value. + + + + + The hash code of the option is the hash code of the option type. + + + + + + The string of the option is the string of the option type. + + + + + Constructs the option by type. + + + + + This option indicates the end of the option list.
+ This might not coincide with the end of the internet header according to the internet header length. + This is used at the end of all options, not the end of each option, and need only be used if the end of the options would not otherwise coincide with the end of the internet header. + May be copied, introduced, or deleted on fragmentation, or for any other reason. +
+
+ + + This option may be used between options, for example, to align the beginning of a subsequent option on a 32 bit boundary. + May be copied, introduced, or deleted on fragmentation, or for any other reason. + + + + + The type of the ip option. + + + + + The header length in bytes for the option (type and size). + + + + + Constructs the option by type. + + + + + The minimum option length in bytes (type, length, pointer). + + + + + The minimum option value length in bytes (pointer). + + + + + The maximum value for the index pointed the route. + + + + + Two routes options are equal iff they have the same type, same pointed address index and same route. + + + + + Two routes options are equal iff they have the same type, same pointed address index and same route. + + + + + The hash code of the route option is the xor of the following hash codes: base class, pointed address index and all the addresses in the route. + + + + + Tries to read the value of the route option from the given buffer. + + The route read from the buffer. + The index pointed in the route read from the buffer. + The buffer to read the value from. + The offset in the buffer to start reading the value from. + The number of bytes that the value should be. + True iff the read was successful. + + + + Construct a route option from the given values. + + + + + The pointed index in the route. + + + + + The route tracked - the collection of addresses written. + + + + + The number of bytes this option will take. + + + + + True iff this option may appear at most once in a datagram. + + + + + This interface is used to create all complex options. + Every complex option should implement such a factory to create itself from a buffer. + + + + + Tries to read the option from a buffer starting from the option value (after the type and length). + + The buffer to read the option from. + The offset to the first byte to read the buffer. Will be incremented by the number of bytes read. + The number of bytes the option value should take according to the length field that was already read. + On success - the complex option read. On failure - null. + + + + Constructs the option from the given values. + + The route addresses values. + The pointed index in the route. + + + + Constructs the option from the given values. + + The route addresses values. + The pointed index in the route. + + + + Constructs an empty record route option. + + + + + Tries to read the option from a buffer starting from the option value (after the type and length). + + The buffer to read the option from. + The offset to the first byte to read the buffer. Will be incremented by the number of bytes read. + The number of bytes the option value should take according to the length field that was already read. + On success - the complex option read. On failure - null. + + + + RFC 2521. + Represents an ICMP Security Failures layer. + + + + + + Represents an ICMP layer. + + + + + + A simple layer is a layer that doesn't care what is the length of its payload, what layer comes after it and what layer comes before it. + + + + + The base class of a layer used to build a Packet. + Each layer represents the part of the packet relevant to a specific protocol. + A sequence of layers can represent a packet. + A packet can be according to a sequence of layers. + + + + + + The interface of a layer used to build a Packet. + Each layer represents the part of the packet relevant to a specific protocol. + A sequence of layers can represent a packet. + A packet can be according to a sequence of layers. + + + + + + Writes the layer to the buffer. + + The buffer to write the layer to. + The offset in the buffer to start writing the layer at. + The length of the layer's payload (the number of bytes after the layer in the packet). + The layer that comes before this layer. null if this is the first layer. + The layer that comes after this layer. null if this is the last layer. + + + + Finalizes the layer data in the buffer. + Used for fields that must be calculated according to the layer's payload (like checksum). + + The buffer to finalize the layer in. + The offset in the buffer the layer starts. + The length of the layer's payload (the number of bytes after the layer in the packet). + The layer that comes after this layer. null if this is the last layer. + + + + The number of bytes this layer will take. + + + + + The kind of the data link of the layer. + Can be null if this is not the first layer in the packet. + + + + + Writes the layer to the buffer. + + The buffer to write the layer to. + The offset in the buffer to start writing the layer at. + The length of the layer's payload (the number of bytes after the layer in the packet). + The layer that comes before this layer. null if this is the first layer. + The layer that comes after this layer. null if this is the last layer. + + + + Finalizes the layer data in the buffer. + Used for fields that must be calculated according to the layer's payload (like checksum). + + The buffer to finalize the layer in. + The offset in the buffer the layer starts. + The length of the layer's payload (the number of bytes after the layer in the packet). + The layer that comes after this layer. null if this is the last layer. + + + + True iff the two objects are equal Layers. + + + + + True iff the two objects are equal Layers. + + + + + Returns a hash code for the layer. + The hash code base is a XOR of the hash codes of the layer length and data link. + + + + + The number of bytes this layer will take. + + + + + The kind of the data link of the layer. + Can be null if this is not the first layer in the packet. + + + + + Writes the layer to the buffer. + + The buffer to write the layer to. + The offset in the buffer to start writing the layer at. + The length of the layer's payload (the number of bytes after the layer in the packet). + The layer that comes before this layer. null if this is the first layer. + The layer that comes after this layer. null if this is the last layer. + + + + Writes the layer to the buffer. + This method ignores the payload length, and the previous and next layers. + + The buffer to write the layer to. + The offset in the buffer to start writing the layer at. + + + + A layer under an IPv4 layer. + Must provide the IPv4 Protocol. + + + + + The protocol that should be written in the previous (IPv4) layer. + + + + + Writes the layer to the buffer. + This method ignores the payload length, and the previous and next layers. + + The buffer to write the layer to. + The offset in the buffer to start writing the layer at. + + + + Writes the ICMP payload to the buffer. + Doesn't include payload in the next layers. + + The buffer to write the ICMP payload to. + The offset in the buffer to start writing the payload at. + + + + Finalizes the layer data in the buffer. + Used for the ICMP checksum. + + The buffer to finalize the layer in. + The offset in the buffer the layer starts. + The length of the layer's payload (the number of bytes after the layer in the packet). + The layer that comes after this layer. null if this is the last layer. + + + + ICMP layers are equal if they have the same message type, code, checksum, variable and payload. + + + + + ICMP layers are equal if they have the same message type, code, checksum, variable and payload. + + + + + Returns a hash code for the layer. + The hash code is a XOR of the layer length, data link, message type and code, checksum and variable. + + + + + Returns a string containing the message type, code and variable. + + + + + True iff the ICMP payload is equal to the other ICMP payload. + + + + + The value of this field determines the format of the remaining data. + + + + + A sub-type of the message. Specific method of this message type. + + + + + A combination of the ICMP Message Type and Code. + + + + + The checksum is the 16-bit ones's complement of the one's complement sum of the ICMP message starting with the ICMP Type. + For computing the checksum, the checksum field should be zero. + This checksum may be replaced in the future. + null means that this checksum should be calculated to be correct. + + + + + A value that should be interpreted according to the specific message. + + + + + The number of bytes this layer will take. + + + + + The number of bytes the ICMP payload takes. + + + + + The protocol that should be written in the previous (IPv4) layer. + + + + + A sub-type of the message. Specific method of this message type. + + + + + An offset into the Original Internet Headers that locates the most significant octet of the offending SPI. + Will be zero when no SPI is present. + + + + + The value of this field determines the format of the remaining data. + + + + + A sub-type of the message. Specific method of this message type. + + + + + A value that should be interpreted according to the specific message. + + + + + RFC 792. + + + + + Represents an ICMP layer with an Identifier and a Sequence Number. + + + + + An identifier to aid in matching requests and replies, may be zero. + + + + + A sequence number to aid in matching requests and replies, may be zero. + + + + + A value that should be interpreted according to the specific message. + + + + + The value of this field determines the format of the remaining data. + + + + + RFC 792. + + + + + The value of this field determines the format of the remaining data. + + + + + RFC 792 and RFC 1191. +
+            +-----+------+------+--------------+
+            | Bit | 0-7  | 8-15 | 16-31        |
+            +-----+------+------+--------------+
+            | 0   | Type | Code | Checksum     |
+            +-----+------+------+--------------+
+            | 32  | unused      | Next-Hop MTU |
+            +-----+-------------+--------------+
+            | 64  | Internet Header            |
+            |     | + 64 bits of               |
+            |     | Original Data Datagram     |
+            +-----+----------------------------+
+            
+
+
+ + + RFC 792. +
+            +-----+------+------+-----------+
+            | Bit | 0-7  | 8-15 | 16-31     |
+            +-----+------+------+-----------+
+            | 0   | Type | Code | Checksum  |
+            +-----+------+------+-----------+
+            | 32  | unused                  |
+            +-----+-------------------------+
+            | 64  | Internet Header         |
+            |     | + 64 bits of            |
+            |     | Original Data Datagram  |
+            +-----+-------------------------+
+            
+
+
+ + +
+            +-----+------+------+-----------+
+            | Bit | 0-7  | 8-15 | 16-31     |
+            +-----+------+------+-----------+
+            | 0   | Type | Code | Checksum  |
+            +-----+------+------+-----------+
+            | 32  | unused                  |
+            +-----+-------------------------+
+            | 64  | IpV4 datagram           |
+            +-----+-------------------------+
+            
+
+
+ + + Generic +
+            +-----+------+------+-----------+
+            | Bit | 0-7  | 8-15 | 16-31     |
+            +-----+------+------+-----------+
+            | 0   | Type | Code | Checksum  |
+            +-----+------+------+-----------+
+            | 32  | Value according to Type |
+            +-----+-------------------------+
+            | 64  | Payload                 |
+            | ... |                         |
+            +-----+-------------------------+
+            
+
+
+ + + Represents a packet datagram. + A datagram is part of the packet bytes that can be treated as a specific protocol data (usually header + payload). + Never copies the given buffer. + + + + + Take all the bytes as a datagram. + + The buffer to take as a datagram. + + + + Take only part of the bytes as a datagarm. + + The bytes to take the datagram from. + The offset in the buffer to start taking the bytes from. + The number of bytes to take. + + + + Returns the Datagram's bytes as a read only MemoryStream with a non-public buffer. + + A read only MemoryStream containing the bytes of the Datagram. + + + + Creates a Layer that represents the datagram to be used with PacketBuilder. + + + + + Iterate through all the bytes in the datagram. + + + + + Two datagrams are equal if the have the same data. + + + + + Two datagrams are equal if the have the same data. + + + + + The hash code of a datagram is the hash code of its length xored with all its bytes (each byte is xored with the next byte in the integer). + + + + + Converts the datagram to a hexadecimal string representing every bytes as two hexadecimal digits. + + A hexadecimal string representing every bytes as two hexadecimal digits. + + + + Converts the datagram to a string using the given encoding. + + The encoding to use to convert the bytes sequence in the Datagram to a string. + A string of the bytes in the Datagram converted using the given encoding. + + + + The default validity check always returns true. + + + + + Reads a requested number of bytes from a specific offset in the datagram. + + The offset in the datagram to start reading. + The number of bytes to read. + The bytes read from the datagram starting from the given offset and in the given length. + + + + Reads 2 bytes from a specific offset in the datagram as a ushort with a given endianity. + + The offset in the datagram to start reading. + The endianity to use to translate the bytes to the value. + The value converted from the read bytes according to the endianity. + + + + Reads 4 bytes from a specific offset in the datagram as an int with a given endianity. + + The offset in the datagram to start reading. + The endianity to use to translate the bytes to the value. + The value converted from the read bytes according to the endianity. + + + + Reads 4 bytes from a specific offset in the datagram as a uint with a given endianity. + + The offset in the datagram to start reading. + The endianity to use to translate the bytes to the value. + The value converted from the read bytes according to the endianity. + + + + Reads 6 bytes from a specific offset in the datagram as a MacAddress with a given endianity. + + The offset in the datagram to start reading. + The endianity to use to translate the bytes to the value. + The value converted from the read bytes according to the endianity. + + + + Reads 4 bytes from a specific offset in the datagram as an IpV4Address with a given endianity. + + The offset in the datagram to start reading. + The endianity to use to translate the bytes to the value. + The value converted from the read bytes according to the endianity. + + + + Reads 4 bytes from a specific offset in the datagram as an IpV4TimeOfDay with a given endianity. + + The offset in the datagram to start reading. + The endianity to use to translate the bytes to the value. + The value converted from the read bytes according to the endianity. + + + + Converts the given 16 bits sum to a checksum. + Sums the two 16 bits in the 32 bits value and if the result is bigger than a 16 bits value repeat. + The result is one's complemented and the least significant 16 bits are taken. + + + + + + + Sums bytes in a buffer as 16 bits big endian values. + If the number of bytes is odd then a 0x00 value is assumed after the last byte. + Used to calculate checksum. + + The buffer to take the bytes from. + The offset in the buffer to start reading the bytes. + The number of bytes to read. + A value equals to the sum of all 16 bits big endian values of the given bytes. + + + + An empty datagram. + Useful for empty payloads. + + + + + The number of bytes in this datagram. + + + + + The value of the byte in the given offset in the datagram. + + The offset in the datagram to take the byte from. + + + + A datagram is checked for validity according to the protocol. + + + + + The original buffer that holds all the data for the datagram. + + + + + The offset of the first byte of the datagram in the buffer. + + + + + The number of bytes the ICMP header takes. + + + + + Creates a Layer that represents the datagram to be used with PacketBuilder. + + + + + ICMP is valid if the datagram's length is OK, the checksum is correct and the code is in the expected range. + + + + + Creates an IcmpDatagram from a buffer according to the message type. + + The buffer of the datagram. + The offset where the datagram starts. + The length of the datagram in the buffer. + An IcmpDatagram according to the Icmp message type. + + + + The value of this field determines the format of the remaining data. + + + + + A sub-type of the message. Specific method of this message type. + + + + + A combination of the ICMP Message Type and Code. + + + + + The checksum is the 16-bit ones's complement of the one's complement sum of the ICMP message starting with the ICMP Type. + For computing the checksum, the checksum field should be zero. + This checksum may be replaced in the future. + + + + + A value that should be interpreted according to the specific message. + + + + + True iff the checksum value is correct according to the datagram data. + + + + + The payload of the ICMP. + All the data without the header. + + + + + The minimum valid ICMP code for this type of ICMP datagram. + + + + + The maximum valid ICMP code for this type of ICMP datagram. + + + + + ICMP with IPv4 payload is valid if the datagram's length is OK, the checksum is correct, the code is in the expected range, + and the IPv4 payload contains at least an IPv4 header. + + + + + The ICMP payload as an IPv4 datagram. + + + + + The number of bytes this payload includes from the original data datagram. + + + + + ICMP with IPv4 payload and 64 bits IPv4 payload is valid if the datagram's length is OK, the checksum is correct, the code is in the expected range, + the IPv4 payload contains at least an IPv4 header and the IPv4's payload is in the expected size. + + + + + The minimum value of the maximum transmission unit for FragmentationNeededAndDoNotFragmentSet code. + + + + + Creates a Layer that represents the datagram to be used with PacketBuilder. + + + + + Valid if the datagram's length is OK, the checksum is correct, the code is in the expected range, + the IPv4 payload contains at least an IPv4 header, the IPv4's payload is in the expected size + and if the NextHopMaximumTransmissionUnit is at least 68 for FragmentationNeededAndDoNotFragmentSet code or exactly 0 for other codes. + + + + + The size in octets of the largest datagram that could be forwarded, + along the path of the original datagram, without being fragmented at this router. + The size includes the IP header and IP data, and does not include any lower-level headers. + + + + + The minimum valid ICMP code for this type of ICMP datagram. + + + + + The maximum valid ICMP code for this type of ICMP datagram. + + + + + The different ICMP code values for Time Exceeded ICMP type. + + + + + RFC 792. + If the gateway processing a datagram finds the time to live field is zero it must discard the datagram. + The gateway may also notify the source host via the time exceeded message. + + + + + RFC 792. + If a host reassembling a fragmented datagram cannot complete the reassembly due to missing fragments within its time limit it discards the datagram, + and it may send a time exceeded message. + If fragment zero is not available then no time exceeded need be sent at all. + + + + + RFC 2616. + Represents an HTTP layer. + + + + + Two HTTP layers are equal iff they have the same version, header and body. + Extended by specific HTTP layers types for more checks. + + + + + Two HTTP layers are equal iff they have the same version, header and body. + Extended by specific HTTP layers types for more checks. + + + + + Writes the HTTP layer to the buffer. + + The buffer to write the layer to. + The offset in the buffer to start writing the layer at. + + + + True iff the message is a request and iff the message is not a response. + + + + + True iff the message is a response and iff the message is not a request. + + + + + The version of this HTTP message. + + + + + The header of the HTTP message. + + + + + Message Body. + + + + + The number of bytes this layer will take. + + + + + An unknown TCP option. + + + + + Represents a complex TCP option. + Complex option means that it contains data and not just the type. + + + + + Represents a TCP option according to rfc 793. + + + + + Checks whether two options have equivalent type. + Useful to check if an option that must appear at most once appears in the list. + + + + + Checks if the two options are exactly the same - including type and value. + + + + + Checks if the two options are exactly the same - including type and value. + + + + + The hash code for a tcp option is the hash code for the option type. + This should be overridden by tcp options with data. + + + + + The string that represents the option type. + + + + + Initializes the option type. + + + + + This option code indicates the end of the option list. + This might not coincide with the end of the TCP header according to the Data Offset field. + This is used at the end of all options, not the end of each option, + and need only be used if the end of the options would not otherwise coincide with the end of the TCP header. + + + + + This option code may be used between options, + for example, to align the beginning of a subsequent option on a word boundary. + There is no guarantee that senders will use this option, + so receivers must be prepared to process options even if they do not begin on a word boundary. + + + + + The type of the TCP option. + + + + + The number of bytes this option header take. + + + + + Creates a complex option using the given option type. + + + + + A factory interface for an unknown option. + + The option type enum type. + + + + Creates an unknown option from its type and by reading a buffer for its value. + + The type of the unknown option. + The buffer of bytes to read the value of the unknown option. + The offset in the buffer to start reading the bytes. + The number of bytes to read from the buffer. + An option created from the given type and buffer. + + + + The minimum number of bytes this option take. + + + + + The minimum number of bytes this option's value take. + + + + + Creates an unknown TCP option by the given type and data. + + + + + The default unknown option is with type 255 and no data. + + + + + Two unknown options are equal iff they are of equal type and equal data. + + + + + Two unknown options are equal iff they are of equal type and equal data. + + + + + The hash code for an unknown option is the hash code for the option type xored with the hash code of the data. + + + + + Creates an unknown option from its type and by reading a buffer for its value. + + The type of the unknown option. + The buffer of bytes to read the value of the unknown option. + The offset in the buffer to start reading the bytes. + The number of bytes to read from the buffer. + An option created from the given type and buffer. + + + + The data of the unknown option. + + + + + The number of bytes this option will take. + + + + + True iff this option may appear at most once in a datagram. + + + + + The header length in bytes for the option (type and size). + + + + + Represents an IPv4 address. + + + + + The number of bytes the address take. + + + + + Create an address from a 32 bit integer. + 0 -> 0.0.0.0 + 1 -> 0.0.0.1 + 256 -> 0.0.1.0 + + + + + Creates an address from an address string (1.2.3.4). + + + + + Gets the address value as a 32 bit integer. + + + + + Two addresses are equal if the have the exact same value. + + + + + Two addresses are equal if the have the exact same value. + + + + + Two addresses are equal if the have the exact same value. + + + + + Two addresses are different if the have different values. + + + + + The hash code of an address is the hash code of its 32 bit integer value. + + + + + Translates the address to a string (1.2.3.4). + + + + + The zero address (0.0.0.0). + + + + + The all-hosts group. + If you ping that group, all multicast capable hosts on the network should answer, + as every multicast capable host must join that group at start-up on all it's multicast capable interfaces. + + + + + A Transport layer under an IPv4 layer. + Must supply information about the Transport layer checksum. + + + + + Checksum is the 16-bit one's complement of the one's complement sum of a pseudo header of information from the IP header, + the Transport header, and the data, padded with zero octets at the end (if necessary) to make a multiple of two octets. + If null is given, the Checksum will be calculated to be correct according to the data. + + + + + Whether the checksum should be calculated. + Can be false in UDP because the checksum is optional. false means that the checksum will be left zero. + + + + + The offset in the layer where the checksum should be written. + + + + + Whether the checksum is optional in the layer. + + + + + RFC 3376. + Represents an IGMP Report version 3 layer. + + + + + + The base of all IGMP layers. + + + + + + IGMP layers are equal if they have the same message type, query version, similar max response time and the same specific type fields. + + + + + IGMP layers are equal if they have the same message type, query version, similar max response time and the same specific type fields. + + + + + Xor of the hash codes of the layer length, datalink, message type and query version. + + + + + true iff the fields that are not mutual to all IGMP layers are equal. + + + + + The type of the IGMP message of concern to the host-router interaction. + + + + + The IGMP version of a Membership Query message. + If the type is not a query, None will be returned. + + + + + The actual time allowed, called the Max Resp Time. + + + + + The protocol that should be written in the previous (IPv4) layer. + + + + + Creates an instance of an IGMP Report Version 3 Layer with a default of no Group Records. + + + + + Writes the layer to the buffer. + This method ignores the payload length, and the previous and next layers. + + The buffer to write the layer to. + The offset in the buffer to start writing the layer at. + + + + Xor of the hash codes of the layer length, datalink, message type, query version and the group records. + + + + + true iff the group records are equal. + + + + + true iff the group records are equal. + + + + + Each Group Record is a block of fields containing information pertaining to the sender's membership in a single multicast group on the interface from which the Report is sent. + + + + + The number of bytes this layer will take. + + + + + The type of the IGMP message of concern to the host-router interaction. + + + + + The actual time allowed, called the Max Resp Time. + + + + + Used to represent an ICMP datagram with an unknown message type. + + + + + Creates a Layer that represents the datagram to be used with PacketBuilder. + + + + + Unknown ICMP datagrams are always invalid. + + + + + Take only part of the bytes as a datagarm. + + The bytes to take the datagram from. + The offset in the buffer to start taking the bytes from. + The number of bytes to take. + + + + RFC 792. +
+            +-----+---------+------+-----------+
+            | Bit | 0-7     | 8-15 | 16-31     |
+            +-----+---------+------+-----------+
+            | 0   | Type    | Code | Checksum  |
+            +-----+---------+------+-----------+
+            | 32  | Pointer | unused           |
+            +-----+---------+------------------+
+            | 64  | Internet Header            |
+            |     | + 64 bits of               |
+            |     | Original Data Datagram     |
+            +-----+----------------------------+
+            
+
+
+ + + Creates a Layer that represents the datagram to be used with PacketBuilder. + + + + + Valid if the datagram's length is OK, the checksum is correct, the code is in the expected range, + the IPv4 payload contains at least an IPv4 header, the IPv4's payload is in the expected size + and the pointer points to a byte within the IPv4 header. + + + + + The pointer identifies the octet of the original datagram's header where the error was detected (it may be in the middle of an option). + For example, 1 indicates something is wrong with the Type of Service, and (if there are options present) 20 indicates something is wrong with the type code of the first option. + + + + + RFC 792. + + + + + The value of this field determines the format of the remaining data. + + + + + RFC 792. +
+            +-----+------+------+-----------+
+            | Bit | 0-7  | 8-15 | 16-31     |
+            +-----+------+------+-----------+
+            | 0   | Type | Code | Checksum  |
+            +-----+------+------+-----------+
+            | 32  | unused                  |
+            +-----+-------------------------+
+            | 64  | Internet Header         |
+            |     | + 64 bits of            |
+            |     | Original Data Datagram  |
+            +-----+-------------------------+
+            
+
+
+ + + Creates a Layer that represents the datagram to be used with PacketBuilder. + + + + + Echo Reply + RFC 792. +
+            +-----+------+------+-----------------+
+            | Bit | 0-7  | 8-15 | 16-31           |
+            +-----+------+------+-----------------+
+            | 0   | Type | Code | Checksum        |
+            +-----+------+------+-----------------+
+            | 0   | Identifier  | Sequence Number |
+            +-----+-------------+-----------------+
+            | 32  | Data...                       |
+            +-----+-------------------------------+
+            
+
+
+ + + RFC 792. +
+            +-----+------+------+-----------------+
+            | Bit | 0-7  | 8-15 | 16-31           |
+            +-----+------+------+-----------------+
+            | 0   | Type | Code | Checksum        |
+            +-----+------+------+-----------------+
+            | 32  | Identifier  | Sequence Number |
+            +-----+-------------+-----------------+
+            
+
+
+ + + An identifier to aid in matching requests and replies, may be zero. + + + + + A sequence number to aid in matching requests and replies, may be zero. + + + + + Creates a Layer that represents the datagram to be used with PacketBuilder. + + + + + RFC 1788. + + + + + The value of this field determines the format of the remaining data. + + + + + Represents a source route entry consisting of an unknown data. + + + + + RFC 1701. + SRE. +
+            +-----+----------------+------------+------------+
+            | Bit | 0-15           | 16-23      | 24-31      |
+            +-----+----------------+------------+------------+
+            | 0   | Address Family | SRE Offset | SRE Length |
+            +-----+----------------+------------+------------+
+            | 32  | Routing Information ...                  |
+            +-----+------------------------------------------+
+            
+
+
+ + + The number of bytes the entry header takes. + + + + + Two entries are equal iff they have the same address family, length, payload offset and payload. + + + + + Two entries are equal iff they have the same address family, length, payload offset and payload. + + + + + The hash code of an entry is a xor of the hash code of the address family, length, payload offset and payload. + + + + + True iff the payloads a are equal. + + + + + Writes the payload to the given buffer in the given offset. + + The buffer to write the payload to. + The offset in the buffer to start writing. + + + + The Address Family field contains a two octet value which indicates the syntax and semantics of the Routing Information field. + + + + + The number of bytes the entry takes. + + + + + The SRE Offset field indicates the octet offset from the start of the Routing Information field to the first octet of the active entry in Source Route Entry to be examined. + + + + + The SRE Length field contains the number of octets in the SRE. + + + + + The hash code of the payload. + + + + + Initializes using an address family, data, and offset to the first octet of the active entry in Source Route Entry to be examined. + + The Address Family field contains a two octet value which indicates the syntax and semantics of the Routing Information field. + The data of the entry source route. + The SRE Offset field indicates the octet offset from the start of the Routing Information field to the first octet of the active entry in Source Route Entry to be examined. + + + + True iff the payloads a are equal. + + + + + Writes the payload to the given buffer in the given offset. + + The buffer to write the payload to. + The offset in the buffer to start writing. + + + + The Address Family field contains a two octet value which indicates the syntax and semantics of the Routing Information field. + + + + + The SRE Length field contains the number of octets in the SRE. + + + + + The SRE Offset field indicates the octet offset from the start of the Routing Information field to the first octet of the active entry in Source Route Entry to be examined. + + + + + The data of the entry source route. + + + + + The hash code of the payload. + + + + + The two possible endianities. + + + + + Small endianity - bytes are read from the high offset to the low offset. + + + + + Big endianity - bytes are read from the low offset to the high offset. + + + + + Represents the different data links kinds. + + + + + Ethernet data link kind. + + + + + Data Over Cable Service Interface Specification. + + + + + Represents an ARP protocol layer. + + + + + A layer under an Ethernet layer. + Must provide the Ethernet Type and the default destination MAC address (if any). + + + + + The Ethernet Type the Ethernet layer should write when this layer is the Ethernet payload. + + + + + The default MAC Address value when this layer is the Ethernet payload. + null means there is no default value. + + + + + Writes the layer to the buffer. + + The buffer to write the layer to. + The offset in the buffer to start writing the layer at. + The length of the layer's payload (the number of bytes after the layer in the packet). + The layer that comes before this layer. null if this is the first layer. + The layer that comes after this layer. null if this is the last layer. + + + + True iff the two ARP layers have equal protocol type, operation and addresses. + + The ARP layer to compare the layer to. + True iff the two layers are equal. + + + + True iff the two ARP layers have equal protocol type, operation and addresses. + + The ARP layer to compare the layer to. + True iff the two layers are equal. + + + + Returns a hash code for the layer. + The hash code is a XOR of a combination of the protocol type and operation and the hash codes of the layer length and data link. + + + + + Each protocol is assigned a number used in this field. + + + + + Specifies the operation the sender is performing. + + + + + Hardware address of the sender. + + + + + Protocol address of the sender. + + + + + Hardware address of the intended receiver. + This field is ignored in requests. + + + + + Protocol address of the intended receiver. + + + + + The Ethernet Type the Ethernet layer should write when this layer is the Ethernet payload. + + + + + The default MAC Address value when this layer is the Ethernet payload. + null means there is no default value. + + + + + The number of bytes this layer will take. + + + + + RFC 768. + Represents the UDP layer. + + + + + + Contains the common part of UDP and TCP layers. + + + + + + Two Transport layers are equal if they have they have the same previous layer protocol value, checksum, source and destination ports, + and if the specific transport protocol fields are equal. + + + + + Two Transport layers are equal if they have they have the same previous layer protocol value, checksum, source and destination ports, + and if the specific transport protocol fields are equal. + + + + + Returns a hash code for the layer. + The hash code is a XOR of the combination of the source and destination ports and the hash codes of the layer length, data link and checksum. + + + + + True iff the specific transport layer fields are equal. + + + + + Checksum is the 16-bit one's complement of the one's complement sum of a pseudo header of information from the IP header, + the Transport header, and the data, padded with zero octets at the end (if necessary) to make a multiple of two octets. + + + + + Indicates the port of the sending process. + In UDP, this field is optional and may only be assumed to be the port + to which a reply should be addressed in the absence of any other information. + If not used in UDP, a value of zero is inserted. + + + + + Destination Port has a meaning within the context of a particular internet destination address. + + + + + The protocol that should be written in the previous (IPv4) layer. + + + + + Whether the checksum should be calculated. + Can be false in UDP because the checksum is optional. false means that the checksum will be left zero. + + + + + The offset in the layer where the checksum should be written. + + + + + Whether the checksum is optional in the layer. + + + + + Writes the layer to the buffer. + + The buffer to write the layer to. + The offset in the buffer to start writing the layer at. + The length of the layer's payload (the number of bytes after the layer in the packet). + The layer that comes before this layer. null if this is the first layer. + The layer that comes after this layer. null if this is the last layer. + + + + Whether the checksum should be calculated. + Can be false in UDP because the checksum is optional. false means that the checksum will be left zero. + + + + + Whether the checksum should be calculated. + Can be false in UDP because the checksum is optional. false means that the checksum will be left zero. + + + + + The protocol that should be written in the previous (IPv4) layer. + + + + + The offset in the layer where the checksum should be written. + + + + + Whether the checksum is optional in the layer. + + + + + The number of bytes this layer will take. + + + + + Represents a layer that adds a simple payload. + Actually can be any buffer of bytes. + + + + + Creates an empty payload. + + + + + Two payload layers are equal if they have same data. + + + + + Two payload layers are equal if they have same data. + + + + + Writes the layer to the buffer. + This method ignores the payload length, and the previous and next layers. + + The buffer to write the layer to. + The offset in the buffer to start writing the layer at. + + + + The Payload data. + + + + + The number of bytes this layer will take. + + + + + The option-type octet is viewed as having 3 fields: + + + Bits + Description + + 1 bit + + Copied flag. + + The copied flag indicates that this option is copied into all fragments on fragmentation. + + 0 = not copied. + 1 = copied. + + + + + 2 bits + + Option class. + + The option classes are: + + 0 = control. + 1 = reserved for future use. + 2 = debugging and measurement. + 3 = reserved for future use. + + + + + 5 bitsOption number. + + + + + DoD Extended Security Option (133), RFC 1108, is not supported because it only defines abstract option and no concrete option RFC is available. + EIP: The Extended Internet Protocol, RFC 1385, is not supported because according iana.org its option type is 145 but according to the RFC its option type is 138 (0x8A). + + + + + + End of Option list. + This option occupies only 1 octet; it has no length octet. + + + + + No Operation. + This option occupies only 1 octet; it has no length octet. + + + + + Quick Start (QS). RFC 4782. + + + + + Traceroute Using an IP Option. + RFC 1393. + + + + + DoD Basic Security: + Used to carry the classification level and protection authority flags. + + + + + Loose Source Routing. + Used to route the internet datagram based on information supplied by the source. + + + + + Strict Source Routing. + Used to route the internet datagram based on information supplied by the source. + + + + + Record Route. + Used to trace the route an internet datagram takes. + + + + + Stream ID. + Used to carry the stream identifier. + + + + + Internet Timestamp. + + + + + Router Alert Option (RFC 2113). + + + + + Represents an IGMP layer that contains a Group Address. + + + + + + The Group Address field is set to zero when sending a General Query, + and set to the IP multicast address being queried when sending a Group-Specific Query or Group-and-Source-Specific Query. + In a Membership Report of version 1 or 2 or Leave Group message, the group address field holds the IP multicast group address of the group being reported or left. + In a Membership Report of version 3 this field is meaningless. + + + + + The type of the IGMP message. + + + + + Illegal type. + + + + + Create Group Request (RFC988). + + + + + Create Group Reply (RFC988). + + + + + Join Group Request (RFC988). + + + + + Join Group Reply (RFC988). + + + + + Leave Group Request (RFC988). + + + + + Leave Group Reply (RFC988). + + + + + Confirm Group Request (RFC988). + + + + + Confirm Group Reply (RFC988). + + + + + Membership Query (RFC3376). + + + + + Version 3 Membership Report (RFC3376). + + + + + Version 1 Membership Report (RFC1112). + + + + + Version 2 Membership Report (RFC2236). + + + + + Version 2 Leave Group (RFC2236). + + + + + Multicast Traceroute Response. + + + + + Echo + RFC 792. +
+            +-----+------+------+-----------------+
+            | Bit | 0-7  | 8-15 | 16-31           |
+            +-----+------+------+-----------------+
+            | 0   | Type | Code | Checksum        |
+            +-----+------+------+-----------------+
+            | 0   | Identifier  | Sequence Number |
+            +-----+-------------+-----------------+
+            | 32  | Data...                       |
+            +-----+-------------------------------+
+            
+
+
+ + + Creates a Layer that represents the datagram to be used with PacketBuilder. + + + + + RFC 792. + + + + + The value of this field determines the format of the remaining data. + + + + + Sack-Permitted Option (RFC 2018) + This two-byte option may be sent in a SYN by a TCP that has been extended to receive (and presumably process) + the SACK option once the connection has opened. + It MUST NOT be sent on non-SYN segments. + +
+            +---------+---------+
+            | Kind=4  | Length=2|
+            +---------+---------+
+            
+
+
+ + + The number of bytes this option take. + + + + + The number of bytes this option value take. + + + + + Creates a selective ack permitted option. + + + + + Two selective ack permitted options are always equal. + + + + + Two selective ack permitted options are always equal. + + + + + Tries to read the option from a buffer starting from the option value (after the type and length). + + The buffer to read the option from. + The offset to the first byte to read the buffer. Will be incremented by the number of bytes read. + The number of bytes the option value should take according to the length field that was already read. + On success - the complex option read. On failure - null. + + + + The number of bytes this option will take. + + + + + True iff this option may appear at most once in a datagram. + + + + + The SACK option is to be used to convey extended acknowledgment information from the receiver to the sender over an established TCP connection. + +
+                              +--------+--------+
+                              | Kind=5 | Length |
+            +--------+--------+--------+--------+
+            |      Left Edge of 1st Block       |
+            +--------+--------+--------+--------+
+            |      Right Edge of 1st Block      |
+            +--------+--------+--------+--------+
+            |                                   |
+            /            . . .                  /
+            |                                   |
+            +--------+--------+--------+--------+
+            |      Left Edge of nth Block       |
+            +--------+--------+--------+--------+
+            |      Right Edge of nth Block      |
+            +--------+--------+--------+--------+
+            
+ + + The SACK option is to be sent by a data receiver to inform the data sender of non-contiguous blocks of data that have been received and queued. + The data receiver awaits the receipt of data (perhaps by means of retransmissions) to fill the gaps in sequence space between received blocks. + When missing segments are received, the data receiver acknowledges the data normally by advancing + the left window edge in the Acknowledgement Number Field of the TCP header. + The SACK option does not change the meaning of the Acknowledgement Number field. + + + + This option contains a list of some of the blocks of contiguous sequence space occupied by data that has been received and queued within the window. + Each contiguous block of data queued at the data receiver is defined in the SACK option by two 32-bit unsigned integers in network byte order: + + Left Edge of Block - This is the first sequence number of this block. + Right Edge of Block - This is the sequence number immediately following the last sequence number of this block. + + + Each block represents received bytes of data that are contiguous and isolated; + that is, the bytes just below the block, (Left Edge of Block - 1), and just above the block, (Right Edge of Block), have not been received. + + A SACK option that specifies n blocks will have a length of 8*n+2 bytes, so the 40 bytes available for TCP options can specify a maximum of 4 blocks. + It is expected that SACK will often be used in conjunction with the Timestamp option used for RTTM [Jacobson92], + which takes an additional 10 bytes (plus two bytes of padding); thus a maximum of 3 SACK blocks will be allowed in this case. + + The SACK option is advisory, in that, while it notifies the data sender that the data receiver has received the indicated segments, + the data receiver is permitted to later discard data which have been reported in a SACK option. +
+
+ + + The minimum number of bytes this option take. + + + + + The minimum number of bytes this option's value take. + + + + + Creates the option from the given list of selective ack blocks. + + + + + The default is no blocks. + + + + + Two selective ack options are equal if they have the same selective ack blocks. + + + + + Two selective ack options are equal if they have the same selective ack blocks. + + + + + The hash code of the selective acknowledgement option is the hash code of the option type xored with all the hash codes of the blocks. + + + + + Tries to read the option from a buffer starting from the option value (after the type and length). + + The buffer to read the option from. + The offset to the first byte to read the buffer. Will be incremented by the number of bytes read. + The number of bytes the option value should take according to the length field that was already read. + On success - the complex option read. On failure - null. + + + + The collection of selective ack blocks. + + + + + The number of bytes this option will take. + + + + + True iff this option may appear at most once in a datagram. + + + + + TCP POC-permitted Option (RFC 1693) +
+            +-----------+-------------+
+            |  Kind=9   |  Length=2   |
+            +-----------+-------------+
+            
+
+
+ + + The number of bytes this option take. + + + + + The number of bytes this option value take. + + + + + Creates a partial order connection permitted option. + + + + + Two partial order connection permitted options are always equal. + + + + + Two partial order connection permitted options are always equal. + + + + + Tries to read the option from a buffer starting from the option value (after the type and length). + + The buffer to read the option from. + The offset to the first byte to read the buffer. Will be incremented by the number of bytes read. + The number of bytes the option value should take according to the length field that was already read. + On success - the complex option read. On failure - null. + + + + The number of bytes this option will take. + + + + + True iff this option may appear at most once in a datagram. + + + + + CC.ECHO Option (RFC 1644). +
+            +--------+--------+--------+--------+--------+--------+
+            |00001101|00000110|    Connection Count:  SEG.CC      |
+            +--------+--------+--------+--------+--------+--------+
+             Kind=13  Length=6
+            
+ + + This option must be sent (in addition to a CC option) in a segment containing both a SYN and an ACK bit, + if the initial SYN segment contained a CC or CC.NEW option. + Its SEG.CC value is the SEG.CC value from the initial SYN. + + + + A CC.ECHO option should be sent only in a <SYN,ACK> segment and should be ignored if it is received in any other segment. + +
+
+ + + The base class for connection count TCP options. + + + + + The number of bytes this option take. + + + + + The number of bytes this option value take. + + + + + Two connection count options are equal of they are of the same option type and have the same connection count. + + + + + Two connection count options are equal of they are of the same option type and have the same connection count. + + + + + The hash code of the connection count option is the hash code of the option type xored with the hash code of the connection count. + + + + + Creates a connection count option according to the given option type and given connection count value. + + + + + Reads the connection count value from the buffer. + + The result connection count. + The buffer to read the connection count from. + The offset to start reading the connection byte from. + The number of bytes available for read in this buffer. + True iff the connection count could be read (there were enough bytes to read). + + + + The connection count value. + + + + + The number of bytes this option will take. + + + + + True iff this option may appear at most once in a datagram. + + + + + Creates the option using the given connection count value. + + + + + The default connection count value is 0. + + + + + Tries to read the option from a buffer starting from the option value (after the type and length). + + The buffer to read the option from. + The offset to the first byte to read the buffer. Will be incremented by the number of bytes read. + The number of bytes the option value should take according to the length field that was already read. + On success - the complex option read. On failure - null. + + + + RFC 793. + TCP Header Format +
+            +-----+-------------+----------+----+-----+-----+-----+-----+-----+-----+-----+-----+------------------+
+            | Bit | 0-3         | 4-6      | 7  | 8   | 9   | 10  | 11  | 12  | 13  | 14  | 15  | 16-31            |
+            +-----+-------------+----------+----+-----+-----+-----+-----+-----+-----+-----+-----+------------------+
+            | 0   | Source Port                                                                 | Destination Port |
+            +-----+-----------------------------------------------------------------------------+------------------+
+            | 32  | Sequence Number                                                                                |
+            +-----+------------------------------------------------------------------------------------------------+
+            | 64  | Acknowledgment Number                                                                          |
+            +-----+-------------+----------+----+-----+-----+-----+-----+-----+-----+-----+-----+------------------+
+            | 96  | Data Offset | Reserved | NS | CWR | ECE | URG | ACK | PSH | RST | SYN | FIN | Window           |
+            +-----+-------------+----------+----+-----+-----+-----+-----+-----+-----+-----+-----+------------------+
+            | 128 | Checksum                                                                    | Urgent Pointer   |
+            +-----+-----------------------------------------------------------------------------+------------------+
+            | 160 | Options + Padding                                                                              |
+            +-----+------------------------------------------------------------------------------------------------+
+            
+
+
+ + + Contains the common part of UDP and TCP. + + + Format: +
+            +-----+-------------+----------+-----+-----+-----+-----+-----+-----+------------------+
+            | Bit | 0-4         | 4-9      | 10  | 11  | 12  | 13  | 14  | 15  | 16-31            |
+            +-----+-------------+----------+-----+-----+-----+-----+-----+-----+------------------+
+            | 0   | Source Port                                                | Destination Port |
+            +-----+------------------------------------------------------------+------------------+
+            | 32  | Sequence Number                                                               |
+            +-----+-------------------------------------------------------------------------------+
+            
+
+
+
+ + + Indicates the port of the sending process. + In UDP, this field is optional and may only be assumed to be the port + to which a reply should be addressed in the absence of any other information. + If not used in UDP, a value of zero is inserted. + + + + + Destination Port has a meaning within the context of a particular internet destination address. + + + + + Checksum is the 16-bit one's complement of the one's complement sum of a pseudo header of information from the IP header, + the Transport header, and the data, padded with zero octets at the end (if necessary) to make a multiple of two octets. + + + + + True iff the checksum for the transport type is optional. + + + + + The minimum number of bytes the header takes. + + + + + The maximum number of bytes the header takes. + + + + + Creates a Layer that represents the datagram to be used with PacketBuilder. + + + + + The datagram is valid if the length is correct according to the header and the options are valid. + + + + + The sequence number of the first data octet in this segment (except when SYN is present). + If SYN is present the sequence number is the initial sequence number (ISN) and the first data octet is ISN+1. + + + + + The sequence number of the data that will come after this data. + + + + + If the ACK control bit is set this field contains the value of the next sequence number + the sender of the segment is expecting to receive. + Once a connection is established this is always sent. + + + + + The number of bytes in the TCP Header. + This indicates where the data begins. + The TCP header (even one including options) is an integral number of 32 bits (4 bytes) long. + + + + + Returns the actual header length. + + + + + A collection of bits for the TCP control. + + + + + The number of data octets beginning with the one indicated in the acknowledgment field which the sender of this segment is willing to accept. + + + + + The checksum field is the 16 bit one's complement of the one's complement sum of all 16 bit words in the header and text. + If a segment contains an odd number of header and text octets to be checksummed, + the last octet is padded on the right with zeros to form a 16 bit word for checksum purposes. + The pad is not transmitted as part of the segment. + While computing the checksum, the checksum field itself is replaced with zeros. + + The checksum also covers a 96 bit pseudo header conceptually prefixed to the TCP header. + This pseudo header contains the Source Address, the Destination Address, the Protocol, and TCP length. + This gives the TCP protection against misrouted segments. + This information is carried in the Internet Protocol and is transferred across the TCP/Network interface in the arguments or results of calls + by the TCP on the IP. + + +--------+--------+--------+--------+ + | Source Address | + +--------+--------+--------+--------+ + | Destination Address | + +--------+--------+--------+--------+ + | zero | PTCL | TCP Length | + +--------+--------+--------+--------+ + + The TCP Length is the TCP header length plus the data length in octets (this is not an explicitly transmitted quantity, but is computed), + and it does not count the 12 octets of the pseudo header. + + + + + True iff the checksum for the transport type is optional. + + + + + This field communicates the current value of the urgent pointer as a positive offset from the sequence number in this segment. + The urgent pointer points to the sequence number of the octet following the urgent data. + This field is only be interpreted in segments with the URG control bit set. + + + + + Returns the TCP options contained in this TCP Datagram. + + + + + The length of the TCP payload. + + + + + True iff the CongestionWindowReduced control bit is turned on. + + + + + True iff the ExplicitCongestionNotificationEcho control bit is turned on. + + + + + True iff the Urgent control bit is turned on. + + + + + True iff the Acknowledgment control bit is turned on. + + + + + True iff the Push control bit is turned on. + + + + + True iff the Reset control bit is turned on. + + + + + True iff the Synchronize control bit is turned on. + + + + + True iff the Fin control bit is turned on. + + + + + The first HTTP message in this TCP datagram. + + + + + All of the available HTTP messages in this TCP datagram. + + + + + The payload of the TCP datagram. + + + + + RFC 793. + Represents the TCP layer. + + + + + + Default constructor. + No TCP options. + + + + + Writes the layer to the buffer. + + The buffer to write the layer to. + The offset in the buffer to start writing the layer at. + The length of the layer's payload (the number of bytes after the layer in the packet). + The layer that comes before this layer. null if this is the first layer. + The layer that comes after this layer. null if this is the last layer. + + + + True iff the SequenceNumber, AcknowledgmentNumber, ControlBits, Window, UrgentPointer and Options fields are equal. + + + + + True iff the SequenceNumber, AcknowledgmentNumber, ControlBits, Window, UrgentPointer and Options fields are equal. + + + + + The sequence number of the first data octet in this segment (except when SYN is present). + If SYN is present the sequence number is the initial sequence number (ISN) and the first data octet is ISN+1. + + + + + If the ACK control bit is set this field contains the value of the next sequence number + the sender of the segment is expecting to receive. + Once a connection is established this is always sent. + + + + + A collection of bits for the TCP control. + + + + + The number of data octets beginning with the one indicated in the acknowledgment field which the sender of this segment is willing to accept. + + + + + This field communicates the current value of the urgent pointer as a positive offset from the sequence number in this segment. + The urgent pointer points to the sequence number of the octet following the urgent data. + This field is only be interpreted in segments with the URG control bit set. + + + + + The TCP options contained in this TCP Datagram. + + + + + The protocol that should be written in the previous (IPv4) layer. + + + + + The offset in the layer where the checksum should be written. + + + + + Whether the checksum is optional in the layer. + + + + + The number of bytes this layer will take. + + + + + Group Record Type. + + + + + Illegal record type. + + + + + A "Current-State Record" is sent by a system in response to a Query received on an interface. + It reports the current reception state of that interface, with respect to a single multicast address. + + MODE_IS_INCLUDE - indicates that the interface has a filter mode of INCLUDE for the specified multicast address. + The Source Address [i] fields in this Group Record contain the interface's source list for the specified multicast address, if it is non-empty. + + + + + + A "Current-State Record" is sent by a system in response to a Query received on an interface. + It reports the current reception state of that interface, with respect to a single multicast address. + + MODE_IS_EXCLUDE - indicates that the interface has a filter mode of EXCLUDE for the specified multicast address. + The Source Address [i] fields in this Group Record contain the interface's source list for the specified multicast address, if it is non-empty. + + + + + + A "Filter-Mode-Change Record" is sent by a system whenever a local invocation of IPMulticastListen causes a change of the filter mode + (i.e., a change from INCLUDE to EXCLUDE, or from EXCLUDE to INCLUDE), + of the interface-level state entry for a particular multicast address. + The Record is included in a Report sent from the interface on which the change occurred. + + CHANGE_TO_INCLUDE_MODE - indicates that the interface has changed to INCLUDE filter mode for the specified multicast address. + The Source Address [i] fields in this Group Record contain the interface's new source list for the specified multicast address, if it is non-empty. + + + + + + A "Filter-Mode-Change Record" is sent by a system whenever a local invocation of IPMulticastListen causes a change of the filter mode + (i.e., a change from INCLUDE to EXCLUDE, or from EXCLUDE to INCLUDE), + of the interface-level state entry for a particular multicast address. + The Record is included in a Report sent from the interface on which the change occurred. + + CHANGE_TO_EXCLUDE_MODE - indicates that the interface has changed to EXCLUDE filter mode for the specified multicast address. + The Source Address [i] fields in this Group Record contain the interface's new source list for the specified multicast address, if it is non-empty. + + + + + + A "Source-List-Change Record" is sent by a system whenever a local invocation of IPMulticastListen causes a change of source list + that is *not* coincident with a change of filter mode, of the interface-level state entry for a particular multicast address. + The Record is included in a Report sent from the interface on which the change occurred. + + ALLOW_NEW_SOURCES - indicates that the Source Address [i] fields in this Group Record contain a list of the additional sources + that the system wishes to hear from, for packets sent to the specified multicast address. + If the change was to an INCLUDE source list, these are the addresses that were added to the list; if the change was to an EXCLUDE source list, + these are the addresses that were deleted from the list. + + + If a change of source list results in both allowing new sources and blocking old sources, + then two Group Records are sent for the same multicast address, one of type ALLOW_NEW_SOURCES and one of type BLOCK_OLD_SOURCES. + + + + + + A "Source-List-Change Record" is sent by a system whenever a local invocation of IPMulticastListen causes a change of source list + that is *not* coincident with a change of filter mode, of the interface-level state entry for a particular multicast address. + The Record is included in a Report sent from the interface on which the change occurred. + + BLOCK_OLD_SOURCES - indicates that the Source Address [i] fields in this Group Record contain a list of the sources + that the system no longer wishes to hear from, for packets sent to the specified multicast address. + If the change was to an INCLUDE source list, these are the addresses that were deleted from the list; if the change was to an EXCLUDE source list, + these are the addresses that were added to the list. + + + If a change of source list results in both allowing new sources and blocking old sources, + then two Group Records are sent for the same multicast address, one of type ALLOW_NEW_SOURCES and one of type BLOCK_OLD_SOURCES. + + + + + + RFC 1112. + + + + + RFC 1112. + Represents an IGMP version 1 layer. + + + + + + Represents a Simple IGMP layer. + A simple layer only has the 8 bytes header without additional fields. + + + + + + Writes the layer to the buffer. + This method ignores the payload length, and the previous and next layers. + + The buffer to write the layer to. + The offset in the buffer to start writing the layer at. + + + + Xor of the hash codes of the layer length, datalink, message type, query version and group address. + + + + + true iff the the group address is equal. + + + + + true iff the the group address is equal. + + + + + The Group Address field is set to zero when sending a General Query, + and set to the IP multicast address being queried when sending a Group-Specific Query or Group-and-Source-Specific Query. + In a Membership Report of version 1 or 2 or Leave Group message, the group address field holds the IP multicast group address of the group being reported or left. + In a Membership Report of version 3 this field is meaningless. + + + + + The number of bytes this layer will take. + + + + + The actual time allowed, called the Max Resp Time. + + + + + The type of the IGMP message of concern to the host-router interaction. + + + + + The IGMP version of a Membership Query message. + If the type is not a query, None will be returned. + + + + + RFC 2521. +
+            +-----+------+------+----------+
+            | Bit | 0-7  | 8-15 | 16-31    |
+            +-----+------+------+----------+
+            | 0   | Type | Code | Checksum |
+            +-----+------+------+----------+
+            | 32  | Reserved    | Pointer  |
+            +-----+-------------+----------+
+            | 64  | Internet Header        |
+            |     | + 64 bits of           |
+            |     | Original Data Datagram |
+            +-----+------------------------+
+            
+
+
+ + + Creates a Layer that represents the datagram to be used with PacketBuilder. + + + + + Valid if the datagram's length is OK, the checksum is correct, the code is in the expected range, + the IPv4 payload contains at least an IPv4 header, the IPv4's payload is in the expected size and the Pointer points to a byte in the IPv4 payload. + + + + + An offset into the Original Internet Headers that locates the most significant octet of the offending SPI. + Will be zero when no SPI is present. + + + + + The minimum valid ICMP code for this type of ICMP datagram. + + + + + The maximum valid ICMP code for this type of ICMP datagram. + + + + + RFC 1256. + + + + + The value of this field determines the format of the remaining data. + + + + + RFC 792. + Represents an ICMP Redirect message layer. + + + + + + A sub-type of the message. Specific method of this message type. + + + + + Address of the gateway to which traffic for the network specified in the internet destination network field of the original datagram's data should be sent. + + + + + The value of this field determines the format of the remaining data. + + + + + A sub-type of the message. Specific method of this message type. + + + + + A value that should be interpreted according to the specific message. + + + + + RFC 792. + + + + + The value of this field determines the format of the remaining data. + + + + + The different ICMP code values for Redirect ICMP type. + + + + + RFC 792. + + + + + RFC 792. + + + + + RFC 792. + + + + + RFC 792. + + + + + A raw packet. + Includes all packet layers as taken from an adapter including the type of the datalink. + Immutable. + + + + + Creates a packet from a string that represents bytes in a hexadecimal format. + + + + + Create a packet from an array of bytes. + + The bytes of the packet. This array should not be changed after creating the packet until the packet is no longer used. + A timestamp of the packet - when it was captured. + The type of the datalink of the packet. + + + + Create a packet from an array of bytes. + + The bytes of the packet. This array should not be changed after creating the packet until the packet is no longer used. + A timestamp of the packet - when it was captured. + The type of the datalink of the packet. + + + + Equals means that the packets have equal data. + + The packet to compare this packet to. + True iff the packets have equal data. + + + + Equals means that the packets have equal data. + + The packet to compare this packet to. + True iff the packets have equal data. + + + + The hash code of a packet is the xor of all its bytes. Each byte is xored with the next 8 bits of the integer. + + + + + The Packet string contains the datalink and the length. + + + + + Returns an enumerator that iterates through the bytes of the packet. + + + + + Returns the first offset in the packet that contains the given byte. + + + + + This operation is invalid because the object is immutable. + + + + + This operation is invalid because the object is immutable. + + + + + This operation is invalid because the object is immutable. + + + + + This operation is invalid because the object is immutable. + + + + + Determines whether the packet contains a specific byte. + + + + + Copies the bytes of the packet to a buffer, starting at a particular offset. + + + + + This operation is invalid because the object is immutable. + + + + + The number of bytes this packet take. + + + + + The time this packet was captured. + + + + + The type of the datalink of the device this packet was captured from. + + + + + The underlying array of bytes. + When taking this array the caller is responsible to make sure this array will not be modified while the packet is still in use. + + + + + Returns the value of the byte in the given offset. + Set operation is invalid because the object is immutable. + + + + + Returns the number of bytes in this packet. + + + + + True since this object is read only. + + + + + True iff the packet is valid. + The packet is valid unless an invalid part of it was found. + Examples for invalid parts: + * Bad checksum. + * An illegal value for a field. + * Length of packet is too short for a header or according to a length field. + + + + + Takes the entire packet as an Ethernet datagram. + + + + + Represents IPv4 Options. + The options may appear or not in datagrams. + They must be implemented by all IP modules (host and gateways). + What is optional is their transmission in any particular datagram, not their implementation. + + + + + A generic Options class. + Represents a list of options (either IPv4 options or TCP options). + + The Option type this collection contains. + + + + Two options are equal iff they have the exact same options. + + + + + Two options are equal iff they have the exact same options. + + + + + The hash code is the xor of the following hash codes: number of bytes the options take and all the options. + + + + + A string of all the option type names. + + + + + Returns the collection of options. + + + + + Returns the number of options. + + + + + Returns the option in the given index. + + The zero based index of the option. + The option in the given index. + + + + The number of bytes the options take. + + + + + Whether or not the options parsed ok. + + + + + The maximum number of bytes the options may take. + + + + + Creates options from a list of options. + + The list of options. + + + + Creates options from a list of options. + + The list of options. + + + + No options instance. + + + + + The Quick-Start Option for IPv4 + + + The Quick-Start Request for IPv4 is defined as follows: +
+            +--------+----------+-------+---------+-------+-------+
+            | 0-7    | 8-15     | 16-19 | 20-23   | 24-29 | 30-31 |
+            +--------+----------+-------+---------+-------+-------+
+            | Option | Length=8 | Func. | Rate    | QS TTL        |
+            |        |          | 0000  | Request |               |
+            +--------+----------+-------+---------+-------+-------+
+            | QS Nonce                                    | R     |
+            +---------------------------------------------+-------+
+              
+
+
+
+ + + The number of bytes this option take. + + + + + The number of bytes this option's value take. + + + + + The maximum value for the rate field. + + + + + Create a quick start option according to the given field values. + + The function of this quick start option. + Either the rate requested or reported. + + The Quick-Start TTL (QS TTL) field. + The sender MUST set the QS TTL field to a random value. + Routers that approve the Quick-Start Request decrement the QS TTL (mod 256) by the same amount that they decrement the IP TTL. + The QS TTL is used by the sender to detect if all the routers along the path understood and approved the Quick-Start option. + + + The QS Nonce gives the Quick-Start sender some protection against receivers lying about the value of the received Rate Request. + + + + + Creates a request with 0 fields. + + + + + Two quick start options are equal iff they have the exact same field values. + + + + + Two trace route options are equal iff they have the exact same field values. + + + + + The hash code is the xor of the base class hash code with the following values hash code: + The combination of function, rate and ttl and the nonce. + + + + + Tries to read the option from a buffer starting from the option value (after the type and length). + + The buffer to read the option from. + The offset to the first byte to read the buffer. Will be incremented by the number of bytes read. + The number of bytes the option value should take according to the length field that was already read. + On success - the complex option read. On failure - null. + + + + The function of this quick start option. + + + + + If function is request then this field is the rate request. + If function is report then this field is the rate report. + + + + + The rate translated to KBPS. + + + + + The Quick-Start TTL (QS TTL) field. + The sender MUST set the QS TTL field to a random value. + Routers that approve the Quick-Start Request decrement the QS TTL (mod 256) by the same amount that they decrement the IP TTL. + The QS TTL is used by the sender to detect if all the routers along the path understood and approved the Quick-Start option. + + + For a Rate Request, the transport sender MUST calculate and store the TTL Diff, + the difference between the IP TTL value, and the QS TTL value in the Quick-Start Request packet, as follows: + TTL Diff = ( IP TTL - QS TTL ) mod 256 + + + + + + The QS Nonce gives the Quick-Start sender some protection against receivers lying about the value of the received Rate Request. + This is particularly important if the receiver knows the original value of the Rate Request + (e.g., when the sender always requests the same value, and the receiver has a long history of communication with that sender). + Without the QS Nonce, there is nothing to prevent the receiver from reporting back to the sender a Rate Request of K, + when the received Rate Request was, in fact, less than K. + + + The format for the 30-bit QS Nonce. + + + Bits + Purpose + + Bits 0-1Rate 15 -> Rate 14 + Bits 2-3Rate 14 -> Rate 13 + Bits 4-5Rate 13 -> Rate 12 + Bits 6-7Rate 12 -> Rate 11 + Bits 8-9Rate 11 -> Rate 10 + Bits 10-11Rate 10 -> Rate 9 + Bits 12-13Rate 9 -> Rate 8 + Bits 14-15Rate 8 -> Rate 7 + Bits 16-17Rate 7 -> Rate 6 + Bits 18-19Rate 6 -> Rate 5 + Bits 20-21Rate 5 -> Rate 4 + Bits 22-23Rate 4 -> Rate 3 + Bits 24-25Rate 3 -> Rate 2 + Bits 26-27Rate 2 -> Rate 1 + Bits 28-29Rate 1 -> Rate 0 + + + + + The transport sender MUST initialize the QS Nonce to a random value. + If the router reduces the Rate Request from rate K to rate K-1, + then the router MUST set the field in the QS Nonce for "Rate K -> Rate K-1" to a new random value. + Similarly, if the router reduces the Rate Request by N steps, + the router MUST set the 2N bits in the relevant fields in the QS Nonce to a new random value. + The receiver MUST report the QS Nonce back to the sender. + + + + If the Rate Request was not decremented in the network, then the QS Nonce should have its original value. + Similarly, if the Rate Request was decremented by N steps in the network, + and the receiver reports back a Rate Request of K, then the last 2K bits of the QS Nonce should have their original value. + + + + + + The number of bytes this option will take. + + + + + True iff this option may appear at most once in a datagram. + + + + + RFC 1112. + Version 1 (query or report): +
+            +-----+---------+------+--------+----------+
+            | Bit | 0-3     | 4-7  | 8-15   | 16-31    |
+            +-----+---------+------+--------+----------+
+            | 0   | Version | Type | Unused | Checksum |
+            +-----+---------+------+--------+----------+
+            | 32  | Group Address                      |
+            +-----+------------------------------------+
+            
+ + RFC 2236. + Version 2 (query, report or leave group): +
+            +-----+------+---------------+----------+
+            | Bit | 0-7  | 8-15          | 16-31    |
+            +-----+------+---------------+----------+
+            | 0   | Type | Max Resp Time | Checksum |
+            +-----+------+---------------+----------+
+            | 32  | Group Address                   |
+            +-----+---------------------------------+
+            
+ + RFC 3376. + Version 3 query: +
+            +-----+------+---+-----+---------------+-----------------------+
+            | Bit | 0-3  | 4 | 5-7 | 8-15          | 16-31                 |
+            +-----+------+---+-----+---------------+-----------------------+
+            | 0   | Type = 0x11    | Max Resp Code | Checksum              |
+            +-----+----------------+---------------+-----------------------+
+            | 32  | Group Address                                          |
+            +-----+------+---+-----+---------------+-----------------------+
+            | 64  | Resv | S | QRV | QQIC          | Number of Sources (N) |
+            +-----+------+---+-----+---------------+-----------------------+
+            | 96  | Source Address [1]                                     |
+            +-----+--------------------------------------------------------+
+            | 128 | Source Address [2]                                     |
+            +-----+--------------------------------------------------------+
+            .     .                         .                              .
+            .     .                         .                              .
+            +-----+--------------------------------------------------------+
+            | 64  | Source Address [N]                                     |
+            | +   |                                                        |
+            | 32N |                                                        |
+            +-----+--------------------------------------------------------+
+            
+ + RFC 3376. + Version 3 report: +
+            +-----+-------------+----------+-----------------------------+
+            | Bit | 0-7         | 8-15     | 16-31                       |
+            +-----+-------------+----------+-----------------------------+
+            | 0   | Type = 0x22 | Reserved | Checksum                    |
+            +-----+-------------+----------+-----------------------------+
+            | 32  | Reserved               | Number of Group Records (M) |
+            +-----+------------------------+-----------------------------+
+            | 64  | Group Record [1]                                     |
+            .     .                                                      .
+            .     .                                                      .
+            .     .                                                      .
+            |     |                                                      |
+            +-----+------------------------------------------------------+
+            |     | Group Record [2]                                     |
+            .     .                                                      .
+            .     .                                                      .
+            .     .                                                      .
+            |     |                                                      |
+            +-----+------------------------------------------------------+
+            |     |                         .                            |
+            .     .                         .                            .
+            |     |                         .                            |
+            +-----+------------------------------------------------------+
+            |     | Group Record [M]                                     |
+            .     .                                                      .
+            .     .                                                      .
+            .     .                                                      .
+            |     |                                                      |
+            +-----+------------------------------------------------------+
+            
+
+
+ + + The number of bytes the IGMP header takes for all messages but query version 3. + All the bytes but the records of the report version 3. + + + + + The number of bytes the query version 3 IGMP message header takes. + All the bytes but the source addresses. + + + + + The maximum value for the query robustness varialbe. + + + + + Creates a Layer that represents the datagram to be used with PacketBuilder. + + + + + IGMP is valid if the checksum is correct, the length fits the message type and data and the MaxResponseCode is 0 in messages where it is not used. + + + + + Calculates the value from the given code as follows: +
+             0 1 2 3 4 5 6 7
+            +-+-+-+-+-+-+-+-+
+            |1| exp | mant  |
+            +-+-+-+-+-+-+-+-+
+            
+ Value = (mant | 0x10) << (exp + 3). +
+
+ + + The Max Resp Code field specifies the maximum time allowed before sending a responding report. + + + + + The maximum value for the max response time in version 3 messages. + + + + + The maximum value for the query interval. + + + + + The type of the IGMP message of concern to the host-router interaction. + + + + + The version of the IGMP protocol for this datagram. + + + + + The IGMP version of a Membership Query message is determined as follows: + + IGMPv1 Query: length = 8 octets AND Max Resp Code field is zero. + IGMPv2 Query: length = 8 octets AND Max Resp Code field is non-zero. + IGMPv3 Query: length >= 12 octets. + + If the type is not a query, None will be returned. + If the query message do not match any of the above conditions (e.g., a Query of length 10 octets) Unknown will be returned. + + + + + The Max Resp Code field specifies the maximum time allowed before sending a responding report. + The actual time allowed, called the Max Resp Time, is represented in units of 1/10 second and is derived from the Max Resp Code as follows: + + If Max Resp Code < 128, Max Resp Time = Max Resp Code. + + If Max Resp Code >= 128, Max Resp Code represents a floating-point value as follows: +
+                0 1 2 3 4 5 6 7
+                +-+-+-+-+-+-+-+-+
+                |1| exp | mant  |
+                +-+-+-+-+-+-+-+-+
+                
+ Max Resp Time = (mant | 0x10) << (exp + 3). +
+
+ + + Small values of Max Resp Time allow IGMPv3 routers to tune the "leave latency" + (the time between the moment the last host leaves a group and the moment the routing protocol is notified that there are no more members). + Larger values, especially in the exponential range, allow tuning of the burstiness of IGMP traffic on a network. + +
+
+ + + The actual time allowed, called the Max Resp Time, is represented in units of 1/10 second and is derived from the Max Resp Code as follows: + + If the query version is 1 or 2 or if Max Resp Code < 128, Max Resp Time = Max Resp Code. + + If Max Resp Code >= 128, Max Resp Code represents a floating-point value as follows: +
+                 0 1 2 3 4 5 6 7
+                +-+-+-+-+-+-+-+-+
+                |1| exp | mant  |
+                +-+-+-+-+-+-+-+-+
+                
+ Max Resp Time = (mant | 0x10) << (exp + 3). +
+
+
+
+ + + The Checksum is the 16-bit one's complement of the one's complement sum of the whole IGMP message (the entire IP payload). + For computing the checksum, the Checksum field is set to zero. + When receiving packets, the checksum MUST be verified before processing a packet. + + + + + True iff the checksum value is correct according to the datagram data. + + + + + The Group Address field is set to zero when sending a General Query, + and set to the IP multicast address being queried when sending a Group-Specific Query or Group-and-Source-Specific Query. + In a Membership Report of version 1 or 2 or Leave Group message, the group address field holds the IP multicast group address of the group being reported or left. + In a Membership Report of version 3 this field is meaningless. + + + + + When set to one, the S Flag indicates to any receiving multicast routers that they are to suppress the normal timer updates they perform upon hearing a Query. + It does not, however, suppress the querier election or the normal "host-side" processing of a Query + that a router may be required to perform as a consequence of itself being a group member. + + + Valid only on query of version 3. + + + + + If non-zero, the QRV field contains the [Robustness Variable] value used by the querier, i.e., the sender of the Query. + If the querier's [Robustness Variable] exceeds 7, the maximum value of the QRV field, the QRV is set to zero. + Routers adopt the QRV value from the most recently received Query as their own [Robustness Variable] value, + unless that most recently received QRV was zero, in which case the receivers use the default [Robustness Variable] value or a statically configured value. + + + Valid only on query of version 3. + + + + + The Querier's Query Interval Code field specifies the [Query Interval] used by the querier. + The actual interval, called the Querier's Query Interval (QQI), is represented in units of seconds and is derived from the Querier's Query Interval Code as follows: + + If QQIC < 128, QQI = QQIC + + If QQIC >= 128, QQIC represents a floating-point value as follows: +
+                 0 1 2 3 4 5 6 7
+                +-+-+-+-+-+-+-+-+
+                |1| exp | mant  |
+                +-+-+-+-+-+-+-+-+
+                
+ QQI = (mant | 0x10) << (exp + 3) +
+
+ Multicast routers that are not the current querier adopt the QQI value from the most recently received Query as their own [Query Interval] value, + unless that most recently received QQI was zero, in which case the receiving routers use the default [Query Interval] value. +
+ + Valid only on query of version 3. + +
+ + + The actual interval, called the Querier's Query Interval (QQI), is represented in units of seconds and is derived from the Querier's Query Interval Code as follows: + + If QQIC < 128, QQI = QQIC + + If QQIC >= 128, QQIC represents a floating-point value as follows: +
+                 0 1 2 3 4 5 6 7
+                +-+-+-+-+-+-+-+-+
+                |1| exp | mant  |
+                +-+-+-+-+-+-+-+-+
+                
+ QQI = (mant | 0x10) << (exp + 3) +
+
+
+ + Valid only on query of version 3. + +
+ + + The Number of Sources (N) field specifies how many source addresses are present in the Query. + This number is zero in a General Query or a Group-Specific Query, and non-zero in a Group-and-Source-Specific Query. + This number is limited by the MTU of the network over which the Query is transmitted. + For example, on an Ethernet with an MTU of 1500 octets, the IP header including the Router Alert option consumes 24 octets, + and the IGMP fields up to including the Number of Sources (N) field consume 12 octets, leaving 1464 octets for source addresses, + which limits the number of source addresses to 366 (1464/4). + + + Valid only on query of version 3. + + + + + The Source Address [i] fields are a vector of n IP unicast addresses, + where n is the value in the Number of Sources (N) field. + + + Valid only on query of version 3. + + + + + The Number of Group Records (M) field specifies how many Group Records are present in this Report. + + + Valid only on report of version 3. + + + + + Each Group Record is a block of fields containing information pertaining to the sender's membership in a single multicast group on the interface from which the Report is sent. + + + + + RFC 792. + Represents an ICMP Timestamp layer. + + + + + + Writes the ICMP payload to the buffer. + Doesn't include payload in the next layers. + + The buffer to write the ICMP payload to. + The offset in the buffer to start writing the payload at. + + + + True iff the OriginateTimestamp, ReceiveTimestamp and the TransmitTimestamp fields are equal. + + + + + True iff the OriginateTimestamp, ReceiveTimestamp and the TransmitTimestamp fields are equal. + + + + + The time the sender last touched the message before sending it. + + + + + The time the echoer first touched it on receipt. + + + + + The time the echoer last touched the message on sending it. + + + + + The value of this field determines the format of the remaining data. + + + + + The number of bytes the ICMP payload takes. + + + + + RFC 792. + + + + + A sub-type of the message. Specific method of this message type. + + + + + The value of this field determines the format of the remaining data. + + + + + A sub-type of the message. Specific method of this message type. + + + + + RFC 1256. + An ICMP Router Advertisement layer. + + + + + + Writes the ICMP payload to the buffer. + Doesn't include payload in the next layers. + + The buffer to write the ICMP payload to. + The offset in the buffer to start writing the payload at. + + + + True iff the Entries are equal to the other ICMP entries. + + + + + True iff the Entries are equal to the other ICMP entries. + + + + + The maximum time that the router addresses may be considered valid. + + + + + The pairs of sending router's IP address(es) on the interface from which this message is sent + and the preferability of each Router Address[i] as a default router address, relative to other router addresses on the same subnet. + A signed, twos-complement value; higher values mean more preferable. + + + + + The value of this field determines the format of the remaining data. + + + + + A value that should be interpreted according to the specific message. + + + + + The number of bytes the ICMP payload takes. + + + + + RFC 1788. +
+            +-----+------+------+-----------------+
+            | Bit | 0-7  | 8-15 | 16-31           |
+            +-----+------+------+-----------------+
+            | 0   | Type | Code | Checksum        |
+            +-----+------+------+-----------------+
+            | 32  | Identifier  | Sequence Number |
+            +-----+-------------+-----------------+
+            
+
+
+ + + Creates a Layer that represents the datagram to be used with PacketBuilder. + + + + + The ICMP code values for Code Conversion Failed ICMP type. + + + + + RFC 1475. + The introduction of network layer conversion requires a new message type, to report conversion errors. + Note that an invalid datagram should result in the sending of some other ICMP message (e.g., parameter problem) or the silent discarding of the datagram. + This message is only sent when a valid datagram cannot be converted. + + + + + RFC 1475. + The introduction of network layer conversion requires a new message type, to report conversion errors. + Note that an invalid datagram should result in the sending of some other ICMP message (e.g., parameter problem) or the silent discarding of the datagram. + This message is only sent when a valid datagram cannot be converted. + + + + + RFC 1475. + The introduction of network layer conversion requires a new message type, to report conversion errors. + Note that an invalid datagram should result in the sending of some other ICMP message (e.g., parameter problem) or the silent discarding of the datagram. + This message is only sent when a valid datagram cannot be converted. + + + + + RFC 1475. + The introduction of network layer conversion requires a new message type, to report conversion errors. + Note that an invalid datagram should result in the sending of some other ICMP message (e.g., parameter problem) or the silent discarding of the datagram. + This message is only sent when a valid datagram cannot be converted. + + + + + RFC 1475. + The introduction of network layer conversion requires a new message type, to report conversion errors. + Note that an invalid datagram should result in the sending of some other ICMP message (e.g., parameter problem) or the silent discarding of the datagram. + This message is only sent when a valid datagram cannot be converted. + + + + + RFC 1475. + The introduction of network layer conversion requires a new message type, to report conversion errors. + Note that an invalid datagram should result in the sending of some other ICMP message (e.g., parameter problem) or the silent discarding of the datagram. + This message is only sent when a valid datagram cannot be converted. + + + + + RFC 1475. + The introduction of network layer conversion requires a new message type, to report conversion errors. + Note that an invalid datagram should result in the sending of some other ICMP message (e.g., parameter problem) or the silent discarding of the datagram. + This message is only sent when a valid datagram cannot be converted. + + + + + RFC 1475. + The introduction of network layer conversion requires a new message type, to report conversion errors. + Note that an invalid datagram should result in the sending of some other ICMP message (e.g., parameter problem) or the silent discarding of the datagram. + This message is only sent when a valid datagram cannot be converted. + + + + + RFC 1475. + The introduction of network layer conversion requires a new message type, to report conversion errors. + Note that an invalid datagram should result in the sending of some other ICMP message (e.g., parameter problem) or the silent discarding of the datagram. + This message is only sent when a valid datagram cannot be converted. + + + + + RFC 1475. + The introduction of network layer conversion requires a new message type, to report conversion errors. + Note that an invalid datagram should result in the sending of some other ICMP message (e.g., parameter problem) or the silent discarding of the datagram. + This message is only sent when a valid datagram cannot be converted. + + + + + RFC 1475. + The introduction of network layer conversion requires a new message type, to report conversion errors. + Note that an invalid datagram should result in the sending of some other ICMP message (e.g., parameter problem) or the silent discarding of the datagram. + This message is only sent when a valid datagram cannot be converted. + + + + + RFC 1475. + The introduction of network layer conversion requires a new message type, to report conversion errors. + Note that an invalid datagram should result in the sending of some other ICMP message (e.g., parameter problem) or the silent discarding of the datagram. + This message is only sent when a valid datagram cannot be converted. + + + + + RFC 2616. + Represents an HTTP response layer. + + + + + Two HTTP response layers are equal iff they have the same version, header, body, status code and reason phrase. + + + + + Two HTTP response layers are equal iff they have the same version, header, body, status code and reason phrase. + + + + + false since this is a response. + + + + + The status code of the response. + null if no status code exists. + + + + + The data of the reason phrase. + Example: OK + + + + + An emotion that can be set in a TCP mood option. + + + + + :) + + + + + :( + + + + + :D + + + + + %( + + + + + :o + + + + + :O + + + + + :P + + + + + :@ + + + + + >:@ + + + + + :| + + + + + ;) + + + + + >:) + + + + + An unknown emotion. + + + + + TCP Mood Option: +
+            +---------+--------+------------+
+            | Kind=25 | Length | ASCII Mood |
+            +---------+--------+------------+
+            
+ + + It is proposed that option 25 (released 2000-12-18) be used to define packet mood. + This option would have a length value of 4 or 5 bytes. + All the simple emotions described as expressible via this mechanism can be displayed with two or three 7-bit, ASCII-encoded characters. + Multiple mood options may appear in a TCP header, so as to express more complex moods than those defined here (for instance if a packet were happy and surprised). + + + + It is proposed that common emoticons be used to denote packet mood. + Packets do not "feel" per se. The emotions they could be tagged with are a reflection of the user mood expressed through packets. + So the humanity expressed in a packet would be entirely sourced from humans. + To this end, it is proposed that simple emotions be used convey mood as follows. + +
+            ASCII                Mood
+            =====                ====
+            :)                   Happy
+            :(                   Sad
+            :D                   Amused
+            %(                   Confused
+            :o                   Bored
+            :O                   Surprised
+            :P                   Silly
+            :@                   Frustrated
+            >:@                  Angry
+            :|                   Apathetic
+            ;)                   Sneaky
+            >:)                  Evil
+            
+ + Proposed ASCII character encoding +
+            Binary          Dec  Hex     Character
+            ========        ===  ===     =========
+            010 0101        37   25      %
+            010 1000        40   28      (
+            010 1001        41   29      )
+            011 1010        58   3A      :
+            011 1011        59   3B      ;
+            011 1110        62   3E      >
+            100 0000        64   40      @
+            100 0100        68   44      D
+            100 1111        79   4F      O
+            101 0000        80   50      P
+            110 1111        111  6F      o
+            111 1100        124  7C      |
+            
+
+
+
+ + + The minimum number of bytes this option take. + + + + + The maximum number of bytes this option take. + + + + + The minimum number of bytes this option value take. + + + + + The maximum number of bytes this option value take. + + + + + Creates the option using the given emotion. + + + + + The default emotion is confused. + + + + + Two mood options are equal if they have the same emotion. + + + + + Two mood options are equal if they have the same emotion. + + + + + The hash code of the echo option is the hash code of the option type xored with the hash code info. + + + + + Tries to read the option from a buffer starting from the option value (after the type and length). + + The buffer to read the option from. + The offset to the first byte to read the buffer. Will be incremented by the number of bytes read. + The number of bytes the option value should take according to the length field that was already read. + On success - the complex option read. On failure - null. + + + + The emotion of the option. + + + + + The ASCII string of the emotion. + + + + + The number of bytes this option will take. + + + + + True iff this option may appear at most once in a datagram. + + + + + Extension methods for byte[]. + + + + + Compares all the bytes in the two ranges of the arrays. + Returns the first non-zero compare value of the bytes in the ranges or zero if the ranges have the same byte values. + + The first array to compare. + The offset of the first byte to compare in the first array. + The second array to compare. + The offset of the first byte to compare in the second array. + The number of bytes to compare. + The first non-zero compare value of the bytes in the ranges or zero if the ranges have the same byte values. + + + + Compares all the bytes in the two ranges of the arrays. + Returns true iff the ranges have the same byte values. + + The first array to compare. + The offset of the first byte to compare in the first array. + The second array to compare. + The offset of the first byte to compare in the second array. + The number of bytes to compare. + True iff the ranges have the same byte values. + + + + Returns the first offset in the array where the other array's range sequence of bytes can be found or the length of the array if no match exists. + + The array to search for the sequence of bytes. + The offset of the first byte in the array that should be compared to the sequence to find. + The number of bytes in the array that the sequence can be searched in. + The array that contains the sequence of bytes to search. + The offset in the array containing the sequence of the first byte of the sequence. + The number of bytes of the sequence. + The first offset in the array where the other array's range sequence of bytes can be found or the length of the array if no match exists. + + + + Returns the first offset in the array where the other array sequence of bytes can be found or the length of the array if no match exists. + + The array to search for the sequence of bytes. + The offset of the first byte in the array that should be compared to the sequence to find. + The number of bytes in the array that the sequence can be searched in. + The array that contains the sequence of bytes to search. + The first offset in the array where the other array sequence of bytes can be found or the length of the array if no match exists. + + + + Copies a specified number of bytes from a source array starting at a particular offset to a destination array starting at a particular offset. + + The source buffer. + The byte offset into source. + The destination buffer. + The byte offset into destination. + The number of bytes to copy. + + + + Reads a byte from a specific offset. + + The buffer to read the byte from. + The offset in the buffer to start reading. + The value read from the buffer. + + + + Reads a byte from a specific offset and increments the offset by 1. + + The buffer to read the byte from. + The offset in the buffer to start reading and to increment. + The value read from the buffer. + + + + Reads bytes from a specific offset. + + The buffer to read the bytes from. + The offset in the buffer to start reading. + The number of bytes to read. + The value read from the buffer. + + + + Reads bytes from a specific offset and increments the offset by the number of bytes read. + + The buffer to read the bytes from. + The offset in the buffer to start reading and to increment. + The number of bytes to read. + The value read from the buffer. + + + + Reads 2 bytes from a specific offset as a short with a given endianity. + + The buffer to read the bytes from. + The offset in the buffer to start reading. + The endianity to use to translate the bytes to the value. + The value converted from the read bytes according to the endianity. + + + + Reads 2 bytes from a specific offset as a ushort with a given endianity. + + The buffer to read the bytes from. + The offset in the buffer to start reading. + The endianity to use to translate the bytes to the value. + The value converted from the read bytes according to the endianity. + + + + Reads 2 bytes from a specific offset as a ushort with a given endianity and increments the offset by the number of bytes read. + + The buffer to read the bytes from. + The offset in the buffer to start reading. + The endianity to use to translate the bytes to the value. + The value converted from the read bytes according to the endianity. + + + + Reads 3 bytes from a specific offset as a UInt24 with a given endianity. + + The buffer to read the bytes from. + The offset in the buffer to start reading. + The endianity to use to translate the bytes to the value. + The value converted from the read bytes according to the endianity. + + + + Reads 3 bytes from a specific offset as a UInt24 with a given endianity and increments the offset by the number of bytes read. + + The buffer to read the bytes from. + The offset in the buffer to start reading. + The endianity to use to translate the bytes to the value. + The value converted from the read bytes according to the endianity. + + + + Reads 4 bytes from a specific offset as an int with a given endianity. + + The buffer to read the bytes from. + The offset in the buffer to start reading. + The endianity to use to translate the bytes to the value. + The value converted from the read bytes according to the endianity. + + + + Reads 4 bytes from a specific offset as a uint with a given endianity. + + The buffer to read the bytes from. + The offset in the buffer to start reading. + The endianity to use to translate the bytes to the value. + The value converted from the read bytes according to the endianity. + + + + Reads 4 bytes from a specific offset as a uint with a given endianity and increments the offset by the number of bytes read. + + The buffer to read the bytes from. + The offset in the buffer to start reading. + The endianity to use to translate the bytes to the value. + The value converted from the read bytes according to the endianity. + + + + Reads 6 bytes from a specific offset as a UInt48 with a given endianity. + + The buffer to read the bytes from. + The offset in the buffer to start reading. + The endianity to use to translate the bytes to the value. + The value converted from the read bytes according to the endianity. + + + + Reads 6 bytes from a specific offset as a UInt48 with a given endianity and increments the offset by the number of bytes read. + + The buffer to read the bytes from. + The offset in the buffer to start reading. + The endianity to use to translate the bytes to the value. + The value converted from the read bytes according to the endianity. + + + + Reads 6 bytes from a specific offset as a MacAddress with a given endianity. + + The buffer to read the bytes from. + The offset in the buffer to start reading. + The endianity to use to translate the bytes to the value. + The value converted from the read bytes according to the endianity. + + + + Reads 6 bytes from a specific offset as a MacAddress with a given endianity and increments the offset by the number of bytes read. + + The buffer to read the bytes from. + The offset in the buffer to start reading. + The endianity to use to translate the bytes to the value. + The value converted from the read bytes according to the endianity. + + + + Reads 4 bytes from a specific offset as an IPv4 address with a given endianity. + + The buffer to read the bytes from. + The offset in the buffer to start reading. + The endianity to use to translate the bytes to the value. + The value converted from the read bytes according to the endianity. + + + + Reads 4 bytes from a specific offset as an IPv4 address with a given endianity and increments the offset by the number of bytes read. + + The buffer to read the bytes from. + The offset in the buffer to start reading. + The endianity to use to translate the bytes to the value. + The value converted from the read bytes according to the endianity. + + + + Reads 4 bytes from a specific offset as an IPv4 time of day with a given endianity. + + The buffer to read the bytes from. + The offset in the buffer to start reading. + The endianity to use to translate the bytes to the value. + The value converted from the read bytes according to the endianity. + + + + Reads 4 bytes from a specific offset as an IPv4 time of day with a given endianity and increments the offset by the number of bytes read. + + The buffer to read the bytes from. + The offset in the buffer to start reading. + The endianity to use to translate the bytes to the value. + The value converted from the read bytes according to the endianity. + + + + Writes the given value to the buffer. + + The buffer to write the value to. + The offset in the buffer to start writing. + The value to write. + + + + Writes the given value to the buffer and increments the offset by the number of bytes written. + + The buffer to write the value to. + The offset in the buffer to start writing. + The value to write. + + + + Writes the given value to the buffer and increments the offset by the number of bytes written. + + The buffer to write the value to. + The offset in the buffer to start writing. + The value to write. + + + + Writes the given value to the buffer using the given endianity. + + The buffer to write the value to. + The offset in the buffer to start writing. + The value to write. + The endianity to use when converting the value to bytes. + + + + Writes the given value to the buffer using the given endianity. + + The buffer to write the value to. + The offset in the buffer to start writing. + The value to write. + The endianity to use when converting the value to bytes. + + + + Writes the given value to the buffer using the given endianity and increments the offset by the number of bytes written. + + The buffer to write the value to. + The offset in the buffer to start writing. + The value to write. + The endianity to use when converting the value to bytes. + + + + Writes the given value to the buffer using the given endianity. + + The buffer to write the value to. + The offset in the buffer to start writing. + The value to write. + The endianity to use when converting the value to bytes. + + + + Writes the given value to the buffer using the given endianity and increments the offset by the number of bytes written. + + The buffer to write the value to. + The offset in the buffer to start writing. + The value to write. + The endianity to use when converting the value to bytes. + + + + Writes the given value to the buffer using the given endianity. + + The buffer to write the value to. + The offset in the buffer to start writing. + The value to write. + The endianity to use when converting the value to bytes. + + + + Writes the given value to the buffer using the given endianity and increments the offset by the number of bytes written. + + The buffer to write the value to. + The offset in the buffer to start writing. + The value to write. + The endianity to use when converting the value to bytes. + + + + Writes the given value to the buffer using the given endianity. + + The buffer to write the value to. + The offset in the buffer to start writing. + The value to write. + The endianity to use when converting the value to bytes. + + + + Writes the given value to the buffer using the given endianity and increments the offset by the number of bytes written. + + The buffer to write the value to. + The offset in the buffer to start writing. + The value to write. + The endianity to use when converting the value to bytes. + + + + Writes the given value to the buffer using the given endianity. + + The buffer to write the value to. + The offset in the buffer to start writing. + The value to write. + The endianity to use when converting the value to bytes. + + + + Writes the given value to the buffer using the given endianity and increments the offset by the number of bytes written. + + The buffer to write the value to. + The offset in the buffer to start writing. + The value to write. + The endianity to use when converting the value to bytes. + + + + Writes a string to a byte array in a specific offset using the given encoding. + Increments the offset by the number of bytes written. + + The buffer to write the string in. + The offset in the buffer to start writing the string in. Incremented by the number of bytes written. + The string to write in the buffer. + The encoding to use to translate the string into a sequence of bytes. + + + + Writes the given value to the buffer. + + The buffer to write the value to. + The offset in the buffer to start writing. + The value to write. + + + + Writes the given value to the buffer and increments the offset by the number of bytes written. + + The buffer to write the value to. + The offset in the buffer to start writing. + The value to write. + + + + Writes the given value to the buffer using the given endianity. + + The buffer to write the value to. + The offset in the buffer to start writing. + The value to write. + The endianity to use when converting the value to bytes. + + + + Writes the given value to the buffer using the given endianity and increments the offset by the number of bytes written. + + The buffer to write the value to. + The offset in the buffer to start writing. + The value to write. + The endianity to use when converting the value to bytes. + + + + Writes the given value to the buffer using the given endianity. + + The buffer to write the value to. + The offset in the buffer to start writing. + The value to write. + The endianity to use when converting the value to bytes. + + + + Writes the given value to the buffer using the given endianity and increments the offset by the number of bytes written. + + The buffer to write the value to. + The offset in the buffer to start writing. + The value to write. + The endianity to use when converting the value to bytes. + + + + Writes the given value to the buffer using the given endianity. + + The buffer to write the value to. + The offset in the buffer to start writing. + The value to write. + The endianity to use when converting the value to bytes. + + + + Writes the given value to the buffer using the given endianity and increments the offset by the number of bytes written. + + The buffer to write the value to. + The offset in the buffer to start writing. + The value to write. + The endianity to use when converting the value to bytes. + + + + Writes the endline bytes (CRLF) in the buffer in the given offset. + Increments the offset by the number of bytes written (2). + + The buffer to write the CRLF in. + The offset to start writing the CRLF in. Incremented by the number of bytes written (2). + + + + Writes an integer as a decimal string in ASCII encoding to a buffer of bytes in a specific offset. + The offset is incremented by the number of bytes (digits) written. + + The buffer to write the integer in. + The offset in the buffer to start writing the integer. Incremented by the number of bytes (digits) written. + The integer value to write in the buffer. + + + + A simple IPv4 option - holds only the type. + + + + + The number of bytes this option will take. + + + + + The number of bytes this option will take. + + + + + True iff this option may appear at most once in a datagram. + + + + + RFC 2236. + + + + + RFC 2236. + Represents a generic IGMP version 2 datagram. + + + + + + The actual time allowed, called the Max Resp Time. + + + + + The actual time allowed, called the Max Resp Time. + + + + + The type of the IGMP message of concern to the host-router interaction. + + + + + The code of the IGMP message for Create Group Request (RFC988). + + + + + Request Granted. + + + + + Request Denied - No Resources. + + + + + Request Denied - Invalid Code. + + + + + Request Denied - Invalid Group Address. + + + + + Request Denied - Invalid Access Key. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + Request Pending - Retry in this value many seconds. + + + + + The code of the IGMP message for Create Group Request (RFC988). + + + + + Public. + + + + + Private. + + + + + The different ICMP message types and codes. + Each of the values is a combination of the message type and a code values that is legal with this message type. + + + + + RFC 792. + If, according to the information in the gateway's routing tables, + the network specified in the internet destination field of a datagram is unreachable, + e.g., the distance to the network is infinity, + the gateway may send a destination unreachable message to the internet source host of the datagram. + + + + + RFC 792. + In some networks, the gateway may be able to determine if the internet destination host is unreachable. + Gateways in these networks may send destination unreachable messages to the source host when the destination host is unreachable. + + + + + RFC 792. + If, in the destination host, the IP module cannot deliver the datagram because the indicated protocol module is not active, + the destination host may send a destination unreachable message to the source host. + + + + + RFC 792. + If, in the destination host, the IP module cannot deliver the datagram because the indicated process port is not active, + the destination host may send a destination unreachable message to the source host. + + + + + RFC 792. + A datagram must be fragmented to be forwarded by a gateway yet the Don't Fragment flag is on. + In this case the gateway must discard the datagram and may return a destination unreachable message. + + + + + RFC 792. + + + + + RFC 792. + If the gateway processing a datagram finds the time to live field is zero it must discard the datagram. + The gateway may also notify the source host via the time exceeded message. + + + + + RFC 792. + If a host reassembling a fragmented datagram cannot complete the reassembly due to missing fragments within its time limit it discards the datagram, + and it may send a time exceeded message. + If fragment zero is not available then no time exceeded need be sent at all. + + + + + RFC 792. + If the gateway or host processing a datagram finds a problem with the header parameters such that it cannot complete processing the datagram it must discard the datagram. + One potential source of such a problem is with incorrect arguments in an option. + The gateway or host may also notify the source host via the parameter problem message. + This message is only sent if the error caused the datagram to be discarded. + + + + + RFC 792. + + + A gateway may discard internet datagrams if it does not have the buffer space needed to queue the datagrams for output to the next network on the route to the destination network. + If a gateway discards a datagram, it may send a source quench message to the internet source host of the datagram. + A destination host may also send a source quench message if datagrams arrive too fast to be processed. + The source quench message is a request to the host to cut back the rate at which it is sending traffic to the internet destination. + The gateway may send a source quench message for every message that it discards. + On receipt of a source quench message, the source host should cut back the rate at which it is sending traffic to the specified destination + until it no longer receives source quench messages from the gateway. + The source host can then gradually increase the rate at which it sends traffic to the destination until it again receives source quench messages. + + + + The gateway or host may send the source quench message when it approaches its capacity limit rather than waiting until the capacity is exceeded. + This means that the data datagram which triggered the source quench message may be delivered. + + + + + + RFC 792. + + + + + RFC 792. + + + + + RFC 792. + + + + + RFC 792. + + + + + RFC 792. + + The data received in the echo message must be returned in the echo reply message. + + + + The identifier and sequence number may be used by the echo sender to aid in matching the replies with the echo requests. + For example, the identifier might be used like a port in TCP or UDP to identify a session, and the sequence number might be incremented on each echo request sent. + The echoer returns these same values in the echo reply. + + + + Code 0 may be received from a gateway or a host. + + + + + + RFC 792. + + The data received in the echo message must be returned in the echo reply message. + + + + The identifier and sequence number may be used by the echo sender to aid in matching the replies with the echo requests. + For example, the identifier might be used like a port in TCP or UDP to identify a session, and the sequence number might be incremented on each echo request sent. + The echoer returns these same values in the echo reply. + + + + Code 0 may be received from a gateway or a host. + + + + + + RFC 792 + + The data received (a timestamp) in the message is returned in the reply together with an additional timestamp. + The timestamp is 32 bits of milliseconds since midnight UT. + + + + If the time is not available in miliseconds or cannot be provided with respect to midnight UT + then any time can be inserted in a timestamp provided the high order bit of the timestamp is also set to indicate this non-standard value. + + + + The identifier and sequence number may be used by the echo sender to aid in matching the replies with the requests. + For example, the identifier might be used like a port in TCP or UDP to identify a session, and the sequence number might be incremented on each request sent. + The destination returns these same values in the reply. + + + + Code 0 may be received from a gateway or a host. + + + + + + RFC 792 + + The data received (a timestamp) in the message is returned in the reply together with an additional timestamp. + The timestamp is 32 bits of milliseconds since midnight UT. + + + + If the time is not available in miliseconds or cannot be provided with respect to midnight UT + then any time can be inserted in a timestamp provided the high order bit of the timestamp is also set to indicate this non-standard value. + + + + The identifier and sequence number may be used by the echo sender to aid in matching the replies with the requests. + For example, the identifier might be used like a port in TCP or UDP to identify a session, and the sequence number might be incremented on each request sent. + The destination returns these same values in the reply. + + + + Code 0 may be received from a gateway or a host. + + + + + + RFC 792. + + This message may be sent with the source network in the IP header source and destination address fields zero (which means "this" network). + The replying IP module should send the reply with the addresses fully specified. + This message is a way for a host to find out the number of the network it is on. + + + + The identifier and sequence number may be used by the echo sender to aid in matching the replies with the requests. + For example, the identifier might be used like a port in TCP or UDP to identify a session, and the sequence number might be incremented on each request sent. + The destination returns these same values in the reply. + + + + Code 0 may be received from a gateway or a host. + + + + + + RFC 792. + + This message may be sent with the source network in the IP header source and destination address fields zero (which means "this" network). + The replying IP module should send the reply with the addresses fully specified. + This message is a way for a host to find out the number of the network it is on. + + + + The identifier and sequence number may be used by the echo sender to aid in matching the replies with the requests. + For example, the identifier might be used like a port in TCP or UDP to identify a session, and the sequence number might be incremented on each request sent. + The destination returns these same values in the reply. + + + + Code 0 may be received from a gateway or a host. + + + + + + RFC 1256. + + + + + RFC 1256. + + + + + RFC 950. + + + A gateway receiving an address mask request should return it with the address mask field set to the 32-bit mask of the bits identifying the subnet and network, + for the subnet on which the request was received. + + + + If the requesting host does not know its own IP address, it may leave the source field zero; the reply should then be broadcast. + However, this approach should be avoided if at all possible, since it increases the superfluous broadcast load on the network. + Even when the replies are broadcast, since there is only one possible address mask for a subnet, there is no need to match requests with replies. + The "Identifier" and "Sequence Number" fields can be ignored. + + + + + + RFC 950. + + + A gateway receiving an address mask request should return it with the address mask field set to the 32-bit mask of the bits identifying the subnet and network, + for the subnet on which the request was received. + + + + If the requesting host does not know its own IP address, it may leave the source field zero; the reply should then be broadcast. + However, this approach should be avoided if at all possible, since it increases the superfluous broadcast load on the network. + Even when the replies are broadcast, since there is only one possible address mask for a subnet, there is no need to match requests with replies. + The "Identifier" and "Sequence Number" fields can be ignored. + + + + + + RFC 1393. + + + + + RFC 1393. + + + + + RFC 1475. + The introduction of network layer conversion requires a new message type, to report conversion errors. + Note that an invalid datagram should result in the sending of some other ICMP message (e.g., parameter problem) or the silent discarding of the datagram. + This message is only sent when a valid datagram cannot be converted. + + + + + RFC 1475. + The introduction of network layer conversion requires a new message type, to report conversion errors. + Note that an invalid datagram should result in the sending of some other ICMP message (e.g., parameter problem) or the silent discarding of the datagram. + This message is only sent when a valid datagram cannot be converted. + + + + + RFC 1475. + The introduction of network layer conversion requires a new message type, to report conversion errors. + Note that an invalid datagram should result in the sending of some other ICMP message (e.g., parameter problem) or the silent discarding of the datagram. + This message is only sent when a valid datagram cannot be converted. + + + + + RFC 1475. + The introduction of network layer conversion requires a new message type, to report conversion errors. + Note that an invalid datagram should result in the sending of some other ICMP message (e.g., parameter problem) or the silent discarding of the datagram. + This message is only sent when a valid datagram cannot be converted. + + + + + RFC 1475. + The introduction of network layer conversion requires a new message type, to report conversion errors. + Note that an invalid datagram should result in the sending of some other ICMP message (e.g., parameter problem) or the silent discarding of the datagram. + This message is only sent when a valid datagram cannot be converted. + + + + + RFC 1475. + The introduction of network layer conversion requires a new message type, to report conversion errors. + Note that an invalid datagram should result in the sending of some other ICMP message (e.g., parameter problem) or the silent discarding of the datagram. + This message is only sent when a valid datagram cannot be converted. + + + + + RFC 1475. + The introduction of network layer conversion requires a new message type, to report conversion errors. + Note that an invalid datagram should result in the sending of some other ICMP message (e.g., parameter problem) or the silent discarding of the datagram. + This message is only sent when a valid datagram cannot be converted. + + + + + RFC 1475. + The introduction of network layer conversion requires a new message type, to report conversion errors. + Note that an invalid datagram should result in the sending of some other ICMP message (e.g., parameter problem) or the silent discarding of the datagram. + This message is only sent when a valid datagram cannot be converted. + + + + + RFC 1475. + The introduction of network layer conversion requires a new message type, to report conversion errors. + Note that an invalid datagram should result in the sending of some other ICMP message (e.g., parameter problem) or the silent discarding of the datagram. + This message is only sent when a valid datagram cannot be converted. + + + + + RFC 1475. + The introduction of network layer conversion requires a new message type, to report conversion errors. + Note that an invalid datagram should result in the sending of some other ICMP message (e.g., parameter problem) or the silent discarding of the datagram. + This message is only sent when a valid datagram cannot be converted. + + + + + RFC 1475. + The introduction of network layer conversion requires a new message type, to report conversion errors. + Note that an invalid datagram should result in the sending of some other ICMP message (e.g., parameter problem) or the silent discarding of the datagram. + This message is only sent when a valid datagram cannot be converted. + + + + + RFC 1475. + The introduction of network layer conversion requires a new message type, to report conversion errors. + Note that an invalid datagram should result in the sending of some other ICMP message (e.g., parameter problem) or the silent discarding of the datagram. + This message is only sent when a valid datagram cannot be converted. + + + + + RFC 1788. + + + + + RFC 1788. + Parsing of this datagram isn't supported because its parsing is not clear from the RFC. + + + + + RFC 2521. + Indicates that a received datagram includes a Security Parameters Index (SPI) that is invalid or has expired. + + + + + RFC 2521. + Indicates that a received datagram failed the authenticity or integrity check for a given SPI. + + + Note that the SPI may indicate an outer Encapsulating Security Protocol when a separate Authentication Header SPI is hidden inside. + + + + + + RFC 2521. + Indicates that a received datagram failed a decompression check for a given SPI. + + + + + RFC 2521. + Indicates that a received datagram failed a decryption check for a given SPI. + + + + + RFC 2521. + Indicates that a received datagram will not be accepted without additional authentication. + + + In this case, either no SPI is present, or an unsuitable SPI is present. + For example, an encryption SPI without integrity arrives from a secure operating system with mutually suspicious users. + + + + + + RFC 2521. + Indicates that a received datagram will not be accepted because it has insufficient authorization. + + + In this case, an authentication SPI is present that is inappropriate for the target transport or application. + The principle party denoted by the SPI does not have proper authorization for the facilities used by the datagram. + For example, the party is authorized for Telnet access, but not for FTP access. + + + + + + RFC 1393. + Represents an ICMP Trace Route message layer. + + + + + + Writes the ICMP payload to the buffer. + Doesn't include payload in the next layers. + + The buffer to write the ICMP payload to. + The offset in the buffer to start writing the payload at. + + + + True iff the OutboundHopCount, ReturnHopCount, OutputLinkSpeed and OutputLinkMaximumTransmissionUnit fields are equal to the other layer fields. + + + + + True iff the OutboundHopCount, ReturnHopCount, OutputLinkSpeed and OutputLinkMaximumTransmissionUnit fields are equal to the other layer fields. + + + + + A sub-type of the message. Specific method of this message type. + + + + + The ID Number as copied from the IP Traceroute option of the packet which caused this Traceroute message to be sent. + This is NOT related to the ID number in the IP header. + + + + + The Outbound Hop Count as copied from the IP Traceroute option of the packet which caused this Traceroute message to be sent. + + + + + The Return Hop Count as copied from the IP Traceroute option of the packet which caused this Traceroute message to be sent. + + + + + The speed, in OCTETS per second, of the link over which the Outbound/Return Packet will be sent. + Since it will not be long before network speeds exceed 4.3Gb/s, and since some machines deal poorly with fields longer than 32 bits, octets per second was chosen over bits per second. + If this value cannot be determined, the field should be set to zero. + + + + + The MTU, in bytes, of the link over which the Outbound/Return Packet will be sent. + MTU refers to the data portion (includes IP header; excludes datalink header/trailer) of the packet. + If this value cannot be determined, the field should be set to zero. + + + + + The value of this field determines the format of the remaining data. + + + + + The number of bytes the ICMP payload takes. + + + + + A sub-type of the message. Specific method of this message type. + + + + + A value that should be interpreted according to the specific message. + + + + + RFC 792. +
+            +-----+------+------+-----------------+
+            | Bit | 0-7  | 8-15 | 16-31           |
+            +-----+------+------+-----------------+
+            | 0   | Type | Code | Checksum        |
+            +-----+------+------+-----------------+
+            | 32  | Identifier  | Sequence Number |
+            +-----+-------------+-----------------+
+            | 64  | Originate Timestamp           |
+            +-----+-------------------------------+
+            | 96  | Receive Timestamp             |
+            +-----+-------------------------------+
+            | 128 | Transmit Timestamp            |
+            +-----+-------------------------------+
+            
+
+
+ + + RFC 792. +
+            +-----+------+------+-----------------+
+            | Bit | 0-7  | 8-15 | 16-31           |
+            +-----+------+------+-----------------+
+            | 0   | Type | Code | Checksum        |
+            +-----+------+------+-----------------+
+            | 32  | Identifier  | Sequence Number |
+            +-----+-------------+-----------------+
+            | 64  | Originate Timestamp           |
+            +-----+-------------------------------+
+            | 96  | Receive Timestamp             |
+            +-----+-------------------------------+
+            | 128 | Transmit Timestamp            |
+            +-----+-------------------------------+
+            
+
+
+ + + The number of bytes this datagram should take. + + + + + The number of bytes this ICMP payload should take. + + + + + Creates a Layer that represents the datagram to be used with PacketBuilder. + + + + + Valid if the datagram's length is OK, the checksum is correct and the code is in the expected range. + + + + + The time the sender last touched the message before sending it. + + + + + The time the echoer first touched it on receipt. + + + + + The time the echoer last touched the message on sending it. + + + + + Creates a Layer that represents the datagram to be used with PacketBuilder. + + + + + RFC 950. + + + + + RFC 950. + Represents an ICMP Trace Route message layer. + + + + + + Writes the ICMP payload to the buffer. + Doesn't include payload in the next layers. + + The buffer to write the ICMP payload to. + The offset in the buffer to start writing the payload at. + + + + True iff the address mask is equal to the other address mask. + + + + + True iff the address mask is equal to the other address mask. + + + + + A 32-bit mask. + + + + + The value of this field determines the format of the remaining data. + + + + + The number of bytes the ICMP payload takes. + + + + + The value of this field determines the format of the remaining data. + + + + + RFC 2616. + Represents an HTTP request. + + + + + RFC 2616 + + Message: +
+             HTTP-message     = Request | Response
+             
+             generic-message  = start-line
+                                *(message-header CRLF)
+                                CRLF
+                                [ message-body ]
+             
+             start-line       = Request-Line | Status-Line
+             
+             message-header   = field-name ":" [ field-value ]
+             field-name       = token
+             field-value      = *( field-content | LWS )
+             field-content    = <the OCTETs making up the field-value and consisting of either *TEXT or combinations of token, separators, and quoted-string>
+             
+             message-body     = entity-body
+                              | <entity-body encoded as per Transfer-Encoding>
+             general-header   = Cache-Control          
+                              | Connection             
+                              | Date                   
+                              | Pragma                 
+                              | Trailer                
+                              | Transfer-Encoding      
+                              | Upgrade                
+                              | Via                    
+                              | Warning                
+             
+ + Request: +
+             Request          = Request-Line             
+                                *(( general-header       
+                                 | request-header        
+                                 | entity-header ) CRLF) 
+                                CRLF
+                                [ message-body ]         
+             
+             Request-Line     = Method SP Request-URI SP HTTP-Version CRLF
+             
+             Method           = "OPTIONS"              
+                              | "GET"                  
+                              | "HEAD"                 
+                              | "POST"                 
+                              | "PUT"                  
+                              | "DELETE"               
+                              | "TRACE"                
+                              | "CONNECT"              
+                              | extension-method
+             
+             extension-method = token
+             
+             Request-URI      = "*" | absoluteURI | abs_path | authority
+             absoluteURI      = scheme ":" ( hier_part | opaque_part )
+             scheme           = alpha *( alpha | digit | "+" | "-" | "." )
+             hier_part        = ( net_path | abs_path ) [ "?" query ]
+             opaque_part      = uric_no_slash *uric
+             net_path         = "//" authority [ abs_path ]
+             abs_path         = "/"  path_segments
+             query            = *uric
+             uric_no_slash    = unreserved | escaped | ";" | "?" | ":" | "@" | "&" | "=" | "+" | "$" | ","
+             uric             = reserved | unreserved | escaped
+             authority        = server | reg_name
+             path_segments    = segment *( "/" segment )
+             unreserved       = alphanum | mark
+             escaped          = "%" hex hex
+             reserved         = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" | "$" | ","
+             server           = [ [ userinfo "@" ] hostport ]
+             reg_name         = 1*( unreserved | escaped | "$" | "," | ";" | ":" | "@" | "&" | "=" | "+" )
+             segment          = *pchar *( ";" param )
+             mark             = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")"
+             userinfo         = *( unreserved | escaped | ";" | ":" | "&" | "=" | "+" | "$" | "," )
+             hostport         = host [ ":" port ]
+             pchar            = unreserved | escaped | ":" | "@" | "&" | "=" | "+" | "$" | ","
+             param            = *pchar
+             host             = hostname | IPv4address
+             port             = *digit
+             hostname         = *( domainlabel "." ) toplabel [ "." ]
+             IPv4address      = 1*digit "." 1*digit "." 1*digit "." 1*digit
+             domainlabel      = alphanum | alphanum *( alphanum | "-" ) alphanum
+             toplabel         = alpha | alpha *( alphanum | "-" ) alphanum
+             
+             request-header   = Accept                  
+                              | Accept-Charset          
+                              | Accept-Encoding         
+                              | Accept-Language         
+                              | Authorization           
+                              | Expect                  
+                              | From                    
+                              | Host                    
+                              | If-Match                
+                              | If-Modified-Since       
+                              | If-None-Match           
+                              | If-Range                
+                              | If-Unmodified-Since     
+                              | Max-Forwards            
+                              | Proxy-Authorization     
+                              | Range                   
+                              | Referer                 
+                              | TE                      
+                              | User-Agent              
+             
+ + Response: +
+             Response         = Status-Line             
+                                *(( general-header      
+                                 | response-header      
+                                 | entity-header ) CRLF)
+                                CRLF
+                                [ message-body ]        
+             
+             Status-Line      = HTTP-Version SP Status-Code SP Reason-Phrase CRLF
+             
+             Status-Code      = "100"  
+                              | "101"  
+                              | "200"  
+                              | "201"  
+                              | "202"  
+                              | "203"  
+                              | "204"  
+                              | "205"  
+                              | "206"  
+                              | "300"  
+                              | "301"  
+                              | "302"  
+                              | "303"  
+                              | "304"  
+                              | "305"  
+                              | "307"  
+                              | "400"  
+                              | "401"  
+                              | "402"  
+                              | "403"  
+                              | "404"  
+                              | "405"  
+                              | "406"  
+                              | "407"  
+                              | "408"  
+                              | "409"  
+                              | "410"  
+                              | "411"  
+                              | "412"  
+                              | "413"  
+                              | "414"  
+                              | "415"  
+                              | "416"  
+                              | "417"  
+                              | "500"  
+                              | "501"  
+                              | "502"  
+                              | "503"  
+                              | "504"  
+                              | "505"  
+                              | extension-code
+             
+             extension-code   = 3DIGIT
+             Reason-Phrase    = *<TEXT, excluding CR, LF>
+             
+             response-header  = Accept-Ranges       
+                              | Age                 
+                              | ETag                
+                              | Location            
+                              | Proxy-Authenticate  
+                              | Retry-After         
+                              | Server              
+                              | Vary                
+                              | WWW-Authenticate    
+            
+             entity-header    = Allow               
+                              | Content-Encoding    
+                              | Content-Language    
+                              | Content-Length      
+                              | Content-Location    
+                              | Content-MD5         
+                              | Content-Range       
+                              | Content-Type        
+                              | Expires             
+                              | Last-Modified       
+                              | extension-header
+            
+             extension-header = message-header
+             
+             entity-body      = *OCTET
+             
+             entity-body     := Content-Encoding( Content-Type( data ) )
+             
+
+
+ + + True iff the message is a request and iff the message is not a response. + + + + + True iff the message is a response and iff the message is not a request. + + + + + The version of this HTTP message. + + + + + The header of the HTTP message. + + + + + Message Body. + + + + + Creates a Layer that represents the datagram to be used with PacketBuilder. + + + + + True since the message is a request. + + + + + The HTTP Request Method. + + + + + The HTTP Request URI. + + + + + Represents HTTP header. + The header is a container for HTTP fields. + Insensitive to the case of HTTP field names. + + + + + Creates a header from an enumerable of fields. + + + + + Creates a header from an array of fields. + + + + + Two HTTP headers are equal if they have the same fields with the same values. + + + + + Two HTTP headers are equal if they have the same fields with the same values. + + + + + Xor of the hash codes of the fields. + + + + + Returns a string of all the fields with endline separators. + + + + + Enumerates over the HTTP fields. + + + + + Writes the HTTP header to the given buffer in the given offset. + + The buffer to write the header to. + The offset in the given buffer to start writing the header. + + + + Writes the HTTP header to the given buffer in the given offset. + Increments the offset by the number of bytes written. + + The buffer to write the header to. + The offset in the given buffer to start writing the header. Incremented by the number of bytes written. + + + + An empty HTTP header. + + + + + The number of bytes the header takes. + + + + + Returns the field with the given field name or null if it doesn't exist. + Case insensitive. + + The case insensitive name of the field. + The field with the matching case insensitive name or null if it doesn't exist. + + + + The HTTP Transfer Encoding field if it exists (null otherwise). + + + + + The HTTP Content Length field if it exists (null otherwise). + + + + + The HTTP Content Type field if it exists (null otherwise). + + + + + A value representing the syntax and semantics of the Routing Information field. + + + + + No address family + + + + + The Routing Information field will consist of a list of IP addresses and indicates an IP source route. + + + + + the Routing Information field will consist of a list of Autonomous System numbers and indicates an AS source route. + + + + + A collection of TCP options. + + + + + The maximum number of bytes the options can take. + + + + + Creates the options collection from the given list of options. + + + + + Creates options from a list of options. + + The list of options. + + + + An empty options collection. + + + + + Represents a timestamp IPv4 option with each timestamp preceded with internet address of the registering entity or the internet address fields are prespecified. + + + + + Internet Timestamp +
+            +--------+--------+--------+--------+
+            |01000100| length | pointer|oflw|flg|
+            +--------+--------+--------+--------+
+            |         internet address          |
+            +--------+--------+--------+--------+
+            |             timestamp             |
+            +--------+--------+--------+--------+
+            |                 .                 |
+                              .
+                              .
+             Type = 68
+            
+ + + The Option Length is the number of octets in the option counting the type, length, pointer, and overflow/flag octets (maximum length 40). + + + + The Pointer is the number of octets from the beginning of this option to the end of timestamps plus one + (i.e., it points to the octet beginning the space for next timestamp). + The smallest legal value is 5. + The timestamp area is full when the pointer is greater than the length. + + + + The Overflow (oflw) [4 bits] is the number of IP modules that cannot register timestamps due to lack of space. + + + + The Flag (flg) [4 bits] values are + + 0 - time stamps only, stored in consecutive 32-bit words. + 1 - each timestamp is preceded with internet address of the registering entity. + 3 - the internet address fields are prespecified. + + An IP module only registers its timestamp if it matches its own address with the next specified internet address. + + + + The Timestamp is a right-justified, 32-bit timestamp in milliseconds since midnight UT. + If the time is not available in milliseconds or cannot be provided with respect to midnight UT + then any time may be inserted as a timestamp provided the high order bit of the timestamp field is set to one + to indicate the use of a non-standard value. + + + + The originating host must compose this option with a large enough timestamp data area to hold all the timestamp information expected. + The size of the option does not change due to adding timestamps. + The intitial contents of the timestamp data area must be zero or internet address/zero pairs. + + + + If the timestamp data area is already full (the pointer exceeds the length) the datagram is forwarded without inserting the timestamp, + but the overflow count is incremented by one. + If there is some room but not enough room for a full timestamp to be inserted, or the overflow count itself overflows, + the original datagram is considered to be in error and is discarded. + In either case an ICMP parameter problem message may be sent to the source host. + + + + The timestamp option is not copied upon fragmentation. + It is carried in the first fragment. + Appears at most once in a datagram. + +
+
+ + + The minimum length in bytes for the option (type, length, pointer, overflow and flags). + + + + + The minimum length in bytes of the option value. + + + + + The maximum value for the overflow field. + + + + + The maximum value for the pointed index field. + + + + + Two options are equal if they have the same value (timestamp, overflow, pointed equals, addresses and timestamps). + + + + + Two options are equal if they have the same value (timestamp, overflow, pointed equals and addresses). + + + + + The hash code is the xor of the base class hash code, the timestamp and overflow hash code and the pointed index hash code. + + + + + Create the option by giving it all the data. + + The timestamp option type. + The number of IP modules that cannot register timestamps due to lack of space. Maximum value is 15. + The index in the timestamp to points to the octet beginning the space for next timestamp. The timestamp area is considered full when the index points beyond the timestamps. + + + + True iff the options values is equal. + + + + + Writes the value of the option to the buffer. + + + + + The timestamp option type. + + + + + The number of IP modules that cannot register timestamps due to lack of space. + + + + + The index in the timestamp that points to the for next timestamp. + The timestamp area is considered full when the index points beyond the timestamps. + + + + + The number of timestamps this option holds (or can hold). + + + + + The number of bytes this option will take. + + + + + True iff this option may appear at most once in a datagram. + + + + + The number of bytes the value of the option take. + + + + + Create the option by giving it all the data. + + The timestamp option type. + The number of IP modules that cannot register timestamps due to lack of space. Maximum value is 15. + The index in the timestamp that points to the for next timestamp. + The pairs of addresses and timestamps where each timestamp time passed since midnight UT. + + + + Create the option by giving it all the data. + + The timestamp option type. + The number of IP modules that cannot register timestamps due to lack of space. Maximum value is 15. + The index in the timestamp that points to the for next timestamp. + The pairs of addresses and timestamps where each timestamp time passed since midnight UT. + + + + The hash of this option is the base class hash xored with the hash of each timestamp. + + + + + True iff the options values is equal. + + + + + Writes the value of the option to the buffer. + + + + + The number of timestamps this option holds (or can hold). + + + + + The pairs of addresses and timestamps where each timestamp time passed since midnight UT. + + + + + The number of bytes the value of the option take. + + + + + Represents IPv4 layer. + + + + + + Creates an IPv4 layer with all zero values. + + + + + Writes the layer to the buffer. + + The buffer to write the layer to. + The offset in the buffer to start writing the layer at. + The length of the layer's payload (the number of bytes after the layer in the packet). + The layer that comes before this layer. null if this is the first layer. + The layer that comes after this layer. null if this is the last layer. + + + + Finalizes the layer data in the buffer. + Used for fields that must be calculated according to the layer's payload (like checksum). + + The buffer to finalize the layer in. + The offset in the buffer the layer starts. + The length of the layer's payload (the number of bytes after the layer in the packet). + The layer that comes after this layer. null if this is the last layer. + + + + True iff the two IPv4 layers have the same TypeOfService, Identification, Fragmentation, Ttl, Protocol, HeaderChecksum, Source, Destination and Options. + + + + + True iff the two IPv4 layers have the same TypeOfService, Identification, Fragmentation, Ttl, Protocol, HeaderChecksum, Source, Destination and Options. + + + + + Returns a hash code for the layer. + The hash code is a XOR of the TypeOfService and Identification combined and the hash codes of the layer length, data link, Fragmentation, Protocol, HeaderChecksum, Source, Destination, Options. + + + + + Contains the Source, Destination and Protocol. + + + + + Type of Service field. + + + + + The value of the IPv4 ID field. + + + + + The fragmentation information field. + + + + + The TTL field. + + + + + The IPv4 (next) protocol field. + null means that this value should be calculated according to the next layer. + + + + + The header checksum value. + null means that this value should be calculated to be correct according to the data. + + + + + The source address. + + + + + The destination address. + + + + + The options field with all the parsed options if any exist. + + + + + The Ethernet Type the Ethernet layer should write when this layer is the Ethernet payload. + + + + + The protocol that should be written in the previous (IPv4) layer (in this case: IP). + + + + + The default MAC Address value when this layer is the Ethernet payload. + null means there is no default value. + + + + + The number of bytes this layer will take. + + + + + RFC 792. +
+            +-----+------+------+-----------------+
+            | Bit | 0-7  | 8-15 | 16-31           |
+            +-----+------+------+-----------------+
+            | 0   | Type | Code | Checksum        |
+            +-----+------+------+-----------------+
+            | 32  | Identifier  | Sequence Number |
+            +-----+-------------+-----------------+
+            
+
+
+ + + Creates a Layer that represents the datagram to be used with PacketBuilder. + + + + + The different ICMP code values for Security Failures ICMP type. + + + + + RFC 2521. + Indicates that a received datagram includes a Security Parameters Index (SPI) that is invalid or has expired. + + + + + RFC 2521. + Indicates that a received datagram failed the authenticity or integrity check for a given SPI. + + + Note that the SPI may indicate an outer Encapsulating Security Protocol when a separate Authentication Header SPI is hidden inside. + + + + + + RFC 2521. + Indicates that a received datagram failed a decompression check for a given SPI. + + + + + RFC 2521. + Indicates that a received datagram failed a decryption check for a given SPI. + + + + + RFC 2521. + Indicates that a received datagram will not be accepted without additional authentication. + + + In this case, either no SPI is present, or an unsuitable SPI is present. + For example, an encryption SPI without integrity arrives from a secure operating system with mutually suspicious users. + + + + + + RFC 2521. + Indicates that a received datagram will not be accepted because it has insufficient authorization. + + + In this case, an authentication SPI is present that is inappropriate for the target transport or application. + The principle party denoted by the SPI does not have proper authorization for the facilities used by the datagram. + For example, the party is authorized for Telnet access, but not for FTP access. + + + + + + Ethernet MacAddress struct. + + + + + The number of bytes the struct takes. + + + + + Constructs the address from a 48 bit integer. + + The 48 bit integer to create the address from. + + + + Create the address from a string in the format XX:XX:XX:XX:XX:XX. + + The string value in hexadecimal format. Every two digits are separated by a colon. + + + + Converts the address to a 48 bit integer. + + A 48 bit integer representing the address. + + + + Two addresses are equal if they have the exact same value. + + + + + Two addresses are equal if they have the exact same value. + + + + + Two addresses are equal if they have the exact same value. + + + + + Two addresses are different if they have different values. + + + + + The hash code of the address is the hash code of its 48 bit integer value. + + + + + Converts the address to a string in the format XX:XX:XX:XX:XX:XX. + + + + + A MAC Address of all zeros (00:00:00:00:00:00). + + + + + TCP POC-service-profile Option (RFC 1693). + +
+                                      1 bit        1 bit    6 bits
+            +----------+----------+------------+----------+--------+
+            |  Kind=10 | Length=3 | Start_flag | End_flag | Filler |
+            +----------+----------+------------+----------+--------+
+            
+ + + Contains two 1-bit flags necessary to handle the case where the service profile does not fit in a single TCP segment. + The "Start_flag" indicates that the information in the data section represents the beginning of the service profile + and the "End_flag" represents the converse. + For service profiles which fit completely in a single segment, both flags will be set to 1. + Otherwise, the Start_flag is set in the initial segment and the End_flag in the final segment + allowing the peer entity to reconstrcut the entire service profile (using the normal sequence numbers in the segment header). + The "Filler" field serves merely to complete the third byte of the option. + +
+
+ + + The number of bytes this option take. + + + + + The number of bytes this option value take. + + + + + Creates the option using the given isStart and isEnd values. + + + + + The default is for service profiles which fit completely in a single segment. + + + + + Two partial order service profile options are equal if they agree on both IsStart and IsEnd. + + + + + Two partial order service profile options are equal if they agree on both IsStart and IsEnd. + + + + + The hash code of the partial order service profile option is the hash code of the option type xored with a combination of the IsStart and IsEnd values. + + + + + Tries to read the option from a buffer starting from the option value (after the type and length). + + The buffer to read the option from. + The offset to the first byte to read the buffer. Will be incremented by the number of bytes read. + The number of bytes the option value should take according to the length field that was already read. + On success - the complex option read. On failure - null. + + + + Indicates that the information in the data section represents the beginning of the service profile. + + + + + Indicates that the information in the data section represents the end of the service profile. + + + + + The number of bytes this option will take. + + + + + True iff this option may appear at most once in a datagram. + + + + +
+            +---------+---------+-------------------+
+            | Kind=19 |Length=18|   MD5 digest...   |
+            +---------+---------+-------------------+
+            |                                       |
+            +---------------------------------------+
+            |                                       |
+            +---------------------------------------+
+            |                                       |
+            +-------------------+-------------------+
+            |                   |
+            +-------------------+
+            
+ + + The MD5 digest is always 16 bytes in length, and the option would appear in every segment of a connection. + +
+
+ + + The number of bytes this option take. + + + + + The number of bytes this option value take. + + + + + Creates the option using the given signature data. + + + + + The default signature is all zeroes. + + + + + Two MD5 signature options are equal if they have the same signature value. + + + + + Two MD5 signature options are equal if they have the same signature value. + + + + + The hash code of the MD5 signature option is the hash code of the option type xored with the hash code of the signature. + + + + + Tries to read the option from a buffer starting from the option value (after the type and length). + + The buffer to read the option from. + The offset to the first byte to read the buffer. Will be incremented by the number of bytes read. + The number of bytes the option value should take according to the length field that was already read. + On success - the complex option read. On failure - null. + + + + The signature value. + + + + + The number of bytes this option will take. + + + + + True iff this option may appear at most once in a datagram. + + + + + The type of the checksum to be used. + + + + + TCP checksum. + + + + + 8-bit Fletcher's algorithm. + + + + + 16-bit Fletcher's algorithm. + + + + + This field identifies the National Access Programs or Special Access Programs + which specify protection rules for transmission and processing of the information contained in the datagram. + Protection authority flags do NOT represent accreditation authorities, though the semantics are superficially similar. + + + + + No protection authorities. + + + + + Designated Approving Authority per DOD 5200.28 + + + + + Single Integrated Operational Plan - Extremely Sensitive Information (SIOP-ESI). + Department of Defense Organization of the Joint Chiefs of Staff + Attn: J6 Washington, DC 20318-6000 + + + + + Sensitive Compartmented Information (SCI). + Director of Central Intelligence + Attn: Chairman, Information Handling Committee, Intelligence Community Staff Washington, D.C. 20505 + + + + + National Security Agency (NSA). + 9800 Savage Road Attn: T03 Ft. Meade, MD 20755-6000 + + + + + Department of Energy (DOE). + Attn: DP343.2 Washington, DC 20545 + + + + + Loose Source and Record Route +
+            +--------+--------+--------+---------//--------+
+            |10000011| length | pointer|     route data    |
+            +--------+--------+--------+---------//--------+
+             Type=131
+            
+ + + The loose source and record route (LSRR) option provides a means for the source of an internet datagram + to supply routing information to be used by the gateways in forwarding the datagram to the destination, + and to record the route information. + + + + The option begins with the option type code. + The second octet is the option length which includes the option type code and the length octet, + the pointer octet, and length-3 octets of route data. + The third octet is the pointer into the route data indicating the octet which begins the next source address to be processed. + The pointer is relative to this option, and the smallest legal value for the pointer is 4. + + + + A route data is composed of a series of internet addresses. + Each internet address is 32 bits or 4 octets. + If the pointer is greater than the length, the source route is empty (and the recorded route full) + and the routing is to be based on the destination address field. + If the address in destination address field has been reached and the pointer is not greater than the length, + the next address in the source route replaces the address in the destination address field, + and the recorded route address replaces the source address just used, and pointer is increased by four. + + + + The recorded route address is the internet module's own internet address + as known in the environment into which this datagram is being forwarded. + + + + This procedure of replacing the source route with the recorded route + (though it is in the reverse of the order it must be in to be used as a source route) means the option (and the IP header as a whole) + remains a constant length as the datagram progresses through the internet. + + + + This option is a loose source route because the gateway or host IP + is allowed to use any route of any number of other intermediate gateways to reach the next address in the route. + + + + Must be copied on fragmentation. + Appears at most once in a datagram. + +
+
+ + + Constructs the option from the given values. + + The route addresses values. + The pointed index in the route. + + + + Empty loose source routing. + + + + + Tries to read the option from a buffer starting from the option value (after the type and length). + + The buffer to read the option from. + The offset to the first byte to read the buffer. Will be incremented by the number of bytes read. + The number of bytes the option value should take according to the length field that was already read. + On success - the complex option read. On failure - null. + + + + RFC 792. +
+            +-----+------+------+------------+
+            | Bit | 0-7  | 8-15 | 16-31      |
+            +-----+------+------+------------+
+            | 0   | Type | Code | Checksum   |
+            +-----+------+------+------------+
+            | 0   | Gateway Internet Address |
+            +-----+--------------------------+
+            | 32  | Internet Header          |
+            |     | + 64 bits of             |
+            |     | Original Data Datagram   |
+            +-----+--------------------------+
+            
+
+
+ + + Creates a Layer that represents the datagram to be used with PacketBuilder. + + + + + Address of the gateway to which traffic for the network specified in the internet destination network field of the original datagram's data should be sent. + + + + + The minimum valid ICMP code for this type of ICMP datagram. + + + + + The maximum valid ICMP code for this type of ICMP datagram. + + + + + RFC 792. + + + + + The value of this field determines the format of the remaining data. + + + + + RFC 792. + + + + + The pointer identifies the octet of the original datagram's header where the error was detected (it may be in the middle of an option). + For example, 1 indicates something is wrong with the Type of Service, and (if there are options present) 20 indicates something is wrong with the type code of the first option. + + + + + The value of this field determines the format of the remaining data. + + + + + A value that should be interpreted according to the specific message. + + + + + The GRE Version Number. + + + + + RFC 1701, RFC 2784 + + + + + RFC 2637 + + + + + RFC 1702. + Represents a source route entry consisting of a list of IP addresses and indicates an IP source route. + + + + + Initializes using the given IP addresses and the next as number index. + + IP addresses of the source route. + The next IP address index in the source route. + + + + True iff the IP addresses are equal. + + + + + Writes the payload to the given buffer in the given offset. + + The buffer to write the payload to. + The offset in the buffer to start writing. + + + + The Address Family field contains a two octet value which indicates the syntax and semantics of the Routing Information field. + + + + + The SRE Length field contains the number of octets in the SRE. + + + + + The SRE Offset field indicates the octet offset from the start of the Routing Information field to the first octet of the active entry in Source Route Entry to be examined. + + + + + The xor of the hash code of the IP addresses. + + + + + IP addresses of the source route. + + + + + The next IP address index in the source route. + + + + + The next IP address. + + + + + RFC 1701, RFC 1702, RFC 2637, RFC 2784. +
+            +-----+---+---+---+---+---+-------+---+-------+---------+-------------------+
+            | Bit | 0 | 1 | 2 | 3 | 4 | 5-7   | 8 | 9-12  | 13-15   | 16-31             |
+            +-----+---+-----------+---+-------+---+-------+---------+-------------------+
+            | 0   | C | R | K | S | s | Recur | A | Flags | Version | Protocol Type     |
+            +-----+---+-----------+---+-------+---+-------+---------+-------------------+
+            | 32  | Checksum (optional)                             | Offset (optional) |
+            +-----+-------------------------------------------------+-------------------+
+            | 32  | Key (optional)                                                      |
+            +-----+---------------------------------------------------------------------+
+            | 32  | Sequence Number (optional)                                          |
+            +-----+---------------------------------------------------------------------+
+            | 32  | Acknowledgment Number (optional)                                    |
+            +-----+---------------------------------------------------------------------+
+            | 32  | Routing (optional)                                                  |
+            +-----+---------------------------------------------------------------------+
+            
+
+
+ + + The minimum number of bytes the GRE header can contain. + + + + + Creates a Layer that represents the datagram to be used with PacketBuilder. + + + + + A GRE Datagram is valid if its length is enough for the GRE header, its routing information is valid, + the bits for future use are set to 0, it has acknowledgment sequence number only if it's Enhanced GRE, + if it has checksum the checksum is correct and its payload is correct. + + true iff the datagram is valid. + + + + The length of the full GRE header on bytes. + + + + + If the Checksum Present bit is set to 1, then the Checksum field is present and contains valid information. + If either the Checksum Present bit or the Routing Present bit are set, BOTH the Checksum and Offset fields are present in the GRE packet. + + + + + If the Routing Present bit is set to 1, then it indicates that the Offset and Routing fields are present and contain valid information. + If either the Checksum Present bit or the Routing Present bit are set, BOTH the Checksum and Offset fields are present in the GRE packet. + + + + + If the Key Present bit is set to 1, then it indicates that the Key field is present in the GRE header. + Otherwise, the Key field is not present in the GRE header. + + + + + If the Sequence Number Present bit is set to 1, then it indicates that the Sequence Number field is present. + Otherwise, the Sequence Number field is not present in the GRE header. + + + + + If the source route is incomplete, then the Strict Source Route bit is checked. + If the source route is a strict source route and the next IP destination or autonomous system is NOT an adjacent system, the packet MUST be dropped. + + + + + Recursion control contains a three bit unsigned integer which contains the number of additional encapsulations which are permissible. + This SHOULD default to zero. + + + + + Set to one (1) if packet contains Acknowledgment Number to be used for acknowledging previously transmitted data. + + + + + Must be set to zero (0). + + + + + The GRE Version Number. + + + + + The Protocol Type field contains the protocol type of the payload packet. + These Protocol Types are defined in [RFC1700] as "ETHER TYPES" and in [ETYPES]. + An implementation receiving a packet containing a Protocol Type which is not listed in [RFC1700] or [ETYPES] SHOULD discard the packet. + + + + + The Checksum field contains the IP (one's complement) checksum sum of the all the 16 bit words in the GRE header and the payload packet. + For purposes of computing the checksum, the value of the checksum field is zero. + This field is present only if the Checksum Present bit is set to one. + + + + + True iff the checksum value is correct according to the datagram data. + Valid only if the Checksum Present bit is set to one. + + + + + The offset field indicates the octet offset from the start of the Routing field to the first octet of the active Source Route Entry to be examined. + This field is present if the Routing Present or the Checksum Present bit is set to 1, and contains valid information only if the Routing Present bit is set to 1. + + + + + The index in the Routing collection of the active source route entry. + + + + + The active Source Route Entry to be examined. + Contains valid information only if the Routing Present bit is set to 1. + if the offset points to the end of the routing information, returns null. + + + + + The Key field contains a four octet number which was inserted by the encapsulator. + It may be used by the receiver to authenticate the source of the packet. + The Key field is only present if the Key Present field is set to 1. + + + + + (High 2 octets of Key) Size of the payload, not including the GRE header + + + + + (Low 2 octets of Key) Contains the Peer's Call ID for the session to which this packet belongs. + + + + + The Sequence Number field contains an unsigned 32 bit integer which is inserted by the encapsulator. + It may be used by the receiver to establish the order in which packets have been transmitted from the encapsulator to the receiver. + + + + + Contains the sequence number of the highest numbered GRE packet received by the sending peer for this user session. + Present if A bit (Bit 8) is one (1). + + + + + The Routing field is optional and is present only if the Routing Present bit is set to 1. + The Routing field is a list of Source Route Entries (SREs). + Each SRE has the form: +
+            +-----+----------------+------------+------------+
+            | Bit | 0-15           | 16-23      | 24-31      |
+            +-----+----------------+------------+------------+
+            | 0   | Address Family | SRE Offset | SRE Length |
+            +-----+----------------+------------+------------+
+            | 32  | Routing Information ...                  |
+            +-----+------------------------------------------+
+            
+ The routing field is terminated with a "NULL" SRE containing an address family of type 0x0000 and a length of 0. +
+
+ + + The Ethernet payload. + + + + + The Ethernet payload as an IPv4 datagram. + + + + + The Ethernet payload as an ARP datagram. + + + + + EtherType is a two-octet field in an Ethernet frame, as defined by the Ethernet II framing networking standard. + It is used to indicate which protocol is encapsulated in the payload. + + + + + No Ethernet type + + + + + Internet Protocol, Version 4 (IPv4) + + + + + Address Resolution Protocol (ARP) + + + + + Reverse Address Resolution Protocol (RARP) + + + + + AppleTalk (Ethertalk) + + + + + AppleTalk Address Resolution Protocol (AARP) + + + + + VLAN-tagged frame (IEEE 802.1Q) + + + + + Novell IPX (alt) + + + + + Novell + + + + + Internet Protocol, Version 6 (IPv6) + + + + + MAC Control + + + + + PPP, Point-to-Point Protocol + + + + + CobraNet + + + + + MPLS unicast + + + + + MPLS multicast + + + + + PPPoE Discovery Stage + + + + + PPPoE Session Stage + + + + + EAP over LAN (IEEE 802.1X) + + + + + HyperSCSI (SCSI over Ethernet) + + + + + ATA over Ethernet + + + + + EtherCAT Protocol + + + + + Provider Bridging (IEEE 802.1ad) + + + + + AVB Transport Protocol (AVBTP) + + + + + SERCOS III + + + + + Circuit Emulation Services over Ethernet (MEF-8) + + + + + HomePlug + + + + + MAC security (IEEE 802.1AE) + + + + + Precision Time Protocol (IEEE 1588) + + + + + IEEE 802.1ag Connectivity Fault Management (CFM) Protocol / ITU-T Recommendation Y.1731 (OAM) + + + + + Fibre Channel over Ethernet + + + + + FCoE Initialization Protocol + + + + + Q-in-Q + + + + + Veritas Low Latency Transport (LLT) + + + + + The Ethernet payload as an IPv4 datagram. + + + + + The Ethernet payload as an ARP datagram. + + + + + The Ethernet payload. + + + + + Represents an Ethernet datagram. + +
+            +------+-----------------+------------+------------------+
+            | Byte | 0-5             | 6-11       | 12-13            |
+            +------+-----------------+------------+------------------+
+            | 0    | MAC Destination | MAC Source | EtherType/Length |
+            +------+-----------------+------------+------------------+
+            | 14   | Data                                            |
+            +------+-------------------------------------------------+
+            
+
+
+ + + Ethernet header length in bytes. + + + + + Creates a Layer that represents the datagram to be used with PacketBuilder. + + + + + An Ethernet datagram is valid iff its length is big enough for the header and its payload is valid. + + + + + The broadcast MAC address (FF:FF:FF:FF:FF:FF). + + + + + The Ethernet payload length in bytes. + + + + + Ethernet source address. + + + + + Ethernet destination address. + + + + + Ethernet type (next protocol). + + + + + The Ethernet payload. + + + + + The bytes padding the Ethernet packet beyond the actual Ethernet payload. + This assumes we know how to calculate the actual payload length (For example, by using the Total Length of the IPv4 payload). + If we don't know how to calculate the actual payload length will be returned. + The trailer doesn't include the if it exists. + + + + + The 4 bytes of the France Check Sequence (FCS). + Usually, these bytes won't be available because the device remvoed them after checking their validity. + We assume they exist when we see that the Ethernet padding pads to 68 bytes or more. + If the padding isn't that long or we don't know how to calculate the real payload length, will be returned. + + + + + The Ethernet payload as an IPv4 datagram. + + + + + The Ethernet payload as an ARP datagram. + + + + + This class is used to build different packets. + Packets are built from layers. + This class can be used using static Build methods by giving the Packet's timestamp and layers. + This class can be instantiated with different layers and then use the Build method by only giving the Packet's timestamp. + If a layer that an instance of this class holds is modified, the PacketBuilder instance will create different packets. + This sample shows how to create ICMP Echo Request packets to different servers with different IP ID and ICMP sequence numbers and identifiers. + + EthernetLayer ethernetLayer = new EthernetLayer + { + Source = new MacAddress("00:01:02:03:04:05"), + Destination = new MacAddress("A0:A1:A2:A3:A4:A5") + }; + + IpV4Layer ipV4Layer = new IpV4Layer + { + Source = new IpV4Address("1.2.3.4"), + Ttl = 128, + }; + + IcmpEchoLayer icmpLayer = new IcmpEchoLayer(); + + PacketBuilder builder = new PacketBuilder(ethernetLayer, ipV4Layer, icmpLayer); + + List<Packet> packets = new List<Packet>(); + + for (int i = 0; i != 100; ++i) + { + ipV4Layer.Destination = new IpV4Address("2.3.4." + i); + ipV4Layer.Identification = (ushort)i; + icmpLayer.SequenceNumber = (ushort)i; + icmpLayer.Identifier = (ushort)i; + + packets.Add(builder.Build(DateTime.Now)); + } + + + + + + + Builds a single packet using the given layers with the given timestamp. + + The packet's timestamp. + The layers to build the packet accordingly and by their order. + A packet built from the given layers with the given timestamp. + + + + Builds a single packet using the given layers with the given timestamp. + + The packet's timestamp. + The layers to build the packet accordingly and by their order. + A packet built from the given layers with the given timestamp. + + + + Creates a PacketBuilder that can build packets according to the given layers and with different timestamps. + The layers' properties can be modified after the builder is built and this will affect the packets built. + + The layers to build the packet accordingly and by their order. + + + + Creates a PacketBuilder that can build packets according to the given layers and with different timestamps. + The layers' properties can be modified after the builder is built and this will affect the packets built. + + The layers to build the packet accordingly and by their order. + + + + Builds a single packet using the builder's layers with the given timestamp. + + The packet's timestamp. + A packet built from the builder's layers with the given timestamp. + + + + The presence of this option in an ICMP Echo (or any other) packet, hereinafter referred to as the Outbound Packet, + will cause a router to send the newly defined ICMP Traceroute message to the originator of the Outbound Packet. + In this way, the path of the Outbound Packet will be logged by the originator with only n+1 (instead of 2n) packets. + This algorithm does not suffer from a changing path and allows the response to the Outbound Packet, + hereinafter refered to as the Return Packet, to be traced + (provided the Outbound Packet's destination preserves the IP Traceroute option in the Return Packet). + + + IP Traceroute option format +
+             0               8              16              24
+            +-+---+---------+---------------+-------------------------------+
+            |F| C |  Number |    Length     |          ID Number            |
+            +-+---+-------------------------+-------------------------------+
+            |      Outbound Hop Count       |       Return Hop Count        |
+            +-------------------------------+-------------------------------+
+            |                     Originator IP Address                     |
+            +---------------------------------------------------------------+
+            
+
+ + + F (copy to fragments): 0 (do not copy to fragments) + C (class): 2 (Debugging and Measurement) + Number: 18 (F+C+Number = 82) + +
+
+ + + The number of bytes this option take. + + + + + The number of bytes this option's value take. + + + + + Create the trace route option from the trace route option values. + + + An arbitrary number used by the originator of the Outbound Packet to identify the ICMP Traceroute messages. + It is NOT related to the ID number in the IP header. + + + Outbound Hop Count (OHC) + The number of routers through which the Outbound Packet has passed. + This field is not incremented by the Outbound Packet's destination. + + + Return Hop Count (RHC) + The number of routers through which the Return Packet has passed. + This field is not incremented by the Return Packet's destination. + + The IP address of the originator of the Outbound Packet. + This isneeded so the routers know where to send the ICMP Traceroute message for Return Packets. + It is also needed for Outbound Packets which have a Source Route option. + + + + + Creates empty trace route option. + + + + + Two trace route options are equal iff they have the exact same field values. + + + + + Two trace route options are equal iff they have the exact same field values. + + + + + The hash code is the xor of the base class hash code with the following values hash code: + The identification, the combination of the outbound and return hop count, the originator address. + + + + + Tries to read the option from a buffer starting from the option value (after the type and length). + + The buffer to read the option from. + The offset to the first byte to read the buffer. Will be incremented by the number of bytes read. + The number of bytes the option value should take according to the length field that was already read. + On success - the complex option read. On failure - null. + + + + An arbitrary number used by the originator of the Outbound Packet to identify the ICMP Traceroute messages. + It is NOT related to the ID number in the IP header. + + + + + The IP address of the originator of the Outbound Packet. + This isneeded so the routers know where to send the ICMP Traceroute message for Return Packets. + It is also needed for Outbound Packets which have a Source Route option. + + + + + Outbound Hop Count (OHC) + The number of routers through which the Outbound Packet has passed. + This field is not incremented by the Outbound Packet's destination. + + + + + Return Hop Count (RHC) + The number of routers through which the Return Packet has passed. + This field is not incremented by the Return Packet's destination. + /// + + + + The number of bytes this option will take. + + + + + True iff this option may appear at most once in a datagram. + + + + + RFC 1112. + + + + + The type of the IGMP message of concern to the host-router interaction. + + + + + RFC 2236. + + + + + The type of the IGMP message of concern to the host-router interaction. + + + + + RFC 792. + + + + + If, according to the information in the gateway's routing tables, + the network specified in the internet destination field of a datagram is unreachable, + e.g., the distance to the network is infinity, + the gateway may send a destination unreachable message to the internet source host of the datagram. + + + + + RFC 792. + In some networks, the gateway may be able to determine if the internet destination host is unreachable. + Gateways in these networks may send destination unreachable messages to the source host when the destination host is unreachable. + + + + + RFC 792. + If, in the destination host, the IP module cannot deliver the datagram because the indicated protocol module is not active, + the destination host may send a destination unreachable message to the source host. + + + + + RFC 792. + If, in the destination host, the IP module cannot deliver the datagram because the indicated process port is not active, + the destination host may send a destination unreachable message to the source host. + + + + + RFC 792. + A datagram must be fragmented to be forwarded by a gateway yet the Don't Fragment flag is on. + In this case the gateway must discard the datagram and may return a destination unreachable message. + + + + + RFC 792. + + + + + The ICMP code values for Traceroute ICMP type. + + + + + RFC 1393. + + + + + RFC 1393. + + + + + Represents a set of HTTP field parameters. + Used for some of HTTP fields. + All parameters must have different names. + + + + + Creates the parameters from an array of parameters. Keys are the parameters names and values are the parameters values. + + + + + Creates the parameters from an enumerable of parameters. Keys are the parameters names and values are the parameters values. + + + + + Enumerates over the parameters. + + + + + Two HTTP field parameters are equal if all of their parameters are equal. + + + + + Two HTTP field parameters are equal if all of their parameters are equal. + + + + + Xor of all of the hash codes of the parameters names and values. + + + + + + Returns a string of parameters beginning and separated by semicolon and equal sign between keys and values. + + + + + Number of parameters. + + + + + Returns the value of the given parameter name. + + The name of the parameter. + The value of the parameter. + + + + A layer that contains an ARP layer. + Must provide the ARP hardware type. + + + + + The ARP Hardware Type of the layer before the ARP layer. + + + + + TCP Alternate Checksum Request Option (RFC 1146). +
+            +----------+----------+----------+
+            |  Kind=14 | Length=3 |  chksum  |
+            +----------+----------+----------+
+            
+ + + Here chksum is a number identifying the type of checksum to be used. + + + + The currently defined values of chksum are: + + 0 - TCP checksum. + 1 - 8-bit Fletcher's algorithm. + 2 - 16-bit Fletcher's algorithm. + + + + + Note that the 8-bit Fletcher algorithm gives a 16-bit checksum and the 16-bit algorithm gives a 32-bit checksum. + +
+
+ + + The number of bytes this option take. + + + + + The number of bytes this option value take. + + + + + Creates the option using the given checksum type. + + + + + The default checksum type is the TCP checksum. + + + + + Two alternate checksum request options are equal if they have the same checksum type. + + + + + Two alternate checksum request options are equal if they have the same checksum type. + + + + + The hash code of this option is the hash code of the option type xored with hash code of the checksum type. + + + + + Tries to read the option from a buffer starting from the option value (after the type and length). + + The buffer to read the option from. + The offset to the first byte to read the buffer. Will be incremented by the number of bytes read. + The number of bytes the option value should take according to the length field that was already read. + On success - the complex option read. On failure - null. + + + + The type of the checksum. + + + + + The number of bytes this option will take. + + + + + True iff this option may appear at most once in a datagram. + + + + + The type of the timestamp ip option. + + + + + Time stamps only, stored in consecutive 32-bit words. + + + + + Each timestamp is preceded with internet address of the registering entity. + + + + + The internet address fields are prespecified. + An IP module only registers its timestamp if it matches its own address with the next specified internet address. + + + + + Represents a timestamp IPv4 option with only the timestamps. + + + + + Create the option by giving it all the data. + + The number of IP modules that cannot register timestamps due to lack of space. Maximum value is 15. + The index in the timestamp that points to the for next timestamp. + The timestamps as time passed since midnight UT. + + + + Create the option by giving it all the data. + + The number of IP modules that cannot register timestamps due to lack of space. Maximum value is 15. + The index in the timestamp that points to the for next timestamp. + The timestamps as time passed since midnight UT. + + + + The hash code of this options is the hash code of the base class xored with the hash code of the timestamps. + + + + + Compares the values of the options. + + + + + Writes the value of the option to the buffer. + + + + + The number of timestamps this option holds (or can hold). + + + + + The timestamps as time passed since midnight UT. + + + + + The number of bytes the value of the option take. + + + + + Represents an ICMP layer with an unknown message type. + + + + + + Writes the ICMP payload to the buffer. + Doesn't include payload in the next layers. + + The buffer to write the ICMP payload to. + The offset in the buffer to start writing the payload at. + + + + The value of this field determines the format of the remaining data. + + + + + A sub-type of the message. Specific method of this message type. + + + + + A value that should be interpreted according to the specific message. + + + + + The payload of the ICMP. + All the data without the ICMP header. + + + + + The value of this field determines the format of the remaining data. + + + + + A sub-type of the message. Specific method of this message type. + + + + + The number of bytes the ICMP payload takes. + + + + + A value that should be interpreted according to the specific message. + + + + + RFC 1256. +
+            +-----+-----------+-----------------+----------+
+            | Bit | 0-7       | 8-15            | 16-31    |
+            +-----+-----------+-----------------+----------+
+            | 0   | Type      | Code            | Checksum |
+            +-----+-----------+-----------------+----------+
+            | 32  | Num Addrs | Addr Entry Size | Lifetime |
+            +-----+-----------+-----------------+----------+
+            | 64  | Router Address[1]                      |
+            +-----+----------------------------------------+
+            | 96  | Preference Level[1]                    |
+            +-----+----------------------------------------+
+            | 128 | Router Address[2]                      |
+            +-----+----------------------------------------+
+            | 160 | Preference Level[2]                    |
+            +-----+----------------------------------------+
+            |  .  |                   .                    |
+            |  .  |                   .                    |
+            |  .  |                   .                    |
+            
+
+
+ + + The default number of 32-bit words of information per each router address. + + + + + Creates a Layer that represents the datagram to be used with PacketBuilder. + + + + + Valid if the datagram's length is OK, the checksum is correct, the code is in the expected range + and the address entry size is the default address entry size. + + + + + The number of router addresses advertised in this message. + + + + + The number of 32-bit words of information per each router address (2, in the version of the protocol described here). + + + + + The maximum number of seconds that the router addresses may be considered valid. + + + + + The maximum time that the router addresses may be considered valid. + + + + + The pairs of sending router's IP address(es) on the interface from which this message is sent + and the preferability of each Router Address[i] as a default router address, relative to other router addresses on the same subnet. + A signed, twos-complement value; higher values mean more preferable. + + + + + Represents an HTTP version. + + + + + Creates a version from the major and minor version numbers. + + The major version number. 0 for 0.9, 1 for 1.0 or 1.1. + The minor version number. 9 for 0.9, 0, for 1.0 and 1 for 1.1. + + + + A string represneting the version. + Example: "HTTP/1.1". + + + + + + Two HTTP versions are equal iff they have the same major and minor versions. + + + + + Two HTTP versions are equal iff they have the same major and minor versions. + + + + + The hash code of an http version is the xor of the hash codes of the minor version and the major version. + + + + + A built version for HTTP/1.0. + + + + + A built version for HTTP/1.1. + + + + + The major version number. + + + + + The minor version number. + + + + + The number of bytes this version takes. + + + + + RFC 2616. + Represents an HTTP response. + + + + + Creates a Layer that represents the datagram to be used with PacketBuilder. + + + + + False since this is message is a response. + + + + + The status code of the response. + null if no status code exists. + + + + + The data of the reason phrase. + Example: OK + + + + + RFC 768. + This User Datagram Protocol (UDP) is defined to make available a datagram mode of packet-switched computer communication + in the environment of an interconnected set of computer networks. + This protocol assumes that the Internet Protocol (IP) is used as the underlying protocol. + + + This protocol provides a procedure for application programs to send messages to other programs + with a minimum of protocol mechanism. + The protocol is transaction oriented, and delivery and duplicate protection are not guaranteed. + Applications requiring ordered reliable delivery of streams of data should use the Transmission Control Protocol (TCP). + + + + Format +
+             0      7 8     15 16    23 24    31
+            +--------+--------+--------+--------+
+            |     Source      |   Destination   |
+            |      Port       |      Port       |
+            +--------+--------+--------+--------+
+            |                 |                 |
+            |     Length      |    Checksum     |
+            +--------+--------+--------+--------+
+            |
+            |          data octets ...
+            +---------------- ...
+            
+
+
+
+ + + The number of bytes the datagram header takes. + + + + + Creates a Layer that represents the datagram to be used with PacketBuilder. + + + + + A udp datagram is valid if it has a full header. + + + + + The length in octets of this user datagram including this header and the data. + (This means the minimum value of the length is eight.) + + + + + Checksum is the 16-bit one's complement of the one's complement sum of a pseudo header of information from the IP header, + the UDP header, and the data, padded with zero octets at the end (if necessary) to make a multiple of two octets. + + + + + True iff the checksum for the transport type is optional. + + + + + The payload of the UDP datagram. + + + + + CC.NEW Option (RFC 1644). +
+            +--------+--------+--------+--------+--------+--------+
+            |00001100|00000110|    Connection Count:  SEG.CC      |
+            +--------+--------+--------+--------+--------+--------+
+             Kind=12  Length=6
+            
+ + + This option may be sent instead of a CC option in an initial <SYN> segment (i.e., SYN but not ACK bit), + to indicate that the SEG.CC value may not be larger than the previous value. + Its SEG.CC value is the TCB.CCsend value from the sender's TCB. + +
+
+ + + Creates the option using the given connection count value. + + + + + The default connection count value is 0. + + + + + Tries to read the option from a buffer starting from the option value (after the type and length). + + The buffer to read the option from. + The offset to the first byte to read the buffer. Will be incremented by the number of bytes read. + The number of bytes the option value should take according to the length field that was already read. + On success - the complex option read. On failure - null. + + + + Indicates the next level IPv4 protocol used in the pyaload of the IPv4 datagram. + + + + + IPv6 Hop-by-Hop Option RFC 2460 + + + + + Internet Control Message Protocol RFC 792 + + + + + Internet Group Management Protocol RFC 1112 + + + + + Gateway-to-Gateway Protocol RFC 823 + + + + + IP in IP (encapsulation) RFC 2003 + + + + + Internet Stream Protocol RFC 1190, RFC 1819 + + + + + Transmission Control Protocol RFC 793 + + + + + CBT + + + + + Exterior Gateway Protocol RFC 888 + + + + + Interior Gateway Protocol (any private interior gateway (used by Cisco for their IGRP)) + + + + + BBN RCC Monitoring + + + + + Network Voice Protocol RFC 741 + + + + + Xerox PUP + + + + + ARGUS + + + + + EMCON + + + + + Cross Net Debugger IEN 158 + + + + + Chaos + + + + + User Datagram Protocol RFC 768 + + + + + Multiplexing IEN 90 + + + + + DCN Measurement Subsystems + + + + + Host Monitoring Protocol RFC 869 + + + + + Packet Radio Measurement + + + + + XEROX NS IDP + + + + + Trunk-1 + + + + + Trunk-2 + + + + + Leaf-1 + + + + + Leaf-2 + + + + + Reliable Datagram Protocol RFC 908 + + + + + Internet Reliable Transaction Protocol RFC 938 + + + + + ISO Transport Protocol Class 4 RFC 905 + + + + + Bulk Data Transfer Protocol RFC 998 + + + + + MFE Network Services Protocol + + + + + MERIT Internodal Protocol + + + + + Datagram Congestion Control Protocol RFC 4340 + + + + + Third Party Connect Protocol + + + + + Inter-Domain Policy Routing Protocol RFC 1479 + + + + + Xpress Transport Protocol + + + + + Datagram Delivery Protocol + + + + + IDPR Control Message Transport Protocol + + + + + TP++ Transport Protocol + + + + + IL Transport Protocol + + + + + IPv6 RFC 2460 + + + + + Source Demand Routing Protocol + + + + + Routing Header for IPv6 RFC 2460 + + + + + Fragment Header for IPv6 RFC 2460 + + + + + Inter-Domain Routing Protocol + + + + + Resource Reservation Protocol + + + + + Generic Routing Encapsulation + + + + + Mobile Host Routing Protocol + + + + + BNA + + + + + Encapsulating Security Payload RFC 2406 + + + + + Authentication Header RFC 2402 + + + + + Integrated Net Layer Security Protocol TUBA + + + + + IP with Encryption + + + + + NBMA Address Resolution Protocol RFC 1735 + + + + + IP Mobility (Min Encap) RFC 2004 + + + + + Transport Layer Security Protocol (using Kryptonet key management) + + + + + Simple Key-Management for Internet Protocol RFC 2356 + + + + + ICMP for IPv6 RFC 2460 + + + + + No Next Header for IPv6 RFC 2460 + + + + + Destination Options for IPv6 RFC 2460 + + + + + Any host internal protocol + + + + + CFTP + + + + + Any local network + + + + + SATNET and Backroom EXPAK + + + + + Kryptolan + + + + + MIT Remote Virtual Disk Protocol + + + + + Internet Pluribus Packet Core + + + + + Any distributed file system + + + + + SATNET Monitoring + + + + + VISA Protocol + + + + + Internet Packet Core Utility + + + + + Computer Protocol Network Executive + + + + + Computer Protocol Heart Beat + + + + + Wang Span Network + + + + + Packet Video Protocol + + + + + Backroom SATNET Monitoring + + + + + SUN ND PROTOCOL-Temporary + + + + + WIDEBAND Monitoring + + + + + WIDEBAND EXPAK + + + + + International Organization for Standardization Internet Protocol + + + + + Versatile Message Transaction Protocol RFC 1045 + + + + + Secure Versatile Message Transaction Protocol RFC 1045 + + + + + VINES + + + + + TTP + + + + + NSFNET-IGP + + + + + Dissimilar Gateway Protocol + + + + + TCF + + + + + Enhanced Interior Gateway Routing Protocol + + + + + Open Shortest Path First RFC 1583 + + + + + Sprite RPC Protocol + + + + + Locus Address Resolution Protocol + + + + + Multicast Transport Protocol + + + + + AX.25 + + + + + IP-within-IP Encapsulation Protocol + + + + + Mobile Internetworking Control Protocol + + + + + Semaphore Communications Sec. Pro + + + + + Ethernet-within-IP Encapsulation RFC 3378 + + + + + Encapsulation Header RFC 1241 + + + + + Any private encryption scheme + + + + + GMTP + + + + + Ipsilon Flow Management Protocol + + + + + PNNI over IP + + + + + Protocol Independent Multicast + + + + + ARIS + + + + + SCPS (Space Communications Protocol Standards) + + + + + QNX + + + + + Active Networks + + + + + IP Payload Compression Protocol RFC 3173 + + + + + Sitara Networks Protocol + + + + + Compaq Peer Protocol + + + + + IPX in IP + + + + + Virtual Router Redundancy Protocol, Common Address Redundancy Protocol (not IANA assigned) VRRP:RFC 3768 + + + + + PGM Reliable Transport Protocol RFC 3208 + + + + + Any 0-hop protocol + + + + + Layer Two Tunneling Protocol + + + + + D-II Data Exchange (DDX) + + + + + Interactive Agent Transfer Protocol + + + + + Schedule Transfer Protocol + + + + + SpectraLink Radio Protocol + + + + + UTI + + + + + Simple Message Protocol + + + + + SM + + + + + Performance Transparency Protocol + + + + + IS-IS over IPv4 + + + + + + + + + + Combat Radio Transport Protocol + + + + + Combat Radio User Datagram + + + + + + + + + + + + + + + Secure Packet Shield + + + + + Private IP Encapsulation within IP Expired I-D draft-petri-mobileip-pipe-00.txt + + + + + Stream Control Transmission Protocol + + + + + Fibre Channel + + + + + RSVP-E2E-IGNORE RFC 3175 + + + + + Mobility Header RFC 3775 + + + + + UDP Lite RFC 3828 + + + + + MPLS-in-IP RFC 4023 + + + + + MANET Protocols I-D draft-ietf-manet-iana-07.txt + + + + + Host Identity Protocol RFC 5201 + + + + + Represents an IPv4 datagram. + +
+            +-----+---------+-----+-----------------+-------+-----------------+
+            | Bit | 0-3     | 4-7 | 8-15            | 16-18 | 19-31           |
+            +-----+---------+-----+-----------------+-------+-----------------+
+            | 0   | Version | IHL | Type of Service | Total Length            |
+            +-----+---------+-----+-----------------+-------+-----------------+
+            | 32  | Identification                  | Flags | Fragment Offset |
+            +-----+---------------+-----------------+-------+-----------------+
+            | 64  | Time to Live  | Protocol        | Header Checksum         |
+            +-----+---------------+-----------------+-------------------------+
+            | 96  | Source Address                                            |
+            +-----+-----------------------------------------------------------+
+            | 128 | Destination Address                                       |
+            +-----+-----------------------------------------------------------+
+            | 160 | Options with padding                                      |
+            +-----+-----------------------------------------------------------+
+            | 160 | Data                                                      |
+            | to  |                                                           |
+            | 360 |                                                           |
+            +-----+-----------------------------------------------------------+
+            
+
+
+ + + The minimum length of the header in bytes. + + + + + The maximum length of the header in bytes. + + + + + The version (4). + + + + + Creates a Layer that represents the datagram to be used with PacketBuilder. + + + + + An IPv4 datagram is valid if its length is big enough for the header, the header checksum is correct and the payload is valid. + + + + + + The header length in bytes. + + + + + The header length in bytes. + + + + + The real number of bytes in the header (different than HeaderLength when the datagram is too small). + + + + + Type of Service field. + + + + + The length of the entire datagram as stated in the total length field. + + + + + The value of the IPv4 ID field. + + + + + The fragmentation information field. + + + + + The TTL field. + + + + + The IPv4 (next) protocol field. + + + + + The header checksum value. + + + + + True iff the header checksum value is correct according to the header. + + + + + The source address. + + + + + The destination address. + + + + + The options field with all the parsed options if any exist. + + + + + Returns whether the TCP or UDP checksum is correct. + The protocol must be TCP or UDP. + For UDP, the checksum is optional, so 0 checksum is still correct. + + + + + The payload of the datagram. + + + + + The payload of the datagram as an IPv4 datagram (IP over IP). + + + + + The payload of the datagram as an ICMP datagram. + + + + + The payload of the datagram as an IGMP datagram. + + + + + The payload of the datagram as a TCP datagram. + + + + + The payload of the datagram as a GRE datagram. + + + + + The payload of the datagram as a UDP datagram. + + + + + Returns the Tranposrt Datagram. + This is either a TCP Datagram or a UDP Datagram (according to the protocol). + + + + + The version of the IGMP query message. + + + + + No query version - not a query. + + + + + Version 1 query - RFC1112. + + + + + Version 2 query - RFC2236. + + + + + Version 3 query - RFC3376. + + + + + The version of the query could not be interpreted. + + + + + RFC 1475. +
+            +-----+------+------+-----------+
+            | Bit | 0-7  | 8-15 | 16-31     |
+            +-----+------+------+-----------+
+            | 0   | Type | Code | Checksum  |
+            +-----+------+------+-----------+
+            | 32  | pointer to problem area |
+            +-----+-------------------------+
+            | 64  | copy of datagram that   |
+            |     | could not be converted  |
+            |     | ...                     |
+            +-----+-------------------------+
+            
+
+
+ + + The number of bytes that should be taken from the original datagram for an unsupported transport protocol ICMP code. + + + + + Creates a Layer that represents the datagram to be used with PacketBuilder. + + + + + Valid if the datagram's length is OK, the checksum is correct, the code is in the expected range + and the IPv4 payload contains at least an IPv4 header and the transport header. + If the code is for unsupported transport protocol, the IPv4 payload should contain 256 bytes of the original datagram. + + + + + An offset from the start of the original datagram to the beginning of the offending field. + + + + + The minimum valid ICMP code for this type of ICMP datagram. + + + + + The maximum valid ICMP code for this type of ICMP datagram. + + + + + RFC 792. +
+            +-----+------+------+-----------+
+            | Bit | 0-7  | 8-15 | 16-31     |
+            +-----+------+------+-----------+
+            | 0   | Type | Code | Checksum  |
+            +-----+------+------+-----------+
+            | 32  | unused                  |
+            +-----+-------------------------+
+            | 64  | Internet Header         |
+            |     | + 64 bits of            |
+            |     | Original Data Datagram  |
+            +-----+-------------------------+
+            
+
+
+ + + Creates a Layer that represents the datagram to be used with PacketBuilder. + + + + + The minimum valid ICMP code for this type of ICMP datagram. + + + + + The maximum valid ICMP code for this type of ICMP datagram. + + + + + RFC 1475. + Represents a Conversion Failed ICMP layer. + + + + + + A sub-type of the message. Specific method of this message type. + + + + + An offset from the start of the original datagram to the beginning of the offending field. + + + + + The value of this field determines the format of the remaining data. + + + + + A sub-type of the message. Specific method of this message type. + + + + + A value that should be interpreted according to the specific message. + + + + + An HTTP field with a name and value. + + + + + Creates a field according to the field name and value. + + The name of the field to create. + The bytes value of the field to create. + The constructed HTTP field. + + + + Creates a field according to the field name and encoded string value. + + The name of the field to create. + The value of the field to create encoded in the given encoding. + The encoding that encodes the given field value. + The constructed HTTP field. + + + + Creates a field according to the field name and encoded string value. + + The name of the field to create. + The value of the field to create encoded in ISO-8859-1 encoding. + The constructed HTTP field. + + + + True iff the two HTTP fields are of equal value. + Two fields are equal iff they have the same name (case insensitive) and the same bytes value. + + + + + True iff the two HTTP fields are of equal value. + Two fields are equal iff they have the same name (case insensitive) and the same bytes value. + + + + + Returns a hash code of this field according to the name and value. + + + + + A string representing the field similar to how it would like in the HTTP protocol. + + + + + + The name of the field. + + + + + The Value of the field. + + + + + The Value of the field as a string using ISO-8859-1 encoding. + + + + + The number of bytes the field will take in the HTTP protocol. + + + + + RFC 2616. + The Content-Type entity-header field indicates the media type of the entity-body sent to the recipient or, in the case of the HEAD method, + the media type that would have been sent had the request been a GET. + +
+            Content-Type   = "Content-Type" ":" media-type
+            
+ + An example of the field is +
+            Content-Type: text/html; charset=ISO-8859-4
+            
+
+
+ + + The field name. + + + + + The field name in uppercase. + + + + + Creates a Content Type Field according to the given media type, media subtype and parameters. + + The main type of the content of this HTTP message. + The subtype of the content of this HTTP message. + Parameters on the specific type. + + + + True iff the two fields are equal. + Two content type fields are equal if they have the same media type and subtype and same parameters. + + + + + True iff the two fields are equal. + Two content type fields are equal if they have the same media type and subtype and same parameters. + + + + + The main type of the content of this HTTP message. + + + + + The subtype of the content of this HTTP message. + + + + + Parameters on the specific type. + + + + + Specifies the operation the ARP sender is performing. + + + + + Invalid operation. + + + + + [RFC826][RFC5227] + + + + + [RFC826][RFC5227] + + + + + [RFC903] + + + + + [RFC903] + + + + + [RFC1931] + + + + + [RFC1931] + + + + + [RFC1931] + + + + + [RFC1293] + + + + + [RFC1293] + + + + + [RFC1577] + + + + + [RFC2176] + + + + + [RFC5494] + + + + + [RFC5494] + + + + + TCP Echo Reply Option: +
+            +--------+--------+--------+--------+--------+--------+
+            | Kind=7 | Length |    4 bytes of echoed info         |
+            +--------+--------+--------+--------+--------+--------+
+            
+ + + A TCP that receives a TCP Echo option containing four information bytes will return these same bytes in a TCP Echo Reply option. + + + + This TCP Echo Reply option must be returned in the next segment (e.g., an ACK segment) that is sent. + If more than one Echo option is received before a reply segment is sent, the TCP must choose only one of the options to echo, + ignoring the others; specifically, it must choose the newest segment with the oldest sequence number. + + + + To use the TCP Echo and Echo Reply options, a TCP must send a TCP Echo option in its own SYN segment + and receive a TCP Echo option in a SYN segment from the other TCP. + A TCP that does not implement the TCP Echo or Echo Reply options must simply ignore any TCP Echo options it receives. + However, a TCP should not receive one of these options in a non-SYN segment unless it included a TCP Echo option in its own SYN segment. + +
+
+ + + The number of bytes this option take. + + + + + The number of bytes this option value take. + + + + + Creates the option using the given echo info. + + + + + The default echo info is 0. + + + + + Two echo reply options are equal if they have the same info. + + + + + Two echo reply options are equal if they have the same info. + + + + + The hash code of the echo reply option is the hash code of the option type xored with the hash code of the info. + + + + + Tries to read the option from a buffer starting from the option value (after the type and length). + + The buffer to read the option from. + The offset to the first byte to read the buffer. Will be incremented by the number of bytes read. + The number of bytes the option value should take according to the length field that was already read. + On success - the complex option read. On failure - null. + + + + The echoed info. + + + + + The number of bytes this option will take. + + + + + True iff this option may appear at most once in a datagram. + + + + + TCP Echo Option: +
+            +--------+--------+--------+--------+--------+--------+
+            | Kind=6 | Length |   4 bytes of info to be echoed    |
+            +--------+--------+--------+--------+--------+--------+
+            
+ + + This option carries four bytes of information that the receiving TCP may send back in a subsequent TCP Echo Reply option. + A TCP may send the TCP Echo option in any segment, but only if a TCP Echo option was received in a SYN segment for the connection. + + + + When the TCP echo option is used for RTT measurement, it will be included in data segments, + and the four information bytes will define the time at which the data segment was transmitted in any format convenient to the sender. + +
+
+ + + The number of bytes this option take. + + + + + The number of bytes this option value take. + + + + + Creates the option using the given echo info. + + + + + The default info is 0. + + + + + Two echo options are equal if they have the same info. + + + + + Two echo options are equal if they have the same info. + + + + + The hash code of the echo option is the hash code of the option type xored with the hash code info. + + + + + Tries to read the option from a buffer starting from the option value (after the type and length). + + The buffer to read the option from. + The offset to the first byte to read the buffer. Will be incremented by the number of bytes read. + The number of bytes the option value should take according to the length field that was already read. + On success - the complex option read. On failure - null. + + + + The info value of the option to be echoed. + + + + + The number of bytes this option will take. + + + + + True iff this option may appear at most once in a datagram. + + + + + TCP Alternate Checksum Data Option (RFC 1146). + + + The format of the TCP Alternate Checksum Data Option is: +
+            +---------+---------+---------+     +---------+
+            | Kind=15 |Length=N |  data   | ... |  data   |
+            +---------+---------+---------+     +---------+
+            
+
+ + + This field is used only when the alternate checksum that is negotiated is longer than 16 bits. + These checksums will not fit in the checksum field of the TCP header and thus at least part of them must be put in an option. + Whether the checksum is split between the checksum field in the TCP header and the option or the entire checksum is placed in the option + is determined on a checksum by checksum basis. + + + + The length of this option will depend on the choice of alternate checksum algorithm for this connection. + + + + While computing the alternate checksum, the TCP checksum field and the data portion TCP Alternate Checksum Data Option are replaced with zeros. + +
+
+ + + The minimum number of bytes this option take. + + + + + The minimum number of bytes this option's value take. + + + + + Creates the option using the given data. + + + + + the default option data is no data. + + + + + Two alternate checksum data options are equal if they have the same data. + + + + + Two alternate checksum data options are equal if they have the same data. + + + + + The hash code of this option is the hash code of the option type xored with the hash code of the data. + + + + + Tries to read the option from a buffer starting from the option value (after the type and length). + + The buffer to read the option from. + The offset to the first byte to read the buffer. Will be incremented by the number of bytes read. + The number of bytes the option value should take according to the length field that was already read. + On success - the complex option read. On failure - null. + + + + The alternate checksum data. + + + + + The number of bytes this option will take. + + + + + True iff this option may appear at most once in a datagram. + + + + + TCP control bits format +
+            +-----+-----+----+-----+-----+-----+-----+-----+-----+-----+-----+
+            | Bit | 0-6 | 7  | 8   | 9   | 10  | 11  | 12  | 13  | 14  | 15  |
+            +-----+-----+----+-----+-----+-----+-----+-----+-----+-----+-----+
+            | 0   |     | NS | CWR | ECE | URG | ACK | PSH | RST | SYN | FIN |
+            +-----+-----+----+-----+-----+-----+-----+-----+-----+-----+-----+
+            
+
+
+ + + No control bits are turned on. + + + + + No more data from sender. + + + + + Synchronize sequence numbers. + + + + + Reset the connection. + + + + + Push Function. + + + + + Acknowledgment field significant. + + + + + Urgent Pointer field significant. + + + + + RFC 3168. + + + + + RFC 3168. + + + + + RFC 3540. + + + + + A pair of address and its time in the day. + + + + + Create a timed address accroding to the given values. + + The address in the pair. + The time passed since midnight UT. + + + + Two options are equal if they have the same address and time passed since midnight UT. + + + + + Two options are equal if they have the same address and time passed since midnight UT. + + + + + Two options are equal if they have the same address and time passed since midnight UT. + + + + + Two options are different if they have different addresses or time passed since midnight UT. + + + + + Returns the xor of the address hash code and the time in the day hash code. + + + + + The address. + + + + + The time passed since midnight UT. + + + + + Represents IPv4 Fragmentation information. + + + + + Creates fragmentation field value according to the given information. + + Options for fragmentation (must be one of the values of the enum). + This field indicates where in the complete datagram this fragment belongs. Measured in bytes but must divide by 8. + + + + Two framentations are equal if they are exactly the same fragmentation (options and offset). + + + + + Two framentations are equal if they are exactly the same fragmentation (options and offset). + + + + + Two framentations are equal if they are exactly the same fragmentation (options and offset). + + + + + Two framentations are different if they are different fragmentation (options or offset). + + + + + The hash code of the fragmentation is the hash code of its combined flags and offset 16 bit field. + + + + + + No fragmentation. + + + + + Options for fragmentation. + + + + + This field indicates where in the complete datagram this fragment belongs. Measured in bytes but must divide by 8. + + + + + An unknown IPv4 option. + + + + + The minimum number of bytes this option take. + + + + + The minimum number of bytes this option's value take. + + + + + Creates an unknown IPv4 option by the given type and data. + + + + + The default unknown option is with type 255 and no data. + + + + + Two unknown options are equal iff they are of equal type and equal data. + + + + + Two unknown options are equal iff they are of equal type and equal data. + + + + + The hash code for an unknown option is the hash code for the option type xored with the hash code of the data. + + + + + Creates an unknown option from its type and by reading a buffer for its value. + + The type of the unknown option. + The buffer of bytes to read the value of the unknown option. + The offset in the buffer to start reading the bytes. + The number of bytes to read from the buffer. + An option created from the given type and buffer. + + + + Returns the Data of the option. + + + + + The number of bytes this option will take. + + + + + True iff this option may appear at most once in a datagram. + + + + + Represents an IGMP group record with all the relevant fields. + Used to build an IGMP report of version 3. + + + + + Create the record according to all the fields. + + The type of group record included in the report message. + The Multicast Address field contains the IP multicast address to which this Group Record pertains. + + The Source Address [i] fields are a vector of n IP unicast addresses, + where n is the value in this record's Number of Sources (N) field. + + + The Auxiliary Data field, if present, contains additional information pertaining to this Group Record. + The protocol specified in this document, IGMPv3, does not define any auxiliary data. + Therefore, implementations of IGMPv3 MUST NOT include any auxiliary data (i.e., MUST set the Aux Data Len field to zero) in any transmitted Group Record, + and MUST ignore any auxiliary data present in any received Group Record. + The semantics and internal encoding of the Auxiliary Data field are to be defined by any future version or extension of IGMP that uses this field. + + + + + Create the record according to all the fields. + + The type of group record included in the report message. + The Multicast Address field contains the IP multicast address to which this Group Record pertains. + + The Source Address [i] fields are a vector of n IP unicast addresses, + where n is the value in this record's Number of Sources (N) field. + + + The Auxiliary Data field, if present, contains additional information pertaining to this Group Record. + The protocol specified in this document, IGMPv3, does not define any auxiliary data. + Therefore, implementations of IGMPv3 MUST NOT include any auxiliary data (i.e., MUST set the Aux Data Len field to zero) in any transmitted Group Record, + and MUST ignore any auxiliary data present in any received Group Record. + The semantics and internal encoding of the Auxiliary Data field are to be defined by any future version or extension of IGMP that uses this field. + + + + + A string containing the record type, multicast address, source addresses and the number of bytes in teh auxiliary data. + + + + + Two records are equal if the record type, multicast address, source addresses and auxiliary data are equal. + + + + + Two records are equal if the record type, multicast address, source addresses and auxiliary data are equal. + + + + + The hash code of a record is the xor of the hash code of the record type, multicast address, source addresses and auxiliary data. + + + + + The type of group record included in the report message. + + + + + The Multicast Address field contains the IP multicast address to which this Group Record pertains. + + + + + The Source Address [i] fields are a vector of n IP unicast addresses, + where n is the value in this record's Number of Sources (N) field. + + + + + The Auxiliary Data field, if present, contains additional information pertaining to this Group Record. + The protocol specified in this document, IGMPv3, does not define any auxiliary data. + Therefore, implementations of IGMPv3 MUST NOT include any auxiliary data (i.e., MUST set the Aux Data Len field to zero) in any transmitted Group Record, + and MUST ignore any auxiliary data present in any received Group Record. + The semantics and internal encoding of the Auxiliary Data field are to be defined by any future version or extension of IGMP that uses this field. + + + + + Represents a GRE layer. + + + + + + Sets the key according to the payload length and call id. + + (High 2 octets of Key) Size of the payload, not including the GRE header. + (Low 2 octets of Key) Contains the Peer's Call ID for the session to which this packet belongs. + + + + Writes the layer to the buffer. + + The buffer to write the layer to. + The offset in the buffer to start writing the layer at. + The length of the layer's payload (the number of bytes after the layer in the packet). + The layer that comes before this layer. null if this is the first layer. + The layer that comes after this layer. null if this is the last layer. + + + + Finalizes the layer data in the buffer. + Used for fields that must be calculated according to the layer's payload (like checksum). + + The buffer to finalize the layer in. + The offset in the buffer the layer starts. + The length of the layer's payload (the number of bytes after the layer in the packet). + The layer that comes after this layer. null if this is the last layer. + + + + True iff the two objects are equal Layers. + + + + + True iff the two objects are equal Layers. + + + + + The GRE Version Number. + + + + + The Protocol Type field contains the protocol type of the payload packet. + These Protocol Types are defined in [RFC1700] as "ETHER TYPES" and in [ETYPES]. + An implementation receiving a packet containing a Protocol Type which is not listed in [RFC1700] or [ETYPES] SHOULD discard the packet. + + + + + Recursion control contains a three bit unsigned integer which contains the number of additional encapsulations which are permissible. + This SHOULD default to zero. + + + + + Must be set to zero (0). + + + + + If the Checksum Present bit is set to 1, then the Checksum field is present and contains valid information. + If either the Checksum Present bit or the Routing Present bit are set, BOTH the Checksum and Offset fields are present in the GRE packet. + + + + + The Checksum field contains the IP (one's complement) checksum sum of the all the 16 bit words in the GRE header and the payload packet. + For purposes of computing the checksum, the value of the checksum field is zero. + This field is present only if the Checksum Present bit is set to one. + In order to calculate the Checksum automatically, leave null in this field and set the ChecksumPresent field to true. + + + + + The Key field contains a four octet number which was inserted by the encapsulator. + It may be used by the receiver to authenticate the source of the packet. + The Key field is only present if the Key Present field is set to 1. + null iff the Key isn't present. + + + + + (High 2 octets of Key) Size of the payload, not including the GRE header. + + + + + (Low 2 octets of Key) Contains the Peer's Call ID for the session to which this packet belongs. + + + + + The Sequence Number field contains an unsigned 32 bit integer which is inserted by the encapsulator. + It may be used by the receiver to establish the order in which packets have been transmitted from the encapsulator to the receiver. + null off the sequence number present bit is 0. + + + + + Contains the sequence number of the highest numbered GRE packet received by the sending peer for this user session. + Present if A bit (Bit 8) is one (1). + null iff not present. + + + + + The offset field indicates the octet offset from the start of the Routing field to the first octet of the active Source Route Entry to be examined. + This field is present if the Routing Present or the Checksum Present bit is set to 1, and contains valid information only if the Routing Present bit is set to 1. + Should be null iff the Routing is null (routing is not present). + + + + + The Routing field is optional and is present only if the Routing Present bit is set to 1. + The Routing field is a list of Source Route Entries (SREs). + null iff the routing isn't present. + + + + + If the source route is incomplete, then the Strict Source Route bit is checked. + If the source route is a strict source route and the next IP destination or autonomous system is NOT an adjacent system, the packet MUST be dropped. + + + + + The number of bytes this layer will take. + + + + + The protocol that should be written in the previous (IPv4) layer. + This is GRE. + + + + + The data link layer protocol of the ARP protocol. + + + + + Invalid hardware type + + + + + Ethernet (10Mb) + + + + + Experimental Ethernet (3Mb) + + + + + Amateur Radio AX.25 + + + + + Proteon ProNET Token Ring + + + + + Chaos + + + + + IEEE 802 Networks + + + + + ARCNET + + + + + Hyperchannel + + + + + Lanstar + + + + + Autonet Short Address + + + + + LocalTalk + + + + + LocalNet (IBM PCNet or SYTEK LocalNET) + + + + + Ultra link + + + + + SMDS + + + + + Frame Relay + + + + + Asynchronous Transmission Mode (ATM) + + + + + HDLC + + + + + Fibre Channel + + + + + Asynchronous Transmission Mode (ATM) + + + + + Serial Line + + + + + Asynchronous Transmission Mode (ATM) + + + + + MIL-STD-188-220 + + + + + Metricom + + + + + IEEE 1394.1995 + + + + + MAPOS + + + + + Twinaxial + + + + + EUI-64 + + + + + HIPARP + + + + + IP and ARP over ISO 7816-3 + + + + + ARPSec + + + + + IPsec tunnel + + + + + InfiniBand (TM) + + + + + TIA-102 Project 25 Common Air Interface (CAI) + + + + + Wiegand Interface + + + + + Pure IP + + + + + HW_EXP1 + + + + + HW_EXP2 + + + + + Maximum Segment Size (RFC 793) +
+            +--------+--------+---------+--------+
+            |00000010|00000100|   max seg size   |
+            +--------+--------+---------+--------+
+             Kind=2   Length=4
+            
+ + + If this option is present, then it communicates the maximum receive segment size at the TCP which sends this segment. + This field must only be sent in the initial connection request (i.e., in segments with the SYN control bit set). + If this option is not used, any segment size is allowed. + +
+
+ + + The number of bytes this option take. + + + + + The number of bytes this option value take. + + + + + Creates the option using the given maximum segment size. + + + + + The default maximum segment size is 0. + + + + + Two maximum segment size options are equal if they have the same maximum segment size. + + + + + Two maximum segment size options are equal if they have the same maximum segment size. + + + + + The hash code of the option is the hash code of the option type xored with the hash code of the maximum segment size. + + + + + + Tries to read the option from a buffer starting from the option value (after the type and length). + + The buffer to read the option from. + The offset to the first byte to read the buffer. Will be incremented by the number of bytes read. + The number of bytes the option value should take according to the length field that was already read. + On success - the complex option read. On failure - null. + + + + The maximum segment size value. + + + + + The number of bytes this option will take. + + + + + True iff this option may appear at most once in a datagram. + + + + + Stream Identifier option. +
+            +--------+--------+--------+--------+
+            |10001000|00000010|    Stream ID    |
+            +--------+--------+--------+--------+
+             Type=136 Length=4
+            
+ + This option provides a way for the 16-bit SATNET stream identifier to be carried through networks that do not support the stream concept. + + Must be copied on fragmentation. + Appears at most once in a datagram. +
+
+ + + The number of bytes this option take. + + + + + Create the option according to the given identifier. + + + + + Creates a 0 stream identifier + + + + + Two stream identifier options are equal if they have the same identifier. + + + + + Two stream identifier options are equal if they have the same identifier. + + + + + The hash code value is the xor of the base class hash code and the identifier hash code. + + + + + Tries to read the option from a buffer starting from the option value (after the type and length). + + The buffer to read the option from. + The offset to the first byte to read the buffer. Will be incremented by the number of bytes read. + The number of bytes the option value should take according to the length field that was already read. + On success - the complex option read. On failure - null. + + + + The identifier of the stream. + + + + + The number of bytes this option will take. + + + + + True iff this option may appear at most once in a datagram. + + + + + This option identifies the U.S. classification level at which the datagram is to be protected + and the authorities whose protection rules apply to each datagram. + + + This option is used by end systems and intermediate systems of an internet to: + + Transmit from source to destination in a network standard representation the common security labels required by computer security models. + Validate the datagram as appropriate for transmission from the source and delivery to the destination. + + Ensure that the route taken by the datagram is protected to the level required by all protection authorities indicated on the datagram. + In order to provide this facility in a general Internet environment, interior and exterior gateway protocols must be augmented + to include security label information in support of routing control. + + + + + + The DoD Basic Security option must be copied on fragmentation. + This option appears at most once in a datagram. + Some security systems require this to be the first option if more than one option is carried in the IP header, + but this is not a generic requirement levied by this specification. + + + + The format of the DoD Basic Security option is as follows: +
+             +------------+------------+------------+-------------//----------+
+             |  10000010  |  XXXXXXXX  |  SSSSSSSS  |  AAAAAAA[1]    AAAAAAA0 |
+             |            |            |            |         [0]             |
+             +------------+------------+------------+-------------//----------+
+               TYPE = 130     LENGTH   CLASSIFICATION         PROTECTION
+                                            LEVEL              AUTHORITY
+                                                                 FLAGS
+               
+
+
+
+ + + The minimum number of bytes this option take. + + + + + The minimum number of bytes this option's value take. + + + + + Create the security option from the different security field values. + + + This field specifies the (U.S.) classification level at which the datagram must be protected. + The information in the datagram must be protected at this level. + + + This field identifies the National Access Programs or Special Access Programs + which specify protection rules for transmission and processing of the information contained in the datagram. + + + The number of bytes this option will take. + + + + + Create the security option with only classification level. + + + This field specifies the (U.S.) classification level at which the datagram must be protected. + The information in the datagram must be protected at this level. + + + + + Creates unclassified security option. + + + + + Two security options are equal iff they have the exact same field values. + + + + + Two security options are equal iff they have the exact same field values. + + + + + The hash code is the xor of the base class hash code + with the hash code of the combination of the classification level, protection authority and length. + + + + + + Tries to read the option from a buffer starting from the option value (after the type and length). + + The buffer to read the option from. + The offset to the first byte to read the buffer. Will be incremented by the number of bytes read. + The number of bytes the option value should take according to the length field that was already read. + On success - the complex option read. On failure - null. + + + + This field specifies the (U.S.) classification level at which the datagram must be protected. + The information in the datagram must be protected at this level. + + + + + This field identifies the National Access Programs or Special Access Programs + which specify protection rules for transmission and processing of the information contained in the datagram. + + + + + The number of bytes this option will take. + + + + + True iff this option may appear at most once in a datagram. + + + + + Represents a datalink. + + + + + The kind of the datalink. + + + + + RFC 950. +
+            +-----+------+------+-----------------+
+            | Bit | 0-7  | 8-15 | 16-31           |
+            +-----+------+------+-----------------+
+            | 0   | Type | Code | Checksum        |
+            +-----+------+------+-----------------+
+            | 32  | Identifier  | Sequence Number |
+            +-----+-------------+-----------------+
+            | 64  | Address Mask                  |
+            +-----+-------------------------------+
+            
+
+
+ + + RFC 950. +
+            +-----+------+------+-----------------+
+            | Bit | 0-7  | 8-15 | 16-31           |
+            +-----+------+------+-----------------+
+            | 0   | Type | Code | Checksum        |
+            +-----+------+------+-----------------+
+            | 32  | Identifier  | Sequence Number |
+            +-----+-------------+-----------------+
+            | 64  | Address Mask                  |
+            +-----+-------------------------------+
+            
+
+
+ + + The number of bytes this Datagram should take. + + + + + The number of bytes this ICMP payload should take. + + + + + Creates a Layer that represents the datagram to be used with PacketBuilder. + + + + + ICMP is valid if the datagram's length is OK, the checksum is correct and the code is in the expected range. + + + + + A 32-bit mask. + + + + + Creates a Layer that represents the datagram to be used with PacketBuilder. + + + + + HTTP request method. + Example: GET + + + + + Creates a method from a method string. + + + + + Creates a method from a known method. + + + + + Two methods are equal iff they have the same method string. + + + + + Two methods are equal iff they have the same method string. + + + + + The hash code of the method string. + + + + + The method string. + + + + + Returns the known method that matches the method string. + Returns HttpRequestKnownMethod.Unknown if no matching known method could be found. + + + + + The number of bytes this method takes. + + + + + RFC 2616. + The Content-Length entity-header field indicates the size of the entity-body, in decimal number of OCTETs, sent to the recipient or, + in the case of the HEAD method, the size of the entity-body that would have been sent had the request been a GET. + + + + + The field name. + + + + + The field name in uppercase. + + + + + Creates a Content Length Field according to a given content length. + + + The size of the entity-body, in decimal number of OCTETs, sent to the recipient or, + in the case of the HEAD method, the size of the entity-body that would have been sent had the request been a GET. + + + + + The size of the entity-body, in decimal number of OCTETs, sent to the recipient or, + in the case of the HEAD method, the size of the entity-body that would have been sent had the request been a GET. + + + + + Represents an Ethernet layer. + + + + + + Creates an instance with zero values. + + + + + Writes the layer to the buffer. + + The buffer to write the layer to. + The offset in the buffer to start writing the layer at. + The length of the layer's payload (the number of bytes after the layer in the packet). + The layer that comes before this layer. null if this is the first layer. + The layer that comes after this layer. null if this is the last layer. + + + + Two Ethernet layers are equal if they have the same source, destination and ethernet type. + + + + + Two Ethernet layers are equal if they have the same source, destination and ethernet type. + + + + + Returns a hash code for the layer. + The hash code is a XOR of the hash codes of the layer length, data link, source and destination addresses and the ethernet type. + + + + + Contains the source, destination and ether type. + + + + + + Ethernet source address. + + + + + Ethernet destination address. + + + + + Ethernet type (next protocol). + + + + + The number of bytes this layer will take. + + + + + The kind of the data link of the layer. + Can be null if this is not the first layer in the packet. + + + + + The ARP Hardware Type of the layer before the ARP layer. + + + + + RFC 3376. + Represents an IGMP Query version 3 layer. + + + + + + Creates an instance of an IGMP Query Version 3 layer. + Default SourceAddresses is no addresses. + + + + + Writes the layer to the buffer. + This method ignores the payload length, and the previous and next layers. + + The buffer to write the layer to. + The offset in the buffer to start writing the layer at. + + + + Xor of the combination of the IsSuppressRouterSideProcessing and QueryRobustnessVariable fields with + the hash codes of the layer length, datalink, message type, query version, group address and all the source addresses. + + + + + true iff the GroupAddress, IsSuppressRouterSideProcessing, QueryRobustnessVariable and SourceAddresses fields are equal + and the QueryInterval is similar. + + + + + true iff the GroupAddress, IsSuppressRouterSideProcessing, QueryRobustnessVariable and SourceAddresses fields are equal + and the QueryInterval is similar. + + + + + The actual time allowed, called the Max Resp Time. + + + + + The Group Address field is set to zero when sending a General Query, + and set to the IP multicast address being queried when sending a Group-Specific Query or Group-and-Source-Specific Query. + In a Membership Report of version 1 or 2 or Leave Group message, the group address field holds the IP multicast group address of the group being reported or left. + In a Membership Report of version 3 this field is meaningless. + + + + + When set to one, the S Flag indicates to any receiving multicast routers that they are to suppress the normal timer updates they perform upon hearing a Query. + It does not, however, suppress the querier election or the normal "host-side" processing of a Query + that a router may be required to perform as a consequence of itself being a group member. + + + + + If non-zero, the QRV field contains the [Robustness Variable] value used by the querier, i.e., the sender of the Query. + If the querier's [Robustness Variable] exceeds 7, the maximum value of the QRV field, the QRV is set to zero. + Routers adopt the QRV value from the most recently received Query as their own [Robustness Variable] value, + unless that most recently received QRV was zero, in which case the receivers use the default [Robustness Variable] value or a statically configured value. + + + + + The actual interval, called the Querier's Query Interval (QQI). + + + + + The Source Address [i] fields are a vector of n IP unicast addresses, + where n is the value in the Number of Sources (N) field. + + + + + The number of bytes this layer will take. + + + + + The type of the IGMP message of concern to the host-router interaction. + + + + + The IGMP version of a Membership Query message. + If the type is not a query, None will be returned. + + + + + The actual time allowed, called the Max Resp Time. + + + + + RFC 1393. +
+            +-----+------+-------------+------------------+
+            | Bit | 0-7  | 8-15        | 16-31            |
+            +-----+------+-------------+------------------+
+            | 0   | Type | Code        | Checksum         |
+            +-----+------+-------------+------------------+
+            | 32  | ID Number          | unused           |
+            +-----+--------------------+------------------+
+            | 64  | Outbound Hop Count | Return Hop Count |
+            +-----+--------------------+------------------+
+            | 96  | Output Link Speed                     |
+            +-----+---------------------------------------+
+            | 128 | Output Link MTU                       |
+            +-----+---------------------------------------+
+            
+
+
+ + + The number of bytes this datagram should take. + + + + + The number of bytes this ICMP payload should take. + + + + + The value the Return Hop Count should be for an outbound ICMP packet. + + + + + Creates a Layer that represents the datagram to be used with PacketBuilder. + + + + + Valid if the datagram's length is OK, the checksum is correct and the code is in the expected range. + + + + + The ID Number as copied from the IP Traceroute option of the packet which caused this Traceroute message to be sent. + This is NOT related to the ID number in the IP header. + + + + + The Outbound Hop Count as copied from the IP Traceroute option of the packet which caused this Traceroute message to be sent. + + + + + The Return Hop Count as copied from the IP Traceroute option of the packet which caused this Traceroute message to be sent. + + + + + The speed, in OCTETS per second, of the link over which the Outbound/Return Packet will be sent. + Since it will not be long before network speeds exceed 4.3Gb/s, and since some machines deal poorly with fields longer than 32 bits, octets per second was chosen over bits per second. + If this value cannot be determined, the field should be set to zero. + + + + + The MTU, in bytes, of the link over which the Outbound/Return Packet will be sent. + MTU refers to the data portion (includes IP header; excludes datalink header/trailer) of the packet. + If this value cannot be determined, the field should be set to zero. + + + + + Is the packet an Outbound packet. + This is indicated by a value of 0xFFFF in the ReturnHopCount field. + + + + + The minimum valid ICMP code for this type of ICMP datagram. + + + + + The maximum valid ICMP code for this type of ICMP datagram. + + + + + RFC 1256. +
+            +-----+------+------+-----------+
+            | Bit | 0-7  | 8-15 | 16-31     |
+            +-----+------+------+-----------+
+            | 0   | Type | Code | Checksum  |
+            +-----+------+------+-----------+
+            | 32  | reserved                |
+            +-----+-------------------------+
+            
+
+
+ + + Creates a Layer that represents the datagram to be used with PacketBuilder. + + + + + RFC 2616. + The Transfer-Encoding general-header field indicates what (if any) type of transformation has been applied to the message body + in order to safely transfer it between the sender and the recipient. + This differs from the content-coding in that the transfer-coding is a property of the message, not of the entity. + +
+            Transfer-Encoding       = "Transfer-Encoding" ":" 1#transfer-coding
+            
+ + Example: + +
+            Transfer-Encoding: chunked
+            
+ + If multiple encodings have been applied to an entity, the transfer-codings MUST be listed in the order in which they were applied. + Additional information about the encoding parameters MAY be provided by other entity-header fields not defined by this specification. +
+
+ + + The field name. + + + + + The field name in uppercase. + + + + + Creates an HTTP transfer encoding field from a set of transfer codings. + + + + + Creates an HTTP transfer encoding field from a set of transfer codings. + + + + + True iff the two HTTP transfer encoding fields are of equal value. + Two HTTP transfer encoding fields are equal iff they have the same transfer codings. + + + + + True iff the two HTTP transfer encoding fields are of equal value. + Two HTTP transfer encoding fields are equal iff they have the same transfer codings. + + + + + Transfer-coding values are used to indicate an encoding transformation that has been, can be, + or may need to be applied to an entity-body in order to ensure "safe transport" through the network. + This differs from a content coding in that the transfer-coding is a property of the message, not of the original entity. + +
+            transfer-coding         = "chunked" | transfer-extension
+            transfer-extension      = token *( ";" parameter )
+            
+ + Parameters are in the form of attribute/value pairs. + +
+            parameter               = attribute "=" value
+            attribute               = token
+            value                   = token | quoted-string
+            
+ + All transfer-coding values are case-insensitive. + Whenever a transfer-coding is applied to a message-body, the set of transfer-codings MUST include "chunked", + unless the message is terminated by closing the connection. + When the "chunked" transfer-coding is used, it MUST be the last transfer-coding applied to the message-body. + The "chunked" transfer-coding MUST NOT be applied more than once to a message-body. + These rules allow the recipient to determine the transfer-length of the message. +
+
+ + + RFC 1702. + Represents a source route entry consisting of a list of Autonomous System numbers and indicates an AS source route. + + + + + Initializes using the given AS numbers and the next as number index. + + Autonomous System numbers of the source route. + The next AS number index in the source route. + + + + True iff the AS numbers are equal. + + + + + Writes the payload to the given buffer in the given offset. + + The buffer to write the payload to. + The offset in the buffer to start writing. + + + + The Address Family field contains a two octet value which indicates the syntax and semantics of the Routing Information field. + + + + + The SRE Length field contains the number of octets in the SRE. + + + + + The SRE Offset field indicates the octet offset from the start of the Routing Information field to the first octet of the active entry in Source Route Entry to be examined. + + + + + The xor of the hash code of the AS numbers. + + + + + Autonomous System numbers of the source route. + + + + + The next AS number index in the source route. + + + + + The next AS number. + + + + + The following is the packet structure used for ARP requests and replies. + On Ethernet networks, these packets use an EtherType of 0x0806, and are sent to the broadcast MAC address of FF:FF:FF:FF:FF:FF. + Note that the EtherType (0x0806) is used in the Ethernet header, and should not be used as the PTYPE of the ARP packet. + The ARP type (0x0806) should never be used in the PTYPE field of an ARP packet, since a hardware protocol address should never be linked to the ARP protocol. + Note that the packet structure shown in the table has SHA and THA as 48-bit fields and SPA and TPA as 32-bit fields but this is just for convenience — + their actual lengths are determined by the hardware & protocol length fields. +
+            +-----+------------------------+------------------------+-----------------------------------------------+
+            | bit | 0-7                    | 8-15                   | 16-31                                         |
+            +-----+------------------------+------------------------+-----------------------------------------------+
+            | 0   |	Hardware type (HTYPE)                           | Protocol type (PTYPE)                         |
+            +-----+------------------------+------------------------+-----------------------------------------------+
+            | 32  | Hardware length (HLEN) | Protocol length (PLEN) | Operation (OPER)                              |
+            +-----+------------------------+------------------------+-----------------------------------------------+
+            | 64  | Sender hardware address (SHA) (first 32 bits)                                                   |
+            +-----+-------------------------------------------------+-----------------------------------------------+
+            | 96  | Sender hardware address (SHA) (last 16 bits)    | Sender protocol address (SPA) (first 16 bits) |
+            +-----+-------------------------------------------------+-----------------------------------------------+
+            | 128 | Sender protocol address (SPA) (last 16 bits)    | Target hardware address (THA) (first 16 bits) |
+            +-----+-------------------------------------------------+-----------------------------------------------+
+            | 160 |	Target hardware address (THA) (last 32 bits)                                                    |
+            +-----+-------------------------------------------------------------------------------------------------+
+            | 192 | Target protocol address (TPA)                                                                   |
+            +-----+-------------------------------------------------------------------------------------------------+
+            
+
+
+ + + The number of bytes in the ARP header without the addresses (that vary in size). + + + + + Creates a Layer that represents the datagram to be used with PacketBuilder. + + + + + The datagram is valid if the length is correct according to the header. + + + + + The number of bytes in the ARP header. + + + + + Each data link layer protocol is assigned a number used in this field. + + + + + Each protocol is assigned a number used in this field. + + + + + Length in bytes of a hardware address. Ethernet addresses are 6 bytes long. + + + + + Length in bytes of a logical address. IPv4 address are 4 bytes long. + + + + + Specifies the operation the sender is performing. + + + + + Hardware address of the sender. + + + + + Protocol address of the sender. + + + + + Protocol IPv4 address of the sender. + + + + + Hardware address of the intended receiver. + This field is ignored in requests. + + + + + Protocol address of the intended receiver. + + + + + Protocol IPv4 address of the intended receiver. + + + + + CC Option (RFC 1644). +
+            +--------+--------+--------+--------+--------+--------+
+            |00001011|00000110|    Connection Count:  SEG.CC      |
+            +--------+--------+--------+--------+--------+--------+
+             Kind=11  Length=6
+            
+ + + This option may be sent in an initial SYN segment, and it may be sent in other segments if a CC or CC.NEW option + has been received for this incarnation of the connection. + Its SEG.CC value is the TCB.CCsend value from the sender's TCB. + +
+
+ + + Create a connection count tcp option by a given connection count. + + + + + The default connection count is 0. + + + + + Tries to read the option from a buffer starting from the option value (after the type and length). + + The buffer to read the option from. + The offset to the first byte to read the buffer. Will be incremented by the number of bytes read. + The number of bytes the option value should take according to the length field that was already read. + On success - the complex option read. On failure - null. + + + + Defines the possible quick start functions. + + + + + Request for a specific rate. + + + + + Reports on a specific rate that was agreed (or disagreed). + + + + + Fragmentation information flags for IPv4 datagram. + + + + + May Fragment, Last Fragment. + + + + + More Fragments. + + + + + Don't Fragment. + + + + + RFC 792 and RFC 1191. + + + + + + A sub-type of the message. Specific method of this message type. + + + + + The value of this field determines the format of the remaining data. + + + + + A sub-type of the message. Specific method of this message type. + + + + + The size in octets of the largest datagram that could be forwarded, + along the path of the original datagram, without being fragmented at this router. + The size includes the IP header and IP data, and does not include any lower-level headers. + + + + + A value that should be interpreted according to the specific message. + + + + + TCP Timestamps Option (TSopt): +
+            +-------+-------+---------------------+---------------------+
+            |Kind=8 |  10   |   TS Value (TSval)  |TS Echo Reply (TSecr)|
+            +-------+-------+---------------------+---------------------+
+                1       1              4                     4
+            
+ + + The Timestamps option carries two four-byte timestamp fields. + The Timestamp Value field (TSval) contains the current value of the timestamp clock of the TCP sending the option. + + + + The Timestamp Echo Reply field (TSecr) is only valid if the ACK bit is set in the TCP header; + if it is valid, it echos a timestamp value that was sent by the remote TCP in the TSval field of a Timestamps option. + When TSecr is not valid, its value must be zero. + The TSecr value will generally be from the most recent Timestamp option that was received; however, there are exceptions that are explained below. + + + + A TCP may send the Timestamps option (TSopt) in an initial <SYN> segment (i.e., segment containing a SYN bit and no ACK bit), + and may send a TSopt in other segments only if it received a TSopt in the initial <SYN> segment for the connection. + +
+
+ + + The number of bytes this option take. + + + + + The number of bytes this option value take. + + + + + Creates the option from the given timestamp value and echo reply. + + + + + The default values for the timestamp value and echo reply are 0. + + + + + Two timestamp options are equal if they have the same timestamp value and echo reply. + + + + + Two timestamp options are equal if they have the same timestamp value and echo reply. + + + + + The hash code of the timestamp option is the hash code of the option type xored with the hash code of the timestamp echo reply. + + + + + Tries to read the option from a buffer starting from the option value (after the type and length). + + The buffer to read the option from. + The offset to the first byte to read the buffer. Will be incremented by the number of bytes read. + The number of bytes the option value should take according to the length field that was already read. + On success - the complex option read. On failure - null. + + + + The timestamp value. + + + + + The echo reply value. + + + + + The number of bytes this option will take. + + + + + True iff this option may appear at most once in a datagram. + + + + + A simple TCP option - holds only the type. + + + + + The number of bytes this option will take. + + + + + The number of bytes this option will take. + + + + + True iff this option may appear at most once in a datagram. + + + + + Represents the time passed since midnight UT. + + + + + Create the time from milliseconds since midnight UT. + + + + + Create the time from TimeSpan since midnight UT. + + + + + Two times are equal if the have the exact same value. + + + + + Two times are equal if the have the exact same value. + + + + + Two times are equal if the have the exact same value. + + + + + Two times are different if the have different values. + + + + + The hash code of a time is the hash code of the milliseconds since midnight UT value. + + + + + Number of milliseconds passed since midnight UT. + + + + + Time passed since midnight UT. + + + + + Strict Source and Record Route +
+            +--------+--------+--------+---------//--------+
+            |10001001| length | pointer|     route data    |
+            +--------+--------+--------+---------//--------+
+             Type=137
+            
+ + + The strict source and record route (SSRR) option provides a means for the source of an internet datagram + to supply routing information to be used by the gateways in forwarding the datagram to the destination, + and to record the route information. + + + + The option begins with the option type code. + The second octet is the option length which includes the option type code and the length octet, + the pointer octet, and length-3 octets of route data. + The third octet is the pointer into the route data indicating the octet which begins the next source address to be processed. + The pointer is relative to this option, and the smallest legal value for the pointer is 4. + + + + A route data is composed of a series of internet addresses. + Each internet address is 32 bits or 4 octets. + If the pointer is greater than the length, the source route is empty (and the recorded route full) + and the routing is to be based on the destination address field. + + + + If the address in destination address field has been reached and the pointer is not greater than the length, + the next address in the source route replaces the address in the destination address field, + and the recorded route address replaces the source address just used, and pointer is increased by four. + + + + The recorded route address is the internet module's own internet address as known in the environment + into which this datagram is being forwarded. + + + + This procedure of replacing the source route with the recorded route + (though it is in the reverse of the order it must be in to be used as a source route) + means the option (and the IP header as a whole) remains a constant length as the datagram progresses through the internet. + + + + This option is a strict source route because the gateway or host IP + must send the datagram directly to the next address in the source route through only the directly connected network + indicated in the next address to reach the next gateway or host specified in the route. + + + + Must be copied on fragmentation. + Appears at most once in a datagram. + +
+
+ + + Create the option according to the given values. + + + + + Creates an empty strict source routing option. + + + + + Tries to read the option from a buffer starting from the option value (after the type and length). + + The buffer to read the option from. + The offset to the first byte to read the buffer. Will be incremented by the number of bytes read. + The number of bytes the option value should take according to the length field that was already read. + On success - the complex option read. On failure - null. + + + + Represents an IPv6 address. + + + + + The number of bytes the address take. + + + + + Create an address from a 128 bit integer. + 0 -> :: + 1 -> ::1 + 256 -> ::100 + + + + + Creates an address from an address string ("2001:0db8:0::22:1.2.3.4"). + + + + + Gets the address value as a 128 bit integer. + + + + + Two addresses are equal if the have the exact same value. + + + + + Two addresses are equal if the have the exact same value. + + + + + Two addresses are equal if the have the exact same value. + + + + + Two addresses are different if the have different values. + + + + + The hash code of an address is the hash code of its 128 bit integer value. + + + + + Translates the address to a string (0ABC:1234:5678:0443:0ABC:1234:5678:0443). + + + + + The zero address (::). + + + + + Each Group Record is a block of fields containing information pertaining + to the sender's membership in a single multicast group on the interface from which the Report is sent. + A Group Record has the following internal format: +
+            +-----+-------------+--------------+--------+--------------+
+            | Bit | 0-7         | 8-15         | 16-31  |              |
+            +-----+-------------+--------------+--------+--------------+
+            | 0   | Record Type | Aux Data Len | Number of Sources (N) |
+            +-----+-------------+--------------+--------+--------------+
+            | 32  | Multicast Address                                  |
+            +-----+----------------------------------------------------+
+            | 64  | Source Address [1]                                 |
+            +-----+----------------------------------------------------+
+            | 96  | Source Address [2]                                 |
+            +-----+----------------------------------------------------+
+            .     .                         .                          .
+            .     .                         .                          .
+            +-----+----------------------------------------------------+
+            | 32  | Source Address [N]                                 |
+            | +   |                                                    |
+            | 32N |                                                    |
+            +-----+----------------------------------------------------+
+            | 64  | Auxiliary Data                                     |
+            . +   .                                                    .
+            . 32N .                                                    .
+            .     .                                                    .
+            |     |                                                    |
+            +-----+----------------------------------------------------+
+            
+
+
+ + + The number of bytes the group record header takes (without the source addresses and auxiliary data). + + + + + Creates an IGMP group record from the given datagram. + Useful to create a new IGMP packet with group records. + + + + + The record is valid if the length is correct according to the header fields. + + + + + The type of group record included in the report message. + + + + + The Aux Data Len field contains the length of the Auxiliary Data field in this Group Record, in bytes (after a translation from 32 bit words length). + It may contain zero, to indicate the absence of any auxiliary data. + + + + + The Number of Sources (N) field specifies how many source addresses are present in this Group Record. + + + + + The Multicast Address field contains the IP multicast address to which this Group Record pertains. + + + + + The Source Address [i] fields are a vector of n IP unicast addresses, + where n is the value in this record's Number of Sources (N) field. + + + + + The Auxiliary Data field, if present, contains additional information pertaining to this Group Record. + The protocol specified in this document, IGMPv3, does not define any auxiliary data. + Therefore, implementations of IGMPv3 MUST NOT include any auxiliary data (i.e., MUST set the Aux Data Len field to zero) in any transmitted Group Record, + and MUST ignore any auxiliary data present in any received Group Record. + The semantics and internal encoding of the Auxiliary Data field are to be defined by any future version or extension of IGMP that uses this field. + + + + + RFC 1256. + Represents an entry in Router Advertisement ICMP message. + + + + + Creates an instance using the given router address and preference. + + The sending router's IP address(es) on the interface from which this message is sent. + The preferability of each Router Address[i] as a default router address, relative to other router addresses on the same subnet. A signed, twos-complement value; higher values mean more preferable. + + + + Two entries are equal if they have the same router address and preference. + + + + + Two entries are equal if they have the same router address and preference. + + + + + A xor of the hash codes of the router address and preference. + + + + + The sending router's IP address(es) on the interface from which this message is sent. + + + + + The preferability of each Router Address[i] as a default router address, relative to other router addresses on the same subnet. A signed, twos-complement value; higher values mean more preferable. + + + + + RFC 2616. + Represents an HTTP request layer. + + + + + Two HTTP Request layers are equal iff they have the same version, header, body, method and uri. + + + + + Two HTTP Request layers are equal iff they have the same version, header, body, method and uri. + + + + + True since the message is a request. + + + + + The HTTP Request Method. + + + + + The HTTP Request URI. + + + + + Represents the DataLink type. + + + + + Create the DataLink from a kind. + + + + + Two DataLinks are equal if they are of the same kind. + + + + + Two DataLinks are equal if they are of the same type and the same kind. + + + + + Two DataLinks are equal if they are of the same kind. + + + + + Two DataLinks are different if they have different kinds. + + + + + The hash code of the datalink is the hash code of its kind. + + + + + The string is the kind's string. + + + + + Etherent DataLink. + + + + + The kind of the DataLink. + + + + + Window Scale Option (RFC 1323) + The three-byte Window Scale option may be sent in a SYN segment by a TCP. + It has two purposes: (1) indicate that the TCP is prepared to do both send and receive window scaling, + and (2) communicate a scale factor to be applied to its receive window. + Thus, a TCP that is prepared to scale windows should send the option, even if its own scale factor is 1. + The scale factor is limited to a power of two and encoded logarithmically, so it may be implemented by binary shift operations. + +
+            +---------+---------+---------+
+            | Kind=3  |Length=3 |shift.cnt|
+            +---------+---------+---------+
+            
+ + + This option is an offer, not a promise; both sides must send Window Scale options in their SYN segments to enable window scaling in either direction. + If window scaling is enabled, then the TCP that sent this option will right-shift its true receive-window values by 'shift.cnt' bits + for transmission in SEG.WND. + The value 'shift.cnt' may be zero (offering to scale, while applying a scale factor of 1 to the receive window). + + + + This option may be sent in an initial SYN segment (i.e., a segment with the SYN bit on and the ACK bit off). + It may also be sent in a SYN,ACK segment, but only if a Window Scale option was received in the initial SYN segment. + A Window Scale option in a segment without a SYN bit should be ignored. + + + + The Window field in a SYN (i.e., a SYN or SYN,ACK) segment itself is never scaled. + +
+
+ + + The number of bytes this option take. + + + + + The number of bytes this option value take. + + + + + Create a scale factor option using the given scale factor log. + + + + + The default scale factor log is 0 (scale factor is 1). + + + + + Two window scale options are equal if they have the same scale factor. + + + + + Two window scale options are equal if they have the same scale factor. + + + + + The hash code of the window scale option is the hash code of the option type xored with the hash code of the scale factor log. + + + + + + Tries to read the option from a buffer starting from the option value (after the type and length). + + The buffer to read the option from. + The offset to the first byte to read the buffer. Will be incremented by the number of bytes read. + The number of bytes the option value should take according to the length field that was already read. + On success - the complex option read. On failure - null. + + + + The log of the window scale factor. + + + + + The number of bytes this option will take. + + + + + True iff this option may appear at most once in a datagram. + + + + + Represents a block to ack when using the selective ack option. + + + + + The number of bytes this struct take. + + + + + Creates a selective ack block. + + The sequence number of the first byte to ack. + The sequence number of the byte after the last byte to ack. + + + + Creates a string that represents the selective block. + + + + + Two blocks are equal if the have the same left and right edges. + + + + + Two blocks are equal if the have the same left and right edges. + + + + + Two blocks are equal if the have the same left and right edges. + + + + + Two blocks are different if the have the different left or right edge. + + + + + The hash code of a block is the xor between the hash code of left and right edges. + + + + + The sequence number of the first byte to ack. + + + + + The sequence number of the byte after the last byte to ack. + + + + + The Router Alert option has the semantic "routers should examine this packet more closely". + By including the Router Alert option in the IP header of its protocol message, + RSVP can cause the message to be intercepted while causing little or no performance + penalty on the forwarding of normal data packets. + + + Routers that support option processing in the fast path already demultiplex processing based on the option type field. + If all option types are supported in the fast path, then the addition of another option type to process is unlikely to impact performance. + If some option types are not supported in the fast path, + this new option type will be unrecognized and cause packets carrying it to be kicked out into the slow path, + so no change to the fast path is necessary, and no performance penalty will be incurred for regular data packets. + + + + Routers that do not support option processing in the fast path will cause packets carrying this new option + to be forwarded through the slow path, so no change to the fast path is necessary and no performance penalty + will be incurred for regular data packets. + + + + The Router Alert option has the following format: +
+            +--------+--------+--------+--------+
+            |10010100|00000100|  2 octet value  |
+            +--------+--------+--------+--------+
+            
+
+
+
+ + + The number of bytes this option take. + + + + + The number of bytes this option's value take. + + + + + Create the option according to the given value. + + + + + Creates a 0 value router alert option + + + + + Two stream identifier options are equal if they have the same identifier. + + + + + Two stream identifier options are equal if they have the same identifier. + + + + + The hash code value is the xor of the base class hash code and the value hash code. + + + + + Tries to read the option from a buffer starting from the option value (after the type and length). + + The buffer to read the option from. + The offset to the first byte to read the buffer. Will be incremented by the number of bytes read. + The number of bytes the option value should take according to the length field that was already read. + On success - the complex option read. On failure - null. + + + + The value of the alert. + + + + + The number of bytes this option will take. + + + + + True iff this option may appear at most once in a datagram. + + + + + RFC 2236. + + + + + The type of the IGMP message of concern to the host-router interaction. + + + + + The IGMP version of a Membership Query message. + If the type is not a query, None will be returned. + + + + + The different ICMP message types. + + + + + RFC 792. + + The data received in the echo message must be returned in the echo reply message. + + + + The identifier and sequence number may be used by the echo sender to aid in matching the replies with the echo requests. + For example, the identifier might be used like a port in TCP or UDP to identify a session, and the sequence number might be incremented on each echo request sent. + The echoer returns these same values in the echo reply. + + + + Code 0 may be received from a gateway or a host. + + + + + + RFC 792 + + + If, according to the information in the gateway's routing tables, + the network specified in the internet destination field of a datagram is unreachable, e.g., the distance to the network is infinity, + the gateway may send a destination unreachable message to the internet source host of the datagram. + In addition, in some networks, the gateway may be able to determine if the internet destination host is unreachable. + Gateways in these networks may send destination unreachable messages to the source host when the destination host is unreachable. + + + + If, in the destination host, the IP module cannot deliver the datagram because the indicated protocol module or process port is not active, + the destination host may send a destination unreachable message to the source host. + + + + Another case is when a datagram must be fragmented to be forwarded by a gateway yet the Don't Fragment flag is on. + In this case the gateway must discard the datagram and may return a destination unreachable message. + + + + Codes 0, 1, 4, and 5 may be received from a gateway. + Codes 2 and 3 may be received from a host. + + + + + + RFC 792. + + + A gateway may discard internet datagrams if it does not have the buffer space needed to queue the datagrams for output to the next network on the route to the destination network. + If a gateway discards a datagram, it may send a source quench message to the internet source host of the datagram. + A destination host may also send a source quench message if datagrams arrive too fast to be processed. + The source quench message is a request to the host to cut back the rate at which it is sending traffic to the internet destination. + The gateway may send a source quench message for every message that it discards. + On receipt of a source quench message, the source host should cut back the rate at which it is sending traffic to the specified destination + until it no longer receives source quench messages from the gateway. + The source host can then gradually increase the rate at which it sends traffic to the destination until it again receives source quench messages. + + + + The gateway or host may send the source quench message when it approaches its capacity limit rather than waiting until the capacity is exceeded. + This means that the data datagram which triggered the source quench message may be delivered. + + + + Code 0 may be received from a gateway or a host. + + + + + + RFC 792. + + + The gateway sends a redirect message to a host in the following situation. + A gateway, G1, receives an internet datagram from a host on a network to which the gateway is attached. + The gateway, G1, checks its routing table and obtains the address of the next gateway, G2, on the route to the datagram's internet destination network, X. + If G2 and the host identified by the internet source address of the datagram are on the same network, a redirect message is sent to the host. + The redirect message advises the host to send its traffic for network X directly to gateway G2 as this is a shorter path to the destination. + The gateway forwards the original datagram's data to its internet destination. + + + + For datagrams with the IP source route options and the gateway address in the destination address field, + a redirect message is not sent even if there is a better route to the ultimate destination than the next address in the source route. + + + + Codes 0, 1, 2, and 3 may be received from a gateway. + + + + + + RFC 792. + + The data received in the echo message must be returned in the echo reply message. + + + + The identifier and sequence number may be used by the echo sender to aid in matching the replies with the echo requests. + For example, the identifier might be used like a port in TCP or UDP to identify a session, and the sequence number might be incremented on each echo request sent. + The echoer returns these same values in the echo reply. + + + + Code 0 may be received from a gateway or a host. + + + + + + RFC 1256. + + + + + RFC 1256. + + + + + RFC 792. + + + If the gateway processing a datagram finds the time to live field is zero it must discard the datagram. + The gateway may also notify the source host via the time exceeded message. + + + + If a host reassembling a fragmented datagram cannot complete the reassembly due to missing fragments within its time limit it discards the datagram, + and it may send a time exceeded message. + If fragment zero is not available then no time exceeded need be sent at all. + + + + Code 0 may be received from a gateway. + Code 1 may be received from a host. + + + + + + RFC 792. + + + If the gateway or host processing a datagram finds a problem with the header parameters such that it cannot complete processing the datagram it must discard the datagram. + One potential source of such a problem is with incorrect arguments in an option. + The gateway or host may also notify the source host via the parameter problem message. + This message is only sent if the error caused the datagram to be discarded. + + + + Code 0 may be received from a gateway or a host. + + + + + + RFC 792 + + The data received (a timestamp) in the message is returned in the reply together with an additional timestamp. + The timestamp is 32 bits of milliseconds since midnight UT. + + + + If the time is not available in miliseconds or cannot be provided with respect to midnight UT + then any time can be inserted in a timestamp provided the high order bit of the timestamp is also set to indicate this non-standard value. + + + + The identifier and sequence number may be used by the echo sender to aid in matching the replies with the requests. + For example, the identifier might be used like a port in TCP or UDP to identify a session, and the sequence number might be incremented on each request sent. + The destination returns these same values in the reply. + + + + Code 0 may be received from a gateway or a host. + + + + + + RFC 792 + + The data received (a timestamp) in the message is returned in the reply together with an additional timestamp. + The timestamp is 32 bits of milliseconds since midnight UT. + + + + If the time is not available in miliseconds or cannot be provided with respect to midnight UT + then any time can be inserted in a timestamp provided the high order bit of the timestamp is also set to indicate this non-standard value. + + + + The identifier and sequence number may be used by the echo sender to aid in matching the replies with the requests. + For example, the identifier might be used like a port in TCP or UDP to identify a session, and the sequence number might be incremented on each request sent. + The destination returns these same values in the reply. + + + + Code 0 may be received from a gateway or a host. + + + + + + RFC 792. + + This message may be sent with the source network in the IP header source and destination address fields zero (which means "this" network). + The replying IP module should send the reply with the addresses fully specified. + This message is a way for a host to find out the number of the network it is on. + + + + The identifier and sequence number may be used by the echo sender to aid in matching the replies with the requests. + For example, the identifier might be used like a port in TCP or UDP to identify a session, and the sequence number might be incremented on each request sent. + The destination returns these same values in the reply. + + + + Code 0 may be received from a gateway or a host. + + + + + + RFC 792. + + This message may be sent with the source network in the IP header source and destination address fields zero (which means "this" network). + The replying IP module should send the reply with the addresses fully specified. + This message is a way for a host to find out the number of the network it is on. + + + + The identifier and sequence number may be used by the echo sender to aid in matching the replies with the requests. + For example, the identifier might be used like a port in TCP or UDP to identify a session, and the sequence number might be incremented on each request sent. + The destination returns these same values in the reply. + + + + Code 0 may be received from a gateway or a host. + + + + + + RFC 950. + + + A gateway receiving an address mask request should return it with the address mask field set to the 32-bit mask of the bits identifying the subnet and network, + for the subnet on which the request was received. + + + + If the requesting host does not know its own IP address, it may leave the source field zero; the reply should then be broadcast. + However, this approach should be avoided if at all possible, since it increases the superfluous broadcast load on the network. + Even when the replies are broadcast, since there is only one possible address mask for a subnet, there is no need to match requests with replies. + The "Identifier" and "Sequence Number" fields can be ignored. + + + + + + RFC 950. + + + A gateway receiving an address mask request should return it with the address mask field set to the 32-bit mask of the bits identifying the subnet and network, + for the subnet on which the request was received. + + + + If the requesting host does not know its own IP address, it may leave the source field zero; the reply should then be broadcast. + However, this approach should be avoided if at all possible, since it increases the superfluous broadcast load on the network. + Even when the replies are broadcast, since there is only one possible address mask for a subnet, there is no need to match requests with replies. + The "Identifier" and "Sequence Number" fields can be ignored. + + + + + + RFC 1393. + + + + + RFC 1475. + The introduction of network layer conversion requires a new message type, to report conversion errors. + Note that an invalid datagram should result in the sending of some other ICMP message (e.g., parameter problem) or the silent discarding of the datagram. + This message is only sent when a valid datagram cannot be converted. + + + + + RFC 1788. + + + + + RFC 1788. + Parsing of this datagram isn't supported because its parsing is not clear from the RFC. + + + + + RFC 2521. + + + + + RFC 792. +
+            +-----+------+------+-----------------+
+            | Bit | 0-7  | 8-15 | 16-31           |
+            +-----+------+------+-----------------+
+            | 0   | Type | Code | Checksum        |
+            +-----+------+------+-----------------+
+            | 32  | Identifier  | Sequence Number |
+            +-----+-------------+-----------------+
+            
+
+
+ + + Creates a Layer that represents the datagram to be used with PacketBuilder. + + + + + Known HTTP request method. + RFC 2616. + + + + + RFC 2616. + + The OPTIONS method represents a request for information about the communication options available on the request/response chain identified by the Request-URI. + This method allows the client to determine the options and/or requirements associated with a resource, or the capabilities of a server, without implying a resource action or initiating a resource retrieval. + + + Responses to this method are not cacheable. + + + If the OPTIONS request includes an entity-body (as indicated by the presence of Content-Length or Transfer-Encoding), + then the media type MUST be indicated by a Content-Type field. + Although this specification does not define any use for such a body, future extensions to HTTP might use the OPTIONS body to make more detailed queries on the server. + A server that does not support such an extension MAY discard the request body. + + + If the Request-URI is an asterisk ("*"), the OPTIONS request is intended to apply to the server in general rather than to a specific resource. + Since a server's communication options typically depend on the resource, the "*" request is only useful as a "ping" or "no-op" type of method; + it does nothing beyond allowing the client to test the capabilities of the server. + For example, this can be used to test a proxy for HTTP/1.1 compliance (or lack thereof). + + + If the Request-URI is not an asterisk, the OPTIONS request applies only to the options that are available when communicating with that resource. + + + A 200 response SHOULD include any header fields that indicate optional features implemented by the server and applicable to that resource (e.g., Allow), + possibly including extensions not defined by this specification. + The response body, if any, SHOULD also include information about the communication options. + The format for such a body is not defined by this specification, but might be defined by future extensions to HTTP. + Content negotiation MAY be used to select the appropriate response format. If no response body is included, the response MUST include a Content-Length field with a field-value of "0". + + + The Max-Forwards request-header field MAY be used to target a specific proxy in the request chain. + When a proxy receives an OPTIONS request on an absoluteURI for which request forwarding is permitted, the proxy MUST check for a Max-Forwards field. + If the Max-Forwards field-value is zero ("0"), the proxy MUST NOT forward the message; instead, the proxy SHOULD respond with its own communication options. + If the Max-Forwards field-value is an integer greater than zero, the proxy MUST decrement the field-value when it forwards the request. + If no Max-Forwards field is present in the request, then the forwarded request MUST NOT include a Max-Forwards field. + + + + + + RFC 2616. + + The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. + If the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the entity in the response and not the source text of the process, + unless that text happens to be the output of the process. + + + The semantics of the GET method change to a "conditional GET" if the request message includes an If-Modified-Since, If-Unmodified-Since, If-Match, If-None-Match, or If-Range header field. + A conditional GET method requests that the entity be transferred only under the circumstances described by the conditional header field(s). + The conditional GET method is intended to reduce unnecessary network usage by allowing cached entities to be refreshed without requiring multiple requests or transferring data already held by the client. + + + The semantics of the GET method change to a "partial GET" if the request message includes a Range header field. + A partial GET requests that only part of the entity be transferred. + The partial GET method is intended to reduce unnecessary network usage by allowing partially-retrieved entities to be completed without transferring data already held by the client. + + + The response to a GET request is cacheable if and only if it meets the requirements for HTTP caching. + + + + + + RFC 2616. + + The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. + The metainformation contained in the HTTP headers in response to a HEAD request SHOULD be identical to the information sent in response to a GET request. + This method can be used for obtaining metainformation about the entity implied by the request without transferring the entity-body itself. + This method is often used for testing hypertext links for validity, accessibility, and recent modification. + + + The response to a HEAD request MAY be cacheable in the sense that the information contained in the response MAY be used to update a previously cached entity from that resource. + If the new field values indicate that the cached entity differs from the current entity (as would be indicated by a change in Content-Length, Content-MD5, ETag or Last-Modified), + then the cache MUST treat the cache entry as stale. + + + + + + RFC 2616. + + The POST method is used to request that the origin server accept the entity enclosed in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line. + POST is designed to allow a uniform method to cover the following functions: + + Annotation of existing resources; + Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles; + Providing a block of data, such as the result of submitting a form, to a data-handling process; + Extending a database through an append operation. + + + + The actual function performed by the POST method is determined by the server and is usually dependent on the Request-URI. + The posted entity is subordinate to that URI in the same way that a file is subordinate to a directory containing it, + a news article is subordinate to a newsgroup to which it is posted, or a record is subordinate to a database. + + + The action performed by the POST method might not result in a resource that can be identified by a URI. In this case, either 200 (OK) or 204 (No Content) is the appropriate response status, + depending on whether or not the response includes an entity that describes the result. + + + If a resource has been created on the origin server, + the response SHOULD be 201 (Created) and contain an entity which describes the status of the request and refers to the new resource, and a Location header. + + + Responses to this method are not cacheable, unless the response includes appropriate Cache-Control or Expires header fields. + However, the 303 (See Other) response can be used to direct the user agent to retrieve a cacheable resource. + + + POST requests MUST obey the message transmission requirements. + + + + + + RFC 2616. + + The PUT method requests that the enclosed entity be stored under the supplied Request-URI. + If the Request-URI refers to an already existing resource, the enclosed entity SHOULD be considered as a modified version of the one residing on the origin server. + If the Request-URI does not point to an existing resource, and that URI is capable of being defined as a new resource by the requesting user agent, the origin server can create the resource with that URI. + If a new resource is created, the origin server MUST inform the user agent via the 201 (Created) response. + If an existing resource is modified, either the 200 (OK) or 204 (No Content) response codes SHOULD be sent to indicate successful completion of the request. + If the resource could not be created or modified with the Request-URI, an appropriate error response SHOULD be given that reflects the nature of the problem. + The recipient of the entity MUST NOT ignore any Content-* (e.g. Content-Range) headers that it does not understand or implement and MUST return a 501 (Not Implemented) response in such cases. + + + If the request passes through a cache and the Request-URI identifies one or more currently cached entities, those entries SHOULD be treated as stale. + Responses to this method are not cacheable. + + + The fundamental difference between the POST and PUT requests is reflected in the different meaning of the Request-URI. + The URI in a POST request identifies the resource that will handle the enclosed entity. + That resource might be a data-accepting process, a gateway to some other protocol, or a separate entity that accepts annotations. + In contrast, the URI in a PUT request identifies the entity enclosed with the request -- the user agent knows what URI is intended and the server MUST NOT attempt to apply the request to some other resource. + If the server desires that the request be applied to a different URI, it MUST send a 301 (Moved Permanently) response; + the user agent MAY then make its own decision regarding whether or not to redirect the request. + + + A single resource MAY be identified by many different URIs. + For example, an article might have a URI for identifying "the current version" which is separate from the URI identifying each particular version. + In this case, a PUT request on a general URI might result in several other URIs being defined by the origin server. + + + HTTP/1.1 does not define how a PUT method affects the state of an origin server. + + + PUT requests MUST obey the message transmission requirements. + + + Unless otherwise specified for a particular entity-header, the entity-headers in the PUT request SHOULD be applied to the resource created or modified by the PUT. + + + + + + RFC 2616. + + The DELETE method requests that the origin server delete the resource identified by the Request-URI. + This method MAY be overridden by human intervention (or other means) on the origin server. + The client cannot be guaranteed that the operation has been carried out, even if the status code returned from the origin server indicates that the action has been completed successfully. + However, the server SHOULD NOT indicate success unless, at the time the response is given, it intends to delete the resource or move it to an inaccessible location. + + + A successful response SHOULD be 200 (OK) if the response includes an entity describing the status, 202 (Accepted) if the action has not yet been enacted, + or 204 (No Content) if the action has been enacted but the response does not include an entity. + + + If the request passes through a cache and the Request-URI identifies one or more currently cached entities, those entries SHOULD be treated as stale. + Responses to this method are not cacheable. + + + + + + RFC 2616. + + The TRACE method is used to invoke a remote, application-layer loop-back of the request message. + The final recipient of the request SHOULD reflect the message received back to the client as the entity-body of a 200 (OK) response. + The final recipient is either the origin server or the first proxy or gateway to receive a Max-Forwards value of zero (0) in the request (see section 14.31). + A TRACE request MUST NOT include an entity. + + + TRACE allows the client to see what is being received at the other end of the request chain and use that data for testing or diagnostic information. + The value of the Via header field is of particular interest, since it acts as a trace of the request chain. + Use of the Max-Forwards header field allows the client to limit the length of the request chain, which is useful for testing a chain of proxies forwarding messages in an infinite loop. + + + If the request is valid, the response SHOULD contain the entire request message in the entity-body, with a Content-Type of "message/http". + Responses to this method MUST NOT be cached. + + + + + + RFC 2616. + + This specification reserves the method name CONNECT for use with a proxy that can dynamically switch to being a tunnel (e.g. SSL tunneling). + + + + + + Unknown request method. + + +
+
diff --git a/dep/pcapnet/PcapDotNet.Packets.dll b/dep/pcapnet/PcapDotNet.Packets.dll new file mode 100644 index 00000000..1c166e16 Binary files /dev/null and b/dep/pcapnet/PcapDotNet.Packets.dll differ diff --git a/dep/powercollections/PowerCollections.License b/dep/powercollections/PowerCollections.License new file mode 100644 index 00000000..cfa5e788 --- /dev/null +++ b/dep/powercollections/PowerCollections.License @@ -0,0 +1,87 @@ +Shared Source License for Wintellect Power Collections + +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + +1. DEFINITIONS + +"Contribution" means: + +a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and + +b) in the case of each subsequent Contributor: + +i) changes to the Program, and + +ii) additions to the Program; + +where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. + +"Contributor" means any person or entity that distributes the Program. + +"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. + +"Program" means the Contributions distributed in accordance with this Agreement. + +"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. + +2. GRANT OF RIGHTS + +a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. + +b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. + +c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. + +d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. + +3. REQUIREMENTS + +A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: + +a) it complies with the terms and conditions of this Agreement; and + +b) its license agreement: + +i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; + +ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; + +iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and + +iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. + +When the Program is made available in source code form: + +a) it must be made available under this Agreement; and + +b) a copy of this Agreement must be included with each copy of the Program. + +Contributors may not remove or alter any copyright notices contained within the Program. + +Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. + +4. COMMERCIAL DISTRIBUTION + +Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. + +For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. + +5. NO WARRANTY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. + +6. DISCLAIMER OF LIABILITY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), 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 OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. GENERAL + +If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. + +If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. + +All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. + +Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. + +This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. \ No newline at end of file diff --git a/dep/powercollections/PowerCollections.XML b/dep/powercollections/PowerCollections.XML new file mode 100644 index 00000000..e2bafa40 --- /dev/null +++ b/dep/powercollections/PowerCollections.XML @@ -0,0 +1,11141 @@ + + + + PowerCollections + + + + + Stores a pair of objects within a single struct. This struct is useful to use as the + T of a collection, or as the TKey or TValue of a dictionary. + + + + + Comparers for the first and second type that are used to compare + values. + + + + + The first element of the pair. + + + + + The second element of the pair. + + + + + Creates a new pair with given first and second elements. + + The first element of the pair. + The second element of the pair. + + + + Creates a new pair using elements from a KeyValuePair structure. The + First element gets the Key, and the Second elements gets the Value. + + The KeyValuePair to initialize the Pair with . + + + + Determines if this pair is equal to another object. The pair is equal to another object + if that object is a Pair, both element types are the same, and the first and second elements + both compare equal using object.Equals. + + Object to compare for equality. + True if the objects are equal. False if the objects are not equal. + + + + Determines if this pair is equal to another pair. The pair is equal if the first and second elements + both compare equal using IComparable<T>.Equals or object.Equals. + + Pair to compare with for equality. + True if the pairs are equal. False if the pairs are not equal. + + + + Returns a hash code for the pair, suitable for use in a hash-table or other hashed collection. + Two pairs that compare equal (using Equals) will have the same hash code. The hash code for + the pair is derived by combining the hash codes for each of the two elements of the pair. + + The hash code. + + + + Compares this pair to another pair of the some type. The pairs are compared by using + the IComparable<T> or IComparable interface on TFirst and TSecond. The pairs + are compared by their first elements first, if their first elements are equal, then they + are compared by their second elements. + If either TFirst or TSecond does not implement IComparable<T> or IComparable, then + an NotSupportedException is thrown, because the pairs cannot be compared. + + The pair to compare to. + An integer indicating how this pair compares to . Less + than zero indicates this pair is less than . Zero indicate this pair is + equals to . Greater than zero indicates this pair is greater than + . + Either FirstSecond or TSecond is not comparable + via the IComparable<T> or IComparable interfaces. + + + + Compares this pair to another pair of the some type. The pairs are compared by using + the IComparable<T> or IComparable interface on TFirst and TSecond. The pairs + are compared by their first elements first, if their first elements are equal, then they + are compared by their second elements. + If either TFirst or TSecond does not implement IComparable<T> or IComparable, then + an NotSupportedException is thrown, because the pairs cannot be compared. + + The pair to compare to. + An integer indicating how this pair compares to . Less + than zero indicates this pair is less than . Zero indicate this pair is + equals to . Greater than zero indicates this pair is greater than + . + is not of the correct type. + Either FirstSecond or TSecond is not comparable + via the IComparable<T> or IComparable interfaces. + + + + Returns a string representation of the pair. The string representation of the pair is + of the form: + First: {0}, Second: {1} + where {0} is the result of First.ToString(), and {1} is the result of Second.ToString() (or + "null" if they are null.) + + The string representation of the pair. + + + + Determines if two pairs are equal. Two pairs are equal if the first and second elements + both compare equal using IComparable<T>.Equals or object.Equals. + + First pair to compare. + Second pair to compare. + True if the pairs are equal. False if the pairs are not equal. + + + + Determines if two pairs are not equal. Two pairs are equal if the first and second elements + both compare equal using IComparable<T>.Equals or object.Equals. + + First pair to compare. + Second pair to compare. + True if the pairs are not equal. False if the pairs are equal. + + + + Converts a Pair to a KeyValuePair. The Key part of the KeyValuePair gets + the First element, and the Value part of the KeyValuePair gets the Second + elements. + + Pair to convert. + The KeyValuePair created from . + + + + Converts this Pair to a KeyValuePair. The Key part of the KeyValuePair gets + the First element, and the Value part of the KeyValuePair gets the Second + elements. + + The KeyValuePair created from this Pair. + + + + Converts a KeyValuePair structure into a Pair. The + First element gets the Key, and the Second element gets the Value. + + The KeyValuePair to convert. + The Pair created by converted the KeyValuePair into a Pair. + + + + OrderedDictionary<TKey, TValue> is a collection that maps keys of type TKey + to values of type TValue. The keys are maintained in a sorted order, and at most one value + is permitted for each key. + + +

The keys are compared in one of three ways. If TKey implements IComparable<TKey> or IComparable, + then the CompareTo method of that interface will be used to compare elements. Alternatively, a comparison + function can be passed in either as a delegate, or as an instance of IComparer<TKey>.

+

OrderedDictionary is implemented as a balanced binary tree. Inserting, deleting, and looking up an + an element all are done in log(N) type, where N is the number of keys in the tree.

+

is similar, but uses hashing instead of comparison, and does not maintain + the keys in sorted order.

+
+ +
+ + + DictionaryBase is a base class that can be used to more easily implement the + generic IDictionary<T> and non-generic IDictionary interfaces. + + + To use DictionaryBase as a base class, the derived class must override + Count, GetEnumerator, TryGetValue, Clear, Remove, and the indexer set accessor. + + The key type of the dictionary. + The value type of the dictionary. + + + + CollectionBase is a base class that can be used to more easily implement the + generic ICollection<T> and non-generic ICollection interfaces. + + + To use CollectionBase as a base class, the derived class must override + the Count, GetEnumerator, Add, Clear, and Remove methods. + ICollection<T>.Contains need not be implemented by the + derived class, but it should be strongly considered, because the CollectionBase implementation + may not be very efficient. + + The item type of the collection. + + + + Creates a new CollectionBase. + + + + + Shows the string representation of the collection. The string representation contains + a list of the items in the collection. Contained collections (except string) are expanded + recursively. + + The string representation of the collection. + + + + Must be overridden to allow adding items to this collection. + +

This method is not abstract, although derived classes should always + override it. It is not abstract because some derived classes may wish to reimplement + Add with a different return type (typically bool). In C#, this can be accomplished + with code like the following:

+ + public class MyCollection<T>: CollectionBase<T>, ICollection<T> + { + public new bool Add(T item) { + /* Add the item */ + } + + void ICollection<T>.Add(T item) { + Add(item); + } + } + +
+ Item to be added to the collection. + Always throws this exception to indicated + that the method must be overridden or re-implemented in the derived class. +
+ + + Must be overridden to allow clearing this collection. + + + + + Must be overridden to allow removing items from this collection. + + True if existed in the collection and + was removed. False if did not exist in the collection. + + + + Determines if the collection contains a particular item. This default implementation + iterates all of the items in the collection via GetEnumerator, testing each item + against using IComparable<T>.Equals or + Object.Equals. + + You should strongly consider overriding this method to provide + a more efficient implementation, or if the default equality comparison + is inappropriate. + The item to check for in the collection. + True if the collection contains , false otherwise. + + + + Copies all the items in the collection into an array. Implemented by + using the enumerator returned from GetEnumerator to get all the items + and copy them to the provided array. + + Array to copy to. + Starting index in to copy to. + + + + Creates an array of the correct size, and copies all the items in the + collection into the array, by calling CopyTo. + + An array containing all the elements in the collection, in order. + + + + Provides a read-only view of this collection. The returned ICollection<T> provides + a view of the collection that prevents modifications to the collection. Use the method to provide + access to the collection without allowing changes. Since the returned object is just a view, + changes to the collection will be reflected in the view. + + An ICollection<T> that provides read-only access to the collection. + + + + Determines if the collection contains any item that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + True if the collection contains one or more items that satisfy the condition + defined by . False if the collection does not contain + an item that satisfies . + + + + Determines if all of the items in the collection satisfy the condition + defined by . + + A delegate that defines the condition to check for. + True if all of the items in the collection satisfy the condition + defined by , or if the collection is empty. False if one or more items + in the collection do not satisfy . + + + + Counts the number of items in the collection that satisfy the condition + defined by . + + A delegate that defines the condition to check for. + The number of items in the collection that satisfy . + + + + Enumerates the items in the collection that satisfy the condition defined + by . + + A delegate that defines the condition to check for. + An IEnumerable<T> that enumerates the items that satisfy the condition. + + + + Removes all the items in the collection that satisfy the condition + defined by . + + A delegate that defines the condition to check for. + Returns a collection of the items that were removed, in sorted order. + + + + Performs the specified action on each item in this collection. + + An Action delegate which is invoked for each item in this collection. + + + + Convert this collection of items by applying a delegate to each item in the collection. The resulting enumeration + contains the result of applying to each item in this collection, in + order. + + The type each item is being converted to. + A delegate to the method to call, passing each item in this collection. + An IEnumerable<TOutput^gt; that enumerates the resulting collection from applying to each item in this collection in + order. + is null. + + + + Must be overridden to enumerate all the members of the collection. + + A generic IEnumerator<T> that can be used + to enumerate all the items in the collection. + + + + Copies all the items in the collection into an array. Implemented by + using the enumerator returned from GetEnumerator to get all the items + and copy them to the provided array. + + Array to copy to. + Starting index in to copy to. + + + + Provides an IEnumerator that can be used to iterate all the members of the + collection. This implementation uses the IEnumerator<T> that was overridden + by the derived classes to enumerate the members of the collection. + + An IEnumerator that can be used to iterate the collection. + + + + Display the contents of the collection in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + Must be overridden to provide the number of items in the collection. + + The number of items in the collection. + + + + Indicates whether the collection is read-only. Always returns false. + + Always returns false. + + + + Indicates whether the collection is synchronized. + + Always returns false, indicating that the collection is not synchronized. + + + + Indicates the synchronization object for this collection. + + Always returns this. + + + + Creates a new DictionaryBase. + + + + + Clears the dictionary. This method must be overridden in the derived class. + + + + + Removes a key from the dictionary. This method must be overridden in the derived class. + + Key to remove from the dictionary. + True if the key was found, false otherwise. + + + + Determines if this dictionary contains a key equal to . If so, the value + associated with that key is returned through the value parameter. This method must be + overridden by the derived class. + + The key to search for. + Returns the value associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Adds a new key-value pair to the dictionary. + + The default implementation of this method + checks to see if the key already exists using + ContainsKey, then calls the indexer setter if the key doesn't + already exist. + Key to add. + Value to associated with the key. + key is already present in the dictionary + + + + Determines whether a given key is found + in the dictionary. + + The default implementation simply calls TryGetValue and returns + what it returns. + Key to look for in the dictionary. + True if the key is present in the dictionary. + + + + Shows the string representation of the dictionary. The string representation contains + a list of the mappings in the dictionary. + + The string representation of the dictionary. + + + + Provides a read-only view of this dictionary. The returned IDictionary<TKey,TValue> provides + a view of the dictionary that prevents modifications to the dictionary. Use the method to provide + access to the dictionary without allowing changes. Since the returned object is just a view, + changes to the dictionary will be reflected in the view. + + An IIDictionary<TKey,TValue> that provides read-only access to the dictionary. + + + + Adds a key-value pair to the collection. This implementation calls the Add method + with the Key and Value from the item. + + A KeyValuePair contains the Key and Value to add. + + + + Determines if a dictionary contains a given KeyValuePair. This implementation checks to see if the + dictionary contains the given key, and if the value associated with the key is equal to (via object.Equals) + the value. + + A KeyValuePair containing the Key and Value to check for. + + + + + Determines if a dictionary contains a given KeyValuePair, and if so, removes it. This implementation checks to see if the + dictionary contains the given key, and if the value associated with the key is equal to (via object.Equals) + the value. If so, the key-value pair is removed. + + A KeyValuePair containing the Key and Value to check for. + True if the item was found and removed. False otherwise. + + + + Check that the given parameter is of the expected generic type. Throw an ArgumentException + if it isn't. + + Expected type of the parameter + parameter name + parameter value + + + + Adds a key-value pair to the collection. If key or value are not of the expected types, an + ArgumentException is thrown. If both key and value are of the expected types, the (overridden) + Add method is called with the key and value to add. + + Key to add to the dictionary. + Value to add to the dictionary. + key or value are not of the expected type for this dictionary. + + + + Clears this dictionary. Calls the (overridden) Clear method. + + + + + Determines if this dictionary contains a key equal to . The dictionary + is not changed. Calls the (overridden) ContainsKey method. If key is not of the correct + TKey for the dictionary, false is returned. + + The key to search for. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Removes the key (and associated value) from the collection that is equal to the passed in key. If + no key in the dictionary is equal to the passed key, the + dictionary is unchanged. Calls the (overridden) Remove method. If key is not of the correct + TKey for the dictionary, the dictionary is unchanged. + + The key to remove. + key could not be converted to TKey. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a DictionaryEntry. + The entries are enumerated in the same orders as the (overridden) GetEnumerator + method. + + An enumerator for enumerating all the elements in the OrderedDictionary. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a DictionaryEntry. + The entries are enumerated in the same orders as the (overridden) GetEnumerator + method. + + An enumerator for enumerating all the elements in the OrderedDictionary. + + + + Display the contents of the dictionary in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + The indexer of the dictionary. This is used to store keys and values and + retrieve values from the dictionary. The setter + accessor must be overridden in the derived class. + + Key to find in the dictionary. + The value associated with the key. + Thrown from the get accessor if the key + was not found in the dictionary. + + + + Returns a collection of the keys in this dictionary. + + A read-only collection of the keys in this dictionary. + + + + Returns a collection of the values in this dictionary. The ordering of + values in this collection is the same as that in the Keys collection. + + A read-only collection of the values in this dictionary. + + + + Returns whether this dictionary is fixed size. This implemented always returns false. + + Always returns false. + + + + Returns if this dictionary is read-only. This implementation always returns false. + + Always returns false. + + + + Returns a collection of all the keys in the dictionary. The values in this collection will + be enumerated in the same order as the (overridden) GetEnumerator method. + + The collection of keys. + + + + Returns a collection of all the values in the dictionary. The values in this collection will + be enumerated in the same order as the (overridden) GetEnumerator method. + + The collection of values. + + + + Gets or sets the value associated with a given key. When getting a value, if this + key is not found in the collection, then null is returned. When setting + a value, the value replaces any existing value in the dictionary. If either the key or value + are not of the correct type for this dictionary, an ArgumentException is thrown. + + The value associated with the key, or null if the key was not present. + key could not be converted to TKey, or value could not be converted to TValue. + + + + A private class that implements ICollection<TKey> and ICollection for the + Keys collection. The collection is read-only. + + + + + ReadOnlyCollectionBase is a base class that can be used to more easily implement the + generic ICollection<T> and non-generic ICollection interfaces for a read-only collection: + a collection that does not allow adding or removing elements. + + + To use ReadOnlyCollectionBase as a base class, the derived class must override + the Count and GetEnumerator methods. + ICollection<T>.Contains need not be implemented by the + derived class, but it should be strongly considered, because the ReadOnlyCollectionBase implementation + may not be very efficient. + + The item type of the collection. + + + + Creates a new ReadOnlyCollectionBase. + + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + Shows the string representation of the collection. The string representation contains + a list of the items in the collection. + + The string representation of the collection. + + + + Determines if the collection contains any item that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + True if the collection contains one or more items that satisfy the condition + defined by . False if the collection does not contain + an item that satisfies . + + + + Determines if all of the items in the collection satisfy the condition + defined by . + + A delegate that defines the condition to check for. + True if all of the items in the collection satisfy the condition + defined by , or if the collection is empty. False if one or more items + in the collection do not satisfy . + + + + Counts the number of items in the collection that satisfy the condition + defined by . + + A delegate that defines the condition to check for. + The number of items in the collection that satisfy . + + + + Enumerates the items in the collection that satisfy the condition defined + by . + + A delegate that defines the condition to check for. + An IEnumerable<T> that enumerates the items that satisfy the condition. + + + + Performs the specified action on each item in this collection. + + An Action delegate which is invoked for each item in this collection. + + + + Convert this collection of items by applying a delegate to each item in the collection. The resulting enumeration + contains the result of applying to each item in this collection, in + order. + + The type each item is being converted to. + A delegate to the method to call, passing each item in this collection. + An IEnumerable<TOutput^gt; that enumerates the resulting collection from applying to each item in this collection in + order. + is null. + + + + This method throws an NotSupportedException + stating the collection is read-only. + + Item to be added to the collection. + Always thrown. + + + + This method throws an NotSupportedException + stating the collection is read-only. + + Always thrown. + + + + This method throws an NotSupportedException + stating the collection is read-only. + + Item to be removed from the collection. + Always thrown. + + + + Determines if the collection contains a particular item. This default implementation + iterates all of the items in the collection via GetEnumerator, testing each item + against using IComparable<T>.Equals or + Object.Equals. + + You should strongly consider overriding this method to provide + a more efficient implementation. + The item to check for in the collection. + True if the collection contains , false otherwise. + + + + Copies all the items in the collection into an array. Implemented by + using the enumerator returned from GetEnumerator to get all the items + and copy them to the provided array. + + Array to copy to. + Starting index in to copy to. + + + + Creates an array of the correct size, and copies all the items in the + collection into the array, by calling CopyTo. + + An array containing all the elements in the collection, in order. + + + + Must be overridden to enumerate all the members of the collection. + + A generic IEnumerator<T> that can be used + to enumerate all the items in the collection. + + + + Copies all the items in the collection into an array. Implemented by + using the enumerator returned from GetEnumerator to get all the items + and copy them to the provided array. + + Array to copy to. + Starting index in to copy to. + + + + Provides an IEnumerator that can be used to iterate all the members of the + collection. This implementation uses the IEnumerator<T> that was overridden + by the derived classes to enumerate the members of the collection. + + An IEnumerator that can be used to iterate the collection. + + + + Display the contents of the collection in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + Must be overridden to provide the number of items in the collection. + + The number of items in the collection. + + + + Indicates whether the collection is read-only. Returns the value + of readOnly that was provided to the constructor. + + Always true. + + + + Indicates whether the collection is synchronized. + + Always returns false, indicating that the collection is not synchronized. + + + + Indicates the synchronization object for this collection. + + Always returns this. + + + + Constructor. + + The dictionary this is associated with. + + + + A private class that implements ICollection<TValue> and ICollection for the + Values collection. The collection is read-only. + + + + + A class that wraps a IDictionaryEnumerator around an IEnumerator that + enumerates KeyValuePairs. This is useful in implementing IDictionary, because + IEnumerator can be implemented with an iterator, but IDictionaryEnumerator cannot. + + + + + Constructor. + + The enumerator of KeyValuePairs that is being wrapped. + + + + Helper function to create a new KeyValuePair struct. + + The key. + The value. + A new KeyValuePair. + + + + Helper function to create a new KeyValuePair struct with a default value. + + The key. + A new KeyValuePair. + + + + Creates a new OrderedDictionary. The TKey must implemented IComparable<TKey> + or IComparable. + The CompareTo method of this interface will be used to compare keys in this dictionary. + + TKey does not implement IComparable<TKey>. + + + + Creates a new OrderedDictionary. The Compare method of the passed comparison object + will be used to compare keys in this dictionary. + + + The GetHashCode and Equals methods of the provided IComparer<TKey> will never + be called, and need not be implemented. + An instance of IComparer<TKey> that will be used to compare keys. + + + + Creates a new OrderedDictionary. The passed delegate will be used to compare keys in this dictionary. + + A delegate to a method that will be used to compare keys. + + + + Creates a new OrderedDictionary. The TKey must implemented IComparable<TKey> + or IComparable. + The CompareTo method of this interface will be used to compare keys in this dictionary. + A collection and keys and values (typically another dictionary) is used to initialized the + contents of the dictionary. + + A collection of keys and values whose contents are used to initialized the dictionary. + TKey does not implement IComparable<TKey>. + + + + Creates a new OrderedDictionary. The Compare method of the passed comparison object + will be used to compare keys in this dictionary. + A collection and keys and values (typically another dictionary) is used to initialized the + contents of the dictionary. + + + The GetHashCode and Equals methods of the provided IComparer<TKey> will never + be called, and need not be implemented. + A collection of keys and values whose contents are used to initialized the dictionary. + An instance of IComparer<TKey> that will be used to compare keys. + + + + Creates a new OrderedDictionary. The passed delegate will be used to compare keys in this dictionary. + A collection and keys and values (typically another dictionary) is used to initialized the + contents of the dictionary. + + A collection of keys and values whose contents are used to initialized the dictionary. + A delegate to a method that will be used to compare keys. + + + + Creates a new OrderedDictionary. The passed comparer + will be used to compare key-value pairs in this dictionary. Used internally + from other constructors. + + A collection of keys and values whose contents are used to initialized the dictionary. + An IComparer that will be used to compare keys. + An IComparer that will be used to compare key-value pairs. + + + + Creates a new OrderedDictionary. The passed comparison delegate + will be used to compare keys in this dictionary, and the given tree is used. Used internally for Clone(). + + An IComparer that will be used to compare keys. + A delegate to a method that will be used to compare key-value pairs. + RedBlackTree that contains the data for the dictionary. + + + + Makes a shallow clone of this dictionary; i.e., if keys or values of the + dictionary are reference types, then they are not cloned. If TKey or TValue is a value type, + then each element is copied as if by simple assignment. + + Cloning the dictionary takes time O(N), where N is the number of keys in the dictionary. + The cloned dictionary. + + + + Throw an InvalidOperationException indicating that this type is not cloneable. + + Type to test. + + + + Makes a deep clone of this dictionary. A new dictionary is created with a clone of + each entry of this dictionary, by calling ICloneable.Clone on each element. If TKey or TValue is + a value type, then each element is copied as if by simple assignment. + + If TKey or TValue is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the dictionary takes time O(N log N), where N is the number of keys in the dictionary. + The cloned dictionary. + TKey or TValue is a reference type that does not implement ICloneable. + + + + Returns a View collection that can be used for enumerating the keys and values in the collection in + reversed order. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Reversed()) { + // process pair + } +

+

If an entry is added to or deleted from the dictionary while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Reverse does not copy the data in the dictionary, and the operation takes constant time.

+
+ An OrderedDictionary.View of key-value pairs in reverse order. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only keys that are greater than and + less than are included. The keys are enumerated in sorted order. + Keys equal to the end points of the range can be included or excluded depending on the + and parameters. + + +

If is greater than or equal to , the returned collection is empty.

+

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Range(from, true, to, false)) { + // process pair + } + +

Calling Range does not copy the data in the dictionary, and the operation takes constant time.

+ The lower bound of the range. + If true, the lower bound is inclusive--keys equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--keys equal to the lower bound will not + be included in the range. + The upper bound of the range. + If true, the upper bound is inclusive--keys equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--keys equal to the upper bound will not + be included in the range. + An OrderedDictionary.View of key-value pairs in the given range. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only keys that are greater than (and optionally, equal to) are included. + The keys are enumerated in sorted order. Keys equal to can be included + or excluded depending on the parameter. + + +

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.RangeFrom(from, true)) { + // process pair + } + +

Calling RangeFrom does not copy of the data in the dictionary, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--keys equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--keys equal to the lower bound will not + be included in the range. + An OrderedDictionary.View of key-value pairs in the given range. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only items that are less than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.RangeFrom(from, false)) { + // process pair + } + +

Calling RangeTo does not copy the data in the dictionary, and the operation takes constant time.

+
+ The upper bound of the range. + If true, the upper bound is inclusive--keys equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--keys equal to the upper bound will not + be included in the range. + An OrderedDictionary.View of key-value pairs in the given range. +
+ + + Removes the key (and associated value) from the collection that is equal to the passed in key. If + no key in the dictionary is equal to the passed key, false is returned and the + dictionary is unchanged. + + Equality between keys is determined by the comparison instance or delegate used + to create the dictionary. + The key to remove. + True if the key was found and removed. False if the key was not found. + + + + Removes all keys and values from the dictionary. + + Clearing the dictionary takes a constant amount of time, regardless of the number of keys in it. + + + + Finds a key in the dictionary. If the dictionary already contains + a key equal to the passed key, then the existing value is returned via value. If the dictionary + doesn't contain that key, then value is associated with that key. + + between keys is determined by the comparison instance or delegate used + to create the dictionary. + This method takes time O(log N), where N is the number of keys in the dictionary. If a value is added, It is more efficient than + calling TryGetValue followed by Add, because the dictionary is not searched twice. + The new key. + The new value to associated with that key, if the key isn't present. If the key was present, + returns the exist value associated with that key. + True if key was already present, false if key wasn't present (and a new value was added). + + + + Adds a new key and value to the dictionary. If the dictionary already contains + a key equal to the passed key, then an ArgumentException is thrown + + + Equality between keys is determined by the comparison instance or delegate used + to create the dictionary. + Adding an key and value takes time O(log N), where N is the number of keys in the dictionary. + The new key. "null" is a valid key value. + The new value to associated with that key. + key is already present in the dictionary + + + + Changes the value associated with a given key. If the dictionary does not contain + a key equal to the passed key, then an ArgumentException is thrown. + + +

Unlike adding or removing an element, changing the value associated with a key + can be performed while an enumeration (foreach) on the the dictionary is in progress.

+

Equality between keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Replace takes time O(log N), where N is the number of entries in the dictionary.

+ The new key. + The new value to associated with that key. + key is not present in the dictionary +
+ + + Adds multiple key-value pairs to a dictionary. If a key exists in both the current instance and dictionaryToAdd, + then the value is updated with the value from (no exception is thrown). + Since IDictionary<TKey,TValue> inherits from IEnumerable<KeyValuePair<TKey,TValue>>, this + method can be used to merge one dictionary into another. + + AddMany takes time O(M log (N+M)), where M is the size of , and N is the size of + this dictionary. + A collection of keys and values whose contents are added to the current dictionary. + + + + Removes all the keys found in another collection (such as an array or List<TKey>). Each key in keyCollectionToRemove + is removed from the dictionary. Keys that are not present are ignored. + + RemoveMany takes time O(M log N), where M is the size of keyCollectionToRemove, and N is this + size of this collection. + The number of keys removed from the dictionary. + A collection of keys to remove from the dictionary. + + + + Determines if this dictionary contains a key equal to . The dictionary + is not changed. + + Searching the dictionary for a key takes time O(log N), where N is the number of keys in the dictionary. + The key to search for. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Determines if this dictionary contains a key equal to . If so, the value + associated with that key is returned through the value parameter. + + TryGetValue takes time O(log N), where N is the number of entries in the dictionary. + The key to search for. + Returns the value associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a KeyValuePair<TKey,TValue>. + The entries are enumerated in the sorted order of the keys. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the elements of the dictionary, which uses this method implicitly.

+

If an element is added to or deleted from the dictionary while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumeration all the entries in the dictionary takes time O(N log N), where N is the number + of entries in the dictionary.

+
+ An enumerator for enumerating all the elements in the OrderedDictionary. +
+ + + Implements ICloneable.Clone. Makes a shallow clone of this dictionary; i.e., if keys or values are reference types, then they are not cloned. + + The cloned dictionary. + + + + Returns the IComparer<T> used to compare keys in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. If the dictionary was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for TKey (Comparer<TKey>.Default) is returned. + + + + Gets or sets the value associated with a given key. When getting a value, if this + key is not found in the collection, then an ArgumentException is thrown. When setting + a value, the value replaces any existing value in the dictionary. + + The indexer takes time O(log N), where N is the number of entries in the dictionary. + The value associated with the key + A value is being retrieved, and the key is not present in the dictionary. + is null. + + + + Returns the number of keys in the dictionary. + + The size of the dictionary is returned in constant time.. + The number of keys in the dictionary. + + + + The OrderedDictionary<TKey,TValue>.View class is used to look at a subset of the keys and values + inside an ordered dictionary. It is returned from the Range, RangeTo, RangeFrom, and Reversed methods. + + +

Views are dynamic. If the underlying dictionary changes, the view changes in sync. If a change is made + to the view, the underlying dictionary changes accordingly.

+

Typically, this class is used in conjunction with a foreach statement to enumerate the keys + and values in a subset of the OrderedDictionary. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Range(from, to)) { + // process pair + } + +
+
+ + + Initialize the View. + + Associated OrderedDictionary to be viewed. + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. + Is the view enuemerated in reverse order? + + + + Determine if the given key lies within the bounds of this view. + + Key to test. + True if the key is within the bounds of this view. + + + + Enumerate all the keys and values in this view. + + An IEnumerator of KeyValuePairs with the keys and views in this view. + + + + Tests if the key is present in the part of the dictionary being viewed. + + Key to check for. + True if the key is within this view. + + + + Determines if this view contains a key equal to . If so, the value + associated with that key is returned through the value parameter. + + The key to search for. + Returns the value associated with key, if true was returned. + True if the key is within this view. + + + + Removes the key (and associated value) from the underlying dictionary of this view. that is equal to the passed in key. If + no key in the view is equal to the passed key, the dictionary and view are unchanged. + + The key to remove. + True if the key was found and removed. False if the key was not found. + + + + Removes all the keys and values within this view from the underlying OrderedDictionary. + + The following removes all the keys that start with "A" from an OrderedDictionary. + + dictionary.Range("A", "B").Clear(); + + + + + + Creates a new View that has the same keys and values as this, in the reversed order. + + A new View that has the reversed order of this view. + + + + Number of keys in this view. + + Number of keys that lie within the bounds the view. + + + + Gets or sets the value associated with a given key. When getting a value, if this + key is not found in the collection, then an ArgumentException is thrown. When setting + a value, the value replaces any existing value in the dictionary. When setting a value, the + key must be within the range of keys being viewed. + + The value associated with the key. + A value is being retrieved, and the key is not present in the dictionary, + or a value is being set, and the key is outside the range of keys being viewed by this View. + + + + ReadOnlyDictionaryBase is a base class that can be used to more easily implement the + generic IDictionary<T> and non-generic IDictionary interfaces. + + + To use ReadOnlyDictionaryBase as a base class, the derived class must override + Count, TryGetValue, GetEnumerator. + + The key type of the dictionary. + The value type of the dictionary. + + + + Creates a new DictionaryBase. This must be called from the constructor of the + derived class to specify whether the dictionary is read-only and the name of the + collection. + + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + Adds a new key-value pair to the dictionary. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + Key to add. + Value to associated with the key. + Always thrown. + + + + Removes a key from the dictionary. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + Key to remove from the dictionary. + True if the key was found, false otherwise. + Always thrown. + + + + Determines whether a given key is found + in the dictionary. + + The default implementation simply calls TryGetValue and returns + what it returns. + Key to look for in the dictionary. + True if the key is present in the dictionary. + + + + Determines if this dictionary contains a key equal to . If so, the value + associated with that key is returned through the value parameter. This method must be overridden + in the derived class. + + The key to search for. + Returns the value associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Shows the string representation of the dictionary. The string representation contains + a list of the mappings in the dictionary. + + The string representation of the dictionary. + + + + Determines if a dictionary contains a given KeyValuePair. This implementation checks to see if the + dictionary contains the given key, and if the value associated with the key is equal to (via object.Equals) + the value. + + A KeyValuePair containing the Key and Value to check for. + + + + + Adds a key-value pair to the collection. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + Key to add to the dictionary. + Value to add to the dictionary. + Always thrown. + + + + Clears this dictionary. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + Always thrown. + + + + Determines if this dictionary contains a key equal to . The dictionary + is not changed. Calls the (overridden) ContainsKey method. If key is not of the correct + TKey for the dictionary, false is returned. + + The key to search for. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Removes the key (and associated value) from the collection that is equal to the passed in key. Always throws an exception + indicating that this method is not supported in a read-only dictionary. + + The key to remove. + Always thrown. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a DictionaryEntry. + The entries are enumerated in the same orders as the (overridden) GetEnumerator + method. + + An enumerator for enumerating all the elements in the OrderedDictionary. + + + + Returns an enumerator that enumerates all the entries in the dictionary. Each entry is + returned as a DictionaryEntry. + The entries are enumerated in the same orders as the (overridden) GetEnumerator + method. + + An enumerator for enumerating all the elements in the OrderedDictionary. + + + + Display the contents of the dictionary in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + The indexer of the dictionary. The set accessor throws an NotSupportedException + stating the dictionary is read-only. + + The get accessor is implemented by calling TryGetValue. + Key to find in the dictionary. + The value associated with the key. + Always thrown from the set accessor, indicating + that the dictionary is read only. + Thrown from the get accessor if the key + was not found. + + + + Returns a collection of the keys in this dictionary. + + A read-only collection of the keys in this dictionary. + + + + Returns a collection of the values in this dictionary. The ordering of + values in this collection is the same as that in the Keys collection. + + A read-only collection of the values in this dictionary. + + + + Returns whether this dictionary is fixed size. + + Always returns true. + + + + Returns if this dictionary is read-only. + + Always returns true. + + + + Returns a collection of all the keys in the dictionary. The values in this collection will + be enumerated in the same order as the (overridden) GetEnumerator method. + + The collection of keys. + + + + Returns a collection of all the values in the dictionary. The values in this collection will + be enumerated in the same order as the (overridden) GetEnumerator method. + + The collection of values. + + + + Gets the value associated with a given key. When getting a value, if this + key is not found in the collection, then null is returned. If the key is not of the correct type + for this dictionary, null is returned. + + The value associated with the key, or null if the key was not present. + Always thrown from the set accessor, indicating + that the dictionary is read only. + + + + A private class that implements ICollection<TKey> and ICollection for the + Keys collection. The collection is read-only. + + + + + Constructor. + + The dictionary this is associated with. + + + + A private class that implements ICollection<TKey> and ICollection for the + Values collection. The collection is read-only. + + + + + A class that wraps a IDictionaryEnumerator around an IEnumerator that + enumerates KeyValuePairs. This is useful in implementing IDictionary, because + IEnumerator can be implemented with an iterator, but IDictionaryEnumerator cannot. + + + + + Constructor. + + The enumerator of KeyValuePairs that is being wrapped. + + + + OrderedBag<T> is a collection that contains items of type T. + The item are maintained in a sorted order. Unlike a OrderedSet, duplicate items (items that + compare equal to each other) are allows in an OrderedBag. + + +

The items are compared in one of three ways. If T implements IComparable<TKey> or IComparable, + then the CompareTo method of that interface will be used to compare items. Alternatively, a comparison + function can be passed in either as a delegate, or as an instance of IComparer<TKey>.

+

OrderedBag is implemented as a balanced binary tree. Inserting, deleting, and looking up an + an element all are done in log(N) + M time, where N is the number of keys in the tree, and M is the current number + of copies of the element being handled.

+

is similar, but uses hashing instead of comparison, and does not maintain + the keys in sorted order.

+
+ +
+ + + Creates a new OrderedBag. The T must implement IComparable<T> + or IComparable. + The CompareTo method of this interface will be used to compare items in this bag. + + + Items that are null are permitted, and will be sorted before all other items. + + T does not implement IComparable<TKey>. + + + + Creates a new OrderedBag. The passed delegate will be used to compare items in this bag. + + A delegate to a method that will be used to compare items. + + + + Creates a new OrderedBag. The Compare method of the passed comparison object + will be used to compare items in this bag. + + + The GetHashCode and Equals methods of the provided IComparer<T> will never + be called, and need not be implemented. + + An instance of IComparer<T> that will be used to compare items. + + + + Creates a new OrderedBag. The T must implement IComparable<T> + or IComparable. + The CompareTo method of this interface will be used to compare items in this bag. The bag is + initialized with all the items in the given collection. + + + Items that are null are permitted, and will be sorted before all other items. + + A collection with items to be placed into the OrderedBag. + T does not implement IComparable<TKey>. + + + + Creates a new OrderedBag. The passed delegate will be used to compare items in this bag. + The bag is initialized with all the items in the given collection. + + A collection with items to be placed into the OrderedBag. + A delegate to a method that will be used to compare items. + + + + Creates a new OrderedBag. The Compare method of the passed comparison object + will be used to compare items in this bag. The bag is + initialized with all the items in the given collection. + + + The GetHashCode and Equals methods of the provided IComparer<T> will never + be called, and need not be implemented. + + A collection with items to be placed into the OrderedBag. + An instance of IComparer<T> that will be used to compare items. + + + + Creates a new OrderedBag given a comparer and a tree that contains the data. Used + internally for Clone. + + Comparer for the bag. + Data for the bag. + + + + Makes a shallow clone of this bag; i.e., if items of the + bag are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the bag takes time O(N), where N is the number of items in the bag. + The cloned bag. + + + + Makes a shallow clone of this bag; i.e., if items of the + bag are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the bag takes time O(N), where N is the number of items in the bag. + The cloned bag. + + + + Makes a deep clone of this bag. A new bag is created with a clone of + each element of this bag, by calling ICloneable.Clone on each element. If T is + a value type, then each element is copied as if by simple assignment. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the bag takes time O(N log N), where N is the number of items in the bag. + The cloned bag. + T is a reference type that does not implement ICloneable. + + + + Returns the number of copies of in the bag. More precisely, returns + the number of items in the bag that compare equal to . + + NumberOfCopies() takes time O(log N + M), where N is the total number of items in the + bag, and M is the number of copies of in the bag. + The item to search for in the bag. + The number of items in the bag that compare equal to . + + + + Returns an enumerator that enumerates all the items in the bag. + The items are enumerated in sorted order. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the items, which uses this method implicitly.

+

If an item is added to or deleted from the bag while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumeration all the items in the bag takes time O(N), where N is the number + of items in the bag.

+
+ An enumerator for enumerating all the items in the OrderedBag. +
+ + + Determines if this bag contains an item equal to . The bag + is not changed. + + Searching the bag for an item takes time O(log N), where N is the number of items in the bag. + The item to search for. + True if the bag contains . False if the bag does not contain . + + + + Enumerates all of the items in this bag that are equal to , according to the + comparison mechanism that was used when the bag was created. The bag + is not changed. + If the bag does contain an item equal to , then the enumeration contains + no items. + + Enumeration the items in the bag equal to takes time O(log N + M), where N + is the total number of items in the bag, and M is the number of items equal to . + The item to search for. + An IEnumerable<T> that enumerates all the items in the bag equal to . + + + + Enumerates all the items in the bag, but enumerates equal items + just once, even if they occur multiple times in the bag. + + If the bag is changed while items are being enumerated, the + enumeration will terminate with an InvalidOperationException. + An IEnumerable<T> that enumerates the unique items. + + + + Get the index of the given item in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. If multiple + equal items exist, the largest index of the equal items is returned. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the last item in the sorted bag equal to , or -1 if the item is not present + in the set. + + + + Get the index of the given item in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. If multiple + equal items exist, the smallest index of the equal items is returned. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the first item in the sorted bag equal to , or -1 if the item is not present + in the set. + + + + Adds a new item to the bag. Since bags can contain duplicate items, the item + is added even if the bag already contains an item equal to . In + this case, the new item is placed after all equal items already present in the bag. + + + Adding an item takes time O(log N), where N is the number of items in the bag. + The item to add to the bag. + + + + Adds all the items in to the bag. + + + Adding the collection takes time O(M log N), where N is the number of items in the bag, and M is the + number of items in . + A collection of items to add to the bag. + is null. + + + + Searches the bag for one item equal to , and if found, + removes it from the bag. If not found, the bag is unchanged. If more than one item + equal to , the item that was last inserted is removed. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Removing an item from the bag takes time O(log N), where N is the number of items in the bag. + The item to remove. + True if was found and removed. False if was not in the bag. + + + + Searches the bag for all items equal to , and + removes all of them from the bag. If not found, the bag is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + RemoveAllCopies() takes time O(M log N), where N is the total number of items in the bag, and M is + the number of items equal to . + The item to remove. + The number of copies of that were found and removed. + + + + Removes all the items in from the bag. Items not + present in the bag are ignored. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Removing the collection takes time O(M log N), where N is the number of items in the bag, and M is the + number of items in . + A collection of items to remove from the bag. + The number of items removed from the bag. + is null. + + + + Removes all items from the bag. + + Clearing the bag takes a constant amount of time, regardless of the number of items in it. + + + + If the collection is empty, throw an invalid operation exception. + + The bag is empty. + + + + Returns the first item in the bag: the item + that would appear first if the bag was enumerated. This is also + the smallest item in the bag. + + GetFirst() takes time O(log N), where N is the number of items in the bag. + The first item in the bag. If more than one item + is smallest, the first one added is returned. + The bag is empty. + + + + Returns the last item in the bag: the item + that would appear last if the bag was enumerated. This is also the largest + item in the bag. + + GetLast() takes time O(log N), where N is the number of items in the bag. + The last item in the bag. If more than one item + is largest, the last one added is returned. + The bag is empty. + + + + Removes the first item in the bag. This is also the smallest + item in the bag. + + RemoveFirst() takes time O(log N), where N is the number of items in the bag. + The item that was removed, which was the smallest item in the bag. + The bag is empty. + + + + Removes the last item in the bag. This is also the largest item in the bag. + + RemoveLast() takes time O(log N), where N is the number of items in the bag. + The item that was removed, which was the largest item in the bag. + The bag is empty. + + + + Check that this bag and another bag were created with the same comparison + mechanism. Throws exception if not compatible. + + Other bag to check comparision mechanism. + If otherBag and this bag don't use the same method for comparing items. + is null. + + + + Determines if this bag is a superset of another bag. Neither bag is modified. + This bag is a superset of if every element in + is also in this bag, at least the same number of + times. + + IsSupersetOf is computed in time O(M log N), where M is the size of the + , and N is the size of the this set. + OrderedBag to compare to. + True if this is a superset of . + This bag and don't use the same method for comparing items. + is null. + + + + Determines if this bag is a proper superset of another bag. Neither bag is modified. + This bag is a proper superset of if every element in + is also in this bag, at least the same number of + times. Additional, this bag must have strictly more items than . + + IsProperSupersetOf is computed in time O(M log N), where M is the number of unique items in + . + OrderedBag to compare to. + True if this is a proper superset of . + This bag and don't use the same method for comparing items. + is null. + + + + Determines if this bag is a subset of another bag. Neither bag is modified. + This bag is a subset of if every element in this bag + is also in , at least the same number of + times. + + IsSubsetOf is computed in time O(N log M), where M is the size of the + , and N is the size of the this bag. + OrderedBag to compare to. + True if this is a subset of . + This bag and don't use the same method for comparing items. + is null. + + + + Determines if this bag is a proper subset of another bag. Neither bag is modified. + This bag is a subset of if every element in this bag + is also in , at least the same number of + times. Additional, this bag must have strictly fewer items than . + + IsSubsetOf is computed in time O(N log M), where M is the size of the + , and N is the size of the this bag. + OrderedBag to compare to. + True if this is a proper subset of . + This bag and don't use the same method for comparing items. + is null. + + + + Determines if this bag is disjoint from another bag. Two bags are disjoint + if no item from one set is equal to any item in the other bag. + + + The answer is computed in time O(N), where N is the size of the smaller set. + + Bag to check disjointness with. + True if the two bags are disjoint, false otherwise. + This bag and don't use the same method for comparing items. + + + + Determines if this bag is equal to another bag. This bag is equal to + if they contain the same items, each the + same number of times. + + IsEqualTo is computed in time O(N), where N is the number of items in + this bag. + OrderedBag to compare to + True if this bag is equal to , false otherwise. + This bag and don't use the same method for comparing items. + + + + Computes the union of this bag with another bag. The union of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the union contains the item Maximum(X,Y) times. This bag receives + the union of the two bags, the other bag is unchanged. + + + The union of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to union with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the union of this bag with another bag. The union of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the union contains the item Maximum(X,Y) times. A new bag is + created with the union of the bags and is returned. This bag and the other bag + are unchanged. + + + The union of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to union with. + The union of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the sum of this bag with another bag. The sum of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item (X+Y) times. This bag receives + the sum of the two bags, the other bag is unchanged. + + + The sum of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to sum with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the sum of this bag with another bag. he sum of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item (X+Y) times. A new bag is + created with the sum of the bags and is returned. This bag and the other bag + are unchanged. + + + The sum of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to sum with. + The sum of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the intersection of this bag with another bag. The intersection of two bags + is all items that appear in both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item Minimum(X,Y) times. This bag receives + the intersection of the two bags, the other bag is unchanged. + + + When equal items appear in both bags, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two bags is computed in time O(N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to intersection with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the intersection of this bag with another bag. The intersection of two bags + is all items that appear in both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item Minimum(X,Y) times. A new bag is + created with the intersection of the bags and is returned. This bag and the other bag + are unchanged. + + + When equal items appear in both bags, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two bags is computed in time O(N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to intersection with. + The intersection of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the difference of this bag with another bag. The difference of these two bags + is all items that appear in this bag, but not in . If an item appears X times in this bag, + and Y times in the other bag, the difference contains the item X - Y times (zero times if Y >= X). This bag receives + the difference of the two bags; the other bag is unchanged. + + + The difference of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to difference with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the difference of this bag with another bag. The difference of these two bags + is all items that appear in this bag, but not in . If an item appears X times in this bag, + and Y times in the other bag, the difference contains the item X - Y times (zero times if Y >= X). A new bag is + created with the difference of the bags and is returned. This bag and the other bag + are unchanged. + + + The difference of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to difference with. + The difference of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the symmetric difference of this bag with another bag. The symmetric difference of two bags + is all items that appear in either of the bags, but not both. If an item appears X times in one bag, + and Y times in the other bag, the symmetric difference contains the item AbsoluteValue(X - Y times). This bag receives + the symmetric difference of the two bags; the other bag is unchanged. + + + The symmetric difference of two bags is computed in time O(M + N), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to symmetric difference with. + This bag and don't use the same method for comparing items. + is null. + + + + Computes the symmetric difference of this bag with another bag. The symmetric difference of two bags + is all items that appear in either of the bags, but not both. If an item appears X times in one bag, + and Y times in the other bag, the symmetric difference contains the item AbsoluteValue(X - Y times). A new bag is + created with the symmetric difference of the bags and is returned. This bag and the other bag + are unchanged. + + + The symmetric difference of two bags is computed in time O(M + N), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to symmetric difference with. + The symmetric difference of the two bags. + This bag and don't use the same method for comparing items. + is null. + + + + Get a read-only list view of the items in this ordered bag. The + items in the list are in sorted order, with the smallest item + at index 0. This view does not copy any data, and reflects any + changes to the underlying OrderedBag. + + A read-only IList<T> view onto this OrderedBag. + + + + Returns a View collection that can be used for enumerating the items in the bag in + reversed order. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in bag.Reversed()) { + // process item + } +

+

If an item is added to or deleted from the bag while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Reverse does not copy the data in the tree, and the operation takes constant time.

+
+ An OrderedBag.View of items in reverse order. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the bag. + Only items that are greater than and + less than are included. The items are enumerated in sorted order. + Items equal to the end points of the range can be included or excluded depending on the + and parameters. + + +

If is greater than or equal to , the returned collection is empty.

+

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in bag.Range(from, true, to, false)) { + // process item + } +

+

If an item is added to or deleted from the bag while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Range does not copy the data in the tree, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--items equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--items equal to the lower bound will not + be included in the range. + The upper bound of the range. + If true, the upper bound is inclusive--items equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--items equal to the upper bound will not + be included in the range. + An OrderedBag.View of items in the given range. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the bag. + Only items that are greater than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in bag.RangeFrom(from, true)) { + // process item + } +

+

If an item is added to or deleted from the bag while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling RangeFrom does not copy the data in the tree, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--items equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--items equal to the lower bound will not + be included in the range. + An OrderedBag.View of items in the given range. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the bag. + Only items that are less than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in bag.RangeTo(to, false)) { + // process item + } +

+

If an item is added to or deleted from the bag while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling RangeTo does not copy the data in the tree, and the operation takes constant time.

+
+ The upper bound of the range. + If true, the upper bound is inclusive--items equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--items equal to the upper bound will not + be included in the range. + An OrderedBag.View of items in the given range. +
+ + + Returns the IComparer<T> used to compare items in this bag. + + If the bag was created using a comparer, that comparer is returned. If the bag was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for T (Comparer<T>.Default) is returned. + + + + Returns the number of items in the bag. + + The size of the bag is returned in constant time. + The number of items in the bag. + + + + Get the item by its index in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + The indexer takes time O(log N), which N is the number of items in + the set. + The index to get the item by. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + The nested class that provides a read-only list view + of all or part of the collection. + + + + + ReadOnlyListBase is an abstract class that can be used as a base class for a read-only collection that needs + to implement the generic IList<T> and non-generic IList collections. The derived class needs + to override the Count property and the get part of the indexer. The implementation + of all the other methods in IList<T> and IList are handled by ListBase. + + + + + + Creates a new ReadOnlyListBase. + + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + Enumerates all of the items in the list, in order. The item at index 0 + is enumerated first, then the item at index 1, and so on. + + An IEnumerator<T> that enumerates all the + items in the list. + + + + Determines if the list contains any item that compares equal to . + The implementation simply checks whether IndexOf(item) returns a non-negative value. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + True if the list contains an item that compares equal to . + + + + Copies all the items in the list, in order, to , + starting at index 0. + + The array to copy to. This array must have a size + that is greater than or equal to Count. + + + + Copies all the items in the list, in order, to , + starting at . + + The array to copy to. This array must have a size + that is greater than or equal to Count + arrayIndex. + The starting index in + to copy to. + + + + Copies a range of elements from the list to , + starting at . + + The starting index in the source list of the range to copy. + The array to copy to. This array must have a size + that is greater than or equal to Count + arrayIndex. + The starting index in + to copy to. + The number of items to copy. + + + + Finds the first item in the list that satisfies the condition + defined by . If no item matches the condition, than + the default value for T (null or all-zero) is returned. + + If the default value for T (null or all-zero) matches the condition defined by , + and the list might contain the default value, then it is impossible to distinguish the different between finding + the default value and not finding any item. To distinguish these cases, use . + A delegate that defined the condition to check for. + The first item that satisfies the condition . If no item satisfies that + condition, the default value for T is returned. + + + + + Finds the first item in the list that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + If true is returned, this parameter receives the first item in the list + that satifies the condition defined by . + True if an item that satisfies the condition was found. False + if no item in the list satisfies that condition. + + + + Finds the last item in the list that satisfies the condition + defined by . If no item matches the condition, than + the default value for T (null or all-zero) is returned. + + If the default value for T (null or all-zero) matches the condition defined by , + and the list might contain the default value, then it is impossible to distinguish the different between finding + the default value and not finding any item. To distinguish these cases, use . + A delegate that defined the condition to check for. + The last item that satisfies the condition . If no item satisfies that + condition, the default value for T is returned. + + + + + Finds the last item in the list that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + If true is returned, this parameter receives the last item in the list + that satifies the condition defined by . + True if an item that satisfies the condition was found. False + if no item in the list satisfies that condition. + + + + Finds the index of the first item in the list that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The index of the first item that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item, in the range of items extending from to the end, that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The starting index of the range to check. + The index of the first item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item, in the range of items starting from , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The starting index of the range to check. + The number of items in range to check. + The index of the first item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item in the list that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The index of the last item that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item, in the range of items extending from the beginning + of the list to , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The ending index of the range to check. + The index of the last item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item, in the range of items ending at , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The ending index of the range to check. + The number of items in range to check. + The index of the last item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item in the list that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The index of the first item in the list that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the first item, in the range of items extending from to the end, + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The starting index of the range to check. + The index of the first item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the first item, in the range of items starting from , + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The starting index of the range to check. + The number of items in range to check. + The index of the first item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item in the list that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The index of the last item in the list that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item, in the range of items extending from the beginning + of the list to , that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The ending index of the range to check. + The index of the last item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item, in the range of items ending at , + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search for. + The ending index of the range to check. + The number of items in range to check. + The index of the last item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Returns a view onto a sub-range of this list. Items are not copied; the + returned IList<T> is simply a different view onto the same underlying items. + + + This method can be used to apply an algorithm to a portion of a list. For example: + Algorithms.Reverse(deque.Range(3, 6)) + will return the reverse opf the 6 items beginning at index 3. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-part of this list. + or is negative. + + is greater than the + size of the list. + + + + Inserts a new item at the given index. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The index in the list to insert the item at. After the + insertion, the inserted item is located at this index. The + first item in the list has index 0. + The item to insert at the given index. + Always thrown. + + + + Removes the item at the given index. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The index in the list to remove the item at. The + first item in the list has index 0. + Always thrown. + + + + Adds an item to the end of the list. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The item to add to the list. + Always thrown. + + + + Removes all the items from the list, resulting in an empty list. This implementation throws a NotSupportedException + indicating that the list is read-only. + + Always thrown. + + + + Determines if the list contains any item that compares equal to . + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + + + + Find the first occurrence of an item equal to + in the list, and returns the index of that item. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + The index of , or -1 if no item in the + list compares equal to . + + + + Insert a new item at the given index. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The index in the list to insert the item at. After the + insertion, the inserted item is located at this index. The + first item in the list has index 0. + The item to insert at the given index. + Always thrown. + + + + Searches the list for the first item that compares equal to . + If one is found, it is removed. Otherwise, the list is unchanged. This implementation throws a NotSupportedException + indicating that the list is read-only. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to remove from the list. + Always thrown. + + + + Removes the item at the given index. This implementation throws a NotSupportedException + indicating that the list is read-only. + + The index in the list to remove the item at. The + first item in the list has index 0. + Always thrown. + + + + The property must be overridden by the derived class to return the number of + items in the list. + + The number of items in the list. + + + + The get part of the indexer must be overridden by the derived class to get + values of the list at a particular index. + + The index in the list to get or set an item at. The + first item in the list has index 0, and the last has index Count-1. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + Returns whether the list is a fixed size. This implementation always returns true. + + Alway true, indicating that the list is fixed size. + + + + Returns whether the list is read only. This implementation always returns true. + + Alway true, indicating that the list is read-only. + + + + Gets or sets the value at a particular index in the list. + + The index in the list to get or set an item at. The + first item in the list has index 0, and the last has index Count-1. + The item at the given index. + is + less than zero or greater than or equal to Count. + cannot be converted to T. + Always thrown from the setter, indicating that the list + is read-only. + + + + Create a new list view wrapped the given set. + + The ordered bag to wrap. + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. Used to optimize some operations. + Is the view enuemerated in reverse order? + + + + The OrderedBag<T>.View class is used to look at a subset of the items + inside an ordered bag. It is returned from the Range, RangeTo, RangeFrom, and Reversed methods. + + +

Views are dynamic. If the underlying bag changes, the view changes in sync. If a change is made + to the view, the underlying bag changes accordingly.

+

Typically, this class is used in conjunction with a foreach statement to enumerate the items + in a subset of the OrderedBag. For example:

+ + foreach(T item in bag.Range(from, to)) { + // process item + } + +
+
+ + + Initialize the view. + + OrderedBag being viewed + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. + Is the view enuemerated in reverse order? + + + + Determine if the given item lies within the bounds of this view. + + Item to test. + True if the item is within the bounds of this view. + + + + Enumerate all the items in this view. + + An IEnumerator<T> with the items in this view. + + + + Removes all the items within this view from the underlying bag. + + The following removes all the items that start with "A" from an OrderedBag. + + bag.Range("A", "B").Clear(); + + + + + + Adds a new item to the bag underlying this View. If the bag already contains an item equal to + , that item is replaces with . If + is outside the range of this view, an InvalidOperationException + is thrown. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Adding an item takes time O(log N), where N is the number of items in the bag. + The item to add. + True if the bag already contained an item equal to (which was replaced), false + otherwise. + + + + Searches the underlying bag for an item equal to , and if found, + removes it from the bag. If not found, the bag is unchanged. If the item is outside + the range of this view, the bag is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Removing an item from the bag takes time O(log N), where N is the number of items in the bag. + The item to remove. + True if was found and removed. False if was not in the bag, or + was outside the range of this view. + + + + Determines if this view of the bag contains an item equal to . The bag + is not changed. If + + Searching the bag for an item takes time O(log N), where N is the number of items in the bag. + The item to search for. + True if the bag contains , and is within + the range of this view. False otherwise. + + + + Get the first index of the given item in the view. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the first item in the view equal to , or -1 if the item is not present + in the view. + + + + Get the last index of the given item in the view. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the last item in the view equal to , or -1 if the item is not present + in the view. + + + + Get a read-only list view of the items in this view. The + items in the list are in sorted order, with the smallest item + at index 0. This view does not copy any data, and reflects any + changes to the underlying OrderedSet. + + A read-only IList<T> view onto this view. + + + + Creates a new View that has the same items as this view, in the reversed order. + + A new View that has the reversed order of this view, with the same upper + and lower bounds. + + + + Returns the first item in this view: the item + that would appear first if the view was enumerated. + + GetFirst() takes time O(log N), where N is the number of items in the bag. + The first item in the view. + The view has no items in it. + + + + Returns the last item in the view: the item + that would appear last if the view was enumerated. + + GetLast() takes time O(log N), where N is the number of items in the bag. + The last item in the view. + The view has no items in it. + + + + Number of items in this view. + + Number of items that lie within the bounds the view. + + + + Get the item by its index in the sorted order. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + The indexer takes time O(log N), which N is the number of items in + the set. + The index to get the item by. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + Stores a triple of objects within a single struct. This struct is useful to use as the + T of a collection, or as the TKey or TValue of a dictionary. + + + + + Comparers for the first and second type that are used to compare + values. + + + + + The first element of the triple. + + + + + The second element of the triple. + + + + + The thrid element of the triple. + + + + + Creates a new triple with given elements. + + The first element of the triple. + The second element of the triple. + The third element of the triple. + + + + Determines if this triple is equal to another object. The triple is equal to another object + if that object is a Triple, all element types are the same, and the all three elements + compare equal using object.Equals. + + Object to compare for equality. + True if the objects are equal. False if the objects are not equal. + + + + Determines if this triple is equal to another triple. Two triples are equal if the all three elements + compare equal using IComparable<T>.Equals or object.Equals. + + Triple to compare with for equality. + True if the triples are equal. False if the triples are not equal. + + + + Returns a hash code for the triple, suitable for use in a hash-table or other hashed collection. + Two triples that compare equal (using Equals) will have the same hash code. The hash code for + the triple is derived by combining the hash codes for each of the two elements of the triple. + + The hash code. + + + + Compares this triple to another triple of the some type. The triples are compared by using + the IComparable<T> or IComparable interface on TFirst, TSecond, and TThird. The triples + are compared by their first elements first, if their first elements are equal, then they + are compared by their second elements. If their second elements are also equal, then they + are compared by their third elements. + If TFirst, TSecond, or TThird does not implement IComparable<T> or IComparable, then + an NotSupportedException is thrown, because the triples cannot be compared. + + The triple to compare to. + An integer indicating how this triple compares to . Less + than zero indicates this triple is less than . Zero indicate this triple is + equals to . Greater than zero indicates this triple is greater than + . + Either FirstSecond, TSecond, or TThird is not comparable + via the IComparable<T> or IComparable interfaces. + + + + Compares this triple to another triple of the some type. The triples are compared by using + the IComparable<T> or IComparable interface on TFirst, TSecond, and TThird. The triples + are compared by their first elements first, if their first elements are equal, then they + are compared by their second elements. If their second elements are also equal, then they + are compared by their third elements. + If TFirst, TSecond, or TThird does not implement IComparable<T> or IComparable, then + an NotSupportedException is thrown, because the triples cannot be compared. + + The triple to compare to. + An integer indicating how this triple compares to . Less + than zero indicates this triple is less than . Zero indicate this triple is + equals to . Greater than zero indicates this triple is greater than + . + is not of the correct type. + Either FirstSecond, TSecond, or TThird is not comparable + via the IComparable<T> or IComparable interfaces. + + + + Returns a string representation of the triple. The string representation of the triple is + of the form: + First: {0}, Second: {1}, Third: {2} + where {0} is the result of First.ToString(), {1} is the result of Second.ToString(), and + {2} is the result of Third.ToString() (or "null" if they are null.) + + The string representation of the triple. + + + + Determines if two triples are equal. Two triples are equal if the all three elements + compare equal using IComparable<T>.Equals or object.Equals. + + First triple to compare. + Second triple to compare. + True if the triples are equal. False if the triples are not equal. + + + + Determines if two triples are not equal. Two triples are equal if the all three elements + compare equal using IComparable<T>.Equals or object.Equals. + + First triple to compare. + Second triple to compare. + True if the triples are not equal. False if the triples are equal. + + + + A holder class for localizable strings that are used. Currently, these are not loaded from resources, but + just coded into this class. To make this library localizable, simply change this class to load the + given strings from resources. + + + + + The MultiDictionary class that associates values with a key. Unlike an Dictionary, + each key can have multiple values associated with it. When indexing an MultiDictionary, instead + of a single value associated with a key, you retrieve an enumeration of values. + When constructed, you can chose to allow the same value to be associated with a key multiple + times, or only one time. + + The type of the keys. + The of values associated with the keys. + + + + + + MultiDictionaryBase is a base class that can be used to more easily implement a class + that associates multiple values to a single key. The class implements the generic + IDictionary<TKey, ICollection<TValue>> interface. + + + To use MultiDictionaryBase as a base class, the derived class must override + Count, Clear, Add, Remove(TKey), Remove(TKey,TValue), Contains(TKey,TValue), + EnumerateKeys, and TryEnumerateValuesForKey. + It may wish consider overriding CountValues, CountAllValues, ContainsKey, + and EqualValues, but these are not required. + + + The key type of the dictionary. + The value type of the dictionary. + + + + Creates a new MultiDictionaryBase. + + + + + Clears the dictionary. This method must be overridden in the derived class. + + + + + Enumerate all the keys in the dictionary. This method must be overridden by a derived + class. + + An IEnumerator<TKey> that enumerates all of the keys in the collection that + have at least one value associated with them. + + + + Enumerate all of the values associated with a given key. This method must be overridden + by the derived class. If the key exists and has values associated with it, an enumerator for those + values is returned throught . If the key does not exist, false is returned. + + The key to get values for. + If true is returned, this parameter receives an enumerators that + enumerates the values associated with that key. + True if the key exists and has values associated with it. False otherwise. + + + + Adds a key-value pair to the collection. The value part of the pair must be a collection + of values to associate with the key. If values are already associated with the given + key, the new values are added to the ones associated with that key. + + A KeyValuePair contains the Key and Value collection to add. + + + + Implements IDictionary<TKey, IEnumerable<TValue>>.Add. If the + key is already present, and ArgumentException is thrown. Otherwise, a + new key is added, and new values are associated with that key. + + Key to add. + Values to associate with that key. + The key is already present in the dictionary. + + + + Adds new values to be associated with a key. If duplicate values are permitted, this + method always adds new key-value pairs to the dictionary. + If duplicate values are not permitted, and already has a value + equal to one of associated with it, then that value is replaced, + and the number of values associate with is unchanged. + + The key to associate with. + A collection of values to associate with . + + + + Adds a new key-value pair to the dictionary. This method must be overridden in the derived class. + + Key to add. + Value to associated with the key. + key is already present in the dictionary + + + + Removes a key from the dictionary. This method must be overridden in the derived class. + + Key to remove from the dictionary. + True if the key was found, false otherwise. + + + + Removes a key-value pair from the dictionary. This method must be overridden in the derived class. + + Key to remove from the dictionary. + Associated value to remove from the dictionary. + True if the key-value pair was found, false otherwise. + + + + Removes a set of values from a given key. If all values associated with a key are + removed, then the key is removed also. + + A KeyValuePair contains a key and a set of values to remove from that key. + True if at least one values was found and removed. + + + + Removes a collection of values from the values associated with a key. If the + last value is removed from a key, the key is removed also. + + A key to remove values from. + A collection of values to remove. + The number of values that were present and removed. + + + + Remove all of the keys (and any associated values) in a collection + of keys. If a key is not present in the dictionary, nothing happens. + + A collection of key values to remove. + The number of keys from the collection that were present and removed. + + + + Determines if this dictionary contains a key equal to . If so, all the values + associated with that key are returned through the values parameter. This method must be + overridden by the derived class. + + The key to search for. + Returns all values associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Determines whether a given key is found in the dictionary. + + The default implementation simply calls TryEnumerateValuesForKey. + It may be appropriate to override this method to + provide a more efficient implementation. + Key to look for in the dictionary. + True if the key is present in the dictionary. + + + + Determines if this dictionary contains a key-value pair equal to and + . The dictionary is not changed. This method must be overridden in the derived class. + + The key to search for. + The value to search for. + True if the dictionary has associated with . + + + + Determines if this dictionary contains the given key and all of the values associated with that key.. + + A key and collection of values to search for. + True if the dictionary has associated all of the values in .Value with .Key. + + + + If the derived class does not use the default comparison for values, this + methods should be overridden to compare two values for equality. This is + used for the correct implementation of ICollection.Contains on the Values + and KeyValuePairs collections. + + First value to compare. + Second value to compare. + True if the values are equal. + + + + Gets a count of the number of values associated with a key. The + default implementation is slow; it enumerators all of the values + (using TryEnumerateValuesForKey) to count them. A derived class + may be able to supply a more efficient implementation. + + The key to count values for. + The number of values associated with . + + + + Gets a total count of values in the collection. This default implementation + is slow; it enumerates all of the keys in the dictionary and calls CountValues on each. + A derived class may be able to supply a more efficient implementation. + + The total number of values associated with all keys in the dictionary. + + + + Replaces all values associated with with the single value . + + This implementation simply calls Remove, followed by Add. + The key to associate with. + The new values to be associated with . + Returns true if some values were removed. Returns false if was not + present in the dictionary before Replace was called. + + + + Replaces all values associated with with a new collection + of values. If the collection does not permit duplicate values, and has duplicate + items, then only the last of duplicates is added. + + The key to associate with. + The new values to be associated with . + Returns true if some values were removed. Returns false if was not + present in the dictionary before Replace was called. + + + + Shows the string representation of the dictionary. The string representation contains + a list of the mappings in the dictionary. + + The string representation of the dictionary. + + + + Display the contents of the dictionary in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + Enumerate all the keys in the dictionary, and for each key, the collection of values for that key. + + An enumerator to enumerate all the key, ICollection<value> pairs in the dictionary. + + + + Gets the number of keys in the dictionary. This property must be overridden + in the derived class. + + + + + Gets a read-only collection all the keys in this dictionary. + + An readonly ICollection<TKey> of all the keys in this dictionary. + + + + Gets a read-only collection of all the values in the dictionary. + + A read-only ICollection<TValue> of all the values in the dictionary. + + + + Gets a read-only collection of all the value collections in the dictionary. + + A read-only ICollection<IEnumerable<TValue>> of all the values in the dictionary. + + + + Gets a read-only collection of all key-value pairs in the dictionary. If a key has multiple + values associated with it, then a key-value pair is present for each value associated + with the key. + + + + + Returns a collection of all of the values in the dictionary associated with , + or changes the set of values associated with . + If the key is not present in the dictionary, an ICollection enumerating no + values is returned. The returned collection of values is read-write, and can be used to + modify the collection of values associated with the key. + + The key to get the values associated with. + An ICollection<TValue> with all the values associated with . + + + + Gets a collection of all the values in the dictionary associated with , + or changes the set of values associated with . + If the key is not present in the dictionary, a KeyNotFound exception is thrown. + + The key to get the values associated with. + An IEnumerable<TValue> that enumerates all the values associated with . + The given key is not present in the dictionary. + + + + A private class that provides the ICollection<TValue> for a particular key. This is the collection + that is returned from the indexer. The collections is read-write, live, and can be used to add, remove, + etc. values from the multi-dictionary. + + + + + Constructor. Initializes this collection. + + Dictionary we're using. + The key we're looking at. + + + + Remove the key and all values associated with it. + + + + + Add a new values to this key. + + New values to add. + + + + Remove a value currently associated with key. + + Value to remove. + True if item was assocaited with key, false otherwise. + + + + A simple function that returns an IEnumerator<TValue> that + doesn't yield any values. A helper. + + An IEnumerator<TValue> that yields no values. + + + + Enumerate all the values associated with key. + + An IEnumerator<TValue> that enumerates all the values associated with key. + + + + Determines if the given values is associated with key. + + Value to check for. + True if value is associated with key, false otherwise. + + + + Get the number of values associated with the key. + + + + + A private class that implements ICollection<TKey> and ICollection for the + Keys collection. The collection is read-only. + + + + + Constructor. + + The dictionary this is associated with. + + + + A private class that implements ICollection<TValue> and ICollection for the + Values collection. The collection is read-only. + + + + + A private class that implements ICollection<ICollection<TValue>> and ICollection for the + Values collection on IDictionary. The collection is read-only. + + + + + A private class that implements ICollection<KeyValuePair<TKey,TValue>> and ICollection for the + KeyValuePairs collection. The collection is read-only. + + + + + Create a new MultiDictionary. The default ordering of keys and values are used. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + The default ordering of keys and values will be used, as defined by TKey and TValue's implementation + of IComparable<T> (or IComparable if IComparable<T> is not implemented). If a different ordering should be + used, other constructors allow a custom Comparer or IComparer to be passed to changed the ordering. + Can the same value be associated with a key multiple times? + TKey or TValue does not implement either IComparable<T> or IComparable. + + + + Create a new MultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + An IEqualityComparer<TKey> instance that will be used to compare keys. + TValue does not implement either IComparable<TValue> or IComparable. + + + + Create a new MultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + An IEqualityComparer<TKey> instance that will be used to compare keys. + An IEqualityComparer<TValue> instance that will be used to compare values. + + + + Create a new MultiDictionary. Private constructor, for use by Clone(). + + + + + Adds a new value to be associated with a key. If duplicate values are permitted, this + method always adds a new key-value pair to the dictionary. + If duplicate values are not permitted, and already has a value + equal to associated with it, then that value is replaced with , + and the number of values associate with is unchanged. + + The key to associate with. + The value to associated with . + + + + Removes a given value from the values associated with a key. If the + last value is removed from a key, the key is removed also. + + A key to remove a value from. + The value to remove. + True if was associated with (and was + therefore removed). False if was not associated with . + + + + Removes a key and all associated values from the dictionary. If the + key is not present in the dictionary, it is unchanged and false is returned. + + The key to remove. + True if the key was present and was removed. Returns + false if the key was not present. + + + + Removes all keys and values from the dictionary. + + + + + Determine if two values are equal. + + First value to compare. + Second value to compare. + True if the values are equal. + + + + Checks to see if is associated with + in the dictionary. + + The key to check. + The value to check. + True if is associated with . + + + + Checks to see if the key is present in the dictionary and has + at least one value associated with it. + + The key to check. + True if is present and has at least + one value associated with it. Returns false otherwise. + + + + Enumerate all the keys in the dictionary. + + An IEnumerator<TKey> that enumerates all of the keys in the dictionary that + have at least one value associated with them. + + + + Enumerate the values in the a KeyAndValues structure. Can't return + the array directly because: + a) The array might be larger than the count. + b) We can't allow clients to down-cast to the array and modify it. + c) We have to abort enumeration if the hash changes. + + Item with the values to enumerate.. + An enumerable that enumerates the items in the KeyAndValues structure. + + + + Determines if this dictionary contains a key equal to . If so, all the values + associated with that key are returned through the values parameter. + + The key to search for. + Returns all values associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Gets the number of values associated with a given key. + + The key to count values of. + The number of values associated with . If + is not present in the dictionary, zero is returned. + + + + Makes a shallow clone of this dictionary; i.e., if keys or values of the + dictionary are reference types, then they are not cloned. If TKey or TValue is a value type, + then each element is copied as if by simple assignment. + + Cloning the dictionary takes time O(N), where N is the number of key-value pairs in the dictionary. + The cloned dictionary. + + + + Implements ICloneable.Clone. Makes a shallow clone of this dictionary; i.e., if keys or values are reference types, then they are not cloned. + + The cloned dictionary. + + + + Throw an InvalidOperationException indicating that this type is not cloneable. + + Type to test. + + + + Makes a deep clone of this dictionary. A new dictionary is created with a clone of + each entry of this dictionary, by calling ICloneable.Clone on each element. If TKey or TValue is + a value type, then each element is copied as if by simple assignment. + + If TKey or TValue is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the dictionary takes time O(N log N), where N is the number of key-value pairs in the dictionary. + The cloned dictionary. + TKey or TValue is a reference type that does not implement ICloneable. + + + + Returns the IEqualityComparer<T> used to compare keys in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. Otherwise + the default comparer for TKey (EqualityComparer<TKey>.Default) is returned. + + + + Returns the IEqualityComparer<T> used to compare values in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. Otherwise + the default comparer for TValue (EqualityComparer<TValue>.Default) is returned. + + + + Gets the number of key-value pairs in the dictionary. Each value associated + with a given key is counted. If duplicate values are permitted, each duplicate + value is included in the count. + + The number of key-value pairs in the dictionary. + + + + A structure to hold the key and the values associated with the key. + The number of values must always be 1 or greater in a version that is stored, but + can be zero in a dummy version used only for lookups. + + + + + The key. + + + + + The number of values. Always at least 1 except in a dummy version for lookups. + + + + + An array of values. + + + + + Create a dummy KeyAndValues with just the key, for lookups. + + The key to use. + + + + Make a copy of a KeyAndValues, copying the array. + + KeyAndValues to copy. + A copied version. + + + + This class implements IEqualityComparer for KeysAndValues, allowing them to be + compared by their keys. An IEqualityComparer on keys is required. + + + + + ListBase is an abstract class that can be used as a base class for a read-write collection that needs + to implement the generic IList<T> and non-generic IList collections. The derived class needs + to override the following methods: Count, Clear, Insert, RemoveAt, and the indexer. The implementation + of all the other methods in IList<T> and IList are handled by ListBase. + + + + + + Creates a new ListBase. + + + + + This method must be overridden by the derived class to empty the list + of all items. + + + + + This method must be overridden by the derived class to insert a new + item at the given index. + + The index in the list to insert the item at. After the + insertion, the inserted item is located at this index. The + first item in the list has index 0. + The item to insert at the given index. + is + less than zero or greater than Count. + + + + This method must be overridden by the derived class to remove the + item at the given index. + + The index in the list to remove the item at. The + first item in the list has index 0. + is + less than zero or greater than or equal to Count. + + + + Enumerates all of the items in the list, in order. The item at index 0 + is enumerated first, then the item at index 1, and so on. + + The enumerator does not check for changes made + to the structure of the list. Thus, changes to the list during + enumeration may cause incorrect enumeration or out of range + exceptions. Consider overriding this method and adding checks + for structural changes. + An IEnumerator<T> that enumerates all the + items in the list. + + + + Determines if the list contains any item that compares equal to . + The implementation simply checks whether IndexOf(item) returns a non-negative value. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + True if the list contains an item that compares equal to . + + + + Adds an item to the end of the list. This method is equivalent to calling: + Insert(Count, item) + + The item to add to the list. + + + + Searches the list for the first item that compares equal to . + If one is found, it is removed. Otherwise, the list is unchanged. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to remove from the list. + True if an item was found and removed that compared equal to + . False if no such item was in the list. + + + + Copies all the items in the list, in order, to , + starting at index 0. + + The array to copy to. This array must have a size + that is greater than or equal to Count. + + + + Copies all the items in the list, in order, to , + starting at . + + The array to copy to. This array must have a size + that is greater than or equal to Count + arrayIndex. + The starting index in + to copy to. + + + + Copies a range of elements from the list to , + starting at . + + The starting index in the source list of the range to copy. + The array to copy to. This array must have a size + that is greater than or equal to Count + arrayIndex. + The starting index in + to copy to. + The number of items to copy. + + + + Provides a read-only view of this list. The returned IList<T> provides + a view of the list that prevents modifications to the list. Use the method to provide + access to the list without allowing changes. Since the returned object is just a view, + changes to the list will be reflected in the view. + + An IList<T> that provides read-only access to the list. + + + + Finds the first item in the list that satisfies the condition + defined by . If no item matches the condition, than + the default value for T (null or all-zero) is returned. + + If the default value for T (null or all-zero) matches the condition defined by , + and the list might contain the default value, then it is impossible to distinguish the different between finding + the default value and not finding any item. To distinguish these cases, use . + A delegate that defined the condition to check for. + The first item that satisfies the condition . If no item satisfies that + condition, the default value for T is returned. + + + + + Finds the first item in the list that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + If true is returned, this parameter receives the first item in the list + that satifies the condition defined by . + True if an item that satisfies the condition was found. False + if no item in the list satisfies that condition. + + + + Finds the last item in the list that satisfies the condition + defined by . If no item matches the condition, than + the default value for T (null or all-zero) is returned. + + If the default value for T (null or all-zero) matches the condition defined by , + and the list might contain the default value, then it is impossible to distinguish the different between finding + the default value and not finding any item. To distinguish these cases, use . + A delegate that defined the condition to check for. + The last item that satisfies the condition . If no item satisfies that + condition, the default value for T is returned. + + + + + Finds the last item in the list that satisfies the condition + defined by . + + A delegate that defines the condition to check for. + If true is returned, this parameter receives the last item in the list + that satifies the condition defined by . + True if an item that satisfies the condition was found. False + if no item in the list satisfies that condition. + + + + Finds the index of the first item in the list that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The index of the first item that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item, in the range of items extending from to the end, that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The starting index of the range to check. + The index of the first item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item, in the range of items starting from , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The starting index of the range to check. + The number of items in range to check. + The index of the first item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item in the list that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The index of the last item that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item, in the range of items extending from the beginning + of the list to , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The ending index of the range to check. + The index of the last item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the last item, in the range of items ending at , that satisfies the condition + defined by . If no item matches the condition, -1 is returned. + + A delegate that defined the condition to check for. + The ending index of the range to check. + The number of items in range to check. + The index of the last item in the given range that satisfies the condition . If no item satisfies that + condition, -1 is returned. + + + + Finds the index of the first item in the list that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The index of the first item in the list that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the first item, in the range of items extending from to the end, + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The starting index of the range to check. + The index of the first item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the first item, in the range of items starting from , + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The starting index of the range to check. + The number of items in range to check. + The index of the first item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item in the list that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The index of the last item in the list that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item, in the range of items extending from the beginning + of the list to , that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search fror. + The ending index of the range to check. + The index of the last item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Finds the index of the last item, in the range of items ending at , + that is equal to . + + The default implementation of equality for type T is used in the search. This is the + equality defined by IComparable<T> or object.Equals. + The item to search for. + The ending index of the range to check. + The number of items in range to check. + The index of the last item in the given range that that is equal to . If no item is equal + to , -1 is returned. + + + + Returns a view onto a sub-range of this list. Items are not copied; the + returned IList<T> is simply a different view onto the same underlying items. Changes to this list + are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the + view, but insertions and deletions in the underlying list do not. + + + This method can be used to apply an algorithm to a portion of a list. For example: + Algorithms.ReverseInPlace(deque.Range(3, 6)) + will reverse the 6 items beginning at index 3. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-part of this list. + or is negative. + + is greater than the + size of the list. + + + + Convert the given parameter to T. Throw an ArgumentException + if it isn't. + + parameter name + parameter value + + + + Adds an item to the end of the list. This method is equivalent to calling: + Insert(Count, item) + + The item to add to the list. + cannot be converted to T. + + + + Removes all the items from the list, resulting in an empty list. + + + + + Determines if the list contains any item that compares equal to . + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + + + + Find the first occurrence of an item equal to + in the list, and returns the index of that item. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to search for. + The index of , or -1 if no item in the + list compares equal to . + + + + Insert a new + item at the given index. + + The index in the list to insert the item at. After the + insertion, the inserted item is located at this index. The + first item in the list has index 0. + The item to insert at the given index. + is + less than zero or greater than Count. + cannot be converted to T. + + + + Searches the list for the first item that compares equal to . + If one is found, it is removed. Otherwise, the list is unchanged. + + Equality in the list is determined by the default sense of + equality for T. If T implements IComparable<T>, the + Equals method of that interface is used to determine equality. Otherwise, + Object.Equals is used to determine equality. + The item to remove from the list. + cannot be converted to T. + + + + Removes the + item at the given index. + + The index in the list to remove the item at. The + first item in the list has index 0. + is + less than zero or greater than or equal to Count. + + + + The property must be overridden by the derived class to return the number of + items in the list. + + The number of items in the list. + + + + The indexer must be overridden by the derived class to get and set + values of the list at a particular index. + + The index in the list to get or set an item at. The + first item in the list has index 0, and the last has index Count-1. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + Returns whether the list is a fixed size. This implementation always returns false. + + Alway false, indicating that the list is not fixed size. + + + + Returns whether the list is read only. This implementation returns the value + from ICollection<T>.IsReadOnly, which is by default, false. + + By default, false, indicating that the list is not read only. + + + + Gets or sets the + value at a particular index in the list. + + The index in the list to get or set an item at. The + first item in the list has index 0, and the last has index Count-1. + The item at the given index. + is + less than zero or greater than or equal to Count. + cannot be converted to T. + + + + Set<T> is a collection that contains items of type T. + The item are maintained in a haphazard, unpredictable order, and duplicate items are not allowed. + + +

The items are compared in one of two ways. If T implements IComparable<T> + then the Equals method of that interface will be used to compare items, otherwise the Equals + method from Object will be used. Alternatively, an instance of IComparer<T> can be passed + to the constructor to use to compare items.

+

Set is implemented as a hash table. Inserting, deleting, and looking up an + an element all are done in approximately constant time, regardless of the number of items in the Set.

+

is similar, but uses comparison instead of hashing, and does maintains + the items in sorted order.

+
+ +
+ + + Creates a new Set. The Equals method and GetHashCode method on T + will be used to compare items for equality. + + + Items that are null are permitted, and will be sorted before all other items. + + + + + Creates a new Set. The Equals and GetHashCode method of the passed comparer object + will be used to compare items in this set. + + An instance of IEqualityComparer<T> that will be used to compare items. + + + + Creates a new Set. The Equals method and GetHashCode method on T + will be used to compare items for equality. + + + Items that are null are permitted. + + A collection with items to be placed into the Set. + + + + Creates a new Set. The Equals and GetHashCode method of the passed comparer object + will be used to compare items in this set. The set is + initialized with all the items in the given collection. + + A collection with items to be placed into the Set. + An instance of IEqualityComparer<T> that will be used to compare items. + + + + Creates a new Set given a comparer and a tree that contains the data. Used + internally for Clone. + + EqualityComparer for the set. + Data for the set. + + + + Makes a shallow clone of this set; i.e., if items of the + set are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the set takes time O(N), where N is the number of items in the set. + The cloned set. + + + + Makes a shallow clone of this set; i.e., if items of the + set are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the set takes time O(N), where N is the number of items in the set. + The cloned set. + + + + Makes a deep clone of this set. A new set is created with a clone of + each element of this set, by calling ICloneable.Clone on each element. If T is + a value type, then each element is copied as if by simple assignment. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the set takes time O(N), where N is the number of items in the set. + The cloned set. + T is a reference type that does not implement ICloneable. + + + + Returns an enumerator that enumerates all the items in the set. + The items are enumerated in sorted order. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the items, which uses this method implicitly.

+

If an item is added to or deleted from the set while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumerating all the items in the set takes time O(N), where N is the number + of items in the set.

+
+ An enumerator for enumerating all the items in the Set. +
+ + + Determines if this set contains an item equal to . The set + is not changed. + + Searching the set for an item takes approximately constant time, regardless of the number of items in the set. + The item to search for. + True if the set contains . False if the set does not contain . + + + + Determines if this set contains an item equal to , according to the + comparison mechanism that was used when the set was created. The set + is not changed. + If the set does contain an item equal to , then the item from the set is returned. + + Searching the set for an item takes approximately constant time, regardless of the number of items in the set. + + In the following example, the set contains strings which are compared in a case-insensitive manner. + + Set<string> set = new Set<string>(StringComparer.CurrentCultureIgnoreCase); + set.Add("HELLO"); + string s; + bool b = set.TryGetItem("Hello", out s); // b receives true, s receives "HELLO". + + + The item to search for. + Returns the item from the set that was equal to . + True if the set contains . False if the set does not contain . + + + + Adds a new item to the set. If the set already contains an item equal to + , that item is replaced with . + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes approximately constant time, regardless of the number of items in the set. + The item to add to the set. + True if the set already contained an item equal to (which was replaced), false + otherwise. + + + + Adds a new item to the set. If the set already contains an item equal to + , that item is replaced with . + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes approximately constant time, regardless of the number of items in the set. + The item to add to the set. + True if the set already contained an item equal to (which was replaced), false + otherwise. + + + + Adds all the items in to the set. If the set already contains an item equal to + one of the items in , that item will be replaced. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding the collection takes time O(M), where M is the + number of items in . + A collection of items to add to the set. + + + + Searches the set for an item equal to , and if found, + removes it from the set. If not found, the set is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing an item from the set takes approximately constant time, regardless of the size of the set. + The item to remove. + True if was found and removed. False if was not in the set. + + + + Removes all the items in from the set. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing the collection takes time O(M), where M is the + number of items in . + A collection of items to remove from the set. + The number of items removed from the set. + is null. + + + + Removes all items from the set. + + Clearing the set takes a constant amount of time, regardless of the number of items in it. + + + + Check that this set and another set were created with the same comparison + mechanism. Throws exception if not compatible. + + Other set to check comparision mechanism. + If otherSet and this set don't use the same method for comparing items. + + + + Determines if this set is a superset of another set. Neither set is modified. + This set is a superset of if every element in + is also in this set. + IsSupersetOf is computed in time O(M), where M is the size of the + . + + Set to compare to. + True if this is a superset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a proper superset of another set. Neither set is modified. + This set is a proper superset of if every element in + is also in this set. + Additionally, this set must have strictly more items than . + + IsProperSubsetOf is computed in time O(M), where M is the size of + . + Set to compare to. + True if this is a proper superset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a subset of another set. Neither set is modified. + This set is a subset of if every element in this set + is also in . + + IsSubsetOf is computed in time O(N), where N is the size of the this set. + Set to compare to. + True if this is a subset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a proper subset of another set. Neither set is modified. + This set is a subset of if every element in this set + is also in . Additionally, this set must have strictly + fewer items than . + + IsProperSubsetOf is computed in time O(N), where N is the size of the this set. + Set to compare to. + True if this is a proper subset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is equal to another set. This set is equal to + if they contain the same items. + + IsEqualTo is computed in time O(N), where N is the number of items in + this set. + Set to compare to + True if this set is equal to , false otherwise. + This set and don't use the same method for comparing items. + + + + Determines if this set is disjoint from another set. Two sets are disjoint + if no item from one set is equal to any item in the other set. + + + The answer is computed in time O(N), where N is the size of the smaller set. + + Set to check disjointness with. + True if the two sets are disjoint, false otherwise. + This set and don't use the same method for comparing items. + + + + Computes the union of this set with another set. The union of two sets + is all items that appear in either or both of the sets. This set receives + the union of the two sets, the other set is unchanged. + + + If equal items appear in both sets, the union will include an arbitrary choice of one of the + two equal items. + The union of two sets is computed in time O(M + N), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to union with. + This set and don't use the same method for comparing items. + + + + Computes the union of this set with another set. The union of two sets + is all items that appear in either or both of the sets. A new set is + created with the union of the sets and is returned. This set and the other set + are unchanged. + + + If equal items appear in both sets, the union will include an arbitrary choice of one of the + two equal items. + The union of two sets is computed in time O(M + N), where M is the size of the + one set, and N is the size of the other set. + + Set to union with. + The union of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the intersection of this set with another set. The intersection of two sets + is all items that appear in both of the sets. This set receives + the intersection of the two sets, the other set is unchanged. + + + When equal items appear in both sets, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to intersection with. + This set and don't use the same method for comparing items. + + + + Computes the intersection of this set with another set. The intersection of two sets + is all items that appear in both of the sets. A new set is + created with the intersection of the sets and is returned. This set and the other set + are unchanged. + + + When equal items appear in both sets, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to intersection with. + The intersection of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the difference of this set with another set. The difference of these two sets + is all items that appear in this set, but not in . This set receives + the difference of the two sets; the other set is unchanged. + + + The difference of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to difference with. + This set and don't use the same method for comparing items. + + + + Computes the difference of this set with another set. The difference of these two sets + is all items that appear in this set, but not in . A new set is + created with the difference of the sets and is returned. This set and the other set + are unchanged. + + + The difference of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to difference with. + The difference of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the symmetric difference of this set with another set. The symmetric difference of two sets + is all items that appear in either of the sets, but not both. This set receives + the symmetric difference of the two sets; the other set is unchanged. + + + The symmetric difference of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to symmetric difference with. + This set and don't use the same method for comparing items. + + + + Computes the symmetric difference of this set with another set. The symmetric difference of two sets + is all items that appear in either of the sets, but not both. A new set is + created with the symmetric difference of the sets and is returned. This set and the other set + are unchanged. + + + The symmetric difference of two sets is computed in time O(N), where N is the size of the smaller set. + + Set to symmetric difference with. + The symmetric difference of the two sets. + This set and don't use the same method for comparing items. + + + + Returns the IEqualityComparer<T> used to compare items in this set. + + If the set was created using a comparer, that comparer is returned. Otherwise + the default comparer for T (EqualityComparer<T>.Default) is returned. + + + + Returns the number of items in the set. + + The size of the set is returned in constant time. + The number of items in the set. + + + + A collection of methods to create IComparer and IEqualityComparer instances in various ways. + + + + + Given an Comparison on a type, returns an IComparer on that type. + + T to compare. + Comparison delegate on T + IComparer that uses the comparison. + + + + Given an IComparer on TKey, returns an IComparer on + key-value Pairs. + + TKey of the pairs + TValue of the apris + IComparer on TKey + IComparer for comparing key-value pairs. + + + + Given an IEqualityComparer on TKey, returns an IEqualityComparer on + key-value Pairs. + + TKey of the pairs + TValue of the apris + IComparer on TKey + IEqualityComparer for comparing key-value pairs. + + + + Given an IComparer on TKey and TValue, returns an IComparer on + key-value Pairs of TKey and TValue, comparing first keys, then values. + + TKey of the pairs + TValue of the apris + IComparer on TKey + IComparer on TValue + IComparer for comparing key-value pairs. + + + + Given an Comparison on TKey, returns an IComparer on + key-value Pairs. + + TKey of the pairs + TValue of the apris + Comparison delegate on TKey + IComparer for comparing key-value pairs. + + + + Given an element type, check that it implements IComparable<T> or IComparable, then returns + a IComparer that can be used to compare elements of that type. + + The IComparer<T> instance. + T does not implement IComparable<T>. + + + + Given an key and value type, check that TKey implements IComparable<T> or IComparable, then returns + a IComparer that can be used to compare KeyValuePairs of those types. + + The IComparer<KeyValuePair<TKey, TValue>> instance. + TKey does not implement IComparable<T>. + + + + Class to change an IEqualityComparer<TKey> to an IEqualityComparer<KeyValuePair<TKey, TValue>> + Only the keys are compared. + + + + + Class to change an IComparer<TKey> to an IComparer<KeyValuePair<TKey, TValue>> + Only the keys are compared. + + + + + Class to change an IComparer<TKey> and IComparer<TValue> to an IComparer<KeyValuePair<TKey, TValue>> + Keys are compared, followed by values. + + + + + Class to change an Comparison<T> to an IComparer<T>. + + + + + Class to change an Comparison<TKey> to an IComparer<KeyValuePair<TKey, TValue>>. + GetHashCode cannot be used on this class. + + + + + MultiDictionaryBase is a base class that can be used to more easily implement a class + that associates multiple values to a single key. The class implements the generic + IDictionary<TKey, ICollection<TValue>> interface. The resulting collection + is read-only -- items cannot be added or removed. + + + To use ReadOnlyMultiDictionaryBase as a base class, the derived class must override + Count, Contains(TKey,TValue), EnumerateKeys, and TryEnumerateValuesForKey . + + The key type of the dictionary. + The value type of the dictionary. + + + + Creates a new ReadOnlyMultiDictionaryBase. + + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + Enumerate all the keys in the dictionary. This method must be overridden by a derived + class. + + An IEnumerator<TKey> that enumerates all of the keys in the collection that + have at least one value associated with them. + + + + Enumerate all of the values associated with a given key. This method must be overridden + by the derived class. If the key exists and has values associated with it, an enumerator for those + values is returned throught . If the key does not exist, false is returned. + + The key to get values for. + If true is returned, this parameter receives an enumerators that + enumerates the values associated with that key. + True if the key exists and has values associated with it. False otherwise. + + + + Implements IDictionary<TKey, IEnumerable<TValue>>.Add. If the + key is already present, and ArgumentException is thrown. Otherwise, a + new key is added, and new values are associated with that key. + + Key to add. + Values to associate with that key. + The key is already present in the dictionary. + + + + Removes a key from the dictionary. This method must be overridden in the derived class. + + Key to remove from the dictionary. + True if the key was found, false otherwise. + + + + Determines if this dictionary contains a key equal to . If so, all the values + associated with that key are returned through the values parameter. This method must be + overridden by the derived class. + + The key to search for. + Returns all values associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Determines whether a given key is found in the dictionary. + + The default implementation simply calls TryGetValue. + It may be appropriate to override this method to + provide a more efficient implementation. + Key to look for in the dictionary. + True if the key is present in the dictionary. + + + + Determines if this dictionary contains a key-value pair equal to and + . The dictionary is not changed. This method must be overridden in the derived class. + + The key to search for. + The value to search for. + True if the dictionary has associated with . + + + + Determines if this dictionary contains the given key and all of the values associated with that key.. + + A key and collection of values to search for. + True if the dictionary has associated all of the values in .Value with .Key. + + + + If the derived class does not use the default comparison for values, this + methods should be overridden to compare two values for equality. This is + used for the correct implementation of ICollection.Contains on the Values + and KeyValuePairs collections. + + First value to compare. + Second value to compare. + True if the values are equal. + + + + Gets a count of the number of values associated with a key. The + default implementation is slow; it enumerators all of the values + (using TryEnumerateValuesForKey) to count them. A derived class + may be able to supply a more efficient implementation. + + The key to count values for. + The number of values associated with . + + + + Gets a total count of values in the collection. This default implementation + is slow; it enumerates all of the keys in the dictionary and calls CountValues on each. + A derived class may be able to supply a more efficient implementation. + + The total number of values associated with all keys in the dictionary. + + + + Shows the string representation of the dictionary. The string representation contains + a list of the mappings in the dictionary. + + The string representation of the dictionary. + + + + Display the contents of the dictionary in the debugger. This is intentionally private, it is called + only from the debugger due to the presence of the DebuggerDisplay attribute. It is similar + format to ToString(), but is limited to 250-300 characters or so, so as not to overload the debugger. + + The string representation of the items in the collection, similar in format to ToString(). + + + + Enumerate all the keys in the dictionary, and for each key, the collection of values for that key. + + An enumerator to enumerate all the key, ICollection<value> pairs in the dictionary. + + + + Gets the number of keys in the dictionary. This property must be overridden + in the derived class. + + + + + Gets a read-only collection all the keys in this dictionary. + + An readonly ICollection<TKey> of all the keys in this dictionary. + + + + Gets a read-only collection of all the values in the dictionary. + + A read-only ICollection<TValue> of all the values in the dictionary. + + + + Gets a read-only collection of all the value collections in the dictionary. + + A read-only ICollection<IEnumerable<TValue>> of all the values in the dictionary. + + + + Gets a read-only collection of all key-value pairs in the dictionary. If a key has multiple + values associated with it, then a key-value pair is present for each value associated + with the key. + + + + + Returns a collection of all of the values in the dictionary associated with . + If the key is not present in the dictionary, an ICollection with no + values is returned. The returned ICollection is read-only. + + The key to get the values associated with. + An ICollection<TValue> with all the values associated with . + + + + Gets a collection of all the values in the dictionary associated with . + If the key is not present in the dictionary, a KeyNotFound exception is thrown. + + The key to get the values associated with. + An IEnumerable<TValue> that enumerates all the values associated with . + The given key is not present in the dictionary. + The set accessor is called. + + + + A private class that provides the ICollection<TValue> for a particular key. This is the collection + that is returned from the indexer. The collections is read-write, live, and can be used to add, remove, + etc. values from the multi-dictionary. + + + + + Constructor. Initializes this collection. + + Dictionary we're using. + The key we're looking at. + + + + A simple function that returns an IEnumerator<TValue> that + doesn't yield any values. A helper. + + An IEnumerator<TValue> that yields no values. + + + + Enumerate all the values associated with key. + + An IEnumerator<TValue> that enumerates all the values associated with key. + + + + Determines if the given values is associated with key. + + Value to check for. + True if value is associated with key, false otherwise. + + + + Get the number of values associated with the key. + + + + + A private class that implements ICollection<TKey> and ICollection for the + Keys collection. The collection is read-only. + + + + + Constructor. + + The dictionary this is associated with. + + + + A private class that implements ICollection<TValue> and ICollection for the + Values collection. The collection is read-only. + + + + + A private class that implements ICollection<IEnumerable<TValue>> and ICollection for the + Values collection on IDictionary. The collection is read-only. + + + + + A private class that implements ICollection<KeyValuePair<TKey,TValue>> and ICollection for the + KeyValuePairs collection. The collection is read-only. + + + + + The BinaryPredicate delegate type encapsulates a method that takes two + items of the same type, and returns a boolean value representating + some relationship between them. For example, checking whether two + items are equal or equivalent is one kind of binary predicate. + + The first item. + The second item. + Whether item1 and item2 satisfy the relationship that the BinaryPredicate defines. + + + + Algorithms contains a number of static methods that implement + algorithms that work on collections. Most of the methods deal with + the standard generic collection interfaces such as IEnumerable<T>, + ICollection<T> and IList<T>. + + + + + Returns a view onto a sub-range of a list. Items from are not copied; the + returned IList<T> is simply a different view onto the same underlying items. Changes to + are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the + view, but insertions and deletions in the underlying list do not. + + This method can be used to apply an algorithm to a portion of a list. For example: + Algorithms.ReverseInPlace(Algorithms.Range(list, 3, 6)) + will reverse the 6 items beginning at index 3. + The type of the items in the list. + The list to view. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-list. + is null. + or is negative. + + is greater than the + size of . + + + + Returns a view onto a sub-range of an array. Items from are not copied; the + returned IList<T> is simply a different view onto the same underlying items. Changes to + are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the + view. After an insertion, the last item in "falls off the end". After a deletion, the + last item in array becomes the default value (0 or null). + + This method can be used to apply an algorithm to a portion of a array. For example: + Algorithms.ReverseInPlace(Algorithms.Range(array, 3, 6)) + will reverse the 6 items beginning at index 3. + The array to view. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-array. + is null. + or is negative. + + is greater than the + size of . + + + + Returns a read-only view onto a collection. The returned ICollection<T> interface + only allows operations that do not change the collection: GetEnumerator, Contains, CopyTo, + Count. The ReadOnly property returns false, indicating that the collection is read-only. All other + methods on the interface throw a NotSupportedException. + + The data in the underlying collection is not copied. If the underlying + collection is changed, then the read-only view also changes accordingly. + The type of items in the collection. + The collection to wrap. + A read-only view onto . If is null, then null is returned. + + + + Returns a read-only view onto a list. The returned IList<T> interface + only allows operations that do not change the list: GetEnumerator, Contains, CopyTo, + Count, IndexOf, and the get accessor of the indexer. + The IsReadOnly property returns true, indicating that the list is read-only. All other + methods on the interface throw a NotSupportedException. + + The data in the underlying list is not copied. If the underlying + list is changed, then the read-only view also changes accordingly. + The type of items in the list. + The list to wrap. + A read-only view onto . Returns null if is null. + If is already read-only, returns . + + + + Returns a read-only view onto a dictionary. The returned IDictionary<TKey,TValue> interface + only allows operations that do not change the dictionary. + The IsReadOnly property returns true, indicating that the dictionary is read-only. All other + methods on the interface throw a NotSupportedException. + + The data in the underlying dictionary is not copied. If the underlying + dictionary is changed, then the read-only view also changes accordingly. + The dictionary to wrap. + A read-only view onto . Returns null if is null. + If is already read-only, returns . + + + + Given a non-generic IEnumerable interface, wrap a generic IEnumerable<T> + interface around it. The generic interface will enumerate the same objects as the + underlying non-generic collection, but can be used in places that require a generic interface. + The underlying non-generic collection must contain only items that + are of type or a type derived from it. This method is useful + when interfacing older, non-generic collections to newer code that uses generic interfaces. + + Some collections implement both generic and non-generic interfaces. For efficiency, + this method will first attempt to cast to IEnumerable<T>. + If that succeeds, it is returned; otherwise, a wrapper object is created. + The item type of the wrapper collection. + An untyped collection. This collection should only contain + items of type or a type derived from it. + A generic IEnumerable<T> wrapper around . + If is null, then null is returned. + + + + Given a non-generic ICollection interface, wrap a generic ICollection<T> + interface around it. The generic interface will enumerate the same objects as the + underlying non-generic collection, but can be used in places that require a generic interface. + The underlying non-generic collection must contain only items that + are of type or a type derived from it. This method is useful + when interfacing older, non-generic collections to newer code that uses generic interfaces. + + Some collections implement both generic and non-generic interfaces. For efficiency, + this method will first attempt to cast to ICollection<T>. + If that succeeds, it is returned; otherwise, a wrapper object is created. + Unlike the generic interface, the non-generic ICollection interfaces does + not contain methods for adding or removing items from the collection. For this reason, + the returned ICollection<T> will be read-only. + The item type of the wrapper collection. + An untyped collection. This collection should only contain + items of type or a type derived from it. + A generic ICollection<T> wrapper around . + If is null, then null is returned. + + + + Given a non-generic IList interface, wrap a generic IList<T> + interface around it. The generic interface will enumerate the same objects as the + underlying non-generic list, but can be used in places that require a generic interface. + The underlying non-generic list must contain only items that + are of type or a type derived from it. This method is useful + when interfacing older, non-generic lists to newer code that uses generic interfaces. + + Some collections implement both generic and non-generic interfaces. For efficiency, + this method will first attempt to cast to IList<T>. + If that succeeds, it is returned; otherwise, a wrapper object is created. + The item type of the wrapper list. + An untyped list. This list should only contain + items of type or a type derived from it. + A generic IList<T> wrapper around . + If is null, then null is returned. + + + + Given a generic ICollection<T> interface, wrap a non-generic (untyped) + ICollection interface around it. The non-generic interface will contain the same objects as the + underlying generic collection, but can be used in places that require a non-generic interface. + This method is useful when interfacing generic interfaces with older code that uses non-generic interfaces. + + Many generic collections already implement the non-generic interfaces directly. This + method will first attempt to simply cast to ICollection. If that + succeeds, it is returned; if it fails, then a wrapper object is created. + The item type of the underlying collection. + A typed collection to wrap. + A non-generic ICollection wrapper around . + If is null, then null is returned. + + + + Given a generic IList<T> interface, wrap a non-generic (untyped) + IList interface around it. The non-generic interface will contain the same objects as the + underlying generic list, but can be used in places that require a non-generic interface. + This method is useful when interfacing generic interfaces with older code that uses non-generic interfaces. + + Many generic collections already implement the non-generic interfaces directly. This + method will first attempt to simply cast to IList. If that + succeeds, it is returned; if it fails, then a wrapper object is created. + The item type of the underlying list. + A typed list to wrap. + A non-generic IList wrapper around . + If is null, then null is returned. + + + + Creates a read-write IList<T> wrapper around an array. When an array is + implicitely converted to an IList<T>, changes to the items in the array cannot + be made through the interface. This method creates a read-write IList<T> wrapper + on an array that can be used to make changes to the array. + Use this method when you need to pass an array to an algorithms that takes an + IList<T> and that tries to modify items in the list. Algorithms in this class generally do not + need this method, since they have been design to operate on arrays even when they + are passed as an IList<T>. + + Since arrays cannot be resized, inserting an item causes the last item in the array to be automatically + removed. Removing an item causes the last item in the array to be replaced with a default value (0 or null). Clearing + the list causes all the items to be replaced with a default value. + The array to wrap. + An IList<T> wrapper onto . + + + + Replace all items in a collection equal to a particular value with another values, yielding another collection. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The collection to process. + The value to find and replace within . + The new value to replace with. + An new collection with the items from , in the same order, + with the appropriate replacements made. + + + + Replace all items in a collection equal to a particular value with another values, yielding another collection. A passed + IEqualityComparer is used to determine equality. + + The collection to process. + The value to find and replace within . + The new value to replace with. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + An new collection with the items from , in the same order, + with the appropriate replacements made. + + + + Replace all items in a collection that a predicate evalues at true with a value, yielding another collection. . + + The collection to process. + The predicate used to evaluate items with the collection. If the predicate returns true for a particular + item, the item is replaces with . + The new value to replace with. + An new collection with the items from , in the same order, + with the appropriate replacements made. + + + + Replace all items in a list or array equal to a particular value with another value. The replacement is done in-place, changing + the list. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The value to find and replace within . + The new value to replace with. + + + + Replace all items in a list or array equal to a particular value with another values. + The replacement is done in-place, changing + the list. A passed IEqualityComparer is used to determine equality. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The value to find and replace within . + The new value to replace with. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + + + + Replace all items in a list or array that a predicate evaluates at true with a value. The replacement is done in-place, changing + the list. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The predicate used to evaluate items with the collection. If the predicate returns true for a particular + item, the item is replaces with . + The new value to replace with. + + + + Remove consecutive equal items from a collection, yielding another collection. In each run of consecutive equal items + in the collection, all items after the first item in the run are removed. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The collection to process. + An new collection with the items from , in the same order, + with consecutive duplicates removed. + is null. + + + + Remove consecutive equal items from a collection, yielding another collection. In each run of consecutive equal items + in the collection, all items after the first item in the run are removed. A passed + IEqualityComparer is used to determine equality. + + The collection to process. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + An new collection with the items from , in the same order, + with consecutive duplicates removed. + or is null. + + + + Remove consecutive "equal" items from a collection, yielding another collection. In each run of consecutive equal items + in the collection, all items after the first item in the run are removed. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being removed need not be true equality. + The collection to process. + The BinaryPredicate used to compare items for "equality". An item current is removed if predicate(first, current)==true, where + first is the first item in the group of "duplicate" items. + An new collection with the items from , in the same order, + with consecutive "duplicates" removed. + + + + Remove consecutive equal items from a list or array. In each run of consecutive equal items + in the list, all items after the first item in the run are removed. The removal is done in-place, changing + the list. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + + + + Remove subsequent consecutive equal items from a list or array. In each run of consecutive equal items + in the list, all items after the first item in the run are removed. + The replacement is done in-place, changing + the list. A passed IEqualityComparer is used to determine equality. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + + + + Remove consecutive "equal" items from a list or array. In each run of consecutive equal items + in the list, all items after the first item in the run are removed. The replacement is done in-place, changing + the list. The passed BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being tested for need not be true equality. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to process. + The BinaryPredicate used to compare items for "equality". + + + + Finds the first occurence of consecutive equal items in the + list. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to examine. + The number of consecutive equal items to look for. The count must be at least 1. + The index of the first item in the first run of consecutive equal items, or -1 if no such run exists.. + + + + Finds the first occurence of consecutive equal items in the + list. A passed IEqualityComparer is used to determine equality. + + The list to examine. + The number of consecutive equal items to look for. The count must be at least 1. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + The index of the first item in the first run of consecutive equal items, or -1 if no such run exists. + + + + Finds the first occurence of consecutive "equal" items in the + list. The passed BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being tested for need not be true equality. + The list to examine. + The number of consecutive equal items to look for. The count must be at least 1. + The BinaryPredicate used to compare items for "equality". + The index of the first item in the first run of consecutive equal items, or -1 if no such run exists. + + + + Finds the first occurence of consecutive items in the + list for which a given predicate returns true. + + The list to examine. + The number of consecutive items to look for. The count must be at least 1. + The predicate used to test each item. + The index of the first item in the first run of items where + returns true for all items in the run, or -1 if no such run exists. + + + + Finds the first item in a collection that satisfies the condition + defined by . + + If the default value for T could be present in the collection, and + would be matched by the predicate, then this method is inappropriate, because + you cannot disguish whether the default value for T was actually present in the collection, + or no items matched the predicate. In this case, use TryFindFirstWhere. + The collection to search. + A delegate that defined the condition to check for. + The first item in the collection that matches the condition, or the default value for T (0 or null) if no + item that matches the condition is found. + + + + + Finds the first item in a collection that satisfies the condition + defined by . + + The collection to search. + A delegate that defined the condition to check for. + Outputs the first item in the collection that matches the condition, if the method returns true. + True if an item satisfying the condition was found. False if no such item exists in the collection. + + + + + Finds the last item in a collection that satisfies the condition + defined by . + + If the collection implements IList<T>, then the list is scanned in reverse until a + matching item is found. Otherwise, the entire collection is iterated in the forward direction. + If the default value for T could be present in the collection, and + would be matched by the predicate, then this method is inappropriate, because + you cannot disguish whether the default value for T was actually present in the collection, + or no items matched the predicate. In this case, use TryFindFirstWhere. + The collection to search. + A delegate that defined the condition to check for. + The last item in the collection that matches the condition, or the default value for T (0 or null) if no + item that matches the condition is found. + + + + + Finds the last item in a collection that satisfies the condition + defined by . + + If the collection implements IList<T>, then the list is scanned in reverse until a + matching item is found. Otherwise, the entire collection is iterated in the forward direction. + The collection to search. + A delegate that defined the condition to check for. + Outputs the last item in the collection that matches the condition, if the method returns true. + True if an item satisfying the condition was found. False if no such item exists in the collection. + + + + + Enumerates all the items in that satisfy the condition defined + by . + + The collection to check all the items in. + A delegate that defines the condition to check for. + An IEnumerable<T> that enumerates the items that satisfy the condition. + + + + Finds the index of the first item in a list that satisfies the condition + defined by . + + The list to search. + A delegate that defined the condition to check for. + The index of the first item satisfying the condition. -1 if no such item exists in the list. + + + + Finds the index of the last item in a list that satisfies the condition + defined by . + + The list to search. + A delegate that defined the condition to check for. + The index of the last item satisfying the condition. -1 if no such item exists in the list. + + + + Enumerates the indices of all the items in that satisfy the condition defined + by . + + The list to check all the items in. + A delegate that defines the condition to check for. + An IEnumerable<T> that enumerates the indices of items that satisfy the condition. + + + + Finds the index of the first item in a list equal to a given item. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The item to search for. + The index of the first item equal to . -1 if no such item exists in the list. + + + + Finds the index of the first item in a list equal to a given item. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The item to search for. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + The index of the first item equal to . -1 if no such item exists in the list. + + + + Finds the index of the last item in a list equal to a given item. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The item to search for. + The index of the last item equal to . -1 if no such item exists in the list. + + + + Finds the index of the last item in a list equal to a given item. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The item to search for. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + The index of the last item equal to . -1 if no such item exists in the list. + + + + Enumerates the indices of all the items in a list equal to a given item. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The item to search for. + An IEnumerable<T> that enumerates the indices of items equal to . + + + + Enumerates the indices of all the items in a list equal to a given item. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The item to search for. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + An IEnumerable<T> that enumerates the indices of items equal to . + + + + Finds the index of the first item in a list equal to one of several given items. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The items to search for. + The index of the first item equal to any of the items in the collection . + -1 if no such item exists in the list. + + + + Finds the index of the first item in a list equal to one of several given items. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The items to search for. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode methods will be called. + The index of the first item equal to any of the items in the collection . + -1 if no such item exists in the list. + + + + Finds the index of the first item in a list "equal" to one of several given items. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being removed need not be true equality. This methods finds + first item X which satisfies BinaryPredicate(X,Y), where Y is one of the items in + The list to search. + The items to search for. + The BinaryPredicate used to compare items for "equality". + The index of the first item "equal" to any of the items in the collection , using + as the test for equality. + -1 if no such item exists in the list. + + + + Finds the index of the last item in a list equal to one of several given items. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + The items to search for. + The index of the last item equal to any of the items in the collection . + -1 if no such item exists in the list. + + + + Finds the index of the last item in a list equal to one of several given items. A passed + IEqualityComparer is used to determine equality. + + The list to search. + The items to search for. + The IEqualityComparer<T> used to compare items for equality. + The index of the last item equal to any of the items in the collection . + -1 if no such item exists in the list. + + + + Finds the index of the last item in a list "equal" to one of several given items. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being removed need not be true equality. This methods finds + last item X which satisfies BinaryPredicate(X,Y), where Y is one of the items in + The list to search. + The items to search for. + The BinaryPredicate used to compare items for "equality". + The index of the last item "equal" to any of the items in the collection , using + as the test for equality. + -1 if no such item exists in the list. + + + + Enumerates the indices of all the items in a list equal to one of several given items. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The list to search. + A collection of items to search for. + An IEnumerable<T> that enumerates the indices of items equal to + any of the items in the collection . + + + + Enumerates the indices of all the items in a list equal to one of several given items. A passed + IEqualityComparer is used to determine equality. + + The list to search. + A collection of items to search for. + The IEqualityComparer<T> used to compare items for equality. + An IEnumerable<T> that enumerates the indices of items equal to + any of the items in the collection . + + + + Enumerates the indices of all the items in a list equal to one of several given items. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being removed need not be true equality. This methods finds + last item X which satisfies BinaryPredicate(X,Y), where Y is one of the items in + The list to search. + A collection of items to search for. + The BinaryPredicate used to compare items for "equality". + An IEnumerable<T> that enumerates the indices of items "equal" to any of the items + in the collection , using + as the test for equality. + + + + Searchs a list for a sub-sequence of items that match a particular pattern. A subsequence + of matches pattern at index i if list[i] is equal to the first item + in , list[i+1] is equal to the second item in , + and so forth for all the items in . + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The type of items in the list. + The list to search. + The sequence of items to search for. + The first index with that matches the items in . + + + + Searchs a list for a sub-sequence of items that match a particular pattern. A subsequence + of matches pattern at index i if list[i] is "equal" to the first item + in , list[i+1] is "equal" to the second item in , + and so forth for all the items in . The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being tested + for in the pattern need not be equality. + The type of items in the list. + The list to search. + The sequence of items to search for. + The BinaryPredicate used to compare items for "equality". + The first index with that matches the items in . + + + + Searchs a list for a sub-sequence of items that match a particular pattern. A subsequence + of matches pattern at index i if list[i] is equal to the first item + in , list[i+1] is equal to the second item in , + and so forth for all the items in . The passed + instance of IEqualityComparer<T> is used for determining if two items are equal. + + The type of items in the list. + The list to search. + The sequence of items to search for. + The IEqualityComparer<T> used to compare items for equality. Only the Equals method will be called. + The first index with that matches the items in . + + + + Determines if one collection is a subset of another, considered as sets. The first set is a subset + of the second set if every item in the first set also occurs in the second set. If an item appears X times in the first set, + it must appear at least X times in the second set. + + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsSubsetOf method on that class. + + The first collection. + The second collection. + True if is a subset of , considered as sets. + or is null. + + + + Determines if one collection is a subset of another, considered as sets. The first set is a subset + of the second set if every item in the first set also occurs in the second set. If an item appears X times in the first set, + it must appear at least X times in the second set. + + + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsSubsetOf method on that class. + + The first collection. + The second collection. + The IEqualityComparer<T> used to compare items for equality. + True if is a subset of , considered as sets. + or is null. + + + + Determines if one collection is a proper subset of another, considered as sets. The first set is a proper subset + of the second set if every item in the first set also occurs in the second set, and the first set is strictly smaller than + the second set. If an item appears X times in the first set, + it must appear at least X times in the second set. + + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsSubsetOf method on that class. + + The first collection. + The second collection. + True if is a subset of , considered as sets. + or is null. + + + + Determines if one collection is a proper subset of another, considered as sets. The first set is a proper subset + of the second set if every item in the first set also occurs in the second set, and the first set is strictly smaller than + the second set. If an item appears X times in the first set, + it must appear at least X times in the second set. + + + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsSubsetOf method on that class. + + The first collection. + The second collection. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + True if is a proper subset of , considered as sets. + or is null. + + + + Determines if two collections are disjoint, considered as sets. Two sets are disjoint if they + have no common items. + + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsDisjoint method on that class. + + The first collection. + The second collection. + True if are are disjoint, considered as sets. + or is null. + + + + Determines if two collections are disjoint, considered as sets. Two sets are disjoint if they + have no common items. + + + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the IsDisjoint method on that class. + + The first collection. + The second collection. + The IEqualityComparerComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + True if are are disjoint, considered as sets. + or is null. + + + + Determines if two collections are equal, considered as sets. Two sets are equal if they + have have the same items, with order not being significant. + + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the EqualTo method on that class. + + The first collection. + The second collection. + True if are are equal, considered as sets. + or is null. + + + + Determines if two collections are equal, considered as sets. Two sets are equal if they + have have the same items, with order not being significant. + + + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the EqualTo method on that class. + + The first collection. + The second collection. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + True if are are equal, considered as sets. + or is null. + + + + Computes the set-theoretic intersection of two collections. The intersection of two sets + is all items that appear in both of the sets. If an item appears X times in one set, + and Y times in the other set, the intersection contains the item Minimum(X,Y) times. + The source collections are not changed. + A new collection is created with the intersection of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the Intersection or IntersectionWith methods on that class. + + The first collection to intersect. + The second collection to intersect. + The intersection of the two collections, considered as sets. + or is null. + + + + Computes the set-theoretic intersection of two collections. The intersection of two sets + is all items that appear in both of the sets. If an item appears X times in one set, + and Y times in the other set, the intersection contains the item Minimum(X,Y) times. + The source collections are not changed. + A new collection is created with the intersection of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the Intersection or IntersectionWith methods on that class. + + The first collection to intersect. + The second collection to intersect. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + The intersection of the two collections, considered as sets. + or is null. + + + + Computes the set-theoretic union of two collections. The union of two sets + is all items that appear in either of the sets. If an item appears X times in one set, + and Y times in the other set, the union contains the item Maximum(X,Y) times. + The source collections are not changed. + A new collection is created with the union of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the Union or UnionWith methods on that class. + + The first collection to union. + The second collection to union. + The union of the two collections, considered as sets. + or is null. + + + + Computes the set-theoretic union of two collections. The union of two sets + is all items that appear in either of the sets. If an item appears X times in one set, + and Y times in the other set, the union contains the item Maximum(X,Y) times. + The source collections are not changed. + A new collection is created with the union of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the union or unionWith methods on that class. + + The first collection to union. + The second collection to union. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + The union of the two collections, considered as sets. + or is null. + + + + Computes the set-theoretic difference of two collections. The difference of two sets + is all items that appear in the first set, but not in the second. If an item appears X times in the first set, + and Y times in the second set, the difference contains the item X - Y times (0 times if X < Y). + The source collections are not changed. + A new collection is created with the difference of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the Difference or DifferenceWith methods on that class. + + The first collection to difference. + The second collection to difference. + The difference of and , considered as sets. + or is null. + + + + Computes the set-theoretic difference of two collections. The difference of two sets + is all items that appear in the first set, but not in the second. If an item appears X times in the first set, + and Y times in the second set, the difference contains the item X - Y times (0 times if X < Y). + The source collections are not changed. + A new collection is created with the difference of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the difference or differenceWith methods on that class. + + The first collection to difference. + The second collection to difference. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + The difference of and , considered as sets. + or is null. + + + + Computes the set-theoretic symmetric difference of two collections. The symmetric difference of two sets + is all items that appear in the one of the sets, but not in the other. If an item appears X times in the one set, + and Y times in the other set, the symmetric difference contains the item AbsoluteValue(X - Y) times. + The source collections are not changed. + A new collection is created with the symmetric difference of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the SymmetricDifference or SymmetricDifferenceWith methods on that class. + + The first collection to symmetric difference. + The second collection to symmetric difference. + The symmetric difference of and , considered as sets. + or is null. + + + + Computes the set-theoretic symmetric difference of two collections. The symmetric difference of two sets + is all items that appear in the one of the sets, but not in the other. If an item appears X times in the one set, + and Y times in the other set, the symmetric difference contains the item AbsoluteValue(X - Y) times. + The source collections are not changed. + A new collection is created with the symmetric difference of the collections; the order of the + items in this collection is undefined. + + + When equal items appear in both collections, the returned collection will include an arbitrary choice of one of the + two equal items. + If both collections are Set, Bag, OrderedSet, or OrderedBag + collections, it is more efficient to use the symmetric difference or symmetric differenceWith methods on that class. + + The first collection to symmetric difference. + The second collection to symmetric difference. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals and GetHashCode member functions of this interface are called. + The symmetric difference of and , considered as sets. + or is null. + + + + Computes the cartestian product of two collections: all possible pairs of items, with the first item taken from the first collection and + the second item taken from the second collection. If the first collection has N items, and the second collection has M items, the cartesian + product will have N * M pairs. + + The type of items in the first collection. + The type of items in the second collection. + The first collection. + The second collection. + An IEnumerable<Pair<TFirst, TSecond>> that enumerates the cartesian product of the two collections. + + + + Gets a string representation of the elements in the collection. + The string representation starts with "{", has a list of items separated + by commas (","), and ends with "}". Each item in the collection is + converted to a string by calling its ToString method (null is represented by "null"). + Contained collections (except strings) are recursively converted to strings by this method. + + A collection to get the string representation of. + The string representation of the collection. If is null, then the string "null" is returned. + + + + Gets a string representation of the elements in the collection. + The string to used at the beginning and end, and to separate items, + and supplied by parameters. Each item in the collection is + converted to a string by calling its ToString method (null is represented by "null"). + + A collection to get the string representation of. + If true, contained collections (except strings) are converted to strings by a recursive call to this method, instead + of by calling ToString. + The string to appear at the beginning of the output string. + The string to appear between each item in the string. + The string to appear at the end of the output string. + The string representation of the collection. If is null, then the string "null" is returned. + , , or + is null. + + + + Gets a string representation of the mappings in a dictionary. + The string representation starts with "{", has a list of mappings separated + by commas (", "), and ends with "}". Each mapping is represented + by "key->value". Each key and value in the dictionary is + converted to a string by calling its ToString method (null is represented by "null"). + Contained collections (except strings) are recursively converted to strings by this method. + + A dictionary to get the string representation of. + The string representation of the collection, or "null" + if is null. + + + + Return a private random number generator to use if the user + doesn't supply one. + + The private random number generator. Only one is ever created + and is always returned. + + + + Randomly shuffles the items in a collection, yielding a new collection. + + The type of the items in the collection. + The collection to shuffle. + An array with the same size and items as , but the items in a randomly chosen order. + + + + Randomly shuffles the items in a collection, yielding a new collection. + + The type of the items in the collection. + The collection to shuffle. + The random number generator to use to select the random order. + An array with the same size and items as , but the items in a randomly chosen order. + + + + Randomly shuffles the items in a list or array, in place. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to shuffle. + + + + Randomly shuffles the items in a list or array, in place. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to shuffle. + The random number generator to use to select the random order. + + + + Picks a random subset of items from , and places + those items into a random order. No item is selected more than once. + + If the collection implements IList<T>, then this method takes time O(). + Otherwise, this method takes time O(N), where N is the number of items in the collection. + The type of items in the collection. + The collection of items to select from. This collection is not changed. + The number of items in the subset to choose. + An array of items, selected at random from . + is negative or greater than .Count. + + + + Picks a random subset of items from , and places + those items into a random order. No item is selected more than once. + + If the collection implements IList<T>, then this method takes time O(). + Otherwise, this method takes time O(N), where N is the number of items in the collection. + The type of items in the collection. + The collection of items to select from. This collection is not changed. + The number of items in the subset to choose. + The random number generates used to make the selection. + An array of items, selected at random from . + is negative or greater than .Count. + is null. + + + + Generates all the possible permutations of the items in . If + has N items, then N factorial permutations will be generated. This method does not compare the items to determine if + any of them are equal. If some items are equal, the same permutation may be generated more than once. For example, + if the collections contains the three items A, A, and B, then this method will generate the six permutations, AAB, AAB, + ABA, ABA, BAA, BAA (not necessarily in that order). To take equal items into account, use the GenerateSortedPermutations + method. + + The type of items to permute. + The collection of items to permute. + An IEnumerable<T[]> that enumerations all the possible permutations of the + items in . Each permutations is returned as an array. The items in the array + should be copied if they need to be used after the next permutation is generated; each permutation may + reuse the same array instance. + + + + Generates all the possible permutations of the items in , in lexicographical order. + Even if some items are equal, the same permutation will not be generated more than once. For example, + if the collections contains the three items A, A, and B, then this method will generate only the three permutations, AAB, ABA, + BAA. + + The type of items to permute. + The collection of items to permute. + An IEnumerable<T[]> that enumerations all the possible permutations of the + items in . Each permutations is returned as an array. The items in the array + should be copied if they need to be used after the next permutation is generated; each permutation may + reuse the same array instance. + + + + Generates all the possible permutations of the items in , in lexicographical order. A + supplied IComparer<T> instance is used to compare the items. + Even if some items are equal, the same permutation will not be generated more than once. For example, + if the collections contains the three items A, A, and B, then this method will generate only the three permutations, AAB, ABA, + BAA. + + The type of items to permute. + The collection of items to permute. + The IComparer<T> used to compare the items. + An IEnumerable<T[]> that enumerations all the possible permutations of the + items in . Each permutations is returned as an array. The items in the array + should be copied if they need to be used after the next permutation is generated; each permutation may + reuse the same array instance. + + + + Generates all the possible permutations of the items in , in lexicographical order. A + supplied Comparison<T> delegate is used to compare the items. + Even if some items are equal, the same permutation will not be generated more than once. For example, + if the collections contains the three items A, A, and B, then this method will generate only the three permutations, AAB, ABA, + BAA. + + The type of items to permute. + The collection of items to permute. + The Comparison<T> delegate used to compare the items. + An IEnumerable<T[]> that enumerations all the possible permutations of the + items in . Each permutations is returned as an array. The items in the array + should be copied if they need to be used after the next permutation is generated; each permutation may + reuse the same array instance. + + + + Finds the maximum value in a collection. + + Values in the collection are compared by using the IComparable<T> + interfaces implementation on the type T. + The type of items in the collection. + The collection to search. + The largest item in the collection. + The collection is empty. + is null. + + + + Finds the maximum value in a collection. A supplied IComparer<T> is used + to compare the items in the collection. + + The type of items in the collection. + The collection to search. + The comparer instance used to compare items in the collection. + The largest item in the collection. + The collection is empty. + or is null. + + + + Finds the maximum value in a collection. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The type of items in the collection. + The collection to search. + The comparison used to compare items in the collection. + The largest item in the collection. + The collection is empty. + or is null. + + + + Finds the minimum value in a collection. + + Values in the collection are compared by using the IComparable<T> + interfaces implementation on the type T. + The type of items in the collection. + The collection to search. + The smallest item in the collection. + The collection is empty. + is null. + + + + Finds the minimum value in a collection. A supplied IComparer<T> is used + to compare the items in the collection. + + The type of items in the collection. + The collection to search. + The comparer instance used to compare items in the collection. + The smallest item in the collection. + The collection is empty. + or is null. + + + + Finds the minimum value in a collection. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The type of items in the collection. + The collection to search. + The comparison used to compare items in the collection. + The smallest item in the collection. + The collection is empty. + or is null. + + + + Finds the index of the maximum value in a list. + + Values in the list are compared by using the IComparable<T> + interfaces implementation on the type T. + The type of items in the list. + The list to search. + The index of the largest item in the list. If the maximum value appears + multiple times, the index of the first appearance is used. If the list is empty, -1 is returned. + is null. + + + + Finds the index of the maximum value in a list. A supplied IComparer<T> is used + to compare the items in the collection. + + The type of items in the list. + The list to search. + The comparer instance used to compare items in the collection. + The index of the largest item in the list. If the maximum value appears + multiple times, the index of the first appearance is used. If the list is empty, -1 is returned. + or is null. + + + + Finds the index of the maximum value in a list. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The type of items in the list. + The list to search. + The comparison used to compare items in the collection. + The index of the largest item in the list. If the maximum value appears + multiple times, the index of the first appearance is used. If the list is empty, -1 is returned. + or is null. + + + + Finds the index of the minimum value in a list. + + Values in the list are compared by using the IComparable<T> + interfaces implementation on the type T. + The type of items in the list. + The list to search. + The index of the smallest item in the list. If the minimum value appears + multiple times, the index of the first appearance is used. + The collection is empty. + is null. + + + + Finds the index of the minimum value in a list. A supplied IComparer<T> is used + to compare the items in the collection. + + The type of items in the list. + The list to search. + The comparer instance used to compare items in the collection. + The index of the smallest item in the list. If the minimum value appears + multiple times, the index of the first appearance is used. + The collection is empty. + or is null. + + + + Finds the index of the minimum value in a list. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The type of items in the list. + The list to search. + The comparison delegate used to compare items in the collection. + The index of the smallest item in the list. If the minimum value appears + multiple times, the index of the first appearance is used. + The collection is empty. + or is null. + + + + Creates a sorted version of a collection. + + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + The collection to sort. + An array containing the sorted version of the collection. + + + + Creates a sorted version of a collection. A supplied IComparer<T> is used + to compare the items in the collection. + + The collection to sort. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + An array containing the sorted version of the collection. + + + + Creates a sorted version of a collection. A supplied Comparison<T> delegate is used + to compare the items in the collection. + + The collection to sort. + The comparison delegate used to compare items in the collection. + An array containing the sorted version of the collection. + + + + Sorts a list or array in place. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + + + + Sorts a list or array in place. A supplied IComparer<T> is used + to compare the items in the list. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + + + + Sorts a list or array in place. A supplied Comparison<T> delegate is used + to compare the items in the list. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + The comparison delegate used to compare items in the collection. + + + + Creates a sorted version of a collection. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + The collection to sort. + An array containing the sorted version of the collection. + + + + Creates a sorted version of a collection. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. A supplied IComparer<T> is used + to compare the items in the collection. + + The collection to sort. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + An array containing the sorted version of the collection. + + + + Creates a sorted version of a collection. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + A supplied Comparison<T> delegate is used + to compare the items in the collection. + + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + The collection to sort. + The comparison delegate used to compare items in the collection. + An array containing the sorted version of the collection. + + + + Sorts a list or array in place. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + + Values are compared by using the IComparable<T> + interfaces implementation on the type T. + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + + + + Sorts a list or array in place. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + A supplied IComparer<T> is used + to compare the items in the list. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + + + + Sorts a list or array in place. The sort is stable, which means that if items X and Y are equal, + and X precedes Y in the unsorted collection, X will precede Y is the sorted collection. + A supplied Comparison<T> delegate is used + to compare the items in the list. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to sort. + The comparison delegate used to compare items in the collection. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the natural ordering of the type (it's implementation of IComparable<T>). + + The sorted list to search. + The item to search for. + Returns the first index at which the item can be found. If the return + value is zero, indicating that was not present in the list, then this + returns the index at which could be inserted to maintain the sorted + order of the list. + The number of items equal to that appear in the list. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the ordering in the passed instance of IComparer<T>. + + The sorted list to search. + The item to search for. + The comparer instance used to sort the list. Only + the Compare method is used. + Returns the first index at which the item can be found. If the return + value is zero, indicating that was not present in the list, then this + returns the index at which could be inserted to maintain the sorted + order of the list. + The number of items equal to that appear in the list. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the ordering in the passed Comparison<T> delegate. + + The sorted list to search. + The item to search for. + The comparison delegate used to sort the list. + Returns the first index at which the item can be found. If the return + value is zero, indicating that was not present in the list, then this + returns the index at which could be inserted to maintain the sorted + order of the list. + The number of items equal to that appear in the list. + + + + Merge several sorted collections into a single sorted collection. Each input collection must be sorted + by the natural ordering of the type (it's implementation of IComparable<T>). The merging + is stable; equal items maintain their ordering, and equal items in different collections are placed + in the order of the collections. + + The set of collections to merge. In many languages, this parameter + can be specified as several individual parameters. + An IEnumerable<T> that enumerates all the items in all the collections + in sorted order. + + + + Merge several sorted collections into a single sorted collection. Each input collection must be sorted + by the ordering in the passed instance of IComparer<T>. The merging + is stable; equal items maintain their ordering, and equal items in different collections are placed + in the order of the collections. + + The set of collections to merge. In many languages, this parameter + can be specified as several individual parameters. + The comparer instance used to sort the list. Only + the Compare method is used. + An IEnumerable<T> that enumerates all the items in all the collections + in sorted order. + + + + Merge several sorted collections into a single sorted collection. Each input collection must be sorted + by the ordering in the passed Comparison<T> delegate. The merging + is stable; equal items maintain their ordering, and equal items in different collections are placed + in the order of the collections. + + The set of collections to merge. In many languages, this parameter + can be specified as several individual parameters. + The comparison delegate used to sort the collections. + An IEnumerable<T> that enumerates all the items in all the collections + in sorted order. + + + + Performs a lexicographical comparison of two sequences of values. A lexicographical comparison compares corresponding + pairs of elements from two sequences in order. If the first element of sequence1 is less than the first element of sequence2, + then the comparison ends and the first sequence is lexicographically less than the second. If the first elements of each sequence + are equal, then the comparison proceeds to the second element of each sequence. If one sequence is shorter than the other, + but corresponding elements are all equal, then the shorter sequence is considered less than the longer one. + + T must implement either IComparable<T> and this implementation is used + to compare the items. + Types of items to compare. This type must implement IComparable<T> to allow + items to be compared. + The first sequence to compare. + The second sequence to compare. + Less than zero if is lexicographically less than . + Greater than zero if is lexicographically greater than . + Zero if is equal to . + T does not implement IComparable<T> or IComparable. + + + + Performs a lexicographical comparison of two sequences of values, using a supplied comparison delegate. A lexicographical comparison compares corresponding + pairs of elements from two sequences in order. If the first element of sequence1 is less than the first element of sequence2, + then the comparison ends and the first sequence is lexicographically less than the second. If the first elements of each sequence + are equal, then the comparison proceeds to the second element of each sequence. If one sequence is shorter than the other, + but corresponding elements are all equal, then the shorter sequence is considered less than the longer one. + + Types of items to compare. + The first sequence to compare. + The second sequence to compare. + The IComparison<T> delegate to compare items. + Only the Compare member function of this interface is called. + Less than zero if is lexicographically less than . + Greater than zero if is lexicographically greater than . + Zero if is equal to . + + + + Performs a lexicographical comparison of two sequences of values, using a supplied comparer interface. A lexicographical comparison compares corresponding + pairs of elements from two sequences in order. If the first element of sequence1 is less than the first element of sequence2, + then the comparison ends and the first sequence is lexicographically less than the second. If the first elements of each sequence + are equal, then the comparison proceeds to the second element of each sequence. If one sequence is shorter than the other, + but corresponding elements are all equal, then the shorter sequence is considered less than the longer one. + + Types of items to compare. + The first sequence to compare. + The second sequence to compare. + The IComparer<T> used to compare items. + Only the Compare member function of this interface is called. + Less than zero if is lexicographically less than . + Greater than zero if is lexicographically greater than . + Zero if is equal to . + , , or + is null. + + + + Creates an IComparer instance that can be used for comparing ordered + sequences of type T; that is IEnumerable<Tgt;. This comparer can be used + for collections or algorithms that use sequences of T as an item type. The Lexicographical + ordered of sequences is for comparison. + + T must implement either IComparable<T> and this implementation is used + to compare the items. + At IComparer<IEnumerable<T>> that compares sequences of T. + + + + Creates an IComparer instance that can be used for comparing ordered + sequences of type T; that is IEnumerable<Tgt;. This comparer can be uses + for collections or algorithms that use sequences of T as an item type. The Lexicographics + ordered of sequences is for comparison. + + A comparer instance used to compare individual items of type T. + At IComparer<IEnumerable<T>> that compares sequences of T. + + + + Creates an IComparer instance that can be used for comparing ordered + sequences of type T; that is IEnumerable<Tgt;. This comparer can be uses + for collections or algorithms that use sequences of T as an item type. The Lexicographics + ordered of sequences is for comparison. + + A comparison delegate used to compare individual items of type T. + At IComparer<IEnumerable<T>> that compares sequences of T. + + + + Reverses the order of comparison of an IComparer<T>. The resulting comparer can be used, + for example, to sort a collection in descending order. Equality and hash codes are unchanged. + + The type of items thta are being compared. + The comparer to reverse. + An IComparer<T> that compares items in the reverse order of . + is null. + + + + Gets an IEqualityComparer<T> instance that can be used to compare objects + of type T for object identity only. Two objects compare equal only if they + are references to the same object. + + An IEqualityComparer<T> instance for identity comparison. + + + + Reverses the order of comparison of an Comparison<T>. The resulting comparison can be used, + for example, to sort a collection in descending order. + + The type of items that are being compared. + The comparison to reverse. + A Comparison<T> that compares items in the reverse order of . + is null. + + + + Given a comparison delegate that compares two items of type T, gets an + IComparer<T> instance that performs the same comparison. + + The comparison delegate to use. + An IComparer<T> that performs the same comparing operation + as . + + + + Given in IComparer<T> instenace that comparers two items from type T, + gets a Comparison delegate that performs the same comparison. + + The IComparer<T> instance to use. + A Comparison<T> delegate that performans the same comparing + operation as . + + + + Gets an IEqualityComparer<IEnumerable<T>> implementation + that can be used to compare collections of elements (of type T). Two collections + of T's are equal if they have the same number of items, and corresponding + items are equal, considered in order. This is the same notion of equality as + in Algorithms.EqualCollections, but encapsulated in an IEqualityComparer<IEnumerable<T>> implementation. + + + The following code creates a Dictionary where the keys are a collection of strings. + + Dictionary<IEnumerable<string>, int> = + new Dictionary<IEnumerable<string>, int>(Algorithms.GetCollectionEqualityComparer<string>()); + + + IEqualityComparer<IEnumerable<T>> implementation suitable for + comparing collections of T for equality. + + + + + Gets an IEqualityComparer<IEnumerable<T>> implementation + that can be used to compare collections of elements (of type T). Two collections + of T's are equal if they have the same number of items, and corresponding + items are equal, considered in order. This is the same notion of equality as + in Algorithms.EqualCollections, but encapsulated in an IEqualityComparer<IEnumerable<T>> implementation. + An IEqualityComparer<T> is used to determine if individual T's are equal + + + The following code creates a Dictionary where the keys are a collection of strings, compared in a case-insensitive way + + Dictionary<IEnumerable<string>, int> = + new Dictionary<IEnumerable<string>, int>(Algorithms.GetCollectionEqualityComparer<string>(StringComparer.CurrentCultureIgnoreCase)); + + + An IEqualityComparer<T> implementation used to compare individual T's. + IEqualityComparer<IEnumerable<T>> implementation suitable for + comparing collections of T for equality. + + + + + Gets an IEqualityComparer<IEnumerable<T>> implementation + that can be used to compare collections of elements (of type T). Two collections + of T's are equal if they have the same number of items, and corresponding + items are equal, without regard to order. This is the same notion of equality as + in Algorithms.EqualSets, but encapsulated in an IEqualityComparer<IEnumerable<T>> implementation. + An IEqualityComparer<T> is used to determine if individual T's are equal + + + The following code creates a Dictionary where the keys are a set of strings, without regard to order + + Dictionary<IEnumerable<string>, int> = + new Dictionary<IEnumerable<string>, int>(Algorithms.GetSetEqualityComparer<string>(StringComparer.CurrentCultureIgnoreCase)); + + + IEqualityComparer<IEnumerable<T>> implementation suitable for + comparing collections of T for equality, without regard to order. + + + + + Gets an IEqualityComparer<IEnumerable<T>> implementation + that can be used to compare collections of elements (of type T). Two collections + of T's are equal if they have the same number of items, and corresponding + items are equal, without regard to order. This is the same notion of equality as + in Algorithms.EqualSets, but encapsulated in an IEqualityComparer<IEnumerable<T>> implementation. + + + The following code creates a Dictionary where the keys are a set of strings, without regard to order + + Dictionary<IEnumerable<string>, int> = + new Dictionary<IEnumerable<string>, int>(Algorithms.GetSetEqualityComparer<string>()); + + + An IEqualityComparer<T> implementation used to compare individual T's. + IEqualityComparer<IEnumerable<T>> implementation suitable for + comparing collections of T for equality, without regard to order. + + + + + Determines if a collection contains any item that satisfies the condition + defined by . + + The collection to check all the items in. + A delegate that defines the condition to check for. + True if the collection contains one or more items that satisfy the condition + defined by . False if the collection does not contain + an item that satisfies . + + + + Determines if all of the items in the collection satisfy the condition + defined by . + + The collection to check all the items in. + A delegate that defines the condition to check for. + True if all of the items in the collection satisfy the condition + defined by , or if the collection is empty. False if one or more items + in the collection do not satisfy . + + + + Counts the number of items in the collection that satisfy the condition + defined by . + + The collection to count items in. + A delegate that defines the condition to check for. + The number of items in the collection that satisfy . + + + + Removes all the items in the collection that satisfy the condition + defined by . + + If the collection if an array or implements IList<T>, an efficient algorithm that + compacts items is used. If not, then ICollection<T>.Remove is used + to remove items from the collection. If the collection is an array or fixed-size list, + the non-removed elements are placed, in order, at the beginning of + the list, and the remaining list items are filled with a default value (0 or null). + The collection to check all the items in. + A delegate that defines the condition to check for. + Returns a collection of the items that were removed. This collection contains the + items in the same order that they orginally appeared in . + + + + Convert a collection of items by applying a delegate to each item in the collection. The resulting collection + contains the result of applying to each item in , in + order. + + The type of items in the collection to convert. + The type each item is being converted to. + The collection of item being converted. + A delegate to the method to call, passing each item in . + The resulting collection from applying to each item in , in + order. + or is null. + + + + Creates a delegate that converts keys to values by used a dictionary to map values. Keys + that a not present in the dictionary are converted to the default value (zero or null). + + This delegate can be used as a parameter in Convert or ConvertAll methods to convert + entire collections. + The dictionary used to perform the conversion. + A delegate to a method that converts keys to values. + + + + Creates a delegate that converts keys to values by used a dictionary to map values. Keys + that a not present in the dictionary are converted to a supplied default value. + + This delegate can be used as a parameter in Convert or ConvertAll methods to convert + entire collections. + The dictionary used to perform the conversion. + The result of the conversion for keys that are not present in the dictionary. + A delegate to a method that converts keys to values. + is null. + + + + Performs the specified action on each item in a collection. + + The collection to process. + An Action delegate which is invoked for each item in . + + + + Partition a list or array based on a predicate. After partitioning, all items for which + the predicate returned true precede all items for which the predicate returned false. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to partition. + A delegate that defines the partitioning condition. + The index of the first item in the second half of the partition; i.e., the first item for + which returned false. If the predicate was true for all items + in the list, list.Count is returned. + + + + Partition a list or array based on a predicate. After partitioning, all items for which + the predicate returned true precede all items for which the predicate returned false. + The partition is stable, which means that if items X and Y have the same result from + the predicate, and X precedes Y in the original list, X will precede Y in the + partitioned list. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to partition. + A delegate that defines the partitioning condition. + The index of the first item in the second half of the partition; i.e., the first item for + which returned false. If the predicate was true for all items + in the list, list.Count is returned. + + + + Concatenates all the items from several collections. The collections need not be of the same type, but + must have the same item type. + + The set of collections to concatenate. In many languages, this parameter + can be specified as several individual parameters. + An IEnumerable that enumerates all the items in each of the collections, in order. + + + + Determines if the two collections contain equal items in the same order. The two collections do not need + to be of the same type; it is permissible to compare an array and an OrderedBag, for instance. + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The type of items in the collections. + The first collection to compare. + The second collection to compare. + True if the collections have equal items in the same order. If both collections are empty, true is returned. + + + + Determines if the two collections contain equal items in the same order. The passed + instance of IEqualityComparer<T> is used for determining if two items are equal. + + The type of items in the collections. + The first collection to compare. + The second collection to compare. + The IEqualityComparer<T> used to compare items for equality. + Only the Equals member function of this interface is called. + True if the collections have equal items in the same order. If both collections are empty, true is returned. + , , or + is null. + + + + Determines if the two collections contain "equal" items in the same order. The passed + BinaryPredicate is used to determine if two items are "equal". + + Since an arbitrary BinaryPredicate is passed to this function, what is being tested + for need not be equality. For example, the following code determines if each integer in + list1 is less than or equal to the corresponding integer in list2. + + List<int> list1, list2; + if (EqualCollections(list1, list2, delegate(int x, int y) { return x <= y; }) { + // the check is true... + } + + + The type of items in the collections. + The first collection to compare. + The second collection to compare. + The BinaryPredicate used to compare items for "equality". + This predicate can compute any relation between two items; it need not represent equality or an equivalence relation. + True if returns true for each corresponding pair of + items in the two collections. If both collections are empty, true is returned. + , , or + is null. + + + + Create an array with the items in a collection. + + If implements ICollection<T>T, then + ICollection<T>.CopyTo() is used to fill the array. Otherwise, the IEnumerable<T>.GetEnumerator() + is used to fill the array. + Element type of the collection. + Collection to create array from. + An array with the items from the collection, in enumeration order. + is null. + + + + Count the number of items in an IEnumerable<T> collection. If + a more specific collection type is being used, it is more efficient to use + the Count property, if one is provided. + + If the collection implements ICollection<T>, this method + simply returns ICollection<T>.Count. Otherwise, it enumerates all items + and counts them. + The collection to count items in. + The number of items in the collection. + is null. + + + + Counts the number of items in the collection that are equal to . + + The default sense of equality for T is used, as defined by T's + implementation of IComparable<T>.Equals or object.Equals. + The collection to count items in. + The item to compare to. + The number of items in the collection that are equal to . + + + + Counts the number of items in the collection that are equal to . + + The collection to count items in. + The item to compare to. + The comparer to use to determine if two items are equal. Only the Equals + member function will be called. + The number of items in the collection that are equal to . + or + is null. + + + + Creates an IEnumerator that enumerates a given item times. + + + The following creates a list consisting of 1000 copies of the double 1.0. + + List<double> list = new List<double>(Algorithms.NCopiesOf(1000, 1.0)); + + The number of times to enumerate the item. + The item that should occur in the enumeration. + An IEnumerable<T> that yields copies + of . + The argument is less than zero. + + + + Replaces each item in a list with a given value. The list does not change in size. + + The type of items in the list. + The list to modify. + The value to fill with. + is a read-only list. + is null. + + + + Replaces each item in a array with a given value. + + The array to modify. + The value to fill with. + is null. + + + + Replaces each item in a part of a list with a given value. + + The type of items in the list. + The list to modify. + The index at which to start filling. The first index in the list has index 0. + The number of items to fill. + The value to fill with. + is a read-only list. + or is negative, or + + is greater than .Count. + is null. + + + + Replaces each item in a part of a array with a given value. + + The array to modify. + The index at which to start filling. The first index in the array has index 0. + The number of items to fill. + The value to fill with. + or is negative, or + + is greater than .Length. + is null. + + + + Copies all of the items from the collection to the list , starting + at the index . If necessary, the size of the destination list is expanded. + + The collection that provide the source items. + The list to store the items into. + The index to begin copying items to. + is negative or + greater than .Count. + or is null. + + + + Copies all of the items from the collection to the array , starting + at the index . + + The collection that provide the source items. + The array to store the items into. + The index to begin copying items to. + is negative or + greater than .Length. + or is null. + The collection has more items than will fit into the array. In this case, the array + has been filled with as many items as fit before the exception is thrown. + + + + Copies at most items from the collection to the list , starting + at the index . If necessary, the size of the destination list is expanded. The source collection must not be + the destination list or part thereof. + + The collection that provide the source items. + The list to store the items into. + The index to begin copying items to. + The maximum number of items to copy. + is negative or + greater than .Count + is negative. + or is null. + + + + Copies at most items from the collection to the array , starting + at the index . The source collection must not be + the destination array or part thereof. + + The collection that provide the source items. + The array to store the items into. + The index to begin copying items to. + The maximum number of items to copy. The array must be large enought to fit this number of items. + is negative or + greater than .Length. + is negative or + + is greater than .Length. + or is null. + + + + Copies items from the list , starting at the index , + to the list , starting at the index . If necessary, the size of the destination list is expanded. + The source and destination lists may be the same. + + The collection that provide the source items. + The index within to begin copying items from. + The list to store the items into. + The index within to begin copying items to. + The maximum number of items to copy. + is negative or + greater than .Count + is negative or + greater than .Count + is negative or too large. + or is null. + + + + Copies items from the list or array , starting at the index , + to the array , starting at the index . + The source may be the same as the destination array. + + The list or array that provide the source items. + The index within to begin copying items from. + The array to store the items into. + The index within to begin copying items to. + The maximum number of items to copy. The destination array must be large enough to hold this many items. + is negative or + greater than .Count + is negative or + greater than .Length + is negative or too large. + or is null. + + + + Reverses a list and returns the reversed list, without changing the source list. + + The list to reverse. + A collection that contains the items from in reverse order. + is null. + + + + Reverses a list or array in place. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to reverse. + is null. + is read only. + + + + Rotates a list and returns the rotated list, without changing the source list. + + The list to rotate. + The number of elements to rotate. This value can be positive or negative. + For example, rotating by positive 3 means that source[3] is the first item in the returned collection. + Rotating by negative 3 means that source[source.Count - 3] is the first item in the returned collection. + A collection that contains the items from in rotated order. + is null. + + + + Rotates a list or array in place. + + Although arrays cast to IList<T> are normally read-only, this method + will work correctly and modify an array passed as . + The list or array to rotate. + The number of elements to rotate. This value can be positive or negative. + For example, rotating by positive 3 means that list[3] is the first item in the resulting list. + Rotating by negative 3 means that list[list.Count - 3] is the first item in the resulting list. + is null. + + + + The class that is used to implement IList<T> to view a sub-range + of a list. The object stores a wrapped list, and a start/count indicating + a sub-range of the list. Insertion/deletions through the sub-range view + cause the count to change also; insertions and deletions directly on + the wrapped list do not. + + + + + Create a sub-range view object on the indicate part + of the list. + + List to wrap. + The start index of the view in the wrapped list. + The number of items in the view. + + + + The class that is used to implement IList<T> to view a sub-range + of an array. The object stores a wrapped array, and a start/count indicating + a sub-range of the array. Insertion/deletions through the sub-range view + cause the count to change up to the size of the underlying array. Elements + fall off the end of the underlying array. + + + + + Create a sub-range view object on the indicate part + of the array. + + Array to wrap. + The start index of the view in the wrapped list. + The number of items in the view. + + + + The read-only ICollection<T> implementation that is used by the ReadOnly method. + Methods that modify the collection throw a NotSupportedException, methods that don't + modify are fowarded through to the wrapped collection. + + + + + Create a ReadOnlyCollection wrapped around the given collection. + + Collection to wrap. + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + The read-only IList<T> implementation that is used by the ReadOnly method. + Methods that modify the list throw a NotSupportedException, methods that don't + modify are fowarded through to the wrapped list. + + + + + Create a ReadOnlyList wrapped around the given list. + + List to wrap. + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + The private class that implements a read-only wrapped for + IDictionary <TKey,TValue>. + + + + + Create a read-only dictionary wrapped around the given dictionary. + + The IDictionary<TKey,TValue> to wrap. + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + The class that provides a typed IEnumerator<T> + view onto an untyped IEnumerator interface. + + + + + Create a typed IEnumerator<T> + view onto an untyped IEnumerator interface + + IEnumerator to wrap. + + + + The class that provides a typed IEnumerable<T> view + onto an untyped IEnumerable interface. + + + + + Create a typed IEnumerable<T> view + onto an untyped IEnumerable interface. + + IEnumerable interface to wrap. + + + + The class that provides a typed ICollection<T> view + onto an untyped ICollection interface. The ICollection<T> + is read-only. + + + + + Create a typed ICollection<T> view + onto an untyped ICollection interface. + + ICollection interface to wrap. + + + + Throws an NotSupportedException stating that this collection cannot be modified. + + + + + The class used to create a typed IList<T> view onto + an untype IList interface. + + + + + Create a typed IList<T> view onto + an untype IList interface. + + The IList to wrap. + + + + The class that is used to provide an untyped ICollection + view onto a typed ICollection<T> interface. + + + + + Create an untyped ICollection + view onto a typed ICollection<T> interface. + + The ICollection<T> to wrap. + + + + The class that implements a non-generic IList wrapper + around a generic IList<T> interface. + + + + + Create a non-generic IList wrapper + around a generic IList<T> interface. + + The IList<T> interface to wrap. + + + + Convert the given parameter to T. Throw an ArgumentException + if it isn't. + + parameter name + parameter value + + + + The class that is used to implement IList<T> to view an array + in a read-write way. Insertions cause the last item in the array + to fall off, deletions replace the last item with the default value. + + + + + Create a list wrapper object on an array. + + Array to wrap. + + + + Return true, to indicate that the list is fixed size. + + + + + A private class used by the LexicographicalComparer method to compare sequences + (IEnumerable) of T by there Lexicographical ordering. + + + + + Creates a new instance that comparer sequences of T by their lexicographical + ordered. + + The IComparer used to compare individual items of type T. + + + + An IComparer instance that can be used to reverse the sense of + a wrapped IComparer instance. + + + + + + The comparer to reverse. + + + + A class, implementing IEqualityComparer<T>, that compares objects + for object identity only. Only Equals and GetHashCode can be used; + this implementation is not appropriate for ordering. + + + + + A private class used to implement GetCollectionEqualityComparer(). This + class implements IEqualityComparer<IEnumerable<T>gt; to compare + two enumerables for equality, where order is significant. + + + + + A private class used to implement GetSetEqualityComparer(). This + class implements IEqualityComparer<IEnumerable<T>gt; to compare + two enumerables for equality, where order is not significant. + + + + + A holder class for various internal utility functions that need to be shared. + + + + + Determine if a type is cloneable: either a value type or implementing + ICloneable. + + Type to check. + Returns if the type is a value type, and does not implement ICloneable. + True if the type is cloneable. + + + + Returns the simple name of the class, for use in exception messages. + + The simple name of this class. + + + + Wrap an enumerable so that clients can't get to the underlying + implementation via a down-case + + Enumerable to wrap. + A wrapper around the enumerable. + + + + Gets the hash code for an object using a comparer. Correctly handles + null. + + Item to get hash code for. Can be null. + The comparer to use. + The hash code for the item. + + + + Wrap an enumerable so that clients can't get to the underlying + implementation via a down-cast. + + + + + Create the wrapper around an enumerable. + + IEnumerable to wrap. + + + + BigList<T> provides a list of items, in order, with indices of the items ranging from 0 to one less + than the count of items in the collection. BigList<T> is optimized for efficient operations on large (>100 items) + lists, especially for insertions, deletions, copies, and concatinations. + + + BigList<T> class is similar in functionality to the standard List<T> class. Both classes + provide a collection that stores an set of items in order, with indices of the items ranging from 0 to one less + than the count of items in the collection. Both classes provide the ability to add and remove items from any index, + and the get or set the item at any index. + BigList<T> differs significantly from List<T> in the performance of various operations, + especially when the lists become large (several hundred items or more). With List<T>, inserting or removing + elements from anywhere in a large list except the end is very inefficient -- every item after the point of inserting + or deletion has to be moved in the list. The BigList<T> class, however, allows for fast insertions + and deletions anywhere in the list. Furthermore, BigList<T> allows copies of a list, sub-parts + of a list, and concatinations of two lists to be very fast. When a copy is made of part or all of a BigList, + two lists shared storage for the parts of the lists that are the same. Only when one of the lists is changed is additional + memory allocated to store the distinct parts of the lists. + Of course, there is a small price to pay for this extra flexibility. Although still quite efficient, using an + index to get or change one element of a BigList, while still reasonably efficient, is significantly slower than using + a plain List. Because of this, if you want to process every element of a BigList, using a foreach loop is a lot + more efficient than using a for loop and indexing the list. + In general, use a List when the only operations you are using are Add (to the end), foreach, + or indexing, or you are very sure the list will always remain small (less than 100 items). For large (>100 items) lists + that do insertions, removals, copies, concatinations, or sub-ranges, BigList will be more efficient than List. + In almost all cases, BigList is more efficient and easier to use than LinkedList. + + The type of items to store in the BigList. + + + + Must be called whenever there is a structural change in the tree. Causes + changeStamp to be changed, which causes any in-progress enumerations + to throw exceptions. + + + + + Checks the given stamp against the current change stamp. If different, the + collection has changed during enumeration and an InvalidOperationException + must be thrown + + changeStamp at the start of the enumeration. + + + + Creates a new BigList. The BigList is initially empty. + + Creating a empty BigList takes constant time and consumes a very small amount of memory. + + + + Creates a new BigList initialized with the items from , in order. + + Initializing the tree list with the elements of collection takes time O(N), where N is the number of + items in . + The collection used to initialize the BigList. + is null. + + + + Creates a new BigList initialized with a given number of copies of the items from , in order. + + Initializing the tree list with the elements of collection takes time O(N + log K), where N is the number of + items in , and K is the number of copies. + Number of copies of the collection to use. + The collection used to initialize the BigList. + is negative. + is null. + + + + Creates a new BigList that is a copy of . + + Copying a BigList takes constant time, and little + additional memory, since the storage for the items of the two lists is shared. However, changing + either list will take additional time and memory. Portions of the list are copied when they are changed. + The BigList to copy. + is null. + + + + Creates a new BigList that is several copies of . + + Creating K copies of a BigList takes time O(log K), and O(log K) + additional memory, since the storage for the items of the two lists is shared. However, changing + either list will take additional time and memory. Portions of the list are copied when they are changed. + Number of copies of the collection to use. + The BigList to copy. + is null. + + + + Creates a new BigList from the indicated Node. + + Node that becomes the new root. If null, the new BigList is empty. + + + + Removes all of the items from the BigList. + + Clearing a BigList takes constant time. + + + + Inserts a new item at the given index in the BigList. All items at indexes + equal to or greater than move up one index. + + The amount of time to insert an item is O(log N), no matter where + in the list the insertion occurs. Inserting an item at the beginning or end of the + list is O(N). + + The index to insert the item at. After the + insertion, the inserted item is located at this index. The + first item has index 0. + The item to insert at the given index. + is + less than zero or greater than Count. + + + + Inserts a collection of items at the given index in the BigList. All items at indexes + equal to or greater than increase their indices + by the number of items inserted. + + The amount of time to insert an arbitrary collection in the BigList is O(M + log N), + where M is the number of items inserted, and N is the number of items in the list. + + The index to insert the collection at. After the + insertion, the first item of the inserted collection is located at this index. The + first item has index 0. + The collection of items to insert at the given index. + is + less than zero or greater than Count. + is null. + + + + Inserts a BigList of items at the given index in the BigList. All items at indexes + equal to or greater than increase their indices + by the number of items inserted. + + The amount of time to insert another BigList is O(log N), + where N is the number of items in the list, regardless of the number of items in the + inserted list. Storage is shared between the two lists until one of them is changed. + + The index to insert the collection at. After the + insertion, the first item of the inserted collection is located at this index. The + first item has index 0. + The BigList of items to insert at the given index. + is + less than zero or greater than Count. + is null. + + + + Removes the item at the given index in the BigList. All items at indexes + greater than move down one index. + + The amount of time to delete an item in the BigList is O(log N), + where N is the number of items in the list. + + The index in the list to remove the item at. The + first item in the list has index 0. + is + less than zero or greater than or equal to Count. + + + + Removes a range of items at the given index in the Deque. All items at indexes + greater than move down indices + in the Deque. + + The amount of time to delete items in the Deque is proportional + to the distance of index from the closest end of the Deque, plus : + O(count + Min(, Count - 1 - )). + + The index in the list to remove the range at. The + first item in the list has index 0. + The number of items to remove. + is + less than zero or greater than or equal to Count, or is less than zero + or too large. + + + + Adds an item to the end of the BigList. The indices of all existing items + in the Deque are unchanged. + + Adding an item takes, on average, constant time. + The item to add. + + + + Adds an item to the beginning of the BigList. The indices of all existing items + in the Deque are increased by one, and the new item has index zero. + + Adding an item takes, on average, constant time. + The item to add. + + + + Adds a collection of items to the end of BigList. The indices of all existing items + are unchanged. The last item in the added collection becomes the + last item in the BigList. + + This method takes time O(M + log N), where M is the number of items in the + , and N is the size of the BigList. + The collection of items to add. + is null. + + + + Adds a collection of items to the front of BigList. The indices of all existing items + in the are increased by the number of items in . + The first item in the added collection becomes the first item in the BigList. + + This method takes time O(M + log N), where M is the number of items in the + , and N is the size of the BigList. + The collection of items to add. + is null. + + + + Creates a new BigList that is a copy of this list. + + Copying a BigList takes constant time, and little + additional memory, since the storage for the items of the two lists is shared. However, changing + either list will take additional time and memory. Portions of the list are copied when they are changed. + A copy of the current list + + + + Creates a new BigList that is a copy of this list. + + Copying a BigList takes constant time, and little + additional memory, since the storage for the items of the two lists is shared. However, changing + either list will take additional time and memory. Portions of the list are copied when they are changed. + A copy of the current list + + + + Makes a deep clone of this BigList. A new BigList is created with a clone of + each element of this set, by calling ICloneable.Clone on each element. If T is + a value type, then this method is the same as Clone. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + If T is a reference type, cloning the list takes time approximate O(N), where N is the number of items in the list. + The cloned set. + T is a reference type that does not implement ICloneable. + + + + Adds a BigList of items to the end of BigList. The indices of all existing items + are unchanged. The last item in becomes the + last item in this list. The added list is unchanged. + + This method takes, on average, constant time, regardless of the size + of either list. Although conceptually all of the items in are + copied, storage is shared between the two lists until changes are made to the + shared sections. + The list of items to add. + is null. + + + + Adds a BigList of items to the front of BigList. The indices of all existing items + are increased by the number of items in . The first item in + becomes the first item in this list. The added list is unchanged. + + This method takes, on average, constant time, regardless of the size + of either list. Although conceptually all of the items in are + copied, storage is shared between the two lists until changes are made to the + shared sections. + The list of items to add. + is null. + + + + Concatenates two lists together to create a new list. Both lists being concatenated + are unchanged. The resulting list contains all the items in , followed + by all the items in . + + This method takes, on average, constant time, regardless of the size + of either list. Although conceptually all of the items in both lists are + copied, storage is shared until changes are made to the + shared sections. + The first list to concatenate. + The second list to concatenate. + or is null. + + + + Creates a new list that contains a subrange of elements from this list. The + current list is unchanged. + + This method takes take O(log N), where N is the size of the current list. Although + the sub-range is conceptually copied, storage is shared between the two lists until a change + is made to the shared items. + If a view of a sub-range is desired, instead of a copy, use the + more efficient method, which provides a view onto a sub-range of items. + The starting index of the sub-range. + The number of items in the sub-range. If this is zero, + the returned list is empty. + A new list with the items that start at . + + + + Returns a view onto a sub-range of this list. Items are not copied; the + returned IList<T> is simply a different view onto the same underlying items. Changes to this list + are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the + view, but insertions and deletions in the underlying list do not. + + + If a copy of the sub-range is desired, use the method instead. + This method can be used to apply an algorithm to a portion of a list. For example: + Algorithms.ReverseInPlace(list.Range(3, 6)) + will reverse the 6 items beginning at index 3. + The starting index of the view. + The number of items in the view. + A list that is a view onto the given sub-list. + or is negative. + + is greater than the + size of this list. + + + + Enumerates a range of the items in the list, in order. The item at + is enumerated first, then the next item at index 1, and so on. At most + items are enumerated. + + Enumerating all of the items in the list take time O(N), where + N is the number of items being enumerated. Using GetEnumerator() or foreach + is much more efficient than accessing all items by index. + Index to start enumerating at. + Max number of items to enumerate. + An IEnumerator<T> that enumerates all the + items in the given range. + + + + Enumerates all of the items in the list, in order. The item at index 0 + is enumerated first, then the item at index 1, and so on. Usually, the + foreach statement is used to call this method implicitly. + + Enumerating all of the items in the list take time O(N), where + N is the number of items in the list. Using GetEnumerator() or foreach + is much more efficient than accessing all items by index. + An IEnumerator<T> that enumerates all the + items in the list. + + + + Given an IEnumerable<T>, create a new Node with all of the + items in the enumerable. Returns null if the enumerable has no items. + + The collection to copy. + Returns a Node, not shared or with any shared children, + with the items from the collection. If the collection was empty, + null is returned. + + + + Consumes up to MAXLEAF items from an Enumerator and places them in a leaf + node. If the enumerator is at the end, null is returned. + + The enumerator to take items from. + A LeafNode with items taken from the enumerator. + + + + Create a node that has N copies of the given node. + + Number of copies. Must be non-negative. + Node to make copies of. + null if node is null or copies is 0. Otherwise, a node consisting of copies + of node. + copies is negative. + + + + Check the balance of the current tree and rebalance it if it is more than BALANCEFACTOR + levels away from fully balanced. Note that rebalancing a tree may leave it two levels away from + fully balanced. + + + + + Rebalance the current tree. Once rebalanced, the depth of the current tree is no more than + two levels from fully balanced, where fully balanced is defined as having Fibonacci(N+2) or more items + in a tree of depth N. + + The rebalancing algorithm is from "Ropes: an Alternative to Strings", by + Boehm, Atkinson, and Plass, in SOFTWARE--PRACTICE AND EXPERIENCE, VOL. 25(12), 1315–1330 (DECEMBER 1995). + + + + + Part of the rebalancing algorithm. Adds a node to the rebalance array. If it is already balanced, add it directly, otherwise + add its children. + + Rebalance array to insert into. + Node to add. + If true, mark the node as shared before adding, because one + of its parents was shared. + + + + Part of the rebalancing algorithm. Adds a balanced node to the rebalance array. + + Rebalance array to insert into. + Node to add. + + + + Convert the list to a new list by applying a delegate to each item in the collection. The resulting list + contains the result of applying to each item in the list, in + order. The current list is unchanged. + + The type each item is being converted to. + A delegate to the method to call, passing each item in . + The resulting BigList from applying to each item in this list. + is null. + + + + Reverses the current list in place. + + + + + Reverses the items in the range of items starting from , in place. + + The starting index of the range to reverse. + The number of items in range to reverse. + + + + Sorts the list in place. + + The Quicksort algorithm is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + Values are compared by using the IComparable or IComparable<T> + interface implementation on the type T. + The type T does not implement either the IComparable or + IComparable<T> interfaces. + + + + Sorts the list in place. A supplied IComparer<T> is used + to compare the items in the list. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + The comparer instance used to compare items in the collection. Only + the Compare method is used. + + + + Sorts the list in place. A supplied Comparison<T> delegate is used + to compare the items in the list. + + The Quicksort algorithms is used to sort the items. In virtually all cases, + this takes time O(N log N), where N is the number of items in the list. + The comparison delegate used to compare items in the collection. + + + + Searches a sorted list for an item via binary search. The list must be sorted + in the order defined by the default ordering of the item type; otherwise, + incorrect results will be returned. + + The item to search for. + Returns the index of the first occurence of in the list. If the item does not occur + in the list, the bitwise complement of the first item larger than in the list is returned. If no item is + larger than , the bitwise complement of Count is returned. + The type T does not implement either the IComparable or + IComparable<T> interfaces. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the ordering defined by the passed IComparer<T> interface; otherwise, + incorrect results will be returned. + + The item to search for. + The IComparer<T> interface used to sort the list. + Returns the index of the first occurence of in the list. If the item does not occur + in the list, the bitwise complement of the first item larger than in the list is returned. If no item is + larger than , the bitwise complement of Count is returned. + + + + Searches a sorted list for an item via binary search. The list must be sorted + by the ordering defined by the passed Comparison<T> delegate; otherwise, + incorrect results will be returned. + + The item to search for. + The comparison delegate used to sort the list. + Returns the index of the first occurence of in the list. If the item does not occur + in the list, the bitwise complement of the first item larger than in the list is returned. If no item is + larger than , the bitwise complement of Count is returned. + + + + Gets the number of items stored in the BigList. The indices of the items + range from 0 to Count-1. + + Getting the number of items in the BigList takes constant time. + The number of items in the BigList. + + + + Gets or sets an item in the list, by index. + + Gettingor setting an item takes time O(log N), where N is the number of items + in the list. + To process each of the items in the list, using GetEnumerator() or a foreach loop is more efficient + that accessing each of the elements by index. + The index of the item to get or set. The first item in the list + has index 0, the last item has index Count-1. + The value of the item at the given index. + is less than zero or + greater than or equal to Count. + + + + The base class for the two kinds of nodes in the tree: Concat nodes + and Leaf nodes. + + + + + Marks this node as shared by setting the shared variable. + + + + + Returns the items at the given index in this node. + + 0-based index, relative to this node. + Item at that index. + + + + Returns a node that has a sub-range of items from this node. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive first element, relative to this node. + Inclusize last element, relative to this node. + Node with the given sub-range. + + + + Changes the item at the given index. Never changes this node, + but always returns a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A new node with the given item changed. + + + + Changes the item at the given index. May change this node, + or return a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A node with the give item changed. If it can be done in place + then "this" is returned. + + + + Append a node after this node. Never changes this node, but returns + a new node with the given appending done. + + Node to append. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node appended to this node. + + + + Append a node after this node. May change this node, or return + a new node. + + Node to append. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the give node appended to this node. May be a new + node or the current node. + + + + Append a item after this node. May change this node, or return + a new node. Equivalent to AppendInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to append. + A node with the given item appended to this node. May be a new + node or the current node. + + + + Remove a range of items from this node. Never changes this node, but returns + a new node with the removing done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A new node with the sub-range removed. + + + + Remove a range of items from this node. May change this node, or returns + a new node with the given appending done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A node with the sub-range removed. If done in-place, returns + "this". + + + + Inserts a node inside this node. Never changes this node, but returns + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node inserted. + + + + Inserts an item inside this node. May change this node, or return + a new node with the given appending done. Equivalent to + InsertInPlace(new LeafNode(item), true), but may be more efficient. + + Index, relative to this node, to insert at. Must + be in bounds. + Item to insert. + A node with the give item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. May change this node, or return + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the given item inserted. If done in-place, returns + "this". + + + + Prefpend a node before this node. Never changes this node, but returns + a new node with the given prepending done. + + Node to prepend. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node prepended to this node. + + + + Prepend a node before this node. May change this node, or return + a new node. + + Node to prepend. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the give node prepended to this node. May be a new + node or the current node. + + + + Prepend a item before this node. May change this node, or return + a new node. Equivalent to PrependInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to prepend. + A node with the given item prepended to this node. May be a new + node or the current node. + + + + Determine if this node is balanced. A node is balanced if the number + of items is greater than + Fibonacci(Depth+2). Balanced nodes are never rebalanced unless + they go out of balance again. + + True if the node is balanced by this definition. + + + + Determine if this node is almost balanced. A node is almost balanced if t + its depth is at most one greater than a fully balanced node with the same count. + + True if the node is almost balanced by this definition. + + + + The number of items stored in the node (or below it). + + The number of items in the node or below. + + + + Is this node shared by more that one list (or within a single) + lists. If true, indicates that this node, and any nodes below it, + may never be modified. Never becomes false after being set to + true. + + + + + + Gets the depth of this node. A leaf node has depth 0, + a concat node with two leaf children has depth 1, etc. + + The depth of this node. + + + + The LeafNode class is the type of node that lives at the leaf of a tree and holds + the actual items stored in the list. Each leaf holds at least 1, and at most MAXLEAF + items in the items array. The number of items stored is found in "count", which may + be less than "items.Length". + + + + + Array that stores the items in the nodes. Always has a least "count" elements, + but may have more as padding. + + + + + Creates a LeafNode that holds a single item. + + Item to place into the leaf node. + + + + Creates a new leaf node with the indicates count of item and the + + Number of items. Can't be zero. + The array of items. The LeafNode takes + possession of this array. + + + + Returns the items at the given index in this node. + + 0-based index, relative to this node. + Item at that index. + + + + Changes the item at the given index. May change this node, + or return a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A node with the give item changed. If it can be done in place + then "this" is returned. + + + + Changes the item at the given index. Never changes this node, + but always returns a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A new node with the given item changed. + + + + If other is a leaf node, and the resulting size would be less than MAXLEAF, merge + the other leaf node into this one (after this one) and return true. + + Other node to possible merge. + If could be merged into this node, returns + true. Otherwise returns false and the current node is unchanged. + + + + If other is a leaf node, and the resulting size would be less than MAXLEAF, merge + the other leaf node with this one (after this one) and return a new node with + the merged items. Does not modify this. + If no merging, return null. + + Other node to possible merge. + If the nodes could be merged, returns the new node. Otherwise + returns null. + + + + Prepend a item before this node. May change this node, or return + a new node. Equivalent to PrependInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to prepend. + A node with the given item prepended to this node. May be a new + node or the current node. + + + + Append a item after this node. May change this node, or return + a new node. Equivalent to AppendInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to append. + A node with the given item appended to this node. May be a new + node or the current node. + + + + Append a node after this node. May change this node, or return + a new node. + + Node to append. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the give node appended to this node. May be a new + node or the current node. + + + + Inserts an item inside this node. May change this node, or return + a new node with the given appending done. Equivalent to + InsertInPlace(new LeafNode(item), true), but may be more efficient. + + Index, relative to this node, to insert at. Must + be in bounds. + Item to insert. + A node with the give item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. May change this node, or return + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the given item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. Never changes this node, but returns + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node inserted. + + + + Remove a range of items from this node. May change this node, or returns + a new node with the given appending done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A node with the sub-range removed. If done in-place, returns + "this". + + + + Remove a range of items from this node. Never changes this node, but returns + a new node with the removing done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A new node with the sub-range removed. + + + + Returns a node that has a sub-range of items from this node. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive first element, relative to this node. + Inclusize last element, relative to this node. + Node with the given sub-range. + + + + A ConcatNode is an interior (non-leaf) node that represents the concatination of + the left and right child nodes. Both children must always be non-null. + + + + + The left and right child nodes. They are never null. + + + + + The left and right child nodes. They are never null. + + + + + The depth of this node -- the maximum length path to + a leaf. If this node has two children that are leaves, the + depth in 1. + + + + + Create a new ConcatNode with the given children. + + The left child. May not be null. + The right child. May not be null. + + + + Create a new node with the given children. Mark unchanged + children as shared. There are four + possible cases: + 1. If one of the new children is null, the other new child is returned. + 2. If neither child has changed, then this is marked as shared as returned. + 3. If one child has changed, the other child is marked shared an a new node is returned. + 4. If both children have changed, a new node is returned. + + New left child. + New right child. + New node with the given children. Returns null if and only if both + new children are null. + + + + Updates a node with the given new children. If one of the new children is + null, the other is returned. If both are null, null is returned. + + New left child. + New right child. + Node with the given children. Usually, but not always, this. Returns + null if and only if both new children are null. + + + + Returns the items at the given index in this node. + + 0-based index, relative to this node. + Item at that index. + + + + Changes the item at the given index. May change this node, + or return a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A node with the give item changed. If it can be done in place + then "this" is returned. + + + + Changes the item at the given index. Never changes this node, + but always returns a new node with the given item changed. + + Index, relative to this node, to change. + New item to place at the given index. + A new node with the given item changed. + + + + Prepend a item before this node. May change this node, or return + a new node. Equivalent to PrependInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to prepend. + A node with the given item prepended to this node. May be a new + node or the current node. + + + + Append a item after this node. May change this node, or return + a new node. Equivalent to AppendInPlace(new LeafNode(item), true), but + may be more efficient because a new LeafNode might not be allocated. + + Item to append. + A node with the given item appended to this node. May be a new + node or the current node. + + + + Append a node after this node. May change this node, or return + a new node. + + Node to append. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the give node appended to this node. May be a new + node or the current node. + + + + Inserts an item inside this node. May change this node, or return + a new node with the given appending done. Equivalent to + InsertInPlace(new LeafNode(item), true), but may be more efficient. + + Index, relative to this node, to insert at. Must + be in bounds. + Item to insert. + A node with the give item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. May change this node, or return + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A node with the given item inserted. If done in-place, returns + "this". + + + + Inserts a node inside this node. Never changes this node, but returns + a new node with the given appending done. + + Index, relative to this node, to insert at. Must + be in bounds. + Node to insert. + If true, the given node is not used + in any current list, so it may be change, overwritten, or destroyed + if convenient. If false, the given node is in use. It should be marked + as shared if is is used within the return value. + A new node with the give node inserted. + + + + Remove a range of items from this node. May change this node, or returns + a new node with the given appending done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A node with the sub-range removed. If done in-place, returns + "this". + + + + Remove a range of items from this node. Never changes this node, but returns + a new node with the removing done. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive index of first item in sub-range, relative + to this node. + Inclusize index of last item in sub-range, relative + to this node. + A new node with the sub-range removed. + + + + Returns a node that has a sub-range of items from this node. The + sub-range may not be empty, but may extend outside the node. + In other words, first might be less than zero or last might be greater + than count. But, last can't be less than zero and first can't be + greater than count. Also, last must be greater than or equal to last. + + Inclusive first element, relative to this node. + Inclusize last element, relative to this node. + Node with the given sub-range. + + + + The depth of this node -- the maximum length path to + a leaf. If this node has two children that are leaves, the + depth in 1. + + The depth of this node. + + + + The class that is used to implement IList<T> to view a sub-range + of a BigList. The object stores a wrapped list, and a start/count indicating + a sub-range of the list. Insertion/deletions through the sub-range view + cause the count to change also; insertions and deletions directly on + the wrapped list do not. + + This is different from Algorithms.Range in a very few respects: + it is specialized to only wrap BigList, and it is a lot more efficient in enumeration. + + + + Create a sub-range view object on the indicate part + of the list. + + List to wrap. + The start index of the view in the wrapped list. + The number of items in the view. + + + + OrderedSet<T> is a collection that contains items of type T. + The item are maintained in a sorted order, and duplicate items are not allowed. Each item has + an index in the set: the smallest item has index 0, the next smallest item has index 1, + and so forth. + + +

The items are compared in one of three ways. If T implements IComparable<TKey> or IComparable, + then the CompareTo method of that interface will be used to compare items. Alternatively, a comparison + function can be passed in either as a delegate, or as an instance of IComparer<TKey>.

+

OrderedSet is implemented as a balanced binary tree. Inserting, deleting, and looking up an + an element all are done in log(N) type, where N is the number of keys in the tree.

+

is similar, but uses hashing instead of comparison, and does not maintain + the items in sorted order.

+
+ +
+ + + Creates a new OrderedSet. The T must implement IComparable<T> + or IComparable. + The CompareTo method of this interface will be used to compare items in this set. + + + Items that are null are permitted, and will be sorted before all other items. + + T does not implement IComparable<TKey>. + + + + Creates a new OrderedSet. The passed delegate will be used to compare items in this set. + + A delegate to a method that will be used to compare items. + + + + Creates a new OrderedSet. The Compare method of the passed comparison object + will be used to compare items in this set. + + + The GetHashCode and Equals methods of the provided IComparer<T> will never + be called, and need not be implemented. + + An instance of IComparer<T> that will be used to compare items. + + + + Creates a new OrderedSet. The T must implement IComparable<T> + or IComparable. + The CompareTo method of this interface will be used to compare items in this set. The set is + initialized with all the items in the given collection. + + + Items that are null are permitted, and will be sorted before all other items. + + A collection with items to be placed into the OrderedSet. + T does not implement IComparable<TKey>. + + + + Creates a new OrderedSet. The passed delegate will be used to compare items in this set. + The set is initialized with all the items in the given collection. + + A collection with items to be placed into the OrderedSet. + A delegate to a method that will be used to compare items. + + + + Creates a new OrderedSet. The Compare method of the passed comparison object + will be used to compare items in this set. The set is + initialized with all the items in the given collection. + + + The GetHashCode and Equals methods of the provided IComparer<T> will never + be called, and need not be implemented. + + A collection with items to be placed into the OrderedSet. + An instance of IComparer<T> that will be used to compare items. + + + + Creates a new OrderedSet given a comparer and a tree that contains the data. Used + internally for Clone. + + Comparer for the set. + Data for the set. + + + + Makes a shallow clone of this set; i.e., if items of the + set are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the set takes time O(N), where N is the number of items in the set. + The cloned set. + + + + Makes a shallow clone of this set; i.e., if items of the + set are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the set takes time O(N), where N is the number of items in the set. + The cloned set. + + + + Makes a deep clone of this set. A new set is created with a clone of + each element of this set, by calling ICloneable.Clone on each element. If T is + a value type, then each element is copied as if by simple assignment. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the set takes time O(N log N), where N is the number of items in the set. + The cloned set. + T is a reference type that does not implement ICloneable. + + + + Returns an enumerator that enumerates all the items in the set. + The items are enumerated in sorted order. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the items, which uses this method implicitly.

+

If an item is added to or deleted from the set while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumeration all the items in the set takes time O(N log N), where N is the number + of items in the set.

+
+ An enumerator for enumerating all the items in the OrderedSet. +
+ + + Determines if this set contains an item equal to . The set + is not changed. + + Searching the set for an item takes time O(log N), where N is the number of items in the set. + The item to search for. + True if the set contains . False if the set does not contain . + + + + Determines if this set contains an item equal to , according to the + comparison mechanism that was used when the set was created. The set + is not changed. + If the set does contain an item equal to , then the item from the set is returned. + + Searching the set for an item takes time O(log N), where N is the number of items in the set. + + In the following example, the set contains strings which are compared in a case-insensitive manner. + + OrderedSet<string> set = new OrderedSet<string>(StringComparer.CurrentCultureIgnoreCase); + set.Add("HELLO"); + string s; + bool b = set.TryGetItem("Hello", out s); // b receives true, s receives "HELLO". + + + The item to search for. + Returns the item from the set that was equal to . + True if the set contains . False if the set does not contain . + + + + Get the index of the given item in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the item in the sorted set, or -1 if the item is not present + in the set. + + + + Adds a new item to the set. If the set already contains an item equal to + , that item is replaced with . + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes time O(log N), where N is the number of items in the set. + The item to add to the set. + True if the set already contained an item equal to (which was replaced), false + otherwise. + + + + Adds a new item to the set. If the set already contains an item equal to + , that item is replaces with . + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes time O(log N), where N is the number of items in the set. + The item to add to the set. + + + + Adds all the items in to the set. If the set already contains an item equal to + one of the items in , that item will be replaced. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding the collection takes time O(M log N), where N is the number of items in the set, and M is the + number of items in . + A collection of items to add to the set. + + + + Searches the set for an item equal to , and if found, + removes it from the set. If not found, the set is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing an item from the set takes time O(log N), where N is the number of items in the set. + The item to remove. + True if was found and removed. False if was not in the set. + + + + Removes all the items in from the set. Items + not present in the set are ignored. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing the collection takes time O(M log N), where N is the number of items in the set, and M is the + number of items in . + A collection of items to remove from the set. + The number of items removed from the set. + is null. + + + + Removes all items from the set. + + Clearing the sets takes a constant amount of time, regardless of the number of items in it. + + + + If the collection is empty, throw an invalid operation exception. + + The set is empty. + + + + Returns the first item in the set: the item + that would appear first if the set was enumerated. This is also + the smallest item in the set. + + GetFirst() takes time O(log N), where N is the number of items in the set. + The first item in the set. + The set is empty. + + + + Returns the lastl item in the set: the item + that would appear last if the set was enumerated. This is also the + largest item in the set. + + GetLast() takes time O(log N), where N is the number of items in the set. + The lastl item in the set. + The set is empty. + + + + Removes the first item in the set. This is also the smallest item in the set. + + RemoveFirst() takes time O(log N), where N is the number of items in the set. + The item that was removed, which was the smallest item in the set. + The set is empty. + + + + Removes the last item in the set. This is also the largest item in the set. + + RemoveLast() takes time O(log N), where N is the number of items in the set. + The item that was removed, which was the largest item in the set. + The set is empty. + + + + Check that this set and another set were created with the same comparison + mechanism. Throws exception if not compatible. + + Other set to check comparision mechanism. + If otherSet and this set don't use the same method for comparing items. + + + + Determines if this set is a superset of another set. Neither set is modified. + This set is a superset of if every element in + is also in this set. + IsSupersetOf is computed in time O(M log N), where M is the size of the + , and N is the size of the this set. + + OrderedSet to compare to. + True if this is a superset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a proper superset of another set. Neither set is modified. + This set is a proper superset of if every element in + is also in this set. + Additionally, this set must have strictly more items than . + + IsProperSupersetOf is computed in time O(M log N), where M is the number of unique items in + . + OrderedSet to compare to. + True if this is a proper superset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a subset of another set. Neither set is modified. + This set is a subset of if every element in this set + is also in . + + IsSubsetOf is computed in time O(N log M), where M is the size of the + , and N is the size of the this set. + Set to compare to. + True if this is a subset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is a proper subset of another set. Neither set is modified. + This set is a subset of if every element in this set + is also in . Additionally, this set must have strictly + fewer items than . + + IsSubsetOf is computed in time O(N log M), where M is the size of the + , and N is the size of the this set. + Set to compare to. + True if this is a proper subset of . + This set and don't use the same method for comparing items. + + + + Determines if this set is equal to another set. This set is equal to + if they contain the same items. + + IsEqualTo is computed in time O(N), where N is the number of items in + this set. + Set to compare to + True if this set is equal to , false otherwise. + This set and don't use the same method for comparing items. + + + + Computes the union of this set with another set. The union of two sets + is all items that appear in either or both of the sets. This set receives + the union of the two sets, the other set is unchanged. + + + If equal items appear in both sets, the union will include an arbitrary choice of one of the + two equal items. + The union of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to union with. + This set and don't use the same method for comparing items. + + + + Determines if this set is disjoint from another set. Two sets are disjoint + if no item from one set is equal to any item in the other set. + + + The answer is computed in time O(N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to check disjointness with. + True if the two sets are disjoint, false otherwise. + This set and don't use the same method for comparing items. + + + + Computes the union of this set with another set. The union of two sets + is all items that appear in either or both of the sets. A new set is + created with the union of the sets and is returned. This set and the other set + are unchanged. + + + If equal items appear in both sets, the union will include an arbitrary choice of one of the + two equal items. + The union of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to union with. + The union of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the intersection of this set with another set. The intersection of two sets + is all items that appear in both of the sets. This set receives + the intersection of the two sets, the other set is unchanged. + + + When equal items appear in both sets, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two sets is computed in time O(N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to intersection with. + This set and don't use the same method for comparing items. + + + + Computes the intersection of this set with another set. The intersection of two sets + is all items that appear in both of the sets. A new set is + created with the intersection of the sets and is returned. This set and the other set + are unchanged. + + + When equal items appear in both sets, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two sets is computed in time O(N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to intersection with. + The intersection of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the difference of this set with another set. The difference of these two sets + is all items that appear in this set, but not in . This set receives + the difference of the two sets; the other set is unchanged. + + + The difference of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to difference with. + This set and don't use the same method for comparing items. + + + + Computes the difference of this set with another set. The difference of these two sets + is all items that appear in this set, but not in . A new set is + created with the difference of the sets and is returned. This set and the other set + are unchanged. + + + The difference of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to difference with. + The difference of the two sets. + This set and don't use the same method for comparing items. + + + + Computes the symmetric difference of this set with another set. The symmetric difference of two sets + is all items that appear in either of the sets, but not both. This set receives + the symmetric difference of the two sets; the other set is unchanged. + + + The symmetric difference of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to symmetric difference with. + This set and don't use the same method for comparing items. + + + + Computes the symmetric difference of this set with another set. The symmetric difference of two sets + is all items that appear in either of the sets, but not both. A new set is + created with the symmetric difference of the sets and is returned. This set and the other set + are unchanged. + + + The symmetric difference of two sets is computed in time O(M + N log M), where M is the size of the + larger set, and N is the size of the smaller set. + + Set to symmetric difference with. + The symmetric difference of the two sets. + This set and don't use the same method for comparing items. + + + + Get a read-only list view of the items in this ordered set. The + items in the list are in sorted order, with the smallest item + at index 0. This view does not copy any data, and reflects any + changes to the underlying OrderedSet. + + A read-only IList<T> view onto this OrderedSet. + + + + Returns a View collection that can be used for enumerating the items in the set in + reversed order. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in set.Reversed()) { + // process item + } +

+

If an item is added to or deleted from the set while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Reverse does not copy the data in the tree, and the operation takes constant time.

+
+ An OrderedSet.View of items in reverse order. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the set.. + Only items that are greater than and + less than are included. The items are enumerated in sorted order. + Items equal to the end points of the range can be included or excluded depending on the + and parameters. + + +

If is greater than , the returned collection is empty.

+

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in set.Range(from, true, to, false)) { + // process item + } +

+

If an item is added to or deleted from the set while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Range does not copy the data in the tree, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--items equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--items equal to the lower bound will not + be included in the range. + The upper bound of the range. + If true, the upper bound is inclusive--items equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--items equal to the upper bound will not + be included in the range. + An OrderedSet.View of items in the given range. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the set.. + Only items that are greater than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in set.RangeFrom(from, true)) { + // process item + } +

+

If an item is added to or deleted from the set while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling RangeFrom does not copy the data in the tree, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--items equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--items equal to the lower bound will not + be included in the range. + An OrderedSet.View of items in the given range. +
+ + + Returns a View collection that can be used for enumerating a range of the items in the set.. + Only items that are less than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(T item in set.RangeTo(to, false)) { + // process item + } +

+

If an item is added to or deleted from the set while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling RangeTo does not copy the data in the tree, and the operation takes constant time.

+
+ The upper bound of the range. + If true, the upper bound is inclusive--items equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--items equal to the upper bound will not + be included in the range. + An OrderedSet.View of items in the given range. +
+ + + Returns the IComparer<T> used to compare items in this set. + + If the set was created using a comparer, that comparer is returned. If the set was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for T (Comparer<T>.Default) is returned. + + + + Returns the number of items in the set. + + The size of the set is returned in constant time. + The number of items in the set. + + + + Get the item by its index in the sorted order. The smallest item has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + The indexer takes time O(log N), which N is the number of items in + the set. + The index to get the item by. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + The nested class that provides a read-only list view + of all or part of the collection. + + + + + Create a new list view wrapped the given set. + + + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. Used to optimize some operations. + Is the view enuemerated in reverse order? + + + + The OrderedSet<T>.View class is used to look at a subset of the Items + inside an ordered set. It is returned from the Range, RangeTo, RangeFrom, and Reversed methods. + + +

Views are dynamic. If the underlying set changes, the view changes in sync. If a change is made + to the view, the underlying set changes accordingly.

+

Typically, this class is used in conjunction with a foreach statement to enumerate the items + in a subset of the OrderedSet. For example:

+ + foreach(T item in set.Range(from, to)) { + // process item + } + +
+
+ + + Initialize the view. + + OrderedSet being viewed + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. Used to optimize some operations. + Is the view enuemerated in reverse order? + + + + Determine if the given item lies within the bounds of this view. + + Item to test. + True if the item is within the bounds of this view. + + + + Enumerate all the items in this view. + + An IEnumerator<T> with the items in this view. + + + + Removes all the items within this view from the underlying set. + + The following removes all the items that start with "A" from an OrderedSet. + + set.Range("A", "B").Clear(); + + + + + + Adds a new item to the set underlying this View. If the set already contains an item equal to + , that item is replaces with . If + is outside the range of this view, an InvalidOperationException + is thrown. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes time O(log N), where N is the number of items in the set. + The item to add. + True if the set already contained an item equal to (which was replaced), false + otherwise. + + + + Adds a new item to the set underlying this View. If the set already contains an item equal to + , that item is replaces with . If + is outside the range of this view, an InvalidOperationException + is thrown. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Adding an item takes time O(log N), where N is the number of items in the set. + The item to add. + + + + Searches the underlying set for an item equal to , and if found, + removes it from the set. If not found, the set is unchanged. If the item is outside + the range of this view, the set is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the set. + Removing an item from the set takes time O(log N), where N is the number of items in the set. + The item to remove. + True if was found and removed. False if was not in the set, or + was outside the range of this view. + + + + Determines if this view of the set contains an item equal to . The set + is not changed. If + + Searching the set for an item takes time O(log N), where N is the number of items in the set. + The item to search for. + True if the set contains , and is within + the range of this view. False otherwise. + + + + Get the index of the given item in the view. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + Finding the index takes time O(log N), which N is the number of items in + the set. + The item to get the index of. + The index of the item in the view, or -1 if the item is not present + in the view. + + + + Get a read-only list view of the items in this view. The + items in the list are in sorted order, with the smallest item + at index 0. This view does not copy any data, and reflects any + changes to the underlying OrderedSet. + + A read-only IList<T> view onto this view. + + + + Creates a new View that has the same items as this view, in the reversed order. + + A new View that has the reversed order of this view, with the same upper + and lower bounds. + + + + Returns the first item in this view: the item + that would appear first if the view was enumerated. + + GetFirst() takes time O(log N), where N is the number of items in the set. + The first item in the view. + The view has no items in it. + + + + Returns the last item in the view: the item + that would appear last if the view was enumerated. + + GetLast() takes time O(log N), where N is the number of items in the set. + The last item in the view. + The view has no items in it. + + + + Number of items in this view. + + Number of items that lie within the bounds the view. + + + + Get the item by its index in the sorted order. The smallest item in the view has index 0, + the next smallest item has index 1, and the largest item has index Count-1. + + The indexer takes time O(log N), which N is the number of items in + the set. + The index to get the item by. + The item at the given index. + is + less than zero or greater than or equal to Count. + + + + The Deque class implements a type of list known as a Double Ended Queue. A Deque + is quite similar to a List, in that items have indices (starting at 0), and the item at any + index can be efficiently retrieved. The difference between a List and a Deque lies in the + efficiency of inserting elements at the beginning. In a List, items can be efficiently added + to the end, but inserting an item at the beginning of the List is slow, taking time + proportional to the size of the List. In a Deque, items can be added to the beginning + or end equally efficiently, regardless of the number of items in the Deque. As a trade-off + for this increased flexibility, Deque is somewhat slower than List (but still constant time) when + being indexed to get or retrieve elements. + + + The Deque class can also be used as a more flexible alternative to the Queue + and Stack classes. Deque is as efficient as Queue and Stack for adding or removing items, + but is more flexible: it allows access + to all items in the queue, and allows adding or removing from either end. + Deque is implemented as a ring buffer, which is grown as necessary. The size + of the buffer is doubled whenever the existing capacity is too small to hold all the + elements. + + The type of items stored in the Deque. + + + + Must be called whenever there is a structural change in the tree. Causes + changeStamp to be changed, which causes any in-progress enumerations + to throw exceptions. + + + + + Checks the given stamp against the current change stamp. If different, the + collection has changed during enumeration and an InvalidOperationException + must be thrown + + changeStamp at the start of the enumeration. + + + + Create a new Deque that is initially empty. + + + + + Create a new Deque initialized with the items from the passed collection, + in order. + + A collection of items to initialize the Deque with. + + + + Copies all the items in the Deque into an array. + + Array to copy to. + Starting index in to copy to. + + + + Trims the amount of memory used by the Deque by changing + the Capacity to be equal to Count. If no more items will be added + to the Deque, calling TrimToSize will reduce the amount of memory + used by the Deque. + + + + + Removes all items from the Deque. + + Clearing the Deque takes a small constant amount of time, regardless of + how many items are currently in the Deque. + + + + Enumerates all of the items in the list, in order. The item at index 0 + is enumerated first, then the item at index 1, and so on. If the items + are added to or removed from the Deque during enumeration, the + enumeration ends with an InvalidOperationException. + + An IEnumerator<T> that enumerates all the + items in the list. + The Deque has an item added or deleted during the enumeration. + + + + Creates the initial buffer and initialized the Deque to contain one initial + item. + + First and only item for the Deque. + + + + Inserts a new item at the given index in the Deque. All items at indexes + equal to or greater than move up one index + in the Deque. + + The amount of time to insert an item in the Deque is proportional + to the distance of index from the closest end of the Deque: + O(Min(, Count - )). + Thus, inserting an item at the front or end of the Deque is always fast; the middle of + of the Deque is the slowest place to insert. + + The index in the Deque to insert the item at. After the + insertion, the inserted item is located at this index. The + front item in the Deque has index 0. + The item to insert at the given index. + is + less than zero or greater than Count. + + + + Inserts a collection of items at the given index in the Deque. All items at indexes + equal to or greater than increase their indices in the Deque + by the number of items inserted. + + The amount of time to insert a collection in the Deque is proportional + to the distance of index from the closest end of the Deque, plus the number of items + inserted (M): + O(M + Min(, Count - )). + + The index in the Deque to insert the collection at. After the + insertion, the first item of the inserted collection is located at this index. The + front item in the Deque has index 0. + The collection of items to insert at the given index. + is + less than zero or greater than Count. + + + + Removes the item at the given index in the Deque. All items at indexes + greater than move down one index + in the Deque. + + The amount of time to delete an item in the Deque is proportional + to the distance of index from the closest end of the Deque: + O(Min(, Count - 1 - )). + Thus, deleting an item at the front or end of the Deque is always fast; the middle of + of the Deque is the slowest place to delete. + + The index in the list to remove the item at. The + first item in the list has index 0. + is + less than zero or greater than or equal to Count. + + + + Removes a range of items at the given index in the Deque. All items at indexes + greater than move down indices + in the Deque. + + The amount of time to delete items in the Deque is proportional + to the distance to the closest end of the Deque: + O(Min(, Count - - )). + + The index in the list to remove the range at. The + first item in the list has index 0. + The number of items to remove. + is + less than zero or greater than or equal to Count, or is less than zero + or too large. + + + + Increase the amount of buffer space. When calling this method, the Deque + must not be empty. If start and end are equal, that indicates a completely + full Deque. + + + + + Adds an item to the front of the Deque. The indices of all existing items + in the Deque are increased by 1. This method is + equivalent to Insert(0, item) but is a little more + efficient. + + Adding an item to the front of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item to add. + + + + Adds a collection of items to the front of the Deque. The indices of all existing items + in the Deque are increased by the number of items inserted. The first item in the added collection becomes the + first item in the Deque. + + This method takes time O(M), where M is the number of items in the + . + The collection of items to add. + + + + Adds an item to the back of the Deque. The indices of all existing items + in the Deque are unchanged. This method is + equivalent to Insert(Count, item) but is a little more + efficient. + + Adding an item to the back of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item to add. + + + + Adds an item to the back of the Deque. The indices of all existing items + in the Deque are unchanged. This method is + equivalent to AddToBack(item). + + Adding an item to the back of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item to add. + + + + Adds a collection of items to the back of the Deque. The indices of all existing items + in the Deque are unchanged. The last item in the added collection becomes the + last item in the Deque. + + This method takes time O(M), where M is the number of items in the + . + The collection of item to add. + + + + Removes an item from the front of the Deque. The indices of all existing items + in the Deque are decreased by 1. This method is + equivalent to RemoveAt(0) but is a little more + efficient. + + Removing an item from the front of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item that was removed. + The Deque is empty. + + + + Removes an item from the back of the Deque. The indices of all existing items + in the Deque are unchanged. This method is + equivalent to RemoveAt(Count-1) but is a little more + efficient. + + Removing an item from the back of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The Deque is empty. + + + + Retreives the item currently at the front of the Deque. The Deque is + unchanged. This method is + equivalent to deque[0] (except that a different exception is thrown). + + Retreiving the item at the front of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item at the front of the Deque. + The Deque is empty. + + + + Retreives the item currently at the back of the Deque. The Deque is + unchanged. This method is + equivalent to deque[deque.Count - 1] (except that a different exception is thrown). + + Retreiving the item at the back of the Deque takes + a small constant amount of time, regardless of how many items are in the Deque. + The item at the back of the Deque. + The Deque is empty. + + + + Creates a new Deque that is a copy of this one. + + Copying a Deque takes O(N) time, where N is the number of items in this Deque.. + A copy of the current deque. + + + + Creates a new Deque that is a copy of this one. + + Copying a Deque takes O(N) time, where N is the number of items in this Deque.. + A copy of the current deque. + + + + Makes a deep clone of this Deque. A new Deque is created with a clone of + each element of this set, by calling ICloneable.Clone on each element. If T is + a value type, then each element is copied as if by simple assignment. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the Deque takes time O(N), where N is the number of items in the Deque. + The cloned Deque. + T is a reference type that does not implement ICloneable. + + + + Gets the number of items currently stored in the Deque. The last item + in the Deque has index Count-1. + + Getting the count of items in the Deque takes a small constant + amount of time. + The number of items stored in this Deque. + + + + Gets or sets the capacity of the Deque. The Capacity is the number of + items that this Deque can hold without expanding its internal buffer. Since + Deque will automatically expand its buffer when necessary, in almost all cases + it is unnecessary to worry about the capacity. However, if it is known that a + Deque will contain exactly 1000 items eventually, it can slightly improve + efficiency to set the capacity to 1000 up front, so that the Deque does not + have to expand automatically. + + The number of items that this Deque can hold without expanding its + internal buffer. + The capacity is being set + to less than Count, or to too large a value. + + + + Gets or sets an item at a particular index in the Deque. + + Getting or setting the item at a particular index takes a small constant amount + of time, no matter what index is used. + The index of the item to retrieve or change. The front item has index 0, and + the back item has index Count-1. + The value at the indicated index. + The index is less than zero or greater than or equal + to Count. + + + + Describes what to do if a key is already in the tree when doing an + insertion. + + + + + The base implementation for various collections classes that use Red-Black trees + as part of their implementation. This class should not (and can not) be + used directly by end users; it's only for internal use by the collections package. + + + The Red-Black tree manages items of type T, and uses a IComparer<T> that + compares items to sort the tree. Multiple items can compare equal and be stored + in the tree. Insert, Delete, and Find operations are provided in their full generality; + all operations allow dealing with either the first or last of items that compare equal. + + + + + Create an array of Nodes big enough for any path from top + to bottom. This is cached, and reused from call-to-call, so only one + can be around at a time per tree. + + The node stack. + + + + Must be called whenever there is a structural change in the tree. Causes + changeStamp to be changed, which causes any in-progress enumerations + to throw exceptions. + + + + + Checks the given stamp against the current change stamp. If different, the + collection has changed during enumeration and an InvalidOperationException + must be thrown + + changeStamp at the start of the enumeration. + + + + Initialize a red-black tree, using the given interface instance to compare elements. Only + Compare is used on the IComparer interface. + + The IComparer<T> used to sort keys. + + + + Clone the tree, returning a new tree containing the same items. Should + take O(N) take. + + Clone version of this tree. + + + + Finds the key in the tree. If multiple items in the tree have + compare equal to the key, finds the first or last one. Optionally replaces the item + with the one searched for. + + Key to search for. + If true, find the first of duplicates, else finds the last of duplicates. + If true, replaces the item with key (if function returns true) + Returns the found item, before replacing (if function returns true). + True if the key was found. + + + + Finds the index of the key in the tree. If multiple items in the tree have + compare equal to the key, finds the first or last one. + + Key to search for. + If true, find the first of duplicates, else finds the last of duplicates. + Index of the item found if the key was found, -1 if not found. + + + + Find the item at a particular index in the tree. + + The zero-based index of the item. Must be >= 0 and < Count. + The item at the particular index. + + + + Insert a new node into the tree, maintaining the red-black invariants. + + Algorithm from Sedgewick, "Algorithms". + The new item to insert + What to do if equal item is already present. + If false, returned, the previous item. + false if duplicate exists, otherwise true. + + + + Split a node with two red children (a 4-node in the 2-3-4 tree formalism), as + part of an insert operation. + + great grand-parent of "node", can be null near root + grand-parent of "node", can be null near root + parent of "node", can be null near root + Node to split, can't be null + Indicates that rotation(s) occurred in the tree. + Node to continue searching from. + + + + Performs a rotation involving the node, it's child and grandchild. The counts of + childs and grand-child are set the correct values from their children; this is important + if they have been adjusted on the way down the try as part of an insert/delete. + + Top node of the rotation. Can be null if child==root. + One child of "node". Not null. + One child of "child". Not null. + + + + Deletes a key from the tree. If multiple elements are equal to key, + deletes the first or last. If no element is equal to the key, + returns false. + + Top-down algorithm from Weiss. Basic plan is to move down in the tree, + rotating and recoloring along the way to always keep the current node red, which + ensures that the node we delete is red. The details are quite complex, however! + Key to delete. + Which item to delete if multiple are equal to key. True to delete the first, false to delete last. + Returns the item that was deleted, if true returned. + True if an element was deleted, false if no element had + specified key. + + + + + Enumerate all the items in-order + + An enumerator for all the items, in order. + The tree has an item added or deleted during the enumeration. + + + + Enumerate all the items in-order + + An enumerator for all the items, in order. + The tree has an item added or deleted during the enumeration. + + + + Gets a range tester that defines a range by first and last items. + + If true, bound the range on the bottom by first. + If useFirst is true, the inclusive lower bound. + If true, bound the range on the top by last. + If useLast is true, the exclusive upper bound. + A RangeTester delegate that tests for an item in the given range. + + + + Gets a range tester that defines a range by first and last items. + + The lower bound. + True if the lower bound is inclusive, false if exclusive. + The upper bound. + True if the upper bound is inclusive, false if exclusive. + A RangeTester delegate that tests for an item in the given range. + + + + Gets a range tester that defines a range by a lower bound. + + The lower bound. + True if the lower bound is inclusive, false if exclusive. + A RangeTester delegate that tests for an item in the given range. + + + + Gets a range tester that defines a range by upper bound. + + The upper bound. + True if the upper bound is inclusive, false if exclusive. + A RangeTester delegate that tests for an item in the given range. + + + + Gets a range tester that defines a range by all items equal to an item. + + The item that is contained in the range. + A RangeTester delegate that tests for an item equal to . + + + + A range tester that defines a range that is the entire tree. + + Item to test. + Always returns 0. + + + + Enumerate the items in a custom range in the tree. The range is determined by + a RangeTest delegate. + + Tests an item against the custom range. + An IEnumerable<T> that enumerates the custom range in order. + The tree has an item added or deleted during the enumeration. + + + + Enumerate all the items in a custom range, under and including node, in-order. + + Tests an item against the custom range. + Node to begin enumeration. May be null. + An enumerable of the items. + The tree has an item added or deleted during the enumeration. + + + + Enumerate the items in a custom range in the tree, in reversed order. The range is determined by + a RangeTest delegate. + + Tests an item against the custom range. + An IEnumerable<T> that enumerates the custom range in reversed order. + The tree has an item added or deleted during the enumeration. + + + + Enumerate all the items in a custom range, under and including node, in reversed order. + + Tests an item against the custom range. + Node to begin enumeration. May be null. + An enumerable of the items, in reversed oreder. + The tree has an item added or deleted during the enumeration. + + + + Deletes either the first or last item from a range, as identified by a RangeTester + delegate. If the range is empty, returns false. + + Top-down algorithm from Weiss. Basic plan is to move down in the tree, + rotating and recoloring along the way to always keep the current node red, which + ensures that the node we delete is red. The details are quite complex, however! + Range to delete from. + If true, delete the first item from the range, else the last. + Returns the item that was deleted, if true returned. + True if an element was deleted, false if the range is empty. + + + + Delete all the items in a range, identified by a RangeTester delegate. + + The delegate that defines the range to delete. + The number of items deleted. + + + + Count the items in a custom range in the tree. The range is determined by + a RangeTester delegate. + + The delegate that defines the range. + The number of items in the range. + + + + Count all the items in a custom range, under and including node. + + The delegate that defines the range. + Node to begin enumeration. May be null. + This node and all under it are either in the range or below it. + This node and all under it are either in the range or above it. + The number of items in the range, under and include node. + + + + Find the first item in a custom range in the tree, and it's index. The range is determined + by a RangeTester delegate. + + The delegate that defines the range. + Returns the item found, if true was returned. + Index of first item in range if range is non-empty, -1 otherwise. + + + + Find the last item in a custom range in the tree, and it's index. The range is determined + by a RangeTester delegate. + + The delegate that defines the range. + Returns the item found, if true was returned. + Index of the item if range is non-empty, -1 otherwise. + + + + Returns the number of elements in the tree. + + + + + The class that is each node in the red-black tree. + + + + + Add one to the Count. + + + + + Subtract one from the Count. The current + Count must be non-zero. + + + + + Clones a node and all its descendants. + + The cloned node. + + + + Is this a red node? + + + + + Get or set the Count field -- a 31-bit field + that holds the number of nodes at or below this + level. + + + + + A delegate that tests if an item is within a custom range. The range must be a contiguous + range of items with the ordering of this tree. The range test function must test + if an item is before, withing, or after the range. + + Item to test against the range. + Returns negative if item is before the range, zero if item is withing the range, + and positive if item is after the range. + + + + Bag<T> is a collection that contains items of type T. + Unlike a Set, duplicate items (items that compare equal to each other) are allowed in an Bag. + + +

The items are compared in one of two ways. If T implements IComparable<T> + then the Equals method of that interface will be used to compare items, otherwise the Equals + method from Object will be used. Alternatively, an instance of IComparer<T> can be passed + to the constructor to use to compare items.

+

Bag is implemented as a hash table. Inserting, deleting, and looking up an + an element all are done in approximately constant time, regardless of the number of items in the bag.

+

When multiple equal items are stored in the bag, they are stored as a representative item and a count. + If equal items can be distinguished, this may be noticable. For example, if a case-insensitive + comparer is used with a Bag<string>, and both "hello", and "HELLO" are added to the bag, then the + bag will appear to contain two copies of "hello" (the representative item).

+

is similar, but uses comparison instead of hashing, maintain + the items in sorted order, and stores distinct copies of items that compare equal.

+
+ +
+ + + Helper function to create a new KeyValuePair struct with an item and a count. + + The item. + The number of appearances. + A new KeyValuePair. + + + + Helper function to create a new KeyValuePair struct with a count of zero. + + The item. + A new KeyValuePair. + + + + Creates a new Bag. + + + Items that are null are permitted. + + + + + Creates a new Bag. The Equals and GetHashCode methods of the passed comparison object + will be used to compare items in this bag for equality. + + An instance of IEqualityComparer<T> that will be used to compare items. + + + + Creates a new Bag. The bag is + initialized with all the items in the given collection. + + + Items that are null are permitted. + + A collection with items to be placed into the Bag. + + + + Creates a new Bag. The Equals and GetHashCode methods of the passed comparison object + will be used to compare items in this bag. The bag is + initialized with all the items in the given collection. + + A collection with items to be placed into the Bag. + An instance of IEqualityComparer<T> that will be used to compare items. + + + + Creates a new Bag given a comparer and a hash that contains the data. Used + internally for Clone. + + IEqualityComparer for the bag. + IEqualityComparer for the key. + Data for the bag. + Size of the bag. + + + + Makes a shallow clone of this bag; i.e., if items of the + bag are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the bag takes time O(N), where N is the number of items in the bag. + The cloned bag. + + + + Makes a shallow clone of this bag; i.e., if items of the + bag are reference types, then they are not cloned. If T is a value type, + then each element is copied as if by simple assignment. + + Cloning the bag takes time O(N), where N is the number of unquie items in the bag. + The cloned bag. + + + + Makes a deep clone of this bag. A new bag is created with a clone of + each element of this bag, by calling ICloneable.Clone on each element. If T is + a value type, then each element is copied as if by simple assignment. + + If T is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the bag takes time O(N log N), where N is the number of items in the bag. + The cloned bag. + T is a reference type that does not implement ICloneable. + + + + Returns the number of copies of in the bag. + + NumberOfCopies() takes approximately constant time, no matter how many items + are stored in the bag. + The item to search for in the bag. + The number of items in the bag that compare equal to . + + + + Returns the representative item stored in the bag that is equal to + the provided item. Also returns the number of copies of the item in the bag. + + Item to find in the bag. + If one or more items equal to are present in the + bag, returns the representative item. If no items equal to are stored in the bag, + returns . + The number of items equal to stored in the bag. + + + + Returns an enumerator that enumerates all the items in the bag. + If an item is present multiple times in the bag, the representative item is yielded by the + enumerator multiple times. The order of enumeration is haphazard and may change. + + +

Typically, this method is not called directly. Instead the "foreach" statement is used + to enumerate the items, which uses this method implicitly.

+

If an item is added to or deleted from the bag while it is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Enumeration all the items in the bag takes time O(N), where N is the number + of items in the bag.

+
+ An enumerator for enumerating all the items in the Bag. +
+ + + Determines if this bag contains an item equal to . The bag + is not changed. + + Searching the bag for an item takes time O(log N), where N is the number of items in the bag. + The item to search for. + True if the bag contains . False if the bag does not contain . + + + + Enumerates all the items in the bag, but enumerates equal items + just once, even if they occur multiple times in the bag. + + If the bag is changed while items are being enumerated, the + enumeration will terminate with an InvalidOperationException. + An IEnumerable<T> that enumerates the unique items. + + + + Adds a new item to the bag. Since bags can contain duplicate items, the item + is added even if the bag already contains an item equal to . In + this case, the count of items for the representative item is increased by one, but the existing + represetative item is unchanged. + + + Adding an item takes approximately constant time, regardless of the number of items in the bag. + The item to add to the bag. + + + + Adds a new item to the bag. Since bags can contain duplicate items, the item + is added even if the bag already contains an item equal to . In + this case (unlike Add), the new item becomes the representative item. + + + Adding an item takes approximately constant time, regardless of the number of items in the bag. + The item to add to the bag. + + + + Changes the number of copies of an existing item in the bag, or adds the indicated number + of copies of the item to the bag. + + + Changing the number of copies takes approximately constant time, regardless of the number of items in the bag. + The item to change the number of copies of. This may or may not already be present in the bag. + The new number of copies of the item. + + + + Adds all the items in to the bag. + + + Adding the collection takes time O(M log N), where N is the number of items in the bag, and M is the + number of items in . + A collection of items to add to the bag. + + + + Searches the bag for one item equal to , and if found, + removes it from the bag. If not found, the bag is unchanged. + + + Equality between items is determined by the comparison instance or delegate used + to create the bag. + Removing an item from the bag takes approximated constant time, + regardless of the number of items in the bag. + The item to remove. + True if was found and removed. False if was not in the bag. + + + + Searches the bag for all items equal to , and + removes all of them from the bag. If not found, the bag is unchanged. + + + Equality between items is determined by the comparer instance used + to create the bag. + RemoveAllCopies() takes time O(M log N), where N is the total number of items in the bag, and M is + the number of items equal to . + The item to remove. + The number of copies of that were found and removed. + + + + Removes all the items in from the bag. Items that + are not present in the bag are ignored. + + + Equality between items is determined by the comparer instance used + to create the bag. + Removing the collection takes time O(M), where M is the + number of items in . + A collection of items to remove from the bag. + The number of items removed from the bag. + is null. + + + + Removes all items from the bag. + + Clearing the bag takes a constant amount of time, regardless of the number of items in it. + + + + Check that this bag and another bag were created with the same comparison + mechanism. Throws exception if not compatible. + + Other bag to check comparision mechanism. + If otherBag and this bag don't use the same method for comparing items. + + + + Determines if this bag is equal to another bag. This bag is equal to + if they contain the same number of + of copies of equal elements. + + IsSupersetOf is computed in time O(N), where N is the number of unique items in + this bag. + Bag to compare to + True if this bag is equal to , false otherwise. + This bag and don't use the same method for comparing items. + + + + Determines if this bag is a superset of another bag. Neither bag is modified. + This bag is a superset of if every element in + is also in this bag, at least the same number of + times. + + IsSupersetOf is computed in time O(M), where M is the number of unique items in + . + Bag to compare to. + True if this is a superset of . + This bag and don't use the same method for comparing items. + + + + Determines if this bag is a proper superset of another bag. Neither bag is modified. + This bag is a proper superset of if every element in + is also in this bag, at least the same number of + times. Additional, this bag must have strictly more items than . + + IsProperSupersetOf is computed in time O(M), where M is the number of unique items in + . + Set to compare to. + True if this is a proper superset of . + This bag and don't use the same method for comparing items. + + + + Determines if this bag is a subset of another ba11 items in this bag. + + Bag to compare to. + True if this is a subset of . + This bag and don't use the same method for comparing items. + + + + Determines if this bag is a proper subset of another bag. Neither bag is modified. + This bag is a subset of if every element in this bag + is also in , at least the same number of + times. Additional, this bag must have strictly fewer items than . + + IsProperSubsetOf is computed in time O(N), where N is the number of unique items in this bag. + Bag to compare to. + True if this is a proper subset of . + This bag and don't use the same method for comparing items. + + + + Determines if this bag is disjoint from another bag. Two bags are disjoint + if no item from one set is equal to any item in the other bag. + + + The answer is computed in time O(N), where N is the size of the smaller set. + + Bag to check disjointness with. + True if the two bags are disjoint, false otherwise. + This bag and don't use the same method for comparing items. + + + + Computes the union of this bag with another bag. The union of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the union contains the item Maximum(X,Y) times. This bag receives + the union of the two bags, the other bag is unchanged. + + + The union of two bags is computed in time O(M+N), where M and N are the size of the + two bags. + + Bag to union with. + This bag and don't use the same method for comparing items. + + + + Computes the union of this bag with another bag. The union of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the union contains the item Maximum(X,Y) times. A new bag is + created with the union of the bags and is returned. This bag and the other bag + are unchanged. + + + The union of two bags is computed in time O(M+N), where M and N are the size of the two bags. + + Bag to union with. + The union of the two bags. + This bag and don't use the same method for comparing items. + + + + Computes the sum of this bag with another bag. The sum of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item (X+Y) times. This bag receives + the sum of the two bags, the other bag is unchanged. + + + The sum of two bags is computed in time O(M), where M is the size of the + other bag.. + + Bag to sum with. + This bag and don't use the same method for comparing items. + + + + Computes the sum of this bag with another bag. he sum of two bags + is all items from both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item (X+Y) times. A new bag is + created with the sum of the bags and is returned. This bag and the other bag + are unchanged. + + + The sum of two bags is computed in time O(M + N log M), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to sum with. + The sum of the two bags. + This bag and don't use the same method for comparing items. + + + + Computes the intersection of this bag with another bag. The intersection of two bags + is all items that appear in both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the sum contains the item Minimum(X,Y) times. This bag receives + the intersection of the two bags, the other bag is unchanged. + + + When equal items appear in both bags, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two bags is computed in time O(N), where N is the size of the smaller bag. + + Bag to intersection with. + This bag and don't use the same method for comparing items. + + + + Computes the intersection of this bag with another bag. The intersection of two bags + is all items that appear in both of the bags. If an item appears X times in one bag, + and Y times in the other bag, the intersection contains the item Minimum(X,Y) times. A new bag is + created with the intersection of the bags and is returned. This bag and the other bag + are unchanged. + + + When equal items appear in both bags, the intersection will include an arbitrary choice of one of the + two equal items. + The intersection of two bags is computed in time O(N), where N is the size of the smaller bag. + + Bag to intersection with. + The intersection of the two bags. + This bag and don't use the same method for comparing items. + + + + Computes the difference of this bag with another bag. The difference of these two bags + is all items that appear in this bag, but not in . If an item appears X times in this bag, + and Y times in the other bag, the difference contains the item X - Y times (zero times if Y >= X). This bag receives + the difference of the two bags; the other bag is unchanged. + + + The difference of two bags is computed in time O(M), where M is the size of the + other bag. + + Bag to difference with. + This bag and don't use the same method for comparing items. + + + + Computes the difference of this bag with another bag. The difference of these two bags + is all items that appear in this bag, but not in . If an item appears X times in this bag, + and Y times in the other bag, the difference contains the item X - Y times (zero times if Y >= X). A new bag is + created with the difference of the bags and is returned. This bag and the other bag + are unchanged. + + + The difference of two bags is computed in time O(M + N), where M and N are the size + of the two bags. + + Bag to difference with. + The difference of the two bags. + This bag and don't use the same method for comparing items. + + + + Computes the symmetric difference of this bag with another bag. The symmetric difference of two bags + is all items that appear in either of the bags, but not both. If an item appears X times in one bag, + and Y times in the other bag, the symmetric difference contains the item AbsoluteValue(X - Y) times. This bag receives + the symmetric difference of the two bags; the other bag is unchanged. + + + The symmetric difference of two bags is computed in time O(M + N), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to symmetric difference with. + This bag and don't use the same method for comparing items. + + + + Computes the symmetric difference of this bag with another bag. The symmetric difference of two bags + is all items that appear in either of the bags, but not both. If an item appears X times in one bag, + and Y times in the other bag, the symmetric difference contains the item AbsoluteValue(X - Y) times. A new bag is + created with the symmetric difference of the bags and is returned. This bag and the other bag + are unchanged. + + + The symmetric difference of two bags is computed in time O(M + N), where M is the size of the + larger bag, and N is the size of the smaller bag. + + Bag to symmetric difference with. + The symmetric difference of the two bags. + This bag and don't use the same method for comparing items. + + + + Returns the IEqualityComparer<T> used to compare items in this bag. + + If the bag was created using a comparer, that comparer is returned. Otherwise + the default comparer for T (EqualityComparer<T>.Default) is returned. + + + + Returns the number of items in the bag. + + The size of the bag is returned in constant time. + The number of items in the bag. + + + + The base implementation for various collections classes that use hash tables + as part of their implementation. This class should not (and can not) be + used directly by end users; it's only for internal use by the collections package. The Hash + does not handle duplicate values. + + + The Hash manages items of type T, and uses a IComparer<ItemTYpe> that + hashes compares items to hash items into the table. + + + + + Constructor. Create a new hash table. + + The comparer to use to compare items. + + + + Gets the current enumeration stamp. Call CheckEnumerationStamp later + with this value to throw an exception if the hash table is changed. + + The current enumeration stamp. + + + + Must be called whenever there is a structural change in the tree. Causes + changeStamp to be changed, which causes any in-progress enumerations + to throw exceptions. + + + + + Checks the given stamp against the current change stamp. If different, the + collection has changed during enumeration and an InvalidOperationException + must be thrown + + changeStamp at the start of the enumeration. + + + + Gets the full hash code for an item. + + Item to get hash code for. + The full hash code. It is never zero. + + + + Get the initial bucket number and skip amount from the full hash value. + + The full hash value. + Returns the initial bucket. Always in the range 0..(totalSlots - 1). + Returns the skip values. Always odd in the range 0..(totalSlots - 1). + + + + Gets the full hash value, initial bucket number, and skip amount for an item. + + Item to get hash value of. + Returns the initial bucket. Always in the range 0..(totalSlots - 1). + Returns the skip values. Always odd in the range 0..(totalSlots - 1). + The full hash value. This is never zero. + + + + Make sure there are enough slots in the hash table that + items can be inserted into the table. + + Number of additional items we are inserting. + + + + Check if the number of items in the table is small enough that + we should shrink the table again. + + + + + Given the size of a hash table, compute the "secondary shift" value -- the shift + that is used to determine the skip amount for collision resolution. + + The new size of the table. + The secondary skip amount. + + + + Resize the hash table to the given new size, moving all items into the + new hash table. + + The new size of the hash table. Must be a power + of two. + + + + Insert a new item into the hash table. If a duplicate item exists, can replace or + do nothing. + + The item to insert. + If true, duplicate items are replaced. If false, nothing + is done if a duplicate already exists. + If a duplicate was found, returns it (whether replaced or not). + True if no duplicate existed, false if a duplicate was found. + + + + Deletes an item from the hash table. + + Item to search for and delete. + If true returned, the actual item stored in the hash table (must be + equal to , but may not be identical. + True if item was found and deleted, false if item wasn't found. + + + + Find an item in the hash table. If found, optionally replace it with the + finding item. + + Item to find. + If true, replaces the equal item in the hash table + with . + Returns the equal item found in the table, if true was returned. + True if the item was found, false otherwise. + + + + Enumerate all of the items in the hash table. The items + are enumerated in a haphazard, unpredictable order. + + An IEnumerator<T> that enumerates the items + in the hash table. + + + + Enumerate all of the items in the hash table. The items + are enumerated in a haphazard, unpredictable order. + + An IEnumerator that enumerates the items + in the hash table. + + + + Creates a clone of this hash table. + + If non-null, this function is applied to each item when cloning. It must be the + case that this function does not modify the hash code or equality function. + A shallow clone that contains the same items. + + + + Serialize the hash table. Called from the serialization infrastructure. + + + + + Called on deserialization. We cannot deserialize now, because hash codes + might not be correct now. We do real deserialization in the OnDeserialization call. + + + + + Deserialize the hash table. Called from the serialization infrastructure when + the object graph has finished deserializing. + + + + + Get the number of items in the hash table. + + The number of items stored in the hash table. + + + + Get the number of slots in the hash table. Exposed internally + for testing purposes. + + The number of slots in the hash table. + + + + Get or change the load factor. Changing the load factor may cause + the size of the table to grow or shrink accordingly. + + + + + + The structure that has each slot in the hash table. Each slot has three parts: + 1. The collision bit. Indicates whether some item visited this slot but had to + keep looking because the slot was full. + 2. 31-bit full hash value of the item. If zero, the slot is empty. + 3. The item itself. + + + + + Clear this slot, leaving the collision bit alone. + + + + + The full hash value associated with the value in this slot, or zero + if the slot is empty. + + + + + Is this slot empty? + + + + + The "Collision" bit indicates that some value hit this slot and + collided, so had to try another slot. + + + + + The OrderedMultiDictionary class that associates values with a key. Unlike an OrderedDictionary, + each key can have multiple values associated with it. When indexing an OrderedMultidictionary, instead + of a single value associated with a key, you retrieve an enumeration of values. + All of the key are stored in sorted order. Also, the values associated with a given key + are kept in sorted order as well. + When constructed, you can chose to allow the same value to be associated with a key multiple + times, or only one time. + + The type of the keys. + The of values associated with the keys. + + + + + + Helper function to create a new KeyValuePair struct. + + The key. + The value. + A new KeyValuePair. + + + + Helper function to create a new KeyValuePair struct with a default value. + + The key. + A new KeyValuePair. + + + + Get a RangeTester that maps to the range of all items with the + given key. + + Key in the given range. + A RangeTester delegate that selects the range of items with that range. + + + + Gets a range tester that defines a range by first and last items. + + The lower bound. + True if the lower bound is inclusive, false if exclusive. + The upper bound. + True if the upper bound is inclusive, false if exclusive. + A RangeTester delegate that tests for a key in the given range. + + + + Gets a range tester that defines a range by a lower bound. + + The lower bound. + True if the lower bound is inclusive, false if exclusive. + A RangeTester delegate that tests for a key in the given range. + + + + Gets a range tester that defines a range by upper bound. + + The upper bound. + True if the upper bound is inclusive, false if exclusive. + A RangeTester delegate that tests for a key in the given range. + + + + Create a new OrderedMultiDictionary. The default ordering of keys and values are used. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + The default ordering of keys and values will be used, as defined by TKey and TValue's implementation + of IComparable<T> (or IComparable if IComparable<T> is not implemented). If a different ordering should be + used, other constructors allow a custom Comparer or IComparer to be passed to changed the ordering. + Can the same value be associated with a key multiple times? + TKey or TValue does not implement either IComparable<T> or IComparable. + + + + Create a new OrderedMultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + A delegate to a method that will be used to compare keys. + TValue does not implement either IComparable<TValue> or IComparable. + + + + Create a new OrderedMultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + A delegate to a method that will be used to compare keys. + A delegate to a method that will be used to compare values. + + + + Create a new OrderedMultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + An IComparer<TKey> instance that will be used to compare keys. + TValue does not implement either IComparable<TValue> or IComparable. + + + + Create a new OrderedMultiDictionary. If duplicate values + are allowed, multiple copies of the same value can be associated with the same key. For example, the key "foo" + could have "a", "a", and "b" associated with it. If duplicate values are not allowed, only one copies of a given value can + be associated with the same key, although different keys can have the same value. For example, the key "foo" could + have "a" and "b" associated with it, which key "bar" has values "b" and "c" associated with it. + + Can the same value be associated with a key multiple times? + An IComparer<TKey> instance that will be used to compare keys. + An IComparer<TValue> instance that will be used to compare values. + + + + Create a new OrderedMultiDictionary. Used internally for cloning. + + Can the same value be associated with a key multiple times? + Number of keys. + An IComparer<TKey> instance that will be used to compare keys. + An IComparer<TValue> instance that will be used to compare values. + Comparer of key-value pairs. + The red-black tree used to store the data. + + + + Adds a new value to be associated with a key. If duplicate values are permitted, this + method always adds a new key-value pair to the dictionary. + If duplicate values are not permitted, and already has a value + equal to associated with it, then that value is replaced with , + and the number of values associate with is unchanged. + + The key to associate with. + The value to associated with . + + + + Removes a given value from the values associated with a key. If the + last value is removed from a key, the key is removed also. + + A key to remove a value from. + The value to remove. + True if was associated with (and was + therefore removed). False if was not associated with . + + + + Removes a key and all associated values from the dictionary. If the + key is not present in the dictionary, it is unchanged and false is returned. + + The key to remove. + True if the key was present and was removed. Returns + false if the key was not present. + + + + Removes all keys and values from the dictionary. + + + + + Determine if two values are equal. + + First value to compare. + Second value to compare. + True if the values are equal. + + + + Checks to see if is associated with + in the dictionary. + + The key to check. + The value to check. + True if is associated with . + + + + Checks to see if the key is present in the dictionary and has + at least one value associated with it. + + The key to check. + True if is present and has at least + one value associated with it. Returns false otherwise. + + + + A private helper method that returns an enumerable that + enumerates all the keys in a range. + + Defines the range to enumerate. + Should the keys be enumerated in reverse order? + An IEnumerable<TKey> that enumerates the keys in the given range. + in the dictionary. + + + + A private helper method for the indexer to return an enumerable that + enumerates all the values for a key. This is separate method because indexers + can't use the yield return construct. + + + An IEnumerable<TValue> that can be used to enumerate all the + values associated with . If is not present, + an enumerable that enumerates no items is returned. + + + + Determines if this dictionary contains a key equal to . If so, all the values + associated with that key are returned through the values parameter. + + The key to search for. + Returns all values associated with key, if true was returned. + True if the dictionary contains key. False if the dictionary does not contain key. + + + + Enumerate all of the keys in the dictionary. + + An IEnumerator<TKey> of all of the keys in the dictionary. + + + + Gets the number of values associated with a given key. + + The key to count values of. + The number of values associated with . If + is not present in the dictionary, zero is returned. + + + + Gets a total count of values in the collection. + + The total number of values associated with all keys in the dictionary. + + + + Makes a shallow clone of this dictionary; i.e., if keys or values of the + dictionary are reference types, then they are not cloned. If TKey or TValue is a value type, + then each element is copied as if by simple assignment. + + Cloning the dictionary takes time O(N), where N is the number of key-value pairs in the dictionary. + The cloned dictionary. + + + + Implements ICloneable.Clone. Makes a shallow clone of this dictionary; i.e., if keys or values are reference types, then they are not cloned. + + The cloned dictionary. + + + + Throw an InvalidOperationException indicating that this type is not cloneable. + + Type to test. + + + + Makes a deep clone of this dictionary. A new dictionary is created with a clone of + each entry of this dictionary, by calling ICloneable.Clone on each element. If TKey or TValue is + a value type, then each element is copied as if by simple assignment. + + If TKey or TValue is a reference type, it must implement + ICloneable. Otherwise, an InvalidOperationException is thrown. + Cloning the dictionary takes time O(N log N), where N is the number of key-value pairs in the dictionary. + The cloned dictionary. + TKey or TValue is a reference type that does not implement ICloneable. + + + + Returns a View collection that can be used for enumerating the keys and values in the collection in + reversed order. + + +

Typically, this method is used in conjunction with a foreach statement. For example: + + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Reversed()) { + // process pair + } +

+

If an entry is added to or deleted from the dictionary while the View is being enumerated, then + the enumeration will end with an InvalidOperationException.

+

Calling Reverse does not copy the data in the dictionary, and the operation takes constant time.

+
+ An OrderedDictionary.View of key-value pairs in reverse order. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only keys that are greater than and + less than are included. The keys are enumerated in sorted order. + Keys equal to the end points of the range can be included or excluded depending on the + and parameters. + + +

If is greater than or equal to , the returned collection is empty.

+

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Range(from, true, to, false)) { + // process pair + } + +

Calling Range does not copy the data in the dictionary, and the operation takes constant time.

+ The lower bound of the range. + If true, the lower bound is inclusive--keys equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--keys equal to the lower bound will not + be included in the range. + The upper bound of the range. + If true, the upper bound is inclusive--keys equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--keys equal to the upper bound will not + be included in the range. + An OrderedMultiDictionary.View of key-value pairs in the given range. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only keys that are greater than (and optionally, equal to) are included. + The keys are enumerated in sorted order. Keys equal to can be included + or excluded depending on the parameter. + + +

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.RangeFrom(from, true)) { + // process pair + } + +

Calling RangeFrom does not copy of the data in the dictionary, and the operation takes constant time.

+
+ The lower bound of the range. + If true, the lower bound is inclusive--keys equal to the lower bound will + be included in the range. If false, the lower bound is exclusive--keys equal to the lower bound will not + be included in the range. + An OrderedMultiDictionary.View of key-value pairs in the given range. +
+ + + Returns a collection that can be used for enumerating some of the keys and values in the collection. + Only items that are less than (and optionally, equal to) are included. + The items are enumerated in sorted order. Items equal to can be included + or excluded depending on the parameter. + + +

The sorted order of the keys is determined by the comparison instance or delegate used + to create the dictionary.

+

Typically, this property is used in conjunction with a foreach statement. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.RangeFrom(from, false)) { + // process pair + } + +

Calling RangeTo does not copy the data in the dictionary, and the operation takes constant time.

+
+ The upper bound of the range. + If true, the upper bound is inclusive--keys equal to the upper bound will + be included in the range. If false, the upper bound is exclusive--keys equal to the upper bound will not + be included in the range. + An OrderedMultiDictionary.View of key-value pairs in the given range. +
+ + + Returns the IComparer<T> used to compare keys in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. If the dictionary was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for TKey (Comparer<TKey>.Default) is returned. + + + + Returns the IComparer<T> used to compare values in this dictionary. + + If the dictionary was created using a comparer, that comparer is returned. If the dictionary was + created using a comparison delegate, then a comparer equivalent to that delegate + is returned. Otherwise + the default comparer for TValue (Comparer<TValue>.Default) is returned. + + + + Gets the number of key-value pairs in the dictionary. Each value associated + with a given key is counted. If duplicate values are permitted, each duplicate + value is included in the count. + + The number of key-value pairs in the dictionary. + + + + Gets a read-only collection of all key-value pairs in the dictionary. If a key has multiple + values associated with it, then a key-value pair is present for each value associated + with the key. + + + + + A private class that implements ICollection<KeyValuePair<TKey,TValue>> and ICollection for the + KeyValuePairs collection. The collection is read-only. + + + + + The OrderedMultiDictionary<TKey,TValue>.View class is used to look at a subset of the keys and values + inside an ordered multi-dictionary. It is returned from the Range, RangeTo, RangeFrom, and Reversed methods. + + +

Views are dynamic. If the underlying dictionary changes, the view changes in sync. If a change is made + to the view, the underlying dictionary changes accordingly.

+

Typically, this class is used in conjunction with a foreach statement to enumerate the keys + and values in a subset of the OrderedMultiDictionary. For example:

+ + foreach(KeyValuePair<TKey, TValue> pair in dictionary.Range(from, to)) { + // process pair + } + +
+
+ + + Initialize the View. + + Associated OrderedMultiDictionary to be viewed. + Range tester that defines the range being used. + If true, then rangeTester defines the entire tree. + Is the view enuemerated in reverse order? + + + + Determine if the given key lies within the bounds of this view. + + Key to test. + True if the key is within the bounds of this view. + + + + Enumerate all the keys in the dictionary. + + An IEnumerator<TKey> that enumerates all of the keys in the collection that + have at least one value associated with them. + + + + Enumerate all of the values associated with a given key. If the key exists and has values associated with it, an enumerator for those + values is returned throught . If the key does not exist, false is returned. + + The key to get values for. + If true is returned, this parameter receives an enumerators that + enumerates the values associated with that key. + True if the key exists and has values associated with it. False otherwise. + + + + Tests if the key is present in the part of the dictionary being viewed. + + Key to check + True if the key is within this view. + + + + Tests if the key-value pair is present in the part of the dictionary being viewed. + + Key to check for. + Value to check for. + True if the key-value pair is within this view. + + + + Gets the number of values associated with a given key. + + The key to count values of. + The number of values associated with . If + is not present in this view, zero is returned. + + + + Adds the given key-value pair to the underlying dictionary of this view. + If is not within the range of this view, an + ArgumentException is thrown. + + + + is not + within the range of this view. + + + + Removes the key (and associated value) from the underlying dictionary of this view. If + no key in the view is equal to the passed key, the dictionary and view are unchanged. + + The key to remove. + True if the key was found and removed. False if the key was not found. + + + + Removes the key and value from the underlying dictionary of this view. that is equal to the passed in key. If + no key in the view is equal to the passed key, or has the given value associated with it, the dictionary and view are unchanged. + + The key to remove. + The value to remove. + True if the key-value pair was found and removed. False if the key-value pair was not found. + + + + Removes all the keys and values within this view from the underlying OrderedMultiDictionary. + + The following removes all the keys that start with "A" from an OrderedMultiDictionary. + + dictionary.Range("A", "B").Clear(); + + + + + + Creates a new View that has the same keys and values as this, in the reversed order. + + A new View that has the reversed order of this view. + + + + Number of keys in this view. + + Number of keys that lie within the bounds the view. + +
+
diff --git a/dep/powercollections/PowerCollections.dll b/dep/powercollections/PowerCollections.dll new file mode 100644 index 00000000..15076467 Binary files /dev/null and b/dep/powercollections/PowerCollections.dll differ diff --git a/dep/protobuf-csharp/Google.ProtocolBuffers.License b/dep/protobuf-csharp/Google.ProtocolBuffers.License new file mode 100644 index 00000000..fb690074 --- /dev/null +++ b/dep/protobuf-csharp/Google.ProtocolBuffers.License @@ -0,0 +1,33 @@ +Copyright 2008, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * 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. + * Neither the name of Google Inc. nor the names of its +contributors may 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. + +Code generated by the Protocol Buffer compiler is owned by the owner +of the input file used when generating it. This code is not +standalone and requires a support library to be linked with it. This +support library is itself covered by the above license. \ No newline at end of file diff --git a/dep/protobuf-csharp/Google.ProtocolBuffers.dll b/dep/protobuf-csharp/Google.ProtocolBuffers.dll new file mode 100644 index 00000000..bf78aa05 Binary files /dev/null and b/dep/protobuf-csharp/Google.ProtocolBuffers.dll differ diff --git a/dep/sharppcap/PacketDotNet.dll b/dep/sharppcap/PacketDotNet.dll new file mode 100644 index 00000000..080f9ad6 Binary files /dev/null and b/dep/sharppcap/PacketDotNet.dll differ diff --git a/dep/sharppcap/PacketDotNet.xml b/dep/sharppcap/PacketDotNet.xml new file mode 100644 index 00000000..47cf2cdf --- /dev/null +++ b/dep/sharppcap/PacketDotNet.xml @@ -0,0 +1,6741 @@ + + + + /home/cmorgan/packetnet_git/PacketDotNet/bin/Release/PacketDotNet + + + + + Represents an application layer packet as described at http://en.wikipedia.org/wiki/Application_Layer + + + + + ApplicationPacket constructor + + + + + Represents a Layer 2 protocol. + + + + + DataLinkPacket constructor + + + + + See http://en.wikipedia.org/wiki/Ethernet#Ethernet_frame_types_and_the_EtherType_field + + + + + Construct a new ethernet packet from source and destination mac addresses + + + + + Constructor + + + A + + + + Payload packet, overridden to set the 'Type' field based on + the type of packet being used here if the PayloadPacket is being set + + + + MAC address of the host where the packet originated from. + + + MAC address of the host where the packet originated from. + + + + Type of packet that this ethernet packet encapsulates + + + + Fetch ascii escape sequence of the color associated with this packet type. + + + + Used by the EthernetPacket constructor. Located here because the LinuxSLL constructor + also needs to perform the same operations as it contains an ethernet type + + + A + + A + + A + + + + Returns the EthernetPacket inside of the Packet p or null if + there is no encapsulated packet + + + A + + A + + + + + + + Generate a random EthernetPacket + TODO: could improve this routine to set a random payload as well + + + A + + + Copied from Pcap.Net @ 20091117 + + Code constants for well-defined ethernet protocols. + EtherType is a two-octet field in an Ethernet frame, as defined by the Ethernet II framing networking standard. + It is used to indicate which protocol is encapsulated in the payload. + Also contains entries taken from linux/if_ether.h and tcpdump/ethertype.h + + + + No Ethernet type + + + + + Internet Protocol, Version 4 (IPv4) + + + + + Address Resolution Protocol (ARP) + + + + + Reverse Address Resolution Protocol (RARP) + + + + + Wake-On-Lan (WOL) + + + + + AppleTalk (Ethertalk) + + + + + AppleTalk Address Resolution Protocol (AARP) + + + + + VLAN-tagged frame (IEEE 802.1Q) + + + + + Novell IPX (alt) + + + + + Novell + + + + + Internet Protocol, Version 6 (IPv6) + + + + + MAC Control + + + + + CobraNet + + + + + MPLS unicast + + + + + MPLS multicast + + + + + PPPoE Discovery Stage + + + + + PPPoE Session Stage + + + + + EAP over LAN (IEEE 802.1X) + + + + + HyperSCSI (SCSI over Ethernet) + + + + + ATA over Ethernet + + + + + EtherCAT Protocol + + + + + Provider Bridging (IEEE 802.1ad) + + + + + AVB Transport Protocol (AVBTP) + + + + + Link Layer Discovery Protocol (LLDP) + + + + + SERCOS III + + + + + Circuit Emulation Services over Ethernet (MEF-8) + + + + + HomePlug + + + + + MAC security (IEEE 802.1AE) + + + + + Precision Time Protocol (IEEE 1588) + + + + + IEEE 802.1ag Connectivity Fault Management (CFM) Protocol / ITU-T Recommendation Y.1731 (OAM) + + + + + Fibre Channel over Ethernet + + + + + FCoE Initialization Protocol + + + + + Q-in-Q + + + + + Veritas Low Latency Transport (LLT) + + + + + Ethernet loopback packet + + + + + Ethernet echo packet + + + + + See http://www.ucertify.com/article/ieee-802-11-frame-format.html + + + + + Constructor + + + A + + + + Types of frames + + + + + Association request + + + + + Association response + + + + + Reassociation request + + + + + Reassociation response + + + + + Probe request + + + + + Probe response + + + + + Reserved 0 + + + + + Reserved 1 + + + + + Becon + + + + + ATIM + + + + + Disassociation + + + + + Authentication + + + + + Deauthentication + + + + + Reserved 2 + + + + + Reserved 3 + + + + + PS poll + + + + + RTS + + + + + CTS + + + + + ACK + + + + + CF-End + + + + + CF-End CF-Ack + + + + + Data + + + + + CF-ACK + + + + + CF-Poll + + + + + CF-Ack CF-Poll + + + + + Null function no data + + + + + CF-Ack No data + + + + + CF-Poll no data + + + + + CF-Ack CF-Poll no data + + + + + Protocol version + + + + + Helps to identify the type of WLAN frame, control data and management are + the various frame types defined in IEEE 802.11 + + + + + Is set to 1 when the frame is sent to Distribution System (DS) + + + + + Is set to 1 when the frame is received from the Distribution System (DS) + + + + + More Fragment is set to 1 when there are more fragments belonging to the same + frame following the current fragment + + + + + Indicates that this fragment is a retransmission of a previously transmitted fragment. + (For receiver to recognize duplicate transmissions of frames) + + + + + Indicates the power management mode that the station will be in after the transmission of the frame + + + + + Indicates that there are more frames buffered for this station + + + + + Indicates that the frame body is encrypted according to the WEP (wired equivalent privacy) algorithm + + + + + Bit is set when the "strict ordering" delivery method is employed. Frames and + fragments are not always sent in order as it causes a transmission performance penalty. + + + + + See http://www.ucertify.com/article/ieee-802-11-frame-format.html + NOTE: All positions are not defined here because the frame type changes + whether some address fields are present or not, causing the sequence control + field to move. In addition the payload size determines where the frame control + sequence value is as it is after the payload bytes, if any payload is present + + + + + Packet class has common fields, FrameControl and Duration and + a specific object class that is set based on the type of + the frame + See http://www.ucertify.com/article/ieee-802-11-frame-format.html + + + + + Constructor + + + A + + + + Interfaces for all inner frames + + + + + Length of the frame + + + + + RTS Frame has a ReceiverAddress[6], TransmitterAddress[6] and a FrameCheckSequence[4], + these fields follow the common FrameControl[2] and DurationId[2] fields + + + + + Constructor + + + A + + A + + + + ReceiverAddress + + + + + TransmitterAddress + + + + + Length of the frame + + + + + ToString() override + + + A + + + + Format of a CTS or an ACK frame + + + + + Constructor + + + A + + A + + + + Receiver address + + + + + Length of the frame + + + + + ToString() override + + + A + + + + Frame control bytes are the first two bytes of the frame + + + + + Frame control field + + + + + Frame check sequence, the last thing in the 802.11 mac packet + + + + + One of RTS, CTS etc frames + + + + + + Zero based address to look up + + + + + + ToString() override + + + A + + + + .Net analog of a ieee80211_radiotap_header from airpcap.h + + + + + Version 0. Only increases for drastic changes, introduction of compatible + new fields does not count. + + + + + Length of the whole header in bytes, including it_version, it_pad, it_len + and data fields + + + + + Returns an array of UInt32 bitmap entries. Each bit in the bitmap indicates + which fields are present. Set bit 31 (0x8000000) + to extend the bitmap by another 32 bits. Additional extensions are made + by setting bit 31. + + + + + Array of radio tap fields + + + + + + + + As defined by Airpcap.h + NOTE: PresentPosition may not be the only position present + as this the field can be extended if the high bit is set + + + + Length of the version field + + + Length of the pad field + + + Length of the length field + + + Length of the first present field (others may follow) + + + Position of the version field + + + Position of the padding field + + + Position of the length field + + + Position of the first present field + + + Default header length, assuming one present field entry + + + + Channel flags + + + + Turbo channel + + + CCK channel + + + OFDM channel + + + 2 GHz spectrum channel + + + 5 GHz spectrum channel + + + Only passive scan allowed + + + Dynamic CCK-OFDM channel + + + GFSK channel (FHSS PHY) + + + 11a static turbo channel only + + + + Channel field + + + + + Constructor + + + A + + + + Channel flags + + + + Type of the field + + + + Frequency in MHz + + + + + Channel number derived from frequency + + + + + Convert a frequency to a channel + + + A + + A + + + + ToString() override + + + A + + + + Fhss radio tap field + + + + + Constructor + + + A + + + Type of the field + + + + Hop set + + + + + Hop pattern + + + + + ToString() override + + + A + + + + Radio tap flags + + + + + Constructor + + + A + + + + Flags set + + + + Type of the field + + + + ToString() override + + + A + + + + Rate field + + + + + Constructor + + + A + + + Type of the field + + + + Rate in Mbps + + + + + ToString() override + + + A + + + + Db antenna signal + + + + + Constructor + + + A + + + Type of the field + + + + Signal strength in dB + + + + + ToString() override + + + A + + + + Antenna noise in dB + + + + + Constructor + + + A + + + Type of the field + + + + Antenna noise in dB + + + + + ToString() override + + + A + + + + Antenna field + + + + + Constructor + + + A + + + Type of the field + + + + Antenna number + + + + + ToString() override + + + A + + + + Antenna signal in dBm + + + + + Constructor + + + A + + + Type of the field + + + + Antenna signal in dBm + + + + + ToString() override + + + A + + + + Antenna noise in dBm + + + + + Constructor + + + A + + + Type of the field + + + + Antenna noise in dBm + + + + + ToString() override + + + A + + + + Lock quality + + + + + Constructor + + + A + + + Type of the field + + + + Signal quality + + + + + ToString() override + + + A + + + + Tsft radio tap field + + + + + Constructor + + + A + + + Type of the field + + + + Timestamp in microseconds + + + + + ToString() override + + + A + + + + Fcs field + + + + + Constructor + + + A + + + Type of the field + + + + Frame check sequence + + + + + ToString() override + + + A + + + + Transmit power expressed as unitless distance from max + power set at factory calibration. 0 is max power. + Monotonically nondecreasing with lower power levels. + + + + + Constructor + + + A + + + Type of the field + + + + Transmit power + + + + + ToString() override + + + A + + + + Transmit power expressed as decibel distance from max power + set at factory calibration. 0 is max power. Monotonically + nondecreasing with lower power levels. + + + + + Constructor + + + A + + + Type of the field + + + + Transmit power + + + + + ToString() override + + + A + + + + Transmit power expressed as dBm (decibels from a 1 milliwatt + reference). This is the absolute power level measured at + the antenna port. + + + + + Constructor + + + A + + + Type of the field + + + + Tx power in dBm + + + + + ToString() override + + + A + + + + Abstract class for all radio tap fields + + + + Type of the field + + + + Parse a radio tap field, indicated by bitIndex, from a given BinaryReader + + + A + + A + + A + + + + Radio tap flags + + + + + sent/received during cfp + + + + + sent/received with short preamble + + + + + sent/received with WEP encryption + + + + + sent/received with fragmentation + + + + + frame includes FCS + + + + + NOTE: Might be out-of-date information since it mentions Ethereal + NOTE: ethereal does NOT handle the following: + IEEE80211_RADIOTAP_FHSS: + IEEE80211_RADIOTAP_LOCK_QUALITY: + IEEE80211_RADIOTAP_TX_ATTENUATION: + IEEE80211_RADIOTAP_DB_TX_ATTENUATION: + + + + + IEEE80211_RADIOTAP_TSFT u_int64_t microseconds + Value in microseconds of the MAC's 64-bit 802.11 Time + Synchronization Function timer when the first bit of the + MPDU arrived at the MAC. For received frames, only. + + + + + IEEE80211_RADIOTAP_FLAGS u_int8_t bitmap + Properties of transmitted and received frames. See flags + defined below. + + + + + IEEE80211_RADIOTAP_RATE u_int8_t 500kb/s + Tx/Rx data rate + + + + + IEEE80211_RADIOTAP_CHANNEL 2 x u_int16_t MHz, bitmap + Tx/Rx frequency in MHz, followed by flags (see below). + + + + + IEEE80211_RADIOTAP_FHSS u_int16_t see below + For frequency-hopping radios, the hop set (first byte) + and pattern (second byte). + + + + + IEEE80211_RADIOTAP_DBM_ANTSIGNAL int8_t decibels from + one milliwatt (dBm) + RF signal power at the antenna, decibel difference from + one milliwatt. + + + + + IEEE80211_RADIOTAP_DBM_ANTNOISE int8_t decibels from + one milliwatt (dBm) + RF noise power at the antenna, decibel difference from one + milliwatt. + + + + + IEEE80211_RADIOTAP_LOCK_QUALITY u_int16_t unitless + Quality of Barker code lock. Unitless. Monotonically + nondecreasing with "better" lock strength. Called "Signal + Quality" in datasheets. (Is there a standard way to measure + this?) + + + + + IEEE80211_RADIOTAP_TX_ATTENUATION u_int16_t unitless + Transmit power expressed as unitless distance from max + power set at factory calibration. 0 is max power. + Monotonically nondecreasing with lower power levels. + + + + + IEEE80211_RADIOTAP_DB_TX_ATTENUATION u_int16_t decibels (dB) + Transmit power expressed as decibel distance from max power + set at factory calibration. 0 is max power. Monotonically + nondecreasing with lower power levels. + + + + + IEEE80211_RADIOTAP_DBM_TX_POWER int8_t decibels from + one milliwatt (dBm) + Transmit power expressed as dBm (decibels from a 1 milliwatt + reference). This is the absolute power level measured at + the antenna port. + + + + + IEEE80211_RADIOTAP_ANTENNA u_int8_t antenna index + Unitless indication of the Rx/Tx antenna for this packet. + The first antenna is antenna 0. + + + + + IEEE80211_RADIOTAP_DB_ANTSIGNAL u_int8_t decibel (dB) + RF signal power at the antenna, decibel difference from an + arbitrary, fixed reference. + + + + + IEEE80211_RADIOTAP_DB_ANTNOISE u_int8_t decibel (dB) + RF noise power at the antenna, decibel difference from an + arbitrary, fixed reference point. + + + + + IEEE80211_RADIOTAP_FCS u_int32_t data + FCS from frame in network byte order. + + + + + Indicates that the flags bitmaps have been extended + + + + + Base class for IPv4 and IPv6 packets that exports the common + functionality that both of these classes has in common + + + + + IpPacket constructor + + + + + The default time to live value for Ip packets being constructed + + + + + Payload packet, overridden to set the NextHeader/Protocol based + on the type of payload packet when the payload packet is set + + + + + The destination address + + + + + The source address + + + + + The IP version + + + + + The protocol of the ip packet's payload + Named 'Protocol' in IPv4 + Named 'NextHeader' in IPv6' + + + + + The protocol of the ip packet's payload + Included along side Protocol for user convienence + + + + + The number of hops remaining before this packet is discarded + Named 'TimeToLive' in IPv4 + Named 'HopLimit' in IPv6 + + + + + The number of hops remaining for this packet + Included along side of TimeToLive for user convienence + + + + + ipv4 header length field, calculated for ipv6 packets + NOTE: This field is the number of 32bit words in the ip header, + ie. the number of bytes is 4x this value + + + + + ipv4 total number of bytes in the ipv4 header + payload, + ipv6 PayloadLength + IPv6Fields.HeaderLength + + + + + ipv6 payload length in bytes, + calculate from ipv4.TotalLength - (ipv4.HeaderLength * 4) + + + + + Adds a pseudo ip header to a given packet. Used to generate the full + byte array required to generate a udp or tcp checksum. + + + A + + A + + + + Convert an ip address from a byte[] + + + A + + A + + A + + A + + + + Called by IPv4 and IPv6 packets to parse their packet payload + + + A + + A + + A + + A + + + + Returns the IpPacket inside of the Packet p or null if + there is no encapsulated packet + + + A + + A + + + + Generate a random packet of a specific ip version + + + A + + A + + + + Base class for all packet types. + Defines helper methods and accessors for the architecture that underlies how + packets interact and store their data. + + + + + Constructor + + + + + Returns true if we already have a contiguous byte[] in either + of these conditions: + - This packet's header byte[] and payload byte[] are the same instance + or + - This packet's header byte[] and this packet's payload packet + are the same instance and the offsets indicate that the bytes + are contiguous + + + + + The packet that is carrying this one + + + + + Returns a + + + + + Packet that this packet carries if one is present. + Note that the packet MAY have a null PayloadPacket but + a non-null PayloadData + + + + + Payload byte[] if one is present. + Note that the packet MAY have a null PayloadData but a + non-null PayloadPacket + + + + + byte[] containing this packet and its payload + NOTE: Use 'public virtual ByteArraySegment BytesHighPerformance' for highest performance + + + + + The option to return a ByteArraySegment means that this method + is higher performance as the data can start at an offset other than + the first byte. + + + + + Color used when generating the text description of a packet + + + + + Parse bytes into a packet + + + A + + A + + A + + + + Used to ensure that values like checksums and lengths are + properly updated + + + + + Called to ensure that calculated values are updated before + the packet bytes are retrieved + Classes should override this method to update things like + checksums and lengths that take too much time or are too complex + to update for each packet parameter change + + + + Output this packet as a readable string + + + + Output the packet information in the specified format + Normal - outputs the packet info to a single line + Colored - outputs the packet info to a single line with coloring + Verbose - outputs detailed info about the packet + VerboseColored - outputs detailed info about the packet with coloring + + + + + + + + Prints the Packet PayloadData in Hex format + With the 16-byte segment number, raw bytes, and parsed ascii output + Ex: + 0010 00 18 82 6c 7c 7f 00 c0 9f 77 a3 b0 88 64 11 00 ...1|... .w...d.. + + + A + + + + Session layer packet + + + + + Constructor + + + + + TcpPacket + See: http://en.wikipedia.org/wiki/Transmission_Control_Protocol + + + + + Create a new TCP packet from values + + + + + Constructor + + + A + + + + Constructor + + + A + + A + + + + 20 bytes is the smallest tcp header + + + + Fetch the port number on the source host. + + + Fetches the port number on the destination host. + + + Fetch the packet sequence number. + + + Fetch the packet acknowledgment number. + + + The size of the tcp header in 32bit words + + + + The size of the receive window, which specifies the number of + bytes (beyond the sequence number in the acknowledgment field) that + the receiver is currently willing to receive. + + + + + Tcp checksum field value of type UInt16 + + + + Check if the TCP packet is valid, checksum-wise. + + + + True if the tcp checksum is valid + + + + + Flags, 9 bits + TODO: Handle the NS bit + + + + Check the URG flag, flag indicates if the urgent pointer is valid. + + + Check the ACK flag, flag indicates if the ack number is valid. + + + Check the PSH flag, flag indicates the receiver should pass the + data to the application as soon as possible. + + + + Check the RST flag, flag indicates the session should be reset between + the sender and the receiver. + + + + Check the SYN flag, flag indicates the sequence numbers should + be synchronized between the sender and receiver to initiate + a connection. + + + + Check the FIN flag, flag indicates the sender is finished sending. + + + + ECN flag + + + + + CWR flag + + + + Fetch ascii escape sequence of the color associated with this packet type. + + + Fetch the urgent pointer. + + + + Bytes that represent the tcp options + + + A + + + + Contains the Options list attached to the TCP header + + + + + Computes the TCP checksum. Does not update the current checksum value + + The calculated TCP checksum. + + + + Update the checksum value. + + + + + + + + + Returns the TcpPacket embedded in Packet p or null if + there is no embedded TcpPacket + + + + + Create a randomized tcp packet with the given ip version + + + A + + + + User datagram protocol + See http://en.wikipedia.org/wiki/Udp + + + + + Create from values + + + A + + A + + + + Constructor + + + A + + + + Constructor + + + A + + A + + + Fetch the port number on the source host. + + + Fetch the port number on the target host. + + + + Length in bytes of the header and payload, minimum size of 8, + the size of the Udp header + + + + Fetch the header checksum. + + + Check if the UDP packet is valid, checksum-wise. + + + + True if the udp checksum is valid + + + + Fetch ascii escape sequence of the color associated with this packet type. + + + + Update the Udp length + + + + + Calculates the UDP checksum, optionally updating the UDP checksum header. + + The calculated UDP checksum. + + + + Update the checksum value. + + + + + + + + Returns the UdpPacket inside of the Packet p or null if + there is no encapsulated packet + + + A + + A + + + + Generate a random packet + + + A + + + + Ethernet protocol field encoding information. + + + + Width of the ethernet type code in bytes. + + + Position of the destination MAC address within the ethernet header. + + + Position of the source MAC address within the ethernet header. + + + Position of the ethernet type field within the ethernet header. + + + Total length of an ethernet header in bytes. + + + + size of an ethernet mac address in bytes + + + + + Transport layer packet + + + + + Constructor + + + + + Options for use when creating a transport layer checksum + + + + + No extra options + + + + + Attach a pseudo IP header to the transport data being checksummed + + + + + The Checksum version + + + + + Calculates the transport layer checksum, either for the + tcp or udp packet + + + + + + A + + + + Determine if the transport layer checksum is valid + + + A + + A + + + String constants for color console output. +

+ This file contains control sequences to print color text on a text + console capable of interpreting and displaying control sequences. +

+ A capable console would be + unix bash, os/2 shell, or command.com w/ ansi.sys loaded +

+ Chris Cheetham + +
+ + + Delimits the start of an ansi color sequence, the color code goes after this + + + + + Delimits the stop of the ansi color sequence, the color code comes before this + + + + + Defines the lengths and positions of the udp fields within + a udp packet + + + + Length of a UDP port in bytes. + + + Length of the header length field in bytes. + + + Length of the checksum field in bytes. + + + Position of the source port. + + + Position of the destination port. + + + Position of the header length. + + + Position of the header checksum length. + + + Length of a UDP header in bytes. + + + + Equivalent of System.IO.BinaryReader, but with either endianness, depending on + the EndianBitConverter it is constructed with. No data is buffered in the + reader; the client may seek within the stream at will. + + + + + Equivalent of System.IO.BinaryWriter, but with either endianness, depending on + the EndianBitConverter it is constructed with. + + Converter to use when reading data + Stream to read data from + + + + Constructs a new binary reader with the given bit converter, reading + to the given stream, using the given encoding. + + Converter to use when reading data + Stream to read data from + Encoding to use when reading character data + + + + Whether or not this reader has been disposed yet. + + + + + Decoder to use for string conversions. + + + + + Buffer used for temporary storage before conversion into primitives + + + + + Buffer used for temporary storage when reading a single character + + + + + Minimum number of bytes used to encode a character + + + + + The bit converter used to read values from the stream + + + + + The encoding used to read strings + + + + + Gets the underlying stream of the EndianBinaryReader. + + + + + Closes the reader, including the underlying stream.. + + + + + Seeks within the stream. + + Offset to seek to. + Origin of seek operation. + + + + Reads a single byte from the stream. + + The byte read + + + + Reads a single signed byte from the stream. + + The byte read + + + + Reads a boolean from the stream. 1 byte is read. + + The boolean read + + + + Reads a 16-bit signed integer from the stream, using the bit converter + for this reader. 2 bytes are read. + + The 16-bit integer read + + + + Reads a 32-bit signed integer from the stream, using the bit converter + for this reader. 4 bytes are read. + + The 32-bit integer read + + + + Reads a 64-bit signed integer from the stream, using the bit converter + for this reader. 8 bytes are read. + + The 64-bit integer read + + + + Reads a 16-bit unsigned integer from the stream, using the bit converter + for this reader. 2 bytes are read. + + The 16-bit unsigned integer read + + + + Reads a 32-bit unsigned integer from the stream, using the bit converter + for this reader. 4 bytes are read. + + The 32-bit unsigned integer read + + + + Reads a 64-bit unsigned integer from the stream, using the bit converter + for this reader. 8 bytes are read. + + The 64-bit unsigned integer read + + + + Reads a single-precision floating-point value from the stream, using the bit converter + for this reader. 4 bytes are read. + + The floating point value read + + + + Reads a double-precision floating-point value from the stream, using the bit converter + for this reader. 8 bytes are read. + + The floating point value read + + + + Reads a decimal value from the stream, using the bit converter + for this reader. 16 bytes are read. + + The decimal value read + + + + Reads a single character from the stream, using the character encoding for + this reader. If no characters have been fully read by the time the stream ends, + -1 is returned. + + The character read, or -1 for end of stream. + + + + Reads the specified number of characters into the given buffer, starting at + the given index. + + The buffer to copy data into + The first index to copy data into + The number of characters to read + The number of characters actually read. This will only be less than + the requested number of characters if the end of the stream is reached. + + + + + Reads the specified number of bytes into the given buffer, starting at + the given index. + + The buffer to copy data into + The first index to copy data into + The number of bytes to read + The number of bytes actually read. This will only be less than + the requested number of bytes if the end of the stream is reached. + + + + + Reads the specified number of bytes, returning them in a new byte array. + If not enough bytes are available before the end of the stream, this + method will return what is available. + + The number of bytes to read + The bytes read + + + + Reads the specified number of bytes, returning them in a new byte array. + If not enough bytes are available before the end of the stream, this + method will throw an IOException. + + The number of bytes to read + The bytes read + + + + Reads a 7-bit encoded integer from the stream. This is stored with the least significant + information first, with 7 bits of information per byte of value, and the top + bit as a continuation flag. This method is not affected by the endianness + of the bit converter. + + The 7-bit encoded integer read from the stream. + + + + Reads a 7-bit encoded integer from the stream. This is stored with the most significant + information first, with 7 bits of information per byte of value, and the top + bit as a continuation flag. This method is not affected by the endianness + of the bit converter. + + The 7-bit encoded integer read from the stream. + + + + Reads a length-prefixed string from the stream, using the encoding for this reader. + A 7-bit encoded integer is first read, which specifies the number of bytes + to read from the stream. These bytes are then converted into a string with + the encoding for this reader. + + The string read from the stream. + + + + Checks whether or not the reader has been disposed, throwing an exception if so. + + + + + Reads the given number of bytes from the stream, throwing an exception + if they can't all be read. + + Buffer to read into + Number of bytes to read + + + + Reads the given number of bytes from the stream if possible, returning + the number of bytes actually read, which may be less than requested if + (and only if) the end of the stream is reached. + + Buffer to read into + Number of bytes to read + Number of bytes actually read + + + + Disposes of the underlying stream. + + + + + Equivalent of System.IO.BinaryWriter, but with either endianness, depending on + the EndianBitConverter it is constructed with. + + + + + Constructs a new binary writer with the given bit converter, writing + to the given stream, using UTF-8 encoding. + + Converter to use when writing data + Stream to write data to + + + + Constructs a new binary writer with the given bit converter, writing + to the given stream, using the given encoding. + + Converter to use when writing data + Stream to write data to + Encoding to use when writing character data + + + + Whether or not this writer has been disposed yet. + + + + + Buffer used for temporary storage during conversion from primitives + + + + + Buffer used for Write(char) + + + + + The bit converter used to write values to the stream + + + + + The encoding used to write strings + + + + + Gets the underlying stream of the EndianBinaryWriter. + + + + + Closes the writer, including the underlying stream. + + + + + Flushes the underlying stream. + + + + + Seeks within the stream. + + Offset to seek to. + Origin of seek operation. + + + + Writes a boolean value to the stream. 1 byte is written. + + The value to write + + + + Writes a 16-bit signed integer to the stream, using the bit converter + for this writer. 2 bytes are written. + + The value to write + + + + Writes a 32-bit signed integer to the stream, using the bit converter + for this writer. 4 bytes are written. + + The value to write + + + + Writes a 64-bit signed integer to the stream, using the bit converter + for this writer. 8 bytes are written. + + The value to write + + + + Writes a 16-bit unsigned integer to the stream, using the bit converter + for this writer. 2 bytes are written. + + The value to write + + + + Writes a 32-bit unsigned integer to the stream, using the bit converter + for this writer. 4 bytes are written. + + The value to write + + + + Writes a 64-bit unsigned integer to the stream, using the bit converter + for this writer. 8 bytes are written. + + The value to write + + + + Writes a single-precision floating-point value to the stream, using the bit converter + for this writer. 4 bytes are written. + + The value to write + + + + Writes a double-precision floating-point value to the stream, using the bit converter + for this writer. 8 bytes are written. + + The value to write + + + + Writes a decimal value to the stream, using the bit converter for this writer. + 16 bytes are written. + + The value to write + + + + Writes a signed byte to the stream. + + The value to write + + + + Writes an unsigned byte to the stream. + + The value to write + + + + Writes an array of bytes to the stream. + + The values to write + + + + Writes a portion of an array of bytes to the stream. + + An array containing the bytes to write + The index of the first byte to write within the array + The number of bytes to write + + + + Writes a single character to the stream, using the encoding for this writer. + + The value to write + + + + Writes an array of characters to the stream, using the encoding for this writer. + + An array containing the characters to write + + + + Writes a string to the stream, using the encoding for this writer. + + The value to write. Must not be null. + value is null + + + + Writes a 7-bit encoded integer from the stream. This is stored with the least significant + information first, with 7 bits of information per byte of value, and the top + bit as a continuation flag. + + The 7-bit encoded integer to write to the stream + + + + Checks whether or not the writer has been disposed, throwing an exception if so. + + + + + Writes the specified number of bytes from the start of the given byte array, + after checking whether or not the writer has been disposed. + + The array of bytes to write from + The number of bytes to write + + + + Disposes of the underlying stream. + + + + + Implementation of EndianBitConverter which converts to/from big-endian + byte arrays. + + + + + Indicates the byte order ("endianess") in which data is converted using this class. + + + + + Indicates the byte order ("endianess") in which data is converted using this class. + + + Different computer architectures store data using different byte orders. "Big-endian" + means the most significant byte is on the left end of a word. "Little-endian" means the + most significant byte is on the right end of a word. + + true if this converter is little-endian, false otherwise. + + + + Copies the specified number of bytes from value to buffer, starting at index. + + The value to copy + The number of bytes to copy + The buffer to copy the bytes into + The index to start at + + + + Returns a value built from the specified number of bytes from the given buffer, + starting at index. + + The data in byte array format + The first index to use + The number of bytes to use + The value built from the given bytes + + + + A class to allow the conversion of doubles to string representations of + their exact decimal values. The implementation aims for readability over + efficiency. + + + + + Private class used for manipulating sequences of decimal digits. + + + + + Constructs an arbitrary decimal expansion from the given long. + The long must not be negative. + + + + Digits in the decimal expansion, one byte per digit + + + + How many digits are *after* the decimal point + + + + + Multiplies the current expansion by the given amount, which should + only be 2 or 5. + + + + + Shifts the decimal point; a negative value makes + the decimal expansion bigger (as fewer digits come after the + decimal place) and a positive value makes the decimal + expansion smaller. + + + + + Removes leading/trailing zeroes from the expansion. + + + + + Converts the value to a proper decimal string representation. + + + + + Converts the given double to a string representation of its + exact decimal value. + + The double to convert. + A string representation of the double's exact decimal value. + + + + Equivalent of System.BitConverter, but with either endianness. + + + + + Union used solely for the equivalent of DoubleToInt64Bits and vice versa. + + + + + Creates an instance representing the given integer. + + The integer value of the new instance. + + + + Creates an instance representing the given floating point number. + + The floating point value of the new instance. + + + + Int32 version of the value. + + + + + Single version of the value. + + + + + Returns the value of the instance as an integer. + + + + + Returns the value of the instance as a floating point number. + + + + + Indicates the byte order ("endianess") in which data is converted using this class. + + + + + Returns a little-endian bit converter instance. The same instance is + always returned. + + + + + Returns a big-endian bit converter instance. The same instance is + always returned. + + + + + Indicates the byte order ("endianess") in which data is converted using this class. + + + Different computer architectures store data using different byte orders. "Big-endian" + means the most significant byte is on the left end of a word. "Little-endian" means the + most significant byte is on the right end of a word. + + true if this converter is little-endian, false otherwise. + + + + Converts the specified double-precision floating point number to a + 64-bit signed integer. Note: the endianness of this converter does not + affect the returned value. + + The number to convert. + A 64-bit signed integer whose value is equivalent to value. + + + + Converts the specified 64-bit signed integer to a double-precision + floating point number. Note: the endianness of this converter does not + affect the returned value. + + The number to convert. + A double-precision floating point number whose value is equivalent to value. + + + + Converts the specified single-precision floating point number to a + 32-bit signed integer. Note: the endianness of this converter does not + affect the returned value. + + The number to convert. + A 32-bit signed integer whose value is equivalent to value. + + + + Converts the specified 32-bit signed integer to a single-precision floating point + number. Note: the endianness of this converter does not + affect the returned value. + + The number to convert. + A single-precision floating point number whose value is equivalent to value. + + + + Returns a Boolean value converted from one byte at a specified position in a byte array. + + An array of bytes. + The starting position within value. + true if the byte at startIndex in value is nonzero; otherwise, false. + + + + Returns a Unicode character converted from two bytes at a specified position in a byte array. + + An array of bytes. + The starting position within value. + A character formed by two bytes beginning at startIndex. + + + + Returns a double-precision floating point number converted from eight bytes + at a specified position in a byte array. + + An array of bytes. + The starting position within value. + A double precision floating point number formed by eight bytes beginning at startIndex. + + + + Returns a single-precision floating point number converted from four bytes + at a specified position in a byte array. + + An array of bytes. + The starting position within value. + A single precision floating point number formed by four bytes beginning at startIndex. + + + + Returns a 16-bit signed integer converted from two bytes at a specified position in a byte array. + + An array of bytes. + The starting position within value. + A 16-bit signed integer formed by two bytes beginning at startIndex. + + + + Returns a 32-bit signed integer converted from four bytes at a specified position in a byte array. + + An array of bytes. + The starting position within value. + A 32-bit signed integer formed by four bytes beginning at startIndex. + + + + Returns a 64-bit signed integer converted from eight bytes at a specified position in a byte array. + + An array of bytes. + The starting position within value. + A 64-bit signed integer formed by eight bytes beginning at startIndex. + + + + Returns a 16-bit unsigned integer converted from two bytes at a specified position in a byte array. + + An array of bytes. + The starting position within value. + A 16-bit unsigned integer formed by two bytes beginning at startIndex. + + + + Returns a 32-bit unsigned integer converted from four bytes at a specified position in a byte array. + + An array of bytes. + The starting position within value. + A 32-bit unsigned integer formed by four bytes beginning at startIndex. + + + + Returns a 64-bit unsigned integer converted from eight bytes at a specified position in a byte array. + + An array of bytes. + The starting position within value. + A 64-bit unsigned integer formed by eight bytes beginning at startIndex. + + + + Checks the given argument for validity. + + The byte array passed in + The start index passed in + The number of bytes required + value is a null reference + + startIndex is less than zero or greater than the length of value minus bytesRequired. + + + + + Checks the arguments for validity before calling FromBytes + (which can therefore assume the arguments are valid). + + The bytes to convert after checking + The index of the first byte to convert + The number of bytes to convert + + + + + + Convert the given number of bytes from the given array, from the given start + position, into a long, using the bytes as the least significant part of the long. + By the time this is called, the arguments have been checked for validity. + + The bytes to convert + The index of the first byte to convert + The number of bytes to use in the conversion + The converted number + + + + Returns a String converted from the elements of a byte array. + + An array of bytes. + All the elements of value are converted. + + A String of hexadecimal pairs separated by hyphens, where each pair + represents the corresponding element in value; for example, "7F-2C-4A". + + + + + Returns a String converted from the elements of a byte array starting at a specified array position. + + An array of bytes. + The starting position within value. + The elements from array position startIndex to the end of the array are converted. + + A String of hexadecimal pairs separated by hyphens, where each pair + represents the corresponding element in value; for example, "7F-2C-4A". + + + + + Returns a String converted from a specified number of bytes at a specified position in a byte array. + + An array of bytes. + The starting position within value. + The number of bytes to convert. + The length elements from array position startIndex are converted. + + A String of hexadecimal pairs separated by hyphens, where each pair + represents the corresponding element in value; for example, "7F-2C-4A". + + + + + Returns a decimal value converted from sixteen bytes + at a specified position in a byte array. + + An array of bytes. + The starting position within value. + A decimal formed by sixteen bytes beginning at startIndex. + + + + Returns the specified decimal value as an array of bytes. + + The number to convert. + An array of bytes with length 16. + + + + Copies the specified decimal value into the specified byte array, + beginning at the specified index. + + A character to convert. + The byte array to copy the bytes into + The first index into the array to copy the bytes into + + + + Returns an array with the given number of bytes formed + from the least significant bytes of the specified value. + This is used to implement the other GetBytes methods. + + The value to get bytes for + The number of significant bytes to return + + + + Returns the specified Boolean value as an array of bytes. + + A Boolean value. + An array of bytes with length 1. + + + + Returns the specified Unicode character value as an array of bytes. + + A character to convert. + An array of bytes with length 2. + + + + Returns the specified double-precision floating point value as an array of bytes. + + The number to convert. + An array of bytes with length 8. + + + + Returns the specified 16-bit signed integer value as an array of bytes. + + The number to convert. + An array of bytes with length 2. + + + + Returns the specified 32-bit signed integer value as an array of bytes. + + The number to convert. + An array of bytes with length 4. + + + + Returns the specified 64-bit signed integer value as an array of bytes. + + The number to convert. + An array of bytes with length 8. + + + + Returns the specified single-precision floating point value as an array of bytes. + + The number to convert. + An array of bytes with length 4. + + + + Returns the specified 16-bit unsigned integer value as an array of bytes. + + The number to convert. + An array of bytes with length 2. + + + + Returns the specified 32-bit unsigned integer value as an array of bytes. + + The number to convert. + An array of bytes with length 4. + + + + Returns the specified 64-bit unsigned integer value as an array of bytes. + + The number to convert. + An array of bytes with length 8. + + + + Copies the given number of bytes from the least-specific + end of the specified value into the specified byte array, beginning + at the specified index. + This is used to implement the other CopyBytes methods. + + The value to copy bytes for + The number of significant bytes to copy + The byte array to copy the bytes into + The first index into the array to copy the bytes into + + + + Copies the given number of bytes from the least-specific + end of the specified value into the specified byte array, beginning + at the specified index. + This must be implemented in concrete derived classes, but the implementation + may assume that the value will fit into the buffer. + + The value to copy bytes for + The number of significant bytes to copy + The byte array to copy the bytes into + The first index into the array to copy the bytes into + + + + Copies the specified Boolean value into the specified byte array, + beginning at the specified index. + + A Boolean value. + The byte array to copy the bytes into + The first index into the array to copy the bytes into + + + + Copies the specified Unicode character value into the specified byte array, + beginning at the specified index. + + A character to convert. + The byte array to copy the bytes into + The first index into the array to copy the bytes into + + + + Copies the specified double-precision floating point value into the specified byte array, + beginning at the specified index. + + The number to convert. + The byte array to copy the bytes into + The first index into the array to copy the bytes into + + + + Copies the specified 16-bit signed integer value into the specified byte array, + beginning at the specified index. + + The number to convert. + The byte array to copy the bytes into + The first index into the array to copy the bytes into + + + + Copies the specified 32-bit signed integer value into the specified byte array, + beginning at the specified index. + + The number to convert. + The byte array to copy the bytes into + The first index into the array to copy the bytes into + + + + Copies the specified 64-bit signed integer value into the specified byte array, + beginning at the specified index. + + The number to convert. + The byte array to copy the bytes into + The first index into the array to copy the bytes into + + + + Copies the specified single-precision floating point value into the specified byte array, + beginning at the specified index. + + The number to convert. + The byte array to copy the bytes into + The first index into the array to copy the bytes into + + + + Copies the specified 16-bit unsigned integer value into the specified byte array, + beginning at the specified index. + + The number to convert. + The byte array to copy the bytes into + The first index into the array to copy the bytes into + + + + Copies the specified 32-bit unsigned integer value into the specified byte array, + beginning at the specified index. + + The number to convert. + The byte array to copy the bytes into + The first index into the array to copy the bytes into + + + + Copies the specified 64-bit unsigned integer value into the specified byte array, + beginning at the specified index. + + The number to convert. + The byte array to copy the bytes into + The first index into the array to copy the bytes into + + + + Endianness of a converter + + + + + Little endian - least significant byte first + + + + + Big endian - most significant byte first + + + + + Implementation of EndianBitConverter which converts to/from little-endian + byte arrays. + + + + + Indicates the byte order ("endianess") in which data is converted using this class. + + + + + Indicates the byte order ("endianess") in which data is converted using this class. + + + Different computer architectures store data using different byte orders. "Big-endian" + means the most significant byte is on the left end of a word. "Little-endian" means the + most significant byte is on the right end of a word. + + true if this converter is little-endian, false otherwise. + + + + Copies the specified number of bytes from value to buffer, starting at index. + + The value to copy + The number of bytes to copy + The buffer to copy the bytes into + The index to start at + + + + Returns a value built from the specified number of bytes from the given buffer, + starting at index. + + The data in byte array format + The first index to use + The number of bytes to use + The value built from the given bytes + + + + Internet packets include IPv4, IPv6, IGMP etc, see + http://en.wikipedia.org/wiki/Internet_Layer + + + + + Constructor + + + + + IP protocol field encoding information. + + + + Width of the IP version and header length field in bytes. + + + Width of the Differentiated Services / Type of service field in bytes. + + + Width of the total length field in bytes. + + + Width of the ID field in bytes. + + + Width of the fragment offset bits and offset field in bytes. + + + Width of the TTL field in bytes. + + + Width of the IP protocol code in bytes. + + + Width of the IP checksum in bytes. + + + Position of the version code and header length within the IP header. + + + Position of the differentiated services value within the IP header. + + + Position of the header length within the IP header. + + + Position of the packet ID within the IP header. + + + Position of the flag bits and fragment offset within the IP header. + + + Position of the ttl within the IP header. + + + + Position of the protocol used within the IP data + + + + Position of the checksum within the IP header. + + + Position of the source IP address within the IP header. + + + Position of the destination IP address within a packet. + + + Length in bytes of an IP header, excluding options. + + + + Number of bytes in an IPv4 address + + + + + IPv4 packet + See http://en.wikipedia.org/wiki/IPv4 for into + + + + + Construct an instance by values + + + + + Constructor + + + A + + + Type of service code constants for IP. Type of service describes + how a packet should be handled. +

+ TOS is an 8-bit record in an IP header which contains a 3-bit + precendence field, 4 TOS bit fields and a 0 bit. +

+ The following constants are bit masks which can be logically and'ed + with the 8-bit IP TOS field to determine what type of service is set. +

+ Taken from TCP/IP Illustrated V1 by Richard Stevens, p34. +

+
+ + + Number of bytes in the smallest valid ipv4 packet + + + + + Version number of the IP protocol being used + + + + Get the IP version code. + + + + Forwards compatibility IPv6.PayloadLength property + + + + + The IP header length field. At most, this can be a + four-bit value. The high order bits beyond the fourth bit + will be ignored. + + The length of the IP header in 32-bit words. + + + + + The unique ID of this IP datagram. The ID normally + increments by one each time a datagram is sent by a host. + A 16-bit unsigned integer. + + + + + Fragmentation offset + The offset specifies a number of octets (i.e., bytes). + A 13-bit unsigned integer. + + + + Fetch the IP address of the host where the packet originated from. + + + Fetch the IP address of the host where the packet is destined. + + + Fetch the header checksum. + + + Check if the IP packet is valid, checksum-wise. + + + + Check if the IP packet header is valid, checksum-wise. + + + + Fetch ascii escape sequence of the color associated with this packet type. + + + Fetch the type of service. + + + + Renamed to DifferentiatedServices in IPv6 but present here + for backwards compatibility + + + + + The entire datagram size including header and data + + + + Fetch fragment flags. + A 3-bit unsigned integer. + + + Fetch the time to live. TTL sets the upper limit on the number of + routers through which this IP datagram is allowed to pass. + Originally intended to be the number of seconds the packet lives it is now decremented + by one each time a router passes the packet on + 8-bit value + + + + Fetch the code indicating the type of protocol embedded in the IP + + + + + + Calculates the IP checksum, optionally updating the IP checksum header. + + The calculated IP checksum. + + + + + Update the checksum value + + + + + Prepend to the given byte[] origHeader the portion of the IPv6 header used for + generating an tcp checksum + http://en.wikipedia.org/wiki/Transmission_Control_Protocol#TCP_checksum_using_IPv4 + http://tools.ietf.org/html/rfc793 + + + A + + A + + + + + + + Generate a random packet + + + A + + + + Update the length fields + + + + + A struct containing length and position information about IPv6 Fields. + + + + + Commutes the field positions. + + + + + The IP Version, Traffic Class, and Flow Label field length. These must be in one + field due to boundary crossings. + + + + + The payload length field length. + + + + + The next header field length, identifies protocol encapsulated by the packet + + + + + The hop limit field length. + + + + + Address field length + + + + + The byte position of the field line in the IPv6 header. + This is where the IP version, Traffic Class, and Flow Label fields are. + + + + + The byte position of the payload length field. + + + + + The byte position of the next header field. (Replaces the ipv4 protocol field) + + + + + The byte position of the hop limit field. + + + + + The byte position of the source address field. + + + + + The byte position of the destination address field. + + + + + The byte length of the IPv6 Header + + + + + IPv6 packet + References + ---------- + http://tools.ietf.org/html/rfc2460 + http://en.wikipedia.org/wiki/IPv6 + + + + + Create an IPv6 packet from values + + + A + + A + + + + Constructor + + + A + + + + Minimum number of bytes in an IPv6 header + + + + + The version of the IP protocol. The '6' in IPv6 indicates the version of the protocol + + + + + The version field of the IPv6 Packet. + + + + + The traffic class field of the IPv6 Packet. + + + + + The flow label field of the IPv6 Packet. + + + + + The payload lengeth field of the IPv6 Packet + NOTE: Differs from the IPv4 'Total length' field that includes the length of the header as + payload length is ONLY the size of the payload. + + + + + Backwards compatibility property for IPv4.HeaderLength + NOTE: This field is the number of 32bit words + + + + + Backwards compatibility property for IPv4.TotalLength + + + + + Identifies the protocol encapsulated by this packet + Replaces IPv4's 'protocol' field, has compatible values + + + + + The protocol of the packet encapsulated in this ip packet + + + + + The hop limit field of the IPv6 Packet. + NOTE: Replaces the 'time to live' field of IPv4 + 8-bit value + + + + + Helper alias for 'HopLimit' + + + + + The source address field of the IPv6 Packet. + + + + + The destination address field of the IPv6 Packet. + + + + Fetch ascii escape sequence of the color associated with this packet type. + + + + Prepend to the given byte[] origHeader the portion of the IPv6 header used for + generating an tcp checksum + http://en.wikipedia.org/wiki/Transmission_Control_Protocol#TCP_checksum_using_IPv6 + http://tools.ietf.org/html/rfc2460#page-27 + + + A + + A + + + + + + + Generate a random packet + + + A + + + Code constants for ip ports. + + + + Secure shell + + + + + Terminal protocol + + + + + Simple mail transport protocol + + + + + Hyper text transfer protocol + + + + + Same as Http + + + + + Secure ftp + + + + + Network time protocol + + + + + Simple network management protocol + + + + + Computes the one's sum on a byte array. + Based TCP/IP Illustrated Vol. 2(1995) by Gary R. Wright and W. Richard + Stevens. Page 236. And on http://www.cs.utk.edu/~cs594np/unp/checksum.html + + + + + Computes the one's complement sum on a byte array + + + + + Computes the one's complement sum on a byte array + + + + + Compute a ones sum of a byte array + + + A + + A + + + + 16 bit sum of all values + http://en.wikipedia.org/wiki/Signed_number_representations#Ones.27_complement + + + A + + A + + A + + A + + + IP protocol field encoding information. + + + + Length of a TCP port in bytes. + + + Length of the sequence number in bytes. + + + Length of the acknowledgment number in bytes. + + + Length of the data offset and flags field in bytes. + + + The length of the flags field + + + Length of the window size field in bytes. + + + Length of the checksum field in bytes. + + + Length of the urgent field in bytes. + + + Position of the source port field. + + + Position of the destination port field. + + + Position of the sequence number field. + + + Position of the acknowledgment number field. + + + Position of the data offset + + + Position of the flags field + + + Position of the window size field. + + + Position of the checksum field. + + + Position of the urgent pointer field. + + + Length in bytes of a TCP header. + + + IP protocol field encoding information. + + FIXME: These fields are partially broken because they assume the offset for + several fields and the offset is actually based on the accumulated offset + into the structure determined by the fields that indicate sizes + + Type code for ethernet addresses. + + + Type code for MAC addresses. + + + Operation type length in bytes. + + + + The length of the address type fields in bytes, + eg. the length of hardware type or protocol type + + + + + The length of the address length fields in bytes. + + + + Position of the hardware address type. + + + Position of the protocol address type. + + + Position of the hardware address length. + + + Position of the protocol address length. + + + Position of the operation type. + + + Position of the sender hardware address. + + + Position of the sender protocol address. + + + Position of the target hardware address. + + + Position of the target protocol address. + + + Total length in bytes of an ARP header. + + + + An ARP protocol packet. + + + + + Create an ARPPacket from values + + + A + + A + + A + + A + + A + + + + Constructor + + + A + + + + Also known as HardwareType + + + + + Also known as ProtocolType + + + + + Hardware address length field + + + + + Protocol address length field + + + + Fetch the operation code. + Usually one of ARPFields.{ARP_OP_REQ_CODE, ARP_OP_REP_CODE}. + + Sets the operation code. + Usually one of ARPFields.{ARP_OP_REQ_CODE, ARP_OP_REP_CODE}. + + + + + Upper layer protocol address of the sender, arp is used for IPv4, IPv6 uses NDP + + + + + Upper layer protocol address of the target, arp is used for IPv4, IPv6 uses NDP + + + + + Sender hardware address, usually an ethernet mac address + + + + + Target hardware address, usually an ethernet mac address + + + + Fetch ascii escape sequence of the color associated with this packet type. + + + + + + + Returns the encapsulated ARPPacket of the Packet p or null if + there is no encapsulated packet + + + A + + A + + + + ICMP protocol field encoding information. + See http://en.wikipedia.org/wiki/ICMPv6 + + + + Length of the ICMP message type code in bytes. + + + Length of the ICMP subcode in bytes. + + + Length of the ICMP header checksum in bytes. + + + Position of the ICMP message type. + + + Position of the ICMP message subcode. + + + Position of the ICMP header checksum. + + + Length in bytes of an ICMP header. + + + + An ICMP packet. + See http://en.wikipedia.org/wiki/ICMPv6 + + + + + Constructor + + + A + + + + Constructor with parent packet + + + A + + A + + + + Used to prevent a recursive stack overflow + when recalculating in UpdateCalculatedValues() + + + + + The Type value + + + + Fetch the ICMP code + + + + Checksum value + + + + Fetch ascii escape sequence of the color associated with this packet type. + + + + Recalculate the checksum + + + + + + + + Returns the ICMPv6Packet inside of Packet p or null if + there is no encapsulated ICMPv6Packet + + + A + + A + + + Code constants for IGMP message types. + From RFC #2236. + + + + + An IGMP packet. + + + + + Constructor + + + A + + + + Constructor with parent + + + A + + A + + + + The type of IGMP message + + + + Fetch the IGMP max response time. + + + Fetch the IGMP header checksum. + + + Fetch the IGMP group address. + + + Fetch ascii escape sequence of the color associated with this packet type. + + + + Returns the encapsulated IGMPv2Packet of the Packet p or null if + there is no encapsulated packet + + + A + + A + + + + + + + Internet Link layer packet + See http://en.wikipedia.org/wiki/Link_Layer + + + + + Constructor + + + + + Look for the innermost payload. This method is useful because + while some packets are LinuxSSL->IpPacket or + EthernetPacket->IpPacket, there are some packets that are + EthernetPacket->PPPoEPacket->PPPPacket->IpPacket, and for these cases + we really want to get to the IpPacket + + + A + + + IGMP protocol field encoding information. + + + Length of the IGMP message type code in bytes. + + + Length of the IGMP max response code in bytes. + + + Length of the IGMP header checksum in bytes. + + + Length of group address in bytes. + + + Position of the IGMP message type. + + + Position of the IGMP max response code. + + + Position of the IGMP header checksum. + + + Position of the IGMP group address. + + + Length in bytes of an IGMP header. + + + + Represents a Linux cooked capture packet, the kinds of packets + received when capturing on an 'any' device + See http://github.com/mcr/libpcap/blob/master/pcap/sll.h + + + + + Constructor + + + A + + + + Information about the packet direction + + + + + The + + + + + Number of bytes in the link layer address of the sender of the packet + + + + + Link layer header bytes, maximum of 8 bytes + + + + + The encapsulated protocol type + + + + + + + + Lengths and offsets to the fields in the LinuxSLL packet + See http://github.com/mcr/libpcap/blob/master/pcap/sll.h + + + + + Length of the packet type field + + + + + Link layer address type + + + + + Link layer address length + + + + + The link layer address field length + NOTE: the actual link layer address MAY be shorter than this + + + + + Number of bytes in a SLL header + + + + + Length of the ethernet protocol field + + + + + Position of the packet type field + + + + + Position of the link layer address type field + + + + + Positino of the link layer address length field + + + + + Position of the link layer address field + + + + + Position of the ethernet protocol type field + + + + + The types of cooked packets + See http://github.com/mcr/libpcap/blob/master/pcap/sll.h + + + + + Packet was sent to us by somebody else + + + + + Packet was broadcast by somebody else + + + + + Packet was multicast, but not broadcast + + + + + Packet was sent by somebody else to somebody else + + + + + Packet was sent by us + + + + + The protocol encapsulated inside of the IP packet + + + + Dummy protocol for TCP. + + + IPv6 Hop-by-Hop options. + + + Internet Control Message Protocol. + + + Internet Group Management Protocol. + + + IPIP tunnels (older KA9Q tunnels use 94). + + + Transmission Control Protocol. + + + Exterior Gateway Protocol. + + + PUP protocol. + + + User Datagram Protocol. + + + XNS IDP protocol. + + + SO Transport Protocol Class 4. + + + IPv6 header. + + + IPv6 routing header. + + + IPv6 fragmentation header. + + + Reservation Protocol. + + + General Routing Encapsulation. + + + encapsulating security payload. + + + authentication header. + + + ICMPv6. + + + IPv6 no next header. + + + IPv6 destination options. + + + Multicast Transport Protocol. + + + Encapsulation Header. + + + Protocol Independent Multicast. + + + Compression Header Protocol. + + + Raw IP packets. + + + IP protocol mask. + + + Code constants for internet protocol versions. + + + + Internet protocol version 4. + + + Internet protocol version 6. + + + Link-layer type codes. +

+ Taken from libpcap/bpf/net/bpf.h and pcap/net/bpf.h. +

+ The link-layer type is used to determine what data-structure the + IP protocol bits will be encapsulated inside of. +

+ On a 10/100mbps network, packets are encapsulated inside of ethernet. + 14-byte ethernet headers which contain MAC addresses and an ethernet type + field. +

+ On ethernet over ppp, the link-layer type is raw, and packets + are not encapsulated in any ethernet header. +

+
+ + no link-layer encapsulation + + + Ethernet (10Mb) + + + Experimental Ethernet (3Mb) + + + Amateur Radio AX.25 + + + Proteon ProNET Token Ring + + + Chaos + + + IEEE 802 Networks + + + ARCNET + + + Serial Line IP + + + Point-to-point Protocol + + + FDDI + + + LLC/SNAP encapsulated atm + + + raw IP + + + BSD Slip. + + + BSD PPP. + + + IP over ATM. + + + PPP over HDLC. + + + Cisco HDLC. + + + IEEE 802.11 wireless. + + + OpenBSD loopback. + + + Linux cooked sockets. + + + + Header for 802.11 plus a number of bits of link-layer information + including radio information, used by some recent BSD drivers as + well as the madwifi Atheros driver for Linux. + + + + + Per Packet Information encapsulated packets. + DLT_ requested by Gianluca Varenni <gianluca.varenni@cacetech.com>. + See http://www.cacetech.com/documents/PPI%20Header%20format%201.0.7.pdf + + + + + Helper class that prints out an array of hex values + + + + + Create a string that contains the hex values of byte[] Byte in + text form + + + A + + A + + A + + A + + + + Creates a string from a Physical address in the format "xx:xx:xx:xx:xx:xx" + + + A + + A + + + + Random utility methods + + + + + Generate a random ip address + + + A + + A + + + + + Differentiates between a packet class payload, a byte[] payload + or no payload + + + + + ICMPv6 types, see http://en.wikipedia.org/wiki/ICMPv6 and + http://www.iana.org/assignments/icmpv6-parameters + + + + + The possible ARP operation values + + + References: + - http://www.networksorcery.com/enp/default1101.htm + + + + Request + See RFC 826, RFC 5227 + + + Response + See RFC 826, RFC 1868, RFC 5227 + + + Request Reverse + See RFC 903 + + + Reply Reverse + See RFC 903 + + + DRARP Request + See RFC 1931 + + + DRARP Reply + See RFC 1931 + + + DRARP Error + See RFC 1931 + + + InARP Request + See RFC 1293 + + + InARP Reply + See RFC 1293 + + + ARP NAK + See RFC 1577 + + + MARS Request + + + MARS Multi + + + MARS MServ + + + MARS Join + + + MARS Leave + + + MARS NAK + + + MARS Unserv + + + MARS SJoin + + + MARS SLeave + + + MARS Grouplist Request + + + MARS Grouplist Reply + + + MARS Redirect Map + + + MARS UNARP + See RFC 2176 + + + OP_EXP1 + See RFC 5494 + + + OP_EXP2 + + + + Point to Point Protocol + See http://tools.ietf.org/html/rfc2516 + + + + + Construct a new PPPoEPacket from source and destination mac addresses + + + + + Constructor + + + A + + + + PPPoe version, must be 0x1 according to RFC + + FIXME: This currently outputs the wrong version number + + + Type, must be 0x1 according to RFC + + + + + + FIXME: This currently outputs the wrong code + + + Session identifier for this PPPoe packet + + + + + Length of the PPPoe payload, not including the PPPoe header + + + + Fetch ascii escape sequence of the color associated with this packet type. + + + + + + + Returns the encapsulated PPPoE of the Packet p or null if + there is no encapsulated packet + + + A + + A + + + + Generate a random PPPoEPacket + + + A + + + + Point to Point Protocol + See http://tools.ietf.org/html/rfc2516 + + + + Size in bytes of the version/type field + + + Size in bytes of the code field + + + Size in bytes of the SessionId field + + + Size in bytes of the Length field + + + Offset from the start of the header to the version/type field + + + Offset from the start of the header to the Code field + + + Offset from the start of the header to the SessionId field + + + Offset from the start of the header to the Length field + + + + Length of the overall PPPoe header + + + + + Values for the Code field of a PPPoE packet + See http://tools.ietf.org/html/rfc2516 + + + + + The PPPoe payload must contain a PPP packet + + + + + Active Discovery Offer (PADO) packet + + + + + From RFC2516: + The Host sends the PADI packet with the DESTINATION_ADDR set to the + broadcast address. The CODE field is set to 0x09 and the SESSION_ID + MUST be set to 0x0000. + The PADI packet MUST contain exactly one TAG of TAG_TYPE Service- + Name, indicating the service the Host is requesting, and any number + of other TAG types. An entire PADI packet (including the PPPoE + header) MUST NOT exceed 1484 octets so as to leave sufficient room + for a relay agent to add a Relay-Session-Id TAG. + + + + + Indicate that the PPPoe session specified by the SessionId field of + the PPPoe packet has been terminated + + + + + PPP packet + See http://en.wikipedia.org/wiki/Point-to-Point_Protocol + + + + + Construct a new PPPPacket from source and destination mac addresses + + + + + Constructor + + + A + + + + See http://www.iana.org/assignments/ppp-numbers + + + + Fetch ascii escape sequence of the color associated with this packet type. + + + + + + + Returns the encapsulated PPPPacket of the Packet p or null if + there is no encapsulated packet + + + A + + A + + + + Generate a random PPPoEPacket + + + A + + + + The fields in a PPP packet + See http://en.wikipedia.org/wiki/Point-to-Point_Protocol + + + + + Length of the Protocol field in bytes, the field is of type + PPPProtocol + + + + + Offset from the start of the PPP packet where the Protocol field is located + + + + + The length of the header + + + + + Indicates the protocol encapsulated by the PPP packet + See http://www.iana.org/assignments/ppp-numbers + + + + Padding + + + IPv4 + + + IPv6 + + + + Code constants for ICMP message types. + From http://en.wikipedia.org/wiki/Internet_Control_Message_Protocol#List_of_permitted_control_messages_.28incomplete_list.29 + Note that these values represent the combined + type and code fields, where the type field is the upper byte + + + + + ICMP protocol field encoding information. + See http://en.wikipedia.org/wiki/ICMPv6 + + + + Length of the ICMP message type code in bytes. + + + Length of the ICMP header checksum in bytes. + + + Length of the ICMP ID field in bytes. + + + Length of the ICMP Sequence field in bytes + + + Position of the ICMP message type/code. + + + Position of the ICMP header checksum. + + + Position of the ICMP ID field + + + Position of the Sequence field + + + Length in bytes of an ICMP header. + + + + An ICMP packet + See http://en.wikipedia.org/wiki/Internet_Control_Message_Protocol + + + + + Constructor + + + A + + + + Construct with parent packet + + + A + + A + + + + The Type/Code enum value + + + + + Checksum value + + + + + ID field + + + + + Sequence field + + + + + Contents of the ICMP packet + + + + Fetch ascii escape sequence of the color associated with this packet type. + + + + + + + Returns the ICMPv4Packet inside of Packet p or null if + there is no encapsulated ICMPv4Packet + + + A + + A + + + + Container class that refers to a segment of bytes in a byte[] + Used to ensure high performance by allowing memory copies to + be avoided + + + + + Constructor + + + A + + + + Constructor from a byte array, offset into the byte array and + a length beyond that offset of the bytes this class is referencing + + + A + + A + + A + + + + Constructor + + + A + + A + + A + + A + + + + Copy constructor + + + A + + + + The byte[] array + + + + + The maximum number of bytes we should treat Bytes as having, allows + for controling the number of bytes produced by EncapsulatedBytes() + + + + + Number of bytes beyond the offset into Bytes + + + + + Offset into Bytes + + + + + Return true if we need to perform a copy to get + the bytes represented by this class + + + A + + + + Returns a contiguous byte[] from this container, if necessary, by copying + the bytes from the current offset into a newly allocated byte[]. + NeedsCopyForActualBytes can be used to determine if the copy is necessary + + + A + + + + Helper method that returns the segment immediately following + this instance, useful for processing where the parent + wants to pass the next segment to a sub class for processing + + + A + + + + Create the segment after the current one + + + A that can be used to limit the segment length + of the ByteArraySegment that is to be returned. Often used to exclude trailing bytes. + + + A + + + + Format the class information as a string + + + A + + + + Encapsulates and ensures that we have either a Packet OR + a ByteArraySegment but not both + + + + + Whether or not this container contains a packet, a byte[] or neither + + + + + Appends to the MemoryStream either the byte[] represented by TheByteArray, or + if ThePacket is non-null, the Packet.Bytes will be appended to the memory stream + which will append ThePacket's header and any encapsulated packets it contains + + + A + + + + A LLDP packet. + As specified in IEEE Std 802.1AB + + + See http://en.wikipedia.org/wiki/Link_Layer_Discovery_Protocol for general info + See IETF 802.1AB for the full specification + + + + + Create an empty LLDPPacket + + + + + Constructor + + + A + + + + Contains the TLV's in the LLDPDU + + + + + Allows access of the TlvCollection by index + + The index of the item being set/retrieved in the collection + The requested TLV + + + + The current length of the LLDPDU + + + + + LLDPPacket specific implementation of BytesHighPerformance + Necessary because each TLV in the collection may have a + byte[] that is not shared by other TLVs + NOTE: There is potential for the same performance improvement that + the Packet class uses where we check to see if each TLVs uses the + same byte[] and that there are no gaps. + + + + + Enables foreach functionality for this class + + The next item in the list + + + + Parse byte[] into TLVs + + + + + + + A + + A + + A + + A + + + + Returns the LLDP inside of the Packet p or null if + there is no encapsulated packet + + + A + + A + + + + Create a randomized LLDP packet with some basic TLVs + + + A + + + + + + + The TLV Types + + + See IETF RFC 802.1AB for more info + + + + Signifies the end of a LLDPU + + The End Of LLDPDU TLV is a 2-octet, all-zero + TLV that is used to mark the end of the TLV + sequence in LLDPDUs + + Source: IETF RFC 802.1AB + + + A Chassis Identifier + + A mandatory TLV that identifies the chassis + containing the IEEE 802 LAN station + associated with the transmitting LLDP agent + + Source: IETF RFC 802.1AB + + + A Port Identifier + + A mandatory TLV that identifies the + port component of the MSAP identifier associated + with the transmitting LLDP agent. + + Source: IETF RFC 802.1AB + + + Specifies the Time to Live + + Indicates the number of seconds that the + recipient LLDP agent is to regard the information + associated with this MSAP identifier to be valid + A value of 0 signals that this source is no longer + available and all information associated with it + should be deleted. + + Source: IETF RFC 802.1AB + + + A Description of the Port + + The port description field shall contain an + alpha-numeric string that indicates the port’s + description. + + Source: IETF RFC 802.1AB + + + The System's Assigned Name + + The System Name TLV allows network management + to advertise the system’s assigned name. + + Source: IETF RFC 802.1AB + + + A Description of the System + + The System Description TLV allows network + management to advertise the system’s description + + Source: IETF RFC 802.1AB + + + A bitmap containing the System's capabilities + + The System Capabilities TLV is an optional TLV + that identifies the primary function(s) of the + system and whether or not these primary functions + are enabled. + + Source: IETF RFC 802.1AB + + + The Management Address + + The Management Address TLV identifies an address + associated with the local LLDP agent that may be + used to reach higher layer entities to assist + discovery by network management. + + Source: IETF RFC 802.1AB + + + A vendor-specifid TLV + + This TLV category is provided to allow different + organizations, such as IEEE 802.1, IEEE 802.3, IETF, + as well as individual software and equipment vendors, + to define TLVs that advertise information to remote + entities attached to the same media. + + Source: IETF RFC 802.1AB + + + + The Chassis ID TLV subtypes + + + + A Chassis Component identifier + See IETF RFC 2737 + + + An Interface Alias identifier + See IETF RFC 2863 + + + A Port Component identifier + See IETF RFC 2737 + + + A MAC (Media Access Control) Address identifier + See IEEE Std 802 + + + A Network Address (IP Address) Identifier + See IEEE Std 802 + + + An Interface Name identifier + See IEEE Std 802 + + + A Locally Assigned identifier + + + + The Port ID TLV subtypes + + + + An Interface Alias identifier + See IETF RFC 2863 + + + A Port Component identifier + See IETF RFC 2737 + + + A MAC (Media Access Control) Address identifier + See IEEE Std 802 + + + A Network Address (IP Address) Identifier + See IEEE Std 802 + + + An Interface Name identifier + See IEEE Std 802 + + + An Agent Circiut ID identifier + See IETF RFC 3046 + + + A Locally Assigned identifier + See IETF RFC 3046 + + + + The System Capabilities options + + + + + An Other Type of System + + + + A Repeater + See IETF RFC 2108 + + + A Bridge + IETF RFC 2674 + + + A WLAN Access Point + IEEE 802.11 MIB + + + A Router + IETF RFC 1812 + + + A Telephone + IETF RFC 2011 + + + A DOCSIS Cable Device + + See IETF RFC 2669 + See IETF RFC 2670 + + + + A Station with no other capabilities + IETF RFC 2011 + + + + A Type-Length-Value object + + + + + Create a tlv + + + + + Creates a TLV + + + Bytes that comprise the TLV + + + The TLVs offset from the start of byte[] bytes + + + + + Points to the TLV data + + + + + Interface to this TLVs type and length + + + + + Length of value portion of the TLV + NOTE: Does not include the length of the Type and Length fields + + + + + Total length of the TLV, including the length of the Type and Length fields + + + + + Tlv type + + + + + Offset to the value bytes of the TLV + + + + + Return a byte[] that contains the tlv + + + + + Points to the TLV data + + + + + A Network Address + + + + + Creates a Network Address entity + + + The Network Address + + + + + Create a network address from byte data + + + A + + A + + A + + + + Length of AddressFamily field in bytes + + + + + Number of bytes in the NetworkAddress + + + + The format of the Network Address + + + The Network Address + + + + Equals override + + + A + + A + + + + GetHashCode() override + + + A + + + + ToString() override + + + A + + + + Interface Numbering Types + + Source IETF RFC 802.1AB + + + Unknown + + + Interface Index + + + System Port Number + + + + An End Of LLDPDU TLV + + + + + Parses bytes into an End Of LLDPDU TLV + + + TLV bytes + + + The End Of LLDPDU TLV's offset from the + origin of the LLDP + + + + + Creates an End Of LLDPDU TLV + + + + + Convert this TTL TLV to a string. + + + A human readable string + + + + + A Chassis ID TLV + + + + + Creates a Chassis ID TLV by parsing a byte[] + + + + + The Chassis ID TLV's offset from the + origin of the LLDP + + + + + Creates a Chassis ID TLV and sets it value + + + The ChassisID subtype + + + The subtype's value + + + + + Create a ChassisID given a mac address + + + A + + + + Create a ChassisID given an interface name + http://tools.ietf.org/search/rfc2863 page 38 + + + A + + + + Length of the sub type field in bytes + + + + + The type of the TLV subtype + + + + + The TLV subtype value + + + + + If SubType is ChassisComponent + + + + + If SubType is InterfaceName the interface name + + + + + If SubType is MACAddress the mac address + + + + + If SubType is NetworkAddress the network address + + + + + If SubType is PortComponent + + + + + If SubType is InterfaceAlias + + + + + Helper method to reduce duplication in type specific constructors + + + + + Convert this Chassis ID TLV to a string. + + + A human readable string + + + + + A Port ID TLV + + + + + Creates a Port ID TLV + + + + + The Port ID TLV's offset from the + origin of the LLDP + + + + + Creates a Port ID TLV and sets it value + + + The Port ID SubType + + + The subtype's value + + + + + Construct a PortID from a NetworkAddress + + + A + + + + The type of the TLV subtype + + + + + The TLV subtype value + + + + + Offset to the value field + + + + + Size of the value field + + + + + Helper method to reduce duplication in type specific constructors + + + + + Convert this Port ID TLV to a string. + + + A human readable string + + + + + A Time to Live TLV + + + + + Creates a TTL TLV + + + + + The TTL TLV's offset from the + origin of the LLDP + + + + + Creates a TTL TLV and sets it value + + + The length in seconds until the LLDP + is refreshed + + + + + Number of bytes in the value portion of this tlv + + + + + The number of seconds until the LLDP needs + to be refreshed + A value of 0 means that the LLDP source is + closed and should no longer be refreshed + + + + + Convert this TTL TLV to a string. + + + A human readable string + + + + + A Port Description TLV + + + + + Creates a Port Description TLV + + + + + The Port Description TLV's offset from the + origin of the LLDP + + + + + Creates a Port Description TLV and sets it value + + + A textual description of the port + + + + + A textual Description of the port + + + + + A System Name TLV + + + + + Creates a System Name TLV + + + + + The System Name TLV's offset from the + origin of the LLDP + + + + + Creates a System Name TLV and sets it value + + + A textual Name of the system + + + + + A textual Name of the system + + + + + A System Description TLV + + + + + Creates a System Description TLV + + + + + The System Description TLV's offset from the + origin of the LLDP + + + + + Creates a System Description TLV and sets it value + + + A textual Description of the system + + + + + A textual Description of the system + + + + + A System Capabilities TLV + [TLVTypeLength - 2 bytes][System Capabilities - 2 bytes][Enabled Capabilities - 2 bytes] + + + + + Creates a System Capabilities TLV + + + + + The System Capabilities TLV's offset from the + origin of the LLDP + + + + + Creates a System Capabilities TLV and sets the value + + + A bitmap containing the available System Capabilities + + + A bitmap containing the enabled System Capabilities + + + + + A bitmap containing the available System Capabilities + + + + + A bitmap containing the Enabled System Capabilities + + + + + Checks whether the system is capable of a certain function + + + The capability being checked + + + Whether or not the system is capable of the function being tested + + + + + Checks whether the specified function has been enabled on the system + + + The capability being checked + + + Whether or not the specified function is enabled + + + + + Convert this System Capabilities TLV to a string. + + + A human readable string + + + + + A Time to Live TLV + [TLV Type Length : 2][Mgmt Addr length : 1][Mgmt Addr Subtype : 1][Mgmt Addr : 1-31] + [Interface Subtype : 1][Interface number : 4][OID length : 1][OID : 0-128] + + + + + Creates a Management Address TLV + + + The LLDP Data unit being modified + + + The Management Address TLV's offset from the + origin of the LLDP + + + + + Creates a Management Address TLV and sets it value + + + The Management Address + + + The Interface Numbering Sub Type + + + The Interface Number + + + The Object Identifier + + + + + Number of bytes in the AddressLength field + + + + + Number of bytes in the interface number subtype field + + + + + Number of bytes in the interface number field + + + + + Number of bytes in the object identifier length field + + + + + Maximum number of bytes in the object identifier field + + + + + The Management Address Length + + + + + The Management Address Subtype + Forward to the MgmtAddress instance + + + + + The Management Address + + + + + Interface Number Sub Type + + + + + Interface Number + + + + + Object ID Length + + + + + Object ID + + + + + Convert this Management Address TLV to a string. + + + A human readable string + + + + + An Organization Specific TLV + [TLV Type Length : 2][Organizationally Unique Identifier OUI : 3] + [Organizationally Defined Subtype : 1][Organizationally Defined Information String : 0 - 507] + + + + + Creates an Organization Specific TLV + + + The LLDP Data unit being modified + + + The Organization Specific TLV's offset from the + origin of the LLDP + + + + + Creates an Organization Specific TLV and sets it value + + + An Organizationally Unique Identifier + + + An Organizationally Defined SubType + + + An Organizationally Defined Information String + + + + + An Organizationally Unique Identifier + + + + + An Organizationally Defined SubType + + + + + An Organizationally Defined Information String + + + + + Convert this Organization Specific TLV to a string. + + + A human readable string + + + + + Tlv type and length are 2 bytes + See http://en.wikipedia.org/wiki/Link_Layer_Discovery_Protocol#Frame_structure + + + + + Construct a TLVTypeLength for a TLV + + + A + + + + Length in bytes of the tlv type and length fields + + + + + The TLV Value's Type + + + + + The TLV Value's Length + NOTE: Value is the length of the TLV Value only, does not include the length + of the type and length fields + + + + + A unsigned short representing the concatenated Type and Length + + + + + The IANA (Internet Assigned Numbers Authority) Address Family + + Source http://www.iana.org/assignments/address-family-numbers/ + + + IP version 4 + + + IP version 6 + + + NSAP + + + HDLC + + + BBN 1822 + + + 802 (includes all 802 media plus Ethernet "canonical format") + + + E.163 + + + + Base class for several TLV types that all contain strings + + + + + Creates a String TLV + + + + + The Port Description TLV's offset from the + origin of the LLDP + + + + + Create from a type and string value + + + A + + A + + + + A textual Description of the port + + + + + Convert this Port Description TLV to a string. + + + A human readable string + + + + + Custom collection for TLV types + Special behavior includes: + - Preventing an EndOfLLDPDU tlv from being added out of place + - Checking and throwing exceptions if one-per-LLDP packet TLVs are added multiple times + + + + + Override to: + - Prevent duplicate end tlvs from being added + - Ensure that an end tlv is present + - Replace any automatically added end tlvs with the user provided tlv + + + A + + A + + + + Wake-On-Lan + See: http://en.wikipedia.org/wiki/Wake-on-LAN + See: http://wiki.wireshark.org/WakeOnLAN + + + + + Create a Wake-On-LAN packet from the destination MAC address + + + A + + + + Constructor + + + A + + + + The Physical Address (MAC) of the host being woken up from sleep + + + + + Returns the embedded Wake-On-LAN packet + or null if there is none + + + A Wake-On-LAN packet + + + + + Generate a random WakeOnLanPacket + + + A + + + + Checks the validity of the Wake-On-LAN payload + - by checking the synchronization sequence + - by checking to see if there are 16 iterations of the Destination MAC address + + + True if the Wake-On-LAN payload is valid + + + + + See IsValid + + + A + + A + + + + Compare two instances + + + A + + A + + + + GetHashCode override + + + A + + + + + + + The available types of strings that the ToString(StringOutputType) can handle. + + + + + Outputs the packet info on a single line + + + + + Outputs the packet info on a single line with coloring + + + + + Outputs the detailed packet info + + + + + Outputs the detailed packet info with coloring + + + + + No Operation Option + Used in the TCP Options field to pad the length to the next 32 byte boundary + + + References: + http://datatracker.ietf.org/doc/rfc793/ + + + + + Creates a No Operation Option + + + A + + A + + A + + + + The length (in bytes) of the NoOperation option + + + + + The length of the NoOperation field + Returns 1 as opposed to returning the length field because + the NoOperation option is only 1 byte long and doesn't + contain a length field + + + + + End-of-Options Option + Marks the end of the Options list + + + References: + http://datatracker.ietf.org/doc/rfc793/ + + + + + Creates an End Of Options Option + + + A + + A + + A + + + + The length (in bytes) of the EndOfOptions option + + + + + The length of the EndOfOptions field + Returns 1 as opposed to returning the length field because + the EndOfOptions option is only 1 byte long and doesn't + contain a length field + + + + + Maximum Segment Size Option + An extension to the DataOffset/HeaderLength field to + allow sizes greater than 65,535 + + + References: + http://datatracker.ietf.org/doc/rfc793/ + + + + + Creates a Maximum Segment Size Option + + + A + + A + + A + + + + The Maximum Segment Size + + + + + Returns the Option info as a string + + + A + + + + A TCP Option + + + + + Creates an Option from a byte[] + + + A + + A + + A + + + The length (in bytes) of the Kind field + + + The length (in bytes) of the Length field + + + The offset (in bytes) of the Kind Field + + + The offset (in bytes) of the Length field + + + + The Length of the Option type + + + + + The Kind of option + + + + + Returns a TLV that contains the Option + + + + + Returns the Option info as a string + + + A + + + + Window Scale Factor Option + Expands the definition of the TCP window to 32 bits + + + References: + http://datatracker.ietf.org/doc/rfc1323/ + + + + + Creates a Window Scale Factor Option + + + A + + A + + A + + + + The Window Scale Factor + used as a multiplier to the window value + The multiplier is equal to 1 left-shifted by the ScaleFactor + So a scale factor of 7 would equal 1 << 7 = 128 + + + + + Returns the Option info as a string + The multiplier is equal to a value of 1 left-shifted by the scale factor + + + A + + + + The different types fields that could be found in the Options field + + + References: + http://en.wikipedia.org/wiki/Transmission_Control_Protocol#TCP_Timestamps + http://www.networksorcery.com/enp/default1101.htm + + + + End Of List + See RFC 793 + + + No Operation + See RFC 793 + + + Maximum Segment Size + See RFC 793 + + + Window Scale Factor + See RFC 1323 + + + SACK (Selective Ack) Permitted + See RFC 2018 + + + SACK (Selective Ack) + See RFC 2018 and RFC 2883 + + + Echo (obsolete) + See RFC 1072 + + + Echo Reply (obsolete) + See RFC 1072 + + + Timestamp + See RFC 1323 + + + Partial Order Connection Permitted (experimental) + See RFC 1693 + + + Partial Order Service Profile (experimental) + See RFC 1693 + + + Connection Count (experimental) + See RFC 1644 + + + Connection Count New (experimental) + See RFC 1644 + + + Connection Count Echo (experimental) + See RFC 1644 + + + Alternate Checksum Request + See RFC 1146 + + + Alternate Checksum Data + See RFC 1146 + + + MD5 Signature + See RFC 2385 + + + Quick-Start Response (experimental) + See RFC 4782 + + + User Timeout + See RFC 5482 + + + + SACK (Selective Ack) Permitted Option + Notifies the receiver that SACK is allowed. + Must only be sent in a SYN segment + + + References: + http://datatracker.ietf.org/doc/rfc2018/ + + + + + Creates a Sack Permitted Option + + + A + + A + + A + + + + SACK (Selective Ack) Option + Provides a means for a receiver to notify the sender about + all the segments that have arrived successfully. + Used to cut down on the number of unnecessary re-transmissions. + + + References: + http://datatracker.ietf.org/doc/rfc2018/ + http://datatracker.ietf.org/doc/rfc2883/ + + + + + Creates a SACK (Selective Ack) Option + + + A + + A + + A + + + + Contains an array of SACK (Selective Ack) Blocks + + + + + Returns the Option info as a string + + + A + + + + Echo Reply Option + Marked obsolete in the TCP spec Echo Reply Option has been + replaced by the TSOPT (Timestamp Option) + + + References: + http://datatracker.ietf.org/doc/rfc1072/ + + + + + Creates an Echo Reply Option + + + A + + A + + A + + + + A Time Stamp Option + Used for RTTM (Round Trip Time Measurement) + and PAWS (Protect Against Wrapped Sequences) + Opsoletes the Echo and EchoReply option fields + + + References: + http://datatracker.ietf.org/doc/rfc1323/ + + + + + Creates a Timestamp Option + + + A + + A + + A + + + + The Timestamp value + + + + + The Echo Reply + + + + + Returns the Option info as a string + + + A + + + + An Echo Option + throws an exception because Echo Options + are obsolete as per their spec + + + + + Creates an Echo Option + + + A + + A + + A + + + + AlternateChecksumRequest Option + + + + + Creates an Alternate Checksum Request Option + Used to negotiate an alternative checksum algorithm in a connection + + + A + + A + + A + + References: + http://datatracker.ietf.org/doc/rfc1146/ + + + + + The Checksum + + + + + Returns the Option info as a string + + + A + + + + Specifies the different types of algorithms that the + Alternative Checksum option are allowed to use + + + References: + http://datatracker.ietf.org/doc/rfc1146/ + + + + Standard TCP Checksum Algorithm + + + 8-bit Fletchers Algorighm + + + 16-bit Fletchers Algorithm + + + Redundant Checksum Avoidance + + + + Alternative Checksum Date + Used as an extension to Alternative Checksum Response when the + checksum is longer than the standard 16bit TCP Checksum field + + + References: + http://datatracker.ietf.org/doc/rfc1146/ + + + + + Creates an Alternate Checksum Data Option + + + A + + A + + A + + + + The array of attached Checksum + + + + + Returns the Option info as a string + + + A + + + + MD5 Signature + Carries the MD5 Digest used by the BGP protocol to + ensure security between two endpoints + + + References: + http://datatracker.ietf.org/doc/rfc2385/ + + + + + Creates a MD5 Signature Option + + + A + + A + + A + + + + The MD5 Digest + + + + + Returns the Option info as a string + + + A + + + + User Timeout Option + The TCP user timeout controls how long transmitted data may remain + unacknowledged before a connection is forcefully closed + + + References: + http://datatracker.ietf.org/doc/rfc5482/ + + + + + Creates a User Timeout Option + + + A + + A + + A + + + + The Granularity + + + + + The User Timeout + + + + + Returns the Option info as a string + + + A + + + diff --git a/dep/sharppcap/SharpPcap.License b/dep/sharppcap/SharpPcap.License new file mode 100644 index 00000000..3462706c --- /dev/null +++ b/dep/sharppcap/SharpPcap.License @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser 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 +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. \ No newline at end of file diff --git a/dep/sharppcap/SharpPcap.dll b/dep/sharppcap/SharpPcap.dll new file mode 100644 index 00000000..b60f3771 Binary files /dev/null and b/dep/sharppcap/SharpPcap.dll differ diff --git a/dep/sharppcap/SharpPcap.dll.config b/dep/sharppcap/SharpPcap.dll.config new file mode 100644 index 00000000..312c542a --- /dev/null +++ b/dep/sharppcap/SharpPcap.dll.config @@ -0,0 +1,8 @@ + + + + diff --git a/dep/sharppcap/SharpPcap.xml b/dep/sharppcap/SharpPcap.xml new file mode 100644 index 00000000..bdc65cba --- /dev/null +++ b/dep/sharppcap/SharpPcap.xml @@ -0,0 +1,3812 @@ + + + + /home/cmorgan/sharppcap_git/SharpPcap/bin/Release/SharpPcap + + + + + Adapter bus types + + + + + Usb + + + + + Pci + + + + + PciExpress + + + + + MiniPci + + + + + MiniPciExpress + + + + + Cardbus + + + + + Expresscard + + + + + Types of airpcap adapters + + + + + Class + + + + + Class release 2 + + + + + AirPcap TX + + + + + AirPcap EX + + + + + AirPcap N + + + + + AirPcap Nx + + + + + Frequency bands + + + + 2.4 GHz band + + + 5 GHz band + + + + Channel info + + + + + Channel frequency, in MHz + + + + + 802.11n specific. Offset of the extension channel in case of 40MHz channels. + Possible values are -1, 0 +1: + - -1 means that the extension channel should be below the control channel (e.g. Control = 5 and Extension = 1) + - 0 means that no extension channel should be used (20MHz channels or legacy mode) + - +1 means that the extension channel should be above the control channel (e.g. Control = 1 and Extension = 5) + In case of 802.11a/b/g channels (802.11n legacy mode), this field should be set to 0. + + + + + Channel Flags. The only flag supported at this time is \ref AIRPCAP_CIF_TX_ENABLED. + + + + + ToString() override + + + A + + + + Channel info flags + + + + + No flags set + + + + + Channel info flag: the channel is enabled for transmission, too. + To comply with the electomagnetic emission regulations of the different countries, the AirPcap hardware can be programmed + to block transmission on specific channels. This flag is set by AirpcapGetDeviceSupportedChannels() to indicate that a + channel in the list supports transmission. + + + + + Type of decryption the adapter performs. + An adapter can be instructed to turn decryption (based on the device-configured keys configured + with \ref AirpcapSetDeviceKeys()) on or off. + + + + This adapter performs decryption + + + This adapter does not perform decryption + + + + AirPcap device + + + + + Led states + + + + + Led on + + + + + Led off + + + + + TODO: Get this from packet.net or another place in System.Net.xxx? + + + + + Handle to the device + + + + + The last pcap error associated with this pcap device + + + + + Device capabilities, whether the device can transmit, its id, model name etc + + + + + Adapter channel + + + + + Channel information + + + + + Decryption keys that are currently associated with the specified device + + + + + Global list of decryption keys that AirPcap is using with all the devices. + + + + + Tells if decryption of the incoming frames with the device-specific keys. + + + + + Tells if this open instance is configured to perform the decryption of the incoming frames with the global set of keys. + + + + + Configures the adapter on whether to include the MAC Frame Check Sequence in the captured packets. + + + + + The kinds of frames that the device will capture + By default all frames are captured + + + + + Kernel packet buffer size for this adapter in bytes + + + + + Number of leds on this adapter + + + + + Link type + + + + + Link type in terms of PacketDotNet.LinkLayers + + + + + Mac address + + + + + Mac flags + + + + + Adapter statistics + + + + + List of supported channels + + + + + Transmit power + + + + + Device timestamp + + + + + See ThrowIfNotOpen(string ExceptionString) + + + + + Retrieve the last error string for a given pcap_t* device + + + A + + A + + + + Open a device + + + + + Open the device. To start capturing call the 'StartCapture' function + + + A + + + + Open the device. To start capturing call the 'StartCapture' function + + + A + + A + + + + Opens an Airpcap device with optional WinPcap.OpenFlags + + + A + + A + + + + Close a device + + + + + Size in bytes of a key collection with a given count of keys + + + + + + + + + Convert a AirpcapKeysCollection unmanaged buffer to a list of managed keys + + + + + + + + + Convert an array of keys into unmanaged memory + + + + + + + + + Constructor + + + A + + A + + + + AirPcap specific capture thread + + + + + Marshal a chunk of captured packets into a packet list + + + + + + + + + + + Capabilities for the adapter + + + + + An id that identifies the adapter model + + + + + String containing a printable adapter model + + + + + The type of bus the adapter is plugged to + + + + + An OR combination of the media that the device supports. Possible values are: \ref AIRPCAP_MEDIUM_802_11_A, + \ref AIRPCAP_MEDIUM_802_11_B, \ref AIRPCAP_MEDIUM_802_11_G or \ref AIRPCAP_MEDIUM_802_11_N. + Not supported at the moment. + + + + + An OR combination of the bands that the device supports. Can be one of: \ref AIRPCAP_BAND_2GHZ, + \ref AIRPCAP_BAND_5GHZ. + + + + + TRUE if the adapter is able to perform frame injection. + + + + + TRUE if the adapter's transmit power is can be specified by the user application. + + + + + TRUE if the adapter supports plugging one or more external antennas. + + + + + ToString() overload + + + A + + + + Adapter description + + + + + Device name + + + + + Device description + + + + + ToString() override + + + A + + + + AirPcap device list + + + + + Represents a strongly typed, read-only list of PcapDevices. + + + + The name or description of the pcap interface to get. + + + + Method to retrieve this classes singleton instance + + + + + Caution: Use the singlton instance unless you know why you need to call this. + One use is for multiple filters on the same physical device. To apply multiple + filters open the same physical device multiple times, one for each + filter by calling this routine and picking the same device out of each list. + + + A + + + + Retrieve an array of AirPcapDevices + + + + + + + Refresh the device list + + + + + + Defines the internal AirPcap device timestamp + + + + Current value of the device counter, in microseconds. + + + Value of the software counter used to timestamp packets before reading the device counter, in microseconds. + + + Value of the software counter used to timestamp packets after reading the device counter, in microseconds. + + + + ToString() override + + + A + + + + WEB key container + + + + + Constructor + + + + + + + + + Number of bytes in a wep key + + + + + Type of key, can be on of: \ref AIRPCAP_KEYTYPE_WEP, \ref AIRPCAP_KEYTYPE_TKIP, \ref AIRPCAP_KEYTYPE_CCMP. Only AIRPCAP_KEYTYPE_WEP is supported by the driver at the moment. + + + + + Key data + + + + + + + A + + + + Type of keys in the adapter + + + + + Key type: WEP. The key can have an arbitrary length smaller than 32 bytes. + + + + + Key type: TKIP (WPA). NOT SUPPORTED YET by AirPcap + + + + + Key type: CCMP (WPA2). NOT SUPPORTED YET by AirPcap + + + + + Mac flags + + + + + If set, the device is configured to work in monitor mode. + When monitor mode is on, the device captures all the frames transmitted on the channel. This includes: + - unicast packets + - multicast packets + - broadcast packets + - control and management packets + When monitor mode is off, the device has a filter on unicast packets to capture only the packets whose MAC + destination address equals the device's address. This means the following frames will be received: + - unicast packets whose destination is the address of the device + - multicast packets + - broadcast packets + - beacons and probe requests + + + + + If set, the device will acknowledge the data frames sent to its address. This is useful when the device needs to interact with other devices on the + 802.11 network, bacause handling the ACKs in software is normally too slow. + + + + + Medium type + + + + 802.11a medium + + + 802.11b medium + + + 802.11g medium + + + 802.11n medium + + + + Packet header + + + + + Seconds field + + + + + Microseconds field + + + + + Number of bytes captured + + + + + On-line packet size in bytes + + + + + Header length in bytes + + + + + ToString() override + + + A + + + + Per http://msdn.microsoft.com/en-us/ms182161.aspx + + + + + Sets variables to the particular version being used + + Pointer to a variable that will be filled with the major version number + Pointer to a variable that will be filled with the minor version number + Pointer to a variable that will be filled with the revision number + Pointer to a variable that will be filled with the build number + + + + Returns the last error related to the specified handle + + Handle to an open adapter + String with the last error, a PCHAR + + + + Returns the list of available devices + + Address to a caller allocated pointer. On success this pointer will receive the head of a list of available devices. + String that will contain error information if FALSE is returned. The size of the string must be AIRPCAP_ERRBUF_SIZE bytes. + TRUE on success. FALSE is returned on failure, in which case Ebuf is filled in with an appropriate error message. + + + + Frees a list of devices returned by AirpcapGetDeviceList() + + Head of the list of devices returned by AirpcapGetDeviceList() + + + + + + Opens an adapter + + Name of the device to open. Use AirpcapGetDeviceList() to get the list of devices. + String that will contain error information in case of failure. The size of the string must be AIRPCAP_ERRBUF_SIZE bytes. + A PAirpcapHandle handle on success. NULL is returned on failure, in which case Ebuf is filled in with an appropriate error message. + + + + Closes an adapter + + Handle to the adapter to close. + + + + Get the capabilities of a device + NOTE: The PCapabilities structure returned by AirpcapGetDeviceCapabilities() must be considered invalid + after the adapter has been closed. + + Handle to the adapter + Pointer to a library-allocated AirpcapDeviceCapabilities structure that contains + the capabilities of the adapter + True on success + + + + Sets the device's monitor mode and acknowledgment settings. + When an adapter is plugged into the system, it's always configured with monitor mode ON and acknowledgment settings OFF. + These values are not stored persistently, so if you want to turn monitor mode off, you will need to do it + every time you attach the adapter. + \note currently, the AirPcap adapter supports frames acknowleging when the adapter is NOT in monitor mode. This means that + the combinations in which the two flags have the same value will cause AirpcapSetDeviceMacFlags() to fail. + + Handle to the adapter + Flags word, that contains a bitwise-OR combination of the following flags: \ref AIRPCAP_MF_MONITOR_MODE_ON and \ref AIRPCAP_MF_ACK_FRAMES_ON . + TRUE on success + + + + Gets the device's monitor mode and acknowledgement settings + When an adapter is plugged into the system, it's always configured with monitor mode ON and acknowledgment settings OFF. + These values are not stored persistently, so if you want to turn monitor mode off, you will need to do it + every time you attach the adapter. + + Handle to the adapter + User-provided flags word, that will be filled by the function with an OR combination of the + following flags: \ref AIRPCAP_MF_MONITOR_MODE_ON and \ref AIRPCAP_MF_ACK_FRAMES_ON. + TRUE on success + + + + Sets the link type of an adapter + the "link type" determines how the driver will encode the packets captured from the network. + Aircap supports two link types: + - \ref AIRPCAP_LT_802_11, to capture 802.11 frames (including control frames) without any + power information. Look at the "Capture_no_radio" example application in the developer's pack + for a reference on how to decode 802.11 frames with this link type. + - \ref AIRPCAP_LT_802_11_PLUS_RADIO, to capture 802.11 frames (including control frames) with a radiotap header + that contains power and channel information. More information about the radiotap header can be found in the + \ref radiotap section. Moreover, the "Capture_radio" example application in + the developer's pack can be used as a reference on how to decode 802.11 frames with radiotap headers. + - \ref AIRPCAP_LT_802_11_PLUS_PPI, to capture 802.11 frames (including control frames) with a Per Packet Information (PPI) + header that contains per-packet meta information like channel and power information. More details on the PPI header can + be found in the PPI online documentation (TODO). + + + + the "link type", i.e. the format of the frames that will be received from the adapter. + TRUE on success + + + + Gets the link type of the specified adapter + the "link type" determines how the driver will encode the packets captured from the network. + Aircap supports two link types: + - \ref AIRPCAP_LT_802_11, to capture 802.11 frames (including control frames) without any + power information. Look at the "Capture_no_radio" example application in the developer's pack + for a reference on how to decode 802.11 frames with this link type. + - \ref AIRPCAP_LT_802_11_PLUS_RADIO, to capture 802.11 frames (including control frames) with a radiotap header + that contains power and channel information. More information about the radiotap header can be found int the + \ref radiotap section. Moreover, the "Capture_radio" example application in + the developer's pack can be used as a reference on how to decode 802.11 frames with radiotap headers. + - \ref AIRPCAP_LT_802_11_PLUS_PPI, to capture 802.11 frames (including control frames) with a Per Packet Information (PPI) + header that contains per-packet meta information like channel and power information. More details on the PPI header can + be found in the PPI online documentation (TODO). + + Handle to the adapter + Pointer to a caller allocated AirpcapLinkType variable that will contain + the link type of the adapter + TRUE on success + + + + Configures the adapter on whether to include the MAC Frame Check Sequence in the captured packets. + In the default configuration, the adapter includes the FCS in the captured packets. The MAC Frame Check Sequence + is 4 bytes and is located at the end of the 802.11 packet, with \ref AIRPCAP_LT_802_11, \ref AIRPCAP_LT_802_11_PLUS_RADIO and + \ref AIRPCAP_LT_802_11_PLUS_PPI link types. + When the FCS inclusion is turned on, and if the link type is \ref AIRPCAP_LT_802_11_PLUS_RADIO, the radiotap header + that precedes each frame has two additional fields at the end: Padding and FCS. These two fields are not present + when FCS inclusion is off. + + Handle to the adapter + TRUE if the packets should include the FCS, FALSE otherwise + TRUE on success + + + + PIsFcsPresent is tue if the specified adapter includes the MAC Frame Check Sequence in the captured packets + In the default configuration, the adapter includes the FCS in the captured packets. The MAC Frame Check Sequence + is 4 bytes and is located at the end of the 802.11 packet, with \ref AIRPCAP_LT_802_11, \ref AIRPCAP_LT_802_11_PLUS_RADIO and + \ref AIRPCAP_LT_802_11_PLUS_PPI link types. + When the FCS inclusion is turned on, and if the link type is \ref AIRPCAP_LT_802_11_PLUS_RADIO, the radiotap header + that precedes each frame has two additional fields at the end: Padding and FCS. These two fields are not present + when FCS inclusion is off. + + Handle to the adapter + User-provided variable that will be set to true if the adapter is including the FCS + TRUE if the operation is successful. FALSE otherwise. + + + + Configures the adapter to accept or drop frames with an incorrect Frame Check sequence (FCS) + NOTE: By default the driver is configured in \ref AIRPCAP_VT_ACCEPT_EVERYTHING mode + + Handle to the adapter + The type of validation the driver will perform. See the documentation of \ref AirpcapValidationType for details. + TRUE on success + + + + Checks if the specified adapter is configured to capture frames with incorrect an incorrect Frame Check Sequence (FCS). + \note By default, the driver is configured in \ref AIRPCAP_VT_ACCEPT_EVERYTHING mode. + + Handle to the adapter + Pointer to a user supplied variable that will contain the type of validation the driver will perform. See the documentation of \ref AirpcapValidationType for details. + TRUE if the operation is successful, FALSE otherwise + + + + Sets the list of decryption keys that AirPcap is going to use with the specified device. + AirPcap is able to use a set of decryption keys to decrypt the traffic transmitted on a specific SSID. If one of the + keys corresponds to the one the frame has been encrypted with, the driver will perform decryption and return the cleartext frames + to the application. + This function allows to set the device-specific set of keys. These keys will be used by the specified device only, + and will not be used by other airpcap devices besides the specified one. + At this time, the only supported decryption method is WEP. + The keys are applied to the packets in the same order they appear in the KeysCollection structure until the packet is + correctly decrypted, therefore putting frequently used keys at the beginning of the structure improves performance. + \note When you change the set of keys from an open capture instance, the change will be + immediately reflected on all the other capture instances on the same device. + + Handle to the adapter + Pointer to a \ref PAirpcapKeysCollection structure that contains the keys to be set in the device. + TRUE if the operation is successful. FALSE otherwise. + + + + Returns the list of decryption keys that are currently associated with the specified device + This function returns the device-specific set of keys. These keys are used by the specified device only, + and not by other airpcap devices besides the specified one. + AirPcap is able to use a set of decryption keys to decrypt the traffic transmitted on a specific SSID. If one of the + keys corresponds to the one the frame has been encrypted with, the driver will perform decryption and return the cleartext frames + to the application. + AirPcap supports, for every device, multiple keys at the same time. + The configured decryption keys are device-specific, therefore AirpcapGetDeviceKeys() will return a different set of keys + when called on different devices. + At this time, the only supported decryption method is WEP. + + Handle to an open adapter + User-allocated PAirpcapKeysCollection structure that will be filled with the keys. + - \b IN: pointer to a user-allocated variable that contains the length of the KeysCollection structure, in bytes. + - \b OUT: amount of data moved by AirPcap in the buffer pointed by KeysBuffer, in bytes. + TRUE if the operation is successful. If an error occurs, the return value is FALSE and KeysCollectionSize is zero. + If the provided buffer is too small to contain the keys, the return value is FALSE and KeysCollectionSize contains the + needed KeysCollection length, in bytes. If the device doesn't have any decryption key configured, the return value is TRUE, and + KeysCollectionSize will be zero. + + + + Set the global list of decryption keys that AirPcap is going to use with all the devices. + The AirPcap driver is able to use a set of decryption keys to decrypt the traffic transmitted on a specific SSID. If one of the + keys corresponds to the one the frame has been encrypted with, the driver will perform decryption and return the cleartext frames + to the application. + This function allows to set the global set of keys. These keys will be used by all the devices plugged in + the machine. + At this time, the only supported decryption method is WEP. + The keys are applied to the packets in the same order they appear in the KeysCollection structure until the packet is + correctly decrypted, therefore putting frequently used keys at the beginning of the structure improves performance. + \note When you change the set of keys from an open capture instance, the change will be + immediately reflected on all the other capture instances. + + Handle to an open adapter + Pointer to a \ref PAirpcapKeysCollection structure that contains the keys to be set globally. + TRUE if the operation is successful. FALSE otherwise. + + + + Returns the global list of decryption keys that AirPcap is using with all the devices. + This function returns the global set of keys. These keys will be used by all the devices plugged in + the machine. + The AirPcap driver is able to use a set of decryption keys to decrypt the traffic transmitted on a specific SSID. If one of the + keys corresponds to the one the frame has been encrypted with, the driver will perform decryption and return the cleartext frames + to the application. + At this time, the only supported decryption method is WEP. + + Handle to an adapter + User-allocated PAirpcapKeysCollection structure that will be filled with the keys. + - \b IN: pointer to a user-allocated variable that contains the length of the KeysCollection structure, in bytes. + - \b OUT: amount of data moved by AirPcap in the buffer pointed by KeysBuffer, in bytes. + TRUE if the operation is successful. If an error occurs, the return value is FALSE and KeysCollectionSize is zero. + If the provided buffer is too small to contain the keys, the return value is FALSE and KeysCollectionSize contains the + needed KeysCollection length, in bytes. If no global decryption keys are configured, the return value is TRUE, and + KeysCollectionSize will be zero. + + + + Turns on or off the decryption of the incoming frames with the device-specific keys. + The device-specific decryption keys can be configured with the \ref AirpcapSetDeviceKeys() function. + \note By default, the driver is configured with \ref AIRPCAP_DECRYPTION_ON. + + Handle to the adapter + Either AIRPCAP_DECRYPTION_ON or AIRPCAP_DECRYPTION_OFF + TRUE on success + + + + Tells if this open instance is configured to perform the decryption of the incoming frames with the device-specific keys. + The device-specific decryption keys can be configured with the \ref AirpcapSetDeviceKeys() function. + \note By default, the driver is configured with \ref AIRPCAP_DECRYPTION_ON. + + Handle to the adapter + Pointer to a user supplied variable that will contain the decryption configuration. See \ref PAirpcapDecryptionState for details. + TRUE if the operation is successful, FALSE otherwise + + + + Turns on or off the decryption of the incoming frames with the global set of keys. + The global decryption keys can be configured with the \ref AirpcapSetDriverKeys() function. + \note By default, the driver is configured with \ref AIRPCAP_DECRYPTION_ON. + + Handle to the adapter + Either \ref AIRPCAP_DECRYPTION_ON or \ref AIRPCAP_DECRYPTION_OFF + TRUE on success + + + + Tells if this open instance is configured to perform the decryption of the incoming frames with the global set of keys. + The global decryption keys can be configured with the \ref AirpcapSetDriverKeys() function. + \note By default, the driver is configured with \ref AIRPCAP_DECRYPTION_ON. + + Handle to the adapter + Pointer to a user supplied variable that will contain the decryption configuration. See \ref PAirpcapDecryptionState for details. + TRUE if the operation is successful. FALSE otherwise. + + + + Sets the radio channel of a device + The list of available channels can be retrieved with \ref AirpcapGetDeviceSupportedChannels(). The default channel setting is 6. + \note This is a device-related function: when you change the channel from an open capture instance, the change will be + immediately reflected on all the other capture instances. + + Handle to the adapter + The new channel to set + TRUE on success + + + + Gets the radio channel of a device + The list of available channels can be retrieved with \ref AirpcapGetDeviceSupportedChannels(). The default channel setting is 6. + \note This is a device-related function: when you change the channel from an open capture instance, the change will be + immediately reflected on all the other capture instances. + + Handle to the adapter + Pointer to a user-supplied variable into which the function will copy the currently configured radio channel. + TRUE on success + + + + Sets the channel of a device through its radio frequency. In case of 802.11n enabled devices, it sets the extension channel, if used. + \note This is a device-related function: when you change the channel from an open capture instance, the change will be + immediately reflected on all the other capture instances. + + Handle to the adapter + The new channel information to set + TRUE on success + + + + Gets the channel of a device through its radio frequency. In case of 802.11n enabled devices, it gets the extension channel, if in use. + \note This is a device-related function: when you change the channel from an open capture instance, the change will be + immediately reflected on all the other capture instances. + + Handle to the adapter + Pointer to a user-supplied variable into which the function will copy the currently configured channel information. + TRUE on success + + + + Gets the list of supported channels for a given device. In case of a 802.11n capable device, information related to supported extension channels is also reported. + Every control channel is listed multiple times, one for each different supported extension channel. For example channel 6 (2437MHz) is usually listed three times: + - Frequency 2437 Extension +1. Control channel is 6, extension channel is 10. + - Frequency 2437 Extension 0. Control channel is 6, no extension channel is used (20MHz channel and legacy mode). + - Frequency 2437 Extension -1. Control channel is 6, extension channel is 2. + \note The supported channels are not listed in any specific order. + + Handle to the adapter + Pointer to a user-supplied variable that will point to an array of supported channel. Such list must not be freed by the caller + Number of channels returned in the array + TRUE on success + + + + Converts a frequency to the corresponding channel + + Frequency of the channel in MHz + Pointer to a user-supplied variable that will contain the channel number on success + Pointer to a user-supplied variable that will contain the band (a orb/g) of the given channel + TRUE on success, i.e. the frequency corresponds to a valid a or b/g channel + + + + Converts a given channel to the corresponding frequency + Because of the overlap of channels with respect to 1-14BG and 1-14A, this function will give precidence to BG. + Thus, the channels are returned as follows: + - Channel 0: 5000MHz + - Channels 1-14: 2412MHz - 2484MHz + - Channels 15-239: 5005MHz - 6195MHz + - Channels 240-255: 4920MHz - 4995MHz + + Channel number to be converted + Pointer to a user-supplied variable that will contain the channel frequency in MHz on success> + + + + + + Sets the size of the kernel packet buffer for this adapter + Every AirPcap open instance has an associated kernel buffer, whose default size is 1 Mbyte. + This function can be used to change the size of this buffer, and can be called at any time. + A bigger kernel buffer size decreases the risk of dropping packets during network bursts or when the + application is busy, at the cost of higher kernel memory usage. + \note Don't use this function unless you know what you are doing. Due to caching issues and bigger non-paged + memory consumption, bigger buffer sizes can decrease the capture performace instead of improving it. + + Handle to the adapter + New size in bytes + TRUE on success + + + + Gets the size of the kernel packet buffer for this adapter + Every AirPcap open instance has an associated kernel buffer, whose default size is 1 Mbyte. + This function can be used to get the size of this buffer. + + Handle to the adapter + User-allocated variable that will be filled with the size of the kernel buffer. + TRUE on success + + + + Sets the power of the frames transmitted by adapter + The transmit power value is monotonically increasing with higher power levels. 1 is the minimum allowed transmit power. + \note The maximum transmit power on each channel is limited by FCC regulations. Therefore, the maximum transmit power + changes from channel to channel. When the channel is changed with \ref AirpcapSetDeviceChannel() or + \ref AirpcapSetDeviceChannelEx() the power is set to the maximum allowd value for that channel. You can read this + value with \ref AirpcapGetTxPower(). Not all the AirPcap adapters support setting the transmit power; you can use + \ref AirpcapGetDeviceCapabilities() to find if the current adapter supports this feature. + + Handle to the adapter + The transmit power. Setting a zero power makes the adapter select the + highest possible power for the current channel. + TRUE on success. False on failure or if the adapter doesn't support setting the transmit power. + + + + Returns the current transmit power level of the adapter + The transmit power value is monotonically increasing with higher power levels. 0 is the minimum allowed power. + \note The maximum transmit power on each channel is limited by FCC regulations. Therefore, the maximum transmit power + changes from channel to channel. When the channel is changed with \ref AirpcapSetDeviceChannel() or + \ref AirpcapSetDeviceChannelEx() the power is set to the maximum allowd value for that channel. Not all the AirPcap + adapters support setting the transmit power; you can use \ref AirpcapGetDeviceCapabilities() to find if the current + adapter supports this feature. + + Handle to the adapter + User-allocated variable that will be filled with the size of the transmit power + TRUE on success, false on failure or if the adapter doesn't support getting the transmit power + + + + Saves the configuration of the specified adapter in the registry, so that it becomes the default for this adapter. + Almost all the AirPcap calls that modify the configuration (\ref AirpcapSetLinkType(), \ref AirpcapSetFcsPresence(), + \ref AirpcapSetFcsValidation(), \ref AirpcapSetKernelBuffer(), \ref AirpcapSetMinToCopy()) + affect only the referenced AirPcap open instance. This means that if you do another \ref AirpcapOpen() on the same + adapter, the configuration changes will not be remembered, and the new adapter handle will have default configuration + settings. + Exceptions to this rule are the \ref AirpcapSetDeviceChannel() and \ref AirpcapSetDeviceKeys() functions: a channel change is + reflected on all the open instances, and remembered until the next call to \ref AirpcapSetDeviceChannel(), until the adapter + is unplugged, or until the machine is powered off. Same thing for the configuration of the WEP keys. + AirpcapStoreCurConfigAsAdapterDefault() stores the configuration of the give open instance as the default for the adapter: + all the instances opened in the future will have the same configuration that this adapter currently has. + The configuration is stored in the registry, therefore it is remembered even when the adapter is unplugged or the + machine is turned off. However, an adapter doesn't bring its configuration with it from machine to machine. + the configuration information saved in the registry includes the following parameters: + - channel + - kernel buffer size + - mintocopy + - link type + - CRC presence + - Encryption keys + - Encryption Enabled/Disabled state + The configuration is device-specific. This means that changing the configuration of a device + doesn't modify the one of the other devices that are currently used or that will be used in the future. + \note AirpcapStoreCurConfigAsAdapterDefault() must have exclusive access to the adapter -- it + will fail if more than one AirPcap handle is opened at the same time for this device. + AirpcapStoreCurConfigAsAdapterDefault() needs administrator privileges. It will fail if the calling user + is not a local machine administrator. + + Handle to an adapter + TRUE on success. FALSE on failure. + + + + Sets the BPF kernel filter for an adapter + The AirPcap driver is able to perform kernel-level filtering using the standard BPF pseudo-machine format. You can read + the WinPcap documentation at http://www.winpcap.org/devel.htm for more details on the BPF filtering mechaism. + A filter can be automatically created by using the pcap_compile() function of the WinPcap API. This function + converts a human readable text expression with the tcpdump/libpcap syntax into a BPF program. + If your program doesn't link wpcap, but you need to generate the code for a particular filter, you can run WinDump + with the -d or -dd or -ddd flags to obtain the pseudocode. + + Handle to the adapter + pointer to the first BPF instruction in the array. Corresponds to the bf_insns + in a bpf_program structure (see the WinPcap documentation at http://www.winpcap.org/devel.htm). + \param Len Number of instructions in the array pointed by the previous field. Corresponds to the bf_len in + a a bpf_program structure (see the WinPcap documentation at http://www.winpcap.org/devel.htm). + + + TRUE on success + + + + Returns the MAC address of a device + + Handle to the adapter + Pointer to a user allocated \ref AirpcapMacAddress structure that will receive the MAC address on success. + TRUE on success + + + + Sets the MAC address of a device + Using this function, the programmer can change the MAC address of the device. This is useful when disabling monitor + mode with \ref AirpcapSetDeviceMacFlags(), because the device will acknowledge the data frames sent to its MAC address. + \note The address change is temporary: when the device is unplugged or when the host PC is turned off, the address is reset to the original + value. + + Handle to the adapter + Pointer to a user-initialized structure containing the MAC address + TRUE on success. FALSE on failure, or if the adapter doesn't support changing the address. + + + + Sets the mintocopy parameter for an open adapter + When the number of bytes in the kernel buffer changes from less than mintocopy bytes to greater than or equal to mintocopy bytes, + the read event is signalled (see \ref AirpcapGetReadEvent()). A high value for mintocopy results in poor responsiveness since the + driver may signal the application "long" after the arrival of the packet. And a high value results in low CPU loading + by minimizing the number of user/kernel context switches. + A low MinToCopy results in good responsiveness since the driver will signal the application close to the arrival time of + the packet. This has higher CPU loading over the first approach. + + Handle to the adapter + is the mintocopy size in bytes + TRUE on success + + + + Gets an event that is signalled when packets are available in the kernel buffer (see \ref AirpcapSetMinToCopy()). + \note The event is signalled when at least mintocopy bytes are present in the kernel buffer (see \ref AirpcapSetMinToCopy()). + This event can be used by WaitForSingleObject() and WaitForMultipleObjects() to create blocking behavior when reading + packets from one or more adapters (see \ref AirpcapRead()). + + Handle to the adapter + Pointer to a user-supplied handle in which the read event will be copied. + TRUE on success + + + + Fills a user-provided buffer with zero or more packets that have been captured on the referenced adapter. + 802.11 frames are returned by the driver in buffers. Every 802.11 frame in the buffer is preceded by a \ref AirpcapBpfHeader structure. + The suggested way to use an AirPcap adapter is through the pcap API exported by wpcap.dll. If this is not + possible, the Capture_radio and Capture_no_radio examples in the AirPcap developer's pack show how to properly decode the + packets in the read buffer returned by AirpcapRead(). + \note This function is NOT blocking. Blocking behavior can be obtained using the event returned + by \ref AirpcapGetReadEvent(). See also \ref AirpcapSetMinToCopy(). + + Handle to the adapter + pointer to the buffer that will be filled with captured packets. + size of the input buffer that will contain the packets, in bytes. + Pointer to a user supplied variable that will receive the number of bytes copied by AirpcapRead. + Can be smaller than BufSize. + TRUE on success + + + + Transmits a packet + The packet will be transmitted on the channel the device is currently set. To change the device adapter, use the + \ref AirpcapSetDeviceChannel() function. + If the link type of the adapter is AIRPCAP_LT_802_11, the buffer pointed by TxPacket should contain just the 802.11 + packet, without additional information. The packet will be transmitted at 1Mbps. + If the link type of the adapter is AIRPCAP_LT_802_11_PLUS_RADIO, the buffer pointed by TxPacket should contain a radiotap + header followed by the 802.11 packet. AirpcapWrite will use the rate information in the radiotap header when + transmitting the packet. + If the link type of the adapter is AIRPCAP_LT_802_11_PLUS_PPI, the buffer pointed by TxPacket should contain a PPI header + followed by the 802.11 packet. AirpcapWrite will use the rate information in the PPI header when transmitting the packet. + If the packet should be transmitted at a 802.11n rate, the packet must include a PPI 802.11n MAC+PHY Extension header, containing + the rate expressed in terms of MCS, short/long guard interval (SGI/LGI) and 20MHz or 40MHz channel. When the MAC+PHY Extension header is present, + the rate field in the PPI 802.11-Common header is ignored. + By default on 802.11n-capable AirPcap adapters, packets are transmitted with no A-MPDU aggregation. A-MPDU aggregation is controlled by the + adapter, but it's possible to give a hint to the hardware to aggregate some packets by setting the "Aggregate" and "More aggregates" flags in + the PPI 802.11n MAC+PHY extension header. + + Handle to the adapter + Pointer to a buffer that contains the packet to be transmitted. + Length of the buffer pointed by the TxPacket argument, in bytes + TRUE on success + + + + Gets per-adapter WinPcap-compatible capture statistics. + + Handle to the adapter + Pointer to a user-allocated AirpcapStats structure that will be filled with statistical information. + TRUE on success + + + + Gets the number of LEDs the referenced adapter has available + + Handle to the adapter + Number of LEDs available on this adapter + + + + + + Turns on one of the adapter's LEDs. + + Handle to the adapter + Zero-based identifier of the LED to turn on + + + + + + Turns off one of the adapter's LEDs. + + Handle to the adapter + Zero-based identifier of the LED to turn off. + + + + + + Gets the current value of the device counter used to timestamp packets. + + Handle to the adapter + Pointer to a caller allocated 64bit integer that will receive the device + timestamp, in microseconds. + TRUE on success + + + + Device statistics + + + + + Number of packets received + + + + + Number of packets dropped + + + + + Number of interface dropped packets + + + + + Number of packets that pass the BPF filter, find place in the kernel buffer and + therefore reach the application. + + + + + ToString override + + + + + + + Channel information + Used by \ref AirpcapSetDeviceChannelEx(), \ref AirpcapGetDeviceChannelEx(), \ref AirpcapGetDeviceSupportedChannels() + + + + + Channel frequency, in MHz + UINT + + + + + 802.11n specific. Offset of the extension channel in case of 40MHz channels. + Possible values are -1, 0 +1: + - -1 means that the extension channel should be below the control channel (e.g. Control = 5 and Extension = 1) + - 0 means that no extension channel should be used (20MHz channels or legacy mode) + - +1 means that the extension channel should be above the control channel (e.g. Control = 1 and Extension = 5) + In case of 802.11a/b/g channels (802.11n legacy mode), this field should be set to 0. + CHAR + + + + + Channel Flags. The only flag supported at this time is \ref AIRPCAP_CIF_TX_ENABLED. + UCHAR + + + + + Reserved. It should be set to {0,0}. + + + + + Capture statistics + Returned by AirpcapGetStats() + + + + + Number of packets that the driver received by the adapter + from the beginning of the current capture. This value includes the packets + dropped because of buffer full. + + + + + Number of packets that the driver dropped from the beginning of a capture. + A packet is lost when the the buffer of the driver is full. + + + + + Packets dropped by the card before going to the USB bus. + Not supported at the moment. + + + + + Number of packets that pass the BPF filter, find place in the kernel buffer and + therefore reach the application. + + + + + Device capabilities + Returned by AirpcapGetDeviceCapabilities() + + + + + An id that identifies the adapter model + + + + + String containing a printable adapter model + + + + + The type of bus the adapter is plugged to + + + + + TRUE if the adapter is able to perform frame injection. + + + + + TRUE if the adapter's transmit power is can be specified by the user application. + + + + + TRUE if the adapter supports plugging one or more external antennas. + + + + + An OR combination of the media that the device supports. Possible values are: \ref AIRPCAP_MEDIUM_802_11_A, + \ref AIRPCAP_MEDIUM_802_11_B, \ref AIRPCAP_MEDIUM_802_11_G or \ref AIRPCAP_MEDIUM_802_11_N. + Not supported at the moment. + + + + + An OR combination of the bands that the device supports. Can be one of: \ref AIRPCAP_BAND_2GHZ, + \ref AIRPCAP_BAND_5GHZ. + + + + + WEB key container + + + + + Type of key, can be on of: \ref AIRPCAP_KEYTYPE_WEP, \ref AIRPCAP_KEYTYPE_TKIP, \ref AIRPCAP_KEYTYPE_CCMP. Only AIRPCAP_KEYTYPE_WEP is supported by the driver at the moment. + + + + + Length of the key in bytes + + + + + Key data + + + + + frequency Band. + 802.11 adapters can support different frequency bands, the most important of which are: 2.4GHz (802.11b/g/n) + and 5GHz (802.11a/n). + + + + Automatically pick the best frequency band + + + 2.4 GHz frequency band + + + 4 GHz frequency band + + + 5 GHz frequency band + + + + Entry in the list returned by \ref AirpcapGetDeviceList(). + + + + + Next element in the list + struct _AirpcapDeviceDescription* + + + + + Device name + PCHAR + + + + + Device description + PCHAR + + + + + Number of keys in the collection + + + + + Packet header + This structure defines the BPF that preceeds every packet delivered to the application + + + + + Timestamp associated with the captured packet. SECONDS. + UINT + + + + + Timestamp associated with the captured packet. MICROSECONDS. + UINT + + + + + Length of captured portion. The captured portion can be different from the original packet, because it is possible (with a proper filter) to instruct the driver to capture only a portion of the packets. + + + + + Original length of packet + UINT + + + + + Length of bpf header (this struct plus alignment padding). In some cases, a padding could be added between the end of this structure and the packet data for performance reasons. This field can be used to retrieve the actual data of the packet. + USHORT + + + + + Structure used to read the free running counter on a device + This structure contains the current value of the counter used by the device to timestamp packets (when the hardware supports hardware timestamps). + This structure also contains the value of the software counter (used to timestamp packets in software), before and after the hardware counter is read + on the device. + + + + Current value of the device counter, in microseconds. + + + Value of the software counter used to timestamp packets before reading the device counter, in microseconds. + + + Value of the software counter used to timestamp packets after reading the device counter, in microseconds. + + + + Type of frame validation the adapter performs. + An adapter can be instructed to accept different kind of frames: correct frames only, frames with wrong Frame Check Sequence (FCS) only, all frames. + + + + Accept all the frames the device captures + + + Accept correct frames only, i.e. frames with correct Frame Check Sequence (FCS). + + + Accept corrupt frames only, i.e. frames with worng Frame Check Sequence (FCS). + + + Unknown validation type. You should see it only in case of error. + + + + Version + + + + + Returns the version in separate fields + + + + + + + + + + + + + + + Returns the version in a.b.c.d format + + + + + + + List of available capture devices + + + + + Represents a strongly typed, read-only list of PcapDevices. + + + + The name or description of the pcap interface to get. + + + + Method to retrieve this classes singleton instance + + + + + Caution: Use the singlton instance unless you know why you need to call this. + One use is for multiple filters on the same physical device. To apply multiple + filters open the same physical device multiple times, one for each + filter by calling this routine and picking the same device out of each list. + + + A + + + + Retrieve a list of the current devices + + + A + + + + Refresh the device list + + + + + General Pcap Exception. + + + + + A wrapper for libpcap's pcap_pkthdr structure + + + + + A wrapper class for libpcap's pcap_pkthdr structure + + + + + Constructs a new PcapHeader + + The seconds value of the packet's timestamp + The microseconds value of the packet's timestamp + The actual length of the packet + The length of the capture + + + + DateTime(1970, 1, 1).Ticks, saves cpu cycles in the Date property + + + + + The seconds value of the packet's timestamp + + + + + The microseconds value of the packet's timestamp + + + + + The length of the packet on the line + + + + + The the bytes actually captured. If the capture length + is small CaptureLength might be less than PacketLength + + + + + Return the DateTime value of this pcap header + + + + + Get a PcapHeader structure from a pcap_pkthdr pointer. + + + + + Marshal this structure into the platform dependent version and return + and IntPtr to that memory + NOTE: IntPtr MUST BE FREED via Marshal.FreeHGlobal() + + + A + + + + Constants and static helper methods + + + + Represents the infinite number for packet captures + + + + Returns the pcap version string retrieved via a call to pcap_lib_version() + + + + + Helper class/method to retrieve the version of the SharpPcap assembly + + + + + Returns the current version string of the SharpPcap library + + the current version string of the SharpPcap library + + + + Item in a list of interfaces. + + + + + Representation of an interface address. + + + + + Structure used by kernel to store a generic address + Look at the sa_family value to determine which specific structure to use + 'struct sockaddr' + + + + + Structure that holds an ipv4 address + + + + + Structure that holds an ipv4 address + 'struct sockaddr' + + + + + Structure that holds an ipv6 address + NOTE: we cast the 'struct sockaddr*' to this structure based on the sa_family type + 'struct sockaddr_in6' + + + + + Structure to represent a low level address, like a hardware address + + + + + Windows and Unix differ in their memory models and make it difficult to + support struct timeval in a single library, like this one, across + multiple platforms. + See http://en.wikipedia.org/wiki/64bit#Specific_data_models + The issue is that struct timeval { long tv_sec; long tv_usec; } + has different sizes on Linux 32 and 64bit but the same size on + Windows 32 and 64 bit + Thanks to Jon Pryor for his help in figuring out both the issue with Linux + 32/64bit and the issue between Windows and Unix + + + + + Windows version of struct timeval, the longs are 32bit even on 64-bit versions of Windows + + + + + Each packet in the dump file is prepended with this generic header. + This gets around the problem of different headers for different + packet interfaces. + + + + + Each packet in the dump file is prepended with this generic header. + This gets around the problem of different headers for different + packet interfaces. + + + + + Packet data bytes + NOTE: This struct doesn't exist in header files, it is a construct to map to an + unmanaged byte array + + + + + A BPF pseudo-assembly program for packet filtering + + + + + A queue of raw packets that will be sent to the network with pcap_sendqueue_transmit() + + + + + Define the return values from int pcap_stats() + + + + + Unix version of 'struct pcap_stat' + Uses the same trick as timeval_unix + + + + + Packets received + + + + + Packets dropped + + + + + Drops by interface (maybe not yet supported) + + + + + Windows version of 'struct pcap_stat' + + + + + Packets received + + + + + Packets dropped + + + + + Drops by interface (maybe not yet supported) + + + + + Packets that reach the application + WIN32 only, based on struct pcap_stat in pcap.h + + + + + Per http://msdn.microsoft.com/en-us/ms182161.aspx + + + + + The delegate declaration for PcapHandler requires an UnmanagedFunctionPointer attribute. + Without this it fires for one time and then throws null pointer exception + + + + Open a file to write packets. + + + + Save a packet to disk. + + + + close the files associated with p and deallocates resources. + + + + To avoid callback, this returns one packet at a time + + + + + Send a raw packet.
+ This function allows to send a raw packet to the network. + The MAC CRC doesn't need to be included, because it is transparently calculated + and added by the network interface driver. +
+ the interface that will be used to send the packet + contains the data of the packet to send (including the various protocol headers) + the dimension of the buffer pointed by data + 0 if the packet is succesfully sent, -1 otherwise. +
+ + + Compile a packet filter, converting an high level filtering expression (see Filtering expression syntax) in a program that can be interpreted by the kernel-level filtering engine. + + + + + Free up allocated memory pointed to by a bpf_program struct generated by pcap_compile() + + + + + return the error text pertaining to the last pcap library error. + + + + Returns a pointer to a string giving information about the version of the libpcap library being used; note that it contains more information than just a version number. + + + return the standard I/O stream of the 'savefile' opened by pcap_dump_open(). + + + Flushes the output buffer to the 'savefile', so that any packets + written with pcap_dump() but not yet written to the 'savefile' will be written. + -1 is returned on error, 0 on success. + + + Closes a savefile. + + + Return the link layer of an adapter. + + + + Set nonblocking mode. pcap_loop() and pcap_next() doesnt work in nonblocking mode! + + + + + Get nonblocking mode, returns allways 0 for savefiles. + + + + + Read packets until cnt packets are processed or an error occurs. + + + + + Retrieves a selectable file descriptor + + + A + + A + + + + Fills in the pcap_stat structure passed to the function + based on the pcap_t adapter + + + A + + A + + A + + + + Returns the snapshot length + + + A + + A + + + + Returns the file descriptor number from which captured packets are read, + if a network device was opened with pcap_create() and pcap_activate() or + with pcap_open_live(), or -1, if a ``savefile'' was opened with + pcap_open_offline() + Libpcap specific method + + + A + + A + + + + Base class for all pcap devices + + + + + Thread that is performing the background packet capture + + + + + Flag that indicates that a capture thread should stop + + + + + If Environment.OSVersion.Platform is unix and MonoUnixFound is true + then we can support proper termination of the capture loop + + + A + + + + Low level interface object that contains device specific information + + + + + Handle to a pcap adapter, not equal to IntPtr.Zero if an adapter is open + + + + + Number of packets that this adapter should capture + + + + + Cached open and linkType variables, avoids a unsafe pointer comparison + and a pinvoke call for each packet retrieved as MarshalRawPacket + retrieves the LinkType + + + + + Fires whenever a new packet is processed, either when the packet arrives + from the network device or when the packet is read from the on-disk file.
+ For network captured packets this event is invoked only when working in "PcapMode.Capture" mode. +
+
+ + + Fired when the capture process of this pcap device is stopped + + + + + Return a value indicating if the capturing process of this adapter is started + + + + + Maximum time within which the capture thread must join the main thread (on + ) or else the thread is aborted and an exception thrown. + + + + + Device name + + + + + Description + + + + + Implemented because there isn't any way to perform + if(OnPacketArrival == null) isn't permitted outside of the containing class + this operation results in a CS0070 compile error + + + A + + + + Low level pcap device values + + + + + Return a value indicating if this adapter is opened + + + + + The underlying pcap device handle + + + + + The last pcap error associated with this pcap device + + + + + Link type in terms of PacketDotNet.LinkLayers + + + + + Retrieves pcap statistics + + + A + + + + Mac address of the physical device + + + + + Kernel level filtering expression associated with this device. + For more info on filter expression syntax, see: + http://www.winpcap.org/docs/docs31/html/group__language.html + + + + + Setup the reflection type and methodinfo for invocation of + Mono.Unix.Native.Syscall.poll() to avoid timeouts when + stopping the capture thread + + + + + Starts the capturing process via a background thread + OnPacketArrival() will be called for each captured packet + + + + + Stops the capture process + Throws an exception if the stop capture timeout is exceeded and the + capture thread was aborted + + + + + Synchronously capture packets on this device. Method blocks forever. + + + + + Synchronously captures packets on this network device. This method will block + until capturing is finished. + + The number of packets to be captured. + -1 means capture indefiniately + + + + The capture thread + + + + + Retrieve the last error string for a given pcap_t* device + + + A + + A + + + + Open the device with class specific options + + + + + Open the device. To start capturing call the 'StartCapture' function + + + A + + + + Open the device. To start capturing call the 'StartCapture' function + + + A + + A + + + + Closes this adapter + + + + + Notify the OnPacketArrival delegates about a newly captured packet + + + A + + + + Notify the delegates that are subscribed to the capture stopped event + + + A + + + + Gets the next packet captured on this device + + The next packet captured on this device + + + + Gets the next packet captured on this device + + + A + + A that contains the result code + + + + + Gets pointers to the next PCAP header and packet data. + Data is only valid until next call to GetNextPacketNative. + Advanced use only. Intended to allow unmanaged code to avoid the overhead of + marshalling PcapHeader and packet contents to allocated memory. + + + + + Pcap_loop callback method. + + + + + Convert an unmanaged packet into a managed PacketDotNet.RawPacket + + + A + + A + + A + + + + Assign a filter to this device given a filterExpression + + The filter expression to compile + + + or unmanaged memory will be leaked + + + Free memory allocated in CompileFilter() + + + A + + + + Returns true if the filter expression was able to be compiled into a + program without errors + + + + + Sends a raw packet throgh this device + + The packet to send + + + + Sends a raw packet throgh this device + + The packet to send + The number of bytes to send + + + + Sends a raw packet throgh this device + + The packet bytes to send + + + + Sends a raw packet throgh this device + + The packet bytes to send + The number of bytes to send + + + + Helper method for checking that the adapter is open, throws an + exception with a string of ExceptionString if the device isn't open + + + A + + + + Override the default ToString() implementation + + + A + + + + Managed representation of the unmanaged pcap_addr structure + + + + + The address value of this PcapAddress, null if none is present + + + + + Netmask of this PcapAddress, null if none is present + + + + + Broadcast address of this PcapAddress, null if none is present + + + + + Destination address, null if the interface isn't a point-to-point interface + + + + + ToString override + + + A + + + + Container class that represents either an ip address or a mac address + An analog to the 'sockaddr_' series of structures + + + + + Create a Sockaddr from a PhysicalAddress which is presumed to + be a hardware address + + + A + + + + Types of addresses a Sockaddr can represent + + + + + Address represents an ipv4 or ipv6 address + + + + + Address represents a physical hardware address eg. a ethernet mac address + + + + + Unknown address type + + + + + Address type represented by this Sockaddr + + + + + If type == AF_INET_AF_INET6 + + + + + If type == HARDWARE + + + + + Address family + + + + + ToString override + + + A + + + + managed version of struct pcap_if + NOTE: we can't use pcap_if directly because the class contains + a pointer to pcap_if that will be freed when the + device memory is freed, so instead convert the unmanaged structure + to a managed one to avoid this issue + + + + + Name of the interface. Used internally when passed to pcap_open_live() + + + + + Human readable interface name derived from System.Net.NetworkInformation.NetworkInterface.Name + + + + + Text description of the interface as given by pcap/winpcap + + + + + Gateway address of this device + NOTE: May only be available on Windows + + + + + Addresses associated with this device + + + + + Pcap interface flags + + + + + MacAddress of the interface + + + + + ToString override + + + A + + + + A PcapDevice or dumpfile is not ready for capture operations. + + + + + Adapter statistics, received, dropped packet counts etc + + + + + Retrieve pcap statistics from the adapter + + + pcap_t* for the adapter + A + + + + Number of packets received + + + + + Number of packets dropped + + + + + Number of interface dropped packets + + + + + ToString override + + + A + + + + Exception thrown when a WinPcap extension method is called from + a non-Windows platform + + + + + string constructor + + + A + + + + The mode used when opening a device + + + + + Promiscuous mode. + Instructs the OS that we want to receive all packets, even those not + intended for the adapter. On non-switched networks this can result in + a large amount of addtional traffic. + NOTE: Devices in this mode CAN be detected via the network + + + + + Not promiscuous mode + + + + + Capture event arguments + + + + + Constructor + + + A + + A + + + + Packet that was captured + + + + + Device this EventArgs was generated for + + + + + Resolves MAC addresses from IP addresses using the Address Resolution Protocol (ARP) + + + + + Constructs a new ARP Resolver + + The network device on which this resolver sends its ARP packets + + + + Timeout for a given call to Resolve() + + + + + Resolves the MAC address of the specified IP address. The 'DeviceName' propery must be set + prior to using this method. + + The IP address to resolve + The MAC address that matches to the given IP address + + + + Resolves the MAC address of the specified IP address + + The IP address to resolve + The local IP address from which to send the ARP request, if null the local address will be discovered + The localMAC address to use, if null the local mac will be discovered + The MAC address that matches to the given IP address or + null if there was a timeout + + + + Status types when capture is stopped + + + + + Capture completed without errors + + + + + Error while capturing + + + + + Thrown when an operation can't be performed because + a background capture has been started via PcapDevice.StartCapture() + + + + + string constructor + + + A + + + + Per http://msdn.microsoft.com/en-us/ms182161.aspx + + + + + Extended pcap_open() method that is WinPcap specific that + provides extra flags and functionality + See http://www.winpcap.org/docs/docs_40_2/html/group__wpcapfunc.html#g2b64c7b6490090d1d37088794f1f1791 + + + A + + A + + A + + A + + A + + A + + A + + + Create a list of network devices that can be opened with pcap_open(). + + + + Set the working mode of the interface p to mode. + Valid values for mode are MODE_CAPT (default capture mode) + and MODE_STAT (statistical mode). See the tutorial + "\ref wpcap_tut9" for details about statistical mode. + WinPcap specific method + + + + + WinPcap specific method for setting the kernel buffer size + associated with this adapter. The old buffer is discarded + when the buffer size is changed. + See http://www.winpcap.org/docs/docs_40_2/html/group__wpcapfunc.html + + + A + + A + + A + + + + changes the minimum amount of data in the kernel buffer that causes + a read from the application to return (unless the timeout expires) + See http://www.winpcap.org/docs/docs_412/html/group__wpcapfunc.html#gab14ceacbf1c2f63026416dd73f80dc0d + + + A + + A + + A + + + + Returns the AirPcap handler associated with an adapter. This handler can be used to change the + wireless-related settings of the CACE Technologies AirPcap wireless capture adapters. + Note: THIS FUNCTION SHOULD BE CONSIDERED PROVISIONAL, AND MAY BE REPLACED IN THE FUTURE BY A + MORE COMPLETE SET OF FUNCTIONS FOR WIRELESS SUPPORT. + pcap_get_airpcap_handle() allows to obtain the airpcap handle of an open adapter. This handle + can be used with the AirPcap API functions to perform wireless-releated operations, e.g. changing + the channel or enabling WEP decryption. For more details about the AirPcap wireless capture adapters, + see http://www.cacetech.com/products/airpcap.html + Parameters: + p,: handle to an open libpcap adapter + Returns: + a PAirpcapHandle pointer to an open AirPcap handle, used internally by the libpcap open adapter. + NULL if the libpcap adapter doesn't have wireless support through AirPcap. + + + + + + + + + Allocate a send queue. + + The size of the queue + A pointer to the allocated buffer + + + + Destroy a send queue. + + A pointer to the queue start address + + + + Add a packet to a send queue. + + A pointer to a queue + The pcap header of the packet to send + The packet data + + + + Send a queue of raw packets to the network. + + + + + + determines if the send operation must be synchronized: + if it is non-zero, the packets are sent respecting the timestamps, + otherwise they are sent as fast as possible + The amount of bytes actually sent. + If it is smaller than the size parameter, an error occurred + during the send. The error can be caused by a driver/adapter + problem or by an inconsistent/bogus send queue. + + + + Interface to the WinPcap send queue extension methods + + + + + Creates and allocates a new SendQueue + + + The maximun amount of memory (in bytes) + to allocate for the queue + + + + The current length in bytes of this queue + + + + + Add a packet to this send queue. The PcapHeader defines the packet length. + + The packet bytes to add + The pcap header of the packet + True if success, else false + + + + Add a packet to this send queue. + + The packet bytes to add + The pcap header of the packet + True if success, else false + + + + Add a packet to this send queue. + + The packet bytes to add + True if success, else false + + + + Add a packet to this send queue. + + The packet to add + True if success, else false + + + + Add a packet to this send queue. + + The packet to add + The 'seconds' part of the packet's timestamp + The 'microseconds' part of the packet's timestamp + True if success, else false + + + + Send a queue of raw packets to the network. + + + The device on which to send the queue + A + + A + + A + + + + Destroy the send queue. + + + + + The types of transmit modes allowed by the WinPcap specific send queue + implementation + + + + + Packets are sent as fast as possible + + + + + Packets are synchronized in the kernel with a high precision timestamp + + + + + Event that contains statistics mode data + NOTE: WinPcap only + + + + + Constructor for a statistics mode event + + + A + + A + + + + Statistics data for this event + + + + + Holds network statistics entry from winpcap when in statistics mode + See http://www.winpcap.org/docs/docs_41b5/html/group__wpcap__tut9.html + + + + + This holds byte received and packets received + + + + + This holds time value + + + + + Number of packets received since last sample + + + + + Number of bytes received since last sample + + + + + The mode used when opening a device + + + + + Defines if the adapter has to go in promiscuous mode. + + + + + Defines if the data trasfer (in case of a remote capture) + has to be done with UDP protocol. + + + + + Defines if the remote probe will capture its own generated traffic. + + + + + Defines if the local adapter will capture its own generated traffic. + + + + + This flag configures the adapter for maximum responsiveness. + + + + + Interfaces for capture devices + + + + + Fires whenever a new packet is processed, either when the packet arrives + from the network device or when the packet is read from the on-disk file.
+ For network captured packets this event is invoked only when working in "PcapMode.Capture" mode. +
+
+ + + Fired when the capture process of this pcap device is stopped + + + + + Gets the name of the device + + + + + Description of the device + + + + + The last pcap error associated with this pcap device + + + + + Kernel level filtering expression associated with this device. + For more info on filter expression syntax, see: + http://www.winpcap.org/docs/docs31/html/group__language.html + + + + + Retrieves pcap statistics + + + + + Mac address of the physical device + + + + + Return a value indicating if the capturing process of this adapter is started + + + + + Maximum time within which the capture thread must join the main thread (on + ) or else the thread is aborted and an exception thrown. + + + + + Return the pcap link layer value of an adapter. + + + + + Opens the adapter + + + + + Open the device. To start capturing call the 'StartCapture' function + + + A + + + + Open the device. To start capturing call the 'StartCapture' function + + + A + + A + + + + Closes this adapter + + + + + Start the capture + + + + + Stop the capture + + + + + Synchronously capture packets on this device. Method blocks forever. + + + + + Retrieves the next packet from a device + + + + + + + Gets pointers to the next PCAP header and packet data. + Data is only valid until next call to GetNextPacketNative. + Advanced use only. Intended to allow unmanaged code to avoid the overhead of + marshalling PcapHeader and packet contents to allocated memory. + + + + + Sends a raw packet throgh this device + + The packet to send + + + + Sends a raw packet throgh this device + + The packet to send + The number of bytes to send + + + + Sends a raw packet throgh this device + + The packet bytes to send + + + + Sends a raw packet throgh this device + + The packet bytes to send + The number of bytes to send + + + + WinPcap device + + + + + Constructs a new PcapDevice based on a 'pcapIf' struct + + A 'pcapIf' struct representing + the pcap device + + + + Fires whenever a new pcap statistics is available for this Pcap Device.
+ For network captured packets this event is invoked only when working in "PcapMode.Statistics" mode. +
+
+ + + WinPcap specific property + + + + + Set the kernel value buffer size in bytes + WinPcap extension + + + + + Set the minumum amount of data (in bytes) received by the kernel in a single call. + WinPcap extension + + + + + Starts the capturing process via a background thread + OnPacketArrival() will be called for each captured packet + NOTE: Winpcap devices can capture packets or statistics updates + so only if both a packet handler AND a statistics handler + are defined will an exception be thrown + + + + + Open the device + + + + + Open + + + A + + A + + A + + + + Open a device with specific flags + WinPcap extension - Use of this method will exclude your application + from working on Linux or Mac + + + + + Close the device + + + + + Notify the OnPacketArrival delegates about a newly captured packet + + + A + + + + Sends all packets in a 'PcapSendQueue' out this pcap device + + + A + + A + + A + + + + Helper method for ensuring we are running in winpcap. Throws + a PcapWinPcapRequiredException() if not on a windows platform + + + + + thrown when pcap_stats() reports an error + + + + + string constructor + + + A + + + + The working mode of a Pcap device + + + + + Set a Pcap device to capture packets, Capture mode + + + + + Set a Pcap device to report statistics. +
+ Statistics mode is only supported in WinPcap +
+
+ + + WinPcap specific unmanaged structures + + + + + Struct to specifiy Remote Address using rpcapd.exe, Winpcaps Remote Packet Capture Daemon + + + + + NOTE: IntPtr used to ensure that the correct data size is used depending on + the platform being used, 32bits on a 32bit machine, 64bits on a 64bit machine + Auth Type, 0=Null, 1= Password + + + + + Username + + + + + Password + + + + + Remote authentication type and parameters + + + + + Constructor + + + A + + A + + A + + + + Type of authentication + + + + + Username + + + + + Password + + + + + Converts this structure to an unmanaged IntPtr. Should be + freed with Marshal.FreeHGlobal(IntPtr); + + + A + + + + Types of authentication + + + + + Null authentication + + + + + Username/password authentication + + + + + Link type + + + + + plain 802.11 link type. Every packet in the buffer contains the raw 802.11 frame, including MAC FCS. + + + + + 802.11 plus radiotap link type. Every packet in the buffer contains a radiotap header followed by the 802.11 frame. MAC FCS is included. + + + + + Unknown link type, should be seen only in error + + + + + 802.11 plus PPI header link type. Every packet in the buffer contains a PPI header followed by the 802.11 frame. MAC FCS is included. + + + + + Adapter statistics, received, dropped packet counts etc + + + + + Number of packets received + + + + + Number of packets dropped + + + + + Number of interface dropped packets + + + + + Remote adapter list + + + + + Represents a strongly typed, read-only list of PcapDevices. + + + + + Port used by rpcapd by default + + + + The name or description of the pcap interface to get. + + + + Method to retrieve this classes singleton instance + + + + + Caution: Use the singlton instance unless you know why you need to call this. + One use is for multiple filters on the same physical device. To apply multiple + filters open the same physical device multiple times, one for each + filter by calling this routine and picking the same device out of each list. + + + A + + + + + Retrieve the local devices + + + + + + + Refresh the device list + + + + + Capture live packets from a network device + + + + + Constructs a new PcapDevice based on a 'pcapIf' struct + + A 'pcapIf' struct representing + the pcap device + + + + Default contructor for subclasses + + + + + Gets the pcap name of this network device + + + + + Addresses that represent this device + + + + + Gets the pcap description of this device + + + + + Interface flags, see pcap_findalldevs() man page for more info + + + + + True if device is a loopback interface, false if not + + + + + Set/Get Non-Blocking Mode. returns allways false for savefiles. + + + + + Retrieves pcap statistics + + + A + + + + PcapDevice finalizer. Ensure PcapDevices are stopped and closed before exit. + + + + + Open the device with default values of: promiscuous_mode = false, read_timeout = 1000 + To start capturing call the 'StartCapture' function + + + + + Open the device. To start capturing call the 'StartCapture' function + + + A + + + + Open the device. To start capturing call the 'StartCapture' function + + + A + + A + + + + Sends a raw packet throgh this device + + The packet bytes to send + The number of bytes to send + + + + List of available Pcap Interfaces. + + + + + Represents a strongly typed, read-only list of PcapDevices. + + + + The name or description of the pcap interface to get. + + + + Method to retrieve this classes singleton instance + + + + + Caution: Use the singlton instance unless you know why you need to call this. + One use is for multiple filters on the same physical device. To apply multiple + filters open the same physical device multiple times, one for each + filter by calling this routine and picking the same device out of each list. + + + A + + + + Retrieve a list of the current PcapDevices + + + A + + + + Refresh the device list + + + + + Represents a raw captured packet + + + + + Constructor + + + A + + A + + A + + + Fetch data portion of the packet. + Data as a class field vs. a virtual property improves performance + significantly. ~2.5% when parsing the packet with Packet.Net and + ~20% when reading each byte of the packet + + + Link layer from which this packet was captured + + + + + The unix timeval when the packet was created + + + + Output this packet as a readable string + + + POSIX.4 timeval + + + + Constructor with Seconds and MicroSeconds fields + + + A + + A + + + + Construct a PosixTimeval using the current UTC time + + + + + Number of seconds in the timeval + + + + + Number of microseconds in the timeval + + + + The timeval as a DateTime in Utc + + + + Equals override + + + A + + A + + + + GetHashCode override + + + A + + + + Convert the timeval to a string like 'SECONDS.MICROSECONDSs' + + + A + + + + Compare this to another + + + A + + A + + + + Operator < overload + + + A + + A + + A + + + + Operator > overload + + + A + + A + + A + + + + Operator <= + + + A + + A + + A + + + + Operator >= + + + A + + A + + A + + + + Operator == + + + A + + A + + A + + + + Operator != + + + A + + A + + A + + + + Read a pcap capture file + + + + + + + A + + + + The name of the capture file + + + + + Description of the device + + + + + Number of bytes in the capture file + + + + + The underlying pcap file name + + + + + Retrieves pcap statistics + + + A + + + + Open the device + + + + + Create or write to a pcap capture file + NOTE: Appending to a capture file is not currently supported + + + + + Constructor + + + A + + + + Constructor + + + A + + A + + + + Constructor + + + A + + A + + + + Constructor + + + A + + A + + A + + + + Constructor + + + A + + A + + A + + A + + + + Handle to an open dump file, not equal to IntPtr.Zero if a dump file is open + + + + + Whether dump file is open or not + + + A + + + + The name of the capture file + + + + + Description of the device + + + + + Retrieves pcap statistics + + + A + + + + Close the capture file + + + + + Open the device + + + + + Writes a packet to the pcap dump file associated with this device. + + + + + Writes a packet to the pcap dump file associated with this device. + + The packet to write + + + + Writes a packet to the pcap dump file associated with this device. + + The packet to write + + + + Thrown when a method not supported on a capture file + + + + + string constructor + + + A + + + A delegate for Packet Arrival events + + + + A delegate for notifying of a capture stopped event + + + + + A delegate for delivering network statistics when using winpcap in + statistics mode + + +
+
diff --git a/.gitignore b/dep/sharpziplib/ICSharpCode.SharpZipLib.License similarity index 100% rename from .gitignore rename to dep/sharpziplib/ICSharpCode.SharpZipLib.License diff --git a/dep/sharpziplib/ICSharpCode.SharpZipLib.dll b/dep/sharpziplib/ICSharpCode.SharpZipLib.dll new file mode 100644 index 00000000..8a9043c7 Binary files /dev/null and b/dep/sharpziplib/ICSharpCode.SharpZipLib.dll differ diff --git a/dep/sqlite/SQLite.License b/dep/sqlite/SQLite.License new file mode 100644 index 00000000..c91eaf6b --- /dev/null +++ b/dep/sqlite/SQLite.License @@ -0,0 +1,7 @@ +ADO.NET SQLite Data Provider +Version 1.0.74.0 July 4, 2011 +Using SQLite 3.7.7.1 [af0d91adf4] +Originally written by Robert Simpson +Released to the public domain, use at your own risk! +Official provider website: http://system.data.sqlite.org/ +Legacy versions: http://sqlite.phxsoftware.com/ \ No newline at end of file diff --git a/dep/sqlite/sqlite-managed/System.Data.SQLite.dll b/dep/sqlite/sqlite-managed/System.Data.SQLite.dll new file mode 100644 index 00000000..90eb1518 Binary files /dev/null and b/dep/sqlite/sqlite-managed/System.Data.SQLite.dll differ diff --git a/dep/sqlite/sqlite-mixed/System.Data.SQLite.dll b/dep/sqlite/sqlite-mixed/System.Data.SQLite.dll new file mode 100644 index 00000000..544cd8fb Binary files /dev/null and b/dep/sqlite/sqlite-mixed/System.Data.SQLite.dll differ diff --git a/dep/sqlite/sqlite-mixed/System.Data.SQLite.pdb b/dep/sqlite/sqlite-mixed/System.Data.SQLite.pdb new file mode 100644 index 00000000..5d354c97 Binary files /dev/null and b/dep/sqlite/sqlite-mixed/System.Data.SQLite.pdb differ diff --git a/dep/sqlite/sqlite-mixed/System.Data.SQLite.xml b/dep/sqlite/sqlite-mixed/System.Data.SQLite.xml new file mode 100644 index 00000000..ec1884b8 --- /dev/null +++ b/dep/sqlite/sqlite-mixed/System.Data.SQLite.xml @@ -0,0 +1,4699 @@ + + + + System.Data.SQLite + + + + + This class implements SQLiteBase completely, and is the guts of the code that interop's SQLite with .NET + + + + + This internal class provides the foundation of SQLite support. It defines all the abstract members needed to implement + a SQLite data provider, and inherits from SQLiteConvert which allows for simple translations of string to and from SQLite. + + + + + This base class provides datatype conversion services for the SQLite provider. + + + + + The format string for DateTime values when using the InvariantCulture or CurrentCulture formats. + + + + + The value for the Unix epoch (e.g. January 1, 1970 at midnight, in UTC). + + + + + The value of the OLE Automation epoch represented as a Julian day. + + + + + An array of ISO8601 datetime formats we support conversion from + + + + + The internal default format for UTC DateTime values when converting + to a string. + + + + + The internal default format for local DateTime values when converting + to a string. + + + + + An UTF-8 Encoding instance, so we can convert strings to and from UTF-8 + + + + + The default DateTime format for this instance + + + + + The default DateTimeKind for this instance. + + + + + Initializes the conversion class + + The default date/time format to use for this instance + The DateTimeKind to use. + + + + Converts a string to a UTF-8 encoded byte array sized to include a null-terminating character. + + The string to convert to UTF-8 + A byte array containing the converted string plus an extra 0 terminating byte at the end of the array. + + + + Convert a DateTime to a UTF-8 encoded, zero-terminated byte array. + + + This function is a convenience function, which first calls ToString() on the DateTime, and then calls ToUTF8() with the + string result. + + The DateTime to convert. + The UTF-8 encoded string, including a 0 terminating byte at the end of the array. + + + + Converts a UTF-8 encoded IntPtr of the specified length into a .NET string + + The pointer to the memory where the UTF-8 string is encoded + The number of bytes to decode + A string containing the translated character(s) + + + + Converts a UTF-8 encoded IntPtr of the specified length into a .NET string + + The pointer to the memory where the UTF-8 string is encoded + The number of bytes to decode + A string containing the translated character(s) + + + + Converts a string into a DateTime, using the current DateTimeFormat specified for the connection when it was opened. + + + Acceptable ISO8601 DateTime formats are: + + THHmmssK + THHmmK + HH:mm:ss.FFFFFFFK + HH:mm:ssK + HH:mmK + yyyy-MM-dd HH:mm:ss.FFFFFFFK + yyyy-MM-dd HH:mm:ssK + yyyy-MM-dd HH:mmK + yyyy-MM-ddTHH:mm:ss.FFFFFFFK + yyyy-MM-ddTHH:mmK + yyyy-MM-ddTHH:mm:ssK + yyyyMMddHHmmssK + yyyyMMddHHmmK + yyyyMMddTHHmmssFFFFFFFK + THHmmss + THHmm + HH:mm:ss.FFFFFFF + HH:mm:ss + HH:mm + yyyy-MM-dd HH:mm:ss.FFFFFFF + yyyy-MM-dd HH:mm:ss + yyyy-MM-dd HH:mm + yyyy-MM-ddTHH:mm:ss.FFFFFFF + yyyy-MM-ddTHH:mm + yyyy-MM-ddTHH:mm:ss + yyyyMMddHHmmss + yyyyMMddHHmm + yyyyMMddTHHmmssFFFFFFF + yyyy-MM-dd + yyyyMMdd + yy-MM-dd + + If the string cannot be matched to one of the above formats, an exception will be thrown. + + The string containing either a long integer number of 100-nanosecond units since + System.DateTime.MinValue, a Julian day double, an integer number of seconds since the Unix epoch, a + culture-independent formatted date and time string, a formatted date and time string in the current + culture, or an ISO8601-format string. + A DateTime value + + + + Converts a string into a DateTime, using the specified DateTimeFormat and DateTimeKind. + + + Acceptable ISO8601 DateTime formats are: + + THHmmssK + THHmmK + HH:mm:ss.FFFFFFFK + HH:mm:ssK + HH:mmK + yyyy-MM-dd HH:mm:ss.FFFFFFFK + yyyy-MM-dd HH:mm:ssK + yyyy-MM-dd HH:mmK + yyyy-MM-ddTHH:mm:ss.FFFFFFFK + yyyy-MM-ddTHH:mmK + yyyy-MM-ddTHH:mm:ssK + yyyyMMddHHmmssK + yyyyMMddHHmmK + yyyyMMddTHHmmssFFFFFFFK + THHmmss + THHmm + HH:mm:ss.FFFFFFF + HH:mm:ss + HH:mm + yyyy-MM-dd HH:mm:ss.FFFFFFF + yyyy-MM-dd HH:mm:ss + yyyy-MM-dd HH:mm + yyyy-MM-ddTHH:mm:ss.FFFFFFF + yyyy-MM-ddTHH:mm + yyyy-MM-ddTHH:mm:ss + yyyyMMddHHmmss + yyyyMMddHHmm + yyyyMMddTHHmmssFFFFFFF + yyyy-MM-dd + yyyyMMdd + yy-MM-dd + + If the string cannot be matched to one of the above formats, an exception will be thrown. + + The string containing either a long integer number of 100-nanosecond units since + System.DateTime.MinValue, a Julian day double, an integer number of seconds since the Unix epoch, a + culture-independent formatted date and time string, a formatted date and time string in the current + culture, or an ISO8601-format string. + The SQLiteDateFormats to use. + The DateTimeKind to use. + A DateTime value + + + + Converts a julianday value into a DateTime + + The value to convert + A .NET DateTime + + + + Converts a julianday value into a DateTime + + The value to convert + The DateTimeKind to use. + A .NET DateTime + + + + Converts a DateTime struct to a JulianDay double + + The DateTime to convert + The JulianDay value the Datetime represents + + + + Converts a DateTime struct to the whole number of seconds since the + Unix epoch. + + The DateTime to convert + The whole number of seconds since the Unix epoch + + + + Returns the default DateTime format string to use for the specified + DateTimeKind. + + The DateTimeKind to use. + + The default DateTime format string to use for the specified DateTimeKind. + + + + + Converts a DateTime to a string value, using the current DateTimeFormat specified for the connection when it was opened. + + The DateTime value to convert + Either a string containing the long integer number of 100-nanosecond units since System.DateTime.MinValue, a + Julian day double, an integer number of seconds since the Unix epoch, a culture-independent formatted date and time + string, a formatted date and time string in the current culture, or an ISO8601-format date/time string. + + + + Internal function to convert a UTF-8 encoded IntPtr of the specified length to a DateTime. + + + This is a convenience function, which first calls ToString() on the IntPtr to convert it to a string, then calls + ToDateTime() on the string to return a DateTime. + + A pointer to the UTF-8 encoded string + The length in bytes of the string + The parsed DateTime value + + + + Smart method of splitting a string. Skips quoted elements, removes the quotes. + + + This split function works somewhat like the String.Split() function in that it breaks apart a string into + pieces and returns the pieces as an array. The primary differences are: + + Only one character can be provided as a separator character + Quoted text inside the string is skipped over when searching for the separator, and the quotes are removed. + + Thus, if splitting the following string looking for a comma:
+ One,Two, "Three, Four", Five
+
+ The resulting array would contain
+ [0] One
+ [1] Two
+ [2] Three, Four
+ [3] Five
+
+ Note that the leading and trailing spaces were removed from each item during the split. +
+ Source string to split apart + Separator character + A string array of the split up elements +
+ + + Convert a value to true or false. + + A string or number representing true or false + + + + + Convert a string to true or false. + + A string representing true or false + + + "yes", "no", "y", "n", "0", "1", "on", "off" as well as Boolean.FalseString and Boolean.TrueString will all be + converted to a proper boolean value. + + + + + Determines the data type of a column in a statement + + The statement to retrieve information for + The column to retrieve type information on + The SQLiteType to receive the affinity for the given column + + + + Converts a SQLiteType to a .NET Type object + + The SQLiteType to convert + Returns a .NET Type object + + + + For a given intrinsic type, return a DbType + + The native type to convert + The corresponding (closest match) DbType + + + + Returns the ColumnSize for the given DbType + + The DbType to get the size of + + + + + Convert a DbType to a Type + + The DbType to convert from + The closest-match .NET type + + + + For a given type, return the closest-match SQLite TypeAffinity, which only understands a very limited subset of types. + + The type to evaluate + The SQLite type affinity for that type. + + + + For a given type name, return a closest-match .NET type + + The name of the type to match + The .NET DBType the text evaluates to. + + + + Shutdown the SQLite engine so that it can be restarted with different config options. + We depend on auto initialization to recover. + + + + + Returns non-zero if a database connection is open. + + + + + + Opens a database. + + + Implementers should call SQLiteFunction.BindFunctions() and save the array after opening a connection + to bind all attributed user-defined functions and collating sequences to the new connection. + + The filename of the database to open. SQLite automatically creates it if it doesn't exist. + The flags associated with the parent connection object + The open flags to use when creating the connection + The maximum size of the pool for the given filename + If true, the connection can be pulled from the connection pool + + + + Closes the currently-open database. + + + After the database has been closed implemeters should call SQLiteFunction.UnbindFunctions() to deallocate all interop allocated + memory associated with the user-defined functions and collating sequences tied to the closed connection. + + + + + Sets the busy timeout on the connection. SQLiteCommand will call this before executing any command. + + The number of milliseconds to wait before returning SQLITE_BUSY + + + + Returns the text of the last error issued by SQLite + + + + + + When pooling is enabled, force this connection to be disposed rather than returned to the pool + + + + + Prepares a SQL statement for execution. + + The source connection preparing the command. Can be null for any caller except LINQ + The SQL command text to prepare + The previous statement in a multi-statement command, or null if no previous statement exists + The timeout to wait before aborting the prepare + The remainder of the statement that was not processed. Each call to prepare parses the + SQL up to to either the end of the text or to the first semi-colon delimiter. The remaining text is returned + here for a subsequent call to Prepare() until all the text has been processed. + Returns an initialized SQLiteStatement. + + + + Steps through a prepared statement. + + The SQLiteStatement to step through + True if a row was returned, False if not. + + + + Resets a prepared statement so it can be executed again. If the error returned is SQLITE_SCHEMA, + transparently attempt to rebuild the SQL statement and throw an error if that was not possible. + + The statement to reset + Returns -1 if the schema changed while resetting, 0 if the reset was sucessful or 6 (SQLITE_LOCKED) if the reset failed due to a lock + + + + Enables or disabled extened result codes returned by SQLite + + true to enable extended result codes, false to disable. + + + + + Returns the numeric result code for the most recent failed SQLite API call + associated with the database connection. + + Result code + + + + Returns the extended numeric result code for the most recent failed SQLite API call + associated with the database connection. + + Extended result code + + + + Add a log message via the SQLite sqlite3_log interface. + + Error code to be logged with the message. + String to be logged. Unlike the SQLite sqlite3_log() + interface, this should be pre-formatted. Consider using the + String.Format() function. + + + + + Creates a new SQLite backup object based on the provided destination + database connection. The source database connection is the one + associated with this object. The source and destination database + connections cannot be the same. + + The destination database connection. + The destination database name. + The source database name. + The newly created backup object. + + + + Copies up to N pages from the source database to the destination + database associated with the specified backup object. + + The backup object to use. + + The number of pages to copy or negative to copy all remaining pages. + + + Set to true if the operation needs to be retried due to database + locking issues. + + + True if there are more pages to be copied, false otherwise. + + + + + Returns the number of pages remaining to be copied from the source + database to the destination database associated with the specified + backup object. + + The backup object to check. + The number of pages remaining to be copied. + + + + Returns the total number of pages in the source database associated + with the specified backup object. + + The backup object to check. + The total number of pages in the source database. + + + + Destroys the backup object, rolling back any backup that may be in + progess. + + The backup object to destroy. + + + + Returns a string representing the active version of SQLite + + + + + Returns the rowid of the most recent successful INSERT into the database from this connection. + + + + + Returns the number of changes the last executing insert/update caused. + + + + + Returns the amount of memory (in bytes) currently in use by the SQLite core library. + + + + + Returns the maximum amount of memory (in bytes) used by the SQLite core library since the high-water mark was last reset. + + + + + The opaque pointer returned to us by the sqlite provider + + + + + The user-defined functions registered on this connection + + + + + Shutdown the SQLite engine so that it can be restarted with different config options. + We depend on auto initialization to recover. + + Returns a result code + + + Enables or disabled extended result codes returned by SQLite + + + Gets the last SQLite error code + + + Gets the last SQLite extended error code + + + Add a log message via the SQLite sqlite3_log interface. + + + + Allows the setting of a logging callback invoked by SQLite when a + log event occurs. Only one callback may be set. If NULL is passed, + the logging callback is unregistered. + + The callback function to invoke. + Returns a result code + + + + Creates a new SQLite backup object based on the provided destination + database connection. The source database connection is the one + associated with this object. The source and destination database + connections cannot be the same. + + The destination database connection. + The destination database name. + The source database name. + The newly created backup object. + + + + Copies up to N pages from the source database to the destination + database associated with the specified backup object. + + The backup object to use. + + The number of pages to copy, negative to copy all remaining pages. + + + Set to true if the operation needs to be retried due to database + locking issues; otherwise, set to false. + + + True if there are more pages to be copied, false otherwise. + + + + + Returns the number of pages remaining to be copied from the source + database to the destination database associated with the specified + backup object. + + The backup object to check. + The number of pages remaining to be copied. + + + + Returns the total number of pages in the source database associated + with the specified backup object. + + The backup object to check. + The total number of pages in the source database. + + + + Destroys the backup object, rolling back any backup that may be in + progess. + + The backup object to destroy. + + + + Determines if the SQLite core library has been initialized for the + current process. + + + A boolean indicating whether or not the SQLite core library has been + initialized for the current process. + + + + + Determines if the SQLite core library has been initialized for the + current process. + + + A boolean indicating whether or not the SQLite core library has been + initialized for the current process. + + + + + Helper function to retrieve a column of data from an active statement. + + The statement being step()'d through + The column index to retrieve + The type of data contained in the column. If Uninitialized, this function will retrieve the datatype information. + Returns the data in the column + + + + Alternate SQLite3 object, overriding many text behaviors to support UTF-16 (Unicode) + + + + + Overrides SQLiteConvert.ToString() to marshal UTF-16 strings instead of UTF-8 + + A pointer to a UTF-16 string + The length (IN BYTES) of the string + A .NET string + + + + Represents a single SQL backup in SQLite. + + + + + The underlying SQLite object this backup is bound to. + + + + + The actual backup handle. + + + + + The destination database for the backup. + + + + + The destination database name for the backup. + + + + + The source database for the backup. + + + + + The source database name for the backup. + + + + + The last result from the StepBackup method of the SQLite3 class. + This is used to determine if the call to the FinishBackup method of + the SQLite3 class should throw an exception when it receives a non-Ok + return code from the core SQLite library. + + + + + Initializes the backup. + + The base SQLite object. + The backup handle. + The destination database for the backup. + The destination database name for the backup. + The source database for the backup. + The source database name for the backup. + + + + Disposes and finalizes the backup. + + + + + The extra behavioral flags that can be applied to a connection. + + + + + No extra flags. + + + + + Enable logging of all SQL statements to be prepared. + + + + + Enable logging of all bound parameter types and raw values. + + + + + Enable logging of all bound parameter strongly typed values. + + + + + Enable logging of all exceptions caught from user-provided + managed code called from native code via delegates. + + + + + Enable logging of backup API errors. + + + + + Enable all logging. + + + + + The default extra flags for new connections. + + + + + SQLite implementation of DbCommand. + + + + + The command text this command is based on + + + + + The connection the command is associated with + + + + + The version of the connection the command is associated with + + + + + Indicates whether or not a DataReader is active on the command. + + + + + The timeout for the command, kludged because SQLite doesn't support per-command timeout values + + + + + Designer support + + + + + Used by DbDataAdapter to determine updating behavior + + + + + The collection of parameters for the command + + + + + The SQL command text, broken into individual SQL statements as they are executed + + + + + Unprocessed SQL text that has not been executed + + + + + Transaction associated with this command + + + + + Constructs a new SQLiteCommand + + + Default constructor + + + + + Initializes the command with the given command text + + The SQL command text + + + + Initializes the command with the given SQL command text and attach the command to the specified + connection. + + The SQL command text + The connection to associate with the command + + + + Initializes the command and associates it with the specified connection. + + The connection to associate with the command + + + + Initializes a command with the given SQL, connection and transaction + + The SQL command text + The connection to associate with the command + The transaction the command should be associated with + + + + Disposes of the command and clears all member variables + + Whether or not the class is being explicitly or implicitly disposed + + + + Clears and destroys all statements currently prepared + + + + + Builds an array of prepared statements for each complete SQL statement in the command text + + + + + Not implemented + + + + + Forwards to the local CreateParameter() function + + + + + + Create a new parameter + + + + + + This function ensures there are no active readers, that we have a valid connection, + that the connection is open, that all statements are prepared and all parameters are assigned + in preparation for allocating a data reader. + + + + + Creates a new SQLiteDataReader to execute/iterate the array of SQLite prepared statements + + The behavior the data reader should adopt + Returns a SQLiteDataReader object + + + + Overrides the default behavior to return a SQLiteDataReader specialization class + + The flags to be associated with the reader + A SQLiteDataReader + + + + Overrides the default behavior of DbDataReader to return a specialized SQLiteDataReader class + + A SQLiteDataReader + + + + Called by the SQLiteDataReader when the data reader is closed. + + + + + Execute the command and return the number of rows inserted/updated affected by it. + + + + + + Execute the command and return the first column of the first row of the resultset + (if present), or null if no resultset was returned. + + The first column of the first row of the first resultset from the query + + + + Does nothing. Commands are prepared as they are executed the first time, and kept in prepared state afterwards. + + + + + Clones a command, including all its parameters + + A new SQLiteCommand with the same commandtext, connection and parameters + + + + The SQL command text associated with the command + + + + + The amount of time to wait for the connection to become available before erroring out + + + + + The type of the command. SQLite only supports CommandType.Text + + + + + The connection associated with this command + + + + + Forwards to the local Connection property + + + + + Returns the SQLiteParameterCollection for the given command + + + + + Forwards to the local Parameters property + + + + + The transaction associated with this command. SQLite only supports one transaction per connection, so this property forwards to the + command's underlying connection. + + + + + Forwards to the local Transaction property + + + + + Sets the method the SQLiteCommandBuilder uses to determine how to update inserted or updated rows in a DataTable. + + + + + Determines if the command is visible at design time. Defaults to True. + + + + + SQLite implementation of DbCommandBuilder. + + + + + Default constructor + + + + + Initializes the command builder and associates it with the specified data adapter. + + + + + + Minimal amount of parameter processing. Primarily sets the DbType for the parameter equal to the provider type in the schema + + The parameter to use in applying custom behaviors to a row + The row to apply the parameter to + The type of statement + Whether the application of the parameter is part of a WHERE clause + + + + Returns a valid named parameter + + The name of the parameter + Error + + + + Returns a named parameter for the given ordinal + + The i of the parameter + Error + + + + Returns a placeholder character for the specified parameter i. + + The index of the parameter to provide a placeholder for + Returns a named parameter + + + + Sets the handler for receiving row updating events. Used by the DbCommandBuilder to autogenerate SQL + statements that may not have previously been generated. + + A data adapter to receive events on. + + + + Returns the automatically-generated SQLite command to delete rows from the database + + + + + + Returns the automatically-generated SQLite command to delete rows from the database + + + + + + + Returns the automatically-generated SQLite command to update rows in the database + + + + + + Returns the automatically-generated SQLite command to update rows in the database + + + + + + + Returns the automatically-generated SQLite command to insert rows into the database + + + + + + Returns the automatically-generated SQLite command to insert rows into the database + + + + + + + Places brackets around an identifier + + The identifier to quote + The bracketed identifier + + + + Removes brackets around an identifier + + The quoted (bracketed) identifier + The undecorated identifier + + + + Override helper, which can help the base command builder choose the right keys for the given query + + + + + + + Gets/sets the DataAdapter for this CommandBuilder + + + + + Overridden to hide its property from the designer + + + + + Overridden to hide its property from the designer + + + + + Overridden to hide its property from the designer + + + + + Overridden to hide its property from the designer + + + + + Overridden to hide its property from the designer + + + + + SQLite implentation of DbConnection. + + + The ConnectionString property of the SQLiteConnection class can contain the following parameter(s), delimited with a semi-colon: + + + Parameter + Values + Required + Default + + + Data Source + {filename} + Y + + + + Version + 3 + N + 3 + + + UseUTF16Encoding + True
False
+ N + False +
+ + DateTimeFormat + Ticks - Use DateTime.Ticks
ISO8601 - Use ISO8601 DateTime format
+ N + ISO8601 +
+ + DateTimeKind + Unspecified - Not specified as either UTC or local time.
Utc - The time represented is UTC.
Local - The time represented is local time.
+ N + Unspecified +
+ + BaseSchemaName + Some base data classes in the framework (e.g. those that build SQL queries dynamically) + assume that an ADO.NET provider cannot support an alternate catalog (i.e. database) without supporting + alternate schemas as well; however, SQLite does not fit into this model. Therefore, this value is used + as a placeholder and removed prior to preparing any SQL statements that may contain it. + N + sqlite_default_schema + + + BinaryGUID + True - Store GUID columns in binary form
False - Store GUID columns as text
+ N + True +
+ + Cache Size + {size in bytes} + N + 2000 + + + Synchronous + Normal - Normal file flushing behavior
Full - Full flushing after all writes
Off - Underlying OS flushes I/O's
+ N + Normal +
+ + Page Size + {size in bytes} + N + 1024 + + + Password + {password} + N + + + + Enlist + Y - Automatically enlist in distributed transactions
N - No automatic enlistment
+ N + Y +
+ + Pooling + True - Use connection pooling
False - Do not use connection pooling
+ N + False +
+ + FailIfMissing + True - Don't create the database if it does not exist, throw an error instead
False - Automatically create the database if it does not exist
+ N + False +
+ + Max Page Count + {size in pages} - Limits the maximum number of pages (limits the size) of the database + N + 0 + + + Legacy Format + True - Use the more compatible legacy 3.x database format
False - Use the newer 3.3x database format which compresses numbers more effectively
+ N + False +
+ + Default Timeout + {time in seconds}
The default command timeout
+ N + 30 +
+ + Journal Mode + Delete - Delete the journal file after a commit
Persist - Zero out and leave the journal file on disk after a commit
Off - Disable the rollback journal entirely
+ N + Delete +
+ + Read Only + True - Open the database for read only access
False - Open the database for normal read/write access
+ N + False +
+ + Max Pool Size + The maximum number of connections for the given connection string that can be in the connection pool + N + 100 + + + Default IsolationLevel + The default transaciton isolation level + N + Serializable + + + Foreign Keys + Enable foreign key constraints + N + False + + + Flags + Extra behavioral flags for the connection. See the SQLiteConnectionFlags enumeration for possible values. + N + Default + +
+
+
+ + + The default "stub" (i.e. placeholder) base schema name to use when + returning column schema information. Used as the initial value of + the BaseSchemaName property. This should start with "sqlite_*" + because those names are reserved for use by SQLite (i.e. they cannot + be confused with the names of user objects). + + + + + State of the current connection + + + + + The connection string + + + + + Nesting level of the transactions open on the connection + + + + + The default isolation level for new transactions + + + + + Whether or not the connection is enlisted in a distrubuted transaction + + + + + The base SQLite object to interop with + + + + + The database filename minus path and extension + + + + + Temporary password storage, emptied after the database has been opened + + + + + The "stub" (i.e. placeholder) base schema name to use when returning + column schema information. + + + + + The extra behavioral flags for this connection, if any. See the + SQLiteConnectionFlags enumeration for a list of possible values. + + + + + Default command timeout + + + + + Constructs a new SQLiteConnection object + + + Default constructor + + + + + Initializes the connection with the specified connection string + + The connection string to use on the connection + + + + Clones the settings and connection string from an existing connection. If the existing connection is already open, this + function will open its own connection, enumerate any attached databases of the original connection, and automatically + attach to them. + + + + + + Backs up the database, using the specified database connection as the + destination. + + The destination database connection. + The destination database name. + The source database name. + + The number of pages to copy or negative to copy all remaining pages. + + + The method to invoke between each step of the backup process. This + parameter may be null (i.e. no callbacks will be performed). + + + The number of milliseconds to sleep after encountering a locking error + during the backup process. A value less than zero means that no sleep + should be performed. + + + + + Creates a clone of the connection. All attached databases and user-defined functions are cloned. If the existing connection is open, the cloned connection + will also be opened. + + + + + + Creates a database file. This just creates a zero-byte file which SQLite + will turn into a database when the file is opened properly. + + The file to create + + + + Raises the state change event when the state of the connection changes + + The new state. If it is different from the previous state, an event is raised. + + + + OBSOLETE. Creates a new SQLiteTransaction if one isn't already active on the connection. + + This parameter is ignored. + When TRUE, SQLite defers obtaining a write lock until a write operation is requested. + When FALSE, a writelock is obtained immediately. The default is TRUE, but in a multi-threaded multi-writer + environment, one may instead choose to lock the database immediately to avoid any possible writer deadlock. + Returns a SQLiteTransaction object. + + + + OBSOLETE. Creates a new SQLiteTransaction if one isn't already active on the connection. + + When TRUE, SQLite defers obtaining a write lock until a write operation is requested. + When FALSE, a writelock is obtained immediately. The default is false, but in a multi-threaded multi-writer + environment, one may instead choose to lock the database immediately to avoid any possible writer deadlock. + Returns a SQLiteTransaction object. + + + + Creates a new SQLiteTransaction if one isn't already active on the connection. + + Supported isolation levels are Serializable, ReadCommitted and Unspecified. + + Unspecified will use the default isolation level specified in the connection string. If no isolation level is specified in the + connection string, Serializable is used. + Serializable transactions are the default. In this mode, the engine gets an immediate lock on the database, and no other threads + may begin a transaction. Other threads may read from the database, but not write. + With a ReadCommitted isolation level, locks are deferred and elevated as needed. It is possible for multiple threads to start + a transaction in ReadCommitted mode, but if a thread attempts to commit a transaction while another thread + has a ReadCommitted lock, it may timeout or cause a deadlock on both threads until both threads' CommandTimeout's are reached. + + Returns a SQLiteTransaction object. + + + + Creates a new SQLiteTransaction if one isn't already active on the connection. + + Returns a SQLiteTransaction object. + + + + Forwards to the local BeginTransaction() function + + Supported isolation levels are Unspecified, Serializable, and ReadCommitted + + + + + Not implemented + + + + + + When the database connection is closed, all commands linked to this connection are automatically reset. + + + + + Clears the connection pool associated with the connection. Any other active connections using the same database file + will be discarded instead of returned to the pool when they are closed. + + + + + + Clears all connection pools. Any active connections will be discarded instead of sent to the pool when they are closed. + + + + + Create a new SQLiteCommand and associate it with this connection. + + Returns an instantiated SQLiteCommand object already assigned to this connection. + + + + Forwards to the local CreateCommand() function + + + + + + Parses the connection string into component parts + + The connection string to parse + An array of key-value pairs representing each parameter of the connection string + + + + Manual distributed transaction enlistment support + + The distributed transaction to enlist in + + + + Looks for a key in the array of key/values of the parameter string. If not found, return the specified default value + + The list to look in + The key to find + The default value to return if the key is not found + The value corresponding to the specified key, or the default value if not found. + + + + Opens the connection using the parameters found in the ConnectionString + + + + + Opens the connection using the parameters found in the ConnectionString and then returns it. + + The current connection object. + + + Passes a shutdown request off to SQLite. + + + Enables or disabled extended result codes returned by SQLite + + + Enables or disabled extended result codes returned by SQLite + + + Enables or disabled extended result codes returned by SQLite + + + Add a log message via the SQLite sqlite3_log interface. + + + + Change the password (or assign a password) to an open database. + + + No readers or writers may be active for this process. The database must already be open + and if it already was password protected, the existing password must already have been supplied. + + The new password to assign to the database + + + + Change the password (or assign a password) to an open database. + + + No readers or writers may be active for this process. The database must already be open + and if it already was password protected, the existing password must already have been supplied. + + The new password to assign to the database + + + + Sets the password for a password-protected database. A password-protected database is + unusable for any operation until the password has been set. + + The password for the database + + + + Sets the password for a password-protected database. A password-protected database is + unusable for any operation until the password has been set. + + The password for the database + + + + Queries or modifies the number of retries or the retry interval (in milliseconds) for + certain I/O operations that may fail due to anti-virus software. + + The number of times to retry the I/O operation. A negative value + will cause the current count to be queried and replace that negative value. + The number of milliseconds to wait before retrying the I/O + operation. This number is multiplied by the number of retry attempts so far to come + up with the final number of milliseconds to wait. A negative value will cause the + current interval to be queried and replace that negative value. + Zero for success, non-zero for error. + + + + Expand the filename of the data source, resolving the |DataDirectory| macro as appropriate. + + The database filename to expand + The expanded path and filename of the filename + + + + The following commands are used to extract schema information out of the database. Valid schema types are: + + + MetaDataCollections + + + DataSourceInformation + + + Catalogs + + + Columns + + + ForeignKeys + + + Indexes + + + IndexColumns + + + Tables + + + Views + + + ViewColumns + + + + + Returns the MetaDataCollections schema + + A DataTable of the MetaDataCollections schema + + + + Returns schema information of the specified collection + + The schema collection to retrieve + A DataTable of the specified collection + + + + Retrieves schema information using the specified constraint(s) for the specified collection + + The collection to retrieve + The restrictions to impose + A DataTable of the specified collection + + + + Builds a MetaDataCollections schema datatable + + DataTable + + + + Builds a DataSourceInformation datatable + + DataTable + + + + Build a Columns schema + + The catalog (attached database) to query, can be null + The table to retrieve schema information for, must not be null + The column to retrieve schema information for, can be null + DataTable + + + + Returns index information for the given database and catalog + + The catalog (attached database) to query, can be null + The name of the index to retrieve information for, can be null + The table to retrieve index information for, can be null + DataTable + + + + Retrieves table schema information for the database and catalog + + The catalog (attached database) to retrieve tables on + The table to retrieve, can be null + The table type, can be null + DataTable + + + + Retrieves view schema information for the database + + The catalog (attached database) to retrieve views on + The view name, can be null + DataTable + + + + Retrieves catalog (attached databases) schema information for the database + + The catalog to retrieve, can be null + DataTable + + + + Returns the base column information for indexes in a database + + The catalog to retrieve indexes for (can be null) + The table to restrict index information by (can be null) + The index to restrict index information by (can be null) + The source column to restrict index information by (can be null) + A DataTable containing the results + + + + Returns detailed column information for a specified view + + The catalog to retrieve columns for (can be null) + The view to restrict column information by (can be null) + The source column to restrict column information by (can be null) + A DataTable containing the results + + + + Retrieves foreign key information from the specified set of filters + + An optional catalog to restrict results on + An optional table to restrict results on + An optional foreign key name to restrict results on + A DataTable with the results of the query + + + + This event is raised whenever the database is opened or closed. + + + + + The connection string containing the parameters for the connection + + + + + Parameter + Values + Required + Default + + + Data Source + {filename} + Y + + + + Version + 3 + N + 3 + + + UseUTF16Encoding + True
False
+ N + False +
+ + DateTimeFormat + Ticks - Use DateTime.Ticks
ISO8601 - Use ISO8601 DateTime format
JulianDay - Use JulianDay format
+ N + ISO8601 +
+ + BinaryGUID + Yes/On/1 - Store GUID columns in binary form
No/Off/0 - Store GUID columns as text
+ N + On +
+ + Cache Size + {size in bytes} + N + 2000 + + + Synchronous + Normal - Normal file flushing behavior
Full - Full flushing after all writes
Off - Underlying OS flushes I/O's
+ N + Normal +
+ + Page Size + {size in bytes} + N + 1024 + + + Password + {password} + N + + + + Enlist + Y - Automatically enlist in distributed transactions
N - No automatic enlistment
+ N + Y +
+ + Pooling + True - Use connection pooling
False - Do not use connection pooling
+ N + False +
+ + FailIfMissing + True - Don't create the database if it does not exist, throw an error instead
False - Automatically create the database if it does not exist
+ N + False +
+ + Max Page Count + {size in pages} - Limits the maximum number of pages (limits the size) of the database + N + 0 + + + Legacy Format + True - Use the more compatible legacy 3.x database format
False - Use the newer 3.3x database format which compresses numbers more effectively
+ N + False +
+ + Default Timeout + {time in seconds}
The default command timeout
+ N + 30 +
+ + Journal Mode + Delete - Delete the journal file after a commit
Persist - Zero out and leave the journal file on disk after a commit
Off - Disable the rollback journal entirely
+ N + Delete +
+ + Read Only + True - Open the database for read only access
False - Open the database for normal read/write access
+ N + False +
+ + Max Pool Size + The maximum number of connections for the given connection string that can be in the connection pool + N + 100 + + + Default IsolationLevel + The default transaciton isolation level + N + Serializable + +
+
+
+ + + Returns the filename without extension or path + + + + + Returns the string "main". + + + + + Gets/sets the default command timeout for newly-created commands. This is especially useful for + commands used internally such as inside a SQLiteTransaction, where setting the timeout is not possible. + This can also be set in the ConnectionString with "Default Timeout" + + + + + Gets/sets the extra behavioral flags for this connection. See the + SQLiteConnectionFlags enumeration for a list of possible values. + + + + + Returns the version of the underlying SQLite database engine + + + + + Returns the rowid of the most recent successful INSERT into the database from this connection. + + + + + Returns the number of rows changed by the last INSERT, UPDATE, or DELETE statement executed on + this connection. + + + + + Returns the amount of memory (in bytes) currently in use by the SQLite core library. + + + + + Returns the maximum amount of memory (in bytes) used by the SQLite core library since the high-water mark was last reset. + + + + + Returns the version of the underlying SQLite database engine + + + + + This method returns the string whose value is the same as the + SQLITE_SOURCE_ID C preprocessor macro used when compiling the + SQLite core library. + + + + + Returns the state of the connection. + + + + + This event is raised whenever SQLite makes an update/delete/insert into the database on + this connection. It only applies to the given connection. + + + + + This event is raised whenever SQLite is committing a transaction. + Return non-zero to trigger a rollback + + + + + This event is raised whenever SQLite statement first begins executing on + this connection. It only applies to the given connection. + + + + + This event is raised whenever SQLite is committing a transaction. + Return non-zero to trigger a rollback + + + + + Returns a SQLiteProviderFactory object. + + + + + The I/O file cache flushing behavior for the connection + + + + + Normal file flushing at critical sections of the code + + + + + Full file flushing after every write operation + + + + + Use the default operating system's file flushing, SQLite does not explicitly flush the file buffers after writing + + + + + Raised when a transaction is about to be committed. To roll back a transaction, set the + rollbackTrans boolean value to true. + + The connection committing the transaction + Event arguments on the transaction + + + + Raised when data is inserted, updated and deleted on a given connection + + The connection committing the transaction + The event parameters which triggered the event + + + + Raised when a statement first begins executing on a given connection + + The connection executing the statement + Event arguments of the trace + + + + Raised between each backup step. + + + The source database connection. + + + The source database name. + + + The destination database connection. + + + The destination database name. + + + The number of pages copied with each step. + + + The number of pages remaining to be copied. + + + The total number of pages in the source database. + + + Set to true if the operation needs to be retried due to database + locking issues; otherwise, set to false. + + + True to continue with the backup process or false to halt the backup + process, rolling back any changes that have been made so far. + + + + + Whenever an update event is triggered on a connection, this enum will indicate + exactly what type of operation is being performed. + + + + + A row is being deleted from the given database and table + + + + + A row is being inserted into the table. + + + + + A row is being updated in the table. + + + + + Passed during an Update callback, these event arguments detail the type of update operation being performed + on the given connection. + + + + + The name of the database being updated (usually "main" but can be any attached or temporary database) + + + + + The name of the table being updated + + + + + The type of update being performed (insert/update/delete) + + + + + The RowId affected by this update. + + + + + Event arguments raised when a transaction is being committed + + + + + Set to true to abort the transaction and trigger a rollback + + + + + Passed during an Trace callback, these event arguments contain the UTF-8 rendering of the SQL statement text + + + + + SQL statement text as the statement first begins executing + + + + + The connection pool object + + + + + The default version number new pools will get + + + + + Attempt to pull a pooled connection out of the queue for active duty + + The filename for a desired connection + The maximum size the connection pool for the filename can be + The pool version the returned connection will belong to + Returns NULL if no connections were available. Even if none are, the poolversion will still be a valid pool version + + + + Clears out all pooled connections and rev's up the default pool version to force all old active objects + not in the pool to get discarded rather than returned to their pools. + + + + + Clear a given pool for a given filename. Discards anything in the pool for the given file, and revs the pool + version so current active objects on the old version of the pool will get discarded rather than be returned to the pool. + + The filename of the pool to clear + + + + Return a connection to the pool for someone else to use. + + The filename of the pool to use + The connection handle to pool + The pool version the handle was created under + + If the version numbers don't match between the connection and the pool, then the handle is discarded. + + + + + We don't have to thread-lock anything in this function, because it's only called by other functions above + which already have a thread-safe lock. + + The queue to resize + If a function intends to add to the pool, this is true, which forces the resize + to take one more than it needs from the pool + + + + Keeps track of connections made on a specified file. The PoolVersion dictates whether old objects get + returned to the pool or discarded when no longer in use. + + + + + SQLite implementation of DbConnectionStringBuilder. + + + + + Properties of this class + + + + + Constructs a new instance of the class + + + Default constructor + + + + + Constructs a new instance of the class using the specified connection string. + + The connection string to parse + + + + Private initializer, which assigns the connection string and resets the builder + + The connection string to assign + + + + Helper function for retrieving values from the connectionstring + + The keyword to retrieve settings for + The resulting parameter value + Returns true if the value was found and returned + + + + Fallback method for MONO, which doesn't implement DbConnectionStringBuilder.GetProperties() + + The hashtable to fill with property descriptors + + + + Gets/Sets the default version of the SQLite engine to instantiate. Currently the only valid value is 3, indicating version 3 of the sqlite library. + + + + + Gets/Sets the synchronization mode (file flushing) of the connection string. Default is "Normal". + + + + + Gets/Sets the encoding for the connection string. The default is "False" which indicates UTF-8 encoding. + + + + + Gets/Sets whether or not to use connection pooling. The default is "False" + + + + + Gets/Sets whethor not to store GUID's in binary format. The default is True + which saves space in the database. + + + + + Gets/Sets the filename to open on the connection string. + + + + + An alternate to the data source property + + + + + Gets/sets the default command timeout for newly-created commands. This is especially useful for + commands used internally such as inside a SQLiteTransaction, where setting the timeout is not possible. + + + + + Determines whether or not the connection will automatically participate + in the current distributed transaction (if one exists) + + + + + If set to true, will throw an exception if the database specified in the connection + string does not exist. If false, the database will be created automatically. + + + + + If enabled, uses the legacy 3.xx format for maximum compatibility, but results in larger + database sizes. + + + + + When enabled, the database will be opened for read-only access and writing will be disabled. + + + + + Gets/sets the database encryption password + + + + + Gets/Sets the page size for the connection. + + + + + Gets/Sets the maximum number of pages the database may hold + + + + + Gets/Sets the cache size for the connection. + + + + + Gets/Sets the DateTime format for the connection. + + + + + Gets/Sets the DateTime kind for the connection. + + + + + Gets/Sets the placeholder base schema name used for + .NET Framework compatibility purposes. + + + + + Determines how SQLite handles the transaction journal file. + + + + + Sets the default isolation level for transactions on the connection. + + + + + If enabled, use foreign key constraints + + + + + Gets/Sets the extra behavioral flags. + + + + + SQLite has very limited types, and is inherently text-based. The first 5 types below represent the sum of all types SQLite + understands. The DateTime extension to the spec is for internal use only. + + + + + Not used + + + + + All integers in SQLite default to Int64 + + + + + All floating point numbers in SQLite default to double + + + + + The default data type of SQLite is text + + + + + Typically blob types are only seen when returned from a function + + + + + Null types can be returned from functions + + + + + Used internally by this provider + + + + + Used internally + + + + + This implementation of SQLite for ADO.NET can process date/time fields in databases in only one of three formats. Ticks, ISO8601 + and JulianDay. + + + ISO8601 is more compatible, readable, fully-processable, but less accurate as it doesn't provide time down to fractions of a second. + JulianDay is the numeric format the SQLite uses internally and is arguably the most compatible with 3rd party tools. It is + not readable as text without post-processing. + Ticks less compatible with 3rd party tools that query the database, and renders the DateTime field unreadable as text without post-processing. + + The preferred order of choosing a datetime format is JulianDay, ISO8601, and then Ticks. Ticks is mainly present for legacy + code support. + + + + + Using ticks is not recommended and is not well supported with LINQ. + + + + + The ISO8601 format + + + + + JulianDay format, which is what SQLite uses internally + + + + + The whole number of seconds since the Unix epoch (January 1, 1970). + + + + + Any culture-independent string value that the .NET Framework can interpret as a valid DateTime. + + + + + Any string value that the .NET Framework can interpret as a valid DateTime using the current culture. + + + + + The default format for this provider. + + + + + This enum determines how SQLite treats its journal file. + + + By default SQLite will create and delete the journal file when needed during a transaction. + However, for some computers running certain filesystem monitoring tools, the rapid + creation and deletion of the journal file can cause those programs to fail, or to interfere with SQLite. + + If a program or virus scanner is interfering with SQLite's journal file, you may receive errors like "unable to open database file" + when starting a transaction. If this is happening, you may want to change the default journal mode to Persist. + + + + + The default mode, this causes SQLite to use the existing journaling mode for the database. + + + + + SQLite will create and destroy the journal file as-needed. + + + + + When this is set, SQLite will keep the journal file even after a transaction has completed. It's contents will be erased, + and the journal re-used as often as needed. If it is deleted, it will be recreated the next time it is needed. + + + + + This option disables the rollback journal entirely. Interrupted transactions or a program crash can cause database + corruption in this mode! + + + + + SQLite will truncate the journal file to zero-length instead of deleting it. + + + + + SQLite will store the journal in volatile RAM. This saves disk I/O but at the expense of database safety and integrity. + If the application using SQLite crashes in the middle of a transaction when the MEMORY journaling mode is set, then the + database file will very likely go corrupt. + + + + + SQLite uses a write-ahead log instead of a rollback journal to implement transactions. The WAL journaling mode is persistent; + after being set it stays in effect across multiple database connections and after closing and reopening the database. A database + in WAL journaling mode can only be accessed by SQLite version 3.7.0 or later. + + + + + Struct used internally to determine the datatype of a column in a resultset + + + + + The DbType of the column, or DbType.Object if it cannot be determined + + + + + The affinity of a column, used for expressions or when Type is DbType.Object + + + + + SQLite implementation of DbDataAdapter. + + + + + This class is just a shell around the DbDataAdapter. Nothing from DbDataAdapter is overridden here, just a few constructors are defined. + + + Default constructor. + + + + + Constructs a data adapter using the specified select command. + + The select command to associate with the adapter. + + + + Constructs a data adapter with the supplied select command text and associated with the specified connection. + + The select command text to associate with the data adapter. + The connection to associate with the select command. + + + + Constructs a data adapter with the specified select command text, and using the specified database connection string. + + The select command text to use to construct a select command. + A connection string suitable for passing to a new SQLiteConnection, which is associated with the select command. + + + + Raised by the underlying DbDataAdapter when a row is being updated + + The event's specifics + + + + Raised by DbDataAdapter after a row is updated + + The event's specifics + + + + Row updating event handler + + + + + Row updated event handler + + + + + Gets/sets the select command for this DataAdapter + + + + + Gets/sets the insert command for this DataAdapter + + + + + Gets/sets the update command for this DataAdapter + + + + + Gets/sets the delete command for this DataAdapter + + + + + SQLite implementation of DbDataReader. + + + + + Underlying command this reader is attached to + + + + + Index of the current statement in the command being processed + + + + + Current statement being Read() + + + + + State of the current statement being processed. + -1 = First Step() executed, so the first Read() will be ignored + 0 = Actively reading + 1 = Finished reading + 2 = Non-row-returning statement, no records + + + + + Number of records affected by the insert/update statements executed on the command + + + + + Count of fields (columns) in the row-returning statement currently being processed + + + + + Datatypes of active fields (columns) in the current statement, used for type-restricting data + + + + + The behavior of the datareader + + + + + If set, then dispose of the command object when the reader is finished + + + + + If set, then raise an exception when the object is accessed after being disposed. + + + + + An array of rowid's for the active statement if CommandBehavior.KeyInfo is specified + + + + + Matches the version of the connection. + + + + + The "stub" (i.e. placeholder) base schema name to use when returning + column schema information. Matches the base schema name used by the + associated connection. + + + + + Internal constructor, initializes the datareader and sets up to begin executing statements + + The SQLiteCommand this data reader is for + The expected behavior of the data reader + + + + Dispose of all resources used by this datareader. + + + + + + Closes the datareader, potentially closing the connection as well if CommandBehavior.CloseConnection was specified. + + + + + Throw an error if the datareader is closed + + + + + Throw an error if a row is not loaded + + + + + Enumerator support + + Returns a DbEnumerator object. + + + + SQLite is inherently un-typed. All datatypes in SQLite are natively strings. The definition of the columns of a table + and the affinity of returned types are all we have to go on to type-restrict data in the reader. + + This function attempts to verify that the type of data being requested of a column matches the datatype of the column. In + the case of columns that are not backed into a table definition, we attempt to match up the affinity of a column (int, double, string or blob) + to a set of known types that closely match that affinity. It's not an exact science, but its the best we can do. + + + This function throws an InvalidTypeCast() exception if the requested type doesn't match the column's definition or affinity. + + The index of the column to type-check + The type we want to get out of the column + + + + Retrieves the column as a boolean value + + The index of the column to retrieve + bool + + + + Retrieves the column as a single byte value + + The index of the column to retrieve + byte + + + + Retrieves a column as an array of bytes (blob) + + The index of the column to retrieve + The zero-based index of where to begin reading the data + The buffer to write the bytes into + The zero-based index of where to begin writing into the array + The number of bytes to retrieve + The actual number of bytes written into the array + + To determine the number of bytes in the column, pass a null value for the buffer. The total length will be returned. + + + + + Returns the column as a single character + + The index of the column to retrieve + char + + + + Retrieves a column as an array of chars (blob) + + The index of the column to retrieve + The zero-based index of where to begin reading the data + The buffer to write the characters into + The zero-based index of where to begin writing into the array + The number of bytes to retrieve + The actual number of characters written into the array + + To determine the number of characters in the column, pass a null value for the buffer. The total length will be returned. + + + + + Retrieves the name of the back-end datatype of the column + + The index of the column to retrieve + string + + + + Retrieve the column as a date/time value + + The index of the column to retrieve + DateTime + + + + Retrieve the column as a decimal value + + The index of the column to retrieve + decimal + + + + Returns the column as a double + + The index of the column to retrieve + double + + + + Returns the .NET type of a given column + + The index of the column to retrieve + Type + + + + Returns a column as a float value + + The index of the column to retrieve + float + + + + Returns the column as a Guid + + The index of the column to retrieve + Guid + + + + Returns the column as a short + + The index of the column to retrieve + Int16 + + + + Retrieves the column as an int + + The index of the column to retrieve + Int32 + + + + Retrieves the column as a long + + The index of the column to retrieve + Int64 + + + + Retrieves the name of the column + + The index of the column to retrieve + string + + + + Retrieves the i of a column, given its name + + The name of the column to retrieve + The int i of the column + + + + Schema information in SQLite is difficult to map into .NET conventions, so a lot of work must be done + to gather the necessary information so it can be represented in an ADO.NET manner. + + Returns a DataTable containing the schema information for the active SELECT statement being processed. + + + + Retrieves the column as a string + + The index of the column to retrieve + string + + + + Retrieves the column as an object corresponding to the underlying datatype of the column + + The index of the column to retrieve + object + + + + Retreives the values of multiple columns, up to the size of the supplied array + + The array to fill with values from the columns in the current resultset + The number of columns retrieved + + + + Returns a collection containing all the column names and values for the + current row of data in the current resultset, if any. If there is no + current row or no current resultset, an exception may be thrown. + + + The collection containing the column name and value information for the + current row of data in the current resultset or null if this information + cannot be obtained. + + + + + Returns True if the specified column is null + + The index of the column to retrieve + True or False + + + + Moves to the next resultset in multiple row-returning SQL command. + + True if the command was successful and a new resultset is available, False otherwise. + + + + Retrieves the SQLiteType for a given column, and caches it to avoid repetetive interop calls. + + The index of the column to retrieve + A SQLiteType structure + + + + Reads the next row from the resultset + + True if a new row was successfully loaded and is ready for processing + + + + Not implemented. Returns 0 + + + + + Returns the number of columns in the current resultset + + + + + Returns the number of visible fields in the current resultset + + + + + Returns True if the resultset has rows that can be fetched + + + + + Returns True if the data reader is closed + + + + + Retrieve the count of records affected by an update/insert command. Only valid once the data reader is closed! + + + + + Indexer to retrieve data from a column given its name + + The name of the column to retrieve data for + The value contained in the column + + + + Indexer to retrieve data from a column given its i + + The index of the column to retrieve + The value contained in the column + + + + SQLite exception class. + + + + + Public constructor for generating a SQLite error given the base error code + + The SQLite error code to report + Extra text to go along with the error message text + + + + Various public constructors that just pass along to the base Exception + + Passed verbatim to Exception + + + + Various public constructors that just pass along to the base Exception + + + + + Various public constructors that just pass along to the base Exception + Passed to Exception + Passed to Exception + + + + + Initializes the exception class with the SQLite error code. + + The SQLite error code + A detailed error message + An error message string + + + + Retrieves the underlying SQLite error code for this exception + + + + + SQLite error codes + + + + + Success + + + + + SQL error or missing database + + + + + Internal logic error in SQLite + + + + + Access permission denied + + + + + Callback routine requested an abort + + + + + The database file is locked + + + + + A table in the database is locked + + + + + malloc() failed + + + + + Attempt to write a read-only database + + + + + Operation terminated by sqlite3_interrupt() + + + + + Some kind of disk I/O error occurred + + + + + The database disk image is malformed + + + + + Table or record not found + + + + + Insertion failed because database is full + + + + + Unable to open the database file + + + + + Database lock protocol error + + + + + Database is empty + + + + + The database schema changed + + + + + Too much data for one row of a table + + + + + Abort due to constraint violation + + + + + Data type mismatch + + + + + Library used incorrectly + + + + + Uses OS features not supported on host + + + + + Authorization denied + + + + + Auxiliary database format error + + + + + 2nd parameter to sqlite3_bind out of range + + + + + File opened that is not a database file + + + + + sqlite3_step() has another row ready + + + + + sqlite3_step() has finished executing + + + + + SQLite implementation of DbProviderFactory. + + + SQLite implementation of DbProviderFactory. + + + + + Constructs a new SQLiteFactory object + + + Default constructor + + + + + Static instance member which returns an instanced SQLiteFactory class. + + + + + Returns a new SQLiteCommand object. + + A SQLiteCommand object. + + + + Returns a new SQLiteCommandBuilder object. + + A SQLiteCommandBuilder object. + + + + Creates a new SQLiteConnection. + + A SQLiteConnection object. + + + + Creates a new SQLiteConnectionStringBuilder. + + A SQLiteConnectionStringBuilder object. + + + + Creates a new SQLiteDataAdapter. + + A SQLiteDataAdapter object. + + + + Creates a new SQLiteParameter. + + A SQLiteParameter object. + + + + Will provide a DbProviderServices object in .NET 3.5 + + The class or interface type to query for + + + + + This event is raised whenever SQLite raises a logging event. + Note that this should be set as one of the first things in the + application. This event is provided for backward compatibility only. + New code should use the SQLiteLog class instead. + + + + + This abstract class is designed to handle user-defined functions easily. An instance of the derived class is made for each + connection to the database. + + + Although there is one instance of a class derived from SQLiteFunction per database connection, the derived class has no access + to the underlying connection. This is necessary to deter implementers from thinking it would be a good idea to make database + calls during processing. + + It is important to distinguish between a per-connection instance, and a per-SQL statement context. One instance of this class + services all SQL statements being stepped through on that connection, and there can be many. One should never store per-statement + information in member variables of user-defined function classes. + + For aggregate functions, always create and store your per-statement data in the contextData object on the 1st step. This data will + be automatically freed for you (and Dispose() called if the item supports IDisposable) when the statement completes. + + + + + The error code used for logging exceptions caught in user-provided + code. + + + + + The base connection this function is attached to + + + + + Internal array used to keep track of aggregate function context data + + + + + The connection flags associated with this object (this should be the + same value as the flags associated with the parent connection object). + + + + + Holds a reference to the callback function for user functions + + + + + Holds a reference to the callbakc function for stepping in an aggregate function + + + + + Holds a reference to the callback function for finalizing an aggregate function + + + + + Holds a reference to the callback function for collation sequences + + + + + Current context of the current callback. Only valid during a callback + + + + + This static list contains all the user-defined functions declared using the proper attributes. + + + + + Internal constructor, initializes the function's internal variables. + + + + + Disposes of any active contextData variables that were not automatically cleaned up. Sometimes this can happen if + someone closes the connection while a DataReader is open. + + + + + Placeholder for a user-defined disposal routine + + True if the object is being disposed explicitly + + + + Scalar functions override this method to do their magic. + + + Parameters passed to functions have only an affinity for a certain data type, there is no underlying schema available + to force them into a certain type. Therefore the only types you will ever see as parameters are + DBNull.Value, Int64, Double, String or byte[] array. + + The arguments for the command to process + You may return most simple types as a return value, null or DBNull.Value to return null, DateTime, or + you may return an Exception-derived class if you wish to return an error to SQLite. Do not actually throw the error, + just return it! + + + + Aggregate functions override this method to do their magic. + + + Typically you'll be updating whatever you've placed in the contextData field and returning as quickly as possible. + + The arguments for the command to process + The 1-based step number. This is incrememted each time the step method is called. + A placeholder for implementers to store contextual data pertaining to the current context. + + + + Aggregate functions override this method to finish their aggregate processing. + + + If you implemented your aggregate function properly, + you've been recording and keeping track of your data in the contextData object provided, and now at this stage you should have + all the information you need in there to figure out what to return. + NOTE: It is possible to arrive here without receiving a previous call to Step(), in which case the contextData will + be null. This can happen when no rows were returned. You can either return null, or 0 or some other custom return value + if that is the case. + + Your own assigned contextData, provided for you so you can return your final results. + You may return most simple types as a return value, null or DBNull.Value to return null, DateTime, or + you may return an Exception-derived class if you wish to return an error to SQLite. Do not actually throw the error, + just return it! + + + + + User-defined collation sequences override this method to provide a custom string sorting algorithm. + + The first string to compare + The second strnig to compare + 1 if param1 is greater than param2, 0 if they are equal, or -1 if param1 is less than param2 + + + + Converts an IntPtr array of context arguments to an object array containing the resolved parameters the pointers point to. + + + Parameters passed to functions have only an affinity for a certain data type, there is no underlying schema available + to force them into a certain type. Therefore the only types you will ever see as parameters are + DBNull.Value, Int64, Double, String or byte[] array. + + The number of arguments + A pointer to the array of arguments + An object array of the arguments once they've been converted to .NET values + + + + Takes the return value from Invoke() and Final() and figures out how to return it to SQLite's context. + + The context the return value applies to + The parameter to return to SQLite + + + + Internal scalar callback function, which wraps the raw context pointer and calls the virtual Invoke() method. + WARNING: Must not throw exceptions. + + A raw context pointer + Number of arguments passed in + A pointer to the array of arguments + + + + Internal collation sequence function, which wraps up the raw string pointers and executes the Compare() virtual function. + WARNING: Must not throw exceptions. + + Not used + Length of the string pv1 + Pointer to the first string to compare + Length of the string pv2 + Pointer to the second string to compare + Returns -1 if the first string is less than the second. 0 if they are equal, or 1 if the first string is greater + than the second. Returns 0 if an exception is caught. + + + + Internal collation sequence function, which wraps up the raw string pointers and executes the Compare() virtual function. + WARNING: Must not throw exceptions. + + Not used + Length of the string pv1 + Pointer to the first string to compare + Length of the string pv2 + Pointer to the second string to compare + Returns -1 if the first string is less than the second. 0 if they are equal, or 1 if the first string is greater + than the second. Returns 0 if an exception is caught. + + + + The internal aggregate Step function callback, which wraps the raw context pointer and calls the virtual Step() method. + WARNING: Must not throw exceptions. + + + This function takes care of doing the lookups and getting the important information put together to call the Step() function. + That includes pulling out the user's contextData and updating it after the call is made. We use a sorted list for this so + binary searches can be done to find the data. + + A raw context pointer + Number of arguments passed in + A pointer to the array of arguments + + + + An internal aggregate Final function callback, which wraps the context pointer and calls the virtual Final() method. + WARNING: Must not throw exceptions. + + A raw context pointer + + + + Using reflection, enumerate all assemblies in the current appdomain looking for classes that + have a SQLiteFunctionAttribute attribute, and registering them accordingly. + + + + + Manual method of registering a function. The type must still have the SQLiteFunctionAttributes in order to work + properly, but this is a workaround for the Compact Framework where enumerating assemblies is not currently supported. + + The type of the function to register + + + + Called by SQLiteBase derived classes, this function binds all user-defined functions to a connection. + It is done this way so that all user-defined functions will access the database using the same encoding scheme + as the connection (UTF-8 or UTF-16). + + + The wrapper functions that interop with SQLite will create a unique cookie value, which internally is a pointer to + all the wrapped callback functions. The interop function uses it to map CDecl callbacks to StdCall callbacks. + + The base object on which the functions are to bind + The flags associated with the parent connection object + Returns an array of functions which the connection object should retain until the connection is closed. + + + + Returns a reference to the underlying connection's SQLiteConvert class, which can be used to convert + strings and DateTime's into the current connection's encoding schema. + + + + + Extends SQLiteFunction and allows an inherited class to obtain the collating sequence associated with a function call. + + + User-defined functions can call the GetCollationSequence() method in this class and use it to compare strings and char arrays. + + + + + Obtains the collating sequence in effect for the given function. + + + + + + The type of user-defined function to declare + + + + + Scalar functions are designed to be called and return a result immediately. Examples include ABS(), Upper(), Lower(), etc. + + + + + Aggregate functions are designed to accumulate data until the end of a call and then return a result gleaned from the accumulated data. + Examples include SUM(), COUNT(), AVG(), etc. + + + + + Collation sequences are used to sort textual data in a custom manner, and appear in an ORDER BY clause. Typically text in an ORDER BY is + sorted using a straight case-insensitive comparison function. Custom collating sequences can be used to alter the behavior of text sorting + in a user-defined manner. + + + + + An internal callback delegate declaration. + + Raw context pointer for the user function + Count of arguments to the function + A pointer to the array of argument pointers + + + + An internal final callback delegate declaration. + + Raw context pointer for the user function + + + + Internal callback delegate for implementing collation sequences + + Not used + Length of the string pv1 + Pointer to the first string to compare + Length of the string pv2 + Pointer to the second string to compare + Returns -1 if the first string is less than the second. 0 if they are equal, or 1 if the first string is greater + than the second. + + + + The type of collating sequence + + + + + The built-in BINARY collating sequence + + + + + The built-in NOCASE collating sequence + + + + + The built-in REVERSE collating sequence + + + + + A custom user-defined collating sequence + + + + + The encoding type the collation sequence uses + + + + + The collation sequence is UTF8 + + + + + The collation sequence is UTF16 little-endian + + + + + The collation sequence is UTF16 big-endian + + + + + A struct describing the collating sequence a function is executing in + + + + + The name of the collating sequence + + + + + The type of collating sequence + + + + + The text encoding of the collation sequence + + + + + Context of the function that requested the collating sequence + + + + + Calls the base collating sequence to compare two strings + + The first string to compare + The second string to compare + -1 if s1 is less than s2, 0 if s1 is equal to s2, and 1 if s1 is greater than s2 + + + + Calls the base collating sequence to compare two character arrays + + The first array to compare + The second array to compare + -1 if c1 is less than c2, 0 if c1 is equal to c2, and 1 if c1 is greater than c2 + + + + A simple custom attribute to enable us to easily find user-defined functions in + the loaded assemblies and initialize them in SQLite as connections are made. + + + + + Default constructor, initializes the internal variables for the function. + + + + + The function's name as it will be used in SQLite command text. + + + + + The number of arguments this function expects. -1 if the number of arguments is variable. + + + + + The type of function this implementation will be. + + + + + This class provides key info for a given SQLite statement. + + Providing key information for a given statement is non-trivial :( + + + + + + This function does all the nasty work at determining what keys need to be returned for + a given statement. + + + + + + + + Make sure all the subqueries are open and ready and sync'd with the current rowid + of the table they're supporting + + + + + Release any readers on any subqueries + + + + + Append all the columns we've added to the original query to the schema + + + + + + How many additional columns of keyinfo we're holding + + + + + Used to support CommandBehavior.KeyInfo + + + + + A single sub-query for a given table/database. + + + + + Passed during an Log callback + + + + + The error code. + + + + + SQL statement text as the statement first begins executing + + + + + Extra data associated with this event, if any. + + + + + Constructs the LogEventArgs object. + + Should be null. + The SQLite error code. + The error message, if any. + The extra data, if any. + + + + Raised when a log event occurs. + + The current connection + Event arguments of the trace + + + + Manages the SQLite custom logging functionality and the associated + callback for the whole process. + + + + + Object used to synchronize access to the static instance data + for this class. + + + + + Member variable to store the AppDomain.DomainUnload event handler. + + + + + The default log event handler. + + + + + The log callback passed to native SQLite engine. This must live + as long as the SQLite library has a pointer to it. + + + + + The base SQLite object to interop with. + + + + + This will be non-zero if logging is currently enabled. + + + + + Initializes the SQLite logging facilities. + + + + + Handles the AppDomain being unloaded. + + + + + + + Log a message to all the registered log event handlers without going + through the SQLite library. + + The error code or zero for success. + The message to be logged. + + + + Creates and initializes the default log event handler. + + + + + Adds the default log event handler to the list of handlers. + + + + + Removes the default log event handler from the list of handlers. + + + + + Internal proxy function that calls any registered application log + event handlers. + + + + + Default logger. Currently, uses the Trace class (i.e. sends events + to the current trace listeners, if any). + + Should be null. + The data associated with this event. + + + + Member variable to store the application log handler to call. + + + + + This event is raised whenever SQLite raises a logging event. + Note that this should be set as one of the first things in the + application. + + + + + If this property is true, logging is enabled; otherwise, logging is + disabled. When logging is disabled, no logging events will fire. + + + + + MetaDataCollections specific to SQLite + + + + + Returns a list of databases attached to the connection + + + + + Returns column information for the specified table + + + + + Returns index information for the optionally-specified table + + + + + Returns base columns for the given index + + + + + Returns the tables in the given catalog + + + + + Returns user-defined views in the given catalog + + + + + Returns underlying column information on the given view + + + + + Returns foreign key information for the given catalog + + + + + Returns the triggers on the database + + + + + SQLite implementation of DbParameter. + + + + + The data type of the parameter + + + + + The version information for mapping the parameter + + + + + The value of the data in the parameter + + + + + The source column for the parameter + + + + + The column name + + + + + The data size, unused by SQLite + + + + + Default constructor + + + + + Constructs a named parameter given the specified parameter name + + The parameter name + + + + Constructs a named parameter given the specified parameter name and initial value + + The parameter name + The initial value of the parameter + + + + Constructs a named parameter of the specified type + + The parameter name + The datatype of the parameter + + + + Constructs a named parameter of the specified type and source column reference + + The parameter name + The data type + The source column + + + + Constructs a named parameter of the specified type, source column and row version + + The parameter name + The data type + The source column + The row version information + + + + Constructs an unnamed parameter of the specified data type + + The datatype of the parameter + + + + Constructs an unnamed parameter of the specified data type and sets the initial value + + The datatype of the parameter + The initial value of the parameter + + + + Constructs an unnamed parameter of the specified data type and source column + + The datatype of the parameter + The source column + + + + Constructs an unnamed parameter of the specified data type, source column and row version + + The data type + The source column + The row version information + + + + Constructs a named parameter of the specified type and size + + The parameter name + The data type + The size of the parameter + + + + Constructs a named parameter of the specified type, size and source column + + The name of the parameter + The data type + The size of the parameter + The source column + + + + Constructs a named parameter of the specified type, size, source column and row version + + The name of the parameter + The data type + The size of the parameter + The source column + The row version information + + + + Constructs a named parameter of the specified type, size, source column and row version + + The name of the parameter + The data type + The size of the parameter + Only input parameters are supported in SQLite + Ignored + Ignored + Ignored + The source column + The row version information + The initial value to assign the parameter + + + + Constructs a named parameter, yet another flavor + + The name of the parameter + The data type + The size of the parameter + Only input parameters are supported in SQLite + Ignored + Ignored + The source column + The row version information + Whether or not this parameter is for comparing NULL's + The intial value to assign the parameter + + + + Constructs an unnamed parameter of the specified type and size + + The data type + The size of the parameter + + + + Constructs an unnamed parameter of the specified type, size, and source column + + The data type + The size of the parameter + The source column + + + + Constructs an unnamed parameter of the specified type, size, source column and row version + + The data type + The size of the parameter + The source column + The row version information + + + + Resets the DbType of the parameter so it can be inferred from the value + + + + + Clones a parameter + + A new, unassociated SQLiteParameter + + + + Whether or not the parameter can contain a null value + + + + + Returns the datatype of the parameter + + + + + Supports only input parameters + + + + + Returns the parameter name + + + + + Returns the size of the parameter + + + + + Gets/sets the source column + + + + + Used by DbCommandBuilder to determine the mapping for nullable fields + + + + + Gets and sets the row version + + + + + Gets and sets the parameter value. If no datatype was specified, the datatype will assume the type from the value given. + + + + + SQLite implementation of DbParameterCollection. + + + + + The underlying command to which this collection belongs + + + + + The internal array of parameters in this collection + + + + + Determines whether or not all parameters have been bound to their statement(s) + + + + + Initializes the collection + + The command to which the collection belongs + + + + Retrieves an enumerator for the collection + + An enumerator for the underlying array + + + + Adds a parameter to the collection + + The parameter name + The data type + The size of the value + The source column + A SQLiteParameter object + + + + Adds a parameter to the collection + + The parameter name + The data type + The size of the value + A SQLiteParameter object + + + + Adds a parameter to the collection + + The parameter name + The data type + A SQLiteParameter object + + + + Adds a parameter to the collection + + The parameter to add + A zero-based index of where the parameter is located in the array + + + + Adds a parameter to the collection + + The parameter to add + A zero-based index of where the parameter is located in the array + + + + Adds a named/unnamed parameter and its value to the parameter collection. + + Name of the parameter, or null to indicate an unnamed parameter + The initial value of the parameter + Returns the SQLiteParameter object created during the call. + + + + Adds an array of parameters to the collection + + The array of parameters to add + + + + Adds an array of parameters to the collection + + The array of parameters to add + + + + Clears the array and resets the collection + + + + + Determines if the named parameter exists in the collection + + The name of the parameter to check + True if the parameter is in the collection + + + + Determines if the parameter exists in the collection + + The SQLiteParameter to check + True if the parameter is in the collection + + + + Not implemented + + + + + + + Retrieve a parameter by name from the collection + + The name of the parameter to fetch + A DbParameter object + + + + Retrieves a parameter by its index in the collection + + The index of the parameter to retrieve + A DbParameter object + + + + Returns the index of a parameter given its name + + The name of the parameter to find + -1 if not found, otherwise a zero-based index of the parameter + + + + Returns the index of a parameter + + The parameter to find + -1 if not found, otherwise a zero-based index of the parameter + + + + Inserts a parameter into the array at the specified location + + The zero-based index to insert the parameter at + The parameter to insert + + + + Removes a parameter from the collection + + The parameter to remove + + + + Removes a parameter from the collection given its name + + The name of the parameter to remove + + + + Removes a parameter from the collection given its index + + The zero-based parameter index to remove + + + + Re-assign the named parameter to a new parameter object + + The name of the parameter to replace + The new parameter + + + + Re-assign a parameter at the specified index + + The zero-based index of the parameter to replace + The new parameter + + + + Un-binds all parameters from their statements + + + + + This function attempts to map all parameters in the collection to all statements in a Command. + Since named parameters may span multiple statements, this function makes sure all statements are bound + to the same named parameter. Unnamed parameters are bound in sequence. + + + + + Returns true + + + + + Returns false + + + + + Returns false + + + + + Returns null + + + + + Returns a count of parameters in the collection + + + + + Overloaded to specialize the return value of the default indexer + + Name of the parameter to get/set + The specified named SQLite parameter + + + + Overloaded to specialize the return value of the default indexer + + The index of the parameter to get/set + The specified SQLite parameter + + + + Represents a single SQL statement in SQLite. + + + + + The underlying SQLite object this statement is bound to + + + + + The command text of this SQL statement + + + + + The actual statement pointer + + + + + An index from which unnamed parameters begin + + + + + Names of the parameters as SQLite understands them to be + + + + + Parameters for this statement + + + + + Command this statement belongs to (if any) + + + + + The flags associated with the parent connection object. + + + + + Initializes the statement and attempts to get all information about parameters in the statement + + The base SQLite object + The flags associated with the parent connection object + The statement + The command text for this statement + The previous command in a multi-statement command + + + + Disposes and finalizes the statement + + + + + Called by SQLiteParameterCollection, this function determines if the specified parameter name belongs to + this statement, and if so, keeps a reference to the parameter so it can be bound later. + + The parameter name to map + The parameter to assign it + + + + Bind all parameters, making sure the caller didn't miss any + + + + + Attempts to convert an arbitrary object to the Boolean data type. + Null object values are converted to false. Throws a SQLiteException + upon failure. + + The object value to convert. + The format provider to use. + The converted boolean value. + + + + Perform the bind operation for an individual parameter + + The index of the parameter to bind + The parameter we're binding + + + + SQLite implementation of DbTransaction. + + + + + The connection to which this transaction is bound + + + + + Constructs the transaction object, binding it to the supplied connection + + The connection to open a transaction on + TRUE to defer the writelock, or FALSE to lock immediately + + + + Disposes the transaction. If it is currently active, any changes are rolled back. + + + + + Commits the current transaction. + + + + + Rolls back the active transaction. + + + + + Returns the underlying connection to which this transaction applies. + + + + + Forwards to the local Connection property + + + + + Gets the isolation level of the transaction. SQLite only supports Serializable transactions. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to <?xml version="1.0" standalone="yes"?> + <DocumentElement> + <DataTypes> + <TypeName>smallint</TypeName> + <ProviderDbType>10</ProviderDbType> + <ColumnSize>5</ColumnSize> + <DataType>System.Int16</DataType> + <CreateFormat>smallint</CreateFormat> + <IsAutoIncrementable>false</IsAutoIncrementable> + <IsCaseSensitive>false</IsCaseSensitive> + <IsFixedLength>true</IsFixedLength> + <IsFixedPrecisionScale>true</IsFixedPrecisionScale> + <IsLong>false</IsLong> + <IsNullable>true</ [rest of string was truncated]";. + + + + + Looks up a localized string similar to ALL,ALTER,AND,AS,AUTOINCREMENT,BETWEEN,BY,CASE,CHECK,COLLATE,COMMIT,CONSTRAINT,CREATE,CROSS,DEFAULT,DEFERRABLE,DELETE,DISTINCT,DROP,ELSE,ESCAPE,EXCEPT,FOREIGN,FROM,FULL,GROUP,HAVING,IN,INDEX,INNER,INSERT,INTERSECT,INTO,IS,ISNULL,JOIN,LEFT,LIMIT,NATURAL,NOT,NOTNULL,NULL,ON,OR,ORDER,OUTER,PRIMARY,REFERENCES,RIGHT,ROLLBACK,SELECT,SET,TABLE,THEN,TO,TRANSACTION,UNION,UNIQUE,UPDATE,USING,VALUES,WHEN,WHERE. + + + + + Looks up a localized string similar to <?xml version="1.0" encoding="utf-8" ?> + <DocumentElement> + <MetaDataCollections> + <CollectionName>MetaDataCollections</CollectionName> + <NumberOfRestrictions>0</NumberOfRestrictions> + <NumberOfIdentifierParts>0</NumberOfIdentifierParts> + </MetaDataCollections> + <MetaDataCollections> + <CollectionName>DataSourceInformation</CollectionName> + <NumberOfRestrictions>0</NumberOfRestrictions> + <NumberOfIdentifierParts>0</NumberOfIdentifierParts> + </MetaDataCollections> + <MetaDataC [rest of string was truncated]";. + + + + + The name of the environment variable containing the processor + architecture of the current process. + + + + + This is the P/Invoke method that wraps the native Win32 LoadLibrary + function. See the MSDN documentation for full details on what it + does. + + + The name of the executable library. + + + The native module handle upon success -OR- IntPtr.Zero on failure. + + + + + This lock is used to protect the static _SQLiteModule and + processorArchitecturePlatforms fields, below. + + + + + Stores the mappings between processor architecture names and platform + names. + + + + + The native module handle for the native SQLite library or the value + IntPtr.Zero. + + + + + For now, this method simply calls the Initialize method. + + + + + Attempts to initialize this class by pre-loading the native SQLite + library for the processor architecture of the current process. + + + + + Queries and returns the base directory of the current application + domain. + + + The base directory for the current application domain -OR- null if it + cannot be determined. + + + + + Determines if the dynamic link library file name requires a suffix + and adds it if necessary. + + + The original dynamic link library file name to inspect. + + + The dynamic link library file name, possibly modified to include an + extension. + + + + + Queries and returns the processor architecture of the current + process. + + + The processor architecture of the current process -OR- null if it + cannot be determined. Always returns an empty string when running on + the .NET Compact Framework. + + + + + Given the processor architecture, returns the name of the platform. + + + The processor architecture to be translated to a platform name. + + + The platform name for the specified processor architecture -OR- null + if it cannot be determined. + + + + + Attempts to load the native SQLite library based on the specified + directory and processor architecture. + + + The base directory to use, null for default (the base directory of + the current application domain). This directory should contain the + processor architecture specific sub-directories. + + + The requested processor architecture, null for default (the + processor architecture of the current process). This caller should + almost always specify null for this parameter. + + + The native module handle as returned by LoadLibrary -OR- IntPtr.Zero + if the loading fails for any reason. + + +
+
diff --git a/docs/Client 0000 00 01 00 00 00 00 ...... Server - Pastebin.com.url b/docs/Client 0000 00 01 00 00 00 00 ...... Server - Pastebin.com.url deleted file mode 100644 index ac166c8b..00000000 --- a/docs/Client 0000 00 01 00 00 00 00 ...... Server - Pastebin.com.url +++ /dev/null @@ -1,2 +0,0 @@ -[InternetShortcut] -URL=http://pastebin.com/iXNsKUPG diff --git a/docs/char create.url b/docs/char create.url deleted file mode 100644 index 1fe3c5cc..00000000 --- a/docs/char create.url +++ /dev/null @@ -1,2 +0,0 @@ -[InternetShortcut] -URL=http://pastie.org/2542427 diff --git a/docs/char screen log.url b/docs/char screen log.url deleted file mode 100644 index 57d75d20..00000000 --- a/docs/char screen log.url +++ /dev/null @@ -1,2 +0,0 @@ -[InternetShortcut] -URL=http://pastie.org/2540760 diff --git a/docs/codeweaver-proto - GitHub.url b/docs/codeweaver-proto - GitHub.url deleted file mode 100644 index 951c2019..00000000 --- a/docs/codeweaver-proto - GitHub.url +++ /dev/null @@ -1,2 +0,0 @@ -[InternetShortcut] -URL=https://github.com/codeweaver/proto diff --git a/docs/create toon.url b/docs/create toon.url deleted file mode 100644 index 88e8366e..00000000 --- a/docs/create toon.url +++ /dev/null @@ -1,2 +0,0 @@ -[InternetShortcut] -URL=http://paste2.org/p/1654169 diff --git a/docs/d3-shourtcut.txt b/docs/d3-shourtcut.txt deleted file mode 100644 index d779d4dc..00000000 --- a/docs/d3-shourtcut.txt +++ /dev/null @@ -1,16 +0,0 @@ -"F:\Diablo III Beta\Diablo III.exe" -launch -auroraaddress 127.0.0.1:1345 - - client parameters: - -auroraadress - -vetsion - -w - -version* - -launch - -battlenetaddress - -battlenetmatchmakingaddress - -test - -perftestfilter - -perftestwaittime - -perftestsampletime - -perftestdumpfreq - -perftestformat \ No newline at end of file diff --git a/docs/header analyzer output.url b/docs/header analyzer output.url deleted file mode 100644 index b68fbe6f..00000000 --- a/docs/header analyzer output.url +++ /dev/null @@ -1,2 +0,0 @@ -[InternetShortcut] -URL=http://privatepaste.com/aacee0e0dc diff --git a/docs/header-analyzer.url b/docs/header-analyzer.url deleted file mode 100644 index 72933273..00000000 --- a/docs/header-analyzer.url +++ /dev/null @@ -1,2 +0,0 @@ -[InternetShortcut] -URL=http://privatepaste.com/54b28f5506 diff --git a/docs/header.consumer.txt b/docs/header.consumer.txt deleted file mode 100644 index 05434f5a..00000000 --- a/docs/header.consumer.txt +++ /dev/null @@ -1 +0,0 @@ -3CD1AFDA \ No newline at end of file diff --git a/docs/header.txt b/docs/header.txt deleted file mode 100644 index 87b9f8ef..00000000 --- a/docs/header.txt +++ /dev/null @@ -1,50 +0,0 @@ - btw scriptor - u working on c# - ? - yes - oh - we too - nice ^^ - how far ahead u r? - i received the bind requests after logonresponse but i switched to moduleloadrequest - http://80.86.81.60:8080/bin/Debug/Log/ - u sent the moduleloadrequest it seems - yes - can i get some help from u on header decompisiton? - pb.CodedInputStream s = pb.CodedInputStream.CreateInstance(bytes); - service = s.ReadRawByte(); - method = s.ReadRawVarint32(); - requestId = s.ReadRawByte() | (s.ReadRawByte() << 8); - if (service != 0xfe) unknown = s.ReadRawVarint64(); - len = s.ReadRawVarint32(); - ok so u read the SID and store them there - what they're used for by context actualy? - no idea - just saving them in an dictionary containing ID and has - h - u just storing them and with next related message using the same SID right? - and another think, i'd like to share repos if you like to, we're 2man working right now maybe eventually we can merge our codebases and share stuff -- and don't take it wrong :) just to make sure peeps over c# can collobrate - foreach (var e in request.ExportedServiceList) - { - newResponse.AddImportedServiceId(e.Id); - if (!m_services.ContainsKey(e.Id)) - m_services.Add(e.Id, e.Hash); - Log.Message("Registering service Id={0}, Hash={1}\n\n", Log.eLogLevel.Log, e.Id, e.Hash); - } - this is in bindrequest - http://80.86.81.60:8080/bin/Debug/Log/ - whoops - -- -scriptor is ~scriptor@Rizon-66DD3832.server4you.de * scriptor -scriptor on @#D3.dev @#d3-protocol #d3dev-www +#D3dev #D3SE -scriptor using *.rizon.net Where are you? -scriptor has identified for this nick -scriptor End of /WHOIS list. -- - kk and u got bitbucket acc? - ill give u access over our one - this is svn repo i guess? - no, just webserver - oh - just give me ur bitbucket acc, ill add you to access list \ No newline at end of file diff --git a/docs/hydra-server-dump.url b/docs/hydra-server-dump.url deleted file mode 100644 index 9e878167..00000000 --- a/docs/hydra-server-dump.url +++ /dev/null @@ -1,2 +0,0 @@ -[InternetShortcut] -URL=http://codepad.org/NId1s8wA diff --git a/docs/log latest.url b/docs/log latest.url deleted file mode 100644 index 53fd5aee..00000000 --- a/docs/log latest.url +++ /dev/null @@ -1,2 +0,0 @@ -[InternetShortcut] -URL=http://pastebin.com/raw.php?i=18j2mGsx diff --git a/docs/login-servers.txt b/docs/login-servers.txt deleted file mode 100644 index fd163c61..00000000 --- a/docs/login-servers.txt +++ /dev/null @@ -1,4 +0,0 @@ -eu.logon.battle.net - 213.248.127.130 -us.logon.battle.net - 12.129.206.130 -beta.actual.battle.net - 12.129.236.246 - diff --git a/docs/logon dump.url b/docs/logon dump.url deleted file mode 100644 index 0c3af7ae..00000000 --- a/docs/logon dump.url +++ /dev/null @@ -1,2 +0,0 @@ -[InternetShortcut] -URL=http://pastie.org/private/py7dt8htjsvt7tn9mak0ra diff --git a/docs/logonresponse.txt b/docs/logonresponse.txt deleted file mode 100644 index df1b2144..00000000 --- a/docs/logonresponse.txt +++ /dev/null @@ -1,10 +0,0 @@ - yes FE 00 03 00 00 {LogonResponse size} {LogonResponse data} - I'm sorry, this is a stupid (and slightly off topic) question, but where did you guys learn to do this kind of stuff? I'm legitimately interested because it is all so complicated. - and its not have to be 03 it have to be the number from LogonRequest - - this is how far am I, http://oi53.tinypic.com/2v1oh1t.jpg - its not have to be 03, it depends on the RequestLogon header - what header your using? - okay - ThreeSix which byte of request login header? 3rd? - for example if LoginRequest is 0101030000 the respone hea \ No newline at end of file diff --git a/docs/on connect request.url b/docs/on connect request.url deleted file mode 100644 index 146d9e42..00000000 --- a/docs/on connect request.url +++ /dev/null @@ -1,2 +0,0 @@ -[InternetShortcut] -URL=http://pastie.org/private/x4a9zli3f0qrj1kuly5oqa diff --git a/docs/packet-logs/d3cap2.cap b/docs/packet-logs/d3cap2.cap deleted file mode 100644 index 2745ffb9..00000000 Binary files a/docs/packet-logs/d3cap2.cap and /dev/null differ diff --git a/docs/packet-logs/d3charcreate.cap b/docs/packet-logs/d3charcreate.cap deleted file mode 100644 index 2a598428..00000000 Binary files a/docs/packet-logs/d3charcreate.cap and /dev/null differ diff --git a/docs/packet-logs/d3randomcap lvlup sellingitems.cap b/docs/packet-logs/d3randomcap lvlup sellingitems.cap deleted file mode 100644 index af0549cd..00000000 Binary files a/docs/packet-logs/d3randomcap lvlup sellingitems.cap and /dev/null differ diff --git a/docs/packet-logs/recap.cap b/docs/packet-logs/recap.cap deleted file mode 100644 index bbcd16ac..00000000 Binary files a/docs/packet-logs/recap.cap and /dev/null differ diff --git a/docs/packet-ops.url b/docs/packet-ops.url deleted file mode 100644 index 0c69cceb..00000000 --- a/docs/packet-ops.url +++ /dev/null @@ -1,2 +0,0 @@ -[InternetShortcut] -URL=http://privatepaste.com/3527f0f609 diff --git a/docs/proto-dump.url b/docs/proto-dump.url deleted file mode 100644 index 9f32f058..00000000 --- a/docs/proto-dump.url +++ /dev/null @@ -1,2 +0,0 @@ -[InternetShortcut] -URL=http://pastebin.com/SB5LEJ2Q diff --git a/docs/rpc.url b/docs/rpc.url deleted file mode 100644 index 797880de..00000000 --- a/docs/rpc.url +++ /dev/null @@ -1,2 +0,0 @@ -[InternetShortcut] -URL=http://privatepaste.com/ba25aceef3 diff --git a/docs/server dump 2.url b/docs/server dump 2.url deleted file mode 100644 index ac54604f..00000000 --- a/docs/server dump 2.url +++ /dev/null @@ -1,2 +0,0 @@ -[InternetShortcut] -URL=http://privatepaste.com/eedf77e2f4 diff --git a/docs/server dump.url b/docs/server dump.url deleted file mode 100644 index bb6daac6..00000000 --- a/docs/server dump.url +++ /dev/null @@ -1,2 +0,0 @@ -[InternetShortcut] -URL=http://codepad.org/kdIDFqxI diff --git a/docs/services 2.url b/docs/services 2.url deleted file mode 100644 index 845c290f..00000000 --- a/docs/services 2.url +++ /dev/null @@ -1,2 +0,0 @@ -[InternetShortcut] -URL=http://pastie.org/2538697 diff --git a/docs/services 3.url b/docs/services 3.url deleted file mode 100644 index b7cf1b6a..00000000 --- a/docs/services 3.url +++ /dev/null @@ -1,2 +0,0 @@ -[InternetShortcut] -URL=http://pastie.org/2540839 diff --git a/docs/services 4.url b/docs/services 4.url deleted file mode 100644 index 66276fe9..00000000 --- a/docs/services 4.url +++ /dev/null @@ -1,2 +0,0 @@ -[InternetShortcut] -URL=http://pastebin.com/xD7nmk3c diff --git a/docs/services.url b/docs/services.url deleted file mode 100644 index 7b7f60b1..00000000 --- a/docs/services.url +++ /dev/null @@ -1,2 +0,0 @@ -[InternetShortcut] -URL=http://pastebin.com/B4k4WExf diff --git a/docs/tomrus88-d3proto - GitHub.url b/docs/tomrus88-d3proto - GitHub.url deleted file mode 100644 index f2b30a22..00000000 --- a/docs/tomrus88-d3proto - GitHub.url +++ /dev/null @@ -1,2 +0,0 @@ -[InternetShortcut] -URL=https://github.com/tomrus88/d3proto diff --git a/docs/toon handle.url b/docs/toon handle.url deleted file mode 100644 index a19e2309..00000000 --- a/docs/toon handle.url +++ /dev/null @@ -1,2 +0,0 @@ -[InternetShortcut] -URL=http://pastie.org/2540670 diff --git a/docs/toonhandle.url b/docs/toonhandle.url deleted file mode 100644 index a19e2309..00000000 --- a/docs/toonhandle.url +++ /dev/null @@ -1,2 +0,0 @@ -[InternetShortcut] -URL=http://pastie.org/2540670 diff --git a/docs/updateprotocol-agent.txt b/docs/updateprotocol-agent.txt deleted file mode 100644 index fdbeb064..00000000 --- a/docs/updateprotocol-agent.txt +++ /dev/null @@ -1,85 +0,0 @@ -Update Protocol (Agent) ------------------------ - -[agent->bnet2] --------------- -POST /patch HTTP/1.1 -Content-Type: text/html -Content-Length: 140 -User-Agent: Blizzard Web Client -Host: enUS.patch.battle.net:1119 -Cache-Control: no-cache -Cookie: __utma=134253166.570439164.1309041696.1309217021.1309302496.6; __utmz=134253166.1309041696.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none) - - - - - - -[bnet2->agent] --------------- -HTTP/1.1 200 OK -Server: Protocol HTTP -Content-Length: 535 -Connection: close -Content-Type: application/xml - - - http://attdist.blizzard.com/sc2patch/update/B16117-5C52FCF1/sc2-1-22280-x86-Win-enUS-bnet-bin-component-dl;sc2-1-22280-x86-Win-enUS-bnet-bin-component-dl;69B17A0F007E49F5B37E2876C87A17DA;22280 - http://ak.worldofwarcraft.com.edgesuite.net/d3-pod/20FB5BE9/NA/Patches/agent404/agent-403-404-win.mpq.torrent;http://ak.worldofwarcraft.com.edgesuite.net/d3-pod/20FB5BE9/NA/Patches/agent404/agent-404-win.mpq.torrent;404;403;0 - - -[agent->bnet2] --------------- -POST /patch HTTP/1.1 -Content-Type: text/html -Content-Length: 140 -User-Agent: Blizzard Web Client -Host: enUS.patch.battle.net:1119 -Cache-Control: no-cacheCookie: __utma=134253166.570439164.1309041696.1309217021.1309302496.6; __utmz=134253166.1309041696.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none) - - - - - - -[bnet2->agent] --------------- -HTTP/1.1 200 OK -Server: Protocol HTTP -Content-Length: 535 -Connection: close -Content-Type: application/xml - - - http://attdist.blizzard.com/sc2patch/update/B16117-5C52FCF1/sc2-1-22280-x86-Win-enUS-bnet-bin-component-dl;sc2-1-22280-x86-Win-enUS-bnet-bin-component-dl;69B17A0F007E49F5B37E2876C87A17DA;22280 - http://ak.worldofwarcraft.com.edgesuite.net/d3-pod/20FB5BE9/NA/Patches/bl525/launcher-524-525-win.mpq.torrent;http://ak.worldofwarcraft.com.edgesuite.net/d3-pod/20FB5BE9/NA/Patches/bl525/launcher-525-win.mpq.torrent;525;524;0 - - -[agent->bnet2] --------------- -POST /patch HTTP/1.1 -Content-Type: text/html -Content-Length: 137 -User-Agent: Blizzard Web Client -Host: enUS.patch.battle.net:1119Cache-Control: no-cacheCookie: __utma=134253166.570439164.1309041696.1309217021.1309302496.6; __utmz=134253166.1309041696.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none) - - - - - - -[bnet2->agent] --------------- -HTTP/1.1 200 OK -Server: Protocol HTTP -Content-Length: 487 -Connection: close -Content-Type: application/xml - - - http://attdist.blizzard.com/sc2patch/update/B16117-5C52FCF1/sc2-1-22280-x86-Win-enUS-bnet-bin-component-dl;sc2-1-22280-x86-Win-enUS-bnet-bin-component-dl;69B17A0F007E49F5B37E2876C87A17DA;22280 - http://ak.worldofwarcraft.com.edgesuite.net/d3-pod/20FB5BE9/NA/d3-7318-A25A9969D948E82419928FBFBACA41A3.xml;D253D8118D6D5D4A50A5DE72526D8AA1;A0F73AD55B049A9A6B3D94D7B944F07E;7318 - - - diff --git a/docs/updateprotocol-sc2.txt b/docs/updateprotocol-sc2.txt deleted file mode 100644 index 66806205..00000000 --- a/docs/updateprotocol-sc2.txt +++ /dev/null @@ -1,81 +0,0 @@ -1. The client sends POST request to us-beta.patch.battle.net:1120 with the following XML data: -Code: [Select] - - - - - - - - -2. If the server detects we have the lastest version it sends 204 (No Content) as said in the first post. - -If we need an update the server sends -Code: [Select] -HTTP/1.1 200 OK -Server: Protocol HTTP -Content-Length: 1118 -Connection: close -Content-Type: application/xml - - - -http://dist.blizzard.com.edgesuite.net/sc2patch/update/B14093B/sc2-0.2.0.13891-0.3.0.14093-x86-Win-enUS-game-component-dl;sc2-0.2.0.13891-0.3.0.14093-x86-Win-enUS-game-component-dl;FE4E80465692A2F9C47C2723D184E933;14093 - - -http://dist.blizzard.com.edgesuite.net/sc2patch/update/B14093B/sc2-0.2.0.13891-0.3.0.14093-x86-Win-enUS-locale-component-dl;sc2-0.2.0.13891-0.3.0.14093-x86-Win-enUS-locale-component-dl;49750B9F1473283D7DA44622E021833B;14093 - - -http://dist.blizzard.com.edgesuite.net/sc2patch/update/B14093B/sc2-0.2.0.13891-0.3.0.14093-x86-Win-enUS-bnet-base-component-dl;sc2-0.2.0.13891-0.3.0.14093-x86-Win-enUS-bnet-base-component-dl;68CC1B35027ECE4B1D1704666344A29E;14093 - - -http://dist.blizzard.com.edgesuite.net/sc2patch/update/B14093B/sc2-0.2.0.13891-0.3.0.14093-x86-Win-enUS-bnet-bin-component-dl;sc2-0.2.0.13891-0.3.0.14093-x86-Win-enUS-bnet-bin-component-dl;423205FE7C3D74D01990A1BB37273ADE;14093 - - - -You can see the -[... URL for the dl file ...];[... Name of the dl file ...];[... MD5 hash of the dl file ...];[... version number ...] - - -3. The client then gets the URLs from here and downloads and install them. -4. Then it checks again and if the server returns no update XML data it means that the client is lastest version. - -If the update server could not be found the launcher continues loading the game. - -The DL file itself is an MPQ archive. It has (a minimum of) two files: - - -prepatch.lst - contains list of operations the updater should do. For example -Code: [Select] -extract sc2-0.2.0.13891-0.3.0.14093-x86-Win-enUS-game.torrent -download sc2-0.2.0.13891-0.3.0.14093-x86-Win-enUS-game.torrent - -The torrent file is also in the archive. The first line tells the updater to extract the torrent file (to the Starcraft 2 folder) and the second one is to start downloading it. It uses the blizzard downloader to do that. - - -The actual update file we get by downloading the torrent is also an MPQ archive. (They just love mpqs don't they ) - - -It contains the updated files in subdirectories. If an updated file is inside some of the base mpqs they aren't including the full mpq but only the updated file inside it. For example -Code: [Select] -\base\Mods\Liberty.SC2Mod\Base.SC2Data\GameData\[...file...].xml - - -Then in the patch.lst file every line is a file to copy. From there these files are put into the mpqs or just copied to the directory. -Code: [Select] -BlizzardComponent.xml;base/Mods/Core.SC2Mod/Base.SC2Data\BlizzardComponent.xml;base/Mods/Core.SC2Mod/Base.SC2Data -BuildId.txt;base/Mods/Core.SC2Mod/Base.SC2Data\BuildId.txt;base/Mods/Core.SC2Mod/Base.SC2Data -Assets\Effects\Protoss\BlinkIn\BlinkIn.m3;base/Mods/Liberty.SC2Mod/Base.SC2Assets\Assets\Effects\Protoss\BlinkIn\BlinkIn.m3;base/Mods/Liberty.SC2Mod/Base.SC2Assets -Code: [Select] -[...File path inside the mpq...];[...Path to the file from the root of the downloaded update mpq...];[...Path to the MPQ archive inside the Starcraft2 folder...]\n - - -patch.cmd contains the build numbers before and after and the Language version. - - -hdfiles.lst and wowtest.lst seem to contain the files that should be in the SC2 folder. - - -delete.lst - files to delete after the patching process. \ No newline at end of file diff --git a/source/.gitignore b/source/.gitignore deleted file mode 100644 index a4cad619..00000000 --- a/source/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/_ReSharper.D3Sharp-win32/ -D3Sharp.user -D3Sharp-mono.userprefs -/*.suo -/*.6.0.ReSharper.user -/*.userprefs diff --git a/source/D3Proto/.gitignore b/source/D3Proto/.gitignore deleted file mode 100644 index 6ad82b0c..00000000 --- a/source/D3Proto/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -bin/ -obj/ -D3Proto.pidb diff --git a/source/D3Proto/CSharpOptions.cs b/source/D3Proto/CSharpOptions.cs deleted file mode 100644 index d6476266..00000000 --- a/source/D3Proto/CSharpOptions.cs +++ /dev/null @@ -1,966 +0,0 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.DescriptorProtos { - - public static partial class CSharpOptions { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - registry.Add(global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.CSharpFileOptions); - registry.Add(global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.CSharpFieldOptions); - } - #endregion - #region Extensions - public const int CSharpFileOptionsFieldNumber = 1000; - public static pb::GeneratedExtensionBase CSharpFileOptions; - public const int CSharpFieldOptionsFieldNumber = 1000; - public static pb::GeneratedExtensionBase CSharpFieldOptions; - #endregion - - #region Static variables - internal static pbd::MessageDescriptor internal__static_google_protobuf_CSharpFileOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_CSharpFileOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_CSharpFieldOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_CSharpFieldOptions__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static CSharpOptions() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "CiRnb29nbGUvcHJvdG9idWYvY3NoYXJwX29wdGlvbnMucHJvdG8SD2dvb2ds" + - "ZS5wcm90b2J1ZhogZ29vZ2xlL3Byb3RvYnVmL2Rlc2NyaXB0b3IucHJvdG8i" + - "6wIKEUNTaGFycEZpbGVPcHRpb25zEhEKCW5hbWVzcGFjZRgBIAEoCRIaChJ1" + - "bWJyZWxsYV9jbGFzc25hbWUYAiABKAkSHAoOcHVibGljX2NsYXNzZXMYAyAB" + - "KAg6BHRydWUSFgoObXVsdGlwbGVfZmlsZXMYBCABKAgSFAoMbmVzdF9jbGFz" + - "c2VzGAUgASgIEhYKDmNvZGVfY29udHJhY3RzGAYgASgIEiQKHGV4cGFuZF9u" + - "YW1lc3BhY2VfZGlyZWN0b3JpZXMYByABKAgSHAoOY2xzX2NvbXBsaWFuY2UY" + - "CCABKAg6BHRydWUSHAoOZmlsZV9leHRlbnNpb24Y3QEgASgJOgMuY3MSGwoS" + - "dW1icmVsbGFfbmFtZXNwYWNlGN4BIAEoCRIcChBvdXRwdXRfZGlyZWN0b3J5" + - "GN8BIAEoCToBLhImChZpZ25vcmVfZ29vZ2xlX3Byb3RvYnVmGOABIAEoCDoF" + - "ZmFsc2UiKwoSQ1NoYXJwRmllbGRPcHRpb25zEhUKDXByb3BlcnR5X25hbWUY" + - "ASABKAk6XgoTY3NoYXJwX2ZpbGVfb3B0aW9ucxIcLmdvb2dsZS5wcm90b2J1" + - "Zi5GaWxlT3B0aW9ucxjoByABKAsyIi5nb29nbGUucHJvdG9idWYuQ1NoYXJw" + - "RmlsZU9wdGlvbnM6YQoUY3NoYXJwX2ZpZWxkX29wdGlvbnMSHS5nb29nbGUu" + - "cHJvdG9idWYuRmllbGRPcHRpb25zGOgHIAEoCzIjLmdvb2dsZS5wcm90b2J1" + - "Zi5DU2hhcnBGaWVsZE9wdGlvbnM="); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_google_protobuf_CSharpFileOptions__Descriptor = Descriptor.MessageTypes[0]; - internal__static_google_protobuf_CSharpFileOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_CSharpFileOptions__Descriptor, - new string[] { "Namespace", "UmbrellaClassname", "PublicClasses", "MultipleFiles", "NestClasses", "CodeContracts", "ExpandNamespaceDirectories", "ClsCompliance", "FileExtension", "UmbrellaNamespace", "OutputDirectory", "IgnoreGoogleProtobuf", }); - internal__static_google_protobuf_CSharpFieldOptions__Descriptor = Descriptor.MessageTypes[1]; - internal__static_google_protobuf_CSharpFieldOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_CSharpFieldOptions__Descriptor, - new string[] { "PropertyName", }); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.CSharpFileOptions = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor.Extensions[0]); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.CSharpFieldOptions = pb::GeneratedSingleExtension.CreateInstance(global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor.Extensions[1]); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, - }, assigner); - } - #endregion - - } - #region Messages - public sealed partial class CSharpFileOptions : pb::GeneratedMessage { - private static readonly CSharpFileOptions defaultInstance = new Builder().BuildPartial(); - public static CSharpFileOptions DefaultInstance { - get { return defaultInstance; } - } - - public override CSharpFileOptions DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override CSharpFileOptions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.internal__static_google_protobuf_CSharpFileOptions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.internal__static_google_protobuf_CSharpFileOptions__FieldAccessorTable; } - } - - public const int NamespaceFieldNumber = 1; - private bool hasNamespace; - private string namespace_ = ""; - public bool HasNamespace { - get { return hasNamespace; } - } - public string Namespace { - get { return namespace_; } - } - - public const int UmbrellaClassnameFieldNumber = 2; - private bool hasUmbrellaClassname; - private string umbrellaClassname_ = ""; - public bool HasUmbrellaClassname { - get { return hasUmbrellaClassname; } - } - public string UmbrellaClassname { - get { return umbrellaClassname_; } - } - - public const int PublicClassesFieldNumber = 3; - private bool hasPublicClasses; - private bool publicClasses_ = true; - public bool HasPublicClasses { - get { return hasPublicClasses; } - } - public bool PublicClasses { - get { return publicClasses_; } - } - - public const int MultipleFilesFieldNumber = 4; - private bool hasMultipleFiles; - private bool multipleFiles_ = false; - public bool HasMultipleFiles { - get { return hasMultipleFiles; } - } - public bool MultipleFiles { - get { return multipleFiles_; } - } - - public const int NestClassesFieldNumber = 5; - private bool hasNestClasses; - private bool nestClasses_ = false; - public bool HasNestClasses { - get { return hasNestClasses; } - } - public bool NestClasses { - get { return nestClasses_; } - } - - public const int CodeContractsFieldNumber = 6; - private bool hasCodeContracts; - private bool codeContracts_ = false; - public bool HasCodeContracts { - get { return hasCodeContracts; } - } - public bool CodeContracts { - get { return codeContracts_; } - } - - public const int ExpandNamespaceDirectoriesFieldNumber = 7; - private bool hasExpandNamespaceDirectories; - private bool expandNamespaceDirectories_ = false; - public bool HasExpandNamespaceDirectories { - get { return hasExpandNamespaceDirectories; } - } - public bool ExpandNamespaceDirectories { - get { return expandNamespaceDirectories_; } - } - - public const int ClsComplianceFieldNumber = 8; - private bool hasClsCompliance; - private bool clsCompliance_ = true; - public bool HasClsCompliance { - get { return hasClsCompliance; } - } - public bool ClsCompliance { - get { return clsCompliance_; } - } - - public const int FileExtensionFieldNumber = 221; - private bool hasFileExtension; - private string fileExtension_ = ".cs"; - public bool HasFileExtension { - get { return hasFileExtension; } - } - public string FileExtension { - get { return fileExtension_; } - } - - public const int UmbrellaNamespaceFieldNumber = 222; - private bool hasUmbrellaNamespace; - private string umbrellaNamespace_ = ""; - public bool HasUmbrellaNamespace { - get { return hasUmbrellaNamespace; } - } - public string UmbrellaNamespace { - get { return umbrellaNamespace_; } - } - - public const int OutputDirectoryFieldNumber = 223; - private bool hasOutputDirectory; - private string outputDirectory_ = "."; - public bool HasOutputDirectory { - get { return hasOutputDirectory; } - } - public string OutputDirectory { - get { return outputDirectory_; } - } - - public const int IgnoreGoogleProtobufFieldNumber = 224; - private bool hasIgnoreGoogleProtobuf; - private bool ignoreGoogleProtobuf_ = false; - public bool HasIgnoreGoogleProtobuf { - get { return hasIgnoreGoogleProtobuf; } - } - public bool IgnoreGoogleProtobuf { - get { return ignoreGoogleProtobuf_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasNamespace) { - output.WriteString(1, Namespace); - } - if (HasUmbrellaClassname) { - output.WriteString(2, UmbrellaClassname); - } - if (HasPublicClasses) { - output.WriteBool(3, PublicClasses); - } - if (HasMultipleFiles) { - output.WriteBool(4, MultipleFiles); - } - if (HasNestClasses) { - output.WriteBool(5, NestClasses); - } - if (HasCodeContracts) { - output.WriteBool(6, CodeContracts); - } - if (HasExpandNamespaceDirectories) { - output.WriteBool(7, ExpandNamespaceDirectories); - } - if (HasClsCompliance) { - output.WriteBool(8, ClsCompliance); - } - if (HasFileExtension) { - output.WriteString(221, FileExtension); - } - if (HasUmbrellaNamespace) { - output.WriteString(222, UmbrellaNamespace); - } - if (HasOutputDirectory) { - output.WriteString(223, OutputDirectory); - } - if (HasIgnoreGoogleProtobuf) { - output.WriteBool(224, IgnoreGoogleProtobuf); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasNamespace) { - size += pb::CodedOutputStream.ComputeStringSize(1, Namespace); - } - if (HasUmbrellaClassname) { - size += pb::CodedOutputStream.ComputeStringSize(2, UmbrellaClassname); - } - if (HasPublicClasses) { - size += pb::CodedOutputStream.ComputeBoolSize(3, PublicClasses); - } - if (HasMultipleFiles) { - size += pb::CodedOutputStream.ComputeBoolSize(4, MultipleFiles); - } - if (HasNestClasses) { - size += pb::CodedOutputStream.ComputeBoolSize(5, NestClasses); - } - if (HasCodeContracts) { - size += pb::CodedOutputStream.ComputeBoolSize(6, CodeContracts); - } - if (HasExpandNamespaceDirectories) { - size += pb::CodedOutputStream.ComputeBoolSize(7, ExpandNamespaceDirectories); - } - if (HasClsCompliance) { - size += pb::CodedOutputStream.ComputeBoolSize(8, ClsCompliance); - } - if (HasFileExtension) { - size += pb::CodedOutputStream.ComputeStringSize(221, FileExtension); - } - if (HasUmbrellaNamespace) { - size += pb::CodedOutputStream.ComputeStringSize(222, UmbrellaNamespace); - } - if (HasOutputDirectory) { - size += pb::CodedOutputStream.ComputeStringSize(223, OutputDirectory); - } - if (HasIgnoreGoogleProtobuf) { - size += pb::CodedOutputStream.ComputeBoolSize(224, IgnoreGoogleProtobuf); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static CSharpFileOptions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CSharpFileOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CSharpFileOptions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CSharpFileOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CSharpFileOptions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CSharpFileOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CSharpFileOptions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CSharpFileOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CSharpFileOptions ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CSharpFileOptions ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CSharpFileOptions prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - CSharpFileOptions result = new CSharpFileOptions(); - - protected override CSharpFileOptions MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new CSharpFileOptions(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpFileOptions.Descriptor; } - } - - public override CSharpFileOptions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpFileOptions.DefaultInstance; } - } - - public override CSharpFileOptions BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - CSharpFileOptions returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CSharpFileOptions) { - return MergeFrom((CSharpFileOptions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CSharpFileOptions other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.CSharpFileOptions.DefaultInstance) return this; - if (other.HasNamespace) { - Namespace = other.Namespace; - } - if (other.HasUmbrellaClassname) { - UmbrellaClassname = other.UmbrellaClassname; - } - if (other.HasPublicClasses) { - PublicClasses = other.PublicClasses; - } - if (other.HasMultipleFiles) { - MultipleFiles = other.MultipleFiles; - } - if (other.HasNestClasses) { - NestClasses = other.NestClasses; - } - if (other.HasCodeContracts) { - CodeContracts = other.CodeContracts; - } - if (other.HasExpandNamespaceDirectories) { - ExpandNamespaceDirectories = other.ExpandNamespaceDirectories; - } - if (other.HasClsCompliance) { - ClsCompliance = other.ClsCompliance; - } - if (other.HasFileExtension) { - FileExtension = other.FileExtension; - } - if (other.HasUmbrellaNamespace) { - UmbrellaNamespace = other.UmbrellaNamespace; - } - if (other.HasOutputDirectory) { - OutputDirectory = other.OutputDirectory; - } - if (other.HasIgnoreGoogleProtobuf) { - IgnoreGoogleProtobuf = other.IgnoreGoogleProtobuf; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - Namespace = input.ReadString(); - break; - } - case 18: { - UmbrellaClassname = input.ReadString(); - break; - } - case 24: { - PublicClasses = input.ReadBool(); - break; - } - case 32: { - MultipleFiles = input.ReadBool(); - break; - } - case 40: { - NestClasses = input.ReadBool(); - break; - } - case 48: { - CodeContracts = input.ReadBool(); - break; - } - case 56: { - ExpandNamespaceDirectories = input.ReadBool(); - break; - } - case 64: { - ClsCompliance = input.ReadBool(); - break; - } - case 1770: { - FileExtension = input.ReadString(); - break; - } - case 1778: { - UmbrellaNamespace = input.ReadString(); - break; - } - case 1786: { - OutputDirectory = input.ReadString(); - break; - } - case 1792: { - IgnoreGoogleProtobuf = input.ReadBool(); - break; - } - } - } - } - - - public bool HasNamespace { - get { return result.HasNamespace; } - } - public string Namespace { - get { return result.Namespace; } - set { SetNamespace(value); } - } - public Builder SetNamespace(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasNamespace = true; - result.namespace_ = value; - return this; - } - public Builder ClearNamespace() { - result.hasNamespace = false; - result.namespace_ = ""; - return this; - } - - public bool HasUmbrellaClassname { - get { return result.HasUmbrellaClassname; } - } - public string UmbrellaClassname { - get { return result.UmbrellaClassname; } - set { SetUmbrellaClassname(value); } - } - public Builder SetUmbrellaClassname(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasUmbrellaClassname = true; - result.umbrellaClassname_ = value; - return this; - } - public Builder ClearUmbrellaClassname() { - result.hasUmbrellaClassname = false; - result.umbrellaClassname_ = ""; - return this; - } - - public bool HasPublicClasses { - get { return result.HasPublicClasses; } - } - public bool PublicClasses { - get { return result.PublicClasses; } - set { SetPublicClasses(value); } - } - public Builder SetPublicClasses(bool value) { - result.hasPublicClasses = true; - result.publicClasses_ = value; - return this; - } - public Builder ClearPublicClasses() { - result.hasPublicClasses = false; - result.publicClasses_ = true; - return this; - } - - public bool HasMultipleFiles { - get { return result.HasMultipleFiles; } - } - public bool MultipleFiles { - get { return result.MultipleFiles; } - set { SetMultipleFiles(value); } - } - public Builder SetMultipleFiles(bool value) { - result.hasMultipleFiles = true; - result.multipleFiles_ = value; - return this; - } - public Builder ClearMultipleFiles() { - result.hasMultipleFiles = false; - result.multipleFiles_ = false; - return this; - } - - public bool HasNestClasses { - get { return result.HasNestClasses; } - } - public bool NestClasses { - get { return result.NestClasses; } - set { SetNestClasses(value); } - } - public Builder SetNestClasses(bool value) { - result.hasNestClasses = true; - result.nestClasses_ = value; - return this; - } - public Builder ClearNestClasses() { - result.hasNestClasses = false; - result.nestClasses_ = false; - return this; - } - - public bool HasCodeContracts { - get { return result.HasCodeContracts; } - } - public bool CodeContracts { - get { return result.CodeContracts; } - set { SetCodeContracts(value); } - } - public Builder SetCodeContracts(bool value) { - result.hasCodeContracts = true; - result.codeContracts_ = value; - return this; - } - public Builder ClearCodeContracts() { - result.hasCodeContracts = false; - result.codeContracts_ = false; - return this; - } - - public bool HasExpandNamespaceDirectories { - get { return result.HasExpandNamespaceDirectories; } - } - public bool ExpandNamespaceDirectories { - get { return result.ExpandNamespaceDirectories; } - set { SetExpandNamespaceDirectories(value); } - } - public Builder SetExpandNamespaceDirectories(bool value) { - result.hasExpandNamespaceDirectories = true; - result.expandNamespaceDirectories_ = value; - return this; - } - public Builder ClearExpandNamespaceDirectories() { - result.hasExpandNamespaceDirectories = false; - result.expandNamespaceDirectories_ = false; - return this; - } - - public bool HasClsCompliance { - get { return result.HasClsCompliance; } - } - public bool ClsCompliance { - get { return result.ClsCompliance; } - set { SetClsCompliance(value); } - } - public Builder SetClsCompliance(bool value) { - result.hasClsCompliance = true; - result.clsCompliance_ = value; - return this; - } - public Builder ClearClsCompliance() { - result.hasClsCompliance = false; - result.clsCompliance_ = true; - return this; - } - - public bool HasFileExtension { - get { return result.HasFileExtension; } - } - public string FileExtension { - get { return result.FileExtension; } - set { SetFileExtension(value); } - } - public Builder SetFileExtension(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasFileExtension = true; - result.fileExtension_ = value; - return this; - } - public Builder ClearFileExtension() { - result.hasFileExtension = false; - result.fileExtension_ = ".cs"; - return this; - } - - public bool HasUmbrellaNamespace { - get { return result.HasUmbrellaNamespace; } - } - public string UmbrellaNamespace { - get { return result.UmbrellaNamespace; } - set { SetUmbrellaNamespace(value); } - } - public Builder SetUmbrellaNamespace(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasUmbrellaNamespace = true; - result.umbrellaNamespace_ = value; - return this; - } - public Builder ClearUmbrellaNamespace() { - result.hasUmbrellaNamespace = false; - result.umbrellaNamespace_ = ""; - return this; - } - - public bool HasOutputDirectory { - get { return result.HasOutputDirectory; } - } - public string OutputDirectory { - get { return result.OutputDirectory; } - set { SetOutputDirectory(value); } - } - public Builder SetOutputDirectory(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasOutputDirectory = true; - result.outputDirectory_ = value; - return this; - } - public Builder ClearOutputDirectory() { - result.hasOutputDirectory = false; - result.outputDirectory_ = "."; - return this; - } - - public bool HasIgnoreGoogleProtobuf { - get { return result.HasIgnoreGoogleProtobuf; } - } - public bool IgnoreGoogleProtobuf { - get { return result.IgnoreGoogleProtobuf; } - set { SetIgnoreGoogleProtobuf(value); } - } - public Builder SetIgnoreGoogleProtobuf(bool value) { - result.hasIgnoreGoogleProtobuf = true; - result.ignoreGoogleProtobuf_ = value; - return this; - } - public Builder ClearIgnoreGoogleProtobuf() { - result.hasIgnoreGoogleProtobuf = false; - result.ignoreGoogleProtobuf_ = false; - return this; - } - } - static CSharpFileOptions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, null); - } - } - - public sealed partial class CSharpFieldOptions : pb::GeneratedMessage { - private static readonly CSharpFieldOptions defaultInstance = new Builder().BuildPartial(); - public static CSharpFieldOptions DefaultInstance { - get { return defaultInstance; } - } - - public override CSharpFieldOptions DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override CSharpFieldOptions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.internal__static_google_protobuf_CSharpFieldOptions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.internal__static_google_protobuf_CSharpFieldOptions__FieldAccessorTable; } - } - - public const int PropertyNameFieldNumber = 1; - private bool hasPropertyName; - private string propertyName_ = ""; - public bool HasPropertyName { - get { return hasPropertyName; } - } - public string PropertyName { - get { return propertyName_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasPropertyName) { - output.WriteString(1, PropertyName); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasPropertyName) { - size += pb::CodedOutputStream.ComputeStringSize(1, PropertyName); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static CSharpFieldOptions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CSharpFieldOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CSharpFieldOptions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CSharpFieldOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CSharpFieldOptions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CSharpFieldOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CSharpFieldOptions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CSharpFieldOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CSharpFieldOptions ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CSharpFieldOptions ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CSharpFieldOptions prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - CSharpFieldOptions result = new CSharpFieldOptions(); - - protected override CSharpFieldOptions MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new CSharpFieldOptions(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpFieldOptions.Descriptor; } - } - - public override CSharpFieldOptions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.CSharpFieldOptions.DefaultInstance; } - } - - public override CSharpFieldOptions BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - CSharpFieldOptions returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CSharpFieldOptions) { - return MergeFrom((CSharpFieldOptions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CSharpFieldOptions other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.CSharpFieldOptions.DefaultInstance) return this; - if (other.HasPropertyName) { - PropertyName = other.PropertyName; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - PropertyName = input.ReadString(); - break; - } - } - } - } - - - public bool HasPropertyName { - get { return result.HasPropertyName; } - } - public string PropertyName { - get { return result.PropertyName; } - set { SetPropertyName(value); } - } - public Builder SetPropertyName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasPropertyName = true; - result.propertyName_ = value; - return this; - } - public Builder ClearPropertyName() { - result.hasPropertyName = false; - result.propertyName_ = ""; - return this; - } - } - static CSharpFieldOptions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, null); - } - } - - #endregion - -} diff --git a/source/D3Proto/D3/Account/Account.cs b/source/D3Proto/D3/Account/Account.cs deleted file mode 100644 index b41c31c1..00000000 --- a/source/D3Proto/D3/Account/Account.cs +++ /dev/null @@ -1,1639 +0,0 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace D3.Account { - - public static partial class Account { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_D3_Account_BannerConfiguration__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Account_BannerConfiguration__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_D3_Account_Digest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Account_Digest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_D3_Account_SavedDefinition__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Account_SavedDefinition__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static Account() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "Cg1BY2NvdW50LnByb3RvEgpEMy5BY2NvdW50GhlBdHRyaWJ1dGVTZXJpYWxp" + - "emVyLnByb3RvGgtJdGVtcy5wcm90bxoTT25saW5lU2VydmljZS5wcm90bxoS" + - "SXRlbUNyYWZ0aW5nLnByb3RvIvIBChNCYW5uZXJDb25maWd1cmF0aW9uEhQK" + - "DGJhbm5lcl9pbmRleBgBIAIoDRISCgpzaWdpbF9tYWluGAIgAigFEhQKDHNp" + - "Z2lsX2FjY2VudBgDIAIoBRIbChNwYXR0ZXJuX2NvbG9yX2luZGV4GAQgAigF" + - "Eh4KFmJhY2tncm91bmRfY29sb3JfaW5kZXgYBSACKAUSGQoRc2lnaWxfY29s" + - "b3JfaW5kZXgYBiACKAUSFwoPcGxhY2VtZW50X2luZGV4GAcgAigFEg8KB3Bh" + - "dHRlcm4YCCACKAUSGQoRdXNlX3NpZ2lsX3ZhcmlhbnQYCSACKAgixQEKBkRp" + - "Z2VzdBIPCgd2ZXJzaW9uGAEgAigNEjcKE2xhc3RfcGxheWVkX2hlcm9faWQY" + - "AiACKAsyGi5EMy5PbmxpbmVTZXJ2aWNlLkVudGl0eUlkEj0KFGJhbm5lcl9j" + - "b25maWd1cmF0aW9uGAMgAigLMh8uRDMuQWNjb3VudC5CYW5uZXJDb25maWd1" + - "cmF0aW9uEg0KBWZsYWdzGAQgAigNIiMKBUZsYWdzEhoKFkhBUkRDT1JFX0hF" + - "Uk9fVU5MT0NLRUQQASLQAgoPU2F2ZWREZWZpbml0aW9uEg8KB3ZlcnNpb24Y" + - "ASACKA0SIgoGZGlnZXN0GAIgASgLMhIuRDMuQWNjb3VudC5EaWdlc3QSQQoQ" + - "c2F2ZWRfYXR0cmlidXRlcxgDIAIoCzInLkQzLkF0dHJpYnV0ZVNlcmlhbGl6" + - "ZXIuU2F2ZWRBdHRyaWJ1dGVzEjUKGW5vcm1hbF9zaGFyZWRfc2F2ZWRfaXRl" + - "bXMYBCABKAsyEi5EMy5JdGVtcy5JdGVtTGlzdBI3ChtoYXJkY29yZV9zaGFy" + - "ZWRfc2F2ZWRfaXRlbXMYBSABKAsyEi5EMy5JdGVtcy5JdGVtTGlzdBI9ChJj" + - "cmFmdGVyX3NhdmVkX2RhdGEYBiABKAsyIS5EMy5JdGVtQ3JhZnRpbmcuQ3Jh" + - "ZnRlclNhdmVkRGF0YRIWCg5zZWVuX3R1dG9yaWFscxgHIAMoDw=="); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_D3_Account_BannerConfiguration__Descriptor = Descriptor.MessageTypes[0]; - internal__static_D3_Account_BannerConfiguration__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Account_BannerConfiguration__Descriptor, - new string[] { "BannerIndex", "SigilMain", "SigilAccent", "PatternColorIndex", "BackgroundColorIndex", "SigilColorIndex", "PlacementIndex", "Pattern", "UseSigilVariant", }); - internal__static_D3_Account_Digest__Descriptor = Descriptor.MessageTypes[1]; - internal__static_D3_Account_Digest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Account_Digest__Descriptor, - new string[] { "Version", "LastPlayedHeroId", "BannerConfiguration", "Flags", }); - internal__static_D3_Account_SavedDefinition__Descriptor = Descriptor.MessageTypes[2]; - internal__static_D3_Account_SavedDefinition__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Account_SavedDefinition__Descriptor, - new string[] { "Version", "Digest", "SavedAttributes", "NormalSharedSavedItems", "HardcoreSharedSavedItems", "CrafterSavedData", "SeenTutorials", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::D3.AttributeSerializer.AttributeSerializer.Descriptor, - global::D3.Items.Items.Descriptor, - global::D3.OnlineService.OnlineService.Descriptor, - global::D3.ItemCrafting.ItemCrafting.Descriptor, - }, assigner); - } - #endregion - - } - #region Messages - public sealed partial class BannerConfiguration : pb::GeneratedMessage { - private static readonly BannerConfiguration defaultInstance = new Builder().BuildPartial(); - public static BannerConfiguration DefaultInstance { - get { return defaultInstance; } - } - - public override BannerConfiguration DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override BannerConfiguration ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::D3.Account.Account.internal__static_D3_Account_BannerConfiguration__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::D3.Account.Account.internal__static_D3_Account_BannerConfiguration__FieldAccessorTable; } - } - - public const int BannerIndexFieldNumber = 1; - private bool hasBannerIndex; - private uint bannerIndex_ = 0; - public bool HasBannerIndex { - get { return hasBannerIndex; } - } - public uint BannerIndex { - get { return bannerIndex_; } - } - - public const int SigilMainFieldNumber = 2; - private bool hasSigilMain; - private int sigilMain_ = 0; - public bool HasSigilMain { - get { return hasSigilMain; } - } - public int SigilMain { - get { return sigilMain_; } - } - - public const int SigilAccentFieldNumber = 3; - private bool hasSigilAccent; - private int sigilAccent_ = 0; - public bool HasSigilAccent { - get { return hasSigilAccent; } - } - public int SigilAccent { - get { return sigilAccent_; } - } - - public const int PatternColorIndexFieldNumber = 4; - private bool hasPatternColorIndex; - private int patternColorIndex_ = 0; - public bool HasPatternColorIndex { - get { return hasPatternColorIndex; } - } - public int PatternColorIndex { - get { return patternColorIndex_; } - } - - public const int BackgroundColorIndexFieldNumber = 5; - private bool hasBackgroundColorIndex; - private int backgroundColorIndex_ = 0; - public bool HasBackgroundColorIndex { - get { return hasBackgroundColorIndex; } - } - public int BackgroundColorIndex { - get { return backgroundColorIndex_; } - } - - public const int SigilColorIndexFieldNumber = 6; - private bool hasSigilColorIndex; - private int sigilColorIndex_ = 0; - public bool HasSigilColorIndex { - get { return hasSigilColorIndex; } - } - public int SigilColorIndex { - get { return sigilColorIndex_; } - } - - public const int PlacementIndexFieldNumber = 7; - private bool hasPlacementIndex; - private int placementIndex_ = 0; - public bool HasPlacementIndex { - get { return hasPlacementIndex; } - } - public int PlacementIndex { - get { return placementIndex_; } - } - - public const int PatternFieldNumber = 8; - private bool hasPattern; - private int pattern_ = 0; - public bool HasPattern { - get { return hasPattern; } - } - public int Pattern { - get { return pattern_; } - } - - public const int UseSigilVariantFieldNumber = 9; - private bool hasUseSigilVariant; - private bool useSigilVariant_ = false; - public bool HasUseSigilVariant { - get { return hasUseSigilVariant; } - } - public bool UseSigilVariant { - get { return useSigilVariant_; } - } - - public override bool IsInitialized { - get { - if (!hasBannerIndex) return false; - if (!hasSigilMain) return false; - if (!hasSigilAccent) return false; - if (!hasPatternColorIndex) return false; - if (!hasBackgroundColorIndex) return false; - if (!hasSigilColorIndex) return false; - if (!hasPlacementIndex) return false; - if (!hasPattern) return false; - if (!hasUseSigilVariant) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasBannerIndex) { - output.WriteUInt32(1, BannerIndex); - } - if (HasSigilMain) { - output.WriteInt32(2, SigilMain); - } - if (HasSigilAccent) { - output.WriteInt32(3, SigilAccent); - } - if (HasPatternColorIndex) { - output.WriteInt32(4, PatternColorIndex); - } - if (HasBackgroundColorIndex) { - output.WriteInt32(5, BackgroundColorIndex); - } - if (HasSigilColorIndex) { - output.WriteInt32(6, SigilColorIndex); - } - if (HasPlacementIndex) { - output.WriteInt32(7, PlacementIndex); - } - if (HasPattern) { - output.WriteInt32(8, Pattern); - } - if (HasUseSigilVariant) { - output.WriteBool(9, UseSigilVariant); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasBannerIndex) { - size += pb::CodedOutputStream.ComputeUInt32Size(1, BannerIndex); - } - if (HasSigilMain) { - size += pb::CodedOutputStream.ComputeInt32Size(2, SigilMain); - } - if (HasSigilAccent) { - size += pb::CodedOutputStream.ComputeInt32Size(3, SigilAccent); - } - if (HasPatternColorIndex) { - size += pb::CodedOutputStream.ComputeInt32Size(4, PatternColorIndex); - } - if (HasBackgroundColorIndex) { - size += pb::CodedOutputStream.ComputeInt32Size(5, BackgroundColorIndex); - } - if (HasSigilColorIndex) { - size += pb::CodedOutputStream.ComputeInt32Size(6, SigilColorIndex); - } - if (HasPlacementIndex) { - size += pb::CodedOutputStream.ComputeInt32Size(7, PlacementIndex); - } - if (HasPattern) { - size += pb::CodedOutputStream.ComputeInt32Size(8, Pattern); - } - if (HasUseSigilVariant) { - size += pb::CodedOutputStream.ComputeBoolSize(9, UseSigilVariant); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static BannerConfiguration ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BannerConfiguration ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BannerConfiguration ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BannerConfiguration ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BannerConfiguration ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BannerConfiguration ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static BannerConfiguration ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static BannerConfiguration ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static BannerConfiguration ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BannerConfiguration ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(BannerConfiguration prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - BannerConfiguration result = new BannerConfiguration(); - - protected override BannerConfiguration MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new BannerConfiguration(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::D3.Account.BannerConfiguration.Descriptor; } - } - - public override BannerConfiguration DefaultInstanceForType { - get { return global::D3.Account.BannerConfiguration.DefaultInstance; } - } - - public override BannerConfiguration BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - BannerConfiguration returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is BannerConfiguration) { - return MergeFrom((BannerConfiguration) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(BannerConfiguration other) { - if (other == global::D3.Account.BannerConfiguration.DefaultInstance) return this; - if (other.HasBannerIndex) { - BannerIndex = other.BannerIndex; - } - if (other.HasSigilMain) { - SigilMain = other.SigilMain; - } - if (other.HasSigilAccent) { - SigilAccent = other.SigilAccent; - } - if (other.HasPatternColorIndex) { - PatternColorIndex = other.PatternColorIndex; - } - if (other.HasBackgroundColorIndex) { - BackgroundColorIndex = other.BackgroundColorIndex; - } - if (other.HasSigilColorIndex) { - SigilColorIndex = other.SigilColorIndex; - } - if (other.HasPlacementIndex) { - PlacementIndex = other.PlacementIndex; - } - if (other.HasPattern) { - Pattern = other.Pattern; - } - if (other.HasUseSigilVariant) { - UseSigilVariant = other.UseSigilVariant; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - BannerIndex = input.ReadUInt32(); - break; - } - case 16: { - SigilMain = input.ReadInt32(); - break; - } - case 24: { - SigilAccent = input.ReadInt32(); - break; - } - case 32: { - PatternColorIndex = input.ReadInt32(); - break; - } - case 40: { - BackgroundColorIndex = input.ReadInt32(); - break; - } - case 48: { - SigilColorIndex = input.ReadInt32(); - break; - } - case 56: { - PlacementIndex = input.ReadInt32(); - break; - } - case 64: { - Pattern = input.ReadInt32(); - break; - } - case 72: { - UseSigilVariant = input.ReadBool(); - break; - } - } - } - } - - - public bool HasBannerIndex { - get { return result.HasBannerIndex; } - } - public uint BannerIndex { - get { return result.BannerIndex; } - set { SetBannerIndex(value); } - } - public Builder SetBannerIndex(uint value) { - result.hasBannerIndex = true; - result.bannerIndex_ = value; - return this; - } - public Builder ClearBannerIndex() { - result.hasBannerIndex = false; - result.bannerIndex_ = 0; - return this; - } - - public bool HasSigilMain { - get { return result.HasSigilMain; } - } - public int SigilMain { - get { return result.SigilMain; } - set { SetSigilMain(value); } - } - public Builder SetSigilMain(int value) { - result.hasSigilMain = true; - result.sigilMain_ = value; - return this; - } - public Builder ClearSigilMain() { - result.hasSigilMain = false; - result.sigilMain_ = 0; - return this; - } - - public bool HasSigilAccent { - get { return result.HasSigilAccent; } - } - public int SigilAccent { - get { return result.SigilAccent; } - set { SetSigilAccent(value); } - } - public Builder SetSigilAccent(int value) { - result.hasSigilAccent = true; - result.sigilAccent_ = value; - return this; - } - public Builder ClearSigilAccent() { - result.hasSigilAccent = false; - result.sigilAccent_ = 0; - return this; - } - - public bool HasPatternColorIndex { - get { return result.HasPatternColorIndex; } - } - public int PatternColorIndex { - get { return result.PatternColorIndex; } - set { SetPatternColorIndex(value); } - } - public Builder SetPatternColorIndex(int value) { - result.hasPatternColorIndex = true; - result.patternColorIndex_ = value; - return this; - } - public Builder ClearPatternColorIndex() { - result.hasPatternColorIndex = false; - result.patternColorIndex_ = 0; - return this; - } - - public bool HasBackgroundColorIndex { - get { return result.HasBackgroundColorIndex; } - } - public int BackgroundColorIndex { - get { return result.BackgroundColorIndex; } - set { SetBackgroundColorIndex(value); } - } - public Builder SetBackgroundColorIndex(int value) { - result.hasBackgroundColorIndex = true; - result.backgroundColorIndex_ = value; - return this; - } - public Builder ClearBackgroundColorIndex() { - result.hasBackgroundColorIndex = false; - result.backgroundColorIndex_ = 0; - return this; - } - - public bool HasSigilColorIndex { - get { return result.HasSigilColorIndex; } - } - public int SigilColorIndex { - get { return result.SigilColorIndex; } - set { SetSigilColorIndex(value); } - } - public Builder SetSigilColorIndex(int value) { - result.hasSigilColorIndex = true; - result.sigilColorIndex_ = value; - return this; - } - public Builder ClearSigilColorIndex() { - result.hasSigilColorIndex = false; - result.sigilColorIndex_ = 0; - return this; - } - - public bool HasPlacementIndex { - get { return result.HasPlacementIndex; } - } - public int PlacementIndex { - get { return result.PlacementIndex; } - set { SetPlacementIndex(value); } - } - public Builder SetPlacementIndex(int value) { - result.hasPlacementIndex = true; - result.placementIndex_ = value; - return this; - } - public Builder ClearPlacementIndex() { - result.hasPlacementIndex = false; - result.placementIndex_ = 0; - return this; - } - - public bool HasPattern { - get { return result.HasPattern; } - } - public int Pattern { - get { return result.Pattern; } - set { SetPattern(value); } - } - public Builder SetPattern(int value) { - result.hasPattern = true; - result.pattern_ = value; - return this; - } - public Builder ClearPattern() { - result.hasPattern = false; - result.pattern_ = 0; - return this; - } - - public bool HasUseSigilVariant { - get { return result.HasUseSigilVariant; } - } - public bool UseSigilVariant { - get { return result.UseSigilVariant; } - set { SetUseSigilVariant(value); } - } - public Builder SetUseSigilVariant(bool value) { - result.hasUseSigilVariant = true; - result.useSigilVariant_ = value; - return this; - } - public Builder ClearUseSigilVariant() { - result.hasUseSigilVariant = false; - result.useSigilVariant_ = false; - return this; - } - } - static BannerConfiguration() { - object.ReferenceEquals(global::D3.Account.Account.Descriptor, null); - } - } - - public sealed partial class Digest : pb::GeneratedMessage { - private static readonly Digest defaultInstance = new Builder().BuildPartial(); - public static Digest DefaultInstance { - get { return defaultInstance; } - } - - public override Digest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override Digest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::D3.Account.Account.internal__static_D3_Account_Digest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::D3.Account.Account.internal__static_D3_Account_Digest__FieldAccessorTable; } - } - - #region Nested types - public static class Types { - public enum Flags { - HARDCORE_HERO_UNLOCKED = 1, - } - - } - #endregion - - public const int VersionFieldNumber = 1; - private bool hasVersion; - private uint version_ = 0; - public bool HasVersion { - get { return hasVersion; } - } - public uint Version { - get { return version_; } - } - - public const int LastPlayedHeroIdFieldNumber = 2; - private bool hasLastPlayedHeroId; - private global::D3.OnlineService.EntityId lastPlayedHeroId_ = global::D3.OnlineService.EntityId.DefaultInstance; - public bool HasLastPlayedHeroId { - get { return hasLastPlayedHeroId; } - } - public global::D3.OnlineService.EntityId LastPlayedHeroId { - get { return lastPlayedHeroId_; } - } - - public const int BannerConfigurationFieldNumber = 3; - private bool hasBannerConfiguration; - private global::D3.Account.BannerConfiguration bannerConfiguration_ = global::D3.Account.BannerConfiguration.DefaultInstance; - public bool HasBannerConfiguration { - get { return hasBannerConfiguration; } - } - public global::D3.Account.BannerConfiguration BannerConfiguration { - get { return bannerConfiguration_; } - } - - public const int FlagsFieldNumber = 4; - private bool hasFlags; - private uint flags_ = 0; - public bool HasFlags { - get { return hasFlags; } - } - public uint Flags { - get { return flags_; } - } - - public override bool IsInitialized { - get { - if (!hasVersion) return false; - if (!hasLastPlayedHeroId) return false; - if (!hasBannerConfiguration) return false; - if (!hasFlags) return false; - if (!LastPlayedHeroId.IsInitialized) return false; - if (!BannerConfiguration.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasVersion) { - output.WriteUInt32(1, Version); - } - if (HasLastPlayedHeroId) { - output.WriteMessage(2, LastPlayedHeroId); - } - if (HasBannerConfiguration) { - output.WriteMessage(3, BannerConfiguration); - } - if (HasFlags) { - output.WriteUInt32(4, Flags); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasVersion) { - size += pb::CodedOutputStream.ComputeUInt32Size(1, Version); - } - if (HasLastPlayedHeroId) { - size += pb::CodedOutputStream.ComputeMessageSize(2, LastPlayedHeroId); - } - if (HasBannerConfiguration) { - size += pb::CodedOutputStream.ComputeMessageSize(3, BannerConfiguration); - } - if (HasFlags) { - size += pb::CodedOutputStream.ComputeUInt32Size(4, Flags); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static Digest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Digest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Digest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Digest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Digest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Digest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Digest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Digest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Digest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Digest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Digest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - Digest result = new Digest(); - - protected override Digest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new Digest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::D3.Account.Digest.Descriptor; } - } - - public override Digest DefaultInstanceForType { - get { return global::D3.Account.Digest.DefaultInstance; } - } - - public override Digest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - Digest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Digest) { - return MergeFrom((Digest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Digest other) { - if (other == global::D3.Account.Digest.DefaultInstance) return this; - if (other.HasVersion) { - Version = other.Version; - } - if (other.HasLastPlayedHeroId) { - MergeLastPlayedHeroId(other.LastPlayedHeroId); - } - if (other.HasBannerConfiguration) { - MergeBannerConfiguration(other.BannerConfiguration); - } - if (other.HasFlags) { - Flags = other.Flags; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - Version = input.ReadUInt32(); - break; - } - case 18: { - global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); - if (HasLastPlayedHeroId) { - subBuilder.MergeFrom(LastPlayedHeroId); - } - input.ReadMessage(subBuilder, extensionRegistry); - LastPlayedHeroId = subBuilder.BuildPartial(); - break; - } - case 26: { - global::D3.Account.BannerConfiguration.Builder subBuilder = global::D3.Account.BannerConfiguration.CreateBuilder(); - if (HasBannerConfiguration) { - subBuilder.MergeFrom(BannerConfiguration); - } - input.ReadMessage(subBuilder, extensionRegistry); - BannerConfiguration = subBuilder.BuildPartial(); - break; - } - case 32: { - Flags = input.ReadUInt32(); - break; - } - } - } - } - - - public bool HasVersion { - get { return result.HasVersion; } - } - public uint Version { - get { return result.Version; } - set { SetVersion(value); } - } - public Builder SetVersion(uint value) { - result.hasVersion = true; - result.version_ = value; - return this; - } - public Builder ClearVersion() { - result.hasVersion = false; - result.version_ = 0; - return this; - } - - public bool HasLastPlayedHeroId { - get { return result.HasLastPlayedHeroId; } - } - public global::D3.OnlineService.EntityId LastPlayedHeroId { - get { return result.LastPlayedHeroId; } - set { SetLastPlayedHeroId(value); } - } - public Builder SetLastPlayedHeroId(global::D3.OnlineService.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasLastPlayedHeroId = true; - result.lastPlayedHeroId_ = value; - return this; - } - public Builder SetLastPlayedHeroId(global::D3.OnlineService.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasLastPlayedHeroId = true; - result.lastPlayedHeroId_ = builderForValue.Build(); - return this; - } - public Builder MergeLastPlayedHeroId(global::D3.OnlineService.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasLastPlayedHeroId && - result.lastPlayedHeroId_ != global::D3.OnlineService.EntityId.DefaultInstance) { - result.lastPlayedHeroId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.lastPlayedHeroId_).MergeFrom(value).BuildPartial(); - } else { - result.lastPlayedHeroId_ = value; - } - result.hasLastPlayedHeroId = true; - return this; - } - public Builder ClearLastPlayedHeroId() { - result.hasLastPlayedHeroId = false; - result.lastPlayedHeroId_ = global::D3.OnlineService.EntityId.DefaultInstance; - return this; - } - - public bool HasBannerConfiguration { - get { return result.HasBannerConfiguration; } - } - public global::D3.Account.BannerConfiguration BannerConfiguration { - get { return result.BannerConfiguration; } - set { SetBannerConfiguration(value); } - } - public Builder SetBannerConfiguration(global::D3.Account.BannerConfiguration value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBannerConfiguration = true; - result.bannerConfiguration_ = value; - return this; - } - public Builder SetBannerConfiguration(global::D3.Account.BannerConfiguration.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBannerConfiguration = true; - result.bannerConfiguration_ = builderForValue.Build(); - return this; - } - public Builder MergeBannerConfiguration(global::D3.Account.BannerConfiguration value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasBannerConfiguration && - result.bannerConfiguration_ != global::D3.Account.BannerConfiguration.DefaultInstance) { - result.bannerConfiguration_ = global::D3.Account.BannerConfiguration.CreateBuilder(result.bannerConfiguration_).MergeFrom(value).BuildPartial(); - } else { - result.bannerConfiguration_ = value; - } - result.hasBannerConfiguration = true; - return this; - } - public Builder ClearBannerConfiguration() { - result.hasBannerConfiguration = false; - result.bannerConfiguration_ = global::D3.Account.BannerConfiguration.DefaultInstance; - return this; - } - - public bool HasFlags { - get { return result.HasFlags; } - } - public uint Flags { - get { return result.Flags; } - set { SetFlags(value); } - } - public Builder SetFlags(uint value) { - result.hasFlags = true; - result.flags_ = value; - return this; - } - public Builder ClearFlags() { - result.hasFlags = false; - result.flags_ = 0; - return this; - } - } - static Digest() { - object.ReferenceEquals(global::D3.Account.Account.Descriptor, null); - } - } - - public sealed partial class SavedDefinition : pb::GeneratedMessage { - private static readonly SavedDefinition defaultInstance = new Builder().BuildPartial(); - public static SavedDefinition DefaultInstance { - get { return defaultInstance; } - } - - public override SavedDefinition DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override SavedDefinition ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::D3.Account.Account.internal__static_D3_Account_SavedDefinition__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::D3.Account.Account.internal__static_D3_Account_SavedDefinition__FieldAccessorTable; } - } - - public const int VersionFieldNumber = 1; - private bool hasVersion; - private uint version_ = 0; - public bool HasVersion { - get { return hasVersion; } - } - public uint Version { - get { return version_; } - } - - public const int DigestFieldNumber = 2; - private bool hasDigest; - private global::D3.Account.Digest digest_ = global::D3.Account.Digest.DefaultInstance; - public bool HasDigest { - get { return hasDigest; } - } - public global::D3.Account.Digest Digest { - get { return digest_; } - } - - public const int SavedAttributesFieldNumber = 3; - private bool hasSavedAttributes; - private global::D3.AttributeSerializer.SavedAttributes savedAttributes_ = global::D3.AttributeSerializer.SavedAttributes.DefaultInstance; - public bool HasSavedAttributes { - get { return hasSavedAttributes; } - } - public global::D3.AttributeSerializer.SavedAttributes SavedAttributes { - get { return savedAttributes_; } - } - - public const int NormalSharedSavedItemsFieldNumber = 4; - private bool hasNormalSharedSavedItems; - private global::D3.Items.ItemList normalSharedSavedItems_ = global::D3.Items.ItemList.DefaultInstance; - public bool HasNormalSharedSavedItems { - get { return hasNormalSharedSavedItems; } - } - public global::D3.Items.ItemList NormalSharedSavedItems { - get { return normalSharedSavedItems_; } - } - - public const int HardcoreSharedSavedItemsFieldNumber = 5; - private bool hasHardcoreSharedSavedItems; - private global::D3.Items.ItemList hardcoreSharedSavedItems_ = global::D3.Items.ItemList.DefaultInstance; - public bool HasHardcoreSharedSavedItems { - get { return hasHardcoreSharedSavedItems; } - } - public global::D3.Items.ItemList HardcoreSharedSavedItems { - get { return hardcoreSharedSavedItems_; } - } - - public const int CrafterSavedDataFieldNumber = 6; - private bool hasCrafterSavedData; - private global::D3.ItemCrafting.CrafterSavedData crafterSavedData_ = global::D3.ItemCrafting.CrafterSavedData.DefaultInstance; - public bool HasCrafterSavedData { - get { return hasCrafterSavedData; } - } - public global::D3.ItemCrafting.CrafterSavedData CrafterSavedData { - get { return crafterSavedData_; } - } - - public const int SeenTutorialsFieldNumber = 7; - private pbc::PopsicleList seenTutorials_ = new pbc::PopsicleList(); - public scg::IList SeenTutorialsList { - get { return pbc::Lists.AsReadOnly(seenTutorials_); } - } - public int SeenTutorialsCount { - get { return seenTutorials_.Count; } - } - public int GetSeenTutorials(int index) { - return seenTutorials_[index]; - } - - public override bool IsInitialized { - get { - if (!hasVersion) return false; - if (!hasSavedAttributes) return false; - if (HasDigest) { - if (!Digest.IsInitialized) return false; - } - if (!SavedAttributes.IsInitialized) return false; - if (HasNormalSharedSavedItems) { - if (!NormalSharedSavedItems.IsInitialized) return false; - } - if (HasHardcoreSharedSavedItems) { - if (!HardcoreSharedSavedItems.IsInitialized) return false; - } - if (HasCrafterSavedData) { - if (!CrafterSavedData.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasVersion) { - output.WriteUInt32(1, Version); - } - if (HasDigest) { - output.WriteMessage(2, Digest); - } - if (HasSavedAttributes) { - output.WriteMessage(3, SavedAttributes); - } - if (HasNormalSharedSavedItems) { - output.WriteMessage(4, NormalSharedSavedItems); - } - if (HasHardcoreSharedSavedItems) { - output.WriteMessage(5, HardcoreSharedSavedItems); - } - if (HasCrafterSavedData) { - output.WriteMessage(6, CrafterSavedData); - } - if (seenTutorials_.Count > 0) { - foreach (int element in seenTutorials_) { - output.WriteSFixed32(7, element); - } - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasVersion) { - size += pb::CodedOutputStream.ComputeUInt32Size(1, Version); - } - if (HasDigest) { - size += pb::CodedOutputStream.ComputeMessageSize(2, Digest); - } - if (HasSavedAttributes) { - size += pb::CodedOutputStream.ComputeMessageSize(3, SavedAttributes); - } - if (HasNormalSharedSavedItems) { - size += pb::CodedOutputStream.ComputeMessageSize(4, NormalSharedSavedItems); - } - if (HasHardcoreSharedSavedItems) { - size += pb::CodedOutputStream.ComputeMessageSize(5, HardcoreSharedSavedItems); - } - if (HasCrafterSavedData) { - size += pb::CodedOutputStream.ComputeMessageSize(6, CrafterSavedData); - } - { - int dataSize = 0; - dataSize = 4 * seenTutorials_.Count; - size += dataSize; - size += 1 * seenTutorials_.Count; - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static SavedDefinition ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SavedDefinition ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SavedDefinition ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SavedDefinition ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SavedDefinition ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SavedDefinition ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SavedDefinition ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SavedDefinition ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SavedDefinition ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SavedDefinition ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SavedDefinition prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - SavedDefinition result = new SavedDefinition(); - - protected override SavedDefinition MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new SavedDefinition(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::D3.Account.SavedDefinition.Descriptor; } - } - - public override SavedDefinition DefaultInstanceForType { - get { return global::D3.Account.SavedDefinition.DefaultInstance; } - } - - public override SavedDefinition BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.seenTutorials_.MakeReadOnly(); - SavedDefinition returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SavedDefinition) { - return MergeFrom((SavedDefinition) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SavedDefinition other) { - if (other == global::D3.Account.SavedDefinition.DefaultInstance) return this; - if (other.HasVersion) { - Version = other.Version; - } - if (other.HasDigest) { - MergeDigest(other.Digest); - } - if (other.HasSavedAttributes) { - MergeSavedAttributes(other.SavedAttributes); - } - if (other.HasNormalSharedSavedItems) { - MergeNormalSharedSavedItems(other.NormalSharedSavedItems); - } - if (other.HasHardcoreSharedSavedItems) { - MergeHardcoreSharedSavedItems(other.HardcoreSharedSavedItems); - } - if (other.HasCrafterSavedData) { - MergeCrafterSavedData(other.CrafterSavedData); - } - if (other.seenTutorials_.Count != 0) { - base.AddRange(other.seenTutorials_, result.seenTutorials_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - Version = input.ReadUInt32(); - break; - } - case 18: { - global::D3.Account.Digest.Builder subBuilder = global::D3.Account.Digest.CreateBuilder(); - if (HasDigest) { - subBuilder.MergeFrom(Digest); - } - input.ReadMessage(subBuilder, extensionRegistry); - Digest = subBuilder.BuildPartial(); - break; - } - case 26: { - global::D3.AttributeSerializer.SavedAttributes.Builder subBuilder = global::D3.AttributeSerializer.SavedAttributes.CreateBuilder(); - if (HasSavedAttributes) { - subBuilder.MergeFrom(SavedAttributes); - } - input.ReadMessage(subBuilder, extensionRegistry); - SavedAttributes = subBuilder.BuildPartial(); - break; - } - case 34: { - global::D3.Items.ItemList.Builder subBuilder = global::D3.Items.ItemList.CreateBuilder(); - if (HasNormalSharedSavedItems) { - subBuilder.MergeFrom(NormalSharedSavedItems); - } - input.ReadMessage(subBuilder, extensionRegistry); - NormalSharedSavedItems = subBuilder.BuildPartial(); - break; - } - case 42: { - global::D3.Items.ItemList.Builder subBuilder = global::D3.Items.ItemList.CreateBuilder(); - if (HasHardcoreSharedSavedItems) { - subBuilder.MergeFrom(HardcoreSharedSavedItems); - } - input.ReadMessage(subBuilder, extensionRegistry); - HardcoreSharedSavedItems = subBuilder.BuildPartial(); - break; - } - case 50: { - global::D3.ItemCrafting.CrafterSavedData.Builder subBuilder = global::D3.ItemCrafting.CrafterSavedData.CreateBuilder(); - if (HasCrafterSavedData) { - subBuilder.MergeFrom(CrafterSavedData); - } - input.ReadMessage(subBuilder, extensionRegistry); - CrafterSavedData = subBuilder.BuildPartial(); - break; - } - case 61: { - AddSeenTutorials(input.ReadSFixed32()); - break; - } - } - } - } - - - public bool HasVersion { - get { return result.HasVersion; } - } - public uint Version { - get { return result.Version; } - set { SetVersion(value); } - } - public Builder SetVersion(uint value) { - result.hasVersion = true; - result.version_ = value; - return this; - } - public Builder ClearVersion() { - result.hasVersion = false; - result.version_ = 0; - return this; - } - - public bool HasDigest { - get { return result.HasDigest; } - } - public global::D3.Account.Digest Digest { - get { return result.Digest; } - set { SetDigest(value); } - } - public Builder SetDigest(global::D3.Account.Digest value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasDigest = true; - result.digest_ = value; - return this; - } - public Builder SetDigest(global::D3.Account.Digest.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasDigest = true; - result.digest_ = builderForValue.Build(); - return this; - } - public Builder MergeDigest(global::D3.Account.Digest value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasDigest && - result.digest_ != global::D3.Account.Digest.DefaultInstance) { - result.digest_ = global::D3.Account.Digest.CreateBuilder(result.digest_).MergeFrom(value).BuildPartial(); - } else { - result.digest_ = value; - } - result.hasDigest = true; - return this; - } - public Builder ClearDigest() { - result.hasDigest = false; - result.digest_ = global::D3.Account.Digest.DefaultInstance; - return this; - } - - public bool HasSavedAttributes { - get { return result.HasSavedAttributes; } - } - public global::D3.AttributeSerializer.SavedAttributes SavedAttributes { - get { return result.SavedAttributes; } - set { SetSavedAttributes(value); } - } - public Builder SetSavedAttributes(global::D3.AttributeSerializer.SavedAttributes value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasSavedAttributes = true; - result.savedAttributes_ = value; - return this; - } - public Builder SetSavedAttributes(global::D3.AttributeSerializer.SavedAttributes.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasSavedAttributes = true; - result.savedAttributes_ = builderForValue.Build(); - return this; - } - public Builder MergeSavedAttributes(global::D3.AttributeSerializer.SavedAttributes value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasSavedAttributes && - result.savedAttributes_ != global::D3.AttributeSerializer.SavedAttributes.DefaultInstance) { - result.savedAttributes_ = global::D3.AttributeSerializer.SavedAttributes.CreateBuilder(result.savedAttributes_).MergeFrom(value).BuildPartial(); - } else { - result.savedAttributes_ = value; - } - result.hasSavedAttributes = true; - return this; - } - public Builder ClearSavedAttributes() { - result.hasSavedAttributes = false; - result.savedAttributes_ = global::D3.AttributeSerializer.SavedAttributes.DefaultInstance; - return this; - } - - public bool HasNormalSharedSavedItems { - get { return result.HasNormalSharedSavedItems; } - } - public global::D3.Items.ItemList NormalSharedSavedItems { - get { return result.NormalSharedSavedItems; } - set { SetNormalSharedSavedItems(value); } - } - public Builder SetNormalSharedSavedItems(global::D3.Items.ItemList value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasNormalSharedSavedItems = true; - result.normalSharedSavedItems_ = value; - return this; - } - public Builder SetNormalSharedSavedItems(global::D3.Items.ItemList.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasNormalSharedSavedItems = true; - result.normalSharedSavedItems_ = builderForValue.Build(); - return this; - } - public Builder MergeNormalSharedSavedItems(global::D3.Items.ItemList value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasNormalSharedSavedItems && - result.normalSharedSavedItems_ != global::D3.Items.ItemList.DefaultInstance) { - result.normalSharedSavedItems_ = global::D3.Items.ItemList.CreateBuilder(result.normalSharedSavedItems_).MergeFrom(value).BuildPartial(); - } else { - result.normalSharedSavedItems_ = value; - } - result.hasNormalSharedSavedItems = true; - return this; - } - public Builder ClearNormalSharedSavedItems() { - result.hasNormalSharedSavedItems = false; - result.normalSharedSavedItems_ = global::D3.Items.ItemList.DefaultInstance; - return this; - } - - public bool HasHardcoreSharedSavedItems { - get { return result.HasHardcoreSharedSavedItems; } - } - public global::D3.Items.ItemList HardcoreSharedSavedItems { - get { return result.HardcoreSharedSavedItems; } - set { SetHardcoreSharedSavedItems(value); } - } - public Builder SetHardcoreSharedSavedItems(global::D3.Items.ItemList value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasHardcoreSharedSavedItems = true; - result.hardcoreSharedSavedItems_ = value; - return this; - } - public Builder SetHardcoreSharedSavedItems(global::D3.Items.ItemList.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasHardcoreSharedSavedItems = true; - result.hardcoreSharedSavedItems_ = builderForValue.Build(); - return this; - } - public Builder MergeHardcoreSharedSavedItems(global::D3.Items.ItemList value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasHardcoreSharedSavedItems && - result.hardcoreSharedSavedItems_ != global::D3.Items.ItemList.DefaultInstance) { - result.hardcoreSharedSavedItems_ = global::D3.Items.ItemList.CreateBuilder(result.hardcoreSharedSavedItems_).MergeFrom(value).BuildPartial(); - } else { - result.hardcoreSharedSavedItems_ = value; - } - result.hasHardcoreSharedSavedItems = true; - return this; - } - public Builder ClearHardcoreSharedSavedItems() { - result.hasHardcoreSharedSavedItems = false; - result.hardcoreSharedSavedItems_ = global::D3.Items.ItemList.DefaultInstance; - return this; - } - - public bool HasCrafterSavedData { - get { return result.HasCrafterSavedData; } - } - public global::D3.ItemCrafting.CrafterSavedData CrafterSavedData { - get { return result.CrafterSavedData; } - set { SetCrafterSavedData(value); } - } - public Builder SetCrafterSavedData(global::D3.ItemCrafting.CrafterSavedData value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasCrafterSavedData = true; - result.crafterSavedData_ = value; - return this; - } - public Builder SetCrafterSavedData(global::D3.ItemCrafting.CrafterSavedData.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasCrafterSavedData = true; - result.crafterSavedData_ = builderForValue.Build(); - return this; - } - public Builder MergeCrafterSavedData(global::D3.ItemCrafting.CrafterSavedData value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasCrafterSavedData && - result.crafterSavedData_ != global::D3.ItemCrafting.CrafterSavedData.DefaultInstance) { - result.crafterSavedData_ = global::D3.ItemCrafting.CrafterSavedData.CreateBuilder(result.crafterSavedData_).MergeFrom(value).BuildPartial(); - } else { - result.crafterSavedData_ = value; - } - result.hasCrafterSavedData = true; - return this; - } - public Builder ClearCrafterSavedData() { - result.hasCrafterSavedData = false; - result.crafterSavedData_ = global::D3.ItemCrafting.CrafterSavedData.DefaultInstance; - return this; - } - - public pbc::IPopsicleList SeenTutorialsList { - get { return result.seenTutorials_; } - } - public int SeenTutorialsCount { - get { return result.SeenTutorialsCount; } - } - public int GetSeenTutorials(int index) { - return result.GetSeenTutorials(index); - } - public Builder SetSeenTutorials(int index, int value) { - result.seenTutorials_[index] = value; - return this; - } - public Builder AddSeenTutorials(int value) { - result.seenTutorials_.Add(value); - return this; - } - public Builder AddRangeSeenTutorials(scg::IEnumerable values) { - base.AddRange(values, result.seenTutorials_); - return this; - } - public Builder ClearSeenTutorials() { - result.seenTutorials_.Clear(); - return this; - } - } - static SavedDefinition() { - object.ReferenceEquals(global::D3.Account.Account.Descriptor, null); - } - } - - #endregion - -} diff --git a/source/D3Proto/D3/Client/Settings.cs b/source/D3Proto/D3/Client/Settings.cs deleted file mode 100644 index c363f557..00000000 --- a/source/D3Proto/D3/Client/Settings.cs +++ /dev/null @@ -1,525 +0,0 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace D3.Client { - - public static partial class Settings { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_D3_Client_ToonSettings__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Client_ToonSettings__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_D3_Client_GameAccountSettings__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Client_GameAccountSettings__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static Settings() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "Cg5TZXR0aW5ncy5wcm90bxIJRDMuQ2xpZW50IiAKDFRvb25TZXR0aW5ncxIQ" + - "Cgh1aV9mbGFncxgBIAEoDSJIChNHYW1lQWNjb3VudFNldHRpbmdzEhUKDXVz" + - "ZV9sYXN0X2hlcm8YASABKAUSGgoSc2hvd19vZmZsaW5lX3RvYXN0GAIgASgF"); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_D3_Client_ToonSettings__Descriptor = Descriptor.MessageTypes[0]; - internal__static_D3_Client_ToonSettings__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Client_ToonSettings__Descriptor, - new string[] { "UiFlags", }); - internal__static_D3_Client_GameAccountSettings__Descriptor = Descriptor.MessageTypes[1]; - internal__static_D3_Client_GameAccountSettings__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Client_GameAccountSettings__Descriptor, - new string[] { "UseLastHero", "ShowOfflineToast", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - }, assigner); - } - #endregion - - } - #region Messages - public sealed partial class ToonSettings : pb::GeneratedMessage { - private static readonly ToonSettings defaultInstance = new Builder().BuildPartial(); - public static ToonSettings DefaultInstance { - get { return defaultInstance; } - } - - public override ToonSettings DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ToonSettings ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::D3.Client.Settings.internal__static_D3_Client_ToonSettings__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::D3.Client.Settings.internal__static_D3_Client_ToonSettings__FieldAccessorTable; } - } - - public const int UiFlagsFieldNumber = 1; - private bool hasUiFlags; - private uint uiFlags_ = 0; - public bool HasUiFlags { - get { return hasUiFlags; } - } - public uint UiFlags { - get { return uiFlags_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasUiFlags) { - output.WriteUInt32(1, UiFlags); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasUiFlags) { - size += pb::CodedOutputStream.ComputeUInt32Size(1, UiFlags); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ToonSettings ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ToonSettings ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ToonSettings ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ToonSettings ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ToonSettings ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ToonSettings ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ToonSettings ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ToonSettings ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ToonSettings ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ToonSettings ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ToonSettings prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ToonSettings result = new ToonSettings(); - - protected override ToonSettings MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ToonSettings(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::D3.Client.ToonSettings.Descriptor; } - } - - public override ToonSettings DefaultInstanceForType { - get { return global::D3.Client.ToonSettings.DefaultInstance; } - } - - public override ToonSettings BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - ToonSettings returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ToonSettings) { - return MergeFrom((ToonSettings) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ToonSettings other) { - if (other == global::D3.Client.ToonSettings.DefaultInstance) return this; - if (other.HasUiFlags) { - UiFlags = other.UiFlags; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - UiFlags = input.ReadUInt32(); - break; - } - } - } - } - - - public bool HasUiFlags { - get { return result.HasUiFlags; } - } - public uint UiFlags { - get { return result.UiFlags; } - set { SetUiFlags(value); } - } - public Builder SetUiFlags(uint value) { - result.hasUiFlags = true; - result.uiFlags_ = value; - return this; - } - public Builder ClearUiFlags() { - result.hasUiFlags = false; - result.uiFlags_ = 0; - return this; - } - } - static ToonSettings() { - object.ReferenceEquals(global::D3.Client.Settings.Descriptor, null); - } - } - - public sealed partial class GameAccountSettings : pb::GeneratedMessage { - private static readonly GameAccountSettings defaultInstance = new Builder().BuildPartial(); - public static GameAccountSettings DefaultInstance { - get { return defaultInstance; } - } - - public override GameAccountSettings DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override GameAccountSettings ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::D3.Client.Settings.internal__static_D3_Client_GameAccountSettings__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::D3.Client.Settings.internal__static_D3_Client_GameAccountSettings__FieldAccessorTable; } - } - - public const int UseLastHeroFieldNumber = 1; - private bool hasUseLastHero; - private int useLastHero_ = 0; - public bool HasUseLastHero { - get { return hasUseLastHero; } - } - public int UseLastHero { - get { return useLastHero_; } - } - - public const int ShowOfflineToastFieldNumber = 2; - private bool hasShowOfflineToast; - private int showOfflineToast_ = 0; - public bool HasShowOfflineToast { - get { return hasShowOfflineToast; } - } - public int ShowOfflineToast { - get { return showOfflineToast_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasUseLastHero) { - output.WriteInt32(1, UseLastHero); - } - if (HasShowOfflineToast) { - output.WriteInt32(2, ShowOfflineToast); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasUseLastHero) { - size += pb::CodedOutputStream.ComputeInt32Size(1, UseLastHero); - } - if (HasShowOfflineToast) { - size += pb::CodedOutputStream.ComputeInt32Size(2, ShowOfflineToast); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static GameAccountSettings ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static GameAccountSettings ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static GameAccountSettings ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static GameAccountSettings ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static GameAccountSettings ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static GameAccountSettings ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static GameAccountSettings ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static GameAccountSettings ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static GameAccountSettings ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static GameAccountSettings ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(GameAccountSettings prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - GameAccountSettings result = new GameAccountSettings(); - - protected override GameAccountSettings MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new GameAccountSettings(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::D3.Client.GameAccountSettings.Descriptor; } - } - - public override GameAccountSettings DefaultInstanceForType { - get { return global::D3.Client.GameAccountSettings.DefaultInstance; } - } - - public override GameAccountSettings BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - GameAccountSettings returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is GameAccountSettings) { - return MergeFrom((GameAccountSettings) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(GameAccountSettings other) { - if (other == global::D3.Client.GameAccountSettings.DefaultInstance) return this; - if (other.HasUseLastHero) { - UseLastHero = other.UseLastHero; - } - if (other.HasShowOfflineToast) { - ShowOfflineToast = other.ShowOfflineToast; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - UseLastHero = input.ReadInt32(); - break; - } - case 16: { - ShowOfflineToast = input.ReadInt32(); - break; - } - } - } - } - - - public bool HasUseLastHero { - get { return result.HasUseLastHero; } - } - public int UseLastHero { - get { return result.UseLastHero; } - set { SetUseLastHero(value); } - } - public Builder SetUseLastHero(int value) { - result.hasUseLastHero = true; - result.useLastHero_ = value; - return this; - } - public Builder ClearUseLastHero() { - result.hasUseLastHero = false; - result.useLastHero_ = 0; - return this; - } - - public bool HasShowOfflineToast { - get { return result.HasShowOfflineToast; } - } - public int ShowOfflineToast { - get { return result.ShowOfflineToast; } - set { SetShowOfflineToast(value); } - } - public Builder SetShowOfflineToast(int value) { - result.hasShowOfflineToast = true; - result.showOfflineToast_ = value; - return this; - } - public Builder ClearShowOfflineToast() { - result.hasShowOfflineToast = false; - result.showOfflineToast_ = 0; - return this; - } - } - static GameAccountSettings() { - object.ReferenceEquals(global::D3.Client.Settings.Descriptor, null); - } - } - - #endregion - -} diff --git a/source/D3Proto/D3/GameMessage/GameMessage.cs b/source/D3Proto/D3/GameMessage/GameMessage.cs deleted file mode 100644 index d55ab9e0..00000000 --- a/source/D3Proto/D3/GameMessage/GameMessage.cs +++ /dev/null @@ -1,2721 +0,0 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace D3.GameMessage { - - public static partial class GameMessage { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_D3_GameMessage_HeroDigestList__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_HeroDigestList__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_D3_GameMessage_ClientToonSettings__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_ClientToonSettings__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_D3_GameMessage_HeroDigestListRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_HeroDigestListRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_D3_GameMessage_HeroDigestResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_HeroDigestResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_D3_GameMessage_HeroDigestListResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_HeroDigestListResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_D3_GameMessage_PlayerBanner__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_PlayerBanner__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_D3_GameMessage_SaveBannerConfiguration__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_SaveBannerConfiguration__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_D3_GameMessage_HeroDigestBanner__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_HeroDigestBanner__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_D3_GameMessage_GameCurrentPlayers__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_GameCurrentPlayers__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static GameMessage() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "ChFHYW1lTWVzc2FnZS5wcm90bxIORDMuR2FtZU1lc3NhZ2UaCkhlcm8ucHJv" + - "dG8aE09ubGluZVNlcnZpY2UucHJvdG8aDlNldHRpbmdzLnByb3RvGg1BY2Nv" + - "dW50LnByb3RvImYKDkhlcm9EaWdlc3RMaXN0Ei4KCmFjY291bnRfaWQYASAC" + - "KAsyGi5EMy5PbmxpbmVTZXJ2aWNlLkVudGl0eUlkEiQKC2RpZ2VzdF9saXN0" + - "GAIgAygLMg8uRDMuSGVyby5EaWdlc3QieAoSQ2xpZW50VG9vblNldHRpbmdz" + - "EisKB3Rvb25faWQYASACKAsyGi5EMy5PbmxpbmVTZXJ2aWNlLkVudGl0eUlk" + - "EjUKFGNsaWVudF90b29uX3NldHRpbmdzGAIgAigLMhcuRDMuQ2xpZW50LlRv" + - "b25TZXR0aW5ncyJEChVIZXJvRGlnZXN0TGlzdFJlcXVlc3QSKwoHdG9vbl9p" + - "ZBgBIAMoCzIaLkQzLk9ubGluZVNlcnZpY2UuRW50aXR5SWQieAoSSGVyb0Rp" + - "Z2VzdFJlc3BvbnNlEisKB3Rvb25faWQYASACKAsyGi5EMy5PbmxpbmVTZXJ2" + - "aWNlLkVudGl0eUlkEg8KB3N1Y2Nlc3MYAiACKAgSJAoLaGVyb19kaWdlc3QY" + - "AyABKAsyDy5EMy5IZXJvLkRpZ2VzdCJRChZIZXJvRGlnZXN0TGlzdFJlc3Bv" + - "bnNlEjcKC2RpZ2VzdF9saXN0GAEgAygLMiIuRDMuR2FtZU1lc3NhZ2UuSGVy" + - "b0RpZ2VzdFJlc3BvbnNlIlUKDFBsYXllckJhbm5lchIUCgxwbGF5ZXJfaW5k" + - "ZXgYASACKA0SLwoGYmFubmVyGAIgAigLMh8uRDMuQWNjb3VudC5CYW5uZXJD" + - "b25maWd1cmF0aW9uInMKF1NhdmVCYW5uZXJDb25maWd1cmF0aW9uEi8KBmJh" + - "bm5lchgBIAIoCzIfLkQzLkFjY291bnQuQmFubmVyQ29uZmlndXJhdGlvbhIS" + - "CgpzbG90X2luZGV4GAIgASgNEhMKC21ha2VfYWN0aXZlGAMgASgIImkKEEhl" + - "cm9EaWdlc3RCYW5uZXISJAoLaGVyb19kaWdlc3QYASACKAsyDy5EMy5IZXJv" + - "LkRpZ2VzdBIvCgZiYW5uZXIYAiACKAsyHy5EMy5BY2NvdW50LkJhbm5lckNv" + - "bmZpZ3VyYXRpb24iRwoSR2FtZUN1cnJlbnRQbGF5ZXJzEjEKB3BsYXllcnMY" + - "ASADKAsyIC5EMy5HYW1lTWVzc2FnZS5IZXJvRGlnZXN0QmFubmVy"); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_D3_GameMessage_HeroDigestList__Descriptor = Descriptor.MessageTypes[0]; - internal__static_D3_GameMessage_HeroDigestList__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_HeroDigestList__Descriptor, - new string[] { "AccountId", "DigestList", }); - internal__static_D3_GameMessage_ClientToonSettings__Descriptor = Descriptor.MessageTypes[1]; - internal__static_D3_GameMessage_ClientToonSettings__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_ClientToonSettings__Descriptor, - new string[] { "ToonId", "ClientToonSettings_", }); - internal__static_D3_GameMessage_HeroDigestListRequest__Descriptor = Descriptor.MessageTypes[2]; - internal__static_D3_GameMessage_HeroDigestListRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_HeroDigestListRequest__Descriptor, - new string[] { "ToonId", }); - internal__static_D3_GameMessage_HeroDigestResponse__Descriptor = Descriptor.MessageTypes[3]; - internal__static_D3_GameMessage_HeroDigestResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_HeroDigestResponse__Descriptor, - new string[] { "ToonId", "Success", "HeroDigest", }); - internal__static_D3_GameMessage_HeroDigestListResponse__Descriptor = Descriptor.MessageTypes[4]; - internal__static_D3_GameMessage_HeroDigestListResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_HeroDigestListResponse__Descriptor, - new string[] { "DigestList", }); - internal__static_D3_GameMessage_PlayerBanner__Descriptor = Descriptor.MessageTypes[5]; - internal__static_D3_GameMessage_PlayerBanner__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_PlayerBanner__Descriptor, - new string[] { "PlayerIndex", "Banner", }); - internal__static_D3_GameMessage_SaveBannerConfiguration__Descriptor = Descriptor.MessageTypes[6]; - internal__static_D3_GameMessage_SaveBannerConfiguration__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_SaveBannerConfiguration__Descriptor, - new string[] { "Banner", "SlotIndex", "MakeActive", }); - internal__static_D3_GameMessage_HeroDigestBanner__Descriptor = Descriptor.MessageTypes[7]; - internal__static_D3_GameMessage_HeroDigestBanner__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_HeroDigestBanner__Descriptor, - new string[] { "HeroDigest", "Banner", }); - internal__static_D3_GameMessage_GameCurrentPlayers__Descriptor = Descriptor.MessageTypes[8]; - internal__static_D3_GameMessage_GameCurrentPlayers__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_GameCurrentPlayers__Descriptor, - new string[] { "Players", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::D3.Hero.Hero.Descriptor, - global::D3.OnlineService.OnlineService.Descriptor, - global::D3.Client.Settings.Descriptor, - global::D3.Account.Account.Descriptor, - }, assigner); - } - #endregion - - } - #region Messages - public sealed partial class HeroDigestList : pb::GeneratedMessage { - private static readonly HeroDigestList defaultInstance = new Builder().BuildPartial(); - public static HeroDigestList DefaultInstance { - get { return defaultInstance; } - } - - public override HeroDigestList DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override HeroDigestList ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_HeroDigestList__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_HeroDigestList__FieldAccessorTable; } - } - - public const int AccountIdFieldNumber = 1; - private bool hasAccountId; - private global::D3.OnlineService.EntityId accountId_ = global::D3.OnlineService.EntityId.DefaultInstance; - public bool HasAccountId { - get { return hasAccountId; } - } - public global::D3.OnlineService.EntityId AccountId { - get { return accountId_; } - } - - public const int DigestListFieldNumber = 2; - private pbc::PopsicleList digestList_ = new pbc::PopsicleList(); - public scg::IList DigestListList { - get { return digestList_; } - } - public int DigestListCount { - get { return digestList_.Count; } - } - public global::D3.Hero.Digest GetDigestList(int index) { - return digestList_[index]; - } - - public override bool IsInitialized { - get { - if (!hasAccountId) return false; - if (!AccountId.IsInitialized) return false; - foreach (global::D3.Hero.Digest element in DigestListList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasAccountId) { - output.WriteMessage(1, AccountId); - } - foreach (global::D3.Hero.Digest element in DigestListList) { - output.WriteMessage(2, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasAccountId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, AccountId); - } - foreach (global::D3.Hero.Digest element in DigestListList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static HeroDigestList ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static HeroDigestList ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static HeroDigestList ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static HeroDigestList ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static HeroDigestList ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static HeroDigestList ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static HeroDigestList ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static HeroDigestList ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static HeroDigestList ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static HeroDigestList ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(HeroDigestList prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - HeroDigestList result = new HeroDigestList(); - - protected override HeroDigestList MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new HeroDigestList(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::D3.GameMessage.HeroDigestList.Descriptor; } - } - - public override HeroDigestList DefaultInstanceForType { - get { return global::D3.GameMessage.HeroDigestList.DefaultInstance; } - } - - public override HeroDigestList BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.digestList_.MakeReadOnly(); - HeroDigestList returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is HeroDigestList) { - return MergeFrom((HeroDigestList) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(HeroDigestList other) { - if (other == global::D3.GameMessage.HeroDigestList.DefaultInstance) return this; - if (other.HasAccountId) { - MergeAccountId(other.AccountId); - } - if (other.digestList_.Count != 0) { - base.AddRange(other.digestList_, result.digestList_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); - if (HasAccountId) { - subBuilder.MergeFrom(AccountId); - } - input.ReadMessage(subBuilder, extensionRegistry); - AccountId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::D3.Hero.Digest.Builder subBuilder = global::D3.Hero.Digest.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddDigestList(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public bool HasAccountId { - get { return result.HasAccountId; } - } - public global::D3.OnlineService.EntityId AccountId { - get { return result.AccountId; } - set { SetAccountId(value); } - } - public Builder SetAccountId(global::D3.OnlineService.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasAccountId = true; - result.accountId_ = value; - return this; - } - public Builder SetAccountId(global::D3.OnlineService.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasAccountId = true; - result.accountId_ = builderForValue.Build(); - return this; - } - public Builder MergeAccountId(global::D3.OnlineService.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAccountId && - result.accountId_ != global::D3.OnlineService.EntityId.DefaultInstance) { - result.accountId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.accountId_).MergeFrom(value).BuildPartial(); - } else { - result.accountId_ = value; - } - result.hasAccountId = true; - return this; - } - public Builder ClearAccountId() { - result.hasAccountId = false; - result.accountId_ = global::D3.OnlineService.EntityId.DefaultInstance; - return this; - } - - public pbc::IPopsicleList DigestListList { - get { return result.digestList_; } - } - public int DigestListCount { - get { return result.DigestListCount; } - } - public global::D3.Hero.Digest GetDigestList(int index) { - return result.GetDigestList(index); - } - public Builder SetDigestList(int index, global::D3.Hero.Digest value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.digestList_[index] = value; - return this; - } - public Builder SetDigestList(int index, global::D3.Hero.Digest.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.digestList_[index] = builderForValue.Build(); - return this; - } - public Builder AddDigestList(global::D3.Hero.Digest value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.digestList_.Add(value); - return this; - } - public Builder AddDigestList(global::D3.Hero.Digest.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.digestList_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeDigestList(scg::IEnumerable values) { - base.AddRange(values, result.digestList_); - return this; - } - public Builder ClearDigestList() { - result.digestList_.Clear(); - return this; - } - } - static HeroDigestList() { - object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); - } - } - - public sealed partial class ClientToonSettings : pb::GeneratedMessage { - private static readonly ClientToonSettings defaultInstance = new Builder().BuildPartial(); - public static ClientToonSettings DefaultInstance { - get { return defaultInstance; } - } - - public override ClientToonSettings DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ClientToonSettings ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_ClientToonSettings__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_ClientToonSettings__FieldAccessorTable; } - } - - public const int ToonIdFieldNumber = 1; - private bool hasToonId; - private global::D3.OnlineService.EntityId toonId_ = global::D3.OnlineService.EntityId.DefaultInstance; - public bool HasToonId { - get { return hasToonId; } - } - public global::D3.OnlineService.EntityId ToonId { - get { return toonId_; } - } - - public const int ClientToonSettings_FieldNumber = 2; - private bool hasClientToonSettings_; - private global::D3.Client.ToonSettings clientToonSettings_ = global::D3.Client.ToonSettings.DefaultInstance; - public bool HasClientToonSettings_ { - get { return hasClientToonSettings_; } - } - public global::D3.Client.ToonSettings ClientToonSettings_ { - get { return clientToonSettings_; } - } - - public override bool IsInitialized { - get { - if (!hasToonId) return false; - if (!hasClientToonSettings_) return false; - if (!ToonId.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasToonId) { - output.WriteMessage(1, ToonId); - } - if (HasClientToonSettings_) { - output.WriteMessage(2, ClientToonSettings_); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasToonId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, ToonId); - } - if (HasClientToonSettings_) { - size += pb::CodedOutputStream.ComputeMessageSize(2, ClientToonSettings_); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ClientToonSettings ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ClientToonSettings ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ClientToonSettings ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ClientToonSettings ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ClientToonSettings ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ClientToonSettings ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ClientToonSettings ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ClientToonSettings ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ClientToonSettings ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ClientToonSettings ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ClientToonSettings prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ClientToonSettings result = new ClientToonSettings(); - - protected override ClientToonSettings MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ClientToonSettings(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::D3.GameMessage.ClientToonSettings.Descriptor; } - } - - public override ClientToonSettings DefaultInstanceForType { - get { return global::D3.GameMessage.ClientToonSettings.DefaultInstance; } - } - - public override ClientToonSettings BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - ClientToonSettings returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ClientToonSettings) { - return MergeFrom((ClientToonSettings) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ClientToonSettings other) { - if (other == global::D3.GameMessage.ClientToonSettings.DefaultInstance) return this; - if (other.HasToonId) { - MergeToonId(other.ToonId); - } - if (other.HasClientToonSettings_) { - MergeClientToonSettings_(other.ClientToonSettings_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); - if (HasToonId) { - subBuilder.MergeFrom(ToonId); - } - input.ReadMessage(subBuilder, extensionRegistry); - ToonId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::D3.Client.ToonSettings.Builder subBuilder = global::D3.Client.ToonSettings.CreateBuilder(); - if (HasClientToonSettings_) { - subBuilder.MergeFrom(ClientToonSettings_); - } - input.ReadMessage(subBuilder, extensionRegistry); - ClientToonSettings_ = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasToonId { - get { return result.HasToonId; } - } - public global::D3.OnlineService.EntityId ToonId { - get { return result.ToonId; } - set { SetToonId(value); } - } - public Builder SetToonId(global::D3.OnlineService.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasToonId = true; - result.toonId_ = value; - return this; - } - public Builder SetToonId(global::D3.OnlineService.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasToonId = true; - result.toonId_ = builderForValue.Build(); - return this; - } - public Builder MergeToonId(global::D3.OnlineService.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasToonId && - result.toonId_ != global::D3.OnlineService.EntityId.DefaultInstance) { - result.toonId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.toonId_).MergeFrom(value).BuildPartial(); - } else { - result.toonId_ = value; - } - result.hasToonId = true; - return this; - } - public Builder ClearToonId() { - result.hasToonId = false; - result.toonId_ = global::D3.OnlineService.EntityId.DefaultInstance; - return this; - } - - public bool HasClientToonSettings_ { - get { return result.HasClientToonSettings_; } - } - public global::D3.Client.ToonSettings ClientToonSettings_ { - get { return result.ClientToonSettings_; } - set { SetClientToonSettings_(value); } - } - public Builder SetClientToonSettings_(global::D3.Client.ToonSettings value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasClientToonSettings_ = true; - result.clientToonSettings_ = value; - return this; - } - public Builder SetClientToonSettings_(global::D3.Client.ToonSettings.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasClientToonSettings_ = true; - result.clientToonSettings_ = builderForValue.Build(); - return this; - } - public Builder MergeClientToonSettings_(global::D3.Client.ToonSettings value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasClientToonSettings_ && - result.clientToonSettings_ != global::D3.Client.ToonSettings.DefaultInstance) { - result.clientToonSettings_ = global::D3.Client.ToonSettings.CreateBuilder(result.clientToonSettings_).MergeFrom(value).BuildPartial(); - } else { - result.clientToonSettings_ = value; - } - result.hasClientToonSettings_ = true; - return this; - } - public Builder ClearClientToonSettings_() { - result.hasClientToonSettings_ = false; - result.clientToonSettings_ = global::D3.Client.ToonSettings.DefaultInstance; - return this; - } - } - static ClientToonSettings() { - object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); - } - } - - public sealed partial class HeroDigestListRequest : pb::GeneratedMessage { - private static readonly HeroDigestListRequest defaultInstance = new Builder().BuildPartial(); - public static HeroDigestListRequest DefaultInstance { - get { return defaultInstance; } - } - - public override HeroDigestListRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override HeroDigestListRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_HeroDigestListRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_HeroDigestListRequest__FieldAccessorTable; } - } - - public const int ToonIdFieldNumber = 1; - private pbc::PopsicleList toonId_ = new pbc::PopsicleList(); - public scg::IList ToonIdList { - get { return toonId_; } - } - public int ToonIdCount { - get { return toonId_.Count; } - } - public global::D3.OnlineService.EntityId GetToonId(int index) { - return toonId_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::D3.OnlineService.EntityId element in ToonIdList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::D3.OnlineService.EntityId element in ToonIdList) { - output.WriteMessage(1, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::D3.OnlineService.EntityId element in ToonIdList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static HeroDigestListRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static HeroDigestListRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static HeroDigestListRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static HeroDigestListRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static HeroDigestListRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static HeroDigestListRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static HeroDigestListRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static HeroDigestListRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static HeroDigestListRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static HeroDigestListRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(HeroDigestListRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - HeroDigestListRequest result = new HeroDigestListRequest(); - - protected override HeroDigestListRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new HeroDigestListRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::D3.GameMessage.HeroDigestListRequest.Descriptor; } - } - - public override HeroDigestListRequest DefaultInstanceForType { - get { return global::D3.GameMessage.HeroDigestListRequest.DefaultInstance; } - } - - public override HeroDigestListRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.toonId_.MakeReadOnly(); - HeroDigestListRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is HeroDigestListRequest) { - return MergeFrom((HeroDigestListRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(HeroDigestListRequest other) { - if (other == global::D3.GameMessage.HeroDigestListRequest.DefaultInstance) return this; - if (other.toonId_.Count != 0) { - base.AddRange(other.toonId_, result.toonId_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddToonId(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public pbc::IPopsicleList ToonIdList { - get { return result.toonId_; } - } - public int ToonIdCount { - get { return result.ToonIdCount; } - } - public global::D3.OnlineService.EntityId GetToonId(int index) { - return result.GetToonId(index); - } - public Builder SetToonId(int index, global::D3.OnlineService.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.toonId_[index] = value; - return this; - } - public Builder SetToonId(int index, global::D3.OnlineService.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.toonId_[index] = builderForValue.Build(); - return this; - } - public Builder AddToonId(global::D3.OnlineService.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.toonId_.Add(value); - return this; - } - public Builder AddToonId(global::D3.OnlineService.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.toonId_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeToonId(scg::IEnumerable values) { - base.AddRange(values, result.toonId_); - return this; - } - public Builder ClearToonId() { - result.toonId_.Clear(); - return this; - } - } - static HeroDigestListRequest() { - object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); - } - } - - public sealed partial class HeroDigestResponse : pb::GeneratedMessage { - private static readonly HeroDigestResponse defaultInstance = new Builder().BuildPartial(); - public static HeroDigestResponse DefaultInstance { - get { return defaultInstance; } - } - - public override HeroDigestResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override HeroDigestResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_HeroDigestResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_HeroDigestResponse__FieldAccessorTable; } - } - - public const int ToonIdFieldNumber = 1; - private bool hasToonId; - private global::D3.OnlineService.EntityId toonId_ = global::D3.OnlineService.EntityId.DefaultInstance; - public bool HasToonId { - get { return hasToonId; } - } - public global::D3.OnlineService.EntityId ToonId { - get { return toonId_; } - } - - public const int SuccessFieldNumber = 2; - private bool hasSuccess; - private bool success_ = false; - public bool HasSuccess { - get { return hasSuccess; } - } - public bool Success { - get { return success_; } - } - - public const int HeroDigestFieldNumber = 3; - private bool hasHeroDigest; - private global::D3.Hero.Digest heroDigest_ = global::D3.Hero.Digest.DefaultInstance; - public bool HasHeroDigest { - get { return hasHeroDigest; } - } - public global::D3.Hero.Digest HeroDigest { - get { return heroDigest_; } - } - - public override bool IsInitialized { - get { - if (!hasToonId) return false; - if (!hasSuccess) return false; - if (!ToonId.IsInitialized) return false; - if (HasHeroDigest) { - if (!HeroDigest.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasToonId) { - output.WriteMessage(1, ToonId); - } - if (HasSuccess) { - output.WriteBool(2, Success); - } - if (HasHeroDigest) { - output.WriteMessage(3, HeroDigest); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasToonId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, ToonId); - } - if (HasSuccess) { - size += pb::CodedOutputStream.ComputeBoolSize(2, Success); - } - if (HasHeroDigest) { - size += pb::CodedOutputStream.ComputeMessageSize(3, HeroDigest); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static HeroDigestResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static HeroDigestResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static HeroDigestResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static HeroDigestResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static HeroDigestResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static HeroDigestResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static HeroDigestResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static HeroDigestResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static HeroDigestResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static HeroDigestResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(HeroDigestResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - HeroDigestResponse result = new HeroDigestResponse(); - - protected override HeroDigestResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new HeroDigestResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::D3.GameMessage.HeroDigestResponse.Descriptor; } - } - - public override HeroDigestResponse DefaultInstanceForType { - get { return global::D3.GameMessage.HeroDigestResponse.DefaultInstance; } - } - - public override HeroDigestResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - HeroDigestResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is HeroDigestResponse) { - return MergeFrom((HeroDigestResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(HeroDigestResponse other) { - if (other == global::D3.GameMessage.HeroDigestResponse.DefaultInstance) return this; - if (other.HasToonId) { - MergeToonId(other.ToonId); - } - if (other.HasSuccess) { - Success = other.Success; - } - if (other.HasHeroDigest) { - MergeHeroDigest(other.HeroDigest); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); - if (HasToonId) { - subBuilder.MergeFrom(ToonId); - } - input.ReadMessage(subBuilder, extensionRegistry); - ToonId = subBuilder.BuildPartial(); - break; - } - case 16: { - Success = input.ReadBool(); - break; - } - case 26: { - global::D3.Hero.Digest.Builder subBuilder = global::D3.Hero.Digest.CreateBuilder(); - if (HasHeroDigest) { - subBuilder.MergeFrom(HeroDigest); - } - input.ReadMessage(subBuilder, extensionRegistry); - HeroDigest = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasToonId { - get { return result.HasToonId; } - } - public global::D3.OnlineService.EntityId ToonId { - get { return result.ToonId; } - set { SetToonId(value); } - } - public Builder SetToonId(global::D3.OnlineService.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasToonId = true; - result.toonId_ = value; - return this; - } - public Builder SetToonId(global::D3.OnlineService.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasToonId = true; - result.toonId_ = builderForValue.Build(); - return this; - } - public Builder MergeToonId(global::D3.OnlineService.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasToonId && - result.toonId_ != global::D3.OnlineService.EntityId.DefaultInstance) { - result.toonId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.toonId_).MergeFrom(value).BuildPartial(); - } else { - result.toonId_ = value; - } - result.hasToonId = true; - return this; - } - public Builder ClearToonId() { - result.hasToonId = false; - result.toonId_ = global::D3.OnlineService.EntityId.DefaultInstance; - return this; - } - - public bool HasSuccess { - get { return result.HasSuccess; } - } - public bool Success { - get { return result.Success; } - set { SetSuccess(value); } - } - public Builder SetSuccess(bool value) { - result.hasSuccess = true; - result.success_ = value; - return this; - } - public Builder ClearSuccess() { - result.hasSuccess = false; - result.success_ = false; - return this; - } - - public bool HasHeroDigest { - get { return result.HasHeroDigest; } - } - public global::D3.Hero.Digest HeroDigest { - get { return result.HeroDigest; } - set { SetHeroDigest(value); } - } - public Builder SetHeroDigest(global::D3.Hero.Digest value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasHeroDigest = true; - result.heroDigest_ = value; - return this; - } - public Builder SetHeroDigest(global::D3.Hero.Digest.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasHeroDigest = true; - result.heroDigest_ = builderForValue.Build(); - return this; - } - public Builder MergeHeroDigest(global::D3.Hero.Digest value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasHeroDigest && - result.heroDigest_ != global::D3.Hero.Digest.DefaultInstance) { - result.heroDigest_ = global::D3.Hero.Digest.CreateBuilder(result.heroDigest_).MergeFrom(value).BuildPartial(); - } else { - result.heroDigest_ = value; - } - result.hasHeroDigest = true; - return this; - } - public Builder ClearHeroDigest() { - result.hasHeroDigest = false; - result.heroDigest_ = global::D3.Hero.Digest.DefaultInstance; - return this; - } - } - static HeroDigestResponse() { - object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); - } - } - - public sealed partial class HeroDigestListResponse : pb::GeneratedMessage { - private static readonly HeroDigestListResponse defaultInstance = new Builder().BuildPartial(); - public static HeroDigestListResponse DefaultInstance { - get { return defaultInstance; } - } - - public override HeroDigestListResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override HeroDigestListResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_HeroDigestListResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_HeroDigestListResponse__FieldAccessorTable; } - } - - public const int DigestListFieldNumber = 1; - private pbc::PopsicleList digestList_ = new pbc::PopsicleList(); - public scg::IList DigestListList { - get { return digestList_; } - } - public int DigestListCount { - get { return digestList_.Count; } - } - public global::D3.GameMessage.HeroDigestResponse GetDigestList(int index) { - return digestList_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::D3.GameMessage.HeroDigestResponse element in DigestListList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::D3.GameMessage.HeroDigestResponse element in DigestListList) { - output.WriteMessage(1, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::D3.GameMessage.HeroDigestResponse element in DigestListList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static HeroDigestListResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static HeroDigestListResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static HeroDigestListResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static HeroDigestListResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static HeroDigestListResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static HeroDigestListResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static HeroDigestListResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static HeroDigestListResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static HeroDigestListResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static HeroDigestListResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(HeroDigestListResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - HeroDigestListResponse result = new HeroDigestListResponse(); - - protected override HeroDigestListResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new HeroDigestListResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::D3.GameMessage.HeroDigestListResponse.Descriptor; } - } - - public override HeroDigestListResponse DefaultInstanceForType { - get { return global::D3.GameMessage.HeroDigestListResponse.DefaultInstance; } - } - - public override HeroDigestListResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.digestList_.MakeReadOnly(); - HeroDigestListResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is HeroDigestListResponse) { - return MergeFrom((HeroDigestListResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(HeroDigestListResponse other) { - if (other == global::D3.GameMessage.HeroDigestListResponse.DefaultInstance) return this; - if (other.digestList_.Count != 0) { - base.AddRange(other.digestList_, result.digestList_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::D3.GameMessage.HeroDigestResponse.Builder subBuilder = global::D3.GameMessage.HeroDigestResponse.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddDigestList(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public pbc::IPopsicleList DigestListList { - get { return result.digestList_; } - } - public int DigestListCount { - get { return result.DigestListCount; } - } - public global::D3.GameMessage.HeroDigestResponse GetDigestList(int index) { - return result.GetDigestList(index); - } - public Builder SetDigestList(int index, global::D3.GameMessage.HeroDigestResponse value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.digestList_[index] = value; - return this; - } - public Builder SetDigestList(int index, global::D3.GameMessage.HeroDigestResponse.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.digestList_[index] = builderForValue.Build(); - return this; - } - public Builder AddDigestList(global::D3.GameMessage.HeroDigestResponse value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.digestList_.Add(value); - return this; - } - public Builder AddDigestList(global::D3.GameMessage.HeroDigestResponse.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.digestList_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeDigestList(scg::IEnumerable values) { - base.AddRange(values, result.digestList_); - return this; - } - public Builder ClearDigestList() { - result.digestList_.Clear(); - return this; - } - } - static HeroDigestListResponse() { - object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); - } - } - - public sealed partial class PlayerBanner : pb::GeneratedMessage { - private static readonly PlayerBanner defaultInstance = new Builder().BuildPartial(); - public static PlayerBanner DefaultInstance { - get { return defaultInstance; } - } - - public override PlayerBanner DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override PlayerBanner ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_PlayerBanner__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_PlayerBanner__FieldAccessorTable; } - } - - public const int PlayerIndexFieldNumber = 1; - private bool hasPlayerIndex; - private uint playerIndex_ = 0; - public bool HasPlayerIndex { - get { return hasPlayerIndex; } - } - public uint PlayerIndex { - get { return playerIndex_; } - } - - public const int BannerFieldNumber = 2; - private bool hasBanner; - private global::D3.Account.BannerConfiguration banner_ = global::D3.Account.BannerConfiguration.DefaultInstance; - public bool HasBanner { - get { return hasBanner; } - } - public global::D3.Account.BannerConfiguration Banner { - get { return banner_; } - } - - public override bool IsInitialized { - get { - if (!hasPlayerIndex) return false; - if (!hasBanner) return false; - if (!Banner.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasPlayerIndex) { - output.WriteUInt32(1, PlayerIndex); - } - if (HasBanner) { - output.WriteMessage(2, Banner); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasPlayerIndex) { - size += pb::CodedOutputStream.ComputeUInt32Size(1, PlayerIndex); - } - if (HasBanner) { - size += pb::CodedOutputStream.ComputeMessageSize(2, Banner); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static PlayerBanner ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PlayerBanner ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PlayerBanner ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PlayerBanner ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PlayerBanner ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PlayerBanner ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static PlayerBanner ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static PlayerBanner ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static PlayerBanner ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PlayerBanner ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(PlayerBanner prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - PlayerBanner result = new PlayerBanner(); - - protected override PlayerBanner MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new PlayerBanner(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::D3.GameMessage.PlayerBanner.Descriptor; } - } - - public override PlayerBanner DefaultInstanceForType { - get { return global::D3.GameMessage.PlayerBanner.DefaultInstance; } - } - - public override PlayerBanner BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - PlayerBanner returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is PlayerBanner) { - return MergeFrom((PlayerBanner) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(PlayerBanner other) { - if (other == global::D3.GameMessage.PlayerBanner.DefaultInstance) return this; - if (other.HasPlayerIndex) { - PlayerIndex = other.PlayerIndex; - } - if (other.HasBanner) { - MergeBanner(other.Banner); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - PlayerIndex = input.ReadUInt32(); - break; - } - case 18: { - global::D3.Account.BannerConfiguration.Builder subBuilder = global::D3.Account.BannerConfiguration.CreateBuilder(); - if (HasBanner) { - subBuilder.MergeFrom(Banner); - } - input.ReadMessage(subBuilder, extensionRegistry); - Banner = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasPlayerIndex { - get { return result.HasPlayerIndex; } - } - public uint PlayerIndex { - get { return result.PlayerIndex; } - set { SetPlayerIndex(value); } - } - public Builder SetPlayerIndex(uint value) { - result.hasPlayerIndex = true; - result.playerIndex_ = value; - return this; - } - public Builder ClearPlayerIndex() { - result.hasPlayerIndex = false; - result.playerIndex_ = 0; - return this; - } - - public bool HasBanner { - get { return result.HasBanner; } - } - public global::D3.Account.BannerConfiguration Banner { - get { return result.Banner; } - set { SetBanner(value); } - } - public Builder SetBanner(global::D3.Account.BannerConfiguration value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBanner = true; - result.banner_ = value; - return this; - } - public Builder SetBanner(global::D3.Account.BannerConfiguration.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBanner = true; - result.banner_ = builderForValue.Build(); - return this; - } - public Builder MergeBanner(global::D3.Account.BannerConfiguration value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasBanner && - result.banner_ != global::D3.Account.BannerConfiguration.DefaultInstance) { - result.banner_ = global::D3.Account.BannerConfiguration.CreateBuilder(result.banner_).MergeFrom(value).BuildPartial(); - } else { - result.banner_ = value; - } - result.hasBanner = true; - return this; - } - public Builder ClearBanner() { - result.hasBanner = false; - result.banner_ = global::D3.Account.BannerConfiguration.DefaultInstance; - return this; - } - } - static PlayerBanner() { - object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); - } - } - - public sealed partial class SaveBannerConfiguration : pb::GeneratedMessage { - private static readonly SaveBannerConfiguration defaultInstance = new Builder().BuildPartial(); - public static SaveBannerConfiguration DefaultInstance { - get { return defaultInstance; } - } - - public override SaveBannerConfiguration DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override SaveBannerConfiguration ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_SaveBannerConfiguration__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_SaveBannerConfiguration__FieldAccessorTable; } - } - - public const int BannerFieldNumber = 1; - private bool hasBanner; - private global::D3.Account.BannerConfiguration banner_ = global::D3.Account.BannerConfiguration.DefaultInstance; - public bool HasBanner { - get { return hasBanner; } - } - public global::D3.Account.BannerConfiguration Banner { - get { return banner_; } - } - - public const int SlotIndexFieldNumber = 2; - private bool hasSlotIndex; - private uint slotIndex_ = 0; - public bool HasSlotIndex { - get { return hasSlotIndex; } - } - public uint SlotIndex { - get { return slotIndex_; } - } - - public const int MakeActiveFieldNumber = 3; - private bool hasMakeActive; - private bool makeActive_ = false; - public bool HasMakeActive { - get { return hasMakeActive; } - } - public bool MakeActive { - get { return makeActive_; } - } - - public override bool IsInitialized { - get { - if (!hasBanner) return false; - if (!Banner.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasBanner) { - output.WriteMessage(1, Banner); - } - if (HasSlotIndex) { - output.WriteUInt32(2, SlotIndex); - } - if (HasMakeActive) { - output.WriteBool(3, MakeActive); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasBanner) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Banner); - } - if (HasSlotIndex) { - size += pb::CodedOutputStream.ComputeUInt32Size(2, SlotIndex); - } - if (HasMakeActive) { - size += pb::CodedOutputStream.ComputeBoolSize(3, MakeActive); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static SaveBannerConfiguration ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SaveBannerConfiguration ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SaveBannerConfiguration ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SaveBannerConfiguration ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SaveBannerConfiguration ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SaveBannerConfiguration ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SaveBannerConfiguration ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SaveBannerConfiguration ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SaveBannerConfiguration ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SaveBannerConfiguration ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SaveBannerConfiguration prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - SaveBannerConfiguration result = new SaveBannerConfiguration(); - - protected override SaveBannerConfiguration MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new SaveBannerConfiguration(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::D3.GameMessage.SaveBannerConfiguration.Descriptor; } - } - - public override SaveBannerConfiguration DefaultInstanceForType { - get { return global::D3.GameMessage.SaveBannerConfiguration.DefaultInstance; } - } - - public override SaveBannerConfiguration BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - SaveBannerConfiguration returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SaveBannerConfiguration) { - return MergeFrom((SaveBannerConfiguration) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SaveBannerConfiguration other) { - if (other == global::D3.GameMessage.SaveBannerConfiguration.DefaultInstance) return this; - if (other.HasBanner) { - MergeBanner(other.Banner); - } - if (other.HasSlotIndex) { - SlotIndex = other.SlotIndex; - } - if (other.HasMakeActive) { - MakeActive = other.MakeActive; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::D3.Account.BannerConfiguration.Builder subBuilder = global::D3.Account.BannerConfiguration.CreateBuilder(); - if (HasBanner) { - subBuilder.MergeFrom(Banner); - } - input.ReadMessage(subBuilder, extensionRegistry); - Banner = subBuilder.BuildPartial(); - break; - } - case 16: { - SlotIndex = input.ReadUInt32(); - break; - } - case 24: { - MakeActive = input.ReadBool(); - break; - } - } - } - } - - - public bool HasBanner { - get { return result.HasBanner; } - } - public global::D3.Account.BannerConfiguration Banner { - get { return result.Banner; } - set { SetBanner(value); } - } - public Builder SetBanner(global::D3.Account.BannerConfiguration value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBanner = true; - result.banner_ = value; - return this; - } - public Builder SetBanner(global::D3.Account.BannerConfiguration.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBanner = true; - result.banner_ = builderForValue.Build(); - return this; - } - public Builder MergeBanner(global::D3.Account.BannerConfiguration value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasBanner && - result.banner_ != global::D3.Account.BannerConfiguration.DefaultInstance) { - result.banner_ = global::D3.Account.BannerConfiguration.CreateBuilder(result.banner_).MergeFrom(value).BuildPartial(); - } else { - result.banner_ = value; - } - result.hasBanner = true; - return this; - } - public Builder ClearBanner() { - result.hasBanner = false; - result.banner_ = global::D3.Account.BannerConfiguration.DefaultInstance; - return this; - } - - public bool HasSlotIndex { - get { return result.HasSlotIndex; } - } - public uint SlotIndex { - get { return result.SlotIndex; } - set { SetSlotIndex(value); } - } - public Builder SetSlotIndex(uint value) { - result.hasSlotIndex = true; - result.slotIndex_ = value; - return this; - } - public Builder ClearSlotIndex() { - result.hasSlotIndex = false; - result.slotIndex_ = 0; - return this; - } - - public bool HasMakeActive { - get { return result.HasMakeActive; } - } - public bool MakeActive { - get { return result.MakeActive; } - set { SetMakeActive(value); } - } - public Builder SetMakeActive(bool value) { - result.hasMakeActive = true; - result.makeActive_ = value; - return this; - } - public Builder ClearMakeActive() { - result.hasMakeActive = false; - result.makeActive_ = false; - return this; - } - } - static SaveBannerConfiguration() { - object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); - } - } - - public sealed partial class HeroDigestBanner : pb::GeneratedMessage { - private static readonly HeroDigestBanner defaultInstance = new Builder().BuildPartial(); - public static HeroDigestBanner DefaultInstance { - get { return defaultInstance; } - } - - public override HeroDigestBanner DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override HeroDigestBanner ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_HeroDigestBanner__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_HeroDigestBanner__FieldAccessorTable; } - } - - public const int HeroDigestFieldNumber = 1; - private bool hasHeroDigest; - private global::D3.Hero.Digest heroDigest_ = global::D3.Hero.Digest.DefaultInstance; - public bool HasHeroDigest { - get { return hasHeroDigest; } - } - public global::D3.Hero.Digest HeroDigest { - get { return heroDigest_; } - } - - public const int BannerFieldNumber = 2; - private bool hasBanner; - private global::D3.Account.BannerConfiguration banner_ = global::D3.Account.BannerConfiguration.DefaultInstance; - public bool HasBanner { - get { return hasBanner; } - } - public global::D3.Account.BannerConfiguration Banner { - get { return banner_; } - } - - public override bool IsInitialized { - get { - if (!hasHeroDigest) return false; - if (!hasBanner) return false; - if (!HeroDigest.IsInitialized) return false; - if (!Banner.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasHeroDigest) { - output.WriteMessage(1, HeroDigest); - } - if (HasBanner) { - output.WriteMessage(2, Banner); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasHeroDigest) { - size += pb::CodedOutputStream.ComputeMessageSize(1, HeroDigest); - } - if (HasBanner) { - size += pb::CodedOutputStream.ComputeMessageSize(2, Banner); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static HeroDigestBanner ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static HeroDigestBanner ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static HeroDigestBanner ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static HeroDigestBanner ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static HeroDigestBanner ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static HeroDigestBanner ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static HeroDigestBanner ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static HeroDigestBanner ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static HeroDigestBanner ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static HeroDigestBanner ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(HeroDigestBanner prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - HeroDigestBanner result = new HeroDigestBanner(); - - protected override HeroDigestBanner MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new HeroDigestBanner(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::D3.GameMessage.HeroDigestBanner.Descriptor; } - } - - public override HeroDigestBanner DefaultInstanceForType { - get { return global::D3.GameMessage.HeroDigestBanner.DefaultInstance; } - } - - public override HeroDigestBanner BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - HeroDigestBanner returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is HeroDigestBanner) { - return MergeFrom((HeroDigestBanner) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(HeroDigestBanner other) { - if (other == global::D3.GameMessage.HeroDigestBanner.DefaultInstance) return this; - if (other.HasHeroDigest) { - MergeHeroDigest(other.HeroDigest); - } - if (other.HasBanner) { - MergeBanner(other.Banner); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::D3.Hero.Digest.Builder subBuilder = global::D3.Hero.Digest.CreateBuilder(); - if (HasHeroDigest) { - subBuilder.MergeFrom(HeroDigest); - } - input.ReadMessage(subBuilder, extensionRegistry); - HeroDigest = subBuilder.BuildPartial(); - break; - } - case 18: { - global::D3.Account.BannerConfiguration.Builder subBuilder = global::D3.Account.BannerConfiguration.CreateBuilder(); - if (HasBanner) { - subBuilder.MergeFrom(Banner); - } - input.ReadMessage(subBuilder, extensionRegistry); - Banner = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasHeroDigest { - get { return result.HasHeroDigest; } - } - public global::D3.Hero.Digest HeroDigest { - get { return result.HeroDigest; } - set { SetHeroDigest(value); } - } - public Builder SetHeroDigest(global::D3.Hero.Digest value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasHeroDigest = true; - result.heroDigest_ = value; - return this; - } - public Builder SetHeroDigest(global::D3.Hero.Digest.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasHeroDigest = true; - result.heroDigest_ = builderForValue.Build(); - return this; - } - public Builder MergeHeroDigest(global::D3.Hero.Digest value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasHeroDigest && - result.heroDigest_ != global::D3.Hero.Digest.DefaultInstance) { - result.heroDigest_ = global::D3.Hero.Digest.CreateBuilder(result.heroDigest_).MergeFrom(value).BuildPartial(); - } else { - result.heroDigest_ = value; - } - result.hasHeroDigest = true; - return this; - } - public Builder ClearHeroDigest() { - result.hasHeroDigest = false; - result.heroDigest_ = global::D3.Hero.Digest.DefaultInstance; - return this; - } - - public bool HasBanner { - get { return result.HasBanner; } - } - public global::D3.Account.BannerConfiguration Banner { - get { return result.Banner; } - set { SetBanner(value); } - } - public Builder SetBanner(global::D3.Account.BannerConfiguration value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBanner = true; - result.banner_ = value; - return this; - } - public Builder SetBanner(global::D3.Account.BannerConfiguration.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBanner = true; - result.banner_ = builderForValue.Build(); - return this; - } - public Builder MergeBanner(global::D3.Account.BannerConfiguration value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasBanner && - result.banner_ != global::D3.Account.BannerConfiguration.DefaultInstance) { - result.banner_ = global::D3.Account.BannerConfiguration.CreateBuilder(result.banner_).MergeFrom(value).BuildPartial(); - } else { - result.banner_ = value; - } - result.hasBanner = true; - return this; - } - public Builder ClearBanner() { - result.hasBanner = false; - result.banner_ = global::D3.Account.BannerConfiguration.DefaultInstance; - return this; - } - } - static HeroDigestBanner() { - object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); - } - } - - public sealed partial class GameCurrentPlayers : pb::GeneratedMessage { - private static readonly GameCurrentPlayers defaultInstance = new Builder().BuildPartial(); - public static GameCurrentPlayers DefaultInstance { - get { return defaultInstance; } - } - - public override GameCurrentPlayers DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override GameCurrentPlayers ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_GameCurrentPlayers__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_GameCurrentPlayers__FieldAccessorTable; } - } - - public const int PlayersFieldNumber = 1; - private pbc::PopsicleList players_ = new pbc::PopsicleList(); - public scg::IList PlayersList { - get { return players_; } - } - public int PlayersCount { - get { return players_.Count; } - } - public global::D3.GameMessage.HeroDigestBanner GetPlayers(int index) { - return players_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::D3.GameMessage.HeroDigestBanner element in PlayersList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::D3.GameMessage.HeroDigestBanner element in PlayersList) { - output.WriteMessage(1, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::D3.GameMessage.HeroDigestBanner element in PlayersList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static GameCurrentPlayers ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static GameCurrentPlayers ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static GameCurrentPlayers ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static GameCurrentPlayers ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static GameCurrentPlayers ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static GameCurrentPlayers ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static GameCurrentPlayers ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static GameCurrentPlayers ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static GameCurrentPlayers ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static GameCurrentPlayers ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(GameCurrentPlayers prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - GameCurrentPlayers result = new GameCurrentPlayers(); - - protected override GameCurrentPlayers MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new GameCurrentPlayers(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::D3.GameMessage.GameCurrentPlayers.Descriptor; } - } - - public override GameCurrentPlayers DefaultInstanceForType { - get { return global::D3.GameMessage.GameCurrentPlayers.DefaultInstance; } - } - - public override GameCurrentPlayers BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.players_.MakeReadOnly(); - GameCurrentPlayers returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is GameCurrentPlayers) { - return MergeFrom((GameCurrentPlayers) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(GameCurrentPlayers other) { - if (other == global::D3.GameMessage.GameCurrentPlayers.DefaultInstance) return this; - if (other.players_.Count != 0) { - base.AddRange(other.players_, result.players_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::D3.GameMessage.HeroDigestBanner.Builder subBuilder = global::D3.GameMessage.HeroDigestBanner.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddPlayers(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public pbc::IPopsicleList PlayersList { - get { return result.players_; } - } - public int PlayersCount { - get { return result.PlayersCount; } - } - public global::D3.GameMessage.HeroDigestBanner GetPlayers(int index) { - return result.GetPlayers(index); - } - public Builder SetPlayers(int index, global::D3.GameMessage.HeroDigestBanner value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.players_[index] = value; - return this; - } - public Builder SetPlayers(int index, global::D3.GameMessage.HeroDigestBanner.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.players_[index] = builderForValue.Build(); - return this; - } - public Builder AddPlayers(global::D3.GameMessage.HeroDigestBanner value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.players_.Add(value); - return this; - } - public Builder AddPlayers(global::D3.GameMessage.HeroDigestBanner.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.players_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangePlayers(scg::IEnumerable values) { - base.AddRange(values, result.players_); - return this; - } - public Builder ClearPlayers() { - result.players_.Clear(); - return this; - } - } - static GameCurrentPlayers() { - object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); - } - } - - #endregion - -} diff --git a/source/D3Proto/D3/PartyMessage/PartyMessage.cs b/source/D3Proto/D3/PartyMessage/PartyMessage.cs deleted file mode 100644 index b4feabe9..00000000 --- a/source/D3Proto/D3/PartyMessage/PartyMessage.cs +++ /dev/null @@ -1,680 +0,0 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace D3.PartyMessage { - - public static partial class PartyMessage { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_D3_PartyMessage_ScreenStatus__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_PartyMessage_ScreenStatus__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_D3_PartyMessage_SearchForPublicGameParams__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_PartyMessage_SearchForPublicGameParams__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static PartyMessage() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "ChJQYXJ0eU1lc3NhZ2UucHJvdG8SD0QzLlBhcnR5TWVzc2FnZRoTT25saW5l" + - "U2VydmljZS5wcm90byIuCgxTY3JlZW5TdGF0dXMSDgoGc2NyZWVuGAEgAigF" + - "Eg4KBnN0YXR1cxgCIAIoBSKaAQoZU2VhcmNoRm9yUHVibGljR2FtZVBhcmFt" + - "cxISCgpzdGFydF90aW1lGAEgASgSEhkKEXNlY29uZHNfdG9fc2VhcmNoGAIg" + - "ASgNEjcKC2dhbWVfcGFyYW1zGAMgASgLMiIuRDMuT25saW5lU2VydmljZS5H" + - "YW1lQ3JlYXRlUGFyYW1zEhUKDXJlbW92ZV9yZWFzb24YBCABKAU="); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_D3_PartyMessage_ScreenStatus__Descriptor = Descriptor.MessageTypes[0]; - internal__static_D3_PartyMessage_ScreenStatus__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_D3_PartyMessage_ScreenStatus__Descriptor, - new string[] { "Screen", "Status", }); - internal__static_D3_PartyMessage_SearchForPublicGameParams__Descriptor = Descriptor.MessageTypes[1]; - internal__static_D3_PartyMessage_SearchForPublicGameParams__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_D3_PartyMessage_SearchForPublicGameParams__Descriptor, - new string[] { "StartTime", "SecondsToSearch", "GameParams", "RemoveReason", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::D3.OnlineService.OnlineService.Descriptor, - }, assigner); - } - #endregion - - } - #region Messages - public sealed partial class ScreenStatus : pb::GeneratedMessage { - private static readonly ScreenStatus defaultInstance = new Builder().BuildPartial(); - public static ScreenStatus DefaultInstance { - get { return defaultInstance; } - } - - public override ScreenStatus DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ScreenStatus ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::D3.PartyMessage.PartyMessage.internal__static_D3_PartyMessage_ScreenStatus__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::D3.PartyMessage.PartyMessage.internal__static_D3_PartyMessage_ScreenStatus__FieldAccessorTable; } - } - - public const int ScreenFieldNumber = 1; - private bool hasScreen; - private int screen_ = 0; - public bool HasScreen { - get { return hasScreen; } - } - public int Screen { - get { return screen_; } - } - - public const int StatusFieldNumber = 2; - private bool hasStatus; - private int status_ = 0; - public bool HasStatus { - get { return hasStatus; } - } - public int Status { - get { return status_; } - } - - public override bool IsInitialized { - get { - if (!hasScreen) return false; - if (!hasStatus) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasScreen) { - output.WriteInt32(1, Screen); - } - if (HasStatus) { - output.WriteInt32(2, Status); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasScreen) { - size += pb::CodedOutputStream.ComputeInt32Size(1, Screen); - } - if (HasStatus) { - size += pb::CodedOutputStream.ComputeInt32Size(2, Status); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ScreenStatus ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ScreenStatus ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ScreenStatus ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ScreenStatus ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ScreenStatus ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ScreenStatus ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ScreenStatus ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ScreenStatus ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ScreenStatus ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ScreenStatus ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ScreenStatus prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ScreenStatus result = new ScreenStatus(); - - protected override ScreenStatus MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ScreenStatus(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::D3.PartyMessage.ScreenStatus.Descriptor; } - } - - public override ScreenStatus DefaultInstanceForType { - get { return global::D3.PartyMessage.ScreenStatus.DefaultInstance; } - } - - public override ScreenStatus BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - ScreenStatus returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ScreenStatus) { - return MergeFrom((ScreenStatus) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ScreenStatus other) { - if (other == global::D3.PartyMessage.ScreenStatus.DefaultInstance) return this; - if (other.HasScreen) { - Screen = other.Screen; - } - if (other.HasStatus) { - Status = other.Status; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - Screen = input.ReadInt32(); - break; - } - case 16: { - Status = input.ReadInt32(); - break; - } - } - } - } - - - public bool HasScreen { - get { return result.HasScreen; } - } - public int Screen { - get { return result.Screen; } - set { SetScreen(value); } - } - public Builder SetScreen(int value) { - result.hasScreen = true; - result.screen_ = value; - return this; - } - public Builder ClearScreen() { - result.hasScreen = false; - result.screen_ = 0; - return this; - } - - public bool HasStatus { - get { return result.HasStatus; } - } - public int Status { - get { return result.Status; } - set { SetStatus(value); } - } - public Builder SetStatus(int value) { - result.hasStatus = true; - result.status_ = value; - return this; - } - public Builder ClearStatus() { - result.hasStatus = false; - result.status_ = 0; - return this; - } - } - static ScreenStatus() { - object.ReferenceEquals(global::D3.PartyMessage.PartyMessage.Descriptor, null); - } - } - - public sealed partial class SearchForPublicGameParams : pb::GeneratedMessage { - private static readonly SearchForPublicGameParams defaultInstance = new Builder().BuildPartial(); - public static SearchForPublicGameParams DefaultInstance { - get { return defaultInstance; } - } - - public override SearchForPublicGameParams DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override SearchForPublicGameParams ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::D3.PartyMessage.PartyMessage.internal__static_D3_PartyMessage_SearchForPublicGameParams__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::D3.PartyMessage.PartyMessage.internal__static_D3_PartyMessage_SearchForPublicGameParams__FieldAccessorTable; } - } - - public const int StartTimeFieldNumber = 1; - private bool hasStartTime; - private long startTime_ = 0; - public bool HasStartTime { - get { return hasStartTime; } - } - public long StartTime { - get { return startTime_; } - } - - public const int SecondsToSearchFieldNumber = 2; - private bool hasSecondsToSearch; - private uint secondsToSearch_ = 0; - public bool HasSecondsToSearch { - get { return hasSecondsToSearch; } - } - public uint SecondsToSearch { - get { return secondsToSearch_; } - } - - public const int GameParamsFieldNumber = 3; - private bool hasGameParams; - private global::D3.OnlineService.GameCreateParams gameParams_ = global::D3.OnlineService.GameCreateParams.DefaultInstance; - public bool HasGameParams { - get { return hasGameParams; } - } - public global::D3.OnlineService.GameCreateParams GameParams { - get { return gameParams_; } - } - - public const int RemoveReasonFieldNumber = 4; - private bool hasRemoveReason; - private int removeReason_ = 0; - public bool HasRemoveReason { - get { return hasRemoveReason; } - } - public int RemoveReason { - get { return removeReason_; } - } - - public override bool IsInitialized { - get { - if (HasGameParams) { - if (!GameParams.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasStartTime) { - output.WriteSInt64(1, StartTime); - } - if (HasSecondsToSearch) { - output.WriteUInt32(2, SecondsToSearch); - } - if (HasGameParams) { - output.WriteMessage(3, GameParams); - } - if (HasRemoveReason) { - output.WriteInt32(4, RemoveReason); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasStartTime) { - size += pb::CodedOutputStream.ComputeSInt64Size(1, StartTime); - } - if (HasSecondsToSearch) { - size += pb::CodedOutputStream.ComputeUInt32Size(2, SecondsToSearch); - } - if (HasGameParams) { - size += pb::CodedOutputStream.ComputeMessageSize(3, GameParams); - } - if (HasRemoveReason) { - size += pb::CodedOutputStream.ComputeInt32Size(4, RemoveReason); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static SearchForPublicGameParams ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SearchForPublicGameParams ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SearchForPublicGameParams ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SearchForPublicGameParams ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SearchForPublicGameParams ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SearchForPublicGameParams ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SearchForPublicGameParams ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SearchForPublicGameParams ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SearchForPublicGameParams ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SearchForPublicGameParams ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SearchForPublicGameParams prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - SearchForPublicGameParams result = new SearchForPublicGameParams(); - - protected override SearchForPublicGameParams MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new SearchForPublicGameParams(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::D3.PartyMessage.SearchForPublicGameParams.Descriptor; } - } - - public override SearchForPublicGameParams DefaultInstanceForType { - get { return global::D3.PartyMessage.SearchForPublicGameParams.DefaultInstance; } - } - - public override SearchForPublicGameParams BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - SearchForPublicGameParams returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SearchForPublicGameParams) { - return MergeFrom((SearchForPublicGameParams) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SearchForPublicGameParams other) { - if (other == global::D3.PartyMessage.SearchForPublicGameParams.DefaultInstance) return this; - if (other.HasStartTime) { - StartTime = other.StartTime; - } - if (other.HasSecondsToSearch) { - SecondsToSearch = other.SecondsToSearch; - } - if (other.HasGameParams) { - MergeGameParams(other.GameParams); - } - if (other.HasRemoveReason) { - RemoveReason = other.RemoveReason; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - StartTime = input.ReadSInt64(); - break; - } - case 16: { - SecondsToSearch = input.ReadUInt32(); - break; - } - case 26: { - global::D3.OnlineService.GameCreateParams.Builder subBuilder = global::D3.OnlineService.GameCreateParams.CreateBuilder(); - if (HasGameParams) { - subBuilder.MergeFrom(GameParams); - } - input.ReadMessage(subBuilder, extensionRegistry); - GameParams = subBuilder.BuildPartial(); - break; - } - case 32: { - RemoveReason = input.ReadInt32(); - break; - } - } - } - } - - - public bool HasStartTime { - get { return result.HasStartTime; } - } - public long StartTime { - get { return result.StartTime; } - set { SetStartTime(value); } - } - public Builder SetStartTime(long value) { - result.hasStartTime = true; - result.startTime_ = value; - return this; - } - public Builder ClearStartTime() { - result.hasStartTime = false; - result.startTime_ = 0; - return this; - } - - public bool HasSecondsToSearch { - get { return result.HasSecondsToSearch; } - } - public uint SecondsToSearch { - get { return result.SecondsToSearch; } - set { SetSecondsToSearch(value); } - } - public Builder SetSecondsToSearch(uint value) { - result.hasSecondsToSearch = true; - result.secondsToSearch_ = value; - return this; - } - public Builder ClearSecondsToSearch() { - result.hasSecondsToSearch = false; - result.secondsToSearch_ = 0; - return this; - } - - public bool HasGameParams { - get { return result.HasGameParams; } - } - public global::D3.OnlineService.GameCreateParams GameParams { - get { return result.GameParams; } - set { SetGameParams(value); } - } - public Builder SetGameParams(global::D3.OnlineService.GameCreateParams value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasGameParams = true; - result.gameParams_ = value; - return this; - } - public Builder SetGameParams(global::D3.OnlineService.GameCreateParams.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasGameParams = true; - result.gameParams_ = builderForValue.Build(); - return this; - } - public Builder MergeGameParams(global::D3.OnlineService.GameCreateParams value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasGameParams && - result.gameParams_ != global::D3.OnlineService.GameCreateParams.DefaultInstance) { - result.gameParams_ = global::D3.OnlineService.GameCreateParams.CreateBuilder(result.gameParams_).MergeFrom(value).BuildPartial(); - } else { - result.gameParams_ = value; - } - result.hasGameParams = true; - return this; - } - public Builder ClearGameParams() { - result.hasGameParams = false; - result.gameParams_ = global::D3.OnlineService.GameCreateParams.DefaultInstance; - return this; - } - - public bool HasRemoveReason { - get { return result.HasRemoveReason; } - } - public int RemoveReason { - get { return result.RemoveReason; } - set { SetRemoveReason(value); } - } - public Builder SetRemoveReason(int value) { - result.hasRemoveReason = true; - result.removeReason_ = value; - return this; - } - public Builder ClearRemoveReason() { - result.hasRemoveReason = false; - result.removeReason_ = 0; - return this; - } - } - static SearchForPublicGameParams() { - object.ReferenceEquals(global::D3.PartyMessage.PartyMessage.Descriptor, null); - } - } - - #endregion - -} diff --git a/source/D3Proto/D3/Stats/Stats.cs b/source/D3Proto/D3/Stats/Stats.cs deleted file mode 100644 index 602df4e6..00000000 --- a/source/D3Proto/D3/Stats/Stats.cs +++ /dev/null @@ -1,639 +0,0 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace D3.Stats { - - public static partial class Stats { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_D3_Stats_StatCategory__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Stats_StatCategory__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_D3_Stats_StatList__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Stats_StatList__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static Stats() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "CgtTdGF0cy5wcm90bxIIRDMuU3RhdHMiTgoMU3RhdENhdGVnb3J5Eg8KB3N0" + - "YXRfaWQYASACKA0SDgoGZGF0YV8xGAIgAigNEg4KBmRhdGFfMhgDIAEoDRIN" + - "CgV0b3RhbBgEIAIoBCIxCghTdGF0TGlzdBIlCgVzdGF0cxgBIAMoCzIWLkQz" + - "LlN0YXRzLlN0YXRDYXRlZ29yeQ=="); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_D3_Stats_StatCategory__Descriptor = Descriptor.MessageTypes[0]; - internal__static_D3_Stats_StatCategory__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Stats_StatCategory__Descriptor, - new string[] { "StatId", "Data1", "Data2", "Total", }); - internal__static_D3_Stats_StatList__Descriptor = Descriptor.MessageTypes[1]; - internal__static_D3_Stats_StatList__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Stats_StatList__Descriptor, - new string[] { "Stats", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - }, assigner); - } - #endregion - - } - #region Messages - public sealed partial class StatCategory : pb::GeneratedMessage { - private static readonly StatCategory defaultInstance = new Builder().BuildPartial(); - public static StatCategory DefaultInstance { - get { return defaultInstance; } - } - - public override StatCategory DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override StatCategory ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::D3.Stats.Stats.internal__static_D3_Stats_StatCategory__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::D3.Stats.Stats.internal__static_D3_Stats_StatCategory__FieldAccessorTable; } - } - - public const int StatIdFieldNumber = 1; - private bool hasStatId; - private uint statId_ = 0; - public bool HasStatId { - get { return hasStatId; } - } - public uint StatId { - get { return statId_; } - } - - public const int Data1FieldNumber = 2; - private bool hasData1; - private uint data1_ = 0; - public bool HasData1 { - get { return hasData1; } - } - public uint Data1 { - get { return data1_; } - } - - public const int Data2FieldNumber = 3; - private bool hasData2; - private uint data2_ = 0; - public bool HasData2 { - get { return hasData2; } - } - public uint Data2 { - get { return data2_; } - } - - public const int TotalFieldNumber = 4; - private bool hasTotal; - private ulong total_ = 0UL; - public bool HasTotal { - get { return hasTotal; } - } - public ulong Total { - get { return total_; } - } - - public override bool IsInitialized { - get { - if (!hasStatId) return false; - if (!hasData1) return false; - if (!hasTotal) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasStatId) { - output.WriteUInt32(1, StatId); - } - if (HasData1) { - output.WriteUInt32(2, Data1); - } - if (HasData2) { - output.WriteUInt32(3, Data2); - } - if (HasTotal) { - output.WriteUInt64(4, Total); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasStatId) { - size += pb::CodedOutputStream.ComputeUInt32Size(1, StatId); - } - if (HasData1) { - size += pb::CodedOutputStream.ComputeUInt32Size(2, Data1); - } - if (HasData2) { - size += pb::CodedOutputStream.ComputeUInt32Size(3, Data2); - } - if (HasTotal) { - size += pb::CodedOutputStream.ComputeUInt64Size(4, Total); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static StatCategory ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static StatCategory ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static StatCategory ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static StatCategory ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static StatCategory ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static StatCategory ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static StatCategory ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static StatCategory ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static StatCategory ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static StatCategory ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(StatCategory prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - StatCategory result = new StatCategory(); - - protected override StatCategory MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new StatCategory(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::D3.Stats.StatCategory.Descriptor; } - } - - public override StatCategory DefaultInstanceForType { - get { return global::D3.Stats.StatCategory.DefaultInstance; } - } - - public override StatCategory BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - StatCategory returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is StatCategory) { - return MergeFrom((StatCategory) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(StatCategory other) { - if (other == global::D3.Stats.StatCategory.DefaultInstance) return this; - if (other.HasStatId) { - StatId = other.StatId; - } - if (other.HasData1) { - Data1 = other.Data1; - } - if (other.HasData2) { - Data2 = other.Data2; - } - if (other.HasTotal) { - Total = other.Total; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - StatId = input.ReadUInt32(); - break; - } - case 16: { - Data1 = input.ReadUInt32(); - break; - } - case 24: { - Data2 = input.ReadUInt32(); - break; - } - case 32: { - Total = input.ReadUInt64(); - break; - } - } - } - } - - - public bool HasStatId { - get { return result.HasStatId; } - } - public uint StatId { - get { return result.StatId; } - set { SetStatId(value); } - } - public Builder SetStatId(uint value) { - result.hasStatId = true; - result.statId_ = value; - return this; - } - public Builder ClearStatId() { - result.hasStatId = false; - result.statId_ = 0; - return this; - } - - public bool HasData1 { - get { return result.HasData1; } - } - public uint Data1 { - get { return result.Data1; } - set { SetData1(value); } - } - public Builder SetData1(uint value) { - result.hasData1 = true; - result.data1_ = value; - return this; - } - public Builder ClearData1() { - result.hasData1 = false; - result.data1_ = 0; - return this; - } - - public bool HasData2 { - get { return result.HasData2; } - } - public uint Data2 { - get { return result.Data2; } - set { SetData2(value); } - } - public Builder SetData2(uint value) { - result.hasData2 = true; - result.data2_ = value; - return this; - } - public Builder ClearData2() { - result.hasData2 = false; - result.data2_ = 0; - return this; - } - - public bool HasTotal { - get { return result.HasTotal; } - } - public ulong Total { - get { return result.Total; } - set { SetTotal(value); } - } - public Builder SetTotal(ulong value) { - result.hasTotal = true; - result.total_ = value; - return this; - } - public Builder ClearTotal() { - result.hasTotal = false; - result.total_ = 0UL; - return this; - } - } - static StatCategory() { - object.ReferenceEquals(global::D3.Stats.Stats.Descriptor, null); - } - } - - public sealed partial class StatList : pb::GeneratedMessage { - private static readonly StatList defaultInstance = new Builder().BuildPartial(); - public static StatList DefaultInstance { - get { return defaultInstance; } - } - - public override StatList DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override StatList ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::D3.Stats.Stats.internal__static_D3_Stats_StatList__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::D3.Stats.Stats.internal__static_D3_Stats_StatList__FieldAccessorTable; } - } - - public const int StatsFieldNumber = 1; - private pbc::PopsicleList stats_ = new pbc::PopsicleList(); - public scg::IList StatsList { - get { return stats_; } - } - public int StatsCount { - get { return stats_.Count; } - } - public global::D3.Stats.StatCategory GetStats(int index) { - return stats_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::D3.Stats.StatCategory element in StatsList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::D3.Stats.StatCategory element in StatsList) { - output.WriteMessage(1, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::D3.Stats.StatCategory element in StatsList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static StatList ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static StatList ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static StatList ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static StatList ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static StatList ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static StatList ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static StatList ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static StatList ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static StatList ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static StatList ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(StatList prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - StatList result = new StatList(); - - protected override StatList MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new StatList(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::D3.Stats.StatList.Descriptor; } - } - - public override StatList DefaultInstanceForType { - get { return global::D3.Stats.StatList.DefaultInstance; } - } - - public override StatList BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.stats_.MakeReadOnly(); - StatList returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is StatList) { - return MergeFrom((StatList) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(StatList other) { - if (other == global::D3.Stats.StatList.DefaultInstance) return this; - if (other.stats_.Count != 0) { - base.AddRange(other.stats_, result.stats_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::D3.Stats.StatCategory.Builder subBuilder = global::D3.Stats.StatCategory.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddStats(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public pbc::IPopsicleList StatsList { - get { return result.stats_; } - } - public int StatsCount { - get { return result.StatsCount; } - } - public global::D3.Stats.StatCategory GetStats(int index) { - return result.GetStats(index); - } - public Builder SetStats(int index, global::D3.Stats.StatCategory value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.stats_[index] = value; - return this; - } - public Builder SetStats(int index, global::D3.Stats.StatCategory.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.stats_[index] = builderForValue.Build(); - return this; - } - public Builder AddStats(global::D3.Stats.StatCategory value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.stats_.Add(value); - return this; - } - public Builder AddStats(global::D3.Stats.StatCategory.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.stats_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeStats(scg::IEnumerable values) { - base.AddRange(values, result.stats_); - return this; - } - public Builder ClearStats() { - result.stats_.Clear(); - return this; - } - } - static StatList() { - object.ReferenceEquals(global::D3.Stats.Stats.Descriptor, null); - } - } - - #endregion - -} diff --git a/source/D3Proto/DescriptorProtoFile.cs b/source/D3Proto/DescriptorProtoFile.cs deleted file mode 100644 index d16fdf9b..00000000 --- a/source/D3Proto/DescriptorProtoFile.cs +++ /dev/null @@ -1,7022 +0,0 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Google.ProtocolBuffers.DescriptorProtos { - - public static partial class DescriptorProtoFile { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_google_protobuf_FileDescriptorSet__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_FileDescriptorSet__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_FileDescriptorProto__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_FileDescriptorProto__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_DescriptorProto__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_DescriptorProto__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_DescriptorProto_ExtensionRange__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_DescriptorProto_ExtensionRange__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_FieldDescriptorProto__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_FieldDescriptorProto__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_EnumDescriptorProto__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_EnumDescriptorProto__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_EnumValueDescriptorProto__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_EnumValueDescriptorProto__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_ServiceDescriptorProto__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_ServiceDescriptorProto__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_MethodDescriptorProto__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_MethodDescriptorProto__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_FileOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_FileOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_MessageOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_MessageOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_FieldOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_FieldOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_EnumOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_EnumOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_EnumValueOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_EnumValueOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_ServiceOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_ServiceOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_MethodOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_MethodOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_UninterpretedOption__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_UninterpretedOption__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_UninterpretedOption_NamePart__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_UninterpretedOption_NamePart__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static DescriptorProtoFile() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "CiBnb29nbGUvcHJvdG9idWYvZGVzY3JpcHRvci5wcm90bxIPZ29vZ2xlLnBy" + - "b3RvYnVmIkcKEUZpbGVEZXNjcmlwdG9yU2V0EjIKBGZpbGUYASADKAsyJC5n" + - "b29nbGUucHJvdG9idWYuRmlsZURlc2NyaXB0b3JQcm90byLcAgoTRmlsZURl" + - "c2NyaXB0b3JQcm90bxIMCgRuYW1lGAEgASgJEg8KB3BhY2thZ2UYAiABKAkS" + - "EgoKZGVwZW5kZW5jeRgDIAMoCRI2CgxtZXNzYWdlX3R5cGUYBCADKAsyIC5n" + - "b29nbGUucHJvdG9idWYuRGVzY3JpcHRvclByb3RvEjcKCWVudW1fdHlwZRgF" + - "IAMoCzIkLmdvb2dsZS5wcm90b2J1Zi5FbnVtRGVzY3JpcHRvclByb3RvEjgK" + - "B3NlcnZpY2UYBiADKAsyJy5nb29nbGUucHJvdG9idWYuU2VydmljZURlc2Ny" + - "aXB0b3JQcm90bxI4CglleHRlbnNpb24YByADKAsyJS5nb29nbGUucHJvdG9i" + - "dWYuRmllbGREZXNjcmlwdG9yUHJvdG8SLQoHb3B0aW9ucxgIIAEoCzIcLmdv" + - "b2dsZS5wcm90b2J1Zi5GaWxlT3B0aW9ucyKpAwoPRGVzY3JpcHRvclByb3Rv" + - "EgwKBG5hbWUYASABKAkSNAoFZmllbGQYAiADKAsyJS5nb29nbGUucHJvdG9i" + - "dWYuRmllbGREZXNjcmlwdG9yUHJvdG8SOAoJZXh0ZW5zaW9uGAYgAygLMiUu" + - "Z29vZ2xlLnByb3RvYnVmLkZpZWxkRGVzY3JpcHRvclByb3RvEjUKC25lc3Rl" + - "ZF90eXBlGAMgAygLMiAuZ29vZ2xlLnByb3RvYnVmLkRlc2NyaXB0b3JQcm90" + - "bxI3CgllbnVtX3R5cGUYBCADKAsyJC5nb29nbGUucHJvdG9idWYuRW51bURl" + - "c2NyaXB0b3JQcm90bxJICg9leHRlbnNpb25fcmFuZ2UYBSADKAsyLy5nb29n" + - "bGUucHJvdG9idWYuRGVzY3JpcHRvclByb3RvLkV4dGVuc2lvblJhbmdlEjAK" + - "B29wdGlvbnMYByABKAsyHy5nb29nbGUucHJvdG9idWYuTWVzc2FnZU9wdGlv" + - "bnMaLAoORXh0ZW5zaW9uUmFuZ2USDQoFc3RhcnQYASABKAUSCwoDZW5kGAIg" + - "ASgFIpQFChRGaWVsZERlc2NyaXB0b3JQcm90bxIMCgRuYW1lGAEgASgJEg4K" + - "Bm51bWJlchgDIAEoBRI6CgVsYWJlbBgEIAEoDjIrLmdvb2dsZS5wcm90b2J1" + - "Zi5GaWVsZERlc2NyaXB0b3JQcm90by5MYWJlbBI4CgR0eXBlGAUgASgOMiou" + - "Z29vZ2xlLnByb3RvYnVmLkZpZWxkRGVzY3JpcHRvclByb3RvLlR5cGUSEQoJ" + - "dHlwZV9uYW1lGAYgASgJEhAKCGV4dGVuZGVlGAIgASgJEhUKDWRlZmF1bHRf" + - "dmFsdWUYByABKAkSLgoHb3B0aW9ucxgIIAEoCzIdLmdvb2dsZS5wcm90b2J1" + - "Zi5GaWVsZE9wdGlvbnMitgIKBFR5cGUSDwoLVFlQRV9ET1VCTEUQARIOCgpU" + - "WVBFX0ZMT0FUEAISDgoKVFlQRV9JTlQ2NBADEg8KC1RZUEVfVUlOVDY0EAQS" + - "DgoKVFlQRV9JTlQzMhAFEhAKDFRZUEVfRklYRUQ2NBAGEhAKDFRZUEVfRklY" + - "RUQzMhAHEg0KCVRZUEVfQk9PTBAIEg8KC1RZUEVfU1RSSU5HEAkSDgoKVFlQ" + - "RV9HUk9VUBAKEhAKDFRZUEVfTUVTU0FHRRALEg4KClRZUEVfQllURVMQDBIP" + - "CgtUWVBFX1VJTlQzMhANEg0KCVRZUEVfRU5VTRAOEhEKDVRZUEVfU0ZJWEVE" + - "MzIQDxIRCg1UWVBFX1NGSVhFRDY0EBASDwoLVFlQRV9TSU5UMzIQERIPCgtU" + - "WVBFX1NJTlQ2NBASIkMKBUxhYmVsEhIKDkxBQkVMX09QVElPTkFMEAESEgoO" + - "TEFCRUxfUkVRVUlSRUQQAhISCg5MQUJFTF9SRVBFQVRFRBADIowBChNFbnVt" + - "RGVzY3JpcHRvclByb3RvEgwKBG5hbWUYASABKAkSOAoFdmFsdWUYAiADKAsy" + - "KS5nb29nbGUucHJvdG9idWYuRW51bVZhbHVlRGVzY3JpcHRvclByb3RvEi0K" + - "B29wdGlvbnMYAyABKAsyHC5nb29nbGUucHJvdG9idWYuRW51bU9wdGlvbnMi" + - "bAoYRW51bVZhbHVlRGVzY3JpcHRvclByb3RvEgwKBG5hbWUYASABKAkSDgoG" + - "bnVtYmVyGAIgASgFEjIKB29wdGlvbnMYAyABKAsyIS5nb29nbGUucHJvdG9i" + - "dWYuRW51bVZhbHVlT3B0aW9ucyKQAQoWU2VydmljZURlc2NyaXB0b3JQcm90" + - "bxIMCgRuYW1lGAEgASgJEjYKBm1ldGhvZBgCIAMoCzImLmdvb2dsZS5wcm90" + - "b2J1Zi5NZXRob2REZXNjcmlwdG9yUHJvdG8SMAoHb3B0aW9ucxgDIAEoCzIf" + - "Lmdvb2dsZS5wcm90b2J1Zi5TZXJ2aWNlT3B0aW9ucyJ/ChVNZXRob2REZXNj" + - "cmlwdG9yUHJvdG8SDAoEbmFtZRgBIAEoCRISCgppbnB1dF90eXBlGAIgASgJ" + - "EhMKC291dHB1dF90eXBlGAMgASgJEi8KB29wdGlvbnMYBCABKAsyHi5nb29n" + - "bGUucHJvdG9idWYuTWV0aG9kT3B0aW9ucyKkAwoLRmlsZU9wdGlvbnMSFAoM" + - "amF2YV9wYWNrYWdlGAEgASgJEhwKFGphdmFfb3V0ZXJfY2xhc3NuYW1lGAgg" + - "ASgJEiIKE2phdmFfbXVsdGlwbGVfZmlsZXMYCiABKAg6BWZhbHNlEkYKDG9w" + - "dGltaXplX2ZvchgJIAEoDjIpLmdvb2dsZS5wcm90b2J1Zi5GaWxlT3B0aW9u" + - "cy5PcHRpbWl6ZU1vZGU6BVNQRUVEEiEKE2NjX2dlbmVyaWNfc2VydmljZXMY" + - "ECABKAg6BHRydWUSIwoVamF2YV9nZW5lcmljX3NlcnZpY2VzGBEgASgIOgR0" + - "cnVlEiEKE3B5X2dlbmVyaWNfc2VydmljZXMYEiABKAg6BHRydWUSQwoUdW5p" + - "bnRlcnByZXRlZF9vcHRpb24Y5wcgAygLMiQuZ29vZ2xlLnByb3RvYnVmLlVu" + - "aW50ZXJwcmV0ZWRPcHRpb24iOgoMT3B0aW1pemVNb2RlEgkKBVNQRUVEEAES" + - "DQoJQ09ERV9TSVpFEAISEAoMTElURV9SVU5USU1FEAMqCQjoBxCAgICAAiK4" + - "AQoOTWVzc2FnZU9wdGlvbnMSJgoXbWVzc2FnZV9zZXRfd2lyZV9mb3JtYXQY" + - "ASABKAg6BWZhbHNlEi4KH25vX3N0YW5kYXJkX2Rlc2NyaXB0b3JfYWNjZXNz" + - "b3IYAiABKAg6BWZhbHNlEkMKFHVuaW50ZXJwcmV0ZWRfb3B0aW9uGOcHIAMo" + - "CzIkLmdvb2dsZS5wcm90b2J1Zi5VbmludGVycHJldGVkT3B0aW9uKgkI6AcQ" + - "gICAgAIilAIKDEZpZWxkT3B0aW9ucxI6CgVjdHlwZRgBIAEoDjIjLmdvb2ds" + - "ZS5wcm90b2J1Zi5GaWVsZE9wdGlvbnMuQ1R5cGU6BlNUUklORxIOCgZwYWNr" + - "ZWQYAiABKAgSGQoKZGVwcmVjYXRlZBgDIAEoCDoFZmFsc2USHAoUZXhwZXJp" + - "bWVudGFsX21hcF9rZXkYCSABKAkSQwoUdW5pbnRlcnByZXRlZF9vcHRpb24Y" + - "5wcgAygLMiQuZ29vZ2xlLnByb3RvYnVmLlVuaW50ZXJwcmV0ZWRPcHRpb24i" + - "LwoFQ1R5cGUSCgoGU1RSSU5HEAASCAoEQ09SRBABEhAKDFNUUklOR19QSUVD" + - "RRACKgkI6AcQgICAgAIiXQoLRW51bU9wdGlvbnMSQwoUdW5pbnRlcnByZXRl" + - "ZF9vcHRpb24Y5wcgAygLMiQuZ29vZ2xlLnByb3RvYnVmLlVuaW50ZXJwcmV0" + - "ZWRPcHRpb24qCQjoBxCAgICAAiJiChBFbnVtVmFsdWVPcHRpb25zEkMKFHVu" + - "aW50ZXJwcmV0ZWRfb3B0aW9uGOcHIAMoCzIkLmdvb2dsZS5wcm90b2J1Zi5V" + - "bmludGVycHJldGVkT3B0aW9uKgkI6AcQgICAgAIiYAoOU2VydmljZU9wdGlv" + - "bnMSQwoUdW5pbnRlcnByZXRlZF9vcHRpb24Y5wcgAygLMiQuZ29vZ2xlLnBy" + - "b3RvYnVmLlVuaW50ZXJwcmV0ZWRPcHRpb24qCQjoBxCAgICAAiJfCg1NZXRo" + - "b2RPcHRpb25zEkMKFHVuaW50ZXJwcmV0ZWRfb3B0aW9uGOcHIAMoCzIkLmdv" + - "b2dsZS5wcm90b2J1Zi5VbmludGVycHJldGVkT3B0aW9uKgkI6AcQgICAgAIi" + - "hQIKE1VuaW50ZXJwcmV0ZWRPcHRpb24SOwoEbmFtZRgCIAMoCzItLmdvb2ds" + - "ZS5wcm90b2J1Zi5VbmludGVycHJldGVkT3B0aW9uLk5hbWVQYXJ0EhgKEGlk" + - "ZW50aWZpZXJfdmFsdWUYAyABKAkSGgoScG9zaXRpdmVfaW50X3ZhbHVlGAQg" + - "ASgEEhoKEm5lZ2F0aXZlX2ludF92YWx1ZRgFIAEoAxIUCgxkb3VibGVfdmFs" + - "dWUYBiABKAESFAoMc3RyaW5nX3ZhbHVlGAcgASgMGjMKCE5hbWVQYXJ0EhEK" + - "CW5hbWVfcGFydBgBIAIoCRIUCgxpc19leHRlbnNpb24YAiACKAhCKQoTY29t" + - "Lmdvb2dsZS5wcm90b2J1ZkIQRGVzY3JpcHRvclByb3Rvc0gB"); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_google_protobuf_FileDescriptorSet__Descriptor = Descriptor.MessageTypes[0]; - internal__static_google_protobuf_FileDescriptorSet__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_FileDescriptorSet__Descriptor, - new string[] { "File", }); - internal__static_google_protobuf_FileDescriptorProto__Descriptor = Descriptor.MessageTypes[1]; - internal__static_google_protobuf_FileDescriptorProto__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_FileDescriptorProto__Descriptor, - new string[] { "Name", "Package", "Dependency", "MessageType", "EnumType", "Service", "Extension", "Options", }); - internal__static_google_protobuf_DescriptorProto__Descriptor = Descriptor.MessageTypes[2]; - internal__static_google_protobuf_DescriptorProto__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_DescriptorProto__Descriptor, - new string[] { "Name", "Field", "Extension", "NestedType", "EnumType", "ExtensionRange", "Options", }); - internal__static_google_protobuf_DescriptorProto_ExtensionRange__Descriptor = internal__static_google_protobuf_DescriptorProto__Descriptor.NestedTypes[0]; - internal__static_google_protobuf_DescriptorProto_ExtensionRange__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_DescriptorProto_ExtensionRange__Descriptor, - new string[] { "Start", "End", }); - internal__static_google_protobuf_FieldDescriptorProto__Descriptor = Descriptor.MessageTypes[3]; - internal__static_google_protobuf_FieldDescriptorProto__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_FieldDescriptorProto__Descriptor, - new string[] { "Name", "Number", "Label", "Type", "TypeName", "Extendee", "DefaultValue", "Options", }); - internal__static_google_protobuf_EnumDescriptorProto__Descriptor = Descriptor.MessageTypes[4]; - internal__static_google_protobuf_EnumDescriptorProto__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_EnumDescriptorProto__Descriptor, - new string[] { "Name", "Value", "Options", }); - internal__static_google_protobuf_EnumValueDescriptorProto__Descriptor = Descriptor.MessageTypes[5]; - internal__static_google_protobuf_EnumValueDescriptorProto__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_EnumValueDescriptorProto__Descriptor, - new string[] { "Name", "Number", "Options", }); - internal__static_google_protobuf_ServiceDescriptorProto__Descriptor = Descriptor.MessageTypes[6]; - internal__static_google_protobuf_ServiceDescriptorProto__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_ServiceDescriptorProto__Descriptor, - new string[] { "Name", "Method", "Options", }); - internal__static_google_protobuf_MethodDescriptorProto__Descriptor = Descriptor.MessageTypes[7]; - internal__static_google_protobuf_MethodDescriptorProto__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_MethodDescriptorProto__Descriptor, - new string[] { "Name", "InputType", "OutputType", "Options", }); - internal__static_google_protobuf_FileOptions__Descriptor = Descriptor.MessageTypes[8]; - internal__static_google_protobuf_FileOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_FileOptions__Descriptor, - new string[] { "JavaPackage", "JavaOuterClassname", "JavaMultipleFiles", "OptimizeFor", "CcGenericServices", "JavaGenericServices", "PyGenericServices", "UninterpretedOption", }); - internal__static_google_protobuf_MessageOptions__Descriptor = Descriptor.MessageTypes[9]; - internal__static_google_protobuf_MessageOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_MessageOptions__Descriptor, - new string[] { "MessageSetWireFormat", "NoStandardDescriptorAccessor", "UninterpretedOption", }); - internal__static_google_protobuf_FieldOptions__Descriptor = Descriptor.MessageTypes[10]; - internal__static_google_protobuf_FieldOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_FieldOptions__Descriptor, - new string[] { "Ctype", "Packed", "Deprecated", "ExperimentalMapKey", "UninterpretedOption", }); - internal__static_google_protobuf_EnumOptions__Descriptor = Descriptor.MessageTypes[11]; - internal__static_google_protobuf_EnumOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_EnumOptions__Descriptor, - new string[] { "UninterpretedOption", }); - internal__static_google_protobuf_EnumValueOptions__Descriptor = Descriptor.MessageTypes[12]; - internal__static_google_protobuf_EnumValueOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_EnumValueOptions__Descriptor, - new string[] { "UninterpretedOption", }); - internal__static_google_protobuf_ServiceOptions__Descriptor = Descriptor.MessageTypes[13]; - internal__static_google_protobuf_ServiceOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_ServiceOptions__Descriptor, - new string[] { "UninterpretedOption", }); - internal__static_google_protobuf_MethodOptions__Descriptor = Descriptor.MessageTypes[14]; - internal__static_google_protobuf_MethodOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_MethodOptions__Descriptor, - new string[] { "UninterpretedOption", }); - internal__static_google_protobuf_UninterpretedOption__Descriptor = Descriptor.MessageTypes[15]; - internal__static_google_protobuf_UninterpretedOption__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_UninterpretedOption__Descriptor, - new string[] { "Name", "IdentifierValue", "PositiveIntValue", "NegativeIntValue", "DoubleValue", "StringValue", }); - internal__static_google_protobuf_UninterpretedOption_NamePart__Descriptor = internal__static_google_protobuf_UninterpretedOption__Descriptor.NestedTypes[0]; - internal__static_google_protobuf_UninterpretedOption_NamePart__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_UninterpretedOption_NamePart__Descriptor, - new string[] { "NamePart_", "IsExtension", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - }, assigner); - } - #endregion - - } - #region Messages - public sealed partial class FileDescriptorSet : pb::GeneratedMessage { - private static readonly FileDescriptorSet defaultInstance = new Builder().BuildPartial(); - public static FileDescriptorSet DefaultInstance { - get { return defaultInstance; } - } - - public override FileDescriptorSet DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override FileDescriptorSet ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FileDescriptorSet__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FileDescriptorSet__FieldAccessorTable; } - } - - public const int FileFieldNumber = 1; - private pbc::PopsicleList file_ = new pbc::PopsicleList(); - public scg::IList FileList { - get { return file_; } - } - public int FileCount { - get { return file_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto GetFile(int index) { - return file_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto element in FileList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto element in FileList) { - output.WriteMessage(1, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto element in FileList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static FileDescriptorSet ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FileDescriptorSet ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FileDescriptorSet ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FileDescriptorSet ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FileDescriptorSet ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FileDescriptorSet ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static FileDescriptorSet ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static FileDescriptorSet ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static FileDescriptorSet ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FileDescriptorSet ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(FileDescriptorSet prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - FileDescriptorSet result = new FileDescriptorSet(); - - protected override FileDescriptorSet MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new FileDescriptorSet(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorSet.Descriptor; } - } - - public override FileDescriptorSet DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorSet.DefaultInstance; } - } - - public override FileDescriptorSet BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.file_.MakeReadOnly(); - FileDescriptorSet returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is FileDescriptorSet) { - return MergeFrom((FileDescriptorSet) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(FileDescriptorSet other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorSet.DefaultInstance) return this; - if (other.file_.Count != 0) { - base.AddRange(other.file_, result.file_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddFile(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public pbc::IPopsicleList FileList { - get { return result.file_; } - } - public int FileCount { - get { return result.FileCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto GetFile(int index) { - return result.GetFile(index); - } - public Builder SetFile(int index, global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.file_[index] = value; - return this; - } - public Builder SetFile(int index, global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.file_[index] = builderForValue.Build(); - return this; - } - public Builder AddFile(global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.file_.Add(value); - return this; - } - public Builder AddFile(global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.file_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeFile(scg::IEnumerable values) { - base.AddRange(values, result.file_); - return this; - } - public Builder ClearFile() { - result.file_.Clear(); - return this; - } - } - static FileDescriptorSet() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - public sealed partial class FileDescriptorProto : pb::GeneratedMessage { - private static readonly FileDescriptorProto defaultInstance = new Builder().BuildPartial(); - public static FileDescriptorProto DefaultInstance { - get { return defaultInstance; } - } - - public override FileDescriptorProto DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override FileDescriptorProto ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FileDescriptorProto__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FileDescriptorProto__FieldAccessorTable; } - } - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int PackageFieldNumber = 2; - private bool hasPackage; - private string package_ = ""; - public bool HasPackage { - get { return hasPackage; } - } - public string Package { - get { return package_; } - } - - public const int DependencyFieldNumber = 3; - private pbc::PopsicleList dependency_ = new pbc::PopsicleList(); - public scg::IList DependencyList { - get { return pbc::Lists.AsReadOnly(dependency_); } - } - public int DependencyCount { - get { return dependency_.Count; } - } - public string GetDependency(int index) { - return dependency_[index]; - } - - public const int MessageTypeFieldNumber = 4; - private pbc::PopsicleList messageType_ = new pbc::PopsicleList(); - public scg::IList MessageTypeList { - get { return messageType_; } - } - public int MessageTypeCount { - get { return messageType_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto GetMessageType(int index) { - return messageType_[index]; - } - - public const int EnumTypeFieldNumber = 5; - private pbc::PopsicleList enumType_ = new pbc::PopsicleList(); - public scg::IList EnumTypeList { - get { return enumType_; } - } - public int EnumTypeCount { - get { return enumType_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto GetEnumType(int index) { - return enumType_[index]; - } - - public const int ServiceFieldNumber = 6; - private pbc::PopsicleList service_ = new pbc::PopsicleList(); - public scg::IList ServiceList { - get { return service_; } - } - public int ServiceCount { - get { return service_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto GetService(int index) { - return service_[index]; - } - - public const int ExtensionFieldNumber = 7; - private pbc::PopsicleList extension_ = new pbc::PopsicleList(); - public scg::IList ExtensionList { - get { return extension_; } - } - public int ExtensionCount { - get { return extension_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto GetExtension(int index) { - return extension_[index]; - } - - public const int OptionsFieldNumber = 8; - private bool hasOptions; - private global::Google.ProtocolBuffers.DescriptorProtos.FileOptions options_ = global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.DefaultInstance; - public bool HasOptions { - get { return hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FileOptions Options { - get { return options_; } - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto element in MessageTypeList) { - if (!element.IsInitialized) return false; - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto element in EnumTypeList) { - if (!element.IsInitialized) return false; - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto element in ServiceList) { - if (!element.IsInitialized) return false; - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto element in ExtensionList) { - if (!element.IsInitialized) return false; - } - if (HasOptions) { - if (!Options.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasName) { - output.WriteString(1, Name); - } - if (HasPackage) { - output.WriteString(2, Package); - } - if (dependency_.Count > 0) { - foreach (string element in dependency_) { - output.WriteString(3, element); - } - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto element in MessageTypeList) { - output.WriteMessage(4, element); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto element in EnumTypeList) { - output.WriteMessage(5, element); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto element in ServiceList) { - output.WriteMessage(6, element); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto element in ExtensionList) { - output.WriteMessage(7, element); - } - if (HasOptions) { - output.WriteMessage(8, Options); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasName) { - size += pb::CodedOutputStream.ComputeStringSize(1, Name); - } - if (HasPackage) { - size += pb::CodedOutputStream.ComputeStringSize(2, Package); - } - { - int dataSize = 0; - foreach (string element in DependencyList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 1 * dependency_.Count; - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto element in MessageTypeList) { - size += pb::CodedOutputStream.ComputeMessageSize(4, element); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto element in EnumTypeList) { - size += pb::CodedOutputStream.ComputeMessageSize(5, element); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto element in ServiceList) { - size += pb::CodedOutputStream.ComputeMessageSize(6, element); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto element in ExtensionList) { - size += pb::CodedOutputStream.ComputeMessageSize(7, element); - } - if (HasOptions) { - size += pb::CodedOutputStream.ComputeMessageSize(8, Options); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static FileDescriptorProto ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FileDescriptorProto ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FileDescriptorProto ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FileDescriptorProto ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FileDescriptorProto ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FileDescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static FileDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static FileDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static FileDescriptorProto ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FileDescriptorProto ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(FileDescriptorProto prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - FileDescriptorProto result = new FileDescriptorProto(); - - protected override FileDescriptorProto MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new FileDescriptorProto(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto.Descriptor; } - } - - public override FileDescriptorProto DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto.DefaultInstance; } - } - - public override FileDescriptorProto BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.dependency_.MakeReadOnly(); - result.messageType_.MakeReadOnly(); - result.enumType_.MakeReadOnly(); - result.service_.MakeReadOnly(); - result.extension_.MakeReadOnly(); - FileDescriptorProto returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is FileDescriptorProto) { - return MergeFrom((FileDescriptorProto) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(FileDescriptorProto other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto.DefaultInstance) return this; - if (other.HasName) { - Name = other.Name; - } - if (other.HasPackage) { - Package = other.Package; - } - if (other.dependency_.Count != 0) { - base.AddRange(other.dependency_, result.dependency_); - } - if (other.messageType_.Count != 0) { - base.AddRange(other.messageType_, result.messageType_); - } - if (other.enumType_.Count != 0) { - base.AddRange(other.enumType_, result.enumType_); - } - if (other.service_.Count != 0) { - base.AddRange(other.service_, result.service_); - } - if (other.extension_.Count != 0) { - base.AddRange(other.extension_, result.extension_); - } - if (other.HasOptions) { - MergeOptions(other.Options); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - Package = input.ReadString(); - break; - } - case 26: { - AddDependency(input.ReadString()); - break; - } - case 34: { - global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddMessageType(subBuilder.BuildPartial()); - break; - } - case 42: { - global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddEnumType(subBuilder.BuildPartial()); - break; - } - case 50: { - global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddService(subBuilder.BuildPartial()); - break; - } - case 58: { - global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddExtension(subBuilder.BuildPartial()); - break; - } - case 66: { - global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.CreateBuilder(); - if (HasOptions) { - subBuilder.MergeFrom(Options); - } - input.ReadMessage(subBuilder, extensionRegistry); - Options = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasName { - get { return result.HasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - result.hasName = false; - result.name_ = ""; - return this; - } - - public bool HasPackage { - get { return result.HasPackage; } - } - public string Package { - get { return result.Package; } - set { SetPackage(value); } - } - public Builder SetPackage(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasPackage = true; - result.package_ = value; - return this; - } - public Builder ClearPackage() { - result.hasPackage = false; - result.package_ = ""; - return this; - } - - public pbc::IPopsicleList DependencyList { - get { return result.dependency_; } - } - public int DependencyCount { - get { return result.DependencyCount; } - } - public string GetDependency(int index) { - return result.GetDependency(index); - } - public Builder SetDependency(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.dependency_[index] = value; - return this; - } - public Builder AddDependency(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.dependency_.Add(value); - return this; - } - public Builder AddRangeDependency(scg::IEnumerable values) { - base.AddRange(values, result.dependency_); - return this; - } - public Builder ClearDependency() { - result.dependency_.Clear(); - return this; - } - - public pbc::IPopsicleList MessageTypeList { - get { return result.messageType_; } - } - public int MessageTypeCount { - get { return result.MessageTypeCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto GetMessageType(int index) { - return result.GetMessageType(index); - } - public Builder SetMessageType(int index, global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.messageType_[index] = value; - return this; - } - public Builder SetMessageType(int index, global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.messageType_[index] = builderForValue.Build(); - return this; - } - public Builder AddMessageType(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.messageType_.Add(value); - return this; - } - public Builder AddMessageType(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.messageType_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeMessageType(scg::IEnumerable values) { - base.AddRange(values, result.messageType_); - return this; - } - public Builder ClearMessageType() { - result.messageType_.Clear(); - return this; - } - - public pbc::IPopsicleList EnumTypeList { - get { return result.enumType_; } - } - public int EnumTypeCount { - get { return result.EnumTypeCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto GetEnumType(int index) { - return result.GetEnumType(index); - } - public Builder SetEnumType(int index, global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.enumType_[index] = value; - return this; - } - public Builder SetEnumType(int index, global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.enumType_[index] = builderForValue.Build(); - return this; - } - public Builder AddEnumType(global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.enumType_.Add(value); - return this; - } - public Builder AddEnumType(global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.enumType_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeEnumType(scg::IEnumerable values) { - base.AddRange(values, result.enumType_); - return this; - } - public Builder ClearEnumType() { - result.enumType_.Clear(); - return this; - } - - public pbc::IPopsicleList ServiceList { - get { return result.service_; } - } - public int ServiceCount { - get { return result.ServiceCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto GetService(int index) { - return result.GetService(index); - } - public Builder SetService(int index, global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.service_[index] = value; - return this; - } - public Builder SetService(int index, global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.service_[index] = builderForValue.Build(); - return this; - } - public Builder AddService(global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.service_.Add(value); - return this; - } - public Builder AddService(global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.service_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeService(scg::IEnumerable values) { - base.AddRange(values, result.service_); - return this; - } - public Builder ClearService() { - result.service_.Clear(); - return this; - } - - public pbc::IPopsicleList ExtensionList { - get { return result.extension_; } - } - public int ExtensionCount { - get { return result.ExtensionCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto GetExtension(int index) { - return result.GetExtension(index); - } - public Builder SetExtension(int index, global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.extension_[index] = value; - return this; - } - public Builder SetExtension(int index, global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.extension_[index] = builderForValue.Build(); - return this; - } - public Builder AddExtension(global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.extension_.Add(value); - return this; - } - public Builder AddExtension(global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.extension_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeExtension(scg::IEnumerable values) { - base.AddRange(values, result.extension_); - return this; - } - public Builder ClearExtension() { - result.extension_.Clear(); - return this; - } - - public bool HasOptions { - get { return result.HasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FileOptions Options { - get { return result.Options; } - set { SetOptions(value); } - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.FileOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasOptions = true; - result.options_ = value; - return this; - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasOptions = true; - result.options_ = builderForValue.Build(); - return this; - } - public Builder MergeOptions(global::Google.ProtocolBuffers.DescriptorProtos.FileOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasOptions && - result.options_ != global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.DefaultInstance) { - result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.CreateBuilder(result.options_).MergeFrom(value).BuildPartial(); - } else { - result.options_ = value; - } - result.hasOptions = true; - return this; - } - public Builder ClearOptions() { - result.hasOptions = false; - result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.DefaultInstance; - return this; - } - } - static FileDescriptorProto() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - public sealed partial class DescriptorProto : pb::GeneratedMessage { - private static readonly DescriptorProto defaultInstance = new Builder().BuildPartial(); - public static DescriptorProto DefaultInstance { - get { return defaultInstance; } - } - - public override DescriptorProto DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override DescriptorProto ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_DescriptorProto__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_DescriptorProto__FieldAccessorTable; } - } - - #region Nested types - public static class Types { - public sealed partial class ExtensionRange : pb::GeneratedMessage { - private static readonly ExtensionRange defaultInstance = new Builder().BuildPartial(); - public static ExtensionRange DefaultInstance { - get { return defaultInstance; } - } - - public override ExtensionRange DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ExtensionRange ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_DescriptorProto_ExtensionRange__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_DescriptorProto_ExtensionRange__FieldAccessorTable; } - } - - public const int StartFieldNumber = 1; - private bool hasStart; - private int start_ = 0; - public bool HasStart { - get { return hasStart; } - } - public int Start { - get { return start_; } - } - - public const int EndFieldNumber = 2; - private bool hasEnd; - private int end_ = 0; - public bool HasEnd { - get { return hasEnd; } - } - public int End { - get { return end_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasStart) { - output.WriteInt32(1, Start); - } - if (HasEnd) { - output.WriteInt32(2, End); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasStart) { - size += pb::CodedOutputStream.ComputeInt32Size(1, Start); - } - if (HasEnd) { - size += pb::CodedOutputStream.ComputeInt32Size(2, End); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ExtensionRange ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ExtensionRange ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ExtensionRange ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ExtensionRange ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ExtensionRange ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ExtensionRange ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ExtensionRange ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ExtensionRange ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ExtensionRange ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ExtensionRange ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ExtensionRange prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ExtensionRange result = new ExtensionRange(); - - protected override ExtensionRange MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ExtensionRange(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange.Descriptor; } - } - - public override ExtensionRange DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange.DefaultInstance; } - } - - public override ExtensionRange BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - ExtensionRange returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ExtensionRange) { - return MergeFrom((ExtensionRange) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ExtensionRange other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange.DefaultInstance) return this; - if (other.HasStart) { - Start = other.Start; - } - if (other.HasEnd) { - End = other.End; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - Start = input.ReadInt32(); - break; - } - case 16: { - End = input.ReadInt32(); - break; - } - } - } - } - - - public bool HasStart { - get { return result.HasStart; } - } - public int Start { - get { return result.Start; } - set { SetStart(value); } - } - public Builder SetStart(int value) { - result.hasStart = true; - result.start_ = value; - return this; - } - public Builder ClearStart() { - result.hasStart = false; - result.start_ = 0; - return this; - } - - public bool HasEnd { - get { return result.HasEnd; } - } - public int End { - get { return result.End; } - set { SetEnd(value); } - } - public Builder SetEnd(int value) { - result.hasEnd = true; - result.end_ = value; - return this; - } - public Builder ClearEnd() { - result.hasEnd = false; - result.end_ = 0; - return this; - } - } - static ExtensionRange() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - } - #endregion - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int FieldFieldNumber = 2; - private pbc::PopsicleList field_ = new pbc::PopsicleList(); - public scg::IList FieldList { - get { return field_; } - } - public int FieldCount { - get { return field_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto GetField(int index) { - return field_[index]; - } - - public const int ExtensionFieldNumber = 6; - private pbc::PopsicleList extension_ = new pbc::PopsicleList(); - public scg::IList ExtensionList { - get { return extension_; } - } - public int ExtensionCount { - get { return extension_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto GetExtension(int index) { - return extension_[index]; - } - - public const int NestedTypeFieldNumber = 3; - private pbc::PopsicleList nestedType_ = new pbc::PopsicleList(); - public scg::IList NestedTypeList { - get { return nestedType_; } - } - public int NestedTypeCount { - get { return nestedType_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto GetNestedType(int index) { - return nestedType_[index]; - } - - public const int EnumTypeFieldNumber = 4; - private pbc::PopsicleList enumType_ = new pbc::PopsicleList(); - public scg::IList EnumTypeList { - get { return enumType_; } - } - public int EnumTypeCount { - get { return enumType_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto GetEnumType(int index) { - return enumType_[index]; - } - - public const int ExtensionRangeFieldNumber = 5; - private pbc::PopsicleList extensionRange_ = new pbc::PopsicleList(); - public scg::IList ExtensionRangeList { - get { return extensionRange_; } - } - public int ExtensionRangeCount { - get { return extensionRange_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange GetExtensionRange(int index) { - return extensionRange_[index]; - } - - public const int OptionsFieldNumber = 7; - private bool hasOptions; - private global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions options_ = global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.DefaultInstance; - public bool HasOptions { - get { return hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions Options { - get { return options_; } - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto element in FieldList) { - if (!element.IsInitialized) return false; - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto element in ExtensionList) { - if (!element.IsInitialized) return false; - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto element in NestedTypeList) { - if (!element.IsInitialized) return false; - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto element in EnumTypeList) { - if (!element.IsInitialized) return false; - } - if (HasOptions) { - if (!Options.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasName) { - output.WriteString(1, Name); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto element in FieldList) { - output.WriteMessage(2, element); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto element in NestedTypeList) { - output.WriteMessage(3, element); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto element in EnumTypeList) { - output.WriteMessage(4, element); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange element in ExtensionRangeList) { - output.WriteMessage(5, element); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto element in ExtensionList) { - output.WriteMessage(6, element); - } - if (HasOptions) { - output.WriteMessage(7, Options); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasName) { - size += pb::CodedOutputStream.ComputeStringSize(1, Name); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto element in FieldList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto element in ExtensionList) { - size += pb::CodedOutputStream.ComputeMessageSize(6, element); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto element in NestedTypeList) { - size += pb::CodedOutputStream.ComputeMessageSize(3, element); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto element in EnumTypeList) { - size += pb::CodedOutputStream.ComputeMessageSize(4, element); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange element in ExtensionRangeList) { - size += pb::CodedOutputStream.ComputeMessageSize(5, element); - } - if (HasOptions) { - size += pb::CodedOutputStream.ComputeMessageSize(7, Options); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static DescriptorProto ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DescriptorProto ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DescriptorProto ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DescriptorProto ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DescriptorProto ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static DescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static DescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static DescriptorProto ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DescriptorProto ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(DescriptorProto prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - DescriptorProto result = new DescriptorProto(); - - protected override DescriptorProto MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new DescriptorProto(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Descriptor; } - } - - public override DescriptorProto DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.DefaultInstance; } - } - - public override DescriptorProto BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.field_.MakeReadOnly(); - result.extension_.MakeReadOnly(); - result.nestedType_.MakeReadOnly(); - result.enumType_.MakeReadOnly(); - result.extensionRange_.MakeReadOnly(); - DescriptorProto returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is DescriptorProto) { - return MergeFrom((DescriptorProto) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(DescriptorProto other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.DefaultInstance) return this; - if (other.HasName) { - Name = other.Name; - } - if (other.field_.Count != 0) { - base.AddRange(other.field_, result.field_); - } - if (other.extension_.Count != 0) { - base.AddRange(other.extension_, result.extension_); - } - if (other.nestedType_.Count != 0) { - base.AddRange(other.nestedType_, result.nestedType_); - } - if (other.enumType_.Count != 0) { - base.AddRange(other.enumType_, result.enumType_); - } - if (other.extensionRange_.Count != 0) { - base.AddRange(other.extensionRange_, result.extensionRange_); - } - if (other.HasOptions) { - MergeOptions(other.Options); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddField(subBuilder.BuildPartial()); - break; - } - case 26: { - global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddNestedType(subBuilder.BuildPartial()); - break; - } - case 34: { - global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddEnumType(subBuilder.BuildPartial()); - break; - } - case 42: { - global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddExtensionRange(subBuilder.BuildPartial()); - break; - } - case 50: { - global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddExtension(subBuilder.BuildPartial()); - break; - } - case 58: { - global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.CreateBuilder(); - if (HasOptions) { - subBuilder.MergeFrom(Options); - } - input.ReadMessage(subBuilder, extensionRegistry); - Options = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasName { - get { return result.HasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - result.hasName = false; - result.name_ = ""; - return this; - } - - public pbc::IPopsicleList FieldList { - get { return result.field_; } - } - public int FieldCount { - get { return result.FieldCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto GetField(int index) { - return result.GetField(index); - } - public Builder SetField(int index, global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.field_[index] = value; - return this; - } - public Builder SetField(int index, global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.field_[index] = builderForValue.Build(); - return this; - } - public Builder AddField(global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.field_.Add(value); - return this; - } - public Builder AddField(global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.field_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeField(scg::IEnumerable values) { - base.AddRange(values, result.field_); - return this; - } - public Builder ClearField() { - result.field_.Clear(); - return this; - } - - public pbc::IPopsicleList ExtensionList { - get { return result.extension_; } - } - public int ExtensionCount { - get { return result.ExtensionCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto GetExtension(int index) { - return result.GetExtension(index); - } - public Builder SetExtension(int index, global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.extension_[index] = value; - return this; - } - public Builder SetExtension(int index, global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.extension_[index] = builderForValue.Build(); - return this; - } - public Builder AddExtension(global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.extension_.Add(value); - return this; - } - public Builder AddExtension(global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.extension_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeExtension(scg::IEnumerable values) { - base.AddRange(values, result.extension_); - return this; - } - public Builder ClearExtension() { - result.extension_.Clear(); - return this; - } - - public pbc::IPopsicleList NestedTypeList { - get { return result.nestedType_; } - } - public int NestedTypeCount { - get { return result.NestedTypeCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto GetNestedType(int index) { - return result.GetNestedType(index); - } - public Builder SetNestedType(int index, global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.nestedType_[index] = value; - return this; - } - public Builder SetNestedType(int index, global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.nestedType_[index] = builderForValue.Build(); - return this; - } - public Builder AddNestedType(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.nestedType_.Add(value); - return this; - } - public Builder AddNestedType(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.nestedType_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeNestedType(scg::IEnumerable values) { - base.AddRange(values, result.nestedType_); - return this; - } - public Builder ClearNestedType() { - result.nestedType_.Clear(); - return this; - } - - public pbc::IPopsicleList EnumTypeList { - get { return result.enumType_; } - } - public int EnumTypeCount { - get { return result.EnumTypeCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto GetEnumType(int index) { - return result.GetEnumType(index); - } - public Builder SetEnumType(int index, global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.enumType_[index] = value; - return this; - } - public Builder SetEnumType(int index, global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.enumType_[index] = builderForValue.Build(); - return this; - } - public Builder AddEnumType(global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.enumType_.Add(value); - return this; - } - public Builder AddEnumType(global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.enumType_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeEnumType(scg::IEnumerable values) { - base.AddRange(values, result.enumType_); - return this; - } - public Builder ClearEnumType() { - result.enumType_.Clear(); - return this; - } - - public pbc::IPopsicleList ExtensionRangeList { - get { return result.extensionRange_; } - } - public int ExtensionRangeCount { - get { return result.ExtensionRangeCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange GetExtensionRange(int index) { - return result.GetExtensionRange(index); - } - public Builder SetExtensionRange(int index, global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.extensionRange_[index] = value; - return this; - } - public Builder SetExtensionRange(int index, global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.extensionRange_[index] = builderForValue.Build(); - return this; - } - public Builder AddExtensionRange(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.extensionRange_.Add(value); - return this; - } - public Builder AddExtensionRange(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProto.Types.ExtensionRange.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.extensionRange_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeExtensionRange(scg::IEnumerable values) { - base.AddRange(values, result.extensionRange_); - return this; - } - public Builder ClearExtensionRange() { - result.extensionRange_.Clear(); - return this; - } - - public bool HasOptions { - get { return result.HasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions Options { - get { return result.Options; } - set { SetOptions(value); } - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasOptions = true; - result.options_ = value; - return this; - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasOptions = true; - result.options_ = builderForValue.Build(); - return this; - } - public Builder MergeOptions(global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasOptions && - result.options_ != global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.DefaultInstance) { - result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.CreateBuilder(result.options_).MergeFrom(value).BuildPartial(); - } else { - result.options_ = value; - } - result.hasOptions = true; - return this; - } - public Builder ClearOptions() { - result.hasOptions = false; - result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.DefaultInstance; - return this; - } - } - static DescriptorProto() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - public sealed partial class FieldDescriptorProto : pb::GeneratedMessage { - private static readonly FieldDescriptorProto defaultInstance = new Builder().BuildPartial(); - public static FieldDescriptorProto DefaultInstance { - get { return defaultInstance; } - } - - public override FieldDescriptorProto DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override FieldDescriptorProto ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FieldDescriptorProto__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FieldDescriptorProto__FieldAccessorTable; } - } - - #region Nested types - public static class Types { - public enum Type { - TYPE_DOUBLE = 1, - TYPE_FLOAT = 2, - TYPE_INT64 = 3, - TYPE_UINT64 = 4, - TYPE_INT32 = 5, - TYPE_FIXED64 = 6, - TYPE_FIXED32 = 7, - TYPE_BOOL = 8, - TYPE_STRING = 9, - TYPE_GROUP = 10, - TYPE_MESSAGE = 11, - TYPE_BYTES = 12, - TYPE_UINT32 = 13, - TYPE_ENUM = 14, - TYPE_SFIXED32 = 15, - TYPE_SFIXED64 = 16, - TYPE_SINT32 = 17, - TYPE_SINT64 = 18, - } - - public enum Label { - LABEL_OPTIONAL = 1, - LABEL_REQUIRED = 2, - LABEL_REPEATED = 3, - } - - } - #endregion - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int NumberFieldNumber = 3; - private bool hasNumber; - private int number_ = 0; - public bool HasNumber { - get { return hasNumber; } - } - public int Number { - get { return number_; } - } - - public const int LabelFieldNumber = 4; - private bool hasLabel; - private global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Label label_ = global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Label.LABEL_OPTIONAL; - public bool HasLabel { - get { return hasLabel; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Label Label { - get { return label_; } - } - - public const int TypeFieldNumber = 5; - private bool hasType; - private global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Type type_ = global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Type.TYPE_DOUBLE; - public bool HasType { - get { return hasType; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Type Type { - get { return type_; } - } - - public const int TypeNameFieldNumber = 6; - private bool hasTypeName; - private string typeName_ = ""; - public bool HasTypeName { - get { return hasTypeName; } - } - public string TypeName { - get { return typeName_; } - } - - public const int ExtendeeFieldNumber = 2; - private bool hasExtendee; - private string extendee_ = ""; - public bool HasExtendee { - get { return hasExtendee; } - } - public string Extendee { - get { return extendee_; } - } - - public const int DefaultValueFieldNumber = 7; - private bool hasDefaultValue; - private string defaultValue_ = ""; - public bool HasDefaultValue { - get { return hasDefaultValue; } - } - public string DefaultValue { - get { return defaultValue_; } - } - - public const int OptionsFieldNumber = 8; - private bool hasOptions; - private global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions options_ = global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.DefaultInstance; - public bool HasOptions { - get { return hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions Options { - get { return options_; } - } - - public override bool IsInitialized { - get { - if (HasOptions) { - if (!Options.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasName) { - output.WriteString(1, Name); - } - if (HasExtendee) { - output.WriteString(2, Extendee); - } - if (HasNumber) { - output.WriteInt32(3, Number); - } - if (HasLabel) { - output.WriteEnum(4, (int) Label); - } - if (HasType) { - output.WriteEnum(5, (int) Type); - } - if (HasTypeName) { - output.WriteString(6, TypeName); - } - if (HasDefaultValue) { - output.WriteString(7, DefaultValue); - } - if (HasOptions) { - output.WriteMessage(8, Options); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasName) { - size += pb::CodedOutputStream.ComputeStringSize(1, Name); - } - if (HasNumber) { - size += pb::CodedOutputStream.ComputeInt32Size(3, Number); - } - if (HasLabel) { - size += pb::CodedOutputStream.ComputeEnumSize(4, (int) Label); - } - if (HasType) { - size += pb::CodedOutputStream.ComputeEnumSize(5, (int) Type); - } - if (HasTypeName) { - size += pb::CodedOutputStream.ComputeStringSize(6, TypeName); - } - if (HasExtendee) { - size += pb::CodedOutputStream.ComputeStringSize(2, Extendee); - } - if (HasDefaultValue) { - size += pb::CodedOutputStream.ComputeStringSize(7, DefaultValue); - } - if (HasOptions) { - size += pb::CodedOutputStream.ComputeMessageSize(8, Options); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static FieldDescriptorProto ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FieldDescriptorProto ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FieldDescriptorProto ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FieldDescriptorProto ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FieldDescriptorProto ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FieldDescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static FieldDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static FieldDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static FieldDescriptorProto ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FieldDescriptorProto ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(FieldDescriptorProto prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - FieldDescriptorProto result = new FieldDescriptorProto(); - - protected override FieldDescriptorProto MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new FieldDescriptorProto(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Descriptor; } - } - - public override FieldDescriptorProto DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.DefaultInstance; } - } - - public override FieldDescriptorProto BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - FieldDescriptorProto returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is FieldDescriptorProto) { - return MergeFrom((FieldDescriptorProto) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(FieldDescriptorProto other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.DefaultInstance) return this; - if (other.HasName) { - Name = other.Name; - } - if (other.HasNumber) { - Number = other.Number; - } - if (other.HasLabel) { - Label = other.Label; - } - if (other.HasType) { - Type = other.Type; - } - if (other.HasTypeName) { - TypeName = other.TypeName; - } - if (other.HasExtendee) { - Extendee = other.Extendee; - } - if (other.HasDefaultValue) { - DefaultValue = other.DefaultValue; - } - if (other.HasOptions) { - MergeOptions(other.Options); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - Extendee = input.ReadString(); - break; - } - case 24: { - Number = input.ReadInt32(); - break; - } - case 32: { - int rawValue = input.ReadEnum(); - if (!global::System.Enum.IsDefined(typeof(global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Label), rawValue)) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(4, (ulong) rawValue); - } else { - Label = (global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Label) rawValue; - } - break; - } - case 40: { - int rawValue = input.ReadEnum(); - if (!global::System.Enum.IsDefined(typeof(global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Type), rawValue)) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(5, (ulong) rawValue); - } else { - Type = (global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Type) rawValue; - } - break; - } - case 50: { - TypeName = input.ReadString(); - break; - } - case 58: { - DefaultValue = input.ReadString(); - break; - } - case 66: { - global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.CreateBuilder(); - if (HasOptions) { - subBuilder.MergeFrom(Options); - } - input.ReadMessage(subBuilder, extensionRegistry); - Options = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasName { - get { return result.HasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - result.hasName = false; - result.name_ = ""; - return this; - } - - public bool HasNumber { - get { return result.HasNumber; } - } - public int Number { - get { return result.Number; } - set { SetNumber(value); } - } - public Builder SetNumber(int value) { - result.hasNumber = true; - result.number_ = value; - return this; - } - public Builder ClearNumber() { - result.hasNumber = false; - result.number_ = 0; - return this; - } - - public bool HasLabel { - get { return result.HasLabel; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Label Label { - get { return result.Label; } - set { SetLabel(value); } - } - public Builder SetLabel(global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Label value) { - result.hasLabel = true; - result.label_ = value; - return this; - } - public Builder ClearLabel() { - result.hasLabel = false; - result.label_ = global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Label.LABEL_OPTIONAL; - return this; - } - - public bool HasType { - get { return result.HasType; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Type Type { - get { return result.Type; } - set { SetType(value); } - } - public Builder SetType(global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Type value) { - result.hasType = true; - result.type_ = value; - return this; - } - public Builder ClearType() { - result.hasType = false; - result.type_ = global::Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Type.TYPE_DOUBLE; - return this; - } - - public bool HasTypeName { - get { return result.HasTypeName; } - } - public string TypeName { - get { return result.TypeName; } - set { SetTypeName(value); } - } - public Builder SetTypeName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasTypeName = true; - result.typeName_ = value; - return this; - } - public Builder ClearTypeName() { - result.hasTypeName = false; - result.typeName_ = ""; - return this; - } - - public bool HasExtendee { - get { return result.HasExtendee; } - } - public string Extendee { - get { return result.Extendee; } - set { SetExtendee(value); } - } - public Builder SetExtendee(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasExtendee = true; - result.extendee_ = value; - return this; - } - public Builder ClearExtendee() { - result.hasExtendee = false; - result.extendee_ = ""; - return this; - } - - public bool HasDefaultValue { - get { return result.HasDefaultValue; } - } - public string DefaultValue { - get { return result.DefaultValue; } - set { SetDefaultValue(value); } - } - public Builder SetDefaultValue(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasDefaultValue = true; - result.defaultValue_ = value; - return this; - } - public Builder ClearDefaultValue() { - result.hasDefaultValue = false; - result.defaultValue_ = ""; - return this; - } - - public bool HasOptions { - get { return result.HasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions Options { - get { return result.Options; } - set { SetOptions(value); } - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasOptions = true; - result.options_ = value; - return this; - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasOptions = true; - result.options_ = builderForValue.Build(); - return this; - } - public Builder MergeOptions(global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasOptions && - result.options_ != global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.DefaultInstance) { - result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.CreateBuilder(result.options_).MergeFrom(value).BuildPartial(); - } else { - result.options_ = value; - } - result.hasOptions = true; - return this; - } - public Builder ClearOptions() { - result.hasOptions = false; - result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.DefaultInstance; - return this; - } - } - static FieldDescriptorProto() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - public sealed partial class EnumDescriptorProto : pb::GeneratedMessage { - private static readonly EnumDescriptorProto defaultInstance = new Builder().BuildPartial(); - public static EnumDescriptorProto DefaultInstance { - get { return defaultInstance; } - } - - public override EnumDescriptorProto DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override EnumDescriptorProto ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumDescriptorProto__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumDescriptorProto__FieldAccessorTable; } - } - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int ValueFieldNumber = 2; - private pbc::PopsicleList value_ = new pbc::PopsicleList(); - public scg::IList ValueList { - get { return value_; } - } - public int ValueCount { - get { return value_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto GetValue(int index) { - return value_[index]; - } - - public const int OptionsFieldNumber = 3; - private bool hasOptions; - private global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions options_ = global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.DefaultInstance; - public bool HasOptions { - get { return hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions Options { - get { return options_; } - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto element in ValueList) { - if (!element.IsInitialized) return false; - } - if (HasOptions) { - if (!Options.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasName) { - output.WriteString(1, Name); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto element in ValueList) { - output.WriteMessage(2, element); - } - if (HasOptions) { - output.WriteMessage(3, Options); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasName) { - size += pb::CodedOutputStream.ComputeStringSize(1, Name); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto element in ValueList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - if (HasOptions) { - size += pb::CodedOutputStream.ComputeMessageSize(3, Options); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static EnumDescriptorProto ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static EnumDescriptorProto ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static EnumDescriptorProto ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static EnumDescriptorProto ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static EnumDescriptorProto ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static EnumDescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static EnumDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static EnumDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static EnumDescriptorProto ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static EnumDescriptorProto ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(EnumDescriptorProto prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - EnumDescriptorProto result = new EnumDescriptorProto(); - - protected override EnumDescriptorProto MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new EnumDescriptorProto(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.Descriptor; } - } - - public override EnumDescriptorProto DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.DefaultInstance; } - } - - public override EnumDescriptorProto BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.value_.MakeReadOnly(); - EnumDescriptorProto returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is EnumDescriptorProto) { - return MergeFrom((EnumDescriptorProto) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(EnumDescriptorProto other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.EnumDescriptorProto.DefaultInstance) return this; - if (other.HasName) { - Name = other.Name; - } - if (other.value_.Count != 0) { - base.AddRange(other.value_, result.value_); - } - if (other.HasOptions) { - MergeOptions(other.Options); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddValue(subBuilder.BuildPartial()); - break; - } - case 26: { - global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.CreateBuilder(); - if (HasOptions) { - subBuilder.MergeFrom(Options); - } - input.ReadMessage(subBuilder, extensionRegistry); - Options = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasName { - get { return result.HasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - result.hasName = false; - result.name_ = ""; - return this; - } - - public pbc::IPopsicleList ValueList { - get { return result.value_; } - } - public int ValueCount { - get { return result.ValueCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto GetValue(int index) { - return result.GetValue(index); - } - public Builder SetValue(int index, global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.value_[index] = value; - return this; - } - public Builder SetValue(int index, global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.value_[index] = builderForValue.Build(); - return this; - } - public Builder AddValue(global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.value_.Add(value); - return this; - } - public Builder AddValue(global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.value_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeValue(scg::IEnumerable values) { - base.AddRange(values, result.value_); - return this; - } - public Builder ClearValue() { - result.value_.Clear(); - return this; - } - - public bool HasOptions { - get { return result.HasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions Options { - get { return result.Options; } - set { SetOptions(value); } - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasOptions = true; - result.options_ = value; - return this; - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasOptions = true; - result.options_ = builderForValue.Build(); - return this; - } - public Builder MergeOptions(global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasOptions && - result.options_ != global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.DefaultInstance) { - result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.CreateBuilder(result.options_).MergeFrom(value).BuildPartial(); - } else { - result.options_ = value; - } - result.hasOptions = true; - return this; - } - public Builder ClearOptions() { - result.hasOptions = false; - result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.DefaultInstance; - return this; - } - } - static EnumDescriptorProto() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - public sealed partial class EnumValueDescriptorProto : pb::GeneratedMessage { - private static readonly EnumValueDescriptorProto defaultInstance = new Builder().BuildPartial(); - public static EnumValueDescriptorProto DefaultInstance { - get { return defaultInstance; } - } - - public override EnumValueDescriptorProto DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override EnumValueDescriptorProto ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumValueDescriptorProto__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumValueDescriptorProto__FieldAccessorTable; } - } - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int NumberFieldNumber = 2; - private bool hasNumber; - private int number_ = 0; - public bool HasNumber { - get { return hasNumber; } - } - public int Number { - get { return number_; } - } - - public const int OptionsFieldNumber = 3; - private bool hasOptions; - private global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions options_ = global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.DefaultInstance; - public bool HasOptions { - get { return hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions Options { - get { return options_; } - } - - public override bool IsInitialized { - get { - if (HasOptions) { - if (!Options.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasName) { - output.WriteString(1, Name); - } - if (HasNumber) { - output.WriteInt32(2, Number); - } - if (HasOptions) { - output.WriteMessage(3, Options); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasName) { - size += pb::CodedOutputStream.ComputeStringSize(1, Name); - } - if (HasNumber) { - size += pb::CodedOutputStream.ComputeInt32Size(2, Number); - } - if (HasOptions) { - size += pb::CodedOutputStream.ComputeMessageSize(3, Options); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static EnumValueDescriptorProto ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static EnumValueDescriptorProto ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static EnumValueDescriptorProto ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static EnumValueDescriptorProto ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static EnumValueDescriptorProto ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static EnumValueDescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static EnumValueDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static EnumValueDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static EnumValueDescriptorProto ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static EnumValueDescriptorProto ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(EnumValueDescriptorProto prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - EnumValueDescriptorProto result = new EnumValueDescriptorProto(); - - protected override EnumValueDescriptorProto MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new EnumValueDescriptorProto(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto.Descriptor; } - } - - public override EnumValueDescriptorProto DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto.DefaultInstance; } - } - - public override EnumValueDescriptorProto BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - EnumValueDescriptorProto returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is EnumValueDescriptorProto) { - return MergeFrom((EnumValueDescriptorProto) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(EnumValueDescriptorProto other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.EnumValueDescriptorProto.DefaultInstance) return this; - if (other.HasName) { - Name = other.Name; - } - if (other.HasNumber) { - Number = other.Number; - } - if (other.HasOptions) { - MergeOptions(other.Options); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - Name = input.ReadString(); - break; - } - case 16: { - Number = input.ReadInt32(); - break; - } - case 26: { - global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.CreateBuilder(); - if (HasOptions) { - subBuilder.MergeFrom(Options); - } - input.ReadMessage(subBuilder, extensionRegistry); - Options = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasName { - get { return result.HasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - result.hasName = false; - result.name_ = ""; - return this; - } - - public bool HasNumber { - get { return result.HasNumber; } - } - public int Number { - get { return result.Number; } - set { SetNumber(value); } - } - public Builder SetNumber(int value) { - result.hasNumber = true; - result.number_ = value; - return this; - } - public Builder ClearNumber() { - result.hasNumber = false; - result.number_ = 0; - return this; - } - - public bool HasOptions { - get { return result.HasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions Options { - get { return result.Options; } - set { SetOptions(value); } - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasOptions = true; - result.options_ = value; - return this; - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasOptions = true; - result.options_ = builderForValue.Build(); - return this; - } - public Builder MergeOptions(global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasOptions && - result.options_ != global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.DefaultInstance) { - result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.CreateBuilder(result.options_).MergeFrom(value).BuildPartial(); - } else { - result.options_ = value; - } - result.hasOptions = true; - return this; - } - public Builder ClearOptions() { - result.hasOptions = false; - result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.DefaultInstance; - return this; - } - } - static EnumValueDescriptorProto() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - public sealed partial class ServiceDescriptorProto : pb::GeneratedMessage { - private static readonly ServiceDescriptorProto defaultInstance = new Builder().BuildPartial(); - public static ServiceDescriptorProto DefaultInstance { - get { return defaultInstance; } - } - - public override ServiceDescriptorProto DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ServiceDescriptorProto ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_ServiceDescriptorProto__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_ServiceDescriptorProto__FieldAccessorTable; } - } - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int MethodFieldNumber = 2; - private pbc::PopsicleList method_ = new pbc::PopsicleList(); - public scg::IList MethodList { - get { return method_; } - } - public int MethodCount { - get { return method_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto GetMethod(int index) { - return method_[index]; - } - - public const int OptionsFieldNumber = 3; - private bool hasOptions; - private global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions options_ = global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.DefaultInstance; - public bool HasOptions { - get { return hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions Options { - get { return options_; } - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto element in MethodList) { - if (!element.IsInitialized) return false; - } - if (HasOptions) { - if (!Options.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasName) { - output.WriteString(1, Name); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto element in MethodList) { - output.WriteMessage(2, element); - } - if (HasOptions) { - output.WriteMessage(3, Options); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasName) { - size += pb::CodedOutputStream.ComputeStringSize(1, Name); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto element in MethodList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - if (HasOptions) { - size += pb::CodedOutputStream.ComputeMessageSize(3, Options); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ServiceDescriptorProto ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ServiceDescriptorProto ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ServiceDescriptorProto ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ServiceDescriptorProto ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ServiceDescriptorProto ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ServiceDescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ServiceDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ServiceDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ServiceDescriptorProto ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ServiceDescriptorProto ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ServiceDescriptorProto prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ServiceDescriptorProto result = new ServiceDescriptorProto(); - - protected override ServiceDescriptorProto MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ServiceDescriptorProto(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto.Descriptor; } - } - - public override ServiceDescriptorProto DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto.DefaultInstance; } - } - - public override ServiceDescriptorProto BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.method_.MakeReadOnly(); - ServiceDescriptorProto returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ServiceDescriptorProto) { - return MergeFrom((ServiceDescriptorProto) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ServiceDescriptorProto other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.ServiceDescriptorProto.DefaultInstance) return this; - if (other.HasName) { - Name = other.Name; - } - if (other.method_.Count != 0) { - base.AddRange(other.method_, result.method_); - } - if (other.HasOptions) { - MergeOptions(other.Options); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddMethod(subBuilder.BuildPartial()); - break; - } - case 26: { - global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.CreateBuilder(); - if (HasOptions) { - subBuilder.MergeFrom(Options); - } - input.ReadMessage(subBuilder, extensionRegistry); - Options = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasName { - get { return result.HasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - result.hasName = false; - result.name_ = ""; - return this; - } - - public pbc::IPopsicleList MethodList { - get { return result.method_; } - } - public int MethodCount { - get { return result.MethodCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto GetMethod(int index) { - return result.GetMethod(index); - } - public Builder SetMethod(int index, global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.method_[index] = value; - return this; - } - public Builder SetMethod(int index, global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.method_[index] = builderForValue.Build(); - return this; - } - public Builder AddMethod(global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.method_.Add(value); - return this; - } - public Builder AddMethod(global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.method_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeMethod(scg::IEnumerable values) { - base.AddRange(values, result.method_); - return this; - } - public Builder ClearMethod() { - result.method_.Clear(); - return this; - } - - public bool HasOptions { - get { return result.HasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions Options { - get { return result.Options; } - set { SetOptions(value); } - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasOptions = true; - result.options_ = value; - return this; - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasOptions = true; - result.options_ = builderForValue.Build(); - return this; - } - public Builder MergeOptions(global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasOptions && - result.options_ != global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.DefaultInstance) { - result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.CreateBuilder(result.options_).MergeFrom(value).BuildPartial(); - } else { - result.options_ = value; - } - result.hasOptions = true; - return this; - } - public Builder ClearOptions() { - result.hasOptions = false; - result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.DefaultInstance; - return this; - } - } - static ServiceDescriptorProto() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - public sealed partial class MethodDescriptorProto : pb::GeneratedMessage { - private static readonly MethodDescriptorProto defaultInstance = new Builder().BuildPartial(); - public static MethodDescriptorProto DefaultInstance { - get { return defaultInstance; } - } - - public override MethodDescriptorProto DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override MethodDescriptorProto ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_MethodDescriptorProto__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_MethodDescriptorProto__FieldAccessorTable; } - } - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int InputTypeFieldNumber = 2; - private bool hasInputType; - private string inputType_ = ""; - public bool HasInputType { - get { return hasInputType; } - } - public string InputType { - get { return inputType_; } - } - - public const int OutputTypeFieldNumber = 3; - private bool hasOutputType; - private string outputType_ = ""; - public bool HasOutputType { - get { return hasOutputType; } - } - public string OutputType { - get { return outputType_; } - } - - public const int OptionsFieldNumber = 4; - private bool hasOptions; - private global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions options_ = global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.DefaultInstance; - public bool HasOptions { - get { return hasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions Options { - get { return options_; } - } - - public override bool IsInitialized { - get { - if (HasOptions) { - if (!Options.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasName) { - output.WriteString(1, Name); - } - if (HasInputType) { - output.WriteString(2, InputType); - } - if (HasOutputType) { - output.WriteString(3, OutputType); - } - if (HasOptions) { - output.WriteMessage(4, Options); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasName) { - size += pb::CodedOutputStream.ComputeStringSize(1, Name); - } - if (HasInputType) { - size += pb::CodedOutputStream.ComputeStringSize(2, InputType); - } - if (HasOutputType) { - size += pb::CodedOutputStream.ComputeStringSize(3, OutputType); - } - if (HasOptions) { - size += pb::CodedOutputStream.ComputeMessageSize(4, Options); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static MethodDescriptorProto ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MethodDescriptorProto ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MethodDescriptorProto ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MethodDescriptorProto ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MethodDescriptorProto ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MethodDescriptorProto ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static MethodDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static MethodDescriptorProto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static MethodDescriptorProto ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MethodDescriptorProto ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(MethodDescriptorProto prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - MethodDescriptorProto result = new MethodDescriptorProto(); - - protected override MethodDescriptorProto MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new MethodDescriptorProto(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto.Descriptor; } - } - - public override MethodDescriptorProto DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto.DefaultInstance; } - } - - public override MethodDescriptorProto BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - MethodDescriptorProto returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is MethodDescriptorProto) { - return MergeFrom((MethodDescriptorProto) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(MethodDescriptorProto other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.MethodDescriptorProto.DefaultInstance) return this; - if (other.HasName) { - Name = other.Name; - } - if (other.HasInputType) { - InputType = other.InputType; - } - if (other.HasOutputType) { - OutputType = other.OutputType; - } - if (other.HasOptions) { - MergeOptions(other.Options); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - InputType = input.ReadString(); - break; - } - case 26: { - OutputType = input.ReadString(); - break; - } - case 34: { - global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.CreateBuilder(); - if (HasOptions) { - subBuilder.MergeFrom(Options); - } - input.ReadMessage(subBuilder, extensionRegistry); - Options = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasName { - get { return result.HasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - result.hasName = false; - result.name_ = ""; - return this; - } - - public bool HasInputType { - get { return result.HasInputType; } - } - public string InputType { - get { return result.InputType; } - set { SetInputType(value); } - } - public Builder SetInputType(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasInputType = true; - result.inputType_ = value; - return this; - } - public Builder ClearInputType() { - result.hasInputType = false; - result.inputType_ = ""; - return this; - } - - public bool HasOutputType { - get { return result.HasOutputType; } - } - public string OutputType { - get { return result.OutputType; } - set { SetOutputType(value); } - } - public Builder SetOutputType(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasOutputType = true; - result.outputType_ = value; - return this; - } - public Builder ClearOutputType() { - result.hasOutputType = false; - result.outputType_ = ""; - return this; - } - - public bool HasOptions { - get { return result.HasOptions; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions Options { - get { return result.Options; } - set { SetOptions(value); } - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasOptions = true; - result.options_ = value; - return this; - } - public Builder SetOptions(global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasOptions = true; - result.options_ = builderForValue.Build(); - return this; - } - public Builder MergeOptions(global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasOptions && - result.options_ != global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.DefaultInstance) { - result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.CreateBuilder(result.options_).MergeFrom(value).BuildPartial(); - } else { - result.options_ = value; - } - result.hasOptions = true; - return this; - } - public Builder ClearOptions() { - result.hasOptions = false; - result.options_ = global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.DefaultInstance; - return this; - } - } - static MethodDescriptorProto() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - public sealed partial class FileOptions : pb::ExtendableMessage { - private static readonly FileOptions defaultInstance = new Builder().BuildPartial(); - public static FileOptions DefaultInstance { - get { return defaultInstance; } - } - - public override FileOptions DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override FileOptions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FileOptions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FileOptions__FieldAccessorTable; } - } - - #region Nested types - public static class Types { - public enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3, - } - - } - #endregion - - public const int JavaPackageFieldNumber = 1; - private bool hasJavaPackage; - private string javaPackage_ = ""; - public bool HasJavaPackage { - get { return hasJavaPackage; } - } - public string JavaPackage { - get { return javaPackage_; } - } - - public const int JavaOuterClassnameFieldNumber = 8; - private bool hasJavaOuterClassname; - private string javaOuterClassname_ = ""; - public bool HasJavaOuterClassname { - get { return hasJavaOuterClassname; } - } - public string JavaOuterClassname { - get { return javaOuterClassname_; } - } - - public const int JavaMultipleFilesFieldNumber = 10; - private bool hasJavaMultipleFiles; - private bool javaMultipleFiles_ = false; - public bool HasJavaMultipleFiles { - get { return hasJavaMultipleFiles; } - } - public bool JavaMultipleFiles { - get { return javaMultipleFiles_; } - } - - public const int OptimizeForFieldNumber = 9; - private bool hasOptimizeFor; - private global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Types.OptimizeMode optimizeFor_ = global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Types.OptimizeMode.SPEED; - public bool HasOptimizeFor { - get { return hasOptimizeFor; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Types.OptimizeMode OptimizeFor { - get { return optimizeFor_; } - } - - public const int CcGenericServicesFieldNumber = 16; - private bool hasCcGenericServices; - private bool ccGenericServices_ = true; - public bool HasCcGenericServices { - get { return hasCcGenericServices; } - } - public bool CcGenericServices { - get { return ccGenericServices_; } - } - - public const int JavaGenericServicesFieldNumber = 17; - private bool hasJavaGenericServices; - private bool javaGenericServices_ = true; - public bool HasJavaGenericServices { - get { return hasJavaGenericServices; } - } - public bool JavaGenericServices { - get { return javaGenericServices_; } - } - - public const int PyGenericServicesFieldNumber = 18; - private bool hasPyGenericServices; - private bool pyGenericServices_ = true; - public bool HasPyGenericServices { - get { return hasPyGenericServices; } - } - public bool PyGenericServices { - get { return pyGenericServices_; } - } - - public const int UninterpretedOptionFieldNumber = 999; - private pbc::PopsicleList uninterpretedOption_ = new pbc::PopsicleList(); - public scg::IList UninterpretedOptionList { - get { return uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return uninterpretedOption_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return uninterpretedOption_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - if (!element.IsInitialized) return false; - } - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - if (HasJavaPackage) { - output.WriteString(1, JavaPackage); - } - if (HasJavaOuterClassname) { - output.WriteString(8, JavaOuterClassname); - } - if (HasOptimizeFor) { - output.WriteEnum(9, (int) OptimizeFor); - } - if (HasJavaMultipleFiles) { - output.WriteBool(10, JavaMultipleFiles); - } - if (HasCcGenericServices) { - output.WriteBool(16, CcGenericServices); - } - if (HasJavaGenericServices) { - output.WriteBool(17, JavaGenericServices); - } - if (HasPyGenericServices) { - output.WriteBool(18, PyGenericServices); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - output.WriteMessage(999, element); - } - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasJavaPackage) { - size += pb::CodedOutputStream.ComputeStringSize(1, JavaPackage); - } - if (HasJavaOuterClassname) { - size += pb::CodedOutputStream.ComputeStringSize(8, JavaOuterClassname); - } - if (HasJavaMultipleFiles) { - size += pb::CodedOutputStream.ComputeBoolSize(10, JavaMultipleFiles); - } - if (HasOptimizeFor) { - size += pb::CodedOutputStream.ComputeEnumSize(9, (int) OptimizeFor); - } - if (HasCcGenericServices) { - size += pb::CodedOutputStream.ComputeBoolSize(16, CcGenericServices); - } - if (HasJavaGenericServices) { - size += pb::CodedOutputStream.ComputeBoolSize(17, JavaGenericServices); - } - if (HasPyGenericServices) { - size += pb::CodedOutputStream.ComputeBoolSize(18, PyGenericServices); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - size += pb::CodedOutputStream.ComputeMessageSize(999, element); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static FileOptions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FileOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FileOptions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FileOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FileOptions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FileOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static FileOptions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static FileOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static FileOptions ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FileOptions ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(FileOptions prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - FileOptions result = new FileOptions(); - - protected override FileOptions MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new FileOptions(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Descriptor; } - } - - public override FileOptions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.DefaultInstance; } - } - - public override FileOptions BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.uninterpretedOption_.MakeReadOnly(); - FileOptions returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is FileOptions) { - return MergeFrom((FileOptions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(FileOptions other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.DefaultInstance) return this; - if (other.HasJavaPackage) { - JavaPackage = other.JavaPackage; - } - if (other.HasJavaOuterClassname) { - JavaOuterClassname = other.JavaOuterClassname; - } - if (other.HasJavaMultipleFiles) { - JavaMultipleFiles = other.JavaMultipleFiles; - } - if (other.HasOptimizeFor) { - OptimizeFor = other.OptimizeFor; - } - if (other.HasCcGenericServices) { - CcGenericServices = other.CcGenericServices; - } - if (other.HasJavaGenericServices) { - JavaGenericServices = other.JavaGenericServices; - } - if (other.HasPyGenericServices) { - PyGenericServices = other.PyGenericServices; - } - if (other.uninterpretedOption_.Count != 0) { - base.AddRange(other.uninterpretedOption_, result.uninterpretedOption_); - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - JavaPackage = input.ReadString(); - break; - } - case 66: { - JavaOuterClassname = input.ReadString(); - break; - } - case 72: { - int rawValue = input.ReadEnum(); - if (!global::System.Enum.IsDefined(typeof(global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Types.OptimizeMode), rawValue)) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(9, (ulong) rawValue); - } else { - OptimizeFor = (global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Types.OptimizeMode) rawValue; - } - break; - } - case 80: { - JavaMultipleFiles = input.ReadBool(); - break; - } - case 128: { - CcGenericServices = input.ReadBool(); - break; - } - case 136: { - JavaGenericServices = input.ReadBool(); - break; - } - case 144: { - PyGenericServices = input.ReadBool(); - break; - } - case 7994: { - global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddUninterpretedOption(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public bool HasJavaPackage { - get { return result.HasJavaPackage; } - } - public string JavaPackage { - get { return result.JavaPackage; } - set { SetJavaPackage(value); } - } - public Builder SetJavaPackage(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasJavaPackage = true; - result.javaPackage_ = value; - return this; - } - public Builder ClearJavaPackage() { - result.hasJavaPackage = false; - result.javaPackage_ = ""; - return this; - } - - public bool HasJavaOuterClassname { - get { return result.HasJavaOuterClassname; } - } - public string JavaOuterClassname { - get { return result.JavaOuterClassname; } - set { SetJavaOuterClassname(value); } - } - public Builder SetJavaOuterClassname(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasJavaOuterClassname = true; - result.javaOuterClassname_ = value; - return this; - } - public Builder ClearJavaOuterClassname() { - result.hasJavaOuterClassname = false; - result.javaOuterClassname_ = ""; - return this; - } - - public bool HasJavaMultipleFiles { - get { return result.HasJavaMultipleFiles; } - } - public bool JavaMultipleFiles { - get { return result.JavaMultipleFiles; } - set { SetJavaMultipleFiles(value); } - } - public Builder SetJavaMultipleFiles(bool value) { - result.hasJavaMultipleFiles = true; - result.javaMultipleFiles_ = value; - return this; - } - public Builder ClearJavaMultipleFiles() { - result.hasJavaMultipleFiles = false; - result.javaMultipleFiles_ = false; - return this; - } - - public bool HasOptimizeFor { - get { return result.HasOptimizeFor; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Types.OptimizeMode OptimizeFor { - get { return result.OptimizeFor; } - set { SetOptimizeFor(value); } - } - public Builder SetOptimizeFor(global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Types.OptimizeMode value) { - result.hasOptimizeFor = true; - result.optimizeFor_ = value; - return this; - } - public Builder ClearOptimizeFor() { - result.hasOptimizeFor = false; - result.optimizeFor_ = global::Google.ProtocolBuffers.DescriptorProtos.FileOptions.Types.OptimizeMode.SPEED; - return this; - } - - public bool HasCcGenericServices { - get { return result.HasCcGenericServices; } - } - public bool CcGenericServices { - get { return result.CcGenericServices; } - set { SetCcGenericServices(value); } - } - public Builder SetCcGenericServices(bool value) { - result.hasCcGenericServices = true; - result.ccGenericServices_ = value; - return this; - } - public Builder ClearCcGenericServices() { - result.hasCcGenericServices = false; - result.ccGenericServices_ = true; - return this; - } - - public bool HasJavaGenericServices { - get { return result.HasJavaGenericServices; } - } - public bool JavaGenericServices { - get { return result.JavaGenericServices; } - set { SetJavaGenericServices(value); } - } - public Builder SetJavaGenericServices(bool value) { - result.hasJavaGenericServices = true; - result.javaGenericServices_ = value; - return this; - } - public Builder ClearJavaGenericServices() { - result.hasJavaGenericServices = false; - result.javaGenericServices_ = true; - return this; - } - - public bool HasPyGenericServices { - get { return result.HasPyGenericServices; } - } - public bool PyGenericServices { - get { return result.PyGenericServices; } - set { SetPyGenericServices(value); } - } - public Builder SetPyGenericServices(bool value) { - result.hasPyGenericServices = true; - result.pyGenericServices_ = value; - return this; - } - public Builder ClearPyGenericServices() { - result.hasPyGenericServices = false; - result.pyGenericServices_ = true; - return this; - } - - public pbc::IPopsicleList UninterpretedOptionList { - get { return result.uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return result.UninterpretedOptionCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return result.GetUninterpretedOption(index); - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.uninterpretedOption_[index] = value; - return this; - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.uninterpretedOption_[index] = builderForValue.Build(); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.uninterpretedOption_.Add(value); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.uninterpretedOption_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeUninterpretedOption(scg::IEnumerable values) { - base.AddRange(values, result.uninterpretedOption_); - return this; - } - public Builder ClearUninterpretedOption() { - result.uninterpretedOption_.Clear(); - return this; - } - } - static FileOptions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - public sealed partial class MessageOptions : pb::ExtendableMessage { - private static readonly MessageOptions defaultInstance = new Builder().BuildPartial(); - public static MessageOptions DefaultInstance { - get { return defaultInstance; } - } - - public override MessageOptions DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override MessageOptions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_MessageOptions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_MessageOptions__FieldAccessorTable; } - } - - public const int MessageSetWireFormatFieldNumber = 1; - private bool hasMessageSetWireFormat; - private bool messageSetWireFormat_ = false; - public bool HasMessageSetWireFormat { - get { return hasMessageSetWireFormat; } - } - public bool MessageSetWireFormat { - get { return messageSetWireFormat_; } - } - - public const int NoStandardDescriptorAccessorFieldNumber = 2; - private bool hasNoStandardDescriptorAccessor; - private bool noStandardDescriptorAccessor_ = false; - public bool HasNoStandardDescriptorAccessor { - get { return hasNoStandardDescriptorAccessor; } - } - public bool NoStandardDescriptorAccessor { - get { return noStandardDescriptorAccessor_; } - } - - public const int UninterpretedOptionFieldNumber = 999; - private pbc::PopsicleList uninterpretedOption_ = new pbc::PopsicleList(); - public scg::IList UninterpretedOptionList { - get { return uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return uninterpretedOption_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return uninterpretedOption_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - if (!element.IsInitialized) return false; - } - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - if (HasMessageSetWireFormat) { - output.WriteBool(1, MessageSetWireFormat); - } - if (HasNoStandardDescriptorAccessor) { - output.WriteBool(2, NoStandardDescriptorAccessor); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - output.WriteMessage(999, element); - } - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasMessageSetWireFormat) { - size += pb::CodedOutputStream.ComputeBoolSize(1, MessageSetWireFormat); - } - if (HasNoStandardDescriptorAccessor) { - size += pb::CodedOutputStream.ComputeBoolSize(2, NoStandardDescriptorAccessor); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - size += pb::CodedOutputStream.ComputeMessageSize(999, element); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static MessageOptions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MessageOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MessageOptions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MessageOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MessageOptions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MessageOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static MessageOptions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static MessageOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static MessageOptions ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MessageOptions ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(MessageOptions prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - MessageOptions result = new MessageOptions(); - - protected override MessageOptions MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new MessageOptions(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.Descriptor; } - } - - public override MessageOptions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.DefaultInstance; } - } - - public override MessageOptions BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.uninterpretedOption_.MakeReadOnly(); - MessageOptions returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is MessageOptions) { - return MergeFrom((MessageOptions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(MessageOptions other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.MessageOptions.DefaultInstance) return this; - if (other.HasMessageSetWireFormat) { - MessageSetWireFormat = other.MessageSetWireFormat; - } - if (other.HasNoStandardDescriptorAccessor) { - NoStandardDescriptorAccessor = other.NoStandardDescriptorAccessor; - } - if (other.uninterpretedOption_.Count != 0) { - base.AddRange(other.uninterpretedOption_, result.uninterpretedOption_); - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - MessageSetWireFormat = input.ReadBool(); - break; - } - case 16: { - NoStandardDescriptorAccessor = input.ReadBool(); - break; - } - case 7994: { - global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddUninterpretedOption(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public bool HasMessageSetWireFormat { - get { return result.HasMessageSetWireFormat; } - } - public bool MessageSetWireFormat { - get { return result.MessageSetWireFormat; } - set { SetMessageSetWireFormat(value); } - } - public Builder SetMessageSetWireFormat(bool value) { - result.hasMessageSetWireFormat = true; - result.messageSetWireFormat_ = value; - return this; - } - public Builder ClearMessageSetWireFormat() { - result.hasMessageSetWireFormat = false; - result.messageSetWireFormat_ = false; - return this; - } - - public bool HasNoStandardDescriptorAccessor { - get { return result.HasNoStandardDescriptorAccessor; } - } - public bool NoStandardDescriptorAccessor { - get { return result.NoStandardDescriptorAccessor; } - set { SetNoStandardDescriptorAccessor(value); } - } - public Builder SetNoStandardDescriptorAccessor(bool value) { - result.hasNoStandardDescriptorAccessor = true; - result.noStandardDescriptorAccessor_ = value; - return this; - } - public Builder ClearNoStandardDescriptorAccessor() { - result.hasNoStandardDescriptorAccessor = false; - result.noStandardDescriptorAccessor_ = false; - return this; - } - - public pbc::IPopsicleList UninterpretedOptionList { - get { return result.uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return result.UninterpretedOptionCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return result.GetUninterpretedOption(index); - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.uninterpretedOption_[index] = value; - return this; - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.uninterpretedOption_[index] = builderForValue.Build(); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.uninterpretedOption_.Add(value); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.uninterpretedOption_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeUninterpretedOption(scg::IEnumerable values) { - base.AddRange(values, result.uninterpretedOption_); - return this; - } - public Builder ClearUninterpretedOption() { - result.uninterpretedOption_.Clear(); - return this; - } - } - static MessageOptions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - public sealed partial class FieldOptions : pb::ExtendableMessage { - private static readonly FieldOptions defaultInstance = new Builder().BuildPartial(); - public static FieldOptions DefaultInstance { - get { return defaultInstance; } - } - - public override FieldOptions DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override FieldOptions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FieldOptions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FieldOptions__FieldAccessorTable; } - } - - #region Nested types - public static class Types { - public enum CType { - STRING = 0, - CORD = 1, - STRING_PIECE = 2, - } - - } - #endregion - - public const int CtypeFieldNumber = 1; - private bool hasCtype; - private global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Types.CType ctype_ = global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Types.CType.STRING; - public bool HasCtype { - get { return hasCtype; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Types.CType Ctype { - get { return ctype_; } - } - - public const int PackedFieldNumber = 2; - private bool hasPacked; - private bool packed_ = false; - public bool HasPacked { - get { return hasPacked; } - } - public bool Packed { - get { return packed_; } - } - - public const int DeprecatedFieldNumber = 3; - private bool hasDeprecated; - private bool deprecated_ = false; - public bool HasDeprecated { - get { return hasDeprecated; } - } - public bool Deprecated { - get { return deprecated_; } - } - - public const int ExperimentalMapKeyFieldNumber = 9; - private bool hasExperimentalMapKey; - private string experimentalMapKey_ = ""; - public bool HasExperimentalMapKey { - get { return hasExperimentalMapKey; } - } - public string ExperimentalMapKey { - get { return experimentalMapKey_; } - } - - public const int UninterpretedOptionFieldNumber = 999; - private pbc::PopsicleList uninterpretedOption_ = new pbc::PopsicleList(); - public scg::IList UninterpretedOptionList { - get { return uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return uninterpretedOption_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return uninterpretedOption_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - if (!element.IsInitialized) return false; - } - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - if (HasCtype) { - output.WriteEnum(1, (int) Ctype); - } - if (HasPacked) { - output.WriteBool(2, Packed); - } - if (HasDeprecated) { - output.WriteBool(3, Deprecated); - } - if (HasExperimentalMapKey) { - output.WriteString(9, ExperimentalMapKey); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - output.WriteMessage(999, element); - } - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasCtype) { - size += pb::CodedOutputStream.ComputeEnumSize(1, (int) Ctype); - } - if (HasPacked) { - size += pb::CodedOutputStream.ComputeBoolSize(2, Packed); - } - if (HasDeprecated) { - size += pb::CodedOutputStream.ComputeBoolSize(3, Deprecated); - } - if (HasExperimentalMapKey) { - size += pb::CodedOutputStream.ComputeStringSize(9, ExperimentalMapKey); - } - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - size += pb::CodedOutputStream.ComputeMessageSize(999, element); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static FieldOptions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FieldOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FieldOptions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FieldOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FieldOptions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FieldOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static FieldOptions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static FieldOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static FieldOptions ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FieldOptions ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(FieldOptions prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - FieldOptions result = new FieldOptions(); - - protected override FieldOptions MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new FieldOptions(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Descriptor; } - } - - public override FieldOptions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.DefaultInstance; } - } - - public override FieldOptions BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.uninterpretedOption_.MakeReadOnly(); - FieldOptions returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is FieldOptions) { - return MergeFrom((FieldOptions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(FieldOptions other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.DefaultInstance) return this; - if (other.HasCtype) { - Ctype = other.Ctype; - } - if (other.HasPacked) { - Packed = other.Packed; - } - if (other.HasDeprecated) { - Deprecated = other.Deprecated; - } - if (other.HasExperimentalMapKey) { - ExperimentalMapKey = other.ExperimentalMapKey; - } - if (other.uninterpretedOption_.Count != 0) { - base.AddRange(other.uninterpretedOption_, result.uninterpretedOption_); - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - int rawValue = input.ReadEnum(); - if (!global::System.Enum.IsDefined(typeof(global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Types.CType), rawValue)) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(1, (ulong) rawValue); - } else { - Ctype = (global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Types.CType) rawValue; - } - break; - } - case 16: { - Packed = input.ReadBool(); - break; - } - case 24: { - Deprecated = input.ReadBool(); - break; - } - case 74: { - ExperimentalMapKey = input.ReadString(); - break; - } - case 7994: { - global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddUninterpretedOption(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public bool HasCtype { - get { return result.HasCtype; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Types.CType Ctype { - get { return result.Ctype; } - set { SetCtype(value); } - } - public Builder SetCtype(global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Types.CType value) { - result.hasCtype = true; - result.ctype_ = value; - return this; - } - public Builder ClearCtype() { - result.hasCtype = false; - result.ctype_ = global::Google.ProtocolBuffers.DescriptorProtos.FieldOptions.Types.CType.STRING; - return this; - } - - public bool HasPacked { - get { return result.HasPacked; } - } - public bool Packed { - get { return result.Packed; } - set { SetPacked(value); } - } - public Builder SetPacked(bool value) { - result.hasPacked = true; - result.packed_ = value; - return this; - } - public Builder ClearPacked() { - result.hasPacked = false; - result.packed_ = false; - return this; - } - - public bool HasDeprecated { - get { return result.HasDeprecated; } - } - public bool Deprecated { - get { return result.Deprecated; } - set { SetDeprecated(value); } - } - public Builder SetDeprecated(bool value) { - result.hasDeprecated = true; - result.deprecated_ = value; - return this; - } - public Builder ClearDeprecated() { - result.hasDeprecated = false; - result.deprecated_ = false; - return this; - } - - public bool HasExperimentalMapKey { - get { return result.HasExperimentalMapKey; } - } - public string ExperimentalMapKey { - get { return result.ExperimentalMapKey; } - set { SetExperimentalMapKey(value); } - } - public Builder SetExperimentalMapKey(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasExperimentalMapKey = true; - result.experimentalMapKey_ = value; - return this; - } - public Builder ClearExperimentalMapKey() { - result.hasExperimentalMapKey = false; - result.experimentalMapKey_ = ""; - return this; - } - - public pbc::IPopsicleList UninterpretedOptionList { - get { return result.uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return result.UninterpretedOptionCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return result.GetUninterpretedOption(index); - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.uninterpretedOption_[index] = value; - return this; - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.uninterpretedOption_[index] = builderForValue.Build(); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.uninterpretedOption_.Add(value); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.uninterpretedOption_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeUninterpretedOption(scg::IEnumerable values) { - base.AddRange(values, result.uninterpretedOption_); - return this; - } - public Builder ClearUninterpretedOption() { - result.uninterpretedOption_.Clear(); - return this; - } - } - static FieldOptions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - public sealed partial class EnumOptions : pb::ExtendableMessage { - private static readonly EnumOptions defaultInstance = new Builder().BuildPartial(); - public static EnumOptions DefaultInstance { - get { return defaultInstance; } - } - - public override EnumOptions DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override EnumOptions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumOptions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumOptions__FieldAccessorTable; } - } - - public const int UninterpretedOptionFieldNumber = 999; - private pbc::PopsicleList uninterpretedOption_ = new pbc::PopsicleList(); - public scg::IList UninterpretedOptionList { - get { return uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return uninterpretedOption_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return uninterpretedOption_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - if (!element.IsInitialized) return false; - } - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - output.WriteMessage(999, element); - } - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - size += pb::CodedOutputStream.ComputeMessageSize(999, element); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static EnumOptions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static EnumOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static EnumOptions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static EnumOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static EnumOptions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static EnumOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static EnumOptions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static EnumOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static EnumOptions ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static EnumOptions ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(EnumOptions prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - EnumOptions result = new EnumOptions(); - - protected override EnumOptions MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new EnumOptions(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.Descriptor; } - } - - public override EnumOptions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.DefaultInstance; } - } - - public override EnumOptions BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.uninterpretedOption_.MakeReadOnly(); - EnumOptions returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is EnumOptions) { - return MergeFrom((EnumOptions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(EnumOptions other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.EnumOptions.DefaultInstance) return this; - if (other.uninterpretedOption_.Count != 0) { - base.AddRange(other.uninterpretedOption_, result.uninterpretedOption_); - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 7994: { - global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddUninterpretedOption(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public pbc::IPopsicleList UninterpretedOptionList { - get { return result.uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return result.UninterpretedOptionCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return result.GetUninterpretedOption(index); - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.uninterpretedOption_[index] = value; - return this; - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.uninterpretedOption_[index] = builderForValue.Build(); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.uninterpretedOption_.Add(value); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.uninterpretedOption_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeUninterpretedOption(scg::IEnumerable values) { - base.AddRange(values, result.uninterpretedOption_); - return this; - } - public Builder ClearUninterpretedOption() { - result.uninterpretedOption_.Clear(); - return this; - } - } - static EnumOptions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - public sealed partial class EnumValueOptions : pb::ExtendableMessage { - private static readonly EnumValueOptions defaultInstance = new Builder().BuildPartial(); - public static EnumValueOptions DefaultInstance { - get { return defaultInstance; } - } - - public override EnumValueOptions DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override EnumValueOptions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumValueOptions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumValueOptions__FieldAccessorTable; } - } - - public const int UninterpretedOptionFieldNumber = 999; - private pbc::PopsicleList uninterpretedOption_ = new pbc::PopsicleList(); - public scg::IList UninterpretedOptionList { - get { return uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return uninterpretedOption_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return uninterpretedOption_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - if (!element.IsInitialized) return false; - } - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - output.WriteMessage(999, element); - } - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - size += pb::CodedOutputStream.ComputeMessageSize(999, element); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static EnumValueOptions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static EnumValueOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static EnumValueOptions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static EnumValueOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static EnumValueOptions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static EnumValueOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static EnumValueOptions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static EnumValueOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static EnumValueOptions ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static EnumValueOptions ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(EnumValueOptions prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - EnumValueOptions result = new EnumValueOptions(); - - protected override EnumValueOptions MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new EnumValueOptions(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.Descriptor; } - } - - public override EnumValueOptions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.DefaultInstance; } - } - - public override EnumValueOptions BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.uninterpretedOption_.MakeReadOnly(); - EnumValueOptions returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is EnumValueOptions) { - return MergeFrom((EnumValueOptions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(EnumValueOptions other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.EnumValueOptions.DefaultInstance) return this; - if (other.uninterpretedOption_.Count != 0) { - base.AddRange(other.uninterpretedOption_, result.uninterpretedOption_); - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 7994: { - global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddUninterpretedOption(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public pbc::IPopsicleList UninterpretedOptionList { - get { return result.uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return result.UninterpretedOptionCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return result.GetUninterpretedOption(index); - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.uninterpretedOption_[index] = value; - return this; - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.uninterpretedOption_[index] = builderForValue.Build(); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.uninterpretedOption_.Add(value); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.uninterpretedOption_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeUninterpretedOption(scg::IEnumerable values) { - base.AddRange(values, result.uninterpretedOption_); - return this; - } - public Builder ClearUninterpretedOption() { - result.uninterpretedOption_.Clear(); - return this; - } - } - static EnumValueOptions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - public sealed partial class ServiceOptions : pb::ExtendableMessage { - private static readonly ServiceOptions defaultInstance = new Builder().BuildPartial(); - public static ServiceOptions DefaultInstance { - get { return defaultInstance; } - } - - public override ServiceOptions DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ServiceOptions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_ServiceOptions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_ServiceOptions__FieldAccessorTable; } - } - - public const int UninterpretedOptionFieldNumber = 999; - private pbc::PopsicleList uninterpretedOption_ = new pbc::PopsicleList(); - public scg::IList UninterpretedOptionList { - get { return uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return uninterpretedOption_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return uninterpretedOption_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - if (!element.IsInitialized) return false; - } - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - output.WriteMessage(999, element); - } - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - size += pb::CodedOutputStream.ComputeMessageSize(999, element); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ServiceOptions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ServiceOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ServiceOptions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ServiceOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ServiceOptions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ServiceOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ServiceOptions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ServiceOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ServiceOptions ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ServiceOptions ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ServiceOptions prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ServiceOptions result = new ServiceOptions(); - - protected override ServiceOptions MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ServiceOptions(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.Descriptor; } - } - - public override ServiceOptions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.DefaultInstance; } - } - - public override ServiceOptions BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.uninterpretedOption_.MakeReadOnly(); - ServiceOptions returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ServiceOptions) { - return MergeFrom((ServiceOptions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ServiceOptions other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.ServiceOptions.DefaultInstance) return this; - if (other.uninterpretedOption_.Count != 0) { - base.AddRange(other.uninterpretedOption_, result.uninterpretedOption_); - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 7994: { - global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddUninterpretedOption(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public pbc::IPopsicleList UninterpretedOptionList { - get { return result.uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return result.UninterpretedOptionCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return result.GetUninterpretedOption(index); - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.uninterpretedOption_[index] = value; - return this; - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.uninterpretedOption_[index] = builderForValue.Build(); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.uninterpretedOption_.Add(value); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.uninterpretedOption_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeUninterpretedOption(scg::IEnumerable values) { - base.AddRange(values, result.uninterpretedOption_); - return this; - } - public Builder ClearUninterpretedOption() { - result.uninterpretedOption_.Clear(); - return this; - } - } - static ServiceOptions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - public sealed partial class MethodOptions : pb::ExtendableMessage { - private static readonly MethodOptions defaultInstance = new Builder().BuildPartial(); - public static MethodOptions DefaultInstance { - get { return defaultInstance; } - } - - public override MethodOptions DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override MethodOptions ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_MethodOptions__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_MethodOptions__FieldAccessorTable; } - } - - public const int UninterpretedOptionFieldNumber = 999; - private pbc::PopsicleList uninterpretedOption_ = new pbc::PopsicleList(); - public scg::IList UninterpretedOptionList { - get { return uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return uninterpretedOption_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return uninterpretedOption_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - if (!element.IsInitialized) return false; - } - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - output.WriteMessage(999, element); - } - extensionWriter.WriteUntil(536870912, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption element in UninterpretedOptionList) { - size += pb::CodedOutputStream.ComputeMessageSize(999, element); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static MethodOptions ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MethodOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MethodOptions ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MethodOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MethodOptions ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MethodOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static MethodOptions ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static MethodOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static MethodOptions ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MethodOptions ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(MethodOptions prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - MethodOptions result = new MethodOptions(); - - protected override MethodOptions MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new MethodOptions(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.Descriptor; } - } - - public override MethodOptions DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.DefaultInstance; } - } - - public override MethodOptions BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.uninterpretedOption_.MakeReadOnly(); - MethodOptions returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is MethodOptions) { - return MergeFrom((MethodOptions) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(MethodOptions other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.MethodOptions.DefaultInstance) return this; - if (other.uninterpretedOption_.Count != 0) { - base.AddRange(other.uninterpretedOption_, result.uninterpretedOption_); - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 7994: { - global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddUninterpretedOption(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public pbc::IPopsicleList UninterpretedOptionList { - get { return result.uninterpretedOption_; } - } - public int UninterpretedOptionCount { - get { return result.UninterpretedOptionCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption GetUninterpretedOption(int index) { - return result.GetUninterpretedOption(index); - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.uninterpretedOption_[index] = value; - return this; - } - public Builder SetUninterpretedOption(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.uninterpretedOption_[index] = builderForValue.Build(); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.uninterpretedOption_.Add(value); - return this; - } - public Builder AddUninterpretedOption(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.uninterpretedOption_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeUninterpretedOption(scg::IEnumerable values) { - base.AddRange(values, result.uninterpretedOption_); - return this; - } - public Builder ClearUninterpretedOption() { - result.uninterpretedOption_.Clear(); - return this; - } - } - static MethodOptions() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - public sealed partial class UninterpretedOption : pb::GeneratedMessage { - private static readonly UninterpretedOption defaultInstance = new Builder().BuildPartial(); - public static UninterpretedOption DefaultInstance { - get { return defaultInstance; } - } - - public override UninterpretedOption DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override UninterpretedOption ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_UninterpretedOption__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_UninterpretedOption__FieldAccessorTable; } - } - - #region Nested types - public static class Types { - public sealed partial class NamePart : pb::GeneratedMessage { - private static readonly NamePart defaultInstance = new Builder().BuildPartial(); - public static NamePart DefaultInstance { - get { return defaultInstance; } - } - - public override NamePart DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override NamePart ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_UninterpretedOption_NamePart__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_UninterpretedOption_NamePart__FieldAccessorTable; } - } - - public const int NamePart_FieldNumber = 1; - private bool hasNamePart_; - private string namePart_ = ""; - public bool HasNamePart_ { - get { return hasNamePart_; } - } - public string NamePart_ { - get { return namePart_; } - } - - public const int IsExtensionFieldNumber = 2; - private bool hasIsExtension; - private bool isExtension_ = false; - public bool HasIsExtension { - get { return hasIsExtension; } - } - public bool IsExtension { - get { return isExtension_; } - } - - public override bool IsInitialized { - get { - if (!hasNamePart_) return false; - if (!hasIsExtension) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasNamePart_) { - output.WriteString(1, NamePart_); - } - if (HasIsExtension) { - output.WriteBool(2, IsExtension); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasNamePart_) { - size += pb::CodedOutputStream.ComputeStringSize(1, NamePart_); - } - if (HasIsExtension) { - size += pb::CodedOutputStream.ComputeBoolSize(2, IsExtension); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static NamePart ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NamePart ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NamePart ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NamePart ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NamePart ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NamePart ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static NamePart ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static NamePart ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static NamePart ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NamePart ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(NamePart prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - NamePart result = new NamePart(); - - protected override NamePart MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new NamePart(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart.Descriptor; } - } - - public override NamePart DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart.DefaultInstance; } - } - - public override NamePart BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - NamePart returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is NamePart) { - return MergeFrom((NamePart) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(NamePart other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart.DefaultInstance) return this; - if (other.HasNamePart_) { - NamePart_ = other.NamePart_; - } - if (other.HasIsExtension) { - IsExtension = other.IsExtension; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - NamePart_ = input.ReadString(); - break; - } - case 16: { - IsExtension = input.ReadBool(); - break; - } - } - } - } - - - public bool HasNamePart_ { - get { return result.HasNamePart_; } - } - public string NamePart_ { - get { return result.NamePart_; } - set { SetNamePart_(value); } - } - public Builder SetNamePart_(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasNamePart_ = true; - result.namePart_ = value; - return this; - } - public Builder ClearNamePart_() { - result.hasNamePart_ = false; - result.namePart_ = ""; - return this; - } - - public bool HasIsExtension { - get { return result.HasIsExtension; } - } - public bool IsExtension { - get { return result.IsExtension; } - set { SetIsExtension(value); } - } - public Builder SetIsExtension(bool value) { - result.hasIsExtension = true; - result.isExtension_ = value; - return this; - } - public Builder ClearIsExtension() { - result.hasIsExtension = false; - result.isExtension_ = false; - return this; - } - } - static NamePart() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - } - #endregion - - public const int NameFieldNumber = 2; - private pbc::PopsicleList name_ = new pbc::PopsicleList(); - public scg::IList NameList { - get { return name_; } - } - public int NameCount { - get { return name_.Count; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart GetName(int index) { - return name_[index]; - } - - public const int IdentifierValueFieldNumber = 3; - private bool hasIdentifierValue; - private string identifierValue_ = ""; - public bool HasIdentifierValue { - get { return hasIdentifierValue; } - } - public string IdentifierValue { - get { return identifierValue_; } - } - - public const int PositiveIntValueFieldNumber = 4; - private bool hasPositiveIntValue; - private ulong positiveIntValue_ = 0UL; - public bool HasPositiveIntValue { - get { return hasPositiveIntValue; } - } - [global::System.CLSCompliant(false)] - public ulong PositiveIntValue { - get { return positiveIntValue_; } - } - - public const int NegativeIntValueFieldNumber = 5; - private bool hasNegativeIntValue; - private long negativeIntValue_ = 0L; - public bool HasNegativeIntValue { - get { return hasNegativeIntValue; } - } - public long NegativeIntValue { - get { return negativeIntValue_; } - } - - public const int DoubleValueFieldNumber = 6; - private bool hasDoubleValue; - private double doubleValue_ = 0D; - public bool HasDoubleValue { - get { return hasDoubleValue; } - } - public double DoubleValue { - get { return doubleValue_; } - } - - public const int StringValueFieldNumber = 7; - private bool hasStringValue; - private pb::ByteString stringValue_ = pb::ByteString.Empty; - public bool HasStringValue { - get { return hasStringValue; } - } - public pb::ByteString StringValue { - get { return stringValue_; } - } - - public override bool IsInitialized { - get { - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart element in NameList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart element in NameList) { - output.WriteMessage(2, element); - } - if (HasIdentifierValue) { - output.WriteString(3, IdentifierValue); - } - if (HasPositiveIntValue) { - output.WriteUInt64(4, PositiveIntValue); - } - if (HasNegativeIntValue) { - output.WriteInt64(5, NegativeIntValue); - } - if (HasDoubleValue) { - output.WriteDouble(6, DoubleValue); - } - if (HasStringValue) { - output.WriteBytes(7, StringValue); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart element in NameList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - if (HasIdentifierValue) { - size += pb::CodedOutputStream.ComputeStringSize(3, IdentifierValue); - } - if (HasPositiveIntValue) { - size += pb::CodedOutputStream.ComputeUInt64Size(4, PositiveIntValue); - } - if (HasNegativeIntValue) { - size += pb::CodedOutputStream.ComputeInt64Size(5, NegativeIntValue); - } - if (HasDoubleValue) { - size += pb::CodedOutputStream.ComputeDoubleSize(6, DoubleValue); - } - if (HasStringValue) { - size += pb::CodedOutputStream.ComputeBytesSize(7, StringValue); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static UninterpretedOption ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static UninterpretedOption ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static UninterpretedOption ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static UninterpretedOption ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static UninterpretedOption ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static UninterpretedOption ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static UninterpretedOption ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static UninterpretedOption ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static UninterpretedOption ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static UninterpretedOption ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(UninterpretedOption prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - UninterpretedOption result = new UninterpretedOption(); - - protected override UninterpretedOption MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new UninterpretedOption(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Descriptor; } - } - - public override UninterpretedOption DefaultInstanceForType { - get { return global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.DefaultInstance; } - } - - public override UninterpretedOption BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.name_.MakeReadOnly(); - UninterpretedOption returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is UninterpretedOption) { - return MergeFrom((UninterpretedOption) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(UninterpretedOption other) { - if (other == global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.DefaultInstance) return this; - if (other.name_.Count != 0) { - base.AddRange(other.name_, result.name_); - } - if (other.HasIdentifierValue) { - IdentifierValue = other.IdentifierValue; - } - if (other.HasPositiveIntValue) { - PositiveIntValue = other.PositiveIntValue; - } - if (other.HasNegativeIntValue) { - NegativeIntValue = other.NegativeIntValue; - } - if (other.HasDoubleValue) { - DoubleValue = other.DoubleValue; - } - if (other.HasStringValue) { - StringValue = other.StringValue; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 18: { - global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart.Builder subBuilder = global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddName(subBuilder.BuildPartial()); - break; - } - case 26: { - IdentifierValue = input.ReadString(); - break; - } - case 32: { - PositiveIntValue = input.ReadUInt64(); - break; - } - case 40: { - NegativeIntValue = input.ReadInt64(); - break; - } - case 49: { - DoubleValue = input.ReadDouble(); - break; - } - case 58: { - StringValue = input.ReadBytes(); - break; - } - } - } - } - - - public pbc::IPopsicleList NameList { - get { return result.name_; } - } - public int NameCount { - get { return result.NameCount; } - } - public global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart GetName(int index) { - return result.GetName(index); - } - public Builder SetName(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.name_[index] = value; - return this; - } - public Builder SetName(int index, global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.name_[index] = builderForValue.Build(); - return this; - } - public Builder AddName(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.name_.Add(value); - return this; - } - public Builder AddName(global::Google.ProtocolBuffers.DescriptorProtos.UninterpretedOption.Types.NamePart.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.name_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeName(scg::IEnumerable values) { - base.AddRange(values, result.name_); - return this; - } - public Builder ClearName() { - result.name_.Clear(); - return this; - } - - public bool HasIdentifierValue { - get { return result.HasIdentifierValue; } - } - public string IdentifierValue { - get { return result.IdentifierValue; } - set { SetIdentifierValue(value); } - } - public Builder SetIdentifierValue(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasIdentifierValue = true; - result.identifierValue_ = value; - return this; - } - public Builder ClearIdentifierValue() { - result.hasIdentifierValue = false; - result.identifierValue_ = ""; - return this; - } - - public bool HasPositiveIntValue { - get { return result.HasPositiveIntValue; } - } - [global::System.CLSCompliant(false)] - public ulong PositiveIntValue { - get { return result.PositiveIntValue; } - set { SetPositiveIntValue(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetPositiveIntValue(ulong value) { - result.hasPositiveIntValue = true; - result.positiveIntValue_ = value; - return this; - } - public Builder ClearPositiveIntValue() { - result.hasPositiveIntValue = false; - result.positiveIntValue_ = 0UL; - return this; - } - - public bool HasNegativeIntValue { - get { return result.HasNegativeIntValue; } - } - public long NegativeIntValue { - get { return result.NegativeIntValue; } - set { SetNegativeIntValue(value); } - } - public Builder SetNegativeIntValue(long value) { - result.hasNegativeIntValue = true; - result.negativeIntValue_ = value; - return this; - } - public Builder ClearNegativeIntValue() { - result.hasNegativeIntValue = false; - result.negativeIntValue_ = 0L; - return this; - } - - public bool HasDoubleValue { - get { return result.HasDoubleValue; } - } - public double DoubleValue { - get { return result.DoubleValue; } - set { SetDoubleValue(value); } - } - public Builder SetDoubleValue(double value) { - result.hasDoubleValue = true; - result.doubleValue_ = value; - return this; - } - public Builder ClearDoubleValue() { - result.hasDoubleValue = false; - result.doubleValue_ = 0D; - return this; - } - - public bool HasStringValue { - get { return result.HasStringValue; } - } - public pb::ByteString StringValue { - get { return result.StringValue; } - set { SetStringValue(value); } - } - public Builder SetStringValue(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasStringValue = true; - result.stringValue_ = value; - return this; - } - public Builder ClearStringValue() { - result.hasStringValue = false; - result.stringValue_ = pb::ByteString.Empty; - return this; - } - } - static UninterpretedOption() { - object.ReferenceEquals(global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, null); - } - } - - #endregion - -} diff --git a/source/D3Proto/bnet/protocol/Descriptor.cs b/source/D3Proto/bnet/protocol/Descriptor.cs deleted file mode 100644 index 63a385df..00000000 --- a/source/D3Proto/bnet/protocol/Descriptor.cs +++ /dev/null @@ -1,280 +0,0 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace bnet.protocol { - - public static partial class Descriptor { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_bnet_protocol_Path__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_Path__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor_ { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static Descriptor() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "Ch1saWIvcHJvdG9jb2wvZGVzY3JpcHRvci5wcm90bxINYm5ldC5wcm90b2Nv" + - "bCIXCgRQYXRoEg8KB29yZGluYWwYASADKA0="); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_bnet_protocol_Path__Descriptor = Descriptor_.MessageTypes[0]; - internal__static_bnet_protocol_Path__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_Path__Descriptor, - new string[] { "Ordinal", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - }, assigner); - } - #endregion - - } - #region Messages - public sealed partial class Path : pb::GeneratedMessage { - private static readonly Path defaultInstance = new Builder().BuildPartial(); - public static Path DefaultInstance { - get { return defaultInstance; } - } - - public override Path DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override Path ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.Descriptor.internal__static_bnet_protocol_Path__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.Descriptor.internal__static_bnet_protocol_Path__FieldAccessorTable; } - } - - public const int OrdinalFieldNumber = 1; - private pbc::PopsicleList ordinal_ = new pbc::PopsicleList(); - public scg::IList OrdinalList { - get { return pbc::Lists.AsReadOnly(ordinal_); } - } - public int OrdinalCount { - get { return ordinal_.Count; } - } - public uint GetOrdinal(int index) { - return ordinal_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (ordinal_.Count > 0) { - foreach (uint element in ordinal_) { - output.WriteUInt32(1, element); - } - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - foreach (uint element in OrdinalList) { - dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); - } - size += dataSize; - size += 1 * ordinal_.Count; - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static Path ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Path ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Path ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Path ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Path ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Path ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Path ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Path ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Path ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Path ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Path prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - Path result = new Path(); - - protected override Path MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new Path(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.Path.Descriptor; } - } - - public override Path DefaultInstanceForType { - get { return global::bnet.protocol.Path.DefaultInstance; } - } - - public override Path BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.ordinal_.MakeReadOnly(); - Path returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Path) { - return MergeFrom((Path) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Path other) { - if (other == global::bnet.protocol.Path.DefaultInstance) return this; - if (other.ordinal_.Count != 0) { - base.AddRange(other.ordinal_, result.ordinal_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - AddOrdinal(input.ReadUInt32()); - break; - } - } - } - } - - - public pbc::IPopsicleList OrdinalList { - get { return result.ordinal_; } - } - public int OrdinalCount { - get { return result.OrdinalCount; } - } - public uint GetOrdinal(int index) { - return result.GetOrdinal(index); - } - public Builder SetOrdinal(int index, uint value) { - result.ordinal_[index] = value; - return this; - } - public Builder AddOrdinal(uint value) { - result.ordinal_.Add(value); - return this; - } - public Builder AddRangeOrdinal(scg::IEnumerable values) { - base.AddRange(values, result.ordinal_); - return this; - } - public Builder ClearOrdinal() { - result.ordinal_.Clear(); - return this; - } - } - static Path() { - object.ReferenceEquals(global::bnet.protocol.Descriptor.Descriptor_, null); - } - } - - #endregion - -} diff --git a/source/D3Proto/bnet/protocol/Entity.cs b/source/D3Proto/bnet/protocol/Entity.cs deleted file mode 100644 index 0df27b16..00000000 --- a/source/D3Proto/bnet/protocol/Entity.cs +++ /dev/null @@ -1,690 +0,0 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace bnet.protocol { - - public static partial class Entity { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_bnet_protocol_EntityId__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_EntityId__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_Identity__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_Identity__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static Entity() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "ChlsaWIvcHJvdG9jb2wvZW50aXR5LnByb3RvEg1ibmV0LnByb3RvY29sIiUK" + - "CEVudGl0eUlkEgwKBGhpZ2gYASACKAYSCwoDbG93GAIgAigGIpMBCghJZGVu" + - "dGl0eRIrCgphY2NvdW50X2lkGAEgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRp" + - "dHlJZBIwCg9nYW1lX2FjY291bnRfaWQYAiABKAsyFy5ibmV0LnByb3RvY29s" + - "LkVudGl0eUlkEigKB3Rvb25faWQYAyABKAsyFy5ibmV0LnByb3RvY29sLkVu" + - "dGl0eUlk"); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_bnet_protocol_EntityId__Descriptor = Descriptor.MessageTypes[0]; - internal__static_bnet_protocol_EntityId__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_EntityId__Descriptor, - new string[] { "High", "Low", }); - internal__static_bnet_protocol_Identity__Descriptor = Descriptor.MessageTypes[1]; - internal__static_bnet_protocol_Identity__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_Identity__Descriptor, - new string[] { "AccountId", "GameAccountId", "ToonId", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - }, assigner); - } - #endregion - - } - #region Messages - public sealed partial class EntityId : pb::GeneratedMessage { - private static readonly EntityId defaultInstance = new Builder().BuildPartial(); - public static EntityId DefaultInstance { - get { return defaultInstance; } - } - - public override EntityId DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override EntityId ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.Entity.internal__static_bnet_protocol_EntityId__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.Entity.internal__static_bnet_protocol_EntityId__FieldAccessorTable; } - } - - public const int HighFieldNumber = 1; - private bool hasHigh; - private ulong high_ = 0; - public bool HasHigh { - get { return hasHigh; } - } - public ulong High { - get { return high_; } - } - - public const int LowFieldNumber = 2; - private bool hasLow; - private ulong low_ = 0; - public bool HasLow { - get { return hasLow; } - } - public ulong Low { - get { return low_; } - } - - public override bool IsInitialized { - get { - if (!hasHigh) return false; - if (!hasLow) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasHigh) { - output.WriteFixed64(1, High); - } - if (HasLow) { - output.WriteFixed64(2, Low); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasHigh) { - size += pb::CodedOutputStream.ComputeFixed64Size(1, High); - } - if (HasLow) { - size += pb::CodedOutputStream.ComputeFixed64Size(2, Low); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static EntityId ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static EntityId ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static EntityId ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static EntityId ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static EntityId ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static EntityId ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static EntityId ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static EntityId ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static EntityId ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static EntityId ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(EntityId prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - EntityId result = new EntityId(); - - protected override EntityId MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new EntityId(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.EntityId.Descriptor; } - } - - public override EntityId DefaultInstanceForType { - get { return global::bnet.protocol.EntityId.DefaultInstance; } - } - - public override EntityId BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - EntityId returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is EntityId) { - return MergeFrom((EntityId) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(EntityId other) { - if (other == global::bnet.protocol.EntityId.DefaultInstance) return this; - if (other.HasHigh) { - High = other.High; - } - if (other.HasLow) { - Low = other.Low; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 9: { - High = input.ReadFixed64(); - break; - } - case 17: { - Low = input.ReadFixed64(); - break; - } - } - } - } - - - public bool HasHigh { - get { return result.HasHigh; } - } - public ulong High { - get { return result.High; } - set { SetHigh(value); } - } - public Builder SetHigh(ulong value) { - result.hasHigh = true; - result.high_ = value; - return this; - } - public Builder ClearHigh() { - result.hasHigh = false; - result.high_ = 0; - return this; - } - - public bool HasLow { - get { return result.HasLow; } - } - public ulong Low { - get { return result.Low; } - set { SetLow(value); } - } - public Builder SetLow(ulong value) { - result.hasLow = true; - result.low_ = value; - return this; - } - public Builder ClearLow() { - result.hasLow = false; - result.low_ = 0; - return this; - } - } - static EntityId() { - object.ReferenceEquals(global::bnet.protocol.Entity.Descriptor, null); - } - } - - public sealed partial class Identity : pb::GeneratedMessage { - private static readonly Identity defaultInstance = new Builder().BuildPartial(); - public static Identity DefaultInstance { - get { return defaultInstance; } - } - - public override Identity DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override Identity ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.Entity.internal__static_bnet_protocol_Identity__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.Entity.internal__static_bnet_protocol_Identity__FieldAccessorTable; } - } - - public const int AccountIdFieldNumber = 1; - private bool hasAccountId; - private global::bnet.protocol.EntityId accountId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasAccountId { - get { return hasAccountId; } - } - public global::bnet.protocol.EntityId AccountId { - get { return accountId_; } - } - - public const int GameAccountIdFieldNumber = 2; - private bool hasGameAccountId; - private global::bnet.protocol.EntityId gameAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasGameAccountId { - get { return hasGameAccountId; } - } - public global::bnet.protocol.EntityId GameAccountId { - get { return gameAccountId_; } - } - - public const int ToonIdFieldNumber = 3; - private bool hasToonId; - private global::bnet.protocol.EntityId toonId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasToonId { - get { return hasToonId; } - } - public global::bnet.protocol.EntityId ToonId { - get { return toonId_; } - } - - public override bool IsInitialized { - get { - if (HasAccountId) { - if (!AccountId.IsInitialized) return false; - } - if (HasGameAccountId) { - if (!GameAccountId.IsInitialized) return false; - } - if (HasToonId) { - if (!ToonId.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasAccountId) { - output.WriteMessage(1, AccountId); - } - if (HasGameAccountId) { - output.WriteMessage(2, GameAccountId); - } - if (HasToonId) { - output.WriteMessage(3, ToonId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasAccountId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, AccountId); - } - if (HasGameAccountId) { - size += pb::CodedOutputStream.ComputeMessageSize(2, GameAccountId); - } - if (HasToonId) { - size += pb::CodedOutputStream.ComputeMessageSize(3, ToonId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static Identity ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Identity ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Identity ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Identity ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Identity ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Identity ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Identity ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Identity ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Identity ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Identity ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Identity prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - Identity result = new Identity(); - - protected override Identity MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new Identity(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.Identity.Descriptor; } - } - - public override Identity DefaultInstanceForType { - get { return global::bnet.protocol.Identity.DefaultInstance; } - } - - public override Identity BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - Identity returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Identity) { - return MergeFrom((Identity) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Identity other) { - if (other == global::bnet.protocol.Identity.DefaultInstance) return this; - if (other.HasAccountId) { - MergeAccountId(other.AccountId); - } - if (other.HasGameAccountId) { - MergeGameAccountId(other.GameAccountId); - } - if (other.HasToonId) { - MergeToonId(other.ToonId); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAccountId) { - subBuilder.MergeFrom(AccountId); - } - input.ReadMessage(subBuilder, extensionRegistry); - AccountId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasGameAccountId) { - subBuilder.MergeFrom(GameAccountId); - } - input.ReadMessage(subBuilder, extensionRegistry); - GameAccountId = subBuilder.BuildPartial(); - break; - } - case 26: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasToonId) { - subBuilder.MergeFrom(ToonId); - } - input.ReadMessage(subBuilder, extensionRegistry); - ToonId = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasAccountId { - get { return result.HasAccountId; } - } - public global::bnet.protocol.EntityId AccountId { - get { return result.AccountId; } - set { SetAccountId(value); } - } - public Builder SetAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasAccountId = true; - result.accountId_ = value; - return this; - } - public Builder SetAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasAccountId = true; - result.accountId_ = builderForValue.Build(); - return this; - } - public Builder MergeAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAccountId && - result.accountId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.accountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.accountId_).MergeFrom(value).BuildPartial(); - } else { - result.accountId_ = value; - } - result.hasAccountId = true; - return this; - } - public Builder ClearAccountId() { - result.hasAccountId = false; - result.accountId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasGameAccountId { - get { return result.HasGameAccountId; } - } - public global::bnet.protocol.EntityId GameAccountId { - get { return result.GameAccountId; } - set { SetGameAccountId(value); } - } - public Builder SetGameAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasGameAccountId = true; - result.gameAccountId_ = value; - return this; - } - public Builder SetGameAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasGameAccountId = true; - result.gameAccountId_ = builderForValue.Build(); - return this; - } - public Builder MergeGameAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasGameAccountId && - result.gameAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.gameAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccountId_).MergeFrom(value).BuildPartial(); - } else { - result.gameAccountId_ = value; - } - result.hasGameAccountId = true; - return this; - } - public Builder ClearGameAccountId() { - result.hasGameAccountId = false; - result.gameAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasToonId { - get { return result.HasToonId; } - } - public global::bnet.protocol.EntityId ToonId { - get { return result.ToonId; } - set { SetToonId(value); } - } - public Builder SetToonId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasToonId = true; - result.toonId_ = value; - return this; - } - public Builder SetToonId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasToonId = true; - result.toonId_ = builderForValue.Build(); - return this; - } - public Builder MergeToonId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasToonId && - result.toonId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.toonId_ = global::bnet.protocol.EntityId.CreateBuilder(result.toonId_).MergeFrom(value).BuildPartial(); - } else { - result.toonId_ = value; - } - result.hasToonId = true; - return this; - } - public Builder ClearToonId() { - result.hasToonId = false; - result.toonId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - } - static Identity() { - object.ReferenceEquals(global::bnet.protocol.Entity.Descriptor, null); - } - } - - #endregion - -} diff --git a/source/D3Proto/bnet/protocol/Rpc.cs b/source/D3Proto/bnet/protocol/Rpc.cs deleted file mode 100644 index 0d326c82..00000000 --- a/source/D3Proto/bnet/protocol/Rpc.cs +++ /dev/null @@ -1,1308 +0,0 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace bnet.protocol { - - public static partial class Rpc { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - registry.Add(global::bnet.protocol.Rpc.MethodId); - registry.Add(global::bnet.protocol.Rpc.Cost); - registry.Add(global::bnet.protocol.Rpc.Timeout); - } - #endregion - #region Extensions - public const int MethodIdFieldNumber = 50000; - public static pb::GeneratedExtensionBase MethodId; - public const int CostFieldNumber = 50001; - public static pb::GeneratedExtensionBase Cost; - public const int TimeoutFieldNumber = 50002; - public static pb::GeneratedExtensionBase Timeout; - #endregion - - #region Static variables - internal static pbd::MessageDescriptor internal__static_bnet_protocol_NO_RESPONSE__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_NO_RESPONSE__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_Address__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_Address__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_ProcessId__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_ProcessId__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_ObjectAddress__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_ObjectAddress__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_NoData__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_NoData__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static Rpc() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "ChFsaWIvcnBjL3JwYy5wcm90bxINYm5ldC5wcm90b2NvbBogZ29vZ2xlL3By" + - "b3RvYnVmL2Rlc2NyaXB0b3IucHJvdG8iDQoLTk9fUkVTUE9OU0UiTgoHQWRk" + - "cmVzcxIPCgdhZGRyZXNzGAEgAigJEgwKBHBvcnQYAiABKA0SJAoEbmV4dBgD" + - "IAEoCzIWLmJuZXQucHJvdG9jb2wuQWRkcmVzcyIpCglQcm9jZXNzSWQSDQoF" + - "bGFiZWwYASACKA0SDQoFZXBvY2gYAiACKA0iSgoNT2JqZWN0QWRkcmVzcxIm" + - "CgRob3N0GAEgAigLMhguYm5ldC5wcm90b2NvbC5Qcm9jZXNzSWQSEQoJb2Jq" + - "ZWN0X2lkGAIgAigEIggKBk5vRGF0YTozCgltZXRob2RfaWQSHi5nb29nbGUu" + - "cHJvdG9idWYuTWV0aG9kT3B0aW9ucxjQhgMgASgNOi4KBGNvc3QSHi5nb29n" + - "bGUucHJvdG9idWYuTWV0aG9kT3B0aW9ucxjRhgMgASgNOjEKB3RpbWVvdXQS" + - "Hi5nb29nbGUucHJvdG9idWYuTWV0aG9kT3B0aW9ucxjShgMgASgC"); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_bnet_protocol_NO_RESPONSE__Descriptor = Descriptor.MessageTypes[0]; - internal__static_bnet_protocol_NO_RESPONSE__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_NO_RESPONSE__Descriptor, - new string[] { }); - internal__static_bnet_protocol_Address__Descriptor = Descriptor.MessageTypes[1]; - internal__static_bnet_protocol_Address__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_Address__Descriptor, - new string[] { "Address_", "Port", "Next", }); - internal__static_bnet_protocol_ProcessId__Descriptor = Descriptor.MessageTypes[2]; - internal__static_bnet_protocol_ProcessId__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_ProcessId__Descriptor, - new string[] { "Label", "Epoch", }); - internal__static_bnet_protocol_ObjectAddress__Descriptor = Descriptor.MessageTypes[3]; - internal__static_bnet_protocol_ObjectAddress__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_ObjectAddress__Descriptor, - new string[] { "Host", "ObjectId", }); - internal__static_bnet_protocol_NoData__Descriptor = Descriptor.MessageTypes[4]; - internal__static_bnet_protocol_NoData__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_NoData__Descriptor, - new string[] { }); - global::bnet.protocol.Rpc.MethodId = pb::GeneratedSingleExtension.CreateInstance(global::bnet.protocol.Rpc.Descriptor.Extensions[0]); - global::bnet.protocol.Rpc.Cost = pb::GeneratedSingleExtension.CreateInstance(global::bnet.protocol.Rpc.Descriptor.Extensions[1]); - global::bnet.protocol.Rpc.Timeout = pb::GeneratedSingleExtension.CreateInstance(global::bnet.protocol.Rpc.Descriptor.Extensions[2]); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, - }, assigner); - } - #endregion - - } - #region Messages - public sealed partial class NO_RESPONSE : pb::GeneratedMessage { - private static readonly NO_RESPONSE defaultInstance = new Builder().BuildPartial(); - public static NO_RESPONSE DefaultInstance { - get { return defaultInstance; } - } - - public override NO_RESPONSE DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override NO_RESPONSE ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.Rpc.internal__static_bnet_protocol_NO_RESPONSE__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.Rpc.internal__static_bnet_protocol_NO_RESPONSE__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static NO_RESPONSE ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NO_RESPONSE ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NO_RESPONSE ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NO_RESPONSE ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NO_RESPONSE ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NO_RESPONSE ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static NO_RESPONSE ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static NO_RESPONSE ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static NO_RESPONSE ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NO_RESPONSE ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(NO_RESPONSE prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - NO_RESPONSE result = new NO_RESPONSE(); - - protected override NO_RESPONSE MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new NO_RESPONSE(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.NO_RESPONSE.Descriptor; } - } - - public override NO_RESPONSE DefaultInstanceForType { - get { return global::bnet.protocol.NO_RESPONSE.DefaultInstance; } - } - - public override NO_RESPONSE BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - NO_RESPONSE returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is NO_RESPONSE) { - return MergeFrom((NO_RESPONSE) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(NO_RESPONSE other) { - if (other == global::bnet.protocol.NO_RESPONSE.DefaultInstance) return this; - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - } - } - } - - } - static NO_RESPONSE() { - object.ReferenceEquals(global::bnet.protocol.Rpc.Descriptor, null); - } - } - - public sealed partial class Address : pb::GeneratedMessage { - private static readonly Address defaultInstance = new Builder().BuildPartial(); - public static Address DefaultInstance { - get { return defaultInstance; } - } - - public override Address DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override Address ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.Rpc.internal__static_bnet_protocol_Address__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.Rpc.internal__static_bnet_protocol_Address__FieldAccessorTable; } - } - - public const int Address_FieldNumber = 1; - private bool hasAddress_; - private string address_ = ""; - public bool HasAddress_ { - get { return hasAddress_; } - } - public string Address_ { - get { return address_; } - } - - public const int PortFieldNumber = 2; - private bool hasPort; - private uint port_ = 0; - public bool HasPort { - get { return hasPort; } - } - public uint Port { - get { return port_; } - } - - public const int NextFieldNumber = 3; - private bool hasNext; - private global::bnet.protocol.Address next_ = global::bnet.protocol.Address.DefaultInstance; - public bool HasNext { - get { return hasNext; } - } - public global::bnet.protocol.Address Next { - get { return next_; } - } - - public override bool IsInitialized { - get { - if (!hasAddress_) return false; - if (HasNext) { - if (!Next.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasAddress_) { - output.WriteString(1, Address_); - } - if (HasPort) { - output.WriteUInt32(2, Port); - } - if (HasNext) { - output.WriteMessage(3, Next); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasAddress_) { - size += pb::CodedOutputStream.ComputeStringSize(1, Address_); - } - if (HasPort) { - size += pb::CodedOutputStream.ComputeUInt32Size(2, Port); - } - if (HasNext) { - size += pb::CodedOutputStream.ComputeMessageSize(3, Next); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static Address ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Address ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Address ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Address ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Address ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Address ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Address ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Address ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Address ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Address ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Address prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - Address result = new Address(); - - protected override Address MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new Address(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.Address.Descriptor; } - } - - public override Address DefaultInstanceForType { - get { return global::bnet.protocol.Address.DefaultInstance; } - } - - public override Address BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - Address returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Address) { - return MergeFrom((Address) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Address other) { - if (other == global::bnet.protocol.Address.DefaultInstance) return this; - if (other.HasAddress_) { - Address_ = other.Address_; - } - if (other.HasPort) { - Port = other.Port; - } - if (other.HasNext) { - MergeNext(other.Next); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - Address_ = input.ReadString(); - break; - } - case 16: { - Port = input.ReadUInt32(); - break; - } - case 26: { - global::bnet.protocol.Address.Builder subBuilder = global::bnet.protocol.Address.CreateBuilder(); - if (HasNext) { - subBuilder.MergeFrom(Next); - } - input.ReadMessage(subBuilder, extensionRegistry); - Next = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasAddress_ { - get { return result.HasAddress_; } - } - public string Address_ { - get { return result.Address_; } - set { SetAddress_(value); } - } - public Builder SetAddress_(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasAddress_ = true; - result.address_ = value; - return this; - } - public Builder ClearAddress_() { - result.hasAddress_ = false; - result.address_ = ""; - return this; - } - - public bool HasPort { - get { return result.HasPort; } - } - public uint Port { - get { return result.Port; } - set { SetPort(value); } - } - public Builder SetPort(uint value) { - result.hasPort = true; - result.port_ = value; - return this; - } - public Builder ClearPort() { - result.hasPort = false; - result.port_ = 0; - return this; - } - - public bool HasNext { - get { return result.HasNext; } - } - public global::bnet.protocol.Address Next { - get { return result.Next; } - set { SetNext(value); } - } - public Builder SetNext(global::bnet.protocol.Address value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasNext = true; - result.next_ = value; - return this; - } - public Builder SetNext(global::bnet.protocol.Address.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasNext = true; - result.next_ = builderForValue.Build(); - return this; - } - public Builder MergeNext(global::bnet.protocol.Address value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasNext && - result.next_ != global::bnet.protocol.Address.DefaultInstance) { - result.next_ = global::bnet.protocol.Address.CreateBuilder(result.next_).MergeFrom(value).BuildPartial(); - } else { - result.next_ = value; - } - result.hasNext = true; - return this; - } - public Builder ClearNext() { - result.hasNext = false; - result.next_ = global::bnet.protocol.Address.DefaultInstance; - return this; - } - } - static Address() { - object.ReferenceEquals(global::bnet.protocol.Rpc.Descriptor, null); - } - } - - public sealed partial class ProcessId : pb::GeneratedMessage { - private static readonly ProcessId defaultInstance = new Builder().BuildPartial(); - public static ProcessId DefaultInstance { - get { return defaultInstance; } - } - - public override ProcessId DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ProcessId ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.Rpc.internal__static_bnet_protocol_ProcessId__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.Rpc.internal__static_bnet_protocol_ProcessId__FieldAccessorTable; } - } - - public const int LabelFieldNumber = 1; - private bool hasLabel; - private uint label_ = 0; - public bool HasLabel { - get { return hasLabel; } - } - public uint Label { - get { return label_; } - } - - public const int EpochFieldNumber = 2; - private bool hasEpoch; - private uint epoch_ = 0; - public bool HasEpoch { - get { return hasEpoch; } - } - public uint Epoch { - get { return epoch_; } - } - - public override bool IsInitialized { - get { - if (!hasLabel) return false; - if (!hasEpoch) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasLabel) { - output.WriteUInt32(1, Label); - } - if (HasEpoch) { - output.WriteUInt32(2, Epoch); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasLabel) { - size += pb::CodedOutputStream.ComputeUInt32Size(1, Label); - } - if (HasEpoch) { - size += pb::CodedOutputStream.ComputeUInt32Size(2, Epoch); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ProcessId ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ProcessId ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ProcessId ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ProcessId ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ProcessId ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ProcessId ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ProcessId ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ProcessId ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ProcessId ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ProcessId ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ProcessId prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ProcessId result = new ProcessId(); - - protected override ProcessId MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ProcessId(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.ProcessId.Descriptor; } - } - - public override ProcessId DefaultInstanceForType { - get { return global::bnet.protocol.ProcessId.DefaultInstance; } - } - - public override ProcessId BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - ProcessId returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ProcessId) { - return MergeFrom((ProcessId) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ProcessId other) { - if (other == global::bnet.protocol.ProcessId.DefaultInstance) return this; - if (other.HasLabel) { - Label = other.Label; - } - if (other.HasEpoch) { - Epoch = other.Epoch; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - Label = input.ReadUInt32(); - break; - } - case 16: { - Epoch = input.ReadUInt32(); - break; - } - } - } - } - - - public bool HasLabel { - get { return result.HasLabel; } - } - public uint Label { - get { return result.Label; } - set { SetLabel(value); } - } - public Builder SetLabel(uint value) { - result.hasLabel = true; - result.label_ = value; - return this; - } - public Builder ClearLabel() { - result.hasLabel = false; - result.label_ = 0; - return this; - } - - public bool HasEpoch { - get { return result.HasEpoch; } - } - public uint Epoch { - get { return result.Epoch; } - set { SetEpoch(value); } - } - public Builder SetEpoch(uint value) { - result.hasEpoch = true; - result.epoch_ = value; - return this; - } - public Builder ClearEpoch() { - result.hasEpoch = false; - result.epoch_ = 0; - return this; - } - } - static ProcessId() { - object.ReferenceEquals(global::bnet.protocol.Rpc.Descriptor, null); - } - } - - public sealed partial class ObjectAddress : pb::GeneratedMessage { - private static readonly ObjectAddress defaultInstance = new Builder().BuildPartial(); - public static ObjectAddress DefaultInstance { - get { return defaultInstance; } - } - - public override ObjectAddress DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ObjectAddress ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.Rpc.internal__static_bnet_protocol_ObjectAddress__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.Rpc.internal__static_bnet_protocol_ObjectAddress__FieldAccessorTable; } - } - - public const int HostFieldNumber = 1; - private bool hasHost; - private global::bnet.protocol.ProcessId host_ = global::bnet.protocol.ProcessId.DefaultInstance; - public bool HasHost { - get { return hasHost; } - } - public global::bnet.protocol.ProcessId Host { - get { return host_; } - } - - public const int ObjectIdFieldNumber = 2; - private bool hasObjectId; - private ulong objectId_ = 0UL; - public bool HasObjectId { - get { return hasObjectId; } - } - public ulong ObjectId { - get { return objectId_; } - } - - public override bool IsInitialized { - get { - if (!hasHost) return false; - if (!hasObjectId) return false; - if (!Host.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasHost) { - output.WriteMessage(1, Host); - } - if (HasObjectId) { - output.WriteUInt64(2, ObjectId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasHost) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Host); - } - if (HasObjectId) { - size += pb::CodedOutputStream.ComputeUInt64Size(2, ObjectId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ObjectAddress ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ObjectAddress ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ObjectAddress ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ObjectAddress ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ObjectAddress ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ObjectAddress ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ObjectAddress ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ObjectAddress ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ObjectAddress ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ObjectAddress ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ObjectAddress prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ObjectAddress result = new ObjectAddress(); - - protected override ObjectAddress MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ObjectAddress(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.ObjectAddress.Descriptor; } - } - - public override ObjectAddress DefaultInstanceForType { - get { return global::bnet.protocol.ObjectAddress.DefaultInstance; } - } - - public override ObjectAddress BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - ObjectAddress returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ObjectAddress) { - return MergeFrom((ObjectAddress) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ObjectAddress other) { - if (other == global::bnet.protocol.ObjectAddress.DefaultInstance) return this; - if (other.HasHost) { - MergeHost(other.Host); - } - if (other.HasObjectId) { - ObjectId = other.ObjectId; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.ProcessId.Builder subBuilder = global::bnet.protocol.ProcessId.CreateBuilder(); - if (HasHost) { - subBuilder.MergeFrom(Host); - } - input.ReadMessage(subBuilder, extensionRegistry); - Host = subBuilder.BuildPartial(); - break; - } - case 16: { - ObjectId = input.ReadUInt64(); - break; - } - } - } - } - - - public bool HasHost { - get { return result.HasHost; } - } - public global::bnet.protocol.ProcessId Host { - get { return result.Host; } - set { SetHost(value); } - } - public Builder SetHost(global::bnet.protocol.ProcessId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasHost = true; - result.host_ = value; - return this; - } - public Builder SetHost(global::bnet.protocol.ProcessId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasHost = true; - result.host_ = builderForValue.Build(); - return this; - } - public Builder MergeHost(global::bnet.protocol.ProcessId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasHost && - result.host_ != global::bnet.protocol.ProcessId.DefaultInstance) { - result.host_ = global::bnet.protocol.ProcessId.CreateBuilder(result.host_).MergeFrom(value).BuildPartial(); - } else { - result.host_ = value; - } - result.hasHost = true; - return this; - } - public Builder ClearHost() { - result.hasHost = false; - result.host_ = global::bnet.protocol.ProcessId.DefaultInstance; - return this; - } - - public bool HasObjectId { - get { return result.HasObjectId; } - } - public ulong ObjectId { - get { return result.ObjectId; } - set { SetObjectId(value); } - } - public Builder SetObjectId(ulong value) { - result.hasObjectId = true; - result.objectId_ = value; - return this; - } - public Builder ClearObjectId() { - result.hasObjectId = false; - result.objectId_ = 0UL; - return this; - } - } - static ObjectAddress() { - object.ReferenceEquals(global::bnet.protocol.Rpc.Descriptor, null); - } - } - - public sealed partial class NoData : pb::GeneratedMessage { - private static readonly NoData defaultInstance = new Builder().BuildPartial(); - public static NoData DefaultInstance { - get { return defaultInstance; } - } - - public override NoData DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override NoData ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.Rpc.internal__static_bnet_protocol_NoData__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.Rpc.internal__static_bnet_protocol_NoData__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static NoData ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NoData ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NoData ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NoData ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NoData ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NoData ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static NoData ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static NoData ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static NoData ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NoData ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(NoData prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - NoData result = new NoData(); - - protected override NoData MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new NoData(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.NoData.Descriptor; } - } - - public override NoData DefaultInstanceForType { - get { return global::bnet.protocol.NoData.DefaultInstance; } - } - - public override NoData BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - NoData returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is NoData) { - return MergeFrom((NoData) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(NoData other) { - if (other == global::bnet.protocol.NoData.DefaultInstance) return this; - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - } - } - } - - } - static NoData() { - object.ReferenceEquals(global::bnet.protocol.Rpc.Descriptor, null); - } - } - - #endregion - -} diff --git a/source/D3Proto/bnet/protocol/authentication/Authentication.cs b/source/D3Proto/bnet/protocol/authentication/Authentication.cs deleted file mode 100644 index 8122ce71..00000000 --- a/source/D3Proto/bnet/protocol/authentication/Authentication.cs +++ /dev/null @@ -1,3407 +0,0 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace bnet.protocol.authentication { - - public static partial class Authentication { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_bnet_protocol_authentication_ModuleLoadRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_authentication_ModuleLoadRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_authentication_ModuleLoadResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_authentication_ModuleLoadResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_authentication_ModuleMessageRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_authentication_ModuleMessageRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_authentication_LogonRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_authentication_LogonRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_authentication_LogonResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_authentication_LogonResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_authentication_AuthenticationConfig__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_authentication_AuthenticationConfig__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_authentication_AuthModuleVariant__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_authentication_AuthModuleVariant__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_authentication_AuthModuleConfig__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_authentication_AuthModuleConfig__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_authentication_AuthAgreementLocale__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_authentication_AuthAgreementLocale__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_authentication_AuthAgreement__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_authentication_AuthAgreement__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static Authentication() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "CitzZXJ2aWNlL2F1dGhlbnRpY2F0aW9uL2F1dGhlbnRpY2F0aW9uLnByb3Rv" + - "EhxibmV0LnByb3RvY29sLmF1dGhlbnRpY2F0aW9uGhFsaWIvcnBjL3JwYy5w" + - "cm90bxohbGliL3Byb3RvY29sL2NvbnRlbnRfaGFuZGxlLnByb3RvGhlsaWIv" + - "cHJvdG9jb2wvZW50aXR5LnByb3RvGh9saWIvY29uZmlnL3Byb2Nlc3NfY29u" + - "ZmlnLnByb3RvIlkKEU1vZHVsZUxvYWRSZXF1ZXN0EjMKDW1vZHVsZV9oYW5k" + - "bGUYASACKAsyHC5ibmV0LnByb3RvY29sLkNvbnRlbnRIYW5kbGUSDwoHbWVz" + - "c2FnZRgCIAEoDCInChJNb2R1bGVMb2FkUmVzcG9uc2USEQoJbW9kdWxlX2lk" + - "GAIgASgFIjoKFE1vZHVsZU1lc3NhZ2VSZXF1ZXN0EhEKCW1vZHVsZV9pZBgB" + - "IAIoBRIPCgdtZXNzYWdlGAIgASgMInYKDExvZ29uUmVxdWVzdBIPCgdwcm9n" + - "cmFtGAEgASgJEhAKCHBsYXRmb3JtGAIgASgJEg4KBmxvY2FsZRgDIAEoCRIN" + - "CgVlbWFpbBgEIAEoCRITCgtsaXN0ZW5lcl9pZBgFIAEoBBIPCgd2ZXJzaW9u" + - "GAYgASgJImgKDUxvZ29uUmVzcG9uc2USKAoHYWNjb3VudBgBIAIoCzIXLmJu" + - "ZXQucHJvdG9jb2wuRW50aXR5SWQSLQoMZ2FtZV9hY2NvdW50GAIgAigLMhcu" + - "Ym5ldC5wcm90b2NvbC5FbnRpdHlJZCKmAQoUQXV0aGVudGljYXRpb25Db25m" + - "aWcSLgoGbW9kdWxlGAEgAygLMh4uYm5ldC5wcm90b2NvbC5jb25maWcuUmVz" + - "b3VyY2USFQoNYWxsb3dfdmVyc2lvbhgCIAMoCRIUCgxkZW55X3ZlcnNpb24Y" + - "AyADKAkSMQoJYWdyZWVtZW50GAQgAygLMh4uYm5ldC5wcm90b2NvbC5jb25m" + - "aWcuUmVzb3VyY2UiNQoRQXV0aE1vZHVsZVZhcmlhbnQSEAoIcGxhdGZvcm0Y" + - "ASACKAkSDgoGaGFuZGxlGAIgAigJIlQKEEF1dGhNb2R1bGVDb25maWcSQAoH" + - "dmFyaWFudBgBIAMoCzIvLmJuZXQucHJvdG9jb2wuYXV0aGVudGljYXRpb24u" + - "QXV0aE1vZHVsZVZhcmlhbnQiMQoTQXV0aEFncmVlbWVudExvY2FsZRIKCgJp" + - "ZBgBIAIoCRIOCgZoYW5kbGUYAiACKAkigQEKDUF1dGhBZ3JlZW1lbnQSDAoE" + - "dHlwZRgBIAIoCRIPCgdwcm9ncmFtGAIgAigJEg4KBnNjaGVtZRgDIAIoDRJB" + - "CgZsb2NhbGUYBCADKAsyMS5ibmV0LnByb3RvY29sLmF1dGhlbnRpY2F0aW9u" + - "LkF1dGhBZ3JlZW1lbnRMb2NhbGUy4wEKFEF1dGhlbnRpY2F0aW9uQ2xpZW50" + - "Em8KCk1vZHVsZUxvYWQSLy5ibmV0LnByb3RvY29sLmF1dGhlbnRpY2F0aW9u" + - "Lk1vZHVsZUxvYWRSZXF1ZXN0GjAuYm5ldC5wcm90b2NvbC5hdXRoZW50aWNh" + - "dGlvbi5Nb2R1bGVMb2FkUmVzcG9uc2USWgoNTW9kdWxlTWVzc2FnZRIyLmJu" + - "ZXQucHJvdG9jb2wuYXV0aGVudGljYXRpb24uTW9kdWxlTWVzc2FnZVJlcXVl" + - "c3QaFS5ibmV0LnByb3RvY29sLk5vRGF0YTLUAQoUQXV0aGVudGljYXRpb25T" + - "ZXJ2ZXISYAoFTG9nb24SKi5ibmV0LnByb3RvY29sLmF1dGhlbnRpY2F0aW9u" + - "LkxvZ29uUmVxdWVzdBorLmJuZXQucHJvdG9jb2wuYXV0aGVudGljYXRpb24u" + - "TG9nb25SZXNwb25zZRJaCg1Nb2R1bGVNZXNzYWdlEjIuYm5ldC5wcm90b2Nv" + - "bC5hdXRoZW50aWNhdGlvbi5Nb2R1bGVNZXNzYWdlUmVxdWVzdBoVLmJuZXQu" + - "cHJvdG9jb2wuTm9EYXRhQgOAAQE="); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_bnet_protocol_authentication_ModuleLoadRequest__Descriptor = Descriptor.MessageTypes[0]; - internal__static_bnet_protocol_authentication_ModuleLoadRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_authentication_ModuleLoadRequest__Descriptor, - new string[] { "ModuleHandle", "Message", }); - internal__static_bnet_protocol_authentication_ModuleLoadResponse__Descriptor = Descriptor.MessageTypes[1]; - internal__static_bnet_protocol_authentication_ModuleLoadResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_authentication_ModuleLoadResponse__Descriptor, - new string[] { "ModuleId", }); - internal__static_bnet_protocol_authentication_ModuleMessageRequest__Descriptor = Descriptor.MessageTypes[2]; - internal__static_bnet_protocol_authentication_ModuleMessageRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_authentication_ModuleMessageRequest__Descriptor, - new string[] { "ModuleId", "Message", }); - internal__static_bnet_protocol_authentication_LogonRequest__Descriptor = Descriptor.MessageTypes[3]; - internal__static_bnet_protocol_authentication_LogonRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_authentication_LogonRequest__Descriptor, - new string[] { "Program", "Platform", "Locale", "Email", "ListenerId", "Version", }); - internal__static_bnet_protocol_authentication_LogonResponse__Descriptor = Descriptor.MessageTypes[4]; - internal__static_bnet_protocol_authentication_LogonResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_authentication_LogonResponse__Descriptor, - new string[] { "Account", "GameAccount", }); - internal__static_bnet_protocol_authentication_AuthenticationConfig__Descriptor = Descriptor.MessageTypes[5]; - internal__static_bnet_protocol_authentication_AuthenticationConfig__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_authentication_AuthenticationConfig__Descriptor, - new string[] { "Module", "AllowVersion", "DenyVersion", "Agreement", }); - internal__static_bnet_protocol_authentication_AuthModuleVariant__Descriptor = Descriptor.MessageTypes[6]; - internal__static_bnet_protocol_authentication_AuthModuleVariant__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_authentication_AuthModuleVariant__Descriptor, - new string[] { "Platform", "Handle", }); - internal__static_bnet_protocol_authentication_AuthModuleConfig__Descriptor = Descriptor.MessageTypes[7]; - internal__static_bnet_protocol_authentication_AuthModuleConfig__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_authentication_AuthModuleConfig__Descriptor, - new string[] { "Variant", }); - internal__static_bnet_protocol_authentication_AuthAgreementLocale__Descriptor = Descriptor.MessageTypes[8]; - internal__static_bnet_protocol_authentication_AuthAgreementLocale__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_authentication_AuthAgreementLocale__Descriptor, - new string[] { "Id", "Handle", }); - internal__static_bnet_protocol_authentication_AuthAgreement__Descriptor = Descriptor.MessageTypes[9]; - internal__static_bnet_protocol_authentication_AuthAgreement__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_authentication_AuthAgreement__Descriptor, - new string[] { "Type", "Program", "Scheme", "Locale", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::bnet.protocol.Rpc.Descriptor, - global::bnet.protocol.Proto.ContentHandle.Descriptor, - global::bnet.protocol.Entity.Descriptor, - global::bnet.protocol.config.Proto.ProcessConfig.Descriptor, - }, assigner); - } - #endregion - - } - #region Messages - public sealed partial class ModuleLoadRequest : pb::GeneratedMessage { - private static readonly ModuleLoadRequest defaultInstance = new Builder().BuildPartial(); - public static ModuleLoadRequest DefaultInstance { - get { return defaultInstance; } - } - - public override ModuleLoadRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ModuleLoadRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.authentication.Authentication.internal__static_bnet_protocol_authentication_ModuleLoadRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.authentication.Authentication.internal__static_bnet_protocol_authentication_ModuleLoadRequest__FieldAccessorTable; } - } - - public const int ModuleHandleFieldNumber = 1; - private bool hasModuleHandle; - private global::bnet.protocol.ContentHandle moduleHandle_ = global::bnet.protocol.ContentHandle.DefaultInstance; - public bool HasModuleHandle { - get { return hasModuleHandle; } - } - public global::bnet.protocol.ContentHandle ModuleHandle { - get { return moduleHandle_; } - } - - public const int MessageFieldNumber = 2; - private bool hasMessage; - private pb::ByteString message_ = pb::ByteString.Empty; - public bool HasMessage { - get { return hasMessage; } - } - public pb::ByteString Message { - get { return message_; } - } - - public override bool IsInitialized { - get { - if (!hasModuleHandle) return false; - if (!ModuleHandle.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasModuleHandle) { - output.WriteMessage(1, ModuleHandle); - } - if (HasMessage) { - output.WriteBytes(2, Message); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasModuleHandle) { - size += pb::CodedOutputStream.ComputeMessageSize(1, ModuleHandle); - } - if (HasMessage) { - size += pb::CodedOutputStream.ComputeBytesSize(2, Message); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ModuleLoadRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ModuleLoadRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ModuleLoadRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ModuleLoadRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ModuleLoadRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ModuleLoadRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ModuleLoadRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ModuleLoadRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ModuleLoadRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ModuleLoadRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ModuleLoadRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ModuleLoadRequest result = new ModuleLoadRequest(); - - protected override ModuleLoadRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ModuleLoadRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.authentication.ModuleLoadRequest.Descriptor; } - } - - public override ModuleLoadRequest DefaultInstanceForType { - get { return global::bnet.protocol.authentication.ModuleLoadRequest.DefaultInstance; } - } - - public override ModuleLoadRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - ModuleLoadRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ModuleLoadRequest) { - return MergeFrom((ModuleLoadRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ModuleLoadRequest other) { - if (other == global::bnet.protocol.authentication.ModuleLoadRequest.DefaultInstance) return this; - if (other.HasModuleHandle) { - MergeModuleHandle(other.ModuleHandle); - } - if (other.HasMessage) { - Message = other.Message; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.ContentHandle.Builder subBuilder = global::bnet.protocol.ContentHandle.CreateBuilder(); - if (HasModuleHandle) { - subBuilder.MergeFrom(ModuleHandle); - } - input.ReadMessage(subBuilder, extensionRegistry); - ModuleHandle = subBuilder.BuildPartial(); - break; - } - case 18: { - Message = input.ReadBytes(); - break; - } - } - } - } - - - public bool HasModuleHandle { - get { return result.HasModuleHandle; } - } - public global::bnet.protocol.ContentHandle ModuleHandle { - get { return result.ModuleHandle; } - set { SetModuleHandle(value); } - } - public Builder SetModuleHandle(global::bnet.protocol.ContentHandle value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasModuleHandle = true; - result.moduleHandle_ = value; - return this; - } - public Builder SetModuleHandle(global::bnet.protocol.ContentHandle.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasModuleHandle = true; - result.moduleHandle_ = builderForValue.Build(); - return this; - } - public Builder MergeModuleHandle(global::bnet.protocol.ContentHandle value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasModuleHandle && - result.moduleHandle_ != global::bnet.protocol.ContentHandle.DefaultInstance) { - result.moduleHandle_ = global::bnet.protocol.ContentHandle.CreateBuilder(result.moduleHandle_).MergeFrom(value).BuildPartial(); - } else { - result.moduleHandle_ = value; - } - result.hasModuleHandle = true; - return this; - } - public Builder ClearModuleHandle() { - result.hasModuleHandle = false; - result.moduleHandle_ = global::bnet.protocol.ContentHandle.DefaultInstance; - return this; - } - - public bool HasMessage { - get { return result.HasMessage; } - } - public pb::ByteString Message { - get { return result.Message; } - set { SetMessage(value); } - } - public Builder SetMessage(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasMessage = true; - result.message_ = value; - return this; - } - public Builder ClearMessage() { - result.hasMessage = false; - result.message_ = pb::ByteString.Empty; - return this; - } - } - static ModuleLoadRequest() { - object.ReferenceEquals(global::bnet.protocol.authentication.Authentication.Descriptor, null); - } - } - - public sealed partial class ModuleLoadResponse : pb::GeneratedMessage { - private static readonly ModuleLoadResponse defaultInstance = new Builder().BuildPartial(); - public static ModuleLoadResponse DefaultInstance { - get { return defaultInstance; } - } - - public override ModuleLoadResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ModuleLoadResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.authentication.Authentication.internal__static_bnet_protocol_authentication_ModuleLoadResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.authentication.Authentication.internal__static_bnet_protocol_authentication_ModuleLoadResponse__FieldAccessorTable; } - } - - public const int ModuleIdFieldNumber = 2; - private bool hasModuleId; - private int moduleId_ = 0; - public bool HasModuleId { - get { return hasModuleId; } - } - public int ModuleId { - get { return moduleId_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasModuleId) { - output.WriteInt32(2, ModuleId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasModuleId) { - size += pb::CodedOutputStream.ComputeInt32Size(2, ModuleId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ModuleLoadResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ModuleLoadResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ModuleLoadResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ModuleLoadResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ModuleLoadResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ModuleLoadResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ModuleLoadResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ModuleLoadResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ModuleLoadResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ModuleLoadResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ModuleLoadResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ModuleLoadResponse result = new ModuleLoadResponse(); - - protected override ModuleLoadResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ModuleLoadResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.authentication.ModuleLoadResponse.Descriptor; } - } - - public override ModuleLoadResponse DefaultInstanceForType { - get { return global::bnet.protocol.authentication.ModuleLoadResponse.DefaultInstance; } - } - - public override ModuleLoadResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - ModuleLoadResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ModuleLoadResponse) { - return MergeFrom((ModuleLoadResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ModuleLoadResponse other) { - if (other == global::bnet.protocol.authentication.ModuleLoadResponse.DefaultInstance) return this; - if (other.HasModuleId) { - ModuleId = other.ModuleId; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 16: { - ModuleId = input.ReadInt32(); - break; - } - } - } - } - - - public bool HasModuleId { - get { return result.HasModuleId; } - } - public int ModuleId { - get { return result.ModuleId; } - set { SetModuleId(value); } - } - public Builder SetModuleId(int value) { - result.hasModuleId = true; - result.moduleId_ = value; - return this; - } - public Builder ClearModuleId() { - result.hasModuleId = false; - result.moduleId_ = 0; - return this; - } - } - static ModuleLoadResponse() { - object.ReferenceEquals(global::bnet.protocol.authentication.Authentication.Descriptor, null); - } - } - - public sealed partial class ModuleMessageRequest : pb::GeneratedMessage { - private static readonly ModuleMessageRequest defaultInstance = new Builder().BuildPartial(); - public static ModuleMessageRequest DefaultInstance { - get { return defaultInstance; } - } - - public override ModuleMessageRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ModuleMessageRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.authentication.Authentication.internal__static_bnet_protocol_authentication_ModuleMessageRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.authentication.Authentication.internal__static_bnet_protocol_authentication_ModuleMessageRequest__FieldAccessorTable; } - } - - public const int ModuleIdFieldNumber = 1; - private bool hasModuleId; - private int moduleId_ = 0; - public bool HasModuleId { - get { return hasModuleId; } - } - public int ModuleId { - get { return moduleId_; } - } - - public const int MessageFieldNumber = 2; - private bool hasMessage; - private pb::ByteString message_ = pb::ByteString.Empty; - public bool HasMessage { - get { return hasMessage; } - } - public pb::ByteString Message { - get { return message_; } - } - - public override bool IsInitialized { - get { - if (!hasModuleId) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasModuleId) { - output.WriteInt32(1, ModuleId); - } - if (HasMessage) { - output.WriteBytes(2, Message); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasModuleId) { - size += pb::CodedOutputStream.ComputeInt32Size(1, ModuleId); - } - if (HasMessage) { - size += pb::CodedOutputStream.ComputeBytesSize(2, Message); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ModuleMessageRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ModuleMessageRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ModuleMessageRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ModuleMessageRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ModuleMessageRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ModuleMessageRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ModuleMessageRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ModuleMessageRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ModuleMessageRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ModuleMessageRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ModuleMessageRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ModuleMessageRequest result = new ModuleMessageRequest(); - - protected override ModuleMessageRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ModuleMessageRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.authentication.ModuleMessageRequest.Descriptor; } - } - - public override ModuleMessageRequest DefaultInstanceForType { - get { return global::bnet.protocol.authentication.ModuleMessageRequest.DefaultInstance; } - } - - public override ModuleMessageRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - ModuleMessageRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ModuleMessageRequest) { - return MergeFrom((ModuleMessageRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ModuleMessageRequest other) { - if (other == global::bnet.protocol.authentication.ModuleMessageRequest.DefaultInstance) return this; - if (other.HasModuleId) { - ModuleId = other.ModuleId; - } - if (other.HasMessage) { - Message = other.Message; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - ModuleId = input.ReadInt32(); - break; - } - case 18: { - Message = input.ReadBytes(); - break; - } - } - } - } - - - public bool HasModuleId { - get { return result.HasModuleId; } - } - public int ModuleId { - get { return result.ModuleId; } - set { SetModuleId(value); } - } - public Builder SetModuleId(int value) { - result.hasModuleId = true; - result.moduleId_ = value; - return this; - } - public Builder ClearModuleId() { - result.hasModuleId = false; - result.moduleId_ = 0; - return this; - } - - public bool HasMessage { - get { return result.HasMessage; } - } - public pb::ByteString Message { - get { return result.Message; } - set { SetMessage(value); } - } - public Builder SetMessage(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasMessage = true; - result.message_ = value; - return this; - } - public Builder ClearMessage() { - result.hasMessage = false; - result.message_ = pb::ByteString.Empty; - return this; - } - } - static ModuleMessageRequest() { - object.ReferenceEquals(global::bnet.protocol.authentication.Authentication.Descriptor, null); - } - } - - public sealed partial class LogonRequest : pb::GeneratedMessage { - private static readonly LogonRequest defaultInstance = new Builder().BuildPartial(); - public static LogonRequest DefaultInstance { - get { return defaultInstance; } - } - - public override LogonRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override LogonRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.authentication.Authentication.internal__static_bnet_protocol_authentication_LogonRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.authentication.Authentication.internal__static_bnet_protocol_authentication_LogonRequest__FieldAccessorTable; } - } - - public const int ProgramFieldNumber = 1; - private bool hasProgram; - private string program_ = ""; - public bool HasProgram { - get { return hasProgram; } - } - public string Program { - get { return program_; } - } - - public const int PlatformFieldNumber = 2; - private bool hasPlatform; - private string platform_ = ""; - public bool HasPlatform { - get { return hasPlatform; } - } - public string Platform { - get { return platform_; } - } - - public const int LocaleFieldNumber = 3; - private bool hasLocale; - private string locale_ = ""; - public bool HasLocale { - get { return hasLocale; } - } - public string Locale { - get { return locale_; } - } - - public const int EmailFieldNumber = 4; - private bool hasEmail; - private string email_ = ""; - public bool HasEmail { - get { return hasEmail; } - } - public string Email { - get { return email_; } - } - - public const int ListenerIdFieldNumber = 5; - private bool hasListenerId; - private ulong listenerId_ = 0UL; - public bool HasListenerId { - get { return hasListenerId; } - } - public ulong ListenerId { - get { return listenerId_; } - } - - public const int VersionFieldNumber = 6; - private bool hasVersion; - private string version_ = ""; - public bool HasVersion { - get { return hasVersion; } - } - public string Version { - get { return version_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasProgram) { - output.WriteString(1, Program); - } - if (HasPlatform) { - output.WriteString(2, Platform); - } - if (HasLocale) { - output.WriteString(3, Locale); - } - if (HasEmail) { - output.WriteString(4, Email); - } - if (HasListenerId) { - output.WriteUInt64(5, ListenerId); - } - if (HasVersion) { - output.WriteString(6, Version); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasProgram) { - size += pb::CodedOutputStream.ComputeStringSize(1, Program); - } - if (HasPlatform) { - size += pb::CodedOutputStream.ComputeStringSize(2, Platform); - } - if (HasLocale) { - size += pb::CodedOutputStream.ComputeStringSize(3, Locale); - } - if (HasEmail) { - size += pb::CodedOutputStream.ComputeStringSize(4, Email); - } - if (HasListenerId) { - size += pb::CodedOutputStream.ComputeUInt64Size(5, ListenerId); - } - if (HasVersion) { - size += pb::CodedOutputStream.ComputeStringSize(6, Version); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static LogonRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static LogonRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static LogonRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static LogonRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static LogonRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static LogonRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static LogonRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static LogonRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static LogonRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static LogonRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(LogonRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - LogonRequest result = new LogonRequest(); - - protected override LogonRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new LogonRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.authentication.LogonRequest.Descriptor; } - } - - public override LogonRequest DefaultInstanceForType { - get { return global::bnet.protocol.authentication.LogonRequest.DefaultInstance; } - } - - public override LogonRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - LogonRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is LogonRequest) { - return MergeFrom((LogonRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(LogonRequest other) { - if (other == global::bnet.protocol.authentication.LogonRequest.DefaultInstance) return this; - if (other.HasProgram) { - Program = other.Program; - } - if (other.HasPlatform) { - Platform = other.Platform; - } - if (other.HasLocale) { - Locale = other.Locale; - } - if (other.HasEmail) { - Email = other.Email; - } - if (other.HasListenerId) { - ListenerId = other.ListenerId; - } - if (other.HasVersion) { - Version = other.Version; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - Program = input.ReadString(); - break; - } - case 18: { - Platform = input.ReadString(); - break; - } - case 26: { - Locale = input.ReadString(); - break; - } - case 34: { - Email = input.ReadString(); - break; - } - case 40: { - ListenerId = input.ReadUInt64(); - break; - } - case 50: { - Version = input.ReadString(); - break; - } - } - } - } - - - public bool HasProgram { - get { return result.HasProgram; } - } - public string Program { - get { return result.Program; } - set { SetProgram(value); } - } - public Builder SetProgram(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasProgram = true; - result.program_ = value; - return this; - } - public Builder ClearProgram() { - result.hasProgram = false; - result.program_ = ""; - return this; - } - - public bool HasPlatform { - get { return result.HasPlatform; } - } - public string Platform { - get { return result.Platform; } - set { SetPlatform(value); } - } - public Builder SetPlatform(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasPlatform = true; - result.platform_ = value; - return this; - } - public Builder ClearPlatform() { - result.hasPlatform = false; - result.platform_ = ""; - return this; - } - - public bool HasLocale { - get { return result.HasLocale; } - } - public string Locale { - get { return result.Locale; } - set { SetLocale(value); } - } - public Builder SetLocale(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasLocale = true; - result.locale_ = value; - return this; - } - public Builder ClearLocale() { - result.hasLocale = false; - result.locale_ = ""; - return this; - } - - public bool HasEmail { - get { return result.HasEmail; } - } - public string Email { - get { return result.Email; } - set { SetEmail(value); } - } - public Builder SetEmail(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasEmail = true; - result.email_ = value; - return this; - } - public Builder ClearEmail() { - result.hasEmail = false; - result.email_ = ""; - return this; - } - - public bool HasListenerId { - get { return result.HasListenerId; } - } - public ulong ListenerId { - get { return result.ListenerId; } - set { SetListenerId(value); } - } - public Builder SetListenerId(ulong value) { - result.hasListenerId = true; - result.listenerId_ = value; - return this; - } - public Builder ClearListenerId() { - result.hasListenerId = false; - result.listenerId_ = 0UL; - return this; - } - - public bool HasVersion { - get { return result.HasVersion; } - } - public string Version { - get { return result.Version; } - set { SetVersion(value); } - } - public Builder SetVersion(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasVersion = true; - result.version_ = value; - return this; - } - public Builder ClearVersion() { - result.hasVersion = false; - result.version_ = ""; - return this; - } - } - static LogonRequest() { - object.ReferenceEquals(global::bnet.protocol.authentication.Authentication.Descriptor, null); - } - } - - public sealed partial class LogonResponse : pb::GeneratedMessage { - private static readonly LogonResponse defaultInstance = new Builder().BuildPartial(); - public static LogonResponse DefaultInstance { - get { return defaultInstance; } - } - - public override LogonResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override LogonResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.authentication.Authentication.internal__static_bnet_protocol_authentication_LogonResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.authentication.Authentication.internal__static_bnet_protocol_authentication_LogonResponse__FieldAccessorTable; } - } - - public const int AccountFieldNumber = 1; - private bool hasAccount; - private global::bnet.protocol.EntityId account_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasAccount { - get { return hasAccount; } - } - public global::bnet.protocol.EntityId Account { - get { return account_; } - } - - public const int GameAccountFieldNumber = 2; - private bool hasGameAccount; - private global::bnet.protocol.EntityId gameAccount_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasGameAccount { - get { return hasGameAccount; } - } - public global::bnet.protocol.EntityId GameAccount { - get { return gameAccount_; } - } - - public override bool IsInitialized { - get { - if (!hasAccount) return false; - if (!hasGameAccount) return false; - if (!Account.IsInitialized) return false; - if (!GameAccount.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasAccount) { - output.WriteMessage(1, Account); - } - if (HasGameAccount) { - output.WriteMessage(2, GameAccount); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasAccount) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Account); - } - if (HasGameAccount) { - size += pb::CodedOutputStream.ComputeMessageSize(2, GameAccount); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static LogonResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static LogonResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static LogonResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static LogonResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static LogonResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static LogonResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static LogonResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static LogonResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static LogonResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static LogonResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(LogonResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - LogonResponse result = new LogonResponse(); - - protected override LogonResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new LogonResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.authentication.LogonResponse.Descriptor; } - } - - public override LogonResponse DefaultInstanceForType { - get { return global::bnet.protocol.authentication.LogonResponse.DefaultInstance; } - } - - public override LogonResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - LogonResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is LogonResponse) { - return MergeFrom((LogonResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(LogonResponse other) { - if (other == global::bnet.protocol.authentication.LogonResponse.DefaultInstance) return this; - if (other.HasAccount) { - MergeAccount(other.Account); - } - if (other.HasGameAccount) { - MergeGameAccount(other.GameAccount); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAccount) { - subBuilder.MergeFrom(Account); - } - input.ReadMessage(subBuilder, extensionRegistry); - Account = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasGameAccount) { - subBuilder.MergeFrom(GameAccount); - } - input.ReadMessage(subBuilder, extensionRegistry); - GameAccount = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasAccount { - get { return result.HasAccount; } - } - public global::bnet.protocol.EntityId Account { - get { return result.Account; } - set { SetAccount(value); } - } - public Builder SetAccount(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasAccount = true; - result.account_ = value; - return this; - } - public Builder SetAccount(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasAccount = true; - result.account_ = builderForValue.Build(); - return this; - } - public Builder MergeAccount(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAccount && - result.account_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.account_ = global::bnet.protocol.EntityId.CreateBuilder(result.account_).MergeFrom(value).BuildPartial(); - } else { - result.account_ = value; - } - result.hasAccount = true; - return this; - } - public Builder ClearAccount() { - result.hasAccount = false; - result.account_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasGameAccount { - get { return result.HasGameAccount; } - } - public global::bnet.protocol.EntityId GameAccount { - get { return result.GameAccount; } - set { SetGameAccount(value); } - } - public Builder SetGameAccount(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasGameAccount = true; - result.gameAccount_ = value; - return this; - } - public Builder SetGameAccount(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasGameAccount = true; - result.gameAccount_ = builderForValue.Build(); - return this; - } - public Builder MergeGameAccount(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasGameAccount && - result.gameAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.gameAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccount_).MergeFrom(value).BuildPartial(); - } else { - result.gameAccount_ = value; - } - result.hasGameAccount = true; - return this; - } - public Builder ClearGameAccount() { - result.hasGameAccount = false; - result.gameAccount_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - } - static LogonResponse() { - object.ReferenceEquals(global::bnet.protocol.authentication.Authentication.Descriptor, null); - } - } - - public sealed partial class AuthenticationConfig : pb::GeneratedMessage { - private static readonly AuthenticationConfig defaultInstance = new Builder().BuildPartial(); - public static AuthenticationConfig DefaultInstance { - get { return defaultInstance; } - } - - public override AuthenticationConfig DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override AuthenticationConfig ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.authentication.Authentication.internal__static_bnet_protocol_authentication_AuthenticationConfig__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.authentication.Authentication.internal__static_bnet_protocol_authentication_AuthenticationConfig__FieldAccessorTable; } - } - - public const int ModuleFieldNumber = 1; - private pbc::PopsicleList module_ = new pbc::PopsicleList(); - public scg::IList ModuleList { - get { return module_; } - } - public int ModuleCount { - get { return module_.Count; } - } - public global::bnet.protocol.config.Resource GetModule(int index) { - return module_[index]; - } - - public const int AllowVersionFieldNumber = 2; - private pbc::PopsicleList allowVersion_ = new pbc::PopsicleList(); - public scg::IList AllowVersionList { - get { return pbc::Lists.AsReadOnly(allowVersion_); } - } - public int AllowVersionCount { - get { return allowVersion_.Count; } - } - public string GetAllowVersion(int index) { - return allowVersion_[index]; - } - - public const int DenyVersionFieldNumber = 3; - private pbc::PopsicleList denyVersion_ = new pbc::PopsicleList(); - public scg::IList DenyVersionList { - get { return pbc::Lists.AsReadOnly(denyVersion_); } - } - public int DenyVersionCount { - get { return denyVersion_.Count; } - } - public string GetDenyVersion(int index) { - return denyVersion_[index]; - } - - public const int AgreementFieldNumber = 4; - private pbc::PopsicleList agreement_ = new pbc::PopsicleList(); - public scg::IList AgreementList { - get { return agreement_; } - } - public int AgreementCount { - get { return agreement_.Count; } - } - public global::bnet.protocol.config.Resource GetAgreement(int index) { - return agreement_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::bnet.protocol.config.Resource element in ModuleList) { - if (!element.IsInitialized) return false; - } - foreach (global::bnet.protocol.config.Resource element in AgreementList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::bnet.protocol.config.Resource element in ModuleList) { - output.WriteMessage(1, element); - } - if (allowVersion_.Count > 0) { - foreach (string element in allowVersion_) { - output.WriteString(2, element); - } - } - if (denyVersion_.Count > 0) { - foreach (string element in denyVersion_) { - output.WriteString(3, element); - } - } - foreach (global::bnet.protocol.config.Resource element in AgreementList) { - output.WriteMessage(4, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::bnet.protocol.config.Resource element in ModuleList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - { - int dataSize = 0; - foreach (string element in AllowVersionList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 1 * allowVersion_.Count; - } - { - int dataSize = 0; - foreach (string element in DenyVersionList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 1 * denyVersion_.Count; - } - foreach (global::bnet.protocol.config.Resource element in AgreementList) { - size += pb::CodedOutputStream.ComputeMessageSize(4, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static AuthenticationConfig ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static AuthenticationConfig ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static AuthenticationConfig ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static AuthenticationConfig ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static AuthenticationConfig ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static AuthenticationConfig ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static AuthenticationConfig ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static AuthenticationConfig ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static AuthenticationConfig ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static AuthenticationConfig ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(AuthenticationConfig prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - AuthenticationConfig result = new AuthenticationConfig(); - - protected override AuthenticationConfig MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new AuthenticationConfig(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.authentication.AuthenticationConfig.Descriptor; } - } - - public override AuthenticationConfig DefaultInstanceForType { - get { return global::bnet.protocol.authentication.AuthenticationConfig.DefaultInstance; } - } - - public override AuthenticationConfig BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.module_.MakeReadOnly(); - result.allowVersion_.MakeReadOnly(); - result.denyVersion_.MakeReadOnly(); - result.agreement_.MakeReadOnly(); - AuthenticationConfig returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is AuthenticationConfig) { - return MergeFrom((AuthenticationConfig) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(AuthenticationConfig other) { - if (other == global::bnet.protocol.authentication.AuthenticationConfig.DefaultInstance) return this; - if (other.module_.Count != 0) { - base.AddRange(other.module_, result.module_); - } - if (other.allowVersion_.Count != 0) { - base.AddRange(other.allowVersion_, result.allowVersion_); - } - if (other.denyVersion_.Count != 0) { - base.AddRange(other.denyVersion_, result.denyVersion_); - } - if (other.agreement_.Count != 0) { - base.AddRange(other.agreement_, result.agreement_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.config.Resource.Builder subBuilder = global::bnet.protocol.config.Resource.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddModule(subBuilder.BuildPartial()); - break; - } - case 18: { - AddAllowVersion(input.ReadString()); - break; - } - case 26: { - AddDenyVersion(input.ReadString()); - break; - } - case 34: { - global::bnet.protocol.config.Resource.Builder subBuilder = global::bnet.protocol.config.Resource.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddAgreement(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public pbc::IPopsicleList ModuleList { - get { return result.module_; } - } - public int ModuleCount { - get { return result.ModuleCount; } - } - public global::bnet.protocol.config.Resource GetModule(int index) { - return result.GetModule(index); - } - public Builder SetModule(int index, global::bnet.protocol.config.Resource value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.module_[index] = value; - return this; - } - public Builder SetModule(int index, global::bnet.protocol.config.Resource.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.module_[index] = builderForValue.Build(); - return this; - } - public Builder AddModule(global::bnet.protocol.config.Resource value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.module_.Add(value); - return this; - } - public Builder AddModule(global::bnet.protocol.config.Resource.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.module_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeModule(scg::IEnumerable values) { - base.AddRange(values, result.module_); - return this; - } - public Builder ClearModule() { - result.module_.Clear(); - return this; - } - - public pbc::IPopsicleList AllowVersionList { - get { return result.allowVersion_; } - } - public int AllowVersionCount { - get { return result.AllowVersionCount; } - } - public string GetAllowVersion(int index) { - return result.GetAllowVersion(index); - } - public Builder SetAllowVersion(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.allowVersion_[index] = value; - return this; - } - public Builder AddAllowVersion(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.allowVersion_.Add(value); - return this; - } - public Builder AddRangeAllowVersion(scg::IEnumerable values) { - base.AddRange(values, result.allowVersion_); - return this; - } - public Builder ClearAllowVersion() { - result.allowVersion_.Clear(); - return this; - } - - public pbc::IPopsicleList DenyVersionList { - get { return result.denyVersion_; } - } - public int DenyVersionCount { - get { return result.DenyVersionCount; } - } - public string GetDenyVersion(int index) { - return result.GetDenyVersion(index); - } - public Builder SetDenyVersion(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.denyVersion_[index] = value; - return this; - } - public Builder AddDenyVersion(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.denyVersion_.Add(value); - return this; - } - public Builder AddRangeDenyVersion(scg::IEnumerable values) { - base.AddRange(values, result.denyVersion_); - return this; - } - public Builder ClearDenyVersion() { - result.denyVersion_.Clear(); - return this; - } - - public pbc::IPopsicleList AgreementList { - get { return result.agreement_; } - } - public int AgreementCount { - get { return result.AgreementCount; } - } - public global::bnet.protocol.config.Resource GetAgreement(int index) { - return result.GetAgreement(index); - } - public Builder SetAgreement(int index, global::bnet.protocol.config.Resource value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.agreement_[index] = value; - return this; - } - public Builder SetAgreement(int index, global::bnet.protocol.config.Resource.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.agreement_[index] = builderForValue.Build(); - return this; - } - public Builder AddAgreement(global::bnet.protocol.config.Resource value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.agreement_.Add(value); - return this; - } - public Builder AddAgreement(global::bnet.protocol.config.Resource.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.agreement_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeAgreement(scg::IEnumerable values) { - base.AddRange(values, result.agreement_); - return this; - } - public Builder ClearAgreement() { - result.agreement_.Clear(); - return this; - } - } - static AuthenticationConfig() { - object.ReferenceEquals(global::bnet.protocol.authentication.Authentication.Descriptor, null); - } - } - - public sealed partial class AuthModuleVariant : pb::GeneratedMessage { - private static readonly AuthModuleVariant defaultInstance = new Builder().BuildPartial(); - public static AuthModuleVariant DefaultInstance { - get { return defaultInstance; } - } - - public override AuthModuleVariant DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override AuthModuleVariant ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.authentication.Authentication.internal__static_bnet_protocol_authentication_AuthModuleVariant__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.authentication.Authentication.internal__static_bnet_protocol_authentication_AuthModuleVariant__FieldAccessorTable; } - } - - public const int PlatformFieldNumber = 1; - private bool hasPlatform; - private string platform_ = ""; - public bool HasPlatform { - get { return hasPlatform; } - } - public string Platform { - get { return platform_; } - } - - public const int HandleFieldNumber = 2; - private bool hasHandle; - private string handle_ = ""; - public bool HasHandle { - get { return hasHandle; } - } - public string Handle { - get { return handle_; } - } - - public override bool IsInitialized { - get { - if (!hasPlatform) return false; - if (!hasHandle) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasPlatform) { - output.WriteString(1, Platform); - } - if (HasHandle) { - output.WriteString(2, Handle); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasPlatform) { - size += pb::CodedOutputStream.ComputeStringSize(1, Platform); - } - if (HasHandle) { - size += pb::CodedOutputStream.ComputeStringSize(2, Handle); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static AuthModuleVariant ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static AuthModuleVariant ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static AuthModuleVariant ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static AuthModuleVariant ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static AuthModuleVariant ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static AuthModuleVariant ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static AuthModuleVariant ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static AuthModuleVariant ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static AuthModuleVariant ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static AuthModuleVariant ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(AuthModuleVariant prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - AuthModuleVariant result = new AuthModuleVariant(); - - protected override AuthModuleVariant MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new AuthModuleVariant(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.authentication.AuthModuleVariant.Descriptor; } - } - - public override AuthModuleVariant DefaultInstanceForType { - get { return global::bnet.protocol.authentication.AuthModuleVariant.DefaultInstance; } - } - - public override AuthModuleVariant BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - AuthModuleVariant returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is AuthModuleVariant) { - return MergeFrom((AuthModuleVariant) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(AuthModuleVariant other) { - if (other == global::bnet.protocol.authentication.AuthModuleVariant.DefaultInstance) return this; - if (other.HasPlatform) { - Platform = other.Platform; - } - if (other.HasHandle) { - Handle = other.Handle; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - Platform = input.ReadString(); - break; - } - case 18: { - Handle = input.ReadString(); - break; - } - } - } - } - - - public bool HasPlatform { - get { return result.HasPlatform; } - } - public string Platform { - get { return result.Platform; } - set { SetPlatform(value); } - } - public Builder SetPlatform(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasPlatform = true; - result.platform_ = value; - return this; - } - public Builder ClearPlatform() { - result.hasPlatform = false; - result.platform_ = ""; - return this; - } - - public bool HasHandle { - get { return result.HasHandle; } - } - public string Handle { - get { return result.Handle; } - set { SetHandle(value); } - } - public Builder SetHandle(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasHandle = true; - result.handle_ = value; - return this; - } - public Builder ClearHandle() { - result.hasHandle = false; - result.handle_ = ""; - return this; - } - } - static AuthModuleVariant() { - object.ReferenceEquals(global::bnet.protocol.authentication.Authentication.Descriptor, null); - } - } - - public sealed partial class AuthModuleConfig : pb::GeneratedMessage { - private static readonly AuthModuleConfig defaultInstance = new Builder().BuildPartial(); - public static AuthModuleConfig DefaultInstance { - get { return defaultInstance; } - } - - public override AuthModuleConfig DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override AuthModuleConfig ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.authentication.Authentication.internal__static_bnet_protocol_authentication_AuthModuleConfig__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.authentication.Authentication.internal__static_bnet_protocol_authentication_AuthModuleConfig__FieldAccessorTable; } - } - - public const int VariantFieldNumber = 1; - private pbc::PopsicleList variant_ = new pbc::PopsicleList(); - public scg::IList VariantList { - get { return variant_; } - } - public int VariantCount { - get { return variant_.Count; } - } - public global::bnet.protocol.authentication.AuthModuleVariant GetVariant(int index) { - return variant_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::bnet.protocol.authentication.AuthModuleVariant element in VariantList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::bnet.protocol.authentication.AuthModuleVariant element in VariantList) { - output.WriteMessage(1, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::bnet.protocol.authentication.AuthModuleVariant element in VariantList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static AuthModuleConfig ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static AuthModuleConfig ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static AuthModuleConfig ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static AuthModuleConfig ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static AuthModuleConfig ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static AuthModuleConfig ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static AuthModuleConfig ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static AuthModuleConfig ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static AuthModuleConfig ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static AuthModuleConfig ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(AuthModuleConfig prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - AuthModuleConfig result = new AuthModuleConfig(); - - protected override AuthModuleConfig MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new AuthModuleConfig(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.authentication.AuthModuleConfig.Descriptor; } - } - - public override AuthModuleConfig DefaultInstanceForType { - get { return global::bnet.protocol.authentication.AuthModuleConfig.DefaultInstance; } - } - - public override AuthModuleConfig BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.variant_.MakeReadOnly(); - AuthModuleConfig returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is AuthModuleConfig) { - return MergeFrom((AuthModuleConfig) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(AuthModuleConfig other) { - if (other == global::bnet.protocol.authentication.AuthModuleConfig.DefaultInstance) return this; - if (other.variant_.Count != 0) { - base.AddRange(other.variant_, result.variant_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.authentication.AuthModuleVariant.Builder subBuilder = global::bnet.protocol.authentication.AuthModuleVariant.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddVariant(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public pbc::IPopsicleList VariantList { - get { return result.variant_; } - } - public int VariantCount { - get { return result.VariantCount; } - } - public global::bnet.protocol.authentication.AuthModuleVariant GetVariant(int index) { - return result.GetVariant(index); - } - public Builder SetVariant(int index, global::bnet.protocol.authentication.AuthModuleVariant value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.variant_[index] = value; - return this; - } - public Builder SetVariant(int index, global::bnet.protocol.authentication.AuthModuleVariant.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.variant_[index] = builderForValue.Build(); - return this; - } - public Builder AddVariant(global::bnet.protocol.authentication.AuthModuleVariant value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.variant_.Add(value); - return this; - } - public Builder AddVariant(global::bnet.protocol.authentication.AuthModuleVariant.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.variant_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeVariant(scg::IEnumerable values) { - base.AddRange(values, result.variant_); - return this; - } - public Builder ClearVariant() { - result.variant_.Clear(); - return this; - } - } - static AuthModuleConfig() { - object.ReferenceEquals(global::bnet.protocol.authentication.Authentication.Descriptor, null); - } - } - - public sealed partial class AuthAgreementLocale : pb::GeneratedMessage { - private static readonly AuthAgreementLocale defaultInstance = new Builder().BuildPartial(); - public static AuthAgreementLocale DefaultInstance { - get { return defaultInstance; } - } - - public override AuthAgreementLocale DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override AuthAgreementLocale ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.authentication.Authentication.internal__static_bnet_protocol_authentication_AuthAgreementLocale__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.authentication.Authentication.internal__static_bnet_protocol_authentication_AuthAgreementLocale__FieldAccessorTable; } - } - - public const int IdFieldNumber = 1; - private bool hasId; - private string id_ = ""; - public bool HasId { - get { return hasId; } - } - public string Id { - get { return id_; } - } - - public const int HandleFieldNumber = 2; - private bool hasHandle; - private string handle_ = ""; - public bool HasHandle { - get { return hasHandle; } - } - public string Handle { - get { return handle_; } - } - - public override bool IsInitialized { - get { - if (!hasId) return false; - if (!hasHandle) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasId) { - output.WriteString(1, Id); - } - if (HasHandle) { - output.WriteString(2, Handle); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasId) { - size += pb::CodedOutputStream.ComputeStringSize(1, Id); - } - if (HasHandle) { - size += pb::CodedOutputStream.ComputeStringSize(2, Handle); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static AuthAgreementLocale ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static AuthAgreementLocale ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static AuthAgreementLocale ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static AuthAgreementLocale ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static AuthAgreementLocale ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static AuthAgreementLocale ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static AuthAgreementLocale ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static AuthAgreementLocale ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static AuthAgreementLocale ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static AuthAgreementLocale ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(AuthAgreementLocale prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - AuthAgreementLocale result = new AuthAgreementLocale(); - - protected override AuthAgreementLocale MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new AuthAgreementLocale(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.authentication.AuthAgreementLocale.Descriptor; } - } - - public override AuthAgreementLocale DefaultInstanceForType { - get { return global::bnet.protocol.authentication.AuthAgreementLocale.DefaultInstance; } - } - - public override AuthAgreementLocale BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - AuthAgreementLocale returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is AuthAgreementLocale) { - return MergeFrom((AuthAgreementLocale) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(AuthAgreementLocale other) { - if (other == global::bnet.protocol.authentication.AuthAgreementLocale.DefaultInstance) return this; - if (other.HasId) { - Id = other.Id; - } - if (other.HasHandle) { - Handle = other.Handle; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - Id = input.ReadString(); - break; - } - case 18: { - Handle = input.ReadString(); - break; - } - } - } - } - - - public bool HasId { - get { return result.HasId; } - } - public string Id { - get { return result.Id; } - set { SetId(value); } - } - public Builder SetId(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasId = true; - result.id_ = value; - return this; - } - public Builder ClearId() { - result.hasId = false; - result.id_ = ""; - return this; - } - - public bool HasHandle { - get { return result.HasHandle; } - } - public string Handle { - get { return result.Handle; } - set { SetHandle(value); } - } - public Builder SetHandle(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasHandle = true; - result.handle_ = value; - return this; - } - public Builder ClearHandle() { - result.hasHandle = false; - result.handle_ = ""; - return this; - } - } - static AuthAgreementLocale() { - object.ReferenceEquals(global::bnet.protocol.authentication.Authentication.Descriptor, null); - } - } - - public sealed partial class AuthAgreement : pb::GeneratedMessage { - private static readonly AuthAgreement defaultInstance = new Builder().BuildPartial(); - public static AuthAgreement DefaultInstance { - get { return defaultInstance; } - } - - public override AuthAgreement DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override AuthAgreement ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.authentication.Authentication.internal__static_bnet_protocol_authentication_AuthAgreement__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.authentication.Authentication.internal__static_bnet_protocol_authentication_AuthAgreement__FieldAccessorTable; } - } - - public const int TypeFieldNumber = 1; - private bool hasType; - private string type_ = ""; - public bool HasType { - get { return hasType; } - } - public string Type { - get { return type_; } - } - - public const int ProgramFieldNumber = 2; - private bool hasProgram; - private string program_ = ""; - public bool HasProgram { - get { return hasProgram; } - } - public string Program { - get { return program_; } - } - - public const int SchemeFieldNumber = 3; - private bool hasScheme; - private uint scheme_ = 0; - public bool HasScheme { - get { return hasScheme; } - } - public uint Scheme { - get { return scheme_; } - } - - public const int LocaleFieldNumber = 4; - private pbc::PopsicleList locale_ = new pbc::PopsicleList(); - public scg::IList LocaleList { - get { return locale_; } - } - public int LocaleCount { - get { return locale_.Count; } - } - public global::bnet.protocol.authentication.AuthAgreementLocale GetLocale(int index) { - return locale_[index]; - } - - public override bool IsInitialized { - get { - if (!hasType) return false; - if (!hasProgram) return false; - if (!hasScheme) return false; - foreach (global::bnet.protocol.authentication.AuthAgreementLocale element in LocaleList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasType) { - output.WriteString(1, Type); - } - if (HasProgram) { - output.WriteString(2, Program); - } - if (HasScheme) { - output.WriteUInt32(3, Scheme); - } - foreach (global::bnet.protocol.authentication.AuthAgreementLocale element in LocaleList) { - output.WriteMessage(4, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasType) { - size += pb::CodedOutputStream.ComputeStringSize(1, Type); - } - if (HasProgram) { - size += pb::CodedOutputStream.ComputeStringSize(2, Program); - } - if (HasScheme) { - size += pb::CodedOutputStream.ComputeUInt32Size(3, Scheme); - } - foreach (global::bnet.protocol.authentication.AuthAgreementLocale element in LocaleList) { - size += pb::CodedOutputStream.ComputeMessageSize(4, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static AuthAgreement ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static AuthAgreement ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static AuthAgreement ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static AuthAgreement ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static AuthAgreement ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static AuthAgreement ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static AuthAgreement ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static AuthAgreement ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static AuthAgreement ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static AuthAgreement ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(AuthAgreement prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - AuthAgreement result = new AuthAgreement(); - - protected override AuthAgreement MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new AuthAgreement(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.authentication.AuthAgreement.Descriptor; } - } - - public override AuthAgreement DefaultInstanceForType { - get { return global::bnet.protocol.authentication.AuthAgreement.DefaultInstance; } - } - - public override AuthAgreement BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.locale_.MakeReadOnly(); - AuthAgreement returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is AuthAgreement) { - return MergeFrom((AuthAgreement) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(AuthAgreement other) { - if (other == global::bnet.protocol.authentication.AuthAgreement.DefaultInstance) return this; - if (other.HasType) { - Type = other.Type; - } - if (other.HasProgram) { - Program = other.Program; - } - if (other.HasScheme) { - Scheme = other.Scheme; - } - if (other.locale_.Count != 0) { - base.AddRange(other.locale_, result.locale_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - Type = input.ReadString(); - break; - } - case 18: { - Program = input.ReadString(); - break; - } - case 24: { - Scheme = input.ReadUInt32(); - break; - } - case 34: { - global::bnet.protocol.authentication.AuthAgreementLocale.Builder subBuilder = global::bnet.protocol.authentication.AuthAgreementLocale.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddLocale(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public bool HasType { - get { return result.HasType; } - } - public string Type { - get { return result.Type; } - set { SetType(value); } - } - public Builder SetType(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasType = true; - result.type_ = value; - return this; - } - public Builder ClearType() { - result.hasType = false; - result.type_ = ""; - return this; - } - - public bool HasProgram { - get { return result.HasProgram; } - } - public string Program { - get { return result.Program; } - set { SetProgram(value); } - } - public Builder SetProgram(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasProgram = true; - result.program_ = value; - return this; - } - public Builder ClearProgram() { - result.hasProgram = false; - result.program_ = ""; - return this; - } - - public bool HasScheme { - get { return result.HasScheme; } - } - public uint Scheme { - get { return result.Scheme; } - set { SetScheme(value); } - } - public Builder SetScheme(uint value) { - result.hasScheme = true; - result.scheme_ = value; - return this; - } - public Builder ClearScheme() { - result.hasScheme = false; - result.scheme_ = 0; - return this; - } - - public pbc::IPopsicleList LocaleList { - get { return result.locale_; } - } - public int LocaleCount { - get { return result.LocaleCount; } - } - public global::bnet.protocol.authentication.AuthAgreementLocale GetLocale(int index) { - return result.GetLocale(index); - } - public Builder SetLocale(int index, global::bnet.protocol.authentication.AuthAgreementLocale value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.locale_[index] = value; - return this; - } - public Builder SetLocale(int index, global::bnet.protocol.authentication.AuthAgreementLocale.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.locale_[index] = builderForValue.Build(); - return this; - } - public Builder AddLocale(global::bnet.protocol.authentication.AuthAgreementLocale value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.locale_.Add(value); - return this; - } - public Builder AddLocale(global::bnet.protocol.authentication.AuthAgreementLocale.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.locale_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeLocale(scg::IEnumerable values) { - base.AddRange(values, result.locale_); - return this; - } - public Builder ClearLocale() { - result.locale_.Clear(); - return this; - } - } - static AuthAgreement() { - object.ReferenceEquals(global::bnet.protocol.authentication.Authentication.Descriptor, null); - } - } - - #endregion - - #region Services - public abstract class AuthenticationClient : pb::IService { - public abstract void ModuleLoad( - pb::IRpcController controller, - global::bnet.protocol.authentication.ModuleLoadRequest request, - global::System.Action done); - public abstract void ModuleMessage( - pb::IRpcController controller, - global::bnet.protocol.authentication.ModuleMessageRequest request, - global::System.Action done); - - public static pbd::ServiceDescriptor Descriptor { - get { return Authentication.Descriptor.Services[0]; } - } - public pbd::ServiceDescriptor DescriptorForType { - get { return Descriptor; } - } - - public void CallMethod( - pbd::MethodDescriptor method, - pb::IRpcController controller, - pb::IMessage request, - global::System.Action done) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.CallMethod() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - this.ModuleLoad(controller, (global::bnet.protocol.authentication.ModuleLoadRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 1: - this.ModuleMessage(controller, (global::bnet.protocol.authentication.ModuleMessageRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetRequestPrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::bnet.protocol.authentication.ModuleLoadRequest.DefaultInstance; - case 1: - return global::bnet.protocol.authentication.ModuleMessageRequest.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetResponsePrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::bnet.protocol.authentication.ModuleLoadResponse.DefaultInstance; - case 1: - return global::bnet.protocol.NoData.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public static Stub CreateStub(pb::IRpcChannel channel) { - return new Stub(channel); - } - - public class Stub : global::bnet.protocol.authentication.AuthenticationClient { - internal Stub(pb::IRpcChannel channel) { - this.channel = channel; - } - - private readonly pb::IRpcChannel channel; - - public pb::IRpcChannel Channel { - get { return channel; } - } - - public override void ModuleLoad( - pb::IRpcController controller, - global::bnet.protocol.authentication.ModuleLoadRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[0], - controller, request, global::bnet.protocol.authentication.ModuleLoadResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.authentication.ModuleLoadResponse.DefaultInstance)); - } - - public override void ModuleMessage( - pb::IRpcController controller, - global::bnet.protocol.authentication.ModuleMessageRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[1], - controller, request, global::bnet.protocol.NoData.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); - } - } - } - public abstract class AuthenticationServer : pb::IService { - public abstract void Logon( - pb::IRpcController controller, - global::bnet.protocol.authentication.LogonRequest request, - global::System.Action done); - public abstract void ModuleMessage( - pb::IRpcController controller, - global::bnet.protocol.authentication.ModuleMessageRequest request, - global::System.Action done); - - public static pbd::ServiceDescriptor Descriptor { - get { return Authentication.Descriptor.Services[1]; } - } - public pbd::ServiceDescriptor DescriptorForType { - get { return Descriptor; } - } - - public void CallMethod( - pbd::MethodDescriptor method, - pb::IRpcController controller, - pb::IMessage request, - global::System.Action done) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.CallMethod() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - this.Logon(controller, (global::bnet.protocol.authentication.LogonRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 1: - this.ModuleMessage(controller, (global::bnet.protocol.authentication.ModuleMessageRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetRequestPrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::bnet.protocol.authentication.LogonRequest.DefaultInstance; - case 1: - return global::bnet.protocol.authentication.ModuleMessageRequest.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetResponsePrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::bnet.protocol.authentication.LogonResponse.DefaultInstance; - case 1: - return global::bnet.protocol.NoData.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public static Stub CreateStub(pb::IRpcChannel channel) { - return new Stub(channel); - } - - public class Stub : global::bnet.protocol.authentication.AuthenticationServer { - internal Stub(pb::IRpcChannel channel) { - this.channel = channel; - } - - private readonly pb::IRpcChannel channel; - - public pb::IRpcChannel Channel { - get { return channel; } - } - - public override void Logon( - pb::IRpcController controller, - global::bnet.protocol.authentication.LogonRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[0], - controller, request, global::bnet.protocol.authentication.LogonResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.authentication.LogonResponse.DefaultInstance)); - } - - public override void ModuleMessage( - pb::IRpcController controller, - global::bnet.protocol.authentication.ModuleMessageRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[1], - controller, request, global::bnet.protocol.NoData.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); - } - } - } - #endregion - -} diff --git a/source/D3Proto/bnet/protocol/channel/ChannelTypes.cs b/source/D3Proto/bnet/protocol/channel/ChannelTypes.cs deleted file mode 100644 index 0ded519e..00000000 --- a/source/D3Proto/bnet/protocol/channel/ChannelTypes.cs +++ /dev/null @@ -1,5398 +0,0 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace bnet.protocol.channel { - - public static partial class ChannelTypes { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_Message__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_Message__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_ChannelDescription__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_ChannelDescription__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_ChannelInfo__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_ChannelInfo__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_GetChannelInfoRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_GetChannelInfoRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_GetChannelInfoResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_GetChannelInfoResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_GetChannelIdRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_GetChannelIdRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_GetChannelIdResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_GetChannelIdResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_CreateChannelRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_CreateChannelRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_CreateChannelResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_CreateChannelResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_JoinChannelRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_JoinChannelRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_JoinChannelResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_JoinChannelResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_FindChannelRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_FindChannelRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_FindChannelResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_FindChannelResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_ChannelState__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_ChannelState__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_MemberState__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_MemberState__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_Member__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_Member__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static ChannelTypes() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "CiNzZXJ2aWNlL2NoYW5uZWwvY2hhbm5lbF90eXBlcy5wcm90bxIVYm5ldC5w" + - "cm90b2NvbC5jaGFubmVsGhxsaWIvcHJvdG9jb2wvYXR0cmlidXRlLnByb3Rv" + - "GhlsaWIvcHJvdG9jb2wvZW50aXR5LnByb3RvGh1saWIvcHJvdG9jb2wvaW52" + - "aXRhdGlvbi5wcm90byJVCgdNZXNzYWdlEjUKCWF0dHJpYnV0ZRgBIAMoCzIi" + - "LmJuZXQucHJvdG9jb2wuYXR0cmlidXRlLkF0dHJpYnV0ZRIMCgRyb2xlGAIg" + - "ASgNKgUIZBCQTiKVAQoSQ2hhbm5lbERlc2NyaXB0aW9uEisKCmNoYW5uZWxf" + - "aWQYASACKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEhcKD2N1cnJlbnRf" + - "bWVtYmVycxgCIAEoDRIyCgVzdGF0ZRgDIAEoCzIjLmJuZXQucHJvdG9jb2wu" + - "Y2hhbm5lbC5DaGFubmVsU3RhdGUqBQhkEJBOIoMBCgtDaGFubmVsSW5mbxI+" + - "CgtkZXNjcmlwdGlvbhgBIAIoCzIpLmJuZXQucHJvdG9jb2wuY2hhbm5lbC5D" + - "aGFubmVsRGVzY3JpcHRpb24SLQoGbWVtYmVyGAIgAygLMh0uYm5ldC5wcm90" + - "b2NvbC5jaGFubmVsLk1lbWJlcioFCGQQkE4ibwoVR2V0Q2hhbm5lbEluZm9S" + - "ZXF1ZXN0EikKCGFnZW50X2lkGAEgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRp" + - "dHlJZBIrCgpjaGFubmVsX2lkGAIgAigLMhcuYm5ldC5wcm90b2NvbC5FbnRp" + - "dHlJZCJSChZHZXRDaGFubmVsSW5mb1Jlc3BvbnNlEjgKDGNoYW5uZWxfaW5m" + - "bxgBIAEoCzIiLmJuZXQucHJvdG9jb2wuY2hhbm5lbC5DaGFubmVsSW5mbyIV" + - "ChNHZXRDaGFubmVsSWRSZXF1ZXN0IkMKFEdldENoYW5uZWxJZFJlc3BvbnNl" + - "EisKCmNoYW5uZWxfaWQYASABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlk" + - "IrsBChRDcmVhdGVDaGFubmVsUmVxdWVzdBIvCg5hZ2VudF9pZGVudGl0eRgB" + - "IAEoCzIXLmJuZXQucHJvdG9jb2wuSWRlbnRpdHkSMgoFc3RhdGUYAiABKAsy" + - "Iy5ibmV0LnByb3RvY29sLmNoYW5uZWwuQ2hhbm5lbFN0YXRlEisKCmNoYW5u" + - "ZWxfaWQYAyABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEhEKCW9iamVj" + - "dF9pZBgEIAEoBCJXChVDcmVhdGVDaGFubmVsUmVzcG9uc2USEQoJb2JqZWN0" + - "X2lkGAEgAigEEisKCmNoYW5uZWxfaWQYAiABKAsyFy5ibmV0LnByb3RvY29s" + - "LkVudGl0eUlkIrkBChJKb2luQ2hhbm5lbFJlcXVlc3QSLwoOYWdlbnRfaWRl" + - "bnRpdHkYASABKAsyFy5ibmV0LnByb3RvY29sLklkZW50aXR5EisKCmNoYW5u" + - "ZWxfaWQYAiACKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEhEKCW9iamVj" + - "dF9pZBgDIAIoBBIyChFmcmllbmRfYWNjb3VudF9pZBgEIAMoCzIXLmJuZXQu" + - "cHJvdG9jb2wuRW50aXR5SWQihwEKE0pvaW5DaGFubmVsUmVzcG9uc2USEQoJ" + - "b2JqZWN0X2lkGAEgASgEEigKGXJlcXVpcmVfZnJpZW5kX3ZhbGlkYXRpb24Y" + - "AiABKAg6BWZhbHNlEjMKEnByaXZpbGVnZWRfYWNjb3VudBgDIAMoCzIXLmJu" + - "ZXQucHJvdG9jb2wuRW50aXR5SWQiTgoSRmluZENoYW5uZWxSZXF1ZXN0EjgK" + - "BmZpbHRlchgBIAIoCzIoLmJuZXQucHJvdG9jb2wuYXR0cmlidXRlLkF0dHJp" + - "YnV0ZUZpbHRlciJRChNGaW5kQ2hhbm5lbFJlc3BvbnNlEjoKB2NoYW5uZWwY" + - "ASADKAsyKS5ibmV0LnByb3RvY29sLmNoYW5uZWwuQ2hhbm5lbERlc2NyaXB0" + - "aW9uIp4ECgxDaGFubmVsU3RhdGUSEwoLbWF4X21lbWJlcnMYASABKA0SEwoL" + - "bWluX21lbWJlcnMYAiABKA0SNQoJYXR0cmlidXRlGAMgAygLMiIuYm5ldC5w" + - "cm90b2NvbC5hdHRyaWJ1dGUuQXR0cmlidXRlEjgKCmludml0YXRpb24YBCAD" + - "KAsyJC5ibmV0LnByb3RvY29sLmludml0YXRpb24uSW52aXRhdGlvbhIXCg9t" + - "YXhfaW52aXRhdGlvbnMYBSABKA0SDgoGcmVhc29uGAYgASgNElsKDXByaXZh" + - "Y3lfbGV2ZWwYByABKA4yMC5ibmV0LnByb3RvY29sLmNoYW5uZWwuQ2hhbm5l" + - "bFN0YXRlLlByaXZhY3lMZXZlbDoSUFJJVkFDWV9MRVZFTF9PUEVOEg4KBnB1" + - "YmxpYxgIIAEoCBIMCgRuYW1lGAkgASgJEhUKDWRlbGVnYXRlX25hbWUYCiAB" + - "KAkSHQoMY2hhbm5lbF90eXBlGAsgASgJOgdkZWZhdWx0IpEBCgxQcml2YWN5" + - "TGV2ZWwSFgoSUFJJVkFDWV9MRVZFTF9PUEVOEAESLAooUFJJVkFDWV9MRVZF" + - "TF9PUEVOX0lOVklUQVRJT05fQU5EX0ZSSUVORBACEiEKHVBSSVZBQ1lfTEVW" + - "RUxfT1BFTl9JTlZJVEFUSU9OEAMSGAoUUFJJVkFDWV9MRVZFTF9DTE9TRUQQ" + - "BCoFCGQQkE4icAoLTWVtYmVyU3RhdGUSNQoJYXR0cmlidXRlGAEgAygLMiIu" + - "Ym5ldC5wcm90b2NvbC5hdHRyaWJ1dGUuQXR0cmlidXRlEgwKBHJvbGUYAiAD" + - "KA0SFQoKcHJpdmlsZWdlcxgDIAEoBDoBMCoFCGQQkE4iZgoGTWVtYmVyEikK" + - "CGlkZW50aXR5GAEgAigLMhcuYm5ldC5wcm90b2NvbC5JZGVudGl0eRIxCgVz" + - "dGF0ZRgCIAIoCzIiLmJuZXQucHJvdG9jb2wuY2hhbm5lbC5NZW1iZXJTdGF0" + - "ZQ=="); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_bnet_protocol_channel_Message__Descriptor = Descriptor.MessageTypes[0]; - internal__static_bnet_protocol_channel_Message__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_Message__Descriptor, - new string[] { "Attribute", "Role", }); - internal__static_bnet_protocol_channel_ChannelDescription__Descriptor = Descriptor.MessageTypes[1]; - internal__static_bnet_protocol_channel_ChannelDescription__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_ChannelDescription__Descriptor, - new string[] { "ChannelId", "CurrentMembers", "State", }); - internal__static_bnet_protocol_channel_ChannelInfo__Descriptor = Descriptor.MessageTypes[2]; - internal__static_bnet_protocol_channel_ChannelInfo__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_ChannelInfo__Descriptor, - new string[] { "Description", "Member", }); - internal__static_bnet_protocol_channel_GetChannelInfoRequest__Descriptor = Descriptor.MessageTypes[3]; - internal__static_bnet_protocol_channel_GetChannelInfoRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_GetChannelInfoRequest__Descriptor, - new string[] { "AgentId", "ChannelId", }); - internal__static_bnet_protocol_channel_GetChannelInfoResponse__Descriptor = Descriptor.MessageTypes[4]; - internal__static_bnet_protocol_channel_GetChannelInfoResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_GetChannelInfoResponse__Descriptor, - new string[] { "ChannelInfo", }); - internal__static_bnet_protocol_channel_GetChannelIdRequest__Descriptor = Descriptor.MessageTypes[5]; - internal__static_bnet_protocol_channel_GetChannelIdRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_GetChannelIdRequest__Descriptor, - new string[] { }); - internal__static_bnet_protocol_channel_GetChannelIdResponse__Descriptor = Descriptor.MessageTypes[6]; - internal__static_bnet_protocol_channel_GetChannelIdResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_GetChannelIdResponse__Descriptor, - new string[] { "ChannelId", }); - internal__static_bnet_protocol_channel_CreateChannelRequest__Descriptor = Descriptor.MessageTypes[7]; - internal__static_bnet_protocol_channel_CreateChannelRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_CreateChannelRequest__Descriptor, - new string[] { "AgentIdentity", "State", "ChannelId", "ObjectId", }); - internal__static_bnet_protocol_channel_CreateChannelResponse__Descriptor = Descriptor.MessageTypes[8]; - internal__static_bnet_protocol_channel_CreateChannelResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_CreateChannelResponse__Descriptor, - new string[] { "ObjectId", "ChannelId", }); - internal__static_bnet_protocol_channel_JoinChannelRequest__Descriptor = Descriptor.MessageTypes[9]; - internal__static_bnet_protocol_channel_JoinChannelRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_JoinChannelRequest__Descriptor, - new string[] { "AgentIdentity", "ChannelId", "ObjectId", "FriendAccountId", }); - internal__static_bnet_protocol_channel_JoinChannelResponse__Descriptor = Descriptor.MessageTypes[10]; - internal__static_bnet_protocol_channel_JoinChannelResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_JoinChannelResponse__Descriptor, - new string[] { "ObjectId", "RequireFriendValidation", "PrivilegedAccount", }); - internal__static_bnet_protocol_channel_FindChannelRequest__Descriptor = Descriptor.MessageTypes[11]; - internal__static_bnet_protocol_channel_FindChannelRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_FindChannelRequest__Descriptor, - new string[] { "Filter", }); - internal__static_bnet_protocol_channel_FindChannelResponse__Descriptor = Descriptor.MessageTypes[12]; - internal__static_bnet_protocol_channel_FindChannelResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_FindChannelResponse__Descriptor, - new string[] { "Channel", }); - internal__static_bnet_protocol_channel_ChannelState__Descriptor = Descriptor.MessageTypes[13]; - internal__static_bnet_protocol_channel_ChannelState__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_ChannelState__Descriptor, - new string[] { "MaxMembers", "MinMembers", "Attribute", "Invitation", "MaxInvitations", "Reason", "PrivacyLevel", "Public", "Name", "DelegateName", "ChannelType", }); - internal__static_bnet_protocol_channel_MemberState__Descriptor = Descriptor.MessageTypes[14]; - internal__static_bnet_protocol_channel_MemberState__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_MemberState__Descriptor, - new string[] { "Attribute", "Role", "Privileges", }); - internal__static_bnet_protocol_channel_Member__Descriptor = Descriptor.MessageTypes[15]; - internal__static_bnet_protocol_channel_Member__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_Member__Descriptor, - new string[] { "Identity", "State", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::bnet.protocol.attribute.Proto.Attribute.Descriptor, - global::bnet.protocol.Entity.Descriptor, - global::bnet.protocol.invitation.Proto.Invitation.Descriptor, - }, assigner); - } - #endregion - - } - #region Messages - public sealed partial class Message : pb::ExtendableMessage { - private static readonly Message defaultInstance = new Builder().BuildPartial(); - public static Message DefaultInstance { - get { return defaultInstance; } - } - - public override Message DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override Message ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_Message__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_Message__FieldAccessorTable; } - } - - public const int AttributeFieldNumber = 1; - private pbc::PopsicleList attribute_ = new pbc::PopsicleList(); - public scg::IList AttributeList { - get { return attribute_; } - } - public int AttributeCount { - get { return attribute_.Count; } - } - public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { - return attribute_[index]; - } - - public const int RoleFieldNumber = 2; - private bool hasRole; - private uint role_ = 0; - public bool HasRole { - get { return hasRole; } - } - public uint Role { - get { return role_; } - } - - public override bool IsInitialized { - get { - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - if (!element.IsInitialized) return false; - } - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - output.WriteMessage(1, element); - } - if (HasRole) { - output.WriteUInt32(2, Role); - } - extensionWriter.WriteUntil(10000, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - if (HasRole) { - size += pb::CodedOutputStream.ComputeUInt32Size(2, Role); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static Message ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Message ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Message ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Message ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Message ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Message ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Message ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Message ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Message ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Message ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Message prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - Message result = new Message(); - - protected override Message MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new Message(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.channel.Message.Descriptor; } - } - - public override Message DefaultInstanceForType { - get { return global::bnet.protocol.channel.Message.DefaultInstance; } - } - - public override Message BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.attribute_.MakeReadOnly(); - Message returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Message) { - return MergeFrom((Message) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Message other) { - if (other == global::bnet.protocol.channel.Message.DefaultInstance) return this; - if (other.attribute_.Count != 0) { - base.AddRange(other.attribute_, result.attribute_); - } - if (other.HasRole) { - Role = other.Role; - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.attribute.Attribute.Builder subBuilder = global::bnet.protocol.attribute.Attribute.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddAttribute(subBuilder.BuildPartial()); - break; - } - case 16: { - Role = input.ReadUInt32(); - break; - } - } - } - } - - - public pbc::IPopsicleList AttributeList { - get { return result.attribute_; } - } - public int AttributeCount { - get { return result.AttributeCount; } - } - public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { - return result.GetAttribute(index); - } - public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.attribute_[index] = value; - return this; - } - public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.attribute_[index] = builderForValue.Build(); - return this; - } - public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.attribute_.Add(value); - return this; - } - public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.attribute_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeAttribute(scg::IEnumerable values) { - base.AddRange(values, result.attribute_); - return this; - } - public Builder ClearAttribute() { - result.attribute_.Clear(); - return this; - } - - public bool HasRole { - get { return result.HasRole; } - } - public uint Role { - get { return result.Role; } - set { SetRole(value); } - } - public Builder SetRole(uint value) { - result.hasRole = true; - result.role_ = value; - return this; - } - public Builder ClearRole() { - result.hasRole = false; - result.role_ = 0; - return this; - } - } - static Message() { - object.ReferenceEquals(global::bnet.protocol.channel.ChannelTypes.Descriptor, null); - } - } - - public sealed partial class ChannelDescription : pb::ExtendableMessage { - private static readonly ChannelDescription defaultInstance = new Builder().BuildPartial(); - public static ChannelDescription DefaultInstance { - get { return defaultInstance; } - } - - public override ChannelDescription DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ChannelDescription ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_ChannelDescription__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_ChannelDescription__FieldAccessorTable; } - } - - public const int ChannelIdFieldNumber = 1; - private bool hasChannelId; - private global::bnet.protocol.EntityId channelId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasChannelId { - get { return hasChannelId; } - } - public global::bnet.protocol.EntityId ChannelId { - get { return channelId_; } - } - - public const int CurrentMembersFieldNumber = 2; - private bool hasCurrentMembers; - private uint currentMembers_ = 0; - public bool HasCurrentMembers { - get { return hasCurrentMembers; } - } - public uint CurrentMembers { - get { return currentMembers_; } - } - - public const int StateFieldNumber = 3; - private bool hasState; - private global::bnet.protocol.channel.ChannelState state_ = global::bnet.protocol.channel.ChannelState.DefaultInstance; - public bool HasState { - get { return hasState; } - } - public global::bnet.protocol.channel.ChannelState State { - get { return state_; } - } - - public override bool IsInitialized { - get { - if (!hasChannelId) return false; - if (!ChannelId.IsInitialized) return false; - if (HasState) { - if (!State.IsInitialized) return false; - } - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - if (HasChannelId) { - output.WriteMessage(1, ChannelId); - } - if (HasCurrentMembers) { - output.WriteUInt32(2, CurrentMembers); - } - if (HasState) { - output.WriteMessage(3, State); - } - extensionWriter.WriteUntil(10000, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasChannelId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, ChannelId); - } - if (HasCurrentMembers) { - size += pb::CodedOutputStream.ComputeUInt32Size(2, CurrentMembers); - } - if (HasState) { - size += pb::CodedOutputStream.ComputeMessageSize(3, State); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ChannelDescription ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ChannelDescription ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ChannelDescription ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ChannelDescription ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ChannelDescription ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ChannelDescription ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ChannelDescription ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ChannelDescription ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ChannelDescription ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ChannelDescription ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ChannelDescription prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ChannelDescription result = new ChannelDescription(); - - protected override ChannelDescription MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ChannelDescription(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.channel.ChannelDescription.Descriptor; } - } - - public override ChannelDescription DefaultInstanceForType { - get { return global::bnet.protocol.channel.ChannelDescription.DefaultInstance; } - } - - public override ChannelDescription BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - ChannelDescription returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ChannelDescription) { - return MergeFrom((ChannelDescription) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ChannelDescription other) { - if (other == global::bnet.protocol.channel.ChannelDescription.DefaultInstance) return this; - if (other.HasChannelId) { - MergeChannelId(other.ChannelId); - } - if (other.HasCurrentMembers) { - CurrentMembers = other.CurrentMembers; - } - if (other.HasState) { - MergeState(other.State); - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasChannelId) { - subBuilder.MergeFrom(ChannelId); - } - input.ReadMessage(subBuilder, extensionRegistry); - ChannelId = subBuilder.BuildPartial(); - break; - } - case 16: { - CurrentMembers = input.ReadUInt32(); - break; - } - case 26: { - global::bnet.protocol.channel.ChannelState.Builder subBuilder = global::bnet.protocol.channel.ChannelState.CreateBuilder(); - if (HasState) { - subBuilder.MergeFrom(State); - } - input.ReadMessage(subBuilder, extensionRegistry); - State = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasChannelId { - get { return result.HasChannelId; } - } - public global::bnet.protocol.EntityId ChannelId { - get { return result.ChannelId; } - set { SetChannelId(value); } - } - public Builder SetChannelId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasChannelId = true; - result.channelId_ = value; - return this; - } - public Builder SetChannelId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasChannelId = true; - result.channelId_ = builderForValue.Build(); - return this; - } - public Builder MergeChannelId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasChannelId && - result.channelId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.channelId_ = global::bnet.protocol.EntityId.CreateBuilder(result.channelId_).MergeFrom(value).BuildPartial(); - } else { - result.channelId_ = value; - } - result.hasChannelId = true; - return this; - } - public Builder ClearChannelId() { - result.hasChannelId = false; - result.channelId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasCurrentMembers { - get { return result.HasCurrentMembers; } - } - public uint CurrentMembers { - get { return result.CurrentMembers; } - set { SetCurrentMembers(value); } - } - public Builder SetCurrentMembers(uint value) { - result.hasCurrentMembers = true; - result.currentMembers_ = value; - return this; - } - public Builder ClearCurrentMembers() { - result.hasCurrentMembers = false; - result.currentMembers_ = 0; - return this; - } - - public bool HasState { - get { return result.HasState; } - } - public global::bnet.protocol.channel.ChannelState State { - get { return result.State; } - set { SetState(value); } - } - public Builder SetState(global::bnet.protocol.channel.ChannelState value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasState = true; - result.state_ = value; - return this; - } - public Builder SetState(global::bnet.protocol.channel.ChannelState.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasState = true; - result.state_ = builderForValue.Build(); - return this; - } - public Builder MergeState(global::bnet.protocol.channel.ChannelState value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasState && - result.state_ != global::bnet.protocol.channel.ChannelState.DefaultInstance) { - result.state_ = global::bnet.protocol.channel.ChannelState.CreateBuilder(result.state_).MergeFrom(value).BuildPartial(); - } else { - result.state_ = value; - } - result.hasState = true; - return this; - } - public Builder ClearState() { - result.hasState = false; - result.state_ = global::bnet.protocol.channel.ChannelState.DefaultInstance; - return this; - } - } - static ChannelDescription() { - object.ReferenceEquals(global::bnet.protocol.channel.ChannelTypes.Descriptor, null); - } - } - - public sealed partial class ChannelInfo : pb::ExtendableMessage { - private static readonly ChannelInfo defaultInstance = new Builder().BuildPartial(); - public static ChannelInfo DefaultInstance { - get { return defaultInstance; } - } - - public override ChannelInfo DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ChannelInfo ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_ChannelInfo__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_ChannelInfo__FieldAccessorTable; } - } - - public const int DescriptionFieldNumber = 1; - private bool hasDescription; - private global::bnet.protocol.channel.ChannelDescription description_ = global::bnet.protocol.channel.ChannelDescription.DefaultInstance; - public bool HasDescription { - get { return hasDescription; } - } - public global::bnet.protocol.channel.ChannelDescription Description { - get { return description_; } - } - - public const int MemberFieldNumber = 2; - private pbc::PopsicleList member_ = new pbc::PopsicleList(); - public scg::IList MemberList { - get { return member_; } - } - public int MemberCount { - get { return member_.Count; } - } - public global::bnet.protocol.channel.Member GetMember(int index) { - return member_[index]; - } - - public override bool IsInitialized { - get { - if (!hasDescription) return false; - if (!Description.IsInitialized) return false; - foreach (global::bnet.protocol.channel.Member element in MemberList) { - if (!element.IsInitialized) return false; - } - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - if (HasDescription) { - output.WriteMessage(1, Description); - } - foreach (global::bnet.protocol.channel.Member element in MemberList) { - output.WriteMessage(2, element); - } - extensionWriter.WriteUntil(10000, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasDescription) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Description); - } - foreach (global::bnet.protocol.channel.Member element in MemberList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ChannelInfo ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ChannelInfo ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ChannelInfo ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ChannelInfo ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ChannelInfo ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ChannelInfo ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ChannelInfo ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ChannelInfo ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ChannelInfo ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ChannelInfo ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ChannelInfo prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ChannelInfo result = new ChannelInfo(); - - protected override ChannelInfo MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ChannelInfo(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.channel.ChannelInfo.Descriptor; } - } - - public override ChannelInfo DefaultInstanceForType { - get { return global::bnet.protocol.channel.ChannelInfo.DefaultInstance; } - } - - public override ChannelInfo BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.member_.MakeReadOnly(); - ChannelInfo returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ChannelInfo) { - return MergeFrom((ChannelInfo) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ChannelInfo other) { - if (other == global::bnet.protocol.channel.ChannelInfo.DefaultInstance) return this; - if (other.HasDescription) { - MergeDescription(other.Description); - } - if (other.member_.Count != 0) { - base.AddRange(other.member_, result.member_); - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.channel.ChannelDescription.Builder subBuilder = global::bnet.protocol.channel.ChannelDescription.CreateBuilder(); - if (HasDescription) { - subBuilder.MergeFrom(Description); - } - input.ReadMessage(subBuilder, extensionRegistry); - Description = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.channel.Member.Builder subBuilder = global::bnet.protocol.channel.Member.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddMember(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public bool HasDescription { - get { return result.HasDescription; } - } - public global::bnet.protocol.channel.ChannelDescription Description { - get { return result.Description; } - set { SetDescription(value); } - } - public Builder SetDescription(global::bnet.protocol.channel.ChannelDescription value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasDescription = true; - result.description_ = value; - return this; - } - public Builder SetDescription(global::bnet.protocol.channel.ChannelDescription.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasDescription = true; - result.description_ = builderForValue.Build(); - return this; - } - public Builder MergeDescription(global::bnet.protocol.channel.ChannelDescription value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasDescription && - result.description_ != global::bnet.protocol.channel.ChannelDescription.DefaultInstance) { - result.description_ = global::bnet.protocol.channel.ChannelDescription.CreateBuilder(result.description_).MergeFrom(value).BuildPartial(); - } else { - result.description_ = value; - } - result.hasDescription = true; - return this; - } - public Builder ClearDescription() { - result.hasDescription = false; - result.description_ = global::bnet.protocol.channel.ChannelDescription.DefaultInstance; - return this; - } - - public pbc::IPopsicleList MemberList { - get { return result.member_; } - } - public int MemberCount { - get { return result.MemberCount; } - } - public global::bnet.protocol.channel.Member GetMember(int index) { - return result.GetMember(index); - } - public Builder SetMember(int index, global::bnet.protocol.channel.Member value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.member_[index] = value; - return this; - } - public Builder SetMember(int index, global::bnet.protocol.channel.Member.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.member_[index] = builderForValue.Build(); - return this; - } - public Builder AddMember(global::bnet.protocol.channel.Member value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.member_.Add(value); - return this; - } - public Builder AddMember(global::bnet.protocol.channel.Member.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.member_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeMember(scg::IEnumerable values) { - base.AddRange(values, result.member_); - return this; - } - public Builder ClearMember() { - result.member_.Clear(); - return this; - } - } - static ChannelInfo() { - object.ReferenceEquals(global::bnet.protocol.channel.ChannelTypes.Descriptor, null); - } - } - - public sealed partial class GetChannelInfoRequest : pb::GeneratedMessage { - private static readonly GetChannelInfoRequest defaultInstance = new Builder().BuildPartial(); - public static GetChannelInfoRequest DefaultInstance { - get { return defaultInstance; } - } - - public override GetChannelInfoRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override GetChannelInfoRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_GetChannelInfoRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_GetChannelInfoRequest__FieldAccessorTable; } - } - - public const int AgentIdFieldNumber = 1; - private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasAgentId { - get { return hasAgentId; } - } - public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } - } - - public const int ChannelIdFieldNumber = 2; - private bool hasChannelId; - private global::bnet.protocol.EntityId channelId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasChannelId { - get { return hasChannelId; } - } - public global::bnet.protocol.EntityId ChannelId { - get { return channelId_; } - } - - public override bool IsInitialized { - get { - if (!hasChannelId) return false; - if (HasAgentId) { - if (!AgentId.IsInitialized) return false; - } - if (!ChannelId.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasAgentId) { - output.WriteMessage(1, AgentId); - } - if (HasChannelId) { - output.WriteMessage(2, ChannelId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasAgentId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); - } - if (HasChannelId) { - size += pb::CodedOutputStream.ComputeMessageSize(2, ChannelId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static GetChannelInfoRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static GetChannelInfoRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static GetChannelInfoRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static GetChannelInfoRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static GetChannelInfoRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static GetChannelInfoRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static GetChannelInfoRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static GetChannelInfoRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static GetChannelInfoRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static GetChannelInfoRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(GetChannelInfoRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - GetChannelInfoRequest result = new GetChannelInfoRequest(); - - protected override GetChannelInfoRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new GetChannelInfoRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.channel.GetChannelInfoRequest.Descriptor; } - } - - public override GetChannelInfoRequest DefaultInstanceForType { - get { return global::bnet.protocol.channel.GetChannelInfoRequest.DefaultInstance; } - } - - public override GetChannelInfoRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - GetChannelInfoRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is GetChannelInfoRequest) { - return MergeFrom((GetChannelInfoRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(GetChannelInfoRequest other) { - if (other == global::bnet.protocol.channel.GetChannelInfoRequest.DefaultInstance) return this; - if (other.HasAgentId) { - MergeAgentId(other.AgentId); - } - if (other.HasChannelId) { - MergeChannelId(other.ChannelId); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { - subBuilder.MergeFrom(AgentId); - } - input.ReadMessage(subBuilder, extensionRegistry); - AgentId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasChannelId) { - subBuilder.MergeFrom(ChannelId); - } - input.ReadMessage(subBuilder, extensionRegistry); - ChannelId = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasAgentId { - get { return result.HasAgentId; } - } - public global::bnet.protocol.EntityId AgentId { - get { return result.AgentId; } - set { SetAgentId(value); } - } - public Builder SetAgentId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasAgentId = true; - result.agentId_ = value; - return this; - } - public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasAgentId = true; - result.agentId_ = builderForValue.Build(); - return this; - } - public Builder MergeAgentId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && - result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); - } else { - result.agentId_ = value; - } - result.hasAgentId = true; - return this; - } - public Builder ClearAgentId() { - result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasChannelId { - get { return result.HasChannelId; } - } - public global::bnet.protocol.EntityId ChannelId { - get { return result.ChannelId; } - set { SetChannelId(value); } - } - public Builder SetChannelId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasChannelId = true; - result.channelId_ = value; - return this; - } - public Builder SetChannelId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasChannelId = true; - result.channelId_ = builderForValue.Build(); - return this; - } - public Builder MergeChannelId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasChannelId && - result.channelId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.channelId_ = global::bnet.protocol.EntityId.CreateBuilder(result.channelId_).MergeFrom(value).BuildPartial(); - } else { - result.channelId_ = value; - } - result.hasChannelId = true; - return this; - } - public Builder ClearChannelId() { - result.hasChannelId = false; - result.channelId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - } - static GetChannelInfoRequest() { - object.ReferenceEquals(global::bnet.protocol.channel.ChannelTypes.Descriptor, null); - } - } - - public sealed partial class GetChannelInfoResponse : pb::GeneratedMessage { - private static readonly GetChannelInfoResponse defaultInstance = new Builder().BuildPartial(); - public static GetChannelInfoResponse DefaultInstance { - get { return defaultInstance; } - } - - public override GetChannelInfoResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override GetChannelInfoResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_GetChannelInfoResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_GetChannelInfoResponse__FieldAccessorTable; } - } - - public const int ChannelInfoFieldNumber = 1; - private bool hasChannelInfo; - private global::bnet.protocol.channel.ChannelInfo channelInfo_ = global::bnet.protocol.channel.ChannelInfo.DefaultInstance; - public bool HasChannelInfo { - get { return hasChannelInfo; } - } - public global::bnet.protocol.channel.ChannelInfo ChannelInfo { - get { return channelInfo_; } - } - - public override bool IsInitialized { - get { - if (HasChannelInfo) { - if (!ChannelInfo.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasChannelInfo) { - output.WriteMessage(1, ChannelInfo); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasChannelInfo) { - size += pb::CodedOutputStream.ComputeMessageSize(1, ChannelInfo); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static GetChannelInfoResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static GetChannelInfoResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static GetChannelInfoResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static GetChannelInfoResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static GetChannelInfoResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static GetChannelInfoResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static GetChannelInfoResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static GetChannelInfoResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static GetChannelInfoResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static GetChannelInfoResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(GetChannelInfoResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - GetChannelInfoResponse result = new GetChannelInfoResponse(); - - protected override GetChannelInfoResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new GetChannelInfoResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.channel.GetChannelInfoResponse.Descriptor; } - } - - public override GetChannelInfoResponse DefaultInstanceForType { - get { return global::bnet.protocol.channel.GetChannelInfoResponse.DefaultInstance; } - } - - public override GetChannelInfoResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - GetChannelInfoResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is GetChannelInfoResponse) { - return MergeFrom((GetChannelInfoResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(GetChannelInfoResponse other) { - if (other == global::bnet.protocol.channel.GetChannelInfoResponse.DefaultInstance) return this; - if (other.HasChannelInfo) { - MergeChannelInfo(other.ChannelInfo); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.channel.ChannelInfo.Builder subBuilder = global::bnet.protocol.channel.ChannelInfo.CreateBuilder(); - if (HasChannelInfo) { - subBuilder.MergeFrom(ChannelInfo); - } - input.ReadMessage(subBuilder, extensionRegistry); - ChannelInfo = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasChannelInfo { - get { return result.HasChannelInfo; } - } - public global::bnet.protocol.channel.ChannelInfo ChannelInfo { - get { return result.ChannelInfo; } - set { SetChannelInfo(value); } - } - public Builder SetChannelInfo(global::bnet.protocol.channel.ChannelInfo value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasChannelInfo = true; - result.channelInfo_ = value; - return this; - } - public Builder SetChannelInfo(global::bnet.protocol.channel.ChannelInfo.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasChannelInfo = true; - result.channelInfo_ = builderForValue.Build(); - return this; - } - public Builder MergeChannelInfo(global::bnet.protocol.channel.ChannelInfo value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasChannelInfo && - result.channelInfo_ != global::bnet.protocol.channel.ChannelInfo.DefaultInstance) { - result.channelInfo_ = global::bnet.protocol.channel.ChannelInfo.CreateBuilder(result.channelInfo_).MergeFrom(value).BuildPartial(); - } else { - result.channelInfo_ = value; - } - result.hasChannelInfo = true; - return this; - } - public Builder ClearChannelInfo() { - result.hasChannelInfo = false; - result.channelInfo_ = global::bnet.protocol.channel.ChannelInfo.DefaultInstance; - return this; - } - } - static GetChannelInfoResponse() { - object.ReferenceEquals(global::bnet.protocol.channel.ChannelTypes.Descriptor, null); - } - } - - public sealed partial class GetChannelIdRequest : pb::GeneratedMessage { - private static readonly GetChannelIdRequest defaultInstance = new Builder().BuildPartial(); - public static GetChannelIdRequest DefaultInstance { - get { return defaultInstance; } - } - - public override GetChannelIdRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override GetChannelIdRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_GetChannelIdRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_GetChannelIdRequest__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static GetChannelIdRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static GetChannelIdRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static GetChannelIdRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static GetChannelIdRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static GetChannelIdRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static GetChannelIdRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static GetChannelIdRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static GetChannelIdRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static GetChannelIdRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static GetChannelIdRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(GetChannelIdRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - GetChannelIdRequest result = new GetChannelIdRequest(); - - protected override GetChannelIdRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new GetChannelIdRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.channel.GetChannelIdRequest.Descriptor; } - } - - public override GetChannelIdRequest DefaultInstanceForType { - get { return global::bnet.protocol.channel.GetChannelIdRequest.DefaultInstance; } - } - - public override GetChannelIdRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - GetChannelIdRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is GetChannelIdRequest) { - return MergeFrom((GetChannelIdRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(GetChannelIdRequest other) { - if (other == global::bnet.protocol.channel.GetChannelIdRequest.DefaultInstance) return this; - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - } - } - } - - } - static GetChannelIdRequest() { - object.ReferenceEquals(global::bnet.protocol.channel.ChannelTypes.Descriptor, null); - } - } - - public sealed partial class GetChannelIdResponse : pb::GeneratedMessage { - private static readonly GetChannelIdResponse defaultInstance = new Builder().BuildPartial(); - public static GetChannelIdResponse DefaultInstance { - get { return defaultInstance; } - } - - public override GetChannelIdResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override GetChannelIdResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_GetChannelIdResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_GetChannelIdResponse__FieldAccessorTable; } - } - - public const int ChannelIdFieldNumber = 1; - private bool hasChannelId; - private global::bnet.protocol.EntityId channelId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasChannelId { - get { return hasChannelId; } - } - public global::bnet.protocol.EntityId ChannelId { - get { return channelId_; } - } - - public override bool IsInitialized { - get { - if (HasChannelId) { - if (!ChannelId.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasChannelId) { - output.WriteMessage(1, ChannelId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasChannelId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, ChannelId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static GetChannelIdResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static GetChannelIdResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static GetChannelIdResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static GetChannelIdResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static GetChannelIdResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static GetChannelIdResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static GetChannelIdResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static GetChannelIdResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static GetChannelIdResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static GetChannelIdResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(GetChannelIdResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - GetChannelIdResponse result = new GetChannelIdResponse(); - - protected override GetChannelIdResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new GetChannelIdResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.channel.GetChannelIdResponse.Descriptor; } - } - - public override GetChannelIdResponse DefaultInstanceForType { - get { return global::bnet.protocol.channel.GetChannelIdResponse.DefaultInstance; } - } - - public override GetChannelIdResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - GetChannelIdResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is GetChannelIdResponse) { - return MergeFrom((GetChannelIdResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(GetChannelIdResponse other) { - if (other == global::bnet.protocol.channel.GetChannelIdResponse.DefaultInstance) return this; - if (other.HasChannelId) { - MergeChannelId(other.ChannelId); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasChannelId) { - subBuilder.MergeFrom(ChannelId); - } - input.ReadMessage(subBuilder, extensionRegistry); - ChannelId = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasChannelId { - get { return result.HasChannelId; } - } - public global::bnet.protocol.EntityId ChannelId { - get { return result.ChannelId; } - set { SetChannelId(value); } - } - public Builder SetChannelId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasChannelId = true; - result.channelId_ = value; - return this; - } - public Builder SetChannelId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasChannelId = true; - result.channelId_ = builderForValue.Build(); - return this; - } - public Builder MergeChannelId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasChannelId && - result.channelId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.channelId_ = global::bnet.protocol.EntityId.CreateBuilder(result.channelId_).MergeFrom(value).BuildPartial(); - } else { - result.channelId_ = value; - } - result.hasChannelId = true; - return this; - } - public Builder ClearChannelId() { - result.hasChannelId = false; - result.channelId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - } - static GetChannelIdResponse() { - object.ReferenceEquals(global::bnet.protocol.channel.ChannelTypes.Descriptor, null); - } - } - - public sealed partial class CreateChannelRequest : pb::GeneratedMessage { - private static readonly CreateChannelRequest defaultInstance = new Builder().BuildPartial(); - public static CreateChannelRequest DefaultInstance { - get { return defaultInstance; } - } - - public override CreateChannelRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override CreateChannelRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_CreateChannelRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_CreateChannelRequest__FieldAccessorTable; } - } - - public const int AgentIdentityFieldNumber = 1; - private bool hasAgentIdentity; - private global::bnet.protocol.Identity agentIdentity_ = global::bnet.protocol.Identity.DefaultInstance; - public bool HasAgentIdentity { - get { return hasAgentIdentity; } - } - public global::bnet.protocol.Identity AgentIdentity { - get { return agentIdentity_; } - } - - public const int StateFieldNumber = 2; - private bool hasState; - private global::bnet.protocol.channel.ChannelState state_ = global::bnet.protocol.channel.ChannelState.DefaultInstance; - public bool HasState { - get { return hasState; } - } - public global::bnet.protocol.channel.ChannelState State { - get { return state_; } - } - - public const int ChannelIdFieldNumber = 3; - private bool hasChannelId; - private global::bnet.protocol.EntityId channelId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasChannelId { - get { return hasChannelId; } - } - public global::bnet.protocol.EntityId ChannelId { - get { return channelId_; } - } - - public const int ObjectIdFieldNumber = 4; - private bool hasObjectId; - private ulong objectId_ = 0UL; - public bool HasObjectId { - get { return hasObjectId; } - } - public ulong ObjectId { - get { return objectId_; } - } - - public override bool IsInitialized { - get { - if (HasAgentIdentity) { - if (!AgentIdentity.IsInitialized) return false; - } - if (HasState) { - if (!State.IsInitialized) return false; - } - if (HasChannelId) { - if (!ChannelId.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasAgentIdentity) { - output.WriteMessage(1, AgentIdentity); - } - if (HasState) { - output.WriteMessage(2, State); - } - if (HasChannelId) { - output.WriteMessage(3, ChannelId); - } - if (HasObjectId) { - output.WriteUInt64(4, ObjectId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasAgentIdentity) { - size += pb::CodedOutputStream.ComputeMessageSize(1, AgentIdentity); - } - if (HasState) { - size += pb::CodedOutputStream.ComputeMessageSize(2, State); - } - if (HasChannelId) { - size += pb::CodedOutputStream.ComputeMessageSize(3, ChannelId); - } - if (HasObjectId) { - size += pb::CodedOutputStream.ComputeUInt64Size(4, ObjectId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static CreateChannelRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CreateChannelRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CreateChannelRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CreateChannelRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CreateChannelRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CreateChannelRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CreateChannelRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CreateChannelRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CreateChannelRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CreateChannelRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CreateChannelRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - CreateChannelRequest result = new CreateChannelRequest(); - - protected override CreateChannelRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new CreateChannelRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.channel.CreateChannelRequest.Descriptor; } - } - - public override CreateChannelRequest DefaultInstanceForType { - get { return global::bnet.protocol.channel.CreateChannelRequest.DefaultInstance; } - } - - public override CreateChannelRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - CreateChannelRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CreateChannelRequest) { - return MergeFrom((CreateChannelRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CreateChannelRequest other) { - if (other == global::bnet.protocol.channel.CreateChannelRequest.DefaultInstance) return this; - if (other.HasAgentIdentity) { - MergeAgentIdentity(other.AgentIdentity); - } - if (other.HasState) { - MergeState(other.State); - } - if (other.HasChannelId) { - MergeChannelId(other.ChannelId); - } - if (other.HasObjectId) { - ObjectId = other.ObjectId; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.Identity.Builder subBuilder = global::bnet.protocol.Identity.CreateBuilder(); - if (HasAgentIdentity) { - subBuilder.MergeFrom(AgentIdentity); - } - input.ReadMessage(subBuilder, extensionRegistry); - AgentIdentity = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.channel.ChannelState.Builder subBuilder = global::bnet.protocol.channel.ChannelState.CreateBuilder(); - if (HasState) { - subBuilder.MergeFrom(State); - } - input.ReadMessage(subBuilder, extensionRegistry); - State = subBuilder.BuildPartial(); - break; - } - case 26: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasChannelId) { - subBuilder.MergeFrom(ChannelId); - } - input.ReadMessage(subBuilder, extensionRegistry); - ChannelId = subBuilder.BuildPartial(); - break; - } - case 32: { - ObjectId = input.ReadUInt64(); - break; - } - } - } - } - - - public bool HasAgentIdentity { - get { return result.HasAgentIdentity; } - } - public global::bnet.protocol.Identity AgentIdentity { - get { return result.AgentIdentity; } - set { SetAgentIdentity(value); } - } - public Builder SetAgentIdentity(global::bnet.protocol.Identity value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasAgentIdentity = true; - result.agentIdentity_ = value; - return this; - } - public Builder SetAgentIdentity(global::bnet.protocol.Identity.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasAgentIdentity = true; - result.agentIdentity_ = builderForValue.Build(); - return this; - } - public Builder MergeAgentIdentity(global::bnet.protocol.Identity value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentIdentity && - result.agentIdentity_ != global::bnet.protocol.Identity.DefaultInstance) { - result.agentIdentity_ = global::bnet.protocol.Identity.CreateBuilder(result.agentIdentity_).MergeFrom(value).BuildPartial(); - } else { - result.agentIdentity_ = value; - } - result.hasAgentIdentity = true; - return this; - } - public Builder ClearAgentIdentity() { - result.hasAgentIdentity = false; - result.agentIdentity_ = global::bnet.protocol.Identity.DefaultInstance; - return this; - } - - public bool HasState { - get { return result.HasState; } - } - public global::bnet.protocol.channel.ChannelState State { - get { return result.State; } - set { SetState(value); } - } - public Builder SetState(global::bnet.protocol.channel.ChannelState value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasState = true; - result.state_ = value; - return this; - } - public Builder SetState(global::bnet.protocol.channel.ChannelState.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasState = true; - result.state_ = builderForValue.Build(); - return this; - } - public Builder MergeState(global::bnet.protocol.channel.ChannelState value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasState && - result.state_ != global::bnet.protocol.channel.ChannelState.DefaultInstance) { - result.state_ = global::bnet.protocol.channel.ChannelState.CreateBuilder(result.state_).MergeFrom(value).BuildPartial(); - } else { - result.state_ = value; - } - result.hasState = true; - return this; - } - public Builder ClearState() { - result.hasState = false; - result.state_ = global::bnet.protocol.channel.ChannelState.DefaultInstance; - return this; - } - - public bool HasChannelId { - get { return result.HasChannelId; } - } - public global::bnet.protocol.EntityId ChannelId { - get { return result.ChannelId; } - set { SetChannelId(value); } - } - public Builder SetChannelId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasChannelId = true; - result.channelId_ = value; - return this; - } - public Builder SetChannelId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasChannelId = true; - result.channelId_ = builderForValue.Build(); - return this; - } - public Builder MergeChannelId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasChannelId && - result.channelId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.channelId_ = global::bnet.protocol.EntityId.CreateBuilder(result.channelId_).MergeFrom(value).BuildPartial(); - } else { - result.channelId_ = value; - } - result.hasChannelId = true; - return this; - } - public Builder ClearChannelId() { - result.hasChannelId = false; - result.channelId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasObjectId { - get { return result.HasObjectId; } - } - public ulong ObjectId { - get { return result.ObjectId; } - set { SetObjectId(value); } - } - public Builder SetObjectId(ulong value) { - result.hasObjectId = true; - result.objectId_ = value; - return this; - } - public Builder ClearObjectId() { - result.hasObjectId = false; - result.objectId_ = 0UL; - return this; - } - } - static CreateChannelRequest() { - object.ReferenceEquals(global::bnet.protocol.channel.ChannelTypes.Descriptor, null); - } - } - - public sealed partial class CreateChannelResponse : pb::GeneratedMessage { - private static readonly CreateChannelResponse defaultInstance = new Builder().BuildPartial(); - public static CreateChannelResponse DefaultInstance { - get { return defaultInstance; } - } - - public override CreateChannelResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override CreateChannelResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_CreateChannelResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_CreateChannelResponse__FieldAccessorTable; } - } - - public const int ObjectIdFieldNumber = 1; - private bool hasObjectId; - private ulong objectId_ = 0UL; - public bool HasObjectId { - get { return hasObjectId; } - } - public ulong ObjectId { - get { return objectId_; } - } - - public const int ChannelIdFieldNumber = 2; - private bool hasChannelId; - private global::bnet.protocol.EntityId channelId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasChannelId { - get { return hasChannelId; } - } - public global::bnet.protocol.EntityId ChannelId { - get { return channelId_; } - } - - public override bool IsInitialized { - get { - if (!hasObjectId) return false; - if (HasChannelId) { - if (!ChannelId.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasObjectId) { - output.WriteUInt64(1, ObjectId); - } - if (HasChannelId) { - output.WriteMessage(2, ChannelId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasObjectId) { - size += pb::CodedOutputStream.ComputeUInt64Size(1, ObjectId); - } - if (HasChannelId) { - size += pb::CodedOutputStream.ComputeMessageSize(2, ChannelId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static CreateChannelResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CreateChannelResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CreateChannelResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CreateChannelResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CreateChannelResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CreateChannelResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CreateChannelResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CreateChannelResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CreateChannelResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CreateChannelResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CreateChannelResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - CreateChannelResponse result = new CreateChannelResponse(); - - protected override CreateChannelResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new CreateChannelResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.channel.CreateChannelResponse.Descriptor; } - } - - public override CreateChannelResponse DefaultInstanceForType { - get { return global::bnet.protocol.channel.CreateChannelResponse.DefaultInstance; } - } - - public override CreateChannelResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - CreateChannelResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CreateChannelResponse) { - return MergeFrom((CreateChannelResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CreateChannelResponse other) { - if (other == global::bnet.protocol.channel.CreateChannelResponse.DefaultInstance) return this; - if (other.HasObjectId) { - ObjectId = other.ObjectId; - } - if (other.HasChannelId) { - MergeChannelId(other.ChannelId); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - ObjectId = input.ReadUInt64(); - break; - } - case 18: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasChannelId) { - subBuilder.MergeFrom(ChannelId); - } - input.ReadMessage(subBuilder, extensionRegistry); - ChannelId = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasObjectId { - get { return result.HasObjectId; } - } - public ulong ObjectId { - get { return result.ObjectId; } - set { SetObjectId(value); } - } - public Builder SetObjectId(ulong value) { - result.hasObjectId = true; - result.objectId_ = value; - return this; - } - public Builder ClearObjectId() { - result.hasObjectId = false; - result.objectId_ = 0UL; - return this; - } - - public bool HasChannelId { - get { return result.HasChannelId; } - } - public global::bnet.protocol.EntityId ChannelId { - get { return result.ChannelId; } - set { SetChannelId(value); } - } - public Builder SetChannelId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasChannelId = true; - result.channelId_ = value; - return this; - } - public Builder SetChannelId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasChannelId = true; - result.channelId_ = builderForValue.Build(); - return this; - } - public Builder MergeChannelId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasChannelId && - result.channelId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.channelId_ = global::bnet.protocol.EntityId.CreateBuilder(result.channelId_).MergeFrom(value).BuildPartial(); - } else { - result.channelId_ = value; - } - result.hasChannelId = true; - return this; - } - public Builder ClearChannelId() { - result.hasChannelId = false; - result.channelId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - } - static CreateChannelResponse() { - object.ReferenceEquals(global::bnet.protocol.channel.ChannelTypes.Descriptor, null); - } - } - - public sealed partial class JoinChannelRequest : pb::GeneratedMessage { - private static readonly JoinChannelRequest defaultInstance = new Builder().BuildPartial(); - public static JoinChannelRequest DefaultInstance { - get { return defaultInstance; } - } - - public override JoinChannelRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override JoinChannelRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_JoinChannelRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_JoinChannelRequest__FieldAccessorTable; } - } - - public const int AgentIdentityFieldNumber = 1; - private bool hasAgentIdentity; - private global::bnet.protocol.Identity agentIdentity_ = global::bnet.protocol.Identity.DefaultInstance; - public bool HasAgentIdentity { - get { return hasAgentIdentity; } - } - public global::bnet.protocol.Identity AgentIdentity { - get { return agentIdentity_; } - } - - public const int ChannelIdFieldNumber = 2; - private bool hasChannelId; - private global::bnet.protocol.EntityId channelId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasChannelId { - get { return hasChannelId; } - } - public global::bnet.protocol.EntityId ChannelId { - get { return channelId_; } - } - - public const int ObjectIdFieldNumber = 3; - private bool hasObjectId; - private ulong objectId_ = 0UL; - public bool HasObjectId { - get { return hasObjectId; } - } - public ulong ObjectId { - get { return objectId_; } - } - - public const int FriendAccountIdFieldNumber = 4; - private pbc::PopsicleList friendAccountId_ = new pbc::PopsicleList(); - public scg::IList FriendAccountIdList { - get { return friendAccountId_; } - } - public int FriendAccountIdCount { - get { return friendAccountId_.Count; } - } - public global::bnet.protocol.EntityId GetFriendAccountId(int index) { - return friendAccountId_[index]; - } - - public override bool IsInitialized { - get { - if (!hasChannelId) return false; - if (!hasObjectId) return false; - if (HasAgentIdentity) { - if (!AgentIdentity.IsInitialized) return false; - } - if (!ChannelId.IsInitialized) return false; - foreach (global::bnet.protocol.EntityId element in FriendAccountIdList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasAgentIdentity) { - output.WriteMessage(1, AgentIdentity); - } - if (HasChannelId) { - output.WriteMessage(2, ChannelId); - } - if (HasObjectId) { - output.WriteUInt64(3, ObjectId); - } - foreach (global::bnet.protocol.EntityId element in FriendAccountIdList) { - output.WriteMessage(4, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasAgentIdentity) { - size += pb::CodedOutputStream.ComputeMessageSize(1, AgentIdentity); - } - if (HasChannelId) { - size += pb::CodedOutputStream.ComputeMessageSize(2, ChannelId); - } - if (HasObjectId) { - size += pb::CodedOutputStream.ComputeUInt64Size(3, ObjectId); - } - foreach (global::bnet.protocol.EntityId element in FriendAccountIdList) { - size += pb::CodedOutputStream.ComputeMessageSize(4, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static JoinChannelRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static JoinChannelRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static JoinChannelRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static JoinChannelRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static JoinChannelRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static JoinChannelRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static JoinChannelRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static JoinChannelRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static JoinChannelRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static JoinChannelRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(JoinChannelRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - JoinChannelRequest result = new JoinChannelRequest(); - - protected override JoinChannelRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new JoinChannelRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.channel.JoinChannelRequest.Descriptor; } - } - - public override JoinChannelRequest DefaultInstanceForType { - get { return global::bnet.protocol.channel.JoinChannelRequest.DefaultInstance; } - } - - public override JoinChannelRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.friendAccountId_.MakeReadOnly(); - JoinChannelRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is JoinChannelRequest) { - return MergeFrom((JoinChannelRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(JoinChannelRequest other) { - if (other == global::bnet.protocol.channel.JoinChannelRequest.DefaultInstance) return this; - if (other.HasAgentIdentity) { - MergeAgentIdentity(other.AgentIdentity); - } - if (other.HasChannelId) { - MergeChannelId(other.ChannelId); - } - if (other.HasObjectId) { - ObjectId = other.ObjectId; - } - if (other.friendAccountId_.Count != 0) { - base.AddRange(other.friendAccountId_, result.friendAccountId_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.Identity.Builder subBuilder = global::bnet.protocol.Identity.CreateBuilder(); - if (HasAgentIdentity) { - subBuilder.MergeFrom(AgentIdentity); - } - input.ReadMessage(subBuilder, extensionRegistry); - AgentIdentity = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasChannelId) { - subBuilder.MergeFrom(ChannelId); - } - input.ReadMessage(subBuilder, extensionRegistry); - ChannelId = subBuilder.BuildPartial(); - break; - } - case 24: { - ObjectId = input.ReadUInt64(); - break; - } - case 34: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddFriendAccountId(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public bool HasAgentIdentity { - get { return result.HasAgentIdentity; } - } - public global::bnet.protocol.Identity AgentIdentity { - get { return result.AgentIdentity; } - set { SetAgentIdentity(value); } - } - public Builder SetAgentIdentity(global::bnet.protocol.Identity value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasAgentIdentity = true; - result.agentIdentity_ = value; - return this; - } - public Builder SetAgentIdentity(global::bnet.protocol.Identity.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasAgentIdentity = true; - result.agentIdentity_ = builderForValue.Build(); - return this; - } - public Builder MergeAgentIdentity(global::bnet.protocol.Identity value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentIdentity && - result.agentIdentity_ != global::bnet.protocol.Identity.DefaultInstance) { - result.agentIdentity_ = global::bnet.protocol.Identity.CreateBuilder(result.agentIdentity_).MergeFrom(value).BuildPartial(); - } else { - result.agentIdentity_ = value; - } - result.hasAgentIdentity = true; - return this; - } - public Builder ClearAgentIdentity() { - result.hasAgentIdentity = false; - result.agentIdentity_ = global::bnet.protocol.Identity.DefaultInstance; - return this; - } - - public bool HasChannelId { - get { return result.HasChannelId; } - } - public global::bnet.protocol.EntityId ChannelId { - get { return result.ChannelId; } - set { SetChannelId(value); } - } - public Builder SetChannelId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasChannelId = true; - result.channelId_ = value; - return this; - } - public Builder SetChannelId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasChannelId = true; - result.channelId_ = builderForValue.Build(); - return this; - } - public Builder MergeChannelId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasChannelId && - result.channelId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.channelId_ = global::bnet.protocol.EntityId.CreateBuilder(result.channelId_).MergeFrom(value).BuildPartial(); - } else { - result.channelId_ = value; - } - result.hasChannelId = true; - return this; - } - public Builder ClearChannelId() { - result.hasChannelId = false; - result.channelId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasObjectId { - get { return result.HasObjectId; } - } - public ulong ObjectId { - get { return result.ObjectId; } - set { SetObjectId(value); } - } - public Builder SetObjectId(ulong value) { - result.hasObjectId = true; - result.objectId_ = value; - return this; - } - public Builder ClearObjectId() { - result.hasObjectId = false; - result.objectId_ = 0UL; - return this; - } - - public pbc::IPopsicleList FriendAccountIdList { - get { return result.friendAccountId_; } - } - public int FriendAccountIdCount { - get { return result.FriendAccountIdCount; } - } - public global::bnet.protocol.EntityId GetFriendAccountId(int index) { - return result.GetFriendAccountId(index); - } - public Builder SetFriendAccountId(int index, global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.friendAccountId_[index] = value; - return this; - } - public Builder SetFriendAccountId(int index, global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.friendAccountId_[index] = builderForValue.Build(); - return this; - } - public Builder AddFriendAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.friendAccountId_.Add(value); - return this; - } - public Builder AddFriendAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.friendAccountId_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeFriendAccountId(scg::IEnumerable values) { - base.AddRange(values, result.friendAccountId_); - return this; - } - public Builder ClearFriendAccountId() { - result.friendAccountId_.Clear(); - return this; - } - } - static JoinChannelRequest() { - object.ReferenceEquals(global::bnet.protocol.channel.ChannelTypes.Descriptor, null); - } - } - - public sealed partial class JoinChannelResponse : pb::GeneratedMessage { - private static readonly JoinChannelResponse defaultInstance = new Builder().BuildPartial(); - public static JoinChannelResponse DefaultInstance { - get { return defaultInstance; } - } - - public override JoinChannelResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override JoinChannelResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_JoinChannelResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_JoinChannelResponse__FieldAccessorTable; } - } - - public const int ObjectIdFieldNumber = 1; - private bool hasObjectId; - private ulong objectId_ = 0UL; - public bool HasObjectId { - get { return hasObjectId; } - } - public ulong ObjectId { - get { return objectId_; } - } - - public const int RequireFriendValidationFieldNumber = 2; - private bool hasRequireFriendValidation; - private bool requireFriendValidation_ = false; - public bool HasRequireFriendValidation { - get { return hasRequireFriendValidation; } - } - public bool RequireFriendValidation { - get { return requireFriendValidation_; } - } - - public const int PrivilegedAccountFieldNumber = 3; - private pbc::PopsicleList privilegedAccount_ = new pbc::PopsicleList(); - public scg::IList PrivilegedAccountList { - get { return privilegedAccount_; } - } - public int PrivilegedAccountCount { - get { return privilegedAccount_.Count; } - } - public global::bnet.protocol.EntityId GetPrivilegedAccount(int index) { - return privilegedAccount_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::bnet.protocol.EntityId element in PrivilegedAccountList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasObjectId) { - output.WriteUInt64(1, ObjectId); - } - if (HasRequireFriendValidation) { - output.WriteBool(2, RequireFriendValidation); - } - foreach (global::bnet.protocol.EntityId element in PrivilegedAccountList) { - output.WriteMessage(3, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasObjectId) { - size += pb::CodedOutputStream.ComputeUInt64Size(1, ObjectId); - } - if (HasRequireFriendValidation) { - size += pb::CodedOutputStream.ComputeBoolSize(2, RequireFriendValidation); - } - foreach (global::bnet.protocol.EntityId element in PrivilegedAccountList) { - size += pb::CodedOutputStream.ComputeMessageSize(3, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static JoinChannelResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static JoinChannelResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static JoinChannelResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static JoinChannelResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static JoinChannelResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static JoinChannelResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static JoinChannelResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static JoinChannelResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static JoinChannelResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static JoinChannelResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(JoinChannelResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - JoinChannelResponse result = new JoinChannelResponse(); - - protected override JoinChannelResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new JoinChannelResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.channel.JoinChannelResponse.Descriptor; } - } - - public override JoinChannelResponse DefaultInstanceForType { - get { return global::bnet.protocol.channel.JoinChannelResponse.DefaultInstance; } - } - - public override JoinChannelResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.privilegedAccount_.MakeReadOnly(); - JoinChannelResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is JoinChannelResponse) { - return MergeFrom((JoinChannelResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(JoinChannelResponse other) { - if (other == global::bnet.protocol.channel.JoinChannelResponse.DefaultInstance) return this; - if (other.HasObjectId) { - ObjectId = other.ObjectId; - } - if (other.HasRequireFriendValidation) { - RequireFriendValidation = other.RequireFriendValidation; - } - if (other.privilegedAccount_.Count != 0) { - base.AddRange(other.privilegedAccount_, result.privilegedAccount_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - ObjectId = input.ReadUInt64(); - break; - } - case 16: { - RequireFriendValidation = input.ReadBool(); - break; - } - case 26: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddPrivilegedAccount(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public bool HasObjectId { - get { return result.HasObjectId; } - } - public ulong ObjectId { - get { return result.ObjectId; } - set { SetObjectId(value); } - } - public Builder SetObjectId(ulong value) { - result.hasObjectId = true; - result.objectId_ = value; - return this; - } - public Builder ClearObjectId() { - result.hasObjectId = false; - result.objectId_ = 0UL; - return this; - } - - public bool HasRequireFriendValidation { - get { return result.HasRequireFriendValidation; } - } - public bool RequireFriendValidation { - get { return result.RequireFriendValidation; } - set { SetRequireFriendValidation(value); } - } - public Builder SetRequireFriendValidation(bool value) { - result.hasRequireFriendValidation = true; - result.requireFriendValidation_ = value; - return this; - } - public Builder ClearRequireFriendValidation() { - result.hasRequireFriendValidation = false; - result.requireFriendValidation_ = false; - return this; - } - - public pbc::IPopsicleList PrivilegedAccountList { - get { return result.privilegedAccount_; } - } - public int PrivilegedAccountCount { - get { return result.PrivilegedAccountCount; } - } - public global::bnet.protocol.EntityId GetPrivilegedAccount(int index) { - return result.GetPrivilegedAccount(index); - } - public Builder SetPrivilegedAccount(int index, global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.privilegedAccount_[index] = value; - return this; - } - public Builder SetPrivilegedAccount(int index, global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.privilegedAccount_[index] = builderForValue.Build(); - return this; - } - public Builder AddPrivilegedAccount(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.privilegedAccount_.Add(value); - return this; - } - public Builder AddPrivilegedAccount(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.privilegedAccount_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangePrivilegedAccount(scg::IEnumerable values) { - base.AddRange(values, result.privilegedAccount_); - return this; - } - public Builder ClearPrivilegedAccount() { - result.privilegedAccount_.Clear(); - return this; - } - } - static JoinChannelResponse() { - object.ReferenceEquals(global::bnet.protocol.channel.ChannelTypes.Descriptor, null); - } - } - - public sealed partial class FindChannelRequest : pb::GeneratedMessage { - private static readonly FindChannelRequest defaultInstance = new Builder().BuildPartial(); - public static FindChannelRequest DefaultInstance { - get { return defaultInstance; } - } - - public override FindChannelRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override FindChannelRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_FindChannelRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_FindChannelRequest__FieldAccessorTable; } - } - - public const int FilterFieldNumber = 1; - private bool hasFilter; - private global::bnet.protocol.attribute.AttributeFilter filter_ = global::bnet.protocol.attribute.AttributeFilter.DefaultInstance; - public bool HasFilter { - get { return hasFilter; } - } - public global::bnet.protocol.attribute.AttributeFilter Filter { - get { return filter_; } - } - - public override bool IsInitialized { - get { - if (!hasFilter) return false; - if (!Filter.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasFilter) { - output.WriteMessage(1, Filter); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasFilter) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Filter); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static FindChannelRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FindChannelRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FindChannelRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FindChannelRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FindChannelRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FindChannelRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static FindChannelRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static FindChannelRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static FindChannelRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FindChannelRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(FindChannelRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - FindChannelRequest result = new FindChannelRequest(); - - protected override FindChannelRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new FindChannelRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.channel.FindChannelRequest.Descriptor; } - } - - public override FindChannelRequest DefaultInstanceForType { - get { return global::bnet.protocol.channel.FindChannelRequest.DefaultInstance; } - } - - public override FindChannelRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - FindChannelRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is FindChannelRequest) { - return MergeFrom((FindChannelRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(FindChannelRequest other) { - if (other == global::bnet.protocol.channel.FindChannelRequest.DefaultInstance) return this; - if (other.HasFilter) { - MergeFilter(other.Filter); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.attribute.AttributeFilter.Builder subBuilder = global::bnet.protocol.attribute.AttributeFilter.CreateBuilder(); - if (HasFilter) { - subBuilder.MergeFrom(Filter); - } - input.ReadMessage(subBuilder, extensionRegistry); - Filter = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasFilter { - get { return result.HasFilter; } - } - public global::bnet.protocol.attribute.AttributeFilter Filter { - get { return result.Filter; } - set { SetFilter(value); } - } - public Builder SetFilter(global::bnet.protocol.attribute.AttributeFilter value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasFilter = true; - result.filter_ = value; - return this; - } - public Builder SetFilter(global::bnet.protocol.attribute.AttributeFilter.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasFilter = true; - result.filter_ = builderForValue.Build(); - return this; - } - public Builder MergeFilter(global::bnet.protocol.attribute.AttributeFilter value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasFilter && - result.filter_ != global::bnet.protocol.attribute.AttributeFilter.DefaultInstance) { - result.filter_ = global::bnet.protocol.attribute.AttributeFilter.CreateBuilder(result.filter_).MergeFrom(value).BuildPartial(); - } else { - result.filter_ = value; - } - result.hasFilter = true; - return this; - } - public Builder ClearFilter() { - result.hasFilter = false; - result.filter_ = global::bnet.protocol.attribute.AttributeFilter.DefaultInstance; - return this; - } - } - static FindChannelRequest() { - object.ReferenceEquals(global::bnet.protocol.channel.ChannelTypes.Descriptor, null); - } - } - - public sealed partial class FindChannelResponse : pb::GeneratedMessage { - private static readonly FindChannelResponse defaultInstance = new Builder().BuildPartial(); - public static FindChannelResponse DefaultInstance { - get { return defaultInstance; } - } - - public override FindChannelResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override FindChannelResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_FindChannelResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_FindChannelResponse__FieldAccessorTable; } - } - - public const int ChannelFieldNumber = 1; - private pbc::PopsicleList channel_ = new pbc::PopsicleList(); - public scg::IList ChannelList { - get { return channel_; } - } - public int ChannelCount { - get { return channel_.Count; } - } - public global::bnet.protocol.channel.ChannelDescription GetChannel(int index) { - return channel_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::bnet.protocol.channel.ChannelDescription element in ChannelList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::bnet.protocol.channel.ChannelDescription element in ChannelList) { - output.WriteMessage(1, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::bnet.protocol.channel.ChannelDescription element in ChannelList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static FindChannelResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FindChannelResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FindChannelResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FindChannelResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FindChannelResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FindChannelResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static FindChannelResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static FindChannelResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static FindChannelResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FindChannelResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(FindChannelResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - FindChannelResponse result = new FindChannelResponse(); - - protected override FindChannelResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new FindChannelResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.channel.FindChannelResponse.Descriptor; } - } - - public override FindChannelResponse DefaultInstanceForType { - get { return global::bnet.protocol.channel.FindChannelResponse.DefaultInstance; } - } - - public override FindChannelResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.channel_.MakeReadOnly(); - FindChannelResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is FindChannelResponse) { - return MergeFrom((FindChannelResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(FindChannelResponse other) { - if (other == global::bnet.protocol.channel.FindChannelResponse.DefaultInstance) return this; - if (other.channel_.Count != 0) { - base.AddRange(other.channel_, result.channel_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.channel.ChannelDescription.Builder subBuilder = global::bnet.protocol.channel.ChannelDescription.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddChannel(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public pbc::IPopsicleList ChannelList { - get { return result.channel_; } - } - public int ChannelCount { - get { return result.ChannelCount; } - } - public global::bnet.protocol.channel.ChannelDescription GetChannel(int index) { - return result.GetChannel(index); - } - public Builder SetChannel(int index, global::bnet.protocol.channel.ChannelDescription value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.channel_[index] = value; - return this; - } - public Builder SetChannel(int index, global::bnet.protocol.channel.ChannelDescription.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.channel_[index] = builderForValue.Build(); - return this; - } - public Builder AddChannel(global::bnet.protocol.channel.ChannelDescription value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.channel_.Add(value); - return this; - } - public Builder AddChannel(global::bnet.protocol.channel.ChannelDescription.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.channel_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeChannel(scg::IEnumerable values) { - base.AddRange(values, result.channel_); - return this; - } - public Builder ClearChannel() { - result.channel_.Clear(); - return this; - } - } - static FindChannelResponse() { - object.ReferenceEquals(global::bnet.protocol.channel.ChannelTypes.Descriptor, null); - } - } - - public sealed partial class ChannelState : pb::ExtendableMessage { - private static readonly ChannelState defaultInstance = new Builder().BuildPartial(); - public static ChannelState DefaultInstance { - get { return defaultInstance; } - } - - public override ChannelState DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ChannelState ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_ChannelState__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_ChannelState__FieldAccessorTable; } - } - - #region Nested types - public static class Types { - public enum PrivacyLevel { - PRIVACY_LEVEL_OPEN = 1, - PRIVACY_LEVEL_OPEN_INVITATION_AND_FRIEND = 2, - PRIVACY_LEVEL_OPEN_INVITATION = 3, - PRIVACY_LEVEL_CLOSED = 4, - } - - } - #endregion - - public const int MaxMembersFieldNumber = 1; - private bool hasMaxMembers; - private uint maxMembers_ = 0; - public bool HasMaxMembers { - get { return hasMaxMembers; } - } - public uint MaxMembers { - get { return maxMembers_; } - } - - public const int MinMembersFieldNumber = 2; - private bool hasMinMembers; - private uint minMembers_ = 0; - public bool HasMinMembers { - get { return hasMinMembers; } - } - public uint MinMembers { - get { return minMembers_; } - } - - public const int AttributeFieldNumber = 3; - private pbc::PopsicleList attribute_ = new pbc::PopsicleList(); - public scg::IList AttributeList { - get { return attribute_; } - } - public int AttributeCount { - get { return attribute_.Count; } - } - public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { - return attribute_[index]; - } - - public const int InvitationFieldNumber = 4; - private pbc::PopsicleList invitation_ = new pbc::PopsicleList(); - public scg::IList InvitationList { - get { return invitation_; } - } - public int InvitationCount { - get { return invitation_.Count; } - } - public global::bnet.protocol.invitation.Invitation GetInvitation(int index) { - return invitation_[index]; - } - - public const int MaxInvitationsFieldNumber = 5; - private bool hasMaxInvitations; - private uint maxInvitations_ = 0; - public bool HasMaxInvitations { - get { return hasMaxInvitations; } - } - public uint MaxInvitations { - get { return maxInvitations_; } - } - - public const int ReasonFieldNumber = 6; - private bool hasReason; - private uint reason_ = 0; - public bool HasReason { - get { return hasReason; } - } - public uint Reason { - get { return reason_; } - } - - public const int PrivacyLevelFieldNumber = 7; - private bool hasPrivacyLevel; - private global::bnet.protocol.channel.ChannelState.Types.PrivacyLevel privacyLevel_ = global::bnet.protocol.channel.ChannelState.Types.PrivacyLevel.PRIVACY_LEVEL_OPEN; - public bool HasPrivacyLevel { - get { return hasPrivacyLevel; } - } - public global::bnet.protocol.channel.ChannelState.Types.PrivacyLevel PrivacyLevel { - get { return privacyLevel_; } - } - - public const int PublicFieldNumber = 8; - private bool hasPublic; - private bool public_ = false; - public bool HasPublic { - get { return hasPublic; } - } - public bool Public { - get { return public_; } - } - - public const int NameFieldNumber = 9; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int DelegateNameFieldNumber = 10; - private bool hasDelegateName; - private string delegateName_ = ""; - public bool HasDelegateName { - get { return hasDelegateName; } - } - public string DelegateName { - get { return delegateName_; } - } - - public const int ChannelTypeFieldNumber = 11; - private bool hasChannelType; - private string channelType_ = "default"; - public bool HasChannelType { - get { return hasChannelType; } - } - public string ChannelType { - get { return channelType_; } - } - - public override bool IsInitialized { - get { - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - if (!element.IsInitialized) return false; - } - foreach (global::bnet.protocol.invitation.Invitation element in InvitationList) { - if (!element.IsInitialized) return false; - } - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - if (HasMaxMembers) { - output.WriteUInt32(1, MaxMembers); - } - if (HasMinMembers) { - output.WriteUInt32(2, MinMembers); - } - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - output.WriteMessage(3, element); - } - foreach (global::bnet.protocol.invitation.Invitation element in InvitationList) { - output.WriteMessage(4, element); - } - if (HasMaxInvitations) { - output.WriteUInt32(5, MaxInvitations); - } - if (HasReason) { - output.WriteUInt32(6, Reason); - } - if (HasPrivacyLevel) { - output.WriteEnum(7, (int) PrivacyLevel); - } - if (HasPublic) { - output.WriteBool(8, Public); - } - if (HasName) { - output.WriteString(9, Name); - } - if (HasDelegateName) { - output.WriteString(10, DelegateName); - } - if (HasChannelType) { - output.WriteString(11, ChannelType); - } - extensionWriter.WriteUntil(10000, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasMaxMembers) { - size += pb::CodedOutputStream.ComputeUInt32Size(1, MaxMembers); - } - if (HasMinMembers) { - size += pb::CodedOutputStream.ComputeUInt32Size(2, MinMembers); - } - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - size += pb::CodedOutputStream.ComputeMessageSize(3, element); - } - foreach (global::bnet.protocol.invitation.Invitation element in InvitationList) { - size += pb::CodedOutputStream.ComputeMessageSize(4, element); - } - if (HasMaxInvitations) { - size += pb::CodedOutputStream.ComputeUInt32Size(5, MaxInvitations); - } - if (HasReason) { - size += pb::CodedOutputStream.ComputeUInt32Size(6, Reason); - } - if (HasPrivacyLevel) { - size += pb::CodedOutputStream.ComputeEnumSize(7, (int) PrivacyLevel); - } - if (HasPublic) { - size += pb::CodedOutputStream.ComputeBoolSize(8, Public); - } - if (HasName) { - size += pb::CodedOutputStream.ComputeStringSize(9, Name); - } - if (HasDelegateName) { - size += pb::CodedOutputStream.ComputeStringSize(10, DelegateName); - } - if (HasChannelType) { - size += pb::CodedOutputStream.ComputeStringSize(11, ChannelType); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ChannelState ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ChannelState ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ChannelState ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ChannelState ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ChannelState ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ChannelState ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ChannelState ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ChannelState ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ChannelState ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ChannelState ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ChannelState prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ChannelState result = new ChannelState(); - - protected override ChannelState MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ChannelState(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.channel.ChannelState.Descriptor; } - } - - public override ChannelState DefaultInstanceForType { - get { return global::bnet.protocol.channel.ChannelState.DefaultInstance; } - } - - public override ChannelState BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.attribute_.MakeReadOnly(); - result.invitation_.MakeReadOnly(); - ChannelState returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ChannelState) { - return MergeFrom((ChannelState) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ChannelState other) { - if (other == global::bnet.protocol.channel.ChannelState.DefaultInstance) return this; - if (other.HasMaxMembers) { - MaxMembers = other.MaxMembers; - } - if (other.HasMinMembers) { - MinMembers = other.MinMembers; - } - if (other.attribute_.Count != 0) { - base.AddRange(other.attribute_, result.attribute_); - } - if (other.invitation_.Count != 0) { - base.AddRange(other.invitation_, result.invitation_); - } - if (other.HasMaxInvitations) { - MaxInvitations = other.MaxInvitations; - } - if (other.HasReason) { - Reason = other.Reason; - } - if (other.HasPrivacyLevel) { - PrivacyLevel = other.PrivacyLevel; - } - if (other.HasPublic) { - Public = other.Public; - } - if (other.HasName) { - Name = other.Name; - } - if (other.HasDelegateName) { - DelegateName = other.DelegateName; - } - if (other.HasChannelType) { - ChannelType = other.ChannelType; - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - MaxMembers = input.ReadUInt32(); - break; - } - case 16: { - MinMembers = input.ReadUInt32(); - break; - } - case 26: { - global::bnet.protocol.attribute.Attribute.Builder subBuilder = global::bnet.protocol.attribute.Attribute.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddAttribute(subBuilder.BuildPartial()); - break; - } - case 34: { - global::bnet.protocol.invitation.Invitation.Builder subBuilder = global::bnet.protocol.invitation.Invitation.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddInvitation(subBuilder.BuildPartial()); - break; - } - case 40: { - MaxInvitations = input.ReadUInt32(); - break; - } - case 48: { - Reason = input.ReadUInt32(); - break; - } - case 56: { - int rawValue = input.ReadEnum(); - if (!global::System.Enum.IsDefined(typeof(global::bnet.protocol.channel.ChannelState.Types.PrivacyLevel), rawValue)) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(7, (ulong) rawValue); - } else { - PrivacyLevel = (global::bnet.protocol.channel.ChannelState.Types.PrivacyLevel) rawValue; - } - break; - } - case 64: { - Public = input.ReadBool(); - break; - } - case 74: { - Name = input.ReadString(); - break; - } - case 82: { - DelegateName = input.ReadString(); - break; - } - case 90: { - ChannelType = input.ReadString(); - break; - } - } - } - } - - - public bool HasMaxMembers { - get { return result.HasMaxMembers; } - } - public uint MaxMembers { - get { return result.MaxMembers; } - set { SetMaxMembers(value); } - } - public Builder SetMaxMembers(uint value) { - result.hasMaxMembers = true; - result.maxMembers_ = value; - return this; - } - public Builder ClearMaxMembers() { - result.hasMaxMembers = false; - result.maxMembers_ = 0; - return this; - } - - public bool HasMinMembers { - get { return result.HasMinMembers; } - } - public uint MinMembers { - get { return result.MinMembers; } - set { SetMinMembers(value); } - } - public Builder SetMinMembers(uint value) { - result.hasMinMembers = true; - result.minMembers_ = value; - return this; - } - public Builder ClearMinMembers() { - result.hasMinMembers = false; - result.minMembers_ = 0; - return this; - } - - public pbc::IPopsicleList AttributeList { - get { return result.attribute_; } - } - public int AttributeCount { - get { return result.AttributeCount; } - } - public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { - return result.GetAttribute(index); - } - public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.attribute_[index] = value; - return this; - } - public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.attribute_[index] = builderForValue.Build(); - return this; - } - public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.attribute_.Add(value); - return this; - } - public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.attribute_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeAttribute(scg::IEnumerable values) { - base.AddRange(values, result.attribute_); - return this; - } - public Builder ClearAttribute() { - result.attribute_.Clear(); - return this; - } - - public pbc::IPopsicleList InvitationList { - get { return result.invitation_; } - } - public int InvitationCount { - get { return result.InvitationCount; } - } - public global::bnet.protocol.invitation.Invitation GetInvitation(int index) { - return result.GetInvitation(index); - } - public Builder SetInvitation(int index, global::bnet.protocol.invitation.Invitation value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.invitation_[index] = value; - return this; - } - public Builder SetInvitation(int index, global::bnet.protocol.invitation.Invitation.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.invitation_[index] = builderForValue.Build(); - return this; - } - public Builder AddInvitation(global::bnet.protocol.invitation.Invitation value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.invitation_.Add(value); - return this; - } - public Builder AddInvitation(global::bnet.protocol.invitation.Invitation.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.invitation_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeInvitation(scg::IEnumerable values) { - base.AddRange(values, result.invitation_); - return this; - } - public Builder ClearInvitation() { - result.invitation_.Clear(); - return this; - } - - public bool HasMaxInvitations { - get { return result.HasMaxInvitations; } - } - public uint MaxInvitations { - get { return result.MaxInvitations; } - set { SetMaxInvitations(value); } - } - public Builder SetMaxInvitations(uint value) { - result.hasMaxInvitations = true; - result.maxInvitations_ = value; - return this; - } - public Builder ClearMaxInvitations() { - result.hasMaxInvitations = false; - result.maxInvitations_ = 0; - return this; - } - - public bool HasReason { - get { return result.HasReason; } - } - public uint Reason { - get { return result.Reason; } - set { SetReason(value); } - } - public Builder SetReason(uint value) { - result.hasReason = true; - result.reason_ = value; - return this; - } - public Builder ClearReason() { - result.hasReason = false; - result.reason_ = 0; - return this; - } - - public bool HasPrivacyLevel { - get { return result.HasPrivacyLevel; } - } - public global::bnet.protocol.channel.ChannelState.Types.PrivacyLevel PrivacyLevel { - get { return result.PrivacyLevel; } - set { SetPrivacyLevel(value); } - } - public Builder SetPrivacyLevel(global::bnet.protocol.channel.ChannelState.Types.PrivacyLevel value) { - result.hasPrivacyLevel = true; - result.privacyLevel_ = value; - return this; - } - public Builder ClearPrivacyLevel() { - result.hasPrivacyLevel = false; - result.privacyLevel_ = global::bnet.protocol.channel.ChannelState.Types.PrivacyLevel.PRIVACY_LEVEL_OPEN; - return this; - } - - public bool HasPublic { - get { return result.HasPublic; } - } - public bool Public { - get { return result.Public; } - set { SetPublic(value); } - } - public Builder SetPublic(bool value) { - result.hasPublic = true; - result.public_ = value; - return this; - } - public Builder ClearPublic() { - result.hasPublic = false; - result.public_ = false; - return this; - } - - public bool HasName { - get { return result.HasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - result.hasName = false; - result.name_ = ""; - return this; - } - - public bool HasDelegateName { - get { return result.HasDelegateName; } - } - public string DelegateName { - get { return result.DelegateName; } - set { SetDelegateName(value); } - } - public Builder SetDelegateName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasDelegateName = true; - result.delegateName_ = value; - return this; - } - public Builder ClearDelegateName() { - result.hasDelegateName = false; - result.delegateName_ = ""; - return this; - } - - public bool HasChannelType { - get { return result.HasChannelType; } - } - public string ChannelType { - get { return result.ChannelType; } - set { SetChannelType(value); } - } - public Builder SetChannelType(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasChannelType = true; - result.channelType_ = value; - return this; - } - public Builder ClearChannelType() { - result.hasChannelType = false; - result.channelType_ = "default"; - return this; - } - } - static ChannelState() { - object.ReferenceEquals(global::bnet.protocol.channel.ChannelTypes.Descriptor, null); - } - } - - public sealed partial class MemberState : pb::ExtendableMessage { - private static readonly MemberState defaultInstance = new Builder().BuildPartial(); - public static MemberState DefaultInstance { - get { return defaultInstance; } - } - - public override MemberState DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override MemberState ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_MemberState__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_MemberState__FieldAccessorTable; } - } - - public const int AttributeFieldNumber = 1; - private pbc::PopsicleList attribute_ = new pbc::PopsicleList(); - public scg::IList AttributeList { - get { return attribute_; } - } - public int AttributeCount { - get { return attribute_.Count; } - } - public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { - return attribute_[index]; - } - - public const int RoleFieldNumber = 2; - private pbc::PopsicleList role_ = new pbc::PopsicleList(); - public scg::IList RoleList { - get { return pbc::Lists.AsReadOnly(role_); } - } - public int RoleCount { - get { return role_.Count; } - } - public uint GetRole(int index) { - return role_[index]; - } - - public const int PrivilegesFieldNumber = 3; - private bool hasPrivileges; - private ulong privileges_ = 0UL; - public bool HasPrivileges { - get { return hasPrivileges; } - } - public ulong Privileges { - get { return privileges_; } - } - - public override bool IsInitialized { - get { - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - if (!element.IsInitialized) return false; - } - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - output.WriteMessage(1, element); - } - if (role_.Count > 0) { - foreach (uint element in role_) { - output.WriteUInt32(2, element); - } - } - if (HasPrivileges) { - output.WriteUInt64(3, Privileges); - } - extensionWriter.WriteUntil(10000, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - { - int dataSize = 0; - foreach (uint element in RoleList) { - dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); - } - size += dataSize; - size += 1 * role_.Count; - } - if (HasPrivileges) { - size += pb::CodedOutputStream.ComputeUInt64Size(3, Privileges); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static MemberState ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MemberState ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MemberState ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MemberState ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MemberState ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MemberState ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static MemberState ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static MemberState ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static MemberState ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MemberState ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(MemberState prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - MemberState result = new MemberState(); - - protected override MemberState MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new MemberState(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.channel.MemberState.Descriptor; } - } - - public override MemberState DefaultInstanceForType { - get { return global::bnet.protocol.channel.MemberState.DefaultInstance; } - } - - public override MemberState BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.attribute_.MakeReadOnly(); - result.role_.MakeReadOnly(); - MemberState returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is MemberState) { - return MergeFrom((MemberState) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(MemberState other) { - if (other == global::bnet.protocol.channel.MemberState.DefaultInstance) return this; - if (other.attribute_.Count != 0) { - base.AddRange(other.attribute_, result.attribute_); - } - if (other.role_.Count != 0) { - base.AddRange(other.role_, result.role_); - } - if (other.HasPrivileges) { - Privileges = other.Privileges; - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.attribute.Attribute.Builder subBuilder = global::bnet.protocol.attribute.Attribute.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddAttribute(subBuilder.BuildPartial()); - break; - } - case 16: { - AddRole(input.ReadUInt32()); - break; - } - case 24: { - Privileges = input.ReadUInt64(); - break; - } - } - } - } - - - public pbc::IPopsicleList AttributeList { - get { return result.attribute_; } - } - public int AttributeCount { - get { return result.AttributeCount; } - } - public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { - return result.GetAttribute(index); - } - public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.attribute_[index] = value; - return this; - } - public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.attribute_[index] = builderForValue.Build(); - return this; - } - public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.attribute_.Add(value); - return this; - } - public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.attribute_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeAttribute(scg::IEnumerable values) { - base.AddRange(values, result.attribute_); - return this; - } - public Builder ClearAttribute() { - result.attribute_.Clear(); - return this; - } - - public pbc::IPopsicleList RoleList { - get { return result.role_; } - } - public int RoleCount { - get { return result.RoleCount; } - } - public uint GetRole(int index) { - return result.GetRole(index); - } - public Builder SetRole(int index, uint value) { - result.role_[index] = value; - return this; - } - public Builder AddRole(uint value) { - result.role_.Add(value); - return this; - } - public Builder AddRangeRole(scg::IEnumerable values) { - base.AddRange(values, result.role_); - return this; - } - public Builder ClearRole() { - result.role_.Clear(); - return this; - } - - public bool HasPrivileges { - get { return result.HasPrivileges; } - } - public ulong Privileges { - get { return result.Privileges; } - set { SetPrivileges(value); } - } - public Builder SetPrivileges(ulong value) { - result.hasPrivileges = true; - result.privileges_ = value; - return this; - } - public Builder ClearPrivileges() { - result.hasPrivileges = false; - result.privileges_ = 0UL; - return this; - } - } - static MemberState() { - object.ReferenceEquals(global::bnet.protocol.channel.ChannelTypes.Descriptor, null); - } - } - - public sealed partial class Member : pb::GeneratedMessage { - private static readonly Member defaultInstance = new Builder().BuildPartial(); - public static Member DefaultInstance { - get { return defaultInstance; } - } - - public override Member DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override Member ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_Member__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_Member__FieldAccessorTable; } - } - - public const int IdentityFieldNumber = 1; - private bool hasIdentity; - private global::bnet.protocol.Identity identity_ = global::bnet.protocol.Identity.DefaultInstance; - public bool HasIdentity { - get { return hasIdentity; } - } - public global::bnet.protocol.Identity Identity { - get { return identity_; } - } - - public const int StateFieldNumber = 2; - private bool hasState; - private global::bnet.protocol.channel.MemberState state_ = global::bnet.protocol.channel.MemberState.DefaultInstance; - public bool HasState { - get { return hasState; } - } - public global::bnet.protocol.channel.MemberState State { - get { return state_; } - } - - public override bool IsInitialized { - get { - if (!hasIdentity) return false; - if (!hasState) return false; - if (!Identity.IsInitialized) return false; - if (!State.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasIdentity) { - output.WriteMessage(1, Identity); - } - if (HasState) { - output.WriteMessage(2, State); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasIdentity) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Identity); - } - if (HasState) { - size += pb::CodedOutputStream.ComputeMessageSize(2, State); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static Member ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Member ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Member ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Member ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Member ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Member ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Member ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Member ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Member ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Member ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Member prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - Member result = new Member(); - - protected override Member MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new Member(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.channel.Member.Descriptor; } - } - - public override Member DefaultInstanceForType { - get { return global::bnet.protocol.channel.Member.DefaultInstance; } - } - - public override Member BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - Member returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Member) { - return MergeFrom((Member) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Member other) { - if (other == global::bnet.protocol.channel.Member.DefaultInstance) return this; - if (other.HasIdentity) { - MergeIdentity(other.Identity); - } - if (other.HasState) { - MergeState(other.State); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.Identity.Builder subBuilder = global::bnet.protocol.Identity.CreateBuilder(); - if (HasIdentity) { - subBuilder.MergeFrom(Identity); - } - input.ReadMessage(subBuilder, extensionRegistry); - Identity = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.channel.MemberState.Builder subBuilder = global::bnet.protocol.channel.MemberState.CreateBuilder(); - if (HasState) { - subBuilder.MergeFrom(State); - } - input.ReadMessage(subBuilder, extensionRegistry); - State = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasIdentity { - get { return result.HasIdentity; } - } - public global::bnet.protocol.Identity Identity { - get { return result.Identity; } - set { SetIdentity(value); } - } - public Builder SetIdentity(global::bnet.protocol.Identity value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasIdentity = true; - result.identity_ = value; - return this; - } - public Builder SetIdentity(global::bnet.protocol.Identity.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasIdentity = true; - result.identity_ = builderForValue.Build(); - return this; - } - public Builder MergeIdentity(global::bnet.protocol.Identity value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasIdentity && - result.identity_ != global::bnet.protocol.Identity.DefaultInstance) { - result.identity_ = global::bnet.protocol.Identity.CreateBuilder(result.identity_).MergeFrom(value).BuildPartial(); - } else { - result.identity_ = value; - } - result.hasIdentity = true; - return this; - } - public Builder ClearIdentity() { - result.hasIdentity = false; - result.identity_ = global::bnet.protocol.Identity.DefaultInstance; - return this; - } - - public bool HasState { - get { return result.HasState; } - } - public global::bnet.protocol.channel.MemberState State { - get { return result.State; } - set { SetState(value); } - } - public Builder SetState(global::bnet.protocol.channel.MemberState value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasState = true; - result.state_ = value; - return this; - } - public Builder SetState(global::bnet.protocol.channel.MemberState.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasState = true; - result.state_ = builderForValue.Build(); - return this; - } - public Builder MergeState(global::bnet.protocol.channel.MemberState value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasState && - result.state_ != global::bnet.protocol.channel.MemberState.DefaultInstance) { - result.state_ = global::bnet.protocol.channel.MemberState.CreateBuilder(result.state_).MergeFrom(value).BuildPartial(); - } else { - result.state_ = value; - } - result.hasState = true; - return this; - } - public Builder ClearState() { - result.hasState = false; - result.state_ = global::bnet.protocol.channel.MemberState.DefaultInstance; - return this; - } - } - static Member() { - object.ReferenceEquals(global::bnet.protocol.channel.ChannelTypes.Descriptor, null); - } - } - - #endregion - -} diff --git a/source/D3Proto/bnet/protocol/chat/Chat.cs b/source/D3Proto/bnet/protocol/chat/Chat.cs deleted file mode 100644 index 32fdb1e7..00000000 --- a/source/D3Proto/bnet/protocol/chat/Chat.cs +++ /dev/null @@ -1,186 +0,0 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace bnet.protocol.chat { - - public static partial class Chat { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static Chat() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "CiJzZXJ2aWNlL2NoYXQvZGVmaW5pdGlvbi9jaGF0LnByb3RvEhJibmV0LnBy" + - "b3RvY29sLmNoYXQaHGxpYi9wcm90b2NvbC9hdHRyaWJ1dGUucHJvdG8aGWxp" + - "Yi9wcm90b2NvbC9lbnRpdHkucHJvdG8aHWxpYi9wcm90b2NvbC9pbnZpdGF0" + - "aW9uLnByb3RvGhFsaWIvcnBjL3JwYy5wcm90bxojc2VydmljZS9jaGFubmVs" + - "L2NoYW5uZWxfdHlwZXMucHJvdG8aKHNlcnZpY2UvY2hhdC9kZWZpbml0aW9u" + - "L2NoYXRfdHlwZXMucHJvdG8yxQIKC0NoYXRTZXJ2aWNlEmQKC0ZpbmRDaGFu" + - "bmVsEikuYm5ldC5wcm90b2NvbC5jaGFubmVsLkZpbmRDaGFubmVsUmVxdWVz" + - "dBoqLmJuZXQucHJvdG9jb2wuY2hhbm5lbC5GaW5kQ2hhbm5lbFJlc3BvbnNl" + - "EmoKDUNyZWF0ZUNoYW5uZWwSKy5ibmV0LnByb3RvY29sLmNoYW5uZWwuQ3Jl" + - "YXRlQ2hhbm5lbFJlcXVlc3QaLC5ibmV0LnByb3RvY29sLmNoYW5uZWwuQ3Jl" + - "YXRlQ2hhbm5lbFJlc3BvbnNlEmQKC0pvaW5DaGFubmVsEikuYm5ldC5wcm90" + - "b2NvbC5jaGFubmVsLkpvaW5DaGFubmVsUmVxdWVzdBoqLmJuZXQucHJvdG9j" + - "b2wuY2hhbm5lbC5Kb2luQ2hhbm5lbFJlc3BvbnNlQgOAAQE="); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::bnet.protocol.attribute.Proto.Attribute.Descriptor, - global::bnet.protocol.Entity.Descriptor, - global::bnet.protocol.invitation.Proto.Invitation.Descriptor, - global::bnet.protocol.Rpc.Descriptor, - global::bnet.protocol.channel.ChannelTypes.Descriptor, - global::bnet.protocol.chat.ChatTypes.Descriptor, - }, assigner); - } - #endregion - - } - #region Services - public abstract class ChatService : pb::IService { - public abstract void FindChannel( - pb::IRpcController controller, - global::bnet.protocol.channel.FindChannelRequest request, - global::System.Action done); - public abstract void CreateChannel( - pb::IRpcController controller, - global::bnet.protocol.channel.CreateChannelRequest request, - global::System.Action done); - public abstract void JoinChannel( - pb::IRpcController controller, - global::bnet.protocol.channel.JoinChannelRequest request, - global::System.Action done); - - public static pbd::ServiceDescriptor Descriptor { - get { return Chat.Descriptor.Services[0]; } - } - public pbd::ServiceDescriptor DescriptorForType { - get { return Descriptor; } - } - - public void CallMethod( - pbd::MethodDescriptor method, - pb::IRpcController controller, - pb::IMessage request, - global::System.Action done) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.CallMethod() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - this.FindChannel(controller, (global::bnet.protocol.channel.FindChannelRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 1: - this.CreateChannel(controller, (global::bnet.protocol.channel.CreateChannelRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 2: - this.JoinChannel(controller, (global::bnet.protocol.channel.JoinChannelRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetRequestPrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::bnet.protocol.channel.FindChannelRequest.DefaultInstance; - case 1: - return global::bnet.protocol.channel.CreateChannelRequest.DefaultInstance; - case 2: - return global::bnet.protocol.channel.JoinChannelRequest.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetResponsePrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::bnet.protocol.channel.FindChannelResponse.DefaultInstance; - case 1: - return global::bnet.protocol.channel.CreateChannelResponse.DefaultInstance; - case 2: - return global::bnet.protocol.channel.JoinChannelResponse.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public static Stub CreateStub(pb::IRpcChannel channel) { - return new Stub(channel); - } - - public class Stub : global::bnet.protocol.chat.ChatService { - internal Stub(pb::IRpcChannel channel) { - this.channel = channel; - } - - private readonly pb::IRpcChannel channel; - - public pb::IRpcChannel Channel { - get { return channel; } - } - - public override void FindChannel( - pb::IRpcController controller, - global::bnet.protocol.channel.FindChannelRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[0], - controller, request, global::bnet.protocol.channel.FindChannelResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.channel.FindChannelResponse.DefaultInstance)); - } - - public override void CreateChannel( - pb::IRpcController controller, - global::bnet.protocol.channel.CreateChannelRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[1], - controller, request, global::bnet.protocol.channel.CreateChannelResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.channel.CreateChannelResponse.DefaultInstance)); - } - - public override void JoinChannel( - pb::IRpcController controller, - global::bnet.protocol.channel.JoinChannelRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[2], - controller, request, global::bnet.protocol.channel.JoinChannelResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.channel.JoinChannelResponse.DefaultInstance)); - } - } - } - #endregion - -} diff --git a/source/D3Proto/bnet/protocol/config/ProcessConfig.cs b/source/D3Proto/bnet/protocol/config/ProcessConfig.cs deleted file mode 100644 index 70652ea1..00000000 --- a/source/D3Proto/bnet/protocol/config/ProcessConfig.cs +++ /dev/null @@ -1,3636 +0,0 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace bnet.protocol.config { - - namespace Proto { - - public static partial class ProcessConfig { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_bnet_protocol_config_Var__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_config_Var__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_config_Resource__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_config_Resource__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_config_ProgramResources__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_config_ProgramResources__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_config_ServerAddress__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_config_ServerAddress__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_config_ServerSet__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_config_ServerSet__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_config_SupplementalService__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_config_SupplementalService__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_config_ListenPoint__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_config_ListenPoint__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_config_ServiceShard__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_config_ServiceShard__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_config_ServiceConfig__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_config_ServiceConfig__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_config_RPCServerConfig__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_config_RPCServerConfig__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_config_ProcessConfig__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_config_ProcessConfig__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static ProcessConfig() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "Ch9saWIvY29uZmlnL3Byb2Nlc3NfY29uZmlnLnByb3RvEhRibmV0LnByb3Rv" + - "Y29sLmNvbmZpZxoRbGliL3JwYy9ycGMucHJvdG8iIgoDVmFyEgwKBG5hbWUY" + - "ASACKAkSDQoFdmFsdWUYAiACKAkiJQoIUmVzb3VyY2USDAoEbmFtZRgBIAIo" + - "CRILCgN1cmwYAiACKAkiQwoQUHJvZ3JhbVJlc291cmNlcxIvCgdwcm9ncmFt" + - "GAEgAygLMh4uYm5ldC5wcm90b2NvbC5jb25maWcuUmVzb3VyY2UiYwoNU2Vy" + - "dmVyQWRkcmVzcxInCgdhZGRyZXNzGAEgAigLMhYuYm5ldC5wcm90b2NvbC5B" + - "ZGRyZXNzEhQKDHByb2Nlc3NfbmFtZRgCIAIoCRITCgtzZXJ2ZXJfbmFtZRgD" + - "IAEoCSJ8CglTZXJ2ZXJTZXQSOwoOc2VydmVyX2FkZHJlc3MYASADKAsyIy5i" + - "bmV0LnByb3RvY29sLmNvbmZpZy5TZXJ2ZXJBZGRyZXNzEhgKEGV4cG9ydGVk" + - "X3NlcnZpY2UYAiADKAkSGAoQaW1wb3J0ZWRfc2VydmljZRgDIAMoCSIxChNT" + - "dXBwbGVtZW50YWxTZXJ2aWNlEgwKBG5hbWUYASACKAkSDAoEcG9ydBgCIAIo" + - "DSJmCgtMaXN0ZW5Qb2ludBIMCgRwb3J0GAEgAigNEhgKB2FkZHJlc3MYAiAB" + - "KAk6BzAuMC4wLjASLwoGYWNjZXB0GAMgAygLMh8uYm5ldC5wcm90b2NvbC5j" + - "b25maWcuU2VydmVyU2V0IiQKDFNlcnZpY2VTaGFyZBIUCgxwcm9jZXNzX25h" + - "bWUYASACKAkiXQoNU2VydmljZUNvbmZpZxIMCgRuYW1lGAEgAigJEgsKA3Vy" + - "bBgCIAIoCRIxCgVzaGFyZBgDIAMoCzIiLmJuZXQucHJvdG9jb2wuY29uZmln" + - "LlNlcnZpY2VTaGFyZCKEAQoPUlBDU2VydmVyQ29uZmlnEgwKBG5hbWUYASAC" + - "KAkSMQoGbGlzdGVuGAIgASgLMiEuYm5ldC5wcm90b2NvbC5jb25maWcuTGlz" + - "dGVuUG9pbnQSMAoHY29ubmVjdBgDIAMoCzIfLmJuZXQucHJvdG9jb2wuY29u" + - "ZmlnLlNlcnZlclNldCK1AgoNUHJvY2Vzc0NvbmZpZxIUCgxwcm9jZXNzX25h" + - "bWUYASACKAkSNQoGc2VydmVyGAIgAygLMiUuYm5ldC5wcm90b2NvbC5jb25m" + - "aWcuUlBDU2VydmVyQ29uZmlnEjAKCHJlc291cmNlGAMgAygLMh4uYm5ldC5w" + - "cm90b2NvbC5jb25maWcuUmVzb3VyY2USNAoHc2VydmljZRgEIAMoCzIjLmJu" + - "ZXQucHJvdG9jb2wuY29uZmlnLlNlcnZpY2VDb25maWcSJgoDdmFyGAUgAygL" + - "MhkuYm5ldC5wcm90b2NvbC5jb25maWcuVmFyEkcKFHN1cHBsZW1lbnRhbF9z" + - "ZXJ2aWNlGAYgAygLMikuYm5ldC5wcm90b2NvbC5jb25maWcuU3VwcGxlbWVu" + - "dGFsU2VydmljZUIQQg5DUHJvY2Vzc0NvbmZpZw=="); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_bnet_protocol_config_Var__Descriptor = Descriptor.MessageTypes[0]; - internal__static_bnet_protocol_config_Var__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_config_Var__Descriptor, - new string[] { "Name", "Value", }); - internal__static_bnet_protocol_config_Resource__Descriptor = Descriptor.MessageTypes[1]; - internal__static_bnet_protocol_config_Resource__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_config_Resource__Descriptor, - new string[] { "Name", "Url", }); - internal__static_bnet_protocol_config_ProgramResources__Descriptor = Descriptor.MessageTypes[2]; - internal__static_bnet_protocol_config_ProgramResources__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_config_ProgramResources__Descriptor, - new string[] { "Program", }); - internal__static_bnet_protocol_config_ServerAddress__Descriptor = Descriptor.MessageTypes[3]; - internal__static_bnet_protocol_config_ServerAddress__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_config_ServerAddress__Descriptor, - new string[] { "Address", "ProcessName", "ServerName", }); - internal__static_bnet_protocol_config_ServerSet__Descriptor = Descriptor.MessageTypes[4]; - internal__static_bnet_protocol_config_ServerSet__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_config_ServerSet__Descriptor, - new string[] { "ServerAddress", "ExportedService", "ImportedService", }); - internal__static_bnet_protocol_config_SupplementalService__Descriptor = Descriptor.MessageTypes[5]; - internal__static_bnet_protocol_config_SupplementalService__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_config_SupplementalService__Descriptor, - new string[] { "Name", "Port", }); - internal__static_bnet_protocol_config_ListenPoint__Descriptor = Descriptor.MessageTypes[6]; - internal__static_bnet_protocol_config_ListenPoint__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_config_ListenPoint__Descriptor, - new string[] { "Port", "Address", "Accept", }); - internal__static_bnet_protocol_config_ServiceShard__Descriptor = Descriptor.MessageTypes[7]; - internal__static_bnet_protocol_config_ServiceShard__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_config_ServiceShard__Descriptor, - new string[] { "ProcessName", }); - internal__static_bnet_protocol_config_ServiceConfig__Descriptor = Descriptor.MessageTypes[8]; - internal__static_bnet_protocol_config_ServiceConfig__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_config_ServiceConfig__Descriptor, - new string[] { "Name", "Url", "Shard", }); - internal__static_bnet_protocol_config_RPCServerConfig__Descriptor = Descriptor.MessageTypes[9]; - internal__static_bnet_protocol_config_RPCServerConfig__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_config_RPCServerConfig__Descriptor, - new string[] { "Name", "Listen", "Connect", }); - internal__static_bnet_protocol_config_ProcessConfig__Descriptor = Descriptor.MessageTypes[10]; - internal__static_bnet_protocol_config_ProcessConfig__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_config_ProcessConfig__Descriptor, - new string[] { "ProcessName", "Server", "Resource", "Service", "Var", "SupplementalService", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::bnet.protocol.Rpc.Descriptor, - }, assigner); - } - #endregion - - } - } - #region Messages - public sealed partial class Var : pb::GeneratedMessage { - private static readonly Var defaultInstance = new Builder().BuildPartial(); - public static Var DefaultInstance { - get { return defaultInstance; } - } - - public override Var DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override Var ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.config.Proto.ProcessConfig.internal__static_bnet_protocol_config_Var__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.config.Proto.ProcessConfig.internal__static_bnet_protocol_config_Var__FieldAccessorTable; } - } - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int ValueFieldNumber = 2; - private bool hasValue; - private string value_ = ""; - public bool HasValue { - get { return hasValue; } - } - public string Value { - get { return value_; } - } - - public override bool IsInitialized { - get { - if (!hasName) return false; - if (!hasValue) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasName) { - output.WriteString(1, Name); - } - if (HasValue) { - output.WriteString(2, Value); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasName) { - size += pb::CodedOutputStream.ComputeStringSize(1, Name); - } - if (HasValue) { - size += pb::CodedOutputStream.ComputeStringSize(2, Value); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static Var ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Var ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Var ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Var ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Var ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Var ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Var ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Var ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Var ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Var ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Var prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - Var result = new Var(); - - protected override Var MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new Var(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.config.Var.Descriptor; } - } - - public override Var DefaultInstanceForType { - get { return global::bnet.protocol.config.Var.DefaultInstance; } - } - - public override Var BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - Var returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Var) { - return MergeFrom((Var) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Var other) { - if (other == global::bnet.protocol.config.Var.DefaultInstance) return this; - if (other.HasName) { - Name = other.Name; - } - if (other.HasValue) { - Value = other.Value; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - Value = input.ReadString(); - break; - } - } - } - } - - - public bool HasName { - get { return result.HasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - result.hasName = false; - result.name_ = ""; - return this; - } - - public bool HasValue { - get { return result.HasValue; } - } - public string Value { - get { return result.Value; } - set { SetValue(value); } - } - public Builder SetValue(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasValue = true; - result.value_ = value; - return this; - } - public Builder ClearValue() { - result.hasValue = false; - result.value_ = ""; - return this; - } - } - static Var() { - object.ReferenceEquals(global::bnet.protocol.config.Proto.ProcessConfig.Descriptor, null); - } - } - - public sealed partial class Resource : pb::GeneratedMessage { - private static readonly Resource defaultInstance = new Builder().BuildPartial(); - public static Resource DefaultInstance { - get { return defaultInstance; } - } - - public override Resource DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override Resource ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.config.Proto.ProcessConfig.internal__static_bnet_protocol_config_Resource__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.config.Proto.ProcessConfig.internal__static_bnet_protocol_config_Resource__FieldAccessorTable; } - } - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int UrlFieldNumber = 2; - private bool hasUrl; - private string url_ = ""; - public bool HasUrl { - get { return hasUrl; } - } - public string Url { - get { return url_; } - } - - public override bool IsInitialized { - get { - if (!hasName) return false; - if (!hasUrl) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasName) { - output.WriteString(1, Name); - } - if (HasUrl) { - output.WriteString(2, Url); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasName) { - size += pb::CodedOutputStream.ComputeStringSize(1, Name); - } - if (HasUrl) { - size += pb::CodedOutputStream.ComputeStringSize(2, Url); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static Resource ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Resource ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Resource ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Resource ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Resource ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Resource ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Resource ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Resource ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Resource ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Resource ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Resource prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - Resource result = new Resource(); - - protected override Resource MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new Resource(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.config.Resource.Descriptor; } - } - - public override Resource DefaultInstanceForType { - get { return global::bnet.protocol.config.Resource.DefaultInstance; } - } - - public override Resource BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - Resource returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Resource) { - return MergeFrom((Resource) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Resource other) { - if (other == global::bnet.protocol.config.Resource.DefaultInstance) return this; - if (other.HasName) { - Name = other.Name; - } - if (other.HasUrl) { - Url = other.Url; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - Url = input.ReadString(); - break; - } - } - } - } - - - public bool HasName { - get { return result.HasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - result.hasName = false; - result.name_ = ""; - return this; - } - - public bool HasUrl { - get { return result.HasUrl; } - } - public string Url { - get { return result.Url; } - set { SetUrl(value); } - } - public Builder SetUrl(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasUrl = true; - result.url_ = value; - return this; - } - public Builder ClearUrl() { - result.hasUrl = false; - result.url_ = ""; - return this; - } - } - static Resource() { - object.ReferenceEquals(global::bnet.protocol.config.Proto.ProcessConfig.Descriptor, null); - } - } - - public sealed partial class ProgramResources : pb::GeneratedMessage { - private static readonly ProgramResources defaultInstance = new Builder().BuildPartial(); - public static ProgramResources DefaultInstance { - get { return defaultInstance; } - } - - public override ProgramResources DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ProgramResources ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.config.Proto.ProcessConfig.internal__static_bnet_protocol_config_ProgramResources__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.config.Proto.ProcessConfig.internal__static_bnet_protocol_config_ProgramResources__FieldAccessorTable; } - } - - public const int ProgramFieldNumber = 1; - private pbc::PopsicleList program_ = new pbc::PopsicleList(); - public scg::IList ProgramList { - get { return program_; } - } - public int ProgramCount { - get { return program_.Count; } - } - public global::bnet.protocol.config.Resource GetProgram(int index) { - return program_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::bnet.protocol.config.Resource element in ProgramList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::bnet.protocol.config.Resource element in ProgramList) { - output.WriteMessage(1, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::bnet.protocol.config.Resource element in ProgramList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ProgramResources ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ProgramResources ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ProgramResources ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ProgramResources ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ProgramResources ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ProgramResources ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ProgramResources ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ProgramResources ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ProgramResources ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ProgramResources ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ProgramResources prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ProgramResources result = new ProgramResources(); - - protected override ProgramResources MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ProgramResources(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.config.ProgramResources.Descriptor; } - } - - public override ProgramResources DefaultInstanceForType { - get { return global::bnet.protocol.config.ProgramResources.DefaultInstance; } - } - - public override ProgramResources BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.program_.MakeReadOnly(); - ProgramResources returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ProgramResources) { - return MergeFrom((ProgramResources) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ProgramResources other) { - if (other == global::bnet.protocol.config.ProgramResources.DefaultInstance) return this; - if (other.program_.Count != 0) { - base.AddRange(other.program_, result.program_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.config.Resource.Builder subBuilder = global::bnet.protocol.config.Resource.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddProgram(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public pbc::IPopsicleList ProgramList { - get { return result.program_; } - } - public int ProgramCount { - get { return result.ProgramCount; } - } - public global::bnet.protocol.config.Resource GetProgram(int index) { - return result.GetProgram(index); - } - public Builder SetProgram(int index, global::bnet.protocol.config.Resource value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.program_[index] = value; - return this; - } - public Builder SetProgram(int index, global::bnet.protocol.config.Resource.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.program_[index] = builderForValue.Build(); - return this; - } - public Builder AddProgram(global::bnet.protocol.config.Resource value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.program_.Add(value); - return this; - } - public Builder AddProgram(global::bnet.protocol.config.Resource.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.program_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeProgram(scg::IEnumerable values) { - base.AddRange(values, result.program_); - return this; - } - public Builder ClearProgram() { - result.program_.Clear(); - return this; - } - } - static ProgramResources() { - object.ReferenceEquals(global::bnet.protocol.config.Proto.ProcessConfig.Descriptor, null); - } - } - - public sealed partial class ServerAddress : pb::GeneratedMessage { - private static readonly ServerAddress defaultInstance = new Builder().BuildPartial(); - public static ServerAddress DefaultInstance { - get { return defaultInstance; } - } - - public override ServerAddress DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ServerAddress ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.config.Proto.ProcessConfig.internal__static_bnet_protocol_config_ServerAddress__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.config.Proto.ProcessConfig.internal__static_bnet_protocol_config_ServerAddress__FieldAccessorTable; } - } - - public const int AddressFieldNumber = 1; - private bool hasAddress; - private global::bnet.protocol.Address address_ = global::bnet.protocol.Address.DefaultInstance; - public bool HasAddress { - get { return hasAddress; } - } - public global::bnet.protocol.Address Address { - get { return address_; } - } - - public const int ProcessNameFieldNumber = 2; - private bool hasProcessName; - private string processName_ = ""; - public bool HasProcessName { - get { return hasProcessName; } - } - public string ProcessName { - get { return processName_; } - } - - public const int ServerNameFieldNumber = 3; - private bool hasServerName; - private string serverName_ = ""; - public bool HasServerName { - get { return hasServerName; } - } - public string ServerName { - get { return serverName_; } - } - - public override bool IsInitialized { - get { - if (!hasAddress) return false; - if (!hasProcessName) return false; - if (!Address.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasAddress) { - output.WriteMessage(1, Address); - } - if (HasProcessName) { - output.WriteString(2, ProcessName); - } - if (HasServerName) { - output.WriteString(3, ServerName); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasAddress) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Address); - } - if (HasProcessName) { - size += pb::CodedOutputStream.ComputeStringSize(2, ProcessName); - } - if (HasServerName) { - size += pb::CodedOutputStream.ComputeStringSize(3, ServerName); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ServerAddress ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ServerAddress ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ServerAddress ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ServerAddress ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ServerAddress ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ServerAddress ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ServerAddress ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ServerAddress ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ServerAddress ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ServerAddress ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ServerAddress prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ServerAddress result = new ServerAddress(); - - protected override ServerAddress MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ServerAddress(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.config.ServerAddress.Descriptor; } - } - - public override ServerAddress DefaultInstanceForType { - get { return global::bnet.protocol.config.ServerAddress.DefaultInstance; } - } - - public override ServerAddress BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - ServerAddress returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ServerAddress) { - return MergeFrom((ServerAddress) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ServerAddress other) { - if (other == global::bnet.protocol.config.ServerAddress.DefaultInstance) return this; - if (other.HasAddress) { - MergeAddress(other.Address); - } - if (other.HasProcessName) { - ProcessName = other.ProcessName; - } - if (other.HasServerName) { - ServerName = other.ServerName; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.Address.Builder subBuilder = global::bnet.protocol.Address.CreateBuilder(); - if (HasAddress) { - subBuilder.MergeFrom(Address); - } - input.ReadMessage(subBuilder, extensionRegistry); - Address = subBuilder.BuildPartial(); - break; - } - case 18: { - ProcessName = input.ReadString(); - break; - } - case 26: { - ServerName = input.ReadString(); - break; - } - } - } - } - - - public bool HasAddress { - get { return result.HasAddress; } - } - public global::bnet.protocol.Address Address { - get { return result.Address; } - set { SetAddress(value); } - } - public Builder SetAddress(global::bnet.protocol.Address value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasAddress = true; - result.address_ = value; - return this; - } - public Builder SetAddress(global::bnet.protocol.Address.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasAddress = true; - result.address_ = builderForValue.Build(); - return this; - } - public Builder MergeAddress(global::bnet.protocol.Address value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAddress && - result.address_ != global::bnet.protocol.Address.DefaultInstance) { - result.address_ = global::bnet.protocol.Address.CreateBuilder(result.address_).MergeFrom(value).BuildPartial(); - } else { - result.address_ = value; - } - result.hasAddress = true; - return this; - } - public Builder ClearAddress() { - result.hasAddress = false; - result.address_ = global::bnet.protocol.Address.DefaultInstance; - return this; - } - - public bool HasProcessName { - get { return result.HasProcessName; } - } - public string ProcessName { - get { return result.ProcessName; } - set { SetProcessName(value); } - } - public Builder SetProcessName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasProcessName = true; - result.processName_ = value; - return this; - } - public Builder ClearProcessName() { - result.hasProcessName = false; - result.processName_ = ""; - return this; - } - - public bool HasServerName { - get { return result.HasServerName; } - } - public string ServerName { - get { return result.ServerName; } - set { SetServerName(value); } - } - public Builder SetServerName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasServerName = true; - result.serverName_ = value; - return this; - } - public Builder ClearServerName() { - result.hasServerName = false; - result.serverName_ = ""; - return this; - } - } - static ServerAddress() { - object.ReferenceEquals(global::bnet.protocol.config.Proto.ProcessConfig.Descriptor, null); - } - } - - public sealed partial class ServerSet : pb::GeneratedMessage { - private static readonly ServerSet defaultInstance = new Builder().BuildPartial(); - public static ServerSet DefaultInstance { - get { return defaultInstance; } - } - - public override ServerSet DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ServerSet ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.config.Proto.ProcessConfig.internal__static_bnet_protocol_config_ServerSet__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.config.Proto.ProcessConfig.internal__static_bnet_protocol_config_ServerSet__FieldAccessorTable; } - } - - public const int ServerAddressFieldNumber = 1; - private pbc::PopsicleList serverAddress_ = new pbc::PopsicleList(); - public scg::IList ServerAddressList { - get { return serverAddress_; } - } - public int ServerAddressCount { - get { return serverAddress_.Count; } - } - public global::bnet.protocol.config.ServerAddress GetServerAddress(int index) { - return serverAddress_[index]; - } - - public const int ExportedServiceFieldNumber = 2; - private pbc::PopsicleList exportedService_ = new pbc::PopsicleList(); - public scg::IList ExportedServiceList { - get { return pbc::Lists.AsReadOnly(exportedService_); } - } - public int ExportedServiceCount { - get { return exportedService_.Count; } - } - public string GetExportedService(int index) { - return exportedService_[index]; - } - - public const int ImportedServiceFieldNumber = 3; - private pbc::PopsicleList importedService_ = new pbc::PopsicleList(); - public scg::IList ImportedServiceList { - get { return pbc::Lists.AsReadOnly(importedService_); } - } - public int ImportedServiceCount { - get { return importedService_.Count; } - } - public string GetImportedService(int index) { - return importedService_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::bnet.protocol.config.ServerAddress element in ServerAddressList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::bnet.protocol.config.ServerAddress element in ServerAddressList) { - output.WriteMessage(1, element); - } - if (exportedService_.Count > 0) { - foreach (string element in exportedService_) { - output.WriteString(2, element); - } - } - if (importedService_.Count > 0) { - foreach (string element in importedService_) { - output.WriteString(3, element); - } - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::bnet.protocol.config.ServerAddress element in ServerAddressList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - { - int dataSize = 0; - foreach (string element in ExportedServiceList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 1 * exportedService_.Count; - } - { - int dataSize = 0; - foreach (string element in ImportedServiceList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 1 * importedService_.Count; - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ServerSet ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ServerSet ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ServerSet ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ServerSet ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ServerSet ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ServerSet ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ServerSet ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ServerSet ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ServerSet ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ServerSet ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ServerSet prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ServerSet result = new ServerSet(); - - protected override ServerSet MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ServerSet(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.config.ServerSet.Descriptor; } - } - - public override ServerSet DefaultInstanceForType { - get { return global::bnet.protocol.config.ServerSet.DefaultInstance; } - } - - public override ServerSet BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.serverAddress_.MakeReadOnly(); - result.exportedService_.MakeReadOnly(); - result.importedService_.MakeReadOnly(); - ServerSet returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ServerSet) { - return MergeFrom((ServerSet) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ServerSet other) { - if (other == global::bnet.protocol.config.ServerSet.DefaultInstance) return this; - if (other.serverAddress_.Count != 0) { - base.AddRange(other.serverAddress_, result.serverAddress_); - } - if (other.exportedService_.Count != 0) { - base.AddRange(other.exportedService_, result.exportedService_); - } - if (other.importedService_.Count != 0) { - base.AddRange(other.importedService_, result.importedService_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.config.ServerAddress.Builder subBuilder = global::bnet.protocol.config.ServerAddress.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddServerAddress(subBuilder.BuildPartial()); - break; - } - case 18: { - AddExportedService(input.ReadString()); - break; - } - case 26: { - AddImportedService(input.ReadString()); - break; - } - } - } - } - - - public pbc::IPopsicleList ServerAddressList { - get { return result.serverAddress_; } - } - public int ServerAddressCount { - get { return result.ServerAddressCount; } - } - public global::bnet.protocol.config.ServerAddress GetServerAddress(int index) { - return result.GetServerAddress(index); - } - public Builder SetServerAddress(int index, global::bnet.protocol.config.ServerAddress value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.serverAddress_[index] = value; - return this; - } - public Builder SetServerAddress(int index, global::bnet.protocol.config.ServerAddress.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.serverAddress_[index] = builderForValue.Build(); - return this; - } - public Builder AddServerAddress(global::bnet.protocol.config.ServerAddress value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.serverAddress_.Add(value); - return this; - } - public Builder AddServerAddress(global::bnet.protocol.config.ServerAddress.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.serverAddress_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeServerAddress(scg::IEnumerable values) { - base.AddRange(values, result.serverAddress_); - return this; - } - public Builder ClearServerAddress() { - result.serverAddress_.Clear(); - return this; - } - - public pbc::IPopsicleList ExportedServiceList { - get { return result.exportedService_; } - } - public int ExportedServiceCount { - get { return result.ExportedServiceCount; } - } - public string GetExportedService(int index) { - return result.GetExportedService(index); - } - public Builder SetExportedService(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.exportedService_[index] = value; - return this; - } - public Builder AddExportedService(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.exportedService_.Add(value); - return this; - } - public Builder AddRangeExportedService(scg::IEnumerable values) { - base.AddRange(values, result.exportedService_); - return this; - } - public Builder ClearExportedService() { - result.exportedService_.Clear(); - return this; - } - - public pbc::IPopsicleList ImportedServiceList { - get { return result.importedService_; } - } - public int ImportedServiceCount { - get { return result.ImportedServiceCount; } - } - public string GetImportedService(int index) { - return result.GetImportedService(index); - } - public Builder SetImportedService(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.importedService_[index] = value; - return this; - } - public Builder AddImportedService(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.importedService_.Add(value); - return this; - } - public Builder AddRangeImportedService(scg::IEnumerable values) { - base.AddRange(values, result.importedService_); - return this; - } - public Builder ClearImportedService() { - result.importedService_.Clear(); - return this; - } - } - static ServerSet() { - object.ReferenceEquals(global::bnet.protocol.config.Proto.ProcessConfig.Descriptor, null); - } - } - - public sealed partial class SupplementalService : pb::GeneratedMessage { - private static readonly SupplementalService defaultInstance = new Builder().BuildPartial(); - public static SupplementalService DefaultInstance { - get { return defaultInstance; } - } - - public override SupplementalService DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override SupplementalService ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.config.Proto.ProcessConfig.internal__static_bnet_protocol_config_SupplementalService__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.config.Proto.ProcessConfig.internal__static_bnet_protocol_config_SupplementalService__FieldAccessorTable; } - } - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int PortFieldNumber = 2; - private bool hasPort; - private uint port_ = 0; - public bool HasPort { - get { return hasPort; } - } - public uint Port { - get { return port_; } - } - - public override bool IsInitialized { - get { - if (!hasName) return false; - if (!hasPort) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasName) { - output.WriteString(1, Name); - } - if (HasPort) { - output.WriteUInt32(2, Port); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasName) { - size += pb::CodedOutputStream.ComputeStringSize(1, Name); - } - if (HasPort) { - size += pb::CodedOutputStream.ComputeUInt32Size(2, Port); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static SupplementalService ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SupplementalService ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SupplementalService ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SupplementalService ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SupplementalService ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SupplementalService ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SupplementalService ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SupplementalService ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SupplementalService ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SupplementalService ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SupplementalService prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - SupplementalService result = new SupplementalService(); - - protected override SupplementalService MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new SupplementalService(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.config.SupplementalService.Descriptor; } - } - - public override SupplementalService DefaultInstanceForType { - get { return global::bnet.protocol.config.SupplementalService.DefaultInstance; } - } - - public override SupplementalService BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - SupplementalService returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SupplementalService) { - return MergeFrom((SupplementalService) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SupplementalService other) { - if (other == global::bnet.protocol.config.SupplementalService.DefaultInstance) return this; - if (other.HasName) { - Name = other.Name; - } - if (other.HasPort) { - Port = other.Port; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - Name = input.ReadString(); - break; - } - case 16: { - Port = input.ReadUInt32(); - break; - } - } - } - } - - - public bool HasName { - get { return result.HasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - result.hasName = false; - result.name_ = ""; - return this; - } - - public bool HasPort { - get { return result.HasPort; } - } - public uint Port { - get { return result.Port; } - set { SetPort(value); } - } - public Builder SetPort(uint value) { - result.hasPort = true; - result.port_ = value; - return this; - } - public Builder ClearPort() { - result.hasPort = false; - result.port_ = 0; - return this; - } - } - static SupplementalService() { - object.ReferenceEquals(global::bnet.protocol.config.Proto.ProcessConfig.Descriptor, null); - } - } - - public sealed partial class ListenPoint : pb::GeneratedMessage { - private static readonly ListenPoint defaultInstance = new Builder().BuildPartial(); - public static ListenPoint DefaultInstance { - get { return defaultInstance; } - } - - public override ListenPoint DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ListenPoint ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.config.Proto.ProcessConfig.internal__static_bnet_protocol_config_ListenPoint__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.config.Proto.ProcessConfig.internal__static_bnet_protocol_config_ListenPoint__FieldAccessorTable; } - } - - public const int PortFieldNumber = 1; - private bool hasPort; - private uint port_ = 0; - public bool HasPort { - get { return hasPort; } - } - public uint Port { - get { return port_; } - } - - public const int AddressFieldNumber = 2; - private bool hasAddress; - private string address_ = "0.0.0.0"; - public bool HasAddress { - get { return hasAddress; } - } - public string Address { - get { return address_; } - } - - public const int AcceptFieldNumber = 3; - private pbc::PopsicleList accept_ = new pbc::PopsicleList(); - public scg::IList AcceptList { - get { return accept_; } - } - public int AcceptCount { - get { return accept_.Count; } - } - public global::bnet.protocol.config.ServerSet GetAccept(int index) { - return accept_[index]; - } - - public override bool IsInitialized { - get { - if (!hasPort) return false; - foreach (global::bnet.protocol.config.ServerSet element in AcceptList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasPort) { - output.WriteUInt32(1, Port); - } - if (HasAddress) { - output.WriteString(2, Address); - } - foreach (global::bnet.protocol.config.ServerSet element in AcceptList) { - output.WriteMessage(3, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasPort) { - size += pb::CodedOutputStream.ComputeUInt32Size(1, Port); - } - if (HasAddress) { - size += pb::CodedOutputStream.ComputeStringSize(2, Address); - } - foreach (global::bnet.protocol.config.ServerSet element in AcceptList) { - size += pb::CodedOutputStream.ComputeMessageSize(3, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ListenPoint ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ListenPoint ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ListenPoint ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ListenPoint ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ListenPoint ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ListenPoint ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ListenPoint ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ListenPoint ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ListenPoint ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ListenPoint ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ListenPoint prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ListenPoint result = new ListenPoint(); - - protected override ListenPoint MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ListenPoint(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.config.ListenPoint.Descriptor; } - } - - public override ListenPoint DefaultInstanceForType { - get { return global::bnet.protocol.config.ListenPoint.DefaultInstance; } - } - - public override ListenPoint BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.accept_.MakeReadOnly(); - ListenPoint returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ListenPoint) { - return MergeFrom((ListenPoint) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ListenPoint other) { - if (other == global::bnet.protocol.config.ListenPoint.DefaultInstance) return this; - if (other.HasPort) { - Port = other.Port; - } - if (other.HasAddress) { - Address = other.Address; - } - if (other.accept_.Count != 0) { - base.AddRange(other.accept_, result.accept_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - Port = input.ReadUInt32(); - break; - } - case 18: { - Address = input.ReadString(); - break; - } - case 26: { - global::bnet.protocol.config.ServerSet.Builder subBuilder = global::bnet.protocol.config.ServerSet.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddAccept(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public bool HasPort { - get { return result.HasPort; } - } - public uint Port { - get { return result.Port; } - set { SetPort(value); } - } - public Builder SetPort(uint value) { - result.hasPort = true; - result.port_ = value; - return this; - } - public Builder ClearPort() { - result.hasPort = false; - result.port_ = 0; - return this; - } - - public bool HasAddress { - get { return result.HasAddress; } - } - public string Address { - get { return result.Address; } - set { SetAddress(value); } - } - public Builder SetAddress(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasAddress = true; - result.address_ = value; - return this; - } - public Builder ClearAddress() { - result.hasAddress = false; - result.address_ = "0.0.0.0"; - return this; - } - - public pbc::IPopsicleList AcceptList { - get { return result.accept_; } - } - public int AcceptCount { - get { return result.AcceptCount; } - } - public global::bnet.protocol.config.ServerSet GetAccept(int index) { - return result.GetAccept(index); - } - public Builder SetAccept(int index, global::bnet.protocol.config.ServerSet value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.accept_[index] = value; - return this; - } - public Builder SetAccept(int index, global::bnet.protocol.config.ServerSet.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.accept_[index] = builderForValue.Build(); - return this; - } - public Builder AddAccept(global::bnet.protocol.config.ServerSet value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.accept_.Add(value); - return this; - } - public Builder AddAccept(global::bnet.protocol.config.ServerSet.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.accept_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeAccept(scg::IEnumerable values) { - base.AddRange(values, result.accept_); - return this; - } - public Builder ClearAccept() { - result.accept_.Clear(); - return this; - } - } - static ListenPoint() { - object.ReferenceEquals(global::bnet.protocol.config.Proto.ProcessConfig.Descriptor, null); - } - } - - public sealed partial class ServiceShard : pb::GeneratedMessage { - private static readonly ServiceShard defaultInstance = new Builder().BuildPartial(); - public static ServiceShard DefaultInstance { - get { return defaultInstance; } - } - - public override ServiceShard DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ServiceShard ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.config.Proto.ProcessConfig.internal__static_bnet_protocol_config_ServiceShard__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.config.Proto.ProcessConfig.internal__static_bnet_protocol_config_ServiceShard__FieldAccessorTable; } - } - - public const int ProcessNameFieldNumber = 1; - private bool hasProcessName; - private string processName_ = ""; - public bool HasProcessName { - get { return hasProcessName; } - } - public string ProcessName { - get { return processName_; } - } - - public override bool IsInitialized { - get { - if (!hasProcessName) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasProcessName) { - output.WriteString(1, ProcessName); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasProcessName) { - size += pb::CodedOutputStream.ComputeStringSize(1, ProcessName); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ServiceShard ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ServiceShard ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ServiceShard ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ServiceShard ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ServiceShard ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ServiceShard ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ServiceShard ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ServiceShard ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ServiceShard ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ServiceShard ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ServiceShard prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ServiceShard result = new ServiceShard(); - - protected override ServiceShard MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ServiceShard(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.config.ServiceShard.Descriptor; } - } - - public override ServiceShard DefaultInstanceForType { - get { return global::bnet.protocol.config.ServiceShard.DefaultInstance; } - } - - public override ServiceShard BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - ServiceShard returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ServiceShard) { - return MergeFrom((ServiceShard) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ServiceShard other) { - if (other == global::bnet.protocol.config.ServiceShard.DefaultInstance) return this; - if (other.HasProcessName) { - ProcessName = other.ProcessName; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - ProcessName = input.ReadString(); - break; - } - } - } - } - - - public bool HasProcessName { - get { return result.HasProcessName; } - } - public string ProcessName { - get { return result.ProcessName; } - set { SetProcessName(value); } - } - public Builder SetProcessName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasProcessName = true; - result.processName_ = value; - return this; - } - public Builder ClearProcessName() { - result.hasProcessName = false; - result.processName_ = ""; - return this; - } - } - static ServiceShard() { - object.ReferenceEquals(global::bnet.protocol.config.Proto.ProcessConfig.Descriptor, null); - } - } - - public sealed partial class ServiceConfig : pb::GeneratedMessage { - private static readonly ServiceConfig defaultInstance = new Builder().BuildPartial(); - public static ServiceConfig DefaultInstance { - get { return defaultInstance; } - } - - public override ServiceConfig DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ServiceConfig ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.config.Proto.ProcessConfig.internal__static_bnet_protocol_config_ServiceConfig__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.config.Proto.ProcessConfig.internal__static_bnet_protocol_config_ServiceConfig__FieldAccessorTable; } - } - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int UrlFieldNumber = 2; - private bool hasUrl; - private string url_ = ""; - public bool HasUrl { - get { return hasUrl; } - } - public string Url { - get { return url_; } - } - - public const int ShardFieldNumber = 3; - private pbc::PopsicleList shard_ = new pbc::PopsicleList(); - public scg::IList ShardList { - get { return shard_; } - } - public int ShardCount { - get { return shard_.Count; } - } - public global::bnet.protocol.config.ServiceShard GetShard(int index) { - return shard_[index]; - } - - public override bool IsInitialized { - get { - if (!hasName) return false; - if (!hasUrl) return false; - foreach (global::bnet.protocol.config.ServiceShard element in ShardList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasName) { - output.WriteString(1, Name); - } - if (HasUrl) { - output.WriteString(2, Url); - } - foreach (global::bnet.protocol.config.ServiceShard element in ShardList) { - output.WriteMessage(3, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasName) { - size += pb::CodedOutputStream.ComputeStringSize(1, Name); - } - if (HasUrl) { - size += pb::CodedOutputStream.ComputeStringSize(2, Url); - } - foreach (global::bnet.protocol.config.ServiceShard element in ShardList) { - size += pb::CodedOutputStream.ComputeMessageSize(3, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ServiceConfig ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ServiceConfig ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ServiceConfig ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ServiceConfig ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ServiceConfig ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ServiceConfig ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ServiceConfig ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ServiceConfig ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ServiceConfig ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ServiceConfig ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ServiceConfig prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ServiceConfig result = new ServiceConfig(); - - protected override ServiceConfig MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ServiceConfig(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.config.ServiceConfig.Descriptor; } - } - - public override ServiceConfig DefaultInstanceForType { - get { return global::bnet.protocol.config.ServiceConfig.DefaultInstance; } - } - - public override ServiceConfig BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.shard_.MakeReadOnly(); - ServiceConfig returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ServiceConfig) { - return MergeFrom((ServiceConfig) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ServiceConfig other) { - if (other == global::bnet.protocol.config.ServiceConfig.DefaultInstance) return this; - if (other.HasName) { - Name = other.Name; - } - if (other.HasUrl) { - Url = other.Url; - } - if (other.shard_.Count != 0) { - base.AddRange(other.shard_, result.shard_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - Url = input.ReadString(); - break; - } - case 26: { - global::bnet.protocol.config.ServiceShard.Builder subBuilder = global::bnet.protocol.config.ServiceShard.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddShard(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public bool HasName { - get { return result.HasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - result.hasName = false; - result.name_ = ""; - return this; - } - - public bool HasUrl { - get { return result.HasUrl; } - } - public string Url { - get { return result.Url; } - set { SetUrl(value); } - } - public Builder SetUrl(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasUrl = true; - result.url_ = value; - return this; - } - public Builder ClearUrl() { - result.hasUrl = false; - result.url_ = ""; - return this; - } - - public pbc::IPopsicleList ShardList { - get { return result.shard_; } - } - public int ShardCount { - get { return result.ShardCount; } - } - public global::bnet.protocol.config.ServiceShard GetShard(int index) { - return result.GetShard(index); - } - public Builder SetShard(int index, global::bnet.protocol.config.ServiceShard value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.shard_[index] = value; - return this; - } - public Builder SetShard(int index, global::bnet.protocol.config.ServiceShard.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.shard_[index] = builderForValue.Build(); - return this; - } - public Builder AddShard(global::bnet.protocol.config.ServiceShard value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.shard_.Add(value); - return this; - } - public Builder AddShard(global::bnet.protocol.config.ServiceShard.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.shard_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeShard(scg::IEnumerable values) { - base.AddRange(values, result.shard_); - return this; - } - public Builder ClearShard() { - result.shard_.Clear(); - return this; - } - } - static ServiceConfig() { - object.ReferenceEquals(global::bnet.protocol.config.Proto.ProcessConfig.Descriptor, null); - } - } - - public sealed partial class RPCServerConfig : pb::GeneratedMessage { - private static readonly RPCServerConfig defaultInstance = new Builder().BuildPartial(); - public static RPCServerConfig DefaultInstance { - get { return defaultInstance; } - } - - public override RPCServerConfig DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override RPCServerConfig ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.config.Proto.ProcessConfig.internal__static_bnet_protocol_config_RPCServerConfig__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.config.Proto.ProcessConfig.internal__static_bnet_protocol_config_RPCServerConfig__FieldAccessorTable; } - } - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int ListenFieldNumber = 2; - private bool hasListen; - private global::bnet.protocol.config.ListenPoint listen_ = global::bnet.protocol.config.ListenPoint.DefaultInstance; - public bool HasListen { - get { return hasListen; } - } - public global::bnet.protocol.config.ListenPoint Listen { - get { return listen_; } - } - - public const int ConnectFieldNumber = 3; - private pbc::PopsicleList connect_ = new pbc::PopsicleList(); - public scg::IList ConnectList { - get { return connect_; } - } - public int ConnectCount { - get { return connect_.Count; } - } - public global::bnet.protocol.config.ServerSet GetConnect(int index) { - return connect_[index]; - } - - public override bool IsInitialized { - get { - if (!hasName) return false; - if (HasListen) { - if (!Listen.IsInitialized) return false; - } - foreach (global::bnet.protocol.config.ServerSet element in ConnectList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasName) { - output.WriteString(1, Name); - } - if (HasListen) { - output.WriteMessage(2, Listen); - } - foreach (global::bnet.protocol.config.ServerSet element in ConnectList) { - output.WriteMessage(3, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasName) { - size += pb::CodedOutputStream.ComputeStringSize(1, Name); - } - if (HasListen) { - size += pb::CodedOutputStream.ComputeMessageSize(2, Listen); - } - foreach (global::bnet.protocol.config.ServerSet element in ConnectList) { - size += pb::CodedOutputStream.ComputeMessageSize(3, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static RPCServerConfig ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RPCServerConfig ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RPCServerConfig ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RPCServerConfig ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RPCServerConfig ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RPCServerConfig ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static RPCServerConfig ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static RPCServerConfig ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static RPCServerConfig ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RPCServerConfig ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(RPCServerConfig prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - RPCServerConfig result = new RPCServerConfig(); - - protected override RPCServerConfig MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new RPCServerConfig(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.config.RPCServerConfig.Descriptor; } - } - - public override RPCServerConfig DefaultInstanceForType { - get { return global::bnet.protocol.config.RPCServerConfig.DefaultInstance; } - } - - public override RPCServerConfig BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.connect_.MakeReadOnly(); - RPCServerConfig returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is RPCServerConfig) { - return MergeFrom((RPCServerConfig) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(RPCServerConfig other) { - if (other == global::bnet.protocol.config.RPCServerConfig.DefaultInstance) return this; - if (other.HasName) { - Name = other.Name; - } - if (other.HasListen) { - MergeListen(other.Listen); - } - if (other.connect_.Count != 0) { - base.AddRange(other.connect_, result.connect_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - global::bnet.protocol.config.ListenPoint.Builder subBuilder = global::bnet.protocol.config.ListenPoint.CreateBuilder(); - if (HasListen) { - subBuilder.MergeFrom(Listen); - } - input.ReadMessage(subBuilder, extensionRegistry); - Listen = subBuilder.BuildPartial(); - break; - } - case 26: { - global::bnet.protocol.config.ServerSet.Builder subBuilder = global::bnet.protocol.config.ServerSet.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddConnect(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public bool HasName { - get { return result.HasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - result.hasName = false; - result.name_ = ""; - return this; - } - - public bool HasListen { - get { return result.HasListen; } - } - public global::bnet.protocol.config.ListenPoint Listen { - get { return result.Listen; } - set { SetListen(value); } - } - public Builder SetListen(global::bnet.protocol.config.ListenPoint value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasListen = true; - result.listen_ = value; - return this; - } - public Builder SetListen(global::bnet.protocol.config.ListenPoint.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasListen = true; - result.listen_ = builderForValue.Build(); - return this; - } - public Builder MergeListen(global::bnet.protocol.config.ListenPoint value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasListen && - result.listen_ != global::bnet.protocol.config.ListenPoint.DefaultInstance) { - result.listen_ = global::bnet.protocol.config.ListenPoint.CreateBuilder(result.listen_).MergeFrom(value).BuildPartial(); - } else { - result.listen_ = value; - } - result.hasListen = true; - return this; - } - public Builder ClearListen() { - result.hasListen = false; - result.listen_ = global::bnet.protocol.config.ListenPoint.DefaultInstance; - return this; - } - - public pbc::IPopsicleList ConnectList { - get { return result.connect_; } - } - public int ConnectCount { - get { return result.ConnectCount; } - } - public global::bnet.protocol.config.ServerSet GetConnect(int index) { - return result.GetConnect(index); - } - public Builder SetConnect(int index, global::bnet.protocol.config.ServerSet value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.connect_[index] = value; - return this; - } - public Builder SetConnect(int index, global::bnet.protocol.config.ServerSet.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.connect_[index] = builderForValue.Build(); - return this; - } - public Builder AddConnect(global::bnet.protocol.config.ServerSet value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.connect_.Add(value); - return this; - } - public Builder AddConnect(global::bnet.protocol.config.ServerSet.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.connect_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeConnect(scg::IEnumerable values) { - base.AddRange(values, result.connect_); - return this; - } - public Builder ClearConnect() { - result.connect_.Clear(); - return this; - } - } - static RPCServerConfig() { - object.ReferenceEquals(global::bnet.protocol.config.Proto.ProcessConfig.Descriptor, null); - } - } - - public sealed partial class ProcessConfig : pb::GeneratedMessage { - private static readonly ProcessConfig defaultInstance = new Builder().BuildPartial(); - public static ProcessConfig DefaultInstance { - get { return defaultInstance; } - } - - public override ProcessConfig DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ProcessConfig ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.config.Proto.ProcessConfig.internal__static_bnet_protocol_config_ProcessConfig__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.config.Proto.ProcessConfig.internal__static_bnet_protocol_config_ProcessConfig__FieldAccessorTable; } - } - - public const int ProcessNameFieldNumber = 1; - private bool hasProcessName; - private string processName_ = ""; - public bool HasProcessName { - get { return hasProcessName; } - } - public string ProcessName { - get { return processName_; } - } - - public const int ServerFieldNumber = 2; - private pbc::PopsicleList server_ = new pbc::PopsicleList(); - public scg::IList ServerList { - get { return server_; } - } - public int ServerCount { - get { return server_.Count; } - } - public global::bnet.protocol.config.RPCServerConfig GetServer(int index) { - return server_[index]; - } - - public const int ResourceFieldNumber = 3; - private pbc::PopsicleList resource_ = new pbc::PopsicleList(); - public scg::IList ResourceList { - get { return resource_; } - } - public int ResourceCount { - get { return resource_.Count; } - } - public global::bnet.protocol.config.Resource GetResource(int index) { - return resource_[index]; - } - - public const int ServiceFieldNumber = 4; - private pbc::PopsicleList service_ = new pbc::PopsicleList(); - public scg::IList ServiceList { - get { return service_; } - } - public int ServiceCount { - get { return service_.Count; } - } - public global::bnet.protocol.config.ServiceConfig GetService(int index) { - return service_[index]; - } - - public const int VarFieldNumber = 5; - private pbc::PopsicleList var_ = new pbc::PopsicleList(); - public scg::IList VarList { - get { return var_; } - } - public int VarCount { - get { return var_.Count; } - } - public global::bnet.protocol.config.Var GetVar(int index) { - return var_[index]; - } - - public const int SupplementalServiceFieldNumber = 6; - private pbc::PopsicleList supplementalService_ = new pbc::PopsicleList(); - public scg::IList SupplementalServiceList { - get { return supplementalService_; } - } - public int SupplementalServiceCount { - get { return supplementalService_.Count; } - } - public global::bnet.protocol.config.SupplementalService GetSupplementalService(int index) { - return supplementalService_[index]; - } - - public override bool IsInitialized { - get { - if (!hasProcessName) return false; - foreach (global::bnet.protocol.config.RPCServerConfig element in ServerList) { - if (!element.IsInitialized) return false; - } - foreach (global::bnet.protocol.config.Resource element in ResourceList) { - if (!element.IsInitialized) return false; - } - foreach (global::bnet.protocol.config.ServiceConfig element in ServiceList) { - if (!element.IsInitialized) return false; - } - foreach (global::bnet.protocol.config.Var element in VarList) { - if (!element.IsInitialized) return false; - } - foreach (global::bnet.protocol.config.SupplementalService element in SupplementalServiceList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasProcessName) { - output.WriteString(1, ProcessName); - } - foreach (global::bnet.protocol.config.RPCServerConfig element in ServerList) { - output.WriteMessage(2, element); - } - foreach (global::bnet.protocol.config.Resource element in ResourceList) { - output.WriteMessage(3, element); - } - foreach (global::bnet.protocol.config.ServiceConfig element in ServiceList) { - output.WriteMessage(4, element); - } - foreach (global::bnet.protocol.config.Var element in VarList) { - output.WriteMessage(5, element); - } - foreach (global::bnet.protocol.config.SupplementalService element in SupplementalServiceList) { - output.WriteMessage(6, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasProcessName) { - size += pb::CodedOutputStream.ComputeStringSize(1, ProcessName); - } - foreach (global::bnet.protocol.config.RPCServerConfig element in ServerList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - foreach (global::bnet.protocol.config.Resource element in ResourceList) { - size += pb::CodedOutputStream.ComputeMessageSize(3, element); - } - foreach (global::bnet.protocol.config.ServiceConfig element in ServiceList) { - size += pb::CodedOutputStream.ComputeMessageSize(4, element); - } - foreach (global::bnet.protocol.config.Var element in VarList) { - size += pb::CodedOutputStream.ComputeMessageSize(5, element); - } - foreach (global::bnet.protocol.config.SupplementalService element in SupplementalServiceList) { - size += pb::CodedOutputStream.ComputeMessageSize(6, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ProcessConfig ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ProcessConfig ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ProcessConfig ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ProcessConfig ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ProcessConfig ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ProcessConfig ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ProcessConfig ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ProcessConfig ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ProcessConfig ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ProcessConfig ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ProcessConfig prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ProcessConfig result = new ProcessConfig(); - - protected override ProcessConfig MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ProcessConfig(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.config.ProcessConfig.Descriptor; } - } - - public override ProcessConfig DefaultInstanceForType { - get { return global::bnet.protocol.config.ProcessConfig.DefaultInstance; } - } - - public override ProcessConfig BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.server_.MakeReadOnly(); - result.resource_.MakeReadOnly(); - result.service_.MakeReadOnly(); - result.var_.MakeReadOnly(); - result.supplementalService_.MakeReadOnly(); - ProcessConfig returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ProcessConfig) { - return MergeFrom((ProcessConfig) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ProcessConfig other) { - if (other == global::bnet.protocol.config.ProcessConfig.DefaultInstance) return this; - if (other.HasProcessName) { - ProcessName = other.ProcessName; - } - if (other.server_.Count != 0) { - base.AddRange(other.server_, result.server_); - } - if (other.resource_.Count != 0) { - base.AddRange(other.resource_, result.resource_); - } - if (other.service_.Count != 0) { - base.AddRange(other.service_, result.service_); - } - if (other.var_.Count != 0) { - base.AddRange(other.var_, result.var_); - } - if (other.supplementalService_.Count != 0) { - base.AddRange(other.supplementalService_, result.supplementalService_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - ProcessName = input.ReadString(); - break; - } - case 18: { - global::bnet.protocol.config.RPCServerConfig.Builder subBuilder = global::bnet.protocol.config.RPCServerConfig.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddServer(subBuilder.BuildPartial()); - break; - } - case 26: { - global::bnet.protocol.config.Resource.Builder subBuilder = global::bnet.protocol.config.Resource.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddResource(subBuilder.BuildPartial()); - break; - } - case 34: { - global::bnet.protocol.config.ServiceConfig.Builder subBuilder = global::bnet.protocol.config.ServiceConfig.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddService(subBuilder.BuildPartial()); - break; - } - case 42: { - global::bnet.protocol.config.Var.Builder subBuilder = global::bnet.protocol.config.Var.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddVar(subBuilder.BuildPartial()); - break; - } - case 50: { - global::bnet.protocol.config.SupplementalService.Builder subBuilder = global::bnet.protocol.config.SupplementalService.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddSupplementalService(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public bool HasProcessName { - get { return result.HasProcessName; } - } - public string ProcessName { - get { return result.ProcessName; } - set { SetProcessName(value); } - } - public Builder SetProcessName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasProcessName = true; - result.processName_ = value; - return this; - } - public Builder ClearProcessName() { - result.hasProcessName = false; - result.processName_ = ""; - return this; - } - - public pbc::IPopsicleList ServerList { - get { return result.server_; } - } - public int ServerCount { - get { return result.ServerCount; } - } - public global::bnet.protocol.config.RPCServerConfig GetServer(int index) { - return result.GetServer(index); - } - public Builder SetServer(int index, global::bnet.protocol.config.RPCServerConfig value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.server_[index] = value; - return this; - } - public Builder SetServer(int index, global::bnet.protocol.config.RPCServerConfig.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.server_[index] = builderForValue.Build(); - return this; - } - public Builder AddServer(global::bnet.protocol.config.RPCServerConfig value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.server_.Add(value); - return this; - } - public Builder AddServer(global::bnet.protocol.config.RPCServerConfig.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.server_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeServer(scg::IEnumerable values) { - base.AddRange(values, result.server_); - return this; - } - public Builder ClearServer() { - result.server_.Clear(); - return this; - } - - public pbc::IPopsicleList ResourceList { - get { return result.resource_; } - } - public int ResourceCount { - get { return result.ResourceCount; } - } - public global::bnet.protocol.config.Resource GetResource(int index) { - return result.GetResource(index); - } - public Builder SetResource(int index, global::bnet.protocol.config.Resource value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.resource_[index] = value; - return this; - } - public Builder SetResource(int index, global::bnet.protocol.config.Resource.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.resource_[index] = builderForValue.Build(); - return this; - } - public Builder AddResource(global::bnet.protocol.config.Resource value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.resource_.Add(value); - return this; - } - public Builder AddResource(global::bnet.protocol.config.Resource.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.resource_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeResource(scg::IEnumerable values) { - base.AddRange(values, result.resource_); - return this; - } - public Builder ClearResource() { - result.resource_.Clear(); - return this; - } - - public pbc::IPopsicleList ServiceList { - get { return result.service_; } - } - public int ServiceCount { - get { return result.ServiceCount; } - } - public global::bnet.protocol.config.ServiceConfig GetService(int index) { - return result.GetService(index); - } - public Builder SetService(int index, global::bnet.protocol.config.ServiceConfig value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.service_[index] = value; - return this; - } - public Builder SetService(int index, global::bnet.protocol.config.ServiceConfig.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.service_[index] = builderForValue.Build(); - return this; - } - public Builder AddService(global::bnet.protocol.config.ServiceConfig value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.service_.Add(value); - return this; - } - public Builder AddService(global::bnet.protocol.config.ServiceConfig.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.service_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeService(scg::IEnumerable values) { - base.AddRange(values, result.service_); - return this; - } - public Builder ClearService() { - result.service_.Clear(); - return this; - } - - public pbc::IPopsicleList VarList { - get { return result.var_; } - } - public int VarCount { - get { return result.VarCount; } - } - public global::bnet.protocol.config.Var GetVar(int index) { - return result.GetVar(index); - } - public Builder SetVar(int index, global::bnet.protocol.config.Var value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.var_[index] = value; - return this; - } - public Builder SetVar(int index, global::bnet.protocol.config.Var.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.var_[index] = builderForValue.Build(); - return this; - } - public Builder AddVar(global::bnet.protocol.config.Var value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.var_.Add(value); - return this; - } - public Builder AddVar(global::bnet.protocol.config.Var.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.var_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeVar(scg::IEnumerable values) { - base.AddRange(values, result.var_); - return this; - } - public Builder ClearVar() { - result.var_.Clear(); - return this; - } - - public pbc::IPopsicleList SupplementalServiceList { - get { return result.supplementalService_; } - } - public int SupplementalServiceCount { - get { return result.SupplementalServiceCount; } - } - public global::bnet.protocol.config.SupplementalService GetSupplementalService(int index) { - return result.GetSupplementalService(index); - } - public Builder SetSupplementalService(int index, global::bnet.protocol.config.SupplementalService value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.supplementalService_[index] = value; - return this; - } - public Builder SetSupplementalService(int index, global::bnet.protocol.config.SupplementalService.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.supplementalService_[index] = builderForValue.Build(); - return this; - } - public Builder AddSupplementalService(global::bnet.protocol.config.SupplementalService value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.supplementalService_.Add(value); - return this; - } - public Builder AddSupplementalService(global::bnet.protocol.config.SupplementalService.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.supplementalService_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeSupplementalService(scg::IEnumerable values) { - base.AddRange(values, result.supplementalService_); - return this; - } - public Builder ClearSupplementalService() { - result.supplementalService_.Clear(); - return this; - } - } - static ProcessConfig() { - object.ReferenceEquals(global::bnet.protocol.config.Proto.ProcessConfig.Descriptor, null); - } - } - - #endregion - -} diff --git a/source/D3Proto/bnet/protocol/exchange/Exchange.cs b/source/D3Proto/bnet/protocol/exchange/Exchange.cs deleted file mode 100644 index 6e2d5316..00000000 --- a/source/D3Proto/bnet/protocol/exchange/Exchange.cs +++ /dev/null @@ -1,1232 +0,0 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace bnet.protocol.exchange { - - public static partial class Exchange { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_PartitionId__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_PartitionId__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_BlobFrom__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_BlobFrom__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_BlobOfType__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_BlobOfType__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_BlobFromOfType__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_BlobFromOfType__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static Exchange() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "ChtsaWIvcHJvdG9jb2wvZXhjaGFuZ2UucHJvdG8SFmJuZXQucHJvdG9jb2wu" + - "ZXhjaGFuZ2UiKAoLUGFydGl0aW9uSWQSDAoEaGlnaBgBIAIoBhILCgNsb3cY" + - "AiACKAYiPAoIQmxvYkZyb20SDgoGc291cmNlGAEgAigHEgwKBGRhdGEYAiAC" + - "KAwSEgoKZXh0cmFfZGF0YRgDIAEoDCI8CgpCbG9iT2ZUeXBlEgwKBHR5cGUY" + - "ASACKAkSDAoEZGF0YRgCIAEoDBISCgpleHRyYV9kYXRhGAMgASgMIjwKDkJs" + - "b2JGcm9tT2ZUeXBlEg4KBnNvdXJjZRgBIAIoBxIMCgR0eXBlGAIgAigJEgwK" + - "BGRhdGEYAyACKAxCEUIMQ0V4Y2hhbmdlTGligAEB"); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_bnet_protocol_exchange_PartitionId__Descriptor = Descriptor.MessageTypes[0]; - internal__static_bnet_protocol_exchange_PartitionId__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_PartitionId__Descriptor, - new string[] { "High", "Low", }); - internal__static_bnet_protocol_exchange_BlobFrom__Descriptor = Descriptor.MessageTypes[1]; - internal__static_bnet_protocol_exchange_BlobFrom__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_BlobFrom__Descriptor, - new string[] { "Source", "Data", "ExtraData", }); - internal__static_bnet_protocol_exchange_BlobOfType__Descriptor = Descriptor.MessageTypes[2]; - internal__static_bnet_protocol_exchange_BlobOfType__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_BlobOfType__Descriptor, - new string[] { "Type", "Data", "ExtraData", }); - internal__static_bnet_protocol_exchange_BlobFromOfType__Descriptor = Descriptor.MessageTypes[3]; - internal__static_bnet_protocol_exchange_BlobFromOfType__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_BlobFromOfType__Descriptor, - new string[] { "Source", "Type", "Data", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - }, assigner); - } - #endregion - - } - #region Messages - public sealed partial class PartitionId : pb::GeneratedMessage { - private static readonly PartitionId defaultInstance = new Builder().BuildPartial(); - public static PartitionId DefaultInstance { - get { return defaultInstance; } - } - - public override PartitionId DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override PartitionId ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Exchange.internal__static_bnet_protocol_exchange_PartitionId__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Exchange.internal__static_bnet_protocol_exchange_PartitionId__FieldAccessorTable; } - } - - public const int HighFieldNumber = 1; - private bool hasHigh; - private ulong high_ = 0; - public bool HasHigh { - get { return hasHigh; } - } - public ulong High { - get { return high_; } - } - - public const int LowFieldNumber = 2; - private bool hasLow; - private ulong low_ = 0; - public bool HasLow { - get { return hasLow; } - } - public ulong Low { - get { return low_; } - } - - public override bool IsInitialized { - get { - if (!hasHigh) return false; - if (!hasLow) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasHigh) { - output.WriteFixed64(1, High); - } - if (HasLow) { - output.WriteFixed64(2, Low); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasHigh) { - size += pb::CodedOutputStream.ComputeFixed64Size(1, High); - } - if (HasLow) { - size += pb::CodedOutputStream.ComputeFixed64Size(2, Low); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static PartitionId ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PartitionId ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PartitionId ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PartitionId ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PartitionId ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PartitionId ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static PartitionId ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static PartitionId ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static PartitionId ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PartitionId ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(PartitionId prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - PartitionId result = new PartitionId(); - - protected override PartitionId MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new PartitionId(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.PartitionId.Descriptor; } - } - - public override PartitionId DefaultInstanceForType { - get { return global::bnet.protocol.exchange.PartitionId.DefaultInstance; } - } - - public override PartitionId BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - PartitionId returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is PartitionId) { - return MergeFrom((PartitionId) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(PartitionId other) { - if (other == global::bnet.protocol.exchange.PartitionId.DefaultInstance) return this; - if (other.HasHigh) { - High = other.High; - } - if (other.HasLow) { - Low = other.Low; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 9: { - High = input.ReadFixed64(); - break; - } - case 17: { - Low = input.ReadFixed64(); - break; - } - } - } - } - - - public bool HasHigh { - get { return result.HasHigh; } - } - public ulong High { - get { return result.High; } - set { SetHigh(value); } - } - public Builder SetHigh(ulong value) { - result.hasHigh = true; - result.high_ = value; - return this; - } - public Builder ClearHigh() { - result.hasHigh = false; - result.high_ = 0; - return this; - } - - public bool HasLow { - get { return result.HasLow; } - } - public ulong Low { - get { return result.Low; } - set { SetLow(value); } - } - public Builder SetLow(ulong value) { - result.hasLow = true; - result.low_ = value; - return this; - } - public Builder ClearLow() { - result.hasLow = false; - result.low_ = 0; - return this; - } - } - static PartitionId() { - object.ReferenceEquals(global::bnet.protocol.exchange.Exchange.Descriptor, null); - } - } - - public sealed partial class BlobFrom : pb::GeneratedMessage { - private static readonly BlobFrom defaultInstance = new Builder().BuildPartial(); - public static BlobFrom DefaultInstance { - get { return defaultInstance; } - } - - public override BlobFrom DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override BlobFrom ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Exchange.internal__static_bnet_protocol_exchange_BlobFrom__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Exchange.internal__static_bnet_protocol_exchange_BlobFrom__FieldAccessorTable; } - } - - public const int SourceFieldNumber = 1; - private bool hasSource; - private uint source_ = 0; - public bool HasSource { - get { return hasSource; } - } - public uint Source { - get { return source_; } - } - - public const int DataFieldNumber = 2; - private bool hasData; - private pb::ByteString data_ = pb::ByteString.Empty; - public bool HasData { - get { return hasData; } - } - public pb::ByteString Data { - get { return data_; } - } - - public const int ExtraDataFieldNumber = 3; - private bool hasExtraData; - private pb::ByteString extraData_ = pb::ByteString.Empty; - public bool HasExtraData { - get { return hasExtraData; } - } - public pb::ByteString ExtraData { - get { return extraData_; } - } - - public override bool IsInitialized { - get { - if (!hasSource) return false; - if (!hasData) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasSource) { - output.WriteFixed32(1, Source); - } - if (HasData) { - output.WriteBytes(2, Data); - } - if (HasExtraData) { - output.WriteBytes(3, ExtraData); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasSource) { - size += pb::CodedOutputStream.ComputeFixed32Size(1, Source); - } - if (HasData) { - size += pb::CodedOutputStream.ComputeBytesSize(2, Data); - } - if (HasExtraData) { - size += pb::CodedOutputStream.ComputeBytesSize(3, ExtraData); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static BlobFrom ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BlobFrom ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BlobFrom ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BlobFrom ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BlobFrom ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BlobFrom ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static BlobFrom ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static BlobFrom ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static BlobFrom ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BlobFrom ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(BlobFrom prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - BlobFrom result = new BlobFrom(); - - protected override BlobFrom MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new BlobFrom(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.BlobFrom.Descriptor; } - } - - public override BlobFrom DefaultInstanceForType { - get { return global::bnet.protocol.exchange.BlobFrom.DefaultInstance; } - } - - public override BlobFrom BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - BlobFrom returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is BlobFrom) { - return MergeFrom((BlobFrom) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(BlobFrom other) { - if (other == global::bnet.protocol.exchange.BlobFrom.DefaultInstance) return this; - if (other.HasSource) { - Source = other.Source; - } - if (other.HasData) { - Data = other.Data; - } - if (other.HasExtraData) { - ExtraData = other.ExtraData; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 13: { - Source = input.ReadFixed32(); - break; - } - case 18: { - Data = input.ReadBytes(); - break; - } - case 26: { - ExtraData = input.ReadBytes(); - break; - } - } - } - } - - - public bool HasSource { - get { return result.HasSource; } - } - public uint Source { - get { return result.Source; } - set { SetSource(value); } - } - public Builder SetSource(uint value) { - result.hasSource = true; - result.source_ = value; - return this; - } - public Builder ClearSource() { - result.hasSource = false; - result.source_ = 0; - return this; - } - - public bool HasData { - get { return result.HasData; } - } - public pb::ByteString Data { - get { return result.Data; } - set { SetData(value); } - } - public Builder SetData(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasData = true; - result.data_ = value; - return this; - } - public Builder ClearData() { - result.hasData = false; - result.data_ = pb::ByteString.Empty; - return this; - } - - public bool HasExtraData { - get { return result.HasExtraData; } - } - public pb::ByteString ExtraData { - get { return result.ExtraData; } - set { SetExtraData(value); } - } - public Builder SetExtraData(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasExtraData = true; - result.extraData_ = value; - return this; - } - public Builder ClearExtraData() { - result.hasExtraData = false; - result.extraData_ = pb::ByteString.Empty; - return this; - } - } - static BlobFrom() { - object.ReferenceEquals(global::bnet.protocol.exchange.Exchange.Descriptor, null); - } - } - - public sealed partial class BlobOfType : pb::GeneratedMessage { - private static readonly BlobOfType defaultInstance = new Builder().BuildPartial(); - public static BlobOfType DefaultInstance { - get { return defaultInstance; } - } - - public override BlobOfType DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override BlobOfType ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Exchange.internal__static_bnet_protocol_exchange_BlobOfType__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Exchange.internal__static_bnet_protocol_exchange_BlobOfType__FieldAccessorTable; } - } - - public const int TypeFieldNumber = 1; - private bool hasType; - private string type_ = ""; - public bool HasType { - get { return hasType; } - } - public string Type { - get { return type_; } - } - - public const int DataFieldNumber = 2; - private bool hasData; - private pb::ByteString data_ = pb::ByteString.Empty; - public bool HasData { - get { return hasData; } - } - public pb::ByteString Data { - get { return data_; } - } - - public const int ExtraDataFieldNumber = 3; - private bool hasExtraData; - private pb::ByteString extraData_ = pb::ByteString.Empty; - public bool HasExtraData { - get { return hasExtraData; } - } - public pb::ByteString ExtraData { - get { return extraData_; } - } - - public override bool IsInitialized { - get { - if (!hasType) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasType) { - output.WriteString(1, Type); - } - if (HasData) { - output.WriteBytes(2, Data); - } - if (HasExtraData) { - output.WriteBytes(3, ExtraData); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasType) { - size += pb::CodedOutputStream.ComputeStringSize(1, Type); - } - if (HasData) { - size += pb::CodedOutputStream.ComputeBytesSize(2, Data); - } - if (HasExtraData) { - size += pb::CodedOutputStream.ComputeBytesSize(3, ExtraData); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static BlobOfType ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BlobOfType ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BlobOfType ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BlobOfType ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BlobOfType ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BlobOfType ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static BlobOfType ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static BlobOfType ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static BlobOfType ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BlobOfType ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(BlobOfType prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - BlobOfType result = new BlobOfType(); - - protected override BlobOfType MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new BlobOfType(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.BlobOfType.Descriptor; } - } - - public override BlobOfType DefaultInstanceForType { - get { return global::bnet.protocol.exchange.BlobOfType.DefaultInstance; } - } - - public override BlobOfType BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - BlobOfType returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is BlobOfType) { - return MergeFrom((BlobOfType) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(BlobOfType other) { - if (other == global::bnet.protocol.exchange.BlobOfType.DefaultInstance) return this; - if (other.HasType) { - Type = other.Type; - } - if (other.HasData) { - Data = other.Data; - } - if (other.HasExtraData) { - ExtraData = other.ExtraData; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - Type = input.ReadString(); - break; - } - case 18: { - Data = input.ReadBytes(); - break; - } - case 26: { - ExtraData = input.ReadBytes(); - break; - } - } - } - } - - - public bool HasType { - get { return result.HasType; } - } - public string Type { - get { return result.Type; } - set { SetType(value); } - } - public Builder SetType(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasType = true; - result.type_ = value; - return this; - } - public Builder ClearType() { - result.hasType = false; - result.type_ = ""; - return this; - } - - public bool HasData { - get { return result.HasData; } - } - public pb::ByteString Data { - get { return result.Data; } - set { SetData(value); } - } - public Builder SetData(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasData = true; - result.data_ = value; - return this; - } - public Builder ClearData() { - result.hasData = false; - result.data_ = pb::ByteString.Empty; - return this; - } - - public bool HasExtraData { - get { return result.HasExtraData; } - } - public pb::ByteString ExtraData { - get { return result.ExtraData; } - set { SetExtraData(value); } - } - public Builder SetExtraData(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasExtraData = true; - result.extraData_ = value; - return this; - } - public Builder ClearExtraData() { - result.hasExtraData = false; - result.extraData_ = pb::ByteString.Empty; - return this; - } - } - static BlobOfType() { - object.ReferenceEquals(global::bnet.protocol.exchange.Exchange.Descriptor, null); - } - } - - public sealed partial class BlobFromOfType : pb::GeneratedMessage { - private static readonly BlobFromOfType defaultInstance = new Builder().BuildPartial(); - public static BlobFromOfType DefaultInstance { - get { return defaultInstance; } - } - - public override BlobFromOfType DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override BlobFromOfType ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Exchange.internal__static_bnet_protocol_exchange_BlobFromOfType__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Exchange.internal__static_bnet_protocol_exchange_BlobFromOfType__FieldAccessorTable; } - } - - public const int SourceFieldNumber = 1; - private bool hasSource; - private uint source_ = 0; - public bool HasSource { - get { return hasSource; } - } - public uint Source { - get { return source_; } - } - - public const int TypeFieldNumber = 2; - private bool hasType; - private string type_ = ""; - public bool HasType { - get { return hasType; } - } - public string Type { - get { return type_; } - } - - public const int DataFieldNumber = 3; - private bool hasData; - private pb::ByteString data_ = pb::ByteString.Empty; - public bool HasData { - get { return hasData; } - } - public pb::ByteString Data { - get { return data_; } - } - - public override bool IsInitialized { - get { - if (!hasSource) return false; - if (!hasType) return false; - if (!hasData) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasSource) { - output.WriteFixed32(1, Source); - } - if (HasType) { - output.WriteString(2, Type); - } - if (HasData) { - output.WriteBytes(3, Data); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasSource) { - size += pb::CodedOutputStream.ComputeFixed32Size(1, Source); - } - if (HasType) { - size += pb::CodedOutputStream.ComputeStringSize(2, Type); - } - if (HasData) { - size += pb::CodedOutputStream.ComputeBytesSize(3, Data); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static BlobFromOfType ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BlobFromOfType ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BlobFromOfType ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BlobFromOfType ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BlobFromOfType ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BlobFromOfType ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static BlobFromOfType ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static BlobFromOfType ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static BlobFromOfType ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BlobFromOfType ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(BlobFromOfType prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - BlobFromOfType result = new BlobFromOfType(); - - protected override BlobFromOfType MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new BlobFromOfType(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.BlobFromOfType.Descriptor; } - } - - public override BlobFromOfType DefaultInstanceForType { - get { return global::bnet.protocol.exchange.BlobFromOfType.DefaultInstance; } - } - - public override BlobFromOfType BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - BlobFromOfType returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is BlobFromOfType) { - return MergeFrom((BlobFromOfType) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(BlobFromOfType other) { - if (other == global::bnet.protocol.exchange.BlobFromOfType.DefaultInstance) return this; - if (other.HasSource) { - Source = other.Source; - } - if (other.HasType) { - Type = other.Type; - } - if (other.HasData) { - Data = other.Data; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 13: { - Source = input.ReadFixed32(); - break; - } - case 18: { - Type = input.ReadString(); - break; - } - case 26: { - Data = input.ReadBytes(); - break; - } - } - } - } - - - public bool HasSource { - get { return result.HasSource; } - } - public uint Source { - get { return result.Source; } - set { SetSource(value); } - } - public Builder SetSource(uint value) { - result.hasSource = true; - result.source_ = value; - return this; - } - public Builder ClearSource() { - result.hasSource = false; - result.source_ = 0; - return this; - } - - public bool HasType { - get { return result.HasType; } - } - public string Type { - get { return result.Type; } - set { SetType(value); } - } - public Builder SetType(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasType = true; - result.type_ = value; - return this; - } - public Builder ClearType() { - result.hasType = false; - result.type_ = ""; - return this; - } - - public bool HasData { - get { return result.HasData; } - } - public pb::ByteString Data { - get { return result.Data; } - set { SetData(value); } - } - public Builder SetData(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasData = true; - result.data_ = value; - return this; - } - public Builder ClearData() { - result.hasData = false; - result.data_ = pb::ByteString.Empty; - return this; - } - } - static BlobFromOfType() { - object.ReferenceEquals(global::bnet.protocol.exchange.Exchange.Descriptor, null); - } - } - - #endregion - -} diff --git a/source/D3Proto/bnet/protocol/exchange/ExchangeService.cs b/source/D3Proto/bnet/protocol/exchange/ExchangeService.cs deleted file mode 100644 index 5de1729a..00000000 --- a/source/D3Proto/bnet/protocol/exchange/ExchangeService.cs +++ /dev/null @@ -1,11955 +0,0 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace bnet.protocol.exchange { - - namespace Proto { - - public static partial class ExchangeService { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_CreateOrderBookRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_CreateOrderBookRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_CreateOrderBookResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_CreateOrderBookResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_PlaceOfferOnOrderBookRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_PlaceOfferOnOrderBookRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_PlaceOfferOnOrderBookResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_PlaceOfferOnOrderBookResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_PlaceOfferCreateOrderBookIfNeededRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_PlaceOfferCreateOrderBookIfNeededRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_PlaceOfferCreateOrderBookIfNeededResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_PlaceOfferCreateOrderBookIfNeededResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_PlaceBidOnOrderBookRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_PlaceBidOnOrderBookRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_PlaceBidOnOrderBookResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_PlaceBidOnOrderBookResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_PlaceBidCreateOrderBookIfNeededRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_PlaceBidCreateOrderBookIfNeededRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_PlaceBidCreateOrderBookIfNeededResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_PlaceBidCreateOrderBookIfNeededResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_QueryOffersByOrderBookRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_QueryOffersByOrderBookRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_QueryOffersByOrderBookResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_QueryOffersByOrderBookResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_QueryBidsByOrderBookRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_QueryBidsByOrderBookRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_QueryBidsByOrderBookResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_QueryBidsByOrderBookResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_QueryOffersByAccountForItemRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_QueryOffersByAccountForItemRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_QueryOffersByAccountForItemResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_QueryOffersByAccountForItemResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_QueryBidsByAccountForItemRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_QueryBidsByAccountForItemRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_QueryBidsByAccountForItemResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_QueryBidsByAccountForItemResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_QueryOrderBooksSummaryRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_QueryOrderBooksSummaryRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_QueryOrderBooksSummaryResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_QueryOrderBooksSummaryResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_QuerySettlementsByOrderBookRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_QuerySettlementsByOrderBookRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_QuerySettlementsByOrderBookResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_QuerySettlementsByOrderBookResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_SubscribeOrderBookStatusChangeRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_SubscribeOrderBookStatusChangeRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_UnsubscribeOrderBookStatusChangeRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_UnsubscribeOrderBookStatusChangeRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_SubscribeOrderStatusChangeRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_SubscribeOrderStatusChangeRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_UnsubscribeOrderStatusChangeRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_UnsubscribeOrderStatusChangeRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_ClaimRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_ClaimRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_CancelRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_CancelRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_GetConfigurationRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_GetConfigurationRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_GetConfigurationResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_GetConfigurationResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_GetOfferFeeEstimationRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_GetOfferFeeEstimationRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_GetBidFeeEstimationRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_GetBidFeeEstimationRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_GetFeeEstimationResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_GetFeeEstimationResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_OrderBookNotificationRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_OrderBookNotificationRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_OfferNotificationRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_OfferNotificationRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_BidNotificationRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_BidNotificationRequest__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static ExchangeService() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "Ch9zZXJ2aWNlL2V4Y2hhbmdlL2V4Y2hhbmdlLnByb3RvEhZibmV0LnByb3Rv" + - "Y29sLmV4Y2hhbmdlGiRnb29nbGUvcHJvdG9idWYvY3NoYXJwX29wdGlvbnMu" + - "cHJvdG8aEWxpYi9ycGMvcnBjLnByb3RvGhtsaWIvcHJvdG9jb2wvZXhjaGFu" + - "Z2UucHJvdG8aK2xpYi9wcm90b2NvbC9leGNoYW5nZV9vYmplY3RfcHJvdmlk" + - "ZXIucHJvdG8aGWxpYi9wcm90b2NvbC9lbnRpdHkucHJvdG8aJXNlcnZpY2Uv" + - "ZXhjaGFuZ2UvZXhjaGFuZ2VfdHlwZXMucHJvdG8iigEKFkNyZWF0ZU9yZGVy" + - "Qm9va1JlcXVlc3QSOQoMcGFydGl0aW9uX2lkGAEgAigLMiMuYm5ldC5wcm90" + - "b2NvbC5leGNoYW5nZS5QYXJ0aXRpb25JZBI1CgpvcmRlcl9ib29rGAIgAigL" + - "MiEuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5PcmRlckJvb2siMAoXQ3JlYXRl" + - "T3JkZXJCb29rUmVzcG9uc2USFQoNb3JkZXJfYm9va19pZBgBIAEoBCKYAQoc" + - "UGxhY2VPZmZlck9uT3JkZXJCb29rUmVxdWVzdBI5CgxwYXJ0aXRpb25faWQY" + - "ASACKAsyIy5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLlBhcnRpdGlvbklkEj0K" + - "Dm9mZmVyX2NyZWF0aW9uGAIgAigLMiUuYm5ldC5wcm90b2NvbC5leGNoYW5n" + - "ZS5PZmZlckNyZWF0aW9uIkgKHVBsYWNlT2ZmZXJPbk9yZGVyQm9va1Jlc3Bv" + - "bnNlEhUKDW9yZGVyX2Jvb2tfaWQYASABKAQSEAoIb2ZmZXJfaWQYAiABKAQi" + - "2wEKKFBsYWNlT2ZmZXJDcmVhdGVPcmRlckJvb2tJZk5lZWRlZFJlcXVlc3QS" + - "OQoMcGFydGl0aW9uX2lkGAEgAigLMiMuYm5ldC5wcm90b2NvbC5leGNoYW5n" + - "ZS5QYXJ0aXRpb25JZBI1CgpvcmRlcl9ib29rGAIgAigLMiEuYm5ldC5wcm90" + - "b2NvbC5leGNoYW5nZS5PcmRlckJvb2sSPQoOb2ZmZXJfY3JlYXRpb24YAyAC" + - "KAsyJS5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLk9mZmVyQ3JlYXRpb24iVAop" + - "UGxhY2VPZmZlckNyZWF0ZU9yZGVyQm9va0lmTmVlZGVkUmVzcG9uc2USFQoN" + - "b3JkZXJfYm9va19pZBgBIAEoBBIQCghvZmZlcl9pZBgCIAEoBCKSAQoaUGxh" + - "Y2VCaWRPbk9yZGVyQm9va1JlcXVlc3QSOQoMcGFydGl0aW9uX2lkGAEgAigL" + - "MiMuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5QYXJ0aXRpb25JZBI5CgxiaWRf" + - "Y3JlYXRpb24YAiACKAsyIy5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLkJpZENy" + - "ZWF0aW9uIkQKG1BsYWNlQmlkT25PcmRlckJvb2tSZXNwb25zZRIVCg1vcmRl" + - "cl9ib29rX2lkGAEgASgEEg4KBmJpZF9pZBgCIAEoBCLVAQomUGxhY2VCaWRD" + - "cmVhdGVPcmRlckJvb2tJZk5lZWRlZFJlcXVlc3QSOQoMcGFydGl0aW9uX2lk" + - "GAEgAigLMiMuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5QYXJ0aXRpb25JZBI1" + - "CgpvcmRlcl9ib29rGAIgAigLMiEuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5P" + - "cmRlckJvb2sSOQoMYmlkX2NyZWF0aW9uGAMgAigLMiMuYm5ldC5wcm90b2Nv" + - "bC5leGNoYW5nZS5CaWRDcmVhdGlvbiJQCidQbGFjZUJpZENyZWF0ZU9yZGVy" + - "Qm9va0lmTmVlZGVkUmVzcG9uc2USFQoNb3JkZXJfYm9va19pZBgBIAEoBBIO" + - "CgZiaWRfaWQYAiABKAQiqAEKHVF1ZXJ5T2ZmZXJzQnlPcmRlckJvb2tSZXF1" + - "ZXN0EjkKDHBhcnRpdGlvbl9pZBgBIAIoCzIjLmJuZXQucHJvdG9jb2wuZXhj" + - "aGFuZ2UuUGFydGl0aW9uSWQSPAoGZmlsdGVyGAIgAigLMiwuYm5ldC5wcm90" + - "b2NvbC5leGNoYW5nZS5RdWVyeUZpbHRlckJ5T3JkZXJJZBIOCgZzdGF0dXMY" + - "AyACKAUibAoeUXVlcnlPZmZlcnNCeU9yZGVyQm9va1Jlc3BvbnNlEjUKBm9m" + - "ZmVycxgBIAMoCzIlLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuT2ZmZXJFeHRl" + - "bmRlZBITCgt0b3RhbF9jb3VudBgCIAIoDSKmAQobUXVlcnlCaWRzQnlPcmRl" + - "ckJvb2tSZXF1ZXN0EjkKDHBhcnRpdGlvbl9pZBgBIAIoCzIjLmJuZXQucHJv" + - "dG9jb2wuZXhjaGFuZ2UuUGFydGl0aW9uSWQSPAoGZmlsdGVyGAIgAigLMiwu" + - "Ym5ldC5wcm90b2NvbC5leGNoYW5nZS5RdWVyeUZpbHRlckJ5T3JkZXJJZBIO" + - "CgZzdGF0dXMYAyACKAUiZgocUXVlcnlCaWRzQnlPcmRlckJvb2tSZXNwb25z" + - "ZRIxCgRiaWRzGAEgAygLMiMuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5CaWRF" + - "eHRlbmRlZBITCgt0b3RhbF9jb3VudBgCIAIoDSLRAQoiUXVlcnlPZmZlcnNC" + - "eUFjY291bnRGb3JJdGVtUmVxdWVzdBI6ChBhY2NvdW50X2Zvcl9pdGVtGAEg" + - "AigLMiAuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5CbG9iRnJvbRJACgZmaWx0" + - "ZXIYAiACKAsyMC5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLlF1ZXJ5RmlsdGVy" + - "QnlDcmVhdGVkVGltZRItCgxibmV0X2FjY291bnQYAyABKAsyFy5ibmV0LnBy" + - "b3RvY29sLkVudGl0eUlkInEKI1F1ZXJ5T2ZmZXJzQnlBY2NvdW50Rm9ySXRl" + - "bVJlc3BvbnNlEjUKBm9mZmVycxgBIAMoCzIlLmJuZXQucHJvdG9jb2wuZXhj" + - "aGFuZ2UuT2ZmZXJFeHRlbmRlZBITCgt0b3RhbF9jb3VudBgCIAIoDSLPAQog" + - "UXVlcnlCaWRzQnlBY2NvdW50Rm9ySXRlbVJlcXVlc3QSOgoQYWNjb3VudF9m" + - "b3JfaXRlbRgBIAIoCzIgLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuQmxvYkZy" + - "b20SQAoGZmlsdGVyGAIgAigLMjAuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5R" + - "dWVyeUZpbHRlckJ5Q3JlYXRlZFRpbWUSLQoMYm5ldF9hY2NvdW50GAMgASgL" + - "MhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZCJrCiFRdWVyeUJpZHNCeUFjY291" + - "bnRGb3JJdGVtUmVzcG9uc2USMQoEYmlkcxgBIAMoCzIjLmJuZXQucHJvdG9j" + - "b2wuZXhjaGFuZ2UuQmlkRXh0ZW5kZWQSEwoLdG90YWxfY291bnQYAiACKA0i" + - "WQodUXVlcnlPcmRlckJvb2tzU3VtbWFyeVJlcXVlc3QSOAoHaGFuZGxlcxgB" + - "IAMoCzInLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuT3JkZXJCb29rSGFuZGxl" + - "Il8KHlF1ZXJ5T3JkZXJCb29rc1N1bW1hcnlSZXNwb25zZRI9CgtvcmRlcl9i" + - "b29rcxgBIAMoCzIoLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuT3JkZXJCb29r" + - "U3VtbWFyeSKdAQoiUXVlcnlTZXR0bGVtZW50c0J5T3JkZXJCb29rUmVxdWVz" + - "dBI5CgxwYXJ0aXRpb25faWQYASACKAsyIy5ibmV0LnByb3RvY29sLmV4Y2hh" + - "bmdlLlBhcnRpdGlvbklkEjwKBmZpbHRlchgCIAIoCzIsLmJuZXQucHJvdG9j" + - "b2wuZXhjaGFuZ2UuUXVlcnlGaWx0ZXJCeU9yZGVySWQiXgojUXVlcnlTZXR0" + - "bGVtZW50c0J5T3JkZXJCb29rUmVzcG9uc2USNwoLc2V0dGxlbWVudHMYASAD" + - "KAsyIi5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLlNldHRsZW1lbnQikgIKJVN1" + - "YnNjcmliZU9yZGVyQm9va1N0YXR1c0NoYW5nZVJlcXVlc3QSEQoJb2JqZWN0" + - "X2lkGAEgAigEEj0KEG1pbl9wYXJ0aXRpb25faWQYAiACKAsyIy5ibmV0LnBy" + - "b3RvY29sLmV4Y2hhbmdlLlBhcnRpdGlvbklkEj0KEG1heF9wYXJ0aXRpb25f" + - "aWQYAyACKAsyIy5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLlBhcnRpdGlvbklk" + - "Eg8KB3Byb2dyYW0YBCACKAcSDgoGc3RhdHVzGAUgAigFEhAKCGN1cnJlbmN5" + - "GAYgASgJEhIKCnNwZWNpYWxpc3QYByABKAUSEQoJYm9vdHN0cmFwGAggASgI" + - "IikKJ1Vuc3Vic2NyaWJlT3JkZXJCb29rU3RhdHVzQ2hhbmdlUmVxdWVzdCJh" + - "CiFTdWJzY3JpYmVPcmRlclN0YXR1c0NoYW5nZVJlcXVlc3QSKQoIYWdlbnRf" + - "aWQYASACKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEhEKCW9iamVjdF9p" + - "ZBgCIAIoBCJjCiNVbnN1YnNjcmliZU9yZGVyU3RhdHVzQ2hhbmdlUmVxdWVz" + - "dBIpCghhZ2VudF9pZBgBIAIoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQS" + - "EQoJb2JqZWN0X2lkGAIgAigEIooBCgxDbGFpbVJlcXVlc3QSOQoMcGFydGl0" + - "aW9uX2lkGAEgAigLMiMuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5QYXJ0aXRp" + - "b25JZBIQCghvcmRlcl9pZBgCIAIoDRItCgxibmV0X2FjY291bnQYAyABKAsy" + - "Fy5ibmV0LnByb3RvY29sLkVudGl0eUlkIpsBCg1DYW5jZWxSZXF1ZXN0EjkK" + - "DHBhcnRpdGlvbl9pZBgBIAIoCzIjLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2Uu" + - "UGFydGl0aW9uSWQSEAoIb3JkZXJfaWQYAiACKA0SDgoGcmVhc29uGAMgASgN" + - "Ei0KDGJuZXRfYWNjb3VudBgEIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5" + - "SWQiKgoXR2V0Q29uZmlndXJhdGlvblJlcXVlc3QSDwoHcHJvZ3JhbRgBIAIo" + - "ByJVChhHZXRDb25maWd1cmF0aW9uUmVzcG9uc2USOQoHY29uZmlncxgBIAMo" + - "CzIoLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuU3BlY2lhbGlzdENvbmZpZyKS" + - "AQocR2V0T2ZmZXJGZWVFc3RpbWF0aW9uUmVxdWVzdBI5CgxwYXJ0aXRpb25f" + - "aWQYASACKAsyIy5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLlBhcnRpdGlvbklk" + - "EjcKBGRhdGEYAiACKAsyKS5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLkZlZUVz" + - "dGltYXRpb25EYXRhIpABChpHZXRCaWRGZWVFc3RpbWF0aW9uUmVxdWVzdBI5" + - "CgxwYXJ0aXRpb25faWQYASACKAsyIy5ibmV0LnByb3RvY29sLmV4Y2hhbmdl" + - "LlBhcnRpdGlvbklkEjcKBGRhdGEYAiACKAsyKS5ibmV0LnByb3RvY29sLmV4" + - "Y2hhbmdlLkZlZUVzdGltYXRpb25EYXRhIi4KGEdldEZlZUVzdGltYXRpb25S" + - "ZXNwb25zZRISCgpmZWVfYW1vdW50GAEgASgEIn0KHE9yZGVyQm9va05vdGlm" + - "aWNhdGlvblJlcXVlc3QSRAoNbm90aWZpY2F0aW9ucxgBIAMoCzItLmJuZXQu" + - "cHJvdG9jb2wuZXhjaGFuZ2UuT3JkZXJCb29rTm90aWZpY2F0aW9uEhcKD2Jv" + - "b3Rfc3RyYXBfbGFzdBgCIAEoCCJfChhPZmZlck5vdGlmaWNhdGlvblJlcXVl" + - "c3QSNAoFb2ZmZXIYASACKAsyJS5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLk9m" + - "ZmVyRXh0ZW5kZWQSDQoFZXZlbnQYAiACKA0iWQoWQmlkTm90aWZpY2F0aW9u" + - "UmVxdWVzdBIwCgNiaWQYASACKAsyIy5ibmV0LnByb3RvY29sLmV4Y2hhbmdl" + - "LkJpZEV4dGVuZGVkEg0KBWV2ZW50GAIgAigNMqUaCg9FeGNoYW5nZVNlcnZp" + - "Y2UScgoPQ3JlYXRlT3JkZXJCb29rEi4uYm5ldC5wcm90b2NvbC5leGNoYW5n" + - "ZS5DcmVhdGVPcmRlckJvb2tSZXF1ZXN0Gi8uYm5ldC5wcm90b2NvbC5leGNo" + - "YW5nZS5DcmVhdGVPcmRlckJvb2tSZXNwb25zZRKEAQoVUGxhY2VPZmZlck9u" + - "T3JkZXJCb29rEjQuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5QbGFjZU9mZmVy" + - "T25PcmRlckJvb2tSZXF1ZXN0GjUuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5Q" + - "bGFjZU9mZmVyT25PcmRlckJvb2tSZXNwb25zZRKoAQohUGxhY2VPZmZlckNy" + - "ZWF0ZU9yZGVyQm9va0lmTmVlZGVkEkAuYm5ldC5wcm90b2NvbC5leGNoYW5n" + - "ZS5QbGFjZU9mZmVyQ3JlYXRlT3JkZXJCb29rSWZOZWVkZWRSZXF1ZXN0GkEu" + - "Ym5ldC5wcm90b2NvbC5leGNoYW5nZS5QbGFjZU9mZmVyQ3JlYXRlT3JkZXJC" + - "b29rSWZOZWVkZWRSZXNwb25zZRJ+ChNQbGFjZUJpZE9uT3JkZXJCb29rEjIu" + - "Ym5ldC5wcm90b2NvbC5leGNoYW5nZS5QbGFjZUJpZE9uT3JkZXJCb29rUmVx" + - "dWVzdBozLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuUGxhY2VCaWRPbk9yZGVy" + - "Qm9va1Jlc3BvbnNlEqIBCh9QbGFjZUJpZENyZWF0ZU9yZGVyQm9va0lmTmVl" + - "ZGVkEj4uYm5ldC5wcm90b2NvbC5leGNoYW5nZS5QbGFjZUJpZENyZWF0ZU9y" + - "ZGVyQm9va0lmTmVlZGVkUmVxdWVzdBo/LmJuZXQucHJvdG9jb2wuZXhjaGFu" + - "Z2UuUGxhY2VCaWRDcmVhdGVPcmRlckJvb2tJZk5lZWRlZFJlc3BvbnNlEocB" + - "ChZRdWVyeU9mZmVyc0J5T3JkZXJCb29rEjUuYm5ldC5wcm90b2NvbC5leGNo" + - "YW5nZS5RdWVyeU9mZmVyc0J5T3JkZXJCb29rUmVxdWVzdBo2LmJuZXQucHJv" + - "dG9jb2wuZXhjaGFuZ2UuUXVlcnlPZmZlcnNCeU9yZGVyQm9va1Jlc3BvbnNl" + - "EoEBChRRdWVyeUJpZHNCeU9yZGVyQm9vaxIzLmJuZXQucHJvdG9jb2wuZXhj" + - "aGFuZ2UuUXVlcnlCaWRzQnlPcmRlckJvb2tSZXF1ZXN0GjQuYm5ldC5wcm90" + - "b2NvbC5leGNoYW5nZS5RdWVyeUJpZHNCeU9yZGVyQm9va1Jlc3BvbnNlEpYB" + - "ChtRdWVyeU9mZmVyc0J5QWNjb3VudEZvckl0ZW0SOi5ibmV0LnByb3RvY29s" + - "LmV4Y2hhbmdlLlF1ZXJ5T2ZmZXJzQnlBY2NvdW50Rm9ySXRlbVJlcXVlc3Qa" + - "Oy5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLlF1ZXJ5T2ZmZXJzQnlBY2NvdW50" + - "Rm9ySXRlbVJlc3BvbnNlEpABChlRdWVyeUJpZHNCeUFjY291bnRGb3JJdGVt" + - "EjguYm5ldC5wcm90b2NvbC5leGNoYW5nZS5RdWVyeUJpZHNCeUFjY291bnRG" + - "b3JJdGVtUmVxdWVzdBo5LmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuUXVlcnlC" + - "aWRzQnlBY2NvdW50Rm9ySXRlbVJlc3BvbnNlEocBChZRdWVyeU9yZGVyQm9v" + - "a3NTdW1tYXJ5EjUuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5RdWVyeU9yZGVy" + - "Qm9va3NTdW1tYXJ5UmVxdWVzdBo2LmJuZXQucHJvdG9jb2wuZXhjaGFuZ2Uu" + - "UXVlcnlPcmRlckJvb2tzU3VtbWFyeVJlc3BvbnNlEpYBChtRdWVyeVNldHRs" + - "ZW1lbnRzQnlPcmRlckJvb2sSOi5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLlF1" + - "ZXJ5U2V0dGxlbWVudHNCeU9yZGVyQm9va1JlcXVlc3QaOy5ibmV0LnByb3Rv" + - "Y29sLmV4Y2hhbmdlLlF1ZXJ5U2V0dGxlbWVudHNCeU9yZGVyQm9va1Jlc3Bv" + - "bnNlEmgKD1JlcG9ydEF1dGhvcml6ZRI+LmJuZXQucHJvdG9jb2wuZXhjaGFu" + - "Z2Vfb2JqZWN0X3Byb3ZpZGVyLlJlcG9ydEF1dGhvcml6ZVJlcXVlc3QaFS5i" + - "bmV0LnByb3RvY29sLk5vRGF0YRJiCgxSZXBvcnRTZXR0bGUSOy5ibmV0LnBy" + - "b3RvY29sLmV4Y2hhbmdlX29iamVjdF9wcm92aWRlci5SZXBvcnRTZXR0bGVS" + - "ZXF1ZXN0GhUuYm5ldC5wcm90b2NvbC5Ob0RhdGESYgoMUmVwb3J0Q2FuY2Vs" + - "EjsuYm5ldC5wcm90b2NvbC5leGNoYW5nZV9vYmplY3RfcHJvdmlkZXIuUmVw" + - "b3J0Q2FuY2VsUmVxdWVzdBoVLmJuZXQucHJvdG9jb2wuTm9EYXRhEnYKHlN1" + - "YnNjcmliZU9yZGVyQm9va1N0YXR1c0NoYW5nZRI9LmJuZXQucHJvdG9jb2wu" + - "ZXhjaGFuZ2UuU3Vic2NyaWJlT3JkZXJCb29rU3RhdHVzQ2hhbmdlUmVxdWVz" + - "dBoVLmJuZXQucHJvdG9jb2wuTm9EYXRhEnoKIFVuc3Vic2NyaWJlT3JkZXJC" + - "b29rU3RhdHVzQ2hhbmdlEj8uYm5ldC5wcm90b2NvbC5leGNoYW5nZS5VbnN1" + - "YnNjcmliZU9yZGVyQm9va1N0YXR1c0NoYW5nZVJlcXVlc3QaFS5ibmV0LnBy" + - "b3RvY29sLk5vRGF0YRJuChpTdWJzY3JpYmVPcmRlclN0YXR1c0NoYW5nZRI5" + - "LmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuU3Vic2NyaWJlT3JkZXJTdGF0dXND" + - "aGFuZ2VSZXF1ZXN0GhUuYm5ldC5wcm90b2NvbC5Ob0RhdGEScgocVW5zdWJz" + - "Y3JpYmVPcmRlclN0YXR1c0NoYW5nZRI7LmJuZXQucHJvdG9jb2wuZXhjaGFu" + - "Z2UuVW5zdWJzY3JpYmVPcmRlclN0YXR1c0NoYW5nZVJlcXVlc3QaFS5ibmV0" + - "LnByb3RvY29sLk5vRGF0YRKYAQoRR2V0UGF5bWVudE1ldGhvZHMSQC5ibmV0" + - "LnByb3RvY29sLmV4Y2hhbmdlX29iamVjdF9wcm92aWRlci5HZXRQYXltZW50" + - "TWV0aG9kc1JlcXVlc3QaQS5ibmV0LnByb3RvY29sLmV4Y2hhbmdlX29iamVj" + - "dF9wcm92aWRlci5HZXRQYXltZW50TWV0aG9kc1Jlc3BvbnNlEksKDENsYWlt" + - "QmlkSXRlbRIkLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuQ2xhaW1SZXF1ZXN0" + - "GhUuYm5ldC5wcm90b2NvbC5Ob0RhdGESTAoNQ2xhaW1CaWRNb25leRIkLmJu" + - "ZXQucHJvdG9jb2wuZXhjaGFuZ2UuQ2xhaW1SZXF1ZXN0GhUuYm5ldC5wcm90" + - "b2NvbC5Ob0RhdGESTQoOQ2xhaW1PZmZlckl0ZW0SJC5ibmV0LnByb3RvY29s" + - "LmV4Y2hhbmdlLkNsYWltUmVxdWVzdBoVLmJuZXQucHJvdG9jb2wuTm9EYXRh" + - "Ek4KD0NsYWltT2ZmZXJNb25leRIkLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2Uu" + - "Q2xhaW1SZXF1ZXN0GhUuYm5ldC5wcm90b2NvbC5Ob0RhdGESSQoJQ2FuY2Vs" + - "QmlkEiUuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5DYW5jZWxSZXF1ZXN0GhUu" + - "Ym5ldC5wcm90b2NvbC5Ob0RhdGESSwoLQ2FuY2VsT2ZmZXISJS5ibmV0LnBy" + - "b3RvY29sLmV4Y2hhbmdlLkNhbmNlbFJlcXVlc3QaFS5ibmV0LnByb3RvY29s" + - "Lk5vRGF0YRJ1ChBHZXRDb25maWd1cmF0aW9uEi8uYm5ldC5wcm90b2NvbC5l" + - "eGNoYW5nZS5HZXRDb25maWd1cmF0aW9uUmVxdWVzdBowLmJuZXQucHJvdG9j" + - "b2wuZXhjaGFuZ2UuR2V0Q29uZmlndXJhdGlvblJlc3BvbnNlEnsKE0dldEJp" + - "ZEZlZUVzdGltYXRpb24SMi5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLkdldEJp" + - "ZEZlZUVzdGltYXRpb25SZXF1ZXN0GjAuYm5ldC5wcm90b2NvbC5leGNoYW5n" + - "ZS5HZXRGZWVFc3RpbWF0aW9uUmVzcG9uc2USfwoVR2V0T2ZmZXJGZWVFc3Rp" + - "bWF0aW9uEjQuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5HZXRPZmZlckZlZUVz" + - "dGltYXRpb25SZXF1ZXN0GjAuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5HZXRG" + - "ZWVFc3RpbWF0aW9uUmVzcG9uc2UyzwIKDkV4Y2hhbmdlTm90aWZ5Em8KG05v" + - "dGlmeU9yZGVyQm9va1N0YXR1c0NoYW5nZRI0LmJuZXQucHJvdG9jb2wuZXhj" + - "aGFuZ2UuT3JkZXJCb29rTm90aWZpY2F0aW9uUmVxdWVzdBoaLmJuZXQucHJv" + - "dG9jb2wuTk9fUkVTUE9OU0USZwoXTm90aWZ5T2ZmZXJTdGF0dXNDaGFuZ2US" + - "MC5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLk9mZmVyTm90aWZpY2F0aW9uUmVx" + - "dWVzdBoaLmJuZXQucHJvdG9jb2wuTk9fUkVTUE9OU0USYwoVTm90aWZ5Qmlk" + - "U3RhdHVzQ2hhbmdlEi4uYm5ldC5wcm90b2NvbC5leGNoYW5nZS5CaWROb3Rp" + - "ZmljYXRpb25SZXF1ZXN0GhouYm5ldC5wcm90b2NvbC5OT19SRVNQT05TRUIp" + - "QhBDRXhjaGFuZ2VTZXJ2aWNlgAEBwj4REg9FeGNoYW5nZVNlcnZpY2U="); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_bnet_protocol_exchange_CreateOrderBookRequest__Descriptor = Descriptor.MessageTypes[0]; - internal__static_bnet_protocol_exchange_CreateOrderBookRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_CreateOrderBookRequest__Descriptor, - new string[] { "PartitionId", "OrderBook", }); - internal__static_bnet_protocol_exchange_CreateOrderBookResponse__Descriptor = Descriptor.MessageTypes[1]; - internal__static_bnet_protocol_exchange_CreateOrderBookResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_CreateOrderBookResponse__Descriptor, - new string[] { "OrderBookId", }); - internal__static_bnet_protocol_exchange_PlaceOfferOnOrderBookRequest__Descriptor = Descriptor.MessageTypes[2]; - internal__static_bnet_protocol_exchange_PlaceOfferOnOrderBookRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_PlaceOfferOnOrderBookRequest__Descriptor, - new string[] { "PartitionId", "OfferCreation", }); - internal__static_bnet_protocol_exchange_PlaceOfferOnOrderBookResponse__Descriptor = Descriptor.MessageTypes[3]; - internal__static_bnet_protocol_exchange_PlaceOfferOnOrderBookResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_PlaceOfferOnOrderBookResponse__Descriptor, - new string[] { "OrderBookId", "OfferId", }); - internal__static_bnet_protocol_exchange_PlaceOfferCreateOrderBookIfNeededRequest__Descriptor = Descriptor.MessageTypes[4]; - internal__static_bnet_protocol_exchange_PlaceOfferCreateOrderBookIfNeededRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_PlaceOfferCreateOrderBookIfNeededRequest__Descriptor, - new string[] { "PartitionId", "OrderBook", "OfferCreation", }); - internal__static_bnet_protocol_exchange_PlaceOfferCreateOrderBookIfNeededResponse__Descriptor = Descriptor.MessageTypes[5]; - internal__static_bnet_protocol_exchange_PlaceOfferCreateOrderBookIfNeededResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_PlaceOfferCreateOrderBookIfNeededResponse__Descriptor, - new string[] { "OrderBookId", "OfferId", }); - internal__static_bnet_protocol_exchange_PlaceBidOnOrderBookRequest__Descriptor = Descriptor.MessageTypes[6]; - internal__static_bnet_protocol_exchange_PlaceBidOnOrderBookRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_PlaceBidOnOrderBookRequest__Descriptor, - new string[] { "PartitionId", "BidCreation", }); - internal__static_bnet_protocol_exchange_PlaceBidOnOrderBookResponse__Descriptor = Descriptor.MessageTypes[7]; - internal__static_bnet_protocol_exchange_PlaceBidOnOrderBookResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_PlaceBidOnOrderBookResponse__Descriptor, - new string[] { "OrderBookId", "BidId", }); - internal__static_bnet_protocol_exchange_PlaceBidCreateOrderBookIfNeededRequest__Descriptor = Descriptor.MessageTypes[8]; - internal__static_bnet_protocol_exchange_PlaceBidCreateOrderBookIfNeededRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_PlaceBidCreateOrderBookIfNeededRequest__Descriptor, - new string[] { "PartitionId", "OrderBook", "BidCreation", }); - internal__static_bnet_protocol_exchange_PlaceBidCreateOrderBookIfNeededResponse__Descriptor = Descriptor.MessageTypes[9]; - internal__static_bnet_protocol_exchange_PlaceBidCreateOrderBookIfNeededResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_PlaceBidCreateOrderBookIfNeededResponse__Descriptor, - new string[] { "OrderBookId", "BidId", }); - internal__static_bnet_protocol_exchange_QueryOffersByOrderBookRequest__Descriptor = Descriptor.MessageTypes[10]; - internal__static_bnet_protocol_exchange_QueryOffersByOrderBookRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_QueryOffersByOrderBookRequest__Descriptor, - new string[] { "PartitionId", "Filter", "Status", }); - internal__static_bnet_protocol_exchange_QueryOffersByOrderBookResponse__Descriptor = Descriptor.MessageTypes[11]; - internal__static_bnet_protocol_exchange_QueryOffersByOrderBookResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_QueryOffersByOrderBookResponse__Descriptor, - new string[] { "Offers", "TotalCount", }); - internal__static_bnet_protocol_exchange_QueryBidsByOrderBookRequest__Descriptor = Descriptor.MessageTypes[12]; - internal__static_bnet_protocol_exchange_QueryBidsByOrderBookRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_QueryBidsByOrderBookRequest__Descriptor, - new string[] { "PartitionId", "Filter", "Status", }); - internal__static_bnet_protocol_exchange_QueryBidsByOrderBookResponse__Descriptor = Descriptor.MessageTypes[13]; - internal__static_bnet_protocol_exchange_QueryBidsByOrderBookResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_QueryBidsByOrderBookResponse__Descriptor, - new string[] { "Bids", "TotalCount", }); - internal__static_bnet_protocol_exchange_QueryOffersByAccountForItemRequest__Descriptor = Descriptor.MessageTypes[14]; - internal__static_bnet_protocol_exchange_QueryOffersByAccountForItemRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_QueryOffersByAccountForItemRequest__Descriptor, - new string[] { "AccountForItem", "Filter", "BnetAccount", }); - internal__static_bnet_protocol_exchange_QueryOffersByAccountForItemResponse__Descriptor = Descriptor.MessageTypes[15]; - internal__static_bnet_protocol_exchange_QueryOffersByAccountForItemResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_QueryOffersByAccountForItemResponse__Descriptor, - new string[] { "Offers", "TotalCount", }); - internal__static_bnet_protocol_exchange_QueryBidsByAccountForItemRequest__Descriptor = Descriptor.MessageTypes[16]; - internal__static_bnet_protocol_exchange_QueryBidsByAccountForItemRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_QueryBidsByAccountForItemRequest__Descriptor, - new string[] { "AccountForItem", "Filter", "BnetAccount", }); - internal__static_bnet_protocol_exchange_QueryBidsByAccountForItemResponse__Descriptor = Descriptor.MessageTypes[17]; - internal__static_bnet_protocol_exchange_QueryBidsByAccountForItemResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_QueryBidsByAccountForItemResponse__Descriptor, - new string[] { "Bids", "TotalCount", }); - internal__static_bnet_protocol_exchange_QueryOrderBooksSummaryRequest__Descriptor = Descriptor.MessageTypes[18]; - internal__static_bnet_protocol_exchange_QueryOrderBooksSummaryRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_QueryOrderBooksSummaryRequest__Descriptor, - new string[] { "Handles", }); - internal__static_bnet_protocol_exchange_QueryOrderBooksSummaryResponse__Descriptor = Descriptor.MessageTypes[19]; - internal__static_bnet_protocol_exchange_QueryOrderBooksSummaryResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_QueryOrderBooksSummaryResponse__Descriptor, - new string[] { "OrderBooks", }); - internal__static_bnet_protocol_exchange_QuerySettlementsByOrderBookRequest__Descriptor = Descriptor.MessageTypes[20]; - internal__static_bnet_protocol_exchange_QuerySettlementsByOrderBookRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_QuerySettlementsByOrderBookRequest__Descriptor, - new string[] { "PartitionId", "Filter", }); - internal__static_bnet_protocol_exchange_QuerySettlementsByOrderBookResponse__Descriptor = Descriptor.MessageTypes[21]; - internal__static_bnet_protocol_exchange_QuerySettlementsByOrderBookResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_QuerySettlementsByOrderBookResponse__Descriptor, - new string[] { "Settlements", }); - internal__static_bnet_protocol_exchange_SubscribeOrderBookStatusChangeRequest__Descriptor = Descriptor.MessageTypes[22]; - internal__static_bnet_protocol_exchange_SubscribeOrderBookStatusChangeRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_SubscribeOrderBookStatusChangeRequest__Descriptor, - new string[] { "ObjectId", "MinPartitionId", "MaxPartitionId", "Program", "Status", "Currency", "Specialist", "Bootstrap", }); - internal__static_bnet_protocol_exchange_UnsubscribeOrderBookStatusChangeRequest__Descriptor = Descriptor.MessageTypes[23]; - internal__static_bnet_protocol_exchange_UnsubscribeOrderBookStatusChangeRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_UnsubscribeOrderBookStatusChangeRequest__Descriptor, - new string[] { }); - internal__static_bnet_protocol_exchange_SubscribeOrderStatusChangeRequest__Descriptor = Descriptor.MessageTypes[24]; - internal__static_bnet_protocol_exchange_SubscribeOrderStatusChangeRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_SubscribeOrderStatusChangeRequest__Descriptor, - new string[] { "AgentId", "ObjectId", }); - internal__static_bnet_protocol_exchange_UnsubscribeOrderStatusChangeRequest__Descriptor = Descriptor.MessageTypes[25]; - internal__static_bnet_protocol_exchange_UnsubscribeOrderStatusChangeRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_UnsubscribeOrderStatusChangeRequest__Descriptor, - new string[] { "AgentId", "ObjectId", }); - internal__static_bnet_protocol_exchange_ClaimRequest__Descriptor = Descriptor.MessageTypes[26]; - internal__static_bnet_protocol_exchange_ClaimRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_ClaimRequest__Descriptor, - new string[] { "PartitionId", "OrderId", "BnetAccount", }); - internal__static_bnet_protocol_exchange_CancelRequest__Descriptor = Descriptor.MessageTypes[27]; - internal__static_bnet_protocol_exchange_CancelRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_CancelRequest__Descriptor, - new string[] { "PartitionId", "OrderId", "Reason", "BnetAccount", }); - internal__static_bnet_protocol_exchange_GetConfigurationRequest__Descriptor = Descriptor.MessageTypes[28]; - internal__static_bnet_protocol_exchange_GetConfigurationRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_GetConfigurationRequest__Descriptor, - new string[] { "Program", }); - internal__static_bnet_protocol_exchange_GetConfigurationResponse__Descriptor = Descriptor.MessageTypes[29]; - internal__static_bnet_protocol_exchange_GetConfigurationResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_GetConfigurationResponse__Descriptor, - new string[] { "Configs", }); - internal__static_bnet_protocol_exchange_GetOfferFeeEstimationRequest__Descriptor = Descriptor.MessageTypes[30]; - internal__static_bnet_protocol_exchange_GetOfferFeeEstimationRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_GetOfferFeeEstimationRequest__Descriptor, - new string[] { "PartitionId", "Data", }); - internal__static_bnet_protocol_exchange_GetBidFeeEstimationRequest__Descriptor = Descriptor.MessageTypes[31]; - internal__static_bnet_protocol_exchange_GetBidFeeEstimationRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_GetBidFeeEstimationRequest__Descriptor, - new string[] { "PartitionId", "Data", }); - internal__static_bnet_protocol_exchange_GetFeeEstimationResponse__Descriptor = Descriptor.MessageTypes[32]; - internal__static_bnet_protocol_exchange_GetFeeEstimationResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_GetFeeEstimationResponse__Descriptor, - new string[] { "FeeAmount", }); - internal__static_bnet_protocol_exchange_OrderBookNotificationRequest__Descriptor = Descriptor.MessageTypes[33]; - internal__static_bnet_protocol_exchange_OrderBookNotificationRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_OrderBookNotificationRequest__Descriptor, - new string[] { "Notifications", "BootStrapLast", }); - internal__static_bnet_protocol_exchange_OfferNotificationRequest__Descriptor = Descriptor.MessageTypes[34]; - internal__static_bnet_protocol_exchange_OfferNotificationRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_OfferNotificationRequest__Descriptor, - new string[] { "Offer", "Event", }); - internal__static_bnet_protocol_exchange_BidNotificationRequest__Descriptor = Descriptor.MessageTypes[35]; - internal__static_bnet_protocol_exchange_BidNotificationRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_BidNotificationRequest__Descriptor, - new string[] { "Bid", "Event", }); - pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); - RegisterAllExtensions(registry); - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry); - global::bnet.protocol.Rpc.RegisterAllExtensions(registry); - global::bnet.protocol.exchange.Exchange.RegisterAllExtensions(registry); - global::bnet.protocol.exchange_object_provider.ExchangeObjectProvider.RegisterAllExtensions(registry); - global::bnet.protocol.Entity.RegisterAllExtensions(registry); - global::bnet.protocol.exchange.ExchangeTypes.RegisterAllExtensions(registry); - return registry; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, - global::bnet.protocol.Rpc.Descriptor, - global::bnet.protocol.exchange.Exchange.Descriptor, - global::bnet.protocol.exchange_object_provider.ExchangeObjectProvider.Descriptor, - global::bnet.protocol.Entity.Descriptor, - global::bnet.protocol.exchange.ExchangeTypes.Descriptor, - }, assigner); - } - #endregion - - } - } - #region Messages - public sealed partial class CreateOrderBookRequest : pb::GeneratedMessage { - private static readonly CreateOrderBookRequest defaultInstance = new Builder().BuildPartial(); - public static CreateOrderBookRequest DefaultInstance { - get { return defaultInstance; } - } - - public override CreateOrderBookRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override CreateOrderBookRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_CreateOrderBookRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_CreateOrderBookRequest__FieldAccessorTable; } - } - - public const int PartitionIdFieldNumber = 1; - private bool hasPartitionId; - private global::bnet.protocol.exchange.PartitionId partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - public bool HasPartitionId { - get { return hasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return partitionId_; } - } - - public const int OrderBookFieldNumber = 2; - private bool hasOrderBook; - private global::bnet.protocol.exchange.OrderBook orderBook_ = global::bnet.protocol.exchange.OrderBook.DefaultInstance; - public bool HasOrderBook { - get { return hasOrderBook; } - } - public global::bnet.protocol.exchange.OrderBook OrderBook { - get { return orderBook_; } - } - - public override bool IsInitialized { - get { - if (!hasPartitionId) return false; - if (!hasOrderBook) return false; - if (!PartitionId.IsInitialized) return false; - if (!OrderBook.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasPartitionId) { - output.WriteMessage(1, PartitionId); - } - if (HasOrderBook) { - output.WriteMessage(2, OrderBook); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasPartitionId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); - } - if (HasOrderBook) { - size += pb::CodedOutputStream.ComputeMessageSize(2, OrderBook); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static CreateOrderBookRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CreateOrderBookRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CreateOrderBookRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CreateOrderBookRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CreateOrderBookRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CreateOrderBookRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CreateOrderBookRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CreateOrderBookRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CreateOrderBookRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CreateOrderBookRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CreateOrderBookRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - CreateOrderBookRequest result = new CreateOrderBookRequest(); - - protected override CreateOrderBookRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new CreateOrderBookRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.CreateOrderBookRequest.Descriptor; } - } - - public override CreateOrderBookRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.CreateOrderBookRequest.DefaultInstance; } - } - - public override CreateOrderBookRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - CreateOrderBookRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CreateOrderBookRequest) { - return MergeFrom((CreateOrderBookRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CreateOrderBookRequest other) { - if (other == global::bnet.protocol.exchange.CreateOrderBookRequest.DefaultInstance) return this; - if (other.HasPartitionId) { - MergePartitionId(other.PartitionId); - } - if (other.HasOrderBook) { - MergeOrderBook(other.OrderBook); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { - subBuilder.MergeFrom(PartitionId); - } - input.ReadMessage(subBuilder, extensionRegistry); - PartitionId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.exchange.OrderBook.Builder subBuilder = global::bnet.protocol.exchange.OrderBook.CreateBuilder(); - if (HasOrderBook) { - subBuilder.MergeFrom(OrderBook); - } - input.ReadMessage(subBuilder, extensionRegistry); - OrderBook = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasPartitionId { - get { return result.HasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return result.PartitionId; } - set { SetPartitionId(value); } - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasPartitionId = true; - result.partitionId_ = value; - return this; - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasPartitionId = true; - result.partitionId_ = builderForValue.Build(); - return this; - } - public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasPartitionId && - result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); - } else { - result.partitionId_ = value; - } - result.hasPartitionId = true; - return this; - } - public Builder ClearPartitionId() { - result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - return this; - } - - public bool HasOrderBook { - get { return result.HasOrderBook; } - } - public global::bnet.protocol.exchange.OrderBook OrderBook { - get { return result.OrderBook; } - set { SetOrderBook(value); } - } - public Builder SetOrderBook(global::bnet.protocol.exchange.OrderBook value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasOrderBook = true; - result.orderBook_ = value; - return this; - } - public Builder SetOrderBook(global::bnet.protocol.exchange.OrderBook.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasOrderBook = true; - result.orderBook_ = builderForValue.Build(); - return this; - } - public Builder MergeOrderBook(global::bnet.protocol.exchange.OrderBook value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasOrderBook && - result.orderBook_ != global::bnet.protocol.exchange.OrderBook.DefaultInstance) { - result.orderBook_ = global::bnet.protocol.exchange.OrderBook.CreateBuilder(result.orderBook_).MergeFrom(value).BuildPartial(); - } else { - result.orderBook_ = value; - } - result.hasOrderBook = true; - return this; - } - public Builder ClearOrderBook() { - result.hasOrderBook = false; - result.orderBook_ = global::bnet.protocol.exchange.OrderBook.DefaultInstance; - return this; - } - } - static CreateOrderBookRequest() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class CreateOrderBookResponse : pb::GeneratedMessage { - private static readonly CreateOrderBookResponse defaultInstance = new Builder().BuildPartial(); - public static CreateOrderBookResponse DefaultInstance { - get { return defaultInstance; } - } - - public override CreateOrderBookResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override CreateOrderBookResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_CreateOrderBookResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_CreateOrderBookResponse__FieldAccessorTable; } - } - - public const int OrderBookIdFieldNumber = 1; - private bool hasOrderBookId; - private ulong orderBookId_ = 0UL; - public bool HasOrderBookId { - get { return hasOrderBookId; } - } - public ulong OrderBookId { - get { return orderBookId_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasOrderBookId) { - output.WriteUInt64(1, OrderBookId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasOrderBookId) { - size += pb::CodedOutputStream.ComputeUInt64Size(1, OrderBookId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static CreateOrderBookResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CreateOrderBookResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CreateOrderBookResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CreateOrderBookResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CreateOrderBookResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CreateOrderBookResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CreateOrderBookResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CreateOrderBookResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CreateOrderBookResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CreateOrderBookResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CreateOrderBookResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - CreateOrderBookResponse result = new CreateOrderBookResponse(); - - protected override CreateOrderBookResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new CreateOrderBookResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.CreateOrderBookResponse.Descriptor; } - } - - public override CreateOrderBookResponse DefaultInstanceForType { - get { return global::bnet.protocol.exchange.CreateOrderBookResponse.DefaultInstance; } - } - - public override CreateOrderBookResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - CreateOrderBookResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CreateOrderBookResponse) { - return MergeFrom((CreateOrderBookResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CreateOrderBookResponse other) { - if (other == global::bnet.protocol.exchange.CreateOrderBookResponse.DefaultInstance) return this; - if (other.HasOrderBookId) { - OrderBookId = other.OrderBookId; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - OrderBookId = input.ReadUInt64(); - break; - } - } - } - } - - - public bool HasOrderBookId { - get { return result.HasOrderBookId; } - } - public ulong OrderBookId { - get { return result.OrderBookId; } - set { SetOrderBookId(value); } - } - public Builder SetOrderBookId(ulong value) { - result.hasOrderBookId = true; - result.orderBookId_ = value; - return this; - } - public Builder ClearOrderBookId() { - result.hasOrderBookId = false; - result.orderBookId_ = 0UL; - return this; - } - } - static CreateOrderBookResponse() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class PlaceOfferOnOrderBookRequest : pb::GeneratedMessage { - private static readonly PlaceOfferOnOrderBookRequest defaultInstance = new Builder().BuildPartial(); - public static PlaceOfferOnOrderBookRequest DefaultInstance { - get { return defaultInstance; } - } - - public override PlaceOfferOnOrderBookRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override PlaceOfferOnOrderBookRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_PlaceOfferOnOrderBookRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_PlaceOfferOnOrderBookRequest__FieldAccessorTable; } - } - - public const int PartitionIdFieldNumber = 1; - private bool hasPartitionId; - private global::bnet.protocol.exchange.PartitionId partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - public bool HasPartitionId { - get { return hasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return partitionId_; } - } - - public const int OfferCreationFieldNumber = 2; - private bool hasOfferCreation; - private global::bnet.protocol.exchange.OfferCreation offerCreation_ = global::bnet.protocol.exchange.OfferCreation.DefaultInstance; - public bool HasOfferCreation { - get { return hasOfferCreation; } - } - public global::bnet.protocol.exchange.OfferCreation OfferCreation { - get { return offerCreation_; } - } - - public override bool IsInitialized { - get { - if (!hasPartitionId) return false; - if (!hasOfferCreation) return false; - if (!PartitionId.IsInitialized) return false; - if (!OfferCreation.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasPartitionId) { - output.WriteMessage(1, PartitionId); - } - if (HasOfferCreation) { - output.WriteMessage(2, OfferCreation); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasPartitionId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); - } - if (HasOfferCreation) { - size += pb::CodedOutputStream.ComputeMessageSize(2, OfferCreation); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static PlaceOfferOnOrderBookRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PlaceOfferOnOrderBookRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PlaceOfferOnOrderBookRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PlaceOfferOnOrderBookRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PlaceOfferOnOrderBookRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PlaceOfferOnOrderBookRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static PlaceOfferOnOrderBookRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static PlaceOfferOnOrderBookRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static PlaceOfferOnOrderBookRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PlaceOfferOnOrderBookRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(PlaceOfferOnOrderBookRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - PlaceOfferOnOrderBookRequest result = new PlaceOfferOnOrderBookRequest(); - - protected override PlaceOfferOnOrderBookRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new PlaceOfferOnOrderBookRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.PlaceOfferOnOrderBookRequest.Descriptor; } - } - - public override PlaceOfferOnOrderBookRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.PlaceOfferOnOrderBookRequest.DefaultInstance; } - } - - public override PlaceOfferOnOrderBookRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - PlaceOfferOnOrderBookRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is PlaceOfferOnOrderBookRequest) { - return MergeFrom((PlaceOfferOnOrderBookRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(PlaceOfferOnOrderBookRequest other) { - if (other == global::bnet.protocol.exchange.PlaceOfferOnOrderBookRequest.DefaultInstance) return this; - if (other.HasPartitionId) { - MergePartitionId(other.PartitionId); - } - if (other.HasOfferCreation) { - MergeOfferCreation(other.OfferCreation); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { - subBuilder.MergeFrom(PartitionId); - } - input.ReadMessage(subBuilder, extensionRegistry); - PartitionId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.exchange.OfferCreation.Builder subBuilder = global::bnet.protocol.exchange.OfferCreation.CreateBuilder(); - if (HasOfferCreation) { - subBuilder.MergeFrom(OfferCreation); - } - input.ReadMessage(subBuilder, extensionRegistry); - OfferCreation = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasPartitionId { - get { return result.HasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return result.PartitionId; } - set { SetPartitionId(value); } - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasPartitionId = true; - result.partitionId_ = value; - return this; - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasPartitionId = true; - result.partitionId_ = builderForValue.Build(); - return this; - } - public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasPartitionId && - result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); - } else { - result.partitionId_ = value; - } - result.hasPartitionId = true; - return this; - } - public Builder ClearPartitionId() { - result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - return this; - } - - public bool HasOfferCreation { - get { return result.HasOfferCreation; } - } - public global::bnet.protocol.exchange.OfferCreation OfferCreation { - get { return result.OfferCreation; } - set { SetOfferCreation(value); } - } - public Builder SetOfferCreation(global::bnet.protocol.exchange.OfferCreation value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasOfferCreation = true; - result.offerCreation_ = value; - return this; - } - public Builder SetOfferCreation(global::bnet.protocol.exchange.OfferCreation.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasOfferCreation = true; - result.offerCreation_ = builderForValue.Build(); - return this; - } - public Builder MergeOfferCreation(global::bnet.protocol.exchange.OfferCreation value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasOfferCreation && - result.offerCreation_ != global::bnet.protocol.exchange.OfferCreation.DefaultInstance) { - result.offerCreation_ = global::bnet.protocol.exchange.OfferCreation.CreateBuilder(result.offerCreation_).MergeFrom(value).BuildPartial(); - } else { - result.offerCreation_ = value; - } - result.hasOfferCreation = true; - return this; - } - public Builder ClearOfferCreation() { - result.hasOfferCreation = false; - result.offerCreation_ = global::bnet.protocol.exchange.OfferCreation.DefaultInstance; - return this; - } - } - static PlaceOfferOnOrderBookRequest() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class PlaceOfferOnOrderBookResponse : pb::GeneratedMessage { - private static readonly PlaceOfferOnOrderBookResponse defaultInstance = new Builder().BuildPartial(); - public static PlaceOfferOnOrderBookResponse DefaultInstance { - get { return defaultInstance; } - } - - public override PlaceOfferOnOrderBookResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override PlaceOfferOnOrderBookResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_PlaceOfferOnOrderBookResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_PlaceOfferOnOrderBookResponse__FieldAccessorTable; } - } - - public const int OrderBookIdFieldNumber = 1; - private bool hasOrderBookId; - private ulong orderBookId_ = 0UL; - public bool HasOrderBookId { - get { return hasOrderBookId; } - } - public ulong OrderBookId { - get { return orderBookId_; } - } - - public const int OfferIdFieldNumber = 2; - private bool hasOfferId; - private ulong offerId_ = 0UL; - public bool HasOfferId { - get { return hasOfferId; } - } - public ulong OfferId { - get { return offerId_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasOrderBookId) { - output.WriteUInt64(1, OrderBookId); - } - if (HasOfferId) { - output.WriteUInt64(2, OfferId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasOrderBookId) { - size += pb::CodedOutputStream.ComputeUInt64Size(1, OrderBookId); - } - if (HasOfferId) { - size += pb::CodedOutputStream.ComputeUInt64Size(2, OfferId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static PlaceOfferOnOrderBookResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PlaceOfferOnOrderBookResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PlaceOfferOnOrderBookResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PlaceOfferOnOrderBookResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PlaceOfferOnOrderBookResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PlaceOfferOnOrderBookResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static PlaceOfferOnOrderBookResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static PlaceOfferOnOrderBookResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static PlaceOfferOnOrderBookResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PlaceOfferOnOrderBookResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(PlaceOfferOnOrderBookResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - PlaceOfferOnOrderBookResponse result = new PlaceOfferOnOrderBookResponse(); - - protected override PlaceOfferOnOrderBookResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new PlaceOfferOnOrderBookResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.PlaceOfferOnOrderBookResponse.Descriptor; } - } - - public override PlaceOfferOnOrderBookResponse DefaultInstanceForType { - get { return global::bnet.protocol.exchange.PlaceOfferOnOrderBookResponse.DefaultInstance; } - } - - public override PlaceOfferOnOrderBookResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - PlaceOfferOnOrderBookResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is PlaceOfferOnOrderBookResponse) { - return MergeFrom((PlaceOfferOnOrderBookResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(PlaceOfferOnOrderBookResponse other) { - if (other == global::bnet.protocol.exchange.PlaceOfferOnOrderBookResponse.DefaultInstance) return this; - if (other.HasOrderBookId) { - OrderBookId = other.OrderBookId; - } - if (other.HasOfferId) { - OfferId = other.OfferId; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - OrderBookId = input.ReadUInt64(); - break; - } - case 16: { - OfferId = input.ReadUInt64(); - break; - } - } - } - } - - - public bool HasOrderBookId { - get { return result.HasOrderBookId; } - } - public ulong OrderBookId { - get { return result.OrderBookId; } - set { SetOrderBookId(value); } - } - public Builder SetOrderBookId(ulong value) { - result.hasOrderBookId = true; - result.orderBookId_ = value; - return this; - } - public Builder ClearOrderBookId() { - result.hasOrderBookId = false; - result.orderBookId_ = 0UL; - return this; - } - - public bool HasOfferId { - get { return result.HasOfferId; } - } - public ulong OfferId { - get { return result.OfferId; } - set { SetOfferId(value); } - } - public Builder SetOfferId(ulong value) { - result.hasOfferId = true; - result.offerId_ = value; - return this; - } - public Builder ClearOfferId() { - result.hasOfferId = false; - result.offerId_ = 0UL; - return this; - } - } - static PlaceOfferOnOrderBookResponse() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class PlaceOfferCreateOrderBookIfNeededRequest : pb::GeneratedMessage { - private static readonly PlaceOfferCreateOrderBookIfNeededRequest defaultInstance = new Builder().BuildPartial(); - public static PlaceOfferCreateOrderBookIfNeededRequest DefaultInstance { - get { return defaultInstance; } - } - - public override PlaceOfferCreateOrderBookIfNeededRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override PlaceOfferCreateOrderBookIfNeededRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_PlaceOfferCreateOrderBookIfNeededRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_PlaceOfferCreateOrderBookIfNeededRequest__FieldAccessorTable; } - } - - public const int PartitionIdFieldNumber = 1; - private bool hasPartitionId; - private global::bnet.protocol.exchange.PartitionId partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - public bool HasPartitionId { - get { return hasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return partitionId_; } - } - - public const int OrderBookFieldNumber = 2; - private bool hasOrderBook; - private global::bnet.protocol.exchange.OrderBook orderBook_ = global::bnet.protocol.exchange.OrderBook.DefaultInstance; - public bool HasOrderBook { - get { return hasOrderBook; } - } - public global::bnet.protocol.exchange.OrderBook OrderBook { - get { return orderBook_; } - } - - public const int OfferCreationFieldNumber = 3; - private bool hasOfferCreation; - private global::bnet.protocol.exchange.OfferCreation offerCreation_ = global::bnet.protocol.exchange.OfferCreation.DefaultInstance; - public bool HasOfferCreation { - get { return hasOfferCreation; } - } - public global::bnet.protocol.exchange.OfferCreation OfferCreation { - get { return offerCreation_; } - } - - public override bool IsInitialized { - get { - if (!hasPartitionId) return false; - if (!hasOrderBook) return false; - if (!hasOfferCreation) return false; - if (!PartitionId.IsInitialized) return false; - if (!OrderBook.IsInitialized) return false; - if (!OfferCreation.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasPartitionId) { - output.WriteMessage(1, PartitionId); - } - if (HasOrderBook) { - output.WriteMessage(2, OrderBook); - } - if (HasOfferCreation) { - output.WriteMessage(3, OfferCreation); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasPartitionId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); - } - if (HasOrderBook) { - size += pb::CodedOutputStream.ComputeMessageSize(2, OrderBook); - } - if (HasOfferCreation) { - size += pb::CodedOutputStream.ComputeMessageSize(3, OfferCreation); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static PlaceOfferCreateOrderBookIfNeededRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PlaceOfferCreateOrderBookIfNeededRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PlaceOfferCreateOrderBookIfNeededRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PlaceOfferCreateOrderBookIfNeededRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PlaceOfferCreateOrderBookIfNeededRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PlaceOfferCreateOrderBookIfNeededRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static PlaceOfferCreateOrderBookIfNeededRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static PlaceOfferCreateOrderBookIfNeededRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static PlaceOfferCreateOrderBookIfNeededRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PlaceOfferCreateOrderBookIfNeededRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(PlaceOfferCreateOrderBookIfNeededRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - PlaceOfferCreateOrderBookIfNeededRequest result = new PlaceOfferCreateOrderBookIfNeededRequest(); - - protected override PlaceOfferCreateOrderBookIfNeededRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new PlaceOfferCreateOrderBookIfNeededRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.PlaceOfferCreateOrderBookIfNeededRequest.Descriptor; } - } - - public override PlaceOfferCreateOrderBookIfNeededRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.PlaceOfferCreateOrderBookIfNeededRequest.DefaultInstance; } - } - - public override PlaceOfferCreateOrderBookIfNeededRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - PlaceOfferCreateOrderBookIfNeededRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is PlaceOfferCreateOrderBookIfNeededRequest) { - return MergeFrom((PlaceOfferCreateOrderBookIfNeededRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(PlaceOfferCreateOrderBookIfNeededRequest other) { - if (other == global::bnet.protocol.exchange.PlaceOfferCreateOrderBookIfNeededRequest.DefaultInstance) return this; - if (other.HasPartitionId) { - MergePartitionId(other.PartitionId); - } - if (other.HasOrderBook) { - MergeOrderBook(other.OrderBook); - } - if (other.HasOfferCreation) { - MergeOfferCreation(other.OfferCreation); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { - subBuilder.MergeFrom(PartitionId); - } - input.ReadMessage(subBuilder, extensionRegistry); - PartitionId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.exchange.OrderBook.Builder subBuilder = global::bnet.protocol.exchange.OrderBook.CreateBuilder(); - if (HasOrderBook) { - subBuilder.MergeFrom(OrderBook); - } - input.ReadMessage(subBuilder, extensionRegistry); - OrderBook = subBuilder.BuildPartial(); - break; - } - case 26: { - global::bnet.protocol.exchange.OfferCreation.Builder subBuilder = global::bnet.protocol.exchange.OfferCreation.CreateBuilder(); - if (HasOfferCreation) { - subBuilder.MergeFrom(OfferCreation); - } - input.ReadMessage(subBuilder, extensionRegistry); - OfferCreation = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasPartitionId { - get { return result.HasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return result.PartitionId; } - set { SetPartitionId(value); } - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasPartitionId = true; - result.partitionId_ = value; - return this; - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasPartitionId = true; - result.partitionId_ = builderForValue.Build(); - return this; - } - public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasPartitionId && - result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); - } else { - result.partitionId_ = value; - } - result.hasPartitionId = true; - return this; - } - public Builder ClearPartitionId() { - result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - return this; - } - - public bool HasOrderBook { - get { return result.HasOrderBook; } - } - public global::bnet.protocol.exchange.OrderBook OrderBook { - get { return result.OrderBook; } - set { SetOrderBook(value); } - } - public Builder SetOrderBook(global::bnet.protocol.exchange.OrderBook value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasOrderBook = true; - result.orderBook_ = value; - return this; - } - public Builder SetOrderBook(global::bnet.protocol.exchange.OrderBook.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasOrderBook = true; - result.orderBook_ = builderForValue.Build(); - return this; - } - public Builder MergeOrderBook(global::bnet.protocol.exchange.OrderBook value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasOrderBook && - result.orderBook_ != global::bnet.protocol.exchange.OrderBook.DefaultInstance) { - result.orderBook_ = global::bnet.protocol.exchange.OrderBook.CreateBuilder(result.orderBook_).MergeFrom(value).BuildPartial(); - } else { - result.orderBook_ = value; - } - result.hasOrderBook = true; - return this; - } - public Builder ClearOrderBook() { - result.hasOrderBook = false; - result.orderBook_ = global::bnet.protocol.exchange.OrderBook.DefaultInstance; - return this; - } - - public bool HasOfferCreation { - get { return result.HasOfferCreation; } - } - public global::bnet.protocol.exchange.OfferCreation OfferCreation { - get { return result.OfferCreation; } - set { SetOfferCreation(value); } - } - public Builder SetOfferCreation(global::bnet.protocol.exchange.OfferCreation value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasOfferCreation = true; - result.offerCreation_ = value; - return this; - } - public Builder SetOfferCreation(global::bnet.protocol.exchange.OfferCreation.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasOfferCreation = true; - result.offerCreation_ = builderForValue.Build(); - return this; - } - public Builder MergeOfferCreation(global::bnet.protocol.exchange.OfferCreation value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasOfferCreation && - result.offerCreation_ != global::bnet.protocol.exchange.OfferCreation.DefaultInstance) { - result.offerCreation_ = global::bnet.protocol.exchange.OfferCreation.CreateBuilder(result.offerCreation_).MergeFrom(value).BuildPartial(); - } else { - result.offerCreation_ = value; - } - result.hasOfferCreation = true; - return this; - } - public Builder ClearOfferCreation() { - result.hasOfferCreation = false; - result.offerCreation_ = global::bnet.protocol.exchange.OfferCreation.DefaultInstance; - return this; - } - } - static PlaceOfferCreateOrderBookIfNeededRequest() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class PlaceOfferCreateOrderBookIfNeededResponse : pb::GeneratedMessage { - private static readonly PlaceOfferCreateOrderBookIfNeededResponse defaultInstance = new Builder().BuildPartial(); - public static PlaceOfferCreateOrderBookIfNeededResponse DefaultInstance { - get { return defaultInstance; } - } - - public override PlaceOfferCreateOrderBookIfNeededResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override PlaceOfferCreateOrderBookIfNeededResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_PlaceOfferCreateOrderBookIfNeededResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_PlaceOfferCreateOrderBookIfNeededResponse__FieldAccessorTable; } - } - - public const int OrderBookIdFieldNumber = 1; - private bool hasOrderBookId; - private ulong orderBookId_ = 0UL; - public bool HasOrderBookId { - get { return hasOrderBookId; } - } - public ulong OrderBookId { - get { return orderBookId_; } - } - - public const int OfferIdFieldNumber = 2; - private bool hasOfferId; - private ulong offerId_ = 0UL; - public bool HasOfferId { - get { return hasOfferId; } - } - public ulong OfferId { - get { return offerId_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasOrderBookId) { - output.WriteUInt64(1, OrderBookId); - } - if (HasOfferId) { - output.WriteUInt64(2, OfferId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasOrderBookId) { - size += pb::CodedOutputStream.ComputeUInt64Size(1, OrderBookId); - } - if (HasOfferId) { - size += pb::CodedOutputStream.ComputeUInt64Size(2, OfferId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static PlaceOfferCreateOrderBookIfNeededResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PlaceOfferCreateOrderBookIfNeededResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PlaceOfferCreateOrderBookIfNeededResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PlaceOfferCreateOrderBookIfNeededResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PlaceOfferCreateOrderBookIfNeededResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PlaceOfferCreateOrderBookIfNeededResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static PlaceOfferCreateOrderBookIfNeededResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static PlaceOfferCreateOrderBookIfNeededResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static PlaceOfferCreateOrderBookIfNeededResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PlaceOfferCreateOrderBookIfNeededResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(PlaceOfferCreateOrderBookIfNeededResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - PlaceOfferCreateOrderBookIfNeededResponse result = new PlaceOfferCreateOrderBookIfNeededResponse(); - - protected override PlaceOfferCreateOrderBookIfNeededResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new PlaceOfferCreateOrderBookIfNeededResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.PlaceOfferCreateOrderBookIfNeededResponse.Descriptor; } - } - - public override PlaceOfferCreateOrderBookIfNeededResponse DefaultInstanceForType { - get { return global::bnet.protocol.exchange.PlaceOfferCreateOrderBookIfNeededResponse.DefaultInstance; } - } - - public override PlaceOfferCreateOrderBookIfNeededResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - PlaceOfferCreateOrderBookIfNeededResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is PlaceOfferCreateOrderBookIfNeededResponse) { - return MergeFrom((PlaceOfferCreateOrderBookIfNeededResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(PlaceOfferCreateOrderBookIfNeededResponse other) { - if (other == global::bnet.protocol.exchange.PlaceOfferCreateOrderBookIfNeededResponse.DefaultInstance) return this; - if (other.HasOrderBookId) { - OrderBookId = other.OrderBookId; - } - if (other.HasOfferId) { - OfferId = other.OfferId; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - OrderBookId = input.ReadUInt64(); - break; - } - case 16: { - OfferId = input.ReadUInt64(); - break; - } - } - } - } - - - public bool HasOrderBookId { - get { return result.HasOrderBookId; } - } - public ulong OrderBookId { - get { return result.OrderBookId; } - set { SetOrderBookId(value); } - } - public Builder SetOrderBookId(ulong value) { - result.hasOrderBookId = true; - result.orderBookId_ = value; - return this; - } - public Builder ClearOrderBookId() { - result.hasOrderBookId = false; - result.orderBookId_ = 0UL; - return this; - } - - public bool HasOfferId { - get { return result.HasOfferId; } - } - public ulong OfferId { - get { return result.OfferId; } - set { SetOfferId(value); } - } - public Builder SetOfferId(ulong value) { - result.hasOfferId = true; - result.offerId_ = value; - return this; - } - public Builder ClearOfferId() { - result.hasOfferId = false; - result.offerId_ = 0UL; - return this; - } - } - static PlaceOfferCreateOrderBookIfNeededResponse() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class PlaceBidOnOrderBookRequest : pb::GeneratedMessage { - private static readonly PlaceBidOnOrderBookRequest defaultInstance = new Builder().BuildPartial(); - public static PlaceBidOnOrderBookRequest DefaultInstance { - get { return defaultInstance; } - } - - public override PlaceBidOnOrderBookRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override PlaceBidOnOrderBookRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_PlaceBidOnOrderBookRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_PlaceBidOnOrderBookRequest__FieldAccessorTable; } - } - - public const int PartitionIdFieldNumber = 1; - private bool hasPartitionId; - private global::bnet.protocol.exchange.PartitionId partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - public bool HasPartitionId { - get { return hasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return partitionId_; } - } - - public const int BidCreationFieldNumber = 2; - private bool hasBidCreation; - private global::bnet.protocol.exchange.BidCreation bidCreation_ = global::bnet.protocol.exchange.BidCreation.DefaultInstance; - public bool HasBidCreation { - get { return hasBidCreation; } - } - public global::bnet.protocol.exchange.BidCreation BidCreation { - get { return bidCreation_; } - } - - public override bool IsInitialized { - get { - if (!hasPartitionId) return false; - if (!hasBidCreation) return false; - if (!PartitionId.IsInitialized) return false; - if (!BidCreation.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasPartitionId) { - output.WriteMessage(1, PartitionId); - } - if (HasBidCreation) { - output.WriteMessage(2, BidCreation); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasPartitionId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); - } - if (HasBidCreation) { - size += pb::CodedOutputStream.ComputeMessageSize(2, BidCreation); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static PlaceBidOnOrderBookRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PlaceBidOnOrderBookRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PlaceBidOnOrderBookRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PlaceBidOnOrderBookRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PlaceBidOnOrderBookRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PlaceBidOnOrderBookRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static PlaceBidOnOrderBookRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static PlaceBidOnOrderBookRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static PlaceBidOnOrderBookRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PlaceBidOnOrderBookRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(PlaceBidOnOrderBookRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - PlaceBidOnOrderBookRequest result = new PlaceBidOnOrderBookRequest(); - - protected override PlaceBidOnOrderBookRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new PlaceBidOnOrderBookRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.PlaceBidOnOrderBookRequest.Descriptor; } - } - - public override PlaceBidOnOrderBookRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.PlaceBidOnOrderBookRequest.DefaultInstance; } - } - - public override PlaceBidOnOrderBookRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - PlaceBidOnOrderBookRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is PlaceBidOnOrderBookRequest) { - return MergeFrom((PlaceBidOnOrderBookRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(PlaceBidOnOrderBookRequest other) { - if (other == global::bnet.protocol.exchange.PlaceBidOnOrderBookRequest.DefaultInstance) return this; - if (other.HasPartitionId) { - MergePartitionId(other.PartitionId); - } - if (other.HasBidCreation) { - MergeBidCreation(other.BidCreation); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { - subBuilder.MergeFrom(PartitionId); - } - input.ReadMessage(subBuilder, extensionRegistry); - PartitionId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.exchange.BidCreation.Builder subBuilder = global::bnet.protocol.exchange.BidCreation.CreateBuilder(); - if (HasBidCreation) { - subBuilder.MergeFrom(BidCreation); - } - input.ReadMessage(subBuilder, extensionRegistry); - BidCreation = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasPartitionId { - get { return result.HasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return result.PartitionId; } - set { SetPartitionId(value); } - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasPartitionId = true; - result.partitionId_ = value; - return this; - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasPartitionId = true; - result.partitionId_ = builderForValue.Build(); - return this; - } - public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasPartitionId && - result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); - } else { - result.partitionId_ = value; - } - result.hasPartitionId = true; - return this; - } - public Builder ClearPartitionId() { - result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - return this; - } - - public bool HasBidCreation { - get { return result.HasBidCreation; } - } - public global::bnet.protocol.exchange.BidCreation BidCreation { - get { return result.BidCreation; } - set { SetBidCreation(value); } - } - public Builder SetBidCreation(global::bnet.protocol.exchange.BidCreation value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBidCreation = true; - result.bidCreation_ = value; - return this; - } - public Builder SetBidCreation(global::bnet.protocol.exchange.BidCreation.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBidCreation = true; - result.bidCreation_ = builderForValue.Build(); - return this; - } - public Builder MergeBidCreation(global::bnet.protocol.exchange.BidCreation value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasBidCreation && - result.bidCreation_ != global::bnet.protocol.exchange.BidCreation.DefaultInstance) { - result.bidCreation_ = global::bnet.protocol.exchange.BidCreation.CreateBuilder(result.bidCreation_).MergeFrom(value).BuildPartial(); - } else { - result.bidCreation_ = value; - } - result.hasBidCreation = true; - return this; - } - public Builder ClearBidCreation() { - result.hasBidCreation = false; - result.bidCreation_ = global::bnet.protocol.exchange.BidCreation.DefaultInstance; - return this; - } - } - static PlaceBidOnOrderBookRequest() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class PlaceBidOnOrderBookResponse : pb::GeneratedMessage { - private static readonly PlaceBidOnOrderBookResponse defaultInstance = new Builder().BuildPartial(); - public static PlaceBidOnOrderBookResponse DefaultInstance { - get { return defaultInstance; } - } - - public override PlaceBidOnOrderBookResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override PlaceBidOnOrderBookResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_PlaceBidOnOrderBookResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_PlaceBidOnOrderBookResponse__FieldAccessorTable; } - } - - public const int OrderBookIdFieldNumber = 1; - private bool hasOrderBookId; - private ulong orderBookId_ = 0UL; - public bool HasOrderBookId { - get { return hasOrderBookId; } - } - public ulong OrderBookId { - get { return orderBookId_; } - } - - public const int BidIdFieldNumber = 2; - private bool hasBidId; - private ulong bidId_ = 0UL; - public bool HasBidId { - get { return hasBidId; } - } - public ulong BidId { - get { return bidId_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasOrderBookId) { - output.WriteUInt64(1, OrderBookId); - } - if (HasBidId) { - output.WriteUInt64(2, BidId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasOrderBookId) { - size += pb::CodedOutputStream.ComputeUInt64Size(1, OrderBookId); - } - if (HasBidId) { - size += pb::CodedOutputStream.ComputeUInt64Size(2, BidId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static PlaceBidOnOrderBookResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PlaceBidOnOrderBookResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PlaceBidOnOrderBookResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PlaceBidOnOrderBookResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PlaceBidOnOrderBookResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PlaceBidOnOrderBookResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static PlaceBidOnOrderBookResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static PlaceBidOnOrderBookResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static PlaceBidOnOrderBookResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PlaceBidOnOrderBookResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(PlaceBidOnOrderBookResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - PlaceBidOnOrderBookResponse result = new PlaceBidOnOrderBookResponse(); - - protected override PlaceBidOnOrderBookResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new PlaceBidOnOrderBookResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.PlaceBidOnOrderBookResponse.Descriptor; } - } - - public override PlaceBidOnOrderBookResponse DefaultInstanceForType { - get { return global::bnet.protocol.exchange.PlaceBidOnOrderBookResponse.DefaultInstance; } - } - - public override PlaceBidOnOrderBookResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - PlaceBidOnOrderBookResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is PlaceBidOnOrderBookResponse) { - return MergeFrom((PlaceBidOnOrderBookResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(PlaceBidOnOrderBookResponse other) { - if (other == global::bnet.protocol.exchange.PlaceBidOnOrderBookResponse.DefaultInstance) return this; - if (other.HasOrderBookId) { - OrderBookId = other.OrderBookId; - } - if (other.HasBidId) { - BidId = other.BidId; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - OrderBookId = input.ReadUInt64(); - break; - } - case 16: { - BidId = input.ReadUInt64(); - break; - } - } - } - } - - - public bool HasOrderBookId { - get { return result.HasOrderBookId; } - } - public ulong OrderBookId { - get { return result.OrderBookId; } - set { SetOrderBookId(value); } - } - public Builder SetOrderBookId(ulong value) { - result.hasOrderBookId = true; - result.orderBookId_ = value; - return this; - } - public Builder ClearOrderBookId() { - result.hasOrderBookId = false; - result.orderBookId_ = 0UL; - return this; - } - - public bool HasBidId { - get { return result.HasBidId; } - } - public ulong BidId { - get { return result.BidId; } - set { SetBidId(value); } - } - public Builder SetBidId(ulong value) { - result.hasBidId = true; - result.bidId_ = value; - return this; - } - public Builder ClearBidId() { - result.hasBidId = false; - result.bidId_ = 0UL; - return this; - } - } - static PlaceBidOnOrderBookResponse() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class PlaceBidCreateOrderBookIfNeededRequest : pb::GeneratedMessage { - private static readonly PlaceBidCreateOrderBookIfNeededRequest defaultInstance = new Builder().BuildPartial(); - public static PlaceBidCreateOrderBookIfNeededRequest DefaultInstance { - get { return defaultInstance; } - } - - public override PlaceBidCreateOrderBookIfNeededRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override PlaceBidCreateOrderBookIfNeededRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_PlaceBidCreateOrderBookIfNeededRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_PlaceBidCreateOrderBookIfNeededRequest__FieldAccessorTable; } - } - - public const int PartitionIdFieldNumber = 1; - private bool hasPartitionId; - private global::bnet.protocol.exchange.PartitionId partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - public bool HasPartitionId { - get { return hasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return partitionId_; } - } - - public const int OrderBookFieldNumber = 2; - private bool hasOrderBook; - private global::bnet.protocol.exchange.OrderBook orderBook_ = global::bnet.protocol.exchange.OrderBook.DefaultInstance; - public bool HasOrderBook { - get { return hasOrderBook; } - } - public global::bnet.protocol.exchange.OrderBook OrderBook { - get { return orderBook_; } - } - - public const int BidCreationFieldNumber = 3; - private bool hasBidCreation; - private global::bnet.protocol.exchange.BidCreation bidCreation_ = global::bnet.protocol.exchange.BidCreation.DefaultInstance; - public bool HasBidCreation { - get { return hasBidCreation; } - } - public global::bnet.protocol.exchange.BidCreation BidCreation { - get { return bidCreation_; } - } - - public override bool IsInitialized { - get { - if (!hasPartitionId) return false; - if (!hasOrderBook) return false; - if (!hasBidCreation) return false; - if (!PartitionId.IsInitialized) return false; - if (!OrderBook.IsInitialized) return false; - if (!BidCreation.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasPartitionId) { - output.WriteMessage(1, PartitionId); - } - if (HasOrderBook) { - output.WriteMessage(2, OrderBook); - } - if (HasBidCreation) { - output.WriteMessage(3, BidCreation); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasPartitionId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); - } - if (HasOrderBook) { - size += pb::CodedOutputStream.ComputeMessageSize(2, OrderBook); - } - if (HasBidCreation) { - size += pb::CodedOutputStream.ComputeMessageSize(3, BidCreation); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static PlaceBidCreateOrderBookIfNeededRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PlaceBidCreateOrderBookIfNeededRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PlaceBidCreateOrderBookIfNeededRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PlaceBidCreateOrderBookIfNeededRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PlaceBidCreateOrderBookIfNeededRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PlaceBidCreateOrderBookIfNeededRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static PlaceBidCreateOrderBookIfNeededRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static PlaceBidCreateOrderBookIfNeededRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static PlaceBidCreateOrderBookIfNeededRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PlaceBidCreateOrderBookIfNeededRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(PlaceBidCreateOrderBookIfNeededRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - PlaceBidCreateOrderBookIfNeededRequest result = new PlaceBidCreateOrderBookIfNeededRequest(); - - protected override PlaceBidCreateOrderBookIfNeededRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new PlaceBidCreateOrderBookIfNeededRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.PlaceBidCreateOrderBookIfNeededRequest.Descriptor; } - } - - public override PlaceBidCreateOrderBookIfNeededRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.PlaceBidCreateOrderBookIfNeededRequest.DefaultInstance; } - } - - public override PlaceBidCreateOrderBookIfNeededRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - PlaceBidCreateOrderBookIfNeededRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is PlaceBidCreateOrderBookIfNeededRequest) { - return MergeFrom((PlaceBidCreateOrderBookIfNeededRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(PlaceBidCreateOrderBookIfNeededRequest other) { - if (other == global::bnet.protocol.exchange.PlaceBidCreateOrderBookIfNeededRequest.DefaultInstance) return this; - if (other.HasPartitionId) { - MergePartitionId(other.PartitionId); - } - if (other.HasOrderBook) { - MergeOrderBook(other.OrderBook); - } - if (other.HasBidCreation) { - MergeBidCreation(other.BidCreation); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { - subBuilder.MergeFrom(PartitionId); - } - input.ReadMessage(subBuilder, extensionRegistry); - PartitionId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.exchange.OrderBook.Builder subBuilder = global::bnet.protocol.exchange.OrderBook.CreateBuilder(); - if (HasOrderBook) { - subBuilder.MergeFrom(OrderBook); - } - input.ReadMessage(subBuilder, extensionRegistry); - OrderBook = subBuilder.BuildPartial(); - break; - } - case 26: { - global::bnet.protocol.exchange.BidCreation.Builder subBuilder = global::bnet.protocol.exchange.BidCreation.CreateBuilder(); - if (HasBidCreation) { - subBuilder.MergeFrom(BidCreation); - } - input.ReadMessage(subBuilder, extensionRegistry); - BidCreation = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasPartitionId { - get { return result.HasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return result.PartitionId; } - set { SetPartitionId(value); } - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasPartitionId = true; - result.partitionId_ = value; - return this; - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasPartitionId = true; - result.partitionId_ = builderForValue.Build(); - return this; - } - public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasPartitionId && - result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); - } else { - result.partitionId_ = value; - } - result.hasPartitionId = true; - return this; - } - public Builder ClearPartitionId() { - result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - return this; - } - - public bool HasOrderBook { - get { return result.HasOrderBook; } - } - public global::bnet.protocol.exchange.OrderBook OrderBook { - get { return result.OrderBook; } - set { SetOrderBook(value); } - } - public Builder SetOrderBook(global::bnet.protocol.exchange.OrderBook value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasOrderBook = true; - result.orderBook_ = value; - return this; - } - public Builder SetOrderBook(global::bnet.protocol.exchange.OrderBook.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasOrderBook = true; - result.orderBook_ = builderForValue.Build(); - return this; - } - public Builder MergeOrderBook(global::bnet.protocol.exchange.OrderBook value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasOrderBook && - result.orderBook_ != global::bnet.protocol.exchange.OrderBook.DefaultInstance) { - result.orderBook_ = global::bnet.protocol.exchange.OrderBook.CreateBuilder(result.orderBook_).MergeFrom(value).BuildPartial(); - } else { - result.orderBook_ = value; - } - result.hasOrderBook = true; - return this; - } - public Builder ClearOrderBook() { - result.hasOrderBook = false; - result.orderBook_ = global::bnet.protocol.exchange.OrderBook.DefaultInstance; - return this; - } - - public bool HasBidCreation { - get { return result.HasBidCreation; } - } - public global::bnet.protocol.exchange.BidCreation BidCreation { - get { return result.BidCreation; } - set { SetBidCreation(value); } - } - public Builder SetBidCreation(global::bnet.protocol.exchange.BidCreation value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBidCreation = true; - result.bidCreation_ = value; - return this; - } - public Builder SetBidCreation(global::bnet.protocol.exchange.BidCreation.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBidCreation = true; - result.bidCreation_ = builderForValue.Build(); - return this; - } - public Builder MergeBidCreation(global::bnet.protocol.exchange.BidCreation value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasBidCreation && - result.bidCreation_ != global::bnet.protocol.exchange.BidCreation.DefaultInstance) { - result.bidCreation_ = global::bnet.protocol.exchange.BidCreation.CreateBuilder(result.bidCreation_).MergeFrom(value).BuildPartial(); - } else { - result.bidCreation_ = value; - } - result.hasBidCreation = true; - return this; - } - public Builder ClearBidCreation() { - result.hasBidCreation = false; - result.bidCreation_ = global::bnet.protocol.exchange.BidCreation.DefaultInstance; - return this; - } - } - static PlaceBidCreateOrderBookIfNeededRequest() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class PlaceBidCreateOrderBookIfNeededResponse : pb::GeneratedMessage { - private static readonly PlaceBidCreateOrderBookIfNeededResponse defaultInstance = new Builder().BuildPartial(); - public static PlaceBidCreateOrderBookIfNeededResponse DefaultInstance { - get { return defaultInstance; } - } - - public override PlaceBidCreateOrderBookIfNeededResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override PlaceBidCreateOrderBookIfNeededResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_PlaceBidCreateOrderBookIfNeededResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_PlaceBidCreateOrderBookIfNeededResponse__FieldAccessorTable; } - } - - public const int OrderBookIdFieldNumber = 1; - private bool hasOrderBookId; - private ulong orderBookId_ = 0UL; - public bool HasOrderBookId { - get { return hasOrderBookId; } - } - public ulong OrderBookId { - get { return orderBookId_; } - } - - public const int BidIdFieldNumber = 2; - private bool hasBidId; - private ulong bidId_ = 0UL; - public bool HasBidId { - get { return hasBidId; } - } - public ulong BidId { - get { return bidId_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasOrderBookId) { - output.WriteUInt64(1, OrderBookId); - } - if (HasBidId) { - output.WriteUInt64(2, BidId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasOrderBookId) { - size += pb::CodedOutputStream.ComputeUInt64Size(1, OrderBookId); - } - if (HasBidId) { - size += pb::CodedOutputStream.ComputeUInt64Size(2, BidId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static PlaceBidCreateOrderBookIfNeededResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PlaceBidCreateOrderBookIfNeededResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PlaceBidCreateOrderBookIfNeededResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PlaceBidCreateOrderBookIfNeededResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PlaceBidCreateOrderBookIfNeededResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PlaceBidCreateOrderBookIfNeededResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static PlaceBidCreateOrderBookIfNeededResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static PlaceBidCreateOrderBookIfNeededResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static PlaceBidCreateOrderBookIfNeededResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PlaceBidCreateOrderBookIfNeededResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(PlaceBidCreateOrderBookIfNeededResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - PlaceBidCreateOrderBookIfNeededResponse result = new PlaceBidCreateOrderBookIfNeededResponse(); - - protected override PlaceBidCreateOrderBookIfNeededResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new PlaceBidCreateOrderBookIfNeededResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.PlaceBidCreateOrderBookIfNeededResponse.Descriptor; } - } - - public override PlaceBidCreateOrderBookIfNeededResponse DefaultInstanceForType { - get { return global::bnet.protocol.exchange.PlaceBidCreateOrderBookIfNeededResponse.DefaultInstance; } - } - - public override PlaceBidCreateOrderBookIfNeededResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - PlaceBidCreateOrderBookIfNeededResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is PlaceBidCreateOrderBookIfNeededResponse) { - return MergeFrom((PlaceBidCreateOrderBookIfNeededResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(PlaceBidCreateOrderBookIfNeededResponse other) { - if (other == global::bnet.protocol.exchange.PlaceBidCreateOrderBookIfNeededResponse.DefaultInstance) return this; - if (other.HasOrderBookId) { - OrderBookId = other.OrderBookId; - } - if (other.HasBidId) { - BidId = other.BidId; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - OrderBookId = input.ReadUInt64(); - break; - } - case 16: { - BidId = input.ReadUInt64(); - break; - } - } - } - } - - - public bool HasOrderBookId { - get { return result.HasOrderBookId; } - } - public ulong OrderBookId { - get { return result.OrderBookId; } - set { SetOrderBookId(value); } - } - public Builder SetOrderBookId(ulong value) { - result.hasOrderBookId = true; - result.orderBookId_ = value; - return this; - } - public Builder ClearOrderBookId() { - result.hasOrderBookId = false; - result.orderBookId_ = 0UL; - return this; - } - - public bool HasBidId { - get { return result.HasBidId; } - } - public ulong BidId { - get { return result.BidId; } - set { SetBidId(value); } - } - public Builder SetBidId(ulong value) { - result.hasBidId = true; - result.bidId_ = value; - return this; - } - public Builder ClearBidId() { - result.hasBidId = false; - result.bidId_ = 0UL; - return this; - } - } - static PlaceBidCreateOrderBookIfNeededResponse() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class QueryOffersByOrderBookRequest : pb::GeneratedMessage { - private static readonly QueryOffersByOrderBookRequest defaultInstance = new Builder().BuildPartial(); - public static QueryOffersByOrderBookRequest DefaultInstance { - get { return defaultInstance; } - } - - public override QueryOffersByOrderBookRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override QueryOffersByOrderBookRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryOffersByOrderBookRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryOffersByOrderBookRequest__FieldAccessorTable; } - } - - public const int PartitionIdFieldNumber = 1; - private bool hasPartitionId; - private global::bnet.protocol.exchange.PartitionId partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - public bool HasPartitionId { - get { return hasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return partitionId_; } - } - - public const int FilterFieldNumber = 2; - private bool hasFilter; - private global::bnet.protocol.exchange.QueryFilterByOrderId filter_ = global::bnet.protocol.exchange.QueryFilterByOrderId.DefaultInstance; - public bool HasFilter { - get { return hasFilter; } - } - public global::bnet.protocol.exchange.QueryFilterByOrderId Filter { - get { return filter_; } - } - - public const int StatusFieldNumber = 3; - private bool hasStatus; - private int status_ = 0; - public bool HasStatus { - get { return hasStatus; } - } - public int Status { - get { return status_; } - } - - public override bool IsInitialized { - get { - if (!hasPartitionId) return false; - if (!hasFilter) return false; - if (!hasStatus) return false; - if (!PartitionId.IsInitialized) return false; - if (!Filter.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasPartitionId) { - output.WriteMessage(1, PartitionId); - } - if (HasFilter) { - output.WriteMessage(2, Filter); - } - if (HasStatus) { - output.WriteInt32(3, Status); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasPartitionId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); - } - if (HasFilter) { - size += pb::CodedOutputStream.ComputeMessageSize(2, Filter); - } - if (HasStatus) { - size += pb::CodedOutputStream.ComputeInt32Size(3, Status); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static QueryOffersByOrderBookRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static QueryOffersByOrderBookRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static QueryOffersByOrderBookRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static QueryOffersByOrderBookRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static QueryOffersByOrderBookRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static QueryOffersByOrderBookRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static QueryOffersByOrderBookRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static QueryOffersByOrderBookRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static QueryOffersByOrderBookRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static QueryOffersByOrderBookRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(QueryOffersByOrderBookRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - QueryOffersByOrderBookRequest result = new QueryOffersByOrderBookRequest(); - - protected override QueryOffersByOrderBookRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new QueryOffersByOrderBookRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.QueryOffersByOrderBookRequest.Descriptor; } - } - - public override QueryOffersByOrderBookRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.QueryOffersByOrderBookRequest.DefaultInstance; } - } - - public override QueryOffersByOrderBookRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - QueryOffersByOrderBookRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is QueryOffersByOrderBookRequest) { - return MergeFrom((QueryOffersByOrderBookRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(QueryOffersByOrderBookRequest other) { - if (other == global::bnet.protocol.exchange.QueryOffersByOrderBookRequest.DefaultInstance) return this; - if (other.HasPartitionId) { - MergePartitionId(other.PartitionId); - } - if (other.HasFilter) { - MergeFilter(other.Filter); - } - if (other.HasStatus) { - Status = other.Status; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { - subBuilder.MergeFrom(PartitionId); - } - input.ReadMessage(subBuilder, extensionRegistry); - PartitionId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.exchange.QueryFilterByOrderId.Builder subBuilder = global::bnet.protocol.exchange.QueryFilterByOrderId.CreateBuilder(); - if (HasFilter) { - subBuilder.MergeFrom(Filter); - } - input.ReadMessage(subBuilder, extensionRegistry); - Filter = subBuilder.BuildPartial(); - break; - } - case 24: { - Status = input.ReadInt32(); - break; - } - } - } - } - - - public bool HasPartitionId { - get { return result.HasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return result.PartitionId; } - set { SetPartitionId(value); } - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasPartitionId = true; - result.partitionId_ = value; - return this; - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasPartitionId = true; - result.partitionId_ = builderForValue.Build(); - return this; - } - public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasPartitionId && - result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); - } else { - result.partitionId_ = value; - } - result.hasPartitionId = true; - return this; - } - public Builder ClearPartitionId() { - result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - return this; - } - - public bool HasFilter { - get { return result.HasFilter; } - } - public global::bnet.protocol.exchange.QueryFilterByOrderId Filter { - get { return result.Filter; } - set { SetFilter(value); } - } - public Builder SetFilter(global::bnet.protocol.exchange.QueryFilterByOrderId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasFilter = true; - result.filter_ = value; - return this; - } - public Builder SetFilter(global::bnet.protocol.exchange.QueryFilterByOrderId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasFilter = true; - result.filter_ = builderForValue.Build(); - return this; - } - public Builder MergeFilter(global::bnet.protocol.exchange.QueryFilterByOrderId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasFilter && - result.filter_ != global::bnet.protocol.exchange.QueryFilterByOrderId.DefaultInstance) { - result.filter_ = global::bnet.protocol.exchange.QueryFilterByOrderId.CreateBuilder(result.filter_).MergeFrom(value).BuildPartial(); - } else { - result.filter_ = value; - } - result.hasFilter = true; - return this; - } - public Builder ClearFilter() { - result.hasFilter = false; - result.filter_ = global::bnet.protocol.exchange.QueryFilterByOrderId.DefaultInstance; - return this; - } - - public bool HasStatus { - get { return result.HasStatus; } - } - public int Status { - get { return result.Status; } - set { SetStatus(value); } - } - public Builder SetStatus(int value) { - result.hasStatus = true; - result.status_ = value; - return this; - } - public Builder ClearStatus() { - result.hasStatus = false; - result.status_ = 0; - return this; - } - } - static QueryOffersByOrderBookRequest() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class QueryOffersByOrderBookResponse : pb::GeneratedMessage { - private static readonly QueryOffersByOrderBookResponse defaultInstance = new Builder().BuildPartial(); - public static QueryOffersByOrderBookResponse DefaultInstance { - get { return defaultInstance; } - } - - public override QueryOffersByOrderBookResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override QueryOffersByOrderBookResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryOffersByOrderBookResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryOffersByOrderBookResponse__FieldAccessorTable; } - } - - public const int OffersFieldNumber = 1; - private pbc::PopsicleList offers_ = new pbc::PopsicleList(); - public scg::IList OffersList { - get { return offers_; } - } - public int OffersCount { - get { return offers_.Count; } - } - public global::bnet.protocol.exchange.OfferExtended GetOffers(int index) { - return offers_[index]; - } - - public const int TotalCountFieldNumber = 2; - private bool hasTotalCount; - private uint totalCount_ = 0; - public bool HasTotalCount { - get { return hasTotalCount; } - } - public uint TotalCount { - get { return totalCount_; } - } - - public override bool IsInitialized { - get { - if (!hasTotalCount) return false; - foreach (global::bnet.protocol.exchange.OfferExtended element in OffersList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::bnet.protocol.exchange.OfferExtended element in OffersList) { - output.WriteMessage(1, element); - } - if (HasTotalCount) { - output.WriteUInt32(2, TotalCount); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::bnet.protocol.exchange.OfferExtended element in OffersList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - if (HasTotalCount) { - size += pb::CodedOutputStream.ComputeUInt32Size(2, TotalCount); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static QueryOffersByOrderBookResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static QueryOffersByOrderBookResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static QueryOffersByOrderBookResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static QueryOffersByOrderBookResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static QueryOffersByOrderBookResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static QueryOffersByOrderBookResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static QueryOffersByOrderBookResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static QueryOffersByOrderBookResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static QueryOffersByOrderBookResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static QueryOffersByOrderBookResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(QueryOffersByOrderBookResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - QueryOffersByOrderBookResponse result = new QueryOffersByOrderBookResponse(); - - protected override QueryOffersByOrderBookResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new QueryOffersByOrderBookResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.QueryOffersByOrderBookResponse.Descriptor; } - } - - public override QueryOffersByOrderBookResponse DefaultInstanceForType { - get { return global::bnet.protocol.exchange.QueryOffersByOrderBookResponse.DefaultInstance; } - } - - public override QueryOffersByOrderBookResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.offers_.MakeReadOnly(); - QueryOffersByOrderBookResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is QueryOffersByOrderBookResponse) { - return MergeFrom((QueryOffersByOrderBookResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(QueryOffersByOrderBookResponse other) { - if (other == global::bnet.protocol.exchange.QueryOffersByOrderBookResponse.DefaultInstance) return this; - if (other.offers_.Count != 0) { - base.AddRange(other.offers_, result.offers_); - } - if (other.HasTotalCount) { - TotalCount = other.TotalCount; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.OfferExtended.Builder subBuilder = global::bnet.protocol.exchange.OfferExtended.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddOffers(subBuilder.BuildPartial()); - break; - } - case 16: { - TotalCount = input.ReadUInt32(); - break; - } - } - } - } - - - public pbc::IPopsicleList OffersList { - get { return result.offers_; } - } - public int OffersCount { - get { return result.OffersCount; } - } - public global::bnet.protocol.exchange.OfferExtended GetOffers(int index) { - return result.GetOffers(index); - } - public Builder SetOffers(int index, global::bnet.protocol.exchange.OfferExtended value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.offers_[index] = value; - return this; - } - public Builder SetOffers(int index, global::bnet.protocol.exchange.OfferExtended.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.offers_[index] = builderForValue.Build(); - return this; - } - public Builder AddOffers(global::bnet.protocol.exchange.OfferExtended value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.offers_.Add(value); - return this; - } - public Builder AddOffers(global::bnet.protocol.exchange.OfferExtended.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.offers_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeOffers(scg::IEnumerable values) { - base.AddRange(values, result.offers_); - return this; - } - public Builder ClearOffers() { - result.offers_.Clear(); - return this; - } - - public bool HasTotalCount { - get { return result.HasTotalCount; } - } - public uint TotalCount { - get { return result.TotalCount; } - set { SetTotalCount(value); } - } - public Builder SetTotalCount(uint value) { - result.hasTotalCount = true; - result.totalCount_ = value; - return this; - } - public Builder ClearTotalCount() { - result.hasTotalCount = false; - result.totalCount_ = 0; - return this; - } - } - static QueryOffersByOrderBookResponse() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class QueryBidsByOrderBookRequest : pb::GeneratedMessage { - private static readonly QueryBidsByOrderBookRequest defaultInstance = new Builder().BuildPartial(); - public static QueryBidsByOrderBookRequest DefaultInstance { - get { return defaultInstance; } - } - - public override QueryBidsByOrderBookRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override QueryBidsByOrderBookRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryBidsByOrderBookRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryBidsByOrderBookRequest__FieldAccessorTable; } - } - - public const int PartitionIdFieldNumber = 1; - private bool hasPartitionId; - private global::bnet.protocol.exchange.PartitionId partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - public bool HasPartitionId { - get { return hasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return partitionId_; } - } - - public const int FilterFieldNumber = 2; - private bool hasFilter; - private global::bnet.protocol.exchange.QueryFilterByOrderId filter_ = global::bnet.protocol.exchange.QueryFilterByOrderId.DefaultInstance; - public bool HasFilter { - get { return hasFilter; } - } - public global::bnet.protocol.exchange.QueryFilterByOrderId Filter { - get { return filter_; } - } - - public const int StatusFieldNumber = 3; - private bool hasStatus; - private int status_ = 0; - public bool HasStatus { - get { return hasStatus; } - } - public int Status { - get { return status_; } - } - - public override bool IsInitialized { - get { - if (!hasPartitionId) return false; - if (!hasFilter) return false; - if (!hasStatus) return false; - if (!PartitionId.IsInitialized) return false; - if (!Filter.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasPartitionId) { - output.WriteMessage(1, PartitionId); - } - if (HasFilter) { - output.WriteMessage(2, Filter); - } - if (HasStatus) { - output.WriteInt32(3, Status); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasPartitionId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); - } - if (HasFilter) { - size += pb::CodedOutputStream.ComputeMessageSize(2, Filter); - } - if (HasStatus) { - size += pb::CodedOutputStream.ComputeInt32Size(3, Status); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static QueryBidsByOrderBookRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static QueryBidsByOrderBookRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static QueryBidsByOrderBookRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static QueryBidsByOrderBookRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static QueryBidsByOrderBookRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static QueryBidsByOrderBookRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static QueryBidsByOrderBookRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static QueryBidsByOrderBookRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static QueryBidsByOrderBookRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static QueryBidsByOrderBookRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(QueryBidsByOrderBookRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - QueryBidsByOrderBookRequest result = new QueryBidsByOrderBookRequest(); - - protected override QueryBidsByOrderBookRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new QueryBidsByOrderBookRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.QueryBidsByOrderBookRequest.Descriptor; } - } - - public override QueryBidsByOrderBookRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.QueryBidsByOrderBookRequest.DefaultInstance; } - } - - public override QueryBidsByOrderBookRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - QueryBidsByOrderBookRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is QueryBidsByOrderBookRequest) { - return MergeFrom((QueryBidsByOrderBookRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(QueryBidsByOrderBookRequest other) { - if (other == global::bnet.protocol.exchange.QueryBidsByOrderBookRequest.DefaultInstance) return this; - if (other.HasPartitionId) { - MergePartitionId(other.PartitionId); - } - if (other.HasFilter) { - MergeFilter(other.Filter); - } - if (other.HasStatus) { - Status = other.Status; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { - subBuilder.MergeFrom(PartitionId); - } - input.ReadMessage(subBuilder, extensionRegistry); - PartitionId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.exchange.QueryFilterByOrderId.Builder subBuilder = global::bnet.protocol.exchange.QueryFilterByOrderId.CreateBuilder(); - if (HasFilter) { - subBuilder.MergeFrom(Filter); - } - input.ReadMessage(subBuilder, extensionRegistry); - Filter = subBuilder.BuildPartial(); - break; - } - case 24: { - Status = input.ReadInt32(); - break; - } - } - } - } - - - public bool HasPartitionId { - get { return result.HasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return result.PartitionId; } - set { SetPartitionId(value); } - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasPartitionId = true; - result.partitionId_ = value; - return this; - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasPartitionId = true; - result.partitionId_ = builderForValue.Build(); - return this; - } - public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasPartitionId && - result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); - } else { - result.partitionId_ = value; - } - result.hasPartitionId = true; - return this; - } - public Builder ClearPartitionId() { - result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - return this; - } - - public bool HasFilter { - get { return result.HasFilter; } - } - public global::bnet.protocol.exchange.QueryFilterByOrderId Filter { - get { return result.Filter; } - set { SetFilter(value); } - } - public Builder SetFilter(global::bnet.protocol.exchange.QueryFilterByOrderId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasFilter = true; - result.filter_ = value; - return this; - } - public Builder SetFilter(global::bnet.protocol.exchange.QueryFilterByOrderId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasFilter = true; - result.filter_ = builderForValue.Build(); - return this; - } - public Builder MergeFilter(global::bnet.protocol.exchange.QueryFilterByOrderId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasFilter && - result.filter_ != global::bnet.protocol.exchange.QueryFilterByOrderId.DefaultInstance) { - result.filter_ = global::bnet.protocol.exchange.QueryFilterByOrderId.CreateBuilder(result.filter_).MergeFrom(value).BuildPartial(); - } else { - result.filter_ = value; - } - result.hasFilter = true; - return this; - } - public Builder ClearFilter() { - result.hasFilter = false; - result.filter_ = global::bnet.protocol.exchange.QueryFilterByOrderId.DefaultInstance; - return this; - } - - public bool HasStatus { - get { return result.HasStatus; } - } - public int Status { - get { return result.Status; } - set { SetStatus(value); } - } - public Builder SetStatus(int value) { - result.hasStatus = true; - result.status_ = value; - return this; - } - public Builder ClearStatus() { - result.hasStatus = false; - result.status_ = 0; - return this; - } - } - static QueryBidsByOrderBookRequest() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class QueryBidsByOrderBookResponse : pb::GeneratedMessage { - private static readonly QueryBidsByOrderBookResponse defaultInstance = new Builder().BuildPartial(); - public static QueryBidsByOrderBookResponse DefaultInstance { - get { return defaultInstance; } - } - - public override QueryBidsByOrderBookResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override QueryBidsByOrderBookResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryBidsByOrderBookResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryBidsByOrderBookResponse__FieldAccessorTable; } - } - - public const int BidsFieldNumber = 1; - private pbc::PopsicleList bids_ = new pbc::PopsicleList(); - public scg::IList BidsList { - get { return bids_; } - } - public int BidsCount { - get { return bids_.Count; } - } - public global::bnet.protocol.exchange.BidExtended GetBids(int index) { - return bids_[index]; - } - - public const int TotalCountFieldNumber = 2; - private bool hasTotalCount; - private uint totalCount_ = 0; - public bool HasTotalCount { - get { return hasTotalCount; } - } - public uint TotalCount { - get { return totalCount_; } - } - - public override bool IsInitialized { - get { - if (!hasTotalCount) return false; - foreach (global::bnet.protocol.exchange.BidExtended element in BidsList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::bnet.protocol.exchange.BidExtended element in BidsList) { - output.WriteMessage(1, element); - } - if (HasTotalCount) { - output.WriteUInt32(2, TotalCount); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::bnet.protocol.exchange.BidExtended element in BidsList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - if (HasTotalCount) { - size += pb::CodedOutputStream.ComputeUInt32Size(2, TotalCount); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static QueryBidsByOrderBookResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static QueryBidsByOrderBookResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static QueryBidsByOrderBookResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static QueryBidsByOrderBookResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static QueryBidsByOrderBookResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static QueryBidsByOrderBookResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static QueryBidsByOrderBookResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static QueryBidsByOrderBookResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static QueryBidsByOrderBookResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static QueryBidsByOrderBookResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(QueryBidsByOrderBookResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - QueryBidsByOrderBookResponse result = new QueryBidsByOrderBookResponse(); - - protected override QueryBidsByOrderBookResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new QueryBidsByOrderBookResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.QueryBidsByOrderBookResponse.Descriptor; } - } - - public override QueryBidsByOrderBookResponse DefaultInstanceForType { - get { return global::bnet.protocol.exchange.QueryBidsByOrderBookResponse.DefaultInstance; } - } - - public override QueryBidsByOrderBookResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.bids_.MakeReadOnly(); - QueryBidsByOrderBookResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is QueryBidsByOrderBookResponse) { - return MergeFrom((QueryBidsByOrderBookResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(QueryBidsByOrderBookResponse other) { - if (other == global::bnet.protocol.exchange.QueryBidsByOrderBookResponse.DefaultInstance) return this; - if (other.bids_.Count != 0) { - base.AddRange(other.bids_, result.bids_); - } - if (other.HasTotalCount) { - TotalCount = other.TotalCount; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.BidExtended.Builder subBuilder = global::bnet.protocol.exchange.BidExtended.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddBids(subBuilder.BuildPartial()); - break; - } - case 16: { - TotalCount = input.ReadUInt32(); - break; - } - } - } - } - - - public pbc::IPopsicleList BidsList { - get { return result.bids_; } - } - public int BidsCount { - get { return result.BidsCount; } - } - public global::bnet.protocol.exchange.BidExtended GetBids(int index) { - return result.GetBids(index); - } - public Builder SetBids(int index, global::bnet.protocol.exchange.BidExtended value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.bids_[index] = value; - return this; - } - public Builder SetBids(int index, global::bnet.protocol.exchange.BidExtended.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.bids_[index] = builderForValue.Build(); - return this; - } - public Builder AddBids(global::bnet.protocol.exchange.BidExtended value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.bids_.Add(value); - return this; - } - public Builder AddBids(global::bnet.protocol.exchange.BidExtended.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.bids_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeBids(scg::IEnumerable values) { - base.AddRange(values, result.bids_); - return this; - } - public Builder ClearBids() { - result.bids_.Clear(); - return this; - } - - public bool HasTotalCount { - get { return result.HasTotalCount; } - } - public uint TotalCount { - get { return result.TotalCount; } - set { SetTotalCount(value); } - } - public Builder SetTotalCount(uint value) { - result.hasTotalCount = true; - result.totalCount_ = value; - return this; - } - public Builder ClearTotalCount() { - result.hasTotalCount = false; - result.totalCount_ = 0; - return this; - } - } - static QueryBidsByOrderBookResponse() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class QueryOffersByAccountForItemRequest : pb::GeneratedMessage { - private static readonly QueryOffersByAccountForItemRequest defaultInstance = new Builder().BuildPartial(); - public static QueryOffersByAccountForItemRequest DefaultInstance { - get { return defaultInstance; } - } - - public override QueryOffersByAccountForItemRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override QueryOffersByAccountForItemRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryOffersByAccountForItemRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryOffersByAccountForItemRequest__FieldAccessorTable; } - } - - public const int AccountForItemFieldNumber = 1; - private bool hasAccountForItem; - private global::bnet.protocol.exchange.BlobFrom accountForItem_ = global::bnet.protocol.exchange.BlobFrom.DefaultInstance; - public bool HasAccountForItem { - get { return hasAccountForItem; } - } - public global::bnet.protocol.exchange.BlobFrom AccountForItem { - get { return accountForItem_; } - } - - public const int FilterFieldNumber = 2; - private bool hasFilter; - private global::bnet.protocol.exchange.QueryFilterByCreatedTime filter_ = global::bnet.protocol.exchange.QueryFilterByCreatedTime.DefaultInstance; - public bool HasFilter { - get { return hasFilter; } - } - public global::bnet.protocol.exchange.QueryFilterByCreatedTime Filter { - get { return filter_; } - } - - public const int BnetAccountFieldNumber = 3; - private bool hasBnetAccount; - private global::bnet.protocol.EntityId bnetAccount_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasBnetAccount { - get { return hasBnetAccount; } - } - public global::bnet.protocol.EntityId BnetAccount { - get { return bnetAccount_; } - } - - public override bool IsInitialized { - get { - if (!hasAccountForItem) return false; - if (!hasFilter) return false; - if (!AccountForItem.IsInitialized) return false; - if (!Filter.IsInitialized) return false; - if (HasBnetAccount) { - if (!BnetAccount.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasAccountForItem) { - output.WriteMessage(1, AccountForItem); - } - if (HasFilter) { - output.WriteMessage(2, Filter); - } - if (HasBnetAccount) { - output.WriteMessage(3, BnetAccount); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasAccountForItem) { - size += pb::CodedOutputStream.ComputeMessageSize(1, AccountForItem); - } - if (HasFilter) { - size += pb::CodedOutputStream.ComputeMessageSize(2, Filter); - } - if (HasBnetAccount) { - size += pb::CodedOutputStream.ComputeMessageSize(3, BnetAccount); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static QueryOffersByAccountForItemRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static QueryOffersByAccountForItemRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static QueryOffersByAccountForItemRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static QueryOffersByAccountForItemRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static QueryOffersByAccountForItemRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static QueryOffersByAccountForItemRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static QueryOffersByAccountForItemRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static QueryOffersByAccountForItemRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static QueryOffersByAccountForItemRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static QueryOffersByAccountForItemRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(QueryOffersByAccountForItemRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - QueryOffersByAccountForItemRequest result = new QueryOffersByAccountForItemRequest(); - - protected override QueryOffersByAccountForItemRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new QueryOffersByAccountForItemRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.QueryOffersByAccountForItemRequest.Descriptor; } - } - - public override QueryOffersByAccountForItemRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.QueryOffersByAccountForItemRequest.DefaultInstance; } - } - - public override QueryOffersByAccountForItemRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - QueryOffersByAccountForItemRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is QueryOffersByAccountForItemRequest) { - return MergeFrom((QueryOffersByAccountForItemRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(QueryOffersByAccountForItemRequest other) { - if (other == global::bnet.protocol.exchange.QueryOffersByAccountForItemRequest.DefaultInstance) return this; - if (other.HasAccountForItem) { - MergeAccountForItem(other.AccountForItem); - } - if (other.HasFilter) { - MergeFilter(other.Filter); - } - if (other.HasBnetAccount) { - MergeBnetAccount(other.BnetAccount); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.BlobFrom.Builder subBuilder = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(); - if (HasAccountForItem) { - subBuilder.MergeFrom(AccountForItem); - } - input.ReadMessage(subBuilder, extensionRegistry); - AccountForItem = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.exchange.QueryFilterByCreatedTime.Builder subBuilder = global::bnet.protocol.exchange.QueryFilterByCreatedTime.CreateBuilder(); - if (HasFilter) { - subBuilder.MergeFrom(Filter); - } - input.ReadMessage(subBuilder, extensionRegistry); - Filter = subBuilder.BuildPartial(); - break; - } - case 26: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasBnetAccount) { - subBuilder.MergeFrom(BnetAccount); - } - input.ReadMessage(subBuilder, extensionRegistry); - BnetAccount = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasAccountForItem { - get { return result.HasAccountForItem; } - } - public global::bnet.protocol.exchange.BlobFrom AccountForItem { - get { return result.AccountForItem; } - set { SetAccountForItem(value); } - } - public Builder SetAccountForItem(global::bnet.protocol.exchange.BlobFrom value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasAccountForItem = true; - result.accountForItem_ = value; - return this; - } - public Builder SetAccountForItem(global::bnet.protocol.exchange.BlobFrom.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasAccountForItem = true; - result.accountForItem_ = builderForValue.Build(); - return this; - } - public Builder MergeAccountForItem(global::bnet.protocol.exchange.BlobFrom value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAccountForItem && - result.accountForItem_ != global::bnet.protocol.exchange.BlobFrom.DefaultInstance) { - result.accountForItem_ = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(result.accountForItem_).MergeFrom(value).BuildPartial(); - } else { - result.accountForItem_ = value; - } - result.hasAccountForItem = true; - return this; - } - public Builder ClearAccountForItem() { - result.hasAccountForItem = false; - result.accountForItem_ = global::bnet.protocol.exchange.BlobFrom.DefaultInstance; - return this; - } - - public bool HasFilter { - get { return result.HasFilter; } - } - public global::bnet.protocol.exchange.QueryFilterByCreatedTime Filter { - get { return result.Filter; } - set { SetFilter(value); } - } - public Builder SetFilter(global::bnet.protocol.exchange.QueryFilterByCreatedTime value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasFilter = true; - result.filter_ = value; - return this; - } - public Builder SetFilter(global::bnet.protocol.exchange.QueryFilterByCreatedTime.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasFilter = true; - result.filter_ = builderForValue.Build(); - return this; - } - public Builder MergeFilter(global::bnet.protocol.exchange.QueryFilterByCreatedTime value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasFilter && - result.filter_ != global::bnet.protocol.exchange.QueryFilterByCreatedTime.DefaultInstance) { - result.filter_ = global::bnet.protocol.exchange.QueryFilterByCreatedTime.CreateBuilder(result.filter_).MergeFrom(value).BuildPartial(); - } else { - result.filter_ = value; - } - result.hasFilter = true; - return this; - } - public Builder ClearFilter() { - result.hasFilter = false; - result.filter_ = global::bnet.protocol.exchange.QueryFilterByCreatedTime.DefaultInstance; - return this; - } - - public bool HasBnetAccount { - get { return result.HasBnetAccount; } - } - public global::bnet.protocol.EntityId BnetAccount { - get { return result.BnetAccount; } - set { SetBnetAccount(value); } - } - public Builder SetBnetAccount(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBnetAccount = true; - result.bnetAccount_ = value; - return this; - } - public Builder SetBnetAccount(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBnetAccount = true; - result.bnetAccount_ = builderForValue.Build(); - return this; - } - public Builder MergeBnetAccount(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasBnetAccount && - result.bnetAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.bnetAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccount_).MergeFrom(value).BuildPartial(); - } else { - result.bnetAccount_ = value; - } - result.hasBnetAccount = true; - return this; - } - public Builder ClearBnetAccount() { - result.hasBnetAccount = false; - result.bnetAccount_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - } - static QueryOffersByAccountForItemRequest() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class QueryOffersByAccountForItemResponse : pb::GeneratedMessage { - private static readonly QueryOffersByAccountForItemResponse defaultInstance = new Builder().BuildPartial(); - public static QueryOffersByAccountForItemResponse DefaultInstance { - get { return defaultInstance; } - } - - public override QueryOffersByAccountForItemResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override QueryOffersByAccountForItemResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryOffersByAccountForItemResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryOffersByAccountForItemResponse__FieldAccessorTable; } - } - - public const int OffersFieldNumber = 1; - private pbc::PopsicleList offers_ = new pbc::PopsicleList(); - public scg::IList OffersList { - get { return offers_; } - } - public int OffersCount { - get { return offers_.Count; } - } - public global::bnet.protocol.exchange.OfferExtended GetOffers(int index) { - return offers_[index]; - } - - public const int TotalCountFieldNumber = 2; - private bool hasTotalCount; - private uint totalCount_ = 0; - public bool HasTotalCount { - get { return hasTotalCount; } - } - public uint TotalCount { - get { return totalCount_; } - } - - public override bool IsInitialized { - get { - if (!hasTotalCount) return false; - foreach (global::bnet.protocol.exchange.OfferExtended element in OffersList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::bnet.protocol.exchange.OfferExtended element in OffersList) { - output.WriteMessage(1, element); - } - if (HasTotalCount) { - output.WriteUInt32(2, TotalCount); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::bnet.protocol.exchange.OfferExtended element in OffersList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - if (HasTotalCount) { - size += pb::CodedOutputStream.ComputeUInt32Size(2, TotalCount); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static QueryOffersByAccountForItemResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static QueryOffersByAccountForItemResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static QueryOffersByAccountForItemResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static QueryOffersByAccountForItemResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static QueryOffersByAccountForItemResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static QueryOffersByAccountForItemResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static QueryOffersByAccountForItemResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static QueryOffersByAccountForItemResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static QueryOffersByAccountForItemResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static QueryOffersByAccountForItemResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(QueryOffersByAccountForItemResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - QueryOffersByAccountForItemResponse result = new QueryOffersByAccountForItemResponse(); - - protected override QueryOffersByAccountForItemResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new QueryOffersByAccountForItemResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.QueryOffersByAccountForItemResponse.Descriptor; } - } - - public override QueryOffersByAccountForItemResponse DefaultInstanceForType { - get { return global::bnet.protocol.exchange.QueryOffersByAccountForItemResponse.DefaultInstance; } - } - - public override QueryOffersByAccountForItemResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.offers_.MakeReadOnly(); - QueryOffersByAccountForItemResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is QueryOffersByAccountForItemResponse) { - return MergeFrom((QueryOffersByAccountForItemResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(QueryOffersByAccountForItemResponse other) { - if (other == global::bnet.protocol.exchange.QueryOffersByAccountForItemResponse.DefaultInstance) return this; - if (other.offers_.Count != 0) { - base.AddRange(other.offers_, result.offers_); - } - if (other.HasTotalCount) { - TotalCount = other.TotalCount; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.OfferExtended.Builder subBuilder = global::bnet.protocol.exchange.OfferExtended.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddOffers(subBuilder.BuildPartial()); - break; - } - case 16: { - TotalCount = input.ReadUInt32(); - break; - } - } - } - } - - - public pbc::IPopsicleList OffersList { - get { return result.offers_; } - } - public int OffersCount { - get { return result.OffersCount; } - } - public global::bnet.protocol.exchange.OfferExtended GetOffers(int index) { - return result.GetOffers(index); - } - public Builder SetOffers(int index, global::bnet.protocol.exchange.OfferExtended value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.offers_[index] = value; - return this; - } - public Builder SetOffers(int index, global::bnet.protocol.exchange.OfferExtended.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.offers_[index] = builderForValue.Build(); - return this; - } - public Builder AddOffers(global::bnet.protocol.exchange.OfferExtended value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.offers_.Add(value); - return this; - } - public Builder AddOffers(global::bnet.protocol.exchange.OfferExtended.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.offers_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeOffers(scg::IEnumerable values) { - base.AddRange(values, result.offers_); - return this; - } - public Builder ClearOffers() { - result.offers_.Clear(); - return this; - } - - public bool HasTotalCount { - get { return result.HasTotalCount; } - } - public uint TotalCount { - get { return result.TotalCount; } - set { SetTotalCount(value); } - } - public Builder SetTotalCount(uint value) { - result.hasTotalCount = true; - result.totalCount_ = value; - return this; - } - public Builder ClearTotalCount() { - result.hasTotalCount = false; - result.totalCount_ = 0; - return this; - } - } - static QueryOffersByAccountForItemResponse() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class QueryBidsByAccountForItemRequest : pb::GeneratedMessage { - private static readonly QueryBidsByAccountForItemRequest defaultInstance = new Builder().BuildPartial(); - public static QueryBidsByAccountForItemRequest DefaultInstance { - get { return defaultInstance; } - } - - public override QueryBidsByAccountForItemRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override QueryBidsByAccountForItemRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryBidsByAccountForItemRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryBidsByAccountForItemRequest__FieldAccessorTable; } - } - - public const int AccountForItemFieldNumber = 1; - private bool hasAccountForItem; - private global::bnet.protocol.exchange.BlobFrom accountForItem_ = global::bnet.protocol.exchange.BlobFrom.DefaultInstance; - public bool HasAccountForItem { - get { return hasAccountForItem; } - } - public global::bnet.protocol.exchange.BlobFrom AccountForItem { - get { return accountForItem_; } - } - - public const int FilterFieldNumber = 2; - private bool hasFilter; - private global::bnet.protocol.exchange.QueryFilterByCreatedTime filter_ = global::bnet.protocol.exchange.QueryFilterByCreatedTime.DefaultInstance; - public bool HasFilter { - get { return hasFilter; } - } - public global::bnet.protocol.exchange.QueryFilterByCreatedTime Filter { - get { return filter_; } - } - - public const int BnetAccountFieldNumber = 3; - private bool hasBnetAccount; - private global::bnet.protocol.EntityId bnetAccount_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasBnetAccount { - get { return hasBnetAccount; } - } - public global::bnet.protocol.EntityId BnetAccount { - get { return bnetAccount_; } - } - - public override bool IsInitialized { - get { - if (!hasAccountForItem) return false; - if (!hasFilter) return false; - if (!AccountForItem.IsInitialized) return false; - if (!Filter.IsInitialized) return false; - if (HasBnetAccount) { - if (!BnetAccount.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasAccountForItem) { - output.WriteMessage(1, AccountForItem); - } - if (HasFilter) { - output.WriteMessage(2, Filter); - } - if (HasBnetAccount) { - output.WriteMessage(3, BnetAccount); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasAccountForItem) { - size += pb::CodedOutputStream.ComputeMessageSize(1, AccountForItem); - } - if (HasFilter) { - size += pb::CodedOutputStream.ComputeMessageSize(2, Filter); - } - if (HasBnetAccount) { - size += pb::CodedOutputStream.ComputeMessageSize(3, BnetAccount); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static QueryBidsByAccountForItemRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static QueryBidsByAccountForItemRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static QueryBidsByAccountForItemRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static QueryBidsByAccountForItemRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static QueryBidsByAccountForItemRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static QueryBidsByAccountForItemRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static QueryBidsByAccountForItemRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static QueryBidsByAccountForItemRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static QueryBidsByAccountForItemRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static QueryBidsByAccountForItemRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(QueryBidsByAccountForItemRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - QueryBidsByAccountForItemRequest result = new QueryBidsByAccountForItemRequest(); - - protected override QueryBidsByAccountForItemRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new QueryBidsByAccountForItemRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.QueryBidsByAccountForItemRequest.Descriptor; } - } - - public override QueryBidsByAccountForItemRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.QueryBidsByAccountForItemRequest.DefaultInstance; } - } - - public override QueryBidsByAccountForItemRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - QueryBidsByAccountForItemRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is QueryBidsByAccountForItemRequest) { - return MergeFrom((QueryBidsByAccountForItemRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(QueryBidsByAccountForItemRequest other) { - if (other == global::bnet.protocol.exchange.QueryBidsByAccountForItemRequest.DefaultInstance) return this; - if (other.HasAccountForItem) { - MergeAccountForItem(other.AccountForItem); - } - if (other.HasFilter) { - MergeFilter(other.Filter); - } - if (other.HasBnetAccount) { - MergeBnetAccount(other.BnetAccount); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.BlobFrom.Builder subBuilder = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(); - if (HasAccountForItem) { - subBuilder.MergeFrom(AccountForItem); - } - input.ReadMessage(subBuilder, extensionRegistry); - AccountForItem = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.exchange.QueryFilterByCreatedTime.Builder subBuilder = global::bnet.protocol.exchange.QueryFilterByCreatedTime.CreateBuilder(); - if (HasFilter) { - subBuilder.MergeFrom(Filter); - } - input.ReadMessage(subBuilder, extensionRegistry); - Filter = subBuilder.BuildPartial(); - break; - } - case 26: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasBnetAccount) { - subBuilder.MergeFrom(BnetAccount); - } - input.ReadMessage(subBuilder, extensionRegistry); - BnetAccount = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasAccountForItem { - get { return result.HasAccountForItem; } - } - public global::bnet.protocol.exchange.BlobFrom AccountForItem { - get { return result.AccountForItem; } - set { SetAccountForItem(value); } - } - public Builder SetAccountForItem(global::bnet.protocol.exchange.BlobFrom value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasAccountForItem = true; - result.accountForItem_ = value; - return this; - } - public Builder SetAccountForItem(global::bnet.protocol.exchange.BlobFrom.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasAccountForItem = true; - result.accountForItem_ = builderForValue.Build(); - return this; - } - public Builder MergeAccountForItem(global::bnet.protocol.exchange.BlobFrom value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAccountForItem && - result.accountForItem_ != global::bnet.protocol.exchange.BlobFrom.DefaultInstance) { - result.accountForItem_ = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(result.accountForItem_).MergeFrom(value).BuildPartial(); - } else { - result.accountForItem_ = value; - } - result.hasAccountForItem = true; - return this; - } - public Builder ClearAccountForItem() { - result.hasAccountForItem = false; - result.accountForItem_ = global::bnet.protocol.exchange.BlobFrom.DefaultInstance; - return this; - } - - public bool HasFilter { - get { return result.HasFilter; } - } - public global::bnet.protocol.exchange.QueryFilterByCreatedTime Filter { - get { return result.Filter; } - set { SetFilter(value); } - } - public Builder SetFilter(global::bnet.protocol.exchange.QueryFilterByCreatedTime value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasFilter = true; - result.filter_ = value; - return this; - } - public Builder SetFilter(global::bnet.protocol.exchange.QueryFilterByCreatedTime.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasFilter = true; - result.filter_ = builderForValue.Build(); - return this; - } - public Builder MergeFilter(global::bnet.protocol.exchange.QueryFilterByCreatedTime value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasFilter && - result.filter_ != global::bnet.protocol.exchange.QueryFilterByCreatedTime.DefaultInstance) { - result.filter_ = global::bnet.protocol.exchange.QueryFilterByCreatedTime.CreateBuilder(result.filter_).MergeFrom(value).BuildPartial(); - } else { - result.filter_ = value; - } - result.hasFilter = true; - return this; - } - public Builder ClearFilter() { - result.hasFilter = false; - result.filter_ = global::bnet.protocol.exchange.QueryFilterByCreatedTime.DefaultInstance; - return this; - } - - public bool HasBnetAccount { - get { return result.HasBnetAccount; } - } - public global::bnet.protocol.EntityId BnetAccount { - get { return result.BnetAccount; } - set { SetBnetAccount(value); } - } - public Builder SetBnetAccount(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBnetAccount = true; - result.bnetAccount_ = value; - return this; - } - public Builder SetBnetAccount(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBnetAccount = true; - result.bnetAccount_ = builderForValue.Build(); - return this; - } - public Builder MergeBnetAccount(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasBnetAccount && - result.bnetAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.bnetAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccount_).MergeFrom(value).BuildPartial(); - } else { - result.bnetAccount_ = value; - } - result.hasBnetAccount = true; - return this; - } - public Builder ClearBnetAccount() { - result.hasBnetAccount = false; - result.bnetAccount_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - } - static QueryBidsByAccountForItemRequest() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class QueryBidsByAccountForItemResponse : pb::GeneratedMessage { - private static readonly QueryBidsByAccountForItemResponse defaultInstance = new Builder().BuildPartial(); - public static QueryBidsByAccountForItemResponse DefaultInstance { - get { return defaultInstance; } - } - - public override QueryBidsByAccountForItemResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override QueryBidsByAccountForItemResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryBidsByAccountForItemResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryBidsByAccountForItemResponse__FieldAccessorTable; } - } - - public const int BidsFieldNumber = 1; - private pbc::PopsicleList bids_ = new pbc::PopsicleList(); - public scg::IList BidsList { - get { return bids_; } - } - public int BidsCount { - get { return bids_.Count; } - } - public global::bnet.protocol.exchange.BidExtended GetBids(int index) { - return bids_[index]; - } - - public const int TotalCountFieldNumber = 2; - private bool hasTotalCount; - private uint totalCount_ = 0; - public bool HasTotalCount { - get { return hasTotalCount; } - } - public uint TotalCount { - get { return totalCount_; } - } - - public override bool IsInitialized { - get { - if (!hasTotalCount) return false; - foreach (global::bnet.protocol.exchange.BidExtended element in BidsList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::bnet.protocol.exchange.BidExtended element in BidsList) { - output.WriteMessage(1, element); - } - if (HasTotalCount) { - output.WriteUInt32(2, TotalCount); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::bnet.protocol.exchange.BidExtended element in BidsList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - if (HasTotalCount) { - size += pb::CodedOutputStream.ComputeUInt32Size(2, TotalCount); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static QueryBidsByAccountForItemResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static QueryBidsByAccountForItemResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static QueryBidsByAccountForItemResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static QueryBidsByAccountForItemResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static QueryBidsByAccountForItemResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static QueryBidsByAccountForItemResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static QueryBidsByAccountForItemResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static QueryBidsByAccountForItemResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static QueryBidsByAccountForItemResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static QueryBidsByAccountForItemResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(QueryBidsByAccountForItemResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - QueryBidsByAccountForItemResponse result = new QueryBidsByAccountForItemResponse(); - - protected override QueryBidsByAccountForItemResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new QueryBidsByAccountForItemResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.QueryBidsByAccountForItemResponse.Descriptor; } - } - - public override QueryBidsByAccountForItemResponse DefaultInstanceForType { - get { return global::bnet.protocol.exchange.QueryBidsByAccountForItemResponse.DefaultInstance; } - } - - public override QueryBidsByAccountForItemResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.bids_.MakeReadOnly(); - QueryBidsByAccountForItemResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is QueryBidsByAccountForItemResponse) { - return MergeFrom((QueryBidsByAccountForItemResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(QueryBidsByAccountForItemResponse other) { - if (other == global::bnet.protocol.exchange.QueryBidsByAccountForItemResponse.DefaultInstance) return this; - if (other.bids_.Count != 0) { - base.AddRange(other.bids_, result.bids_); - } - if (other.HasTotalCount) { - TotalCount = other.TotalCount; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.BidExtended.Builder subBuilder = global::bnet.protocol.exchange.BidExtended.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddBids(subBuilder.BuildPartial()); - break; - } - case 16: { - TotalCount = input.ReadUInt32(); - break; - } - } - } - } - - - public pbc::IPopsicleList BidsList { - get { return result.bids_; } - } - public int BidsCount { - get { return result.BidsCount; } - } - public global::bnet.protocol.exchange.BidExtended GetBids(int index) { - return result.GetBids(index); - } - public Builder SetBids(int index, global::bnet.protocol.exchange.BidExtended value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.bids_[index] = value; - return this; - } - public Builder SetBids(int index, global::bnet.protocol.exchange.BidExtended.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.bids_[index] = builderForValue.Build(); - return this; - } - public Builder AddBids(global::bnet.protocol.exchange.BidExtended value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.bids_.Add(value); - return this; - } - public Builder AddBids(global::bnet.protocol.exchange.BidExtended.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.bids_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeBids(scg::IEnumerable values) { - base.AddRange(values, result.bids_); - return this; - } - public Builder ClearBids() { - result.bids_.Clear(); - return this; - } - - public bool HasTotalCount { - get { return result.HasTotalCount; } - } - public uint TotalCount { - get { return result.TotalCount; } - set { SetTotalCount(value); } - } - public Builder SetTotalCount(uint value) { - result.hasTotalCount = true; - result.totalCount_ = value; - return this; - } - public Builder ClearTotalCount() { - result.hasTotalCount = false; - result.totalCount_ = 0; - return this; - } - } - static QueryBidsByAccountForItemResponse() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class QueryOrderBooksSummaryRequest : pb::GeneratedMessage { - private static readonly QueryOrderBooksSummaryRequest defaultInstance = new Builder().BuildPartial(); - public static QueryOrderBooksSummaryRequest DefaultInstance { - get { return defaultInstance; } - } - - public override QueryOrderBooksSummaryRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override QueryOrderBooksSummaryRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryOrderBooksSummaryRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryOrderBooksSummaryRequest__FieldAccessorTable; } - } - - public const int HandlesFieldNumber = 1; - private pbc::PopsicleList handles_ = new pbc::PopsicleList(); - public scg::IList HandlesList { - get { return handles_; } - } - public int HandlesCount { - get { return handles_.Count; } - } - public global::bnet.protocol.exchange.OrderBookHandle GetHandles(int index) { - return handles_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::bnet.protocol.exchange.OrderBookHandle element in HandlesList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::bnet.protocol.exchange.OrderBookHandle element in HandlesList) { - output.WriteMessage(1, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::bnet.protocol.exchange.OrderBookHandle element in HandlesList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static QueryOrderBooksSummaryRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static QueryOrderBooksSummaryRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static QueryOrderBooksSummaryRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static QueryOrderBooksSummaryRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static QueryOrderBooksSummaryRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static QueryOrderBooksSummaryRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static QueryOrderBooksSummaryRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static QueryOrderBooksSummaryRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static QueryOrderBooksSummaryRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static QueryOrderBooksSummaryRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(QueryOrderBooksSummaryRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - QueryOrderBooksSummaryRequest result = new QueryOrderBooksSummaryRequest(); - - protected override QueryOrderBooksSummaryRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new QueryOrderBooksSummaryRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.QueryOrderBooksSummaryRequest.Descriptor; } - } - - public override QueryOrderBooksSummaryRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.QueryOrderBooksSummaryRequest.DefaultInstance; } - } - - public override QueryOrderBooksSummaryRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.handles_.MakeReadOnly(); - QueryOrderBooksSummaryRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is QueryOrderBooksSummaryRequest) { - return MergeFrom((QueryOrderBooksSummaryRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(QueryOrderBooksSummaryRequest other) { - if (other == global::bnet.protocol.exchange.QueryOrderBooksSummaryRequest.DefaultInstance) return this; - if (other.handles_.Count != 0) { - base.AddRange(other.handles_, result.handles_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.OrderBookHandle.Builder subBuilder = global::bnet.protocol.exchange.OrderBookHandle.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddHandles(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public pbc::IPopsicleList HandlesList { - get { return result.handles_; } - } - public int HandlesCount { - get { return result.HandlesCount; } - } - public global::bnet.protocol.exchange.OrderBookHandle GetHandles(int index) { - return result.GetHandles(index); - } - public Builder SetHandles(int index, global::bnet.protocol.exchange.OrderBookHandle value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.handles_[index] = value; - return this; - } - public Builder SetHandles(int index, global::bnet.protocol.exchange.OrderBookHandle.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.handles_[index] = builderForValue.Build(); - return this; - } - public Builder AddHandles(global::bnet.protocol.exchange.OrderBookHandle value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.handles_.Add(value); - return this; - } - public Builder AddHandles(global::bnet.protocol.exchange.OrderBookHandle.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.handles_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeHandles(scg::IEnumerable values) { - base.AddRange(values, result.handles_); - return this; - } - public Builder ClearHandles() { - result.handles_.Clear(); - return this; - } - } - static QueryOrderBooksSummaryRequest() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class QueryOrderBooksSummaryResponse : pb::GeneratedMessage { - private static readonly QueryOrderBooksSummaryResponse defaultInstance = new Builder().BuildPartial(); - public static QueryOrderBooksSummaryResponse DefaultInstance { - get { return defaultInstance; } - } - - public override QueryOrderBooksSummaryResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override QueryOrderBooksSummaryResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryOrderBooksSummaryResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryOrderBooksSummaryResponse__FieldAccessorTable; } - } - - public const int OrderBooksFieldNumber = 1; - private pbc::PopsicleList orderBooks_ = new pbc::PopsicleList(); - public scg::IList OrderBooksList { - get { return orderBooks_; } - } - public int OrderBooksCount { - get { return orderBooks_.Count; } - } - public global::bnet.protocol.exchange.OrderBookSummary GetOrderBooks(int index) { - return orderBooks_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::bnet.protocol.exchange.OrderBookSummary element in OrderBooksList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::bnet.protocol.exchange.OrderBookSummary element in OrderBooksList) { - output.WriteMessage(1, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::bnet.protocol.exchange.OrderBookSummary element in OrderBooksList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static QueryOrderBooksSummaryResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static QueryOrderBooksSummaryResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static QueryOrderBooksSummaryResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static QueryOrderBooksSummaryResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static QueryOrderBooksSummaryResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static QueryOrderBooksSummaryResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static QueryOrderBooksSummaryResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static QueryOrderBooksSummaryResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static QueryOrderBooksSummaryResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static QueryOrderBooksSummaryResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(QueryOrderBooksSummaryResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - QueryOrderBooksSummaryResponse result = new QueryOrderBooksSummaryResponse(); - - protected override QueryOrderBooksSummaryResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new QueryOrderBooksSummaryResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.QueryOrderBooksSummaryResponse.Descriptor; } - } - - public override QueryOrderBooksSummaryResponse DefaultInstanceForType { - get { return global::bnet.protocol.exchange.QueryOrderBooksSummaryResponse.DefaultInstance; } - } - - public override QueryOrderBooksSummaryResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.orderBooks_.MakeReadOnly(); - QueryOrderBooksSummaryResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is QueryOrderBooksSummaryResponse) { - return MergeFrom((QueryOrderBooksSummaryResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(QueryOrderBooksSummaryResponse other) { - if (other == global::bnet.protocol.exchange.QueryOrderBooksSummaryResponse.DefaultInstance) return this; - if (other.orderBooks_.Count != 0) { - base.AddRange(other.orderBooks_, result.orderBooks_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.OrderBookSummary.Builder subBuilder = global::bnet.protocol.exchange.OrderBookSummary.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddOrderBooks(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public pbc::IPopsicleList OrderBooksList { - get { return result.orderBooks_; } - } - public int OrderBooksCount { - get { return result.OrderBooksCount; } - } - public global::bnet.protocol.exchange.OrderBookSummary GetOrderBooks(int index) { - return result.GetOrderBooks(index); - } - public Builder SetOrderBooks(int index, global::bnet.protocol.exchange.OrderBookSummary value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.orderBooks_[index] = value; - return this; - } - public Builder SetOrderBooks(int index, global::bnet.protocol.exchange.OrderBookSummary.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.orderBooks_[index] = builderForValue.Build(); - return this; - } - public Builder AddOrderBooks(global::bnet.protocol.exchange.OrderBookSummary value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.orderBooks_.Add(value); - return this; - } - public Builder AddOrderBooks(global::bnet.protocol.exchange.OrderBookSummary.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.orderBooks_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeOrderBooks(scg::IEnumerable values) { - base.AddRange(values, result.orderBooks_); - return this; - } - public Builder ClearOrderBooks() { - result.orderBooks_.Clear(); - return this; - } - } - static QueryOrderBooksSummaryResponse() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class QuerySettlementsByOrderBookRequest : pb::GeneratedMessage { - private static readonly QuerySettlementsByOrderBookRequest defaultInstance = new Builder().BuildPartial(); - public static QuerySettlementsByOrderBookRequest DefaultInstance { - get { return defaultInstance; } - } - - public override QuerySettlementsByOrderBookRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override QuerySettlementsByOrderBookRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QuerySettlementsByOrderBookRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QuerySettlementsByOrderBookRequest__FieldAccessorTable; } - } - - public const int PartitionIdFieldNumber = 1; - private bool hasPartitionId; - private global::bnet.protocol.exchange.PartitionId partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - public bool HasPartitionId { - get { return hasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return partitionId_; } - } - - public const int FilterFieldNumber = 2; - private bool hasFilter; - private global::bnet.protocol.exchange.QueryFilterByOrderId filter_ = global::bnet.protocol.exchange.QueryFilterByOrderId.DefaultInstance; - public bool HasFilter { - get { return hasFilter; } - } - public global::bnet.protocol.exchange.QueryFilterByOrderId Filter { - get { return filter_; } - } - - public override bool IsInitialized { - get { - if (!hasPartitionId) return false; - if (!hasFilter) return false; - if (!PartitionId.IsInitialized) return false; - if (!Filter.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasPartitionId) { - output.WriteMessage(1, PartitionId); - } - if (HasFilter) { - output.WriteMessage(2, Filter); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasPartitionId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); - } - if (HasFilter) { - size += pb::CodedOutputStream.ComputeMessageSize(2, Filter); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static QuerySettlementsByOrderBookRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static QuerySettlementsByOrderBookRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static QuerySettlementsByOrderBookRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static QuerySettlementsByOrderBookRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static QuerySettlementsByOrderBookRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static QuerySettlementsByOrderBookRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static QuerySettlementsByOrderBookRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static QuerySettlementsByOrderBookRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static QuerySettlementsByOrderBookRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static QuerySettlementsByOrderBookRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(QuerySettlementsByOrderBookRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - QuerySettlementsByOrderBookRequest result = new QuerySettlementsByOrderBookRequest(); - - protected override QuerySettlementsByOrderBookRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new QuerySettlementsByOrderBookRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.QuerySettlementsByOrderBookRequest.Descriptor; } - } - - public override QuerySettlementsByOrderBookRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.QuerySettlementsByOrderBookRequest.DefaultInstance; } - } - - public override QuerySettlementsByOrderBookRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - QuerySettlementsByOrderBookRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is QuerySettlementsByOrderBookRequest) { - return MergeFrom((QuerySettlementsByOrderBookRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(QuerySettlementsByOrderBookRequest other) { - if (other == global::bnet.protocol.exchange.QuerySettlementsByOrderBookRequest.DefaultInstance) return this; - if (other.HasPartitionId) { - MergePartitionId(other.PartitionId); - } - if (other.HasFilter) { - MergeFilter(other.Filter); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { - subBuilder.MergeFrom(PartitionId); - } - input.ReadMessage(subBuilder, extensionRegistry); - PartitionId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.exchange.QueryFilterByOrderId.Builder subBuilder = global::bnet.protocol.exchange.QueryFilterByOrderId.CreateBuilder(); - if (HasFilter) { - subBuilder.MergeFrom(Filter); - } - input.ReadMessage(subBuilder, extensionRegistry); - Filter = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasPartitionId { - get { return result.HasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return result.PartitionId; } - set { SetPartitionId(value); } - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasPartitionId = true; - result.partitionId_ = value; - return this; - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasPartitionId = true; - result.partitionId_ = builderForValue.Build(); - return this; - } - public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasPartitionId && - result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); - } else { - result.partitionId_ = value; - } - result.hasPartitionId = true; - return this; - } - public Builder ClearPartitionId() { - result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - return this; - } - - public bool HasFilter { - get { return result.HasFilter; } - } - public global::bnet.protocol.exchange.QueryFilterByOrderId Filter { - get { return result.Filter; } - set { SetFilter(value); } - } - public Builder SetFilter(global::bnet.protocol.exchange.QueryFilterByOrderId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasFilter = true; - result.filter_ = value; - return this; - } - public Builder SetFilter(global::bnet.protocol.exchange.QueryFilterByOrderId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasFilter = true; - result.filter_ = builderForValue.Build(); - return this; - } - public Builder MergeFilter(global::bnet.protocol.exchange.QueryFilterByOrderId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasFilter && - result.filter_ != global::bnet.protocol.exchange.QueryFilterByOrderId.DefaultInstance) { - result.filter_ = global::bnet.protocol.exchange.QueryFilterByOrderId.CreateBuilder(result.filter_).MergeFrom(value).BuildPartial(); - } else { - result.filter_ = value; - } - result.hasFilter = true; - return this; - } - public Builder ClearFilter() { - result.hasFilter = false; - result.filter_ = global::bnet.protocol.exchange.QueryFilterByOrderId.DefaultInstance; - return this; - } - } - static QuerySettlementsByOrderBookRequest() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class QuerySettlementsByOrderBookResponse : pb::GeneratedMessage { - private static readonly QuerySettlementsByOrderBookResponse defaultInstance = new Builder().BuildPartial(); - public static QuerySettlementsByOrderBookResponse DefaultInstance { - get { return defaultInstance; } - } - - public override QuerySettlementsByOrderBookResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override QuerySettlementsByOrderBookResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QuerySettlementsByOrderBookResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QuerySettlementsByOrderBookResponse__FieldAccessorTable; } - } - - public const int SettlementsFieldNumber = 1; - private pbc::PopsicleList settlements_ = new pbc::PopsicleList(); - public scg::IList SettlementsList { - get { return settlements_; } - } - public int SettlementsCount { - get { return settlements_.Count; } - } - public global::bnet.protocol.exchange.Settlement GetSettlements(int index) { - return settlements_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::bnet.protocol.exchange.Settlement element in SettlementsList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::bnet.protocol.exchange.Settlement element in SettlementsList) { - output.WriteMessage(1, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::bnet.protocol.exchange.Settlement element in SettlementsList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static QuerySettlementsByOrderBookResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static QuerySettlementsByOrderBookResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static QuerySettlementsByOrderBookResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static QuerySettlementsByOrderBookResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static QuerySettlementsByOrderBookResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static QuerySettlementsByOrderBookResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static QuerySettlementsByOrderBookResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static QuerySettlementsByOrderBookResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static QuerySettlementsByOrderBookResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static QuerySettlementsByOrderBookResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(QuerySettlementsByOrderBookResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - QuerySettlementsByOrderBookResponse result = new QuerySettlementsByOrderBookResponse(); - - protected override QuerySettlementsByOrderBookResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new QuerySettlementsByOrderBookResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.QuerySettlementsByOrderBookResponse.Descriptor; } - } - - public override QuerySettlementsByOrderBookResponse DefaultInstanceForType { - get { return global::bnet.protocol.exchange.QuerySettlementsByOrderBookResponse.DefaultInstance; } - } - - public override QuerySettlementsByOrderBookResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.settlements_.MakeReadOnly(); - QuerySettlementsByOrderBookResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is QuerySettlementsByOrderBookResponse) { - return MergeFrom((QuerySettlementsByOrderBookResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(QuerySettlementsByOrderBookResponse other) { - if (other == global::bnet.protocol.exchange.QuerySettlementsByOrderBookResponse.DefaultInstance) return this; - if (other.settlements_.Count != 0) { - base.AddRange(other.settlements_, result.settlements_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.Settlement.Builder subBuilder = global::bnet.protocol.exchange.Settlement.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddSettlements(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public pbc::IPopsicleList SettlementsList { - get { return result.settlements_; } - } - public int SettlementsCount { - get { return result.SettlementsCount; } - } - public global::bnet.protocol.exchange.Settlement GetSettlements(int index) { - return result.GetSettlements(index); - } - public Builder SetSettlements(int index, global::bnet.protocol.exchange.Settlement value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.settlements_[index] = value; - return this; - } - public Builder SetSettlements(int index, global::bnet.protocol.exchange.Settlement.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.settlements_[index] = builderForValue.Build(); - return this; - } - public Builder AddSettlements(global::bnet.protocol.exchange.Settlement value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.settlements_.Add(value); - return this; - } - public Builder AddSettlements(global::bnet.protocol.exchange.Settlement.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.settlements_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeSettlements(scg::IEnumerable values) { - base.AddRange(values, result.settlements_); - return this; - } - public Builder ClearSettlements() { - result.settlements_.Clear(); - return this; - } - } - static QuerySettlementsByOrderBookResponse() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class SubscribeOrderBookStatusChangeRequest : pb::GeneratedMessage { - private static readonly SubscribeOrderBookStatusChangeRequest defaultInstance = new Builder().BuildPartial(); - public static SubscribeOrderBookStatusChangeRequest DefaultInstance { - get { return defaultInstance; } - } - - public override SubscribeOrderBookStatusChangeRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override SubscribeOrderBookStatusChangeRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_SubscribeOrderBookStatusChangeRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_SubscribeOrderBookStatusChangeRequest__FieldAccessorTable; } - } - - public const int ObjectIdFieldNumber = 1; - private bool hasObjectId; - private ulong objectId_ = 0UL; - public bool HasObjectId { - get { return hasObjectId; } - } - public ulong ObjectId { - get { return objectId_; } - } - - public const int MinPartitionIdFieldNumber = 2; - private bool hasMinPartitionId; - private global::bnet.protocol.exchange.PartitionId minPartitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - public bool HasMinPartitionId { - get { return hasMinPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId MinPartitionId { - get { return minPartitionId_; } - } - - public const int MaxPartitionIdFieldNumber = 3; - private bool hasMaxPartitionId; - private global::bnet.protocol.exchange.PartitionId maxPartitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - public bool HasMaxPartitionId { - get { return hasMaxPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId MaxPartitionId { - get { return maxPartitionId_; } - } - - public const int ProgramFieldNumber = 4; - private bool hasProgram; - private uint program_ = 0; - public bool HasProgram { - get { return hasProgram; } - } - public uint Program { - get { return program_; } - } - - public const int StatusFieldNumber = 5; - private bool hasStatus; - private int status_ = 0; - public bool HasStatus { - get { return hasStatus; } - } - public int Status { - get { return status_; } - } - - public const int CurrencyFieldNumber = 6; - private bool hasCurrency; - private string currency_ = ""; - public bool HasCurrency { - get { return hasCurrency; } - } - public string Currency { - get { return currency_; } - } - - public const int SpecialistFieldNumber = 7; - private bool hasSpecialist; - private int specialist_ = 0; - public bool HasSpecialist { - get { return hasSpecialist; } - } - public int Specialist { - get { return specialist_; } - } - - public const int BootstrapFieldNumber = 8; - private bool hasBootstrap; - private bool bootstrap_ = false; - public bool HasBootstrap { - get { return hasBootstrap; } - } - public bool Bootstrap { - get { return bootstrap_; } - } - - public override bool IsInitialized { - get { - if (!hasObjectId) return false; - if (!hasMinPartitionId) return false; - if (!hasMaxPartitionId) return false; - if (!hasProgram) return false; - if (!hasStatus) return false; - if (!MinPartitionId.IsInitialized) return false; - if (!MaxPartitionId.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasObjectId) { - output.WriteUInt64(1, ObjectId); - } - if (HasMinPartitionId) { - output.WriteMessage(2, MinPartitionId); - } - if (HasMaxPartitionId) { - output.WriteMessage(3, MaxPartitionId); - } - if (HasProgram) { - output.WriteFixed32(4, Program); - } - if (HasStatus) { - output.WriteInt32(5, Status); - } - if (HasCurrency) { - output.WriteString(6, Currency); - } - if (HasSpecialist) { - output.WriteInt32(7, Specialist); - } - if (HasBootstrap) { - output.WriteBool(8, Bootstrap); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasObjectId) { - size += pb::CodedOutputStream.ComputeUInt64Size(1, ObjectId); - } - if (HasMinPartitionId) { - size += pb::CodedOutputStream.ComputeMessageSize(2, MinPartitionId); - } - if (HasMaxPartitionId) { - size += pb::CodedOutputStream.ComputeMessageSize(3, MaxPartitionId); - } - if (HasProgram) { - size += pb::CodedOutputStream.ComputeFixed32Size(4, Program); - } - if (HasStatus) { - size += pb::CodedOutputStream.ComputeInt32Size(5, Status); - } - if (HasCurrency) { - size += pb::CodedOutputStream.ComputeStringSize(6, Currency); - } - if (HasSpecialist) { - size += pb::CodedOutputStream.ComputeInt32Size(7, Specialist); - } - if (HasBootstrap) { - size += pb::CodedOutputStream.ComputeBoolSize(8, Bootstrap); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static SubscribeOrderBookStatusChangeRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SubscribeOrderBookStatusChangeRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SubscribeOrderBookStatusChangeRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SubscribeOrderBookStatusChangeRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SubscribeOrderBookStatusChangeRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SubscribeOrderBookStatusChangeRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SubscribeOrderBookStatusChangeRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SubscribeOrderBookStatusChangeRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SubscribeOrderBookStatusChangeRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SubscribeOrderBookStatusChangeRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SubscribeOrderBookStatusChangeRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - SubscribeOrderBookStatusChangeRequest result = new SubscribeOrderBookStatusChangeRequest(); - - protected override SubscribeOrderBookStatusChangeRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new SubscribeOrderBookStatusChangeRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.SubscribeOrderBookStatusChangeRequest.Descriptor; } - } - - public override SubscribeOrderBookStatusChangeRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.SubscribeOrderBookStatusChangeRequest.DefaultInstance; } - } - - public override SubscribeOrderBookStatusChangeRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - SubscribeOrderBookStatusChangeRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SubscribeOrderBookStatusChangeRequest) { - return MergeFrom((SubscribeOrderBookStatusChangeRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SubscribeOrderBookStatusChangeRequest other) { - if (other == global::bnet.protocol.exchange.SubscribeOrderBookStatusChangeRequest.DefaultInstance) return this; - if (other.HasObjectId) { - ObjectId = other.ObjectId; - } - if (other.HasMinPartitionId) { - MergeMinPartitionId(other.MinPartitionId); - } - if (other.HasMaxPartitionId) { - MergeMaxPartitionId(other.MaxPartitionId); - } - if (other.HasProgram) { - Program = other.Program; - } - if (other.HasStatus) { - Status = other.Status; - } - if (other.HasCurrency) { - Currency = other.Currency; - } - if (other.HasSpecialist) { - Specialist = other.Specialist; - } - if (other.HasBootstrap) { - Bootstrap = other.Bootstrap; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - ObjectId = input.ReadUInt64(); - break; - } - case 18: { - global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasMinPartitionId) { - subBuilder.MergeFrom(MinPartitionId); - } - input.ReadMessage(subBuilder, extensionRegistry); - MinPartitionId = subBuilder.BuildPartial(); - break; - } - case 26: { - global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasMaxPartitionId) { - subBuilder.MergeFrom(MaxPartitionId); - } - input.ReadMessage(subBuilder, extensionRegistry); - MaxPartitionId = subBuilder.BuildPartial(); - break; - } - case 37: { - Program = input.ReadFixed32(); - break; - } - case 40: { - Status = input.ReadInt32(); - break; - } - case 50: { - Currency = input.ReadString(); - break; - } - case 56: { - Specialist = input.ReadInt32(); - break; - } - case 64: { - Bootstrap = input.ReadBool(); - break; - } - } - } - } - - - public bool HasObjectId { - get { return result.HasObjectId; } - } - public ulong ObjectId { - get { return result.ObjectId; } - set { SetObjectId(value); } - } - public Builder SetObjectId(ulong value) { - result.hasObjectId = true; - result.objectId_ = value; - return this; - } - public Builder ClearObjectId() { - result.hasObjectId = false; - result.objectId_ = 0UL; - return this; - } - - public bool HasMinPartitionId { - get { return result.HasMinPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId MinPartitionId { - get { return result.MinPartitionId; } - set { SetMinPartitionId(value); } - } - public Builder SetMinPartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasMinPartitionId = true; - result.minPartitionId_ = value; - return this; - } - public Builder SetMinPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasMinPartitionId = true; - result.minPartitionId_ = builderForValue.Build(); - return this; - } - public Builder MergeMinPartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasMinPartitionId && - result.minPartitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { - result.minPartitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.minPartitionId_).MergeFrom(value).BuildPartial(); - } else { - result.minPartitionId_ = value; - } - result.hasMinPartitionId = true; - return this; - } - public Builder ClearMinPartitionId() { - result.hasMinPartitionId = false; - result.minPartitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - return this; - } - - public bool HasMaxPartitionId { - get { return result.HasMaxPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId MaxPartitionId { - get { return result.MaxPartitionId; } - set { SetMaxPartitionId(value); } - } - public Builder SetMaxPartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasMaxPartitionId = true; - result.maxPartitionId_ = value; - return this; - } - public Builder SetMaxPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasMaxPartitionId = true; - result.maxPartitionId_ = builderForValue.Build(); - return this; - } - public Builder MergeMaxPartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasMaxPartitionId && - result.maxPartitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { - result.maxPartitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.maxPartitionId_).MergeFrom(value).BuildPartial(); - } else { - result.maxPartitionId_ = value; - } - result.hasMaxPartitionId = true; - return this; - } - public Builder ClearMaxPartitionId() { - result.hasMaxPartitionId = false; - result.maxPartitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - return this; - } - - public bool HasProgram { - get { return result.HasProgram; } - } - public uint Program { - get { return result.Program; } - set { SetProgram(value); } - } - public Builder SetProgram(uint value) { - result.hasProgram = true; - result.program_ = value; - return this; - } - public Builder ClearProgram() { - result.hasProgram = false; - result.program_ = 0; - return this; - } - - public bool HasStatus { - get { return result.HasStatus; } - } - public int Status { - get { return result.Status; } - set { SetStatus(value); } - } - public Builder SetStatus(int value) { - result.hasStatus = true; - result.status_ = value; - return this; - } - public Builder ClearStatus() { - result.hasStatus = false; - result.status_ = 0; - return this; - } - - public bool HasCurrency { - get { return result.HasCurrency; } - } - public string Currency { - get { return result.Currency; } - set { SetCurrency(value); } - } - public Builder SetCurrency(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasCurrency = true; - result.currency_ = value; - return this; - } - public Builder ClearCurrency() { - result.hasCurrency = false; - result.currency_ = ""; - return this; - } - - public bool HasSpecialist { - get { return result.HasSpecialist; } - } - public int Specialist { - get { return result.Specialist; } - set { SetSpecialist(value); } - } - public Builder SetSpecialist(int value) { - result.hasSpecialist = true; - result.specialist_ = value; - return this; - } - public Builder ClearSpecialist() { - result.hasSpecialist = false; - result.specialist_ = 0; - return this; - } - - public bool HasBootstrap { - get { return result.HasBootstrap; } - } - public bool Bootstrap { - get { return result.Bootstrap; } - set { SetBootstrap(value); } - } - public Builder SetBootstrap(bool value) { - result.hasBootstrap = true; - result.bootstrap_ = value; - return this; - } - public Builder ClearBootstrap() { - result.hasBootstrap = false; - result.bootstrap_ = false; - return this; - } - } - static SubscribeOrderBookStatusChangeRequest() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class UnsubscribeOrderBookStatusChangeRequest : pb::GeneratedMessage { - private static readonly UnsubscribeOrderBookStatusChangeRequest defaultInstance = new Builder().BuildPartial(); - public static UnsubscribeOrderBookStatusChangeRequest DefaultInstance { - get { return defaultInstance; } - } - - public override UnsubscribeOrderBookStatusChangeRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override UnsubscribeOrderBookStatusChangeRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_UnsubscribeOrderBookStatusChangeRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_UnsubscribeOrderBookStatusChangeRequest__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static UnsubscribeOrderBookStatusChangeRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static UnsubscribeOrderBookStatusChangeRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static UnsubscribeOrderBookStatusChangeRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static UnsubscribeOrderBookStatusChangeRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static UnsubscribeOrderBookStatusChangeRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static UnsubscribeOrderBookStatusChangeRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static UnsubscribeOrderBookStatusChangeRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static UnsubscribeOrderBookStatusChangeRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static UnsubscribeOrderBookStatusChangeRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static UnsubscribeOrderBookStatusChangeRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(UnsubscribeOrderBookStatusChangeRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - UnsubscribeOrderBookStatusChangeRequest result = new UnsubscribeOrderBookStatusChangeRequest(); - - protected override UnsubscribeOrderBookStatusChangeRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new UnsubscribeOrderBookStatusChangeRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.UnsubscribeOrderBookStatusChangeRequest.Descriptor; } - } - - public override UnsubscribeOrderBookStatusChangeRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.UnsubscribeOrderBookStatusChangeRequest.DefaultInstance; } - } - - public override UnsubscribeOrderBookStatusChangeRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - UnsubscribeOrderBookStatusChangeRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is UnsubscribeOrderBookStatusChangeRequest) { - return MergeFrom((UnsubscribeOrderBookStatusChangeRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(UnsubscribeOrderBookStatusChangeRequest other) { - if (other == global::bnet.protocol.exchange.UnsubscribeOrderBookStatusChangeRequest.DefaultInstance) return this; - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - } - } - } - - } - static UnsubscribeOrderBookStatusChangeRequest() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class SubscribeOrderStatusChangeRequest : pb::GeneratedMessage { - private static readonly SubscribeOrderStatusChangeRequest defaultInstance = new Builder().BuildPartial(); - public static SubscribeOrderStatusChangeRequest DefaultInstance { - get { return defaultInstance; } - } - - public override SubscribeOrderStatusChangeRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override SubscribeOrderStatusChangeRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_SubscribeOrderStatusChangeRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_SubscribeOrderStatusChangeRequest__FieldAccessorTable; } - } - - public const int AgentIdFieldNumber = 1; - private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasAgentId { - get { return hasAgentId; } - } - public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } - } - - public const int ObjectIdFieldNumber = 2; - private bool hasObjectId; - private ulong objectId_ = 0UL; - public bool HasObjectId { - get { return hasObjectId; } - } - public ulong ObjectId { - get { return objectId_; } - } - - public override bool IsInitialized { - get { - if (!hasAgentId) return false; - if (!hasObjectId) return false; - if (!AgentId.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasAgentId) { - output.WriteMessage(1, AgentId); - } - if (HasObjectId) { - output.WriteUInt64(2, ObjectId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasAgentId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); - } - if (HasObjectId) { - size += pb::CodedOutputStream.ComputeUInt64Size(2, ObjectId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static SubscribeOrderStatusChangeRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SubscribeOrderStatusChangeRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SubscribeOrderStatusChangeRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SubscribeOrderStatusChangeRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SubscribeOrderStatusChangeRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SubscribeOrderStatusChangeRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SubscribeOrderStatusChangeRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SubscribeOrderStatusChangeRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SubscribeOrderStatusChangeRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SubscribeOrderStatusChangeRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SubscribeOrderStatusChangeRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - SubscribeOrderStatusChangeRequest result = new SubscribeOrderStatusChangeRequest(); - - protected override SubscribeOrderStatusChangeRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new SubscribeOrderStatusChangeRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.SubscribeOrderStatusChangeRequest.Descriptor; } - } - - public override SubscribeOrderStatusChangeRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.SubscribeOrderStatusChangeRequest.DefaultInstance; } - } - - public override SubscribeOrderStatusChangeRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - SubscribeOrderStatusChangeRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SubscribeOrderStatusChangeRequest) { - return MergeFrom((SubscribeOrderStatusChangeRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SubscribeOrderStatusChangeRequest other) { - if (other == global::bnet.protocol.exchange.SubscribeOrderStatusChangeRequest.DefaultInstance) return this; - if (other.HasAgentId) { - MergeAgentId(other.AgentId); - } - if (other.HasObjectId) { - ObjectId = other.ObjectId; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { - subBuilder.MergeFrom(AgentId); - } - input.ReadMessage(subBuilder, extensionRegistry); - AgentId = subBuilder.BuildPartial(); - break; - } - case 16: { - ObjectId = input.ReadUInt64(); - break; - } - } - } - } - - - public bool HasAgentId { - get { return result.HasAgentId; } - } - public global::bnet.protocol.EntityId AgentId { - get { return result.AgentId; } - set { SetAgentId(value); } - } - public Builder SetAgentId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasAgentId = true; - result.agentId_ = value; - return this; - } - public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasAgentId = true; - result.agentId_ = builderForValue.Build(); - return this; - } - public Builder MergeAgentId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && - result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); - } else { - result.agentId_ = value; - } - result.hasAgentId = true; - return this; - } - public Builder ClearAgentId() { - result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasObjectId { - get { return result.HasObjectId; } - } - public ulong ObjectId { - get { return result.ObjectId; } - set { SetObjectId(value); } - } - public Builder SetObjectId(ulong value) { - result.hasObjectId = true; - result.objectId_ = value; - return this; - } - public Builder ClearObjectId() { - result.hasObjectId = false; - result.objectId_ = 0UL; - return this; - } - } - static SubscribeOrderStatusChangeRequest() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class UnsubscribeOrderStatusChangeRequest : pb::GeneratedMessage { - private static readonly UnsubscribeOrderStatusChangeRequest defaultInstance = new Builder().BuildPartial(); - public static UnsubscribeOrderStatusChangeRequest DefaultInstance { - get { return defaultInstance; } - } - - public override UnsubscribeOrderStatusChangeRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override UnsubscribeOrderStatusChangeRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_UnsubscribeOrderStatusChangeRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_UnsubscribeOrderStatusChangeRequest__FieldAccessorTable; } - } - - public const int AgentIdFieldNumber = 1; - private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasAgentId { - get { return hasAgentId; } - } - public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } - } - - public const int ObjectIdFieldNumber = 2; - private bool hasObjectId; - private ulong objectId_ = 0UL; - public bool HasObjectId { - get { return hasObjectId; } - } - public ulong ObjectId { - get { return objectId_; } - } - - public override bool IsInitialized { - get { - if (!hasAgentId) return false; - if (!hasObjectId) return false; - if (!AgentId.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasAgentId) { - output.WriteMessage(1, AgentId); - } - if (HasObjectId) { - output.WriteUInt64(2, ObjectId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasAgentId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); - } - if (HasObjectId) { - size += pb::CodedOutputStream.ComputeUInt64Size(2, ObjectId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static UnsubscribeOrderStatusChangeRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static UnsubscribeOrderStatusChangeRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static UnsubscribeOrderStatusChangeRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static UnsubscribeOrderStatusChangeRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static UnsubscribeOrderStatusChangeRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static UnsubscribeOrderStatusChangeRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static UnsubscribeOrderStatusChangeRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static UnsubscribeOrderStatusChangeRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static UnsubscribeOrderStatusChangeRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static UnsubscribeOrderStatusChangeRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(UnsubscribeOrderStatusChangeRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - UnsubscribeOrderStatusChangeRequest result = new UnsubscribeOrderStatusChangeRequest(); - - protected override UnsubscribeOrderStatusChangeRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new UnsubscribeOrderStatusChangeRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.UnsubscribeOrderStatusChangeRequest.Descriptor; } - } - - public override UnsubscribeOrderStatusChangeRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.UnsubscribeOrderStatusChangeRequest.DefaultInstance; } - } - - public override UnsubscribeOrderStatusChangeRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - UnsubscribeOrderStatusChangeRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is UnsubscribeOrderStatusChangeRequest) { - return MergeFrom((UnsubscribeOrderStatusChangeRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(UnsubscribeOrderStatusChangeRequest other) { - if (other == global::bnet.protocol.exchange.UnsubscribeOrderStatusChangeRequest.DefaultInstance) return this; - if (other.HasAgentId) { - MergeAgentId(other.AgentId); - } - if (other.HasObjectId) { - ObjectId = other.ObjectId; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { - subBuilder.MergeFrom(AgentId); - } - input.ReadMessage(subBuilder, extensionRegistry); - AgentId = subBuilder.BuildPartial(); - break; - } - case 16: { - ObjectId = input.ReadUInt64(); - break; - } - } - } - } - - - public bool HasAgentId { - get { return result.HasAgentId; } - } - public global::bnet.protocol.EntityId AgentId { - get { return result.AgentId; } - set { SetAgentId(value); } - } - public Builder SetAgentId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasAgentId = true; - result.agentId_ = value; - return this; - } - public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasAgentId = true; - result.agentId_ = builderForValue.Build(); - return this; - } - public Builder MergeAgentId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && - result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); - } else { - result.agentId_ = value; - } - result.hasAgentId = true; - return this; - } - public Builder ClearAgentId() { - result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasObjectId { - get { return result.HasObjectId; } - } - public ulong ObjectId { - get { return result.ObjectId; } - set { SetObjectId(value); } - } - public Builder SetObjectId(ulong value) { - result.hasObjectId = true; - result.objectId_ = value; - return this; - } - public Builder ClearObjectId() { - result.hasObjectId = false; - result.objectId_ = 0UL; - return this; - } - } - static UnsubscribeOrderStatusChangeRequest() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class ClaimRequest : pb::GeneratedMessage { - private static readonly ClaimRequest defaultInstance = new Builder().BuildPartial(); - public static ClaimRequest DefaultInstance { - get { return defaultInstance; } - } - - public override ClaimRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ClaimRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_ClaimRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_ClaimRequest__FieldAccessorTable; } - } - - public const int PartitionIdFieldNumber = 1; - private bool hasPartitionId; - private global::bnet.protocol.exchange.PartitionId partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - public bool HasPartitionId { - get { return hasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return partitionId_; } - } - - public const int OrderIdFieldNumber = 2; - private bool hasOrderId; - private uint orderId_ = 0; - public bool HasOrderId { - get { return hasOrderId; } - } - public uint OrderId { - get { return orderId_; } - } - - public const int BnetAccountFieldNumber = 3; - private bool hasBnetAccount; - private global::bnet.protocol.EntityId bnetAccount_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasBnetAccount { - get { return hasBnetAccount; } - } - public global::bnet.protocol.EntityId BnetAccount { - get { return bnetAccount_; } - } - - public override bool IsInitialized { - get { - if (!hasPartitionId) return false; - if (!hasOrderId) return false; - if (!PartitionId.IsInitialized) return false; - if (HasBnetAccount) { - if (!BnetAccount.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasPartitionId) { - output.WriteMessage(1, PartitionId); - } - if (HasOrderId) { - output.WriteUInt32(2, OrderId); - } - if (HasBnetAccount) { - output.WriteMessage(3, BnetAccount); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasPartitionId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); - } - if (HasOrderId) { - size += pb::CodedOutputStream.ComputeUInt32Size(2, OrderId); - } - if (HasBnetAccount) { - size += pb::CodedOutputStream.ComputeMessageSize(3, BnetAccount); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ClaimRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ClaimRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ClaimRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ClaimRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ClaimRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ClaimRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ClaimRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ClaimRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ClaimRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ClaimRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ClaimRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ClaimRequest result = new ClaimRequest(); - - protected override ClaimRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ClaimRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.ClaimRequest.Descriptor; } - } - - public override ClaimRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.ClaimRequest.DefaultInstance; } - } - - public override ClaimRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - ClaimRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ClaimRequest) { - return MergeFrom((ClaimRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ClaimRequest other) { - if (other == global::bnet.protocol.exchange.ClaimRequest.DefaultInstance) return this; - if (other.HasPartitionId) { - MergePartitionId(other.PartitionId); - } - if (other.HasOrderId) { - OrderId = other.OrderId; - } - if (other.HasBnetAccount) { - MergeBnetAccount(other.BnetAccount); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { - subBuilder.MergeFrom(PartitionId); - } - input.ReadMessage(subBuilder, extensionRegistry); - PartitionId = subBuilder.BuildPartial(); - break; - } - case 16: { - OrderId = input.ReadUInt32(); - break; - } - case 26: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasBnetAccount) { - subBuilder.MergeFrom(BnetAccount); - } - input.ReadMessage(subBuilder, extensionRegistry); - BnetAccount = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasPartitionId { - get { return result.HasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return result.PartitionId; } - set { SetPartitionId(value); } - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasPartitionId = true; - result.partitionId_ = value; - return this; - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasPartitionId = true; - result.partitionId_ = builderForValue.Build(); - return this; - } - public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasPartitionId && - result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); - } else { - result.partitionId_ = value; - } - result.hasPartitionId = true; - return this; - } - public Builder ClearPartitionId() { - result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - return this; - } - - public bool HasOrderId { - get { return result.HasOrderId; } - } - public uint OrderId { - get { return result.OrderId; } - set { SetOrderId(value); } - } - public Builder SetOrderId(uint value) { - result.hasOrderId = true; - result.orderId_ = value; - return this; - } - public Builder ClearOrderId() { - result.hasOrderId = false; - result.orderId_ = 0; - return this; - } - - public bool HasBnetAccount { - get { return result.HasBnetAccount; } - } - public global::bnet.protocol.EntityId BnetAccount { - get { return result.BnetAccount; } - set { SetBnetAccount(value); } - } - public Builder SetBnetAccount(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBnetAccount = true; - result.bnetAccount_ = value; - return this; - } - public Builder SetBnetAccount(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBnetAccount = true; - result.bnetAccount_ = builderForValue.Build(); - return this; - } - public Builder MergeBnetAccount(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasBnetAccount && - result.bnetAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.bnetAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccount_).MergeFrom(value).BuildPartial(); - } else { - result.bnetAccount_ = value; - } - result.hasBnetAccount = true; - return this; - } - public Builder ClearBnetAccount() { - result.hasBnetAccount = false; - result.bnetAccount_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - } - static ClaimRequest() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class CancelRequest : pb::GeneratedMessage { - private static readonly CancelRequest defaultInstance = new Builder().BuildPartial(); - public static CancelRequest DefaultInstance { - get { return defaultInstance; } - } - - public override CancelRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override CancelRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_CancelRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_CancelRequest__FieldAccessorTable; } - } - - public const int PartitionIdFieldNumber = 1; - private bool hasPartitionId; - private global::bnet.protocol.exchange.PartitionId partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - public bool HasPartitionId { - get { return hasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return partitionId_; } - } - - public const int OrderIdFieldNumber = 2; - private bool hasOrderId; - private uint orderId_ = 0; - public bool HasOrderId { - get { return hasOrderId; } - } - public uint OrderId { - get { return orderId_; } - } - - public const int ReasonFieldNumber = 3; - private bool hasReason; - private uint reason_ = 0; - public bool HasReason { - get { return hasReason; } - } - public uint Reason { - get { return reason_; } - } - - public const int BnetAccountFieldNumber = 4; - private bool hasBnetAccount; - private global::bnet.protocol.EntityId bnetAccount_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasBnetAccount { - get { return hasBnetAccount; } - } - public global::bnet.protocol.EntityId BnetAccount { - get { return bnetAccount_; } - } - - public override bool IsInitialized { - get { - if (!hasPartitionId) return false; - if (!hasOrderId) return false; - if (!PartitionId.IsInitialized) return false; - if (HasBnetAccount) { - if (!BnetAccount.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasPartitionId) { - output.WriteMessage(1, PartitionId); - } - if (HasOrderId) { - output.WriteUInt32(2, OrderId); - } - if (HasReason) { - output.WriteUInt32(3, Reason); - } - if (HasBnetAccount) { - output.WriteMessage(4, BnetAccount); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasPartitionId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); - } - if (HasOrderId) { - size += pb::CodedOutputStream.ComputeUInt32Size(2, OrderId); - } - if (HasReason) { - size += pb::CodedOutputStream.ComputeUInt32Size(3, Reason); - } - if (HasBnetAccount) { - size += pb::CodedOutputStream.ComputeMessageSize(4, BnetAccount); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static CancelRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CancelRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CancelRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CancelRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CancelRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CancelRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CancelRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CancelRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CancelRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CancelRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CancelRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - CancelRequest result = new CancelRequest(); - - protected override CancelRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new CancelRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.CancelRequest.Descriptor; } - } - - public override CancelRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.CancelRequest.DefaultInstance; } - } - - public override CancelRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - CancelRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CancelRequest) { - return MergeFrom((CancelRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CancelRequest other) { - if (other == global::bnet.protocol.exchange.CancelRequest.DefaultInstance) return this; - if (other.HasPartitionId) { - MergePartitionId(other.PartitionId); - } - if (other.HasOrderId) { - OrderId = other.OrderId; - } - if (other.HasReason) { - Reason = other.Reason; - } - if (other.HasBnetAccount) { - MergeBnetAccount(other.BnetAccount); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { - subBuilder.MergeFrom(PartitionId); - } - input.ReadMessage(subBuilder, extensionRegistry); - PartitionId = subBuilder.BuildPartial(); - break; - } - case 16: { - OrderId = input.ReadUInt32(); - break; - } - case 24: { - Reason = input.ReadUInt32(); - break; - } - case 34: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasBnetAccount) { - subBuilder.MergeFrom(BnetAccount); - } - input.ReadMessage(subBuilder, extensionRegistry); - BnetAccount = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasPartitionId { - get { return result.HasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return result.PartitionId; } - set { SetPartitionId(value); } - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasPartitionId = true; - result.partitionId_ = value; - return this; - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasPartitionId = true; - result.partitionId_ = builderForValue.Build(); - return this; - } - public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasPartitionId && - result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); - } else { - result.partitionId_ = value; - } - result.hasPartitionId = true; - return this; - } - public Builder ClearPartitionId() { - result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - return this; - } - - public bool HasOrderId { - get { return result.HasOrderId; } - } - public uint OrderId { - get { return result.OrderId; } - set { SetOrderId(value); } - } - public Builder SetOrderId(uint value) { - result.hasOrderId = true; - result.orderId_ = value; - return this; - } - public Builder ClearOrderId() { - result.hasOrderId = false; - result.orderId_ = 0; - return this; - } - - public bool HasReason { - get { return result.HasReason; } - } - public uint Reason { - get { return result.Reason; } - set { SetReason(value); } - } - public Builder SetReason(uint value) { - result.hasReason = true; - result.reason_ = value; - return this; - } - public Builder ClearReason() { - result.hasReason = false; - result.reason_ = 0; - return this; - } - - public bool HasBnetAccount { - get { return result.HasBnetAccount; } - } - public global::bnet.protocol.EntityId BnetAccount { - get { return result.BnetAccount; } - set { SetBnetAccount(value); } - } - public Builder SetBnetAccount(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBnetAccount = true; - result.bnetAccount_ = value; - return this; - } - public Builder SetBnetAccount(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBnetAccount = true; - result.bnetAccount_ = builderForValue.Build(); - return this; - } - public Builder MergeBnetAccount(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasBnetAccount && - result.bnetAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.bnetAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccount_).MergeFrom(value).BuildPartial(); - } else { - result.bnetAccount_ = value; - } - result.hasBnetAccount = true; - return this; - } - public Builder ClearBnetAccount() { - result.hasBnetAccount = false; - result.bnetAccount_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - } - static CancelRequest() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class GetConfigurationRequest : pb::GeneratedMessage { - private static readonly GetConfigurationRequest defaultInstance = new Builder().BuildPartial(); - public static GetConfigurationRequest DefaultInstance { - get { return defaultInstance; } - } - - public override GetConfigurationRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override GetConfigurationRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetConfigurationRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetConfigurationRequest__FieldAccessorTable; } - } - - public const int ProgramFieldNumber = 1; - private bool hasProgram; - private uint program_ = 0; - public bool HasProgram { - get { return hasProgram; } - } - public uint Program { - get { return program_; } - } - - public override bool IsInitialized { - get { - if (!hasProgram) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasProgram) { - output.WriteFixed32(1, Program); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasProgram) { - size += pb::CodedOutputStream.ComputeFixed32Size(1, Program); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static GetConfigurationRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static GetConfigurationRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static GetConfigurationRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static GetConfigurationRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static GetConfigurationRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static GetConfigurationRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static GetConfigurationRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static GetConfigurationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static GetConfigurationRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static GetConfigurationRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(GetConfigurationRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - GetConfigurationRequest result = new GetConfigurationRequest(); - - protected override GetConfigurationRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new GetConfigurationRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.GetConfigurationRequest.Descriptor; } - } - - public override GetConfigurationRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.GetConfigurationRequest.DefaultInstance; } - } - - public override GetConfigurationRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - GetConfigurationRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is GetConfigurationRequest) { - return MergeFrom((GetConfigurationRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(GetConfigurationRequest other) { - if (other == global::bnet.protocol.exchange.GetConfigurationRequest.DefaultInstance) return this; - if (other.HasProgram) { - Program = other.Program; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 13: { - Program = input.ReadFixed32(); - break; - } - } - } - } - - - public bool HasProgram { - get { return result.HasProgram; } - } - public uint Program { - get { return result.Program; } - set { SetProgram(value); } - } - public Builder SetProgram(uint value) { - result.hasProgram = true; - result.program_ = value; - return this; - } - public Builder ClearProgram() { - result.hasProgram = false; - result.program_ = 0; - return this; - } - } - static GetConfigurationRequest() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class GetConfigurationResponse : pb::GeneratedMessage { - private static readonly GetConfigurationResponse defaultInstance = new Builder().BuildPartial(); - public static GetConfigurationResponse DefaultInstance { - get { return defaultInstance; } - } - - public override GetConfigurationResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override GetConfigurationResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetConfigurationResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetConfigurationResponse__FieldAccessorTable; } - } - - public const int ConfigsFieldNumber = 1; - private pbc::PopsicleList configs_ = new pbc::PopsicleList(); - public scg::IList ConfigsList { - get { return configs_; } - } - public int ConfigsCount { - get { return configs_.Count; } - } - public global::bnet.protocol.exchange.SpecialistConfig GetConfigs(int index) { - return configs_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::bnet.protocol.exchange.SpecialistConfig element in ConfigsList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::bnet.protocol.exchange.SpecialistConfig element in ConfigsList) { - output.WriteMessage(1, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::bnet.protocol.exchange.SpecialistConfig element in ConfigsList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static GetConfigurationResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static GetConfigurationResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static GetConfigurationResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static GetConfigurationResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static GetConfigurationResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static GetConfigurationResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static GetConfigurationResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static GetConfigurationResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static GetConfigurationResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static GetConfigurationResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(GetConfigurationResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - GetConfigurationResponse result = new GetConfigurationResponse(); - - protected override GetConfigurationResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new GetConfigurationResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.GetConfigurationResponse.Descriptor; } - } - - public override GetConfigurationResponse DefaultInstanceForType { - get { return global::bnet.protocol.exchange.GetConfigurationResponse.DefaultInstance; } - } - - public override GetConfigurationResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.configs_.MakeReadOnly(); - GetConfigurationResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is GetConfigurationResponse) { - return MergeFrom((GetConfigurationResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(GetConfigurationResponse other) { - if (other == global::bnet.protocol.exchange.GetConfigurationResponse.DefaultInstance) return this; - if (other.configs_.Count != 0) { - base.AddRange(other.configs_, result.configs_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.SpecialistConfig.Builder subBuilder = global::bnet.protocol.exchange.SpecialistConfig.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddConfigs(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public pbc::IPopsicleList ConfigsList { - get { return result.configs_; } - } - public int ConfigsCount { - get { return result.ConfigsCount; } - } - public global::bnet.protocol.exchange.SpecialistConfig GetConfigs(int index) { - return result.GetConfigs(index); - } - public Builder SetConfigs(int index, global::bnet.protocol.exchange.SpecialistConfig value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.configs_[index] = value; - return this; - } - public Builder SetConfigs(int index, global::bnet.protocol.exchange.SpecialistConfig.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.configs_[index] = builderForValue.Build(); - return this; - } - public Builder AddConfigs(global::bnet.protocol.exchange.SpecialistConfig value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.configs_.Add(value); - return this; - } - public Builder AddConfigs(global::bnet.protocol.exchange.SpecialistConfig.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.configs_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeConfigs(scg::IEnumerable values) { - base.AddRange(values, result.configs_); - return this; - } - public Builder ClearConfigs() { - result.configs_.Clear(); - return this; - } - } - static GetConfigurationResponse() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class GetOfferFeeEstimationRequest : pb::GeneratedMessage { - private static readonly GetOfferFeeEstimationRequest defaultInstance = new Builder().BuildPartial(); - public static GetOfferFeeEstimationRequest DefaultInstance { - get { return defaultInstance; } - } - - public override GetOfferFeeEstimationRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override GetOfferFeeEstimationRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetOfferFeeEstimationRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetOfferFeeEstimationRequest__FieldAccessorTable; } - } - - public const int PartitionIdFieldNumber = 1; - private bool hasPartitionId; - private global::bnet.protocol.exchange.PartitionId partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - public bool HasPartitionId { - get { return hasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return partitionId_; } - } - - public const int DataFieldNumber = 2; - private bool hasData; - private global::bnet.protocol.exchange.FeeEstimationData data_ = global::bnet.protocol.exchange.FeeEstimationData.DefaultInstance; - public bool HasData { - get { return hasData; } - } - public global::bnet.protocol.exchange.FeeEstimationData Data { - get { return data_; } - } - - public override bool IsInitialized { - get { - if (!hasPartitionId) return false; - if (!hasData) return false; - if (!PartitionId.IsInitialized) return false; - if (!Data.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasPartitionId) { - output.WriteMessage(1, PartitionId); - } - if (HasData) { - output.WriteMessage(2, Data); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasPartitionId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); - } - if (HasData) { - size += pb::CodedOutputStream.ComputeMessageSize(2, Data); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static GetOfferFeeEstimationRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static GetOfferFeeEstimationRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static GetOfferFeeEstimationRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static GetOfferFeeEstimationRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static GetOfferFeeEstimationRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static GetOfferFeeEstimationRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static GetOfferFeeEstimationRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static GetOfferFeeEstimationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static GetOfferFeeEstimationRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static GetOfferFeeEstimationRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(GetOfferFeeEstimationRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - GetOfferFeeEstimationRequest result = new GetOfferFeeEstimationRequest(); - - protected override GetOfferFeeEstimationRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new GetOfferFeeEstimationRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.GetOfferFeeEstimationRequest.Descriptor; } - } - - public override GetOfferFeeEstimationRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.GetOfferFeeEstimationRequest.DefaultInstance; } - } - - public override GetOfferFeeEstimationRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - GetOfferFeeEstimationRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is GetOfferFeeEstimationRequest) { - return MergeFrom((GetOfferFeeEstimationRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(GetOfferFeeEstimationRequest other) { - if (other == global::bnet.protocol.exchange.GetOfferFeeEstimationRequest.DefaultInstance) return this; - if (other.HasPartitionId) { - MergePartitionId(other.PartitionId); - } - if (other.HasData) { - MergeData(other.Data); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { - subBuilder.MergeFrom(PartitionId); - } - input.ReadMessage(subBuilder, extensionRegistry); - PartitionId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.exchange.FeeEstimationData.Builder subBuilder = global::bnet.protocol.exchange.FeeEstimationData.CreateBuilder(); - if (HasData) { - subBuilder.MergeFrom(Data); - } - input.ReadMessage(subBuilder, extensionRegistry); - Data = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasPartitionId { - get { return result.HasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return result.PartitionId; } - set { SetPartitionId(value); } - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasPartitionId = true; - result.partitionId_ = value; - return this; - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasPartitionId = true; - result.partitionId_ = builderForValue.Build(); - return this; - } - public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasPartitionId && - result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); - } else { - result.partitionId_ = value; - } - result.hasPartitionId = true; - return this; - } - public Builder ClearPartitionId() { - result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - return this; - } - - public bool HasData { - get { return result.HasData; } - } - public global::bnet.protocol.exchange.FeeEstimationData Data { - get { return result.Data; } - set { SetData(value); } - } - public Builder SetData(global::bnet.protocol.exchange.FeeEstimationData value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasData = true; - result.data_ = value; - return this; - } - public Builder SetData(global::bnet.protocol.exchange.FeeEstimationData.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasData = true; - result.data_ = builderForValue.Build(); - return this; - } - public Builder MergeData(global::bnet.protocol.exchange.FeeEstimationData value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasData && - result.data_ != global::bnet.protocol.exchange.FeeEstimationData.DefaultInstance) { - result.data_ = global::bnet.protocol.exchange.FeeEstimationData.CreateBuilder(result.data_).MergeFrom(value).BuildPartial(); - } else { - result.data_ = value; - } - result.hasData = true; - return this; - } - public Builder ClearData() { - result.hasData = false; - result.data_ = global::bnet.protocol.exchange.FeeEstimationData.DefaultInstance; - return this; - } - } - static GetOfferFeeEstimationRequest() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class GetBidFeeEstimationRequest : pb::GeneratedMessage { - private static readonly GetBidFeeEstimationRequest defaultInstance = new Builder().BuildPartial(); - public static GetBidFeeEstimationRequest DefaultInstance { - get { return defaultInstance; } - } - - public override GetBidFeeEstimationRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override GetBidFeeEstimationRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetBidFeeEstimationRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetBidFeeEstimationRequest__FieldAccessorTable; } - } - - public const int PartitionIdFieldNumber = 1; - private bool hasPartitionId; - private global::bnet.protocol.exchange.PartitionId partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - public bool HasPartitionId { - get { return hasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return partitionId_; } - } - - public const int DataFieldNumber = 2; - private bool hasData; - private global::bnet.protocol.exchange.FeeEstimationData data_ = global::bnet.protocol.exchange.FeeEstimationData.DefaultInstance; - public bool HasData { - get { return hasData; } - } - public global::bnet.protocol.exchange.FeeEstimationData Data { - get { return data_; } - } - - public override bool IsInitialized { - get { - if (!hasPartitionId) return false; - if (!hasData) return false; - if (!PartitionId.IsInitialized) return false; - if (!Data.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasPartitionId) { - output.WriteMessage(1, PartitionId); - } - if (HasData) { - output.WriteMessage(2, Data); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasPartitionId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); - } - if (HasData) { - size += pb::CodedOutputStream.ComputeMessageSize(2, Data); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static GetBidFeeEstimationRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static GetBidFeeEstimationRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static GetBidFeeEstimationRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static GetBidFeeEstimationRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static GetBidFeeEstimationRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static GetBidFeeEstimationRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static GetBidFeeEstimationRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static GetBidFeeEstimationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static GetBidFeeEstimationRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static GetBidFeeEstimationRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(GetBidFeeEstimationRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - GetBidFeeEstimationRequest result = new GetBidFeeEstimationRequest(); - - protected override GetBidFeeEstimationRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new GetBidFeeEstimationRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.GetBidFeeEstimationRequest.Descriptor; } - } - - public override GetBidFeeEstimationRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.GetBidFeeEstimationRequest.DefaultInstance; } - } - - public override GetBidFeeEstimationRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - GetBidFeeEstimationRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is GetBidFeeEstimationRequest) { - return MergeFrom((GetBidFeeEstimationRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(GetBidFeeEstimationRequest other) { - if (other == global::bnet.protocol.exchange.GetBidFeeEstimationRequest.DefaultInstance) return this; - if (other.HasPartitionId) { - MergePartitionId(other.PartitionId); - } - if (other.HasData) { - MergeData(other.Data); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { - subBuilder.MergeFrom(PartitionId); - } - input.ReadMessage(subBuilder, extensionRegistry); - PartitionId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.exchange.FeeEstimationData.Builder subBuilder = global::bnet.protocol.exchange.FeeEstimationData.CreateBuilder(); - if (HasData) { - subBuilder.MergeFrom(Data); - } - input.ReadMessage(subBuilder, extensionRegistry); - Data = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasPartitionId { - get { return result.HasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return result.PartitionId; } - set { SetPartitionId(value); } - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasPartitionId = true; - result.partitionId_ = value; - return this; - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasPartitionId = true; - result.partitionId_ = builderForValue.Build(); - return this; - } - public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasPartitionId && - result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); - } else { - result.partitionId_ = value; - } - result.hasPartitionId = true; - return this; - } - public Builder ClearPartitionId() { - result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - return this; - } - - public bool HasData { - get { return result.HasData; } - } - public global::bnet.protocol.exchange.FeeEstimationData Data { - get { return result.Data; } - set { SetData(value); } - } - public Builder SetData(global::bnet.protocol.exchange.FeeEstimationData value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasData = true; - result.data_ = value; - return this; - } - public Builder SetData(global::bnet.protocol.exchange.FeeEstimationData.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasData = true; - result.data_ = builderForValue.Build(); - return this; - } - public Builder MergeData(global::bnet.protocol.exchange.FeeEstimationData value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasData && - result.data_ != global::bnet.protocol.exchange.FeeEstimationData.DefaultInstance) { - result.data_ = global::bnet.protocol.exchange.FeeEstimationData.CreateBuilder(result.data_).MergeFrom(value).BuildPartial(); - } else { - result.data_ = value; - } - result.hasData = true; - return this; - } - public Builder ClearData() { - result.hasData = false; - result.data_ = global::bnet.protocol.exchange.FeeEstimationData.DefaultInstance; - return this; - } - } - static GetBidFeeEstimationRequest() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class GetFeeEstimationResponse : pb::GeneratedMessage { - private static readonly GetFeeEstimationResponse defaultInstance = new Builder().BuildPartial(); - public static GetFeeEstimationResponse DefaultInstance { - get { return defaultInstance; } - } - - public override GetFeeEstimationResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override GetFeeEstimationResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetFeeEstimationResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetFeeEstimationResponse__FieldAccessorTable; } - } - - public const int FeeAmountFieldNumber = 1; - private bool hasFeeAmount; - private ulong feeAmount_ = 0UL; - public bool HasFeeAmount { - get { return hasFeeAmount; } - } - public ulong FeeAmount { - get { return feeAmount_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasFeeAmount) { - output.WriteUInt64(1, FeeAmount); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasFeeAmount) { - size += pb::CodedOutputStream.ComputeUInt64Size(1, FeeAmount); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static GetFeeEstimationResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static GetFeeEstimationResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static GetFeeEstimationResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static GetFeeEstimationResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static GetFeeEstimationResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static GetFeeEstimationResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static GetFeeEstimationResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static GetFeeEstimationResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static GetFeeEstimationResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static GetFeeEstimationResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(GetFeeEstimationResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - GetFeeEstimationResponse result = new GetFeeEstimationResponse(); - - protected override GetFeeEstimationResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new GetFeeEstimationResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.GetFeeEstimationResponse.Descriptor; } - } - - public override GetFeeEstimationResponse DefaultInstanceForType { - get { return global::bnet.protocol.exchange.GetFeeEstimationResponse.DefaultInstance; } - } - - public override GetFeeEstimationResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - GetFeeEstimationResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is GetFeeEstimationResponse) { - return MergeFrom((GetFeeEstimationResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(GetFeeEstimationResponse other) { - if (other == global::bnet.protocol.exchange.GetFeeEstimationResponse.DefaultInstance) return this; - if (other.HasFeeAmount) { - FeeAmount = other.FeeAmount; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - FeeAmount = input.ReadUInt64(); - break; - } - } - } - } - - - public bool HasFeeAmount { - get { return result.HasFeeAmount; } - } - public ulong FeeAmount { - get { return result.FeeAmount; } - set { SetFeeAmount(value); } - } - public Builder SetFeeAmount(ulong value) { - result.hasFeeAmount = true; - result.feeAmount_ = value; - return this; - } - public Builder ClearFeeAmount() { - result.hasFeeAmount = false; - result.feeAmount_ = 0UL; - return this; - } - } - static GetFeeEstimationResponse() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class OrderBookNotificationRequest : pb::GeneratedMessage { - private static readonly OrderBookNotificationRequest defaultInstance = new Builder().BuildPartial(); - public static OrderBookNotificationRequest DefaultInstance { - get { return defaultInstance; } - } - - public override OrderBookNotificationRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override OrderBookNotificationRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_OrderBookNotificationRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_OrderBookNotificationRequest__FieldAccessorTable; } - } - - public const int NotificationsFieldNumber = 1; - private pbc::PopsicleList notifications_ = new pbc::PopsicleList(); - public scg::IList NotificationsList { - get { return notifications_; } - } - public int NotificationsCount { - get { return notifications_.Count; } - } - public global::bnet.protocol.exchange.OrderBookNotification GetNotifications(int index) { - return notifications_[index]; - } - - public const int BootStrapLastFieldNumber = 2; - private bool hasBootStrapLast; - private bool bootStrapLast_ = false; - public bool HasBootStrapLast { - get { return hasBootStrapLast; } - } - public bool BootStrapLast { - get { return bootStrapLast_; } - } - - public override bool IsInitialized { - get { - foreach (global::bnet.protocol.exchange.OrderBookNotification element in NotificationsList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::bnet.protocol.exchange.OrderBookNotification element in NotificationsList) { - output.WriteMessage(1, element); - } - if (HasBootStrapLast) { - output.WriteBool(2, BootStrapLast); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::bnet.protocol.exchange.OrderBookNotification element in NotificationsList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - if (HasBootStrapLast) { - size += pb::CodedOutputStream.ComputeBoolSize(2, BootStrapLast); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static OrderBookNotificationRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OrderBookNotificationRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OrderBookNotificationRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OrderBookNotificationRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OrderBookNotificationRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OrderBookNotificationRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static OrderBookNotificationRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static OrderBookNotificationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static OrderBookNotificationRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OrderBookNotificationRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(OrderBookNotificationRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - OrderBookNotificationRequest result = new OrderBookNotificationRequest(); - - protected override OrderBookNotificationRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new OrderBookNotificationRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.OrderBookNotificationRequest.Descriptor; } - } - - public override OrderBookNotificationRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.OrderBookNotificationRequest.DefaultInstance; } - } - - public override OrderBookNotificationRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.notifications_.MakeReadOnly(); - OrderBookNotificationRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is OrderBookNotificationRequest) { - return MergeFrom((OrderBookNotificationRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(OrderBookNotificationRequest other) { - if (other == global::bnet.protocol.exchange.OrderBookNotificationRequest.DefaultInstance) return this; - if (other.notifications_.Count != 0) { - base.AddRange(other.notifications_, result.notifications_); - } - if (other.HasBootStrapLast) { - BootStrapLast = other.BootStrapLast; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.OrderBookNotification.Builder subBuilder = global::bnet.protocol.exchange.OrderBookNotification.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddNotifications(subBuilder.BuildPartial()); - break; - } - case 16: { - BootStrapLast = input.ReadBool(); - break; - } - } - } - } - - - public pbc::IPopsicleList NotificationsList { - get { return result.notifications_; } - } - public int NotificationsCount { - get { return result.NotificationsCount; } - } - public global::bnet.protocol.exchange.OrderBookNotification GetNotifications(int index) { - return result.GetNotifications(index); - } - public Builder SetNotifications(int index, global::bnet.protocol.exchange.OrderBookNotification value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.notifications_[index] = value; - return this; - } - public Builder SetNotifications(int index, global::bnet.protocol.exchange.OrderBookNotification.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.notifications_[index] = builderForValue.Build(); - return this; - } - public Builder AddNotifications(global::bnet.protocol.exchange.OrderBookNotification value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.notifications_.Add(value); - return this; - } - public Builder AddNotifications(global::bnet.protocol.exchange.OrderBookNotification.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.notifications_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeNotifications(scg::IEnumerable values) { - base.AddRange(values, result.notifications_); - return this; - } - public Builder ClearNotifications() { - result.notifications_.Clear(); - return this; - } - - public bool HasBootStrapLast { - get { return result.HasBootStrapLast; } - } - public bool BootStrapLast { - get { return result.BootStrapLast; } - set { SetBootStrapLast(value); } - } - public Builder SetBootStrapLast(bool value) { - result.hasBootStrapLast = true; - result.bootStrapLast_ = value; - return this; - } - public Builder ClearBootStrapLast() { - result.hasBootStrapLast = false; - result.bootStrapLast_ = false; - return this; - } - } - static OrderBookNotificationRequest() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class OfferNotificationRequest : pb::GeneratedMessage { - private static readonly OfferNotificationRequest defaultInstance = new Builder().BuildPartial(); - public static OfferNotificationRequest DefaultInstance { - get { return defaultInstance; } - } - - public override OfferNotificationRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override OfferNotificationRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_OfferNotificationRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_OfferNotificationRequest__FieldAccessorTable; } - } - - public const int OfferFieldNumber = 1; - private bool hasOffer; - private global::bnet.protocol.exchange.OfferExtended offer_ = global::bnet.protocol.exchange.OfferExtended.DefaultInstance; - public bool HasOffer { - get { return hasOffer; } - } - public global::bnet.protocol.exchange.OfferExtended Offer { - get { return offer_; } - } - - public const int EventFieldNumber = 2; - private bool hasEvent; - private uint event_ = 0; - public bool HasEvent { - get { return hasEvent; } - } - public uint Event { - get { return event_; } - } - - public override bool IsInitialized { - get { - if (!hasOffer) return false; - if (!hasEvent) return false; - if (!Offer.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasOffer) { - output.WriteMessage(1, Offer); - } - if (HasEvent) { - output.WriteUInt32(2, Event); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasOffer) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Offer); - } - if (HasEvent) { - size += pb::CodedOutputStream.ComputeUInt32Size(2, Event); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static OfferNotificationRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OfferNotificationRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OfferNotificationRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OfferNotificationRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OfferNotificationRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OfferNotificationRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static OfferNotificationRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static OfferNotificationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static OfferNotificationRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OfferNotificationRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(OfferNotificationRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - OfferNotificationRequest result = new OfferNotificationRequest(); - - protected override OfferNotificationRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new OfferNotificationRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.OfferNotificationRequest.Descriptor; } - } - - public override OfferNotificationRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.OfferNotificationRequest.DefaultInstance; } - } - - public override OfferNotificationRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - OfferNotificationRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is OfferNotificationRequest) { - return MergeFrom((OfferNotificationRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(OfferNotificationRequest other) { - if (other == global::bnet.protocol.exchange.OfferNotificationRequest.DefaultInstance) return this; - if (other.HasOffer) { - MergeOffer(other.Offer); - } - if (other.HasEvent) { - Event = other.Event; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.OfferExtended.Builder subBuilder = global::bnet.protocol.exchange.OfferExtended.CreateBuilder(); - if (HasOffer) { - subBuilder.MergeFrom(Offer); - } - input.ReadMessage(subBuilder, extensionRegistry); - Offer = subBuilder.BuildPartial(); - break; - } - case 16: { - Event = input.ReadUInt32(); - break; - } - } - } - } - - - public bool HasOffer { - get { return result.HasOffer; } - } - public global::bnet.protocol.exchange.OfferExtended Offer { - get { return result.Offer; } - set { SetOffer(value); } - } - public Builder SetOffer(global::bnet.protocol.exchange.OfferExtended value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasOffer = true; - result.offer_ = value; - return this; - } - public Builder SetOffer(global::bnet.protocol.exchange.OfferExtended.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasOffer = true; - result.offer_ = builderForValue.Build(); - return this; - } - public Builder MergeOffer(global::bnet.protocol.exchange.OfferExtended value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasOffer && - result.offer_ != global::bnet.protocol.exchange.OfferExtended.DefaultInstance) { - result.offer_ = global::bnet.protocol.exchange.OfferExtended.CreateBuilder(result.offer_).MergeFrom(value).BuildPartial(); - } else { - result.offer_ = value; - } - result.hasOffer = true; - return this; - } - public Builder ClearOffer() { - result.hasOffer = false; - result.offer_ = global::bnet.protocol.exchange.OfferExtended.DefaultInstance; - return this; - } - - public bool HasEvent { - get { return result.HasEvent; } - } - public uint Event { - get { return result.Event; } - set { SetEvent(value); } - } - public Builder SetEvent(uint value) { - result.hasEvent = true; - result.event_ = value; - return this; - } - public Builder ClearEvent() { - result.hasEvent = false; - result.event_ = 0; - return this; - } - } - static OfferNotificationRequest() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - public sealed partial class BidNotificationRequest : pb::GeneratedMessage { - private static readonly BidNotificationRequest defaultInstance = new Builder().BuildPartial(); - public static BidNotificationRequest DefaultInstance { - get { return defaultInstance; } - } - - public override BidNotificationRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override BidNotificationRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_BidNotificationRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_BidNotificationRequest__FieldAccessorTable; } - } - - public const int BidFieldNumber = 1; - private bool hasBid; - private global::bnet.protocol.exchange.BidExtended bid_ = global::bnet.protocol.exchange.BidExtended.DefaultInstance; - public bool HasBid { - get { return hasBid; } - } - public global::bnet.protocol.exchange.BidExtended Bid { - get { return bid_; } - } - - public const int EventFieldNumber = 2; - private bool hasEvent; - private uint event_ = 0; - public bool HasEvent { - get { return hasEvent; } - } - public uint Event { - get { return event_; } - } - - public override bool IsInitialized { - get { - if (!hasBid) return false; - if (!hasEvent) return false; - if (!Bid.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasBid) { - output.WriteMessage(1, Bid); - } - if (HasEvent) { - output.WriteUInt32(2, Event); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasBid) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Bid); - } - if (HasEvent) { - size += pb::CodedOutputStream.ComputeUInt32Size(2, Event); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static BidNotificationRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BidNotificationRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BidNotificationRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BidNotificationRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BidNotificationRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BidNotificationRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static BidNotificationRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static BidNotificationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static BidNotificationRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BidNotificationRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(BidNotificationRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - BidNotificationRequest result = new BidNotificationRequest(); - - protected override BidNotificationRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new BidNotificationRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.BidNotificationRequest.Descriptor; } - } - - public override BidNotificationRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.BidNotificationRequest.DefaultInstance; } - } - - public override BidNotificationRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - BidNotificationRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is BidNotificationRequest) { - return MergeFrom((BidNotificationRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(BidNotificationRequest other) { - if (other == global::bnet.protocol.exchange.BidNotificationRequest.DefaultInstance) return this; - if (other.HasBid) { - MergeBid(other.Bid); - } - if (other.HasEvent) { - Event = other.Event; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.BidExtended.Builder subBuilder = global::bnet.protocol.exchange.BidExtended.CreateBuilder(); - if (HasBid) { - subBuilder.MergeFrom(Bid); - } - input.ReadMessage(subBuilder, extensionRegistry); - Bid = subBuilder.BuildPartial(); - break; - } - case 16: { - Event = input.ReadUInt32(); - break; - } - } - } - } - - - public bool HasBid { - get { return result.HasBid; } - } - public global::bnet.protocol.exchange.BidExtended Bid { - get { return result.Bid; } - set { SetBid(value); } - } - public Builder SetBid(global::bnet.protocol.exchange.BidExtended value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBid = true; - result.bid_ = value; - return this; - } - public Builder SetBid(global::bnet.protocol.exchange.BidExtended.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBid = true; - result.bid_ = builderForValue.Build(); - return this; - } - public Builder MergeBid(global::bnet.protocol.exchange.BidExtended value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasBid && - result.bid_ != global::bnet.protocol.exchange.BidExtended.DefaultInstance) { - result.bid_ = global::bnet.protocol.exchange.BidExtended.CreateBuilder(result.bid_).MergeFrom(value).BuildPartial(); - } else { - result.bid_ = value; - } - result.hasBid = true; - return this; - } - public Builder ClearBid() { - result.hasBid = false; - result.bid_ = global::bnet.protocol.exchange.BidExtended.DefaultInstance; - return this; - } - - public bool HasEvent { - get { return result.HasEvent; } - } - public uint Event { - get { return result.Event; } - set { SetEvent(value); } - } - public Builder SetEvent(uint value) { - result.hasEvent = true; - result.event_ = value; - return this; - } - public Builder ClearEvent() { - result.hasEvent = false; - result.event_ = 0; - return this; - } - } - static BidNotificationRequest() { - object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); - } - } - - #endregion - - #region Services - public abstract class ExchangeService : pb::IService { - public abstract void CreateOrderBook( - pb::IRpcController controller, - global::bnet.protocol.exchange.CreateOrderBookRequest request, - global::System.Action done); - public abstract void PlaceOfferOnOrderBook( - pb::IRpcController controller, - global::bnet.protocol.exchange.PlaceOfferOnOrderBookRequest request, - global::System.Action done); - public abstract void PlaceOfferCreateOrderBookIfNeeded( - pb::IRpcController controller, - global::bnet.protocol.exchange.PlaceOfferCreateOrderBookIfNeededRequest request, - global::System.Action done); - public abstract void PlaceBidOnOrderBook( - pb::IRpcController controller, - global::bnet.protocol.exchange.PlaceBidOnOrderBookRequest request, - global::System.Action done); - public abstract void PlaceBidCreateOrderBookIfNeeded( - pb::IRpcController controller, - global::bnet.protocol.exchange.PlaceBidCreateOrderBookIfNeededRequest request, - global::System.Action done); - public abstract void QueryOffersByOrderBook( - pb::IRpcController controller, - global::bnet.protocol.exchange.QueryOffersByOrderBookRequest request, - global::System.Action done); - public abstract void QueryBidsByOrderBook( - pb::IRpcController controller, - global::bnet.protocol.exchange.QueryBidsByOrderBookRequest request, - global::System.Action done); - public abstract void QueryOffersByAccountForItem( - pb::IRpcController controller, - global::bnet.protocol.exchange.QueryOffersByAccountForItemRequest request, - global::System.Action done); - public abstract void QueryBidsByAccountForItem( - pb::IRpcController controller, - global::bnet.protocol.exchange.QueryBidsByAccountForItemRequest request, - global::System.Action done); - public abstract void QueryOrderBooksSummary( - pb::IRpcController controller, - global::bnet.protocol.exchange.QueryOrderBooksSummaryRequest request, - global::System.Action done); - public abstract void QuerySettlementsByOrderBook( - pb::IRpcController controller, - global::bnet.protocol.exchange.QuerySettlementsByOrderBookRequest request, - global::System.Action done); - public abstract void ReportAuthorize( - pb::IRpcController controller, - global::bnet.protocol.exchange_object_provider.ReportAuthorizeRequest request, - global::System.Action done); - public abstract void ReportSettle( - pb::IRpcController controller, - global::bnet.protocol.exchange_object_provider.ReportSettleRequest request, - global::System.Action done); - public abstract void ReportCancel( - pb::IRpcController controller, - global::bnet.protocol.exchange_object_provider.ReportCancelRequest request, - global::System.Action done); - public abstract void SubscribeOrderBookStatusChange( - pb::IRpcController controller, - global::bnet.protocol.exchange.SubscribeOrderBookStatusChangeRequest request, - global::System.Action done); - public abstract void UnsubscribeOrderBookStatusChange( - pb::IRpcController controller, - global::bnet.protocol.exchange.UnsubscribeOrderBookStatusChangeRequest request, - global::System.Action done); - public abstract void SubscribeOrderStatusChange( - pb::IRpcController controller, - global::bnet.protocol.exchange.SubscribeOrderStatusChangeRequest request, - global::System.Action done); - public abstract void UnsubscribeOrderStatusChange( - pb::IRpcController controller, - global::bnet.protocol.exchange.UnsubscribeOrderStatusChangeRequest request, - global::System.Action done); - public abstract void GetPaymentMethods( - pb::IRpcController controller, - global::bnet.protocol.exchange_object_provider.GetPaymentMethodsRequest request, - global::System.Action done); - public abstract void ClaimBidItem( - pb::IRpcController controller, - global::bnet.protocol.exchange.ClaimRequest request, - global::System.Action done); - public abstract void ClaimBidMoney( - pb::IRpcController controller, - global::bnet.protocol.exchange.ClaimRequest request, - global::System.Action done); - public abstract void ClaimOfferItem( - pb::IRpcController controller, - global::bnet.protocol.exchange.ClaimRequest request, - global::System.Action done); - public abstract void ClaimOfferMoney( - pb::IRpcController controller, - global::bnet.protocol.exchange.ClaimRequest request, - global::System.Action done); - public abstract void CancelBid( - pb::IRpcController controller, - global::bnet.protocol.exchange.CancelRequest request, - global::System.Action done); - public abstract void CancelOffer( - pb::IRpcController controller, - global::bnet.protocol.exchange.CancelRequest request, - global::System.Action done); - public abstract void GetConfiguration( - pb::IRpcController controller, - global::bnet.protocol.exchange.GetConfigurationRequest request, - global::System.Action done); - public abstract void GetBidFeeEstimation( - pb::IRpcController controller, - global::bnet.protocol.exchange.GetBidFeeEstimationRequest request, - global::System.Action done); - public abstract void GetOfferFeeEstimation( - pb::IRpcController controller, - global::bnet.protocol.exchange.GetOfferFeeEstimationRequest request, - global::System.Action done); - - public static pbd::ServiceDescriptor Descriptor { - get { return Proto.ExchangeService.Descriptor.Services[0]; } - } - public pbd::ServiceDescriptor DescriptorForType { - get { return Descriptor; } - } - - public void CallMethod( - pbd::MethodDescriptor method, - pb::IRpcController controller, - pb::IMessage request, - global::System.Action done) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.CallMethod() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - this.CreateOrderBook(controller, (global::bnet.protocol.exchange.CreateOrderBookRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 1: - this.PlaceOfferOnOrderBook(controller, (global::bnet.protocol.exchange.PlaceOfferOnOrderBookRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 2: - this.PlaceOfferCreateOrderBookIfNeeded(controller, (global::bnet.protocol.exchange.PlaceOfferCreateOrderBookIfNeededRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 3: - this.PlaceBidOnOrderBook(controller, (global::bnet.protocol.exchange.PlaceBidOnOrderBookRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 4: - this.PlaceBidCreateOrderBookIfNeeded(controller, (global::bnet.protocol.exchange.PlaceBidCreateOrderBookIfNeededRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 5: - this.QueryOffersByOrderBook(controller, (global::bnet.protocol.exchange.QueryOffersByOrderBookRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 6: - this.QueryBidsByOrderBook(controller, (global::bnet.protocol.exchange.QueryBidsByOrderBookRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 7: - this.QueryOffersByAccountForItem(controller, (global::bnet.protocol.exchange.QueryOffersByAccountForItemRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 8: - this.QueryBidsByAccountForItem(controller, (global::bnet.protocol.exchange.QueryBidsByAccountForItemRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 9: - this.QueryOrderBooksSummary(controller, (global::bnet.protocol.exchange.QueryOrderBooksSummaryRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 10: - this.QuerySettlementsByOrderBook(controller, (global::bnet.protocol.exchange.QuerySettlementsByOrderBookRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 11: - this.ReportAuthorize(controller, (global::bnet.protocol.exchange_object_provider.ReportAuthorizeRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 12: - this.ReportSettle(controller, (global::bnet.protocol.exchange_object_provider.ReportSettleRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 13: - this.ReportCancel(controller, (global::bnet.protocol.exchange_object_provider.ReportCancelRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 14: - this.SubscribeOrderBookStatusChange(controller, (global::bnet.protocol.exchange.SubscribeOrderBookStatusChangeRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 15: - this.UnsubscribeOrderBookStatusChange(controller, (global::bnet.protocol.exchange.UnsubscribeOrderBookStatusChangeRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 16: - this.SubscribeOrderStatusChange(controller, (global::bnet.protocol.exchange.SubscribeOrderStatusChangeRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 17: - this.UnsubscribeOrderStatusChange(controller, (global::bnet.protocol.exchange.UnsubscribeOrderStatusChangeRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 18: - this.GetPaymentMethods(controller, (global::bnet.protocol.exchange_object_provider.GetPaymentMethodsRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 19: - this.ClaimBidItem(controller, (global::bnet.protocol.exchange.ClaimRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 20: - this.ClaimBidMoney(controller, (global::bnet.protocol.exchange.ClaimRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 21: - this.ClaimOfferItem(controller, (global::bnet.protocol.exchange.ClaimRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 22: - this.ClaimOfferMoney(controller, (global::bnet.protocol.exchange.ClaimRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 23: - this.CancelBid(controller, (global::bnet.protocol.exchange.CancelRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 24: - this.CancelOffer(controller, (global::bnet.protocol.exchange.CancelRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 25: - this.GetConfiguration(controller, (global::bnet.protocol.exchange.GetConfigurationRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 26: - this.GetBidFeeEstimation(controller, (global::bnet.protocol.exchange.GetBidFeeEstimationRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 27: - this.GetOfferFeeEstimation(controller, (global::bnet.protocol.exchange.GetOfferFeeEstimationRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetRequestPrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::bnet.protocol.exchange.CreateOrderBookRequest.DefaultInstance; - case 1: - return global::bnet.protocol.exchange.PlaceOfferOnOrderBookRequest.DefaultInstance; - case 2: - return global::bnet.protocol.exchange.PlaceOfferCreateOrderBookIfNeededRequest.DefaultInstance; - case 3: - return global::bnet.protocol.exchange.PlaceBidOnOrderBookRequest.DefaultInstance; - case 4: - return global::bnet.protocol.exchange.PlaceBidCreateOrderBookIfNeededRequest.DefaultInstance; - case 5: - return global::bnet.protocol.exchange.QueryOffersByOrderBookRequest.DefaultInstance; - case 6: - return global::bnet.protocol.exchange.QueryBidsByOrderBookRequest.DefaultInstance; - case 7: - return global::bnet.protocol.exchange.QueryOffersByAccountForItemRequest.DefaultInstance; - case 8: - return global::bnet.protocol.exchange.QueryBidsByAccountForItemRequest.DefaultInstance; - case 9: - return global::bnet.protocol.exchange.QueryOrderBooksSummaryRequest.DefaultInstance; - case 10: - return global::bnet.protocol.exchange.QuerySettlementsByOrderBookRequest.DefaultInstance; - case 11: - return global::bnet.protocol.exchange_object_provider.ReportAuthorizeRequest.DefaultInstance; - case 12: - return global::bnet.protocol.exchange_object_provider.ReportSettleRequest.DefaultInstance; - case 13: - return global::bnet.protocol.exchange_object_provider.ReportCancelRequest.DefaultInstance; - case 14: - return global::bnet.protocol.exchange.SubscribeOrderBookStatusChangeRequest.DefaultInstance; - case 15: - return global::bnet.protocol.exchange.UnsubscribeOrderBookStatusChangeRequest.DefaultInstance; - case 16: - return global::bnet.protocol.exchange.SubscribeOrderStatusChangeRequest.DefaultInstance; - case 17: - return global::bnet.protocol.exchange.UnsubscribeOrderStatusChangeRequest.DefaultInstance; - case 18: - return global::bnet.protocol.exchange_object_provider.GetPaymentMethodsRequest.DefaultInstance; - case 19: - return global::bnet.protocol.exchange.ClaimRequest.DefaultInstance; - case 20: - return global::bnet.protocol.exchange.ClaimRequest.DefaultInstance; - case 21: - return global::bnet.protocol.exchange.ClaimRequest.DefaultInstance; - case 22: - return global::bnet.protocol.exchange.ClaimRequest.DefaultInstance; - case 23: - return global::bnet.protocol.exchange.CancelRequest.DefaultInstance; - case 24: - return global::bnet.protocol.exchange.CancelRequest.DefaultInstance; - case 25: - return global::bnet.protocol.exchange.GetConfigurationRequest.DefaultInstance; - case 26: - return global::bnet.protocol.exchange.GetBidFeeEstimationRequest.DefaultInstance; - case 27: - return global::bnet.protocol.exchange.GetOfferFeeEstimationRequest.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetResponsePrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::bnet.protocol.exchange.CreateOrderBookResponse.DefaultInstance; - case 1: - return global::bnet.protocol.exchange.PlaceOfferOnOrderBookResponse.DefaultInstance; - case 2: - return global::bnet.protocol.exchange.PlaceOfferCreateOrderBookIfNeededResponse.DefaultInstance; - case 3: - return global::bnet.protocol.exchange.PlaceBidOnOrderBookResponse.DefaultInstance; - case 4: - return global::bnet.protocol.exchange.PlaceBidCreateOrderBookIfNeededResponse.DefaultInstance; - case 5: - return global::bnet.protocol.exchange.QueryOffersByOrderBookResponse.DefaultInstance; - case 6: - return global::bnet.protocol.exchange.QueryBidsByOrderBookResponse.DefaultInstance; - case 7: - return global::bnet.protocol.exchange.QueryOffersByAccountForItemResponse.DefaultInstance; - case 8: - return global::bnet.protocol.exchange.QueryBidsByAccountForItemResponse.DefaultInstance; - case 9: - return global::bnet.protocol.exchange.QueryOrderBooksSummaryResponse.DefaultInstance; - case 10: - return global::bnet.protocol.exchange.QuerySettlementsByOrderBookResponse.DefaultInstance; - case 11: - return global::bnet.protocol.NoData.DefaultInstance; - case 12: - return global::bnet.protocol.NoData.DefaultInstance; - case 13: - return global::bnet.protocol.NoData.DefaultInstance; - case 14: - return global::bnet.protocol.NoData.DefaultInstance; - case 15: - return global::bnet.protocol.NoData.DefaultInstance; - case 16: - return global::bnet.protocol.NoData.DefaultInstance; - case 17: - return global::bnet.protocol.NoData.DefaultInstance; - case 18: - return global::bnet.protocol.exchange_object_provider.GetPaymentMethodsResponse.DefaultInstance; - case 19: - return global::bnet.protocol.NoData.DefaultInstance; - case 20: - return global::bnet.protocol.NoData.DefaultInstance; - case 21: - return global::bnet.protocol.NoData.DefaultInstance; - case 22: - return global::bnet.protocol.NoData.DefaultInstance; - case 23: - return global::bnet.protocol.NoData.DefaultInstance; - case 24: - return global::bnet.protocol.NoData.DefaultInstance; - case 25: - return global::bnet.protocol.exchange.GetConfigurationResponse.DefaultInstance; - case 26: - return global::bnet.protocol.exchange.GetFeeEstimationResponse.DefaultInstance; - case 27: - return global::bnet.protocol.exchange.GetFeeEstimationResponse.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public static Stub CreateStub(pb::IRpcChannel channel) { - return new Stub(channel); - } - - public class Stub : global::bnet.protocol.exchange.ExchangeService { - internal Stub(pb::IRpcChannel channel) { - this.channel = channel; - } - - private readonly pb::IRpcChannel channel; - - public pb::IRpcChannel Channel { - get { return channel; } - } - - public override void CreateOrderBook( - pb::IRpcController controller, - global::bnet.protocol.exchange.CreateOrderBookRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[0], - controller, request, global::bnet.protocol.exchange.CreateOrderBookResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.CreateOrderBookResponse.DefaultInstance)); - } - - public override void PlaceOfferOnOrderBook( - pb::IRpcController controller, - global::bnet.protocol.exchange.PlaceOfferOnOrderBookRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[1], - controller, request, global::bnet.protocol.exchange.PlaceOfferOnOrderBookResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.PlaceOfferOnOrderBookResponse.DefaultInstance)); - } - - public override void PlaceOfferCreateOrderBookIfNeeded( - pb::IRpcController controller, - global::bnet.protocol.exchange.PlaceOfferCreateOrderBookIfNeededRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[2], - controller, request, global::bnet.protocol.exchange.PlaceOfferCreateOrderBookIfNeededResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.PlaceOfferCreateOrderBookIfNeededResponse.DefaultInstance)); - } - - public override void PlaceBidOnOrderBook( - pb::IRpcController controller, - global::bnet.protocol.exchange.PlaceBidOnOrderBookRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[3], - controller, request, global::bnet.protocol.exchange.PlaceBidOnOrderBookResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.PlaceBidOnOrderBookResponse.DefaultInstance)); - } - - public override void PlaceBidCreateOrderBookIfNeeded( - pb::IRpcController controller, - global::bnet.protocol.exchange.PlaceBidCreateOrderBookIfNeededRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[4], - controller, request, global::bnet.protocol.exchange.PlaceBidCreateOrderBookIfNeededResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.PlaceBidCreateOrderBookIfNeededResponse.DefaultInstance)); - } - - public override void QueryOffersByOrderBook( - pb::IRpcController controller, - global::bnet.protocol.exchange.QueryOffersByOrderBookRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[5], - controller, request, global::bnet.protocol.exchange.QueryOffersByOrderBookResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.QueryOffersByOrderBookResponse.DefaultInstance)); - } - - public override void QueryBidsByOrderBook( - pb::IRpcController controller, - global::bnet.protocol.exchange.QueryBidsByOrderBookRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[6], - controller, request, global::bnet.protocol.exchange.QueryBidsByOrderBookResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.QueryBidsByOrderBookResponse.DefaultInstance)); - } - - public override void QueryOffersByAccountForItem( - pb::IRpcController controller, - global::bnet.protocol.exchange.QueryOffersByAccountForItemRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[7], - controller, request, global::bnet.protocol.exchange.QueryOffersByAccountForItemResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.QueryOffersByAccountForItemResponse.DefaultInstance)); - } - - public override void QueryBidsByAccountForItem( - pb::IRpcController controller, - global::bnet.protocol.exchange.QueryBidsByAccountForItemRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[8], - controller, request, global::bnet.protocol.exchange.QueryBidsByAccountForItemResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.QueryBidsByAccountForItemResponse.DefaultInstance)); - } - - public override void QueryOrderBooksSummary( - pb::IRpcController controller, - global::bnet.protocol.exchange.QueryOrderBooksSummaryRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[9], - controller, request, global::bnet.protocol.exchange.QueryOrderBooksSummaryResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.QueryOrderBooksSummaryResponse.DefaultInstance)); - } - - public override void QuerySettlementsByOrderBook( - pb::IRpcController controller, - global::bnet.protocol.exchange.QuerySettlementsByOrderBookRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[10], - controller, request, global::bnet.protocol.exchange.QuerySettlementsByOrderBookResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.QuerySettlementsByOrderBookResponse.DefaultInstance)); - } - - public override void ReportAuthorize( - pb::IRpcController controller, - global::bnet.protocol.exchange_object_provider.ReportAuthorizeRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[11], - controller, request, global::bnet.protocol.NoData.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); - } - - public override void ReportSettle( - pb::IRpcController controller, - global::bnet.protocol.exchange_object_provider.ReportSettleRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[12], - controller, request, global::bnet.protocol.NoData.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); - } - - public override void ReportCancel( - pb::IRpcController controller, - global::bnet.protocol.exchange_object_provider.ReportCancelRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[13], - controller, request, global::bnet.protocol.NoData.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); - } - - public override void SubscribeOrderBookStatusChange( - pb::IRpcController controller, - global::bnet.protocol.exchange.SubscribeOrderBookStatusChangeRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[14], - controller, request, global::bnet.protocol.NoData.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); - } - - public override void UnsubscribeOrderBookStatusChange( - pb::IRpcController controller, - global::bnet.protocol.exchange.UnsubscribeOrderBookStatusChangeRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[15], - controller, request, global::bnet.protocol.NoData.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); - } - - public override void SubscribeOrderStatusChange( - pb::IRpcController controller, - global::bnet.protocol.exchange.SubscribeOrderStatusChangeRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[16], - controller, request, global::bnet.protocol.NoData.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); - } - - public override void UnsubscribeOrderStatusChange( - pb::IRpcController controller, - global::bnet.protocol.exchange.UnsubscribeOrderStatusChangeRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[17], - controller, request, global::bnet.protocol.NoData.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); - } - - public override void GetPaymentMethods( - pb::IRpcController controller, - global::bnet.protocol.exchange_object_provider.GetPaymentMethodsRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[18], - controller, request, global::bnet.protocol.exchange_object_provider.GetPaymentMethodsResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange_object_provider.GetPaymentMethodsResponse.DefaultInstance)); - } - - public override void ClaimBidItem( - pb::IRpcController controller, - global::bnet.protocol.exchange.ClaimRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[19], - controller, request, global::bnet.protocol.NoData.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); - } - - public override void ClaimBidMoney( - pb::IRpcController controller, - global::bnet.protocol.exchange.ClaimRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[20], - controller, request, global::bnet.protocol.NoData.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); - } - - public override void ClaimOfferItem( - pb::IRpcController controller, - global::bnet.protocol.exchange.ClaimRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[21], - controller, request, global::bnet.protocol.NoData.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); - } - - public override void ClaimOfferMoney( - pb::IRpcController controller, - global::bnet.protocol.exchange.ClaimRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[22], - controller, request, global::bnet.protocol.NoData.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); - } - - public override void CancelBid( - pb::IRpcController controller, - global::bnet.protocol.exchange.CancelRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[23], - controller, request, global::bnet.protocol.NoData.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); - } - - public override void CancelOffer( - pb::IRpcController controller, - global::bnet.protocol.exchange.CancelRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[24], - controller, request, global::bnet.protocol.NoData.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); - } - - public override void GetConfiguration( - pb::IRpcController controller, - global::bnet.protocol.exchange.GetConfigurationRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[25], - controller, request, global::bnet.protocol.exchange.GetConfigurationResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.GetConfigurationResponse.DefaultInstance)); - } - - public override void GetBidFeeEstimation( - pb::IRpcController controller, - global::bnet.protocol.exchange.GetBidFeeEstimationRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[26], - controller, request, global::bnet.protocol.exchange.GetFeeEstimationResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.GetFeeEstimationResponse.DefaultInstance)); - } - - public override void GetOfferFeeEstimation( - pb::IRpcController controller, - global::bnet.protocol.exchange.GetOfferFeeEstimationRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[27], - controller, request, global::bnet.protocol.exchange.GetFeeEstimationResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.GetFeeEstimationResponse.DefaultInstance)); - } - } - } - public abstract class ExchangeNotify : pb::IService { - public abstract void NotifyOrderBookStatusChange( - pb::IRpcController controller, - global::bnet.protocol.exchange.OrderBookNotificationRequest request, - global::System.Action done); - public abstract void NotifyOfferStatusChange( - pb::IRpcController controller, - global::bnet.protocol.exchange.OfferNotificationRequest request, - global::System.Action done); - public abstract void NotifyBidStatusChange( - pb::IRpcController controller, - global::bnet.protocol.exchange.BidNotificationRequest request, - global::System.Action done); - - public static pbd::ServiceDescriptor Descriptor { - get { return Proto.ExchangeService.Descriptor.Services[1]; } - } - public pbd::ServiceDescriptor DescriptorForType { - get { return Descriptor; } - } - - public void CallMethod( - pbd::MethodDescriptor method, - pb::IRpcController controller, - pb::IMessage request, - global::System.Action done) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.CallMethod() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - this.NotifyOrderBookStatusChange(controller, (global::bnet.protocol.exchange.OrderBookNotificationRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 1: - this.NotifyOfferStatusChange(controller, (global::bnet.protocol.exchange.OfferNotificationRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 2: - this.NotifyBidStatusChange(controller, (global::bnet.protocol.exchange.BidNotificationRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetRequestPrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::bnet.protocol.exchange.OrderBookNotificationRequest.DefaultInstance; - case 1: - return global::bnet.protocol.exchange.OfferNotificationRequest.DefaultInstance; - case 2: - return global::bnet.protocol.exchange.BidNotificationRequest.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetResponsePrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::bnet.protocol.NO_RESPONSE.DefaultInstance; - case 1: - return global::bnet.protocol.NO_RESPONSE.DefaultInstance; - case 2: - return global::bnet.protocol.NO_RESPONSE.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public static Stub CreateStub(pb::IRpcChannel channel) { - return new Stub(channel); - } - - public class Stub : global::bnet.protocol.exchange.ExchangeNotify { - internal Stub(pb::IRpcChannel channel) { - this.channel = channel; - } - - private readonly pb::IRpcChannel channel; - - public pb::IRpcChannel Channel { - get { return channel; } - } - - public override void NotifyOrderBookStatusChange( - pb::IRpcController controller, - global::bnet.protocol.exchange.OrderBookNotificationRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[0], - controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); - } - - public override void NotifyOfferStatusChange( - pb::IRpcController controller, - global::bnet.protocol.exchange.OfferNotificationRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[1], - controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); - } - - public override void NotifyBidStatusChange( - pb::IRpcController controller, - global::bnet.protocol.exchange.BidNotificationRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[2], - controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); - } - } - } - #endregion - -} diff --git a/source/D3Proto/bnet/protocol/exchange/ExchangeTypes.cs b/source/D3Proto/bnet/protocol/exchange/ExchangeTypes.cs deleted file mode 100644 index ab7e4674..00000000 --- a/source/D3Proto/bnet/protocol/exchange/ExchangeTypes.cs +++ /dev/null @@ -1,8591 +0,0 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace bnet.protocol.exchange { - - public static partial class ExchangeTypes { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_OrderBook__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_OrderBook__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_OrderBookHandle__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_OrderBookHandle__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_OrderBookNotification__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_OrderBookNotification__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_OrderBookSummary__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_OrderBookSummary__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_Order__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_Order__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_Extension__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_Extension__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_Offer__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_Offer__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_OfferExtended__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_OfferExtended__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_OfferCreation__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_OfferCreation__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_Bid__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_Bid__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_BidExtended__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_BidExtended__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_BidCreation__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_BidCreation__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_QueryFilterByOrderId__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_QueryFilterByOrderId__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_QueryFilterByCreatedTime__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_QueryFilterByCreatedTime__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_Settlement__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_Settlement__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_CurrencyConfig__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_CurrencyConfig__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_SpecialistConfig__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_SpecialistConfig__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_BillingAddress__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_BillingAddress__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_FeeEstimationData__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_FeeEstimationData__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static ExchangeTypes() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "CiVzZXJ2aWNlL2V4Y2hhbmdlL2V4Y2hhbmdlX3R5cGVzLnByb3RvEhZibmV0" + - "LnByb3RvY29sLmV4Y2hhbmdlGhlsaWIvcHJvdG9jb2wvZW50aXR5LnByb3Rv" + - "GhtsaWIvcHJvdG9jb2wvZXhjaGFuZ2UucHJvdG8ipAEKCU9yZGVyQm9vaxIy" + - "CgZvYmplY3QYASACKAsyIi5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLkJsb2JP" + - "ZlR5cGUSDwoHcHJvZ3JhbRgCIAIoBxIVCg1jb21wYXRpYmlsaXR5GAMgAigN" + - "EhAKCGN1cnJlbmN5GAQgAigJEhIKCnNwZWNpYWxpc3QYBSACKAUSFQoNYWxs" + - "b3dlZF9yZWFsbRgGIAIoDSJjCg9PcmRlckJvb2tIYW5kbGUSOQoMcGFydGl0" + - "aW9uX2lkGAEgAigLMiMuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5QYXJ0aXRp" + - "b25JZBIVCg1vcmRlcl9ib29rX2lkGAIgAigEIt4BChVPcmRlckJvb2tOb3Rp" + - "ZmljYXRpb24SNQoKb3JkZXJfYm9vaxgBIAIoCzIhLmJuZXQucHJvdG9jb2wu" + - "ZXhjaGFuZ2UuT3JkZXJCb29rEjkKDHBhcnRpdGlvbl9pZBgCIAIoCzIjLmJu" + - "ZXQucHJvdG9jb2wuZXhjaGFuZ2UuUGFydGl0aW9uSWQSFQoNb3JkZXJfYm9v" + - "a19pZBgDIAIoBBIXCg90cmFkZV9ub3dfcHJpY2UYBCABKAQSDgoGc3RhdHVz" + - "GAUgAigNEhMKC3VwZGF0ZV90aW1lGAYgAigEIvsCChBPcmRlckJvb2tTdW1t" + - "YXJ5EjkKDHBhcnRpdGlvbl9pZBgBIAIoCzIjLmJuZXQucHJvdG9jb2wuZXhj" + - "aGFuZ2UuUGFydGl0aW9uSWQSFQoNb3JkZXJfYm9va19pZBgCIAIoBBIOCgZy" + - "ZXN1bHQYAyACKA0SNQoKb3JkZXJfYm9vaxgEIAEoCzIhLmJuZXQucHJvdG9j" + - "b2wuZXhjaGFuZ2UuT3JkZXJCb29rEg4KBmFtb3VudBgFIAEoBBIYChBiZXN0" + - "X29mZmVyX3ByaWNlGAYgASgEEhYKDmJlc3RfYmlkX3ByaWNlGAcgASgEEhAK" + - "CGVuZF90aW1lGAggASgEEg4KBnN0YXR1cxgJIAEoBRIUCgxjcmVhdGVkX3Rp" + - "bWUYCiABKAQSEwoLYWN0aXZlX3RpbWUYCyABKAQSEwoLY2xvc2VkX3RpbWUY" + - "DCABKAQSDgoGcmVhc29uGA0gASgNEhoKEm91dF9iaWRfdW5pdF9wcmljZRgO" + - "IAEoBCK7AgoFT3JkZXISDgoGYW1vdW50GAEgAigNEhIKCnN0YXJ0X3RpbWUY" + - "AiABKAQSEAoIZW5kX3RpbWUYAyABKAQSOwoRYWNjb3VudF9mb3JfbW9uZXkY" + - "BCABKAsyIC5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLkJsb2JGcm9tEjoKEGFj" + - "Y291bnRfZm9yX2l0ZW0YBSABKAsyIC5ibmV0LnByb3RvY29sLmV4Y2hhbmdl" + - "LkJsb2JGcm9tEi0KDGJuZXRfYWNjb3VudBgGIAEoCzIXLmJuZXQucHJvdG9j" + - "b2wuRW50aXR5SWQSLQoMZ2FtZV9hY2NvdW50GAcgASgLMhcuYm5ldC5wcm90" + - "b2NvbC5FbnRpdHlJZBIlCgR0b29uGAggASgLMhcuYm5ldC5wcm90b2NvbC5F" + - "bnRpdHlJZCLyAgoJRXh0ZW5zaW9uEjkKDHBhcnRpdGlvbl9pZBgBIAIoCzIj" + - "LmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuUGFydGl0aW9uSWQSFQoNb3JkZXJf" + - "Ym9va19pZBgCIAIoBBIQCghvcmRlcl9pZBgDIAIoBBIVCg1maWxsZWRfYW1v" + - "dW50GAQgASgEEhQKDG9yZGVyX3N0YXR1cxgFIAEoBRIXCg9hdXRob3JpemVk" + - "X3RpbWUYBiABKAQSFAoMY3JlYXRlZF90aW1lGAcgASgEEhMKC2Nsb3NlZF90" + - "aW1lGAggASgEEg4KBnJlYXNvbhgJIAEoDRI1CgpvcmRlcl9ib29rGAogASgL" + - "MiEuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5PcmRlckJvb2sSGQoRb3JkZXJf" + - "Ym9va19zdGF0dXMYCyABKAQSFgoObW9uZXlfdG9fY2xhaW0YDCABKAQSFgoO" + - "aXRlbXNfdG9fY2xhaW0YDSABKAQifAoFT2ZmZXISLAoFb3JkZXIYASACKAsy" + - "HS5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLk9yZGVyEhcKD3RyYWRlX25vd19w" + - "cmljZRgCIAEoBBIVCg1yZXNlcnZlX3ByaWNlGAMgASgEEhUKDW91dF9iaWRf" + - "cHJpY2UYBCABKAQikgEKDU9mZmVyRXh0ZW5kZWQSLAoFb2ZmZXIYASACKAsy" + - "HS5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLk9mZmVyEjQKCWV4dGVuc2lvbhgC" + - "IAIoCzIhLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuRXh0ZW5zaW9uEh0KFWN1" + - "cnJlbnRfd2lubmluZ19wcmljZRgDIAEoBCK1AQoNT2ZmZXJDcmVhdGlvbhIs" + - "CgVvZmZlchgBIAIoCzIdLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuT2ZmZXIS" + - "GAoQYXVjdGlvbl9kdXJhdGlvbhgCIAEoBBIbChNhdWN0aW9uX3N0YXJ0X2Rl" + - "bGF5GAMgASgEEj8KD2JpbGxpbmdfYWRkcmVzcxgEIAEoCzImLmJuZXQucHJv" + - "dG9jb2wuZXhjaGFuZ2UuQmlsbGluZ0FkZHJlc3MiZwoDQmlkEiwKBW9yZGVy" + - "GAEgAigLMh0uYm5ldC5wcm90b2NvbC5leGNoYW5nZS5PcmRlchIaChJjdXJy" + - "ZW50X3VuaXRfcHJpY2UYAiABKAQSFgoObWF4X3VuaXRfcHJpY2UYAyABKAQi" + - "zgEKC0JpZEV4dGVuZGVkEigKA2JpZBgBIAIoCzIbLmJuZXQucHJvdG9jb2wu" + - "ZXhjaGFuZ2UuQmlkEjQKCWV4dGVuc2lvbhgCIAIoCzIhLmJuZXQucHJvdG9j" + - "b2wuZXhjaGFuZ2UuRXh0ZW5zaW9uEhsKE29mZmVyX291dF9iaWRfcHJpY2UY" + - "AyABKAQSHQoVb2ZmZXJfdHJhZGVfbm93X3ByaWNlGAQgASgEEiMKG29mZmVy" + - "X2N1cnJlbnRfd2lubmluZ19wcmljZRgFIAEoBCKvAQoLQmlkQ3JlYXRpb24S" + - "KAoDYmlkGAEgAigLMhsuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5CaWQSGAoQ" + - "YXVjdGlvbl9kdXJhdGlvbhgCIAEoBBIbChNhdWN0aW9uX3N0YXJ0X2RlbGF5" + - "GAMgASgEEj8KD2JpbGxpbmdfYWRkcmVzcxgEIAEoCzImLmJuZXQucHJvdG9j" + - "b2wuZXhjaGFuZ2UuQmlsbGluZ0FkZHJlc3MiQAoUUXVlcnlGaWx0ZXJCeU9y" + - "ZGVySWQSEgoKbWF4X3Jlc3VsdBgBIAIoDRIUCgxyZWZfb3JkZXJfaWQYAiAB" + - "KAQiSAoYUXVlcnlGaWx0ZXJCeUNyZWF0ZWRUaW1lEhIKCm1heF9yZXN1bHQY" + - "ASACKA0SGAoQcmVmX2NyZWF0ZWRfdGltZRgCIAEoBCJoCgpTZXR0bGVtZW50" + - "EhUKDW9yZGVyX2Jvb2tfaWQYASACKAQSFAoMbW9uZXlfYW1vdW50GAIgAigE" + - "EhQKDGl0ZW1zX2Ftb3VudBgDIAIoBBIXCg9vZmZlcl9zZXR0bGVfaWQYBCAC" + - "KAQi8wEKDkN1cnJlbmN5Q29uZmlnEhAKCGN1cnJlbmN5GAEgAigJEhEKCXRp" + - "Y2tfc2l6ZRgCIAIoBBIYChBmbGF0X291dGJpZF9pbmNyGAMgAigEEhkKEXNj" + - "YWxlX291dGJpZF9pbmNyGAQgAigEEh8KF21pbl9zdGFydGluZ191bml0X3By" + - "aWNlGAUgAigEEh8KF21heF9zdGFydGluZ191bml0X3ByaWNlGAYgAigEEhYK" + - "Dm1heF91bml0X3ByaWNlGAcgAigEEhgKEG1heF90b3RhbF9hbW91bnQYCCAC" + - "KAQSEwoLYnV5b3V0X3J1bGUYCSACKAUixgEKEFNwZWNpYWxpc3RDb25maWcS" + - "EgoKc3BlY2lhbGlzdBgBIAIoBRIZChFhdWN0aW9uX2R1cmF0aW9ucxgCIAMo" + - "BBIcChRhdWN0aW9uX3N0YXJ0X2RlbGF5cxgDIAMoBBIkChxhbnRpX3NuaXBp" + - "bmdfZXh0ZW5zaW9uX2RlbGF5GAQgAigEEj8KD2N1cnJlbmN5X2NvbmZpZxgF" + - "IAMoCzImLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuQ3VycmVuY3lDb25maWci" + - "VgoOQmlsbGluZ0FkZHJlc3MSEgoKY291bnRyeV9pZBgBIAIoBRIMCgRjaXR5" + - "GAIgAigJEg0KBXN0YXRlGAMgASgJEhMKC3Bvc3RhbF9jb2RlGAQgASgJItoB" + - "ChFGZWVFc3RpbWF0aW9uRGF0YRIPCgdwcm9ncmFtGAEgAigHEhIKCnNwZWNp" + - "YWxpc3QYAiACKAUSEAoIY3VycmVuY3kYAyACKAkSDgoGc291cmNlGAQgAigH" + - "Eg4KBmFtb3VudBgFIAIoBBItCgxibmV0X2FjY291bnQYBiABKAsyFy5ibmV0" + - "LnByb3RvY29sLkVudGl0eUlkEj8KD2JpbGxpbmdfYWRkcmVzcxgHIAEoCzIm" + - "LmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuQmlsbGluZ0FkZHJlc3M="); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_bnet_protocol_exchange_OrderBook__Descriptor = Descriptor.MessageTypes[0]; - internal__static_bnet_protocol_exchange_OrderBook__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_OrderBook__Descriptor, - new string[] { "Object", "Program", "Compatibility", "Currency", "Specialist", "AllowedRealm", }); - internal__static_bnet_protocol_exchange_OrderBookHandle__Descriptor = Descriptor.MessageTypes[1]; - internal__static_bnet_protocol_exchange_OrderBookHandle__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_OrderBookHandle__Descriptor, - new string[] { "PartitionId", "OrderBookId", }); - internal__static_bnet_protocol_exchange_OrderBookNotification__Descriptor = Descriptor.MessageTypes[2]; - internal__static_bnet_protocol_exchange_OrderBookNotification__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_OrderBookNotification__Descriptor, - new string[] { "OrderBook", "PartitionId", "OrderBookId", "TradeNowPrice", "Status", "UpdateTime", }); - internal__static_bnet_protocol_exchange_OrderBookSummary__Descriptor = Descriptor.MessageTypes[3]; - internal__static_bnet_protocol_exchange_OrderBookSummary__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_OrderBookSummary__Descriptor, - new string[] { "PartitionId", "OrderBookId", "Result", "OrderBook", "Amount", "BestOfferPrice", "BestBidPrice", "EndTime", "Status", "CreatedTime", "ActiveTime", "ClosedTime", "Reason", "OutBidUnitPrice", }); - internal__static_bnet_protocol_exchange_Order__Descriptor = Descriptor.MessageTypes[4]; - internal__static_bnet_protocol_exchange_Order__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_Order__Descriptor, - new string[] { "Amount", "StartTime", "EndTime", "AccountForMoney", "AccountForItem", "BnetAccount", "GameAccount", "Toon", }); - internal__static_bnet_protocol_exchange_Extension__Descriptor = Descriptor.MessageTypes[5]; - internal__static_bnet_protocol_exchange_Extension__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_Extension__Descriptor, - new string[] { "PartitionId", "OrderBookId", "OrderId", "FilledAmount", "OrderStatus", "AuthorizedTime", "CreatedTime", "ClosedTime", "Reason", "OrderBook", "OrderBookStatus", "MoneyToClaim", "ItemsToClaim", }); - internal__static_bnet_protocol_exchange_Offer__Descriptor = Descriptor.MessageTypes[6]; - internal__static_bnet_protocol_exchange_Offer__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_Offer__Descriptor, - new string[] { "Order", "TradeNowPrice", "ReservePrice", "OutBidPrice", }); - internal__static_bnet_protocol_exchange_OfferExtended__Descriptor = Descriptor.MessageTypes[7]; - internal__static_bnet_protocol_exchange_OfferExtended__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_OfferExtended__Descriptor, - new string[] { "Offer", "Extension", "CurrentWinningPrice", }); - internal__static_bnet_protocol_exchange_OfferCreation__Descriptor = Descriptor.MessageTypes[8]; - internal__static_bnet_protocol_exchange_OfferCreation__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_OfferCreation__Descriptor, - new string[] { "Offer", "AuctionDuration", "AuctionStartDelay", "BillingAddress", }); - internal__static_bnet_protocol_exchange_Bid__Descriptor = Descriptor.MessageTypes[9]; - internal__static_bnet_protocol_exchange_Bid__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_Bid__Descriptor, - new string[] { "Order", "CurrentUnitPrice", "MaxUnitPrice", }); - internal__static_bnet_protocol_exchange_BidExtended__Descriptor = Descriptor.MessageTypes[10]; - internal__static_bnet_protocol_exchange_BidExtended__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_BidExtended__Descriptor, - new string[] { "Bid", "Extension", "OfferOutBidPrice", "OfferTradeNowPrice", "OfferCurrentWinningPrice", }); - internal__static_bnet_protocol_exchange_BidCreation__Descriptor = Descriptor.MessageTypes[11]; - internal__static_bnet_protocol_exchange_BidCreation__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_BidCreation__Descriptor, - new string[] { "Bid", "AuctionDuration", "AuctionStartDelay", "BillingAddress", }); - internal__static_bnet_protocol_exchange_QueryFilterByOrderId__Descriptor = Descriptor.MessageTypes[12]; - internal__static_bnet_protocol_exchange_QueryFilterByOrderId__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_QueryFilterByOrderId__Descriptor, - new string[] { "MaxResult", "RefOrderId", }); - internal__static_bnet_protocol_exchange_QueryFilterByCreatedTime__Descriptor = Descriptor.MessageTypes[13]; - internal__static_bnet_protocol_exchange_QueryFilterByCreatedTime__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_QueryFilterByCreatedTime__Descriptor, - new string[] { "MaxResult", "RefCreatedTime", }); - internal__static_bnet_protocol_exchange_Settlement__Descriptor = Descriptor.MessageTypes[14]; - internal__static_bnet_protocol_exchange_Settlement__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_Settlement__Descriptor, - new string[] { "OrderBookId", "MoneyAmount", "ItemsAmount", "OfferSettleId", }); - internal__static_bnet_protocol_exchange_CurrencyConfig__Descriptor = Descriptor.MessageTypes[15]; - internal__static_bnet_protocol_exchange_CurrencyConfig__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_CurrencyConfig__Descriptor, - new string[] { "Currency", "TickSize", "FlatOutbidIncr", "ScaleOutbidIncr", "MinStartingUnitPrice", "MaxStartingUnitPrice", "MaxUnitPrice", "MaxTotalAmount", "BuyoutRule", }); - internal__static_bnet_protocol_exchange_SpecialistConfig__Descriptor = Descriptor.MessageTypes[16]; - internal__static_bnet_protocol_exchange_SpecialistConfig__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_SpecialistConfig__Descriptor, - new string[] { "Specialist", "AuctionDurations", "AuctionStartDelays", "AntiSnipingExtensionDelay", "CurrencyConfig", }); - internal__static_bnet_protocol_exchange_BillingAddress__Descriptor = Descriptor.MessageTypes[17]; - internal__static_bnet_protocol_exchange_BillingAddress__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_BillingAddress__Descriptor, - new string[] { "CountryId", "City", "State", "PostalCode", }); - internal__static_bnet_protocol_exchange_FeeEstimationData__Descriptor = Descriptor.MessageTypes[18]; - internal__static_bnet_protocol_exchange_FeeEstimationData__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_FeeEstimationData__Descriptor, - new string[] { "Program", "Specialist", "Currency", "Source", "Amount", "BnetAccount", "BillingAddress", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::bnet.protocol.Entity.Descriptor, - global::bnet.protocol.exchange.Exchange.Descriptor, - }, assigner); - } - #endregion - - } - #region Messages - public sealed partial class OrderBook : pb::GeneratedMessage { - private static readonly OrderBook defaultInstance = new Builder().BuildPartial(); - public static OrderBook DefaultInstance { - get { return defaultInstance; } - } - - public override OrderBook DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override OrderBook ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_OrderBook__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_OrderBook__FieldAccessorTable; } - } - - public const int ObjectFieldNumber = 1; - private bool hasObject; - private global::bnet.protocol.exchange.BlobOfType object_ = global::bnet.protocol.exchange.BlobOfType.DefaultInstance; - public bool HasObject { - get { return hasObject; } - } - public global::bnet.protocol.exchange.BlobOfType Object { - get { return object_; } - } - - public const int ProgramFieldNumber = 2; - private bool hasProgram; - private uint program_ = 0; - public bool HasProgram { - get { return hasProgram; } - } - public uint Program { - get { return program_; } - } - - public const int CompatibilityFieldNumber = 3; - private bool hasCompatibility; - private uint compatibility_ = 0; - public bool HasCompatibility { - get { return hasCompatibility; } - } - public uint Compatibility { - get { return compatibility_; } - } - - public const int CurrencyFieldNumber = 4; - private bool hasCurrency; - private string currency_ = ""; - public bool HasCurrency { - get { return hasCurrency; } - } - public string Currency { - get { return currency_; } - } - - public const int SpecialistFieldNumber = 5; - private bool hasSpecialist; - private int specialist_ = 0; - public bool HasSpecialist { - get { return hasSpecialist; } - } - public int Specialist { - get { return specialist_; } - } - - public const int AllowedRealmFieldNumber = 6; - private bool hasAllowedRealm; - private uint allowedRealm_ = 0; - public bool HasAllowedRealm { - get { return hasAllowedRealm; } - } - public uint AllowedRealm { - get { return allowedRealm_; } - } - - public override bool IsInitialized { - get { - if (!hasObject) return false; - if (!hasProgram) return false; - if (!hasCompatibility) return false; - if (!hasCurrency) return false; - if (!hasSpecialist) return false; - if (!hasAllowedRealm) return false; - if (!Object.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasObject) { - output.WriteMessage(1, Object); - } - if (HasProgram) { - output.WriteFixed32(2, Program); - } - if (HasCompatibility) { - output.WriteUInt32(3, Compatibility); - } - if (HasCurrency) { - output.WriteString(4, Currency); - } - if (HasSpecialist) { - output.WriteInt32(5, Specialist); - } - if (HasAllowedRealm) { - output.WriteUInt32(6, AllowedRealm); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasObject) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Object); - } - if (HasProgram) { - size += pb::CodedOutputStream.ComputeFixed32Size(2, Program); - } - if (HasCompatibility) { - size += pb::CodedOutputStream.ComputeUInt32Size(3, Compatibility); - } - if (HasCurrency) { - size += pb::CodedOutputStream.ComputeStringSize(4, Currency); - } - if (HasSpecialist) { - size += pb::CodedOutputStream.ComputeInt32Size(5, Specialist); - } - if (HasAllowedRealm) { - size += pb::CodedOutputStream.ComputeUInt32Size(6, AllowedRealm); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static OrderBook ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OrderBook ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OrderBook ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OrderBook ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OrderBook ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OrderBook ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static OrderBook ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static OrderBook ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static OrderBook ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OrderBook ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(OrderBook prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - OrderBook result = new OrderBook(); - - protected override OrderBook MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new OrderBook(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.OrderBook.Descriptor; } - } - - public override OrderBook DefaultInstanceForType { - get { return global::bnet.protocol.exchange.OrderBook.DefaultInstance; } - } - - public override OrderBook BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - OrderBook returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is OrderBook) { - return MergeFrom((OrderBook) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(OrderBook other) { - if (other == global::bnet.protocol.exchange.OrderBook.DefaultInstance) return this; - if (other.HasObject) { - MergeObject(other.Object); - } - if (other.HasProgram) { - Program = other.Program; - } - if (other.HasCompatibility) { - Compatibility = other.Compatibility; - } - if (other.HasCurrency) { - Currency = other.Currency; - } - if (other.HasSpecialist) { - Specialist = other.Specialist; - } - if (other.HasAllowedRealm) { - AllowedRealm = other.AllowedRealm; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.BlobOfType.Builder subBuilder = global::bnet.protocol.exchange.BlobOfType.CreateBuilder(); - if (HasObject) { - subBuilder.MergeFrom(Object); - } - input.ReadMessage(subBuilder, extensionRegistry); - Object = subBuilder.BuildPartial(); - break; - } - case 21: { - Program = input.ReadFixed32(); - break; - } - case 24: { - Compatibility = input.ReadUInt32(); - break; - } - case 34: { - Currency = input.ReadString(); - break; - } - case 40: { - Specialist = input.ReadInt32(); - break; - } - case 48: { - AllowedRealm = input.ReadUInt32(); - break; - } - } - } - } - - - public bool HasObject { - get { return result.HasObject; } - } - public global::bnet.protocol.exchange.BlobOfType Object { - get { return result.Object; } - set { SetObject(value); } - } - public Builder SetObject(global::bnet.protocol.exchange.BlobOfType value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasObject = true; - result.object_ = value; - return this; - } - public Builder SetObject(global::bnet.protocol.exchange.BlobOfType.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasObject = true; - result.object_ = builderForValue.Build(); - return this; - } - public Builder MergeObject(global::bnet.protocol.exchange.BlobOfType value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasObject && - result.object_ != global::bnet.protocol.exchange.BlobOfType.DefaultInstance) { - result.object_ = global::bnet.protocol.exchange.BlobOfType.CreateBuilder(result.object_).MergeFrom(value).BuildPartial(); - } else { - result.object_ = value; - } - result.hasObject = true; - return this; - } - public Builder ClearObject() { - result.hasObject = false; - result.object_ = global::bnet.protocol.exchange.BlobOfType.DefaultInstance; - return this; - } - - public bool HasProgram { - get { return result.HasProgram; } - } - public uint Program { - get { return result.Program; } - set { SetProgram(value); } - } - public Builder SetProgram(uint value) { - result.hasProgram = true; - result.program_ = value; - return this; - } - public Builder ClearProgram() { - result.hasProgram = false; - result.program_ = 0; - return this; - } - - public bool HasCompatibility { - get { return result.HasCompatibility; } - } - public uint Compatibility { - get { return result.Compatibility; } - set { SetCompatibility(value); } - } - public Builder SetCompatibility(uint value) { - result.hasCompatibility = true; - result.compatibility_ = value; - return this; - } - public Builder ClearCompatibility() { - result.hasCompatibility = false; - result.compatibility_ = 0; - return this; - } - - public bool HasCurrency { - get { return result.HasCurrency; } - } - public string Currency { - get { return result.Currency; } - set { SetCurrency(value); } - } - public Builder SetCurrency(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasCurrency = true; - result.currency_ = value; - return this; - } - public Builder ClearCurrency() { - result.hasCurrency = false; - result.currency_ = ""; - return this; - } - - public bool HasSpecialist { - get { return result.HasSpecialist; } - } - public int Specialist { - get { return result.Specialist; } - set { SetSpecialist(value); } - } - public Builder SetSpecialist(int value) { - result.hasSpecialist = true; - result.specialist_ = value; - return this; - } - public Builder ClearSpecialist() { - result.hasSpecialist = false; - result.specialist_ = 0; - return this; - } - - public bool HasAllowedRealm { - get { return result.HasAllowedRealm; } - } - public uint AllowedRealm { - get { return result.AllowedRealm; } - set { SetAllowedRealm(value); } - } - public Builder SetAllowedRealm(uint value) { - result.hasAllowedRealm = true; - result.allowedRealm_ = value; - return this; - } - public Builder ClearAllowedRealm() { - result.hasAllowedRealm = false; - result.allowedRealm_ = 0; - return this; - } - } - static OrderBook() { - object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); - } - } - - public sealed partial class OrderBookHandle : pb::GeneratedMessage { - private static readonly OrderBookHandle defaultInstance = new Builder().BuildPartial(); - public static OrderBookHandle DefaultInstance { - get { return defaultInstance; } - } - - public override OrderBookHandle DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override OrderBookHandle ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_OrderBookHandle__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_OrderBookHandle__FieldAccessorTable; } - } - - public const int PartitionIdFieldNumber = 1; - private bool hasPartitionId; - private global::bnet.protocol.exchange.PartitionId partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - public bool HasPartitionId { - get { return hasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return partitionId_; } - } - - public const int OrderBookIdFieldNumber = 2; - private bool hasOrderBookId; - private ulong orderBookId_ = 0UL; - public bool HasOrderBookId { - get { return hasOrderBookId; } - } - public ulong OrderBookId { - get { return orderBookId_; } - } - - public override bool IsInitialized { - get { - if (!hasPartitionId) return false; - if (!hasOrderBookId) return false; - if (!PartitionId.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasPartitionId) { - output.WriteMessage(1, PartitionId); - } - if (HasOrderBookId) { - output.WriteUInt64(2, OrderBookId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasPartitionId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); - } - if (HasOrderBookId) { - size += pb::CodedOutputStream.ComputeUInt64Size(2, OrderBookId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static OrderBookHandle ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OrderBookHandle ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OrderBookHandle ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OrderBookHandle ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OrderBookHandle ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OrderBookHandle ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static OrderBookHandle ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static OrderBookHandle ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static OrderBookHandle ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OrderBookHandle ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(OrderBookHandle prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - OrderBookHandle result = new OrderBookHandle(); - - protected override OrderBookHandle MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new OrderBookHandle(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.OrderBookHandle.Descriptor; } - } - - public override OrderBookHandle DefaultInstanceForType { - get { return global::bnet.protocol.exchange.OrderBookHandle.DefaultInstance; } - } - - public override OrderBookHandle BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - OrderBookHandle returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is OrderBookHandle) { - return MergeFrom((OrderBookHandle) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(OrderBookHandle other) { - if (other == global::bnet.protocol.exchange.OrderBookHandle.DefaultInstance) return this; - if (other.HasPartitionId) { - MergePartitionId(other.PartitionId); - } - if (other.HasOrderBookId) { - OrderBookId = other.OrderBookId; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { - subBuilder.MergeFrom(PartitionId); - } - input.ReadMessage(subBuilder, extensionRegistry); - PartitionId = subBuilder.BuildPartial(); - break; - } - case 16: { - OrderBookId = input.ReadUInt64(); - break; - } - } - } - } - - - public bool HasPartitionId { - get { return result.HasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return result.PartitionId; } - set { SetPartitionId(value); } - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasPartitionId = true; - result.partitionId_ = value; - return this; - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasPartitionId = true; - result.partitionId_ = builderForValue.Build(); - return this; - } - public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasPartitionId && - result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); - } else { - result.partitionId_ = value; - } - result.hasPartitionId = true; - return this; - } - public Builder ClearPartitionId() { - result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - return this; - } - - public bool HasOrderBookId { - get { return result.HasOrderBookId; } - } - public ulong OrderBookId { - get { return result.OrderBookId; } - set { SetOrderBookId(value); } - } - public Builder SetOrderBookId(ulong value) { - result.hasOrderBookId = true; - result.orderBookId_ = value; - return this; - } - public Builder ClearOrderBookId() { - result.hasOrderBookId = false; - result.orderBookId_ = 0UL; - return this; - } - } - static OrderBookHandle() { - object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); - } - } - - public sealed partial class OrderBookNotification : pb::GeneratedMessage { - private static readonly OrderBookNotification defaultInstance = new Builder().BuildPartial(); - public static OrderBookNotification DefaultInstance { - get { return defaultInstance; } - } - - public override OrderBookNotification DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override OrderBookNotification ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_OrderBookNotification__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_OrderBookNotification__FieldAccessorTable; } - } - - public const int OrderBookFieldNumber = 1; - private bool hasOrderBook; - private global::bnet.protocol.exchange.OrderBook orderBook_ = global::bnet.protocol.exchange.OrderBook.DefaultInstance; - public bool HasOrderBook { - get { return hasOrderBook; } - } - public global::bnet.protocol.exchange.OrderBook OrderBook { - get { return orderBook_; } - } - - public const int PartitionIdFieldNumber = 2; - private bool hasPartitionId; - private global::bnet.protocol.exchange.PartitionId partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - public bool HasPartitionId { - get { return hasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return partitionId_; } - } - - public const int OrderBookIdFieldNumber = 3; - private bool hasOrderBookId; - private ulong orderBookId_ = 0UL; - public bool HasOrderBookId { - get { return hasOrderBookId; } - } - public ulong OrderBookId { - get { return orderBookId_; } - } - - public const int TradeNowPriceFieldNumber = 4; - private bool hasTradeNowPrice; - private ulong tradeNowPrice_ = 0UL; - public bool HasTradeNowPrice { - get { return hasTradeNowPrice; } - } - public ulong TradeNowPrice { - get { return tradeNowPrice_; } - } - - public const int StatusFieldNumber = 5; - private bool hasStatus; - private uint status_ = 0; - public bool HasStatus { - get { return hasStatus; } - } - public uint Status { - get { return status_; } - } - - public const int UpdateTimeFieldNumber = 6; - private bool hasUpdateTime; - private ulong updateTime_ = 0UL; - public bool HasUpdateTime { - get { return hasUpdateTime; } - } - public ulong UpdateTime { - get { return updateTime_; } - } - - public override bool IsInitialized { - get { - if (!hasOrderBook) return false; - if (!hasPartitionId) return false; - if (!hasOrderBookId) return false; - if (!hasStatus) return false; - if (!hasUpdateTime) return false; - if (!OrderBook.IsInitialized) return false; - if (!PartitionId.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasOrderBook) { - output.WriteMessage(1, OrderBook); - } - if (HasPartitionId) { - output.WriteMessage(2, PartitionId); - } - if (HasOrderBookId) { - output.WriteUInt64(3, OrderBookId); - } - if (HasTradeNowPrice) { - output.WriteUInt64(4, TradeNowPrice); - } - if (HasStatus) { - output.WriteUInt32(5, Status); - } - if (HasUpdateTime) { - output.WriteUInt64(6, UpdateTime); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasOrderBook) { - size += pb::CodedOutputStream.ComputeMessageSize(1, OrderBook); - } - if (HasPartitionId) { - size += pb::CodedOutputStream.ComputeMessageSize(2, PartitionId); - } - if (HasOrderBookId) { - size += pb::CodedOutputStream.ComputeUInt64Size(3, OrderBookId); - } - if (HasTradeNowPrice) { - size += pb::CodedOutputStream.ComputeUInt64Size(4, TradeNowPrice); - } - if (HasStatus) { - size += pb::CodedOutputStream.ComputeUInt32Size(5, Status); - } - if (HasUpdateTime) { - size += pb::CodedOutputStream.ComputeUInt64Size(6, UpdateTime); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static OrderBookNotification ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OrderBookNotification ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OrderBookNotification ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OrderBookNotification ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OrderBookNotification ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OrderBookNotification ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static OrderBookNotification ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static OrderBookNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static OrderBookNotification ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OrderBookNotification ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(OrderBookNotification prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - OrderBookNotification result = new OrderBookNotification(); - - protected override OrderBookNotification MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new OrderBookNotification(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.OrderBookNotification.Descriptor; } - } - - public override OrderBookNotification DefaultInstanceForType { - get { return global::bnet.protocol.exchange.OrderBookNotification.DefaultInstance; } - } - - public override OrderBookNotification BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - OrderBookNotification returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is OrderBookNotification) { - return MergeFrom((OrderBookNotification) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(OrderBookNotification other) { - if (other == global::bnet.protocol.exchange.OrderBookNotification.DefaultInstance) return this; - if (other.HasOrderBook) { - MergeOrderBook(other.OrderBook); - } - if (other.HasPartitionId) { - MergePartitionId(other.PartitionId); - } - if (other.HasOrderBookId) { - OrderBookId = other.OrderBookId; - } - if (other.HasTradeNowPrice) { - TradeNowPrice = other.TradeNowPrice; - } - if (other.HasStatus) { - Status = other.Status; - } - if (other.HasUpdateTime) { - UpdateTime = other.UpdateTime; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.OrderBook.Builder subBuilder = global::bnet.protocol.exchange.OrderBook.CreateBuilder(); - if (HasOrderBook) { - subBuilder.MergeFrom(OrderBook); - } - input.ReadMessage(subBuilder, extensionRegistry); - OrderBook = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { - subBuilder.MergeFrom(PartitionId); - } - input.ReadMessage(subBuilder, extensionRegistry); - PartitionId = subBuilder.BuildPartial(); - break; - } - case 24: { - OrderBookId = input.ReadUInt64(); - break; - } - case 32: { - TradeNowPrice = input.ReadUInt64(); - break; - } - case 40: { - Status = input.ReadUInt32(); - break; - } - case 48: { - UpdateTime = input.ReadUInt64(); - break; - } - } - } - } - - - public bool HasOrderBook { - get { return result.HasOrderBook; } - } - public global::bnet.protocol.exchange.OrderBook OrderBook { - get { return result.OrderBook; } - set { SetOrderBook(value); } - } - public Builder SetOrderBook(global::bnet.protocol.exchange.OrderBook value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasOrderBook = true; - result.orderBook_ = value; - return this; - } - public Builder SetOrderBook(global::bnet.protocol.exchange.OrderBook.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasOrderBook = true; - result.orderBook_ = builderForValue.Build(); - return this; - } - public Builder MergeOrderBook(global::bnet.protocol.exchange.OrderBook value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasOrderBook && - result.orderBook_ != global::bnet.protocol.exchange.OrderBook.DefaultInstance) { - result.orderBook_ = global::bnet.protocol.exchange.OrderBook.CreateBuilder(result.orderBook_).MergeFrom(value).BuildPartial(); - } else { - result.orderBook_ = value; - } - result.hasOrderBook = true; - return this; - } - public Builder ClearOrderBook() { - result.hasOrderBook = false; - result.orderBook_ = global::bnet.protocol.exchange.OrderBook.DefaultInstance; - return this; - } - - public bool HasPartitionId { - get { return result.HasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return result.PartitionId; } - set { SetPartitionId(value); } - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasPartitionId = true; - result.partitionId_ = value; - return this; - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasPartitionId = true; - result.partitionId_ = builderForValue.Build(); - return this; - } - public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasPartitionId && - result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); - } else { - result.partitionId_ = value; - } - result.hasPartitionId = true; - return this; - } - public Builder ClearPartitionId() { - result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - return this; - } - - public bool HasOrderBookId { - get { return result.HasOrderBookId; } - } - public ulong OrderBookId { - get { return result.OrderBookId; } - set { SetOrderBookId(value); } - } - public Builder SetOrderBookId(ulong value) { - result.hasOrderBookId = true; - result.orderBookId_ = value; - return this; - } - public Builder ClearOrderBookId() { - result.hasOrderBookId = false; - result.orderBookId_ = 0UL; - return this; - } - - public bool HasTradeNowPrice { - get { return result.HasTradeNowPrice; } - } - public ulong TradeNowPrice { - get { return result.TradeNowPrice; } - set { SetTradeNowPrice(value); } - } - public Builder SetTradeNowPrice(ulong value) { - result.hasTradeNowPrice = true; - result.tradeNowPrice_ = value; - return this; - } - public Builder ClearTradeNowPrice() { - result.hasTradeNowPrice = false; - result.tradeNowPrice_ = 0UL; - return this; - } - - public bool HasStatus { - get { return result.HasStatus; } - } - public uint Status { - get { return result.Status; } - set { SetStatus(value); } - } - public Builder SetStatus(uint value) { - result.hasStatus = true; - result.status_ = value; - return this; - } - public Builder ClearStatus() { - result.hasStatus = false; - result.status_ = 0; - return this; - } - - public bool HasUpdateTime { - get { return result.HasUpdateTime; } - } - public ulong UpdateTime { - get { return result.UpdateTime; } - set { SetUpdateTime(value); } - } - public Builder SetUpdateTime(ulong value) { - result.hasUpdateTime = true; - result.updateTime_ = value; - return this; - } - public Builder ClearUpdateTime() { - result.hasUpdateTime = false; - result.updateTime_ = 0UL; - return this; - } - } - static OrderBookNotification() { - object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); - } - } - - public sealed partial class OrderBookSummary : pb::GeneratedMessage { - private static readonly OrderBookSummary defaultInstance = new Builder().BuildPartial(); - public static OrderBookSummary DefaultInstance { - get { return defaultInstance; } - } - - public override OrderBookSummary DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override OrderBookSummary ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_OrderBookSummary__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_OrderBookSummary__FieldAccessorTable; } - } - - public const int PartitionIdFieldNumber = 1; - private bool hasPartitionId; - private global::bnet.protocol.exchange.PartitionId partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - public bool HasPartitionId { - get { return hasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return partitionId_; } - } - - public const int OrderBookIdFieldNumber = 2; - private bool hasOrderBookId; - private ulong orderBookId_ = 0UL; - public bool HasOrderBookId { - get { return hasOrderBookId; } - } - public ulong OrderBookId { - get { return orderBookId_; } - } - - public const int ResultFieldNumber = 3; - private bool hasResult; - private uint result_ = 0; - public bool HasResult { - get { return hasResult; } - } - public uint Result { - get { return result_; } - } - - public const int OrderBookFieldNumber = 4; - private bool hasOrderBook; - private global::bnet.protocol.exchange.OrderBook orderBook_ = global::bnet.protocol.exchange.OrderBook.DefaultInstance; - public bool HasOrderBook { - get { return hasOrderBook; } - } - public global::bnet.protocol.exchange.OrderBook OrderBook { - get { return orderBook_; } - } - - public const int AmountFieldNumber = 5; - private bool hasAmount; - private ulong amount_ = 0UL; - public bool HasAmount { - get { return hasAmount; } - } - public ulong Amount { - get { return amount_; } - } - - public const int BestOfferPriceFieldNumber = 6; - private bool hasBestOfferPrice; - private ulong bestOfferPrice_ = 0UL; - public bool HasBestOfferPrice { - get { return hasBestOfferPrice; } - } - public ulong BestOfferPrice { - get { return bestOfferPrice_; } - } - - public const int BestBidPriceFieldNumber = 7; - private bool hasBestBidPrice; - private ulong bestBidPrice_ = 0UL; - public bool HasBestBidPrice { - get { return hasBestBidPrice; } - } - public ulong BestBidPrice { - get { return bestBidPrice_; } - } - - public const int EndTimeFieldNumber = 8; - private bool hasEndTime; - private ulong endTime_ = 0UL; - public bool HasEndTime { - get { return hasEndTime; } - } - public ulong EndTime { - get { return endTime_; } - } - - public const int StatusFieldNumber = 9; - private bool hasStatus; - private int status_ = 0; - public bool HasStatus { - get { return hasStatus; } - } - public int Status { - get { return status_; } - } - - public const int CreatedTimeFieldNumber = 10; - private bool hasCreatedTime; - private ulong createdTime_ = 0UL; - public bool HasCreatedTime { - get { return hasCreatedTime; } - } - public ulong CreatedTime { - get { return createdTime_; } - } - - public const int ActiveTimeFieldNumber = 11; - private bool hasActiveTime; - private ulong activeTime_ = 0UL; - public bool HasActiveTime { - get { return hasActiveTime; } - } - public ulong ActiveTime { - get { return activeTime_; } - } - - public const int ClosedTimeFieldNumber = 12; - private bool hasClosedTime; - private ulong closedTime_ = 0UL; - public bool HasClosedTime { - get { return hasClosedTime; } - } - public ulong ClosedTime { - get { return closedTime_; } - } - - public const int ReasonFieldNumber = 13; - private bool hasReason; - private uint reason_ = 0; - public bool HasReason { - get { return hasReason; } - } - public uint Reason { - get { return reason_; } - } - - public const int OutBidUnitPriceFieldNumber = 14; - private bool hasOutBidUnitPrice; - private ulong outBidUnitPrice_ = 0UL; - public bool HasOutBidUnitPrice { - get { return hasOutBidUnitPrice; } - } - public ulong OutBidUnitPrice { - get { return outBidUnitPrice_; } - } - - public override bool IsInitialized { - get { - if (!hasPartitionId) return false; - if (!hasOrderBookId) return false; - if (!hasResult) return false; - if (!PartitionId.IsInitialized) return false; - if (HasOrderBook) { - if (!OrderBook.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasPartitionId) { - output.WriteMessage(1, PartitionId); - } - if (HasOrderBookId) { - output.WriteUInt64(2, OrderBookId); - } - if (HasResult) { - output.WriteUInt32(3, Result); - } - if (HasOrderBook) { - output.WriteMessage(4, OrderBook); - } - if (HasAmount) { - output.WriteUInt64(5, Amount); - } - if (HasBestOfferPrice) { - output.WriteUInt64(6, BestOfferPrice); - } - if (HasBestBidPrice) { - output.WriteUInt64(7, BestBidPrice); - } - if (HasEndTime) { - output.WriteUInt64(8, EndTime); - } - if (HasStatus) { - output.WriteInt32(9, Status); - } - if (HasCreatedTime) { - output.WriteUInt64(10, CreatedTime); - } - if (HasActiveTime) { - output.WriteUInt64(11, ActiveTime); - } - if (HasClosedTime) { - output.WriteUInt64(12, ClosedTime); - } - if (HasReason) { - output.WriteUInt32(13, Reason); - } - if (HasOutBidUnitPrice) { - output.WriteUInt64(14, OutBidUnitPrice); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasPartitionId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); - } - if (HasOrderBookId) { - size += pb::CodedOutputStream.ComputeUInt64Size(2, OrderBookId); - } - if (HasResult) { - size += pb::CodedOutputStream.ComputeUInt32Size(3, Result); - } - if (HasOrderBook) { - size += pb::CodedOutputStream.ComputeMessageSize(4, OrderBook); - } - if (HasAmount) { - size += pb::CodedOutputStream.ComputeUInt64Size(5, Amount); - } - if (HasBestOfferPrice) { - size += pb::CodedOutputStream.ComputeUInt64Size(6, BestOfferPrice); - } - if (HasBestBidPrice) { - size += pb::CodedOutputStream.ComputeUInt64Size(7, BestBidPrice); - } - if (HasEndTime) { - size += pb::CodedOutputStream.ComputeUInt64Size(8, EndTime); - } - if (HasStatus) { - size += pb::CodedOutputStream.ComputeInt32Size(9, Status); - } - if (HasCreatedTime) { - size += pb::CodedOutputStream.ComputeUInt64Size(10, CreatedTime); - } - if (HasActiveTime) { - size += pb::CodedOutputStream.ComputeUInt64Size(11, ActiveTime); - } - if (HasClosedTime) { - size += pb::CodedOutputStream.ComputeUInt64Size(12, ClosedTime); - } - if (HasReason) { - size += pb::CodedOutputStream.ComputeUInt32Size(13, Reason); - } - if (HasOutBidUnitPrice) { - size += pb::CodedOutputStream.ComputeUInt64Size(14, OutBidUnitPrice); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static OrderBookSummary ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OrderBookSummary ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OrderBookSummary ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OrderBookSummary ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OrderBookSummary ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OrderBookSummary ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static OrderBookSummary ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static OrderBookSummary ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static OrderBookSummary ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OrderBookSummary ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(OrderBookSummary prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - OrderBookSummary result = new OrderBookSummary(); - - protected override OrderBookSummary MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new OrderBookSummary(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.OrderBookSummary.Descriptor; } - } - - public override OrderBookSummary DefaultInstanceForType { - get { return global::bnet.protocol.exchange.OrderBookSummary.DefaultInstance; } - } - - public override OrderBookSummary BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - OrderBookSummary returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is OrderBookSummary) { - return MergeFrom((OrderBookSummary) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(OrderBookSummary other) { - if (other == global::bnet.protocol.exchange.OrderBookSummary.DefaultInstance) return this; - if (other.HasPartitionId) { - MergePartitionId(other.PartitionId); - } - if (other.HasOrderBookId) { - OrderBookId = other.OrderBookId; - } - if (other.HasResult) { - Result = other.Result; - } - if (other.HasOrderBook) { - MergeOrderBook(other.OrderBook); - } - if (other.HasAmount) { - Amount = other.Amount; - } - if (other.HasBestOfferPrice) { - BestOfferPrice = other.BestOfferPrice; - } - if (other.HasBestBidPrice) { - BestBidPrice = other.BestBidPrice; - } - if (other.HasEndTime) { - EndTime = other.EndTime; - } - if (other.HasStatus) { - Status = other.Status; - } - if (other.HasCreatedTime) { - CreatedTime = other.CreatedTime; - } - if (other.HasActiveTime) { - ActiveTime = other.ActiveTime; - } - if (other.HasClosedTime) { - ClosedTime = other.ClosedTime; - } - if (other.HasReason) { - Reason = other.Reason; - } - if (other.HasOutBidUnitPrice) { - OutBidUnitPrice = other.OutBidUnitPrice; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { - subBuilder.MergeFrom(PartitionId); - } - input.ReadMessage(subBuilder, extensionRegistry); - PartitionId = subBuilder.BuildPartial(); - break; - } - case 16: { - OrderBookId = input.ReadUInt64(); - break; - } - case 24: { - Result = input.ReadUInt32(); - break; - } - case 34: { - global::bnet.protocol.exchange.OrderBook.Builder subBuilder = global::bnet.protocol.exchange.OrderBook.CreateBuilder(); - if (HasOrderBook) { - subBuilder.MergeFrom(OrderBook); - } - input.ReadMessage(subBuilder, extensionRegistry); - OrderBook = subBuilder.BuildPartial(); - break; - } - case 40: { - Amount = input.ReadUInt64(); - break; - } - case 48: { - BestOfferPrice = input.ReadUInt64(); - break; - } - case 56: { - BestBidPrice = input.ReadUInt64(); - break; - } - case 64: { - EndTime = input.ReadUInt64(); - break; - } - case 72: { - Status = input.ReadInt32(); - break; - } - case 80: { - CreatedTime = input.ReadUInt64(); - break; - } - case 88: { - ActiveTime = input.ReadUInt64(); - break; - } - case 96: { - ClosedTime = input.ReadUInt64(); - break; - } - case 104: { - Reason = input.ReadUInt32(); - break; - } - case 112: { - OutBidUnitPrice = input.ReadUInt64(); - break; - } - } - } - } - - - public bool HasPartitionId { - get { return result.HasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return result.PartitionId; } - set { SetPartitionId(value); } - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasPartitionId = true; - result.partitionId_ = value; - return this; - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasPartitionId = true; - result.partitionId_ = builderForValue.Build(); - return this; - } - public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasPartitionId && - result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); - } else { - result.partitionId_ = value; - } - result.hasPartitionId = true; - return this; - } - public Builder ClearPartitionId() { - result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - return this; - } - - public bool HasOrderBookId { - get { return result.HasOrderBookId; } - } - public ulong OrderBookId { - get { return result.OrderBookId; } - set { SetOrderBookId(value); } - } - public Builder SetOrderBookId(ulong value) { - result.hasOrderBookId = true; - result.orderBookId_ = value; - return this; - } - public Builder ClearOrderBookId() { - result.hasOrderBookId = false; - result.orderBookId_ = 0UL; - return this; - } - - public bool HasResult { - get { return result.HasResult; } - } - public uint Result { - get { return result.Result; } - set { SetResult(value); } - } - public Builder SetResult(uint value) { - result.hasResult = true; - result.result_ = value; - return this; - } - public Builder ClearResult() { - result.hasResult = false; - result.result_ = 0; - return this; - } - - public bool HasOrderBook { - get { return result.HasOrderBook; } - } - public global::bnet.protocol.exchange.OrderBook OrderBook { - get { return result.OrderBook; } - set { SetOrderBook(value); } - } - public Builder SetOrderBook(global::bnet.protocol.exchange.OrderBook value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasOrderBook = true; - result.orderBook_ = value; - return this; - } - public Builder SetOrderBook(global::bnet.protocol.exchange.OrderBook.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasOrderBook = true; - result.orderBook_ = builderForValue.Build(); - return this; - } - public Builder MergeOrderBook(global::bnet.protocol.exchange.OrderBook value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasOrderBook && - result.orderBook_ != global::bnet.protocol.exchange.OrderBook.DefaultInstance) { - result.orderBook_ = global::bnet.protocol.exchange.OrderBook.CreateBuilder(result.orderBook_).MergeFrom(value).BuildPartial(); - } else { - result.orderBook_ = value; - } - result.hasOrderBook = true; - return this; - } - public Builder ClearOrderBook() { - result.hasOrderBook = false; - result.orderBook_ = global::bnet.protocol.exchange.OrderBook.DefaultInstance; - return this; - } - - public bool HasAmount { - get { return result.HasAmount; } - } - public ulong Amount { - get { return result.Amount; } - set { SetAmount(value); } - } - public Builder SetAmount(ulong value) { - result.hasAmount = true; - result.amount_ = value; - return this; - } - public Builder ClearAmount() { - result.hasAmount = false; - result.amount_ = 0UL; - return this; - } - - public bool HasBestOfferPrice { - get { return result.HasBestOfferPrice; } - } - public ulong BestOfferPrice { - get { return result.BestOfferPrice; } - set { SetBestOfferPrice(value); } - } - public Builder SetBestOfferPrice(ulong value) { - result.hasBestOfferPrice = true; - result.bestOfferPrice_ = value; - return this; - } - public Builder ClearBestOfferPrice() { - result.hasBestOfferPrice = false; - result.bestOfferPrice_ = 0UL; - return this; - } - - public bool HasBestBidPrice { - get { return result.HasBestBidPrice; } - } - public ulong BestBidPrice { - get { return result.BestBidPrice; } - set { SetBestBidPrice(value); } - } - public Builder SetBestBidPrice(ulong value) { - result.hasBestBidPrice = true; - result.bestBidPrice_ = value; - return this; - } - public Builder ClearBestBidPrice() { - result.hasBestBidPrice = false; - result.bestBidPrice_ = 0UL; - return this; - } - - public bool HasEndTime { - get { return result.HasEndTime; } - } - public ulong EndTime { - get { return result.EndTime; } - set { SetEndTime(value); } - } - public Builder SetEndTime(ulong value) { - result.hasEndTime = true; - result.endTime_ = value; - return this; - } - public Builder ClearEndTime() { - result.hasEndTime = false; - result.endTime_ = 0UL; - return this; - } - - public bool HasStatus { - get { return result.HasStatus; } - } - public int Status { - get { return result.Status; } - set { SetStatus(value); } - } - public Builder SetStatus(int value) { - result.hasStatus = true; - result.status_ = value; - return this; - } - public Builder ClearStatus() { - result.hasStatus = false; - result.status_ = 0; - return this; - } - - public bool HasCreatedTime { - get { return result.HasCreatedTime; } - } - public ulong CreatedTime { - get { return result.CreatedTime; } - set { SetCreatedTime(value); } - } - public Builder SetCreatedTime(ulong value) { - result.hasCreatedTime = true; - result.createdTime_ = value; - return this; - } - public Builder ClearCreatedTime() { - result.hasCreatedTime = false; - result.createdTime_ = 0UL; - return this; - } - - public bool HasActiveTime { - get { return result.HasActiveTime; } - } - public ulong ActiveTime { - get { return result.ActiveTime; } - set { SetActiveTime(value); } - } - public Builder SetActiveTime(ulong value) { - result.hasActiveTime = true; - result.activeTime_ = value; - return this; - } - public Builder ClearActiveTime() { - result.hasActiveTime = false; - result.activeTime_ = 0UL; - return this; - } - - public bool HasClosedTime { - get { return result.HasClosedTime; } - } - public ulong ClosedTime { - get { return result.ClosedTime; } - set { SetClosedTime(value); } - } - public Builder SetClosedTime(ulong value) { - result.hasClosedTime = true; - result.closedTime_ = value; - return this; - } - public Builder ClearClosedTime() { - result.hasClosedTime = false; - result.closedTime_ = 0UL; - return this; - } - - public bool HasReason { - get { return result.HasReason; } - } - public uint Reason { - get { return result.Reason; } - set { SetReason(value); } - } - public Builder SetReason(uint value) { - result.hasReason = true; - result.reason_ = value; - return this; - } - public Builder ClearReason() { - result.hasReason = false; - result.reason_ = 0; - return this; - } - - public bool HasOutBidUnitPrice { - get { return result.HasOutBidUnitPrice; } - } - public ulong OutBidUnitPrice { - get { return result.OutBidUnitPrice; } - set { SetOutBidUnitPrice(value); } - } - public Builder SetOutBidUnitPrice(ulong value) { - result.hasOutBidUnitPrice = true; - result.outBidUnitPrice_ = value; - return this; - } - public Builder ClearOutBidUnitPrice() { - result.hasOutBidUnitPrice = false; - result.outBidUnitPrice_ = 0UL; - return this; - } - } - static OrderBookSummary() { - object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); - } - } - - public sealed partial class Order : pb::GeneratedMessage { - private static readonly Order defaultInstance = new Builder().BuildPartial(); - public static Order DefaultInstance { - get { return defaultInstance; } - } - - public override Order DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override Order ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_Order__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_Order__FieldAccessorTable; } - } - - public const int AmountFieldNumber = 1; - private bool hasAmount; - private uint amount_ = 0; - public bool HasAmount { - get { return hasAmount; } - } - public uint Amount { - get { return amount_; } - } - - public const int StartTimeFieldNumber = 2; - private bool hasStartTime; - private ulong startTime_ = 0UL; - public bool HasStartTime { - get { return hasStartTime; } - } - public ulong StartTime { - get { return startTime_; } - } - - public const int EndTimeFieldNumber = 3; - private bool hasEndTime; - private ulong endTime_ = 0UL; - public bool HasEndTime { - get { return hasEndTime; } - } - public ulong EndTime { - get { return endTime_; } - } - - public const int AccountForMoneyFieldNumber = 4; - private bool hasAccountForMoney; - private global::bnet.protocol.exchange.BlobFrom accountForMoney_ = global::bnet.protocol.exchange.BlobFrom.DefaultInstance; - public bool HasAccountForMoney { - get { return hasAccountForMoney; } - } - public global::bnet.protocol.exchange.BlobFrom AccountForMoney { - get { return accountForMoney_; } - } - - public const int AccountForItemFieldNumber = 5; - private bool hasAccountForItem; - private global::bnet.protocol.exchange.BlobFrom accountForItem_ = global::bnet.protocol.exchange.BlobFrom.DefaultInstance; - public bool HasAccountForItem { - get { return hasAccountForItem; } - } - public global::bnet.protocol.exchange.BlobFrom AccountForItem { - get { return accountForItem_; } - } - - public const int BnetAccountFieldNumber = 6; - private bool hasBnetAccount; - private global::bnet.protocol.EntityId bnetAccount_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasBnetAccount { - get { return hasBnetAccount; } - } - public global::bnet.protocol.EntityId BnetAccount { - get { return bnetAccount_; } - } - - public const int GameAccountFieldNumber = 7; - private bool hasGameAccount; - private global::bnet.protocol.EntityId gameAccount_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasGameAccount { - get { return hasGameAccount; } - } - public global::bnet.protocol.EntityId GameAccount { - get { return gameAccount_; } - } - - public const int ToonFieldNumber = 8; - private bool hasToon; - private global::bnet.protocol.EntityId toon_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasToon { - get { return hasToon; } - } - public global::bnet.protocol.EntityId Toon { - get { return toon_; } - } - - public override bool IsInitialized { - get { - if (!hasAmount) return false; - if (HasAccountForMoney) { - if (!AccountForMoney.IsInitialized) return false; - } - if (HasAccountForItem) { - if (!AccountForItem.IsInitialized) return false; - } - if (HasBnetAccount) { - if (!BnetAccount.IsInitialized) return false; - } - if (HasGameAccount) { - if (!GameAccount.IsInitialized) return false; - } - if (HasToon) { - if (!Toon.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasAmount) { - output.WriteUInt32(1, Amount); - } - if (HasStartTime) { - output.WriteUInt64(2, StartTime); - } - if (HasEndTime) { - output.WriteUInt64(3, EndTime); - } - if (HasAccountForMoney) { - output.WriteMessage(4, AccountForMoney); - } - if (HasAccountForItem) { - output.WriteMessage(5, AccountForItem); - } - if (HasBnetAccount) { - output.WriteMessage(6, BnetAccount); - } - if (HasGameAccount) { - output.WriteMessage(7, GameAccount); - } - if (HasToon) { - output.WriteMessage(8, Toon); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasAmount) { - size += pb::CodedOutputStream.ComputeUInt32Size(1, Amount); - } - if (HasStartTime) { - size += pb::CodedOutputStream.ComputeUInt64Size(2, StartTime); - } - if (HasEndTime) { - size += pb::CodedOutputStream.ComputeUInt64Size(3, EndTime); - } - if (HasAccountForMoney) { - size += pb::CodedOutputStream.ComputeMessageSize(4, AccountForMoney); - } - if (HasAccountForItem) { - size += pb::CodedOutputStream.ComputeMessageSize(5, AccountForItem); - } - if (HasBnetAccount) { - size += pb::CodedOutputStream.ComputeMessageSize(6, BnetAccount); - } - if (HasGameAccount) { - size += pb::CodedOutputStream.ComputeMessageSize(7, GameAccount); - } - if (HasToon) { - size += pb::CodedOutputStream.ComputeMessageSize(8, Toon); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static Order ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Order ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Order ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Order ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Order ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Order ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Order ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Order ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Order ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Order ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Order prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - Order result = new Order(); - - protected override Order MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new Order(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.Order.Descriptor; } - } - - public override Order DefaultInstanceForType { - get { return global::bnet.protocol.exchange.Order.DefaultInstance; } - } - - public override Order BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - Order returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Order) { - return MergeFrom((Order) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Order other) { - if (other == global::bnet.protocol.exchange.Order.DefaultInstance) return this; - if (other.HasAmount) { - Amount = other.Amount; - } - if (other.HasStartTime) { - StartTime = other.StartTime; - } - if (other.HasEndTime) { - EndTime = other.EndTime; - } - if (other.HasAccountForMoney) { - MergeAccountForMoney(other.AccountForMoney); - } - if (other.HasAccountForItem) { - MergeAccountForItem(other.AccountForItem); - } - if (other.HasBnetAccount) { - MergeBnetAccount(other.BnetAccount); - } - if (other.HasGameAccount) { - MergeGameAccount(other.GameAccount); - } - if (other.HasToon) { - MergeToon(other.Toon); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - Amount = input.ReadUInt32(); - break; - } - case 16: { - StartTime = input.ReadUInt64(); - break; - } - case 24: { - EndTime = input.ReadUInt64(); - break; - } - case 34: { - global::bnet.protocol.exchange.BlobFrom.Builder subBuilder = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(); - if (HasAccountForMoney) { - subBuilder.MergeFrom(AccountForMoney); - } - input.ReadMessage(subBuilder, extensionRegistry); - AccountForMoney = subBuilder.BuildPartial(); - break; - } - case 42: { - global::bnet.protocol.exchange.BlobFrom.Builder subBuilder = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(); - if (HasAccountForItem) { - subBuilder.MergeFrom(AccountForItem); - } - input.ReadMessage(subBuilder, extensionRegistry); - AccountForItem = subBuilder.BuildPartial(); - break; - } - case 50: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasBnetAccount) { - subBuilder.MergeFrom(BnetAccount); - } - input.ReadMessage(subBuilder, extensionRegistry); - BnetAccount = subBuilder.BuildPartial(); - break; - } - case 58: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasGameAccount) { - subBuilder.MergeFrom(GameAccount); - } - input.ReadMessage(subBuilder, extensionRegistry); - GameAccount = subBuilder.BuildPartial(); - break; - } - case 66: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasToon) { - subBuilder.MergeFrom(Toon); - } - input.ReadMessage(subBuilder, extensionRegistry); - Toon = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasAmount { - get { return result.HasAmount; } - } - public uint Amount { - get { return result.Amount; } - set { SetAmount(value); } - } - public Builder SetAmount(uint value) { - result.hasAmount = true; - result.amount_ = value; - return this; - } - public Builder ClearAmount() { - result.hasAmount = false; - result.amount_ = 0; - return this; - } - - public bool HasStartTime { - get { return result.HasStartTime; } - } - public ulong StartTime { - get { return result.StartTime; } - set { SetStartTime(value); } - } - public Builder SetStartTime(ulong value) { - result.hasStartTime = true; - result.startTime_ = value; - return this; - } - public Builder ClearStartTime() { - result.hasStartTime = false; - result.startTime_ = 0UL; - return this; - } - - public bool HasEndTime { - get { return result.HasEndTime; } - } - public ulong EndTime { - get { return result.EndTime; } - set { SetEndTime(value); } - } - public Builder SetEndTime(ulong value) { - result.hasEndTime = true; - result.endTime_ = value; - return this; - } - public Builder ClearEndTime() { - result.hasEndTime = false; - result.endTime_ = 0UL; - return this; - } - - public bool HasAccountForMoney { - get { return result.HasAccountForMoney; } - } - public global::bnet.protocol.exchange.BlobFrom AccountForMoney { - get { return result.AccountForMoney; } - set { SetAccountForMoney(value); } - } - public Builder SetAccountForMoney(global::bnet.protocol.exchange.BlobFrom value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasAccountForMoney = true; - result.accountForMoney_ = value; - return this; - } - public Builder SetAccountForMoney(global::bnet.protocol.exchange.BlobFrom.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasAccountForMoney = true; - result.accountForMoney_ = builderForValue.Build(); - return this; - } - public Builder MergeAccountForMoney(global::bnet.protocol.exchange.BlobFrom value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAccountForMoney && - result.accountForMoney_ != global::bnet.protocol.exchange.BlobFrom.DefaultInstance) { - result.accountForMoney_ = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(result.accountForMoney_).MergeFrom(value).BuildPartial(); - } else { - result.accountForMoney_ = value; - } - result.hasAccountForMoney = true; - return this; - } - public Builder ClearAccountForMoney() { - result.hasAccountForMoney = false; - result.accountForMoney_ = global::bnet.protocol.exchange.BlobFrom.DefaultInstance; - return this; - } - - public bool HasAccountForItem { - get { return result.HasAccountForItem; } - } - public global::bnet.protocol.exchange.BlobFrom AccountForItem { - get { return result.AccountForItem; } - set { SetAccountForItem(value); } - } - public Builder SetAccountForItem(global::bnet.protocol.exchange.BlobFrom value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasAccountForItem = true; - result.accountForItem_ = value; - return this; - } - public Builder SetAccountForItem(global::bnet.protocol.exchange.BlobFrom.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasAccountForItem = true; - result.accountForItem_ = builderForValue.Build(); - return this; - } - public Builder MergeAccountForItem(global::bnet.protocol.exchange.BlobFrom value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAccountForItem && - result.accountForItem_ != global::bnet.protocol.exchange.BlobFrom.DefaultInstance) { - result.accountForItem_ = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(result.accountForItem_).MergeFrom(value).BuildPartial(); - } else { - result.accountForItem_ = value; - } - result.hasAccountForItem = true; - return this; - } - public Builder ClearAccountForItem() { - result.hasAccountForItem = false; - result.accountForItem_ = global::bnet.protocol.exchange.BlobFrom.DefaultInstance; - return this; - } - - public bool HasBnetAccount { - get { return result.HasBnetAccount; } - } - public global::bnet.protocol.EntityId BnetAccount { - get { return result.BnetAccount; } - set { SetBnetAccount(value); } - } - public Builder SetBnetAccount(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBnetAccount = true; - result.bnetAccount_ = value; - return this; - } - public Builder SetBnetAccount(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBnetAccount = true; - result.bnetAccount_ = builderForValue.Build(); - return this; - } - public Builder MergeBnetAccount(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasBnetAccount && - result.bnetAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.bnetAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccount_).MergeFrom(value).BuildPartial(); - } else { - result.bnetAccount_ = value; - } - result.hasBnetAccount = true; - return this; - } - public Builder ClearBnetAccount() { - result.hasBnetAccount = false; - result.bnetAccount_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasGameAccount { - get { return result.HasGameAccount; } - } - public global::bnet.protocol.EntityId GameAccount { - get { return result.GameAccount; } - set { SetGameAccount(value); } - } - public Builder SetGameAccount(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasGameAccount = true; - result.gameAccount_ = value; - return this; - } - public Builder SetGameAccount(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasGameAccount = true; - result.gameAccount_ = builderForValue.Build(); - return this; - } - public Builder MergeGameAccount(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasGameAccount && - result.gameAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.gameAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccount_).MergeFrom(value).BuildPartial(); - } else { - result.gameAccount_ = value; - } - result.hasGameAccount = true; - return this; - } - public Builder ClearGameAccount() { - result.hasGameAccount = false; - result.gameAccount_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasToon { - get { return result.HasToon; } - } - public global::bnet.protocol.EntityId Toon { - get { return result.Toon; } - set { SetToon(value); } - } - public Builder SetToon(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasToon = true; - result.toon_ = value; - return this; - } - public Builder SetToon(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasToon = true; - result.toon_ = builderForValue.Build(); - return this; - } - public Builder MergeToon(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasToon && - result.toon_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.toon_ = global::bnet.protocol.EntityId.CreateBuilder(result.toon_).MergeFrom(value).BuildPartial(); - } else { - result.toon_ = value; - } - result.hasToon = true; - return this; - } - public Builder ClearToon() { - result.hasToon = false; - result.toon_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - } - static Order() { - object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); - } - } - - public sealed partial class Extension : pb::GeneratedMessage { - private static readonly Extension defaultInstance = new Builder().BuildPartial(); - public static Extension DefaultInstance { - get { return defaultInstance; } - } - - public override Extension DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override Extension ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_Extension__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_Extension__FieldAccessorTable; } - } - - public const int PartitionIdFieldNumber = 1; - private bool hasPartitionId; - private global::bnet.protocol.exchange.PartitionId partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - public bool HasPartitionId { - get { return hasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return partitionId_; } - } - - public const int OrderBookIdFieldNumber = 2; - private bool hasOrderBookId; - private ulong orderBookId_ = 0UL; - public bool HasOrderBookId { - get { return hasOrderBookId; } - } - public ulong OrderBookId { - get { return orderBookId_; } - } - - public const int OrderIdFieldNumber = 3; - private bool hasOrderId; - private ulong orderId_ = 0UL; - public bool HasOrderId { - get { return hasOrderId; } - } - public ulong OrderId { - get { return orderId_; } - } - - public const int FilledAmountFieldNumber = 4; - private bool hasFilledAmount; - private ulong filledAmount_ = 0UL; - public bool HasFilledAmount { - get { return hasFilledAmount; } - } - public ulong FilledAmount { - get { return filledAmount_; } - } - - public const int OrderStatusFieldNumber = 5; - private bool hasOrderStatus; - private int orderStatus_ = 0; - public bool HasOrderStatus { - get { return hasOrderStatus; } - } - public int OrderStatus { - get { return orderStatus_; } - } - - public const int AuthorizedTimeFieldNumber = 6; - private bool hasAuthorizedTime; - private ulong authorizedTime_ = 0UL; - public bool HasAuthorizedTime { - get { return hasAuthorizedTime; } - } - public ulong AuthorizedTime { - get { return authorizedTime_; } - } - - public const int CreatedTimeFieldNumber = 7; - private bool hasCreatedTime; - private ulong createdTime_ = 0UL; - public bool HasCreatedTime { - get { return hasCreatedTime; } - } - public ulong CreatedTime { - get { return createdTime_; } - } - - public const int ClosedTimeFieldNumber = 8; - private bool hasClosedTime; - private ulong closedTime_ = 0UL; - public bool HasClosedTime { - get { return hasClosedTime; } - } - public ulong ClosedTime { - get { return closedTime_; } - } - - public const int ReasonFieldNumber = 9; - private bool hasReason; - private uint reason_ = 0; - public bool HasReason { - get { return hasReason; } - } - public uint Reason { - get { return reason_; } - } - - public const int OrderBookFieldNumber = 10; - private bool hasOrderBook; - private global::bnet.protocol.exchange.OrderBook orderBook_ = global::bnet.protocol.exchange.OrderBook.DefaultInstance; - public bool HasOrderBook { - get { return hasOrderBook; } - } - public global::bnet.protocol.exchange.OrderBook OrderBook { - get { return orderBook_; } - } - - public const int OrderBookStatusFieldNumber = 11; - private bool hasOrderBookStatus; - private ulong orderBookStatus_ = 0UL; - public bool HasOrderBookStatus { - get { return hasOrderBookStatus; } - } - public ulong OrderBookStatus { - get { return orderBookStatus_; } - } - - public const int MoneyToClaimFieldNumber = 12; - private bool hasMoneyToClaim; - private ulong moneyToClaim_ = 0UL; - public bool HasMoneyToClaim { - get { return hasMoneyToClaim; } - } - public ulong MoneyToClaim { - get { return moneyToClaim_; } - } - - public const int ItemsToClaimFieldNumber = 13; - private bool hasItemsToClaim; - private ulong itemsToClaim_ = 0UL; - public bool HasItemsToClaim { - get { return hasItemsToClaim; } - } - public ulong ItemsToClaim { - get { return itemsToClaim_; } - } - - public override bool IsInitialized { - get { - if (!hasPartitionId) return false; - if (!hasOrderBookId) return false; - if (!hasOrderId) return false; - if (!PartitionId.IsInitialized) return false; - if (HasOrderBook) { - if (!OrderBook.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasPartitionId) { - output.WriteMessage(1, PartitionId); - } - if (HasOrderBookId) { - output.WriteUInt64(2, OrderBookId); - } - if (HasOrderId) { - output.WriteUInt64(3, OrderId); - } - if (HasFilledAmount) { - output.WriteUInt64(4, FilledAmount); - } - if (HasOrderStatus) { - output.WriteInt32(5, OrderStatus); - } - if (HasAuthorizedTime) { - output.WriteUInt64(6, AuthorizedTime); - } - if (HasCreatedTime) { - output.WriteUInt64(7, CreatedTime); - } - if (HasClosedTime) { - output.WriteUInt64(8, ClosedTime); - } - if (HasReason) { - output.WriteUInt32(9, Reason); - } - if (HasOrderBook) { - output.WriteMessage(10, OrderBook); - } - if (HasOrderBookStatus) { - output.WriteUInt64(11, OrderBookStatus); - } - if (HasMoneyToClaim) { - output.WriteUInt64(12, MoneyToClaim); - } - if (HasItemsToClaim) { - output.WriteUInt64(13, ItemsToClaim); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasPartitionId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); - } - if (HasOrderBookId) { - size += pb::CodedOutputStream.ComputeUInt64Size(2, OrderBookId); - } - if (HasOrderId) { - size += pb::CodedOutputStream.ComputeUInt64Size(3, OrderId); - } - if (HasFilledAmount) { - size += pb::CodedOutputStream.ComputeUInt64Size(4, FilledAmount); - } - if (HasOrderStatus) { - size += pb::CodedOutputStream.ComputeInt32Size(5, OrderStatus); - } - if (HasAuthorizedTime) { - size += pb::CodedOutputStream.ComputeUInt64Size(6, AuthorizedTime); - } - if (HasCreatedTime) { - size += pb::CodedOutputStream.ComputeUInt64Size(7, CreatedTime); - } - if (HasClosedTime) { - size += pb::CodedOutputStream.ComputeUInt64Size(8, ClosedTime); - } - if (HasReason) { - size += pb::CodedOutputStream.ComputeUInt32Size(9, Reason); - } - if (HasOrderBook) { - size += pb::CodedOutputStream.ComputeMessageSize(10, OrderBook); - } - if (HasOrderBookStatus) { - size += pb::CodedOutputStream.ComputeUInt64Size(11, OrderBookStatus); - } - if (HasMoneyToClaim) { - size += pb::CodedOutputStream.ComputeUInt64Size(12, MoneyToClaim); - } - if (HasItemsToClaim) { - size += pb::CodedOutputStream.ComputeUInt64Size(13, ItemsToClaim); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static Extension ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Extension ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Extension ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Extension ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Extension ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Extension ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Extension ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Extension ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Extension ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Extension ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Extension prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - Extension result = new Extension(); - - protected override Extension MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new Extension(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.Extension.Descriptor; } - } - - public override Extension DefaultInstanceForType { - get { return global::bnet.protocol.exchange.Extension.DefaultInstance; } - } - - public override Extension BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - Extension returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Extension) { - return MergeFrom((Extension) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Extension other) { - if (other == global::bnet.protocol.exchange.Extension.DefaultInstance) return this; - if (other.HasPartitionId) { - MergePartitionId(other.PartitionId); - } - if (other.HasOrderBookId) { - OrderBookId = other.OrderBookId; - } - if (other.HasOrderId) { - OrderId = other.OrderId; - } - if (other.HasFilledAmount) { - FilledAmount = other.FilledAmount; - } - if (other.HasOrderStatus) { - OrderStatus = other.OrderStatus; - } - if (other.HasAuthorizedTime) { - AuthorizedTime = other.AuthorizedTime; - } - if (other.HasCreatedTime) { - CreatedTime = other.CreatedTime; - } - if (other.HasClosedTime) { - ClosedTime = other.ClosedTime; - } - if (other.HasReason) { - Reason = other.Reason; - } - if (other.HasOrderBook) { - MergeOrderBook(other.OrderBook); - } - if (other.HasOrderBookStatus) { - OrderBookStatus = other.OrderBookStatus; - } - if (other.HasMoneyToClaim) { - MoneyToClaim = other.MoneyToClaim; - } - if (other.HasItemsToClaim) { - ItemsToClaim = other.ItemsToClaim; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { - subBuilder.MergeFrom(PartitionId); - } - input.ReadMessage(subBuilder, extensionRegistry); - PartitionId = subBuilder.BuildPartial(); - break; - } - case 16: { - OrderBookId = input.ReadUInt64(); - break; - } - case 24: { - OrderId = input.ReadUInt64(); - break; - } - case 32: { - FilledAmount = input.ReadUInt64(); - break; - } - case 40: { - OrderStatus = input.ReadInt32(); - break; - } - case 48: { - AuthorizedTime = input.ReadUInt64(); - break; - } - case 56: { - CreatedTime = input.ReadUInt64(); - break; - } - case 64: { - ClosedTime = input.ReadUInt64(); - break; - } - case 72: { - Reason = input.ReadUInt32(); - break; - } - case 82: { - global::bnet.protocol.exchange.OrderBook.Builder subBuilder = global::bnet.protocol.exchange.OrderBook.CreateBuilder(); - if (HasOrderBook) { - subBuilder.MergeFrom(OrderBook); - } - input.ReadMessage(subBuilder, extensionRegistry); - OrderBook = subBuilder.BuildPartial(); - break; - } - case 88: { - OrderBookStatus = input.ReadUInt64(); - break; - } - case 96: { - MoneyToClaim = input.ReadUInt64(); - break; - } - case 104: { - ItemsToClaim = input.ReadUInt64(); - break; - } - } - } - } - - - public bool HasPartitionId { - get { return result.HasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return result.PartitionId; } - set { SetPartitionId(value); } - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasPartitionId = true; - result.partitionId_ = value; - return this; - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasPartitionId = true; - result.partitionId_ = builderForValue.Build(); - return this; - } - public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasPartitionId && - result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); - } else { - result.partitionId_ = value; - } - result.hasPartitionId = true; - return this; - } - public Builder ClearPartitionId() { - result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - return this; - } - - public bool HasOrderBookId { - get { return result.HasOrderBookId; } - } - public ulong OrderBookId { - get { return result.OrderBookId; } - set { SetOrderBookId(value); } - } - public Builder SetOrderBookId(ulong value) { - result.hasOrderBookId = true; - result.orderBookId_ = value; - return this; - } - public Builder ClearOrderBookId() { - result.hasOrderBookId = false; - result.orderBookId_ = 0UL; - return this; - } - - public bool HasOrderId { - get { return result.HasOrderId; } - } - public ulong OrderId { - get { return result.OrderId; } - set { SetOrderId(value); } - } - public Builder SetOrderId(ulong value) { - result.hasOrderId = true; - result.orderId_ = value; - return this; - } - public Builder ClearOrderId() { - result.hasOrderId = false; - result.orderId_ = 0UL; - return this; - } - - public bool HasFilledAmount { - get { return result.HasFilledAmount; } - } - public ulong FilledAmount { - get { return result.FilledAmount; } - set { SetFilledAmount(value); } - } - public Builder SetFilledAmount(ulong value) { - result.hasFilledAmount = true; - result.filledAmount_ = value; - return this; - } - public Builder ClearFilledAmount() { - result.hasFilledAmount = false; - result.filledAmount_ = 0UL; - return this; - } - - public bool HasOrderStatus { - get { return result.HasOrderStatus; } - } - public int OrderStatus { - get { return result.OrderStatus; } - set { SetOrderStatus(value); } - } - public Builder SetOrderStatus(int value) { - result.hasOrderStatus = true; - result.orderStatus_ = value; - return this; - } - public Builder ClearOrderStatus() { - result.hasOrderStatus = false; - result.orderStatus_ = 0; - return this; - } - - public bool HasAuthorizedTime { - get { return result.HasAuthorizedTime; } - } - public ulong AuthorizedTime { - get { return result.AuthorizedTime; } - set { SetAuthorizedTime(value); } - } - public Builder SetAuthorizedTime(ulong value) { - result.hasAuthorizedTime = true; - result.authorizedTime_ = value; - return this; - } - public Builder ClearAuthorizedTime() { - result.hasAuthorizedTime = false; - result.authorizedTime_ = 0UL; - return this; - } - - public bool HasCreatedTime { - get { return result.HasCreatedTime; } - } - public ulong CreatedTime { - get { return result.CreatedTime; } - set { SetCreatedTime(value); } - } - public Builder SetCreatedTime(ulong value) { - result.hasCreatedTime = true; - result.createdTime_ = value; - return this; - } - public Builder ClearCreatedTime() { - result.hasCreatedTime = false; - result.createdTime_ = 0UL; - return this; - } - - public bool HasClosedTime { - get { return result.HasClosedTime; } - } - public ulong ClosedTime { - get { return result.ClosedTime; } - set { SetClosedTime(value); } - } - public Builder SetClosedTime(ulong value) { - result.hasClosedTime = true; - result.closedTime_ = value; - return this; - } - public Builder ClearClosedTime() { - result.hasClosedTime = false; - result.closedTime_ = 0UL; - return this; - } - - public bool HasReason { - get { return result.HasReason; } - } - public uint Reason { - get { return result.Reason; } - set { SetReason(value); } - } - public Builder SetReason(uint value) { - result.hasReason = true; - result.reason_ = value; - return this; - } - public Builder ClearReason() { - result.hasReason = false; - result.reason_ = 0; - return this; - } - - public bool HasOrderBook { - get { return result.HasOrderBook; } - } - public global::bnet.protocol.exchange.OrderBook OrderBook { - get { return result.OrderBook; } - set { SetOrderBook(value); } - } - public Builder SetOrderBook(global::bnet.protocol.exchange.OrderBook value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasOrderBook = true; - result.orderBook_ = value; - return this; - } - public Builder SetOrderBook(global::bnet.protocol.exchange.OrderBook.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasOrderBook = true; - result.orderBook_ = builderForValue.Build(); - return this; - } - public Builder MergeOrderBook(global::bnet.protocol.exchange.OrderBook value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasOrderBook && - result.orderBook_ != global::bnet.protocol.exchange.OrderBook.DefaultInstance) { - result.orderBook_ = global::bnet.protocol.exchange.OrderBook.CreateBuilder(result.orderBook_).MergeFrom(value).BuildPartial(); - } else { - result.orderBook_ = value; - } - result.hasOrderBook = true; - return this; - } - public Builder ClearOrderBook() { - result.hasOrderBook = false; - result.orderBook_ = global::bnet.protocol.exchange.OrderBook.DefaultInstance; - return this; - } - - public bool HasOrderBookStatus { - get { return result.HasOrderBookStatus; } - } - public ulong OrderBookStatus { - get { return result.OrderBookStatus; } - set { SetOrderBookStatus(value); } - } - public Builder SetOrderBookStatus(ulong value) { - result.hasOrderBookStatus = true; - result.orderBookStatus_ = value; - return this; - } - public Builder ClearOrderBookStatus() { - result.hasOrderBookStatus = false; - result.orderBookStatus_ = 0UL; - return this; - } - - public bool HasMoneyToClaim { - get { return result.HasMoneyToClaim; } - } - public ulong MoneyToClaim { - get { return result.MoneyToClaim; } - set { SetMoneyToClaim(value); } - } - public Builder SetMoneyToClaim(ulong value) { - result.hasMoneyToClaim = true; - result.moneyToClaim_ = value; - return this; - } - public Builder ClearMoneyToClaim() { - result.hasMoneyToClaim = false; - result.moneyToClaim_ = 0UL; - return this; - } - - public bool HasItemsToClaim { - get { return result.HasItemsToClaim; } - } - public ulong ItemsToClaim { - get { return result.ItemsToClaim; } - set { SetItemsToClaim(value); } - } - public Builder SetItemsToClaim(ulong value) { - result.hasItemsToClaim = true; - result.itemsToClaim_ = value; - return this; - } - public Builder ClearItemsToClaim() { - result.hasItemsToClaim = false; - result.itemsToClaim_ = 0UL; - return this; - } - } - static Extension() { - object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); - } - } - - public sealed partial class Offer : pb::GeneratedMessage { - private static readonly Offer defaultInstance = new Builder().BuildPartial(); - public static Offer DefaultInstance { - get { return defaultInstance; } - } - - public override Offer DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override Offer ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_Offer__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_Offer__FieldAccessorTable; } - } - - public const int OrderFieldNumber = 1; - private bool hasOrder; - private global::bnet.protocol.exchange.Order order_ = global::bnet.protocol.exchange.Order.DefaultInstance; - public bool HasOrder { - get { return hasOrder; } - } - public global::bnet.protocol.exchange.Order Order { - get { return order_; } - } - - public const int TradeNowPriceFieldNumber = 2; - private bool hasTradeNowPrice; - private ulong tradeNowPrice_ = 0UL; - public bool HasTradeNowPrice { - get { return hasTradeNowPrice; } - } - public ulong TradeNowPrice { - get { return tradeNowPrice_; } - } - - public const int ReservePriceFieldNumber = 3; - private bool hasReservePrice; - private ulong reservePrice_ = 0UL; - public bool HasReservePrice { - get { return hasReservePrice; } - } - public ulong ReservePrice { - get { return reservePrice_; } - } - - public const int OutBidPriceFieldNumber = 4; - private bool hasOutBidPrice; - private ulong outBidPrice_ = 0UL; - public bool HasOutBidPrice { - get { return hasOutBidPrice; } - } - public ulong OutBidPrice { - get { return outBidPrice_; } - } - - public override bool IsInitialized { - get { - if (!hasOrder) return false; - if (!Order.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasOrder) { - output.WriteMessage(1, Order); - } - if (HasTradeNowPrice) { - output.WriteUInt64(2, TradeNowPrice); - } - if (HasReservePrice) { - output.WriteUInt64(3, ReservePrice); - } - if (HasOutBidPrice) { - output.WriteUInt64(4, OutBidPrice); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasOrder) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Order); - } - if (HasTradeNowPrice) { - size += pb::CodedOutputStream.ComputeUInt64Size(2, TradeNowPrice); - } - if (HasReservePrice) { - size += pb::CodedOutputStream.ComputeUInt64Size(3, ReservePrice); - } - if (HasOutBidPrice) { - size += pb::CodedOutputStream.ComputeUInt64Size(4, OutBidPrice); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static Offer ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Offer ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Offer ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Offer ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Offer ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Offer ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Offer ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Offer ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Offer ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Offer ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Offer prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - Offer result = new Offer(); - - protected override Offer MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new Offer(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.Offer.Descriptor; } - } - - public override Offer DefaultInstanceForType { - get { return global::bnet.protocol.exchange.Offer.DefaultInstance; } - } - - public override Offer BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - Offer returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Offer) { - return MergeFrom((Offer) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Offer other) { - if (other == global::bnet.protocol.exchange.Offer.DefaultInstance) return this; - if (other.HasOrder) { - MergeOrder(other.Order); - } - if (other.HasTradeNowPrice) { - TradeNowPrice = other.TradeNowPrice; - } - if (other.HasReservePrice) { - ReservePrice = other.ReservePrice; - } - if (other.HasOutBidPrice) { - OutBidPrice = other.OutBidPrice; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.Order.Builder subBuilder = global::bnet.protocol.exchange.Order.CreateBuilder(); - if (HasOrder) { - subBuilder.MergeFrom(Order); - } - input.ReadMessage(subBuilder, extensionRegistry); - Order = subBuilder.BuildPartial(); - break; - } - case 16: { - TradeNowPrice = input.ReadUInt64(); - break; - } - case 24: { - ReservePrice = input.ReadUInt64(); - break; - } - case 32: { - OutBidPrice = input.ReadUInt64(); - break; - } - } - } - } - - - public bool HasOrder { - get { return result.HasOrder; } - } - public global::bnet.protocol.exchange.Order Order { - get { return result.Order; } - set { SetOrder(value); } - } - public Builder SetOrder(global::bnet.protocol.exchange.Order value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasOrder = true; - result.order_ = value; - return this; - } - public Builder SetOrder(global::bnet.protocol.exchange.Order.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasOrder = true; - result.order_ = builderForValue.Build(); - return this; - } - public Builder MergeOrder(global::bnet.protocol.exchange.Order value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasOrder && - result.order_ != global::bnet.protocol.exchange.Order.DefaultInstance) { - result.order_ = global::bnet.protocol.exchange.Order.CreateBuilder(result.order_).MergeFrom(value).BuildPartial(); - } else { - result.order_ = value; - } - result.hasOrder = true; - return this; - } - public Builder ClearOrder() { - result.hasOrder = false; - result.order_ = global::bnet.protocol.exchange.Order.DefaultInstance; - return this; - } - - public bool HasTradeNowPrice { - get { return result.HasTradeNowPrice; } - } - public ulong TradeNowPrice { - get { return result.TradeNowPrice; } - set { SetTradeNowPrice(value); } - } - public Builder SetTradeNowPrice(ulong value) { - result.hasTradeNowPrice = true; - result.tradeNowPrice_ = value; - return this; - } - public Builder ClearTradeNowPrice() { - result.hasTradeNowPrice = false; - result.tradeNowPrice_ = 0UL; - return this; - } - - public bool HasReservePrice { - get { return result.HasReservePrice; } - } - public ulong ReservePrice { - get { return result.ReservePrice; } - set { SetReservePrice(value); } - } - public Builder SetReservePrice(ulong value) { - result.hasReservePrice = true; - result.reservePrice_ = value; - return this; - } - public Builder ClearReservePrice() { - result.hasReservePrice = false; - result.reservePrice_ = 0UL; - return this; - } - - public bool HasOutBidPrice { - get { return result.HasOutBidPrice; } - } - public ulong OutBidPrice { - get { return result.OutBidPrice; } - set { SetOutBidPrice(value); } - } - public Builder SetOutBidPrice(ulong value) { - result.hasOutBidPrice = true; - result.outBidPrice_ = value; - return this; - } - public Builder ClearOutBidPrice() { - result.hasOutBidPrice = false; - result.outBidPrice_ = 0UL; - return this; - } - } - static Offer() { - object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); - } - } - - public sealed partial class OfferExtended : pb::GeneratedMessage { - private static readonly OfferExtended defaultInstance = new Builder().BuildPartial(); - public static OfferExtended DefaultInstance { - get { return defaultInstance; } - } - - public override OfferExtended DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override OfferExtended ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_OfferExtended__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_OfferExtended__FieldAccessorTable; } - } - - public const int OfferFieldNumber = 1; - private bool hasOffer; - private global::bnet.protocol.exchange.Offer offer_ = global::bnet.protocol.exchange.Offer.DefaultInstance; - public bool HasOffer { - get { return hasOffer; } - } - public global::bnet.protocol.exchange.Offer Offer { - get { return offer_; } - } - - public const int ExtensionFieldNumber = 2; - private bool hasExtension; - private global::bnet.protocol.exchange.Extension extension_ = global::bnet.protocol.exchange.Extension.DefaultInstance; - public bool HasExtension { - get { return hasExtension; } - } - public global::bnet.protocol.exchange.Extension Extension { - get { return extension_; } - } - - public const int CurrentWinningPriceFieldNumber = 3; - private bool hasCurrentWinningPrice; - private ulong currentWinningPrice_ = 0UL; - public bool HasCurrentWinningPrice { - get { return hasCurrentWinningPrice; } - } - public ulong CurrentWinningPrice { - get { return currentWinningPrice_; } - } - - public override bool IsInitialized { - get { - if (!hasOffer) return false; - if (!hasExtension) return false; - if (!Offer.IsInitialized) return false; - if (!Extension.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasOffer) { - output.WriteMessage(1, Offer); - } - if (HasExtension) { - output.WriteMessage(2, Extension); - } - if (HasCurrentWinningPrice) { - output.WriteUInt64(3, CurrentWinningPrice); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasOffer) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Offer); - } - if (HasExtension) { - size += pb::CodedOutputStream.ComputeMessageSize(2, Extension); - } - if (HasCurrentWinningPrice) { - size += pb::CodedOutputStream.ComputeUInt64Size(3, CurrentWinningPrice); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static OfferExtended ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OfferExtended ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OfferExtended ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OfferExtended ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OfferExtended ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OfferExtended ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static OfferExtended ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static OfferExtended ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static OfferExtended ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OfferExtended ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(OfferExtended prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - OfferExtended result = new OfferExtended(); - - protected override OfferExtended MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new OfferExtended(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.OfferExtended.Descriptor; } - } - - public override OfferExtended DefaultInstanceForType { - get { return global::bnet.protocol.exchange.OfferExtended.DefaultInstance; } - } - - public override OfferExtended BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - OfferExtended returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is OfferExtended) { - return MergeFrom((OfferExtended) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(OfferExtended other) { - if (other == global::bnet.protocol.exchange.OfferExtended.DefaultInstance) return this; - if (other.HasOffer) { - MergeOffer(other.Offer); - } - if (other.HasExtension) { - MergeExtension(other.Extension); - } - if (other.HasCurrentWinningPrice) { - CurrentWinningPrice = other.CurrentWinningPrice; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.Offer.Builder subBuilder = global::bnet.protocol.exchange.Offer.CreateBuilder(); - if (HasOffer) { - subBuilder.MergeFrom(Offer); - } - input.ReadMessage(subBuilder, extensionRegistry); - Offer = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.exchange.Extension.Builder subBuilder = global::bnet.protocol.exchange.Extension.CreateBuilder(); - if (HasExtension) { - subBuilder.MergeFrom(Extension); - } - input.ReadMessage(subBuilder, extensionRegistry); - Extension = subBuilder.BuildPartial(); - break; - } - case 24: { - CurrentWinningPrice = input.ReadUInt64(); - break; - } - } - } - } - - - public bool HasOffer { - get { return result.HasOffer; } - } - public global::bnet.protocol.exchange.Offer Offer { - get { return result.Offer; } - set { SetOffer(value); } - } - public Builder SetOffer(global::bnet.protocol.exchange.Offer value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasOffer = true; - result.offer_ = value; - return this; - } - public Builder SetOffer(global::bnet.protocol.exchange.Offer.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasOffer = true; - result.offer_ = builderForValue.Build(); - return this; - } - public Builder MergeOffer(global::bnet.protocol.exchange.Offer value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasOffer && - result.offer_ != global::bnet.protocol.exchange.Offer.DefaultInstance) { - result.offer_ = global::bnet.protocol.exchange.Offer.CreateBuilder(result.offer_).MergeFrom(value).BuildPartial(); - } else { - result.offer_ = value; - } - result.hasOffer = true; - return this; - } - public Builder ClearOffer() { - result.hasOffer = false; - result.offer_ = global::bnet.protocol.exchange.Offer.DefaultInstance; - return this; - } - - public bool HasExtension { - get { return result.HasExtension; } - } - public global::bnet.protocol.exchange.Extension Extension { - get { return result.Extension; } - set { SetExtension(value); } - } - public Builder SetExtension(global::bnet.protocol.exchange.Extension value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasExtension = true; - result.extension_ = value; - return this; - } - public Builder SetExtension(global::bnet.protocol.exchange.Extension.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasExtension = true; - result.extension_ = builderForValue.Build(); - return this; - } - public Builder MergeExtension(global::bnet.protocol.exchange.Extension value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasExtension && - result.extension_ != global::bnet.protocol.exchange.Extension.DefaultInstance) { - result.extension_ = global::bnet.protocol.exchange.Extension.CreateBuilder(result.extension_).MergeFrom(value).BuildPartial(); - } else { - result.extension_ = value; - } - result.hasExtension = true; - return this; - } - public Builder ClearExtension() { - result.hasExtension = false; - result.extension_ = global::bnet.protocol.exchange.Extension.DefaultInstance; - return this; - } - - public bool HasCurrentWinningPrice { - get { return result.HasCurrentWinningPrice; } - } - public ulong CurrentWinningPrice { - get { return result.CurrentWinningPrice; } - set { SetCurrentWinningPrice(value); } - } - public Builder SetCurrentWinningPrice(ulong value) { - result.hasCurrentWinningPrice = true; - result.currentWinningPrice_ = value; - return this; - } - public Builder ClearCurrentWinningPrice() { - result.hasCurrentWinningPrice = false; - result.currentWinningPrice_ = 0UL; - return this; - } - } - static OfferExtended() { - object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); - } - } - - public sealed partial class OfferCreation : pb::GeneratedMessage { - private static readonly OfferCreation defaultInstance = new Builder().BuildPartial(); - public static OfferCreation DefaultInstance { - get { return defaultInstance; } - } - - public override OfferCreation DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override OfferCreation ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_OfferCreation__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_OfferCreation__FieldAccessorTable; } - } - - public const int OfferFieldNumber = 1; - private bool hasOffer; - private global::bnet.protocol.exchange.Offer offer_ = global::bnet.protocol.exchange.Offer.DefaultInstance; - public bool HasOffer { - get { return hasOffer; } - } - public global::bnet.protocol.exchange.Offer Offer { - get { return offer_; } - } - - public const int AuctionDurationFieldNumber = 2; - private bool hasAuctionDuration; - private ulong auctionDuration_ = 0UL; - public bool HasAuctionDuration { - get { return hasAuctionDuration; } - } - public ulong AuctionDuration { - get { return auctionDuration_; } - } - - public const int AuctionStartDelayFieldNumber = 3; - private bool hasAuctionStartDelay; - private ulong auctionStartDelay_ = 0UL; - public bool HasAuctionStartDelay { - get { return hasAuctionStartDelay; } - } - public ulong AuctionStartDelay { - get { return auctionStartDelay_; } - } - - public const int BillingAddressFieldNumber = 4; - private bool hasBillingAddress; - private global::bnet.protocol.exchange.BillingAddress billingAddress_ = global::bnet.protocol.exchange.BillingAddress.DefaultInstance; - public bool HasBillingAddress { - get { return hasBillingAddress; } - } - public global::bnet.protocol.exchange.BillingAddress BillingAddress { - get { return billingAddress_; } - } - - public override bool IsInitialized { - get { - if (!hasOffer) return false; - if (!Offer.IsInitialized) return false; - if (HasBillingAddress) { - if (!BillingAddress.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasOffer) { - output.WriteMessage(1, Offer); - } - if (HasAuctionDuration) { - output.WriteUInt64(2, AuctionDuration); - } - if (HasAuctionStartDelay) { - output.WriteUInt64(3, AuctionStartDelay); - } - if (HasBillingAddress) { - output.WriteMessage(4, BillingAddress); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasOffer) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Offer); - } - if (HasAuctionDuration) { - size += pb::CodedOutputStream.ComputeUInt64Size(2, AuctionDuration); - } - if (HasAuctionStartDelay) { - size += pb::CodedOutputStream.ComputeUInt64Size(3, AuctionStartDelay); - } - if (HasBillingAddress) { - size += pb::CodedOutputStream.ComputeMessageSize(4, BillingAddress); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static OfferCreation ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OfferCreation ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OfferCreation ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OfferCreation ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OfferCreation ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OfferCreation ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static OfferCreation ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static OfferCreation ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static OfferCreation ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OfferCreation ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(OfferCreation prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - OfferCreation result = new OfferCreation(); - - protected override OfferCreation MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new OfferCreation(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.OfferCreation.Descriptor; } - } - - public override OfferCreation DefaultInstanceForType { - get { return global::bnet.protocol.exchange.OfferCreation.DefaultInstance; } - } - - public override OfferCreation BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - OfferCreation returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is OfferCreation) { - return MergeFrom((OfferCreation) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(OfferCreation other) { - if (other == global::bnet.protocol.exchange.OfferCreation.DefaultInstance) return this; - if (other.HasOffer) { - MergeOffer(other.Offer); - } - if (other.HasAuctionDuration) { - AuctionDuration = other.AuctionDuration; - } - if (other.HasAuctionStartDelay) { - AuctionStartDelay = other.AuctionStartDelay; - } - if (other.HasBillingAddress) { - MergeBillingAddress(other.BillingAddress); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.Offer.Builder subBuilder = global::bnet.protocol.exchange.Offer.CreateBuilder(); - if (HasOffer) { - subBuilder.MergeFrom(Offer); - } - input.ReadMessage(subBuilder, extensionRegistry); - Offer = subBuilder.BuildPartial(); - break; - } - case 16: { - AuctionDuration = input.ReadUInt64(); - break; - } - case 24: { - AuctionStartDelay = input.ReadUInt64(); - break; - } - case 34: { - global::bnet.protocol.exchange.BillingAddress.Builder subBuilder = global::bnet.protocol.exchange.BillingAddress.CreateBuilder(); - if (HasBillingAddress) { - subBuilder.MergeFrom(BillingAddress); - } - input.ReadMessage(subBuilder, extensionRegistry); - BillingAddress = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasOffer { - get { return result.HasOffer; } - } - public global::bnet.protocol.exchange.Offer Offer { - get { return result.Offer; } - set { SetOffer(value); } - } - public Builder SetOffer(global::bnet.protocol.exchange.Offer value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasOffer = true; - result.offer_ = value; - return this; - } - public Builder SetOffer(global::bnet.protocol.exchange.Offer.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasOffer = true; - result.offer_ = builderForValue.Build(); - return this; - } - public Builder MergeOffer(global::bnet.protocol.exchange.Offer value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasOffer && - result.offer_ != global::bnet.protocol.exchange.Offer.DefaultInstance) { - result.offer_ = global::bnet.protocol.exchange.Offer.CreateBuilder(result.offer_).MergeFrom(value).BuildPartial(); - } else { - result.offer_ = value; - } - result.hasOffer = true; - return this; - } - public Builder ClearOffer() { - result.hasOffer = false; - result.offer_ = global::bnet.protocol.exchange.Offer.DefaultInstance; - return this; - } - - public bool HasAuctionDuration { - get { return result.HasAuctionDuration; } - } - public ulong AuctionDuration { - get { return result.AuctionDuration; } - set { SetAuctionDuration(value); } - } - public Builder SetAuctionDuration(ulong value) { - result.hasAuctionDuration = true; - result.auctionDuration_ = value; - return this; - } - public Builder ClearAuctionDuration() { - result.hasAuctionDuration = false; - result.auctionDuration_ = 0UL; - return this; - } - - public bool HasAuctionStartDelay { - get { return result.HasAuctionStartDelay; } - } - public ulong AuctionStartDelay { - get { return result.AuctionStartDelay; } - set { SetAuctionStartDelay(value); } - } - public Builder SetAuctionStartDelay(ulong value) { - result.hasAuctionStartDelay = true; - result.auctionStartDelay_ = value; - return this; - } - public Builder ClearAuctionStartDelay() { - result.hasAuctionStartDelay = false; - result.auctionStartDelay_ = 0UL; - return this; - } - - public bool HasBillingAddress { - get { return result.HasBillingAddress; } - } - public global::bnet.protocol.exchange.BillingAddress BillingAddress { - get { return result.BillingAddress; } - set { SetBillingAddress(value); } - } - public Builder SetBillingAddress(global::bnet.protocol.exchange.BillingAddress value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBillingAddress = true; - result.billingAddress_ = value; - return this; - } - public Builder SetBillingAddress(global::bnet.protocol.exchange.BillingAddress.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBillingAddress = true; - result.billingAddress_ = builderForValue.Build(); - return this; - } - public Builder MergeBillingAddress(global::bnet.protocol.exchange.BillingAddress value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasBillingAddress && - result.billingAddress_ != global::bnet.protocol.exchange.BillingAddress.DefaultInstance) { - result.billingAddress_ = global::bnet.protocol.exchange.BillingAddress.CreateBuilder(result.billingAddress_).MergeFrom(value).BuildPartial(); - } else { - result.billingAddress_ = value; - } - result.hasBillingAddress = true; - return this; - } - public Builder ClearBillingAddress() { - result.hasBillingAddress = false; - result.billingAddress_ = global::bnet.protocol.exchange.BillingAddress.DefaultInstance; - return this; - } - } - static OfferCreation() { - object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); - } - } - - public sealed partial class Bid : pb::GeneratedMessage { - private static readonly Bid defaultInstance = new Builder().BuildPartial(); - public static Bid DefaultInstance { - get { return defaultInstance; } - } - - public override Bid DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override Bid ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_Bid__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_Bid__FieldAccessorTable; } - } - - public const int OrderFieldNumber = 1; - private bool hasOrder; - private global::bnet.protocol.exchange.Order order_ = global::bnet.protocol.exchange.Order.DefaultInstance; - public bool HasOrder { - get { return hasOrder; } - } - public global::bnet.protocol.exchange.Order Order { - get { return order_; } - } - - public const int CurrentUnitPriceFieldNumber = 2; - private bool hasCurrentUnitPrice; - private ulong currentUnitPrice_ = 0UL; - public bool HasCurrentUnitPrice { - get { return hasCurrentUnitPrice; } - } - public ulong CurrentUnitPrice { - get { return currentUnitPrice_; } - } - - public const int MaxUnitPriceFieldNumber = 3; - private bool hasMaxUnitPrice; - private ulong maxUnitPrice_ = 0UL; - public bool HasMaxUnitPrice { - get { return hasMaxUnitPrice; } - } - public ulong MaxUnitPrice { - get { return maxUnitPrice_; } - } - - public override bool IsInitialized { - get { - if (!hasOrder) return false; - if (!Order.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasOrder) { - output.WriteMessage(1, Order); - } - if (HasCurrentUnitPrice) { - output.WriteUInt64(2, CurrentUnitPrice); - } - if (HasMaxUnitPrice) { - output.WriteUInt64(3, MaxUnitPrice); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasOrder) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Order); - } - if (HasCurrentUnitPrice) { - size += pb::CodedOutputStream.ComputeUInt64Size(2, CurrentUnitPrice); - } - if (HasMaxUnitPrice) { - size += pb::CodedOutputStream.ComputeUInt64Size(3, MaxUnitPrice); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static Bid ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Bid ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Bid ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Bid ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Bid ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Bid ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Bid ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Bid ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Bid ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Bid ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Bid prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - Bid result = new Bid(); - - protected override Bid MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new Bid(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.Bid.Descriptor; } - } - - public override Bid DefaultInstanceForType { - get { return global::bnet.protocol.exchange.Bid.DefaultInstance; } - } - - public override Bid BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - Bid returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Bid) { - return MergeFrom((Bid) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Bid other) { - if (other == global::bnet.protocol.exchange.Bid.DefaultInstance) return this; - if (other.HasOrder) { - MergeOrder(other.Order); - } - if (other.HasCurrentUnitPrice) { - CurrentUnitPrice = other.CurrentUnitPrice; - } - if (other.HasMaxUnitPrice) { - MaxUnitPrice = other.MaxUnitPrice; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.Order.Builder subBuilder = global::bnet.protocol.exchange.Order.CreateBuilder(); - if (HasOrder) { - subBuilder.MergeFrom(Order); - } - input.ReadMessage(subBuilder, extensionRegistry); - Order = subBuilder.BuildPartial(); - break; - } - case 16: { - CurrentUnitPrice = input.ReadUInt64(); - break; - } - case 24: { - MaxUnitPrice = input.ReadUInt64(); - break; - } - } - } - } - - - public bool HasOrder { - get { return result.HasOrder; } - } - public global::bnet.protocol.exchange.Order Order { - get { return result.Order; } - set { SetOrder(value); } - } - public Builder SetOrder(global::bnet.protocol.exchange.Order value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasOrder = true; - result.order_ = value; - return this; - } - public Builder SetOrder(global::bnet.protocol.exchange.Order.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasOrder = true; - result.order_ = builderForValue.Build(); - return this; - } - public Builder MergeOrder(global::bnet.protocol.exchange.Order value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasOrder && - result.order_ != global::bnet.protocol.exchange.Order.DefaultInstance) { - result.order_ = global::bnet.protocol.exchange.Order.CreateBuilder(result.order_).MergeFrom(value).BuildPartial(); - } else { - result.order_ = value; - } - result.hasOrder = true; - return this; - } - public Builder ClearOrder() { - result.hasOrder = false; - result.order_ = global::bnet.protocol.exchange.Order.DefaultInstance; - return this; - } - - public bool HasCurrentUnitPrice { - get { return result.HasCurrentUnitPrice; } - } - public ulong CurrentUnitPrice { - get { return result.CurrentUnitPrice; } - set { SetCurrentUnitPrice(value); } - } - public Builder SetCurrentUnitPrice(ulong value) { - result.hasCurrentUnitPrice = true; - result.currentUnitPrice_ = value; - return this; - } - public Builder ClearCurrentUnitPrice() { - result.hasCurrentUnitPrice = false; - result.currentUnitPrice_ = 0UL; - return this; - } - - public bool HasMaxUnitPrice { - get { return result.HasMaxUnitPrice; } - } - public ulong MaxUnitPrice { - get { return result.MaxUnitPrice; } - set { SetMaxUnitPrice(value); } - } - public Builder SetMaxUnitPrice(ulong value) { - result.hasMaxUnitPrice = true; - result.maxUnitPrice_ = value; - return this; - } - public Builder ClearMaxUnitPrice() { - result.hasMaxUnitPrice = false; - result.maxUnitPrice_ = 0UL; - return this; - } - } - static Bid() { - object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); - } - } - - public sealed partial class BidExtended : pb::GeneratedMessage { - private static readonly BidExtended defaultInstance = new Builder().BuildPartial(); - public static BidExtended DefaultInstance { - get { return defaultInstance; } - } - - public override BidExtended DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override BidExtended ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_BidExtended__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_BidExtended__FieldAccessorTable; } - } - - public const int BidFieldNumber = 1; - private bool hasBid; - private global::bnet.protocol.exchange.Bid bid_ = global::bnet.protocol.exchange.Bid.DefaultInstance; - public bool HasBid { - get { return hasBid; } - } - public global::bnet.protocol.exchange.Bid Bid { - get { return bid_; } - } - - public const int ExtensionFieldNumber = 2; - private bool hasExtension; - private global::bnet.protocol.exchange.Extension extension_ = global::bnet.protocol.exchange.Extension.DefaultInstance; - public bool HasExtension { - get { return hasExtension; } - } - public global::bnet.protocol.exchange.Extension Extension { - get { return extension_; } - } - - public const int OfferOutBidPriceFieldNumber = 3; - private bool hasOfferOutBidPrice; - private ulong offerOutBidPrice_ = 0UL; - public bool HasOfferOutBidPrice { - get { return hasOfferOutBidPrice; } - } - public ulong OfferOutBidPrice { - get { return offerOutBidPrice_; } - } - - public const int OfferTradeNowPriceFieldNumber = 4; - private bool hasOfferTradeNowPrice; - private ulong offerTradeNowPrice_ = 0UL; - public bool HasOfferTradeNowPrice { - get { return hasOfferTradeNowPrice; } - } - public ulong OfferTradeNowPrice { - get { return offerTradeNowPrice_; } - } - - public const int OfferCurrentWinningPriceFieldNumber = 5; - private bool hasOfferCurrentWinningPrice; - private ulong offerCurrentWinningPrice_ = 0UL; - public bool HasOfferCurrentWinningPrice { - get { return hasOfferCurrentWinningPrice; } - } - public ulong OfferCurrentWinningPrice { - get { return offerCurrentWinningPrice_; } - } - - public override bool IsInitialized { - get { - if (!hasBid) return false; - if (!hasExtension) return false; - if (!Bid.IsInitialized) return false; - if (!Extension.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasBid) { - output.WriteMessage(1, Bid); - } - if (HasExtension) { - output.WriteMessage(2, Extension); - } - if (HasOfferOutBidPrice) { - output.WriteUInt64(3, OfferOutBidPrice); - } - if (HasOfferTradeNowPrice) { - output.WriteUInt64(4, OfferTradeNowPrice); - } - if (HasOfferCurrentWinningPrice) { - output.WriteUInt64(5, OfferCurrentWinningPrice); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasBid) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Bid); - } - if (HasExtension) { - size += pb::CodedOutputStream.ComputeMessageSize(2, Extension); - } - if (HasOfferOutBidPrice) { - size += pb::CodedOutputStream.ComputeUInt64Size(3, OfferOutBidPrice); - } - if (HasOfferTradeNowPrice) { - size += pb::CodedOutputStream.ComputeUInt64Size(4, OfferTradeNowPrice); - } - if (HasOfferCurrentWinningPrice) { - size += pb::CodedOutputStream.ComputeUInt64Size(5, OfferCurrentWinningPrice); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static BidExtended ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BidExtended ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BidExtended ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BidExtended ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BidExtended ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BidExtended ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static BidExtended ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static BidExtended ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static BidExtended ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BidExtended ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(BidExtended prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - BidExtended result = new BidExtended(); - - protected override BidExtended MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new BidExtended(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.BidExtended.Descriptor; } - } - - public override BidExtended DefaultInstanceForType { - get { return global::bnet.protocol.exchange.BidExtended.DefaultInstance; } - } - - public override BidExtended BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - BidExtended returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is BidExtended) { - return MergeFrom((BidExtended) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(BidExtended other) { - if (other == global::bnet.protocol.exchange.BidExtended.DefaultInstance) return this; - if (other.HasBid) { - MergeBid(other.Bid); - } - if (other.HasExtension) { - MergeExtension(other.Extension); - } - if (other.HasOfferOutBidPrice) { - OfferOutBidPrice = other.OfferOutBidPrice; - } - if (other.HasOfferTradeNowPrice) { - OfferTradeNowPrice = other.OfferTradeNowPrice; - } - if (other.HasOfferCurrentWinningPrice) { - OfferCurrentWinningPrice = other.OfferCurrentWinningPrice; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.Bid.Builder subBuilder = global::bnet.protocol.exchange.Bid.CreateBuilder(); - if (HasBid) { - subBuilder.MergeFrom(Bid); - } - input.ReadMessage(subBuilder, extensionRegistry); - Bid = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.exchange.Extension.Builder subBuilder = global::bnet.protocol.exchange.Extension.CreateBuilder(); - if (HasExtension) { - subBuilder.MergeFrom(Extension); - } - input.ReadMessage(subBuilder, extensionRegistry); - Extension = subBuilder.BuildPartial(); - break; - } - case 24: { - OfferOutBidPrice = input.ReadUInt64(); - break; - } - case 32: { - OfferTradeNowPrice = input.ReadUInt64(); - break; - } - case 40: { - OfferCurrentWinningPrice = input.ReadUInt64(); - break; - } - } - } - } - - - public bool HasBid { - get { return result.HasBid; } - } - public global::bnet.protocol.exchange.Bid Bid { - get { return result.Bid; } - set { SetBid(value); } - } - public Builder SetBid(global::bnet.protocol.exchange.Bid value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBid = true; - result.bid_ = value; - return this; - } - public Builder SetBid(global::bnet.protocol.exchange.Bid.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBid = true; - result.bid_ = builderForValue.Build(); - return this; - } - public Builder MergeBid(global::bnet.protocol.exchange.Bid value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasBid && - result.bid_ != global::bnet.protocol.exchange.Bid.DefaultInstance) { - result.bid_ = global::bnet.protocol.exchange.Bid.CreateBuilder(result.bid_).MergeFrom(value).BuildPartial(); - } else { - result.bid_ = value; - } - result.hasBid = true; - return this; - } - public Builder ClearBid() { - result.hasBid = false; - result.bid_ = global::bnet.protocol.exchange.Bid.DefaultInstance; - return this; - } - - public bool HasExtension { - get { return result.HasExtension; } - } - public global::bnet.protocol.exchange.Extension Extension { - get { return result.Extension; } - set { SetExtension(value); } - } - public Builder SetExtension(global::bnet.protocol.exchange.Extension value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasExtension = true; - result.extension_ = value; - return this; - } - public Builder SetExtension(global::bnet.protocol.exchange.Extension.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasExtension = true; - result.extension_ = builderForValue.Build(); - return this; - } - public Builder MergeExtension(global::bnet.protocol.exchange.Extension value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasExtension && - result.extension_ != global::bnet.protocol.exchange.Extension.DefaultInstance) { - result.extension_ = global::bnet.protocol.exchange.Extension.CreateBuilder(result.extension_).MergeFrom(value).BuildPartial(); - } else { - result.extension_ = value; - } - result.hasExtension = true; - return this; - } - public Builder ClearExtension() { - result.hasExtension = false; - result.extension_ = global::bnet.protocol.exchange.Extension.DefaultInstance; - return this; - } - - public bool HasOfferOutBidPrice { - get { return result.HasOfferOutBidPrice; } - } - public ulong OfferOutBidPrice { - get { return result.OfferOutBidPrice; } - set { SetOfferOutBidPrice(value); } - } - public Builder SetOfferOutBidPrice(ulong value) { - result.hasOfferOutBidPrice = true; - result.offerOutBidPrice_ = value; - return this; - } - public Builder ClearOfferOutBidPrice() { - result.hasOfferOutBidPrice = false; - result.offerOutBidPrice_ = 0UL; - return this; - } - - public bool HasOfferTradeNowPrice { - get { return result.HasOfferTradeNowPrice; } - } - public ulong OfferTradeNowPrice { - get { return result.OfferTradeNowPrice; } - set { SetOfferTradeNowPrice(value); } - } - public Builder SetOfferTradeNowPrice(ulong value) { - result.hasOfferTradeNowPrice = true; - result.offerTradeNowPrice_ = value; - return this; - } - public Builder ClearOfferTradeNowPrice() { - result.hasOfferTradeNowPrice = false; - result.offerTradeNowPrice_ = 0UL; - return this; - } - - public bool HasOfferCurrentWinningPrice { - get { return result.HasOfferCurrentWinningPrice; } - } - public ulong OfferCurrentWinningPrice { - get { return result.OfferCurrentWinningPrice; } - set { SetOfferCurrentWinningPrice(value); } - } - public Builder SetOfferCurrentWinningPrice(ulong value) { - result.hasOfferCurrentWinningPrice = true; - result.offerCurrentWinningPrice_ = value; - return this; - } - public Builder ClearOfferCurrentWinningPrice() { - result.hasOfferCurrentWinningPrice = false; - result.offerCurrentWinningPrice_ = 0UL; - return this; - } - } - static BidExtended() { - object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); - } - } - - public sealed partial class BidCreation : pb::GeneratedMessage { - private static readonly BidCreation defaultInstance = new Builder().BuildPartial(); - public static BidCreation DefaultInstance { - get { return defaultInstance; } - } - - public override BidCreation DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override BidCreation ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_BidCreation__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_BidCreation__FieldAccessorTable; } - } - - public const int BidFieldNumber = 1; - private bool hasBid; - private global::bnet.protocol.exchange.Bid bid_ = global::bnet.protocol.exchange.Bid.DefaultInstance; - public bool HasBid { - get { return hasBid; } - } - public global::bnet.protocol.exchange.Bid Bid { - get { return bid_; } - } - - public const int AuctionDurationFieldNumber = 2; - private bool hasAuctionDuration; - private ulong auctionDuration_ = 0UL; - public bool HasAuctionDuration { - get { return hasAuctionDuration; } - } - public ulong AuctionDuration { - get { return auctionDuration_; } - } - - public const int AuctionStartDelayFieldNumber = 3; - private bool hasAuctionStartDelay; - private ulong auctionStartDelay_ = 0UL; - public bool HasAuctionStartDelay { - get { return hasAuctionStartDelay; } - } - public ulong AuctionStartDelay { - get { return auctionStartDelay_; } - } - - public const int BillingAddressFieldNumber = 4; - private bool hasBillingAddress; - private global::bnet.protocol.exchange.BillingAddress billingAddress_ = global::bnet.protocol.exchange.BillingAddress.DefaultInstance; - public bool HasBillingAddress { - get { return hasBillingAddress; } - } - public global::bnet.protocol.exchange.BillingAddress BillingAddress { - get { return billingAddress_; } - } - - public override bool IsInitialized { - get { - if (!hasBid) return false; - if (!Bid.IsInitialized) return false; - if (HasBillingAddress) { - if (!BillingAddress.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasBid) { - output.WriteMessage(1, Bid); - } - if (HasAuctionDuration) { - output.WriteUInt64(2, AuctionDuration); - } - if (HasAuctionStartDelay) { - output.WriteUInt64(3, AuctionStartDelay); - } - if (HasBillingAddress) { - output.WriteMessage(4, BillingAddress); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasBid) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Bid); - } - if (HasAuctionDuration) { - size += pb::CodedOutputStream.ComputeUInt64Size(2, AuctionDuration); - } - if (HasAuctionStartDelay) { - size += pb::CodedOutputStream.ComputeUInt64Size(3, AuctionStartDelay); - } - if (HasBillingAddress) { - size += pb::CodedOutputStream.ComputeMessageSize(4, BillingAddress); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static BidCreation ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BidCreation ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BidCreation ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BidCreation ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BidCreation ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BidCreation ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static BidCreation ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static BidCreation ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static BidCreation ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BidCreation ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(BidCreation prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - BidCreation result = new BidCreation(); - - protected override BidCreation MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new BidCreation(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.BidCreation.Descriptor; } - } - - public override BidCreation DefaultInstanceForType { - get { return global::bnet.protocol.exchange.BidCreation.DefaultInstance; } - } - - public override BidCreation BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - BidCreation returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is BidCreation) { - return MergeFrom((BidCreation) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(BidCreation other) { - if (other == global::bnet.protocol.exchange.BidCreation.DefaultInstance) return this; - if (other.HasBid) { - MergeBid(other.Bid); - } - if (other.HasAuctionDuration) { - AuctionDuration = other.AuctionDuration; - } - if (other.HasAuctionStartDelay) { - AuctionStartDelay = other.AuctionStartDelay; - } - if (other.HasBillingAddress) { - MergeBillingAddress(other.BillingAddress); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.Bid.Builder subBuilder = global::bnet.protocol.exchange.Bid.CreateBuilder(); - if (HasBid) { - subBuilder.MergeFrom(Bid); - } - input.ReadMessage(subBuilder, extensionRegistry); - Bid = subBuilder.BuildPartial(); - break; - } - case 16: { - AuctionDuration = input.ReadUInt64(); - break; - } - case 24: { - AuctionStartDelay = input.ReadUInt64(); - break; - } - case 34: { - global::bnet.protocol.exchange.BillingAddress.Builder subBuilder = global::bnet.protocol.exchange.BillingAddress.CreateBuilder(); - if (HasBillingAddress) { - subBuilder.MergeFrom(BillingAddress); - } - input.ReadMessage(subBuilder, extensionRegistry); - BillingAddress = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasBid { - get { return result.HasBid; } - } - public global::bnet.protocol.exchange.Bid Bid { - get { return result.Bid; } - set { SetBid(value); } - } - public Builder SetBid(global::bnet.protocol.exchange.Bid value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBid = true; - result.bid_ = value; - return this; - } - public Builder SetBid(global::bnet.protocol.exchange.Bid.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBid = true; - result.bid_ = builderForValue.Build(); - return this; - } - public Builder MergeBid(global::bnet.protocol.exchange.Bid value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasBid && - result.bid_ != global::bnet.protocol.exchange.Bid.DefaultInstance) { - result.bid_ = global::bnet.protocol.exchange.Bid.CreateBuilder(result.bid_).MergeFrom(value).BuildPartial(); - } else { - result.bid_ = value; - } - result.hasBid = true; - return this; - } - public Builder ClearBid() { - result.hasBid = false; - result.bid_ = global::bnet.protocol.exchange.Bid.DefaultInstance; - return this; - } - - public bool HasAuctionDuration { - get { return result.HasAuctionDuration; } - } - public ulong AuctionDuration { - get { return result.AuctionDuration; } - set { SetAuctionDuration(value); } - } - public Builder SetAuctionDuration(ulong value) { - result.hasAuctionDuration = true; - result.auctionDuration_ = value; - return this; - } - public Builder ClearAuctionDuration() { - result.hasAuctionDuration = false; - result.auctionDuration_ = 0UL; - return this; - } - - public bool HasAuctionStartDelay { - get { return result.HasAuctionStartDelay; } - } - public ulong AuctionStartDelay { - get { return result.AuctionStartDelay; } - set { SetAuctionStartDelay(value); } - } - public Builder SetAuctionStartDelay(ulong value) { - result.hasAuctionStartDelay = true; - result.auctionStartDelay_ = value; - return this; - } - public Builder ClearAuctionStartDelay() { - result.hasAuctionStartDelay = false; - result.auctionStartDelay_ = 0UL; - return this; - } - - public bool HasBillingAddress { - get { return result.HasBillingAddress; } - } - public global::bnet.protocol.exchange.BillingAddress BillingAddress { - get { return result.BillingAddress; } - set { SetBillingAddress(value); } - } - public Builder SetBillingAddress(global::bnet.protocol.exchange.BillingAddress value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBillingAddress = true; - result.billingAddress_ = value; - return this; - } - public Builder SetBillingAddress(global::bnet.protocol.exchange.BillingAddress.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBillingAddress = true; - result.billingAddress_ = builderForValue.Build(); - return this; - } - public Builder MergeBillingAddress(global::bnet.protocol.exchange.BillingAddress value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasBillingAddress && - result.billingAddress_ != global::bnet.protocol.exchange.BillingAddress.DefaultInstance) { - result.billingAddress_ = global::bnet.protocol.exchange.BillingAddress.CreateBuilder(result.billingAddress_).MergeFrom(value).BuildPartial(); - } else { - result.billingAddress_ = value; - } - result.hasBillingAddress = true; - return this; - } - public Builder ClearBillingAddress() { - result.hasBillingAddress = false; - result.billingAddress_ = global::bnet.protocol.exchange.BillingAddress.DefaultInstance; - return this; - } - } - static BidCreation() { - object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); - } - } - - public sealed partial class QueryFilterByOrderId : pb::GeneratedMessage { - private static readonly QueryFilterByOrderId defaultInstance = new Builder().BuildPartial(); - public static QueryFilterByOrderId DefaultInstance { - get { return defaultInstance; } - } - - public override QueryFilterByOrderId DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override QueryFilterByOrderId ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_QueryFilterByOrderId__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_QueryFilterByOrderId__FieldAccessorTable; } - } - - public const int MaxResultFieldNumber = 1; - private bool hasMaxResult; - private uint maxResult_ = 0; - public bool HasMaxResult { - get { return hasMaxResult; } - } - public uint MaxResult { - get { return maxResult_; } - } - - public const int RefOrderIdFieldNumber = 2; - private bool hasRefOrderId; - private ulong refOrderId_ = 0UL; - public bool HasRefOrderId { - get { return hasRefOrderId; } - } - public ulong RefOrderId { - get { return refOrderId_; } - } - - public override bool IsInitialized { - get { - if (!hasMaxResult) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasMaxResult) { - output.WriteUInt32(1, MaxResult); - } - if (HasRefOrderId) { - output.WriteUInt64(2, RefOrderId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasMaxResult) { - size += pb::CodedOutputStream.ComputeUInt32Size(1, MaxResult); - } - if (HasRefOrderId) { - size += pb::CodedOutputStream.ComputeUInt64Size(2, RefOrderId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static QueryFilterByOrderId ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static QueryFilterByOrderId ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static QueryFilterByOrderId ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static QueryFilterByOrderId ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static QueryFilterByOrderId ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static QueryFilterByOrderId ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static QueryFilterByOrderId ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static QueryFilterByOrderId ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static QueryFilterByOrderId ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static QueryFilterByOrderId ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(QueryFilterByOrderId prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - QueryFilterByOrderId result = new QueryFilterByOrderId(); - - protected override QueryFilterByOrderId MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new QueryFilterByOrderId(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.QueryFilterByOrderId.Descriptor; } - } - - public override QueryFilterByOrderId DefaultInstanceForType { - get { return global::bnet.protocol.exchange.QueryFilterByOrderId.DefaultInstance; } - } - - public override QueryFilterByOrderId BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - QueryFilterByOrderId returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is QueryFilterByOrderId) { - return MergeFrom((QueryFilterByOrderId) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(QueryFilterByOrderId other) { - if (other == global::bnet.protocol.exchange.QueryFilterByOrderId.DefaultInstance) return this; - if (other.HasMaxResult) { - MaxResult = other.MaxResult; - } - if (other.HasRefOrderId) { - RefOrderId = other.RefOrderId; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - MaxResult = input.ReadUInt32(); - break; - } - case 16: { - RefOrderId = input.ReadUInt64(); - break; - } - } - } - } - - - public bool HasMaxResult { - get { return result.HasMaxResult; } - } - public uint MaxResult { - get { return result.MaxResult; } - set { SetMaxResult(value); } - } - public Builder SetMaxResult(uint value) { - result.hasMaxResult = true; - result.maxResult_ = value; - return this; - } - public Builder ClearMaxResult() { - result.hasMaxResult = false; - result.maxResult_ = 0; - return this; - } - - public bool HasRefOrderId { - get { return result.HasRefOrderId; } - } - public ulong RefOrderId { - get { return result.RefOrderId; } - set { SetRefOrderId(value); } - } - public Builder SetRefOrderId(ulong value) { - result.hasRefOrderId = true; - result.refOrderId_ = value; - return this; - } - public Builder ClearRefOrderId() { - result.hasRefOrderId = false; - result.refOrderId_ = 0UL; - return this; - } - } - static QueryFilterByOrderId() { - object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); - } - } - - public sealed partial class QueryFilterByCreatedTime : pb::GeneratedMessage { - private static readonly QueryFilterByCreatedTime defaultInstance = new Builder().BuildPartial(); - public static QueryFilterByCreatedTime DefaultInstance { - get { return defaultInstance; } - } - - public override QueryFilterByCreatedTime DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override QueryFilterByCreatedTime ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_QueryFilterByCreatedTime__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_QueryFilterByCreatedTime__FieldAccessorTable; } - } - - public const int MaxResultFieldNumber = 1; - private bool hasMaxResult; - private uint maxResult_ = 0; - public bool HasMaxResult { - get { return hasMaxResult; } - } - public uint MaxResult { - get { return maxResult_; } - } - - public const int RefCreatedTimeFieldNumber = 2; - private bool hasRefCreatedTime; - private ulong refCreatedTime_ = 0UL; - public bool HasRefCreatedTime { - get { return hasRefCreatedTime; } - } - public ulong RefCreatedTime { - get { return refCreatedTime_; } - } - - public override bool IsInitialized { - get { - if (!hasMaxResult) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasMaxResult) { - output.WriteUInt32(1, MaxResult); - } - if (HasRefCreatedTime) { - output.WriteUInt64(2, RefCreatedTime); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasMaxResult) { - size += pb::CodedOutputStream.ComputeUInt32Size(1, MaxResult); - } - if (HasRefCreatedTime) { - size += pb::CodedOutputStream.ComputeUInt64Size(2, RefCreatedTime); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static QueryFilterByCreatedTime ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static QueryFilterByCreatedTime ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static QueryFilterByCreatedTime ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static QueryFilterByCreatedTime ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static QueryFilterByCreatedTime ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static QueryFilterByCreatedTime ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static QueryFilterByCreatedTime ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static QueryFilterByCreatedTime ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static QueryFilterByCreatedTime ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static QueryFilterByCreatedTime ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(QueryFilterByCreatedTime prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - QueryFilterByCreatedTime result = new QueryFilterByCreatedTime(); - - protected override QueryFilterByCreatedTime MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new QueryFilterByCreatedTime(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.QueryFilterByCreatedTime.Descriptor; } - } - - public override QueryFilterByCreatedTime DefaultInstanceForType { - get { return global::bnet.protocol.exchange.QueryFilterByCreatedTime.DefaultInstance; } - } - - public override QueryFilterByCreatedTime BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - QueryFilterByCreatedTime returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is QueryFilterByCreatedTime) { - return MergeFrom((QueryFilterByCreatedTime) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(QueryFilterByCreatedTime other) { - if (other == global::bnet.protocol.exchange.QueryFilterByCreatedTime.DefaultInstance) return this; - if (other.HasMaxResult) { - MaxResult = other.MaxResult; - } - if (other.HasRefCreatedTime) { - RefCreatedTime = other.RefCreatedTime; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - MaxResult = input.ReadUInt32(); - break; - } - case 16: { - RefCreatedTime = input.ReadUInt64(); - break; - } - } - } - } - - - public bool HasMaxResult { - get { return result.HasMaxResult; } - } - public uint MaxResult { - get { return result.MaxResult; } - set { SetMaxResult(value); } - } - public Builder SetMaxResult(uint value) { - result.hasMaxResult = true; - result.maxResult_ = value; - return this; - } - public Builder ClearMaxResult() { - result.hasMaxResult = false; - result.maxResult_ = 0; - return this; - } - - public bool HasRefCreatedTime { - get { return result.HasRefCreatedTime; } - } - public ulong RefCreatedTime { - get { return result.RefCreatedTime; } - set { SetRefCreatedTime(value); } - } - public Builder SetRefCreatedTime(ulong value) { - result.hasRefCreatedTime = true; - result.refCreatedTime_ = value; - return this; - } - public Builder ClearRefCreatedTime() { - result.hasRefCreatedTime = false; - result.refCreatedTime_ = 0UL; - return this; - } - } - static QueryFilterByCreatedTime() { - object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); - } - } - - public sealed partial class Settlement : pb::GeneratedMessage { - private static readonly Settlement defaultInstance = new Builder().BuildPartial(); - public static Settlement DefaultInstance { - get { return defaultInstance; } - } - - public override Settlement DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override Settlement ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_Settlement__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_Settlement__FieldAccessorTable; } - } - - public const int OrderBookIdFieldNumber = 1; - private bool hasOrderBookId; - private ulong orderBookId_ = 0UL; - public bool HasOrderBookId { - get { return hasOrderBookId; } - } - public ulong OrderBookId { - get { return orderBookId_; } - } - - public const int MoneyAmountFieldNumber = 2; - private bool hasMoneyAmount; - private ulong moneyAmount_ = 0UL; - public bool HasMoneyAmount { - get { return hasMoneyAmount; } - } - public ulong MoneyAmount { - get { return moneyAmount_; } - } - - public const int ItemsAmountFieldNumber = 3; - private bool hasItemsAmount; - private ulong itemsAmount_ = 0UL; - public bool HasItemsAmount { - get { return hasItemsAmount; } - } - public ulong ItemsAmount { - get { return itemsAmount_; } - } - - public const int OfferSettleIdFieldNumber = 4; - private bool hasOfferSettleId; - private ulong offerSettleId_ = 0UL; - public bool HasOfferSettleId { - get { return hasOfferSettleId; } - } - public ulong OfferSettleId { - get { return offerSettleId_; } - } - - public override bool IsInitialized { - get { - if (!hasOrderBookId) return false; - if (!hasMoneyAmount) return false; - if (!hasItemsAmount) return false; - if (!hasOfferSettleId) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasOrderBookId) { - output.WriteUInt64(1, OrderBookId); - } - if (HasMoneyAmount) { - output.WriteUInt64(2, MoneyAmount); - } - if (HasItemsAmount) { - output.WriteUInt64(3, ItemsAmount); - } - if (HasOfferSettleId) { - output.WriteUInt64(4, OfferSettleId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasOrderBookId) { - size += pb::CodedOutputStream.ComputeUInt64Size(1, OrderBookId); - } - if (HasMoneyAmount) { - size += pb::CodedOutputStream.ComputeUInt64Size(2, MoneyAmount); - } - if (HasItemsAmount) { - size += pb::CodedOutputStream.ComputeUInt64Size(3, ItemsAmount); - } - if (HasOfferSettleId) { - size += pb::CodedOutputStream.ComputeUInt64Size(4, OfferSettleId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static Settlement ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Settlement ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Settlement ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Settlement ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Settlement ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Settlement ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Settlement ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Settlement ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Settlement ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Settlement ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Settlement prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - Settlement result = new Settlement(); - - protected override Settlement MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new Settlement(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.Settlement.Descriptor; } - } - - public override Settlement DefaultInstanceForType { - get { return global::bnet.protocol.exchange.Settlement.DefaultInstance; } - } - - public override Settlement BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - Settlement returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Settlement) { - return MergeFrom((Settlement) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Settlement other) { - if (other == global::bnet.protocol.exchange.Settlement.DefaultInstance) return this; - if (other.HasOrderBookId) { - OrderBookId = other.OrderBookId; - } - if (other.HasMoneyAmount) { - MoneyAmount = other.MoneyAmount; - } - if (other.HasItemsAmount) { - ItemsAmount = other.ItemsAmount; - } - if (other.HasOfferSettleId) { - OfferSettleId = other.OfferSettleId; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - OrderBookId = input.ReadUInt64(); - break; - } - case 16: { - MoneyAmount = input.ReadUInt64(); - break; - } - case 24: { - ItemsAmount = input.ReadUInt64(); - break; - } - case 32: { - OfferSettleId = input.ReadUInt64(); - break; - } - } - } - } - - - public bool HasOrderBookId { - get { return result.HasOrderBookId; } - } - public ulong OrderBookId { - get { return result.OrderBookId; } - set { SetOrderBookId(value); } - } - public Builder SetOrderBookId(ulong value) { - result.hasOrderBookId = true; - result.orderBookId_ = value; - return this; - } - public Builder ClearOrderBookId() { - result.hasOrderBookId = false; - result.orderBookId_ = 0UL; - return this; - } - - public bool HasMoneyAmount { - get { return result.HasMoneyAmount; } - } - public ulong MoneyAmount { - get { return result.MoneyAmount; } - set { SetMoneyAmount(value); } - } - public Builder SetMoneyAmount(ulong value) { - result.hasMoneyAmount = true; - result.moneyAmount_ = value; - return this; - } - public Builder ClearMoneyAmount() { - result.hasMoneyAmount = false; - result.moneyAmount_ = 0UL; - return this; - } - - public bool HasItemsAmount { - get { return result.HasItemsAmount; } - } - public ulong ItemsAmount { - get { return result.ItemsAmount; } - set { SetItemsAmount(value); } - } - public Builder SetItemsAmount(ulong value) { - result.hasItemsAmount = true; - result.itemsAmount_ = value; - return this; - } - public Builder ClearItemsAmount() { - result.hasItemsAmount = false; - result.itemsAmount_ = 0UL; - return this; - } - - public bool HasOfferSettleId { - get { return result.HasOfferSettleId; } - } - public ulong OfferSettleId { - get { return result.OfferSettleId; } - set { SetOfferSettleId(value); } - } - public Builder SetOfferSettleId(ulong value) { - result.hasOfferSettleId = true; - result.offerSettleId_ = value; - return this; - } - public Builder ClearOfferSettleId() { - result.hasOfferSettleId = false; - result.offerSettleId_ = 0UL; - return this; - } - } - static Settlement() { - object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); - } - } - - public sealed partial class CurrencyConfig : pb::GeneratedMessage { - private static readonly CurrencyConfig defaultInstance = new Builder().BuildPartial(); - public static CurrencyConfig DefaultInstance { - get { return defaultInstance; } - } - - public override CurrencyConfig DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override CurrencyConfig ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_CurrencyConfig__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_CurrencyConfig__FieldAccessorTable; } - } - - public const int CurrencyFieldNumber = 1; - private bool hasCurrency; - private string currency_ = ""; - public bool HasCurrency { - get { return hasCurrency; } - } - public string Currency { - get { return currency_; } - } - - public const int TickSizeFieldNumber = 2; - private bool hasTickSize; - private ulong tickSize_ = 0UL; - public bool HasTickSize { - get { return hasTickSize; } - } - public ulong TickSize { - get { return tickSize_; } - } - - public const int FlatOutbidIncrFieldNumber = 3; - private bool hasFlatOutbidIncr; - private ulong flatOutbidIncr_ = 0UL; - public bool HasFlatOutbidIncr { - get { return hasFlatOutbidIncr; } - } - public ulong FlatOutbidIncr { - get { return flatOutbidIncr_; } - } - - public const int ScaleOutbidIncrFieldNumber = 4; - private bool hasScaleOutbidIncr; - private ulong scaleOutbidIncr_ = 0UL; - public bool HasScaleOutbidIncr { - get { return hasScaleOutbidIncr; } - } - public ulong ScaleOutbidIncr { - get { return scaleOutbidIncr_; } - } - - public const int MinStartingUnitPriceFieldNumber = 5; - private bool hasMinStartingUnitPrice; - private ulong minStartingUnitPrice_ = 0UL; - public bool HasMinStartingUnitPrice { - get { return hasMinStartingUnitPrice; } - } - public ulong MinStartingUnitPrice { - get { return minStartingUnitPrice_; } - } - - public const int MaxStartingUnitPriceFieldNumber = 6; - private bool hasMaxStartingUnitPrice; - private ulong maxStartingUnitPrice_ = 0UL; - public bool HasMaxStartingUnitPrice { - get { return hasMaxStartingUnitPrice; } - } - public ulong MaxStartingUnitPrice { - get { return maxStartingUnitPrice_; } - } - - public const int MaxUnitPriceFieldNumber = 7; - private bool hasMaxUnitPrice; - private ulong maxUnitPrice_ = 0UL; - public bool HasMaxUnitPrice { - get { return hasMaxUnitPrice; } - } - public ulong MaxUnitPrice { - get { return maxUnitPrice_; } - } - - public const int MaxTotalAmountFieldNumber = 8; - private bool hasMaxTotalAmount; - private ulong maxTotalAmount_ = 0UL; - public bool HasMaxTotalAmount { - get { return hasMaxTotalAmount; } - } - public ulong MaxTotalAmount { - get { return maxTotalAmount_; } - } - - public const int BuyoutRuleFieldNumber = 9; - private bool hasBuyoutRule; - private int buyoutRule_ = 0; - public bool HasBuyoutRule { - get { return hasBuyoutRule; } - } - public int BuyoutRule { - get { return buyoutRule_; } - } - - public override bool IsInitialized { - get { - if (!hasCurrency) return false; - if (!hasTickSize) return false; - if (!hasFlatOutbidIncr) return false; - if (!hasScaleOutbidIncr) return false; - if (!hasMinStartingUnitPrice) return false; - if (!hasMaxStartingUnitPrice) return false; - if (!hasMaxUnitPrice) return false; - if (!hasMaxTotalAmount) return false; - if (!hasBuyoutRule) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasCurrency) { - output.WriteString(1, Currency); - } - if (HasTickSize) { - output.WriteUInt64(2, TickSize); - } - if (HasFlatOutbidIncr) { - output.WriteUInt64(3, FlatOutbidIncr); - } - if (HasScaleOutbidIncr) { - output.WriteUInt64(4, ScaleOutbidIncr); - } - if (HasMinStartingUnitPrice) { - output.WriteUInt64(5, MinStartingUnitPrice); - } - if (HasMaxStartingUnitPrice) { - output.WriteUInt64(6, MaxStartingUnitPrice); - } - if (HasMaxUnitPrice) { - output.WriteUInt64(7, MaxUnitPrice); - } - if (HasMaxTotalAmount) { - output.WriteUInt64(8, MaxTotalAmount); - } - if (HasBuyoutRule) { - output.WriteInt32(9, BuyoutRule); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasCurrency) { - size += pb::CodedOutputStream.ComputeStringSize(1, Currency); - } - if (HasTickSize) { - size += pb::CodedOutputStream.ComputeUInt64Size(2, TickSize); - } - if (HasFlatOutbidIncr) { - size += pb::CodedOutputStream.ComputeUInt64Size(3, FlatOutbidIncr); - } - if (HasScaleOutbidIncr) { - size += pb::CodedOutputStream.ComputeUInt64Size(4, ScaleOutbidIncr); - } - if (HasMinStartingUnitPrice) { - size += pb::CodedOutputStream.ComputeUInt64Size(5, MinStartingUnitPrice); - } - if (HasMaxStartingUnitPrice) { - size += pb::CodedOutputStream.ComputeUInt64Size(6, MaxStartingUnitPrice); - } - if (HasMaxUnitPrice) { - size += pb::CodedOutputStream.ComputeUInt64Size(7, MaxUnitPrice); - } - if (HasMaxTotalAmount) { - size += pb::CodedOutputStream.ComputeUInt64Size(8, MaxTotalAmount); - } - if (HasBuyoutRule) { - size += pb::CodedOutputStream.ComputeInt32Size(9, BuyoutRule); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static CurrencyConfig ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CurrencyConfig ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CurrencyConfig ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CurrencyConfig ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CurrencyConfig ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CurrencyConfig ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CurrencyConfig ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CurrencyConfig ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CurrencyConfig ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CurrencyConfig ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CurrencyConfig prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - CurrencyConfig result = new CurrencyConfig(); - - protected override CurrencyConfig MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new CurrencyConfig(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.CurrencyConfig.Descriptor; } - } - - public override CurrencyConfig DefaultInstanceForType { - get { return global::bnet.protocol.exchange.CurrencyConfig.DefaultInstance; } - } - - public override CurrencyConfig BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - CurrencyConfig returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CurrencyConfig) { - return MergeFrom((CurrencyConfig) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CurrencyConfig other) { - if (other == global::bnet.protocol.exchange.CurrencyConfig.DefaultInstance) return this; - if (other.HasCurrency) { - Currency = other.Currency; - } - if (other.HasTickSize) { - TickSize = other.TickSize; - } - if (other.HasFlatOutbidIncr) { - FlatOutbidIncr = other.FlatOutbidIncr; - } - if (other.HasScaleOutbidIncr) { - ScaleOutbidIncr = other.ScaleOutbidIncr; - } - if (other.HasMinStartingUnitPrice) { - MinStartingUnitPrice = other.MinStartingUnitPrice; - } - if (other.HasMaxStartingUnitPrice) { - MaxStartingUnitPrice = other.MaxStartingUnitPrice; - } - if (other.HasMaxUnitPrice) { - MaxUnitPrice = other.MaxUnitPrice; - } - if (other.HasMaxTotalAmount) { - MaxTotalAmount = other.MaxTotalAmount; - } - if (other.HasBuyoutRule) { - BuyoutRule = other.BuyoutRule; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - Currency = input.ReadString(); - break; - } - case 16: { - TickSize = input.ReadUInt64(); - break; - } - case 24: { - FlatOutbidIncr = input.ReadUInt64(); - break; - } - case 32: { - ScaleOutbidIncr = input.ReadUInt64(); - break; - } - case 40: { - MinStartingUnitPrice = input.ReadUInt64(); - break; - } - case 48: { - MaxStartingUnitPrice = input.ReadUInt64(); - break; - } - case 56: { - MaxUnitPrice = input.ReadUInt64(); - break; - } - case 64: { - MaxTotalAmount = input.ReadUInt64(); - break; - } - case 72: { - BuyoutRule = input.ReadInt32(); - break; - } - } - } - } - - - public bool HasCurrency { - get { return result.HasCurrency; } - } - public string Currency { - get { return result.Currency; } - set { SetCurrency(value); } - } - public Builder SetCurrency(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasCurrency = true; - result.currency_ = value; - return this; - } - public Builder ClearCurrency() { - result.hasCurrency = false; - result.currency_ = ""; - return this; - } - - public bool HasTickSize { - get { return result.HasTickSize; } - } - public ulong TickSize { - get { return result.TickSize; } - set { SetTickSize(value); } - } - public Builder SetTickSize(ulong value) { - result.hasTickSize = true; - result.tickSize_ = value; - return this; - } - public Builder ClearTickSize() { - result.hasTickSize = false; - result.tickSize_ = 0UL; - return this; - } - - public bool HasFlatOutbidIncr { - get { return result.HasFlatOutbidIncr; } - } - public ulong FlatOutbidIncr { - get { return result.FlatOutbidIncr; } - set { SetFlatOutbidIncr(value); } - } - public Builder SetFlatOutbidIncr(ulong value) { - result.hasFlatOutbidIncr = true; - result.flatOutbidIncr_ = value; - return this; - } - public Builder ClearFlatOutbidIncr() { - result.hasFlatOutbidIncr = false; - result.flatOutbidIncr_ = 0UL; - return this; - } - - public bool HasScaleOutbidIncr { - get { return result.HasScaleOutbidIncr; } - } - public ulong ScaleOutbidIncr { - get { return result.ScaleOutbidIncr; } - set { SetScaleOutbidIncr(value); } - } - public Builder SetScaleOutbidIncr(ulong value) { - result.hasScaleOutbidIncr = true; - result.scaleOutbidIncr_ = value; - return this; - } - public Builder ClearScaleOutbidIncr() { - result.hasScaleOutbidIncr = false; - result.scaleOutbidIncr_ = 0UL; - return this; - } - - public bool HasMinStartingUnitPrice { - get { return result.HasMinStartingUnitPrice; } - } - public ulong MinStartingUnitPrice { - get { return result.MinStartingUnitPrice; } - set { SetMinStartingUnitPrice(value); } - } - public Builder SetMinStartingUnitPrice(ulong value) { - result.hasMinStartingUnitPrice = true; - result.minStartingUnitPrice_ = value; - return this; - } - public Builder ClearMinStartingUnitPrice() { - result.hasMinStartingUnitPrice = false; - result.minStartingUnitPrice_ = 0UL; - return this; - } - - public bool HasMaxStartingUnitPrice { - get { return result.HasMaxStartingUnitPrice; } - } - public ulong MaxStartingUnitPrice { - get { return result.MaxStartingUnitPrice; } - set { SetMaxStartingUnitPrice(value); } - } - public Builder SetMaxStartingUnitPrice(ulong value) { - result.hasMaxStartingUnitPrice = true; - result.maxStartingUnitPrice_ = value; - return this; - } - public Builder ClearMaxStartingUnitPrice() { - result.hasMaxStartingUnitPrice = false; - result.maxStartingUnitPrice_ = 0UL; - return this; - } - - public bool HasMaxUnitPrice { - get { return result.HasMaxUnitPrice; } - } - public ulong MaxUnitPrice { - get { return result.MaxUnitPrice; } - set { SetMaxUnitPrice(value); } - } - public Builder SetMaxUnitPrice(ulong value) { - result.hasMaxUnitPrice = true; - result.maxUnitPrice_ = value; - return this; - } - public Builder ClearMaxUnitPrice() { - result.hasMaxUnitPrice = false; - result.maxUnitPrice_ = 0UL; - return this; - } - - public bool HasMaxTotalAmount { - get { return result.HasMaxTotalAmount; } - } - public ulong MaxTotalAmount { - get { return result.MaxTotalAmount; } - set { SetMaxTotalAmount(value); } - } - public Builder SetMaxTotalAmount(ulong value) { - result.hasMaxTotalAmount = true; - result.maxTotalAmount_ = value; - return this; - } - public Builder ClearMaxTotalAmount() { - result.hasMaxTotalAmount = false; - result.maxTotalAmount_ = 0UL; - return this; - } - - public bool HasBuyoutRule { - get { return result.HasBuyoutRule; } - } - public int BuyoutRule { - get { return result.BuyoutRule; } - set { SetBuyoutRule(value); } - } - public Builder SetBuyoutRule(int value) { - result.hasBuyoutRule = true; - result.buyoutRule_ = value; - return this; - } - public Builder ClearBuyoutRule() { - result.hasBuyoutRule = false; - result.buyoutRule_ = 0; - return this; - } - } - static CurrencyConfig() { - object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); - } - } - - public sealed partial class SpecialistConfig : pb::GeneratedMessage { - private static readonly SpecialistConfig defaultInstance = new Builder().BuildPartial(); - public static SpecialistConfig DefaultInstance { - get { return defaultInstance; } - } - - public override SpecialistConfig DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override SpecialistConfig ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_SpecialistConfig__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_SpecialistConfig__FieldAccessorTable; } - } - - public const int SpecialistFieldNumber = 1; - private bool hasSpecialist; - private int specialist_ = 0; - public bool HasSpecialist { - get { return hasSpecialist; } - } - public int Specialist { - get { return specialist_; } - } - - public const int AuctionDurationsFieldNumber = 2; - private pbc::PopsicleList auctionDurations_ = new pbc::PopsicleList(); - public scg::IList AuctionDurationsList { - get { return pbc::Lists.AsReadOnly(auctionDurations_); } - } - public int AuctionDurationsCount { - get { return auctionDurations_.Count; } - } - public ulong GetAuctionDurations(int index) { - return auctionDurations_[index]; - } - - public const int AuctionStartDelaysFieldNumber = 3; - private pbc::PopsicleList auctionStartDelays_ = new pbc::PopsicleList(); - public scg::IList AuctionStartDelaysList { - get { return pbc::Lists.AsReadOnly(auctionStartDelays_); } - } - public int AuctionStartDelaysCount { - get { return auctionStartDelays_.Count; } - } - public ulong GetAuctionStartDelays(int index) { - return auctionStartDelays_[index]; - } - - public const int AntiSnipingExtensionDelayFieldNumber = 4; - private bool hasAntiSnipingExtensionDelay; - private ulong antiSnipingExtensionDelay_ = 0UL; - public bool HasAntiSnipingExtensionDelay { - get { return hasAntiSnipingExtensionDelay; } - } - public ulong AntiSnipingExtensionDelay { - get { return antiSnipingExtensionDelay_; } - } - - public const int CurrencyConfigFieldNumber = 5; - private pbc::PopsicleList currencyConfig_ = new pbc::PopsicleList(); - public scg::IList CurrencyConfigList { - get { return currencyConfig_; } - } - public int CurrencyConfigCount { - get { return currencyConfig_.Count; } - } - public global::bnet.protocol.exchange.CurrencyConfig GetCurrencyConfig(int index) { - return currencyConfig_[index]; - } - - public override bool IsInitialized { - get { - if (!hasSpecialist) return false; - if (!hasAntiSnipingExtensionDelay) return false; - foreach (global::bnet.protocol.exchange.CurrencyConfig element in CurrencyConfigList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasSpecialist) { - output.WriteInt32(1, Specialist); - } - if (auctionDurations_.Count > 0) { - foreach (ulong element in auctionDurations_) { - output.WriteUInt64(2, element); - } - } - if (auctionStartDelays_.Count > 0) { - foreach (ulong element in auctionStartDelays_) { - output.WriteUInt64(3, element); - } - } - if (HasAntiSnipingExtensionDelay) { - output.WriteUInt64(4, AntiSnipingExtensionDelay); - } - foreach (global::bnet.protocol.exchange.CurrencyConfig element in CurrencyConfigList) { - output.WriteMessage(5, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasSpecialist) { - size += pb::CodedOutputStream.ComputeInt32Size(1, Specialist); - } - { - int dataSize = 0; - foreach (ulong element in AuctionDurationsList) { - dataSize += pb::CodedOutputStream.ComputeUInt64SizeNoTag(element); - } - size += dataSize; - size += 1 * auctionDurations_.Count; - } - { - int dataSize = 0; - foreach (ulong element in AuctionStartDelaysList) { - dataSize += pb::CodedOutputStream.ComputeUInt64SizeNoTag(element); - } - size += dataSize; - size += 1 * auctionStartDelays_.Count; - } - if (HasAntiSnipingExtensionDelay) { - size += pb::CodedOutputStream.ComputeUInt64Size(4, AntiSnipingExtensionDelay); - } - foreach (global::bnet.protocol.exchange.CurrencyConfig element in CurrencyConfigList) { - size += pb::CodedOutputStream.ComputeMessageSize(5, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static SpecialistConfig ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SpecialistConfig ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SpecialistConfig ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SpecialistConfig ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SpecialistConfig ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SpecialistConfig ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SpecialistConfig ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SpecialistConfig ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SpecialistConfig ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SpecialistConfig ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SpecialistConfig prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - SpecialistConfig result = new SpecialistConfig(); - - protected override SpecialistConfig MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new SpecialistConfig(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.SpecialistConfig.Descriptor; } - } - - public override SpecialistConfig DefaultInstanceForType { - get { return global::bnet.protocol.exchange.SpecialistConfig.DefaultInstance; } - } - - public override SpecialistConfig BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.auctionDurations_.MakeReadOnly(); - result.auctionStartDelays_.MakeReadOnly(); - result.currencyConfig_.MakeReadOnly(); - SpecialistConfig returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SpecialistConfig) { - return MergeFrom((SpecialistConfig) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SpecialistConfig other) { - if (other == global::bnet.protocol.exchange.SpecialistConfig.DefaultInstance) return this; - if (other.HasSpecialist) { - Specialist = other.Specialist; - } - if (other.auctionDurations_.Count != 0) { - base.AddRange(other.auctionDurations_, result.auctionDurations_); - } - if (other.auctionStartDelays_.Count != 0) { - base.AddRange(other.auctionStartDelays_, result.auctionStartDelays_); - } - if (other.HasAntiSnipingExtensionDelay) { - AntiSnipingExtensionDelay = other.AntiSnipingExtensionDelay; - } - if (other.currencyConfig_.Count != 0) { - base.AddRange(other.currencyConfig_, result.currencyConfig_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - Specialist = input.ReadInt32(); - break; - } - case 16: { - AddAuctionDurations(input.ReadUInt64()); - break; - } - case 24: { - AddAuctionStartDelays(input.ReadUInt64()); - break; - } - case 32: { - AntiSnipingExtensionDelay = input.ReadUInt64(); - break; - } - case 42: { - global::bnet.protocol.exchange.CurrencyConfig.Builder subBuilder = global::bnet.protocol.exchange.CurrencyConfig.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddCurrencyConfig(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public bool HasSpecialist { - get { return result.HasSpecialist; } - } - public int Specialist { - get { return result.Specialist; } - set { SetSpecialist(value); } - } - public Builder SetSpecialist(int value) { - result.hasSpecialist = true; - result.specialist_ = value; - return this; - } - public Builder ClearSpecialist() { - result.hasSpecialist = false; - result.specialist_ = 0; - return this; - } - - public pbc::IPopsicleList AuctionDurationsList { - get { return result.auctionDurations_; } - } - public int AuctionDurationsCount { - get { return result.AuctionDurationsCount; } - } - public ulong GetAuctionDurations(int index) { - return result.GetAuctionDurations(index); - } - public Builder SetAuctionDurations(int index, ulong value) { - result.auctionDurations_[index] = value; - return this; - } - public Builder AddAuctionDurations(ulong value) { - result.auctionDurations_.Add(value); - return this; - } - public Builder AddRangeAuctionDurations(scg::IEnumerable values) { - base.AddRange(values, result.auctionDurations_); - return this; - } - public Builder ClearAuctionDurations() { - result.auctionDurations_.Clear(); - return this; - } - - public pbc::IPopsicleList AuctionStartDelaysList { - get { return result.auctionStartDelays_; } - } - public int AuctionStartDelaysCount { - get { return result.AuctionStartDelaysCount; } - } - public ulong GetAuctionStartDelays(int index) { - return result.GetAuctionStartDelays(index); - } - public Builder SetAuctionStartDelays(int index, ulong value) { - result.auctionStartDelays_[index] = value; - return this; - } - public Builder AddAuctionStartDelays(ulong value) { - result.auctionStartDelays_.Add(value); - return this; - } - public Builder AddRangeAuctionStartDelays(scg::IEnumerable values) { - base.AddRange(values, result.auctionStartDelays_); - return this; - } - public Builder ClearAuctionStartDelays() { - result.auctionStartDelays_.Clear(); - return this; - } - - public bool HasAntiSnipingExtensionDelay { - get { return result.HasAntiSnipingExtensionDelay; } - } - public ulong AntiSnipingExtensionDelay { - get { return result.AntiSnipingExtensionDelay; } - set { SetAntiSnipingExtensionDelay(value); } - } - public Builder SetAntiSnipingExtensionDelay(ulong value) { - result.hasAntiSnipingExtensionDelay = true; - result.antiSnipingExtensionDelay_ = value; - return this; - } - public Builder ClearAntiSnipingExtensionDelay() { - result.hasAntiSnipingExtensionDelay = false; - result.antiSnipingExtensionDelay_ = 0UL; - return this; - } - - public pbc::IPopsicleList CurrencyConfigList { - get { return result.currencyConfig_; } - } - public int CurrencyConfigCount { - get { return result.CurrencyConfigCount; } - } - public global::bnet.protocol.exchange.CurrencyConfig GetCurrencyConfig(int index) { - return result.GetCurrencyConfig(index); - } - public Builder SetCurrencyConfig(int index, global::bnet.protocol.exchange.CurrencyConfig value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.currencyConfig_[index] = value; - return this; - } - public Builder SetCurrencyConfig(int index, global::bnet.protocol.exchange.CurrencyConfig.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.currencyConfig_[index] = builderForValue.Build(); - return this; - } - public Builder AddCurrencyConfig(global::bnet.protocol.exchange.CurrencyConfig value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.currencyConfig_.Add(value); - return this; - } - public Builder AddCurrencyConfig(global::bnet.protocol.exchange.CurrencyConfig.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.currencyConfig_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeCurrencyConfig(scg::IEnumerable values) { - base.AddRange(values, result.currencyConfig_); - return this; - } - public Builder ClearCurrencyConfig() { - result.currencyConfig_.Clear(); - return this; - } - } - static SpecialistConfig() { - object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); - } - } - - public sealed partial class BillingAddress : pb::GeneratedMessage { - private static readonly BillingAddress defaultInstance = new Builder().BuildPartial(); - public static BillingAddress DefaultInstance { - get { return defaultInstance; } - } - - public override BillingAddress DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override BillingAddress ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_BillingAddress__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_BillingAddress__FieldAccessorTable; } - } - - public const int CountryIdFieldNumber = 1; - private bool hasCountryId; - private int countryId_ = 0; - public bool HasCountryId { - get { return hasCountryId; } - } - public int CountryId { - get { return countryId_; } - } - - public const int CityFieldNumber = 2; - private bool hasCity; - private string city_ = ""; - public bool HasCity { - get { return hasCity; } - } - public string City { - get { return city_; } - } - - public const int StateFieldNumber = 3; - private bool hasState; - private string state_ = ""; - public bool HasState { - get { return hasState; } - } - public string State { - get { return state_; } - } - - public const int PostalCodeFieldNumber = 4; - private bool hasPostalCode; - private string postalCode_ = ""; - public bool HasPostalCode { - get { return hasPostalCode; } - } - public string PostalCode { - get { return postalCode_; } - } - - public override bool IsInitialized { - get { - if (!hasCountryId) return false; - if (!hasCity) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasCountryId) { - output.WriteInt32(1, CountryId); - } - if (HasCity) { - output.WriteString(2, City); - } - if (HasState) { - output.WriteString(3, State); - } - if (HasPostalCode) { - output.WriteString(4, PostalCode); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasCountryId) { - size += pb::CodedOutputStream.ComputeInt32Size(1, CountryId); - } - if (HasCity) { - size += pb::CodedOutputStream.ComputeStringSize(2, City); - } - if (HasState) { - size += pb::CodedOutputStream.ComputeStringSize(3, State); - } - if (HasPostalCode) { - size += pb::CodedOutputStream.ComputeStringSize(4, PostalCode); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static BillingAddress ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BillingAddress ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BillingAddress ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BillingAddress ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BillingAddress ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BillingAddress ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static BillingAddress ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static BillingAddress ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static BillingAddress ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BillingAddress ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(BillingAddress prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - BillingAddress result = new BillingAddress(); - - protected override BillingAddress MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new BillingAddress(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.BillingAddress.Descriptor; } - } - - public override BillingAddress DefaultInstanceForType { - get { return global::bnet.protocol.exchange.BillingAddress.DefaultInstance; } - } - - public override BillingAddress BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - BillingAddress returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is BillingAddress) { - return MergeFrom((BillingAddress) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(BillingAddress other) { - if (other == global::bnet.protocol.exchange.BillingAddress.DefaultInstance) return this; - if (other.HasCountryId) { - CountryId = other.CountryId; - } - if (other.HasCity) { - City = other.City; - } - if (other.HasState) { - State = other.State; - } - if (other.HasPostalCode) { - PostalCode = other.PostalCode; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - CountryId = input.ReadInt32(); - break; - } - case 18: { - City = input.ReadString(); - break; - } - case 26: { - State = input.ReadString(); - break; - } - case 34: { - PostalCode = input.ReadString(); - break; - } - } - } - } - - - public bool HasCountryId { - get { return result.HasCountryId; } - } - public int CountryId { - get { return result.CountryId; } - set { SetCountryId(value); } - } - public Builder SetCountryId(int value) { - result.hasCountryId = true; - result.countryId_ = value; - return this; - } - public Builder ClearCountryId() { - result.hasCountryId = false; - result.countryId_ = 0; - return this; - } - - public bool HasCity { - get { return result.HasCity; } - } - public string City { - get { return result.City; } - set { SetCity(value); } - } - public Builder SetCity(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasCity = true; - result.city_ = value; - return this; - } - public Builder ClearCity() { - result.hasCity = false; - result.city_ = ""; - return this; - } - - public bool HasState { - get { return result.HasState; } - } - public string State { - get { return result.State; } - set { SetState(value); } - } - public Builder SetState(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasState = true; - result.state_ = value; - return this; - } - public Builder ClearState() { - result.hasState = false; - result.state_ = ""; - return this; - } - - public bool HasPostalCode { - get { return result.HasPostalCode; } - } - public string PostalCode { - get { return result.PostalCode; } - set { SetPostalCode(value); } - } - public Builder SetPostalCode(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasPostalCode = true; - result.postalCode_ = value; - return this; - } - public Builder ClearPostalCode() { - result.hasPostalCode = false; - result.postalCode_ = ""; - return this; - } - } - static BillingAddress() { - object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); - } - } - - public sealed partial class FeeEstimationData : pb::GeneratedMessage { - private static readonly FeeEstimationData defaultInstance = new Builder().BuildPartial(); - public static FeeEstimationData DefaultInstance { - get { return defaultInstance; } - } - - public override FeeEstimationData DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override FeeEstimationData ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_FeeEstimationData__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_FeeEstimationData__FieldAccessorTable; } - } - - public const int ProgramFieldNumber = 1; - private bool hasProgram; - private uint program_ = 0; - public bool HasProgram { - get { return hasProgram; } - } - public uint Program { - get { return program_; } - } - - public const int SpecialistFieldNumber = 2; - private bool hasSpecialist; - private int specialist_ = 0; - public bool HasSpecialist { - get { return hasSpecialist; } - } - public int Specialist { - get { return specialist_; } - } - - public const int CurrencyFieldNumber = 3; - private bool hasCurrency; - private string currency_ = ""; - public bool HasCurrency { - get { return hasCurrency; } - } - public string Currency { - get { return currency_; } - } - - public const int SourceFieldNumber = 4; - private bool hasSource; - private uint source_ = 0; - public bool HasSource { - get { return hasSource; } - } - public uint Source { - get { return source_; } - } - - public const int AmountFieldNumber = 5; - private bool hasAmount; - private ulong amount_ = 0UL; - public bool HasAmount { - get { return hasAmount; } - } - public ulong Amount { - get { return amount_; } - } - - public const int BnetAccountFieldNumber = 6; - private bool hasBnetAccount; - private global::bnet.protocol.EntityId bnetAccount_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasBnetAccount { - get { return hasBnetAccount; } - } - public global::bnet.protocol.EntityId BnetAccount { - get { return bnetAccount_; } - } - - public const int BillingAddressFieldNumber = 7; - private bool hasBillingAddress; - private global::bnet.protocol.exchange.BillingAddress billingAddress_ = global::bnet.protocol.exchange.BillingAddress.DefaultInstance; - public bool HasBillingAddress { - get { return hasBillingAddress; } - } - public global::bnet.protocol.exchange.BillingAddress BillingAddress { - get { return billingAddress_; } - } - - public override bool IsInitialized { - get { - if (!hasProgram) return false; - if (!hasSpecialist) return false; - if (!hasCurrency) return false; - if (!hasSource) return false; - if (!hasAmount) return false; - if (HasBnetAccount) { - if (!BnetAccount.IsInitialized) return false; - } - if (HasBillingAddress) { - if (!BillingAddress.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasProgram) { - output.WriteFixed32(1, Program); - } - if (HasSpecialist) { - output.WriteInt32(2, Specialist); - } - if (HasCurrency) { - output.WriteString(3, Currency); - } - if (HasSource) { - output.WriteFixed32(4, Source); - } - if (HasAmount) { - output.WriteUInt64(5, Amount); - } - if (HasBnetAccount) { - output.WriteMessage(6, BnetAccount); - } - if (HasBillingAddress) { - output.WriteMessage(7, BillingAddress); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasProgram) { - size += pb::CodedOutputStream.ComputeFixed32Size(1, Program); - } - if (HasSpecialist) { - size += pb::CodedOutputStream.ComputeInt32Size(2, Specialist); - } - if (HasCurrency) { - size += pb::CodedOutputStream.ComputeStringSize(3, Currency); - } - if (HasSource) { - size += pb::CodedOutputStream.ComputeFixed32Size(4, Source); - } - if (HasAmount) { - size += pb::CodedOutputStream.ComputeUInt64Size(5, Amount); - } - if (HasBnetAccount) { - size += pb::CodedOutputStream.ComputeMessageSize(6, BnetAccount); - } - if (HasBillingAddress) { - size += pb::CodedOutputStream.ComputeMessageSize(7, BillingAddress); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static FeeEstimationData ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FeeEstimationData ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FeeEstimationData ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FeeEstimationData ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FeeEstimationData ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FeeEstimationData ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static FeeEstimationData ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static FeeEstimationData ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static FeeEstimationData ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FeeEstimationData ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(FeeEstimationData prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - FeeEstimationData result = new FeeEstimationData(); - - protected override FeeEstimationData MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new FeeEstimationData(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange.FeeEstimationData.Descriptor; } - } - - public override FeeEstimationData DefaultInstanceForType { - get { return global::bnet.protocol.exchange.FeeEstimationData.DefaultInstance; } - } - - public override FeeEstimationData BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - FeeEstimationData returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is FeeEstimationData) { - return MergeFrom((FeeEstimationData) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(FeeEstimationData other) { - if (other == global::bnet.protocol.exchange.FeeEstimationData.DefaultInstance) return this; - if (other.HasProgram) { - Program = other.Program; - } - if (other.HasSpecialist) { - Specialist = other.Specialist; - } - if (other.HasCurrency) { - Currency = other.Currency; - } - if (other.HasSource) { - Source = other.Source; - } - if (other.HasAmount) { - Amount = other.Amount; - } - if (other.HasBnetAccount) { - MergeBnetAccount(other.BnetAccount); - } - if (other.HasBillingAddress) { - MergeBillingAddress(other.BillingAddress); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 13: { - Program = input.ReadFixed32(); - break; - } - case 16: { - Specialist = input.ReadInt32(); - break; - } - case 26: { - Currency = input.ReadString(); - break; - } - case 37: { - Source = input.ReadFixed32(); - break; - } - case 40: { - Amount = input.ReadUInt64(); - break; - } - case 50: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasBnetAccount) { - subBuilder.MergeFrom(BnetAccount); - } - input.ReadMessage(subBuilder, extensionRegistry); - BnetAccount = subBuilder.BuildPartial(); - break; - } - case 58: { - global::bnet.protocol.exchange.BillingAddress.Builder subBuilder = global::bnet.protocol.exchange.BillingAddress.CreateBuilder(); - if (HasBillingAddress) { - subBuilder.MergeFrom(BillingAddress); - } - input.ReadMessage(subBuilder, extensionRegistry); - BillingAddress = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasProgram { - get { return result.HasProgram; } - } - public uint Program { - get { return result.Program; } - set { SetProgram(value); } - } - public Builder SetProgram(uint value) { - result.hasProgram = true; - result.program_ = value; - return this; - } - public Builder ClearProgram() { - result.hasProgram = false; - result.program_ = 0; - return this; - } - - public bool HasSpecialist { - get { return result.HasSpecialist; } - } - public int Specialist { - get { return result.Specialist; } - set { SetSpecialist(value); } - } - public Builder SetSpecialist(int value) { - result.hasSpecialist = true; - result.specialist_ = value; - return this; - } - public Builder ClearSpecialist() { - result.hasSpecialist = false; - result.specialist_ = 0; - return this; - } - - public bool HasCurrency { - get { return result.HasCurrency; } - } - public string Currency { - get { return result.Currency; } - set { SetCurrency(value); } - } - public Builder SetCurrency(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasCurrency = true; - result.currency_ = value; - return this; - } - public Builder ClearCurrency() { - result.hasCurrency = false; - result.currency_ = ""; - return this; - } - - public bool HasSource { - get { return result.HasSource; } - } - public uint Source { - get { return result.Source; } - set { SetSource(value); } - } - public Builder SetSource(uint value) { - result.hasSource = true; - result.source_ = value; - return this; - } - public Builder ClearSource() { - result.hasSource = false; - result.source_ = 0; - return this; - } - - public bool HasAmount { - get { return result.HasAmount; } - } - public ulong Amount { - get { return result.Amount; } - set { SetAmount(value); } - } - public Builder SetAmount(ulong value) { - result.hasAmount = true; - result.amount_ = value; - return this; - } - public Builder ClearAmount() { - result.hasAmount = false; - result.amount_ = 0UL; - return this; - } - - public bool HasBnetAccount { - get { return result.HasBnetAccount; } - } - public global::bnet.protocol.EntityId BnetAccount { - get { return result.BnetAccount; } - set { SetBnetAccount(value); } - } - public Builder SetBnetAccount(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBnetAccount = true; - result.bnetAccount_ = value; - return this; - } - public Builder SetBnetAccount(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBnetAccount = true; - result.bnetAccount_ = builderForValue.Build(); - return this; - } - public Builder MergeBnetAccount(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasBnetAccount && - result.bnetAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.bnetAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccount_).MergeFrom(value).BuildPartial(); - } else { - result.bnetAccount_ = value; - } - result.hasBnetAccount = true; - return this; - } - public Builder ClearBnetAccount() { - result.hasBnetAccount = false; - result.bnetAccount_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasBillingAddress { - get { return result.HasBillingAddress; } - } - public global::bnet.protocol.exchange.BillingAddress BillingAddress { - get { return result.BillingAddress; } - set { SetBillingAddress(value); } - } - public Builder SetBillingAddress(global::bnet.protocol.exchange.BillingAddress value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBillingAddress = true; - result.billingAddress_ = value; - return this; - } - public Builder SetBillingAddress(global::bnet.protocol.exchange.BillingAddress.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBillingAddress = true; - result.billingAddress_ = builderForValue.Build(); - return this; - } - public Builder MergeBillingAddress(global::bnet.protocol.exchange.BillingAddress value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasBillingAddress && - result.billingAddress_ != global::bnet.protocol.exchange.BillingAddress.DefaultInstance) { - result.billingAddress_ = global::bnet.protocol.exchange.BillingAddress.CreateBuilder(result.billingAddress_).MergeFrom(value).BuildPartial(); - } else { - result.billingAddress_ = value; - } - result.hasBillingAddress = true; - return this; - } - public Builder ClearBillingAddress() { - result.hasBillingAddress = false; - result.billingAddress_ = global::bnet.protocol.exchange.BillingAddress.DefaultInstance; - return this; - } - } - static FeeEstimationData() { - object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); - } - } - - #endregion - -} diff --git a/source/D3Proto/bnet/protocol/exchange_object_provider/ExchangeObjectProvider.cs b/source/D3Proto/bnet/protocol/exchange_object_provider/ExchangeObjectProvider.cs deleted file mode 100644 index c55a1c74..00000000 --- a/source/D3Proto/bnet/protocol/exchange_object_provider/ExchangeObjectProvider.cs +++ /dev/null @@ -1,2348 +0,0 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace bnet.protocol.exchange_object_provider { - - public static partial class ExchangeObjectProvider { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_object_provider_ReportAuthorizeRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_object_provider_ReportAuthorizeRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_object_provider_ReportSettleRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_object_provider_ReportSettleRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_object_provider_ReportCancelRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_object_provider_ReportCancelRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_object_provider_GetPaymentMethodsRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_object_provider_GetPaymentMethodsRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_object_provider_PaymentMethod__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_object_provider_PaymentMethod__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_object_provider_GetPaymentMethodsResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_object_provider_GetPaymentMethodsResponse__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static ExchangeObjectProvider() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "CitsaWIvcHJvdG9jb2wvZXhjaGFuZ2Vfb2JqZWN0X3Byb3ZpZGVyLnByb3Rv" + - "EiZibmV0LnByb3RvY29sLmV4Y2hhbmdlX29iamVjdF9wcm92aWRlchoZbGli" + - "L3Byb3RvY29sL2VudGl0eS5wcm90bxobbGliL3Byb3RvY29sL2V4Y2hhbmdl" + - "LnByb3RvIp4CChZSZXBvcnRBdXRob3JpemVSZXF1ZXN0EjkKDHBhcnRpdGlv" + - "bl9pZBgBIAIoCzIjLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuUGFydGl0aW9u" + - "SWQSMgoFdG9rZW4YAiACKAsyIy5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLlBh" + - "cnRpdGlvbklkEg4KBnJlc3VsdBgDIAIoBBI7CgthdXRoX2hhbmRsZRgEIAEo" + - "CzImLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuQmxvYkZyb21PZlR5cGUSFgoO" + - "ZGVmZXJfZGVsaXZlcnkYBSABKAgSMAoPYm5ldF9hY2NvdW50X2lkGAYgAigL" + - "MhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZCKUAQoTUmVwb3J0U2V0dGxlUmVx" + - "dWVzdBI5CgxwYXJ0aXRpb25faWQYASACKAsyIy5ibmV0LnByb3RvY29sLmV4" + - "Y2hhbmdlLlBhcnRpdGlvbklkEjIKBXRva2VuGAIgAigLMiMuYm5ldC5wcm90" + - "b2NvbC5leGNoYW5nZS5QYXJ0aXRpb25JZBIOCgZyZXN1bHQYAyACKAQilAEK" + - "E1JlcG9ydENhbmNlbFJlcXVlc3QSOQoMcGFydGl0aW9uX2lkGAEgAigLMiMu" + - "Ym5ldC5wcm90b2NvbC5leGNoYW5nZS5QYXJ0aXRpb25JZBIyCgV0b2tlbhgC" + - "IAIoCzIjLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuUGFydGl0aW9uSWQSDgoG" + - "cmVzdWx0GAMgAigEIssBChhHZXRQYXltZW50TWV0aG9kc1JlcXVlc3QSLQoM" + - "Ym5ldF9hY2NvdW50GAEgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBIt" + - "CgxnYW1lX2FjY291bnQYAiABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlk" + - "EiUKBHRvb24YAyABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEhAKCGN1" + - "cnJlbmN5GAQgAigJEhgKEGNhc2hfaW5fb3V0X21hc2sYBSACKA0iZwoNUGF5" + - "bWVudE1ldGhvZBIxCgdhY2NvdW50GAEgAigLMiAuYm5ldC5wcm90b2NvbC5l" + - "eGNoYW5nZS5CbG9iRnJvbRITCgtkZXNjcmlwdGlvbhgCIAIoCRIOCgZhbW91" + - "bnQYAyABKAQiYwoZR2V0UGF5bWVudE1ldGhvZHNSZXNwb25zZRJGCgdtZXRo" + - "b2RzGAEgAygLMjUuYm5ldC5wcm90b2NvbC5leGNoYW5nZV9vYmplY3RfcHJv" + - "dmlkZXIuUGF5bWVudE1ldGhvZEIDgAEB"); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_bnet_protocol_exchange_object_provider_ReportAuthorizeRequest__Descriptor = Descriptor.MessageTypes[0]; - internal__static_bnet_protocol_exchange_object_provider_ReportAuthorizeRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_object_provider_ReportAuthorizeRequest__Descriptor, - new string[] { "PartitionId", "Token", "Result", "AuthHandle", "DeferDelivery", "BnetAccountId", }); - internal__static_bnet_protocol_exchange_object_provider_ReportSettleRequest__Descriptor = Descriptor.MessageTypes[1]; - internal__static_bnet_protocol_exchange_object_provider_ReportSettleRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_object_provider_ReportSettleRequest__Descriptor, - new string[] { "PartitionId", "Token", "Result", }); - internal__static_bnet_protocol_exchange_object_provider_ReportCancelRequest__Descriptor = Descriptor.MessageTypes[2]; - internal__static_bnet_protocol_exchange_object_provider_ReportCancelRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_object_provider_ReportCancelRequest__Descriptor, - new string[] { "PartitionId", "Token", "Result", }); - internal__static_bnet_protocol_exchange_object_provider_GetPaymentMethodsRequest__Descriptor = Descriptor.MessageTypes[3]; - internal__static_bnet_protocol_exchange_object_provider_GetPaymentMethodsRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_object_provider_GetPaymentMethodsRequest__Descriptor, - new string[] { "BnetAccount", "GameAccount", "Toon", "Currency", "CashInOutMask", }); - internal__static_bnet_protocol_exchange_object_provider_PaymentMethod__Descriptor = Descriptor.MessageTypes[4]; - internal__static_bnet_protocol_exchange_object_provider_PaymentMethod__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_object_provider_PaymentMethod__Descriptor, - new string[] { "Account", "Description", "Amount", }); - internal__static_bnet_protocol_exchange_object_provider_GetPaymentMethodsResponse__Descriptor = Descriptor.MessageTypes[5]; - internal__static_bnet_protocol_exchange_object_provider_GetPaymentMethodsResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_object_provider_GetPaymentMethodsResponse__Descriptor, - new string[] { "Methods", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::bnet.protocol.Entity.Descriptor, - global::bnet.protocol.exchange.Exchange.Descriptor, - }, assigner); - } - #endregion - - } - #region Messages - public sealed partial class ReportAuthorizeRequest : pb::GeneratedMessage { - private static readonly ReportAuthorizeRequest defaultInstance = new Builder().BuildPartial(); - public static ReportAuthorizeRequest DefaultInstance { - get { return defaultInstance; } - } - - public override ReportAuthorizeRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ReportAuthorizeRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange_object_provider.ExchangeObjectProvider.internal__static_bnet_protocol_exchange_object_provider_ReportAuthorizeRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange_object_provider.ExchangeObjectProvider.internal__static_bnet_protocol_exchange_object_provider_ReportAuthorizeRequest__FieldAccessorTable; } - } - - public const int PartitionIdFieldNumber = 1; - private bool hasPartitionId; - private global::bnet.protocol.exchange.PartitionId partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - public bool HasPartitionId { - get { return hasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return partitionId_; } - } - - public const int TokenFieldNumber = 2; - private bool hasToken; - private global::bnet.protocol.exchange.PartitionId token_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - public bool HasToken { - get { return hasToken; } - } - public global::bnet.protocol.exchange.PartitionId Token { - get { return token_; } - } - - public const int ResultFieldNumber = 3; - private bool hasResult; - private ulong result_ = 0UL; - public bool HasResult { - get { return hasResult; } - } - public ulong Result { - get { return result_; } - } - - public const int AuthHandleFieldNumber = 4; - private bool hasAuthHandle; - private global::bnet.protocol.exchange.BlobFromOfType authHandle_ = global::bnet.protocol.exchange.BlobFromOfType.DefaultInstance; - public bool HasAuthHandle { - get { return hasAuthHandle; } - } - public global::bnet.protocol.exchange.BlobFromOfType AuthHandle { - get { return authHandle_; } - } - - public const int DeferDeliveryFieldNumber = 5; - private bool hasDeferDelivery; - private bool deferDelivery_ = false; - public bool HasDeferDelivery { - get { return hasDeferDelivery; } - } - public bool DeferDelivery { - get { return deferDelivery_; } - } - - public const int BnetAccountIdFieldNumber = 6; - private bool hasBnetAccountId; - private global::bnet.protocol.EntityId bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasBnetAccountId { - get { return hasBnetAccountId; } - } - public global::bnet.protocol.EntityId BnetAccountId { - get { return bnetAccountId_; } - } - - public override bool IsInitialized { - get { - if (!hasPartitionId) return false; - if (!hasToken) return false; - if (!hasResult) return false; - if (!hasBnetAccountId) return false; - if (!PartitionId.IsInitialized) return false; - if (!Token.IsInitialized) return false; - if (HasAuthHandle) { - if (!AuthHandle.IsInitialized) return false; - } - if (!BnetAccountId.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasPartitionId) { - output.WriteMessage(1, PartitionId); - } - if (HasToken) { - output.WriteMessage(2, Token); - } - if (HasResult) { - output.WriteUInt64(3, Result); - } - if (HasAuthHandle) { - output.WriteMessage(4, AuthHandle); - } - if (HasDeferDelivery) { - output.WriteBool(5, DeferDelivery); - } - if (HasBnetAccountId) { - output.WriteMessage(6, BnetAccountId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasPartitionId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); - } - if (HasToken) { - size += pb::CodedOutputStream.ComputeMessageSize(2, Token); - } - if (HasResult) { - size += pb::CodedOutputStream.ComputeUInt64Size(3, Result); - } - if (HasAuthHandle) { - size += pb::CodedOutputStream.ComputeMessageSize(4, AuthHandle); - } - if (HasDeferDelivery) { - size += pb::CodedOutputStream.ComputeBoolSize(5, DeferDelivery); - } - if (HasBnetAccountId) { - size += pb::CodedOutputStream.ComputeMessageSize(6, BnetAccountId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ReportAuthorizeRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ReportAuthorizeRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ReportAuthorizeRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ReportAuthorizeRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ReportAuthorizeRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ReportAuthorizeRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ReportAuthorizeRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ReportAuthorizeRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ReportAuthorizeRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ReportAuthorizeRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ReportAuthorizeRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ReportAuthorizeRequest result = new ReportAuthorizeRequest(); - - protected override ReportAuthorizeRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ReportAuthorizeRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange_object_provider.ReportAuthorizeRequest.Descriptor; } - } - - public override ReportAuthorizeRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange_object_provider.ReportAuthorizeRequest.DefaultInstance; } - } - - public override ReportAuthorizeRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - ReportAuthorizeRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ReportAuthorizeRequest) { - return MergeFrom((ReportAuthorizeRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ReportAuthorizeRequest other) { - if (other == global::bnet.protocol.exchange_object_provider.ReportAuthorizeRequest.DefaultInstance) return this; - if (other.HasPartitionId) { - MergePartitionId(other.PartitionId); - } - if (other.HasToken) { - MergeToken(other.Token); - } - if (other.HasResult) { - Result = other.Result; - } - if (other.HasAuthHandle) { - MergeAuthHandle(other.AuthHandle); - } - if (other.HasDeferDelivery) { - DeferDelivery = other.DeferDelivery; - } - if (other.HasBnetAccountId) { - MergeBnetAccountId(other.BnetAccountId); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { - subBuilder.MergeFrom(PartitionId); - } - input.ReadMessage(subBuilder, extensionRegistry); - PartitionId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasToken) { - subBuilder.MergeFrom(Token); - } - input.ReadMessage(subBuilder, extensionRegistry); - Token = subBuilder.BuildPartial(); - break; - } - case 24: { - Result = input.ReadUInt64(); - break; - } - case 34: { - global::bnet.protocol.exchange.BlobFromOfType.Builder subBuilder = global::bnet.protocol.exchange.BlobFromOfType.CreateBuilder(); - if (HasAuthHandle) { - subBuilder.MergeFrom(AuthHandle); - } - input.ReadMessage(subBuilder, extensionRegistry); - AuthHandle = subBuilder.BuildPartial(); - break; - } - case 40: { - DeferDelivery = input.ReadBool(); - break; - } - case 50: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasBnetAccountId) { - subBuilder.MergeFrom(BnetAccountId); - } - input.ReadMessage(subBuilder, extensionRegistry); - BnetAccountId = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasPartitionId { - get { return result.HasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return result.PartitionId; } - set { SetPartitionId(value); } - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasPartitionId = true; - result.partitionId_ = value; - return this; - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasPartitionId = true; - result.partitionId_ = builderForValue.Build(); - return this; - } - public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasPartitionId && - result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); - } else { - result.partitionId_ = value; - } - result.hasPartitionId = true; - return this; - } - public Builder ClearPartitionId() { - result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - return this; - } - - public bool HasToken { - get { return result.HasToken; } - } - public global::bnet.protocol.exchange.PartitionId Token { - get { return result.Token; } - set { SetToken(value); } - } - public Builder SetToken(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasToken = true; - result.token_ = value; - return this; - } - public Builder SetToken(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasToken = true; - result.token_ = builderForValue.Build(); - return this; - } - public Builder MergeToken(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasToken && - result.token_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { - result.token_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.token_).MergeFrom(value).BuildPartial(); - } else { - result.token_ = value; - } - result.hasToken = true; - return this; - } - public Builder ClearToken() { - result.hasToken = false; - result.token_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - return this; - } - - public bool HasResult { - get { return result.HasResult; } - } - public ulong Result { - get { return result.Result; } - set { SetResult(value); } - } - public Builder SetResult(ulong value) { - result.hasResult = true; - result.result_ = value; - return this; - } - public Builder ClearResult() { - result.hasResult = false; - result.result_ = 0UL; - return this; - } - - public bool HasAuthHandle { - get { return result.HasAuthHandle; } - } - public global::bnet.protocol.exchange.BlobFromOfType AuthHandle { - get { return result.AuthHandle; } - set { SetAuthHandle(value); } - } - public Builder SetAuthHandle(global::bnet.protocol.exchange.BlobFromOfType value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasAuthHandle = true; - result.authHandle_ = value; - return this; - } - public Builder SetAuthHandle(global::bnet.protocol.exchange.BlobFromOfType.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasAuthHandle = true; - result.authHandle_ = builderForValue.Build(); - return this; - } - public Builder MergeAuthHandle(global::bnet.protocol.exchange.BlobFromOfType value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAuthHandle && - result.authHandle_ != global::bnet.protocol.exchange.BlobFromOfType.DefaultInstance) { - result.authHandle_ = global::bnet.protocol.exchange.BlobFromOfType.CreateBuilder(result.authHandle_).MergeFrom(value).BuildPartial(); - } else { - result.authHandle_ = value; - } - result.hasAuthHandle = true; - return this; - } - public Builder ClearAuthHandle() { - result.hasAuthHandle = false; - result.authHandle_ = global::bnet.protocol.exchange.BlobFromOfType.DefaultInstance; - return this; - } - - public bool HasDeferDelivery { - get { return result.HasDeferDelivery; } - } - public bool DeferDelivery { - get { return result.DeferDelivery; } - set { SetDeferDelivery(value); } - } - public Builder SetDeferDelivery(bool value) { - result.hasDeferDelivery = true; - result.deferDelivery_ = value; - return this; - } - public Builder ClearDeferDelivery() { - result.hasDeferDelivery = false; - result.deferDelivery_ = false; - return this; - } - - public bool HasBnetAccountId { - get { return result.HasBnetAccountId; } - } - public global::bnet.protocol.EntityId BnetAccountId { - get { return result.BnetAccountId; } - set { SetBnetAccountId(value); } - } - public Builder SetBnetAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBnetAccountId = true; - result.bnetAccountId_ = value; - return this; - } - public Builder SetBnetAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBnetAccountId = true; - result.bnetAccountId_ = builderForValue.Build(); - return this; - } - public Builder MergeBnetAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasBnetAccountId && - result.bnetAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.bnetAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccountId_).MergeFrom(value).BuildPartial(); - } else { - result.bnetAccountId_ = value; - } - result.hasBnetAccountId = true; - return this; - } - public Builder ClearBnetAccountId() { - result.hasBnetAccountId = false; - result.bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - } - static ReportAuthorizeRequest() { - object.ReferenceEquals(global::bnet.protocol.exchange_object_provider.ExchangeObjectProvider.Descriptor, null); - } - } - - public sealed partial class ReportSettleRequest : pb::GeneratedMessage { - private static readonly ReportSettleRequest defaultInstance = new Builder().BuildPartial(); - public static ReportSettleRequest DefaultInstance { - get { return defaultInstance; } - } - - public override ReportSettleRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ReportSettleRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange_object_provider.ExchangeObjectProvider.internal__static_bnet_protocol_exchange_object_provider_ReportSettleRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange_object_provider.ExchangeObjectProvider.internal__static_bnet_protocol_exchange_object_provider_ReportSettleRequest__FieldAccessorTable; } - } - - public const int PartitionIdFieldNumber = 1; - private bool hasPartitionId; - private global::bnet.protocol.exchange.PartitionId partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - public bool HasPartitionId { - get { return hasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return partitionId_; } - } - - public const int TokenFieldNumber = 2; - private bool hasToken; - private global::bnet.protocol.exchange.PartitionId token_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - public bool HasToken { - get { return hasToken; } - } - public global::bnet.protocol.exchange.PartitionId Token { - get { return token_; } - } - - public const int ResultFieldNumber = 3; - private bool hasResult; - private ulong result_ = 0UL; - public bool HasResult { - get { return hasResult; } - } - public ulong Result { - get { return result_; } - } - - public override bool IsInitialized { - get { - if (!hasPartitionId) return false; - if (!hasToken) return false; - if (!hasResult) return false; - if (!PartitionId.IsInitialized) return false; - if (!Token.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasPartitionId) { - output.WriteMessage(1, PartitionId); - } - if (HasToken) { - output.WriteMessage(2, Token); - } - if (HasResult) { - output.WriteUInt64(3, Result); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasPartitionId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); - } - if (HasToken) { - size += pb::CodedOutputStream.ComputeMessageSize(2, Token); - } - if (HasResult) { - size += pb::CodedOutputStream.ComputeUInt64Size(3, Result); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ReportSettleRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ReportSettleRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ReportSettleRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ReportSettleRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ReportSettleRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ReportSettleRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ReportSettleRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ReportSettleRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ReportSettleRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ReportSettleRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ReportSettleRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ReportSettleRequest result = new ReportSettleRequest(); - - protected override ReportSettleRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ReportSettleRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange_object_provider.ReportSettleRequest.Descriptor; } - } - - public override ReportSettleRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange_object_provider.ReportSettleRequest.DefaultInstance; } - } - - public override ReportSettleRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - ReportSettleRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ReportSettleRequest) { - return MergeFrom((ReportSettleRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ReportSettleRequest other) { - if (other == global::bnet.protocol.exchange_object_provider.ReportSettleRequest.DefaultInstance) return this; - if (other.HasPartitionId) { - MergePartitionId(other.PartitionId); - } - if (other.HasToken) { - MergeToken(other.Token); - } - if (other.HasResult) { - Result = other.Result; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { - subBuilder.MergeFrom(PartitionId); - } - input.ReadMessage(subBuilder, extensionRegistry); - PartitionId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasToken) { - subBuilder.MergeFrom(Token); - } - input.ReadMessage(subBuilder, extensionRegistry); - Token = subBuilder.BuildPartial(); - break; - } - case 24: { - Result = input.ReadUInt64(); - break; - } - } - } - } - - - public bool HasPartitionId { - get { return result.HasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return result.PartitionId; } - set { SetPartitionId(value); } - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasPartitionId = true; - result.partitionId_ = value; - return this; - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasPartitionId = true; - result.partitionId_ = builderForValue.Build(); - return this; - } - public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasPartitionId && - result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); - } else { - result.partitionId_ = value; - } - result.hasPartitionId = true; - return this; - } - public Builder ClearPartitionId() { - result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - return this; - } - - public bool HasToken { - get { return result.HasToken; } - } - public global::bnet.protocol.exchange.PartitionId Token { - get { return result.Token; } - set { SetToken(value); } - } - public Builder SetToken(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasToken = true; - result.token_ = value; - return this; - } - public Builder SetToken(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasToken = true; - result.token_ = builderForValue.Build(); - return this; - } - public Builder MergeToken(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasToken && - result.token_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { - result.token_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.token_).MergeFrom(value).BuildPartial(); - } else { - result.token_ = value; - } - result.hasToken = true; - return this; - } - public Builder ClearToken() { - result.hasToken = false; - result.token_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - return this; - } - - public bool HasResult { - get { return result.HasResult; } - } - public ulong Result { - get { return result.Result; } - set { SetResult(value); } - } - public Builder SetResult(ulong value) { - result.hasResult = true; - result.result_ = value; - return this; - } - public Builder ClearResult() { - result.hasResult = false; - result.result_ = 0UL; - return this; - } - } - static ReportSettleRequest() { - object.ReferenceEquals(global::bnet.protocol.exchange_object_provider.ExchangeObjectProvider.Descriptor, null); - } - } - - public sealed partial class ReportCancelRequest : pb::GeneratedMessage { - private static readonly ReportCancelRequest defaultInstance = new Builder().BuildPartial(); - public static ReportCancelRequest DefaultInstance { - get { return defaultInstance; } - } - - public override ReportCancelRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ReportCancelRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange_object_provider.ExchangeObjectProvider.internal__static_bnet_protocol_exchange_object_provider_ReportCancelRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange_object_provider.ExchangeObjectProvider.internal__static_bnet_protocol_exchange_object_provider_ReportCancelRequest__FieldAccessorTable; } - } - - public const int PartitionIdFieldNumber = 1; - private bool hasPartitionId; - private global::bnet.protocol.exchange.PartitionId partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - public bool HasPartitionId { - get { return hasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return partitionId_; } - } - - public const int TokenFieldNumber = 2; - private bool hasToken; - private global::bnet.protocol.exchange.PartitionId token_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - public bool HasToken { - get { return hasToken; } - } - public global::bnet.protocol.exchange.PartitionId Token { - get { return token_; } - } - - public const int ResultFieldNumber = 3; - private bool hasResult; - private ulong result_ = 0UL; - public bool HasResult { - get { return hasResult; } - } - public ulong Result { - get { return result_; } - } - - public override bool IsInitialized { - get { - if (!hasPartitionId) return false; - if (!hasToken) return false; - if (!hasResult) return false; - if (!PartitionId.IsInitialized) return false; - if (!Token.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasPartitionId) { - output.WriteMessage(1, PartitionId); - } - if (HasToken) { - output.WriteMessage(2, Token); - } - if (HasResult) { - output.WriteUInt64(3, Result); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasPartitionId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); - } - if (HasToken) { - size += pb::CodedOutputStream.ComputeMessageSize(2, Token); - } - if (HasResult) { - size += pb::CodedOutputStream.ComputeUInt64Size(3, Result); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ReportCancelRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ReportCancelRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ReportCancelRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ReportCancelRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ReportCancelRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ReportCancelRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ReportCancelRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ReportCancelRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ReportCancelRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ReportCancelRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ReportCancelRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ReportCancelRequest result = new ReportCancelRequest(); - - protected override ReportCancelRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ReportCancelRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange_object_provider.ReportCancelRequest.Descriptor; } - } - - public override ReportCancelRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange_object_provider.ReportCancelRequest.DefaultInstance; } - } - - public override ReportCancelRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - ReportCancelRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ReportCancelRequest) { - return MergeFrom((ReportCancelRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ReportCancelRequest other) { - if (other == global::bnet.protocol.exchange_object_provider.ReportCancelRequest.DefaultInstance) return this; - if (other.HasPartitionId) { - MergePartitionId(other.PartitionId); - } - if (other.HasToken) { - MergeToken(other.Token); - } - if (other.HasResult) { - Result = other.Result; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { - subBuilder.MergeFrom(PartitionId); - } - input.ReadMessage(subBuilder, extensionRegistry); - PartitionId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasToken) { - subBuilder.MergeFrom(Token); - } - input.ReadMessage(subBuilder, extensionRegistry); - Token = subBuilder.BuildPartial(); - break; - } - case 24: { - Result = input.ReadUInt64(); - break; - } - } - } - } - - - public bool HasPartitionId { - get { return result.HasPartitionId; } - } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return result.PartitionId; } - set { SetPartitionId(value); } - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasPartitionId = true; - result.partitionId_ = value; - return this; - } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasPartitionId = true; - result.partitionId_ = builderForValue.Build(); - return this; - } - public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasPartitionId && - result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); - } else { - result.partitionId_ = value; - } - result.hasPartitionId = true; - return this; - } - public Builder ClearPartitionId() { - result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - return this; - } - - public bool HasToken { - get { return result.HasToken; } - } - public global::bnet.protocol.exchange.PartitionId Token { - get { return result.Token; } - set { SetToken(value); } - } - public Builder SetToken(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasToken = true; - result.token_ = value; - return this; - } - public Builder SetToken(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasToken = true; - result.token_ = builderForValue.Build(); - return this; - } - public Builder MergeToken(global::bnet.protocol.exchange.PartitionId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasToken && - result.token_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { - result.token_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.token_).MergeFrom(value).BuildPartial(); - } else { - result.token_ = value; - } - result.hasToken = true; - return this; - } - public Builder ClearToken() { - result.hasToken = false; - result.token_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; - return this; - } - - public bool HasResult { - get { return result.HasResult; } - } - public ulong Result { - get { return result.Result; } - set { SetResult(value); } - } - public Builder SetResult(ulong value) { - result.hasResult = true; - result.result_ = value; - return this; - } - public Builder ClearResult() { - result.hasResult = false; - result.result_ = 0UL; - return this; - } - } - static ReportCancelRequest() { - object.ReferenceEquals(global::bnet.protocol.exchange_object_provider.ExchangeObjectProvider.Descriptor, null); - } - } - - public sealed partial class GetPaymentMethodsRequest : pb::GeneratedMessage { - private static readonly GetPaymentMethodsRequest defaultInstance = new Builder().BuildPartial(); - public static GetPaymentMethodsRequest DefaultInstance { - get { return defaultInstance; } - } - - public override GetPaymentMethodsRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override GetPaymentMethodsRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange_object_provider.ExchangeObjectProvider.internal__static_bnet_protocol_exchange_object_provider_GetPaymentMethodsRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange_object_provider.ExchangeObjectProvider.internal__static_bnet_protocol_exchange_object_provider_GetPaymentMethodsRequest__FieldAccessorTable; } - } - - public const int BnetAccountFieldNumber = 1; - private bool hasBnetAccount; - private global::bnet.protocol.EntityId bnetAccount_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasBnetAccount { - get { return hasBnetAccount; } - } - public global::bnet.protocol.EntityId BnetAccount { - get { return bnetAccount_; } - } - - public const int GameAccountFieldNumber = 2; - private bool hasGameAccount; - private global::bnet.protocol.EntityId gameAccount_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasGameAccount { - get { return hasGameAccount; } - } - public global::bnet.protocol.EntityId GameAccount { - get { return gameAccount_; } - } - - public const int ToonFieldNumber = 3; - private bool hasToon; - private global::bnet.protocol.EntityId toon_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasToon { - get { return hasToon; } - } - public global::bnet.protocol.EntityId Toon { - get { return toon_; } - } - - public const int CurrencyFieldNumber = 4; - private bool hasCurrency; - private string currency_ = ""; - public bool HasCurrency { - get { return hasCurrency; } - } - public string Currency { - get { return currency_; } - } - - public const int CashInOutMaskFieldNumber = 5; - private bool hasCashInOutMask; - private uint cashInOutMask_ = 0; - public bool HasCashInOutMask { - get { return hasCashInOutMask; } - } - public uint CashInOutMask { - get { return cashInOutMask_; } - } - - public override bool IsInitialized { - get { - if (!hasCurrency) return false; - if (!hasCashInOutMask) return false; - if (HasBnetAccount) { - if (!BnetAccount.IsInitialized) return false; - } - if (HasGameAccount) { - if (!GameAccount.IsInitialized) return false; - } - if (HasToon) { - if (!Toon.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasBnetAccount) { - output.WriteMessage(1, BnetAccount); - } - if (HasGameAccount) { - output.WriteMessage(2, GameAccount); - } - if (HasToon) { - output.WriteMessage(3, Toon); - } - if (HasCurrency) { - output.WriteString(4, Currency); - } - if (HasCashInOutMask) { - output.WriteUInt32(5, CashInOutMask); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasBnetAccount) { - size += pb::CodedOutputStream.ComputeMessageSize(1, BnetAccount); - } - if (HasGameAccount) { - size += pb::CodedOutputStream.ComputeMessageSize(2, GameAccount); - } - if (HasToon) { - size += pb::CodedOutputStream.ComputeMessageSize(3, Toon); - } - if (HasCurrency) { - size += pb::CodedOutputStream.ComputeStringSize(4, Currency); - } - if (HasCashInOutMask) { - size += pb::CodedOutputStream.ComputeUInt32Size(5, CashInOutMask); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static GetPaymentMethodsRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static GetPaymentMethodsRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static GetPaymentMethodsRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static GetPaymentMethodsRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static GetPaymentMethodsRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static GetPaymentMethodsRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static GetPaymentMethodsRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static GetPaymentMethodsRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static GetPaymentMethodsRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static GetPaymentMethodsRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(GetPaymentMethodsRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - GetPaymentMethodsRequest result = new GetPaymentMethodsRequest(); - - protected override GetPaymentMethodsRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new GetPaymentMethodsRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange_object_provider.GetPaymentMethodsRequest.Descriptor; } - } - - public override GetPaymentMethodsRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange_object_provider.GetPaymentMethodsRequest.DefaultInstance; } - } - - public override GetPaymentMethodsRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - GetPaymentMethodsRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is GetPaymentMethodsRequest) { - return MergeFrom((GetPaymentMethodsRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(GetPaymentMethodsRequest other) { - if (other == global::bnet.protocol.exchange_object_provider.GetPaymentMethodsRequest.DefaultInstance) return this; - if (other.HasBnetAccount) { - MergeBnetAccount(other.BnetAccount); - } - if (other.HasGameAccount) { - MergeGameAccount(other.GameAccount); - } - if (other.HasToon) { - MergeToon(other.Toon); - } - if (other.HasCurrency) { - Currency = other.Currency; - } - if (other.HasCashInOutMask) { - CashInOutMask = other.CashInOutMask; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasBnetAccount) { - subBuilder.MergeFrom(BnetAccount); - } - input.ReadMessage(subBuilder, extensionRegistry); - BnetAccount = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasGameAccount) { - subBuilder.MergeFrom(GameAccount); - } - input.ReadMessage(subBuilder, extensionRegistry); - GameAccount = subBuilder.BuildPartial(); - break; - } - case 26: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasToon) { - subBuilder.MergeFrom(Toon); - } - input.ReadMessage(subBuilder, extensionRegistry); - Toon = subBuilder.BuildPartial(); - break; - } - case 34: { - Currency = input.ReadString(); - break; - } - case 40: { - CashInOutMask = input.ReadUInt32(); - break; - } - } - } - } - - - public bool HasBnetAccount { - get { return result.HasBnetAccount; } - } - public global::bnet.protocol.EntityId BnetAccount { - get { return result.BnetAccount; } - set { SetBnetAccount(value); } - } - public Builder SetBnetAccount(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBnetAccount = true; - result.bnetAccount_ = value; - return this; - } - public Builder SetBnetAccount(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBnetAccount = true; - result.bnetAccount_ = builderForValue.Build(); - return this; - } - public Builder MergeBnetAccount(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasBnetAccount && - result.bnetAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.bnetAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccount_).MergeFrom(value).BuildPartial(); - } else { - result.bnetAccount_ = value; - } - result.hasBnetAccount = true; - return this; - } - public Builder ClearBnetAccount() { - result.hasBnetAccount = false; - result.bnetAccount_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasGameAccount { - get { return result.HasGameAccount; } - } - public global::bnet.protocol.EntityId GameAccount { - get { return result.GameAccount; } - set { SetGameAccount(value); } - } - public Builder SetGameAccount(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasGameAccount = true; - result.gameAccount_ = value; - return this; - } - public Builder SetGameAccount(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasGameAccount = true; - result.gameAccount_ = builderForValue.Build(); - return this; - } - public Builder MergeGameAccount(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasGameAccount && - result.gameAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.gameAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccount_).MergeFrom(value).BuildPartial(); - } else { - result.gameAccount_ = value; - } - result.hasGameAccount = true; - return this; - } - public Builder ClearGameAccount() { - result.hasGameAccount = false; - result.gameAccount_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasToon { - get { return result.HasToon; } - } - public global::bnet.protocol.EntityId Toon { - get { return result.Toon; } - set { SetToon(value); } - } - public Builder SetToon(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasToon = true; - result.toon_ = value; - return this; - } - public Builder SetToon(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasToon = true; - result.toon_ = builderForValue.Build(); - return this; - } - public Builder MergeToon(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasToon && - result.toon_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.toon_ = global::bnet.protocol.EntityId.CreateBuilder(result.toon_).MergeFrom(value).BuildPartial(); - } else { - result.toon_ = value; - } - result.hasToon = true; - return this; - } - public Builder ClearToon() { - result.hasToon = false; - result.toon_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasCurrency { - get { return result.HasCurrency; } - } - public string Currency { - get { return result.Currency; } - set { SetCurrency(value); } - } - public Builder SetCurrency(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasCurrency = true; - result.currency_ = value; - return this; - } - public Builder ClearCurrency() { - result.hasCurrency = false; - result.currency_ = ""; - return this; - } - - public bool HasCashInOutMask { - get { return result.HasCashInOutMask; } - } - public uint CashInOutMask { - get { return result.CashInOutMask; } - set { SetCashInOutMask(value); } - } - public Builder SetCashInOutMask(uint value) { - result.hasCashInOutMask = true; - result.cashInOutMask_ = value; - return this; - } - public Builder ClearCashInOutMask() { - result.hasCashInOutMask = false; - result.cashInOutMask_ = 0; - return this; - } - } - static GetPaymentMethodsRequest() { - object.ReferenceEquals(global::bnet.protocol.exchange_object_provider.ExchangeObjectProvider.Descriptor, null); - } - } - - public sealed partial class PaymentMethod : pb::GeneratedMessage { - private static readonly PaymentMethod defaultInstance = new Builder().BuildPartial(); - public static PaymentMethod DefaultInstance { - get { return defaultInstance; } - } - - public override PaymentMethod DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override PaymentMethod ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange_object_provider.ExchangeObjectProvider.internal__static_bnet_protocol_exchange_object_provider_PaymentMethod__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange_object_provider.ExchangeObjectProvider.internal__static_bnet_protocol_exchange_object_provider_PaymentMethod__FieldAccessorTable; } - } - - public const int AccountFieldNumber = 1; - private bool hasAccount; - private global::bnet.protocol.exchange.BlobFrom account_ = global::bnet.protocol.exchange.BlobFrom.DefaultInstance; - public bool HasAccount { - get { return hasAccount; } - } - public global::bnet.protocol.exchange.BlobFrom Account { - get { return account_; } - } - - public const int DescriptionFieldNumber = 2; - private bool hasDescription; - private string description_ = ""; - public bool HasDescription { - get { return hasDescription; } - } - public string Description { - get { return description_; } - } - - public const int AmountFieldNumber = 3; - private bool hasAmount; - private ulong amount_ = 0UL; - public bool HasAmount { - get { return hasAmount; } - } - public ulong Amount { - get { return amount_; } - } - - public override bool IsInitialized { - get { - if (!hasAccount) return false; - if (!hasDescription) return false; - if (!Account.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasAccount) { - output.WriteMessage(1, Account); - } - if (HasDescription) { - output.WriteString(2, Description); - } - if (HasAmount) { - output.WriteUInt64(3, Amount); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasAccount) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Account); - } - if (HasDescription) { - size += pb::CodedOutputStream.ComputeStringSize(2, Description); - } - if (HasAmount) { - size += pb::CodedOutputStream.ComputeUInt64Size(3, Amount); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static PaymentMethod ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PaymentMethod ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PaymentMethod ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PaymentMethod ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PaymentMethod ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PaymentMethod ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static PaymentMethod ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static PaymentMethod ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static PaymentMethod ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PaymentMethod ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(PaymentMethod prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - PaymentMethod result = new PaymentMethod(); - - protected override PaymentMethod MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new PaymentMethod(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange_object_provider.PaymentMethod.Descriptor; } - } - - public override PaymentMethod DefaultInstanceForType { - get { return global::bnet.protocol.exchange_object_provider.PaymentMethod.DefaultInstance; } - } - - public override PaymentMethod BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - PaymentMethod returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is PaymentMethod) { - return MergeFrom((PaymentMethod) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(PaymentMethod other) { - if (other == global::bnet.protocol.exchange_object_provider.PaymentMethod.DefaultInstance) return this; - if (other.HasAccount) { - MergeAccount(other.Account); - } - if (other.HasDescription) { - Description = other.Description; - } - if (other.HasAmount) { - Amount = other.Amount; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange.BlobFrom.Builder subBuilder = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(); - if (HasAccount) { - subBuilder.MergeFrom(Account); - } - input.ReadMessage(subBuilder, extensionRegistry); - Account = subBuilder.BuildPartial(); - break; - } - case 18: { - Description = input.ReadString(); - break; - } - case 24: { - Amount = input.ReadUInt64(); - break; - } - } - } - } - - - public bool HasAccount { - get { return result.HasAccount; } - } - public global::bnet.protocol.exchange.BlobFrom Account { - get { return result.Account; } - set { SetAccount(value); } - } - public Builder SetAccount(global::bnet.protocol.exchange.BlobFrom value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasAccount = true; - result.account_ = value; - return this; - } - public Builder SetAccount(global::bnet.protocol.exchange.BlobFrom.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasAccount = true; - result.account_ = builderForValue.Build(); - return this; - } - public Builder MergeAccount(global::bnet.protocol.exchange.BlobFrom value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAccount && - result.account_ != global::bnet.protocol.exchange.BlobFrom.DefaultInstance) { - result.account_ = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(result.account_).MergeFrom(value).BuildPartial(); - } else { - result.account_ = value; - } - result.hasAccount = true; - return this; - } - public Builder ClearAccount() { - result.hasAccount = false; - result.account_ = global::bnet.protocol.exchange.BlobFrom.DefaultInstance; - return this; - } - - public bool HasDescription { - get { return result.HasDescription; } - } - public string Description { - get { return result.Description; } - set { SetDescription(value); } - } - public Builder SetDescription(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasDescription = true; - result.description_ = value; - return this; - } - public Builder ClearDescription() { - result.hasDescription = false; - result.description_ = ""; - return this; - } - - public bool HasAmount { - get { return result.HasAmount; } - } - public ulong Amount { - get { return result.Amount; } - set { SetAmount(value); } - } - public Builder SetAmount(ulong value) { - result.hasAmount = true; - result.amount_ = value; - return this; - } - public Builder ClearAmount() { - result.hasAmount = false; - result.amount_ = 0UL; - return this; - } - } - static PaymentMethod() { - object.ReferenceEquals(global::bnet.protocol.exchange_object_provider.ExchangeObjectProvider.Descriptor, null); - } - } - - public sealed partial class GetPaymentMethodsResponse : pb::GeneratedMessage { - private static readonly GetPaymentMethodsResponse defaultInstance = new Builder().BuildPartial(); - public static GetPaymentMethodsResponse DefaultInstance { - get { return defaultInstance; } - } - - public override GetPaymentMethodsResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override GetPaymentMethodsResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange_object_provider.ExchangeObjectProvider.internal__static_bnet_protocol_exchange_object_provider_GetPaymentMethodsResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange_object_provider.ExchangeObjectProvider.internal__static_bnet_protocol_exchange_object_provider_GetPaymentMethodsResponse__FieldAccessorTable; } - } - - public const int MethodsFieldNumber = 1; - private pbc::PopsicleList methods_ = new pbc::PopsicleList(); - public scg::IList MethodsList { - get { return methods_; } - } - public int MethodsCount { - get { return methods_.Count; } - } - public global::bnet.protocol.exchange_object_provider.PaymentMethod GetMethods(int index) { - return methods_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::bnet.protocol.exchange_object_provider.PaymentMethod element in MethodsList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::bnet.protocol.exchange_object_provider.PaymentMethod element in MethodsList) { - output.WriteMessage(1, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::bnet.protocol.exchange_object_provider.PaymentMethod element in MethodsList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static GetPaymentMethodsResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static GetPaymentMethodsResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static GetPaymentMethodsResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static GetPaymentMethodsResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static GetPaymentMethodsResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static GetPaymentMethodsResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static GetPaymentMethodsResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static GetPaymentMethodsResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static GetPaymentMethodsResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static GetPaymentMethodsResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(GetPaymentMethodsResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - GetPaymentMethodsResponse result = new GetPaymentMethodsResponse(); - - protected override GetPaymentMethodsResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new GetPaymentMethodsResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.exchange_object_provider.GetPaymentMethodsResponse.Descriptor; } - } - - public override GetPaymentMethodsResponse DefaultInstanceForType { - get { return global::bnet.protocol.exchange_object_provider.GetPaymentMethodsResponse.DefaultInstance; } - } - - public override GetPaymentMethodsResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.methods_.MakeReadOnly(); - GetPaymentMethodsResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is GetPaymentMethodsResponse) { - return MergeFrom((GetPaymentMethodsResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(GetPaymentMethodsResponse other) { - if (other == global::bnet.protocol.exchange_object_provider.GetPaymentMethodsResponse.DefaultInstance) return this; - if (other.methods_.Count != 0) { - base.AddRange(other.methods_, result.methods_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.exchange_object_provider.PaymentMethod.Builder subBuilder = global::bnet.protocol.exchange_object_provider.PaymentMethod.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddMethods(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public pbc::IPopsicleList MethodsList { - get { return result.methods_; } - } - public int MethodsCount { - get { return result.MethodsCount; } - } - public global::bnet.protocol.exchange_object_provider.PaymentMethod GetMethods(int index) { - return result.GetMethods(index); - } - public Builder SetMethods(int index, global::bnet.protocol.exchange_object_provider.PaymentMethod value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.methods_[index] = value; - return this; - } - public Builder SetMethods(int index, global::bnet.protocol.exchange_object_provider.PaymentMethod.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.methods_[index] = builderForValue.Build(); - return this; - } - public Builder AddMethods(global::bnet.protocol.exchange_object_provider.PaymentMethod value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.methods_.Add(value); - return this; - } - public Builder AddMethods(global::bnet.protocol.exchange_object_provider.PaymentMethod.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.methods_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeMethods(scg::IEnumerable values) { - base.AddRange(values, result.methods_); - return this; - } - public Builder ClearMethods() { - result.methods_.Clear(); - return this; - } - } - static GetPaymentMethodsResponse() { - object.ReferenceEquals(global::bnet.protocol.exchange_object_provider.ExchangeObjectProvider.Descriptor, null); - } - } - - #endregion - -} diff --git a/source/D3Proto/bnet/protocol/followers/Followers.cs b/source/D3Proto/bnet/protocol/followers/Followers.cs deleted file mode 100644 index fe1ecd94..00000000 --- a/source/D3Proto/bnet/protocol/followers/Followers.cs +++ /dev/null @@ -1,3281 +0,0 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace bnet.protocol.followers { - - public static partial class Followers { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_bnet_protocol_followers_FollowedUser__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_followers_FollowedUser__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_followers_SubscribeToFollowersRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_followers_SubscribeToFollowersRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_followers_SubscribeToFollowersResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_followers_SubscribeToFollowersResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_followers_StartFollowingRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_followers_StartFollowingRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_followers_StartFollowingResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_followers_StartFollowingResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_followers_StopFollowingRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_followers_StopFollowingRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_followers_StopFollowingResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_followers_StopFollowingResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_followers_UpdateFollowerStateRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_followers_UpdateFollowerStateRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_followers_UpdateFollowerStateResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_followers_UpdateFollowerStateResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_followers_FollowerNotification__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_followers_FollowerNotification__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static Followers() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "CixzZXJ2aWNlL2ZvbGxvd2Vycy9kZWZpbml0aW9uL2ZvbGxvd2Vycy5wcm90" + - "bxIXYm5ldC5wcm90b2NvbC5mb2xsb3dlcnMaHGxpYi9wcm90b2NvbC9hdHRy" + - "aWJ1dGUucHJvdG8aGWxpYi9wcm90b2NvbC9lbnRpdHkucHJvdG8aEWxpYi9y" + - "cGMvcnBjLnByb3RvImoKDEZvbGxvd2VkVXNlchIjCgJpZBgBIAIoCzIXLmJu" + - "ZXQucHJvdG9jb2wuRW50aXR5SWQSNQoJYXR0cmlidXRlGAIgAygLMiIuYm5l" + - "dC5wcm90b2NvbC5hdHRyaWJ1dGUuQXR0cmlidXRlIlsKG1N1YnNjcmliZVRv" + - "Rm9sbG93ZXJzUmVxdWVzdBIpCghhZ2VudF9pZBgBIAEoCzIXLmJuZXQucHJv" + - "dG9jb2wuRW50aXR5SWQSEQoJb2JqZWN0X2lkGAIgAigEIl0KHFN1YnNjcmli" + - "ZVRvRm9sbG93ZXJzUmVzcG9uc2USPQoOZm9sbG93ZWRfdXNlcnMYAiADKAsy" + - "JS5ibmV0LnByb3RvY29sLmZvbGxvd2Vycy5Gb2xsb3dlZFVzZXIihQEKFVN0" + - "YXJ0Rm9sbG93aW5nUmVxdWVzdBIpCghhZ2VudF9pZBgBIAEoCzIXLmJuZXQu" + - "cHJvdG9jb2wuRW50aXR5SWQSKgoJdGFyZ2V0X2lkGAIgASgLMhcuYm5ldC5w" + - "cm90b2NvbC5FbnRpdHlJZBIVCg1mb2xsb3dlcl9uYW1lGAMgASgJIlYKFlN0" + - "YXJ0Rm9sbG93aW5nUmVzcG9uc2USPAoNZm9sbG93ZWRfdXNlchgCIAEoCzIl" + - "LmJuZXQucHJvdG9jb2wuZm9sbG93ZXJzLkZvbGxvd2VkVXNlciJtChRTdG9w" + - "Rm9sbG93aW5nUmVxdWVzdBIpCghhZ2VudF9pZBgBIAEoCzIXLmJuZXQucHJv" + - "dG9jb2wuRW50aXR5SWQSKgoJdGFyZ2V0X2lkGAIgAigLMhcuYm5ldC5wcm90" + - "b2NvbC5FbnRpdHlJZCJVChVTdG9wRm9sbG93aW5nUmVzcG9uc2USPAoNZm9s" + - "bG93ZWRfdXNlchgCIAEoCzIlLmJuZXQucHJvdG9jb2wuZm9sbG93ZXJzLkZv" + - "bGxvd2VkVXNlciKqAQoaVXBkYXRlRm9sbG93ZXJTdGF0ZVJlcXVlc3QSKQoI" + - "YWdlbnRfaWQYASABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEioKCXRh" + - "cmdldF9pZBgCIAIoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSNQoJYXR0" + - "cmlidXRlGAMgAygLMiIuYm5ldC5wcm90b2NvbC5hdHRyaWJ1dGUuQXR0cmli" + - "dXRlIoABChtVcGRhdGVGb2xsb3dlclN0YXRlUmVzcG9uc2USKgoJdGFyZ2V0" + - "X2lkGAIgAigLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBI1CglhdHRyaWJ1" + - "dGUYAyADKAsyIi5ibmV0LnByb3RvY29sLmF0dHJpYnV0ZS5BdHRyaWJ1dGUi" + - "VAoURm9sbG93ZXJOb3RpZmljYXRpb24SPAoNZm9sbG93ZWRfdXNlchgBIAIo" + - "CzIlLmJuZXQucHJvdG9jb2wuZm9sbG93ZXJzLkZvbGxvd2VkVXNlcjL+AwoQ" + - "Rm9sbG93ZXJzU2VydmljZRKDAQoUU3Vic2NyaWJlVG9Gb2xsb3dlcnMSNC5i" + - "bmV0LnByb3RvY29sLmZvbGxvd2Vycy5TdWJzY3JpYmVUb0ZvbGxvd2Vyc1Jl" + - "cXVlc3QaNS5ibmV0LnByb3RvY29sLmZvbGxvd2Vycy5TdWJzY3JpYmVUb0Zv" + - "bGxvd2Vyc1Jlc3BvbnNlEnEKDlN0YXJ0Rm9sbG93aW5nEi4uYm5ldC5wcm90" + - "b2NvbC5mb2xsb3dlcnMuU3RhcnRGb2xsb3dpbmdSZXF1ZXN0Gi8uYm5ldC5w" + - "cm90b2NvbC5mb2xsb3dlcnMuU3RhcnRGb2xsb3dpbmdSZXNwb25zZRJuCg1T" + - "dG9wRm9sbG93aW5nEi0uYm5ldC5wcm90b2NvbC5mb2xsb3dlcnMuU3RvcEZv" + - "bGxvd2luZ1JlcXVlc3QaLi5ibmV0LnByb3RvY29sLmZvbGxvd2Vycy5TdG9w" + - "Rm9sbG93aW5nUmVzcG9uc2USgAEKE1VwZGF0ZUZvbGxvd2VyU3RhdGUSMy5i" + - "bmV0LnByb3RvY29sLmZvbGxvd2Vycy5VcGRhdGVGb2xsb3dlclN0YXRlUmVx" + - "dWVzdBo0LmJuZXQucHJvdG9jb2wuZm9sbG93ZXJzLlVwZGF0ZUZvbGxvd2Vy" + - "U3RhdGVSZXNwb25zZTJ1Cg9Gb2xsb3dlcnNOb3RpZnkSYgoVTm90aWZ5Rm9s" + - "bG93ZXJSZW1vdmVkEi0uYm5ldC5wcm90b2NvbC5mb2xsb3dlcnMuRm9sbG93" + - "ZXJOb3RpZmljYXRpb24aGi5ibmV0LnByb3RvY29sLk5PX1JFU1BPTlNFQgOA" + - "AQE="); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_bnet_protocol_followers_FollowedUser__Descriptor = Descriptor.MessageTypes[0]; - internal__static_bnet_protocol_followers_FollowedUser__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_followers_FollowedUser__Descriptor, - new string[] { "Id", "Attribute", }); - internal__static_bnet_protocol_followers_SubscribeToFollowersRequest__Descriptor = Descriptor.MessageTypes[1]; - internal__static_bnet_protocol_followers_SubscribeToFollowersRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_followers_SubscribeToFollowersRequest__Descriptor, - new string[] { "AgentId", "ObjectId", }); - internal__static_bnet_protocol_followers_SubscribeToFollowersResponse__Descriptor = Descriptor.MessageTypes[2]; - internal__static_bnet_protocol_followers_SubscribeToFollowersResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_followers_SubscribeToFollowersResponse__Descriptor, - new string[] { "FollowedUsers", }); - internal__static_bnet_protocol_followers_StartFollowingRequest__Descriptor = Descriptor.MessageTypes[3]; - internal__static_bnet_protocol_followers_StartFollowingRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_followers_StartFollowingRequest__Descriptor, - new string[] { "AgentId", "TargetId", "FollowerName", }); - internal__static_bnet_protocol_followers_StartFollowingResponse__Descriptor = Descriptor.MessageTypes[4]; - internal__static_bnet_protocol_followers_StartFollowingResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_followers_StartFollowingResponse__Descriptor, - new string[] { "FollowedUser", }); - internal__static_bnet_protocol_followers_StopFollowingRequest__Descriptor = Descriptor.MessageTypes[5]; - internal__static_bnet_protocol_followers_StopFollowingRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_followers_StopFollowingRequest__Descriptor, - new string[] { "AgentId", "TargetId", }); - internal__static_bnet_protocol_followers_StopFollowingResponse__Descriptor = Descriptor.MessageTypes[6]; - internal__static_bnet_protocol_followers_StopFollowingResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_followers_StopFollowingResponse__Descriptor, - new string[] { "FollowedUser", }); - internal__static_bnet_protocol_followers_UpdateFollowerStateRequest__Descriptor = Descriptor.MessageTypes[7]; - internal__static_bnet_protocol_followers_UpdateFollowerStateRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_followers_UpdateFollowerStateRequest__Descriptor, - new string[] { "AgentId", "TargetId", "Attribute", }); - internal__static_bnet_protocol_followers_UpdateFollowerStateResponse__Descriptor = Descriptor.MessageTypes[8]; - internal__static_bnet_protocol_followers_UpdateFollowerStateResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_followers_UpdateFollowerStateResponse__Descriptor, - new string[] { "TargetId", "Attribute", }); - internal__static_bnet_protocol_followers_FollowerNotification__Descriptor = Descriptor.MessageTypes[9]; - internal__static_bnet_protocol_followers_FollowerNotification__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_followers_FollowerNotification__Descriptor, - new string[] { "FollowedUser", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::bnet.protocol.attribute.Proto.Attribute.Descriptor, - global::bnet.protocol.Entity.Descriptor, - global::bnet.protocol.Rpc.Descriptor, - }, assigner); - } - #endregion - - } - #region Messages - public sealed partial class FollowedUser : pb::GeneratedMessage { - private static readonly FollowedUser defaultInstance = new Builder().BuildPartial(); - public static FollowedUser DefaultInstance { - get { return defaultInstance; } - } - - public override FollowedUser DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override FollowedUser ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.followers.Followers.internal__static_bnet_protocol_followers_FollowedUser__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.followers.Followers.internal__static_bnet_protocol_followers_FollowedUser__FieldAccessorTable; } - } - - public const int IdFieldNumber = 1; - private bool hasId; - private global::bnet.protocol.EntityId id_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasId { - get { return hasId; } - } - public global::bnet.protocol.EntityId Id { - get { return id_; } - } - - public const int AttributeFieldNumber = 2; - private pbc::PopsicleList attribute_ = new pbc::PopsicleList(); - public scg::IList AttributeList { - get { return attribute_; } - } - public int AttributeCount { - get { return attribute_.Count; } - } - public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { - return attribute_[index]; - } - - public override bool IsInitialized { - get { - if (!hasId) return false; - if (!Id.IsInitialized) return false; - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasId) { - output.WriteMessage(1, Id); - } - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - output.WriteMessage(2, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Id); - } - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static FollowedUser ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FollowedUser ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FollowedUser ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FollowedUser ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FollowedUser ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FollowedUser ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static FollowedUser ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static FollowedUser ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static FollowedUser ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FollowedUser ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(FollowedUser prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - FollowedUser result = new FollowedUser(); - - protected override FollowedUser MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new FollowedUser(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.followers.FollowedUser.Descriptor; } - } - - public override FollowedUser DefaultInstanceForType { - get { return global::bnet.protocol.followers.FollowedUser.DefaultInstance; } - } - - public override FollowedUser BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.attribute_.MakeReadOnly(); - FollowedUser returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is FollowedUser) { - return MergeFrom((FollowedUser) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(FollowedUser other) { - if (other == global::bnet.protocol.followers.FollowedUser.DefaultInstance) return this; - if (other.HasId) { - MergeId(other.Id); - } - if (other.attribute_.Count != 0) { - base.AddRange(other.attribute_, result.attribute_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasId) { - subBuilder.MergeFrom(Id); - } - input.ReadMessage(subBuilder, extensionRegistry); - Id = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.attribute.Attribute.Builder subBuilder = global::bnet.protocol.attribute.Attribute.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddAttribute(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public bool HasId { - get { return result.HasId; } - } - public global::bnet.protocol.EntityId Id { - get { return result.Id; } - set { SetId(value); } - } - public Builder SetId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasId = true; - result.id_ = value; - return this; - } - public Builder SetId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasId = true; - result.id_ = builderForValue.Build(); - return this; - } - public Builder MergeId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasId && - result.id_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.id_ = global::bnet.protocol.EntityId.CreateBuilder(result.id_).MergeFrom(value).BuildPartial(); - } else { - result.id_ = value; - } - result.hasId = true; - return this; - } - public Builder ClearId() { - result.hasId = false; - result.id_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public pbc::IPopsicleList AttributeList { - get { return result.attribute_; } - } - public int AttributeCount { - get { return result.AttributeCount; } - } - public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { - return result.GetAttribute(index); - } - public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.attribute_[index] = value; - return this; - } - public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.attribute_[index] = builderForValue.Build(); - return this; - } - public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.attribute_.Add(value); - return this; - } - public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.attribute_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeAttribute(scg::IEnumerable values) { - base.AddRange(values, result.attribute_); - return this; - } - public Builder ClearAttribute() { - result.attribute_.Clear(); - return this; - } - } - static FollowedUser() { - object.ReferenceEquals(global::bnet.protocol.followers.Followers.Descriptor, null); - } - } - - public sealed partial class SubscribeToFollowersRequest : pb::GeneratedMessage { - private static readonly SubscribeToFollowersRequest defaultInstance = new Builder().BuildPartial(); - public static SubscribeToFollowersRequest DefaultInstance { - get { return defaultInstance; } - } - - public override SubscribeToFollowersRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override SubscribeToFollowersRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.followers.Followers.internal__static_bnet_protocol_followers_SubscribeToFollowersRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.followers.Followers.internal__static_bnet_protocol_followers_SubscribeToFollowersRequest__FieldAccessorTable; } - } - - public const int AgentIdFieldNumber = 1; - private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasAgentId { - get { return hasAgentId; } - } - public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } - } - - public const int ObjectIdFieldNumber = 2; - private bool hasObjectId; - private ulong objectId_ = 0UL; - public bool HasObjectId { - get { return hasObjectId; } - } - public ulong ObjectId { - get { return objectId_; } - } - - public override bool IsInitialized { - get { - if (!hasObjectId) return false; - if (HasAgentId) { - if (!AgentId.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasAgentId) { - output.WriteMessage(1, AgentId); - } - if (HasObjectId) { - output.WriteUInt64(2, ObjectId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasAgentId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); - } - if (HasObjectId) { - size += pb::CodedOutputStream.ComputeUInt64Size(2, ObjectId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static SubscribeToFollowersRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SubscribeToFollowersRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SubscribeToFollowersRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SubscribeToFollowersRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SubscribeToFollowersRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SubscribeToFollowersRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SubscribeToFollowersRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SubscribeToFollowersRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SubscribeToFollowersRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SubscribeToFollowersRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SubscribeToFollowersRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - SubscribeToFollowersRequest result = new SubscribeToFollowersRequest(); - - protected override SubscribeToFollowersRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new SubscribeToFollowersRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.followers.SubscribeToFollowersRequest.Descriptor; } - } - - public override SubscribeToFollowersRequest DefaultInstanceForType { - get { return global::bnet.protocol.followers.SubscribeToFollowersRequest.DefaultInstance; } - } - - public override SubscribeToFollowersRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - SubscribeToFollowersRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SubscribeToFollowersRequest) { - return MergeFrom((SubscribeToFollowersRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SubscribeToFollowersRequest other) { - if (other == global::bnet.protocol.followers.SubscribeToFollowersRequest.DefaultInstance) return this; - if (other.HasAgentId) { - MergeAgentId(other.AgentId); - } - if (other.HasObjectId) { - ObjectId = other.ObjectId; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { - subBuilder.MergeFrom(AgentId); - } - input.ReadMessage(subBuilder, extensionRegistry); - AgentId = subBuilder.BuildPartial(); - break; - } - case 16: { - ObjectId = input.ReadUInt64(); - break; - } - } - } - } - - - public bool HasAgentId { - get { return result.HasAgentId; } - } - public global::bnet.protocol.EntityId AgentId { - get { return result.AgentId; } - set { SetAgentId(value); } - } - public Builder SetAgentId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasAgentId = true; - result.agentId_ = value; - return this; - } - public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasAgentId = true; - result.agentId_ = builderForValue.Build(); - return this; - } - public Builder MergeAgentId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && - result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); - } else { - result.agentId_ = value; - } - result.hasAgentId = true; - return this; - } - public Builder ClearAgentId() { - result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasObjectId { - get { return result.HasObjectId; } - } - public ulong ObjectId { - get { return result.ObjectId; } - set { SetObjectId(value); } - } - public Builder SetObjectId(ulong value) { - result.hasObjectId = true; - result.objectId_ = value; - return this; - } - public Builder ClearObjectId() { - result.hasObjectId = false; - result.objectId_ = 0UL; - return this; - } - } - static SubscribeToFollowersRequest() { - object.ReferenceEquals(global::bnet.protocol.followers.Followers.Descriptor, null); - } - } - - public sealed partial class SubscribeToFollowersResponse : pb::GeneratedMessage { - private static readonly SubscribeToFollowersResponse defaultInstance = new Builder().BuildPartial(); - public static SubscribeToFollowersResponse DefaultInstance { - get { return defaultInstance; } - } - - public override SubscribeToFollowersResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override SubscribeToFollowersResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.followers.Followers.internal__static_bnet_protocol_followers_SubscribeToFollowersResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.followers.Followers.internal__static_bnet_protocol_followers_SubscribeToFollowersResponse__FieldAccessorTable; } - } - - public const int FollowedUsersFieldNumber = 2; - private pbc::PopsicleList followedUsers_ = new pbc::PopsicleList(); - public scg::IList FollowedUsersList { - get { return followedUsers_; } - } - public int FollowedUsersCount { - get { return followedUsers_.Count; } - } - public global::bnet.protocol.followers.FollowedUser GetFollowedUsers(int index) { - return followedUsers_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::bnet.protocol.followers.FollowedUser element in FollowedUsersList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::bnet.protocol.followers.FollowedUser element in FollowedUsersList) { - output.WriteMessage(2, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::bnet.protocol.followers.FollowedUser element in FollowedUsersList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static SubscribeToFollowersResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SubscribeToFollowersResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SubscribeToFollowersResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SubscribeToFollowersResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SubscribeToFollowersResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SubscribeToFollowersResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SubscribeToFollowersResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SubscribeToFollowersResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SubscribeToFollowersResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SubscribeToFollowersResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SubscribeToFollowersResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - SubscribeToFollowersResponse result = new SubscribeToFollowersResponse(); - - protected override SubscribeToFollowersResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new SubscribeToFollowersResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.followers.SubscribeToFollowersResponse.Descriptor; } - } - - public override SubscribeToFollowersResponse DefaultInstanceForType { - get { return global::bnet.protocol.followers.SubscribeToFollowersResponse.DefaultInstance; } - } - - public override SubscribeToFollowersResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.followedUsers_.MakeReadOnly(); - SubscribeToFollowersResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SubscribeToFollowersResponse) { - return MergeFrom((SubscribeToFollowersResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SubscribeToFollowersResponse other) { - if (other == global::bnet.protocol.followers.SubscribeToFollowersResponse.DefaultInstance) return this; - if (other.followedUsers_.Count != 0) { - base.AddRange(other.followedUsers_, result.followedUsers_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 18: { - global::bnet.protocol.followers.FollowedUser.Builder subBuilder = global::bnet.protocol.followers.FollowedUser.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddFollowedUsers(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public pbc::IPopsicleList FollowedUsersList { - get { return result.followedUsers_; } - } - public int FollowedUsersCount { - get { return result.FollowedUsersCount; } - } - public global::bnet.protocol.followers.FollowedUser GetFollowedUsers(int index) { - return result.GetFollowedUsers(index); - } - public Builder SetFollowedUsers(int index, global::bnet.protocol.followers.FollowedUser value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.followedUsers_[index] = value; - return this; - } - public Builder SetFollowedUsers(int index, global::bnet.protocol.followers.FollowedUser.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.followedUsers_[index] = builderForValue.Build(); - return this; - } - public Builder AddFollowedUsers(global::bnet.protocol.followers.FollowedUser value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.followedUsers_.Add(value); - return this; - } - public Builder AddFollowedUsers(global::bnet.protocol.followers.FollowedUser.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.followedUsers_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeFollowedUsers(scg::IEnumerable values) { - base.AddRange(values, result.followedUsers_); - return this; - } - public Builder ClearFollowedUsers() { - result.followedUsers_.Clear(); - return this; - } - } - static SubscribeToFollowersResponse() { - object.ReferenceEquals(global::bnet.protocol.followers.Followers.Descriptor, null); - } - } - - public sealed partial class StartFollowingRequest : pb::GeneratedMessage { - private static readonly StartFollowingRequest defaultInstance = new Builder().BuildPartial(); - public static StartFollowingRequest DefaultInstance { - get { return defaultInstance; } - } - - public override StartFollowingRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override StartFollowingRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.followers.Followers.internal__static_bnet_protocol_followers_StartFollowingRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.followers.Followers.internal__static_bnet_protocol_followers_StartFollowingRequest__FieldAccessorTable; } - } - - public const int AgentIdFieldNumber = 1; - private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasAgentId { - get { return hasAgentId; } - } - public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } - } - - public const int TargetIdFieldNumber = 2; - private bool hasTargetId; - private global::bnet.protocol.EntityId targetId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasTargetId { - get { return hasTargetId; } - } - public global::bnet.protocol.EntityId TargetId { - get { return targetId_; } - } - - public const int FollowerNameFieldNumber = 3; - private bool hasFollowerName; - private string followerName_ = ""; - public bool HasFollowerName { - get { return hasFollowerName; } - } - public string FollowerName { - get { return followerName_; } - } - - public override bool IsInitialized { - get { - if (HasAgentId) { - if (!AgentId.IsInitialized) return false; - } - if (HasTargetId) { - if (!TargetId.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasAgentId) { - output.WriteMessage(1, AgentId); - } - if (HasTargetId) { - output.WriteMessage(2, TargetId); - } - if (HasFollowerName) { - output.WriteString(3, FollowerName); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasAgentId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); - } - if (HasTargetId) { - size += pb::CodedOutputStream.ComputeMessageSize(2, TargetId); - } - if (HasFollowerName) { - size += pb::CodedOutputStream.ComputeStringSize(3, FollowerName); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static StartFollowingRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static StartFollowingRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static StartFollowingRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static StartFollowingRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static StartFollowingRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static StartFollowingRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static StartFollowingRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static StartFollowingRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static StartFollowingRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static StartFollowingRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(StartFollowingRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - StartFollowingRequest result = new StartFollowingRequest(); - - protected override StartFollowingRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new StartFollowingRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.followers.StartFollowingRequest.Descriptor; } - } - - public override StartFollowingRequest DefaultInstanceForType { - get { return global::bnet.protocol.followers.StartFollowingRequest.DefaultInstance; } - } - - public override StartFollowingRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - StartFollowingRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is StartFollowingRequest) { - return MergeFrom((StartFollowingRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(StartFollowingRequest other) { - if (other == global::bnet.protocol.followers.StartFollowingRequest.DefaultInstance) return this; - if (other.HasAgentId) { - MergeAgentId(other.AgentId); - } - if (other.HasTargetId) { - MergeTargetId(other.TargetId); - } - if (other.HasFollowerName) { - FollowerName = other.FollowerName; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { - subBuilder.MergeFrom(AgentId); - } - input.ReadMessage(subBuilder, extensionRegistry); - AgentId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasTargetId) { - subBuilder.MergeFrom(TargetId); - } - input.ReadMessage(subBuilder, extensionRegistry); - TargetId = subBuilder.BuildPartial(); - break; - } - case 26: { - FollowerName = input.ReadString(); - break; - } - } - } - } - - - public bool HasAgentId { - get { return result.HasAgentId; } - } - public global::bnet.protocol.EntityId AgentId { - get { return result.AgentId; } - set { SetAgentId(value); } - } - public Builder SetAgentId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasAgentId = true; - result.agentId_ = value; - return this; - } - public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasAgentId = true; - result.agentId_ = builderForValue.Build(); - return this; - } - public Builder MergeAgentId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && - result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); - } else { - result.agentId_ = value; - } - result.hasAgentId = true; - return this; - } - public Builder ClearAgentId() { - result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasTargetId { - get { return result.HasTargetId; } - } - public global::bnet.protocol.EntityId TargetId { - get { return result.TargetId; } - set { SetTargetId(value); } - } - public Builder SetTargetId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasTargetId = true; - result.targetId_ = value; - return this; - } - public Builder SetTargetId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasTargetId = true; - result.targetId_ = builderForValue.Build(); - return this; - } - public Builder MergeTargetId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasTargetId && - result.targetId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.targetId_ = global::bnet.protocol.EntityId.CreateBuilder(result.targetId_).MergeFrom(value).BuildPartial(); - } else { - result.targetId_ = value; - } - result.hasTargetId = true; - return this; - } - public Builder ClearTargetId() { - result.hasTargetId = false; - result.targetId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasFollowerName { - get { return result.HasFollowerName; } - } - public string FollowerName { - get { return result.FollowerName; } - set { SetFollowerName(value); } - } - public Builder SetFollowerName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasFollowerName = true; - result.followerName_ = value; - return this; - } - public Builder ClearFollowerName() { - result.hasFollowerName = false; - result.followerName_ = ""; - return this; - } - } - static StartFollowingRequest() { - object.ReferenceEquals(global::bnet.protocol.followers.Followers.Descriptor, null); - } - } - - public sealed partial class StartFollowingResponse : pb::GeneratedMessage { - private static readonly StartFollowingResponse defaultInstance = new Builder().BuildPartial(); - public static StartFollowingResponse DefaultInstance { - get { return defaultInstance; } - } - - public override StartFollowingResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override StartFollowingResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.followers.Followers.internal__static_bnet_protocol_followers_StartFollowingResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.followers.Followers.internal__static_bnet_protocol_followers_StartFollowingResponse__FieldAccessorTable; } - } - - public const int FollowedUserFieldNumber = 2; - private bool hasFollowedUser; - private global::bnet.protocol.followers.FollowedUser followedUser_ = global::bnet.protocol.followers.FollowedUser.DefaultInstance; - public bool HasFollowedUser { - get { return hasFollowedUser; } - } - public global::bnet.protocol.followers.FollowedUser FollowedUser { - get { return followedUser_; } - } - - public override bool IsInitialized { - get { - if (HasFollowedUser) { - if (!FollowedUser.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasFollowedUser) { - output.WriteMessage(2, FollowedUser); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasFollowedUser) { - size += pb::CodedOutputStream.ComputeMessageSize(2, FollowedUser); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static StartFollowingResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static StartFollowingResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static StartFollowingResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static StartFollowingResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static StartFollowingResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static StartFollowingResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static StartFollowingResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static StartFollowingResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static StartFollowingResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static StartFollowingResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(StartFollowingResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - StartFollowingResponse result = new StartFollowingResponse(); - - protected override StartFollowingResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new StartFollowingResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.followers.StartFollowingResponse.Descriptor; } - } - - public override StartFollowingResponse DefaultInstanceForType { - get { return global::bnet.protocol.followers.StartFollowingResponse.DefaultInstance; } - } - - public override StartFollowingResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - StartFollowingResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is StartFollowingResponse) { - return MergeFrom((StartFollowingResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(StartFollowingResponse other) { - if (other == global::bnet.protocol.followers.StartFollowingResponse.DefaultInstance) return this; - if (other.HasFollowedUser) { - MergeFollowedUser(other.FollowedUser); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 18: { - global::bnet.protocol.followers.FollowedUser.Builder subBuilder = global::bnet.protocol.followers.FollowedUser.CreateBuilder(); - if (HasFollowedUser) { - subBuilder.MergeFrom(FollowedUser); - } - input.ReadMessage(subBuilder, extensionRegistry); - FollowedUser = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasFollowedUser { - get { return result.HasFollowedUser; } - } - public global::bnet.protocol.followers.FollowedUser FollowedUser { - get { return result.FollowedUser; } - set { SetFollowedUser(value); } - } - public Builder SetFollowedUser(global::bnet.protocol.followers.FollowedUser value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasFollowedUser = true; - result.followedUser_ = value; - return this; - } - public Builder SetFollowedUser(global::bnet.protocol.followers.FollowedUser.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasFollowedUser = true; - result.followedUser_ = builderForValue.Build(); - return this; - } - public Builder MergeFollowedUser(global::bnet.protocol.followers.FollowedUser value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasFollowedUser && - result.followedUser_ != global::bnet.protocol.followers.FollowedUser.DefaultInstance) { - result.followedUser_ = global::bnet.protocol.followers.FollowedUser.CreateBuilder(result.followedUser_).MergeFrom(value).BuildPartial(); - } else { - result.followedUser_ = value; - } - result.hasFollowedUser = true; - return this; - } - public Builder ClearFollowedUser() { - result.hasFollowedUser = false; - result.followedUser_ = global::bnet.protocol.followers.FollowedUser.DefaultInstance; - return this; - } - } - static StartFollowingResponse() { - object.ReferenceEquals(global::bnet.protocol.followers.Followers.Descriptor, null); - } - } - - public sealed partial class StopFollowingRequest : pb::GeneratedMessage { - private static readonly StopFollowingRequest defaultInstance = new Builder().BuildPartial(); - public static StopFollowingRequest DefaultInstance { - get { return defaultInstance; } - } - - public override StopFollowingRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override StopFollowingRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.followers.Followers.internal__static_bnet_protocol_followers_StopFollowingRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.followers.Followers.internal__static_bnet_protocol_followers_StopFollowingRequest__FieldAccessorTable; } - } - - public const int AgentIdFieldNumber = 1; - private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasAgentId { - get { return hasAgentId; } - } - public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } - } - - public const int TargetIdFieldNumber = 2; - private bool hasTargetId; - private global::bnet.protocol.EntityId targetId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasTargetId { - get { return hasTargetId; } - } - public global::bnet.protocol.EntityId TargetId { - get { return targetId_; } - } - - public override bool IsInitialized { - get { - if (!hasTargetId) return false; - if (HasAgentId) { - if (!AgentId.IsInitialized) return false; - } - if (!TargetId.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasAgentId) { - output.WriteMessage(1, AgentId); - } - if (HasTargetId) { - output.WriteMessage(2, TargetId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasAgentId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); - } - if (HasTargetId) { - size += pb::CodedOutputStream.ComputeMessageSize(2, TargetId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static StopFollowingRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static StopFollowingRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static StopFollowingRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static StopFollowingRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static StopFollowingRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static StopFollowingRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static StopFollowingRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static StopFollowingRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static StopFollowingRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static StopFollowingRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(StopFollowingRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - StopFollowingRequest result = new StopFollowingRequest(); - - protected override StopFollowingRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new StopFollowingRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.followers.StopFollowingRequest.Descriptor; } - } - - public override StopFollowingRequest DefaultInstanceForType { - get { return global::bnet.protocol.followers.StopFollowingRequest.DefaultInstance; } - } - - public override StopFollowingRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - StopFollowingRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is StopFollowingRequest) { - return MergeFrom((StopFollowingRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(StopFollowingRequest other) { - if (other == global::bnet.protocol.followers.StopFollowingRequest.DefaultInstance) return this; - if (other.HasAgentId) { - MergeAgentId(other.AgentId); - } - if (other.HasTargetId) { - MergeTargetId(other.TargetId); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { - subBuilder.MergeFrom(AgentId); - } - input.ReadMessage(subBuilder, extensionRegistry); - AgentId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasTargetId) { - subBuilder.MergeFrom(TargetId); - } - input.ReadMessage(subBuilder, extensionRegistry); - TargetId = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasAgentId { - get { return result.HasAgentId; } - } - public global::bnet.protocol.EntityId AgentId { - get { return result.AgentId; } - set { SetAgentId(value); } - } - public Builder SetAgentId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasAgentId = true; - result.agentId_ = value; - return this; - } - public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasAgentId = true; - result.agentId_ = builderForValue.Build(); - return this; - } - public Builder MergeAgentId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && - result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); - } else { - result.agentId_ = value; - } - result.hasAgentId = true; - return this; - } - public Builder ClearAgentId() { - result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasTargetId { - get { return result.HasTargetId; } - } - public global::bnet.protocol.EntityId TargetId { - get { return result.TargetId; } - set { SetTargetId(value); } - } - public Builder SetTargetId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasTargetId = true; - result.targetId_ = value; - return this; - } - public Builder SetTargetId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasTargetId = true; - result.targetId_ = builderForValue.Build(); - return this; - } - public Builder MergeTargetId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasTargetId && - result.targetId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.targetId_ = global::bnet.protocol.EntityId.CreateBuilder(result.targetId_).MergeFrom(value).BuildPartial(); - } else { - result.targetId_ = value; - } - result.hasTargetId = true; - return this; - } - public Builder ClearTargetId() { - result.hasTargetId = false; - result.targetId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - } - static StopFollowingRequest() { - object.ReferenceEquals(global::bnet.protocol.followers.Followers.Descriptor, null); - } - } - - public sealed partial class StopFollowingResponse : pb::GeneratedMessage { - private static readonly StopFollowingResponse defaultInstance = new Builder().BuildPartial(); - public static StopFollowingResponse DefaultInstance { - get { return defaultInstance; } - } - - public override StopFollowingResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override StopFollowingResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.followers.Followers.internal__static_bnet_protocol_followers_StopFollowingResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.followers.Followers.internal__static_bnet_protocol_followers_StopFollowingResponse__FieldAccessorTable; } - } - - public const int FollowedUserFieldNumber = 2; - private bool hasFollowedUser; - private global::bnet.protocol.followers.FollowedUser followedUser_ = global::bnet.protocol.followers.FollowedUser.DefaultInstance; - public bool HasFollowedUser { - get { return hasFollowedUser; } - } - public global::bnet.protocol.followers.FollowedUser FollowedUser { - get { return followedUser_; } - } - - public override bool IsInitialized { - get { - if (HasFollowedUser) { - if (!FollowedUser.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasFollowedUser) { - output.WriteMessage(2, FollowedUser); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasFollowedUser) { - size += pb::CodedOutputStream.ComputeMessageSize(2, FollowedUser); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static StopFollowingResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static StopFollowingResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static StopFollowingResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static StopFollowingResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static StopFollowingResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static StopFollowingResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static StopFollowingResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static StopFollowingResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static StopFollowingResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static StopFollowingResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(StopFollowingResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - StopFollowingResponse result = new StopFollowingResponse(); - - protected override StopFollowingResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new StopFollowingResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.followers.StopFollowingResponse.Descriptor; } - } - - public override StopFollowingResponse DefaultInstanceForType { - get { return global::bnet.protocol.followers.StopFollowingResponse.DefaultInstance; } - } - - public override StopFollowingResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - StopFollowingResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is StopFollowingResponse) { - return MergeFrom((StopFollowingResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(StopFollowingResponse other) { - if (other == global::bnet.protocol.followers.StopFollowingResponse.DefaultInstance) return this; - if (other.HasFollowedUser) { - MergeFollowedUser(other.FollowedUser); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 18: { - global::bnet.protocol.followers.FollowedUser.Builder subBuilder = global::bnet.protocol.followers.FollowedUser.CreateBuilder(); - if (HasFollowedUser) { - subBuilder.MergeFrom(FollowedUser); - } - input.ReadMessage(subBuilder, extensionRegistry); - FollowedUser = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasFollowedUser { - get { return result.HasFollowedUser; } - } - public global::bnet.protocol.followers.FollowedUser FollowedUser { - get { return result.FollowedUser; } - set { SetFollowedUser(value); } - } - public Builder SetFollowedUser(global::bnet.protocol.followers.FollowedUser value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasFollowedUser = true; - result.followedUser_ = value; - return this; - } - public Builder SetFollowedUser(global::bnet.protocol.followers.FollowedUser.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasFollowedUser = true; - result.followedUser_ = builderForValue.Build(); - return this; - } - public Builder MergeFollowedUser(global::bnet.protocol.followers.FollowedUser value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasFollowedUser && - result.followedUser_ != global::bnet.protocol.followers.FollowedUser.DefaultInstance) { - result.followedUser_ = global::bnet.protocol.followers.FollowedUser.CreateBuilder(result.followedUser_).MergeFrom(value).BuildPartial(); - } else { - result.followedUser_ = value; - } - result.hasFollowedUser = true; - return this; - } - public Builder ClearFollowedUser() { - result.hasFollowedUser = false; - result.followedUser_ = global::bnet.protocol.followers.FollowedUser.DefaultInstance; - return this; - } - } - static StopFollowingResponse() { - object.ReferenceEquals(global::bnet.protocol.followers.Followers.Descriptor, null); - } - } - - public sealed partial class UpdateFollowerStateRequest : pb::GeneratedMessage { - private static readonly UpdateFollowerStateRequest defaultInstance = new Builder().BuildPartial(); - public static UpdateFollowerStateRequest DefaultInstance { - get { return defaultInstance; } - } - - public override UpdateFollowerStateRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override UpdateFollowerStateRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.followers.Followers.internal__static_bnet_protocol_followers_UpdateFollowerStateRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.followers.Followers.internal__static_bnet_protocol_followers_UpdateFollowerStateRequest__FieldAccessorTable; } - } - - public const int AgentIdFieldNumber = 1; - private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasAgentId { - get { return hasAgentId; } - } - public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } - } - - public const int TargetIdFieldNumber = 2; - private bool hasTargetId; - private global::bnet.protocol.EntityId targetId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasTargetId { - get { return hasTargetId; } - } - public global::bnet.protocol.EntityId TargetId { - get { return targetId_; } - } - - public const int AttributeFieldNumber = 3; - private pbc::PopsicleList attribute_ = new pbc::PopsicleList(); - public scg::IList AttributeList { - get { return attribute_; } - } - public int AttributeCount { - get { return attribute_.Count; } - } - public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { - return attribute_[index]; - } - - public override bool IsInitialized { - get { - if (!hasTargetId) return false; - if (HasAgentId) { - if (!AgentId.IsInitialized) return false; - } - if (!TargetId.IsInitialized) return false; - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasAgentId) { - output.WriteMessage(1, AgentId); - } - if (HasTargetId) { - output.WriteMessage(2, TargetId); - } - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - output.WriteMessage(3, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasAgentId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); - } - if (HasTargetId) { - size += pb::CodedOutputStream.ComputeMessageSize(2, TargetId); - } - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - size += pb::CodedOutputStream.ComputeMessageSize(3, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static UpdateFollowerStateRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static UpdateFollowerStateRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static UpdateFollowerStateRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static UpdateFollowerStateRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static UpdateFollowerStateRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static UpdateFollowerStateRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static UpdateFollowerStateRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static UpdateFollowerStateRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static UpdateFollowerStateRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static UpdateFollowerStateRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(UpdateFollowerStateRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - UpdateFollowerStateRequest result = new UpdateFollowerStateRequest(); - - protected override UpdateFollowerStateRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new UpdateFollowerStateRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.followers.UpdateFollowerStateRequest.Descriptor; } - } - - public override UpdateFollowerStateRequest DefaultInstanceForType { - get { return global::bnet.protocol.followers.UpdateFollowerStateRequest.DefaultInstance; } - } - - public override UpdateFollowerStateRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.attribute_.MakeReadOnly(); - UpdateFollowerStateRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is UpdateFollowerStateRequest) { - return MergeFrom((UpdateFollowerStateRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(UpdateFollowerStateRequest other) { - if (other == global::bnet.protocol.followers.UpdateFollowerStateRequest.DefaultInstance) return this; - if (other.HasAgentId) { - MergeAgentId(other.AgentId); - } - if (other.HasTargetId) { - MergeTargetId(other.TargetId); - } - if (other.attribute_.Count != 0) { - base.AddRange(other.attribute_, result.attribute_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { - subBuilder.MergeFrom(AgentId); - } - input.ReadMessage(subBuilder, extensionRegistry); - AgentId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasTargetId) { - subBuilder.MergeFrom(TargetId); - } - input.ReadMessage(subBuilder, extensionRegistry); - TargetId = subBuilder.BuildPartial(); - break; - } - case 26: { - global::bnet.protocol.attribute.Attribute.Builder subBuilder = global::bnet.protocol.attribute.Attribute.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddAttribute(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public bool HasAgentId { - get { return result.HasAgentId; } - } - public global::bnet.protocol.EntityId AgentId { - get { return result.AgentId; } - set { SetAgentId(value); } - } - public Builder SetAgentId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasAgentId = true; - result.agentId_ = value; - return this; - } - public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasAgentId = true; - result.agentId_ = builderForValue.Build(); - return this; - } - public Builder MergeAgentId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && - result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); - } else { - result.agentId_ = value; - } - result.hasAgentId = true; - return this; - } - public Builder ClearAgentId() { - result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasTargetId { - get { return result.HasTargetId; } - } - public global::bnet.protocol.EntityId TargetId { - get { return result.TargetId; } - set { SetTargetId(value); } - } - public Builder SetTargetId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasTargetId = true; - result.targetId_ = value; - return this; - } - public Builder SetTargetId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasTargetId = true; - result.targetId_ = builderForValue.Build(); - return this; - } - public Builder MergeTargetId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasTargetId && - result.targetId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.targetId_ = global::bnet.protocol.EntityId.CreateBuilder(result.targetId_).MergeFrom(value).BuildPartial(); - } else { - result.targetId_ = value; - } - result.hasTargetId = true; - return this; - } - public Builder ClearTargetId() { - result.hasTargetId = false; - result.targetId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public pbc::IPopsicleList AttributeList { - get { return result.attribute_; } - } - public int AttributeCount { - get { return result.AttributeCount; } - } - public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { - return result.GetAttribute(index); - } - public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.attribute_[index] = value; - return this; - } - public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.attribute_[index] = builderForValue.Build(); - return this; - } - public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.attribute_.Add(value); - return this; - } - public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.attribute_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeAttribute(scg::IEnumerable values) { - base.AddRange(values, result.attribute_); - return this; - } - public Builder ClearAttribute() { - result.attribute_.Clear(); - return this; - } - } - static UpdateFollowerStateRequest() { - object.ReferenceEquals(global::bnet.protocol.followers.Followers.Descriptor, null); - } - } - - public sealed partial class UpdateFollowerStateResponse : pb::GeneratedMessage { - private static readonly UpdateFollowerStateResponse defaultInstance = new Builder().BuildPartial(); - public static UpdateFollowerStateResponse DefaultInstance { - get { return defaultInstance; } - } - - public override UpdateFollowerStateResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override UpdateFollowerStateResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.followers.Followers.internal__static_bnet_protocol_followers_UpdateFollowerStateResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.followers.Followers.internal__static_bnet_protocol_followers_UpdateFollowerStateResponse__FieldAccessorTable; } - } - - public const int TargetIdFieldNumber = 2; - private bool hasTargetId; - private global::bnet.protocol.EntityId targetId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasTargetId { - get { return hasTargetId; } - } - public global::bnet.protocol.EntityId TargetId { - get { return targetId_; } - } - - public const int AttributeFieldNumber = 3; - private pbc::PopsicleList attribute_ = new pbc::PopsicleList(); - public scg::IList AttributeList { - get { return attribute_; } - } - public int AttributeCount { - get { return attribute_.Count; } - } - public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { - return attribute_[index]; - } - - public override bool IsInitialized { - get { - if (!hasTargetId) return false; - if (!TargetId.IsInitialized) return false; - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasTargetId) { - output.WriteMessage(2, TargetId); - } - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - output.WriteMessage(3, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasTargetId) { - size += pb::CodedOutputStream.ComputeMessageSize(2, TargetId); - } - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - size += pb::CodedOutputStream.ComputeMessageSize(3, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static UpdateFollowerStateResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static UpdateFollowerStateResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static UpdateFollowerStateResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static UpdateFollowerStateResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static UpdateFollowerStateResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static UpdateFollowerStateResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static UpdateFollowerStateResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static UpdateFollowerStateResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static UpdateFollowerStateResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static UpdateFollowerStateResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(UpdateFollowerStateResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - UpdateFollowerStateResponse result = new UpdateFollowerStateResponse(); - - protected override UpdateFollowerStateResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new UpdateFollowerStateResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.followers.UpdateFollowerStateResponse.Descriptor; } - } - - public override UpdateFollowerStateResponse DefaultInstanceForType { - get { return global::bnet.protocol.followers.UpdateFollowerStateResponse.DefaultInstance; } - } - - public override UpdateFollowerStateResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.attribute_.MakeReadOnly(); - UpdateFollowerStateResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is UpdateFollowerStateResponse) { - return MergeFrom((UpdateFollowerStateResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(UpdateFollowerStateResponse other) { - if (other == global::bnet.protocol.followers.UpdateFollowerStateResponse.DefaultInstance) return this; - if (other.HasTargetId) { - MergeTargetId(other.TargetId); - } - if (other.attribute_.Count != 0) { - base.AddRange(other.attribute_, result.attribute_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 18: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasTargetId) { - subBuilder.MergeFrom(TargetId); - } - input.ReadMessage(subBuilder, extensionRegistry); - TargetId = subBuilder.BuildPartial(); - break; - } - case 26: { - global::bnet.protocol.attribute.Attribute.Builder subBuilder = global::bnet.protocol.attribute.Attribute.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddAttribute(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public bool HasTargetId { - get { return result.HasTargetId; } - } - public global::bnet.protocol.EntityId TargetId { - get { return result.TargetId; } - set { SetTargetId(value); } - } - public Builder SetTargetId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasTargetId = true; - result.targetId_ = value; - return this; - } - public Builder SetTargetId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasTargetId = true; - result.targetId_ = builderForValue.Build(); - return this; - } - public Builder MergeTargetId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasTargetId && - result.targetId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.targetId_ = global::bnet.protocol.EntityId.CreateBuilder(result.targetId_).MergeFrom(value).BuildPartial(); - } else { - result.targetId_ = value; - } - result.hasTargetId = true; - return this; - } - public Builder ClearTargetId() { - result.hasTargetId = false; - result.targetId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public pbc::IPopsicleList AttributeList { - get { return result.attribute_; } - } - public int AttributeCount { - get { return result.AttributeCount; } - } - public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { - return result.GetAttribute(index); - } - public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.attribute_[index] = value; - return this; - } - public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.attribute_[index] = builderForValue.Build(); - return this; - } - public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.attribute_.Add(value); - return this; - } - public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.attribute_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeAttribute(scg::IEnumerable values) { - base.AddRange(values, result.attribute_); - return this; - } - public Builder ClearAttribute() { - result.attribute_.Clear(); - return this; - } - } - static UpdateFollowerStateResponse() { - object.ReferenceEquals(global::bnet.protocol.followers.Followers.Descriptor, null); - } - } - - public sealed partial class FollowerNotification : pb::GeneratedMessage { - private static readonly FollowerNotification defaultInstance = new Builder().BuildPartial(); - public static FollowerNotification DefaultInstance { - get { return defaultInstance; } - } - - public override FollowerNotification DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override FollowerNotification ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.followers.Followers.internal__static_bnet_protocol_followers_FollowerNotification__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.followers.Followers.internal__static_bnet_protocol_followers_FollowerNotification__FieldAccessorTable; } - } - - public const int FollowedUserFieldNumber = 1; - private bool hasFollowedUser; - private global::bnet.protocol.followers.FollowedUser followedUser_ = global::bnet.protocol.followers.FollowedUser.DefaultInstance; - public bool HasFollowedUser { - get { return hasFollowedUser; } - } - public global::bnet.protocol.followers.FollowedUser FollowedUser { - get { return followedUser_; } - } - - public override bool IsInitialized { - get { - if (!hasFollowedUser) return false; - if (!FollowedUser.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasFollowedUser) { - output.WriteMessage(1, FollowedUser); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasFollowedUser) { - size += pb::CodedOutputStream.ComputeMessageSize(1, FollowedUser); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static FollowerNotification ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FollowerNotification ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FollowerNotification ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FollowerNotification ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FollowerNotification ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FollowerNotification ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static FollowerNotification ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static FollowerNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static FollowerNotification ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FollowerNotification ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(FollowerNotification prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - FollowerNotification result = new FollowerNotification(); - - protected override FollowerNotification MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new FollowerNotification(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.followers.FollowerNotification.Descriptor; } - } - - public override FollowerNotification DefaultInstanceForType { - get { return global::bnet.protocol.followers.FollowerNotification.DefaultInstance; } - } - - public override FollowerNotification BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - FollowerNotification returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is FollowerNotification) { - return MergeFrom((FollowerNotification) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(FollowerNotification other) { - if (other == global::bnet.protocol.followers.FollowerNotification.DefaultInstance) return this; - if (other.HasFollowedUser) { - MergeFollowedUser(other.FollowedUser); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.followers.FollowedUser.Builder subBuilder = global::bnet.protocol.followers.FollowedUser.CreateBuilder(); - if (HasFollowedUser) { - subBuilder.MergeFrom(FollowedUser); - } - input.ReadMessage(subBuilder, extensionRegistry); - FollowedUser = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasFollowedUser { - get { return result.HasFollowedUser; } - } - public global::bnet.protocol.followers.FollowedUser FollowedUser { - get { return result.FollowedUser; } - set { SetFollowedUser(value); } - } - public Builder SetFollowedUser(global::bnet.protocol.followers.FollowedUser value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasFollowedUser = true; - result.followedUser_ = value; - return this; - } - public Builder SetFollowedUser(global::bnet.protocol.followers.FollowedUser.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasFollowedUser = true; - result.followedUser_ = builderForValue.Build(); - return this; - } - public Builder MergeFollowedUser(global::bnet.protocol.followers.FollowedUser value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasFollowedUser && - result.followedUser_ != global::bnet.protocol.followers.FollowedUser.DefaultInstance) { - result.followedUser_ = global::bnet.protocol.followers.FollowedUser.CreateBuilder(result.followedUser_).MergeFrom(value).BuildPartial(); - } else { - result.followedUser_ = value; - } - result.hasFollowedUser = true; - return this; - } - public Builder ClearFollowedUser() { - result.hasFollowedUser = false; - result.followedUser_ = global::bnet.protocol.followers.FollowedUser.DefaultInstance; - return this; - } - } - static FollowerNotification() { - object.ReferenceEquals(global::bnet.protocol.followers.Followers.Descriptor, null); - } - } - - #endregion - - #region Services - public abstract class FollowersService : pb::IService { - public abstract void SubscribeToFollowers( - pb::IRpcController controller, - global::bnet.protocol.followers.SubscribeToFollowersRequest request, - global::System.Action done); - public abstract void StartFollowing( - pb::IRpcController controller, - global::bnet.protocol.followers.StartFollowingRequest request, - global::System.Action done); - public abstract void StopFollowing( - pb::IRpcController controller, - global::bnet.protocol.followers.StopFollowingRequest request, - global::System.Action done); - public abstract void UpdateFollowerState( - pb::IRpcController controller, - global::bnet.protocol.followers.UpdateFollowerStateRequest request, - global::System.Action done); - - public static pbd::ServiceDescriptor Descriptor { - get { return Followers.Descriptor.Services[0]; } - } - public pbd::ServiceDescriptor DescriptorForType { - get { return Descriptor; } - } - - public void CallMethod( - pbd::MethodDescriptor method, - pb::IRpcController controller, - pb::IMessage request, - global::System.Action done) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.CallMethod() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - this.SubscribeToFollowers(controller, (global::bnet.protocol.followers.SubscribeToFollowersRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 1: - this.StartFollowing(controller, (global::bnet.protocol.followers.StartFollowingRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 2: - this.StopFollowing(controller, (global::bnet.protocol.followers.StopFollowingRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 3: - this.UpdateFollowerState(controller, (global::bnet.protocol.followers.UpdateFollowerStateRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetRequestPrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::bnet.protocol.followers.SubscribeToFollowersRequest.DefaultInstance; - case 1: - return global::bnet.protocol.followers.StartFollowingRequest.DefaultInstance; - case 2: - return global::bnet.protocol.followers.StopFollowingRequest.DefaultInstance; - case 3: - return global::bnet.protocol.followers.UpdateFollowerStateRequest.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetResponsePrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::bnet.protocol.followers.SubscribeToFollowersResponse.DefaultInstance; - case 1: - return global::bnet.protocol.followers.StartFollowingResponse.DefaultInstance; - case 2: - return global::bnet.protocol.followers.StopFollowingResponse.DefaultInstance; - case 3: - return global::bnet.protocol.followers.UpdateFollowerStateResponse.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public static Stub CreateStub(pb::IRpcChannel channel) { - return new Stub(channel); - } - - public class Stub : global::bnet.protocol.followers.FollowersService { - internal Stub(pb::IRpcChannel channel) { - this.channel = channel; - } - - private readonly pb::IRpcChannel channel; - - public pb::IRpcChannel Channel { - get { return channel; } - } - - public override void SubscribeToFollowers( - pb::IRpcController controller, - global::bnet.protocol.followers.SubscribeToFollowersRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[0], - controller, request, global::bnet.protocol.followers.SubscribeToFollowersResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.followers.SubscribeToFollowersResponse.DefaultInstance)); - } - - public override void StartFollowing( - pb::IRpcController controller, - global::bnet.protocol.followers.StartFollowingRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[1], - controller, request, global::bnet.protocol.followers.StartFollowingResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.followers.StartFollowingResponse.DefaultInstance)); - } - - public override void StopFollowing( - pb::IRpcController controller, - global::bnet.protocol.followers.StopFollowingRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[2], - controller, request, global::bnet.protocol.followers.StopFollowingResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.followers.StopFollowingResponse.DefaultInstance)); - } - - public override void UpdateFollowerState( - pb::IRpcController controller, - global::bnet.protocol.followers.UpdateFollowerStateRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[3], - controller, request, global::bnet.protocol.followers.UpdateFollowerStateResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.followers.UpdateFollowerStateResponse.DefaultInstance)); - } - } - } - public abstract class FollowersNotify : pb::IService { - public abstract void NotifyFollowerRemoved( - pb::IRpcController controller, - global::bnet.protocol.followers.FollowerNotification request, - global::System.Action done); - - public static pbd::ServiceDescriptor Descriptor { - get { return Followers.Descriptor.Services[1]; } - } - public pbd::ServiceDescriptor DescriptorForType { - get { return Descriptor; } - } - - public void CallMethod( - pbd::MethodDescriptor method, - pb::IRpcController controller, - pb::IMessage request, - global::System.Action done) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.CallMethod() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - this.NotifyFollowerRemoved(controller, (global::bnet.protocol.followers.FollowerNotification) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetRequestPrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::bnet.protocol.followers.FollowerNotification.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetResponsePrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::bnet.protocol.NO_RESPONSE.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public static Stub CreateStub(pb::IRpcChannel channel) { - return new Stub(channel); - } - - public class Stub : global::bnet.protocol.followers.FollowersNotify { - internal Stub(pb::IRpcChannel channel) { - this.channel = channel; - } - - private readonly pb::IRpcChannel channel; - - public pb::IRpcChannel Channel { - get { return channel; } - } - - public override void NotifyFollowerRemoved( - pb::IRpcController controller, - global::bnet.protocol.followers.FollowerNotification request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[0], - controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); - } - } - } - #endregion - -} diff --git a/source/D3Proto/bnet/protocol/friends/FriendsTypes.cs b/source/D3Proto/bnet/protocol/friends/FriendsTypes.cs deleted file mode 100644 index 51bb81a1..00000000 --- a/source/D3Proto/bnet/protocol/friends/FriendsTypes.cs +++ /dev/null @@ -1,592 +0,0 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace bnet.protocol.friends { - - public static partial class FriendsTypes { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - registry.Add(global::bnet.protocol.friends.FriendInvitation.FriendInvitation_); - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_bnet_protocol_friends_Friend__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_friends_Friend__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_friends_FriendInvitation__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_friends_FriendInvitation__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static FriendsTypes() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "CiNzZXJ2aWNlL2ZyaWVuZHMvZnJpZW5kc190eXBlcy5wcm90bxIVYm5ldC5w" + - "cm90b2NvbC5mcmllbmRzGhxsaWIvcHJvdG9jb2wvYXR0cmlidXRlLnByb3Rv" + - "GhlsaWIvcHJvdG9jb2wvZW50aXR5LnByb3RvGh1saWIvcHJvdG9jb2wvaW52" + - "aXRhdGlvbi5wcm90byJkCgZGcmllbmQSIwoCaWQYASACKAsyFy5ibmV0LnBy" + - "b3RvY29sLkVudGl0eUlkEjUKCWF0dHJpYnV0ZRgCIAMoCzIiLmJuZXQucHJv" + - "dG9jb2wuYXR0cmlidXRlLkF0dHJpYnV0ZSKbAQoQRnJpZW5kSW52aXRhdGlv" + - "bhIdCg5maXJzdF9yZWNlaXZlZBgBIAEoCDoFZmFsc2UyaAoRZnJpZW5kX2lu" + - "dml0YXRpb24SJC5ibmV0LnByb3RvY29sLmludml0YXRpb24uSW52aXRhdGlv" + - "bhhnIAEoCzInLmJuZXQucHJvdG9jb2wuZnJpZW5kcy5GcmllbmRJbnZpdGF0" + - "aW9u"); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_bnet_protocol_friends_Friend__Descriptor = Descriptor.MessageTypes[0]; - internal__static_bnet_protocol_friends_Friend__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_friends_Friend__Descriptor, - new string[] { "Id", "Attribute", }); - internal__static_bnet_protocol_friends_FriendInvitation__Descriptor = Descriptor.MessageTypes[1]; - internal__static_bnet_protocol_friends_FriendInvitation__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_friends_FriendInvitation__Descriptor, - new string[] { "FirstReceived", }); - global::bnet.protocol.friends.FriendInvitation.FriendInvitation_ = pb::GeneratedSingleExtension.CreateInstance(global::bnet.protocol.friends.FriendInvitation.Descriptor.Extensions[0]); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::bnet.protocol.attribute.Proto.Attribute.Descriptor, - global::bnet.protocol.Entity.Descriptor, - global::bnet.protocol.invitation.Proto.Invitation.Descriptor, - }, assigner); - } - #endregion - - } - #region Messages - public sealed partial class Friend : pb::GeneratedMessage { - private static readonly Friend defaultInstance = new Builder().BuildPartial(); - public static Friend DefaultInstance { - get { return defaultInstance; } - } - - public override Friend DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override Friend ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.friends.FriendsTypes.internal__static_bnet_protocol_friends_Friend__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.friends.FriendsTypes.internal__static_bnet_protocol_friends_Friend__FieldAccessorTable; } - } - - public const int IdFieldNumber = 1; - private bool hasId; - private global::bnet.protocol.EntityId id_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasId { - get { return hasId; } - } - public global::bnet.protocol.EntityId Id { - get { return id_; } - } - - public const int AttributeFieldNumber = 2; - private pbc::PopsicleList attribute_ = new pbc::PopsicleList(); - public scg::IList AttributeList { - get { return attribute_; } - } - public int AttributeCount { - get { return attribute_.Count; } - } - public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { - return attribute_[index]; - } - - public override bool IsInitialized { - get { - if (!hasId) return false; - if (!Id.IsInitialized) return false; - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasId) { - output.WriteMessage(1, Id); - } - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - output.WriteMessage(2, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Id); - } - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static Friend ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Friend ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Friend ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Friend ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Friend ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Friend ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Friend ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Friend ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Friend ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Friend ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Friend prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - Friend result = new Friend(); - - protected override Friend MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new Friend(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.friends.Friend.Descriptor; } - } - - public override Friend DefaultInstanceForType { - get { return global::bnet.protocol.friends.Friend.DefaultInstance; } - } - - public override Friend BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.attribute_.MakeReadOnly(); - Friend returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Friend) { - return MergeFrom((Friend) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Friend other) { - if (other == global::bnet.protocol.friends.Friend.DefaultInstance) return this; - if (other.HasId) { - MergeId(other.Id); - } - if (other.attribute_.Count != 0) { - base.AddRange(other.attribute_, result.attribute_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasId) { - subBuilder.MergeFrom(Id); - } - input.ReadMessage(subBuilder, extensionRegistry); - Id = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.attribute.Attribute.Builder subBuilder = global::bnet.protocol.attribute.Attribute.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddAttribute(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public bool HasId { - get { return result.HasId; } - } - public global::bnet.protocol.EntityId Id { - get { return result.Id; } - set { SetId(value); } - } - public Builder SetId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasId = true; - result.id_ = value; - return this; - } - public Builder SetId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasId = true; - result.id_ = builderForValue.Build(); - return this; - } - public Builder MergeId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasId && - result.id_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.id_ = global::bnet.protocol.EntityId.CreateBuilder(result.id_).MergeFrom(value).BuildPartial(); - } else { - result.id_ = value; - } - result.hasId = true; - return this; - } - public Builder ClearId() { - result.hasId = false; - result.id_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public pbc::IPopsicleList AttributeList { - get { return result.attribute_; } - } - public int AttributeCount { - get { return result.AttributeCount; } - } - public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { - return result.GetAttribute(index); - } - public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.attribute_[index] = value; - return this; - } - public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.attribute_[index] = builderForValue.Build(); - return this; - } - public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.attribute_.Add(value); - return this; - } - public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.attribute_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeAttribute(scg::IEnumerable values) { - base.AddRange(values, result.attribute_); - return this; - } - public Builder ClearAttribute() { - result.attribute_.Clear(); - return this; - } - } - static Friend() { - object.ReferenceEquals(global::bnet.protocol.friends.FriendsTypes.Descriptor, null); - } - } - - public sealed partial class FriendInvitation : pb::GeneratedMessage { - private static readonly FriendInvitation defaultInstance = new Builder().BuildPartial(); - public static FriendInvitation DefaultInstance { - get { return defaultInstance; } - } - - public override FriendInvitation DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override FriendInvitation ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.friends.FriendsTypes.internal__static_bnet_protocol_friends_FriendInvitation__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.friends.FriendsTypes.internal__static_bnet_protocol_friends_FriendInvitation__FieldAccessorTable; } - } - - public const int FriendInvitationFieldNumber = 103; - public static pb::GeneratedExtensionBase FriendInvitation_; - public const int FirstReceivedFieldNumber = 1; - private bool hasFirstReceived; - private bool firstReceived_ = false; - public bool HasFirstReceived { - get { return hasFirstReceived; } - } - public bool FirstReceived { - get { return firstReceived_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasFirstReceived) { - output.WriteBool(1, FirstReceived); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasFirstReceived) { - size += pb::CodedOutputStream.ComputeBoolSize(1, FirstReceived); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static FriendInvitation ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FriendInvitation ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FriendInvitation ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FriendInvitation ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FriendInvitation ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FriendInvitation ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static FriendInvitation ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static FriendInvitation ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static FriendInvitation ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FriendInvitation ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(FriendInvitation prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - FriendInvitation result = new FriendInvitation(); - - protected override FriendInvitation MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new FriendInvitation(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.friends.FriendInvitation.Descriptor; } - } - - public override FriendInvitation DefaultInstanceForType { - get { return global::bnet.protocol.friends.FriendInvitation.DefaultInstance; } - } - - public override FriendInvitation BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - FriendInvitation returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is FriendInvitation) { - return MergeFrom((FriendInvitation) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(FriendInvitation other) { - if (other == global::bnet.protocol.friends.FriendInvitation.DefaultInstance) return this; - if (other.HasFirstReceived) { - FirstReceived = other.FirstReceived; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - FirstReceived = input.ReadBool(); - break; - } - } - } - } - - - public bool HasFirstReceived { - get { return result.HasFirstReceived; } - } - public bool FirstReceived { - get { return result.FirstReceived; } - set { SetFirstReceived(value); } - } - public Builder SetFirstReceived(bool value) { - result.hasFirstReceived = true; - result.firstReceived_ = value; - return this; - } - public Builder ClearFirstReceived() { - result.hasFirstReceived = false; - result.firstReceived_ = false; - return this; - } - } - static FriendInvitation() { - object.ReferenceEquals(global::bnet.protocol.friends.FriendsTypes.Descriptor, null); - } - } - - #endregion - -} diff --git a/source/D3Proto/bnet/protocol/game_utilities/GameUtilities.cs b/source/D3Proto/bnet/protocol/game_utilities/GameUtilities.cs deleted file mode 100644 index 4e373a7e..00000000 --- a/source/D3Proto/bnet/protocol/game_utilities/GameUtilities.cs +++ /dev/null @@ -1,5218 +0,0 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace bnet.protocol.game_utilities { - - namespace Proto { - - public static partial class GameUtilities { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_utilities_ClientRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_utilities_ClientRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_utilities_ClientResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_utilities_ClientResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_utilities_CreateToonRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_utilities_CreateToonRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_utilities_CreateToonResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_utilities_CreateToonResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_utilities_DeleteToonRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_utilities_DeleteToonRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_utilities_TransferToonRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_utilities_TransferToonRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_utilities_TransferToonRequest_Account__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_utilities_TransferToonRequest_Account__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_utilities_SelectToonRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_utilities_SelectToonRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_utilities_PresenceChannelCreatedRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_utilities_PresenceChannelCreatedRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_utilities_PlayerVariablesRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_utilities_PlayerVariablesRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_utilities_GameVariablesRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_utilities_GameVariablesRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_utilities_VariablesResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_utilities_VariablesResponse__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static GameUtilities() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "CitzZXJ2aWNlL2dhbWVfdXRpbGl0aWVzL2dhbWVfdXRpbGl0aWVzLnByb3Rv" + - "EhxibmV0LnByb3RvY29sLmdhbWVfdXRpbGl0aWVzGiVzZXJ2aWNlL2dhbWVf" + - "bWFzdGVyL2dhbWVfbWFzdGVyLnByb3RvGiVzZXJ2aWNlL3NlcnZlcl9wb29s" + - "L3NlcnZlcl9wb29sLnByb3RvGhxsaWIvcHJvdG9jb2wvYXR0cmlidXRlLnBy" + - "b3RvGhlsaWIvcHJvdG9jb2wvZW50aXR5LnByb3RvGhFsaWIvcnBjL3JwYy5w" + - "cm90byL8AQoNQ2xpZW50UmVxdWVzdBI1CglhdHRyaWJ1dGUYASADKAsyIi5i" + - "bmV0LnByb3RvY29sLmF0dHJpYnV0ZS5BdHRyaWJ1dGUSJgoEaG9zdBgCIAEo" + - "CzIYLmJuZXQucHJvdG9jb2wuUHJvY2Vzc0lkEjAKD2JuZXRfYWNjb3VudF9p" + - "ZBgDIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSMAoPZ2FtZV9hY2Nv" + - "dW50X2lkGAQgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBIoCgd0b29u" + - "X2lkGAUgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZCJHCg5DbGllbnRS" + - "ZXNwb25zZRI1CglhdHRyaWJ1dGUYASADKAsyIi5ibmV0LnByb3RvY29sLmF0" + - "dHJpYnV0ZS5BdHRyaWJ1dGUijgIKEUNyZWF0ZVRvb25SZXF1ZXN0EjAKD2Ju" + - "ZXRfYWNjb3VudF9pZBgBIAIoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQS" + - "MAoPZ2FtZV9hY2NvdW50X2lkGAIgAigLMhcuYm5ldC5wcm90b2NvbC5FbnRp" + - "dHlJZBIoCgd0b29uX2lkGAMgAigLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJ" + - "ZBIMCgRuYW1lGAQgAigJEjUKCWF0dHJpYnV0ZRgFIAMoCzIiLmJuZXQucHJv" + - "dG9jb2wuYXR0cmlidXRlLkF0dHJpYnV0ZRImCgRob3N0GAYgASgLMhguYm5l" + - "dC5wcm90b2NvbC5Qcm9jZXNzSWQiIgoSQ3JlYXRlVG9vblJlc3BvbnNlEgwK" + - "BG5hbWUYASABKAkiyQEKEURlbGV0ZVRvb25SZXF1ZXN0EjAKD2JuZXRfYWNj" + - "b3VudF9pZBgBIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSMAoPZ2Ft" + - "ZV9hY2NvdW50X2lkGAIgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBIo" + - "Cgd0b29uX2lkGAMgAigLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBImCgRo" + - "b3N0GAQgASgLMhguYm5ldC5wcm90b2NvbC5Qcm9jZXNzSWQi7AIKE1RyYW5z" + - "ZmVyVG9vblJlcXVlc3QSKAoHdG9vbl9pZBgBIAIoCzIXLmJuZXQucHJvdG9j" + - "b2wuRW50aXR5SWQSSQoGc291cmNlGAIgASgLMjkuYm5ldC5wcm90b2NvbC5n" + - "YW1lX3V0aWxpdGllcy5UcmFuc2ZlclRvb25SZXF1ZXN0LkFjY291bnQSSQoG" + - "dGFyZ2V0GAMgASgLMjkuYm5ldC5wcm90b2NvbC5nYW1lX3V0aWxpdGllcy5U" + - "cmFuc2ZlclRvb25SZXF1ZXN0LkFjY291bnQSJgoEaG9zdBgEIAEoCzIYLmJu" + - "ZXQucHJvdG9jb2wuUHJvY2Vzc0lkGm0KB0FjY291bnQSMAoPYm5ldF9hY2Nv" + - "dW50X2lkGAEgAigLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBIwCg9nYW1l" + - "X2FjY291bnRfaWQYAiACKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkIskB" + - "ChFTZWxlY3RUb29uUmVxdWVzdBIwCg9ibmV0X2FjY291bnRfaWQYASACKAsy" + - "Fy5ibmV0LnByb3RvY29sLkVudGl0eUlkEjAKD2dhbWVfYWNjb3VudF9pZBgC" + - "IAIoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSKAoHdG9vbl9pZBgDIAIo" + - "CzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSJgoEaG9zdBgEIAEoCzIYLmJu" + - "ZXQucHJvdG9jb2wuUHJvY2Vzc0lkIvoBCh1QcmVzZW5jZUNoYW5uZWxDcmVh" + - "dGVkUmVxdWVzdBIjCgJpZBgBIAIoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5" + - "SWQSKAoHdG9vbl9pZBgCIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQS" + - "MAoPZ2FtZV9hY2NvdW50X2lkGAMgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRp" + - "dHlJZBIwCg9ibmV0X2FjY291bnRfaWQYBCABKAsyFy5ibmV0LnByb3RvY29s" + - "LkVudGl0eUlkEiYKBGhvc3QYBSABKAsyGC5ibmV0LnByb3RvY29sLlByb2Nl" + - "c3NJZCLgAQoWUGxheWVyVmFyaWFibGVzUmVxdWVzdBIwCg9ibmV0X2FjY291" + - "bnRfaWQYASACKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEjAKD2dhbWVf" + - "YWNjb3VudF9pZBgCIAIoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSKAoH" + - "dG9vbl9pZBgDIAIoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSEAoIdmFy" + - "aWFibGUYBCADKAkSJgoEaG9zdBgFIAEoCzIYLmJuZXQucHJvdG9jb2wuUHJv" + - "Y2Vzc0lkIocBChRHYW1lVmFyaWFibGVzUmVxdWVzdBI1CglhdHRyaWJ1dGUY" + - "ASADKAsyIi5ibmV0LnByb3RvY29sLmF0dHJpYnV0ZS5BdHRyaWJ1dGUSEAoI" + - "dmFyaWFibGUYAiADKAkSJgoEaG9zdBgDIAEoCzIYLmJuZXQucHJvdG9jb2wu" + - "UHJvY2Vzc0lkIiIKEVZhcmlhYmxlc1Jlc3BvbnNlEg0KBXZhbHVlGAEgAygC" + - "MrsHCg1HYW1lVXRpbGl0aWVzEnEKFFByb2Nlc3NDbGllbnRSZXF1ZXN0Eisu" + - "Ym5ldC5wcm90b2NvbC5nYW1lX3V0aWxpdGllcy5DbGllbnRSZXF1ZXN0Giwu" + - "Ym5ldC5wcm90b2NvbC5nYW1lX3V0aWxpdGllcy5DbGllbnRSZXNwb25zZRJv" + - "CgpDcmVhdGVUb29uEi8uYm5ldC5wcm90b2NvbC5nYW1lX3V0aWxpdGllcy5D" + - "cmVhdGVUb29uUmVxdWVzdBowLmJuZXQucHJvdG9jb2wuZ2FtZV91dGlsaXRp" + - "ZXMuQ3JlYXRlVG9vblJlc3BvbnNlElQKCkRlbGV0ZVRvb24SLy5ibmV0LnBy" + - "b3RvY29sLmdhbWVfdXRpbGl0aWVzLkRlbGV0ZVRvb25SZXF1ZXN0GhUuYm5l" + - "dC5wcm90b2NvbC5Ob0RhdGESWAoMVHJhbnNmZXJUb29uEjEuYm5ldC5wcm90" + - "b2NvbC5nYW1lX3V0aWxpdGllcy5UcmFuc2ZlclRvb25SZXF1ZXN0GhUuYm5l" + - "dC5wcm90b2NvbC5Ob0RhdGESVAoKU2VsZWN0VG9vbhIvLmJuZXQucHJvdG9j" + - "b2wuZ2FtZV91dGlsaXRpZXMuU2VsZWN0VG9vblJlcXVlc3QaFS5ibmV0LnBy" + - "b3RvY29sLk5vRGF0YRJsChZQcmVzZW5jZUNoYW5uZWxDcmVhdGVkEjsuYm5l" + - "dC5wcm90b2NvbC5nYW1lX3V0aWxpdGllcy5QcmVzZW5jZUNoYW5uZWxDcmVh" + - "dGVkUmVxdWVzdBoVLmJuZXQucHJvdG9jb2wuTm9EYXRhEnsKEkdldFBsYXll" + - "clZhcmlhYmxlcxI0LmJuZXQucHJvdG9jb2wuZ2FtZV91dGlsaXRpZXMuUGxh" + - "eWVyVmFyaWFibGVzUmVxdWVzdBovLmJuZXQucHJvdG9jb2wuZ2FtZV91dGls" + - "aXRpZXMuVmFyaWFibGVzUmVzcG9uc2USdwoQR2V0R2FtZVZhcmlhYmxlcxIy" + - "LmJuZXQucHJvdG9jb2wuZ2FtZV91dGlsaXRpZXMuR2FtZVZhcmlhYmxlc1Jl" + - "cXVlc3QaLy5ibmV0LnByb3RvY29sLmdhbWVfdXRpbGl0aWVzLlZhcmlhYmxl" + - "c1Jlc3BvbnNlElwKB0dldExvYWQSKS5ibmV0LnByb3RvY29sLnNlcnZlcl9w" + - "b29sLkdldExvYWRSZXF1ZXN0GiYuYm5ldC5wcm90b2NvbC5zZXJ2ZXJfcG9v" + - "bC5TZXJ2ZXJTdGF0ZUIRQgxDR2FtZVV0aWxpZXOAAQE="); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_bnet_protocol_game_utilities_ClientRequest__Descriptor = Descriptor.MessageTypes[0]; - internal__static_bnet_protocol_game_utilities_ClientRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_utilities_ClientRequest__Descriptor, - new string[] { "Attribute", "Host", "BnetAccountId", "GameAccountId", "ToonId", }); - internal__static_bnet_protocol_game_utilities_ClientResponse__Descriptor = Descriptor.MessageTypes[1]; - internal__static_bnet_protocol_game_utilities_ClientResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_utilities_ClientResponse__Descriptor, - new string[] { "Attribute", }); - internal__static_bnet_protocol_game_utilities_CreateToonRequest__Descriptor = Descriptor.MessageTypes[2]; - internal__static_bnet_protocol_game_utilities_CreateToonRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_utilities_CreateToonRequest__Descriptor, - new string[] { "BnetAccountId", "GameAccountId", "ToonId", "Name", "Attribute", "Host", }); - internal__static_bnet_protocol_game_utilities_CreateToonResponse__Descriptor = Descriptor.MessageTypes[3]; - internal__static_bnet_protocol_game_utilities_CreateToonResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_utilities_CreateToonResponse__Descriptor, - new string[] { "Name", }); - internal__static_bnet_protocol_game_utilities_DeleteToonRequest__Descriptor = Descriptor.MessageTypes[4]; - internal__static_bnet_protocol_game_utilities_DeleteToonRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_utilities_DeleteToonRequest__Descriptor, - new string[] { "BnetAccountId", "GameAccountId", "ToonId", "Host", }); - internal__static_bnet_protocol_game_utilities_TransferToonRequest__Descriptor = Descriptor.MessageTypes[5]; - internal__static_bnet_protocol_game_utilities_TransferToonRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_utilities_TransferToonRequest__Descriptor, - new string[] { "ToonId", "Source", "Target", "Host", }); - internal__static_bnet_protocol_game_utilities_TransferToonRequest_Account__Descriptor = internal__static_bnet_protocol_game_utilities_TransferToonRequest__Descriptor.NestedTypes[0]; - internal__static_bnet_protocol_game_utilities_TransferToonRequest_Account__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_utilities_TransferToonRequest_Account__Descriptor, - new string[] { "BnetAccountId", "GameAccountId", }); - internal__static_bnet_protocol_game_utilities_SelectToonRequest__Descriptor = Descriptor.MessageTypes[6]; - internal__static_bnet_protocol_game_utilities_SelectToonRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_utilities_SelectToonRequest__Descriptor, - new string[] { "BnetAccountId", "GameAccountId", "ToonId", "Host", }); - internal__static_bnet_protocol_game_utilities_PresenceChannelCreatedRequest__Descriptor = Descriptor.MessageTypes[7]; - internal__static_bnet_protocol_game_utilities_PresenceChannelCreatedRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_utilities_PresenceChannelCreatedRequest__Descriptor, - new string[] { "Id", "ToonId", "GameAccountId", "BnetAccountId", "Host", }); - internal__static_bnet_protocol_game_utilities_PlayerVariablesRequest__Descriptor = Descriptor.MessageTypes[8]; - internal__static_bnet_protocol_game_utilities_PlayerVariablesRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_utilities_PlayerVariablesRequest__Descriptor, - new string[] { "BnetAccountId", "GameAccountId", "ToonId", "Variable", "Host", }); - internal__static_bnet_protocol_game_utilities_GameVariablesRequest__Descriptor = Descriptor.MessageTypes[9]; - internal__static_bnet_protocol_game_utilities_GameVariablesRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_utilities_GameVariablesRequest__Descriptor, - new string[] { "Attribute", "Variable", "Host", }); - internal__static_bnet_protocol_game_utilities_VariablesResponse__Descriptor = Descriptor.MessageTypes[10]; - internal__static_bnet_protocol_game_utilities_VariablesResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_utilities_VariablesResponse__Descriptor, - new string[] { "Value", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::bnet.protocol.game_master.Proto.GameMaster.Descriptor, - global::bnet.protocol.server_pool.ServerPool.Descriptor, - global::bnet.protocol.attribute.Proto.Attribute.Descriptor, - global::bnet.protocol.Entity.Descriptor, - global::bnet.protocol.Rpc.Descriptor, - }, assigner); - } - #endregion - - } - } - #region Messages - public sealed partial class ClientRequest : pb::GeneratedMessage { - private static readonly ClientRequest defaultInstance = new Builder().BuildPartial(); - public static ClientRequest DefaultInstance { - get { return defaultInstance; } - } - - public override ClientRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ClientRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_utilities.Proto.GameUtilities.internal__static_bnet_protocol_game_utilities_ClientRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_utilities.Proto.GameUtilities.internal__static_bnet_protocol_game_utilities_ClientRequest__FieldAccessorTable; } - } - - public const int AttributeFieldNumber = 1; - private pbc::PopsicleList attribute_ = new pbc::PopsicleList(); - public scg::IList AttributeList { - get { return attribute_; } - } - public int AttributeCount { - get { return attribute_.Count; } - } - public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { - return attribute_[index]; - } - - public const int HostFieldNumber = 2; - private bool hasHost; - private global::bnet.protocol.ProcessId host_ = global::bnet.protocol.ProcessId.DefaultInstance; - public bool HasHost { - get { return hasHost; } - } - public global::bnet.protocol.ProcessId Host { - get { return host_; } - } - - public const int BnetAccountIdFieldNumber = 3; - private bool hasBnetAccountId; - private global::bnet.protocol.EntityId bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasBnetAccountId { - get { return hasBnetAccountId; } - } - public global::bnet.protocol.EntityId BnetAccountId { - get { return bnetAccountId_; } - } - - public const int GameAccountIdFieldNumber = 4; - private bool hasGameAccountId; - private global::bnet.protocol.EntityId gameAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasGameAccountId { - get { return hasGameAccountId; } - } - public global::bnet.protocol.EntityId GameAccountId { - get { return gameAccountId_; } - } - - public const int ToonIdFieldNumber = 5; - private bool hasToonId; - private global::bnet.protocol.EntityId toonId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasToonId { - get { return hasToonId; } - } - public global::bnet.protocol.EntityId ToonId { - get { return toonId_; } - } - - public override bool IsInitialized { - get { - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - if (!element.IsInitialized) return false; - } - if (HasHost) { - if (!Host.IsInitialized) return false; - } - if (HasBnetAccountId) { - if (!BnetAccountId.IsInitialized) return false; - } - if (HasGameAccountId) { - if (!GameAccountId.IsInitialized) return false; - } - if (HasToonId) { - if (!ToonId.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - output.WriteMessage(1, element); - } - if (HasHost) { - output.WriteMessage(2, Host); - } - if (HasBnetAccountId) { - output.WriteMessage(3, BnetAccountId); - } - if (HasGameAccountId) { - output.WriteMessage(4, GameAccountId); - } - if (HasToonId) { - output.WriteMessage(5, ToonId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - if (HasHost) { - size += pb::CodedOutputStream.ComputeMessageSize(2, Host); - } - if (HasBnetAccountId) { - size += pb::CodedOutputStream.ComputeMessageSize(3, BnetAccountId); - } - if (HasGameAccountId) { - size += pb::CodedOutputStream.ComputeMessageSize(4, GameAccountId); - } - if (HasToonId) { - size += pb::CodedOutputStream.ComputeMessageSize(5, ToonId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ClientRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ClientRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ClientRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ClientRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ClientRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ClientRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ClientRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ClientRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ClientRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ClientRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ClientRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ClientRequest result = new ClientRequest(); - - protected override ClientRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ClientRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.game_utilities.ClientRequest.Descriptor; } - } - - public override ClientRequest DefaultInstanceForType { - get { return global::bnet.protocol.game_utilities.ClientRequest.DefaultInstance; } - } - - public override ClientRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.attribute_.MakeReadOnly(); - ClientRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ClientRequest) { - return MergeFrom((ClientRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ClientRequest other) { - if (other == global::bnet.protocol.game_utilities.ClientRequest.DefaultInstance) return this; - if (other.attribute_.Count != 0) { - base.AddRange(other.attribute_, result.attribute_); - } - if (other.HasHost) { - MergeHost(other.Host); - } - if (other.HasBnetAccountId) { - MergeBnetAccountId(other.BnetAccountId); - } - if (other.HasGameAccountId) { - MergeGameAccountId(other.GameAccountId); - } - if (other.HasToonId) { - MergeToonId(other.ToonId); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.attribute.Attribute.Builder subBuilder = global::bnet.protocol.attribute.Attribute.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddAttribute(subBuilder.BuildPartial()); - break; - } - case 18: { - global::bnet.protocol.ProcessId.Builder subBuilder = global::bnet.protocol.ProcessId.CreateBuilder(); - if (HasHost) { - subBuilder.MergeFrom(Host); - } - input.ReadMessage(subBuilder, extensionRegistry); - Host = subBuilder.BuildPartial(); - break; - } - case 26: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasBnetAccountId) { - subBuilder.MergeFrom(BnetAccountId); - } - input.ReadMessage(subBuilder, extensionRegistry); - BnetAccountId = subBuilder.BuildPartial(); - break; - } - case 34: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasGameAccountId) { - subBuilder.MergeFrom(GameAccountId); - } - input.ReadMessage(subBuilder, extensionRegistry); - GameAccountId = subBuilder.BuildPartial(); - break; - } - case 42: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasToonId) { - subBuilder.MergeFrom(ToonId); - } - input.ReadMessage(subBuilder, extensionRegistry); - ToonId = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public pbc::IPopsicleList AttributeList { - get { return result.attribute_; } - } - public int AttributeCount { - get { return result.AttributeCount; } - } - public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { - return result.GetAttribute(index); - } - public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.attribute_[index] = value; - return this; - } - public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.attribute_[index] = builderForValue.Build(); - return this; - } - public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.attribute_.Add(value); - return this; - } - public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.attribute_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeAttribute(scg::IEnumerable values) { - base.AddRange(values, result.attribute_); - return this; - } - public Builder ClearAttribute() { - result.attribute_.Clear(); - return this; - } - - public bool HasHost { - get { return result.HasHost; } - } - public global::bnet.protocol.ProcessId Host { - get { return result.Host; } - set { SetHost(value); } - } - public Builder SetHost(global::bnet.protocol.ProcessId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasHost = true; - result.host_ = value; - return this; - } - public Builder SetHost(global::bnet.protocol.ProcessId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasHost = true; - result.host_ = builderForValue.Build(); - return this; - } - public Builder MergeHost(global::bnet.protocol.ProcessId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasHost && - result.host_ != global::bnet.protocol.ProcessId.DefaultInstance) { - result.host_ = global::bnet.protocol.ProcessId.CreateBuilder(result.host_).MergeFrom(value).BuildPartial(); - } else { - result.host_ = value; - } - result.hasHost = true; - return this; - } - public Builder ClearHost() { - result.hasHost = false; - result.host_ = global::bnet.protocol.ProcessId.DefaultInstance; - return this; - } - - public bool HasBnetAccountId { - get { return result.HasBnetAccountId; } - } - public global::bnet.protocol.EntityId BnetAccountId { - get { return result.BnetAccountId; } - set { SetBnetAccountId(value); } - } - public Builder SetBnetAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBnetAccountId = true; - result.bnetAccountId_ = value; - return this; - } - public Builder SetBnetAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBnetAccountId = true; - result.bnetAccountId_ = builderForValue.Build(); - return this; - } - public Builder MergeBnetAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasBnetAccountId && - result.bnetAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.bnetAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccountId_).MergeFrom(value).BuildPartial(); - } else { - result.bnetAccountId_ = value; - } - result.hasBnetAccountId = true; - return this; - } - public Builder ClearBnetAccountId() { - result.hasBnetAccountId = false; - result.bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasGameAccountId { - get { return result.HasGameAccountId; } - } - public global::bnet.protocol.EntityId GameAccountId { - get { return result.GameAccountId; } - set { SetGameAccountId(value); } - } - public Builder SetGameAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasGameAccountId = true; - result.gameAccountId_ = value; - return this; - } - public Builder SetGameAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasGameAccountId = true; - result.gameAccountId_ = builderForValue.Build(); - return this; - } - public Builder MergeGameAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasGameAccountId && - result.gameAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.gameAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccountId_).MergeFrom(value).BuildPartial(); - } else { - result.gameAccountId_ = value; - } - result.hasGameAccountId = true; - return this; - } - public Builder ClearGameAccountId() { - result.hasGameAccountId = false; - result.gameAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasToonId { - get { return result.HasToonId; } - } - public global::bnet.protocol.EntityId ToonId { - get { return result.ToonId; } - set { SetToonId(value); } - } - public Builder SetToonId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasToonId = true; - result.toonId_ = value; - return this; - } - public Builder SetToonId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasToonId = true; - result.toonId_ = builderForValue.Build(); - return this; - } - public Builder MergeToonId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasToonId && - result.toonId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.toonId_ = global::bnet.protocol.EntityId.CreateBuilder(result.toonId_).MergeFrom(value).BuildPartial(); - } else { - result.toonId_ = value; - } - result.hasToonId = true; - return this; - } - public Builder ClearToonId() { - result.hasToonId = false; - result.toonId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - } - static ClientRequest() { - object.ReferenceEquals(global::bnet.protocol.game_utilities.Proto.GameUtilities.Descriptor, null); - } - } - - public sealed partial class ClientResponse : pb::GeneratedMessage { - private static readonly ClientResponse defaultInstance = new Builder().BuildPartial(); - public static ClientResponse DefaultInstance { - get { return defaultInstance; } - } - - public override ClientResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ClientResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_utilities.Proto.GameUtilities.internal__static_bnet_protocol_game_utilities_ClientResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_utilities.Proto.GameUtilities.internal__static_bnet_protocol_game_utilities_ClientResponse__FieldAccessorTable; } - } - - public const int AttributeFieldNumber = 1; - private pbc::PopsicleList attribute_ = new pbc::PopsicleList(); - public scg::IList AttributeList { - get { return attribute_; } - } - public int AttributeCount { - get { return attribute_.Count; } - } - public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { - return attribute_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - output.WriteMessage(1, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ClientResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ClientResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ClientResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ClientResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ClientResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ClientResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ClientResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ClientResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ClientResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ClientResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ClientResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ClientResponse result = new ClientResponse(); - - protected override ClientResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ClientResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.game_utilities.ClientResponse.Descriptor; } - } - - public override ClientResponse DefaultInstanceForType { - get { return global::bnet.protocol.game_utilities.ClientResponse.DefaultInstance; } - } - - public override ClientResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.attribute_.MakeReadOnly(); - ClientResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ClientResponse) { - return MergeFrom((ClientResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ClientResponse other) { - if (other == global::bnet.protocol.game_utilities.ClientResponse.DefaultInstance) return this; - if (other.attribute_.Count != 0) { - base.AddRange(other.attribute_, result.attribute_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.attribute.Attribute.Builder subBuilder = global::bnet.protocol.attribute.Attribute.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddAttribute(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public pbc::IPopsicleList AttributeList { - get { return result.attribute_; } - } - public int AttributeCount { - get { return result.AttributeCount; } - } - public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { - return result.GetAttribute(index); - } - public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.attribute_[index] = value; - return this; - } - public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.attribute_[index] = builderForValue.Build(); - return this; - } - public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.attribute_.Add(value); - return this; - } - public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.attribute_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeAttribute(scg::IEnumerable values) { - base.AddRange(values, result.attribute_); - return this; - } - public Builder ClearAttribute() { - result.attribute_.Clear(); - return this; - } - } - static ClientResponse() { - object.ReferenceEquals(global::bnet.protocol.game_utilities.Proto.GameUtilities.Descriptor, null); - } - } - - public sealed partial class CreateToonRequest : pb::GeneratedMessage { - private static readonly CreateToonRequest defaultInstance = new Builder().BuildPartial(); - public static CreateToonRequest DefaultInstance { - get { return defaultInstance; } - } - - public override CreateToonRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override CreateToonRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_utilities.Proto.GameUtilities.internal__static_bnet_protocol_game_utilities_CreateToonRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_utilities.Proto.GameUtilities.internal__static_bnet_protocol_game_utilities_CreateToonRequest__FieldAccessorTable; } - } - - public const int BnetAccountIdFieldNumber = 1; - private bool hasBnetAccountId; - private global::bnet.protocol.EntityId bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasBnetAccountId { - get { return hasBnetAccountId; } - } - public global::bnet.protocol.EntityId BnetAccountId { - get { return bnetAccountId_; } - } - - public const int GameAccountIdFieldNumber = 2; - private bool hasGameAccountId; - private global::bnet.protocol.EntityId gameAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasGameAccountId { - get { return hasGameAccountId; } - } - public global::bnet.protocol.EntityId GameAccountId { - get { return gameAccountId_; } - } - - public const int ToonIdFieldNumber = 3; - private bool hasToonId; - private global::bnet.protocol.EntityId toonId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasToonId { - get { return hasToonId; } - } - public global::bnet.protocol.EntityId ToonId { - get { return toonId_; } - } - - public const int NameFieldNumber = 4; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int AttributeFieldNumber = 5; - private pbc::PopsicleList attribute_ = new pbc::PopsicleList(); - public scg::IList AttributeList { - get { return attribute_; } - } - public int AttributeCount { - get { return attribute_.Count; } - } - public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { - return attribute_[index]; - } - - public const int HostFieldNumber = 6; - private bool hasHost; - private global::bnet.protocol.ProcessId host_ = global::bnet.protocol.ProcessId.DefaultInstance; - public bool HasHost { - get { return hasHost; } - } - public global::bnet.protocol.ProcessId Host { - get { return host_; } - } - - public override bool IsInitialized { - get { - if (!hasBnetAccountId) return false; - if (!hasGameAccountId) return false; - if (!hasToonId) return false; - if (!hasName) return false; - if (!BnetAccountId.IsInitialized) return false; - if (!GameAccountId.IsInitialized) return false; - if (!ToonId.IsInitialized) return false; - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - if (!element.IsInitialized) return false; - } - if (HasHost) { - if (!Host.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasBnetAccountId) { - output.WriteMessage(1, BnetAccountId); - } - if (HasGameAccountId) { - output.WriteMessage(2, GameAccountId); - } - if (HasToonId) { - output.WriteMessage(3, ToonId); - } - if (HasName) { - output.WriteString(4, Name); - } - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - output.WriteMessage(5, element); - } - if (HasHost) { - output.WriteMessage(6, Host); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasBnetAccountId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, BnetAccountId); - } - if (HasGameAccountId) { - size += pb::CodedOutputStream.ComputeMessageSize(2, GameAccountId); - } - if (HasToonId) { - size += pb::CodedOutputStream.ComputeMessageSize(3, ToonId); - } - if (HasName) { - size += pb::CodedOutputStream.ComputeStringSize(4, Name); - } - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - size += pb::CodedOutputStream.ComputeMessageSize(5, element); - } - if (HasHost) { - size += pb::CodedOutputStream.ComputeMessageSize(6, Host); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static CreateToonRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CreateToonRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CreateToonRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CreateToonRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CreateToonRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CreateToonRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CreateToonRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CreateToonRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CreateToonRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CreateToonRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CreateToonRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - CreateToonRequest result = new CreateToonRequest(); - - protected override CreateToonRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new CreateToonRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.game_utilities.CreateToonRequest.Descriptor; } - } - - public override CreateToonRequest DefaultInstanceForType { - get { return global::bnet.protocol.game_utilities.CreateToonRequest.DefaultInstance; } - } - - public override CreateToonRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.attribute_.MakeReadOnly(); - CreateToonRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CreateToonRequest) { - return MergeFrom((CreateToonRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CreateToonRequest other) { - if (other == global::bnet.protocol.game_utilities.CreateToonRequest.DefaultInstance) return this; - if (other.HasBnetAccountId) { - MergeBnetAccountId(other.BnetAccountId); - } - if (other.HasGameAccountId) { - MergeGameAccountId(other.GameAccountId); - } - if (other.HasToonId) { - MergeToonId(other.ToonId); - } - if (other.HasName) { - Name = other.Name; - } - if (other.attribute_.Count != 0) { - base.AddRange(other.attribute_, result.attribute_); - } - if (other.HasHost) { - MergeHost(other.Host); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasBnetAccountId) { - subBuilder.MergeFrom(BnetAccountId); - } - input.ReadMessage(subBuilder, extensionRegistry); - BnetAccountId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasGameAccountId) { - subBuilder.MergeFrom(GameAccountId); - } - input.ReadMessage(subBuilder, extensionRegistry); - GameAccountId = subBuilder.BuildPartial(); - break; - } - case 26: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasToonId) { - subBuilder.MergeFrom(ToonId); - } - input.ReadMessage(subBuilder, extensionRegistry); - ToonId = subBuilder.BuildPartial(); - break; - } - case 34: { - Name = input.ReadString(); - break; - } - case 42: { - global::bnet.protocol.attribute.Attribute.Builder subBuilder = global::bnet.protocol.attribute.Attribute.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddAttribute(subBuilder.BuildPartial()); - break; - } - case 50: { - global::bnet.protocol.ProcessId.Builder subBuilder = global::bnet.protocol.ProcessId.CreateBuilder(); - if (HasHost) { - subBuilder.MergeFrom(Host); - } - input.ReadMessage(subBuilder, extensionRegistry); - Host = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasBnetAccountId { - get { return result.HasBnetAccountId; } - } - public global::bnet.protocol.EntityId BnetAccountId { - get { return result.BnetAccountId; } - set { SetBnetAccountId(value); } - } - public Builder SetBnetAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBnetAccountId = true; - result.bnetAccountId_ = value; - return this; - } - public Builder SetBnetAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBnetAccountId = true; - result.bnetAccountId_ = builderForValue.Build(); - return this; - } - public Builder MergeBnetAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasBnetAccountId && - result.bnetAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.bnetAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccountId_).MergeFrom(value).BuildPartial(); - } else { - result.bnetAccountId_ = value; - } - result.hasBnetAccountId = true; - return this; - } - public Builder ClearBnetAccountId() { - result.hasBnetAccountId = false; - result.bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasGameAccountId { - get { return result.HasGameAccountId; } - } - public global::bnet.protocol.EntityId GameAccountId { - get { return result.GameAccountId; } - set { SetGameAccountId(value); } - } - public Builder SetGameAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasGameAccountId = true; - result.gameAccountId_ = value; - return this; - } - public Builder SetGameAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasGameAccountId = true; - result.gameAccountId_ = builderForValue.Build(); - return this; - } - public Builder MergeGameAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasGameAccountId && - result.gameAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.gameAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccountId_).MergeFrom(value).BuildPartial(); - } else { - result.gameAccountId_ = value; - } - result.hasGameAccountId = true; - return this; - } - public Builder ClearGameAccountId() { - result.hasGameAccountId = false; - result.gameAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasToonId { - get { return result.HasToonId; } - } - public global::bnet.protocol.EntityId ToonId { - get { return result.ToonId; } - set { SetToonId(value); } - } - public Builder SetToonId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasToonId = true; - result.toonId_ = value; - return this; - } - public Builder SetToonId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasToonId = true; - result.toonId_ = builderForValue.Build(); - return this; - } - public Builder MergeToonId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasToonId && - result.toonId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.toonId_ = global::bnet.protocol.EntityId.CreateBuilder(result.toonId_).MergeFrom(value).BuildPartial(); - } else { - result.toonId_ = value; - } - result.hasToonId = true; - return this; - } - public Builder ClearToonId() { - result.hasToonId = false; - result.toonId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasName { - get { return result.HasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - result.hasName = false; - result.name_ = ""; - return this; - } - - public pbc::IPopsicleList AttributeList { - get { return result.attribute_; } - } - public int AttributeCount { - get { return result.AttributeCount; } - } - public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { - return result.GetAttribute(index); - } - public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.attribute_[index] = value; - return this; - } - public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.attribute_[index] = builderForValue.Build(); - return this; - } - public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.attribute_.Add(value); - return this; - } - public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.attribute_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeAttribute(scg::IEnumerable values) { - base.AddRange(values, result.attribute_); - return this; - } - public Builder ClearAttribute() { - result.attribute_.Clear(); - return this; - } - - public bool HasHost { - get { return result.HasHost; } - } - public global::bnet.protocol.ProcessId Host { - get { return result.Host; } - set { SetHost(value); } - } - public Builder SetHost(global::bnet.protocol.ProcessId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasHost = true; - result.host_ = value; - return this; - } - public Builder SetHost(global::bnet.protocol.ProcessId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasHost = true; - result.host_ = builderForValue.Build(); - return this; - } - public Builder MergeHost(global::bnet.protocol.ProcessId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasHost && - result.host_ != global::bnet.protocol.ProcessId.DefaultInstance) { - result.host_ = global::bnet.protocol.ProcessId.CreateBuilder(result.host_).MergeFrom(value).BuildPartial(); - } else { - result.host_ = value; - } - result.hasHost = true; - return this; - } - public Builder ClearHost() { - result.hasHost = false; - result.host_ = global::bnet.protocol.ProcessId.DefaultInstance; - return this; - } - } - static CreateToonRequest() { - object.ReferenceEquals(global::bnet.protocol.game_utilities.Proto.GameUtilities.Descriptor, null); - } - } - - public sealed partial class CreateToonResponse : pb::GeneratedMessage { - private static readonly CreateToonResponse defaultInstance = new Builder().BuildPartial(); - public static CreateToonResponse DefaultInstance { - get { return defaultInstance; } - } - - public override CreateToonResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override CreateToonResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_utilities.Proto.GameUtilities.internal__static_bnet_protocol_game_utilities_CreateToonResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_utilities.Proto.GameUtilities.internal__static_bnet_protocol_game_utilities_CreateToonResponse__FieldAccessorTable; } - } - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasName) { - output.WriteString(1, Name); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasName) { - size += pb::CodedOutputStream.ComputeStringSize(1, Name); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static CreateToonResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CreateToonResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CreateToonResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CreateToonResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CreateToonResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CreateToonResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CreateToonResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CreateToonResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CreateToonResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CreateToonResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CreateToonResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - CreateToonResponse result = new CreateToonResponse(); - - protected override CreateToonResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new CreateToonResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.game_utilities.CreateToonResponse.Descriptor; } - } - - public override CreateToonResponse DefaultInstanceForType { - get { return global::bnet.protocol.game_utilities.CreateToonResponse.DefaultInstance; } - } - - public override CreateToonResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - CreateToonResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CreateToonResponse) { - return MergeFrom((CreateToonResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CreateToonResponse other) { - if (other == global::bnet.protocol.game_utilities.CreateToonResponse.DefaultInstance) return this; - if (other.HasName) { - Name = other.Name; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - Name = input.ReadString(); - break; - } - } - } - } - - - public bool HasName { - get { return result.HasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - result.hasName = false; - result.name_ = ""; - return this; - } - } - static CreateToonResponse() { - object.ReferenceEquals(global::bnet.protocol.game_utilities.Proto.GameUtilities.Descriptor, null); - } - } - - public sealed partial class DeleteToonRequest : pb::GeneratedMessage { - private static readonly DeleteToonRequest defaultInstance = new Builder().BuildPartial(); - public static DeleteToonRequest DefaultInstance { - get { return defaultInstance; } - } - - public override DeleteToonRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override DeleteToonRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_utilities.Proto.GameUtilities.internal__static_bnet_protocol_game_utilities_DeleteToonRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_utilities.Proto.GameUtilities.internal__static_bnet_protocol_game_utilities_DeleteToonRequest__FieldAccessorTable; } - } - - public const int BnetAccountIdFieldNumber = 1; - private bool hasBnetAccountId; - private global::bnet.protocol.EntityId bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasBnetAccountId { - get { return hasBnetAccountId; } - } - public global::bnet.protocol.EntityId BnetAccountId { - get { return bnetAccountId_; } - } - - public const int GameAccountIdFieldNumber = 2; - private bool hasGameAccountId; - private global::bnet.protocol.EntityId gameAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasGameAccountId { - get { return hasGameAccountId; } - } - public global::bnet.protocol.EntityId GameAccountId { - get { return gameAccountId_; } - } - - public const int ToonIdFieldNumber = 3; - private bool hasToonId; - private global::bnet.protocol.EntityId toonId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasToonId { - get { return hasToonId; } - } - public global::bnet.protocol.EntityId ToonId { - get { return toonId_; } - } - - public const int HostFieldNumber = 4; - private bool hasHost; - private global::bnet.protocol.ProcessId host_ = global::bnet.protocol.ProcessId.DefaultInstance; - public bool HasHost { - get { return hasHost; } - } - public global::bnet.protocol.ProcessId Host { - get { return host_; } - } - - public override bool IsInitialized { - get { - if (!hasToonId) return false; - if (HasBnetAccountId) { - if (!BnetAccountId.IsInitialized) return false; - } - if (HasGameAccountId) { - if (!GameAccountId.IsInitialized) return false; - } - if (!ToonId.IsInitialized) return false; - if (HasHost) { - if (!Host.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasBnetAccountId) { - output.WriteMessage(1, BnetAccountId); - } - if (HasGameAccountId) { - output.WriteMessage(2, GameAccountId); - } - if (HasToonId) { - output.WriteMessage(3, ToonId); - } - if (HasHost) { - output.WriteMessage(4, Host); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasBnetAccountId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, BnetAccountId); - } - if (HasGameAccountId) { - size += pb::CodedOutputStream.ComputeMessageSize(2, GameAccountId); - } - if (HasToonId) { - size += pb::CodedOutputStream.ComputeMessageSize(3, ToonId); - } - if (HasHost) { - size += pb::CodedOutputStream.ComputeMessageSize(4, Host); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static DeleteToonRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DeleteToonRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DeleteToonRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DeleteToonRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DeleteToonRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DeleteToonRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static DeleteToonRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static DeleteToonRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static DeleteToonRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DeleteToonRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(DeleteToonRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - DeleteToonRequest result = new DeleteToonRequest(); - - protected override DeleteToonRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new DeleteToonRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.game_utilities.DeleteToonRequest.Descriptor; } - } - - public override DeleteToonRequest DefaultInstanceForType { - get { return global::bnet.protocol.game_utilities.DeleteToonRequest.DefaultInstance; } - } - - public override DeleteToonRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - DeleteToonRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is DeleteToonRequest) { - return MergeFrom((DeleteToonRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(DeleteToonRequest other) { - if (other == global::bnet.protocol.game_utilities.DeleteToonRequest.DefaultInstance) return this; - if (other.HasBnetAccountId) { - MergeBnetAccountId(other.BnetAccountId); - } - if (other.HasGameAccountId) { - MergeGameAccountId(other.GameAccountId); - } - if (other.HasToonId) { - MergeToonId(other.ToonId); - } - if (other.HasHost) { - MergeHost(other.Host); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasBnetAccountId) { - subBuilder.MergeFrom(BnetAccountId); - } - input.ReadMessage(subBuilder, extensionRegistry); - BnetAccountId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasGameAccountId) { - subBuilder.MergeFrom(GameAccountId); - } - input.ReadMessage(subBuilder, extensionRegistry); - GameAccountId = subBuilder.BuildPartial(); - break; - } - case 26: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasToonId) { - subBuilder.MergeFrom(ToonId); - } - input.ReadMessage(subBuilder, extensionRegistry); - ToonId = subBuilder.BuildPartial(); - break; - } - case 34: { - global::bnet.protocol.ProcessId.Builder subBuilder = global::bnet.protocol.ProcessId.CreateBuilder(); - if (HasHost) { - subBuilder.MergeFrom(Host); - } - input.ReadMessage(subBuilder, extensionRegistry); - Host = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasBnetAccountId { - get { return result.HasBnetAccountId; } - } - public global::bnet.protocol.EntityId BnetAccountId { - get { return result.BnetAccountId; } - set { SetBnetAccountId(value); } - } - public Builder SetBnetAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBnetAccountId = true; - result.bnetAccountId_ = value; - return this; - } - public Builder SetBnetAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBnetAccountId = true; - result.bnetAccountId_ = builderForValue.Build(); - return this; - } - public Builder MergeBnetAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasBnetAccountId && - result.bnetAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.bnetAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccountId_).MergeFrom(value).BuildPartial(); - } else { - result.bnetAccountId_ = value; - } - result.hasBnetAccountId = true; - return this; - } - public Builder ClearBnetAccountId() { - result.hasBnetAccountId = false; - result.bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasGameAccountId { - get { return result.HasGameAccountId; } - } - public global::bnet.protocol.EntityId GameAccountId { - get { return result.GameAccountId; } - set { SetGameAccountId(value); } - } - public Builder SetGameAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasGameAccountId = true; - result.gameAccountId_ = value; - return this; - } - public Builder SetGameAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasGameAccountId = true; - result.gameAccountId_ = builderForValue.Build(); - return this; - } - public Builder MergeGameAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasGameAccountId && - result.gameAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.gameAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccountId_).MergeFrom(value).BuildPartial(); - } else { - result.gameAccountId_ = value; - } - result.hasGameAccountId = true; - return this; - } - public Builder ClearGameAccountId() { - result.hasGameAccountId = false; - result.gameAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasToonId { - get { return result.HasToonId; } - } - public global::bnet.protocol.EntityId ToonId { - get { return result.ToonId; } - set { SetToonId(value); } - } - public Builder SetToonId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasToonId = true; - result.toonId_ = value; - return this; - } - public Builder SetToonId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasToonId = true; - result.toonId_ = builderForValue.Build(); - return this; - } - public Builder MergeToonId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasToonId && - result.toonId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.toonId_ = global::bnet.protocol.EntityId.CreateBuilder(result.toonId_).MergeFrom(value).BuildPartial(); - } else { - result.toonId_ = value; - } - result.hasToonId = true; - return this; - } - public Builder ClearToonId() { - result.hasToonId = false; - result.toonId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasHost { - get { return result.HasHost; } - } - public global::bnet.protocol.ProcessId Host { - get { return result.Host; } - set { SetHost(value); } - } - public Builder SetHost(global::bnet.protocol.ProcessId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasHost = true; - result.host_ = value; - return this; - } - public Builder SetHost(global::bnet.protocol.ProcessId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasHost = true; - result.host_ = builderForValue.Build(); - return this; - } - public Builder MergeHost(global::bnet.protocol.ProcessId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasHost && - result.host_ != global::bnet.protocol.ProcessId.DefaultInstance) { - result.host_ = global::bnet.protocol.ProcessId.CreateBuilder(result.host_).MergeFrom(value).BuildPartial(); - } else { - result.host_ = value; - } - result.hasHost = true; - return this; - } - public Builder ClearHost() { - result.hasHost = false; - result.host_ = global::bnet.protocol.ProcessId.DefaultInstance; - return this; - } - } - static DeleteToonRequest() { - object.ReferenceEquals(global::bnet.protocol.game_utilities.Proto.GameUtilities.Descriptor, null); - } - } - - public sealed partial class TransferToonRequest : pb::GeneratedMessage { - private static readonly TransferToonRequest defaultInstance = new Builder().BuildPartial(); - public static TransferToonRequest DefaultInstance { - get { return defaultInstance; } - } - - public override TransferToonRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override TransferToonRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_utilities.Proto.GameUtilities.internal__static_bnet_protocol_game_utilities_TransferToonRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_utilities.Proto.GameUtilities.internal__static_bnet_protocol_game_utilities_TransferToonRequest__FieldAccessorTable; } - } - - #region Nested types - public static class Types { - public sealed partial class Account : pb::GeneratedMessage { - private static readonly Account defaultInstance = new Builder().BuildPartial(); - public static Account DefaultInstance { - get { return defaultInstance; } - } - - public override Account DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override Account ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_utilities.Proto.GameUtilities.internal__static_bnet_protocol_game_utilities_TransferToonRequest_Account__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_utilities.Proto.GameUtilities.internal__static_bnet_protocol_game_utilities_TransferToonRequest_Account__FieldAccessorTable; } - } - - public const int BnetAccountIdFieldNumber = 1; - private bool hasBnetAccountId; - private global::bnet.protocol.EntityId bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasBnetAccountId { - get { return hasBnetAccountId; } - } - public global::bnet.protocol.EntityId BnetAccountId { - get { return bnetAccountId_; } - } - - public const int GameAccountIdFieldNumber = 2; - private bool hasGameAccountId; - private global::bnet.protocol.EntityId gameAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasGameAccountId { - get { return hasGameAccountId; } - } - public global::bnet.protocol.EntityId GameAccountId { - get { return gameAccountId_; } - } - - public override bool IsInitialized { - get { - if (!hasBnetAccountId) return false; - if (!hasGameAccountId) return false; - if (!BnetAccountId.IsInitialized) return false; - if (!GameAccountId.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasBnetAccountId) { - output.WriteMessage(1, BnetAccountId); - } - if (HasGameAccountId) { - output.WriteMessage(2, GameAccountId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasBnetAccountId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, BnetAccountId); - } - if (HasGameAccountId) { - size += pb::CodedOutputStream.ComputeMessageSize(2, GameAccountId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static Account ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Account ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Account ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Account ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Account ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Account ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Account ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Account ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Account ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Account ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Account prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - Account result = new Account(); - - protected override Account MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new Account(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account.Descriptor; } - } - - public override Account DefaultInstanceForType { - get { return global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account.DefaultInstance; } - } - - public override Account BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - Account returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Account) { - return MergeFrom((Account) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Account other) { - if (other == global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account.DefaultInstance) return this; - if (other.HasBnetAccountId) { - MergeBnetAccountId(other.BnetAccountId); - } - if (other.HasGameAccountId) { - MergeGameAccountId(other.GameAccountId); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasBnetAccountId) { - subBuilder.MergeFrom(BnetAccountId); - } - input.ReadMessage(subBuilder, extensionRegistry); - BnetAccountId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasGameAccountId) { - subBuilder.MergeFrom(GameAccountId); - } - input.ReadMessage(subBuilder, extensionRegistry); - GameAccountId = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasBnetAccountId { - get { return result.HasBnetAccountId; } - } - public global::bnet.protocol.EntityId BnetAccountId { - get { return result.BnetAccountId; } - set { SetBnetAccountId(value); } - } - public Builder SetBnetAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBnetAccountId = true; - result.bnetAccountId_ = value; - return this; - } - public Builder SetBnetAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBnetAccountId = true; - result.bnetAccountId_ = builderForValue.Build(); - return this; - } - public Builder MergeBnetAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasBnetAccountId && - result.bnetAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.bnetAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccountId_).MergeFrom(value).BuildPartial(); - } else { - result.bnetAccountId_ = value; - } - result.hasBnetAccountId = true; - return this; - } - public Builder ClearBnetAccountId() { - result.hasBnetAccountId = false; - result.bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasGameAccountId { - get { return result.HasGameAccountId; } - } - public global::bnet.protocol.EntityId GameAccountId { - get { return result.GameAccountId; } - set { SetGameAccountId(value); } - } - public Builder SetGameAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasGameAccountId = true; - result.gameAccountId_ = value; - return this; - } - public Builder SetGameAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasGameAccountId = true; - result.gameAccountId_ = builderForValue.Build(); - return this; - } - public Builder MergeGameAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasGameAccountId && - result.gameAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.gameAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccountId_).MergeFrom(value).BuildPartial(); - } else { - result.gameAccountId_ = value; - } - result.hasGameAccountId = true; - return this; - } - public Builder ClearGameAccountId() { - result.hasGameAccountId = false; - result.gameAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - } - static Account() { - object.ReferenceEquals(global::bnet.protocol.game_utilities.Proto.GameUtilities.Descriptor, null); - } - } - - } - #endregion - - public const int ToonIdFieldNumber = 1; - private bool hasToonId; - private global::bnet.protocol.EntityId toonId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasToonId { - get { return hasToonId; } - } - public global::bnet.protocol.EntityId ToonId { - get { return toonId_; } - } - - public const int SourceFieldNumber = 2; - private bool hasSource; - private global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account source_ = global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account.DefaultInstance; - public bool HasSource { - get { return hasSource; } - } - public global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account Source { - get { return source_; } - } - - public const int TargetFieldNumber = 3; - private bool hasTarget; - private global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account target_ = global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account.DefaultInstance; - public bool HasTarget { - get { return hasTarget; } - } - public global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account Target { - get { return target_; } - } - - public const int HostFieldNumber = 4; - private bool hasHost; - private global::bnet.protocol.ProcessId host_ = global::bnet.protocol.ProcessId.DefaultInstance; - public bool HasHost { - get { return hasHost; } - } - public global::bnet.protocol.ProcessId Host { - get { return host_; } - } - - public override bool IsInitialized { - get { - if (!hasToonId) return false; - if (!ToonId.IsInitialized) return false; - if (HasSource) { - if (!Source.IsInitialized) return false; - } - if (HasTarget) { - if (!Target.IsInitialized) return false; - } - if (HasHost) { - if (!Host.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasToonId) { - output.WriteMessage(1, ToonId); - } - if (HasSource) { - output.WriteMessage(2, Source); - } - if (HasTarget) { - output.WriteMessage(3, Target); - } - if (HasHost) { - output.WriteMessage(4, Host); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasToonId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, ToonId); - } - if (HasSource) { - size += pb::CodedOutputStream.ComputeMessageSize(2, Source); - } - if (HasTarget) { - size += pb::CodedOutputStream.ComputeMessageSize(3, Target); - } - if (HasHost) { - size += pb::CodedOutputStream.ComputeMessageSize(4, Host); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static TransferToonRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TransferToonRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TransferToonRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TransferToonRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TransferToonRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TransferToonRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TransferToonRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TransferToonRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TransferToonRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TransferToonRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TransferToonRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - TransferToonRequest result = new TransferToonRequest(); - - protected override TransferToonRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new TransferToonRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.game_utilities.TransferToonRequest.Descriptor; } - } - - public override TransferToonRequest DefaultInstanceForType { - get { return global::bnet.protocol.game_utilities.TransferToonRequest.DefaultInstance; } - } - - public override TransferToonRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - TransferToonRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TransferToonRequest) { - return MergeFrom((TransferToonRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TransferToonRequest other) { - if (other == global::bnet.protocol.game_utilities.TransferToonRequest.DefaultInstance) return this; - if (other.HasToonId) { - MergeToonId(other.ToonId); - } - if (other.HasSource) { - MergeSource(other.Source); - } - if (other.HasTarget) { - MergeTarget(other.Target); - } - if (other.HasHost) { - MergeHost(other.Host); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasToonId) { - subBuilder.MergeFrom(ToonId); - } - input.ReadMessage(subBuilder, extensionRegistry); - ToonId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account.Builder subBuilder = global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account.CreateBuilder(); - if (HasSource) { - subBuilder.MergeFrom(Source); - } - input.ReadMessage(subBuilder, extensionRegistry); - Source = subBuilder.BuildPartial(); - break; - } - case 26: { - global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account.Builder subBuilder = global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account.CreateBuilder(); - if (HasTarget) { - subBuilder.MergeFrom(Target); - } - input.ReadMessage(subBuilder, extensionRegistry); - Target = subBuilder.BuildPartial(); - break; - } - case 34: { - global::bnet.protocol.ProcessId.Builder subBuilder = global::bnet.protocol.ProcessId.CreateBuilder(); - if (HasHost) { - subBuilder.MergeFrom(Host); - } - input.ReadMessage(subBuilder, extensionRegistry); - Host = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasToonId { - get { return result.HasToonId; } - } - public global::bnet.protocol.EntityId ToonId { - get { return result.ToonId; } - set { SetToonId(value); } - } - public Builder SetToonId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasToonId = true; - result.toonId_ = value; - return this; - } - public Builder SetToonId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasToonId = true; - result.toonId_ = builderForValue.Build(); - return this; - } - public Builder MergeToonId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasToonId && - result.toonId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.toonId_ = global::bnet.protocol.EntityId.CreateBuilder(result.toonId_).MergeFrom(value).BuildPartial(); - } else { - result.toonId_ = value; - } - result.hasToonId = true; - return this; - } - public Builder ClearToonId() { - result.hasToonId = false; - result.toonId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasSource { - get { return result.HasSource; } - } - public global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account Source { - get { return result.Source; } - set { SetSource(value); } - } - public Builder SetSource(global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasSource = true; - result.source_ = value; - return this; - } - public Builder SetSource(global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasSource = true; - result.source_ = builderForValue.Build(); - return this; - } - public Builder MergeSource(global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasSource && - result.source_ != global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account.DefaultInstance) { - result.source_ = global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account.CreateBuilder(result.source_).MergeFrom(value).BuildPartial(); - } else { - result.source_ = value; - } - result.hasSource = true; - return this; - } - public Builder ClearSource() { - result.hasSource = false; - result.source_ = global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account.DefaultInstance; - return this; - } - - public bool HasTarget { - get { return result.HasTarget; } - } - public global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account Target { - get { return result.Target; } - set { SetTarget(value); } - } - public Builder SetTarget(global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasTarget = true; - result.target_ = value; - return this; - } - public Builder SetTarget(global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasTarget = true; - result.target_ = builderForValue.Build(); - return this; - } - public Builder MergeTarget(global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasTarget && - result.target_ != global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account.DefaultInstance) { - result.target_ = global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account.CreateBuilder(result.target_).MergeFrom(value).BuildPartial(); - } else { - result.target_ = value; - } - result.hasTarget = true; - return this; - } - public Builder ClearTarget() { - result.hasTarget = false; - result.target_ = global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account.DefaultInstance; - return this; - } - - public bool HasHost { - get { return result.HasHost; } - } - public global::bnet.protocol.ProcessId Host { - get { return result.Host; } - set { SetHost(value); } - } - public Builder SetHost(global::bnet.protocol.ProcessId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasHost = true; - result.host_ = value; - return this; - } - public Builder SetHost(global::bnet.protocol.ProcessId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasHost = true; - result.host_ = builderForValue.Build(); - return this; - } - public Builder MergeHost(global::bnet.protocol.ProcessId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasHost && - result.host_ != global::bnet.protocol.ProcessId.DefaultInstance) { - result.host_ = global::bnet.protocol.ProcessId.CreateBuilder(result.host_).MergeFrom(value).BuildPartial(); - } else { - result.host_ = value; - } - result.hasHost = true; - return this; - } - public Builder ClearHost() { - result.hasHost = false; - result.host_ = global::bnet.protocol.ProcessId.DefaultInstance; - return this; - } - } - static TransferToonRequest() { - object.ReferenceEquals(global::bnet.protocol.game_utilities.Proto.GameUtilities.Descriptor, null); - } - } - - public sealed partial class SelectToonRequest : pb::GeneratedMessage { - private static readonly SelectToonRequest defaultInstance = new Builder().BuildPartial(); - public static SelectToonRequest DefaultInstance { - get { return defaultInstance; } - } - - public override SelectToonRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override SelectToonRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_utilities.Proto.GameUtilities.internal__static_bnet_protocol_game_utilities_SelectToonRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_utilities.Proto.GameUtilities.internal__static_bnet_protocol_game_utilities_SelectToonRequest__FieldAccessorTable; } - } - - public const int BnetAccountIdFieldNumber = 1; - private bool hasBnetAccountId; - private global::bnet.protocol.EntityId bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasBnetAccountId { - get { return hasBnetAccountId; } - } - public global::bnet.protocol.EntityId BnetAccountId { - get { return bnetAccountId_; } - } - - public const int GameAccountIdFieldNumber = 2; - private bool hasGameAccountId; - private global::bnet.protocol.EntityId gameAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasGameAccountId { - get { return hasGameAccountId; } - } - public global::bnet.protocol.EntityId GameAccountId { - get { return gameAccountId_; } - } - - public const int ToonIdFieldNumber = 3; - private bool hasToonId; - private global::bnet.protocol.EntityId toonId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasToonId { - get { return hasToonId; } - } - public global::bnet.protocol.EntityId ToonId { - get { return toonId_; } - } - - public const int HostFieldNumber = 4; - private bool hasHost; - private global::bnet.protocol.ProcessId host_ = global::bnet.protocol.ProcessId.DefaultInstance; - public bool HasHost { - get { return hasHost; } - } - public global::bnet.protocol.ProcessId Host { - get { return host_; } - } - - public override bool IsInitialized { - get { - if (!hasBnetAccountId) return false; - if (!hasGameAccountId) return false; - if (!hasToonId) return false; - if (!BnetAccountId.IsInitialized) return false; - if (!GameAccountId.IsInitialized) return false; - if (!ToonId.IsInitialized) return false; - if (HasHost) { - if (!Host.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasBnetAccountId) { - output.WriteMessage(1, BnetAccountId); - } - if (HasGameAccountId) { - output.WriteMessage(2, GameAccountId); - } - if (HasToonId) { - output.WriteMessage(3, ToonId); - } - if (HasHost) { - output.WriteMessage(4, Host); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasBnetAccountId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, BnetAccountId); - } - if (HasGameAccountId) { - size += pb::CodedOutputStream.ComputeMessageSize(2, GameAccountId); - } - if (HasToonId) { - size += pb::CodedOutputStream.ComputeMessageSize(3, ToonId); - } - if (HasHost) { - size += pb::CodedOutputStream.ComputeMessageSize(4, Host); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static SelectToonRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SelectToonRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SelectToonRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SelectToonRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SelectToonRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SelectToonRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SelectToonRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SelectToonRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SelectToonRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SelectToonRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SelectToonRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - SelectToonRequest result = new SelectToonRequest(); - - protected override SelectToonRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new SelectToonRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.game_utilities.SelectToonRequest.Descriptor; } - } - - public override SelectToonRequest DefaultInstanceForType { - get { return global::bnet.protocol.game_utilities.SelectToonRequest.DefaultInstance; } - } - - public override SelectToonRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - SelectToonRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SelectToonRequest) { - return MergeFrom((SelectToonRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SelectToonRequest other) { - if (other == global::bnet.protocol.game_utilities.SelectToonRequest.DefaultInstance) return this; - if (other.HasBnetAccountId) { - MergeBnetAccountId(other.BnetAccountId); - } - if (other.HasGameAccountId) { - MergeGameAccountId(other.GameAccountId); - } - if (other.HasToonId) { - MergeToonId(other.ToonId); - } - if (other.HasHost) { - MergeHost(other.Host); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasBnetAccountId) { - subBuilder.MergeFrom(BnetAccountId); - } - input.ReadMessage(subBuilder, extensionRegistry); - BnetAccountId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasGameAccountId) { - subBuilder.MergeFrom(GameAccountId); - } - input.ReadMessage(subBuilder, extensionRegistry); - GameAccountId = subBuilder.BuildPartial(); - break; - } - case 26: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasToonId) { - subBuilder.MergeFrom(ToonId); - } - input.ReadMessage(subBuilder, extensionRegistry); - ToonId = subBuilder.BuildPartial(); - break; - } - case 34: { - global::bnet.protocol.ProcessId.Builder subBuilder = global::bnet.protocol.ProcessId.CreateBuilder(); - if (HasHost) { - subBuilder.MergeFrom(Host); - } - input.ReadMessage(subBuilder, extensionRegistry); - Host = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasBnetAccountId { - get { return result.HasBnetAccountId; } - } - public global::bnet.protocol.EntityId BnetAccountId { - get { return result.BnetAccountId; } - set { SetBnetAccountId(value); } - } - public Builder SetBnetAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBnetAccountId = true; - result.bnetAccountId_ = value; - return this; - } - public Builder SetBnetAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBnetAccountId = true; - result.bnetAccountId_ = builderForValue.Build(); - return this; - } - public Builder MergeBnetAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasBnetAccountId && - result.bnetAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.bnetAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccountId_).MergeFrom(value).BuildPartial(); - } else { - result.bnetAccountId_ = value; - } - result.hasBnetAccountId = true; - return this; - } - public Builder ClearBnetAccountId() { - result.hasBnetAccountId = false; - result.bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasGameAccountId { - get { return result.HasGameAccountId; } - } - public global::bnet.protocol.EntityId GameAccountId { - get { return result.GameAccountId; } - set { SetGameAccountId(value); } - } - public Builder SetGameAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasGameAccountId = true; - result.gameAccountId_ = value; - return this; - } - public Builder SetGameAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasGameAccountId = true; - result.gameAccountId_ = builderForValue.Build(); - return this; - } - public Builder MergeGameAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasGameAccountId && - result.gameAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.gameAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccountId_).MergeFrom(value).BuildPartial(); - } else { - result.gameAccountId_ = value; - } - result.hasGameAccountId = true; - return this; - } - public Builder ClearGameAccountId() { - result.hasGameAccountId = false; - result.gameAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasToonId { - get { return result.HasToonId; } - } - public global::bnet.protocol.EntityId ToonId { - get { return result.ToonId; } - set { SetToonId(value); } - } - public Builder SetToonId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasToonId = true; - result.toonId_ = value; - return this; - } - public Builder SetToonId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasToonId = true; - result.toonId_ = builderForValue.Build(); - return this; - } - public Builder MergeToonId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasToonId && - result.toonId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.toonId_ = global::bnet.protocol.EntityId.CreateBuilder(result.toonId_).MergeFrom(value).BuildPartial(); - } else { - result.toonId_ = value; - } - result.hasToonId = true; - return this; - } - public Builder ClearToonId() { - result.hasToonId = false; - result.toonId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasHost { - get { return result.HasHost; } - } - public global::bnet.protocol.ProcessId Host { - get { return result.Host; } - set { SetHost(value); } - } - public Builder SetHost(global::bnet.protocol.ProcessId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasHost = true; - result.host_ = value; - return this; - } - public Builder SetHost(global::bnet.protocol.ProcessId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasHost = true; - result.host_ = builderForValue.Build(); - return this; - } - public Builder MergeHost(global::bnet.protocol.ProcessId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasHost && - result.host_ != global::bnet.protocol.ProcessId.DefaultInstance) { - result.host_ = global::bnet.protocol.ProcessId.CreateBuilder(result.host_).MergeFrom(value).BuildPartial(); - } else { - result.host_ = value; - } - result.hasHost = true; - return this; - } - public Builder ClearHost() { - result.hasHost = false; - result.host_ = global::bnet.protocol.ProcessId.DefaultInstance; - return this; - } - } - static SelectToonRequest() { - object.ReferenceEquals(global::bnet.protocol.game_utilities.Proto.GameUtilities.Descriptor, null); - } - } - - public sealed partial class PresenceChannelCreatedRequest : pb::GeneratedMessage { - private static readonly PresenceChannelCreatedRequest defaultInstance = new Builder().BuildPartial(); - public static PresenceChannelCreatedRequest DefaultInstance { - get { return defaultInstance; } - } - - public override PresenceChannelCreatedRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override PresenceChannelCreatedRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_utilities.Proto.GameUtilities.internal__static_bnet_protocol_game_utilities_PresenceChannelCreatedRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_utilities.Proto.GameUtilities.internal__static_bnet_protocol_game_utilities_PresenceChannelCreatedRequest__FieldAccessorTable; } - } - - public const int IdFieldNumber = 1; - private bool hasId; - private global::bnet.protocol.EntityId id_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasId { - get { return hasId; } - } - public global::bnet.protocol.EntityId Id { - get { return id_; } - } - - public const int ToonIdFieldNumber = 2; - private bool hasToonId; - private global::bnet.protocol.EntityId toonId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasToonId { - get { return hasToonId; } - } - public global::bnet.protocol.EntityId ToonId { - get { return toonId_; } - } - - public const int GameAccountIdFieldNumber = 3; - private bool hasGameAccountId; - private global::bnet.protocol.EntityId gameAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasGameAccountId { - get { return hasGameAccountId; } - } - public global::bnet.protocol.EntityId GameAccountId { - get { return gameAccountId_; } - } - - public const int BnetAccountIdFieldNumber = 4; - private bool hasBnetAccountId; - private global::bnet.protocol.EntityId bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasBnetAccountId { - get { return hasBnetAccountId; } - } - public global::bnet.protocol.EntityId BnetAccountId { - get { return bnetAccountId_; } - } - - public const int HostFieldNumber = 5; - private bool hasHost; - private global::bnet.protocol.ProcessId host_ = global::bnet.protocol.ProcessId.DefaultInstance; - public bool HasHost { - get { return hasHost; } - } - public global::bnet.protocol.ProcessId Host { - get { return host_; } - } - - public override bool IsInitialized { - get { - if (!hasId) return false; - if (!Id.IsInitialized) return false; - if (HasToonId) { - if (!ToonId.IsInitialized) return false; - } - if (HasGameAccountId) { - if (!GameAccountId.IsInitialized) return false; - } - if (HasBnetAccountId) { - if (!BnetAccountId.IsInitialized) return false; - } - if (HasHost) { - if (!Host.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasId) { - output.WriteMessage(1, Id); - } - if (HasToonId) { - output.WriteMessage(2, ToonId); - } - if (HasGameAccountId) { - output.WriteMessage(3, GameAccountId); - } - if (HasBnetAccountId) { - output.WriteMessage(4, BnetAccountId); - } - if (HasHost) { - output.WriteMessage(5, Host); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Id); - } - if (HasToonId) { - size += pb::CodedOutputStream.ComputeMessageSize(2, ToonId); - } - if (HasGameAccountId) { - size += pb::CodedOutputStream.ComputeMessageSize(3, GameAccountId); - } - if (HasBnetAccountId) { - size += pb::CodedOutputStream.ComputeMessageSize(4, BnetAccountId); - } - if (HasHost) { - size += pb::CodedOutputStream.ComputeMessageSize(5, Host); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static PresenceChannelCreatedRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PresenceChannelCreatedRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PresenceChannelCreatedRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PresenceChannelCreatedRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PresenceChannelCreatedRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PresenceChannelCreatedRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static PresenceChannelCreatedRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static PresenceChannelCreatedRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static PresenceChannelCreatedRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PresenceChannelCreatedRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(PresenceChannelCreatedRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - PresenceChannelCreatedRequest result = new PresenceChannelCreatedRequest(); - - protected override PresenceChannelCreatedRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new PresenceChannelCreatedRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.game_utilities.PresenceChannelCreatedRequest.Descriptor; } - } - - public override PresenceChannelCreatedRequest DefaultInstanceForType { - get { return global::bnet.protocol.game_utilities.PresenceChannelCreatedRequest.DefaultInstance; } - } - - public override PresenceChannelCreatedRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - PresenceChannelCreatedRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is PresenceChannelCreatedRequest) { - return MergeFrom((PresenceChannelCreatedRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(PresenceChannelCreatedRequest other) { - if (other == global::bnet.protocol.game_utilities.PresenceChannelCreatedRequest.DefaultInstance) return this; - if (other.HasId) { - MergeId(other.Id); - } - if (other.HasToonId) { - MergeToonId(other.ToonId); - } - if (other.HasGameAccountId) { - MergeGameAccountId(other.GameAccountId); - } - if (other.HasBnetAccountId) { - MergeBnetAccountId(other.BnetAccountId); - } - if (other.HasHost) { - MergeHost(other.Host); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasId) { - subBuilder.MergeFrom(Id); - } - input.ReadMessage(subBuilder, extensionRegistry); - Id = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasToonId) { - subBuilder.MergeFrom(ToonId); - } - input.ReadMessage(subBuilder, extensionRegistry); - ToonId = subBuilder.BuildPartial(); - break; - } - case 26: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasGameAccountId) { - subBuilder.MergeFrom(GameAccountId); - } - input.ReadMessage(subBuilder, extensionRegistry); - GameAccountId = subBuilder.BuildPartial(); - break; - } - case 34: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasBnetAccountId) { - subBuilder.MergeFrom(BnetAccountId); - } - input.ReadMessage(subBuilder, extensionRegistry); - BnetAccountId = subBuilder.BuildPartial(); - break; - } - case 42: { - global::bnet.protocol.ProcessId.Builder subBuilder = global::bnet.protocol.ProcessId.CreateBuilder(); - if (HasHost) { - subBuilder.MergeFrom(Host); - } - input.ReadMessage(subBuilder, extensionRegistry); - Host = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasId { - get { return result.HasId; } - } - public global::bnet.protocol.EntityId Id { - get { return result.Id; } - set { SetId(value); } - } - public Builder SetId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasId = true; - result.id_ = value; - return this; - } - public Builder SetId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasId = true; - result.id_ = builderForValue.Build(); - return this; - } - public Builder MergeId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasId && - result.id_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.id_ = global::bnet.protocol.EntityId.CreateBuilder(result.id_).MergeFrom(value).BuildPartial(); - } else { - result.id_ = value; - } - result.hasId = true; - return this; - } - public Builder ClearId() { - result.hasId = false; - result.id_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasToonId { - get { return result.HasToonId; } - } - public global::bnet.protocol.EntityId ToonId { - get { return result.ToonId; } - set { SetToonId(value); } - } - public Builder SetToonId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasToonId = true; - result.toonId_ = value; - return this; - } - public Builder SetToonId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasToonId = true; - result.toonId_ = builderForValue.Build(); - return this; - } - public Builder MergeToonId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasToonId && - result.toonId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.toonId_ = global::bnet.protocol.EntityId.CreateBuilder(result.toonId_).MergeFrom(value).BuildPartial(); - } else { - result.toonId_ = value; - } - result.hasToonId = true; - return this; - } - public Builder ClearToonId() { - result.hasToonId = false; - result.toonId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasGameAccountId { - get { return result.HasGameAccountId; } - } - public global::bnet.protocol.EntityId GameAccountId { - get { return result.GameAccountId; } - set { SetGameAccountId(value); } - } - public Builder SetGameAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasGameAccountId = true; - result.gameAccountId_ = value; - return this; - } - public Builder SetGameAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasGameAccountId = true; - result.gameAccountId_ = builderForValue.Build(); - return this; - } - public Builder MergeGameAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasGameAccountId && - result.gameAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.gameAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccountId_).MergeFrom(value).BuildPartial(); - } else { - result.gameAccountId_ = value; - } - result.hasGameAccountId = true; - return this; - } - public Builder ClearGameAccountId() { - result.hasGameAccountId = false; - result.gameAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasBnetAccountId { - get { return result.HasBnetAccountId; } - } - public global::bnet.protocol.EntityId BnetAccountId { - get { return result.BnetAccountId; } - set { SetBnetAccountId(value); } - } - public Builder SetBnetAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBnetAccountId = true; - result.bnetAccountId_ = value; - return this; - } - public Builder SetBnetAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBnetAccountId = true; - result.bnetAccountId_ = builderForValue.Build(); - return this; - } - public Builder MergeBnetAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasBnetAccountId && - result.bnetAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.bnetAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccountId_).MergeFrom(value).BuildPartial(); - } else { - result.bnetAccountId_ = value; - } - result.hasBnetAccountId = true; - return this; - } - public Builder ClearBnetAccountId() { - result.hasBnetAccountId = false; - result.bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasHost { - get { return result.HasHost; } - } - public global::bnet.protocol.ProcessId Host { - get { return result.Host; } - set { SetHost(value); } - } - public Builder SetHost(global::bnet.protocol.ProcessId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasHost = true; - result.host_ = value; - return this; - } - public Builder SetHost(global::bnet.protocol.ProcessId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasHost = true; - result.host_ = builderForValue.Build(); - return this; - } - public Builder MergeHost(global::bnet.protocol.ProcessId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasHost && - result.host_ != global::bnet.protocol.ProcessId.DefaultInstance) { - result.host_ = global::bnet.protocol.ProcessId.CreateBuilder(result.host_).MergeFrom(value).BuildPartial(); - } else { - result.host_ = value; - } - result.hasHost = true; - return this; - } - public Builder ClearHost() { - result.hasHost = false; - result.host_ = global::bnet.protocol.ProcessId.DefaultInstance; - return this; - } - } - static PresenceChannelCreatedRequest() { - object.ReferenceEquals(global::bnet.protocol.game_utilities.Proto.GameUtilities.Descriptor, null); - } - } - - public sealed partial class PlayerVariablesRequest : pb::GeneratedMessage { - private static readonly PlayerVariablesRequest defaultInstance = new Builder().BuildPartial(); - public static PlayerVariablesRequest DefaultInstance { - get { return defaultInstance; } - } - - public override PlayerVariablesRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override PlayerVariablesRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_utilities.Proto.GameUtilities.internal__static_bnet_protocol_game_utilities_PlayerVariablesRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_utilities.Proto.GameUtilities.internal__static_bnet_protocol_game_utilities_PlayerVariablesRequest__FieldAccessorTable; } - } - - public const int BnetAccountIdFieldNumber = 1; - private bool hasBnetAccountId; - private global::bnet.protocol.EntityId bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasBnetAccountId { - get { return hasBnetAccountId; } - } - public global::bnet.protocol.EntityId BnetAccountId { - get { return bnetAccountId_; } - } - - public const int GameAccountIdFieldNumber = 2; - private bool hasGameAccountId; - private global::bnet.protocol.EntityId gameAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasGameAccountId { - get { return hasGameAccountId; } - } - public global::bnet.protocol.EntityId GameAccountId { - get { return gameAccountId_; } - } - - public const int ToonIdFieldNumber = 3; - private bool hasToonId; - private global::bnet.protocol.EntityId toonId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasToonId { - get { return hasToonId; } - } - public global::bnet.protocol.EntityId ToonId { - get { return toonId_; } - } - - public const int VariableFieldNumber = 4; - private pbc::PopsicleList variable_ = new pbc::PopsicleList(); - public scg::IList VariableList { - get { return pbc::Lists.AsReadOnly(variable_); } - } - public int VariableCount { - get { return variable_.Count; } - } - public string GetVariable(int index) { - return variable_[index]; - } - - public const int HostFieldNumber = 5; - private bool hasHost; - private global::bnet.protocol.ProcessId host_ = global::bnet.protocol.ProcessId.DefaultInstance; - public bool HasHost { - get { return hasHost; } - } - public global::bnet.protocol.ProcessId Host { - get { return host_; } - } - - public override bool IsInitialized { - get { - if (!hasBnetAccountId) return false; - if (!hasGameAccountId) return false; - if (!hasToonId) return false; - if (!BnetAccountId.IsInitialized) return false; - if (!GameAccountId.IsInitialized) return false; - if (!ToonId.IsInitialized) return false; - if (HasHost) { - if (!Host.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasBnetAccountId) { - output.WriteMessage(1, BnetAccountId); - } - if (HasGameAccountId) { - output.WriteMessage(2, GameAccountId); - } - if (HasToonId) { - output.WriteMessage(3, ToonId); - } - if (variable_.Count > 0) { - foreach (string element in variable_) { - output.WriteString(4, element); - } - } - if (HasHost) { - output.WriteMessage(5, Host); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasBnetAccountId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, BnetAccountId); - } - if (HasGameAccountId) { - size += pb::CodedOutputStream.ComputeMessageSize(2, GameAccountId); - } - if (HasToonId) { - size += pb::CodedOutputStream.ComputeMessageSize(3, ToonId); - } - { - int dataSize = 0; - foreach (string element in VariableList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 1 * variable_.Count; - } - if (HasHost) { - size += pb::CodedOutputStream.ComputeMessageSize(5, Host); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static PlayerVariablesRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PlayerVariablesRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PlayerVariablesRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PlayerVariablesRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PlayerVariablesRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PlayerVariablesRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static PlayerVariablesRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static PlayerVariablesRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static PlayerVariablesRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PlayerVariablesRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(PlayerVariablesRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - PlayerVariablesRequest result = new PlayerVariablesRequest(); - - protected override PlayerVariablesRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new PlayerVariablesRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.game_utilities.PlayerVariablesRequest.Descriptor; } - } - - public override PlayerVariablesRequest DefaultInstanceForType { - get { return global::bnet.protocol.game_utilities.PlayerVariablesRequest.DefaultInstance; } - } - - public override PlayerVariablesRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.variable_.MakeReadOnly(); - PlayerVariablesRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is PlayerVariablesRequest) { - return MergeFrom((PlayerVariablesRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(PlayerVariablesRequest other) { - if (other == global::bnet.protocol.game_utilities.PlayerVariablesRequest.DefaultInstance) return this; - if (other.HasBnetAccountId) { - MergeBnetAccountId(other.BnetAccountId); - } - if (other.HasGameAccountId) { - MergeGameAccountId(other.GameAccountId); - } - if (other.HasToonId) { - MergeToonId(other.ToonId); - } - if (other.variable_.Count != 0) { - base.AddRange(other.variable_, result.variable_); - } - if (other.HasHost) { - MergeHost(other.Host); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasBnetAccountId) { - subBuilder.MergeFrom(BnetAccountId); - } - input.ReadMessage(subBuilder, extensionRegistry); - BnetAccountId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasGameAccountId) { - subBuilder.MergeFrom(GameAccountId); - } - input.ReadMessage(subBuilder, extensionRegistry); - GameAccountId = subBuilder.BuildPartial(); - break; - } - case 26: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasToonId) { - subBuilder.MergeFrom(ToonId); - } - input.ReadMessage(subBuilder, extensionRegistry); - ToonId = subBuilder.BuildPartial(); - break; - } - case 34: { - AddVariable(input.ReadString()); - break; - } - case 42: { - global::bnet.protocol.ProcessId.Builder subBuilder = global::bnet.protocol.ProcessId.CreateBuilder(); - if (HasHost) { - subBuilder.MergeFrom(Host); - } - input.ReadMessage(subBuilder, extensionRegistry); - Host = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasBnetAccountId { - get { return result.HasBnetAccountId; } - } - public global::bnet.protocol.EntityId BnetAccountId { - get { return result.BnetAccountId; } - set { SetBnetAccountId(value); } - } - public Builder SetBnetAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBnetAccountId = true; - result.bnetAccountId_ = value; - return this; - } - public Builder SetBnetAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBnetAccountId = true; - result.bnetAccountId_ = builderForValue.Build(); - return this; - } - public Builder MergeBnetAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasBnetAccountId && - result.bnetAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.bnetAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccountId_).MergeFrom(value).BuildPartial(); - } else { - result.bnetAccountId_ = value; - } - result.hasBnetAccountId = true; - return this; - } - public Builder ClearBnetAccountId() { - result.hasBnetAccountId = false; - result.bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasGameAccountId { - get { return result.HasGameAccountId; } - } - public global::bnet.protocol.EntityId GameAccountId { - get { return result.GameAccountId; } - set { SetGameAccountId(value); } - } - public Builder SetGameAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasGameAccountId = true; - result.gameAccountId_ = value; - return this; - } - public Builder SetGameAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasGameAccountId = true; - result.gameAccountId_ = builderForValue.Build(); - return this; - } - public Builder MergeGameAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasGameAccountId && - result.gameAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.gameAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccountId_).MergeFrom(value).BuildPartial(); - } else { - result.gameAccountId_ = value; - } - result.hasGameAccountId = true; - return this; - } - public Builder ClearGameAccountId() { - result.hasGameAccountId = false; - result.gameAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasToonId { - get { return result.HasToonId; } - } - public global::bnet.protocol.EntityId ToonId { - get { return result.ToonId; } - set { SetToonId(value); } - } - public Builder SetToonId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasToonId = true; - result.toonId_ = value; - return this; - } - public Builder SetToonId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasToonId = true; - result.toonId_ = builderForValue.Build(); - return this; - } - public Builder MergeToonId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasToonId && - result.toonId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.toonId_ = global::bnet.protocol.EntityId.CreateBuilder(result.toonId_).MergeFrom(value).BuildPartial(); - } else { - result.toonId_ = value; - } - result.hasToonId = true; - return this; - } - public Builder ClearToonId() { - result.hasToonId = false; - result.toonId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public pbc::IPopsicleList VariableList { - get { return result.variable_; } - } - public int VariableCount { - get { return result.VariableCount; } - } - public string GetVariable(int index) { - return result.GetVariable(index); - } - public Builder SetVariable(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.variable_[index] = value; - return this; - } - public Builder AddVariable(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.variable_.Add(value); - return this; - } - public Builder AddRangeVariable(scg::IEnumerable values) { - base.AddRange(values, result.variable_); - return this; - } - public Builder ClearVariable() { - result.variable_.Clear(); - return this; - } - - public bool HasHost { - get { return result.HasHost; } - } - public global::bnet.protocol.ProcessId Host { - get { return result.Host; } - set { SetHost(value); } - } - public Builder SetHost(global::bnet.protocol.ProcessId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasHost = true; - result.host_ = value; - return this; - } - public Builder SetHost(global::bnet.protocol.ProcessId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasHost = true; - result.host_ = builderForValue.Build(); - return this; - } - public Builder MergeHost(global::bnet.protocol.ProcessId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasHost && - result.host_ != global::bnet.protocol.ProcessId.DefaultInstance) { - result.host_ = global::bnet.protocol.ProcessId.CreateBuilder(result.host_).MergeFrom(value).BuildPartial(); - } else { - result.host_ = value; - } - result.hasHost = true; - return this; - } - public Builder ClearHost() { - result.hasHost = false; - result.host_ = global::bnet.protocol.ProcessId.DefaultInstance; - return this; - } - } - static PlayerVariablesRequest() { - object.ReferenceEquals(global::bnet.protocol.game_utilities.Proto.GameUtilities.Descriptor, null); - } - } - - public sealed partial class GameVariablesRequest : pb::GeneratedMessage { - private static readonly GameVariablesRequest defaultInstance = new Builder().BuildPartial(); - public static GameVariablesRequest DefaultInstance { - get { return defaultInstance; } - } - - public override GameVariablesRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override GameVariablesRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_utilities.Proto.GameUtilities.internal__static_bnet_protocol_game_utilities_GameVariablesRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_utilities.Proto.GameUtilities.internal__static_bnet_protocol_game_utilities_GameVariablesRequest__FieldAccessorTable; } - } - - public const int AttributeFieldNumber = 1; - private pbc::PopsicleList attribute_ = new pbc::PopsicleList(); - public scg::IList AttributeList { - get { return attribute_; } - } - public int AttributeCount { - get { return attribute_.Count; } - } - public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { - return attribute_[index]; - } - - public const int VariableFieldNumber = 2; - private pbc::PopsicleList variable_ = new pbc::PopsicleList(); - public scg::IList VariableList { - get { return pbc::Lists.AsReadOnly(variable_); } - } - public int VariableCount { - get { return variable_.Count; } - } - public string GetVariable(int index) { - return variable_[index]; - } - - public const int HostFieldNumber = 3; - private bool hasHost; - private global::bnet.protocol.ProcessId host_ = global::bnet.protocol.ProcessId.DefaultInstance; - public bool HasHost { - get { return hasHost; } - } - public global::bnet.protocol.ProcessId Host { - get { return host_; } - } - - public override bool IsInitialized { - get { - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - if (!element.IsInitialized) return false; - } - if (HasHost) { - if (!Host.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - output.WriteMessage(1, element); - } - if (variable_.Count > 0) { - foreach (string element in variable_) { - output.WriteString(2, element); - } - } - if (HasHost) { - output.WriteMessage(3, Host); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - { - int dataSize = 0; - foreach (string element in VariableList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 1 * variable_.Count; - } - if (HasHost) { - size += pb::CodedOutputStream.ComputeMessageSize(3, Host); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static GameVariablesRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static GameVariablesRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static GameVariablesRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static GameVariablesRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static GameVariablesRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static GameVariablesRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static GameVariablesRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static GameVariablesRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static GameVariablesRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static GameVariablesRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(GameVariablesRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - GameVariablesRequest result = new GameVariablesRequest(); - - protected override GameVariablesRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new GameVariablesRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.game_utilities.GameVariablesRequest.Descriptor; } - } - - public override GameVariablesRequest DefaultInstanceForType { - get { return global::bnet.protocol.game_utilities.GameVariablesRequest.DefaultInstance; } - } - - public override GameVariablesRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.attribute_.MakeReadOnly(); - result.variable_.MakeReadOnly(); - GameVariablesRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is GameVariablesRequest) { - return MergeFrom((GameVariablesRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(GameVariablesRequest other) { - if (other == global::bnet.protocol.game_utilities.GameVariablesRequest.DefaultInstance) return this; - if (other.attribute_.Count != 0) { - base.AddRange(other.attribute_, result.attribute_); - } - if (other.variable_.Count != 0) { - base.AddRange(other.variable_, result.variable_); - } - if (other.HasHost) { - MergeHost(other.Host); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.attribute.Attribute.Builder subBuilder = global::bnet.protocol.attribute.Attribute.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddAttribute(subBuilder.BuildPartial()); - break; - } - case 18: { - AddVariable(input.ReadString()); - break; - } - case 26: { - global::bnet.protocol.ProcessId.Builder subBuilder = global::bnet.protocol.ProcessId.CreateBuilder(); - if (HasHost) { - subBuilder.MergeFrom(Host); - } - input.ReadMessage(subBuilder, extensionRegistry); - Host = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public pbc::IPopsicleList AttributeList { - get { return result.attribute_; } - } - public int AttributeCount { - get { return result.AttributeCount; } - } - public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { - return result.GetAttribute(index); - } - public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.attribute_[index] = value; - return this; - } - public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.attribute_[index] = builderForValue.Build(); - return this; - } - public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.attribute_.Add(value); - return this; - } - public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.attribute_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeAttribute(scg::IEnumerable values) { - base.AddRange(values, result.attribute_); - return this; - } - public Builder ClearAttribute() { - result.attribute_.Clear(); - return this; - } - - public pbc::IPopsicleList VariableList { - get { return result.variable_; } - } - public int VariableCount { - get { return result.VariableCount; } - } - public string GetVariable(int index) { - return result.GetVariable(index); - } - public Builder SetVariable(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.variable_[index] = value; - return this; - } - public Builder AddVariable(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.variable_.Add(value); - return this; - } - public Builder AddRangeVariable(scg::IEnumerable values) { - base.AddRange(values, result.variable_); - return this; - } - public Builder ClearVariable() { - result.variable_.Clear(); - return this; - } - - public bool HasHost { - get { return result.HasHost; } - } - public global::bnet.protocol.ProcessId Host { - get { return result.Host; } - set { SetHost(value); } - } - public Builder SetHost(global::bnet.protocol.ProcessId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasHost = true; - result.host_ = value; - return this; - } - public Builder SetHost(global::bnet.protocol.ProcessId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasHost = true; - result.host_ = builderForValue.Build(); - return this; - } - public Builder MergeHost(global::bnet.protocol.ProcessId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasHost && - result.host_ != global::bnet.protocol.ProcessId.DefaultInstance) { - result.host_ = global::bnet.protocol.ProcessId.CreateBuilder(result.host_).MergeFrom(value).BuildPartial(); - } else { - result.host_ = value; - } - result.hasHost = true; - return this; - } - public Builder ClearHost() { - result.hasHost = false; - result.host_ = global::bnet.protocol.ProcessId.DefaultInstance; - return this; - } - } - static GameVariablesRequest() { - object.ReferenceEquals(global::bnet.protocol.game_utilities.Proto.GameUtilities.Descriptor, null); - } - } - - public sealed partial class VariablesResponse : pb::GeneratedMessage { - private static readonly VariablesResponse defaultInstance = new Builder().BuildPartial(); - public static VariablesResponse DefaultInstance { - get { return defaultInstance; } - } - - public override VariablesResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override VariablesResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_utilities.Proto.GameUtilities.internal__static_bnet_protocol_game_utilities_VariablesResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_utilities.Proto.GameUtilities.internal__static_bnet_protocol_game_utilities_VariablesResponse__FieldAccessorTable; } - } - - public const int ValueFieldNumber = 1; - private pbc::PopsicleList value_ = new pbc::PopsicleList(); - public scg::IList ValueList { - get { return pbc::Lists.AsReadOnly(value_); } - } - public int ValueCount { - get { return value_.Count; } - } - public float GetValue(int index) { - return value_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (value_.Count > 0) { - foreach (float element in value_) { - output.WriteFloat(1, element); - } - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - dataSize = 4 * value_.Count; - size += dataSize; - size += 1 * value_.Count; - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static VariablesResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static VariablesResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static VariablesResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static VariablesResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static VariablesResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static VariablesResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static VariablesResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static VariablesResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static VariablesResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static VariablesResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(VariablesResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - VariablesResponse result = new VariablesResponse(); - - protected override VariablesResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new VariablesResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.game_utilities.VariablesResponse.Descriptor; } - } - - public override VariablesResponse DefaultInstanceForType { - get { return global::bnet.protocol.game_utilities.VariablesResponse.DefaultInstance; } - } - - public override VariablesResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.value_.MakeReadOnly(); - VariablesResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is VariablesResponse) { - return MergeFrom((VariablesResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(VariablesResponse other) { - if (other == global::bnet.protocol.game_utilities.VariablesResponse.DefaultInstance) return this; - if (other.value_.Count != 0) { - base.AddRange(other.value_, result.value_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 13: { - AddValue(input.ReadFloat()); - break; - } - } - } - } - - - public pbc::IPopsicleList ValueList { - get { return result.value_; } - } - public int ValueCount { - get { return result.ValueCount; } - } - public float GetValue(int index) { - return result.GetValue(index); - } - public Builder SetValue(int index, float value) { - result.value_[index] = value; - return this; - } - public Builder AddValue(float value) { - result.value_.Add(value); - return this; - } - public Builder AddRangeValue(scg::IEnumerable values) { - base.AddRange(values, result.value_); - return this; - } - public Builder ClearValue() { - result.value_.Clear(); - return this; - } - } - static VariablesResponse() { - object.ReferenceEquals(global::bnet.protocol.game_utilities.Proto.GameUtilities.Descriptor, null); - } - } - - #endregion - - #region Services - public abstract class GameUtilities : pb::IService { - public abstract void ProcessClientRequest( - pb::IRpcController controller, - global::bnet.protocol.game_utilities.ClientRequest request, - global::System.Action done); - public abstract void CreateToon( - pb::IRpcController controller, - global::bnet.protocol.game_utilities.CreateToonRequest request, - global::System.Action done); - public abstract void DeleteToon( - pb::IRpcController controller, - global::bnet.protocol.game_utilities.DeleteToonRequest request, - global::System.Action done); - public abstract void TransferToon( - pb::IRpcController controller, - global::bnet.protocol.game_utilities.TransferToonRequest request, - global::System.Action done); - public abstract void SelectToon( - pb::IRpcController controller, - global::bnet.protocol.game_utilities.SelectToonRequest request, - global::System.Action done); - public abstract void PresenceChannelCreated( - pb::IRpcController controller, - global::bnet.protocol.game_utilities.PresenceChannelCreatedRequest request, - global::System.Action done); - public abstract void GetPlayerVariables( - pb::IRpcController controller, - global::bnet.protocol.game_utilities.PlayerVariablesRequest request, - global::System.Action done); - public abstract void GetGameVariables( - pb::IRpcController controller, - global::bnet.protocol.game_utilities.GameVariablesRequest request, - global::System.Action done); - public abstract void GetLoad( - pb::IRpcController controller, - global::bnet.protocol.server_pool.GetLoadRequest request, - global::System.Action done); - - public static pbd::ServiceDescriptor Descriptor { - get { return Proto.GameUtilities.Descriptor.Services[0]; } - } - public pbd::ServiceDescriptor DescriptorForType { - get { return Descriptor; } - } - - public void CallMethod( - pbd::MethodDescriptor method, - pb::IRpcController controller, - pb::IMessage request, - global::System.Action done) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.CallMethod() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - this.ProcessClientRequest(controller, (global::bnet.protocol.game_utilities.ClientRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 1: - this.CreateToon(controller, (global::bnet.protocol.game_utilities.CreateToonRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 2: - this.DeleteToon(controller, (global::bnet.protocol.game_utilities.DeleteToonRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 3: - this.TransferToon(controller, (global::bnet.protocol.game_utilities.TransferToonRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 4: - this.SelectToon(controller, (global::bnet.protocol.game_utilities.SelectToonRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 5: - this.PresenceChannelCreated(controller, (global::bnet.protocol.game_utilities.PresenceChannelCreatedRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 6: - this.GetPlayerVariables(controller, (global::bnet.protocol.game_utilities.PlayerVariablesRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 7: - this.GetGameVariables(controller, (global::bnet.protocol.game_utilities.GameVariablesRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 8: - this.GetLoad(controller, (global::bnet.protocol.server_pool.GetLoadRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetRequestPrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::bnet.protocol.game_utilities.ClientRequest.DefaultInstance; - case 1: - return global::bnet.protocol.game_utilities.CreateToonRequest.DefaultInstance; - case 2: - return global::bnet.protocol.game_utilities.DeleteToonRequest.DefaultInstance; - case 3: - return global::bnet.protocol.game_utilities.TransferToonRequest.DefaultInstance; - case 4: - return global::bnet.protocol.game_utilities.SelectToonRequest.DefaultInstance; - case 5: - return global::bnet.protocol.game_utilities.PresenceChannelCreatedRequest.DefaultInstance; - case 6: - return global::bnet.protocol.game_utilities.PlayerVariablesRequest.DefaultInstance; - case 7: - return global::bnet.protocol.game_utilities.GameVariablesRequest.DefaultInstance; - case 8: - return global::bnet.protocol.server_pool.GetLoadRequest.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetResponsePrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::bnet.protocol.game_utilities.ClientResponse.DefaultInstance; - case 1: - return global::bnet.protocol.game_utilities.CreateToonResponse.DefaultInstance; - case 2: - return global::bnet.protocol.NoData.DefaultInstance; - case 3: - return global::bnet.protocol.NoData.DefaultInstance; - case 4: - return global::bnet.protocol.NoData.DefaultInstance; - case 5: - return global::bnet.protocol.NoData.DefaultInstance; - case 6: - return global::bnet.protocol.game_utilities.VariablesResponse.DefaultInstance; - case 7: - return global::bnet.protocol.game_utilities.VariablesResponse.DefaultInstance; - case 8: - return global::bnet.protocol.server_pool.ServerState.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public static Stub CreateStub(pb::IRpcChannel channel) { - return new Stub(channel); - } - - public class Stub : global::bnet.protocol.game_utilities.GameUtilities { - internal Stub(pb::IRpcChannel channel) { - this.channel = channel; - } - - private readonly pb::IRpcChannel channel; - - public pb::IRpcChannel Channel { - get { return channel; } - } - - public override void ProcessClientRequest( - pb::IRpcController controller, - global::bnet.protocol.game_utilities.ClientRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[0], - controller, request, global::bnet.protocol.game_utilities.ClientResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.game_utilities.ClientResponse.DefaultInstance)); - } - - public override void CreateToon( - pb::IRpcController controller, - global::bnet.protocol.game_utilities.CreateToonRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[1], - controller, request, global::bnet.protocol.game_utilities.CreateToonResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.game_utilities.CreateToonResponse.DefaultInstance)); - } - - public override void DeleteToon( - pb::IRpcController controller, - global::bnet.protocol.game_utilities.DeleteToonRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[2], - controller, request, global::bnet.protocol.NoData.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); - } - - public override void TransferToon( - pb::IRpcController controller, - global::bnet.protocol.game_utilities.TransferToonRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[3], - controller, request, global::bnet.protocol.NoData.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); - } - - public override void SelectToon( - pb::IRpcController controller, - global::bnet.protocol.game_utilities.SelectToonRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[4], - controller, request, global::bnet.protocol.NoData.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); - } - - public override void PresenceChannelCreated( - pb::IRpcController controller, - global::bnet.protocol.game_utilities.PresenceChannelCreatedRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[5], - controller, request, global::bnet.protocol.NoData.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); - } - - public override void GetPlayerVariables( - pb::IRpcController controller, - global::bnet.protocol.game_utilities.PlayerVariablesRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[6], - controller, request, global::bnet.protocol.game_utilities.VariablesResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.game_utilities.VariablesResponse.DefaultInstance)); - } - - public override void GetGameVariables( - pb::IRpcController controller, - global::bnet.protocol.game_utilities.GameVariablesRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[7], - controller, request, global::bnet.protocol.game_utilities.VariablesResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.game_utilities.VariablesResponse.DefaultInstance)); - } - - public override void GetLoad( - pb::IRpcController controller, - global::bnet.protocol.server_pool.GetLoadRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[8], - controller, request, global::bnet.protocol.server_pool.ServerState.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.server_pool.ServerState.DefaultInstance)); - } - } - } - #endregion - -} diff --git a/source/D3Proto/bnet/protocol/invitation/Invitation.cs b/source/D3Proto/bnet/protocol/invitation/Invitation.cs deleted file mode 100644 index a4728d90..00000000 --- a/source/D3Proto/bnet/protocol/invitation/Invitation.cs +++ /dev/null @@ -1,2100 +0,0 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace bnet.protocol.invitation { - - namespace Proto { - - public static partial class Invitation { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_bnet_protocol_invitation_Invitation__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_invitation_Invitation__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_invitation_Suggestion__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_invitation_Suggestion__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_invitation_SendInvitationRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_invitation_SendInvitationRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_invitation_SendInvitationResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_invitation_SendInvitationResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_invitation_GenericRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_invitation_GenericRequest__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static Invitation() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "Ch1saWIvcHJvdG9jb2wvaW52aXRhdGlvbi5wcm90bxIYYm5ldC5wcm90b2Nv" + - "bC5pbnZpdGF0aW9uGhxsaWIvcHJvdG9jb2wvYXR0cmlidXRlLnByb3RvGhls" + - "aWIvcHJvdG9jb2wvZW50aXR5LnByb3RvIv0BCgpJbnZpdGF0aW9uEgoKAmlk" + - "GAEgAigGEjEKEGludml0ZXJfaWRlbnRpdHkYAiACKAsyFy5ibmV0LnByb3Rv" + - "Y29sLklkZW50aXR5EjEKEGludml0ZWVfaWRlbnRpdHkYAyACKAsyFy5ibmV0" + - "LnByb3RvY29sLklkZW50aXR5EhQKDGludml0ZXJfbmFtZRgEIAEoCRIUCgxp" + - "bnZpdGVlX25hbWUYBSABKAkSGgoSaW52aXRhdGlvbl9tZXNzYWdlGAYgASgJ" + - "EhUKDWNyZWF0aW9uX3RpbWUYByABKAQSFwoPZXhwaXJhdGlvbl90aW1lGAgg" + - "ASgEKgUIZBCQTiLHAQoKU3VnZ2VzdGlvbhIrCgpjaGFubmVsX2lkGAEgASgL" + - "MhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBItCgxzdWdnZXN0ZXJfaWQYAiAC" + - "KAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEi0KDHN1Z2dlc3RlZV9pZBgD" + - "IAIoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSFgoOc3VnZ2VzdGVyX25h" + - "bWUYBCABKAkSFgoOc3VnZ2VzdGVlX25hbWUYBSABKAkiswEKFVNlbmRJbnZp" + - "dGF0aW9uUmVxdWVzdBIvCg5hZ2VudF9pZGVudGl0eRgBIAEoCzIXLmJuZXQu" + - "cHJvdG9jb2wuSWRlbnRpdHkSKgoJdGFyZ2V0X2lkGAIgAigLMhcuYm5ldC5w" + - "cm90b2NvbC5FbnRpdHlJZBIaChJpbnZpdGF0aW9uX21lc3NhZ2UYAyABKAkS" + - "GgoPZXhwaXJhdGlvbl90aW1lGAQgASgEOgEwKgUIZBCQTiJSChZTZW5kSW52" + - "aXRhdGlvblJlc3BvbnNlEjgKCmludml0YXRpb24YAiABKAsyJC5ibmV0LnBy" + - "b3RvY29sLmludml0YXRpb24uSW52aXRhdGlvbiJ+Cg5HZW5lcmljUmVxdWVz" + - "dBIpCghhZ2VudF9pZBgBIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQS" + - "KgoJdGFyZ2V0X2lkGAIgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBIV" + - "Cg1pbnZpdGF0aW9uX2lkGAMgAigGQg1CC0NJbnZpdGF0aW9u"); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_bnet_protocol_invitation_Invitation__Descriptor = Descriptor.MessageTypes[0]; - internal__static_bnet_protocol_invitation_Invitation__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_invitation_Invitation__Descriptor, - new string[] { "Id", "InviterIdentity", "InviteeIdentity", "InviterName", "InviteeName", "InvitationMessage", "CreationTime", "ExpirationTime", }); - internal__static_bnet_protocol_invitation_Suggestion__Descriptor = Descriptor.MessageTypes[1]; - internal__static_bnet_protocol_invitation_Suggestion__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_invitation_Suggestion__Descriptor, - new string[] { "ChannelId", "SuggesterId", "SuggesteeId", "SuggesterName", "SuggesteeName", }); - internal__static_bnet_protocol_invitation_SendInvitationRequest__Descriptor = Descriptor.MessageTypes[2]; - internal__static_bnet_protocol_invitation_SendInvitationRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_invitation_SendInvitationRequest__Descriptor, - new string[] { "AgentIdentity", "TargetId", "InvitationMessage", "ExpirationTime", }); - internal__static_bnet_protocol_invitation_SendInvitationResponse__Descriptor = Descriptor.MessageTypes[3]; - internal__static_bnet_protocol_invitation_SendInvitationResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_invitation_SendInvitationResponse__Descriptor, - new string[] { "Invitation", }); - internal__static_bnet_protocol_invitation_GenericRequest__Descriptor = Descriptor.MessageTypes[4]; - internal__static_bnet_protocol_invitation_GenericRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_invitation_GenericRequest__Descriptor, - new string[] { "AgentId", "TargetId", "InvitationId", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::bnet.protocol.attribute.Proto.Attribute.Descriptor, - global::bnet.protocol.Entity.Descriptor, - }, assigner); - } - #endregion - - } - } - #region Messages - public sealed partial class Invitation : pb::ExtendableMessage { - private static readonly Invitation defaultInstance = new Builder().BuildPartial(); - public static Invitation DefaultInstance { - get { return defaultInstance; } - } - - public override Invitation DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override Invitation ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.invitation.Proto.Invitation.internal__static_bnet_protocol_invitation_Invitation__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.invitation.Proto.Invitation.internal__static_bnet_protocol_invitation_Invitation__FieldAccessorTable; } - } - - public const int IdFieldNumber = 1; - private bool hasId; - private ulong id_ = 0; - public bool HasId { - get { return hasId; } - } - public ulong Id { - get { return id_; } - } - - public const int InviterIdentityFieldNumber = 2; - private bool hasInviterIdentity; - private global::bnet.protocol.Identity inviterIdentity_ = global::bnet.protocol.Identity.DefaultInstance; - public bool HasInviterIdentity { - get { return hasInviterIdentity; } - } - public global::bnet.protocol.Identity InviterIdentity { - get { return inviterIdentity_; } - } - - public const int InviteeIdentityFieldNumber = 3; - private bool hasInviteeIdentity; - private global::bnet.protocol.Identity inviteeIdentity_ = global::bnet.protocol.Identity.DefaultInstance; - public bool HasInviteeIdentity { - get { return hasInviteeIdentity; } - } - public global::bnet.protocol.Identity InviteeIdentity { - get { return inviteeIdentity_; } - } - - public const int InviterNameFieldNumber = 4; - private bool hasInviterName; - private string inviterName_ = ""; - public bool HasInviterName { - get { return hasInviterName; } - } - public string InviterName { - get { return inviterName_; } - } - - public const int InviteeNameFieldNumber = 5; - private bool hasInviteeName; - private string inviteeName_ = ""; - public bool HasInviteeName { - get { return hasInviteeName; } - } - public string InviteeName { - get { return inviteeName_; } - } - - public const int InvitationMessageFieldNumber = 6; - private bool hasInvitationMessage; - private string invitationMessage_ = ""; - public bool HasInvitationMessage { - get { return hasInvitationMessage; } - } - public string InvitationMessage { - get { return invitationMessage_; } - } - - public const int CreationTimeFieldNumber = 7; - private bool hasCreationTime; - private ulong creationTime_ = 0UL; - public bool HasCreationTime { - get { return hasCreationTime; } - } - public ulong CreationTime { - get { return creationTime_; } - } - - public const int ExpirationTimeFieldNumber = 8; - private bool hasExpirationTime; - private ulong expirationTime_ = 0UL; - public bool HasExpirationTime { - get { return hasExpirationTime; } - } - public ulong ExpirationTime { - get { return expirationTime_; } - } - - public override bool IsInitialized { - get { - if (!hasId) return false; - if (!hasInviterIdentity) return false; - if (!hasInviteeIdentity) return false; - if (!InviterIdentity.IsInitialized) return false; - if (!InviteeIdentity.IsInitialized) return false; - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - if (HasId) { - output.WriteFixed64(1, Id); - } - if (HasInviterIdentity) { - output.WriteMessage(2, InviterIdentity); - } - if (HasInviteeIdentity) { - output.WriteMessage(3, InviteeIdentity); - } - if (HasInviterName) { - output.WriteString(4, InviterName); - } - if (HasInviteeName) { - output.WriteString(5, InviteeName); - } - if (HasInvitationMessage) { - output.WriteString(6, InvitationMessage); - } - if (HasCreationTime) { - output.WriteUInt64(7, CreationTime); - } - if (HasExpirationTime) { - output.WriteUInt64(8, ExpirationTime); - } - extensionWriter.WriteUntil(10000, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasId) { - size += pb::CodedOutputStream.ComputeFixed64Size(1, Id); - } - if (HasInviterIdentity) { - size += pb::CodedOutputStream.ComputeMessageSize(2, InviterIdentity); - } - if (HasInviteeIdentity) { - size += pb::CodedOutputStream.ComputeMessageSize(3, InviteeIdentity); - } - if (HasInviterName) { - size += pb::CodedOutputStream.ComputeStringSize(4, InviterName); - } - if (HasInviteeName) { - size += pb::CodedOutputStream.ComputeStringSize(5, InviteeName); - } - if (HasInvitationMessage) { - size += pb::CodedOutputStream.ComputeStringSize(6, InvitationMessage); - } - if (HasCreationTime) { - size += pb::CodedOutputStream.ComputeUInt64Size(7, CreationTime); - } - if (HasExpirationTime) { - size += pb::CodedOutputStream.ComputeUInt64Size(8, ExpirationTime); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static Invitation ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Invitation ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Invitation ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Invitation ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Invitation ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Invitation ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Invitation ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Invitation ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Invitation ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Invitation ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Invitation prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - Invitation result = new Invitation(); - - protected override Invitation MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new Invitation(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.invitation.Invitation.Descriptor; } - } - - public override Invitation DefaultInstanceForType { - get { return global::bnet.protocol.invitation.Invitation.DefaultInstance; } - } - - public override Invitation BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - Invitation returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Invitation) { - return MergeFrom((Invitation) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Invitation other) { - if (other == global::bnet.protocol.invitation.Invitation.DefaultInstance) return this; - if (other.HasId) { - Id = other.Id; - } - if (other.HasInviterIdentity) { - MergeInviterIdentity(other.InviterIdentity); - } - if (other.HasInviteeIdentity) { - MergeInviteeIdentity(other.InviteeIdentity); - } - if (other.HasInviterName) { - InviterName = other.InviterName; - } - if (other.HasInviteeName) { - InviteeName = other.InviteeName; - } - if (other.HasInvitationMessage) { - InvitationMessage = other.InvitationMessage; - } - if (other.HasCreationTime) { - CreationTime = other.CreationTime; - } - if (other.HasExpirationTime) { - ExpirationTime = other.ExpirationTime; - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 9: { - Id = input.ReadFixed64(); - break; - } - case 18: { - global::bnet.protocol.Identity.Builder subBuilder = global::bnet.protocol.Identity.CreateBuilder(); - if (HasInviterIdentity) { - subBuilder.MergeFrom(InviterIdentity); - } - input.ReadMessage(subBuilder, extensionRegistry); - InviterIdentity = subBuilder.BuildPartial(); - break; - } - case 26: { - global::bnet.protocol.Identity.Builder subBuilder = global::bnet.protocol.Identity.CreateBuilder(); - if (HasInviteeIdentity) { - subBuilder.MergeFrom(InviteeIdentity); - } - input.ReadMessage(subBuilder, extensionRegistry); - InviteeIdentity = subBuilder.BuildPartial(); - break; - } - case 34: { - InviterName = input.ReadString(); - break; - } - case 42: { - InviteeName = input.ReadString(); - break; - } - case 50: { - InvitationMessage = input.ReadString(); - break; - } - case 56: { - CreationTime = input.ReadUInt64(); - break; - } - case 64: { - ExpirationTime = input.ReadUInt64(); - break; - } - } - } - } - - - public bool HasId { - get { return result.HasId; } - } - public ulong Id { - get { return result.Id; } - set { SetId(value); } - } - public Builder SetId(ulong value) { - result.hasId = true; - result.id_ = value; - return this; - } - public Builder ClearId() { - result.hasId = false; - result.id_ = 0; - return this; - } - - public bool HasInviterIdentity { - get { return result.HasInviterIdentity; } - } - public global::bnet.protocol.Identity InviterIdentity { - get { return result.InviterIdentity; } - set { SetInviterIdentity(value); } - } - public Builder SetInviterIdentity(global::bnet.protocol.Identity value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasInviterIdentity = true; - result.inviterIdentity_ = value; - return this; - } - public Builder SetInviterIdentity(global::bnet.protocol.Identity.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasInviterIdentity = true; - result.inviterIdentity_ = builderForValue.Build(); - return this; - } - public Builder MergeInviterIdentity(global::bnet.protocol.Identity value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasInviterIdentity && - result.inviterIdentity_ != global::bnet.protocol.Identity.DefaultInstance) { - result.inviterIdentity_ = global::bnet.protocol.Identity.CreateBuilder(result.inviterIdentity_).MergeFrom(value).BuildPartial(); - } else { - result.inviterIdentity_ = value; - } - result.hasInviterIdentity = true; - return this; - } - public Builder ClearInviterIdentity() { - result.hasInviterIdentity = false; - result.inviterIdentity_ = global::bnet.protocol.Identity.DefaultInstance; - return this; - } - - public bool HasInviteeIdentity { - get { return result.HasInviteeIdentity; } - } - public global::bnet.protocol.Identity InviteeIdentity { - get { return result.InviteeIdentity; } - set { SetInviteeIdentity(value); } - } - public Builder SetInviteeIdentity(global::bnet.protocol.Identity value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasInviteeIdentity = true; - result.inviteeIdentity_ = value; - return this; - } - public Builder SetInviteeIdentity(global::bnet.protocol.Identity.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasInviteeIdentity = true; - result.inviteeIdentity_ = builderForValue.Build(); - return this; - } - public Builder MergeInviteeIdentity(global::bnet.protocol.Identity value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasInviteeIdentity && - result.inviteeIdentity_ != global::bnet.protocol.Identity.DefaultInstance) { - result.inviteeIdentity_ = global::bnet.protocol.Identity.CreateBuilder(result.inviteeIdentity_).MergeFrom(value).BuildPartial(); - } else { - result.inviteeIdentity_ = value; - } - result.hasInviteeIdentity = true; - return this; - } - public Builder ClearInviteeIdentity() { - result.hasInviteeIdentity = false; - result.inviteeIdentity_ = global::bnet.protocol.Identity.DefaultInstance; - return this; - } - - public bool HasInviterName { - get { return result.HasInviterName; } - } - public string InviterName { - get { return result.InviterName; } - set { SetInviterName(value); } - } - public Builder SetInviterName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasInviterName = true; - result.inviterName_ = value; - return this; - } - public Builder ClearInviterName() { - result.hasInviterName = false; - result.inviterName_ = ""; - return this; - } - - public bool HasInviteeName { - get { return result.HasInviteeName; } - } - public string InviteeName { - get { return result.InviteeName; } - set { SetInviteeName(value); } - } - public Builder SetInviteeName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasInviteeName = true; - result.inviteeName_ = value; - return this; - } - public Builder ClearInviteeName() { - result.hasInviteeName = false; - result.inviteeName_ = ""; - return this; - } - - public bool HasInvitationMessage { - get { return result.HasInvitationMessage; } - } - public string InvitationMessage { - get { return result.InvitationMessage; } - set { SetInvitationMessage(value); } - } - public Builder SetInvitationMessage(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasInvitationMessage = true; - result.invitationMessage_ = value; - return this; - } - public Builder ClearInvitationMessage() { - result.hasInvitationMessage = false; - result.invitationMessage_ = ""; - return this; - } - - public bool HasCreationTime { - get { return result.HasCreationTime; } - } - public ulong CreationTime { - get { return result.CreationTime; } - set { SetCreationTime(value); } - } - public Builder SetCreationTime(ulong value) { - result.hasCreationTime = true; - result.creationTime_ = value; - return this; - } - public Builder ClearCreationTime() { - result.hasCreationTime = false; - result.creationTime_ = 0UL; - return this; - } - - public bool HasExpirationTime { - get { return result.HasExpirationTime; } - } - public ulong ExpirationTime { - get { return result.ExpirationTime; } - set { SetExpirationTime(value); } - } - public Builder SetExpirationTime(ulong value) { - result.hasExpirationTime = true; - result.expirationTime_ = value; - return this; - } - public Builder ClearExpirationTime() { - result.hasExpirationTime = false; - result.expirationTime_ = 0UL; - return this; - } - } - static Invitation() { - object.ReferenceEquals(global::bnet.protocol.invitation.Proto.Invitation.Descriptor, null); - } - } - - public sealed partial class Suggestion : pb::GeneratedMessage { - private static readonly Suggestion defaultInstance = new Builder().BuildPartial(); - public static Suggestion DefaultInstance { - get { return defaultInstance; } - } - - public override Suggestion DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override Suggestion ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.invitation.Proto.Invitation.internal__static_bnet_protocol_invitation_Suggestion__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.invitation.Proto.Invitation.internal__static_bnet_protocol_invitation_Suggestion__FieldAccessorTable; } - } - - public const int ChannelIdFieldNumber = 1; - private bool hasChannelId; - private global::bnet.protocol.EntityId channelId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasChannelId { - get { return hasChannelId; } - } - public global::bnet.protocol.EntityId ChannelId { - get { return channelId_; } - } - - public const int SuggesterIdFieldNumber = 2; - private bool hasSuggesterId; - private global::bnet.protocol.EntityId suggesterId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasSuggesterId { - get { return hasSuggesterId; } - } - public global::bnet.protocol.EntityId SuggesterId { - get { return suggesterId_; } - } - - public const int SuggesteeIdFieldNumber = 3; - private bool hasSuggesteeId; - private global::bnet.protocol.EntityId suggesteeId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasSuggesteeId { - get { return hasSuggesteeId; } - } - public global::bnet.protocol.EntityId SuggesteeId { - get { return suggesteeId_; } - } - - public const int SuggesterNameFieldNumber = 4; - private bool hasSuggesterName; - private string suggesterName_ = ""; - public bool HasSuggesterName { - get { return hasSuggesterName; } - } - public string SuggesterName { - get { return suggesterName_; } - } - - public const int SuggesteeNameFieldNumber = 5; - private bool hasSuggesteeName; - private string suggesteeName_ = ""; - public bool HasSuggesteeName { - get { return hasSuggesteeName; } - } - public string SuggesteeName { - get { return suggesteeName_; } - } - - public override bool IsInitialized { - get { - if (!hasSuggesterId) return false; - if (!hasSuggesteeId) return false; - if (HasChannelId) { - if (!ChannelId.IsInitialized) return false; - } - if (!SuggesterId.IsInitialized) return false; - if (!SuggesteeId.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasChannelId) { - output.WriteMessage(1, ChannelId); - } - if (HasSuggesterId) { - output.WriteMessage(2, SuggesterId); - } - if (HasSuggesteeId) { - output.WriteMessage(3, SuggesteeId); - } - if (HasSuggesterName) { - output.WriteString(4, SuggesterName); - } - if (HasSuggesteeName) { - output.WriteString(5, SuggesteeName); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasChannelId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, ChannelId); - } - if (HasSuggesterId) { - size += pb::CodedOutputStream.ComputeMessageSize(2, SuggesterId); - } - if (HasSuggesteeId) { - size += pb::CodedOutputStream.ComputeMessageSize(3, SuggesteeId); - } - if (HasSuggesterName) { - size += pb::CodedOutputStream.ComputeStringSize(4, SuggesterName); - } - if (HasSuggesteeName) { - size += pb::CodedOutputStream.ComputeStringSize(5, SuggesteeName); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static Suggestion ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Suggestion ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Suggestion ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Suggestion ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Suggestion ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Suggestion ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Suggestion ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Suggestion ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Suggestion ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Suggestion ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Suggestion prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - Suggestion result = new Suggestion(); - - protected override Suggestion MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new Suggestion(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.invitation.Suggestion.Descriptor; } - } - - public override Suggestion DefaultInstanceForType { - get { return global::bnet.protocol.invitation.Suggestion.DefaultInstance; } - } - - public override Suggestion BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - Suggestion returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Suggestion) { - return MergeFrom((Suggestion) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Suggestion other) { - if (other == global::bnet.protocol.invitation.Suggestion.DefaultInstance) return this; - if (other.HasChannelId) { - MergeChannelId(other.ChannelId); - } - if (other.HasSuggesterId) { - MergeSuggesterId(other.SuggesterId); - } - if (other.HasSuggesteeId) { - MergeSuggesteeId(other.SuggesteeId); - } - if (other.HasSuggesterName) { - SuggesterName = other.SuggesterName; - } - if (other.HasSuggesteeName) { - SuggesteeName = other.SuggesteeName; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasChannelId) { - subBuilder.MergeFrom(ChannelId); - } - input.ReadMessage(subBuilder, extensionRegistry); - ChannelId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasSuggesterId) { - subBuilder.MergeFrom(SuggesterId); - } - input.ReadMessage(subBuilder, extensionRegistry); - SuggesterId = subBuilder.BuildPartial(); - break; - } - case 26: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasSuggesteeId) { - subBuilder.MergeFrom(SuggesteeId); - } - input.ReadMessage(subBuilder, extensionRegistry); - SuggesteeId = subBuilder.BuildPartial(); - break; - } - case 34: { - SuggesterName = input.ReadString(); - break; - } - case 42: { - SuggesteeName = input.ReadString(); - break; - } - } - } - } - - - public bool HasChannelId { - get { return result.HasChannelId; } - } - public global::bnet.protocol.EntityId ChannelId { - get { return result.ChannelId; } - set { SetChannelId(value); } - } - public Builder SetChannelId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasChannelId = true; - result.channelId_ = value; - return this; - } - public Builder SetChannelId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasChannelId = true; - result.channelId_ = builderForValue.Build(); - return this; - } - public Builder MergeChannelId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasChannelId && - result.channelId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.channelId_ = global::bnet.protocol.EntityId.CreateBuilder(result.channelId_).MergeFrom(value).BuildPartial(); - } else { - result.channelId_ = value; - } - result.hasChannelId = true; - return this; - } - public Builder ClearChannelId() { - result.hasChannelId = false; - result.channelId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasSuggesterId { - get { return result.HasSuggesterId; } - } - public global::bnet.protocol.EntityId SuggesterId { - get { return result.SuggesterId; } - set { SetSuggesterId(value); } - } - public Builder SetSuggesterId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasSuggesterId = true; - result.suggesterId_ = value; - return this; - } - public Builder SetSuggesterId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasSuggesterId = true; - result.suggesterId_ = builderForValue.Build(); - return this; - } - public Builder MergeSuggesterId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasSuggesterId && - result.suggesterId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.suggesterId_ = global::bnet.protocol.EntityId.CreateBuilder(result.suggesterId_).MergeFrom(value).BuildPartial(); - } else { - result.suggesterId_ = value; - } - result.hasSuggesterId = true; - return this; - } - public Builder ClearSuggesterId() { - result.hasSuggesterId = false; - result.suggesterId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasSuggesteeId { - get { return result.HasSuggesteeId; } - } - public global::bnet.protocol.EntityId SuggesteeId { - get { return result.SuggesteeId; } - set { SetSuggesteeId(value); } - } - public Builder SetSuggesteeId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasSuggesteeId = true; - result.suggesteeId_ = value; - return this; - } - public Builder SetSuggesteeId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasSuggesteeId = true; - result.suggesteeId_ = builderForValue.Build(); - return this; - } - public Builder MergeSuggesteeId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasSuggesteeId && - result.suggesteeId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.suggesteeId_ = global::bnet.protocol.EntityId.CreateBuilder(result.suggesteeId_).MergeFrom(value).BuildPartial(); - } else { - result.suggesteeId_ = value; - } - result.hasSuggesteeId = true; - return this; - } - public Builder ClearSuggesteeId() { - result.hasSuggesteeId = false; - result.suggesteeId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasSuggesterName { - get { return result.HasSuggesterName; } - } - public string SuggesterName { - get { return result.SuggesterName; } - set { SetSuggesterName(value); } - } - public Builder SetSuggesterName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasSuggesterName = true; - result.suggesterName_ = value; - return this; - } - public Builder ClearSuggesterName() { - result.hasSuggesterName = false; - result.suggesterName_ = ""; - return this; - } - - public bool HasSuggesteeName { - get { return result.HasSuggesteeName; } - } - public string SuggesteeName { - get { return result.SuggesteeName; } - set { SetSuggesteeName(value); } - } - public Builder SetSuggesteeName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasSuggesteeName = true; - result.suggesteeName_ = value; - return this; - } - public Builder ClearSuggesteeName() { - result.hasSuggesteeName = false; - result.suggesteeName_ = ""; - return this; - } - } - static Suggestion() { - object.ReferenceEquals(global::bnet.protocol.invitation.Proto.Invitation.Descriptor, null); - } - } - - public sealed partial class SendInvitationRequest : pb::ExtendableMessage { - private static readonly SendInvitationRequest defaultInstance = new Builder().BuildPartial(); - public static SendInvitationRequest DefaultInstance { - get { return defaultInstance; } - } - - public override SendInvitationRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override SendInvitationRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.invitation.Proto.Invitation.internal__static_bnet_protocol_invitation_SendInvitationRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.invitation.Proto.Invitation.internal__static_bnet_protocol_invitation_SendInvitationRequest__FieldAccessorTable; } - } - - public const int AgentIdentityFieldNumber = 1; - private bool hasAgentIdentity; - private global::bnet.protocol.Identity agentIdentity_ = global::bnet.protocol.Identity.DefaultInstance; - public bool HasAgentIdentity { - get { return hasAgentIdentity; } - } - public global::bnet.protocol.Identity AgentIdentity { - get { return agentIdentity_; } - } - - public const int TargetIdFieldNumber = 2; - private bool hasTargetId; - private global::bnet.protocol.EntityId targetId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasTargetId { - get { return hasTargetId; } - } - public global::bnet.protocol.EntityId TargetId { - get { return targetId_; } - } - - public const int InvitationMessageFieldNumber = 3; - private bool hasInvitationMessage; - private string invitationMessage_ = ""; - public bool HasInvitationMessage { - get { return hasInvitationMessage; } - } - public string InvitationMessage { - get { return invitationMessage_; } - } - - public const int ExpirationTimeFieldNumber = 4; - private bool hasExpirationTime; - private ulong expirationTime_ = 0UL; - public bool HasExpirationTime { - get { return hasExpirationTime; } - } - public ulong ExpirationTime { - get { return expirationTime_; } - } - - public override bool IsInitialized { - get { - if (!hasTargetId) return false; - if (HasAgentIdentity) { - if (!AgentIdentity.IsInitialized) return false; - } - if (!TargetId.IsInitialized) return false; - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - if (HasAgentIdentity) { - output.WriteMessage(1, AgentIdentity); - } - if (HasTargetId) { - output.WriteMessage(2, TargetId); - } - if (HasInvitationMessage) { - output.WriteString(3, InvitationMessage); - } - if (HasExpirationTime) { - output.WriteUInt64(4, ExpirationTime); - } - extensionWriter.WriteUntil(10000, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasAgentIdentity) { - size += pb::CodedOutputStream.ComputeMessageSize(1, AgentIdentity); - } - if (HasTargetId) { - size += pb::CodedOutputStream.ComputeMessageSize(2, TargetId); - } - if (HasInvitationMessage) { - size += pb::CodedOutputStream.ComputeStringSize(3, InvitationMessage); - } - if (HasExpirationTime) { - size += pb::CodedOutputStream.ComputeUInt64Size(4, ExpirationTime); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static SendInvitationRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SendInvitationRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SendInvitationRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SendInvitationRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SendInvitationRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SendInvitationRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SendInvitationRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SendInvitationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SendInvitationRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SendInvitationRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SendInvitationRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - SendInvitationRequest result = new SendInvitationRequest(); - - protected override SendInvitationRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new SendInvitationRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.invitation.SendInvitationRequest.Descriptor; } - } - - public override SendInvitationRequest DefaultInstanceForType { - get { return global::bnet.protocol.invitation.SendInvitationRequest.DefaultInstance; } - } - - public override SendInvitationRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - SendInvitationRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SendInvitationRequest) { - return MergeFrom((SendInvitationRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SendInvitationRequest other) { - if (other == global::bnet.protocol.invitation.SendInvitationRequest.DefaultInstance) return this; - if (other.HasAgentIdentity) { - MergeAgentIdentity(other.AgentIdentity); - } - if (other.HasTargetId) { - MergeTargetId(other.TargetId); - } - if (other.HasInvitationMessage) { - InvitationMessage = other.InvitationMessage; - } - if (other.HasExpirationTime) { - ExpirationTime = other.ExpirationTime; - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.Identity.Builder subBuilder = global::bnet.protocol.Identity.CreateBuilder(); - if (HasAgentIdentity) { - subBuilder.MergeFrom(AgentIdentity); - } - input.ReadMessage(subBuilder, extensionRegistry); - AgentIdentity = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasTargetId) { - subBuilder.MergeFrom(TargetId); - } - input.ReadMessage(subBuilder, extensionRegistry); - TargetId = subBuilder.BuildPartial(); - break; - } - case 26: { - InvitationMessage = input.ReadString(); - break; - } - case 32: { - ExpirationTime = input.ReadUInt64(); - break; - } - } - } - } - - - public bool HasAgentIdentity { - get { return result.HasAgentIdentity; } - } - public global::bnet.protocol.Identity AgentIdentity { - get { return result.AgentIdentity; } - set { SetAgentIdentity(value); } - } - public Builder SetAgentIdentity(global::bnet.protocol.Identity value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasAgentIdentity = true; - result.agentIdentity_ = value; - return this; - } - public Builder SetAgentIdentity(global::bnet.protocol.Identity.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasAgentIdentity = true; - result.agentIdentity_ = builderForValue.Build(); - return this; - } - public Builder MergeAgentIdentity(global::bnet.protocol.Identity value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentIdentity && - result.agentIdentity_ != global::bnet.protocol.Identity.DefaultInstance) { - result.agentIdentity_ = global::bnet.protocol.Identity.CreateBuilder(result.agentIdentity_).MergeFrom(value).BuildPartial(); - } else { - result.agentIdentity_ = value; - } - result.hasAgentIdentity = true; - return this; - } - public Builder ClearAgentIdentity() { - result.hasAgentIdentity = false; - result.agentIdentity_ = global::bnet.protocol.Identity.DefaultInstance; - return this; - } - - public bool HasTargetId { - get { return result.HasTargetId; } - } - public global::bnet.protocol.EntityId TargetId { - get { return result.TargetId; } - set { SetTargetId(value); } - } - public Builder SetTargetId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasTargetId = true; - result.targetId_ = value; - return this; - } - public Builder SetTargetId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasTargetId = true; - result.targetId_ = builderForValue.Build(); - return this; - } - public Builder MergeTargetId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasTargetId && - result.targetId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.targetId_ = global::bnet.protocol.EntityId.CreateBuilder(result.targetId_).MergeFrom(value).BuildPartial(); - } else { - result.targetId_ = value; - } - result.hasTargetId = true; - return this; - } - public Builder ClearTargetId() { - result.hasTargetId = false; - result.targetId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasInvitationMessage { - get { return result.HasInvitationMessage; } - } - public string InvitationMessage { - get { return result.InvitationMessage; } - set { SetInvitationMessage(value); } - } - public Builder SetInvitationMessage(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasInvitationMessage = true; - result.invitationMessage_ = value; - return this; - } - public Builder ClearInvitationMessage() { - result.hasInvitationMessage = false; - result.invitationMessage_ = ""; - return this; - } - - public bool HasExpirationTime { - get { return result.HasExpirationTime; } - } - public ulong ExpirationTime { - get { return result.ExpirationTime; } - set { SetExpirationTime(value); } - } - public Builder SetExpirationTime(ulong value) { - result.hasExpirationTime = true; - result.expirationTime_ = value; - return this; - } - public Builder ClearExpirationTime() { - result.hasExpirationTime = false; - result.expirationTime_ = 0UL; - return this; - } - } - static SendInvitationRequest() { - object.ReferenceEquals(global::bnet.protocol.invitation.Proto.Invitation.Descriptor, null); - } - } - - public sealed partial class SendInvitationResponse : pb::GeneratedMessage { - private static readonly SendInvitationResponse defaultInstance = new Builder().BuildPartial(); - public static SendInvitationResponse DefaultInstance { - get { return defaultInstance; } - } - - public override SendInvitationResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override SendInvitationResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.invitation.Proto.Invitation.internal__static_bnet_protocol_invitation_SendInvitationResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.invitation.Proto.Invitation.internal__static_bnet_protocol_invitation_SendInvitationResponse__FieldAccessorTable; } - } - - public const int InvitationFieldNumber = 2; - private bool hasInvitation; - private global::bnet.protocol.invitation.Invitation invitation_ = global::bnet.protocol.invitation.Invitation.DefaultInstance; - public bool HasInvitation { - get { return hasInvitation; } - } - public global::bnet.protocol.invitation.Invitation Invitation { - get { return invitation_; } - } - - public override bool IsInitialized { - get { - if (HasInvitation) { - if (!Invitation.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasInvitation) { - output.WriteMessage(2, Invitation); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasInvitation) { - size += pb::CodedOutputStream.ComputeMessageSize(2, Invitation); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static SendInvitationResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SendInvitationResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SendInvitationResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SendInvitationResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SendInvitationResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SendInvitationResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SendInvitationResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SendInvitationResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SendInvitationResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SendInvitationResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SendInvitationResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - SendInvitationResponse result = new SendInvitationResponse(); - - protected override SendInvitationResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new SendInvitationResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.invitation.SendInvitationResponse.Descriptor; } - } - - public override SendInvitationResponse DefaultInstanceForType { - get { return global::bnet.protocol.invitation.SendInvitationResponse.DefaultInstance; } - } - - public override SendInvitationResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - SendInvitationResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SendInvitationResponse) { - return MergeFrom((SendInvitationResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SendInvitationResponse other) { - if (other == global::bnet.protocol.invitation.SendInvitationResponse.DefaultInstance) return this; - if (other.HasInvitation) { - MergeInvitation(other.Invitation); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 18: { - global::bnet.protocol.invitation.Invitation.Builder subBuilder = global::bnet.protocol.invitation.Invitation.CreateBuilder(); - if (HasInvitation) { - subBuilder.MergeFrom(Invitation); - } - input.ReadMessage(subBuilder, extensionRegistry); - Invitation = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasInvitation { - get { return result.HasInvitation; } - } - public global::bnet.protocol.invitation.Invitation Invitation { - get { return result.Invitation; } - set { SetInvitation(value); } - } - public Builder SetInvitation(global::bnet.protocol.invitation.Invitation value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasInvitation = true; - result.invitation_ = value; - return this; - } - public Builder SetInvitation(global::bnet.protocol.invitation.Invitation.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasInvitation = true; - result.invitation_ = builderForValue.Build(); - return this; - } - public Builder MergeInvitation(global::bnet.protocol.invitation.Invitation value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasInvitation && - result.invitation_ != global::bnet.protocol.invitation.Invitation.DefaultInstance) { - result.invitation_ = global::bnet.protocol.invitation.Invitation.CreateBuilder(result.invitation_).MergeFrom(value).BuildPartial(); - } else { - result.invitation_ = value; - } - result.hasInvitation = true; - return this; - } - public Builder ClearInvitation() { - result.hasInvitation = false; - result.invitation_ = global::bnet.protocol.invitation.Invitation.DefaultInstance; - return this; - } - } - static SendInvitationResponse() { - object.ReferenceEquals(global::bnet.protocol.invitation.Proto.Invitation.Descriptor, null); - } - } - - public sealed partial class GenericRequest : pb::GeneratedMessage { - private static readonly GenericRequest defaultInstance = new Builder().BuildPartial(); - public static GenericRequest DefaultInstance { - get { return defaultInstance; } - } - - public override GenericRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override GenericRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.invitation.Proto.Invitation.internal__static_bnet_protocol_invitation_GenericRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.invitation.Proto.Invitation.internal__static_bnet_protocol_invitation_GenericRequest__FieldAccessorTable; } - } - - public const int AgentIdFieldNumber = 1; - private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasAgentId { - get { return hasAgentId; } - } - public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } - } - - public const int TargetIdFieldNumber = 2; - private bool hasTargetId; - private global::bnet.protocol.EntityId targetId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasTargetId { - get { return hasTargetId; } - } - public global::bnet.protocol.EntityId TargetId { - get { return targetId_; } - } - - public const int InvitationIdFieldNumber = 3; - private bool hasInvitationId; - private ulong invitationId_ = 0; - public bool HasInvitationId { - get { return hasInvitationId; } - } - public ulong InvitationId { - get { return invitationId_; } - } - - public override bool IsInitialized { - get { - if (!hasInvitationId) return false; - if (HasAgentId) { - if (!AgentId.IsInitialized) return false; - } - if (HasTargetId) { - if (!TargetId.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasAgentId) { - output.WriteMessage(1, AgentId); - } - if (HasTargetId) { - output.WriteMessage(2, TargetId); - } - if (HasInvitationId) { - output.WriteFixed64(3, InvitationId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasAgentId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); - } - if (HasTargetId) { - size += pb::CodedOutputStream.ComputeMessageSize(2, TargetId); - } - if (HasInvitationId) { - size += pb::CodedOutputStream.ComputeFixed64Size(3, InvitationId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static GenericRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static GenericRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static GenericRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static GenericRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static GenericRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static GenericRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static GenericRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static GenericRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static GenericRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static GenericRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(GenericRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - GenericRequest result = new GenericRequest(); - - protected override GenericRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new GenericRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.invitation.GenericRequest.Descriptor; } - } - - public override GenericRequest DefaultInstanceForType { - get { return global::bnet.protocol.invitation.GenericRequest.DefaultInstance; } - } - - public override GenericRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - GenericRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is GenericRequest) { - return MergeFrom((GenericRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(GenericRequest other) { - if (other == global::bnet.protocol.invitation.GenericRequest.DefaultInstance) return this; - if (other.HasAgentId) { - MergeAgentId(other.AgentId); - } - if (other.HasTargetId) { - MergeTargetId(other.TargetId); - } - if (other.HasInvitationId) { - InvitationId = other.InvitationId; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { - subBuilder.MergeFrom(AgentId); - } - input.ReadMessage(subBuilder, extensionRegistry); - AgentId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasTargetId) { - subBuilder.MergeFrom(TargetId); - } - input.ReadMessage(subBuilder, extensionRegistry); - TargetId = subBuilder.BuildPartial(); - break; - } - case 25: { - InvitationId = input.ReadFixed64(); - break; - } - } - } - } - - - public bool HasAgentId { - get { return result.HasAgentId; } - } - public global::bnet.protocol.EntityId AgentId { - get { return result.AgentId; } - set { SetAgentId(value); } - } - public Builder SetAgentId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasAgentId = true; - result.agentId_ = value; - return this; - } - public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasAgentId = true; - result.agentId_ = builderForValue.Build(); - return this; - } - public Builder MergeAgentId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && - result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); - } else { - result.agentId_ = value; - } - result.hasAgentId = true; - return this; - } - public Builder ClearAgentId() { - result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasTargetId { - get { return result.HasTargetId; } - } - public global::bnet.protocol.EntityId TargetId { - get { return result.TargetId; } - set { SetTargetId(value); } - } - public Builder SetTargetId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasTargetId = true; - result.targetId_ = value; - return this; - } - public Builder SetTargetId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasTargetId = true; - result.targetId_ = builderForValue.Build(); - return this; - } - public Builder MergeTargetId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasTargetId && - result.targetId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.targetId_ = global::bnet.protocol.EntityId.CreateBuilder(result.targetId_).MergeFrom(value).BuildPartial(); - } else { - result.targetId_ = value; - } - result.hasTargetId = true; - return this; - } - public Builder ClearTargetId() { - result.hasTargetId = false; - result.targetId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasInvitationId { - get { return result.HasInvitationId; } - } - public ulong InvitationId { - get { return result.InvitationId; } - set { SetInvitationId(value); } - } - public Builder SetInvitationId(ulong value) { - result.hasInvitationId = true; - result.invitationId_ = value; - return this; - } - public Builder ClearInvitationId() { - result.hasInvitationId = false; - result.invitationId_ = 0; - return this; - } - } - static GenericRequest() { - object.ReferenceEquals(global::bnet.protocol.invitation.Proto.Invitation.Descriptor, null); - } - } - - #endregion - -} diff --git a/source/D3Proto/bnet/protocol/party/Party.cs b/source/D3Proto/bnet/protocol/party/Party.cs deleted file mode 100644 index df3ebe7b..00000000 --- a/source/D3Proto/bnet/protocol/party/Party.cs +++ /dev/null @@ -1,185 +0,0 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace bnet.protocol.party { - - public static partial class Party { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static Party() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "CiRzZXJ2aWNlL3BhcnR5L2RlZmluaXRpb24vcGFydHkucHJvdG8SE2JuZXQu" + - "cHJvdG9jb2wucGFydHkaI3NlcnZpY2UvY2hhbm5lbC9jaGFubmVsX3R5cGVz" + - "LnByb3RvGhxsaWIvcHJvdG9jb2wvYXR0cmlidXRlLnByb3RvGhlsaWIvcHJv" + - "dG9jb2wvZW50aXR5LnByb3RvGh1saWIvcHJvdG9jb2wvaW52aXRhdGlvbi5w" + - "cm90bxoRbGliL3JwYy9ycGMucHJvdG8yzwIKDFBhcnR5U2VydmljZRJqCg1D" + - "cmVhdGVDaGFubmVsEisuYm5ldC5wcm90b2NvbC5jaGFubmVsLkNyZWF0ZUNo" + - "YW5uZWxSZXF1ZXN0GiwuYm5ldC5wcm90b2NvbC5jaGFubmVsLkNyZWF0ZUNo" + - "YW5uZWxSZXNwb25zZRJkCgtKb2luQ2hhbm5lbBIpLmJuZXQucHJvdG9jb2wu" + - "Y2hhbm5lbC5Kb2luQ2hhbm5lbFJlcXVlc3QaKi5ibmV0LnByb3RvY29sLmNo" + - "YW5uZWwuSm9pbkNoYW5uZWxSZXNwb25zZRJtCg5HZXRDaGFubmVsSW5mbxIs" + - "LmJuZXQucHJvdG9jb2wuY2hhbm5lbC5HZXRDaGFubmVsSW5mb1JlcXVlc3Qa" + - "LS5ibmV0LnByb3RvY29sLmNoYW5uZWwuR2V0Q2hhbm5lbEluZm9SZXNwb25z" + - "ZUIDgAEB"); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::bnet.protocol.channel.ChannelTypes.Descriptor, - global::bnet.protocol.attribute.Proto.Attribute.Descriptor, - global::bnet.protocol.Entity.Descriptor, - global::bnet.protocol.invitation.Proto.Invitation.Descriptor, - global::bnet.protocol.Rpc.Descriptor, - }, assigner); - } - #endregion - - } - #region Services - public abstract class PartyService : pb::IService { - public abstract void CreateChannel( - pb::IRpcController controller, - global::bnet.protocol.channel.CreateChannelRequest request, - global::System.Action done); - public abstract void JoinChannel( - pb::IRpcController controller, - global::bnet.protocol.channel.JoinChannelRequest request, - global::System.Action done); - public abstract void GetChannelInfo( - pb::IRpcController controller, - global::bnet.protocol.channel.GetChannelInfoRequest request, - global::System.Action done); - - public static pbd::ServiceDescriptor Descriptor { - get { return Party.Descriptor.Services[0]; } - } - public pbd::ServiceDescriptor DescriptorForType { - get { return Descriptor; } - } - - public void CallMethod( - pbd::MethodDescriptor method, - pb::IRpcController controller, - pb::IMessage request, - global::System.Action done) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.CallMethod() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - this.CreateChannel(controller, (global::bnet.protocol.channel.CreateChannelRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 1: - this.JoinChannel(controller, (global::bnet.protocol.channel.JoinChannelRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 2: - this.GetChannelInfo(controller, (global::bnet.protocol.channel.GetChannelInfoRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetRequestPrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::bnet.protocol.channel.CreateChannelRequest.DefaultInstance; - case 1: - return global::bnet.protocol.channel.JoinChannelRequest.DefaultInstance; - case 2: - return global::bnet.protocol.channel.GetChannelInfoRequest.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetResponsePrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::bnet.protocol.channel.CreateChannelResponse.DefaultInstance; - case 1: - return global::bnet.protocol.channel.JoinChannelResponse.DefaultInstance; - case 2: - return global::bnet.protocol.channel.GetChannelInfoResponse.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public static Stub CreateStub(pb::IRpcChannel channel) { - return new Stub(channel); - } - - public class Stub : global::bnet.protocol.party.PartyService { - internal Stub(pb::IRpcChannel channel) { - this.channel = channel; - } - - private readonly pb::IRpcChannel channel; - - public pb::IRpcChannel Channel { - get { return channel; } - } - - public override void CreateChannel( - pb::IRpcController controller, - global::bnet.protocol.channel.CreateChannelRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[0], - controller, request, global::bnet.protocol.channel.CreateChannelResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.channel.CreateChannelResponse.DefaultInstance)); - } - - public override void JoinChannel( - pb::IRpcController controller, - global::bnet.protocol.channel.JoinChannelRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[1], - controller, request, global::bnet.protocol.channel.JoinChannelResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.channel.JoinChannelResponse.DefaultInstance)); - } - - public override void GetChannelInfo( - pb::IRpcController controller, - global::bnet.protocol.channel.GetChannelInfoRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[2], - controller, request, global::bnet.protocol.channel.GetChannelInfoResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.channel.GetChannelInfoResponse.DefaultInstance)); - } - } - } - #endregion - -} diff --git a/source/D3Proto/bnet/protocol/presence/Presence.cs b/source/D3Proto/bnet/protocol/presence/Presence.cs deleted file mode 100644 index f16a1c1f..00000000 --- a/source/D3Proto/bnet/protocol/presence/Presence.cs +++ /dev/null @@ -1,1767 +0,0 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace bnet.protocol.presence { - - public static partial class Presence { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_bnet_protocol_presence_SubscribeRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_presence_SubscribeRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_presence_UnsubscribeRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_presence_UnsubscribeRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_presence_UpdateRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_presence_UpdateRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_presence_QueryRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_presence_QueryRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_presence_QueryResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_presence_QueryResponse__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static Presence() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "Ch9zZXJ2aWNlL3ByZXNlbmNlL3ByZXNlbmNlLnByb3RvEhZibmV0LnByb3Rv" + - "Y29sLnByZXNlbmNlGhxsaWIvcHJvdG9jb2wvYXR0cmlidXRlLnByb3RvGhls" + - "aWIvcHJvdG9jb2wvZW50aXR5LnByb3RvGhFsaWIvcnBjL3JwYy5wcm90bxol" + - "c2VydmljZS9wcmVzZW5jZS9wcmVzZW5jZV90eXBlcy5wcm90byJ8ChBTdWJz" + - "Y3JpYmVSZXF1ZXN0EikKCGFnZW50X2lkGAEgASgLMhcuYm5ldC5wcm90b2Nv" + - "bC5FbnRpdHlJZBIqCgllbnRpdHlfaWQYAiACKAsyFy5ibmV0LnByb3RvY29s" + - "LkVudGl0eUlkEhEKCW9iamVjdF9pZBgDIAIoBCJrChJVbnN1YnNjcmliZVJl" + - "cXVlc3QSKQoIYWdlbnRfaWQYASABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0" + - "eUlkEioKCWVudGl0eV9pZBgCIAIoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5" + - "SWQifAoNVXBkYXRlUmVxdWVzdBIqCgllbnRpdHlfaWQYASACKAsyFy5ibmV0" + - "LnByb3RvY29sLkVudGl0eUlkEj8KD2ZpZWxkX29wZXJhdGlvbhgCIAMoCzIm" + - "LmJuZXQucHJvdG9jb2wucHJlc2VuY2UuRmllbGRPcGVyYXRpb24iaQoMUXVl" + - "cnlSZXF1ZXN0EioKCWVudGl0eV9pZBgBIAIoCzIXLmJuZXQucHJvdG9jb2wu" + - "RW50aXR5SWQSLQoDa2V5GAIgAygLMiAuYm5ldC5wcm90b2NvbC5wcmVzZW5j" + - "ZS5GaWVsZEtleSI9Cg1RdWVyeVJlc3BvbnNlEiwKBWZpZWxkGAIgAygLMh0u" + - "Ym5ldC5wcm90b2NvbC5wcmVzZW5jZS5GaWVsZDLPAgoPUHJlc2VuY2VTZXJ2" + - "aWNlEkwKCVN1YnNjcmliZRIoLmJuZXQucHJvdG9jb2wucHJlc2VuY2UuU3Vi" + - "c2NyaWJlUmVxdWVzdBoVLmJuZXQucHJvdG9jb2wuTm9EYXRhElAKC1Vuc3Vi" + - "c2NyaWJlEiouYm5ldC5wcm90b2NvbC5wcmVzZW5jZS5VbnN1YnNjcmliZVJl" + - "cXVlc3QaFS5ibmV0LnByb3RvY29sLk5vRGF0YRJGCgZVcGRhdGUSJS5ibmV0" + - "LnByb3RvY29sLnByZXNlbmNlLlVwZGF0ZVJlcXVlc3QaFS5ibmV0LnByb3Rv" + - "Y29sLk5vRGF0YRJUCgVRdWVyeRIkLmJuZXQucHJvdG9jb2wucHJlc2VuY2Uu" + - "UXVlcnlSZXF1ZXN0GiUuYm5ldC5wcm90b2NvbC5wcmVzZW5jZS5RdWVyeVJl" + - "c3BvbnNlQgOAAQE="); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_bnet_protocol_presence_SubscribeRequest__Descriptor = Descriptor.MessageTypes[0]; - internal__static_bnet_protocol_presence_SubscribeRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_presence_SubscribeRequest__Descriptor, - new string[] { "AgentId", "EntityId", "ObjectId", }); - internal__static_bnet_protocol_presence_UnsubscribeRequest__Descriptor = Descriptor.MessageTypes[1]; - internal__static_bnet_protocol_presence_UnsubscribeRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_presence_UnsubscribeRequest__Descriptor, - new string[] { "AgentId", "EntityId", }); - internal__static_bnet_protocol_presence_UpdateRequest__Descriptor = Descriptor.MessageTypes[2]; - internal__static_bnet_protocol_presence_UpdateRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_presence_UpdateRequest__Descriptor, - new string[] { "EntityId", "FieldOperation", }); - internal__static_bnet_protocol_presence_QueryRequest__Descriptor = Descriptor.MessageTypes[3]; - internal__static_bnet_protocol_presence_QueryRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_presence_QueryRequest__Descriptor, - new string[] { "EntityId", "Key", }); - internal__static_bnet_protocol_presence_QueryResponse__Descriptor = Descriptor.MessageTypes[4]; - internal__static_bnet_protocol_presence_QueryResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_presence_QueryResponse__Descriptor, - new string[] { "Field", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::bnet.protocol.attribute.Proto.Attribute.Descriptor, - global::bnet.protocol.Entity.Descriptor, - global::bnet.protocol.Rpc.Descriptor, - global::bnet.protocol.presence.PresenceTypes.Descriptor, - }, assigner); - } - #endregion - - } - #region Messages - public sealed partial class SubscribeRequest : pb::GeneratedMessage { - private static readonly SubscribeRequest defaultInstance = new Builder().BuildPartial(); - public static SubscribeRequest DefaultInstance { - get { return defaultInstance; } - } - - public override SubscribeRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override SubscribeRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.presence.Presence.internal__static_bnet_protocol_presence_SubscribeRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.presence.Presence.internal__static_bnet_protocol_presence_SubscribeRequest__FieldAccessorTable; } - } - - public const int AgentIdFieldNumber = 1; - private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasAgentId { - get { return hasAgentId; } - } - public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } - } - - public const int EntityIdFieldNumber = 2; - private bool hasEntityId; - private global::bnet.protocol.EntityId entityId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasEntityId { - get { return hasEntityId; } - } - public global::bnet.protocol.EntityId EntityId { - get { return entityId_; } - } - - public const int ObjectIdFieldNumber = 3; - private bool hasObjectId; - private ulong objectId_ = 0UL; - public bool HasObjectId { - get { return hasObjectId; } - } - public ulong ObjectId { - get { return objectId_; } - } - - public override bool IsInitialized { - get { - if (!hasEntityId) return false; - if (!hasObjectId) return false; - if (HasAgentId) { - if (!AgentId.IsInitialized) return false; - } - if (!EntityId.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasAgentId) { - output.WriteMessage(1, AgentId); - } - if (HasEntityId) { - output.WriteMessage(2, EntityId); - } - if (HasObjectId) { - output.WriteUInt64(3, ObjectId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasAgentId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); - } - if (HasEntityId) { - size += pb::CodedOutputStream.ComputeMessageSize(2, EntityId); - } - if (HasObjectId) { - size += pb::CodedOutputStream.ComputeUInt64Size(3, ObjectId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static SubscribeRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SubscribeRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SubscribeRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SubscribeRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SubscribeRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SubscribeRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SubscribeRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SubscribeRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SubscribeRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SubscribeRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SubscribeRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - SubscribeRequest result = new SubscribeRequest(); - - protected override SubscribeRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new SubscribeRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.presence.SubscribeRequest.Descriptor; } - } - - public override SubscribeRequest DefaultInstanceForType { - get { return global::bnet.protocol.presence.SubscribeRequest.DefaultInstance; } - } - - public override SubscribeRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - SubscribeRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SubscribeRequest) { - return MergeFrom((SubscribeRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SubscribeRequest other) { - if (other == global::bnet.protocol.presence.SubscribeRequest.DefaultInstance) return this; - if (other.HasAgentId) { - MergeAgentId(other.AgentId); - } - if (other.HasEntityId) { - MergeEntityId(other.EntityId); - } - if (other.HasObjectId) { - ObjectId = other.ObjectId; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { - subBuilder.MergeFrom(AgentId); - } - input.ReadMessage(subBuilder, extensionRegistry); - AgentId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasEntityId) { - subBuilder.MergeFrom(EntityId); - } - input.ReadMessage(subBuilder, extensionRegistry); - EntityId = subBuilder.BuildPartial(); - break; - } - case 24: { - ObjectId = input.ReadUInt64(); - break; - } - } - } - } - - - public bool HasAgentId { - get { return result.HasAgentId; } - } - public global::bnet.protocol.EntityId AgentId { - get { return result.AgentId; } - set { SetAgentId(value); } - } - public Builder SetAgentId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasAgentId = true; - result.agentId_ = value; - return this; - } - public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasAgentId = true; - result.agentId_ = builderForValue.Build(); - return this; - } - public Builder MergeAgentId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && - result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); - } else { - result.agentId_ = value; - } - result.hasAgentId = true; - return this; - } - public Builder ClearAgentId() { - result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasEntityId { - get { return result.HasEntityId; } - } - public global::bnet.protocol.EntityId EntityId { - get { return result.EntityId; } - set { SetEntityId(value); } - } - public Builder SetEntityId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasEntityId = true; - result.entityId_ = value; - return this; - } - public Builder SetEntityId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasEntityId = true; - result.entityId_ = builderForValue.Build(); - return this; - } - public Builder MergeEntityId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasEntityId && - result.entityId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.entityId_ = global::bnet.protocol.EntityId.CreateBuilder(result.entityId_).MergeFrom(value).BuildPartial(); - } else { - result.entityId_ = value; - } - result.hasEntityId = true; - return this; - } - public Builder ClearEntityId() { - result.hasEntityId = false; - result.entityId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasObjectId { - get { return result.HasObjectId; } - } - public ulong ObjectId { - get { return result.ObjectId; } - set { SetObjectId(value); } - } - public Builder SetObjectId(ulong value) { - result.hasObjectId = true; - result.objectId_ = value; - return this; - } - public Builder ClearObjectId() { - result.hasObjectId = false; - result.objectId_ = 0UL; - return this; - } - } - static SubscribeRequest() { - object.ReferenceEquals(global::bnet.protocol.presence.Presence.Descriptor, null); - } - } - - public sealed partial class UnsubscribeRequest : pb::GeneratedMessage { - private static readonly UnsubscribeRequest defaultInstance = new Builder().BuildPartial(); - public static UnsubscribeRequest DefaultInstance { - get { return defaultInstance; } - } - - public override UnsubscribeRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override UnsubscribeRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.presence.Presence.internal__static_bnet_protocol_presence_UnsubscribeRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.presence.Presence.internal__static_bnet_protocol_presence_UnsubscribeRequest__FieldAccessorTable; } - } - - public const int AgentIdFieldNumber = 1; - private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasAgentId { - get { return hasAgentId; } - } - public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } - } - - public const int EntityIdFieldNumber = 2; - private bool hasEntityId; - private global::bnet.protocol.EntityId entityId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasEntityId { - get { return hasEntityId; } - } - public global::bnet.protocol.EntityId EntityId { - get { return entityId_; } - } - - public override bool IsInitialized { - get { - if (!hasEntityId) return false; - if (HasAgentId) { - if (!AgentId.IsInitialized) return false; - } - if (!EntityId.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasAgentId) { - output.WriteMessage(1, AgentId); - } - if (HasEntityId) { - output.WriteMessage(2, EntityId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasAgentId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); - } - if (HasEntityId) { - size += pb::CodedOutputStream.ComputeMessageSize(2, EntityId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static UnsubscribeRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static UnsubscribeRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static UnsubscribeRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static UnsubscribeRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static UnsubscribeRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static UnsubscribeRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static UnsubscribeRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static UnsubscribeRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static UnsubscribeRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static UnsubscribeRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(UnsubscribeRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - UnsubscribeRequest result = new UnsubscribeRequest(); - - protected override UnsubscribeRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new UnsubscribeRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.presence.UnsubscribeRequest.Descriptor; } - } - - public override UnsubscribeRequest DefaultInstanceForType { - get { return global::bnet.protocol.presence.UnsubscribeRequest.DefaultInstance; } - } - - public override UnsubscribeRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - UnsubscribeRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is UnsubscribeRequest) { - return MergeFrom((UnsubscribeRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(UnsubscribeRequest other) { - if (other == global::bnet.protocol.presence.UnsubscribeRequest.DefaultInstance) return this; - if (other.HasAgentId) { - MergeAgentId(other.AgentId); - } - if (other.HasEntityId) { - MergeEntityId(other.EntityId); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { - subBuilder.MergeFrom(AgentId); - } - input.ReadMessage(subBuilder, extensionRegistry); - AgentId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasEntityId) { - subBuilder.MergeFrom(EntityId); - } - input.ReadMessage(subBuilder, extensionRegistry); - EntityId = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasAgentId { - get { return result.HasAgentId; } - } - public global::bnet.protocol.EntityId AgentId { - get { return result.AgentId; } - set { SetAgentId(value); } - } - public Builder SetAgentId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasAgentId = true; - result.agentId_ = value; - return this; - } - public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasAgentId = true; - result.agentId_ = builderForValue.Build(); - return this; - } - public Builder MergeAgentId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && - result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); - } else { - result.agentId_ = value; - } - result.hasAgentId = true; - return this; - } - public Builder ClearAgentId() { - result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasEntityId { - get { return result.HasEntityId; } - } - public global::bnet.protocol.EntityId EntityId { - get { return result.EntityId; } - set { SetEntityId(value); } - } - public Builder SetEntityId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasEntityId = true; - result.entityId_ = value; - return this; - } - public Builder SetEntityId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasEntityId = true; - result.entityId_ = builderForValue.Build(); - return this; - } - public Builder MergeEntityId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasEntityId && - result.entityId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.entityId_ = global::bnet.protocol.EntityId.CreateBuilder(result.entityId_).MergeFrom(value).BuildPartial(); - } else { - result.entityId_ = value; - } - result.hasEntityId = true; - return this; - } - public Builder ClearEntityId() { - result.hasEntityId = false; - result.entityId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - } - static UnsubscribeRequest() { - object.ReferenceEquals(global::bnet.protocol.presence.Presence.Descriptor, null); - } - } - - public sealed partial class UpdateRequest : pb::GeneratedMessage { - private static readonly UpdateRequest defaultInstance = new Builder().BuildPartial(); - public static UpdateRequest DefaultInstance { - get { return defaultInstance; } - } - - public override UpdateRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override UpdateRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.presence.Presence.internal__static_bnet_protocol_presence_UpdateRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.presence.Presence.internal__static_bnet_protocol_presence_UpdateRequest__FieldAccessorTable; } - } - - public const int EntityIdFieldNumber = 1; - private bool hasEntityId; - private global::bnet.protocol.EntityId entityId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasEntityId { - get { return hasEntityId; } - } - public global::bnet.protocol.EntityId EntityId { - get { return entityId_; } - } - - public const int FieldOperationFieldNumber = 2; - private pbc::PopsicleList fieldOperation_ = new pbc::PopsicleList(); - public scg::IList FieldOperationList { - get { return fieldOperation_; } - } - public int FieldOperationCount { - get { return fieldOperation_.Count; } - } - public global::bnet.protocol.presence.FieldOperation GetFieldOperation(int index) { - return fieldOperation_[index]; - } - - public override bool IsInitialized { - get { - if (!hasEntityId) return false; - if (!EntityId.IsInitialized) return false; - foreach (global::bnet.protocol.presence.FieldOperation element in FieldOperationList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasEntityId) { - output.WriteMessage(1, EntityId); - } - foreach (global::bnet.protocol.presence.FieldOperation element in FieldOperationList) { - output.WriteMessage(2, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasEntityId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, EntityId); - } - foreach (global::bnet.protocol.presence.FieldOperation element in FieldOperationList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static UpdateRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static UpdateRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static UpdateRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static UpdateRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static UpdateRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static UpdateRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static UpdateRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static UpdateRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static UpdateRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static UpdateRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(UpdateRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - UpdateRequest result = new UpdateRequest(); - - protected override UpdateRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new UpdateRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.presence.UpdateRequest.Descriptor; } - } - - public override UpdateRequest DefaultInstanceForType { - get { return global::bnet.protocol.presence.UpdateRequest.DefaultInstance; } - } - - public override UpdateRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.fieldOperation_.MakeReadOnly(); - UpdateRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is UpdateRequest) { - return MergeFrom((UpdateRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(UpdateRequest other) { - if (other == global::bnet.protocol.presence.UpdateRequest.DefaultInstance) return this; - if (other.HasEntityId) { - MergeEntityId(other.EntityId); - } - if (other.fieldOperation_.Count != 0) { - base.AddRange(other.fieldOperation_, result.fieldOperation_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasEntityId) { - subBuilder.MergeFrom(EntityId); - } - input.ReadMessage(subBuilder, extensionRegistry); - EntityId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.presence.FieldOperation.Builder subBuilder = global::bnet.protocol.presence.FieldOperation.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddFieldOperation(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public bool HasEntityId { - get { return result.HasEntityId; } - } - public global::bnet.protocol.EntityId EntityId { - get { return result.EntityId; } - set { SetEntityId(value); } - } - public Builder SetEntityId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasEntityId = true; - result.entityId_ = value; - return this; - } - public Builder SetEntityId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasEntityId = true; - result.entityId_ = builderForValue.Build(); - return this; - } - public Builder MergeEntityId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasEntityId && - result.entityId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.entityId_ = global::bnet.protocol.EntityId.CreateBuilder(result.entityId_).MergeFrom(value).BuildPartial(); - } else { - result.entityId_ = value; - } - result.hasEntityId = true; - return this; - } - public Builder ClearEntityId() { - result.hasEntityId = false; - result.entityId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public pbc::IPopsicleList FieldOperationList { - get { return result.fieldOperation_; } - } - public int FieldOperationCount { - get { return result.FieldOperationCount; } - } - public global::bnet.protocol.presence.FieldOperation GetFieldOperation(int index) { - return result.GetFieldOperation(index); - } - public Builder SetFieldOperation(int index, global::bnet.protocol.presence.FieldOperation value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.fieldOperation_[index] = value; - return this; - } - public Builder SetFieldOperation(int index, global::bnet.protocol.presence.FieldOperation.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.fieldOperation_[index] = builderForValue.Build(); - return this; - } - public Builder AddFieldOperation(global::bnet.protocol.presence.FieldOperation value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.fieldOperation_.Add(value); - return this; - } - public Builder AddFieldOperation(global::bnet.protocol.presence.FieldOperation.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.fieldOperation_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeFieldOperation(scg::IEnumerable values) { - base.AddRange(values, result.fieldOperation_); - return this; - } - public Builder ClearFieldOperation() { - result.fieldOperation_.Clear(); - return this; - } - } - static UpdateRequest() { - object.ReferenceEquals(global::bnet.protocol.presence.Presence.Descriptor, null); - } - } - - public sealed partial class QueryRequest : pb::GeneratedMessage { - private static readonly QueryRequest defaultInstance = new Builder().BuildPartial(); - public static QueryRequest DefaultInstance { - get { return defaultInstance; } - } - - public override QueryRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override QueryRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.presence.Presence.internal__static_bnet_protocol_presence_QueryRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.presence.Presence.internal__static_bnet_protocol_presence_QueryRequest__FieldAccessorTable; } - } - - public const int EntityIdFieldNumber = 1; - private bool hasEntityId; - private global::bnet.protocol.EntityId entityId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasEntityId { - get { return hasEntityId; } - } - public global::bnet.protocol.EntityId EntityId { - get { return entityId_; } - } - - public const int KeyFieldNumber = 2; - private pbc::PopsicleList key_ = new pbc::PopsicleList(); - public scg::IList KeyList { - get { return key_; } - } - public int KeyCount { - get { return key_.Count; } - } - public global::bnet.protocol.presence.FieldKey GetKey(int index) { - return key_[index]; - } - - public override bool IsInitialized { - get { - if (!hasEntityId) return false; - if (!EntityId.IsInitialized) return false; - foreach (global::bnet.protocol.presence.FieldKey element in KeyList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasEntityId) { - output.WriteMessage(1, EntityId); - } - foreach (global::bnet.protocol.presence.FieldKey element in KeyList) { - output.WriteMessage(2, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasEntityId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, EntityId); - } - foreach (global::bnet.protocol.presence.FieldKey element in KeyList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static QueryRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static QueryRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static QueryRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static QueryRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static QueryRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static QueryRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static QueryRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static QueryRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static QueryRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static QueryRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(QueryRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - QueryRequest result = new QueryRequest(); - - protected override QueryRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new QueryRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.presence.QueryRequest.Descriptor; } - } - - public override QueryRequest DefaultInstanceForType { - get { return global::bnet.protocol.presence.QueryRequest.DefaultInstance; } - } - - public override QueryRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.key_.MakeReadOnly(); - QueryRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is QueryRequest) { - return MergeFrom((QueryRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(QueryRequest other) { - if (other == global::bnet.protocol.presence.QueryRequest.DefaultInstance) return this; - if (other.HasEntityId) { - MergeEntityId(other.EntityId); - } - if (other.key_.Count != 0) { - base.AddRange(other.key_, result.key_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasEntityId) { - subBuilder.MergeFrom(EntityId); - } - input.ReadMessage(subBuilder, extensionRegistry); - EntityId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.presence.FieldKey.Builder subBuilder = global::bnet.protocol.presence.FieldKey.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddKey(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public bool HasEntityId { - get { return result.HasEntityId; } - } - public global::bnet.protocol.EntityId EntityId { - get { return result.EntityId; } - set { SetEntityId(value); } - } - public Builder SetEntityId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasEntityId = true; - result.entityId_ = value; - return this; - } - public Builder SetEntityId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasEntityId = true; - result.entityId_ = builderForValue.Build(); - return this; - } - public Builder MergeEntityId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasEntityId && - result.entityId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.entityId_ = global::bnet.protocol.EntityId.CreateBuilder(result.entityId_).MergeFrom(value).BuildPartial(); - } else { - result.entityId_ = value; - } - result.hasEntityId = true; - return this; - } - public Builder ClearEntityId() { - result.hasEntityId = false; - result.entityId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public pbc::IPopsicleList KeyList { - get { return result.key_; } - } - public int KeyCount { - get { return result.KeyCount; } - } - public global::bnet.protocol.presence.FieldKey GetKey(int index) { - return result.GetKey(index); - } - public Builder SetKey(int index, global::bnet.protocol.presence.FieldKey value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.key_[index] = value; - return this; - } - public Builder SetKey(int index, global::bnet.protocol.presence.FieldKey.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.key_[index] = builderForValue.Build(); - return this; - } - public Builder AddKey(global::bnet.protocol.presence.FieldKey value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.key_.Add(value); - return this; - } - public Builder AddKey(global::bnet.protocol.presence.FieldKey.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.key_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeKey(scg::IEnumerable values) { - base.AddRange(values, result.key_); - return this; - } - public Builder ClearKey() { - result.key_.Clear(); - return this; - } - } - static QueryRequest() { - object.ReferenceEquals(global::bnet.protocol.presence.Presence.Descriptor, null); - } - } - - public sealed partial class QueryResponse : pb::GeneratedMessage { - private static readonly QueryResponse defaultInstance = new Builder().BuildPartial(); - public static QueryResponse DefaultInstance { - get { return defaultInstance; } - } - - public override QueryResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override QueryResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.presence.Presence.internal__static_bnet_protocol_presence_QueryResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.presence.Presence.internal__static_bnet_protocol_presence_QueryResponse__FieldAccessorTable; } - } - - public const int FieldFieldNumber = 2; - private pbc::PopsicleList field_ = new pbc::PopsicleList(); - public scg::IList FieldList { - get { return field_; } - } - public int FieldCount { - get { return field_.Count; } - } - public global::bnet.protocol.presence.Field GetField(int index) { - return field_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::bnet.protocol.presence.Field element in FieldList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::bnet.protocol.presence.Field element in FieldList) { - output.WriteMessage(2, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::bnet.protocol.presence.Field element in FieldList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static QueryResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static QueryResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static QueryResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static QueryResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static QueryResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static QueryResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static QueryResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static QueryResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static QueryResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static QueryResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(QueryResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - QueryResponse result = new QueryResponse(); - - protected override QueryResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new QueryResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.presence.QueryResponse.Descriptor; } - } - - public override QueryResponse DefaultInstanceForType { - get { return global::bnet.protocol.presence.QueryResponse.DefaultInstance; } - } - - public override QueryResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.field_.MakeReadOnly(); - QueryResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is QueryResponse) { - return MergeFrom((QueryResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(QueryResponse other) { - if (other == global::bnet.protocol.presence.QueryResponse.DefaultInstance) return this; - if (other.field_.Count != 0) { - base.AddRange(other.field_, result.field_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 18: { - global::bnet.protocol.presence.Field.Builder subBuilder = global::bnet.protocol.presence.Field.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddField(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public pbc::IPopsicleList FieldList { - get { return result.field_; } - } - public int FieldCount { - get { return result.FieldCount; } - } - public global::bnet.protocol.presence.Field GetField(int index) { - return result.GetField(index); - } - public Builder SetField(int index, global::bnet.protocol.presence.Field value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.field_[index] = value; - return this; - } - public Builder SetField(int index, global::bnet.protocol.presence.Field.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.field_[index] = builderForValue.Build(); - return this; - } - public Builder AddField(global::bnet.protocol.presence.Field value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.field_.Add(value); - return this; - } - public Builder AddField(global::bnet.protocol.presence.Field.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.field_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeField(scg::IEnumerable values) { - base.AddRange(values, result.field_); - return this; - } - public Builder ClearField() { - result.field_.Clear(); - return this; - } - } - static QueryResponse() { - object.ReferenceEquals(global::bnet.protocol.presence.Presence.Descriptor, null); - } - } - - #endregion - - #region Services - public abstract class PresenceService : pb::IService { - public abstract void Subscribe( - pb::IRpcController controller, - global::bnet.protocol.presence.SubscribeRequest request, - global::System.Action done); - public abstract void Unsubscribe( - pb::IRpcController controller, - global::bnet.protocol.presence.UnsubscribeRequest request, - global::System.Action done); - public abstract void Update( - pb::IRpcController controller, - global::bnet.protocol.presence.UpdateRequest request, - global::System.Action done); - public abstract void Query( - pb::IRpcController controller, - global::bnet.protocol.presence.QueryRequest request, - global::System.Action done); - - public static pbd::ServiceDescriptor Descriptor { - get { return Presence.Descriptor.Services[0]; } - } - public pbd::ServiceDescriptor DescriptorForType { - get { return Descriptor; } - } - - public void CallMethod( - pbd::MethodDescriptor method, - pb::IRpcController controller, - pb::IMessage request, - global::System.Action done) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.CallMethod() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - this.Subscribe(controller, (global::bnet.protocol.presence.SubscribeRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 1: - this.Unsubscribe(controller, (global::bnet.protocol.presence.UnsubscribeRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 2: - this.Update(controller, (global::bnet.protocol.presence.UpdateRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 3: - this.Query(controller, (global::bnet.protocol.presence.QueryRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetRequestPrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::bnet.protocol.presence.SubscribeRequest.DefaultInstance; - case 1: - return global::bnet.protocol.presence.UnsubscribeRequest.DefaultInstance; - case 2: - return global::bnet.protocol.presence.UpdateRequest.DefaultInstance; - case 3: - return global::bnet.protocol.presence.QueryRequest.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetResponsePrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::bnet.protocol.NoData.DefaultInstance; - case 1: - return global::bnet.protocol.NoData.DefaultInstance; - case 2: - return global::bnet.protocol.NoData.DefaultInstance; - case 3: - return global::bnet.protocol.presence.QueryResponse.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public static Stub CreateStub(pb::IRpcChannel channel) { - return new Stub(channel); - } - - public class Stub : global::bnet.protocol.presence.PresenceService { - internal Stub(pb::IRpcChannel channel) { - this.channel = channel; - } - - private readonly pb::IRpcChannel channel; - - public pb::IRpcChannel Channel { - get { return channel; } - } - - public override void Subscribe( - pb::IRpcController controller, - global::bnet.protocol.presence.SubscribeRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[0], - controller, request, global::bnet.protocol.NoData.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); - } - - public override void Unsubscribe( - pb::IRpcController controller, - global::bnet.protocol.presence.UnsubscribeRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[1], - controller, request, global::bnet.protocol.NoData.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); - } - - public override void Update( - pb::IRpcController controller, - global::bnet.protocol.presence.UpdateRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[2], - controller, request, global::bnet.protocol.NoData.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); - } - - public override void Query( - pb::IRpcController controller, - global::bnet.protocol.presence.QueryRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[3], - controller, request, global::bnet.protocol.presence.QueryResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.presence.QueryResponse.DefaultInstance)); - } - } - } - #endregion - -} diff --git a/source/D3Proto/bnet/protocol/search/Search.cs b/source/D3Proto/bnet/protocol/search/Search.cs deleted file mode 100644 index 066bddff..00000000 --- a/source/D3Proto/bnet/protocol/search/Search.cs +++ /dev/null @@ -1,1549 +0,0 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace bnet.protocol.search { - - public static partial class Search { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_bnet_protocol_search_FindMatchesRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_search_FindMatchesRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_search_FindMatchesResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_search_FindMatchesResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_search_SetObjectRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_search_SetObjectRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_search_RemoveObjectsRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_search_RemoveObjectsRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_search_SearchConfig__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_search_SearchConfig__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static Search() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "ChtzZXJ2aWNlL3NlYXJjaC9zZWFyY2gucHJvdG8SFGJuZXQucHJvdG9jb2wu" + - "c2VhcmNoGhFsaWIvcnBjL3JwYy5wcm90bxohc2VydmljZS9zZWFyY2gvc2Vh" + - "cmNoX3R5cGVzLnByb3RvIoIBChJGaW5kTWF0Y2hlc1JlcXVlc3QSEAoIdW5p" + - "dmVyc2UYASACKAkSLQoHZmlsdGVycxgCIAMoCzIcLmJuZXQucHJvdG9jb2wu" + - "c2VhcmNoLkZpbHRlchIZCg5zdGFydGluZ19pbmRleBgDIAEoDToBMBIQCgVj" + - "b3VudBgEIAEoDToBMCJZChNGaW5kTWF0Y2hlc1Jlc3BvbnNlEhMKC3RvdGFs" + - "X2NvdW50GAEgAigNEi0KB29iamVjdHMYAiADKAsyHC5ibmV0LnByb3RvY29s" + - "LnNlYXJjaC5PYmplY3QiQQoQU2V0T2JqZWN0UmVxdWVzdBItCgdvYmplY3Rz" + - "GAEgAygLMhwuYm5ldC5wcm90b2NvbC5zZWFyY2guT2JqZWN0IjgKFFJlbW92" + - "ZU9iamVjdHNSZXF1ZXN0EhAKCHN0YXJ0X2lkGAEgAigMEg4KBmVuZF9pZBgC" + - "IAIoDCIOCgxTZWFyY2hDb25maWcynQIKDVNlYXJjaFNlcnZpY2USYgoLRmlu" + - "ZE1hdGNoZXMSKC5ibmV0LnByb3RvY29sLnNlYXJjaC5GaW5kTWF0Y2hlc1Jl" + - "cXVlc3QaKS5ibmV0LnByb3RvY29sLnNlYXJjaC5GaW5kTWF0Y2hlc1Jlc3Bv" + - "bnNlEk8KCVNldE9iamVjdBImLmJuZXQucHJvdG9jb2wuc2VhcmNoLlNldE9i" + - "amVjdFJlcXVlc3QaGi5ibmV0LnByb3RvY29sLk5PX1JFU1BPTlNFElcKDVJl" + - "bW92ZU9iamVjdHMSKi5ibmV0LnByb3RvY29sLnNlYXJjaC5SZW1vdmVPYmpl" + - "Y3RzUmVxdWVzdBoaLmJuZXQucHJvdG9jb2wuTk9fUkVTUE9OU0VCA4ABAQ=="); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_bnet_protocol_search_FindMatchesRequest__Descriptor = Descriptor.MessageTypes[0]; - internal__static_bnet_protocol_search_FindMatchesRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_search_FindMatchesRequest__Descriptor, - new string[] { "Universe", "Filters", "StartingIndex", "Count", }); - internal__static_bnet_protocol_search_FindMatchesResponse__Descriptor = Descriptor.MessageTypes[1]; - internal__static_bnet_protocol_search_FindMatchesResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_search_FindMatchesResponse__Descriptor, - new string[] { "TotalCount", "Objects", }); - internal__static_bnet_protocol_search_SetObjectRequest__Descriptor = Descriptor.MessageTypes[2]; - internal__static_bnet_protocol_search_SetObjectRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_search_SetObjectRequest__Descriptor, - new string[] { "Objects", }); - internal__static_bnet_protocol_search_RemoveObjectsRequest__Descriptor = Descriptor.MessageTypes[3]; - internal__static_bnet_protocol_search_RemoveObjectsRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_search_RemoveObjectsRequest__Descriptor, - new string[] { "StartId", "EndId", }); - internal__static_bnet_protocol_search_SearchConfig__Descriptor = Descriptor.MessageTypes[4]; - internal__static_bnet_protocol_search_SearchConfig__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_search_SearchConfig__Descriptor, - new string[] { }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::bnet.protocol.Rpc.Descriptor, - global::bnet.protocol.search.SearchTypes.Descriptor, - }, assigner); - } - #endregion - - } - #region Messages - public sealed partial class FindMatchesRequest : pb::GeneratedMessage { - private static readonly FindMatchesRequest defaultInstance = new Builder().BuildPartial(); - public static FindMatchesRequest DefaultInstance { - get { return defaultInstance; } - } - - public override FindMatchesRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override FindMatchesRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.search.Search.internal__static_bnet_protocol_search_FindMatchesRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.search.Search.internal__static_bnet_protocol_search_FindMatchesRequest__FieldAccessorTable; } - } - - public const int UniverseFieldNumber = 1; - private bool hasUniverse; - private string universe_ = ""; - public bool HasUniverse { - get { return hasUniverse; } - } - public string Universe { - get { return universe_; } - } - - public const int FiltersFieldNumber = 2; - private pbc::PopsicleList filters_ = new pbc::PopsicleList(); - public scg::IList FiltersList { - get { return filters_; } - } - public int FiltersCount { - get { return filters_.Count; } - } - public global::bnet.protocol.search.Filter GetFilters(int index) { - return filters_[index]; - } - - public const int StartingIndexFieldNumber = 3; - private bool hasStartingIndex; - private uint startingIndex_ = 0; - public bool HasStartingIndex { - get { return hasStartingIndex; } - } - public uint StartingIndex { - get { return startingIndex_; } - } - - public const int CountFieldNumber = 4; - private bool hasCount; - private uint count_ = 0; - public bool HasCount { - get { return hasCount; } - } - public uint Count { - get { return count_; } - } - - public override bool IsInitialized { - get { - if (!hasUniverse) return false; - foreach (global::bnet.protocol.search.Filter element in FiltersList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasUniverse) { - output.WriteString(1, Universe); - } - foreach (global::bnet.protocol.search.Filter element in FiltersList) { - output.WriteMessage(2, element); - } - if (HasStartingIndex) { - output.WriteUInt32(3, StartingIndex); - } - if (HasCount) { - output.WriteUInt32(4, Count); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasUniverse) { - size += pb::CodedOutputStream.ComputeStringSize(1, Universe); - } - foreach (global::bnet.protocol.search.Filter element in FiltersList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - if (HasStartingIndex) { - size += pb::CodedOutputStream.ComputeUInt32Size(3, StartingIndex); - } - if (HasCount) { - size += pb::CodedOutputStream.ComputeUInt32Size(4, Count); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static FindMatchesRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FindMatchesRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FindMatchesRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FindMatchesRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FindMatchesRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FindMatchesRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static FindMatchesRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static FindMatchesRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static FindMatchesRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FindMatchesRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(FindMatchesRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - FindMatchesRequest result = new FindMatchesRequest(); - - protected override FindMatchesRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new FindMatchesRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.search.FindMatchesRequest.Descriptor; } - } - - public override FindMatchesRequest DefaultInstanceForType { - get { return global::bnet.protocol.search.FindMatchesRequest.DefaultInstance; } - } - - public override FindMatchesRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.filters_.MakeReadOnly(); - FindMatchesRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is FindMatchesRequest) { - return MergeFrom((FindMatchesRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(FindMatchesRequest other) { - if (other == global::bnet.protocol.search.FindMatchesRequest.DefaultInstance) return this; - if (other.HasUniverse) { - Universe = other.Universe; - } - if (other.filters_.Count != 0) { - base.AddRange(other.filters_, result.filters_); - } - if (other.HasStartingIndex) { - StartingIndex = other.StartingIndex; - } - if (other.HasCount) { - Count = other.Count; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - Universe = input.ReadString(); - break; - } - case 18: { - global::bnet.protocol.search.Filter.Builder subBuilder = global::bnet.protocol.search.Filter.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddFilters(subBuilder.BuildPartial()); - break; - } - case 24: { - StartingIndex = input.ReadUInt32(); - break; - } - case 32: { - Count = input.ReadUInt32(); - break; - } - } - } - } - - - public bool HasUniverse { - get { return result.HasUniverse; } - } - public string Universe { - get { return result.Universe; } - set { SetUniverse(value); } - } - public Builder SetUniverse(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasUniverse = true; - result.universe_ = value; - return this; - } - public Builder ClearUniverse() { - result.hasUniverse = false; - result.universe_ = ""; - return this; - } - - public pbc::IPopsicleList FiltersList { - get { return result.filters_; } - } - public int FiltersCount { - get { return result.FiltersCount; } - } - public global::bnet.protocol.search.Filter GetFilters(int index) { - return result.GetFilters(index); - } - public Builder SetFilters(int index, global::bnet.protocol.search.Filter value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.filters_[index] = value; - return this; - } - public Builder SetFilters(int index, global::bnet.protocol.search.Filter.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.filters_[index] = builderForValue.Build(); - return this; - } - public Builder AddFilters(global::bnet.protocol.search.Filter value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.filters_.Add(value); - return this; - } - public Builder AddFilters(global::bnet.protocol.search.Filter.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.filters_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeFilters(scg::IEnumerable values) { - base.AddRange(values, result.filters_); - return this; - } - public Builder ClearFilters() { - result.filters_.Clear(); - return this; - } - - public bool HasStartingIndex { - get { return result.HasStartingIndex; } - } - public uint StartingIndex { - get { return result.StartingIndex; } - set { SetStartingIndex(value); } - } - public Builder SetStartingIndex(uint value) { - result.hasStartingIndex = true; - result.startingIndex_ = value; - return this; - } - public Builder ClearStartingIndex() { - result.hasStartingIndex = false; - result.startingIndex_ = 0; - return this; - } - - public bool HasCount { - get { return result.HasCount; } - } - public uint Count { - get { return result.Count; } - set { SetCount(value); } - } - public Builder SetCount(uint value) { - result.hasCount = true; - result.count_ = value; - return this; - } - public Builder ClearCount() { - result.hasCount = false; - result.count_ = 0; - return this; - } - } - static FindMatchesRequest() { - object.ReferenceEquals(global::bnet.protocol.search.Search.Descriptor, null); - } - } - - public sealed partial class FindMatchesResponse : pb::GeneratedMessage { - private static readonly FindMatchesResponse defaultInstance = new Builder().BuildPartial(); - public static FindMatchesResponse DefaultInstance { - get { return defaultInstance; } - } - - public override FindMatchesResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override FindMatchesResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.search.Search.internal__static_bnet_protocol_search_FindMatchesResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.search.Search.internal__static_bnet_protocol_search_FindMatchesResponse__FieldAccessorTable; } - } - - public const int TotalCountFieldNumber = 1; - private bool hasTotalCount; - private uint totalCount_ = 0; - public bool HasTotalCount { - get { return hasTotalCount; } - } - public uint TotalCount { - get { return totalCount_; } - } - - public const int ObjectsFieldNumber = 2; - private pbc::PopsicleList objects_ = new pbc::PopsicleList(); - public scg::IList ObjectsList { - get { return objects_; } - } - public int ObjectsCount { - get { return objects_.Count; } - } - public global::bnet.protocol.search.Object GetObjects(int index) { - return objects_[index]; - } - - public override bool IsInitialized { - get { - if (!hasTotalCount) return false; - foreach (global::bnet.protocol.search.Object element in ObjectsList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasTotalCount) { - output.WriteUInt32(1, TotalCount); - } - foreach (global::bnet.protocol.search.Object element in ObjectsList) { - output.WriteMessage(2, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasTotalCount) { - size += pb::CodedOutputStream.ComputeUInt32Size(1, TotalCount); - } - foreach (global::bnet.protocol.search.Object element in ObjectsList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static FindMatchesResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FindMatchesResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FindMatchesResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static FindMatchesResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static FindMatchesResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FindMatchesResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static FindMatchesResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static FindMatchesResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static FindMatchesResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static FindMatchesResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(FindMatchesResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - FindMatchesResponse result = new FindMatchesResponse(); - - protected override FindMatchesResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new FindMatchesResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.search.FindMatchesResponse.Descriptor; } - } - - public override FindMatchesResponse DefaultInstanceForType { - get { return global::bnet.protocol.search.FindMatchesResponse.DefaultInstance; } - } - - public override FindMatchesResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.objects_.MakeReadOnly(); - FindMatchesResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is FindMatchesResponse) { - return MergeFrom((FindMatchesResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(FindMatchesResponse other) { - if (other == global::bnet.protocol.search.FindMatchesResponse.DefaultInstance) return this; - if (other.HasTotalCount) { - TotalCount = other.TotalCount; - } - if (other.objects_.Count != 0) { - base.AddRange(other.objects_, result.objects_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - TotalCount = input.ReadUInt32(); - break; - } - case 18: { - global::bnet.protocol.search.Object.Builder subBuilder = global::bnet.protocol.search.Object.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddObjects(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public bool HasTotalCount { - get { return result.HasTotalCount; } - } - public uint TotalCount { - get { return result.TotalCount; } - set { SetTotalCount(value); } - } - public Builder SetTotalCount(uint value) { - result.hasTotalCount = true; - result.totalCount_ = value; - return this; - } - public Builder ClearTotalCount() { - result.hasTotalCount = false; - result.totalCount_ = 0; - return this; - } - - public pbc::IPopsicleList ObjectsList { - get { return result.objects_; } - } - public int ObjectsCount { - get { return result.ObjectsCount; } - } - public global::bnet.protocol.search.Object GetObjects(int index) { - return result.GetObjects(index); - } - public Builder SetObjects(int index, global::bnet.protocol.search.Object value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.objects_[index] = value; - return this; - } - public Builder SetObjects(int index, global::bnet.protocol.search.Object.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.objects_[index] = builderForValue.Build(); - return this; - } - public Builder AddObjects(global::bnet.protocol.search.Object value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.objects_.Add(value); - return this; - } - public Builder AddObjects(global::bnet.protocol.search.Object.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.objects_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeObjects(scg::IEnumerable values) { - base.AddRange(values, result.objects_); - return this; - } - public Builder ClearObjects() { - result.objects_.Clear(); - return this; - } - } - static FindMatchesResponse() { - object.ReferenceEquals(global::bnet.protocol.search.Search.Descriptor, null); - } - } - - public sealed partial class SetObjectRequest : pb::GeneratedMessage { - private static readonly SetObjectRequest defaultInstance = new Builder().BuildPartial(); - public static SetObjectRequest DefaultInstance { - get { return defaultInstance; } - } - - public override SetObjectRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override SetObjectRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.search.Search.internal__static_bnet_protocol_search_SetObjectRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.search.Search.internal__static_bnet_protocol_search_SetObjectRequest__FieldAccessorTable; } - } - - public const int ObjectsFieldNumber = 1; - private pbc::PopsicleList objects_ = new pbc::PopsicleList(); - public scg::IList ObjectsList { - get { return objects_; } - } - public int ObjectsCount { - get { return objects_.Count; } - } - public global::bnet.protocol.search.Object GetObjects(int index) { - return objects_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::bnet.protocol.search.Object element in ObjectsList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::bnet.protocol.search.Object element in ObjectsList) { - output.WriteMessage(1, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::bnet.protocol.search.Object element in ObjectsList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static SetObjectRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SetObjectRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SetObjectRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SetObjectRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SetObjectRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SetObjectRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SetObjectRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SetObjectRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SetObjectRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SetObjectRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SetObjectRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - SetObjectRequest result = new SetObjectRequest(); - - protected override SetObjectRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new SetObjectRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.search.SetObjectRequest.Descriptor; } - } - - public override SetObjectRequest DefaultInstanceForType { - get { return global::bnet.protocol.search.SetObjectRequest.DefaultInstance; } - } - - public override SetObjectRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.objects_.MakeReadOnly(); - SetObjectRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SetObjectRequest) { - return MergeFrom((SetObjectRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SetObjectRequest other) { - if (other == global::bnet.protocol.search.SetObjectRequest.DefaultInstance) return this; - if (other.objects_.Count != 0) { - base.AddRange(other.objects_, result.objects_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.search.Object.Builder subBuilder = global::bnet.protocol.search.Object.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddObjects(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public pbc::IPopsicleList ObjectsList { - get { return result.objects_; } - } - public int ObjectsCount { - get { return result.ObjectsCount; } - } - public global::bnet.protocol.search.Object GetObjects(int index) { - return result.GetObjects(index); - } - public Builder SetObjects(int index, global::bnet.protocol.search.Object value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.objects_[index] = value; - return this; - } - public Builder SetObjects(int index, global::bnet.protocol.search.Object.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.objects_[index] = builderForValue.Build(); - return this; - } - public Builder AddObjects(global::bnet.protocol.search.Object value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.objects_.Add(value); - return this; - } - public Builder AddObjects(global::bnet.protocol.search.Object.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.objects_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeObjects(scg::IEnumerable values) { - base.AddRange(values, result.objects_); - return this; - } - public Builder ClearObjects() { - result.objects_.Clear(); - return this; - } - } - static SetObjectRequest() { - object.ReferenceEquals(global::bnet.protocol.search.Search.Descriptor, null); - } - } - - public sealed partial class RemoveObjectsRequest : pb::GeneratedMessage { - private static readonly RemoveObjectsRequest defaultInstance = new Builder().BuildPartial(); - public static RemoveObjectsRequest DefaultInstance { - get { return defaultInstance; } - } - - public override RemoveObjectsRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override RemoveObjectsRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.search.Search.internal__static_bnet_protocol_search_RemoveObjectsRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.search.Search.internal__static_bnet_protocol_search_RemoveObjectsRequest__FieldAccessorTable; } - } - - public const int StartIdFieldNumber = 1; - private bool hasStartId; - private pb::ByteString startId_ = pb::ByteString.Empty; - public bool HasStartId { - get { return hasStartId; } - } - public pb::ByteString StartId { - get { return startId_; } - } - - public const int EndIdFieldNumber = 2; - private bool hasEndId; - private pb::ByteString endId_ = pb::ByteString.Empty; - public bool HasEndId { - get { return hasEndId; } - } - public pb::ByteString EndId { - get { return endId_; } - } - - public override bool IsInitialized { - get { - if (!hasStartId) return false; - if (!hasEndId) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasStartId) { - output.WriteBytes(1, StartId); - } - if (HasEndId) { - output.WriteBytes(2, EndId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasStartId) { - size += pb::CodedOutputStream.ComputeBytesSize(1, StartId); - } - if (HasEndId) { - size += pb::CodedOutputStream.ComputeBytesSize(2, EndId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static RemoveObjectsRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RemoveObjectsRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RemoveObjectsRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RemoveObjectsRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RemoveObjectsRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RemoveObjectsRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static RemoveObjectsRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static RemoveObjectsRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static RemoveObjectsRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RemoveObjectsRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(RemoveObjectsRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - RemoveObjectsRequest result = new RemoveObjectsRequest(); - - protected override RemoveObjectsRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new RemoveObjectsRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.search.RemoveObjectsRequest.Descriptor; } - } - - public override RemoveObjectsRequest DefaultInstanceForType { - get { return global::bnet.protocol.search.RemoveObjectsRequest.DefaultInstance; } - } - - public override RemoveObjectsRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - RemoveObjectsRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is RemoveObjectsRequest) { - return MergeFrom((RemoveObjectsRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(RemoveObjectsRequest other) { - if (other == global::bnet.protocol.search.RemoveObjectsRequest.DefaultInstance) return this; - if (other.HasStartId) { - StartId = other.StartId; - } - if (other.HasEndId) { - EndId = other.EndId; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - StartId = input.ReadBytes(); - break; - } - case 18: { - EndId = input.ReadBytes(); - break; - } - } - } - } - - - public bool HasStartId { - get { return result.HasStartId; } - } - public pb::ByteString StartId { - get { return result.StartId; } - set { SetStartId(value); } - } - public Builder SetStartId(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasStartId = true; - result.startId_ = value; - return this; - } - public Builder ClearStartId() { - result.hasStartId = false; - result.startId_ = pb::ByteString.Empty; - return this; - } - - public bool HasEndId { - get { return result.HasEndId; } - } - public pb::ByteString EndId { - get { return result.EndId; } - set { SetEndId(value); } - } - public Builder SetEndId(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasEndId = true; - result.endId_ = value; - return this; - } - public Builder ClearEndId() { - result.hasEndId = false; - result.endId_ = pb::ByteString.Empty; - return this; - } - } - static RemoveObjectsRequest() { - object.ReferenceEquals(global::bnet.protocol.search.Search.Descriptor, null); - } - } - - public sealed partial class SearchConfig : pb::GeneratedMessage { - private static readonly SearchConfig defaultInstance = new Builder().BuildPartial(); - public static SearchConfig DefaultInstance { - get { return defaultInstance; } - } - - public override SearchConfig DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override SearchConfig ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.search.Search.internal__static_bnet_protocol_search_SearchConfig__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.search.Search.internal__static_bnet_protocol_search_SearchConfig__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static SearchConfig ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SearchConfig ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SearchConfig ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SearchConfig ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SearchConfig ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SearchConfig ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SearchConfig ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SearchConfig ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SearchConfig ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SearchConfig ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SearchConfig prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - SearchConfig result = new SearchConfig(); - - protected override SearchConfig MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new SearchConfig(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.search.SearchConfig.Descriptor; } - } - - public override SearchConfig DefaultInstanceForType { - get { return global::bnet.protocol.search.SearchConfig.DefaultInstance; } - } - - public override SearchConfig BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - SearchConfig returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SearchConfig) { - return MergeFrom((SearchConfig) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SearchConfig other) { - if (other == global::bnet.protocol.search.SearchConfig.DefaultInstance) return this; - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - } - } - } - - } - static SearchConfig() { - object.ReferenceEquals(global::bnet.protocol.search.Search.Descriptor, null); - } - } - - #endregion - - #region Services - public abstract class SearchService : pb::IService { - public abstract void FindMatches( - pb::IRpcController controller, - global::bnet.protocol.search.FindMatchesRequest request, - global::System.Action done); - public abstract void SetObject( - pb::IRpcController controller, - global::bnet.protocol.search.SetObjectRequest request, - global::System.Action done); - public abstract void RemoveObjects( - pb::IRpcController controller, - global::bnet.protocol.search.RemoveObjectsRequest request, - global::System.Action done); - - public static pbd::ServiceDescriptor Descriptor { - get { return Search.Descriptor.Services[0]; } - } - public pbd::ServiceDescriptor DescriptorForType { - get { return Descriptor; } - } - - public void CallMethod( - pbd::MethodDescriptor method, - pb::IRpcController controller, - pb::IMessage request, - global::System.Action done) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.CallMethod() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - this.FindMatches(controller, (global::bnet.protocol.search.FindMatchesRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 1: - this.SetObject(controller, (global::bnet.protocol.search.SetObjectRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 2: - this.RemoveObjects(controller, (global::bnet.protocol.search.RemoveObjectsRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetRequestPrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::bnet.protocol.search.FindMatchesRequest.DefaultInstance; - case 1: - return global::bnet.protocol.search.SetObjectRequest.DefaultInstance; - case 2: - return global::bnet.protocol.search.RemoveObjectsRequest.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetResponsePrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::bnet.protocol.search.FindMatchesResponse.DefaultInstance; - case 1: - return global::bnet.protocol.NO_RESPONSE.DefaultInstance; - case 2: - return global::bnet.protocol.NO_RESPONSE.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public static Stub CreateStub(pb::IRpcChannel channel) { - return new Stub(channel); - } - - public class Stub : global::bnet.protocol.search.SearchService { - internal Stub(pb::IRpcChannel channel) { - this.channel = channel; - } - - private readonly pb::IRpcChannel channel; - - public pb::IRpcChannel Channel { - get { return channel; } - } - - public override void FindMatches( - pb::IRpcController controller, - global::bnet.protocol.search.FindMatchesRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[0], - controller, request, global::bnet.protocol.search.FindMatchesResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.search.FindMatchesResponse.DefaultInstance)); - } - - public override void SetObject( - pb::IRpcController controller, - global::bnet.protocol.search.SetObjectRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[1], - controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); - } - - public override void RemoveObjects( - pb::IRpcController controller, - global::bnet.protocol.search.RemoveObjectsRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[2], - controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); - } - } - } - #endregion - -} diff --git a/source/D3Proto/bnet/protocol/storage/Storage.cs b/source/D3Proto/bnet/protocol/storage/Storage.cs deleted file mode 100644 index 47b65966..00000000 --- a/source/D3Proto/bnet/protocol/storage/Storage.cs +++ /dev/null @@ -1,6066 +0,0 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace bnet.protocol.storage { - - public static partial class Storage { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_bnet_protocol_storage_TableId__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_storage_TableId__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_storage_ColumnId__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_storage_ColumnId__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_storage_RowId__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_storage_RowId__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_storage_Privilege__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_storage_Privilege__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_storage_ScanOperation__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_storage_ScanOperation__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_storage_Command__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_storage_Command__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_storage_Operation__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_storage_Operation__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_storage_Cell__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_storage_Cell__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_storage_OperationResult__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_storage_OperationResult__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_storage_OpenTableRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_storage_OpenTableRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_storage_OpenTableResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_storage_OpenTableResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_storage_OpenColumnRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_storage_OpenColumnRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_storage_OpenColumnResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_storage_OpenColumnResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_storage_ExecuteRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_storage_ExecuteRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_storage_ExecuteResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_storage_ExecuteResponse__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static Storage() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "Ch1zZXJ2aWNlL3N0b3JhZ2Uvc3RvcmFnZS5wcm90bxIVYm5ldC5wcm90b2Nv" + - "bC5zdG9yYWdlGh1saWIvcHJvdG9jb2wvZGVzY3JpcHRvci5wcm90bxoZbGli" + - "L3Byb3RvY29sL2VudGl0eS5wcm90bxoRbGliL3JwYy9ycGMucHJvdG8iFwoH" + - "VGFibGVJZBIMCgRoYXNoGAEgAigMIhgKCENvbHVtbklkEgwKBGhhc2gYASAC" + - "KAwiFQoFUm93SWQSDAoEaGFzaBgBIAIoDCJzCglQcml2aWxlZ2USDwoEYml0" + - "cxgBIAEoBjoBMBISCgdwcm9ncmFtGAIgASgHOgEwIkEKClBlcm1pc3Npb24S" + - "CQoFT1dORVIQARIKCgZGUklFTkQQAhIJCgVPVEhFUhAEEggKBEdBTUUQCBIH" + - "CgNBTEwQDyL7AQoNU2Nhbk9wZXJhdGlvbhIzCgJvcBgBIAIoDjInLmJuZXQu" + - "cHJvdG9jb2wuc3RvcmFnZS5TY2FuT3BlcmF0aW9uLk9wEiIKBWZpZWxkGAIg" + - "AigLMhMuYm5ldC5wcm90b2NvbC5QYXRoIpABCgJPcBIMCghJU19DTEVBUhAB" + - "Eg0KCU5PVF9DTEVBUhACEg0KCUlTX0VRVUFMUxADEg4KCk5PVF9FUVVBTFMQ" + - "BBITCg9JU19HUkVBVEVSX1RIQU4QBRIUChBOT1RfR1JFQVRFUl9USEFOEAYS" + - "EAoMSVNfTEVTU19USEFOEAcSEQoNTk9UX0xFU1NfVEhBThAIIoUGCgdDb21t" + - "YW5kEi0KAm9wGAEgAigOMiEuYm5ldC5wcm90b2NvbC5zdG9yYWdlLkNvbW1h" + - "bmQuT3ASDAoEZGF0YRgCIAEoDBIjCgZmaWVsZHMYAyADKAsyEy5ibmV0LnBy" + - "b3RvY29sLlBhdGgSEwoLbWluX3ZlcnNpb24YBCABKAYSEwoLbWF4X3ZlcnNp" + - "b24YBSABKAYSMgoEc2NhbhgGIAEoCzIkLmJuZXQucHJvdG9jb2wuc3RvcmFn" + - "ZS5TY2FuT3BlcmF0aW9uEg0KBWxpbWl0GAcgASgNEjYKCWNvbmRpdGlvbhgI" + - "IAEoDjIjLmJuZXQucHJvdG9jb2wuc3RvcmFnZS5Db21tYW5kLkNvbmQSDwoH" + - "bWVzc2FnZRgLIAEoCSKpAgoCT3ASDgoKUk9XX0RFTEVURRABEg0KCVJPV19G" + - "RVRDSBACEg4KCkNPTF9ERUxFVEUQAxINCglDT0xfRkVUQ0gQBBINCglDT0xf" + - "V1JJVEUQBRINCglDT0xfTUVSR0UQBhINCglGTERfQ0xFQVIQBxINCglGTERf" + - "RkVUQ0gQCBINCglGTERfV1JJVEUQCRINCglGTERfTUVSR0UQChIMCghGTERf" + - "SU5DUhALEgwKCEZMRF9URVNUEAwSDAoIRkxEX1NDQU4QDRIMCghST1dfVEVT" + - "VBAOEgwKCENPTF9URVNUEA8SDAoIRkxEX1NNQVgQEBIMCghDT0xfQ09ORBAR" + - "EgwKCEZMRF9DT05EEBISDAoIQ09ORF9QT1AQExINCglMT0dfREVCVUcQFCK1" + - "AQoEQ29uZBIPCgtDT05EX0FMV0FZUxAAEhMKD0NPTkRfTk9UX0VYSVNUUxAB" + - "EhIKDkNPTkRfTk9UX0VRVUFMEAISEgoOQ09ORF9MRVNTX1RIQU4QAxIUChBD" + - "T05EX05PVF9HUkVBVEVSEAQSDwoLQ09ORF9FUVVBTFMQBRIRCg1DT05EX05P" + - "VF9MRVNTEAYSFQoRQ09ORF9HUkVBVEVSX1RIQU4QBxIOCgpDT05EX05FVkVS" + - "EAgivAIKCU9wZXJhdGlvbhIwCgh0YWJsZV9pZBgBIAIoCzIeLmJuZXQucHJv" + - "dG9jb2wuc3RvcmFnZS5UYWJsZUlkEjIKCWNvbHVtbl9pZBgCIAEoCzIfLmJu" + - "ZXQucHJvdG9jb2wuc3RvcmFnZS5Db2x1bW5JZBIsCgZyb3dfaWQYAyABKAsy" + - "HC5ibmV0LnByb3RvY29sLnN0b3JhZ2UuUm93SWQSDwoHcm93X2tleRgEIAEo" + - "DBIPCgd2ZXJzaW9uGAUgASgGEiwKBHJvcHMYBiADKAsyHi5ibmV0LnByb3Rv" + - "Y29sLnN0b3JhZ2UuQ29tbWFuZBIWCg5tdXRhdGVfdmVyc2lvbhgHIAEoBhIz" + - "Cglwcml2aWxlZ2UYCCABKAsyIC5ibmV0LnByb3RvY29sLnN0b3JhZ2UuUHJp" + - "dmlsZWdlIpgBCgRDZWxsEjIKCWNvbHVtbl9pZBgBIAIoCzIfLmJuZXQucHJv" + - "dG9jb2wuc3RvcmFnZS5Db2x1bW5JZBIsCgZyb3dfaWQYAiACKAsyHC5ibmV0" + - "LnByb3RvY29sLnN0b3JhZ2UuUm93SWQSDwoHcm93X2tleRgDIAEoDBIPCgd2" + - "ZXJzaW9uGAQgASgGEgwKBGRhdGEYBSABKAwihQEKD09wZXJhdGlvblJlc3Vs" + - "dBIVCgplcnJvcl9jb2RlGAEgASgNOgEwEjAKCHRhYmxlX2lkGAIgAigLMh4u" + - "Ym5ldC5wcm90b2NvbC5zdG9yYWdlLlRhYmxlSWQSKQoEZGF0YRgDIAMoCzIb" + - "LmJuZXQucHJvdG9jb2wuc3RvcmFnZS5DZWxsItMBChBPcGVuVGFibGVSZXF1" + - "ZXN0EhcKBnNjaGVtYRgBIAEoCToHREVGQVVMVBIzCglwcml2aWxlZ2UYAiAB" + - "KAsyIC5ibmV0LnByb3RvY29sLnN0b3JhZ2UuUHJpdmlsZWdlEjAKCHRhYmxl" + - "X2lkGAMgAigLMh4uYm5ldC5wcm90b2NvbC5zdG9yYWdlLlRhYmxlSWQSKQoI" + - "YWdlbnRfaWQYBCABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEhQKDHBy" + - "b2Nlc3NfbmFtZRgFIAEoCSITChFPcGVuVGFibGVSZXNwb25zZSKcAgoRT3Bl" + - "bkNvbHVtblJlcXVlc3QSFwoGc2NoZW1hGAEgASgJOgdERUZBVUxUEjMKCXBy" + - "aXZpbGVnZRgCIAEoCzIgLmJuZXQucHJvdG9jb2wuc3RvcmFnZS5Qcml2aWxl" + - "Z2USMAoIdGFibGVfaWQYBCACKAsyHi5ibmV0LnByb3RvY29sLnN0b3JhZ2Uu" + - "VGFibGVJZBIyCgljb2x1bW5faWQYBSACKAsyHy5ibmV0LnByb3RvY29sLnN0" + - "b3JhZ2UuQ29sdW1uSWQSEgoKcHJvdG9fdHlwZRgGIAEoCRIpCghhZ2VudF9p" + - "ZBgHIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSFAoMcHJvY2Vzc19u" + - "YW1lGAggASgJIjUKEk9wZW5Db2x1bW5SZXNwb25zZRIfChBzZXJ2ZXJfZmll" + - "bGRfb3BzGAIgASgIOgVmYWxzZSL9AgoORXhlY3V0ZVJlcXVlc3QSFwoGc2No" + - "ZW1hGAEgASgJOgdERUZBVUxUEjMKCXByaXZpbGVnZRgCIAEoCzIgLmJuZXQu" + - "cHJvdG9jb2wuc3RvcmFnZS5Qcml2aWxlZ2USGAoJcmVhZF9vbmx5GAMgASgI" + - "OgVmYWxzZRIcCg13YW50c19yb3dfa2V5GAQgASgIOgVmYWxzZRIgChF3YW50" + - "c19jb2x1bW5fbmFtZRgFIAEoCDoFZmFsc2USHwoNbWF4X2RhdGFfc2l6ZRgG" + - "IAEoDToIMTY3NzcyMTUSNAoKb3BlcmF0aW9ucxgHIAMoCzIgLmJuZXQucHJv" + - "dG9jb2wuc3RvcmFnZS5PcGVyYXRpb24SDwoHdGltZW91dBgMIAEoDRIpCghh" + - "Z2VudF9pZBgJIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSGgoKcXVl" + - "cnlfbmFtZRgKIAEoCToGTm9OYW1lEhQKDHByb2Nlc3NfbmFtZRgLIAEoCSJ4" + - "Cg9FeGVjdXRlUmVzcG9uc2USFQoKZXJyb3JfY29kZRgBIAEoDToBMBI3Cgdy" + - "ZXN1bHRzGAIgAygLMiYuYm5ldC5wcm90b2NvbC5zdG9yYWdlLk9wZXJhdGlv" + - "blJlc3VsdBIVCg1lcnJvcl9tZXNzYWdlGAMgASgJMq0CCg5TdG9yYWdlU2Vy" + - "dmljZRJYCgdFeGVjdXRlEiUuYm5ldC5wcm90b2NvbC5zdG9yYWdlLkV4ZWN1" + - "dGVSZXF1ZXN0GiYuYm5ldC5wcm90b2NvbC5zdG9yYWdlLkV4ZWN1dGVSZXNw" + - "b25zZRJeCglPcGVuVGFibGUSJy5ibmV0LnByb3RvY29sLnN0b3JhZ2UuT3Bl" + - "blRhYmxlUmVxdWVzdBooLmJuZXQucHJvdG9jb2wuc3RvcmFnZS5PcGVuVGFi" + - "bGVSZXNwb25zZRJhCgpPcGVuQ29sdW1uEiguYm5ldC5wcm90b2NvbC5zdG9y" + - "YWdlLk9wZW5Db2x1bW5SZXF1ZXN0GikuYm5ldC5wcm90b2NvbC5zdG9yYWdl" + - "Lk9wZW5Db2x1bW5SZXNwb25zZUIDgAEB"); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_bnet_protocol_storage_TableId__Descriptor = Descriptor.MessageTypes[0]; - internal__static_bnet_protocol_storage_TableId__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_storage_TableId__Descriptor, - new string[] { "Hash", }); - internal__static_bnet_protocol_storage_ColumnId__Descriptor = Descriptor.MessageTypes[1]; - internal__static_bnet_protocol_storage_ColumnId__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_storage_ColumnId__Descriptor, - new string[] { "Hash", }); - internal__static_bnet_protocol_storage_RowId__Descriptor = Descriptor.MessageTypes[2]; - internal__static_bnet_protocol_storage_RowId__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_storage_RowId__Descriptor, - new string[] { "Hash", }); - internal__static_bnet_protocol_storage_Privilege__Descriptor = Descriptor.MessageTypes[3]; - internal__static_bnet_protocol_storage_Privilege__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_storage_Privilege__Descriptor, - new string[] { "Bits", "Program", }); - internal__static_bnet_protocol_storage_ScanOperation__Descriptor = Descriptor.MessageTypes[4]; - internal__static_bnet_protocol_storage_ScanOperation__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_storage_ScanOperation__Descriptor, - new string[] { "Op", "Field", }); - internal__static_bnet_protocol_storage_Command__Descriptor = Descriptor.MessageTypes[5]; - internal__static_bnet_protocol_storage_Command__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_storage_Command__Descriptor, - new string[] { "Op", "Data", "Fields", "MinVersion", "MaxVersion", "Scan", "Limit", "Condition", "Message", }); - internal__static_bnet_protocol_storage_Operation__Descriptor = Descriptor.MessageTypes[6]; - internal__static_bnet_protocol_storage_Operation__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_storage_Operation__Descriptor, - new string[] { "TableId", "ColumnId", "RowId", "RowKey", "Version", "Rops", "MutateVersion", "Privilege", }); - internal__static_bnet_protocol_storage_Cell__Descriptor = Descriptor.MessageTypes[7]; - internal__static_bnet_protocol_storage_Cell__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_storage_Cell__Descriptor, - new string[] { "ColumnId", "RowId", "RowKey", "Version", "Data", }); - internal__static_bnet_protocol_storage_OperationResult__Descriptor = Descriptor.MessageTypes[8]; - internal__static_bnet_protocol_storage_OperationResult__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_storage_OperationResult__Descriptor, - new string[] { "ErrorCode", "TableId", "Data", }); - internal__static_bnet_protocol_storage_OpenTableRequest__Descriptor = Descriptor.MessageTypes[9]; - internal__static_bnet_protocol_storage_OpenTableRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_storage_OpenTableRequest__Descriptor, - new string[] { "Schema", "Privilege", "TableId", "AgentId", "ProcessName", }); - internal__static_bnet_protocol_storage_OpenTableResponse__Descriptor = Descriptor.MessageTypes[10]; - internal__static_bnet_protocol_storage_OpenTableResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_storage_OpenTableResponse__Descriptor, - new string[] { }); - internal__static_bnet_protocol_storage_OpenColumnRequest__Descriptor = Descriptor.MessageTypes[11]; - internal__static_bnet_protocol_storage_OpenColumnRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_storage_OpenColumnRequest__Descriptor, - new string[] { "Schema", "Privilege", "TableId", "ColumnId", "ProtoType", "AgentId", "ProcessName", }); - internal__static_bnet_protocol_storage_OpenColumnResponse__Descriptor = Descriptor.MessageTypes[12]; - internal__static_bnet_protocol_storage_OpenColumnResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_storage_OpenColumnResponse__Descriptor, - new string[] { "ServerFieldOps", }); - internal__static_bnet_protocol_storage_ExecuteRequest__Descriptor = Descriptor.MessageTypes[13]; - internal__static_bnet_protocol_storage_ExecuteRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_storage_ExecuteRequest__Descriptor, - new string[] { "Schema", "Privilege", "ReadOnly", "WantsRowKey", "WantsColumnName", "MaxDataSize", "Operations", "Timeout", "AgentId", "QueryName", "ProcessName", }); - internal__static_bnet_protocol_storage_ExecuteResponse__Descriptor = Descriptor.MessageTypes[14]; - internal__static_bnet_protocol_storage_ExecuteResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_storage_ExecuteResponse__Descriptor, - new string[] { "ErrorCode", "Results", "ErrorMessage", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::bnet.protocol.Descriptor.Descriptor_, - global::bnet.protocol.Entity.Descriptor, - global::bnet.protocol.Rpc.Descriptor, - }, assigner); - } - #endregion - - } - #region Messages - public sealed partial class TableId : pb::GeneratedMessage { - private static readonly TableId defaultInstance = new Builder().BuildPartial(); - public static TableId DefaultInstance { - get { return defaultInstance; } - } - - public override TableId DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override TableId ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.storage.Storage.internal__static_bnet_protocol_storage_TableId__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.storage.Storage.internal__static_bnet_protocol_storage_TableId__FieldAccessorTable; } - } - - public const int HashFieldNumber = 1; - private bool hasHash; - private pb::ByteString hash_ = pb::ByteString.Empty; - public bool HasHash { - get { return hasHash; } - } - public pb::ByteString Hash { - get { return hash_; } - } - - public override bool IsInitialized { - get { - if (!hasHash) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasHash) { - output.WriteBytes(1, Hash); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasHash) { - size += pb::CodedOutputStream.ComputeBytesSize(1, Hash); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static TableId ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TableId ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TableId ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TableId ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TableId ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TableId ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TableId ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TableId ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TableId ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TableId ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TableId prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - TableId result = new TableId(); - - protected override TableId MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new TableId(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.storage.TableId.Descriptor; } - } - - public override TableId DefaultInstanceForType { - get { return global::bnet.protocol.storage.TableId.DefaultInstance; } - } - - public override TableId BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - TableId returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TableId) { - return MergeFrom((TableId) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TableId other) { - if (other == global::bnet.protocol.storage.TableId.DefaultInstance) return this; - if (other.HasHash) { - Hash = other.Hash; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - Hash = input.ReadBytes(); - break; - } - } - } - } - - - public bool HasHash { - get { return result.HasHash; } - } - public pb::ByteString Hash { - get { return result.Hash; } - set { SetHash(value); } - } - public Builder SetHash(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasHash = true; - result.hash_ = value; - return this; - } - public Builder ClearHash() { - result.hasHash = false; - result.hash_ = pb::ByteString.Empty; - return this; - } - } - static TableId() { - object.ReferenceEquals(global::bnet.protocol.storage.Storage.Descriptor, null); - } - } - - public sealed partial class ColumnId : pb::GeneratedMessage { - private static readonly ColumnId defaultInstance = new Builder().BuildPartial(); - public static ColumnId DefaultInstance { - get { return defaultInstance; } - } - - public override ColumnId DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ColumnId ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.storage.Storage.internal__static_bnet_protocol_storage_ColumnId__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.storage.Storage.internal__static_bnet_protocol_storage_ColumnId__FieldAccessorTable; } - } - - public const int HashFieldNumber = 1; - private bool hasHash; - private pb::ByteString hash_ = pb::ByteString.Empty; - public bool HasHash { - get { return hasHash; } - } - public pb::ByteString Hash { - get { return hash_; } - } - - public override bool IsInitialized { - get { - if (!hasHash) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasHash) { - output.WriteBytes(1, Hash); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasHash) { - size += pb::CodedOutputStream.ComputeBytesSize(1, Hash); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ColumnId ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ColumnId ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ColumnId ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ColumnId ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ColumnId ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ColumnId ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ColumnId ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ColumnId ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ColumnId ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ColumnId ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ColumnId prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ColumnId result = new ColumnId(); - - protected override ColumnId MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ColumnId(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.storage.ColumnId.Descriptor; } - } - - public override ColumnId DefaultInstanceForType { - get { return global::bnet.protocol.storage.ColumnId.DefaultInstance; } - } - - public override ColumnId BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - ColumnId returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ColumnId) { - return MergeFrom((ColumnId) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ColumnId other) { - if (other == global::bnet.protocol.storage.ColumnId.DefaultInstance) return this; - if (other.HasHash) { - Hash = other.Hash; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - Hash = input.ReadBytes(); - break; - } - } - } - } - - - public bool HasHash { - get { return result.HasHash; } - } - public pb::ByteString Hash { - get { return result.Hash; } - set { SetHash(value); } - } - public Builder SetHash(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasHash = true; - result.hash_ = value; - return this; - } - public Builder ClearHash() { - result.hasHash = false; - result.hash_ = pb::ByteString.Empty; - return this; - } - } - static ColumnId() { - object.ReferenceEquals(global::bnet.protocol.storage.Storage.Descriptor, null); - } - } - - public sealed partial class RowId : pb::GeneratedMessage { - private static readonly RowId defaultInstance = new Builder().BuildPartial(); - public static RowId DefaultInstance { - get { return defaultInstance; } - } - - public override RowId DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override RowId ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.storage.Storage.internal__static_bnet_protocol_storage_RowId__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.storage.Storage.internal__static_bnet_protocol_storage_RowId__FieldAccessorTable; } - } - - public const int HashFieldNumber = 1; - private bool hasHash; - private pb::ByteString hash_ = pb::ByteString.Empty; - public bool HasHash { - get { return hasHash; } - } - public pb::ByteString Hash { - get { return hash_; } - } - - public override bool IsInitialized { - get { - if (!hasHash) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasHash) { - output.WriteBytes(1, Hash); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasHash) { - size += pb::CodedOutputStream.ComputeBytesSize(1, Hash); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static RowId ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RowId ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RowId ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RowId ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RowId ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RowId ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static RowId ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static RowId ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static RowId ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RowId ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(RowId prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - RowId result = new RowId(); - - protected override RowId MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new RowId(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.storage.RowId.Descriptor; } - } - - public override RowId DefaultInstanceForType { - get { return global::bnet.protocol.storage.RowId.DefaultInstance; } - } - - public override RowId BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - RowId returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is RowId) { - return MergeFrom((RowId) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(RowId other) { - if (other == global::bnet.protocol.storage.RowId.DefaultInstance) return this; - if (other.HasHash) { - Hash = other.Hash; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - Hash = input.ReadBytes(); - break; - } - } - } - } - - - public bool HasHash { - get { return result.HasHash; } - } - public pb::ByteString Hash { - get { return result.Hash; } - set { SetHash(value); } - } - public Builder SetHash(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasHash = true; - result.hash_ = value; - return this; - } - public Builder ClearHash() { - result.hasHash = false; - result.hash_ = pb::ByteString.Empty; - return this; - } - } - static RowId() { - object.ReferenceEquals(global::bnet.protocol.storage.Storage.Descriptor, null); - } - } - - public sealed partial class Privilege : pb::GeneratedMessage { - private static readonly Privilege defaultInstance = new Builder().BuildPartial(); - public static Privilege DefaultInstance { - get { return defaultInstance; } - } - - public override Privilege DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override Privilege ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.storage.Storage.internal__static_bnet_protocol_storage_Privilege__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.storage.Storage.internal__static_bnet_protocol_storage_Privilege__FieldAccessorTable; } - } - - #region Nested types - public static class Types { - public enum Permission { - OWNER = 1, - FRIEND = 2, - OTHER = 4, - GAME = 8, - ALL = 15, - } - - } - #endregion - - public const int BitsFieldNumber = 1; - private bool hasBits; - private ulong bits_ = 0; - public bool HasBits { - get { return hasBits; } - } - public ulong Bits { - get { return bits_; } - } - - public const int ProgramFieldNumber = 2; - private bool hasProgram; - private uint program_ = 0; - public bool HasProgram { - get { return hasProgram; } - } - public uint Program { - get { return program_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasBits) { - output.WriteFixed64(1, Bits); - } - if (HasProgram) { - output.WriteFixed32(2, Program); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasBits) { - size += pb::CodedOutputStream.ComputeFixed64Size(1, Bits); - } - if (HasProgram) { - size += pb::CodedOutputStream.ComputeFixed32Size(2, Program); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static Privilege ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Privilege ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Privilege ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Privilege ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Privilege ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Privilege ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Privilege ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Privilege ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Privilege ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Privilege ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Privilege prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - Privilege result = new Privilege(); - - protected override Privilege MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new Privilege(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.storage.Privilege.Descriptor; } - } - - public override Privilege DefaultInstanceForType { - get { return global::bnet.protocol.storage.Privilege.DefaultInstance; } - } - - public override Privilege BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - Privilege returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Privilege) { - return MergeFrom((Privilege) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Privilege other) { - if (other == global::bnet.protocol.storage.Privilege.DefaultInstance) return this; - if (other.HasBits) { - Bits = other.Bits; - } - if (other.HasProgram) { - Program = other.Program; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 9: { - Bits = input.ReadFixed64(); - break; - } - case 21: { - Program = input.ReadFixed32(); - break; - } - } - } - } - - - public bool HasBits { - get { return result.HasBits; } - } - public ulong Bits { - get { return result.Bits; } - set { SetBits(value); } - } - public Builder SetBits(ulong value) { - result.hasBits = true; - result.bits_ = value; - return this; - } - public Builder ClearBits() { - result.hasBits = false; - result.bits_ = 0; - return this; - } - - public bool HasProgram { - get { return result.HasProgram; } - } - public uint Program { - get { return result.Program; } - set { SetProgram(value); } - } - public Builder SetProgram(uint value) { - result.hasProgram = true; - result.program_ = value; - return this; - } - public Builder ClearProgram() { - result.hasProgram = false; - result.program_ = 0; - return this; - } - } - static Privilege() { - object.ReferenceEquals(global::bnet.protocol.storage.Storage.Descriptor, null); - } - } - - public sealed partial class ScanOperation : pb::GeneratedMessage { - private static readonly ScanOperation defaultInstance = new Builder().BuildPartial(); - public static ScanOperation DefaultInstance { - get { return defaultInstance; } - } - - public override ScanOperation DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ScanOperation ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.storage.Storage.internal__static_bnet_protocol_storage_ScanOperation__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.storage.Storage.internal__static_bnet_protocol_storage_ScanOperation__FieldAccessorTable; } - } - - #region Nested types - public static class Types { - public enum Op { - IS_CLEAR = 1, - NOT_CLEAR = 2, - IS_EQUALS = 3, - NOT_EQUALS = 4, - IS_GREATER_THAN = 5, - NOT_GREATER_THAN = 6, - IS_LESS_THAN = 7, - NOT_LESS_THAN = 8, - } - - } - #endregion - - public const int OpFieldNumber = 1; - private bool hasOp; - private global::bnet.protocol.storage.ScanOperation.Types.Op op_ = global::bnet.protocol.storage.ScanOperation.Types.Op.IS_CLEAR; - public bool HasOp { - get { return hasOp; } - } - public global::bnet.protocol.storage.ScanOperation.Types.Op Op { - get { return op_; } - } - - public const int FieldFieldNumber = 2; - private bool hasField; - private global::bnet.protocol.Path field_ = global::bnet.protocol.Path.DefaultInstance; - public bool HasField { - get { return hasField; } - } - public global::bnet.protocol.Path Field { - get { return field_; } - } - - public override bool IsInitialized { - get { - if (!hasOp) return false; - if (!hasField) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasOp) { - output.WriteEnum(1, (int) Op); - } - if (HasField) { - output.WriteMessage(2, Field); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasOp) { - size += pb::CodedOutputStream.ComputeEnumSize(1, (int) Op); - } - if (HasField) { - size += pb::CodedOutputStream.ComputeMessageSize(2, Field); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ScanOperation ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ScanOperation ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ScanOperation ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ScanOperation ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ScanOperation ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ScanOperation ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ScanOperation ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ScanOperation ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ScanOperation ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ScanOperation ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ScanOperation prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ScanOperation result = new ScanOperation(); - - protected override ScanOperation MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ScanOperation(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.storage.ScanOperation.Descriptor; } - } - - public override ScanOperation DefaultInstanceForType { - get { return global::bnet.protocol.storage.ScanOperation.DefaultInstance; } - } - - public override ScanOperation BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - ScanOperation returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ScanOperation) { - return MergeFrom((ScanOperation) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ScanOperation other) { - if (other == global::bnet.protocol.storage.ScanOperation.DefaultInstance) return this; - if (other.HasOp) { - Op = other.Op; - } - if (other.HasField) { - MergeField(other.Field); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - int rawValue = input.ReadEnum(); - if (!global::System.Enum.IsDefined(typeof(global::bnet.protocol.storage.ScanOperation.Types.Op), rawValue)) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(1, (ulong) rawValue); - } else { - Op = (global::bnet.protocol.storage.ScanOperation.Types.Op) rawValue; - } - break; - } - case 18: { - global::bnet.protocol.Path.Builder subBuilder = global::bnet.protocol.Path.CreateBuilder(); - if (HasField) { - subBuilder.MergeFrom(Field); - } - input.ReadMessage(subBuilder, extensionRegistry); - Field = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasOp { - get { return result.HasOp; } - } - public global::bnet.protocol.storage.ScanOperation.Types.Op Op { - get { return result.Op; } - set { SetOp(value); } - } - public Builder SetOp(global::bnet.protocol.storage.ScanOperation.Types.Op value) { - result.hasOp = true; - result.op_ = value; - return this; - } - public Builder ClearOp() { - result.hasOp = false; - result.op_ = global::bnet.protocol.storage.ScanOperation.Types.Op.IS_CLEAR; - return this; - } - - public bool HasField { - get { return result.HasField; } - } - public global::bnet.protocol.Path Field { - get { return result.Field; } - set { SetField(value); } - } - public Builder SetField(global::bnet.protocol.Path value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasField = true; - result.field_ = value; - return this; - } - public Builder SetField(global::bnet.protocol.Path.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasField = true; - result.field_ = builderForValue.Build(); - return this; - } - public Builder MergeField(global::bnet.protocol.Path value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasField && - result.field_ != global::bnet.protocol.Path.DefaultInstance) { - result.field_ = global::bnet.protocol.Path.CreateBuilder(result.field_).MergeFrom(value).BuildPartial(); - } else { - result.field_ = value; - } - result.hasField = true; - return this; - } - public Builder ClearField() { - result.hasField = false; - result.field_ = global::bnet.protocol.Path.DefaultInstance; - return this; - } - } - static ScanOperation() { - object.ReferenceEquals(global::bnet.protocol.storage.Storage.Descriptor, null); - } - } - - public sealed partial class Command : pb::GeneratedMessage { - private static readonly Command defaultInstance = new Builder().BuildPartial(); - public static Command DefaultInstance { - get { return defaultInstance; } - } - - public override Command DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override Command ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.storage.Storage.internal__static_bnet_protocol_storage_Command__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.storage.Storage.internal__static_bnet_protocol_storage_Command__FieldAccessorTable; } - } - - #region Nested types - public static class Types { - public enum Op { - ROW_DELETE = 1, - ROW_FETCH = 2, - COL_DELETE = 3, - COL_FETCH = 4, - COL_WRITE = 5, - COL_MERGE = 6, - FLD_CLEAR = 7, - FLD_FETCH = 8, - FLD_WRITE = 9, - FLD_MERGE = 10, - FLD_INCR = 11, - FLD_TEST = 12, - FLD_SCAN = 13, - ROW_TEST = 14, - COL_TEST = 15, - FLD_SMAX = 16, - COL_COND = 17, - FLD_COND = 18, - COND_POP = 19, - LOG_DEBUG = 20, - } - - public enum Cond { - COND_ALWAYS = 0, - COND_NOT_EXISTS = 1, - COND_NOT_EQUAL = 2, - COND_LESS_THAN = 3, - COND_NOT_GREATER = 4, - COND_EQUALS = 5, - COND_NOT_LESS = 6, - COND_GREATER_THAN = 7, - COND_NEVER = 8, - } - - } - #endregion - - public const int OpFieldNumber = 1; - private bool hasOp; - private global::bnet.protocol.storage.Command.Types.Op op_ = global::bnet.protocol.storage.Command.Types.Op.ROW_DELETE; - public bool HasOp { - get { return hasOp; } - } - public global::bnet.protocol.storage.Command.Types.Op Op { - get { return op_; } - } - - public const int DataFieldNumber = 2; - private bool hasData; - private pb::ByteString data_ = pb::ByteString.Empty; - public bool HasData { - get { return hasData; } - } - public pb::ByteString Data { - get { return data_; } - } - - public const int FieldsFieldNumber = 3; - private pbc::PopsicleList fields_ = new pbc::PopsicleList(); - public scg::IList FieldsList { - get { return fields_; } - } - public int FieldsCount { - get { return fields_.Count; } - } - public global::bnet.protocol.Path GetFields(int index) { - return fields_[index]; - } - - public const int MinVersionFieldNumber = 4; - private bool hasMinVersion; - private ulong minVersion_ = 0; - public bool HasMinVersion { - get { return hasMinVersion; } - } - public ulong MinVersion { - get { return minVersion_; } - } - - public const int MaxVersionFieldNumber = 5; - private bool hasMaxVersion; - private ulong maxVersion_ = 0; - public bool HasMaxVersion { - get { return hasMaxVersion; } - } - public ulong MaxVersion { - get { return maxVersion_; } - } - - public const int ScanFieldNumber = 6; - private bool hasScan; - private global::bnet.protocol.storage.ScanOperation scan_ = global::bnet.protocol.storage.ScanOperation.DefaultInstance; - public bool HasScan { - get { return hasScan; } - } - public global::bnet.protocol.storage.ScanOperation Scan { - get { return scan_; } - } - - public const int LimitFieldNumber = 7; - private bool hasLimit; - private uint limit_ = 0; - public bool HasLimit { - get { return hasLimit; } - } - public uint Limit { - get { return limit_; } - } - - public const int ConditionFieldNumber = 8; - private bool hasCondition; - private global::bnet.protocol.storage.Command.Types.Cond condition_ = global::bnet.protocol.storage.Command.Types.Cond.COND_ALWAYS; - public bool HasCondition { - get { return hasCondition; } - } - public global::bnet.protocol.storage.Command.Types.Cond Condition { - get { return condition_; } - } - - public const int MessageFieldNumber = 11; - private bool hasMessage; - private string message_ = ""; - public bool HasMessage { - get { return hasMessage; } - } - public string Message { - get { return message_; } - } - - public override bool IsInitialized { - get { - if (!hasOp) return false; - if (HasScan) { - if (!Scan.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasOp) { - output.WriteEnum(1, (int) Op); - } - if (HasData) { - output.WriteBytes(2, Data); - } - foreach (global::bnet.protocol.Path element in FieldsList) { - output.WriteMessage(3, element); - } - if (HasMinVersion) { - output.WriteFixed64(4, MinVersion); - } - if (HasMaxVersion) { - output.WriteFixed64(5, MaxVersion); - } - if (HasScan) { - output.WriteMessage(6, Scan); - } - if (HasLimit) { - output.WriteUInt32(7, Limit); - } - if (HasCondition) { - output.WriteEnum(8, (int) Condition); - } - if (HasMessage) { - output.WriteString(11, Message); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasOp) { - size += pb::CodedOutputStream.ComputeEnumSize(1, (int) Op); - } - if (HasData) { - size += pb::CodedOutputStream.ComputeBytesSize(2, Data); - } - foreach (global::bnet.protocol.Path element in FieldsList) { - size += pb::CodedOutputStream.ComputeMessageSize(3, element); - } - if (HasMinVersion) { - size += pb::CodedOutputStream.ComputeFixed64Size(4, MinVersion); - } - if (HasMaxVersion) { - size += pb::CodedOutputStream.ComputeFixed64Size(5, MaxVersion); - } - if (HasScan) { - size += pb::CodedOutputStream.ComputeMessageSize(6, Scan); - } - if (HasLimit) { - size += pb::CodedOutputStream.ComputeUInt32Size(7, Limit); - } - if (HasCondition) { - size += pb::CodedOutputStream.ComputeEnumSize(8, (int) Condition); - } - if (HasMessage) { - size += pb::CodedOutputStream.ComputeStringSize(11, Message); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static Command ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Command ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Command ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Command ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Command ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Command ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Command ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Command ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Command ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Command ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Command prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - Command result = new Command(); - - protected override Command MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new Command(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.storage.Command.Descriptor; } - } - - public override Command DefaultInstanceForType { - get { return global::bnet.protocol.storage.Command.DefaultInstance; } - } - - public override Command BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.fields_.MakeReadOnly(); - Command returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Command) { - return MergeFrom((Command) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Command other) { - if (other == global::bnet.protocol.storage.Command.DefaultInstance) return this; - if (other.HasOp) { - Op = other.Op; - } - if (other.HasData) { - Data = other.Data; - } - if (other.fields_.Count != 0) { - base.AddRange(other.fields_, result.fields_); - } - if (other.HasMinVersion) { - MinVersion = other.MinVersion; - } - if (other.HasMaxVersion) { - MaxVersion = other.MaxVersion; - } - if (other.HasScan) { - MergeScan(other.Scan); - } - if (other.HasLimit) { - Limit = other.Limit; - } - if (other.HasCondition) { - Condition = other.Condition; - } - if (other.HasMessage) { - Message = other.Message; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - int rawValue = input.ReadEnum(); - if (!global::System.Enum.IsDefined(typeof(global::bnet.protocol.storage.Command.Types.Op), rawValue)) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(1, (ulong) rawValue); - } else { - Op = (global::bnet.protocol.storage.Command.Types.Op) rawValue; - } - break; - } - case 18: { - Data = input.ReadBytes(); - break; - } - case 26: { - global::bnet.protocol.Path.Builder subBuilder = global::bnet.protocol.Path.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddFields(subBuilder.BuildPartial()); - break; - } - case 33: { - MinVersion = input.ReadFixed64(); - break; - } - case 41: { - MaxVersion = input.ReadFixed64(); - break; - } - case 50: { - global::bnet.protocol.storage.ScanOperation.Builder subBuilder = global::bnet.protocol.storage.ScanOperation.CreateBuilder(); - if (HasScan) { - subBuilder.MergeFrom(Scan); - } - input.ReadMessage(subBuilder, extensionRegistry); - Scan = subBuilder.BuildPartial(); - break; - } - case 56: { - Limit = input.ReadUInt32(); - break; - } - case 64: { - int rawValue = input.ReadEnum(); - if (!global::System.Enum.IsDefined(typeof(global::bnet.protocol.storage.Command.Types.Cond), rawValue)) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(8, (ulong) rawValue); - } else { - Condition = (global::bnet.protocol.storage.Command.Types.Cond) rawValue; - } - break; - } - case 90: { - Message = input.ReadString(); - break; - } - } - } - } - - - public bool HasOp { - get { return result.HasOp; } - } - public global::bnet.protocol.storage.Command.Types.Op Op { - get { return result.Op; } - set { SetOp(value); } - } - public Builder SetOp(global::bnet.protocol.storage.Command.Types.Op value) { - result.hasOp = true; - result.op_ = value; - return this; - } - public Builder ClearOp() { - result.hasOp = false; - result.op_ = global::bnet.protocol.storage.Command.Types.Op.ROW_DELETE; - return this; - } - - public bool HasData { - get { return result.HasData; } - } - public pb::ByteString Data { - get { return result.Data; } - set { SetData(value); } - } - public Builder SetData(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasData = true; - result.data_ = value; - return this; - } - public Builder ClearData() { - result.hasData = false; - result.data_ = pb::ByteString.Empty; - return this; - } - - public pbc::IPopsicleList FieldsList { - get { return result.fields_; } - } - public int FieldsCount { - get { return result.FieldsCount; } - } - public global::bnet.protocol.Path GetFields(int index) { - return result.GetFields(index); - } - public Builder SetFields(int index, global::bnet.protocol.Path value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.fields_[index] = value; - return this; - } - public Builder SetFields(int index, global::bnet.protocol.Path.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.fields_[index] = builderForValue.Build(); - return this; - } - public Builder AddFields(global::bnet.protocol.Path value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.fields_.Add(value); - return this; - } - public Builder AddFields(global::bnet.protocol.Path.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.fields_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeFields(scg::IEnumerable values) { - base.AddRange(values, result.fields_); - return this; - } - public Builder ClearFields() { - result.fields_.Clear(); - return this; - } - - public bool HasMinVersion { - get { return result.HasMinVersion; } - } - public ulong MinVersion { - get { return result.MinVersion; } - set { SetMinVersion(value); } - } - public Builder SetMinVersion(ulong value) { - result.hasMinVersion = true; - result.minVersion_ = value; - return this; - } - public Builder ClearMinVersion() { - result.hasMinVersion = false; - result.minVersion_ = 0; - return this; - } - - public bool HasMaxVersion { - get { return result.HasMaxVersion; } - } - public ulong MaxVersion { - get { return result.MaxVersion; } - set { SetMaxVersion(value); } - } - public Builder SetMaxVersion(ulong value) { - result.hasMaxVersion = true; - result.maxVersion_ = value; - return this; - } - public Builder ClearMaxVersion() { - result.hasMaxVersion = false; - result.maxVersion_ = 0; - return this; - } - - public bool HasScan { - get { return result.HasScan; } - } - public global::bnet.protocol.storage.ScanOperation Scan { - get { return result.Scan; } - set { SetScan(value); } - } - public Builder SetScan(global::bnet.protocol.storage.ScanOperation value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasScan = true; - result.scan_ = value; - return this; - } - public Builder SetScan(global::bnet.protocol.storage.ScanOperation.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasScan = true; - result.scan_ = builderForValue.Build(); - return this; - } - public Builder MergeScan(global::bnet.protocol.storage.ScanOperation value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasScan && - result.scan_ != global::bnet.protocol.storage.ScanOperation.DefaultInstance) { - result.scan_ = global::bnet.protocol.storage.ScanOperation.CreateBuilder(result.scan_).MergeFrom(value).BuildPartial(); - } else { - result.scan_ = value; - } - result.hasScan = true; - return this; - } - public Builder ClearScan() { - result.hasScan = false; - result.scan_ = global::bnet.protocol.storage.ScanOperation.DefaultInstance; - return this; - } - - public bool HasLimit { - get { return result.HasLimit; } - } - public uint Limit { - get { return result.Limit; } - set { SetLimit(value); } - } - public Builder SetLimit(uint value) { - result.hasLimit = true; - result.limit_ = value; - return this; - } - public Builder ClearLimit() { - result.hasLimit = false; - result.limit_ = 0; - return this; - } - - public bool HasCondition { - get { return result.HasCondition; } - } - public global::bnet.protocol.storage.Command.Types.Cond Condition { - get { return result.Condition; } - set { SetCondition(value); } - } - public Builder SetCondition(global::bnet.protocol.storage.Command.Types.Cond value) { - result.hasCondition = true; - result.condition_ = value; - return this; - } - public Builder ClearCondition() { - result.hasCondition = false; - result.condition_ = global::bnet.protocol.storage.Command.Types.Cond.COND_ALWAYS; - return this; - } - - public bool HasMessage { - get { return result.HasMessage; } - } - public string Message { - get { return result.Message; } - set { SetMessage(value); } - } - public Builder SetMessage(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasMessage = true; - result.message_ = value; - return this; - } - public Builder ClearMessage() { - result.hasMessage = false; - result.message_ = ""; - return this; - } - } - static Command() { - object.ReferenceEquals(global::bnet.protocol.storage.Storage.Descriptor, null); - } - } - - public sealed partial class Operation : pb::GeneratedMessage { - private static readonly Operation defaultInstance = new Builder().BuildPartial(); - public static Operation DefaultInstance { - get { return defaultInstance; } - } - - public override Operation DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override Operation ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.storage.Storage.internal__static_bnet_protocol_storage_Operation__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.storage.Storage.internal__static_bnet_protocol_storage_Operation__FieldAccessorTable; } - } - - public const int TableIdFieldNumber = 1; - private bool hasTableId; - private global::bnet.protocol.storage.TableId tableId_ = global::bnet.protocol.storage.TableId.DefaultInstance; - public bool HasTableId { - get { return hasTableId; } - } - public global::bnet.protocol.storage.TableId TableId { - get { return tableId_; } - } - - public const int ColumnIdFieldNumber = 2; - private bool hasColumnId; - private global::bnet.protocol.storage.ColumnId columnId_ = global::bnet.protocol.storage.ColumnId.DefaultInstance; - public bool HasColumnId { - get { return hasColumnId; } - } - public global::bnet.protocol.storage.ColumnId ColumnId { - get { return columnId_; } - } - - public const int RowIdFieldNumber = 3; - private bool hasRowId; - private global::bnet.protocol.storage.RowId rowId_ = global::bnet.protocol.storage.RowId.DefaultInstance; - public bool HasRowId { - get { return hasRowId; } - } - public global::bnet.protocol.storage.RowId RowId { - get { return rowId_; } - } - - public const int RowKeyFieldNumber = 4; - private bool hasRowKey; - private pb::ByteString rowKey_ = pb::ByteString.Empty; - public bool HasRowKey { - get { return hasRowKey; } - } - public pb::ByteString RowKey { - get { return rowKey_; } - } - - public const int VersionFieldNumber = 5; - private bool hasVersion; - private ulong version_ = 0; - public bool HasVersion { - get { return hasVersion; } - } - public ulong Version { - get { return version_; } - } - - public const int RopsFieldNumber = 6; - private pbc::PopsicleList rops_ = new pbc::PopsicleList(); - public scg::IList RopsList { - get { return rops_; } - } - public int RopsCount { - get { return rops_.Count; } - } - public global::bnet.protocol.storage.Command GetRops(int index) { - return rops_[index]; - } - - public const int MutateVersionFieldNumber = 7; - private bool hasMutateVersion; - private ulong mutateVersion_ = 0; - public bool HasMutateVersion { - get { return hasMutateVersion; } - } - public ulong MutateVersion { - get { return mutateVersion_; } - } - - public const int PrivilegeFieldNumber = 8; - private bool hasPrivilege; - private global::bnet.protocol.storage.Privilege privilege_ = global::bnet.protocol.storage.Privilege.DefaultInstance; - public bool HasPrivilege { - get { return hasPrivilege; } - } - public global::bnet.protocol.storage.Privilege Privilege { - get { return privilege_; } - } - - public override bool IsInitialized { - get { - if (!hasTableId) return false; - if (!TableId.IsInitialized) return false; - if (HasColumnId) { - if (!ColumnId.IsInitialized) return false; - } - if (HasRowId) { - if (!RowId.IsInitialized) return false; - } - foreach (global::bnet.protocol.storage.Command element in RopsList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasTableId) { - output.WriteMessage(1, TableId); - } - if (HasColumnId) { - output.WriteMessage(2, ColumnId); - } - if (HasRowId) { - output.WriteMessage(3, RowId); - } - if (HasRowKey) { - output.WriteBytes(4, RowKey); - } - if (HasVersion) { - output.WriteFixed64(5, Version); - } - foreach (global::bnet.protocol.storage.Command element in RopsList) { - output.WriteMessage(6, element); - } - if (HasMutateVersion) { - output.WriteFixed64(7, MutateVersion); - } - if (HasPrivilege) { - output.WriteMessage(8, Privilege); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasTableId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, TableId); - } - if (HasColumnId) { - size += pb::CodedOutputStream.ComputeMessageSize(2, ColumnId); - } - if (HasRowId) { - size += pb::CodedOutputStream.ComputeMessageSize(3, RowId); - } - if (HasRowKey) { - size += pb::CodedOutputStream.ComputeBytesSize(4, RowKey); - } - if (HasVersion) { - size += pb::CodedOutputStream.ComputeFixed64Size(5, Version); - } - foreach (global::bnet.protocol.storage.Command element in RopsList) { - size += pb::CodedOutputStream.ComputeMessageSize(6, element); - } - if (HasMutateVersion) { - size += pb::CodedOutputStream.ComputeFixed64Size(7, MutateVersion); - } - if (HasPrivilege) { - size += pb::CodedOutputStream.ComputeMessageSize(8, Privilege); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static Operation ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Operation ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Operation ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Operation ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Operation ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Operation ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Operation ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Operation ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Operation ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Operation ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Operation prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - Operation result = new Operation(); - - protected override Operation MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new Operation(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.storage.Operation.Descriptor; } - } - - public override Operation DefaultInstanceForType { - get { return global::bnet.protocol.storage.Operation.DefaultInstance; } - } - - public override Operation BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.rops_.MakeReadOnly(); - Operation returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Operation) { - return MergeFrom((Operation) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Operation other) { - if (other == global::bnet.protocol.storage.Operation.DefaultInstance) return this; - if (other.HasTableId) { - MergeTableId(other.TableId); - } - if (other.HasColumnId) { - MergeColumnId(other.ColumnId); - } - if (other.HasRowId) { - MergeRowId(other.RowId); - } - if (other.HasRowKey) { - RowKey = other.RowKey; - } - if (other.HasVersion) { - Version = other.Version; - } - if (other.rops_.Count != 0) { - base.AddRange(other.rops_, result.rops_); - } - if (other.HasMutateVersion) { - MutateVersion = other.MutateVersion; - } - if (other.HasPrivilege) { - MergePrivilege(other.Privilege); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.storage.TableId.Builder subBuilder = global::bnet.protocol.storage.TableId.CreateBuilder(); - if (HasTableId) { - subBuilder.MergeFrom(TableId); - } - input.ReadMessage(subBuilder, extensionRegistry); - TableId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.storage.ColumnId.Builder subBuilder = global::bnet.protocol.storage.ColumnId.CreateBuilder(); - if (HasColumnId) { - subBuilder.MergeFrom(ColumnId); - } - input.ReadMessage(subBuilder, extensionRegistry); - ColumnId = subBuilder.BuildPartial(); - break; - } - case 26: { - global::bnet.protocol.storage.RowId.Builder subBuilder = global::bnet.protocol.storage.RowId.CreateBuilder(); - if (HasRowId) { - subBuilder.MergeFrom(RowId); - } - input.ReadMessage(subBuilder, extensionRegistry); - RowId = subBuilder.BuildPartial(); - break; - } - case 34: { - RowKey = input.ReadBytes(); - break; - } - case 41: { - Version = input.ReadFixed64(); - break; - } - case 50: { - global::bnet.protocol.storage.Command.Builder subBuilder = global::bnet.protocol.storage.Command.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddRops(subBuilder.BuildPartial()); - break; - } - case 57: { - MutateVersion = input.ReadFixed64(); - break; - } - case 66: { - global::bnet.protocol.storage.Privilege.Builder subBuilder = global::bnet.protocol.storage.Privilege.CreateBuilder(); - if (HasPrivilege) { - subBuilder.MergeFrom(Privilege); - } - input.ReadMessage(subBuilder, extensionRegistry); - Privilege = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasTableId { - get { return result.HasTableId; } - } - public global::bnet.protocol.storage.TableId TableId { - get { return result.TableId; } - set { SetTableId(value); } - } - public Builder SetTableId(global::bnet.protocol.storage.TableId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasTableId = true; - result.tableId_ = value; - return this; - } - public Builder SetTableId(global::bnet.protocol.storage.TableId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasTableId = true; - result.tableId_ = builderForValue.Build(); - return this; - } - public Builder MergeTableId(global::bnet.protocol.storage.TableId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasTableId && - result.tableId_ != global::bnet.protocol.storage.TableId.DefaultInstance) { - result.tableId_ = global::bnet.protocol.storage.TableId.CreateBuilder(result.tableId_).MergeFrom(value).BuildPartial(); - } else { - result.tableId_ = value; - } - result.hasTableId = true; - return this; - } - public Builder ClearTableId() { - result.hasTableId = false; - result.tableId_ = global::bnet.protocol.storage.TableId.DefaultInstance; - return this; - } - - public bool HasColumnId { - get { return result.HasColumnId; } - } - public global::bnet.protocol.storage.ColumnId ColumnId { - get { return result.ColumnId; } - set { SetColumnId(value); } - } - public Builder SetColumnId(global::bnet.protocol.storage.ColumnId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasColumnId = true; - result.columnId_ = value; - return this; - } - public Builder SetColumnId(global::bnet.protocol.storage.ColumnId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasColumnId = true; - result.columnId_ = builderForValue.Build(); - return this; - } - public Builder MergeColumnId(global::bnet.protocol.storage.ColumnId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasColumnId && - result.columnId_ != global::bnet.protocol.storage.ColumnId.DefaultInstance) { - result.columnId_ = global::bnet.protocol.storage.ColumnId.CreateBuilder(result.columnId_).MergeFrom(value).BuildPartial(); - } else { - result.columnId_ = value; - } - result.hasColumnId = true; - return this; - } - public Builder ClearColumnId() { - result.hasColumnId = false; - result.columnId_ = global::bnet.protocol.storage.ColumnId.DefaultInstance; - return this; - } - - public bool HasRowId { - get { return result.HasRowId; } - } - public global::bnet.protocol.storage.RowId RowId { - get { return result.RowId; } - set { SetRowId(value); } - } - public Builder SetRowId(global::bnet.protocol.storage.RowId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasRowId = true; - result.rowId_ = value; - return this; - } - public Builder SetRowId(global::bnet.protocol.storage.RowId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasRowId = true; - result.rowId_ = builderForValue.Build(); - return this; - } - public Builder MergeRowId(global::bnet.protocol.storage.RowId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasRowId && - result.rowId_ != global::bnet.protocol.storage.RowId.DefaultInstance) { - result.rowId_ = global::bnet.protocol.storage.RowId.CreateBuilder(result.rowId_).MergeFrom(value).BuildPartial(); - } else { - result.rowId_ = value; - } - result.hasRowId = true; - return this; - } - public Builder ClearRowId() { - result.hasRowId = false; - result.rowId_ = global::bnet.protocol.storage.RowId.DefaultInstance; - return this; - } - - public bool HasRowKey { - get { return result.HasRowKey; } - } - public pb::ByteString RowKey { - get { return result.RowKey; } - set { SetRowKey(value); } - } - public Builder SetRowKey(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasRowKey = true; - result.rowKey_ = value; - return this; - } - public Builder ClearRowKey() { - result.hasRowKey = false; - result.rowKey_ = pb::ByteString.Empty; - return this; - } - - public bool HasVersion { - get { return result.HasVersion; } - } - public ulong Version { - get { return result.Version; } - set { SetVersion(value); } - } - public Builder SetVersion(ulong value) { - result.hasVersion = true; - result.version_ = value; - return this; - } - public Builder ClearVersion() { - result.hasVersion = false; - result.version_ = 0; - return this; - } - - public pbc::IPopsicleList RopsList { - get { return result.rops_; } - } - public int RopsCount { - get { return result.RopsCount; } - } - public global::bnet.protocol.storage.Command GetRops(int index) { - return result.GetRops(index); - } - public Builder SetRops(int index, global::bnet.protocol.storage.Command value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.rops_[index] = value; - return this; - } - public Builder SetRops(int index, global::bnet.protocol.storage.Command.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.rops_[index] = builderForValue.Build(); - return this; - } - public Builder AddRops(global::bnet.protocol.storage.Command value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.rops_.Add(value); - return this; - } - public Builder AddRops(global::bnet.protocol.storage.Command.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.rops_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeRops(scg::IEnumerable values) { - base.AddRange(values, result.rops_); - return this; - } - public Builder ClearRops() { - result.rops_.Clear(); - return this; - } - - public bool HasMutateVersion { - get { return result.HasMutateVersion; } - } - public ulong MutateVersion { - get { return result.MutateVersion; } - set { SetMutateVersion(value); } - } - public Builder SetMutateVersion(ulong value) { - result.hasMutateVersion = true; - result.mutateVersion_ = value; - return this; - } - public Builder ClearMutateVersion() { - result.hasMutateVersion = false; - result.mutateVersion_ = 0; - return this; - } - - public bool HasPrivilege { - get { return result.HasPrivilege; } - } - public global::bnet.protocol.storage.Privilege Privilege { - get { return result.Privilege; } - set { SetPrivilege(value); } - } - public Builder SetPrivilege(global::bnet.protocol.storage.Privilege value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasPrivilege = true; - result.privilege_ = value; - return this; - } - public Builder SetPrivilege(global::bnet.protocol.storage.Privilege.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasPrivilege = true; - result.privilege_ = builderForValue.Build(); - return this; - } - public Builder MergePrivilege(global::bnet.protocol.storage.Privilege value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasPrivilege && - result.privilege_ != global::bnet.protocol.storage.Privilege.DefaultInstance) { - result.privilege_ = global::bnet.protocol.storage.Privilege.CreateBuilder(result.privilege_).MergeFrom(value).BuildPartial(); - } else { - result.privilege_ = value; - } - result.hasPrivilege = true; - return this; - } - public Builder ClearPrivilege() { - result.hasPrivilege = false; - result.privilege_ = global::bnet.protocol.storage.Privilege.DefaultInstance; - return this; - } - } - static Operation() { - object.ReferenceEquals(global::bnet.protocol.storage.Storage.Descriptor, null); - } - } - - public sealed partial class Cell : pb::GeneratedMessage { - private static readonly Cell defaultInstance = new Builder().BuildPartial(); - public static Cell DefaultInstance { - get { return defaultInstance; } - } - - public override Cell DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override Cell ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.storage.Storage.internal__static_bnet_protocol_storage_Cell__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.storage.Storage.internal__static_bnet_protocol_storage_Cell__FieldAccessorTable; } - } - - public const int ColumnIdFieldNumber = 1; - private bool hasColumnId; - private global::bnet.protocol.storage.ColumnId columnId_ = global::bnet.protocol.storage.ColumnId.DefaultInstance; - public bool HasColumnId { - get { return hasColumnId; } - } - public global::bnet.protocol.storage.ColumnId ColumnId { - get { return columnId_; } - } - - public const int RowIdFieldNumber = 2; - private bool hasRowId; - private global::bnet.protocol.storage.RowId rowId_ = global::bnet.protocol.storage.RowId.DefaultInstance; - public bool HasRowId { - get { return hasRowId; } - } - public global::bnet.protocol.storage.RowId RowId { - get { return rowId_; } - } - - public const int RowKeyFieldNumber = 3; - private bool hasRowKey; - private pb::ByteString rowKey_ = pb::ByteString.Empty; - public bool HasRowKey { - get { return hasRowKey; } - } - public pb::ByteString RowKey { - get { return rowKey_; } - } - - public const int VersionFieldNumber = 4; - private bool hasVersion; - private ulong version_ = 0; - public bool HasVersion { - get { return hasVersion; } - } - public ulong Version { - get { return version_; } - } - - public const int DataFieldNumber = 5; - private bool hasData; - private pb::ByteString data_ = pb::ByteString.Empty; - public bool HasData { - get { return hasData; } - } - public pb::ByteString Data { - get { return data_; } - } - - public override bool IsInitialized { - get { - if (!hasColumnId) return false; - if (!hasRowId) return false; - if (!ColumnId.IsInitialized) return false; - if (!RowId.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasColumnId) { - output.WriteMessage(1, ColumnId); - } - if (HasRowId) { - output.WriteMessage(2, RowId); - } - if (HasRowKey) { - output.WriteBytes(3, RowKey); - } - if (HasVersion) { - output.WriteFixed64(4, Version); - } - if (HasData) { - output.WriteBytes(5, Data); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasColumnId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, ColumnId); - } - if (HasRowId) { - size += pb::CodedOutputStream.ComputeMessageSize(2, RowId); - } - if (HasRowKey) { - size += pb::CodedOutputStream.ComputeBytesSize(3, RowKey); - } - if (HasVersion) { - size += pb::CodedOutputStream.ComputeFixed64Size(4, Version); - } - if (HasData) { - size += pb::CodedOutputStream.ComputeBytesSize(5, Data); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static Cell ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Cell ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Cell ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Cell ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Cell ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Cell ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Cell ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Cell ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Cell ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Cell ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Cell prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - Cell result = new Cell(); - - protected override Cell MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new Cell(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.storage.Cell.Descriptor; } - } - - public override Cell DefaultInstanceForType { - get { return global::bnet.protocol.storage.Cell.DefaultInstance; } - } - - public override Cell BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - Cell returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Cell) { - return MergeFrom((Cell) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Cell other) { - if (other == global::bnet.protocol.storage.Cell.DefaultInstance) return this; - if (other.HasColumnId) { - MergeColumnId(other.ColumnId); - } - if (other.HasRowId) { - MergeRowId(other.RowId); - } - if (other.HasRowKey) { - RowKey = other.RowKey; - } - if (other.HasVersion) { - Version = other.Version; - } - if (other.HasData) { - Data = other.Data; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.storage.ColumnId.Builder subBuilder = global::bnet.protocol.storage.ColumnId.CreateBuilder(); - if (HasColumnId) { - subBuilder.MergeFrom(ColumnId); - } - input.ReadMessage(subBuilder, extensionRegistry); - ColumnId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.storage.RowId.Builder subBuilder = global::bnet.protocol.storage.RowId.CreateBuilder(); - if (HasRowId) { - subBuilder.MergeFrom(RowId); - } - input.ReadMessage(subBuilder, extensionRegistry); - RowId = subBuilder.BuildPartial(); - break; - } - case 26: { - RowKey = input.ReadBytes(); - break; - } - case 33: { - Version = input.ReadFixed64(); - break; - } - case 42: { - Data = input.ReadBytes(); - break; - } - } - } - } - - - public bool HasColumnId { - get { return result.HasColumnId; } - } - public global::bnet.protocol.storage.ColumnId ColumnId { - get { return result.ColumnId; } - set { SetColumnId(value); } - } - public Builder SetColumnId(global::bnet.protocol.storage.ColumnId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasColumnId = true; - result.columnId_ = value; - return this; - } - public Builder SetColumnId(global::bnet.protocol.storage.ColumnId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasColumnId = true; - result.columnId_ = builderForValue.Build(); - return this; - } - public Builder MergeColumnId(global::bnet.protocol.storage.ColumnId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasColumnId && - result.columnId_ != global::bnet.protocol.storage.ColumnId.DefaultInstance) { - result.columnId_ = global::bnet.protocol.storage.ColumnId.CreateBuilder(result.columnId_).MergeFrom(value).BuildPartial(); - } else { - result.columnId_ = value; - } - result.hasColumnId = true; - return this; - } - public Builder ClearColumnId() { - result.hasColumnId = false; - result.columnId_ = global::bnet.protocol.storage.ColumnId.DefaultInstance; - return this; - } - - public bool HasRowId { - get { return result.HasRowId; } - } - public global::bnet.protocol.storage.RowId RowId { - get { return result.RowId; } - set { SetRowId(value); } - } - public Builder SetRowId(global::bnet.protocol.storage.RowId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasRowId = true; - result.rowId_ = value; - return this; - } - public Builder SetRowId(global::bnet.protocol.storage.RowId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasRowId = true; - result.rowId_ = builderForValue.Build(); - return this; - } - public Builder MergeRowId(global::bnet.protocol.storage.RowId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasRowId && - result.rowId_ != global::bnet.protocol.storage.RowId.DefaultInstance) { - result.rowId_ = global::bnet.protocol.storage.RowId.CreateBuilder(result.rowId_).MergeFrom(value).BuildPartial(); - } else { - result.rowId_ = value; - } - result.hasRowId = true; - return this; - } - public Builder ClearRowId() { - result.hasRowId = false; - result.rowId_ = global::bnet.protocol.storage.RowId.DefaultInstance; - return this; - } - - public bool HasRowKey { - get { return result.HasRowKey; } - } - public pb::ByteString RowKey { - get { return result.RowKey; } - set { SetRowKey(value); } - } - public Builder SetRowKey(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasRowKey = true; - result.rowKey_ = value; - return this; - } - public Builder ClearRowKey() { - result.hasRowKey = false; - result.rowKey_ = pb::ByteString.Empty; - return this; - } - - public bool HasVersion { - get { return result.HasVersion; } - } - public ulong Version { - get { return result.Version; } - set { SetVersion(value); } - } - public Builder SetVersion(ulong value) { - result.hasVersion = true; - result.version_ = value; - return this; - } - public Builder ClearVersion() { - result.hasVersion = false; - result.version_ = 0; - return this; - } - - public bool HasData { - get { return result.HasData; } - } - public pb::ByteString Data { - get { return result.Data; } - set { SetData(value); } - } - public Builder SetData(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasData = true; - result.data_ = value; - return this; - } - public Builder ClearData() { - result.hasData = false; - result.data_ = pb::ByteString.Empty; - return this; - } - } - static Cell() { - object.ReferenceEquals(global::bnet.protocol.storage.Storage.Descriptor, null); - } - } - - public sealed partial class OperationResult : pb::GeneratedMessage { - private static readonly OperationResult defaultInstance = new Builder().BuildPartial(); - public static OperationResult DefaultInstance { - get { return defaultInstance; } - } - - public override OperationResult DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override OperationResult ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.storage.Storage.internal__static_bnet_protocol_storage_OperationResult__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.storage.Storage.internal__static_bnet_protocol_storage_OperationResult__FieldAccessorTable; } - } - - public const int ErrorCodeFieldNumber = 1; - private bool hasErrorCode; - private uint errorCode_ = 0; - public bool HasErrorCode { - get { return hasErrorCode; } - } - public uint ErrorCode { - get { return errorCode_; } - } - - public const int TableIdFieldNumber = 2; - private bool hasTableId; - private global::bnet.protocol.storage.TableId tableId_ = global::bnet.protocol.storage.TableId.DefaultInstance; - public bool HasTableId { - get { return hasTableId; } - } - public global::bnet.protocol.storage.TableId TableId { - get { return tableId_; } - } - - public const int DataFieldNumber = 3; - private pbc::PopsicleList data_ = new pbc::PopsicleList(); - public scg::IList DataList { - get { return data_; } - } - public int DataCount { - get { return data_.Count; } - } - public global::bnet.protocol.storage.Cell GetData(int index) { - return data_[index]; - } - - public override bool IsInitialized { - get { - if (!hasTableId) return false; - if (!TableId.IsInitialized) return false; - foreach (global::bnet.protocol.storage.Cell element in DataList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasErrorCode) { - output.WriteUInt32(1, ErrorCode); - } - if (HasTableId) { - output.WriteMessage(2, TableId); - } - foreach (global::bnet.protocol.storage.Cell element in DataList) { - output.WriteMessage(3, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasErrorCode) { - size += pb::CodedOutputStream.ComputeUInt32Size(1, ErrorCode); - } - if (HasTableId) { - size += pb::CodedOutputStream.ComputeMessageSize(2, TableId); - } - foreach (global::bnet.protocol.storage.Cell element in DataList) { - size += pb::CodedOutputStream.ComputeMessageSize(3, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static OperationResult ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OperationResult ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OperationResult ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OperationResult ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OperationResult ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OperationResult ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static OperationResult ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static OperationResult ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static OperationResult ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OperationResult ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(OperationResult prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - OperationResult result = new OperationResult(); - - protected override OperationResult MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new OperationResult(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.storage.OperationResult.Descriptor; } - } - - public override OperationResult DefaultInstanceForType { - get { return global::bnet.protocol.storage.OperationResult.DefaultInstance; } - } - - public override OperationResult BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.data_.MakeReadOnly(); - OperationResult returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is OperationResult) { - return MergeFrom((OperationResult) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(OperationResult other) { - if (other == global::bnet.protocol.storage.OperationResult.DefaultInstance) return this; - if (other.HasErrorCode) { - ErrorCode = other.ErrorCode; - } - if (other.HasTableId) { - MergeTableId(other.TableId); - } - if (other.data_.Count != 0) { - base.AddRange(other.data_, result.data_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - ErrorCode = input.ReadUInt32(); - break; - } - case 18: { - global::bnet.protocol.storage.TableId.Builder subBuilder = global::bnet.protocol.storage.TableId.CreateBuilder(); - if (HasTableId) { - subBuilder.MergeFrom(TableId); - } - input.ReadMessage(subBuilder, extensionRegistry); - TableId = subBuilder.BuildPartial(); - break; - } - case 26: { - global::bnet.protocol.storage.Cell.Builder subBuilder = global::bnet.protocol.storage.Cell.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddData(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public bool HasErrorCode { - get { return result.HasErrorCode; } - } - public uint ErrorCode { - get { return result.ErrorCode; } - set { SetErrorCode(value); } - } - public Builder SetErrorCode(uint value) { - result.hasErrorCode = true; - result.errorCode_ = value; - return this; - } - public Builder ClearErrorCode() { - result.hasErrorCode = false; - result.errorCode_ = 0; - return this; - } - - public bool HasTableId { - get { return result.HasTableId; } - } - public global::bnet.protocol.storage.TableId TableId { - get { return result.TableId; } - set { SetTableId(value); } - } - public Builder SetTableId(global::bnet.protocol.storage.TableId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasTableId = true; - result.tableId_ = value; - return this; - } - public Builder SetTableId(global::bnet.protocol.storage.TableId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasTableId = true; - result.tableId_ = builderForValue.Build(); - return this; - } - public Builder MergeTableId(global::bnet.protocol.storage.TableId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasTableId && - result.tableId_ != global::bnet.protocol.storage.TableId.DefaultInstance) { - result.tableId_ = global::bnet.protocol.storage.TableId.CreateBuilder(result.tableId_).MergeFrom(value).BuildPartial(); - } else { - result.tableId_ = value; - } - result.hasTableId = true; - return this; - } - public Builder ClearTableId() { - result.hasTableId = false; - result.tableId_ = global::bnet.protocol.storage.TableId.DefaultInstance; - return this; - } - - public pbc::IPopsicleList DataList { - get { return result.data_; } - } - public int DataCount { - get { return result.DataCount; } - } - public global::bnet.protocol.storage.Cell GetData(int index) { - return result.GetData(index); - } - public Builder SetData(int index, global::bnet.protocol.storage.Cell value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.data_[index] = value; - return this; - } - public Builder SetData(int index, global::bnet.protocol.storage.Cell.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.data_[index] = builderForValue.Build(); - return this; - } - public Builder AddData(global::bnet.protocol.storage.Cell value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.data_.Add(value); - return this; - } - public Builder AddData(global::bnet.protocol.storage.Cell.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.data_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeData(scg::IEnumerable values) { - base.AddRange(values, result.data_); - return this; - } - public Builder ClearData() { - result.data_.Clear(); - return this; - } - } - static OperationResult() { - object.ReferenceEquals(global::bnet.protocol.storage.Storage.Descriptor, null); - } - } - - public sealed partial class OpenTableRequest : pb::GeneratedMessage { - private static readonly OpenTableRequest defaultInstance = new Builder().BuildPartial(); - public static OpenTableRequest DefaultInstance { - get { return defaultInstance; } - } - - public override OpenTableRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override OpenTableRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.storage.Storage.internal__static_bnet_protocol_storage_OpenTableRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.storage.Storage.internal__static_bnet_protocol_storage_OpenTableRequest__FieldAccessorTable; } - } - - public const int SchemaFieldNumber = 1; - private bool hasSchema; - private string schema_ = "DEFAULT"; - public bool HasSchema { - get { return hasSchema; } - } - public string Schema { - get { return schema_; } - } - - public const int PrivilegeFieldNumber = 2; - private bool hasPrivilege; - private global::bnet.protocol.storage.Privilege privilege_ = global::bnet.protocol.storage.Privilege.DefaultInstance; - public bool HasPrivilege { - get { return hasPrivilege; } - } - public global::bnet.protocol.storage.Privilege Privilege { - get { return privilege_; } - } - - public const int TableIdFieldNumber = 3; - private bool hasTableId; - private global::bnet.protocol.storage.TableId tableId_ = global::bnet.protocol.storage.TableId.DefaultInstance; - public bool HasTableId { - get { return hasTableId; } - } - public global::bnet.protocol.storage.TableId TableId { - get { return tableId_; } - } - - public const int AgentIdFieldNumber = 4; - private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasAgentId { - get { return hasAgentId; } - } - public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } - } - - public const int ProcessNameFieldNumber = 5; - private bool hasProcessName; - private string processName_ = ""; - public bool HasProcessName { - get { return hasProcessName; } - } - public string ProcessName { - get { return processName_; } - } - - public override bool IsInitialized { - get { - if (!hasTableId) return false; - if (!TableId.IsInitialized) return false; - if (HasAgentId) { - if (!AgentId.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasSchema) { - output.WriteString(1, Schema); - } - if (HasPrivilege) { - output.WriteMessage(2, Privilege); - } - if (HasTableId) { - output.WriteMessage(3, TableId); - } - if (HasAgentId) { - output.WriteMessage(4, AgentId); - } - if (HasProcessName) { - output.WriteString(5, ProcessName); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasSchema) { - size += pb::CodedOutputStream.ComputeStringSize(1, Schema); - } - if (HasPrivilege) { - size += pb::CodedOutputStream.ComputeMessageSize(2, Privilege); - } - if (HasTableId) { - size += pb::CodedOutputStream.ComputeMessageSize(3, TableId); - } - if (HasAgentId) { - size += pb::CodedOutputStream.ComputeMessageSize(4, AgentId); - } - if (HasProcessName) { - size += pb::CodedOutputStream.ComputeStringSize(5, ProcessName); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static OpenTableRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OpenTableRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OpenTableRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OpenTableRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OpenTableRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OpenTableRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static OpenTableRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static OpenTableRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static OpenTableRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OpenTableRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(OpenTableRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - OpenTableRequest result = new OpenTableRequest(); - - protected override OpenTableRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new OpenTableRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.storage.OpenTableRequest.Descriptor; } - } - - public override OpenTableRequest DefaultInstanceForType { - get { return global::bnet.protocol.storage.OpenTableRequest.DefaultInstance; } - } - - public override OpenTableRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - OpenTableRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is OpenTableRequest) { - return MergeFrom((OpenTableRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(OpenTableRequest other) { - if (other == global::bnet.protocol.storage.OpenTableRequest.DefaultInstance) return this; - if (other.HasSchema) { - Schema = other.Schema; - } - if (other.HasPrivilege) { - MergePrivilege(other.Privilege); - } - if (other.HasTableId) { - MergeTableId(other.TableId); - } - if (other.HasAgentId) { - MergeAgentId(other.AgentId); - } - if (other.HasProcessName) { - ProcessName = other.ProcessName; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - Schema = input.ReadString(); - break; - } - case 18: { - global::bnet.protocol.storage.Privilege.Builder subBuilder = global::bnet.protocol.storage.Privilege.CreateBuilder(); - if (HasPrivilege) { - subBuilder.MergeFrom(Privilege); - } - input.ReadMessage(subBuilder, extensionRegistry); - Privilege = subBuilder.BuildPartial(); - break; - } - case 26: { - global::bnet.protocol.storage.TableId.Builder subBuilder = global::bnet.protocol.storage.TableId.CreateBuilder(); - if (HasTableId) { - subBuilder.MergeFrom(TableId); - } - input.ReadMessage(subBuilder, extensionRegistry); - TableId = subBuilder.BuildPartial(); - break; - } - case 34: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { - subBuilder.MergeFrom(AgentId); - } - input.ReadMessage(subBuilder, extensionRegistry); - AgentId = subBuilder.BuildPartial(); - break; - } - case 42: { - ProcessName = input.ReadString(); - break; - } - } - } - } - - - public bool HasSchema { - get { return result.HasSchema; } - } - public string Schema { - get { return result.Schema; } - set { SetSchema(value); } - } - public Builder SetSchema(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasSchema = true; - result.schema_ = value; - return this; - } - public Builder ClearSchema() { - result.hasSchema = false; - result.schema_ = "DEFAULT"; - return this; - } - - public bool HasPrivilege { - get { return result.HasPrivilege; } - } - public global::bnet.protocol.storage.Privilege Privilege { - get { return result.Privilege; } - set { SetPrivilege(value); } - } - public Builder SetPrivilege(global::bnet.protocol.storage.Privilege value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasPrivilege = true; - result.privilege_ = value; - return this; - } - public Builder SetPrivilege(global::bnet.protocol.storage.Privilege.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasPrivilege = true; - result.privilege_ = builderForValue.Build(); - return this; - } - public Builder MergePrivilege(global::bnet.protocol.storage.Privilege value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasPrivilege && - result.privilege_ != global::bnet.protocol.storage.Privilege.DefaultInstance) { - result.privilege_ = global::bnet.protocol.storage.Privilege.CreateBuilder(result.privilege_).MergeFrom(value).BuildPartial(); - } else { - result.privilege_ = value; - } - result.hasPrivilege = true; - return this; - } - public Builder ClearPrivilege() { - result.hasPrivilege = false; - result.privilege_ = global::bnet.protocol.storage.Privilege.DefaultInstance; - return this; - } - - public bool HasTableId { - get { return result.HasTableId; } - } - public global::bnet.protocol.storage.TableId TableId { - get { return result.TableId; } - set { SetTableId(value); } - } - public Builder SetTableId(global::bnet.protocol.storage.TableId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasTableId = true; - result.tableId_ = value; - return this; - } - public Builder SetTableId(global::bnet.protocol.storage.TableId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasTableId = true; - result.tableId_ = builderForValue.Build(); - return this; - } - public Builder MergeTableId(global::bnet.protocol.storage.TableId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasTableId && - result.tableId_ != global::bnet.protocol.storage.TableId.DefaultInstance) { - result.tableId_ = global::bnet.protocol.storage.TableId.CreateBuilder(result.tableId_).MergeFrom(value).BuildPartial(); - } else { - result.tableId_ = value; - } - result.hasTableId = true; - return this; - } - public Builder ClearTableId() { - result.hasTableId = false; - result.tableId_ = global::bnet.protocol.storage.TableId.DefaultInstance; - return this; - } - - public bool HasAgentId { - get { return result.HasAgentId; } - } - public global::bnet.protocol.EntityId AgentId { - get { return result.AgentId; } - set { SetAgentId(value); } - } - public Builder SetAgentId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasAgentId = true; - result.agentId_ = value; - return this; - } - public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasAgentId = true; - result.agentId_ = builderForValue.Build(); - return this; - } - public Builder MergeAgentId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && - result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); - } else { - result.agentId_ = value; - } - result.hasAgentId = true; - return this; - } - public Builder ClearAgentId() { - result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasProcessName { - get { return result.HasProcessName; } - } - public string ProcessName { - get { return result.ProcessName; } - set { SetProcessName(value); } - } - public Builder SetProcessName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasProcessName = true; - result.processName_ = value; - return this; - } - public Builder ClearProcessName() { - result.hasProcessName = false; - result.processName_ = ""; - return this; - } - } - static OpenTableRequest() { - object.ReferenceEquals(global::bnet.protocol.storage.Storage.Descriptor, null); - } - } - - public sealed partial class OpenTableResponse : pb::GeneratedMessage { - private static readonly OpenTableResponse defaultInstance = new Builder().BuildPartial(); - public static OpenTableResponse DefaultInstance { - get { return defaultInstance; } - } - - public override OpenTableResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override OpenTableResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.storage.Storage.internal__static_bnet_protocol_storage_OpenTableResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.storage.Storage.internal__static_bnet_protocol_storage_OpenTableResponse__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static OpenTableResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OpenTableResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OpenTableResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OpenTableResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OpenTableResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OpenTableResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static OpenTableResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static OpenTableResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static OpenTableResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OpenTableResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(OpenTableResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - OpenTableResponse result = new OpenTableResponse(); - - protected override OpenTableResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new OpenTableResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.storage.OpenTableResponse.Descriptor; } - } - - public override OpenTableResponse DefaultInstanceForType { - get { return global::bnet.protocol.storage.OpenTableResponse.DefaultInstance; } - } - - public override OpenTableResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - OpenTableResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is OpenTableResponse) { - return MergeFrom((OpenTableResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(OpenTableResponse other) { - if (other == global::bnet.protocol.storage.OpenTableResponse.DefaultInstance) return this; - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - } - } - } - - } - static OpenTableResponse() { - object.ReferenceEquals(global::bnet.protocol.storage.Storage.Descriptor, null); - } - } - - public sealed partial class OpenColumnRequest : pb::GeneratedMessage { - private static readonly OpenColumnRequest defaultInstance = new Builder().BuildPartial(); - public static OpenColumnRequest DefaultInstance { - get { return defaultInstance; } - } - - public override OpenColumnRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override OpenColumnRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.storage.Storage.internal__static_bnet_protocol_storage_OpenColumnRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.storage.Storage.internal__static_bnet_protocol_storage_OpenColumnRequest__FieldAccessorTable; } - } - - public const int SchemaFieldNumber = 1; - private bool hasSchema; - private string schema_ = "DEFAULT"; - public bool HasSchema { - get { return hasSchema; } - } - public string Schema { - get { return schema_; } - } - - public const int PrivilegeFieldNumber = 2; - private bool hasPrivilege; - private global::bnet.protocol.storage.Privilege privilege_ = global::bnet.protocol.storage.Privilege.DefaultInstance; - public bool HasPrivilege { - get { return hasPrivilege; } - } - public global::bnet.protocol.storage.Privilege Privilege { - get { return privilege_; } - } - - public const int TableIdFieldNumber = 4; - private bool hasTableId; - private global::bnet.protocol.storage.TableId tableId_ = global::bnet.protocol.storage.TableId.DefaultInstance; - public bool HasTableId { - get { return hasTableId; } - } - public global::bnet.protocol.storage.TableId TableId { - get { return tableId_; } - } - - public const int ColumnIdFieldNumber = 5; - private bool hasColumnId; - private global::bnet.protocol.storage.ColumnId columnId_ = global::bnet.protocol.storage.ColumnId.DefaultInstance; - public bool HasColumnId { - get { return hasColumnId; } - } - public global::bnet.protocol.storage.ColumnId ColumnId { - get { return columnId_; } - } - - public const int ProtoTypeFieldNumber = 6; - private bool hasProtoType; - private string protoType_ = ""; - public bool HasProtoType { - get { return hasProtoType; } - } - public string ProtoType { - get { return protoType_; } - } - - public const int AgentIdFieldNumber = 7; - private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasAgentId { - get { return hasAgentId; } - } - public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } - } - - public const int ProcessNameFieldNumber = 8; - private bool hasProcessName; - private string processName_ = ""; - public bool HasProcessName { - get { return hasProcessName; } - } - public string ProcessName { - get { return processName_; } - } - - public override bool IsInitialized { - get { - if (!hasTableId) return false; - if (!hasColumnId) return false; - if (!TableId.IsInitialized) return false; - if (!ColumnId.IsInitialized) return false; - if (HasAgentId) { - if (!AgentId.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasSchema) { - output.WriteString(1, Schema); - } - if (HasPrivilege) { - output.WriteMessage(2, Privilege); - } - if (HasTableId) { - output.WriteMessage(4, TableId); - } - if (HasColumnId) { - output.WriteMessage(5, ColumnId); - } - if (HasProtoType) { - output.WriteString(6, ProtoType); - } - if (HasAgentId) { - output.WriteMessage(7, AgentId); - } - if (HasProcessName) { - output.WriteString(8, ProcessName); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasSchema) { - size += pb::CodedOutputStream.ComputeStringSize(1, Schema); - } - if (HasPrivilege) { - size += pb::CodedOutputStream.ComputeMessageSize(2, Privilege); - } - if (HasTableId) { - size += pb::CodedOutputStream.ComputeMessageSize(4, TableId); - } - if (HasColumnId) { - size += pb::CodedOutputStream.ComputeMessageSize(5, ColumnId); - } - if (HasProtoType) { - size += pb::CodedOutputStream.ComputeStringSize(6, ProtoType); - } - if (HasAgentId) { - size += pb::CodedOutputStream.ComputeMessageSize(7, AgentId); - } - if (HasProcessName) { - size += pb::CodedOutputStream.ComputeStringSize(8, ProcessName); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static OpenColumnRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OpenColumnRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OpenColumnRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OpenColumnRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OpenColumnRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OpenColumnRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static OpenColumnRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static OpenColumnRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static OpenColumnRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OpenColumnRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(OpenColumnRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - OpenColumnRequest result = new OpenColumnRequest(); - - protected override OpenColumnRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new OpenColumnRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.storage.OpenColumnRequest.Descriptor; } - } - - public override OpenColumnRequest DefaultInstanceForType { - get { return global::bnet.protocol.storage.OpenColumnRequest.DefaultInstance; } - } - - public override OpenColumnRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - OpenColumnRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is OpenColumnRequest) { - return MergeFrom((OpenColumnRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(OpenColumnRequest other) { - if (other == global::bnet.protocol.storage.OpenColumnRequest.DefaultInstance) return this; - if (other.HasSchema) { - Schema = other.Schema; - } - if (other.HasPrivilege) { - MergePrivilege(other.Privilege); - } - if (other.HasTableId) { - MergeTableId(other.TableId); - } - if (other.HasColumnId) { - MergeColumnId(other.ColumnId); - } - if (other.HasProtoType) { - ProtoType = other.ProtoType; - } - if (other.HasAgentId) { - MergeAgentId(other.AgentId); - } - if (other.HasProcessName) { - ProcessName = other.ProcessName; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - Schema = input.ReadString(); - break; - } - case 18: { - global::bnet.protocol.storage.Privilege.Builder subBuilder = global::bnet.protocol.storage.Privilege.CreateBuilder(); - if (HasPrivilege) { - subBuilder.MergeFrom(Privilege); - } - input.ReadMessage(subBuilder, extensionRegistry); - Privilege = subBuilder.BuildPartial(); - break; - } - case 34: { - global::bnet.protocol.storage.TableId.Builder subBuilder = global::bnet.protocol.storage.TableId.CreateBuilder(); - if (HasTableId) { - subBuilder.MergeFrom(TableId); - } - input.ReadMessage(subBuilder, extensionRegistry); - TableId = subBuilder.BuildPartial(); - break; - } - case 42: { - global::bnet.protocol.storage.ColumnId.Builder subBuilder = global::bnet.protocol.storage.ColumnId.CreateBuilder(); - if (HasColumnId) { - subBuilder.MergeFrom(ColumnId); - } - input.ReadMessage(subBuilder, extensionRegistry); - ColumnId = subBuilder.BuildPartial(); - break; - } - case 50: { - ProtoType = input.ReadString(); - break; - } - case 58: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { - subBuilder.MergeFrom(AgentId); - } - input.ReadMessage(subBuilder, extensionRegistry); - AgentId = subBuilder.BuildPartial(); - break; - } - case 66: { - ProcessName = input.ReadString(); - break; - } - } - } - } - - - public bool HasSchema { - get { return result.HasSchema; } - } - public string Schema { - get { return result.Schema; } - set { SetSchema(value); } - } - public Builder SetSchema(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasSchema = true; - result.schema_ = value; - return this; - } - public Builder ClearSchema() { - result.hasSchema = false; - result.schema_ = "DEFAULT"; - return this; - } - - public bool HasPrivilege { - get { return result.HasPrivilege; } - } - public global::bnet.protocol.storage.Privilege Privilege { - get { return result.Privilege; } - set { SetPrivilege(value); } - } - public Builder SetPrivilege(global::bnet.protocol.storage.Privilege value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasPrivilege = true; - result.privilege_ = value; - return this; - } - public Builder SetPrivilege(global::bnet.protocol.storage.Privilege.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasPrivilege = true; - result.privilege_ = builderForValue.Build(); - return this; - } - public Builder MergePrivilege(global::bnet.protocol.storage.Privilege value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasPrivilege && - result.privilege_ != global::bnet.protocol.storage.Privilege.DefaultInstance) { - result.privilege_ = global::bnet.protocol.storage.Privilege.CreateBuilder(result.privilege_).MergeFrom(value).BuildPartial(); - } else { - result.privilege_ = value; - } - result.hasPrivilege = true; - return this; - } - public Builder ClearPrivilege() { - result.hasPrivilege = false; - result.privilege_ = global::bnet.protocol.storage.Privilege.DefaultInstance; - return this; - } - - public bool HasTableId { - get { return result.HasTableId; } - } - public global::bnet.protocol.storage.TableId TableId { - get { return result.TableId; } - set { SetTableId(value); } - } - public Builder SetTableId(global::bnet.protocol.storage.TableId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasTableId = true; - result.tableId_ = value; - return this; - } - public Builder SetTableId(global::bnet.protocol.storage.TableId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasTableId = true; - result.tableId_ = builderForValue.Build(); - return this; - } - public Builder MergeTableId(global::bnet.protocol.storage.TableId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasTableId && - result.tableId_ != global::bnet.protocol.storage.TableId.DefaultInstance) { - result.tableId_ = global::bnet.protocol.storage.TableId.CreateBuilder(result.tableId_).MergeFrom(value).BuildPartial(); - } else { - result.tableId_ = value; - } - result.hasTableId = true; - return this; - } - public Builder ClearTableId() { - result.hasTableId = false; - result.tableId_ = global::bnet.protocol.storage.TableId.DefaultInstance; - return this; - } - - public bool HasColumnId { - get { return result.HasColumnId; } - } - public global::bnet.protocol.storage.ColumnId ColumnId { - get { return result.ColumnId; } - set { SetColumnId(value); } - } - public Builder SetColumnId(global::bnet.protocol.storage.ColumnId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasColumnId = true; - result.columnId_ = value; - return this; - } - public Builder SetColumnId(global::bnet.protocol.storage.ColumnId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasColumnId = true; - result.columnId_ = builderForValue.Build(); - return this; - } - public Builder MergeColumnId(global::bnet.protocol.storage.ColumnId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasColumnId && - result.columnId_ != global::bnet.protocol.storage.ColumnId.DefaultInstance) { - result.columnId_ = global::bnet.protocol.storage.ColumnId.CreateBuilder(result.columnId_).MergeFrom(value).BuildPartial(); - } else { - result.columnId_ = value; - } - result.hasColumnId = true; - return this; - } - public Builder ClearColumnId() { - result.hasColumnId = false; - result.columnId_ = global::bnet.protocol.storage.ColumnId.DefaultInstance; - return this; - } - - public bool HasProtoType { - get { return result.HasProtoType; } - } - public string ProtoType { - get { return result.ProtoType; } - set { SetProtoType(value); } - } - public Builder SetProtoType(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasProtoType = true; - result.protoType_ = value; - return this; - } - public Builder ClearProtoType() { - result.hasProtoType = false; - result.protoType_ = ""; - return this; - } - - public bool HasAgentId { - get { return result.HasAgentId; } - } - public global::bnet.protocol.EntityId AgentId { - get { return result.AgentId; } - set { SetAgentId(value); } - } - public Builder SetAgentId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasAgentId = true; - result.agentId_ = value; - return this; - } - public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasAgentId = true; - result.agentId_ = builderForValue.Build(); - return this; - } - public Builder MergeAgentId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && - result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); - } else { - result.agentId_ = value; - } - result.hasAgentId = true; - return this; - } - public Builder ClearAgentId() { - result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasProcessName { - get { return result.HasProcessName; } - } - public string ProcessName { - get { return result.ProcessName; } - set { SetProcessName(value); } - } - public Builder SetProcessName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasProcessName = true; - result.processName_ = value; - return this; - } - public Builder ClearProcessName() { - result.hasProcessName = false; - result.processName_ = ""; - return this; - } - } - static OpenColumnRequest() { - object.ReferenceEquals(global::bnet.protocol.storage.Storage.Descriptor, null); - } - } - - public sealed partial class OpenColumnResponse : pb::GeneratedMessage { - private static readonly OpenColumnResponse defaultInstance = new Builder().BuildPartial(); - public static OpenColumnResponse DefaultInstance { - get { return defaultInstance; } - } - - public override OpenColumnResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override OpenColumnResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.storage.Storage.internal__static_bnet_protocol_storage_OpenColumnResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.storage.Storage.internal__static_bnet_protocol_storage_OpenColumnResponse__FieldAccessorTable; } - } - - public const int ServerFieldOpsFieldNumber = 2; - private bool hasServerFieldOps; - private bool serverFieldOps_ = false; - public bool HasServerFieldOps { - get { return hasServerFieldOps; } - } - public bool ServerFieldOps { - get { return serverFieldOps_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasServerFieldOps) { - output.WriteBool(2, ServerFieldOps); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasServerFieldOps) { - size += pb::CodedOutputStream.ComputeBoolSize(2, ServerFieldOps); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static OpenColumnResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OpenColumnResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OpenColumnResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static OpenColumnResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static OpenColumnResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OpenColumnResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static OpenColumnResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static OpenColumnResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static OpenColumnResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static OpenColumnResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(OpenColumnResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - OpenColumnResponse result = new OpenColumnResponse(); - - protected override OpenColumnResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new OpenColumnResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.storage.OpenColumnResponse.Descriptor; } - } - - public override OpenColumnResponse DefaultInstanceForType { - get { return global::bnet.protocol.storage.OpenColumnResponse.DefaultInstance; } - } - - public override OpenColumnResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - OpenColumnResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is OpenColumnResponse) { - return MergeFrom((OpenColumnResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(OpenColumnResponse other) { - if (other == global::bnet.protocol.storage.OpenColumnResponse.DefaultInstance) return this; - if (other.HasServerFieldOps) { - ServerFieldOps = other.ServerFieldOps; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 16: { - ServerFieldOps = input.ReadBool(); - break; - } - } - } - } - - - public bool HasServerFieldOps { - get { return result.HasServerFieldOps; } - } - public bool ServerFieldOps { - get { return result.ServerFieldOps; } - set { SetServerFieldOps(value); } - } - public Builder SetServerFieldOps(bool value) { - result.hasServerFieldOps = true; - result.serverFieldOps_ = value; - return this; - } - public Builder ClearServerFieldOps() { - result.hasServerFieldOps = false; - result.serverFieldOps_ = false; - return this; - } - } - static OpenColumnResponse() { - object.ReferenceEquals(global::bnet.protocol.storage.Storage.Descriptor, null); - } - } - - public sealed partial class ExecuteRequest : pb::GeneratedMessage { - private static readonly ExecuteRequest defaultInstance = new Builder().BuildPartial(); - public static ExecuteRequest DefaultInstance { - get { return defaultInstance; } - } - - public override ExecuteRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ExecuteRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.storage.Storage.internal__static_bnet_protocol_storage_ExecuteRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.storage.Storage.internal__static_bnet_protocol_storage_ExecuteRequest__FieldAccessorTable; } - } - - public const int SchemaFieldNumber = 1; - private bool hasSchema; - private string schema_ = "DEFAULT"; - public bool HasSchema { - get { return hasSchema; } - } - public string Schema { - get { return schema_; } - } - - public const int PrivilegeFieldNumber = 2; - private bool hasPrivilege; - private global::bnet.protocol.storage.Privilege privilege_ = global::bnet.protocol.storage.Privilege.DefaultInstance; - public bool HasPrivilege { - get { return hasPrivilege; } - } - public global::bnet.protocol.storage.Privilege Privilege { - get { return privilege_; } - } - - public const int ReadOnlyFieldNumber = 3; - private bool hasReadOnly; - private bool readOnly_ = false; - public bool HasReadOnly { - get { return hasReadOnly; } - } - public bool ReadOnly { - get { return readOnly_; } - } - - public const int WantsRowKeyFieldNumber = 4; - private bool hasWantsRowKey; - private bool wantsRowKey_ = false; - public bool HasWantsRowKey { - get { return hasWantsRowKey; } - } - public bool WantsRowKey { - get { return wantsRowKey_; } - } - - public const int WantsColumnNameFieldNumber = 5; - private bool hasWantsColumnName; - private bool wantsColumnName_ = false; - public bool HasWantsColumnName { - get { return hasWantsColumnName; } - } - public bool WantsColumnName { - get { return wantsColumnName_; } - } - - public const int MaxDataSizeFieldNumber = 6; - private bool hasMaxDataSize; - private uint maxDataSize_ = 16777215; - public bool HasMaxDataSize { - get { return hasMaxDataSize; } - } - public uint MaxDataSize { - get { return maxDataSize_; } - } - - public const int OperationsFieldNumber = 7; - private pbc::PopsicleList operations_ = new pbc::PopsicleList(); - public scg::IList OperationsList { - get { return operations_; } - } - public int OperationsCount { - get { return operations_.Count; } - } - public global::bnet.protocol.storage.Operation GetOperations(int index) { - return operations_[index]; - } - - public const int TimeoutFieldNumber = 12; - private bool hasTimeout; - private uint timeout_ = 0; - public bool HasTimeout { - get { return hasTimeout; } - } - public uint Timeout { - get { return timeout_; } - } - - public const int AgentIdFieldNumber = 9; - private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasAgentId { - get { return hasAgentId; } - } - public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } - } - - public const int QueryNameFieldNumber = 10; - private bool hasQueryName; - private string queryName_ = "NoName"; - public bool HasQueryName { - get { return hasQueryName; } - } - public string QueryName { - get { return queryName_; } - } - - public const int ProcessNameFieldNumber = 11; - private bool hasProcessName; - private string processName_ = ""; - public bool HasProcessName { - get { return hasProcessName; } - } - public string ProcessName { - get { return processName_; } - } - - public override bool IsInitialized { - get { - foreach (global::bnet.protocol.storage.Operation element in OperationsList) { - if (!element.IsInitialized) return false; - } - if (HasAgentId) { - if (!AgentId.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasSchema) { - output.WriteString(1, Schema); - } - if (HasPrivilege) { - output.WriteMessage(2, Privilege); - } - if (HasReadOnly) { - output.WriteBool(3, ReadOnly); - } - if (HasWantsRowKey) { - output.WriteBool(4, WantsRowKey); - } - if (HasWantsColumnName) { - output.WriteBool(5, WantsColumnName); - } - if (HasMaxDataSize) { - output.WriteUInt32(6, MaxDataSize); - } - foreach (global::bnet.protocol.storage.Operation element in OperationsList) { - output.WriteMessage(7, element); - } - if (HasAgentId) { - output.WriteMessage(9, AgentId); - } - if (HasQueryName) { - output.WriteString(10, QueryName); - } - if (HasProcessName) { - output.WriteString(11, ProcessName); - } - if (HasTimeout) { - output.WriteUInt32(12, Timeout); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasSchema) { - size += pb::CodedOutputStream.ComputeStringSize(1, Schema); - } - if (HasPrivilege) { - size += pb::CodedOutputStream.ComputeMessageSize(2, Privilege); - } - if (HasReadOnly) { - size += pb::CodedOutputStream.ComputeBoolSize(3, ReadOnly); - } - if (HasWantsRowKey) { - size += pb::CodedOutputStream.ComputeBoolSize(4, WantsRowKey); - } - if (HasWantsColumnName) { - size += pb::CodedOutputStream.ComputeBoolSize(5, WantsColumnName); - } - if (HasMaxDataSize) { - size += pb::CodedOutputStream.ComputeUInt32Size(6, MaxDataSize); - } - foreach (global::bnet.protocol.storage.Operation element in OperationsList) { - size += pb::CodedOutputStream.ComputeMessageSize(7, element); - } - if (HasTimeout) { - size += pb::CodedOutputStream.ComputeUInt32Size(12, Timeout); - } - if (HasAgentId) { - size += pb::CodedOutputStream.ComputeMessageSize(9, AgentId); - } - if (HasQueryName) { - size += pb::CodedOutputStream.ComputeStringSize(10, QueryName); - } - if (HasProcessName) { - size += pb::CodedOutputStream.ComputeStringSize(11, ProcessName); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ExecuteRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ExecuteRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ExecuteRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ExecuteRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ExecuteRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ExecuteRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ExecuteRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ExecuteRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ExecuteRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ExecuteRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ExecuteRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ExecuteRequest result = new ExecuteRequest(); - - protected override ExecuteRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ExecuteRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.storage.ExecuteRequest.Descriptor; } - } - - public override ExecuteRequest DefaultInstanceForType { - get { return global::bnet.protocol.storage.ExecuteRequest.DefaultInstance; } - } - - public override ExecuteRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.operations_.MakeReadOnly(); - ExecuteRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ExecuteRequest) { - return MergeFrom((ExecuteRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ExecuteRequest other) { - if (other == global::bnet.protocol.storage.ExecuteRequest.DefaultInstance) return this; - if (other.HasSchema) { - Schema = other.Schema; - } - if (other.HasPrivilege) { - MergePrivilege(other.Privilege); - } - if (other.HasReadOnly) { - ReadOnly = other.ReadOnly; - } - if (other.HasWantsRowKey) { - WantsRowKey = other.WantsRowKey; - } - if (other.HasWantsColumnName) { - WantsColumnName = other.WantsColumnName; - } - if (other.HasMaxDataSize) { - MaxDataSize = other.MaxDataSize; - } - if (other.operations_.Count != 0) { - base.AddRange(other.operations_, result.operations_); - } - if (other.HasTimeout) { - Timeout = other.Timeout; - } - if (other.HasAgentId) { - MergeAgentId(other.AgentId); - } - if (other.HasQueryName) { - QueryName = other.QueryName; - } - if (other.HasProcessName) { - ProcessName = other.ProcessName; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - Schema = input.ReadString(); - break; - } - case 18: { - global::bnet.protocol.storage.Privilege.Builder subBuilder = global::bnet.protocol.storage.Privilege.CreateBuilder(); - if (HasPrivilege) { - subBuilder.MergeFrom(Privilege); - } - input.ReadMessage(subBuilder, extensionRegistry); - Privilege = subBuilder.BuildPartial(); - break; - } - case 24: { - ReadOnly = input.ReadBool(); - break; - } - case 32: { - WantsRowKey = input.ReadBool(); - break; - } - case 40: { - WantsColumnName = input.ReadBool(); - break; - } - case 48: { - MaxDataSize = input.ReadUInt32(); - break; - } - case 58: { - global::bnet.protocol.storage.Operation.Builder subBuilder = global::bnet.protocol.storage.Operation.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddOperations(subBuilder.BuildPartial()); - break; - } - case 74: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { - subBuilder.MergeFrom(AgentId); - } - input.ReadMessage(subBuilder, extensionRegistry); - AgentId = subBuilder.BuildPartial(); - break; - } - case 82: { - QueryName = input.ReadString(); - break; - } - case 90: { - ProcessName = input.ReadString(); - break; - } - case 96: { - Timeout = input.ReadUInt32(); - break; - } - } - } - } - - - public bool HasSchema { - get { return result.HasSchema; } - } - public string Schema { - get { return result.Schema; } - set { SetSchema(value); } - } - public Builder SetSchema(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasSchema = true; - result.schema_ = value; - return this; - } - public Builder ClearSchema() { - result.hasSchema = false; - result.schema_ = "DEFAULT"; - return this; - } - - public bool HasPrivilege { - get { return result.HasPrivilege; } - } - public global::bnet.protocol.storage.Privilege Privilege { - get { return result.Privilege; } - set { SetPrivilege(value); } - } - public Builder SetPrivilege(global::bnet.protocol.storage.Privilege value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasPrivilege = true; - result.privilege_ = value; - return this; - } - public Builder SetPrivilege(global::bnet.protocol.storage.Privilege.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasPrivilege = true; - result.privilege_ = builderForValue.Build(); - return this; - } - public Builder MergePrivilege(global::bnet.protocol.storage.Privilege value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasPrivilege && - result.privilege_ != global::bnet.protocol.storage.Privilege.DefaultInstance) { - result.privilege_ = global::bnet.protocol.storage.Privilege.CreateBuilder(result.privilege_).MergeFrom(value).BuildPartial(); - } else { - result.privilege_ = value; - } - result.hasPrivilege = true; - return this; - } - public Builder ClearPrivilege() { - result.hasPrivilege = false; - result.privilege_ = global::bnet.protocol.storage.Privilege.DefaultInstance; - return this; - } - - public bool HasReadOnly { - get { return result.HasReadOnly; } - } - public bool ReadOnly { - get { return result.ReadOnly; } - set { SetReadOnly(value); } - } - public Builder SetReadOnly(bool value) { - result.hasReadOnly = true; - result.readOnly_ = value; - return this; - } - public Builder ClearReadOnly() { - result.hasReadOnly = false; - result.readOnly_ = false; - return this; - } - - public bool HasWantsRowKey { - get { return result.HasWantsRowKey; } - } - public bool WantsRowKey { - get { return result.WantsRowKey; } - set { SetWantsRowKey(value); } - } - public Builder SetWantsRowKey(bool value) { - result.hasWantsRowKey = true; - result.wantsRowKey_ = value; - return this; - } - public Builder ClearWantsRowKey() { - result.hasWantsRowKey = false; - result.wantsRowKey_ = false; - return this; - } - - public bool HasWantsColumnName { - get { return result.HasWantsColumnName; } - } - public bool WantsColumnName { - get { return result.WantsColumnName; } - set { SetWantsColumnName(value); } - } - public Builder SetWantsColumnName(bool value) { - result.hasWantsColumnName = true; - result.wantsColumnName_ = value; - return this; - } - public Builder ClearWantsColumnName() { - result.hasWantsColumnName = false; - result.wantsColumnName_ = false; - return this; - } - - public bool HasMaxDataSize { - get { return result.HasMaxDataSize; } - } - public uint MaxDataSize { - get { return result.MaxDataSize; } - set { SetMaxDataSize(value); } - } - public Builder SetMaxDataSize(uint value) { - result.hasMaxDataSize = true; - result.maxDataSize_ = value; - return this; - } - public Builder ClearMaxDataSize() { - result.hasMaxDataSize = false; - result.maxDataSize_ = 16777215; - return this; - } - - public pbc::IPopsicleList OperationsList { - get { return result.operations_; } - } - public int OperationsCount { - get { return result.OperationsCount; } - } - public global::bnet.protocol.storage.Operation GetOperations(int index) { - return result.GetOperations(index); - } - public Builder SetOperations(int index, global::bnet.protocol.storage.Operation value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.operations_[index] = value; - return this; - } - public Builder SetOperations(int index, global::bnet.protocol.storage.Operation.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.operations_[index] = builderForValue.Build(); - return this; - } - public Builder AddOperations(global::bnet.protocol.storage.Operation value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.operations_.Add(value); - return this; - } - public Builder AddOperations(global::bnet.protocol.storage.Operation.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.operations_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeOperations(scg::IEnumerable values) { - base.AddRange(values, result.operations_); - return this; - } - public Builder ClearOperations() { - result.operations_.Clear(); - return this; - } - - public bool HasTimeout { - get { return result.HasTimeout; } - } - public uint Timeout { - get { return result.Timeout; } - set { SetTimeout(value); } - } - public Builder SetTimeout(uint value) { - result.hasTimeout = true; - result.timeout_ = value; - return this; - } - public Builder ClearTimeout() { - result.hasTimeout = false; - result.timeout_ = 0; - return this; - } - - public bool HasAgentId { - get { return result.HasAgentId; } - } - public global::bnet.protocol.EntityId AgentId { - get { return result.AgentId; } - set { SetAgentId(value); } - } - public Builder SetAgentId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasAgentId = true; - result.agentId_ = value; - return this; - } - public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasAgentId = true; - result.agentId_ = builderForValue.Build(); - return this; - } - public Builder MergeAgentId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && - result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); - } else { - result.agentId_ = value; - } - result.hasAgentId = true; - return this; - } - public Builder ClearAgentId() { - result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasQueryName { - get { return result.HasQueryName; } - } - public string QueryName { - get { return result.QueryName; } - set { SetQueryName(value); } - } - public Builder SetQueryName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasQueryName = true; - result.queryName_ = value; - return this; - } - public Builder ClearQueryName() { - result.hasQueryName = false; - result.queryName_ = "NoName"; - return this; - } - - public bool HasProcessName { - get { return result.HasProcessName; } - } - public string ProcessName { - get { return result.ProcessName; } - set { SetProcessName(value); } - } - public Builder SetProcessName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasProcessName = true; - result.processName_ = value; - return this; - } - public Builder ClearProcessName() { - result.hasProcessName = false; - result.processName_ = ""; - return this; - } - } - static ExecuteRequest() { - object.ReferenceEquals(global::bnet.protocol.storage.Storage.Descriptor, null); - } - } - - public sealed partial class ExecuteResponse : pb::GeneratedMessage { - private static readonly ExecuteResponse defaultInstance = new Builder().BuildPartial(); - public static ExecuteResponse DefaultInstance { - get { return defaultInstance; } - } - - public override ExecuteResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ExecuteResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.storage.Storage.internal__static_bnet_protocol_storage_ExecuteResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.storage.Storage.internal__static_bnet_protocol_storage_ExecuteResponse__FieldAccessorTable; } - } - - public const int ErrorCodeFieldNumber = 1; - private bool hasErrorCode; - private uint errorCode_ = 0; - public bool HasErrorCode { - get { return hasErrorCode; } - } - public uint ErrorCode { - get { return errorCode_; } - } - - public const int ResultsFieldNumber = 2; - private pbc::PopsicleList results_ = new pbc::PopsicleList(); - public scg::IList ResultsList { - get { return results_; } - } - public int ResultsCount { - get { return results_.Count; } - } - public global::bnet.protocol.storage.OperationResult GetResults(int index) { - return results_[index]; - } - - public const int ErrorMessageFieldNumber = 3; - private bool hasErrorMessage; - private string errorMessage_ = ""; - public bool HasErrorMessage { - get { return hasErrorMessage; } - } - public string ErrorMessage { - get { return errorMessage_; } - } - - public override bool IsInitialized { - get { - foreach (global::bnet.protocol.storage.OperationResult element in ResultsList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasErrorCode) { - output.WriteUInt32(1, ErrorCode); - } - foreach (global::bnet.protocol.storage.OperationResult element in ResultsList) { - output.WriteMessage(2, element); - } - if (HasErrorMessage) { - output.WriteString(3, ErrorMessage); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasErrorCode) { - size += pb::CodedOutputStream.ComputeUInt32Size(1, ErrorCode); - } - foreach (global::bnet.protocol.storage.OperationResult element in ResultsList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - if (HasErrorMessage) { - size += pb::CodedOutputStream.ComputeStringSize(3, ErrorMessage); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ExecuteResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ExecuteResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ExecuteResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ExecuteResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ExecuteResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ExecuteResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ExecuteResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ExecuteResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ExecuteResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ExecuteResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ExecuteResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ExecuteResponse result = new ExecuteResponse(); - - protected override ExecuteResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ExecuteResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.storage.ExecuteResponse.Descriptor; } - } - - public override ExecuteResponse DefaultInstanceForType { - get { return global::bnet.protocol.storage.ExecuteResponse.DefaultInstance; } - } - - public override ExecuteResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.results_.MakeReadOnly(); - ExecuteResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ExecuteResponse) { - return MergeFrom((ExecuteResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ExecuteResponse other) { - if (other == global::bnet.protocol.storage.ExecuteResponse.DefaultInstance) return this; - if (other.HasErrorCode) { - ErrorCode = other.ErrorCode; - } - if (other.results_.Count != 0) { - base.AddRange(other.results_, result.results_); - } - if (other.HasErrorMessage) { - ErrorMessage = other.ErrorMessage; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - ErrorCode = input.ReadUInt32(); - break; - } - case 18: { - global::bnet.protocol.storage.OperationResult.Builder subBuilder = global::bnet.protocol.storage.OperationResult.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddResults(subBuilder.BuildPartial()); - break; - } - case 26: { - ErrorMessage = input.ReadString(); - break; - } - } - } - } - - - public bool HasErrorCode { - get { return result.HasErrorCode; } - } - public uint ErrorCode { - get { return result.ErrorCode; } - set { SetErrorCode(value); } - } - public Builder SetErrorCode(uint value) { - result.hasErrorCode = true; - result.errorCode_ = value; - return this; - } - public Builder ClearErrorCode() { - result.hasErrorCode = false; - result.errorCode_ = 0; - return this; - } - - public pbc::IPopsicleList ResultsList { - get { return result.results_; } - } - public int ResultsCount { - get { return result.ResultsCount; } - } - public global::bnet.protocol.storage.OperationResult GetResults(int index) { - return result.GetResults(index); - } - public Builder SetResults(int index, global::bnet.protocol.storage.OperationResult value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.results_[index] = value; - return this; - } - public Builder SetResults(int index, global::bnet.protocol.storage.OperationResult.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.results_[index] = builderForValue.Build(); - return this; - } - public Builder AddResults(global::bnet.protocol.storage.OperationResult value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.results_.Add(value); - return this; - } - public Builder AddResults(global::bnet.protocol.storage.OperationResult.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.results_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeResults(scg::IEnumerable values) { - base.AddRange(values, result.results_); - return this; - } - public Builder ClearResults() { - result.results_.Clear(); - return this; - } - - public bool HasErrorMessage { - get { return result.HasErrorMessage; } - } - public string ErrorMessage { - get { return result.ErrorMessage; } - set { SetErrorMessage(value); } - } - public Builder SetErrorMessage(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasErrorMessage = true; - result.errorMessage_ = value; - return this; - } - public Builder ClearErrorMessage() { - result.hasErrorMessage = false; - result.errorMessage_ = ""; - return this; - } - } - static ExecuteResponse() { - object.ReferenceEquals(global::bnet.protocol.storage.Storage.Descriptor, null); - } - } - - #endregion - - #region Services - public abstract class StorageService : pb::IService { - public abstract void Execute( - pb::IRpcController controller, - global::bnet.protocol.storage.ExecuteRequest request, - global::System.Action done); - public abstract void OpenTable( - pb::IRpcController controller, - global::bnet.protocol.storage.OpenTableRequest request, - global::System.Action done); - public abstract void OpenColumn( - pb::IRpcController controller, - global::bnet.protocol.storage.OpenColumnRequest request, - global::System.Action done); - - public static pbd::ServiceDescriptor Descriptor { - get { return Storage.Descriptor.Services[0]; } - } - public pbd::ServiceDescriptor DescriptorForType { - get { return Descriptor; } - } - - public void CallMethod( - pbd::MethodDescriptor method, - pb::IRpcController controller, - pb::IMessage request, - global::System.Action done) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.CallMethod() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - this.Execute(controller, (global::bnet.protocol.storage.ExecuteRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 1: - this.OpenTable(controller, (global::bnet.protocol.storage.OpenTableRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 2: - this.OpenColumn(controller, (global::bnet.protocol.storage.OpenColumnRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetRequestPrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::bnet.protocol.storage.ExecuteRequest.DefaultInstance; - case 1: - return global::bnet.protocol.storage.OpenTableRequest.DefaultInstance; - case 2: - return global::bnet.protocol.storage.OpenColumnRequest.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetResponsePrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::bnet.protocol.storage.ExecuteResponse.DefaultInstance; - case 1: - return global::bnet.protocol.storage.OpenTableResponse.DefaultInstance; - case 2: - return global::bnet.protocol.storage.OpenColumnResponse.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public static Stub CreateStub(pb::IRpcChannel channel) { - return new Stub(channel); - } - - public class Stub : global::bnet.protocol.storage.StorageService { - internal Stub(pb::IRpcChannel channel) { - this.channel = channel; - } - - private readonly pb::IRpcChannel channel; - - public pb::IRpcChannel Channel { - get { return channel; } - } - - public override void Execute( - pb::IRpcController controller, - global::bnet.protocol.storage.ExecuteRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[0], - controller, request, global::bnet.protocol.storage.ExecuteResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.storage.ExecuteResponse.DefaultInstance)); - } - - public override void OpenTable( - pb::IRpcController controller, - global::bnet.protocol.storage.OpenTableRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[1], - controller, request, global::bnet.protocol.storage.OpenTableResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.storage.OpenTableResponse.DefaultInstance)); - } - - public override void OpenColumn( - pb::IRpcController controller, - global::bnet.protocol.storage.OpenColumnRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[2], - controller, request, global::bnet.protocol.storage.OpenColumnResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.storage.OpenColumnResponse.DefaultInstance)); - } - } - } - #endregion - -} diff --git a/source/D3Proto/bnet/protocol/toon/Toon.cs b/source/D3Proto/bnet/protocol/toon/Toon.cs deleted file mode 100644 index db9f8339..00000000 --- a/source/D3Proto/bnet/protocol/toon/Toon.cs +++ /dev/null @@ -1,861 +0,0 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace bnet.protocol.toon { - - public static partial class Toon { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_bnet_protocol_toon_ToonHandle__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_toon_ToonHandle__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_toon_ToonName__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_toon_ToonName__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_toon_ToonInfo__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_toon_ToonInfo__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static Toon() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "ChdzZXJ2aWNlL3Rvb24vdG9vbi5wcm90bxISYm5ldC5wcm90b2NvbC50b29u" + - "IkgKClRvb25IYW5kbGUSCgoCaWQYASACKAYSDwoHcHJvZ3JhbRgCIAIoBxIO" + - "CgZyZWdpb24YAyACKA0SDQoFcmVhbG0YBCACKA0iHQoIVG9vbk5hbWUSEQoJ" + - "ZnVsbF9uYW1lGAEgAigJIjYKCFRvb25JbmZvEioKBG5hbWUYASACKAsyHC5i" + - "bmV0LnByb3RvY29sLnRvb24uVG9vbk5hbWVCA4ABAQ=="); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_bnet_protocol_toon_ToonHandle__Descriptor = Descriptor.MessageTypes[0]; - internal__static_bnet_protocol_toon_ToonHandle__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_toon_ToonHandle__Descriptor, - new string[] { "Id", "Program", "Region", "Realm", }); - internal__static_bnet_protocol_toon_ToonName__Descriptor = Descriptor.MessageTypes[1]; - internal__static_bnet_protocol_toon_ToonName__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_toon_ToonName__Descriptor, - new string[] { "FullName", }); - internal__static_bnet_protocol_toon_ToonInfo__Descriptor = Descriptor.MessageTypes[2]; - internal__static_bnet_protocol_toon_ToonInfo__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_toon_ToonInfo__Descriptor, - new string[] { "Name", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - }, assigner); - } - #endregion - - } - #region Messages - public sealed partial class ToonHandle : pb::GeneratedMessage { - private static readonly ToonHandle defaultInstance = new Builder().BuildPartial(); - public static ToonHandle DefaultInstance { - get { return defaultInstance; } - } - - public override ToonHandle DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ToonHandle ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.toon.Toon.internal__static_bnet_protocol_toon_ToonHandle__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.toon.Toon.internal__static_bnet_protocol_toon_ToonHandle__FieldAccessorTable; } - } - - public const int IdFieldNumber = 1; - private bool hasId; - private ulong id_ = 0; - public bool HasId { - get { return hasId; } - } - public ulong Id { - get { return id_; } - } - - public const int ProgramFieldNumber = 2; - private bool hasProgram; - private uint program_ = 0; - public bool HasProgram { - get { return hasProgram; } - } - public uint Program { - get { return program_; } - } - - public const int RegionFieldNumber = 3; - private bool hasRegion; - private uint region_ = 0; - public bool HasRegion { - get { return hasRegion; } - } - public uint Region { - get { return region_; } - } - - public const int RealmFieldNumber = 4; - private bool hasRealm; - private uint realm_ = 0; - public bool HasRealm { - get { return hasRealm; } - } - public uint Realm { - get { return realm_; } - } - - public override bool IsInitialized { - get { - if (!hasId) return false; - if (!hasProgram) return false; - if (!hasRegion) return false; - if (!hasRealm) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasId) { - output.WriteFixed64(1, Id); - } - if (HasProgram) { - output.WriteFixed32(2, Program); - } - if (HasRegion) { - output.WriteUInt32(3, Region); - } - if (HasRealm) { - output.WriteUInt32(4, Realm); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasId) { - size += pb::CodedOutputStream.ComputeFixed64Size(1, Id); - } - if (HasProgram) { - size += pb::CodedOutputStream.ComputeFixed32Size(2, Program); - } - if (HasRegion) { - size += pb::CodedOutputStream.ComputeUInt32Size(3, Region); - } - if (HasRealm) { - size += pb::CodedOutputStream.ComputeUInt32Size(4, Realm); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ToonHandle ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ToonHandle ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ToonHandle ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ToonHandle ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ToonHandle ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ToonHandle ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ToonHandle ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ToonHandle ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ToonHandle ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ToonHandle ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ToonHandle prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ToonHandle result = new ToonHandle(); - - protected override ToonHandle MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ToonHandle(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.toon.ToonHandle.Descriptor; } - } - - public override ToonHandle DefaultInstanceForType { - get { return global::bnet.protocol.toon.ToonHandle.DefaultInstance; } - } - - public override ToonHandle BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - ToonHandle returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ToonHandle) { - return MergeFrom((ToonHandle) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ToonHandle other) { - if (other == global::bnet.protocol.toon.ToonHandle.DefaultInstance) return this; - if (other.HasId) { - Id = other.Id; - } - if (other.HasProgram) { - Program = other.Program; - } - if (other.HasRegion) { - Region = other.Region; - } - if (other.HasRealm) { - Realm = other.Realm; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 9: { - Id = input.ReadFixed64(); - break; - } - case 21: { - Program = input.ReadFixed32(); - break; - } - case 24: { - Region = input.ReadUInt32(); - break; - } - case 32: { - Realm = input.ReadUInt32(); - break; - } - } - } - } - - - public bool HasId { - get { return result.HasId; } - } - public ulong Id { - get { return result.Id; } - set { SetId(value); } - } - public Builder SetId(ulong value) { - result.hasId = true; - result.id_ = value; - return this; - } - public Builder ClearId() { - result.hasId = false; - result.id_ = 0; - return this; - } - - public bool HasProgram { - get { return result.HasProgram; } - } - public uint Program { - get { return result.Program; } - set { SetProgram(value); } - } - public Builder SetProgram(uint value) { - result.hasProgram = true; - result.program_ = value; - return this; - } - public Builder ClearProgram() { - result.hasProgram = false; - result.program_ = 0; - return this; - } - - public bool HasRegion { - get { return result.HasRegion; } - } - public uint Region { - get { return result.Region; } - set { SetRegion(value); } - } - public Builder SetRegion(uint value) { - result.hasRegion = true; - result.region_ = value; - return this; - } - public Builder ClearRegion() { - result.hasRegion = false; - result.region_ = 0; - return this; - } - - public bool HasRealm { - get { return result.HasRealm; } - } - public uint Realm { - get { return result.Realm; } - set { SetRealm(value); } - } - public Builder SetRealm(uint value) { - result.hasRealm = true; - result.realm_ = value; - return this; - } - public Builder ClearRealm() { - result.hasRealm = false; - result.realm_ = 0; - return this; - } - } - static ToonHandle() { - object.ReferenceEquals(global::bnet.protocol.toon.Toon.Descriptor, null); - } - } - - public sealed partial class ToonName : pb::GeneratedMessage { - private static readonly ToonName defaultInstance = new Builder().BuildPartial(); - public static ToonName DefaultInstance { - get { return defaultInstance; } - } - - public override ToonName DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ToonName ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.toon.Toon.internal__static_bnet_protocol_toon_ToonName__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.toon.Toon.internal__static_bnet_protocol_toon_ToonName__FieldAccessorTable; } - } - - public const int FullNameFieldNumber = 1; - private bool hasFullName; - private string fullName_ = ""; - public bool HasFullName { - get { return hasFullName; } - } - public string FullName { - get { return fullName_; } - } - - public override bool IsInitialized { - get { - if (!hasFullName) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasFullName) { - output.WriteString(1, FullName); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasFullName) { - size += pb::CodedOutputStream.ComputeStringSize(1, FullName); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ToonName ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ToonName ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ToonName ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ToonName ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ToonName ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ToonName ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ToonName ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ToonName ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ToonName ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ToonName ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ToonName prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ToonName result = new ToonName(); - - protected override ToonName MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ToonName(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.toon.ToonName.Descriptor; } - } - - public override ToonName DefaultInstanceForType { - get { return global::bnet.protocol.toon.ToonName.DefaultInstance; } - } - - public override ToonName BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - ToonName returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ToonName) { - return MergeFrom((ToonName) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ToonName other) { - if (other == global::bnet.protocol.toon.ToonName.DefaultInstance) return this; - if (other.HasFullName) { - FullName = other.FullName; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - FullName = input.ReadString(); - break; - } - } - } - } - - - public bool HasFullName { - get { return result.HasFullName; } - } - public string FullName { - get { return result.FullName; } - set { SetFullName(value); } - } - public Builder SetFullName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasFullName = true; - result.fullName_ = value; - return this; - } - public Builder ClearFullName() { - result.hasFullName = false; - result.fullName_ = ""; - return this; - } - } - static ToonName() { - object.ReferenceEquals(global::bnet.protocol.toon.Toon.Descriptor, null); - } - } - - public sealed partial class ToonInfo : pb::GeneratedMessage { - private static readonly ToonInfo defaultInstance = new Builder().BuildPartial(); - public static ToonInfo DefaultInstance { - get { return defaultInstance; } - } - - public override ToonInfo DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ToonInfo ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.toon.Toon.internal__static_bnet_protocol_toon_ToonInfo__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.toon.Toon.internal__static_bnet_protocol_toon_ToonInfo__FieldAccessorTable; } - } - - public const int NameFieldNumber = 1; - private bool hasName; - private global::bnet.protocol.toon.ToonName name_ = global::bnet.protocol.toon.ToonName.DefaultInstance; - public bool HasName { - get { return hasName; } - } - public global::bnet.protocol.toon.ToonName Name { - get { return name_; } - } - - public override bool IsInitialized { - get { - if (!hasName) return false; - if (!Name.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasName) { - output.WriteMessage(1, Name); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasName) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Name); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ToonInfo ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ToonInfo ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ToonInfo ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ToonInfo ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ToonInfo ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ToonInfo ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ToonInfo ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ToonInfo ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ToonInfo ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ToonInfo ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ToonInfo prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ToonInfo result = new ToonInfo(); - - protected override ToonInfo MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ToonInfo(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.toon.ToonInfo.Descriptor; } - } - - public override ToonInfo DefaultInstanceForType { - get { return global::bnet.protocol.toon.ToonInfo.DefaultInstance; } - } - - public override ToonInfo BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - ToonInfo returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ToonInfo) { - return MergeFrom((ToonInfo) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ToonInfo other) { - if (other == global::bnet.protocol.toon.ToonInfo.DefaultInstance) return this; - if (other.HasName) { - MergeName(other.Name); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.toon.ToonName.Builder subBuilder = global::bnet.protocol.toon.ToonName.CreateBuilder(); - if (HasName) { - subBuilder.MergeFrom(Name); - } - input.ReadMessage(subBuilder, extensionRegistry); - Name = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasName { - get { return result.HasName; } - } - public global::bnet.protocol.toon.ToonName Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(global::bnet.protocol.toon.ToonName value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder SetName(global::bnet.protocol.toon.ToonName.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasName = true; - result.name_ = builderForValue.Build(); - return this; - } - public Builder MergeName(global::bnet.protocol.toon.ToonName value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasName && - result.name_ != global::bnet.protocol.toon.ToonName.DefaultInstance) { - result.name_ = global::bnet.protocol.toon.ToonName.CreateBuilder(result.name_).MergeFrom(value).BuildPartial(); - } else { - result.name_ = value; - } - result.hasName = true; - return this; - } - public Builder ClearName() { - result.hasName = false; - result.name_ = global::bnet.protocol.toon.ToonName.DefaultInstance; - return this; - } - } - static ToonInfo() { - object.ReferenceEquals(global::bnet.protocol.toon.Toon.Descriptor, null); - } - } - - #endregion - -} diff --git a/source/D3Proto/bnet/protocol/toon/external/ToonExternal.cs b/source/D3Proto/bnet/protocol/toon/external/ToonExternal.cs deleted file mode 100644 index ebe46e41..00000000 --- a/source/D3Proto/bnet/protocol/toon/external/ToonExternal.cs +++ /dev/null @@ -1,2038 +0,0 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace bnet.protocol.toon.external { - - public static partial class ToonExternal { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_bnet_protocol_toon_external_ToonListRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_toon_external_ToonListRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_toon_external_ToonListResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_toon_external_ToonListResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_toon_external_SelectToonRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_toon_external_SelectToonRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_toon_external_SelectToonResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_toon_external_SelectToonResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_toon_external_CreateToonRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_toon_external_CreateToonRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_toon_external_CreateToonResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_toon_external_CreateToonResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_toon_external_DeleteToonRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_toon_external_DeleteToonRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_toon_external_DeleteToonResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_toon_external_DeleteToonResponse__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static ToonExternal() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "CiBzZXJ2aWNlL3Rvb24vdG9vbl9leHRlcm5hbC5wcm90bxIbYm5ldC5wcm90" + - "b2NvbC50b29uLmV4dGVybmFsGhFsaWIvcnBjL3JwYy5wcm90bxoZbGliL3By" + - "b3RvY29sL2VudGl0eS5wcm90bxocbGliL3Byb3RvY29sL2F0dHJpYnV0ZS5w" + - "cm90bxoXc2VydmljZS90b29uL3Rvb24ucHJvdG8iEQoPVG9vbkxpc3RSZXF1" + - "ZXN0IjoKEFRvb25MaXN0UmVzcG9uc2USJgoFdG9vbnMYAiADKAsyFy5ibmV0" + - "LnByb3RvY29sLkVudGl0eUlkIjoKEVNlbGVjdFRvb25SZXF1ZXN0EiUKBHRv" + - "b24YASACKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkIhQKElNlbGVjdFRv" + - "b25SZXNwb25zZSJYChFDcmVhdGVUb29uUmVxdWVzdBIMCgRuYW1lGAEgASgJ" + - "EjUKCWF0dHJpYnV0ZRgCIAMoCzIiLmJuZXQucHJvdG9jb2wuYXR0cmlidXRl" + - "LkF0dHJpYnV0ZSI7ChJDcmVhdGVUb29uUmVzcG9uc2USJQoEdG9vbhgCIAEo" + - "CzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQiOgoRRGVsZXRlVG9vblJlcXVl" + - "c3QSJQoEdG9vbhgBIAIoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQiFAoS" + - "RGVsZXRlVG9vblJlc3BvbnNlMssDChNUb29uU2VydmljZUV4dGVybmFsEmcK" + - "CFRvb25MaXN0EiwuYm5ldC5wcm90b2NvbC50b29uLmV4dGVybmFsLlRvb25M" + - "aXN0UmVxdWVzdBotLmJuZXQucHJvdG9jb2wudG9vbi5leHRlcm5hbC5Ub29u" + - "TGlzdFJlc3BvbnNlEm0KClNlbGVjdFRvb24SLi5ibmV0LnByb3RvY29sLnRv" + - "b24uZXh0ZXJuYWwuU2VsZWN0VG9vblJlcXVlc3QaLy5ibmV0LnByb3RvY29s" + - "LnRvb24uZXh0ZXJuYWwuU2VsZWN0VG9vblJlc3BvbnNlEm0KCkNyZWF0ZVRv" + - "b24SLi5ibmV0LnByb3RvY29sLnRvb24uZXh0ZXJuYWwuQ3JlYXRlVG9vblJl" + - "cXVlc3QaLy5ibmV0LnByb3RvY29sLnRvb24uZXh0ZXJuYWwuQ3JlYXRlVG9v" + - "blJlc3BvbnNlEm0KCkRlbGV0ZVRvb24SLi5ibmV0LnByb3RvY29sLnRvb24u" + - "ZXh0ZXJuYWwuRGVsZXRlVG9vblJlcXVlc3QaLy5ibmV0LnByb3RvY29sLnRv" + - "b24uZXh0ZXJuYWwuRGVsZXRlVG9vblJlc3BvbnNlQgOAAQE="); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_bnet_protocol_toon_external_ToonListRequest__Descriptor = Descriptor.MessageTypes[0]; - internal__static_bnet_protocol_toon_external_ToonListRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_toon_external_ToonListRequest__Descriptor, - new string[] { }); - internal__static_bnet_protocol_toon_external_ToonListResponse__Descriptor = Descriptor.MessageTypes[1]; - internal__static_bnet_protocol_toon_external_ToonListResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_toon_external_ToonListResponse__Descriptor, - new string[] { "Toons", }); - internal__static_bnet_protocol_toon_external_SelectToonRequest__Descriptor = Descriptor.MessageTypes[2]; - internal__static_bnet_protocol_toon_external_SelectToonRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_toon_external_SelectToonRequest__Descriptor, - new string[] { "Toon", }); - internal__static_bnet_protocol_toon_external_SelectToonResponse__Descriptor = Descriptor.MessageTypes[3]; - internal__static_bnet_protocol_toon_external_SelectToonResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_toon_external_SelectToonResponse__Descriptor, - new string[] { }); - internal__static_bnet_protocol_toon_external_CreateToonRequest__Descriptor = Descriptor.MessageTypes[4]; - internal__static_bnet_protocol_toon_external_CreateToonRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_toon_external_CreateToonRequest__Descriptor, - new string[] { "Name", "Attribute", }); - internal__static_bnet_protocol_toon_external_CreateToonResponse__Descriptor = Descriptor.MessageTypes[5]; - internal__static_bnet_protocol_toon_external_CreateToonResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_toon_external_CreateToonResponse__Descriptor, - new string[] { "Toon", }); - internal__static_bnet_protocol_toon_external_DeleteToonRequest__Descriptor = Descriptor.MessageTypes[6]; - internal__static_bnet_protocol_toon_external_DeleteToonRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_toon_external_DeleteToonRequest__Descriptor, - new string[] { "Toon", }); - internal__static_bnet_protocol_toon_external_DeleteToonResponse__Descriptor = Descriptor.MessageTypes[7]; - internal__static_bnet_protocol_toon_external_DeleteToonResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_toon_external_DeleteToonResponse__Descriptor, - new string[] { }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::bnet.protocol.Rpc.Descriptor, - global::bnet.protocol.Entity.Descriptor, - global::bnet.protocol.attribute.Proto.Attribute.Descriptor, - global::bnet.protocol.toon.Toon.Descriptor, - }, assigner); - } - #endregion - - } - #region Messages - public sealed partial class ToonListRequest : pb::GeneratedMessage { - private static readonly ToonListRequest defaultInstance = new Builder().BuildPartial(); - public static ToonListRequest DefaultInstance { - get { return defaultInstance; } - } - - public override ToonListRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ToonListRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.toon.external.ToonExternal.internal__static_bnet_protocol_toon_external_ToonListRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.toon.external.ToonExternal.internal__static_bnet_protocol_toon_external_ToonListRequest__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ToonListRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ToonListRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ToonListRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ToonListRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ToonListRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ToonListRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ToonListRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ToonListRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ToonListRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ToonListRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ToonListRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ToonListRequest result = new ToonListRequest(); - - protected override ToonListRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ToonListRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.toon.external.ToonListRequest.Descriptor; } - } - - public override ToonListRequest DefaultInstanceForType { - get { return global::bnet.protocol.toon.external.ToonListRequest.DefaultInstance; } - } - - public override ToonListRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - ToonListRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ToonListRequest) { - return MergeFrom((ToonListRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ToonListRequest other) { - if (other == global::bnet.protocol.toon.external.ToonListRequest.DefaultInstance) return this; - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - } - } - } - - } - static ToonListRequest() { - object.ReferenceEquals(global::bnet.protocol.toon.external.ToonExternal.Descriptor, null); - } - } - - public sealed partial class ToonListResponse : pb::GeneratedMessage { - private static readonly ToonListResponse defaultInstance = new Builder().BuildPartial(); - public static ToonListResponse DefaultInstance { - get { return defaultInstance; } - } - - public override ToonListResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ToonListResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.toon.external.ToonExternal.internal__static_bnet_protocol_toon_external_ToonListResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.toon.external.ToonExternal.internal__static_bnet_protocol_toon_external_ToonListResponse__FieldAccessorTable; } - } - - public const int ToonsFieldNumber = 2; - private pbc::PopsicleList toons_ = new pbc::PopsicleList(); - public scg::IList ToonsList { - get { return toons_; } - } - public int ToonsCount { - get { return toons_.Count; } - } - public global::bnet.protocol.EntityId GetToons(int index) { - return toons_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::bnet.protocol.EntityId element in ToonsList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::bnet.protocol.EntityId element in ToonsList) { - output.WriteMessage(2, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::bnet.protocol.EntityId element in ToonsList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ToonListResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ToonListResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ToonListResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ToonListResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ToonListResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ToonListResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ToonListResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ToonListResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ToonListResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ToonListResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ToonListResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ToonListResponse result = new ToonListResponse(); - - protected override ToonListResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ToonListResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.toon.external.ToonListResponse.Descriptor; } - } - - public override ToonListResponse DefaultInstanceForType { - get { return global::bnet.protocol.toon.external.ToonListResponse.DefaultInstance; } - } - - public override ToonListResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.toons_.MakeReadOnly(); - ToonListResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ToonListResponse) { - return MergeFrom((ToonListResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ToonListResponse other) { - if (other == global::bnet.protocol.toon.external.ToonListResponse.DefaultInstance) return this; - if (other.toons_.Count != 0) { - base.AddRange(other.toons_, result.toons_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 18: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddToons(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public pbc::IPopsicleList ToonsList { - get { return result.toons_; } - } - public int ToonsCount { - get { return result.ToonsCount; } - } - public global::bnet.protocol.EntityId GetToons(int index) { - return result.GetToons(index); - } - public Builder SetToons(int index, global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.toons_[index] = value; - return this; - } - public Builder SetToons(int index, global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.toons_[index] = builderForValue.Build(); - return this; - } - public Builder AddToons(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.toons_.Add(value); - return this; - } - public Builder AddToons(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.toons_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeToons(scg::IEnumerable values) { - base.AddRange(values, result.toons_); - return this; - } - public Builder ClearToons() { - result.toons_.Clear(); - return this; - } - } - static ToonListResponse() { - object.ReferenceEquals(global::bnet.protocol.toon.external.ToonExternal.Descriptor, null); - } - } - - public sealed partial class SelectToonRequest : pb::GeneratedMessage { - private static readonly SelectToonRequest defaultInstance = new Builder().BuildPartial(); - public static SelectToonRequest DefaultInstance { - get { return defaultInstance; } - } - - public override SelectToonRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override SelectToonRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.toon.external.ToonExternal.internal__static_bnet_protocol_toon_external_SelectToonRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.toon.external.ToonExternal.internal__static_bnet_protocol_toon_external_SelectToonRequest__FieldAccessorTable; } - } - - public const int ToonFieldNumber = 1; - private bool hasToon; - private global::bnet.protocol.EntityId toon_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasToon { - get { return hasToon; } - } - public global::bnet.protocol.EntityId Toon { - get { return toon_; } - } - - public override bool IsInitialized { - get { - if (!hasToon) return false; - if (!Toon.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasToon) { - output.WriteMessage(1, Toon); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasToon) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Toon); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static SelectToonRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SelectToonRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SelectToonRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SelectToonRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SelectToonRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SelectToonRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SelectToonRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SelectToonRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SelectToonRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SelectToonRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SelectToonRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - SelectToonRequest result = new SelectToonRequest(); - - protected override SelectToonRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new SelectToonRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.toon.external.SelectToonRequest.Descriptor; } - } - - public override SelectToonRequest DefaultInstanceForType { - get { return global::bnet.protocol.toon.external.SelectToonRequest.DefaultInstance; } - } - - public override SelectToonRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - SelectToonRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SelectToonRequest) { - return MergeFrom((SelectToonRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SelectToonRequest other) { - if (other == global::bnet.protocol.toon.external.SelectToonRequest.DefaultInstance) return this; - if (other.HasToon) { - MergeToon(other.Toon); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasToon) { - subBuilder.MergeFrom(Toon); - } - input.ReadMessage(subBuilder, extensionRegistry); - Toon = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasToon { - get { return result.HasToon; } - } - public global::bnet.protocol.EntityId Toon { - get { return result.Toon; } - set { SetToon(value); } - } - public Builder SetToon(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasToon = true; - result.toon_ = value; - return this; - } - public Builder SetToon(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasToon = true; - result.toon_ = builderForValue.Build(); - return this; - } - public Builder MergeToon(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasToon && - result.toon_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.toon_ = global::bnet.protocol.EntityId.CreateBuilder(result.toon_).MergeFrom(value).BuildPartial(); - } else { - result.toon_ = value; - } - result.hasToon = true; - return this; - } - public Builder ClearToon() { - result.hasToon = false; - result.toon_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - } - static SelectToonRequest() { - object.ReferenceEquals(global::bnet.protocol.toon.external.ToonExternal.Descriptor, null); - } - } - - public sealed partial class SelectToonResponse : pb::GeneratedMessage { - private static readonly SelectToonResponse defaultInstance = new Builder().BuildPartial(); - public static SelectToonResponse DefaultInstance { - get { return defaultInstance; } - } - - public override SelectToonResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override SelectToonResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.toon.external.ToonExternal.internal__static_bnet_protocol_toon_external_SelectToonResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.toon.external.ToonExternal.internal__static_bnet_protocol_toon_external_SelectToonResponse__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static SelectToonResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SelectToonResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SelectToonResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SelectToonResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SelectToonResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SelectToonResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SelectToonResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SelectToonResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SelectToonResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SelectToonResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SelectToonResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - SelectToonResponse result = new SelectToonResponse(); - - protected override SelectToonResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new SelectToonResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.toon.external.SelectToonResponse.Descriptor; } - } - - public override SelectToonResponse DefaultInstanceForType { - get { return global::bnet.protocol.toon.external.SelectToonResponse.DefaultInstance; } - } - - public override SelectToonResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - SelectToonResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SelectToonResponse) { - return MergeFrom((SelectToonResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SelectToonResponse other) { - if (other == global::bnet.protocol.toon.external.SelectToonResponse.DefaultInstance) return this; - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - } - } - } - - } - static SelectToonResponse() { - object.ReferenceEquals(global::bnet.protocol.toon.external.ToonExternal.Descriptor, null); - } - } - - public sealed partial class CreateToonRequest : pb::GeneratedMessage { - private static readonly CreateToonRequest defaultInstance = new Builder().BuildPartial(); - public static CreateToonRequest DefaultInstance { - get { return defaultInstance; } - } - - public override CreateToonRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override CreateToonRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.toon.external.ToonExternal.internal__static_bnet_protocol_toon_external_CreateToonRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.toon.external.ToonExternal.internal__static_bnet_protocol_toon_external_CreateToonRequest__FieldAccessorTable; } - } - - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } - } - - public const int AttributeFieldNumber = 2; - private pbc::PopsicleList attribute_ = new pbc::PopsicleList(); - public scg::IList AttributeList { - get { return attribute_; } - } - public int AttributeCount { - get { return attribute_.Count; } - } - public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { - return attribute_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasName) { - output.WriteString(1, Name); - } - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - output.WriteMessage(2, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasName) { - size += pb::CodedOutputStream.ComputeStringSize(1, Name); - } - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static CreateToonRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CreateToonRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CreateToonRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CreateToonRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CreateToonRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CreateToonRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CreateToonRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CreateToonRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CreateToonRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CreateToonRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CreateToonRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - CreateToonRequest result = new CreateToonRequest(); - - protected override CreateToonRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new CreateToonRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.toon.external.CreateToonRequest.Descriptor; } - } - - public override CreateToonRequest DefaultInstanceForType { - get { return global::bnet.protocol.toon.external.CreateToonRequest.DefaultInstance; } - } - - public override CreateToonRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.attribute_.MakeReadOnly(); - CreateToonRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CreateToonRequest) { - return MergeFrom((CreateToonRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CreateToonRequest other) { - if (other == global::bnet.protocol.toon.external.CreateToonRequest.DefaultInstance) return this; - if (other.HasName) { - Name = other.Name; - } - if (other.attribute_.Count != 0) { - base.AddRange(other.attribute_, result.attribute_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - Name = input.ReadString(); - break; - } - case 18: { - global::bnet.protocol.attribute.Attribute.Builder subBuilder = global::bnet.protocol.attribute.Attribute.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddAttribute(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public bool HasName { - get { return result.HasName; } - } - public string Name { - get { return result.Name; } - set { SetName(value); } - } - public Builder SetName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasName = true; - result.name_ = value; - return this; - } - public Builder ClearName() { - result.hasName = false; - result.name_ = ""; - return this; - } - - public pbc::IPopsicleList AttributeList { - get { return result.attribute_; } - } - public int AttributeCount { - get { return result.AttributeCount; } - } - public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { - return result.GetAttribute(index); - } - public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.attribute_[index] = value; - return this; - } - public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.attribute_[index] = builderForValue.Build(); - return this; - } - public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.attribute_.Add(value); - return this; - } - public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.attribute_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeAttribute(scg::IEnumerable values) { - base.AddRange(values, result.attribute_); - return this; - } - public Builder ClearAttribute() { - result.attribute_.Clear(); - return this; - } - } - static CreateToonRequest() { - object.ReferenceEquals(global::bnet.protocol.toon.external.ToonExternal.Descriptor, null); - } - } - - public sealed partial class CreateToonResponse : pb::GeneratedMessage { - private static readonly CreateToonResponse defaultInstance = new Builder().BuildPartial(); - public static CreateToonResponse DefaultInstance { - get { return defaultInstance; } - } - - public override CreateToonResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override CreateToonResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.toon.external.ToonExternal.internal__static_bnet_protocol_toon_external_CreateToonResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.toon.external.ToonExternal.internal__static_bnet_protocol_toon_external_CreateToonResponse__FieldAccessorTable; } - } - - public const int ToonFieldNumber = 2; - private bool hasToon; - private global::bnet.protocol.EntityId toon_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasToon { - get { return hasToon; } - } - public global::bnet.protocol.EntityId Toon { - get { return toon_; } - } - - public override bool IsInitialized { - get { - if (HasToon) { - if (!Toon.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasToon) { - output.WriteMessage(2, Toon); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasToon) { - size += pb::CodedOutputStream.ComputeMessageSize(2, Toon); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static CreateToonResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CreateToonResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CreateToonResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CreateToonResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CreateToonResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CreateToonResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CreateToonResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CreateToonResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CreateToonResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CreateToonResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CreateToonResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - CreateToonResponse result = new CreateToonResponse(); - - protected override CreateToonResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new CreateToonResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.toon.external.CreateToonResponse.Descriptor; } - } - - public override CreateToonResponse DefaultInstanceForType { - get { return global::bnet.protocol.toon.external.CreateToonResponse.DefaultInstance; } - } - - public override CreateToonResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - CreateToonResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CreateToonResponse) { - return MergeFrom((CreateToonResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CreateToonResponse other) { - if (other == global::bnet.protocol.toon.external.CreateToonResponse.DefaultInstance) return this; - if (other.HasToon) { - MergeToon(other.Toon); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 18: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasToon) { - subBuilder.MergeFrom(Toon); - } - input.ReadMessage(subBuilder, extensionRegistry); - Toon = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasToon { - get { return result.HasToon; } - } - public global::bnet.protocol.EntityId Toon { - get { return result.Toon; } - set { SetToon(value); } - } - public Builder SetToon(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasToon = true; - result.toon_ = value; - return this; - } - public Builder SetToon(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasToon = true; - result.toon_ = builderForValue.Build(); - return this; - } - public Builder MergeToon(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasToon && - result.toon_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.toon_ = global::bnet.protocol.EntityId.CreateBuilder(result.toon_).MergeFrom(value).BuildPartial(); - } else { - result.toon_ = value; - } - result.hasToon = true; - return this; - } - public Builder ClearToon() { - result.hasToon = false; - result.toon_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - } - static CreateToonResponse() { - object.ReferenceEquals(global::bnet.protocol.toon.external.ToonExternal.Descriptor, null); - } - } - - public sealed partial class DeleteToonRequest : pb::GeneratedMessage { - private static readonly DeleteToonRequest defaultInstance = new Builder().BuildPartial(); - public static DeleteToonRequest DefaultInstance { - get { return defaultInstance; } - } - - public override DeleteToonRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override DeleteToonRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.toon.external.ToonExternal.internal__static_bnet_protocol_toon_external_DeleteToonRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.toon.external.ToonExternal.internal__static_bnet_protocol_toon_external_DeleteToonRequest__FieldAccessorTable; } - } - - public const int ToonFieldNumber = 1; - private bool hasToon; - private global::bnet.protocol.EntityId toon_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasToon { - get { return hasToon; } - } - public global::bnet.protocol.EntityId Toon { - get { return toon_; } - } - - public override bool IsInitialized { - get { - if (!hasToon) return false; - if (!Toon.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasToon) { - output.WriteMessage(1, Toon); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasToon) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Toon); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static DeleteToonRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DeleteToonRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DeleteToonRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DeleteToonRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DeleteToonRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DeleteToonRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static DeleteToonRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static DeleteToonRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static DeleteToonRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DeleteToonRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(DeleteToonRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - DeleteToonRequest result = new DeleteToonRequest(); - - protected override DeleteToonRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new DeleteToonRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.toon.external.DeleteToonRequest.Descriptor; } - } - - public override DeleteToonRequest DefaultInstanceForType { - get { return global::bnet.protocol.toon.external.DeleteToonRequest.DefaultInstance; } - } - - public override DeleteToonRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - DeleteToonRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is DeleteToonRequest) { - return MergeFrom((DeleteToonRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(DeleteToonRequest other) { - if (other == global::bnet.protocol.toon.external.DeleteToonRequest.DefaultInstance) return this; - if (other.HasToon) { - MergeToon(other.Toon); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasToon) { - subBuilder.MergeFrom(Toon); - } - input.ReadMessage(subBuilder, extensionRegistry); - Toon = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasToon { - get { return result.HasToon; } - } - public global::bnet.protocol.EntityId Toon { - get { return result.Toon; } - set { SetToon(value); } - } - public Builder SetToon(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasToon = true; - result.toon_ = value; - return this; - } - public Builder SetToon(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasToon = true; - result.toon_ = builderForValue.Build(); - return this; - } - public Builder MergeToon(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasToon && - result.toon_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.toon_ = global::bnet.protocol.EntityId.CreateBuilder(result.toon_).MergeFrom(value).BuildPartial(); - } else { - result.toon_ = value; - } - result.hasToon = true; - return this; - } - public Builder ClearToon() { - result.hasToon = false; - result.toon_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - } - static DeleteToonRequest() { - object.ReferenceEquals(global::bnet.protocol.toon.external.ToonExternal.Descriptor, null); - } - } - - public sealed partial class DeleteToonResponse : pb::GeneratedMessage { - private static readonly DeleteToonResponse defaultInstance = new Builder().BuildPartial(); - public static DeleteToonResponse DefaultInstance { - get { return defaultInstance; } - } - - public override DeleteToonResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override DeleteToonResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.toon.external.ToonExternal.internal__static_bnet_protocol_toon_external_DeleteToonResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.toon.external.ToonExternal.internal__static_bnet_protocol_toon_external_DeleteToonResponse__FieldAccessorTable; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static DeleteToonResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DeleteToonResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DeleteToonResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DeleteToonResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DeleteToonResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DeleteToonResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static DeleteToonResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static DeleteToonResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static DeleteToonResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DeleteToonResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(DeleteToonResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - DeleteToonResponse result = new DeleteToonResponse(); - - protected override DeleteToonResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new DeleteToonResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.toon.external.DeleteToonResponse.Descriptor; } - } - - public override DeleteToonResponse DefaultInstanceForType { - get { return global::bnet.protocol.toon.external.DeleteToonResponse.DefaultInstance; } - } - - public override DeleteToonResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - DeleteToonResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is DeleteToonResponse) { - return MergeFrom((DeleteToonResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(DeleteToonResponse other) { - if (other == global::bnet.protocol.toon.external.DeleteToonResponse.DefaultInstance) return this; - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - } - } - } - - } - static DeleteToonResponse() { - object.ReferenceEquals(global::bnet.protocol.toon.external.ToonExternal.Descriptor, null); - } - } - - #endregion - - #region Services - public abstract class ToonServiceExternal : pb::IService { - public abstract void ToonList( - pb::IRpcController controller, - global::bnet.protocol.toon.external.ToonListRequest request, - global::System.Action done); - public abstract void SelectToon( - pb::IRpcController controller, - global::bnet.protocol.toon.external.SelectToonRequest request, - global::System.Action done); - public abstract void CreateToon( - pb::IRpcController controller, - global::bnet.protocol.toon.external.CreateToonRequest request, - global::System.Action done); - public abstract void DeleteToon( - pb::IRpcController controller, - global::bnet.protocol.toon.external.DeleteToonRequest request, - global::System.Action done); - - public static pbd::ServiceDescriptor Descriptor { - get { return ToonExternal.Descriptor.Services[0]; } - } - public pbd::ServiceDescriptor DescriptorForType { - get { return Descriptor; } - } - - public void CallMethod( - pbd::MethodDescriptor method, - pb::IRpcController controller, - pb::IMessage request, - global::System.Action done) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.CallMethod() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - this.ToonList(controller, (global::bnet.protocol.toon.external.ToonListRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 1: - this.SelectToon(controller, (global::bnet.protocol.toon.external.SelectToonRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 2: - this.CreateToon(controller, (global::bnet.protocol.toon.external.CreateToonRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 3: - this.DeleteToon(controller, (global::bnet.protocol.toon.external.DeleteToonRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetRequestPrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::bnet.protocol.toon.external.ToonListRequest.DefaultInstance; - case 1: - return global::bnet.protocol.toon.external.SelectToonRequest.DefaultInstance; - case 2: - return global::bnet.protocol.toon.external.CreateToonRequest.DefaultInstance; - case 3: - return global::bnet.protocol.toon.external.DeleteToonRequest.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetResponsePrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::bnet.protocol.toon.external.ToonListResponse.DefaultInstance; - case 1: - return global::bnet.protocol.toon.external.SelectToonResponse.DefaultInstance; - case 2: - return global::bnet.protocol.toon.external.CreateToonResponse.DefaultInstance; - case 3: - return global::bnet.protocol.toon.external.DeleteToonResponse.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public static Stub CreateStub(pb::IRpcChannel channel) { - return new Stub(channel); - } - - public class Stub : global::bnet.protocol.toon.external.ToonServiceExternal { - internal Stub(pb::IRpcChannel channel) { - this.channel = channel; - } - - private readonly pb::IRpcChannel channel; - - public pb::IRpcChannel Channel { - get { return channel; } - } - - public override void ToonList( - pb::IRpcController controller, - global::bnet.protocol.toon.external.ToonListRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[0], - controller, request, global::bnet.protocol.toon.external.ToonListResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.toon.external.ToonListResponse.DefaultInstance)); - } - - public override void SelectToon( - pb::IRpcController controller, - global::bnet.protocol.toon.external.SelectToonRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[1], - controller, request, global::bnet.protocol.toon.external.SelectToonResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.toon.external.SelectToonResponse.DefaultInstance)); - } - - public override void CreateToon( - pb::IRpcController controller, - global::bnet.protocol.toon.external.CreateToonRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[2], - controller, request, global::bnet.protocol.toon.external.CreateToonResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.toon.external.CreateToonResponse.DefaultInstance)); - } - - public override void DeleteToon( - pb::IRpcController controller, - global::bnet.protocol.toon.external.DeleteToonRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[3], - controller, request, global::bnet.protocol.toon.external.DeleteToonResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.toon.external.DeleteToonResponse.DefaultInstance)); - } - } - } - #endregion - -} diff --git a/source/D3Proto/bnet/protocol/user_manager/UserManager.cs b/source/D3Proto/bnet/protocol/user_manager/UserManager.cs deleted file mode 100644 index 537fc3bc..00000000 --- a/source/D3Proto/bnet/protocol/user_manager/UserManager.cs +++ /dev/null @@ -1,4947 +0,0 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace bnet.protocol.user_manager { - - public static partial class UserManager { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_PlayerReport__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_PlayerReport__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_RecentPlayer__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_RecentPlayer__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_SubscribeToUserManagerRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_SubscribeToUserManagerRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_SubscribeToUserManagerResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_SubscribeToUserManagerResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_ReportPlayerRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_ReportPlayerRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_ReportPlayerResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_ReportPlayerResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_CheckPlayerBlockRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_CheckPlayerBlockRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_CheckPlayerBlockResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_CheckPlayerBlockResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_BlockPlayerRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_BlockPlayerRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_BlockPlayerResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_BlockPlayerResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_RemovePlayerBlockRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_RemovePlayerBlockRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_RemovePlayerBlockResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_RemovePlayerBlockResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_AddRecentPlayersRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_AddRecentPlayersRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_AddRecentPlayersResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_AddRecentPlayersResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_RemoveRecentPlayersRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_RemoveRecentPlayersRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_RemoveRecentPlayersResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_RemoveRecentPlayersResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_BlockedPlayerNotification__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_BlockedPlayerNotification__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static UserManager() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "CidzZXJ2aWNlL3VzZXJfbWFuYWdlci91c2VyX21hbmFnZXIucHJvdG8SGmJu" + - "ZXQucHJvdG9jb2wudXNlcl9tYW5hZ2VyGhxsaWIvcHJvdG9jb2wvYXR0cmli" + - "dXRlLnByb3RvGhlsaWIvcHJvdG9jb2wvZW50aXR5LnByb3RvGhFsaWIvcnBj" + - "L3JwYy5wcm90byLIAgoMUGxheWVyUmVwb3J0ElIKDmNvbXBsYWludF9jb2Rl" + - "GAEgAigOMjouYm5ldC5wcm90b2NvbC51c2VyX21hbmFnZXIuUGxheWVyUmVw" + - "b3J0LlVzZXJDb21wbGFpbnRDb2RlEhYKDmNvbXBsYWludF9ub3RlGAIgAigJ" + - "IssBChFVc2VyQ29tcGxhaW50Q29kZRIXChNVU0VSX0NPTVBMQUlOVF9TUEFN" + - "EAASHQoZVVNFUl9DT01QTEFJTlRfSEFSQVNTTUVOVBABEiMKH1VTRVJfQ09N" + - "UExBSU5UX1JFQUxfTElGRV9USFJFQVQQAhIlCiFVU0VSX0NPTVBMQUlOVF9J" + - "TkFQUFJPUFJJQVRFX05BTUUQAxIaChZVU0VSX0NPTVBMQUlOVF9IQUNLSU5H" + - "EAQSFgoSVVNFUl9DT01QTEFJTlRfQU5ZEAUiiQEKDFJlY2VudFBsYXllchIn" + - "CgZwbGF5ZXIYASACKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEhgKEHRp" + - "bWVzdGFtcF9wbGF5ZWQYAiABKAYSNgoKYXR0cmlidXRlcxgDIAMoCzIiLmJu" + - "ZXQucHJvdG9jb2wuYXR0cmlidXRlLkF0dHJpYnV0ZSIyCh1TdWJzY3JpYmVU" + - "b1VzZXJNYW5hZ2VyUmVxdWVzdBIRCglvYmplY3RfaWQYASACKAQikgEKHlN1" + - "YnNjcmliZVRvVXNlck1hbmFnZXJSZXNwb25zZRIuCg1ibG9ja2VkX3VzZXJz" + - "GAEgAygLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBJACg5yZWNlbnRfcGxh" + - "eWVycxgCIAMoCzIoLmJuZXQucHJvdG9jb2wudXNlcl9tYW5hZ2VyLlJlY2Vu" + - "dFBsYXllciJ7ChNSZXBvcnRQbGF5ZXJSZXF1ZXN0EioKCXRhcmdldF9pZBgB" + - "IAIoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSOAoGcmVwb3J0GAIgAigL" + - "MiguYm5ldC5wcm90b2NvbC51c2VyX21hbmFnZXIuUGxheWVyUmVwb3J0IkYK" + - "FFJlcG9ydFBsYXllclJlc3BvbnNlEi4KDXJlcG9ydGVkX3VzZXIYASABKAsy" + - "Fy5ibmV0LnByb3RvY29sLkVudGl0eUlkIkUKF0NoZWNrUGxheWVyQmxvY2tS" + - "ZXF1ZXN0EioKCXRhcmdldF9pZBgBIAIoCzIXLmJuZXQucHJvdG9jb2wuRW50" + - "aXR5SWQiSQoYQ2hlY2tQbGF5ZXJCbG9ja1Jlc3BvbnNlEi0KDGJsb2NrZWRf" + - "dXNlchgBIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQiQAoSQmxvY2tQ" + - "bGF5ZXJSZXF1ZXN0EioKCXRhcmdldF9pZBgBIAIoCzIXLmJuZXQucHJvdG9j" + - "b2wuRW50aXR5SWQiRAoTQmxvY2tQbGF5ZXJSZXNwb25zZRItCgxibG9ja2Vk" + - "X3VzZXIYASABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkIkYKGFJlbW92" + - "ZVBsYXllckJsb2NrUmVxdWVzdBIqCgl0YXJnZXRfaWQYASACKAsyFy5ibmV0" + - "LnByb3RvY29sLkVudGl0eUlkIkoKGVJlbW92ZVBsYXllckJsb2NrUmVzcG9u" + - "c2USLQoMYmxvY2tlZF91c2VyGAEgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRp" + - "dHlJZCJUChdBZGRSZWNlbnRQbGF5ZXJzUmVxdWVzdBI5CgdwbGF5ZXJzGAEg" + - "AygLMiguYm5ldC5wcm90b2NvbC51c2VyX21hbmFnZXIuUmVjZW50UGxheWVy" + - "Ip4BChhBZGRSZWNlbnRQbGF5ZXJzUmVzcG9uc2USPwoNcGxheWVyc19hZGRl" + - "ZBgBIAMoCzIoLmJuZXQucHJvdG9jb2wudXNlcl9tYW5hZ2VyLlJlY2VudFBs" + - "YXllchJBCg9wbGF5ZXJzX3JlbW92ZWQYAyADKAsyKC5ibmV0LnByb3RvY29s" + - "LnVzZXJfbWFuYWdlci5SZWNlbnRQbGF5ZXIiVwoaUmVtb3ZlUmVjZW50UGxh" + - "eWVyc1JlcXVlc3QSOQoHcGxheWVycxgCIAMoCzIoLmJuZXQucHJvdG9jb2wu" + - "dXNlcl9tYW5hZ2VyLlJlY2VudFBsYXllciJgChtSZW1vdmVSZWNlbnRQbGF5" + - "ZXJzUmVzcG9uc2USQQoPcGxheWVyc19yZW1vdmVkGAEgAygLMiguYm5ldC5w" + - "cm90b2NvbC51c2VyX21hbmFnZXIuUmVjZW50UGxheWVyIkUKGUJsb2NrZWRQ" + - "bGF5ZXJOb3RpZmljYXRpb24SKAoHcGxheWVycxgBIAMoCzIXLmJuZXQucHJv" + - "dG9jb2wuRW50aXR5SWQylAYKElVzZXJNYW5hZ2VyU2VydmljZRKPAQoWU3Vi" + - "c2NyaWJlVG9Vc2VyTWFuYWdlchI5LmJuZXQucHJvdG9jb2wudXNlcl9tYW5h" + - "Z2VyLlN1YnNjcmliZVRvVXNlck1hbmFnZXJSZXF1ZXN0GjouYm5ldC5wcm90" + - "b2NvbC51c2VyX21hbmFnZXIuU3Vic2NyaWJlVG9Vc2VyTWFuYWdlclJlc3Bv" + - "bnNlEnEKDFJlcG9ydFBsYXllchIvLmJuZXQucHJvdG9jb2wudXNlcl9tYW5h" + - "Z2VyLlJlcG9ydFBsYXllclJlcXVlc3QaMC5ibmV0LnByb3RvY29sLnVzZXJf" + - "bWFuYWdlci5SZXBvcnRQbGF5ZXJSZXNwb25zZRJuCgtCbG9ja1BsYXllchIu" + - "LmJuZXQucHJvdG9jb2wudXNlcl9tYW5hZ2VyLkJsb2NrUGxheWVyUmVxdWVz" + - "dBovLmJuZXQucHJvdG9jb2wudXNlcl9tYW5hZ2VyLkJsb2NrUGxheWVyUmVz" + - "cG9uc2USgAEKEVJlbW92ZVBsYXllckJsb2NrEjQuYm5ldC5wcm90b2NvbC51" + - "c2VyX21hbmFnZXIuUmVtb3ZlUGxheWVyQmxvY2tSZXF1ZXN0GjUuYm5ldC5w" + - "cm90b2NvbC51c2VyX21hbmFnZXIuUmVtb3ZlUGxheWVyQmxvY2tSZXNwb25z" + - "ZRJ9ChBBZGRSZWNlbnRQbGF5ZXJzEjMuYm5ldC5wcm90b2NvbC51c2VyX21h" + - "bmFnZXIuQWRkUmVjZW50UGxheWVyc1JlcXVlc3QaNC5ibmV0LnByb3RvY29s" + - "LnVzZXJfbWFuYWdlci5BZGRSZWNlbnRQbGF5ZXJzUmVzcG9uc2UShgEKE1Jl" + - "bW92ZVJlY2VudFBsYXllcnMSNi5ibmV0LnByb3RvY29sLnVzZXJfbWFuYWdl" + - "ci5SZW1vdmVSZWNlbnRQbGF5ZXJzUmVxdWVzdBo3LmJuZXQucHJvdG9jb2wu" + - "dXNlcl9tYW5hZ2VyLlJlbW92ZVJlY2VudFBsYXllcnNSZXNwb25zZTLsAQoR" + - "VXNlck1hbmFnZXJOb3RpZnkSaAoTTm90aWZ5UGxheWVyQmxvY2tlZBI1LmJu" + - "ZXQucHJvdG9jb2wudXNlcl9tYW5hZ2VyLkJsb2NrZWRQbGF5ZXJOb3RpZmlj" + - "YXRpb24aGi5ibmV0LnByb3RvY29sLk5PX1JFU1BPTlNFEm0KGE5vdGlmeVBs" + - "YXllckJsb2NrUmVtb3ZlZBI1LmJuZXQucHJvdG9jb2wudXNlcl9tYW5hZ2Vy" + - "LkJsb2NrZWRQbGF5ZXJOb3RpZmljYXRpb24aGi5ibmV0LnByb3RvY29sLk5P" + - "X1JFU1BPTlNFQgOAAQE="); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_bnet_protocol_user_manager_PlayerReport__Descriptor = Descriptor.MessageTypes[0]; - internal__static_bnet_protocol_user_manager_PlayerReport__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_PlayerReport__Descriptor, - new string[] { "ComplaintCode", "ComplaintNote", }); - internal__static_bnet_protocol_user_manager_RecentPlayer__Descriptor = Descriptor.MessageTypes[1]; - internal__static_bnet_protocol_user_manager_RecentPlayer__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_RecentPlayer__Descriptor, - new string[] { "Player", "TimestampPlayed", "Attributes", }); - internal__static_bnet_protocol_user_manager_SubscribeToUserManagerRequest__Descriptor = Descriptor.MessageTypes[2]; - internal__static_bnet_protocol_user_manager_SubscribeToUserManagerRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_SubscribeToUserManagerRequest__Descriptor, - new string[] { "ObjectId", }); - internal__static_bnet_protocol_user_manager_SubscribeToUserManagerResponse__Descriptor = Descriptor.MessageTypes[3]; - internal__static_bnet_protocol_user_manager_SubscribeToUserManagerResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_SubscribeToUserManagerResponse__Descriptor, - new string[] { "BlockedUsers", "RecentPlayers", }); - internal__static_bnet_protocol_user_manager_ReportPlayerRequest__Descriptor = Descriptor.MessageTypes[4]; - internal__static_bnet_protocol_user_manager_ReportPlayerRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_ReportPlayerRequest__Descriptor, - new string[] { "TargetId", "Report", }); - internal__static_bnet_protocol_user_manager_ReportPlayerResponse__Descriptor = Descriptor.MessageTypes[5]; - internal__static_bnet_protocol_user_manager_ReportPlayerResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_ReportPlayerResponse__Descriptor, - new string[] { "ReportedUser", }); - internal__static_bnet_protocol_user_manager_CheckPlayerBlockRequest__Descriptor = Descriptor.MessageTypes[6]; - internal__static_bnet_protocol_user_manager_CheckPlayerBlockRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_CheckPlayerBlockRequest__Descriptor, - new string[] { "TargetId", }); - internal__static_bnet_protocol_user_manager_CheckPlayerBlockResponse__Descriptor = Descriptor.MessageTypes[7]; - internal__static_bnet_protocol_user_manager_CheckPlayerBlockResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_CheckPlayerBlockResponse__Descriptor, - new string[] { "BlockedUser", }); - internal__static_bnet_protocol_user_manager_BlockPlayerRequest__Descriptor = Descriptor.MessageTypes[8]; - internal__static_bnet_protocol_user_manager_BlockPlayerRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_BlockPlayerRequest__Descriptor, - new string[] { "TargetId", }); - internal__static_bnet_protocol_user_manager_BlockPlayerResponse__Descriptor = Descriptor.MessageTypes[9]; - internal__static_bnet_protocol_user_manager_BlockPlayerResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_BlockPlayerResponse__Descriptor, - new string[] { "BlockedUser", }); - internal__static_bnet_protocol_user_manager_RemovePlayerBlockRequest__Descriptor = Descriptor.MessageTypes[10]; - internal__static_bnet_protocol_user_manager_RemovePlayerBlockRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_RemovePlayerBlockRequest__Descriptor, - new string[] { "TargetId", }); - internal__static_bnet_protocol_user_manager_RemovePlayerBlockResponse__Descriptor = Descriptor.MessageTypes[11]; - internal__static_bnet_protocol_user_manager_RemovePlayerBlockResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_RemovePlayerBlockResponse__Descriptor, - new string[] { "BlockedUser", }); - internal__static_bnet_protocol_user_manager_AddRecentPlayersRequest__Descriptor = Descriptor.MessageTypes[12]; - internal__static_bnet_protocol_user_manager_AddRecentPlayersRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_AddRecentPlayersRequest__Descriptor, - new string[] { "Players", }); - internal__static_bnet_protocol_user_manager_AddRecentPlayersResponse__Descriptor = Descriptor.MessageTypes[13]; - internal__static_bnet_protocol_user_manager_AddRecentPlayersResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_AddRecentPlayersResponse__Descriptor, - new string[] { "PlayersAdded", "PlayersRemoved", }); - internal__static_bnet_protocol_user_manager_RemoveRecentPlayersRequest__Descriptor = Descriptor.MessageTypes[14]; - internal__static_bnet_protocol_user_manager_RemoveRecentPlayersRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_RemoveRecentPlayersRequest__Descriptor, - new string[] { "Players", }); - internal__static_bnet_protocol_user_manager_RemoveRecentPlayersResponse__Descriptor = Descriptor.MessageTypes[15]; - internal__static_bnet_protocol_user_manager_RemoveRecentPlayersResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_RemoveRecentPlayersResponse__Descriptor, - new string[] { "PlayersRemoved", }); - internal__static_bnet_protocol_user_manager_BlockedPlayerNotification__Descriptor = Descriptor.MessageTypes[16]; - internal__static_bnet_protocol_user_manager_BlockedPlayerNotification__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_BlockedPlayerNotification__Descriptor, - new string[] { "Players", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::bnet.protocol.attribute.Proto.Attribute.Descriptor, - global::bnet.protocol.Entity.Descriptor, - global::bnet.protocol.Rpc.Descriptor, - }, assigner); - } - #endregion - - } - #region Messages - public sealed partial class PlayerReport : pb::GeneratedMessage { - private static readonly PlayerReport defaultInstance = new Builder().BuildPartial(); - public static PlayerReport DefaultInstance { - get { return defaultInstance; } - } - - public override PlayerReport DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override PlayerReport ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_PlayerReport__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_PlayerReport__FieldAccessorTable; } - } - - #region Nested types - public static class Types { - public enum UserComplaintCode { - USER_COMPLAINT_SPAM = 0, - USER_COMPLAINT_HARASSMENT = 1, - USER_COMPLAINT_REAL_LIFE_THREAT = 2, - USER_COMPLAINT_INAPPROPRIATE_NAME = 3, - USER_COMPLAINT_HACKING = 4, - USER_COMPLAINT_ANY = 5, - } - - } - #endregion - - public const int ComplaintCodeFieldNumber = 1; - private bool hasComplaintCode; - private global::bnet.protocol.user_manager.PlayerReport.Types.UserComplaintCode complaintCode_ = global::bnet.protocol.user_manager.PlayerReport.Types.UserComplaintCode.USER_COMPLAINT_SPAM; - public bool HasComplaintCode { - get { return hasComplaintCode; } - } - public global::bnet.protocol.user_manager.PlayerReport.Types.UserComplaintCode ComplaintCode { - get { return complaintCode_; } - } - - public const int ComplaintNoteFieldNumber = 2; - private bool hasComplaintNote; - private string complaintNote_ = ""; - public bool HasComplaintNote { - get { return hasComplaintNote; } - } - public string ComplaintNote { - get { return complaintNote_; } - } - - public override bool IsInitialized { - get { - if (!hasComplaintCode) return false; - if (!hasComplaintNote) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasComplaintCode) { - output.WriteEnum(1, (int) ComplaintCode); - } - if (HasComplaintNote) { - output.WriteString(2, ComplaintNote); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasComplaintCode) { - size += pb::CodedOutputStream.ComputeEnumSize(1, (int) ComplaintCode); - } - if (HasComplaintNote) { - size += pb::CodedOutputStream.ComputeStringSize(2, ComplaintNote); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static PlayerReport ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PlayerReport ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PlayerReport ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PlayerReport ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PlayerReport ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PlayerReport ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static PlayerReport ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static PlayerReport ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static PlayerReport ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PlayerReport ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(PlayerReport prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - PlayerReport result = new PlayerReport(); - - protected override PlayerReport MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new PlayerReport(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.user_manager.PlayerReport.Descriptor; } - } - - public override PlayerReport DefaultInstanceForType { - get { return global::bnet.protocol.user_manager.PlayerReport.DefaultInstance; } - } - - public override PlayerReport BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - PlayerReport returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is PlayerReport) { - return MergeFrom((PlayerReport) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(PlayerReport other) { - if (other == global::bnet.protocol.user_manager.PlayerReport.DefaultInstance) return this; - if (other.HasComplaintCode) { - ComplaintCode = other.ComplaintCode; - } - if (other.HasComplaintNote) { - ComplaintNote = other.ComplaintNote; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - int rawValue = input.ReadEnum(); - if (!global::System.Enum.IsDefined(typeof(global::bnet.protocol.user_manager.PlayerReport.Types.UserComplaintCode), rawValue)) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(1, (ulong) rawValue); - } else { - ComplaintCode = (global::bnet.protocol.user_manager.PlayerReport.Types.UserComplaintCode) rawValue; - } - break; - } - case 18: { - ComplaintNote = input.ReadString(); - break; - } - } - } - } - - - public bool HasComplaintCode { - get { return result.HasComplaintCode; } - } - public global::bnet.protocol.user_manager.PlayerReport.Types.UserComplaintCode ComplaintCode { - get { return result.ComplaintCode; } - set { SetComplaintCode(value); } - } - public Builder SetComplaintCode(global::bnet.protocol.user_manager.PlayerReport.Types.UserComplaintCode value) { - result.hasComplaintCode = true; - result.complaintCode_ = value; - return this; - } - public Builder ClearComplaintCode() { - result.hasComplaintCode = false; - result.complaintCode_ = global::bnet.protocol.user_manager.PlayerReport.Types.UserComplaintCode.USER_COMPLAINT_SPAM; - return this; - } - - public bool HasComplaintNote { - get { return result.HasComplaintNote; } - } - public string ComplaintNote { - get { return result.ComplaintNote; } - set { SetComplaintNote(value); } - } - public Builder SetComplaintNote(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasComplaintNote = true; - result.complaintNote_ = value; - return this; - } - public Builder ClearComplaintNote() { - result.hasComplaintNote = false; - result.complaintNote_ = ""; - return this; - } - } - static PlayerReport() { - object.ReferenceEquals(global::bnet.protocol.user_manager.UserManager.Descriptor, null); - } - } - - public sealed partial class RecentPlayer : pb::GeneratedMessage { - private static readonly RecentPlayer defaultInstance = new Builder().BuildPartial(); - public static RecentPlayer DefaultInstance { - get { return defaultInstance; } - } - - public override RecentPlayer DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override RecentPlayer ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_RecentPlayer__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_RecentPlayer__FieldAccessorTable; } - } - - public const int PlayerFieldNumber = 1; - private bool hasPlayer; - private global::bnet.protocol.EntityId player_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasPlayer { - get { return hasPlayer; } - } - public global::bnet.protocol.EntityId Player { - get { return player_; } - } - - public const int TimestampPlayedFieldNumber = 2; - private bool hasTimestampPlayed; - private ulong timestampPlayed_ = 0; - public bool HasTimestampPlayed { - get { return hasTimestampPlayed; } - } - public ulong TimestampPlayed { - get { return timestampPlayed_; } - } - - public const int AttributesFieldNumber = 3; - private pbc::PopsicleList attributes_ = new pbc::PopsicleList(); - public scg::IList AttributesList { - get { return attributes_; } - } - public int AttributesCount { - get { return attributes_.Count; } - } - public global::bnet.protocol.attribute.Attribute GetAttributes(int index) { - return attributes_[index]; - } - - public override bool IsInitialized { - get { - if (!hasPlayer) return false; - if (!Player.IsInitialized) return false; - foreach (global::bnet.protocol.attribute.Attribute element in AttributesList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasPlayer) { - output.WriteMessage(1, Player); - } - if (HasTimestampPlayed) { - output.WriteFixed64(2, TimestampPlayed); - } - foreach (global::bnet.protocol.attribute.Attribute element in AttributesList) { - output.WriteMessage(3, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasPlayer) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Player); - } - if (HasTimestampPlayed) { - size += pb::CodedOutputStream.ComputeFixed64Size(2, TimestampPlayed); - } - foreach (global::bnet.protocol.attribute.Attribute element in AttributesList) { - size += pb::CodedOutputStream.ComputeMessageSize(3, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static RecentPlayer ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RecentPlayer ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RecentPlayer ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RecentPlayer ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RecentPlayer ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RecentPlayer ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static RecentPlayer ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static RecentPlayer ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static RecentPlayer ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RecentPlayer ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(RecentPlayer prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - RecentPlayer result = new RecentPlayer(); - - protected override RecentPlayer MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new RecentPlayer(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.user_manager.RecentPlayer.Descriptor; } - } - - public override RecentPlayer DefaultInstanceForType { - get { return global::bnet.protocol.user_manager.RecentPlayer.DefaultInstance; } - } - - public override RecentPlayer BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.attributes_.MakeReadOnly(); - RecentPlayer returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is RecentPlayer) { - return MergeFrom((RecentPlayer) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(RecentPlayer other) { - if (other == global::bnet.protocol.user_manager.RecentPlayer.DefaultInstance) return this; - if (other.HasPlayer) { - MergePlayer(other.Player); - } - if (other.HasTimestampPlayed) { - TimestampPlayed = other.TimestampPlayed; - } - if (other.attributes_.Count != 0) { - base.AddRange(other.attributes_, result.attributes_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasPlayer) { - subBuilder.MergeFrom(Player); - } - input.ReadMessage(subBuilder, extensionRegistry); - Player = subBuilder.BuildPartial(); - break; - } - case 17: { - TimestampPlayed = input.ReadFixed64(); - break; - } - case 26: { - global::bnet.protocol.attribute.Attribute.Builder subBuilder = global::bnet.protocol.attribute.Attribute.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddAttributes(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public bool HasPlayer { - get { return result.HasPlayer; } - } - public global::bnet.protocol.EntityId Player { - get { return result.Player; } - set { SetPlayer(value); } - } - public Builder SetPlayer(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasPlayer = true; - result.player_ = value; - return this; - } - public Builder SetPlayer(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasPlayer = true; - result.player_ = builderForValue.Build(); - return this; - } - public Builder MergePlayer(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasPlayer && - result.player_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.player_ = global::bnet.protocol.EntityId.CreateBuilder(result.player_).MergeFrom(value).BuildPartial(); - } else { - result.player_ = value; - } - result.hasPlayer = true; - return this; - } - public Builder ClearPlayer() { - result.hasPlayer = false; - result.player_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasTimestampPlayed { - get { return result.HasTimestampPlayed; } - } - public ulong TimestampPlayed { - get { return result.TimestampPlayed; } - set { SetTimestampPlayed(value); } - } - public Builder SetTimestampPlayed(ulong value) { - result.hasTimestampPlayed = true; - result.timestampPlayed_ = value; - return this; - } - public Builder ClearTimestampPlayed() { - result.hasTimestampPlayed = false; - result.timestampPlayed_ = 0; - return this; - } - - public pbc::IPopsicleList AttributesList { - get { return result.attributes_; } - } - public int AttributesCount { - get { return result.AttributesCount; } - } - public global::bnet.protocol.attribute.Attribute GetAttributes(int index) { - return result.GetAttributes(index); - } - public Builder SetAttributes(int index, global::bnet.protocol.attribute.Attribute value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.attributes_[index] = value; - return this; - } - public Builder SetAttributes(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.attributes_[index] = builderForValue.Build(); - return this; - } - public Builder AddAttributes(global::bnet.protocol.attribute.Attribute value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.attributes_.Add(value); - return this; - } - public Builder AddAttributes(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.attributes_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeAttributes(scg::IEnumerable values) { - base.AddRange(values, result.attributes_); - return this; - } - public Builder ClearAttributes() { - result.attributes_.Clear(); - return this; - } - } - static RecentPlayer() { - object.ReferenceEquals(global::bnet.protocol.user_manager.UserManager.Descriptor, null); - } - } - - public sealed partial class SubscribeToUserManagerRequest : pb::GeneratedMessage { - private static readonly SubscribeToUserManagerRequest defaultInstance = new Builder().BuildPartial(); - public static SubscribeToUserManagerRequest DefaultInstance { - get { return defaultInstance; } - } - - public override SubscribeToUserManagerRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override SubscribeToUserManagerRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_SubscribeToUserManagerRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_SubscribeToUserManagerRequest__FieldAccessorTable; } - } - - public const int ObjectIdFieldNumber = 1; - private bool hasObjectId; - private ulong objectId_ = 0UL; - public bool HasObjectId { - get { return hasObjectId; } - } - public ulong ObjectId { - get { return objectId_; } - } - - public override bool IsInitialized { - get { - if (!hasObjectId) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasObjectId) { - output.WriteUInt64(1, ObjectId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasObjectId) { - size += pb::CodedOutputStream.ComputeUInt64Size(1, ObjectId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static SubscribeToUserManagerRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SubscribeToUserManagerRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SubscribeToUserManagerRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SubscribeToUserManagerRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SubscribeToUserManagerRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SubscribeToUserManagerRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SubscribeToUserManagerRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SubscribeToUserManagerRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SubscribeToUserManagerRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SubscribeToUserManagerRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SubscribeToUserManagerRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - SubscribeToUserManagerRequest result = new SubscribeToUserManagerRequest(); - - protected override SubscribeToUserManagerRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new SubscribeToUserManagerRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.user_manager.SubscribeToUserManagerRequest.Descriptor; } - } - - public override SubscribeToUserManagerRequest DefaultInstanceForType { - get { return global::bnet.protocol.user_manager.SubscribeToUserManagerRequest.DefaultInstance; } - } - - public override SubscribeToUserManagerRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - SubscribeToUserManagerRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SubscribeToUserManagerRequest) { - return MergeFrom((SubscribeToUserManagerRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SubscribeToUserManagerRequest other) { - if (other == global::bnet.protocol.user_manager.SubscribeToUserManagerRequest.DefaultInstance) return this; - if (other.HasObjectId) { - ObjectId = other.ObjectId; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - ObjectId = input.ReadUInt64(); - break; - } - } - } - } - - - public bool HasObjectId { - get { return result.HasObjectId; } - } - public ulong ObjectId { - get { return result.ObjectId; } - set { SetObjectId(value); } - } - public Builder SetObjectId(ulong value) { - result.hasObjectId = true; - result.objectId_ = value; - return this; - } - public Builder ClearObjectId() { - result.hasObjectId = false; - result.objectId_ = 0UL; - return this; - } - } - static SubscribeToUserManagerRequest() { - object.ReferenceEquals(global::bnet.protocol.user_manager.UserManager.Descriptor, null); - } - } - - public sealed partial class SubscribeToUserManagerResponse : pb::GeneratedMessage { - private static readonly SubscribeToUserManagerResponse defaultInstance = new Builder().BuildPartial(); - public static SubscribeToUserManagerResponse DefaultInstance { - get { return defaultInstance; } - } - - public override SubscribeToUserManagerResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override SubscribeToUserManagerResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_SubscribeToUserManagerResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_SubscribeToUserManagerResponse__FieldAccessorTable; } - } - - public const int BlockedUsersFieldNumber = 1; - private pbc::PopsicleList blockedUsers_ = new pbc::PopsicleList(); - public scg::IList BlockedUsersList { - get { return blockedUsers_; } - } - public int BlockedUsersCount { - get { return blockedUsers_.Count; } - } - public global::bnet.protocol.EntityId GetBlockedUsers(int index) { - return blockedUsers_[index]; - } - - public const int RecentPlayersFieldNumber = 2; - private pbc::PopsicleList recentPlayers_ = new pbc::PopsicleList(); - public scg::IList RecentPlayersList { - get { return recentPlayers_; } - } - public int RecentPlayersCount { - get { return recentPlayers_.Count; } - } - public global::bnet.protocol.user_manager.RecentPlayer GetRecentPlayers(int index) { - return recentPlayers_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::bnet.protocol.EntityId element in BlockedUsersList) { - if (!element.IsInitialized) return false; - } - foreach (global::bnet.protocol.user_manager.RecentPlayer element in RecentPlayersList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::bnet.protocol.EntityId element in BlockedUsersList) { - output.WriteMessage(1, element); - } - foreach (global::bnet.protocol.user_manager.RecentPlayer element in RecentPlayersList) { - output.WriteMessage(2, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::bnet.protocol.EntityId element in BlockedUsersList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - foreach (global::bnet.protocol.user_manager.RecentPlayer element in RecentPlayersList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static SubscribeToUserManagerResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SubscribeToUserManagerResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SubscribeToUserManagerResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SubscribeToUserManagerResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SubscribeToUserManagerResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SubscribeToUserManagerResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SubscribeToUserManagerResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SubscribeToUserManagerResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SubscribeToUserManagerResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SubscribeToUserManagerResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SubscribeToUserManagerResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - SubscribeToUserManagerResponse result = new SubscribeToUserManagerResponse(); - - protected override SubscribeToUserManagerResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new SubscribeToUserManagerResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.user_manager.SubscribeToUserManagerResponse.Descriptor; } - } - - public override SubscribeToUserManagerResponse DefaultInstanceForType { - get { return global::bnet.protocol.user_manager.SubscribeToUserManagerResponse.DefaultInstance; } - } - - public override SubscribeToUserManagerResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.blockedUsers_.MakeReadOnly(); - result.recentPlayers_.MakeReadOnly(); - SubscribeToUserManagerResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SubscribeToUserManagerResponse) { - return MergeFrom((SubscribeToUserManagerResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SubscribeToUserManagerResponse other) { - if (other == global::bnet.protocol.user_manager.SubscribeToUserManagerResponse.DefaultInstance) return this; - if (other.blockedUsers_.Count != 0) { - base.AddRange(other.blockedUsers_, result.blockedUsers_); - } - if (other.recentPlayers_.Count != 0) { - base.AddRange(other.recentPlayers_, result.recentPlayers_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddBlockedUsers(subBuilder.BuildPartial()); - break; - } - case 18: { - global::bnet.protocol.user_manager.RecentPlayer.Builder subBuilder = global::bnet.protocol.user_manager.RecentPlayer.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddRecentPlayers(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public pbc::IPopsicleList BlockedUsersList { - get { return result.blockedUsers_; } - } - public int BlockedUsersCount { - get { return result.BlockedUsersCount; } - } - public global::bnet.protocol.EntityId GetBlockedUsers(int index) { - return result.GetBlockedUsers(index); - } - public Builder SetBlockedUsers(int index, global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.blockedUsers_[index] = value; - return this; - } - public Builder SetBlockedUsers(int index, global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.blockedUsers_[index] = builderForValue.Build(); - return this; - } - public Builder AddBlockedUsers(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.blockedUsers_.Add(value); - return this; - } - public Builder AddBlockedUsers(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.blockedUsers_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeBlockedUsers(scg::IEnumerable values) { - base.AddRange(values, result.blockedUsers_); - return this; - } - public Builder ClearBlockedUsers() { - result.blockedUsers_.Clear(); - return this; - } - - public pbc::IPopsicleList RecentPlayersList { - get { return result.recentPlayers_; } - } - public int RecentPlayersCount { - get { return result.RecentPlayersCount; } - } - public global::bnet.protocol.user_manager.RecentPlayer GetRecentPlayers(int index) { - return result.GetRecentPlayers(index); - } - public Builder SetRecentPlayers(int index, global::bnet.protocol.user_manager.RecentPlayer value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.recentPlayers_[index] = value; - return this; - } - public Builder SetRecentPlayers(int index, global::bnet.protocol.user_manager.RecentPlayer.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.recentPlayers_[index] = builderForValue.Build(); - return this; - } - public Builder AddRecentPlayers(global::bnet.protocol.user_manager.RecentPlayer value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.recentPlayers_.Add(value); - return this; - } - public Builder AddRecentPlayers(global::bnet.protocol.user_manager.RecentPlayer.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.recentPlayers_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeRecentPlayers(scg::IEnumerable values) { - base.AddRange(values, result.recentPlayers_); - return this; - } - public Builder ClearRecentPlayers() { - result.recentPlayers_.Clear(); - return this; - } - } - static SubscribeToUserManagerResponse() { - object.ReferenceEquals(global::bnet.protocol.user_manager.UserManager.Descriptor, null); - } - } - - public sealed partial class ReportPlayerRequest : pb::GeneratedMessage { - private static readonly ReportPlayerRequest defaultInstance = new Builder().BuildPartial(); - public static ReportPlayerRequest DefaultInstance { - get { return defaultInstance; } - } - - public override ReportPlayerRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ReportPlayerRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_ReportPlayerRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_ReportPlayerRequest__FieldAccessorTable; } - } - - public const int TargetIdFieldNumber = 1; - private bool hasTargetId; - private global::bnet.protocol.EntityId targetId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasTargetId { - get { return hasTargetId; } - } - public global::bnet.protocol.EntityId TargetId { - get { return targetId_; } - } - - public const int ReportFieldNumber = 2; - private bool hasReport; - private global::bnet.protocol.user_manager.PlayerReport report_ = global::bnet.protocol.user_manager.PlayerReport.DefaultInstance; - public bool HasReport { - get { return hasReport; } - } - public global::bnet.protocol.user_manager.PlayerReport Report { - get { return report_; } - } - - public override bool IsInitialized { - get { - if (!hasTargetId) return false; - if (!hasReport) return false; - if (!TargetId.IsInitialized) return false; - if (!Report.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasTargetId) { - output.WriteMessage(1, TargetId); - } - if (HasReport) { - output.WriteMessage(2, Report); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasTargetId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, TargetId); - } - if (HasReport) { - size += pb::CodedOutputStream.ComputeMessageSize(2, Report); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ReportPlayerRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ReportPlayerRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ReportPlayerRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ReportPlayerRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ReportPlayerRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ReportPlayerRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ReportPlayerRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ReportPlayerRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ReportPlayerRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ReportPlayerRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ReportPlayerRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ReportPlayerRequest result = new ReportPlayerRequest(); - - protected override ReportPlayerRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ReportPlayerRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.user_manager.ReportPlayerRequest.Descriptor; } - } - - public override ReportPlayerRequest DefaultInstanceForType { - get { return global::bnet.protocol.user_manager.ReportPlayerRequest.DefaultInstance; } - } - - public override ReportPlayerRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - ReportPlayerRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ReportPlayerRequest) { - return MergeFrom((ReportPlayerRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ReportPlayerRequest other) { - if (other == global::bnet.protocol.user_manager.ReportPlayerRequest.DefaultInstance) return this; - if (other.HasTargetId) { - MergeTargetId(other.TargetId); - } - if (other.HasReport) { - MergeReport(other.Report); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasTargetId) { - subBuilder.MergeFrom(TargetId); - } - input.ReadMessage(subBuilder, extensionRegistry); - TargetId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::bnet.protocol.user_manager.PlayerReport.Builder subBuilder = global::bnet.protocol.user_manager.PlayerReport.CreateBuilder(); - if (HasReport) { - subBuilder.MergeFrom(Report); - } - input.ReadMessage(subBuilder, extensionRegistry); - Report = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasTargetId { - get { return result.HasTargetId; } - } - public global::bnet.protocol.EntityId TargetId { - get { return result.TargetId; } - set { SetTargetId(value); } - } - public Builder SetTargetId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasTargetId = true; - result.targetId_ = value; - return this; - } - public Builder SetTargetId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasTargetId = true; - result.targetId_ = builderForValue.Build(); - return this; - } - public Builder MergeTargetId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasTargetId && - result.targetId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.targetId_ = global::bnet.protocol.EntityId.CreateBuilder(result.targetId_).MergeFrom(value).BuildPartial(); - } else { - result.targetId_ = value; - } - result.hasTargetId = true; - return this; - } - public Builder ClearTargetId() { - result.hasTargetId = false; - result.targetId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasReport { - get { return result.HasReport; } - } - public global::bnet.protocol.user_manager.PlayerReport Report { - get { return result.Report; } - set { SetReport(value); } - } - public Builder SetReport(global::bnet.protocol.user_manager.PlayerReport value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasReport = true; - result.report_ = value; - return this; - } - public Builder SetReport(global::bnet.protocol.user_manager.PlayerReport.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasReport = true; - result.report_ = builderForValue.Build(); - return this; - } - public Builder MergeReport(global::bnet.protocol.user_manager.PlayerReport value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasReport && - result.report_ != global::bnet.protocol.user_manager.PlayerReport.DefaultInstance) { - result.report_ = global::bnet.protocol.user_manager.PlayerReport.CreateBuilder(result.report_).MergeFrom(value).BuildPartial(); - } else { - result.report_ = value; - } - result.hasReport = true; - return this; - } - public Builder ClearReport() { - result.hasReport = false; - result.report_ = global::bnet.protocol.user_manager.PlayerReport.DefaultInstance; - return this; - } - } - static ReportPlayerRequest() { - object.ReferenceEquals(global::bnet.protocol.user_manager.UserManager.Descriptor, null); - } - } - - public sealed partial class ReportPlayerResponse : pb::GeneratedMessage { - private static readonly ReportPlayerResponse defaultInstance = new Builder().BuildPartial(); - public static ReportPlayerResponse DefaultInstance { - get { return defaultInstance; } - } - - public override ReportPlayerResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ReportPlayerResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_ReportPlayerResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_ReportPlayerResponse__FieldAccessorTable; } - } - - public const int ReportedUserFieldNumber = 1; - private bool hasReportedUser; - private global::bnet.protocol.EntityId reportedUser_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasReportedUser { - get { return hasReportedUser; } - } - public global::bnet.protocol.EntityId ReportedUser { - get { return reportedUser_; } - } - - public override bool IsInitialized { - get { - if (HasReportedUser) { - if (!ReportedUser.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasReportedUser) { - output.WriteMessage(1, ReportedUser); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasReportedUser) { - size += pb::CodedOutputStream.ComputeMessageSize(1, ReportedUser); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ReportPlayerResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ReportPlayerResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ReportPlayerResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ReportPlayerResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ReportPlayerResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ReportPlayerResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ReportPlayerResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ReportPlayerResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ReportPlayerResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ReportPlayerResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ReportPlayerResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ReportPlayerResponse result = new ReportPlayerResponse(); - - protected override ReportPlayerResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ReportPlayerResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.user_manager.ReportPlayerResponse.Descriptor; } - } - - public override ReportPlayerResponse DefaultInstanceForType { - get { return global::bnet.protocol.user_manager.ReportPlayerResponse.DefaultInstance; } - } - - public override ReportPlayerResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - ReportPlayerResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ReportPlayerResponse) { - return MergeFrom((ReportPlayerResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ReportPlayerResponse other) { - if (other == global::bnet.protocol.user_manager.ReportPlayerResponse.DefaultInstance) return this; - if (other.HasReportedUser) { - MergeReportedUser(other.ReportedUser); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasReportedUser) { - subBuilder.MergeFrom(ReportedUser); - } - input.ReadMessage(subBuilder, extensionRegistry); - ReportedUser = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasReportedUser { - get { return result.HasReportedUser; } - } - public global::bnet.protocol.EntityId ReportedUser { - get { return result.ReportedUser; } - set { SetReportedUser(value); } - } - public Builder SetReportedUser(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasReportedUser = true; - result.reportedUser_ = value; - return this; - } - public Builder SetReportedUser(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasReportedUser = true; - result.reportedUser_ = builderForValue.Build(); - return this; - } - public Builder MergeReportedUser(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasReportedUser && - result.reportedUser_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.reportedUser_ = global::bnet.protocol.EntityId.CreateBuilder(result.reportedUser_).MergeFrom(value).BuildPartial(); - } else { - result.reportedUser_ = value; - } - result.hasReportedUser = true; - return this; - } - public Builder ClearReportedUser() { - result.hasReportedUser = false; - result.reportedUser_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - } - static ReportPlayerResponse() { - object.ReferenceEquals(global::bnet.protocol.user_manager.UserManager.Descriptor, null); - } - } - - public sealed partial class CheckPlayerBlockRequest : pb::GeneratedMessage { - private static readonly CheckPlayerBlockRequest defaultInstance = new Builder().BuildPartial(); - public static CheckPlayerBlockRequest DefaultInstance { - get { return defaultInstance; } - } - - public override CheckPlayerBlockRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override CheckPlayerBlockRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_CheckPlayerBlockRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_CheckPlayerBlockRequest__FieldAccessorTable; } - } - - public const int TargetIdFieldNumber = 1; - private bool hasTargetId; - private global::bnet.protocol.EntityId targetId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasTargetId { - get { return hasTargetId; } - } - public global::bnet.protocol.EntityId TargetId { - get { return targetId_; } - } - - public override bool IsInitialized { - get { - if (!hasTargetId) return false; - if (!TargetId.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasTargetId) { - output.WriteMessage(1, TargetId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasTargetId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, TargetId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static CheckPlayerBlockRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CheckPlayerBlockRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CheckPlayerBlockRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CheckPlayerBlockRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CheckPlayerBlockRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CheckPlayerBlockRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CheckPlayerBlockRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CheckPlayerBlockRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CheckPlayerBlockRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CheckPlayerBlockRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CheckPlayerBlockRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - CheckPlayerBlockRequest result = new CheckPlayerBlockRequest(); - - protected override CheckPlayerBlockRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new CheckPlayerBlockRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.user_manager.CheckPlayerBlockRequest.Descriptor; } - } - - public override CheckPlayerBlockRequest DefaultInstanceForType { - get { return global::bnet.protocol.user_manager.CheckPlayerBlockRequest.DefaultInstance; } - } - - public override CheckPlayerBlockRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - CheckPlayerBlockRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CheckPlayerBlockRequest) { - return MergeFrom((CheckPlayerBlockRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CheckPlayerBlockRequest other) { - if (other == global::bnet.protocol.user_manager.CheckPlayerBlockRequest.DefaultInstance) return this; - if (other.HasTargetId) { - MergeTargetId(other.TargetId); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasTargetId) { - subBuilder.MergeFrom(TargetId); - } - input.ReadMessage(subBuilder, extensionRegistry); - TargetId = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasTargetId { - get { return result.HasTargetId; } - } - public global::bnet.protocol.EntityId TargetId { - get { return result.TargetId; } - set { SetTargetId(value); } - } - public Builder SetTargetId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasTargetId = true; - result.targetId_ = value; - return this; - } - public Builder SetTargetId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasTargetId = true; - result.targetId_ = builderForValue.Build(); - return this; - } - public Builder MergeTargetId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasTargetId && - result.targetId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.targetId_ = global::bnet.protocol.EntityId.CreateBuilder(result.targetId_).MergeFrom(value).BuildPartial(); - } else { - result.targetId_ = value; - } - result.hasTargetId = true; - return this; - } - public Builder ClearTargetId() { - result.hasTargetId = false; - result.targetId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - } - static CheckPlayerBlockRequest() { - object.ReferenceEquals(global::bnet.protocol.user_manager.UserManager.Descriptor, null); - } - } - - public sealed partial class CheckPlayerBlockResponse : pb::GeneratedMessage { - private static readonly CheckPlayerBlockResponse defaultInstance = new Builder().BuildPartial(); - public static CheckPlayerBlockResponse DefaultInstance { - get { return defaultInstance; } - } - - public override CheckPlayerBlockResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override CheckPlayerBlockResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_CheckPlayerBlockResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_CheckPlayerBlockResponse__FieldAccessorTable; } - } - - public const int BlockedUserFieldNumber = 1; - private bool hasBlockedUser; - private global::bnet.protocol.EntityId blockedUser_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasBlockedUser { - get { return hasBlockedUser; } - } - public global::bnet.protocol.EntityId BlockedUser { - get { return blockedUser_; } - } - - public override bool IsInitialized { - get { - if (HasBlockedUser) { - if (!BlockedUser.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasBlockedUser) { - output.WriteMessage(1, BlockedUser); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasBlockedUser) { - size += pb::CodedOutputStream.ComputeMessageSize(1, BlockedUser); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static CheckPlayerBlockResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CheckPlayerBlockResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CheckPlayerBlockResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CheckPlayerBlockResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CheckPlayerBlockResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CheckPlayerBlockResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CheckPlayerBlockResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CheckPlayerBlockResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CheckPlayerBlockResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CheckPlayerBlockResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CheckPlayerBlockResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - CheckPlayerBlockResponse result = new CheckPlayerBlockResponse(); - - protected override CheckPlayerBlockResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new CheckPlayerBlockResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.user_manager.CheckPlayerBlockResponse.Descriptor; } - } - - public override CheckPlayerBlockResponse DefaultInstanceForType { - get { return global::bnet.protocol.user_manager.CheckPlayerBlockResponse.DefaultInstance; } - } - - public override CheckPlayerBlockResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - CheckPlayerBlockResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CheckPlayerBlockResponse) { - return MergeFrom((CheckPlayerBlockResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CheckPlayerBlockResponse other) { - if (other == global::bnet.protocol.user_manager.CheckPlayerBlockResponse.DefaultInstance) return this; - if (other.HasBlockedUser) { - MergeBlockedUser(other.BlockedUser); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasBlockedUser) { - subBuilder.MergeFrom(BlockedUser); - } - input.ReadMessage(subBuilder, extensionRegistry); - BlockedUser = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasBlockedUser { - get { return result.HasBlockedUser; } - } - public global::bnet.protocol.EntityId BlockedUser { - get { return result.BlockedUser; } - set { SetBlockedUser(value); } - } - public Builder SetBlockedUser(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBlockedUser = true; - result.blockedUser_ = value; - return this; - } - public Builder SetBlockedUser(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBlockedUser = true; - result.blockedUser_ = builderForValue.Build(); - return this; - } - public Builder MergeBlockedUser(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasBlockedUser && - result.blockedUser_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.blockedUser_ = global::bnet.protocol.EntityId.CreateBuilder(result.blockedUser_).MergeFrom(value).BuildPartial(); - } else { - result.blockedUser_ = value; - } - result.hasBlockedUser = true; - return this; - } - public Builder ClearBlockedUser() { - result.hasBlockedUser = false; - result.blockedUser_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - } - static CheckPlayerBlockResponse() { - object.ReferenceEquals(global::bnet.protocol.user_manager.UserManager.Descriptor, null); - } - } - - public sealed partial class BlockPlayerRequest : pb::GeneratedMessage { - private static readonly BlockPlayerRequest defaultInstance = new Builder().BuildPartial(); - public static BlockPlayerRequest DefaultInstance { - get { return defaultInstance; } - } - - public override BlockPlayerRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override BlockPlayerRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_BlockPlayerRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_BlockPlayerRequest__FieldAccessorTable; } - } - - public const int TargetIdFieldNumber = 1; - private bool hasTargetId; - private global::bnet.protocol.EntityId targetId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasTargetId { - get { return hasTargetId; } - } - public global::bnet.protocol.EntityId TargetId { - get { return targetId_; } - } - - public override bool IsInitialized { - get { - if (!hasTargetId) return false; - if (!TargetId.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasTargetId) { - output.WriteMessage(1, TargetId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasTargetId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, TargetId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static BlockPlayerRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BlockPlayerRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BlockPlayerRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BlockPlayerRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BlockPlayerRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BlockPlayerRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static BlockPlayerRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static BlockPlayerRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static BlockPlayerRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BlockPlayerRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(BlockPlayerRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - BlockPlayerRequest result = new BlockPlayerRequest(); - - protected override BlockPlayerRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new BlockPlayerRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.user_manager.BlockPlayerRequest.Descriptor; } - } - - public override BlockPlayerRequest DefaultInstanceForType { - get { return global::bnet.protocol.user_manager.BlockPlayerRequest.DefaultInstance; } - } - - public override BlockPlayerRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - BlockPlayerRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is BlockPlayerRequest) { - return MergeFrom((BlockPlayerRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(BlockPlayerRequest other) { - if (other == global::bnet.protocol.user_manager.BlockPlayerRequest.DefaultInstance) return this; - if (other.HasTargetId) { - MergeTargetId(other.TargetId); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasTargetId) { - subBuilder.MergeFrom(TargetId); - } - input.ReadMessage(subBuilder, extensionRegistry); - TargetId = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasTargetId { - get { return result.HasTargetId; } - } - public global::bnet.protocol.EntityId TargetId { - get { return result.TargetId; } - set { SetTargetId(value); } - } - public Builder SetTargetId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasTargetId = true; - result.targetId_ = value; - return this; - } - public Builder SetTargetId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasTargetId = true; - result.targetId_ = builderForValue.Build(); - return this; - } - public Builder MergeTargetId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasTargetId && - result.targetId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.targetId_ = global::bnet.protocol.EntityId.CreateBuilder(result.targetId_).MergeFrom(value).BuildPartial(); - } else { - result.targetId_ = value; - } - result.hasTargetId = true; - return this; - } - public Builder ClearTargetId() { - result.hasTargetId = false; - result.targetId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - } - static BlockPlayerRequest() { - object.ReferenceEquals(global::bnet.protocol.user_manager.UserManager.Descriptor, null); - } - } - - public sealed partial class BlockPlayerResponse : pb::GeneratedMessage { - private static readonly BlockPlayerResponse defaultInstance = new Builder().BuildPartial(); - public static BlockPlayerResponse DefaultInstance { - get { return defaultInstance; } - } - - public override BlockPlayerResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override BlockPlayerResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_BlockPlayerResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_BlockPlayerResponse__FieldAccessorTable; } - } - - public const int BlockedUserFieldNumber = 1; - private bool hasBlockedUser; - private global::bnet.protocol.EntityId blockedUser_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasBlockedUser { - get { return hasBlockedUser; } - } - public global::bnet.protocol.EntityId BlockedUser { - get { return blockedUser_; } - } - - public override bool IsInitialized { - get { - if (HasBlockedUser) { - if (!BlockedUser.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasBlockedUser) { - output.WriteMessage(1, BlockedUser); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasBlockedUser) { - size += pb::CodedOutputStream.ComputeMessageSize(1, BlockedUser); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static BlockPlayerResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BlockPlayerResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BlockPlayerResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BlockPlayerResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BlockPlayerResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BlockPlayerResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static BlockPlayerResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static BlockPlayerResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static BlockPlayerResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BlockPlayerResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(BlockPlayerResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - BlockPlayerResponse result = new BlockPlayerResponse(); - - protected override BlockPlayerResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new BlockPlayerResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.user_manager.BlockPlayerResponse.Descriptor; } - } - - public override BlockPlayerResponse DefaultInstanceForType { - get { return global::bnet.protocol.user_manager.BlockPlayerResponse.DefaultInstance; } - } - - public override BlockPlayerResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - BlockPlayerResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is BlockPlayerResponse) { - return MergeFrom((BlockPlayerResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(BlockPlayerResponse other) { - if (other == global::bnet.protocol.user_manager.BlockPlayerResponse.DefaultInstance) return this; - if (other.HasBlockedUser) { - MergeBlockedUser(other.BlockedUser); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasBlockedUser) { - subBuilder.MergeFrom(BlockedUser); - } - input.ReadMessage(subBuilder, extensionRegistry); - BlockedUser = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasBlockedUser { - get { return result.HasBlockedUser; } - } - public global::bnet.protocol.EntityId BlockedUser { - get { return result.BlockedUser; } - set { SetBlockedUser(value); } - } - public Builder SetBlockedUser(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBlockedUser = true; - result.blockedUser_ = value; - return this; - } - public Builder SetBlockedUser(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBlockedUser = true; - result.blockedUser_ = builderForValue.Build(); - return this; - } - public Builder MergeBlockedUser(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasBlockedUser && - result.blockedUser_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.blockedUser_ = global::bnet.protocol.EntityId.CreateBuilder(result.blockedUser_).MergeFrom(value).BuildPartial(); - } else { - result.blockedUser_ = value; - } - result.hasBlockedUser = true; - return this; - } - public Builder ClearBlockedUser() { - result.hasBlockedUser = false; - result.blockedUser_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - } - static BlockPlayerResponse() { - object.ReferenceEquals(global::bnet.protocol.user_manager.UserManager.Descriptor, null); - } - } - - public sealed partial class RemovePlayerBlockRequest : pb::GeneratedMessage { - private static readonly RemovePlayerBlockRequest defaultInstance = new Builder().BuildPartial(); - public static RemovePlayerBlockRequest DefaultInstance { - get { return defaultInstance; } - } - - public override RemovePlayerBlockRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override RemovePlayerBlockRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_RemovePlayerBlockRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_RemovePlayerBlockRequest__FieldAccessorTable; } - } - - public const int TargetIdFieldNumber = 1; - private bool hasTargetId; - private global::bnet.protocol.EntityId targetId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasTargetId { - get { return hasTargetId; } - } - public global::bnet.protocol.EntityId TargetId { - get { return targetId_; } - } - - public override bool IsInitialized { - get { - if (!hasTargetId) return false; - if (!TargetId.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasTargetId) { - output.WriteMessage(1, TargetId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasTargetId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, TargetId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static RemovePlayerBlockRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RemovePlayerBlockRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RemovePlayerBlockRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RemovePlayerBlockRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RemovePlayerBlockRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RemovePlayerBlockRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static RemovePlayerBlockRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static RemovePlayerBlockRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static RemovePlayerBlockRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RemovePlayerBlockRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(RemovePlayerBlockRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - RemovePlayerBlockRequest result = new RemovePlayerBlockRequest(); - - protected override RemovePlayerBlockRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new RemovePlayerBlockRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.user_manager.RemovePlayerBlockRequest.Descriptor; } - } - - public override RemovePlayerBlockRequest DefaultInstanceForType { - get { return global::bnet.protocol.user_manager.RemovePlayerBlockRequest.DefaultInstance; } - } - - public override RemovePlayerBlockRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - RemovePlayerBlockRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is RemovePlayerBlockRequest) { - return MergeFrom((RemovePlayerBlockRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(RemovePlayerBlockRequest other) { - if (other == global::bnet.protocol.user_manager.RemovePlayerBlockRequest.DefaultInstance) return this; - if (other.HasTargetId) { - MergeTargetId(other.TargetId); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasTargetId) { - subBuilder.MergeFrom(TargetId); - } - input.ReadMessage(subBuilder, extensionRegistry); - TargetId = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasTargetId { - get { return result.HasTargetId; } - } - public global::bnet.protocol.EntityId TargetId { - get { return result.TargetId; } - set { SetTargetId(value); } - } - public Builder SetTargetId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasTargetId = true; - result.targetId_ = value; - return this; - } - public Builder SetTargetId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasTargetId = true; - result.targetId_ = builderForValue.Build(); - return this; - } - public Builder MergeTargetId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasTargetId && - result.targetId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.targetId_ = global::bnet.protocol.EntityId.CreateBuilder(result.targetId_).MergeFrom(value).BuildPartial(); - } else { - result.targetId_ = value; - } - result.hasTargetId = true; - return this; - } - public Builder ClearTargetId() { - result.hasTargetId = false; - result.targetId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - } - static RemovePlayerBlockRequest() { - object.ReferenceEquals(global::bnet.protocol.user_manager.UserManager.Descriptor, null); - } - } - - public sealed partial class RemovePlayerBlockResponse : pb::GeneratedMessage { - private static readonly RemovePlayerBlockResponse defaultInstance = new Builder().BuildPartial(); - public static RemovePlayerBlockResponse DefaultInstance { - get { return defaultInstance; } - } - - public override RemovePlayerBlockResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override RemovePlayerBlockResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_RemovePlayerBlockResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_RemovePlayerBlockResponse__FieldAccessorTable; } - } - - public const int BlockedUserFieldNumber = 1; - private bool hasBlockedUser; - private global::bnet.protocol.EntityId blockedUser_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasBlockedUser { - get { return hasBlockedUser; } - } - public global::bnet.protocol.EntityId BlockedUser { - get { return blockedUser_; } - } - - public override bool IsInitialized { - get { - if (HasBlockedUser) { - if (!BlockedUser.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasBlockedUser) { - output.WriteMessage(1, BlockedUser); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasBlockedUser) { - size += pb::CodedOutputStream.ComputeMessageSize(1, BlockedUser); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static RemovePlayerBlockResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RemovePlayerBlockResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RemovePlayerBlockResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RemovePlayerBlockResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RemovePlayerBlockResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RemovePlayerBlockResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static RemovePlayerBlockResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static RemovePlayerBlockResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static RemovePlayerBlockResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RemovePlayerBlockResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(RemovePlayerBlockResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - RemovePlayerBlockResponse result = new RemovePlayerBlockResponse(); - - protected override RemovePlayerBlockResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new RemovePlayerBlockResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.user_manager.RemovePlayerBlockResponse.Descriptor; } - } - - public override RemovePlayerBlockResponse DefaultInstanceForType { - get { return global::bnet.protocol.user_manager.RemovePlayerBlockResponse.DefaultInstance; } - } - - public override RemovePlayerBlockResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - RemovePlayerBlockResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is RemovePlayerBlockResponse) { - return MergeFrom((RemovePlayerBlockResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(RemovePlayerBlockResponse other) { - if (other == global::bnet.protocol.user_manager.RemovePlayerBlockResponse.DefaultInstance) return this; - if (other.HasBlockedUser) { - MergeBlockedUser(other.BlockedUser); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasBlockedUser) { - subBuilder.MergeFrom(BlockedUser); - } - input.ReadMessage(subBuilder, extensionRegistry); - BlockedUser = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasBlockedUser { - get { return result.HasBlockedUser; } - } - public global::bnet.protocol.EntityId BlockedUser { - get { return result.BlockedUser; } - set { SetBlockedUser(value); } - } - public Builder SetBlockedUser(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBlockedUser = true; - result.blockedUser_ = value; - return this; - } - public Builder SetBlockedUser(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBlockedUser = true; - result.blockedUser_ = builderForValue.Build(); - return this; - } - public Builder MergeBlockedUser(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasBlockedUser && - result.blockedUser_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.blockedUser_ = global::bnet.protocol.EntityId.CreateBuilder(result.blockedUser_).MergeFrom(value).BuildPartial(); - } else { - result.blockedUser_ = value; - } - result.hasBlockedUser = true; - return this; - } - public Builder ClearBlockedUser() { - result.hasBlockedUser = false; - result.blockedUser_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - } - static RemovePlayerBlockResponse() { - object.ReferenceEquals(global::bnet.protocol.user_manager.UserManager.Descriptor, null); - } - } - - public sealed partial class AddRecentPlayersRequest : pb::GeneratedMessage { - private static readonly AddRecentPlayersRequest defaultInstance = new Builder().BuildPartial(); - public static AddRecentPlayersRequest DefaultInstance { - get { return defaultInstance; } - } - - public override AddRecentPlayersRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override AddRecentPlayersRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_AddRecentPlayersRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_AddRecentPlayersRequest__FieldAccessorTable; } - } - - public const int PlayersFieldNumber = 1; - private pbc::PopsicleList players_ = new pbc::PopsicleList(); - public scg::IList PlayersList { - get { return players_; } - } - public int PlayersCount { - get { return players_.Count; } - } - public global::bnet.protocol.user_manager.RecentPlayer GetPlayers(int index) { - return players_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::bnet.protocol.user_manager.RecentPlayer element in PlayersList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::bnet.protocol.user_manager.RecentPlayer element in PlayersList) { - output.WriteMessage(1, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::bnet.protocol.user_manager.RecentPlayer element in PlayersList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static AddRecentPlayersRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static AddRecentPlayersRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static AddRecentPlayersRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static AddRecentPlayersRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static AddRecentPlayersRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static AddRecentPlayersRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static AddRecentPlayersRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static AddRecentPlayersRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static AddRecentPlayersRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static AddRecentPlayersRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(AddRecentPlayersRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - AddRecentPlayersRequest result = new AddRecentPlayersRequest(); - - protected override AddRecentPlayersRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new AddRecentPlayersRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.user_manager.AddRecentPlayersRequest.Descriptor; } - } - - public override AddRecentPlayersRequest DefaultInstanceForType { - get { return global::bnet.protocol.user_manager.AddRecentPlayersRequest.DefaultInstance; } - } - - public override AddRecentPlayersRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.players_.MakeReadOnly(); - AddRecentPlayersRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is AddRecentPlayersRequest) { - return MergeFrom((AddRecentPlayersRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(AddRecentPlayersRequest other) { - if (other == global::bnet.protocol.user_manager.AddRecentPlayersRequest.DefaultInstance) return this; - if (other.players_.Count != 0) { - base.AddRange(other.players_, result.players_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.user_manager.RecentPlayer.Builder subBuilder = global::bnet.protocol.user_manager.RecentPlayer.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddPlayers(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public pbc::IPopsicleList PlayersList { - get { return result.players_; } - } - public int PlayersCount { - get { return result.PlayersCount; } - } - public global::bnet.protocol.user_manager.RecentPlayer GetPlayers(int index) { - return result.GetPlayers(index); - } - public Builder SetPlayers(int index, global::bnet.protocol.user_manager.RecentPlayer value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.players_[index] = value; - return this; - } - public Builder SetPlayers(int index, global::bnet.protocol.user_manager.RecentPlayer.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.players_[index] = builderForValue.Build(); - return this; - } - public Builder AddPlayers(global::bnet.protocol.user_manager.RecentPlayer value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.players_.Add(value); - return this; - } - public Builder AddPlayers(global::bnet.protocol.user_manager.RecentPlayer.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.players_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangePlayers(scg::IEnumerable values) { - base.AddRange(values, result.players_); - return this; - } - public Builder ClearPlayers() { - result.players_.Clear(); - return this; - } - } - static AddRecentPlayersRequest() { - object.ReferenceEquals(global::bnet.protocol.user_manager.UserManager.Descriptor, null); - } - } - - public sealed partial class AddRecentPlayersResponse : pb::GeneratedMessage { - private static readonly AddRecentPlayersResponse defaultInstance = new Builder().BuildPartial(); - public static AddRecentPlayersResponse DefaultInstance { - get { return defaultInstance; } - } - - public override AddRecentPlayersResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override AddRecentPlayersResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_AddRecentPlayersResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_AddRecentPlayersResponse__FieldAccessorTable; } - } - - public const int PlayersAddedFieldNumber = 1; - private pbc::PopsicleList playersAdded_ = new pbc::PopsicleList(); - public scg::IList PlayersAddedList { - get { return playersAdded_; } - } - public int PlayersAddedCount { - get { return playersAdded_.Count; } - } - public global::bnet.protocol.user_manager.RecentPlayer GetPlayersAdded(int index) { - return playersAdded_[index]; - } - - public const int PlayersRemovedFieldNumber = 3; - private pbc::PopsicleList playersRemoved_ = new pbc::PopsicleList(); - public scg::IList PlayersRemovedList { - get { return playersRemoved_; } - } - public int PlayersRemovedCount { - get { return playersRemoved_.Count; } - } - public global::bnet.protocol.user_manager.RecentPlayer GetPlayersRemoved(int index) { - return playersRemoved_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::bnet.protocol.user_manager.RecentPlayer element in PlayersAddedList) { - if (!element.IsInitialized) return false; - } - foreach (global::bnet.protocol.user_manager.RecentPlayer element in PlayersRemovedList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::bnet.protocol.user_manager.RecentPlayer element in PlayersAddedList) { - output.WriteMessage(1, element); - } - foreach (global::bnet.protocol.user_manager.RecentPlayer element in PlayersRemovedList) { - output.WriteMessage(3, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::bnet.protocol.user_manager.RecentPlayer element in PlayersAddedList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - foreach (global::bnet.protocol.user_manager.RecentPlayer element in PlayersRemovedList) { - size += pb::CodedOutputStream.ComputeMessageSize(3, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static AddRecentPlayersResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static AddRecentPlayersResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static AddRecentPlayersResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static AddRecentPlayersResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static AddRecentPlayersResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static AddRecentPlayersResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static AddRecentPlayersResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static AddRecentPlayersResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static AddRecentPlayersResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static AddRecentPlayersResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(AddRecentPlayersResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - AddRecentPlayersResponse result = new AddRecentPlayersResponse(); - - protected override AddRecentPlayersResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new AddRecentPlayersResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.user_manager.AddRecentPlayersResponse.Descriptor; } - } - - public override AddRecentPlayersResponse DefaultInstanceForType { - get { return global::bnet.protocol.user_manager.AddRecentPlayersResponse.DefaultInstance; } - } - - public override AddRecentPlayersResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.playersAdded_.MakeReadOnly(); - result.playersRemoved_.MakeReadOnly(); - AddRecentPlayersResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is AddRecentPlayersResponse) { - return MergeFrom((AddRecentPlayersResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(AddRecentPlayersResponse other) { - if (other == global::bnet.protocol.user_manager.AddRecentPlayersResponse.DefaultInstance) return this; - if (other.playersAdded_.Count != 0) { - base.AddRange(other.playersAdded_, result.playersAdded_); - } - if (other.playersRemoved_.Count != 0) { - base.AddRange(other.playersRemoved_, result.playersRemoved_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.user_manager.RecentPlayer.Builder subBuilder = global::bnet.protocol.user_manager.RecentPlayer.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddPlayersAdded(subBuilder.BuildPartial()); - break; - } - case 26: { - global::bnet.protocol.user_manager.RecentPlayer.Builder subBuilder = global::bnet.protocol.user_manager.RecentPlayer.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddPlayersRemoved(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public pbc::IPopsicleList PlayersAddedList { - get { return result.playersAdded_; } - } - public int PlayersAddedCount { - get { return result.PlayersAddedCount; } - } - public global::bnet.protocol.user_manager.RecentPlayer GetPlayersAdded(int index) { - return result.GetPlayersAdded(index); - } - public Builder SetPlayersAdded(int index, global::bnet.protocol.user_manager.RecentPlayer value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.playersAdded_[index] = value; - return this; - } - public Builder SetPlayersAdded(int index, global::bnet.protocol.user_manager.RecentPlayer.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.playersAdded_[index] = builderForValue.Build(); - return this; - } - public Builder AddPlayersAdded(global::bnet.protocol.user_manager.RecentPlayer value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.playersAdded_.Add(value); - return this; - } - public Builder AddPlayersAdded(global::bnet.protocol.user_manager.RecentPlayer.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.playersAdded_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangePlayersAdded(scg::IEnumerable values) { - base.AddRange(values, result.playersAdded_); - return this; - } - public Builder ClearPlayersAdded() { - result.playersAdded_.Clear(); - return this; - } - - public pbc::IPopsicleList PlayersRemovedList { - get { return result.playersRemoved_; } - } - public int PlayersRemovedCount { - get { return result.PlayersRemovedCount; } - } - public global::bnet.protocol.user_manager.RecentPlayer GetPlayersRemoved(int index) { - return result.GetPlayersRemoved(index); - } - public Builder SetPlayersRemoved(int index, global::bnet.protocol.user_manager.RecentPlayer value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.playersRemoved_[index] = value; - return this; - } - public Builder SetPlayersRemoved(int index, global::bnet.protocol.user_manager.RecentPlayer.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.playersRemoved_[index] = builderForValue.Build(); - return this; - } - public Builder AddPlayersRemoved(global::bnet.protocol.user_manager.RecentPlayer value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.playersRemoved_.Add(value); - return this; - } - public Builder AddPlayersRemoved(global::bnet.protocol.user_manager.RecentPlayer.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.playersRemoved_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangePlayersRemoved(scg::IEnumerable values) { - base.AddRange(values, result.playersRemoved_); - return this; - } - public Builder ClearPlayersRemoved() { - result.playersRemoved_.Clear(); - return this; - } - } - static AddRecentPlayersResponse() { - object.ReferenceEquals(global::bnet.protocol.user_manager.UserManager.Descriptor, null); - } - } - - public sealed partial class RemoveRecentPlayersRequest : pb::GeneratedMessage { - private static readonly RemoveRecentPlayersRequest defaultInstance = new Builder().BuildPartial(); - public static RemoveRecentPlayersRequest DefaultInstance { - get { return defaultInstance; } - } - - public override RemoveRecentPlayersRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override RemoveRecentPlayersRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_RemoveRecentPlayersRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_RemoveRecentPlayersRequest__FieldAccessorTable; } - } - - public const int PlayersFieldNumber = 2; - private pbc::PopsicleList players_ = new pbc::PopsicleList(); - public scg::IList PlayersList { - get { return players_; } - } - public int PlayersCount { - get { return players_.Count; } - } - public global::bnet.protocol.user_manager.RecentPlayer GetPlayers(int index) { - return players_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::bnet.protocol.user_manager.RecentPlayer element in PlayersList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::bnet.protocol.user_manager.RecentPlayer element in PlayersList) { - output.WriteMessage(2, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::bnet.protocol.user_manager.RecentPlayer element in PlayersList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static RemoveRecentPlayersRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RemoveRecentPlayersRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RemoveRecentPlayersRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RemoveRecentPlayersRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RemoveRecentPlayersRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RemoveRecentPlayersRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static RemoveRecentPlayersRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static RemoveRecentPlayersRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static RemoveRecentPlayersRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RemoveRecentPlayersRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(RemoveRecentPlayersRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - RemoveRecentPlayersRequest result = new RemoveRecentPlayersRequest(); - - protected override RemoveRecentPlayersRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new RemoveRecentPlayersRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.user_manager.RemoveRecentPlayersRequest.Descriptor; } - } - - public override RemoveRecentPlayersRequest DefaultInstanceForType { - get { return global::bnet.protocol.user_manager.RemoveRecentPlayersRequest.DefaultInstance; } - } - - public override RemoveRecentPlayersRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.players_.MakeReadOnly(); - RemoveRecentPlayersRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is RemoveRecentPlayersRequest) { - return MergeFrom((RemoveRecentPlayersRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(RemoveRecentPlayersRequest other) { - if (other == global::bnet.protocol.user_manager.RemoveRecentPlayersRequest.DefaultInstance) return this; - if (other.players_.Count != 0) { - base.AddRange(other.players_, result.players_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 18: { - global::bnet.protocol.user_manager.RecentPlayer.Builder subBuilder = global::bnet.protocol.user_manager.RecentPlayer.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddPlayers(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public pbc::IPopsicleList PlayersList { - get { return result.players_; } - } - public int PlayersCount { - get { return result.PlayersCount; } - } - public global::bnet.protocol.user_manager.RecentPlayer GetPlayers(int index) { - return result.GetPlayers(index); - } - public Builder SetPlayers(int index, global::bnet.protocol.user_manager.RecentPlayer value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.players_[index] = value; - return this; - } - public Builder SetPlayers(int index, global::bnet.protocol.user_manager.RecentPlayer.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.players_[index] = builderForValue.Build(); - return this; - } - public Builder AddPlayers(global::bnet.protocol.user_manager.RecentPlayer value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.players_.Add(value); - return this; - } - public Builder AddPlayers(global::bnet.protocol.user_manager.RecentPlayer.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.players_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangePlayers(scg::IEnumerable values) { - base.AddRange(values, result.players_); - return this; - } - public Builder ClearPlayers() { - result.players_.Clear(); - return this; - } - } - static RemoveRecentPlayersRequest() { - object.ReferenceEquals(global::bnet.protocol.user_manager.UserManager.Descriptor, null); - } - } - - public sealed partial class RemoveRecentPlayersResponse : pb::GeneratedMessage { - private static readonly RemoveRecentPlayersResponse defaultInstance = new Builder().BuildPartial(); - public static RemoveRecentPlayersResponse DefaultInstance { - get { return defaultInstance; } - } - - public override RemoveRecentPlayersResponse DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override RemoveRecentPlayersResponse ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_RemoveRecentPlayersResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_RemoveRecentPlayersResponse__FieldAccessorTable; } - } - - public const int PlayersRemovedFieldNumber = 1; - private pbc::PopsicleList playersRemoved_ = new pbc::PopsicleList(); - public scg::IList PlayersRemovedList { - get { return playersRemoved_; } - } - public int PlayersRemovedCount { - get { return playersRemoved_.Count; } - } - public global::bnet.protocol.user_manager.RecentPlayer GetPlayersRemoved(int index) { - return playersRemoved_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::bnet.protocol.user_manager.RecentPlayer element in PlayersRemovedList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::bnet.protocol.user_manager.RecentPlayer element in PlayersRemovedList) { - output.WriteMessage(1, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::bnet.protocol.user_manager.RecentPlayer element in PlayersRemovedList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static RemoveRecentPlayersResponse ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RemoveRecentPlayersResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RemoveRecentPlayersResponse ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RemoveRecentPlayersResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RemoveRecentPlayersResponse ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RemoveRecentPlayersResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static RemoveRecentPlayersResponse ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static RemoveRecentPlayersResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static RemoveRecentPlayersResponse ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RemoveRecentPlayersResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(RemoveRecentPlayersResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - RemoveRecentPlayersResponse result = new RemoveRecentPlayersResponse(); - - protected override RemoveRecentPlayersResponse MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new RemoveRecentPlayersResponse(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.user_manager.RemoveRecentPlayersResponse.Descriptor; } - } - - public override RemoveRecentPlayersResponse DefaultInstanceForType { - get { return global::bnet.protocol.user_manager.RemoveRecentPlayersResponse.DefaultInstance; } - } - - public override RemoveRecentPlayersResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.playersRemoved_.MakeReadOnly(); - RemoveRecentPlayersResponse returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is RemoveRecentPlayersResponse) { - return MergeFrom((RemoveRecentPlayersResponse) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(RemoveRecentPlayersResponse other) { - if (other == global::bnet.protocol.user_manager.RemoveRecentPlayersResponse.DefaultInstance) return this; - if (other.playersRemoved_.Count != 0) { - base.AddRange(other.playersRemoved_, result.playersRemoved_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.user_manager.RecentPlayer.Builder subBuilder = global::bnet.protocol.user_manager.RecentPlayer.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddPlayersRemoved(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public pbc::IPopsicleList PlayersRemovedList { - get { return result.playersRemoved_; } - } - public int PlayersRemovedCount { - get { return result.PlayersRemovedCount; } - } - public global::bnet.protocol.user_manager.RecentPlayer GetPlayersRemoved(int index) { - return result.GetPlayersRemoved(index); - } - public Builder SetPlayersRemoved(int index, global::bnet.protocol.user_manager.RecentPlayer value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.playersRemoved_[index] = value; - return this; - } - public Builder SetPlayersRemoved(int index, global::bnet.protocol.user_manager.RecentPlayer.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.playersRemoved_[index] = builderForValue.Build(); - return this; - } - public Builder AddPlayersRemoved(global::bnet.protocol.user_manager.RecentPlayer value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.playersRemoved_.Add(value); - return this; - } - public Builder AddPlayersRemoved(global::bnet.protocol.user_manager.RecentPlayer.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.playersRemoved_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangePlayersRemoved(scg::IEnumerable values) { - base.AddRange(values, result.playersRemoved_); - return this; - } - public Builder ClearPlayersRemoved() { - result.playersRemoved_.Clear(); - return this; - } - } - static RemoveRecentPlayersResponse() { - object.ReferenceEquals(global::bnet.protocol.user_manager.UserManager.Descriptor, null); - } - } - - public sealed partial class BlockedPlayerNotification : pb::GeneratedMessage { - private static readonly BlockedPlayerNotification defaultInstance = new Builder().BuildPartial(); - public static BlockedPlayerNotification DefaultInstance { - get { return defaultInstance; } - } - - public override BlockedPlayerNotification DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override BlockedPlayerNotification ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_BlockedPlayerNotification__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_BlockedPlayerNotification__FieldAccessorTable; } - } - - public const int PlayersFieldNumber = 1; - private pbc::PopsicleList players_ = new pbc::PopsicleList(); - public scg::IList PlayersList { - get { return players_; } - } - public int PlayersCount { - get { return players_.Count; } - } - public global::bnet.protocol.EntityId GetPlayers(int index) { - return players_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::bnet.protocol.EntityId element in PlayersList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::bnet.protocol.EntityId element in PlayersList) { - output.WriteMessage(1, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::bnet.protocol.EntityId element in PlayersList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static BlockedPlayerNotification ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BlockedPlayerNotification ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BlockedPlayerNotification ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static BlockedPlayerNotification ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static BlockedPlayerNotification ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BlockedPlayerNotification ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static BlockedPlayerNotification ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static BlockedPlayerNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static BlockedPlayerNotification ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static BlockedPlayerNotification ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(BlockedPlayerNotification prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - BlockedPlayerNotification result = new BlockedPlayerNotification(); - - protected override BlockedPlayerNotification MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new BlockedPlayerNotification(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.user_manager.BlockedPlayerNotification.Descriptor; } - } - - public override BlockedPlayerNotification DefaultInstanceForType { - get { return global::bnet.protocol.user_manager.BlockedPlayerNotification.DefaultInstance; } - } - - public override BlockedPlayerNotification BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.players_.MakeReadOnly(); - BlockedPlayerNotification returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is BlockedPlayerNotification) { - return MergeFrom((BlockedPlayerNotification) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(BlockedPlayerNotification other) { - if (other == global::bnet.protocol.user_manager.BlockedPlayerNotification.DefaultInstance) return this; - if (other.players_.Count != 0) { - base.AddRange(other.players_, result.players_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddPlayers(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public pbc::IPopsicleList PlayersList { - get { return result.players_; } - } - public int PlayersCount { - get { return result.PlayersCount; } - } - public global::bnet.protocol.EntityId GetPlayers(int index) { - return result.GetPlayers(index); - } - public Builder SetPlayers(int index, global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.players_[index] = value; - return this; - } - public Builder SetPlayers(int index, global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.players_[index] = builderForValue.Build(); - return this; - } - public Builder AddPlayers(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.players_.Add(value); - return this; - } - public Builder AddPlayers(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.players_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangePlayers(scg::IEnumerable values) { - base.AddRange(values, result.players_); - return this; - } - public Builder ClearPlayers() { - result.players_.Clear(); - return this; - } - } - static BlockedPlayerNotification() { - object.ReferenceEquals(global::bnet.protocol.user_manager.UserManager.Descriptor, null); - } - } - - #endregion - - #region Services - public abstract class UserManagerService : pb::IService { - public abstract void SubscribeToUserManager( - pb::IRpcController controller, - global::bnet.protocol.user_manager.SubscribeToUserManagerRequest request, - global::System.Action done); - public abstract void ReportPlayer( - pb::IRpcController controller, - global::bnet.protocol.user_manager.ReportPlayerRequest request, - global::System.Action done); - public abstract void BlockPlayer( - pb::IRpcController controller, - global::bnet.protocol.user_manager.BlockPlayerRequest request, - global::System.Action done); - public abstract void RemovePlayerBlock( - pb::IRpcController controller, - global::bnet.protocol.user_manager.RemovePlayerBlockRequest request, - global::System.Action done); - public abstract void AddRecentPlayers( - pb::IRpcController controller, - global::bnet.protocol.user_manager.AddRecentPlayersRequest request, - global::System.Action done); - public abstract void RemoveRecentPlayers( - pb::IRpcController controller, - global::bnet.protocol.user_manager.RemoveRecentPlayersRequest request, - global::System.Action done); - - public static pbd::ServiceDescriptor Descriptor { - get { return UserManager.Descriptor.Services[0]; } - } - public pbd::ServiceDescriptor DescriptorForType { - get { return Descriptor; } - } - - public void CallMethod( - pbd::MethodDescriptor method, - pb::IRpcController controller, - pb::IMessage request, - global::System.Action done) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.CallMethod() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - this.SubscribeToUserManager(controller, (global::bnet.protocol.user_manager.SubscribeToUserManagerRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 1: - this.ReportPlayer(controller, (global::bnet.protocol.user_manager.ReportPlayerRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 2: - this.BlockPlayer(controller, (global::bnet.protocol.user_manager.BlockPlayerRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 3: - this.RemovePlayerBlock(controller, (global::bnet.protocol.user_manager.RemovePlayerBlockRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 4: - this.AddRecentPlayers(controller, (global::bnet.protocol.user_manager.AddRecentPlayersRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 5: - this.RemoveRecentPlayers(controller, (global::bnet.protocol.user_manager.RemoveRecentPlayersRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetRequestPrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::bnet.protocol.user_manager.SubscribeToUserManagerRequest.DefaultInstance; - case 1: - return global::bnet.protocol.user_manager.ReportPlayerRequest.DefaultInstance; - case 2: - return global::bnet.protocol.user_manager.BlockPlayerRequest.DefaultInstance; - case 3: - return global::bnet.protocol.user_manager.RemovePlayerBlockRequest.DefaultInstance; - case 4: - return global::bnet.protocol.user_manager.AddRecentPlayersRequest.DefaultInstance; - case 5: - return global::bnet.protocol.user_manager.RemoveRecentPlayersRequest.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetResponsePrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::bnet.protocol.user_manager.SubscribeToUserManagerResponse.DefaultInstance; - case 1: - return global::bnet.protocol.user_manager.ReportPlayerResponse.DefaultInstance; - case 2: - return global::bnet.protocol.user_manager.BlockPlayerResponse.DefaultInstance; - case 3: - return global::bnet.protocol.user_manager.RemovePlayerBlockResponse.DefaultInstance; - case 4: - return global::bnet.protocol.user_manager.AddRecentPlayersResponse.DefaultInstance; - case 5: - return global::bnet.protocol.user_manager.RemoveRecentPlayersResponse.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public static Stub CreateStub(pb::IRpcChannel channel) { - return new Stub(channel); - } - - public class Stub : global::bnet.protocol.user_manager.UserManagerService { - internal Stub(pb::IRpcChannel channel) { - this.channel = channel; - } - - private readonly pb::IRpcChannel channel; - - public pb::IRpcChannel Channel { - get { return channel; } - } - - public override void SubscribeToUserManager( - pb::IRpcController controller, - global::bnet.protocol.user_manager.SubscribeToUserManagerRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[0], - controller, request, global::bnet.protocol.user_manager.SubscribeToUserManagerResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.user_manager.SubscribeToUserManagerResponse.DefaultInstance)); - } - - public override void ReportPlayer( - pb::IRpcController controller, - global::bnet.protocol.user_manager.ReportPlayerRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[1], - controller, request, global::bnet.protocol.user_manager.ReportPlayerResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.user_manager.ReportPlayerResponse.DefaultInstance)); - } - - public override void BlockPlayer( - pb::IRpcController controller, - global::bnet.protocol.user_manager.BlockPlayerRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[2], - controller, request, global::bnet.protocol.user_manager.BlockPlayerResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.user_manager.BlockPlayerResponse.DefaultInstance)); - } - - public override void RemovePlayerBlock( - pb::IRpcController controller, - global::bnet.protocol.user_manager.RemovePlayerBlockRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[3], - controller, request, global::bnet.protocol.user_manager.RemovePlayerBlockResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.user_manager.RemovePlayerBlockResponse.DefaultInstance)); - } - - public override void AddRecentPlayers( - pb::IRpcController controller, - global::bnet.protocol.user_manager.AddRecentPlayersRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[4], - controller, request, global::bnet.protocol.user_manager.AddRecentPlayersResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.user_manager.AddRecentPlayersResponse.DefaultInstance)); - } - - public override void RemoveRecentPlayers( - pb::IRpcController controller, - global::bnet.protocol.user_manager.RemoveRecentPlayersRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[5], - controller, request, global::bnet.protocol.user_manager.RemoveRecentPlayersResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.user_manager.RemoveRecentPlayersResponse.DefaultInstance)); - } - } - } - public abstract class UserManagerNotify : pb::IService { - public abstract void NotifyPlayerBlocked( - pb::IRpcController controller, - global::bnet.protocol.user_manager.BlockedPlayerNotification request, - global::System.Action done); - public abstract void NotifyPlayerBlockRemoved( - pb::IRpcController controller, - global::bnet.protocol.user_manager.BlockedPlayerNotification request, - global::System.Action done); - - public static pbd::ServiceDescriptor Descriptor { - get { return UserManager.Descriptor.Services[1]; } - } - public pbd::ServiceDescriptor DescriptorForType { - get { return Descriptor; } - } - - public void CallMethod( - pbd::MethodDescriptor method, - pb::IRpcController controller, - pb::IMessage request, - global::System.Action done) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.CallMethod() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - this.NotifyPlayerBlocked(controller, (global::bnet.protocol.user_manager.BlockedPlayerNotification) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 1: - this.NotifyPlayerBlockRemoved(controller, (global::bnet.protocol.user_manager.BlockedPlayerNotification) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetRequestPrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::bnet.protocol.user_manager.BlockedPlayerNotification.DefaultInstance; - case 1: - return global::bnet.protocol.user_manager.BlockedPlayerNotification.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetResponsePrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::bnet.protocol.NO_RESPONSE.DefaultInstance; - case 1: - return global::bnet.protocol.NO_RESPONSE.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public static Stub CreateStub(pb::IRpcChannel channel) { - return new Stub(channel); - } - - public class Stub : global::bnet.protocol.user_manager.UserManagerNotify { - internal Stub(pb::IRpcChannel channel) { - this.channel = channel; - } - - private readonly pb::IRpcChannel channel; - - public pb::IRpcChannel Channel { - get { return channel; } - } - - public override void NotifyPlayerBlocked( - pb::IRpcController controller, - global::bnet.protocol.user_manager.BlockedPlayerNotification request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[0], - controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); - } - - public override void NotifyPlayerBlockRemoved( - pb::IRpcController controller, - global::bnet.protocol.user_manager.BlockedPlayerNotification request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[1], - controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); - } - } - } - #endregion - -} diff --git a/source/D3Sharp-mono.sln b/source/D3Sharp-mono.sln deleted file mode 100644 index ad146d87..00000000 --- a/source/D3Sharp-mono.sln +++ /dev/null @@ -1,32 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "D3Sharp", "D3Sharp\D3Sharp.csproj", "{41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "D3Proto", "D3Proto\D3Proto.csproj", "{4CC19847-6F24-4453-9E31-126F94308AB9}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtoStringFixer", "ProtoStringFixer\ProtoStringFixer.csproj", "{1519D483-C89D-4B86-8A48-2E4F05440423}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x86 = Debug|x86 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {1519D483-C89D-4B86-8A48-2E4F05440423}.Debug|x86.ActiveCfg = Debug|Any CPU - {1519D483-C89D-4B86-8A48-2E4F05440423}.Debug|x86.Build.0 = Debug|Any CPU - {1519D483-C89D-4B86-8A48-2E4F05440423}.Release|x86.ActiveCfg = Release|Any CPU - {1519D483-C89D-4B86-8A48-2E4F05440423}.Release|x86.Build.0 = Release|Any CPU - {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Debug|x86.ActiveCfg = Debug|x86 - {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Debug|x86.Build.0 = Debug|x86 - {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Release|x86.ActiveCfg = Release|x86 - {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD}.Release|x86.Build.0 = Release|x86 - {4CC19847-6F24-4453-9E31-126F94308AB9}.Debug|x86.ActiveCfg = Debug|Any CPU - {4CC19847-6F24-4453-9E31-126F94308AB9}.Debug|x86.Build.0 = Debug|Any CPU - {4CC19847-6F24-4453-9E31-126F94308AB9}.Release|x86.ActiveCfg = Release|Any CPU - {4CC19847-6F24-4453-9E31-126F94308AB9}.Release|x86.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(MonoDevelopProperties) = preSolution - StartupItem = D3Sharp\D3Sharp.csproj - EndGlobalSection -EndGlobal diff --git a/source/D3Sharp/.gitignore b/source/D3Sharp/.gitignore deleted file mode 100644 index cc0bb574..00000000 --- a/source/D3Sharp/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -bin/ -obj/ -D3Sharp.pidb diff --git a/source/D3Sharp/Core/Services/AuthenticationService.cs b/source/D3Sharp/Core/Services/AuthenticationService.cs deleted file mode 100644 index eb9277f1..00000000 --- a/source/D3Sharp/Core/Services/AuthenticationService.cs +++ /dev/null @@ -1,26 +0,0 @@ -using D3Sharp.Net; -using D3Sharp.Net.Packets; -using bnet.protocol; - -namespace D3Sharp.Core.Services -{ - [Service(serviceID: 0x1, serverHash: 0xDECFC01, clientHash: 0x71240E35)] - public class AuthenticationService:Service - { - [ServiceMethod(0x1)] - public void Logon(IClient client, Packet packetIn) - { - Logger.Trace("RPC:Authentication:Logon()"); - var response = bnet.protocol.authentication.LogonResponse.CreateBuilder() - .SetAccount(EntityId.CreateBuilder().SetHigh(0x100000000000000).SetLow(0)) - .SetGameAccount(EntityId.CreateBuilder().SetHigh(0x200006200004433).SetLow(0)) - .Build(); - - var packet = new Packet( - new Header(0xfe, 0x0, packetIn.Header.RequestID, (uint)response.SerializedSize), - response.ToByteArray()); - - client.Send(packet); - } - } -} diff --git a/source/D3Sharp/Core/Services/BaseService.cs b/source/D3Sharp/Core/Services/BaseService.cs deleted file mode 100644 index e10eca9c..00000000 --- a/source/D3Sharp/Core/Services/BaseService.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using D3Sharp.Net; -using D3Sharp.Net.Packets; -using D3Sharp.Utils.Extensions; -using bnet.protocol; - -namespace D3Sharp.Core.Services -{ - [Service(serviceID: 0x0, serverHash: 0x0, clientHash: 0x0)] - public class BaseService : Service - { - [ServiceMethod(0x1)] - public void Connect(IClient client, Packet packetIn) - { - Logger.Trace("RPC:Connect()"); - var response = bnet.protocol.connection.ConnectResponse.CreateBuilder() - .SetServerId(ProcessId.CreateBuilder().SetLabel(0xAAAA).SetEpoch(DateTime.Now.ToUnixTime())) - .SetClientId(ProcessId.CreateBuilder().SetLabel(0xBBBB).SetEpoch(DateTime.Now.ToUnixTime())) - .Build(); - - var packet = new Packet( - new Header(0xfe, 0x0, packetIn.Header.RequestID, (uint)response.SerializedSize), - response.ToByteArray()); - - client.Send(packet); - } - - [ServiceMethod(0x2)] - public void Bind(IClient client, Packet packetIn) - { - var request = bnet.protocol.connection.BindRequest.ParseFrom(packetIn.Payload.ToArray()); - - // supply service id's requested by client using service-hashes. - var requestedServiceIDs = new List(); - foreach (var serviceHash in request.ImportedServiceHashList) - { - var serviceID = ServiceManager.GetServerServiceIDByHash(serviceHash); - Logger.Trace("RPC:Bind() - Hash: 0x{0} ID: {1,4} Service: {2} ", serviceHash.ToString("X8"), serviceID, ServiceManager.GetServerServiceByID(serviceID) != null ? ServiceManager.GetServerServiceByID(serviceID).GetType().Name : "N/A"); - requestedServiceIDs.Add(serviceID); - } - - // read services supplied by client.. - foreach (var service in request.ExportedServiceList) - { - if (!client.Services.ContainsKey(service.Id)) - client.Services.Add(service.Id, service.Hash); - } - - var builder = bnet.protocol.connection.BindResponse.CreateBuilder(); - foreach (var serviceId in requestedServiceIDs) builder.AddImportedServiceId(serviceId); - var response = builder.Build(); - - var packet = - new Packet( - new Header(0xfe, 0x0, packetIn.Header.RequestID, (uint) response.SerializedSize), - response.ToByteArray()); - - client.Send(packet); - } - } -} diff --git a/source/D3Sharp/Core/Services/ChannelInvitationService.cs b/source/D3Sharp/Core/Services/ChannelInvitationService.cs deleted file mode 100644 index f2c609a9..00000000 --- a/source/D3Sharp/Core/Services/ChannelInvitationService.cs +++ /dev/null @@ -1,22 +0,0 @@ -using D3Sharp.Net; -using D3Sharp.Net.Packets; - -namespace D3Sharp.Core.Services -{ - [Service(serviceID: 0x3, serverHash: 0x83040608, clientHash: 0xF084FC20)] - public class ChannelInvitationService:Service - { - [ServiceMethod(0x1)] - public void Subscribe(IClient client, Packet packetIn) - { - Logger.Trace("RPC:ChannelInvitation:Subscribe()"); - var response = bnet.protocol.channel_invitation.SubscribeResponse.CreateBuilder().Build(); - - var packet = new Packet( - new Header(0xfe, 0x0, packetIn.Header.RequestID, (uint)response.SerializedSize), - response.ToByteArray()); - - client.Send(packet); - } - } -} diff --git a/source/D3Sharp/Core/Services/ChannelOwnerService.cs b/source/D3Sharp/Core/Services/ChannelOwnerService.cs deleted file mode 100644 index d64536f9..00000000 --- a/source/D3Sharp/Core/Services/ChannelOwnerService.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace D3Sharp.Core.Services -{ - // bnet.protocol.channel.ChannelOwner - [Service(serviceID: 0x11, serverHash: 0x060ca08d, clientHash: 0x0)] - public class ChannelOwnerService : Service - { - - } -} diff --git a/source/D3Sharp/Core/Services/ChannelService.cs b/source/D3Sharp/Core/Services/ChannelService.cs deleted file mode 100644 index 1c9948ee..00000000 --- a/source/D3Sharp/Core/Services/ChannelService.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace D3Sharp.Core.Services -{ - // bnet.protocol.channel.Channel - [Service(serviceID: 0x10, serverHash: 0xB732DB32, clientHash: 0x0)] - public class ChannelService : Service - { - - } -} diff --git a/source/D3Sharp/Core/Services/ChatService.cs b/source/D3Sharp/Core/Services/ChatService.cs deleted file mode 100644 index 8e9d89a8..00000000 --- a/source/D3Sharp/Core/Services/ChatService.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace D3Sharp.Core.Services -{ - // net.protocol.chat.ChatService - [Service(serviceID: 0x0f, serverHash: 0x00D89CA9, clientHash: 0x0)] - public class ChatService : Service - { - - } -} diff --git a/source/D3Sharp/Core/Services/ExchangeService.cs b/source/D3Sharp/Core/Services/ExchangeService.cs deleted file mode 100644 index 0fdf474e..00000000 --- a/source/D3Sharp/Core/Services/ExchangeService.cs +++ /dev/null @@ -1,22 +0,0 @@ -using D3Sharp.Net; -using D3Sharp.Net.Packets; - -namespace D3Sharp.Core.Services -{ - [Service(serviceID: 0x0a, serverHash: 0xd750148b, clientHash: 0x0)] - public class ExchangeService : Service - { - [ServiceMethod(0x1b)] - public void GetConfiguration(IClient client, Packet packetIn) - { - Logger.Trace("RPC:Exchange:GetConfiguration()"); - var response = bnet.protocol.exchange.GetConfigurationResponse.CreateBuilder().Build(); - - var packet = new Packet( - new Header(0xfe, 0x0, packetIn.Header.RequestID, (uint)response.SerializedSize), - response.ToByteArray()); - - client.Send(packet); - } - } -} diff --git a/source/D3Sharp/Core/Services/FollowersService.cs b/source/D3Sharp/Core/Services/FollowersService.cs deleted file mode 100644 index 44562228..00000000 --- a/source/D3Sharp/Core/Services/FollowersService.cs +++ /dev/null @@ -1,22 +0,0 @@ -using D3Sharp.Net; -using D3Sharp.Net.Packets; - -namespace D3Sharp.Core.Services -{ - [Service(serviceID: 0x4, serverHash: 0xE5A11099, clientHash: 0x905CDF9F)] - public class FollowersService : Service - { - [ServiceMethod(0x1)] - public void SubscribeToFollowers(IClient client, Packet packetIn) - { - var response = bnet.protocol.followers.SubscribeToFollowersResponse.CreateBuilder().Build(); - - var packet = new Packet( - new Header(0xfe, 0x0, packetIn.Header.RequestID, (uint)response.SerializedSize), - response.ToByteArray()); - - Logger.Trace("RPC:Followers:Subscribe()"); - client.Send(packet); - } - } -} diff --git a/source/D3Sharp/Core/Services/FriendsService.cs b/source/D3Sharp/Core/Services/FriendsService.cs deleted file mode 100644 index ac8c80e4..00000000 --- a/source/D3Sharp/Core/Services/FriendsService.cs +++ /dev/null @@ -1,26 +0,0 @@ -using D3Sharp.Net; -using D3Sharp.Net.Packets; - -namespace D3Sharp.Core.Services -{ - [Service(serviceID: 0x6, serverHash: 0xA3DDB1BD, clientHash: 0x6F259A13)] - public class FriendsService : Service - { - [ServiceMethod(0x1)] - public void SubscribeToFriends(IClient client, Packet packetIn) - { - Logger.Trace("RPC:Friends:Subscribe()"); - var response = bnet.protocol.friends.SubscribeToFriendsResponse.CreateBuilder() - .SetMaxFriends(127) - .SetMaxReceivedInvitations(127) - .SetMaxSentInvitations(127) - .Build(); - - var packet = new Packet( - new Header(0xfe, 0x0, packetIn.Header.RequestID, (uint)response.SerializedSize), - response.ToByteArray()); - - client.Send(packet); - } - } -} diff --git a/source/D3Sharp/Core/Services/GameMasterService.cs b/source/D3Sharp/Core/Services/GameMasterService.cs deleted file mode 100644 index b0e2feea..00000000 --- a/source/D3Sharp/Core/Services/GameMasterService.cs +++ /dev/null @@ -1,71 +0,0 @@ -using D3Sharp.Net; -using D3Sharp.Net.Packets; - -namespace D3Sharp.Core.Services -{ - [Service(serviceID: 0x7, serverHash: 0x810CB195, clientHash: 0x0)] - public class GameMasterService : Service - { - [ServiceMethod(0x2)] - public void ListFactoriesRequest(IClient client, Packet packetIn) - { - Logger.Trace("RPC:GameMaster:ListFactoriesRequest()"); - //var reqb = bnet.protocol.game_master.ListFactoriesRequest.ParseFrom(packetIn.Payload.ToArray()); - var varib1 = bnet.protocol.attribute.Variant.CreateBuilder(); - varib1.SetIntValue(2); - var vari1 = varib1.Build(); - var varib2 = bnet.protocol.attribute.Variant.CreateBuilder(); - varib2.SetIntValue(4); - var vari2 = varib2.Build(); - var varib3 = bnet.protocol.attribute.Variant.CreateBuilder(); - varib3.SetIntValue(1); - var vari3 = varib3.Build(); - var varib4 = bnet.protocol.attribute.Variant.CreateBuilder(); - varib4.SetStringValue("0.3.0"); - var vari4 = varib4.Build(); - var attrb1 = bnet.protocol.attribute.Attribute.CreateBuilder(); - attrb1.SetName("min_players"); - attrb1.SetValue(vari1); - var attr1 = attrb1.Build(); - var attrb2 = bnet.protocol.attribute.Attribute.CreateBuilder(); - attrb2.SetName("max_players"); - attrb2.SetValue(vari2); - var attr2 = attrb2.Build(); - var attrb3 = bnet.protocol.attribute.Attribute.CreateBuilder(); - attrb3.SetName("num_teams"); - attrb3.SetValue(vari3); - var attr3 = attrb3.Build(); - var attrb4 = bnet.protocol.attribute.Attribute.CreateBuilder(); - attrb4.SetName("version"); - attrb4.SetValue(vari4); - var attr4 = attrb4.Build(); - var statsb = bnet.protocol.game_master.GameStatsBucket.CreateBuilder(); - statsb.SetBucketMin(0); - statsb.SetBucketMax(4.2949673e+009f); - statsb.SetWaitMilliseconds(1000); - statsb.SetGamesPerHour(0); - statsb.SetActiveGames(50); - statsb.SetActivePlayers(60); - statsb.SetFormingGames(0); - statsb.SetWaitingPlayers(0); - var stats = statsb.Build(); - var factb = bnet.protocol.game_master.GameFactoryDescription.CreateBuilder(); // CoopFactoryID - 14249086168335147635 was value on bnet forum error log - factb.SetId(14249086168335147635); - factb.AddStatsBucket(stats); - factb.AddAttribute(attr1); - factb.AddAttribute(attr2); - factb.AddAttribute(attr3); - factb.AddAttribute(attr4); - var fact = factb.Build(); - var respb = bnet.protocol.game_master.ListFactoriesResponse.CreateBuilder(); - respb.SetTotalResults(1); - respb.AddDescription(fact); - var response = respb.Build(); // Seems rescount is optional - - var packet = new Packet( - new Header(0xfe, 0x0, packetIn.Header.RequestID, (uint)response.SerializedSize), - response.ToByteArray()); - client.Send(packet); - } - } -} diff --git a/source/D3Sharp/Core/Services/GameUtilitiesService.cs b/source/D3Sharp/Core/Services/GameUtilitiesService.cs deleted file mode 100644 index 79963c44..00000000 --- a/source/D3Sharp/Core/Services/GameUtilitiesService.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace D3Sharp.Core.Services -{ - [Service(serviceID: 0x8, serverHash: 0x3FC1274D, clientHash: 0x0)] - public class GameUtilitiesService : Service - { - } -} diff --git a/source/D3Sharp/Core/Services/NotificationService.cs b/source/D3Sharp/Core/Services/NotificationService.cs deleted file mode 100644 index c3294255..00000000 --- a/source/D3Sharp/Core/Services/NotificationService.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace D3Sharp.Core.Services -{ - // bnet.protocol.notification.NotificationService - [Service(serviceID: 0xc, serverHash: 0x0cbe3c43, clientHash: 0xe1cb2ea8)] - public class NotificationService : Service - { - - } -} diff --git a/source/D3Sharp/Core/Services/PartyService.cs b/source/D3Sharp/Core/Services/PartyService.cs deleted file mode 100644 index fed74647..00000000 --- a/source/D3Sharp/Core/Services/PartyService.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.Linq; -using D3Sharp.Net; -using D3Sharp.Net.Packets; -using D3Sharp.Utils.Extensions; -using Google.ProtocolBuffers; - -namespace D3Sharp.Core.Services -{ - // bnet.protocol.party.PartyService - [Service(serviceID: 0x0D, serverHash: 0xF4E7FA35, clientHash: 0x0)] - public class PartyService : Service - { - [ServiceMethod(0x01)] - public void CreateChannel(IClient client, Packet packetIn) - { - Logger.Trace("RPC:Party:CreateChannel()"); - var request = bnet.protocol.channel.CreateChannelRequest.ParseFrom(packetIn.Payload.ToArray()); - //Logger.Debug("request:\n{0}", request.ToString()); - - var response = bnet.protocol.channel.CreateChannelResponse.CreateBuilder() - .SetObjectId(request.ObjectId) - .SetChannelId(bnet.protocol.EntityId.CreateBuilder().SetHigh(0xCCDD).SetLow(0xAABB)) - .Build(); - - var packet = new Packet( - new Header(0xfe, 0x0, packetIn.Header.RequestID, (uint)response.SerializedSize), - response.ToByteArray()); - - client.Send(packet); - } - - [ServiceMethod(0x02)] - public void JoinChannel(IClient client, Packet packetIn) - { - Logger.Trace("RPC:Party:JoinChannel() Stub"); - } - - [ServiceMethod(0x03)] - public void GetChannelInfo(IClient client, Packet packetIn) - { - Logger.Trace("RPC:Party:GetChannelInfo() Stub"); - } - } -} diff --git a/source/D3Sharp/Core/Services/PresenceService.cs b/source/D3Sharp/Core/Services/PresenceService.cs deleted file mode 100644 index 965b28d9..00000000 --- a/source/D3Sharp/Core/Services/PresenceService.cs +++ /dev/null @@ -1,38 +0,0 @@ -using D3Sharp.Net; -using D3Sharp.Net.Packets; - -namespace D3Sharp.Core.Services -{ - // bnet.protocol.presence - [Service(serviceID: 0xb, serverHash: 0xFA0796FF, clientHash: 0x0)] - public class PresenceService : Service - { - [ServiceMethod(0x1)] - public void Subscribe(IClient client, Packet packetIn) - { - Logger.Trace("RPC:Presence:Subscribe() Stub"); - // responds with NoData - } - - [ServiceMethod(0x2)] - public void Unsubscribe(IClient client, Packet packetIn) - { - Logger.Trace("RPC:Presence:Unsubscribe() Stub"); - // responds with NoData - } - - [ServiceMethod(0x3)] - public void Update(IClient client, Packet packetIn) - { - Logger.Trace("RPC:Presence:Update() Stub"); - // responds with NoData - } - - [ServiceMethod(0x4)] - public void Query(IClient client, Packet packetIn) - { - Logger.Trace("RPC:Presence:Query() Stub"); - // responds with QueryResponse - } - } -} diff --git a/source/D3Sharp/Core/Services/SearchService.cs b/source/D3Sharp/Core/Services/SearchService.cs deleted file mode 100644 index 42c5bf46..00000000 --- a/source/D3Sharp/Core/Services/SearchService.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace D3Sharp.Core.Services -{ - // bnet.protocol.search.SearchService - [Service(serviceID: 0xe, serverHash: 0x0a24a291, clientHash: 0x0)] - public class SearchService : Service - { - - } -} diff --git a/source/D3Sharp/Core/Services/Service.cs b/source/D3Sharp/Core/Services/Service.cs deleted file mode 100644 index 52380f69..00000000 --- a/source/D3Sharp/Core/Services/Service.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Reflection; -using D3Sharp.Net; -using D3Sharp.Net.Packets; -using D3Sharp.Utils; - -namespace D3Sharp.Core.Services -{ - [AttributeUsage(AttributeTargets.Class)] - public class ServiceAttribute : Attribute - { - public uint ServiceID { get; private set; } - public uint ServerHash { get; private set; } - public uint ClientHash { get; private set; } - - public ServiceAttribute(uint serviceID, uint serverHash, uint clientHash) - { - this.ServiceID = serviceID; - this.ServerHash = serverHash; - this.ClientHash = clientHash; - } - } - - [AttributeUsage(AttributeTargets.Method)] - public class ServiceMethodAttribute: Attribute - { - public byte MethodID { get; set; } - - public ServiceMethodAttribute(byte methodID) - { - this.MethodID = methodID; - } - } - - public class Service - { - public static readonly Logger Logger = LogManager.CreateLogger(); - public Dictionary Methods = new Dictionary(); - - public Service() - { - this.LoadMethods(); - } - - private void LoadMethods() - { - foreach (var methodInfo in this.GetType().GetMethods()) - { - var attribute = Attribute.GetCustomAttribute(methodInfo, typeof(ServiceMethodAttribute)); - if (attribute == null) continue; - - this.Methods.Add(((ServiceMethodAttribute)attribute).MethodID, methodInfo); - } - } - - public void CallMethod(uint methodID, IClient client, Packet packet) - { - if (!this.Methods.ContainsKey(methodID)) - { - Console.WriteLine("Unknown method 0x{0:x2} called on {1} ", methodID, this.GetType()); - return; - } - - var method = this.Methods[methodID]; - //Console.WriteLine("[Client]: {0}:{1}", method.ReflectedType.FullName, method.Name); - method.Invoke(this, new object[] {client, packet}); - } - } -} diff --git a/source/D3Sharp/Core/Services/ServiceManager.cs b/source/D3Sharp/Core/Services/ServiceManager.cs deleted file mode 100644 index 56f6a303..00000000 --- a/source/D3Sharp/Core/Services/ServiceManager.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; - -namespace D3Sharp.Core.Services -{ - public static class ServiceManager - { - public static Dictionary ProvidedServices = new Dictionary(); - public static Dictionary Services = new Dictionary(); - - static ServiceManager() - { - foreach (Type t in Assembly.GetEntryAssembly().GetTypes()) - { - if (!t.IsSubclassOf(typeof(Service))) - continue; - ReadServiceInfo(t); - } - } - - public static Service GetServerServiceByID(uint serviceID) - { - return (from pair in ProvidedServices let serviceInfo = pair.Value where serviceInfo.ServiceID == serviceID select Services[pair.Key]).FirstOrDefault(); - } - - private static uint _notImplementedServiceCounter = 99; - - public static uint GetServerServiceIDByHash(uint serviceHash) - { - foreach (var serviceInfo in ProvidedServices.Select(pair => pair.Value).Where(serviceInfo => serviceInfo.ServerHash == serviceHash)) - { - return serviceInfo.ServiceID; - } - - return _notImplementedServiceCounter++; - } - - private static void ReadServiceInfo(Type type) - { - object[] attributes = type.GetCustomAttributes(typeof(ServiceAttribute), true); // get the attributes of the packet. - if (attributes.Length == 0) return; - - ProvidedServices.Add(type, (ServiceAttribute)attributes[0]); - Services.Add(type, (Service)Activator.CreateInstance(type)); - } - } -} diff --git a/source/D3Sharp/Core/Services/StorageService.cs b/source/D3Sharp/Core/Services/StorageService.cs deleted file mode 100644 index 04f98caf..00000000 --- a/source/D3Sharp/Core/Services/StorageService.cs +++ /dev/null @@ -1,187 +0,0 @@ -using System.Linq; -using D3Sharp.Net; -using D3Sharp.Net.Packets; -using D3Sharp.Utils.Extensions; -using D3Sharp.Core.Storage; - -namespace D3Sharp.Core.Services -{ - [Service(serviceID: 0x9, serverHash: 0xDA6E4BB9, clientHash: 0x0)] - public class StorageService : Service - { - [ServiceMethod(0x2)] - public void OpenTableRequest(IClient client, Packet packetIn) - { - Logger.Trace("RPC:Storage:OpenTableRequest()"); - var response = bnet.protocol.storage.OpenTableResponse.CreateBuilder().Build(); - - var packet = new Packet( - new Header(0xfe, 0x0, packetIn.Header.RequestID, (uint)response.SerializedSize), - response.ToByteArray()); - - client.Send(packet); - } - - [ServiceMethod(0x3)] - public void OpenColumnRequest(IClient client, Packet packetIn) - { - Logger.Trace("RPC:Storage:OpenColumnRequest()"); - var response = bnet.protocol.storage.OpenColumnResponse.CreateBuilder().Build(); - - var packet = new Packet( - new Header(0xfe, 0x0, packetIn.Header.RequestID, (uint)response.SerializedSize), - response.ToByteArray()); - - client.Send(packet); - } - - [ServiceMethod(0x1)] - public void ExecuteRequest(IClient client, Packet packetIn) - { - Logger.Trace("RPC:Storage:ExecuteRequest()"); - var request = bnet.protocol.storage.ExecuteRequest.ParseFrom(packetIn.Payload.ToArray()); - //Logger.Debug("request:\n{0}", request.ToString()); - - bnet.protocol.storage.ExecuteResponse response = null; - switch (request.QueryName) - { - case "GetGameAccountSettings": - response = GameAccountSettings(request); - break; - case "LoadAccountDigest": - response = LoadAccountDigest(request); - break; - case "GetHeroDigests": - response = GetHeroDigest(request); - break; - case "GetToonSettings": - response = GetToonSettings(request); - break; - default: - Logger.Warn("Unhandled ExecuteRequest: {0}", request.QueryName); - break; - } - - var packet = new Packet( - new Header(0xfe, 0x0, packetIn.Header.RequestID, (uint)response.SerializedSize), - response.ToByteArray()); - - client.Send(packet); - } - - private bnet.protocol.storage.ExecuteResponse GetToonSettings(bnet.protocol.storage.ExecuteRequest request) - { - var builder = bnet.protocol.storage.ExecuteResponse.CreateBuilder(); - - var operationResult = bnet.protocol.storage.OperationResult.CreateBuilder() - .SetTableId(request.OperationsList[0].TableId) - .AddData( - bnet.protocol.storage.Cell.CreateBuilder() - .SetColumnId(request.OperationsList[0].ColumnId) - .SetRowId(request.OperationsList[0].RowId) - .SetVersion(1) - .Build()) - .Build(); - - builder.AddResults(operationResult); - return builder.Build(); - } - - private bnet.protocol.storage.ExecuteResponse GetHeroDigest(bnet.protocol.storage.ExecuteRequest request) - { - var op=request.OperationsList[0]; - var table_id=op.TableId; - var column_id=op.ColumnId; - var row_id=op.RowId; - - Logger.Debug("table_id.Hash:\n{0}", table_id.Hash.ToByteArray().Dump()); - Logger.Debug("column_id.Hash:\n{0}", column_id.Hash.ToByteArray().Dump()); - Logger.Debug("row_id.Hash:\n{0}", row_id.Hash.ToByteArray().Dump()); - - /*try { - var stream = CodedInputStream.CreateInstance(row_id.Hash.ToByteArray()); - stream.SkipRawBytes(2); - var tgen=bnet.protocol.toon.ToonHandle.CreateBuilder() - .SetRealm(stream.ReadRawVarint32()) - .SetRegion(stream.ReadRawVarint32()) - .SetProgram(stream.ReadUInt32()) // "D3\0\0" - .SetId(stream.ReadUInt64()) - .Build(); - Logger.Debug("generated:\n{0}", tgen.ToByteArray().Dump()); - Logger.Debug(tgen.ToString()); - //var toonhandle=bnet.protocol.toon.ToonHandle.ParseFrom(eid.ToByteArray()); - //Logger.Debug("row_id.hash as handle:\n{0}", toonhandle.ToString()); - } catch (Exception e) { - Logger.DebugException(e, "row_id"); - }*/ - var heroDigest = D3.Hero.Digest.ParseFrom(StorageManager.Tables[table_id].Rows[row_id].Cells[column_id].Data); - - var operationResult = bnet.protocol.storage.OperationResult.CreateBuilder() - .SetTableId(request.OperationsList[0].TableId) - .AddData( - bnet.protocol.storage.Cell.CreateBuilder() - .SetColumnId(request.OperationsList[0].ColumnId) - .SetRowId(request.OperationsList[0].RowId) - .SetVersion(1) - .SetData(heroDigest.ToByteString()) - .Build() - ).Build(); - - var builder = bnet.protocol.storage.ExecuteResponse.CreateBuilder(); - builder.AddResults(operationResult); - return builder.Build(); - } - - private bnet.protocol.storage.ExecuteResponse LoadAccountDigest(bnet.protocol.storage.ExecuteRequest request) - { - var builder = bnet.protocol.storage.ExecuteResponse.CreateBuilder(); - - var accountDigest = D3.Account.Digest.CreateBuilder().SetVersion(1) - .SetLastPlayedHeroId(D3.OnlineService.EntityId.CreateBuilder().SetIdHigh(0).SetIdLow(0).Build()) - .SetBannerConfiguration(D3.Account.BannerConfiguration.CreateBuilder() - .SetBackgroundColorIndex(0) - .SetBannerIndex(0) - .SetPattern(0) - .SetPatternColorIndex(0) - .SetPlacementIndex(0) - .SetSigilAccent(0) - .SetSigilMain(0) - .SetSigilColorIndex(0) - .SetUseSigilVariant(false) - .Build()) - .SetFlags(0) - .Build(); - - var operationResult = bnet.protocol.storage.OperationResult.CreateBuilder() - .SetTableId(request.OperationsList[0].TableId) - .AddData( - bnet.protocol.storage.Cell.CreateBuilder() - .SetColumnId(request.OperationsList[0].ColumnId) - .SetRowId(request.OperationsList[0].RowId) - .SetVersion(1) - .SetData(accountDigest.ToByteString()) - .Build()) - .Build(); - - builder.AddResults(operationResult); - return builder.Build(); - } - - private bnet.protocol.storage.ExecuteResponse GameAccountSettings(bnet.protocol.storage.ExecuteRequest request) - { - var builder = bnet.protocol.storage.ExecuteResponse.CreateBuilder(); - - var operationResult = bnet.protocol.storage.OperationResult.CreateBuilder() - .SetTableId(request.OperationsList[0].TableId) - .AddData( - bnet.protocol.storage.Cell.CreateBuilder() - .SetColumnId(request.OperationsList[0].ColumnId) - .SetRowId(request.OperationsList[0].RowId) - .Build()) - .Build(); - - builder.AddResults(operationResult); - return builder.Build(); - } - } -} diff --git a/source/D3Sharp/Core/Services/ToonExternalService.cs b/source/D3Sharp/Core/Services/ToonExternalService.cs deleted file mode 100644 index 5be2d8d9..00000000 --- a/source/D3Sharp/Core/Services/ToonExternalService.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System.Linq; -using System.IO; -using D3Sharp.Net; -using D3Sharp.Net.Packets; -using D3Sharp.Utils.Extensions; -using D3Sharp.Core.Storage; -using Google.ProtocolBuffers; - -namespace D3Sharp.Core.Services -{ - [Service(serviceID: 0x2, serverHash: 0x4124C31B, clientHash: 0x0)] - public class ToonExternalService : Service - { - [ServiceMethod(0x1)] - public void ToonListRequest(IClient client, Packet packetIn) - { - Logger.Trace("RPC:ToonExternal:ToonListRequest()"); - var response = bnet.protocol.toon.external.ToonListResponse.CreateBuilder().Build(); - - var packet = new Packet( - new Header(0xfe, 0x0, packetIn.Header.RequestID, (uint)response.SerializedSize), - response.ToByteArray()); - - client.Send(packet); - } - - [ServiceMethod(0x2)] - public void SelectToonRequest(IClient client, Packet packetIn) - { - Logger.Trace("RPC:ToonExternal:SelectToonRequest()"); - //var request = bnet.protocol.toon.external.SelectToonRequest.ParseFrom(packetIn.Payload.ToArray()); - var response = bnet.protocol.toon.external.SelectToonResponse.CreateBuilder().Build(); - - var packet = new Packet( - new Header(0xfe, 0x0, packetIn.Header.RequestID, (uint)response.SerializedSize), - response.ToByteArray()); - - client.Send(packet); - } - - [ServiceMethod(0x3)] - public void CreateToonRequest(IClient client, Packet packetIn) - { - Logger.Trace("RPC:ToonExternal:CreateToonRequest()"); - var request = bnet.protocol.toon.external.CreateToonRequest.ParseFrom(packetIn.Payload.ToArray()); - var hcp = D3.OnlineService.HeroCreateParams.ParseFrom(request.AttributeList[0].Value.MessageValue); - - ulong eid_high=0x0300016200004433; // ToonHandle - ulong eid_low=0xFFFFFFFFFFFFFFFF; // Actual id? - - var equipment = D3.Hero.VisualEquipment.CreateBuilder().Build(); - var heroDigest = D3.Hero.Digest.CreateBuilder().SetVersion(1) - .SetHeroId(D3.OnlineService.EntityId.CreateBuilder().SetIdHigh(eid_high).SetIdLow(eid_low).Build()) - .SetHeroName(request.Name) - .SetGbidClass(hcp.GbidClass) - .SetPlayerFlags(hcp.IsFemale ? (uint)0x2000002 : 0x00) - .SetLevel(1) - .SetVisualEquipment(equipment) - //.SetQuestHistory(0, questhistory) - .SetLastPlayedAct(0) - .SetHighestUnlockedAct(0) - .SetLastPlayedDifficulty(0) - .SetHighestUnlockedDifficulty(0) - .SetLastPlayedQuest(1) - .SetLastPlayedQuestStep(1) - .SetTimePlayed(0) - .Build(); - - // Can't seem to figure out how to get the right format for the ColumnId - var eid=/*D3.OnlineService*/bnet.protocol.EntityId.CreateBuilder().SetHigh(eid_high).SetLow(eid_low).Build(); - byte[] eid_bytes; - using (var stream = new MemoryStream()) { - var output = CodedOutputStream.CreateInstance(stream); - output.WriteUInt64NoTag(eid.High); - output.WriteUInt64NoTag(eid.Low); - output.Flush(); - eid_bytes=stream.ToArray(); - } - // In this we have the tags, which are not in the ColumnId, and eid.High is coded backwards (otherwise this would be correct) - Logger.Debug("D3OS EID bytes:\n{0}", eid.ToByteArray().Dump()); - // And in the raw format, the data for eid.High is never even close to what it should be - Logger.Debug("D3OS EID raw:\n{0}", eid_bytes.Dump()); - - // Hard coding eid as ColumnId for certain form - var colid = bnet.protocol.storage.ColumnId.CreateBuilder() - .SetHash(ByteString.CopyFrom(new byte[] {0xA1, 0x81, 0xA8, 0x35, 0x68, 0x24, 0x41, 0x60, 0x09, 0x7C, 0x05, 0x1B, 0x11, 0xA8, 0x7F, 0x04})) - .Build(); - - var cell = new Cell(colid, heroDigest.ToByteString()); - // Remove cell if it already exists - StorageManager.Tables[StorageManager.ToonTable.Id].Rows[StorageManager.CharacterRow.Id].Cells.Remove(colid); - StorageManager.Tables[StorageManager.ToonTable.Id].Rows[StorageManager.CharacterRow.Id].AddCell(cell); - - var response = bnet.protocol.toon.external.CreateToonResponse.CreateBuilder() - .SetToon(bnet.protocol.EntityId.CreateBuilder().SetHigh(eid_high).SetLow(eid_low)) - .Build(); - - var packet = new Packet( - new Header(0xfe, 0x0, packetIn.Header.RequestID, (uint)response.SerializedSize), - response.ToByteArray()); - - client.Send(packet); - } - } -} diff --git a/source/D3Sharp/Core/Services/UserManagerService.cs b/source/D3Sharp/Core/Services/UserManagerService.cs deleted file mode 100644 index c988cdeb..00000000 --- a/source/D3Sharp/Core/Services/UserManagerService.cs +++ /dev/null @@ -1,22 +0,0 @@ -using D3Sharp.Net; -using D3Sharp.Net.Packets; - -namespace D3Sharp.Core.Services -{ - [Service(serviceID: 0x5, serverHash: 0x3E19268A, clientHash: 0xBC872C22)] - public class UserManagerService : Service - { - [ServiceMethod(0x1)] - public void SubscribeToUserManager(IClient client, Packet packetIn) - { - Logger.Trace("RPC:UserManager:Subscribe()"); - var response = bnet.protocol.user_manager.SubscribeToUserManagerResponse.CreateBuilder().Build(); - - var packet = new Packet( - new Header(0xfe, 0x0, packetIn.Header.RequestID, (uint)response.SerializedSize), - response.ToByteArray()); - - client.Send(packet); - } - } -} diff --git a/source/D3Sharp/Core/Storage/StorageManager.cs b/source/D3Sharp/Core/Storage/StorageManager.cs deleted file mode 100644 index d9b0ca3a..00000000 --- a/source/D3Sharp/Core/Storage/StorageManager.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using D3Sharp.Net; -using D3Sharp.Net.Packets; -using D3Sharp.Utils; -using D3Sharp.Utils.Extensions; -using Google.ProtocolBuffers; - -namespace D3Sharp.Core.Storage -{ - public class StorageManager - { - public static Dictionary Tables { get; private set; } - public readonly object TableLock = new object(); - - // Temporary - public static Table ToonTable = new Table( - bnet.protocol.storage.TableId.CreateBuilder() - .SetHash( - ByteString.CopyFrom( - new byte[] { - 0x06, 0x8B, 0x94, 0x62, 0x64, 0x14, 0xB9, 0x4A, 0x51, 0x36, 0xFD, 0x0F, 0xA6, 0xE6, 0x6C, 0xD7 - })) - .Build()); - - // Temporary - public static Row CharacterRow = new Row( - bnet.protocol.storage.RowId.CreateBuilder() - .SetHash( - ByteString.CopyFrom( - new byte[] { - 0x03, 0x00, 0x01, 0x62, 0x00, 0x00, 0x44, 0x33, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF - })) - .Build()); - - static StorageManager() - { - Tables = new Dictionary(); - Tables[ToonTable.Id] = ToonTable; - ToonTable.Rows[CharacterRow.Id] = CharacterRow; - } - } -} - diff --git a/source/D3Sharp/Core/Storage/Table.cs b/source/D3Sharp/Core/Storage/Table.cs deleted file mode 100644 index 84430d92..00000000 --- a/source/D3Sharp/Core/Storage/Table.cs +++ /dev/null @@ -1,100 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using D3Sharp.Net; -using D3Sharp.Net.Packets; -using D3Sharp.Utils; -using D3Sharp.Utils.Extensions; -using Google.ProtocolBuffers; - -namespace D3Sharp.Core.Storage -{ - public class Table - { - public bnet.protocol.storage.TableId Id { get; private set; } - public Dictionary Rows { get; private set; } - - public Table(bnet.protocol.storage.TableId id) - { - this.Id = id; - this.Rows = new Dictionary(); - } - - public void AddRow(Row row) - { - /*if (Rows.ContainsKey(row.Id)) - { - Logger.Warn("Replacing row for ID {0}", row.Id.Hash.ToByteArray().ToString()); - }*/ - Rows.Add(row.Id, row); - } - - public bnet.protocol.storage.Cell SerializeCell(bnet.protocol.storage.RowId row_id, bnet.protocol.storage.ColumnId column_id) - { - return Rows[row_id].SerializeCell(column_id); - } - } - - public class Row - { - public bnet.protocol.storage.RowId Id { get; private set; } - public Dictionary Cells { get; private set; } - - public Row(bnet.protocol.storage.RowId id) - { - this.Id = id; - this.Cells = new Dictionary(); - } - - public void AddCell(Cell cell) - { - /*if (Cells.ContainsKey(cell.Id)) - { - Logger.Warn("Replacing cell for ID {0}", cell.Id.Hash.ToByteArray().ToString()); - }*/ - Cells.Add(cell.Id, cell); - } - - public bnet.protocol.storage.Cell SerializeCell(bnet.protocol.storage.ColumnId id) - { - var cell = Cells[id]; - var builder=bnet.protocol.storage.Cell.CreateBuilder(); - builder.SetRowId(Id); - cell.Serialize(builder); - // optional bytes row_key - // optional fixed64 version - return builder.Build(); - } - } - - public class Cell - { - public bnet.protocol.storage.ColumnId Id { get; private set; } - public ByteString Data { get; set; } - - public Cell(bnet.protocol.storage.ColumnId id, ByteString data) - { - this.Id = id; - this.Data = data; - } - - public Cell ParseFrom(bnet.protocol.storage.Cell cell) - { - this.Id = cell.ColumnId; - this.Data = cell.Data; - return this; - } - - public bnet.protocol.storage.Cell.Builder Serialize(bnet.protocol.storage.Cell.Builder builder) - { - builder.SetColumnId(Id); - if (Data!=null) - builder.SetData(Data); - else - builder.ClearData(); - return builder; - } - } -} - diff --git a/source/D3Sharp/D3Sharp.csproj b/source/D3Sharp/D3Sharp.csproj deleted file mode 100644 index d0b0aebb..00000000 --- a/source/D3Sharp/D3Sharp.csproj +++ /dev/null @@ -1,133 +0,0 @@ - - - - Debug - x86 - 9.0.21022 - 2.0 - {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD} - Exe - D3Sharp - D3Sharp - v4.0 - - - 3.5 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - false - bin\Debug - DEBUG - prompt - 4 - x86 - true - AllRules.ruleset - - - none - false - bin\Release - prompt - 4 - x86 - true - AllRules.ruleset - - - - - - - - - ..\libs\Google.ProtocolBuffers.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - {4CC19847-6F24-4453-9E31-126F94308AB9} - D3Proto - - - \ No newline at end of file diff --git a/source/D3Sharp/Net/Client.cs b/source/D3Sharp/Net/Client.cs deleted file mode 100644 index f06633ec..00000000 --- a/source/D3Sharp/Net/Client.cs +++ /dev/null @@ -1,128 +0,0 @@ -using System; -using System.Linq; -using System.Collections.Generic; -using System.Net; -using System.Net.Sockets; -using D3Sharp.Net.Packets; - -namespace D3Sharp.Net -{ - public sealed class Client : IClient - { - private readonly Server _server; - private readonly Socket _socket; - private readonly byte[] _recvBuffer = new byte[BufferSize]; - public static readonly int BufferSize = 16*1024; // 16 KB - - public Dictionary Services { get; private set; } - - public bool IsConnected - { - get { return _socket.Connected; } - } - - public IPEndPoint RemoteEndPoint - { - get { return _socket.RemoteEndPoint as IPEndPoint; } - } - - public IPEndPoint LocalEndPoint - { - get { return _socket.LocalEndPoint as IPEndPoint; } - } - - public byte[] RecvBuffer - { - get { return _recvBuffer; } - } - - public Socket Socket - { - get { return _socket; } - } - - public Client(Server server, Socket socket) - { - if (server == null) throw new ArgumentNullException("server"); - if (socket == null) throw new ArgumentNullException("socket"); - - this._server = server; - this._socket = socket; - this.Services = new Dictionary(); - } - - #region recv-methods - - public IAsyncResult BeginReceive(AsyncCallback callback, object state) - { - return _socket.BeginReceive(_recvBuffer, 0, BufferSize, SocketFlags.None, callback, state); - } - - public int EndReceive(IAsyncResult result) - { - return _socket.EndReceive(result); - } - - #endregion - - #region send methods - - public int Send(Packet packet) - { - if (packet == null) throw new ArgumentNullException("packet"); - return Send(packet.GetRawPacketData()); - } - - public int Send(IEnumerable data) - { - if (data == null) throw new ArgumentNullException("data"); - return Send(data, SocketFlags.None); - } - - public int Send(IEnumerable data, SocketFlags flags) - { - if (data == null) throw new ArgumentNullException("data"); - return _server.Send(this, data, flags); - } - - public int Send(byte[] buffer) - { - if (buffer == null) throw new ArgumentNullException("buffer"); - return Send(buffer, 0, buffer.Length, SocketFlags.None); - } - - public int Send(byte[] buffer, SocketFlags flags) - { - if (buffer == null) throw new ArgumentNullException("buffer"); - return Send(buffer, 0, buffer.Length, flags); - } - - public int Send(byte[] buffer, int start, int count) - { - if (buffer == null) throw new ArgumentNullException("buffer"); - return Send(buffer, start, count, SocketFlags.None); - } - - public int Send(byte[] buffer, int start, int count, SocketFlags flags) - { - if (buffer == null) throw new ArgumentNullException("buffer"); - return _server.Send(this, buffer, start, count, flags); - } - - #endregion - - public void Disconnect() - { - if (this.IsConnected) - _server.Disconnect(this); - } - - public override string ToString() - { - if (_socket.RemoteEndPoint != null) - return _socket.RemoteEndPoint.ToString(); - else - return "Not Connected"; - } - } -} diff --git a/source/D3Sharp/Net/ClientDataEventArgs.cs b/source/D3Sharp/Net/ClientDataEventArgs.cs deleted file mode 100644 index 541adc68..00000000 --- a/source/D3Sharp/Net/ClientDataEventArgs.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Collections.Generic; -using System.Linq; - -namespace D3Sharp.Net -{ - public sealed class ClientDataEventArgs : ClientEventArgs - { - public IEnumerable Data { get; private set; } - - public ClientDataEventArgs(IClient client, IEnumerable data) - : base(client) - { - this.Data = data ?? new byte[0]; - } - - public override string ToString() - { - return Client.RemoteEndPoint != null - ? string.Format("{0}: {1} bytes", Client.RemoteEndPoint, Data.Count()) - : string.Format("Not Connected: {0} bytes", Data.Count()); - } - } -} - diff --git a/source/D3Sharp/Net/ClientEventArgs.cs b/source/D3Sharp/Net/ClientEventArgs.cs deleted file mode 100644 index 5db51137..00000000 --- a/source/D3Sharp/Net/ClientEventArgs.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; - -namespace D3Sharp.Net -{ - public class ClientEventArgs : EventArgs - { - public IClient Client { get; private set; } - - public ClientEventArgs(IClient connection) - { - if (connection == null) - throw new ArgumentNullException("connection"); - this.Client = connection; - } - - public override string ToString() - { - return Client.RemoteEndPoint != null - ? Client.RemoteEndPoint.ToString() - : "Not Connected"; - } - } -} - diff --git a/source/D3Sharp/Net/IClient.cs b/source/D3Sharp/Net/IClient.cs deleted file mode 100644 index e6d9ee4b..00000000 --- a/source/D3Sharp/Net/IClient.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Collections.Generic; -using System.Net; -using System.Net.Sockets; -using D3Sharp.Net.Packets; - -namespace D3Sharp.Net -{ - public interface IClient - { - bool IsConnected { get; } - IPEndPoint RemoteEndPoint { get; } - IPEndPoint LocalEndPoint { get; } - - Dictionary Services { get; } - - int Send(Packet packet); - int Send(IEnumerable data); - int Send(IEnumerable data, SocketFlags flags); - int Send(byte[] buffer); - int Send(byte[] buffer, SocketFlags flags); - int Send(byte[] buffer, int start, int count); - int Send(byte[] buffer, int start, int count, SocketFlags flags); - - void Disconnect(); - } -} - diff --git a/source/D3Sharp/Net/Packets/Header.cs b/source/D3Sharp/Net/Packets/Header.cs deleted file mode 100644 index 3abc1900..00000000 --- a/source/D3Sharp/Net/Packets/Header.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using Google.ProtocolBuffers; - -namespace D3Sharp.Net.Packets -{ - public class Header - { - public byte[] Data { get; private set; } - - public byte ServiceID { get; set; } - public uint MethodID { get; set; } - public int RequestID { get; set; } - public ulong Unknown { get; set; } - public uint PayloadLength { get; set; } - - public Header() - { - this.Unknown = 0x00; - this.PayloadLength = 0x00; - } - - public Header(byte[] data) - { - this.Data = data; - - var stream = CodedInputStream.CreateInstance(data); - this.ServiceID = stream.ReadRawByte(); - this.MethodID = stream.ReadRawVarint32(); - this.RequestID = stream.ReadRawByte() | (stream.ReadRawByte() << 8); - if (ServiceID != 0xfe) this.Unknown = stream.ReadRawVarint64(); - this.PayloadLength = stream.ReadRawVarint32(); - } - - public Header(byte serviceID, uint methodId, int requestID, uint payloadLenght) - { - this.ServiceID = serviceID; - this.MethodID = methodId; - this.RequestID = requestID; - this.Unknown = 0x0; - this.PayloadLength = payloadLenght; - - this.Data = this.ServiceID != 0xfe ? new byte[6] : new byte[5]; - - using (var stream = new MemoryStream()) - { - var output = CodedOutputStream.CreateInstance(stream); - output.WriteRawByte(this.ServiceID); - output.WriteRawVarint32(this.MethodID); - output.WriteRawByte((byte) (this.RequestID & 0xff)); - output.WriteRawByte((byte) (this.RequestID >> 8)); - if (serviceID != 0xfe) output.WriteRawVarint64(this.Unknown); - output.WriteRawVarint32(this.PayloadLength); - output.Flush(); - - this.Data = stream.ToArray(); - } - } - - - public Header(IEnumerable data) - : this(data.ToArray()) - { - } - - public void Build() - { - //var stream = CodedOutputStream.CreateInstance(this.Data); - //stream.WriteRawByte(this.Service); - //stream.WriteRawVarint32(this.Method); - //stream.WriteRawByte((byte) this.RequestID); - //if (ServiceID != 0xfe) - //stream.WriteRawVarint64(this.Unknown); - //stream.WriteRawVarint32(this.PayloadLength); - } - - public override string ToString() - { - return string.Format("[S]: 0x{0}, [M]: 0x{1}, [R]: 0x{2}, [L]: 0x{3}", this.ServiceID.ToString("X2"), this.MethodID.ToString("X2"), this.RequestID.ToString("X2"), this.PayloadLength.ToString("X2")); - } - } -} diff --git a/source/D3Sharp/Net/Packets/Packet.cs b/source/D3Sharp/Net/Packets/Packet.cs deleted file mode 100644 index 7df5345e..00000000 --- a/source/D3Sharp/Net/Packets/Packet.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using D3Sharp.Utils.Extensions; - -namespace D3Sharp.Net.Packets -{ - public class Packet - { - public Header Header { get; protected set; } - public IEnumerable Payload { get; set; } - - public Packet(Header header, byte[] payload) - { - this.Header = header; - this.Payload = payload; - } - - public int Lenght - { - get { return this.Header.Data.Length + this.Payload.ToArray().Length; } - } - - public byte[] GetRawPacketData() - { - return this.Header.Data.Append(this.Payload.ToArray()); - } - - public override string ToString() - { - return - string.Format( - "Header\t: {0}\nData\t: {1}- {2}", - this.Header, - this.Header.Data.HexDump(), - this.Payload.HexDump() - ); - } - } -} diff --git a/source/D3Sharp/Net/Packets/PacketRouter.cs b/source/D3Sharp/Net/Packets/PacketRouter.cs deleted file mode 100644 index 8491ae8f..00000000 --- a/source/D3Sharp/Net/Packets/PacketRouter.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using D3Sharp.Core.Services; -using D3Sharp.Utils.Extensions; - -namespace D3Sharp.Net.Packets -{ - public static class PacketRouter - { - public static void Route(ClientDataEventArgs e) - { - var buffer = e.Data.ToArray(); - // handle data as a stream -- a single packet can contain multiple messages - while (buffer.Length > 0) - { - var bytesConsumed = Identify(e.Client, buffer); - if (bytesConsumed <= 0) - return; - - var bytesLeft=buffer.Length - bytesConsumed; - var tmp = new byte[bytesLeft]; - Array.Copy(buffer, bytesConsumed, tmp, 0, bytesLeft); - buffer = tmp; - } - } - - public static int Identify(IClient client, byte[] buffer) - { - var header = new Header(buffer.Take(6)); - var payload = new byte[header.PayloadLength]; - // if our packet contains a payload, get it. - if (header.PayloadLength > 0) - Array.Copy(buffer, 6, payload, 0, header.PayloadLength); - - - var packet = new Packet(header, payload); - var service = ServiceManager.GetServerServiceByID(header.ServiceID); - - if(service!=null) - { - service.CallMethod(header.MethodID, client, packet); - return packet.Lenght; - } - - Console.WriteLine("\n===========[Unknown Crap]===========\nHeader\t: {0}Payload\t: {1}", header.Data.Dump(), payload.Dump()); - return 0; - } - } -} diff --git a/source/D3Sharp/Net/Server.cs b/source/D3Sharp/Net/Server.cs deleted file mode 100644 index 01424253..00000000 --- a/source/D3Sharp/Net/Server.cs +++ /dev/null @@ -1,272 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Net.Sockets; -using D3Sharp.Core.Storage; -using D3Sharp.Utils; -using D3Sharp.Utils.Extensions; - -namespace D3Sharp.Net -{ - public class Server : IDisposable - { - public bool IsListening { get; private set; } - public int Port { get; private set; } - - protected Socket Listener; - protected Dictionary Connections = new Dictionary(); - protected object ConnectionLock = new object(); - - public delegate void ConnectionEventHandler(object sender, ClientEventArgs e); - public delegate void ConnectionDataEventHandler(object sender, ClientDataEventArgs e); - - public event ConnectionEventHandler ClientConnected; - public event ConnectionEventHandler ClientDisconnected; - public event ConnectionDataEventHandler DataReceived; - public event ConnectionDataEventHandler DataSent; - - private static readonly Logger Logger = LogManager.CreateLogger(); - private bool _disposed; - - #region listener - - public virtual void Listen(int port) - { - // Check if the server has been disposed. - if (_disposed) throw new ObjectDisposedException(this.GetType().Name, "Server has been disposed."); - - // Check if the server is already listening. - if (IsListening) throw new InvalidOperationException("Server is already listening."); - - // Create new TCP socket and set socket options. - Listener = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); - try { - // This is failing on Linux; dunno why. - Listener.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.NoDelay, true); - } catch (SocketException e) { - Logger.DebugException(e, "Listen"); - } - Listener.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.DontLinger, true); - - // Bind. - Listener.Bind(new IPEndPoint(IPAddress.Any, port)); - this.Port = port; - - // Start listening for incoming connections. - Listener.Listen(10); - IsListening = true; - - // Begin accepting any incoming connections asynchronously. - Listener.BeginAccept(AcceptCallback, null); - } - - private void AcceptCallback(IAsyncResult result) - { - try - { - var socket = Listener.EndAccept(result); // Finish accepting the incoming client. - var connection = new Client(this, socket); // Add the new connection to the dictionary. - - lock (ConnectionLock) Connections[socket] = connection; // add the client to list. - - OnClientConnection(new ClientEventArgs(connection)); // Raise the ClientConnected event. - - connection.BeginReceive(ReceiveCallback, connection); // Begin receiving on the new client connection. - Listener.BeginAccept(AcceptCallback, null); // Continue receiving other incoming clients asynchronously. - } - catch (Exception e) - { - Logger.DebugException(e, "AcceptCallback"); - } - } - - private void ReceiveCallback(IAsyncResult result) - { - var connection = result.AsyncState as Client; // Get the client connection passed to the callback. - if (connection == null) return; - - try - { - var bytesRecv = connection.EndReceive(result); // Finish receiving data from the socket. - - if (bytesRecv > 0) - { - OnDataReceived(new ClientDataEventArgs(connection, connection.RecvBuffer.Enumerate(0, bytesRecv))); // Raise the DataReceived event. - - if (connection.IsConnected) connection.BeginReceive(ReceiveCallback, connection); // Begin receiving again on the socket, if it is connected. - else RemoveConnection(connection, true); // else remove it from client list. - } - else RemoveConnection(connection, true); // Connection was lost. - } - catch (SocketException) - { - RemoveConnection(connection, true); // An error occured while receiving, client has disconnected. - } - catch (Exception e) - { - Logger.DebugException(e, "ReceiveCallback"); - } - } - - public virtual int Send(Client connection, IEnumerable data, SocketFlags flags) - { - if (connection == null) throw new ArgumentNullException("connection"); - if (data == null) throw new ArgumentNullException("data"); - - var buffer = data.ToArray(); - return Send(connection, buffer, 0, buffer.Length, SocketFlags.None); - } - - public virtual int Send(Client connection, byte[] buffer, int start, int count, SocketFlags flags) - { - if (connection == null) throw new ArgumentNullException("connection"); - if (buffer == null) throw new ArgumentNullException("buffer"); - - var totalBytesSent = 0; - var bytesRemaining = buffer.Length; - - try - { - while (bytesRemaining > 0) // Ensure we send every byte. - { - var bytesSent = connection.Socket.Send(buffer, totalBytesSent, bytesRemaining, flags); // Send the remaining data. - if (bytesSent > 0) - OnDataSent(new ClientDataEventArgs(connection, buffer.Enumerate(totalBytesSent, bytesSent))); // Raise the Data Sent event. - - // Decrement bytes remaining and increment bytes sent. - bytesRemaining -= bytesSent; - totalBytesSent += bytesSent; - } - } - catch (SocketException) - { - RemoveConnection(connection, true); // An error occured while sending, client has disconnected. - } - catch (Exception e) - { - Logger.DebugException(e, "Send"); - } - - return totalBytesSent; - } - - #endregion - - #region service methods - - public IEnumerable GetClients() - { - lock (ConnectionLock) - foreach (IClient client in Connections.Values) - yield return client; - } - - #endregion - - #region events - - protected virtual void OnClientConnection(ClientEventArgs e) - { - var handler = ClientConnected; - if (handler != null) handler(this, e); - } - - protected virtual void OnClientDisconnect(ClientEventArgs e) - { - var handler = ClientDisconnected; - if (handler != null) handler(this, e); - } - - protected virtual void OnDataReceived(ClientDataEventArgs e) - { - var handler = DataReceived; - if (handler != null) handler(this, e); - } - - protected virtual void OnDataSent(ClientDataEventArgs e) - { - var handler = DataSent; - if (handler != null) handler(this, e); - } - - #endregion - - #region disconnect & shutdown handlers - - public virtual void DisconnectAll() - { - lock (ConnectionLock) - { - foreach (var connection in Connections.Values.Cast().Where(client => client.IsConnected)) // Check if the client is connected. - { - // Disconnect and raise the ClientDisconnected event. - connection.Socket.Disconnect(false); - OnClientDisconnect(new ClientEventArgs(connection)); - } - - Connections.Clear(); - } - } - - public virtual void Disconnect(Client connection) - { - if (connection == null) throw new ArgumentNullException("connection"); - if (!connection.IsConnected) return; - - connection.Socket.Disconnect(false); - RemoveConnection(connection, true); - } - - private void RemoveConnection(Client connection, bool raiseEvent) - { - // Remove the connection from the dictionary and raise the OnDisconnection event. - lock (ConnectionLock) - if (Connections.Remove(connection.Socket) && raiseEvent) - OnClientDisconnect(new ClientEventArgs(connection)); - } - - public virtual void Shutdown() - { - // Check if the server has been disposed. - if (_disposed) throw new ObjectDisposedException(this.GetType().Name, "Server has been disposed."); - - // Check if the server is actually listening. - if (!IsListening) return; - - // Close the listener socket. - if (Listener != null) Listener.Close(); - - Listener = null; - IsListening = false; - } - - #endregion - - #region de-ctor - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - protected virtual void Dispose(bool disposing) - { - if (_disposed) return; - - if (disposing) - { - Shutdown(); // Close the listener socket. - DisconnectAll(); // Disconnect all users. - } - - // Dispose of unmanaged resources here. - - _disposed = true; - } - - #endregion - } -} - diff --git a/source/D3Sharp/Program.cs b/source/D3Sharp/Program.cs deleted file mode 100644 index c04132e4..00000000 --- a/source/D3Sharp/Program.cs +++ /dev/null @@ -1,89 +0,0 @@ -using System; -using System.Reflection; -using D3Sharp.Net; -using D3Sharp.Net.Packets; -using D3Sharp.Utils; - -namespace D3Sharp -{ - internal class Program - { - private static readonly Logger Logger = LogManager.CreateLogger(); - - private int _port; - private Server _server; - - public static void Main(string[] args) - { - AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler; // watch for unhandled-exceptions. - - LogManager.Enabled = true; // enable the logger. - LogManager.AttachLogTarget(new ConsoleTarget(Level.Trace)); // attach a console-target. - - Logger.Info("d3sharp v{0} warming-up..", Assembly.GetExecutingAssembly().GetName().Version); - - var main = new Program(); // startup. - main.ParseArguments(args); - main.Run(); - } - - Program() { - this._port=1345; - } - - public void ParseArguments(string[] args) { - // Temp code - if (args.Length>0) { - int port; - if (!Int32.TryParse(args[0], out port)) - Logger.Warn("Invalid format for port; defaulting to {0}", _port); - else - _port=port; - } - } - - public void Run() - { - using (_server = new Server()) // Create new test server. - { - InitializeServerEvents(); // Initializes server events for debug output. - - // we can't listen for port 1119 because D3 and the launcher (agent) communicates on that port through loopback. - // so we change our default port and start D3 with a shortcut like so: - // "F:\Diablo III Beta\Diablo III.exe" -launch -auroraaddress 127.0.0.1:1345 - _server.Listen(_port); - Logger.Info("Server is listening on port {0}...", _server.Port.ToString()); - - // Read user input indefinitely. - while (_server.IsListening) - { - var line = Console.ReadLine(); - if (!string.Equals("quit", line, StringComparison.OrdinalIgnoreCase) - && !string.Equals("exit", line, StringComparison.OrdinalIgnoreCase)) - { - continue; - } - Logger.Info("Shutting down server..."); - _server.Shutdown(); - } - } - } - - private void InitializeServerEvents() - { - _server.ClientConnected += (sender, e) => Logger.Trace("Client connected: {0}", e.Client.ToString()); - _server.ClientDisconnected += (sender, e) => Logger.Trace("Client disconnected: {0}", e.Client.ToString()); - _server.DataReceived += (sender, e) => PacketRouter.Route(e); - _server.DataSent += (sender, e) => { }; - } - - private static void UnhandledExceptionHandler(object sender, UnhandledExceptionEventArgs e) - { - if (e.IsTerminating) - Logger.FatalException((e.ExceptionObject as Exception), "Application terminating because of unhandled exception."); - else - Logger.ErrorException((e.ExceptionObject as Exception), "Caught unhandled exception."); - Console.ReadLine(); - } - } -} diff --git a/source/D3Sharp/Properties/AssemblyInfo.cs b/source/D3Sharp/Properties/AssemblyInfo.cs deleted file mode 100644 index 9bcbfda0..00000000 --- a/source/D3Sharp/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. - -[assembly: AssemblyTitle("D3Sharp")] -[assembly: AssemblyDescription("Diablo 3 Server Emulator")] -#if DEBUG -[assembly: AssemblyConfiguration("Debug")] -#else -[assembly: AssemblyConfiguration("Release")] -#endif -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("2011")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. - -[assembly: AssemblyVersion("0.0.*")] - -// The following attributes are used to specify the signing key for the assembly, -// if desired. See the Mono documentation for more information about signing. - -//[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] - diff --git a/source/D3Sharp/Utils/Extensions/ArrayExtensions.cs b/source/D3Sharp/Utils/Extensions/ArrayExtensions.cs deleted file mode 100644 index 3639101d..00000000 --- a/source/D3Sharp/Utils/Extensions/ArrayExtensions.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Text; -using System.Collections.Generic; -using System.Linq; - -namespace D3Sharp.Utils.Extensions -{ - public static class ArrayExtensions - { - public static IEnumerable EnumerateFrom(this T[] array, int start) - { - if (array == null) - throw new ArgumentNullException("array"); - - return Enumerate(array, start, array.Length); - } - - public static IEnumerable Enumerate(this T[] array, int start, int count) - { - if (array == null) - throw new ArgumentNullException("array"); - - for (int i = 0; i < count; i++) - yield return array[start + i]; - } - - public static byte[] Append(this byte[] a, byte[] b) - { - var result = new byte[a.Length + b.Length]; - - a.CopyTo(result, 0); - b.CopyTo(result, a.Length); - - return result; - } - - public static string Dump(this byte[] array) - { - return EnumerableExtensions.Dump(array); - } - } -} - diff --git a/source/D3Sharp/Utils/Extensions/DateTimeExtensions.cs b/source/D3Sharp/Utils/Extensions/DateTimeExtensions.cs deleted file mode 100644 index e048f9dc..00000000 --- a/source/D3Sharp/Utils/Extensions/DateTimeExtensions.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace D3Sharp.Utils.Extensions -{ - public static class DateTimeExtensions - { - public static uint ToUnixTime(this DateTime time) - { - return (uint)((time.ToUniversalTime().Ticks - 621355968000000000L) / 10000000L); - } - } -} diff --git a/source/D3Sharp/Utils/Extensions/EnumerableExtensions.cs b/source/D3Sharp/Utils/Extensions/EnumerableExtensions.cs deleted file mode 100644 index ea687552..00000000 --- a/source/D3Sharp/Utils/Extensions/EnumerableExtensions.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace D3Sharp.Utils.Extensions -{ - public static class EnumerableExtensions - { - public static string HexDump(this IEnumerable collection) - { - var sb = new StringBuilder(); - foreach (byte value in collection) - { - sb.Append(value.ToString("X2")); - sb.Append(' '); - } - return sb.ToString(); - } - - public static string ToEncodedString(this IEnumerable collection, Encoding encoding) - { - return encoding.GetString(collection.ToArray()); - } - - public static string Dump(this IEnumerable collection) - { - var output=new StringBuilder(); - var hex=new StringBuilder(); - var text=new StringBuilder(); - int i=0; - foreach (byte value in collection) { - if (i>0 && ((i%16)==0)) { - output.Append(hex); - output.Append(' '); - output.Append(text); - output.Append(Environment.NewLine); - hex.Clear(); text.Clear(); - } - hex.Append(value.ToString("X2")); - hex.Append(' '); - text.Append(string.Format("{0}", (char.IsWhiteSpace((char)value) && (char)value != ' ') ? '.' : (char)value)); // prettify text - ++i; - } - var hexstring=hex.ToString(); - if (text.Length<16) { - hexstring=hexstring.PadRight(48); // pad the hex representation in-case it's smaller than a regular 16 value line. - } - output.Append(hexstring); - output.Append(' '); - output.Append(text); - output.Append(Environment.NewLine); - return output.ToString(); - } - } -} - diff --git a/source/D3Sharp/Utils/TinyLogger.cs b/source/D3Sharp/Utils/TinyLogger.cs deleted file mode 100644 index 2e8dc294..00000000 --- a/source/D3Sharp/Utils/TinyLogger.cs +++ /dev/null @@ -1,248 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Text; -using D3Sharp.Utils.win32; - -namespace D3Sharp.Utils -{ - public enum Level - { - Trace, - Debug, - Info, - Warn, - Error, - Fatal, - } - - public static class LogManager - { - public static bool Enabled { get; set; } - - internal readonly static List Targets = new List(); - internal static readonly Dictionary Loggers = new Dictionary(); - - public static void AttachLogTarget(Target target) - { - Targets.Add(target); - } - - public static Logger CreateLogger() - { - var frame = new StackFrame(1, false); - var name = frame.GetMethod().DeclaringType.Name; - if (name == null) throw new Exception("Error getting full name for declaring type."); - if (!Loggers.ContainsKey(name)) Loggers.Add(name, new Logger(name)); - return Loggers[name]; - } - - public static Logger CreateLogger(string name) - { - if (!Loggers.ContainsKey(name)) Loggers.Add(name, new Logger(name)); - return Loggers[name]; - } - } - - internal static class LogRouter - { - public static void RouteMessage(Level level, string logger, string message) - { - if (!LogManager.Enabled) return; - if (LogManager.Targets.Count == 0) return; - - foreach (var target in LogManager.Targets.Where(target => level >= target.MinimumLevel)) - { - target.LogMessage(level, logger, message); - } - } - - public static void RouteException(Level level, string logger, string message, Exception exception) - { - if (!LogManager.Enabled) return; - if (LogManager.Targets.Count == 0) return; - - foreach (var target in LogManager.Targets.Where(target => level >= target.MinimumLevel)) - { - target.LogException(level, logger, message, exception); - } - } - } - - public class Logger - { - public string Name { get; protected set; } - - public Logger(string name) - { - Name = name; - } - - private void Log(Level level, string message, object[] args) - { - LogRouter.RouteMessage(level, this.Name, args == null ? message : string.Format(CultureInfo.InvariantCulture, message, args)); - } - - private void LogException(Level level, string message, object[] args, Exception exception) - { - LogRouter.RouteException(level, this.Name, args == null ? message : string.Format(CultureInfo.InvariantCulture, message, args), exception); - } - - public void Trace(string message) { Log(Level.Trace, message, null); } - public void Trace(string message, params object[] args) { Log(Level.Trace, message, args); } - - public void Debug(string message) { Log(Level.Debug, message, null); } - public void Debug(string message, params object[] args) { Log(Level.Debug, message, args); } - - public void Info(string message) { Log(Level.Info, message, null); } - public void Info(string message, params object[] args) { Log(Level.Info, message, args); } - - public void Warn(string message) { Log(Level.Warn, message, null); } - public void Warn(string message, params object[] args) { Log(Level.Warn, message, args); } - - public void Error(string message) { Log(Level.Error, message, null); } - public void Error(string message, params object[] args) { Log(Level.Error, message, args); } - - public void Fatal(string message) { Log(Level.Fatal, message, null); } - public void Fatal(string message, params object[] args) { Log(Level.Fatal, message, args); } - - public void TraceException(Exception exception, string message) { LogException(Level.Trace, message, null, exception); } - public void TraceException(Exception exception, string message, params object[] args) { LogException(Level.Trace, message, args, exception); } - - public void DebugException(Exception exception, string message) { LogException(Level.Debug, message, null, exception); } - public void DebugException(Exception exception, string message, params object[] args) { LogException(Level.Debug, message, args, exception); } - - public void InfoException(Exception exception, string message) { LogException(Level.Info, message, null, exception); } - public void InfoException(Exception exception, string message, params object[] args) { LogException(Level.Info, message, args, exception); } - - public void WarnException(Exception exception, string message) { LogException(Level.Warn, message, null, exception); } - public void WarnException(Exception exception, string message, params object[] args) { LogException(Level.Warn, message, args, exception); } - - public void ErrorException(Exception exception, string message) { LogException(Level.Error, message, null, exception); } - public void ErrorException(Exception exception, string message, params object[] args) { LogException(Level.Error, message, args, exception); } - - public void FatalException(Exception exception, string message) { LogException(Level.Fatal, message, null, exception); } - public void FatalException(Exception exception, string message, params object[] args) { LogException(Level.Fatal, message, args, exception); } - } - - public class Target - { - public Level MinimumLevel { get; protected set; } - public virtual void LogMessage(Level level, string logger, string message) { throw new NotSupportedException(); } - public virtual void LogException(Level level, string logger, string message, Exception exception) { throw new NotSupportedException(); } - } - - public class FileTarget : Target, IDisposable - { - private readonly string _filePath; - - private FileStream _fileStream; - private StreamWriter _logStream; - - public FileTarget(Level minLevel, string filePath) - { - MinimumLevel = minLevel; - _filePath = filePath; - this._fileStream = new FileStream(_filePath, FileMode.Append, FileAccess.Write); - this._logStream = new StreamWriter(this._fileStream); - this._logStream.AutoFlush = true; - } - - public override void LogMessage(Level level, string logger, string message) - { - this._logStream.WriteLine(string.Format("[{0}] [{1}]: {2}", level.ToString().PadLeft(5), logger, message)); - } - - public override void LogException(Level level, string logger, string message, Exception exception) - { - this._logStream.WriteLine(string.Format("[{0}] [{1}]: {2} - [Exception] {3}", level.ToString().PadLeft(5), logger, message, exception)); - } - - #region de-ctor - - // IDisposable pattern: http://msdn.microsoft.com/en-us/library/fs2xkftw%28VS.80%29.aspx - - private bool _disposed = false; - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); // Take object out the finalization queue to prevent finalization code for it from executing a second time. - } - - private void Dispose(bool disposing) - { - if (this._disposed) return; // if already disposed, just return - - if (disposing) // only dispose managed resources if we're called from directly or in-directly from user code. - { - this._logStream.Close(); - this._logStream.Dispose(); - this._fileStream.Close(); - this._fileStream.Dispose(); - } - - this._logStream = null; - this._fileStream = null; - - _disposed = true; - } - - ~FileTarget() { Dispose(false); } // finalizer called by the runtime. we should only dispose unmanaged objects and should NOT reference managed ones. - - #endregion - } - - public class ConsoleTarget : Target - { - // Win32 API constants. - private const int StdOutputHandle = -11; - private const int CodePage = 437; - - public ConsoleTarget(Level minLevel, bool initConsole = false) - { - MinimumLevel = minLevel; - // if (initConsole) InitConsole(); TODO: Make sure only get compiled in win32 - } - - // TODO: Make sure only get compiled in win32 - /*private static void InitConsole() // binds a new console window to a windowed application. - { - NativeMethods.AllocConsole(); // allocate a new console window. - var stdHandle = NativeMethods.GetStdHandle(StdOutputHandle); // the stdout handle. - var safeFileHandle = new Microsoft.Win32.SafeHandles.SafeFileHandle(stdHandle, true); - var fileStream = new FileStream(safeFileHandle, FileAccess.Write); - var encoding = Encoding.GetEncoding(CodePage); - var standardOutput = new StreamWriter(fileStream, encoding) { AutoFlush = true }; - Console.SetOut(standardOutput); // set console's output stream to stdout. - }*/ - - public override void LogMessage(Level level, string logger, string message) - { - SetForeGroundColor(level); - Console.WriteLine(string.Format("[{0}] [{1}]: {2}", level.ToString().PadLeft(5), logger, message)); - } - - public override void LogException(Level level, string logger, string message, Exception exception) - { - SetForeGroundColor(level); - Console.WriteLine(string.Format("[{0}] [{1}]: {2} - [Exception] {3}", level.ToString().PadLeft(5), logger, message, exception)); - } - - private static void SetForeGroundColor(Level level) - { - switch (level) - { - case Level.Trace: Console.ForegroundColor = ConsoleColor.Gray; break; - case Level.Debug: Console.ForegroundColor = ConsoleColor.DarkGray; break; - case Level.Info: Console.ForegroundColor = ConsoleColor.DarkYellow; break; - case Level.Warn: Console.ForegroundColor = ConsoleColor.Yellow; break; - case Level.Error: Console.ForegroundColor = ConsoleColor.Red; break; - case Level.Fatal: Console.ForegroundColor = ConsoleColor.DarkRed; break; - default: break; - } - } - } -} diff --git a/source/D3Sharp/Utils/win32/NativeMethods.cs b/source/D3Sharp/Utils/win32/NativeMethods.cs deleted file mode 100644 index 6fe312ac..00000000 --- a/source/D3Sharp/Utils/win32/NativeMethods.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace D3Sharp.Utils.win32 -{ - internal static class NativeMethods - { - /* Win32 API entries; GetStdHandle() and AllocConsole() allows a windowed application to bind a console window */ - [DllImport("kernel32.dll", EntryPoint = "GetStdHandle", SetLastError = true, CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)] - internal static extern IntPtr GetStdHandle(int nStdHandle); - - [DllImport("kernel32.dll", EntryPoint = "AllocConsole", SetLastError = true, CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)] - internal static extern int AllocConsole(); - } -} diff --git a/source/ProtoStringFixer/.gitignore b/source/ProtoStringFixer/.gitignore deleted file mode 100644 index cc0bb574..00000000 --- a/source/ProtoStringFixer/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -bin/ -obj/ -D3Sharp.pidb diff --git a/source/ProtoStringFixer/src/Main.cs b/source/ProtoStringFixer/src/Main.cs deleted file mode 100644 index e1455826..00000000 --- a/source/ProtoStringFixer/src/Main.cs +++ /dev/null @@ -1,136 +0,0 @@ -using System; -using System.Text; - -namespace ProtoStringFixer { - -public class Program { - public static int Main(string[] args) { - if (args.Length > 0) { - foreach (string str in args) { - Console.WriteLine("{0}", ByteArrayToString(UnescapeBytes(str))); - } - } else { - Console.WriteLine("No arguments given"); - } - return 0; - } - - static string ByteArrayToString(byte[] array) { - StringBuilder sb = new StringBuilder(); - foreach (byte b in array) { - sb.Append(b.ToString("X2")).Append(' '); - } - return sb.ToString(); - } - - // Behold, the horrific beauty -- courtesy of the dastardly fellas from protobuf-csharp - static byte[] UnescapeBytes(string input) { - byte[] result = new byte[input.Length]; - int pos = 0; - for (int i = 0; i < input.Length; i++) { - char c = input[i]; - if (c > 127 || c < 32) { - throw new FormatException("Escaped string must only contain ASCII"); - } - if (c != '\\') { - result[pos++] = (byte)c; - continue; - } - if (i + 1 >= input.Length) { - throw new FormatException("Invalid escape sequence: '\\' at end of string."); - } - - i++; - c = input[i]; - if (c >= '0' && c <= '7') { - // Octal escape. - int code = ParseDigit(c); - if (i + 1 < input.Length && IsOctal(input[i + 1])) { - i++; - code = code * 8 + ParseDigit(input[i]); - } - if (i + 1 < input.Length && IsOctal(input[i + 1])) { - i++; - code = code * 8 + ParseDigit(input[i]); - } - result[pos++] = (byte)code; - } else { - switch (c) { - case 'a': - result[pos++] = 0x07; - break; - case 'b': - result[pos++] = (byte)'\b'; - break; - case 'f': - result[pos++] = (byte)'\f'; - break; - case 'n': - result[pos++] = (byte)'\n'; - break; - case 'r': - result[pos++] = (byte)'\r'; - break; - case 't': - result[pos++] = (byte)'\t'; - break; - case 'v': - result[pos++] = 0x0b; - break; - case '\\': - result[pos++] = (byte)'\\'; - break; - case '\'': - result[pos++] = (byte)'\''; - break; - case '"': - result[pos++] = (byte)'\"'; - break; - - case 'x': - // hex escape - int code; - if (i + 1 < input.Length && IsHex(input[i + 1])) { - i++; - code = ParseDigit(input[i]); - } else { - throw new FormatException("Invalid escape sequence: '\\x' with no digits"); - } - if (i + 1 < input.Length && IsHex(input[i + 1])) { - ++i; - code = code * 16 + ParseDigit(input[i]); - } - result[pos++] = (byte)code; - break; - default: - - throw new FormatException("Invalid escape sequence: '\\" + c + "'"); - } - } - } - byte[] bout = new byte[pos]; - Array.Copy(result, bout, pos); - return bout; - } - - private static bool IsOctal(char c) { - return '0' <= c && c <= '7'; - } - - private static bool IsHex(char c) { - return ('0' <= c && c <= '9') || ('a' <= c && c <= 'f') || ('A' <= c && c <= 'F'); - } - - static int ParseDigit(char c) { - if ('0' <= c && c <= '9') { - return c - '0'; - } else if ('a' <= c && c <= 'z') { - return c - 'a' + 10; - } else { - return c - 'A' + 10; - } - } -} - -} - diff --git a/src/LibMooNet/D3/Account/Account.cs b/src/LibMooNet/D3/Account/Account.cs new file mode 100644 index 00000000..e9ed3d8b --- /dev/null +++ b/src/LibMooNet/D3/Account/Account.cs @@ -0,0 +1,2370 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace D3.Account { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class Account { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_D3_Account_BannerConfiguration__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Account_BannerConfiguration__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_Account_Digest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Account_Digest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_Account_SavedDefinition__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Account_SavedDefinition__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static Account() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "Cg1BY2NvdW50LnByb3RvEgpEMy5BY2NvdW50GhlBdHRyaWJ1dGVTZXJpYWxp" + + "emVyLnByb3RvGgtJdGVtcy5wcm90bxoTT25saW5lU2VydmljZS5wcm90bxoS" + + "SXRlbUNyYWZ0aW5nLnByb3RvIpcCChNCYW5uZXJDb25maWd1cmF0aW9uEhcK" + + "DGJhbm5lcl9zaGFwZRgBIAIoDToBMBIVCgpzaWdpbF9tYWluGAIgAigNOgEw" + + "EhcKDHNpZ2lsX2FjY2VudBgDIAIoDToBMBIYCg1wYXR0ZXJuX2NvbG9yGAQg" + + "AigNOgEwEhsKEGJhY2tncm91bmRfY29sb3IYBSACKA06ATASFgoLc2lnaWxf" + + "Y29sb3IYBiACKA06ATASGgoPc2lnaWxfcGxhY2VtZW50GAcgAigNOgEwEhIK" + + "B3BhdHRlcm4YCCACKA06ATASIAoRdXNlX3NpZ2lsX3ZhcmlhbnQYCSACKAg6" + + "BWZhbHNlEhYKC2VwaWNfYmFubmVyGAogASgNOgEwIsgBCgZEaWdlc3QSDwoH" + + "dmVyc2lvbhgBIAIoDRI3ChNsYXN0X3BsYXllZF9oZXJvX2lkGAIgAigLMhou" + + "RDMuT25saW5lU2VydmljZS5FbnRpdHlJZBI9ChRiYW5uZXJfY29uZmlndXJh" + + "dGlvbhgDIAIoCzIfLkQzLkFjY291bnQuQmFubmVyQ29uZmlndXJhdGlvbhIQ" + + "CgVmbGFncxgEIAIoDToBMCIjCgVGbGFncxIaChZIQVJEQ09SRV9IRVJPX1VO" + + "TE9DS0VEEAEi0AUKD1NhdmVkRGVmaW5pdGlvbhIPCgd2ZXJzaW9uGAEgAigN" + + "EiIKBmRpZ2VzdBgCIAEoCzISLkQzLkFjY291bnQuRGlnZXN0EkEKEHNhdmVk" + + "X2F0dHJpYnV0ZXMYAyACKAsyJy5EMy5BdHRyaWJ1dGVTZXJpYWxpemVyLlNh" + + "dmVkQXR0cmlidXRlcxJKChlzYXZlZF9hdHRyaWJ1dGVzX2hhcmRjb3JlGAQg" + + "ASgLMicuRDMuQXR0cmlidXRlU2VyaWFsaXplci5TYXZlZEF0dHJpYnV0ZXMS" + + "NQoZbm9ybWFsX3NoYXJlZF9zYXZlZF9pdGVtcxgFIAEoCzISLkQzLkl0ZW1z" + + "Lkl0ZW1MaXN0EjcKG2hhcmRjb3JlX3NoYXJlZF9zYXZlZF9pdGVtcxgGIAEo" + + "CzISLkQzLkl0ZW1zLkl0ZW1MaXN0Ej4KE2NyYWZ0ZXJfbm9ybWFsX2RhdGEY" + + "ByABKAsyIS5EMy5JdGVtQ3JhZnRpbmcuQ3JhZnRlclNhdmVkRGF0YRJAChVj" + + "cmFmdGVyX2hhcmRjb3JlX2RhdGEYCCABKAsyIS5EMy5JdGVtQ3JhZnRpbmcu" + + "Q3JhZnRlclNhdmVkRGF0YRIWCg5zZWVuX3R1dG9yaWFscxgJIAEoDBImCh5u" + + "dW1fdm90ZV9raWNrc19wYXJ0aWNpcGF0ZWRfaW4YCiABKBASIAoYbnVtX3Zv" + + "dGVfa2lja3NfaW5pdGlhdGVkGAsgASgQEiAKGG51bV9wdWJsaWNfZ2FtZXNf" + + "bm9fa2ljaxgMIAEoEBIZChF0aW1lc192b3RlX2tpY2tlZBgNIAEoEBIyCg5n" + + "b2xkX2lkX25vcm1hbBgOIAEoCzIaLkQzLk9ubGluZVNlcnZpY2UuRW50aXR5" + + "SWQSNAoQZ29sZF9pZF9oYXJkY29yZRgPIAEoCzIaLkQzLk9ubGluZVNlcnZp" + + "Y2UuRW50aXR5SWQ="); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_D3_Account_BannerConfiguration__Descriptor = Descriptor.MessageTypes[0]; + internal__static_D3_Account_BannerConfiguration__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Account_BannerConfiguration__Descriptor, + new string[] { "BannerShape", "SigilMain", "SigilAccent", "PatternColor", "BackgroundColor", "SigilColor", "SigilPlacement", "Pattern", "UseSigilVariant", "EpicBanner", }); + internal__static_D3_Account_Digest__Descriptor = Descriptor.MessageTypes[1]; + internal__static_D3_Account_Digest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Account_Digest__Descriptor, + new string[] { "Version", "LastPlayedHeroId", "BannerConfiguration", "Flags", }); + internal__static_D3_Account_SavedDefinition__Descriptor = Descriptor.MessageTypes[2]; + internal__static_D3_Account_SavedDefinition__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Account_SavedDefinition__Descriptor, + new string[] { "Version", "Digest", "SavedAttributes", "SavedAttributesHardcore", "NormalSharedSavedItems", "HardcoreSharedSavedItems", "CrafterNormalData", "CrafterHardcoreData", "SeenTutorials", "NumVoteKicksParticipatedIn", "NumVoteKicksInitiated", "NumPublicGamesNoKick", "TimesVoteKicked", "GoldIdNormal", "GoldIdHardcore", }); + return null; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::D3.AttributeSerializer.AttributeSerializer.Descriptor, + global::D3.Items.Items.Descriptor, + global::D3.OnlineService.OnlineService.Descriptor, + global::D3.ItemCrafting.ItemCrafting.Descriptor, + }, assigner); + } + #endregion + + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class BannerConfiguration : pb::GeneratedMessage { + private BannerConfiguration() { } + private static readonly BannerConfiguration defaultInstance = new BannerConfiguration().MakeReadOnly(); + private static readonly string[] _bannerConfigurationFieldNames = new string[] { "background_color", "banner_shape", "epic_banner", "pattern", "pattern_color", "sigil_accent", "sigil_color", "sigil_main", "sigil_placement", "use_sigil_variant" }; + private static readonly uint[] _bannerConfigurationFieldTags = new uint[] { 40, 8, 80, 64, 32, 24, 48, 16, 56, 72 }; + public static BannerConfiguration DefaultInstance { + get { return defaultInstance; } + } + + public override BannerConfiguration DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override BannerConfiguration ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.Account.Account.internal__static_D3_Account_BannerConfiguration__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.Account.Account.internal__static_D3_Account_BannerConfiguration__FieldAccessorTable; } + } + + public const int BannerShapeFieldNumber = 1; + private bool hasBannerShape; + private uint bannerShape_; + public bool HasBannerShape { + get { return hasBannerShape; } + } + public uint BannerShape { + get { return bannerShape_; } + } + + public const int SigilMainFieldNumber = 2; + private bool hasSigilMain; + private uint sigilMain_; + public bool HasSigilMain { + get { return hasSigilMain; } + } + public uint SigilMain { + get { return sigilMain_; } + } + + public const int SigilAccentFieldNumber = 3; + private bool hasSigilAccent; + private uint sigilAccent_; + public bool HasSigilAccent { + get { return hasSigilAccent; } + } + public uint SigilAccent { + get { return sigilAccent_; } + } + + public const int PatternColorFieldNumber = 4; + private bool hasPatternColor; + private uint patternColor_; + public bool HasPatternColor { + get { return hasPatternColor; } + } + public uint PatternColor { + get { return patternColor_; } + } + + public const int BackgroundColorFieldNumber = 5; + private bool hasBackgroundColor; + private uint backgroundColor_; + public bool HasBackgroundColor { + get { return hasBackgroundColor; } + } + public uint BackgroundColor { + get { return backgroundColor_; } + } + + public const int SigilColorFieldNumber = 6; + private bool hasSigilColor; + private uint sigilColor_; + public bool HasSigilColor { + get { return hasSigilColor; } + } + public uint SigilColor { + get { return sigilColor_; } + } + + public const int SigilPlacementFieldNumber = 7; + private bool hasSigilPlacement; + private uint sigilPlacement_; + public bool HasSigilPlacement { + get { return hasSigilPlacement; } + } + public uint SigilPlacement { + get { return sigilPlacement_; } + } + + public const int PatternFieldNumber = 8; + private bool hasPattern; + private uint pattern_; + public bool HasPattern { + get { return hasPattern; } + } + public uint Pattern { + get { return pattern_; } + } + + public const int UseSigilVariantFieldNumber = 9; + private bool hasUseSigilVariant; + private bool useSigilVariant_; + public bool HasUseSigilVariant { + get { return hasUseSigilVariant; } + } + public bool UseSigilVariant { + get { return useSigilVariant_; } + } + + public const int EpicBannerFieldNumber = 10; + private bool hasEpicBanner; + private uint epicBanner_; + public bool HasEpicBanner { + get { return hasEpicBanner; } + } + public uint EpicBanner { + get { return epicBanner_; } + } + + public override bool IsInitialized { + get { + if (!hasBannerShape) return false; + if (!hasSigilMain) return false; + if (!hasSigilAccent) return false; + if (!hasPatternColor) return false; + if (!hasBackgroundColor) return false; + if (!hasSigilColor) return false; + if (!hasSigilPlacement) return false; + if (!hasPattern) return false; + if (!hasUseSigilVariant) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _bannerConfigurationFieldNames; + if (hasBannerShape) { + output.WriteUInt32(1, field_names[1], BannerShape); + } + if (hasSigilMain) { + output.WriteUInt32(2, field_names[7], SigilMain); + } + if (hasSigilAccent) { + output.WriteUInt32(3, field_names[5], SigilAccent); + } + if (hasPatternColor) { + output.WriteUInt32(4, field_names[4], PatternColor); + } + if (hasBackgroundColor) { + output.WriteUInt32(5, field_names[0], BackgroundColor); + } + if (hasSigilColor) { + output.WriteUInt32(6, field_names[6], SigilColor); + } + if (hasSigilPlacement) { + output.WriteUInt32(7, field_names[8], SigilPlacement); + } + if (hasPattern) { + output.WriteUInt32(8, field_names[3], Pattern); + } + if (hasUseSigilVariant) { + output.WriteBool(9, field_names[9], UseSigilVariant); + } + if (hasEpicBanner) { + output.WriteUInt32(10, field_names[2], EpicBanner); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasBannerShape) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, BannerShape); + } + if (hasSigilMain) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, SigilMain); + } + if (hasSigilAccent) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, SigilAccent); + } + if (hasPatternColor) { + size += pb::CodedOutputStream.ComputeUInt32Size(4, PatternColor); + } + if (hasBackgroundColor) { + size += pb::CodedOutputStream.ComputeUInt32Size(5, BackgroundColor); + } + if (hasSigilColor) { + size += pb::CodedOutputStream.ComputeUInt32Size(6, SigilColor); + } + if (hasSigilPlacement) { + size += pb::CodedOutputStream.ComputeUInt32Size(7, SigilPlacement); + } + if (hasPattern) { + size += pb::CodedOutputStream.ComputeUInt32Size(8, Pattern); + } + if (hasUseSigilVariant) { + size += pb::CodedOutputStream.ComputeBoolSize(9, UseSigilVariant); + } + if (hasEpicBanner) { + size += pb::CodedOutputStream.ComputeUInt32Size(10, EpicBanner); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static BannerConfiguration ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static BannerConfiguration ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static BannerConfiguration ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static BannerConfiguration ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static BannerConfiguration ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static BannerConfiguration ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static BannerConfiguration ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static BannerConfiguration ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static BannerConfiguration ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static BannerConfiguration ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private BannerConfiguration MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(BannerConfiguration prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(BannerConfiguration cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private BannerConfiguration result; + + private BannerConfiguration PrepareBuilder() { + if (resultIsReadOnly) { + BannerConfiguration original = result; + result = new BannerConfiguration(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override BannerConfiguration MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.Account.BannerConfiguration.Descriptor; } + } + + public override BannerConfiguration DefaultInstanceForType { + get { return global::D3.Account.BannerConfiguration.DefaultInstance; } + } + + public override BannerConfiguration BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is BannerConfiguration) { + return MergeFrom((BannerConfiguration) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(BannerConfiguration other) { + if (other == global::D3.Account.BannerConfiguration.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasBannerShape) { + BannerShape = other.BannerShape; + } + if (other.HasSigilMain) { + SigilMain = other.SigilMain; + } + if (other.HasSigilAccent) { + SigilAccent = other.SigilAccent; + } + if (other.HasPatternColor) { + PatternColor = other.PatternColor; + } + if (other.HasBackgroundColor) { + BackgroundColor = other.BackgroundColor; + } + if (other.HasSigilColor) { + SigilColor = other.SigilColor; + } + if (other.HasSigilPlacement) { + SigilPlacement = other.SigilPlacement; + } + if (other.HasPattern) { + Pattern = other.Pattern; + } + if (other.HasUseSigilVariant) { + UseSigilVariant = other.UseSigilVariant; + } + if (other.HasEpicBanner) { + EpicBanner = other.EpicBanner; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_bannerConfigurationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _bannerConfigurationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasBannerShape = input.ReadUInt32(ref result.bannerShape_); + break; + } + case 16: { + result.hasSigilMain = input.ReadUInt32(ref result.sigilMain_); + break; + } + case 24: { + result.hasSigilAccent = input.ReadUInt32(ref result.sigilAccent_); + break; + } + case 32: { + result.hasPatternColor = input.ReadUInt32(ref result.patternColor_); + break; + } + case 40: { + result.hasBackgroundColor = input.ReadUInt32(ref result.backgroundColor_); + break; + } + case 48: { + result.hasSigilColor = input.ReadUInt32(ref result.sigilColor_); + break; + } + case 56: { + result.hasSigilPlacement = input.ReadUInt32(ref result.sigilPlacement_); + break; + } + case 64: { + result.hasPattern = input.ReadUInt32(ref result.pattern_); + break; + } + case 72: { + result.hasUseSigilVariant = input.ReadBool(ref result.useSigilVariant_); + break; + } + case 80: { + result.hasEpicBanner = input.ReadUInt32(ref result.epicBanner_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasBannerShape { + get { return result.hasBannerShape; } + } + public uint BannerShape { + get { return result.BannerShape; } + set { SetBannerShape(value); } + } + public Builder SetBannerShape(uint value) { + PrepareBuilder(); + result.hasBannerShape = true; + result.bannerShape_ = value; + return this; + } + public Builder ClearBannerShape() { + PrepareBuilder(); + result.hasBannerShape = false; + result.bannerShape_ = 0; + return this; + } + + public bool HasSigilMain { + get { return result.hasSigilMain; } + } + public uint SigilMain { + get { return result.SigilMain; } + set { SetSigilMain(value); } + } + public Builder SetSigilMain(uint value) { + PrepareBuilder(); + result.hasSigilMain = true; + result.sigilMain_ = value; + return this; + } + public Builder ClearSigilMain() { + PrepareBuilder(); + result.hasSigilMain = false; + result.sigilMain_ = 0; + return this; + } + + public bool HasSigilAccent { + get { return result.hasSigilAccent; } + } + public uint SigilAccent { + get { return result.SigilAccent; } + set { SetSigilAccent(value); } + } + public Builder SetSigilAccent(uint value) { + PrepareBuilder(); + result.hasSigilAccent = true; + result.sigilAccent_ = value; + return this; + } + public Builder ClearSigilAccent() { + PrepareBuilder(); + result.hasSigilAccent = false; + result.sigilAccent_ = 0; + return this; + } + + public bool HasPatternColor { + get { return result.hasPatternColor; } + } + public uint PatternColor { + get { return result.PatternColor; } + set { SetPatternColor(value); } + } + public Builder SetPatternColor(uint value) { + PrepareBuilder(); + result.hasPatternColor = true; + result.patternColor_ = value; + return this; + } + public Builder ClearPatternColor() { + PrepareBuilder(); + result.hasPatternColor = false; + result.patternColor_ = 0; + return this; + } + + public bool HasBackgroundColor { + get { return result.hasBackgroundColor; } + } + public uint BackgroundColor { + get { return result.BackgroundColor; } + set { SetBackgroundColor(value); } + } + public Builder SetBackgroundColor(uint value) { + PrepareBuilder(); + result.hasBackgroundColor = true; + result.backgroundColor_ = value; + return this; + } + public Builder ClearBackgroundColor() { + PrepareBuilder(); + result.hasBackgroundColor = false; + result.backgroundColor_ = 0; + return this; + } + + public bool HasSigilColor { + get { return result.hasSigilColor; } + } + public uint SigilColor { + get { return result.SigilColor; } + set { SetSigilColor(value); } + } + public Builder SetSigilColor(uint value) { + PrepareBuilder(); + result.hasSigilColor = true; + result.sigilColor_ = value; + return this; + } + public Builder ClearSigilColor() { + PrepareBuilder(); + result.hasSigilColor = false; + result.sigilColor_ = 0; + return this; + } + + public bool HasSigilPlacement { + get { return result.hasSigilPlacement; } + } + public uint SigilPlacement { + get { return result.SigilPlacement; } + set { SetSigilPlacement(value); } + } + public Builder SetSigilPlacement(uint value) { + PrepareBuilder(); + result.hasSigilPlacement = true; + result.sigilPlacement_ = value; + return this; + } + public Builder ClearSigilPlacement() { + PrepareBuilder(); + result.hasSigilPlacement = false; + result.sigilPlacement_ = 0; + return this; + } + + public bool HasPattern { + get { return result.hasPattern; } + } + public uint Pattern { + get { return result.Pattern; } + set { SetPattern(value); } + } + public Builder SetPattern(uint value) { + PrepareBuilder(); + result.hasPattern = true; + result.pattern_ = value; + return this; + } + public Builder ClearPattern() { + PrepareBuilder(); + result.hasPattern = false; + result.pattern_ = 0; + return this; + } + + public bool HasUseSigilVariant { + get { return result.hasUseSigilVariant; } + } + public bool UseSigilVariant { + get { return result.UseSigilVariant; } + set { SetUseSigilVariant(value); } + } + public Builder SetUseSigilVariant(bool value) { + PrepareBuilder(); + result.hasUseSigilVariant = true; + result.useSigilVariant_ = value; + return this; + } + public Builder ClearUseSigilVariant() { + PrepareBuilder(); + result.hasUseSigilVariant = false; + result.useSigilVariant_ = false; + return this; + } + + public bool HasEpicBanner { + get { return result.hasEpicBanner; } + } + public uint EpicBanner { + get { return result.EpicBanner; } + set { SetEpicBanner(value); } + } + public Builder SetEpicBanner(uint value) { + PrepareBuilder(); + result.hasEpicBanner = true; + result.epicBanner_ = value; + return this; + } + public Builder ClearEpicBanner() { + PrepareBuilder(); + result.hasEpicBanner = false; + result.epicBanner_ = 0; + return this; + } + } + static BannerConfiguration() { + object.ReferenceEquals(global::D3.Account.Account.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Digest : pb::GeneratedMessage { + private Digest() { } + private static readonly Digest defaultInstance = new Digest().MakeReadOnly(); + private static readonly string[] _digestFieldNames = new string[] { "banner_configuration", "flags", "last_played_hero_id", "version" }; + private static readonly uint[] _digestFieldTags = new uint[] { 26, 32, 18, 8 }; + public static Digest DefaultInstance { + get { return defaultInstance; } + } + + public override Digest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Digest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.Account.Account.internal__static_D3_Account_Digest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.Account.Account.internal__static_D3_Account_Digest__FieldAccessorTable; } + } + + #region Nested types + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static class Types { + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public enum Flags { + HARDCORE_HERO_UNLOCKED = 1, + } + + } + #endregion + + public const int VersionFieldNumber = 1; + private bool hasVersion; + private uint version_; + public bool HasVersion { + get { return hasVersion; } + } + public uint Version { + get { return version_; } + } + + public const int LastPlayedHeroIdFieldNumber = 2; + private bool hasLastPlayedHeroId; + private global::D3.OnlineService.EntityId lastPlayedHeroId_; + public bool HasLastPlayedHeroId { + get { return hasLastPlayedHeroId; } + } + public global::D3.OnlineService.EntityId LastPlayedHeroId { + get { return lastPlayedHeroId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public const int BannerConfigurationFieldNumber = 3; + private bool hasBannerConfiguration; + private global::D3.Account.BannerConfiguration bannerConfiguration_; + public bool HasBannerConfiguration { + get { return hasBannerConfiguration; } + } + public global::D3.Account.BannerConfiguration BannerConfiguration { + get { return bannerConfiguration_ ?? global::D3.Account.BannerConfiguration.DefaultInstance; } + } + + public const int FlagsFieldNumber = 4; + private bool hasFlags; + private uint flags_; + public bool HasFlags { + get { return hasFlags; } + } + public uint Flags { + get { return flags_; } + } + + public override bool IsInitialized { + get { + if (!hasVersion) return false; + if (!hasLastPlayedHeroId) return false; + if (!hasBannerConfiguration) return false; + if (!hasFlags) return false; + if (!LastPlayedHeroId.IsInitialized) return false; + if (!BannerConfiguration.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _digestFieldNames; + if (hasVersion) { + output.WriteUInt32(1, field_names[3], Version); + } + if (hasLastPlayedHeroId) { + output.WriteMessage(2, field_names[2], LastPlayedHeroId); + } + if (hasBannerConfiguration) { + output.WriteMessage(3, field_names[0], BannerConfiguration); + } + if (hasFlags) { + output.WriteUInt32(4, field_names[1], Flags); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasVersion) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, Version); + } + if (hasLastPlayedHeroId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, LastPlayedHeroId); + } + if (hasBannerConfiguration) { + size += pb::CodedOutputStream.ComputeMessageSize(3, BannerConfiguration); + } + if (hasFlags) { + size += pb::CodedOutputStream.ComputeUInt32Size(4, Flags); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static Digest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Digest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Digest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Digest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Digest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Digest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Digest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Digest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Digest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Digest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Digest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Digest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Digest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Digest result; + + private Digest PrepareBuilder() { + if (resultIsReadOnly) { + Digest original = result; + result = new Digest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Digest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.Account.Digest.Descriptor; } + } + + public override Digest DefaultInstanceForType { + get { return global::D3.Account.Digest.DefaultInstance; } + } + + public override Digest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Digest) { + return MergeFrom((Digest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Digest other) { + if (other == global::D3.Account.Digest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasVersion) { + Version = other.Version; + } + if (other.HasLastPlayedHeroId) { + MergeLastPlayedHeroId(other.LastPlayedHeroId); + } + if (other.HasBannerConfiguration) { + MergeBannerConfiguration(other.BannerConfiguration); + } + if (other.HasFlags) { + Flags = other.Flags; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_digestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _digestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasVersion = input.ReadUInt32(ref result.version_); + break; + } + case 18: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasLastPlayedHeroId) { + subBuilder.MergeFrom(LastPlayedHeroId); + } + input.ReadMessage(subBuilder, extensionRegistry); + LastPlayedHeroId = subBuilder.BuildPartial(); + break; + } + case 26: { + global::D3.Account.BannerConfiguration.Builder subBuilder = global::D3.Account.BannerConfiguration.CreateBuilder(); + if (result.hasBannerConfiguration) { + subBuilder.MergeFrom(BannerConfiguration); + } + input.ReadMessage(subBuilder, extensionRegistry); + BannerConfiguration = subBuilder.BuildPartial(); + break; + } + case 32: { + result.hasFlags = input.ReadUInt32(ref result.flags_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasVersion { + get { return result.hasVersion; } + } + public uint Version { + get { return result.Version; } + set { SetVersion(value); } + } + public Builder SetVersion(uint value) { + PrepareBuilder(); + result.hasVersion = true; + result.version_ = value; + return this; + } + public Builder ClearVersion() { + PrepareBuilder(); + result.hasVersion = false; + result.version_ = 0; + return this; + } + + public bool HasLastPlayedHeroId { + get { return result.hasLastPlayedHeroId; } + } + public global::D3.OnlineService.EntityId LastPlayedHeroId { + get { return result.LastPlayedHeroId; } + set { SetLastPlayedHeroId(value); } + } + public Builder SetLastPlayedHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasLastPlayedHeroId = true; + result.lastPlayedHeroId_ = value; + return this; + } + public Builder SetLastPlayedHeroId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasLastPlayedHeroId = true; + result.lastPlayedHeroId_ = builderForValue.Build(); + return this; + } + public Builder MergeLastPlayedHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasLastPlayedHeroId && + result.lastPlayedHeroId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.lastPlayedHeroId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.lastPlayedHeroId_).MergeFrom(value).BuildPartial(); + } else { + result.lastPlayedHeroId_ = value; + } + result.hasLastPlayedHeroId = true; + return this; + } + public Builder ClearLastPlayedHeroId() { + PrepareBuilder(); + result.hasLastPlayedHeroId = false; + result.lastPlayedHeroId_ = null; + return this; + } + + public bool HasBannerConfiguration { + get { return result.hasBannerConfiguration; } + } + public global::D3.Account.BannerConfiguration BannerConfiguration { + get { return result.BannerConfiguration; } + set { SetBannerConfiguration(value); } + } + public Builder SetBannerConfiguration(global::D3.Account.BannerConfiguration value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBannerConfiguration = true; + result.bannerConfiguration_ = value; + return this; + } + public Builder SetBannerConfiguration(global::D3.Account.BannerConfiguration.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBannerConfiguration = true; + result.bannerConfiguration_ = builderForValue.Build(); + return this; + } + public Builder MergeBannerConfiguration(global::D3.Account.BannerConfiguration value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBannerConfiguration && + result.bannerConfiguration_ != global::D3.Account.BannerConfiguration.DefaultInstance) { + result.bannerConfiguration_ = global::D3.Account.BannerConfiguration.CreateBuilder(result.bannerConfiguration_).MergeFrom(value).BuildPartial(); + } else { + result.bannerConfiguration_ = value; + } + result.hasBannerConfiguration = true; + return this; + } + public Builder ClearBannerConfiguration() { + PrepareBuilder(); + result.hasBannerConfiguration = false; + result.bannerConfiguration_ = null; + return this; + } + + public bool HasFlags { + get { return result.hasFlags; } + } + public uint Flags { + get { return result.Flags; } + set { SetFlags(value); } + } + public Builder SetFlags(uint value) { + PrepareBuilder(); + result.hasFlags = true; + result.flags_ = value; + return this; + } + public Builder ClearFlags() { + PrepareBuilder(); + result.hasFlags = false; + result.flags_ = 0; + return this; + } + } + static Digest() { + object.ReferenceEquals(global::D3.Account.Account.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class SavedDefinition : pb::GeneratedMessage { + private SavedDefinition() { } + private static readonly SavedDefinition defaultInstance = new SavedDefinition().MakeReadOnly(); + private static readonly string[] _savedDefinitionFieldNames = new string[] { "crafter_hardcore_data", "crafter_normal_data", "digest", "gold_id_hardcore", "gold_id_normal", "hardcore_shared_saved_items", "normal_shared_saved_items", "num_public_games_no_kick", "num_vote_kicks_initiated", "num_vote_kicks_participated_in", "saved_attributes", "saved_attributes_hardcore", "seen_tutorials", "times_vote_kicked", "version" }; + private static readonly uint[] _savedDefinitionFieldTags = new uint[] { 66, 58, 18, 122, 114, 50, 42, 97, 89, 81, 26, 34, 74, 105, 8 }; + public static SavedDefinition DefaultInstance { + get { return defaultInstance; } + } + + public override SavedDefinition DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SavedDefinition ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.Account.Account.internal__static_D3_Account_SavedDefinition__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.Account.Account.internal__static_D3_Account_SavedDefinition__FieldAccessorTable; } + } + + public const int VersionFieldNumber = 1; + private bool hasVersion; + private uint version_; + public bool HasVersion { + get { return hasVersion; } + } + public uint Version { + get { return version_; } + } + + public const int DigestFieldNumber = 2; + private bool hasDigest; + private global::D3.Account.Digest digest_; + public bool HasDigest { + get { return hasDigest; } + } + public global::D3.Account.Digest Digest { + get { return digest_ ?? global::D3.Account.Digest.DefaultInstance; } + } + + public const int SavedAttributesFieldNumber = 3; + private bool hasSavedAttributes; + private global::D3.AttributeSerializer.SavedAttributes savedAttributes_; + public bool HasSavedAttributes { + get { return hasSavedAttributes; } + } + public global::D3.AttributeSerializer.SavedAttributes SavedAttributes { + get { return savedAttributes_ ?? global::D3.AttributeSerializer.SavedAttributes.DefaultInstance; } + } + + public const int SavedAttributesHardcoreFieldNumber = 4; + private bool hasSavedAttributesHardcore; + private global::D3.AttributeSerializer.SavedAttributes savedAttributesHardcore_; + public bool HasSavedAttributesHardcore { + get { return hasSavedAttributesHardcore; } + } + public global::D3.AttributeSerializer.SavedAttributes SavedAttributesHardcore { + get { return savedAttributesHardcore_ ?? global::D3.AttributeSerializer.SavedAttributes.DefaultInstance; } + } + + public const int NormalSharedSavedItemsFieldNumber = 5; + private bool hasNormalSharedSavedItems; + private global::D3.Items.ItemList normalSharedSavedItems_; + public bool HasNormalSharedSavedItems { + get { return hasNormalSharedSavedItems; } + } + public global::D3.Items.ItemList NormalSharedSavedItems { + get { return normalSharedSavedItems_ ?? global::D3.Items.ItemList.DefaultInstance; } + } + + public const int HardcoreSharedSavedItemsFieldNumber = 6; + private bool hasHardcoreSharedSavedItems; + private global::D3.Items.ItemList hardcoreSharedSavedItems_; + public bool HasHardcoreSharedSavedItems { + get { return hasHardcoreSharedSavedItems; } + } + public global::D3.Items.ItemList HardcoreSharedSavedItems { + get { return hardcoreSharedSavedItems_ ?? global::D3.Items.ItemList.DefaultInstance; } + } + + public const int CrafterNormalDataFieldNumber = 7; + private bool hasCrafterNormalData; + private global::D3.ItemCrafting.CrafterSavedData crafterNormalData_; + public bool HasCrafterNormalData { + get { return hasCrafterNormalData; } + } + public global::D3.ItemCrafting.CrafterSavedData CrafterNormalData { + get { return crafterNormalData_ ?? global::D3.ItemCrafting.CrafterSavedData.DefaultInstance; } + } + + public const int CrafterHardcoreDataFieldNumber = 8; + private bool hasCrafterHardcoreData; + private global::D3.ItemCrafting.CrafterSavedData crafterHardcoreData_; + public bool HasCrafterHardcoreData { + get { return hasCrafterHardcoreData; } + } + public global::D3.ItemCrafting.CrafterSavedData CrafterHardcoreData { + get { return crafterHardcoreData_ ?? global::D3.ItemCrafting.CrafterSavedData.DefaultInstance; } + } + + public const int SeenTutorialsFieldNumber = 9; + private bool hasSeenTutorials; + private pb::ByteString seenTutorials_ = pb::ByteString.Empty; + public bool HasSeenTutorials { + get { return hasSeenTutorials; } + } + public pb::ByteString SeenTutorials { + get { return seenTutorials_; } + } + + public const int NumVoteKicksParticipatedInFieldNumber = 10; + private bool hasNumVoteKicksParticipatedIn; + private long numVoteKicksParticipatedIn_; + public bool HasNumVoteKicksParticipatedIn { + get { return hasNumVoteKicksParticipatedIn; } + } + public long NumVoteKicksParticipatedIn { + get { return numVoteKicksParticipatedIn_; } + } + + public const int NumVoteKicksInitiatedFieldNumber = 11; + private bool hasNumVoteKicksInitiated; + private long numVoteKicksInitiated_; + public bool HasNumVoteKicksInitiated { + get { return hasNumVoteKicksInitiated; } + } + public long NumVoteKicksInitiated { + get { return numVoteKicksInitiated_; } + } + + public const int NumPublicGamesNoKickFieldNumber = 12; + private bool hasNumPublicGamesNoKick; + private long numPublicGamesNoKick_; + public bool HasNumPublicGamesNoKick { + get { return hasNumPublicGamesNoKick; } + } + public long NumPublicGamesNoKick { + get { return numPublicGamesNoKick_; } + } + + public const int TimesVoteKickedFieldNumber = 13; + private bool hasTimesVoteKicked; + private long timesVoteKicked_; + public bool HasTimesVoteKicked { + get { return hasTimesVoteKicked; } + } + public long TimesVoteKicked { + get { return timesVoteKicked_; } + } + + public const int GoldIdNormalFieldNumber = 14; + private bool hasGoldIdNormal; + private global::D3.OnlineService.EntityId goldIdNormal_; + public bool HasGoldIdNormal { + get { return hasGoldIdNormal; } + } + public global::D3.OnlineService.EntityId GoldIdNormal { + get { return goldIdNormal_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public const int GoldIdHardcoreFieldNumber = 15; + private bool hasGoldIdHardcore; + private global::D3.OnlineService.EntityId goldIdHardcore_; + public bool HasGoldIdHardcore { + get { return hasGoldIdHardcore; } + } + public global::D3.OnlineService.EntityId GoldIdHardcore { + get { return goldIdHardcore_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasVersion) return false; + if (!hasSavedAttributes) return false; + if (HasDigest) { + if (!Digest.IsInitialized) return false; + } + if (!SavedAttributes.IsInitialized) return false; + if (HasSavedAttributesHardcore) { + if (!SavedAttributesHardcore.IsInitialized) return false; + } + if (HasNormalSharedSavedItems) { + if (!NormalSharedSavedItems.IsInitialized) return false; + } + if (HasHardcoreSharedSavedItems) { + if (!HardcoreSharedSavedItems.IsInitialized) return false; + } + if (HasCrafterNormalData) { + if (!CrafterNormalData.IsInitialized) return false; + } + if (HasCrafterHardcoreData) { + if (!CrafterHardcoreData.IsInitialized) return false; + } + if (HasGoldIdNormal) { + if (!GoldIdNormal.IsInitialized) return false; + } + if (HasGoldIdHardcore) { + if (!GoldIdHardcore.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _savedDefinitionFieldNames; + if (hasVersion) { + output.WriteUInt32(1, field_names[14], Version); + } + if (hasDigest) { + output.WriteMessage(2, field_names[2], Digest); + } + if (hasSavedAttributes) { + output.WriteMessage(3, field_names[10], SavedAttributes); + } + if (hasSavedAttributesHardcore) { + output.WriteMessage(4, field_names[11], SavedAttributesHardcore); + } + if (hasNormalSharedSavedItems) { + output.WriteMessage(5, field_names[6], NormalSharedSavedItems); + } + if (hasHardcoreSharedSavedItems) { + output.WriteMessage(6, field_names[5], HardcoreSharedSavedItems); + } + if (hasCrafterNormalData) { + output.WriteMessage(7, field_names[1], CrafterNormalData); + } + if (hasCrafterHardcoreData) { + output.WriteMessage(8, field_names[0], CrafterHardcoreData); + } + if (hasSeenTutorials) { + output.WriteBytes(9, field_names[12], SeenTutorials); + } + if (hasNumVoteKicksParticipatedIn) { + output.WriteSFixed64(10, field_names[9], NumVoteKicksParticipatedIn); + } + if (hasNumVoteKicksInitiated) { + output.WriteSFixed64(11, field_names[8], NumVoteKicksInitiated); + } + if (hasNumPublicGamesNoKick) { + output.WriteSFixed64(12, field_names[7], NumPublicGamesNoKick); + } + if (hasTimesVoteKicked) { + output.WriteSFixed64(13, field_names[13], TimesVoteKicked); + } + if (hasGoldIdNormal) { + output.WriteMessage(14, field_names[4], GoldIdNormal); + } + if (hasGoldIdHardcore) { + output.WriteMessage(15, field_names[3], GoldIdHardcore); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasVersion) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, Version); + } + if (hasDigest) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Digest); + } + if (hasSavedAttributes) { + size += pb::CodedOutputStream.ComputeMessageSize(3, SavedAttributes); + } + if (hasSavedAttributesHardcore) { + size += pb::CodedOutputStream.ComputeMessageSize(4, SavedAttributesHardcore); + } + if (hasNormalSharedSavedItems) { + size += pb::CodedOutputStream.ComputeMessageSize(5, NormalSharedSavedItems); + } + if (hasHardcoreSharedSavedItems) { + size += pb::CodedOutputStream.ComputeMessageSize(6, HardcoreSharedSavedItems); + } + if (hasCrafterNormalData) { + size += pb::CodedOutputStream.ComputeMessageSize(7, CrafterNormalData); + } + if (hasCrafterHardcoreData) { + size += pb::CodedOutputStream.ComputeMessageSize(8, CrafterHardcoreData); + } + if (hasSeenTutorials) { + size += pb::CodedOutputStream.ComputeBytesSize(9, SeenTutorials); + } + if (hasNumVoteKicksParticipatedIn) { + size += pb::CodedOutputStream.ComputeSFixed64Size(10, NumVoteKicksParticipatedIn); + } + if (hasNumVoteKicksInitiated) { + size += pb::CodedOutputStream.ComputeSFixed64Size(11, NumVoteKicksInitiated); + } + if (hasNumPublicGamesNoKick) { + size += pb::CodedOutputStream.ComputeSFixed64Size(12, NumPublicGamesNoKick); + } + if (hasTimesVoteKicked) { + size += pb::CodedOutputStream.ComputeSFixed64Size(13, TimesVoteKicked); + } + if (hasGoldIdNormal) { + size += pb::CodedOutputStream.ComputeMessageSize(14, GoldIdNormal); + } + if (hasGoldIdHardcore) { + size += pb::CodedOutputStream.ComputeMessageSize(15, GoldIdHardcore); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static SavedDefinition ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SavedDefinition ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SavedDefinition ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SavedDefinition ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SavedDefinition ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SavedDefinition ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SavedDefinition ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SavedDefinition ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SavedDefinition ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SavedDefinition ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SavedDefinition MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SavedDefinition prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SavedDefinition cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SavedDefinition result; + + private SavedDefinition PrepareBuilder() { + if (resultIsReadOnly) { + SavedDefinition original = result; + result = new SavedDefinition(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SavedDefinition MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.Account.SavedDefinition.Descriptor; } + } + + public override SavedDefinition DefaultInstanceForType { + get { return global::D3.Account.SavedDefinition.DefaultInstance; } + } + + public override SavedDefinition BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SavedDefinition) { + return MergeFrom((SavedDefinition) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SavedDefinition other) { + if (other == global::D3.Account.SavedDefinition.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasVersion) { + Version = other.Version; + } + if (other.HasDigest) { + MergeDigest(other.Digest); + } + if (other.HasSavedAttributes) { + MergeSavedAttributes(other.SavedAttributes); + } + if (other.HasSavedAttributesHardcore) { + MergeSavedAttributesHardcore(other.SavedAttributesHardcore); + } + if (other.HasNormalSharedSavedItems) { + MergeNormalSharedSavedItems(other.NormalSharedSavedItems); + } + if (other.HasHardcoreSharedSavedItems) { + MergeHardcoreSharedSavedItems(other.HardcoreSharedSavedItems); + } + if (other.HasCrafterNormalData) { + MergeCrafterNormalData(other.CrafterNormalData); + } + if (other.HasCrafterHardcoreData) { + MergeCrafterHardcoreData(other.CrafterHardcoreData); + } + if (other.HasSeenTutorials) { + SeenTutorials = other.SeenTutorials; + } + if (other.HasNumVoteKicksParticipatedIn) { + NumVoteKicksParticipatedIn = other.NumVoteKicksParticipatedIn; + } + if (other.HasNumVoteKicksInitiated) { + NumVoteKicksInitiated = other.NumVoteKicksInitiated; + } + if (other.HasNumPublicGamesNoKick) { + NumPublicGamesNoKick = other.NumPublicGamesNoKick; + } + if (other.HasTimesVoteKicked) { + TimesVoteKicked = other.TimesVoteKicked; + } + if (other.HasGoldIdNormal) { + MergeGoldIdNormal(other.GoldIdNormal); + } + if (other.HasGoldIdHardcore) { + MergeGoldIdHardcore(other.GoldIdHardcore); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_savedDefinitionFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _savedDefinitionFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasVersion = input.ReadUInt32(ref result.version_); + break; + } + case 18: { + global::D3.Account.Digest.Builder subBuilder = global::D3.Account.Digest.CreateBuilder(); + if (result.hasDigest) { + subBuilder.MergeFrom(Digest); + } + input.ReadMessage(subBuilder, extensionRegistry); + Digest = subBuilder.BuildPartial(); + break; + } + case 26: { + global::D3.AttributeSerializer.SavedAttributes.Builder subBuilder = global::D3.AttributeSerializer.SavedAttributes.CreateBuilder(); + if (result.hasSavedAttributes) { + subBuilder.MergeFrom(SavedAttributes); + } + input.ReadMessage(subBuilder, extensionRegistry); + SavedAttributes = subBuilder.BuildPartial(); + break; + } + case 34: { + global::D3.AttributeSerializer.SavedAttributes.Builder subBuilder = global::D3.AttributeSerializer.SavedAttributes.CreateBuilder(); + if (result.hasSavedAttributesHardcore) { + subBuilder.MergeFrom(SavedAttributesHardcore); + } + input.ReadMessage(subBuilder, extensionRegistry); + SavedAttributesHardcore = subBuilder.BuildPartial(); + break; + } + case 42: { + global::D3.Items.ItemList.Builder subBuilder = global::D3.Items.ItemList.CreateBuilder(); + if (result.hasNormalSharedSavedItems) { + subBuilder.MergeFrom(NormalSharedSavedItems); + } + input.ReadMessage(subBuilder, extensionRegistry); + NormalSharedSavedItems = subBuilder.BuildPartial(); + break; + } + case 50: { + global::D3.Items.ItemList.Builder subBuilder = global::D3.Items.ItemList.CreateBuilder(); + if (result.hasHardcoreSharedSavedItems) { + subBuilder.MergeFrom(HardcoreSharedSavedItems); + } + input.ReadMessage(subBuilder, extensionRegistry); + HardcoreSharedSavedItems = subBuilder.BuildPartial(); + break; + } + case 58: { + global::D3.ItemCrafting.CrafterSavedData.Builder subBuilder = global::D3.ItemCrafting.CrafterSavedData.CreateBuilder(); + if (result.hasCrafterNormalData) { + subBuilder.MergeFrom(CrafterNormalData); + } + input.ReadMessage(subBuilder, extensionRegistry); + CrafterNormalData = subBuilder.BuildPartial(); + break; + } + case 66: { + global::D3.ItemCrafting.CrafterSavedData.Builder subBuilder = global::D3.ItemCrafting.CrafterSavedData.CreateBuilder(); + if (result.hasCrafterHardcoreData) { + subBuilder.MergeFrom(CrafterHardcoreData); + } + input.ReadMessage(subBuilder, extensionRegistry); + CrafterHardcoreData = subBuilder.BuildPartial(); + break; + } + case 74: { + result.hasSeenTutorials = input.ReadBytes(ref result.seenTutorials_); + break; + } + case 81: { + result.hasNumVoteKicksParticipatedIn = input.ReadSFixed64(ref result.numVoteKicksParticipatedIn_); + break; + } + case 89: { + result.hasNumVoteKicksInitiated = input.ReadSFixed64(ref result.numVoteKicksInitiated_); + break; + } + case 97: { + result.hasNumPublicGamesNoKick = input.ReadSFixed64(ref result.numPublicGamesNoKick_); + break; + } + case 105: { + result.hasTimesVoteKicked = input.ReadSFixed64(ref result.timesVoteKicked_); + break; + } + case 114: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasGoldIdNormal) { + subBuilder.MergeFrom(GoldIdNormal); + } + input.ReadMessage(subBuilder, extensionRegistry); + GoldIdNormal = subBuilder.BuildPartial(); + break; + } + case 122: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasGoldIdHardcore) { + subBuilder.MergeFrom(GoldIdHardcore); + } + input.ReadMessage(subBuilder, extensionRegistry); + GoldIdHardcore = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasVersion { + get { return result.hasVersion; } + } + public uint Version { + get { return result.Version; } + set { SetVersion(value); } + } + public Builder SetVersion(uint value) { + PrepareBuilder(); + result.hasVersion = true; + result.version_ = value; + return this; + } + public Builder ClearVersion() { + PrepareBuilder(); + result.hasVersion = false; + result.version_ = 0; + return this; + } + + public bool HasDigest { + get { return result.hasDigest; } + } + public global::D3.Account.Digest Digest { + get { return result.Digest; } + set { SetDigest(value); } + } + public Builder SetDigest(global::D3.Account.Digest value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasDigest = true; + result.digest_ = value; + return this; + } + public Builder SetDigest(global::D3.Account.Digest.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasDigest = true; + result.digest_ = builderForValue.Build(); + return this; + } + public Builder MergeDigest(global::D3.Account.Digest value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasDigest && + result.digest_ != global::D3.Account.Digest.DefaultInstance) { + result.digest_ = global::D3.Account.Digest.CreateBuilder(result.digest_).MergeFrom(value).BuildPartial(); + } else { + result.digest_ = value; + } + result.hasDigest = true; + return this; + } + public Builder ClearDigest() { + PrepareBuilder(); + result.hasDigest = false; + result.digest_ = null; + return this; + } + + public bool HasSavedAttributes { + get { return result.hasSavedAttributes; } + } + public global::D3.AttributeSerializer.SavedAttributes SavedAttributes { + get { return result.SavedAttributes; } + set { SetSavedAttributes(value); } + } + public Builder SetSavedAttributes(global::D3.AttributeSerializer.SavedAttributes value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasSavedAttributes = true; + result.savedAttributes_ = value; + return this; + } + public Builder SetSavedAttributes(global::D3.AttributeSerializer.SavedAttributes.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasSavedAttributes = true; + result.savedAttributes_ = builderForValue.Build(); + return this; + } + public Builder MergeSavedAttributes(global::D3.AttributeSerializer.SavedAttributes value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasSavedAttributes && + result.savedAttributes_ != global::D3.AttributeSerializer.SavedAttributes.DefaultInstance) { + result.savedAttributes_ = global::D3.AttributeSerializer.SavedAttributes.CreateBuilder(result.savedAttributes_).MergeFrom(value).BuildPartial(); + } else { + result.savedAttributes_ = value; + } + result.hasSavedAttributes = true; + return this; + } + public Builder ClearSavedAttributes() { + PrepareBuilder(); + result.hasSavedAttributes = false; + result.savedAttributes_ = null; + return this; + } + + public bool HasSavedAttributesHardcore { + get { return result.hasSavedAttributesHardcore; } + } + public global::D3.AttributeSerializer.SavedAttributes SavedAttributesHardcore { + get { return result.SavedAttributesHardcore; } + set { SetSavedAttributesHardcore(value); } + } + public Builder SetSavedAttributesHardcore(global::D3.AttributeSerializer.SavedAttributes value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasSavedAttributesHardcore = true; + result.savedAttributesHardcore_ = value; + return this; + } + public Builder SetSavedAttributesHardcore(global::D3.AttributeSerializer.SavedAttributes.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasSavedAttributesHardcore = true; + result.savedAttributesHardcore_ = builderForValue.Build(); + return this; + } + public Builder MergeSavedAttributesHardcore(global::D3.AttributeSerializer.SavedAttributes value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasSavedAttributesHardcore && + result.savedAttributesHardcore_ != global::D3.AttributeSerializer.SavedAttributes.DefaultInstance) { + result.savedAttributesHardcore_ = global::D3.AttributeSerializer.SavedAttributes.CreateBuilder(result.savedAttributesHardcore_).MergeFrom(value).BuildPartial(); + } else { + result.savedAttributesHardcore_ = value; + } + result.hasSavedAttributesHardcore = true; + return this; + } + public Builder ClearSavedAttributesHardcore() { + PrepareBuilder(); + result.hasSavedAttributesHardcore = false; + result.savedAttributesHardcore_ = null; + return this; + } + + public bool HasNormalSharedSavedItems { + get { return result.hasNormalSharedSavedItems; } + } + public global::D3.Items.ItemList NormalSharedSavedItems { + get { return result.NormalSharedSavedItems; } + set { SetNormalSharedSavedItems(value); } + } + public Builder SetNormalSharedSavedItems(global::D3.Items.ItemList value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasNormalSharedSavedItems = true; + result.normalSharedSavedItems_ = value; + return this; + } + public Builder SetNormalSharedSavedItems(global::D3.Items.ItemList.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasNormalSharedSavedItems = true; + result.normalSharedSavedItems_ = builderForValue.Build(); + return this; + } + public Builder MergeNormalSharedSavedItems(global::D3.Items.ItemList value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasNormalSharedSavedItems && + result.normalSharedSavedItems_ != global::D3.Items.ItemList.DefaultInstance) { + result.normalSharedSavedItems_ = global::D3.Items.ItemList.CreateBuilder(result.normalSharedSavedItems_).MergeFrom(value).BuildPartial(); + } else { + result.normalSharedSavedItems_ = value; + } + result.hasNormalSharedSavedItems = true; + return this; + } + public Builder ClearNormalSharedSavedItems() { + PrepareBuilder(); + result.hasNormalSharedSavedItems = false; + result.normalSharedSavedItems_ = null; + return this; + } + + public bool HasHardcoreSharedSavedItems { + get { return result.hasHardcoreSharedSavedItems; } + } + public global::D3.Items.ItemList HardcoreSharedSavedItems { + get { return result.HardcoreSharedSavedItems; } + set { SetHardcoreSharedSavedItems(value); } + } + public Builder SetHardcoreSharedSavedItems(global::D3.Items.ItemList value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasHardcoreSharedSavedItems = true; + result.hardcoreSharedSavedItems_ = value; + return this; + } + public Builder SetHardcoreSharedSavedItems(global::D3.Items.ItemList.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasHardcoreSharedSavedItems = true; + result.hardcoreSharedSavedItems_ = builderForValue.Build(); + return this; + } + public Builder MergeHardcoreSharedSavedItems(global::D3.Items.ItemList value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasHardcoreSharedSavedItems && + result.hardcoreSharedSavedItems_ != global::D3.Items.ItemList.DefaultInstance) { + result.hardcoreSharedSavedItems_ = global::D3.Items.ItemList.CreateBuilder(result.hardcoreSharedSavedItems_).MergeFrom(value).BuildPartial(); + } else { + result.hardcoreSharedSavedItems_ = value; + } + result.hasHardcoreSharedSavedItems = true; + return this; + } + public Builder ClearHardcoreSharedSavedItems() { + PrepareBuilder(); + result.hasHardcoreSharedSavedItems = false; + result.hardcoreSharedSavedItems_ = null; + return this; + } + + public bool HasCrafterNormalData { + get { return result.hasCrafterNormalData; } + } + public global::D3.ItemCrafting.CrafterSavedData CrafterNormalData { + get { return result.CrafterNormalData; } + set { SetCrafterNormalData(value); } + } + public Builder SetCrafterNormalData(global::D3.ItemCrafting.CrafterSavedData value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasCrafterNormalData = true; + result.crafterNormalData_ = value; + return this; + } + public Builder SetCrafterNormalData(global::D3.ItemCrafting.CrafterSavedData.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasCrafterNormalData = true; + result.crafterNormalData_ = builderForValue.Build(); + return this; + } + public Builder MergeCrafterNormalData(global::D3.ItemCrafting.CrafterSavedData value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasCrafterNormalData && + result.crafterNormalData_ != global::D3.ItemCrafting.CrafterSavedData.DefaultInstance) { + result.crafterNormalData_ = global::D3.ItemCrafting.CrafterSavedData.CreateBuilder(result.crafterNormalData_).MergeFrom(value).BuildPartial(); + } else { + result.crafterNormalData_ = value; + } + result.hasCrafterNormalData = true; + return this; + } + public Builder ClearCrafterNormalData() { + PrepareBuilder(); + result.hasCrafterNormalData = false; + result.crafterNormalData_ = null; + return this; + } + + public bool HasCrafterHardcoreData { + get { return result.hasCrafterHardcoreData; } + } + public global::D3.ItemCrafting.CrafterSavedData CrafterHardcoreData { + get { return result.CrafterHardcoreData; } + set { SetCrafterHardcoreData(value); } + } + public Builder SetCrafterHardcoreData(global::D3.ItemCrafting.CrafterSavedData value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasCrafterHardcoreData = true; + result.crafterHardcoreData_ = value; + return this; + } + public Builder SetCrafterHardcoreData(global::D3.ItemCrafting.CrafterSavedData.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasCrafterHardcoreData = true; + result.crafterHardcoreData_ = builderForValue.Build(); + return this; + } + public Builder MergeCrafterHardcoreData(global::D3.ItemCrafting.CrafterSavedData value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasCrafterHardcoreData && + result.crafterHardcoreData_ != global::D3.ItemCrafting.CrafterSavedData.DefaultInstance) { + result.crafterHardcoreData_ = global::D3.ItemCrafting.CrafterSavedData.CreateBuilder(result.crafterHardcoreData_).MergeFrom(value).BuildPartial(); + } else { + result.crafterHardcoreData_ = value; + } + result.hasCrafterHardcoreData = true; + return this; + } + public Builder ClearCrafterHardcoreData() { + PrepareBuilder(); + result.hasCrafterHardcoreData = false; + result.crafterHardcoreData_ = null; + return this; + } + + public bool HasSeenTutorials { + get { return result.hasSeenTutorials; } + } + public pb::ByteString SeenTutorials { + get { return result.SeenTutorials; } + set { SetSeenTutorials(value); } + } + public Builder SetSeenTutorials(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasSeenTutorials = true; + result.seenTutorials_ = value; + return this; + } + public Builder ClearSeenTutorials() { + PrepareBuilder(); + result.hasSeenTutorials = false; + result.seenTutorials_ = pb::ByteString.Empty; + return this; + } + + public bool HasNumVoteKicksParticipatedIn { + get { return result.hasNumVoteKicksParticipatedIn; } + } + public long NumVoteKicksParticipatedIn { + get { return result.NumVoteKicksParticipatedIn; } + set { SetNumVoteKicksParticipatedIn(value); } + } + public Builder SetNumVoteKicksParticipatedIn(long value) { + PrepareBuilder(); + result.hasNumVoteKicksParticipatedIn = true; + result.numVoteKicksParticipatedIn_ = value; + return this; + } + public Builder ClearNumVoteKicksParticipatedIn() { + PrepareBuilder(); + result.hasNumVoteKicksParticipatedIn = false; + result.numVoteKicksParticipatedIn_ = 0; + return this; + } + + public bool HasNumVoteKicksInitiated { + get { return result.hasNumVoteKicksInitiated; } + } + public long NumVoteKicksInitiated { + get { return result.NumVoteKicksInitiated; } + set { SetNumVoteKicksInitiated(value); } + } + public Builder SetNumVoteKicksInitiated(long value) { + PrepareBuilder(); + result.hasNumVoteKicksInitiated = true; + result.numVoteKicksInitiated_ = value; + return this; + } + public Builder ClearNumVoteKicksInitiated() { + PrepareBuilder(); + result.hasNumVoteKicksInitiated = false; + result.numVoteKicksInitiated_ = 0; + return this; + } + + public bool HasNumPublicGamesNoKick { + get { return result.hasNumPublicGamesNoKick; } + } + public long NumPublicGamesNoKick { + get { return result.NumPublicGamesNoKick; } + set { SetNumPublicGamesNoKick(value); } + } + public Builder SetNumPublicGamesNoKick(long value) { + PrepareBuilder(); + result.hasNumPublicGamesNoKick = true; + result.numPublicGamesNoKick_ = value; + return this; + } + public Builder ClearNumPublicGamesNoKick() { + PrepareBuilder(); + result.hasNumPublicGamesNoKick = false; + result.numPublicGamesNoKick_ = 0; + return this; + } + + public bool HasTimesVoteKicked { + get { return result.hasTimesVoteKicked; } + } + public long TimesVoteKicked { + get { return result.TimesVoteKicked; } + set { SetTimesVoteKicked(value); } + } + public Builder SetTimesVoteKicked(long value) { + PrepareBuilder(); + result.hasTimesVoteKicked = true; + result.timesVoteKicked_ = value; + return this; + } + public Builder ClearTimesVoteKicked() { + PrepareBuilder(); + result.hasTimesVoteKicked = false; + result.timesVoteKicked_ = 0; + return this; + } + + public bool HasGoldIdNormal { + get { return result.hasGoldIdNormal; } + } + public global::D3.OnlineService.EntityId GoldIdNormal { + get { return result.GoldIdNormal; } + set { SetGoldIdNormal(value); } + } + public Builder SetGoldIdNormal(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasGoldIdNormal = true; + result.goldIdNormal_ = value; + return this; + } + public Builder SetGoldIdNormal(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasGoldIdNormal = true; + result.goldIdNormal_ = builderForValue.Build(); + return this; + } + public Builder MergeGoldIdNormal(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasGoldIdNormal && + result.goldIdNormal_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.goldIdNormal_ = global::D3.OnlineService.EntityId.CreateBuilder(result.goldIdNormal_).MergeFrom(value).BuildPartial(); + } else { + result.goldIdNormal_ = value; + } + result.hasGoldIdNormal = true; + return this; + } + public Builder ClearGoldIdNormal() { + PrepareBuilder(); + result.hasGoldIdNormal = false; + result.goldIdNormal_ = null; + return this; + } + + public bool HasGoldIdHardcore { + get { return result.hasGoldIdHardcore; } + } + public global::D3.OnlineService.EntityId GoldIdHardcore { + get { return result.GoldIdHardcore; } + set { SetGoldIdHardcore(value); } + } + public Builder SetGoldIdHardcore(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasGoldIdHardcore = true; + result.goldIdHardcore_ = value; + return this; + } + public Builder SetGoldIdHardcore(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasGoldIdHardcore = true; + result.goldIdHardcore_ = builderForValue.Build(); + return this; + } + public Builder MergeGoldIdHardcore(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasGoldIdHardcore && + result.goldIdHardcore_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.goldIdHardcore_ = global::D3.OnlineService.EntityId.CreateBuilder(result.goldIdHardcore_).MergeFrom(value).BuildPartial(); + } else { + result.goldIdHardcore_ = value; + } + result.hasGoldIdHardcore = true; + return this; + } + public Builder ClearGoldIdHardcore() { + PrepareBuilder(); + result.hasGoldIdHardcore = false; + result.goldIdHardcore_ = null; + return this; + } + } + static SavedDefinition() { + object.ReferenceEquals(global::D3.Account.Account.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code diff --git a/source/D3Proto/D3/AttributeSerializer/AttributeSerializer.cs b/src/LibMooNet/D3/AttributeSerializer/AttributeSerializer.cs similarity index 70% rename from source/D3Proto/D3/AttributeSerializer/AttributeSerializer.cs rename to src/LibMooNet/D3/AttributeSerializer/AttributeSerializer.cs index f71275b2..83448939 100644 --- a/source/D3Proto/D3/AttributeSerializer/AttributeSerializer.cs +++ b/src/LibMooNet/D3/AttributeSerializer/AttributeSerializer.cs @@ -1,4 +1,6 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code using pb = global::Google.ProtocolBuffers; using pbc = global::Google.ProtocolBuffers.Collections; @@ -6,6 +8,9 @@ using scg = global::System.Collections.Generic; namespace D3.AttributeSerializer { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public static partial class AttributeSerializer { #region Extension registration @@ -53,14 +58,20 @@ static AttributeSerializer() { } #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class SavedAttribute : pb::GeneratedMessage { - private static readonly SavedAttribute defaultInstance = new Builder().BuildPartial(); + private SavedAttribute() { } + private static readonly SavedAttribute defaultInstance = new SavedAttribute().MakeReadOnly(); + private static readonly string[] _savedAttributeFieldNames = new string[] { "key", "value" }; + private static readonly uint[] _savedAttributeFieldTags = new uint[] { 8, 16 }; public static SavedAttribute DefaultInstance { get { return defaultInstance; } } public override SavedAttribute DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override SavedAttribute ThisMessage { @@ -77,7 +88,7 @@ protected override SavedAttribute ThisMessage { public const int KeyFieldNumber = 1; private bool hasKey; - private int key_ = 0; + private int key_; public bool HasKey { get { return hasKey; } } @@ -87,7 +98,7 @@ public int Key { public const int ValueFieldNumber = 2; private bool hasValue; - private int value_ = 0; + private int value_; public bool HasValue { get { return hasValue; } } @@ -103,13 +114,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasKey) { - output.WriteSInt32(1, Key); + string[] field_names = _savedAttributeFieldNames; + if (hasKey) { + output.WriteSInt32(1, field_names[0], Key); } - if (HasValue) { - output.WriteSInt32(2, Value); + if (hasValue) { + output.WriteSInt32(2, field_names[1], Value); } UnknownFields.WriteTo(output); } @@ -121,10 +133,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasKey) { + if (hasKey) { size += pb::CodedOutputStream.ComputeSInt32Size(1, Key); } - if (HasValue) { + if (hasValue) { size += pb::CodedOutputStream.ComputeSInt32Size(2, Value); } size += UnknownFields.SerializedSize; @@ -157,38 +169,72 @@ public static SavedAttribute ParseDelimitedFrom(global::System.IO.Stream input) public static SavedAttribute ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static SavedAttribute ParseFrom(pb::CodedInputStream input) { + public static SavedAttribute ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SavedAttribute ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static SavedAttribute ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private SavedAttribute MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(SavedAttribute prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SavedAttribute cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - SavedAttribute result = new SavedAttribute(); + private bool resultIsReadOnly; + private SavedAttribute result; + + private SavedAttribute PrepareBuilder() { + if (resultIsReadOnly) { + SavedAttribute original = result; + result = new SavedAttribute(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override SavedAttribute MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SavedAttribute(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -200,12 +246,11 @@ public override SavedAttribute DefaultInstanceForType { } public override SavedAttribute BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - SavedAttribute returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -219,6 +264,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SavedAttribute other) { if (other == global::D3.AttributeSerializer.SavedAttribute.DefaultInstance) return this; + PrepareBuilder(); if (other.HasKey) { Key = other.Key; } @@ -229,20 +275,31 @@ public override Builder MergeFrom(SavedAttribute other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_savedAttributeFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _savedAttributeFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -254,53 +311,62 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 8: { - Key = input.ReadSInt32(); + result.hasKey = input.ReadSInt32(ref result.key_); break; } case 16: { - Value = input.ReadSInt32(); + result.hasValue = input.ReadSInt32(ref result.value_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasKey { - get { return result.HasKey; } + get { return result.hasKey; } } public int Key { get { return result.Key; } set { SetKey(value); } } public Builder SetKey(int value) { + PrepareBuilder(); result.hasKey = true; result.key_ = value; return this; } public Builder ClearKey() { + PrepareBuilder(); result.hasKey = false; result.key_ = 0; return this; } public bool HasValue { - get { return result.HasValue; } + get { return result.hasValue; } } public int Value { get { return result.Value; } set { SetValue(value); } } public Builder SetValue(int value) { + PrepareBuilder(); result.hasValue = true; result.value_ = value; return this; } public Builder ClearValue() { + PrepareBuilder(); result.hasValue = false; result.value_ = 0; return this; @@ -311,14 +377,20 @@ static SavedAttribute() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class SavedAttributes : pb::GeneratedMessage { - private static readonly SavedAttributes defaultInstance = new Builder().BuildPartial(); + private SavedAttributes() { } + private static readonly SavedAttributes defaultInstance = new SavedAttributes().MakeReadOnly(); + private static readonly string[] _savedAttributesFieldNames = new string[] { "attributes", "gb_handle" }; + private static readonly uint[] _savedAttributesFieldTags = new uint[] { 18, 10 }; public static SavedAttributes DefaultInstance { get { return defaultInstance; } } public override SavedAttributes DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override SavedAttributes ThisMessage { @@ -335,12 +407,12 @@ protected override SavedAttributes ThisMessage { public const int GbHandleFieldNumber = 1; private bool hasGbHandle; - private global::D3.GameBalance.Handle gbHandle_ = global::D3.GameBalance.Handle.DefaultInstance; + private global::D3.GameBalance.Handle gbHandle_; public bool HasGbHandle { get { return hasGbHandle; } } public global::D3.GameBalance.Handle GbHandle { - get { return gbHandle_; } + get { return gbHandle_ ?? global::D3.GameBalance.Handle.DefaultInstance; } } public const int AttributesFieldNumber = 2; @@ -366,13 +438,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasGbHandle) { - output.WriteMessage(1, GbHandle); + string[] field_names = _savedAttributesFieldNames; + if (hasGbHandle) { + output.WriteMessage(1, field_names[1], GbHandle); } - foreach (global::D3.AttributeSerializer.SavedAttribute element in AttributesList) { - output.WriteMessage(2, element); + if (attributes_.Count > 0) { + output.WriteMessageArray(2, field_names[0], attributes_); } UnknownFields.WriteTo(output); } @@ -384,7 +457,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasGbHandle) { + if (hasGbHandle) { size += pb::CodedOutputStream.ComputeMessageSize(1, GbHandle); } foreach (global::D3.AttributeSerializer.SavedAttribute element in AttributesList) { @@ -420,38 +493,73 @@ public static SavedAttributes ParseDelimitedFrom(global::System.IO.Stream input) public static SavedAttributes ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static SavedAttributes ParseFrom(pb::CodedInputStream input) { + public static SavedAttributes ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SavedAttributes ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static SavedAttributes ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private SavedAttributes MakeReadOnly() { + attributes_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(SavedAttributes prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SavedAttributes cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - SavedAttributes result = new SavedAttributes(); + private bool resultIsReadOnly; + private SavedAttributes result; + + private SavedAttributes PrepareBuilder() { + if (resultIsReadOnly) { + SavedAttributes original = result; + result = new SavedAttributes(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override SavedAttributes MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SavedAttributes(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -463,13 +571,11 @@ public override SavedAttributes DefaultInstanceForType { } public override SavedAttributes BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.attributes_.MakeReadOnly(); - SavedAttributes returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -483,30 +589,42 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SavedAttributes other) { if (other == global::D3.AttributeSerializer.SavedAttributes.DefaultInstance) return this; + PrepareBuilder(); if (other.HasGbHandle) { MergeGbHandle(other.GbHandle); } if (other.attributes_.Count != 0) { - base.AddRange(other.attributes_, result.attributes_); + result.attributes_.Add(other.attributes_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_savedAttributesFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _savedAttributesFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -518,12 +636,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::D3.GameBalance.Handle.Builder subBuilder = global::D3.GameBalance.Handle.CreateBuilder(); - if (HasGbHandle) { + if (result.hasGbHandle) { subBuilder.MergeFrom(GbHandle); } input.ReadMessage(subBuilder, extensionRegistry); @@ -531,18 +649,21 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 18: { - global::D3.AttributeSerializer.SavedAttribute.Builder subBuilder = global::D3.AttributeSerializer.SavedAttribute.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddAttributes(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.attributes_, global::D3.AttributeSerializer.SavedAttribute.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasGbHandle { - get { return result.HasGbHandle; } + get { return result.hasGbHandle; } } public global::D3.GameBalance.Handle GbHandle { get { return result.GbHandle; } @@ -550,19 +671,22 @@ public bool HasGbHandle { } public Builder SetGbHandle(global::D3.GameBalance.Handle value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasGbHandle = true; result.gbHandle_ = value; return this; } public Builder SetGbHandle(global::D3.GameBalance.Handle.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasGbHandle = true; result.gbHandle_ = builderForValue.Build(); return this; } public Builder MergeGbHandle(global::D3.GameBalance.Handle value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasGbHandle && + PrepareBuilder(); + if (result.hasGbHandle && result.gbHandle_ != global::D3.GameBalance.Handle.DefaultInstance) { result.gbHandle_ = global::D3.GameBalance.Handle.CreateBuilder(result.gbHandle_).MergeFrom(value).BuildPartial(); } else { @@ -572,13 +696,14 @@ public Builder MergeGbHandle(global::D3.GameBalance.Handle value) { return this; } public Builder ClearGbHandle() { + PrepareBuilder(); result.hasGbHandle = false; - result.gbHandle_ = global::D3.GameBalance.Handle.DefaultInstance; + result.gbHandle_ = null; return this; } public pbc::IPopsicleList AttributesList { - get { return result.attributes_; } + get { return PrepareBuilder().attributes_; } } public int AttributesCount { get { return result.AttributesCount; } @@ -588,29 +713,35 @@ public int AttributesCount { } public Builder SetAttributes(int index, global::D3.AttributeSerializer.SavedAttribute value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.attributes_[index] = value; return this; } public Builder SetAttributes(int index, global::D3.AttributeSerializer.SavedAttribute.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.attributes_[index] = builderForValue.Build(); return this; } public Builder AddAttributes(global::D3.AttributeSerializer.SavedAttribute value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.attributes_.Add(value); return this; } public Builder AddAttributes(global::D3.AttributeSerializer.SavedAttribute.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.attributes_.Add(builderForValue.Build()); return this; } public Builder AddRangeAttributes(scg::IEnumerable values) { - base.AddRange(values, result.attributes_); + PrepareBuilder(); + result.attributes_.Add(values); return this; } public Builder ClearAttributes() { + PrepareBuilder(); result.attributes_.Clear(); return this; } @@ -623,3 +754,5 @@ static SavedAttributes() { #endregion } + +#endregion Designer generated code diff --git a/src/LibMooNet/D3/AuctionHouse/AuctionHouse.cs b/src/LibMooNet/D3/AuctionHouse/AuctionHouse.cs new file mode 100644 index 00000000..dd2a72ae --- /dev/null +++ b/src/LibMooNet/D3/AuctionHouse/AuctionHouse.cs @@ -0,0 +1,3005 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace D3.AuctionHouse { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class AuctionHouse { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_D3_AuctionHouse_InventoryOperation__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_AuctionHouse_InventoryOperation__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_AuctionHouse_InventoryOperations__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_AuctionHouse_InventoryOperations__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_AuctionHouse_Item__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_AuctionHouse_Item__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_AuctionHouse_Escrow__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_AuctionHouse_Escrow__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_AuctionHouse_AuthorizeInfo__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_AuctionHouse_AuthorizeInfo__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_AuctionHouse_ClaimInfo__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_AuctionHouse_ClaimInfo__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_AuctionHouse_AccountInfo__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_AuctionHouse_AccountInfo__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static AuctionHouse() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "ChJBdWN0aW9uSG91c2UucHJvdG8SD0QzLkF1Y3Rpb25Ib3VzZRoOR0JIYW5k" + + "bGUucHJvdG8aE09ubGluZVNlcnZpY2UucHJvdG8aC0l0ZW1zLnByb3RvGgpI" + + "ZXJvLnByb3RvIqsCChJJbnZlbnRvcnlPcGVyYXRpb24SQAoJb3BlcmF0aW9u" + + "GAEgAigOMi0uRDMuQXVjdGlvbkhvdXNlLkludmVudG9yeU9wZXJhdGlvbi5P" + + "cGVyYXRpb24SNwoTdHJhbnNhY3Rpb25faGVyb19pZBgCIAIoCzIaLkQzLk9u" + + "bGluZVNlcnZpY2UuRW50aXR5SWQSJAoCaWQYAyACKAsyGC5EMy5PbmxpbmVT" + + "ZXJ2aWNlLkl0ZW1JZBIRCglpdGVtX3Nsb3QYBCABKBESFAoMc3F1YXJlX2lu" + + "ZGV4GAUgASgREiYKCWdlbmVyYXRvchgGIAEoCzITLkQzLkl0ZW1zLkdlbmVy" + + "YXRvciIjCglPcGVyYXRpb24SCgoGUkVNT1ZFEAASCgoGVVBEQVRFEAEiTgoT" + + "SW52ZW50b3J5T3BlcmF0aW9ucxI3CgpvcGVyYXRpb25zGAEgAygLMiMuRDMu" + + "QXVjdGlvbkhvdXNlLkludmVudG9yeU9wZXJhdGlvbiJUCgRJdGVtEiQKAmlk" + + "GAEgAigLMhguRDMuT25saW5lU2VydmljZS5JdGVtSWQSJgoJZ2VuZXJhdG9y" + + "GAIgAigLMhMuRDMuSXRlbXMuR2VuZXJhdG9yIr0BCgZFc2Nyb3cSDwoHdmVy" + + "c2lvbhgBIAIoDRIrCgxhdWN0aW9uX2l0ZW0YAiABKAsyFS5EMy5BdWN0aW9u" + + "SG91c2UuSXRlbRIgCgRoZXJvGAMgASgLMhIuRDMuSGVyby5TYXZlZERhdGES" + + "MwoPc2VydmljZWRfdG9rZW5zGAQgAygLMhouRDMuT25saW5lU2VydmljZS5F" + + "bnRpdHlJZCIeCgdWZXJzaW9uEhMKD0NVUlJFTlRfVkVSU0lPThABIqQBCg1B" + + "dXRob3JpemVJbmZvEi8KC2xvY2F0aW9uX2lkGAEgAigLMhouRDMuT25saW5l" + + "U2VydmljZS5FbnRpdHlJZBI3ChN0cmFuc2FjdGlvbl9oZXJvX2lkGAIgAigL" + + "MhouRDMuT25saW5lU2VydmljZS5FbnRpdHlJZBIpCgdpdGVtX2lkGAMgASgL" + + "MhguRDMuT25saW5lU2VydmljZS5JdGVtSWQiRAoJQ2xhaW1JbmZvEjcKE3Ry" + + "YW5zYWN0aW9uX2hlcm9faWQYASACKAsyGi5EMy5PbmxpbmVTZXJ2aWNlLkVu" + + "dGl0eUlkImwKC0FjY291bnRJbmZvEi4KCmFjY291bnRfaWQYASACKAsyGi5E" + + "My5PbmxpbmVTZXJ2aWNlLkVudGl0eUlkEi0KCWVzY3Jvd19pZBgCIAIoCzIa" + + "LkQzLk9ubGluZVNlcnZpY2UuRW50aXR5SWQ="); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_D3_AuctionHouse_InventoryOperation__Descriptor = Descriptor.MessageTypes[0]; + internal__static_D3_AuctionHouse_InventoryOperation__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_AuctionHouse_InventoryOperation__Descriptor, + new string[] { "Operation", "TransactionHeroId", "Id", "ItemSlot", "SquareIndex", "Generator", }); + internal__static_D3_AuctionHouse_InventoryOperations__Descriptor = Descriptor.MessageTypes[1]; + internal__static_D3_AuctionHouse_InventoryOperations__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_AuctionHouse_InventoryOperations__Descriptor, + new string[] { "Operations", }); + internal__static_D3_AuctionHouse_Item__Descriptor = Descriptor.MessageTypes[2]; + internal__static_D3_AuctionHouse_Item__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_AuctionHouse_Item__Descriptor, + new string[] { "Id", "Generator", }); + internal__static_D3_AuctionHouse_Escrow__Descriptor = Descriptor.MessageTypes[3]; + internal__static_D3_AuctionHouse_Escrow__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_AuctionHouse_Escrow__Descriptor, + new string[] { "Version", "AuctionItem", "Hero", "ServicedTokens", }); + internal__static_D3_AuctionHouse_AuthorizeInfo__Descriptor = Descriptor.MessageTypes[4]; + internal__static_D3_AuctionHouse_AuthorizeInfo__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_AuctionHouse_AuthorizeInfo__Descriptor, + new string[] { "LocationId", "TransactionHeroId", "ItemId", }); + internal__static_D3_AuctionHouse_ClaimInfo__Descriptor = Descriptor.MessageTypes[5]; + internal__static_D3_AuctionHouse_ClaimInfo__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_AuctionHouse_ClaimInfo__Descriptor, + new string[] { "TransactionHeroId", }); + internal__static_D3_AuctionHouse_AccountInfo__Descriptor = Descriptor.MessageTypes[6]; + internal__static_D3_AuctionHouse_AccountInfo__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_AuctionHouse_AccountInfo__Descriptor, + new string[] { "AccountId", "EscrowId", }); + return null; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::D3.GameBalance.GBHandle.Descriptor, + global::D3.OnlineService.OnlineService.Descriptor, + global::D3.Items.Items.Descriptor, + global::D3.Hero.Hero.Descriptor, + }, assigner); + } + #endregion + + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class InventoryOperation : pb::GeneratedMessage { + private InventoryOperation() { } + private static readonly InventoryOperation defaultInstance = new InventoryOperation().MakeReadOnly(); + private static readonly string[] _inventoryOperationFieldNames = new string[] { "generator", "id", "item_slot", "operation", "square_index", "transaction_hero_id" }; + private static readonly uint[] _inventoryOperationFieldTags = new uint[] { 50, 26, 32, 8, 40, 18 }; + public static InventoryOperation DefaultInstance { + get { return defaultInstance; } + } + + public override InventoryOperation DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override InventoryOperation ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.AuctionHouse.AuctionHouse.internal__static_D3_AuctionHouse_InventoryOperation__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.AuctionHouse.AuctionHouse.internal__static_D3_AuctionHouse_InventoryOperation__FieldAccessorTable; } + } + + #region Nested types + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static class Types { + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public enum Operation { + REMOVE = 0, + UPDATE = 1, + } + + } + #endregion + + public const int OperationFieldNumber = 1; + private bool hasOperation; + private global::D3.AuctionHouse.InventoryOperation.Types.Operation operation_ = global::D3.AuctionHouse.InventoryOperation.Types.Operation.REMOVE; + public bool HasOperation { + get { return hasOperation; } + } + public global::D3.AuctionHouse.InventoryOperation.Types.Operation Operation { + get { return operation_; } + } + + public const int TransactionHeroIdFieldNumber = 2; + private bool hasTransactionHeroId; + private global::D3.OnlineService.EntityId transactionHeroId_; + public bool HasTransactionHeroId { + get { return hasTransactionHeroId; } + } + public global::D3.OnlineService.EntityId TransactionHeroId { + get { return transactionHeroId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public const int IdFieldNumber = 3; + private bool hasId; + private global::D3.OnlineService.ItemId id_; + public bool HasId { + get { return hasId; } + } + public global::D3.OnlineService.ItemId Id { + get { return id_ ?? global::D3.OnlineService.ItemId.DefaultInstance; } + } + + public const int ItemSlotFieldNumber = 4; + private bool hasItemSlot; + private int itemSlot_; + public bool HasItemSlot { + get { return hasItemSlot; } + } + public int ItemSlot { + get { return itemSlot_; } + } + + public const int SquareIndexFieldNumber = 5; + private bool hasSquareIndex; + private int squareIndex_; + public bool HasSquareIndex { + get { return hasSquareIndex; } + } + public int SquareIndex { + get { return squareIndex_; } + } + + public const int GeneratorFieldNumber = 6; + private bool hasGenerator; + private global::D3.Items.Generator generator_; + public bool HasGenerator { + get { return hasGenerator; } + } + public global::D3.Items.Generator Generator { + get { return generator_ ?? global::D3.Items.Generator.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasOperation) return false; + if (!hasTransactionHeroId) return false; + if (!hasId) return false; + if (!TransactionHeroId.IsInitialized) return false; + if (!Id.IsInitialized) return false; + if (HasGenerator) { + if (!Generator.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _inventoryOperationFieldNames; + if (hasOperation) { + output.WriteEnum(1, field_names[3], (int) Operation, Operation); + } + if (hasTransactionHeroId) { + output.WriteMessage(2, field_names[5], TransactionHeroId); + } + if (hasId) { + output.WriteMessage(3, field_names[1], Id); + } + if (hasItemSlot) { + output.WriteSInt32(4, field_names[2], ItemSlot); + } + if (hasSquareIndex) { + output.WriteSInt32(5, field_names[4], SquareIndex); + } + if (hasGenerator) { + output.WriteMessage(6, field_names[0], Generator); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasOperation) { + size += pb::CodedOutputStream.ComputeEnumSize(1, (int) Operation); + } + if (hasTransactionHeroId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, TransactionHeroId); + } + if (hasId) { + size += pb::CodedOutputStream.ComputeMessageSize(3, Id); + } + if (hasItemSlot) { + size += pb::CodedOutputStream.ComputeSInt32Size(4, ItemSlot); + } + if (hasSquareIndex) { + size += pb::CodedOutputStream.ComputeSInt32Size(5, SquareIndex); + } + if (hasGenerator) { + size += pb::CodedOutputStream.ComputeMessageSize(6, Generator); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static InventoryOperation ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static InventoryOperation ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static InventoryOperation ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static InventoryOperation ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static InventoryOperation ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static InventoryOperation ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static InventoryOperation ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static InventoryOperation ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static InventoryOperation ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static InventoryOperation ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private InventoryOperation MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(InventoryOperation prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(InventoryOperation cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private InventoryOperation result; + + private InventoryOperation PrepareBuilder() { + if (resultIsReadOnly) { + InventoryOperation original = result; + result = new InventoryOperation(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override InventoryOperation MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.AuctionHouse.InventoryOperation.Descriptor; } + } + + public override InventoryOperation DefaultInstanceForType { + get { return global::D3.AuctionHouse.InventoryOperation.DefaultInstance; } + } + + public override InventoryOperation BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is InventoryOperation) { + return MergeFrom((InventoryOperation) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(InventoryOperation other) { + if (other == global::D3.AuctionHouse.InventoryOperation.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasOperation) { + Operation = other.Operation; + } + if (other.HasTransactionHeroId) { + MergeTransactionHeroId(other.TransactionHeroId); + } + if (other.HasId) { + MergeId(other.Id); + } + if (other.HasItemSlot) { + ItemSlot = other.ItemSlot; + } + if (other.HasSquareIndex) { + SquareIndex = other.SquareIndex; + } + if (other.HasGenerator) { + MergeGenerator(other.Generator); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_inventoryOperationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _inventoryOperationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + object unknown; + if(input.ReadEnum(ref result.operation_, out unknown)) { + result.hasOperation = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(1, (ulong)(int)unknown); + } + break; + } + case 18: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasTransactionHeroId) { + subBuilder.MergeFrom(TransactionHeroId); + } + input.ReadMessage(subBuilder, extensionRegistry); + TransactionHeroId = subBuilder.BuildPartial(); + break; + } + case 26: { + global::D3.OnlineService.ItemId.Builder subBuilder = global::D3.OnlineService.ItemId.CreateBuilder(); + if (result.hasId) { + subBuilder.MergeFrom(Id); + } + input.ReadMessage(subBuilder, extensionRegistry); + Id = subBuilder.BuildPartial(); + break; + } + case 32: { + result.hasItemSlot = input.ReadSInt32(ref result.itemSlot_); + break; + } + case 40: { + result.hasSquareIndex = input.ReadSInt32(ref result.squareIndex_); + break; + } + case 50: { + global::D3.Items.Generator.Builder subBuilder = global::D3.Items.Generator.CreateBuilder(); + if (result.hasGenerator) { + subBuilder.MergeFrom(Generator); + } + input.ReadMessage(subBuilder, extensionRegistry); + Generator = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasOperation { + get { return result.hasOperation; } + } + public global::D3.AuctionHouse.InventoryOperation.Types.Operation Operation { + get { return result.Operation; } + set { SetOperation(value); } + } + public Builder SetOperation(global::D3.AuctionHouse.InventoryOperation.Types.Operation value) { + PrepareBuilder(); + result.hasOperation = true; + result.operation_ = value; + return this; + } + public Builder ClearOperation() { + PrepareBuilder(); + result.hasOperation = false; + result.operation_ = global::D3.AuctionHouse.InventoryOperation.Types.Operation.REMOVE; + return this; + } + + public bool HasTransactionHeroId { + get { return result.hasTransactionHeroId; } + } + public global::D3.OnlineService.EntityId TransactionHeroId { + get { return result.TransactionHeroId; } + set { SetTransactionHeroId(value); } + } + public Builder SetTransactionHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTransactionHeroId = true; + result.transactionHeroId_ = value; + return this; + } + public Builder SetTransactionHeroId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasTransactionHeroId = true; + result.transactionHeroId_ = builderForValue.Build(); + return this; + } + public Builder MergeTransactionHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasTransactionHeroId && + result.transactionHeroId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.transactionHeroId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.transactionHeroId_).MergeFrom(value).BuildPartial(); + } else { + result.transactionHeroId_ = value; + } + result.hasTransactionHeroId = true; + return this; + } + public Builder ClearTransactionHeroId() { + PrepareBuilder(); + result.hasTransactionHeroId = false; + result.transactionHeroId_ = null; + return this; + } + + public bool HasId { + get { return result.hasId; } + } + public global::D3.OnlineService.ItemId Id { + get { return result.Id; } + set { SetId(value); } + } + public Builder SetId(global::D3.OnlineService.ItemId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasId = true; + result.id_ = value; + return this; + } + public Builder SetId(global::D3.OnlineService.ItemId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasId = true; + result.id_ = builderForValue.Build(); + return this; + } + public Builder MergeId(global::D3.OnlineService.ItemId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasId && + result.id_ != global::D3.OnlineService.ItemId.DefaultInstance) { + result.id_ = global::D3.OnlineService.ItemId.CreateBuilder(result.id_).MergeFrom(value).BuildPartial(); + } else { + result.id_ = value; + } + result.hasId = true; + return this; + } + public Builder ClearId() { + PrepareBuilder(); + result.hasId = false; + result.id_ = null; + return this; + } + + public bool HasItemSlot { + get { return result.hasItemSlot; } + } + public int ItemSlot { + get { return result.ItemSlot; } + set { SetItemSlot(value); } + } + public Builder SetItemSlot(int value) { + PrepareBuilder(); + result.hasItemSlot = true; + result.itemSlot_ = value; + return this; + } + public Builder ClearItemSlot() { + PrepareBuilder(); + result.hasItemSlot = false; + result.itemSlot_ = 0; + return this; + } + + public bool HasSquareIndex { + get { return result.hasSquareIndex; } + } + public int SquareIndex { + get { return result.SquareIndex; } + set { SetSquareIndex(value); } + } + public Builder SetSquareIndex(int value) { + PrepareBuilder(); + result.hasSquareIndex = true; + result.squareIndex_ = value; + return this; + } + public Builder ClearSquareIndex() { + PrepareBuilder(); + result.hasSquareIndex = false; + result.squareIndex_ = 0; + return this; + } + + public bool HasGenerator { + get { return result.hasGenerator; } + } + public global::D3.Items.Generator Generator { + get { return result.Generator; } + set { SetGenerator(value); } + } + public Builder SetGenerator(global::D3.Items.Generator value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasGenerator = true; + result.generator_ = value; + return this; + } + public Builder SetGenerator(global::D3.Items.Generator.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasGenerator = true; + result.generator_ = builderForValue.Build(); + return this; + } + public Builder MergeGenerator(global::D3.Items.Generator value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasGenerator && + result.generator_ != global::D3.Items.Generator.DefaultInstance) { + result.generator_ = global::D3.Items.Generator.CreateBuilder(result.generator_).MergeFrom(value).BuildPartial(); + } else { + result.generator_ = value; + } + result.hasGenerator = true; + return this; + } + public Builder ClearGenerator() { + PrepareBuilder(); + result.hasGenerator = false; + result.generator_ = null; + return this; + } + } + static InventoryOperation() { + object.ReferenceEquals(global::D3.AuctionHouse.AuctionHouse.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class InventoryOperations : pb::GeneratedMessage { + private InventoryOperations() { } + private static readonly InventoryOperations defaultInstance = new InventoryOperations().MakeReadOnly(); + private static readonly string[] _inventoryOperationsFieldNames = new string[] { "operations" }; + private static readonly uint[] _inventoryOperationsFieldTags = new uint[] { 10 }; + public static InventoryOperations DefaultInstance { + get { return defaultInstance; } + } + + public override InventoryOperations DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override InventoryOperations ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.AuctionHouse.AuctionHouse.internal__static_D3_AuctionHouse_InventoryOperations__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.AuctionHouse.AuctionHouse.internal__static_D3_AuctionHouse_InventoryOperations__FieldAccessorTable; } + } + + public const int OperationsFieldNumber = 1; + private pbc::PopsicleList operations_ = new pbc::PopsicleList(); + public scg::IList OperationsList { + get { return operations_; } + } + public int OperationsCount { + get { return operations_.Count; } + } + public global::D3.AuctionHouse.InventoryOperation GetOperations(int index) { + return operations_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::D3.AuctionHouse.InventoryOperation element in OperationsList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _inventoryOperationsFieldNames; + if (operations_.Count > 0) { + output.WriteMessageArray(1, field_names[0], operations_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::D3.AuctionHouse.InventoryOperation element in OperationsList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static InventoryOperations ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static InventoryOperations ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static InventoryOperations ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static InventoryOperations ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static InventoryOperations ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static InventoryOperations ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static InventoryOperations ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static InventoryOperations ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static InventoryOperations ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static InventoryOperations ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private InventoryOperations MakeReadOnly() { + operations_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(InventoryOperations prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(InventoryOperations cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private InventoryOperations result; + + private InventoryOperations PrepareBuilder() { + if (resultIsReadOnly) { + InventoryOperations original = result; + result = new InventoryOperations(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override InventoryOperations MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.AuctionHouse.InventoryOperations.Descriptor; } + } + + public override InventoryOperations DefaultInstanceForType { + get { return global::D3.AuctionHouse.InventoryOperations.DefaultInstance; } + } + + public override InventoryOperations BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is InventoryOperations) { + return MergeFrom((InventoryOperations) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(InventoryOperations other) { + if (other == global::D3.AuctionHouse.InventoryOperations.DefaultInstance) return this; + PrepareBuilder(); + if (other.operations_.Count != 0) { + result.operations_.Add(other.operations_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_inventoryOperationsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _inventoryOperationsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.operations_, global::D3.AuctionHouse.InventoryOperation.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList OperationsList { + get { return PrepareBuilder().operations_; } + } + public int OperationsCount { + get { return result.OperationsCount; } + } + public global::D3.AuctionHouse.InventoryOperation GetOperations(int index) { + return result.GetOperations(index); + } + public Builder SetOperations(int index, global::D3.AuctionHouse.InventoryOperation value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.operations_[index] = value; + return this; + } + public Builder SetOperations(int index, global::D3.AuctionHouse.InventoryOperation.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.operations_[index] = builderForValue.Build(); + return this; + } + public Builder AddOperations(global::D3.AuctionHouse.InventoryOperation value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.operations_.Add(value); + return this; + } + public Builder AddOperations(global::D3.AuctionHouse.InventoryOperation.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.operations_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeOperations(scg::IEnumerable values) { + PrepareBuilder(); + result.operations_.Add(values); + return this; + } + public Builder ClearOperations() { + PrepareBuilder(); + result.operations_.Clear(); + return this; + } + } + static InventoryOperations() { + object.ReferenceEquals(global::D3.AuctionHouse.AuctionHouse.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Item : pb::GeneratedMessage { + private Item() { } + private static readonly Item defaultInstance = new Item().MakeReadOnly(); + private static readonly string[] _itemFieldNames = new string[] { "generator", "id" }; + private static readonly uint[] _itemFieldTags = new uint[] { 18, 10 }; + public static Item DefaultInstance { + get { return defaultInstance; } + } + + public override Item DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Item ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.AuctionHouse.AuctionHouse.internal__static_D3_AuctionHouse_Item__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.AuctionHouse.AuctionHouse.internal__static_D3_AuctionHouse_Item__FieldAccessorTable; } + } + + public const int IdFieldNumber = 1; + private bool hasId; + private global::D3.OnlineService.ItemId id_; + public bool HasId { + get { return hasId; } + } + public global::D3.OnlineService.ItemId Id { + get { return id_ ?? global::D3.OnlineService.ItemId.DefaultInstance; } + } + + public const int GeneratorFieldNumber = 2; + private bool hasGenerator; + private global::D3.Items.Generator generator_; + public bool HasGenerator { + get { return hasGenerator; } + } + public global::D3.Items.Generator Generator { + get { return generator_ ?? global::D3.Items.Generator.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasId) return false; + if (!hasGenerator) return false; + if (!Id.IsInitialized) return false; + if (!Generator.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _itemFieldNames; + if (hasId) { + output.WriteMessage(1, field_names[1], Id); + } + if (hasGenerator) { + output.WriteMessage(2, field_names[0], Generator); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Id); + } + if (hasGenerator) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Generator); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static Item ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Item ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Item ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Item ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Item ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Item ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Item ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Item ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Item ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Item ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Item MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Item prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Item cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Item result; + + private Item PrepareBuilder() { + if (resultIsReadOnly) { + Item original = result; + result = new Item(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Item MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.AuctionHouse.Item.Descriptor; } + } + + public override Item DefaultInstanceForType { + get { return global::D3.AuctionHouse.Item.DefaultInstance; } + } + + public override Item BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Item) { + return MergeFrom((Item) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Item other) { + if (other == global::D3.AuctionHouse.Item.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasId) { + MergeId(other.Id); + } + if (other.HasGenerator) { + MergeGenerator(other.Generator); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_itemFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _itemFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.OnlineService.ItemId.Builder subBuilder = global::D3.OnlineService.ItemId.CreateBuilder(); + if (result.hasId) { + subBuilder.MergeFrom(Id); + } + input.ReadMessage(subBuilder, extensionRegistry); + Id = subBuilder.BuildPartial(); + break; + } + case 18: { + global::D3.Items.Generator.Builder subBuilder = global::D3.Items.Generator.CreateBuilder(); + if (result.hasGenerator) { + subBuilder.MergeFrom(Generator); + } + input.ReadMessage(subBuilder, extensionRegistry); + Generator = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasId { + get { return result.hasId; } + } + public global::D3.OnlineService.ItemId Id { + get { return result.Id; } + set { SetId(value); } + } + public Builder SetId(global::D3.OnlineService.ItemId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasId = true; + result.id_ = value; + return this; + } + public Builder SetId(global::D3.OnlineService.ItemId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasId = true; + result.id_ = builderForValue.Build(); + return this; + } + public Builder MergeId(global::D3.OnlineService.ItemId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasId && + result.id_ != global::D3.OnlineService.ItemId.DefaultInstance) { + result.id_ = global::D3.OnlineService.ItemId.CreateBuilder(result.id_).MergeFrom(value).BuildPartial(); + } else { + result.id_ = value; + } + result.hasId = true; + return this; + } + public Builder ClearId() { + PrepareBuilder(); + result.hasId = false; + result.id_ = null; + return this; + } + + public bool HasGenerator { + get { return result.hasGenerator; } + } + public global::D3.Items.Generator Generator { + get { return result.Generator; } + set { SetGenerator(value); } + } + public Builder SetGenerator(global::D3.Items.Generator value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasGenerator = true; + result.generator_ = value; + return this; + } + public Builder SetGenerator(global::D3.Items.Generator.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasGenerator = true; + result.generator_ = builderForValue.Build(); + return this; + } + public Builder MergeGenerator(global::D3.Items.Generator value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasGenerator && + result.generator_ != global::D3.Items.Generator.DefaultInstance) { + result.generator_ = global::D3.Items.Generator.CreateBuilder(result.generator_).MergeFrom(value).BuildPartial(); + } else { + result.generator_ = value; + } + result.hasGenerator = true; + return this; + } + public Builder ClearGenerator() { + PrepareBuilder(); + result.hasGenerator = false; + result.generator_ = null; + return this; + } + } + static Item() { + object.ReferenceEquals(global::D3.AuctionHouse.AuctionHouse.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Escrow : pb::GeneratedMessage { + private Escrow() { } + private static readonly Escrow defaultInstance = new Escrow().MakeReadOnly(); + private static readonly string[] _escrowFieldNames = new string[] { "auction_item", "hero", "serviced_tokens", "version" }; + private static readonly uint[] _escrowFieldTags = new uint[] { 18, 26, 34, 8 }; + public static Escrow DefaultInstance { + get { return defaultInstance; } + } + + public override Escrow DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Escrow ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.AuctionHouse.AuctionHouse.internal__static_D3_AuctionHouse_Escrow__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.AuctionHouse.AuctionHouse.internal__static_D3_AuctionHouse_Escrow__FieldAccessorTable; } + } + + #region Nested types + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static class Types { + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public enum Version { + CURRENT_VERSION = 1, + } + + } + #endregion + + public const int VersionFieldNumber = 1; + private bool hasVersion; + private uint version_; + public bool HasVersion { + get { return hasVersion; } + } + public uint Version { + get { return version_; } + } + + public const int AuctionItemFieldNumber = 2; + private bool hasAuctionItem; + private global::D3.AuctionHouse.Item auctionItem_; + public bool HasAuctionItem { + get { return hasAuctionItem; } + } + public global::D3.AuctionHouse.Item AuctionItem { + get { return auctionItem_ ?? global::D3.AuctionHouse.Item.DefaultInstance; } + } + + public const int HeroFieldNumber = 3; + private bool hasHero; + private global::D3.Hero.SavedData hero_; + public bool HasHero { + get { return hasHero; } + } + public global::D3.Hero.SavedData Hero { + get { return hero_ ?? global::D3.Hero.SavedData.DefaultInstance; } + } + + public const int ServicedTokensFieldNumber = 4; + private pbc::PopsicleList servicedTokens_ = new pbc::PopsicleList(); + public scg::IList ServicedTokensList { + get { return servicedTokens_; } + } + public int ServicedTokensCount { + get { return servicedTokens_.Count; } + } + public global::D3.OnlineService.EntityId GetServicedTokens(int index) { + return servicedTokens_[index]; + } + + public override bool IsInitialized { + get { + if (!hasVersion) return false; + if (HasAuctionItem) { + if (!AuctionItem.IsInitialized) return false; + } + if (HasHero) { + if (!Hero.IsInitialized) return false; + } + foreach (global::D3.OnlineService.EntityId element in ServicedTokensList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _escrowFieldNames; + if (hasVersion) { + output.WriteUInt32(1, field_names[3], Version); + } + if (hasAuctionItem) { + output.WriteMessage(2, field_names[0], AuctionItem); + } + if (hasHero) { + output.WriteMessage(3, field_names[1], Hero); + } + if (servicedTokens_.Count > 0) { + output.WriteMessageArray(4, field_names[2], servicedTokens_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasVersion) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, Version); + } + if (hasAuctionItem) { + size += pb::CodedOutputStream.ComputeMessageSize(2, AuctionItem); + } + if (hasHero) { + size += pb::CodedOutputStream.ComputeMessageSize(3, Hero); + } + foreach (global::D3.OnlineService.EntityId element in ServicedTokensList) { + size += pb::CodedOutputStream.ComputeMessageSize(4, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static Escrow ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Escrow ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Escrow ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Escrow ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Escrow ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Escrow ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Escrow ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Escrow ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Escrow ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Escrow ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Escrow MakeReadOnly() { + servicedTokens_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Escrow prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Escrow cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Escrow result; + + private Escrow PrepareBuilder() { + if (resultIsReadOnly) { + Escrow original = result; + result = new Escrow(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Escrow MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.AuctionHouse.Escrow.Descriptor; } + } + + public override Escrow DefaultInstanceForType { + get { return global::D3.AuctionHouse.Escrow.DefaultInstance; } + } + + public override Escrow BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Escrow) { + return MergeFrom((Escrow) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Escrow other) { + if (other == global::D3.AuctionHouse.Escrow.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasVersion) { + Version = other.Version; + } + if (other.HasAuctionItem) { + MergeAuctionItem(other.AuctionItem); + } + if (other.HasHero) { + MergeHero(other.Hero); + } + if (other.servicedTokens_.Count != 0) { + result.servicedTokens_.Add(other.servicedTokens_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_escrowFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _escrowFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasVersion = input.ReadUInt32(ref result.version_); + break; + } + case 18: { + global::D3.AuctionHouse.Item.Builder subBuilder = global::D3.AuctionHouse.Item.CreateBuilder(); + if (result.hasAuctionItem) { + subBuilder.MergeFrom(AuctionItem); + } + input.ReadMessage(subBuilder, extensionRegistry); + AuctionItem = subBuilder.BuildPartial(); + break; + } + case 26: { + global::D3.Hero.SavedData.Builder subBuilder = global::D3.Hero.SavedData.CreateBuilder(); + if (result.hasHero) { + subBuilder.MergeFrom(Hero); + } + input.ReadMessage(subBuilder, extensionRegistry); + Hero = subBuilder.BuildPartial(); + break; + } + case 34: { + input.ReadMessageArray(tag, field_name, result.servicedTokens_, global::D3.OnlineService.EntityId.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasVersion { + get { return result.hasVersion; } + } + public uint Version { + get { return result.Version; } + set { SetVersion(value); } + } + public Builder SetVersion(uint value) { + PrepareBuilder(); + result.hasVersion = true; + result.version_ = value; + return this; + } + public Builder ClearVersion() { + PrepareBuilder(); + result.hasVersion = false; + result.version_ = 0; + return this; + } + + public bool HasAuctionItem { + get { return result.hasAuctionItem; } + } + public global::D3.AuctionHouse.Item AuctionItem { + get { return result.AuctionItem; } + set { SetAuctionItem(value); } + } + public Builder SetAuctionItem(global::D3.AuctionHouse.Item value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAuctionItem = true; + result.auctionItem_ = value; + return this; + } + public Builder SetAuctionItem(global::D3.AuctionHouse.Item.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAuctionItem = true; + result.auctionItem_ = builderForValue.Build(); + return this; + } + public Builder MergeAuctionItem(global::D3.AuctionHouse.Item value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAuctionItem && + result.auctionItem_ != global::D3.AuctionHouse.Item.DefaultInstance) { + result.auctionItem_ = global::D3.AuctionHouse.Item.CreateBuilder(result.auctionItem_).MergeFrom(value).BuildPartial(); + } else { + result.auctionItem_ = value; + } + result.hasAuctionItem = true; + return this; + } + public Builder ClearAuctionItem() { + PrepareBuilder(); + result.hasAuctionItem = false; + result.auctionItem_ = null; + return this; + } + + public bool HasHero { + get { return result.hasHero; } + } + public global::D3.Hero.SavedData Hero { + get { return result.Hero; } + set { SetHero(value); } + } + public Builder SetHero(global::D3.Hero.SavedData value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasHero = true; + result.hero_ = value; + return this; + } + public Builder SetHero(global::D3.Hero.SavedData.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasHero = true; + result.hero_ = builderForValue.Build(); + return this; + } + public Builder MergeHero(global::D3.Hero.SavedData value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasHero && + result.hero_ != global::D3.Hero.SavedData.DefaultInstance) { + result.hero_ = global::D3.Hero.SavedData.CreateBuilder(result.hero_).MergeFrom(value).BuildPartial(); + } else { + result.hero_ = value; + } + result.hasHero = true; + return this; + } + public Builder ClearHero() { + PrepareBuilder(); + result.hasHero = false; + result.hero_ = null; + return this; + } + + public pbc::IPopsicleList ServicedTokensList { + get { return PrepareBuilder().servicedTokens_; } + } + public int ServicedTokensCount { + get { return result.ServicedTokensCount; } + } + public global::D3.OnlineService.EntityId GetServicedTokens(int index) { + return result.GetServicedTokens(index); + } + public Builder SetServicedTokens(int index, global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.servicedTokens_[index] = value; + return this; + } + public Builder SetServicedTokens(int index, global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.servicedTokens_[index] = builderForValue.Build(); + return this; + } + public Builder AddServicedTokens(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.servicedTokens_.Add(value); + return this; + } + public Builder AddServicedTokens(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.servicedTokens_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeServicedTokens(scg::IEnumerable values) { + PrepareBuilder(); + result.servicedTokens_.Add(values); + return this; + } + public Builder ClearServicedTokens() { + PrepareBuilder(); + result.servicedTokens_.Clear(); + return this; + } + } + static Escrow() { + object.ReferenceEquals(global::D3.AuctionHouse.AuctionHouse.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class AuthorizeInfo : pb::GeneratedMessage { + private AuthorizeInfo() { } + private static readonly AuthorizeInfo defaultInstance = new AuthorizeInfo().MakeReadOnly(); + private static readonly string[] _authorizeInfoFieldNames = new string[] { "item_id", "location_id", "transaction_hero_id" }; + private static readonly uint[] _authorizeInfoFieldTags = new uint[] { 26, 10, 18 }; + public static AuthorizeInfo DefaultInstance { + get { return defaultInstance; } + } + + public override AuthorizeInfo DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override AuthorizeInfo ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.AuctionHouse.AuctionHouse.internal__static_D3_AuctionHouse_AuthorizeInfo__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.AuctionHouse.AuctionHouse.internal__static_D3_AuctionHouse_AuthorizeInfo__FieldAccessorTable; } + } + + public const int LocationIdFieldNumber = 1; + private bool hasLocationId; + private global::D3.OnlineService.EntityId locationId_; + public bool HasLocationId { + get { return hasLocationId; } + } + public global::D3.OnlineService.EntityId LocationId { + get { return locationId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public const int TransactionHeroIdFieldNumber = 2; + private bool hasTransactionHeroId; + private global::D3.OnlineService.EntityId transactionHeroId_; + public bool HasTransactionHeroId { + get { return hasTransactionHeroId; } + } + public global::D3.OnlineService.EntityId TransactionHeroId { + get { return transactionHeroId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public const int ItemIdFieldNumber = 3; + private bool hasItemId; + private global::D3.OnlineService.ItemId itemId_; + public bool HasItemId { + get { return hasItemId; } + } + public global::D3.OnlineService.ItemId ItemId { + get { return itemId_ ?? global::D3.OnlineService.ItemId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasLocationId) return false; + if (!hasTransactionHeroId) return false; + if (!LocationId.IsInitialized) return false; + if (!TransactionHeroId.IsInitialized) return false; + if (HasItemId) { + if (!ItemId.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _authorizeInfoFieldNames; + if (hasLocationId) { + output.WriteMessage(1, field_names[1], LocationId); + } + if (hasTransactionHeroId) { + output.WriteMessage(2, field_names[2], TransactionHeroId); + } + if (hasItemId) { + output.WriteMessage(3, field_names[0], ItemId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasLocationId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, LocationId); + } + if (hasTransactionHeroId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, TransactionHeroId); + } + if (hasItemId) { + size += pb::CodedOutputStream.ComputeMessageSize(3, ItemId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static AuthorizeInfo ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AuthorizeInfo ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AuthorizeInfo ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AuthorizeInfo ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AuthorizeInfo ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AuthorizeInfo ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static AuthorizeInfo ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static AuthorizeInfo ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static AuthorizeInfo ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AuthorizeInfo ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private AuthorizeInfo MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(AuthorizeInfo prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(AuthorizeInfo cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private AuthorizeInfo result; + + private AuthorizeInfo PrepareBuilder() { + if (resultIsReadOnly) { + AuthorizeInfo original = result; + result = new AuthorizeInfo(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override AuthorizeInfo MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.AuctionHouse.AuthorizeInfo.Descriptor; } + } + + public override AuthorizeInfo DefaultInstanceForType { + get { return global::D3.AuctionHouse.AuthorizeInfo.DefaultInstance; } + } + + public override AuthorizeInfo BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is AuthorizeInfo) { + return MergeFrom((AuthorizeInfo) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(AuthorizeInfo other) { + if (other == global::D3.AuctionHouse.AuthorizeInfo.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasLocationId) { + MergeLocationId(other.LocationId); + } + if (other.HasTransactionHeroId) { + MergeTransactionHeroId(other.TransactionHeroId); + } + if (other.HasItemId) { + MergeItemId(other.ItemId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_authorizeInfoFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _authorizeInfoFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasLocationId) { + subBuilder.MergeFrom(LocationId); + } + input.ReadMessage(subBuilder, extensionRegistry); + LocationId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasTransactionHeroId) { + subBuilder.MergeFrom(TransactionHeroId); + } + input.ReadMessage(subBuilder, extensionRegistry); + TransactionHeroId = subBuilder.BuildPartial(); + break; + } + case 26: { + global::D3.OnlineService.ItemId.Builder subBuilder = global::D3.OnlineService.ItemId.CreateBuilder(); + if (result.hasItemId) { + subBuilder.MergeFrom(ItemId); + } + input.ReadMessage(subBuilder, extensionRegistry); + ItemId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasLocationId { + get { return result.hasLocationId; } + } + public global::D3.OnlineService.EntityId LocationId { + get { return result.LocationId; } + set { SetLocationId(value); } + } + public Builder SetLocationId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasLocationId = true; + result.locationId_ = value; + return this; + } + public Builder SetLocationId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasLocationId = true; + result.locationId_ = builderForValue.Build(); + return this; + } + public Builder MergeLocationId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasLocationId && + result.locationId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.locationId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.locationId_).MergeFrom(value).BuildPartial(); + } else { + result.locationId_ = value; + } + result.hasLocationId = true; + return this; + } + public Builder ClearLocationId() { + PrepareBuilder(); + result.hasLocationId = false; + result.locationId_ = null; + return this; + } + + public bool HasTransactionHeroId { + get { return result.hasTransactionHeroId; } + } + public global::D3.OnlineService.EntityId TransactionHeroId { + get { return result.TransactionHeroId; } + set { SetTransactionHeroId(value); } + } + public Builder SetTransactionHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTransactionHeroId = true; + result.transactionHeroId_ = value; + return this; + } + public Builder SetTransactionHeroId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasTransactionHeroId = true; + result.transactionHeroId_ = builderForValue.Build(); + return this; + } + public Builder MergeTransactionHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasTransactionHeroId && + result.transactionHeroId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.transactionHeroId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.transactionHeroId_).MergeFrom(value).BuildPartial(); + } else { + result.transactionHeroId_ = value; + } + result.hasTransactionHeroId = true; + return this; + } + public Builder ClearTransactionHeroId() { + PrepareBuilder(); + result.hasTransactionHeroId = false; + result.transactionHeroId_ = null; + return this; + } + + public bool HasItemId { + get { return result.hasItemId; } + } + public global::D3.OnlineService.ItemId ItemId { + get { return result.ItemId; } + set { SetItemId(value); } + } + public Builder SetItemId(global::D3.OnlineService.ItemId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasItemId = true; + result.itemId_ = value; + return this; + } + public Builder SetItemId(global::D3.OnlineService.ItemId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasItemId = true; + result.itemId_ = builderForValue.Build(); + return this; + } + public Builder MergeItemId(global::D3.OnlineService.ItemId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasItemId && + result.itemId_ != global::D3.OnlineService.ItemId.DefaultInstance) { + result.itemId_ = global::D3.OnlineService.ItemId.CreateBuilder(result.itemId_).MergeFrom(value).BuildPartial(); + } else { + result.itemId_ = value; + } + result.hasItemId = true; + return this; + } + public Builder ClearItemId() { + PrepareBuilder(); + result.hasItemId = false; + result.itemId_ = null; + return this; + } + } + static AuthorizeInfo() { + object.ReferenceEquals(global::D3.AuctionHouse.AuctionHouse.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ClaimInfo : pb::GeneratedMessage { + private ClaimInfo() { } + private static readonly ClaimInfo defaultInstance = new ClaimInfo().MakeReadOnly(); + private static readonly string[] _claimInfoFieldNames = new string[] { "transaction_hero_id" }; + private static readonly uint[] _claimInfoFieldTags = new uint[] { 10 }; + public static ClaimInfo DefaultInstance { + get { return defaultInstance; } + } + + public override ClaimInfo DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ClaimInfo ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.AuctionHouse.AuctionHouse.internal__static_D3_AuctionHouse_ClaimInfo__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.AuctionHouse.AuctionHouse.internal__static_D3_AuctionHouse_ClaimInfo__FieldAccessorTable; } + } + + public const int TransactionHeroIdFieldNumber = 1; + private bool hasTransactionHeroId; + private global::D3.OnlineService.EntityId transactionHeroId_; + public bool HasTransactionHeroId { + get { return hasTransactionHeroId; } + } + public global::D3.OnlineService.EntityId TransactionHeroId { + get { return transactionHeroId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasTransactionHeroId) return false; + if (!TransactionHeroId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _claimInfoFieldNames; + if (hasTransactionHeroId) { + output.WriteMessage(1, field_names[0], TransactionHeroId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTransactionHeroId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, TransactionHeroId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ClaimInfo ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ClaimInfo ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ClaimInfo ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ClaimInfo ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ClaimInfo ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ClaimInfo ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ClaimInfo ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ClaimInfo ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ClaimInfo ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ClaimInfo ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ClaimInfo MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ClaimInfo prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ClaimInfo cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ClaimInfo result; + + private ClaimInfo PrepareBuilder() { + if (resultIsReadOnly) { + ClaimInfo original = result; + result = new ClaimInfo(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ClaimInfo MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.AuctionHouse.ClaimInfo.Descriptor; } + } + + public override ClaimInfo DefaultInstanceForType { + get { return global::D3.AuctionHouse.ClaimInfo.DefaultInstance; } + } + + public override ClaimInfo BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ClaimInfo) { + return MergeFrom((ClaimInfo) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ClaimInfo other) { + if (other == global::D3.AuctionHouse.ClaimInfo.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTransactionHeroId) { + MergeTransactionHeroId(other.TransactionHeroId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_claimInfoFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _claimInfoFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasTransactionHeroId) { + subBuilder.MergeFrom(TransactionHeroId); + } + input.ReadMessage(subBuilder, extensionRegistry); + TransactionHeroId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTransactionHeroId { + get { return result.hasTransactionHeroId; } + } + public global::D3.OnlineService.EntityId TransactionHeroId { + get { return result.TransactionHeroId; } + set { SetTransactionHeroId(value); } + } + public Builder SetTransactionHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTransactionHeroId = true; + result.transactionHeroId_ = value; + return this; + } + public Builder SetTransactionHeroId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasTransactionHeroId = true; + result.transactionHeroId_ = builderForValue.Build(); + return this; + } + public Builder MergeTransactionHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasTransactionHeroId && + result.transactionHeroId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.transactionHeroId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.transactionHeroId_).MergeFrom(value).BuildPartial(); + } else { + result.transactionHeroId_ = value; + } + result.hasTransactionHeroId = true; + return this; + } + public Builder ClearTransactionHeroId() { + PrepareBuilder(); + result.hasTransactionHeroId = false; + result.transactionHeroId_ = null; + return this; + } + } + static ClaimInfo() { + object.ReferenceEquals(global::D3.AuctionHouse.AuctionHouse.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class AccountInfo : pb::GeneratedMessage { + private AccountInfo() { } + private static readonly AccountInfo defaultInstance = new AccountInfo().MakeReadOnly(); + private static readonly string[] _accountInfoFieldNames = new string[] { "account_id", "escrow_id" }; + private static readonly uint[] _accountInfoFieldTags = new uint[] { 10, 18 }; + public static AccountInfo DefaultInstance { + get { return defaultInstance; } + } + + public override AccountInfo DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override AccountInfo ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.AuctionHouse.AuctionHouse.internal__static_D3_AuctionHouse_AccountInfo__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.AuctionHouse.AuctionHouse.internal__static_D3_AuctionHouse_AccountInfo__FieldAccessorTable; } + } + + public const int AccountIdFieldNumber = 1; + private bool hasAccountId; + private global::D3.OnlineService.EntityId accountId_; + public bool HasAccountId { + get { return hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return accountId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public const int EscrowIdFieldNumber = 2; + private bool hasEscrowId; + private global::D3.OnlineService.EntityId escrowId_; + public bool HasEscrowId { + get { return hasEscrowId; } + } + public global::D3.OnlineService.EntityId EscrowId { + get { return escrowId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasAccountId) return false; + if (!hasEscrowId) return false; + if (!AccountId.IsInitialized) return false; + if (!EscrowId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _accountInfoFieldNames; + if (hasAccountId) { + output.WriteMessage(1, field_names[0], AccountId); + } + if (hasEscrowId) { + output.WriteMessage(2, field_names[1], EscrowId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AccountId); + } + if (hasEscrowId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, EscrowId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static AccountInfo ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AccountInfo ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AccountInfo ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AccountInfo ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AccountInfo ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AccountInfo ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static AccountInfo ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static AccountInfo ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static AccountInfo ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AccountInfo ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private AccountInfo MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(AccountInfo prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(AccountInfo cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private AccountInfo result; + + private AccountInfo PrepareBuilder() { + if (resultIsReadOnly) { + AccountInfo original = result; + result = new AccountInfo(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override AccountInfo MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.AuctionHouse.AccountInfo.Descriptor; } + } + + public override AccountInfo DefaultInstanceForType { + get { return global::D3.AuctionHouse.AccountInfo.DefaultInstance; } + } + + public override AccountInfo BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is AccountInfo) { + return MergeFrom((AccountInfo) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(AccountInfo other) { + if (other == global::D3.AuctionHouse.AccountInfo.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAccountId) { + MergeAccountId(other.AccountId); + } + if (other.HasEscrowId) { + MergeEscrowId(other.EscrowId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_accountInfoFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _accountInfoFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasAccountId) { + subBuilder.MergeFrom(AccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + AccountId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasEscrowId) { + subBuilder.MergeFrom(EscrowId); + } + input.ReadMessage(subBuilder, extensionRegistry); + EscrowId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAccountId { + get { return result.hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return result.AccountId; } + set { SetAccountId(value); } + } + public Builder SetAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = value; + return this; + } + public Builder SetAccountId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = builderForValue.Build(); + return this; + } + public Builder MergeAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccountId && + result.accountId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.accountId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.accountId_).MergeFrom(value).BuildPartial(); + } else { + result.accountId_ = value; + } + result.hasAccountId = true; + return this; + } + public Builder ClearAccountId() { + PrepareBuilder(); + result.hasAccountId = false; + result.accountId_ = null; + return this; + } + + public bool HasEscrowId { + get { return result.hasEscrowId; } + } + public global::D3.OnlineService.EntityId EscrowId { + get { return result.EscrowId; } + set { SetEscrowId(value); } + } + public Builder SetEscrowId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasEscrowId = true; + result.escrowId_ = value; + return this; + } + public Builder SetEscrowId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasEscrowId = true; + result.escrowId_ = builderForValue.Build(); + return this; + } + public Builder MergeEscrowId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasEscrowId && + result.escrowId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.escrowId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.escrowId_).MergeFrom(value).BuildPartial(); + } else { + result.escrowId_ = value; + } + result.hasEscrowId = true; + return this; + } + public Builder ClearEscrowId() { + PrepareBuilder(); + result.hasEscrowId = false; + result.escrowId_ = null; + return this; + } + } + static AccountInfo() { + object.ReferenceEquals(global::D3.AuctionHouse.AuctionHouse.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/LibMooNet/D3/CS/CS.cs b/src/LibMooNet/D3/CS/CS.cs new file mode 100644 index 00000000..447f6a49 --- /dev/null +++ b/src/LibMooNet/D3/CS/CS.cs @@ -0,0 +1,3037 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace D3.CS { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class CS { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_D3_CS_ToolTip__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_CS_ToolTip__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_CS_TooltipList__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_CS_TooltipList__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_CS_FallenHero__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_CS_FallenHero__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_CS_Snapshot__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_CS_Snapshot__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_CS_SnapshotVersion__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_CS_SnapshotVersion__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_CS_SnapshotVersions__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_CS_SnapshotVersions__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static CS() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "CghDUy5wcm90bxIFRDMuQ1MaGUF0dHJpYnV0ZVNlcmlhbGl6ZXIucHJvdG8a" + + "C0l0ZW1zLnByb3RvGhNPbmxpbmVTZXJ2aWNlLnByb3RvGhJJdGVtQ3JhZnRp" + + "bmcucHJvdG8aCkhlcm8ucHJvdG8aDUFjY291bnQucHJvdG8aDVByb2ZpbGUu" + + "cHJvdG8ivgIKB1Rvb2xUaXASKAoGaXRlbUlkGAEgAigLMhguRDMuT25saW5l" + + "U2VydmljZS5JdGVtSWQSGAoQSXRlbVF1YWxpdHlMZXZlbBgCIAIoDRIMCgRO" + + "YW1lGAMgAigJEgwKBFR5cGUYBCACKAkSDwoHU2V0SXRlbRgFIAIoBRIOCgZG" + + "bGF2b3IYBiACKAkSDAoEQ29zdBgHIAIoCRISCgpEdXJhYmlsaXR5GAggAigJ" + + "EhEKCUNsYXNzUmVxcxgJIAIoCRIUCgxSZXF1aXJlbWVudHMYCiACKAkSEwoL" + + "RW5oYW5jZW1lbnQYCyACKAkSEgoKU3RhY2tDb3VudBgMIAIoBBISCgpOdW1T" + + "b2NrZXRzGA0gAigNEhUKDUZpbGxlZFNvY2tldHMYDiACKA0SEwoLRGlzcGxh" + + "eU5hbWUYDyACKAkiLwoLVG9vbHRpcExpc3QSIAoIdG9vbHRpcHMYASADKAsy" + + "Di5EMy5DUy5Ub29sVGlwImUKCkZhbGxlbkhlcm8SKAoHcHJvZmlsZRgBIAIo" + + "CzIXLkQzLlByb2ZpbGUuSGVyb1Byb2ZpbGUSHwoGZGlnZXN0GAIgAigLMg8u" + + "RDMuSGVyby5EaWdlc3QSDAoEdGltZRgDIAIoCSKHAgoIU25hcHNob3QSDwoH" + + "dmVyc2lvbhgBIAIoBBIvCgpkZWZpbml0aW9uGAIgAigLMhsuRDMuQWNjb3Vu" + + "dC5TYXZlZERlZmluaXRpb24SJwoFaGVyb3MYAyADKAsyGC5EMy5IZXJvLlNh" + + "dmVkRGVmaW5pdGlvbhIzCg9hY2NvdW50X3Byb2ZpbGUYBCACKAsyGi5EMy5Q" + + "cm9maWxlLkFjY291bnRQcm9maWxlEjIKDWhlcm9fcHJvZmlsZXMYBSACKAsy" + + "Gy5EMy5Qcm9maWxlLkhlcm9Qcm9maWxlTGlzdBInCgxmYWxsZW5faGVyb3MY" + + "BiADKAsyES5EMy5DUy5GYWxsZW5IZXJvIkUKD1NuYXBzaG90VmVyc2lvbhIP" + + "Cgd2ZXJzaW9uGAEgAigEEiEKCHNuYXBzaG90GAIgAigLMg8uRDMuQ1MuU25h" + + "cHNob3QiPAoQU25hcHNob3RWZXJzaW9ucxIoCgh2ZXJzaW9ucxgBIAMoCzIW" + + "LkQzLkNTLlNuYXBzaG90VmVyc2lvbg=="); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_D3_CS_ToolTip__Descriptor = Descriptor.MessageTypes[0]; + internal__static_D3_CS_ToolTip__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_CS_ToolTip__Descriptor, + new string[] { "ItemId", "ItemQualityLevel", "Name", "Type", "SetItem", "Flavor", "Cost", "Durability", "ClassReqs", "Requirements", "Enhancement", "StackCount", "NumSockets", "FilledSockets", "DisplayName", }); + internal__static_D3_CS_TooltipList__Descriptor = Descriptor.MessageTypes[1]; + internal__static_D3_CS_TooltipList__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_CS_TooltipList__Descriptor, + new string[] { "Tooltips", }); + internal__static_D3_CS_FallenHero__Descriptor = Descriptor.MessageTypes[2]; + internal__static_D3_CS_FallenHero__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_CS_FallenHero__Descriptor, + new string[] { "Profile", "Digest", "Time", }); + internal__static_D3_CS_Snapshot__Descriptor = Descriptor.MessageTypes[3]; + internal__static_D3_CS_Snapshot__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_CS_Snapshot__Descriptor, + new string[] { "Version", "Definition", "Heros", "AccountProfile", "HeroProfiles", "FallenHeros", }); + internal__static_D3_CS_SnapshotVersion__Descriptor = Descriptor.MessageTypes[4]; + internal__static_D3_CS_SnapshotVersion__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_CS_SnapshotVersion__Descriptor, + new string[] { "Version", "Snapshot", }); + internal__static_D3_CS_SnapshotVersions__Descriptor = Descriptor.MessageTypes[5]; + internal__static_D3_CS_SnapshotVersions__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_CS_SnapshotVersions__Descriptor, + new string[] { "Versions", }); + return null; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::D3.AttributeSerializer.AttributeSerializer.Descriptor, + global::D3.Items.Items.Descriptor, + global::D3.OnlineService.OnlineService.Descriptor, + global::D3.ItemCrafting.ItemCrafting.Descriptor, + global::D3.Hero.Hero.Descriptor, + global::D3.Account.Account.Descriptor, + global::D3.Profile.Profile.Descriptor, + }, assigner); + } + #endregion + + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ToolTip : pb::GeneratedMessage { + private ToolTip() { } + private static readonly ToolTip defaultInstance = new ToolTip().MakeReadOnly(); + private static readonly string[] _toolTipFieldNames = new string[] { "ClassReqs", "Cost", "DisplayName", "Durability", "Enhancement", "FilledSockets", "Flavor", "ItemQualityLevel", "Name", "NumSockets", "Requirements", "SetItem", "StackCount", "Type", "itemId" }; + private static readonly uint[] _toolTipFieldTags = new uint[] { 74, 58, 122, 66, 90, 112, 50, 16, 26, 104, 82, 40, 96, 34, 10 }; + public static ToolTip DefaultInstance { + get { return defaultInstance; } + } + + public override ToolTip DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ToolTip ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.CS.CS.internal__static_D3_CS_ToolTip__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.CS.CS.internal__static_D3_CS_ToolTip__FieldAccessorTable; } + } + + public const int ItemIdFieldNumber = 1; + private bool hasItemId; + private global::D3.OnlineService.ItemId itemId_; + public bool HasItemId { + get { return hasItemId; } + } + public global::D3.OnlineService.ItemId ItemId { + get { return itemId_ ?? global::D3.OnlineService.ItemId.DefaultInstance; } + } + + public const int ItemQualityLevelFieldNumber = 2; + private bool hasItemQualityLevel; + private uint itemQualityLevel_; + public bool HasItemQualityLevel { + get { return hasItemQualityLevel; } + } + public uint ItemQualityLevel { + get { return itemQualityLevel_; } + } + + public const int NameFieldNumber = 3; + private bool hasName; + private string name_ = ""; + public bool HasName { + get { return hasName; } + } + public string Name { + get { return name_; } + } + + public const int TypeFieldNumber = 4; + private bool hasType; + private string type_ = ""; + public bool HasType { + get { return hasType; } + } + public string Type { + get { return type_; } + } + + public const int SetItemFieldNumber = 5; + private bool hasSetItem; + private int setItem_; + public bool HasSetItem { + get { return hasSetItem; } + } + public int SetItem { + get { return setItem_; } + } + + public const int FlavorFieldNumber = 6; + private bool hasFlavor; + private string flavor_ = ""; + public bool HasFlavor { + get { return hasFlavor; } + } + public string Flavor { + get { return flavor_; } + } + + public const int CostFieldNumber = 7; + private bool hasCost; + private string cost_ = ""; + public bool HasCost { + get { return hasCost; } + } + public string Cost { + get { return cost_; } + } + + public const int DurabilityFieldNumber = 8; + private bool hasDurability; + private string durability_ = ""; + public bool HasDurability { + get { return hasDurability; } + } + public string Durability { + get { return durability_; } + } + + public const int ClassReqsFieldNumber = 9; + private bool hasClassReqs; + private string classReqs_ = ""; + public bool HasClassReqs { + get { return hasClassReqs; } + } + public string ClassReqs { + get { return classReqs_; } + } + + public const int RequirementsFieldNumber = 10; + private bool hasRequirements; + private string requirements_ = ""; + public bool HasRequirements { + get { return hasRequirements; } + } + public string Requirements { + get { return requirements_; } + } + + public const int EnhancementFieldNumber = 11; + private bool hasEnhancement; + private string enhancement_ = ""; + public bool HasEnhancement { + get { return hasEnhancement; } + } + public string Enhancement { + get { return enhancement_; } + } + + public const int StackCountFieldNumber = 12; + private bool hasStackCount; + private ulong stackCount_; + public bool HasStackCount { + get { return hasStackCount; } + } + public ulong StackCount { + get { return stackCount_; } + } + + public const int NumSocketsFieldNumber = 13; + private bool hasNumSockets; + private uint numSockets_; + public bool HasNumSockets { + get { return hasNumSockets; } + } + public uint NumSockets { + get { return numSockets_; } + } + + public const int FilledSocketsFieldNumber = 14; + private bool hasFilledSockets; + private uint filledSockets_; + public bool HasFilledSockets { + get { return hasFilledSockets; } + } + public uint FilledSockets { + get { return filledSockets_; } + } + + public const int DisplayNameFieldNumber = 15; + private bool hasDisplayName; + private string displayName_ = ""; + public bool HasDisplayName { + get { return hasDisplayName; } + } + public string DisplayName { + get { return displayName_; } + } + + public override bool IsInitialized { + get { + if (!hasItemId) return false; + if (!hasItemQualityLevel) return false; + if (!hasName) return false; + if (!hasType) return false; + if (!hasSetItem) return false; + if (!hasFlavor) return false; + if (!hasCost) return false; + if (!hasDurability) return false; + if (!hasClassReqs) return false; + if (!hasRequirements) return false; + if (!hasEnhancement) return false; + if (!hasStackCount) return false; + if (!hasNumSockets) return false; + if (!hasFilledSockets) return false; + if (!hasDisplayName) return false; + if (!ItemId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _toolTipFieldNames; + if (hasItemId) { + output.WriteMessage(1, field_names[14], ItemId); + } + if (hasItemQualityLevel) { + output.WriteUInt32(2, field_names[7], ItemQualityLevel); + } + if (hasName) { + output.WriteString(3, field_names[8], Name); + } + if (hasType) { + output.WriteString(4, field_names[13], Type); + } + if (hasSetItem) { + output.WriteInt32(5, field_names[11], SetItem); + } + if (hasFlavor) { + output.WriteString(6, field_names[6], Flavor); + } + if (hasCost) { + output.WriteString(7, field_names[1], Cost); + } + if (hasDurability) { + output.WriteString(8, field_names[3], Durability); + } + if (hasClassReqs) { + output.WriteString(9, field_names[0], ClassReqs); + } + if (hasRequirements) { + output.WriteString(10, field_names[10], Requirements); + } + if (hasEnhancement) { + output.WriteString(11, field_names[4], Enhancement); + } + if (hasStackCount) { + output.WriteUInt64(12, field_names[12], StackCount); + } + if (hasNumSockets) { + output.WriteUInt32(13, field_names[9], NumSockets); + } + if (hasFilledSockets) { + output.WriteUInt32(14, field_names[5], FilledSockets); + } + if (hasDisplayName) { + output.WriteString(15, field_names[2], DisplayName); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasItemId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, ItemId); + } + if (hasItemQualityLevel) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, ItemQualityLevel); + } + if (hasName) { + size += pb::CodedOutputStream.ComputeStringSize(3, Name); + } + if (hasType) { + size += pb::CodedOutputStream.ComputeStringSize(4, Type); + } + if (hasSetItem) { + size += pb::CodedOutputStream.ComputeInt32Size(5, SetItem); + } + if (hasFlavor) { + size += pb::CodedOutputStream.ComputeStringSize(6, Flavor); + } + if (hasCost) { + size += pb::CodedOutputStream.ComputeStringSize(7, Cost); + } + if (hasDurability) { + size += pb::CodedOutputStream.ComputeStringSize(8, Durability); + } + if (hasClassReqs) { + size += pb::CodedOutputStream.ComputeStringSize(9, ClassReqs); + } + if (hasRequirements) { + size += pb::CodedOutputStream.ComputeStringSize(10, Requirements); + } + if (hasEnhancement) { + size += pb::CodedOutputStream.ComputeStringSize(11, Enhancement); + } + if (hasStackCount) { + size += pb::CodedOutputStream.ComputeUInt64Size(12, StackCount); + } + if (hasNumSockets) { + size += pb::CodedOutputStream.ComputeUInt32Size(13, NumSockets); + } + if (hasFilledSockets) { + size += pb::CodedOutputStream.ComputeUInt32Size(14, FilledSockets); + } + if (hasDisplayName) { + size += pb::CodedOutputStream.ComputeStringSize(15, DisplayName); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ToolTip ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ToolTip ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ToolTip ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ToolTip ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ToolTip ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ToolTip ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ToolTip ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ToolTip ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ToolTip ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ToolTip ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ToolTip MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ToolTip prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ToolTip cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ToolTip result; + + private ToolTip PrepareBuilder() { + if (resultIsReadOnly) { + ToolTip original = result; + result = new ToolTip(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ToolTip MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.CS.ToolTip.Descriptor; } + } + + public override ToolTip DefaultInstanceForType { + get { return global::D3.CS.ToolTip.DefaultInstance; } + } + + public override ToolTip BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ToolTip) { + return MergeFrom((ToolTip) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ToolTip other) { + if (other == global::D3.CS.ToolTip.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasItemId) { + MergeItemId(other.ItemId); + } + if (other.HasItemQualityLevel) { + ItemQualityLevel = other.ItemQualityLevel; + } + if (other.HasName) { + Name = other.Name; + } + if (other.HasType) { + Type = other.Type; + } + if (other.HasSetItem) { + SetItem = other.SetItem; + } + if (other.HasFlavor) { + Flavor = other.Flavor; + } + if (other.HasCost) { + Cost = other.Cost; + } + if (other.HasDurability) { + Durability = other.Durability; + } + if (other.HasClassReqs) { + ClassReqs = other.ClassReqs; + } + if (other.HasRequirements) { + Requirements = other.Requirements; + } + if (other.HasEnhancement) { + Enhancement = other.Enhancement; + } + if (other.HasStackCount) { + StackCount = other.StackCount; + } + if (other.HasNumSockets) { + NumSockets = other.NumSockets; + } + if (other.HasFilledSockets) { + FilledSockets = other.FilledSockets; + } + if (other.HasDisplayName) { + DisplayName = other.DisplayName; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_toolTipFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _toolTipFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.OnlineService.ItemId.Builder subBuilder = global::D3.OnlineService.ItemId.CreateBuilder(); + if (result.hasItemId) { + subBuilder.MergeFrom(ItemId); + } + input.ReadMessage(subBuilder, extensionRegistry); + ItemId = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasItemQualityLevel = input.ReadUInt32(ref result.itemQualityLevel_); + break; + } + case 26: { + result.hasName = input.ReadString(ref result.name_); + break; + } + case 34: { + result.hasType = input.ReadString(ref result.type_); + break; + } + case 40: { + result.hasSetItem = input.ReadInt32(ref result.setItem_); + break; + } + case 50: { + result.hasFlavor = input.ReadString(ref result.flavor_); + break; + } + case 58: { + result.hasCost = input.ReadString(ref result.cost_); + break; + } + case 66: { + result.hasDurability = input.ReadString(ref result.durability_); + break; + } + case 74: { + result.hasClassReqs = input.ReadString(ref result.classReqs_); + break; + } + case 82: { + result.hasRequirements = input.ReadString(ref result.requirements_); + break; + } + case 90: { + result.hasEnhancement = input.ReadString(ref result.enhancement_); + break; + } + case 96: { + result.hasStackCount = input.ReadUInt64(ref result.stackCount_); + break; + } + case 104: { + result.hasNumSockets = input.ReadUInt32(ref result.numSockets_); + break; + } + case 112: { + result.hasFilledSockets = input.ReadUInt32(ref result.filledSockets_); + break; + } + case 122: { + result.hasDisplayName = input.ReadString(ref result.displayName_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasItemId { + get { return result.hasItemId; } + } + public global::D3.OnlineService.ItemId ItemId { + get { return result.ItemId; } + set { SetItemId(value); } + } + public Builder SetItemId(global::D3.OnlineService.ItemId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasItemId = true; + result.itemId_ = value; + return this; + } + public Builder SetItemId(global::D3.OnlineService.ItemId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasItemId = true; + result.itemId_ = builderForValue.Build(); + return this; + } + public Builder MergeItemId(global::D3.OnlineService.ItemId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasItemId && + result.itemId_ != global::D3.OnlineService.ItemId.DefaultInstance) { + result.itemId_ = global::D3.OnlineService.ItemId.CreateBuilder(result.itemId_).MergeFrom(value).BuildPartial(); + } else { + result.itemId_ = value; + } + result.hasItemId = true; + return this; + } + public Builder ClearItemId() { + PrepareBuilder(); + result.hasItemId = false; + result.itemId_ = null; + return this; + } + + public bool HasItemQualityLevel { + get { return result.hasItemQualityLevel; } + } + public uint ItemQualityLevel { + get { return result.ItemQualityLevel; } + set { SetItemQualityLevel(value); } + } + public Builder SetItemQualityLevel(uint value) { + PrepareBuilder(); + result.hasItemQualityLevel = true; + result.itemQualityLevel_ = value; + return this; + } + public Builder ClearItemQualityLevel() { + PrepareBuilder(); + result.hasItemQualityLevel = false; + result.itemQualityLevel_ = 0; + return this; + } + + public bool HasName { + get { return result.hasName; } + } + public string Name { + get { return result.Name; } + set { SetName(value); } + } + public Builder SetName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasName = true; + result.name_ = value; + return this; + } + public Builder ClearName() { + PrepareBuilder(); + result.hasName = false; + result.name_ = ""; + return this; + } + + public bool HasType { + get { return result.hasType; } + } + public string Type { + get { return result.Type; } + set { SetType(value); } + } + public Builder SetType(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasType = true; + result.type_ = value; + return this; + } + public Builder ClearType() { + PrepareBuilder(); + result.hasType = false; + result.type_ = ""; + return this; + } + + public bool HasSetItem { + get { return result.hasSetItem; } + } + public int SetItem { + get { return result.SetItem; } + set { SetSetItem(value); } + } + public Builder SetSetItem(int value) { + PrepareBuilder(); + result.hasSetItem = true; + result.setItem_ = value; + return this; + } + public Builder ClearSetItem() { + PrepareBuilder(); + result.hasSetItem = false; + result.setItem_ = 0; + return this; + } + + public bool HasFlavor { + get { return result.hasFlavor; } + } + public string Flavor { + get { return result.Flavor; } + set { SetFlavor(value); } + } + public Builder SetFlavor(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasFlavor = true; + result.flavor_ = value; + return this; + } + public Builder ClearFlavor() { + PrepareBuilder(); + result.hasFlavor = false; + result.flavor_ = ""; + return this; + } + + public bool HasCost { + get { return result.hasCost; } + } + public string Cost { + get { return result.Cost; } + set { SetCost(value); } + } + public Builder SetCost(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasCost = true; + result.cost_ = value; + return this; + } + public Builder ClearCost() { + PrepareBuilder(); + result.hasCost = false; + result.cost_ = ""; + return this; + } + + public bool HasDurability { + get { return result.hasDurability; } + } + public string Durability { + get { return result.Durability; } + set { SetDurability(value); } + } + public Builder SetDurability(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasDurability = true; + result.durability_ = value; + return this; + } + public Builder ClearDurability() { + PrepareBuilder(); + result.hasDurability = false; + result.durability_ = ""; + return this; + } + + public bool HasClassReqs { + get { return result.hasClassReqs; } + } + public string ClassReqs { + get { return result.ClassReqs; } + set { SetClassReqs(value); } + } + public Builder SetClassReqs(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasClassReqs = true; + result.classReqs_ = value; + return this; + } + public Builder ClearClassReqs() { + PrepareBuilder(); + result.hasClassReqs = false; + result.classReqs_ = ""; + return this; + } + + public bool HasRequirements { + get { return result.hasRequirements; } + } + public string Requirements { + get { return result.Requirements; } + set { SetRequirements(value); } + } + public Builder SetRequirements(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasRequirements = true; + result.requirements_ = value; + return this; + } + public Builder ClearRequirements() { + PrepareBuilder(); + result.hasRequirements = false; + result.requirements_ = ""; + return this; + } + + public bool HasEnhancement { + get { return result.hasEnhancement; } + } + public string Enhancement { + get { return result.Enhancement; } + set { SetEnhancement(value); } + } + public Builder SetEnhancement(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasEnhancement = true; + result.enhancement_ = value; + return this; + } + public Builder ClearEnhancement() { + PrepareBuilder(); + result.hasEnhancement = false; + result.enhancement_ = ""; + return this; + } + + public bool HasStackCount { + get { return result.hasStackCount; } + } + public ulong StackCount { + get { return result.StackCount; } + set { SetStackCount(value); } + } + public Builder SetStackCount(ulong value) { + PrepareBuilder(); + result.hasStackCount = true; + result.stackCount_ = value; + return this; + } + public Builder ClearStackCount() { + PrepareBuilder(); + result.hasStackCount = false; + result.stackCount_ = 0UL; + return this; + } + + public bool HasNumSockets { + get { return result.hasNumSockets; } + } + public uint NumSockets { + get { return result.NumSockets; } + set { SetNumSockets(value); } + } + public Builder SetNumSockets(uint value) { + PrepareBuilder(); + result.hasNumSockets = true; + result.numSockets_ = value; + return this; + } + public Builder ClearNumSockets() { + PrepareBuilder(); + result.hasNumSockets = false; + result.numSockets_ = 0; + return this; + } + + public bool HasFilledSockets { + get { return result.hasFilledSockets; } + } + public uint FilledSockets { + get { return result.FilledSockets; } + set { SetFilledSockets(value); } + } + public Builder SetFilledSockets(uint value) { + PrepareBuilder(); + result.hasFilledSockets = true; + result.filledSockets_ = value; + return this; + } + public Builder ClearFilledSockets() { + PrepareBuilder(); + result.hasFilledSockets = false; + result.filledSockets_ = 0; + return this; + } + + public bool HasDisplayName { + get { return result.hasDisplayName; } + } + public string DisplayName { + get { return result.DisplayName; } + set { SetDisplayName(value); } + } + public Builder SetDisplayName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasDisplayName = true; + result.displayName_ = value; + return this; + } + public Builder ClearDisplayName() { + PrepareBuilder(); + result.hasDisplayName = false; + result.displayName_ = ""; + return this; + } + } + static ToolTip() { + object.ReferenceEquals(global::D3.CS.CS.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class TooltipList : pb::GeneratedMessage { + private TooltipList() { } + private static readonly TooltipList defaultInstance = new TooltipList().MakeReadOnly(); + private static readonly string[] _tooltipListFieldNames = new string[] { "tooltips" }; + private static readonly uint[] _tooltipListFieldTags = new uint[] { 10 }; + public static TooltipList DefaultInstance { + get { return defaultInstance; } + } + + public override TooltipList DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override TooltipList ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.CS.CS.internal__static_D3_CS_TooltipList__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.CS.CS.internal__static_D3_CS_TooltipList__FieldAccessorTable; } + } + + public const int TooltipsFieldNumber = 1; + private pbc::PopsicleList tooltips_ = new pbc::PopsicleList(); + public scg::IList TooltipsList { + get { return tooltips_; } + } + public int TooltipsCount { + get { return tooltips_.Count; } + } + public global::D3.CS.ToolTip GetTooltips(int index) { + return tooltips_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::D3.CS.ToolTip element in TooltipsList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _tooltipListFieldNames; + if (tooltips_.Count > 0) { + output.WriteMessageArray(1, field_names[0], tooltips_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::D3.CS.ToolTip element in TooltipsList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static TooltipList ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TooltipList ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TooltipList ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TooltipList ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TooltipList ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TooltipList ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static TooltipList ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static TooltipList ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static TooltipList ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TooltipList ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private TooltipList MakeReadOnly() { + tooltips_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(TooltipList prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(TooltipList cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private TooltipList result; + + private TooltipList PrepareBuilder() { + if (resultIsReadOnly) { + TooltipList original = result; + result = new TooltipList(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override TooltipList MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.CS.TooltipList.Descriptor; } + } + + public override TooltipList DefaultInstanceForType { + get { return global::D3.CS.TooltipList.DefaultInstance; } + } + + public override TooltipList BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is TooltipList) { + return MergeFrom((TooltipList) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(TooltipList other) { + if (other == global::D3.CS.TooltipList.DefaultInstance) return this; + PrepareBuilder(); + if (other.tooltips_.Count != 0) { + result.tooltips_.Add(other.tooltips_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_tooltipListFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _tooltipListFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.tooltips_, global::D3.CS.ToolTip.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList TooltipsList { + get { return PrepareBuilder().tooltips_; } + } + public int TooltipsCount { + get { return result.TooltipsCount; } + } + public global::D3.CS.ToolTip GetTooltips(int index) { + return result.GetTooltips(index); + } + public Builder SetTooltips(int index, global::D3.CS.ToolTip value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.tooltips_[index] = value; + return this; + } + public Builder SetTooltips(int index, global::D3.CS.ToolTip.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.tooltips_[index] = builderForValue.Build(); + return this; + } + public Builder AddTooltips(global::D3.CS.ToolTip value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.tooltips_.Add(value); + return this; + } + public Builder AddTooltips(global::D3.CS.ToolTip.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.tooltips_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeTooltips(scg::IEnumerable values) { + PrepareBuilder(); + result.tooltips_.Add(values); + return this; + } + public Builder ClearTooltips() { + PrepareBuilder(); + result.tooltips_.Clear(); + return this; + } + } + static TooltipList() { + object.ReferenceEquals(global::D3.CS.CS.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class FallenHero : pb::GeneratedMessage { + private FallenHero() { } + private static readonly FallenHero defaultInstance = new FallenHero().MakeReadOnly(); + private static readonly string[] _fallenHeroFieldNames = new string[] { "digest", "profile", "time" }; + private static readonly uint[] _fallenHeroFieldTags = new uint[] { 18, 10, 26 }; + public static FallenHero DefaultInstance { + get { return defaultInstance; } + } + + public override FallenHero DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override FallenHero ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.CS.CS.internal__static_D3_CS_FallenHero__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.CS.CS.internal__static_D3_CS_FallenHero__FieldAccessorTable; } + } + + public const int ProfileFieldNumber = 1; + private bool hasProfile; + private global::D3.Profile.HeroProfile profile_; + public bool HasProfile { + get { return hasProfile; } + } + public global::D3.Profile.HeroProfile Profile { + get { return profile_ ?? global::D3.Profile.HeroProfile.DefaultInstance; } + } + + public const int DigestFieldNumber = 2; + private bool hasDigest; + private global::D3.Hero.Digest digest_; + public bool HasDigest { + get { return hasDigest; } + } + public global::D3.Hero.Digest Digest { + get { return digest_ ?? global::D3.Hero.Digest.DefaultInstance; } + } + + public const int TimeFieldNumber = 3; + private bool hasTime; + private string time_ = ""; + public bool HasTime { + get { return hasTime; } + } + public string Time { + get { return time_; } + } + + public override bool IsInitialized { + get { + if (!hasProfile) return false; + if (!hasDigest) return false; + if (!hasTime) return false; + if (!Profile.IsInitialized) return false; + if (!Digest.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _fallenHeroFieldNames; + if (hasProfile) { + output.WriteMessage(1, field_names[1], Profile); + } + if (hasDigest) { + output.WriteMessage(2, field_names[0], Digest); + } + if (hasTime) { + output.WriteString(3, field_names[2], Time); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasProfile) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Profile); + } + if (hasDigest) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Digest); + } + if (hasTime) { + size += pb::CodedOutputStream.ComputeStringSize(3, Time); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static FallenHero ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FallenHero ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FallenHero ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FallenHero ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FallenHero ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FallenHero ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static FallenHero ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static FallenHero ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static FallenHero ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FallenHero ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private FallenHero MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(FallenHero prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(FallenHero cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private FallenHero result; + + private FallenHero PrepareBuilder() { + if (resultIsReadOnly) { + FallenHero original = result; + result = new FallenHero(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override FallenHero MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.CS.FallenHero.Descriptor; } + } + + public override FallenHero DefaultInstanceForType { + get { return global::D3.CS.FallenHero.DefaultInstance; } + } + + public override FallenHero BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is FallenHero) { + return MergeFrom((FallenHero) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(FallenHero other) { + if (other == global::D3.CS.FallenHero.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasProfile) { + MergeProfile(other.Profile); + } + if (other.HasDigest) { + MergeDigest(other.Digest); + } + if (other.HasTime) { + Time = other.Time; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_fallenHeroFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _fallenHeroFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.Profile.HeroProfile.Builder subBuilder = global::D3.Profile.HeroProfile.CreateBuilder(); + if (result.hasProfile) { + subBuilder.MergeFrom(Profile); + } + input.ReadMessage(subBuilder, extensionRegistry); + Profile = subBuilder.BuildPartial(); + break; + } + case 18: { + global::D3.Hero.Digest.Builder subBuilder = global::D3.Hero.Digest.CreateBuilder(); + if (result.hasDigest) { + subBuilder.MergeFrom(Digest); + } + input.ReadMessage(subBuilder, extensionRegistry); + Digest = subBuilder.BuildPartial(); + break; + } + case 26: { + result.hasTime = input.ReadString(ref result.time_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasProfile { + get { return result.hasProfile; } + } + public global::D3.Profile.HeroProfile Profile { + get { return result.Profile; } + set { SetProfile(value); } + } + public Builder SetProfile(global::D3.Profile.HeroProfile value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasProfile = true; + result.profile_ = value; + return this; + } + public Builder SetProfile(global::D3.Profile.HeroProfile.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasProfile = true; + result.profile_ = builderForValue.Build(); + return this; + } + public Builder MergeProfile(global::D3.Profile.HeroProfile value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasProfile && + result.profile_ != global::D3.Profile.HeroProfile.DefaultInstance) { + result.profile_ = global::D3.Profile.HeroProfile.CreateBuilder(result.profile_).MergeFrom(value).BuildPartial(); + } else { + result.profile_ = value; + } + result.hasProfile = true; + return this; + } + public Builder ClearProfile() { + PrepareBuilder(); + result.hasProfile = false; + result.profile_ = null; + return this; + } + + public bool HasDigest { + get { return result.hasDigest; } + } + public global::D3.Hero.Digest Digest { + get { return result.Digest; } + set { SetDigest(value); } + } + public Builder SetDigest(global::D3.Hero.Digest value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasDigest = true; + result.digest_ = value; + return this; + } + public Builder SetDigest(global::D3.Hero.Digest.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasDigest = true; + result.digest_ = builderForValue.Build(); + return this; + } + public Builder MergeDigest(global::D3.Hero.Digest value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasDigest && + result.digest_ != global::D3.Hero.Digest.DefaultInstance) { + result.digest_ = global::D3.Hero.Digest.CreateBuilder(result.digest_).MergeFrom(value).BuildPartial(); + } else { + result.digest_ = value; + } + result.hasDigest = true; + return this; + } + public Builder ClearDigest() { + PrepareBuilder(); + result.hasDigest = false; + result.digest_ = null; + return this; + } + + public bool HasTime { + get { return result.hasTime; } + } + public string Time { + get { return result.Time; } + set { SetTime(value); } + } + public Builder SetTime(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTime = true; + result.time_ = value; + return this; + } + public Builder ClearTime() { + PrepareBuilder(); + result.hasTime = false; + result.time_ = ""; + return this; + } + } + static FallenHero() { + object.ReferenceEquals(global::D3.CS.CS.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Snapshot : pb::GeneratedMessage { + private Snapshot() { } + private static readonly Snapshot defaultInstance = new Snapshot().MakeReadOnly(); + private static readonly string[] _snapshotFieldNames = new string[] { "account_profile", "definition", "fallen_heros", "hero_profiles", "heros", "version" }; + private static readonly uint[] _snapshotFieldTags = new uint[] { 34, 18, 50, 42, 26, 8 }; + public static Snapshot DefaultInstance { + get { return defaultInstance; } + } + + public override Snapshot DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Snapshot ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.CS.CS.internal__static_D3_CS_Snapshot__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.CS.CS.internal__static_D3_CS_Snapshot__FieldAccessorTable; } + } + + public const int VersionFieldNumber = 1; + private bool hasVersion; + private ulong version_; + public bool HasVersion { + get { return hasVersion; } + } + public ulong Version { + get { return version_; } + } + + public const int DefinitionFieldNumber = 2; + private bool hasDefinition; + private global::D3.Account.SavedDefinition definition_; + public bool HasDefinition { + get { return hasDefinition; } + } + public global::D3.Account.SavedDefinition Definition { + get { return definition_ ?? global::D3.Account.SavedDefinition.DefaultInstance; } + } + + public const int HerosFieldNumber = 3; + private pbc::PopsicleList heros_ = new pbc::PopsicleList(); + public scg::IList HerosList { + get { return heros_; } + } + public int HerosCount { + get { return heros_.Count; } + } + public global::D3.Hero.SavedDefinition GetHeros(int index) { + return heros_[index]; + } + + public const int AccountProfileFieldNumber = 4; + private bool hasAccountProfile; + private global::D3.Profile.AccountProfile accountProfile_; + public bool HasAccountProfile { + get { return hasAccountProfile; } + } + public global::D3.Profile.AccountProfile AccountProfile { + get { return accountProfile_ ?? global::D3.Profile.AccountProfile.DefaultInstance; } + } + + public const int HeroProfilesFieldNumber = 5; + private bool hasHeroProfiles; + private global::D3.Profile.HeroProfileList heroProfiles_; + public bool HasHeroProfiles { + get { return hasHeroProfiles; } + } + public global::D3.Profile.HeroProfileList HeroProfiles { + get { return heroProfiles_ ?? global::D3.Profile.HeroProfileList.DefaultInstance; } + } + + public const int FallenHerosFieldNumber = 6; + private pbc::PopsicleList fallenHeros_ = new pbc::PopsicleList(); + public scg::IList FallenHerosList { + get { return fallenHeros_; } + } + public int FallenHerosCount { + get { return fallenHeros_.Count; } + } + public global::D3.CS.FallenHero GetFallenHeros(int index) { + return fallenHeros_[index]; + } + + public override bool IsInitialized { + get { + if (!hasVersion) return false; + if (!hasDefinition) return false; + if (!hasAccountProfile) return false; + if (!hasHeroProfiles) return false; + if (!Definition.IsInitialized) return false; + foreach (global::D3.Hero.SavedDefinition element in HerosList) { + if (!element.IsInitialized) return false; + } + if (!HeroProfiles.IsInitialized) return false; + foreach (global::D3.CS.FallenHero element in FallenHerosList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _snapshotFieldNames; + if (hasVersion) { + output.WriteUInt64(1, field_names[5], Version); + } + if (hasDefinition) { + output.WriteMessage(2, field_names[1], Definition); + } + if (heros_.Count > 0) { + output.WriteMessageArray(3, field_names[4], heros_); + } + if (hasAccountProfile) { + output.WriteMessage(4, field_names[0], AccountProfile); + } + if (hasHeroProfiles) { + output.WriteMessage(5, field_names[3], HeroProfiles); + } + if (fallenHeros_.Count > 0) { + output.WriteMessageArray(6, field_names[2], fallenHeros_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasVersion) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, Version); + } + if (hasDefinition) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Definition); + } + foreach (global::D3.Hero.SavedDefinition element in HerosList) { + size += pb::CodedOutputStream.ComputeMessageSize(3, element); + } + if (hasAccountProfile) { + size += pb::CodedOutputStream.ComputeMessageSize(4, AccountProfile); + } + if (hasHeroProfiles) { + size += pb::CodedOutputStream.ComputeMessageSize(5, HeroProfiles); + } + foreach (global::D3.CS.FallenHero element in FallenHerosList) { + size += pb::CodedOutputStream.ComputeMessageSize(6, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static Snapshot ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Snapshot ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Snapshot ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Snapshot ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Snapshot ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Snapshot ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Snapshot ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Snapshot ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Snapshot ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Snapshot ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Snapshot MakeReadOnly() { + heros_.MakeReadOnly(); + fallenHeros_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Snapshot prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Snapshot cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Snapshot result; + + private Snapshot PrepareBuilder() { + if (resultIsReadOnly) { + Snapshot original = result; + result = new Snapshot(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Snapshot MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.CS.Snapshot.Descriptor; } + } + + public override Snapshot DefaultInstanceForType { + get { return global::D3.CS.Snapshot.DefaultInstance; } + } + + public override Snapshot BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Snapshot) { + return MergeFrom((Snapshot) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Snapshot other) { + if (other == global::D3.CS.Snapshot.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasVersion) { + Version = other.Version; + } + if (other.HasDefinition) { + MergeDefinition(other.Definition); + } + if (other.heros_.Count != 0) { + result.heros_.Add(other.heros_); + } + if (other.HasAccountProfile) { + MergeAccountProfile(other.AccountProfile); + } + if (other.HasHeroProfiles) { + MergeHeroProfiles(other.HeroProfiles); + } + if (other.fallenHeros_.Count != 0) { + result.fallenHeros_.Add(other.fallenHeros_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_snapshotFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _snapshotFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasVersion = input.ReadUInt64(ref result.version_); + break; + } + case 18: { + global::D3.Account.SavedDefinition.Builder subBuilder = global::D3.Account.SavedDefinition.CreateBuilder(); + if (result.hasDefinition) { + subBuilder.MergeFrom(Definition); + } + input.ReadMessage(subBuilder, extensionRegistry); + Definition = subBuilder.BuildPartial(); + break; + } + case 26: { + input.ReadMessageArray(tag, field_name, result.heros_, global::D3.Hero.SavedDefinition.DefaultInstance, extensionRegistry); + break; + } + case 34: { + global::D3.Profile.AccountProfile.Builder subBuilder = global::D3.Profile.AccountProfile.CreateBuilder(); + if (result.hasAccountProfile) { + subBuilder.MergeFrom(AccountProfile); + } + input.ReadMessage(subBuilder, extensionRegistry); + AccountProfile = subBuilder.BuildPartial(); + break; + } + case 42: { + global::D3.Profile.HeroProfileList.Builder subBuilder = global::D3.Profile.HeroProfileList.CreateBuilder(); + if (result.hasHeroProfiles) { + subBuilder.MergeFrom(HeroProfiles); + } + input.ReadMessage(subBuilder, extensionRegistry); + HeroProfiles = subBuilder.BuildPartial(); + break; + } + case 50: { + input.ReadMessageArray(tag, field_name, result.fallenHeros_, global::D3.CS.FallenHero.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasVersion { + get { return result.hasVersion; } + } + public ulong Version { + get { return result.Version; } + set { SetVersion(value); } + } + public Builder SetVersion(ulong value) { + PrepareBuilder(); + result.hasVersion = true; + result.version_ = value; + return this; + } + public Builder ClearVersion() { + PrepareBuilder(); + result.hasVersion = false; + result.version_ = 0UL; + return this; + } + + public bool HasDefinition { + get { return result.hasDefinition; } + } + public global::D3.Account.SavedDefinition Definition { + get { return result.Definition; } + set { SetDefinition(value); } + } + public Builder SetDefinition(global::D3.Account.SavedDefinition value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasDefinition = true; + result.definition_ = value; + return this; + } + public Builder SetDefinition(global::D3.Account.SavedDefinition.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasDefinition = true; + result.definition_ = builderForValue.Build(); + return this; + } + public Builder MergeDefinition(global::D3.Account.SavedDefinition value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasDefinition && + result.definition_ != global::D3.Account.SavedDefinition.DefaultInstance) { + result.definition_ = global::D3.Account.SavedDefinition.CreateBuilder(result.definition_).MergeFrom(value).BuildPartial(); + } else { + result.definition_ = value; + } + result.hasDefinition = true; + return this; + } + public Builder ClearDefinition() { + PrepareBuilder(); + result.hasDefinition = false; + result.definition_ = null; + return this; + } + + public pbc::IPopsicleList HerosList { + get { return PrepareBuilder().heros_; } + } + public int HerosCount { + get { return result.HerosCount; } + } + public global::D3.Hero.SavedDefinition GetHeros(int index) { + return result.GetHeros(index); + } + public Builder SetHeros(int index, global::D3.Hero.SavedDefinition value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.heros_[index] = value; + return this; + } + public Builder SetHeros(int index, global::D3.Hero.SavedDefinition.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.heros_[index] = builderForValue.Build(); + return this; + } + public Builder AddHeros(global::D3.Hero.SavedDefinition value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.heros_.Add(value); + return this; + } + public Builder AddHeros(global::D3.Hero.SavedDefinition.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.heros_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeHeros(scg::IEnumerable values) { + PrepareBuilder(); + result.heros_.Add(values); + return this; + } + public Builder ClearHeros() { + PrepareBuilder(); + result.heros_.Clear(); + return this; + } + + public bool HasAccountProfile { + get { return result.hasAccountProfile; } + } + public global::D3.Profile.AccountProfile AccountProfile { + get { return result.AccountProfile; } + set { SetAccountProfile(value); } + } + public Builder SetAccountProfile(global::D3.Profile.AccountProfile value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccountProfile = true; + result.accountProfile_ = value; + return this; + } + public Builder SetAccountProfile(global::D3.Profile.AccountProfile.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccountProfile = true; + result.accountProfile_ = builderForValue.Build(); + return this; + } + public Builder MergeAccountProfile(global::D3.Profile.AccountProfile value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccountProfile && + result.accountProfile_ != global::D3.Profile.AccountProfile.DefaultInstance) { + result.accountProfile_ = global::D3.Profile.AccountProfile.CreateBuilder(result.accountProfile_).MergeFrom(value).BuildPartial(); + } else { + result.accountProfile_ = value; + } + result.hasAccountProfile = true; + return this; + } + public Builder ClearAccountProfile() { + PrepareBuilder(); + result.hasAccountProfile = false; + result.accountProfile_ = null; + return this; + } + + public bool HasHeroProfiles { + get { return result.hasHeroProfiles; } + } + public global::D3.Profile.HeroProfileList HeroProfiles { + get { return result.HeroProfiles; } + set { SetHeroProfiles(value); } + } + public Builder SetHeroProfiles(global::D3.Profile.HeroProfileList value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasHeroProfiles = true; + result.heroProfiles_ = value; + return this; + } + public Builder SetHeroProfiles(global::D3.Profile.HeroProfileList.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasHeroProfiles = true; + result.heroProfiles_ = builderForValue.Build(); + return this; + } + public Builder MergeHeroProfiles(global::D3.Profile.HeroProfileList value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasHeroProfiles && + result.heroProfiles_ != global::D3.Profile.HeroProfileList.DefaultInstance) { + result.heroProfiles_ = global::D3.Profile.HeroProfileList.CreateBuilder(result.heroProfiles_).MergeFrom(value).BuildPartial(); + } else { + result.heroProfiles_ = value; + } + result.hasHeroProfiles = true; + return this; + } + public Builder ClearHeroProfiles() { + PrepareBuilder(); + result.hasHeroProfiles = false; + result.heroProfiles_ = null; + return this; + } + + public pbc::IPopsicleList FallenHerosList { + get { return PrepareBuilder().fallenHeros_; } + } + public int FallenHerosCount { + get { return result.FallenHerosCount; } + } + public global::D3.CS.FallenHero GetFallenHeros(int index) { + return result.GetFallenHeros(index); + } + public Builder SetFallenHeros(int index, global::D3.CS.FallenHero value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.fallenHeros_[index] = value; + return this; + } + public Builder SetFallenHeros(int index, global::D3.CS.FallenHero.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.fallenHeros_[index] = builderForValue.Build(); + return this; + } + public Builder AddFallenHeros(global::D3.CS.FallenHero value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.fallenHeros_.Add(value); + return this; + } + public Builder AddFallenHeros(global::D3.CS.FallenHero.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.fallenHeros_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeFallenHeros(scg::IEnumerable values) { + PrepareBuilder(); + result.fallenHeros_.Add(values); + return this; + } + public Builder ClearFallenHeros() { + PrepareBuilder(); + result.fallenHeros_.Clear(); + return this; + } + } + static Snapshot() { + object.ReferenceEquals(global::D3.CS.CS.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class SnapshotVersion : pb::GeneratedMessage { + private SnapshotVersion() { } + private static readonly SnapshotVersion defaultInstance = new SnapshotVersion().MakeReadOnly(); + private static readonly string[] _snapshotVersionFieldNames = new string[] { "snapshot", "version" }; + private static readonly uint[] _snapshotVersionFieldTags = new uint[] { 18, 8 }; + public static SnapshotVersion DefaultInstance { + get { return defaultInstance; } + } + + public override SnapshotVersion DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SnapshotVersion ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.CS.CS.internal__static_D3_CS_SnapshotVersion__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.CS.CS.internal__static_D3_CS_SnapshotVersion__FieldAccessorTable; } + } + + public const int VersionFieldNumber = 1; + private bool hasVersion; + private ulong version_; + public bool HasVersion { + get { return hasVersion; } + } + public ulong Version { + get { return version_; } + } + + public const int SnapshotFieldNumber = 2; + private bool hasSnapshot; + private global::D3.CS.Snapshot snapshot_; + public bool HasSnapshot { + get { return hasSnapshot; } + } + public global::D3.CS.Snapshot Snapshot { + get { return snapshot_ ?? global::D3.CS.Snapshot.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasVersion) return false; + if (!hasSnapshot) return false; + if (!Snapshot.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _snapshotVersionFieldNames; + if (hasVersion) { + output.WriteUInt64(1, field_names[1], Version); + } + if (hasSnapshot) { + output.WriteMessage(2, field_names[0], Snapshot); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasVersion) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, Version); + } + if (hasSnapshot) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Snapshot); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static SnapshotVersion ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SnapshotVersion ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SnapshotVersion ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SnapshotVersion ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SnapshotVersion ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SnapshotVersion ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SnapshotVersion ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SnapshotVersion ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SnapshotVersion ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SnapshotVersion ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SnapshotVersion MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SnapshotVersion prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SnapshotVersion cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SnapshotVersion result; + + private SnapshotVersion PrepareBuilder() { + if (resultIsReadOnly) { + SnapshotVersion original = result; + result = new SnapshotVersion(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SnapshotVersion MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.CS.SnapshotVersion.Descriptor; } + } + + public override SnapshotVersion DefaultInstanceForType { + get { return global::D3.CS.SnapshotVersion.DefaultInstance; } + } + + public override SnapshotVersion BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SnapshotVersion) { + return MergeFrom((SnapshotVersion) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SnapshotVersion other) { + if (other == global::D3.CS.SnapshotVersion.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasVersion) { + Version = other.Version; + } + if (other.HasSnapshot) { + MergeSnapshot(other.Snapshot); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_snapshotVersionFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _snapshotVersionFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasVersion = input.ReadUInt64(ref result.version_); + break; + } + case 18: { + global::D3.CS.Snapshot.Builder subBuilder = global::D3.CS.Snapshot.CreateBuilder(); + if (result.hasSnapshot) { + subBuilder.MergeFrom(Snapshot); + } + input.ReadMessage(subBuilder, extensionRegistry); + Snapshot = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasVersion { + get { return result.hasVersion; } + } + public ulong Version { + get { return result.Version; } + set { SetVersion(value); } + } + public Builder SetVersion(ulong value) { + PrepareBuilder(); + result.hasVersion = true; + result.version_ = value; + return this; + } + public Builder ClearVersion() { + PrepareBuilder(); + result.hasVersion = false; + result.version_ = 0UL; + return this; + } + + public bool HasSnapshot { + get { return result.hasSnapshot; } + } + public global::D3.CS.Snapshot Snapshot { + get { return result.Snapshot; } + set { SetSnapshot(value); } + } + public Builder SetSnapshot(global::D3.CS.Snapshot value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasSnapshot = true; + result.snapshot_ = value; + return this; + } + public Builder SetSnapshot(global::D3.CS.Snapshot.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasSnapshot = true; + result.snapshot_ = builderForValue.Build(); + return this; + } + public Builder MergeSnapshot(global::D3.CS.Snapshot value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasSnapshot && + result.snapshot_ != global::D3.CS.Snapshot.DefaultInstance) { + result.snapshot_ = global::D3.CS.Snapshot.CreateBuilder(result.snapshot_).MergeFrom(value).BuildPartial(); + } else { + result.snapshot_ = value; + } + result.hasSnapshot = true; + return this; + } + public Builder ClearSnapshot() { + PrepareBuilder(); + result.hasSnapshot = false; + result.snapshot_ = null; + return this; + } + } + static SnapshotVersion() { + object.ReferenceEquals(global::D3.CS.CS.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class SnapshotVersions : pb::GeneratedMessage { + private SnapshotVersions() { } + private static readonly SnapshotVersions defaultInstance = new SnapshotVersions().MakeReadOnly(); + private static readonly string[] _snapshotVersionsFieldNames = new string[] { "versions" }; + private static readonly uint[] _snapshotVersionsFieldTags = new uint[] { 10 }; + public static SnapshotVersions DefaultInstance { + get { return defaultInstance; } + } + + public override SnapshotVersions DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SnapshotVersions ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.CS.CS.internal__static_D3_CS_SnapshotVersions__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.CS.CS.internal__static_D3_CS_SnapshotVersions__FieldAccessorTable; } + } + + public const int VersionsFieldNumber = 1; + private pbc::PopsicleList versions_ = new pbc::PopsicleList(); + public scg::IList VersionsList { + get { return versions_; } + } + public int VersionsCount { + get { return versions_.Count; } + } + public global::D3.CS.SnapshotVersion GetVersions(int index) { + return versions_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::D3.CS.SnapshotVersion element in VersionsList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _snapshotVersionsFieldNames; + if (versions_.Count > 0) { + output.WriteMessageArray(1, field_names[0], versions_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::D3.CS.SnapshotVersion element in VersionsList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static SnapshotVersions ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SnapshotVersions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SnapshotVersions ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SnapshotVersions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SnapshotVersions ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SnapshotVersions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SnapshotVersions ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SnapshotVersions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SnapshotVersions ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SnapshotVersions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SnapshotVersions MakeReadOnly() { + versions_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SnapshotVersions prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SnapshotVersions cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SnapshotVersions result; + + private SnapshotVersions PrepareBuilder() { + if (resultIsReadOnly) { + SnapshotVersions original = result; + result = new SnapshotVersions(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SnapshotVersions MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.CS.SnapshotVersions.Descriptor; } + } + + public override SnapshotVersions DefaultInstanceForType { + get { return global::D3.CS.SnapshotVersions.DefaultInstance; } + } + + public override SnapshotVersions BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SnapshotVersions) { + return MergeFrom((SnapshotVersions) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SnapshotVersions other) { + if (other == global::D3.CS.SnapshotVersions.DefaultInstance) return this; + PrepareBuilder(); + if (other.versions_.Count != 0) { + result.versions_.Add(other.versions_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_snapshotVersionsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _snapshotVersionsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.versions_, global::D3.CS.SnapshotVersion.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList VersionsList { + get { return PrepareBuilder().versions_; } + } + public int VersionsCount { + get { return result.VersionsCount; } + } + public global::D3.CS.SnapshotVersion GetVersions(int index) { + return result.GetVersions(index); + } + public Builder SetVersions(int index, global::D3.CS.SnapshotVersion value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.versions_[index] = value; + return this; + } + public Builder SetVersions(int index, global::D3.CS.SnapshotVersion.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.versions_[index] = builderForValue.Build(); + return this; + } + public Builder AddVersions(global::D3.CS.SnapshotVersion value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.versions_.Add(value); + return this; + } + public Builder AddVersions(global::D3.CS.SnapshotVersion.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.versions_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeVersions(scg::IEnumerable values) { + PrepareBuilder(); + result.versions_.Add(values); + return this; + } + public Builder ClearVersions() { + PrepareBuilder(); + result.versions_.Clear(); + return this; + } + } + static SnapshotVersions() { + object.ReferenceEquals(global::D3.CS.CS.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/LibMooNet/D3/Client/Settings.cs b/src/LibMooNet/D3/Client/Settings.cs new file mode 100644 index 00000000..57b995b6 --- /dev/null +++ b/src/LibMooNet/D3/Client/Settings.cs @@ -0,0 +1,6340 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace D3.Client { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class Settings { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_D3_Client_ToonSettings__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Client_ToonSettings__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_Client_ActionBinding__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Client_ActionBinding__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_Client_GameAccountSettings__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Client_GameAccountSettings__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_Client_Preferences__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Client_Preferences__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static Settings() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "Cg5TZXR0aW5ncy5wcm90bxIJRDMuQ2xpZW50IiMKDFRvb25TZXR0aW5ncxIT" + + "Cgh1aV9mbGFncxgBIAEoDToBMCJ3Cg1BY3Rpb25CaW5kaW5nEhEKBWtleV8x" + + "GAEgAigFOgItMRIfChRrZXlfbW9kaWZpZXJfZmxhZ3NfMRgCIAIoDToBMBIR" + + "CgVrZXlfMhgDIAIoBToCLTESHwoUa2V5X21vZGlmaWVyX2ZsYWdzXzIYBCAC" + + "KA06ATAi1AEKE0dhbWVBY2NvdW50U2V0dGluZ3MSGAoNdXNlX2xhc3RfaGVy" + + "bxgBIAEoBToBMBIdChJzaG93X29mZmxpbmVfdG9hc3QYAiABKAU6ATASHgoW" + + "cm10X2xhc3RfdXNlZF9jdXJyZW5jeRgDIAEoCRIoCh1jb29wX2xhc3RfY3Jl" + + "YXRlX2dhbWVfcHJpdmFjeRgEIAEoBToBMRIeChZybXRfcHJlZmVycmVkX2N1" + + "cnJlbmN5GAUgASgJEhoKEmF1dG9fam9pbl9jaGFubmVscxgGIAMoCSLAJAoL" + + "UHJlZmVyZW5jZXMSDwoHdmVyc2lvbhgBIAIoBRIQCgVmbGFncxgCIAEoDToB" + + "MBIiChdpdGVtc19vbl9ncm91bmRfc2V0dGluZxgDIAEoDToBMBI6ChhhY3Rp" + + "b25fYmluZGluZ19pbnZlbnRvcnkYBCABKAsyGC5EMy5DbGllbnQuQWN0aW9u" + + "QmluZGluZxI5ChdhY3Rpb25fYmluZGluZ19oaXJlbGluZxgFIAEoCzIYLkQz" + + "LkNsaWVudC5BY3Rpb25CaW5kaW5nEjcKFWFjdGlvbl9iaW5kaW5nX3NraWxs" + + "cxgGIAEoCzIYLkQzLkNsaWVudC5BY3Rpb25CaW5kaW5nEjcKFWFjdGlvbl9i" + + "aW5kaW5nX3F1ZXN0cxhKIAEoCzIYLkQzLkNsaWVudC5BY3Rpb25CaW5kaW5n" + + "EjUKE2FjdGlvbl9iaW5kaW5nX2xvcmUYCCABKAsyGC5EMy5DbGllbnQuQWN0" + + "aW9uQmluZGluZxI3ChVhY3Rpb25fYmluZGluZ19zb2NpYWwYCSABKAsyGC5E" + + "My5DbGllbnQuQWN0aW9uQmluZGluZxI5ChdhY3Rpb25fYmluZGluZ193b3Js" + + "ZG1hcBgKIAEoCzIYLkQzLkNsaWVudC5BY3Rpb25CaW5kaW5nEjUKE2FjdGlv" + + "bl9iaW5kaW5nX2hlbHAYCyABKAsyGC5EMy5DbGllbnQuQWN0aW9uQmluZGlu" + + "ZxI+ChxhY3Rpb25fYmluZGluZ19yZWNlbnRwbGF5ZXJzGAwgASgLMhguRDMu" + + "Q2xpZW50LkFjdGlvbkJpbmRpbmcSOgoYYWN0aW9uX2JpbmRpbmdfY2hhdGxv" + + "YmJ5GA0gASgLMhguRDMuQ2xpZW50LkFjdGlvbkJpbmRpbmcSPQobYWN0aW9u" + + "X2JpbmRpbmdfYWNoaWV2ZW1lbnRzGA4gASgLMhguRDMuQ2xpZW50LkFjdGlv" + + "bkJpbmRpbmcSOAoWYWN0aW9uX2JpbmRpbmdfcHJvZmlsZRgPIAEoCzIYLkQz" + + "LkNsaWVudC5BY3Rpb25CaW5kaW5nEj0KG2FjdGlvbl9iaW5kaW5nX2F1Y3Rp" + + "b25ob3VzZRgQIAEoCzIYLkQzLkNsaWVudC5BY3Rpb25CaW5kaW5nEjYKFGFj" + + "dGlvbl9iaW5kaW5nX2NsZWFyGBEgASgLMhguRDMuQ2xpZW50LkFjdGlvbkJp" + + "bmRpbmcSOAoWYWN0aW9uX2JpbmRpbmdfY29uc29sZRgSIAEoCzIYLkQzLkNs" + + "aWVudC5BY3Rpb25CaW5kaW5nEjQKEmFjdGlvbl9iaW5kaW5nX21hcBgTIAEo" + + "CzIYLkQzLkNsaWVudC5BY3Rpb25CaW5kaW5nEjsKGWFjdGlvbl9iaW5kaW5n" + + "X3NraWxsY3ljbGUYFCABKAsyGC5EMy5DbGllbnQuQWN0aW9uQmluZGluZxJE" + + "CiJhY3Rpb25fYmluZGluZ190b2dnbGVtb25zdGVyaHBiYXJzGBUgASgLMhgu" + + "RDMuQ2xpZW50LkFjdGlvbkJpbmRpbmcSQwohYWN0aW9uX2JpbmRpbmdfdG9n" + + "Z2xlcGxheWVyaHBiYXJzGBYgASgLMhguRDMuQ2xpZW50LkFjdGlvbkJpbmRp" + + "bmcSRAoiYWN0aW9uX2JpbmRpbmdfdG9nZ2xlZGFtYWdlbnVtYmVycxgXIAEo" + + "CzIYLkQzLkNsaWVudC5BY3Rpb25CaW5kaW5nEkQKImFjdGlvbl9iaW5kaW5n" + + "X3RvZ2dsZWl0ZW1zb25ncm91bmQYGCABKAsyGC5EMy5DbGllbnQuQWN0aW9u" + + "QmluZGluZxI6ChhhY3Rpb25fYmluZGluZ19yZXdoaXNwZXIYGSABKAsyGC5E" + + "My5DbGllbnQuQWN0aW9uQmluZGluZxI9ChthY3Rpb25fYmluZGluZ193aGlz" + + "cGVycmVwbHkYGiABKAsyGC5EMy5DbGllbnQuQWN0aW9uQmluZGluZxI5Chdh" + + "Y3Rpb25fYmluZGluZ192b2ljZXB0dBgbIAEoCzIYLkQzLkNsaWVudC5BY3Rp" + + "b25CaW5kaW5nEjcKFWFjdGlvbl9iaW5kaW5nX3NraWxsMRgcIAEoCzIYLkQz" + + "LkNsaWVudC5BY3Rpb25CaW5kaW5nEjcKFWFjdGlvbl9iaW5kaW5nX3NraWxs" + + "MhgdIAEoCzIYLkQzLkNsaWVudC5BY3Rpb25CaW5kaW5nEjcKFWFjdGlvbl9i" + + "aW5kaW5nX3NraWxsMxgeIAEoCzIYLkQzLkNsaWVudC5BY3Rpb25CaW5kaW5n" + + "EjcKFWFjdGlvbl9iaW5kaW5nX3NraWxsNBgfIAEoCzIYLkQzLkNsaWVudC5B" + + "Y3Rpb25CaW5kaW5nEjcKFWFjdGlvbl9iaW5kaW5nX3BvdGlvbhggIAEoCzIY" + + "LkQzLkNsaWVudC5BY3Rpb25CaW5kaW5nEjsKGWFjdGlvbl9iaW5kaW5nX2Jh" + + "bm5lcmRyb3AYISABKAsyGC5EMy5DbGllbnQuQWN0aW9uQmluZGluZxI1ChNh" + + "Y3Rpb25fYmluZGluZ196b29tGCIgASgLMhguRDMuQ2xpZW50LkFjdGlvbkJp" + + "bmRpbmcSPAoaYWN0aW9uX2JpbmRpbmdfZW1vdGVmb2xsb3cYIyABKAsyGC5E" + + "My5DbGllbnQuQWN0aW9uQmluZGluZxI6ChhhY3Rpb25fYmluZGluZ19lbW90" + + "ZWdpdmUYJCABKAsyGC5EMy5DbGllbnQuQWN0aW9uQmluZGluZxI8ChphY3Rp" + + "b25fYmluZGluZ19lbW90ZXRoYW5rcxglIAEoCzIYLkQzLkNsaWVudC5BY3Rp" + + "b25CaW5kaW5nEjsKGWFjdGlvbl9iaW5kaW5nX2Vtb3Rlc29ycnkYJiABKAsy" + + "GC5EMy5DbGllbnQuQWN0aW9uQmluZGluZxI5ChdhY3Rpb25fYmluZGluZ19l" + + "bW90ZWJ5ZRgnIAEoCzIYLkQzLkNsaWVudC5BY3Rpb25CaW5kaW5nEjkKF2Fj" + + "dGlvbl9iaW5kaW5nX2Vtb3RlZGllGCggASgLMhguRDMuQ2xpZW50LkFjdGlv" + + "bkJpbmRpbmcSOQoXYWN0aW9uX2JpbmRpbmdfZW1vdGVydW4YKSABKAsyGC5E" + + "My5DbGllbnQuQWN0aW9uQmluZGluZxI6ChhhY3Rpb25fYmluZGluZ19lbW90" + + "ZXdhaXQYKiABKAsyGC5EMy5DbGllbnQuQWN0aW9uQmluZGluZxI4ChZhY3Rp" + + "b25fYmluZGluZ19lbW90ZWdvGCsgASgLMhguRDMuQ2xpZW50LkFjdGlvbkJp" + + "bmRpbmcSOgoYYWN0aW9uX2JpbmRpbmdfZW1vdGVoZWxwGCwgASgLMhguRDMu" + + "Q2xpZW50LkFjdGlvbkJpbmRpbmcSOQoXYWN0aW9uX2JpbmRpbmdfZW1vdGV5" + + "ZXMYLSABKAsyGC5EMy5DbGllbnQuQWN0aW9uQmluZGluZxI4ChZhY3Rpb25f" + + "YmluZGluZ19lbW90ZW5vGC4gASgLMhguRDMuQ2xpZW50LkFjdGlvbkJpbmRp" + + "bmcSOgoYYWN0aW9uX2JpbmRpbmdfZW1vdGVzdGF5GC8gASgLMhguRDMuQ2xp" + + "ZW50LkFjdGlvbkJpbmRpbmcSPAoaYWN0aW9uX2JpbmRpbmdfZW1vdGVhdHRh" + + "Y2sYMCABKAsyGC5EMy5DbGllbnQuQWN0aW9uQmluZGluZxI9ChthY3Rpb25f" + + "YmluZGluZ19lbW90ZXJldHJlYXQYMSABKAsyGC5EMy5DbGllbnQuQWN0aW9u" + + "QmluZGluZxI6ChhhY3Rpb25fYmluZGluZ19lbW90ZWhvbGQYMiABKAsyGC5E" + + "My5DbGllbnQuQWN0aW9uQmluZGluZxJDCiFhY3Rpb25fYmluZGluZ19lbW90" + + "ZXRha2VvYmplY3RpdmUYMyABKAsyGC5EMy5DbGllbnQuQWN0aW9uQmluZGlu" + + "ZxI7ChlhY3Rpb25fYmluZGluZ19lbW90ZWxhdWdoGDQgASgLMhguRDMuQ2xp" + + "ZW50LkFjdGlvbkJpbmRpbmcSPQobYWN0aW9uX2JpbmRpbmdfaG9sZHBvc2l0" + + "aW9uGDUgASgLMhguRDMuQ2xpZW50LkFjdGlvbkJpbmRpbmcSRQojYWN0aW9u" + + "X2JpbmRpbmdfc3lzdGVtbWFzdGVydm9sdW1ldXAYNiABKAsyGC5EMy5DbGll" + + "bnQuQWN0aW9uQmluZGluZxJHCiVhY3Rpb25fYmluZGluZ19zeXN0ZW1tYXN0" + + "ZXJ2b2x1bWVkb3duGDcgASgLMhguRDMuQ2xpZW50LkFjdGlvbkJpbmRpbmcS" + + "QgogYWN0aW9uX2JpbmRpbmdfc3lzdGVtdG9nZ2xlbXVzaWMYOCABKAsyGC5E" + + "My5DbGllbnQuQWN0aW9uQmluZGluZxJCCiBhY3Rpb25fYmluZGluZ19zeXN0" + + "ZW10b2dnbGVzb3VuZBg5IAEoCzIYLkQzLkNsaWVudC5BY3Rpb25CaW5kaW5n" + + "EkEKH2FjdGlvbl9iaW5kaW5nX3N5c3RlbXNjcmVlbnNob3QYOiABKAsyGC5E" + + "My5DbGllbnQuQWN0aW9uQmluZGluZxI+ChxhY3Rpb25fYmluZGluZ19zdG9u" + + "ZW9mcmVjYWxsGDsgASgLMhguRDMuQ2xpZW50LkFjdGlvbkJpbmRpbmcSPQob" + + "YWN0aW9uX2JpbmRpbmdfYmFubmVyc2NyZWVuGDwgASgLMhguRDMuQ2xpZW50" + + "LkFjdGlvbkJpbmRpbmcSNAoSYWN0aW9uX2JpbmRpbmdfbG1iGD0gASgLMhgu" + + "RDMuQ2xpZW50LkFjdGlvbkJpbmRpbmcSNAoSYWN0aW9uX2JpbmRpbmdfcm1i" + + "GD4gASgLMhguRDMuQ2xpZW50LkFjdGlvbkJpbmRpbmcSNQoTYWN0aW9uX2Jp" + + "bmRpbmdfd2Fsaxg/IAEoCzIYLkQzLkNsaWVudC5BY3Rpb25CaW5kaW5nEkAK" + + "HmFjdGlvbl9iaW5kaW5nX3N5c3RlbXRvZ2dsZWZwcxhAIAEoCzIYLkQzLkNs" + + "aWVudC5BY3Rpb25CaW5kaW5nEjsKGWFjdGlvbl9iaW5kaW5nX2NoYXRwYWdl" + + "dXAYQSABKAsyGC5EMy5DbGllbnQuQWN0aW9uQmluZGluZxI9ChthY3Rpb25f" + + "YmluZGluZ19jaGF0cGFnZWRvd24YQiABKAsyGC5EMy5DbGllbnQuQWN0aW9u" + + "QmluZGluZxIaCg9ub3RpZnlfZHVyYXRpb24YZCABKA06ATASEgoGZmxhZ3My" + + "GMgBIAEoDToBMCLtBAoFRmxhZ3MSHQoZU0hPV19JVEVNX1RPT0xUSVBfT05f" + + "RFJPUBABEhgKFFNIT1dfTU9OU1RFUl9IUF9CQVJTEAISFwoTU0hPV19QTEFZ" + + "RVJfSFBfQkFSUxADEhgKFFNIT1dfSVRFTVNfT05fR1JPVU5EEAYSFwoTU0hP" + + "V19EQU1BR0VfTlVNQkVSUxAIEhIKDlNIT1dfQ1JJVElDQUxTEAkSGwoXU0hP" + + "V19ERUZFTlNJVkVfTUVTU0FHRVMQChISCg5JTlZFTlRPUllfWk9PTRALEhQK" + + "EEFVVE9fRVFVSVBfSVRFTVMQDBISCg5TSE9XX1RVVE9SSUFMUxANEhQKEFNI" + + "T1dfQlJFQURfQ1JVTUIQDhIYChRESVNBQkxFX09TX1NIT1JUQ1VUUxAREhUK" + + "EVNIT1dfSEVBTF9OVU1CRVJTEBISFQoRU0hPV19QTEFZRVJfTkFNRVMQExIX" + + "ChNTSE9XX0hQX0JBUl9OVU1CRVJTEBQSDgoKU0hPV19DTE9DSxAVEhoKFlNI" + + "T1dfQURWQU5DRURfVE9PTFRJUFMQFhIRCg1FTEVDVElWRV9NT0RFEBcSGAoU" + + "Tk9USUZZX0ZSSUVORF9PTkxJTkUQGBIZChVOT1RJRllfRlJJRU5EX09GRkxJ" + + "TkUQGRIZChVOT1RJRllfRlJJRU5EX1JFUVVFU1QQGhIdChlOT1RJRllfRlJJ" + + "RU5EX0FDSElFVkVNRU5UEBsSGQoVTk9USUZZX0RJU1BMQVlfV0lORE9XEBwS" + + "GgoWTUFUVVJFX0xBTkdVQUdFX0ZJTFRFUhAdEhQKEEFMTE9XX1FVSUNLX0pP" + + "SU4QHiJKCgZGbGFnczISGgoWVVNFX0NPTU1BTkRfQVNfQ09OVFJPTBABEiQK" + + "IFVTRV9DT01NQU5EX0NMSUNLX0FTX1JJR0hUX0NMSUNLEAI="); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_D3_Client_ToonSettings__Descriptor = Descriptor.MessageTypes[0]; + internal__static_D3_Client_ToonSettings__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Client_ToonSettings__Descriptor, + new string[] { "UiFlags", }); + internal__static_D3_Client_ActionBinding__Descriptor = Descriptor.MessageTypes[1]; + internal__static_D3_Client_ActionBinding__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Client_ActionBinding__Descriptor, + new string[] { "Key1", "KeyModifierFlags1", "Key2", "KeyModifierFlags2", }); + internal__static_D3_Client_GameAccountSettings__Descriptor = Descriptor.MessageTypes[2]; + internal__static_D3_Client_GameAccountSettings__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Client_GameAccountSettings__Descriptor, + new string[] { "UseLastHero", "ShowOfflineToast", "RmtLastUsedCurrency", "CoopLastCreateGamePrivacy", "RmtPreferredCurrency", "AutoJoinChannels", }); + internal__static_D3_Client_Preferences__Descriptor = Descriptor.MessageTypes[3]; + internal__static_D3_Client_Preferences__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Client_Preferences__Descriptor, + new string[] { "Version", "Flags", "ItemsOnGroundSetting", "ActionBindingInventory", "ActionBindingHireling", "ActionBindingSkills", "ActionBindingQuests", "ActionBindingLore", "ActionBindingSocial", "ActionBindingWorldmap", "ActionBindingHelp", "ActionBindingRecentplayers", "ActionBindingChatlobby", "ActionBindingAchievements", "ActionBindingProfile", "ActionBindingAuctionhouse", "ActionBindingClear", "ActionBindingConsole", "ActionBindingMap", "ActionBindingSkillcycle", "ActionBindingTogglemonsterhpbars", "ActionBindingToggleplayerhpbars", "ActionBindingToggledamagenumbers", "ActionBindingToggleitemsonground", "ActionBindingRewhisper", "ActionBindingWhisperreply", "ActionBindingVoiceptt", "ActionBindingSkill1", "ActionBindingSkill2", "ActionBindingSkill3", "ActionBindingSkill4", "ActionBindingPotion", "ActionBindingBannerdrop", "ActionBindingZoom", "ActionBindingEmotefollow", "ActionBindingEmotegive", "ActionBindingEmotethanks", "ActionBindingEmotesorry", "ActionBindingEmotebye", "ActionBindingEmotedie", "ActionBindingEmoterun", "ActionBindingEmotewait", "ActionBindingEmotego", "ActionBindingEmotehelp", "ActionBindingEmoteyes", "ActionBindingEmoteno", "ActionBindingEmotestay", "ActionBindingEmoteattack", "ActionBindingEmoteretreat", "ActionBindingEmotehold", "ActionBindingEmotetakeobjective", "ActionBindingEmotelaugh", "ActionBindingHoldposition", "ActionBindingSystemmastervolumeup", "ActionBindingSystemmastervolumedown", "ActionBindingSystemtogglemusic", "ActionBindingSystemtogglesound", "ActionBindingSystemscreenshot", "ActionBindingStoneofrecall", "ActionBindingBannerscreen", "ActionBindingLmb", "ActionBindingRmb", "ActionBindingWalk", "ActionBindingSystemtogglefps", "ActionBindingChatpageup", "ActionBindingChatpagedown", "NotifyDuration", "Flags2", }); + return null; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + }, assigner); + } + #endregion + + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ToonSettings : pb::GeneratedMessage { + private ToonSettings() { } + private static readonly ToonSettings defaultInstance = new ToonSettings().MakeReadOnly(); + private static readonly string[] _toonSettingsFieldNames = new string[] { "ui_flags" }; + private static readonly uint[] _toonSettingsFieldTags = new uint[] { 8 }; + public static ToonSettings DefaultInstance { + get { return defaultInstance; } + } + + public override ToonSettings DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ToonSettings ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.Client.Settings.internal__static_D3_Client_ToonSettings__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.Client.Settings.internal__static_D3_Client_ToonSettings__FieldAccessorTable; } + } + + public const int UiFlagsFieldNumber = 1; + private bool hasUiFlags; + private uint uiFlags_; + public bool HasUiFlags { + get { return hasUiFlags; } + } + public uint UiFlags { + get { return uiFlags_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _toonSettingsFieldNames; + if (hasUiFlags) { + output.WriteUInt32(1, field_names[0], UiFlags); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasUiFlags) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, UiFlags); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ToonSettings ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ToonSettings ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ToonSettings ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ToonSettings ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ToonSettings ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ToonSettings ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ToonSettings ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ToonSettings ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ToonSettings ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ToonSettings ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ToonSettings MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ToonSettings prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ToonSettings cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ToonSettings result; + + private ToonSettings PrepareBuilder() { + if (resultIsReadOnly) { + ToonSettings original = result; + result = new ToonSettings(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ToonSettings MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.Client.ToonSettings.Descriptor; } + } + + public override ToonSettings DefaultInstanceForType { + get { return global::D3.Client.ToonSettings.DefaultInstance; } + } + + public override ToonSettings BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ToonSettings) { + return MergeFrom((ToonSettings) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ToonSettings other) { + if (other == global::D3.Client.ToonSettings.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasUiFlags) { + UiFlags = other.UiFlags; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_toonSettingsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _toonSettingsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasUiFlags = input.ReadUInt32(ref result.uiFlags_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasUiFlags { + get { return result.hasUiFlags; } + } + public uint UiFlags { + get { return result.UiFlags; } + set { SetUiFlags(value); } + } + public Builder SetUiFlags(uint value) { + PrepareBuilder(); + result.hasUiFlags = true; + result.uiFlags_ = value; + return this; + } + public Builder ClearUiFlags() { + PrepareBuilder(); + result.hasUiFlags = false; + result.uiFlags_ = 0; + return this; + } + } + static ToonSettings() { + object.ReferenceEquals(global::D3.Client.Settings.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ActionBinding : pb::GeneratedMessage { + private ActionBinding() { } + private static readonly ActionBinding defaultInstance = new ActionBinding().MakeReadOnly(); + private static readonly string[] _actionBindingFieldNames = new string[] { "key_1", "key_2", "key_modifier_flags_1", "key_modifier_flags_2" }; + private static readonly uint[] _actionBindingFieldTags = new uint[] { 8, 24, 16, 32 }; + public static ActionBinding DefaultInstance { + get { return defaultInstance; } + } + + public override ActionBinding DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ActionBinding ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.Client.Settings.internal__static_D3_Client_ActionBinding__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.Client.Settings.internal__static_D3_Client_ActionBinding__FieldAccessorTable; } + } + + public const int Key1FieldNumber = 1; + private bool hasKey1; + private int key1_ = -1; + public bool HasKey1 { + get { return hasKey1; } + } + public int Key1 { + get { return key1_; } + } + + public const int KeyModifierFlags1FieldNumber = 2; + private bool hasKeyModifierFlags1; + private uint keyModifierFlags1_; + public bool HasKeyModifierFlags1 { + get { return hasKeyModifierFlags1; } + } + public uint KeyModifierFlags1 { + get { return keyModifierFlags1_; } + } + + public const int Key2FieldNumber = 3; + private bool hasKey2; + private int key2_ = -1; + public bool HasKey2 { + get { return hasKey2; } + } + public int Key2 { + get { return key2_; } + } + + public const int KeyModifierFlags2FieldNumber = 4; + private bool hasKeyModifierFlags2; + private uint keyModifierFlags2_; + public bool HasKeyModifierFlags2 { + get { return hasKeyModifierFlags2; } + } + public uint KeyModifierFlags2 { + get { return keyModifierFlags2_; } + } + + public override bool IsInitialized { + get { + if (!hasKey1) return false; + if (!hasKeyModifierFlags1) return false; + if (!hasKey2) return false; + if (!hasKeyModifierFlags2) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _actionBindingFieldNames; + if (hasKey1) { + output.WriteInt32(1, field_names[0], Key1); + } + if (hasKeyModifierFlags1) { + output.WriteUInt32(2, field_names[2], KeyModifierFlags1); + } + if (hasKey2) { + output.WriteInt32(3, field_names[1], Key2); + } + if (hasKeyModifierFlags2) { + output.WriteUInt32(4, field_names[3], KeyModifierFlags2); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasKey1) { + size += pb::CodedOutputStream.ComputeInt32Size(1, Key1); + } + if (hasKeyModifierFlags1) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, KeyModifierFlags1); + } + if (hasKey2) { + size += pb::CodedOutputStream.ComputeInt32Size(3, Key2); + } + if (hasKeyModifierFlags2) { + size += pb::CodedOutputStream.ComputeUInt32Size(4, KeyModifierFlags2); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ActionBinding ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ActionBinding ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ActionBinding ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ActionBinding ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ActionBinding ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ActionBinding ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ActionBinding ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ActionBinding ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ActionBinding ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ActionBinding ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ActionBinding MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ActionBinding prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ActionBinding cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ActionBinding result; + + private ActionBinding PrepareBuilder() { + if (resultIsReadOnly) { + ActionBinding original = result; + result = new ActionBinding(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ActionBinding MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.Client.ActionBinding.Descriptor; } + } + + public override ActionBinding DefaultInstanceForType { + get { return global::D3.Client.ActionBinding.DefaultInstance; } + } + + public override ActionBinding BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ActionBinding) { + return MergeFrom((ActionBinding) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ActionBinding other) { + if (other == global::D3.Client.ActionBinding.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasKey1) { + Key1 = other.Key1; + } + if (other.HasKeyModifierFlags1) { + KeyModifierFlags1 = other.KeyModifierFlags1; + } + if (other.HasKey2) { + Key2 = other.Key2; + } + if (other.HasKeyModifierFlags2) { + KeyModifierFlags2 = other.KeyModifierFlags2; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_actionBindingFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _actionBindingFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasKey1 = input.ReadInt32(ref result.key1_); + break; + } + case 16: { + result.hasKeyModifierFlags1 = input.ReadUInt32(ref result.keyModifierFlags1_); + break; + } + case 24: { + result.hasKey2 = input.ReadInt32(ref result.key2_); + break; + } + case 32: { + result.hasKeyModifierFlags2 = input.ReadUInt32(ref result.keyModifierFlags2_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasKey1 { + get { return result.hasKey1; } + } + public int Key1 { + get { return result.Key1; } + set { SetKey1(value); } + } + public Builder SetKey1(int value) { + PrepareBuilder(); + result.hasKey1 = true; + result.key1_ = value; + return this; + } + public Builder ClearKey1() { + PrepareBuilder(); + result.hasKey1 = false; + result.key1_ = -1; + return this; + } + + public bool HasKeyModifierFlags1 { + get { return result.hasKeyModifierFlags1; } + } + public uint KeyModifierFlags1 { + get { return result.KeyModifierFlags1; } + set { SetKeyModifierFlags1(value); } + } + public Builder SetKeyModifierFlags1(uint value) { + PrepareBuilder(); + result.hasKeyModifierFlags1 = true; + result.keyModifierFlags1_ = value; + return this; + } + public Builder ClearKeyModifierFlags1() { + PrepareBuilder(); + result.hasKeyModifierFlags1 = false; + result.keyModifierFlags1_ = 0; + return this; + } + + public bool HasKey2 { + get { return result.hasKey2; } + } + public int Key2 { + get { return result.Key2; } + set { SetKey2(value); } + } + public Builder SetKey2(int value) { + PrepareBuilder(); + result.hasKey2 = true; + result.key2_ = value; + return this; + } + public Builder ClearKey2() { + PrepareBuilder(); + result.hasKey2 = false; + result.key2_ = -1; + return this; + } + + public bool HasKeyModifierFlags2 { + get { return result.hasKeyModifierFlags2; } + } + public uint KeyModifierFlags2 { + get { return result.KeyModifierFlags2; } + set { SetKeyModifierFlags2(value); } + } + public Builder SetKeyModifierFlags2(uint value) { + PrepareBuilder(); + result.hasKeyModifierFlags2 = true; + result.keyModifierFlags2_ = value; + return this; + } + public Builder ClearKeyModifierFlags2() { + PrepareBuilder(); + result.hasKeyModifierFlags2 = false; + result.keyModifierFlags2_ = 0; + return this; + } + } + static ActionBinding() { + object.ReferenceEquals(global::D3.Client.Settings.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GameAccountSettings : pb::GeneratedMessage { + private GameAccountSettings() { } + private static readonly GameAccountSettings defaultInstance = new GameAccountSettings().MakeReadOnly(); + private static readonly string[] _gameAccountSettingsFieldNames = new string[] { "auto_join_channels", "coop_last_create_game_privacy", "rmt_last_used_currency", "rmt_preferred_currency", "show_offline_toast", "use_last_hero" }; + private static readonly uint[] _gameAccountSettingsFieldTags = new uint[] { 50, 32, 26, 42, 16, 8 }; + public static GameAccountSettings DefaultInstance { + get { return defaultInstance; } + } + + public override GameAccountSettings DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GameAccountSettings ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.Client.Settings.internal__static_D3_Client_GameAccountSettings__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.Client.Settings.internal__static_D3_Client_GameAccountSettings__FieldAccessorTable; } + } + + public const int UseLastHeroFieldNumber = 1; + private bool hasUseLastHero; + private int useLastHero_; + public bool HasUseLastHero { + get { return hasUseLastHero; } + } + public int UseLastHero { + get { return useLastHero_; } + } + + public const int ShowOfflineToastFieldNumber = 2; + private bool hasShowOfflineToast; + private int showOfflineToast_; + public bool HasShowOfflineToast { + get { return hasShowOfflineToast; } + } + public int ShowOfflineToast { + get { return showOfflineToast_; } + } + + public const int RmtLastUsedCurrencyFieldNumber = 3; + private bool hasRmtLastUsedCurrency; + private string rmtLastUsedCurrency_ = ""; + public bool HasRmtLastUsedCurrency { + get { return hasRmtLastUsedCurrency; } + } + public string RmtLastUsedCurrency { + get { return rmtLastUsedCurrency_; } + } + + public const int CoopLastCreateGamePrivacyFieldNumber = 4; + private bool hasCoopLastCreateGamePrivacy; + private int coopLastCreateGamePrivacy_ = 1; + public bool HasCoopLastCreateGamePrivacy { + get { return hasCoopLastCreateGamePrivacy; } + } + public int CoopLastCreateGamePrivacy { + get { return coopLastCreateGamePrivacy_; } + } + + public const int RmtPreferredCurrencyFieldNumber = 5; + private bool hasRmtPreferredCurrency; + private string rmtPreferredCurrency_ = ""; + public bool HasRmtPreferredCurrency { + get { return hasRmtPreferredCurrency; } + } + public string RmtPreferredCurrency { + get { return rmtPreferredCurrency_; } + } + + public const int AutoJoinChannelsFieldNumber = 6; + private pbc::PopsicleList autoJoinChannels_ = new pbc::PopsicleList(); + public scg::IList AutoJoinChannelsList { + get { return pbc::Lists.AsReadOnly(autoJoinChannels_); } + } + public int AutoJoinChannelsCount { + get { return autoJoinChannels_.Count; } + } + public string GetAutoJoinChannels(int index) { + return autoJoinChannels_[index]; + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _gameAccountSettingsFieldNames; + if (hasUseLastHero) { + output.WriteInt32(1, field_names[5], UseLastHero); + } + if (hasShowOfflineToast) { + output.WriteInt32(2, field_names[4], ShowOfflineToast); + } + if (hasRmtLastUsedCurrency) { + output.WriteString(3, field_names[2], RmtLastUsedCurrency); + } + if (hasCoopLastCreateGamePrivacy) { + output.WriteInt32(4, field_names[1], CoopLastCreateGamePrivacy); + } + if (hasRmtPreferredCurrency) { + output.WriteString(5, field_names[3], RmtPreferredCurrency); + } + if (autoJoinChannels_.Count > 0) { + output.WriteStringArray(6, field_names[0], autoJoinChannels_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasUseLastHero) { + size += pb::CodedOutputStream.ComputeInt32Size(1, UseLastHero); + } + if (hasShowOfflineToast) { + size += pb::CodedOutputStream.ComputeInt32Size(2, ShowOfflineToast); + } + if (hasRmtLastUsedCurrency) { + size += pb::CodedOutputStream.ComputeStringSize(3, RmtLastUsedCurrency); + } + if (hasCoopLastCreateGamePrivacy) { + size += pb::CodedOutputStream.ComputeInt32Size(4, CoopLastCreateGamePrivacy); + } + if (hasRmtPreferredCurrency) { + size += pb::CodedOutputStream.ComputeStringSize(5, RmtPreferredCurrency); + } + { + int dataSize = 0; + foreach (string element in AutoJoinChannelsList) { + dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); + } + size += dataSize; + size += 1 * autoJoinChannels_.Count; + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GameAccountSettings ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GameAccountSettings ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GameAccountSettings ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GameAccountSettings ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GameAccountSettings ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GameAccountSettings ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GameAccountSettings ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GameAccountSettings ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GameAccountSettings ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GameAccountSettings ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GameAccountSettings MakeReadOnly() { + autoJoinChannels_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GameAccountSettings prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GameAccountSettings cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GameAccountSettings result; + + private GameAccountSettings PrepareBuilder() { + if (resultIsReadOnly) { + GameAccountSettings original = result; + result = new GameAccountSettings(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GameAccountSettings MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.Client.GameAccountSettings.Descriptor; } + } + + public override GameAccountSettings DefaultInstanceForType { + get { return global::D3.Client.GameAccountSettings.DefaultInstance; } + } + + public override GameAccountSettings BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GameAccountSettings) { + return MergeFrom((GameAccountSettings) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GameAccountSettings other) { + if (other == global::D3.Client.GameAccountSettings.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasUseLastHero) { + UseLastHero = other.UseLastHero; + } + if (other.HasShowOfflineToast) { + ShowOfflineToast = other.ShowOfflineToast; + } + if (other.HasRmtLastUsedCurrency) { + RmtLastUsedCurrency = other.RmtLastUsedCurrency; + } + if (other.HasCoopLastCreateGamePrivacy) { + CoopLastCreateGamePrivacy = other.CoopLastCreateGamePrivacy; + } + if (other.HasRmtPreferredCurrency) { + RmtPreferredCurrency = other.RmtPreferredCurrency; + } + if (other.autoJoinChannels_.Count != 0) { + result.autoJoinChannels_.Add(other.autoJoinChannels_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_gameAccountSettingsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _gameAccountSettingsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasUseLastHero = input.ReadInt32(ref result.useLastHero_); + break; + } + case 16: { + result.hasShowOfflineToast = input.ReadInt32(ref result.showOfflineToast_); + break; + } + case 26: { + result.hasRmtLastUsedCurrency = input.ReadString(ref result.rmtLastUsedCurrency_); + break; + } + case 32: { + result.hasCoopLastCreateGamePrivacy = input.ReadInt32(ref result.coopLastCreateGamePrivacy_); + break; + } + case 42: { + result.hasRmtPreferredCurrency = input.ReadString(ref result.rmtPreferredCurrency_); + break; + } + case 50: { + input.ReadStringArray(tag, field_name, result.autoJoinChannels_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasUseLastHero { + get { return result.hasUseLastHero; } + } + public int UseLastHero { + get { return result.UseLastHero; } + set { SetUseLastHero(value); } + } + public Builder SetUseLastHero(int value) { + PrepareBuilder(); + result.hasUseLastHero = true; + result.useLastHero_ = value; + return this; + } + public Builder ClearUseLastHero() { + PrepareBuilder(); + result.hasUseLastHero = false; + result.useLastHero_ = 0; + return this; + } + + public bool HasShowOfflineToast { + get { return result.hasShowOfflineToast; } + } + public int ShowOfflineToast { + get { return result.ShowOfflineToast; } + set { SetShowOfflineToast(value); } + } + public Builder SetShowOfflineToast(int value) { + PrepareBuilder(); + result.hasShowOfflineToast = true; + result.showOfflineToast_ = value; + return this; + } + public Builder ClearShowOfflineToast() { + PrepareBuilder(); + result.hasShowOfflineToast = false; + result.showOfflineToast_ = 0; + return this; + } + + public bool HasRmtLastUsedCurrency { + get { return result.hasRmtLastUsedCurrency; } + } + public string RmtLastUsedCurrency { + get { return result.RmtLastUsedCurrency; } + set { SetRmtLastUsedCurrency(value); } + } + public Builder SetRmtLastUsedCurrency(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasRmtLastUsedCurrency = true; + result.rmtLastUsedCurrency_ = value; + return this; + } + public Builder ClearRmtLastUsedCurrency() { + PrepareBuilder(); + result.hasRmtLastUsedCurrency = false; + result.rmtLastUsedCurrency_ = ""; + return this; + } + + public bool HasCoopLastCreateGamePrivacy { + get { return result.hasCoopLastCreateGamePrivacy; } + } + public int CoopLastCreateGamePrivacy { + get { return result.CoopLastCreateGamePrivacy; } + set { SetCoopLastCreateGamePrivacy(value); } + } + public Builder SetCoopLastCreateGamePrivacy(int value) { + PrepareBuilder(); + result.hasCoopLastCreateGamePrivacy = true; + result.coopLastCreateGamePrivacy_ = value; + return this; + } + public Builder ClearCoopLastCreateGamePrivacy() { + PrepareBuilder(); + result.hasCoopLastCreateGamePrivacy = false; + result.coopLastCreateGamePrivacy_ = 1; + return this; + } + + public bool HasRmtPreferredCurrency { + get { return result.hasRmtPreferredCurrency; } + } + public string RmtPreferredCurrency { + get { return result.RmtPreferredCurrency; } + set { SetRmtPreferredCurrency(value); } + } + public Builder SetRmtPreferredCurrency(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasRmtPreferredCurrency = true; + result.rmtPreferredCurrency_ = value; + return this; + } + public Builder ClearRmtPreferredCurrency() { + PrepareBuilder(); + result.hasRmtPreferredCurrency = false; + result.rmtPreferredCurrency_ = ""; + return this; + } + + public pbc::IPopsicleList AutoJoinChannelsList { + get { return PrepareBuilder().autoJoinChannels_; } + } + public int AutoJoinChannelsCount { + get { return result.AutoJoinChannelsCount; } + } + public string GetAutoJoinChannels(int index) { + return result.GetAutoJoinChannels(index); + } + public Builder SetAutoJoinChannels(int index, string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.autoJoinChannels_[index] = value; + return this; + } + public Builder AddAutoJoinChannels(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.autoJoinChannels_.Add(value); + return this; + } + public Builder AddRangeAutoJoinChannels(scg::IEnumerable values) { + PrepareBuilder(); + result.autoJoinChannels_.Add(values); + return this; + } + public Builder ClearAutoJoinChannels() { + PrepareBuilder(); + result.autoJoinChannels_.Clear(); + return this; + } + } + static GameAccountSettings() { + object.ReferenceEquals(global::D3.Client.Settings.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Preferences : pb::GeneratedMessage { + private Preferences() { } + private static readonly Preferences defaultInstance = new Preferences().MakeReadOnly(); + private static readonly string[] _preferencesFieldNames = new string[] { "action_binding_achievements", "action_binding_auctionhouse", "action_binding_bannerdrop", "action_binding_bannerscreen", "action_binding_chatlobby", "action_binding_chatpagedown", "action_binding_chatpageup", "action_binding_clear", "action_binding_console", "action_binding_emoteattack", "action_binding_emotebye", "action_binding_emotedie", "action_binding_emotefollow", "action_binding_emotegive", "action_binding_emotego", "action_binding_emotehelp", "action_binding_emotehold", "action_binding_emotelaugh", "action_binding_emoteno", "action_binding_emoteretreat", "action_binding_emoterun", "action_binding_emotesorry", "action_binding_emotestay", "action_binding_emotetakeobjective", "action_binding_emotethanks", "action_binding_emotewait", "action_binding_emoteyes", "action_binding_help", "action_binding_hireling", "action_binding_holdposition", "action_binding_inventory", "action_binding_lmb", "action_binding_lore", "action_binding_map", "action_binding_potion", "action_binding_profile", "action_binding_quests", "action_binding_recentplayers", "action_binding_rewhisper", "action_binding_rmb", "action_binding_skill1", "action_binding_skill2", "action_binding_skill3", "action_binding_skill4", "action_binding_skillcycle", "action_binding_skills", "action_binding_social", "action_binding_stoneofrecall", "action_binding_systemmastervolumedown", "action_binding_systemmastervolumeup", "action_binding_systemscreenshot", "action_binding_systemtogglefps", "action_binding_systemtogglemusic", "action_binding_systemtogglesound", "action_binding_toggledamagenumbers", "action_binding_toggleitemsonground", "action_binding_togglemonsterhpbars", "action_binding_toggleplayerhpbars", "action_binding_voiceptt", "action_binding_walk", "action_binding_whisperreply", "action_binding_worldmap", "action_binding_zoom", "flags", "flags2", "items_on_ground_setting", "notify_duration", "version" }; + private static readonly uint[] _preferencesFieldTags = new uint[] { 114, 130, 266, 482, 106, 530, 522, 138, 146, 386, 314, 322, 282, 290, 346, 354, 402, 418, 370, 394, 330, 306, 378, 410, 298, 338, 362, 90, 42, 426, 34, 490, 66, 154, 258, 122, 594, 98, 202, 498, 226, 234, 242, 250, 162, 50, 74, 474, 442, 434, 466, 514, 450, 458, 186, 194, 170, 178, 218, 506, 210, 82, 274, 16, 1600, 24, 800, 8 }; + public static Preferences DefaultInstance { + get { return defaultInstance; } + } + + public override Preferences DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Preferences ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.Client.Settings.internal__static_D3_Client_Preferences__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.Client.Settings.internal__static_D3_Client_Preferences__FieldAccessorTable; } + } + + #region Nested types + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static class Types { + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public enum Flags { + SHOW_ITEM_TOOLTIP_ON_DROP = 1, + SHOW_MONSTER_HP_BARS = 2, + SHOW_PLAYER_HP_BARS = 3, + SHOW_ITEMS_ON_GROUND = 6, + SHOW_DAMAGE_NUMBERS = 8, + SHOW_CRITICALS = 9, + SHOW_DEFENSIVE_MESSAGES = 10, + INVENTORY_ZOOM = 11, + AUTO_EQUIP_ITEMS = 12, + SHOW_TUTORIALS = 13, + SHOW_BREAD_CRUMB = 14, + DISABLE_OS_SHORTCUTS = 17, + SHOW_HEAL_NUMBERS = 18, + SHOW_PLAYER_NAMES = 19, + SHOW_HP_BAR_NUMBERS = 20, + SHOW_CLOCK = 21, + SHOW_ADVANCED_TOOLTIPS = 22, + ELECTIVE_MODE = 23, + NOTIFY_FRIEND_ONLINE = 24, + NOTIFY_FRIEND_OFFLINE = 25, + NOTIFY_FRIEND_REQUEST = 26, + NOTIFY_FRIEND_ACHIEVEMENT = 27, + NOTIFY_DISPLAY_WINDOW = 28, + MATURE_LANGUAGE_FILTER = 29, + ALLOW_QUICK_JOIN = 30, + } + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public enum Flags2 { + USE_COMMAND_AS_CONTROL = 1, + USE_COMMAND_CLICK_AS_RIGHT_CLICK = 2, + } + + } + #endregion + + public const int VersionFieldNumber = 1; + private bool hasVersion; + private int version_; + public bool HasVersion { + get { return hasVersion; } + } + public int Version { + get { return version_; } + } + + public const int FlagsFieldNumber = 2; + private bool hasFlags; + private uint flags_; + public bool HasFlags { + get { return hasFlags; } + } + public uint Flags { + get { return flags_; } + } + + public const int ItemsOnGroundSettingFieldNumber = 3; + private bool hasItemsOnGroundSetting; + private uint itemsOnGroundSetting_; + public bool HasItemsOnGroundSetting { + get { return hasItemsOnGroundSetting; } + } + public uint ItemsOnGroundSetting { + get { return itemsOnGroundSetting_; } + } + + public const int ActionBindingInventoryFieldNumber = 4; + private bool hasActionBindingInventory; + private global::D3.Client.ActionBinding actionBindingInventory_; + public bool HasActionBindingInventory { + get { return hasActionBindingInventory; } + } + public global::D3.Client.ActionBinding ActionBindingInventory { + get { return actionBindingInventory_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingHirelingFieldNumber = 5; + private bool hasActionBindingHireling; + private global::D3.Client.ActionBinding actionBindingHireling_; + public bool HasActionBindingHireling { + get { return hasActionBindingHireling; } + } + public global::D3.Client.ActionBinding ActionBindingHireling { + get { return actionBindingHireling_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingSkillsFieldNumber = 6; + private bool hasActionBindingSkills; + private global::D3.Client.ActionBinding actionBindingSkills_; + public bool HasActionBindingSkills { + get { return hasActionBindingSkills; } + } + public global::D3.Client.ActionBinding ActionBindingSkills { + get { return actionBindingSkills_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingQuestsFieldNumber = 74; + private bool hasActionBindingQuests; + private global::D3.Client.ActionBinding actionBindingQuests_; + public bool HasActionBindingQuests { + get { return hasActionBindingQuests; } + } + public global::D3.Client.ActionBinding ActionBindingQuests { + get { return actionBindingQuests_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingLoreFieldNumber = 8; + private bool hasActionBindingLore; + private global::D3.Client.ActionBinding actionBindingLore_; + public bool HasActionBindingLore { + get { return hasActionBindingLore; } + } + public global::D3.Client.ActionBinding ActionBindingLore { + get { return actionBindingLore_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingSocialFieldNumber = 9; + private bool hasActionBindingSocial; + private global::D3.Client.ActionBinding actionBindingSocial_; + public bool HasActionBindingSocial { + get { return hasActionBindingSocial; } + } + public global::D3.Client.ActionBinding ActionBindingSocial { + get { return actionBindingSocial_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingWorldmapFieldNumber = 10; + private bool hasActionBindingWorldmap; + private global::D3.Client.ActionBinding actionBindingWorldmap_; + public bool HasActionBindingWorldmap { + get { return hasActionBindingWorldmap; } + } + public global::D3.Client.ActionBinding ActionBindingWorldmap { + get { return actionBindingWorldmap_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingHelpFieldNumber = 11; + private bool hasActionBindingHelp; + private global::D3.Client.ActionBinding actionBindingHelp_; + public bool HasActionBindingHelp { + get { return hasActionBindingHelp; } + } + public global::D3.Client.ActionBinding ActionBindingHelp { + get { return actionBindingHelp_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingRecentplayersFieldNumber = 12; + private bool hasActionBindingRecentplayers; + private global::D3.Client.ActionBinding actionBindingRecentplayers_; + public bool HasActionBindingRecentplayers { + get { return hasActionBindingRecentplayers; } + } + public global::D3.Client.ActionBinding ActionBindingRecentplayers { + get { return actionBindingRecentplayers_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingChatlobbyFieldNumber = 13; + private bool hasActionBindingChatlobby; + private global::D3.Client.ActionBinding actionBindingChatlobby_; + public bool HasActionBindingChatlobby { + get { return hasActionBindingChatlobby; } + } + public global::D3.Client.ActionBinding ActionBindingChatlobby { + get { return actionBindingChatlobby_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingAchievementsFieldNumber = 14; + private bool hasActionBindingAchievements; + private global::D3.Client.ActionBinding actionBindingAchievements_; + public bool HasActionBindingAchievements { + get { return hasActionBindingAchievements; } + } + public global::D3.Client.ActionBinding ActionBindingAchievements { + get { return actionBindingAchievements_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingProfileFieldNumber = 15; + private bool hasActionBindingProfile; + private global::D3.Client.ActionBinding actionBindingProfile_; + public bool HasActionBindingProfile { + get { return hasActionBindingProfile; } + } + public global::D3.Client.ActionBinding ActionBindingProfile { + get { return actionBindingProfile_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingAuctionhouseFieldNumber = 16; + private bool hasActionBindingAuctionhouse; + private global::D3.Client.ActionBinding actionBindingAuctionhouse_; + public bool HasActionBindingAuctionhouse { + get { return hasActionBindingAuctionhouse; } + } + public global::D3.Client.ActionBinding ActionBindingAuctionhouse { + get { return actionBindingAuctionhouse_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingClearFieldNumber = 17; + private bool hasActionBindingClear; + private global::D3.Client.ActionBinding actionBindingClear_; + public bool HasActionBindingClear { + get { return hasActionBindingClear; } + } + public global::D3.Client.ActionBinding ActionBindingClear { + get { return actionBindingClear_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingConsoleFieldNumber = 18; + private bool hasActionBindingConsole; + private global::D3.Client.ActionBinding actionBindingConsole_; + public bool HasActionBindingConsole { + get { return hasActionBindingConsole; } + } + public global::D3.Client.ActionBinding ActionBindingConsole { + get { return actionBindingConsole_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingMapFieldNumber = 19; + private bool hasActionBindingMap; + private global::D3.Client.ActionBinding actionBindingMap_; + public bool HasActionBindingMap { + get { return hasActionBindingMap; } + } + public global::D3.Client.ActionBinding ActionBindingMap { + get { return actionBindingMap_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingSkillcycleFieldNumber = 20; + private bool hasActionBindingSkillcycle; + private global::D3.Client.ActionBinding actionBindingSkillcycle_; + public bool HasActionBindingSkillcycle { + get { return hasActionBindingSkillcycle; } + } + public global::D3.Client.ActionBinding ActionBindingSkillcycle { + get { return actionBindingSkillcycle_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingTogglemonsterhpbarsFieldNumber = 21; + private bool hasActionBindingTogglemonsterhpbars; + private global::D3.Client.ActionBinding actionBindingTogglemonsterhpbars_; + public bool HasActionBindingTogglemonsterhpbars { + get { return hasActionBindingTogglemonsterhpbars; } + } + public global::D3.Client.ActionBinding ActionBindingTogglemonsterhpbars { + get { return actionBindingTogglemonsterhpbars_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingToggleplayerhpbarsFieldNumber = 22; + private bool hasActionBindingToggleplayerhpbars; + private global::D3.Client.ActionBinding actionBindingToggleplayerhpbars_; + public bool HasActionBindingToggleplayerhpbars { + get { return hasActionBindingToggleplayerhpbars; } + } + public global::D3.Client.ActionBinding ActionBindingToggleplayerhpbars { + get { return actionBindingToggleplayerhpbars_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingToggledamagenumbersFieldNumber = 23; + private bool hasActionBindingToggledamagenumbers; + private global::D3.Client.ActionBinding actionBindingToggledamagenumbers_; + public bool HasActionBindingToggledamagenumbers { + get { return hasActionBindingToggledamagenumbers; } + } + public global::D3.Client.ActionBinding ActionBindingToggledamagenumbers { + get { return actionBindingToggledamagenumbers_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingToggleitemsongroundFieldNumber = 24; + private bool hasActionBindingToggleitemsonground; + private global::D3.Client.ActionBinding actionBindingToggleitemsonground_; + public bool HasActionBindingToggleitemsonground { + get { return hasActionBindingToggleitemsonground; } + } + public global::D3.Client.ActionBinding ActionBindingToggleitemsonground { + get { return actionBindingToggleitemsonground_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingRewhisperFieldNumber = 25; + private bool hasActionBindingRewhisper; + private global::D3.Client.ActionBinding actionBindingRewhisper_; + public bool HasActionBindingRewhisper { + get { return hasActionBindingRewhisper; } + } + public global::D3.Client.ActionBinding ActionBindingRewhisper { + get { return actionBindingRewhisper_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingWhisperreplyFieldNumber = 26; + private bool hasActionBindingWhisperreply; + private global::D3.Client.ActionBinding actionBindingWhisperreply_; + public bool HasActionBindingWhisperreply { + get { return hasActionBindingWhisperreply; } + } + public global::D3.Client.ActionBinding ActionBindingWhisperreply { + get { return actionBindingWhisperreply_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingVoicepttFieldNumber = 27; + private bool hasActionBindingVoiceptt; + private global::D3.Client.ActionBinding actionBindingVoiceptt_; + public bool HasActionBindingVoiceptt { + get { return hasActionBindingVoiceptt; } + } + public global::D3.Client.ActionBinding ActionBindingVoiceptt { + get { return actionBindingVoiceptt_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingSkill1FieldNumber = 28; + private bool hasActionBindingSkill1; + private global::D3.Client.ActionBinding actionBindingSkill1_; + public bool HasActionBindingSkill1 { + get { return hasActionBindingSkill1; } + } + public global::D3.Client.ActionBinding ActionBindingSkill1 { + get { return actionBindingSkill1_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingSkill2FieldNumber = 29; + private bool hasActionBindingSkill2; + private global::D3.Client.ActionBinding actionBindingSkill2_; + public bool HasActionBindingSkill2 { + get { return hasActionBindingSkill2; } + } + public global::D3.Client.ActionBinding ActionBindingSkill2 { + get { return actionBindingSkill2_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingSkill3FieldNumber = 30; + private bool hasActionBindingSkill3; + private global::D3.Client.ActionBinding actionBindingSkill3_; + public bool HasActionBindingSkill3 { + get { return hasActionBindingSkill3; } + } + public global::D3.Client.ActionBinding ActionBindingSkill3 { + get { return actionBindingSkill3_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingSkill4FieldNumber = 31; + private bool hasActionBindingSkill4; + private global::D3.Client.ActionBinding actionBindingSkill4_; + public bool HasActionBindingSkill4 { + get { return hasActionBindingSkill4; } + } + public global::D3.Client.ActionBinding ActionBindingSkill4 { + get { return actionBindingSkill4_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingPotionFieldNumber = 32; + private bool hasActionBindingPotion; + private global::D3.Client.ActionBinding actionBindingPotion_; + public bool HasActionBindingPotion { + get { return hasActionBindingPotion; } + } + public global::D3.Client.ActionBinding ActionBindingPotion { + get { return actionBindingPotion_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingBannerdropFieldNumber = 33; + private bool hasActionBindingBannerdrop; + private global::D3.Client.ActionBinding actionBindingBannerdrop_; + public bool HasActionBindingBannerdrop { + get { return hasActionBindingBannerdrop; } + } + public global::D3.Client.ActionBinding ActionBindingBannerdrop { + get { return actionBindingBannerdrop_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingZoomFieldNumber = 34; + private bool hasActionBindingZoom; + private global::D3.Client.ActionBinding actionBindingZoom_; + public bool HasActionBindingZoom { + get { return hasActionBindingZoom; } + } + public global::D3.Client.ActionBinding ActionBindingZoom { + get { return actionBindingZoom_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingEmotefollowFieldNumber = 35; + private bool hasActionBindingEmotefollow; + private global::D3.Client.ActionBinding actionBindingEmotefollow_; + public bool HasActionBindingEmotefollow { + get { return hasActionBindingEmotefollow; } + } + public global::D3.Client.ActionBinding ActionBindingEmotefollow { + get { return actionBindingEmotefollow_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingEmotegiveFieldNumber = 36; + private bool hasActionBindingEmotegive; + private global::D3.Client.ActionBinding actionBindingEmotegive_; + public bool HasActionBindingEmotegive { + get { return hasActionBindingEmotegive; } + } + public global::D3.Client.ActionBinding ActionBindingEmotegive { + get { return actionBindingEmotegive_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingEmotethanksFieldNumber = 37; + private bool hasActionBindingEmotethanks; + private global::D3.Client.ActionBinding actionBindingEmotethanks_; + public bool HasActionBindingEmotethanks { + get { return hasActionBindingEmotethanks; } + } + public global::D3.Client.ActionBinding ActionBindingEmotethanks { + get { return actionBindingEmotethanks_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingEmotesorryFieldNumber = 38; + private bool hasActionBindingEmotesorry; + private global::D3.Client.ActionBinding actionBindingEmotesorry_; + public bool HasActionBindingEmotesorry { + get { return hasActionBindingEmotesorry; } + } + public global::D3.Client.ActionBinding ActionBindingEmotesorry { + get { return actionBindingEmotesorry_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingEmotebyeFieldNumber = 39; + private bool hasActionBindingEmotebye; + private global::D3.Client.ActionBinding actionBindingEmotebye_; + public bool HasActionBindingEmotebye { + get { return hasActionBindingEmotebye; } + } + public global::D3.Client.ActionBinding ActionBindingEmotebye { + get { return actionBindingEmotebye_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingEmotedieFieldNumber = 40; + private bool hasActionBindingEmotedie; + private global::D3.Client.ActionBinding actionBindingEmotedie_; + public bool HasActionBindingEmotedie { + get { return hasActionBindingEmotedie; } + } + public global::D3.Client.ActionBinding ActionBindingEmotedie { + get { return actionBindingEmotedie_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingEmoterunFieldNumber = 41; + private bool hasActionBindingEmoterun; + private global::D3.Client.ActionBinding actionBindingEmoterun_; + public bool HasActionBindingEmoterun { + get { return hasActionBindingEmoterun; } + } + public global::D3.Client.ActionBinding ActionBindingEmoterun { + get { return actionBindingEmoterun_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingEmotewaitFieldNumber = 42; + private bool hasActionBindingEmotewait; + private global::D3.Client.ActionBinding actionBindingEmotewait_; + public bool HasActionBindingEmotewait { + get { return hasActionBindingEmotewait; } + } + public global::D3.Client.ActionBinding ActionBindingEmotewait { + get { return actionBindingEmotewait_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingEmotegoFieldNumber = 43; + private bool hasActionBindingEmotego; + private global::D3.Client.ActionBinding actionBindingEmotego_; + public bool HasActionBindingEmotego { + get { return hasActionBindingEmotego; } + } + public global::D3.Client.ActionBinding ActionBindingEmotego { + get { return actionBindingEmotego_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingEmotehelpFieldNumber = 44; + private bool hasActionBindingEmotehelp; + private global::D3.Client.ActionBinding actionBindingEmotehelp_; + public bool HasActionBindingEmotehelp { + get { return hasActionBindingEmotehelp; } + } + public global::D3.Client.ActionBinding ActionBindingEmotehelp { + get { return actionBindingEmotehelp_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingEmoteyesFieldNumber = 45; + private bool hasActionBindingEmoteyes; + private global::D3.Client.ActionBinding actionBindingEmoteyes_; + public bool HasActionBindingEmoteyes { + get { return hasActionBindingEmoteyes; } + } + public global::D3.Client.ActionBinding ActionBindingEmoteyes { + get { return actionBindingEmoteyes_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingEmotenoFieldNumber = 46; + private bool hasActionBindingEmoteno; + private global::D3.Client.ActionBinding actionBindingEmoteno_; + public bool HasActionBindingEmoteno { + get { return hasActionBindingEmoteno; } + } + public global::D3.Client.ActionBinding ActionBindingEmoteno { + get { return actionBindingEmoteno_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingEmotestayFieldNumber = 47; + private bool hasActionBindingEmotestay; + private global::D3.Client.ActionBinding actionBindingEmotestay_; + public bool HasActionBindingEmotestay { + get { return hasActionBindingEmotestay; } + } + public global::D3.Client.ActionBinding ActionBindingEmotestay { + get { return actionBindingEmotestay_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingEmoteattackFieldNumber = 48; + private bool hasActionBindingEmoteattack; + private global::D3.Client.ActionBinding actionBindingEmoteattack_; + public bool HasActionBindingEmoteattack { + get { return hasActionBindingEmoteattack; } + } + public global::D3.Client.ActionBinding ActionBindingEmoteattack { + get { return actionBindingEmoteattack_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingEmoteretreatFieldNumber = 49; + private bool hasActionBindingEmoteretreat; + private global::D3.Client.ActionBinding actionBindingEmoteretreat_; + public bool HasActionBindingEmoteretreat { + get { return hasActionBindingEmoteretreat; } + } + public global::D3.Client.ActionBinding ActionBindingEmoteretreat { + get { return actionBindingEmoteretreat_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingEmoteholdFieldNumber = 50; + private bool hasActionBindingEmotehold; + private global::D3.Client.ActionBinding actionBindingEmotehold_; + public bool HasActionBindingEmotehold { + get { return hasActionBindingEmotehold; } + } + public global::D3.Client.ActionBinding ActionBindingEmotehold { + get { return actionBindingEmotehold_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingEmotetakeobjectiveFieldNumber = 51; + private bool hasActionBindingEmotetakeobjective; + private global::D3.Client.ActionBinding actionBindingEmotetakeobjective_; + public bool HasActionBindingEmotetakeobjective { + get { return hasActionBindingEmotetakeobjective; } + } + public global::D3.Client.ActionBinding ActionBindingEmotetakeobjective { + get { return actionBindingEmotetakeobjective_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingEmotelaughFieldNumber = 52; + private bool hasActionBindingEmotelaugh; + private global::D3.Client.ActionBinding actionBindingEmotelaugh_; + public bool HasActionBindingEmotelaugh { + get { return hasActionBindingEmotelaugh; } + } + public global::D3.Client.ActionBinding ActionBindingEmotelaugh { + get { return actionBindingEmotelaugh_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingHoldpositionFieldNumber = 53; + private bool hasActionBindingHoldposition; + private global::D3.Client.ActionBinding actionBindingHoldposition_; + public bool HasActionBindingHoldposition { + get { return hasActionBindingHoldposition; } + } + public global::D3.Client.ActionBinding ActionBindingHoldposition { + get { return actionBindingHoldposition_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingSystemmastervolumeupFieldNumber = 54; + private bool hasActionBindingSystemmastervolumeup; + private global::D3.Client.ActionBinding actionBindingSystemmastervolumeup_; + public bool HasActionBindingSystemmastervolumeup { + get { return hasActionBindingSystemmastervolumeup; } + } + public global::D3.Client.ActionBinding ActionBindingSystemmastervolumeup { + get { return actionBindingSystemmastervolumeup_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingSystemmastervolumedownFieldNumber = 55; + private bool hasActionBindingSystemmastervolumedown; + private global::D3.Client.ActionBinding actionBindingSystemmastervolumedown_; + public bool HasActionBindingSystemmastervolumedown { + get { return hasActionBindingSystemmastervolumedown; } + } + public global::D3.Client.ActionBinding ActionBindingSystemmastervolumedown { + get { return actionBindingSystemmastervolumedown_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingSystemtogglemusicFieldNumber = 56; + private bool hasActionBindingSystemtogglemusic; + private global::D3.Client.ActionBinding actionBindingSystemtogglemusic_; + public bool HasActionBindingSystemtogglemusic { + get { return hasActionBindingSystemtogglemusic; } + } + public global::D3.Client.ActionBinding ActionBindingSystemtogglemusic { + get { return actionBindingSystemtogglemusic_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingSystemtogglesoundFieldNumber = 57; + private bool hasActionBindingSystemtogglesound; + private global::D3.Client.ActionBinding actionBindingSystemtogglesound_; + public bool HasActionBindingSystemtogglesound { + get { return hasActionBindingSystemtogglesound; } + } + public global::D3.Client.ActionBinding ActionBindingSystemtogglesound { + get { return actionBindingSystemtogglesound_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingSystemscreenshotFieldNumber = 58; + private bool hasActionBindingSystemscreenshot; + private global::D3.Client.ActionBinding actionBindingSystemscreenshot_; + public bool HasActionBindingSystemscreenshot { + get { return hasActionBindingSystemscreenshot; } + } + public global::D3.Client.ActionBinding ActionBindingSystemscreenshot { + get { return actionBindingSystemscreenshot_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingStoneofrecallFieldNumber = 59; + private bool hasActionBindingStoneofrecall; + private global::D3.Client.ActionBinding actionBindingStoneofrecall_; + public bool HasActionBindingStoneofrecall { + get { return hasActionBindingStoneofrecall; } + } + public global::D3.Client.ActionBinding ActionBindingStoneofrecall { + get { return actionBindingStoneofrecall_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingBannerscreenFieldNumber = 60; + private bool hasActionBindingBannerscreen; + private global::D3.Client.ActionBinding actionBindingBannerscreen_; + public bool HasActionBindingBannerscreen { + get { return hasActionBindingBannerscreen; } + } + public global::D3.Client.ActionBinding ActionBindingBannerscreen { + get { return actionBindingBannerscreen_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingLmbFieldNumber = 61; + private bool hasActionBindingLmb; + private global::D3.Client.ActionBinding actionBindingLmb_; + public bool HasActionBindingLmb { + get { return hasActionBindingLmb; } + } + public global::D3.Client.ActionBinding ActionBindingLmb { + get { return actionBindingLmb_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingRmbFieldNumber = 62; + private bool hasActionBindingRmb; + private global::D3.Client.ActionBinding actionBindingRmb_; + public bool HasActionBindingRmb { + get { return hasActionBindingRmb; } + } + public global::D3.Client.ActionBinding ActionBindingRmb { + get { return actionBindingRmb_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingWalkFieldNumber = 63; + private bool hasActionBindingWalk; + private global::D3.Client.ActionBinding actionBindingWalk_; + public bool HasActionBindingWalk { + get { return hasActionBindingWalk; } + } + public global::D3.Client.ActionBinding ActionBindingWalk { + get { return actionBindingWalk_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingSystemtogglefpsFieldNumber = 64; + private bool hasActionBindingSystemtogglefps; + private global::D3.Client.ActionBinding actionBindingSystemtogglefps_; + public bool HasActionBindingSystemtogglefps { + get { return hasActionBindingSystemtogglefps; } + } + public global::D3.Client.ActionBinding ActionBindingSystemtogglefps { + get { return actionBindingSystemtogglefps_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingChatpageupFieldNumber = 65; + private bool hasActionBindingChatpageup; + private global::D3.Client.ActionBinding actionBindingChatpageup_; + public bool HasActionBindingChatpageup { + get { return hasActionBindingChatpageup; } + } + public global::D3.Client.ActionBinding ActionBindingChatpageup { + get { return actionBindingChatpageup_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int ActionBindingChatpagedownFieldNumber = 66; + private bool hasActionBindingChatpagedown; + private global::D3.Client.ActionBinding actionBindingChatpagedown_; + public bool HasActionBindingChatpagedown { + get { return hasActionBindingChatpagedown; } + } + public global::D3.Client.ActionBinding ActionBindingChatpagedown { + get { return actionBindingChatpagedown_ ?? global::D3.Client.ActionBinding.DefaultInstance; } + } + + public const int NotifyDurationFieldNumber = 100; + private bool hasNotifyDuration; + private uint notifyDuration_; + public bool HasNotifyDuration { + get { return hasNotifyDuration; } + } + public uint NotifyDuration { + get { return notifyDuration_; } + } + + public const int Flags2FieldNumber = 200; + private bool hasFlags2; + private uint flags2_; + public bool HasFlags2 { + get { return hasFlags2; } + } + public uint Flags2 { + get { return flags2_; } + } + + public override bool IsInitialized { + get { + if (!hasVersion) return false; + if (HasActionBindingInventory) { + if (!ActionBindingInventory.IsInitialized) return false; + } + if (HasActionBindingHireling) { + if (!ActionBindingHireling.IsInitialized) return false; + } + if (HasActionBindingSkills) { + if (!ActionBindingSkills.IsInitialized) return false; + } + if (HasActionBindingQuests) { + if (!ActionBindingQuests.IsInitialized) return false; + } + if (HasActionBindingLore) { + if (!ActionBindingLore.IsInitialized) return false; + } + if (HasActionBindingSocial) { + if (!ActionBindingSocial.IsInitialized) return false; + } + if (HasActionBindingWorldmap) { + if (!ActionBindingWorldmap.IsInitialized) return false; + } + if (HasActionBindingHelp) { + if (!ActionBindingHelp.IsInitialized) return false; + } + if (HasActionBindingRecentplayers) { + if (!ActionBindingRecentplayers.IsInitialized) return false; + } + if (HasActionBindingChatlobby) { + if (!ActionBindingChatlobby.IsInitialized) return false; + } + if (HasActionBindingAchievements) { + if (!ActionBindingAchievements.IsInitialized) return false; + } + if (HasActionBindingProfile) { + if (!ActionBindingProfile.IsInitialized) return false; + } + if (HasActionBindingAuctionhouse) { + if (!ActionBindingAuctionhouse.IsInitialized) return false; + } + if (HasActionBindingClear) { + if (!ActionBindingClear.IsInitialized) return false; + } + if (HasActionBindingConsole) { + if (!ActionBindingConsole.IsInitialized) return false; + } + if (HasActionBindingMap) { + if (!ActionBindingMap.IsInitialized) return false; + } + if (HasActionBindingSkillcycle) { + if (!ActionBindingSkillcycle.IsInitialized) return false; + } + if (HasActionBindingTogglemonsterhpbars) { + if (!ActionBindingTogglemonsterhpbars.IsInitialized) return false; + } + if (HasActionBindingToggleplayerhpbars) { + if (!ActionBindingToggleplayerhpbars.IsInitialized) return false; + } + if (HasActionBindingToggledamagenumbers) { + if (!ActionBindingToggledamagenumbers.IsInitialized) return false; + } + if (HasActionBindingToggleitemsonground) { + if (!ActionBindingToggleitemsonground.IsInitialized) return false; + } + if (HasActionBindingRewhisper) { + if (!ActionBindingRewhisper.IsInitialized) return false; + } + if (HasActionBindingWhisperreply) { + if (!ActionBindingWhisperreply.IsInitialized) return false; + } + if (HasActionBindingVoiceptt) { + if (!ActionBindingVoiceptt.IsInitialized) return false; + } + if (HasActionBindingSkill1) { + if (!ActionBindingSkill1.IsInitialized) return false; + } + if (HasActionBindingSkill2) { + if (!ActionBindingSkill2.IsInitialized) return false; + } + if (HasActionBindingSkill3) { + if (!ActionBindingSkill3.IsInitialized) return false; + } + if (HasActionBindingSkill4) { + if (!ActionBindingSkill4.IsInitialized) return false; + } + if (HasActionBindingPotion) { + if (!ActionBindingPotion.IsInitialized) return false; + } + if (HasActionBindingBannerdrop) { + if (!ActionBindingBannerdrop.IsInitialized) return false; + } + if (HasActionBindingZoom) { + if (!ActionBindingZoom.IsInitialized) return false; + } + if (HasActionBindingEmotefollow) { + if (!ActionBindingEmotefollow.IsInitialized) return false; + } + if (HasActionBindingEmotegive) { + if (!ActionBindingEmotegive.IsInitialized) return false; + } + if (HasActionBindingEmotethanks) { + if (!ActionBindingEmotethanks.IsInitialized) return false; + } + if (HasActionBindingEmotesorry) { + if (!ActionBindingEmotesorry.IsInitialized) return false; + } + if (HasActionBindingEmotebye) { + if (!ActionBindingEmotebye.IsInitialized) return false; + } + if (HasActionBindingEmotedie) { + if (!ActionBindingEmotedie.IsInitialized) return false; + } + if (HasActionBindingEmoterun) { + if (!ActionBindingEmoterun.IsInitialized) return false; + } + if (HasActionBindingEmotewait) { + if (!ActionBindingEmotewait.IsInitialized) return false; + } + if (HasActionBindingEmotego) { + if (!ActionBindingEmotego.IsInitialized) return false; + } + if (HasActionBindingEmotehelp) { + if (!ActionBindingEmotehelp.IsInitialized) return false; + } + if (HasActionBindingEmoteyes) { + if (!ActionBindingEmoteyes.IsInitialized) return false; + } + if (HasActionBindingEmoteno) { + if (!ActionBindingEmoteno.IsInitialized) return false; + } + if (HasActionBindingEmotestay) { + if (!ActionBindingEmotestay.IsInitialized) return false; + } + if (HasActionBindingEmoteattack) { + if (!ActionBindingEmoteattack.IsInitialized) return false; + } + if (HasActionBindingEmoteretreat) { + if (!ActionBindingEmoteretreat.IsInitialized) return false; + } + if (HasActionBindingEmotehold) { + if (!ActionBindingEmotehold.IsInitialized) return false; + } + if (HasActionBindingEmotetakeobjective) { + if (!ActionBindingEmotetakeobjective.IsInitialized) return false; + } + if (HasActionBindingEmotelaugh) { + if (!ActionBindingEmotelaugh.IsInitialized) return false; + } + if (HasActionBindingHoldposition) { + if (!ActionBindingHoldposition.IsInitialized) return false; + } + if (HasActionBindingSystemmastervolumeup) { + if (!ActionBindingSystemmastervolumeup.IsInitialized) return false; + } + if (HasActionBindingSystemmastervolumedown) { + if (!ActionBindingSystemmastervolumedown.IsInitialized) return false; + } + if (HasActionBindingSystemtogglemusic) { + if (!ActionBindingSystemtogglemusic.IsInitialized) return false; + } + if (HasActionBindingSystemtogglesound) { + if (!ActionBindingSystemtogglesound.IsInitialized) return false; + } + if (HasActionBindingSystemscreenshot) { + if (!ActionBindingSystemscreenshot.IsInitialized) return false; + } + if (HasActionBindingStoneofrecall) { + if (!ActionBindingStoneofrecall.IsInitialized) return false; + } + if (HasActionBindingBannerscreen) { + if (!ActionBindingBannerscreen.IsInitialized) return false; + } + if (HasActionBindingLmb) { + if (!ActionBindingLmb.IsInitialized) return false; + } + if (HasActionBindingRmb) { + if (!ActionBindingRmb.IsInitialized) return false; + } + if (HasActionBindingWalk) { + if (!ActionBindingWalk.IsInitialized) return false; + } + if (HasActionBindingSystemtogglefps) { + if (!ActionBindingSystemtogglefps.IsInitialized) return false; + } + if (HasActionBindingChatpageup) { + if (!ActionBindingChatpageup.IsInitialized) return false; + } + if (HasActionBindingChatpagedown) { + if (!ActionBindingChatpagedown.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _preferencesFieldNames; + if (hasVersion) { + output.WriteInt32(1, field_names[67], Version); + } + if (hasFlags) { + output.WriteUInt32(2, field_names[63], Flags); + } + if (hasItemsOnGroundSetting) { + output.WriteUInt32(3, field_names[65], ItemsOnGroundSetting); + } + if (hasActionBindingInventory) { + output.WriteMessage(4, field_names[30], ActionBindingInventory); + } + if (hasActionBindingHireling) { + output.WriteMessage(5, field_names[28], ActionBindingHireling); + } + if (hasActionBindingSkills) { + output.WriteMessage(6, field_names[45], ActionBindingSkills); + } + if (hasActionBindingLore) { + output.WriteMessage(8, field_names[32], ActionBindingLore); + } + if (hasActionBindingSocial) { + output.WriteMessage(9, field_names[46], ActionBindingSocial); + } + if (hasActionBindingWorldmap) { + output.WriteMessage(10, field_names[61], ActionBindingWorldmap); + } + if (hasActionBindingHelp) { + output.WriteMessage(11, field_names[27], ActionBindingHelp); + } + if (hasActionBindingRecentplayers) { + output.WriteMessage(12, field_names[37], ActionBindingRecentplayers); + } + if (hasActionBindingChatlobby) { + output.WriteMessage(13, field_names[4], ActionBindingChatlobby); + } + if (hasActionBindingAchievements) { + output.WriteMessage(14, field_names[0], ActionBindingAchievements); + } + if (hasActionBindingProfile) { + output.WriteMessage(15, field_names[35], ActionBindingProfile); + } + if (hasActionBindingAuctionhouse) { + output.WriteMessage(16, field_names[1], ActionBindingAuctionhouse); + } + if (hasActionBindingClear) { + output.WriteMessage(17, field_names[7], ActionBindingClear); + } + if (hasActionBindingConsole) { + output.WriteMessage(18, field_names[8], ActionBindingConsole); + } + if (hasActionBindingMap) { + output.WriteMessage(19, field_names[33], ActionBindingMap); + } + if (hasActionBindingSkillcycle) { + output.WriteMessage(20, field_names[44], ActionBindingSkillcycle); + } + if (hasActionBindingTogglemonsterhpbars) { + output.WriteMessage(21, field_names[56], ActionBindingTogglemonsterhpbars); + } + if (hasActionBindingToggleplayerhpbars) { + output.WriteMessage(22, field_names[57], ActionBindingToggleplayerhpbars); + } + if (hasActionBindingToggledamagenumbers) { + output.WriteMessage(23, field_names[54], ActionBindingToggledamagenumbers); + } + if (hasActionBindingToggleitemsonground) { + output.WriteMessage(24, field_names[55], ActionBindingToggleitemsonground); + } + if (hasActionBindingRewhisper) { + output.WriteMessage(25, field_names[38], ActionBindingRewhisper); + } + if (hasActionBindingWhisperreply) { + output.WriteMessage(26, field_names[60], ActionBindingWhisperreply); + } + if (hasActionBindingVoiceptt) { + output.WriteMessage(27, field_names[58], ActionBindingVoiceptt); + } + if (hasActionBindingSkill1) { + output.WriteMessage(28, field_names[40], ActionBindingSkill1); + } + if (hasActionBindingSkill2) { + output.WriteMessage(29, field_names[41], ActionBindingSkill2); + } + if (hasActionBindingSkill3) { + output.WriteMessage(30, field_names[42], ActionBindingSkill3); + } + if (hasActionBindingSkill4) { + output.WriteMessage(31, field_names[43], ActionBindingSkill4); + } + if (hasActionBindingPotion) { + output.WriteMessage(32, field_names[34], ActionBindingPotion); + } + if (hasActionBindingBannerdrop) { + output.WriteMessage(33, field_names[2], ActionBindingBannerdrop); + } + if (hasActionBindingZoom) { + output.WriteMessage(34, field_names[62], ActionBindingZoom); + } + if (hasActionBindingEmotefollow) { + output.WriteMessage(35, field_names[12], ActionBindingEmotefollow); + } + if (hasActionBindingEmotegive) { + output.WriteMessage(36, field_names[13], ActionBindingEmotegive); + } + if (hasActionBindingEmotethanks) { + output.WriteMessage(37, field_names[24], ActionBindingEmotethanks); + } + if (hasActionBindingEmotesorry) { + output.WriteMessage(38, field_names[21], ActionBindingEmotesorry); + } + if (hasActionBindingEmotebye) { + output.WriteMessage(39, field_names[10], ActionBindingEmotebye); + } + if (hasActionBindingEmotedie) { + output.WriteMessage(40, field_names[11], ActionBindingEmotedie); + } + if (hasActionBindingEmoterun) { + output.WriteMessage(41, field_names[20], ActionBindingEmoterun); + } + if (hasActionBindingEmotewait) { + output.WriteMessage(42, field_names[25], ActionBindingEmotewait); + } + if (hasActionBindingEmotego) { + output.WriteMessage(43, field_names[14], ActionBindingEmotego); + } + if (hasActionBindingEmotehelp) { + output.WriteMessage(44, field_names[15], ActionBindingEmotehelp); + } + if (hasActionBindingEmoteyes) { + output.WriteMessage(45, field_names[26], ActionBindingEmoteyes); + } + if (hasActionBindingEmoteno) { + output.WriteMessage(46, field_names[18], ActionBindingEmoteno); + } + if (hasActionBindingEmotestay) { + output.WriteMessage(47, field_names[22], ActionBindingEmotestay); + } + if (hasActionBindingEmoteattack) { + output.WriteMessage(48, field_names[9], ActionBindingEmoteattack); + } + if (hasActionBindingEmoteretreat) { + output.WriteMessage(49, field_names[19], ActionBindingEmoteretreat); + } + if (hasActionBindingEmotehold) { + output.WriteMessage(50, field_names[16], ActionBindingEmotehold); + } + if (hasActionBindingEmotetakeobjective) { + output.WriteMessage(51, field_names[23], ActionBindingEmotetakeobjective); + } + if (hasActionBindingEmotelaugh) { + output.WriteMessage(52, field_names[17], ActionBindingEmotelaugh); + } + if (hasActionBindingHoldposition) { + output.WriteMessage(53, field_names[29], ActionBindingHoldposition); + } + if (hasActionBindingSystemmastervolumeup) { + output.WriteMessage(54, field_names[49], ActionBindingSystemmastervolumeup); + } + if (hasActionBindingSystemmastervolumedown) { + output.WriteMessage(55, field_names[48], ActionBindingSystemmastervolumedown); + } + if (hasActionBindingSystemtogglemusic) { + output.WriteMessage(56, field_names[52], ActionBindingSystemtogglemusic); + } + if (hasActionBindingSystemtogglesound) { + output.WriteMessage(57, field_names[53], ActionBindingSystemtogglesound); + } + if (hasActionBindingSystemscreenshot) { + output.WriteMessage(58, field_names[50], ActionBindingSystemscreenshot); + } + if (hasActionBindingStoneofrecall) { + output.WriteMessage(59, field_names[47], ActionBindingStoneofrecall); + } + if (hasActionBindingBannerscreen) { + output.WriteMessage(60, field_names[3], ActionBindingBannerscreen); + } + if (hasActionBindingLmb) { + output.WriteMessage(61, field_names[31], ActionBindingLmb); + } + if (hasActionBindingRmb) { + output.WriteMessage(62, field_names[39], ActionBindingRmb); + } + if (hasActionBindingWalk) { + output.WriteMessage(63, field_names[59], ActionBindingWalk); + } + if (hasActionBindingSystemtogglefps) { + output.WriteMessage(64, field_names[51], ActionBindingSystemtogglefps); + } + if (hasActionBindingChatpageup) { + output.WriteMessage(65, field_names[6], ActionBindingChatpageup); + } + if (hasActionBindingChatpagedown) { + output.WriteMessage(66, field_names[5], ActionBindingChatpagedown); + } + if (hasActionBindingQuests) { + output.WriteMessage(74, field_names[36], ActionBindingQuests); + } + if (hasNotifyDuration) { + output.WriteUInt32(100, field_names[66], NotifyDuration); + } + if (hasFlags2) { + output.WriteUInt32(200, field_names[64], Flags2); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasVersion) { + size += pb::CodedOutputStream.ComputeInt32Size(1, Version); + } + if (hasFlags) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, Flags); + } + if (hasItemsOnGroundSetting) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, ItemsOnGroundSetting); + } + if (hasActionBindingInventory) { + size += pb::CodedOutputStream.ComputeMessageSize(4, ActionBindingInventory); + } + if (hasActionBindingHireling) { + size += pb::CodedOutputStream.ComputeMessageSize(5, ActionBindingHireling); + } + if (hasActionBindingSkills) { + size += pb::CodedOutputStream.ComputeMessageSize(6, ActionBindingSkills); + } + if (hasActionBindingQuests) { + size += pb::CodedOutputStream.ComputeMessageSize(74, ActionBindingQuests); + } + if (hasActionBindingLore) { + size += pb::CodedOutputStream.ComputeMessageSize(8, ActionBindingLore); + } + if (hasActionBindingSocial) { + size += pb::CodedOutputStream.ComputeMessageSize(9, ActionBindingSocial); + } + if (hasActionBindingWorldmap) { + size += pb::CodedOutputStream.ComputeMessageSize(10, ActionBindingWorldmap); + } + if (hasActionBindingHelp) { + size += pb::CodedOutputStream.ComputeMessageSize(11, ActionBindingHelp); + } + if (hasActionBindingRecentplayers) { + size += pb::CodedOutputStream.ComputeMessageSize(12, ActionBindingRecentplayers); + } + if (hasActionBindingChatlobby) { + size += pb::CodedOutputStream.ComputeMessageSize(13, ActionBindingChatlobby); + } + if (hasActionBindingAchievements) { + size += pb::CodedOutputStream.ComputeMessageSize(14, ActionBindingAchievements); + } + if (hasActionBindingProfile) { + size += pb::CodedOutputStream.ComputeMessageSize(15, ActionBindingProfile); + } + if (hasActionBindingAuctionhouse) { + size += pb::CodedOutputStream.ComputeMessageSize(16, ActionBindingAuctionhouse); + } + if (hasActionBindingClear) { + size += pb::CodedOutputStream.ComputeMessageSize(17, ActionBindingClear); + } + if (hasActionBindingConsole) { + size += pb::CodedOutputStream.ComputeMessageSize(18, ActionBindingConsole); + } + if (hasActionBindingMap) { + size += pb::CodedOutputStream.ComputeMessageSize(19, ActionBindingMap); + } + if (hasActionBindingSkillcycle) { + size += pb::CodedOutputStream.ComputeMessageSize(20, ActionBindingSkillcycle); + } + if (hasActionBindingTogglemonsterhpbars) { + size += pb::CodedOutputStream.ComputeMessageSize(21, ActionBindingTogglemonsterhpbars); + } + if (hasActionBindingToggleplayerhpbars) { + size += pb::CodedOutputStream.ComputeMessageSize(22, ActionBindingToggleplayerhpbars); + } + if (hasActionBindingToggledamagenumbers) { + size += pb::CodedOutputStream.ComputeMessageSize(23, ActionBindingToggledamagenumbers); + } + if (hasActionBindingToggleitemsonground) { + size += pb::CodedOutputStream.ComputeMessageSize(24, ActionBindingToggleitemsonground); + } + if (hasActionBindingRewhisper) { + size += pb::CodedOutputStream.ComputeMessageSize(25, ActionBindingRewhisper); + } + if (hasActionBindingWhisperreply) { + size += pb::CodedOutputStream.ComputeMessageSize(26, ActionBindingWhisperreply); + } + if (hasActionBindingVoiceptt) { + size += pb::CodedOutputStream.ComputeMessageSize(27, ActionBindingVoiceptt); + } + if (hasActionBindingSkill1) { + size += pb::CodedOutputStream.ComputeMessageSize(28, ActionBindingSkill1); + } + if (hasActionBindingSkill2) { + size += pb::CodedOutputStream.ComputeMessageSize(29, ActionBindingSkill2); + } + if (hasActionBindingSkill3) { + size += pb::CodedOutputStream.ComputeMessageSize(30, ActionBindingSkill3); + } + if (hasActionBindingSkill4) { + size += pb::CodedOutputStream.ComputeMessageSize(31, ActionBindingSkill4); + } + if (hasActionBindingPotion) { + size += pb::CodedOutputStream.ComputeMessageSize(32, ActionBindingPotion); + } + if (hasActionBindingBannerdrop) { + size += pb::CodedOutputStream.ComputeMessageSize(33, ActionBindingBannerdrop); + } + if (hasActionBindingZoom) { + size += pb::CodedOutputStream.ComputeMessageSize(34, ActionBindingZoom); + } + if (hasActionBindingEmotefollow) { + size += pb::CodedOutputStream.ComputeMessageSize(35, ActionBindingEmotefollow); + } + if (hasActionBindingEmotegive) { + size += pb::CodedOutputStream.ComputeMessageSize(36, ActionBindingEmotegive); + } + if (hasActionBindingEmotethanks) { + size += pb::CodedOutputStream.ComputeMessageSize(37, ActionBindingEmotethanks); + } + if (hasActionBindingEmotesorry) { + size += pb::CodedOutputStream.ComputeMessageSize(38, ActionBindingEmotesorry); + } + if (hasActionBindingEmotebye) { + size += pb::CodedOutputStream.ComputeMessageSize(39, ActionBindingEmotebye); + } + if (hasActionBindingEmotedie) { + size += pb::CodedOutputStream.ComputeMessageSize(40, ActionBindingEmotedie); + } + if (hasActionBindingEmoterun) { + size += pb::CodedOutputStream.ComputeMessageSize(41, ActionBindingEmoterun); + } + if (hasActionBindingEmotewait) { + size += pb::CodedOutputStream.ComputeMessageSize(42, ActionBindingEmotewait); + } + if (hasActionBindingEmotego) { + size += pb::CodedOutputStream.ComputeMessageSize(43, ActionBindingEmotego); + } + if (hasActionBindingEmotehelp) { + size += pb::CodedOutputStream.ComputeMessageSize(44, ActionBindingEmotehelp); + } + if (hasActionBindingEmoteyes) { + size += pb::CodedOutputStream.ComputeMessageSize(45, ActionBindingEmoteyes); + } + if (hasActionBindingEmoteno) { + size += pb::CodedOutputStream.ComputeMessageSize(46, ActionBindingEmoteno); + } + if (hasActionBindingEmotestay) { + size += pb::CodedOutputStream.ComputeMessageSize(47, ActionBindingEmotestay); + } + if (hasActionBindingEmoteattack) { + size += pb::CodedOutputStream.ComputeMessageSize(48, ActionBindingEmoteattack); + } + if (hasActionBindingEmoteretreat) { + size += pb::CodedOutputStream.ComputeMessageSize(49, ActionBindingEmoteretreat); + } + if (hasActionBindingEmotehold) { + size += pb::CodedOutputStream.ComputeMessageSize(50, ActionBindingEmotehold); + } + if (hasActionBindingEmotetakeobjective) { + size += pb::CodedOutputStream.ComputeMessageSize(51, ActionBindingEmotetakeobjective); + } + if (hasActionBindingEmotelaugh) { + size += pb::CodedOutputStream.ComputeMessageSize(52, ActionBindingEmotelaugh); + } + if (hasActionBindingHoldposition) { + size += pb::CodedOutputStream.ComputeMessageSize(53, ActionBindingHoldposition); + } + if (hasActionBindingSystemmastervolumeup) { + size += pb::CodedOutputStream.ComputeMessageSize(54, ActionBindingSystemmastervolumeup); + } + if (hasActionBindingSystemmastervolumedown) { + size += pb::CodedOutputStream.ComputeMessageSize(55, ActionBindingSystemmastervolumedown); + } + if (hasActionBindingSystemtogglemusic) { + size += pb::CodedOutputStream.ComputeMessageSize(56, ActionBindingSystemtogglemusic); + } + if (hasActionBindingSystemtogglesound) { + size += pb::CodedOutputStream.ComputeMessageSize(57, ActionBindingSystemtogglesound); + } + if (hasActionBindingSystemscreenshot) { + size += pb::CodedOutputStream.ComputeMessageSize(58, ActionBindingSystemscreenshot); + } + if (hasActionBindingStoneofrecall) { + size += pb::CodedOutputStream.ComputeMessageSize(59, ActionBindingStoneofrecall); + } + if (hasActionBindingBannerscreen) { + size += pb::CodedOutputStream.ComputeMessageSize(60, ActionBindingBannerscreen); + } + if (hasActionBindingLmb) { + size += pb::CodedOutputStream.ComputeMessageSize(61, ActionBindingLmb); + } + if (hasActionBindingRmb) { + size += pb::CodedOutputStream.ComputeMessageSize(62, ActionBindingRmb); + } + if (hasActionBindingWalk) { + size += pb::CodedOutputStream.ComputeMessageSize(63, ActionBindingWalk); + } + if (hasActionBindingSystemtogglefps) { + size += pb::CodedOutputStream.ComputeMessageSize(64, ActionBindingSystemtogglefps); + } + if (hasActionBindingChatpageup) { + size += pb::CodedOutputStream.ComputeMessageSize(65, ActionBindingChatpageup); + } + if (hasActionBindingChatpagedown) { + size += pb::CodedOutputStream.ComputeMessageSize(66, ActionBindingChatpagedown); + } + if (hasNotifyDuration) { + size += pb::CodedOutputStream.ComputeUInt32Size(100, NotifyDuration); + } + if (hasFlags2) { + size += pb::CodedOutputStream.ComputeUInt32Size(200, Flags2); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static Preferences ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Preferences ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Preferences ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Preferences ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Preferences ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Preferences ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Preferences ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Preferences ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Preferences ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Preferences ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Preferences MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Preferences prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Preferences cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Preferences result; + + private Preferences PrepareBuilder() { + if (resultIsReadOnly) { + Preferences original = result; + result = new Preferences(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Preferences MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.Client.Preferences.Descriptor; } + } + + public override Preferences DefaultInstanceForType { + get { return global::D3.Client.Preferences.DefaultInstance; } + } + + public override Preferences BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Preferences) { + return MergeFrom((Preferences) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Preferences other) { + if (other == global::D3.Client.Preferences.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasVersion) { + Version = other.Version; + } + if (other.HasFlags) { + Flags = other.Flags; + } + if (other.HasItemsOnGroundSetting) { + ItemsOnGroundSetting = other.ItemsOnGroundSetting; + } + if (other.HasActionBindingInventory) { + MergeActionBindingInventory(other.ActionBindingInventory); + } + if (other.HasActionBindingHireling) { + MergeActionBindingHireling(other.ActionBindingHireling); + } + if (other.HasActionBindingSkills) { + MergeActionBindingSkills(other.ActionBindingSkills); + } + if (other.HasActionBindingQuests) { + MergeActionBindingQuests(other.ActionBindingQuests); + } + if (other.HasActionBindingLore) { + MergeActionBindingLore(other.ActionBindingLore); + } + if (other.HasActionBindingSocial) { + MergeActionBindingSocial(other.ActionBindingSocial); + } + if (other.HasActionBindingWorldmap) { + MergeActionBindingWorldmap(other.ActionBindingWorldmap); + } + if (other.HasActionBindingHelp) { + MergeActionBindingHelp(other.ActionBindingHelp); + } + if (other.HasActionBindingRecentplayers) { + MergeActionBindingRecentplayers(other.ActionBindingRecentplayers); + } + if (other.HasActionBindingChatlobby) { + MergeActionBindingChatlobby(other.ActionBindingChatlobby); + } + if (other.HasActionBindingAchievements) { + MergeActionBindingAchievements(other.ActionBindingAchievements); + } + if (other.HasActionBindingProfile) { + MergeActionBindingProfile(other.ActionBindingProfile); + } + if (other.HasActionBindingAuctionhouse) { + MergeActionBindingAuctionhouse(other.ActionBindingAuctionhouse); + } + if (other.HasActionBindingClear) { + MergeActionBindingClear(other.ActionBindingClear); + } + if (other.HasActionBindingConsole) { + MergeActionBindingConsole(other.ActionBindingConsole); + } + if (other.HasActionBindingMap) { + MergeActionBindingMap(other.ActionBindingMap); + } + if (other.HasActionBindingSkillcycle) { + MergeActionBindingSkillcycle(other.ActionBindingSkillcycle); + } + if (other.HasActionBindingTogglemonsterhpbars) { + MergeActionBindingTogglemonsterhpbars(other.ActionBindingTogglemonsterhpbars); + } + if (other.HasActionBindingToggleplayerhpbars) { + MergeActionBindingToggleplayerhpbars(other.ActionBindingToggleplayerhpbars); + } + if (other.HasActionBindingToggledamagenumbers) { + MergeActionBindingToggledamagenumbers(other.ActionBindingToggledamagenumbers); + } + if (other.HasActionBindingToggleitemsonground) { + MergeActionBindingToggleitemsonground(other.ActionBindingToggleitemsonground); + } + if (other.HasActionBindingRewhisper) { + MergeActionBindingRewhisper(other.ActionBindingRewhisper); + } + if (other.HasActionBindingWhisperreply) { + MergeActionBindingWhisperreply(other.ActionBindingWhisperreply); + } + if (other.HasActionBindingVoiceptt) { + MergeActionBindingVoiceptt(other.ActionBindingVoiceptt); + } + if (other.HasActionBindingSkill1) { + MergeActionBindingSkill1(other.ActionBindingSkill1); + } + if (other.HasActionBindingSkill2) { + MergeActionBindingSkill2(other.ActionBindingSkill2); + } + if (other.HasActionBindingSkill3) { + MergeActionBindingSkill3(other.ActionBindingSkill3); + } + if (other.HasActionBindingSkill4) { + MergeActionBindingSkill4(other.ActionBindingSkill4); + } + if (other.HasActionBindingPotion) { + MergeActionBindingPotion(other.ActionBindingPotion); + } + if (other.HasActionBindingBannerdrop) { + MergeActionBindingBannerdrop(other.ActionBindingBannerdrop); + } + if (other.HasActionBindingZoom) { + MergeActionBindingZoom(other.ActionBindingZoom); + } + if (other.HasActionBindingEmotefollow) { + MergeActionBindingEmotefollow(other.ActionBindingEmotefollow); + } + if (other.HasActionBindingEmotegive) { + MergeActionBindingEmotegive(other.ActionBindingEmotegive); + } + if (other.HasActionBindingEmotethanks) { + MergeActionBindingEmotethanks(other.ActionBindingEmotethanks); + } + if (other.HasActionBindingEmotesorry) { + MergeActionBindingEmotesorry(other.ActionBindingEmotesorry); + } + if (other.HasActionBindingEmotebye) { + MergeActionBindingEmotebye(other.ActionBindingEmotebye); + } + if (other.HasActionBindingEmotedie) { + MergeActionBindingEmotedie(other.ActionBindingEmotedie); + } + if (other.HasActionBindingEmoterun) { + MergeActionBindingEmoterun(other.ActionBindingEmoterun); + } + if (other.HasActionBindingEmotewait) { + MergeActionBindingEmotewait(other.ActionBindingEmotewait); + } + if (other.HasActionBindingEmotego) { + MergeActionBindingEmotego(other.ActionBindingEmotego); + } + if (other.HasActionBindingEmotehelp) { + MergeActionBindingEmotehelp(other.ActionBindingEmotehelp); + } + if (other.HasActionBindingEmoteyes) { + MergeActionBindingEmoteyes(other.ActionBindingEmoteyes); + } + if (other.HasActionBindingEmoteno) { + MergeActionBindingEmoteno(other.ActionBindingEmoteno); + } + if (other.HasActionBindingEmotestay) { + MergeActionBindingEmotestay(other.ActionBindingEmotestay); + } + if (other.HasActionBindingEmoteattack) { + MergeActionBindingEmoteattack(other.ActionBindingEmoteattack); + } + if (other.HasActionBindingEmoteretreat) { + MergeActionBindingEmoteretreat(other.ActionBindingEmoteretreat); + } + if (other.HasActionBindingEmotehold) { + MergeActionBindingEmotehold(other.ActionBindingEmotehold); + } + if (other.HasActionBindingEmotetakeobjective) { + MergeActionBindingEmotetakeobjective(other.ActionBindingEmotetakeobjective); + } + if (other.HasActionBindingEmotelaugh) { + MergeActionBindingEmotelaugh(other.ActionBindingEmotelaugh); + } + if (other.HasActionBindingHoldposition) { + MergeActionBindingHoldposition(other.ActionBindingHoldposition); + } + if (other.HasActionBindingSystemmastervolumeup) { + MergeActionBindingSystemmastervolumeup(other.ActionBindingSystemmastervolumeup); + } + if (other.HasActionBindingSystemmastervolumedown) { + MergeActionBindingSystemmastervolumedown(other.ActionBindingSystemmastervolumedown); + } + if (other.HasActionBindingSystemtogglemusic) { + MergeActionBindingSystemtogglemusic(other.ActionBindingSystemtogglemusic); + } + if (other.HasActionBindingSystemtogglesound) { + MergeActionBindingSystemtogglesound(other.ActionBindingSystemtogglesound); + } + if (other.HasActionBindingSystemscreenshot) { + MergeActionBindingSystemscreenshot(other.ActionBindingSystemscreenshot); + } + if (other.HasActionBindingStoneofrecall) { + MergeActionBindingStoneofrecall(other.ActionBindingStoneofrecall); + } + if (other.HasActionBindingBannerscreen) { + MergeActionBindingBannerscreen(other.ActionBindingBannerscreen); + } + if (other.HasActionBindingLmb) { + MergeActionBindingLmb(other.ActionBindingLmb); + } + if (other.HasActionBindingRmb) { + MergeActionBindingRmb(other.ActionBindingRmb); + } + if (other.HasActionBindingWalk) { + MergeActionBindingWalk(other.ActionBindingWalk); + } + if (other.HasActionBindingSystemtogglefps) { + MergeActionBindingSystemtogglefps(other.ActionBindingSystemtogglefps); + } + if (other.HasActionBindingChatpageup) { + MergeActionBindingChatpageup(other.ActionBindingChatpageup); + } + if (other.HasActionBindingChatpagedown) { + MergeActionBindingChatpagedown(other.ActionBindingChatpagedown); + } + if (other.HasNotifyDuration) { + NotifyDuration = other.NotifyDuration; + } + if (other.HasFlags2) { + Flags2 = other.Flags2; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_preferencesFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _preferencesFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasVersion = input.ReadInt32(ref result.version_); + break; + } + case 16: { + result.hasFlags = input.ReadUInt32(ref result.flags_); + break; + } + case 24: { + result.hasItemsOnGroundSetting = input.ReadUInt32(ref result.itemsOnGroundSetting_); + break; + } + case 34: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingInventory) { + subBuilder.MergeFrom(ActionBindingInventory); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingInventory = subBuilder.BuildPartial(); + break; + } + case 42: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingHireling) { + subBuilder.MergeFrom(ActionBindingHireling); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingHireling = subBuilder.BuildPartial(); + break; + } + case 50: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingSkills) { + subBuilder.MergeFrom(ActionBindingSkills); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingSkills = subBuilder.BuildPartial(); + break; + } + case 66: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingLore) { + subBuilder.MergeFrom(ActionBindingLore); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingLore = subBuilder.BuildPartial(); + break; + } + case 74: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingSocial) { + subBuilder.MergeFrom(ActionBindingSocial); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingSocial = subBuilder.BuildPartial(); + break; + } + case 82: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingWorldmap) { + subBuilder.MergeFrom(ActionBindingWorldmap); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingWorldmap = subBuilder.BuildPartial(); + break; + } + case 90: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingHelp) { + subBuilder.MergeFrom(ActionBindingHelp); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingHelp = subBuilder.BuildPartial(); + break; + } + case 98: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingRecentplayers) { + subBuilder.MergeFrom(ActionBindingRecentplayers); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingRecentplayers = subBuilder.BuildPartial(); + break; + } + case 106: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingChatlobby) { + subBuilder.MergeFrom(ActionBindingChatlobby); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingChatlobby = subBuilder.BuildPartial(); + break; + } + case 114: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingAchievements) { + subBuilder.MergeFrom(ActionBindingAchievements); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingAchievements = subBuilder.BuildPartial(); + break; + } + case 122: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingProfile) { + subBuilder.MergeFrom(ActionBindingProfile); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingProfile = subBuilder.BuildPartial(); + break; + } + case 130: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingAuctionhouse) { + subBuilder.MergeFrom(ActionBindingAuctionhouse); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingAuctionhouse = subBuilder.BuildPartial(); + break; + } + case 138: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingClear) { + subBuilder.MergeFrom(ActionBindingClear); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingClear = subBuilder.BuildPartial(); + break; + } + case 146: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingConsole) { + subBuilder.MergeFrom(ActionBindingConsole); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingConsole = subBuilder.BuildPartial(); + break; + } + case 154: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingMap) { + subBuilder.MergeFrom(ActionBindingMap); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingMap = subBuilder.BuildPartial(); + break; + } + case 162: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingSkillcycle) { + subBuilder.MergeFrom(ActionBindingSkillcycle); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingSkillcycle = subBuilder.BuildPartial(); + break; + } + case 170: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingTogglemonsterhpbars) { + subBuilder.MergeFrom(ActionBindingTogglemonsterhpbars); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingTogglemonsterhpbars = subBuilder.BuildPartial(); + break; + } + case 178: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingToggleplayerhpbars) { + subBuilder.MergeFrom(ActionBindingToggleplayerhpbars); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingToggleplayerhpbars = subBuilder.BuildPartial(); + break; + } + case 186: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingToggledamagenumbers) { + subBuilder.MergeFrom(ActionBindingToggledamagenumbers); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingToggledamagenumbers = subBuilder.BuildPartial(); + break; + } + case 194: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingToggleitemsonground) { + subBuilder.MergeFrom(ActionBindingToggleitemsonground); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingToggleitemsonground = subBuilder.BuildPartial(); + break; + } + case 202: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingRewhisper) { + subBuilder.MergeFrom(ActionBindingRewhisper); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingRewhisper = subBuilder.BuildPartial(); + break; + } + case 210: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingWhisperreply) { + subBuilder.MergeFrom(ActionBindingWhisperreply); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingWhisperreply = subBuilder.BuildPartial(); + break; + } + case 218: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingVoiceptt) { + subBuilder.MergeFrom(ActionBindingVoiceptt); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingVoiceptt = subBuilder.BuildPartial(); + break; + } + case 226: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingSkill1) { + subBuilder.MergeFrom(ActionBindingSkill1); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingSkill1 = subBuilder.BuildPartial(); + break; + } + case 234: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingSkill2) { + subBuilder.MergeFrom(ActionBindingSkill2); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingSkill2 = subBuilder.BuildPartial(); + break; + } + case 242: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingSkill3) { + subBuilder.MergeFrom(ActionBindingSkill3); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingSkill3 = subBuilder.BuildPartial(); + break; + } + case 250: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingSkill4) { + subBuilder.MergeFrom(ActionBindingSkill4); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingSkill4 = subBuilder.BuildPartial(); + break; + } + case 258: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingPotion) { + subBuilder.MergeFrom(ActionBindingPotion); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingPotion = subBuilder.BuildPartial(); + break; + } + case 266: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingBannerdrop) { + subBuilder.MergeFrom(ActionBindingBannerdrop); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingBannerdrop = subBuilder.BuildPartial(); + break; + } + case 274: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingZoom) { + subBuilder.MergeFrom(ActionBindingZoom); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingZoom = subBuilder.BuildPartial(); + break; + } + case 282: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingEmotefollow) { + subBuilder.MergeFrom(ActionBindingEmotefollow); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingEmotefollow = subBuilder.BuildPartial(); + break; + } + case 290: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingEmotegive) { + subBuilder.MergeFrom(ActionBindingEmotegive); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingEmotegive = subBuilder.BuildPartial(); + break; + } + case 298: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingEmotethanks) { + subBuilder.MergeFrom(ActionBindingEmotethanks); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingEmotethanks = subBuilder.BuildPartial(); + break; + } + case 306: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingEmotesorry) { + subBuilder.MergeFrom(ActionBindingEmotesorry); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingEmotesorry = subBuilder.BuildPartial(); + break; + } + case 314: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingEmotebye) { + subBuilder.MergeFrom(ActionBindingEmotebye); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingEmotebye = subBuilder.BuildPartial(); + break; + } + case 322: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingEmotedie) { + subBuilder.MergeFrom(ActionBindingEmotedie); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingEmotedie = subBuilder.BuildPartial(); + break; + } + case 330: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingEmoterun) { + subBuilder.MergeFrom(ActionBindingEmoterun); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingEmoterun = subBuilder.BuildPartial(); + break; + } + case 338: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingEmotewait) { + subBuilder.MergeFrom(ActionBindingEmotewait); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingEmotewait = subBuilder.BuildPartial(); + break; + } + case 346: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingEmotego) { + subBuilder.MergeFrom(ActionBindingEmotego); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingEmotego = subBuilder.BuildPartial(); + break; + } + case 354: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingEmotehelp) { + subBuilder.MergeFrom(ActionBindingEmotehelp); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingEmotehelp = subBuilder.BuildPartial(); + break; + } + case 362: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingEmoteyes) { + subBuilder.MergeFrom(ActionBindingEmoteyes); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingEmoteyes = subBuilder.BuildPartial(); + break; + } + case 370: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingEmoteno) { + subBuilder.MergeFrom(ActionBindingEmoteno); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingEmoteno = subBuilder.BuildPartial(); + break; + } + case 378: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingEmotestay) { + subBuilder.MergeFrom(ActionBindingEmotestay); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingEmotestay = subBuilder.BuildPartial(); + break; + } + case 386: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingEmoteattack) { + subBuilder.MergeFrom(ActionBindingEmoteattack); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingEmoteattack = subBuilder.BuildPartial(); + break; + } + case 394: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingEmoteretreat) { + subBuilder.MergeFrom(ActionBindingEmoteretreat); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingEmoteretreat = subBuilder.BuildPartial(); + break; + } + case 402: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingEmotehold) { + subBuilder.MergeFrom(ActionBindingEmotehold); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingEmotehold = subBuilder.BuildPartial(); + break; + } + case 410: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingEmotetakeobjective) { + subBuilder.MergeFrom(ActionBindingEmotetakeobjective); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingEmotetakeobjective = subBuilder.BuildPartial(); + break; + } + case 418: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingEmotelaugh) { + subBuilder.MergeFrom(ActionBindingEmotelaugh); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingEmotelaugh = subBuilder.BuildPartial(); + break; + } + case 426: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingHoldposition) { + subBuilder.MergeFrom(ActionBindingHoldposition); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingHoldposition = subBuilder.BuildPartial(); + break; + } + case 434: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingSystemmastervolumeup) { + subBuilder.MergeFrom(ActionBindingSystemmastervolumeup); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingSystemmastervolumeup = subBuilder.BuildPartial(); + break; + } + case 442: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingSystemmastervolumedown) { + subBuilder.MergeFrom(ActionBindingSystemmastervolumedown); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingSystemmastervolumedown = subBuilder.BuildPartial(); + break; + } + case 450: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingSystemtogglemusic) { + subBuilder.MergeFrom(ActionBindingSystemtogglemusic); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingSystemtogglemusic = subBuilder.BuildPartial(); + break; + } + case 458: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingSystemtogglesound) { + subBuilder.MergeFrom(ActionBindingSystemtogglesound); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingSystemtogglesound = subBuilder.BuildPartial(); + break; + } + case 466: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingSystemscreenshot) { + subBuilder.MergeFrom(ActionBindingSystemscreenshot); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingSystemscreenshot = subBuilder.BuildPartial(); + break; + } + case 474: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingStoneofrecall) { + subBuilder.MergeFrom(ActionBindingStoneofrecall); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingStoneofrecall = subBuilder.BuildPartial(); + break; + } + case 482: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingBannerscreen) { + subBuilder.MergeFrom(ActionBindingBannerscreen); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingBannerscreen = subBuilder.BuildPartial(); + break; + } + case 490: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingLmb) { + subBuilder.MergeFrom(ActionBindingLmb); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingLmb = subBuilder.BuildPartial(); + break; + } + case 498: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingRmb) { + subBuilder.MergeFrom(ActionBindingRmb); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingRmb = subBuilder.BuildPartial(); + break; + } + case 506: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingWalk) { + subBuilder.MergeFrom(ActionBindingWalk); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingWalk = subBuilder.BuildPartial(); + break; + } + case 514: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingSystemtogglefps) { + subBuilder.MergeFrom(ActionBindingSystemtogglefps); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingSystemtogglefps = subBuilder.BuildPartial(); + break; + } + case 522: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingChatpageup) { + subBuilder.MergeFrom(ActionBindingChatpageup); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingChatpageup = subBuilder.BuildPartial(); + break; + } + case 530: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingChatpagedown) { + subBuilder.MergeFrom(ActionBindingChatpagedown); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingChatpagedown = subBuilder.BuildPartial(); + break; + } + case 594: { + global::D3.Client.ActionBinding.Builder subBuilder = global::D3.Client.ActionBinding.CreateBuilder(); + if (result.hasActionBindingQuests) { + subBuilder.MergeFrom(ActionBindingQuests); + } + input.ReadMessage(subBuilder, extensionRegistry); + ActionBindingQuests = subBuilder.BuildPartial(); + break; + } + case 800: { + result.hasNotifyDuration = input.ReadUInt32(ref result.notifyDuration_); + break; + } + case 1600: { + result.hasFlags2 = input.ReadUInt32(ref result.flags2_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasVersion { + get { return result.hasVersion; } + } + public int Version { + get { return result.Version; } + set { SetVersion(value); } + } + public Builder SetVersion(int value) { + PrepareBuilder(); + result.hasVersion = true; + result.version_ = value; + return this; + } + public Builder ClearVersion() { + PrepareBuilder(); + result.hasVersion = false; + result.version_ = 0; + return this; + } + + public bool HasFlags { + get { return result.hasFlags; } + } + public uint Flags { + get { return result.Flags; } + set { SetFlags(value); } + } + public Builder SetFlags(uint value) { + PrepareBuilder(); + result.hasFlags = true; + result.flags_ = value; + return this; + } + public Builder ClearFlags() { + PrepareBuilder(); + result.hasFlags = false; + result.flags_ = 0; + return this; + } + + public bool HasItemsOnGroundSetting { + get { return result.hasItemsOnGroundSetting; } + } + public uint ItemsOnGroundSetting { + get { return result.ItemsOnGroundSetting; } + set { SetItemsOnGroundSetting(value); } + } + public Builder SetItemsOnGroundSetting(uint value) { + PrepareBuilder(); + result.hasItemsOnGroundSetting = true; + result.itemsOnGroundSetting_ = value; + return this; + } + public Builder ClearItemsOnGroundSetting() { + PrepareBuilder(); + result.hasItemsOnGroundSetting = false; + result.itemsOnGroundSetting_ = 0; + return this; + } + + public bool HasActionBindingInventory { + get { return result.hasActionBindingInventory; } + } + public global::D3.Client.ActionBinding ActionBindingInventory { + get { return result.ActionBindingInventory; } + set { SetActionBindingInventory(value); } + } + public Builder SetActionBindingInventory(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingInventory = true; + result.actionBindingInventory_ = value; + return this; + } + public Builder SetActionBindingInventory(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingInventory = true; + result.actionBindingInventory_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingInventory(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingInventory && + result.actionBindingInventory_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingInventory_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingInventory_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingInventory_ = value; + } + result.hasActionBindingInventory = true; + return this; + } + public Builder ClearActionBindingInventory() { + PrepareBuilder(); + result.hasActionBindingInventory = false; + result.actionBindingInventory_ = null; + return this; + } + + public bool HasActionBindingHireling { + get { return result.hasActionBindingHireling; } + } + public global::D3.Client.ActionBinding ActionBindingHireling { + get { return result.ActionBindingHireling; } + set { SetActionBindingHireling(value); } + } + public Builder SetActionBindingHireling(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingHireling = true; + result.actionBindingHireling_ = value; + return this; + } + public Builder SetActionBindingHireling(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingHireling = true; + result.actionBindingHireling_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingHireling(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingHireling && + result.actionBindingHireling_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingHireling_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingHireling_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingHireling_ = value; + } + result.hasActionBindingHireling = true; + return this; + } + public Builder ClearActionBindingHireling() { + PrepareBuilder(); + result.hasActionBindingHireling = false; + result.actionBindingHireling_ = null; + return this; + } + + public bool HasActionBindingSkills { + get { return result.hasActionBindingSkills; } + } + public global::D3.Client.ActionBinding ActionBindingSkills { + get { return result.ActionBindingSkills; } + set { SetActionBindingSkills(value); } + } + public Builder SetActionBindingSkills(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingSkills = true; + result.actionBindingSkills_ = value; + return this; + } + public Builder SetActionBindingSkills(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingSkills = true; + result.actionBindingSkills_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingSkills(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingSkills && + result.actionBindingSkills_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingSkills_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingSkills_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingSkills_ = value; + } + result.hasActionBindingSkills = true; + return this; + } + public Builder ClearActionBindingSkills() { + PrepareBuilder(); + result.hasActionBindingSkills = false; + result.actionBindingSkills_ = null; + return this; + } + + public bool HasActionBindingQuests { + get { return result.hasActionBindingQuests; } + } + public global::D3.Client.ActionBinding ActionBindingQuests { + get { return result.ActionBindingQuests; } + set { SetActionBindingQuests(value); } + } + public Builder SetActionBindingQuests(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingQuests = true; + result.actionBindingQuests_ = value; + return this; + } + public Builder SetActionBindingQuests(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingQuests = true; + result.actionBindingQuests_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingQuests(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingQuests && + result.actionBindingQuests_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingQuests_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingQuests_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingQuests_ = value; + } + result.hasActionBindingQuests = true; + return this; + } + public Builder ClearActionBindingQuests() { + PrepareBuilder(); + result.hasActionBindingQuests = false; + result.actionBindingQuests_ = null; + return this; + } + + public bool HasActionBindingLore { + get { return result.hasActionBindingLore; } + } + public global::D3.Client.ActionBinding ActionBindingLore { + get { return result.ActionBindingLore; } + set { SetActionBindingLore(value); } + } + public Builder SetActionBindingLore(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingLore = true; + result.actionBindingLore_ = value; + return this; + } + public Builder SetActionBindingLore(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingLore = true; + result.actionBindingLore_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingLore(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingLore && + result.actionBindingLore_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingLore_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingLore_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingLore_ = value; + } + result.hasActionBindingLore = true; + return this; + } + public Builder ClearActionBindingLore() { + PrepareBuilder(); + result.hasActionBindingLore = false; + result.actionBindingLore_ = null; + return this; + } + + public bool HasActionBindingSocial { + get { return result.hasActionBindingSocial; } + } + public global::D3.Client.ActionBinding ActionBindingSocial { + get { return result.ActionBindingSocial; } + set { SetActionBindingSocial(value); } + } + public Builder SetActionBindingSocial(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingSocial = true; + result.actionBindingSocial_ = value; + return this; + } + public Builder SetActionBindingSocial(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingSocial = true; + result.actionBindingSocial_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingSocial(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingSocial && + result.actionBindingSocial_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingSocial_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingSocial_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingSocial_ = value; + } + result.hasActionBindingSocial = true; + return this; + } + public Builder ClearActionBindingSocial() { + PrepareBuilder(); + result.hasActionBindingSocial = false; + result.actionBindingSocial_ = null; + return this; + } + + public bool HasActionBindingWorldmap { + get { return result.hasActionBindingWorldmap; } + } + public global::D3.Client.ActionBinding ActionBindingWorldmap { + get { return result.ActionBindingWorldmap; } + set { SetActionBindingWorldmap(value); } + } + public Builder SetActionBindingWorldmap(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingWorldmap = true; + result.actionBindingWorldmap_ = value; + return this; + } + public Builder SetActionBindingWorldmap(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingWorldmap = true; + result.actionBindingWorldmap_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingWorldmap(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingWorldmap && + result.actionBindingWorldmap_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingWorldmap_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingWorldmap_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingWorldmap_ = value; + } + result.hasActionBindingWorldmap = true; + return this; + } + public Builder ClearActionBindingWorldmap() { + PrepareBuilder(); + result.hasActionBindingWorldmap = false; + result.actionBindingWorldmap_ = null; + return this; + } + + public bool HasActionBindingHelp { + get { return result.hasActionBindingHelp; } + } + public global::D3.Client.ActionBinding ActionBindingHelp { + get { return result.ActionBindingHelp; } + set { SetActionBindingHelp(value); } + } + public Builder SetActionBindingHelp(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingHelp = true; + result.actionBindingHelp_ = value; + return this; + } + public Builder SetActionBindingHelp(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingHelp = true; + result.actionBindingHelp_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingHelp(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingHelp && + result.actionBindingHelp_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingHelp_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingHelp_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingHelp_ = value; + } + result.hasActionBindingHelp = true; + return this; + } + public Builder ClearActionBindingHelp() { + PrepareBuilder(); + result.hasActionBindingHelp = false; + result.actionBindingHelp_ = null; + return this; + } + + public bool HasActionBindingRecentplayers { + get { return result.hasActionBindingRecentplayers; } + } + public global::D3.Client.ActionBinding ActionBindingRecentplayers { + get { return result.ActionBindingRecentplayers; } + set { SetActionBindingRecentplayers(value); } + } + public Builder SetActionBindingRecentplayers(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingRecentplayers = true; + result.actionBindingRecentplayers_ = value; + return this; + } + public Builder SetActionBindingRecentplayers(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingRecentplayers = true; + result.actionBindingRecentplayers_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingRecentplayers(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingRecentplayers && + result.actionBindingRecentplayers_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingRecentplayers_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingRecentplayers_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingRecentplayers_ = value; + } + result.hasActionBindingRecentplayers = true; + return this; + } + public Builder ClearActionBindingRecentplayers() { + PrepareBuilder(); + result.hasActionBindingRecentplayers = false; + result.actionBindingRecentplayers_ = null; + return this; + } + + public bool HasActionBindingChatlobby { + get { return result.hasActionBindingChatlobby; } + } + public global::D3.Client.ActionBinding ActionBindingChatlobby { + get { return result.ActionBindingChatlobby; } + set { SetActionBindingChatlobby(value); } + } + public Builder SetActionBindingChatlobby(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingChatlobby = true; + result.actionBindingChatlobby_ = value; + return this; + } + public Builder SetActionBindingChatlobby(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingChatlobby = true; + result.actionBindingChatlobby_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingChatlobby(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingChatlobby && + result.actionBindingChatlobby_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingChatlobby_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingChatlobby_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingChatlobby_ = value; + } + result.hasActionBindingChatlobby = true; + return this; + } + public Builder ClearActionBindingChatlobby() { + PrepareBuilder(); + result.hasActionBindingChatlobby = false; + result.actionBindingChatlobby_ = null; + return this; + } + + public bool HasActionBindingAchievements { + get { return result.hasActionBindingAchievements; } + } + public global::D3.Client.ActionBinding ActionBindingAchievements { + get { return result.ActionBindingAchievements; } + set { SetActionBindingAchievements(value); } + } + public Builder SetActionBindingAchievements(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingAchievements = true; + result.actionBindingAchievements_ = value; + return this; + } + public Builder SetActionBindingAchievements(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingAchievements = true; + result.actionBindingAchievements_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingAchievements(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingAchievements && + result.actionBindingAchievements_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingAchievements_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingAchievements_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingAchievements_ = value; + } + result.hasActionBindingAchievements = true; + return this; + } + public Builder ClearActionBindingAchievements() { + PrepareBuilder(); + result.hasActionBindingAchievements = false; + result.actionBindingAchievements_ = null; + return this; + } + + public bool HasActionBindingProfile { + get { return result.hasActionBindingProfile; } + } + public global::D3.Client.ActionBinding ActionBindingProfile { + get { return result.ActionBindingProfile; } + set { SetActionBindingProfile(value); } + } + public Builder SetActionBindingProfile(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingProfile = true; + result.actionBindingProfile_ = value; + return this; + } + public Builder SetActionBindingProfile(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingProfile = true; + result.actionBindingProfile_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingProfile(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingProfile && + result.actionBindingProfile_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingProfile_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingProfile_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingProfile_ = value; + } + result.hasActionBindingProfile = true; + return this; + } + public Builder ClearActionBindingProfile() { + PrepareBuilder(); + result.hasActionBindingProfile = false; + result.actionBindingProfile_ = null; + return this; + } + + public bool HasActionBindingAuctionhouse { + get { return result.hasActionBindingAuctionhouse; } + } + public global::D3.Client.ActionBinding ActionBindingAuctionhouse { + get { return result.ActionBindingAuctionhouse; } + set { SetActionBindingAuctionhouse(value); } + } + public Builder SetActionBindingAuctionhouse(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingAuctionhouse = true; + result.actionBindingAuctionhouse_ = value; + return this; + } + public Builder SetActionBindingAuctionhouse(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingAuctionhouse = true; + result.actionBindingAuctionhouse_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingAuctionhouse(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingAuctionhouse && + result.actionBindingAuctionhouse_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingAuctionhouse_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingAuctionhouse_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingAuctionhouse_ = value; + } + result.hasActionBindingAuctionhouse = true; + return this; + } + public Builder ClearActionBindingAuctionhouse() { + PrepareBuilder(); + result.hasActionBindingAuctionhouse = false; + result.actionBindingAuctionhouse_ = null; + return this; + } + + public bool HasActionBindingClear { + get { return result.hasActionBindingClear; } + } + public global::D3.Client.ActionBinding ActionBindingClear { + get { return result.ActionBindingClear; } + set { SetActionBindingClear(value); } + } + public Builder SetActionBindingClear(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingClear = true; + result.actionBindingClear_ = value; + return this; + } + public Builder SetActionBindingClear(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingClear = true; + result.actionBindingClear_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingClear(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingClear && + result.actionBindingClear_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingClear_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingClear_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingClear_ = value; + } + result.hasActionBindingClear = true; + return this; + } + public Builder ClearActionBindingClear() { + PrepareBuilder(); + result.hasActionBindingClear = false; + result.actionBindingClear_ = null; + return this; + } + + public bool HasActionBindingConsole { + get { return result.hasActionBindingConsole; } + } + public global::D3.Client.ActionBinding ActionBindingConsole { + get { return result.ActionBindingConsole; } + set { SetActionBindingConsole(value); } + } + public Builder SetActionBindingConsole(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingConsole = true; + result.actionBindingConsole_ = value; + return this; + } + public Builder SetActionBindingConsole(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingConsole = true; + result.actionBindingConsole_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingConsole(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingConsole && + result.actionBindingConsole_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingConsole_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingConsole_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingConsole_ = value; + } + result.hasActionBindingConsole = true; + return this; + } + public Builder ClearActionBindingConsole() { + PrepareBuilder(); + result.hasActionBindingConsole = false; + result.actionBindingConsole_ = null; + return this; + } + + public bool HasActionBindingMap { + get { return result.hasActionBindingMap; } + } + public global::D3.Client.ActionBinding ActionBindingMap { + get { return result.ActionBindingMap; } + set { SetActionBindingMap(value); } + } + public Builder SetActionBindingMap(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingMap = true; + result.actionBindingMap_ = value; + return this; + } + public Builder SetActionBindingMap(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingMap = true; + result.actionBindingMap_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingMap(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingMap && + result.actionBindingMap_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingMap_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingMap_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingMap_ = value; + } + result.hasActionBindingMap = true; + return this; + } + public Builder ClearActionBindingMap() { + PrepareBuilder(); + result.hasActionBindingMap = false; + result.actionBindingMap_ = null; + return this; + } + + public bool HasActionBindingSkillcycle { + get { return result.hasActionBindingSkillcycle; } + } + public global::D3.Client.ActionBinding ActionBindingSkillcycle { + get { return result.ActionBindingSkillcycle; } + set { SetActionBindingSkillcycle(value); } + } + public Builder SetActionBindingSkillcycle(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingSkillcycle = true; + result.actionBindingSkillcycle_ = value; + return this; + } + public Builder SetActionBindingSkillcycle(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingSkillcycle = true; + result.actionBindingSkillcycle_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingSkillcycle(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingSkillcycle && + result.actionBindingSkillcycle_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingSkillcycle_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingSkillcycle_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingSkillcycle_ = value; + } + result.hasActionBindingSkillcycle = true; + return this; + } + public Builder ClearActionBindingSkillcycle() { + PrepareBuilder(); + result.hasActionBindingSkillcycle = false; + result.actionBindingSkillcycle_ = null; + return this; + } + + public bool HasActionBindingTogglemonsterhpbars { + get { return result.hasActionBindingTogglemonsterhpbars; } + } + public global::D3.Client.ActionBinding ActionBindingTogglemonsterhpbars { + get { return result.ActionBindingTogglemonsterhpbars; } + set { SetActionBindingTogglemonsterhpbars(value); } + } + public Builder SetActionBindingTogglemonsterhpbars(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingTogglemonsterhpbars = true; + result.actionBindingTogglemonsterhpbars_ = value; + return this; + } + public Builder SetActionBindingTogglemonsterhpbars(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingTogglemonsterhpbars = true; + result.actionBindingTogglemonsterhpbars_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingTogglemonsterhpbars(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingTogglemonsterhpbars && + result.actionBindingTogglemonsterhpbars_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingTogglemonsterhpbars_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingTogglemonsterhpbars_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingTogglemonsterhpbars_ = value; + } + result.hasActionBindingTogglemonsterhpbars = true; + return this; + } + public Builder ClearActionBindingTogglemonsterhpbars() { + PrepareBuilder(); + result.hasActionBindingTogglemonsterhpbars = false; + result.actionBindingTogglemonsterhpbars_ = null; + return this; + } + + public bool HasActionBindingToggleplayerhpbars { + get { return result.hasActionBindingToggleplayerhpbars; } + } + public global::D3.Client.ActionBinding ActionBindingToggleplayerhpbars { + get { return result.ActionBindingToggleplayerhpbars; } + set { SetActionBindingToggleplayerhpbars(value); } + } + public Builder SetActionBindingToggleplayerhpbars(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingToggleplayerhpbars = true; + result.actionBindingToggleplayerhpbars_ = value; + return this; + } + public Builder SetActionBindingToggleplayerhpbars(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingToggleplayerhpbars = true; + result.actionBindingToggleplayerhpbars_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingToggleplayerhpbars(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingToggleplayerhpbars && + result.actionBindingToggleplayerhpbars_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingToggleplayerhpbars_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingToggleplayerhpbars_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingToggleplayerhpbars_ = value; + } + result.hasActionBindingToggleplayerhpbars = true; + return this; + } + public Builder ClearActionBindingToggleplayerhpbars() { + PrepareBuilder(); + result.hasActionBindingToggleplayerhpbars = false; + result.actionBindingToggleplayerhpbars_ = null; + return this; + } + + public bool HasActionBindingToggledamagenumbers { + get { return result.hasActionBindingToggledamagenumbers; } + } + public global::D3.Client.ActionBinding ActionBindingToggledamagenumbers { + get { return result.ActionBindingToggledamagenumbers; } + set { SetActionBindingToggledamagenumbers(value); } + } + public Builder SetActionBindingToggledamagenumbers(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingToggledamagenumbers = true; + result.actionBindingToggledamagenumbers_ = value; + return this; + } + public Builder SetActionBindingToggledamagenumbers(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingToggledamagenumbers = true; + result.actionBindingToggledamagenumbers_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingToggledamagenumbers(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingToggledamagenumbers && + result.actionBindingToggledamagenumbers_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingToggledamagenumbers_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingToggledamagenumbers_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingToggledamagenumbers_ = value; + } + result.hasActionBindingToggledamagenumbers = true; + return this; + } + public Builder ClearActionBindingToggledamagenumbers() { + PrepareBuilder(); + result.hasActionBindingToggledamagenumbers = false; + result.actionBindingToggledamagenumbers_ = null; + return this; + } + + public bool HasActionBindingToggleitemsonground { + get { return result.hasActionBindingToggleitemsonground; } + } + public global::D3.Client.ActionBinding ActionBindingToggleitemsonground { + get { return result.ActionBindingToggleitemsonground; } + set { SetActionBindingToggleitemsonground(value); } + } + public Builder SetActionBindingToggleitemsonground(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingToggleitemsonground = true; + result.actionBindingToggleitemsonground_ = value; + return this; + } + public Builder SetActionBindingToggleitemsonground(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingToggleitemsonground = true; + result.actionBindingToggleitemsonground_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingToggleitemsonground(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingToggleitemsonground && + result.actionBindingToggleitemsonground_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingToggleitemsonground_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingToggleitemsonground_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingToggleitemsonground_ = value; + } + result.hasActionBindingToggleitemsonground = true; + return this; + } + public Builder ClearActionBindingToggleitemsonground() { + PrepareBuilder(); + result.hasActionBindingToggleitemsonground = false; + result.actionBindingToggleitemsonground_ = null; + return this; + } + + public bool HasActionBindingRewhisper { + get { return result.hasActionBindingRewhisper; } + } + public global::D3.Client.ActionBinding ActionBindingRewhisper { + get { return result.ActionBindingRewhisper; } + set { SetActionBindingRewhisper(value); } + } + public Builder SetActionBindingRewhisper(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingRewhisper = true; + result.actionBindingRewhisper_ = value; + return this; + } + public Builder SetActionBindingRewhisper(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingRewhisper = true; + result.actionBindingRewhisper_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingRewhisper(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingRewhisper && + result.actionBindingRewhisper_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingRewhisper_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingRewhisper_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingRewhisper_ = value; + } + result.hasActionBindingRewhisper = true; + return this; + } + public Builder ClearActionBindingRewhisper() { + PrepareBuilder(); + result.hasActionBindingRewhisper = false; + result.actionBindingRewhisper_ = null; + return this; + } + + public bool HasActionBindingWhisperreply { + get { return result.hasActionBindingWhisperreply; } + } + public global::D3.Client.ActionBinding ActionBindingWhisperreply { + get { return result.ActionBindingWhisperreply; } + set { SetActionBindingWhisperreply(value); } + } + public Builder SetActionBindingWhisperreply(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingWhisperreply = true; + result.actionBindingWhisperreply_ = value; + return this; + } + public Builder SetActionBindingWhisperreply(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingWhisperreply = true; + result.actionBindingWhisperreply_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingWhisperreply(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingWhisperreply && + result.actionBindingWhisperreply_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingWhisperreply_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingWhisperreply_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingWhisperreply_ = value; + } + result.hasActionBindingWhisperreply = true; + return this; + } + public Builder ClearActionBindingWhisperreply() { + PrepareBuilder(); + result.hasActionBindingWhisperreply = false; + result.actionBindingWhisperreply_ = null; + return this; + } + + public bool HasActionBindingVoiceptt { + get { return result.hasActionBindingVoiceptt; } + } + public global::D3.Client.ActionBinding ActionBindingVoiceptt { + get { return result.ActionBindingVoiceptt; } + set { SetActionBindingVoiceptt(value); } + } + public Builder SetActionBindingVoiceptt(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingVoiceptt = true; + result.actionBindingVoiceptt_ = value; + return this; + } + public Builder SetActionBindingVoiceptt(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingVoiceptt = true; + result.actionBindingVoiceptt_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingVoiceptt(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingVoiceptt && + result.actionBindingVoiceptt_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingVoiceptt_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingVoiceptt_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingVoiceptt_ = value; + } + result.hasActionBindingVoiceptt = true; + return this; + } + public Builder ClearActionBindingVoiceptt() { + PrepareBuilder(); + result.hasActionBindingVoiceptt = false; + result.actionBindingVoiceptt_ = null; + return this; + } + + public bool HasActionBindingSkill1 { + get { return result.hasActionBindingSkill1; } + } + public global::D3.Client.ActionBinding ActionBindingSkill1 { + get { return result.ActionBindingSkill1; } + set { SetActionBindingSkill1(value); } + } + public Builder SetActionBindingSkill1(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingSkill1 = true; + result.actionBindingSkill1_ = value; + return this; + } + public Builder SetActionBindingSkill1(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingSkill1 = true; + result.actionBindingSkill1_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingSkill1(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingSkill1 && + result.actionBindingSkill1_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingSkill1_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingSkill1_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingSkill1_ = value; + } + result.hasActionBindingSkill1 = true; + return this; + } + public Builder ClearActionBindingSkill1() { + PrepareBuilder(); + result.hasActionBindingSkill1 = false; + result.actionBindingSkill1_ = null; + return this; + } + + public bool HasActionBindingSkill2 { + get { return result.hasActionBindingSkill2; } + } + public global::D3.Client.ActionBinding ActionBindingSkill2 { + get { return result.ActionBindingSkill2; } + set { SetActionBindingSkill2(value); } + } + public Builder SetActionBindingSkill2(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingSkill2 = true; + result.actionBindingSkill2_ = value; + return this; + } + public Builder SetActionBindingSkill2(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingSkill2 = true; + result.actionBindingSkill2_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingSkill2(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingSkill2 && + result.actionBindingSkill2_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingSkill2_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingSkill2_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingSkill2_ = value; + } + result.hasActionBindingSkill2 = true; + return this; + } + public Builder ClearActionBindingSkill2() { + PrepareBuilder(); + result.hasActionBindingSkill2 = false; + result.actionBindingSkill2_ = null; + return this; + } + + public bool HasActionBindingSkill3 { + get { return result.hasActionBindingSkill3; } + } + public global::D3.Client.ActionBinding ActionBindingSkill3 { + get { return result.ActionBindingSkill3; } + set { SetActionBindingSkill3(value); } + } + public Builder SetActionBindingSkill3(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingSkill3 = true; + result.actionBindingSkill3_ = value; + return this; + } + public Builder SetActionBindingSkill3(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingSkill3 = true; + result.actionBindingSkill3_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingSkill3(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingSkill3 && + result.actionBindingSkill3_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingSkill3_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingSkill3_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingSkill3_ = value; + } + result.hasActionBindingSkill3 = true; + return this; + } + public Builder ClearActionBindingSkill3() { + PrepareBuilder(); + result.hasActionBindingSkill3 = false; + result.actionBindingSkill3_ = null; + return this; + } + + public bool HasActionBindingSkill4 { + get { return result.hasActionBindingSkill4; } + } + public global::D3.Client.ActionBinding ActionBindingSkill4 { + get { return result.ActionBindingSkill4; } + set { SetActionBindingSkill4(value); } + } + public Builder SetActionBindingSkill4(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingSkill4 = true; + result.actionBindingSkill4_ = value; + return this; + } + public Builder SetActionBindingSkill4(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingSkill4 = true; + result.actionBindingSkill4_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingSkill4(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingSkill4 && + result.actionBindingSkill4_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingSkill4_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingSkill4_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingSkill4_ = value; + } + result.hasActionBindingSkill4 = true; + return this; + } + public Builder ClearActionBindingSkill4() { + PrepareBuilder(); + result.hasActionBindingSkill4 = false; + result.actionBindingSkill4_ = null; + return this; + } + + public bool HasActionBindingPotion { + get { return result.hasActionBindingPotion; } + } + public global::D3.Client.ActionBinding ActionBindingPotion { + get { return result.ActionBindingPotion; } + set { SetActionBindingPotion(value); } + } + public Builder SetActionBindingPotion(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingPotion = true; + result.actionBindingPotion_ = value; + return this; + } + public Builder SetActionBindingPotion(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingPotion = true; + result.actionBindingPotion_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingPotion(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingPotion && + result.actionBindingPotion_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingPotion_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingPotion_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingPotion_ = value; + } + result.hasActionBindingPotion = true; + return this; + } + public Builder ClearActionBindingPotion() { + PrepareBuilder(); + result.hasActionBindingPotion = false; + result.actionBindingPotion_ = null; + return this; + } + + public bool HasActionBindingBannerdrop { + get { return result.hasActionBindingBannerdrop; } + } + public global::D3.Client.ActionBinding ActionBindingBannerdrop { + get { return result.ActionBindingBannerdrop; } + set { SetActionBindingBannerdrop(value); } + } + public Builder SetActionBindingBannerdrop(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingBannerdrop = true; + result.actionBindingBannerdrop_ = value; + return this; + } + public Builder SetActionBindingBannerdrop(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingBannerdrop = true; + result.actionBindingBannerdrop_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingBannerdrop(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingBannerdrop && + result.actionBindingBannerdrop_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingBannerdrop_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingBannerdrop_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingBannerdrop_ = value; + } + result.hasActionBindingBannerdrop = true; + return this; + } + public Builder ClearActionBindingBannerdrop() { + PrepareBuilder(); + result.hasActionBindingBannerdrop = false; + result.actionBindingBannerdrop_ = null; + return this; + } + + public bool HasActionBindingZoom { + get { return result.hasActionBindingZoom; } + } + public global::D3.Client.ActionBinding ActionBindingZoom { + get { return result.ActionBindingZoom; } + set { SetActionBindingZoom(value); } + } + public Builder SetActionBindingZoom(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingZoom = true; + result.actionBindingZoom_ = value; + return this; + } + public Builder SetActionBindingZoom(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingZoom = true; + result.actionBindingZoom_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingZoom(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingZoom && + result.actionBindingZoom_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingZoom_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingZoom_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingZoom_ = value; + } + result.hasActionBindingZoom = true; + return this; + } + public Builder ClearActionBindingZoom() { + PrepareBuilder(); + result.hasActionBindingZoom = false; + result.actionBindingZoom_ = null; + return this; + } + + public bool HasActionBindingEmotefollow { + get { return result.hasActionBindingEmotefollow; } + } + public global::D3.Client.ActionBinding ActionBindingEmotefollow { + get { return result.ActionBindingEmotefollow; } + set { SetActionBindingEmotefollow(value); } + } + public Builder SetActionBindingEmotefollow(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingEmotefollow = true; + result.actionBindingEmotefollow_ = value; + return this; + } + public Builder SetActionBindingEmotefollow(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingEmotefollow = true; + result.actionBindingEmotefollow_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingEmotefollow(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingEmotefollow && + result.actionBindingEmotefollow_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingEmotefollow_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingEmotefollow_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingEmotefollow_ = value; + } + result.hasActionBindingEmotefollow = true; + return this; + } + public Builder ClearActionBindingEmotefollow() { + PrepareBuilder(); + result.hasActionBindingEmotefollow = false; + result.actionBindingEmotefollow_ = null; + return this; + } + + public bool HasActionBindingEmotegive { + get { return result.hasActionBindingEmotegive; } + } + public global::D3.Client.ActionBinding ActionBindingEmotegive { + get { return result.ActionBindingEmotegive; } + set { SetActionBindingEmotegive(value); } + } + public Builder SetActionBindingEmotegive(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingEmotegive = true; + result.actionBindingEmotegive_ = value; + return this; + } + public Builder SetActionBindingEmotegive(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingEmotegive = true; + result.actionBindingEmotegive_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingEmotegive(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingEmotegive && + result.actionBindingEmotegive_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingEmotegive_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingEmotegive_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingEmotegive_ = value; + } + result.hasActionBindingEmotegive = true; + return this; + } + public Builder ClearActionBindingEmotegive() { + PrepareBuilder(); + result.hasActionBindingEmotegive = false; + result.actionBindingEmotegive_ = null; + return this; + } + + public bool HasActionBindingEmotethanks { + get { return result.hasActionBindingEmotethanks; } + } + public global::D3.Client.ActionBinding ActionBindingEmotethanks { + get { return result.ActionBindingEmotethanks; } + set { SetActionBindingEmotethanks(value); } + } + public Builder SetActionBindingEmotethanks(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingEmotethanks = true; + result.actionBindingEmotethanks_ = value; + return this; + } + public Builder SetActionBindingEmotethanks(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingEmotethanks = true; + result.actionBindingEmotethanks_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingEmotethanks(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingEmotethanks && + result.actionBindingEmotethanks_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingEmotethanks_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingEmotethanks_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingEmotethanks_ = value; + } + result.hasActionBindingEmotethanks = true; + return this; + } + public Builder ClearActionBindingEmotethanks() { + PrepareBuilder(); + result.hasActionBindingEmotethanks = false; + result.actionBindingEmotethanks_ = null; + return this; + } + + public bool HasActionBindingEmotesorry { + get { return result.hasActionBindingEmotesorry; } + } + public global::D3.Client.ActionBinding ActionBindingEmotesorry { + get { return result.ActionBindingEmotesorry; } + set { SetActionBindingEmotesorry(value); } + } + public Builder SetActionBindingEmotesorry(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingEmotesorry = true; + result.actionBindingEmotesorry_ = value; + return this; + } + public Builder SetActionBindingEmotesorry(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingEmotesorry = true; + result.actionBindingEmotesorry_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingEmotesorry(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingEmotesorry && + result.actionBindingEmotesorry_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingEmotesorry_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingEmotesorry_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingEmotesorry_ = value; + } + result.hasActionBindingEmotesorry = true; + return this; + } + public Builder ClearActionBindingEmotesorry() { + PrepareBuilder(); + result.hasActionBindingEmotesorry = false; + result.actionBindingEmotesorry_ = null; + return this; + } + + public bool HasActionBindingEmotebye { + get { return result.hasActionBindingEmotebye; } + } + public global::D3.Client.ActionBinding ActionBindingEmotebye { + get { return result.ActionBindingEmotebye; } + set { SetActionBindingEmotebye(value); } + } + public Builder SetActionBindingEmotebye(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingEmotebye = true; + result.actionBindingEmotebye_ = value; + return this; + } + public Builder SetActionBindingEmotebye(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingEmotebye = true; + result.actionBindingEmotebye_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingEmotebye(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingEmotebye && + result.actionBindingEmotebye_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingEmotebye_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingEmotebye_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingEmotebye_ = value; + } + result.hasActionBindingEmotebye = true; + return this; + } + public Builder ClearActionBindingEmotebye() { + PrepareBuilder(); + result.hasActionBindingEmotebye = false; + result.actionBindingEmotebye_ = null; + return this; + } + + public bool HasActionBindingEmotedie { + get { return result.hasActionBindingEmotedie; } + } + public global::D3.Client.ActionBinding ActionBindingEmotedie { + get { return result.ActionBindingEmotedie; } + set { SetActionBindingEmotedie(value); } + } + public Builder SetActionBindingEmotedie(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingEmotedie = true; + result.actionBindingEmotedie_ = value; + return this; + } + public Builder SetActionBindingEmotedie(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingEmotedie = true; + result.actionBindingEmotedie_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingEmotedie(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingEmotedie && + result.actionBindingEmotedie_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingEmotedie_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingEmotedie_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingEmotedie_ = value; + } + result.hasActionBindingEmotedie = true; + return this; + } + public Builder ClearActionBindingEmotedie() { + PrepareBuilder(); + result.hasActionBindingEmotedie = false; + result.actionBindingEmotedie_ = null; + return this; + } + + public bool HasActionBindingEmoterun { + get { return result.hasActionBindingEmoterun; } + } + public global::D3.Client.ActionBinding ActionBindingEmoterun { + get { return result.ActionBindingEmoterun; } + set { SetActionBindingEmoterun(value); } + } + public Builder SetActionBindingEmoterun(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingEmoterun = true; + result.actionBindingEmoterun_ = value; + return this; + } + public Builder SetActionBindingEmoterun(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingEmoterun = true; + result.actionBindingEmoterun_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingEmoterun(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingEmoterun && + result.actionBindingEmoterun_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingEmoterun_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingEmoterun_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingEmoterun_ = value; + } + result.hasActionBindingEmoterun = true; + return this; + } + public Builder ClearActionBindingEmoterun() { + PrepareBuilder(); + result.hasActionBindingEmoterun = false; + result.actionBindingEmoterun_ = null; + return this; + } + + public bool HasActionBindingEmotewait { + get { return result.hasActionBindingEmotewait; } + } + public global::D3.Client.ActionBinding ActionBindingEmotewait { + get { return result.ActionBindingEmotewait; } + set { SetActionBindingEmotewait(value); } + } + public Builder SetActionBindingEmotewait(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingEmotewait = true; + result.actionBindingEmotewait_ = value; + return this; + } + public Builder SetActionBindingEmotewait(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingEmotewait = true; + result.actionBindingEmotewait_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingEmotewait(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingEmotewait && + result.actionBindingEmotewait_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingEmotewait_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingEmotewait_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingEmotewait_ = value; + } + result.hasActionBindingEmotewait = true; + return this; + } + public Builder ClearActionBindingEmotewait() { + PrepareBuilder(); + result.hasActionBindingEmotewait = false; + result.actionBindingEmotewait_ = null; + return this; + } + + public bool HasActionBindingEmotego { + get { return result.hasActionBindingEmotego; } + } + public global::D3.Client.ActionBinding ActionBindingEmotego { + get { return result.ActionBindingEmotego; } + set { SetActionBindingEmotego(value); } + } + public Builder SetActionBindingEmotego(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingEmotego = true; + result.actionBindingEmotego_ = value; + return this; + } + public Builder SetActionBindingEmotego(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingEmotego = true; + result.actionBindingEmotego_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingEmotego(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingEmotego && + result.actionBindingEmotego_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingEmotego_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingEmotego_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingEmotego_ = value; + } + result.hasActionBindingEmotego = true; + return this; + } + public Builder ClearActionBindingEmotego() { + PrepareBuilder(); + result.hasActionBindingEmotego = false; + result.actionBindingEmotego_ = null; + return this; + } + + public bool HasActionBindingEmotehelp { + get { return result.hasActionBindingEmotehelp; } + } + public global::D3.Client.ActionBinding ActionBindingEmotehelp { + get { return result.ActionBindingEmotehelp; } + set { SetActionBindingEmotehelp(value); } + } + public Builder SetActionBindingEmotehelp(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingEmotehelp = true; + result.actionBindingEmotehelp_ = value; + return this; + } + public Builder SetActionBindingEmotehelp(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingEmotehelp = true; + result.actionBindingEmotehelp_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingEmotehelp(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingEmotehelp && + result.actionBindingEmotehelp_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingEmotehelp_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingEmotehelp_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingEmotehelp_ = value; + } + result.hasActionBindingEmotehelp = true; + return this; + } + public Builder ClearActionBindingEmotehelp() { + PrepareBuilder(); + result.hasActionBindingEmotehelp = false; + result.actionBindingEmotehelp_ = null; + return this; + } + + public bool HasActionBindingEmoteyes { + get { return result.hasActionBindingEmoteyes; } + } + public global::D3.Client.ActionBinding ActionBindingEmoteyes { + get { return result.ActionBindingEmoteyes; } + set { SetActionBindingEmoteyes(value); } + } + public Builder SetActionBindingEmoteyes(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingEmoteyes = true; + result.actionBindingEmoteyes_ = value; + return this; + } + public Builder SetActionBindingEmoteyes(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingEmoteyes = true; + result.actionBindingEmoteyes_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingEmoteyes(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingEmoteyes && + result.actionBindingEmoteyes_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingEmoteyes_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingEmoteyes_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingEmoteyes_ = value; + } + result.hasActionBindingEmoteyes = true; + return this; + } + public Builder ClearActionBindingEmoteyes() { + PrepareBuilder(); + result.hasActionBindingEmoteyes = false; + result.actionBindingEmoteyes_ = null; + return this; + } + + public bool HasActionBindingEmoteno { + get { return result.hasActionBindingEmoteno; } + } + public global::D3.Client.ActionBinding ActionBindingEmoteno { + get { return result.ActionBindingEmoteno; } + set { SetActionBindingEmoteno(value); } + } + public Builder SetActionBindingEmoteno(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingEmoteno = true; + result.actionBindingEmoteno_ = value; + return this; + } + public Builder SetActionBindingEmoteno(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingEmoteno = true; + result.actionBindingEmoteno_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingEmoteno(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingEmoteno && + result.actionBindingEmoteno_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingEmoteno_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingEmoteno_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingEmoteno_ = value; + } + result.hasActionBindingEmoteno = true; + return this; + } + public Builder ClearActionBindingEmoteno() { + PrepareBuilder(); + result.hasActionBindingEmoteno = false; + result.actionBindingEmoteno_ = null; + return this; + } + + public bool HasActionBindingEmotestay { + get { return result.hasActionBindingEmotestay; } + } + public global::D3.Client.ActionBinding ActionBindingEmotestay { + get { return result.ActionBindingEmotestay; } + set { SetActionBindingEmotestay(value); } + } + public Builder SetActionBindingEmotestay(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingEmotestay = true; + result.actionBindingEmotestay_ = value; + return this; + } + public Builder SetActionBindingEmotestay(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingEmotestay = true; + result.actionBindingEmotestay_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingEmotestay(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingEmotestay && + result.actionBindingEmotestay_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingEmotestay_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingEmotestay_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingEmotestay_ = value; + } + result.hasActionBindingEmotestay = true; + return this; + } + public Builder ClearActionBindingEmotestay() { + PrepareBuilder(); + result.hasActionBindingEmotestay = false; + result.actionBindingEmotestay_ = null; + return this; + } + + public bool HasActionBindingEmoteattack { + get { return result.hasActionBindingEmoteattack; } + } + public global::D3.Client.ActionBinding ActionBindingEmoteattack { + get { return result.ActionBindingEmoteattack; } + set { SetActionBindingEmoteattack(value); } + } + public Builder SetActionBindingEmoteattack(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingEmoteattack = true; + result.actionBindingEmoteattack_ = value; + return this; + } + public Builder SetActionBindingEmoteattack(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingEmoteattack = true; + result.actionBindingEmoteattack_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingEmoteattack(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingEmoteattack && + result.actionBindingEmoteattack_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingEmoteattack_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingEmoteattack_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingEmoteattack_ = value; + } + result.hasActionBindingEmoteattack = true; + return this; + } + public Builder ClearActionBindingEmoteattack() { + PrepareBuilder(); + result.hasActionBindingEmoteattack = false; + result.actionBindingEmoteattack_ = null; + return this; + } + + public bool HasActionBindingEmoteretreat { + get { return result.hasActionBindingEmoteretreat; } + } + public global::D3.Client.ActionBinding ActionBindingEmoteretreat { + get { return result.ActionBindingEmoteretreat; } + set { SetActionBindingEmoteretreat(value); } + } + public Builder SetActionBindingEmoteretreat(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingEmoteretreat = true; + result.actionBindingEmoteretreat_ = value; + return this; + } + public Builder SetActionBindingEmoteretreat(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingEmoteretreat = true; + result.actionBindingEmoteretreat_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingEmoteretreat(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingEmoteretreat && + result.actionBindingEmoteretreat_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingEmoteretreat_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingEmoteretreat_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingEmoteretreat_ = value; + } + result.hasActionBindingEmoteretreat = true; + return this; + } + public Builder ClearActionBindingEmoteretreat() { + PrepareBuilder(); + result.hasActionBindingEmoteretreat = false; + result.actionBindingEmoteretreat_ = null; + return this; + } + + public bool HasActionBindingEmotehold { + get { return result.hasActionBindingEmotehold; } + } + public global::D3.Client.ActionBinding ActionBindingEmotehold { + get { return result.ActionBindingEmotehold; } + set { SetActionBindingEmotehold(value); } + } + public Builder SetActionBindingEmotehold(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingEmotehold = true; + result.actionBindingEmotehold_ = value; + return this; + } + public Builder SetActionBindingEmotehold(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingEmotehold = true; + result.actionBindingEmotehold_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingEmotehold(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingEmotehold && + result.actionBindingEmotehold_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingEmotehold_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingEmotehold_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingEmotehold_ = value; + } + result.hasActionBindingEmotehold = true; + return this; + } + public Builder ClearActionBindingEmotehold() { + PrepareBuilder(); + result.hasActionBindingEmotehold = false; + result.actionBindingEmotehold_ = null; + return this; + } + + public bool HasActionBindingEmotetakeobjective { + get { return result.hasActionBindingEmotetakeobjective; } + } + public global::D3.Client.ActionBinding ActionBindingEmotetakeobjective { + get { return result.ActionBindingEmotetakeobjective; } + set { SetActionBindingEmotetakeobjective(value); } + } + public Builder SetActionBindingEmotetakeobjective(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingEmotetakeobjective = true; + result.actionBindingEmotetakeobjective_ = value; + return this; + } + public Builder SetActionBindingEmotetakeobjective(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingEmotetakeobjective = true; + result.actionBindingEmotetakeobjective_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingEmotetakeobjective(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingEmotetakeobjective && + result.actionBindingEmotetakeobjective_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingEmotetakeobjective_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingEmotetakeobjective_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingEmotetakeobjective_ = value; + } + result.hasActionBindingEmotetakeobjective = true; + return this; + } + public Builder ClearActionBindingEmotetakeobjective() { + PrepareBuilder(); + result.hasActionBindingEmotetakeobjective = false; + result.actionBindingEmotetakeobjective_ = null; + return this; + } + + public bool HasActionBindingEmotelaugh { + get { return result.hasActionBindingEmotelaugh; } + } + public global::D3.Client.ActionBinding ActionBindingEmotelaugh { + get { return result.ActionBindingEmotelaugh; } + set { SetActionBindingEmotelaugh(value); } + } + public Builder SetActionBindingEmotelaugh(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingEmotelaugh = true; + result.actionBindingEmotelaugh_ = value; + return this; + } + public Builder SetActionBindingEmotelaugh(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingEmotelaugh = true; + result.actionBindingEmotelaugh_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingEmotelaugh(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingEmotelaugh && + result.actionBindingEmotelaugh_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingEmotelaugh_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingEmotelaugh_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingEmotelaugh_ = value; + } + result.hasActionBindingEmotelaugh = true; + return this; + } + public Builder ClearActionBindingEmotelaugh() { + PrepareBuilder(); + result.hasActionBindingEmotelaugh = false; + result.actionBindingEmotelaugh_ = null; + return this; + } + + public bool HasActionBindingHoldposition { + get { return result.hasActionBindingHoldposition; } + } + public global::D3.Client.ActionBinding ActionBindingHoldposition { + get { return result.ActionBindingHoldposition; } + set { SetActionBindingHoldposition(value); } + } + public Builder SetActionBindingHoldposition(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingHoldposition = true; + result.actionBindingHoldposition_ = value; + return this; + } + public Builder SetActionBindingHoldposition(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingHoldposition = true; + result.actionBindingHoldposition_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingHoldposition(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingHoldposition && + result.actionBindingHoldposition_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingHoldposition_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingHoldposition_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingHoldposition_ = value; + } + result.hasActionBindingHoldposition = true; + return this; + } + public Builder ClearActionBindingHoldposition() { + PrepareBuilder(); + result.hasActionBindingHoldposition = false; + result.actionBindingHoldposition_ = null; + return this; + } + + public bool HasActionBindingSystemmastervolumeup { + get { return result.hasActionBindingSystemmastervolumeup; } + } + public global::D3.Client.ActionBinding ActionBindingSystemmastervolumeup { + get { return result.ActionBindingSystemmastervolumeup; } + set { SetActionBindingSystemmastervolumeup(value); } + } + public Builder SetActionBindingSystemmastervolumeup(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingSystemmastervolumeup = true; + result.actionBindingSystemmastervolumeup_ = value; + return this; + } + public Builder SetActionBindingSystemmastervolumeup(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingSystemmastervolumeup = true; + result.actionBindingSystemmastervolumeup_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingSystemmastervolumeup(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingSystemmastervolumeup && + result.actionBindingSystemmastervolumeup_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingSystemmastervolumeup_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingSystemmastervolumeup_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingSystemmastervolumeup_ = value; + } + result.hasActionBindingSystemmastervolumeup = true; + return this; + } + public Builder ClearActionBindingSystemmastervolumeup() { + PrepareBuilder(); + result.hasActionBindingSystemmastervolumeup = false; + result.actionBindingSystemmastervolumeup_ = null; + return this; + } + + public bool HasActionBindingSystemmastervolumedown { + get { return result.hasActionBindingSystemmastervolumedown; } + } + public global::D3.Client.ActionBinding ActionBindingSystemmastervolumedown { + get { return result.ActionBindingSystemmastervolumedown; } + set { SetActionBindingSystemmastervolumedown(value); } + } + public Builder SetActionBindingSystemmastervolumedown(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingSystemmastervolumedown = true; + result.actionBindingSystemmastervolumedown_ = value; + return this; + } + public Builder SetActionBindingSystemmastervolumedown(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingSystemmastervolumedown = true; + result.actionBindingSystemmastervolumedown_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingSystemmastervolumedown(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingSystemmastervolumedown && + result.actionBindingSystemmastervolumedown_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingSystemmastervolumedown_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingSystemmastervolumedown_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingSystemmastervolumedown_ = value; + } + result.hasActionBindingSystemmastervolumedown = true; + return this; + } + public Builder ClearActionBindingSystemmastervolumedown() { + PrepareBuilder(); + result.hasActionBindingSystemmastervolumedown = false; + result.actionBindingSystemmastervolumedown_ = null; + return this; + } + + public bool HasActionBindingSystemtogglemusic { + get { return result.hasActionBindingSystemtogglemusic; } + } + public global::D3.Client.ActionBinding ActionBindingSystemtogglemusic { + get { return result.ActionBindingSystemtogglemusic; } + set { SetActionBindingSystemtogglemusic(value); } + } + public Builder SetActionBindingSystemtogglemusic(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingSystemtogglemusic = true; + result.actionBindingSystemtogglemusic_ = value; + return this; + } + public Builder SetActionBindingSystemtogglemusic(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingSystemtogglemusic = true; + result.actionBindingSystemtogglemusic_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingSystemtogglemusic(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingSystemtogglemusic && + result.actionBindingSystemtogglemusic_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingSystemtogglemusic_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingSystemtogglemusic_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingSystemtogglemusic_ = value; + } + result.hasActionBindingSystemtogglemusic = true; + return this; + } + public Builder ClearActionBindingSystemtogglemusic() { + PrepareBuilder(); + result.hasActionBindingSystemtogglemusic = false; + result.actionBindingSystemtogglemusic_ = null; + return this; + } + + public bool HasActionBindingSystemtogglesound { + get { return result.hasActionBindingSystemtogglesound; } + } + public global::D3.Client.ActionBinding ActionBindingSystemtogglesound { + get { return result.ActionBindingSystemtogglesound; } + set { SetActionBindingSystemtogglesound(value); } + } + public Builder SetActionBindingSystemtogglesound(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingSystemtogglesound = true; + result.actionBindingSystemtogglesound_ = value; + return this; + } + public Builder SetActionBindingSystemtogglesound(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingSystemtogglesound = true; + result.actionBindingSystemtogglesound_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingSystemtogglesound(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingSystemtogglesound && + result.actionBindingSystemtogglesound_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingSystemtogglesound_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingSystemtogglesound_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingSystemtogglesound_ = value; + } + result.hasActionBindingSystemtogglesound = true; + return this; + } + public Builder ClearActionBindingSystemtogglesound() { + PrepareBuilder(); + result.hasActionBindingSystemtogglesound = false; + result.actionBindingSystemtogglesound_ = null; + return this; + } + + public bool HasActionBindingSystemscreenshot { + get { return result.hasActionBindingSystemscreenshot; } + } + public global::D3.Client.ActionBinding ActionBindingSystemscreenshot { + get { return result.ActionBindingSystemscreenshot; } + set { SetActionBindingSystemscreenshot(value); } + } + public Builder SetActionBindingSystemscreenshot(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingSystemscreenshot = true; + result.actionBindingSystemscreenshot_ = value; + return this; + } + public Builder SetActionBindingSystemscreenshot(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingSystemscreenshot = true; + result.actionBindingSystemscreenshot_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingSystemscreenshot(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingSystemscreenshot && + result.actionBindingSystemscreenshot_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingSystemscreenshot_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingSystemscreenshot_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingSystemscreenshot_ = value; + } + result.hasActionBindingSystemscreenshot = true; + return this; + } + public Builder ClearActionBindingSystemscreenshot() { + PrepareBuilder(); + result.hasActionBindingSystemscreenshot = false; + result.actionBindingSystemscreenshot_ = null; + return this; + } + + public bool HasActionBindingStoneofrecall { + get { return result.hasActionBindingStoneofrecall; } + } + public global::D3.Client.ActionBinding ActionBindingStoneofrecall { + get { return result.ActionBindingStoneofrecall; } + set { SetActionBindingStoneofrecall(value); } + } + public Builder SetActionBindingStoneofrecall(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingStoneofrecall = true; + result.actionBindingStoneofrecall_ = value; + return this; + } + public Builder SetActionBindingStoneofrecall(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingStoneofrecall = true; + result.actionBindingStoneofrecall_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingStoneofrecall(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingStoneofrecall && + result.actionBindingStoneofrecall_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingStoneofrecall_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingStoneofrecall_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingStoneofrecall_ = value; + } + result.hasActionBindingStoneofrecall = true; + return this; + } + public Builder ClearActionBindingStoneofrecall() { + PrepareBuilder(); + result.hasActionBindingStoneofrecall = false; + result.actionBindingStoneofrecall_ = null; + return this; + } + + public bool HasActionBindingBannerscreen { + get { return result.hasActionBindingBannerscreen; } + } + public global::D3.Client.ActionBinding ActionBindingBannerscreen { + get { return result.ActionBindingBannerscreen; } + set { SetActionBindingBannerscreen(value); } + } + public Builder SetActionBindingBannerscreen(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingBannerscreen = true; + result.actionBindingBannerscreen_ = value; + return this; + } + public Builder SetActionBindingBannerscreen(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingBannerscreen = true; + result.actionBindingBannerscreen_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingBannerscreen(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingBannerscreen && + result.actionBindingBannerscreen_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingBannerscreen_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingBannerscreen_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingBannerscreen_ = value; + } + result.hasActionBindingBannerscreen = true; + return this; + } + public Builder ClearActionBindingBannerscreen() { + PrepareBuilder(); + result.hasActionBindingBannerscreen = false; + result.actionBindingBannerscreen_ = null; + return this; + } + + public bool HasActionBindingLmb { + get { return result.hasActionBindingLmb; } + } + public global::D3.Client.ActionBinding ActionBindingLmb { + get { return result.ActionBindingLmb; } + set { SetActionBindingLmb(value); } + } + public Builder SetActionBindingLmb(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingLmb = true; + result.actionBindingLmb_ = value; + return this; + } + public Builder SetActionBindingLmb(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingLmb = true; + result.actionBindingLmb_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingLmb(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingLmb && + result.actionBindingLmb_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingLmb_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingLmb_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingLmb_ = value; + } + result.hasActionBindingLmb = true; + return this; + } + public Builder ClearActionBindingLmb() { + PrepareBuilder(); + result.hasActionBindingLmb = false; + result.actionBindingLmb_ = null; + return this; + } + + public bool HasActionBindingRmb { + get { return result.hasActionBindingRmb; } + } + public global::D3.Client.ActionBinding ActionBindingRmb { + get { return result.ActionBindingRmb; } + set { SetActionBindingRmb(value); } + } + public Builder SetActionBindingRmb(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingRmb = true; + result.actionBindingRmb_ = value; + return this; + } + public Builder SetActionBindingRmb(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingRmb = true; + result.actionBindingRmb_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingRmb(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingRmb && + result.actionBindingRmb_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingRmb_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingRmb_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingRmb_ = value; + } + result.hasActionBindingRmb = true; + return this; + } + public Builder ClearActionBindingRmb() { + PrepareBuilder(); + result.hasActionBindingRmb = false; + result.actionBindingRmb_ = null; + return this; + } + + public bool HasActionBindingWalk { + get { return result.hasActionBindingWalk; } + } + public global::D3.Client.ActionBinding ActionBindingWalk { + get { return result.ActionBindingWalk; } + set { SetActionBindingWalk(value); } + } + public Builder SetActionBindingWalk(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingWalk = true; + result.actionBindingWalk_ = value; + return this; + } + public Builder SetActionBindingWalk(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingWalk = true; + result.actionBindingWalk_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingWalk(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingWalk && + result.actionBindingWalk_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingWalk_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingWalk_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingWalk_ = value; + } + result.hasActionBindingWalk = true; + return this; + } + public Builder ClearActionBindingWalk() { + PrepareBuilder(); + result.hasActionBindingWalk = false; + result.actionBindingWalk_ = null; + return this; + } + + public bool HasActionBindingSystemtogglefps { + get { return result.hasActionBindingSystemtogglefps; } + } + public global::D3.Client.ActionBinding ActionBindingSystemtogglefps { + get { return result.ActionBindingSystemtogglefps; } + set { SetActionBindingSystemtogglefps(value); } + } + public Builder SetActionBindingSystemtogglefps(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingSystemtogglefps = true; + result.actionBindingSystemtogglefps_ = value; + return this; + } + public Builder SetActionBindingSystemtogglefps(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingSystemtogglefps = true; + result.actionBindingSystemtogglefps_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingSystemtogglefps(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingSystemtogglefps && + result.actionBindingSystemtogglefps_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingSystemtogglefps_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingSystemtogglefps_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingSystemtogglefps_ = value; + } + result.hasActionBindingSystemtogglefps = true; + return this; + } + public Builder ClearActionBindingSystemtogglefps() { + PrepareBuilder(); + result.hasActionBindingSystemtogglefps = false; + result.actionBindingSystemtogglefps_ = null; + return this; + } + + public bool HasActionBindingChatpageup { + get { return result.hasActionBindingChatpageup; } + } + public global::D3.Client.ActionBinding ActionBindingChatpageup { + get { return result.ActionBindingChatpageup; } + set { SetActionBindingChatpageup(value); } + } + public Builder SetActionBindingChatpageup(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingChatpageup = true; + result.actionBindingChatpageup_ = value; + return this; + } + public Builder SetActionBindingChatpageup(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingChatpageup = true; + result.actionBindingChatpageup_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingChatpageup(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingChatpageup && + result.actionBindingChatpageup_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingChatpageup_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingChatpageup_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingChatpageup_ = value; + } + result.hasActionBindingChatpageup = true; + return this; + } + public Builder ClearActionBindingChatpageup() { + PrepareBuilder(); + result.hasActionBindingChatpageup = false; + result.actionBindingChatpageup_ = null; + return this; + } + + public bool HasActionBindingChatpagedown { + get { return result.hasActionBindingChatpagedown; } + } + public global::D3.Client.ActionBinding ActionBindingChatpagedown { + get { return result.ActionBindingChatpagedown; } + set { SetActionBindingChatpagedown(value); } + } + public Builder SetActionBindingChatpagedown(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasActionBindingChatpagedown = true; + result.actionBindingChatpagedown_ = value; + return this; + } + public Builder SetActionBindingChatpagedown(global::D3.Client.ActionBinding.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasActionBindingChatpagedown = true; + result.actionBindingChatpagedown_ = builderForValue.Build(); + return this; + } + public Builder MergeActionBindingChatpagedown(global::D3.Client.ActionBinding value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasActionBindingChatpagedown && + result.actionBindingChatpagedown_ != global::D3.Client.ActionBinding.DefaultInstance) { + result.actionBindingChatpagedown_ = global::D3.Client.ActionBinding.CreateBuilder(result.actionBindingChatpagedown_).MergeFrom(value).BuildPartial(); + } else { + result.actionBindingChatpagedown_ = value; + } + result.hasActionBindingChatpagedown = true; + return this; + } + public Builder ClearActionBindingChatpagedown() { + PrepareBuilder(); + result.hasActionBindingChatpagedown = false; + result.actionBindingChatpagedown_ = null; + return this; + } + + public bool HasNotifyDuration { + get { return result.hasNotifyDuration; } + } + public uint NotifyDuration { + get { return result.NotifyDuration; } + set { SetNotifyDuration(value); } + } + public Builder SetNotifyDuration(uint value) { + PrepareBuilder(); + result.hasNotifyDuration = true; + result.notifyDuration_ = value; + return this; + } + public Builder ClearNotifyDuration() { + PrepareBuilder(); + result.hasNotifyDuration = false; + result.notifyDuration_ = 0; + return this; + } + + public bool HasFlags2 { + get { return result.hasFlags2; } + } + public uint Flags2 { + get { return result.Flags2; } + set { SetFlags2(value); } + } + public Builder SetFlags2(uint value) { + PrepareBuilder(); + result.hasFlags2 = true; + result.flags2_ = value; + return this; + } + public Builder ClearFlags2() { + PrepareBuilder(); + result.hasFlags2 = false; + result.flags2_ = 0; + return this; + } + } + static Preferences() { + object.ReferenceEquals(global::D3.Client.Settings.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code diff --git a/source/D3Proto/D3/GameBalance/GBHandle.cs b/src/LibMooNet/D3/GameBalance/GBHandle.cs similarity index 65% rename from source/D3Proto/D3/GameBalance/GBHandle.cs rename to src/LibMooNet/D3/GameBalance/GBHandle.cs index 05f6d6e6..f737cb7a 100644 --- a/source/D3Proto/D3/GameBalance/GBHandle.cs +++ b/src/LibMooNet/D3/GameBalance/GBHandle.cs @@ -1,4 +1,6 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code using pb = global::Google.ProtocolBuffers; using pbc = global::Google.ProtocolBuffers.Collections; @@ -6,6 +8,9 @@ using scg = global::System.Collections.Generic; namespace D3.GameBalance { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public static partial class GBHandle { #region Extension registration @@ -24,8 +29,9 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { static GBHandle() { byte[] descriptorData = global::System.Convert.FromBase64String( - "Cg5HQkhhbmRsZS5wcm90bxIORDMuR2FtZUJhbGFuY2UiMQoGSGFuZGxlEhkK" + - "EWdhbWVfYmFsYW5jZV90eXBlGAEgAigREgwKBGdiaWQYAiACKA8="); + "Cg5HQkhhbmRsZS5wcm90bxIORDMuR2FtZUJhbGFuY2UiOQoGSGFuZGxlEh0K" + + "EWdhbWVfYmFsYW5jZV90eXBlGAEgAigROgItMRIQCgRnYmlkGAIgAigPOgIt" + + "MQ=="); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_D3_GameBalance_Handle__Descriptor = Descriptor.MessageTypes[0]; @@ -42,14 +48,20 @@ static GBHandle() { } #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Handle : pb::GeneratedMessage { - private static readonly Handle defaultInstance = new Builder().BuildPartial(); + private Handle() { } + private static readonly Handle defaultInstance = new Handle().MakeReadOnly(); + private static readonly string[] _handleFieldNames = new string[] { "game_balance_type", "gbid" }; + private static readonly uint[] _handleFieldTags = new uint[] { 8, 21 }; public static Handle DefaultInstance { get { return defaultInstance; } } public override Handle DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override Handle ThisMessage { @@ -66,7 +78,7 @@ protected override Handle ThisMessage { public const int GameBalanceTypeFieldNumber = 1; private bool hasGameBalanceType; - private int gameBalanceType_ = 0; + private int gameBalanceType_ = -1; public bool HasGameBalanceType { get { return hasGameBalanceType; } } @@ -76,7 +88,7 @@ public int GameBalanceType { public const int GbidFieldNumber = 2; private bool hasGbid; - private int gbid_ = 0; + private int gbid_ = -1; public bool HasGbid { get { return hasGbid; } } @@ -92,13 +104,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasGameBalanceType) { - output.WriteSInt32(1, GameBalanceType); + string[] field_names = _handleFieldNames; + if (hasGameBalanceType) { + output.WriteSInt32(1, field_names[0], GameBalanceType); } - if (HasGbid) { - output.WriteSFixed32(2, Gbid); + if (hasGbid) { + output.WriteSFixed32(2, field_names[1], Gbid); } UnknownFields.WriteTo(output); } @@ -110,10 +123,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasGameBalanceType) { + if (hasGameBalanceType) { size += pb::CodedOutputStream.ComputeSInt32Size(1, GameBalanceType); } - if (HasGbid) { + if (hasGbid) { size += pb::CodedOutputStream.ComputeSFixed32Size(2, Gbid); } size += UnknownFields.SerializedSize; @@ -146,38 +159,72 @@ public static Handle ParseDelimitedFrom(global::System.IO.Stream input) { public static Handle ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static Handle ParseFrom(pb::CodedInputStream input) { + public static Handle ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Handle ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static Handle ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private Handle MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(Handle prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Handle cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - Handle result = new Handle(); + private bool resultIsReadOnly; + private Handle result; + + private Handle PrepareBuilder() { + if (resultIsReadOnly) { + Handle original = result; + result = new Handle(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override Handle MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new Handle(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -189,12 +236,11 @@ public override Handle DefaultInstanceForType { } public override Handle BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - Handle returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -208,6 +254,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Handle other) { if (other == global::D3.GameBalance.Handle.DefaultInstance) return this; + PrepareBuilder(); if (other.HasGameBalanceType) { GameBalanceType = other.GameBalanceType; } @@ -218,20 +265,31 @@ public override Builder MergeFrom(Handle other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_handleFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _handleFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -243,55 +301,64 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 8: { - GameBalanceType = input.ReadSInt32(); + result.hasGameBalanceType = input.ReadSInt32(ref result.gameBalanceType_); break; } case 21: { - Gbid = input.ReadSFixed32(); + result.hasGbid = input.ReadSFixed32(ref result.gbid_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasGameBalanceType { - get { return result.HasGameBalanceType; } + get { return result.hasGameBalanceType; } } public int GameBalanceType { get { return result.GameBalanceType; } set { SetGameBalanceType(value); } } public Builder SetGameBalanceType(int value) { + PrepareBuilder(); result.hasGameBalanceType = true; result.gameBalanceType_ = value; return this; } public Builder ClearGameBalanceType() { + PrepareBuilder(); result.hasGameBalanceType = false; - result.gameBalanceType_ = 0; + result.gameBalanceType_ = -1; return this; } public bool HasGbid { - get { return result.HasGbid; } + get { return result.hasGbid; } } public int Gbid { get { return result.Gbid; } set { SetGbid(value); } } public Builder SetGbid(int value) { + PrepareBuilder(); result.hasGbid = true; result.gbid_ = value; return this; } public Builder ClearGbid() { + PrepareBuilder(); result.hasGbid = false; - result.gbid_ = 0; + result.gbid_ = -1; return this; } } @@ -303,3 +370,5 @@ static Handle() { #endregion } + +#endregion Designer generated code diff --git a/src/LibMooNet/D3/GameMessage/GameMessage.cs b/src/LibMooNet/D3/GameMessage/GameMessage.cs new file mode 100644 index 00000000..19616cfc --- /dev/null +++ b/src/LibMooNet/D3/GameMessage/GameMessage.cs @@ -0,0 +1,16344 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace D3.GameMessage { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class GameMessage { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_HeroDigestList__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_HeroDigestList__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_ClientToonSettings__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_ClientToonSettings__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_HeroDigestListRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_HeroDigestListRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_HeroDigestResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_HeroDigestResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_HeroDigestListResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_HeroDigestListResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_PlayerBanner__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_PlayerBanner__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_SaveBannerConfiguration__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_SaveBannerConfiguration__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_HeroDigestBanner__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_HeroDigestBanner__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_GameCurrentPlayers__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_GameCurrentPlayers__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_AccountVersionList__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_AccountVersionList__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_AccountVersionSync__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_AccountVersionSync__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_TooltipIds__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_TooltipIds__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_TooltipGenerators__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_TooltipGenerators__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_TutorialMessage__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_TutorialMessage__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_TutorialState__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_TutorialState__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_DeleteHero__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_DeleteHero__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_UndeleteHero__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_UndeleteHero__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_GetFallenHeros__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_GetFallenHeros__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_ArchiveHardcore__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_ArchiveHardcore__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_DeleteFallenHero__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_DeleteFallenHero__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_ServerDeleteHero__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_ServerDeleteHero__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_ServerUndeleteHero__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_ServerUndeleteHero__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_ServerForceRenameHero__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_ServerForceRenameHero__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_ServerFetchHeros__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_ServerFetchHeros__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_ServerFetchInventory__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_ServerFetchInventory__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_ServerSnapshot__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_ServerSnapshot__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_ServerSnapshotResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_ServerSnapshotResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_ServerFetchSnapshot__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_ServerFetchSnapshot__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_ServerRevokeItem__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_ServerRevokeItem__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_RenameHero__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_RenameHero__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_GetGameAccountSettings__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_GetGameAccountSettings__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_SetGameAccountSettings__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_SetGameAccountSettings__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_GetToonSettings__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_GetToonSettings__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_SetToonSettings__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_SetToonSettings__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_GetAccountDigest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_GetAccountDigest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_GetHeroItems__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_GetHeroItems__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_GetAccountItems__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_GetAccountItems__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_GetAccountProfile__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_GetAccountProfile__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_GetHeroProfiles__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_GetHeroProfiles__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_GetAccountPrefs__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_GetAccountPrefs__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_SetAccountPrefs__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_SetAccountPrefs__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_GetHeroDigest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_GetHeroDigest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_GetHeroIds__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_GetHeroIds__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_GetDeletedHero__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_GetDeletedHero__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_CSGetSnapshots__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_CSGetSnapshots__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_CSPullSnapshot__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_CSPullSnapshot__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_CSPushSnapshot__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_CSPushSnapshot__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_CSRestoreToSnapshot__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_CSRestoreToSnapshot__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_GameMessage_CSWriteSnapshot__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_CSWriteSnapshot__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static GameMessage() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "ChFHYW1lTWVzc2FnZS5wcm90bxIORDMuR2FtZU1lc3NhZ2UaCkhlcm8ucHJv" + + "dG8aE09ubGluZVNlcnZpY2UucHJvdG8aDlNldHRpbmdzLnByb3RvGg1BY2Nv" + + "dW50LnByb3RvGgtJdGVtcy5wcm90bxoIQ1MucHJvdG8iZgoOSGVyb0RpZ2Vz" + + "dExpc3QSLgoKYWNjb3VudF9pZBgBIAIoCzIaLkQzLk9ubGluZVNlcnZpY2Uu" + + "RW50aXR5SWQSJAoLZGlnZXN0X2xpc3QYAiADKAsyDy5EMy5IZXJvLkRpZ2Vz" + + "dCJ4ChJDbGllbnRUb29uU2V0dGluZ3MSKwoHdG9vbl9pZBgBIAIoCzIaLkQz" + + "Lk9ubGluZVNlcnZpY2UuRW50aXR5SWQSNQoUY2xpZW50X3Rvb25fc2V0dGlu" + + "Z3MYAiACKAsyFy5EMy5DbGllbnQuVG9vblNldHRpbmdzInQKFUhlcm9EaWdl" + + "c3RMaXN0UmVxdWVzdBIuCgphY2NvdW50X2lkGAEgAigLMhouRDMuT25saW5l" + + "U2VydmljZS5FbnRpdHlJZBIrCgd0b29uX2lkGAIgAygLMhouRDMuT25saW5l" + + "U2VydmljZS5FbnRpdHlJZCJ4ChJIZXJvRGlnZXN0UmVzcG9uc2USKwoHdG9v" + + "bl9pZBgBIAIoCzIaLkQzLk9ubGluZVNlcnZpY2UuRW50aXR5SWQSDwoHc3Vj" + + "Y2VzcxgCIAIoCBIkCgtoZXJvX2RpZ2VzdBgDIAEoCzIPLkQzLkhlcm8uRGln" + + "ZXN0IlEKFkhlcm9EaWdlc3RMaXN0UmVzcG9uc2USNwoLZGlnZXN0X2xpc3QY" + + "ASADKAsyIi5EMy5HYW1lTWVzc2FnZS5IZXJvRGlnZXN0UmVzcG9uc2UiVQoM" + + "UGxheWVyQmFubmVyEhQKDHBsYXllcl9pbmRleBgBIAIoDRIvCgZiYW5uZXIY" + + "AiACKAsyHy5EMy5BY2NvdW50LkJhbm5lckNvbmZpZ3VyYXRpb24ifAoXU2F2" + + "ZUJhbm5lckNvbmZpZ3VyYXRpb24SLwoGYmFubmVyGAEgAigLMh8uRDMuQWNj" + + "b3VudC5CYW5uZXJDb25maWd1cmF0aW9uEhUKCnNsb3RfaW5kZXgYAiABKA06" + + "ATASGQoLbWFrZV9hY3RpdmUYAyABKAg6BHRydWUiaQoQSGVyb0RpZ2VzdEJh" + + "bm5lchIkCgtoZXJvX2RpZ2VzdBgBIAIoCzIPLkQzLkhlcm8uRGlnZXN0Ei8K" + + "BmJhbm5lchgCIAIoCzIfLkQzLkFjY291bnQuQmFubmVyQ29uZmlndXJhdGlv" + + "biJHChJHYW1lQ3VycmVudFBsYXllcnMSMQoHcGxheWVycxgBIAMoCzIgLkQz" + + "LkdhbWVNZXNzYWdlLkhlcm9EaWdlc3RCYW5uZXIiZQoSQWNjb3VudFZlcnNp" + + "b25MaXN0Ei4KCmFjY291bnRfaWQYASACKAsyGi5EMy5PbmxpbmVTZXJ2aWNl" + + "LkVudGl0eUlkEh8KEHJldHVybl9zbmFwc2hvdHMYAiABKAg6BWZhbHNlIlUK" + + "EkFjY291bnRWZXJzaW9uU3luYxIuCgphY2NvdW50X2lkGAEgAigLMhouRDMu" + + "T25saW5lU2VydmljZS5FbnRpdHlJZBIPCgd2ZXJzaW9uGAIgAigEIkMKClRv" + + "b2x0aXBJZHMSDgoGbG9jYWxlGAEgAigNEiUKA2lkcxgCIAMoCzIYLkQzLk9u" + + "bGluZVNlcnZpY2UuSXRlbUlkIkYKEVRvb2x0aXBHZW5lcmF0b3JzEg4KBmxv" + + "Y2FsZRgBIAIoDRIhCgVpdGVtcxgCIAIoCzISLkQzLkl0ZW1zLkl0ZW1MaXN0" + + "Ij8KD1R1dG9yaWFsTWVzc2FnZRIUCgx0dXRvcmlhbF9zbm8YASACKA0SFgoO" + + "dWlfYW5jaG9yX25hbWUYAiABKAkiJwoNVHV0b3JpYWxTdGF0ZRIWCg5zZWVu" + + "X3R1dG9yaWFscxgBIAIoDCI5CgpEZWxldGVIZXJvEisKB2hlcm9faWQYASAC" + + "KAsyGi5EMy5PbmxpbmVTZXJ2aWNlLkVudGl0eUlkInkKDFVuZGVsZXRlSGVy" + + "bxI0ChB1bmRlbGV0ZV9oZXJvX2lkGAEgAigLMhouRDMuT25saW5lU2Vydmlj" + + "ZS5FbnRpdHlJZBIzCg9yZXBsYWNlX2hlcm9faWQYAiABKAsyGi5EMy5Pbmxp" + + "bmVTZXJ2aWNlLkVudGl0eUlkIkAKDkdldEZhbGxlbkhlcm9zEi4KCmFjY291" + + "bnRfaWQYASACKAsyGi5EMy5PbmxpbmVTZXJ2aWNlLkVudGl0eUlkIk8KD0Fy" + + "Y2hpdmVIYXJkY29yZRIrCgdoZXJvX2lkGAEgAigLMhouRDMuT25saW5lU2Vy" + + "dmljZS5FbnRpdHlJZBIPCgdlcGl0YXBoGAIgAigJIj8KEERlbGV0ZUZhbGxl" + + "bkhlcm8SKwoHaGVyb19pZBgBIAIoCzIaLkQzLk9ubGluZVNlcnZpY2UuRW50" + + "aXR5SWQibwoQU2VydmVyRGVsZXRlSGVybxIuCgphY2NvdW50X2lkGAEgAigL" + + "MhouRDMuT25saW5lU2VydmljZS5FbnRpdHlJZBIrCgdoZXJvX2lkGAIgAigL" + + "MhouRDMuT25saW5lU2VydmljZS5FbnRpdHlJZCKvAQoSU2VydmVyVW5kZWxl" + + "dGVIZXJvEi4KCmFjY291bnRfaWQYASACKAsyGi5EMy5PbmxpbmVTZXJ2aWNl" + + "LkVudGl0eUlkEjQKEHVuZGVsZXRlX2hlcm9faWQYAiACKAsyGi5EMy5Pbmxp" + + "bmVTZXJ2aWNlLkVudGl0eUlkEjMKD3JlcGxhY2VfaGVyb19pZBgDIAEoCzIa" + + "LkQzLk9ubGluZVNlcnZpY2UuRW50aXR5SWQidAoVU2VydmVyRm9yY2VSZW5h" + + "bWVIZXJvEi4KCmFjY291bnRfaWQYASACKAsyGi5EMy5PbmxpbmVTZXJ2aWNl" + + "LkVudGl0eUlkEisKB2hlcm9faWQYAiACKAsyGi5EMy5PbmxpbmVTZXJ2aWNl" + + "LkVudGl0eUlkIkIKEFNlcnZlckZldGNoSGVyb3MSLgoKYWNjb3VudF9pZBgB" + + "IAIoCzIaLkQzLk9ubGluZVNlcnZpY2UuRW50aXR5SWQicwoUU2VydmVyRmV0" + + "Y2hJbnZlbnRvcnkSLgoKYWNjb3VudF9pZBgBIAIoCzIaLkQzLk9ubGluZVNl" + + "cnZpY2UuRW50aXR5SWQSKwoHaGVyb19pZBgCIAIoCzIaLkQzLk9ubGluZVNl" + + "cnZpY2UuRW50aXR5SWQiQAoOU2VydmVyU25hcHNob3QSLgoKYWNjb3VudF9p" + + "ZBgBIAIoCzIaLkQzLk9ubGluZVNlcnZpY2UuRW50aXR5SWQiWQoWU2VydmVy" + + "U25hcHNob3RSZXNwb25zZRIuCgphY2NvdW50X2lkGAEgAigLMhouRDMuT25s" + + "aW5lU2VydmljZS5FbnRpdHlJZBIPCgd2ZXJzaW9uGAIgAigEIlYKE1NlcnZl" + + "ckZldGNoU25hcHNob3QSLgoKYWNjb3VudF9pZBgBIAIoCzIaLkQzLk9ubGlu" + + "ZVNlcnZpY2UuRW50aXR5SWQSDwoHdmVyc2lvbhgCIAIoBCKaAQoQU2VydmVy" + + "UmV2b2tlSXRlbRIuCgphY2NvdW50X2lkGAEgAigLMhouRDMuT25saW5lU2Vy" + + "dmljZS5FbnRpdHlJZBIrCgdoZXJvX2lkGAIgAigLMhouRDMuT25saW5lU2Vy" + + "dmljZS5FbnRpdHlJZBIpCgdpdGVtX2lkGAMgAigLMhguRDMuT25saW5lU2Vy" + + "dmljZS5JdGVtSWQiSwoKUmVuYW1lSGVybxIrCgdoZXJvX2lkGAEgAigLMhou" + + "RDMuT25saW5lU2VydmljZS5FbnRpdHlJZBIQCghuZXdfbmFtZRgCIAIoCSIY" + + "ChZHZXRHYW1lQWNjb3VudFNldHRpbmdzIkoKFlNldEdhbWVBY2NvdW50U2V0" + + "dGluZ3MSMAoIc2V0dGluZ3MYASACKAsyHi5EMy5DbGllbnQuR2FtZUFjY291" + + "bnRTZXR0aW5ncyI+Cg9HZXRUb29uU2V0dGluZ3MSKwoHaGVyb19pZBgBIAIo" + + "CzIaLkQzLk9ubGluZVNlcnZpY2UuRW50aXR5SWQiaQoPU2V0VG9vblNldHRp" + + "bmdzEisKB2hlcm9faWQYASACKAsyGi5EMy5PbmxpbmVTZXJ2aWNlLkVudGl0" + + "eUlkEikKCHNldHRpbmdzGAIgAigLMhcuRDMuQ2xpZW50LlRvb25TZXR0aW5n" + + "cyISChBHZXRBY2NvdW50RGlnZXN0IjsKDEdldEhlcm9JdGVtcxIrCgdoZXJv" + + "X2lkGAEgAigLMhouRDMuT25saW5lU2VydmljZS5FbnRpdHlJZCIjCg9HZXRB" + + "Y2NvdW50SXRlbXMSEAoIaGFyZGNvcmUYASACKAgiQwoRR2V0QWNjb3VudFBy" + + "b2ZpbGUSLgoKYWNjb3VudF9pZBgBIAIoCzIaLkQzLk9ubGluZVNlcnZpY2Uu" + + "RW50aXR5SWQibwoPR2V0SGVyb1Byb2ZpbGVzEi4KCmFjY291bnRfaWQYASAC" + + "KAsyGi5EMy5PbmxpbmVTZXJ2aWNlLkVudGl0eUlkEiwKCGhlcm9faWRzGAIg" + + "AygLMhouRDMuT25saW5lU2VydmljZS5FbnRpdHlJZCIRCg9HZXRBY2NvdW50" + + "UHJlZnMiOAoPU2V0QWNjb3VudFByZWZzEiUKBXByZWZzGAEgAigLMhYuRDMu" + + "Q2xpZW50LlByZWZlcmVuY2VzImwKDUdldEhlcm9EaWdlc3QSLgoKYWNjb3Vu" + + "dF9pZBgBIAIoCzIaLkQzLk9ubGluZVNlcnZpY2UuRW50aXR5SWQSKwoHaGVy" + + "b19pZBgCIAIoCzIaLkQzLk9ubGluZVNlcnZpY2UuRW50aXR5SWQiPAoKR2V0" + + "SGVyb0lkcxIuCgphY2NvdW50X2lkGAEgAigLMhouRDMuT25saW5lU2Vydmlj" + + "ZS5FbnRpdHlJZCIQCg5HZXREZWxldGVkSGVybyIQCg5DU0dldFNuYXBzaG90" + + "cyIhCg5DU1B1bGxTbmFwc2hvdBIPCgd2ZXJzaW9uGAEgAigEIi8KDkNTUHVz" + + "aFNuYXBzaG90Eh0KBGRhdGEYASACKAsyDy5EMy5DUy5TbmFwc2hvdCImChND" + + "U1Jlc3RvcmVUb1NuYXBzaG90Eg8KB3ZlcnNpb24YASACKAQiEQoPQ1NXcml0" + + "ZVNuYXBzaG90"); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_D3_GameMessage_HeroDigestList__Descriptor = Descriptor.MessageTypes[0]; + internal__static_D3_GameMessage_HeroDigestList__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_HeroDigestList__Descriptor, + new string[] { "AccountId", "DigestList", }); + internal__static_D3_GameMessage_ClientToonSettings__Descriptor = Descriptor.MessageTypes[1]; + internal__static_D3_GameMessage_ClientToonSettings__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_ClientToonSettings__Descriptor, + new string[] { "ToonId", "ClientToonSettings_", }); + internal__static_D3_GameMessage_HeroDigestListRequest__Descriptor = Descriptor.MessageTypes[2]; + internal__static_D3_GameMessage_HeroDigestListRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_HeroDigestListRequest__Descriptor, + new string[] { "AccountId", "ToonId", }); + internal__static_D3_GameMessage_HeroDigestResponse__Descriptor = Descriptor.MessageTypes[3]; + internal__static_D3_GameMessage_HeroDigestResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_HeroDigestResponse__Descriptor, + new string[] { "ToonId", "Success", "HeroDigest", }); + internal__static_D3_GameMessage_HeroDigestListResponse__Descriptor = Descriptor.MessageTypes[4]; + internal__static_D3_GameMessage_HeroDigestListResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_HeroDigestListResponse__Descriptor, + new string[] { "DigestList", }); + internal__static_D3_GameMessage_PlayerBanner__Descriptor = Descriptor.MessageTypes[5]; + internal__static_D3_GameMessage_PlayerBanner__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_PlayerBanner__Descriptor, + new string[] { "PlayerIndex", "Banner", }); + internal__static_D3_GameMessage_SaveBannerConfiguration__Descriptor = Descriptor.MessageTypes[6]; + internal__static_D3_GameMessage_SaveBannerConfiguration__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_SaveBannerConfiguration__Descriptor, + new string[] { "Banner", "SlotIndex", "MakeActive", }); + internal__static_D3_GameMessage_HeroDigestBanner__Descriptor = Descriptor.MessageTypes[7]; + internal__static_D3_GameMessage_HeroDigestBanner__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_HeroDigestBanner__Descriptor, + new string[] { "HeroDigest", "Banner", }); + internal__static_D3_GameMessage_GameCurrentPlayers__Descriptor = Descriptor.MessageTypes[8]; + internal__static_D3_GameMessage_GameCurrentPlayers__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_GameCurrentPlayers__Descriptor, + new string[] { "Players", }); + internal__static_D3_GameMessage_AccountVersionList__Descriptor = Descriptor.MessageTypes[9]; + internal__static_D3_GameMessage_AccountVersionList__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_AccountVersionList__Descriptor, + new string[] { "AccountId", "ReturnSnapshots", }); + internal__static_D3_GameMessage_AccountVersionSync__Descriptor = Descriptor.MessageTypes[10]; + internal__static_D3_GameMessage_AccountVersionSync__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_AccountVersionSync__Descriptor, + new string[] { "AccountId", "Version", }); + internal__static_D3_GameMessage_TooltipIds__Descriptor = Descriptor.MessageTypes[11]; + internal__static_D3_GameMessage_TooltipIds__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_TooltipIds__Descriptor, + new string[] { "Locale", "Ids", }); + internal__static_D3_GameMessage_TooltipGenerators__Descriptor = Descriptor.MessageTypes[12]; + internal__static_D3_GameMessage_TooltipGenerators__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_TooltipGenerators__Descriptor, + new string[] { "Locale", "Items", }); + internal__static_D3_GameMessage_TutorialMessage__Descriptor = Descriptor.MessageTypes[13]; + internal__static_D3_GameMessage_TutorialMessage__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_TutorialMessage__Descriptor, + new string[] { "TutorialSno", "UiAnchorName", }); + internal__static_D3_GameMessage_TutorialState__Descriptor = Descriptor.MessageTypes[14]; + internal__static_D3_GameMessage_TutorialState__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_TutorialState__Descriptor, + new string[] { "SeenTutorials", }); + internal__static_D3_GameMessage_DeleteHero__Descriptor = Descriptor.MessageTypes[15]; + internal__static_D3_GameMessage_DeleteHero__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_DeleteHero__Descriptor, + new string[] { "HeroId", }); + internal__static_D3_GameMessage_UndeleteHero__Descriptor = Descriptor.MessageTypes[16]; + internal__static_D3_GameMessage_UndeleteHero__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_UndeleteHero__Descriptor, + new string[] { "UndeleteHeroId", "ReplaceHeroId", }); + internal__static_D3_GameMessage_GetFallenHeros__Descriptor = Descriptor.MessageTypes[17]; + internal__static_D3_GameMessage_GetFallenHeros__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_GetFallenHeros__Descriptor, + new string[] { "AccountId", }); + internal__static_D3_GameMessage_ArchiveHardcore__Descriptor = Descriptor.MessageTypes[18]; + internal__static_D3_GameMessage_ArchiveHardcore__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_ArchiveHardcore__Descriptor, + new string[] { "HeroId", "Epitaph", }); + internal__static_D3_GameMessage_DeleteFallenHero__Descriptor = Descriptor.MessageTypes[19]; + internal__static_D3_GameMessage_DeleteFallenHero__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_DeleteFallenHero__Descriptor, + new string[] { "HeroId", }); + internal__static_D3_GameMessage_ServerDeleteHero__Descriptor = Descriptor.MessageTypes[20]; + internal__static_D3_GameMessage_ServerDeleteHero__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_ServerDeleteHero__Descriptor, + new string[] { "AccountId", "HeroId", }); + internal__static_D3_GameMessage_ServerUndeleteHero__Descriptor = Descriptor.MessageTypes[21]; + internal__static_D3_GameMessage_ServerUndeleteHero__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_ServerUndeleteHero__Descriptor, + new string[] { "AccountId", "UndeleteHeroId", "ReplaceHeroId", }); + internal__static_D3_GameMessage_ServerForceRenameHero__Descriptor = Descriptor.MessageTypes[22]; + internal__static_D3_GameMessage_ServerForceRenameHero__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_ServerForceRenameHero__Descriptor, + new string[] { "AccountId", "HeroId", }); + internal__static_D3_GameMessage_ServerFetchHeros__Descriptor = Descriptor.MessageTypes[23]; + internal__static_D3_GameMessage_ServerFetchHeros__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_ServerFetchHeros__Descriptor, + new string[] { "AccountId", }); + internal__static_D3_GameMessage_ServerFetchInventory__Descriptor = Descriptor.MessageTypes[24]; + internal__static_D3_GameMessage_ServerFetchInventory__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_ServerFetchInventory__Descriptor, + new string[] { "AccountId", "HeroId", }); + internal__static_D3_GameMessage_ServerSnapshot__Descriptor = Descriptor.MessageTypes[25]; + internal__static_D3_GameMessage_ServerSnapshot__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_ServerSnapshot__Descriptor, + new string[] { "AccountId", }); + internal__static_D3_GameMessage_ServerSnapshotResponse__Descriptor = Descriptor.MessageTypes[26]; + internal__static_D3_GameMessage_ServerSnapshotResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_ServerSnapshotResponse__Descriptor, + new string[] { "AccountId", "Version", }); + internal__static_D3_GameMessage_ServerFetchSnapshot__Descriptor = Descriptor.MessageTypes[27]; + internal__static_D3_GameMessage_ServerFetchSnapshot__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_ServerFetchSnapshot__Descriptor, + new string[] { "AccountId", "Version", }); + internal__static_D3_GameMessage_ServerRevokeItem__Descriptor = Descriptor.MessageTypes[28]; + internal__static_D3_GameMessage_ServerRevokeItem__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_ServerRevokeItem__Descriptor, + new string[] { "AccountId", "HeroId", "ItemId", }); + internal__static_D3_GameMessage_RenameHero__Descriptor = Descriptor.MessageTypes[29]; + internal__static_D3_GameMessage_RenameHero__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_RenameHero__Descriptor, + new string[] { "HeroId", "NewName", }); + internal__static_D3_GameMessage_GetGameAccountSettings__Descriptor = Descriptor.MessageTypes[30]; + internal__static_D3_GameMessage_GetGameAccountSettings__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_GetGameAccountSettings__Descriptor, + new string[] { }); + internal__static_D3_GameMessage_SetGameAccountSettings__Descriptor = Descriptor.MessageTypes[31]; + internal__static_D3_GameMessage_SetGameAccountSettings__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_SetGameAccountSettings__Descriptor, + new string[] { "Settings", }); + internal__static_D3_GameMessage_GetToonSettings__Descriptor = Descriptor.MessageTypes[32]; + internal__static_D3_GameMessage_GetToonSettings__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_GetToonSettings__Descriptor, + new string[] { "HeroId", }); + internal__static_D3_GameMessage_SetToonSettings__Descriptor = Descriptor.MessageTypes[33]; + internal__static_D3_GameMessage_SetToonSettings__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_SetToonSettings__Descriptor, + new string[] { "HeroId", "Settings", }); + internal__static_D3_GameMessage_GetAccountDigest__Descriptor = Descriptor.MessageTypes[34]; + internal__static_D3_GameMessage_GetAccountDigest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_GetAccountDigest__Descriptor, + new string[] { }); + internal__static_D3_GameMessage_GetHeroItems__Descriptor = Descriptor.MessageTypes[35]; + internal__static_D3_GameMessage_GetHeroItems__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_GetHeroItems__Descriptor, + new string[] { "HeroId", }); + internal__static_D3_GameMessage_GetAccountItems__Descriptor = Descriptor.MessageTypes[36]; + internal__static_D3_GameMessage_GetAccountItems__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_GetAccountItems__Descriptor, + new string[] { "Hardcore", }); + internal__static_D3_GameMessage_GetAccountProfile__Descriptor = Descriptor.MessageTypes[37]; + internal__static_D3_GameMessage_GetAccountProfile__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_GetAccountProfile__Descriptor, + new string[] { "AccountId", }); + internal__static_D3_GameMessage_GetHeroProfiles__Descriptor = Descriptor.MessageTypes[38]; + internal__static_D3_GameMessage_GetHeroProfiles__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_GetHeroProfiles__Descriptor, + new string[] { "AccountId", "HeroIds", }); + internal__static_D3_GameMessage_GetAccountPrefs__Descriptor = Descriptor.MessageTypes[39]; + internal__static_D3_GameMessage_GetAccountPrefs__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_GetAccountPrefs__Descriptor, + new string[] { }); + internal__static_D3_GameMessage_SetAccountPrefs__Descriptor = Descriptor.MessageTypes[40]; + internal__static_D3_GameMessage_SetAccountPrefs__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_SetAccountPrefs__Descriptor, + new string[] { "Prefs", }); + internal__static_D3_GameMessage_GetHeroDigest__Descriptor = Descriptor.MessageTypes[41]; + internal__static_D3_GameMessage_GetHeroDigest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_GetHeroDigest__Descriptor, + new string[] { "AccountId", "HeroId", }); + internal__static_D3_GameMessage_GetHeroIds__Descriptor = Descriptor.MessageTypes[42]; + internal__static_D3_GameMessage_GetHeroIds__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_GetHeroIds__Descriptor, + new string[] { "AccountId", }); + internal__static_D3_GameMessage_GetDeletedHero__Descriptor = Descriptor.MessageTypes[43]; + internal__static_D3_GameMessage_GetDeletedHero__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_GetDeletedHero__Descriptor, + new string[] { }); + internal__static_D3_GameMessage_CSGetSnapshots__Descriptor = Descriptor.MessageTypes[44]; + internal__static_D3_GameMessage_CSGetSnapshots__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_CSGetSnapshots__Descriptor, + new string[] { }); + internal__static_D3_GameMessage_CSPullSnapshot__Descriptor = Descriptor.MessageTypes[45]; + internal__static_D3_GameMessage_CSPullSnapshot__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_CSPullSnapshot__Descriptor, + new string[] { "Version", }); + internal__static_D3_GameMessage_CSPushSnapshot__Descriptor = Descriptor.MessageTypes[46]; + internal__static_D3_GameMessage_CSPushSnapshot__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_CSPushSnapshot__Descriptor, + new string[] { "Data", }); + internal__static_D3_GameMessage_CSRestoreToSnapshot__Descriptor = Descriptor.MessageTypes[47]; + internal__static_D3_GameMessage_CSRestoreToSnapshot__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_CSRestoreToSnapshot__Descriptor, + new string[] { "Version", }); + internal__static_D3_GameMessage_CSWriteSnapshot__Descriptor = Descriptor.MessageTypes[48]; + internal__static_D3_GameMessage_CSWriteSnapshot__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_CSWriteSnapshot__Descriptor, + new string[] { }); + return null; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::D3.Hero.Hero.Descriptor, + global::D3.OnlineService.OnlineService.Descriptor, + global::D3.Client.Settings.Descriptor, + global::D3.Account.Account.Descriptor, + global::D3.Items.Items.Descriptor, + global::D3.CS.CS.Descriptor, + }, assigner); + } + #endregion + + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class HeroDigestList : pb::GeneratedMessage { + private HeroDigestList() { } + private static readonly HeroDigestList defaultInstance = new HeroDigestList().MakeReadOnly(); + private static readonly string[] _heroDigestListFieldNames = new string[] { "account_id", "digest_list" }; + private static readonly uint[] _heroDigestListFieldTags = new uint[] { 10, 18 }; + public static HeroDigestList DefaultInstance { + get { return defaultInstance; } + } + + public override HeroDigestList DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override HeroDigestList ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_HeroDigestList__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_HeroDigestList__FieldAccessorTable; } + } + + public const int AccountIdFieldNumber = 1; + private bool hasAccountId; + private global::D3.OnlineService.EntityId accountId_; + public bool HasAccountId { + get { return hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return accountId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public const int DigestListFieldNumber = 2; + private pbc::PopsicleList digestList_ = new pbc::PopsicleList(); + public scg::IList DigestListList { + get { return digestList_; } + } + public int DigestListCount { + get { return digestList_.Count; } + } + public global::D3.Hero.Digest GetDigestList(int index) { + return digestList_[index]; + } + + public override bool IsInitialized { + get { + if (!hasAccountId) return false; + if (!AccountId.IsInitialized) return false; + foreach (global::D3.Hero.Digest element in DigestListList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _heroDigestListFieldNames; + if (hasAccountId) { + output.WriteMessage(1, field_names[0], AccountId); + } + if (digestList_.Count > 0) { + output.WriteMessageArray(2, field_names[1], digestList_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AccountId); + } + foreach (global::D3.Hero.Digest element in DigestListList) { + size += pb::CodedOutputStream.ComputeMessageSize(2, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static HeroDigestList ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static HeroDigestList ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static HeroDigestList ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static HeroDigestList ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static HeroDigestList ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static HeroDigestList ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static HeroDigestList ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static HeroDigestList ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static HeroDigestList ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static HeroDigestList ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private HeroDigestList MakeReadOnly() { + digestList_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(HeroDigestList prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(HeroDigestList cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private HeroDigestList result; + + private HeroDigestList PrepareBuilder() { + if (resultIsReadOnly) { + HeroDigestList original = result; + result = new HeroDigestList(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override HeroDigestList MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.HeroDigestList.Descriptor; } + } + + public override HeroDigestList DefaultInstanceForType { + get { return global::D3.GameMessage.HeroDigestList.DefaultInstance; } + } + + public override HeroDigestList BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is HeroDigestList) { + return MergeFrom((HeroDigestList) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(HeroDigestList other) { + if (other == global::D3.GameMessage.HeroDigestList.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAccountId) { + MergeAccountId(other.AccountId); + } + if (other.digestList_.Count != 0) { + result.digestList_.Add(other.digestList_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_heroDigestListFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _heroDigestListFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasAccountId) { + subBuilder.MergeFrom(AccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + AccountId = subBuilder.BuildPartial(); + break; + } + case 18: { + input.ReadMessageArray(tag, field_name, result.digestList_, global::D3.Hero.Digest.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAccountId { + get { return result.hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return result.AccountId; } + set { SetAccountId(value); } + } + public Builder SetAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = value; + return this; + } + public Builder SetAccountId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = builderForValue.Build(); + return this; + } + public Builder MergeAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccountId && + result.accountId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.accountId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.accountId_).MergeFrom(value).BuildPartial(); + } else { + result.accountId_ = value; + } + result.hasAccountId = true; + return this; + } + public Builder ClearAccountId() { + PrepareBuilder(); + result.hasAccountId = false; + result.accountId_ = null; + return this; + } + + public pbc::IPopsicleList DigestListList { + get { return PrepareBuilder().digestList_; } + } + public int DigestListCount { + get { return result.DigestListCount; } + } + public global::D3.Hero.Digest GetDigestList(int index) { + return result.GetDigestList(index); + } + public Builder SetDigestList(int index, global::D3.Hero.Digest value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.digestList_[index] = value; + return this; + } + public Builder SetDigestList(int index, global::D3.Hero.Digest.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.digestList_[index] = builderForValue.Build(); + return this; + } + public Builder AddDigestList(global::D3.Hero.Digest value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.digestList_.Add(value); + return this; + } + public Builder AddDigestList(global::D3.Hero.Digest.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.digestList_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeDigestList(scg::IEnumerable values) { + PrepareBuilder(); + result.digestList_.Add(values); + return this; + } + public Builder ClearDigestList() { + PrepareBuilder(); + result.digestList_.Clear(); + return this; + } + } + static HeroDigestList() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ClientToonSettings : pb::GeneratedMessage { + private ClientToonSettings() { } + private static readonly ClientToonSettings defaultInstance = new ClientToonSettings().MakeReadOnly(); + private static readonly string[] _clientToonSettingsFieldNames = new string[] { "client_toon_settings", "toon_id" }; + private static readonly uint[] _clientToonSettingsFieldTags = new uint[] { 18, 10 }; + public static ClientToonSettings DefaultInstance { + get { return defaultInstance; } + } + + public override ClientToonSettings DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ClientToonSettings ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_ClientToonSettings__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_ClientToonSettings__FieldAccessorTable; } + } + + public const int ToonIdFieldNumber = 1; + private bool hasToonId; + private global::D3.OnlineService.EntityId toonId_; + public bool HasToonId { + get { return hasToonId; } + } + public global::D3.OnlineService.EntityId ToonId { + get { return toonId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public const int ClientToonSettings_FieldNumber = 2; + private bool hasClientToonSettings_; + private global::D3.Client.ToonSettings clientToonSettings_; + public bool HasClientToonSettings_ { + get { return hasClientToonSettings_; } + } + public global::D3.Client.ToonSettings ClientToonSettings_ { + get { return clientToonSettings_ ?? global::D3.Client.ToonSettings.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasToonId) return false; + if (!hasClientToonSettings_) return false; + if (!ToonId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _clientToonSettingsFieldNames; + if (hasToonId) { + output.WriteMessage(1, field_names[1], ToonId); + } + if (hasClientToonSettings_) { + output.WriteMessage(2, field_names[0], ClientToonSettings_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasToonId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, ToonId); + } + if (hasClientToonSettings_) { + size += pb::CodedOutputStream.ComputeMessageSize(2, ClientToonSettings_); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ClientToonSettings ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ClientToonSettings ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ClientToonSettings ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ClientToonSettings ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ClientToonSettings ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ClientToonSettings ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ClientToonSettings ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ClientToonSettings ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ClientToonSettings ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ClientToonSettings ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ClientToonSettings MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ClientToonSettings prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ClientToonSettings cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ClientToonSettings result; + + private ClientToonSettings PrepareBuilder() { + if (resultIsReadOnly) { + ClientToonSettings original = result; + result = new ClientToonSettings(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ClientToonSettings MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.ClientToonSettings.Descriptor; } + } + + public override ClientToonSettings DefaultInstanceForType { + get { return global::D3.GameMessage.ClientToonSettings.DefaultInstance; } + } + + public override ClientToonSettings BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ClientToonSettings) { + return MergeFrom((ClientToonSettings) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ClientToonSettings other) { + if (other == global::D3.GameMessage.ClientToonSettings.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasToonId) { + MergeToonId(other.ToonId); + } + if (other.HasClientToonSettings_) { + MergeClientToonSettings_(other.ClientToonSettings_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_clientToonSettingsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _clientToonSettingsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasToonId) { + subBuilder.MergeFrom(ToonId); + } + input.ReadMessage(subBuilder, extensionRegistry); + ToonId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::D3.Client.ToonSettings.Builder subBuilder = global::D3.Client.ToonSettings.CreateBuilder(); + if (result.hasClientToonSettings_) { + subBuilder.MergeFrom(ClientToonSettings_); + } + input.ReadMessage(subBuilder, extensionRegistry); + ClientToonSettings_ = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasToonId { + get { return result.hasToonId; } + } + public global::D3.OnlineService.EntityId ToonId { + get { return result.ToonId; } + set { SetToonId(value); } + } + public Builder SetToonId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasToonId = true; + result.toonId_ = value; + return this; + } + public Builder SetToonId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasToonId = true; + result.toonId_ = builderForValue.Build(); + return this; + } + public Builder MergeToonId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasToonId && + result.toonId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.toonId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.toonId_).MergeFrom(value).BuildPartial(); + } else { + result.toonId_ = value; + } + result.hasToonId = true; + return this; + } + public Builder ClearToonId() { + PrepareBuilder(); + result.hasToonId = false; + result.toonId_ = null; + return this; + } + + public bool HasClientToonSettings_ { + get { return result.hasClientToonSettings_; } + } + public global::D3.Client.ToonSettings ClientToonSettings_ { + get { return result.ClientToonSettings_; } + set { SetClientToonSettings_(value); } + } + public Builder SetClientToonSettings_(global::D3.Client.ToonSettings value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasClientToonSettings_ = true; + result.clientToonSettings_ = value; + return this; + } + public Builder SetClientToonSettings_(global::D3.Client.ToonSettings.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasClientToonSettings_ = true; + result.clientToonSettings_ = builderForValue.Build(); + return this; + } + public Builder MergeClientToonSettings_(global::D3.Client.ToonSettings value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasClientToonSettings_ && + result.clientToonSettings_ != global::D3.Client.ToonSettings.DefaultInstance) { + result.clientToonSettings_ = global::D3.Client.ToonSettings.CreateBuilder(result.clientToonSettings_).MergeFrom(value).BuildPartial(); + } else { + result.clientToonSettings_ = value; + } + result.hasClientToonSettings_ = true; + return this; + } + public Builder ClearClientToonSettings_() { + PrepareBuilder(); + result.hasClientToonSettings_ = false; + result.clientToonSettings_ = null; + return this; + } + } + static ClientToonSettings() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class HeroDigestListRequest : pb::GeneratedMessage { + private HeroDigestListRequest() { } + private static readonly HeroDigestListRequest defaultInstance = new HeroDigestListRequest().MakeReadOnly(); + private static readonly string[] _heroDigestListRequestFieldNames = new string[] { "account_id", "toon_id" }; + private static readonly uint[] _heroDigestListRequestFieldTags = new uint[] { 10, 18 }; + public static HeroDigestListRequest DefaultInstance { + get { return defaultInstance; } + } + + public override HeroDigestListRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override HeroDigestListRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_HeroDigestListRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_HeroDigestListRequest__FieldAccessorTable; } + } + + public const int AccountIdFieldNumber = 1; + private bool hasAccountId; + private global::D3.OnlineService.EntityId accountId_; + public bool HasAccountId { + get { return hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return accountId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public const int ToonIdFieldNumber = 2; + private pbc::PopsicleList toonId_ = new pbc::PopsicleList(); + public scg::IList ToonIdList { + get { return toonId_; } + } + public int ToonIdCount { + get { return toonId_.Count; } + } + public global::D3.OnlineService.EntityId GetToonId(int index) { + return toonId_[index]; + } + + public override bool IsInitialized { + get { + if (!hasAccountId) return false; + if (!AccountId.IsInitialized) return false; + foreach (global::D3.OnlineService.EntityId element in ToonIdList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _heroDigestListRequestFieldNames; + if (hasAccountId) { + output.WriteMessage(1, field_names[0], AccountId); + } + if (toonId_.Count > 0) { + output.WriteMessageArray(2, field_names[1], toonId_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AccountId); + } + foreach (global::D3.OnlineService.EntityId element in ToonIdList) { + size += pb::CodedOutputStream.ComputeMessageSize(2, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static HeroDigestListRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static HeroDigestListRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static HeroDigestListRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static HeroDigestListRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static HeroDigestListRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static HeroDigestListRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static HeroDigestListRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static HeroDigestListRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static HeroDigestListRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static HeroDigestListRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private HeroDigestListRequest MakeReadOnly() { + toonId_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(HeroDigestListRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(HeroDigestListRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private HeroDigestListRequest result; + + private HeroDigestListRequest PrepareBuilder() { + if (resultIsReadOnly) { + HeroDigestListRequest original = result; + result = new HeroDigestListRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override HeroDigestListRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.HeroDigestListRequest.Descriptor; } + } + + public override HeroDigestListRequest DefaultInstanceForType { + get { return global::D3.GameMessage.HeroDigestListRequest.DefaultInstance; } + } + + public override HeroDigestListRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is HeroDigestListRequest) { + return MergeFrom((HeroDigestListRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(HeroDigestListRequest other) { + if (other == global::D3.GameMessage.HeroDigestListRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAccountId) { + MergeAccountId(other.AccountId); + } + if (other.toonId_.Count != 0) { + result.toonId_.Add(other.toonId_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_heroDigestListRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _heroDigestListRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasAccountId) { + subBuilder.MergeFrom(AccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + AccountId = subBuilder.BuildPartial(); + break; + } + case 18: { + input.ReadMessageArray(tag, field_name, result.toonId_, global::D3.OnlineService.EntityId.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAccountId { + get { return result.hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return result.AccountId; } + set { SetAccountId(value); } + } + public Builder SetAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = value; + return this; + } + public Builder SetAccountId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = builderForValue.Build(); + return this; + } + public Builder MergeAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccountId && + result.accountId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.accountId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.accountId_).MergeFrom(value).BuildPartial(); + } else { + result.accountId_ = value; + } + result.hasAccountId = true; + return this; + } + public Builder ClearAccountId() { + PrepareBuilder(); + result.hasAccountId = false; + result.accountId_ = null; + return this; + } + + public pbc::IPopsicleList ToonIdList { + get { return PrepareBuilder().toonId_; } + } + public int ToonIdCount { + get { return result.ToonIdCount; } + } + public global::D3.OnlineService.EntityId GetToonId(int index) { + return result.GetToonId(index); + } + public Builder SetToonId(int index, global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.toonId_[index] = value; + return this; + } + public Builder SetToonId(int index, global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.toonId_[index] = builderForValue.Build(); + return this; + } + public Builder AddToonId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.toonId_.Add(value); + return this; + } + public Builder AddToonId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.toonId_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeToonId(scg::IEnumerable values) { + PrepareBuilder(); + result.toonId_.Add(values); + return this; + } + public Builder ClearToonId() { + PrepareBuilder(); + result.toonId_.Clear(); + return this; + } + } + static HeroDigestListRequest() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class HeroDigestResponse : pb::GeneratedMessage { + private HeroDigestResponse() { } + private static readonly HeroDigestResponse defaultInstance = new HeroDigestResponse().MakeReadOnly(); + private static readonly string[] _heroDigestResponseFieldNames = new string[] { "hero_digest", "success", "toon_id" }; + private static readonly uint[] _heroDigestResponseFieldTags = new uint[] { 26, 16, 10 }; + public static HeroDigestResponse DefaultInstance { + get { return defaultInstance; } + } + + public override HeroDigestResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override HeroDigestResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_HeroDigestResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_HeroDigestResponse__FieldAccessorTable; } + } + + public const int ToonIdFieldNumber = 1; + private bool hasToonId; + private global::D3.OnlineService.EntityId toonId_; + public bool HasToonId { + get { return hasToonId; } + } + public global::D3.OnlineService.EntityId ToonId { + get { return toonId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public const int SuccessFieldNumber = 2; + private bool hasSuccess; + private bool success_; + public bool HasSuccess { + get { return hasSuccess; } + } + public bool Success { + get { return success_; } + } + + public const int HeroDigestFieldNumber = 3; + private bool hasHeroDigest; + private global::D3.Hero.Digest heroDigest_; + public bool HasHeroDigest { + get { return hasHeroDigest; } + } + public global::D3.Hero.Digest HeroDigest { + get { return heroDigest_ ?? global::D3.Hero.Digest.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasToonId) return false; + if (!hasSuccess) return false; + if (!ToonId.IsInitialized) return false; + if (HasHeroDigest) { + if (!HeroDigest.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _heroDigestResponseFieldNames; + if (hasToonId) { + output.WriteMessage(1, field_names[2], ToonId); + } + if (hasSuccess) { + output.WriteBool(2, field_names[1], Success); + } + if (hasHeroDigest) { + output.WriteMessage(3, field_names[0], HeroDigest); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasToonId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, ToonId); + } + if (hasSuccess) { + size += pb::CodedOutputStream.ComputeBoolSize(2, Success); + } + if (hasHeroDigest) { + size += pb::CodedOutputStream.ComputeMessageSize(3, HeroDigest); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static HeroDigestResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static HeroDigestResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static HeroDigestResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static HeroDigestResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static HeroDigestResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static HeroDigestResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static HeroDigestResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static HeroDigestResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static HeroDigestResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static HeroDigestResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private HeroDigestResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(HeroDigestResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(HeroDigestResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private HeroDigestResponse result; + + private HeroDigestResponse PrepareBuilder() { + if (resultIsReadOnly) { + HeroDigestResponse original = result; + result = new HeroDigestResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override HeroDigestResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.HeroDigestResponse.Descriptor; } + } + + public override HeroDigestResponse DefaultInstanceForType { + get { return global::D3.GameMessage.HeroDigestResponse.DefaultInstance; } + } + + public override HeroDigestResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is HeroDigestResponse) { + return MergeFrom((HeroDigestResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(HeroDigestResponse other) { + if (other == global::D3.GameMessage.HeroDigestResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasToonId) { + MergeToonId(other.ToonId); + } + if (other.HasSuccess) { + Success = other.Success; + } + if (other.HasHeroDigest) { + MergeHeroDigest(other.HeroDigest); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_heroDigestResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _heroDigestResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasToonId) { + subBuilder.MergeFrom(ToonId); + } + input.ReadMessage(subBuilder, extensionRegistry); + ToonId = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasSuccess = input.ReadBool(ref result.success_); + break; + } + case 26: { + global::D3.Hero.Digest.Builder subBuilder = global::D3.Hero.Digest.CreateBuilder(); + if (result.hasHeroDigest) { + subBuilder.MergeFrom(HeroDigest); + } + input.ReadMessage(subBuilder, extensionRegistry); + HeroDigest = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasToonId { + get { return result.hasToonId; } + } + public global::D3.OnlineService.EntityId ToonId { + get { return result.ToonId; } + set { SetToonId(value); } + } + public Builder SetToonId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasToonId = true; + result.toonId_ = value; + return this; + } + public Builder SetToonId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasToonId = true; + result.toonId_ = builderForValue.Build(); + return this; + } + public Builder MergeToonId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasToonId && + result.toonId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.toonId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.toonId_).MergeFrom(value).BuildPartial(); + } else { + result.toonId_ = value; + } + result.hasToonId = true; + return this; + } + public Builder ClearToonId() { + PrepareBuilder(); + result.hasToonId = false; + result.toonId_ = null; + return this; + } + + public bool HasSuccess { + get { return result.hasSuccess; } + } + public bool Success { + get { return result.Success; } + set { SetSuccess(value); } + } + public Builder SetSuccess(bool value) { + PrepareBuilder(); + result.hasSuccess = true; + result.success_ = value; + return this; + } + public Builder ClearSuccess() { + PrepareBuilder(); + result.hasSuccess = false; + result.success_ = false; + return this; + } + + public bool HasHeroDigest { + get { return result.hasHeroDigest; } + } + public global::D3.Hero.Digest HeroDigest { + get { return result.HeroDigest; } + set { SetHeroDigest(value); } + } + public Builder SetHeroDigest(global::D3.Hero.Digest value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasHeroDigest = true; + result.heroDigest_ = value; + return this; + } + public Builder SetHeroDigest(global::D3.Hero.Digest.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasHeroDigest = true; + result.heroDigest_ = builderForValue.Build(); + return this; + } + public Builder MergeHeroDigest(global::D3.Hero.Digest value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasHeroDigest && + result.heroDigest_ != global::D3.Hero.Digest.DefaultInstance) { + result.heroDigest_ = global::D3.Hero.Digest.CreateBuilder(result.heroDigest_).MergeFrom(value).BuildPartial(); + } else { + result.heroDigest_ = value; + } + result.hasHeroDigest = true; + return this; + } + public Builder ClearHeroDigest() { + PrepareBuilder(); + result.hasHeroDigest = false; + result.heroDigest_ = null; + return this; + } + } + static HeroDigestResponse() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class HeroDigestListResponse : pb::GeneratedMessage { + private HeroDigestListResponse() { } + private static readonly HeroDigestListResponse defaultInstance = new HeroDigestListResponse().MakeReadOnly(); + private static readonly string[] _heroDigestListResponseFieldNames = new string[] { "digest_list" }; + private static readonly uint[] _heroDigestListResponseFieldTags = new uint[] { 10 }; + public static HeroDigestListResponse DefaultInstance { + get { return defaultInstance; } + } + + public override HeroDigestListResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override HeroDigestListResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_HeroDigestListResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_HeroDigestListResponse__FieldAccessorTable; } + } + + public const int DigestListFieldNumber = 1; + private pbc::PopsicleList digestList_ = new pbc::PopsicleList(); + public scg::IList DigestListList { + get { return digestList_; } + } + public int DigestListCount { + get { return digestList_.Count; } + } + public global::D3.GameMessage.HeroDigestResponse GetDigestList(int index) { + return digestList_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::D3.GameMessage.HeroDigestResponse element in DigestListList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _heroDigestListResponseFieldNames; + if (digestList_.Count > 0) { + output.WriteMessageArray(1, field_names[0], digestList_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::D3.GameMessage.HeroDigestResponse element in DigestListList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static HeroDigestListResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static HeroDigestListResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static HeroDigestListResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static HeroDigestListResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static HeroDigestListResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static HeroDigestListResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static HeroDigestListResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static HeroDigestListResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static HeroDigestListResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static HeroDigestListResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private HeroDigestListResponse MakeReadOnly() { + digestList_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(HeroDigestListResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(HeroDigestListResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private HeroDigestListResponse result; + + private HeroDigestListResponse PrepareBuilder() { + if (resultIsReadOnly) { + HeroDigestListResponse original = result; + result = new HeroDigestListResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override HeroDigestListResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.HeroDigestListResponse.Descriptor; } + } + + public override HeroDigestListResponse DefaultInstanceForType { + get { return global::D3.GameMessage.HeroDigestListResponse.DefaultInstance; } + } + + public override HeroDigestListResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is HeroDigestListResponse) { + return MergeFrom((HeroDigestListResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(HeroDigestListResponse other) { + if (other == global::D3.GameMessage.HeroDigestListResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.digestList_.Count != 0) { + result.digestList_.Add(other.digestList_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_heroDigestListResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _heroDigestListResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.digestList_, global::D3.GameMessage.HeroDigestResponse.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList DigestListList { + get { return PrepareBuilder().digestList_; } + } + public int DigestListCount { + get { return result.DigestListCount; } + } + public global::D3.GameMessage.HeroDigestResponse GetDigestList(int index) { + return result.GetDigestList(index); + } + public Builder SetDigestList(int index, global::D3.GameMessage.HeroDigestResponse value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.digestList_[index] = value; + return this; + } + public Builder SetDigestList(int index, global::D3.GameMessage.HeroDigestResponse.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.digestList_[index] = builderForValue.Build(); + return this; + } + public Builder AddDigestList(global::D3.GameMessage.HeroDigestResponse value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.digestList_.Add(value); + return this; + } + public Builder AddDigestList(global::D3.GameMessage.HeroDigestResponse.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.digestList_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeDigestList(scg::IEnumerable values) { + PrepareBuilder(); + result.digestList_.Add(values); + return this; + } + public Builder ClearDigestList() { + PrepareBuilder(); + result.digestList_.Clear(); + return this; + } + } + static HeroDigestListResponse() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class PlayerBanner : pb::GeneratedMessage { + private PlayerBanner() { } + private static readonly PlayerBanner defaultInstance = new PlayerBanner().MakeReadOnly(); + private static readonly string[] _playerBannerFieldNames = new string[] { "banner", "player_index" }; + private static readonly uint[] _playerBannerFieldTags = new uint[] { 18, 8 }; + public static PlayerBanner DefaultInstance { + get { return defaultInstance; } + } + + public override PlayerBanner DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override PlayerBanner ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_PlayerBanner__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_PlayerBanner__FieldAccessorTable; } + } + + public const int PlayerIndexFieldNumber = 1; + private bool hasPlayerIndex; + private uint playerIndex_; + public bool HasPlayerIndex { + get { return hasPlayerIndex; } + } + public uint PlayerIndex { + get { return playerIndex_; } + } + + public const int BannerFieldNumber = 2; + private bool hasBanner; + private global::D3.Account.BannerConfiguration banner_; + public bool HasBanner { + get { return hasBanner; } + } + public global::D3.Account.BannerConfiguration Banner { + get { return banner_ ?? global::D3.Account.BannerConfiguration.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasPlayerIndex) return false; + if (!hasBanner) return false; + if (!Banner.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _playerBannerFieldNames; + if (hasPlayerIndex) { + output.WriteUInt32(1, field_names[1], PlayerIndex); + } + if (hasBanner) { + output.WriteMessage(2, field_names[0], Banner); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasPlayerIndex) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, PlayerIndex); + } + if (hasBanner) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Banner); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static PlayerBanner ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PlayerBanner ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PlayerBanner ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PlayerBanner ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PlayerBanner ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PlayerBanner ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static PlayerBanner ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static PlayerBanner ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static PlayerBanner ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PlayerBanner ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private PlayerBanner MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(PlayerBanner prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(PlayerBanner cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private PlayerBanner result; + + private PlayerBanner PrepareBuilder() { + if (resultIsReadOnly) { + PlayerBanner original = result; + result = new PlayerBanner(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override PlayerBanner MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.PlayerBanner.Descriptor; } + } + + public override PlayerBanner DefaultInstanceForType { + get { return global::D3.GameMessage.PlayerBanner.DefaultInstance; } + } + + public override PlayerBanner BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is PlayerBanner) { + return MergeFrom((PlayerBanner) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(PlayerBanner other) { + if (other == global::D3.GameMessage.PlayerBanner.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasPlayerIndex) { + PlayerIndex = other.PlayerIndex; + } + if (other.HasBanner) { + MergeBanner(other.Banner); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_playerBannerFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _playerBannerFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasPlayerIndex = input.ReadUInt32(ref result.playerIndex_); + break; + } + case 18: { + global::D3.Account.BannerConfiguration.Builder subBuilder = global::D3.Account.BannerConfiguration.CreateBuilder(); + if (result.hasBanner) { + subBuilder.MergeFrom(Banner); + } + input.ReadMessage(subBuilder, extensionRegistry); + Banner = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasPlayerIndex { + get { return result.hasPlayerIndex; } + } + public uint PlayerIndex { + get { return result.PlayerIndex; } + set { SetPlayerIndex(value); } + } + public Builder SetPlayerIndex(uint value) { + PrepareBuilder(); + result.hasPlayerIndex = true; + result.playerIndex_ = value; + return this; + } + public Builder ClearPlayerIndex() { + PrepareBuilder(); + result.hasPlayerIndex = false; + result.playerIndex_ = 0; + return this; + } + + public bool HasBanner { + get { return result.hasBanner; } + } + public global::D3.Account.BannerConfiguration Banner { + get { return result.Banner; } + set { SetBanner(value); } + } + public Builder SetBanner(global::D3.Account.BannerConfiguration value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBanner = true; + result.banner_ = value; + return this; + } + public Builder SetBanner(global::D3.Account.BannerConfiguration.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBanner = true; + result.banner_ = builderForValue.Build(); + return this; + } + public Builder MergeBanner(global::D3.Account.BannerConfiguration value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBanner && + result.banner_ != global::D3.Account.BannerConfiguration.DefaultInstance) { + result.banner_ = global::D3.Account.BannerConfiguration.CreateBuilder(result.banner_).MergeFrom(value).BuildPartial(); + } else { + result.banner_ = value; + } + result.hasBanner = true; + return this; + } + public Builder ClearBanner() { + PrepareBuilder(); + result.hasBanner = false; + result.banner_ = null; + return this; + } + } + static PlayerBanner() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class SaveBannerConfiguration : pb::GeneratedMessage { + private SaveBannerConfiguration() { } + private static readonly SaveBannerConfiguration defaultInstance = new SaveBannerConfiguration().MakeReadOnly(); + private static readonly string[] _saveBannerConfigurationFieldNames = new string[] { "banner", "make_active", "slot_index" }; + private static readonly uint[] _saveBannerConfigurationFieldTags = new uint[] { 10, 24, 16 }; + public static SaveBannerConfiguration DefaultInstance { + get { return defaultInstance; } + } + + public override SaveBannerConfiguration DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SaveBannerConfiguration ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_SaveBannerConfiguration__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_SaveBannerConfiguration__FieldAccessorTable; } + } + + public const int BannerFieldNumber = 1; + private bool hasBanner; + private global::D3.Account.BannerConfiguration banner_; + public bool HasBanner { + get { return hasBanner; } + } + public global::D3.Account.BannerConfiguration Banner { + get { return banner_ ?? global::D3.Account.BannerConfiguration.DefaultInstance; } + } + + public const int SlotIndexFieldNumber = 2; + private bool hasSlotIndex; + private uint slotIndex_; + public bool HasSlotIndex { + get { return hasSlotIndex; } + } + public uint SlotIndex { + get { return slotIndex_; } + } + + public const int MakeActiveFieldNumber = 3; + private bool hasMakeActive; + private bool makeActive_ = true; + public bool HasMakeActive { + get { return hasMakeActive; } + } + public bool MakeActive { + get { return makeActive_; } + } + + public override bool IsInitialized { + get { + if (!hasBanner) return false; + if (!Banner.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _saveBannerConfigurationFieldNames; + if (hasBanner) { + output.WriteMessage(1, field_names[0], Banner); + } + if (hasSlotIndex) { + output.WriteUInt32(2, field_names[2], SlotIndex); + } + if (hasMakeActive) { + output.WriteBool(3, field_names[1], MakeActive); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasBanner) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Banner); + } + if (hasSlotIndex) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, SlotIndex); + } + if (hasMakeActive) { + size += pb::CodedOutputStream.ComputeBoolSize(3, MakeActive); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static SaveBannerConfiguration ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SaveBannerConfiguration ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SaveBannerConfiguration ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SaveBannerConfiguration ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SaveBannerConfiguration ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SaveBannerConfiguration ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SaveBannerConfiguration ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SaveBannerConfiguration ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SaveBannerConfiguration ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SaveBannerConfiguration ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SaveBannerConfiguration MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SaveBannerConfiguration prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SaveBannerConfiguration cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SaveBannerConfiguration result; + + private SaveBannerConfiguration PrepareBuilder() { + if (resultIsReadOnly) { + SaveBannerConfiguration original = result; + result = new SaveBannerConfiguration(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SaveBannerConfiguration MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.SaveBannerConfiguration.Descriptor; } + } + + public override SaveBannerConfiguration DefaultInstanceForType { + get { return global::D3.GameMessage.SaveBannerConfiguration.DefaultInstance; } + } + + public override SaveBannerConfiguration BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SaveBannerConfiguration) { + return MergeFrom((SaveBannerConfiguration) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SaveBannerConfiguration other) { + if (other == global::D3.GameMessage.SaveBannerConfiguration.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasBanner) { + MergeBanner(other.Banner); + } + if (other.HasSlotIndex) { + SlotIndex = other.SlotIndex; + } + if (other.HasMakeActive) { + MakeActive = other.MakeActive; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_saveBannerConfigurationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _saveBannerConfigurationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.Account.BannerConfiguration.Builder subBuilder = global::D3.Account.BannerConfiguration.CreateBuilder(); + if (result.hasBanner) { + subBuilder.MergeFrom(Banner); + } + input.ReadMessage(subBuilder, extensionRegistry); + Banner = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasSlotIndex = input.ReadUInt32(ref result.slotIndex_); + break; + } + case 24: { + result.hasMakeActive = input.ReadBool(ref result.makeActive_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasBanner { + get { return result.hasBanner; } + } + public global::D3.Account.BannerConfiguration Banner { + get { return result.Banner; } + set { SetBanner(value); } + } + public Builder SetBanner(global::D3.Account.BannerConfiguration value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBanner = true; + result.banner_ = value; + return this; + } + public Builder SetBanner(global::D3.Account.BannerConfiguration.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBanner = true; + result.banner_ = builderForValue.Build(); + return this; + } + public Builder MergeBanner(global::D3.Account.BannerConfiguration value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBanner && + result.banner_ != global::D3.Account.BannerConfiguration.DefaultInstance) { + result.banner_ = global::D3.Account.BannerConfiguration.CreateBuilder(result.banner_).MergeFrom(value).BuildPartial(); + } else { + result.banner_ = value; + } + result.hasBanner = true; + return this; + } + public Builder ClearBanner() { + PrepareBuilder(); + result.hasBanner = false; + result.banner_ = null; + return this; + } + + public bool HasSlotIndex { + get { return result.hasSlotIndex; } + } + public uint SlotIndex { + get { return result.SlotIndex; } + set { SetSlotIndex(value); } + } + public Builder SetSlotIndex(uint value) { + PrepareBuilder(); + result.hasSlotIndex = true; + result.slotIndex_ = value; + return this; + } + public Builder ClearSlotIndex() { + PrepareBuilder(); + result.hasSlotIndex = false; + result.slotIndex_ = 0; + return this; + } + + public bool HasMakeActive { + get { return result.hasMakeActive; } + } + public bool MakeActive { + get { return result.MakeActive; } + set { SetMakeActive(value); } + } + public Builder SetMakeActive(bool value) { + PrepareBuilder(); + result.hasMakeActive = true; + result.makeActive_ = value; + return this; + } + public Builder ClearMakeActive() { + PrepareBuilder(); + result.hasMakeActive = false; + result.makeActive_ = true; + return this; + } + } + static SaveBannerConfiguration() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class HeroDigestBanner : pb::GeneratedMessage { + private HeroDigestBanner() { } + private static readonly HeroDigestBanner defaultInstance = new HeroDigestBanner().MakeReadOnly(); + private static readonly string[] _heroDigestBannerFieldNames = new string[] { "banner", "hero_digest" }; + private static readonly uint[] _heroDigestBannerFieldTags = new uint[] { 18, 10 }; + public static HeroDigestBanner DefaultInstance { + get { return defaultInstance; } + } + + public override HeroDigestBanner DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override HeroDigestBanner ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_HeroDigestBanner__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_HeroDigestBanner__FieldAccessorTable; } + } + + public const int HeroDigestFieldNumber = 1; + private bool hasHeroDigest; + private global::D3.Hero.Digest heroDigest_; + public bool HasHeroDigest { + get { return hasHeroDigest; } + } + public global::D3.Hero.Digest HeroDigest { + get { return heroDigest_ ?? global::D3.Hero.Digest.DefaultInstance; } + } + + public const int BannerFieldNumber = 2; + private bool hasBanner; + private global::D3.Account.BannerConfiguration banner_; + public bool HasBanner { + get { return hasBanner; } + } + public global::D3.Account.BannerConfiguration Banner { + get { return banner_ ?? global::D3.Account.BannerConfiguration.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasHeroDigest) return false; + if (!hasBanner) return false; + if (!HeroDigest.IsInitialized) return false; + if (!Banner.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _heroDigestBannerFieldNames; + if (hasHeroDigest) { + output.WriteMessage(1, field_names[1], HeroDigest); + } + if (hasBanner) { + output.WriteMessage(2, field_names[0], Banner); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasHeroDigest) { + size += pb::CodedOutputStream.ComputeMessageSize(1, HeroDigest); + } + if (hasBanner) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Banner); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static HeroDigestBanner ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static HeroDigestBanner ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static HeroDigestBanner ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static HeroDigestBanner ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static HeroDigestBanner ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static HeroDigestBanner ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static HeroDigestBanner ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static HeroDigestBanner ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static HeroDigestBanner ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static HeroDigestBanner ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private HeroDigestBanner MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(HeroDigestBanner prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(HeroDigestBanner cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private HeroDigestBanner result; + + private HeroDigestBanner PrepareBuilder() { + if (resultIsReadOnly) { + HeroDigestBanner original = result; + result = new HeroDigestBanner(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override HeroDigestBanner MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.HeroDigestBanner.Descriptor; } + } + + public override HeroDigestBanner DefaultInstanceForType { + get { return global::D3.GameMessage.HeroDigestBanner.DefaultInstance; } + } + + public override HeroDigestBanner BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is HeroDigestBanner) { + return MergeFrom((HeroDigestBanner) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(HeroDigestBanner other) { + if (other == global::D3.GameMessage.HeroDigestBanner.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasHeroDigest) { + MergeHeroDigest(other.HeroDigest); + } + if (other.HasBanner) { + MergeBanner(other.Banner); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_heroDigestBannerFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _heroDigestBannerFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.Hero.Digest.Builder subBuilder = global::D3.Hero.Digest.CreateBuilder(); + if (result.hasHeroDigest) { + subBuilder.MergeFrom(HeroDigest); + } + input.ReadMessage(subBuilder, extensionRegistry); + HeroDigest = subBuilder.BuildPartial(); + break; + } + case 18: { + global::D3.Account.BannerConfiguration.Builder subBuilder = global::D3.Account.BannerConfiguration.CreateBuilder(); + if (result.hasBanner) { + subBuilder.MergeFrom(Banner); + } + input.ReadMessage(subBuilder, extensionRegistry); + Banner = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasHeroDigest { + get { return result.hasHeroDigest; } + } + public global::D3.Hero.Digest HeroDigest { + get { return result.HeroDigest; } + set { SetHeroDigest(value); } + } + public Builder SetHeroDigest(global::D3.Hero.Digest value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasHeroDigest = true; + result.heroDigest_ = value; + return this; + } + public Builder SetHeroDigest(global::D3.Hero.Digest.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasHeroDigest = true; + result.heroDigest_ = builderForValue.Build(); + return this; + } + public Builder MergeHeroDigest(global::D3.Hero.Digest value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasHeroDigest && + result.heroDigest_ != global::D3.Hero.Digest.DefaultInstance) { + result.heroDigest_ = global::D3.Hero.Digest.CreateBuilder(result.heroDigest_).MergeFrom(value).BuildPartial(); + } else { + result.heroDigest_ = value; + } + result.hasHeroDigest = true; + return this; + } + public Builder ClearHeroDigest() { + PrepareBuilder(); + result.hasHeroDigest = false; + result.heroDigest_ = null; + return this; + } + + public bool HasBanner { + get { return result.hasBanner; } + } + public global::D3.Account.BannerConfiguration Banner { + get { return result.Banner; } + set { SetBanner(value); } + } + public Builder SetBanner(global::D3.Account.BannerConfiguration value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBanner = true; + result.banner_ = value; + return this; + } + public Builder SetBanner(global::D3.Account.BannerConfiguration.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBanner = true; + result.banner_ = builderForValue.Build(); + return this; + } + public Builder MergeBanner(global::D3.Account.BannerConfiguration value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBanner && + result.banner_ != global::D3.Account.BannerConfiguration.DefaultInstance) { + result.banner_ = global::D3.Account.BannerConfiguration.CreateBuilder(result.banner_).MergeFrom(value).BuildPartial(); + } else { + result.banner_ = value; + } + result.hasBanner = true; + return this; + } + public Builder ClearBanner() { + PrepareBuilder(); + result.hasBanner = false; + result.banner_ = null; + return this; + } + } + static HeroDigestBanner() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GameCurrentPlayers : pb::GeneratedMessage { + private GameCurrentPlayers() { } + private static readonly GameCurrentPlayers defaultInstance = new GameCurrentPlayers().MakeReadOnly(); + private static readonly string[] _gameCurrentPlayersFieldNames = new string[] { "players" }; + private static readonly uint[] _gameCurrentPlayersFieldTags = new uint[] { 10 }; + public static GameCurrentPlayers DefaultInstance { + get { return defaultInstance; } + } + + public override GameCurrentPlayers DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GameCurrentPlayers ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_GameCurrentPlayers__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_GameCurrentPlayers__FieldAccessorTable; } + } + + public const int PlayersFieldNumber = 1; + private pbc::PopsicleList players_ = new pbc::PopsicleList(); + public scg::IList PlayersList { + get { return players_; } + } + public int PlayersCount { + get { return players_.Count; } + } + public global::D3.GameMessage.HeroDigestBanner GetPlayers(int index) { + return players_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::D3.GameMessage.HeroDigestBanner element in PlayersList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _gameCurrentPlayersFieldNames; + if (players_.Count > 0) { + output.WriteMessageArray(1, field_names[0], players_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::D3.GameMessage.HeroDigestBanner element in PlayersList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GameCurrentPlayers ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GameCurrentPlayers ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GameCurrentPlayers ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GameCurrentPlayers ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GameCurrentPlayers ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GameCurrentPlayers ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GameCurrentPlayers ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GameCurrentPlayers ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GameCurrentPlayers ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GameCurrentPlayers ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GameCurrentPlayers MakeReadOnly() { + players_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GameCurrentPlayers prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GameCurrentPlayers cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GameCurrentPlayers result; + + private GameCurrentPlayers PrepareBuilder() { + if (resultIsReadOnly) { + GameCurrentPlayers original = result; + result = new GameCurrentPlayers(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GameCurrentPlayers MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.GameCurrentPlayers.Descriptor; } + } + + public override GameCurrentPlayers DefaultInstanceForType { + get { return global::D3.GameMessage.GameCurrentPlayers.DefaultInstance; } + } + + public override GameCurrentPlayers BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GameCurrentPlayers) { + return MergeFrom((GameCurrentPlayers) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GameCurrentPlayers other) { + if (other == global::D3.GameMessage.GameCurrentPlayers.DefaultInstance) return this; + PrepareBuilder(); + if (other.players_.Count != 0) { + result.players_.Add(other.players_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_gameCurrentPlayersFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _gameCurrentPlayersFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.players_, global::D3.GameMessage.HeroDigestBanner.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList PlayersList { + get { return PrepareBuilder().players_; } + } + public int PlayersCount { + get { return result.PlayersCount; } + } + public global::D3.GameMessage.HeroDigestBanner GetPlayers(int index) { + return result.GetPlayers(index); + } + public Builder SetPlayers(int index, global::D3.GameMessage.HeroDigestBanner value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.players_[index] = value; + return this; + } + public Builder SetPlayers(int index, global::D3.GameMessage.HeroDigestBanner.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.players_[index] = builderForValue.Build(); + return this; + } + public Builder AddPlayers(global::D3.GameMessage.HeroDigestBanner value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.players_.Add(value); + return this; + } + public Builder AddPlayers(global::D3.GameMessage.HeroDigestBanner.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.players_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangePlayers(scg::IEnumerable values) { + PrepareBuilder(); + result.players_.Add(values); + return this; + } + public Builder ClearPlayers() { + PrepareBuilder(); + result.players_.Clear(); + return this; + } + } + static GameCurrentPlayers() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class AccountVersionList : pb::GeneratedMessage { + private AccountVersionList() { } + private static readonly AccountVersionList defaultInstance = new AccountVersionList().MakeReadOnly(); + private static readonly string[] _accountVersionListFieldNames = new string[] { "account_id", "return_snapshots" }; + private static readonly uint[] _accountVersionListFieldTags = new uint[] { 10, 16 }; + public static AccountVersionList DefaultInstance { + get { return defaultInstance; } + } + + public override AccountVersionList DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override AccountVersionList ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_AccountVersionList__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_AccountVersionList__FieldAccessorTable; } + } + + public const int AccountIdFieldNumber = 1; + private bool hasAccountId; + private global::D3.OnlineService.EntityId accountId_; + public bool HasAccountId { + get { return hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return accountId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public const int ReturnSnapshotsFieldNumber = 2; + private bool hasReturnSnapshots; + private bool returnSnapshots_; + public bool HasReturnSnapshots { + get { return hasReturnSnapshots; } + } + public bool ReturnSnapshots { + get { return returnSnapshots_; } + } + + public override bool IsInitialized { + get { + if (!hasAccountId) return false; + if (!AccountId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _accountVersionListFieldNames; + if (hasAccountId) { + output.WriteMessage(1, field_names[0], AccountId); + } + if (hasReturnSnapshots) { + output.WriteBool(2, field_names[1], ReturnSnapshots); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AccountId); + } + if (hasReturnSnapshots) { + size += pb::CodedOutputStream.ComputeBoolSize(2, ReturnSnapshots); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static AccountVersionList ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AccountVersionList ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AccountVersionList ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AccountVersionList ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AccountVersionList ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AccountVersionList ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static AccountVersionList ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static AccountVersionList ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static AccountVersionList ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AccountVersionList ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private AccountVersionList MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(AccountVersionList prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(AccountVersionList cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private AccountVersionList result; + + private AccountVersionList PrepareBuilder() { + if (resultIsReadOnly) { + AccountVersionList original = result; + result = new AccountVersionList(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override AccountVersionList MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.AccountVersionList.Descriptor; } + } + + public override AccountVersionList DefaultInstanceForType { + get { return global::D3.GameMessage.AccountVersionList.DefaultInstance; } + } + + public override AccountVersionList BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is AccountVersionList) { + return MergeFrom((AccountVersionList) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(AccountVersionList other) { + if (other == global::D3.GameMessage.AccountVersionList.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAccountId) { + MergeAccountId(other.AccountId); + } + if (other.HasReturnSnapshots) { + ReturnSnapshots = other.ReturnSnapshots; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_accountVersionListFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _accountVersionListFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasAccountId) { + subBuilder.MergeFrom(AccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + AccountId = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasReturnSnapshots = input.ReadBool(ref result.returnSnapshots_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAccountId { + get { return result.hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return result.AccountId; } + set { SetAccountId(value); } + } + public Builder SetAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = value; + return this; + } + public Builder SetAccountId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = builderForValue.Build(); + return this; + } + public Builder MergeAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccountId && + result.accountId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.accountId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.accountId_).MergeFrom(value).BuildPartial(); + } else { + result.accountId_ = value; + } + result.hasAccountId = true; + return this; + } + public Builder ClearAccountId() { + PrepareBuilder(); + result.hasAccountId = false; + result.accountId_ = null; + return this; + } + + public bool HasReturnSnapshots { + get { return result.hasReturnSnapshots; } + } + public bool ReturnSnapshots { + get { return result.ReturnSnapshots; } + set { SetReturnSnapshots(value); } + } + public Builder SetReturnSnapshots(bool value) { + PrepareBuilder(); + result.hasReturnSnapshots = true; + result.returnSnapshots_ = value; + return this; + } + public Builder ClearReturnSnapshots() { + PrepareBuilder(); + result.hasReturnSnapshots = false; + result.returnSnapshots_ = false; + return this; + } + } + static AccountVersionList() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class AccountVersionSync : pb::GeneratedMessage { + private AccountVersionSync() { } + private static readonly AccountVersionSync defaultInstance = new AccountVersionSync().MakeReadOnly(); + private static readonly string[] _accountVersionSyncFieldNames = new string[] { "account_id", "version" }; + private static readonly uint[] _accountVersionSyncFieldTags = new uint[] { 10, 16 }; + public static AccountVersionSync DefaultInstance { + get { return defaultInstance; } + } + + public override AccountVersionSync DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override AccountVersionSync ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_AccountVersionSync__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_AccountVersionSync__FieldAccessorTable; } + } + + public const int AccountIdFieldNumber = 1; + private bool hasAccountId; + private global::D3.OnlineService.EntityId accountId_; + public bool HasAccountId { + get { return hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return accountId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public const int VersionFieldNumber = 2; + private bool hasVersion; + private ulong version_; + public bool HasVersion { + get { return hasVersion; } + } + public ulong Version { + get { return version_; } + } + + public override bool IsInitialized { + get { + if (!hasAccountId) return false; + if (!hasVersion) return false; + if (!AccountId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _accountVersionSyncFieldNames; + if (hasAccountId) { + output.WriteMessage(1, field_names[0], AccountId); + } + if (hasVersion) { + output.WriteUInt64(2, field_names[1], Version); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AccountId); + } + if (hasVersion) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, Version); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static AccountVersionSync ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AccountVersionSync ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AccountVersionSync ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AccountVersionSync ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AccountVersionSync ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AccountVersionSync ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static AccountVersionSync ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static AccountVersionSync ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static AccountVersionSync ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AccountVersionSync ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private AccountVersionSync MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(AccountVersionSync prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(AccountVersionSync cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private AccountVersionSync result; + + private AccountVersionSync PrepareBuilder() { + if (resultIsReadOnly) { + AccountVersionSync original = result; + result = new AccountVersionSync(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override AccountVersionSync MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.AccountVersionSync.Descriptor; } + } + + public override AccountVersionSync DefaultInstanceForType { + get { return global::D3.GameMessage.AccountVersionSync.DefaultInstance; } + } + + public override AccountVersionSync BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is AccountVersionSync) { + return MergeFrom((AccountVersionSync) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(AccountVersionSync other) { + if (other == global::D3.GameMessage.AccountVersionSync.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAccountId) { + MergeAccountId(other.AccountId); + } + if (other.HasVersion) { + Version = other.Version; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_accountVersionSyncFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _accountVersionSyncFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasAccountId) { + subBuilder.MergeFrom(AccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + AccountId = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasVersion = input.ReadUInt64(ref result.version_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAccountId { + get { return result.hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return result.AccountId; } + set { SetAccountId(value); } + } + public Builder SetAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = value; + return this; + } + public Builder SetAccountId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = builderForValue.Build(); + return this; + } + public Builder MergeAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccountId && + result.accountId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.accountId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.accountId_).MergeFrom(value).BuildPartial(); + } else { + result.accountId_ = value; + } + result.hasAccountId = true; + return this; + } + public Builder ClearAccountId() { + PrepareBuilder(); + result.hasAccountId = false; + result.accountId_ = null; + return this; + } + + public bool HasVersion { + get { return result.hasVersion; } + } + public ulong Version { + get { return result.Version; } + set { SetVersion(value); } + } + public Builder SetVersion(ulong value) { + PrepareBuilder(); + result.hasVersion = true; + result.version_ = value; + return this; + } + public Builder ClearVersion() { + PrepareBuilder(); + result.hasVersion = false; + result.version_ = 0UL; + return this; + } + } + static AccountVersionSync() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class TooltipIds : pb::GeneratedMessage { + private TooltipIds() { } + private static readonly TooltipIds defaultInstance = new TooltipIds().MakeReadOnly(); + private static readonly string[] _tooltipIdsFieldNames = new string[] { "ids", "locale" }; + private static readonly uint[] _tooltipIdsFieldTags = new uint[] { 18, 8 }; + public static TooltipIds DefaultInstance { + get { return defaultInstance; } + } + + public override TooltipIds DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override TooltipIds ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_TooltipIds__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_TooltipIds__FieldAccessorTable; } + } + + public const int LocaleFieldNumber = 1; + private bool hasLocale; + private uint locale_; + public bool HasLocale { + get { return hasLocale; } + } + public uint Locale { + get { return locale_; } + } + + public const int IdsFieldNumber = 2; + private pbc::PopsicleList ids_ = new pbc::PopsicleList(); + public scg::IList IdsList { + get { return ids_; } + } + public int IdsCount { + get { return ids_.Count; } + } + public global::D3.OnlineService.ItemId GetIds(int index) { + return ids_[index]; + } + + public override bool IsInitialized { + get { + if (!hasLocale) return false; + foreach (global::D3.OnlineService.ItemId element in IdsList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _tooltipIdsFieldNames; + if (hasLocale) { + output.WriteUInt32(1, field_names[1], Locale); + } + if (ids_.Count > 0) { + output.WriteMessageArray(2, field_names[0], ids_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasLocale) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, Locale); + } + foreach (global::D3.OnlineService.ItemId element in IdsList) { + size += pb::CodedOutputStream.ComputeMessageSize(2, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static TooltipIds ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TooltipIds ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TooltipIds ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TooltipIds ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TooltipIds ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TooltipIds ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static TooltipIds ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static TooltipIds ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static TooltipIds ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TooltipIds ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private TooltipIds MakeReadOnly() { + ids_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(TooltipIds prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(TooltipIds cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private TooltipIds result; + + private TooltipIds PrepareBuilder() { + if (resultIsReadOnly) { + TooltipIds original = result; + result = new TooltipIds(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override TooltipIds MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.TooltipIds.Descriptor; } + } + + public override TooltipIds DefaultInstanceForType { + get { return global::D3.GameMessage.TooltipIds.DefaultInstance; } + } + + public override TooltipIds BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is TooltipIds) { + return MergeFrom((TooltipIds) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(TooltipIds other) { + if (other == global::D3.GameMessage.TooltipIds.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasLocale) { + Locale = other.Locale; + } + if (other.ids_.Count != 0) { + result.ids_.Add(other.ids_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_tooltipIdsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _tooltipIdsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasLocale = input.ReadUInt32(ref result.locale_); + break; + } + case 18: { + input.ReadMessageArray(tag, field_name, result.ids_, global::D3.OnlineService.ItemId.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasLocale { + get { return result.hasLocale; } + } + public uint Locale { + get { return result.Locale; } + set { SetLocale(value); } + } + public Builder SetLocale(uint value) { + PrepareBuilder(); + result.hasLocale = true; + result.locale_ = value; + return this; + } + public Builder ClearLocale() { + PrepareBuilder(); + result.hasLocale = false; + result.locale_ = 0; + return this; + } + + public pbc::IPopsicleList IdsList { + get { return PrepareBuilder().ids_; } + } + public int IdsCount { + get { return result.IdsCount; } + } + public global::D3.OnlineService.ItemId GetIds(int index) { + return result.GetIds(index); + } + public Builder SetIds(int index, global::D3.OnlineService.ItemId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.ids_[index] = value; + return this; + } + public Builder SetIds(int index, global::D3.OnlineService.ItemId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.ids_[index] = builderForValue.Build(); + return this; + } + public Builder AddIds(global::D3.OnlineService.ItemId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.ids_.Add(value); + return this; + } + public Builder AddIds(global::D3.OnlineService.ItemId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.ids_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeIds(scg::IEnumerable values) { + PrepareBuilder(); + result.ids_.Add(values); + return this; + } + public Builder ClearIds() { + PrepareBuilder(); + result.ids_.Clear(); + return this; + } + } + static TooltipIds() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class TooltipGenerators : pb::GeneratedMessage { + private TooltipGenerators() { } + private static readonly TooltipGenerators defaultInstance = new TooltipGenerators().MakeReadOnly(); + private static readonly string[] _tooltipGeneratorsFieldNames = new string[] { "items", "locale" }; + private static readonly uint[] _tooltipGeneratorsFieldTags = new uint[] { 18, 8 }; + public static TooltipGenerators DefaultInstance { + get { return defaultInstance; } + } + + public override TooltipGenerators DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override TooltipGenerators ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_TooltipGenerators__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_TooltipGenerators__FieldAccessorTable; } + } + + public const int LocaleFieldNumber = 1; + private bool hasLocale; + private uint locale_; + public bool HasLocale { + get { return hasLocale; } + } + public uint Locale { + get { return locale_; } + } + + public const int ItemsFieldNumber = 2; + private bool hasItems; + private global::D3.Items.ItemList items_; + public bool HasItems { + get { return hasItems; } + } + public global::D3.Items.ItemList Items { + get { return items_ ?? global::D3.Items.ItemList.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasLocale) return false; + if (!hasItems) return false; + if (!Items.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _tooltipGeneratorsFieldNames; + if (hasLocale) { + output.WriteUInt32(1, field_names[1], Locale); + } + if (hasItems) { + output.WriteMessage(2, field_names[0], Items); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasLocale) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, Locale); + } + if (hasItems) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Items); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static TooltipGenerators ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TooltipGenerators ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TooltipGenerators ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TooltipGenerators ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TooltipGenerators ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TooltipGenerators ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static TooltipGenerators ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static TooltipGenerators ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static TooltipGenerators ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TooltipGenerators ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private TooltipGenerators MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(TooltipGenerators prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(TooltipGenerators cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private TooltipGenerators result; + + private TooltipGenerators PrepareBuilder() { + if (resultIsReadOnly) { + TooltipGenerators original = result; + result = new TooltipGenerators(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override TooltipGenerators MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.TooltipGenerators.Descriptor; } + } + + public override TooltipGenerators DefaultInstanceForType { + get { return global::D3.GameMessage.TooltipGenerators.DefaultInstance; } + } + + public override TooltipGenerators BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is TooltipGenerators) { + return MergeFrom((TooltipGenerators) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(TooltipGenerators other) { + if (other == global::D3.GameMessage.TooltipGenerators.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasLocale) { + Locale = other.Locale; + } + if (other.HasItems) { + MergeItems(other.Items); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_tooltipGeneratorsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _tooltipGeneratorsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasLocale = input.ReadUInt32(ref result.locale_); + break; + } + case 18: { + global::D3.Items.ItemList.Builder subBuilder = global::D3.Items.ItemList.CreateBuilder(); + if (result.hasItems) { + subBuilder.MergeFrom(Items); + } + input.ReadMessage(subBuilder, extensionRegistry); + Items = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasLocale { + get { return result.hasLocale; } + } + public uint Locale { + get { return result.Locale; } + set { SetLocale(value); } + } + public Builder SetLocale(uint value) { + PrepareBuilder(); + result.hasLocale = true; + result.locale_ = value; + return this; + } + public Builder ClearLocale() { + PrepareBuilder(); + result.hasLocale = false; + result.locale_ = 0; + return this; + } + + public bool HasItems { + get { return result.hasItems; } + } + public global::D3.Items.ItemList Items { + get { return result.Items; } + set { SetItems(value); } + } + public Builder SetItems(global::D3.Items.ItemList value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasItems = true; + result.items_ = value; + return this; + } + public Builder SetItems(global::D3.Items.ItemList.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasItems = true; + result.items_ = builderForValue.Build(); + return this; + } + public Builder MergeItems(global::D3.Items.ItemList value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasItems && + result.items_ != global::D3.Items.ItemList.DefaultInstance) { + result.items_ = global::D3.Items.ItemList.CreateBuilder(result.items_).MergeFrom(value).BuildPartial(); + } else { + result.items_ = value; + } + result.hasItems = true; + return this; + } + public Builder ClearItems() { + PrepareBuilder(); + result.hasItems = false; + result.items_ = null; + return this; + } + } + static TooltipGenerators() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class TutorialMessage : pb::GeneratedMessage { + private TutorialMessage() { } + private static readonly TutorialMessage defaultInstance = new TutorialMessage().MakeReadOnly(); + private static readonly string[] _tutorialMessageFieldNames = new string[] { "tutorial_sno", "ui_anchor_name" }; + private static readonly uint[] _tutorialMessageFieldTags = new uint[] { 8, 18 }; + public static TutorialMessage DefaultInstance { + get { return defaultInstance; } + } + + public override TutorialMessage DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override TutorialMessage ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_TutorialMessage__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_TutorialMessage__FieldAccessorTable; } + } + + public const int TutorialSnoFieldNumber = 1; + private bool hasTutorialSno; + private uint tutorialSno_; + public bool HasTutorialSno { + get { return hasTutorialSno; } + } + public uint TutorialSno { + get { return tutorialSno_; } + } + + public const int UiAnchorNameFieldNumber = 2; + private bool hasUiAnchorName; + private string uiAnchorName_ = ""; + public bool HasUiAnchorName { + get { return hasUiAnchorName; } + } + public string UiAnchorName { + get { return uiAnchorName_; } + } + + public override bool IsInitialized { + get { + if (!hasTutorialSno) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _tutorialMessageFieldNames; + if (hasTutorialSno) { + output.WriteUInt32(1, field_names[0], TutorialSno); + } + if (hasUiAnchorName) { + output.WriteString(2, field_names[1], UiAnchorName); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTutorialSno) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, TutorialSno); + } + if (hasUiAnchorName) { + size += pb::CodedOutputStream.ComputeStringSize(2, UiAnchorName); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static TutorialMessage ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TutorialMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TutorialMessage ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TutorialMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TutorialMessage ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TutorialMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static TutorialMessage ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static TutorialMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static TutorialMessage ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TutorialMessage ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private TutorialMessage MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(TutorialMessage prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(TutorialMessage cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private TutorialMessage result; + + private TutorialMessage PrepareBuilder() { + if (resultIsReadOnly) { + TutorialMessage original = result; + result = new TutorialMessage(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override TutorialMessage MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.TutorialMessage.Descriptor; } + } + + public override TutorialMessage DefaultInstanceForType { + get { return global::D3.GameMessage.TutorialMessage.DefaultInstance; } + } + + public override TutorialMessage BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is TutorialMessage) { + return MergeFrom((TutorialMessage) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(TutorialMessage other) { + if (other == global::D3.GameMessage.TutorialMessage.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTutorialSno) { + TutorialSno = other.TutorialSno; + } + if (other.HasUiAnchorName) { + UiAnchorName = other.UiAnchorName; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_tutorialMessageFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _tutorialMessageFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasTutorialSno = input.ReadUInt32(ref result.tutorialSno_); + break; + } + case 18: { + result.hasUiAnchorName = input.ReadString(ref result.uiAnchorName_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTutorialSno { + get { return result.hasTutorialSno; } + } + public uint TutorialSno { + get { return result.TutorialSno; } + set { SetTutorialSno(value); } + } + public Builder SetTutorialSno(uint value) { + PrepareBuilder(); + result.hasTutorialSno = true; + result.tutorialSno_ = value; + return this; + } + public Builder ClearTutorialSno() { + PrepareBuilder(); + result.hasTutorialSno = false; + result.tutorialSno_ = 0; + return this; + } + + public bool HasUiAnchorName { + get { return result.hasUiAnchorName; } + } + public string UiAnchorName { + get { return result.UiAnchorName; } + set { SetUiAnchorName(value); } + } + public Builder SetUiAnchorName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasUiAnchorName = true; + result.uiAnchorName_ = value; + return this; + } + public Builder ClearUiAnchorName() { + PrepareBuilder(); + result.hasUiAnchorName = false; + result.uiAnchorName_ = ""; + return this; + } + } + static TutorialMessage() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class TutorialState : pb::GeneratedMessage { + private TutorialState() { } + private static readonly TutorialState defaultInstance = new TutorialState().MakeReadOnly(); + private static readonly string[] _tutorialStateFieldNames = new string[] { "seen_tutorials" }; + private static readonly uint[] _tutorialStateFieldTags = new uint[] { 10 }; + public static TutorialState DefaultInstance { + get { return defaultInstance; } + } + + public override TutorialState DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override TutorialState ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_TutorialState__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_TutorialState__FieldAccessorTable; } + } + + public const int SeenTutorialsFieldNumber = 1; + private bool hasSeenTutorials; + private pb::ByteString seenTutorials_ = pb::ByteString.Empty; + public bool HasSeenTutorials { + get { return hasSeenTutorials; } + } + public pb::ByteString SeenTutorials { + get { return seenTutorials_; } + } + + public override bool IsInitialized { + get { + if (!hasSeenTutorials) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _tutorialStateFieldNames; + if (hasSeenTutorials) { + output.WriteBytes(1, field_names[0], SeenTutorials); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasSeenTutorials) { + size += pb::CodedOutputStream.ComputeBytesSize(1, SeenTutorials); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static TutorialState ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TutorialState ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TutorialState ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TutorialState ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TutorialState ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TutorialState ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static TutorialState ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static TutorialState ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static TutorialState ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TutorialState ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private TutorialState MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(TutorialState prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(TutorialState cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private TutorialState result; + + private TutorialState PrepareBuilder() { + if (resultIsReadOnly) { + TutorialState original = result; + result = new TutorialState(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override TutorialState MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.TutorialState.Descriptor; } + } + + public override TutorialState DefaultInstanceForType { + get { return global::D3.GameMessage.TutorialState.DefaultInstance; } + } + + public override TutorialState BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is TutorialState) { + return MergeFrom((TutorialState) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(TutorialState other) { + if (other == global::D3.GameMessage.TutorialState.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasSeenTutorials) { + SeenTutorials = other.SeenTutorials; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_tutorialStateFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _tutorialStateFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasSeenTutorials = input.ReadBytes(ref result.seenTutorials_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasSeenTutorials { + get { return result.hasSeenTutorials; } + } + public pb::ByteString SeenTutorials { + get { return result.SeenTutorials; } + set { SetSeenTutorials(value); } + } + public Builder SetSeenTutorials(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasSeenTutorials = true; + result.seenTutorials_ = value; + return this; + } + public Builder ClearSeenTutorials() { + PrepareBuilder(); + result.hasSeenTutorials = false; + result.seenTutorials_ = pb::ByteString.Empty; + return this; + } + } + static TutorialState() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class DeleteHero : pb::GeneratedMessage { + private DeleteHero() { } + private static readonly DeleteHero defaultInstance = new DeleteHero().MakeReadOnly(); + private static readonly string[] _deleteHeroFieldNames = new string[] { "hero_id" }; + private static readonly uint[] _deleteHeroFieldTags = new uint[] { 10 }; + public static DeleteHero DefaultInstance { + get { return defaultInstance; } + } + + public override DeleteHero DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override DeleteHero ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_DeleteHero__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_DeleteHero__FieldAccessorTable; } + } + + public const int HeroIdFieldNumber = 1; + private bool hasHeroId; + private global::D3.OnlineService.EntityId heroId_; + public bool HasHeroId { + get { return hasHeroId; } + } + public global::D3.OnlineService.EntityId HeroId { + get { return heroId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasHeroId) return false; + if (!HeroId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _deleteHeroFieldNames; + if (hasHeroId) { + output.WriteMessage(1, field_names[0], HeroId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasHeroId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, HeroId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static DeleteHero ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DeleteHero ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DeleteHero ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DeleteHero ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DeleteHero ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DeleteHero ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static DeleteHero ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static DeleteHero ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static DeleteHero ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DeleteHero ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private DeleteHero MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(DeleteHero prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(DeleteHero cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private DeleteHero result; + + private DeleteHero PrepareBuilder() { + if (resultIsReadOnly) { + DeleteHero original = result; + result = new DeleteHero(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override DeleteHero MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.DeleteHero.Descriptor; } + } + + public override DeleteHero DefaultInstanceForType { + get { return global::D3.GameMessage.DeleteHero.DefaultInstance; } + } + + public override DeleteHero BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is DeleteHero) { + return MergeFrom((DeleteHero) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(DeleteHero other) { + if (other == global::D3.GameMessage.DeleteHero.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasHeroId) { + MergeHeroId(other.HeroId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_deleteHeroFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _deleteHeroFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasHeroId) { + subBuilder.MergeFrom(HeroId); + } + input.ReadMessage(subBuilder, extensionRegistry); + HeroId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasHeroId { + get { return result.hasHeroId; } + } + public global::D3.OnlineService.EntityId HeroId { + get { return result.HeroId; } + set { SetHeroId(value); } + } + public Builder SetHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasHeroId = true; + result.heroId_ = value; + return this; + } + public Builder SetHeroId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasHeroId = true; + result.heroId_ = builderForValue.Build(); + return this; + } + public Builder MergeHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasHeroId && + result.heroId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.heroId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.heroId_).MergeFrom(value).BuildPartial(); + } else { + result.heroId_ = value; + } + result.hasHeroId = true; + return this; + } + public Builder ClearHeroId() { + PrepareBuilder(); + result.hasHeroId = false; + result.heroId_ = null; + return this; + } + } + static DeleteHero() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class UndeleteHero : pb::GeneratedMessage { + private UndeleteHero() { } + private static readonly UndeleteHero defaultInstance = new UndeleteHero().MakeReadOnly(); + private static readonly string[] _undeleteHeroFieldNames = new string[] { "replace_hero_id", "undelete_hero_id" }; + private static readonly uint[] _undeleteHeroFieldTags = new uint[] { 18, 10 }; + public static UndeleteHero DefaultInstance { + get { return defaultInstance; } + } + + public override UndeleteHero DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override UndeleteHero ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_UndeleteHero__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_UndeleteHero__FieldAccessorTable; } + } + + public const int UndeleteHeroIdFieldNumber = 1; + private bool hasUndeleteHeroId; + private global::D3.OnlineService.EntityId undeleteHeroId_; + public bool HasUndeleteHeroId { + get { return hasUndeleteHeroId; } + } + public global::D3.OnlineService.EntityId UndeleteHeroId { + get { return undeleteHeroId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public const int ReplaceHeroIdFieldNumber = 2; + private bool hasReplaceHeroId; + private global::D3.OnlineService.EntityId replaceHeroId_; + public bool HasReplaceHeroId { + get { return hasReplaceHeroId; } + } + public global::D3.OnlineService.EntityId ReplaceHeroId { + get { return replaceHeroId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasUndeleteHeroId) return false; + if (!UndeleteHeroId.IsInitialized) return false; + if (HasReplaceHeroId) { + if (!ReplaceHeroId.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _undeleteHeroFieldNames; + if (hasUndeleteHeroId) { + output.WriteMessage(1, field_names[1], UndeleteHeroId); + } + if (hasReplaceHeroId) { + output.WriteMessage(2, field_names[0], ReplaceHeroId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasUndeleteHeroId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, UndeleteHeroId); + } + if (hasReplaceHeroId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, ReplaceHeroId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static UndeleteHero ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UndeleteHero ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UndeleteHero ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UndeleteHero ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UndeleteHero ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UndeleteHero ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static UndeleteHero ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static UndeleteHero ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static UndeleteHero ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UndeleteHero ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private UndeleteHero MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(UndeleteHero prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(UndeleteHero cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private UndeleteHero result; + + private UndeleteHero PrepareBuilder() { + if (resultIsReadOnly) { + UndeleteHero original = result; + result = new UndeleteHero(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override UndeleteHero MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.UndeleteHero.Descriptor; } + } + + public override UndeleteHero DefaultInstanceForType { + get { return global::D3.GameMessage.UndeleteHero.DefaultInstance; } + } + + public override UndeleteHero BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is UndeleteHero) { + return MergeFrom((UndeleteHero) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(UndeleteHero other) { + if (other == global::D3.GameMessage.UndeleteHero.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasUndeleteHeroId) { + MergeUndeleteHeroId(other.UndeleteHeroId); + } + if (other.HasReplaceHeroId) { + MergeReplaceHeroId(other.ReplaceHeroId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_undeleteHeroFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _undeleteHeroFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasUndeleteHeroId) { + subBuilder.MergeFrom(UndeleteHeroId); + } + input.ReadMessage(subBuilder, extensionRegistry); + UndeleteHeroId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasReplaceHeroId) { + subBuilder.MergeFrom(ReplaceHeroId); + } + input.ReadMessage(subBuilder, extensionRegistry); + ReplaceHeroId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasUndeleteHeroId { + get { return result.hasUndeleteHeroId; } + } + public global::D3.OnlineService.EntityId UndeleteHeroId { + get { return result.UndeleteHeroId; } + set { SetUndeleteHeroId(value); } + } + public Builder SetUndeleteHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasUndeleteHeroId = true; + result.undeleteHeroId_ = value; + return this; + } + public Builder SetUndeleteHeroId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasUndeleteHeroId = true; + result.undeleteHeroId_ = builderForValue.Build(); + return this; + } + public Builder MergeUndeleteHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasUndeleteHeroId && + result.undeleteHeroId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.undeleteHeroId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.undeleteHeroId_).MergeFrom(value).BuildPartial(); + } else { + result.undeleteHeroId_ = value; + } + result.hasUndeleteHeroId = true; + return this; + } + public Builder ClearUndeleteHeroId() { + PrepareBuilder(); + result.hasUndeleteHeroId = false; + result.undeleteHeroId_ = null; + return this; + } + + public bool HasReplaceHeroId { + get { return result.hasReplaceHeroId; } + } + public global::D3.OnlineService.EntityId ReplaceHeroId { + get { return result.ReplaceHeroId; } + set { SetReplaceHeroId(value); } + } + public Builder SetReplaceHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasReplaceHeroId = true; + result.replaceHeroId_ = value; + return this; + } + public Builder SetReplaceHeroId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasReplaceHeroId = true; + result.replaceHeroId_ = builderForValue.Build(); + return this; + } + public Builder MergeReplaceHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasReplaceHeroId && + result.replaceHeroId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.replaceHeroId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.replaceHeroId_).MergeFrom(value).BuildPartial(); + } else { + result.replaceHeroId_ = value; + } + result.hasReplaceHeroId = true; + return this; + } + public Builder ClearReplaceHeroId() { + PrepareBuilder(); + result.hasReplaceHeroId = false; + result.replaceHeroId_ = null; + return this; + } + } + static UndeleteHero() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetFallenHeros : pb::GeneratedMessage { + private GetFallenHeros() { } + private static readonly GetFallenHeros defaultInstance = new GetFallenHeros().MakeReadOnly(); + private static readonly string[] _getFallenHerosFieldNames = new string[] { "account_id" }; + private static readonly uint[] _getFallenHerosFieldTags = new uint[] { 10 }; + public static GetFallenHeros DefaultInstance { + get { return defaultInstance; } + } + + public override GetFallenHeros DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetFallenHeros ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_GetFallenHeros__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_GetFallenHeros__FieldAccessorTable; } + } + + public const int AccountIdFieldNumber = 1; + private bool hasAccountId; + private global::D3.OnlineService.EntityId accountId_; + public bool HasAccountId { + get { return hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return accountId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasAccountId) return false; + if (!AccountId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getFallenHerosFieldNames; + if (hasAccountId) { + output.WriteMessage(1, field_names[0], AccountId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AccountId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetFallenHeros ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetFallenHeros ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetFallenHeros ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetFallenHeros ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetFallenHeros ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetFallenHeros ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetFallenHeros ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetFallenHeros ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetFallenHeros ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetFallenHeros ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetFallenHeros MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetFallenHeros prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetFallenHeros cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetFallenHeros result; + + private GetFallenHeros PrepareBuilder() { + if (resultIsReadOnly) { + GetFallenHeros original = result; + result = new GetFallenHeros(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetFallenHeros MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.GetFallenHeros.Descriptor; } + } + + public override GetFallenHeros DefaultInstanceForType { + get { return global::D3.GameMessage.GetFallenHeros.DefaultInstance; } + } + + public override GetFallenHeros BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetFallenHeros) { + return MergeFrom((GetFallenHeros) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetFallenHeros other) { + if (other == global::D3.GameMessage.GetFallenHeros.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAccountId) { + MergeAccountId(other.AccountId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getFallenHerosFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getFallenHerosFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasAccountId) { + subBuilder.MergeFrom(AccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + AccountId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAccountId { + get { return result.hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return result.AccountId; } + set { SetAccountId(value); } + } + public Builder SetAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = value; + return this; + } + public Builder SetAccountId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = builderForValue.Build(); + return this; + } + public Builder MergeAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccountId && + result.accountId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.accountId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.accountId_).MergeFrom(value).BuildPartial(); + } else { + result.accountId_ = value; + } + result.hasAccountId = true; + return this; + } + public Builder ClearAccountId() { + PrepareBuilder(); + result.hasAccountId = false; + result.accountId_ = null; + return this; + } + } + static GetFallenHeros() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ArchiveHardcore : pb::GeneratedMessage { + private ArchiveHardcore() { } + private static readonly ArchiveHardcore defaultInstance = new ArchiveHardcore().MakeReadOnly(); + private static readonly string[] _archiveHardcoreFieldNames = new string[] { "epitaph", "hero_id" }; + private static readonly uint[] _archiveHardcoreFieldTags = new uint[] { 18, 10 }; + public static ArchiveHardcore DefaultInstance { + get { return defaultInstance; } + } + + public override ArchiveHardcore DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ArchiveHardcore ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_ArchiveHardcore__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_ArchiveHardcore__FieldAccessorTable; } + } + + public const int HeroIdFieldNumber = 1; + private bool hasHeroId; + private global::D3.OnlineService.EntityId heroId_; + public bool HasHeroId { + get { return hasHeroId; } + } + public global::D3.OnlineService.EntityId HeroId { + get { return heroId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public const int EpitaphFieldNumber = 2; + private bool hasEpitaph; + private string epitaph_ = ""; + public bool HasEpitaph { + get { return hasEpitaph; } + } + public string Epitaph { + get { return epitaph_; } + } + + public override bool IsInitialized { + get { + if (!hasHeroId) return false; + if (!hasEpitaph) return false; + if (!HeroId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _archiveHardcoreFieldNames; + if (hasHeroId) { + output.WriteMessage(1, field_names[1], HeroId); + } + if (hasEpitaph) { + output.WriteString(2, field_names[0], Epitaph); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasHeroId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, HeroId); + } + if (hasEpitaph) { + size += pb::CodedOutputStream.ComputeStringSize(2, Epitaph); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ArchiveHardcore ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ArchiveHardcore ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ArchiveHardcore ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ArchiveHardcore ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ArchiveHardcore ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ArchiveHardcore ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ArchiveHardcore ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ArchiveHardcore ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ArchiveHardcore ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ArchiveHardcore ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ArchiveHardcore MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ArchiveHardcore prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ArchiveHardcore cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ArchiveHardcore result; + + private ArchiveHardcore PrepareBuilder() { + if (resultIsReadOnly) { + ArchiveHardcore original = result; + result = new ArchiveHardcore(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ArchiveHardcore MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.ArchiveHardcore.Descriptor; } + } + + public override ArchiveHardcore DefaultInstanceForType { + get { return global::D3.GameMessage.ArchiveHardcore.DefaultInstance; } + } + + public override ArchiveHardcore BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ArchiveHardcore) { + return MergeFrom((ArchiveHardcore) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ArchiveHardcore other) { + if (other == global::D3.GameMessage.ArchiveHardcore.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasHeroId) { + MergeHeroId(other.HeroId); + } + if (other.HasEpitaph) { + Epitaph = other.Epitaph; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_archiveHardcoreFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _archiveHardcoreFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasHeroId) { + subBuilder.MergeFrom(HeroId); + } + input.ReadMessage(subBuilder, extensionRegistry); + HeroId = subBuilder.BuildPartial(); + break; + } + case 18: { + result.hasEpitaph = input.ReadString(ref result.epitaph_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasHeroId { + get { return result.hasHeroId; } + } + public global::D3.OnlineService.EntityId HeroId { + get { return result.HeroId; } + set { SetHeroId(value); } + } + public Builder SetHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasHeroId = true; + result.heroId_ = value; + return this; + } + public Builder SetHeroId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasHeroId = true; + result.heroId_ = builderForValue.Build(); + return this; + } + public Builder MergeHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasHeroId && + result.heroId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.heroId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.heroId_).MergeFrom(value).BuildPartial(); + } else { + result.heroId_ = value; + } + result.hasHeroId = true; + return this; + } + public Builder ClearHeroId() { + PrepareBuilder(); + result.hasHeroId = false; + result.heroId_ = null; + return this; + } + + public bool HasEpitaph { + get { return result.hasEpitaph; } + } + public string Epitaph { + get { return result.Epitaph; } + set { SetEpitaph(value); } + } + public Builder SetEpitaph(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasEpitaph = true; + result.epitaph_ = value; + return this; + } + public Builder ClearEpitaph() { + PrepareBuilder(); + result.hasEpitaph = false; + result.epitaph_ = ""; + return this; + } + } + static ArchiveHardcore() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class DeleteFallenHero : pb::GeneratedMessage { + private DeleteFallenHero() { } + private static readonly DeleteFallenHero defaultInstance = new DeleteFallenHero().MakeReadOnly(); + private static readonly string[] _deleteFallenHeroFieldNames = new string[] { "hero_id" }; + private static readonly uint[] _deleteFallenHeroFieldTags = new uint[] { 10 }; + public static DeleteFallenHero DefaultInstance { + get { return defaultInstance; } + } + + public override DeleteFallenHero DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override DeleteFallenHero ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_DeleteFallenHero__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_DeleteFallenHero__FieldAccessorTable; } + } + + public const int HeroIdFieldNumber = 1; + private bool hasHeroId; + private global::D3.OnlineService.EntityId heroId_; + public bool HasHeroId { + get { return hasHeroId; } + } + public global::D3.OnlineService.EntityId HeroId { + get { return heroId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasHeroId) return false; + if (!HeroId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _deleteFallenHeroFieldNames; + if (hasHeroId) { + output.WriteMessage(1, field_names[0], HeroId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasHeroId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, HeroId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static DeleteFallenHero ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DeleteFallenHero ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DeleteFallenHero ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DeleteFallenHero ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DeleteFallenHero ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DeleteFallenHero ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static DeleteFallenHero ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static DeleteFallenHero ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static DeleteFallenHero ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DeleteFallenHero ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private DeleteFallenHero MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(DeleteFallenHero prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(DeleteFallenHero cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private DeleteFallenHero result; + + private DeleteFallenHero PrepareBuilder() { + if (resultIsReadOnly) { + DeleteFallenHero original = result; + result = new DeleteFallenHero(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override DeleteFallenHero MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.DeleteFallenHero.Descriptor; } + } + + public override DeleteFallenHero DefaultInstanceForType { + get { return global::D3.GameMessage.DeleteFallenHero.DefaultInstance; } + } + + public override DeleteFallenHero BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is DeleteFallenHero) { + return MergeFrom((DeleteFallenHero) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(DeleteFallenHero other) { + if (other == global::D3.GameMessage.DeleteFallenHero.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasHeroId) { + MergeHeroId(other.HeroId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_deleteFallenHeroFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _deleteFallenHeroFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasHeroId) { + subBuilder.MergeFrom(HeroId); + } + input.ReadMessage(subBuilder, extensionRegistry); + HeroId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasHeroId { + get { return result.hasHeroId; } + } + public global::D3.OnlineService.EntityId HeroId { + get { return result.HeroId; } + set { SetHeroId(value); } + } + public Builder SetHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasHeroId = true; + result.heroId_ = value; + return this; + } + public Builder SetHeroId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasHeroId = true; + result.heroId_ = builderForValue.Build(); + return this; + } + public Builder MergeHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasHeroId && + result.heroId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.heroId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.heroId_).MergeFrom(value).BuildPartial(); + } else { + result.heroId_ = value; + } + result.hasHeroId = true; + return this; + } + public Builder ClearHeroId() { + PrepareBuilder(); + result.hasHeroId = false; + result.heroId_ = null; + return this; + } + } + static DeleteFallenHero() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ServerDeleteHero : pb::GeneratedMessage { + private ServerDeleteHero() { } + private static readonly ServerDeleteHero defaultInstance = new ServerDeleteHero().MakeReadOnly(); + private static readonly string[] _serverDeleteHeroFieldNames = new string[] { "account_id", "hero_id" }; + private static readonly uint[] _serverDeleteHeroFieldTags = new uint[] { 10, 18 }; + public static ServerDeleteHero DefaultInstance { + get { return defaultInstance; } + } + + public override ServerDeleteHero DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ServerDeleteHero ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_ServerDeleteHero__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_ServerDeleteHero__FieldAccessorTable; } + } + + public const int AccountIdFieldNumber = 1; + private bool hasAccountId; + private global::D3.OnlineService.EntityId accountId_; + public bool HasAccountId { + get { return hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return accountId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public const int HeroIdFieldNumber = 2; + private bool hasHeroId; + private global::D3.OnlineService.EntityId heroId_; + public bool HasHeroId { + get { return hasHeroId; } + } + public global::D3.OnlineService.EntityId HeroId { + get { return heroId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasAccountId) return false; + if (!hasHeroId) return false; + if (!AccountId.IsInitialized) return false; + if (!HeroId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _serverDeleteHeroFieldNames; + if (hasAccountId) { + output.WriteMessage(1, field_names[0], AccountId); + } + if (hasHeroId) { + output.WriteMessage(2, field_names[1], HeroId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AccountId); + } + if (hasHeroId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, HeroId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ServerDeleteHero ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ServerDeleteHero ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ServerDeleteHero ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ServerDeleteHero ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ServerDeleteHero ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ServerDeleteHero ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ServerDeleteHero ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ServerDeleteHero ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ServerDeleteHero ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ServerDeleteHero ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ServerDeleteHero MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ServerDeleteHero prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ServerDeleteHero cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ServerDeleteHero result; + + private ServerDeleteHero PrepareBuilder() { + if (resultIsReadOnly) { + ServerDeleteHero original = result; + result = new ServerDeleteHero(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ServerDeleteHero MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.ServerDeleteHero.Descriptor; } + } + + public override ServerDeleteHero DefaultInstanceForType { + get { return global::D3.GameMessage.ServerDeleteHero.DefaultInstance; } + } + + public override ServerDeleteHero BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ServerDeleteHero) { + return MergeFrom((ServerDeleteHero) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ServerDeleteHero other) { + if (other == global::D3.GameMessage.ServerDeleteHero.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAccountId) { + MergeAccountId(other.AccountId); + } + if (other.HasHeroId) { + MergeHeroId(other.HeroId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_serverDeleteHeroFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _serverDeleteHeroFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasAccountId) { + subBuilder.MergeFrom(AccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + AccountId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasHeroId) { + subBuilder.MergeFrom(HeroId); + } + input.ReadMessage(subBuilder, extensionRegistry); + HeroId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAccountId { + get { return result.hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return result.AccountId; } + set { SetAccountId(value); } + } + public Builder SetAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = value; + return this; + } + public Builder SetAccountId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = builderForValue.Build(); + return this; + } + public Builder MergeAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccountId && + result.accountId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.accountId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.accountId_).MergeFrom(value).BuildPartial(); + } else { + result.accountId_ = value; + } + result.hasAccountId = true; + return this; + } + public Builder ClearAccountId() { + PrepareBuilder(); + result.hasAccountId = false; + result.accountId_ = null; + return this; + } + + public bool HasHeroId { + get { return result.hasHeroId; } + } + public global::D3.OnlineService.EntityId HeroId { + get { return result.HeroId; } + set { SetHeroId(value); } + } + public Builder SetHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasHeroId = true; + result.heroId_ = value; + return this; + } + public Builder SetHeroId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasHeroId = true; + result.heroId_ = builderForValue.Build(); + return this; + } + public Builder MergeHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasHeroId && + result.heroId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.heroId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.heroId_).MergeFrom(value).BuildPartial(); + } else { + result.heroId_ = value; + } + result.hasHeroId = true; + return this; + } + public Builder ClearHeroId() { + PrepareBuilder(); + result.hasHeroId = false; + result.heroId_ = null; + return this; + } + } + static ServerDeleteHero() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ServerUndeleteHero : pb::GeneratedMessage { + private ServerUndeleteHero() { } + private static readonly ServerUndeleteHero defaultInstance = new ServerUndeleteHero().MakeReadOnly(); + private static readonly string[] _serverUndeleteHeroFieldNames = new string[] { "account_id", "replace_hero_id", "undelete_hero_id" }; + private static readonly uint[] _serverUndeleteHeroFieldTags = new uint[] { 10, 26, 18 }; + public static ServerUndeleteHero DefaultInstance { + get { return defaultInstance; } + } + + public override ServerUndeleteHero DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ServerUndeleteHero ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_ServerUndeleteHero__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_ServerUndeleteHero__FieldAccessorTable; } + } + + public const int AccountIdFieldNumber = 1; + private bool hasAccountId; + private global::D3.OnlineService.EntityId accountId_; + public bool HasAccountId { + get { return hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return accountId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public const int UndeleteHeroIdFieldNumber = 2; + private bool hasUndeleteHeroId; + private global::D3.OnlineService.EntityId undeleteHeroId_; + public bool HasUndeleteHeroId { + get { return hasUndeleteHeroId; } + } + public global::D3.OnlineService.EntityId UndeleteHeroId { + get { return undeleteHeroId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public const int ReplaceHeroIdFieldNumber = 3; + private bool hasReplaceHeroId; + private global::D3.OnlineService.EntityId replaceHeroId_; + public bool HasReplaceHeroId { + get { return hasReplaceHeroId; } + } + public global::D3.OnlineService.EntityId ReplaceHeroId { + get { return replaceHeroId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasAccountId) return false; + if (!hasUndeleteHeroId) return false; + if (!AccountId.IsInitialized) return false; + if (!UndeleteHeroId.IsInitialized) return false; + if (HasReplaceHeroId) { + if (!ReplaceHeroId.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _serverUndeleteHeroFieldNames; + if (hasAccountId) { + output.WriteMessage(1, field_names[0], AccountId); + } + if (hasUndeleteHeroId) { + output.WriteMessage(2, field_names[2], UndeleteHeroId); + } + if (hasReplaceHeroId) { + output.WriteMessage(3, field_names[1], ReplaceHeroId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AccountId); + } + if (hasUndeleteHeroId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, UndeleteHeroId); + } + if (hasReplaceHeroId) { + size += pb::CodedOutputStream.ComputeMessageSize(3, ReplaceHeroId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ServerUndeleteHero ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ServerUndeleteHero ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ServerUndeleteHero ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ServerUndeleteHero ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ServerUndeleteHero ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ServerUndeleteHero ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ServerUndeleteHero ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ServerUndeleteHero ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ServerUndeleteHero ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ServerUndeleteHero ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ServerUndeleteHero MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ServerUndeleteHero prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ServerUndeleteHero cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ServerUndeleteHero result; + + private ServerUndeleteHero PrepareBuilder() { + if (resultIsReadOnly) { + ServerUndeleteHero original = result; + result = new ServerUndeleteHero(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ServerUndeleteHero MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.ServerUndeleteHero.Descriptor; } + } + + public override ServerUndeleteHero DefaultInstanceForType { + get { return global::D3.GameMessage.ServerUndeleteHero.DefaultInstance; } + } + + public override ServerUndeleteHero BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ServerUndeleteHero) { + return MergeFrom((ServerUndeleteHero) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ServerUndeleteHero other) { + if (other == global::D3.GameMessage.ServerUndeleteHero.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAccountId) { + MergeAccountId(other.AccountId); + } + if (other.HasUndeleteHeroId) { + MergeUndeleteHeroId(other.UndeleteHeroId); + } + if (other.HasReplaceHeroId) { + MergeReplaceHeroId(other.ReplaceHeroId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_serverUndeleteHeroFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _serverUndeleteHeroFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasAccountId) { + subBuilder.MergeFrom(AccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + AccountId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasUndeleteHeroId) { + subBuilder.MergeFrom(UndeleteHeroId); + } + input.ReadMessage(subBuilder, extensionRegistry); + UndeleteHeroId = subBuilder.BuildPartial(); + break; + } + case 26: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasReplaceHeroId) { + subBuilder.MergeFrom(ReplaceHeroId); + } + input.ReadMessage(subBuilder, extensionRegistry); + ReplaceHeroId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAccountId { + get { return result.hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return result.AccountId; } + set { SetAccountId(value); } + } + public Builder SetAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = value; + return this; + } + public Builder SetAccountId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = builderForValue.Build(); + return this; + } + public Builder MergeAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccountId && + result.accountId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.accountId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.accountId_).MergeFrom(value).BuildPartial(); + } else { + result.accountId_ = value; + } + result.hasAccountId = true; + return this; + } + public Builder ClearAccountId() { + PrepareBuilder(); + result.hasAccountId = false; + result.accountId_ = null; + return this; + } + + public bool HasUndeleteHeroId { + get { return result.hasUndeleteHeroId; } + } + public global::D3.OnlineService.EntityId UndeleteHeroId { + get { return result.UndeleteHeroId; } + set { SetUndeleteHeroId(value); } + } + public Builder SetUndeleteHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasUndeleteHeroId = true; + result.undeleteHeroId_ = value; + return this; + } + public Builder SetUndeleteHeroId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasUndeleteHeroId = true; + result.undeleteHeroId_ = builderForValue.Build(); + return this; + } + public Builder MergeUndeleteHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasUndeleteHeroId && + result.undeleteHeroId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.undeleteHeroId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.undeleteHeroId_).MergeFrom(value).BuildPartial(); + } else { + result.undeleteHeroId_ = value; + } + result.hasUndeleteHeroId = true; + return this; + } + public Builder ClearUndeleteHeroId() { + PrepareBuilder(); + result.hasUndeleteHeroId = false; + result.undeleteHeroId_ = null; + return this; + } + + public bool HasReplaceHeroId { + get { return result.hasReplaceHeroId; } + } + public global::D3.OnlineService.EntityId ReplaceHeroId { + get { return result.ReplaceHeroId; } + set { SetReplaceHeroId(value); } + } + public Builder SetReplaceHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasReplaceHeroId = true; + result.replaceHeroId_ = value; + return this; + } + public Builder SetReplaceHeroId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasReplaceHeroId = true; + result.replaceHeroId_ = builderForValue.Build(); + return this; + } + public Builder MergeReplaceHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasReplaceHeroId && + result.replaceHeroId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.replaceHeroId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.replaceHeroId_).MergeFrom(value).BuildPartial(); + } else { + result.replaceHeroId_ = value; + } + result.hasReplaceHeroId = true; + return this; + } + public Builder ClearReplaceHeroId() { + PrepareBuilder(); + result.hasReplaceHeroId = false; + result.replaceHeroId_ = null; + return this; + } + } + static ServerUndeleteHero() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ServerForceRenameHero : pb::GeneratedMessage { + private ServerForceRenameHero() { } + private static readonly ServerForceRenameHero defaultInstance = new ServerForceRenameHero().MakeReadOnly(); + private static readonly string[] _serverForceRenameHeroFieldNames = new string[] { "account_id", "hero_id" }; + private static readonly uint[] _serverForceRenameHeroFieldTags = new uint[] { 10, 18 }; + public static ServerForceRenameHero DefaultInstance { + get { return defaultInstance; } + } + + public override ServerForceRenameHero DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ServerForceRenameHero ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_ServerForceRenameHero__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_ServerForceRenameHero__FieldAccessorTable; } + } + + public const int AccountIdFieldNumber = 1; + private bool hasAccountId; + private global::D3.OnlineService.EntityId accountId_; + public bool HasAccountId { + get { return hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return accountId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public const int HeroIdFieldNumber = 2; + private bool hasHeroId; + private global::D3.OnlineService.EntityId heroId_; + public bool HasHeroId { + get { return hasHeroId; } + } + public global::D3.OnlineService.EntityId HeroId { + get { return heroId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasAccountId) return false; + if (!hasHeroId) return false; + if (!AccountId.IsInitialized) return false; + if (!HeroId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _serverForceRenameHeroFieldNames; + if (hasAccountId) { + output.WriteMessage(1, field_names[0], AccountId); + } + if (hasHeroId) { + output.WriteMessage(2, field_names[1], HeroId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AccountId); + } + if (hasHeroId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, HeroId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ServerForceRenameHero ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ServerForceRenameHero ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ServerForceRenameHero ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ServerForceRenameHero ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ServerForceRenameHero ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ServerForceRenameHero ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ServerForceRenameHero ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ServerForceRenameHero ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ServerForceRenameHero ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ServerForceRenameHero ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ServerForceRenameHero MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ServerForceRenameHero prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ServerForceRenameHero cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ServerForceRenameHero result; + + private ServerForceRenameHero PrepareBuilder() { + if (resultIsReadOnly) { + ServerForceRenameHero original = result; + result = new ServerForceRenameHero(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ServerForceRenameHero MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.ServerForceRenameHero.Descriptor; } + } + + public override ServerForceRenameHero DefaultInstanceForType { + get { return global::D3.GameMessage.ServerForceRenameHero.DefaultInstance; } + } + + public override ServerForceRenameHero BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ServerForceRenameHero) { + return MergeFrom((ServerForceRenameHero) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ServerForceRenameHero other) { + if (other == global::D3.GameMessage.ServerForceRenameHero.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAccountId) { + MergeAccountId(other.AccountId); + } + if (other.HasHeroId) { + MergeHeroId(other.HeroId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_serverForceRenameHeroFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _serverForceRenameHeroFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasAccountId) { + subBuilder.MergeFrom(AccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + AccountId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasHeroId) { + subBuilder.MergeFrom(HeroId); + } + input.ReadMessage(subBuilder, extensionRegistry); + HeroId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAccountId { + get { return result.hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return result.AccountId; } + set { SetAccountId(value); } + } + public Builder SetAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = value; + return this; + } + public Builder SetAccountId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = builderForValue.Build(); + return this; + } + public Builder MergeAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccountId && + result.accountId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.accountId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.accountId_).MergeFrom(value).BuildPartial(); + } else { + result.accountId_ = value; + } + result.hasAccountId = true; + return this; + } + public Builder ClearAccountId() { + PrepareBuilder(); + result.hasAccountId = false; + result.accountId_ = null; + return this; + } + + public bool HasHeroId { + get { return result.hasHeroId; } + } + public global::D3.OnlineService.EntityId HeroId { + get { return result.HeroId; } + set { SetHeroId(value); } + } + public Builder SetHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasHeroId = true; + result.heroId_ = value; + return this; + } + public Builder SetHeroId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasHeroId = true; + result.heroId_ = builderForValue.Build(); + return this; + } + public Builder MergeHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasHeroId && + result.heroId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.heroId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.heroId_).MergeFrom(value).BuildPartial(); + } else { + result.heroId_ = value; + } + result.hasHeroId = true; + return this; + } + public Builder ClearHeroId() { + PrepareBuilder(); + result.hasHeroId = false; + result.heroId_ = null; + return this; + } + } + static ServerForceRenameHero() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ServerFetchHeros : pb::GeneratedMessage { + private ServerFetchHeros() { } + private static readonly ServerFetchHeros defaultInstance = new ServerFetchHeros().MakeReadOnly(); + private static readonly string[] _serverFetchHerosFieldNames = new string[] { "account_id" }; + private static readonly uint[] _serverFetchHerosFieldTags = new uint[] { 10 }; + public static ServerFetchHeros DefaultInstance { + get { return defaultInstance; } + } + + public override ServerFetchHeros DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ServerFetchHeros ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_ServerFetchHeros__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_ServerFetchHeros__FieldAccessorTable; } + } + + public const int AccountIdFieldNumber = 1; + private bool hasAccountId; + private global::D3.OnlineService.EntityId accountId_; + public bool HasAccountId { + get { return hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return accountId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasAccountId) return false; + if (!AccountId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _serverFetchHerosFieldNames; + if (hasAccountId) { + output.WriteMessage(1, field_names[0], AccountId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AccountId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ServerFetchHeros ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ServerFetchHeros ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ServerFetchHeros ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ServerFetchHeros ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ServerFetchHeros ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ServerFetchHeros ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ServerFetchHeros ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ServerFetchHeros ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ServerFetchHeros ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ServerFetchHeros ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ServerFetchHeros MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ServerFetchHeros prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ServerFetchHeros cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ServerFetchHeros result; + + private ServerFetchHeros PrepareBuilder() { + if (resultIsReadOnly) { + ServerFetchHeros original = result; + result = new ServerFetchHeros(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ServerFetchHeros MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.ServerFetchHeros.Descriptor; } + } + + public override ServerFetchHeros DefaultInstanceForType { + get { return global::D3.GameMessage.ServerFetchHeros.DefaultInstance; } + } + + public override ServerFetchHeros BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ServerFetchHeros) { + return MergeFrom((ServerFetchHeros) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ServerFetchHeros other) { + if (other == global::D3.GameMessage.ServerFetchHeros.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAccountId) { + MergeAccountId(other.AccountId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_serverFetchHerosFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _serverFetchHerosFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasAccountId) { + subBuilder.MergeFrom(AccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + AccountId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAccountId { + get { return result.hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return result.AccountId; } + set { SetAccountId(value); } + } + public Builder SetAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = value; + return this; + } + public Builder SetAccountId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = builderForValue.Build(); + return this; + } + public Builder MergeAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccountId && + result.accountId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.accountId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.accountId_).MergeFrom(value).BuildPartial(); + } else { + result.accountId_ = value; + } + result.hasAccountId = true; + return this; + } + public Builder ClearAccountId() { + PrepareBuilder(); + result.hasAccountId = false; + result.accountId_ = null; + return this; + } + } + static ServerFetchHeros() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ServerFetchInventory : pb::GeneratedMessage { + private ServerFetchInventory() { } + private static readonly ServerFetchInventory defaultInstance = new ServerFetchInventory().MakeReadOnly(); + private static readonly string[] _serverFetchInventoryFieldNames = new string[] { "account_id", "hero_id" }; + private static readonly uint[] _serverFetchInventoryFieldTags = new uint[] { 10, 18 }; + public static ServerFetchInventory DefaultInstance { + get { return defaultInstance; } + } + + public override ServerFetchInventory DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ServerFetchInventory ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_ServerFetchInventory__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_ServerFetchInventory__FieldAccessorTable; } + } + + public const int AccountIdFieldNumber = 1; + private bool hasAccountId; + private global::D3.OnlineService.EntityId accountId_; + public bool HasAccountId { + get { return hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return accountId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public const int HeroIdFieldNumber = 2; + private bool hasHeroId; + private global::D3.OnlineService.EntityId heroId_; + public bool HasHeroId { + get { return hasHeroId; } + } + public global::D3.OnlineService.EntityId HeroId { + get { return heroId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasAccountId) return false; + if (!hasHeroId) return false; + if (!AccountId.IsInitialized) return false; + if (!HeroId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _serverFetchInventoryFieldNames; + if (hasAccountId) { + output.WriteMessage(1, field_names[0], AccountId); + } + if (hasHeroId) { + output.WriteMessage(2, field_names[1], HeroId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AccountId); + } + if (hasHeroId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, HeroId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ServerFetchInventory ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ServerFetchInventory ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ServerFetchInventory ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ServerFetchInventory ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ServerFetchInventory ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ServerFetchInventory ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ServerFetchInventory ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ServerFetchInventory ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ServerFetchInventory ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ServerFetchInventory ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ServerFetchInventory MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ServerFetchInventory prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ServerFetchInventory cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ServerFetchInventory result; + + private ServerFetchInventory PrepareBuilder() { + if (resultIsReadOnly) { + ServerFetchInventory original = result; + result = new ServerFetchInventory(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ServerFetchInventory MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.ServerFetchInventory.Descriptor; } + } + + public override ServerFetchInventory DefaultInstanceForType { + get { return global::D3.GameMessage.ServerFetchInventory.DefaultInstance; } + } + + public override ServerFetchInventory BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ServerFetchInventory) { + return MergeFrom((ServerFetchInventory) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ServerFetchInventory other) { + if (other == global::D3.GameMessage.ServerFetchInventory.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAccountId) { + MergeAccountId(other.AccountId); + } + if (other.HasHeroId) { + MergeHeroId(other.HeroId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_serverFetchInventoryFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _serverFetchInventoryFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasAccountId) { + subBuilder.MergeFrom(AccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + AccountId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasHeroId) { + subBuilder.MergeFrom(HeroId); + } + input.ReadMessage(subBuilder, extensionRegistry); + HeroId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAccountId { + get { return result.hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return result.AccountId; } + set { SetAccountId(value); } + } + public Builder SetAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = value; + return this; + } + public Builder SetAccountId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = builderForValue.Build(); + return this; + } + public Builder MergeAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccountId && + result.accountId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.accountId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.accountId_).MergeFrom(value).BuildPartial(); + } else { + result.accountId_ = value; + } + result.hasAccountId = true; + return this; + } + public Builder ClearAccountId() { + PrepareBuilder(); + result.hasAccountId = false; + result.accountId_ = null; + return this; + } + + public bool HasHeroId { + get { return result.hasHeroId; } + } + public global::D3.OnlineService.EntityId HeroId { + get { return result.HeroId; } + set { SetHeroId(value); } + } + public Builder SetHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasHeroId = true; + result.heroId_ = value; + return this; + } + public Builder SetHeroId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasHeroId = true; + result.heroId_ = builderForValue.Build(); + return this; + } + public Builder MergeHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasHeroId && + result.heroId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.heroId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.heroId_).MergeFrom(value).BuildPartial(); + } else { + result.heroId_ = value; + } + result.hasHeroId = true; + return this; + } + public Builder ClearHeroId() { + PrepareBuilder(); + result.hasHeroId = false; + result.heroId_ = null; + return this; + } + } + static ServerFetchInventory() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ServerSnapshot : pb::GeneratedMessage { + private ServerSnapshot() { } + private static readonly ServerSnapshot defaultInstance = new ServerSnapshot().MakeReadOnly(); + private static readonly string[] _serverSnapshotFieldNames = new string[] { "account_id" }; + private static readonly uint[] _serverSnapshotFieldTags = new uint[] { 10 }; + public static ServerSnapshot DefaultInstance { + get { return defaultInstance; } + } + + public override ServerSnapshot DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ServerSnapshot ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_ServerSnapshot__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_ServerSnapshot__FieldAccessorTable; } + } + + public const int AccountIdFieldNumber = 1; + private bool hasAccountId; + private global::D3.OnlineService.EntityId accountId_; + public bool HasAccountId { + get { return hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return accountId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasAccountId) return false; + if (!AccountId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _serverSnapshotFieldNames; + if (hasAccountId) { + output.WriteMessage(1, field_names[0], AccountId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AccountId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ServerSnapshot ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ServerSnapshot ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ServerSnapshot ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ServerSnapshot ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ServerSnapshot ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ServerSnapshot ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ServerSnapshot ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ServerSnapshot ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ServerSnapshot ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ServerSnapshot ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ServerSnapshot MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ServerSnapshot prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ServerSnapshot cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ServerSnapshot result; + + private ServerSnapshot PrepareBuilder() { + if (resultIsReadOnly) { + ServerSnapshot original = result; + result = new ServerSnapshot(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ServerSnapshot MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.ServerSnapshot.Descriptor; } + } + + public override ServerSnapshot DefaultInstanceForType { + get { return global::D3.GameMessage.ServerSnapshot.DefaultInstance; } + } + + public override ServerSnapshot BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ServerSnapshot) { + return MergeFrom((ServerSnapshot) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ServerSnapshot other) { + if (other == global::D3.GameMessage.ServerSnapshot.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAccountId) { + MergeAccountId(other.AccountId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_serverSnapshotFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _serverSnapshotFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasAccountId) { + subBuilder.MergeFrom(AccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + AccountId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAccountId { + get { return result.hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return result.AccountId; } + set { SetAccountId(value); } + } + public Builder SetAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = value; + return this; + } + public Builder SetAccountId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = builderForValue.Build(); + return this; + } + public Builder MergeAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccountId && + result.accountId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.accountId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.accountId_).MergeFrom(value).BuildPartial(); + } else { + result.accountId_ = value; + } + result.hasAccountId = true; + return this; + } + public Builder ClearAccountId() { + PrepareBuilder(); + result.hasAccountId = false; + result.accountId_ = null; + return this; + } + } + static ServerSnapshot() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ServerSnapshotResponse : pb::GeneratedMessage { + private ServerSnapshotResponse() { } + private static readonly ServerSnapshotResponse defaultInstance = new ServerSnapshotResponse().MakeReadOnly(); + private static readonly string[] _serverSnapshotResponseFieldNames = new string[] { "account_id", "version" }; + private static readonly uint[] _serverSnapshotResponseFieldTags = new uint[] { 10, 16 }; + public static ServerSnapshotResponse DefaultInstance { + get { return defaultInstance; } + } + + public override ServerSnapshotResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ServerSnapshotResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_ServerSnapshotResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_ServerSnapshotResponse__FieldAccessorTable; } + } + + public const int AccountIdFieldNumber = 1; + private bool hasAccountId; + private global::D3.OnlineService.EntityId accountId_; + public bool HasAccountId { + get { return hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return accountId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public const int VersionFieldNumber = 2; + private bool hasVersion; + private ulong version_; + public bool HasVersion { + get { return hasVersion; } + } + public ulong Version { + get { return version_; } + } + + public override bool IsInitialized { + get { + if (!hasAccountId) return false; + if (!hasVersion) return false; + if (!AccountId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _serverSnapshotResponseFieldNames; + if (hasAccountId) { + output.WriteMessage(1, field_names[0], AccountId); + } + if (hasVersion) { + output.WriteUInt64(2, field_names[1], Version); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AccountId); + } + if (hasVersion) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, Version); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ServerSnapshotResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ServerSnapshotResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ServerSnapshotResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ServerSnapshotResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ServerSnapshotResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ServerSnapshotResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ServerSnapshotResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ServerSnapshotResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ServerSnapshotResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ServerSnapshotResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ServerSnapshotResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ServerSnapshotResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ServerSnapshotResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ServerSnapshotResponse result; + + private ServerSnapshotResponse PrepareBuilder() { + if (resultIsReadOnly) { + ServerSnapshotResponse original = result; + result = new ServerSnapshotResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ServerSnapshotResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.ServerSnapshotResponse.Descriptor; } + } + + public override ServerSnapshotResponse DefaultInstanceForType { + get { return global::D3.GameMessage.ServerSnapshotResponse.DefaultInstance; } + } + + public override ServerSnapshotResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ServerSnapshotResponse) { + return MergeFrom((ServerSnapshotResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ServerSnapshotResponse other) { + if (other == global::D3.GameMessage.ServerSnapshotResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAccountId) { + MergeAccountId(other.AccountId); + } + if (other.HasVersion) { + Version = other.Version; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_serverSnapshotResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _serverSnapshotResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasAccountId) { + subBuilder.MergeFrom(AccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + AccountId = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasVersion = input.ReadUInt64(ref result.version_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAccountId { + get { return result.hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return result.AccountId; } + set { SetAccountId(value); } + } + public Builder SetAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = value; + return this; + } + public Builder SetAccountId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = builderForValue.Build(); + return this; + } + public Builder MergeAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccountId && + result.accountId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.accountId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.accountId_).MergeFrom(value).BuildPartial(); + } else { + result.accountId_ = value; + } + result.hasAccountId = true; + return this; + } + public Builder ClearAccountId() { + PrepareBuilder(); + result.hasAccountId = false; + result.accountId_ = null; + return this; + } + + public bool HasVersion { + get { return result.hasVersion; } + } + public ulong Version { + get { return result.Version; } + set { SetVersion(value); } + } + public Builder SetVersion(ulong value) { + PrepareBuilder(); + result.hasVersion = true; + result.version_ = value; + return this; + } + public Builder ClearVersion() { + PrepareBuilder(); + result.hasVersion = false; + result.version_ = 0UL; + return this; + } + } + static ServerSnapshotResponse() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ServerFetchSnapshot : pb::GeneratedMessage { + private ServerFetchSnapshot() { } + private static readonly ServerFetchSnapshot defaultInstance = new ServerFetchSnapshot().MakeReadOnly(); + private static readonly string[] _serverFetchSnapshotFieldNames = new string[] { "account_id", "version" }; + private static readonly uint[] _serverFetchSnapshotFieldTags = new uint[] { 10, 16 }; + public static ServerFetchSnapshot DefaultInstance { + get { return defaultInstance; } + } + + public override ServerFetchSnapshot DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ServerFetchSnapshot ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_ServerFetchSnapshot__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_ServerFetchSnapshot__FieldAccessorTable; } + } + + public const int AccountIdFieldNumber = 1; + private bool hasAccountId; + private global::D3.OnlineService.EntityId accountId_; + public bool HasAccountId { + get { return hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return accountId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public const int VersionFieldNumber = 2; + private bool hasVersion; + private ulong version_; + public bool HasVersion { + get { return hasVersion; } + } + public ulong Version { + get { return version_; } + } + + public override bool IsInitialized { + get { + if (!hasAccountId) return false; + if (!hasVersion) return false; + if (!AccountId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _serverFetchSnapshotFieldNames; + if (hasAccountId) { + output.WriteMessage(1, field_names[0], AccountId); + } + if (hasVersion) { + output.WriteUInt64(2, field_names[1], Version); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AccountId); + } + if (hasVersion) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, Version); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ServerFetchSnapshot ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ServerFetchSnapshot ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ServerFetchSnapshot ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ServerFetchSnapshot ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ServerFetchSnapshot ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ServerFetchSnapshot ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ServerFetchSnapshot ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ServerFetchSnapshot ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ServerFetchSnapshot ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ServerFetchSnapshot ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ServerFetchSnapshot MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ServerFetchSnapshot prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ServerFetchSnapshot cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ServerFetchSnapshot result; + + private ServerFetchSnapshot PrepareBuilder() { + if (resultIsReadOnly) { + ServerFetchSnapshot original = result; + result = new ServerFetchSnapshot(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ServerFetchSnapshot MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.ServerFetchSnapshot.Descriptor; } + } + + public override ServerFetchSnapshot DefaultInstanceForType { + get { return global::D3.GameMessage.ServerFetchSnapshot.DefaultInstance; } + } + + public override ServerFetchSnapshot BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ServerFetchSnapshot) { + return MergeFrom((ServerFetchSnapshot) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ServerFetchSnapshot other) { + if (other == global::D3.GameMessage.ServerFetchSnapshot.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAccountId) { + MergeAccountId(other.AccountId); + } + if (other.HasVersion) { + Version = other.Version; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_serverFetchSnapshotFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _serverFetchSnapshotFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasAccountId) { + subBuilder.MergeFrom(AccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + AccountId = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasVersion = input.ReadUInt64(ref result.version_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAccountId { + get { return result.hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return result.AccountId; } + set { SetAccountId(value); } + } + public Builder SetAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = value; + return this; + } + public Builder SetAccountId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = builderForValue.Build(); + return this; + } + public Builder MergeAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccountId && + result.accountId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.accountId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.accountId_).MergeFrom(value).BuildPartial(); + } else { + result.accountId_ = value; + } + result.hasAccountId = true; + return this; + } + public Builder ClearAccountId() { + PrepareBuilder(); + result.hasAccountId = false; + result.accountId_ = null; + return this; + } + + public bool HasVersion { + get { return result.hasVersion; } + } + public ulong Version { + get { return result.Version; } + set { SetVersion(value); } + } + public Builder SetVersion(ulong value) { + PrepareBuilder(); + result.hasVersion = true; + result.version_ = value; + return this; + } + public Builder ClearVersion() { + PrepareBuilder(); + result.hasVersion = false; + result.version_ = 0UL; + return this; + } + } + static ServerFetchSnapshot() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ServerRevokeItem : pb::GeneratedMessage { + private ServerRevokeItem() { } + private static readonly ServerRevokeItem defaultInstance = new ServerRevokeItem().MakeReadOnly(); + private static readonly string[] _serverRevokeItemFieldNames = new string[] { "account_id", "hero_id", "item_id" }; + private static readonly uint[] _serverRevokeItemFieldTags = new uint[] { 10, 18, 26 }; + public static ServerRevokeItem DefaultInstance { + get { return defaultInstance; } + } + + public override ServerRevokeItem DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ServerRevokeItem ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_ServerRevokeItem__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_ServerRevokeItem__FieldAccessorTable; } + } + + public const int AccountIdFieldNumber = 1; + private bool hasAccountId; + private global::D3.OnlineService.EntityId accountId_; + public bool HasAccountId { + get { return hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return accountId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public const int HeroIdFieldNumber = 2; + private bool hasHeroId; + private global::D3.OnlineService.EntityId heroId_; + public bool HasHeroId { + get { return hasHeroId; } + } + public global::D3.OnlineService.EntityId HeroId { + get { return heroId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public const int ItemIdFieldNumber = 3; + private bool hasItemId; + private global::D3.OnlineService.ItemId itemId_; + public bool HasItemId { + get { return hasItemId; } + } + public global::D3.OnlineService.ItemId ItemId { + get { return itemId_ ?? global::D3.OnlineService.ItemId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasAccountId) return false; + if (!hasHeroId) return false; + if (!hasItemId) return false; + if (!AccountId.IsInitialized) return false; + if (!HeroId.IsInitialized) return false; + if (!ItemId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _serverRevokeItemFieldNames; + if (hasAccountId) { + output.WriteMessage(1, field_names[0], AccountId); + } + if (hasHeroId) { + output.WriteMessage(2, field_names[1], HeroId); + } + if (hasItemId) { + output.WriteMessage(3, field_names[2], ItemId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AccountId); + } + if (hasHeroId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, HeroId); + } + if (hasItemId) { + size += pb::CodedOutputStream.ComputeMessageSize(3, ItemId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ServerRevokeItem ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ServerRevokeItem ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ServerRevokeItem ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ServerRevokeItem ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ServerRevokeItem ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ServerRevokeItem ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ServerRevokeItem ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ServerRevokeItem ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ServerRevokeItem ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ServerRevokeItem ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ServerRevokeItem MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ServerRevokeItem prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ServerRevokeItem cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ServerRevokeItem result; + + private ServerRevokeItem PrepareBuilder() { + if (resultIsReadOnly) { + ServerRevokeItem original = result; + result = new ServerRevokeItem(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ServerRevokeItem MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.ServerRevokeItem.Descriptor; } + } + + public override ServerRevokeItem DefaultInstanceForType { + get { return global::D3.GameMessage.ServerRevokeItem.DefaultInstance; } + } + + public override ServerRevokeItem BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ServerRevokeItem) { + return MergeFrom((ServerRevokeItem) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ServerRevokeItem other) { + if (other == global::D3.GameMessage.ServerRevokeItem.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAccountId) { + MergeAccountId(other.AccountId); + } + if (other.HasHeroId) { + MergeHeroId(other.HeroId); + } + if (other.HasItemId) { + MergeItemId(other.ItemId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_serverRevokeItemFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _serverRevokeItemFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasAccountId) { + subBuilder.MergeFrom(AccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + AccountId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasHeroId) { + subBuilder.MergeFrom(HeroId); + } + input.ReadMessage(subBuilder, extensionRegistry); + HeroId = subBuilder.BuildPartial(); + break; + } + case 26: { + global::D3.OnlineService.ItemId.Builder subBuilder = global::D3.OnlineService.ItemId.CreateBuilder(); + if (result.hasItemId) { + subBuilder.MergeFrom(ItemId); + } + input.ReadMessage(subBuilder, extensionRegistry); + ItemId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAccountId { + get { return result.hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return result.AccountId; } + set { SetAccountId(value); } + } + public Builder SetAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = value; + return this; + } + public Builder SetAccountId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = builderForValue.Build(); + return this; + } + public Builder MergeAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccountId && + result.accountId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.accountId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.accountId_).MergeFrom(value).BuildPartial(); + } else { + result.accountId_ = value; + } + result.hasAccountId = true; + return this; + } + public Builder ClearAccountId() { + PrepareBuilder(); + result.hasAccountId = false; + result.accountId_ = null; + return this; + } + + public bool HasHeroId { + get { return result.hasHeroId; } + } + public global::D3.OnlineService.EntityId HeroId { + get { return result.HeroId; } + set { SetHeroId(value); } + } + public Builder SetHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasHeroId = true; + result.heroId_ = value; + return this; + } + public Builder SetHeroId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasHeroId = true; + result.heroId_ = builderForValue.Build(); + return this; + } + public Builder MergeHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasHeroId && + result.heroId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.heroId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.heroId_).MergeFrom(value).BuildPartial(); + } else { + result.heroId_ = value; + } + result.hasHeroId = true; + return this; + } + public Builder ClearHeroId() { + PrepareBuilder(); + result.hasHeroId = false; + result.heroId_ = null; + return this; + } + + public bool HasItemId { + get { return result.hasItemId; } + } + public global::D3.OnlineService.ItemId ItemId { + get { return result.ItemId; } + set { SetItemId(value); } + } + public Builder SetItemId(global::D3.OnlineService.ItemId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasItemId = true; + result.itemId_ = value; + return this; + } + public Builder SetItemId(global::D3.OnlineService.ItemId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasItemId = true; + result.itemId_ = builderForValue.Build(); + return this; + } + public Builder MergeItemId(global::D3.OnlineService.ItemId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasItemId && + result.itemId_ != global::D3.OnlineService.ItemId.DefaultInstance) { + result.itemId_ = global::D3.OnlineService.ItemId.CreateBuilder(result.itemId_).MergeFrom(value).BuildPartial(); + } else { + result.itemId_ = value; + } + result.hasItemId = true; + return this; + } + public Builder ClearItemId() { + PrepareBuilder(); + result.hasItemId = false; + result.itemId_ = null; + return this; + } + } + static ServerRevokeItem() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class RenameHero : pb::GeneratedMessage { + private RenameHero() { } + private static readonly RenameHero defaultInstance = new RenameHero().MakeReadOnly(); + private static readonly string[] _renameHeroFieldNames = new string[] { "hero_id", "new_name" }; + private static readonly uint[] _renameHeroFieldTags = new uint[] { 10, 18 }; + public static RenameHero DefaultInstance { + get { return defaultInstance; } + } + + public override RenameHero DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override RenameHero ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_RenameHero__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_RenameHero__FieldAccessorTable; } + } + + public const int HeroIdFieldNumber = 1; + private bool hasHeroId; + private global::D3.OnlineService.EntityId heroId_; + public bool HasHeroId { + get { return hasHeroId; } + } + public global::D3.OnlineService.EntityId HeroId { + get { return heroId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public const int NewNameFieldNumber = 2; + private bool hasNewName; + private string newName_ = ""; + public bool HasNewName { + get { return hasNewName; } + } + public string NewName { + get { return newName_; } + } + + public override bool IsInitialized { + get { + if (!hasHeroId) return false; + if (!hasNewName) return false; + if (!HeroId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _renameHeroFieldNames; + if (hasHeroId) { + output.WriteMessage(1, field_names[0], HeroId); + } + if (hasNewName) { + output.WriteString(2, field_names[1], NewName); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasHeroId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, HeroId); + } + if (hasNewName) { + size += pb::CodedOutputStream.ComputeStringSize(2, NewName); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static RenameHero ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RenameHero ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RenameHero ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RenameHero ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RenameHero ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RenameHero ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static RenameHero ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static RenameHero ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static RenameHero ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RenameHero ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private RenameHero MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(RenameHero prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(RenameHero cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private RenameHero result; + + private RenameHero PrepareBuilder() { + if (resultIsReadOnly) { + RenameHero original = result; + result = new RenameHero(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override RenameHero MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.RenameHero.Descriptor; } + } + + public override RenameHero DefaultInstanceForType { + get { return global::D3.GameMessage.RenameHero.DefaultInstance; } + } + + public override RenameHero BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is RenameHero) { + return MergeFrom((RenameHero) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(RenameHero other) { + if (other == global::D3.GameMessage.RenameHero.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasHeroId) { + MergeHeroId(other.HeroId); + } + if (other.HasNewName) { + NewName = other.NewName; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_renameHeroFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _renameHeroFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasHeroId) { + subBuilder.MergeFrom(HeroId); + } + input.ReadMessage(subBuilder, extensionRegistry); + HeroId = subBuilder.BuildPartial(); + break; + } + case 18: { + result.hasNewName = input.ReadString(ref result.newName_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasHeroId { + get { return result.hasHeroId; } + } + public global::D3.OnlineService.EntityId HeroId { + get { return result.HeroId; } + set { SetHeroId(value); } + } + public Builder SetHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasHeroId = true; + result.heroId_ = value; + return this; + } + public Builder SetHeroId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasHeroId = true; + result.heroId_ = builderForValue.Build(); + return this; + } + public Builder MergeHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasHeroId && + result.heroId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.heroId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.heroId_).MergeFrom(value).BuildPartial(); + } else { + result.heroId_ = value; + } + result.hasHeroId = true; + return this; + } + public Builder ClearHeroId() { + PrepareBuilder(); + result.hasHeroId = false; + result.heroId_ = null; + return this; + } + + public bool HasNewName { + get { return result.hasNewName; } + } + public string NewName { + get { return result.NewName; } + set { SetNewName(value); } + } + public Builder SetNewName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasNewName = true; + result.newName_ = value; + return this; + } + public Builder ClearNewName() { + PrepareBuilder(); + result.hasNewName = false; + result.newName_ = ""; + return this; + } + } + static RenameHero() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetGameAccountSettings : pb::GeneratedMessage { + private GetGameAccountSettings() { } + private static readonly GetGameAccountSettings defaultInstance = new GetGameAccountSettings().MakeReadOnly(); + private static readonly string[] _getGameAccountSettingsFieldNames = new string[] { }; + private static readonly uint[] _getGameAccountSettingsFieldTags = new uint[] { }; + public static GetGameAccountSettings DefaultInstance { + get { return defaultInstance; } + } + + public override GetGameAccountSettings DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetGameAccountSettings ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_GetGameAccountSettings__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_GetGameAccountSettings__FieldAccessorTable; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getGameAccountSettingsFieldNames; + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetGameAccountSettings ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetGameAccountSettings ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetGameAccountSettings ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetGameAccountSettings ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetGameAccountSettings ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetGameAccountSettings ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetGameAccountSettings ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetGameAccountSettings ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetGameAccountSettings ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetGameAccountSettings ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetGameAccountSettings MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetGameAccountSettings prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetGameAccountSettings cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetGameAccountSettings result; + + private GetGameAccountSettings PrepareBuilder() { + if (resultIsReadOnly) { + GetGameAccountSettings original = result; + result = new GetGameAccountSettings(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetGameAccountSettings MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.GetGameAccountSettings.Descriptor; } + } + + public override GetGameAccountSettings DefaultInstanceForType { + get { return global::D3.GameMessage.GetGameAccountSettings.DefaultInstance; } + } + + public override GetGameAccountSettings BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetGameAccountSettings) { + return MergeFrom((GetGameAccountSettings) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetGameAccountSettings other) { + if (other == global::D3.GameMessage.GetGameAccountSettings.DefaultInstance) return this; + PrepareBuilder(); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getGameAccountSettingsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getGameAccountSettingsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + } + static GetGameAccountSettings() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class SetGameAccountSettings : pb::GeneratedMessage { + private SetGameAccountSettings() { } + private static readonly SetGameAccountSettings defaultInstance = new SetGameAccountSettings().MakeReadOnly(); + private static readonly string[] _setGameAccountSettingsFieldNames = new string[] { "settings" }; + private static readonly uint[] _setGameAccountSettingsFieldTags = new uint[] { 10 }; + public static SetGameAccountSettings DefaultInstance { + get { return defaultInstance; } + } + + public override SetGameAccountSettings DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SetGameAccountSettings ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_SetGameAccountSettings__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_SetGameAccountSettings__FieldAccessorTable; } + } + + public const int SettingsFieldNumber = 1; + private bool hasSettings; + private global::D3.Client.GameAccountSettings settings_; + public bool HasSettings { + get { return hasSettings; } + } + public global::D3.Client.GameAccountSettings Settings { + get { return settings_ ?? global::D3.Client.GameAccountSettings.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasSettings) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _setGameAccountSettingsFieldNames; + if (hasSettings) { + output.WriteMessage(1, field_names[0], Settings); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasSettings) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Settings); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static SetGameAccountSettings ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SetGameAccountSettings ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SetGameAccountSettings ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SetGameAccountSettings ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SetGameAccountSettings ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SetGameAccountSettings ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SetGameAccountSettings ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SetGameAccountSettings ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SetGameAccountSettings ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SetGameAccountSettings ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SetGameAccountSettings MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SetGameAccountSettings prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SetGameAccountSettings cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SetGameAccountSettings result; + + private SetGameAccountSettings PrepareBuilder() { + if (resultIsReadOnly) { + SetGameAccountSettings original = result; + result = new SetGameAccountSettings(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SetGameAccountSettings MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.SetGameAccountSettings.Descriptor; } + } + + public override SetGameAccountSettings DefaultInstanceForType { + get { return global::D3.GameMessage.SetGameAccountSettings.DefaultInstance; } + } + + public override SetGameAccountSettings BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SetGameAccountSettings) { + return MergeFrom((SetGameAccountSettings) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SetGameAccountSettings other) { + if (other == global::D3.GameMessage.SetGameAccountSettings.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasSettings) { + MergeSettings(other.Settings); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_setGameAccountSettingsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _setGameAccountSettingsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.Client.GameAccountSettings.Builder subBuilder = global::D3.Client.GameAccountSettings.CreateBuilder(); + if (result.hasSettings) { + subBuilder.MergeFrom(Settings); + } + input.ReadMessage(subBuilder, extensionRegistry); + Settings = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasSettings { + get { return result.hasSettings; } + } + public global::D3.Client.GameAccountSettings Settings { + get { return result.Settings; } + set { SetSettings(value); } + } + public Builder SetSettings(global::D3.Client.GameAccountSettings value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasSettings = true; + result.settings_ = value; + return this; + } + public Builder SetSettings(global::D3.Client.GameAccountSettings.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasSettings = true; + result.settings_ = builderForValue.Build(); + return this; + } + public Builder MergeSettings(global::D3.Client.GameAccountSettings value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasSettings && + result.settings_ != global::D3.Client.GameAccountSettings.DefaultInstance) { + result.settings_ = global::D3.Client.GameAccountSettings.CreateBuilder(result.settings_).MergeFrom(value).BuildPartial(); + } else { + result.settings_ = value; + } + result.hasSettings = true; + return this; + } + public Builder ClearSettings() { + PrepareBuilder(); + result.hasSettings = false; + result.settings_ = null; + return this; + } + } + static SetGameAccountSettings() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetToonSettings : pb::GeneratedMessage { + private GetToonSettings() { } + private static readonly GetToonSettings defaultInstance = new GetToonSettings().MakeReadOnly(); + private static readonly string[] _getToonSettingsFieldNames = new string[] { "hero_id" }; + private static readonly uint[] _getToonSettingsFieldTags = new uint[] { 10 }; + public static GetToonSettings DefaultInstance { + get { return defaultInstance; } + } + + public override GetToonSettings DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetToonSettings ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_GetToonSettings__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_GetToonSettings__FieldAccessorTable; } + } + + public const int HeroIdFieldNumber = 1; + private bool hasHeroId; + private global::D3.OnlineService.EntityId heroId_; + public bool HasHeroId { + get { return hasHeroId; } + } + public global::D3.OnlineService.EntityId HeroId { + get { return heroId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasHeroId) return false; + if (!HeroId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getToonSettingsFieldNames; + if (hasHeroId) { + output.WriteMessage(1, field_names[0], HeroId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasHeroId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, HeroId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetToonSettings ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetToonSettings ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetToonSettings ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetToonSettings ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetToonSettings ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetToonSettings ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetToonSettings ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetToonSettings ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetToonSettings ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetToonSettings ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetToonSettings MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetToonSettings prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetToonSettings cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetToonSettings result; + + private GetToonSettings PrepareBuilder() { + if (resultIsReadOnly) { + GetToonSettings original = result; + result = new GetToonSettings(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetToonSettings MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.GetToonSettings.Descriptor; } + } + + public override GetToonSettings DefaultInstanceForType { + get { return global::D3.GameMessage.GetToonSettings.DefaultInstance; } + } + + public override GetToonSettings BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetToonSettings) { + return MergeFrom((GetToonSettings) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetToonSettings other) { + if (other == global::D3.GameMessage.GetToonSettings.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasHeroId) { + MergeHeroId(other.HeroId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getToonSettingsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getToonSettingsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasHeroId) { + subBuilder.MergeFrom(HeroId); + } + input.ReadMessage(subBuilder, extensionRegistry); + HeroId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasHeroId { + get { return result.hasHeroId; } + } + public global::D3.OnlineService.EntityId HeroId { + get { return result.HeroId; } + set { SetHeroId(value); } + } + public Builder SetHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasHeroId = true; + result.heroId_ = value; + return this; + } + public Builder SetHeroId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasHeroId = true; + result.heroId_ = builderForValue.Build(); + return this; + } + public Builder MergeHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasHeroId && + result.heroId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.heroId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.heroId_).MergeFrom(value).BuildPartial(); + } else { + result.heroId_ = value; + } + result.hasHeroId = true; + return this; + } + public Builder ClearHeroId() { + PrepareBuilder(); + result.hasHeroId = false; + result.heroId_ = null; + return this; + } + } + static GetToonSettings() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class SetToonSettings : pb::GeneratedMessage { + private SetToonSettings() { } + private static readonly SetToonSettings defaultInstance = new SetToonSettings().MakeReadOnly(); + private static readonly string[] _setToonSettingsFieldNames = new string[] { "hero_id", "settings" }; + private static readonly uint[] _setToonSettingsFieldTags = new uint[] { 10, 18 }; + public static SetToonSettings DefaultInstance { + get { return defaultInstance; } + } + + public override SetToonSettings DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SetToonSettings ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_SetToonSettings__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_SetToonSettings__FieldAccessorTable; } + } + + public const int HeroIdFieldNumber = 1; + private bool hasHeroId; + private global::D3.OnlineService.EntityId heroId_; + public bool HasHeroId { + get { return hasHeroId; } + } + public global::D3.OnlineService.EntityId HeroId { + get { return heroId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public const int SettingsFieldNumber = 2; + private bool hasSettings; + private global::D3.Client.ToonSettings settings_; + public bool HasSettings { + get { return hasSettings; } + } + public global::D3.Client.ToonSettings Settings { + get { return settings_ ?? global::D3.Client.ToonSettings.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasHeroId) return false; + if (!hasSettings) return false; + if (!HeroId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _setToonSettingsFieldNames; + if (hasHeroId) { + output.WriteMessage(1, field_names[0], HeroId); + } + if (hasSettings) { + output.WriteMessage(2, field_names[1], Settings); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasHeroId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, HeroId); + } + if (hasSettings) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Settings); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static SetToonSettings ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SetToonSettings ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SetToonSettings ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SetToonSettings ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SetToonSettings ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SetToonSettings ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SetToonSettings ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SetToonSettings ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SetToonSettings ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SetToonSettings ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SetToonSettings MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SetToonSettings prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SetToonSettings cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SetToonSettings result; + + private SetToonSettings PrepareBuilder() { + if (resultIsReadOnly) { + SetToonSettings original = result; + result = new SetToonSettings(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SetToonSettings MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.SetToonSettings.Descriptor; } + } + + public override SetToonSettings DefaultInstanceForType { + get { return global::D3.GameMessage.SetToonSettings.DefaultInstance; } + } + + public override SetToonSettings BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SetToonSettings) { + return MergeFrom((SetToonSettings) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SetToonSettings other) { + if (other == global::D3.GameMessage.SetToonSettings.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasHeroId) { + MergeHeroId(other.HeroId); + } + if (other.HasSettings) { + MergeSettings(other.Settings); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_setToonSettingsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _setToonSettingsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasHeroId) { + subBuilder.MergeFrom(HeroId); + } + input.ReadMessage(subBuilder, extensionRegistry); + HeroId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::D3.Client.ToonSettings.Builder subBuilder = global::D3.Client.ToonSettings.CreateBuilder(); + if (result.hasSettings) { + subBuilder.MergeFrom(Settings); + } + input.ReadMessage(subBuilder, extensionRegistry); + Settings = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasHeroId { + get { return result.hasHeroId; } + } + public global::D3.OnlineService.EntityId HeroId { + get { return result.HeroId; } + set { SetHeroId(value); } + } + public Builder SetHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasHeroId = true; + result.heroId_ = value; + return this; + } + public Builder SetHeroId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasHeroId = true; + result.heroId_ = builderForValue.Build(); + return this; + } + public Builder MergeHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasHeroId && + result.heroId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.heroId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.heroId_).MergeFrom(value).BuildPartial(); + } else { + result.heroId_ = value; + } + result.hasHeroId = true; + return this; + } + public Builder ClearHeroId() { + PrepareBuilder(); + result.hasHeroId = false; + result.heroId_ = null; + return this; + } + + public bool HasSettings { + get { return result.hasSettings; } + } + public global::D3.Client.ToonSettings Settings { + get { return result.Settings; } + set { SetSettings(value); } + } + public Builder SetSettings(global::D3.Client.ToonSettings value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasSettings = true; + result.settings_ = value; + return this; + } + public Builder SetSettings(global::D3.Client.ToonSettings.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasSettings = true; + result.settings_ = builderForValue.Build(); + return this; + } + public Builder MergeSettings(global::D3.Client.ToonSettings value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasSettings && + result.settings_ != global::D3.Client.ToonSettings.DefaultInstance) { + result.settings_ = global::D3.Client.ToonSettings.CreateBuilder(result.settings_).MergeFrom(value).BuildPartial(); + } else { + result.settings_ = value; + } + result.hasSettings = true; + return this; + } + public Builder ClearSettings() { + PrepareBuilder(); + result.hasSettings = false; + result.settings_ = null; + return this; + } + } + static SetToonSettings() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetAccountDigest : pb::GeneratedMessage { + private GetAccountDigest() { } + private static readonly GetAccountDigest defaultInstance = new GetAccountDigest().MakeReadOnly(); + private static readonly string[] _getAccountDigestFieldNames = new string[] { }; + private static readonly uint[] _getAccountDigestFieldTags = new uint[] { }; + public static GetAccountDigest DefaultInstance { + get { return defaultInstance; } + } + + public override GetAccountDigest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetAccountDigest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_GetAccountDigest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_GetAccountDigest__FieldAccessorTable; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getAccountDigestFieldNames; + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetAccountDigest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetAccountDigest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetAccountDigest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetAccountDigest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetAccountDigest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetAccountDigest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetAccountDigest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetAccountDigest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetAccountDigest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetAccountDigest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetAccountDigest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetAccountDigest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetAccountDigest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetAccountDigest result; + + private GetAccountDigest PrepareBuilder() { + if (resultIsReadOnly) { + GetAccountDigest original = result; + result = new GetAccountDigest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetAccountDigest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.GetAccountDigest.Descriptor; } + } + + public override GetAccountDigest DefaultInstanceForType { + get { return global::D3.GameMessage.GetAccountDigest.DefaultInstance; } + } + + public override GetAccountDigest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetAccountDigest) { + return MergeFrom((GetAccountDigest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetAccountDigest other) { + if (other == global::D3.GameMessage.GetAccountDigest.DefaultInstance) return this; + PrepareBuilder(); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getAccountDigestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getAccountDigestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + } + static GetAccountDigest() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetHeroItems : pb::GeneratedMessage { + private GetHeroItems() { } + private static readonly GetHeroItems defaultInstance = new GetHeroItems().MakeReadOnly(); + private static readonly string[] _getHeroItemsFieldNames = new string[] { "hero_id" }; + private static readonly uint[] _getHeroItemsFieldTags = new uint[] { 10 }; + public static GetHeroItems DefaultInstance { + get { return defaultInstance; } + } + + public override GetHeroItems DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetHeroItems ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_GetHeroItems__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_GetHeroItems__FieldAccessorTable; } + } + + public const int HeroIdFieldNumber = 1; + private bool hasHeroId; + private global::D3.OnlineService.EntityId heroId_; + public bool HasHeroId { + get { return hasHeroId; } + } + public global::D3.OnlineService.EntityId HeroId { + get { return heroId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasHeroId) return false; + if (!HeroId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getHeroItemsFieldNames; + if (hasHeroId) { + output.WriteMessage(1, field_names[0], HeroId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasHeroId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, HeroId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetHeroItems ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetHeroItems ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetHeroItems ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetHeroItems ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetHeroItems ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetHeroItems ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetHeroItems ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetHeroItems ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetHeroItems ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetHeroItems ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetHeroItems MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetHeroItems prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetHeroItems cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetHeroItems result; + + private GetHeroItems PrepareBuilder() { + if (resultIsReadOnly) { + GetHeroItems original = result; + result = new GetHeroItems(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetHeroItems MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.GetHeroItems.Descriptor; } + } + + public override GetHeroItems DefaultInstanceForType { + get { return global::D3.GameMessage.GetHeroItems.DefaultInstance; } + } + + public override GetHeroItems BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetHeroItems) { + return MergeFrom((GetHeroItems) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetHeroItems other) { + if (other == global::D3.GameMessage.GetHeroItems.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasHeroId) { + MergeHeroId(other.HeroId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getHeroItemsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getHeroItemsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasHeroId) { + subBuilder.MergeFrom(HeroId); + } + input.ReadMessage(subBuilder, extensionRegistry); + HeroId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasHeroId { + get { return result.hasHeroId; } + } + public global::D3.OnlineService.EntityId HeroId { + get { return result.HeroId; } + set { SetHeroId(value); } + } + public Builder SetHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasHeroId = true; + result.heroId_ = value; + return this; + } + public Builder SetHeroId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasHeroId = true; + result.heroId_ = builderForValue.Build(); + return this; + } + public Builder MergeHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasHeroId && + result.heroId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.heroId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.heroId_).MergeFrom(value).BuildPartial(); + } else { + result.heroId_ = value; + } + result.hasHeroId = true; + return this; + } + public Builder ClearHeroId() { + PrepareBuilder(); + result.hasHeroId = false; + result.heroId_ = null; + return this; + } + } + static GetHeroItems() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetAccountItems : pb::GeneratedMessage { + private GetAccountItems() { } + private static readonly GetAccountItems defaultInstance = new GetAccountItems().MakeReadOnly(); + private static readonly string[] _getAccountItemsFieldNames = new string[] { "hardcore" }; + private static readonly uint[] _getAccountItemsFieldTags = new uint[] { 8 }; + public static GetAccountItems DefaultInstance { + get { return defaultInstance; } + } + + public override GetAccountItems DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetAccountItems ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_GetAccountItems__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_GetAccountItems__FieldAccessorTable; } + } + + public const int HardcoreFieldNumber = 1; + private bool hasHardcore; + private bool hardcore_; + public bool HasHardcore { + get { return hasHardcore; } + } + public bool Hardcore { + get { return hardcore_; } + } + + public override bool IsInitialized { + get { + if (!hasHardcore) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getAccountItemsFieldNames; + if (hasHardcore) { + output.WriteBool(1, field_names[0], Hardcore); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasHardcore) { + size += pb::CodedOutputStream.ComputeBoolSize(1, Hardcore); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetAccountItems ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetAccountItems ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetAccountItems ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetAccountItems ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetAccountItems ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetAccountItems ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetAccountItems ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetAccountItems ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetAccountItems ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetAccountItems ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetAccountItems MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetAccountItems prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetAccountItems cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetAccountItems result; + + private GetAccountItems PrepareBuilder() { + if (resultIsReadOnly) { + GetAccountItems original = result; + result = new GetAccountItems(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetAccountItems MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.GetAccountItems.Descriptor; } + } + + public override GetAccountItems DefaultInstanceForType { + get { return global::D3.GameMessage.GetAccountItems.DefaultInstance; } + } + + public override GetAccountItems BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetAccountItems) { + return MergeFrom((GetAccountItems) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetAccountItems other) { + if (other == global::D3.GameMessage.GetAccountItems.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasHardcore) { + Hardcore = other.Hardcore; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getAccountItemsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getAccountItemsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasHardcore = input.ReadBool(ref result.hardcore_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasHardcore { + get { return result.hasHardcore; } + } + public bool Hardcore { + get { return result.Hardcore; } + set { SetHardcore(value); } + } + public Builder SetHardcore(bool value) { + PrepareBuilder(); + result.hasHardcore = true; + result.hardcore_ = value; + return this; + } + public Builder ClearHardcore() { + PrepareBuilder(); + result.hasHardcore = false; + result.hardcore_ = false; + return this; + } + } + static GetAccountItems() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetAccountProfile : pb::GeneratedMessage { + private GetAccountProfile() { } + private static readonly GetAccountProfile defaultInstance = new GetAccountProfile().MakeReadOnly(); + private static readonly string[] _getAccountProfileFieldNames = new string[] { "account_id" }; + private static readonly uint[] _getAccountProfileFieldTags = new uint[] { 10 }; + public static GetAccountProfile DefaultInstance { + get { return defaultInstance; } + } + + public override GetAccountProfile DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetAccountProfile ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_GetAccountProfile__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_GetAccountProfile__FieldAccessorTable; } + } + + public const int AccountIdFieldNumber = 1; + private bool hasAccountId; + private global::D3.OnlineService.EntityId accountId_; + public bool HasAccountId { + get { return hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return accountId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasAccountId) return false; + if (!AccountId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getAccountProfileFieldNames; + if (hasAccountId) { + output.WriteMessage(1, field_names[0], AccountId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AccountId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetAccountProfile ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetAccountProfile ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetAccountProfile ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetAccountProfile ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetAccountProfile ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetAccountProfile ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetAccountProfile ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetAccountProfile ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetAccountProfile ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetAccountProfile ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetAccountProfile MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetAccountProfile prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetAccountProfile cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetAccountProfile result; + + private GetAccountProfile PrepareBuilder() { + if (resultIsReadOnly) { + GetAccountProfile original = result; + result = new GetAccountProfile(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetAccountProfile MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.GetAccountProfile.Descriptor; } + } + + public override GetAccountProfile DefaultInstanceForType { + get { return global::D3.GameMessage.GetAccountProfile.DefaultInstance; } + } + + public override GetAccountProfile BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetAccountProfile) { + return MergeFrom((GetAccountProfile) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetAccountProfile other) { + if (other == global::D3.GameMessage.GetAccountProfile.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAccountId) { + MergeAccountId(other.AccountId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getAccountProfileFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getAccountProfileFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasAccountId) { + subBuilder.MergeFrom(AccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + AccountId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAccountId { + get { return result.hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return result.AccountId; } + set { SetAccountId(value); } + } + public Builder SetAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = value; + return this; + } + public Builder SetAccountId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = builderForValue.Build(); + return this; + } + public Builder MergeAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccountId && + result.accountId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.accountId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.accountId_).MergeFrom(value).BuildPartial(); + } else { + result.accountId_ = value; + } + result.hasAccountId = true; + return this; + } + public Builder ClearAccountId() { + PrepareBuilder(); + result.hasAccountId = false; + result.accountId_ = null; + return this; + } + } + static GetAccountProfile() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetHeroProfiles : pb::GeneratedMessage { + private GetHeroProfiles() { } + private static readonly GetHeroProfiles defaultInstance = new GetHeroProfiles().MakeReadOnly(); + private static readonly string[] _getHeroProfilesFieldNames = new string[] { "account_id", "hero_ids" }; + private static readonly uint[] _getHeroProfilesFieldTags = new uint[] { 10, 18 }; + public static GetHeroProfiles DefaultInstance { + get { return defaultInstance; } + } + + public override GetHeroProfiles DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetHeroProfiles ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_GetHeroProfiles__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_GetHeroProfiles__FieldAccessorTable; } + } + + public const int AccountIdFieldNumber = 1; + private bool hasAccountId; + private global::D3.OnlineService.EntityId accountId_; + public bool HasAccountId { + get { return hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return accountId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public const int HeroIdsFieldNumber = 2; + private pbc::PopsicleList heroIds_ = new pbc::PopsicleList(); + public scg::IList HeroIdsList { + get { return heroIds_; } + } + public int HeroIdsCount { + get { return heroIds_.Count; } + } + public global::D3.OnlineService.EntityId GetHeroIds(int index) { + return heroIds_[index]; + } + + public override bool IsInitialized { + get { + if (!hasAccountId) return false; + if (!AccountId.IsInitialized) return false; + foreach (global::D3.OnlineService.EntityId element in HeroIdsList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getHeroProfilesFieldNames; + if (hasAccountId) { + output.WriteMessage(1, field_names[0], AccountId); + } + if (heroIds_.Count > 0) { + output.WriteMessageArray(2, field_names[1], heroIds_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AccountId); + } + foreach (global::D3.OnlineService.EntityId element in HeroIdsList) { + size += pb::CodedOutputStream.ComputeMessageSize(2, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetHeroProfiles ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetHeroProfiles ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetHeroProfiles ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetHeroProfiles ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetHeroProfiles ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetHeroProfiles ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetHeroProfiles ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetHeroProfiles ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetHeroProfiles ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetHeroProfiles ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetHeroProfiles MakeReadOnly() { + heroIds_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetHeroProfiles prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetHeroProfiles cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetHeroProfiles result; + + private GetHeroProfiles PrepareBuilder() { + if (resultIsReadOnly) { + GetHeroProfiles original = result; + result = new GetHeroProfiles(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetHeroProfiles MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.GetHeroProfiles.Descriptor; } + } + + public override GetHeroProfiles DefaultInstanceForType { + get { return global::D3.GameMessage.GetHeroProfiles.DefaultInstance; } + } + + public override GetHeroProfiles BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetHeroProfiles) { + return MergeFrom((GetHeroProfiles) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetHeroProfiles other) { + if (other == global::D3.GameMessage.GetHeroProfiles.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAccountId) { + MergeAccountId(other.AccountId); + } + if (other.heroIds_.Count != 0) { + result.heroIds_.Add(other.heroIds_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getHeroProfilesFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getHeroProfilesFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasAccountId) { + subBuilder.MergeFrom(AccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + AccountId = subBuilder.BuildPartial(); + break; + } + case 18: { + input.ReadMessageArray(tag, field_name, result.heroIds_, global::D3.OnlineService.EntityId.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAccountId { + get { return result.hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return result.AccountId; } + set { SetAccountId(value); } + } + public Builder SetAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = value; + return this; + } + public Builder SetAccountId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = builderForValue.Build(); + return this; + } + public Builder MergeAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccountId && + result.accountId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.accountId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.accountId_).MergeFrom(value).BuildPartial(); + } else { + result.accountId_ = value; + } + result.hasAccountId = true; + return this; + } + public Builder ClearAccountId() { + PrepareBuilder(); + result.hasAccountId = false; + result.accountId_ = null; + return this; + } + + public pbc::IPopsicleList HeroIdsList { + get { return PrepareBuilder().heroIds_; } + } + public int HeroIdsCount { + get { return result.HeroIdsCount; } + } + public global::D3.OnlineService.EntityId GetHeroIds(int index) { + return result.GetHeroIds(index); + } + public Builder SetHeroIds(int index, global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.heroIds_[index] = value; + return this; + } + public Builder SetHeroIds(int index, global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.heroIds_[index] = builderForValue.Build(); + return this; + } + public Builder AddHeroIds(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.heroIds_.Add(value); + return this; + } + public Builder AddHeroIds(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.heroIds_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeHeroIds(scg::IEnumerable values) { + PrepareBuilder(); + result.heroIds_.Add(values); + return this; + } + public Builder ClearHeroIds() { + PrepareBuilder(); + result.heroIds_.Clear(); + return this; + } + } + static GetHeroProfiles() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetAccountPrefs : pb::GeneratedMessage { + private GetAccountPrefs() { } + private static readonly GetAccountPrefs defaultInstance = new GetAccountPrefs().MakeReadOnly(); + private static readonly string[] _getAccountPrefsFieldNames = new string[] { }; + private static readonly uint[] _getAccountPrefsFieldTags = new uint[] { }; + public static GetAccountPrefs DefaultInstance { + get { return defaultInstance; } + } + + public override GetAccountPrefs DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetAccountPrefs ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_GetAccountPrefs__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_GetAccountPrefs__FieldAccessorTable; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getAccountPrefsFieldNames; + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetAccountPrefs ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetAccountPrefs ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetAccountPrefs ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetAccountPrefs ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetAccountPrefs ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetAccountPrefs ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetAccountPrefs ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetAccountPrefs ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetAccountPrefs ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetAccountPrefs ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetAccountPrefs MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetAccountPrefs prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetAccountPrefs cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetAccountPrefs result; + + private GetAccountPrefs PrepareBuilder() { + if (resultIsReadOnly) { + GetAccountPrefs original = result; + result = new GetAccountPrefs(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetAccountPrefs MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.GetAccountPrefs.Descriptor; } + } + + public override GetAccountPrefs DefaultInstanceForType { + get { return global::D3.GameMessage.GetAccountPrefs.DefaultInstance; } + } + + public override GetAccountPrefs BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetAccountPrefs) { + return MergeFrom((GetAccountPrefs) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetAccountPrefs other) { + if (other == global::D3.GameMessage.GetAccountPrefs.DefaultInstance) return this; + PrepareBuilder(); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getAccountPrefsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getAccountPrefsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + } + static GetAccountPrefs() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class SetAccountPrefs : pb::GeneratedMessage { + private SetAccountPrefs() { } + private static readonly SetAccountPrefs defaultInstance = new SetAccountPrefs().MakeReadOnly(); + private static readonly string[] _setAccountPrefsFieldNames = new string[] { "prefs" }; + private static readonly uint[] _setAccountPrefsFieldTags = new uint[] { 10 }; + public static SetAccountPrefs DefaultInstance { + get { return defaultInstance; } + } + + public override SetAccountPrefs DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SetAccountPrefs ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_SetAccountPrefs__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_SetAccountPrefs__FieldAccessorTable; } + } + + public const int PrefsFieldNumber = 1; + private bool hasPrefs; + private global::D3.Client.Preferences prefs_; + public bool HasPrefs { + get { return hasPrefs; } + } + public global::D3.Client.Preferences Prefs { + get { return prefs_ ?? global::D3.Client.Preferences.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasPrefs) return false; + if (!Prefs.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _setAccountPrefsFieldNames; + if (hasPrefs) { + output.WriteMessage(1, field_names[0], Prefs); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasPrefs) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Prefs); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static SetAccountPrefs ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SetAccountPrefs ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SetAccountPrefs ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SetAccountPrefs ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SetAccountPrefs ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SetAccountPrefs ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SetAccountPrefs ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SetAccountPrefs ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SetAccountPrefs ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SetAccountPrefs ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SetAccountPrefs MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SetAccountPrefs prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SetAccountPrefs cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SetAccountPrefs result; + + private SetAccountPrefs PrepareBuilder() { + if (resultIsReadOnly) { + SetAccountPrefs original = result; + result = new SetAccountPrefs(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SetAccountPrefs MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.SetAccountPrefs.Descriptor; } + } + + public override SetAccountPrefs DefaultInstanceForType { + get { return global::D3.GameMessage.SetAccountPrefs.DefaultInstance; } + } + + public override SetAccountPrefs BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SetAccountPrefs) { + return MergeFrom((SetAccountPrefs) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SetAccountPrefs other) { + if (other == global::D3.GameMessage.SetAccountPrefs.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasPrefs) { + MergePrefs(other.Prefs); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_setAccountPrefsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _setAccountPrefsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.Client.Preferences.Builder subBuilder = global::D3.Client.Preferences.CreateBuilder(); + if (result.hasPrefs) { + subBuilder.MergeFrom(Prefs); + } + input.ReadMessage(subBuilder, extensionRegistry); + Prefs = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasPrefs { + get { return result.hasPrefs; } + } + public global::D3.Client.Preferences Prefs { + get { return result.Prefs; } + set { SetPrefs(value); } + } + public Builder SetPrefs(global::D3.Client.Preferences value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPrefs = true; + result.prefs_ = value; + return this; + } + public Builder SetPrefs(global::D3.Client.Preferences.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPrefs = true; + result.prefs_ = builderForValue.Build(); + return this; + } + public Builder MergePrefs(global::D3.Client.Preferences value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasPrefs && + result.prefs_ != global::D3.Client.Preferences.DefaultInstance) { + result.prefs_ = global::D3.Client.Preferences.CreateBuilder(result.prefs_).MergeFrom(value).BuildPartial(); + } else { + result.prefs_ = value; + } + result.hasPrefs = true; + return this; + } + public Builder ClearPrefs() { + PrepareBuilder(); + result.hasPrefs = false; + result.prefs_ = null; + return this; + } + } + static SetAccountPrefs() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetHeroDigest : pb::GeneratedMessage { + private GetHeroDigest() { } + private static readonly GetHeroDigest defaultInstance = new GetHeroDigest().MakeReadOnly(); + private static readonly string[] _getHeroDigestFieldNames = new string[] { "account_id", "hero_id" }; + private static readonly uint[] _getHeroDigestFieldTags = new uint[] { 10, 18 }; + public static GetHeroDigest DefaultInstance { + get { return defaultInstance; } + } + + public override GetHeroDigest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetHeroDigest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_GetHeroDigest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_GetHeroDigest__FieldAccessorTable; } + } + + public const int AccountIdFieldNumber = 1; + private bool hasAccountId; + private global::D3.OnlineService.EntityId accountId_; + public bool HasAccountId { + get { return hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return accountId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public const int HeroIdFieldNumber = 2; + private bool hasHeroId; + private global::D3.OnlineService.EntityId heroId_; + public bool HasHeroId { + get { return hasHeroId; } + } + public global::D3.OnlineService.EntityId HeroId { + get { return heroId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasAccountId) return false; + if (!hasHeroId) return false; + if (!AccountId.IsInitialized) return false; + if (!HeroId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getHeroDigestFieldNames; + if (hasAccountId) { + output.WriteMessage(1, field_names[0], AccountId); + } + if (hasHeroId) { + output.WriteMessage(2, field_names[1], HeroId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AccountId); + } + if (hasHeroId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, HeroId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetHeroDigest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetHeroDigest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetHeroDigest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetHeroDigest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetHeroDigest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetHeroDigest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetHeroDigest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetHeroDigest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetHeroDigest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetHeroDigest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetHeroDigest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetHeroDigest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetHeroDigest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetHeroDigest result; + + private GetHeroDigest PrepareBuilder() { + if (resultIsReadOnly) { + GetHeroDigest original = result; + result = new GetHeroDigest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetHeroDigest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.GetHeroDigest.Descriptor; } + } + + public override GetHeroDigest DefaultInstanceForType { + get { return global::D3.GameMessage.GetHeroDigest.DefaultInstance; } + } + + public override GetHeroDigest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetHeroDigest) { + return MergeFrom((GetHeroDigest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetHeroDigest other) { + if (other == global::D3.GameMessage.GetHeroDigest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAccountId) { + MergeAccountId(other.AccountId); + } + if (other.HasHeroId) { + MergeHeroId(other.HeroId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getHeroDigestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getHeroDigestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasAccountId) { + subBuilder.MergeFrom(AccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + AccountId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasHeroId) { + subBuilder.MergeFrom(HeroId); + } + input.ReadMessage(subBuilder, extensionRegistry); + HeroId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAccountId { + get { return result.hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return result.AccountId; } + set { SetAccountId(value); } + } + public Builder SetAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = value; + return this; + } + public Builder SetAccountId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = builderForValue.Build(); + return this; + } + public Builder MergeAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccountId && + result.accountId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.accountId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.accountId_).MergeFrom(value).BuildPartial(); + } else { + result.accountId_ = value; + } + result.hasAccountId = true; + return this; + } + public Builder ClearAccountId() { + PrepareBuilder(); + result.hasAccountId = false; + result.accountId_ = null; + return this; + } + + public bool HasHeroId { + get { return result.hasHeroId; } + } + public global::D3.OnlineService.EntityId HeroId { + get { return result.HeroId; } + set { SetHeroId(value); } + } + public Builder SetHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasHeroId = true; + result.heroId_ = value; + return this; + } + public Builder SetHeroId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasHeroId = true; + result.heroId_ = builderForValue.Build(); + return this; + } + public Builder MergeHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasHeroId && + result.heroId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.heroId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.heroId_).MergeFrom(value).BuildPartial(); + } else { + result.heroId_ = value; + } + result.hasHeroId = true; + return this; + } + public Builder ClearHeroId() { + PrepareBuilder(); + result.hasHeroId = false; + result.heroId_ = null; + return this; + } + } + static GetHeroDigest() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetHeroIds : pb::GeneratedMessage { + private GetHeroIds() { } + private static readonly GetHeroIds defaultInstance = new GetHeroIds().MakeReadOnly(); + private static readonly string[] _getHeroIdsFieldNames = new string[] { "account_id" }; + private static readonly uint[] _getHeroIdsFieldTags = new uint[] { 10 }; + public static GetHeroIds DefaultInstance { + get { return defaultInstance; } + } + + public override GetHeroIds DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetHeroIds ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_GetHeroIds__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_GetHeroIds__FieldAccessorTable; } + } + + public const int AccountIdFieldNumber = 1; + private bool hasAccountId; + private global::D3.OnlineService.EntityId accountId_; + public bool HasAccountId { + get { return hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return accountId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasAccountId) return false; + if (!AccountId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getHeroIdsFieldNames; + if (hasAccountId) { + output.WriteMessage(1, field_names[0], AccountId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AccountId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetHeroIds ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetHeroIds ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetHeroIds ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetHeroIds ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetHeroIds ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetHeroIds ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetHeroIds ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetHeroIds ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetHeroIds ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetHeroIds ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetHeroIds MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetHeroIds prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetHeroIds cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetHeroIds result; + + private GetHeroIds PrepareBuilder() { + if (resultIsReadOnly) { + GetHeroIds original = result; + result = new GetHeroIds(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetHeroIds MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.GetHeroIds.Descriptor; } + } + + public override GetHeroIds DefaultInstanceForType { + get { return global::D3.GameMessage.GetHeroIds.DefaultInstance; } + } + + public override GetHeroIds BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetHeroIds) { + return MergeFrom((GetHeroIds) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetHeroIds other) { + if (other == global::D3.GameMessage.GetHeroIds.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAccountId) { + MergeAccountId(other.AccountId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getHeroIdsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getHeroIdsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasAccountId) { + subBuilder.MergeFrom(AccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + AccountId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAccountId { + get { return result.hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return result.AccountId; } + set { SetAccountId(value); } + } + public Builder SetAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = value; + return this; + } + public Builder SetAccountId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = builderForValue.Build(); + return this; + } + public Builder MergeAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccountId && + result.accountId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.accountId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.accountId_).MergeFrom(value).BuildPartial(); + } else { + result.accountId_ = value; + } + result.hasAccountId = true; + return this; + } + public Builder ClearAccountId() { + PrepareBuilder(); + result.hasAccountId = false; + result.accountId_ = null; + return this; + } + } + static GetHeroIds() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetDeletedHero : pb::GeneratedMessage { + private GetDeletedHero() { } + private static readonly GetDeletedHero defaultInstance = new GetDeletedHero().MakeReadOnly(); + private static readonly string[] _getDeletedHeroFieldNames = new string[] { }; + private static readonly uint[] _getDeletedHeroFieldTags = new uint[] { }; + public static GetDeletedHero DefaultInstance { + get { return defaultInstance; } + } + + public override GetDeletedHero DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetDeletedHero ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_GetDeletedHero__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_GetDeletedHero__FieldAccessorTable; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getDeletedHeroFieldNames; + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetDeletedHero ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetDeletedHero ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetDeletedHero ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetDeletedHero ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetDeletedHero ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetDeletedHero ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetDeletedHero ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetDeletedHero ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetDeletedHero ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetDeletedHero ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetDeletedHero MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetDeletedHero prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetDeletedHero cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetDeletedHero result; + + private GetDeletedHero PrepareBuilder() { + if (resultIsReadOnly) { + GetDeletedHero original = result; + result = new GetDeletedHero(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetDeletedHero MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.GetDeletedHero.Descriptor; } + } + + public override GetDeletedHero DefaultInstanceForType { + get { return global::D3.GameMessage.GetDeletedHero.DefaultInstance; } + } + + public override GetDeletedHero BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetDeletedHero) { + return MergeFrom((GetDeletedHero) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetDeletedHero other) { + if (other == global::D3.GameMessage.GetDeletedHero.DefaultInstance) return this; + PrepareBuilder(); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getDeletedHeroFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getDeletedHeroFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + } + static GetDeletedHero() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class CSGetSnapshots : pb::GeneratedMessage { + private CSGetSnapshots() { } + private static readonly CSGetSnapshots defaultInstance = new CSGetSnapshots().MakeReadOnly(); + private static readonly string[] _cSGetSnapshotsFieldNames = new string[] { }; + private static readonly uint[] _cSGetSnapshotsFieldTags = new uint[] { }; + public static CSGetSnapshots DefaultInstance { + get { return defaultInstance; } + } + + public override CSGetSnapshots DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override CSGetSnapshots ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_CSGetSnapshots__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_CSGetSnapshots__FieldAccessorTable; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _cSGetSnapshotsFieldNames; + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static CSGetSnapshots ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CSGetSnapshots ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CSGetSnapshots ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CSGetSnapshots ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CSGetSnapshots ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CSGetSnapshots ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static CSGetSnapshots ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static CSGetSnapshots ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static CSGetSnapshots ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CSGetSnapshots ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CSGetSnapshots MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(CSGetSnapshots prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CSGetSnapshots cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CSGetSnapshots result; + + private CSGetSnapshots PrepareBuilder() { + if (resultIsReadOnly) { + CSGetSnapshots original = result; + result = new CSGetSnapshots(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CSGetSnapshots MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.CSGetSnapshots.Descriptor; } + } + + public override CSGetSnapshots DefaultInstanceForType { + get { return global::D3.GameMessage.CSGetSnapshots.DefaultInstance; } + } + + public override CSGetSnapshots BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is CSGetSnapshots) { + return MergeFrom((CSGetSnapshots) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(CSGetSnapshots other) { + if (other == global::D3.GameMessage.CSGetSnapshots.DefaultInstance) return this; + PrepareBuilder(); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_cSGetSnapshotsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _cSGetSnapshotsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + } + static CSGetSnapshots() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class CSPullSnapshot : pb::GeneratedMessage { + private CSPullSnapshot() { } + private static readonly CSPullSnapshot defaultInstance = new CSPullSnapshot().MakeReadOnly(); + private static readonly string[] _cSPullSnapshotFieldNames = new string[] { "version" }; + private static readonly uint[] _cSPullSnapshotFieldTags = new uint[] { 8 }; + public static CSPullSnapshot DefaultInstance { + get { return defaultInstance; } + } + + public override CSPullSnapshot DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override CSPullSnapshot ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_CSPullSnapshot__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_CSPullSnapshot__FieldAccessorTable; } + } + + public const int VersionFieldNumber = 1; + private bool hasVersion; + private ulong version_; + public bool HasVersion { + get { return hasVersion; } + } + public ulong Version { + get { return version_; } + } + + public override bool IsInitialized { + get { + if (!hasVersion) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _cSPullSnapshotFieldNames; + if (hasVersion) { + output.WriteUInt64(1, field_names[0], Version); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasVersion) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, Version); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static CSPullSnapshot ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CSPullSnapshot ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CSPullSnapshot ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CSPullSnapshot ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CSPullSnapshot ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CSPullSnapshot ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static CSPullSnapshot ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static CSPullSnapshot ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static CSPullSnapshot ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CSPullSnapshot ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CSPullSnapshot MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(CSPullSnapshot prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CSPullSnapshot cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CSPullSnapshot result; + + private CSPullSnapshot PrepareBuilder() { + if (resultIsReadOnly) { + CSPullSnapshot original = result; + result = new CSPullSnapshot(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CSPullSnapshot MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.CSPullSnapshot.Descriptor; } + } + + public override CSPullSnapshot DefaultInstanceForType { + get { return global::D3.GameMessage.CSPullSnapshot.DefaultInstance; } + } + + public override CSPullSnapshot BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is CSPullSnapshot) { + return MergeFrom((CSPullSnapshot) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(CSPullSnapshot other) { + if (other == global::D3.GameMessage.CSPullSnapshot.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasVersion) { + Version = other.Version; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_cSPullSnapshotFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _cSPullSnapshotFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasVersion = input.ReadUInt64(ref result.version_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasVersion { + get { return result.hasVersion; } + } + public ulong Version { + get { return result.Version; } + set { SetVersion(value); } + } + public Builder SetVersion(ulong value) { + PrepareBuilder(); + result.hasVersion = true; + result.version_ = value; + return this; + } + public Builder ClearVersion() { + PrepareBuilder(); + result.hasVersion = false; + result.version_ = 0UL; + return this; + } + } + static CSPullSnapshot() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class CSPushSnapshot : pb::GeneratedMessage { + private CSPushSnapshot() { } + private static readonly CSPushSnapshot defaultInstance = new CSPushSnapshot().MakeReadOnly(); + private static readonly string[] _cSPushSnapshotFieldNames = new string[] { "data" }; + private static readonly uint[] _cSPushSnapshotFieldTags = new uint[] { 10 }; + public static CSPushSnapshot DefaultInstance { + get { return defaultInstance; } + } + + public override CSPushSnapshot DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override CSPushSnapshot ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_CSPushSnapshot__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_CSPushSnapshot__FieldAccessorTable; } + } + + public const int DataFieldNumber = 1; + private bool hasData; + private global::D3.CS.Snapshot data_; + public bool HasData { + get { return hasData; } + } + public global::D3.CS.Snapshot Data { + get { return data_ ?? global::D3.CS.Snapshot.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasData) return false; + if (!Data.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _cSPushSnapshotFieldNames; + if (hasData) { + output.WriteMessage(1, field_names[0], Data); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasData) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Data); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static CSPushSnapshot ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CSPushSnapshot ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CSPushSnapshot ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CSPushSnapshot ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CSPushSnapshot ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CSPushSnapshot ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static CSPushSnapshot ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static CSPushSnapshot ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static CSPushSnapshot ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CSPushSnapshot ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CSPushSnapshot MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(CSPushSnapshot prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CSPushSnapshot cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CSPushSnapshot result; + + private CSPushSnapshot PrepareBuilder() { + if (resultIsReadOnly) { + CSPushSnapshot original = result; + result = new CSPushSnapshot(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CSPushSnapshot MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.CSPushSnapshot.Descriptor; } + } + + public override CSPushSnapshot DefaultInstanceForType { + get { return global::D3.GameMessage.CSPushSnapshot.DefaultInstance; } + } + + public override CSPushSnapshot BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is CSPushSnapshot) { + return MergeFrom((CSPushSnapshot) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(CSPushSnapshot other) { + if (other == global::D3.GameMessage.CSPushSnapshot.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasData) { + MergeData(other.Data); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_cSPushSnapshotFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _cSPushSnapshotFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.CS.Snapshot.Builder subBuilder = global::D3.CS.Snapshot.CreateBuilder(); + if (result.hasData) { + subBuilder.MergeFrom(Data); + } + input.ReadMessage(subBuilder, extensionRegistry); + Data = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasData { + get { return result.hasData; } + } + public global::D3.CS.Snapshot Data { + get { return result.Data; } + set { SetData(value); } + } + public Builder SetData(global::D3.CS.Snapshot value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasData = true; + result.data_ = value; + return this; + } + public Builder SetData(global::D3.CS.Snapshot.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasData = true; + result.data_ = builderForValue.Build(); + return this; + } + public Builder MergeData(global::D3.CS.Snapshot value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasData && + result.data_ != global::D3.CS.Snapshot.DefaultInstance) { + result.data_ = global::D3.CS.Snapshot.CreateBuilder(result.data_).MergeFrom(value).BuildPartial(); + } else { + result.data_ = value; + } + result.hasData = true; + return this; + } + public Builder ClearData() { + PrepareBuilder(); + result.hasData = false; + result.data_ = null; + return this; + } + } + static CSPushSnapshot() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class CSRestoreToSnapshot : pb::GeneratedMessage { + private CSRestoreToSnapshot() { } + private static readonly CSRestoreToSnapshot defaultInstance = new CSRestoreToSnapshot().MakeReadOnly(); + private static readonly string[] _cSRestoreToSnapshotFieldNames = new string[] { "version" }; + private static readonly uint[] _cSRestoreToSnapshotFieldTags = new uint[] { 8 }; + public static CSRestoreToSnapshot DefaultInstance { + get { return defaultInstance; } + } + + public override CSRestoreToSnapshot DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override CSRestoreToSnapshot ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_CSRestoreToSnapshot__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_CSRestoreToSnapshot__FieldAccessorTable; } + } + + public const int VersionFieldNumber = 1; + private bool hasVersion; + private ulong version_; + public bool HasVersion { + get { return hasVersion; } + } + public ulong Version { + get { return version_; } + } + + public override bool IsInitialized { + get { + if (!hasVersion) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _cSRestoreToSnapshotFieldNames; + if (hasVersion) { + output.WriteUInt64(1, field_names[0], Version); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasVersion) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, Version); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static CSRestoreToSnapshot ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CSRestoreToSnapshot ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CSRestoreToSnapshot ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CSRestoreToSnapshot ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CSRestoreToSnapshot ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CSRestoreToSnapshot ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static CSRestoreToSnapshot ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static CSRestoreToSnapshot ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static CSRestoreToSnapshot ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CSRestoreToSnapshot ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CSRestoreToSnapshot MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(CSRestoreToSnapshot prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CSRestoreToSnapshot cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CSRestoreToSnapshot result; + + private CSRestoreToSnapshot PrepareBuilder() { + if (resultIsReadOnly) { + CSRestoreToSnapshot original = result; + result = new CSRestoreToSnapshot(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CSRestoreToSnapshot MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.CSRestoreToSnapshot.Descriptor; } + } + + public override CSRestoreToSnapshot DefaultInstanceForType { + get { return global::D3.GameMessage.CSRestoreToSnapshot.DefaultInstance; } + } + + public override CSRestoreToSnapshot BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is CSRestoreToSnapshot) { + return MergeFrom((CSRestoreToSnapshot) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(CSRestoreToSnapshot other) { + if (other == global::D3.GameMessage.CSRestoreToSnapshot.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasVersion) { + Version = other.Version; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_cSRestoreToSnapshotFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _cSRestoreToSnapshotFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasVersion = input.ReadUInt64(ref result.version_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasVersion { + get { return result.hasVersion; } + } + public ulong Version { + get { return result.Version; } + set { SetVersion(value); } + } + public Builder SetVersion(ulong value) { + PrepareBuilder(); + result.hasVersion = true; + result.version_ = value; + return this; + } + public Builder ClearVersion() { + PrepareBuilder(); + result.hasVersion = false; + result.version_ = 0UL; + return this; + } + } + static CSRestoreToSnapshot() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class CSWriteSnapshot : pb::GeneratedMessage { + private CSWriteSnapshot() { } + private static readonly CSWriteSnapshot defaultInstance = new CSWriteSnapshot().MakeReadOnly(); + private static readonly string[] _cSWriteSnapshotFieldNames = new string[] { }; + private static readonly uint[] _cSWriteSnapshotFieldTags = new uint[] { }; + public static CSWriteSnapshot DefaultInstance { + get { return defaultInstance; } + } + + public override CSWriteSnapshot DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override CSWriteSnapshot ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_CSWriteSnapshot__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_CSWriteSnapshot__FieldAccessorTable; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _cSWriteSnapshotFieldNames; + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static CSWriteSnapshot ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CSWriteSnapshot ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CSWriteSnapshot ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CSWriteSnapshot ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CSWriteSnapshot ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CSWriteSnapshot ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static CSWriteSnapshot ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static CSWriteSnapshot ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static CSWriteSnapshot ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CSWriteSnapshot ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CSWriteSnapshot MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(CSWriteSnapshot prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CSWriteSnapshot cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CSWriteSnapshot result; + + private CSWriteSnapshot PrepareBuilder() { + if (resultIsReadOnly) { + CSWriteSnapshot original = result; + result = new CSWriteSnapshot(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CSWriteSnapshot MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.GameMessage.CSWriteSnapshot.Descriptor; } + } + + public override CSWriteSnapshot DefaultInstanceForType { + get { return global::D3.GameMessage.CSWriteSnapshot.DefaultInstance; } + } + + public override CSWriteSnapshot BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is CSWriteSnapshot) { + return MergeFrom((CSWriteSnapshot) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(CSWriteSnapshot other) { + if (other == global::D3.GameMessage.CSWriteSnapshot.DefaultInstance) return this; + PrepareBuilder(); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_cSWriteSnapshotFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _cSWriteSnapshotFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + } + static CSWriteSnapshot() { + object.ReferenceEquals(global::D3.GameMessage.GameMessage.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code diff --git a/source/D3Proto/D3/Hero/Hero.cs b/src/LibMooNet/D3/Hero/Hero.cs similarity index 51% rename from source/D3Proto/D3/Hero/Hero.cs rename to src/LibMooNet/D3/Hero/Hero.cs index bc90c6f7..a64d8c42 100644 --- a/source/D3Proto/D3/Hero/Hero.cs +++ b/src/LibMooNet/D3/Hero/Hero.cs @@ -1,4 +1,6 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code using pb = global::Google.ProtocolBuffers; using pbc = global::Google.ProtocolBuffers.Collections; @@ -6,6 +8,9 @@ using scg = global::System.Collections.Generic; namespace D3.Hero { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public static partial class Hero { #region Extension registration @@ -23,10 +28,8 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Hero_QuestRewardHistoryEntry__FieldAccessorTable; internal static pbd::MessageDescriptor internal__static_D3_Hero_Digest__Descriptor; internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Hero_Digest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_D3_Hero_HotbarButtonData__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Hero_HotbarButtonData__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_D3_Hero_SkillKeyMapping__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Hero_SkillKeyMapping__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_Hero_DigestUI__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Hero_DigestUI__FieldAccessorTable; internal static pbd::MessageDescriptor internal__static_D3_Hero_SavedQuest__Descriptor; internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Hero_SavedQuest__FieldAccessorTable; internal static pbd::MessageDescriptor internal__static_D3_Hero_LearnedLore__Descriptor; @@ -35,18 +38,26 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Hero_SavedConversations__FieldAccessorTable; internal static pbd::MessageDescriptor internal__static_D3_Hero_SavePointData_Proto__Descriptor; internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Hero_SavePointData_Proto__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_Hero_SkillWithRune__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Hero_SkillWithRune__FieldAccessorTable; internal static pbd::MessageDescriptor internal__static_D3_Hero_SavedData__Descriptor; internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Hero_SavedData__FieldAccessorTable; internal static pbd::MessageDescriptor internal__static_D3_Hero_Timestamps__Descriptor; internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Hero_Timestamps__FieldAccessorTable; internal static pbd::MessageDescriptor internal__static_D3_Hero_SavedDefinition__Descriptor; internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Hero_SavedDefinition__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_D3_Hero_NameSequence__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Hero_NameSequence__FieldAccessorTable; internal static pbd::MessageDescriptor internal__static_D3_Hero_NameText__Descriptor; internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Hero_NameText__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_D3_Hero_Escrow__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Hero_Escrow__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_Hero_HeroList__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Hero_HeroList__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_Hero_DigestList__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Hero_DigestList__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_Hero_QuestHistoryList__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Hero_QuestHistoryList__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_Hero_SavedQuestList__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Hero_SavedQuestList__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_Hero_QuestRewardHistoryList__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Hero_QuestRewardHistoryList__FieldAccessorTable; #endregion #region Descriptor public static pbd::FileDescriptor Descriptor { @@ -58,58 +69,70 @@ static Hero() { byte[] descriptorData = global::System.Convert.FromBase64String( "CgpIZXJvLnByb3RvEgdEMy5IZXJvGhlBdHRyaWJ1dGVTZXJpYWxpemVyLnBy" + "b3RvGg5IaXJlbGluZy5wcm90bxoLSXRlbXMucHJvdG8aE09ubGluZVNlcnZp" + - "Y2UucHJvdG8iXAoKVmlzdWFsSXRlbRIMCgRnYmlkGAEgASgPEhAKCGR5ZV90" + - "eXBlGAIgASgREhgKEGl0ZW1fZWZmZWN0X3R5cGUYAyABKBESFAoMZWZmZWN0" + - "X2xldmVsGAQgASgRIjsKD1Zpc3VhbEVxdWlwbWVudBIoCgt2aXN1YWxfaXRl" + - "bRgBIAMoCzITLkQzLkhlcm8uVmlzdWFsSXRlbSI6ChFRdWVzdEhpc3RvcnlF" + - "bnRyeRIRCglzbm9fcXVlc3QYASACKA8SEgoKZGlmZmljdWx0eRgCIAIoESJS" + - "ChdRdWVzdFJld2FyZEhpc3RvcnlFbnRyeRIRCglzbm9fcXVlc3QYASACKA8S" + - "EAoIc3RlcF91aWQYAiACKBESEgoKZGlmZmljdWx0eRgDIAIoESLFAwoGRGln" + - "ZXN0Eg8KB3ZlcnNpb24YASACKA0SKwoHaGVyb19pZBgCIAIoCzIaLkQzLk9u" + - "bGluZVNlcnZpY2UuRW50aXR5SWQSEQoJaGVyb19uYW1lGAMgAigJEhIKCmdi" + - "aWRfY2xhc3MYBCACKA8SDQoFbGV2ZWwYBSACKBESFAoMcGxheWVyX2ZsYWdz" + - "GAYgAigNEjIKEHZpc3VhbF9lcXVpcG1lbnQYByACKAsyGC5EMy5IZXJvLlZp" + - "c3VhbEVxdWlwbWVudBIxCg1xdWVzdF9oaXN0b3J5GAggAygLMhouRDMuSGVy" + - "by5RdWVzdEhpc3RvcnlFbnRyeRIXCg9sYXN0X3BsYXllZF9hY3QYCiACKBES" + - "HAoUaGlnaGVzdF91bmxvY2tlZF9hY3QYCyACKBESHgoWbGFzdF9wbGF5ZWRf" + - "ZGlmZmljdWx0eRgMIAIoERIjChtoaWdoZXN0X3VubG9ja2VkX2RpZmZpY3Vs" + - "dHkYDSACKBESGQoRbGFzdF9wbGF5ZWRfcXVlc3QYDiACKA8SHgoWbGFzdF9w" + - "bGF5ZWRfcXVlc3Rfc3RlcBgPIAIoERITCgt0aW1lX3BsYXllZBgQIAIoDSI4" + - "ChBIb3RiYXJCdXR0b25EYXRhEhEKCXNub19wb3dlchgBIAIoDxIRCglnYmlk" + - "X2l0ZW0YAiACKA8iTQoPU2tpbGxLZXlNYXBwaW5nEhEKCXNub19wb3dlchgB" + - "IAIoDxIRCglpZF9ob3RrZXkYAiACKBESFAoMc2tpbGxfYnV0dG9uGAMgAigR" + - "IocBCgpTYXZlZFF1ZXN0EhEKCXNub19xdWVzdBgBIAIoDxISCgpkaWZmaWN1" + - "bHR5GAIgAigREhgKEGN1cnJlbnRfc3RlcF91aWQYAyACKBESFwoPb2JqZWN0" + - "aXZlX3N0YXRlGAQgAygREh8KF2ZhaWx1cmVfY29uZGl0aW9uX3N0YXRlGAUg" + - "AygRIicKC0xlYXJuZWRMb3JlEhgKEHNub19sb3JlX2xlYXJuZWQYASADKA8i" + - "XAoSU2F2ZWRDb252ZXJzYXRpb25zEiUKHXBsYXllZF9jb252ZXJzYXRpb25z" + - "X2JpdGZpZWxkGAEgAigMEh8KF3Nub19zYXZlZF9jb252ZXJzYXRpb25zGAIg" + - "AygPIloKE1NhdmVQb2ludERhdGFfUHJvdG8SEQoJc25vX3dvcmxkGAEgAigP" + - "EhgKEHNhdmVwb2ludF9udW1iZXIYAiACKBESFgoOY3JlYXRlc19wb3J0YWwY" + - "AyACKA0i2QMKCVNhdmVkRGF0YRI8Chlob3RiYXJfYnV0dG9uX2Fzc2lnbm1l" + - "bnRzGAEgAygLMhkuRDMuSGVyby5Ib3RiYXJCdXR0b25EYXRhEi8KDXNraWxs" + - "X2tleV9tYXAYAiADKAsyGC5EMy5IZXJvLlNraWxsS2V5TWFwcGluZxITCgt0" + - "aW1lX3BsYXllZBgDIAIoDRIbChNhY3RpdmF0ZWRfd2F5cG9pbnRzGAQgAigN" + - "EjMKE2hpcmVsaW5nX3NhdmVkX2RhdGEYBSACKAsyFi5EMy5IaXJlbGluZy5T" + - "YXZlZERhdGESFwoPbGFzdF9sZXZlbF90aW1lGAYgAigNEioKDGxlYXJuZWRf" + - "bG9yZRgHIAIoCzIULkQzLkhlcm8uTGVhcm5lZExvcmUSOAoTc2F2ZWRfY29u" + - "dmVyc2F0aW9ucxgIIAIoCzIbLkQzLkhlcm8uU2F2ZWRDb252ZXJzYXRpb25z" + - "EhkKEXNub19hY3RpdmVfc2tpbGxzGAkgAygPEhIKCnNub190cmFpdHMYCiAD" + - "KA8SFgoOc2Vlbl90dXRvcmlhbHMYCyADKA8SMAoKc2F2ZV9wb2ludBgMIAIo" + - "CzIcLkQzLkhlcm8uU2F2ZVBvaW50RGF0YV9Qcm90byI2CgpUaW1lc3RhbXBz" + - "EhMKC2NyZWF0ZV90aW1lGAEgAigSEhMKC2RlbGV0ZV90aW1lGAIgASgSIrsC" + - "Cg9TYXZlZERlZmluaXRpb24SDwoHdmVyc2lvbhgBIAIoDRIfCgZkaWdlc3QY" + - "AiABKAsyDy5EMy5IZXJvLkRpZ2VzdBJBChBzYXZlZF9hdHRyaWJ1dGVzGAMg" + - "AigLMicuRDMuQXR0cmlidXRlU2VyaWFsaXplci5TYXZlZEF0dHJpYnV0ZXMS" + - "JgoKc2F2ZWRfZGF0YRgEIAEoCzISLkQzLkhlcm8uU2F2ZWREYXRhEigKC3Nh" + - "dmVkX3F1ZXN0GAUgAygLMhMuRDMuSGVyby5TYXZlZFF1ZXN0EiEKBWl0ZW1z" + - "GAYgASgLMhIuRDMuSXRlbXMuSXRlbUxpc3QSPgoUcXVlc3RfcmV3YXJkX2hp" + - "c3RvcnkYByADKAsyIC5EMy5IZXJvLlF1ZXN0UmV3YXJkSGlzdG9yeUVudHJ5" + - "IiAKDE5hbWVTZXF1ZW5jZRIQCghzZXF1ZW5jZRgBIAEoAyIYCghOYW1lVGV4" + - "dBIMCgRuYW1lGAEgAigJIncKBkVzY3JvdxIPCgd2ZXJzaW9uGAEgAigNEiYK" + - "CWdlbmVyYXRvchgCIAEoCzITLkQzLkl0ZW1zLkdlbmVyYXRvchIlCgloZXJv" + - "X2RhdGEYAyABKAsyEi5EMy5IZXJvLlNhdmVkRGF0YRINCgVzdGF0ZRgEIAEo" + - "DQ=="); + "Y2UucHJvdG8iagoKVmlzdWFsSXRlbRIQCgRnYmlkGAEgASgPOgItMRITCghk" + + "eWVfdHlwZRgCIAEoEToBMBIbChBpdGVtX2VmZmVjdF90eXBlGAMgASgROgEw" + + "EhgKDGVmZmVjdF9sZXZlbBgEIAEoEToCLTEiOwoPVmlzdWFsRXF1aXBtZW50" + + "EigKC3Zpc3VhbF9pdGVtGAEgAygLMhMuRDMuSGVyby5WaXN1YWxJdGVtImgK" + + "EVF1ZXN0SGlzdG9yeUVudHJ5EhUKCXNub19xdWVzdBgBIAIoDzoCLTESFQoK" + + "ZGlmZmljdWx0eRgCIAIoEToBMBIlChloaWdoZXN0X3BsYXllZF9xdWVzdF9z" + + "dGVwGAMgASgROgItMyJdChdRdWVzdFJld2FyZEhpc3RvcnlFbnRyeRIVCglz" + + "bm9fcXVlc3QYASACKA86Ai0xEhQKCHN0ZXBfdWlkGAIgAigROgItMRIVCgpk" + + "aWZmaWN1bHR5GAMgAigROgEwIrYECgZEaWdlc3QSDwoHdmVyc2lvbhgBIAIo" + + "DRIrCgdoZXJvX2lkGAIgAigLMhouRDMuT25saW5lU2VydmljZS5FbnRpdHlJ" + + "ZBIRCgloZXJvX25hbWUYAyABKAkSEgoKZ2JpZF9jbGFzcxgEIAIoDxINCgVs" + + "ZXZlbBgFIAIoERIUCgxwbGF5ZXJfZmxhZ3MYBiACKA0SMgoQdmlzdWFsX2Vx" + + "dWlwbWVudBgHIAIoCzIYLkQzLkhlcm8uVmlzdWFsRXF1aXBtZW50EjEKDXF1" + + "ZXN0X2hpc3RvcnkYCCADKAsyGi5EMy5IZXJvLlF1ZXN0SGlzdG9yeUVudHJ5" + + "EhcKD2xhc3RfcGxheWVkX2FjdBgJIAIoERIcChRoaWdoZXN0X3VubG9ja2Vk" + + "X2FjdBgKIAIoERIeChZsYXN0X3BsYXllZF9kaWZmaWN1bHR5GAsgAigREiMK" + + "G2hpZ2hlc3RfdW5sb2NrZWRfZGlmZmljdWx0eRgMIAIoERIZChFsYXN0X3Bs" + + "YXllZF9xdWVzdBgNIAIoDxIeChZsYXN0X3BsYXllZF9xdWVzdF9zdGVwGA4g" + + "AigREhYKC3RpbWVfcGxheWVkGA8gAigNOgEwEigKHGhpZ2hlc3RfY29tcGxl" + + "dGVkX2RpZmZpY3VsdHkYECABKBE6Ai0xEhMKC2NyZWF0ZV90aW1lGBEgASgN" + + "EhgKEGxhc3RfcGxheWVkX3RpbWUYEiABKA0SEwoLZGVsZXRlX3RpbWUYEyAB" + + "KA0i/wEKCERpZ2VzdFVJEhcKD2xhc3RfcGxheWVkX2FjdBgBIAIoERIcChRo" + + "aWdoZXN0X3VubG9ja2VkX2FjdBgCIAIoERIeChZsYXN0X3BsYXllZF9kaWZm" + + "aWN1bHR5GAMgAigREiMKG2hpZ2hlc3RfdW5sb2NrZWRfZGlmZmljdWx0eRgE" + + "IAIoERIZChFsYXN0X3BsYXllZF9xdWVzdBgFIAIoDxIeChZsYXN0X3BsYXll" + + "ZF9xdWVzdF9zdGVwGAYgAigREhYKC3RpbWVfcGxheWVkGAcgAigNOgEwEiQK" + + "HGhpZ2hlc3RfY29tcGxldGVkX2RpZmZpY3VsdHkYCCABKBEimgEKClNhdmVk" + + "UXVlc3QSFQoJc25vX3F1ZXN0GAEgAigPOgItMRIVCgpkaWZmaWN1bHR5GAIg" + + "AigROgEwEhwKEGN1cnJlbnRfc3RlcF91aWQYAyACKBE6Ai0xEhsKD29iamVj" + + "dGl2ZV9zdGF0ZRgEIAMoEUICEAESIwoXZmFpbHVyZV9jb25kaXRpb25fc3Rh" + + "dGUYBSADKBFCAhABIicKC0xlYXJuZWRMb3JlEhgKEHNub19sb3JlX2xlYXJu" + + "ZWQYASADKA8iXAoSU2F2ZWRDb252ZXJzYXRpb25zEiUKHXBsYXllZF9jb252" + + "ZXJzYXRpb25zX2JpdGZpZWxkGAEgAigMEh8KF3Nub19zYXZlZF9jb252ZXJz" + + "YXRpb25zGAIgAygPImUKE1NhdmVQb2ludERhdGFfUHJvdG8SFQoJc25vX3dv" + + "cmxkGAEgAigPOgItMRIcChBzYXZlcG9pbnRfbnVtYmVyGAIgAigROgItMRIZ" + + "Cg5jcmVhdGVzX3BvcnRhbBgDIAIoDToBMCI9Cg1Ta2lsbFdpdGhSdW5lEhUK" + + "CXNub19za2lsbBgBIAIoDzoCLTESFQoJcnVuZV90eXBlGAIgASgROgItMSLL" + + "AwoJU2F2ZWREYXRhEhYKC3RpbWVfcGxheWVkGAEgAigNOgEwEh4KE2FjdGl2" + + "YXRlZF93YXlwb2ludHMYAiACKA06ATASMwoTaGlyZWxpbmdfc2F2ZWRfZGF0" + + "YRgDIAIoCzIWLkQzLkhpcmVsaW5nLlNhdmVkRGF0YRIaCg9sYXN0X2xldmVs" + + "X3RpbWUYBCACKA06ATASKgoMbGVhcm5lZF9sb3JlGAUgAigLMhQuRDMuSGVy" + + "by5MZWFybmVkTG9yZRI4ChNzYXZlZF9jb252ZXJzYXRpb25zGAYgAigLMhsu" + + "RDMuSGVyby5TYXZlZENvbnZlcnNhdGlvbnMSEgoKc25vX3RyYWl0cxgHIAMo" + + "DxIwCgpzYXZlX3BvaW50GAggAigLMhwuRDMuSGVyby5TYXZlUG9pbnREYXRh" + + "X1Byb3RvEh4KEmdiaWRfcG90aW9uX2J1dHRvbhgJIAIoDzoCLTESLQoNYWN0" + + "aXZlX3NraWxscxgKIAMoCzIWLkQzLkhlcm8uU2tpbGxXaXRoUnVuZRIgChhz" + + "a2lsbF9zbG90X2V2ZXJfYXNzaWduZWQYCyACKAwSGAoNc2tpbGxfdmVyc2lv" + + "bhgMIAIoDToBMCI2CgpUaW1lc3RhbXBzEhMKC2NyZWF0ZV90aW1lGAEgAigS" + + "EhMKC2RlbGV0ZV90aW1lGAIgASgSIrsCCg9TYXZlZERlZmluaXRpb24SDwoH" + + "dmVyc2lvbhgBIAIoDRIfCgZkaWdlc3QYAiABKAsyDy5EMy5IZXJvLkRpZ2Vz" + + "dBJBChBzYXZlZF9hdHRyaWJ1dGVzGAMgAigLMicuRDMuQXR0cmlidXRlU2Vy" + + "aWFsaXplci5TYXZlZEF0dHJpYnV0ZXMSJgoKc2F2ZWRfZGF0YRgEIAEoCzIS" + + "LkQzLkhlcm8uU2F2ZWREYXRhEigKC3NhdmVkX3F1ZXN0GAUgAygLMhMuRDMu" + + "SGVyby5TYXZlZFF1ZXN0EiEKBWl0ZW1zGAYgASgLMhIuRDMuSXRlbXMuSXRl" + + "bUxpc3QSPgoUcXVlc3RfcmV3YXJkX2hpc3RvcnkYByADKAsyIC5EMy5IZXJv" + + "LlF1ZXN0UmV3YXJkSGlzdG9yeUVudHJ5IhgKCE5hbWVUZXh0EgwKBG5hbWUY" + + "ASACKAkiOAoISGVyb0xpc3QSLAoIaGVyb19pZHMYASADKAsyGi5EMy5Pbmxp" + + "bmVTZXJ2aWNlLkVudGl0eUlkIi4KCkRpZ2VzdExpc3QSIAoHZGlnZXN0cxgB" + + "IAMoCzIPLkQzLkhlcm8uRGlnZXN0Ij8KEFF1ZXN0SGlzdG9yeUxpc3QSKwoH" + + "aGlzdG9yeRgBIAMoCzIaLkQzLkhlcm8uUXVlc3RIaXN0b3J5RW50cnkiOwoO" + + "U2F2ZWRRdWVzdExpc3QSKQoMc2F2ZWRfcXVlc3RzGAEgAygLMhMuRDMuSGVy" + + "by5TYXZlZFF1ZXN0IlIKFlF1ZXN0UmV3YXJkSGlzdG9yeUxpc3QSOAoOcmV3" + + "YXJkX2hpc3RvcnkYASADKAsyIC5EMy5IZXJvLlF1ZXN0UmV3YXJkSGlzdG9y" + + "eUVudHJ5"); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_D3_Hero_VisualItem__Descriptor = Descriptor.MessageTypes[0]; @@ -123,7 +146,7 @@ static Hero() { internal__static_D3_Hero_QuestHistoryEntry__Descriptor = Descriptor.MessageTypes[2]; internal__static_D3_Hero_QuestHistoryEntry__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Hero_QuestHistoryEntry__Descriptor, - new string[] { "SnoQuest", "Difficulty", }); + new string[] { "SnoQuest", "Difficulty", "HighestPlayedQuestStep", }); internal__static_D3_Hero_QuestRewardHistoryEntry__Descriptor = Descriptor.MessageTypes[3]; internal__static_D3_Hero_QuestRewardHistoryEntry__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Hero_QuestRewardHistoryEntry__Descriptor, @@ -131,35 +154,35 @@ static Hero() { internal__static_D3_Hero_Digest__Descriptor = Descriptor.MessageTypes[4]; internal__static_D3_Hero_Digest__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Hero_Digest__Descriptor, - new string[] { "Version", "HeroId", "HeroName", "GbidClass", "Level", "PlayerFlags", "VisualEquipment", "QuestHistory", "LastPlayedAct", "HighestUnlockedAct", "LastPlayedDifficulty", "HighestUnlockedDifficulty", "LastPlayedQuest", "LastPlayedQuestStep", "TimePlayed", }); - internal__static_D3_Hero_HotbarButtonData__Descriptor = Descriptor.MessageTypes[5]; - internal__static_D3_Hero_HotbarButtonData__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Hero_HotbarButtonData__Descriptor, - new string[] { "SnoPower", "GbidItem", }); - internal__static_D3_Hero_SkillKeyMapping__Descriptor = Descriptor.MessageTypes[6]; - internal__static_D3_Hero_SkillKeyMapping__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Hero_SkillKeyMapping__Descriptor, - new string[] { "SnoPower", "IdHotkey", "SkillButton", }); - internal__static_D3_Hero_SavedQuest__Descriptor = Descriptor.MessageTypes[7]; + new string[] { "Version", "HeroId", "HeroName", "GbidClass", "Level", "PlayerFlags", "VisualEquipment", "QuestHistory", "LastPlayedAct", "HighestUnlockedAct", "LastPlayedDifficulty", "HighestUnlockedDifficulty", "LastPlayedQuest", "LastPlayedQuestStep", "TimePlayed", "HighestCompletedDifficulty", "CreateTime", "LastPlayedTime", "DeleteTime", }); + internal__static_D3_Hero_DigestUI__Descriptor = Descriptor.MessageTypes[5]; + internal__static_D3_Hero_DigestUI__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Hero_DigestUI__Descriptor, + new string[] { "LastPlayedAct", "HighestUnlockedAct", "LastPlayedDifficulty", "HighestUnlockedDifficulty", "LastPlayedQuest", "LastPlayedQuestStep", "TimePlayed", "HighestCompletedDifficulty", }); + internal__static_D3_Hero_SavedQuest__Descriptor = Descriptor.MessageTypes[6]; internal__static_D3_Hero_SavedQuest__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Hero_SavedQuest__Descriptor, new string[] { "SnoQuest", "Difficulty", "CurrentStepUid", "ObjectiveState", "FailureConditionState", }); - internal__static_D3_Hero_LearnedLore__Descriptor = Descriptor.MessageTypes[8]; + internal__static_D3_Hero_LearnedLore__Descriptor = Descriptor.MessageTypes[7]; internal__static_D3_Hero_LearnedLore__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Hero_LearnedLore__Descriptor, new string[] { "SnoLoreLearned", }); - internal__static_D3_Hero_SavedConversations__Descriptor = Descriptor.MessageTypes[9]; + internal__static_D3_Hero_SavedConversations__Descriptor = Descriptor.MessageTypes[8]; internal__static_D3_Hero_SavedConversations__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Hero_SavedConversations__Descriptor, new string[] { "PlayedConversationsBitfield", "SnoSavedConversations", }); - internal__static_D3_Hero_SavePointData_Proto__Descriptor = Descriptor.MessageTypes[10]; + internal__static_D3_Hero_SavePointData_Proto__Descriptor = Descriptor.MessageTypes[9]; internal__static_D3_Hero_SavePointData_Proto__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Hero_SavePointData_Proto__Descriptor, new string[] { "SnoWorld", "SavepointNumber", "CreatesPortal", }); + internal__static_D3_Hero_SkillWithRune__Descriptor = Descriptor.MessageTypes[10]; + internal__static_D3_Hero_SkillWithRune__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Hero_SkillWithRune__Descriptor, + new string[] { "SnoSkill", "RuneType", }); internal__static_D3_Hero_SavedData__Descriptor = Descriptor.MessageTypes[11]; internal__static_D3_Hero_SavedData__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Hero_SavedData__Descriptor, - new string[] { "HotbarButtonAssignments", "SkillKeyMap", "TimePlayed", "ActivatedWaypoints", "HirelingSavedData", "LastLevelTime", "LearnedLore", "SavedConversations", "SnoActiveSkills", "SnoTraits", "SeenTutorials", "SavePoint", }); + new string[] { "TimePlayed", "ActivatedWaypoints", "HirelingSavedData", "LastLevelTime", "LearnedLore", "SavedConversations", "SnoTraits", "SavePoint", "GbidPotionButton", "ActiveSkills", "SkillSlotEverAssigned", "SkillVersion", }); internal__static_D3_Hero_Timestamps__Descriptor = Descriptor.MessageTypes[12]; internal__static_D3_Hero_Timestamps__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Hero_Timestamps__Descriptor, @@ -168,18 +191,30 @@ static Hero() { internal__static_D3_Hero_SavedDefinition__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Hero_SavedDefinition__Descriptor, new string[] { "Version", "Digest", "SavedAttributes", "SavedData", "SavedQuest", "Items", "QuestRewardHistory", }); - internal__static_D3_Hero_NameSequence__Descriptor = Descriptor.MessageTypes[14]; - internal__static_D3_Hero_NameSequence__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Hero_NameSequence__Descriptor, - new string[] { "Sequence", }); - internal__static_D3_Hero_NameText__Descriptor = Descriptor.MessageTypes[15]; + internal__static_D3_Hero_NameText__Descriptor = Descriptor.MessageTypes[14]; internal__static_D3_Hero_NameText__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Hero_NameText__Descriptor, new string[] { "Name", }); - internal__static_D3_Hero_Escrow__Descriptor = Descriptor.MessageTypes[16]; - internal__static_D3_Hero_Escrow__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Hero_Escrow__Descriptor, - new string[] { "Version", "Generator", "HeroData", "State", }); + internal__static_D3_Hero_HeroList__Descriptor = Descriptor.MessageTypes[15]; + internal__static_D3_Hero_HeroList__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Hero_HeroList__Descriptor, + new string[] { "HeroIds", }); + internal__static_D3_Hero_DigestList__Descriptor = Descriptor.MessageTypes[16]; + internal__static_D3_Hero_DigestList__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Hero_DigestList__Descriptor, + new string[] { "Digests", }); + internal__static_D3_Hero_QuestHistoryList__Descriptor = Descriptor.MessageTypes[17]; + internal__static_D3_Hero_QuestHistoryList__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Hero_QuestHistoryList__Descriptor, + new string[] { "History", }); + internal__static_D3_Hero_SavedQuestList__Descriptor = Descriptor.MessageTypes[18]; + internal__static_D3_Hero_SavedQuestList__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Hero_SavedQuestList__Descriptor, + new string[] { "SavedQuests", }); + internal__static_D3_Hero_QuestRewardHistoryList__Descriptor = Descriptor.MessageTypes[19]; + internal__static_D3_Hero_QuestRewardHistoryList__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Hero_QuestRewardHistoryList__Descriptor, + new string[] { "RewardHistory", }); return null; }; pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, @@ -194,14 +229,20 @@ static Hero() { } #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class VisualItem : pb::GeneratedMessage { - private static readonly VisualItem defaultInstance = new Builder().BuildPartial(); + private VisualItem() { } + private static readonly VisualItem defaultInstance = new VisualItem().MakeReadOnly(); + private static readonly string[] _visualItemFieldNames = new string[] { "dye_type", "effect_level", "gbid", "item_effect_type" }; + private static readonly uint[] _visualItemFieldTags = new uint[] { 16, 32, 13, 24 }; public static VisualItem DefaultInstance { get { return defaultInstance; } } public override VisualItem DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override VisualItem ThisMessage { @@ -218,7 +259,7 @@ protected override VisualItem ThisMessage { public const int GbidFieldNumber = 1; private bool hasGbid; - private int gbid_ = 0; + private int gbid_ = -1; public bool HasGbid { get { return hasGbid; } } @@ -228,7 +269,7 @@ public int Gbid { public const int DyeTypeFieldNumber = 2; private bool hasDyeType; - private int dyeType_ = 0; + private int dyeType_; public bool HasDyeType { get { return hasDyeType; } } @@ -238,7 +279,7 @@ public int DyeType { public const int ItemEffectTypeFieldNumber = 3; private bool hasItemEffectType; - private int itemEffectType_ = 0; + private int itemEffectType_; public bool HasItemEffectType { get { return hasItemEffectType; } } @@ -248,7 +289,7 @@ public int ItemEffectType { public const int EffectLevelFieldNumber = 4; private bool hasEffectLevel; - private int effectLevel_ = 0; + private int effectLevel_ = -1; public bool HasEffectLevel { get { return hasEffectLevel; } } @@ -262,19 +303,20 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasGbid) { - output.WriteSFixed32(1, Gbid); + string[] field_names = _visualItemFieldNames; + if (hasGbid) { + output.WriteSFixed32(1, field_names[2], Gbid); } - if (HasDyeType) { - output.WriteSInt32(2, DyeType); + if (hasDyeType) { + output.WriteSInt32(2, field_names[0], DyeType); } - if (HasItemEffectType) { - output.WriteSInt32(3, ItemEffectType); + if (hasItemEffectType) { + output.WriteSInt32(3, field_names[3], ItemEffectType); } - if (HasEffectLevel) { - output.WriteSInt32(4, EffectLevel); + if (hasEffectLevel) { + output.WriteSInt32(4, field_names[1], EffectLevel); } UnknownFields.WriteTo(output); } @@ -286,16 +328,16 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasGbid) { + if (hasGbid) { size += pb::CodedOutputStream.ComputeSFixed32Size(1, Gbid); } - if (HasDyeType) { + if (hasDyeType) { size += pb::CodedOutputStream.ComputeSInt32Size(2, DyeType); } - if (HasItemEffectType) { + if (hasItemEffectType) { size += pb::CodedOutputStream.ComputeSInt32Size(3, ItemEffectType); } - if (HasEffectLevel) { + if (hasEffectLevel) { size += pb::CodedOutputStream.ComputeSInt32Size(4, EffectLevel); } size += UnknownFields.SerializedSize; @@ -328,38 +370,72 @@ public static VisualItem ParseDelimitedFrom(global::System.IO.Stream input) { public static VisualItem ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static VisualItem ParseFrom(pb::CodedInputStream input) { + public static VisualItem ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static VisualItem ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static VisualItem ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private VisualItem MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(VisualItem prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(VisualItem cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private VisualItem result; + + private VisualItem PrepareBuilder() { + if (resultIsReadOnly) { + VisualItem original = result; + result = new VisualItem(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - VisualItem result = new VisualItem(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override VisualItem MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new VisualItem(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -371,12 +447,11 @@ public override VisualItem DefaultInstanceForType { } public override VisualItem BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - VisualItem returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -390,6 +465,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(VisualItem other) { if (other == global::D3.Hero.VisualItem.DefaultInstance) return this; + PrepareBuilder(); if (other.HasGbid) { Gbid = other.Gbid; } @@ -406,20 +482,31 @@ public override Builder MergeFrom(VisualItem other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_visualItemFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _visualItemFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -431,99 +518,112 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 13: { - Gbid = input.ReadSFixed32(); + result.hasGbid = input.ReadSFixed32(ref result.gbid_); break; } case 16: { - DyeType = input.ReadSInt32(); + result.hasDyeType = input.ReadSInt32(ref result.dyeType_); break; } case 24: { - ItemEffectType = input.ReadSInt32(); + result.hasItemEffectType = input.ReadSInt32(ref result.itemEffectType_); break; } case 32: { - EffectLevel = input.ReadSInt32(); + result.hasEffectLevel = input.ReadSInt32(ref result.effectLevel_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasGbid { - get { return result.HasGbid; } + get { return result.hasGbid; } } public int Gbid { get { return result.Gbid; } set { SetGbid(value); } } public Builder SetGbid(int value) { + PrepareBuilder(); result.hasGbid = true; result.gbid_ = value; return this; } public Builder ClearGbid() { + PrepareBuilder(); result.hasGbid = false; - result.gbid_ = 0; + result.gbid_ = -1; return this; } public bool HasDyeType { - get { return result.HasDyeType; } + get { return result.hasDyeType; } } public int DyeType { get { return result.DyeType; } set { SetDyeType(value); } } public Builder SetDyeType(int value) { + PrepareBuilder(); result.hasDyeType = true; result.dyeType_ = value; return this; } public Builder ClearDyeType() { + PrepareBuilder(); result.hasDyeType = false; result.dyeType_ = 0; return this; } public bool HasItemEffectType { - get { return result.HasItemEffectType; } + get { return result.hasItemEffectType; } } public int ItemEffectType { get { return result.ItemEffectType; } set { SetItemEffectType(value); } } public Builder SetItemEffectType(int value) { + PrepareBuilder(); result.hasItemEffectType = true; result.itemEffectType_ = value; return this; } public Builder ClearItemEffectType() { + PrepareBuilder(); result.hasItemEffectType = false; result.itemEffectType_ = 0; return this; } public bool HasEffectLevel { - get { return result.HasEffectLevel; } + get { return result.hasEffectLevel; } } public int EffectLevel { get { return result.EffectLevel; } set { SetEffectLevel(value); } } public Builder SetEffectLevel(int value) { + PrepareBuilder(); result.hasEffectLevel = true; result.effectLevel_ = value; return this; } public Builder ClearEffectLevel() { + PrepareBuilder(); result.hasEffectLevel = false; - result.effectLevel_ = 0; + result.effectLevel_ = -1; return this; } } @@ -532,14 +632,20 @@ static VisualItem() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class VisualEquipment : pb::GeneratedMessage { - private static readonly VisualEquipment defaultInstance = new Builder().BuildPartial(); + private VisualEquipment() { } + private static readonly VisualEquipment defaultInstance = new VisualEquipment().MakeReadOnly(); + private static readonly string[] _visualEquipmentFieldNames = new string[] { "visual_item" }; + private static readonly uint[] _visualEquipmentFieldTags = new uint[] { 10 }; public static VisualEquipment DefaultInstance { get { return defaultInstance; } } public override VisualEquipment DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override VisualEquipment ThisMessage { @@ -572,10 +678,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - foreach (global::D3.Hero.VisualItem element in VisualItemList) { - output.WriteMessage(1, element); + string[] field_names = _visualEquipmentFieldNames; + if (visualItem_.Count > 0) { + output.WriteMessageArray(1, field_names[0], visualItem_); } UnknownFields.WriteTo(output); } @@ -620,38 +727,73 @@ public static VisualEquipment ParseDelimitedFrom(global::System.IO.Stream input) public static VisualEquipment ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static VisualEquipment ParseFrom(pb::CodedInputStream input) { + public static VisualEquipment ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static VisualEquipment ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static VisualEquipment ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private VisualEquipment MakeReadOnly() { + visualItem_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(VisualEquipment prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(VisualEquipment cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private VisualEquipment result; + + private VisualEquipment PrepareBuilder() { + if (resultIsReadOnly) { + VisualEquipment original = result; + result = new VisualEquipment(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - VisualEquipment result = new VisualEquipment(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override VisualEquipment MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new VisualEquipment(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -663,13 +805,11 @@ public override VisualEquipment DefaultInstanceForType { } public override VisualEquipment BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.visualItem_.MakeReadOnly(); - VisualEquipment returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -683,27 +823,39 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(VisualEquipment other) { if (other == global::D3.Hero.VisualEquipment.DefaultInstance) return this; + PrepareBuilder(); if (other.visualItem_.Count != 0) { - base.AddRange(other.visualItem_, result.visualItem_); + result.visualItem_.Add(other.visualItem_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_visualEquipmentFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _visualEquipmentFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -715,22 +867,25 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { - global::D3.Hero.VisualItem.Builder subBuilder = global::D3.Hero.VisualItem.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddVisualItem(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.visualItem_, global::D3.Hero.VisualItem.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public pbc::IPopsicleList VisualItemList { - get { return result.visualItem_; } + get { return PrepareBuilder().visualItem_; } } public int VisualItemCount { get { return result.VisualItemCount; } @@ -740,29 +895,35 @@ public int VisualItemCount { } public Builder SetVisualItem(int index, global::D3.Hero.VisualItem value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.visualItem_[index] = value; return this; } public Builder SetVisualItem(int index, global::D3.Hero.VisualItem.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.visualItem_[index] = builderForValue.Build(); return this; } public Builder AddVisualItem(global::D3.Hero.VisualItem value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.visualItem_.Add(value); return this; } public Builder AddVisualItem(global::D3.Hero.VisualItem.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.visualItem_.Add(builderForValue.Build()); return this; } public Builder AddRangeVisualItem(scg::IEnumerable values) { - base.AddRange(values, result.visualItem_); + PrepareBuilder(); + result.visualItem_.Add(values); return this; } public Builder ClearVisualItem() { + PrepareBuilder(); result.visualItem_.Clear(); return this; } @@ -772,14 +933,20 @@ static VisualEquipment() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class QuestHistoryEntry : pb::GeneratedMessage { - private static readonly QuestHistoryEntry defaultInstance = new Builder().BuildPartial(); + private QuestHistoryEntry() { } + private static readonly QuestHistoryEntry defaultInstance = new QuestHistoryEntry().MakeReadOnly(); + private static readonly string[] _questHistoryEntryFieldNames = new string[] { "difficulty", "highest_played_quest_step", "sno_quest" }; + private static readonly uint[] _questHistoryEntryFieldTags = new uint[] { 16, 24, 13 }; public static QuestHistoryEntry DefaultInstance { get { return defaultInstance; } } public override QuestHistoryEntry DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override QuestHistoryEntry ThisMessage { @@ -796,7 +963,7 @@ protected override QuestHistoryEntry ThisMessage { public const int SnoQuestFieldNumber = 1; private bool hasSnoQuest; - private int snoQuest_ = 0; + private int snoQuest_ = -1; public bool HasSnoQuest { get { return hasSnoQuest; } } @@ -806,7 +973,7 @@ public int SnoQuest { public const int DifficultyFieldNumber = 2; private bool hasDifficulty; - private int difficulty_ = 0; + private int difficulty_; public bool HasDifficulty { get { return hasDifficulty; } } @@ -814,6 +981,16 @@ public int Difficulty { get { return difficulty_; } } + public const int HighestPlayedQuestStepFieldNumber = 3; + private bool hasHighestPlayedQuestStep; + private int highestPlayedQuestStep_ = -3; + public bool HasHighestPlayedQuestStep { + get { return hasHighestPlayedQuestStep; } + } + public int HighestPlayedQuestStep { + get { return highestPlayedQuestStep_; } + } + public override bool IsInitialized { get { if (!hasSnoQuest) return false; @@ -822,13 +999,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasSnoQuest) { - output.WriteSFixed32(1, SnoQuest); + string[] field_names = _questHistoryEntryFieldNames; + if (hasSnoQuest) { + output.WriteSFixed32(1, field_names[2], SnoQuest); + } + if (hasDifficulty) { + output.WriteSInt32(2, field_names[0], Difficulty); } - if (HasDifficulty) { - output.WriteSInt32(2, Difficulty); + if (hasHighestPlayedQuestStep) { + output.WriteSInt32(3, field_names[1], HighestPlayedQuestStep); } UnknownFields.WriteTo(output); } @@ -840,12 +1021,15 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasSnoQuest) { + if (hasSnoQuest) { size += pb::CodedOutputStream.ComputeSFixed32Size(1, SnoQuest); } - if (HasDifficulty) { + if (hasDifficulty) { size += pb::CodedOutputStream.ComputeSInt32Size(2, Difficulty); } + if (hasHighestPlayedQuestStep) { + size += pb::CodedOutputStream.ComputeSInt32Size(3, HighestPlayedQuestStep); + } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; return size; @@ -876,38 +1060,72 @@ public static QuestHistoryEntry ParseDelimitedFrom(global::System.IO.Stream inpu public static QuestHistoryEntry ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static QuestHistoryEntry ParseFrom(pb::CodedInputStream input) { + public static QuestHistoryEntry ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static QuestHistoryEntry ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static QuestHistoryEntry ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private QuestHistoryEntry MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(QuestHistoryEntry prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(QuestHistoryEntry cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private QuestHistoryEntry result; + + private QuestHistoryEntry PrepareBuilder() { + if (resultIsReadOnly) { + QuestHistoryEntry original = result; + result = new QuestHistoryEntry(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - QuestHistoryEntry result = new QuestHistoryEntry(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override QuestHistoryEntry MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new QuestHistoryEntry(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -919,12 +1137,11 @@ public override QuestHistoryEntry DefaultInstanceForType { } public override QuestHistoryEntry BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - QuestHistoryEntry returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -938,30 +1155,45 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(QuestHistoryEntry other) { if (other == global::D3.Hero.QuestHistoryEntry.DefaultInstance) return this; + PrepareBuilder(); if (other.HasSnoQuest) { SnoQuest = other.SnoQuest; } if (other.HasDifficulty) { Difficulty = other.Difficulty; } + if (other.HasHighestPlayedQuestStep) { + HighestPlayedQuestStep = other.HighestPlayedQuestStep; + } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_questHistoryEntryFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _questHistoryEntryFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -973,71 +1205,110 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 13: { - SnoQuest = input.ReadSFixed32(); + result.hasSnoQuest = input.ReadSFixed32(ref result.snoQuest_); break; } case 16: { - Difficulty = input.ReadSInt32(); + result.hasDifficulty = input.ReadSInt32(ref result.difficulty_); + break; + } + case 24: { + result.hasHighestPlayedQuestStep = input.ReadSInt32(ref result.highestPlayedQuestStep_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasSnoQuest { - get { return result.HasSnoQuest; } + get { return result.hasSnoQuest; } } public int SnoQuest { get { return result.SnoQuest; } set { SetSnoQuest(value); } } public Builder SetSnoQuest(int value) { + PrepareBuilder(); result.hasSnoQuest = true; result.snoQuest_ = value; return this; } public Builder ClearSnoQuest() { + PrepareBuilder(); result.hasSnoQuest = false; - result.snoQuest_ = 0; + result.snoQuest_ = -1; return this; } public bool HasDifficulty { - get { return result.HasDifficulty; } + get { return result.hasDifficulty; } } public int Difficulty { get { return result.Difficulty; } set { SetDifficulty(value); } } public Builder SetDifficulty(int value) { + PrepareBuilder(); result.hasDifficulty = true; result.difficulty_ = value; return this; } public Builder ClearDifficulty() { + PrepareBuilder(); result.hasDifficulty = false; result.difficulty_ = 0; return this; } + + public bool HasHighestPlayedQuestStep { + get { return result.hasHighestPlayedQuestStep; } + } + public int HighestPlayedQuestStep { + get { return result.HighestPlayedQuestStep; } + set { SetHighestPlayedQuestStep(value); } + } + public Builder SetHighestPlayedQuestStep(int value) { + PrepareBuilder(); + result.hasHighestPlayedQuestStep = true; + result.highestPlayedQuestStep_ = value; + return this; + } + public Builder ClearHighestPlayedQuestStep() { + PrepareBuilder(); + result.hasHighestPlayedQuestStep = false; + result.highestPlayedQuestStep_ = -3; + return this; + } } static QuestHistoryEntry() { object.ReferenceEquals(global::D3.Hero.Hero.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class QuestRewardHistoryEntry : pb::GeneratedMessage { - private static readonly QuestRewardHistoryEntry defaultInstance = new Builder().BuildPartial(); + private QuestRewardHistoryEntry() { } + private static readonly QuestRewardHistoryEntry defaultInstance = new QuestRewardHistoryEntry().MakeReadOnly(); + private static readonly string[] _questRewardHistoryEntryFieldNames = new string[] { "difficulty", "sno_quest", "step_uid" }; + private static readonly uint[] _questRewardHistoryEntryFieldTags = new uint[] { 24, 13, 16 }; public static QuestRewardHistoryEntry DefaultInstance { get { return defaultInstance; } } public override QuestRewardHistoryEntry DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override QuestRewardHistoryEntry ThisMessage { @@ -1054,7 +1325,7 @@ protected override QuestRewardHistoryEntry ThisMessage { public const int SnoQuestFieldNumber = 1; private bool hasSnoQuest; - private int snoQuest_ = 0; + private int snoQuest_ = -1; public bool HasSnoQuest { get { return hasSnoQuest; } } @@ -1064,7 +1335,7 @@ public int SnoQuest { public const int StepUidFieldNumber = 2; private bool hasStepUid; - private int stepUid_ = 0; + private int stepUid_ = -1; public bool HasStepUid { get { return hasStepUid; } } @@ -1074,7 +1345,7 @@ public int StepUid { public const int DifficultyFieldNumber = 3; private bool hasDifficulty; - private int difficulty_ = 0; + private int difficulty_; public bool HasDifficulty { get { return hasDifficulty; } } @@ -1091,16 +1362,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasSnoQuest) { - output.WriteSFixed32(1, SnoQuest); + string[] field_names = _questRewardHistoryEntryFieldNames; + if (hasSnoQuest) { + output.WriteSFixed32(1, field_names[1], SnoQuest); } - if (HasStepUid) { - output.WriteSInt32(2, StepUid); + if (hasStepUid) { + output.WriteSInt32(2, field_names[2], StepUid); } - if (HasDifficulty) { - output.WriteSInt32(3, Difficulty); + if (hasDifficulty) { + output.WriteSInt32(3, field_names[0], Difficulty); } UnknownFields.WriteTo(output); } @@ -1112,13 +1384,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasSnoQuest) { + if (hasSnoQuest) { size += pb::CodedOutputStream.ComputeSFixed32Size(1, SnoQuest); } - if (HasStepUid) { + if (hasStepUid) { size += pb::CodedOutputStream.ComputeSInt32Size(2, StepUid); } - if (HasDifficulty) { + if (hasDifficulty) { size += pb::CodedOutputStream.ComputeSInt32Size(3, Difficulty); } size += UnknownFields.SerializedSize; @@ -1151,38 +1423,72 @@ public static QuestRewardHistoryEntry ParseDelimitedFrom(global::System.IO.Strea public static QuestRewardHistoryEntry ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static QuestRewardHistoryEntry ParseFrom(pb::CodedInputStream input) { + public static QuestRewardHistoryEntry ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static QuestRewardHistoryEntry ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static QuestRewardHistoryEntry ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private QuestRewardHistoryEntry MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(QuestRewardHistoryEntry prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(QuestRewardHistoryEntry cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private QuestRewardHistoryEntry result; + + private QuestRewardHistoryEntry PrepareBuilder() { + if (resultIsReadOnly) { + QuestRewardHistoryEntry original = result; + result = new QuestRewardHistoryEntry(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - QuestRewardHistoryEntry result = new QuestRewardHistoryEntry(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override QuestRewardHistoryEntry MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new QuestRewardHistoryEntry(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -1194,12 +1500,11 @@ public override QuestRewardHistoryEntry DefaultInstanceForType { } public override QuestRewardHistoryEntry BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - QuestRewardHistoryEntry returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1213,6 +1518,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(QuestRewardHistoryEntry other) { if (other == global::D3.Hero.QuestRewardHistoryEntry.DefaultInstance) return this; + PrepareBuilder(); if (other.HasSnoQuest) { SnoQuest = other.SnoQuest; } @@ -1226,20 +1532,31 @@ public override Builder MergeFrom(QuestRewardHistoryEntry other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_questRewardHistoryEntryFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _questRewardHistoryEntryFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1251,75 +1568,86 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 13: { - SnoQuest = input.ReadSFixed32(); + result.hasSnoQuest = input.ReadSFixed32(ref result.snoQuest_); break; } case 16: { - StepUid = input.ReadSInt32(); + result.hasStepUid = input.ReadSInt32(ref result.stepUid_); break; } case 24: { - Difficulty = input.ReadSInt32(); + result.hasDifficulty = input.ReadSInt32(ref result.difficulty_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasSnoQuest { - get { return result.HasSnoQuest; } + get { return result.hasSnoQuest; } } public int SnoQuest { get { return result.SnoQuest; } set { SetSnoQuest(value); } } public Builder SetSnoQuest(int value) { + PrepareBuilder(); result.hasSnoQuest = true; result.snoQuest_ = value; return this; } public Builder ClearSnoQuest() { + PrepareBuilder(); result.hasSnoQuest = false; - result.snoQuest_ = 0; + result.snoQuest_ = -1; return this; } public bool HasStepUid { - get { return result.HasStepUid; } + get { return result.hasStepUid; } } public int StepUid { get { return result.StepUid; } set { SetStepUid(value); } } public Builder SetStepUid(int value) { + PrepareBuilder(); result.hasStepUid = true; result.stepUid_ = value; return this; } public Builder ClearStepUid() { + PrepareBuilder(); result.hasStepUid = false; - result.stepUid_ = 0; + result.stepUid_ = -1; return this; } public bool HasDifficulty { - get { return result.HasDifficulty; } + get { return result.hasDifficulty; } } public int Difficulty { get { return result.Difficulty; } set { SetDifficulty(value); } } public Builder SetDifficulty(int value) { + PrepareBuilder(); result.hasDifficulty = true; result.difficulty_ = value; return this; } public Builder ClearDifficulty() { + PrepareBuilder(); result.hasDifficulty = false; result.difficulty_ = 0; return this; @@ -1330,14 +1658,20 @@ static QuestRewardHistoryEntry() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Digest : pb::GeneratedMessage { - private static readonly Digest defaultInstance = new Builder().BuildPartial(); + private Digest() { } + private static readonly Digest defaultInstance = new Digest().MakeReadOnly(); + private static readonly string[] _digestFieldNames = new string[] { "create_time", "delete_time", "gbid_class", "hero_id", "hero_name", "highest_completed_difficulty", "highest_unlocked_act", "highest_unlocked_difficulty", "last_played_act", "last_played_difficulty", "last_played_quest", "last_played_quest_step", "last_played_time", "level", "player_flags", "quest_history", "time_played", "version", "visual_equipment" }; + private static readonly uint[] _digestFieldTags = new uint[] { 136, 152, 37, 18, 26, 128, 80, 96, 72, 88, 109, 112, 144, 40, 48, 66, 120, 8, 58 }; public static Digest DefaultInstance { get { return defaultInstance; } } public override Digest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override Digest ThisMessage { @@ -1354,7 +1688,7 @@ protected override Digest ThisMessage { public const int VersionFieldNumber = 1; private bool hasVersion; - private uint version_ = 0; + private uint version_; public bool HasVersion { get { return hasVersion; } } @@ -1364,12 +1698,12 @@ public uint Version { public const int HeroIdFieldNumber = 2; private bool hasHeroId; - private global::D3.OnlineService.EntityId heroId_ = global::D3.OnlineService.EntityId.DefaultInstance; + private global::D3.OnlineService.EntityId heroId_; public bool HasHeroId { get { return hasHeroId; } } public global::D3.OnlineService.EntityId HeroId { - get { return heroId_; } + get { return heroId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } } public const int HeroNameFieldNumber = 3; @@ -1384,7 +1718,7 @@ public string HeroName { public const int GbidClassFieldNumber = 4; private bool hasGbidClass; - private int gbidClass_ = 0; + private int gbidClass_; public bool HasGbidClass { get { return hasGbidClass; } } @@ -1394,7 +1728,7 @@ public int GbidClass { public const int LevelFieldNumber = 5; private bool hasLevel; - private int level_ = 0; + private int level_; public bool HasLevel { get { return hasLevel; } } @@ -1404,7 +1738,7 @@ public int Level { public const int PlayerFlagsFieldNumber = 6; private bool hasPlayerFlags; - private uint playerFlags_ = 0; + private uint playerFlags_; public bool HasPlayerFlags { get { return hasPlayerFlags; } } @@ -1414,12 +1748,12 @@ public uint PlayerFlags { public const int VisualEquipmentFieldNumber = 7; private bool hasVisualEquipment; - private global::D3.Hero.VisualEquipment visualEquipment_ = global::D3.Hero.VisualEquipment.DefaultInstance; + private global::D3.Hero.VisualEquipment visualEquipment_; public bool HasVisualEquipment { get { return hasVisualEquipment; } } public global::D3.Hero.VisualEquipment VisualEquipment { - get { return visualEquipment_; } + get { return visualEquipment_ ?? global::D3.Hero.VisualEquipment.DefaultInstance; } } public const int QuestHistoryFieldNumber = 8; @@ -1434,9 +1768,9 @@ public int QuestHistoryCount { return questHistory_[index]; } - public const int LastPlayedActFieldNumber = 10; + public const int LastPlayedActFieldNumber = 9; private bool hasLastPlayedAct; - private int lastPlayedAct_ = 0; + private int lastPlayedAct_; public bool HasLastPlayedAct { get { return hasLastPlayedAct; } } @@ -1444,9 +1778,9 @@ public int LastPlayedAct { get { return lastPlayedAct_; } } - public const int HighestUnlockedActFieldNumber = 11; + public const int HighestUnlockedActFieldNumber = 10; private bool hasHighestUnlockedAct; - private int highestUnlockedAct_ = 0; + private int highestUnlockedAct_; public bool HasHighestUnlockedAct { get { return hasHighestUnlockedAct; } } @@ -1454,9 +1788,9 @@ public int HighestUnlockedAct { get { return highestUnlockedAct_; } } - public const int LastPlayedDifficultyFieldNumber = 12; + public const int LastPlayedDifficultyFieldNumber = 11; private bool hasLastPlayedDifficulty; - private int lastPlayedDifficulty_ = 0; + private int lastPlayedDifficulty_; public bool HasLastPlayedDifficulty { get { return hasLastPlayedDifficulty; } } @@ -1464,9 +1798,9 @@ public int LastPlayedDifficulty { get { return lastPlayedDifficulty_; } } - public const int HighestUnlockedDifficultyFieldNumber = 13; + public const int HighestUnlockedDifficultyFieldNumber = 12; private bool hasHighestUnlockedDifficulty; - private int highestUnlockedDifficulty_ = 0; + private int highestUnlockedDifficulty_; public bool HasHighestUnlockedDifficulty { get { return hasHighestUnlockedDifficulty; } } @@ -1474,9 +1808,9 @@ public int HighestUnlockedDifficulty { get { return highestUnlockedDifficulty_; } } - public const int LastPlayedQuestFieldNumber = 14; + public const int LastPlayedQuestFieldNumber = 13; private bool hasLastPlayedQuest; - private int lastPlayedQuest_ = 0; + private int lastPlayedQuest_; public bool HasLastPlayedQuest { get { return hasLastPlayedQuest; } } @@ -1484,9 +1818,9 @@ public int LastPlayedQuest { get { return lastPlayedQuest_; } } - public const int LastPlayedQuestStepFieldNumber = 15; + public const int LastPlayedQuestStepFieldNumber = 14; private bool hasLastPlayedQuestStep; - private int lastPlayedQuestStep_ = 0; + private int lastPlayedQuestStep_; public bool HasLastPlayedQuestStep { get { return hasLastPlayedQuestStep; } } @@ -1494,9 +1828,9 @@ public int LastPlayedQuestStep { get { return lastPlayedQuestStep_; } } - public const int TimePlayedFieldNumber = 16; + public const int TimePlayedFieldNumber = 15; private bool hasTimePlayed; - private uint timePlayed_ = 0; + private uint timePlayed_; public bool HasTimePlayed { get { return hasTimePlayed; } } @@ -1504,11 +1838,50 @@ public uint TimePlayed { get { return timePlayed_; } } + public const int HighestCompletedDifficultyFieldNumber = 16; + private bool hasHighestCompletedDifficulty; + private int highestCompletedDifficulty_ = -1; + public bool HasHighestCompletedDifficulty { + get { return hasHighestCompletedDifficulty; } + } + public int HighestCompletedDifficulty { + get { return highestCompletedDifficulty_; } + } + + public const int CreateTimeFieldNumber = 17; + private bool hasCreateTime; + private uint createTime_; + public bool HasCreateTime { + get { return hasCreateTime; } + } + public uint CreateTime { + get { return createTime_; } + } + + public const int LastPlayedTimeFieldNumber = 18; + private bool hasLastPlayedTime; + private uint lastPlayedTime_; + public bool HasLastPlayedTime { + get { return hasLastPlayedTime; } + } + public uint LastPlayedTime { + get { return lastPlayedTime_; } + } + + public const int DeleteTimeFieldNumber = 19; + private bool hasDeleteTime; + private uint deleteTime_; + public bool HasDeleteTime { + get { return hasDeleteTime; } + } + public uint DeleteTime { + get { return deleteTime_; } + } + public override bool IsInitialized { get { if (!hasVersion) return false; if (!hasHeroId) return false; - if (!hasHeroName) return false; if (!hasGbidClass) return false; if (!hasLevel) return false; if (!hasPlayerFlags) return false; @@ -1528,52 +1901,65 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasVersion) { - output.WriteUInt32(1, Version); + string[] field_names = _digestFieldNames; + if (hasVersion) { + output.WriteUInt32(1, field_names[17], Version); + } + if (hasHeroId) { + output.WriteMessage(2, field_names[3], HeroId); + } + if (hasHeroName) { + output.WriteString(3, field_names[4], HeroName); } - if (HasHeroId) { - output.WriteMessage(2, HeroId); + if (hasGbidClass) { + output.WriteSFixed32(4, field_names[2], GbidClass); } - if (HasHeroName) { - output.WriteString(3, HeroName); + if (hasLevel) { + output.WriteSInt32(5, field_names[13], Level); } - if (HasGbidClass) { - output.WriteSFixed32(4, GbidClass); + if (hasPlayerFlags) { + output.WriteUInt32(6, field_names[14], PlayerFlags); } - if (HasLevel) { - output.WriteSInt32(5, Level); + if (hasVisualEquipment) { + output.WriteMessage(7, field_names[18], VisualEquipment); } - if (HasPlayerFlags) { - output.WriteUInt32(6, PlayerFlags); + if (questHistory_.Count > 0) { + output.WriteMessageArray(8, field_names[15], questHistory_); } - if (HasVisualEquipment) { - output.WriteMessage(7, VisualEquipment); + if (hasLastPlayedAct) { + output.WriteSInt32(9, field_names[8], LastPlayedAct); } - foreach (global::D3.Hero.QuestHistoryEntry element in QuestHistoryList) { - output.WriteMessage(8, element); + if (hasHighestUnlockedAct) { + output.WriteSInt32(10, field_names[6], HighestUnlockedAct); } - if (HasLastPlayedAct) { - output.WriteSInt32(10, LastPlayedAct); + if (hasLastPlayedDifficulty) { + output.WriteSInt32(11, field_names[9], LastPlayedDifficulty); } - if (HasHighestUnlockedAct) { - output.WriteSInt32(11, HighestUnlockedAct); + if (hasHighestUnlockedDifficulty) { + output.WriteSInt32(12, field_names[7], HighestUnlockedDifficulty); } - if (HasLastPlayedDifficulty) { - output.WriteSInt32(12, LastPlayedDifficulty); + if (hasLastPlayedQuest) { + output.WriteSFixed32(13, field_names[10], LastPlayedQuest); } - if (HasHighestUnlockedDifficulty) { - output.WriteSInt32(13, HighestUnlockedDifficulty); + if (hasLastPlayedQuestStep) { + output.WriteSInt32(14, field_names[11], LastPlayedQuestStep); } - if (HasLastPlayedQuest) { - output.WriteSFixed32(14, LastPlayedQuest); + if (hasTimePlayed) { + output.WriteUInt32(15, field_names[16], TimePlayed); } - if (HasLastPlayedQuestStep) { - output.WriteSInt32(15, LastPlayedQuestStep); + if (hasHighestCompletedDifficulty) { + output.WriteSInt32(16, field_names[5], HighestCompletedDifficulty); } - if (HasTimePlayed) { - output.WriteUInt32(16, TimePlayed); + if (hasCreateTime) { + output.WriteUInt32(17, field_names[0], CreateTime); + } + if (hasLastPlayedTime) { + output.WriteUInt32(18, field_names[12], LastPlayedTime); + } + if (hasDeleteTime) { + output.WriteUInt32(19, field_names[1], DeleteTime); } UnknownFields.WriteTo(output); } @@ -1585,50 +1971,62 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasVersion) { + if (hasVersion) { size += pb::CodedOutputStream.ComputeUInt32Size(1, Version); } - if (HasHeroId) { + if (hasHeroId) { size += pb::CodedOutputStream.ComputeMessageSize(2, HeroId); } - if (HasHeroName) { + if (hasHeroName) { size += pb::CodedOutputStream.ComputeStringSize(3, HeroName); } - if (HasGbidClass) { + if (hasGbidClass) { size += pb::CodedOutputStream.ComputeSFixed32Size(4, GbidClass); } - if (HasLevel) { + if (hasLevel) { size += pb::CodedOutputStream.ComputeSInt32Size(5, Level); } - if (HasPlayerFlags) { + if (hasPlayerFlags) { size += pb::CodedOutputStream.ComputeUInt32Size(6, PlayerFlags); } - if (HasVisualEquipment) { + if (hasVisualEquipment) { size += pb::CodedOutputStream.ComputeMessageSize(7, VisualEquipment); } foreach (global::D3.Hero.QuestHistoryEntry element in QuestHistoryList) { size += pb::CodedOutputStream.ComputeMessageSize(8, element); } - if (HasLastPlayedAct) { - size += pb::CodedOutputStream.ComputeSInt32Size(10, LastPlayedAct); + if (hasLastPlayedAct) { + size += pb::CodedOutputStream.ComputeSInt32Size(9, LastPlayedAct); + } + if (hasHighestUnlockedAct) { + size += pb::CodedOutputStream.ComputeSInt32Size(10, HighestUnlockedAct); + } + if (hasLastPlayedDifficulty) { + size += pb::CodedOutputStream.ComputeSInt32Size(11, LastPlayedDifficulty); } - if (HasHighestUnlockedAct) { - size += pb::CodedOutputStream.ComputeSInt32Size(11, HighestUnlockedAct); + if (hasHighestUnlockedDifficulty) { + size += pb::CodedOutputStream.ComputeSInt32Size(12, HighestUnlockedDifficulty); } - if (HasLastPlayedDifficulty) { - size += pb::CodedOutputStream.ComputeSInt32Size(12, LastPlayedDifficulty); + if (hasLastPlayedQuest) { + size += pb::CodedOutputStream.ComputeSFixed32Size(13, LastPlayedQuest); } - if (HasHighestUnlockedDifficulty) { - size += pb::CodedOutputStream.ComputeSInt32Size(13, HighestUnlockedDifficulty); + if (hasLastPlayedQuestStep) { + size += pb::CodedOutputStream.ComputeSInt32Size(14, LastPlayedQuestStep); } - if (HasLastPlayedQuest) { - size += pb::CodedOutputStream.ComputeSFixed32Size(14, LastPlayedQuest); + if (hasTimePlayed) { + size += pb::CodedOutputStream.ComputeUInt32Size(15, TimePlayed); } - if (HasLastPlayedQuestStep) { - size += pb::CodedOutputStream.ComputeSInt32Size(15, LastPlayedQuestStep); + if (hasHighestCompletedDifficulty) { + size += pb::CodedOutputStream.ComputeSInt32Size(16, HighestCompletedDifficulty); } - if (HasTimePlayed) { - size += pb::CodedOutputStream.ComputeUInt32Size(16, TimePlayed); + if (hasCreateTime) { + size += pb::CodedOutputStream.ComputeUInt32Size(17, CreateTime); + } + if (hasLastPlayedTime) { + size += pb::CodedOutputStream.ComputeUInt32Size(18, LastPlayedTime); + } + if (hasDeleteTime) { + size += pb::CodedOutputStream.ComputeUInt32Size(19, DeleteTime); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -1660,38 +2058,73 @@ public static Digest ParseDelimitedFrom(global::System.IO.Stream input) { public static Digest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static Digest ParseFrom(pb::CodedInputStream input) { + public static Digest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Digest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static Digest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private Digest MakeReadOnly() { + questHistory_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(Digest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Digest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Digest result; + + private Digest PrepareBuilder() { + if (resultIsReadOnly) { + Digest original = result; + result = new Digest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - Digest result = new Digest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override Digest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new Digest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -1703,13 +2136,11 @@ public override Digest DefaultInstanceForType { } public override Digest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.questHistory_.MakeReadOnly(); - Digest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1723,6 +2154,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Digest other) { if (other == global::D3.Hero.Digest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasVersion) { Version = other.Version; } @@ -1745,7 +2177,7 @@ public override Builder MergeFrom(Digest other) { MergeVisualEquipment(other.VisualEquipment); } if (other.questHistory_.Count != 0) { - base.AddRange(other.questHistory_, result.questHistory_); + result.questHistory_.Add(other.questHistory_); } if (other.HasLastPlayedAct) { LastPlayedAct = other.LastPlayedAct; @@ -1768,24 +2200,47 @@ public override Builder MergeFrom(Digest other) { if (other.HasTimePlayed) { TimePlayed = other.TimePlayed; } + if (other.HasHighestCompletedDifficulty) { + HighestCompletedDifficulty = other.HighestCompletedDifficulty; + } + if (other.HasCreateTime) { + CreateTime = other.CreateTime; + } + if (other.HasLastPlayedTime) { + LastPlayedTime = other.LastPlayedTime; + } + if (other.HasDeleteTime) { + DeleteTime = other.DeleteTime; + } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_digestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _digestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1797,16 +2252,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 8: { - Version = input.ReadUInt32(); + result.hasVersion = input.ReadUInt32(ref result.version_); break; } case 18: { global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); - if (HasHeroId) { + if (result.hasHeroId) { subBuilder.MergeFrom(HeroId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1814,24 +2269,24 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 26: { - HeroName = input.ReadString(); + result.hasHeroName = input.ReadString(ref result.heroName_); break; } case 37: { - GbidClass = input.ReadSFixed32(); + result.hasGbidClass = input.ReadSFixed32(ref result.gbidClass_); break; } case 40: { - Level = input.ReadSInt32(); + result.hasLevel = input.ReadSInt32(ref result.level_); break; } case 48: { - PlayerFlags = input.ReadUInt32(); + result.hasPlayerFlags = input.ReadUInt32(ref result.playerFlags_); break; } case 58: { global::D3.Hero.VisualEquipment.Builder subBuilder = global::D3.Hero.VisualEquipment.CreateBuilder(); - if (HasVisualEquipment) { + if (result.hasVisualEquipment) { subBuilder.MergeFrom(VisualEquipment); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1839,64 +2294,85 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 66: { - global::D3.Hero.QuestHistoryEntry.Builder subBuilder = global::D3.Hero.QuestHistoryEntry.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddQuestHistory(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.questHistory_, global::D3.Hero.QuestHistoryEntry.DefaultInstance, extensionRegistry); + break; + } + case 72: { + result.hasLastPlayedAct = input.ReadSInt32(ref result.lastPlayedAct_); break; } case 80: { - LastPlayedAct = input.ReadSInt32(); + result.hasHighestUnlockedAct = input.ReadSInt32(ref result.highestUnlockedAct_); break; } case 88: { - HighestUnlockedAct = input.ReadSInt32(); + result.hasLastPlayedDifficulty = input.ReadSInt32(ref result.lastPlayedDifficulty_); break; } case 96: { - LastPlayedDifficulty = input.ReadSInt32(); + result.hasHighestUnlockedDifficulty = input.ReadSInt32(ref result.highestUnlockedDifficulty_); break; } - case 104: { - HighestUnlockedDifficulty = input.ReadSInt32(); + case 109: { + result.hasLastPlayedQuest = input.ReadSFixed32(ref result.lastPlayedQuest_); break; } - case 117: { - LastPlayedQuest = input.ReadSFixed32(); + case 112: { + result.hasLastPlayedQuestStep = input.ReadSInt32(ref result.lastPlayedQuestStep_); break; } case 120: { - LastPlayedQuestStep = input.ReadSInt32(); + result.hasTimePlayed = input.ReadUInt32(ref result.timePlayed_); break; } case 128: { - TimePlayed = input.ReadUInt32(); + result.hasHighestCompletedDifficulty = input.ReadSInt32(ref result.highestCompletedDifficulty_); + break; + } + case 136: { + result.hasCreateTime = input.ReadUInt32(ref result.createTime_); + break; + } + case 144: { + result.hasLastPlayedTime = input.ReadUInt32(ref result.lastPlayedTime_); + break; + } + case 152: { + result.hasDeleteTime = input.ReadUInt32(ref result.deleteTime_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasVersion { - get { return result.HasVersion; } + get { return result.hasVersion; } } public uint Version { get { return result.Version; } set { SetVersion(value); } } public Builder SetVersion(uint value) { + PrepareBuilder(); result.hasVersion = true; result.version_ = value; return this; } public Builder ClearVersion() { + PrepareBuilder(); result.hasVersion = false; result.version_ = 0; return this; } public bool HasHeroId { - get { return result.HasHeroId; } + get { return result.hasHeroId; } } public global::D3.OnlineService.EntityId HeroId { get { return result.HeroId; } @@ -1904,19 +2380,22 @@ public bool HasHeroId { } public Builder SetHeroId(global::D3.OnlineService.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasHeroId = true; result.heroId_ = value; return this; } public Builder SetHeroId(global::D3.OnlineService.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasHeroId = true; result.heroId_ = builderForValue.Build(); return this; } public Builder MergeHeroId(global::D3.OnlineService.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasHeroId && + PrepareBuilder(); + if (result.hasHeroId && result.heroId_ != global::D3.OnlineService.EntityId.DefaultInstance) { result.heroId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.heroId_).MergeFrom(value).BuildPartial(); } else { @@ -1926,13 +2405,14 @@ public Builder MergeHeroId(global::D3.OnlineService.EntityId value) { return this; } public Builder ClearHeroId() { + PrepareBuilder(); result.hasHeroId = false; - result.heroId_ = global::D3.OnlineService.EntityId.DefaultInstance; + result.heroId_ = null; return this; } public bool HasHeroName { - get { return result.HasHeroName; } + get { return result.hasHeroName; } } public string HeroName { get { return result.HeroName; } @@ -1940,72 +2420,80 @@ public string HeroName { } public Builder SetHeroName(string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasHeroName = true; result.heroName_ = value; return this; } public Builder ClearHeroName() { + PrepareBuilder(); result.hasHeroName = false; result.heroName_ = ""; return this; } public bool HasGbidClass { - get { return result.HasGbidClass; } + get { return result.hasGbidClass; } } public int GbidClass { get { return result.GbidClass; } set { SetGbidClass(value); } } public Builder SetGbidClass(int value) { + PrepareBuilder(); result.hasGbidClass = true; result.gbidClass_ = value; return this; } public Builder ClearGbidClass() { + PrepareBuilder(); result.hasGbidClass = false; result.gbidClass_ = 0; return this; } public bool HasLevel { - get { return result.HasLevel; } + get { return result.hasLevel; } } public int Level { get { return result.Level; } set { SetLevel(value); } } public Builder SetLevel(int value) { + PrepareBuilder(); result.hasLevel = true; result.level_ = value; return this; } public Builder ClearLevel() { + PrepareBuilder(); result.hasLevel = false; result.level_ = 0; return this; } public bool HasPlayerFlags { - get { return result.HasPlayerFlags; } + get { return result.hasPlayerFlags; } } public uint PlayerFlags { get { return result.PlayerFlags; } set { SetPlayerFlags(value); } } public Builder SetPlayerFlags(uint value) { + PrepareBuilder(); result.hasPlayerFlags = true; result.playerFlags_ = value; return this; } public Builder ClearPlayerFlags() { + PrepareBuilder(); result.hasPlayerFlags = false; result.playerFlags_ = 0; return this; } public bool HasVisualEquipment { - get { return result.HasVisualEquipment; } + get { return result.hasVisualEquipment; } } public global::D3.Hero.VisualEquipment VisualEquipment { get { return result.VisualEquipment; } @@ -2013,19 +2501,22 @@ public bool HasVisualEquipment { } public Builder SetVisualEquipment(global::D3.Hero.VisualEquipment value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasVisualEquipment = true; result.visualEquipment_ = value; return this; } public Builder SetVisualEquipment(global::D3.Hero.VisualEquipment.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasVisualEquipment = true; result.visualEquipment_ = builderForValue.Build(); return this; } public Builder MergeVisualEquipment(global::D3.Hero.VisualEquipment value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasVisualEquipment && + PrepareBuilder(); + if (result.hasVisualEquipment && result.visualEquipment_ != global::D3.Hero.VisualEquipment.DefaultInstance) { result.visualEquipment_ = global::D3.Hero.VisualEquipment.CreateBuilder(result.visualEquipment_).MergeFrom(value).BuildPartial(); } else { @@ -2035,13 +2526,14 @@ public Builder MergeVisualEquipment(global::D3.Hero.VisualEquipment value) { return this; } public Builder ClearVisualEquipment() { + PrepareBuilder(); result.hasVisualEquipment = false; - result.visualEquipment_ = global::D3.Hero.VisualEquipment.DefaultInstance; + result.visualEquipment_ = null; return this; } public pbc::IPopsicleList QuestHistoryList { - get { return result.questHistory_; } + get { return PrepareBuilder().questHistory_; } } public int QuestHistoryCount { get { return result.QuestHistoryCount; } @@ -2051,493 +2543,411 @@ public int QuestHistoryCount { } public Builder SetQuestHistory(int index, global::D3.Hero.QuestHistoryEntry value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.questHistory_[index] = value; return this; } public Builder SetQuestHistory(int index, global::D3.Hero.QuestHistoryEntry.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.questHistory_[index] = builderForValue.Build(); return this; } public Builder AddQuestHistory(global::D3.Hero.QuestHistoryEntry value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.questHistory_.Add(value); return this; } public Builder AddQuestHistory(global::D3.Hero.QuestHistoryEntry.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.questHistory_.Add(builderForValue.Build()); return this; } public Builder AddRangeQuestHistory(scg::IEnumerable values) { - base.AddRange(values, result.questHistory_); + PrepareBuilder(); + result.questHistory_.Add(values); return this; } public Builder ClearQuestHistory() { + PrepareBuilder(); result.questHistory_.Clear(); return this; } public bool HasLastPlayedAct { - get { return result.HasLastPlayedAct; } + get { return result.hasLastPlayedAct; } } public int LastPlayedAct { get { return result.LastPlayedAct; } set { SetLastPlayedAct(value); } } public Builder SetLastPlayedAct(int value) { + PrepareBuilder(); result.hasLastPlayedAct = true; result.lastPlayedAct_ = value; return this; } public Builder ClearLastPlayedAct() { + PrepareBuilder(); result.hasLastPlayedAct = false; result.lastPlayedAct_ = 0; return this; } public bool HasHighestUnlockedAct { - get { return result.HasHighestUnlockedAct; } + get { return result.hasHighestUnlockedAct; } } public int HighestUnlockedAct { get { return result.HighestUnlockedAct; } set { SetHighestUnlockedAct(value); } } public Builder SetHighestUnlockedAct(int value) { + PrepareBuilder(); result.hasHighestUnlockedAct = true; result.highestUnlockedAct_ = value; return this; } public Builder ClearHighestUnlockedAct() { + PrepareBuilder(); result.hasHighestUnlockedAct = false; result.highestUnlockedAct_ = 0; return this; } public bool HasLastPlayedDifficulty { - get { return result.HasLastPlayedDifficulty; } + get { return result.hasLastPlayedDifficulty; } } public int LastPlayedDifficulty { get { return result.LastPlayedDifficulty; } set { SetLastPlayedDifficulty(value); } } public Builder SetLastPlayedDifficulty(int value) { + PrepareBuilder(); result.hasLastPlayedDifficulty = true; result.lastPlayedDifficulty_ = value; return this; } public Builder ClearLastPlayedDifficulty() { + PrepareBuilder(); result.hasLastPlayedDifficulty = false; result.lastPlayedDifficulty_ = 0; return this; } public bool HasHighestUnlockedDifficulty { - get { return result.HasHighestUnlockedDifficulty; } + get { return result.hasHighestUnlockedDifficulty; } } public int HighestUnlockedDifficulty { get { return result.HighestUnlockedDifficulty; } set { SetHighestUnlockedDifficulty(value); } } public Builder SetHighestUnlockedDifficulty(int value) { + PrepareBuilder(); result.hasHighestUnlockedDifficulty = true; result.highestUnlockedDifficulty_ = value; return this; } public Builder ClearHighestUnlockedDifficulty() { + PrepareBuilder(); result.hasHighestUnlockedDifficulty = false; result.highestUnlockedDifficulty_ = 0; return this; } public bool HasLastPlayedQuest { - get { return result.HasLastPlayedQuest; } + get { return result.hasLastPlayedQuest; } } public int LastPlayedQuest { get { return result.LastPlayedQuest; } set { SetLastPlayedQuest(value); } } public Builder SetLastPlayedQuest(int value) { + PrepareBuilder(); result.hasLastPlayedQuest = true; result.lastPlayedQuest_ = value; return this; } public Builder ClearLastPlayedQuest() { + PrepareBuilder(); result.hasLastPlayedQuest = false; result.lastPlayedQuest_ = 0; return this; } public bool HasLastPlayedQuestStep { - get { return result.HasLastPlayedQuestStep; } + get { return result.hasLastPlayedQuestStep; } } public int LastPlayedQuestStep { get { return result.LastPlayedQuestStep; } set { SetLastPlayedQuestStep(value); } } public Builder SetLastPlayedQuestStep(int value) { + PrepareBuilder(); result.hasLastPlayedQuestStep = true; result.lastPlayedQuestStep_ = value; return this; } public Builder ClearLastPlayedQuestStep() { + PrepareBuilder(); result.hasLastPlayedQuestStep = false; result.lastPlayedQuestStep_ = 0; return this; } public bool HasTimePlayed { - get { return result.HasTimePlayed; } + get { return result.hasTimePlayed; } } public uint TimePlayed { get { return result.TimePlayed; } set { SetTimePlayed(value); } } public Builder SetTimePlayed(uint value) { + PrepareBuilder(); result.hasTimePlayed = true; result.timePlayed_ = value; return this; } public Builder ClearTimePlayed() { + PrepareBuilder(); result.hasTimePlayed = false; result.timePlayed_ = 0; return this; } + + public bool HasHighestCompletedDifficulty { + get { return result.hasHighestCompletedDifficulty; } + } + public int HighestCompletedDifficulty { + get { return result.HighestCompletedDifficulty; } + set { SetHighestCompletedDifficulty(value); } + } + public Builder SetHighestCompletedDifficulty(int value) { + PrepareBuilder(); + result.hasHighestCompletedDifficulty = true; + result.highestCompletedDifficulty_ = value; + return this; + } + public Builder ClearHighestCompletedDifficulty() { + PrepareBuilder(); + result.hasHighestCompletedDifficulty = false; + result.highestCompletedDifficulty_ = -1; + return this; + } + + public bool HasCreateTime { + get { return result.hasCreateTime; } + } + public uint CreateTime { + get { return result.CreateTime; } + set { SetCreateTime(value); } + } + public Builder SetCreateTime(uint value) { + PrepareBuilder(); + result.hasCreateTime = true; + result.createTime_ = value; + return this; + } + public Builder ClearCreateTime() { + PrepareBuilder(); + result.hasCreateTime = false; + result.createTime_ = 0; + return this; + } + + public bool HasLastPlayedTime { + get { return result.hasLastPlayedTime; } + } + public uint LastPlayedTime { + get { return result.LastPlayedTime; } + set { SetLastPlayedTime(value); } + } + public Builder SetLastPlayedTime(uint value) { + PrepareBuilder(); + result.hasLastPlayedTime = true; + result.lastPlayedTime_ = value; + return this; + } + public Builder ClearLastPlayedTime() { + PrepareBuilder(); + result.hasLastPlayedTime = false; + result.lastPlayedTime_ = 0; + return this; + } + + public bool HasDeleteTime { + get { return result.hasDeleteTime; } + } + public uint DeleteTime { + get { return result.DeleteTime; } + set { SetDeleteTime(value); } + } + public Builder SetDeleteTime(uint value) { + PrepareBuilder(); + result.hasDeleteTime = true; + result.deleteTime_ = value; + return this; + } + public Builder ClearDeleteTime() { + PrepareBuilder(); + result.hasDeleteTime = false; + result.deleteTime_ = 0; + return this; + } } static Digest() { object.ReferenceEquals(global::D3.Hero.Hero.Descriptor, null); } } - public sealed partial class HotbarButtonData : pb::GeneratedMessage { - private static readonly HotbarButtonData defaultInstance = new Builder().BuildPartial(); - public static HotbarButtonData DefaultInstance { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class DigestUI : pb::GeneratedMessage { + private DigestUI() { } + private static readonly DigestUI defaultInstance = new DigestUI().MakeReadOnly(); + private static readonly string[] _digestUIFieldNames = new string[] { "highest_completed_difficulty", "highest_unlocked_act", "highest_unlocked_difficulty", "last_played_act", "last_played_difficulty", "last_played_quest", "last_played_quest_step", "time_played" }; + private static readonly uint[] _digestUIFieldTags = new uint[] { 64, 16, 32, 8, 24, 45, 48, 56 }; + public static DigestUI DefaultInstance { get { return defaultInstance; } } - public override HotbarButtonData DefaultInstanceForType { - get { return defaultInstance; } + public override DigestUI DefaultInstanceForType { + get { return DefaultInstance; } } - protected override HotbarButtonData ThisMessage { + protected override DigestUI ThisMessage { get { return this; } } public static pbd::MessageDescriptor Descriptor { - get { return global::D3.Hero.Hero.internal__static_D3_Hero_HotbarButtonData__Descriptor; } + get { return global::D3.Hero.Hero.internal__static_D3_Hero_DigestUI__Descriptor; } } - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::D3.Hero.Hero.internal__static_D3_Hero_HotbarButtonData__FieldAccessorTable; } + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.Hero.Hero.internal__static_D3_Hero_DigestUI__FieldAccessorTable; } } - public const int SnoPowerFieldNumber = 1; - private bool hasSnoPower; - private int snoPower_ = 0; - public bool HasSnoPower { - get { return hasSnoPower; } + public const int LastPlayedActFieldNumber = 1; + private bool hasLastPlayedAct; + private int lastPlayedAct_; + public bool HasLastPlayedAct { + get { return hasLastPlayedAct; } } - public int SnoPower { - get { return snoPower_; } + public int LastPlayedAct { + get { return lastPlayedAct_; } } - public const int GbidItemFieldNumber = 2; - private bool hasGbidItem; - private int gbidItem_ = 0; - public bool HasGbidItem { - get { return hasGbidItem; } + public const int HighestUnlockedActFieldNumber = 2; + private bool hasHighestUnlockedAct; + private int highestUnlockedAct_; + public bool HasHighestUnlockedAct { + get { return hasHighestUnlockedAct; } } - public int GbidItem { - get { return gbidItem_; } + public int HighestUnlockedAct { + get { return highestUnlockedAct_; } } - public override bool IsInitialized { - get { - if (!hasSnoPower) return false; - if (!hasGbidItem) return false; - return true; - } + public const int LastPlayedDifficultyFieldNumber = 3; + private bool hasLastPlayedDifficulty; + private int lastPlayedDifficulty_; + public bool HasLastPlayedDifficulty { + get { return hasLastPlayedDifficulty; } } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasSnoPower) { - output.WriteSFixed32(1, SnoPower); - } - if (HasGbidItem) { - output.WriteSFixed32(2, GbidItem); - } - UnknownFields.WriteTo(output); + public int LastPlayedDifficulty { + get { return lastPlayedDifficulty_; } } - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasSnoPower) { - size += pb::CodedOutputStream.ComputeSFixed32Size(1, SnoPower); - } - if (HasGbidItem) { - size += pb::CodedOutputStream.ComputeSFixed32Size(2, GbidItem); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } + public const int HighestUnlockedDifficultyFieldNumber = 4; + private bool hasHighestUnlockedDifficulty; + private int highestUnlockedDifficulty_; + public bool HasHighestUnlockedDifficulty { + get { return hasHighestUnlockedDifficulty; } } - - public static HotbarButtonData ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static HotbarButtonData ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static HotbarButtonData ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static HotbarButtonData ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static HotbarButtonData ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static HotbarButtonData ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static HotbarButtonData ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static HotbarButtonData ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static HotbarButtonData ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static HotbarButtonData ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(HotbarButtonData prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - HotbarButtonData result = new HotbarButtonData(); - - protected override HotbarButtonData MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new HotbarButtonData(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::D3.Hero.HotbarButtonData.Descriptor; } - } - - public override HotbarButtonData DefaultInstanceForType { - get { return global::D3.Hero.HotbarButtonData.DefaultInstance; } - } - - public override HotbarButtonData BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - HotbarButtonData returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is HotbarButtonData) { - return MergeFrom((HotbarButtonData) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(HotbarButtonData other) { - if (other == global::D3.Hero.HotbarButtonData.DefaultInstance) return this; - if (other.HasSnoPower) { - SnoPower = other.SnoPower; - } - if (other.HasGbidItem) { - GbidItem = other.GbidItem; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 13: { - SnoPower = input.ReadSFixed32(); - break; - } - case 21: { - GbidItem = input.ReadSFixed32(); - break; - } - } - } - } - - - public bool HasSnoPower { - get { return result.HasSnoPower; } - } - public int SnoPower { - get { return result.SnoPower; } - set { SetSnoPower(value); } - } - public Builder SetSnoPower(int value) { - result.hasSnoPower = true; - result.snoPower_ = value; - return this; - } - public Builder ClearSnoPower() { - result.hasSnoPower = false; - result.snoPower_ = 0; - return this; - } - - public bool HasGbidItem { - get { return result.HasGbidItem; } - } - public int GbidItem { - get { return result.GbidItem; } - set { SetGbidItem(value); } - } - public Builder SetGbidItem(int value) { - result.hasGbidItem = true; - result.gbidItem_ = value; - return this; - } - public Builder ClearGbidItem() { - result.hasGbidItem = false; - result.gbidItem_ = 0; - return this; - } - } - static HotbarButtonData() { - object.ReferenceEquals(global::D3.Hero.Hero.Descriptor, null); - } - } - - public sealed partial class SkillKeyMapping : pb::GeneratedMessage { - private static readonly SkillKeyMapping defaultInstance = new Builder().BuildPartial(); - public static SkillKeyMapping DefaultInstance { - get { return defaultInstance; } - } - - public override SkillKeyMapping DefaultInstanceForType { - get { return defaultInstance; } + public int HighestUnlockedDifficulty { + get { return highestUnlockedDifficulty_; } } - protected override SkillKeyMapping ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::D3.Hero.Hero.internal__static_D3_Hero_SkillKeyMapping__Descriptor; } + public const int LastPlayedQuestFieldNumber = 5; + private bool hasLastPlayedQuest; + private int lastPlayedQuest_; + public bool HasLastPlayedQuest { + get { return hasLastPlayedQuest; } } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::D3.Hero.Hero.internal__static_D3_Hero_SkillKeyMapping__FieldAccessorTable; } + public int LastPlayedQuest { + get { return lastPlayedQuest_; } } - public const int SnoPowerFieldNumber = 1; - private bool hasSnoPower; - private int snoPower_ = 0; - public bool HasSnoPower { - get { return hasSnoPower; } + public const int LastPlayedQuestStepFieldNumber = 6; + private bool hasLastPlayedQuestStep; + private int lastPlayedQuestStep_; + public bool HasLastPlayedQuestStep { + get { return hasLastPlayedQuestStep; } } - public int SnoPower { - get { return snoPower_; } + public int LastPlayedQuestStep { + get { return lastPlayedQuestStep_; } } - public const int IdHotkeyFieldNumber = 2; - private bool hasIdHotkey; - private int idHotkey_ = 0; - public bool HasIdHotkey { - get { return hasIdHotkey; } + public const int TimePlayedFieldNumber = 7; + private bool hasTimePlayed; + private uint timePlayed_; + public bool HasTimePlayed { + get { return hasTimePlayed; } } - public int IdHotkey { - get { return idHotkey_; } + public uint TimePlayed { + get { return timePlayed_; } } - public const int SkillButtonFieldNumber = 3; - private bool hasSkillButton; - private int skillButton_ = 0; - public bool HasSkillButton { - get { return hasSkillButton; } + public const int HighestCompletedDifficultyFieldNumber = 8; + private bool hasHighestCompletedDifficulty; + private int highestCompletedDifficulty_; + public bool HasHighestCompletedDifficulty { + get { return hasHighestCompletedDifficulty; } } - public int SkillButton { - get { return skillButton_; } + public int HighestCompletedDifficulty { + get { return highestCompletedDifficulty_; } } public override bool IsInitialized { get { - if (!hasSnoPower) return false; - if (!hasIdHotkey) return false; - if (!hasSkillButton) return false; + if (!hasLastPlayedAct) return false; + if (!hasHighestUnlockedAct) return false; + if (!hasLastPlayedDifficulty) return false; + if (!hasHighestUnlockedDifficulty) return false; + if (!hasLastPlayedQuest) return false; + if (!hasLastPlayedQuestStep) return false; + if (!hasTimePlayed) return false; return true; } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasSnoPower) { - output.WriteSFixed32(1, SnoPower); + string[] field_names = _digestUIFieldNames; + if (hasLastPlayedAct) { + output.WriteSInt32(1, field_names[3], LastPlayedAct); + } + if (hasHighestUnlockedAct) { + output.WriteSInt32(2, field_names[1], HighestUnlockedAct); + } + if (hasLastPlayedDifficulty) { + output.WriteSInt32(3, field_names[4], LastPlayedDifficulty); + } + if (hasHighestUnlockedDifficulty) { + output.WriteSInt32(4, field_names[2], HighestUnlockedDifficulty); + } + if (hasLastPlayedQuest) { + output.WriteSFixed32(5, field_names[5], LastPlayedQuest); + } + if (hasLastPlayedQuestStep) { + output.WriteSInt32(6, field_names[6], LastPlayedQuestStep); } - if (HasIdHotkey) { - output.WriteSInt32(2, IdHotkey); + if (hasTimePlayed) { + output.WriteUInt32(7, field_names[7], TimePlayed); } - if (HasSkillButton) { - output.WriteSInt32(3, SkillButton); + if (hasHighestCompletedDifficulty) { + output.WriteSInt32(8, field_names[0], HighestCompletedDifficulty); } UnknownFields.WriteTo(output); } @@ -2549,14 +2959,29 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasSnoPower) { - size += pb::CodedOutputStream.ComputeSFixed32Size(1, SnoPower); + if (hasLastPlayedAct) { + size += pb::CodedOutputStream.ComputeSInt32Size(1, LastPlayedAct); } - if (HasIdHotkey) { - size += pb::CodedOutputStream.ComputeSInt32Size(2, IdHotkey); + if (hasHighestUnlockedAct) { + size += pb::CodedOutputStream.ComputeSInt32Size(2, HighestUnlockedAct); } - if (HasSkillButton) { - size += pb::CodedOutputStream.ComputeSInt32Size(3, SkillButton); + if (hasLastPlayedDifficulty) { + size += pb::CodedOutputStream.ComputeSInt32Size(3, LastPlayedDifficulty); + } + if (hasHighestUnlockedDifficulty) { + size += pb::CodedOutputStream.ComputeSInt32Size(4, HighestUnlockedDifficulty); + } + if (hasLastPlayedQuest) { + size += pb::CodedOutputStream.ComputeSFixed32Size(5, LastPlayedQuest); + } + if (hasLastPlayedQuestStep) { + size += pb::CodedOutputStream.ComputeSInt32Size(6, LastPlayedQuestStep); + } + if (hasTimePlayed) { + size += pb::CodedOutputStream.ComputeUInt32Size(7, TimePlayed); + } + if (hasHighestCompletedDifficulty) { + size += pb::CodedOutputStream.ComputeSInt32Size(8, HighestCompletedDifficulty); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -2564,119 +2989,179 @@ public override int SerializedSize { } } - public static SkillKeyMapping ParseFrom(pb::ByteString data) { + public static DigestUI ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static SkillKeyMapping ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static DigestUI ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static SkillKeyMapping ParseFrom(byte[] data) { + public static DigestUI ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static SkillKeyMapping ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static DigestUI ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static SkillKeyMapping ParseFrom(global::System.IO.Stream input) { + public static DigestUI ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SkillKeyMapping ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static DigestUI ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } - public static SkillKeyMapping ParseDelimitedFrom(global::System.IO.Stream input) { + public static DigestUI ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static SkillKeyMapping ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static DigestUI ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static SkillKeyMapping ParseFrom(pb::CodedInputStream input) { + public static DigestUI ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SkillKeyMapping ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static DigestUI ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private DigestUI MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SkillKeyMapping prototype) { - return (Builder) new Builder().MergeFrom(prototype); + public static Builder CreateBuilder(DigestUI prototype) { + return new Builder(prototype); } - public sealed partial class Builder : pb::GeneratedBuilder { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(DigestUI cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private DigestUI result; + + private DigestUI PrepareBuilder() { + if (resultIsReadOnly) { + DigestUI original = result; + result = new DigestUI(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - SkillKeyMapping result = new SkillKeyMapping(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } - protected override SkillKeyMapping MessageBeingBuilt { - get { return result; } + protected override DigestUI MessageBeingBuilt { + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SkillKeyMapping(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { - get { return global::D3.Hero.SkillKeyMapping.Descriptor; } + get { return global::D3.Hero.DigestUI.Descriptor; } } - public override SkillKeyMapping DefaultInstanceForType { - get { return global::D3.Hero.SkillKeyMapping.DefaultInstance; } + public override DigestUI DefaultInstanceForType { + get { return global::D3.Hero.DigestUI.DefaultInstance; } } - public override SkillKeyMapping BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override DigestUI BuildPartial() { + if (resultIsReadOnly) { + return result; } - SkillKeyMapping returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is SkillKeyMapping) { - return MergeFrom((SkillKeyMapping) other); + if (other is DigestUI) { + return MergeFrom((DigestUI) other); } else { base.MergeFrom(other); return this; } } - public override Builder MergeFrom(SkillKeyMapping other) { - if (other == global::D3.Hero.SkillKeyMapping.DefaultInstance) return this; - if (other.HasSnoPower) { - SnoPower = other.SnoPower; + public override Builder MergeFrom(DigestUI other) { + if (other == global::D3.Hero.DigestUI.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasLastPlayedAct) { + LastPlayedAct = other.LastPlayedAct; + } + if (other.HasHighestUnlockedAct) { + HighestUnlockedAct = other.HighestUnlockedAct; + } + if (other.HasLastPlayedDifficulty) { + LastPlayedDifficulty = other.LastPlayedDifficulty; + } + if (other.HasHighestUnlockedDifficulty) { + HighestUnlockedDifficulty = other.HighestUnlockedDifficulty; + } + if (other.HasLastPlayedQuest) { + LastPlayedQuest = other.LastPlayedQuest; + } + if (other.HasLastPlayedQuestStep) { + LastPlayedQuestStep = other.LastPlayedQuestStep; } - if (other.HasIdHotkey) { - IdHotkey = other.IdHotkey; + if (other.HasTimePlayed) { + TimePlayed = other.TimePlayed; } - if (other.HasSkillButton) { - SkillButton = other.SkillButton; + if (other.HasHighestCompletedDifficulty) { + HighestCompletedDifficulty = other.HighestCompletedDifficulty; } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_digestUIFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _digestUIFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -2688,110 +3173,247 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } - case 13: { - SnoPower = input.ReadSFixed32(); + case 8: { + result.hasLastPlayedAct = input.ReadSInt32(ref result.lastPlayedAct_); break; } case 16: { - IdHotkey = input.ReadSInt32(); + result.hasHighestUnlockedAct = input.ReadSInt32(ref result.highestUnlockedAct_); break; } case 24: { - SkillButton = input.ReadSInt32(); + result.hasLastPlayedDifficulty = input.ReadSInt32(ref result.lastPlayedDifficulty_); + break; + } + case 32: { + result.hasHighestUnlockedDifficulty = input.ReadSInt32(ref result.highestUnlockedDifficulty_); + break; + } + case 45: { + result.hasLastPlayedQuest = input.ReadSFixed32(ref result.lastPlayedQuest_); + break; + } + case 48: { + result.hasLastPlayedQuestStep = input.ReadSInt32(ref result.lastPlayedQuestStep_); + break; + } + case 56: { + result.hasTimePlayed = input.ReadUInt32(ref result.timePlayed_); + break; + } + case 64: { + result.hasHighestCompletedDifficulty = input.ReadSInt32(ref result.highestCompletedDifficulty_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } - public bool HasSnoPower { - get { return result.HasSnoPower; } + public bool HasLastPlayedAct { + get { return result.hasLastPlayedAct; } } - public int SnoPower { - get { return result.SnoPower; } - set { SetSnoPower(value); } + public int LastPlayedAct { + get { return result.LastPlayedAct; } + set { SetLastPlayedAct(value); } } - public Builder SetSnoPower(int value) { - result.hasSnoPower = true; - result.snoPower_ = value; + public Builder SetLastPlayedAct(int value) { + PrepareBuilder(); + result.hasLastPlayedAct = true; + result.lastPlayedAct_ = value; return this; } - public Builder ClearSnoPower() { - result.hasSnoPower = false; - result.snoPower_ = 0; + public Builder ClearLastPlayedAct() { + PrepareBuilder(); + result.hasLastPlayedAct = false; + result.lastPlayedAct_ = 0; return this; } - public bool HasIdHotkey { - get { return result.HasIdHotkey; } + public bool HasHighestUnlockedAct { + get { return result.hasHighestUnlockedAct; } } - public int IdHotkey { - get { return result.IdHotkey; } - set { SetIdHotkey(value); } + public int HighestUnlockedAct { + get { return result.HighestUnlockedAct; } + set { SetHighestUnlockedAct(value); } } - public Builder SetIdHotkey(int value) { - result.hasIdHotkey = true; - result.idHotkey_ = value; + public Builder SetHighestUnlockedAct(int value) { + PrepareBuilder(); + result.hasHighestUnlockedAct = true; + result.highestUnlockedAct_ = value; return this; } - public Builder ClearIdHotkey() { - result.hasIdHotkey = false; - result.idHotkey_ = 0; + public Builder ClearHighestUnlockedAct() { + PrepareBuilder(); + result.hasHighestUnlockedAct = false; + result.highestUnlockedAct_ = 0; return this; } - public bool HasSkillButton { - get { return result.HasSkillButton; } + public bool HasLastPlayedDifficulty { + get { return result.hasLastPlayedDifficulty; } } - public int SkillButton { - get { return result.SkillButton; } - set { SetSkillButton(value); } + public int LastPlayedDifficulty { + get { return result.LastPlayedDifficulty; } + set { SetLastPlayedDifficulty(value); } } - public Builder SetSkillButton(int value) { - result.hasSkillButton = true; - result.skillButton_ = value; + public Builder SetLastPlayedDifficulty(int value) { + PrepareBuilder(); + result.hasLastPlayedDifficulty = true; + result.lastPlayedDifficulty_ = value; return this; } - public Builder ClearSkillButton() { - result.hasSkillButton = false; - result.skillButton_ = 0; + public Builder ClearLastPlayedDifficulty() { + PrepareBuilder(); + result.hasLastPlayedDifficulty = false; + result.lastPlayedDifficulty_ = 0; return this; } - } - static SkillKeyMapping() { - object.ReferenceEquals(global::D3.Hero.Hero.Descriptor, null); - } - } - - public sealed partial class SavedQuest : pb::GeneratedMessage { - private static readonly SavedQuest defaultInstance = new Builder().BuildPartial(); - public static SavedQuest DefaultInstance { - get { return defaultInstance; } - } - - public override SavedQuest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override SavedQuest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::D3.Hero.Hero.internal__static_D3_Hero_SavedQuest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::D3.Hero.Hero.internal__static_D3_Hero_SavedQuest__FieldAccessorTable; } + + public bool HasHighestUnlockedDifficulty { + get { return result.hasHighestUnlockedDifficulty; } + } + public int HighestUnlockedDifficulty { + get { return result.HighestUnlockedDifficulty; } + set { SetHighestUnlockedDifficulty(value); } + } + public Builder SetHighestUnlockedDifficulty(int value) { + PrepareBuilder(); + result.hasHighestUnlockedDifficulty = true; + result.highestUnlockedDifficulty_ = value; + return this; + } + public Builder ClearHighestUnlockedDifficulty() { + PrepareBuilder(); + result.hasHighestUnlockedDifficulty = false; + result.highestUnlockedDifficulty_ = 0; + return this; + } + + public bool HasLastPlayedQuest { + get { return result.hasLastPlayedQuest; } + } + public int LastPlayedQuest { + get { return result.LastPlayedQuest; } + set { SetLastPlayedQuest(value); } + } + public Builder SetLastPlayedQuest(int value) { + PrepareBuilder(); + result.hasLastPlayedQuest = true; + result.lastPlayedQuest_ = value; + return this; + } + public Builder ClearLastPlayedQuest() { + PrepareBuilder(); + result.hasLastPlayedQuest = false; + result.lastPlayedQuest_ = 0; + return this; + } + + public bool HasLastPlayedQuestStep { + get { return result.hasLastPlayedQuestStep; } + } + public int LastPlayedQuestStep { + get { return result.LastPlayedQuestStep; } + set { SetLastPlayedQuestStep(value); } + } + public Builder SetLastPlayedQuestStep(int value) { + PrepareBuilder(); + result.hasLastPlayedQuestStep = true; + result.lastPlayedQuestStep_ = value; + return this; + } + public Builder ClearLastPlayedQuestStep() { + PrepareBuilder(); + result.hasLastPlayedQuestStep = false; + result.lastPlayedQuestStep_ = 0; + return this; + } + + public bool HasTimePlayed { + get { return result.hasTimePlayed; } + } + public uint TimePlayed { + get { return result.TimePlayed; } + set { SetTimePlayed(value); } + } + public Builder SetTimePlayed(uint value) { + PrepareBuilder(); + result.hasTimePlayed = true; + result.timePlayed_ = value; + return this; + } + public Builder ClearTimePlayed() { + PrepareBuilder(); + result.hasTimePlayed = false; + result.timePlayed_ = 0; + return this; + } + + public bool HasHighestCompletedDifficulty { + get { return result.hasHighestCompletedDifficulty; } + } + public int HighestCompletedDifficulty { + get { return result.HighestCompletedDifficulty; } + set { SetHighestCompletedDifficulty(value); } + } + public Builder SetHighestCompletedDifficulty(int value) { + PrepareBuilder(); + result.hasHighestCompletedDifficulty = true; + result.highestCompletedDifficulty_ = value; + return this; + } + public Builder ClearHighestCompletedDifficulty() { + PrepareBuilder(); + result.hasHighestCompletedDifficulty = false; + result.highestCompletedDifficulty_ = 0; + return this; + } + } + static DigestUI() { + object.ReferenceEquals(global::D3.Hero.Hero.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class SavedQuest : pb::GeneratedMessage { + private SavedQuest() { } + private static readonly SavedQuest defaultInstance = new SavedQuest().MakeReadOnly(); + private static readonly string[] _savedQuestFieldNames = new string[] { "current_step_uid", "difficulty", "failure_condition_state", "objective_state", "sno_quest" }; + private static readonly uint[] _savedQuestFieldTags = new uint[] { 24, 16, 42, 34, 13 }; + public static SavedQuest DefaultInstance { + get { return defaultInstance; } + } + + public override SavedQuest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SavedQuest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.Hero.Hero.internal__static_D3_Hero_SavedQuest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.Hero.Hero.internal__static_D3_Hero_SavedQuest__FieldAccessorTable; } } public const int SnoQuestFieldNumber = 1; private bool hasSnoQuest; - private int snoQuest_ = 0; + private int snoQuest_ = -1; public bool HasSnoQuest { get { return hasSnoQuest; } } @@ -2801,7 +3423,7 @@ public int SnoQuest { public const int DifficultyFieldNumber = 2; private bool hasDifficulty; - private int difficulty_ = 0; + private int difficulty_; public bool HasDifficulty { get { return hasDifficulty; } } @@ -2811,7 +3433,7 @@ public int Difficulty { public const int CurrentStepUidFieldNumber = 3; private bool hasCurrentStepUid; - private int currentStepUid_ = 0; + private int currentStepUid_ = -1; public bool HasCurrentStepUid { get { return hasCurrentStepUid; } } @@ -2820,6 +3442,7 @@ public int CurrentStepUid { } public const int ObjectiveStateFieldNumber = 4; + private int objectiveStateMemoizedSerializedSize; private pbc::PopsicleList objectiveState_ = new pbc::PopsicleList(); public scg::IList ObjectiveStateList { get { return pbc::Lists.AsReadOnly(objectiveState_); } @@ -2832,6 +3455,7 @@ public int GetObjectiveState(int index) { } public const int FailureConditionStateFieldNumber = 5; + private int failureConditionStateMemoizedSerializedSize; private pbc::PopsicleList failureConditionState_ = new pbc::PopsicleList(); public scg::IList FailureConditionStateList { get { return pbc::Lists.AsReadOnly(failureConditionState_); } @@ -2852,26 +3476,23 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasSnoQuest) { - output.WriteSFixed32(1, SnoQuest); + string[] field_names = _savedQuestFieldNames; + if (hasSnoQuest) { + output.WriteSFixed32(1, field_names[4], SnoQuest); } - if (HasDifficulty) { - output.WriteSInt32(2, Difficulty); + if (hasDifficulty) { + output.WriteSInt32(2, field_names[1], Difficulty); } - if (HasCurrentStepUid) { - output.WriteSInt32(3, CurrentStepUid); + if (hasCurrentStepUid) { + output.WriteSInt32(3, field_names[0], CurrentStepUid); } if (objectiveState_.Count > 0) { - foreach (int element in objectiveState_) { - output.WriteSInt32(4, element); - } + output.WritePackedSInt32Array(4, field_names[3], objectiveStateMemoizedSerializedSize, objectiveState_); } if (failureConditionState_.Count > 0) { - foreach (int element in failureConditionState_) { - output.WriteSInt32(5, element); - } + output.WritePackedSInt32Array(5, field_names[2], failureConditionStateMemoizedSerializedSize, failureConditionState_); } UnknownFields.WriteTo(output); } @@ -2883,13 +3504,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasSnoQuest) { + if (hasSnoQuest) { size += pb::CodedOutputStream.ComputeSFixed32Size(1, SnoQuest); } - if (HasDifficulty) { + if (hasDifficulty) { size += pb::CodedOutputStream.ComputeSInt32Size(2, Difficulty); } - if (HasCurrentStepUid) { + if (hasCurrentStepUid) { size += pb::CodedOutputStream.ComputeSInt32Size(3, CurrentStepUid); } { @@ -2898,7 +3519,10 @@ public override int SerializedSize { dataSize += pb::CodedOutputStream.ComputeSInt32SizeNoTag(element); } size += dataSize; - size += 1 * objectiveState_.Count; + if (objectiveState_.Count != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); + } + objectiveStateMemoizedSerializedSize = dataSize; } { int dataSize = 0; @@ -2906,7 +3530,10 @@ public override int SerializedSize { dataSize += pb::CodedOutputStream.ComputeSInt32SizeNoTag(element); } size += dataSize; - size += 1 * failureConditionState_.Count; + if (failureConditionState_.Count != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); + } + failureConditionStateMemoizedSerializedSize = dataSize; } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -2938,38 +3565,74 @@ public static SavedQuest ParseDelimitedFrom(global::System.IO.Stream input) { public static SavedQuest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static SavedQuest ParseFrom(pb::CodedInputStream input) { + public static SavedQuest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SavedQuest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static SavedQuest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private SavedQuest MakeReadOnly() { + objectiveState_.MakeReadOnly(); + failureConditionState_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(SavedQuest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SavedQuest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SavedQuest result; + + private SavedQuest PrepareBuilder() { + if (resultIsReadOnly) { + SavedQuest original = result; + result = new SavedQuest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - SavedQuest result = new SavedQuest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override SavedQuest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SavedQuest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -2981,14 +3644,11 @@ public override SavedQuest DefaultInstanceForType { } public override SavedQuest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.objectiveState_.MakeReadOnly(); - result.failureConditionState_.MakeReadOnly(); - SavedQuest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -3002,6 +3662,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SavedQuest other) { if (other == global::D3.Hero.SavedQuest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasSnoQuest) { SnoQuest = other.SnoQuest; } @@ -3012,29 +3673,40 @@ public override Builder MergeFrom(SavedQuest other) { CurrentStepUid = other.CurrentStepUid; } if (other.objectiveState_.Count != 0) { - base.AddRange(other.objectiveState_, result.objectiveState_); + result.objectiveState_.Add(other.objectiveState_); } if (other.failureConditionState_.Count != 0) { - base.AddRange(other.failureConditionState_, result.failureConditionState_); + result.failureConditionState_.Add(other.failureConditionState_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_savedQuestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _savedQuestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -3046,90 +3718,103 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 13: { - SnoQuest = input.ReadSFixed32(); + result.hasSnoQuest = input.ReadSFixed32(ref result.snoQuest_); break; } case 16: { - Difficulty = input.ReadSInt32(); + result.hasDifficulty = input.ReadSInt32(ref result.difficulty_); break; } case 24: { - CurrentStepUid = input.ReadSInt32(); + result.hasCurrentStepUid = input.ReadSInt32(ref result.currentStepUid_); break; } + case 34: case 32: { - AddObjectiveState(input.ReadSInt32()); + input.ReadSInt32Array(tag, field_name, result.objectiveState_); break; } + case 42: case 40: { - AddFailureConditionState(input.ReadSInt32()); + input.ReadSInt32Array(tag, field_name, result.failureConditionState_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasSnoQuest { - get { return result.HasSnoQuest; } + get { return result.hasSnoQuest; } } public int SnoQuest { get { return result.SnoQuest; } set { SetSnoQuest(value); } } public Builder SetSnoQuest(int value) { + PrepareBuilder(); result.hasSnoQuest = true; result.snoQuest_ = value; return this; } public Builder ClearSnoQuest() { + PrepareBuilder(); result.hasSnoQuest = false; - result.snoQuest_ = 0; + result.snoQuest_ = -1; return this; } public bool HasDifficulty { - get { return result.HasDifficulty; } + get { return result.hasDifficulty; } } public int Difficulty { get { return result.Difficulty; } set { SetDifficulty(value); } } public Builder SetDifficulty(int value) { + PrepareBuilder(); result.hasDifficulty = true; result.difficulty_ = value; return this; } public Builder ClearDifficulty() { + PrepareBuilder(); result.hasDifficulty = false; result.difficulty_ = 0; return this; } public bool HasCurrentStepUid { - get { return result.HasCurrentStepUid; } + get { return result.hasCurrentStepUid; } } public int CurrentStepUid { get { return result.CurrentStepUid; } set { SetCurrentStepUid(value); } } public Builder SetCurrentStepUid(int value) { + PrepareBuilder(); result.hasCurrentStepUid = true; result.currentStepUid_ = value; return this; } public Builder ClearCurrentStepUid() { + PrepareBuilder(); result.hasCurrentStepUid = false; - result.currentStepUid_ = 0; + result.currentStepUid_ = -1; return this; } public pbc::IPopsicleList ObjectiveStateList { - get { return result.objectiveState_; } + get { return PrepareBuilder().objectiveState_; } } public int ObjectiveStateCount { get { return result.ObjectiveStateCount; } @@ -3138,24 +3823,28 @@ public int GetObjectiveState(int index) { return result.GetObjectiveState(index); } public Builder SetObjectiveState(int index, int value) { + PrepareBuilder(); result.objectiveState_[index] = value; return this; } public Builder AddObjectiveState(int value) { + PrepareBuilder(); result.objectiveState_.Add(value); return this; } public Builder AddRangeObjectiveState(scg::IEnumerable values) { - base.AddRange(values, result.objectiveState_); + PrepareBuilder(); + result.objectiveState_.Add(values); return this; } public Builder ClearObjectiveState() { + PrepareBuilder(); result.objectiveState_.Clear(); return this; } public pbc::IPopsicleList FailureConditionStateList { - get { return result.failureConditionState_; } + get { return PrepareBuilder().failureConditionState_; } } public int FailureConditionStateCount { get { return result.FailureConditionStateCount; } @@ -3164,18 +3853,22 @@ public int GetFailureConditionState(int index) { return result.GetFailureConditionState(index); } public Builder SetFailureConditionState(int index, int value) { + PrepareBuilder(); result.failureConditionState_[index] = value; return this; } public Builder AddFailureConditionState(int value) { + PrepareBuilder(); result.failureConditionState_.Add(value); return this; } public Builder AddRangeFailureConditionState(scg::IEnumerable values) { - base.AddRange(values, result.failureConditionState_); + PrepareBuilder(); + result.failureConditionState_.Add(values); return this; } public Builder ClearFailureConditionState() { + PrepareBuilder(); result.failureConditionState_.Clear(); return this; } @@ -3185,14 +3878,20 @@ static SavedQuest() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class LearnedLore : pb::GeneratedMessage { - private static readonly LearnedLore defaultInstance = new Builder().BuildPartial(); + private LearnedLore() { } + private static readonly LearnedLore defaultInstance = new LearnedLore().MakeReadOnly(); + private static readonly string[] _learnedLoreFieldNames = new string[] { "sno_lore_learned" }; + private static readonly uint[] _learnedLoreFieldTags = new uint[] { 13 }; public static LearnedLore DefaultInstance { get { return defaultInstance; } } public override LearnedLore DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override LearnedLore ThisMessage { @@ -3225,12 +3924,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; + string[] field_names = _learnedLoreFieldNames; if (snoLoreLearned_.Count > 0) { - foreach (int element in snoLoreLearned_) { - output.WriteSFixed32(1, element); - } + output.WriteSFixed32Array(1, field_names[0], snoLoreLearned_); } UnknownFields.WriteTo(output); } @@ -3278,38 +3976,73 @@ public static LearnedLore ParseDelimitedFrom(global::System.IO.Stream input) { public static LearnedLore ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static LearnedLore ParseFrom(pb::CodedInputStream input) { + public static LearnedLore ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static LearnedLore ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static LearnedLore ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private LearnedLore MakeReadOnly() { + snoLoreLearned_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(LearnedLore prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(LearnedLore cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - LearnedLore result = new LearnedLore(); + private bool resultIsReadOnly; + private LearnedLore result; + + private LearnedLore PrepareBuilder() { + if (resultIsReadOnly) { + LearnedLore original = result; + result = new LearnedLore(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override LearnedLore MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new LearnedLore(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -3321,13 +4054,11 @@ public override LearnedLore DefaultInstanceForType { } public override LearnedLore BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.snoLoreLearned_.MakeReadOnly(); - LearnedLore returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -3341,27 +4072,39 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(LearnedLore other) { if (other == global::D3.Hero.LearnedLore.DefaultInstance) return this; + PrepareBuilder(); if (other.snoLoreLearned_.Count != 0) { - base.AddRange(other.snoLoreLearned_, result.snoLoreLearned_); + result.snoLoreLearned_.Add(other.snoLoreLearned_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_learnedLoreFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _learnedLoreFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -3373,20 +4116,26 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } + case 10: case 13: { - AddSnoLoreLearned(input.ReadSFixed32()); + input.ReadSFixed32Array(tag, field_name, result.snoLoreLearned_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public pbc::IPopsicleList SnoLoreLearnedList { - get { return result.snoLoreLearned_; } + get { return PrepareBuilder().snoLoreLearned_; } } public int SnoLoreLearnedCount { get { return result.SnoLoreLearnedCount; } @@ -3395,18 +4144,22 @@ public int GetSnoLoreLearned(int index) { return result.GetSnoLoreLearned(index); } public Builder SetSnoLoreLearned(int index, int value) { + PrepareBuilder(); result.snoLoreLearned_[index] = value; return this; } public Builder AddSnoLoreLearned(int value) { + PrepareBuilder(); result.snoLoreLearned_.Add(value); return this; } public Builder AddRangeSnoLoreLearned(scg::IEnumerable values) { - base.AddRange(values, result.snoLoreLearned_); + PrepareBuilder(); + result.snoLoreLearned_.Add(values); return this; } public Builder ClearSnoLoreLearned() { + PrepareBuilder(); result.snoLoreLearned_.Clear(); return this; } @@ -3416,14 +4169,20 @@ static LearnedLore() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class SavedConversations : pb::GeneratedMessage { - private static readonly SavedConversations defaultInstance = new Builder().BuildPartial(); + private SavedConversations() { } + private static readonly SavedConversations defaultInstance = new SavedConversations().MakeReadOnly(); + private static readonly string[] _savedConversationsFieldNames = new string[] { "played_conversations_bitfield", "sno_saved_conversations" }; + private static readonly uint[] _savedConversationsFieldTags = new uint[] { 10, 21 }; public static SavedConversations DefaultInstance { get { return defaultInstance; } } public override SavedConversations DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override SavedConversations ThisMessage { @@ -3467,15 +4226,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasPlayedConversationsBitfield) { - output.WriteBytes(1, PlayedConversationsBitfield); + string[] field_names = _savedConversationsFieldNames; + if (hasPlayedConversationsBitfield) { + output.WriteBytes(1, field_names[0], PlayedConversationsBitfield); } if (snoSavedConversations_.Count > 0) { - foreach (int element in snoSavedConversations_) { - output.WriteSFixed32(2, element); - } + output.WriteSFixed32Array(2, field_names[1], snoSavedConversations_); } UnknownFields.WriteTo(output); } @@ -3487,7 +4245,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasPlayedConversationsBitfield) { + if (hasPlayedConversationsBitfield) { size += pb::CodedOutputStream.ComputeBytesSize(1, PlayedConversationsBitfield); } { @@ -3526,38 +4284,73 @@ public static SavedConversations ParseDelimitedFrom(global::System.IO.Stream inp public static SavedConversations ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static SavedConversations ParseFrom(pb::CodedInputStream input) { + public static SavedConversations ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SavedConversations ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static SavedConversations ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private SavedConversations MakeReadOnly() { + snoSavedConversations_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(SavedConversations prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SavedConversations cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SavedConversations result; + + private SavedConversations PrepareBuilder() { + if (resultIsReadOnly) { + SavedConversations original = result; + result = new SavedConversations(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - SavedConversations result = new SavedConversations(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override SavedConversations MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SavedConversations(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -3569,13 +4362,11 @@ public override SavedConversations DefaultInstanceForType { } public override SavedConversations BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.snoSavedConversations_.MakeReadOnly(); - SavedConversations returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -3589,30 +4380,42 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SavedConversations other) { if (other == global::D3.Hero.SavedConversations.DefaultInstance) return this; + PrepareBuilder(); if (other.HasPlayedConversationsBitfield) { PlayedConversationsBitfield = other.PlayedConversationsBitfield; } if (other.snoSavedConversations_.Count != 0) { - base.AddRange(other.snoSavedConversations_, result.snoSavedConversations_); + result.snoSavedConversations_.Add(other.snoSavedConversations_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_savedConversationsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _savedConversationsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -3624,24 +4427,30 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { - PlayedConversationsBitfield = input.ReadBytes(); + result.hasPlayedConversationsBitfield = input.ReadBytes(ref result.playedConversationsBitfield_); break; } + case 18: case 21: { - AddSnoSavedConversations(input.ReadSFixed32()); + input.ReadSFixed32Array(tag, field_name, result.snoSavedConversations_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasPlayedConversationsBitfield { - get { return result.HasPlayedConversationsBitfield; } + get { return result.hasPlayedConversationsBitfield; } } public pb::ByteString PlayedConversationsBitfield { get { return result.PlayedConversationsBitfield; } @@ -3649,18 +4458,20 @@ public bool HasPlayedConversationsBitfield { } public Builder SetPlayedConversationsBitfield(pb::ByteString value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasPlayedConversationsBitfield = true; result.playedConversationsBitfield_ = value; return this; } public Builder ClearPlayedConversationsBitfield() { + PrepareBuilder(); result.hasPlayedConversationsBitfield = false; result.playedConversationsBitfield_ = pb::ByteString.Empty; return this; } public pbc::IPopsicleList SnoSavedConversationsList { - get { return result.snoSavedConversations_; } + get { return PrepareBuilder().snoSavedConversations_; } } public int SnoSavedConversationsCount { get { return result.SnoSavedConversationsCount; } @@ -3669,18 +4480,22 @@ public int GetSnoSavedConversations(int index) { return result.GetSnoSavedConversations(index); } public Builder SetSnoSavedConversations(int index, int value) { + PrepareBuilder(); result.snoSavedConversations_[index] = value; return this; } public Builder AddSnoSavedConversations(int value) { + PrepareBuilder(); result.snoSavedConversations_.Add(value); return this; } public Builder AddRangeSnoSavedConversations(scg::IEnumerable values) { - base.AddRange(values, result.snoSavedConversations_); + PrepareBuilder(); + result.snoSavedConversations_.Add(values); return this; } public Builder ClearSnoSavedConversations() { + PrepareBuilder(); result.snoSavedConversations_.Clear(); return this; } @@ -3690,14 +4505,20 @@ static SavedConversations() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class SavePointData_Proto : pb::GeneratedMessage { - private static readonly SavePointData_Proto defaultInstance = new Builder().BuildPartial(); + private SavePointData_Proto() { } + private static readonly SavePointData_Proto defaultInstance = new SavePointData_Proto().MakeReadOnly(); + private static readonly string[] _savePointDataProtoFieldNames = new string[] { "creates_portal", "savepoint_number", "sno_world" }; + private static readonly uint[] _savePointDataProtoFieldTags = new uint[] { 24, 16, 13 }; public static SavePointData_Proto DefaultInstance { get { return defaultInstance; } } public override SavePointData_Proto DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override SavePointData_Proto ThisMessage { @@ -3714,7 +4535,7 @@ protected override SavePointData_Proto ThisMessage { public const int SnoWorldFieldNumber = 1; private bool hasSnoWorld; - private int snoWorld_ = 0; + private int snoWorld_ = -1; public bool HasSnoWorld { get { return hasSnoWorld; } } @@ -3724,7 +4545,7 @@ public int SnoWorld { public const int SavepointNumberFieldNumber = 2; private bool hasSavepointNumber; - private int savepointNumber_ = 0; + private int savepointNumber_ = -1; public bool HasSavepointNumber { get { return hasSavepointNumber; } } @@ -3734,7 +4555,7 @@ public int SavepointNumber { public const int CreatesPortalFieldNumber = 3; private bool hasCreatesPortal; - private uint createsPortal_ = 0; + private uint createsPortal_; public bool HasCreatesPortal { get { return hasCreatesPortal; } } @@ -3751,16 +4572,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasSnoWorld) { - output.WriteSFixed32(1, SnoWorld); + string[] field_names = _savePointDataProtoFieldNames; + if (hasSnoWorld) { + output.WriteSFixed32(1, field_names[2], SnoWorld); } - if (HasSavepointNumber) { - output.WriteSInt32(2, SavepointNumber); + if (hasSavepointNumber) { + output.WriteSInt32(2, field_names[1], SavepointNumber); } - if (HasCreatesPortal) { - output.WriteUInt32(3, CreatesPortal); + if (hasCreatesPortal) { + output.WriteUInt32(3, field_names[0], CreatesPortal); } UnknownFields.WriteTo(output); } @@ -3772,13 +4594,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasSnoWorld) { + if (hasSnoWorld) { size += pb::CodedOutputStream.ComputeSFixed32Size(1, SnoWorld); } - if (HasSavepointNumber) { + if (hasSavepointNumber) { size += pb::CodedOutputStream.ComputeSInt32Size(2, SavepointNumber); } - if (HasCreatesPortal) { + if (hasCreatesPortal) { size += pb::CodedOutputStream.ComputeUInt32Size(3, CreatesPortal); } size += UnknownFields.SerializedSize; @@ -3811,38 +4633,72 @@ public static SavePointData_Proto ParseDelimitedFrom(global::System.IO.Stream in public static SavePointData_Proto ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static SavePointData_Proto ParseFrom(pb::CodedInputStream input) { + public static SavePointData_Proto ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SavePointData_Proto ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static SavePointData_Proto ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private SavePointData_Proto MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(SavePointData_Proto prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SavePointData_Proto cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SavePointData_Proto result; + + private SavePointData_Proto PrepareBuilder() { + if (resultIsReadOnly) { + SavePointData_Proto original = result; + result = new SavePointData_Proto(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - SavePointData_Proto result = new SavePointData_Proto(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override SavePointData_Proto MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SavePointData_Proto(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -3854,12 +4710,11 @@ public override SavePointData_Proto DefaultInstanceForType { } public override SavePointData_Proto BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - SavePointData_Proto returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -3873,6 +4728,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SavePointData_Proto other) { if (other == global::D3.Hero.SavePointData_Proto.DefaultInstance) return this; + PrepareBuilder(); if (other.HasSnoWorld) { SnoWorld = other.SnoWorld; } @@ -3886,20 +4742,31 @@ public override Builder MergeFrom(SavePointData_Proto other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_savePointDataProtoFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _savePointDataProtoFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -3911,75 +4778,86 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 13: { - SnoWorld = input.ReadSFixed32(); + result.hasSnoWorld = input.ReadSFixed32(ref result.snoWorld_); break; } case 16: { - SavepointNumber = input.ReadSInt32(); + result.hasSavepointNumber = input.ReadSInt32(ref result.savepointNumber_); break; } case 24: { - CreatesPortal = input.ReadUInt32(); + result.hasCreatesPortal = input.ReadUInt32(ref result.createsPortal_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasSnoWorld { - get { return result.HasSnoWorld; } + get { return result.hasSnoWorld; } } public int SnoWorld { get { return result.SnoWorld; } set { SetSnoWorld(value); } } public Builder SetSnoWorld(int value) { + PrepareBuilder(); result.hasSnoWorld = true; result.snoWorld_ = value; return this; } public Builder ClearSnoWorld() { + PrepareBuilder(); result.hasSnoWorld = false; - result.snoWorld_ = 0; + result.snoWorld_ = -1; return this; } public bool HasSavepointNumber { - get { return result.HasSavepointNumber; } + get { return result.hasSavepointNumber; } } public int SavepointNumber { get { return result.SavepointNumber; } set { SetSavepointNumber(value); } } public Builder SetSavepointNumber(int value) { + PrepareBuilder(); result.hasSavepointNumber = true; result.savepointNumber_ = value; return this; } public Builder ClearSavepointNumber() { + PrepareBuilder(); result.hasSavepointNumber = false; - result.savepointNumber_ = 0; + result.savepointNumber_ = -1; return this; } public bool HasCreatesPortal { - get { return result.HasCreatesPortal; } + get { return result.hasCreatesPortal; } } public uint CreatesPortal { get { return result.CreatesPortal; } set { SetCreatesPortal(value); } } public Builder SetCreatesPortal(uint value) { + PrepareBuilder(); result.hasCreatesPortal = true; result.createsPortal_ = value; return this; } public Builder ClearCreatesPortal() { + PrepareBuilder(); result.hasCreatesPortal = false; result.createsPortal_ = 0; return this; @@ -3990,125 +4868,413 @@ static SavePointData_Proto() { } } - public sealed partial class SavedData : pb::GeneratedMessage { - private static readonly SavedData defaultInstance = new Builder().BuildPartial(); - public static SavedData DefaultInstance { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class SkillWithRune : pb::GeneratedMessage { + private SkillWithRune() { } + private static readonly SkillWithRune defaultInstance = new SkillWithRune().MakeReadOnly(); + private static readonly string[] _skillWithRuneFieldNames = new string[] { "rune_type", "sno_skill" }; + private static readonly uint[] _skillWithRuneFieldTags = new uint[] { 16, 13 }; + public static SkillWithRune DefaultInstance { get { return defaultInstance; } } - public override SavedData DefaultInstanceForType { - get { return defaultInstance; } + public override SkillWithRune DefaultInstanceForType { + get { return DefaultInstance; } } - protected override SavedData ThisMessage { + protected override SkillWithRune ThisMessage { get { return this; } } public static pbd::MessageDescriptor Descriptor { - get { return global::D3.Hero.Hero.internal__static_D3_Hero_SavedData__Descriptor; } + get { return global::D3.Hero.Hero.internal__static_D3_Hero_SkillWithRune__Descriptor; } } - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::D3.Hero.Hero.internal__static_D3_Hero_SavedData__FieldAccessorTable; } + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.Hero.Hero.internal__static_D3_Hero_SkillWithRune__FieldAccessorTable; } } - public const int HotbarButtonAssignmentsFieldNumber = 1; - private pbc::PopsicleList hotbarButtonAssignments_ = new pbc::PopsicleList(); - public scg::IList HotbarButtonAssignmentsList { - get { return hotbarButtonAssignments_; } - } - public int HotbarButtonAssignmentsCount { - get { return hotbarButtonAssignments_.Count; } + public const int SnoSkillFieldNumber = 1; + private bool hasSnoSkill; + private int snoSkill_ = -1; + public bool HasSnoSkill { + get { return hasSnoSkill; } } - public global::D3.Hero.HotbarButtonData GetHotbarButtonAssignments(int index) { - return hotbarButtonAssignments_[index]; + public int SnoSkill { + get { return snoSkill_; } } - public const int SkillKeyMapFieldNumber = 2; - private pbc::PopsicleList skillKeyMap_ = new pbc::PopsicleList(); - public scg::IList SkillKeyMapList { - get { return skillKeyMap_; } + public const int RuneTypeFieldNumber = 2; + private bool hasRuneType; + private int runeType_ = -1; + public bool HasRuneType { + get { return hasRuneType; } } - public int SkillKeyMapCount { - get { return skillKeyMap_.Count; } - } - public global::D3.Hero.SkillKeyMapping GetSkillKeyMap(int index) { - return skillKeyMap_[index]; + public int RuneType { + get { return runeType_; } } - public const int TimePlayedFieldNumber = 3; - private bool hasTimePlayed; - private uint timePlayed_ = 0; - public bool HasTimePlayed { - get { return hasTimePlayed; } - } - public uint TimePlayed { - get { return timePlayed_; } + public override bool IsInitialized { + get { + if (!hasSnoSkill) return false; + return true; + } } - public const int ActivatedWaypointsFieldNumber = 4; - private bool hasActivatedWaypoints; - private uint activatedWaypoints_ = 0; - public bool HasActivatedWaypoints { - get { return hasActivatedWaypoints; } - } - public uint ActivatedWaypoints { - get { return activatedWaypoints_; } + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _skillWithRuneFieldNames; + if (hasSnoSkill) { + output.WriteSFixed32(1, field_names[1], SnoSkill); + } + if (hasRuneType) { + output.WriteSInt32(2, field_names[0], RuneType); + } + UnknownFields.WriteTo(output); } - public const int HirelingSavedDataFieldNumber = 5; - private bool hasHirelingSavedData; - private global::D3.Hireling.SavedData hirelingSavedData_ = global::D3.Hireling.SavedData.DefaultInstance; - public bool HasHirelingSavedData { - get { return hasHirelingSavedData; } - } - public global::D3.Hireling.SavedData HirelingSavedData { - get { return hirelingSavedData_; } + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasSnoSkill) { + size += pb::CodedOutputStream.ComputeSFixed32Size(1, SnoSkill); + } + if (hasRuneType) { + size += pb::CodedOutputStream.ComputeSInt32Size(2, RuneType); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } } - public const int LastLevelTimeFieldNumber = 6; - private bool hasLastLevelTime; - private uint lastLevelTime_ = 0; - public bool HasLastLevelTime { - get { return hasLastLevelTime; } + public static SkillWithRune ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public uint LastLevelTime { - get { return lastLevelTime_; } + public static SkillWithRune ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - - public const int LearnedLoreFieldNumber = 7; - private bool hasLearnedLore; - private global::D3.Hero.LearnedLore learnedLore_ = global::D3.Hero.LearnedLore.DefaultInstance; - public bool HasLearnedLore { - get { return hasLearnedLore; } + public static SkillWithRune ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public global::D3.Hero.LearnedLore LearnedLore { - get { return learnedLore_; } + public static SkillWithRune ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - - public const int SavedConversationsFieldNumber = 8; - private bool hasSavedConversations; - private global::D3.Hero.SavedConversations savedConversations_ = global::D3.Hero.SavedConversations.DefaultInstance; - public bool HasSavedConversations { - get { return hasSavedConversations; } + public static SkillWithRune ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public global::D3.Hero.SavedConversations SavedConversations { - get { return savedConversations_; } + public static SkillWithRune ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SkillWithRune ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SkillWithRune ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SkillWithRune ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SkillWithRune ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SkillWithRune MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SkillWithRune prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SkillWithRune cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SkillWithRune result; + + private SkillWithRune PrepareBuilder() { + if (resultIsReadOnly) { + SkillWithRune original = result; + result = new SkillWithRune(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SkillWithRune MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.Hero.SkillWithRune.Descriptor; } + } + + public override SkillWithRune DefaultInstanceForType { + get { return global::D3.Hero.SkillWithRune.DefaultInstance; } + } + + public override SkillWithRune BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SkillWithRune) { + return MergeFrom((SkillWithRune) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SkillWithRune other) { + if (other == global::D3.Hero.SkillWithRune.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasSnoSkill) { + SnoSkill = other.SnoSkill; + } + if (other.HasRuneType) { + RuneType = other.RuneType; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_skillWithRuneFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _skillWithRuneFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 13: { + result.hasSnoSkill = input.ReadSFixed32(ref result.snoSkill_); + break; + } + case 16: { + result.hasRuneType = input.ReadSInt32(ref result.runeType_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasSnoSkill { + get { return result.hasSnoSkill; } + } + public int SnoSkill { + get { return result.SnoSkill; } + set { SetSnoSkill(value); } + } + public Builder SetSnoSkill(int value) { + PrepareBuilder(); + result.hasSnoSkill = true; + result.snoSkill_ = value; + return this; + } + public Builder ClearSnoSkill() { + PrepareBuilder(); + result.hasSnoSkill = false; + result.snoSkill_ = -1; + return this; + } + + public bool HasRuneType { + get { return result.hasRuneType; } + } + public int RuneType { + get { return result.RuneType; } + set { SetRuneType(value); } + } + public Builder SetRuneType(int value) { + PrepareBuilder(); + result.hasRuneType = true; + result.runeType_ = value; + return this; + } + public Builder ClearRuneType() { + PrepareBuilder(); + result.hasRuneType = false; + result.runeType_ = -1; + return this; + } + } + static SkillWithRune() { + object.ReferenceEquals(global::D3.Hero.Hero.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class SavedData : pb::GeneratedMessage { + private SavedData() { } + private static readonly SavedData defaultInstance = new SavedData().MakeReadOnly(); + private static readonly string[] _savedDataFieldNames = new string[] { "activated_waypoints", "active_skills", "gbid_potion_button", "hireling_saved_data", "last_level_time", "learned_lore", "save_point", "saved_conversations", "skill_slot_ever_assigned", "skill_version", "sno_traits", "time_played" }; + private static readonly uint[] _savedDataFieldTags = new uint[] { 16, 82, 77, 26, 32, 42, 66, 50, 90, 96, 61, 8 }; + public static SavedData DefaultInstance { + get { return defaultInstance; } + } + + public override SavedData DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SavedData ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.Hero.Hero.internal__static_D3_Hero_SavedData__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.Hero.Hero.internal__static_D3_Hero_SavedData__FieldAccessorTable; } + } + + public const int TimePlayedFieldNumber = 1; + private bool hasTimePlayed; + private uint timePlayed_; + public bool HasTimePlayed { + get { return hasTimePlayed; } + } + public uint TimePlayed { + get { return timePlayed_; } + } + + public const int ActivatedWaypointsFieldNumber = 2; + private bool hasActivatedWaypoints; + private uint activatedWaypoints_; + public bool HasActivatedWaypoints { + get { return hasActivatedWaypoints; } + } + public uint ActivatedWaypoints { + get { return activatedWaypoints_; } + } + + public const int HirelingSavedDataFieldNumber = 3; + private bool hasHirelingSavedData; + private global::D3.Hireling.SavedData hirelingSavedData_; + public bool HasHirelingSavedData { + get { return hasHirelingSavedData; } + } + public global::D3.Hireling.SavedData HirelingSavedData { + get { return hirelingSavedData_ ?? global::D3.Hireling.SavedData.DefaultInstance; } + } + + public const int LastLevelTimeFieldNumber = 4; + private bool hasLastLevelTime; + private uint lastLevelTime_; + public bool HasLastLevelTime { + get { return hasLastLevelTime; } + } + public uint LastLevelTime { + get { return lastLevelTime_; } } - public const int SnoActiveSkillsFieldNumber = 9; - private pbc::PopsicleList snoActiveSkills_ = new pbc::PopsicleList(); - public scg::IList SnoActiveSkillsList { - get { return pbc::Lists.AsReadOnly(snoActiveSkills_); } + public const int LearnedLoreFieldNumber = 5; + private bool hasLearnedLore; + private global::D3.Hero.LearnedLore learnedLore_; + public bool HasLearnedLore { + get { return hasLearnedLore; } } - public int SnoActiveSkillsCount { - get { return snoActiveSkills_.Count; } + public global::D3.Hero.LearnedLore LearnedLore { + get { return learnedLore_ ?? global::D3.Hero.LearnedLore.DefaultInstance; } + } + + public const int SavedConversationsFieldNumber = 6; + private bool hasSavedConversations; + private global::D3.Hero.SavedConversations savedConversations_; + public bool HasSavedConversations { + get { return hasSavedConversations; } } - public int GetSnoActiveSkills(int index) { - return snoActiveSkills_[index]; + public global::D3.Hero.SavedConversations SavedConversations { + get { return savedConversations_ ?? global::D3.Hero.SavedConversations.DefaultInstance; } } - public const int SnoTraitsFieldNumber = 10; + public const int SnoTraitsFieldNumber = 7; private pbc::PopsicleList snoTraits_ = new pbc::PopsicleList(); public scg::IList SnoTraitsList { get { return pbc::Lists.AsReadOnly(snoTraits_); } @@ -4120,26 +5286,56 @@ public int GetSnoTraits(int index) { return snoTraits_[index]; } - public const int SeenTutorialsFieldNumber = 11; - private pbc::PopsicleList seenTutorials_ = new pbc::PopsicleList(); - public scg::IList SeenTutorialsList { - get { return pbc::Lists.AsReadOnly(seenTutorials_); } - } - public int SeenTutorialsCount { - get { return seenTutorials_.Count; } - } - public int GetSeenTutorials(int index) { - return seenTutorials_[index]; - } - - public const int SavePointFieldNumber = 12; + public const int SavePointFieldNumber = 8; private bool hasSavePoint; - private global::D3.Hero.SavePointData_Proto savePoint_ = global::D3.Hero.SavePointData_Proto.DefaultInstance; + private global::D3.Hero.SavePointData_Proto savePoint_; public bool HasSavePoint { get { return hasSavePoint; } } public global::D3.Hero.SavePointData_Proto SavePoint { - get { return savePoint_; } + get { return savePoint_ ?? global::D3.Hero.SavePointData_Proto.DefaultInstance; } + } + + public const int GbidPotionButtonFieldNumber = 9; + private bool hasGbidPotionButton; + private int gbidPotionButton_ = -1; + public bool HasGbidPotionButton { + get { return hasGbidPotionButton; } + } + public int GbidPotionButton { + get { return gbidPotionButton_; } + } + + public const int ActiveSkillsFieldNumber = 10; + private pbc::PopsicleList activeSkills_ = new pbc::PopsicleList(); + public scg::IList ActiveSkillsList { + get { return activeSkills_; } + } + public int ActiveSkillsCount { + get { return activeSkills_.Count; } + } + public global::D3.Hero.SkillWithRune GetActiveSkills(int index) { + return activeSkills_[index]; + } + + public const int SkillSlotEverAssignedFieldNumber = 11; + private bool hasSkillSlotEverAssigned; + private pb::ByteString skillSlotEverAssigned_ = pb::ByteString.Empty; + public bool HasSkillSlotEverAssigned { + get { return hasSkillSlotEverAssigned; } + } + public pb::ByteString SkillSlotEverAssigned { + get { return skillSlotEverAssigned_; } + } + + public const int SkillVersionFieldNumber = 12; + private bool hasSkillVersion; + private uint skillVersion_; + public bool HasSkillVersion { + get { return hasSkillVersion; } + } + public uint SkillVersion { + get { return skillVersion_; } } public override bool IsInitialized { @@ -4151,62 +5347,57 @@ public override bool IsInitialized { if (!hasLearnedLore) return false; if (!hasSavedConversations) return false; if (!hasSavePoint) return false; - foreach (global::D3.Hero.HotbarButtonData element in HotbarButtonAssignmentsList) { - if (!element.IsInitialized) return false; - } - foreach (global::D3.Hero.SkillKeyMapping element in SkillKeyMapList) { - if (!element.IsInitialized) return false; - } + if (!hasGbidPotionButton) return false; + if (!hasSkillSlotEverAssigned) return false; + if (!hasSkillVersion) return false; if (!HirelingSavedData.IsInitialized) return false; if (!SavedConversations.IsInitialized) return false; if (!SavePoint.IsInitialized) return false; + foreach (global::D3.Hero.SkillWithRune element in ActiveSkillsList) { + if (!element.IsInitialized) return false; + } return true; } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - foreach (global::D3.Hero.HotbarButtonData element in HotbarButtonAssignmentsList) { - output.WriteMessage(1, element); + string[] field_names = _savedDataFieldNames; + if (hasTimePlayed) { + output.WriteUInt32(1, field_names[11], TimePlayed); } - foreach (global::D3.Hero.SkillKeyMapping element in SkillKeyMapList) { - output.WriteMessage(2, element); + if (hasActivatedWaypoints) { + output.WriteUInt32(2, field_names[0], ActivatedWaypoints); } - if (HasTimePlayed) { - output.WriteUInt32(3, TimePlayed); + if (hasHirelingSavedData) { + output.WriteMessage(3, field_names[3], HirelingSavedData); } - if (HasActivatedWaypoints) { - output.WriteUInt32(4, ActivatedWaypoints); + if (hasLastLevelTime) { + output.WriteUInt32(4, field_names[4], LastLevelTime); } - if (HasHirelingSavedData) { - output.WriteMessage(5, HirelingSavedData); + if (hasLearnedLore) { + output.WriteMessage(5, field_names[5], LearnedLore); } - if (HasLastLevelTime) { - output.WriteUInt32(6, LastLevelTime); + if (hasSavedConversations) { + output.WriteMessage(6, field_names[7], SavedConversations); } - if (HasLearnedLore) { - output.WriteMessage(7, LearnedLore); + if (snoTraits_.Count > 0) { + output.WriteSFixed32Array(7, field_names[10], snoTraits_); } - if (HasSavedConversations) { - output.WriteMessage(8, SavedConversations); + if (hasSavePoint) { + output.WriteMessage(8, field_names[6], SavePoint); } - if (snoActiveSkills_.Count > 0) { - foreach (int element in snoActiveSkills_) { - output.WriteSFixed32(9, element); - } + if (hasGbidPotionButton) { + output.WriteSFixed32(9, field_names[2], GbidPotionButton); } - if (snoTraits_.Count > 0) { - foreach (int element in snoTraits_) { - output.WriteSFixed32(10, element); - } + if (activeSkills_.Count > 0) { + output.WriteMessageArray(10, field_names[1], activeSkills_); } - if (seenTutorials_.Count > 0) { - foreach (int element in seenTutorials_) { - output.WriteSFixed32(11, element); - } + if (hasSkillSlotEverAssigned) { + output.WriteBytes(11, field_names[8], SkillSlotEverAssigned); } - if (HasSavePoint) { - output.WriteMessage(12, SavePoint); + if (hasSkillVersion) { + output.WriteUInt32(12, field_names[9], SkillVersion); } UnknownFields.WriteTo(output); } @@ -4218,35 +5409,23 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - foreach (global::D3.Hero.HotbarButtonData element in HotbarButtonAssignmentsList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); + if (hasTimePlayed) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, TimePlayed); } - foreach (global::D3.Hero.SkillKeyMapping element in SkillKeyMapList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); + if (hasActivatedWaypoints) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, ActivatedWaypoints); } - if (HasTimePlayed) { - size += pb::CodedOutputStream.ComputeUInt32Size(3, TimePlayed); + if (hasHirelingSavedData) { + size += pb::CodedOutputStream.ComputeMessageSize(3, HirelingSavedData); } - if (HasActivatedWaypoints) { - size += pb::CodedOutputStream.ComputeUInt32Size(4, ActivatedWaypoints); + if (hasLastLevelTime) { + size += pb::CodedOutputStream.ComputeUInt32Size(4, LastLevelTime); } - if (HasHirelingSavedData) { - size += pb::CodedOutputStream.ComputeMessageSize(5, HirelingSavedData); + if (hasLearnedLore) { + size += pb::CodedOutputStream.ComputeMessageSize(5, LearnedLore); } - if (HasLastLevelTime) { - size += pb::CodedOutputStream.ComputeUInt32Size(6, LastLevelTime); - } - if (HasLearnedLore) { - size += pb::CodedOutputStream.ComputeMessageSize(7, LearnedLore); - } - if (HasSavedConversations) { - size += pb::CodedOutputStream.ComputeMessageSize(8, SavedConversations); - } - { - int dataSize = 0; - dataSize = 4 * snoActiveSkills_.Count; - size += dataSize; - size += 1 * snoActiveSkills_.Count; + if (hasSavedConversations) { + size += pb::CodedOutputStream.ComputeMessageSize(6, SavedConversations); } { int dataSize = 0; @@ -4254,14 +5433,20 @@ public override int SerializedSize { size += dataSize; size += 1 * snoTraits_.Count; } - { - int dataSize = 0; - dataSize = 4 * seenTutorials_.Count; - size += dataSize; - size += 1 * seenTutorials_.Count; + if (hasSavePoint) { + size += pb::CodedOutputStream.ComputeMessageSize(8, SavePoint); + } + if (hasGbidPotionButton) { + size += pb::CodedOutputStream.ComputeSFixed32Size(9, GbidPotionButton); + } + foreach (global::D3.Hero.SkillWithRune element in ActiveSkillsList) { + size += pb::CodedOutputStream.ComputeMessageSize(10, element); + } + if (hasSkillSlotEverAssigned) { + size += pb::CodedOutputStream.ComputeBytesSize(11, SkillSlotEverAssigned); } - if (HasSavePoint) { - size += pb::CodedOutputStream.ComputeMessageSize(12, SavePoint); + if (hasSkillVersion) { + size += pb::CodedOutputStream.ComputeUInt32Size(12, SkillVersion); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -4293,38 +5478,74 @@ public static SavedData ParseDelimitedFrom(global::System.IO.Stream input) { public static SavedData ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static SavedData ParseFrom(pb::CodedInputStream input) { + public static SavedData ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SavedData ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static SavedData ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private SavedData MakeReadOnly() { + snoTraits_.MakeReadOnly(); + activeSkills_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(SavedData prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SavedData cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SavedData result; + + private SavedData PrepareBuilder() { + if (resultIsReadOnly) { + SavedData original = result; + result = new SavedData(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - SavedData result = new SavedData(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override SavedData MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SavedData(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -4336,17 +5557,11 @@ public override SavedData DefaultInstanceForType { } public override SavedData BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.hotbarButtonAssignments_.MakeReadOnly(); - result.skillKeyMap_.MakeReadOnly(); - result.snoActiveSkills_.MakeReadOnly(); - result.snoTraits_.MakeReadOnly(); - result.seenTutorials_.MakeReadOnly(); - SavedData returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -4360,12 +5575,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SavedData other) { if (other == global::D3.Hero.SavedData.DefaultInstance) return this; - if (other.hotbarButtonAssignments_.Count != 0) { - base.AddRange(other.hotbarButtonAssignments_, result.hotbarButtonAssignments_); - } - if (other.skillKeyMap_.Count != 0) { - base.AddRange(other.skillKeyMap_, result.skillKeyMap_); - } + PrepareBuilder(); if (other.HasTimePlayed) { TimePlayed = other.TimePlayed; } @@ -4384,36 +5594,53 @@ public override Builder MergeFrom(SavedData other) { if (other.HasSavedConversations) { MergeSavedConversations(other.SavedConversations); } - if (other.snoActiveSkills_.Count != 0) { - base.AddRange(other.snoActiveSkills_, result.snoActiveSkills_); - } if (other.snoTraits_.Count != 0) { - base.AddRange(other.snoTraits_, result.snoTraits_); - } - if (other.seenTutorials_.Count != 0) { - base.AddRange(other.seenTutorials_, result.seenTutorials_); + result.snoTraits_.Add(other.snoTraits_); } if (other.HasSavePoint) { MergeSavePoint(other.SavePoint); } + if (other.HasGbidPotionButton) { + GbidPotionButton = other.GbidPotionButton; + } + if (other.activeSkills_.Count != 0) { + result.activeSkills_.Add(other.activeSkills_); + } + if (other.HasSkillSlotEverAssigned) { + SkillSlotEverAssigned = other.SkillSlotEverAssigned; + } + if (other.HasSkillVersion) { + SkillVersion = other.SkillVersion; + } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_savedDataFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _savedDataFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -4425,200 +5652,130 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::D3.Hero.HotbarButtonData.Builder subBuilder = global::D3.Hero.HotbarButtonData.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddHotbarButtonAssignments(subBuilder.BuildPartial()); - break; - } - case 18: { - global::D3.Hero.SkillKeyMapping.Builder subBuilder = global::D3.Hero.SkillKeyMapping.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddSkillKeyMap(subBuilder.BuildPartial()); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } - case 24: { - TimePlayed = input.ReadUInt32(); + case 8: { + result.hasTimePlayed = input.ReadUInt32(ref result.timePlayed_); break; } - case 32: { - ActivatedWaypoints = input.ReadUInt32(); + case 16: { + result.hasActivatedWaypoints = input.ReadUInt32(ref result.activatedWaypoints_); break; } - case 42: { + case 26: { global::D3.Hireling.SavedData.Builder subBuilder = global::D3.Hireling.SavedData.CreateBuilder(); - if (HasHirelingSavedData) { + if (result.hasHirelingSavedData) { subBuilder.MergeFrom(HirelingSavedData); } input.ReadMessage(subBuilder, extensionRegistry); HirelingSavedData = subBuilder.BuildPartial(); break; } - case 48: { - LastLevelTime = input.ReadUInt32(); + case 32: { + result.hasLastLevelTime = input.ReadUInt32(ref result.lastLevelTime_); break; } - case 58: { + case 42: { global::D3.Hero.LearnedLore.Builder subBuilder = global::D3.Hero.LearnedLore.CreateBuilder(); - if (HasLearnedLore) { + if (result.hasLearnedLore) { subBuilder.MergeFrom(LearnedLore); } input.ReadMessage(subBuilder, extensionRegistry); LearnedLore = subBuilder.BuildPartial(); break; } - case 66: { + case 50: { global::D3.Hero.SavedConversations.Builder subBuilder = global::D3.Hero.SavedConversations.CreateBuilder(); - if (HasSavedConversations) { + if (result.hasSavedConversations) { subBuilder.MergeFrom(SavedConversations); } input.ReadMessage(subBuilder, extensionRegistry); SavedConversations = subBuilder.BuildPartial(); break; } - case 77: { - AddSnoActiveSkills(input.ReadSFixed32()); - break; - } - case 85: { - AddSnoTraits(input.ReadSFixed32()); + case 58: + case 61: { + input.ReadSFixed32Array(tag, field_name, result.snoTraits_); break; } - case 93: { - AddSeenTutorials(input.ReadSFixed32()); - break; - } - case 98: { + case 66: { global::D3.Hero.SavePointData_Proto.Builder subBuilder = global::D3.Hero.SavePointData_Proto.CreateBuilder(); - if (HasSavePoint) { + if (result.hasSavePoint) { subBuilder.MergeFrom(SavePoint); } input.ReadMessage(subBuilder, extensionRegistry); SavePoint = subBuilder.BuildPartial(); break; } + case 77: { + result.hasGbidPotionButton = input.ReadSFixed32(ref result.gbidPotionButton_); + break; + } + case 82: { + input.ReadMessageArray(tag, field_name, result.activeSkills_, global::D3.Hero.SkillWithRune.DefaultInstance, extensionRegistry); + break; + } + case 90: { + result.hasSkillSlotEverAssigned = input.ReadBytes(ref result.skillSlotEverAssigned_); + break; + } + case 96: { + result.hasSkillVersion = input.ReadUInt32(ref result.skillVersion_); + break; + } } } - } - - - public pbc::IPopsicleList HotbarButtonAssignmentsList { - get { return result.hotbarButtonAssignments_; } - } - public int HotbarButtonAssignmentsCount { - get { return result.HotbarButtonAssignmentsCount; } - } - public global::D3.Hero.HotbarButtonData GetHotbarButtonAssignments(int index) { - return result.GetHotbarButtonAssignments(index); - } - public Builder SetHotbarButtonAssignments(int index, global::D3.Hero.HotbarButtonData value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hotbarButtonAssignments_[index] = value; - return this; - } - public Builder SetHotbarButtonAssignments(int index, global::D3.Hero.HotbarButtonData.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hotbarButtonAssignments_[index] = builderForValue.Build(); - return this; - } - public Builder AddHotbarButtonAssignments(global::D3.Hero.HotbarButtonData value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hotbarButtonAssignments_.Add(value); - return this; - } - public Builder AddHotbarButtonAssignments(global::D3.Hero.HotbarButtonData.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hotbarButtonAssignments_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeHotbarButtonAssignments(scg::IEnumerable values) { - base.AddRange(values, result.hotbarButtonAssignments_); - return this; - } - public Builder ClearHotbarButtonAssignments() { - result.hotbarButtonAssignments_.Clear(); + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } return this; } - public pbc::IPopsicleList SkillKeyMapList { - get { return result.skillKeyMap_; } - } - public int SkillKeyMapCount { - get { return result.SkillKeyMapCount; } - } - public global::D3.Hero.SkillKeyMapping GetSkillKeyMap(int index) { - return result.GetSkillKeyMap(index); - } - public Builder SetSkillKeyMap(int index, global::D3.Hero.SkillKeyMapping value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.skillKeyMap_[index] = value; - return this; - } - public Builder SetSkillKeyMap(int index, global::D3.Hero.SkillKeyMapping.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.skillKeyMap_[index] = builderForValue.Build(); - return this; - } - public Builder AddSkillKeyMap(global::D3.Hero.SkillKeyMapping value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.skillKeyMap_.Add(value); - return this; - } - public Builder AddSkillKeyMap(global::D3.Hero.SkillKeyMapping.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.skillKeyMap_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeSkillKeyMap(scg::IEnumerable values) { - base.AddRange(values, result.skillKeyMap_); - return this; - } - public Builder ClearSkillKeyMap() { - result.skillKeyMap_.Clear(); - return this; - } public bool HasTimePlayed { - get { return result.HasTimePlayed; } + get { return result.hasTimePlayed; } } public uint TimePlayed { get { return result.TimePlayed; } set { SetTimePlayed(value); } } public Builder SetTimePlayed(uint value) { + PrepareBuilder(); result.hasTimePlayed = true; result.timePlayed_ = value; return this; } public Builder ClearTimePlayed() { + PrepareBuilder(); result.hasTimePlayed = false; result.timePlayed_ = 0; return this; } public bool HasActivatedWaypoints { - get { return result.HasActivatedWaypoints; } + get { return result.hasActivatedWaypoints; } } public uint ActivatedWaypoints { get { return result.ActivatedWaypoints; } set { SetActivatedWaypoints(value); } } public Builder SetActivatedWaypoints(uint value) { + PrepareBuilder(); result.hasActivatedWaypoints = true; result.activatedWaypoints_ = value; return this; } public Builder ClearActivatedWaypoints() { + PrepareBuilder(); result.hasActivatedWaypoints = false; result.activatedWaypoints_ = 0; return this; } public bool HasHirelingSavedData { - get { return result.HasHirelingSavedData; } + get { return result.hasHirelingSavedData; } } public global::D3.Hireling.SavedData HirelingSavedData { get { return result.HirelingSavedData; } @@ -4626,19 +5783,22 @@ public bool HasHirelingSavedData { } public Builder SetHirelingSavedData(global::D3.Hireling.SavedData value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasHirelingSavedData = true; result.hirelingSavedData_ = value; return this; } public Builder SetHirelingSavedData(global::D3.Hireling.SavedData.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasHirelingSavedData = true; result.hirelingSavedData_ = builderForValue.Build(); return this; } public Builder MergeHirelingSavedData(global::D3.Hireling.SavedData value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasHirelingSavedData && + PrepareBuilder(); + if (result.hasHirelingSavedData && result.hirelingSavedData_ != global::D3.Hireling.SavedData.DefaultInstance) { result.hirelingSavedData_ = global::D3.Hireling.SavedData.CreateBuilder(result.hirelingSavedData_).MergeFrom(value).BuildPartial(); } else { @@ -4648,31 +5808,34 @@ public Builder MergeHirelingSavedData(global::D3.Hireling.SavedData value) { return this; } public Builder ClearHirelingSavedData() { + PrepareBuilder(); result.hasHirelingSavedData = false; - result.hirelingSavedData_ = global::D3.Hireling.SavedData.DefaultInstance; + result.hirelingSavedData_ = null; return this; } public bool HasLastLevelTime { - get { return result.HasLastLevelTime; } + get { return result.hasLastLevelTime; } } public uint LastLevelTime { get { return result.LastLevelTime; } set { SetLastLevelTime(value); } } public Builder SetLastLevelTime(uint value) { + PrepareBuilder(); result.hasLastLevelTime = true; result.lastLevelTime_ = value; return this; } public Builder ClearLastLevelTime() { + PrepareBuilder(); result.hasLastLevelTime = false; result.lastLevelTime_ = 0; return this; } public bool HasLearnedLore { - get { return result.HasLearnedLore; } + get { return result.hasLearnedLore; } } public global::D3.Hero.LearnedLore LearnedLore { get { return result.LearnedLore; } @@ -4680,19 +5843,22 @@ public bool HasLearnedLore { } public Builder SetLearnedLore(global::D3.Hero.LearnedLore value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasLearnedLore = true; result.learnedLore_ = value; return this; } public Builder SetLearnedLore(global::D3.Hero.LearnedLore.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasLearnedLore = true; result.learnedLore_ = builderForValue.Build(); return this; } public Builder MergeLearnedLore(global::D3.Hero.LearnedLore value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasLearnedLore && + PrepareBuilder(); + if (result.hasLearnedLore && result.learnedLore_ != global::D3.Hero.LearnedLore.DefaultInstance) { result.learnedLore_ = global::D3.Hero.LearnedLore.CreateBuilder(result.learnedLore_).MergeFrom(value).BuildPartial(); } else { @@ -4702,13 +5868,14 @@ public Builder MergeLearnedLore(global::D3.Hero.LearnedLore value) { return this; } public Builder ClearLearnedLore() { + PrepareBuilder(); result.hasLearnedLore = false; - result.learnedLore_ = global::D3.Hero.LearnedLore.DefaultInstance; + result.learnedLore_ = null; return this; } public bool HasSavedConversations { - get { return result.HasSavedConversations; } + get { return result.hasSavedConversations; } } public global::D3.Hero.SavedConversations SavedConversations { get { return result.SavedConversations; } @@ -4716,19 +5883,22 @@ public bool HasSavedConversations { } public Builder SetSavedConversations(global::D3.Hero.SavedConversations value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasSavedConversations = true; result.savedConversations_ = value; return this; } public Builder SetSavedConversations(global::D3.Hero.SavedConversations.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasSavedConversations = true; result.savedConversations_ = builderForValue.Build(); return this; } public Builder MergeSavedConversations(global::D3.Hero.SavedConversations value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasSavedConversations && + PrepareBuilder(); + if (result.hasSavedConversations && result.savedConversations_ != global::D3.Hero.SavedConversations.DefaultInstance) { result.savedConversations_ = global::D3.Hero.SavedConversations.CreateBuilder(result.savedConversations_).MergeFrom(value).BuildPartial(); } else { @@ -4738,39 +5908,14 @@ public Builder MergeSavedConversations(global::D3.Hero.SavedConversations value) return this; } public Builder ClearSavedConversations() { + PrepareBuilder(); result.hasSavedConversations = false; - result.savedConversations_ = global::D3.Hero.SavedConversations.DefaultInstance; - return this; - } - - public pbc::IPopsicleList SnoActiveSkillsList { - get { return result.snoActiveSkills_; } - } - public int SnoActiveSkillsCount { - get { return result.SnoActiveSkillsCount; } - } - public int GetSnoActiveSkills(int index) { - return result.GetSnoActiveSkills(index); - } - public Builder SetSnoActiveSkills(int index, int value) { - result.snoActiveSkills_[index] = value; - return this; - } - public Builder AddSnoActiveSkills(int value) { - result.snoActiveSkills_.Add(value); - return this; - } - public Builder AddRangeSnoActiveSkills(scg::IEnumerable values) { - base.AddRange(values, result.snoActiveSkills_); - return this; - } - public Builder ClearSnoActiveSkills() { - result.snoActiveSkills_.Clear(); + result.savedConversations_ = null; return this; } public pbc::IPopsicleList SnoTraitsList { - get { return result.snoTraits_; } + get { return PrepareBuilder().snoTraits_; } } public int SnoTraitsCount { get { return result.SnoTraitsCount; } @@ -4779,50 +5924,28 @@ public int GetSnoTraits(int index) { return result.GetSnoTraits(index); } public Builder SetSnoTraits(int index, int value) { + PrepareBuilder(); result.snoTraits_[index] = value; return this; } public Builder AddSnoTraits(int value) { + PrepareBuilder(); result.snoTraits_.Add(value); return this; } public Builder AddRangeSnoTraits(scg::IEnumerable values) { - base.AddRange(values, result.snoTraits_); + PrepareBuilder(); + result.snoTraits_.Add(values); return this; } public Builder ClearSnoTraits() { + PrepareBuilder(); result.snoTraits_.Clear(); return this; } - public pbc::IPopsicleList SeenTutorialsList { - get { return result.seenTutorials_; } - } - public int SeenTutorialsCount { - get { return result.SeenTutorialsCount; } - } - public int GetSeenTutorials(int index) { - return result.GetSeenTutorials(index); - } - public Builder SetSeenTutorials(int index, int value) { - result.seenTutorials_[index] = value; - return this; - } - public Builder AddSeenTutorials(int value) { - result.seenTutorials_.Add(value); - return this; - } - public Builder AddRangeSeenTutorials(scg::IEnumerable values) { - base.AddRange(values, result.seenTutorials_); - return this; - } - public Builder ClearSeenTutorials() { - result.seenTutorials_.Clear(); - return this; - } - public bool HasSavePoint { - get { return result.HasSavePoint; } + get { return result.hasSavePoint; } } public global::D3.Hero.SavePointData_Proto SavePoint { get { return result.SavePoint; } @@ -4830,19 +5953,22 @@ public bool HasSavePoint { } public Builder SetSavePoint(global::D3.Hero.SavePointData_Proto value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasSavePoint = true; result.savePoint_ = value; return this; } public Builder SetSavePoint(global::D3.Hero.SavePointData_Proto.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasSavePoint = true; result.savePoint_ = builderForValue.Build(); return this; } public Builder MergeSavePoint(global::D3.Hero.SavePointData_Proto value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasSavePoint && + PrepareBuilder(); + if (result.hasSavePoint && result.savePoint_ != global::D3.Hero.SavePointData_Proto.DefaultInstance) { result.savePoint_ = global::D3.Hero.SavePointData_Proto.CreateBuilder(result.savePoint_).MergeFrom(value).BuildPartial(); } else { @@ -4852,8 +5978,114 @@ public Builder MergeSavePoint(global::D3.Hero.SavePointData_Proto value) { return this; } public Builder ClearSavePoint() { + PrepareBuilder(); result.hasSavePoint = false; - result.savePoint_ = global::D3.Hero.SavePointData_Proto.DefaultInstance; + result.savePoint_ = null; + return this; + } + + public bool HasGbidPotionButton { + get { return result.hasGbidPotionButton; } + } + public int GbidPotionButton { + get { return result.GbidPotionButton; } + set { SetGbidPotionButton(value); } + } + public Builder SetGbidPotionButton(int value) { + PrepareBuilder(); + result.hasGbidPotionButton = true; + result.gbidPotionButton_ = value; + return this; + } + public Builder ClearGbidPotionButton() { + PrepareBuilder(); + result.hasGbidPotionButton = false; + result.gbidPotionButton_ = -1; + return this; + } + + public pbc::IPopsicleList ActiveSkillsList { + get { return PrepareBuilder().activeSkills_; } + } + public int ActiveSkillsCount { + get { return result.ActiveSkillsCount; } + } + public global::D3.Hero.SkillWithRune GetActiveSkills(int index) { + return result.GetActiveSkills(index); + } + public Builder SetActiveSkills(int index, global::D3.Hero.SkillWithRune value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.activeSkills_[index] = value; + return this; + } + public Builder SetActiveSkills(int index, global::D3.Hero.SkillWithRune.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.activeSkills_[index] = builderForValue.Build(); + return this; + } + public Builder AddActiveSkills(global::D3.Hero.SkillWithRune value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.activeSkills_.Add(value); + return this; + } + public Builder AddActiveSkills(global::D3.Hero.SkillWithRune.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.activeSkills_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeActiveSkills(scg::IEnumerable values) { + PrepareBuilder(); + result.activeSkills_.Add(values); + return this; + } + public Builder ClearActiveSkills() { + PrepareBuilder(); + result.activeSkills_.Clear(); + return this; + } + + public bool HasSkillSlotEverAssigned { + get { return result.hasSkillSlotEverAssigned; } + } + public pb::ByteString SkillSlotEverAssigned { + get { return result.SkillSlotEverAssigned; } + set { SetSkillSlotEverAssigned(value); } + } + public Builder SetSkillSlotEverAssigned(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasSkillSlotEverAssigned = true; + result.skillSlotEverAssigned_ = value; + return this; + } + public Builder ClearSkillSlotEverAssigned() { + PrepareBuilder(); + result.hasSkillSlotEverAssigned = false; + result.skillSlotEverAssigned_ = pb::ByteString.Empty; + return this; + } + + public bool HasSkillVersion { + get { return result.hasSkillVersion; } + } + public uint SkillVersion { + get { return result.SkillVersion; } + set { SetSkillVersion(value); } + } + public Builder SetSkillVersion(uint value) { + PrepareBuilder(); + result.hasSkillVersion = true; + result.skillVersion_ = value; + return this; + } + public Builder ClearSkillVersion() { + PrepareBuilder(); + result.hasSkillVersion = false; + result.skillVersion_ = 0; return this; } } @@ -4862,14 +6094,20 @@ static SavedData() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Timestamps : pb::GeneratedMessage { - private static readonly Timestamps defaultInstance = new Builder().BuildPartial(); + private Timestamps() { } + private static readonly Timestamps defaultInstance = new Timestamps().MakeReadOnly(); + private static readonly string[] _timestampsFieldNames = new string[] { "create_time", "delete_time" }; + private static readonly uint[] _timestampsFieldTags = new uint[] { 8, 16 }; public static Timestamps DefaultInstance { get { return defaultInstance; } } public override Timestamps DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override Timestamps ThisMessage { @@ -4886,7 +6124,7 @@ protected override Timestamps ThisMessage { public const int CreateTimeFieldNumber = 1; private bool hasCreateTime; - private long createTime_ = 0; + private long createTime_; public bool HasCreateTime { get { return hasCreateTime; } } @@ -4896,7 +6134,7 @@ public long CreateTime { public const int DeleteTimeFieldNumber = 2; private bool hasDeleteTime; - private long deleteTime_ = 0; + private long deleteTime_; public bool HasDeleteTime { get { return hasDeleteTime; } } @@ -4911,13 +6149,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasCreateTime) { - output.WriteSInt64(1, CreateTime); + string[] field_names = _timestampsFieldNames; + if (hasCreateTime) { + output.WriteSInt64(1, field_names[0], CreateTime); } - if (HasDeleteTime) { - output.WriteSInt64(2, DeleteTime); + if (hasDeleteTime) { + output.WriteSInt64(2, field_names[1], DeleteTime); } UnknownFields.WriteTo(output); } @@ -4929,10 +6168,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasCreateTime) { + if (hasCreateTime) { size += pb::CodedOutputStream.ComputeSInt64Size(1, CreateTime); } - if (HasDeleteTime) { + if (hasDeleteTime) { size += pb::CodedOutputStream.ComputeSInt64Size(2, DeleteTime); } size += UnknownFields.SerializedSize; @@ -4965,38 +6204,72 @@ public static Timestamps ParseDelimitedFrom(global::System.IO.Stream input) { public static Timestamps ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static Timestamps ParseFrom(pb::CodedInputStream input) { + public static Timestamps ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Timestamps ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static Timestamps ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private Timestamps MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(Timestamps prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Timestamps cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Timestamps result; + + private Timestamps PrepareBuilder() { + if (resultIsReadOnly) { + Timestamps original = result; + result = new Timestamps(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - Timestamps result = new Timestamps(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override Timestamps MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new Timestamps(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -5008,12 +6281,11 @@ public override Timestamps DefaultInstanceForType { } public override Timestamps BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - Timestamps returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -5027,6 +6299,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Timestamps other) { if (other == global::D3.Hero.Timestamps.DefaultInstance) return this; + PrepareBuilder(); if (other.HasCreateTime) { CreateTime = other.CreateTime; } @@ -5037,20 +6310,31 @@ public override Builder MergeFrom(Timestamps other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_timestampsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _timestampsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -5062,53 +6346,62 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 8: { - CreateTime = input.ReadSInt64(); + result.hasCreateTime = input.ReadSInt64(ref result.createTime_); break; } case 16: { - DeleteTime = input.ReadSInt64(); + result.hasDeleteTime = input.ReadSInt64(ref result.deleteTime_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasCreateTime { - get { return result.HasCreateTime; } + get { return result.hasCreateTime; } } public long CreateTime { get { return result.CreateTime; } set { SetCreateTime(value); } } public Builder SetCreateTime(long value) { + PrepareBuilder(); result.hasCreateTime = true; result.createTime_ = value; return this; } public Builder ClearCreateTime() { + PrepareBuilder(); result.hasCreateTime = false; result.createTime_ = 0; return this; } public bool HasDeleteTime { - get { return result.HasDeleteTime; } + get { return result.hasDeleteTime; } } public long DeleteTime { get { return result.DeleteTime; } set { SetDeleteTime(value); } } public Builder SetDeleteTime(long value) { + PrepareBuilder(); result.hasDeleteTime = true; result.deleteTime_ = value; return this; } public Builder ClearDeleteTime() { + PrepareBuilder(); result.hasDeleteTime = false; result.deleteTime_ = 0; return this; @@ -5119,14 +6412,20 @@ static Timestamps() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class SavedDefinition : pb::GeneratedMessage { - private static readonly SavedDefinition defaultInstance = new Builder().BuildPartial(); + private SavedDefinition() { } + private static readonly SavedDefinition defaultInstance = new SavedDefinition().MakeReadOnly(); + private static readonly string[] _savedDefinitionFieldNames = new string[] { "digest", "items", "quest_reward_history", "saved_attributes", "saved_data", "saved_quest", "version" }; + private static readonly uint[] _savedDefinitionFieldTags = new uint[] { 18, 50, 58, 26, 34, 42, 8 }; public static SavedDefinition DefaultInstance { get { return defaultInstance; } } public override SavedDefinition DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override SavedDefinition ThisMessage { @@ -5143,7 +6442,7 @@ protected override SavedDefinition ThisMessage { public const int VersionFieldNumber = 1; private bool hasVersion; - private uint version_ = 0; + private uint version_; public bool HasVersion { get { return hasVersion; } } @@ -5153,32 +6452,32 @@ public uint Version { public const int DigestFieldNumber = 2; private bool hasDigest; - private global::D3.Hero.Digest digest_ = global::D3.Hero.Digest.DefaultInstance; + private global::D3.Hero.Digest digest_; public bool HasDigest { get { return hasDigest; } } public global::D3.Hero.Digest Digest { - get { return digest_; } + get { return digest_ ?? global::D3.Hero.Digest.DefaultInstance; } } public const int SavedAttributesFieldNumber = 3; private bool hasSavedAttributes; - private global::D3.AttributeSerializer.SavedAttributes savedAttributes_ = global::D3.AttributeSerializer.SavedAttributes.DefaultInstance; + private global::D3.AttributeSerializer.SavedAttributes savedAttributes_; public bool HasSavedAttributes { get { return hasSavedAttributes; } } public global::D3.AttributeSerializer.SavedAttributes SavedAttributes { - get { return savedAttributes_; } + get { return savedAttributes_ ?? global::D3.AttributeSerializer.SavedAttributes.DefaultInstance; } } public const int SavedDataFieldNumber = 4; private bool hasSavedData; - private global::D3.Hero.SavedData savedData_ = global::D3.Hero.SavedData.DefaultInstance; + private global::D3.Hero.SavedData savedData_; public bool HasSavedData { get { return hasSavedData; } } public global::D3.Hero.SavedData SavedData { - get { return savedData_; } + get { return savedData_ ?? global::D3.Hero.SavedData.DefaultInstance; } } public const int SavedQuestFieldNumber = 5; @@ -5195,12 +6494,12 @@ public int SavedQuestCount { public const int ItemsFieldNumber = 6; private bool hasItems; - private global::D3.Items.ItemList items_ = global::D3.Items.ItemList.DefaultInstance; + private global::D3.Items.ItemList items_; public bool HasItems { get { return hasItems; } } public global::D3.Items.ItemList Items { - get { return items_; } + get { return items_ ?? global::D3.Items.ItemList.DefaultInstance; } } public const int QuestRewardHistoryFieldNumber = 7; @@ -5239,28 +6538,29 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasVersion) { - output.WriteUInt32(1, Version); + string[] field_names = _savedDefinitionFieldNames; + if (hasVersion) { + output.WriteUInt32(1, field_names[6], Version); } - if (HasDigest) { - output.WriteMessage(2, Digest); + if (hasDigest) { + output.WriteMessage(2, field_names[0], Digest); } - if (HasSavedAttributes) { - output.WriteMessage(3, SavedAttributes); + if (hasSavedAttributes) { + output.WriteMessage(3, field_names[3], SavedAttributes); } - if (HasSavedData) { - output.WriteMessage(4, SavedData); + if (hasSavedData) { + output.WriteMessage(4, field_names[4], SavedData); } - foreach (global::D3.Hero.SavedQuest element in SavedQuestList) { - output.WriteMessage(5, element); + if (savedQuest_.Count > 0) { + output.WriteMessageArray(5, field_names[5], savedQuest_); } - if (HasItems) { - output.WriteMessage(6, Items); + if (hasItems) { + output.WriteMessage(6, field_names[1], Items); } - foreach (global::D3.Hero.QuestRewardHistoryEntry element in QuestRewardHistoryList) { - output.WriteMessage(7, element); + if (questRewardHistory_.Count > 0) { + output.WriteMessageArray(7, field_names[2], questRewardHistory_); } UnknownFields.WriteTo(output); } @@ -5272,22 +6572,22 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasVersion) { + if (hasVersion) { size += pb::CodedOutputStream.ComputeUInt32Size(1, Version); } - if (HasDigest) { + if (hasDigest) { size += pb::CodedOutputStream.ComputeMessageSize(2, Digest); } - if (HasSavedAttributes) { + if (hasSavedAttributes) { size += pb::CodedOutputStream.ComputeMessageSize(3, SavedAttributes); } - if (HasSavedData) { + if (hasSavedData) { size += pb::CodedOutputStream.ComputeMessageSize(4, SavedData); } foreach (global::D3.Hero.SavedQuest element in SavedQuestList) { size += pb::CodedOutputStream.ComputeMessageSize(5, element); } - if (HasItems) { + if (hasItems) { size += pb::CodedOutputStream.ComputeMessageSize(6, Items); } foreach (global::D3.Hero.QuestRewardHistoryEntry element in QuestRewardHistoryList) { @@ -5323,38 +6623,74 @@ public static SavedDefinition ParseDelimitedFrom(global::System.IO.Stream input) public static SavedDefinition ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static SavedDefinition ParseFrom(pb::CodedInputStream input) { + public static SavedDefinition ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SavedDefinition ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static SavedDefinition ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private SavedDefinition MakeReadOnly() { + savedQuest_.MakeReadOnly(); + questRewardHistory_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(SavedDefinition prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SavedDefinition cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SavedDefinition result; + + private SavedDefinition PrepareBuilder() { + if (resultIsReadOnly) { + SavedDefinition original = result; + result = new SavedDefinition(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - SavedDefinition result = new SavedDefinition(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override SavedDefinition MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SavedDefinition(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -5366,14 +6702,11 @@ public override SavedDefinition DefaultInstanceForType { } public override SavedDefinition BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.savedQuest_.MakeReadOnly(); - result.questRewardHistory_.MakeReadOnly(); - SavedDefinition returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -5387,6 +6720,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SavedDefinition other) { if (other == global::D3.Hero.SavedDefinition.DefaultInstance) return this; + PrepareBuilder(); if (other.HasVersion) { Version = other.Version; } @@ -5400,32 +6734,43 @@ public override Builder MergeFrom(SavedDefinition other) { MergeSavedData(other.SavedData); } if (other.savedQuest_.Count != 0) { - base.AddRange(other.savedQuest_, result.savedQuest_); + result.savedQuest_.Add(other.savedQuest_); } if (other.HasItems) { MergeItems(other.Items); } if (other.questRewardHistory_.Count != 0) { - base.AddRange(other.questRewardHistory_, result.questRewardHistory_); + result.questRewardHistory_.Add(other.questRewardHistory_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_savedDefinitionFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _savedDefinitionFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -5437,16 +6782,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 8: { - Version = input.ReadUInt32(); + result.hasVersion = input.ReadUInt32(ref result.version_); break; } case 18: { global::D3.Hero.Digest.Builder subBuilder = global::D3.Hero.Digest.CreateBuilder(); - if (HasDigest) { + if (result.hasDigest) { subBuilder.MergeFrom(Digest); } input.ReadMessage(subBuilder, extensionRegistry); @@ -5455,7 +6800,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 26: { global::D3.AttributeSerializer.SavedAttributes.Builder subBuilder = global::D3.AttributeSerializer.SavedAttributes.CreateBuilder(); - if (HasSavedAttributes) { + if (result.hasSavedAttributes) { subBuilder.MergeFrom(SavedAttributes); } input.ReadMessage(subBuilder, extensionRegistry); @@ -5464,7 +6809,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 34: { global::D3.Hero.SavedData.Builder subBuilder = global::D3.Hero.SavedData.CreateBuilder(); - if (HasSavedData) { + if (result.hasSavedData) { subBuilder.MergeFrom(SavedData); } input.ReadMessage(subBuilder, extensionRegistry); @@ -5472,14 +6817,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 42: { - global::D3.Hero.SavedQuest.Builder subBuilder = global::D3.Hero.SavedQuest.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddSavedQuest(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.savedQuest_, global::D3.Hero.SavedQuest.DefaultInstance, extensionRegistry); break; } case 50: { global::D3.Items.ItemList.Builder subBuilder = global::D3.Items.ItemList.CreateBuilder(); - if (HasItems) { + if (result.hasItems) { subBuilder.MergeFrom(Items); } input.ReadMessage(subBuilder, extensionRegistry); @@ -5487,36 +6830,41 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 58: { - global::D3.Hero.QuestRewardHistoryEntry.Builder subBuilder = global::D3.Hero.QuestRewardHistoryEntry.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddQuestRewardHistory(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.questRewardHistory_, global::D3.Hero.QuestRewardHistoryEntry.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasVersion { - get { return result.HasVersion; } + get { return result.hasVersion; } } public uint Version { get { return result.Version; } set { SetVersion(value); } } public Builder SetVersion(uint value) { + PrepareBuilder(); result.hasVersion = true; result.version_ = value; return this; } public Builder ClearVersion() { + PrepareBuilder(); result.hasVersion = false; result.version_ = 0; return this; } public bool HasDigest { - get { return result.HasDigest; } + get { return result.hasDigest; } } public global::D3.Hero.Digest Digest { get { return result.Digest; } @@ -5524,19 +6872,22 @@ public bool HasDigest { } public Builder SetDigest(global::D3.Hero.Digest value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasDigest = true; result.digest_ = value; return this; } public Builder SetDigest(global::D3.Hero.Digest.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasDigest = true; result.digest_ = builderForValue.Build(); return this; } public Builder MergeDigest(global::D3.Hero.Digest value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasDigest && + PrepareBuilder(); + if (result.hasDigest && result.digest_ != global::D3.Hero.Digest.DefaultInstance) { result.digest_ = global::D3.Hero.Digest.CreateBuilder(result.digest_).MergeFrom(value).BuildPartial(); } else { @@ -5546,13 +6897,14 @@ public Builder MergeDigest(global::D3.Hero.Digest value) { return this; } public Builder ClearDigest() { + PrepareBuilder(); result.hasDigest = false; - result.digest_ = global::D3.Hero.Digest.DefaultInstance; + result.digest_ = null; return this; } public bool HasSavedAttributes { - get { return result.HasSavedAttributes; } + get { return result.hasSavedAttributes; } } public global::D3.AttributeSerializer.SavedAttributes SavedAttributes { get { return result.SavedAttributes; } @@ -5560,19 +6912,22 @@ public bool HasSavedAttributes { } public Builder SetSavedAttributes(global::D3.AttributeSerializer.SavedAttributes value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasSavedAttributes = true; result.savedAttributes_ = value; return this; } public Builder SetSavedAttributes(global::D3.AttributeSerializer.SavedAttributes.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasSavedAttributes = true; result.savedAttributes_ = builderForValue.Build(); return this; } public Builder MergeSavedAttributes(global::D3.AttributeSerializer.SavedAttributes value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasSavedAttributes && + PrepareBuilder(); + if (result.hasSavedAttributes && result.savedAttributes_ != global::D3.AttributeSerializer.SavedAttributes.DefaultInstance) { result.savedAttributes_ = global::D3.AttributeSerializer.SavedAttributes.CreateBuilder(result.savedAttributes_).MergeFrom(value).BuildPartial(); } else { @@ -5582,13 +6937,14 @@ public Builder MergeSavedAttributes(global::D3.AttributeSerializer.SavedAttribut return this; } public Builder ClearSavedAttributes() { + PrepareBuilder(); result.hasSavedAttributes = false; - result.savedAttributes_ = global::D3.AttributeSerializer.SavedAttributes.DefaultInstance; + result.savedAttributes_ = null; return this; } public bool HasSavedData { - get { return result.HasSavedData; } + get { return result.hasSavedData; } } public global::D3.Hero.SavedData SavedData { get { return result.SavedData; } @@ -5596,19 +6952,22 @@ public bool HasSavedData { } public Builder SetSavedData(global::D3.Hero.SavedData value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasSavedData = true; result.savedData_ = value; return this; } public Builder SetSavedData(global::D3.Hero.SavedData.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasSavedData = true; result.savedData_ = builderForValue.Build(); return this; } public Builder MergeSavedData(global::D3.Hero.SavedData value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasSavedData && + PrepareBuilder(); + if (result.hasSavedData && result.savedData_ != global::D3.Hero.SavedData.DefaultInstance) { result.savedData_ = global::D3.Hero.SavedData.CreateBuilder(result.savedData_).MergeFrom(value).BuildPartial(); } else { @@ -5618,13 +6977,14 @@ public Builder MergeSavedData(global::D3.Hero.SavedData value) { return this; } public Builder ClearSavedData() { + PrepareBuilder(); result.hasSavedData = false; - result.savedData_ = global::D3.Hero.SavedData.DefaultInstance; + result.savedData_ = null; return this; } public pbc::IPopsicleList SavedQuestList { - get { return result.savedQuest_; } + get { return PrepareBuilder().savedQuest_; } } public int SavedQuestCount { get { return result.SavedQuestCount; } @@ -5634,35 +6994,41 @@ public int SavedQuestCount { } public Builder SetSavedQuest(int index, global::D3.Hero.SavedQuest value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.savedQuest_[index] = value; return this; } public Builder SetSavedQuest(int index, global::D3.Hero.SavedQuest.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.savedQuest_[index] = builderForValue.Build(); return this; } public Builder AddSavedQuest(global::D3.Hero.SavedQuest value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.savedQuest_.Add(value); return this; } public Builder AddSavedQuest(global::D3.Hero.SavedQuest.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.savedQuest_.Add(builderForValue.Build()); return this; } public Builder AddRangeSavedQuest(scg::IEnumerable values) { - base.AddRange(values, result.savedQuest_); + PrepareBuilder(); + result.savedQuest_.Add(values); return this; } public Builder ClearSavedQuest() { + PrepareBuilder(); result.savedQuest_.Clear(); return this; } public bool HasItems { - get { return result.HasItems; } + get { return result.hasItems; } } public global::D3.Items.ItemList Items { get { return result.Items; } @@ -5670,118 +7036,1024 @@ public bool HasItems { } public Builder SetItems(global::D3.Items.ItemList value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasItems = true; result.items_ = value; return this; } public Builder SetItems(global::D3.Items.ItemList.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasItems = true; result.items_ = builderForValue.Build(); return this; } public Builder MergeItems(global::D3.Items.ItemList value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasItems && + PrepareBuilder(); + if (result.hasItems && result.items_ != global::D3.Items.ItemList.DefaultInstance) { result.items_ = global::D3.Items.ItemList.CreateBuilder(result.items_).MergeFrom(value).BuildPartial(); } else { result.items_ = value; } - result.hasItems = true; - return this; - } - public Builder ClearItems() { - result.hasItems = false; - result.items_ = global::D3.Items.ItemList.DefaultInstance; + result.hasItems = true; + return this; + } + public Builder ClearItems() { + PrepareBuilder(); + result.hasItems = false; + result.items_ = null; + return this; + } + + public pbc::IPopsicleList QuestRewardHistoryList { + get { return PrepareBuilder().questRewardHistory_; } + } + public int QuestRewardHistoryCount { + get { return result.QuestRewardHistoryCount; } + } + public global::D3.Hero.QuestRewardHistoryEntry GetQuestRewardHistory(int index) { + return result.GetQuestRewardHistory(index); + } + public Builder SetQuestRewardHistory(int index, global::D3.Hero.QuestRewardHistoryEntry value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.questRewardHistory_[index] = value; + return this; + } + public Builder SetQuestRewardHistory(int index, global::D3.Hero.QuestRewardHistoryEntry.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.questRewardHistory_[index] = builderForValue.Build(); + return this; + } + public Builder AddQuestRewardHistory(global::D3.Hero.QuestRewardHistoryEntry value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.questRewardHistory_.Add(value); + return this; + } + public Builder AddQuestRewardHistory(global::D3.Hero.QuestRewardHistoryEntry.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.questRewardHistory_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeQuestRewardHistory(scg::IEnumerable values) { + PrepareBuilder(); + result.questRewardHistory_.Add(values); + return this; + } + public Builder ClearQuestRewardHistory() { + PrepareBuilder(); + result.questRewardHistory_.Clear(); + return this; + } + } + static SavedDefinition() { + object.ReferenceEquals(global::D3.Hero.Hero.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class NameText : pb::GeneratedMessage { + private NameText() { } + private static readonly NameText defaultInstance = new NameText().MakeReadOnly(); + private static readonly string[] _nameTextFieldNames = new string[] { "name" }; + private static readonly uint[] _nameTextFieldTags = new uint[] { 10 }; + public static NameText DefaultInstance { + get { return defaultInstance; } + } + + public override NameText DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override NameText ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.Hero.Hero.internal__static_D3_Hero_NameText__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.Hero.Hero.internal__static_D3_Hero_NameText__FieldAccessorTable; } + } + + public const int NameFieldNumber = 1; + private bool hasName; + private string name_ = ""; + public bool HasName { + get { return hasName; } + } + public string Name { + get { return name_; } + } + + public override bool IsInitialized { + get { + if (!hasName) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _nameTextFieldNames; + if (hasName) { + output.WriteString(1, field_names[0], Name); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasName) { + size += pb::CodedOutputStream.ComputeStringSize(1, Name); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static NameText ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static NameText ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static NameText ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static NameText ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static NameText ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static NameText ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static NameText ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static NameText ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static NameText ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static NameText ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private NameText MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(NameText prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(NameText cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private NameText result; + + private NameText PrepareBuilder() { + if (resultIsReadOnly) { + NameText original = result; + result = new NameText(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override NameText MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.Hero.NameText.Descriptor; } + } + + public override NameText DefaultInstanceForType { + get { return global::D3.Hero.NameText.DefaultInstance; } + } + + public override NameText BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is NameText) { + return MergeFrom((NameText) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(NameText other) { + if (other == global::D3.Hero.NameText.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasName) { + Name = other.Name; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_nameTextFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _nameTextFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasName = input.ReadString(ref result.name_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasName { + get { return result.hasName; } + } + public string Name { + get { return result.Name; } + set { SetName(value); } + } + public Builder SetName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasName = true; + result.name_ = value; + return this; + } + public Builder ClearName() { + PrepareBuilder(); + result.hasName = false; + result.name_ = ""; + return this; + } + } + static NameText() { + object.ReferenceEquals(global::D3.Hero.Hero.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class HeroList : pb::GeneratedMessage { + private HeroList() { } + private static readonly HeroList defaultInstance = new HeroList().MakeReadOnly(); + private static readonly string[] _heroListFieldNames = new string[] { "hero_ids" }; + private static readonly uint[] _heroListFieldTags = new uint[] { 10 }; + public static HeroList DefaultInstance { + get { return defaultInstance; } + } + + public override HeroList DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override HeroList ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.Hero.Hero.internal__static_D3_Hero_HeroList__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.Hero.Hero.internal__static_D3_Hero_HeroList__FieldAccessorTable; } + } + + public const int HeroIdsFieldNumber = 1; + private pbc::PopsicleList heroIds_ = new pbc::PopsicleList(); + public scg::IList HeroIdsList { + get { return heroIds_; } + } + public int HeroIdsCount { + get { return heroIds_.Count; } + } + public global::D3.OnlineService.EntityId GetHeroIds(int index) { + return heroIds_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::D3.OnlineService.EntityId element in HeroIdsList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _heroListFieldNames; + if (heroIds_.Count > 0) { + output.WriteMessageArray(1, field_names[0], heroIds_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::D3.OnlineService.EntityId element in HeroIdsList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static HeroList ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static HeroList ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static HeroList ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static HeroList ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static HeroList ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static HeroList ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static HeroList ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static HeroList ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static HeroList ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static HeroList ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private HeroList MakeReadOnly() { + heroIds_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(HeroList prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(HeroList cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private HeroList result; + + private HeroList PrepareBuilder() { + if (resultIsReadOnly) { + HeroList original = result; + result = new HeroList(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override HeroList MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.Hero.HeroList.Descriptor; } + } + + public override HeroList DefaultInstanceForType { + get { return global::D3.Hero.HeroList.DefaultInstance; } + } + + public override HeroList BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is HeroList) { + return MergeFrom((HeroList) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(HeroList other) { + if (other == global::D3.Hero.HeroList.DefaultInstance) return this; + PrepareBuilder(); + if (other.heroIds_.Count != 0) { + result.heroIds_.Add(other.heroIds_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_heroListFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _heroListFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.heroIds_, global::D3.OnlineService.EntityId.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList HeroIdsList { + get { return PrepareBuilder().heroIds_; } + } + public int HeroIdsCount { + get { return result.HeroIdsCount; } + } + public global::D3.OnlineService.EntityId GetHeroIds(int index) { + return result.GetHeroIds(index); + } + public Builder SetHeroIds(int index, global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.heroIds_[index] = value; + return this; + } + public Builder SetHeroIds(int index, global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.heroIds_[index] = builderForValue.Build(); + return this; + } + public Builder AddHeroIds(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.heroIds_.Add(value); + return this; + } + public Builder AddHeroIds(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.heroIds_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeHeroIds(scg::IEnumerable values) { + PrepareBuilder(); + result.heroIds_.Add(values); + return this; + } + public Builder ClearHeroIds() { + PrepareBuilder(); + result.heroIds_.Clear(); + return this; + } + } + static HeroList() { + object.ReferenceEquals(global::D3.Hero.Hero.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class DigestList : pb::GeneratedMessage { + private DigestList() { } + private static readonly DigestList defaultInstance = new DigestList().MakeReadOnly(); + private static readonly string[] _digestListFieldNames = new string[] { "digests" }; + private static readonly uint[] _digestListFieldTags = new uint[] { 10 }; + public static DigestList DefaultInstance { + get { return defaultInstance; } + } + + public override DigestList DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override DigestList ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.Hero.Hero.internal__static_D3_Hero_DigestList__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.Hero.Hero.internal__static_D3_Hero_DigestList__FieldAccessorTable; } + } + + public const int DigestsFieldNumber = 1; + private pbc::PopsicleList digests_ = new pbc::PopsicleList(); + public scg::IList DigestsList { + get { return digests_; } + } + public int DigestsCount { + get { return digests_.Count; } + } + public global::D3.Hero.Digest GetDigests(int index) { + return digests_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::D3.Hero.Digest element in DigestsList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _digestListFieldNames; + if (digests_.Count > 0) { + output.WriteMessageArray(1, field_names[0], digests_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::D3.Hero.Digest element in DigestsList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static DigestList ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DigestList ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DigestList ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DigestList ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DigestList ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DigestList ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static DigestList ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static DigestList ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static DigestList ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DigestList ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private DigestList MakeReadOnly() { + digests_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(DigestList prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(DigestList cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private DigestList result; + + private DigestList PrepareBuilder() { + if (resultIsReadOnly) { + DigestList original = result; + result = new DigestList(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override DigestList MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.Hero.DigestList.Descriptor; } + } + + public override DigestList DefaultInstanceForType { + get { return global::D3.Hero.DigestList.DefaultInstance; } + } + + public override DigestList BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is DigestList) { + return MergeFrom((DigestList) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(DigestList other) { + if (other == global::D3.Hero.DigestList.DefaultInstance) return this; + PrepareBuilder(); + if (other.digests_.Count != 0) { + result.digests_.Add(other.digests_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_digestListFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _digestListFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.digests_, global::D3.Hero.Digest.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } return this; } - public pbc::IPopsicleList QuestRewardHistoryList { - get { return result.questRewardHistory_; } + + public pbc::IPopsicleList DigestsList { + get { return PrepareBuilder().digests_; } } - public int QuestRewardHistoryCount { - get { return result.QuestRewardHistoryCount; } + public int DigestsCount { + get { return result.DigestsCount; } } - public global::D3.Hero.QuestRewardHistoryEntry GetQuestRewardHistory(int index) { - return result.GetQuestRewardHistory(index); + public global::D3.Hero.Digest GetDigests(int index) { + return result.GetDigests(index); } - public Builder SetQuestRewardHistory(int index, global::D3.Hero.QuestRewardHistoryEntry value) { + public Builder SetDigests(int index, global::D3.Hero.Digest value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - result.questRewardHistory_[index] = value; + PrepareBuilder(); + result.digests_[index] = value; return this; } - public Builder SetQuestRewardHistory(int index, global::D3.Hero.QuestRewardHistoryEntry.Builder builderForValue) { + public Builder SetDigests(int index, global::D3.Hero.Digest.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.questRewardHistory_[index] = builderForValue.Build(); + PrepareBuilder(); + result.digests_[index] = builderForValue.Build(); return this; } - public Builder AddQuestRewardHistory(global::D3.Hero.QuestRewardHistoryEntry value) { + public Builder AddDigests(global::D3.Hero.Digest value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - result.questRewardHistory_.Add(value); + PrepareBuilder(); + result.digests_.Add(value); return this; } - public Builder AddQuestRewardHistory(global::D3.Hero.QuestRewardHistoryEntry.Builder builderForValue) { + public Builder AddDigests(global::D3.Hero.Digest.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.questRewardHistory_.Add(builderForValue.Build()); + PrepareBuilder(); + result.digests_.Add(builderForValue.Build()); return this; } - public Builder AddRangeQuestRewardHistory(scg::IEnumerable values) { - base.AddRange(values, result.questRewardHistory_); + public Builder AddRangeDigests(scg::IEnumerable values) { + PrepareBuilder(); + result.digests_.Add(values); return this; } - public Builder ClearQuestRewardHistory() { - result.questRewardHistory_.Clear(); + public Builder ClearDigests() { + PrepareBuilder(); + result.digests_.Clear(); return this; } } - static SavedDefinition() { + static DigestList() { object.ReferenceEquals(global::D3.Hero.Hero.Descriptor, null); } } - public sealed partial class NameSequence : pb::GeneratedMessage { - private static readonly NameSequence defaultInstance = new Builder().BuildPartial(); - public static NameSequence DefaultInstance { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class QuestHistoryList : pb::GeneratedMessage { + private QuestHistoryList() { } + private static readonly QuestHistoryList defaultInstance = new QuestHistoryList().MakeReadOnly(); + private static readonly string[] _questHistoryListFieldNames = new string[] { "history" }; + private static readonly uint[] _questHistoryListFieldTags = new uint[] { 10 }; + public static QuestHistoryList DefaultInstance { get { return defaultInstance; } } - public override NameSequence DefaultInstanceForType { - get { return defaultInstance; } + public override QuestHistoryList DefaultInstanceForType { + get { return DefaultInstance; } } - protected override NameSequence ThisMessage { + protected override QuestHistoryList ThisMessage { get { return this; } } public static pbd::MessageDescriptor Descriptor { - get { return global::D3.Hero.Hero.internal__static_D3_Hero_NameSequence__Descriptor; } + get { return global::D3.Hero.Hero.internal__static_D3_Hero_QuestHistoryList__Descriptor; } } - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::D3.Hero.Hero.internal__static_D3_Hero_NameSequence__FieldAccessorTable; } + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.Hero.Hero.internal__static_D3_Hero_QuestHistoryList__FieldAccessorTable; } } - public const int SequenceFieldNumber = 1; - private bool hasSequence; - private long sequence_ = 0L; - public bool HasSequence { - get { return hasSequence; } + public const int HistoryFieldNumber = 1; + private pbc::PopsicleList history_ = new pbc::PopsicleList(); + public scg::IList HistoryList { + get { return history_; } } - public long Sequence { - get { return sequence_; } + public int HistoryCount { + get { return history_.Count; } + } + public global::D3.Hero.QuestHistoryEntry GetHistory(int index) { + return history_[index]; } public override bool IsInitialized { get { + foreach (global::D3.Hero.QuestHistoryEntry element in HistoryList) { + if (!element.IsInitialized) return false; + } return true; } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasSequence) { - output.WriteInt64(1, Sequence); + string[] field_names = _questHistoryListFieldNames; + if (history_.Count > 0) { + output.WriteMessageArray(1, field_names[0], history_); } UnknownFields.WriteTo(output); } @@ -5793,8 +8065,8 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasSequence) { - size += pb::CodedOutputStream.ComputeInt64Size(1, Sequence); + foreach (global::D3.Hero.QuestHistoryEntry element in HistoryList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -5802,113 +8074,159 @@ public override int SerializedSize { } } - public static NameSequence ParseFrom(pb::ByteString data) { + public static QuestHistoryList ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static NameSequence ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static QuestHistoryList ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static NameSequence ParseFrom(byte[] data) { + public static QuestHistoryList ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static NameSequence ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static QuestHistoryList ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static NameSequence ParseFrom(global::System.IO.Stream input) { + public static QuestHistoryList ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static NameSequence ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static QuestHistoryList ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } - public static NameSequence ParseDelimitedFrom(global::System.IO.Stream input) { + public static QuestHistoryList ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static NameSequence ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static QuestHistoryList ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static NameSequence ParseFrom(pb::CodedInputStream input) { + public static QuestHistoryList ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static NameSequence ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static QuestHistoryList ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private QuestHistoryList MakeReadOnly() { + history_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(NameSequence prototype) { - return (Builder) new Builder().MergeFrom(prototype); + public static Builder CreateBuilder(QuestHistoryList prototype) { + return new Builder(prototype); } - public sealed partial class Builder : pb::GeneratedBuilder { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(QuestHistoryList cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private QuestHistoryList result; + + private QuestHistoryList PrepareBuilder() { + if (resultIsReadOnly) { + QuestHistoryList original = result; + result = new QuestHistoryList(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - NameSequence result = new NameSequence(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } - protected override NameSequence MessageBeingBuilt { - get { return result; } + protected override QuestHistoryList MessageBeingBuilt { + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new NameSequence(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { - get { return global::D3.Hero.NameSequence.Descriptor; } + get { return global::D3.Hero.QuestHistoryList.Descriptor; } } - public override NameSequence DefaultInstanceForType { - get { return global::D3.Hero.NameSequence.DefaultInstance; } + public override QuestHistoryList DefaultInstanceForType { + get { return global::D3.Hero.QuestHistoryList.DefaultInstance; } } - public override NameSequence BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override QuestHistoryList BuildPartial() { + if (resultIsReadOnly) { + return result; } - NameSequence returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is NameSequence) { - return MergeFrom((NameSequence) other); + if (other is QuestHistoryList) { + return MergeFrom((QuestHistoryList) other); } else { base.MergeFrom(other); return this; } } - public override Builder MergeFrom(NameSequence other) { - if (other == global::D3.Hero.NameSequence.DefaultInstance) return this; - if (other.HasSequence) { - Sequence = other.Sequence; + public override Builder MergeFrom(QuestHistoryList other) { + if (other == global::D3.Hero.QuestHistoryList.DefaultInstance) return this; + PrepareBuilder(); + if (other.history_.Count != 0) { + result.history_.Add(other.history_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_questHistoryListFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _questHistoryListFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -5920,84 +8238,126 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } - case 8: { - Sequence = input.ReadInt64(); + case 10: { + input.ReadMessageArray(tag, field_name, result.history_, global::D3.Hero.QuestHistoryEntry.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } - public bool HasSequence { - get { return result.HasSequence; } + public pbc::IPopsicleList HistoryList { + get { return PrepareBuilder().history_; } + } + public int HistoryCount { + get { return result.HistoryCount; } + } + public global::D3.Hero.QuestHistoryEntry GetHistory(int index) { + return result.GetHistory(index); + } + public Builder SetHistory(int index, global::D3.Hero.QuestHistoryEntry value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.history_[index] = value; + return this; + } + public Builder SetHistory(int index, global::D3.Hero.QuestHistoryEntry.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.history_[index] = builderForValue.Build(); + return this; + } + public Builder AddHistory(global::D3.Hero.QuestHistoryEntry value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.history_.Add(value); + return this; } - public long Sequence { - get { return result.Sequence; } - set { SetSequence(value); } + public Builder AddHistory(global::D3.Hero.QuestHistoryEntry.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.history_.Add(builderForValue.Build()); + return this; } - public Builder SetSequence(long value) { - result.hasSequence = true; - result.sequence_ = value; + public Builder AddRangeHistory(scg::IEnumerable values) { + PrepareBuilder(); + result.history_.Add(values); return this; } - public Builder ClearSequence() { - result.hasSequence = false; - result.sequence_ = 0L; + public Builder ClearHistory() { + PrepareBuilder(); + result.history_.Clear(); return this; } } - static NameSequence() { + static QuestHistoryList() { object.ReferenceEquals(global::D3.Hero.Hero.Descriptor, null); } } - public sealed partial class NameText : pb::GeneratedMessage { - private static readonly NameText defaultInstance = new Builder().BuildPartial(); - public static NameText DefaultInstance { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class SavedQuestList : pb::GeneratedMessage { + private SavedQuestList() { } + private static readonly SavedQuestList defaultInstance = new SavedQuestList().MakeReadOnly(); + private static readonly string[] _savedQuestListFieldNames = new string[] { "saved_quests" }; + private static readonly uint[] _savedQuestListFieldTags = new uint[] { 10 }; + public static SavedQuestList DefaultInstance { get { return defaultInstance; } } - public override NameText DefaultInstanceForType { - get { return defaultInstance; } + public override SavedQuestList DefaultInstanceForType { + get { return DefaultInstance; } } - protected override NameText ThisMessage { + protected override SavedQuestList ThisMessage { get { return this; } } public static pbd::MessageDescriptor Descriptor { - get { return global::D3.Hero.Hero.internal__static_D3_Hero_NameText__Descriptor; } + get { return global::D3.Hero.Hero.internal__static_D3_Hero_SavedQuestList__Descriptor; } } - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::D3.Hero.Hero.internal__static_D3_Hero_NameText__FieldAccessorTable; } + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.Hero.Hero.internal__static_D3_Hero_SavedQuestList__FieldAccessorTable; } } - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } + public const int SavedQuestsFieldNumber = 1; + private pbc::PopsicleList savedQuests_ = new pbc::PopsicleList(); + public scg::IList SavedQuestsList { + get { return savedQuests_; } } - public string Name { - get { return name_; } + public int SavedQuestsCount { + get { return savedQuests_.Count; } + } + public global::D3.Hero.SavedQuest GetSavedQuests(int index) { + return savedQuests_[index]; } public override bool IsInitialized { get { - if (!hasName) return false; + foreach (global::D3.Hero.SavedQuest element in SavedQuestsList) { + if (!element.IsInitialized) return false; + } return true; } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasName) { - output.WriteString(1, Name); + string[] field_names = _savedQuestListFieldNames; + if (savedQuests_.Count > 0) { + output.WriteMessageArray(1, field_names[0], savedQuests_); } UnknownFields.WriteTo(output); } @@ -6009,8 +8369,8 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasName) { - size += pb::CodedOutputStream.ComputeStringSize(1, Name); + foreach (global::D3.Hero.SavedQuest element in SavedQuestsList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -6018,113 +8378,159 @@ public override int SerializedSize { } } - public static NameText ParseFrom(pb::ByteString data) { + public static SavedQuestList ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static NameText ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static SavedQuestList ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static NameText ParseFrom(byte[] data) { + public static SavedQuestList ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static NameText ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static SavedQuestList ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static NameText ParseFrom(global::System.IO.Stream input) { + public static SavedQuestList ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static NameText ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static SavedQuestList ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } - public static NameText ParseDelimitedFrom(global::System.IO.Stream input) { + public static SavedQuestList ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static NameText ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static SavedQuestList ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static NameText ParseFrom(pb::CodedInputStream input) { + public static SavedQuestList ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static NameText ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static SavedQuestList ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private SavedQuestList MakeReadOnly() { + savedQuests_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(NameText prototype) { - return (Builder) new Builder().MergeFrom(prototype); + public static Builder CreateBuilder(SavedQuestList prototype) { + return new Builder(prototype); } - public sealed partial class Builder : pb::GeneratedBuilder { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SavedQuestList cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - NameText result = new NameText(); + private bool resultIsReadOnly; + private SavedQuestList result; - protected override NameText MessageBeingBuilt { - get { return result; } + private SavedQuestList PrepareBuilder() { + if (resultIsReadOnly) { + SavedQuestList original = result; + result = new SavedQuestList(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SavedQuestList MessageBeingBuilt { + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new NameText(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { - get { return global::D3.Hero.NameText.Descriptor; } + get { return global::D3.Hero.SavedQuestList.Descriptor; } } - public override NameText DefaultInstanceForType { - get { return global::D3.Hero.NameText.DefaultInstance; } + public override SavedQuestList DefaultInstanceForType { + get { return global::D3.Hero.SavedQuestList.DefaultInstance; } } - public override NameText BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override SavedQuestList BuildPartial() { + if (resultIsReadOnly) { + return result; } - NameText returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is NameText) { - return MergeFrom((NameText) other); + if (other is SavedQuestList) { + return MergeFrom((SavedQuestList) other); } else { base.MergeFrom(other); return this; } } - public override Builder MergeFrom(NameText other) { - if (other == global::D3.Hero.NameText.DefaultInstance) return this; - if (other.HasName) { - Name = other.Name; + public override Builder MergeFrom(SavedQuestList other) { + if (other == global::D3.Hero.SavedQuestList.DefaultInstance) return this; + PrepareBuilder(); + if (other.savedQuests_.Count != 0) { + result.savedQuests_.Add(other.savedQuests_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_savedQuestListFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _savedQuestListFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -6136,130 +8542,126 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { - Name = input.ReadString(); + input.ReadMessageArray(tag, field_name, result.savedQuests_, global::D3.Hero.SavedQuest.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } - public bool HasName { - get { return result.HasName; } + public pbc::IPopsicleList SavedQuestsList { + get { return PrepareBuilder().savedQuests_; } } - public string Name { - get { return result.Name; } - set { SetName(value); } + public int SavedQuestsCount { + get { return result.SavedQuestsCount; } } - public Builder SetName(string value) { + public global::D3.Hero.SavedQuest GetSavedQuests(int index) { + return result.GetSavedQuests(index); + } + public Builder SetSavedQuests(int index, global::D3.Hero.SavedQuest value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasName = true; - result.name_ = value; + PrepareBuilder(); + result.savedQuests_[index] = value; return this; } - public Builder ClearName() { - result.hasName = false; - result.name_ = ""; + public Builder SetSavedQuests(int index, global::D3.Hero.SavedQuest.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.savedQuests_[index] = builderForValue.Build(); + return this; + } + public Builder AddSavedQuests(global::D3.Hero.SavedQuest value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.savedQuests_.Add(value); + return this; + } + public Builder AddSavedQuests(global::D3.Hero.SavedQuest.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.savedQuests_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeSavedQuests(scg::IEnumerable values) { + PrepareBuilder(); + result.savedQuests_.Add(values); + return this; + } + public Builder ClearSavedQuests() { + PrepareBuilder(); + result.savedQuests_.Clear(); return this; } } - static NameText() { + static SavedQuestList() { object.ReferenceEquals(global::D3.Hero.Hero.Descriptor, null); } } - public sealed partial class Escrow : pb::GeneratedMessage { - private static readonly Escrow defaultInstance = new Builder().BuildPartial(); - public static Escrow DefaultInstance { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class QuestRewardHistoryList : pb::GeneratedMessage { + private QuestRewardHistoryList() { } + private static readonly QuestRewardHistoryList defaultInstance = new QuestRewardHistoryList().MakeReadOnly(); + private static readonly string[] _questRewardHistoryListFieldNames = new string[] { "reward_history" }; + private static readonly uint[] _questRewardHistoryListFieldTags = new uint[] { 10 }; + public static QuestRewardHistoryList DefaultInstance { get { return defaultInstance; } } - public override Escrow DefaultInstanceForType { - get { return defaultInstance; } + public override QuestRewardHistoryList DefaultInstanceForType { + get { return DefaultInstance; } } - protected override Escrow ThisMessage { + protected override QuestRewardHistoryList ThisMessage { get { return this; } } public static pbd::MessageDescriptor Descriptor { - get { return global::D3.Hero.Hero.internal__static_D3_Hero_Escrow__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::D3.Hero.Hero.internal__static_D3_Hero_Escrow__FieldAccessorTable; } - } - - public const int VersionFieldNumber = 1; - private bool hasVersion; - private uint version_ = 0; - public bool HasVersion { - get { return hasVersion; } - } - public uint Version { - get { return version_; } + get { return global::D3.Hero.Hero.internal__static_D3_Hero_QuestRewardHistoryList__Descriptor; } } - public const int GeneratorFieldNumber = 2; - private bool hasGenerator; - private global::D3.Items.Generator generator_ = global::D3.Items.Generator.DefaultInstance; - public bool HasGenerator { - get { return hasGenerator; } - } - public global::D3.Items.Generator Generator { - get { return generator_; } + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.Hero.Hero.internal__static_D3_Hero_QuestRewardHistoryList__FieldAccessorTable; } } - public const int HeroDataFieldNumber = 3; - private bool hasHeroData; - private global::D3.Hero.SavedData heroData_ = global::D3.Hero.SavedData.DefaultInstance; - public bool HasHeroData { - get { return hasHeroData; } - } - public global::D3.Hero.SavedData HeroData { - get { return heroData_; } + public const int RewardHistoryFieldNumber = 1; + private pbc::PopsicleList rewardHistory_ = new pbc::PopsicleList(); + public scg::IList RewardHistoryList { + get { return rewardHistory_; } } - - public const int StateFieldNumber = 4; - private bool hasState; - private uint state_ = 0; - public bool HasState { - get { return hasState; } + public int RewardHistoryCount { + get { return rewardHistory_.Count; } } - public uint State { - get { return state_; } + public global::D3.Hero.QuestRewardHistoryEntry GetRewardHistory(int index) { + return rewardHistory_[index]; } public override bool IsInitialized { get { - if (!hasVersion) return false; - if (HasGenerator) { - if (!Generator.IsInitialized) return false; - } - if (HasHeroData) { - if (!HeroData.IsInitialized) return false; + foreach (global::D3.Hero.QuestRewardHistoryEntry element in RewardHistoryList) { + if (!element.IsInitialized) return false; } return true; } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasVersion) { - output.WriteUInt32(1, Version); - } - if (HasGenerator) { - output.WriteMessage(2, Generator); - } - if (HasHeroData) { - output.WriteMessage(3, HeroData); - } - if (HasState) { - output.WriteUInt32(4, State); + string[] field_names = _questRewardHistoryListFieldNames; + if (rewardHistory_.Count > 0) { + output.WriteMessageArray(1, field_names[0], rewardHistory_); } UnknownFields.WriteTo(output); } @@ -6271,17 +8673,8 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasVersion) { - size += pb::CodedOutputStream.ComputeUInt32Size(1, Version); - } - if (HasGenerator) { - size += pb::CodedOutputStream.ComputeMessageSize(2, Generator); - } - if (HasHeroData) { - size += pb::CodedOutputStream.ComputeMessageSize(3, HeroData); - } - if (HasState) { - size += pb::CodedOutputStream.ComputeUInt32Size(4, State); + foreach (global::D3.Hero.QuestRewardHistoryEntry element in RewardHistoryList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -6289,122 +8682,159 @@ public override int SerializedSize { } } - public static Escrow ParseFrom(pb::ByteString data) { + public static QuestRewardHistoryList ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static Escrow ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static QuestRewardHistoryList ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static Escrow ParseFrom(byte[] data) { + public static QuestRewardHistoryList ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static Escrow ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static QuestRewardHistoryList ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static Escrow ParseFrom(global::System.IO.Stream input) { + public static QuestRewardHistoryList ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Escrow ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static QuestRewardHistoryList ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } - public static Escrow ParseDelimitedFrom(global::System.IO.Stream input) { + public static QuestRewardHistoryList ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static Escrow ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static QuestRewardHistoryList ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static Escrow ParseFrom(pb::CodedInputStream input) { + public static QuestRewardHistoryList ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Escrow ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static QuestRewardHistoryList ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private QuestRewardHistoryList MakeReadOnly() { + rewardHistory_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Escrow prototype) { - return (Builder) new Builder().MergeFrom(prototype); + public static Builder CreateBuilder(QuestRewardHistoryList prototype) { + return new Builder(prototype); } - public sealed partial class Builder : pb::GeneratedBuilder { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(QuestRewardHistoryList cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private QuestRewardHistoryList result; + + private QuestRewardHistoryList PrepareBuilder() { + if (resultIsReadOnly) { + QuestRewardHistoryList original = result; + result = new QuestRewardHistoryList(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - Escrow result = new Escrow(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } - protected override Escrow MessageBeingBuilt { - get { return result; } + protected override QuestRewardHistoryList MessageBeingBuilt { + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new Escrow(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { - get { return global::D3.Hero.Escrow.Descriptor; } + get { return global::D3.Hero.QuestRewardHistoryList.Descriptor; } } - public override Escrow DefaultInstanceForType { - get { return global::D3.Hero.Escrow.DefaultInstance; } + public override QuestRewardHistoryList DefaultInstanceForType { + get { return global::D3.Hero.QuestRewardHistoryList.DefaultInstance; } } - public override Escrow BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override QuestRewardHistoryList BuildPartial() { + if (resultIsReadOnly) { + return result; } - Escrow returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is Escrow) { - return MergeFrom((Escrow) other); + if (other is QuestRewardHistoryList) { + return MergeFrom((QuestRewardHistoryList) other); } else { base.MergeFrom(other); return this; } } - public override Builder MergeFrom(Escrow other) { - if (other == global::D3.Hero.Escrow.DefaultInstance) return this; - if (other.HasVersion) { - Version = other.Version; - } - if (other.HasGenerator) { - MergeGenerator(other.Generator); - } - if (other.HasHeroData) { - MergeHeroData(other.HeroData); - } - if (other.HasState) { - State = other.State; + public override Builder MergeFrom(QuestRewardHistoryList other) { + if (other == global::D3.Hero.QuestRewardHistoryList.DefaultInstance) return this; + PrepareBuilder(); + if (other.rewardHistory_.Count != 0) { + result.rewardHistory_.Add(other.rewardHistory_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_questRewardHistoryListFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _questRewardHistoryListFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -6416,149 +8846,68 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 8: { - Version = input.ReadUInt32(); - break; - } - case 18: { - global::D3.Items.Generator.Builder subBuilder = global::D3.Items.Generator.CreateBuilder(); - if (HasGenerator) { - subBuilder.MergeFrom(Generator); - } - input.ReadMessage(subBuilder, extensionRegistry); - Generator = subBuilder.BuildPartial(); - break; - } - case 26: { - global::D3.Hero.SavedData.Builder subBuilder = global::D3.Hero.SavedData.CreateBuilder(); - if (HasHeroData) { - subBuilder.MergeFrom(HeroData); - } - input.ReadMessage(subBuilder, extensionRegistry); - HeroData = subBuilder.BuildPartial(); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } - case 32: { - State = input.ReadUInt32(); + case 10: { + input.ReadMessageArray(tag, field_name, result.rewardHistory_, global::D3.Hero.QuestRewardHistoryEntry.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } - public bool HasVersion { - get { return result.HasVersion; } - } - public uint Version { - get { return result.Version; } - set { SetVersion(value); } + public pbc::IPopsicleList RewardHistoryList { + get { return PrepareBuilder().rewardHistory_; } } - public Builder SetVersion(uint value) { - result.hasVersion = true; - result.version_ = value; - return this; - } - public Builder ClearVersion() { - result.hasVersion = false; - result.version_ = 0; - return this; - } - - public bool HasGenerator { - get { return result.HasGenerator; } + public int RewardHistoryCount { + get { return result.RewardHistoryCount; } } - public global::D3.Items.Generator Generator { - get { return result.Generator; } - set { SetGenerator(value); } + public global::D3.Hero.QuestRewardHistoryEntry GetRewardHistory(int index) { + return result.GetRewardHistory(index); } - public Builder SetGenerator(global::D3.Items.Generator value) { + public Builder SetRewardHistory(int index, global::D3.Hero.QuestRewardHistoryEntry value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasGenerator = true; - result.generator_ = value; + PrepareBuilder(); + result.rewardHistory_[index] = value; return this; } - public Builder SetGenerator(global::D3.Items.Generator.Builder builderForValue) { + public Builder SetRewardHistory(int index, global::D3.Hero.QuestRewardHistoryEntry.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasGenerator = true; - result.generator_ = builderForValue.Build(); - return this; - } - public Builder MergeGenerator(global::D3.Items.Generator value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasGenerator && - result.generator_ != global::D3.Items.Generator.DefaultInstance) { - result.generator_ = global::D3.Items.Generator.CreateBuilder(result.generator_).MergeFrom(value).BuildPartial(); - } else { - result.generator_ = value; - } - result.hasGenerator = true; + PrepareBuilder(); + result.rewardHistory_[index] = builderForValue.Build(); return this; } - public Builder ClearGenerator() { - result.hasGenerator = false; - result.generator_ = global::D3.Items.Generator.DefaultInstance; - return this; - } - - public bool HasHeroData { - get { return result.HasHeroData; } - } - public global::D3.Hero.SavedData HeroData { - get { return result.HeroData; } - set { SetHeroData(value); } - } - public Builder SetHeroData(global::D3.Hero.SavedData value) { + public Builder AddRewardHistory(global::D3.Hero.QuestRewardHistoryEntry value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasHeroData = true; - result.heroData_ = value; + PrepareBuilder(); + result.rewardHistory_.Add(value); return this; } - public Builder SetHeroData(global::D3.Hero.SavedData.Builder builderForValue) { + public Builder AddRewardHistory(global::D3.Hero.QuestRewardHistoryEntry.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasHeroData = true; - result.heroData_ = builderForValue.Build(); - return this; - } - public Builder MergeHeroData(global::D3.Hero.SavedData value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasHeroData && - result.heroData_ != global::D3.Hero.SavedData.DefaultInstance) { - result.heroData_ = global::D3.Hero.SavedData.CreateBuilder(result.heroData_).MergeFrom(value).BuildPartial(); - } else { - result.heroData_ = value; - } - result.hasHeroData = true; - return this; - } - public Builder ClearHeroData() { - result.hasHeroData = false; - result.heroData_ = global::D3.Hero.SavedData.DefaultInstance; + PrepareBuilder(); + result.rewardHistory_.Add(builderForValue.Build()); return this; } - - public bool HasState { - get { return result.HasState; } - } - public uint State { - get { return result.State; } - set { SetState(value); } - } - public Builder SetState(uint value) { - result.hasState = true; - result.state_ = value; + public Builder AddRangeRewardHistory(scg::IEnumerable values) { + PrepareBuilder(); + result.rewardHistory_.Add(values); return this; } - public Builder ClearState() { - result.hasState = false; - result.state_ = 0; + public Builder ClearRewardHistory() { + PrepareBuilder(); + result.rewardHistory_.Clear(); return this; } } - static Escrow() { + static QuestRewardHistoryList() { object.ReferenceEquals(global::D3.Hero.Hero.Descriptor, null); } } @@ -6566,3 +8915,5 @@ static Escrow() { #endregion } + +#endregion Designer generated code diff --git a/source/D3Proto/D3/Hireling/Hireling.cs b/src/LibMooNet/D3/Hireling/Hireling.cs similarity index 67% rename from source/D3Proto/D3/Hireling/Hireling.cs rename to src/LibMooNet/D3/Hireling/Hireling.cs index e6e32e1e..c1f0ec18 100644 --- a/source/D3Proto/D3/Hireling/Hireling.cs +++ b/src/LibMooNet/D3/Hireling/Hireling.cs @@ -1,4 +1,6 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code using pb = global::Google.ProtocolBuffers; using pbc = global::Google.ProtocolBuffers.Collections; @@ -6,6 +8,9 @@ using scg = global::System.Collections.Generic; namespace D3.Hireling { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public static partial class Hireling { #region Extension registration @@ -26,13 +31,13 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { static Hireling() { byte[] descriptorData = global::System.Convert.FromBase64String( - "Cg5IaXJlbGluZy5wcm90bxILRDMuSGlyZWxpbmciiwEKBEluZm8SFgoOaGly" + - "ZWxpbmdfY2xhc3MYASACKBESEQoJZ2JpZF9uYW1lGAIgAigPEg0KBWxldmVs" + - "GAMgAigREiEKGWF0dHJpYnV0ZV9leHBlcmllbmNlX25leHQYBCACKA0SGAoQ" + - "cG93ZXJfa2V5X3BhcmFtcxgLIAMoERIMCgRkZWFkGAwgAigIInAKCVNhdmVk" + - "RGF0YRIkCgloaXJlbGluZ3MYASADKAsyES5EMy5IaXJlbGluZy5JbmZvEhcK" + - "D2FjdGl2ZV9oaXJlbGluZxgCIAIoDRIkChxhdmFpbGFibGVfaGlyZWxpbmdz" + - "X2JpdGZpZWxkGAMgAigN"); + "Cg5IaXJlbGluZy5wcm90bxILRDMuSGlyZWxpbmcikgEKBEluZm8SGQoOaGly" + + "ZWxpbmdfY2xhc3MYASACKBE6ATASFQoJZ2JpZF9uYW1lGAIgAigPOgItMRIN" + + "CgVsZXZlbBgDIAIoERIhChlhdHRyaWJ1dGVfZXhwZXJpZW5jZV9uZXh0GAQg" + + "AigNEhgKEHBvd2VyX2tleV9wYXJhbXMYBSADKBESDAoEZGVhZBgGIAIoCCJ2" + + "CglTYXZlZERhdGESJAoJaGlyZWxpbmdzGAEgAygLMhEuRDMuSGlyZWxpbmcu" + + "SW5mbxIaCg9hY3RpdmVfaGlyZWxpbmcYAiACKA06ATASJwocYXZhaWxhYmxl" + + "X2hpcmVsaW5nc19iaXRmaWVsZBgDIAIoDToBMA=="); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_D3_Hireling_Info__Descriptor = Descriptor.MessageTypes[0]; @@ -53,14 +58,20 @@ static Hireling() { } #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Info : pb::GeneratedMessage { - private static readonly Info defaultInstance = new Builder().BuildPartial(); + private Info() { } + private static readonly Info defaultInstance = new Info().MakeReadOnly(); + private static readonly string[] _infoFieldNames = new string[] { "attribute_experience_next", "dead", "gbid_name", "hireling_class", "level", "power_key_params" }; + private static readonly uint[] _infoFieldTags = new uint[] { 32, 48, 21, 8, 24, 40 }; public static Info DefaultInstance { get { return defaultInstance; } } public override Info DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override Info ThisMessage { @@ -77,7 +88,7 @@ protected override Info ThisMessage { public const int HirelingClassFieldNumber = 1; private bool hasHirelingClass; - private int hirelingClass_ = 0; + private int hirelingClass_; public bool HasHirelingClass { get { return hasHirelingClass; } } @@ -87,7 +98,7 @@ public int HirelingClass { public const int GbidNameFieldNumber = 2; private bool hasGbidName; - private int gbidName_ = 0; + private int gbidName_ = -1; public bool HasGbidName { get { return hasGbidName; } } @@ -97,7 +108,7 @@ public int GbidName { public const int LevelFieldNumber = 3; private bool hasLevel; - private int level_ = 0; + private int level_; public bool HasLevel { get { return hasLevel; } } @@ -107,7 +118,7 @@ public int Level { public const int AttributeExperienceNextFieldNumber = 4; private bool hasAttributeExperienceNext; - private uint attributeExperienceNext_ = 0; + private uint attributeExperienceNext_; public bool HasAttributeExperienceNext { get { return hasAttributeExperienceNext; } } @@ -115,7 +126,7 @@ public uint AttributeExperienceNext { get { return attributeExperienceNext_; } } - public const int PowerKeyParamsFieldNumber = 11; + public const int PowerKeyParamsFieldNumber = 5; private pbc::PopsicleList powerKeyParams_ = new pbc::PopsicleList(); public scg::IList PowerKeyParamsList { get { return pbc::Lists.AsReadOnly(powerKeyParams_); } @@ -127,9 +138,9 @@ public int GetPowerKeyParams(int index) { return powerKeyParams_[index]; } - public const int DeadFieldNumber = 12; + public const int DeadFieldNumber = 6; private bool hasDead; - private bool dead_ = false; + private bool dead_; public bool HasDead { get { return hasDead; } } @@ -148,27 +159,26 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasHirelingClass) { - output.WriteSInt32(1, HirelingClass); + string[] field_names = _infoFieldNames; + if (hasHirelingClass) { + output.WriteSInt32(1, field_names[3], HirelingClass); } - if (HasGbidName) { - output.WriteSFixed32(2, GbidName); + if (hasGbidName) { + output.WriteSFixed32(2, field_names[2], GbidName); } - if (HasLevel) { - output.WriteSInt32(3, Level); + if (hasLevel) { + output.WriteSInt32(3, field_names[4], Level); } - if (HasAttributeExperienceNext) { - output.WriteUInt32(4, AttributeExperienceNext); + if (hasAttributeExperienceNext) { + output.WriteUInt32(4, field_names[0], AttributeExperienceNext); } if (powerKeyParams_.Count > 0) { - foreach (int element in powerKeyParams_) { - output.WriteSInt32(11, element); - } + output.WriteSInt32Array(5, field_names[5], powerKeyParams_); } - if (HasDead) { - output.WriteBool(12, Dead); + if (hasDead) { + output.WriteBool(6, field_names[1], Dead); } UnknownFields.WriteTo(output); } @@ -180,16 +190,16 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasHirelingClass) { + if (hasHirelingClass) { size += pb::CodedOutputStream.ComputeSInt32Size(1, HirelingClass); } - if (HasGbidName) { + if (hasGbidName) { size += pb::CodedOutputStream.ComputeSFixed32Size(2, GbidName); } - if (HasLevel) { + if (hasLevel) { size += pb::CodedOutputStream.ComputeSInt32Size(3, Level); } - if (HasAttributeExperienceNext) { + if (hasAttributeExperienceNext) { size += pb::CodedOutputStream.ComputeUInt32Size(4, AttributeExperienceNext); } { @@ -200,8 +210,8 @@ public override int SerializedSize { size += dataSize; size += 1 * powerKeyParams_.Count; } - if (HasDead) { - size += pb::CodedOutputStream.ComputeBoolSize(12, Dead); + if (hasDead) { + size += pb::CodedOutputStream.ComputeBoolSize(6, Dead); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -233,38 +243,73 @@ public static Info ParseDelimitedFrom(global::System.IO.Stream input) { public static Info ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static Info ParseFrom(pb::CodedInputStream input) { + public static Info ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Info ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static Info ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private Info MakeReadOnly() { + powerKeyParams_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(Info prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Info cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - Info result = new Info(); + private bool resultIsReadOnly; + private Info result; + + private Info PrepareBuilder() { + if (resultIsReadOnly) { + Info original = result; + result = new Info(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override Info MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new Info(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -276,13 +321,11 @@ public override Info DefaultInstanceForType { } public override Info BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.powerKeyParams_.MakeReadOnly(); - Info returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -296,6 +339,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Info other) { if (other == global::D3.Hireling.Info.DefaultInstance) return this; + PrepareBuilder(); if (other.HasHirelingClass) { HirelingClass = other.HirelingClass; } @@ -309,7 +353,7 @@ public override Builder MergeFrom(Info other) { AttributeExperienceNext = other.AttributeExperienceNext; } if (other.powerKeyParams_.Count != 0) { - base.AddRange(other.powerKeyParams_, result.powerKeyParams_); + result.powerKeyParams_.Add(other.powerKeyParams_); } if (other.HasDead) { Dead = other.Dead; @@ -318,20 +362,31 @@ public override Builder MergeFrom(Info other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_infoFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _infoFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -343,112 +398,126 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 8: { - HirelingClass = input.ReadSInt32(); + result.hasHirelingClass = input.ReadSInt32(ref result.hirelingClass_); break; } case 21: { - GbidName = input.ReadSFixed32(); + result.hasGbidName = input.ReadSFixed32(ref result.gbidName_); break; } case 24: { - Level = input.ReadSInt32(); + result.hasLevel = input.ReadSInt32(ref result.level_); break; } case 32: { - AttributeExperienceNext = input.ReadUInt32(); + result.hasAttributeExperienceNext = input.ReadUInt32(ref result.attributeExperienceNext_); break; } - case 88: { - AddPowerKeyParams(input.ReadSInt32()); + case 42: + case 40: { + input.ReadSInt32Array(tag, field_name, result.powerKeyParams_); break; } - case 96: { - Dead = input.ReadBool(); + case 48: { + result.hasDead = input.ReadBool(ref result.dead_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasHirelingClass { - get { return result.HasHirelingClass; } + get { return result.hasHirelingClass; } } public int HirelingClass { get { return result.HirelingClass; } set { SetHirelingClass(value); } } public Builder SetHirelingClass(int value) { + PrepareBuilder(); result.hasHirelingClass = true; result.hirelingClass_ = value; return this; } public Builder ClearHirelingClass() { + PrepareBuilder(); result.hasHirelingClass = false; result.hirelingClass_ = 0; return this; } public bool HasGbidName { - get { return result.HasGbidName; } + get { return result.hasGbidName; } } public int GbidName { get { return result.GbidName; } set { SetGbidName(value); } } public Builder SetGbidName(int value) { + PrepareBuilder(); result.hasGbidName = true; result.gbidName_ = value; return this; } public Builder ClearGbidName() { + PrepareBuilder(); result.hasGbidName = false; - result.gbidName_ = 0; + result.gbidName_ = -1; return this; } public bool HasLevel { - get { return result.HasLevel; } + get { return result.hasLevel; } } public int Level { get { return result.Level; } set { SetLevel(value); } } public Builder SetLevel(int value) { + PrepareBuilder(); result.hasLevel = true; result.level_ = value; return this; } public Builder ClearLevel() { + PrepareBuilder(); result.hasLevel = false; result.level_ = 0; return this; } public bool HasAttributeExperienceNext { - get { return result.HasAttributeExperienceNext; } + get { return result.hasAttributeExperienceNext; } } public uint AttributeExperienceNext { get { return result.AttributeExperienceNext; } set { SetAttributeExperienceNext(value); } } public Builder SetAttributeExperienceNext(uint value) { + PrepareBuilder(); result.hasAttributeExperienceNext = true; result.attributeExperienceNext_ = value; return this; } public Builder ClearAttributeExperienceNext() { + PrepareBuilder(); result.hasAttributeExperienceNext = false; result.attributeExperienceNext_ = 0; return this; } public pbc::IPopsicleList PowerKeyParamsList { - get { return result.powerKeyParams_; } + get { return PrepareBuilder().powerKeyParams_; } } public int PowerKeyParamsCount { get { return result.PowerKeyParamsCount; } @@ -457,35 +526,41 @@ public int GetPowerKeyParams(int index) { return result.GetPowerKeyParams(index); } public Builder SetPowerKeyParams(int index, int value) { + PrepareBuilder(); result.powerKeyParams_[index] = value; return this; } public Builder AddPowerKeyParams(int value) { + PrepareBuilder(); result.powerKeyParams_.Add(value); return this; } public Builder AddRangePowerKeyParams(scg::IEnumerable values) { - base.AddRange(values, result.powerKeyParams_); + PrepareBuilder(); + result.powerKeyParams_.Add(values); return this; } public Builder ClearPowerKeyParams() { + PrepareBuilder(); result.powerKeyParams_.Clear(); return this; } public bool HasDead { - get { return result.HasDead; } + get { return result.hasDead; } } public bool Dead { get { return result.Dead; } set { SetDead(value); } } public Builder SetDead(bool value) { + PrepareBuilder(); result.hasDead = true; result.dead_ = value; return this; } public Builder ClearDead() { + PrepareBuilder(); result.hasDead = false; result.dead_ = false; return this; @@ -496,14 +571,20 @@ static Info() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class SavedData : pb::GeneratedMessage { - private static readonly SavedData defaultInstance = new Builder().BuildPartial(); + private SavedData() { } + private static readonly SavedData defaultInstance = new SavedData().MakeReadOnly(); + private static readonly string[] _savedDataFieldNames = new string[] { "active_hireling", "available_hirelings_bitfield", "hirelings" }; + private static readonly uint[] _savedDataFieldTags = new uint[] { 16, 24, 10 }; public static SavedData DefaultInstance { get { return defaultInstance; } } public override SavedData DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override SavedData ThisMessage { @@ -532,7 +613,7 @@ public int HirelingsCount { public const int ActiveHirelingFieldNumber = 2; private bool hasActiveHireling; - private uint activeHireling_ = 0; + private uint activeHireling_; public bool HasActiveHireling { get { return hasActiveHireling; } } @@ -542,7 +623,7 @@ public uint ActiveHireling { public const int AvailableHirelingsBitfieldFieldNumber = 3; private bool hasAvailableHirelingsBitfield; - private uint availableHirelingsBitfield_ = 0; + private uint availableHirelingsBitfield_; public bool HasAvailableHirelingsBitfield { get { return hasAvailableHirelingsBitfield; } } @@ -561,16 +642,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - foreach (global::D3.Hireling.Info element in HirelingsList) { - output.WriteMessage(1, element); + string[] field_names = _savedDataFieldNames; + if (hirelings_.Count > 0) { + output.WriteMessageArray(1, field_names[2], hirelings_); } - if (HasActiveHireling) { - output.WriteUInt32(2, ActiveHireling); + if (hasActiveHireling) { + output.WriteUInt32(2, field_names[0], ActiveHireling); } - if (HasAvailableHirelingsBitfield) { - output.WriteUInt32(3, AvailableHirelingsBitfield); + if (hasAvailableHirelingsBitfield) { + output.WriteUInt32(3, field_names[1], AvailableHirelingsBitfield); } UnknownFields.WriteTo(output); } @@ -585,10 +667,10 @@ public override int SerializedSize { foreach (global::D3.Hireling.Info element in HirelingsList) { size += pb::CodedOutputStream.ComputeMessageSize(1, element); } - if (HasActiveHireling) { + if (hasActiveHireling) { size += pb::CodedOutputStream.ComputeUInt32Size(2, ActiveHireling); } - if (HasAvailableHirelingsBitfield) { + if (hasAvailableHirelingsBitfield) { size += pb::CodedOutputStream.ComputeUInt32Size(3, AvailableHirelingsBitfield); } size += UnknownFields.SerializedSize; @@ -621,38 +703,73 @@ public static SavedData ParseDelimitedFrom(global::System.IO.Stream input) { public static SavedData ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static SavedData ParseFrom(pb::CodedInputStream input) { + public static SavedData ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SavedData ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static SavedData ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private SavedData MakeReadOnly() { + hirelings_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(SavedData prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SavedData cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - SavedData result = new SavedData(); + private bool resultIsReadOnly; + private SavedData result; + + private SavedData PrepareBuilder() { + if (resultIsReadOnly) { + SavedData original = result; + result = new SavedData(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override SavedData MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SavedData(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -664,13 +781,11 @@ public override SavedData DefaultInstanceForType { } public override SavedData BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.hirelings_.MakeReadOnly(); - SavedData returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -684,8 +799,9 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SavedData other) { if (other == global::D3.Hireling.SavedData.DefaultInstance) return this; + PrepareBuilder(); if (other.hirelings_.Count != 0) { - base.AddRange(other.hirelings_, result.hirelings_); + result.hirelings_.Add(other.hirelings_); } if (other.HasActiveHireling) { ActiveHireling = other.ActiveHireling; @@ -697,20 +813,31 @@ public override Builder MergeFrom(SavedData other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_savedDataFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _savedDataFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -722,30 +849,33 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { - global::D3.Hireling.Info.Builder subBuilder = global::D3.Hireling.Info.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddHirelings(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.hirelings_, global::D3.Hireling.Info.DefaultInstance, extensionRegistry); break; } case 16: { - ActiveHireling = input.ReadUInt32(); + result.hasActiveHireling = input.ReadUInt32(ref result.activeHireling_); break; } case 24: { - AvailableHirelingsBitfield = input.ReadUInt32(); + result.hasAvailableHirelingsBitfield = input.ReadUInt32(ref result.availableHirelingsBitfield_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public pbc::IPopsicleList HirelingsList { - get { return result.hirelings_; } + get { return PrepareBuilder().hirelings_; } } public int HirelingsCount { get { return result.HirelingsCount; } @@ -755,64 +885,74 @@ public int HirelingsCount { } public Builder SetHirelings(int index, global::D3.Hireling.Info value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hirelings_[index] = value; return this; } public Builder SetHirelings(int index, global::D3.Hireling.Info.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hirelings_[index] = builderForValue.Build(); return this; } public Builder AddHirelings(global::D3.Hireling.Info value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hirelings_.Add(value); return this; } public Builder AddHirelings(global::D3.Hireling.Info.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hirelings_.Add(builderForValue.Build()); return this; } public Builder AddRangeHirelings(scg::IEnumerable values) { - base.AddRange(values, result.hirelings_); + PrepareBuilder(); + result.hirelings_.Add(values); return this; } public Builder ClearHirelings() { + PrepareBuilder(); result.hirelings_.Clear(); return this; } public bool HasActiveHireling { - get { return result.HasActiveHireling; } + get { return result.hasActiveHireling; } } public uint ActiveHireling { get { return result.ActiveHireling; } set { SetActiveHireling(value); } } public Builder SetActiveHireling(uint value) { + PrepareBuilder(); result.hasActiveHireling = true; result.activeHireling_ = value; return this; } public Builder ClearActiveHireling() { + PrepareBuilder(); result.hasActiveHireling = false; result.activeHireling_ = 0; return this; } public bool HasAvailableHirelingsBitfield { - get { return result.HasAvailableHirelingsBitfield; } + get { return result.hasAvailableHirelingsBitfield; } } public uint AvailableHirelingsBitfield { get { return result.AvailableHirelingsBitfield; } set { SetAvailableHirelingsBitfield(value); } } public Builder SetAvailableHirelingsBitfield(uint value) { + PrepareBuilder(); result.hasAvailableHirelingsBitfield = true; result.availableHirelingsBitfield_ = value; return this; } public Builder ClearAvailableHirelingsBitfield() { + PrepareBuilder(); result.hasAvailableHirelingsBitfield = false; result.availableHirelingsBitfield_ = 0; return this; @@ -826,3 +966,5 @@ static SavedData() { #endregion } + +#endregion Designer generated code diff --git a/source/D3Proto/D3/ItemCrafting/ItemCrafting.cs b/src/LibMooNet/D3/ItemCrafting/ItemCrafting.cs similarity index 62% rename from source/D3Proto/D3/ItemCrafting/ItemCrafting.cs rename to src/LibMooNet/D3/ItemCrafting/ItemCrafting.cs index b585b16c..2480f61b 100644 --- a/source/D3Proto/D3/ItemCrafting/ItemCrafting.cs +++ b/src/LibMooNet/D3/ItemCrafting/ItemCrafting.cs @@ -1,4 +1,6 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code using pb = global::Google.ProtocolBuffers; using pbc = global::Google.ProtocolBuffers.Collections; @@ -6,6 +8,9 @@ using scg = global::System.Collections.Generic; namespace D3.ItemCrafting { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public static partial class ItemCrafting { #region Extension registration @@ -26,17 +31,17 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { static ItemCrafting() { byte[] descriptorData = global::System.Convert.FromBase64String( - "ChJJdGVtQ3JhZnRpbmcucHJvdG8SD0QzLkl0ZW1DcmFmdGluZyJfCgtDcmFm" + - "dGVyRGF0YRIPCgdyZWNpcGVzGAEgAygPEhoKEmF2YWlsYWJsZV9lbmNoYW50" + - "cxgCIAMoDxINCgVsZXZlbBgDIAIoBRIUCgxjb29sZG93bl9lbmQYBCACKBAi" + - "RgoQQ3JhZnRlclNhdmVkRGF0YRIyCgxjcmFmdGVyX2RhdGEYASADKAsyHC5E" + - "My5JdGVtQ3JhZnRpbmcuQ3JhZnRlckRhdGE="); + "ChJJdGVtQ3JhZnRpbmcucHJvdG8SD0QzLkl0ZW1DcmFmdGluZyJqCgtDcmFm" + + "dGVyRGF0YRIPCgdyZWNpcGVzGAEgAygPEiUKHWRlcHJlY2F0ZWRfYXZhaWxh" + + "YmxlX2VuY2hhbnRzGAIgAygPEg0KBWxldmVsGAMgAigFEhQKDGNvb2xkb3du" + + "X2VuZBgEIAIoECJGChBDcmFmdGVyU2F2ZWREYXRhEjIKDGNyYWZ0ZXJfZGF0" + + "YRgBIAMoCzIcLkQzLkl0ZW1DcmFmdGluZy5DcmFmdGVyRGF0YQ=="); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_D3_ItemCrafting_CrafterData__Descriptor = Descriptor.MessageTypes[0]; internal__static_D3_ItemCrafting_CrafterData__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_D3_ItemCrafting_CrafterData__Descriptor, - new string[] { "Recipes", "AvailableEnchants", "Level", "CooldownEnd", }); + new string[] { "Recipes", "DeprecatedAvailableEnchants", "Level", "CooldownEnd", }); internal__static_D3_ItemCrafting_CrafterSavedData__Descriptor = Descriptor.MessageTypes[1]; internal__static_D3_ItemCrafting_CrafterSavedData__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_D3_ItemCrafting_CrafterSavedData__Descriptor, @@ -51,14 +56,20 @@ static ItemCrafting() { } #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class CrafterData : pb::GeneratedMessage { - private static readonly CrafterData defaultInstance = new Builder().BuildPartial(); + private CrafterData() { } + private static readonly CrafterData defaultInstance = new CrafterData().MakeReadOnly(); + private static readonly string[] _crafterDataFieldNames = new string[] { "cooldown_end", "deprecated_available_enchants", "level", "recipes" }; + private static readonly uint[] _crafterDataFieldTags = new uint[] { 33, 21, 24, 13 }; public static CrafterData DefaultInstance { get { return defaultInstance; } } public override CrafterData DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override CrafterData ThisMessage { @@ -85,21 +96,21 @@ public int GetRecipes(int index) { return recipes_[index]; } - public const int AvailableEnchantsFieldNumber = 2; - private pbc::PopsicleList availableEnchants_ = new pbc::PopsicleList(); - public scg::IList AvailableEnchantsList { - get { return pbc::Lists.AsReadOnly(availableEnchants_); } + public const int DeprecatedAvailableEnchantsFieldNumber = 2; + private pbc::PopsicleList deprecatedAvailableEnchants_ = new pbc::PopsicleList(); + public scg::IList DeprecatedAvailableEnchantsList { + get { return pbc::Lists.AsReadOnly(deprecatedAvailableEnchants_); } } - public int AvailableEnchantsCount { - get { return availableEnchants_.Count; } + public int DeprecatedAvailableEnchantsCount { + get { return deprecatedAvailableEnchants_.Count; } } - public int GetAvailableEnchants(int index) { - return availableEnchants_[index]; + public int GetDeprecatedAvailableEnchants(int index) { + return deprecatedAvailableEnchants_[index]; } public const int LevelFieldNumber = 3; private bool hasLevel; - private int level_ = 0; + private int level_; public bool HasLevel { get { return hasLevel; } } @@ -109,7 +120,7 @@ public int Level { public const int CooldownEndFieldNumber = 4; private bool hasCooldownEnd; - private long cooldownEnd_ = 0; + private long cooldownEnd_; public bool HasCooldownEnd { get { return hasCooldownEnd; } } @@ -125,23 +136,20 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; + string[] field_names = _crafterDataFieldNames; if (recipes_.Count > 0) { - foreach (int element in recipes_) { - output.WriteSFixed32(1, element); - } + output.WriteSFixed32Array(1, field_names[3], recipes_); } - if (availableEnchants_.Count > 0) { - foreach (int element in availableEnchants_) { - output.WriteSFixed32(2, element); - } + if (deprecatedAvailableEnchants_.Count > 0) { + output.WriteSFixed32Array(2, field_names[1], deprecatedAvailableEnchants_); } - if (HasLevel) { - output.WriteInt32(3, Level); + if (hasLevel) { + output.WriteInt32(3, field_names[2], Level); } - if (HasCooldownEnd) { - output.WriteSFixed64(4, CooldownEnd); + if (hasCooldownEnd) { + output.WriteSFixed64(4, field_names[0], CooldownEnd); } UnknownFields.WriteTo(output); } @@ -161,14 +169,14 @@ public override int SerializedSize { } { int dataSize = 0; - dataSize = 4 * availableEnchants_.Count; + dataSize = 4 * deprecatedAvailableEnchants_.Count; size += dataSize; - size += 1 * availableEnchants_.Count; + size += 1 * deprecatedAvailableEnchants_.Count; } - if (HasLevel) { + if (hasLevel) { size += pb::CodedOutputStream.ComputeInt32Size(3, Level); } - if (HasCooldownEnd) { + if (hasCooldownEnd) { size += pb::CodedOutputStream.ComputeSFixed64Size(4, CooldownEnd); } size += UnknownFields.SerializedSize; @@ -201,38 +209,74 @@ public static CrafterData ParseDelimitedFrom(global::System.IO.Stream input) { public static CrafterData ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static CrafterData ParseFrom(pb::CodedInputStream input) { + public static CrafterData ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static CrafterData ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static CrafterData ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private CrafterData MakeReadOnly() { + recipes_.MakeReadOnly(); + deprecatedAvailableEnchants_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(CrafterData prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CrafterData cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CrafterData result; + + private CrafterData PrepareBuilder() { + if (resultIsReadOnly) { + CrafterData original = result; + result = new CrafterData(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - CrafterData result = new CrafterData(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override CrafterData MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new CrafterData(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -244,14 +288,11 @@ public override CrafterData DefaultInstanceForType { } public override CrafterData BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.recipes_.MakeReadOnly(); - result.availableEnchants_.MakeReadOnly(); - CrafterData returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -265,11 +306,12 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(CrafterData other) { if (other == global::D3.ItemCrafting.CrafterData.DefaultInstance) return this; + PrepareBuilder(); if (other.recipes_.Count != 0) { - base.AddRange(other.recipes_, result.recipes_); + result.recipes_.Add(other.recipes_); } - if (other.availableEnchants_.Count != 0) { - base.AddRange(other.availableEnchants_, result.availableEnchants_); + if (other.deprecatedAvailableEnchants_.Count != 0) { + result.deprecatedAvailableEnchants_.Add(other.deprecatedAvailableEnchants_); } if (other.HasLevel) { Level = other.Level; @@ -281,20 +323,31 @@ public override Builder MergeFrom(CrafterData other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_crafterDataFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _crafterDataFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -306,32 +359,39 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } + case 10: case 13: { - AddRecipes(input.ReadSFixed32()); + input.ReadSFixed32Array(tag, field_name, result.recipes_); break; } + case 18: case 21: { - AddAvailableEnchants(input.ReadSFixed32()); + input.ReadSFixed32Array(tag, field_name, result.deprecatedAvailableEnchants_); break; } case 24: { - Level = input.ReadInt32(); + result.hasLevel = input.ReadInt32(ref result.level_); break; } case 33: { - CooldownEnd = input.ReadSFixed64(); + result.hasCooldownEnd = input.ReadSFixed64(ref result.cooldownEnd_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public pbc::IPopsicleList RecipesList { - get { return result.recipes_; } + get { return PrepareBuilder().recipes_; } } public int RecipesCount { get { return result.RecipesCount; } @@ -340,79 +400,91 @@ public int GetRecipes(int index) { return result.GetRecipes(index); } public Builder SetRecipes(int index, int value) { + PrepareBuilder(); result.recipes_[index] = value; return this; } public Builder AddRecipes(int value) { + PrepareBuilder(); result.recipes_.Add(value); return this; } public Builder AddRangeRecipes(scg::IEnumerable values) { - base.AddRange(values, result.recipes_); + PrepareBuilder(); + result.recipes_.Add(values); return this; } public Builder ClearRecipes() { + PrepareBuilder(); result.recipes_.Clear(); return this; } - public pbc::IPopsicleList AvailableEnchantsList { - get { return result.availableEnchants_; } + public pbc::IPopsicleList DeprecatedAvailableEnchantsList { + get { return PrepareBuilder().deprecatedAvailableEnchants_; } } - public int AvailableEnchantsCount { - get { return result.AvailableEnchantsCount; } + public int DeprecatedAvailableEnchantsCount { + get { return result.DeprecatedAvailableEnchantsCount; } } - public int GetAvailableEnchants(int index) { - return result.GetAvailableEnchants(index); + public int GetDeprecatedAvailableEnchants(int index) { + return result.GetDeprecatedAvailableEnchants(index); } - public Builder SetAvailableEnchants(int index, int value) { - result.availableEnchants_[index] = value; + public Builder SetDeprecatedAvailableEnchants(int index, int value) { + PrepareBuilder(); + result.deprecatedAvailableEnchants_[index] = value; return this; } - public Builder AddAvailableEnchants(int value) { - result.availableEnchants_.Add(value); + public Builder AddDeprecatedAvailableEnchants(int value) { + PrepareBuilder(); + result.deprecatedAvailableEnchants_.Add(value); return this; } - public Builder AddRangeAvailableEnchants(scg::IEnumerable values) { - base.AddRange(values, result.availableEnchants_); + public Builder AddRangeDeprecatedAvailableEnchants(scg::IEnumerable values) { + PrepareBuilder(); + result.deprecatedAvailableEnchants_.Add(values); return this; } - public Builder ClearAvailableEnchants() { - result.availableEnchants_.Clear(); + public Builder ClearDeprecatedAvailableEnchants() { + PrepareBuilder(); + result.deprecatedAvailableEnchants_.Clear(); return this; } public bool HasLevel { - get { return result.HasLevel; } + get { return result.hasLevel; } } public int Level { get { return result.Level; } set { SetLevel(value); } } public Builder SetLevel(int value) { + PrepareBuilder(); result.hasLevel = true; result.level_ = value; return this; } public Builder ClearLevel() { + PrepareBuilder(); result.hasLevel = false; result.level_ = 0; return this; } public bool HasCooldownEnd { - get { return result.HasCooldownEnd; } + get { return result.hasCooldownEnd; } } public long CooldownEnd { get { return result.CooldownEnd; } set { SetCooldownEnd(value); } } public Builder SetCooldownEnd(long value) { + PrepareBuilder(); result.hasCooldownEnd = true; result.cooldownEnd_ = value; return this; } public Builder ClearCooldownEnd() { + PrepareBuilder(); result.hasCooldownEnd = false; result.cooldownEnd_ = 0; return this; @@ -423,14 +495,20 @@ static CrafterData() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class CrafterSavedData : pb::GeneratedMessage { - private static readonly CrafterSavedData defaultInstance = new Builder().BuildPartial(); + private CrafterSavedData() { } + private static readonly CrafterSavedData defaultInstance = new CrafterSavedData().MakeReadOnly(); + private static readonly string[] _crafterSavedDataFieldNames = new string[] { "crafter_data" }; + private static readonly uint[] _crafterSavedDataFieldTags = new uint[] { 10 }; public static CrafterSavedData DefaultInstance { get { return defaultInstance; } } public override CrafterSavedData DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override CrafterSavedData ThisMessage { @@ -466,10 +544,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - foreach (global::D3.ItemCrafting.CrafterData element in CrafterDataList) { - output.WriteMessage(1, element); + string[] field_names = _crafterSavedDataFieldNames; + if (crafterData_.Count > 0) { + output.WriteMessageArray(1, field_names[0], crafterData_); } UnknownFields.WriteTo(output); } @@ -514,38 +593,73 @@ public static CrafterSavedData ParseDelimitedFrom(global::System.IO.Stream input public static CrafterSavedData ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static CrafterSavedData ParseFrom(pb::CodedInputStream input) { + public static CrafterSavedData ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static CrafterSavedData ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static CrafterSavedData ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private CrafterSavedData MakeReadOnly() { + crafterData_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(CrafterSavedData prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CrafterSavedData cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - CrafterSavedData result = new CrafterSavedData(); + private bool resultIsReadOnly; + private CrafterSavedData result; + + private CrafterSavedData PrepareBuilder() { + if (resultIsReadOnly) { + CrafterSavedData original = result; + result = new CrafterSavedData(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override CrafterSavedData MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new CrafterSavedData(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -557,13 +671,11 @@ public override CrafterSavedData DefaultInstanceForType { } public override CrafterSavedData BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.crafterData_.MakeReadOnly(); - CrafterSavedData returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -577,27 +689,39 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(CrafterSavedData other) { if (other == global::D3.ItemCrafting.CrafterSavedData.DefaultInstance) return this; + PrepareBuilder(); if (other.crafterData_.Count != 0) { - base.AddRange(other.crafterData_, result.crafterData_); + result.crafterData_.Add(other.crafterData_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_crafterSavedDataFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _crafterSavedDataFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -609,22 +733,25 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { - global::D3.ItemCrafting.CrafterData.Builder subBuilder = global::D3.ItemCrafting.CrafterData.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddCrafterData(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.crafterData_, global::D3.ItemCrafting.CrafterData.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public pbc::IPopsicleList CrafterDataList { - get { return result.crafterData_; } + get { return PrepareBuilder().crafterData_; } } public int CrafterDataCount { get { return result.CrafterDataCount; } @@ -634,29 +761,35 @@ public int CrafterDataCount { } public Builder SetCrafterData(int index, global::D3.ItemCrafting.CrafterData value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.crafterData_[index] = value; return this; } public Builder SetCrafterData(int index, global::D3.ItemCrafting.CrafterData.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.crafterData_[index] = builderForValue.Build(); return this; } public Builder AddCrafterData(global::D3.ItemCrafting.CrafterData value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.crafterData_.Add(value); return this; } public Builder AddCrafterData(global::D3.ItemCrafting.CrafterData.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.crafterData_.Add(builderForValue.Build()); return this; } public Builder AddRangeCrafterData(scg::IEnumerable values) { - base.AddRange(values, result.crafterData_); + PrepareBuilder(); + result.crafterData_.Add(values); return this; } public Builder ClearCrafterData() { + PrepareBuilder(); result.crafterData_.Clear(); return this; } @@ -669,3 +802,5 @@ static CrafterSavedData() { #endregion } + +#endregion Designer generated code diff --git a/source/D3Proto/D3/Items/Items.cs b/src/LibMooNet/D3/Items/Items.cs similarity index 50% rename from source/D3Proto/D3/Items/Items.cs rename to src/LibMooNet/D3/Items/Items.cs index 80824763..7a3befa0 100644 --- a/source/D3Proto/D3/Items/Items.cs +++ b/src/LibMooNet/D3/Items/Items.cs @@ -1,4 +1,6 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code using pb = global::Google.ProtocolBuffers; using pbc = global::Google.ProtocolBuffers.Collections; @@ -6,6 +8,9 @@ using scg = global::System.Collections.Generic; namespace D3.Items { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public static partial class Items { #region Extension registration @@ -21,16 +26,8 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Items_EmbeddedGenerator__FieldAccessorTable; internal static pbd::MessageDescriptor internal__static_D3_Items_SavedItem__Descriptor; internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Items_SavedItem__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_D3_Items_AuctionAccountInfo__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Items_AuctionAccountInfo__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_D3_Items_AuctionItem__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Items_AuctionItem__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_D3_Items_AuctionInfo__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Items_AuctionInfo__FieldAccessorTable; internal static pbd::MessageDescriptor internal__static_D3_Items_ItemList__Descriptor; internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Items_ItemList__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_D3_Items_Ownership__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Items_Ownership__FieldAccessorTable; #endregion #region Descriptor public static pbd::FileDescriptor Descriptor { @@ -41,38 +38,30 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { static Items() { byte[] descriptorData = global::System.Convert.FromBase64String( "CgtJdGVtcy5wcm90bxIIRDMuSXRlbXMaDkdCSGFuZGxlLnByb3RvGhNPbmxp" + - "bmVTZXJ2aWNlLnByb3RvIosBCgxSYXJlSXRlbU5hbWUSGwoTaXRlbV9uYW1l" + - "X2lzX3ByZWZpeBgBIAIoCBIdChVzbm9fYWZmaXhfc3RyaW5nX2xpc3QYAiAC" + - "KA8SHwoXYWZmaXhfc3RyaW5nX2xpc3RfaW5kZXgYAyACKBESHgoWaXRlbV9z" + - "dHJpbmdfbGlzdF9pbmRleBgEIAIoESKWAwoJR2VuZXJhdG9yEgwKBHNlZWQY" + - "ASACKA0SKQoJZ2JfaGFuZGxlGAIgAigLMhYuRDMuR2FtZUJhbGFuY2UuSGFu" + - "ZGxlEhQKDGJhc2VfYWZmaXhlcxgDIAMoDxIuCg5yYXJlX2l0ZW1fbmFtZRgE" + - "IAIoCzIWLkQzLkl0ZW1zLlJhcmVJdGVtTmFtZRIVCg1lbmNoYW50X2FmZml4" + - "GAUgAigPEhQKDHNvY2tldF9hZmZpeBgGIAIoDxINCgVmbGFncxgHIAIoDRIS" + - "CgpkdXJhYmlsaXR5GAggAigNEhIKCnN0YWNrX3NpemUYCSACKAQSEAoIZHll" + - "X3R5cGUYCiACKA0SGgoSaXRlbV9xdWFsaXR5X2xldmVsGAsgAigREhoKEml0" + - "ZW1fYmluZGluZ19sZXZlbBgMIAIoERIWCg5tYXhfZHVyYWJpbGl0eRgNIAIo" + - "DRItCghjb250ZW50cxgOIAMoCzIbLkQzLkl0ZW1zLkVtYmVkZGVkR2VuZXJh" + - "dG9yEhUKDWF0dHVuZWRfc2tpbGwYDyABKA8iYQoRRW1iZWRkZWRHZW5lcmF0" + - "b3ISJAoCaWQYASACKAsyGC5EMy5PbmxpbmVTZXJ2aWNlLkl0ZW1JZBImCgln" + - "ZW5lcmF0b3IYAiACKAsyEy5EMy5JdGVtcy5HZW5lcmF0b3IilwIKCVNhdmVk" + - "SXRlbRIkCgJpZBgBIAIoCzIYLkQzLk9ubGluZVNlcnZpY2UuSXRlbUlkEjMK" + - "D293bmVyX2VudGl0eV9pZBgCIAEoCzIaLkQzLk9ubGluZVNlcnZpY2UuRW50" + - "aXR5SWQSKwoJc29ja2V0X2lkGAMgASgLMhguRDMuT25saW5lU2VydmljZS5J" + - "dGVtSWQSFgoOaGlyZWxpbmdfY2xhc3MYBCACKBESEQoJaXRlbV9zbG90GAUg" + - "AigREhQKDHNxdWFyZV9pbmRleBgGIAIoERIZChF1c2VkX3NvY2tldF9jb3Vu" + - "dBgHIAIoDRImCglnZW5lcmF0b3IYCCABKAsyEy5EMy5JdGVtcy5HZW5lcmF0" + - "b3IicwoSQXVjdGlvbkFjY291bnRJbmZvEi4KCmFjY291bnRfaWQYASACKAsy" + - "Gi5EMy5PbmxpbmVTZXJ2aWNlLkVudGl0eUlkEi0KCWVzY3Jvd19pZBgCIAIo" + - "CzIaLkQzLk9ubGluZVNlcnZpY2UuRW50aXR5SWQiWwoLQXVjdGlvbkl0ZW0S" + - "JAoCaWQYASACKAsyGC5EMy5PbmxpbmVTZXJ2aWNlLkl0ZW1JZBImCglnZW5l" + - "cmF0b3IYAiACKAsyEy5EMy5JdGVtcy5HZW5lcmF0b3IiVwoLQXVjdGlvbklu" + - "Zm8SJAoCaWQYASACKAsyGC5EMy5PbmxpbmVTZXJ2aWNlLkl0ZW1JZBIiCgVv" + - "d25lchgCIAEoCzITLkQzLkl0ZW1zLk93bmVyc2hpcCIuCghJdGVtTGlzdBIi" + - "CgVpdGVtcxgBIAMoCzITLkQzLkl0ZW1zLlNhdmVkSXRlbSKEAQoJT3duZXJz" + - "aGlwEjMKD293bmVyX2VudGl0eV9pZBgBIAIoCzIaLkQzLk9ubGluZVNlcnZp" + - "Y2UuRW50aXR5SWQSEwoLZGVsZXRlX3RpbWUYAiABKBISLQoJZXNjcm93X2lk" + - "GAMgASgLMhouRDMuT25saW5lU2VydmljZS5FbnRpdHlJZA=="); + "bmVTZXJ2aWNlLnByb3RvIp4BCgxSYXJlSXRlbU5hbWUSIgoTaXRlbV9uYW1l" + + "X2lzX3ByZWZpeBgBIAIoCDoFZmFsc2USIQoVc25vX2FmZml4X3N0cmluZ19s" + + "aXN0GAIgAigPOgItMRIjChdhZmZpeF9zdHJpbmdfbGlzdF9pbmRleBgDIAIo" + + "EToCLTESIgoWaXRlbV9zdHJpbmdfbGlzdF9pbmRleBgEIAIoEToCLTEivwMK" + + "CUdlbmVyYXRvchIPCgRzZWVkGAEgAigNOgEwEikKCWdiX2hhbmRsZRgCIAIo" + + "CzIWLkQzLkdhbWVCYWxhbmNlLkhhbmRsZRIUCgxiYXNlX2FmZml4ZXMYAyAD" + + "KA8SLgoOcmFyZV9pdGVtX25hbWUYBCABKAsyFi5EMy5JdGVtcy5SYXJlSXRl" + + "bU5hbWUSGQoNZW5jaGFudF9hZmZpeBgFIAEoDzoCLTESEAoFZmxhZ3MYBiAC" + + "KA06ATASEgoKZHVyYWJpbGl0eRgHIAIoDRISCgpzdGFja19zaXplGAggAigE" + + "EhMKCGR5ZV90eXBlGAkgASgNOgEwEh0KEml0ZW1fcXVhbGl0eV9sZXZlbBgK" + + "IAEoEToBMRIdChJpdGVtX2JpbmRpbmdfbGV2ZWwYCyABKBE6ATASGQoObWF4" + + "X2R1cmFiaWxpdHkYDCABKA06ATASLQoIY29udGVudHMYDSADKAsyGy5EMy5J" + + "dGVtcy5FbWJlZGRlZEdlbmVyYXRvchIgChVpdGVtX3VubG9ja190aW1lc3Rh" + + "bXAYDiABKAQ6ATASHAoRZW5jaGFudF9yYW5nZV92YWwYDyABKA06ATAiYQoR" + + "RW1iZWRkZWRHZW5lcmF0b3ISJAoCaWQYASACKAsyGC5EMy5PbmxpbmVTZXJ2" + + "aWNlLkl0ZW1JZBImCglnZW5lcmF0b3IYAiACKAsyEy5EMy5JdGVtcy5HZW5l" + + "cmF0b3IimgIKCVNhdmVkSXRlbRIkCgJpZBgBIAIoCzIYLkQzLk9ubGluZVNl" + + "cnZpY2UuSXRlbUlkEjMKD293bmVyX2VudGl0eV9pZBgCIAEoCzIaLkQzLk9u" + + "bGluZVNlcnZpY2UuRW50aXR5SWQSKwoJc29ja2V0X2lkGAMgASgLMhguRDMu" + + "T25saW5lU2VydmljZS5JdGVtSWQSFgoOaGlyZWxpbmdfY2xhc3MYBCACKBES" + + "EQoJaXRlbV9zbG90GAUgAigREhQKDHNxdWFyZV9pbmRleBgGIAIoERIcChF1" + + "c2VkX3NvY2tldF9jb3VudBgHIAIoDToBMBImCglnZW5lcmF0b3IYCCABKAsy" + + "Ey5EMy5JdGVtcy5HZW5lcmF0b3IiLgoISXRlbUxpc3QSIgoFaXRlbXMYASAD" + + "KAsyEy5EMy5JdGVtcy5TYXZlZEl0ZW0="); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_D3_Items_RareItemName__Descriptor = Descriptor.MessageTypes[0]; @@ -82,7 +71,7 @@ static Items() { internal__static_D3_Items_Generator__Descriptor = Descriptor.MessageTypes[1]; internal__static_D3_Items_Generator__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Items_Generator__Descriptor, - new string[] { "Seed", "GbHandle", "BaseAffixes", "RareItemName", "EnchantAffix", "SocketAffix", "Flags", "Durability", "StackSize", "DyeType", "ItemQualityLevel", "ItemBindingLevel", "MaxDurability", "Contents", "AttunedSkill", }); + new string[] { "Seed", "GbHandle", "BaseAffixes", "RareItemName", "EnchantAffix", "Flags", "Durability", "StackSize", "DyeType", "ItemQualityLevel", "ItemBindingLevel", "MaxDurability", "Contents", "ItemUnlockTimestamp", "EnchantRangeVal", }); internal__static_D3_Items_EmbeddedGenerator__Descriptor = Descriptor.MessageTypes[2]; internal__static_D3_Items_EmbeddedGenerator__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Items_EmbeddedGenerator__Descriptor, @@ -91,26 +80,10 @@ static Items() { internal__static_D3_Items_SavedItem__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Items_SavedItem__Descriptor, new string[] { "Id", "OwnerEntityId", "SocketId", "HirelingClass", "ItemSlot", "SquareIndex", "UsedSocketCount", "Generator", }); - internal__static_D3_Items_AuctionAccountInfo__Descriptor = Descriptor.MessageTypes[4]; - internal__static_D3_Items_AuctionAccountInfo__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Items_AuctionAccountInfo__Descriptor, - new string[] { "AccountId", "EscrowId", }); - internal__static_D3_Items_AuctionItem__Descriptor = Descriptor.MessageTypes[5]; - internal__static_D3_Items_AuctionItem__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Items_AuctionItem__Descriptor, - new string[] { "Id", "Generator", }); - internal__static_D3_Items_AuctionInfo__Descriptor = Descriptor.MessageTypes[6]; - internal__static_D3_Items_AuctionInfo__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Items_AuctionInfo__Descriptor, - new string[] { "Id", "Owner", }); - internal__static_D3_Items_ItemList__Descriptor = Descriptor.MessageTypes[7]; + internal__static_D3_Items_ItemList__Descriptor = Descriptor.MessageTypes[4]; internal__static_D3_Items_ItemList__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Items_ItemList__Descriptor, new string[] { "Items", }); - internal__static_D3_Items_Ownership__Descriptor = Descriptor.MessageTypes[8]; - internal__static_D3_Items_Ownership__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Items_Ownership__Descriptor, - new string[] { "OwnerEntityId", "DeleteTime", "EscrowId", }); return null; }; pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, @@ -123,14 +96,20 @@ static Items() { } #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class RareItemName : pb::GeneratedMessage { - private static readonly RareItemName defaultInstance = new Builder().BuildPartial(); + private RareItemName() { } + private static readonly RareItemName defaultInstance = new RareItemName().MakeReadOnly(); + private static readonly string[] _rareItemNameFieldNames = new string[] { "affix_string_list_index", "item_name_is_prefix", "item_string_list_index", "sno_affix_string_list" }; + private static readonly uint[] _rareItemNameFieldTags = new uint[] { 24, 8, 32, 21 }; public static RareItemName DefaultInstance { get { return defaultInstance; } } public override RareItemName DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override RareItemName ThisMessage { @@ -147,7 +126,7 @@ protected override RareItemName ThisMessage { public const int ItemNameIsPrefixFieldNumber = 1; private bool hasItemNameIsPrefix; - private bool itemNameIsPrefix_ = false; + private bool itemNameIsPrefix_; public bool HasItemNameIsPrefix { get { return hasItemNameIsPrefix; } } @@ -157,7 +136,7 @@ public bool ItemNameIsPrefix { public const int SnoAffixStringListFieldNumber = 2; private bool hasSnoAffixStringList; - private int snoAffixStringList_ = 0; + private int snoAffixStringList_ = -1; public bool HasSnoAffixStringList { get { return hasSnoAffixStringList; } } @@ -167,7 +146,7 @@ public int SnoAffixStringList { public const int AffixStringListIndexFieldNumber = 3; private bool hasAffixStringListIndex; - private int affixStringListIndex_ = 0; + private int affixStringListIndex_ = -1; public bool HasAffixStringListIndex { get { return hasAffixStringListIndex; } } @@ -177,7 +156,7 @@ public int AffixStringListIndex { public const int ItemStringListIndexFieldNumber = 4; private bool hasItemStringListIndex; - private int itemStringListIndex_ = 0; + private int itemStringListIndex_ = -1; public bool HasItemStringListIndex { get { return hasItemStringListIndex; } } @@ -195,19 +174,20 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasItemNameIsPrefix) { - output.WriteBool(1, ItemNameIsPrefix); + string[] field_names = _rareItemNameFieldNames; + if (hasItemNameIsPrefix) { + output.WriteBool(1, field_names[1], ItemNameIsPrefix); } - if (HasSnoAffixStringList) { - output.WriteSFixed32(2, SnoAffixStringList); + if (hasSnoAffixStringList) { + output.WriteSFixed32(2, field_names[3], SnoAffixStringList); } - if (HasAffixStringListIndex) { - output.WriteSInt32(3, AffixStringListIndex); + if (hasAffixStringListIndex) { + output.WriteSInt32(3, field_names[0], AffixStringListIndex); } - if (HasItemStringListIndex) { - output.WriteSInt32(4, ItemStringListIndex); + if (hasItemStringListIndex) { + output.WriteSInt32(4, field_names[2], ItemStringListIndex); } UnknownFields.WriteTo(output); } @@ -219,16 +199,16 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasItemNameIsPrefix) { + if (hasItemNameIsPrefix) { size += pb::CodedOutputStream.ComputeBoolSize(1, ItemNameIsPrefix); } - if (HasSnoAffixStringList) { + if (hasSnoAffixStringList) { size += pb::CodedOutputStream.ComputeSFixed32Size(2, SnoAffixStringList); } - if (HasAffixStringListIndex) { + if (hasAffixStringListIndex) { size += pb::CodedOutputStream.ComputeSInt32Size(3, AffixStringListIndex); } - if (HasItemStringListIndex) { + if (hasItemStringListIndex) { size += pb::CodedOutputStream.ComputeSInt32Size(4, ItemStringListIndex); } size += UnknownFields.SerializedSize; @@ -261,38 +241,72 @@ public static RareItemName ParseDelimitedFrom(global::System.IO.Stream input) { public static RareItemName ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static RareItemName ParseFrom(pb::CodedInputStream input) { + public static RareItemName ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static RareItemName ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static RareItemName ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private RareItemName MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(RareItemName prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(RareItemName cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private RareItemName result; + + private RareItemName PrepareBuilder() { + if (resultIsReadOnly) { + RareItemName original = result; + result = new RareItemName(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - RareItemName result = new RareItemName(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override RareItemName MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new RareItemName(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -304,12 +318,11 @@ public override RareItemName DefaultInstanceForType { } public override RareItemName BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - RareItemName returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -323,6 +336,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(RareItemName other) { if (other == global::D3.Items.RareItemName.DefaultInstance) return this; + PrepareBuilder(); if (other.HasItemNameIsPrefix) { ItemNameIsPrefix = other.ItemNameIsPrefix; } @@ -339,20 +353,31 @@ public override Builder MergeFrom(RareItemName other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_rareItemNameFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _rareItemNameFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -364,99 +389,112 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 8: { - ItemNameIsPrefix = input.ReadBool(); + result.hasItemNameIsPrefix = input.ReadBool(ref result.itemNameIsPrefix_); break; } case 21: { - SnoAffixStringList = input.ReadSFixed32(); + result.hasSnoAffixStringList = input.ReadSFixed32(ref result.snoAffixStringList_); break; } case 24: { - AffixStringListIndex = input.ReadSInt32(); + result.hasAffixStringListIndex = input.ReadSInt32(ref result.affixStringListIndex_); break; } case 32: { - ItemStringListIndex = input.ReadSInt32(); + result.hasItemStringListIndex = input.ReadSInt32(ref result.itemStringListIndex_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasItemNameIsPrefix { - get { return result.HasItemNameIsPrefix; } + get { return result.hasItemNameIsPrefix; } } public bool ItemNameIsPrefix { get { return result.ItemNameIsPrefix; } set { SetItemNameIsPrefix(value); } } public Builder SetItemNameIsPrefix(bool value) { + PrepareBuilder(); result.hasItemNameIsPrefix = true; result.itemNameIsPrefix_ = value; return this; } public Builder ClearItemNameIsPrefix() { + PrepareBuilder(); result.hasItemNameIsPrefix = false; result.itemNameIsPrefix_ = false; return this; } public bool HasSnoAffixStringList { - get { return result.HasSnoAffixStringList; } + get { return result.hasSnoAffixStringList; } } public int SnoAffixStringList { get { return result.SnoAffixStringList; } set { SetSnoAffixStringList(value); } } public Builder SetSnoAffixStringList(int value) { + PrepareBuilder(); result.hasSnoAffixStringList = true; result.snoAffixStringList_ = value; return this; } public Builder ClearSnoAffixStringList() { + PrepareBuilder(); result.hasSnoAffixStringList = false; - result.snoAffixStringList_ = 0; + result.snoAffixStringList_ = -1; return this; } public bool HasAffixStringListIndex { - get { return result.HasAffixStringListIndex; } + get { return result.hasAffixStringListIndex; } } public int AffixStringListIndex { get { return result.AffixStringListIndex; } set { SetAffixStringListIndex(value); } } public Builder SetAffixStringListIndex(int value) { + PrepareBuilder(); result.hasAffixStringListIndex = true; result.affixStringListIndex_ = value; return this; } public Builder ClearAffixStringListIndex() { + PrepareBuilder(); result.hasAffixStringListIndex = false; - result.affixStringListIndex_ = 0; + result.affixStringListIndex_ = -1; return this; } public bool HasItemStringListIndex { - get { return result.HasItemStringListIndex; } + get { return result.hasItemStringListIndex; } } public int ItemStringListIndex { get { return result.ItemStringListIndex; } set { SetItemStringListIndex(value); } } public Builder SetItemStringListIndex(int value) { + PrepareBuilder(); result.hasItemStringListIndex = true; result.itemStringListIndex_ = value; return this; } public Builder ClearItemStringListIndex() { + PrepareBuilder(); result.hasItemStringListIndex = false; - result.itemStringListIndex_ = 0; + result.itemStringListIndex_ = -1; return this; } } @@ -465,14 +503,20 @@ static RareItemName() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Generator : pb::GeneratedMessage { - private static readonly Generator defaultInstance = new Builder().BuildPartial(); + private Generator() { } + private static readonly Generator defaultInstance = new Generator().MakeReadOnly(); + private static readonly string[] _generatorFieldNames = new string[] { "base_affixes", "contents", "durability", "dye_type", "enchant_affix", "enchant_range_val", "flags", "gb_handle", "item_binding_level", "item_quality_level", "item_unlock_timestamp", "max_durability", "rare_item_name", "seed", "stack_size" }; + private static readonly uint[] _generatorFieldTags = new uint[] { 29, 106, 56, 72, 45, 120, 48, 18, 88, 80, 112, 96, 34, 8, 64 }; public static Generator DefaultInstance { get { return defaultInstance; } } public override Generator DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override Generator ThisMessage { @@ -489,7 +533,7 @@ protected override Generator ThisMessage { public const int SeedFieldNumber = 1; private bool hasSeed; - private uint seed_ = 0; + private uint seed_; public bool HasSeed { get { return hasSeed; } } @@ -499,12 +543,12 @@ public uint Seed { public const int GbHandleFieldNumber = 2; private bool hasGbHandle; - private global::D3.GameBalance.Handle gbHandle_ = global::D3.GameBalance.Handle.DefaultInstance; + private global::D3.GameBalance.Handle gbHandle_; public bool HasGbHandle { get { return hasGbHandle; } } public global::D3.GameBalance.Handle GbHandle { - get { return gbHandle_; } + get { return gbHandle_ ?? global::D3.GameBalance.Handle.DefaultInstance; } } public const int BaseAffixesFieldNumber = 3; @@ -521,17 +565,17 @@ public int GetBaseAffixes(int index) { public const int RareItemNameFieldNumber = 4; private bool hasRareItemName; - private global::D3.Items.RareItemName rareItemName_ = global::D3.Items.RareItemName.DefaultInstance; + private global::D3.Items.RareItemName rareItemName_; public bool HasRareItemName { get { return hasRareItemName; } } public global::D3.Items.RareItemName RareItemName { - get { return rareItemName_; } + get { return rareItemName_ ?? global::D3.Items.RareItemName.DefaultInstance; } } public const int EnchantAffixFieldNumber = 5; private bool hasEnchantAffix; - private int enchantAffix_ = 0; + private int enchantAffix_ = -1; public bool HasEnchantAffix { get { return hasEnchantAffix; } } @@ -539,19 +583,9 @@ public int EnchantAffix { get { return enchantAffix_; } } - public const int SocketAffixFieldNumber = 6; - private bool hasSocketAffix; - private int socketAffix_ = 0; - public bool HasSocketAffix { - get { return hasSocketAffix; } - } - public int SocketAffix { - get { return socketAffix_; } - } - - public const int FlagsFieldNumber = 7; + public const int FlagsFieldNumber = 6; private bool hasFlags; - private uint flags_ = 0; + private uint flags_; public bool HasFlags { get { return hasFlags; } } @@ -559,9 +593,9 @@ public uint Flags { get { return flags_; } } - public const int DurabilityFieldNumber = 8; + public const int DurabilityFieldNumber = 7; private bool hasDurability; - private uint durability_ = 0; + private uint durability_; public bool HasDurability { get { return hasDurability; } } @@ -569,9 +603,9 @@ public uint Durability { get { return durability_; } } - public const int StackSizeFieldNumber = 9; + public const int StackSizeFieldNumber = 8; private bool hasStackSize; - private ulong stackSize_ = 0UL; + private ulong stackSize_; public bool HasStackSize { get { return hasStackSize; } } @@ -579,9 +613,9 @@ public ulong StackSize { get { return stackSize_; } } - public const int DyeTypeFieldNumber = 10; + public const int DyeTypeFieldNumber = 9; private bool hasDyeType; - private uint dyeType_ = 0; + private uint dyeType_; public bool HasDyeType { get { return hasDyeType; } } @@ -589,9 +623,9 @@ public uint DyeType { get { return dyeType_; } } - public const int ItemQualityLevelFieldNumber = 11; + public const int ItemQualityLevelFieldNumber = 10; private bool hasItemQualityLevel; - private int itemQualityLevel_ = 0; + private int itemQualityLevel_ = 1; public bool HasItemQualityLevel { get { return hasItemQualityLevel; } } @@ -599,9 +633,9 @@ public int ItemQualityLevel { get { return itemQualityLevel_; } } - public const int ItemBindingLevelFieldNumber = 12; + public const int ItemBindingLevelFieldNumber = 11; private bool hasItemBindingLevel; - private int itemBindingLevel_ = 0; + private int itemBindingLevel_; public bool HasItemBindingLevel { get { return hasItemBindingLevel; } } @@ -609,9 +643,9 @@ public int ItemBindingLevel { get { return itemBindingLevel_; } } - public const int MaxDurabilityFieldNumber = 13; + public const int MaxDurabilityFieldNumber = 12; private bool hasMaxDurability; - private uint maxDurability_ = 0; + private uint maxDurability_; public bool HasMaxDurability { get { return hasMaxDurability; } } @@ -619,7 +653,7 @@ public uint MaxDurability { get { return maxDurability_; } } - public const int ContentsFieldNumber = 14; + public const int ContentsFieldNumber = 13; private pbc::PopsicleList contents_ = new pbc::PopsicleList(); public scg::IList ContentsList { get { return contents_; } @@ -631,32 +665,37 @@ public int ContentsCount { return contents_[index]; } - public const int AttunedSkillFieldNumber = 15; - private bool hasAttunedSkill; - private int attunedSkill_ = 0; - public bool HasAttunedSkill { - get { return hasAttunedSkill; } + public const int ItemUnlockTimestampFieldNumber = 14; + private bool hasItemUnlockTimestamp; + private ulong itemUnlockTimestamp_; + public bool HasItemUnlockTimestamp { + get { return hasItemUnlockTimestamp; } + } + public ulong ItemUnlockTimestamp { + get { return itemUnlockTimestamp_; } + } + + public const int EnchantRangeValFieldNumber = 15; + private bool hasEnchantRangeVal; + private uint enchantRangeVal_; + public bool HasEnchantRangeVal { + get { return hasEnchantRangeVal; } } - public int AttunedSkill { - get { return attunedSkill_; } + public uint EnchantRangeVal { + get { return enchantRangeVal_; } } public override bool IsInitialized { get { if (!hasSeed) return false; if (!hasGbHandle) return false; - if (!hasRareItemName) return false; - if (!hasEnchantAffix) return false; - if (!hasSocketAffix) return false; if (!hasFlags) return false; if (!hasDurability) return false; if (!hasStackSize) return false; - if (!hasDyeType) return false; - if (!hasItemQualityLevel) return false; - if (!hasItemBindingLevel) return false; - if (!hasMaxDurability) return false; if (!GbHandle.IsInitialized) return false; - if (!RareItemName.IsInitialized) return false; + if (HasRareItemName) { + if (!RareItemName.IsInitialized) return false; + } foreach (global::D3.Items.EmbeddedGenerator element in ContentsList) { if (!element.IsInitialized) return false; } @@ -664,54 +703,53 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasSeed) { - output.WriteUInt32(1, Seed); + string[] field_names = _generatorFieldNames; + if (hasSeed) { + output.WriteUInt32(1, field_names[13], Seed); } - if (HasGbHandle) { - output.WriteMessage(2, GbHandle); + if (hasGbHandle) { + output.WriteMessage(2, field_names[7], GbHandle); } if (baseAffixes_.Count > 0) { - foreach (int element in baseAffixes_) { - output.WriteSFixed32(3, element); - } + output.WriteSFixed32Array(3, field_names[0], baseAffixes_); } - if (HasRareItemName) { - output.WriteMessage(4, RareItemName); + if (hasRareItemName) { + output.WriteMessage(4, field_names[12], RareItemName); } - if (HasEnchantAffix) { - output.WriteSFixed32(5, EnchantAffix); + if (hasEnchantAffix) { + output.WriteSFixed32(5, field_names[4], EnchantAffix); } - if (HasSocketAffix) { - output.WriteSFixed32(6, SocketAffix); + if (hasFlags) { + output.WriteUInt32(6, field_names[6], Flags); } - if (HasFlags) { - output.WriteUInt32(7, Flags); + if (hasDurability) { + output.WriteUInt32(7, field_names[2], Durability); } - if (HasDurability) { - output.WriteUInt32(8, Durability); + if (hasStackSize) { + output.WriteUInt64(8, field_names[14], StackSize); } - if (HasStackSize) { - output.WriteUInt64(9, StackSize); + if (hasDyeType) { + output.WriteUInt32(9, field_names[3], DyeType); } - if (HasDyeType) { - output.WriteUInt32(10, DyeType); + if (hasItemQualityLevel) { + output.WriteSInt32(10, field_names[9], ItemQualityLevel); } - if (HasItemQualityLevel) { - output.WriteSInt32(11, ItemQualityLevel); + if (hasItemBindingLevel) { + output.WriteSInt32(11, field_names[8], ItemBindingLevel); } - if (HasItemBindingLevel) { - output.WriteSInt32(12, ItemBindingLevel); + if (hasMaxDurability) { + output.WriteUInt32(12, field_names[11], MaxDurability); } - if (HasMaxDurability) { - output.WriteUInt32(13, MaxDurability); + if (contents_.Count > 0) { + output.WriteMessageArray(13, field_names[1], contents_); } - foreach (global::D3.Items.EmbeddedGenerator element in ContentsList) { - output.WriteMessage(14, element); + if (hasItemUnlockTimestamp) { + output.WriteUInt64(14, field_names[10], ItemUnlockTimestamp); } - if (HasAttunedSkill) { - output.WriteSFixed32(15, AttunedSkill); + if (hasEnchantRangeVal) { + output.WriteUInt32(15, field_names[5], EnchantRangeVal); } UnknownFields.WriteTo(output); } @@ -723,10 +761,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasSeed) { + if (hasSeed) { size += pb::CodedOutputStream.ComputeUInt32Size(1, Seed); } - if (HasGbHandle) { + if (hasGbHandle) { size += pb::CodedOutputStream.ComputeMessageSize(2, GbHandle); } { @@ -735,41 +773,41 @@ public override int SerializedSize { size += dataSize; size += 1 * baseAffixes_.Count; } - if (HasRareItemName) { + if (hasRareItemName) { size += pb::CodedOutputStream.ComputeMessageSize(4, RareItemName); } - if (HasEnchantAffix) { + if (hasEnchantAffix) { size += pb::CodedOutputStream.ComputeSFixed32Size(5, EnchantAffix); } - if (HasSocketAffix) { - size += pb::CodedOutputStream.ComputeSFixed32Size(6, SocketAffix); - } - if (HasFlags) { - size += pb::CodedOutputStream.ComputeUInt32Size(7, Flags); + if (hasFlags) { + size += pb::CodedOutputStream.ComputeUInt32Size(6, Flags); } - if (HasDurability) { - size += pb::CodedOutputStream.ComputeUInt32Size(8, Durability); + if (hasDurability) { + size += pb::CodedOutputStream.ComputeUInt32Size(7, Durability); } - if (HasStackSize) { - size += pb::CodedOutputStream.ComputeUInt64Size(9, StackSize); + if (hasStackSize) { + size += pb::CodedOutputStream.ComputeUInt64Size(8, StackSize); } - if (HasDyeType) { - size += pb::CodedOutputStream.ComputeUInt32Size(10, DyeType); + if (hasDyeType) { + size += pb::CodedOutputStream.ComputeUInt32Size(9, DyeType); } - if (HasItemQualityLevel) { - size += pb::CodedOutputStream.ComputeSInt32Size(11, ItemQualityLevel); + if (hasItemQualityLevel) { + size += pb::CodedOutputStream.ComputeSInt32Size(10, ItemQualityLevel); } - if (HasItemBindingLevel) { - size += pb::CodedOutputStream.ComputeSInt32Size(12, ItemBindingLevel); + if (hasItemBindingLevel) { + size += pb::CodedOutputStream.ComputeSInt32Size(11, ItemBindingLevel); } - if (HasMaxDurability) { - size += pb::CodedOutputStream.ComputeUInt32Size(13, MaxDurability); + if (hasMaxDurability) { + size += pb::CodedOutputStream.ComputeUInt32Size(12, MaxDurability); } foreach (global::D3.Items.EmbeddedGenerator element in ContentsList) { - size += pb::CodedOutputStream.ComputeMessageSize(14, element); + size += pb::CodedOutputStream.ComputeMessageSize(13, element); } - if (HasAttunedSkill) { - size += pb::CodedOutputStream.ComputeSFixed32Size(15, AttunedSkill); + if (hasItemUnlockTimestamp) { + size += pb::CodedOutputStream.ComputeUInt64Size(14, ItemUnlockTimestamp); + } + if (hasEnchantRangeVal) { + size += pb::CodedOutputStream.ComputeUInt32Size(15, EnchantRangeVal); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -801,38 +839,74 @@ public static Generator ParseDelimitedFrom(global::System.IO.Stream input) { public static Generator ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static Generator ParseFrom(pb::CodedInputStream input) { + public static Generator ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Generator ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static Generator ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private Generator MakeReadOnly() { + baseAffixes_.MakeReadOnly(); + contents_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(Generator prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Generator cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Generator result; + + private Generator PrepareBuilder() { + if (resultIsReadOnly) { + Generator original = result; + result = new Generator(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - Generator result = new Generator(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override Generator MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new Generator(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -844,14 +918,11 @@ public override Generator DefaultInstanceForType { } public override Generator BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.baseAffixes_.MakeReadOnly(); - result.contents_.MakeReadOnly(); - Generator returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -865,6 +936,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Generator other) { if (other == global::D3.Items.Generator.DefaultInstance) return this; + PrepareBuilder(); if (other.HasSeed) { Seed = other.Seed; } @@ -872,7 +944,7 @@ public override Builder MergeFrom(Generator other) { MergeGbHandle(other.GbHandle); } if (other.baseAffixes_.Count != 0) { - base.AddRange(other.baseAffixes_, result.baseAffixes_); + result.baseAffixes_.Add(other.baseAffixes_); } if (other.HasRareItemName) { MergeRareItemName(other.RareItemName); @@ -880,9 +952,6 @@ public override Builder MergeFrom(Generator other) { if (other.HasEnchantAffix) { EnchantAffix = other.EnchantAffix; } - if (other.HasSocketAffix) { - SocketAffix = other.SocketAffix; - } if (other.HasFlags) { Flags = other.Flags; } @@ -905,29 +974,43 @@ public override Builder MergeFrom(Generator other) { MaxDurability = other.MaxDurability; } if (other.contents_.Count != 0) { - base.AddRange(other.contents_, result.contents_); + result.contents_.Add(other.contents_); + } + if (other.HasItemUnlockTimestamp) { + ItemUnlockTimestamp = other.ItemUnlockTimestamp; } - if (other.HasAttunedSkill) { - AttunedSkill = other.AttunedSkill; + if (other.HasEnchantRangeVal) { + EnchantRangeVal = other.EnchantRangeVal; } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_generatorFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _generatorFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -939,29 +1022,30 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 8: { - Seed = input.ReadUInt32(); + result.hasSeed = input.ReadUInt32(ref result.seed_); break; } case 18: { global::D3.GameBalance.Handle.Builder subBuilder = global::D3.GameBalance.Handle.CreateBuilder(); - if (HasGbHandle) { + if (result.hasGbHandle) { subBuilder.MergeFrom(GbHandle); } input.ReadMessage(subBuilder, extensionRegistry); GbHandle = subBuilder.BuildPartial(); break; } + case 26: case 29: { - AddBaseAffixes(input.ReadSFixed32()); + input.ReadSFixed32Array(tag, field_name, result.baseAffixes_); break; } case 34: { global::D3.Items.RareItemName.Builder subBuilder = global::D3.Items.RareItemName.CreateBuilder(); - if (HasRareItemName) { + if (result.hasRareItemName) { subBuilder.MergeFrom(RareItemName); } input.ReadMessage(subBuilder, extensionRegistry); @@ -969,76 +1053,81 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 45: { - EnchantAffix = input.ReadSFixed32(); + result.hasEnchantAffix = input.ReadSFixed32(ref result.enchantAffix_); break; } - case 53: { - SocketAffix = input.ReadSFixed32(); + case 48: { + result.hasFlags = input.ReadUInt32(ref result.flags_); break; } case 56: { - Flags = input.ReadUInt32(); + result.hasDurability = input.ReadUInt32(ref result.durability_); break; } case 64: { - Durability = input.ReadUInt32(); + result.hasStackSize = input.ReadUInt64(ref result.stackSize_); break; } case 72: { - StackSize = input.ReadUInt64(); + result.hasDyeType = input.ReadUInt32(ref result.dyeType_); break; } case 80: { - DyeType = input.ReadUInt32(); + result.hasItemQualityLevel = input.ReadSInt32(ref result.itemQualityLevel_); break; } case 88: { - ItemQualityLevel = input.ReadSInt32(); + result.hasItemBindingLevel = input.ReadSInt32(ref result.itemBindingLevel_); break; } case 96: { - ItemBindingLevel = input.ReadSInt32(); + result.hasMaxDurability = input.ReadUInt32(ref result.maxDurability_); break; } - case 104: { - MaxDurability = input.ReadUInt32(); + case 106: { + input.ReadMessageArray(tag, field_name, result.contents_, global::D3.Items.EmbeddedGenerator.DefaultInstance, extensionRegistry); break; } - case 114: { - global::D3.Items.EmbeddedGenerator.Builder subBuilder = global::D3.Items.EmbeddedGenerator.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddContents(subBuilder.BuildPartial()); + case 112: { + result.hasItemUnlockTimestamp = input.ReadUInt64(ref result.itemUnlockTimestamp_); break; } - case 125: { - AttunedSkill = input.ReadSFixed32(); + case 120: { + result.hasEnchantRangeVal = input.ReadUInt32(ref result.enchantRangeVal_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasSeed { - get { return result.HasSeed; } + get { return result.hasSeed; } } public uint Seed { get { return result.Seed; } set { SetSeed(value); } } public Builder SetSeed(uint value) { + PrepareBuilder(); result.hasSeed = true; result.seed_ = value; return this; } public Builder ClearSeed() { + PrepareBuilder(); result.hasSeed = false; result.seed_ = 0; return this; } public bool HasGbHandle { - get { return result.HasGbHandle; } + get { return result.hasGbHandle; } } public global::D3.GameBalance.Handle GbHandle { get { return result.GbHandle; } @@ -1046,19 +1135,22 @@ public bool HasGbHandle { } public Builder SetGbHandle(global::D3.GameBalance.Handle value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasGbHandle = true; result.gbHandle_ = value; return this; } public Builder SetGbHandle(global::D3.GameBalance.Handle.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasGbHandle = true; result.gbHandle_ = builderForValue.Build(); return this; } public Builder MergeGbHandle(global::D3.GameBalance.Handle value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasGbHandle && + PrepareBuilder(); + if (result.hasGbHandle && result.gbHandle_ != global::D3.GameBalance.Handle.DefaultInstance) { result.gbHandle_ = global::D3.GameBalance.Handle.CreateBuilder(result.gbHandle_).MergeFrom(value).BuildPartial(); } else { @@ -1068,13 +1160,14 @@ public Builder MergeGbHandle(global::D3.GameBalance.Handle value) { return this; } public Builder ClearGbHandle() { + PrepareBuilder(); result.hasGbHandle = false; - result.gbHandle_ = global::D3.GameBalance.Handle.DefaultInstance; + result.gbHandle_ = null; return this; } public pbc::IPopsicleList BaseAffixesList { - get { return result.baseAffixes_; } + get { return PrepareBuilder().baseAffixes_; } } public int BaseAffixesCount { get { return result.BaseAffixesCount; } @@ -1083,24 +1176,28 @@ public int GetBaseAffixes(int index) { return result.GetBaseAffixes(index); } public Builder SetBaseAffixes(int index, int value) { + PrepareBuilder(); result.baseAffixes_[index] = value; return this; } public Builder AddBaseAffixes(int value) { + PrepareBuilder(); result.baseAffixes_.Add(value); return this; } public Builder AddRangeBaseAffixes(scg::IEnumerable values) { - base.AddRange(values, result.baseAffixes_); + PrepareBuilder(); + result.baseAffixes_.Add(values); return this; } public Builder ClearBaseAffixes() { + PrepareBuilder(); result.baseAffixes_.Clear(); return this; } public bool HasRareItemName { - get { return result.HasRareItemName; } + get { return result.hasRareItemName; } } public global::D3.Items.RareItemName RareItemName { get { return result.RareItemName; } @@ -1108,19 +1205,22 @@ public bool HasRareItemName { } public Builder SetRareItemName(global::D3.Items.RareItemName value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasRareItemName = true; result.rareItemName_ = value; return this; } public Builder SetRareItemName(global::D3.Items.RareItemName.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasRareItemName = true; result.rareItemName_ = builderForValue.Build(); return this; } public Builder MergeRareItemName(global::D3.Items.RareItemName value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasRareItemName && + PrepareBuilder(); + if (result.hasRareItemName && result.rareItemName_ != global::D3.Items.RareItemName.DefaultInstance) { result.rareItemName_ = global::D3.Items.RareItemName.CreateBuilder(result.rareItemName_).MergeFrom(value).BuildPartial(); } else { @@ -1130,175 +1230,174 @@ public Builder MergeRareItemName(global::D3.Items.RareItemName value) { return this; } public Builder ClearRareItemName() { + PrepareBuilder(); result.hasRareItemName = false; - result.rareItemName_ = global::D3.Items.RareItemName.DefaultInstance; + result.rareItemName_ = null; return this; } public bool HasEnchantAffix { - get { return result.HasEnchantAffix; } + get { return result.hasEnchantAffix; } } public int EnchantAffix { get { return result.EnchantAffix; } set { SetEnchantAffix(value); } } public Builder SetEnchantAffix(int value) { + PrepareBuilder(); result.hasEnchantAffix = true; result.enchantAffix_ = value; return this; } public Builder ClearEnchantAffix() { + PrepareBuilder(); result.hasEnchantAffix = false; - result.enchantAffix_ = 0; - return this; - } - - public bool HasSocketAffix { - get { return result.HasSocketAffix; } - } - public int SocketAffix { - get { return result.SocketAffix; } - set { SetSocketAffix(value); } - } - public Builder SetSocketAffix(int value) { - result.hasSocketAffix = true; - result.socketAffix_ = value; - return this; - } - public Builder ClearSocketAffix() { - result.hasSocketAffix = false; - result.socketAffix_ = 0; + result.enchantAffix_ = -1; return this; } public bool HasFlags { - get { return result.HasFlags; } + get { return result.hasFlags; } } public uint Flags { get { return result.Flags; } set { SetFlags(value); } } public Builder SetFlags(uint value) { + PrepareBuilder(); result.hasFlags = true; result.flags_ = value; return this; } public Builder ClearFlags() { + PrepareBuilder(); result.hasFlags = false; result.flags_ = 0; return this; } public bool HasDurability { - get { return result.HasDurability; } + get { return result.hasDurability; } } public uint Durability { get { return result.Durability; } set { SetDurability(value); } } public Builder SetDurability(uint value) { + PrepareBuilder(); result.hasDurability = true; result.durability_ = value; return this; } public Builder ClearDurability() { + PrepareBuilder(); result.hasDurability = false; result.durability_ = 0; return this; } public bool HasStackSize { - get { return result.HasStackSize; } + get { return result.hasStackSize; } } public ulong StackSize { get { return result.StackSize; } set { SetStackSize(value); } } public Builder SetStackSize(ulong value) { + PrepareBuilder(); result.hasStackSize = true; result.stackSize_ = value; return this; } public Builder ClearStackSize() { + PrepareBuilder(); result.hasStackSize = false; result.stackSize_ = 0UL; return this; } public bool HasDyeType { - get { return result.HasDyeType; } + get { return result.hasDyeType; } } public uint DyeType { get { return result.DyeType; } set { SetDyeType(value); } } public Builder SetDyeType(uint value) { + PrepareBuilder(); result.hasDyeType = true; result.dyeType_ = value; return this; } public Builder ClearDyeType() { + PrepareBuilder(); result.hasDyeType = false; result.dyeType_ = 0; return this; } public bool HasItemQualityLevel { - get { return result.HasItemQualityLevel; } + get { return result.hasItemQualityLevel; } } public int ItemQualityLevel { get { return result.ItemQualityLevel; } set { SetItemQualityLevel(value); } } public Builder SetItemQualityLevel(int value) { + PrepareBuilder(); result.hasItemQualityLevel = true; result.itemQualityLevel_ = value; return this; } public Builder ClearItemQualityLevel() { + PrepareBuilder(); result.hasItemQualityLevel = false; - result.itemQualityLevel_ = 0; + result.itemQualityLevel_ = 1; return this; } public bool HasItemBindingLevel { - get { return result.HasItemBindingLevel; } + get { return result.hasItemBindingLevel; } } public int ItemBindingLevel { get { return result.ItemBindingLevel; } set { SetItemBindingLevel(value); } } public Builder SetItemBindingLevel(int value) { + PrepareBuilder(); result.hasItemBindingLevel = true; result.itemBindingLevel_ = value; return this; } public Builder ClearItemBindingLevel() { + PrepareBuilder(); result.hasItemBindingLevel = false; result.itemBindingLevel_ = 0; return this; } public bool HasMaxDurability { - get { return result.HasMaxDurability; } + get { return result.hasMaxDurability; } } public uint MaxDurability { get { return result.MaxDurability; } set { SetMaxDurability(value); } } public Builder SetMaxDurability(uint value) { + PrepareBuilder(); result.hasMaxDurability = true; result.maxDurability_ = value; return this; } public Builder ClearMaxDurability() { + PrepareBuilder(); result.hasMaxDurability = false; result.maxDurability_ = 0; return this; } public pbc::IPopsicleList ContentsList { - get { return result.contents_; } + get { return PrepareBuilder().contents_; } } public int ContentsCount { get { return result.ContentsCount; } @@ -1308,48 +1407,76 @@ public int ContentsCount { } public Builder SetContents(int index, global::D3.Items.EmbeddedGenerator value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.contents_[index] = value; return this; } public Builder SetContents(int index, global::D3.Items.EmbeddedGenerator.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.contents_[index] = builderForValue.Build(); return this; } public Builder AddContents(global::D3.Items.EmbeddedGenerator value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.contents_.Add(value); return this; } public Builder AddContents(global::D3.Items.EmbeddedGenerator.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.contents_.Add(builderForValue.Build()); return this; } public Builder AddRangeContents(scg::IEnumerable values) { - base.AddRange(values, result.contents_); + PrepareBuilder(); + result.contents_.Add(values); return this; } public Builder ClearContents() { + PrepareBuilder(); result.contents_.Clear(); return this; } - public bool HasAttunedSkill { - get { return result.HasAttunedSkill; } + public bool HasItemUnlockTimestamp { + get { return result.hasItemUnlockTimestamp; } + } + public ulong ItemUnlockTimestamp { + get { return result.ItemUnlockTimestamp; } + set { SetItemUnlockTimestamp(value); } + } + public Builder SetItemUnlockTimestamp(ulong value) { + PrepareBuilder(); + result.hasItemUnlockTimestamp = true; + result.itemUnlockTimestamp_ = value; + return this; + } + public Builder ClearItemUnlockTimestamp() { + PrepareBuilder(); + result.hasItemUnlockTimestamp = false; + result.itemUnlockTimestamp_ = 0UL; + return this; + } + + public bool HasEnchantRangeVal { + get { return result.hasEnchantRangeVal; } } - public int AttunedSkill { - get { return result.AttunedSkill; } - set { SetAttunedSkill(value); } + public uint EnchantRangeVal { + get { return result.EnchantRangeVal; } + set { SetEnchantRangeVal(value); } } - public Builder SetAttunedSkill(int value) { - result.hasAttunedSkill = true; - result.attunedSkill_ = value; + public Builder SetEnchantRangeVal(uint value) { + PrepareBuilder(); + result.hasEnchantRangeVal = true; + result.enchantRangeVal_ = value; return this; } - public Builder ClearAttunedSkill() { - result.hasAttunedSkill = false; - result.attunedSkill_ = 0; + public Builder ClearEnchantRangeVal() { + PrepareBuilder(); + result.hasEnchantRangeVal = false; + result.enchantRangeVal_ = 0; return this; } } @@ -1358,14 +1485,20 @@ static Generator() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class EmbeddedGenerator : pb::GeneratedMessage { - private static readonly EmbeddedGenerator defaultInstance = new Builder().BuildPartial(); + private EmbeddedGenerator() { } + private static readonly EmbeddedGenerator defaultInstance = new EmbeddedGenerator().MakeReadOnly(); + private static readonly string[] _embeddedGeneratorFieldNames = new string[] { "generator", "id" }; + private static readonly uint[] _embeddedGeneratorFieldTags = new uint[] { 18, 10 }; public static EmbeddedGenerator DefaultInstance { get { return defaultInstance; } } public override EmbeddedGenerator DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override EmbeddedGenerator ThisMessage { @@ -1382,22 +1515,22 @@ protected override EmbeddedGenerator ThisMessage { public const int IdFieldNumber = 1; private bool hasId; - private global::D3.OnlineService.ItemId id_ = global::D3.OnlineService.ItemId.DefaultInstance; + private global::D3.OnlineService.ItemId id_; public bool HasId { get { return hasId; } } public global::D3.OnlineService.ItemId Id { - get { return id_; } + get { return id_ ?? global::D3.OnlineService.ItemId.DefaultInstance; } } public const int GeneratorFieldNumber = 2; private bool hasGenerator; - private global::D3.Items.Generator generator_ = global::D3.Items.Generator.DefaultInstance; + private global::D3.Items.Generator generator_; public bool HasGenerator { get { return hasGenerator; } } public global::D3.Items.Generator Generator { - get { return generator_; } + get { return generator_ ?? global::D3.Items.Generator.DefaultInstance; } } public override bool IsInitialized { @@ -1410,13 +1543,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasId) { - output.WriteMessage(1, Id); + string[] field_names = _embeddedGeneratorFieldNames; + if (hasId) { + output.WriteMessage(1, field_names[1], Id); } - if (HasGenerator) { - output.WriteMessage(2, Generator); + if (hasGenerator) { + output.WriteMessage(2, field_names[0], Generator); } UnknownFields.WriteTo(output); } @@ -1428,10 +1562,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasId) { + if (hasId) { size += pb::CodedOutputStream.ComputeMessageSize(1, Id); } - if (HasGenerator) { + if (hasGenerator) { size += pb::CodedOutputStream.ComputeMessageSize(2, Generator); } size += UnknownFields.SerializedSize; @@ -1464,38 +1598,72 @@ public static EmbeddedGenerator ParseDelimitedFrom(global::System.IO.Stream inpu public static EmbeddedGenerator ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static EmbeddedGenerator ParseFrom(pb::CodedInputStream input) { + public static EmbeddedGenerator ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static EmbeddedGenerator ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static EmbeddedGenerator ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private EmbeddedGenerator MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(EmbeddedGenerator prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(EmbeddedGenerator cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private EmbeddedGenerator result; + + private EmbeddedGenerator PrepareBuilder() { + if (resultIsReadOnly) { + EmbeddedGenerator original = result; + result = new EmbeddedGenerator(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - EmbeddedGenerator result = new EmbeddedGenerator(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override EmbeddedGenerator MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new EmbeddedGenerator(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -1507,12 +1675,11 @@ public override EmbeddedGenerator DefaultInstanceForType { } public override EmbeddedGenerator BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - EmbeddedGenerator returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1526,6 +1693,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(EmbeddedGenerator other) { if (other == global::D3.Items.EmbeddedGenerator.DefaultInstance) return this; + PrepareBuilder(); if (other.HasId) { MergeId(other.Id); } @@ -1536,20 +1704,31 @@ public override Builder MergeFrom(EmbeddedGenerator other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_embeddedGeneratorFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _embeddedGeneratorFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1561,12 +1740,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::D3.OnlineService.ItemId.Builder subBuilder = global::D3.OnlineService.ItemId.CreateBuilder(); - if (HasId) { + if (result.hasId) { subBuilder.MergeFrom(Id); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1575,7 +1754,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::D3.Items.Generator.Builder subBuilder = global::D3.Items.Generator.CreateBuilder(); - if (HasGenerator) { + if (result.hasGenerator) { subBuilder.MergeFrom(Generator); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1584,11 +1763,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasId { - get { return result.HasId; } + get { return result.hasId; } } public global::D3.OnlineService.ItemId Id { get { return result.Id; } @@ -1596,19 +1780,22 @@ public bool HasId { } public Builder SetId(global::D3.OnlineService.ItemId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasId = true; result.id_ = value; return this; } public Builder SetId(global::D3.OnlineService.ItemId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasId = true; result.id_ = builderForValue.Build(); return this; } public Builder MergeId(global::D3.OnlineService.ItemId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasId && + PrepareBuilder(); + if (result.hasId && result.id_ != global::D3.OnlineService.ItemId.DefaultInstance) { result.id_ = global::D3.OnlineService.ItemId.CreateBuilder(result.id_).MergeFrom(value).BuildPartial(); } else { @@ -1618,13 +1805,14 @@ public Builder MergeId(global::D3.OnlineService.ItemId value) { return this; } public Builder ClearId() { + PrepareBuilder(); result.hasId = false; - result.id_ = global::D3.OnlineService.ItemId.DefaultInstance; + result.id_ = null; return this; } public bool HasGenerator { - get { return result.HasGenerator; } + get { return result.hasGenerator; } } public global::D3.Items.Generator Generator { get { return result.Generator; } @@ -1632,19 +1820,22 @@ public bool HasGenerator { } public Builder SetGenerator(global::D3.Items.Generator value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasGenerator = true; result.generator_ = value; return this; } public Builder SetGenerator(global::D3.Items.Generator.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasGenerator = true; result.generator_ = builderForValue.Build(); return this; } public Builder MergeGenerator(global::D3.Items.Generator value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasGenerator && + PrepareBuilder(); + if (result.hasGenerator && result.generator_ != global::D3.Items.Generator.DefaultInstance) { result.generator_ = global::D3.Items.Generator.CreateBuilder(result.generator_).MergeFrom(value).BuildPartial(); } else { @@ -1654,8 +1845,9 @@ public Builder MergeGenerator(global::D3.Items.Generator value) { return this; } public Builder ClearGenerator() { + PrepareBuilder(); result.hasGenerator = false; - result.generator_ = global::D3.Items.Generator.DefaultInstance; + result.generator_ = null; return this; } } @@ -1664,14 +1856,20 @@ static EmbeddedGenerator() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class SavedItem : pb::GeneratedMessage { - private static readonly SavedItem defaultInstance = new Builder().BuildPartial(); + private SavedItem() { } + private static readonly SavedItem defaultInstance = new SavedItem().MakeReadOnly(); + private static readonly string[] _savedItemFieldNames = new string[] { "generator", "hireling_class", "id", "item_slot", "owner_entity_id", "socket_id", "square_index", "used_socket_count" }; + private static readonly uint[] _savedItemFieldTags = new uint[] { 66, 32, 10, 40, 18, 26, 48, 56 }; public static SavedItem DefaultInstance { get { return defaultInstance; } } public override SavedItem DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override SavedItem ThisMessage { @@ -1688,37 +1886,37 @@ protected override SavedItem ThisMessage { public const int IdFieldNumber = 1; private bool hasId; - private global::D3.OnlineService.ItemId id_ = global::D3.OnlineService.ItemId.DefaultInstance; + private global::D3.OnlineService.ItemId id_; public bool HasId { get { return hasId; } } public global::D3.OnlineService.ItemId Id { - get { return id_; } + get { return id_ ?? global::D3.OnlineService.ItemId.DefaultInstance; } } public const int OwnerEntityIdFieldNumber = 2; private bool hasOwnerEntityId; - private global::D3.OnlineService.EntityId ownerEntityId_ = global::D3.OnlineService.EntityId.DefaultInstance; + private global::D3.OnlineService.EntityId ownerEntityId_; public bool HasOwnerEntityId { get { return hasOwnerEntityId; } } public global::D3.OnlineService.EntityId OwnerEntityId { - get { return ownerEntityId_; } + get { return ownerEntityId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } } public const int SocketIdFieldNumber = 3; private bool hasSocketId; - private global::D3.OnlineService.ItemId socketId_ = global::D3.OnlineService.ItemId.DefaultInstance; + private global::D3.OnlineService.ItemId socketId_; public bool HasSocketId { get { return hasSocketId; } } public global::D3.OnlineService.ItemId SocketId { - get { return socketId_; } + get { return socketId_ ?? global::D3.OnlineService.ItemId.DefaultInstance; } } public const int HirelingClassFieldNumber = 4; private bool hasHirelingClass; - private int hirelingClass_ = 0; + private int hirelingClass_; public bool HasHirelingClass { get { return hasHirelingClass; } } @@ -1728,7 +1926,7 @@ public int HirelingClass { public const int ItemSlotFieldNumber = 5; private bool hasItemSlot; - private int itemSlot_ = 0; + private int itemSlot_; public bool HasItemSlot { get { return hasItemSlot; } } @@ -1738,7 +1936,7 @@ public int ItemSlot { public const int SquareIndexFieldNumber = 6; private bool hasSquareIndex; - private int squareIndex_ = 0; + private int squareIndex_; public bool HasSquareIndex { get { return hasSquareIndex; } } @@ -1748,7 +1946,7 @@ public int SquareIndex { public const int UsedSocketCountFieldNumber = 7; private bool hasUsedSocketCount; - private uint usedSocketCount_ = 0; + private uint usedSocketCount_; public bool HasUsedSocketCount { get { return hasUsedSocketCount; } } @@ -1758,12 +1956,12 @@ public uint UsedSocketCount { public const int GeneratorFieldNumber = 8; private bool hasGenerator; - private global::D3.Items.Generator generator_ = global::D3.Items.Generator.DefaultInstance; + private global::D3.Items.Generator generator_; public bool HasGenerator { get { return hasGenerator; } } public global::D3.Items.Generator Generator { - get { return generator_; } + get { return generator_ ?? global::D3.Items.Generator.DefaultInstance; } } public override bool IsInitialized { @@ -1787,31 +1985,32 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasId) { - output.WriteMessage(1, Id); + string[] field_names = _savedItemFieldNames; + if (hasId) { + output.WriteMessage(1, field_names[2], Id); } - if (HasOwnerEntityId) { - output.WriteMessage(2, OwnerEntityId); + if (hasOwnerEntityId) { + output.WriteMessage(2, field_names[4], OwnerEntityId); } - if (HasSocketId) { - output.WriteMessage(3, SocketId); + if (hasSocketId) { + output.WriteMessage(3, field_names[5], SocketId); } - if (HasHirelingClass) { - output.WriteSInt32(4, HirelingClass); + if (hasHirelingClass) { + output.WriteSInt32(4, field_names[1], HirelingClass); } - if (HasItemSlot) { - output.WriteSInt32(5, ItemSlot); + if (hasItemSlot) { + output.WriteSInt32(5, field_names[3], ItemSlot); } - if (HasSquareIndex) { - output.WriteSInt32(6, SquareIndex); + if (hasSquareIndex) { + output.WriteSInt32(6, field_names[6], SquareIndex); } - if (HasUsedSocketCount) { - output.WriteUInt32(7, UsedSocketCount); + if (hasUsedSocketCount) { + output.WriteUInt32(7, field_names[7], UsedSocketCount); } - if (HasGenerator) { - output.WriteMessage(8, Generator); + if (hasGenerator) { + output.WriteMessage(8, field_names[0], Generator); } UnknownFields.WriteTo(output); } @@ -1823,28 +2022,28 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasId) { + if (hasId) { size += pb::CodedOutputStream.ComputeMessageSize(1, Id); } - if (HasOwnerEntityId) { + if (hasOwnerEntityId) { size += pb::CodedOutputStream.ComputeMessageSize(2, OwnerEntityId); } - if (HasSocketId) { + if (hasSocketId) { size += pb::CodedOutputStream.ComputeMessageSize(3, SocketId); } - if (HasHirelingClass) { + if (hasHirelingClass) { size += pb::CodedOutputStream.ComputeSInt32Size(4, HirelingClass); } - if (HasItemSlot) { + if (hasItemSlot) { size += pb::CodedOutputStream.ComputeSInt32Size(5, ItemSlot); } - if (HasSquareIndex) { + if (hasSquareIndex) { size += pb::CodedOutputStream.ComputeSInt32Size(6, SquareIndex); } - if (HasUsedSocketCount) { + if (hasUsedSocketCount) { size += pb::CodedOutputStream.ComputeUInt32Size(7, UsedSocketCount); } - if (HasGenerator) { + if (hasGenerator) { size += pb::CodedOutputStream.ComputeMessageSize(8, Generator); } size += UnknownFields.SerializedSize; @@ -1877,38 +2076,72 @@ public static SavedItem ParseDelimitedFrom(global::System.IO.Stream input) { public static SavedItem ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static SavedItem ParseFrom(pb::CodedInputStream input) { + public static SavedItem ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SavedItem ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static SavedItem ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private SavedItem MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(SavedItem prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SavedItem cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SavedItem result; + + private SavedItem PrepareBuilder() { + if (resultIsReadOnly) { + SavedItem original = result; + result = new SavedItem(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - SavedItem result = new SavedItem(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override SavedItem MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SavedItem(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -1920,12 +2153,11 @@ public override SavedItem DefaultInstanceForType { } public override SavedItem BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - SavedItem returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1939,6 +2171,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SavedItem other) { if (other == global::D3.Items.SavedItem.DefaultInstance) return this; + PrepareBuilder(); if (other.HasId) { MergeId(other.Id); } @@ -1967,20 +2200,31 @@ public override Builder MergeFrom(SavedItem other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_savedItemFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _savedItemFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1992,12 +2236,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::D3.OnlineService.ItemId.Builder subBuilder = global::D3.OnlineService.ItemId.CreateBuilder(); - if (HasId) { + if (result.hasId) { subBuilder.MergeFrom(Id); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2006,7 +2250,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); - if (HasOwnerEntityId) { + if (result.hasOwnerEntityId) { subBuilder.MergeFrom(OwnerEntityId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2015,7 +2259,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 26: { global::D3.OnlineService.ItemId.Builder subBuilder = global::D3.OnlineService.ItemId.CreateBuilder(); - if (HasSocketId) { + if (result.hasSocketId) { subBuilder.MergeFrom(SocketId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2023,24 +2267,24 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 32: { - HirelingClass = input.ReadSInt32(); + result.hasHirelingClass = input.ReadSInt32(ref result.hirelingClass_); break; } case 40: { - ItemSlot = input.ReadSInt32(); + result.hasItemSlot = input.ReadSInt32(ref result.itemSlot_); break; } case 48: { - SquareIndex = input.ReadSInt32(); + result.hasSquareIndex = input.ReadSInt32(ref result.squareIndex_); break; } case 56: { - UsedSocketCount = input.ReadUInt32(); + result.hasUsedSocketCount = input.ReadUInt32(ref result.usedSocketCount_); break; } case 66: { global::D3.Items.Generator.Builder subBuilder = global::D3.Items.Generator.CreateBuilder(); - if (HasGenerator) { + if (result.hasGenerator) { subBuilder.MergeFrom(Generator); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2049,11 +2293,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasId { - get { return result.HasId; } + get { return result.hasId; } } public global::D3.OnlineService.ItemId Id { get { return result.Id; } @@ -2061,19 +2310,22 @@ public bool HasId { } public Builder SetId(global::D3.OnlineService.ItemId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasId = true; result.id_ = value; return this; } public Builder SetId(global::D3.OnlineService.ItemId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasId = true; result.id_ = builderForValue.Build(); return this; } public Builder MergeId(global::D3.OnlineService.ItemId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasId && + PrepareBuilder(); + if (result.hasId && result.id_ != global::D3.OnlineService.ItemId.DefaultInstance) { result.id_ = global::D3.OnlineService.ItemId.CreateBuilder(result.id_).MergeFrom(value).BuildPartial(); } else { @@ -2083,13 +2335,14 @@ public Builder MergeId(global::D3.OnlineService.ItemId value) { return this; } public Builder ClearId() { + PrepareBuilder(); result.hasId = false; - result.id_ = global::D3.OnlineService.ItemId.DefaultInstance; + result.id_ = null; return this; } public bool HasOwnerEntityId { - get { return result.HasOwnerEntityId; } + get { return result.hasOwnerEntityId; } } public global::D3.OnlineService.EntityId OwnerEntityId { get { return result.OwnerEntityId; } @@ -2097,19 +2350,22 @@ public bool HasOwnerEntityId { } public Builder SetOwnerEntityId(global::D3.OnlineService.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasOwnerEntityId = true; result.ownerEntityId_ = value; return this; } public Builder SetOwnerEntityId(global::D3.OnlineService.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasOwnerEntityId = true; result.ownerEntityId_ = builderForValue.Build(); return this; } public Builder MergeOwnerEntityId(global::D3.OnlineService.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasOwnerEntityId && + PrepareBuilder(); + if (result.hasOwnerEntityId && result.ownerEntityId_ != global::D3.OnlineService.EntityId.DefaultInstance) { result.ownerEntityId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.ownerEntityId_).MergeFrom(value).BuildPartial(); } else { @@ -2119,13 +2375,14 @@ public Builder MergeOwnerEntityId(global::D3.OnlineService.EntityId value) { return this; } public Builder ClearOwnerEntityId() { + PrepareBuilder(); result.hasOwnerEntityId = false; - result.ownerEntityId_ = global::D3.OnlineService.EntityId.DefaultInstance; + result.ownerEntityId_ = null; return this; } public bool HasSocketId { - get { return result.HasSocketId; } + get { return result.hasSocketId; } } public global::D3.OnlineService.ItemId SocketId { get { return result.SocketId; } @@ -2133,19 +2390,22 @@ public bool HasSocketId { } public Builder SetSocketId(global::D3.OnlineService.ItemId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasSocketId = true; result.socketId_ = value; return this; } public Builder SetSocketId(global::D3.OnlineService.ItemId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasSocketId = true; result.socketId_ = builderForValue.Build(); return this; } public Builder MergeSocketId(global::D3.OnlineService.ItemId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasSocketId && + PrepareBuilder(); + if (result.hasSocketId && result.socketId_ != global::D3.OnlineService.ItemId.DefaultInstance) { result.socketId_ = global::D3.OnlineService.ItemId.CreateBuilder(result.socketId_).MergeFrom(value).BuildPartial(); } else { @@ -2155,85 +2415,94 @@ public Builder MergeSocketId(global::D3.OnlineService.ItemId value) { return this; } public Builder ClearSocketId() { + PrepareBuilder(); result.hasSocketId = false; - result.socketId_ = global::D3.OnlineService.ItemId.DefaultInstance; + result.socketId_ = null; return this; } public bool HasHirelingClass { - get { return result.HasHirelingClass; } + get { return result.hasHirelingClass; } } public int HirelingClass { get { return result.HirelingClass; } set { SetHirelingClass(value); } } public Builder SetHirelingClass(int value) { + PrepareBuilder(); result.hasHirelingClass = true; result.hirelingClass_ = value; return this; } public Builder ClearHirelingClass() { + PrepareBuilder(); result.hasHirelingClass = false; result.hirelingClass_ = 0; return this; } public bool HasItemSlot { - get { return result.HasItemSlot; } + get { return result.hasItemSlot; } } public int ItemSlot { get { return result.ItemSlot; } set { SetItemSlot(value); } } public Builder SetItemSlot(int value) { + PrepareBuilder(); result.hasItemSlot = true; result.itemSlot_ = value; return this; } public Builder ClearItemSlot() { + PrepareBuilder(); result.hasItemSlot = false; result.itemSlot_ = 0; return this; } public bool HasSquareIndex { - get { return result.HasSquareIndex; } + get { return result.hasSquareIndex; } } public int SquareIndex { get { return result.SquareIndex; } set { SetSquareIndex(value); } } public Builder SetSquareIndex(int value) { + PrepareBuilder(); result.hasSquareIndex = true; result.squareIndex_ = value; return this; } public Builder ClearSquareIndex() { + PrepareBuilder(); result.hasSquareIndex = false; result.squareIndex_ = 0; return this; } public bool HasUsedSocketCount { - get { return result.HasUsedSocketCount; } + get { return result.hasUsedSocketCount; } } public uint UsedSocketCount { get { return result.UsedSocketCount; } set { SetUsedSocketCount(value); } } public Builder SetUsedSocketCount(uint value) { + PrepareBuilder(); result.hasUsedSocketCount = true; result.usedSocketCount_ = value; return this; } public Builder ClearUsedSocketCount() { + PrepareBuilder(); result.hasUsedSocketCount = false; result.usedSocketCount_ = 0; return this; } public bool HasGenerator { - get { return result.HasGenerator; } + get { return result.hasGenerator; } } public global::D3.Items.Generator Generator { get { return result.Generator; } @@ -2241,19 +2510,22 @@ public bool HasGenerator { } public Builder SetGenerator(global::D3.Items.Generator value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasGenerator = true; result.generator_ = value; return this; } public Builder SetGenerator(global::D3.Items.Generator.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasGenerator = true; result.generator_ = builderForValue.Build(); return this; } public Builder MergeGenerator(global::D3.Items.Generator value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasGenerator && + PrepareBuilder(); + if (result.hasGenerator && result.generator_ != global::D3.Items.Generator.DefaultInstance) { result.generator_ = global::D3.Items.Generator.CreateBuilder(result.generator_).MergeFrom(value).BuildPartial(); } else { @@ -2263,8 +2535,9 @@ public Builder MergeGenerator(global::D3.Items.Generator value) { return this; } public Builder ClearGenerator() { + PrepareBuilder(); result.hasGenerator = false; - result.generator_ = global::D3.Items.Generator.DefaultInstance; + result.generator_ = null; return this; } } @@ -2273,65 +2546,60 @@ static SavedItem() { } } - public sealed partial class AuctionAccountInfo : pb::GeneratedMessage { - private static readonly AuctionAccountInfo defaultInstance = new Builder().BuildPartial(); - public static AuctionAccountInfo DefaultInstance { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ItemList : pb::GeneratedMessage { + private ItemList() { } + private static readonly ItemList defaultInstance = new ItemList().MakeReadOnly(); + private static readonly string[] _itemListFieldNames = new string[] { "items" }; + private static readonly uint[] _itemListFieldTags = new uint[] { 10 }; + public static ItemList DefaultInstance { get { return defaultInstance; } } - public override AuctionAccountInfo DefaultInstanceForType { - get { return defaultInstance; } + public override ItemList DefaultInstanceForType { + get { return DefaultInstance; } } - protected override AuctionAccountInfo ThisMessage { + protected override ItemList ThisMessage { get { return this; } } public static pbd::MessageDescriptor Descriptor { - get { return global::D3.Items.Items.internal__static_D3_Items_AuctionAccountInfo__Descriptor; } + get { return global::D3.Items.Items.internal__static_D3_Items_ItemList__Descriptor; } } - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::D3.Items.Items.internal__static_D3_Items_AuctionAccountInfo__FieldAccessorTable; } + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.Items.Items.internal__static_D3_Items_ItemList__FieldAccessorTable; } } - public const int AccountIdFieldNumber = 1; - private bool hasAccountId; - private global::D3.OnlineService.EntityId accountId_ = global::D3.OnlineService.EntityId.DefaultInstance; - public bool HasAccountId { - get { return hasAccountId; } - } - public global::D3.OnlineService.EntityId AccountId { - get { return accountId_; } + public const int ItemsFieldNumber = 1; + private pbc::PopsicleList items_ = new pbc::PopsicleList(); + public scg::IList ItemsList { + get { return items_; } } - - public const int EscrowIdFieldNumber = 2; - private bool hasEscrowId; - private global::D3.OnlineService.EntityId escrowId_ = global::D3.OnlineService.EntityId.DefaultInstance; - public bool HasEscrowId { - get { return hasEscrowId; } + public int ItemsCount { + get { return items_.Count; } } - public global::D3.OnlineService.EntityId EscrowId { - get { return escrowId_; } + public global::D3.Items.SavedItem GetItems(int index) { + return items_[index]; } public override bool IsInitialized { get { - if (!hasAccountId) return false; - if (!hasEscrowId) return false; - if (!AccountId.IsInitialized) return false; - if (!EscrowId.IsInitialized) return false; + foreach (global::D3.Items.SavedItem element in ItemsList) { + if (!element.IsInitialized) return false; + } return true; } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasAccountId) { - output.WriteMessage(1, AccountId); - } - if (HasEscrowId) { - output.WriteMessage(2, EscrowId); + string[] field_names = _itemListFieldNames; + if (items_.Count > 0) { + output.WriteMessageArray(1, field_names[0], items_); } UnknownFields.WriteTo(output); } @@ -2343,11 +2611,8 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAccountId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, AccountId); - } - if (HasEscrowId) { - size += pb::CodedOutputStream.ComputeMessageSize(2, EscrowId); + foreach (global::D3.Items.SavedItem element in ItemsList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -2355,116 +2620,159 @@ public override int SerializedSize { } } - public static AuctionAccountInfo ParseFrom(pb::ByteString data) { + public static ItemList ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static AuctionAccountInfo ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static ItemList ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static AuctionAccountInfo ParseFrom(byte[] data) { + public static ItemList ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static AuctionAccountInfo ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static ItemList ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static AuctionAccountInfo ParseFrom(global::System.IO.Stream input) { + public static ItemList ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static AuctionAccountInfo ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static ItemList ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } - public static AuctionAccountInfo ParseDelimitedFrom(global::System.IO.Stream input) { + public static ItemList ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static AuctionAccountInfo ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static ItemList ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static AuctionAccountInfo ParseFrom(pb::CodedInputStream input) { + public static ItemList ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static AuctionAccountInfo ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static ItemList ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private ItemList MakeReadOnly() { + items_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(AuctionAccountInfo prototype) { - return (Builder) new Builder().MergeFrom(prototype); + public static Builder CreateBuilder(ItemList prototype) { + return new Builder(prototype); } - public sealed partial class Builder : pb::GeneratedBuilder { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ItemList cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ItemList result; + + private ItemList PrepareBuilder() { + if (resultIsReadOnly) { + ItemList original = result; + result = new ItemList(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - AuctionAccountInfo result = new AuctionAccountInfo(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } - protected override AuctionAccountInfo MessageBeingBuilt { - get { return result; } + protected override ItemList MessageBeingBuilt { + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new AuctionAccountInfo(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { - get { return global::D3.Items.AuctionAccountInfo.Descriptor; } + get { return global::D3.Items.ItemList.Descriptor; } } - public override AuctionAccountInfo DefaultInstanceForType { - get { return global::D3.Items.AuctionAccountInfo.DefaultInstance; } + public override ItemList DefaultInstanceForType { + get { return global::D3.Items.ItemList.DefaultInstance; } } - public override AuctionAccountInfo BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override ItemList BuildPartial() { + if (resultIsReadOnly) { + return result; } - AuctionAccountInfo returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is AuctionAccountInfo) { - return MergeFrom((AuctionAccountInfo) other); + if (other is ItemList) { + return MergeFrom((ItemList) other); } else { base.MergeFrom(other); return this; } } - public override Builder MergeFrom(AuctionAccountInfo other) { - if (other == global::D3.Items.AuctionAccountInfo.DefaultInstance) return this; - if (other.HasAccountId) { - MergeAccountId(other.AccountId); - } - if (other.HasEscrowId) { - MergeEscrowId(other.EscrowId); + public override Builder MergeFrom(ItemList other) { + if (other == global::D3.Items.ItemList.DefaultInstance) return this; + PrepareBuilder(); + if (other.items_.Count != 0) { + result.items_.Add(other.items_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_itemListFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _itemListFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -2476,1309 +2784,68 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { - global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); - if (HasAccountId) { - subBuilder.MergeFrom(AccountId); - } - input.ReadMessage(subBuilder, extensionRegistry); - AccountId = subBuilder.BuildPartial(); - break; - } - case 18: { - global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); - if (HasEscrowId) { - subBuilder.MergeFrom(EscrowId); - } - input.ReadMessage(subBuilder, extensionRegistry); - EscrowId = subBuilder.BuildPartial(); + input.ReadMessageArray(tag, field_name, result.items_, global::D3.Items.SavedItem.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } - public bool HasAccountId { - get { return result.HasAccountId; } - } - public global::D3.OnlineService.EntityId AccountId { - get { return result.AccountId; } - set { SetAccountId(value); } + public pbc::IPopsicleList ItemsList { + get { return PrepareBuilder().items_; } } - public Builder SetAccountId(global::D3.OnlineService.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasAccountId = true; - result.accountId_ = value; - return this; + public int ItemsCount { + get { return result.ItemsCount; } } - public Builder SetAccountId(global::D3.OnlineService.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasAccountId = true; - result.accountId_ = builderForValue.Build(); - return this; + public global::D3.Items.SavedItem GetItems(int index) { + return result.GetItems(index); } - public Builder MergeAccountId(global::D3.OnlineService.EntityId value) { + public Builder SetItems(int index, global::D3.Items.SavedItem value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAccountId && - result.accountId_ != global::D3.OnlineService.EntityId.DefaultInstance) { - result.accountId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.accountId_).MergeFrom(value).BuildPartial(); - } else { - result.accountId_ = value; - } - result.hasAccountId = true; + PrepareBuilder(); + result.items_[index] = value; return this; } - public Builder ClearAccountId() { - result.hasAccountId = false; - result.accountId_ = global::D3.OnlineService.EntityId.DefaultInstance; + public Builder SetItems(int index, global::D3.Items.SavedItem.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.items_[index] = builderForValue.Build(); return this; } - - public bool HasEscrowId { - get { return result.HasEscrowId; } - } - public global::D3.OnlineService.EntityId EscrowId { - get { return result.EscrowId; } - set { SetEscrowId(value); } - } - public Builder SetEscrowId(global::D3.OnlineService.EntityId value) { + public Builder AddItems(global::D3.Items.SavedItem value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasEscrowId = true; - result.escrowId_ = value; + PrepareBuilder(); + result.items_.Add(value); return this; } - public Builder SetEscrowId(global::D3.OnlineService.EntityId.Builder builderForValue) { + public Builder AddItems(global::D3.Items.SavedItem.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasEscrowId = true; - result.escrowId_ = builderForValue.Build(); + PrepareBuilder(); + result.items_.Add(builderForValue.Build()); return this; } - public Builder MergeEscrowId(global::D3.OnlineService.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasEscrowId && - result.escrowId_ != global::D3.OnlineService.EntityId.DefaultInstance) { - result.escrowId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.escrowId_).MergeFrom(value).BuildPartial(); - } else { - result.escrowId_ = value; - } - result.hasEscrowId = true; + public Builder AddRangeItems(scg::IEnumerable values) { + PrepareBuilder(); + result.items_.Add(values); return this; } - public Builder ClearEscrowId() { - result.hasEscrowId = false; - result.escrowId_ = global::D3.OnlineService.EntityId.DefaultInstance; + public Builder ClearItems() { + PrepareBuilder(); + result.items_.Clear(); return this; } } - static AuctionAccountInfo() { - object.ReferenceEquals(global::D3.Items.Items.Descriptor, null); - } - } - - public sealed partial class AuctionItem : pb::GeneratedMessage { - private static readonly AuctionItem defaultInstance = new Builder().BuildPartial(); - public static AuctionItem DefaultInstance { - get { return defaultInstance; } - } - - public override AuctionItem DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override AuctionItem ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::D3.Items.Items.internal__static_D3_Items_AuctionItem__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::D3.Items.Items.internal__static_D3_Items_AuctionItem__FieldAccessorTable; } - } - - public const int IdFieldNumber = 1; - private bool hasId; - private global::D3.OnlineService.ItemId id_ = global::D3.OnlineService.ItemId.DefaultInstance; - public bool HasId { - get { return hasId; } - } - public global::D3.OnlineService.ItemId Id { - get { return id_; } - } - - public const int GeneratorFieldNumber = 2; - private bool hasGenerator; - private global::D3.Items.Generator generator_ = global::D3.Items.Generator.DefaultInstance; - public bool HasGenerator { - get { return hasGenerator; } - } - public global::D3.Items.Generator Generator { - get { return generator_; } - } - - public override bool IsInitialized { - get { - if (!hasId) return false; - if (!hasGenerator) return false; - if (!Id.IsInitialized) return false; - if (!Generator.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasId) { - output.WriteMessage(1, Id); - } - if (HasGenerator) { - output.WriteMessage(2, Generator); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Id); - } - if (HasGenerator) { - size += pb::CodedOutputStream.ComputeMessageSize(2, Generator); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static AuctionItem ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static AuctionItem ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static AuctionItem ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static AuctionItem ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static AuctionItem ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static AuctionItem ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static AuctionItem ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static AuctionItem ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static AuctionItem ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static AuctionItem ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(AuctionItem prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - AuctionItem result = new AuctionItem(); - - protected override AuctionItem MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new AuctionItem(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::D3.Items.AuctionItem.Descriptor; } - } - - public override AuctionItem DefaultInstanceForType { - get { return global::D3.Items.AuctionItem.DefaultInstance; } - } - - public override AuctionItem BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - AuctionItem returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is AuctionItem) { - return MergeFrom((AuctionItem) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(AuctionItem other) { - if (other == global::D3.Items.AuctionItem.DefaultInstance) return this; - if (other.HasId) { - MergeId(other.Id); - } - if (other.HasGenerator) { - MergeGenerator(other.Generator); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::D3.OnlineService.ItemId.Builder subBuilder = global::D3.OnlineService.ItemId.CreateBuilder(); - if (HasId) { - subBuilder.MergeFrom(Id); - } - input.ReadMessage(subBuilder, extensionRegistry); - Id = subBuilder.BuildPartial(); - break; - } - case 18: { - global::D3.Items.Generator.Builder subBuilder = global::D3.Items.Generator.CreateBuilder(); - if (HasGenerator) { - subBuilder.MergeFrom(Generator); - } - input.ReadMessage(subBuilder, extensionRegistry); - Generator = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasId { - get { return result.HasId; } - } - public global::D3.OnlineService.ItemId Id { - get { return result.Id; } - set { SetId(value); } - } - public Builder SetId(global::D3.OnlineService.ItemId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasId = true; - result.id_ = value; - return this; - } - public Builder SetId(global::D3.OnlineService.ItemId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasId = true; - result.id_ = builderForValue.Build(); - return this; - } - public Builder MergeId(global::D3.OnlineService.ItemId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasId && - result.id_ != global::D3.OnlineService.ItemId.DefaultInstance) { - result.id_ = global::D3.OnlineService.ItemId.CreateBuilder(result.id_).MergeFrom(value).BuildPartial(); - } else { - result.id_ = value; - } - result.hasId = true; - return this; - } - public Builder ClearId() { - result.hasId = false; - result.id_ = global::D3.OnlineService.ItemId.DefaultInstance; - return this; - } - - public bool HasGenerator { - get { return result.HasGenerator; } - } - public global::D3.Items.Generator Generator { - get { return result.Generator; } - set { SetGenerator(value); } - } - public Builder SetGenerator(global::D3.Items.Generator value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasGenerator = true; - result.generator_ = value; - return this; - } - public Builder SetGenerator(global::D3.Items.Generator.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasGenerator = true; - result.generator_ = builderForValue.Build(); - return this; - } - public Builder MergeGenerator(global::D3.Items.Generator value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasGenerator && - result.generator_ != global::D3.Items.Generator.DefaultInstance) { - result.generator_ = global::D3.Items.Generator.CreateBuilder(result.generator_).MergeFrom(value).BuildPartial(); - } else { - result.generator_ = value; - } - result.hasGenerator = true; - return this; - } - public Builder ClearGenerator() { - result.hasGenerator = false; - result.generator_ = global::D3.Items.Generator.DefaultInstance; - return this; - } - } - static AuctionItem() { - object.ReferenceEquals(global::D3.Items.Items.Descriptor, null); - } - } - - public sealed partial class AuctionInfo : pb::GeneratedMessage { - private static readonly AuctionInfo defaultInstance = new Builder().BuildPartial(); - public static AuctionInfo DefaultInstance { - get { return defaultInstance; } - } - - public override AuctionInfo DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override AuctionInfo ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::D3.Items.Items.internal__static_D3_Items_AuctionInfo__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::D3.Items.Items.internal__static_D3_Items_AuctionInfo__FieldAccessorTable; } - } - - public const int IdFieldNumber = 1; - private bool hasId; - private global::D3.OnlineService.ItemId id_ = global::D3.OnlineService.ItemId.DefaultInstance; - public bool HasId { - get { return hasId; } - } - public global::D3.OnlineService.ItemId Id { - get { return id_; } - } - - public const int OwnerFieldNumber = 2; - private bool hasOwner; - private global::D3.Items.Ownership owner_ = global::D3.Items.Ownership.DefaultInstance; - public bool HasOwner { - get { return hasOwner; } - } - public global::D3.Items.Ownership Owner { - get { return owner_; } - } - - public override bool IsInitialized { - get { - if (!hasId) return false; - if (!Id.IsInitialized) return false; - if (HasOwner) { - if (!Owner.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasId) { - output.WriteMessage(1, Id); - } - if (HasOwner) { - output.WriteMessage(2, Owner); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Id); - } - if (HasOwner) { - size += pb::CodedOutputStream.ComputeMessageSize(2, Owner); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static AuctionInfo ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static AuctionInfo ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static AuctionInfo ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static AuctionInfo ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static AuctionInfo ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static AuctionInfo ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static AuctionInfo ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static AuctionInfo ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static AuctionInfo ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static AuctionInfo ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(AuctionInfo prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - AuctionInfo result = new AuctionInfo(); - - protected override AuctionInfo MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new AuctionInfo(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::D3.Items.AuctionInfo.Descriptor; } - } - - public override AuctionInfo DefaultInstanceForType { - get { return global::D3.Items.AuctionInfo.DefaultInstance; } - } - - public override AuctionInfo BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - AuctionInfo returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is AuctionInfo) { - return MergeFrom((AuctionInfo) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(AuctionInfo other) { - if (other == global::D3.Items.AuctionInfo.DefaultInstance) return this; - if (other.HasId) { - MergeId(other.Id); - } - if (other.HasOwner) { - MergeOwner(other.Owner); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::D3.OnlineService.ItemId.Builder subBuilder = global::D3.OnlineService.ItemId.CreateBuilder(); - if (HasId) { - subBuilder.MergeFrom(Id); - } - input.ReadMessage(subBuilder, extensionRegistry); - Id = subBuilder.BuildPartial(); - break; - } - case 18: { - global::D3.Items.Ownership.Builder subBuilder = global::D3.Items.Ownership.CreateBuilder(); - if (HasOwner) { - subBuilder.MergeFrom(Owner); - } - input.ReadMessage(subBuilder, extensionRegistry); - Owner = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasId { - get { return result.HasId; } - } - public global::D3.OnlineService.ItemId Id { - get { return result.Id; } - set { SetId(value); } - } - public Builder SetId(global::D3.OnlineService.ItemId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasId = true; - result.id_ = value; - return this; - } - public Builder SetId(global::D3.OnlineService.ItemId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasId = true; - result.id_ = builderForValue.Build(); - return this; - } - public Builder MergeId(global::D3.OnlineService.ItemId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasId && - result.id_ != global::D3.OnlineService.ItemId.DefaultInstance) { - result.id_ = global::D3.OnlineService.ItemId.CreateBuilder(result.id_).MergeFrom(value).BuildPartial(); - } else { - result.id_ = value; - } - result.hasId = true; - return this; - } - public Builder ClearId() { - result.hasId = false; - result.id_ = global::D3.OnlineService.ItemId.DefaultInstance; - return this; - } - - public bool HasOwner { - get { return result.HasOwner; } - } - public global::D3.Items.Ownership Owner { - get { return result.Owner; } - set { SetOwner(value); } - } - public Builder SetOwner(global::D3.Items.Ownership value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasOwner = true; - result.owner_ = value; - return this; - } - public Builder SetOwner(global::D3.Items.Ownership.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasOwner = true; - result.owner_ = builderForValue.Build(); - return this; - } - public Builder MergeOwner(global::D3.Items.Ownership value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasOwner && - result.owner_ != global::D3.Items.Ownership.DefaultInstance) { - result.owner_ = global::D3.Items.Ownership.CreateBuilder(result.owner_).MergeFrom(value).BuildPartial(); - } else { - result.owner_ = value; - } - result.hasOwner = true; - return this; - } - public Builder ClearOwner() { - result.hasOwner = false; - result.owner_ = global::D3.Items.Ownership.DefaultInstance; - return this; - } - } - static AuctionInfo() { - object.ReferenceEquals(global::D3.Items.Items.Descriptor, null); - } - } - - public sealed partial class ItemList : pb::GeneratedMessage { - private static readonly ItemList defaultInstance = new Builder().BuildPartial(); - public static ItemList DefaultInstance { - get { return defaultInstance; } - } - - public override ItemList DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ItemList ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::D3.Items.Items.internal__static_D3_Items_ItemList__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::D3.Items.Items.internal__static_D3_Items_ItemList__FieldAccessorTable; } - } - - public const int ItemsFieldNumber = 1; - private pbc::PopsicleList items_ = new pbc::PopsicleList(); - public scg::IList ItemsList { - get { return items_; } - } - public int ItemsCount { - get { return items_.Count; } - } - public global::D3.Items.SavedItem GetItems(int index) { - return items_[index]; - } - - public override bool IsInitialized { - get { - foreach (global::D3.Items.SavedItem element in ItemsList) { - if (!element.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - foreach (global::D3.Items.SavedItem element in ItemsList) { - output.WriteMessage(1, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::D3.Items.SavedItem element in ItemsList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ItemList ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ItemList ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ItemList ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ItemList ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ItemList ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ItemList ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ItemList ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ItemList ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ItemList ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ItemList ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ItemList prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ItemList result = new ItemList(); - - protected override ItemList MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ItemList(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::D3.Items.ItemList.Descriptor; } - } - - public override ItemList DefaultInstanceForType { - get { return global::D3.Items.ItemList.DefaultInstance; } - } - - public override ItemList BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.items_.MakeReadOnly(); - ItemList returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ItemList) { - return MergeFrom((ItemList) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ItemList other) { - if (other == global::D3.Items.ItemList.DefaultInstance) return this; - if (other.items_.Count != 0) { - base.AddRange(other.items_, result.items_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::D3.Items.SavedItem.Builder subBuilder = global::D3.Items.SavedItem.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddItems(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public pbc::IPopsicleList ItemsList { - get { return result.items_; } - } - public int ItemsCount { - get { return result.ItemsCount; } - } - public global::D3.Items.SavedItem GetItems(int index) { - return result.GetItems(index); - } - public Builder SetItems(int index, global::D3.Items.SavedItem value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.items_[index] = value; - return this; - } - public Builder SetItems(int index, global::D3.Items.SavedItem.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.items_[index] = builderForValue.Build(); - return this; - } - public Builder AddItems(global::D3.Items.SavedItem value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.items_.Add(value); - return this; - } - public Builder AddItems(global::D3.Items.SavedItem.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.items_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeItems(scg::IEnumerable values) { - base.AddRange(values, result.items_); - return this; - } - public Builder ClearItems() { - result.items_.Clear(); - return this; - } - } - static ItemList() { - object.ReferenceEquals(global::D3.Items.Items.Descriptor, null); - } - } - - public sealed partial class Ownership : pb::GeneratedMessage { - private static readonly Ownership defaultInstance = new Builder().BuildPartial(); - public static Ownership DefaultInstance { - get { return defaultInstance; } - } - - public override Ownership DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override Ownership ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::D3.Items.Items.internal__static_D3_Items_Ownership__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::D3.Items.Items.internal__static_D3_Items_Ownership__FieldAccessorTable; } - } - - public const int OwnerEntityIdFieldNumber = 1; - private bool hasOwnerEntityId; - private global::D3.OnlineService.EntityId ownerEntityId_ = global::D3.OnlineService.EntityId.DefaultInstance; - public bool HasOwnerEntityId { - get { return hasOwnerEntityId; } - } - public global::D3.OnlineService.EntityId OwnerEntityId { - get { return ownerEntityId_; } - } - - public const int DeleteTimeFieldNumber = 2; - private bool hasDeleteTime; - private long deleteTime_ = 0; - public bool HasDeleteTime { - get { return hasDeleteTime; } - } - public long DeleteTime { - get { return deleteTime_; } - } - - public const int EscrowIdFieldNumber = 3; - private bool hasEscrowId; - private global::D3.OnlineService.EntityId escrowId_ = global::D3.OnlineService.EntityId.DefaultInstance; - public bool HasEscrowId { - get { return hasEscrowId; } - } - public global::D3.OnlineService.EntityId EscrowId { - get { return escrowId_; } - } - - public override bool IsInitialized { - get { - if (!hasOwnerEntityId) return false; - if (!OwnerEntityId.IsInitialized) return false; - if (HasEscrowId) { - if (!EscrowId.IsInitialized) return false; - } - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasOwnerEntityId) { - output.WriteMessage(1, OwnerEntityId); - } - if (HasDeleteTime) { - output.WriteSInt64(2, DeleteTime); - } - if (HasEscrowId) { - output.WriteMessage(3, EscrowId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasOwnerEntityId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, OwnerEntityId); - } - if (HasDeleteTime) { - size += pb::CodedOutputStream.ComputeSInt64Size(2, DeleteTime); - } - if (HasEscrowId) { - size += pb::CodedOutputStream.ComputeMessageSize(3, EscrowId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static Ownership ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Ownership ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Ownership ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Ownership ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Ownership ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Ownership ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Ownership ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Ownership ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Ownership ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Ownership ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Ownership prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - Ownership result = new Ownership(); - - protected override Ownership MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new Ownership(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::D3.Items.Ownership.Descriptor; } - } - - public override Ownership DefaultInstanceForType { - get { return global::D3.Items.Ownership.DefaultInstance; } - } - - public override Ownership BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - Ownership returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Ownership) { - return MergeFrom((Ownership) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Ownership other) { - if (other == global::D3.Items.Ownership.DefaultInstance) return this; - if (other.HasOwnerEntityId) { - MergeOwnerEntityId(other.OwnerEntityId); - } - if (other.HasDeleteTime) { - DeleteTime = other.DeleteTime; - } - if (other.HasEscrowId) { - MergeEscrowId(other.EscrowId); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); - if (HasOwnerEntityId) { - subBuilder.MergeFrom(OwnerEntityId); - } - input.ReadMessage(subBuilder, extensionRegistry); - OwnerEntityId = subBuilder.BuildPartial(); - break; - } - case 16: { - DeleteTime = input.ReadSInt64(); - break; - } - case 26: { - global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); - if (HasEscrowId) { - subBuilder.MergeFrom(EscrowId); - } - input.ReadMessage(subBuilder, extensionRegistry); - EscrowId = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasOwnerEntityId { - get { return result.HasOwnerEntityId; } - } - public global::D3.OnlineService.EntityId OwnerEntityId { - get { return result.OwnerEntityId; } - set { SetOwnerEntityId(value); } - } - public Builder SetOwnerEntityId(global::D3.OnlineService.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasOwnerEntityId = true; - result.ownerEntityId_ = value; - return this; - } - public Builder SetOwnerEntityId(global::D3.OnlineService.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasOwnerEntityId = true; - result.ownerEntityId_ = builderForValue.Build(); - return this; - } - public Builder MergeOwnerEntityId(global::D3.OnlineService.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasOwnerEntityId && - result.ownerEntityId_ != global::D3.OnlineService.EntityId.DefaultInstance) { - result.ownerEntityId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.ownerEntityId_).MergeFrom(value).BuildPartial(); - } else { - result.ownerEntityId_ = value; - } - result.hasOwnerEntityId = true; - return this; - } - public Builder ClearOwnerEntityId() { - result.hasOwnerEntityId = false; - result.ownerEntityId_ = global::D3.OnlineService.EntityId.DefaultInstance; - return this; - } - - public bool HasDeleteTime { - get { return result.HasDeleteTime; } - } - public long DeleteTime { - get { return result.DeleteTime; } - set { SetDeleteTime(value); } - } - public Builder SetDeleteTime(long value) { - result.hasDeleteTime = true; - result.deleteTime_ = value; - return this; - } - public Builder ClearDeleteTime() { - result.hasDeleteTime = false; - result.deleteTime_ = 0; - return this; - } - - public bool HasEscrowId { - get { return result.HasEscrowId; } - } - public global::D3.OnlineService.EntityId EscrowId { - get { return result.EscrowId; } - set { SetEscrowId(value); } - } - public Builder SetEscrowId(global::D3.OnlineService.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasEscrowId = true; - result.escrowId_ = value; - return this; - } - public Builder SetEscrowId(global::D3.OnlineService.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasEscrowId = true; - result.escrowId_ = builderForValue.Build(); - return this; - } - public Builder MergeEscrowId(global::D3.OnlineService.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasEscrowId && - result.escrowId_ != global::D3.OnlineService.EntityId.DefaultInstance) { - result.escrowId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.escrowId_).MergeFrom(value).BuildPartial(); - } else { - result.escrowId_ = value; - } - result.hasEscrowId = true; - return this; - } - public Builder ClearEscrowId() { - result.hasEscrowId = false; - result.escrowId_ = global::D3.OnlineService.EntityId.DefaultInstance; - return this; - } - } - static Ownership() { + static ItemList() { object.ReferenceEquals(global::D3.Items.Items.Descriptor, null); } } @@ -3786,3 +2853,5 @@ static Ownership() { #endregion } + +#endregion Designer generated code diff --git a/source/D3Proto/D3/OnlineService/OnlineService.cs b/src/LibMooNet/D3/OnlineService/OnlineService.cs similarity index 66% rename from source/D3Proto/D3/OnlineService/OnlineService.cs rename to src/LibMooNet/D3/OnlineService/OnlineService.cs index 16e8b41d..b066bf84 100644 --- a/source/D3Proto/D3/OnlineService/OnlineService.cs +++ b/src/LibMooNet/D3/OnlineService/OnlineService.cs @@ -1,4 +1,6 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code using pb = global::Google.ProtocolBuffers; using pbc = global::Google.ProtocolBuffers.Collections; @@ -6,6 +8,9 @@ using scg = global::System.Collections.Generic; namespace D3.OnlineService { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public static partial class OnlineService { #region Extension registration @@ -36,23 +41,24 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { static OnlineService() { byte[] descriptorData = global::System.Convert.FromBase64String( - "ChNPbmxpbmVTZXJ2aWNlLnByb3RvEhBEMy5PbmxpbmVTZXJ2aWNlIisKCEVu" + - "dGl0eUlkEg8KB2lkX2hpZ2gYASACKAQSDgoGaWRfbG93GAIgAigEIjoKBkdh" + - "bWVJZBIPCgdmYWN0b3J5GAEgAigEEg8KB2lkX2hpZ2gYAiACKAQSDgoGaWRf" + - "bG93GAMgAigEIikKBkl0ZW1JZBIPCgdpZF9oaWdoGAEgAigEEg4KBmlkX2xv" + - "dxgCIAIoBCLbAQoQQ29vcENyZWF0ZVBhcmFtcxIYChBkaWZmaWN1bHR5X2xl" + - "dmVsGAEgAigFEgsKA2FjdBgCIAIoERIRCglzbm9fcXVlc3QYAyACKA8SFQoN" + - "cXVlc3Rfc3RlcF9pZBgEIAIoBRI8ChhyZXN1bWVfZnJvbV9zYXZlX2hlcm9f" + - "aWQYBSABKAsyGi5EMy5PbmxpbmVTZXJ2aWNlLkVudGl0eUlkEhcKD29wZW5f" + - "dG9fZnJpZW5kcxgGIAIoCBIfChdvcGVuX3RvX2ZyaWVuZHNfbWVzc2FnZRgH" + - "IAEoCSIkCg9QdlBDcmVhdGVQYXJhbXMSEQoJc25vX3dvcmxkGAEgAigPIsEB" + - "ChBHYW1lQ3JlYXRlUGFyYW1zEhEKCWdhbWVfdHlwZRgBIAIoERIWCg5jcmVh" + - "dGlvbl9mbGFncxgCIAIoDRIwCgRjb29wGAMgASgLMiIuRDMuT25saW5lU2Vy" + - "dmljZS5Db29wQ3JlYXRlUGFyYW1zEi4KA3B2cBgEIAEoCzIhLkQzLk9ubGlu" + - "ZVNlcnZpY2UuUHZQQ3JlYXRlUGFyYW1zEgwKBG5hbWUYBSABKAkSEgoKaXNf" + - "cHJpdmF0ZRgGIAIoCCJOChBIZXJvQ3JlYXRlUGFyYW1zEhIKCmdiaWRfY2xh" + - "c3MYASACKA8SEwoLaXNfaGFyZGNvcmUYAiACKAgSEQoJaXNfZmVtYWxlGAMg" + - "AigI"); + "ChNPbmxpbmVTZXJ2aWNlLnByb3RvEhBEMy5PbmxpbmVTZXJ2aWNlIjEKCEVu" + + "dGl0eUlkEhIKB2lkX2hpZ2gYASACKAQ6ATASEQoGaWRfbG93GAIgAigEOgEw" + + "IkMKBkdhbWVJZBISCgdmYWN0b3J5GAEgAigEOgEwEhIKB2lkX2hpZ2gYAiAC" + + "KAQ6ATASEQoGaWRfbG93GAMgAigEOgEwIi8KBkl0ZW1JZBISCgdpZF9oaWdo" + + "GAEgAigEOgEwEhEKBmlkX2xvdxgCIAIoBDoBMCLxAQoQQ29vcENyZWF0ZVBh" + + "cmFtcxIcChBkaWZmaWN1bHR5X2xldmVsGAEgAigFOgItMRIOCgNhY3QYAiAC" + + "KBE6ATASFQoJc25vX3F1ZXN0GAMgAigPOgItMRIZCg1xdWVzdF9zdGVwX2lk" + + "GAQgAigFOgItMRI8ChhyZXN1bWVfZnJvbV9zYXZlX2hlcm9faWQYBSABKAsy" + + "Gi5EMy5PbmxpbmVTZXJ2aWNlLkVudGl0eUlkEh4KD29wZW5fdG9fZnJpZW5k" + + "cxgGIAIoCDoFZmFsc2USHwoXb3Blbl90b19mcmllbmRzX21lc3NhZ2UYByAB" + + "KAkiKAoPUHZQQ3JlYXRlUGFyYW1zEhUKCXNub193b3JsZBgBIAIoDzoCLTEi" + + "sAEKEEdhbWVDcmVhdGVQYXJhbXMSEQoJZ2FtZV90eXBlGAEgAigREhkKDmNy" + + "ZWF0aW9uX2ZsYWdzGAIgAigNOgEwEjAKBGNvb3AYAyABKAsyIi5EMy5Pbmxp" + + "bmVTZXJ2aWNlLkNvb3BDcmVhdGVQYXJhbXMSLgoDcHZwGAQgASgLMiEuRDMu" + + "T25saW5lU2VydmljZS5QdlBDcmVhdGVQYXJhbXMSDAoEbmFtZRgFIAEoCSJu" + + "ChBIZXJvQ3JlYXRlUGFyYW1zEgwKBG5hbWUYASACKAkSFgoKZ2JpZF9jbGFz" + + "cxgCIAIoDzoCLTESGgoLaXNfaGFyZGNvcmUYAyACKAg6BWZhbHNlEhgKCWlz" + + "X2ZlbWFsZRgEIAIoCDoFZmFsc2U="); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_D3_OnlineService_EntityId__Descriptor = Descriptor.MessageTypes[0]; @@ -78,11 +84,11 @@ static OnlineService() { internal__static_D3_OnlineService_GameCreateParams__Descriptor = Descriptor.MessageTypes[5]; internal__static_D3_OnlineService_GameCreateParams__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_D3_OnlineService_GameCreateParams__Descriptor, - new string[] { "GameType", "CreationFlags", "Coop", "Pvp", "Name", "IsPrivate", }); + new string[] { "GameType", "CreationFlags", "Coop", "Pvp", "Name", }); internal__static_D3_OnlineService_HeroCreateParams__Descriptor = Descriptor.MessageTypes[6]; internal__static_D3_OnlineService_HeroCreateParams__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_D3_OnlineService_HeroCreateParams__Descriptor, - new string[] { "GbidClass", "IsHardcore", "IsFemale", }); + new string[] { "Name", "GbidClass", "IsHardcore", "IsFemale", }); return null; }; pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, @@ -93,14 +99,20 @@ static OnlineService() { } #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class EntityId : pb::GeneratedMessage { - private static readonly EntityId defaultInstance = new Builder().BuildPartial(); + private EntityId() { } + private static readonly EntityId defaultInstance = new EntityId().MakeReadOnly(); + private static readonly string[] _entityIdFieldNames = new string[] { "id_high", "id_low" }; + private static readonly uint[] _entityIdFieldTags = new uint[] { 8, 16 }; public static EntityId DefaultInstance { get { return defaultInstance; } } public override EntityId DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override EntityId ThisMessage { @@ -117,7 +129,7 @@ protected override EntityId ThisMessage { public const int IdHighFieldNumber = 1; private bool hasIdHigh; - private ulong idHigh_ = 0UL; + private ulong idHigh_; public bool HasIdHigh { get { return hasIdHigh; } } @@ -127,7 +139,7 @@ public ulong IdHigh { public const int IdLowFieldNumber = 2; private bool hasIdLow; - private ulong idLow_ = 0UL; + private ulong idLow_; public bool HasIdLow { get { return hasIdLow; } } @@ -143,13 +155,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasIdHigh) { - output.WriteUInt64(1, IdHigh); + string[] field_names = _entityIdFieldNames; + if (hasIdHigh) { + output.WriteUInt64(1, field_names[0], IdHigh); } - if (HasIdLow) { - output.WriteUInt64(2, IdLow); + if (hasIdLow) { + output.WriteUInt64(2, field_names[1], IdLow); } UnknownFields.WriteTo(output); } @@ -161,10 +174,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasIdHigh) { + if (hasIdHigh) { size += pb::CodedOutputStream.ComputeUInt64Size(1, IdHigh); } - if (HasIdLow) { + if (hasIdLow) { size += pb::CodedOutputStream.ComputeUInt64Size(2, IdLow); } size += UnknownFields.SerializedSize; @@ -197,38 +210,72 @@ public static EntityId ParseDelimitedFrom(global::System.IO.Stream input) { public static EntityId ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static EntityId ParseFrom(pb::CodedInputStream input) { + public static EntityId ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static EntityId ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static EntityId ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private EntityId MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(EntityId prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(EntityId cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - EntityId result = new EntityId(); + private bool resultIsReadOnly; + private EntityId result; + + private EntityId PrepareBuilder() { + if (resultIsReadOnly) { + EntityId original = result; + result = new EntityId(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override EntityId MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new EntityId(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -240,12 +287,11 @@ public override EntityId DefaultInstanceForType { } public override EntityId BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - EntityId returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -259,6 +305,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(EntityId other) { if (other == global::D3.OnlineService.EntityId.DefaultInstance) return this; + PrepareBuilder(); if (other.HasIdHigh) { IdHigh = other.IdHigh; } @@ -269,20 +316,31 @@ public override Builder MergeFrom(EntityId other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_entityIdFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _entityIdFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -294,53 +352,62 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 8: { - IdHigh = input.ReadUInt64(); + result.hasIdHigh = input.ReadUInt64(ref result.idHigh_); break; } case 16: { - IdLow = input.ReadUInt64(); + result.hasIdLow = input.ReadUInt64(ref result.idLow_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasIdHigh { - get { return result.HasIdHigh; } + get { return result.hasIdHigh; } } public ulong IdHigh { get { return result.IdHigh; } set { SetIdHigh(value); } } public Builder SetIdHigh(ulong value) { + PrepareBuilder(); result.hasIdHigh = true; result.idHigh_ = value; return this; } public Builder ClearIdHigh() { + PrepareBuilder(); result.hasIdHigh = false; result.idHigh_ = 0UL; return this; } public bool HasIdLow { - get { return result.HasIdLow; } + get { return result.hasIdLow; } } public ulong IdLow { get { return result.IdLow; } set { SetIdLow(value); } } public Builder SetIdLow(ulong value) { + PrepareBuilder(); result.hasIdLow = true; result.idLow_ = value; return this; } public Builder ClearIdLow() { + PrepareBuilder(); result.hasIdLow = false; result.idLow_ = 0UL; return this; @@ -351,14 +418,20 @@ static EntityId() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class GameId : pb::GeneratedMessage { - private static readonly GameId defaultInstance = new Builder().BuildPartial(); + private GameId() { } + private static readonly GameId defaultInstance = new GameId().MakeReadOnly(); + private static readonly string[] _gameIdFieldNames = new string[] { "factory", "id_high", "id_low" }; + private static readonly uint[] _gameIdFieldTags = new uint[] { 8, 16, 24 }; public static GameId DefaultInstance { get { return defaultInstance; } } public override GameId DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override GameId ThisMessage { @@ -375,7 +448,7 @@ protected override GameId ThisMessage { public const int FactoryFieldNumber = 1; private bool hasFactory; - private ulong factory_ = 0UL; + private ulong factory_; public bool HasFactory { get { return hasFactory; } } @@ -385,7 +458,7 @@ public ulong Factory { public const int IdHighFieldNumber = 2; private bool hasIdHigh; - private ulong idHigh_ = 0UL; + private ulong idHigh_; public bool HasIdHigh { get { return hasIdHigh; } } @@ -395,7 +468,7 @@ public ulong IdHigh { public const int IdLowFieldNumber = 3; private bool hasIdLow; - private ulong idLow_ = 0UL; + private ulong idLow_; public bool HasIdLow { get { return hasIdLow; } } @@ -412,16 +485,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasFactory) { - output.WriteUInt64(1, Factory); + string[] field_names = _gameIdFieldNames; + if (hasFactory) { + output.WriteUInt64(1, field_names[0], Factory); } - if (HasIdHigh) { - output.WriteUInt64(2, IdHigh); + if (hasIdHigh) { + output.WriteUInt64(2, field_names[1], IdHigh); } - if (HasIdLow) { - output.WriteUInt64(3, IdLow); + if (hasIdLow) { + output.WriteUInt64(3, field_names[2], IdLow); } UnknownFields.WriteTo(output); } @@ -433,13 +507,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasFactory) { + if (hasFactory) { size += pb::CodedOutputStream.ComputeUInt64Size(1, Factory); } - if (HasIdHigh) { + if (hasIdHigh) { size += pb::CodedOutputStream.ComputeUInt64Size(2, IdHigh); } - if (HasIdLow) { + if (hasIdLow) { size += pb::CodedOutputStream.ComputeUInt64Size(3, IdLow); } size += UnknownFields.SerializedSize; @@ -472,38 +546,72 @@ public static GameId ParseDelimitedFrom(global::System.IO.Stream input) { public static GameId ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static GameId ParseFrom(pb::CodedInputStream input) { + public static GameId ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static GameId ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static GameId ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private GameId MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(GameId prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GameId cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - GameId result = new GameId(); + private bool resultIsReadOnly; + private GameId result; + + private GameId PrepareBuilder() { + if (resultIsReadOnly) { + GameId original = result; + result = new GameId(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override GameId MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new GameId(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -515,12 +623,11 @@ public override GameId DefaultInstanceForType { } public override GameId BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - GameId returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -534,6 +641,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(GameId other) { if (other == global::D3.OnlineService.GameId.DefaultInstance) return this; + PrepareBuilder(); if (other.HasFactory) { Factory = other.Factory; } @@ -547,20 +655,31 @@ public override Builder MergeFrom(GameId other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_gameIdFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _gameIdFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -572,75 +691,86 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 8: { - Factory = input.ReadUInt64(); + result.hasFactory = input.ReadUInt64(ref result.factory_); break; } case 16: { - IdHigh = input.ReadUInt64(); + result.hasIdHigh = input.ReadUInt64(ref result.idHigh_); break; } case 24: { - IdLow = input.ReadUInt64(); + result.hasIdLow = input.ReadUInt64(ref result.idLow_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasFactory { - get { return result.HasFactory; } + get { return result.hasFactory; } } public ulong Factory { get { return result.Factory; } set { SetFactory(value); } } public Builder SetFactory(ulong value) { + PrepareBuilder(); result.hasFactory = true; result.factory_ = value; return this; } public Builder ClearFactory() { + PrepareBuilder(); result.hasFactory = false; result.factory_ = 0UL; return this; } public bool HasIdHigh { - get { return result.HasIdHigh; } + get { return result.hasIdHigh; } } public ulong IdHigh { get { return result.IdHigh; } set { SetIdHigh(value); } } public Builder SetIdHigh(ulong value) { + PrepareBuilder(); result.hasIdHigh = true; result.idHigh_ = value; return this; } public Builder ClearIdHigh() { + PrepareBuilder(); result.hasIdHigh = false; result.idHigh_ = 0UL; return this; } public bool HasIdLow { - get { return result.HasIdLow; } + get { return result.hasIdLow; } } public ulong IdLow { get { return result.IdLow; } set { SetIdLow(value); } } public Builder SetIdLow(ulong value) { + PrepareBuilder(); result.hasIdLow = true; result.idLow_ = value; return this; } public Builder ClearIdLow() { + PrepareBuilder(); result.hasIdLow = false; result.idLow_ = 0UL; return this; @@ -651,14 +781,20 @@ static GameId() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class ItemId : pb::GeneratedMessage { - private static readonly ItemId defaultInstance = new Builder().BuildPartial(); + private ItemId() { } + private static readonly ItemId defaultInstance = new ItemId().MakeReadOnly(); + private static readonly string[] _itemIdFieldNames = new string[] { "id_high", "id_low" }; + private static readonly uint[] _itemIdFieldTags = new uint[] { 8, 16 }; public static ItemId DefaultInstance { get { return defaultInstance; } } public override ItemId DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ItemId ThisMessage { @@ -675,7 +811,7 @@ protected override ItemId ThisMessage { public const int IdHighFieldNumber = 1; private bool hasIdHigh; - private ulong idHigh_ = 0UL; + private ulong idHigh_; public bool HasIdHigh { get { return hasIdHigh; } } @@ -685,7 +821,7 @@ public ulong IdHigh { public const int IdLowFieldNumber = 2; private bool hasIdLow; - private ulong idLow_ = 0UL; + private ulong idLow_; public bool HasIdLow { get { return hasIdLow; } } @@ -701,13 +837,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasIdHigh) { - output.WriteUInt64(1, IdHigh); + string[] field_names = _itemIdFieldNames; + if (hasIdHigh) { + output.WriteUInt64(1, field_names[0], IdHigh); } - if (HasIdLow) { - output.WriteUInt64(2, IdLow); + if (hasIdLow) { + output.WriteUInt64(2, field_names[1], IdLow); } UnknownFields.WriteTo(output); } @@ -719,10 +856,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasIdHigh) { + if (hasIdHigh) { size += pb::CodedOutputStream.ComputeUInt64Size(1, IdHigh); } - if (HasIdLow) { + if (hasIdLow) { size += pb::CodedOutputStream.ComputeUInt64Size(2, IdLow); } size += UnknownFields.SerializedSize; @@ -755,38 +892,72 @@ public static ItemId ParseDelimitedFrom(global::System.IO.Stream input) { public static ItemId ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static ItemId ParseFrom(pb::CodedInputStream input) { + public static ItemId ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ItemId ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static ItemId ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private ItemId MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(ItemId prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ItemId cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ItemId result; + + private ItemId PrepareBuilder() { + if (resultIsReadOnly) { + ItemId original = result; + result = new ItemId(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - ItemId result = new ItemId(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override ItemId MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ItemId(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -798,12 +969,11 @@ public override ItemId DefaultInstanceForType { } public override ItemId BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - ItemId returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -817,6 +987,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(ItemId other) { if (other == global::D3.OnlineService.ItemId.DefaultInstance) return this; + PrepareBuilder(); if (other.HasIdHigh) { IdHigh = other.IdHigh; } @@ -827,20 +998,31 @@ public override Builder MergeFrom(ItemId other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_itemIdFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _itemIdFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -852,53 +1034,62 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 8: { - IdHigh = input.ReadUInt64(); + result.hasIdHigh = input.ReadUInt64(ref result.idHigh_); break; } case 16: { - IdLow = input.ReadUInt64(); + result.hasIdLow = input.ReadUInt64(ref result.idLow_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasIdHigh { - get { return result.HasIdHigh; } + get { return result.hasIdHigh; } } public ulong IdHigh { get { return result.IdHigh; } set { SetIdHigh(value); } } public Builder SetIdHigh(ulong value) { + PrepareBuilder(); result.hasIdHigh = true; result.idHigh_ = value; return this; } public Builder ClearIdHigh() { + PrepareBuilder(); result.hasIdHigh = false; result.idHigh_ = 0UL; return this; } public bool HasIdLow { - get { return result.HasIdLow; } + get { return result.hasIdLow; } } public ulong IdLow { get { return result.IdLow; } set { SetIdLow(value); } } public Builder SetIdLow(ulong value) { + PrepareBuilder(); result.hasIdLow = true; result.idLow_ = value; return this; } public Builder ClearIdLow() { + PrepareBuilder(); result.hasIdLow = false; result.idLow_ = 0UL; return this; @@ -909,14 +1100,20 @@ static ItemId() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class CoopCreateParams : pb::GeneratedMessage { - private static readonly CoopCreateParams defaultInstance = new Builder().BuildPartial(); + private CoopCreateParams() { } + private static readonly CoopCreateParams defaultInstance = new CoopCreateParams().MakeReadOnly(); + private static readonly string[] _coopCreateParamsFieldNames = new string[] { "act", "difficulty_level", "open_to_friends", "open_to_friends_message", "quest_step_id", "resume_from_save_hero_id", "sno_quest" }; + private static readonly uint[] _coopCreateParamsFieldTags = new uint[] { 16, 8, 48, 58, 32, 42, 29 }; public static CoopCreateParams DefaultInstance { get { return defaultInstance; } } public override CoopCreateParams DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override CoopCreateParams ThisMessage { @@ -933,7 +1130,7 @@ protected override CoopCreateParams ThisMessage { public const int DifficultyLevelFieldNumber = 1; private bool hasDifficultyLevel; - private int difficultyLevel_ = 0; + private int difficultyLevel_ = -1; public bool HasDifficultyLevel { get { return hasDifficultyLevel; } } @@ -943,7 +1140,7 @@ public int DifficultyLevel { public const int ActFieldNumber = 2; private bool hasAct; - private int act_ = 0; + private int act_; public bool HasAct { get { return hasAct; } } @@ -953,7 +1150,7 @@ public int Act { public const int SnoQuestFieldNumber = 3; private bool hasSnoQuest; - private int snoQuest_ = 0; + private int snoQuest_ = -1; public bool HasSnoQuest { get { return hasSnoQuest; } } @@ -963,7 +1160,7 @@ public int SnoQuest { public const int QuestStepIdFieldNumber = 4; private bool hasQuestStepId; - private int questStepId_ = 0; + private int questStepId_ = -1; public bool HasQuestStepId { get { return hasQuestStepId; } } @@ -973,17 +1170,17 @@ public int QuestStepId { public const int ResumeFromSaveHeroIdFieldNumber = 5; private bool hasResumeFromSaveHeroId; - private global::D3.OnlineService.EntityId resumeFromSaveHeroId_ = global::D3.OnlineService.EntityId.DefaultInstance; + private global::D3.OnlineService.EntityId resumeFromSaveHeroId_; public bool HasResumeFromSaveHeroId { get { return hasResumeFromSaveHeroId; } } public global::D3.OnlineService.EntityId ResumeFromSaveHeroId { - get { return resumeFromSaveHeroId_; } + get { return resumeFromSaveHeroId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } } public const int OpenToFriendsFieldNumber = 6; private bool hasOpenToFriends; - private bool openToFriends_ = false; + private bool openToFriends_; public bool HasOpenToFriends { get { return hasOpenToFriends; } } @@ -1015,28 +1212,29 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasDifficultyLevel) { - output.WriteInt32(1, DifficultyLevel); + string[] field_names = _coopCreateParamsFieldNames; + if (hasDifficultyLevel) { + output.WriteInt32(1, field_names[1], DifficultyLevel); } - if (HasAct) { - output.WriteSInt32(2, Act); + if (hasAct) { + output.WriteSInt32(2, field_names[0], Act); } - if (HasSnoQuest) { - output.WriteSFixed32(3, SnoQuest); + if (hasSnoQuest) { + output.WriteSFixed32(3, field_names[6], SnoQuest); } - if (HasQuestStepId) { - output.WriteInt32(4, QuestStepId); + if (hasQuestStepId) { + output.WriteInt32(4, field_names[4], QuestStepId); } - if (HasResumeFromSaveHeroId) { - output.WriteMessage(5, ResumeFromSaveHeroId); + if (hasResumeFromSaveHeroId) { + output.WriteMessage(5, field_names[5], ResumeFromSaveHeroId); } - if (HasOpenToFriends) { - output.WriteBool(6, OpenToFriends); + if (hasOpenToFriends) { + output.WriteBool(6, field_names[2], OpenToFriends); } - if (HasOpenToFriendsMessage) { - output.WriteString(7, OpenToFriendsMessage); + if (hasOpenToFriendsMessage) { + output.WriteString(7, field_names[3], OpenToFriendsMessage); } UnknownFields.WriteTo(output); } @@ -1048,25 +1246,25 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasDifficultyLevel) { + if (hasDifficultyLevel) { size += pb::CodedOutputStream.ComputeInt32Size(1, DifficultyLevel); } - if (HasAct) { + if (hasAct) { size += pb::CodedOutputStream.ComputeSInt32Size(2, Act); } - if (HasSnoQuest) { + if (hasSnoQuest) { size += pb::CodedOutputStream.ComputeSFixed32Size(3, SnoQuest); } - if (HasQuestStepId) { + if (hasQuestStepId) { size += pb::CodedOutputStream.ComputeInt32Size(4, QuestStepId); } - if (HasResumeFromSaveHeroId) { + if (hasResumeFromSaveHeroId) { size += pb::CodedOutputStream.ComputeMessageSize(5, ResumeFromSaveHeroId); } - if (HasOpenToFriends) { + if (hasOpenToFriends) { size += pb::CodedOutputStream.ComputeBoolSize(6, OpenToFriends); } - if (HasOpenToFriendsMessage) { + if (hasOpenToFriendsMessage) { size += pb::CodedOutputStream.ComputeStringSize(7, OpenToFriendsMessage); } size += UnknownFields.SerializedSize; @@ -1099,38 +1297,72 @@ public static CoopCreateParams ParseDelimitedFrom(global::System.IO.Stream input public static CoopCreateParams ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static CoopCreateParams ParseFrom(pb::CodedInputStream input) { + public static CoopCreateParams ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static CoopCreateParams ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static CoopCreateParams ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private CoopCreateParams MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(CoopCreateParams prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CoopCreateParams cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - CoopCreateParams result = new CoopCreateParams(); + private bool resultIsReadOnly; + private CoopCreateParams result; + + private CoopCreateParams PrepareBuilder() { + if (resultIsReadOnly) { + CoopCreateParams original = result; + result = new CoopCreateParams(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override CoopCreateParams MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new CoopCreateParams(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -1142,12 +1374,11 @@ public override CoopCreateParams DefaultInstanceForType { } public override CoopCreateParams BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - CoopCreateParams returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1161,6 +1392,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(CoopCreateParams other) { if (other == global::D3.OnlineService.CoopCreateParams.DefaultInstance) return this; + PrepareBuilder(); if (other.HasDifficultyLevel) { DifficultyLevel = other.DifficultyLevel; } @@ -1186,20 +1418,31 @@ public override Builder MergeFrom(CoopCreateParams other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_coopCreateParamsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _coopCreateParamsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1211,28 +1454,28 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 8: { - DifficultyLevel = input.ReadInt32(); + result.hasDifficultyLevel = input.ReadInt32(ref result.difficultyLevel_); break; } case 16: { - Act = input.ReadSInt32(); + result.hasAct = input.ReadSInt32(ref result.act_); break; } case 29: { - SnoQuest = input.ReadSFixed32(); + result.hasSnoQuest = input.ReadSFixed32(ref result.snoQuest_); break; } case 32: { - QuestStepId = input.ReadInt32(); + result.hasQuestStepId = input.ReadInt32(ref result.questStepId_); break; } case 42: { global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); - if (HasResumeFromSaveHeroId) { + if (result.hasResumeFromSaveHeroId) { subBuilder.MergeFrom(ResumeFromSaveHeroId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1240,92 +1483,105 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 48: { - OpenToFriends = input.ReadBool(); + result.hasOpenToFriends = input.ReadBool(ref result.openToFriends_); break; } case 58: { - OpenToFriendsMessage = input.ReadString(); + result.hasOpenToFriendsMessage = input.ReadString(ref result.openToFriendsMessage_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasDifficultyLevel { - get { return result.HasDifficultyLevel; } + get { return result.hasDifficultyLevel; } } public int DifficultyLevel { get { return result.DifficultyLevel; } set { SetDifficultyLevel(value); } } public Builder SetDifficultyLevel(int value) { + PrepareBuilder(); result.hasDifficultyLevel = true; result.difficultyLevel_ = value; return this; } public Builder ClearDifficultyLevel() { + PrepareBuilder(); result.hasDifficultyLevel = false; - result.difficultyLevel_ = 0; + result.difficultyLevel_ = -1; return this; } public bool HasAct { - get { return result.HasAct; } + get { return result.hasAct; } } public int Act { get { return result.Act; } set { SetAct(value); } } public Builder SetAct(int value) { + PrepareBuilder(); result.hasAct = true; result.act_ = value; return this; } public Builder ClearAct() { + PrepareBuilder(); result.hasAct = false; result.act_ = 0; return this; } public bool HasSnoQuest { - get { return result.HasSnoQuest; } + get { return result.hasSnoQuest; } } public int SnoQuest { get { return result.SnoQuest; } set { SetSnoQuest(value); } } public Builder SetSnoQuest(int value) { + PrepareBuilder(); result.hasSnoQuest = true; result.snoQuest_ = value; return this; } public Builder ClearSnoQuest() { + PrepareBuilder(); result.hasSnoQuest = false; - result.snoQuest_ = 0; + result.snoQuest_ = -1; return this; } public bool HasQuestStepId { - get { return result.HasQuestStepId; } + get { return result.hasQuestStepId; } } public int QuestStepId { get { return result.QuestStepId; } set { SetQuestStepId(value); } } public Builder SetQuestStepId(int value) { + PrepareBuilder(); result.hasQuestStepId = true; result.questStepId_ = value; return this; } public Builder ClearQuestStepId() { + PrepareBuilder(); result.hasQuestStepId = false; - result.questStepId_ = 0; + result.questStepId_ = -1; return this; } public bool HasResumeFromSaveHeroId { - get { return result.HasResumeFromSaveHeroId; } + get { return result.hasResumeFromSaveHeroId; } } public global::D3.OnlineService.EntityId ResumeFromSaveHeroId { get { return result.ResumeFromSaveHeroId; } @@ -1333,19 +1589,22 @@ public bool HasResumeFromSaveHeroId { } public Builder SetResumeFromSaveHeroId(global::D3.OnlineService.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasResumeFromSaveHeroId = true; result.resumeFromSaveHeroId_ = value; return this; } public Builder SetResumeFromSaveHeroId(global::D3.OnlineService.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasResumeFromSaveHeroId = true; result.resumeFromSaveHeroId_ = builderForValue.Build(); return this; } public Builder MergeResumeFromSaveHeroId(global::D3.OnlineService.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasResumeFromSaveHeroId && + PrepareBuilder(); + if (result.hasResumeFromSaveHeroId && result.resumeFromSaveHeroId_ != global::D3.OnlineService.EntityId.DefaultInstance) { result.resumeFromSaveHeroId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.resumeFromSaveHeroId_).MergeFrom(value).BuildPartial(); } else { @@ -1355,31 +1614,34 @@ public Builder MergeResumeFromSaveHeroId(global::D3.OnlineService.EntityId value return this; } public Builder ClearResumeFromSaveHeroId() { + PrepareBuilder(); result.hasResumeFromSaveHeroId = false; - result.resumeFromSaveHeroId_ = global::D3.OnlineService.EntityId.DefaultInstance; + result.resumeFromSaveHeroId_ = null; return this; } public bool HasOpenToFriends { - get { return result.HasOpenToFriends; } + get { return result.hasOpenToFriends; } } public bool OpenToFriends { get { return result.OpenToFriends; } set { SetOpenToFriends(value); } } public Builder SetOpenToFriends(bool value) { + PrepareBuilder(); result.hasOpenToFriends = true; result.openToFriends_ = value; return this; } public Builder ClearOpenToFriends() { + PrepareBuilder(); result.hasOpenToFriends = false; result.openToFriends_ = false; return this; } public bool HasOpenToFriendsMessage { - get { return result.HasOpenToFriendsMessage; } + get { return result.hasOpenToFriendsMessage; } } public string OpenToFriendsMessage { get { return result.OpenToFriendsMessage; } @@ -1387,11 +1649,13 @@ public string OpenToFriendsMessage { } public Builder SetOpenToFriendsMessage(string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasOpenToFriendsMessage = true; result.openToFriendsMessage_ = value; return this; } public Builder ClearOpenToFriendsMessage() { + PrepareBuilder(); result.hasOpenToFriendsMessage = false; result.openToFriendsMessage_ = ""; return this; @@ -1402,14 +1666,20 @@ static CoopCreateParams() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class PvPCreateParams : pb::GeneratedMessage { - private static readonly PvPCreateParams defaultInstance = new Builder().BuildPartial(); + private PvPCreateParams() { } + private static readonly PvPCreateParams defaultInstance = new PvPCreateParams().MakeReadOnly(); + private static readonly string[] _pvPCreateParamsFieldNames = new string[] { "sno_world" }; + private static readonly uint[] _pvPCreateParamsFieldTags = new uint[] { 13 }; public static PvPCreateParams DefaultInstance { get { return defaultInstance; } } public override PvPCreateParams DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override PvPCreateParams ThisMessage { @@ -1426,7 +1696,7 @@ protected override PvPCreateParams ThisMessage { public const int SnoWorldFieldNumber = 1; private bool hasSnoWorld; - private int snoWorld_ = 0; + private int snoWorld_ = -1; public bool HasSnoWorld { get { return hasSnoWorld; } } @@ -1441,10 +1711,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasSnoWorld) { - output.WriteSFixed32(1, SnoWorld); + string[] field_names = _pvPCreateParamsFieldNames; + if (hasSnoWorld) { + output.WriteSFixed32(1, field_names[0], SnoWorld); } UnknownFields.WriteTo(output); } @@ -1456,7 +1727,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasSnoWorld) { + if (hasSnoWorld) { size += pb::CodedOutputStream.ComputeSFixed32Size(1, SnoWorld); } size += UnknownFields.SerializedSize; @@ -1489,38 +1760,72 @@ public static PvPCreateParams ParseDelimitedFrom(global::System.IO.Stream input) public static PvPCreateParams ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static PvPCreateParams ParseFrom(pb::CodedInputStream input) { + public static PvPCreateParams ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static PvPCreateParams ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static PvPCreateParams ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private PvPCreateParams MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(PvPCreateParams prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(PvPCreateParams cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - PvPCreateParams result = new PvPCreateParams(); + private bool resultIsReadOnly; + private PvPCreateParams result; + + private PvPCreateParams PrepareBuilder() { + if (resultIsReadOnly) { + PvPCreateParams original = result; + result = new PvPCreateParams(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override PvPCreateParams MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new PvPCreateParams(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -1532,12 +1837,11 @@ public override PvPCreateParams DefaultInstanceForType { } public override PvPCreateParams BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - PvPCreateParams returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1551,6 +1855,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(PvPCreateParams other) { if (other == global::D3.OnlineService.PvPCreateParams.DefaultInstance) return this; + PrepareBuilder(); if (other.HasSnoWorld) { SnoWorld = other.SnoWorld; } @@ -1558,20 +1863,31 @@ public override Builder MergeFrom(PvPCreateParams other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_pvPCreateParamsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _pvPCreateParamsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1583,33 +1899,40 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 13: { - SnoWorld = input.ReadSFixed32(); + result.hasSnoWorld = input.ReadSFixed32(ref result.snoWorld_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasSnoWorld { - get { return result.HasSnoWorld; } + get { return result.hasSnoWorld; } } public int SnoWorld { get { return result.SnoWorld; } set { SetSnoWorld(value); } } public Builder SetSnoWorld(int value) { + PrepareBuilder(); result.hasSnoWorld = true; result.snoWorld_ = value; return this; } public Builder ClearSnoWorld() { + PrepareBuilder(); result.hasSnoWorld = false; - result.snoWorld_ = 0; + result.snoWorld_ = -1; return this; } } @@ -1618,14 +1941,20 @@ static PvPCreateParams() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class GameCreateParams : pb::GeneratedMessage { - private static readonly GameCreateParams defaultInstance = new Builder().BuildPartial(); + private GameCreateParams() { } + private static readonly GameCreateParams defaultInstance = new GameCreateParams().MakeReadOnly(); + private static readonly string[] _gameCreateParamsFieldNames = new string[] { "coop", "creation_flags", "game_type", "name", "pvp" }; + private static readonly uint[] _gameCreateParamsFieldTags = new uint[] { 26, 16, 8, 42, 34 }; public static GameCreateParams DefaultInstance { get { return defaultInstance; } } public override GameCreateParams DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override GameCreateParams ThisMessage { @@ -1642,7 +1971,7 @@ protected override GameCreateParams ThisMessage { public const int GameTypeFieldNumber = 1; private bool hasGameType; - private int gameType_ = 0; + private int gameType_; public bool HasGameType { get { return hasGameType; } } @@ -1652,7 +1981,7 @@ public int GameType { public const int CreationFlagsFieldNumber = 2; private bool hasCreationFlags; - private uint creationFlags_ = 0; + private uint creationFlags_; public bool HasCreationFlags { get { return hasCreationFlags; } } @@ -1662,22 +1991,22 @@ public uint CreationFlags { public const int CoopFieldNumber = 3; private bool hasCoop; - private global::D3.OnlineService.CoopCreateParams coop_ = global::D3.OnlineService.CoopCreateParams.DefaultInstance; + private global::D3.OnlineService.CoopCreateParams coop_; public bool HasCoop { get { return hasCoop; } } public global::D3.OnlineService.CoopCreateParams Coop { - get { return coop_; } + get { return coop_ ?? global::D3.OnlineService.CoopCreateParams.DefaultInstance; } } public const int PvpFieldNumber = 4; private bool hasPvp; - private global::D3.OnlineService.PvPCreateParams pvp_ = global::D3.OnlineService.PvPCreateParams.DefaultInstance; + private global::D3.OnlineService.PvPCreateParams pvp_; public bool HasPvp { get { return hasPvp; } } public global::D3.OnlineService.PvPCreateParams Pvp { - get { return pvp_; } + get { return pvp_ ?? global::D3.OnlineService.PvPCreateParams.DefaultInstance; } } public const int NameFieldNumber = 5; @@ -1690,21 +2019,10 @@ public string Name { get { return name_; } } - public const int IsPrivateFieldNumber = 6; - private bool hasIsPrivate; - private bool isPrivate_ = false; - public bool HasIsPrivate { - get { return hasIsPrivate; } - } - public bool IsPrivate { - get { return isPrivate_; } - } - public override bool IsInitialized { get { if (!hasGameType) return false; if (!hasCreationFlags) return false; - if (!hasIsPrivate) return false; if (HasCoop) { if (!Coop.IsInitialized) return false; } @@ -1715,25 +2033,23 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasGameType) { - output.WriteSInt32(1, GameType); - } - if (HasCreationFlags) { - output.WriteUInt32(2, CreationFlags); + string[] field_names = _gameCreateParamsFieldNames; + if (hasGameType) { + output.WriteSInt32(1, field_names[2], GameType); } - if (HasCoop) { - output.WriteMessage(3, Coop); + if (hasCreationFlags) { + output.WriteUInt32(2, field_names[1], CreationFlags); } - if (HasPvp) { - output.WriteMessage(4, Pvp); + if (hasCoop) { + output.WriteMessage(3, field_names[0], Coop); } - if (HasName) { - output.WriteString(5, Name); + if (hasPvp) { + output.WriteMessage(4, field_names[4], Pvp); } - if (HasIsPrivate) { - output.WriteBool(6, IsPrivate); + if (hasName) { + output.WriteString(5, field_names[3], Name); } UnknownFields.WriteTo(output); } @@ -1745,24 +2061,21 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasGameType) { + if (hasGameType) { size += pb::CodedOutputStream.ComputeSInt32Size(1, GameType); } - if (HasCreationFlags) { + if (hasCreationFlags) { size += pb::CodedOutputStream.ComputeUInt32Size(2, CreationFlags); } - if (HasCoop) { + if (hasCoop) { size += pb::CodedOutputStream.ComputeMessageSize(3, Coop); } - if (HasPvp) { + if (hasPvp) { size += pb::CodedOutputStream.ComputeMessageSize(4, Pvp); } - if (HasName) { + if (hasName) { size += pb::CodedOutputStream.ComputeStringSize(5, Name); } - if (HasIsPrivate) { - size += pb::CodedOutputStream.ComputeBoolSize(6, IsPrivate); - } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; return size; @@ -1793,38 +2106,72 @@ public static GameCreateParams ParseDelimitedFrom(global::System.IO.Stream input public static GameCreateParams ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static GameCreateParams ParseFrom(pb::CodedInputStream input) { + public static GameCreateParams ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static GameCreateParams ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static GameCreateParams ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private GameCreateParams MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(GameCreateParams prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GameCreateParams cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - GameCreateParams result = new GameCreateParams(); + private bool resultIsReadOnly; + private GameCreateParams result; + + private GameCreateParams PrepareBuilder() { + if (resultIsReadOnly) { + GameCreateParams original = result; + result = new GameCreateParams(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override GameCreateParams MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new GameCreateParams(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -1836,12 +2183,11 @@ public override GameCreateParams DefaultInstanceForType { } public override GameCreateParams BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - GameCreateParams returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1855,6 +2201,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(GameCreateParams other) { if (other == global::D3.OnlineService.GameCreateParams.DefaultInstance) return this; + PrepareBuilder(); if (other.HasGameType) { GameType = other.GameType; } @@ -1870,27 +2217,35 @@ public override Builder MergeFrom(GameCreateParams other) { if (other.HasName) { Name = other.Name; } - if (other.HasIsPrivate) { - IsPrivate = other.IsPrivate; - } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_gameCreateParamsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _gameCreateParamsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1902,20 +2257,20 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 8: { - GameType = input.ReadSInt32(); + result.hasGameType = input.ReadSInt32(ref result.gameType_); break; } case 16: { - CreationFlags = input.ReadUInt32(); + result.hasCreationFlags = input.ReadUInt32(ref result.creationFlags_); break; } case 26: { global::D3.OnlineService.CoopCreateParams.Builder subBuilder = global::D3.OnlineService.CoopCreateParams.CreateBuilder(); - if (HasCoop) { + if (result.hasCoop) { subBuilder.MergeFrom(Coop); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1924,7 +2279,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 34: { global::D3.OnlineService.PvPCreateParams.Builder subBuilder = global::D3.OnlineService.PvPCreateParams.CreateBuilder(); - if (HasPvp) { + if (result.hasPvp) { subBuilder.MergeFrom(Pvp); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1932,56 +2287,61 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 42: { - Name = input.ReadString(); - break; - } - case 48: { - IsPrivate = input.ReadBool(); + result.hasName = input.ReadString(ref result.name_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasGameType { - get { return result.HasGameType; } + get { return result.hasGameType; } } public int GameType { get { return result.GameType; } set { SetGameType(value); } } public Builder SetGameType(int value) { + PrepareBuilder(); result.hasGameType = true; result.gameType_ = value; return this; } public Builder ClearGameType() { + PrepareBuilder(); result.hasGameType = false; result.gameType_ = 0; return this; } public bool HasCreationFlags { - get { return result.HasCreationFlags; } + get { return result.hasCreationFlags; } } public uint CreationFlags { get { return result.CreationFlags; } set { SetCreationFlags(value); } } public Builder SetCreationFlags(uint value) { + PrepareBuilder(); result.hasCreationFlags = true; result.creationFlags_ = value; return this; } public Builder ClearCreationFlags() { + PrepareBuilder(); result.hasCreationFlags = false; result.creationFlags_ = 0; return this; } public bool HasCoop { - get { return result.HasCoop; } + get { return result.hasCoop; } } public global::D3.OnlineService.CoopCreateParams Coop { get { return result.Coop; } @@ -1989,19 +2349,22 @@ public bool HasCoop { } public Builder SetCoop(global::D3.OnlineService.CoopCreateParams value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasCoop = true; result.coop_ = value; return this; } public Builder SetCoop(global::D3.OnlineService.CoopCreateParams.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasCoop = true; result.coop_ = builderForValue.Build(); return this; } public Builder MergeCoop(global::D3.OnlineService.CoopCreateParams value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasCoop && + PrepareBuilder(); + if (result.hasCoop && result.coop_ != global::D3.OnlineService.CoopCreateParams.DefaultInstance) { result.coop_ = global::D3.OnlineService.CoopCreateParams.CreateBuilder(result.coop_).MergeFrom(value).BuildPartial(); } else { @@ -2011,13 +2374,14 @@ public Builder MergeCoop(global::D3.OnlineService.CoopCreateParams value) { return this; } public Builder ClearCoop() { + PrepareBuilder(); result.hasCoop = false; - result.coop_ = global::D3.OnlineService.CoopCreateParams.DefaultInstance; + result.coop_ = null; return this; } public bool HasPvp { - get { return result.HasPvp; } + get { return result.hasPvp; } } public global::D3.OnlineService.PvPCreateParams Pvp { get { return result.Pvp; } @@ -2025,19 +2389,22 @@ public bool HasPvp { } public Builder SetPvp(global::D3.OnlineService.PvPCreateParams value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasPvp = true; result.pvp_ = value; return this; } public Builder SetPvp(global::D3.OnlineService.PvPCreateParams.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasPvp = true; result.pvp_ = builderForValue.Build(); return this; } public Builder MergePvp(global::D3.OnlineService.PvPCreateParams value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasPvp && + PrepareBuilder(); + if (result.hasPvp && result.pvp_ != global::D3.OnlineService.PvPCreateParams.DefaultInstance) { result.pvp_ = global::D3.OnlineService.PvPCreateParams.CreateBuilder(result.pvp_).MergeFrom(value).BuildPartial(); } else { @@ -2047,13 +2414,14 @@ public Builder MergePvp(global::D3.OnlineService.PvPCreateParams value) { return this; } public Builder ClearPvp() { + PrepareBuilder(); result.hasPvp = false; - result.pvp_ = global::D3.OnlineService.PvPCreateParams.DefaultInstance; + result.pvp_ = null; return this; } public bool HasName { - get { return result.HasName; } + get { return result.hasName; } } public string Name { get { return result.Name; } @@ -2061,47 +2429,37 @@ public string Name { } public Builder SetName(string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasName = true; result.name_ = value; return this; } public Builder ClearName() { + PrepareBuilder(); result.hasName = false; result.name_ = ""; return this; } - - public bool HasIsPrivate { - get { return result.HasIsPrivate; } - } - public bool IsPrivate { - get { return result.IsPrivate; } - set { SetIsPrivate(value); } - } - public Builder SetIsPrivate(bool value) { - result.hasIsPrivate = true; - result.isPrivate_ = value; - return this; - } - public Builder ClearIsPrivate() { - result.hasIsPrivate = false; - result.isPrivate_ = false; - return this; - } } static GameCreateParams() { object.ReferenceEquals(global::D3.OnlineService.OnlineService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class HeroCreateParams : pb::GeneratedMessage { - private static readonly HeroCreateParams defaultInstance = new Builder().BuildPartial(); + private HeroCreateParams() { } + private static readonly HeroCreateParams defaultInstance = new HeroCreateParams().MakeReadOnly(); + private static readonly string[] _heroCreateParamsFieldNames = new string[] { "gbid_class", "is_female", "is_hardcore", "name" }; + private static readonly uint[] _heroCreateParamsFieldTags = new uint[] { 21, 32, 24, 10 }; public static HeroCreateParams DefaultInstance { get { return defaultInstance; } } public override HeroCreateParams DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override HeroCreateParams ThisMessage { @@ -2116,9 +2474,19 @@ protected override HeroCreateParams ThisMessage { get { return global::D3.OnlineService.OnlineService.internal__static_D3_OnlineService_HeroCreateParams__FieldAccessorTable; } } - public const int GbidClassFieldNumber = 1; + public const int NameFieldNumber = 1; + private bool hasName; + private string name_ = ""; + public bool HasName { + get { return hasName; } + } + public string Name { + get { return name_; } + } + + public const int GbidClassFieldNumber = 2; private bool hasGbidClass; - private int gbidClass_ = 0; + private int gbidClass_ = -1; public bool HasGbidClass { get { return hasGbidClass; } } @@ -2126,9 +2494,9 @@ public int GbidClass { get { return gbidClass_; } } - public const int IsHardcoreFieldNumber = 2; + public const int IsHardcoreFieldNumber = 3; private bool hasIsHardcore; - private bool isHardcore_ = false; + private bool isHardcore_; public bool HasIsHardcore { get { return hasIsHardcore; } } @@ -2136,9 +2504,9 @@ public bool IsHardcore { get { return isHardcore_; } } - public const int IsFemaleFieldNumber = 3; + public const int IsFemaleFieldNumber = 4; private bool hasIsFemale; - private bool isFemale_ = false; + private bool isFemale_; public bool HasIsFemale { get { return hasIsFemale; } } @@ -2148,6 +2516,7 @@ public bool IsFemale { public override bool IsInitialized { get { + if (!hasName) return false; if (!hasGbidClass) return false; if (!hasIsHardcore) return false; if (!hasIsFemale) return false; @@ -2155,16 +2524,20 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasGbidClass) { - output.WriteSFixed32(1, GbidClass); + string[] field_names = _heroCreateParamsFieldNames; + if (hasName) { + output.WriteString(1, field_names[3], Name); } - if (HasIsHardcore) { - output.WriteBool(2, IsHardcore); + if (hasGbidClass) { + output.WriteSFixed32(2, field_names[0], GbidClass); } - if (HasIsFemale) { - output.WriteBool(3, IsFemale); + if (hasIsHardcore) { + output.WriteBool(3, field_names[2], IsHardcore); + } + if (hasIsFemale) { + output.WriteBool(4, field_names[1], IsFemale); } UnknownFields.WriteTo(output); } @@ -2176,14 +2549,17 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasGbidClass) { - size += pb::CodedOutputStream.ComputeSFixed32Size(1, GbidClass); + if (hasName) { + size += pb::CodedOutputStream.ComputeStringSize(1, Name); + } + if (hasGbidClass) { + size += pb::CodedOutputStream.ComputeSFixed32Size(2, GbidClass); } - if (HasIsHardcore) { - size += pb::CodedOutputStream.ComputeBoolSize(2, IsHardcore); + if (hasIsHardcore) { + size += pb::CodedOutputStream.ComputeBoolSize(3, IsHardcore); } - if (HasIsFemale) { - size += pb::CodedOutputStream.ComputeBoolSize(3, IsFemale); + if (hasIsFemale) { + size += pb::CodedOutputStream.ComputeBoolSize(4, IsFemale); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -2215,38 +2591,72 @@ public static HeroCreateParams ParseDelimitedFrom(global::System.IO.Stream input public static HeroCreateParams ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static HeroCreateParams ParseFrom(pb::CodedInputStream input) { + public static HeroCreateParams ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static HeroCreateParams ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static HeroCreateParams ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private HeroCreateParams MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(HeroCreateParams prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(HeroCreateParams cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private HeroCreateParams result; + + private HeroCreateParams PrepareBuilder() { + if (resultIsReadOnly) { + HeroCreateParams original = result; + result = new HeroCreateParams(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - HeroCreateParams result = new HeroCreateParams(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override HeroCreateParams MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new HeroCreateParams(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -2258,12 +2668,11 @@ public override HeroCreateParams DefaultInstanceForType { } public override HeroCreateParams BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - HeroCreateParams returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2277,6 +2686,10 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(HeroCreateParams other) { if (other == global::D3.OnlineService.HeroCreateParams.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasName) { + Name = other.Name; + } if (other.HasGbidClass) { GbidClass = other.GbidClass; } @@ -2290,20 +2703,31 @@ public override Builder MergeFrom(HeroCreateParams other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_heroCreateParamsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _heroCreateParamsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -2315,75 +2739,111 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } - case 13: { - GbidClass = input.ReadSFixed32(); + case 10: { + result.hasName = input.ReadString(ref result.name_); break; } - case 16: { - IsHardcore = input.ReadBool(); + case 21: { + result.hasGbidClass = input.ReadSFixed32(ref result.gbidClass_); break; } case 24: { - IsFemale = input.ReadBool(); + result.hasIsHardcore = input.ReadBool(ref result.isHardcore_); + break; + } + case 32: { + result.hasIsFemale = input.ReadBool(ref result.isFemale_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } + public bool HasName { + get { return result.hasName; } + } + public string Name { + get { return result.Name; } + set { SetName(value); } + } + public Builder SetName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasName = true; + result.name_ = value; + return this; + } + public Builder ClearName() { + PrepareBuilder(); + result.hasName = false; + result.name_ = ""; + return this; + } + public bool HasGbidClass { - get { return result.HasGbidClass; } + get { return result.hasGbidClass; } } public int GbidClass { get { return result.GbidClass; } set { SetGbidClass(value); } } public Builder SetGbidClass(int value) { + PrepareBuilder(); result.hasGbidClass = true; result.gbidClass_ = value; return this; } public Builder ClearGbidClass() { + PrepareBuilder(); result.hasGbidClass = false; - result.gbidClass_ = 0; + result.gbidClass_ = -1; return this; } public bool HasIsHardcore { - get { return result.HasIsHardcore; } + get { return result.hasIsHardcore; } } public bool IsHardcore { get { return result.IsHardcore; } set { SetIsHardcore(value); } } public Builder SetIsHardcore(bool value) { + PrepareBuilder(); result.hasIsHardcore = true; result.isHardcore_ = value; return this; } public Builder ClearIsHardcore() { + PrepareBuilder(); result.hasIsHardcore = false; result.isHardcore_ = false; return this; } public bool HasIsFemale { - get { return result.HasIsFemale; } + get { return result.hasIsFemale; } } public bool IsFemale { get { return result.IsFemale; } set { SetIsFemale(value); } } public Builder SetIsFemale(bool value) { + PrepareBuilder(); result.hasIsFemale = true; result.isFemale_ = value; return this; } public Builder ClearIsFemale() { + PrepareBuilder(); result.hasIsFemale = false; result.isFemale_ = false; return this; @@ -2397,3 +2857,5 @@ static HeroCreateParams() { #endregion } + +#endregion Designer generated code diff --git a/src/LibMooNet/D3/PartyMessage/PartyMessage.cs b/src/LibMooNet/D3/PartyMessage/PartyMessage.cs new file mode 100644 index 00000000..8e6ecbdb --- /dev/null +++ b/src/LibMooNet/D3/PartyMessage/PartyMessage.cs @@ -0,0 +1,1550 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace D3.PartyMessage { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class PartyMessage { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_D3_PartyMessage_ScreenStatus__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_PartyMessage_ScreenStatus__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_PartyMessage_SearchForPublicGameParams__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_PartyMessage_SearchForPublicGameParams__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_PartyMessage_EnterGamePartyMember__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_PartyMessage_EnterGamePartyMember__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_PartyMessage_EnterGamePartyMemberList__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_PartyMessage_EnterGamePartyMemberList__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static PartyMessage() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "ChJQYXJ0eU1lc3NhZ2UucHJvdG8SD0QzLlBhcnR5TWVzc2FnZRoTT25saW5l" + + "U2VydmljZS5wcm90byIuCgxTY3JlZW5TdGF0dXMSDgoGc2NyZWVuGAEgAigF" + + "Eg4KBnN0YXR1cxgCIAIoBSKaAQoZU2VhcmNoRm9yUHVibGljR2FtZVBhcmFt" + + "cxISCgpzdGFydF90aW1lGAEgASgSEhkKEXNlY29uZHNfdG9fc2VhcmNoGAIg" + + "ASgNEjcKC2dhbWVfcGFyYW1zGAMgASgLMiIuRDMuT25saW5lU2VydmljZS5H" + + "YW1lQ3JlYXRlUGFyYW1zEhUKDXJlbW92ZV9yZWFzb24YBCABKAUicwoURW50" + + "ZXJHYW1lUGFydHlNZW1iZXISLgoKYWNjb3VudF9pZBgBIAIoCzIaLkQzLk9u" + + "bGluZVNlcnZpY2UuRW50aXR5SWQSKwoHaGVyb19pZBgCIAIoCzIaLkQzLk9u" + + "bGluZVNlcnZpY2UuRW50aXR5SWQiagoYRW50ZXJHYW1lUGFydHlNZW1iZXJM" + + "aXN0EjUKBm1lbWJlchgBIAMoCzIlLkQzLlBhcnR5TWVzc2FnZS5FbnRlckdh" + + "bWVQYXJ0eU1lbWJlchIXCg9yZXF1ZXN0ZXJfaW5kZXgYAiABKAU="); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_D3_PartyMessage_ScreenStatus__Descriptor = Descriptor.MessageTypes[0]; + internal__static_D3_PartyMessage_ScreenStatus__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_PartyMessage_ScreenStatus__Descriptor, + new string[] { "Screen", "Status", }); + internal__static_D3_PartyMessage_SearchForPublicGameParams__Descriptor = Descriptor.MessageTypes[1]; + internal__static_D3_PartyMessage_SearchForPublicGameParams__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_PartyMessage_SearchForPublicGameParams__Descriptor, + new string[] { "StartTime", "SecondsToSearch", "GameParams", "RemoveReason", }); + internal__static_D3_PartyMessage_EnterGamePartyMember__Descriptor = Descriptor.MessageTypes[2]; + internal__static_D3_PartyMessage_EnterGamePartyMember__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_PartyMessage_EnterGamePartyMember__Descriptor, + new string[] { "AccountId", "HeroId", }); + internal__static_D3_PartyMessage_EnterGamePartyMemberList__Descriptor = Descriptor.MessageTypes[3]; + internal__static_D3_PartyMessage_EnterGamePartyMemberList__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_PartyMessage_EnterGamePartyMemberList__Descriptor, + new string[] { "Member", "RequesterIndex", }); + return null; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::D3.OnlineService.OnlineService.Descriptor, + }, assigner); + } + #endregion + + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ScreenStatus : pb::GeneratedMessage { + private ScreenStatus() { } + private static readonly ScreenStatus defaultInstance = new ScreenStatus().MakeReadOnly(); + private static readonly string[] _screenStatusFieldNames = new string[] { "screen", "status" }; + private static readonly uint[] _screenStatusFieldTags = new uint[] { 8, 16 }; + public static ScreenStatus DefaultInstance { + get { return defaultInstance; } + } + + public override ScreenStatus DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ScreenStatus ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.PartyMessage.PartyMessage.internal__static_D3_PartyMessage_ScreenStatus__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.PartyMessage.PartyMessage.internal__static_D3_PartyMessage_ScreenStatus__FieldAccessorTable; } + } + + public const int ScreenFieldNumber = 1; + private bool hasScreen; + private int screen_; + public bool HasScreen { + get { return hasScreen; } + } + public int Screen { + get { return screen_; } + } + + public const int StatusFieldNumber = 2; + private bool hasStatus; + private int status_; + public bool HasStatus { + get { return hasStatus; } + } + public int Status { + get { return status_; } + } + + public override bool IsInitialized { + get { + if (!hasScreen) return false; + if (!hasStatus) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _screenStatusFieldNames; + if (hasScreen) { + output.WriteInt32(1, field_names[0], Screen); + } + if (hasStatus) { + output.WriteInt32(2, field_names[1], Status); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasScreen) { + size += pb::CodedOutputStream.ComputeInt32Size(1, Screen); + } + if (hasStatus) { + size += pb::CodedOutputStream.ComputeInt32Size(2, Status); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ScreenStatus ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ScreenStatus ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ScreenStatus ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ScreenStatus ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ScreenStatus ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ScreenStatus ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ScreenStatus ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ScreenStatus ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ScreenStatus ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ScreenStatus ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ScreenStatus MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ScreenStatus prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ScreenStatus cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ScreenStatus result; + + private ScreenStatus PrepareBuilder() { + if (resultIsReadOnly) { + ScreenStatus original = result; + result = new ScreenStatus(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ScreenStatus MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.PartyMessage.ScreenStatus.Descriptor; } + } + + public override ScreenStatus DefaultInstanceForType { + get { return global::D3.PartyMessage.ScreenStatus.DefaultInstance; } + } + + public override ScreenStatus BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ScreenStatus) { + return MergeFrom((ScreenStatus) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ScreenStatus other) { + if (other == global::D3.PartyMessage.ScreenStatus.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasScreen) { + Screen = other.Screen; + } + if (other.HasStatus) { + Status = other.Status; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_screenStatusFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _screenStatusFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasScreen = input.ReadInt32(ref result.screen_); + break; + } + case 16: { + result.hasStatus = input.ReadInt32(ref result.status_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasScreen { + get { return result.hasScreen; } + } + public int Screen { + get { return result.Screen; } + set { SetScreen(value); } + } + public Builder SetScreen(int value) { + PrepareBuilder(); + result.hasScreen = true; + result.screen_ = value; + return this; + } + public Builder ClearScreen() { + PrepareBuilder(); + result.hasScreen = false; + result.screen_ = 0; + return this; + } + + public bool HasStatus { + get { return result.hasStatus; } + } + public int Status { + get { return result.Status; } + set { SetStatus(value); } + } + public Builder SetStatus(int value) { + PrepareBuilder(); + result.hasStatus = true; + result.status_ = value; + return this; + } + public Builder ClearStatus() { + PrepareBuilder(); + result.hasStatus = false; + result.status_ = 0; + return this; + } + } + static ScreenStatus() { + object.ReferenceEquals(global::D3.PartyMessage.PartyMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class SearchForPublicGameParams : pb::GeneratedMessage { + private SearchForPublicGameParams() { } + private static readonly SearchForPublicGameParams defaultInstance = new SearchForPublicGameParams().MakeReadOnly(); + private static readonly string[] _searchForPublicGameParamsFieldNames = new string[] { "game_params", "remove_reason", "seconds_to_search", "start_time" }; + private static readonly uint[] _searchForPublicGameParamsFieldTags = new uint[] { 26, 32, 16, 8 }; + public static SearchForPublicGameParams DefaultInstance { + get { return defaultInstance; } + } + + public override SearchForPublicGameParams DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SearchForPublicGameParams ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.PartyMessage.PartyMessage.internal__static_D3_PartyMessage_SearchForPublicGameParams__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.PartyMessage.PartyMessage.internal__static_D3_PartyMessage_SearchForPublicGameParams__FieldAccessorTable; } + } + + public const int StartTimeFieldNumber = 1; + private bool hasStartTime; + private long startTime_; + public bool HasStartTime { + get { return hasStartTime; } + } + public long StartTime { + get { return startTime_; } + } + + public const int SecondsToSearchFieldNumber = 2; + private bool hasSecondsToSearch; + private uint secondsToSearch_; + public bool HasSecondsToSearch { + get { return hasSecondsToSearch; } + } + public uint SecondsToSearch { + get { return secondsToSearch_; } + } + + public const int GameParamsFieldNumber = 3; + private bool hasGameParams; + private global::D3.OnlineService.GameCreateParams gameParams_; + public bool HasGameParams { + get { return hasGameParams; } + } + public global::D3.OnlineService.GameCreateParams GameParams { + get { return gameParams_ ?? global::D3.OnlineService.GameCreateParams.DefaultInstance; } + } + + public const int RemoveReasonFieldNumber = 4; + private bool hasRemoveReason; + private int removeReason_; + public bool HasRemoveReason { + get { return hasRemoveReason; } + } + public int RemoveReason { + get { return removeReason_; } + } + + public override bool IsInitialized { + get { + if (HasGameParams) { + if (!GameParams.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _searchForPublicGameParamsFieldNames; + if (hasStartTime) { + output.WriteSInt64(1, field_names[3], StartTime); + } + if (hasSecondsToSearch) { + output.WriteUInt32(2, field_names[2], SecondsToSearch); + } + if (hasGameParams) { + output.WriteMessage(3, field_names[0], GameParams); + } + if (hasRemoveReason) { + output.WriteInt32(4, field_names[1], RemoveReason); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasStartTime) { + size += pb::CodedOutputStream.ComputeSInt64Size(1, StartTime); + } + if (hasSecondsToSearch) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, SecondsToSearch); + } + if (hasGameParams) { + size += pb::CodedOutputStream.ComputeMessageSize(3, GameParams); + } + if (hasRemoveReason) { + size += pb::CodedOutputStream.ComputeInt32Size(4, RemoveReason); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static SearchForPublicGameParams ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SearchForPublicGameParams ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SearchForPublicGameParams ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SearchForPublicGameParams ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SearchForPublicGameParams ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SearchForPublicGameParams ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SearchForPublicGameParams ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SearchForPublicGameParams ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SearchForPublicGameParams ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SearchForPublicGameParams ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SearchForPublicGameParams MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SearchForPublicGameParams prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SearchForPublicGameParams cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SearchForPublicGameParams result; + + private SearchForPublicGameParams PrepareBuilder() { + if (resultIsReadOnly) { + SearchForPublicGameParams original = result; + result = new SearchForPublicGameParams(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SearchForPublicGameParams MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.PartyMessage.SearchForPublicGameParams.Descriptor; } + } + + public override SearchForPublicGameParams DefaultInstanceForType { + get { return global::D3.PartyMessage.SearchForPublicGameParams.DefaultInstance; } + } + + public override SearchForPublicGameParams BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SearchForPublicGameParams) { + return MergeFrom((SearchForPublicGameParams) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SearchForPublicGameParams other) { + if (other == global::D3.PartyMessage.SearchForPublicGameParams.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasStartTime) { + StartTime = other.StartTime; + } + if (other.HasSecondsToSearch) { + SecondsToSearch = other.SecondsToSearch; + } + if (other.HasGameParams) { + MergeGameParams(other.GameParams); + } + if (other.HasRemoveReason) { + RemoveReason = other.RemoveReason; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_searchForPublicGameParamsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _searchForPublicGameParamsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasStartTime = input.ReadSInt64(ref result.startTime_); + break; + } + case 16: { + result.hasSecondsToSearch = input.ReadUInt32(ref result.secondsToSearch_); + break; + } + case 26: { + global::D3.OnlineService.GameCreateParams.Builder subBuilder = global::D3.OnlineService.GameCreateParams.CreateBuilder(); + if (result.hasGameParams) { + subBuilder.MergeFrom(GameParams); + } + input.ReadMessage(subBuilder, extensionRegistry); + GameParams = subBuilder.BuildPartial(); + break; + } + case 32: { + result.hasRemoveReason = input.ReadInt32(ref result.removeReason_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasStartTime { + get { return result.hasStartTime; } + } + public long StartTime { + get { return result.StartTime; } + set { SetStartTime(value); } + } + public Builder SetStartTime(long value) { + PrepareBuilder(); + result.hasStartTime = true; + result.startTime_ = value; + return this; + } + public Builder ClearStartTime() { + PrepareBuilder(); + result.hasStartTime = false; + result.startTime_ = 0; + return this; + } + + public bool HasSecondsToSearch { + get { return result.hasSecondsToSearch; } + } + public uint SecondsToSearch { + get { return result.SecondsToSearch; } + set { SetSecondsToSearch(value); } + } + public Builder SetSecondsToSearch(uint value) { + PrepareBuilder(); + result.hasSecondsToSearch = true; + result.secondsToSearch_ = value; + return this; + } + public Builder ClearSecondsToSearch() { + PrepareBuilder(); + result.hasSecondsToSearch = false; + result.secondsToSearch_ = 0; + return this; + } + + public bool HasGameParams { + get { return result.hasGameParams; } + } + public global::D3.OnlineService.GameCreateParams GameParams { + get { return result.GameParams; } + set { SetGameParams(value); } + } + public Builder SetGameParams(global::D3.OnlineService.GameCreateParams value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasGameParams = true; + result.gameParams_ = value; + return this; + } + public Builder SetGameParams(global::D3.OnlineService.GameCreateParams.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasGameParams = true; + result.gameParams_ = builderForValue.Build(); + return this; + } + public Builder MergeGameParams(global::D3.OnlineService.GameCreateParams value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasGameParams && + result.gameParams_ != global::D3.OnlineService.GameCreateParams.DefaultInstance) { + result.gameParams_ = global::D3.OnlineService.GameCreateParams.CreateBuilder(result.gameParams_).MergeFrom(value).BuildPartial(); + } else { + result.gameParams_ = value; + } + result.hasGameParams = true; + return this; + } + public Builder ClearGameParams() { + PrepareBuilder(); + result.hasGameParams = false; + result.gameParams_ = null; + return this; + } + + public bool HasRemoveReason { + get { return result.hasRemoveReason; } + } + public int RemoveReason { + get { return result.RemoveReason; } + set { SetRemoveReason(value); } + } + public Builder SetRemoveReason(int value) { + PrepareBuilder(); + result.hasRemoveReason = true; + result.removeReason_ = value; + return this; + } + public Builder ClearRemoveReason() { + PrepareBuilder(); + result.hasRemoveReason = false; + result.removeReason_ = 0; + return this; + } + } + static SearchForPublicGameParams() { + object.ReferenceEquals(global::D3.PartyMessage.PartyMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class EnterGamePartyMember : pb::GeneratedMessage { + private EnterGamePartyMember() { } + private static readonly EnterGamePartyMember defaultInstance = new EnterGamePartyMember().MakeReadOnly(); + private static readonly string[] _enterGamePartyMemberFieldNames = new string[] { "account_id", "hero_id" }; + private static readonly uint[] _enterGamePartyMemberFieldTags = new uint[] { 10, 18 }; + public static EnterGamePartyMember DefaultInstance { + get { return defaultInstance; } + } + + public override EnterGamePartyMember DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override EnterGamePartyMember ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.PartyMessage.PartyMessage.internal__static_D3_PartyMessage_EnterGamePartyMember__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.PartyMessage.PartyMessage.internal__static_D3_PartyMessage_EnterGamePartyMember__FieldAccessorTable; } + } + + public const int AccountIdFieldNumber = 1; + private bool hasAccountId; + private global::D3.OnlineService.EntityId accountId_; + public bool HasAccountId { + get { return hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return accountId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public const int HeroIdFieldNumber = 2; + private bool hasHeroId; + private global::D3.OnlineService.EntityId heroId_; + public bool HasHeroId { + get { return hasHeroId; } + } + public global::D3.OnlineService.EntityId HeroId { + get { return heroId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasAccountId) return false; + if (!hasHeroId) return false; + if (!AccountId.IsInitialized) return false; + if (!HeroId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _enterGamePartyMemberFieldNames; + if (hasAccountId) { + output.WriteMessage(1, field_names[0], AccountId); + } + if (hasHeroId) { + output.WriteMessage(2, field_names[1], HeroId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AccountId); + } + if (hasHeroId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, HeroId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static EnterGamePartyMember ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static EnterGamePartyMember ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static EnterGamePartyMember ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static EnterGamePartyMember ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static EnterGamePartyMember ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static EnterGamePartyMember ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static EnterGamePartyMember ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static EnterGamePartyMember ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static EnterGamePartyMember ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static EnterGamePartyMember ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private EnterGamePartyMember MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(EnterGamePartyMember prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(EnterGamePartyMember cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private EnterGamePartyMember result; + + private EnterGamePartyMember PrepareBuilder() { + if (resultIsReadOnly) { + EnterGamePartyMember original = result; + result = new EnterGamePartyMember(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override EnterGamePartyMember MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.PartyMessage.EnterGamePartyMember.Descriptor; } + } + + public override EnterGamePartyMember DefaultInstanceForType { + get { return global::D3.PartyMessage.EnterGamePartyMember.DefaultInstance; } + } + + public override EnterGamePartyMember BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is EnterGamePartyMember) { + return MergeFrom((EnterGamePartyMember) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(EnterGamePartyMember other) { + if (other == global::D3.PartyMessage.EnterGamePartyMember.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAccountId) { + MergeAccountId(other.AccountId); + } + if (other.HasHeroId) { + MergeHeroId(other.HeroId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_enterGamePartyMemberFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _enterGamePartyMemberFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasAccountId) { + subBuilder.MergeFrom(AccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + AccountId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasHeroId) { + subBuilder.MergeFrom(HeroId); + } + input.ReadMessage(subBuilder, extensionRegistry); + HeroId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAccountId { + get { return result.hasAccountId; } + } + public global::D3.OnlineService.EntityId AccountId { + get { return result.AccountId; } + set { SetAccountId(value); } + } + public Builder SetAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = value; + return this; + } + public Builder SetAccountId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = builderForValue.Build(); + return this; + } + public Builder MergeAccountId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccountId && + result.accountId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.accountId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.accountId_).MergeFrom(value).BuildPartial(); + } else { + result.accountId_ = value; + } + result.hasAccountId = true; + return this; + } + public Builder ClearAccountId() { + PrepareBuilder(); + result.hasAccountId = false; + result.accountId_ = null; + return this; + } + + public bool HasHeroId { + get { return result.hasHeroId; } + } + public global::D3.OnlineService.EntityId HeroId { + get { return result.HeroId; } + set { SetHeroId(value); } + } + public Builder SetHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasHeroId = true; + result.heroId_ = value; + return this; + } + public Builder SetHeroId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasHeroId = true; + result.heroId_ = builderForValue.Build(); + return this; + } + public Builder MergeHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasHeroId && + result.heroId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.heroId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.heroId_).MergeFrom(value).BuildPartial(); + } else { + result.heroId_ = value; + } + result.hasHeroId = true; + return this; + } + public Builder ClearHeroId() { + PrepareBuilder(); + result.hasHeroId = false; + result.heroId_ = null; + return this; + } + } + static EnterGamePartyMember() { + object.ReferenceEquals(global::D3.PartyMessage.PartyMessage.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class EnterGamePartyMemberList : pb::GeneratedMessage { + private EnterGamePartyMemberList() { } + private static readonly EnterGamePartyMemberList defaultInstance = new EnterGamePartyMemberList().MakeReadOnly(); + private static readonly string[] _enterGamePartyMemberListFieldNames = new string[] { "member", "requester_index" }; + private static readonly uint[] _enterGamePartyMemberListFieldTags = new uint[] { 10, 16 }; + public static EnterGamePartyMemberList DefaultInstance { + get { return defaultInstance; } + } + + public override EnterGamePartyMemberList DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override EnterGamePartyMemberList ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.PartyMessage.PartyMessage.internal__static_D3_PartyMessage_EnterGamePartyMemberList__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.PartyMessage.PartyMessage.internal__static_D3_PartyMessage_EnterGamePartyMemberList__FieldAccessorTable; } + } + + public const int MemberFieldNumber = 1; + private pbc::PopsicleList member_ = new pbc::PopsicleList(); + public scg::IList MemberList { + get { return member_; } + } + public int MemberCount { + get { return member_.Count; } + } + public global::D3.PartyMessage.EnterGamePartyMember GetMember(int index) { + return member_[index]; + } + + public const int RequesterIndexFieldNumber = 2; + private bool hasRequesterIndex; + private int requesterIndex_; + public bool HasRequesterIndex { + get { return hasRequesterIndex; } + } + public int RequesterIndex { + get { return requesterIndex_; } + } + + public override bool IsInitialized { + get { + foreach (global::D3.PartyMessage.EnterGamePartyMember element in MemberList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _enterGamePartyMemberListFieldNames; + if (member_.Count > 0) { + output.WriteMessageArray(1, field_names[0], member_); + } + if (hasRequesterIndex) { + output.WriteInt32(2, field_names[1], RequesterIndex); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::D3.PartyMessage.EnterGamePartyMember element in MemberList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + if (hasRequesterIndex) { + size += pb::CodedOutputStream.ComputeInt32Size(2, RequesterIndex); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static EnterGamePartyMemberList ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static EnterGamePartyMemberList ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static EnterGamePartyMemberList ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static EnterGamePartyMemberList ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static EnterGamePartyMemberList ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static EnterGamePartyMemberList ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static EnterGamePartyMemberList ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static EnterGamePartyMemberList ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static EnterGamePartyMemberList ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static EnterGamePartyMemberList ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private EnterGamePartyMemberList MakeReadOnly() { + member_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(EnterGamePartyMemberList prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(EnterGamePartyMemberList cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private EnterGamePartyMemberList result; + + private EnterGamePartyMemberList PrepareBuilder() { + if (resultIsReadOnly) { + EnterGamePartyMemberList original = result; + result = new EnterGamePartyMemberList(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override EnterGamePartyMemberList MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.PartyMessage.EnterGamePartyMemberList.Descriptor; } + } + + public override EnterGamePartyMemberList DefaultInstanceForType { + get { return global::D3.PartyMessage.EnterGamePartyMemberList.DefaultInstance; } + } + + public override EnterGamePartyMemberList BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is EnterGamePartyMemberList) { + return MergeFrom((EnterGamePartyMemberList) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(EnterGamePartyMemberList other) { + if (other == global::D3.PartyMessage.EnterGamePartyMemberList.DefaultInstance) return this; + PrepareBuilder(); + if (other.member_.Count != 0) { + result.member_.Add(other.member_); + } + if (other.HasRequesterIndex) { + RequesterIndex = other.RequesterIndex; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_enterGamePartyMemberListFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _enterGamePartyMemberListFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.member_, global::D3.PartyMessage.EnterGamePartyMember.DefaultInstance, extensionRegistry); + break; + } + case 16: { + result.hasRequesterIndex = input.ReadInt32(ref result.requesterIndex_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList MemberList { + get { return PrepareBuilder().member_; } + } + public int MemberCount { + get { return result.MemberCount; } + } + public global::D3.PartyMessage.EnterGamePartyMember GetMember(int index) { + return result.GetMember(index); + } + public Builder SetMember(int index, global::D3.PartyMessage.EnterGamePartyMember value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.member_[index] = value; + return this; + } + public Builder SetMember(int index, global::D3.PartyMessage.EnterGamePartyMember.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.member_[index] = builderForValue.Build(); + return this; + } + public Builder AddMember(global::D3.PartyMessage.EnterGamePartyMember value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.member_.Add(value); + return this; + } + public Builder AddMember(global::D3.PartyMessage.EnterGamePartyMember.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.member_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeMember(scg::IEnumerable values) { + PrepareBuilder(); + result.member_.Add(values); + return this; + } + public Builder ClearMember() { + PrepareBuilder(); + result.member_.Clear(); + return this; + } + + public bool HasRequesterIndex { + get { return result.hasRequesterIndex; } + } + public int RequesterIndex { + get { return result.RequesterIndex; } + set { SetRequesterIndex(value); } + } + public Builder SetRequesterIndex(int value) { + PrepareBuilder(); + result.hasRequesterIndex = true; + result.requesterIndex_ = value; + return this; + } + public Builder ClearRequesterIndex() { + PrepareBuilder(); + result.hasRequesterIndex = false; + result.requesterIndex_ = 0; + return this; + } + } + static EnterGamePartyMemberList() { + object.ReferenceEquals(global::D3.PartyMessage.PartyMessage.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/LibMooNet/D3/Profile/Profile.cs b/src/LibMooNet/D3/Profile/Profile.cs new file mode 100644 index 00000000..fcf97f49 --- /dev/null +++ b/src/LibMooNet/D3/Profile/Profile.cs @@ -0,0 +1,4708 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace D3.Profile { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class Profile { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_D3_Profile_ClassInfo__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Profile_ClassInfo__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_Profile_SkillWithRune__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Profile_SkillWithRune__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_Profile_SkillsWithRunes__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Profile_SkillsWithRunes__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_Profile_PassiveSkills__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Profile_PassiveSkills__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_Profile_KillerInfo__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Profile_KillerInfo__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_Profile_HeroProfile__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Profile_HeroProfile__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_Profile_HeroProfileList__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Profile_HeroProfileList__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_D3_Profile_AccountProfile__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_Profile_AccountProfile__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static Profile() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "Cg1Qcm9maWxlLnByb3RvEgpEMy5Qcm9maWxlGhlBdHRyaWJ1dGVTZXJpYWxp" + + "emVyLnByb3RvGgtJdGVtcy5wcm90bxoTT25saW5lU2VydmljZS5wcm90bxoO" + + "R0JIYW5kbGUucHJvdG8iWQoJQ2xhc3NJbmZvEhMKCHBsYXl0aW1lGAEgASgE" + + "OgEwEhgKDWhpZ2hlc3RfbGV2ZWwYAiABKA06ATASHQoSaGlnaGVzdF9kaWZm" + + "aWN1bHR5GAMgASgNOgEwIjkKDVNraWxsV2l0aFJ1bmUSEQoFc2tpbGwYASAC" + + "KA86Ai0xEhUKCXJ1bmVfdHlwZRgCIAEoEToCLTEiOwoPU2tpbGxzV2l0aFJ1" + + "bmVzEigKBXJ1bmVzGAEgAygLMhkuRDMuUHJvZmlsZS5Ta2lsbFdpdGhSdW5l" + + "IiMKDVBhc3NpdmVTa2lsbHMSEgoKc25vX3RyYWl0cxgBIAMoDyJNCgpLaWxs" + + "ZXJJbmZvEhYKCnNub19raWxsZXIYASABKAU6Ai0xEg4KBnJhcml0eRgCIAEo" + + "DRIXCg9yYXJlX25hbWVfZ2JpZHMYAyADKAUi/gUKC0hlcm9Qcm9maWxlEhcK" + + "D21vbnN0ZXJzX2tpbGxlZBgBIAEoBBIVCg1lbGl0ZXNfa2lsbGVkGAIgASgE" + + "EhYKDmdvbGRfY29sbGVjdGVkGAMgASgEEhUKDWhpZ2hlc3RfbGV2ZWwYBCAB" + + "KA0SGgoSaGlnaGVzdF9kaWZmaWN1bHR5GAUgASgNEhMKC2NyZWF0ZV90aW1l" + + "GAYgASgNEhcKCGhhcmRjb3JlGAcgASgIOgVmYWxzZRIQCghzdHJlbmd0aBgI" + + "IAEoDRIRCglkZXh0ZXJpdHkYCSABKA0SFAoMaW50ZWxsaWdlbmNlGAogASgN" + + "EhAKCHZpdGFsaXR5GAsgASgNEg0KBWFybW9yGAwgASgNEgsKA2RwcxgNIAEo" + + "AhIVCg1yZXNpc3RfYXJjYW5lGA4gASgNEhMKC3Jlc2lzdF9maXJlGA8gASgN" + + "EhgKEHJlc2lzdF9saWdodG5pbmcYECABKA0SFQoNcmVzaXN0X3BvaXNvbhgR" + + "IAEoDRITCgtyZXNpc3RfY29sZBgSIAEoDRIlCgllcXVpcG1lbnQYEyABKAsy" + + "Ei5EMy5JdGVtcy5JdGVtTGlzdBI2ChFzbm9fYWN0aXZlX3NraWxscxgUIAEo" + + "CzIbLkQzLlByb2ZpbGUuU2tpbGxzV2l0aFJ1bmVzEi0KCnNub190cmFpdHMY" + + "FSABKAsyGS5EMy5Qcm9maWxlLlBhc3NpdmVTa2lsbHMSEgoKZGVhdGhfdGlt" + + "ZRgWIAEoDRIrCgtraWxsZXJfaW5mbxgXIAEoCzIWLkQzLlByb2ZpbGUuS2ls" + + "bGVySW5mbxIZChFzbm9fa2lsbF9sb2NhdGlvbhgYIAEoDRIrCgdoZXJvX2lk" + + "GBsgASgLMhouRDMuT25saW5lU2VydmljZS5FbnRpdHlJZBIXCg9kYW1hZ2Vf" + + "aW5jcmVhc2UYHCABKAISEwoLY3JpdF9jaGFuY2UYHSABKAISGAoQZGFtYWdl" + + "X3JlZHVjdGlvbhgeIAEoAhIMCgRsaWZlGB8gASgNIjkKD0hlcm9Qcm9maWxl" + + "TGlzdBImCgVoZXJvcxgBIAMoCzIXLkQzLlByb2ZpbGUuSGVyb1Byb2ZpbGUi" + + "twQKDkFjY291bnRQcm9maWxlEhoKEmhpZ2hlc3RfZGlmZmljdWx0eRgBIAEo" + + "DRIhChloaWdoZXN0X2Jvc3NfZGlmZmljdWx0eV8xGAIgASgNEiEKGWhpZ2hl" + + "c3RfYm9zc19kaWZmaWN1bHR5XzIYAyABKA0SIQoZaGlnaGVzdF9ib3NzX2Rp" + + "ZmZpY3VsdHlfMxgEIAEoDRIhChloaWdoZXN0X2Jvc3NfZGlmZmljdWx0eV80" + + "GAUgASgNEhoKD21vbnN0ZXJzX2tpbGxlZBgGIAEoBDoBMBIYCg1lbGl0ZXNf" + + "a2lsbGVkGAcgASgEOgEwEhkKDmdvbGRfY29sbGVjdGVkGAggASgEOgEwEh4K" + + "FmhpZ2hlc3RfaGFyZGNvcmVfbGV2ZWwYCSABKAQSIAoYaGFyZGNvcmVfbW9u" + + "c3RlcnNfa2lsbGVkGAogASgEEi4KD2NsYXNzX2JhcmJhcmlhbhgLIAEoCzIV" + + "LkQzLlByb2ZpbGUuQ2xhc3NJbmZvEjAKEWNsYXNzX2RlbW9uaHVudGVyGAwg" + + "ASgLMhUuRDMuUHJvZmlsZS5DbGFzc0luZm8SKQoKY2xhc3NfbW9uaxgNIAEo" + + "CzIVLkQzLlByb2ZpbGUuQ2xhc3NJbmZvEjAKEWNsYXNzX3dpdGNoZG9jdG9y" + + "GA4gASgLMhUuRDMuUHJvZmlsZS5DbGFzc0luZm8SKwoMY2xhc3Nfd2l6YXJk" + + "GA8gASgLMhUuRDMuUHJvZmlsZS5DbGFzc0luZm8="); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_D3_Profile_ClassInfo__Descriptor = Descriptor.MessageTypes[0]; + internal__static_D3_Profile_ClassInfo__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Profile_ClassInfo__Descriptor, + new string[] { "Playtime", "HighestLevel", "HighestDifficulty", }); + internal__static_D3_Profile_SkillWithRune__Descriptor = Descriptor.MessageTypes[1]; + internal__static_D3_Profile_SkillWithRune__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Profile_SkillWithRune__Descriptor, + new string[] { "Skill", "RuneType", }); + internal__static_D3_Profile_SkillsWithRunes__Descriptor = Descriptor.MessageTypes[2]; + internal__static_D3_Profile_SkillsWithRunes__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Profile_SkillsWithRunes__Descriptor, + new string[] { "Runes", }); + internal__static_D3_Profile_PassiveSkills__Descriptor = Descriptor.MessageTypes[3]; + internal__static_D3_Profile_PassiveSkills__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Profile_PassiveSkills__Descriptor, + new string[] { "SnoTraits", }); + internal__static_D3_Profile_KillerInfo__Descriptor = Descriptor.MessageTypes[4]; + internal__static_D3_Profile_KillerInfo__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Profile_KillerInfo__Descriptor, + new string[] { "SnoKiller", "Rarity", "RareNameGbids", }); + internal__static_D3_Profile_HeroProfile__Descriptor = Descriptor.MessageTypes[5]; + internal__static_D3_Profile_HeroProfile__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Profile_HeroProfile__Descriptor, + new string[] { "MonstersKilled", "ElitesKilled", "GoldCollected", "HighestLevel", "HighestDifficulty", "CreateTime", "Hardcore", "Strength", "Dexterity", "Intelligence", "Vitality", "Armor", "Dps", "ResistArcane", "ResistFire", "ResistLightning", "ResistPoison", "ResistCold", "Equipment", "SnoActiveSkills", "SnoTraits", "DeathTime", "KillerInfo", "SnoKillLocation", "HeroId", "DamageIncrease", "CritChance", "DamageReduction", "Life", }); + internal__static_D3_Profile_HeroProfileList__Descriptor = Descriptor.MessageTypes[6]; + internal__static_D3_Profile_HeroProfileList__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Profile_HeroProfileList__Descriptor, + new string[] { "Heros", }); + internal__static_D3_Profile_AccountProfile__Descriptor = Descriptor.MessageTypes[7]; + internal__static_D3_Profile_AccountProfile__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Profile_AccountProfile__Descriptor, + new string[] { "HighestDifficulty", "HighestBossDifficulty1", "HighestBossDifficulty2", "HighestBossDifficulty3", "HighestBossDifficulty4", "MonstersKilled", "ElitesKilled", "GoldCollected", "HighestHardcoreLevel", "HardcoreMonstersKilled", "ClassBarbarian", "ClassDemonhunter", "ClassMonk", "ClassWitchdoctor", "ClassWizard", }); + return null; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::D3.AttributeSerializer.AttributeSerializer.Descriptor, + global::D3.Items.Items.Descriptor, + global::D3.OnlineService.OnlineService.Descriptor, + global::D3.GameBalance.GBHandle.Descriptor, + }, assigner); + } + #endregion + + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ClassInfo : pb::GeneratedMessage { + private ClassInfo() { } + private static readonly ClassInfo defaultInstance = new ClassInfo().MakeReadOnly(); + private static readonly string[] _classInfoFieldNames = new string[] { "highest_difficulty", "highest_level", "playtime" }; + private static readonly uint[] _classInfoFieldTags = new uint[] { 24, 16, 8 }; + public static ClassInfo DefaultInstance { + get { return defaultInstance; } + } + + public override ClassInfo DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ClassInfo ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.Profile.Profile.internal__static_D3_Profile_ClassInfo__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.Profile.Profile.internal__static_D3_Profile_ClassInfo__FieldAccessorTable; } + } + + public const int PlaytimeFieldNumber = 1; + private bool hasPlaytime; + private ulong playtime_; + public bool HasPlaytime { + get { return hasPlaytime; } + } + public ulong Playtime { + get { return playtime_; } + } + + public const int HighestLevelFieldNumber = 2; + private bool hasHighestLevel; + private uint highestLevel_; + public bool HasHighestLevel { + get { return hasHighestLevel; } + } + public uint HighestLevel { + get { return highestLevel_; } + } + + public const int HighestDifficultyFieldNumber = 3; + private bool hasHighestDifficulty; + private uint highestDifficulty_; + public bool HasHighestDifficulty { + get { return hasHighestDifficulty; } + } + public uint HighestDifficulty { + get { return highestDifficulty_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _classInfoFieldNames; + if (hasPlaytime) { + output.WriteUInt64(1, field_names[2], Playtime); + } + if (hasHighestLevel) { + output.WriteUInt32(2, field_names[1], HighestLevel); + } + if (hasHighestDifficulty) { + output.WriteUInt32(3, field_names[0], HighestDifficulty); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasPlaytime) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, Playtime); + } + if (hasHighestLevel) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, HighestLevel); + } + if (hasHighestDifficulty) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, HighestDifficulty); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ClassInfo ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ClassInfo ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ClassInfo ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ClassInfo ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ClassInfo ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ClassInfo ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ClassInfo ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ClassInfo ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ClassInfo ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ClassInfo ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ClassInfo MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ClassInfo prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ClassInfo cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ClassInfo result; + + private ClassInfo PrepareBuilder() { + if (resultIsReadOnly) { + ClassInfo original = result; + result = new ClassInfo(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ClassInfo MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.Profile.ClassInfo.Descriptor; } + } + + public override ClassInfo DefaultInstanceForType { + get { return global::D3.Profile.ClassInfo.DefaultInstance; } + } + + public override ClassInfo BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ClassInfo) { + return MergeFrom((ClassInfo) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ClassInfo other) { + if (other == global::D3.Profile.ClassInfo.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasPlaytime) { + Playtime = other.Playtime; + } + if (other.HasHighestLevel) { + HighestLevel = other.HighestLevel; + } + if (other.HasHighestDifficulty) { + HighestDifficulty = other.HighestDifficulty; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_classInfoFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _classInfoFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasPlaytime = input.ReadUInt64(ref result.playtime_); + break; + } + case 16: { + result.hasHighestLevel = input.ReadUInt32(ref result.highestLevel_); + break; + } + case 24: { + result.hasHighestDifficulty = input.ReadUInt32(ref result.highestDifficulty_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasPlaytime { + get { return result.hasPlaytime; } + } + public ulong Playtime { + get { return result.Playtime; } + set { SetPlaytime(value); } + } + public Builder SetPlaytime(ulong value) { + PrepareBuilder(); + result.hasPlaytime = true; + result.playtime_ = value; + return this; + } + public Builder ClearPlaytime() { + PrepareBuilder(); + result.hasPlaytime = false; + result.playtime_ = 0UL; + return this; + } + + public bool HasHighestLevel { + get { return result.hasHighestLevel; } + } + public uint HighestLevel { + get { return result.HighestLevel; } + set { SetHighestLevel(value); } + } + public Builder SetHighestLevel(uint value) { + PrepareBuilder(); + result.hasHighestLevel = true; + result.highestLevel_ = value; + return this; + } + public Builder ClearHighestLevel() { + PrepareBuilder(); + result.hasHighestLevel = false; + result.highestLevel_ = 0; + return this; + } + + public bool HasHighestDifficulty { + get { return result.hasHighestDifficulty; } + } + public uint HighestDifficulty { + get { return result.HighestDifficulty; } + set { SetHighestDifficulty(value); } + } + public Builder SetHighestDifficulty(uint value) { + PrepareBuilder(); + result.hasHighestDifficulty = true; + result.highestDifficulty_ = value; + return this; + } + public Builder ClearHighestDifficulty() { + PrepareBuilder(); + result.hasHighestDifficulty = false; + result.highestDifficulty_ = 0; + return this; + } + } + static ClassInfo() { + object.ReferenceEquals(global::D3.Profile.Profile.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class SkillWithRune : pb::GeneratedMessage { + private SkillWithRune() { } + private static readonly SkillWithRune defaultInstance = new SkillWithRune().MakeReadOnly(); + private static readonly string[] _skillWithRuneFieldNames = new string[] { "rune_type", "skill" }; + private static readonly uint[] _skillWithRuneFieldTags = new uint[] { 16, 13 }; + public static SkillWithRune DefaultInstance { + get { return defaultInstance; } + } + + public override SkillWithRune DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SkillWithRune ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.Profile.Profile.internal__static_D3_Profile_SkillWithRune__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.Profile.Profile.internal__static_D3_Profile_SkillWithRune__FieldAccessorTable; } + } + + public const int SkillFieldNumber = 1; + private bool hasSkill; + private int skill_ = -1; + public bool HasSkill { + get { return hasSkill; } + } + public int Skill { + get { return skill_; } + } + + public const int RuneTypeFieldNumber = 2; + private bool hasRuneType; + private int runeType_ = -1; + public bool HasRuneType { + get { return hasRuneType; } + } + public int RuneType { + get { return runeType_; } + } + + public override bool IsInitialized { + get { + if (!hasSkill) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _skillWithRuneFieldNames; + if (hasSkill) { + output.WriteSFixed32(1, field_names[1], Skill); + } + if (hasRuneType) { + output.WriteSInt32(2, field_names[0], RuneType); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasSkill) { + size += pb::CodedOutputStream.ComputeSFixed32Size(1, Skill); + } + if (hasRuneType) { + size += pb::CodedOutputStream.ComputeSInt32Size(2, RuneType); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static SkillWithRune ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SkillWithRune ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SkillWithRune ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SkillWithRune ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SkillWithRune ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SkillWithRune ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SkillWithRune ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SkillWithRune ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SkillWithRune ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SkillWithRune ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SkillWithRune MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SkillWithRune prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SkillWithRune cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SkillWithRune result; + + private SkillWithRune PrepareBuilder() { + if (resultIsReadOnly) { + SkillWithRune original = result; + result = new SkillWithRune(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SkillWithRune MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.Profile.SkillWithRune.Descriptor; } + } + + public override SkillWithRune DefaultInstanceForType { + get { return global::D3.Profile.SkillWithRune.DefaultInstance; } + } + + public override SkillWithRune BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SkillWithRune) { + return MergeFrom((SkillWithRune) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SkillWithRune other) { + if (other == global::D3.Profile.SkillWithRune.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasSkill) { + Skill = other.Skill; + } + if (other.HasRuneType) { + RuneType = other.RuneType; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_skillWithRuneFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _skillWithRuneFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 13: { + result.hasSkill = input.ReadSFixed32(ref result.skill_); + break; + } + case 16: { + result.hasRuneType = input.ReadSInt32(ref result.runeType_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasSkill { + get { return result.hasSkill; } + } + public int Skill { + get { return result.Skill; } + set { SetSkill(value); } + } + public Builder SetSkill(int value) { + PrepareBuilder(); + result.hasSkill = true; + result.skill_ = value; + return this; + } + public Builder ClearSkill() { + PrepareBuilder(); + result.hasSkill = false; + result.skill_ = -1; + return this; + } + + public bool HasRuneType { + get { return result.hasRuneType; } + } + public int RuneType { + get { return result.RuneType; } + set { SetRuneType(value); } + } + public Builder SetRuneType(int value) { + PrepareBuilder(); + result.hasRuneType = true; + result.runeType_ = value; + return this; + } + public Builder ClearRuneType() { + PrepareBuilder(); + result.hasRuneType = false; + result.runeType_ = -1; + return this; + } + } + static SkillWithRune() { + object.ReferenceEquals(global::D3.Profile.Profile.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class SkillsWithRunes : pb::GeneratedMessage { + private SkillsWithRunes() { } + private static readonly SkillsWithRunes defaultInstance = new SkillsWithRunes().MakeReadOnly(); + private static readonly string[] _skillsWithRunesFieldNames = new string[] { "runes" }; + private static readonly uint[] _skillsWithRunesFieldTags = new uint[] { 10 }; + public static SkillsWithRunes DefaultInstance { + get { return defaultInstance; } + } + + public override SkillsWithRunes DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SkillsWithRunes ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.Profile.Profile.internal__static_D3_Profile_SkillsWithRunes__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.Profile.Profile.internal__static_D3_Profile_SkillsWithRunes__FieldAccessorTable; } + } + + public const int RunesFieldNumber = 1; + private pbc::PopsicleList runes_ = new pbc::PopsicleList(); + public scg::IList RunesList { + get { return runes_; } + } + public int RunesCount { + get { return runes_.Count; } + } + public global::D3.Profile.SkillWithRune GetRunes(int index) { + return runes_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::D3.Profile.SkillWithRune element in RunesList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _skillsWithRunesFieldNames; + if (runes_.Count > 0) { + output.WriteMessageArray(1, field_names[0], runes_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::D3.Profile.SkillWithRune element in RunesList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static SkillsWithRunes ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SkillsWithRunes ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SkillsWithRunes ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SkillsWithRunes ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SkillsWithRunes ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SkillsWithRunes ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SkillsWithRunes ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SkillsWithRunes ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SkillsWithRunes ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SkillsWithRunes ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SkillsWithRunes MakeReadOnly() { + runes_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SkillsWithRunes prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SkillsWithRunes cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SkillsWithRunes result; + + private SkillsWithRunes PrepareBuilder() { + if (resultIsReadOnly) { + SkillsWithRunes original = result; + result = new SkillsWithRunes(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SkillsWithRunes MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.Profile.SkillsWithRunes.Descriptor; } + } + + public override SkillsWithRunes DefaultInstanceForType { + get { return global::D3.Profile.SkillsWithRunes.DefaultInstance; } + } + + public override SkillsWithRunes BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SkillsWithRunes) { + return MergeFrom((SkillsWithRunes) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SkillsWithRunes other) { + if (other == global::D3.Profile.SkillsWithRunes.DefaultInstance) return this; + PrepareBuilder(); + if (other.runes_.Count != 0) { + result.runes_.Add(other.runes_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_skillsWithRunesFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _skillsWithRunesFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.runes_, global::D3.Profile.SkillWithRune.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList RunesList { + get { return PrepareBuilder().runes_; } + } + public int RunesCount { + get { return result.RunesCount; } + } + public global::D3.Profile.SkillWithRune GetRunes(int index) { + return result.GetRunes(index); + } + public Builder SetRunes(int index, global::D3.Profile.SkillWithRune value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.runes_[index] = value; + return this; + } + public Builder SetRunes(int index, global::D3.Profile.SkillWithRune.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.runes_[index] = builderForValue.Build(); + return this; + } + public Builder AddRunes(global::D3.Profile.SkillWithRune value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.runes_.Add(value); + return this; + } + public Builder AddRunes(global::D3.Profile.SkillWithRune.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.runes_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeRunes(scg::IEnumerable values) { + PrepareBuilder(); + result.runes_.Add(values); + return this; + } + public Builder ClearRunes() { + PrepareBuilder(); + result.runes_.Clear(); + return this; + } + } + static SkillsWithRunes() { + object.ReferenceEquals(global::D3.Profile.Profile.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class PassiveSkills : pb::GeneratedMessage { + private PassiveSkills() { } + private static readonly PassiveSkills defaultInstance = new PassiveSkills().MakeReadOnly(); + private static readonly string[] _passiveSkillsFieldNames = new string[] { "sno_traits" }; + private static readonly uint[] _passiveSkillsFieldTags = new uint[] { 13 }; + public static PassiveSkills DefaultInstance { + get { return defaultInstance; } + } + + public override PassiveSkills DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override PassiveSkills ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.Profile.Profile.internal__static_D3_Profile_PassiveSkills__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.Profile.Profile.internal__static_D3_Profile_PassiveSkills__FieldAccessorTable; } + } + + public const int SnoTraitsFieldNumber = 1; + private pbc::PopsicleList snoTraits_ = new pbc::PopsicleList(); + public scg::IList SnoTraitsList { + get { return pbc::Lists.AsReadOnly(snoTraits_); } + } + public int SnoTraitsCount { + get { return snoTraits_.Count; } + } + public int GetSnoTraits(int index) { + return snoTraits_[index]; + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _passiveSkillsFieldNames; + if (snoTraits_.Count > 0) { + output.WriteSFixed32Array(1, field_names[0], snoTraits_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + dataSize = 4 * snoTraits_.Count; + size += dataSize; + size += 1 * snoTraits_.Count; + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static PassiveSkills ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PassiveSkills ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PassiveSkills ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PassiveSkills ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PassiveSkills ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PassiveSkills ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static PassiveSkills ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static PassiveSkills ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static PassiveSkills ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PassiveSkills ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private PassiveSkills MakeReadOnly() { + snoTraits_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(PassiveSkills prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(PassiveSkills cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private PassiveSkills result; + + private PassiveSkills PrepareBuilder() { + if (resultIsReadOnly) { + PassiveSkills original = result; + result = new PassiveSkills(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override PassiveSkills MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.Profile.PassiveSkills.Descriptor; } + } + + public override PassiveSkills DefaultInstanceForType { + get { return global::D3.Profile.PassiveSkills.DefaultInstance; } + } + + public override PassiveSkills BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is PassiveSkills) { + return MergeFrom((PassiveSkills) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(PassiveSkills other) { + if (other == global::D3.Profile.PassiveSkills.DefaultInstance) return this; + PrepareBuilder(); + if (other.snoTraits_.Count != 0) { + result.snoTraits_.Add(other.snoTraits_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_passiveSkillsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _passiveSkillsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: + case 13: { + input.ReadSFixed32Array(tag, field_name, result.snoTraits_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList SnoTraitsList { + get { return PrepareBuilder().snoTraits_; } + } + public int SnoTraitsCount { + get { return result.SnoTraitsCount; } + } + public int GetSnoTraits(int index) { + return result.GetSnoTraits(index); + } + public Builder SetSnoTraits(int index, int value) { + PrepareBuilder(); + result.snoTraits_[index] = value; + return this; + } + public Builder AddSnoTraits(int value) { + PrepareBuilder(); + result.snoTraits_.Add(value); + return this; + } + public Builder AddRangeSnoTraits(scg::IEnumerable values) { + PrepareBuilder(); + result.snoTraits_.Add(values); + return this; + } + public Builder ClearSnoTraits() { + PrepareBuilder(); + result.snoTraits_.Clear(); + return this; + } + } + static PassiveSkills() { + object.ReferenceEquals(global::D3.Profile.Profile.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class KillerInfo : pb::GeneratedMessage { + private KillerInfo() { } + private static readonly KillerInfo defaultInstance = new KillerInfo().MakeReadOnly(); + private static readonly string[] _killerInfoFieldNames = new string[] { "rare_name_gbids", "rarity", "sno_killer" }; + private static readonly uint[] _killerInfoFieldTags = new uint[] { 24, 16, 8 }; + public static KillerInfo DefaultInstance { + get { return defaultInstance; } + } + + public override KillerInfo DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override KillerInfo ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.Profile.Profile.internal__static_D3_Profile_KillerInfo__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.Profile.Profile.internal__static_D3_Profile_KillerInfo__FieldAccessorTable; } + } + + public const int SnoKillerFieldNumber = 1; + private bool hasSnoKiller; + private int snoKiller_ = -1; + public bool HasSnoKiller { + get { return hasSnoKiller; } + } + public int SnoKiller { + get { return snoKiller_; } + } + + public const int RarityFieldNumber = 2; + private bool hasRarity; + private uint rarity_; + public bool HasRarity { + get { return hasRarity; } + } + public uint Rarity { + get { return rarity_; } + } + + public const int RareNameGbidsFieldNumber = 3; + private pbc::PopsicleList rareNameGbids_ = new pbc::PopsicleList(); + public scg::IList RareNameGbidsList { + get { return pbc::Lists.AsReadOnly(rareNameGbids_); } + } + public int RareNameGbidsCount { + get { return rareNameGbids_.Count; } + } + public int GetRareNameGbids(int index) { + return rareNameGbids_[index]; + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _killerInfoFieldNames; + if (hasSnoKiller) { + output.WriteInt32(1, field_names[2], SnoKiller); + } + if (hasRarity) { + output.WriteUInt32(2, field_names[1], Rarity); + } + if (rareNameGbids_.Count > 0) { + output.WriteInt32Array(3, field_names[0], rareNameGbids_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasSnoKiller) { + size += pb::CodedOutputStream.ComputeInt32Size(1, SnoKiller); + } + if (hasRarity) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, Rarity); + } + { + int dataSize = 0; + foreach (int element in RareNameGbidsList) { + dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); + } + size += dataSize; + size += 1 * rareNameGbids_.Count; + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static KillerInfo ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static KillerInfo ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static KillerInfo ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static KillerInfo ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static KillerInfo ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static KillerInfo ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static KillerInfo ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static KillerInfo ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static KillerInfo ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static KillerInfo ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private KillerInfo MakeReadOnly() { + rareNameGbids_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(KillerInfo prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(KillerInfo cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private KillerInfo result; + + private KillerInfo PrepareBuilder() { + if (resultIsReadOnly) { + KillerInfo original = result; + result = new KillerInfo(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override KillerInfo MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.Profile.KillerInfo.Descriptor; } + } + + public override KillerInfo DefaultInstanceForType { + get { return global::D3.Profile.KillerInfo.DefaultInstance; } + } + + public override KillerInfo BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is KillerInfo) { + return MergeFrom((KillerInfo) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(KillerInfo other) { + if (other == global::D3.Profile.KillerInfo.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasSnoKiller) { + SnoKiller = other.SnoKiller; + } + if (other.HasRarity) { + Rarity = other.Rarity; + } + if (other.rareNameGbids_.Count != 0) { + result.rareNameGbids_.Add(other.rareNameGbids_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_killerInfoFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _killerInfoFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasSnoKiller = input.ReadInt32(ref result.snoKiller_); + break; + } + case 16: { + result.hasRarity = input.ReadUInt32(ref result.rarity_); + break; + } + case 26: + case 24: { + input.ReadInt32Array(tag, field_name, result.rareNameGbids_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasSnoKiller { + get { return result.hasSnoKiller; } + } + public int SnoKiller { + get { return result.SnoKiller; } + set { SetSnoKiller(value); } + } + public Builder SetSnoKiller(int value) { + PrepareBuilder(); + result.hasSnoKiller = true; + result.snoKiller_ = value; + return this; + } + public Builder ClearSnoKiller() { + PrepareBuilder(); + result.hasSnoKiller = false; + result.snoKiller_ = -1; + return this; + } + + public bool HasRarity { + get { return result.hasRarity; } + } + public uint Rarity { + get { return result.Rarity; } + set { SetRarity(value); } + } + public Builder SetRarity(uint value) { + PrepareBuilder(); + result.hasRarity = true; + result.rarity_ = value; + return this; + } + public Builder ClearRarity() { + PrepareBuilder(); + result.hasRarity = false; + result.rarity_ = 0; + return this; + } + + public pbc::IPopsicleList RareNameGbidsList { + get { return PrepareBuilder().rareNameGbids_; } + } + public int RareNameGbidsCount { + get { return result.RareNameGbidsCount; } + } + public int GetRareNameGbids(int index) { + return result.GetRareNameGbids(index); + } + public Builder SetRareNameGbids(int index, int value) { + PrepareBuilder(); + result.rareNameGbids_[index] = value; + return this; + } + public Builder AddRareNameGbids(int value) { + PrepareBuilder(); + result.rareNameGbids_.Add(value); + return this; + } + public Builder AddRangeRareNameGbids(scg::IEnumerable values) { + PrepareBuilder(); + result.rareNameGbids_.Add(values); + return this; + } + public Builder ClearRareNameGbids() { + PrepareBuilder(); + result.rareNameGbids_.Clear(); + return this; + } + } + static KillerInfo() { + object.ReferenceEquals(global::D3.Profile.Profile.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class HeroProfile : pb::GeneratedMessage { + private HeroProfile() { } + private static readonly HeroProfile defaultInstance = new HeroProfile().MakeReadOnly(); + private static readonly string[] _heroProfileFieldNames = new string[] { "armor", "create_time", "crit_chance", "damage_increase", "damage_reduction", "death_time", "dexterity", "dps", "elites_killed", "equipment", "gold_collected", "hardcore", "hero_id", "highest_difficulty", "highest_level", "intelligence", "killer_info", "life", "monsters_killed", "resist_arcane", "resist_cold", "resist_fire", "resist_lightning", "resist_poison", "sno_active_skills", "sno_kill_location", "sno_traits", "strength", "vitality" }; + private static readonly uint[] _heroProfileFieldTags = new uint[] { 96, 48, 237, 229, 245, 176, 72, 109, 16, 154, 24, 56, 218, 40, 32, 80, 186, 248, 8, 112, 144, 120, 128, 136, 162, 192, 170, 64, 88 }; + public static HeroProfile DefaultInstance { + get { return defaultInstance; } + } + + public override HeroProfile DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override HeroProfile ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.Profile.Profile.internal__static_D3_Profile_HeroProfile__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.Profile.Profile.internal__static_D3_Profile_HeroProfile__FieldAccessorTable; } + } + + public const int MonstersKilledFieldNumber = 1; + private bool hasMonstersKilled; + private ulong monstersKilled_; + public bool HasMonstersKilled { + get { return hasMonstersKilled; } + } + public ulong MonstersKilled { + get { return monstersKilled_; } + } + + public const int ElitesKilledFieldNumber = 2; + private bool hasElitesKilled; + private ulong elitesKilled_; + public bool HasElitesKilled { + get { return hasElitesKilled; } + } + public ulong ElitesKilled { + get { return elitesKilled_; } + } + + public const int GoldCollectedFieldNumber = 3; + private bool hasGoldCollected; + private ulong goldCollected_; + public bool HasGoldCollected { + get { return hasGoldCollected; } + } + public ulong GoldCollected { + get { return goldCollected_; } + } + + public const int HighestLevelFieldNumber = 4; + private bool hasHighestLevel; + private uint highestLevel_; + public bool HasHighestLevel { + get { return hasHighestLevel; } + } + public uint HighestLevel { + get { return highestLevel_; } + } + + public const int HighestDifficultyFieldNumber = 5; + private bool hasHighestDifficulty; + private uint highestDifficulty_; + public bool HasHighestDifficulty { + get { return hasHighestDifficulty; } + } + public uint HighestDifficulty { + get { return highestDifficulty_; } + } + + public const int CreateTimeFieldNumber = 6; + private bool hasCreateTime; + private uint createTime_; + public bool HasCreateTime { + get { return hasCreateTime; } + } + public uint CreateTime { + get { return createTime_; } + } + + public const int HardcoreFieldNumber = 7; + private bool hasHardcore; + private bool hardcore_; + public bool HasHardcore { + get { return hasHardcore; } + } + public bool Hardcore { + get { return hardcore_; } + } + + public const int StrengthFieldNumber = 8; + private bool hasStrength; + private uint strength_; + public bool HasStrength { + get { return hasStrength; } + } + public uint Strength { + get { return strength_; } + } + + public const int DexterityFieldNumber = 9; + private bool hasDexterity; + private uint dexterity_; + public bool HasDexterity { + get { return hasDexterity; } + } + public uint Dexterity { + get { return dexterity_; } + } + + public const int IntelligenceFieldNumber = 10; + private bool hasIntelligence; + private uint intelligence_; + public bool HasIntelligence { + get { return hasIntelligence; } + } + public uint Intelligence { + get { return intelligence_; } + } + + public const int VitalityFieldNumber = 11; + private bool hasVitality; + private uint vitality_; + public bool HasVitality { + get { return hasVitality; } + } + public uint Vitality { + get { return vitality_; } + } + + public const int ArmorFieldNumber = 12; + private bool hasArmor; + private uint armor_; + public bool HasArmor { + get { return hasArmor; } + } + public uint Armor { + get { return armor_; } + } + + public const int DpsFieldNumber = 13; + private bool hasDps; + private float dps_; + public bool HasDps { + get { return hasDps; } + } + public float Dps { + get { return dps_; } + } + + public const int ResistArcaneFieldNumber = 14; + private bool hasResistArcane; + private uint resistArcane_; + public bool HasResistArcane { + get { return hasResistArcane; } + } + public uint ResistArcane { + get { return resistArcane_; } + } + + public const int ResistFireFieldNumber = 15; + private bool hasResistFire; + private uint resistFire_; + public bool HasResistFire { + get { return hasResistFire; } + } + public uint ResistFire { + get { return resistFire_; } + } + + public const int ResistLightningFieldNumber = 16; + private bool hasResistLightning; + private uint resistLightning_; + public bool HasResistLightning { + get { return hasResistLightning; } + } + public uint ResistLightning { + get { return resistLightning_; } + } + + public const int ResistPoisonFieldNumber = 17; + private bool hasResistPoison; + private uint resistPoison_; + public bool HasResistPoison { + get { return hasResistPoison; } + } + public uint ResistPoison { + get { return resistPoison_; } + } + + public const int ResistColdFieldNumber = 18; + private bool hasResistCold; + private uint resistCold_; + public bool HasResistCold { + get { return hasResistCold; } + } + public uint ResistCold { + get { return resistCold_; } + } + + public const int EquipmentFieldNumber = 19; + private bool hasEquipment; + private global::D3.Items.ItemList equipment_; + public bool HasEquipment { + get { return hasEquipment; } + } + public global::D3.Items.ItemList Equipment { + get { return equipment_ ?? global::D3.Items.ItemList.DefaultInstance; } + } + + public const int SnoActiveSkillsFieldNumber = 20; + private bool hasSnoActiveSkills; + private global::D3.Profile.SkillsWithRunes snoActiveSkills_; + public bool HasSnoActiveSkills { + get { return hasSnoActiveSkills; } + } + public global::D3.Profile.SkillsWithRunes SnoActiveSkills { + get { return snoActiveSkills_ ?? global::D3.Profile.SkillsWithRunes.DefaultInstance; } + } + + public const int SnoTraitsFieldNumber = 21; + private bool hasSnoTraits; + private global::D3.Profile.PassiveSkills snoTraits_; + public bool HasSnoTraits { + get { return hasSnoTraits; } + } + public global::D3.Profile.PassiveSkills SnoTraits { + get { return snoTraits_ ?? global::D3.Profile.PassiveSkills.DefaultInstance; } + } + + public const int DeathTimeFieldNumber = 22; + private bool hasDeathTime; + private uint deathTime_; + public bool HasDeathTime { + get { return hasDeathTime; } + } + public uint DeathTime { + get { return deathTime_; } + } + + public const int KillerInfoFieldNumber = 23; + private bool hasKillerInfo; + private global::D3.Profile.KillerInfo killerInfo_; + public bool HasKillerInfo { + get { return hasKillerInfo; } + } + public global::D3.Profile.KillerInfo KillerInfo { + get { return killerInfo_ ?? global::D3.Profile.KillerInfo.DefaultInstance; } + } + + public const int SnoKillLocationFieldNumber = 24; + private bool hasSnoKillLocation; + private uint snoKillLocation_; + public bool HasSnoKillLocation { + get { return hasSnoKillLocation; } + } + public uint SnoKillLocation { + get { return snoKillLocation_; } + } + + public const int HeroIdFieldNumber = 27; + private bool hasHeroId; + private global::D3.OnlineService.EntityId heroId_; + public bool HasHeroId { + get { return hasHeroId; } + } + public global::D3.OnlineService.EntityId HeroId { + get { return heroId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + + public const int DamageIncreaseFieldNumber = 28; + private bool hasDamageIncrease; + private float damageIncrease_; + public bool HasDamageIncrease { + get { return hasDamageIncrease; } + } + public float DamageIncrease { + get { return damageIncrease_; } + } + + public const int CritChanceFieldNumber = 29; + private bool hasCritChance; + private float critChance_; + public bool HasCritChance { + get { return hasCritChance; } + } + public float CritChance { + get { return critChance_; } + } + + public const int DamageReductionFieldNumber = 30; + private bool hasDamageReduction; + private float damageReduction_; + public bool HasDamageReduction { + get { return hasDamageReduction; } + } + public float DamageReduction { + get { return damageReduction_; } + } + + public const int LifeFieldNumber = 31; + private bool hasLife; + private uint life_; + public bool HasLife { + get { return hasLife; } + } + public uint Life { + get { return life_; } + } + + public override bool IsInitialized { + get { + if (HasEquipment) { + if (!Equipment.IsInitialized) return false; + } + if (HasSnoActiveSkills) { + if (!SnoActiveSkills.IsInitialized) return false; + } + if (HasHeroId) { + if (!HeroId.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _heroProfileFieldNames; + if (hasMonstersKilled) { + output.WriteUInt64(1, field_names[18], MonstersKilled); + } + if (hasElitesKilled) { + output.WriteUInt64(2, field_names[8], ElitesKilled); + } + if (hasGoldCollected) { + output.WriteUInt64(3, field_names[10], GoldCollected); + } + if (hasHighestLevel) { + output.WriteUInt32(4, field_names[14], HighestLevel); + } + if (hasHighestDifficulty) { + output.WriteUInt32(5, field_names[13], HighestDifficulty); + } + if (hasCreateTime) { + output.WriteUInt32(6, field_names[1], CreateTime); + } + if (hasHardcore) { + output.WriteBool(7, field_names[11], Hardcore); + } + if (hasStrength) { + output.WriteUInt32(8, field_names[27], Strength); + } + if (hasDexterity) { + output.WriteUInt32(9, field_names[6], Dexterity); + } + if (hasIntelligence) { + output.WriteUInt32(10, field_names[15], Intelligence); + } + if (hasVitality) { + output.WriteUInt32(11, field_names[28], Vitality); + } + if (hasArmor) { + output.WriteUInt32(12, field_names[0], Armor); + } + if (hasDps) { + output.WriteFloat(13, field_names[7], Dps); + } + if (hasResistArcane) { + output.WriteUInt32(14, field_names[19], ResistArcane); + } + if (hasResistFire) { + output.WriteUInt32(15, field_names[21], ResistFire); + } + if (hasResistLightning) { + output.WriteUInt32(16, field_names[22], ResistLightning); + } + if (hasResistPoison) { + output.WriteUInt32(17, field_names[23], ResistPoison); + } + if (hasResistCold) { + output.WriteUInt32(18, field_names[20], ResistCold); + } + if (hasEquipment) { + output.WriteMessage(19, field_names[9], Equipment); + } + if (hasSnoActiveSkills) { + output.WriteMessage(20, field_names[24], SnoActiveSkills); + } + if (hasSnoTraits) { + output.WriteMessage(21, field_names[26], SnoTraits); + } + if (hasDeathTime) { + output.WriteUInt32(22, field_names[5], DeathTime); + } + if (hasKillerInfo) { + output.WriteMessage(23, field_names[16], KillerInfo); + } + if (hasSnoKillLocation) { + output.WriteUInt32(24, field_names[25], SnoKillLocation); + } + if (hasHeroId) { + output.WriteMessage(27, field_names[12], HeroId); + } + if (hasDamageIncrease) { + output.WriteFloat(28, field_names[3], DamageIncrease); + } + if (hasCritChance) { + output.WriteFloat(29, field_names[2], CritChance); + } + if (hasDamageReduction) { + output.WriteFloat(30, field_names[4], DamageReduction); + } + if (hasLife) { + output.WriteUInt32(31, field_names[17], Life); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasMonstersKilled) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, MonstersKilled); + } + if (hasElitesKilled) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, ElitesKilled); + } + if (hasGoldCollected) { + size += pb::CodedOutputStream.ComputeUInt64Size(3, GoldCollected); + } + if (hasHighestLevel) { + size += pb::CodedOutputStream.ComputeUInt32Size(4, HighestLevel); + } + if (hasHighestDifficulty) { + size += pb::CodedOutputStream.ComputeUInt32Size(5, HighestDifficulty); + } + if (hasCreateTime) { + size += pb::CodedOutputStream.ComputeUInt32Size(6, CreateTime); + } + if (hasHardcore) { + size += pb::CodedOutputStream.ComputeBoolSize(7, Hardcore); + } + if (hasStrength) { + size += pb::CodedOutputStream.ComputeUInt32Size(8, Strength); + } + if (hasDexterity) { + size += pb::CodedOutputStream.ComputeUInt32Size(9, Dexterity); + } + if (hasIntelligence) { + size += pb::CodedOutputStream.ComputeUInt32Size(10, Intelligence); + } + if (hasVitality) { + size += pb::CodedOutputStream.ComputeUInt32Size(11, Vitality); + } + if (hasArmor) { + size += pb::CodedOutputStream.ComputeUInt32Size(12, Armor); + } + if (hasDps) { + size += pb::CodedOutputStream.ComputeFloatSize(13, Dps); + } + if (hasResistArcane) { + size += pb::CodedOutputStream.ComputeUInt32Size(14, ResistArcane); + } + if (hasResistFire) { + size += pb::CodedOutputStream.ComputeUInt32Size(15, ResistFire); + } + if (hasResistLightning) { + size += pb::CodedOutputStream.ComputeUInt32Size(16, ResistLightning); + } + if (hasResistPoison) { + size += pb::CodedOutputStream.ComputeUInt32Size(17, ResistPoison); + } + if (hasResistCold) { + size += pb::CodedOutputStream.ComputeUInt32Size(18, ResistCold); + } + if (hasEquipment) { + size += pb::CodedOutputStream.ComputeMessageSize(19, Equipment); + } + if (hasSnoActiveSkills) { + size += pb::CodedOutputStream.ComputeMessageSize(20, SnoActiveSkills); + } + if (hasSnoTraits) { + size += pb::CodedOutputStream.ComputeMessageSize(21, SnoTraits); + } + if (hasDeathTime) { + size += pb::CodedOutputStream.ComputeUInt32Size(22, DeathTime); + } + if (hasKillerInfo) { + size += pb::CodedOutputStream.ComputeMessageSize(23, KillerInfo); + } + if (hasSnoKillLocation) { + size += pb::CodedOutputStream.ComputeUInt32Size(24, SnoKillLocation); + } + if (hasHeroId) { + size += pb::CodedOutputStream.ComputeMessageSize(27, HeroId); + } + if (hasDamageIncrease) { + size += pb::CodedOutputStream.ComputeFloatSize(28, DamageIncrease); + } + if (hasCritChance) { + size += pb::CodedOutputStream.ComputeFloatSize(29, CritChance); + } + if (hasDamageReduction) { + size += pb::CodedOutputStream.ComputeFloatSize(30, DamageReduction); + } + if (hasLife) { + size += pb::CodedOutputStream.ComputeUInt32Size(31, Life); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static HeroProfile ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static HeroProfile ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static HeroProfile ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static HeroProfile ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static HeroProfile ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static HeroProfile ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static HeroProfile ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static HeroProfile ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static HeroProfile ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static HeroProfile ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private HeroProfile MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(HeroProfile prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(HeroProfile cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private HeroProfile result; + + private HeroProfile PrepareBuilder() { + if (resultIsReadOnly) { + HeroProfile original = result; + result = new HeroProfile(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override HeroProfile MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.Profile.HeroProfile.Descriptor; } + } + + public override HeroProfile DefaultInstanceForType { + get { return global::D3.Profile.HeroProfile.DefaultInstance; } + } + + public override HeroProfile BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is HeroProfile) { + return MergeFrom((HeroProfile) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(HeroProfile other) { + if (other == global::D3.Profile.HeroProfile.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasMonstersKilled) { + MonstersKilled = other.MonstersKilled; + } + if (other.HasElitesKilled) { + ElitesKilled = other.ElitesKilled; + } + if (other.HasGoldCollected) { + GoldCollected = other.GoldCollected; + } + if (other.HasHighestLevel) { + HighestLevel = other.HighestLevel; + } + if (other.HasHighestDifficulty) { + HighestDifficulty = other.HighestDifficulty; + } + if (other.HasCreateTime) { + CreateTime = other.CreateTime; + } + if (other.HasHardcore) { + Hardcore = other.Hardcore; + } + if (other.HasStrength) { + Strength = other.Strength; + } + if (other.HasDexterity) { + Dexterity = other.Dexterity; + } + if (other.HasIntelligence) { + Intelligence = other.Intelligence; + } + if (other.HasVitality) { + Vitality = other.Vitality; + } + if (other.HasArmor) { + Armor = other.Armor; + } + if (other.HasDps) { + Dps = other.Dps; + } + if (other.HasResistArcane) { + ResistArcane = other.ResistArcane; + } + if (other.HasResistFire) { + ResistFire = other.ResistFire; + } + if (other.HasResistLightning) { + ResistLightning = other.ResistLightning; + } + if (other.HasResistPoison) { + ResistPoison = other.ResistPoison; + } + if (other.HasResistCold) { + ResistCold = other.ResistCold; + } + if (other.HasEquipment) { + MergeEquipment(other.Equipment); + } + if (other.HasSnoActiveSkills) { + MergeSnoActiveSkills(other.SnoActiveSkills); + } + if (other.HasSnoTraits) { + MergeSnoTraits(other.SnoTraits); + } + if (other.HasDeathTime) { + DeathTime = other.DeathTime; + } + if (other.HasKillerInfo) { + MergeKillerInfo(other.KillerInfo); + } + if (other.HasSnoKillLocation) { + SnoKillLocation = other.SnoKillLocation; + } + if (other.HasHeroId) { + MergeHeroId(other.HeroId); + } + if (other.HasDamageIncrease) { + DamageIncrease = other.DamageIncrease; + } + if (other.HasCritChance) { + CritChance = other.CritChance; + } + if (other.HasDamageReduction) { + DamageReduction = other.DamageReduction; + } + if (other.HasLife) { + Life = other.Life; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_heroProfileFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _heroProfileFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasMonstersKilled = input.ReadUInt64(ref result.monstersKilled_); + break; + } + case 16: { + result.hasElitesKilled = input.ReadUInt64(ref result.elitesKilled_); + break; + } + case 24: { + result.hasGoldCollected = input.ReadUInt64(ref result.goldCollected_); + break; + } + case 32: { + result.hasHighestLevel = input.ReadUInt32(ref result.highestLevel_); + break; + } + case 40: { + result.hasHighestDifficulty = input.ReadUInt32(ref result.highestDifficulty_); + break; + } + case 48: { + result.hasCreateTime = input.ReadUInt32(ref result.createTime_); + break; + } + case 56: { + result.hasHardcore = input.ReadBool(ref result.hardcore_); + break; + } + case 64: { + result.hasStrength = input.ReadUInt32(ref result.strength_); + break; + } + case 72: { + result.hasDexterity = input.ReadUInt32(ref result.dexterity_); + break; + } + case 80: { + result.hasIntelligence = input.ReadUInt32(ref result.intelligence_); + break; + } + case 88: { + result.hasVitality = input.ReadUInt32(ref result.vitality_); + break; + } + case 96: { + result.hasArmor = input.ReadUInt32(ref result.armor_); + break; + } + case 109: { + result.hasDps = input.ReadFloat(ref result.dps_); + break; + } + case 112: { + result.hasResistArcane = input.ReadUInt32(ref result.resistArcane_); + break; + } + case 120: { + result.hasResistFire = input.ReadUInt32(ref result.resistFire_); + break; + } + case 128: { + result.hasResistLightning = input.ReadUInt32(ref result.resistLightning_); + break; + } + case 136: { + result.hasResistPoison = input.ReadUInt32(ref result.resistPoison_); + break; + } + case 144: { + result.hasResistCold = input.ReadUInt32(ref result.resistCold_); + break; + } + case 154: { + global::D3.Items.ItemList.Builder subBuilder = global::D3.Items.ItemList.CreateBuilder(); + if (result.hasEquipment) { + subBuilder.MergeFrom(Equipment); + } + input.ReadMessage(subBuilder, extensionRegistry); + Equipment = subBuilder.BuildPartial(); + break; + } + case 162: { + global::D3.Profile.SkillsWithRunes.Builder subBuilder = global::D3.Profile.SkillsWithRunes.CreateBuilder(); + if (result.hasSnoActiveSkills) { + subBuilder.MergeFrom(SnoActiveSkills); + } + input.ReadMessage(subBuilder, extensionRegistry); + SnoActiveSkills = subBuilder.BuildPartial(); + break; + } + case 170: { + global::D3.Profile.PassiveSkills.Builder subBuilder = global::D3.Profile.PassiveSkills.CreateBuilder(); + if (result.hasSnoTraits) { + subBuilder.MergeFrom(SnoTraits); + } + input.ReadMessage(subBuilder, extensionRegistry); + SnoTraits = subBuilder.BuildPartial(); + break; + } + case 176: { + result.hasDeathTime = input.ReadUInt32(ref result.deathTime_); + break; + } + case 186: { + global::D3.Profile.KillerInfo.Builder subBuilder = global::D3.Profile.KillerInfo.CreateBuilder(); + if (result.hasKillerInfo) { + subBuilder.MergeFrom(KillerInfo); + } + input.ReadMessage(subBuilder, extensionRegistry); + KillerInfo = subBuilder.BuildPartial(); + break; + } + case 192: { + result.hasSnoKillLocation = input.ReadUInt32(ref result.snoKillLocation_); + break; + } + case 218: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasHeroId) { + subBuilder.MergeFrom(HeroId); + } + input.ReadMessage(subBuilder, extensionRegistry); + HeroId = subBuilder.BuildPartial(); + break; + } + case 229: { + result.hasDamageIncrease = input.ReadFloat(ref result.damageIncrease_); + break; + } + case 237: { + result.hasCritChance = input.ReadFloat(ref result.critChance_); + break; + } + case 245: { + result.hasDamageReduction = input.ReadFloat(ref result.damageReduction_); + break; + } + case 248: { + result.hasLife = input.ReadUInt32(ref result.life_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasMonstersKilled { + get { return result.hasMonstersKilled; } + } + public ulong MonstersKilled { + get { return result.MonstersKilled; } + set { SetMonstersKilled(value); } + } + public Builder SetMonstersKilled(ulong value) { + PrepareBuilder(); + result.hasMonstersKilled = true; + result.monstersKilled_ = value; + return this; + } + public Builder ClearMonstersKilled() { + PrepareBuilder(); + result.hasMonstersKilled = false; + result.monstersKilled_ = 0UL; + return this; + } + + public bool HasElitesKilled { + get { return result.hasElitesKilled; } + } + public ulong ElitesKilled { + get { return result.ElitesKilled; } + set { SetElitesKilled(value); } + } + public Builder SetElitesKilled(ulong value) { + PrepareBuilder(); + result.hasElitesKilled = true; + result.elitesKilled_ = value; + return this; + } + public Builder ClearElitesKilled() { + PrepareBuilder(); + result.hasElitesKilled = false; + result.elitesKilled_ = 0UL; + return this; + } + + public bool HasGoldCollected { + get { return result.hasGoldCollected; } + } + public ulong GoldCollected { + get { return result.GoldCollected; } + set { SetGoldCollected(value); } + } + public Builder SetGoldCollected(ulong value) { + PrepareBuilder(); + result.hasGoldCollected = true; + result.goldCollected_ = value; + return this; + } + public Builder ClearGoldCollected() { + PrepareBuilder(); + result.hasGoldCollected = false; + result.goldCollected_ = 0UL; + return this; + } + + public bool HasHighestLevel { + get { return result.hasHighestLevel; } + } + public uint HighestLevel { + get { return result.HighestLevel; } + set { SetHighestLevel(value); } + } + public Builder SetHighestLevel(uint value) { + PrepareBuilder(); + result.hasHighestLevel = true; + result.highestLevel_ = value; + return this; + } + public Builder ClearHighestLevel() { + PrepareBuilder(); + result.hasHighestLevel = false; + result.highestLevel_ = 0; + return this; + } + + public bool HasHighestDifficulty { + get { return result.hasHighestDifficulty; } + } + public uint HighestDifficulty { + get { return result.HighestDifficulty; } + set { SetHighestDifficulty(value); } + } + public Builder SetHighestDifficulty(uint value) { + PrepareBuilder(); + result.hasHighestDifficulty = true; + result.highestDifficulty_ = value; + return this; + } + public Builder ClearHighestDifficulty() { + PrepareBuilder(); + result.hasHighestDifficulty = false; + result.highestDifficulty_ = 0; + return this; + } + + public bool HasCreateTime { + get { return result.hasCreateTime; } + } + public uint CreateTime { + get { return result.CreateTime; } + set { SetCreateTime(value); } + } + public Builder SetCreateTime(uint value) { + PrepareBuilder(); + result.hasCreateTime = true; + result.createTime_ = value; + return this; + } + public Builder ClearCreateTime() { + PrepareBuilder(); + result.hasCreateTime = false; + result.createTime_ = 0; + return this; + } + + public bool HasHardcore { + get { return result.hasHardcore; } + } + public bool Hardcore { + get { return result.Hardcore; } + set { SetHardcore(value); } + } + public Builder SetHardcore(bool value) { + PrepareBuilder(); + result.hasHardcore = true; + result.hardcore_ = value; + return this; + } + public Builder ClearHardcore() { + PrepareBuilder(); + result.hasHardcore = false; + result.hardcore_ = false; + return this; + } + + public bool HasStrength { + get { return result.hasStrength; } + } + public uint Strength { + get { return result.Strength; } + set { SetStrength(value); } + } + public Builder SetStrength(uint value) { + PrepareBuilder(); + result.hasStrength = true; + result.strength_ = value; + return this; + } + public Builder ClearStrength() { + PrepareBuilder(); + result.hasStrength = false; + result.strength_ = 0; + return this; + } + + public bool HasDexterity { + get { return result.hasDexterity; } + } + public uint Dexterity { + get { return result.Dexterity; } + set { SetDexterity(value); } + } + public Builder SetDexterity(uint value) { + PrepareBuilder(); + result.hasDexterity = true; + result.dexterity_ = value; + return this; + } + public Builder ClearDexterity() { + PrepareBuilder(); + result.hasDexterity = false; + result.dexterity_ = 0; + return this; + } + + public bool HasIntelligence { + get { return result.hasIntelligence; } + } + public uint Intelligence { + get { return result.Intelligence; } + set { SetIntelligence(value); } + } + public Builder SetIntelligence(uint value) { + PrepareBuilder(); + result.hasIntelligence = true; + result.intelligence_ = value; + return this; + } + public Builder ClearIntelligence() { + PrepareBuilder(); + result.hasIntelligence = false; + result.intelligence_ = 0; + return this; + } + + public bool HasVitality { + get { return result.hasVitality; } + } + public uint Vitality { + get { return result.Vitality; } + set { SetVitality(value); } + } + public Builder SetVitality(uint value) { + PrepareBuilder(); + result.hasVitality = true; + result.vitality_ = value; + return this; + } + public Builder ClearVitality() { + PrepareBuilder(); + result.hasVitality = false; + result.vitality_ = 0; + return this; + } + + public bool HasArmor { + get { return result.hasArmor; } + } + public uint Armor { + get { return result.Armor; } + set { SetArmor(value); } + } + public Builder SetArmor(uint value) { + PrepareBuilder(); + result.hasArmor = true; + result.armor_ = value; + return this; + } + public Builder ClearArmor() { + PrepareBuilder(); + result.hasArmor = false; + result.armor_ = 0; + return this; + } + + public bool HasDps { + get { return result.hasDps; } + } + public float Dps { + get { return result.Dps; } + set { SetDps(value); } + } + public Builder SetDps(float value) { + PrepareBuilder(); + result.hasDps = true; + result.dps_ = value; + return this; + } + public Builder ClearDps() { + PrepareBuilder(); + result.hasDps = false; + result.dps_ = 0F; + return this; + } + + public bool HasResistArcane { + get { return result.hasResistArcane; } + } + public uint ResistArcane { + get { return result.ResistArcane; } + set { SetResistArcane(value); } + } + public Builder SetResistArcane(uint value) { + PrepareBuilder(); + result.hasResistArcane = true; + result.resistArcane_ = value; + return this; + } + public Builder ClearResistArcane() { + PrepareBuilder(); + result.hasResistArcane = false; + result.resistArcane_ = 0; + return this; + } + + public bool HasResistFire { + get { return result.hasResistFire; } + } + public uint ResistFire { + get { return result.ResistFire; } + set { SetResistFire(value); } + } + public Builder SetResistFire(uint value) { + PrepareBuilder(); + result.hasResistFire = true; + result.resistFire_ = value; + return this; + } + public Builder ClearResistFire() { + PrepareBuilder(); + result.hasResistFire = false; + result.resistFire_ = 0; + return this; + } + + public bool HasResistLightning { + get { return result.hasResistLightning; } + } + public uint ResistLightning { + get { return result.ResistLightning; } + set { SetResistLightning(value); } + } + public Builder SetResistLightning(uint value) { + PrepareBuilder(); + result.hasResistLightning = true; + result.resistLightning_ = value; + return this; + } + public Builder ClearResistLightning() { + PrepareBuilder(); + result.hasResistLightning = false; + result.resistLightning_ = 0; + return this; + } + + public bool HasResistPoison { + get { return result.hasResistPoison; } + } + public uint ResistPoison { + get { return result.ResistPoison; } + set { SetResistPoison(value); } + } + public Builder SetResistPoison(uint value) { + PrepareBuilder(); + result.hasResistPoison = true; + result.resistPoison_ = value; + return this; + } + public Builder ClearResistPoison() { + PrepareBuilder(); + result.hasResistPoison = false; + result.resistPoison_ = 0; + return this; + } + + public bool HasResistCold { + get { return result.hasResistCold; } + } + public uint ResistCold { + get { return result.ResistCold; } + set { SetResistCold(value); } + } + public Builder SetResistCold(uint value) { + PrepareBuilder(); + result.hasResistCold = true; + result.resistCold_ = value; + return this; + } + public Builder ClearResistCold() { + PrepareBuilder(); + result.hasResistCold = false; + result.resistCold_ = 0; + return this; + } + + public bool HasEquipment { + get { return result.hasEquipment; } + } + public global::D3.Items.ItemList Equipment { + get { return result.Equipment; } + set { SetEquipment(value); } + } + public Builder SetEquipment(global::D3.Items.ItemList value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasEquipment = true; + result.equipment_ = value; + return this; + } + public Builder SetEquipment(global::D3.Items.ItemList.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasEquipment = true; + result.equipment_ = builderForValue.Build(); + return this; + } + public Builder MergeEquipment(global::D3.Items.ItemList value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasEquipment && + result.equipment_ != global::D3.Items.ItemList.DefaultInstance) { + result.equipment_ = global::D3.Items.ItemList.CreateBuilder(result.equipment_).MergeFrom(value).BuildPartial(); + } else { + result.equipment_ = value; + } + result.hasEquipment = true; + return this; + } + public Builder ClearEquipment() { + PrepareBuilder(); + result.hasEquipment = false; + result.equipment_ = null; + return this; + } + + public bool HasSnoActiveSkills { + get { return result.hasSnoActiveSkills; } + } + public global::D3.Profile.SkillsWithRunes SnoActiveSkills { + get { return result.SnoActiveSkills; } + set { SetSnoActiveSkills(value); } + } + public Builder SetSnoActiveSkills(global::D3.Profile.SkillsWithRunes value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasSnoActiveSkills = true; + result.snoActiveSkills_ = value; + return this; + } + public Builder SetSnoActiveSkills(global::D3.Profile.SkillsWithRunes.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasSnoActiveSkills = true; + result.snoActiveSkills_ = builderForValue.Build(); + return this; + } + public Builder MergeSnoActiveSkills(global::D3.Profile.SkillsWithRunes value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasSnoActiveSkills && + result.snoActiveSkills_ != global::D3.Profile.SkillsWithRunes.DefaultInstance) { + result.snoActiveSkills_ = global::D3.Profile.SkillsWithRunes.CreateBuilder(result.snoActiveSkills_).MergeFrom(value).BuildPartial(); + } else { + result.snoActiveSkills_ = value; + } + result.hasSnoActiveSkills = true; + return this; + } + public Builder ClearSnoActiveSkills() { + PrepareBuilder(); + result.hasSnoActiveSkills = false; + result.snoActiveSkills_ = null; + return this; + } + + public bool HasSnoTraits { + get { return result.hasSnoTraits; } + } + public global::D3.Profile.PassiveSkills SnoTraits { + get { return result.SnoTraits; } + set { SetSnoTraits(value); } + } + public Builder SetSnoTraits(global::D3.Profile.PassiveSkills value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasSnoTraits = true; + result.snoTraits_ = value; + return this; + } + public Builder SetSnoTraits(global::D3.Profile.PassiveSkills.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasSnoTraits = true; + result.snoTraits_ = builderForValue.Build(); + return this; + } + public Builder MergeSnoTraits(global::D3.Profile.PassiveSkills value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasSnoTraits && + result.snoTraits_ != global::D3.Profile.PassiveSkills.DefaultInstance) { + result.snoTraits_ = global::D3.Profile.PassiveSkills.CreateBuilder(result.snoTraits_).MergeFrom(value).BuildPartial(); + } else { + result.snoTraits_ = value; + } + result.hasSnoTraits = true; + return this; + } + public Builder ClearSnoTraits() { + PrepareBuilder(); + result.hasSnoTraits = false; + result.snoTraits_ = null; + return this; + } + + public bool HasDeathTime { + get { return result.hasDeathTime; } + } + public uint DeathTime { + get { return result.DeathTime; } + set { SetDeathTime(value); } + } + public Builder SetDeathTime(uint value) { + PrepareBuilder(); + result.hasDeathTime = true; + result.deathTime_ = value; + return this; + } + public Builder ClearDeathTime() { + PrepareBuilder(); + result.hasDeathTime = false; + result.deathTime_ = 0; + return this; + } + + public bool HasKillerInfo { + get { return result.hasKillerInfo; } + } + public global::D3.Profile.KillerInfo KillerInfo { + get { return result.KillerInfo; } + set { SetKillerInfo(value); } + } + public Builder SetKillerInfo(global::D3.Profile.KillerInfo value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasKillerInfo = true; + result.killerInfo_ = value; + return this; + } + public Builder SetKillerInfo(global::D3.Profile.KillerInfo.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasKillerInfo = true; + result.killerInfo_ = builderForValue.Build(); + return this; + } + public Builder MergeKillerInfo(global::D3.Profile.KillerInfo value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasKillerInfo && + result.killerInfo_ != global::D3.Profile.KillerInfo.DefaultInstance) { + result.killerInfo_ = global::D3.Profile.KillerInfo.CreateBuilder(result.killerInfo_).MergeFrom(value).BuildPartial(); + } else { + result.killerInfo_ = value; + } + result.hasKillerInfo = true; + return this; + } + public Builder ClearKillerInfo() { + PrepareBuilder(); + result.hasKillerInfo = false; + result.killerInfo_ = null; + return this; + } + + public bool HasSnoKillLocation { + get { return result.hasSnoKillLocation; } + } + public uint SnoKillLocation { + get { return result.SnoKillLocation; } + set { SetSnoKillLocation(value); } + } + public Builder SetSnoKillLocation(uint value) { + PrepareBuilder(); + result.hasSnoKillLocation = true; + result.snoKillLocation_ = value; + return this; + } + public Builder ClearSnoKillLocation() { + PrepareBuilder(); + result.hasSnoKillLocation = false; + result.snoKillLocation_ = 0; + return this; + } + + public bool HasHeroId { + get { return result.hasHeroId; } + } + public global::D3.OnlineService.EntityId HeroId { + get { return result.HeroId; } + set { SetHeroId(value); } + } + public Builder SetHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasHeroId = true; + result.heroId_ = value; + return this; + } + public Builder SetHeroId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasHeroId = true; + result.heroId_ = builderForValue.Build(); + return this; + } + public Builder MergeHeroId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasHeroId && + result.heroId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.heroId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.heroId_).MergeFrom(value).BuildPartial(); + } else { + result.heroId_ = value; + } + result.hasHeroId = true; + return this; + } + public Builder ClearHeroId() { + PrepareBuilder(); + result.hasHeroId = false; + result.heroId_ = null; + return this; + } + + public bool HasDamageIncrease { + get { return result.hasDamageIncrease; } + } + public float DamageIncrease { + get { return result.DamageIncrease; } + set { SetDamageIncrease(value); } + } + public Builder SetDamageIncrease(float value) { + PrepareBuilder(); + result.hasDamageIncrease = true; + result.damageIncrease_ = value; + return this; + } + public Builder ClearDamageIncrease() { + PrepareBuilder(); + result.hasDamageIncrease = false; + result.damageIncrease_ = 0F; + return this; + } + + public bool HasCritChance { + get { return result.hasCritChance; } + } + public float CritChance { + get { return result.CritChance; } + set { SetCritChance(value); } + } + public Builder SetCritChance(float value) { + PrepareBuilder(); + result.hasCritChance = true; + result.critChance_ = value; + return this; + } + public Builder ClearCritChance() { + PrepareBuilder(); + result.hasCritChance = false; + result.critChance_ = 0F; + return this; + } + + public bool HasDamageReduction { + get { return result.hasDamageReduction; } + } + public float DamageReduction { + get { return result.DamageReduction; } + set { SetDamageReduction(value); } + } + public Builder SetDamageReduction(float value) { + PrepareBuilder(); + result.hasDamageReduction = true; + result.damageReduction_ = value; + return this; + } + public Builder ClearDamageReduction() { + PrepareBuilder(); + result.hasDamageReduction = false; + result.damageReduction_ = 0F; + return this; + } + + public bool HasLife { + get { return result.hasLife; } + } + public uint Life { + get { return result.Life; } + set { SetLife(value); } + } + public Builder SetLife(uint value) { + PrepareBuilder(); + result.hasLife = true; + result.life_ = value; + return this; + } + public Builder ClearLife() { + PrepareBuilder(); + result.hasLife = false; + result.life_ = 0; + return this; + } + } + static HeroProfile() { + object.ReferenceEquals(global::D3.Profile.Profile.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class HeroProfileList : pb::GeneratedMessage { + private HeroProfileList() { } + private static readonly HeroProfileList defaultInstance = new HeroProfileList().MakeReadOnly(); + private static readonly string[] _heroProfileListFieldNames = new string[] { "heros" }; + private static readonly uint[] _heroProfileListFieldTags = new uint[] { 10 }; + public static HeroProfileList DefaultInstance { + get { return defaultInstance; } + } + + public override HeroProfileList DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override HeroProfileList ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.Profile.Profile.internal__static_D3_Profile_HeroProfileList__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.Profile.Profile.internal__static_D3_Profile_HeroProfileList__FieldAccessorTable; } + } + + public const int HerosFieldNumber = 1; + private pbc::PopsicleList heros_ = new pbc::PopsicleList(); + public scg::IList HerosList { + get { return heros_; } + } + public int HerosCount { + get { return heros_.Count; } + } + public global::D3.Profile.HeroProfile GetHeros(int index) { + return heros_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::D3.Profile.HeroProfile element in HerosList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _heroProfileListFieldNames; + if (heros_.Count > 0) { + output.WriteMessageArray(1, field_names[0], heros_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::D3.Profile.HeroProfile element in HerosList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static HeroProfileList ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static HeroProfileList ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static HeroProfileList ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static HeroProfileList ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static HeroProfileList ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static HeroProfileList ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static HeroProfileList ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static HeroProfileList ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static HeroProfileList ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static HeroProfileList ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private HeroProfileList MakeReadOnly() { + heros_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(HeroProfileList prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(HeroProfileList cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private HeroProfileList result; + + private HeroProfileList PrepareBuilder() { + if (resultIsReadOnly) { + HeroProfileList original = result; + result = new HeroProfileList(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override HeroProfileList MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.Profile.HeroProfileList.Descriptor; } + } + + public override HeroProfileList DefaultInstanceForType { + get { return global::D3.Profile.HeroProfileList.DefaultInstance; } + } + + public override HeroProfileList BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is HeroProfileList) { + return MergeFrom((HeroProfileList) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(HeroProfileList other) { + if (other == global::D3.Profile.HeroProfileList.DefaultInstance) return this; + PrepareBuilder(); + if (other.heros_.Count != 0) { + result.heros_.Add(other.heros_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_heroProfileListFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _heroProfileListFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.heros_, global::D3.Profile.HeroProfile.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList HerosList { + get { return PrepareBuilder().heros_; } + } + public int HerosCount { + get { return result.HerosCount; } + } + public global::D3.Profile.HeroProfile GetHeros(int index) { + return result.GetHeros(index); + } + public Builder SetHeros(int index, global::D3.Profile.HeroProfile value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.heros_[index] = value; + return this; + } + public Builder SetHeros(int index, global::D3.Profile.HeroProfile.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.heros_[index] = builderForValue.Build(); + return this; + } + public Builder AddHeros(global::D3.Profile.HeroProfile value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.heros_.Add(value); + return this; + } + public Builder AddHeros(global::D3.Profile.HeroProfile.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.heros_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeHeros(scg::IEnumerable values) { + PrepareBuilder(); + result.heros_.Add(values); + return this; + } + public Builder ClearHeros() { + PrepareBuilder(); + result.heros_.Clear(); + return this; + } + } + static HeroProfileList() { + object.ReferenceEquals(global::D3.Profile.Profile.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class AccountProfile : pb::GeneratedMessage { + private AccountProfile() { } + private static readonly AccountProfile defaultInstance = new AccountProfile().MakeReadOnly(); + private static readonly string[] _accountProfileFieldNames = new string[] { "class_barbarian", "class_demonhunter", "class_monk", "class_witchdoctor", "class_wizard", "elites_killed", "gold_collected", "hardcore_monsters_killed", "highest_boss_difficulty_1", "highest_boss_difficulty_2", "highest_boss_difficulty_3", "highest_boss_difficulty_4", "highest_difficulty", "highest_hardcore_level", "monsters_killed" }; + private static readonly uint[] _accountProfileFieldTags = new uint[] { 90, 98, 106, 114, 122, 56, 64, 80, 16, 24, 32, 40, 8, 72, 48 }; + public static AccountProfile DefaultInstance { + get { return defaultInstance; } + } + + public override AccountProfile DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override AccountProfile ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.Profile.Profile.internal__static_D3_Profile_AccountProfile__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.Profile.Profile.internal__static_D3_Profile_AccountProfile__FieldAccessorTable; } + } + + public const int HighestDifficultyFieldNumber = 1; + private bool hasHighestDifficulty; + private uint highestDifficulty_; + public bool HasHighestDifficulty { + get { return hasHighestDifficulty; } + } + public uint HighestDifficulty { + get { return highestDifficulty_; } + } + + public const int HighestBossDifficulty1FieldNumber = 2; + private bool hasHighestBossDifficulty1; + private uint highestBossDifficulty1_; + public bool HasHighestBossDifficulty1 { + get { return hasHighestBossDifficulty1; } + } + public uint HighestBossDifficulty1 { + get { return highestBossDifficulty1_; } + } + + public const int HighestBossDifficulty2FieldNumber = 3; + private bool hasHighestBossDifficulty2; + private uint highestBossDifficulty2_; + public bool HasHighestBossDifficulty2 { + get { return hasHighestBossDifficulty2; } + } + public uint HighestBossDifficulty2 { + get { return highestBossDifficulty2_; } + } + + public const int HighestBossDifficulty3FieldNumber = 4; + private bool hasHighestBossDifficulty3; + private uint highestBossDifficulty3_; + public bool HasHighestBossDifficulty3 { + get { return hasHighestBossDifficulty3; } + } + public uint HighestBossDifficulty3 { + get { return highestBossDifficulty3_; } + } + + public const int HighestBossDifficulty4FieldNumber = 5; + private bool hasHighestBossDifficulty4; + private uint highestBossDifficulty4_; + public bool HasHighestBossDifficulty4 { + get { return hasHighestBossDifficulty4; } + } + public uint HighestBossDifficulty4 { + get { return highestBossDifficulty4_; } + } + + public const int MonstersKilledFieldNumber = 6; + private bool hasMonstersKilled; + private ulong monstersKilled_; + public bool HasMonstersKilled { + get { return hasMonstersKilled; } + } + public ulong MonstersKilled { + get { return monstersKilled_; } + } + + public const int ElitesKilledFieldNumber = 7; + private bool hasElitesKilled; + private ulong elitesKilled_; + public bool HasElitesKilled { + get { return hasElitesKilled; } + } + public ulong ElitesKilled { + get { return elitesKilled_; } + } + + public const int GoldCollectedFieldNumber = 8; + private bool hasGoldCollected; + private ulong goldCollected_; + public bool HasGoldCollected { + get { return hasGoldCollected; } + } + public ulong GoldCollected { + get { return goldCollected_; } + } + + public const int HighestHardcoreLevelFieldNumber = 9; + private bool hasHighestHardcoreLevel; + private ulong highestHardcoreLevel_; + public bool HasHighestHardcoreLevel { + get { return hasHighestHardcoreLevel; } + } + public ulong HighestHardcoreLevel { + get { return highestHardcoreLevel_; } + } + + public const int HardcoreMonstersKilledFieldNumber = 10; + private bool hasHardcoreMonstersKilled; + private ulong hardcoreMonstersKilled_; + public bool HasHardcoreMonstersKilled { + get { return hasHardcoreMonstersKilled; } + } + public ulong HardcoreMonstersKilled { + get { return hardcoreMonstersKilled_; } + } + + public const int ClassBarbarianFieldNumber = 11; + private bool hasClassBarbarian; + private global::D3.Profile.ClassInfo classBarbarian_; + public bool HasClassBarbarian { + get { return hasClassBarbarian; } + } + public global::D3.Profile.ClassInfo ClassBarbarian { + get { return classBarbarian_ ?? global::D3.Profile.ClassInfo.DefaultInstance; } + } + + public const int ClassDemonhunterFieldNumber = 12; + private bool hasClassDemonhunter; + private global::D3.Profile.ClassInfo classDemonhunter_; + public bool HasClassDemonhunter { + get { return hasClassDemonhunter; } + } + public global::D3.Profile.ClassInfo ClassDemonhunter { + get { return classDemonhunter_ ?? global::D3.Profile.ClassInfo.DefaultInstance; } + } + + public const int ClassMonkFieldNumber = 13; + private bool hasClassMonk; + private global::D3.Profile.ClassInfo classMonk_; + public bool HasClassMonk { + get { return hasClassMonk; } + } + public global::D3.Profile.ClassInfo ClassMonk { + get { return classMonk_ ?? global::D3.Profile.ClassInfo.DefaultInstance; } + } + + public const int ClassWitchdoctorFieldNumber = 14; + private bool hasClassWitchdoctor; + private global::D3.Profile.ClassInfo classWitchdoctor_; + public bool HasClassWitchdoctor { + get { return hasClassWitchdoctor; } + } + public global::D3.Profile.ClassInfo ClassWitchdoctor { + get { return classWitchdoctor_ ?? global::D3.Profile.ClassInfo.DefaultInstance; } + } + + public const int ClassWizardFieldNumber = 15; + private bool hasClassWizard; + private global::D3.Profile.ClassInfo classWizard_; + public bool HasClassWizard { + get { return hasClassWizard; } + } + public global::D3.Profile.ClassInfo ClassWizard { + get { return classWizard_ ?? global::D3.Profile.ClassInfo.DefaultInstance; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _accountProfileFieldNames; + if (hasHighestDifficulty) { + output.WriteUInt32(1, field_names[12], HighestDifficulty); + } + if (hasHighestBossDifficulty1) { + output.WriteUInt32(2, field_names[8], HighestBossDifficulty1); + } + if (hasHighestBossDifficulty2) { + output.WriteUInt32(3, field_names[9], HighestBossDifficulty2); + } + if (hasHighestBossDifficulty3) { + output.WriteUInt32(4, field_names[10], HighestBossDifficulty3); + } + if (hasHighestBossDifficulty4) { + output.WriteUInt32(5, field_names[11], HighestBossDifficulty4); + } + if (hasMonstersKilled) { + output.WriteUInt64(6, field_names[14], MonstersKilled); + } + if (hasElitesKilled) { + output.WriteUInt64(7, field_names[5], ElitesKilled); + } + if (hasGoldCollected) { + output.WriteUInt64(8, field_names[6], GoldCollected); + } + if (hasHighestHardcoreLevel) { + output.WriteUInt64(9, field_names[13], HighestHardcoreLevel); + } + if (hasHardcoreMonstersKilled) { + output.WriteUInt64(10, field_names[7], HardcoreMonstersKilled); + } + if (hasClassBarbarian) { + output.WriteMessage(11, field_names[0], ClassBarbarian); + } + if (hasClassDemonhunter) { + output.WriteMessage(12, field_names[1], ClassDemonhunter); + } + if (hasClassMonk) { + output.WriteMessage(13, field_names[2], ClassMonk); + } + if (hasClassWitchdoctor) { + output.WriteMessage(14, field_names[3], ClassWitchdoctor); + } + if (hasClassWizard) { + output.WriteMessage(15, field_names[4], ClassWizard); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasHighestDifficulty) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, HighestDifficulty); + } + if (hasHighestBossDifficulty1) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, HighestBossDifficulty1); + } + if (hasHighestBossDifficulty2) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, HighestBossDifficulty2); + } + if (hasHighestBossDifficulty3) { + size += pb::CodedOutputStream.ComputeUInt32Size(4, HighestBossDifficulty3); + } + if (hasHighestBossDifficulty4) { + size += pb::CodedOutputStream.ComputeUInt32Size(5, HighestBossDifficulty4); + } + if (hasMonstersKilled) { + size += pb::CodedOutputStream.ComputeUInt64Size(6, MonstersKilled); + } + if (hasElitesKilled) { + size += pb::CodedOutputStream.ComputeUInt64Size(7, ElitesKilled); + } + if (hasGoldCollected) { + size += pb::CodedOutputStream.ComputeUInt64Size(8, GoldCollected); + } + if (hasHighestHardcoreLevel) { + size += pb::CodedOutputStream.ComputeUInt64Size(9, HighestHardcoreLevel); + } + if (hasHardcoreMonstersKilled) { + size += pb::CodedOutputStream.ComputeUInt64Size(10, HardcoreMonstersKilled); + } + if (hasClassBarbarian) { + size += pb::CodedOutputStream.ComputeMessageSize(11, ClassBarbarian); + } + if (hasClassDemonhunter) { + size += pb::CodedOutputStream.ComputeMessageSize(12, ClassDemonhunter); + } + if (hasClassMonk) { + size += pb::CodedOutputStream.ComputeMessageSize(13, ClassMonk); + } + if (hasClassWitchdoctor) { + size += pb::CodedOutputStream.ComputeMessageSize(14, ClassWitchdoctor); + } + if (hasClassWizard) { + size += pb::CodedOutputStream.ComputeMessageSize(15, ClassWizard); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static AccountProfile ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AccountProfile ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AccountProfile ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AccountProfile ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AccountProfile ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AccountProfile ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static AccountProfile ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static AccountProfile ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static AccountProfile ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AccountProfile ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private AccountProfile MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(AccountProfile prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(AccountProfile cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private AccountProfile result; + + private AccountProfile PrepareBuilder() { + if (resultIsReadOnly) { + AccountProfile original = result; + result = new AccountProfile(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override AccountProfile MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::D3.Profile.AccountProfile.Descriptor; } + } + + public override AccountProfile DefaultInstanceForType { + get { return global::D3.Profile.AccountProfile.DefaultInstance; } + } + + public override AccountProfile BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is AccountProfile) { + return MergeFrom((AccountProfile) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(AccountProfile other) { + if (other == global::D3.Profile.AccountProfile.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasHighestDifficulty) { + HighestDifficulty = other.HighestDifficulty; + } + if (other.HasHighestBossDifficulty1) { + HighestBossDifficulty1 = other.HighestBossDifficulty1; + } + if (other.HasHighestBossDifficulty2) { + HighestBossDifficulty2 = other.HighestBossDifficulty2; + } + if (other.HasHighestBossDifficulty3) { + HighestBossDifficulty3 = other.HighestBossDifficulty3; + } + if (other.HasHighestBossDifficulty4) { + HighestBossDifficulty4 = other.HighestBossDifficulty4; + } + if (other.HasMonstersKilled) { + MonstersKilled = other.MonstersKilled; + } + if (other.HasElitesKilled) { + ElitesKilled = other.ElitesKilled; + } + if (other.HasGoldCollected) { + GoldCollected = other.GoldCollected; + } + if (other.HasHighestHardcoreLevel) { + HighestHardcoreLevel = other.HighestHardcoreLevel; + } + if (other.HasHardcoreMonstersKilled) { + HardcoreMonstersKilled = other.HardcoreMonstersKilled; + } + if (other.HasClassBarbarian) { + MergeClassBarbarian(other.ClassBarbarian); + } + if (other.HasClassDemonhunter) { + MergeClassDemonhunter(other.ClassDemonhunter); + } + if (other.HasClassMonk) { + MergeClassMonk(other.ClassMonk); + } + if (other.HasClassWitchdoctor) { + MergeClassWitchdoctor(other.ClassWitchdoctor); + } + if (other.HasClassWizard) { + MergeClassWizard(other.ClassWizard); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_accountProfileFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _accountProfileFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasHighestDifficulty = input.ReadUInt32(ref result.highestDifficulty_); + break; + } + case 16: { + result.hasHighestBossDifficulty1 = input.ReadUInt32(ref result.highestBossDifficulty1_); + break; + } + case 24: { + result.hasHighestBossDifficulty2 = input.ReadUInt32(ref result.highestBossDifficulty2_); + break; + } + case 32: { + result.hasHighestBossDifficulty3 = input.ReadUInt32(ref result.highestBossDifficulty3_); + break; + } + case 40: { + result.hasHighestBossDifficulty4 = input.ReadUInt32(ref result.highestBossDifficulty4_); + break; + } + case 48: { + result.hasMonstersKilled = input.ReadUInt64(ref result.monstersKilled_); + break; + } + case 56: { + result.hasElitesKilled = input.ReadUInt64(ref result.elitesKilled_); + break; + } + case 64: { + result.hasGoldCollected = input.ReadUInt64(ref result.goldCollected_); + break; + } + case 72: { + result.hasHighestHardcoreLevel = input.ReadUInt64(ref result.highestHardcoreLevel_); + break; + } + case 80: { + result.hasHardcoreMonstersKilled = input.ReadUInt64(ref result.hardcoreMonstersKilled_); + break; + } + case 90: { + global::D3.Profile.ClassInfo.Builder subBuilder = global::D3.Profile.ClassInfo.CreateBuilder(); + if (result.hasClassBarbarian) { + subBuilder.MergeFrom(ClassBarbarian); + } + input.ReadMessage(subBuilder, extensionRegistry); + ClassBarbarian = subBuilder.BuildPartial(); + break; + } + case 98: { + global::D3.Profile.ClassInfo.Builder subBuilder = global::D3.Profile.ClassInfo.CreateBuilder(); + if (result.hasClassDemonhunter) { + subBuilder.MergeFrom(ClassDemonhunter); + } + input.ReadMessage(subBuilder, extensionRegistry); + ClassDemonhunter = subBuilder.BuildPartial(); + break; + } + case 106: { + global::D3.Profile.ClassInfo.Builder subBuilder = global::D3.Profile.ClassInfo.CreateBuilder(); + if (result.hasClassMonk) { + subBuilder.MergeFrom(ClassMonk); + } + input.ReadMessage(subBuilder, extensionRegistry); + ClassMonk = subBuilder.BuildPartial(); + break; + } + case 114: { + global::D3.Profile.ClassInfo.Builder subBuilder = global::D3.Profile.ClassInfo.CreateBuilder(); + if (result.hasClassWitchdoctor) { + subBuilder.MergeFrom(ClassWitchdoctor); + } + input.ReadMessage(subBuilder, extensionRegistry); + ClassWitchdoctor = subBuilder.BuildPartial(); + break; + } + case 122: { + global::D3.Profile.ClassInfo.Builder subBuilder = global::D3.Profile.ClassInfo.CreateBuilder(); + if (result.hasClassWizard) { + subBuilder.MergeFrom(ClassWizard); + } + input.ReadMessage(subBuilder, extensionRegistry); + ClassWizard = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasHighestDifficulty { + get { return result.hasHighestDifficulty; } + } + public uint HighestDifficulty { + get { return result.HighestDifficulty; } + set { SetHighestDifficulty(value); } + } + public Builder SetHighestDifficulty(uint value) { + PrepareBuilder(); + result.hasHighestDifficulty = true; + result.highestDifficulty_ = value; + return this; + } + public Builder ClearHighestDifficulty() { + PrepareBuilder(); + result.hasHighestDifficulty = false; + result.highestDifficulty_ = 0; + return this; + } + + public bool HasHighestBossDifficulty1 { + get { return result.hasHighestBossDifficulty1; } + } + public uint HighestBossDifficulty1 { + get { return result.HighestBossDifficulty1; } + set { SetHighestBossDifficulty1(value); } + } + public Builder SetHighestBossDifficulty1(uint value) { + PrepareBuilder(); + result.hasHighestBossDifficulty1 = true; + result.highestBossDifficulty1_ = value; + return this; + } + public Builder ClearHighestBossDifficulty1() { + PrepareBuilder(); + result.hasHighestBossDifficulty1 = false; + result.highestBossDifficulty1_ = 0; + return this; + } + + public bool HasHighestBossDifficulty2 { + get { return result.hasHighestBossDifficulty2; } + } + public uint HighestBossDifficulty2 { + get { return result.HighestBossDifficulty2; } + set { SetHighestBossDifficulty2(value); } + } + public Builder SetHighestBossDifficulty2(uint value) { + PrepareBuilder(); + result.hasHighestBossDifficulty2 = true; + result.highestBossDifficulty2_ = value; + return this; + } + public Builder ClearHighestBossDifficulty2() { + PrepareBuilder(); + result.hasHighestBossDifficulty2 = false; + result.highestBossDifficulty2_ = 0; + return this; + } + + public bool HasHighestBossDifficulty3 { + get { return result.hasHighestBossDifficulty3; } + } + public uint HighestBossDifficulty3 { + get { return result.HighestBossDifficulty3; } + set { SetHighestBossDifficulty3(value); } + } + public Builder SetHighestBossDifficulty3(uint value) { + PrepareBuilder(); + result.hasHighestBossDifficulty3 = true; + result.highestBossDifficulty3_ = value; + return this; + } + public Builder ClearHighestBossDifficulty3() { + PrepareBuilder(); + result.hasHighestBossDifficulty3 = false; + result.highestBossDifficulty3_ = 0; + return this; + } + + public bool HasHighestBossDifficulty4 { + get { return result.hasHighestBossDifficulty4; } + } + public uint HighestBossDifficulty4 { + get { return result.HighestBossDifficulty4; } + set { SetHighestBossDifficulty4(value); } + } + public Builder SetHighestBossDifficulty4(uint value) { + PrepareBuilder(); + result.hasHighestBossDifficulty4 = true; + result.highestBossDifficulty4_ = value; + return this; + } + public Builder ClearHighestBossDifficulty4() { + PrepareBuilder(); + result.hasHighestBossDifficulty4 = false; + result.highestBossDifficulty4_ = 0; + return this; + } + + public bool HasMonstersKilled { + get { return result.hasMonstersKilled; } + } + public ulong MonstersKilled { + get { return result.MonstersKilled; } + set { SetMonstersKilled(value); } + } + public Builder SetMonstersKilled(ulong value) { + PrepareBuilder(); + result.hasMonstersKilled = true; + result.monstersKilled_ = value; + return this; + } + public Builder ClearMonstersKilled() { + PrepareBuilder(); + result.hasMonstersKilled = false; + result.monstersKilled_ = 0UL; + return this; + } + + public bool HasElitesKilled { + get { return result.hasElitesKilled; } + } + public ulong ElitesKilled { + get { return result.ElitesKilled; } + set { SetElitesKilled(value); } + } + public Builder SetElitesKilled(ulong value) { + PrepareBuilder(); + result.hasElitesKilled = true; + result.elitesKilled_ = value; + return this; + } + public Builder ClearElitesKilled() { + PrepareBuilder(); + result.hasElitesKilled = false; + result.elitesKilled_ = 0UL; + return this; + } + + public bool HasGoldCollected { + get { return result.hasGoldCollected; } + } + public ulong GoldCollected { + get { return result.GoldCollected; } + set { SetGoldCollected(value); } + } + public Builder SetGoldCollected(ulong value) { + PrepareBuilder(); + result.hasGoldCollected = true; + result.goldCollected_ = value; + return this; + } + public Builder ClearGoldCollected() { + PrepareBuilder(); + result.hasGoldCollected = false; + result.goldCollected_ = 0UL; + return this; + } + + public bool HasHighestHardcoreLevel { + get { return result.hasHighestHardcoreLevel; } + } + public ulong HighestHardcoreLevel { + get { return result.HighestHardcoreLevel; } + set { SetHighestHardcoreLevel(value); } + } + public Builder SetHighestHardcoreLevel(ulong value) { + PrepareBuilder(); + result.hasHighestHardcoreLevel = true; + result.highestHardcoreLevel_ = value; + return this; + } + public Builder ClearHighestHardcoreLevel() { + PrepareBuilder(); + result.hasHighestHardcoreLevel = false; + result.highestHardcoreLevel_ = 0UL; + return this; + } + + public bool HasHardcoreMonstersKilled { + get { return result.hasHardcoreMonstersKilled; } + } + public ulong HardcoreMonstersKilled { + get { return result.HardcoreMonstersKilled; } + set { SetHardcoreMonstersKilled(value); } + } + public Builder SetHardcoreMonstersKilled(ulong value) { + PrepareBuilder(); + result.hasHardcoreMonstersKilled = true; + result.hardcoreMonstersKilled_ = value; + return this; + } + public Builder ClearHardcoreMonstersKilled() { + PrepareBuilder(); + result.hasHardcoreMonstersKilled = false; + result.hardcoreMonstersKilled_ = 0UL; + return this; + } + + public bool HasClassBarbarian { + get { return result.hasClassBarbarian; } + } + public global::D3.Profile.ClassInfo ClassBarbarian { + get { return result.ClassBarbarian; } + set { SetClassBarbarian(value); } + } + public Builder SetClassBarbarian(global::D3.Profile.ClassInfo value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasClassBarbarian = true; + result.classBarbarian_ = value; + return this; + } + public Builder SetClassBarbarian(global::D3.Profile.ClassInfo.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasClassBarbarian = true; + result.classBarbarian_ = builderForValue.Build(); + return this; + } + public Builder MergeClassBarbarian(global::D3.Profile.ClassInfo value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasClassBarbarian && + result.classBarbarian_ != global::D3.Profile.ClassInfo.DefaultInstance) { + result.classBarbarian_ = global::D3.Profile.ClassInfo.CreateBuilder(result.classBarbarian_).MergeFrom(value).BuildPartial(); + } else { + result.classBarbarian_ = value; + } + result.hasClassBarbarian = true; + return this; + } + public Builder ClearClassBarbarian() { + PrepareBuilder(); + result.hasClassBarbarian = false; + result.classBarbarian_ = null; + return this; + } + + public bool HasClassDemonhunter { + get { return result.hasClassDemonhunter; } + } + public global::D3.Profile.ClassInfo ClassDemonhunter { + get { return result.ClassDemonhunter; } + set { SetClassDemonhunter(value); } + } + public Builder SetClassDemonhunter(global::D3.Profile.ClassInfo value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasClassDemonhunter = true; + result.classDemonhunter_ = value; + return this; + } + public Builder SetClassDemonhunter(global::D3.Profile.ClassInfo.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasClassDemonhunter = true; + result.classDemonhunter_ = builderForValue.Build(); + return this; + } + public Builder MergeClassDemonhunter(global::D3.Profile.ClassInfo value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasClassDemonhunter && + result.classDemonhunter_ != global::D3.Profile.ClassInfo.DefaultInstance) { + result.classDemonhunter_ = global::D3.Profile.ClassInfo.CreateBuilder(result.classDemonhunter_).MergeFrom(value).BuildPartial(); + } else { + result.classDemonhunter_ = value; + } + result.hasClassDemonhunter = true; + return this; + } + public Builder ClearClassDemonhunter() { + PrepareBuilder(); + result.hasClassDemonhunter = false; + result.classDemonhunter_ = null; + return this; + } + + public bool HasClassMonk { + get { return result.hasClassMonk; } + } + public global::D3.Profile.ClassInfo ClassMonk { + get { return result.ClassMonk; } + set { SetClassMonk(value); } + } + public Builder SetClassMonk(global::D3.Profile.ClassInfo value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasClassMonk = true; + result.classMonk_ = value; + return this; + } + public Builder SetClassMonk(global::D3.Profile.ClassInfo.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasClassMonk = true; + result.classMonk_ = builderForValue.Build(); + return this; + } + public Builder MergeClassMonk(global::D3.Profile.ClassInfo value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasClassMonk && + result.classMonk_ != global::D3.Profile.ClassInfo.DefaultInstance) { + result.classMonk_ = global::D3.Profile.ClassInfo.CreateBuilder(result.classMonk_).MergeFrom(value).BuildPartial(); + } else { + result.classMonk_ = value; + } + result.hasClassMonk = true; + return this; + } + public Builder ClearClassMonk() { + PrepareBuilder(); + result.hasClassMonk = false; + result.classMonk_ = null; + return this; + } + + public bool HasClassWitchdoctor { + get { return result.hasClassWitchdoctor; } + } + public global::D3.Profile.ClassInfo ClassWitchdoctor { + get { return result.ClassWitchdoctor; } + set { SetClassWitchdoctor(value); } + } + public Builder SetClassWitchdoctor(global::D3.Profile.ClassInfo value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasClassWitchdoctor = true; + result.classWitchdoctor_ = value; + return this; + } + public Builder SetClassWitchdoctor(global::D3.Profile.ClassInfo.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasClassWitchdoctor = true; + result.classWitchdoctor_ = builderForValue.Build(); + return this; + } + public Builder MergeClassWitchdoctor(global::D3.Profile.ClassInfo value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasClassWitchdoctor && + result.classWitchdoctor_ != global::D3.Profile.ClassInfo.DefaultInstance) { + result.classWitchdoctor_ = global::D3.Profile.ClassInfo.CreateBuilder(result.classWitchdoctor_).MergeFrom(value).BuildPartial(); + } else { + result.classWitchdoctor_ = value; + } + result.hasClassWitchdoctor = true; + return this; + } + public Builder ClearClassWitchdoctor() { + PrepareBuilder(); + result.hasClassWitchdoctor = false; + result.classWitchdoctor_ = null; + return this; + } + + public bool HasClassWizard { + get { return result.hasClassWizard; } + } + public global::D3.Profile.ClassInfo ClassWizard { + get { return result.ClassWizard; } + set { SetClassWizard(value); } + } + public Builder SetClassWizard(global::D3.Profile.ClassInfo value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasClassWizard = true; + result.classWizard_ = value; + return this; + } + public Builder SetClassWizard(global::D3.Profile.ClassInfo.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasClassWizard = true; + result.classWizard_ = builderForValue.Build(); + return this; + } + public Builder MergeClassWizard(global::D3.Profile.ClassInfo value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasClassWizard && + result.classWizard_ != global::D3.Profile.ClassInfo.DefaultInstance) { + result.classWizard_ = global::D3.Profile.ClassInfo.CreateBuilder(result.classWizard_).MergeFrom(value).BuildPartial(); + } else { + result.classWizard_ = value; + } + result.hasClassWizard = true; + return this; + } + public Builder ClearClassWizard() { + PrepareBuilder(); + result.hasClassWizard = false; + result.classWizard_ = null; + return this; + } + } + static AccountProfile() { + object.ReferenceEquals(global::D3.Profile.Profile.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code diff --git a/source/D3Proto/D3/Quests/Quest.cs b/src/LibMooNet/D3/Quests/Quest.cs similarity index 60% rename from source/D3Proto/D3/Quests/Quest.cs rename to src/LibMooNet/D3/Quests/Quest.cs index f0acdfe3..a7c1104d 100644 --- a/source/D3Proto/D3/Quests/Quest.cs +++ b/src/LibMooNet/D3/Quests/Quest.cs @@ -1,4 +1,6 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code using pb = global::Google.ProtocolBuffers; using pbc = global::Google.ProtocolBuffers.Collections; @@ -6,6 +8,9 @@ using scg = global::System.Collections.Generic; namespace D3.Quests { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public static partial class Quest { #region Extension registration @@ -26,17 +31,18 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { static Quest() { byte[] descriptorData = global::System.Convert.FromBase64String( - "CgtRdWVzdC5wcm90bxIJRDMuUXVlc3RzGgtJdGVtcy5wcm90byJaCgtRdWVz" + - "dFJld2FyZBISCgp4cF9ncmFudGVkGAEgASgFEhQKDGdvbGRfZ3JhbnRlZBgC" + - "IAEoBRIhCgRpdGVtGAMgASgLMhMuRDMuSXRlbXMuR2VuZXJhdG9yIlYKEVF1" + - "ZXN0U3RlcENvbXBsZXRlEhkKEWlzX3F1ZXN0X2NvbXBsZXRlGAEgAigIEiYK" + - "BnJld2FyZBgCIAEoCzIWLkQzLlF1ZXN0cy5RdWVzdFJld2FyZA=="); + "CgtRdWVzdC5wcm90bxIJRDMuUXVlc3RzGgtJdGVtcy5wcm90byJ/CgtRdWVz" + + "dFJld2FyZBIVCgp4cF9ncmFudGVkGAEgASgFOgEwEhcKDGdvbGRfZ3JhbnRl" + + "ZBgCIAEoBToBMBIpCgxpdGVtX2dyYW50ZWQYAyABKAsyEy5EMy5JdGVtcy5H" + + "ZW5lcmF0b3ISFQoJc25vX3F1ZXN0GAQgASgPOgItMSJWChFRdWVzdFN0ZXBD" + + "b21wbGV0ZRIZChFpc19xdWVzdF9jb21wbGV0ZRgBIAIoCBImCgZyZXdhcmQY" + + "AiABKAsyFi5EMy5RdWVzdHMuUXVlc3RSZXdhcmQ="); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_D3_Quests_QuestReward__Descriptor = Descriptor.MessageTypes[0]; internal__static_D3_Quests_QuestReward__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Quests_QuestReward__Descriptor, - new string[] { "XpGranted", "GoldGranted", "Item", }); + new string[] { "XpGranted", "GoldGranted", "ItemGranted", "SnoQuest", }); internal__static_D3_Quests_QuestStepComplete__Descriptor = Descriptor.MessageTypes[1]; internal__static_D3_Quests_QuestStepComplete__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Quests_QuestStepComplete__Descriptor, @@ -52,14 +58,20 @@ static Quest() { } #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class QuestReward : pb::GeneratedMessage { - private static readonly QuestReward defaultInstance = new Builder().BuildPartial(); + private QuestReward() { } + private static readonly QuestReward defaultInstance = new QuestReward().MakeReadOnly(); + private static readonly string[] _questRewardFieldNames = new string[] { "gold_granted", "item_granted", "sno_quest", "xp_granted" }; + private static readonly uint[] _questRewardFieldTags = new uint[] { 16, 26, 37, 8 }; public static QuestReward DefaultInstance { get { return defaultInstance; } } public override QuestReward DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override QuestReward ThisMessage { @@ -76,7 +88,7 @@ protected override QuestReward ThisMessage { public const int XpGrantedFieldNumber = 1; private bool hasXpGranted; - private int xpGranted_ = 0; + private int xpGranted_; public bool HasXpGranted { get { return hasXpGranted; } } @@ -86,7 +98,7 @@ public int XpGranted { public const int GoldGrantedFieldNumber = 2; private bool hasGoldGranted; - private int goldGranted_ = 0; + private int goldGranted_; public bool HasGoldGranted { get { return hasGoldGranted; } } @@ -94,35 +106,49 @@ public int GoldGranted { get { return goldGranted_; } } - public const int ItemFieldNumber = 3; - private bool hasItem; - private global::D3.Items.Generator item_ = global::D3.Items.Generator.DefaultInstance; - public bool HasItem { - get { return hasItem; } + public const int ItemGrantedFieldNumber = 3; + private bool hasItemGranted; + private global::D3.Items.Generator itemGranted_; + public bool HasItemGranted { + get { return hasItemGranted; } + } + public global::D3.Items.Generator ItemGranted { + get { return itemGranted_ ?? global::D3.Items.Generator.DefaultInstance; } + } + + public const int SnoQuestFieldNumber = 4; + private bool hasSnoQuest; + private int snoQuest_ = -1; + public bool HasSnoQuest { + get { return hasSnoQuest; } } - public global::D3.Items.Generator Item { - get { return item_; } + public int SnoQuest { + get { return snoQuest_; } } public override bool IsInitialized { get { - if (HasItem) { - if (!Item.IsInitialized) return false; + if (HasItemGranted) { + if (!ItemGranted.IsInitialized) return false; } return true; } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasXpGranted) { - output.WriteInt32(1, XpGranted); + string[] field_names = _questRewardFieldNames; + if (hasXpGranted) { + output.WriteInt32(1, field_names[3], XpGranted); } - if (HasGoldGranted) { - output.WriteInt32(2, GoldGranted); + if (hasGoldGranted) { + output.WriteInt32(2, field_names[0], GoldGranted); } - if (HasItem) { - output.WriteMessage(3, Item); + if (hasItemGranted) { + output.WriteMessage(3, field_names[1], ItemGranted); + } + if (hasSnoQuest) { + output.WriteSFixed32(4, field_names[2], SnoQuest); } UnknownFields.WriteTo(output); } @@ -134,14 +160,17 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasXpGranted) { + if (hasXpGranted) { size += pb::CodedOutputStream.ComputeInt32Size(1, XpGranted); } - if (HasGoldGranted) { + if (hasGoldGranted) { size += pb::CodedOutputStream.ComputeInt32Size(2, GoldGranted); } - if (HasItem) { - size += pb::CodedOutputStream.ComputeMessageSize(3, Item); + if (hasItemGranted) { + size += pb::CodedOutputStream.ComputeMessageSize(3, ItemGranted); + } + if (hasSnoQuest) { + size += pb::CodedOutputStream.ComputeSFixed32Size(4, SnoQuest); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -173,38 +202,72 @@ public static QuestReward ParseDelimitedFrom(global::System.IO.Stream input) { public static QuestReward ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static QuestReward ParseFrom(pb::CodedInputStream input) { + public static QuestReward ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static QuestReward ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static QuestReward ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private QuestReward MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(QuestReward prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(QuestReward cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - QuestReward result = new QuestReward(); + private bool resultIsReadOnly; + private QuestReward result; + + private QuestReward PrepareBuilder() { + if (resultIsReadOnly) { + QuestReward original = result; + result = new QuestReward(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override QuestReward MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new QuestReward(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -216,12 +279,11 @@ public override QuestReward DefaultInstanceForType { } public override QuestReward BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - QuestReward returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -235,33 +297,48 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(QuestReward other) { if (other == global::D3.Quests.QuestReward.DefaultInstance) return this; + PrepareBuilder(); if (other.HasXpGranted) { XpGranted = other.XpGranted; } if (other.HasGoldGranted) { GoldGranted = other.GoldGranted; } - if (other.HasItem) { - MergeItem(other.Item); + if (other.HasItemGranted) { + MergeItemGranted(other.ItemGranted); + } + if (other.HasSnoQuest) { + SnoQuest = other.SnoQuest; } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_questRewardFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _questRewardFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -273,100 +350,137 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 8: { - XpGranted = input.ReadInt32(); + result.hasXpGranted = input.ReadInt32(ref result.xpGranted_); break; } case 16: { - GoldGranted = input.ReadInt32(); + result.hasGoldGranted = input.ReadInt32(ref result.goldGranted_); break; } case 26: { global::D3.Items.Generator.Builder subBuilder = global::D3.Items.Generator.CreateBuilder(); - if (HasItem) { - subBuilder.MergeFrom(Item); + if (result.hasItemGranted) { + subBuilder.MergeFrom(ItemGranted); } input.ReadMessage(subBuilder, extensionRegistry); - Item = subBuilder.BuildPartial(); + ItemGranted = subBuilder.BuildPartial(); + break; + } + case 37: { + result.hasSnoQuest = input.ReadSFixed32(ref result.snoQuest_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasXpGranted { - get { return result.HasXpGranted; } + get { return result.hasXpGranted; } } public int XpGranted { get { return result.XpGranted; } set { SetXpGranted(value); } } public Builder SetXpGranted(int value) { + PrepareBuilder(); result.hasXpGranted = true; result.xpGranted_ = value; return this; } public Builder ClearXpGranted() { + PrepareBuilder(); result.hasXpGranted = false; result.xpGranted_ = 0; return this; } public bool HasGoldGranted { - get { return result.HasGoldGranted; } + get { return result.hasGoldGranted; } } public int GoldGranted { get { return result.GoldGranted; } set { SetGoldGranted(value); } } public Builder SetGoldGranted(int value) { + PrepareBuilder(); result.hasGoldGranted = true; result.goldGranted_ = value; return this; } public Builder ClearGoldGranted() { + PrepareBuilder(); result.hasGoldGranted = false; result.goldGranted_ = 0; return this; } - public bool HasItem { - get { return result.HasItem; } + public bool HasItemGranted { + get { return result.hasItemGranted; } } - public global::D3.Items.Generator Item { - get { return result.Item; } - set { SetItem(value); } + public global::D3.Items.Generator ItemGranted { + get { return result.ItemGranted; } + set { SetItemGranted(value); } } - public Builder SetItem(global::D3.Items.Generator value) { + public Builder SetItemGranted(global::D3.Items.Generator value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasItem = true; - result.item_ = value; + PrepareBuilder(); + result.hasItemGranted = true; + result.itemGranted_ = value; return this; } - public Builder SetItem(global::D3.Items.Generator.Builder builderForValue) { + public Builder SetItemGranted(global::D3.Items.Generator.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasItem = true; - result.item_ = builderForValue.Build(); + PrepareBuilder(); + result.hasItemGranted = true; + result.itemGranted_ = builderForValue.Build(); return this; } - public Builder MergeItem(global::D3.Items.Generator value) { + public Builder MergeItemGranted(global::D3.Items.Generator value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasItem && - result.item_ != global::D3.Items.Generator.DefaultInstance) { - result.item_ = global::D3.Items.Generator.CreateBuilder(result.item_).MergeFrom(value).BuildPartial(); + PrepareBuilder(); + if (result.hasItemGranted && + result.itemGranted_ != global::D3.Items.Generator.DefaultInstance) { + result.itemGranted_ = global::D3.Items.Generator.CreateBuilder(result.itemGranted_).MergeFrom(value).BuildPartial(); } else { - result.item_ = value; + result.itemGranted_ = value; } - result.hasItem = true; + result.hasItemGranted = true; return this; } - public Builder ClearItem() { - result.hasItem = false; - result.item_ = global::D3.Items.Generator.DefaultInstance; + public Builder ClearItemGranted() { + PrepareBuilder(); + result.hasItemGranted = false; + result.itemGranted_ = null; + return this; + } + + public bool HasSnoQuest { + get { return result.hasSnoQuest; } + } + public int SnoQuest { + get { return result.SnoQuest; } + set { SetSnoQuest(value); } + } + public Builder SetSnoQuest(int value) { + PrepareBuilder(); + result.hasSnoQuest = true; + result.snoQuest_ = value; + return this; + } + public Builder ClearSnoQuest() { + PrepareBuilder(); + result.hasSnoQuest = false; + result.snoQuest_ = -1; return this; } } @@ -375,14 +489,20 @@ static QuestReward() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class QuestStepComplete : pb::GeneratedMessage { - private static readonly QuestStepComplete defaultInstance = new Builder().BuildPartial(); + private QuestStepComplete() { } + private static readonly QuestStepComplete defaultInstance = new QuestStepComplete().MakeReadOnly(); + private static readonly string[] _questStepCompleteFieldNames = new string[] { "is_quest_complete", "reward" }; + private static readonly uint[] _questStepCompleteFieldTags = new uint[] { 8, 18 }; public static QuestStepComplete DefaultInstance { get { return defaultInstance; } } public override QuestStepComplete DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override QuestStepComplete ThisMessage { @@ -399,7 +519,7 @@ protected override QuestStepComplete ThisMessage { public const int IsQuestCompleteFieldNumber = 1; private bool hasIsQuestComplete; - private bool isQuestComplete_ = false; + private bool isQuestComplete_; public bool HasIsQuestComplete { get { return hasIsQuestComplete; } } @@ -409,12 +529,12 @@ public bool IsQuestComplete { public const int RewardFieldNumber = 2; private bool hasReward; - private global::D3.Quests.QuestReward reward_ = global::D3.Quests.QuestReward.DefaultInstance; + private global::D3.Quests.QuestReward reward_; public bool HasReward { get { return hasReward; } } public global::D3.Quests.QuestReward Reward { - get { return reward_; } + get { return reward_ ?? global::D3.Quests.QuestReward.DefaultInstance; } } public override bool IsInitialized { @@ -427,13 +547,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasIsQuestComplete) { - output.WriteBool(1, IsQuestComplete); + string[] field_names = _questStepCompleteFieldNames; + if (hasIsQuestComplete) { + output.WriteBool(1, field_names[0], IsQuestComplete); } - if (HasReward) { - output.WriteMessage(2, Reward); + if (hasReward) { + output.WriteMessage(2, field_names[1], Reward); } UnknownFields.WriteTo(output); } @@ -445,10 +566,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasIsQuestComplete) { + if (hasIsQuestComplete) { size += pb::CodedOutputStream.ComputeBoolSize(1, IsQuestComplete); } - if (HasReward) { + if (hasReward) { size += pb::CodedOutputStream.ComputeMessageSize(2, Reward); } size += UnknownFields.SerializedSize; @@ -481,38 +602,72 @@ public static QuestStepComplete ParseDelimitedFrom(global::System.IO.Stream inpu public static QuestStepComplete ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static QuestStepComplete ParseFrom(pb::CodedInputStream input) { + public static QuestStepComplete ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static QuestStepComplete ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static QuestStepComplete ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private QuestStepComplete MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(QuestStepComplete prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(QuestStepComplete cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - QuestStepComplete result = new QuestStepComplete(); + private bool resultIsReadOnly; + private QuestStepComplete result; + + private QuestStepComplete PrepareBuilder() { + if (resultIsReadOnly) { + QuestStepComplete original = result; + result = new QuestStepComplete(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override QuestStepComplete MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new QuestStepComplete(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -524,12 +679,11 @@ public override QuestStepComplete DefaultInstanceForType { } public override QuestStepComplete BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - QuestStepComplete returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -543,6 +697,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(QuestStepComplete other) { if (other == global::D3.Quests.QuestStepComplete.DefaultInstance) return this; + PrepareBuilder(); if (other.HasIsQuestComplete) { IsQuestComplete = other.IsQuestComplete; } @@ -553,20 +708,31 @@ public override Builder MergeFrom(QuestStepComplete other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_questStepCompleteFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _questStepCompleteFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -578,16 +744,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 8: { - IsQuestComplete = input.ReadBool(); + result.hasIsQuestComplete = input.ReadBool(ref result.isQuestComplete_); break; } case 18: { global::D3.Quests.QuestReward.Builder subBuilder = global::D3.Quests.QuestReward.CreateBuilder(); - if (HasReward) { + if (result.hasReward) { subBuilder.MergeFrom(Reward); } input.ReadMessage(subBuilder, extensionRegistry); @@ -596,29 +762,36 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasIsQuestComplete { - get { return result.HasIsQuestComplete; } + get { return result.hasIsQuestComplete; } } public bool IsQuestComplete { get { return result.IsQuestComplete; } set { SetIsQuestComplete(value); } } public Builder SetIsQuestComplete(bool value) { + PrepareBuilder(); result.hasIsQuestComplete = true; result.isQuestComplete_ = value; return this; } public Builder ClearIsQuestComplete() { + PrepareBuilder(); result.hasIsQuestComplete = false; result.isQuestComplete_ = false; return this; } public bool HasReward { - get { return result.HasReward; } + get { return result.hasReward; } } public global::D3.Quests.QuestReward Reward { get { return result.Reward; } @@ -626,19 +799,22 @@ public bool HasReward { } public Builder SetReward(global::D3.Quests.QuestReward value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasReward = true; result.reward_ = value; return this; } public Builder SetReward(global::D3.Quests.QuestReward.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasReward = true; result.reward_ = builderForValue.Build(); return this; } public Builder MergeReward(global::D3.Quests.QuestReward value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasReward && + PrepareBuilder(); + if (result.hasReward && result.reward_ != global::D3.Quests.QuestReward.DefaultInstance) { result.reward_ = global::D3.Quests.QuestReward.CreateBuilder(result.reward_).MergeFrom(value).BuildPartial(); } else { @@ -648,8 +824,9 @@ public Builder MergeReward(global::D3.Quests.QuestReward value) { return this; } public Builder ClearReward() { + PrepareBuilder(); result.hasReward = false; - result.reward_ = global::D3.Quests.QuestReward.DefaultInstance; + result.reward_ = null; return this; } } @@ -661,3 +838,5 @@ static QuestStepComplete() { #endregion } + +#endregion Designer generated code diff --git a/source/D3Proto/D3Proto.csproj b/src/LibMooNet/LibMooNet.csproj similarity index 59% rename from source/D3Proto/D3Proto.csproj rename to src/LibMooNet/LibMooNet.csproj index 25ddf460..866a85df 100644 --- a/source/D3Proto/D3Proto.csproj +++ b/src/LibMooNet/LibMooNet.csproj @@ -7,9 +7,8 @@ 2.0 {4CC19847-6F24-4453-9E31-126F94308AB9} Library - D3Proto - D3Proto - v4.0 + LibMooNet + LibMooNet true @@ -30,50 +29,63 @@ false - - - - False - ..\libs\Google.ProtocolBuffers.dll + + + ..\..\dep\protobuf-csharp\Google.ProtocolBuffers.dll + - - - + + + + + + + Code + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + - - - - - + - - - - - - - - - - - - - @@ -85,12 +97,8 @@ + - - - - - - + \ No newline at end of file diff --git a/src/LibMooNet/LibMooNet.csproj.user b/src/LibMooNet/LibMooNet.csproj.user new file mode 100644 index 00000000..07dbd5b5 --- /dev/null +++ b/src/LibMooNet/LibMooNet.csproj.user @@ -0,0 +1,6 @@ + + + + ProjectFiles + + \ No newline at end of file diff --git a/src/LibMooNet/Properties/AssemblyInfo.cs b/src/LibMooNet/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..f45d3bfc --- /dev/null +++ b/src/LibMooNet/Properties/AssemblyInfo.cs @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. + +[assembly: AssemblyTitle("LibMooege")] +[assembly: AssemblyDescription("LibMooege")] +#if DEBUG +[assembly: AssemblyConfiguration("Debug")] +#else +[assembly: AssemblyConfiguration("Release")] +#endif +[assembly: AssemblyCompany("mooege.org")] +[assembly: AssemblyProduct("mooege")] +[assembly: AssemblyCopyright("Copyright © 2011, mooege")] +[assembly: AssemblyTrademark("mooege")] +[assembly: AssemblyCulture("")] + +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// The form "{Major}.{Minor}.*" will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}.*" will update just the revision. + +[assembly: AssemblyVersion("0.7841.*")] + +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. + +//[assembly: AssemblyDelaySign(false)] +//[assembly: AssemblyKeyFile("")] + diff --git a/source/D3Proto/bnet/protocol/ContentHandle.cs b/src/LibMooNet/bnet/protocol/ContentHandle.cs similarity index 61% rename from source/D3Proto/bnet/protocol/ContentHandle.cs rename to src/LibMooNet/bnet/protocol/ContentHandle.cs index 2ff765d2..e6c57312 100644 --- a/source/D3Proto/bnet/protocol/ContentHandle.cs +++ b/src/LibMooNet/bnet/protocol/ContentHandle.cs @@ -1,4 +1,6 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code using pb = global::Google.ProtocolBuffers; using pbc = global::Google.ProtocolBuffers.Collections; @@ -8,6 +10,9 @@ namespace bnet.protocol { namespace Proto { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public static partial class ContentHandle { #region Extension registration @@ -26,15 +31,15 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { static ContentHandle() { byte[] descriptorData = global::System.Convert.FromBase64String( - "CiFsaWIvcHJvdG9jb2wvY29udGVudF9oYW5kbGUucHJvdG8SDWJuZXQucHJv" + - "dG9jb2wiPAoNQ29udGVudEhhbmRsZRIOCgZyZWdpb24YASACKAcSDQoFdXNh" + - "Z2UYAiACKAcSDAoEaGFzaBgDIAIoDEIQQg5DQ29udGVudEhhbmRsZQ=="); + "ChlibmV0L2NvbnRlbnRfaGFuZGxlLnByb3RvEg1ibmV0LnByb3RvY29sIk8K" + + "DUNvbnRlbnRIYW5kbGUSDgoGcmVnaW9uGAEgAigHEg0KBXVzYWdlGAIgAigH" + + "EgwKBGhhc2gYAyACKAwSEQoJcHJvdG9fdXJsGAQgASgJ"); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_bnet_protocol_ContentHandle__Descriptor = Descriptor.MessageTypes[0]; internal__static_bnet_protocol_ContentHandle__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_ContentHandle__Descriptor, - new string[] { "Region", "Usage", "Hash", }); + new string[] { "Region", "Usage", "Hash", "ProtoUrl", }); return null; }; pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, @@ -46,14 +51,20 @@ static ContentHandle() { } } #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class ContentHandle : pb::GeneratedMessage { - private static readonly ContentHandle defaultInstance = new Builder().BuildPartial(); + private ContentHandle() { } + private static readonly ContentHandle defaultInstance = new ContentHandle().MakeReadOnly(); + private static readonly string[] _contentHandleFieldNames = new string[] { "hash", "proto_url", "region", "usage" }; + private static readonly uint[] _contentHandleFieldTags = new uint[] { 26, 34, 13, 21 }; public static ContentHandle DefaultInstance { get { return defaultInstance; } } public override ContentHandle DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ContentHandle ThisMessage { @@ -70,7 +81,7 @@ protected override ContentHandle ThisMessage { public const int RegionFieldNumber = 1; private bool hasRegion; - private uint region_ = 0; + private uint region_; public bool HasRegion { get { return hasRegion; } } @@ -80,7 +91,7 @@ public uint Region { public const int UsageFieldNumber = 2; private bool hasUsage; - private uint usage_ = 0; + private uint usage_; public bool HasUsage { get { return hasUsage; } } @@ -98,6 +109,16 @@ public bool HasHash { get { return hash_; } } + public const int ProtoUrlFieldNumber = 4; + private bool hasProtoUrl; + private string protoUrl_ = ""; + public bool HasProtoUrl { + get { return hasProtoUrl; } + } + public string ProtoUrl { + get { return protoUrl_; } + } + public override bool IsInitialized { get { if (!hasRegion) return false; @@ -107,16 +128,20 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasRegion) { - output.WriteFixed32(1, Region); + string[] field_names = _contentHandleFieldNames; + if (hasRegion) { + output.WriteFixed32(1, field_names[2], Region); + } + if (hasUsage) { + output.WriteFixed32(2, field_names[3], Usage); } - if (HasUsage) { - output.WriteFixed32(2, Usage); + if (hasHash) { + output.WriteBytes(3, field_names[0], Hash); } - if (HasHash) { - output.WriteBytes(3, Hash); + if (hasProtoUrl) { + output.WriteString(4, field_names[1], ProtoUrl); } UnknownFields.WriteTo(output); } @@ -128,15 +153,18 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasRegion) { + if (hasRegion) { size += pb::CodedOutputStream.ComputeFixed32Size(1, Region); } - if (HasUsage) { + if (hasUsage) { size += pb::CodedOutputStream.ComputeFixed32Size(2, Usage); } - if (HasHash) { + if (hasHash) { size += pb::CodedOutputStream.ComputeBytesSize(3, Hash); } + if (hasProtoUrl) { + size += pb::CodedOutputStream.ComputeStringSize(4, ProtoUrl); + } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; return size; @@ -167,38 +195,72 @@ public static ContentHandle ParseDelimitedFrom(global::System.IO.Stream input) { public static ContentHandle ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static ContentHandle ParseFrom(pb::CodedInputStream input) { + public static ContentHandle ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ContentHandle ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static ContentHandle ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private ContentHandle MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(ContentHandle prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ContentHandle cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - ContentHandle result = new ContentHandle(); + private bool resultIsReadOnly; + private ContentHandle result; + + private ContentHandle PrepareBuilder() { + if (resultIsReadOnly) { + ContentHandle original = result; + result = new ContentHandle(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override ContentHandle MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ContentHandle(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -210,12 +272,11 @@ public override ContentHandle DefaultInstanceForType { } public override ContentHandle BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - ContentHandle returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -229,6 +290,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(ContentHandle other) { if (other == global::bnet.protocol.ContentHandle.DefaultInstance) return this; + PrepareBuilder(); if (other.HasRegion) { Region = other.Region; } @@ -238,24 +300,38 @@ public override Builder MergeFrom(ContentHandle other) { if (other.HasHash) { Hash = other.Hash; } + if (other.HasProtoUrl) { + ProtoUrl = other.ProtoUrl; + } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_contentHandleFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _contentHandleFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -267,64 +343,77 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 13: { - Region = input.ReadFixed32(); + result.hasRegion = input.ReadFixed32(ref result.region_); break; } case 21: { - Usage = input.ReadFixed32(); + result.hasUsage = input.ReadFixed32(ref result.usage_); break; } case 26: { - Hash = input.ReadBytes(); + result.hasHash = input.ReadBytes(ref result.hash_); + break; + } + case 34: { + result.hasProtoUrl = input.ReadString(ref result.protoUrl_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasRegion { - get { return result.HasRegion; } + get { return result.hasRegion; } } public uint Region { get { return result.Region; } set { SetRegion(value); } } public Builder SetRegion(uint value) { + PrepareBuilder(); result.hasRegion = true; result.region_ = value; return this; } public Builder ClearRegion() { + PrepareBuilder(); result.hasRegion = false; result.region_ = 0; return this; } public bool HasUsage { - get { return result.HasUsage; } + get { return result.hasUsage; } } public uint Usage { get { return result.Usage; } set { SetUsage(value); } } public Builder SetUsage(uint value) { + PrepareBuilder(); result.hasUsage = true; result.usage_ = value; return this; } public Builder ClearUsage() { + PrepareBuilder(); result.hasUsage = false; result.usage_ = 0; return this; } public bool HasHash { - get { return result.HasHash; } + get { return result.hasHash; } } public pb::ByteString Hash { get { return result.Hash; } @@ -332,15 +421,38 @@ public bool HasHash { } public Builder SetHash(pb::ByteString value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasHash = true; result.hash_ = value; return this; } public Builder ClearHash() { + PrepareBuilder(); result.hasHash = false; result.hash_ = pb::ByteString.Empty; return this; } + + public bool HasProtoUrl { + get { return result.hasProtoUrl; } + } + public string ProtoUrl { + get { return result.ProtoUrl; } + set { SetProtoUrl(value); } + } + public Builder SetProtoUrl(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasProtoUrl = true; + result.protoUrl_ = value; + return this; + } + public Builder ClearProtoUrl() { + PrepareBuilder(); + result.hasProtoUrl = false; + result.protoUrl_ = ""; + return this; + } } static ContentHandle() { object.ReferenceEquals(global::bnet.protocol.Proto.ContentHandle.Descriptor, null); @@ -350,3 +462,5 @@ static ContentHandle() { #endregion } + +#endregion Designer generated code diff --git a/src/LibMooNet/bnet/protocol/Entity.cs b/src/LibMooNet/bnet/protocol/Entity.cs new file mode 100644 index 00000000..baf7c92f --- /dev/null +++ b/src/LibMooNet/bnet/protocol/Entity.cs @@ -0,0 +1,1169 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace bnet.protocol { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class Entity { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_bnet_protocol_EntityId__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_EntityId__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_Identity__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_Identity__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_AccountInfo__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_AccountInfo__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static Entity() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "ChFibmV0L2VudGl0eS5wcm90bxINYm5ldC5wcm90b2NvbBoYYm5ldC9maWVs" + + "ZF9vcHRpb25zLnByb3RvIiUKCEVudGl0eUlkEgwKBGhpZ2gYASACKAYSCwoD" + + "bG93GAIgAigGImkKCElkZW50aXR5EisKCmFjY291bnRfaWQYASABKAsyFy5i" + + "bmV0LnByb3RvY29sLkVudGl0eUlkEjAKD2dhbWVfYWNjb3VudF9pZBgCIAEo" + + "CzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQicwoLQWNjb3VudEluZm8SGwoM" + + "YWNjb3VudF9wYWlkGAEgASgIOgVmYWxzZRIVCgpjb3VudHJ5X2lkGAIgASgH" + + "OgEwEhIKCmJhdHRsZV90YWcYAyABKAkSHAoNbWFudWFsX3JldmlldxgEIAEo" + + "CDoFZmFsc2U="); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_bnet_protocol_EntityId__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_EntityId__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_EntityId__Descriptor, + new string[] { "High", "Low", }); + internal__static_bnet_protocol_Identity__Descriptor = Descriptor.MessageTypes[1]; + internal__static_bnet_protocol_Identity__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_Identity__Descriptor, + new string[] { "AccountId", "GameAccountId", }); + internal__static_bnet_protocol_AccountInfo__Descriptor = Descriptor.MessageTypes[2]; + internal__static_bnet_protocol_AccountInfo__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_AccountInfo__Descriptor, + new string[] { "AccountPaid", "CountryId", "BattleTag", "ManualReview", }); + return null; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::bnet.protocol.FieldOptions.Descriptor, + }, assigner); + } + #endregion + + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class EntityId : pb::GeneratedMessage { + private EntityId() { } + private static readonly EntityId defaultInstance = new EntityId().MakeReadOnly(); + private static readonly string[] _entityIdFieldNames = new string[] { "high", "low" }; + private static readonly uint[] _entityIdFieldTags = new uint[] { 9, 17 }; + public static EntityId DefaultInstance { + get { return defaultInstance; } + } + + public override EntityId DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override EntityId ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.Entity.internal__static_bnet_protocol_EntityId__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.Entity.internal__static_bnet_protocol_EntityId__FieldAccessorTable; } + } + + public const int HighFieldNumber = 1; + private bool hasHigh; + private ulong high_; + public bool HasHigh { + get { return hasHigh; } + } + public ulong High { + get { return high_; } + } + + public const int LowFieldNumber = 2; + private bool hasLow; + private ulong low_; + public bool HasLow { + get { return hasLow; } + } + public ulong Low { + get { return low_; } + } + + public override bool IsInitialized { + get { + if (!hasHigh) return false; + if (!hasLow) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _entityIdFieldNames; + if (hasHigh) { + output.WriteFixed64(1, field_names[0], High); + } + if (hasLow) { + output.WriteFixed64(2, field_names[1], Low); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasHigh) { + size += pb::CodedOutputStream.ComputeFixed64Size(1, High); + } + if (hasLow) { + size += pb::CodedOutputStream.ComputeFixed64Size(2, Low); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static EntityId ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static EntityId ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static EntityId ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static EntityId ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static EntityId ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static EntityId ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static EntityId ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static EntityId ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static EntityId ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static EntityId ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private EntityId MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(EntityId prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(EntityId cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private EntityId result; + + private EntityId PrepareBuilder() { + if (resultIsReadOnly) { + EntityId original = result; + result = new EntityId(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override EntityId MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.EntityId.Descriptor; } + } + + public override EntityId DefaultInstanceForType { + get { return global::bnet.protocol.EntityId.DefaultInstance; } + } + + public override EntityId BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is EntityId) { + return MergeFrom((EntityId) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(EntityId other) { + if (other == global::bnet.protocol.EntityId.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasHigh) { + High = other.High; + } + if (other.HasLow) { + Low = other.Low; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_entityIdFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _entityIdFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 9: { + result.hasHigh = input.ReadFixed64(ref result.high_); + break; + } + case 17: { + result.hasLow = input.ReadFixed64(ref result.low_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasHigh { + get { return result.hasHigh; } + } + public ulong High { + get { return result.High; } + set { SetHigh(value); } + } + public Builder SetHigh(ulong value) { + PrepareBuilder(); + result.hasHigh = true; + result.high_ = value; + return this; + } + public Builder ClearHigh() { + PrepareBuilder(); + result.hasHigh = false; + result.high_ = 0; + return this; + } + + public bool HasLow { + get { return result.hasLow; } + } + public ulong Low { + get { return result.Low; } + set { SetLow(value); } + } + public Builder SetLow(ulong value) { + PrepareBuilder(); + result.hasLow = true; + result.low_ = value; + return this; + } + public Builder ClearLow() { + PrepareBuilder(); + result.hasLow = false; + result.low_ = 0; + return this; + } + } + static EntityId() { + object.ReferenceEquals(global::bnet.protocol.Entity.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Identity : pb::GeneratedMessage { + private Identity() { } + private static readonly Identity defaultInstance = new Identity().MakeReadOnly(); + private static readonly string[] _identityFieldNames = new string[] { "account_id", "game_account_id" }; + private static readonly uint[] _identityFieldTags = new uint[] { 10, 18 }; + public static Identity DefaultInstance { + get { return defaultInstance; } + } + + public override Identity DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Identity ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.Entity.internal__static_bnet_protocol_Identity__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.Entity.internal__static_bnet_protocol_Identity__FieldAccessorTable; } + } + + public const int AccountIdFieldNumber = 1; + private bool hasAccountId; + private global::bnet.protocol.EntityId accountId_; + public bool HasAccountId { + get { return hasAccountId; } + } + public global::bnet.protocol.EntityId AccountId { + get { return accountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int GameAccountIdFieldNumber = 2; + private bool hasGameAccountId; + private global::bnet.protocol.EntityId gameAccountId_; + public bool HasGameAccountId { + get { return hasGameAccountId; } + } + public global::bnet.protocol.EntityId GameAccountId { + get { return gameAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (HasAccountId) { + if (!AccountId.IsInitialized) return false; + } + if (HasGameAccountId) { + if (!GameAccountId.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _identityFieldNames; + if (hasAccountId) { + output.WriteMessage(1, field_names[0], AccountId); + } + if (hasGameAccountId) { + output.WriteMessage(2, field_names[1], GameAccountId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AccountId); + } + if (hasGameAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, GameAccountId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static Identity ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Identity ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Identity ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Identity ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Identity ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Identity ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Identity ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Identity ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Identity ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Identity ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Identity MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Identity prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Identity cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Identity result; + + private Identity PrepareBuilder() { + if (resultIsReadOnly) { + Identity original = result; + result = new Identity(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Identity MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.Identity.Descriptor; } + } + + public override Identity DefaultInstanceForType { + get { return global::bnet.protocol.Identity.DefaultInstance; } + } + + public override Identity BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Identity) { + return MergeFrom((Identity) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Identity other) { + if (other == global::bnet.protocol.Identity.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAccountId) { + MergeAccountId(other.AccountId); + } + if (other.HasGameAccountId) { + MergeGameAccountId(other.GameAccountId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_identityFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _identityFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasAccountId) { + subBuilder.MergeFrom(AccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + AccountId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasGameAccountId) { + subBuilder.MergeFrom(GameAccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + GameAccountId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAccountId { + get { return result.hasAccountId; } + } + public global::bnet.protocol.EntityId AccountId { + get { return result.AccountId; } + set { SetAccountId(value); } + } + public Builder SetAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = value; + return this; + } + public Builder SetAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccountId = true; + result.accountId_ = builderForValue.Build(); + return this; + } + public Builder MergeAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccountId && + result.accountId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.accountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.accountId_).MergeFrom(value).BuildPartial(); + } else { + result.accountId_ = value; + } + result.hasAccountId = true; + return this; + } + public Builder ClearAccountId() { + PrepareBuilder(); + result.hasAccountId = false; + result.accountId_ = null; + return this; + } + + public bool HasGameAccountId { + get { return result.hasGameAccountId; } + } + public global::bnet.protocol.EntityId GameAccountId { + get { return result.GameAccountId; } + set { SetGameAccountId(value); } + } + public Builder SetGameAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasGameAccountId = true; + result.gameAccountId_ = value; + return this; + } + public Builder SetGameAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasGameAccountId = true; + result.gameAccountId_ = builderForValue.Build(); + return this; + } + public Builder MergeGameAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasGameAccountId && + result.gameAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.gameAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccountId_).MergeFrom(value).BuildPartial(); + } else { + result.gameAccountId_ = value; + } + result.hasGameAccountId = true; + return this; + } + public Builder ClearGameAccountId() { + PrepareBuilder(); + result.hasGameAccountId = false; + result.gameAccountId_ = null; + return this; + } + } + static Identity() { + object.ReferenceEquals(global::bnet.protocol.Entity.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class AccountInfo : pb::GeneratedMessage { + private AccountInfo() { } + private static readonly AccountInfo defaultInstance = new AccountInfo().MakeReadOnly(); + private static readonly string[] _accountInfoFieldNames = new string[] { "account_paid", "battle_tag", "country_id", "manual_review" }; + private static readonly uint[] _accountInfoFieldTags = new uint[] { 8, 26, 21, 32 }; + public static AccountInfo DefaultInstance { + get { return defaultInstance; } + } + + public override AccountInfo DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override AccountInfo ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.Entity.internal__static_bnet_protocol_AccountInfo__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.Entity.internal__static_bnet_protocol_AccountInfo__FieldAccessorTable; } + } + + public const int AccountPaidFieldNumber = 1; + private bool hasAccountPaid; + private bool accountPaid_; + public bool HasAccountPaid { + get { return hasAccountPaid; } + } + public bool AccountPaid { + get { return accountPaid_; } + } + + public const int CountryIdFieldNumber = 2; + private bool hasCountryId; + private uint countryId_; + public bool HasCountryId { + get { return hasCountryId; } + } + public uint CountryId { + get { return countryId_; } + } + + public const int BattleTagFieldNumber = 3; + private bool hasBattleTag; + private string battleTag_ = ""; + public bool HasBattleTag { + get { return hasBattleTag; } + } + public string BattleTag { + get { return battleTag_; } + } + + public const int ManualReviewFieldNumber = 4; + private bool hasManualReview; + private bool manualReview_; + public bool HasManualReview { + get { return hasManualReview; } + } + public bool ManualReview { + get { return manualReview_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _accountInfoFieldNames; + if (hasAccountPaid) { + output.WriteBool(1, field_names[0], AccountPaid); + } + if (hasCountryId) { + output.WriteFixed32(2, field_names[2], CountryId); + } + if (hasBattleTag) { + output.WriteString(3, field_names[1], BattleTag); + } + if (hasManualReview) { + output.WriteBool(4, field_names[3], ManualReview); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAccountPaid) { + size += pb::CodedOutputStream.ComputeBoolSize(1, AccountPaid); + } + if (hasCountryId) { + size += pb::CodedOutputStream.ComputeFixed32Size(2, CountryId); + } + if (hasBattleTag) { + size += pb::CodedOutputStream.ComputeStringSize(3, BattleTag); + } + if (hasManualReview) { + size += pb::CodedOutputStream.ComputeBoolSize(4, ManualReview); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static AccountInfo ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AccountInfo ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AccountInfo ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AccountInfo ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AccountInfo ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AccountInfo ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static AccountInfo ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static AccountInfo ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static AccountInfo ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AccountInfo ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private AccountInfo MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(AccountInfo prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(AccountInfo cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private AccountInfo result; + + private AccountInfo PrepareBuilder() { + if (resultIsReadOnly) { + AccountInfo original = result; + result = new AccountInfo(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override AccountInfo MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.AccountInfo.Descriptor; } + } + + public override AccountInfo DefaultInstanceForType { + get { return global::bnet.protocol.AccountInfo.DefaultInstance; } + } + + public override AccountInfo BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is AccountInfo) { + return MergeFrom((AccountInfo) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(AccountInfo other) { + if (other == global::bnet.protocol.AccountInfo.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAccountPaid) { + AccountPaid = other.AccountPaid; + } + if (other.HasCountryId) { + CountryId = other.CountryId; + } + if (other.HasBattleTag) { + BattleTag = other.BattleTag; + } + if (other.HasManualReview) { + ManualReview = other.ManualReview; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_accountInfoFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _accountInfoFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasAccountPaid = input.ReadBool(ref result.accountPaid_); + break; + } + case 21: { + result.hasCountryId = input.ReadFixed32(ref result.countryId_); + break; + } + case 26: { + result.hasBattleTag = input.ReadString(ref result.battleTag_); + break; + } + case 32: { + result.hasManualReview = input.ReadBool(ref result.manualReview_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAccountPaid { + get { return result.hasAccountPaid; } + } + public bool AccountPaid { + get { return result.AccountPaid; } + set { SetAccountPaid(value); } + } + public Builder SetAccountPaid(bool value) { + PrepareBuilder(); + result.hasAccountPaid = true; + result.accountPaid_ = value; + return this; + } + public Builder ClearAccountPaid() { + PrepareBuilder(); + result.hasAccountPaid = false; + result.accountPaid_ = false; + return this; + } + + public bool HasCountryId { + get { return result.hasCountryId; } + } + public uint CountryId { + get { return result.CountryId; } + set { SetCountryId(value); } + } + public Builder SetCountryId(uint value) { + PrepareBuilder(); + result.hasCountryId = true; + result.countryId_ = value; + return this; + } + public Builder ClearCountryId() { + PrepareBuilder(); + result.hasCountryId = false; + result.countryId_ = 0; + return this; + } + + public bool HasBattleTag { + get { return result.hasBattleTag; } + } + public string BattleTag { + get { return result.BattleTag; } + set { SetBattleTag(value); } + } + public Builder SetBattleTag(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBattleTag = true; + result.battleTag_ = value; + return this; + } + public Builder ClearBattleTag() { + PrepareBuilder(); + result.hasBattleTag = false; + result.battleTag_ = ""; + return this; + } + + public bool HasManualReview { + get { return result.hasManualReview; } + } + public bool ManualReview { + get { return result.ManualReview; } + set { SetManualReview(value); } + } + public Builder SetManualReview(bool value) { + PrepareBuilder(); + result.hasManualReview = true; + result.manualReview_ = value; + return this; + } + public Builder ClearManualReview() { + PrepareBuilder(); + result.hasManualReview = false; + result.manualReview_ = false; + return this; + } + } + static AccountInfo() { + object.ReferenceEquals(global::bnet.protocol.Entity.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/LibMooNet/bnet/protocol/FieldOptions.cs b/src/LibMooNet/bnet/protocol/FieldOptions.cs new file mode 100644 index 00000000..523bf66e --- /dev/null +++ b/src/LibMooNet/bnet/protocol/FieldOptions.cs @@ -0,0 +1,66 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace bnet.protocol { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class FieldOptions { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + registry.Add(global::bnet.protocol.FieldOptions.Log); + } + #endregion + #region Extensions + public const int LogFieldNumber = 50000; + public static pb::GeneratedExtensionBase Log; + #endregion + + #region Static variables + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static FieldOptions() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "ChhibmV0L2ZpZWxkX29wdGlvbnMucHJvdG8SDWJuZXQucHJvdG9jb2waIGdv" + + "b2dsZS9wcm90b2J1Zi9kZXNjcmlwdG9yLnByb3RvKiAKCUxvZ09wdGlvbhIK" + + "CgZISURERU4QARIHCgNIRVgQAjpGCgNsb2cSHS5nb29nbGUucHJvdG9idWYu" + + "RmllbGRPcHRpb25zGNCGAyABKA4yGC5ibmV0LnByb3RvY29sLkxvZ09wdGlv" + + "bg=="); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + global::bnet.protocol.FieldOptions.Log = pb::GeneratedSingleExtension.CreateInstance(global::bnet.protocol.FieldOptions.Descriptor.Extensions[0]); + return null; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, + }, assigner); + } + #endregion + + } + #region Enums + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public enum LogOption { + HIDDEN = 1, + HEX = 2, + } + + #endregion + +} + +#endregion Designer generated code diff --git a/source/D3Proto/bnet/protocol/Resource.cs b/src/LibMooNet/bnet/protocol/ResourceTypes.cs similarity index 66% rename from source/D3Proto/bnet/protocol/Resource.cs rename to src/LibMooNet/bnet/protocol/ResourceTypes.cs index ebe6f20d..b46ae3cb 100644 --- a/source/D3Proto/bnet/protocol/Resource.cs +++ b/src/LibMooNet/bnet/protocol/ResourceTypes.cs @@ -1,4 +1,6 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code using pb = global::Google.ProtocolBuffers; using pbc = global::Google.ProtocolBuffers.Collections; @@ -6,7 +8,10 @@ using scg = global::System.Collections.Generic; namespace bnet.protocol { - public static partial class Resource { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class ResourceTypes { #region Extension registration public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { @@ -30,20 +35,19 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { } private static pbd::FileDescriptor descriptor; - static Resource() { + static ResourceTypes() { byte[] descriptorData = global::System.Convert.FromBase64String( - "ChtsaWIvcHJvdG9jb2wvcmVzb3VyY2UucHJvdG8SDWJuZXQucHJvdG9jb2wa" + - "IWxpYi9wcm90b2NvbC9jb250ZW50X2hhbmRsZS5wcm90bxocbGliL3Byb3Rv" + - "Y29sL2F0dHJpYnV0ZS5wcm90byJoCgdQYXlsb2FkEhYKDmNvbnRlbnRfaGFu" + - "ZGxlGAEgAigJEhEKCWRhdGFfc2l6ZRgCIAIoDRIyCgZjdXN0b20YAyADKAsy" + - "Ii5ibmV0LnByb3RvY29sLmF0dHJpYnV0ZS5BdHRyaWJ1dGUiWQoKRGVwZW5k" + - "ZW5jeRIXCg9yZXNvdXJjZV9oYW5kbGUYASACKAkSMgoGY3VzdG9tGAIgAygL" + - "MiIuYm5ldC5wcm90b2NvbC5hdHRyaWJ1dGUuQXR0cmlidXRlImIKCE1ldGFk" + - "YXRhEi0KCmRlcGVuZGVuY3kYASADKAsyGS5ibmV0LnByb3RvY29sLkRlcGVu" + - "ZGVuY3kSJwoHcGF5bG9hZBgCIAMoCzIWLmJuZXQucHJvdG9jb2wuUGF5bG9h" + - "ZCInCgpJbmRleEVudHJ5EgwKBG5hbWUYASACKAkSCwoDdXJsGAIgAigJIjkK" + - "DVJlc291cmNlSW5kZXgSKAoFZW50cnkYASADKAsyGS5ibmV0LnByb3RvY29s" + - "LkluZGV4RW50cnk="); + "ChlibmV0L3Jlc291cmNlX3R5cGVzLnByb3RvEg1ibmV0LnByb3RvY29sGhli" + + "bmV0L2NvbnRlbnRfaGFuZGxlLnByb3RvGhRibmV0L2F0dHJpYnV0ZS5wcm90" + + "byJoCgdQYXlsb2FkEhYKDmNvbnRlbnRfaGFuZGxlGAEgAigJEhEKCWRhdGFf" + + "c2l6ZRgCIAIoDRIyCgZjdXN0b20YAyADKAsyIi5ibmV0LnByb3RvY29sLmF0" + + "dHJpYnV0ZS5BdHRyaWJ1dGUiWQoKRGVwZW5kZW5jeRIXCg9yZXNvdXJjZV9o" + + "YW5kbGUYASACKAkSMgoGY3VzdG9tGAIgAygLMiIuYm5ldC5wcm90b2NvbC5h" + + "dHRyaWJ1dGUuQXR0cmlidXRlImIKCE1ldGFkYXRhEi0KCmRlcGVuZGVuY3kY" + + "ASADKAsyGS5ibmV0LnByb3RvY29sLkRlcGVuZGVuY3kSJwoHcGF5bG9hZBgC" + + "IAMoCzIWLmJuZXQucHJvdG9jb2wuUGF5bG9hZCInCgpJbmRleEVudHJ5EgwK" + + "BG5hbWUYASACKAkSCwoDdXJsGAIgAigJIjkKDVJlc291cmNlSW5kZXgSKAoF" + + "ZW50cnkYASADKAsyGS5ibmV0LnByb3RvY29sLkluZGV4RW50cnk="); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_bnet_protocol_Payload__Descriptor = Descriptor.MessageTypes[0]; @@ -78,14 +82,20 @@ static Resource() { } #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Payload : pb::GeneratedMessage { - private static readonly Payload defaultInstance = new Builder().BuildPartial(); + private Payload() { } + private static readonly Payload defaultInstance = new Payload().MakeReadOnly(); + private static readonly string[] _payloadFieldNames = new string[] { "content_handle", "custom", "data_size" }; + private static readonly uint[] _payloadFieldTags = new uint[] { 10, 26, 16 }; public static Payload DefaultInstance { get { return defaultInstance; } } public override Payload DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override Payload ThisMessage { @@ -93,11 +103,11 @@ protected override Payload ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.Resource.internal__static_bnet_protocol_Payload__Descriptor; } + get { return global::bnet.protocol.ResourceTypes.internal__static_bnet_protocol_Payload__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.Resource.internal__static_bnet_protocol_Payload__FieldAccessorTable; } + get { return global::bnet.protocol.ResourceTypes.internal__static_bnet_protocol_Payload__FieldAccessorTable; } } public const int ContentHandleFieldNumber = 1; @@ -112,7 +122,7 @@ public string ContentHandle { public const int DataSizeFieldNumber = 2; private bool hasDataSize; - private uint dataSize_ = 0; + private uint dataSize_; public bool HasDataSize { get { return hasDataSize; } } @@ -143,16 +153,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasContentHandle) { - output.WriteString(1, ContentHandle); + string[] field_names = _payloadFieldNames; + if (hasContentHandle) { + output.WriteString(1, field_names[0], ContentHandle); } - if (HasDataSize) { - output.WriteUInt32(2, DataSize); + if (hasDataSize) { + output.WriteUInt32(2, field_names[2], DataSize); } - foreach (global::bnet.protocol.attribute.Attribute element in CustomList) { - output.WriteMessage(3, element); + if (custom_.Count > 0) { + output.WriteMessageArray(3, field_names[1], custom_); } UnknownFields.WriteTo(output); } @@ -164,10 +175,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasContentHandle) { + if (hasContentHandle) { size += pb::CodedOutputStream.ComputeStringSize(1, ContentHandle); } - if (HasDataSize) { + if (hasDataSize) { size += pb::CodedOutputStream.ComputeUInt32Size(2, DataSize); } foreach (global::bnet.protocol.attribute.Attribute element in CustomList) { @@ -203,38 +214,73 @@ public static Payload ParseDelimitedFrom(global::System.IO.Stream input) { public static Payload ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static Payload ParseFrom(pb::CodedInputStream input) { + public static Payload ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Payload ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static Payload ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private Payload MakeReadOnly() { + custom_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(Payload prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Payload cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Payload result; + + private Payload PrepareBuilder() { + if (resultIsReadOnly) { + Payload original = result; + result = new Payload(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - Payload result = new Payload(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override Payload MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new Payload(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -246,13 +292,11 @@ public override Payload DefaultInstanceForType { } public override Payload BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.custom_.MakeReadOnly(); - Payload returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -266,6 +310,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Payload other) { if (other == global::bnet.protocol.Payload.DefaultInstance) return this; + PrepareBuilder(); if (other.HasContentHandle) { ContentHandle = other.ContentHandle; } @@ -273,26 +318,37 @@ public override Builder MergeFrom(Payload other) { DataSize = other.DataSize; } if (other.custom_.Count != 0) { - base.AddRange(other.custom_, result.custom_); + result.custom_.Add(other.custom_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_payloadFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _payloadFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -304,30 +360,33 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { - ContentHandle = input.ReadString(); + result.hasContentHandle = input.ReadString(ref result.contentHandle_); break; } case 16: { - DataSize = input.ReadUInt32(); + result.hasDataSize = input.ReadUInt32(ref result.dataSize_); break; } case 26: { - global::bnet.protocol.attribute.Attribute.Builder subBuilder = global::bnet.protocol.attribute.Attribute.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddCustom(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.custom_, global::bnet.protocol.attribute.Attribute.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasContentHandle { - get { return result.HasContentHandle; } + get { return result.hasContentHandle; } } public string ContentHandle { get { return result.ContentHandle; } @@ -335,36 +394,40 @@ public string ContentHandle { } public Builder SetContentHandle(string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasContentHandle = true; result.contentHandle_ = value; return this; } public Builder ClearContentHandle() { + PrepareBuilder(); result.hasContentHandle = false; result.contentHandle_ = ""; return this; } public bool HasDataSize { - get { return result.HasDataSize; } + get { return result.hasDataSize; } } public uint DataSize { get { return result.DataSize; } set { SetDataSize(value); } } public Builder SetDataSize(uint value) { + PrepareBuilder(); result.hasDataSize = true; result.dataSize_ = value; return this; } public Builder ClearDataSize() { + PrepareBuilder(); result.hasDataSize = false; result.dataSize_ = 0; return this; } public pbc::IPopsicleList CustomList { - get { return result.custom_; } + get { return PrepareBuilder().custom_; } } public int CustomCount { get { return result.CustomCount; } @@ -374,46 +437,58 @@ public int CustomCount { } public Builder SetCustom(int index, global::bnet.protocol.attribute.Attribute value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.custom_[index] = value; return this; } public Builder SetCustom(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.custom_[index] = builderForValue.Build(); return this; } public Builder AddCustom(global::bnet.protocol.attribute.Attribute value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.custom_.Add(value); return this; } public Builder AddCustom(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.custom_.Add(builderForValue.Build()); return this; } public Builder AddRangeCustom(scg::IEnumerable values) { - base.AddRange(values, result.custom_); + PrepareBuilder(); + result.custom_.Add(values); return this; } public Builder ClearCustom() { + PrepareBuilder(); result.custom_.Clear(); return this; } } static Payload() { - object.ReferenceEquals(global::bnet.protocol.Resource.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.ResourceTypes.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Dependency : pb::GeneratedMessage { - private static readonly Dependency defaultInstance = new Builder().BuildPartial(); + private Dependency() { } + private static readonly Dependency defaultInstance = new Dependency().MakeReadOnly(); + private static readonly string[] _dependencyFieldNames = new string[] { "custom", "resource_handle" }; + private static readonly uint[] _dependencyFieldTags = new uint[] { 18, 10 }; public static Dependency DefaultInstance { get { return defaultInstance; } } public override Dependency DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override Dependency ThisMessage { @@ -421,11 +496,11 @@ protected override Dependency ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.Resource.internal__static_bnet_protocol_Dependency__Descriptor; } + get { return global::bnet.protocol.ResourceTypes.internal__static_bnet_protocol_Dependency__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.Resource.internal__static_bnet_protocol_Dependency__FieldAccessorTable; } + get { return global::bnet.protocol.ResourceTypes.internal__static_bnet_protocol_Dependency__FieldAccessorTable; } } public const int ResourceHandleFieldNumber = 1; @@ -460,13 +535,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasResourceHandle) { - output.WriteString(1, ResourceHandle); + string[] field_names = _dependencyFieldNames; + if (hasResourceHandle) { + output.WriteString(1, field_names[1], ResourceHandle); } - foreach (global::bnet.protocol.attribute.Attribute element in CustomList) { - output.WriteMessage(2, element); + if (custom_.Count > 0) { + output.WriteMessageArray(2, field_names[0], custom_); } UnknownFields.WriteTo(output); } @@ -478,7 +554,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasResourceHandle) { + if (hasResourceHandle) { size += pb::CodedOutputStream.ComputeStringSize(1, ResourceHandle); } foreach (global::bnet.protocol.attribute.Attribute element in CustomList) { @@ -514,38 +590,73 @@ public static Dependency ParseDelimitedFrom(global::System.IO.Stream input) { public static Dependency ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static Dependency ParseFrom(pb::CodedInputStream input) { + public static Dependency ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Dependency ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static Dependency ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private Dependency MakeReadOnly() { + custom_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(Dependency prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Dependency cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - Dependency result = new Dependency(); + private bool resultIsReadOnly; + private Dependency result; + + private Dependency PrepareBuilder() { + if (resultIsReadOnly) { + Dependency original = result; + result = new Dependency(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override Dependency MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new Dependency(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -557,13 +668,11 @@ public override Dependency DefaultInstanceForType { } public override Dependency BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.custom_.MakeReadOnly(); - Dependency returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -577,30 +686,42 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Dependency other) { if (other == global::bnet.protocol.Dependency.DefaultInstance) return this; + PrepareBuilder(); if (other.HasResourceHandle) { ResourceHandle = other.ResourceHandle; } if (other.custom_.Count != 0) { - base.AddRange(other.custom_, result.custom_); + result.custom_.Add(other.custom_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_dependencyFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _dependencyFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -612,26 +733,29 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { - ResourceHandle = input.ReadString(); + result.hasResourceHandle = input.ReadString(ref result.resourceHandle_); break; } case 18: { - global::bnet.protocol.attribute.Attribute.Builder subBuilder = global::bnet.protocol.attribute.Attribute.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddCustom(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.custom_, global::bnet.protocol.attribute.Attribute.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasResourceHandle { - get { return result.HasResourceHandle; } + get { return result.hasResourceHandle; } } public string ResourceHandle { get { return result.ResourceHandle; } @@ -639,18 +763,20 @@ public string ResourceHandle { } public Builder SetResourceHandle(string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasResourceHandle = true; result.resourceHandle_ = value; return this; } public Builder ClearResourceHandle() { + PrepareBuilder(); result.hasResourceHandle = false; result.resourceHandle_ = ""; return this; } public pbc::IPopsicleList CustomList { - get { return result.custom_; } + get { return PrepareBuilder().custom_; } } public int CustomCount { get { return result.CustomCount; } @@ -660,46 +786,58 @@ public int CustomCount { } public Builder SetCustom(int index, global::bnet.protocol.attribute.Attribute value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.custom_[index] = value; return this; } public Builder SetCustom(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.custom_[index] = builderForValue.Build(); return this; } public Builder AddCustom(global::bnet.protocol.attribute.Attribute value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.custom_.Add(value); return this; } public Builder AddCustom(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.custom_.Add(builderForValue.Build()); return this; } public Builder AddRangeCustom(scg::IEnumerable values) { - base.AddRange(values, result.custom_); + PrepareBuilder(); + result.custom_.Add(values); return this; } public Builder ClearCustom() { + PrepareBuilder(); result.custom_.Clear(); return this; } } static Dependency() { - object.ReferenceEquals(global::bnet.protocol.Resource.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.ResourceTypes.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Metadata : pb::GeneratedMessage { - private static readonly Metadata defaultInstance = new Builder().BuildPartial(); + private Metadata() { } + private static readonly Metadata defaultInstance = new Metadata().MakeReadOnly(); + private static readonly string[] _metadataFieldNames = new string[] { "dependency", "payload" }; + private static readonly uint[] _metadataFieldTags = new uint[] { 10, 18 }; public static Metadata DefaultInstance { get { return defaultInstance; } } public override Metadata DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override Metadata ThisMessage { @@ -707,11 +845,11 @@ protected override Metadata ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.Resource.internal__static_bnet_protocol_Metadata__Descriptor; } + get { return global::bnet.protocol.ResourceTypes.internal__static_bnet_protocol_Metadata__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.Resource.internal__static_bnet_protocol_Metadata__FieldAccessorTable; } + get { return global::bnet.protocol.ResourceTypes.internal__static_bnet_protocol_Metadata__FieldAccessorTable; } } public const int DependencyFieldNumber = 1; @@ -750,13 +888,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - foreach (global::bnet.protocol.Dependency element in DependencyList) { - output.WriteMessage(1, element); + string[] field_names = _metadataFieldNames; + if (dependency_.Count > 0) { + output.WriteMessageArray(1, field_names[0], dependency_); } - foreach (global::bnet.protocol.Payload element in PayloadList) { - output.WriteMessage(2, element); + if (payload_.Count > 0) { + output.WriteMessageArray(2, field_names[1], payload_); } UnknownFields.WriteTo(output); } @@ -804,38 +943,74 @@ public static Metadata ParseDelimitedFrom(global::System.IO.Stream input) { public static Metadata ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static Metadata ParseFrom(pb::CodedInputStream input) { + public static Metadata ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Metadata ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static Metadata ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private Metadata MakeReadOnly() { + dependency_.MakeReadOnly(); + payload_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(Metadata prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Metadata cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - Metadata result = new Metadata(); + private bool resultIsReadOnly; + private Metadata result; + + private Metadata PrepareBuilder() { + if (resultIsReadOnly) { + Metadata original = result; + result = new Metadata(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override Metadata MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new Metadata(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -847,14 +1022,11 @@ public override Metadata DefaultInstanceForType { } public override Metadata BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.dependency_.MakeReadOnly(); - result.payload_.MakeReadOnly(); - Metadata returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -868,30 +1040,42 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Metadata other) { if (other == global::bnet.protocol.Metadata.DefaultInstance) return this; + PrepareBuilder(); if (other.dependency_.Count != 0) { - base.AddRange(other.dependency_, result.dependency_); + result.dependency_.Add(other.dependency_); } if (other.payload_.Count != 0) { - base.AddRange(other.payload_, result.payload_); + result.payload_.Add(other.payload_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_metadataFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _metadataFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -903,28 +1087,29 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { - global::bnet.protocol.Dependency.Builder subBuilder = global::bnet.protocol.Dependency.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddDependency(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.dependency_, global::bnet.protocol.Dependency.DefaultInstance, extensionRegistry); break; } case 18: { - global::bnet.protocol.Payload.Builder subBuilder = global::bnet.protocol.Payload.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddPayload(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.payload_, global::bnet.protocol.Payload.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public pbc::IPopsicleList DependencyList { - get { return result.dependency_; } + get { return PrepareBuilder().dependency_; } } public int DependencyCount { get { return result.DependencyCount; } @@ -934,35 +1119,41 @@ public int DependencyCount { } public Builder SetDependency(int index, global::bnet.protocol.Dependency value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.dependency_[index] = value; return this; } public Builder SetDependency(int index, global::bnet.protocol.Dependency.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.dependency_[index] = builderForValue.Build(); return this; } public Builder AddDependency(global::bnet.protocol.Dependency value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.dependency_.Add(value); return this; } public Builder AddDependency(global::bnet.protocol.Dependency.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.dependency_.Add(builderForValue.Build()); return this; } public Builder AddRangeDependency(scg::IEnumerable values) { - base.AddRange(values, result.dependency_); + PrepareBuilder(); + result.dependency_.Add(values); return this; } public Builder ClearDependency() { + PrepareBuilder(); result.dependency_.Clear(); return this; } public pbc::IPopsicleList PayloadList { - get { return result.payload_; } + get { return PrepareBuilder().payload_; } } public int PayloadCount { get { return result.PayloadCount; } @@ -972,46 +1163,58 @@ public int PayloadCount { } public Builder SetPayload(int index, global::bnet.protocol.Payload value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.payload_[index] = value; return this; } public Builder SetPayload(int index, global::bnet.protocol.Payload.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.payload_[index] = builderForValue.Build(); return this; } public Builder AddPayload(global::bnet.protocol.Payload value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.payload_.Add(value); return this; } public Builder AddPayload(global::bnet.protocol.Payload.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.payload_.Add(builderForValue.Build()); return this; } public Builder AddRangePayload(scg::IEnumerable values) { - base.AddRange(values, result.payload_); + PrepareBuilder(); + result.payload_.Add(values); return this; } public Builder ClearPayload() { + PrepareBuilder(); result.payload_.Clear(); return this; } } static Metadata() { - object.ReferenceEquals(global::bnet.protocol.Resource.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.ResourceTypes.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class IndexEntry : pb::GeneratedMessage { - private static readonly IndexEntry defaultInstance = new Builder().BuildPartial(); + private IndexEntry() { } + private static readonly IndexEntry defaultInstance = new IndexEntry().MakeReadOnly(); + private static readonly string[] _indexEntryFieldNames = new string[] { "name", "url" }; + private static readonly uint[] _indexEntryFieldTags = new uint[] { 10, 18 }; public static IndexEntry DefaultInstance { get { return defaultInstance; } } public override IndexEntry DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override IndexEntry ThisMessage { @@ -1019,11 +1222,11 @@ protected override IndexEntry ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.Resource.internal__static_bnet_protocol_IndexEntry__Descriptor; } + get { return global::bnet.protocol.ResourceTypes.internal__static_bnet_protocol_IndexEntry__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.Resource.internal__static_bnet_protocol_IndexEntry__FieldAccessorTable; } + get { return global::bnet.protocol.ResourceTypes.internal__static_bnet_protocol_IndexEntry__FieldAccessorTable; } } public const int NameFieldNumber = 1; @@ -1054,13 +1257,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasName) { - output.WriteString(1, Name); + string[] field_names = _indexEntryFieldNames; + if (hasName) { + output.WriteString(1, field_names[0], Name); } - if (HasUrl) { - output.WriteString(2, Url); + if (hasUrl) { + output.WriteString(2, field_names[1], Url); } UnknownFields.WriteTo(output); } @@ -1072,10 +1276,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasName) { + if (hasName) { size += pb::CodedOutputStream.ComputeStringSize(1, Name); } - if (HasUrl) { + if (hasUrl) { size += pb::CodedOutputStream.ComputeStringSize(2, Url); } size += UnknownFields.SerializedSize; @@ -1108,38 +1312,72 @@ public static IndexEntry ParseDelimitedFrom(global::System.IO.Stream input) { public static IndexEntry ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static IndexEntry ParseFrom(pb::CodedInputStream input) { + public static IndexEntry ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static IndexEntry ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static IndexEntry ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private IndexEntry MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(IndexEntry prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(IndexEntry cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private IndexEntry result; - IndexEntry result = new IndexEntry(); + private IndexEntry PrepareBuilder() { + if (resultIsReadOnly) { + IndexEntry original = result; + result = new IndexEntry(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override IndexEntry MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new IndexEntry(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -1151,12 +1389,11 @@ public override IndexEntry DefaultInstanceForType { } public override IndexEntry BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - IndexEntry returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1170,6 +1407,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(IndexEntry other) { if (other == global::bnet.protocol.IndexEntry.DefaultInstance) return this; + PrepareBuilder(); if (other.HasName) { Name = other.Name; } @@ -1180,20 +1418,31 @@ public override Builder MergeFrom(IndexEntry other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_indexEntryFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _indexEntryFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1205,24 +1454,29 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { - Name = input.ReadString(); + result.hasName = input.ReadString(ref result.name_); break; } case 18: { - Url = input.ReadString(); + result.hasUrl = input.ReadString(ref result.url_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasName { - get { return result.HasName; } + get { return result.hasName; } } public string Name { get { return result.Name; } @@ -1230,18 +1484,20 @@ public string Name { } public Builder SetName(string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasName = true; result.name_ = value; return this; } public Builder ClearName() { + PrepareBuilder(); result.hasName = false; result.name_ = ""; return this; } public bool HasUrl { - get { return result.HasUrl; } + get { return result.hasUrl; } } public string Url { get { return result.Url; } @@ -1249,29 +1505,37 @@ public string Url { } public Builder SetUrl(string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasUrl = true; result.url_ = value; return this; } public Builder ClearUrl() { + PrepareBuilder(); result.hasUrl = false; result.url_ = ""; return this; } } static IndexEntry() { - object.ReferenceEquals(global::bnet.protocol.Resource.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.ResourceTypes.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class ResourceIndex : pb::GeneratedMessage { - private static readonly ResourceIndex defaultInstance = new Builder().BuildPartial(); + private ResourceIndex() { } + private static readonly ResourceIndex defaultInstance = new ResourceIndex().MakeReadOnly(); + private static readonly string[] _resourceIndexFieldNames = new string[] { "entry" }; + private static readonly uint[] _resourceIndexFieldTags = new uint[] { 10 }; public static ResourceIndex DefaultInstance { get { return defaultInstance; } } public override ResourceIndex DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ResourceIndex ThisMessage { @@ -1279,11 +1543,11 @@ protected override ResourceIndex ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.Resource.internal__static_bnet_protocol_ResourceIndex__Descriptor; } + get { return global::bnet.protocol.ResourceTypes.internal__static_bnet_protocol_ResourceIndex__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.Resource.internal__static_bnet_protocol_ResourceIndex__FieldAccessorTable; } + get { return global::bnet.protocol.ResourceTypes.internal__static_bnet_protocol_ResourceIndex__FieldAccessorTable; } } public const int EntryFieldNumber = 1; @@ -1307,10 +1571,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - foreach (global::bnet.protocol.IndexEntry element in EntryList) { - output.WriteMessage(1, element); + string[] field_names = _resourceIndexFieldNames; + if (entry_.Count > 0) { + output.WriteMessageArray(1, field_names[0], entry_); } UnknownFields.WriteTo(output); } @@ -1355,38 +1620,73 @@ public static ResourceIndex ParseDelimitedFrom(global::System.IO.Stream input) { public static ResourceIndex ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static ResourceIndex ParseFrom(pb::CodedInputStream input) { + public static ResourceIndex ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ResourceIndex ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static ResourceIndex ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private ResourceIndex MakeReadOnly() { + entry_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(ResourceIndex prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ResourceIndex cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ResourceIndex result; + + private ResourceIndex PrepareBuilder() { + if (resultIsReadOnly) { + ResourceIndex original = result; + result = new ResourceIndex(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - ResourceIndex result = new ResourceIndex(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override ResourceIndex MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ResourceIndex(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -1398,13 +1698,11 @@ public override ResourceIndex DefaultInstanceForType { } public override ResourceIndex BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.entry_.MakeReadOnly(); - ResourceIndex returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1418,27 +1716,39 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(ResourceIndex other) { if (other == global::bnet.protocol.ResourceIndex.DefaultInstance) return this; + PrepareBuilder(); if (other.entry_.Count != 0) { - base.AddRange(other.entry_, result.entry_); + result.entry_.Add(other.entry_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_resourceIndexFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _resourceIndexFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1450,22 +1760,25 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { - global::bnet.protocol.IndexEntry.Builder subBuilder = global::bnet.protocol.IndexEntry.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddEntry(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.entry_, global::bnet.protocol.IndexEntry.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public pbc::IPopsicleList EntryList { - get { return result.entry_; } + get { return PrepareBuilder().entry_; } } public int EntryCount { get { return result.EntryCount; } @@ -1475,38 +1788,46 @@ public int EntryCount { } public Builder SetEntry(int index, global::bnet.protocol.IndexEntry value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.entry_[index] = value; return this; } public Builder SetEntry(int index, global::bnet.protocol.IndexEntry.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.entry_[index] = builderForValue.Build(); return this; } public Builder AddEntry(global::bnet.protocol.IndexEntry value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.entry_.Add(value); return this; } public Builder AddEntry(global::bnet.protocol.IndexEntry.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.entry_.Add(builderForValue.Build()); return this; } public Builder AddRangeEntry(scg::IEnumerable values) { - base.AddRange(values, result.entry_); + PrepareBuilder(); + result.entry_.Add(values); return this; } public Builder ClearEntry() { + PrepareBuilder(); result.entry_.Clear(); return this; } } static ResourceIndex() { - object.ReferenceEquals(global::bnet.protocol.Resource.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.ResourceTypes.Descriptor, null); } } #endregion } + +#endregion Designer generated code diff --git a/src/LibMooNet/bnet/protocol/RoleSet.cs b/src/LibMooNet/bnet/protocol/RoleSet.cs new file mode 100644 index 00000000..52073b05 --- /dev/null +++ b/src/LibMooNet/bnet/protocol/RoleSet.cs @@ -0,0 +1,2053 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace bnet.protocol { + + namespace Proto { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class RoleSet { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_bnet_protocol_Privilege__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_Privilege__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_RoleSetConfig__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_RoleSetConfig__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_Role__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_Role__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_RoleSet__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_RoleSet__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static RoleSet() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "ChNibmV0L3JvbGVfc2V0LnByb3RvEg1ibmV0LnByb3RvY29sGhRibmV0L2F0" + + "dHJpYnV0ZS5wcm90byIoCglQcml2aWxlZ2USDAoEbmFtZRgBIAIoCRINCgV2" + + "YWx1ZRgCIAIoDSJmCg1Sb2xlU2V0Q29uZmlnEisKCXByaXZpbGVnZRgBIAMo" + + "CzIYLmJuZXQucHJvdG9jb2wuUHJpdmlsZWdlEigKCHJvbGVfc2V0GAIgAigL" + + "MhYuYm5ldC5wcm90b2NvbC5Sb2xlU2V0ItABCgRSb2xlEgoKAmlkGAEgAigN" + + "EgwKBG5hbWUYAiACKAkSEQoJcHJpdmlsZWdlGAMgAygJEhsKD2Fzc2lnbmFi" + + "bGVfcm9sZRgEIAMoDUICEAESFwoIcmVxdWlyZWQYBSABKAg6BWZhbHNlEhUK" + + "BnVuaXF1ZRgGIAEoCDoFZmFsc2USFwoPcmVsZWdhdGlvbl9yb2xlGAcgASgN" + + "EjUKCWF0dHJpYnV0ZRgIIAMoCzIiLmJuZXQucHJvdG9jb2wuYXR0cmlidXRl" + + "LkF0dHJpYnV0ZSLOAQoHUm9sZVNldBIPCgdwcm9ncmFtGAEgAigJEg8KB3Nl" + + "cnZpY2UYAiACKAkSGAoHc3VidHlwZRgDIAEoCToHZGVmYXVsdBIhCgRyb2xl" + + "GAQgAygLMhMuYm5ldC5wcm90b2NvbC5Sb2xlEhgKDGRlZmF1bHRfcm9sZRgF" + + "IAMoDUICEAESEwoLbWF4X21lbWJlcnMYBiABKAUSNQoJYXR0cmlidXRlGAcg" + + "AygLMiIuYm5ldC5wcm90b2NvbC5hdHRyaWJ1dGUuQXR0cmlidXRl"); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_bnet_protocol_Privilege__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_Privilege__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_Privilege__Descriptor, + new string[] { "Name", "Value", }); + internal__static_bnet_protocol_RoleSetConfig__Descriptor = Descriptor.MessageTypes[1]; + internal__static_bnet_protocol_RoleSetConfig__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_RoleSetConfig__Descriptor, + new string[] { "Privilege", "RoleSet", }); + internal__static_bnet_protocol_Role__Descriptor = Descriptor.MessageTypes[2]; + internal__static_bnet_protocol_Role__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_Role__Descriptor, + new string[] { "Id", "Name", "Privilege", "AssignableRole", "Required", "Unique", "RelegationRole", "Attribute", }); + internal__static_bnet_protocol_RoleSet__Descriptor = Descriptor.MessageTypes[3]; + internal__static_bnet_protocol_RoleSet__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_RoleSet__Descriptor, + new string[] { "Program", "Service", "Subtype", "Role", "DefaultRole", "MaxMembers", "Attribute", }); + return null; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::bnet.protocol.attribute.Proto.Attribute.Descriptor, + }, assigner); + } + #endregion + + } + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Privilege : pb::GeneratedMessage { + private Privilege() { } + private static readonly Privilege defaultInstance = new Privilege().MakeReadOnly(); + private static readonly string[] _privilegeFieldNames = new string[] { "name", "value" }; + private static readonly uint[] _privilegeFieldTags = new uint[] { 10, 16 }; + public static Privilege DefaultInstance { + get { return defaultInstance; } + } + + public override Privilege DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Privilege ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.Proto.RoleSet.internal__static_bnet_protocol_Privilege__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.Proto.RoleSet.internal__static_bnet_protocol_Privilege__FieldAccessorTable; } + } + + public const int NameFieldNumber = 1; + private bool hasName; + private string name_ = ""; + public bool HasName { + get { return hasName; } + } + public string Name { + get { return name_; } + } + + public const int ValueFieldNumber = 2; + private bool hasValue; + private uint value_; + public bool HasValue { + get { return hasValue; } + } + public uint Value { + get { return value_; } + } + + public override bool IsInitialized { + get { + if (!hasName) return false; + if (!hasValue) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _privilegeFieldNames; + if (hasName) { + output.WriteString(1, field_names[0], Name); + } + if (hasValue) { + output.WriteUInt32(2, field_names[1], Value); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasName) { + size += pb::CodedOutputStream.ComputeStringSize(1, Name); + } + if (hasValue) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, Value); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static Privilege ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Privilege ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Privilege ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Privilege ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Privilege ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Privilege ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Privilege ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Privilege ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Privilege ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Privilege ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Privilege MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Privilege prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Privilege cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Privilege result; + + private Privilege PrepareBuilder() { + if (resultIsReadOnly) { + Privilege original = result; + result = new Privilege(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Privilege MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.Privilege.Descriptor; } + } + + public override Privilege DefaultInstanceForType { + get { return global::bnet.protocol.Privilege.DefaultInstance; } + } + + public override Privilege BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Privilege) { + return MergeFrom((Privilege) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Privilege other) { + if (other == global::bnet.protocol.Privilege.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasName) { + Name = other.Name; + } + if (other.HasValue) { + Value = other.Value; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_privilegeFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _privilegeFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasName = input.ReadString(ref result.name_); + break; + } + case 16: { + result.hasValue = input.ReadUInt32(ref result.value_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasName { + get { return result.hasName; } + } + public string Name { + get { return result.Name; } + set { SetName(value); } + } + public Builder SetName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasName = true; + result.name_ = value; + return this; + } + public Builder ClearName() { + PrepareBuilder(); + result.hasName = false; + result.name_ = ""; + return this; + } + + public bool HasValue { + get { return result.hasValue; } + } + public uint Value { + get { return result.Value; } + set { SetValue(value); } + } + public Builder SetValue(uint value) { + PrepareBuilder(); + result.hasValue = true; + result.value_ = value; + return this; + } + public Builder ClearValue() { + PrepareBuilder(); + result.hasValue = false; + result.value_ = 0; + return this; + } + } + static Privilege() { + object.ReferenceEquals(global::bnet.protocol.Proto.RoleSet.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class RoleSetConfig : pb::GeneratedMessage { + private RoleSetConfig() { } + private static readonly RoleSetConfig defaultInstance = new RoleSetConfig().MakeReadOnly(); + private static readonly string[] _roleSetConfigFieldNames = new string[] { "privilege", "role_set" }; + private static readonly uint[] _roleSetConfigFieldTags = new uint[] { 10, 18 }; + public static RoleSetConfig DefaultInstance { + get { return defaultInstance; } + } + + public override RoleSetConfig DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override RoleSetConfig ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.Proto.RoleSet.internal__static_bnet_protocol_RoleSetConfig__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.Proto.RoleSet.internal__static_bnet_protocol_RoleSetConfig__FieldAccessorTable; } + } + + public const int PrivilegeFieldNumber = 1; + private pbc::PopsicleList privilege_ = new pbc::PopsicleList(); + public scg::IList PrivilegeList { + get { return privilege_; } + } + public int PrivilegeCount { + get { return privilege_.Count; } + } + public global::bnet.protocol.Privilege GetPrivilege(int index) { + return privilege_[index]; + } + + public const int RoleSetFieldNumber = 2; + private bool hasRoleSet; + private global::bnet.protocol.RoleSet roleSet_; + public bool HasRoleSet { + get { return hasRoleSet; } + } + public global::bnet.protocol.RoleSet RoleSet { + get { return roleSet_ ?? global::bnet.protocol.RoleSet.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasRoleSet) return false; + foreach (global::bnet.protocol.Privilege element in PrivilegeList) { + if (!element.IsInitialized) return false; + } + if (!RoleSet.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _roleSetConfigFieldNames; + if (privilege_.Count > 0) { + output.WriteMessageArray(1, field_names[0], privilege_); + } + if (hasRoleSet) { + output.WriteMessage(2, field_names[1], RoleSet); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.Privilege element in PrivilegeList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + if (hasRoleSet) { + size += pb::CodedOutputStream.ComputeMessageSize(2, RoleSet); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static RoleSetConfig ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RoleSetConfig ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RoleSetConfig ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RoleSetConfig ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RoleSetConfig ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RoleSetConfig ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static RoleSetConfig ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static RoleSetConfig ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static RoleSetConfig ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RoleSetConfig ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private RoleSetConfig MakeReadOnly() { + privilege_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(RoleSetConfig prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(RoleSetConfig cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private RoleSetConfig result; + + private RoleSetConfig PrepareBuilder() { + if (resultIsReadOnly) { + RoleSetConfig original = result; + result = new RoleSetConfig(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override RoleSetConfig MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.RoleSetConfig.Descriptor; } + } + + public override RoleSetConfig DefaultInstanceForType { + get { return global::bnet.protocol.RoleSetConfig.DefaultInstance; } + } + + public override RoleSetConfig BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is RoleSetConfig) { + return MergeFrom((RoleSetConfig) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(RoleSetConfig other) { + if (other == global::bnet.protocol.RoleSetConfig.DefaultInstance) return this; + PrepareBuilder(); + if (other.privilege_.Count != 0) { + result.privilege_.Add(other.privilege_); + } + if (other.HasRoleSet) { + MergeRoleSet(other.RoleSet); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_roleSetConfigFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _roleSetConfigFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.privilege_, global::bnet.protocol.Privilege.DefaultInstance, extensionRegistry); + break; + } + case 18: { + global::bnet.protocol.RoleSet.Builder subBuilder = global::bnet.protocol.RoleSet.CreateBuilder(); + if (result.hasRoleSet) { + subBuilder.MergeFrom(RoleSet); + } + input.ReadMessage(subBuilder, extensionRegistry); + RoleSet = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList PrivilegeList { + get { return PrepareBuilder().privilege_; } + } + public int PrivilegeCount { + get { return result.PrivilegeCount; } + } + public global::bnet.protocol.Privilege GetPrivilege(int index) { + return result.GetPrivilege(index); + } + public Builder SetPrivilege(int index, global::bnet.protocol.Privilege value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.privilege_[index] = value; + return this; + } + public Builder SetPrivilege(int index, global::bnet.protocol.Privilege.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.privilege_[index] = builderForValue.Build(); + return this; + } + public Builder AddPrivilege(global::bnet.protocol.Privilege value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.privilege_.Add(value); + return this; + } + public Builder AddPrivilege(global::bnet.protocol.Privilege.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.privilege_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangePrivilege(scg::IEnumerable values) { + PrepareBuilder(); + result.privilege_.Add(values); + return this; + } + public Builder ClearPrivilege() { + PrepareBuilder(); + result.privilege_.Clear(); + return this; + } + + public bool HasRoleSet { + get { return result.hasRoleSet; } + } + public global::bnet.protocol.RoleSet RoleSet { + get { return result.RoleSet; } + set { SetRoleSet(value); } + } + public Builder SetRoleSet(global::bnet.protocol.RoleSet value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasRoleSet = true; + result.roleSet_ = value; + return this; + } + public Builder SetRoleSet(global::bnet.protocol.RoleSet.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasRoleSet = true; + result.roleSet_ = builderForValue.Build(); + return this; + } + public Builder MergeRoleSet(global::bnet.protocol.RoleSet value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasRoleSet && + result.roleSet_ != global::bnet.protocol.RoleSet.DefaultInstance) { + result.roleSet_ = global::bnet.protocol.RoleSet.CreateBuilder(result.roleSet_).MergeFrom(value).BuildPartial(); + } else { + result.roleSet_ = value; + } + result.hasRoleSet = true; + return this; + } + public Builder ClearRoleSet() { + PrepareBuilder(); + result.hasRoleSet = false; + result.roleSet_ = null; + return this; + } + } + static RoleSetConfig() { + object.ReferenceEquals(global::bnet.protocol.Proto.RoleSet.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Role : pb::GeneratedMessage { + private Role() { } + private static readonly Role defaultInstance = new Role().MakeReadOnly(); + private static readonly string[] _roleFieldNames = new string[] { "assignable_role", "attribute", "id", "name", "privilege", "relegation_role", "required", "unique" }; + private static readonly uint[] _roleFieldTags = new uint[] { 34, 66, 8, 18, 26, 56, 40, 48 }; + public static Role DefaultInstance { + get { return defaultInstance; } + } + + public override Role DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Role ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.Proto.RoleSet.internal__static_bnet_protocol_Role__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.Proto.RoleSet.internal__static_bnet_protocol_Role__FieldAccessorTable; } + } + + public const int IdFieldNumber = 1; + private bool hasId; + private uint id_; + public bool HasId { + get { return hasId; } + } + public uint Id { + get { return id_; } + } + + public const int NameFieldNumber = 2; + private bool hasName; + private string name_ = ""; + public bool HasName { + get { return hasName; } + } + public string Name { + get { return name_; } + } + + public const int PrivilegeFieldNumber = 3; + private pbc::PopsicleList privilege_ = new pbc::PopsicleList(); + public scg::IList PrivilegeList { + get { return pbc::Lists.AsReadOnly(privilege_); } + } + public int PrivilegeCount { + get { return privilege_.Count; } + } + public string GetPrivilege(int index) { + return privilege_[index]; + } + + public const int AssignableRoleFieldNumber = 4; + private int assignableRoleMemoizedSerializedSize; + private pbc::PopsicleList assignableRole_ = new pbc::PopsicleList(); + public scg::IList AssignableRoleList { + get { return pbc::Lists.AsReadOnly(assignableRole_); } + } + public int AssignableRoleCount { + get { return assignableRole_.Count; } + } + public uint GetAssignableRole(int index) { + return assignableRole_[index]; + } + + public const int RequiredFieldNumber = 5; + private bool hasRequired; + private bool required_; + public bool HasRequired { + get { return hasRequired; } + } + public bool Required { + get { return required_; } + } + + public const int UniqueFieldNumber = 6; + private bool hasUnique; + private bool unique_; + public bool HasUnique { + get { return hasUnique; } + } + public bool Unique { + get { return unique_; } + } + + public const int RelegationRoleFieldNumber = 7; + private bool hasRelegationRole; + private uint relegationRole_; + public bool HasRelegationRole { + get { return hasRelegationRole; } + } + public uint RelegationRole { + get { return relegationRole_; } + } + + public const int AttributeFieldNumber = 8; + private pbc::PopsicleList attribute_ = new pbc::PopsicleList(); + public scg::IList AttributeList { + get { return attribute_; } + } + public int AttributeCount { + get { return attribute_.Count; } + } + public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { + return attribute_[index]; + } + + public override bool IsInitialized { + get { + if (!hasId) return false; + if (!hasName) return false; + foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _roleFieldNames; + if (hasId) { + output.WriteUInt32(1, field_names[2], Id); + } + if (hasName) { + output.WriteString(2, field_names[3], Name); + } + if (privilege_.Count > 0) { + output.WriteStringArray(3, field_names[4], privilege_); + } + if (assignableRole_.Count > 0) { + output.WritePackedUInt32Array(4, field_names[0], assignableRoleMemoizedSerializedSize, assignableRole_); + } + if (hasRequired) { + output.WriteBool(5, field_names[6], Required); + } + if (hasUnique) { + output.WriteBool(6, field_names[7], Unique); + } + if (hasRelegationRole) { + output.WriteUInt32(7, field_names[5], RelegationRole); + } + if (attribute_.Count > 0) { + output.WriteMessageArray(8, field_names[1], attribute_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasId) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, Id); + } + if (hasName) { + size += pb::CodedOutputStream.ComputeStringSize(2, Name); + } + { + int dataSize = 0; + foreach (string element in PrivilegeList) { + dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); + } + size += dataSize; + size += 1 * privilege_.Count; + } + { + int dataSize = 0; + foreach (uint element in AssignableRoleList) { + dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); + } + size += dataSize; + if (assignableRole_.Count != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); + } + assignableRoleMemoizedSerializedSize = dataSize; + } + if (hasRequired) { + size += pb::CodedOutputStream.ComputeBoolSize(5, Required); + } + if (hasUnique) { + size += pb::CodedOutputStream.ComputeBoolSize(6, Unique); + } + if (hasRelegationRole) { + size += pb::CodedOutputStream.ComputeUInt32Size(7, RelegationRole); + } + foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { + size += pb::CodedOutputStream.ComputeMessageSize(8, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static Role ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Role ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Role ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Role ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Role ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Role ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Role ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Role ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Role ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Role ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Role MakeReadOnly() { + privilege_.MakeReadOnly(); + assignableRole_.MakeReadOnly(); + attribute_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Role prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Role cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Role result; + + private Role PrepareBuilder() { + if (resultIsReadOnly) { + Role original = result; + result = new Role(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Role MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.Role.Descriptor; } + } + + public override Role DefaultInstanceForType { + get { return global::bnet.protocol.Role.DefaultInstance; } + } + + public override Role BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Role) { + return MergeFrom((Role) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Role other) { + if (other == global::bnet.protocol.Role.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasId) { + Id = other.Id; + } + if (other.HasName) { + Name = other.Name; + } + if (other.privilege_.Count != 0) { + result.privilege_.Add(other.privilege_); + } + if (other.assignableRole_.Count != 0) { + result.assignableRole_.Add(other.assignableRole_); + } + if (other.HasRequired) { + Required = other.Required; + } + if (other.HasUnique) { + Unique = other.Unique; + } + if (other.HasRelegationRole) { + RelegationRole = other.RelegationRole; + } + if (other.attribute_.Count != 0) { + result.attribute_.Add(other.attribute_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_roleFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _roleFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasId = input.ReadUInt32(ref result.id_); + break; + } + case 18: { + result.hasName = input.ReadString(ref result.name_); + break; + } + case 26: { + input.ReadStringArray(tag, field_name, result.privilege_); + break; + } + case 34: + case 32: { + input.ReadUInt32Array(tag, field_name, result.assignableRole_); + break; + } + case 40: { + result.hasRequired = input.ReadBool(ref result.required_); + break; + } + case 48: { + result.hasUnique = input.ReadBool(ref result.unique_); + break; + } + case 56: { + result.hasRelegationRole = input.ReadUInt32(ref result.relegationRole_); + break; + } + case 66: { + input.ReadMessageArray(tag, field_name, result.attribute_, global::bnet.protocol.attribute.Attribute.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasId { + get { return result.hasId; } + } + public uint Id { + get { return result.Id; } + set { SetId(value); } + } + public Builder SetId(uint value) { + PrepareBuilder(); + result.hasId = true; + result.id_ = value; + return this; + } + public Builder ClearId() { + PrepareBuilder(); + result.hasId = false; + result.id_ = 0; + return this; + } + + public bool HasName { + get { return result.hasName; } + } + public string Name { + get { return result.Name; } + set { SetName(value); } + } + public Builder SetName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasName = true; + result.name_ = value; + return this; + } + public Builder ClearName() { + PrepareBuilder(); + result.hasName = false; + result.name_ = ""; + return this; + } + + public pbc::IPopsicleList PrivilegeList { + get { return PrepareBuilder().privilege_; } + } + public int PrivilegeCount { + get { return result.PrivilegeCount; } + } + public string GetPrivilege(int index) { + return result.GetPrivilege(index); + } + public Builder SetPrivilege(int index, string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.privilege_[index] = value; + return this; + } + public Builder AddPrivilege(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.privilege_.Add(value); + return this; + } + public Builder AddRangePrivilege(scg::IEnumerable values) { + PrepareBuilder(); + result.privilege_.Add(values); + return this; + } + public Builder ClearPrivilege() { + PrepareBuilder(); + result.privilege_.Clear(); + return this; + } + + public pbc::IPopsicleList AssignableRoleList { + get { return PrepareBuilder().assignableRole_; } + } + public int AssignableRoleCount { + get { return result.AssignableRoleCount; } + } + public uint GetAssignableRole(int index) { + return result.GetAssignableRole(index); + } + public Builder SetAssignableRole(int index, uint value) { + PrepareBuilder(); + result.assignableRole_[index] = value; + return this; + } + public Builder AddAssignableRole(uint value) { + PrepareBuilder(); + result.assignableRole_.Add(value); + return this; + } + public Builder AddRangeAssignableRole(scg::IEnumerable values) { + PrepareBuilder(); + result.assignableRole_.Add(values); + return this; + } + public Builder ClearAssignableRole() { + PrepareBuilder(); + result.assignableRole_.Clear(); + return this; + } + + public bool HasRequired { + get { return result.hasRequired; } + } + public bool Required { + get { return result.Required; } + set { SetRequired(value); } + } + public Builder SetRequired(bool value) { + PrepareBuilder(); + result.hasRequired = true; + result.required_ = value; + return this; + } + public Builder ClearRequired() { + PrepareBuilder(); + result.hasRequired = false; + result.required_ = false; + return this; + } + + public bool HasUnique { + get { return result.hasUnique; } + } + public bool Unique { + get { return result.Unique; } + set { SetUnique(value); } + } + public Builder SetUnique(bool value) { + PrepareBuilder(); + result.hasUnique = true; + result.unique_ = value; + return this; + } + public Builder ClearUnique() { + PrepareBuilder(); + result.hasUnique = false; + result.unique_ = false; + return this; + } + + public bool HasRelegationRole { + get { return result.hasRelegationRole; } + } + public uint RelegationRole { + get { return result.RelegationRole; } + set { SetRelegationRole(value); } + } + public Builder SetRelegationRole(uint value) { + PrepareBuilder(); + result.hasRelegationRole = true; + result.relegationRole_ = value; + return this; + } + public Builder ClearRelegationRole() { + PrepareBuilder(); + result.hasRelegationRole = false; + result.relegationRole_ = 0; + return this; + } + + public pbc::IPopsicleList AttributeList { + get { return PrepareBuilder().attribute_; } + } + public int AttributeCount { + get { return result.AttributeCount; } + } + public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { + return result.GetAttribute(index); + } + public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.attribute_[index] = value; + return this; + } + public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.attribute_[index] = builderForValue.Build(); + return this; + } + public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.attribute_.Add(value); + return this; + } + public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.attribute_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeAttribute(scg::IEnumerable values) { + PrepareBuilder(); + result.attribute_.Add(values); + return this; + } + public Builder ClearAttribute() { + PrepareBuilder(); + result.attribute_.Clear(); + return this; + } + } + static Role() { + object.ReferenceEquals(global::bnet.protocol.Proto.RoleSet.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class RoleSet : pb::GeneratedMessage { + private RoleSet() { } + private static readonly RoleSet defaultInstance = new RoleSet().MakeReadOnly(); + private static readonly string[] _roleSetFieldNames = new string[] { "attribute", "default_role", "max_members", "program", "role", "service", "subtype" }; + private static readonly uint[] _roleSetFieldTags = new uint[] { 58, 42, 48, 10, 34, 18, 26 }; + public static RoleSet DefaultInstance { + get { return defaultInstance; } + } + + public override RoleSet DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override RoleSet ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.Proto.RoleSet.internal__static_bnet_protocol_RoleSet__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.Proto.RoleSet.internal__static_bnet_protocol_RoleSet__FieldAccessorTable; } + } + + public const int ProgramFieldNumber = 1; + private bool hasProgram; + private string program_ = ""; + public bool HasProgram { + get { return hasProgram; } + } + public string Program { + get { return program_; } + } + + public const int ServiceFieldNumber = 2; + private bool hasService; + private string service_ = ""; + public bool HasService { + get { return hasService; } + } + public string Service { + get { return service_; } + } + + public const int SubtypeFieldNumber = 3; + private bool hasSubtype; + private string subtype_ = "default"; + public bool HasSubtype { + get { return hasSubtype; } + } + public string Subtype { + get { return subtype_; } + } + + public const int RoleFieldNumber = 4; + private pbc::PopsicleList role_ = new pbc::PopsicleList(); + public scg::IList RoleList { + get { return role_; } + } + public int RoleCount { + get { return role_.Count; } + } + public global::bnet.protocol.Role GetRole(int index) { + return role_[index]; + } + + public const int DefaultRoleFieldNumber = 5; + private int defaultRoleMemoizedSerializedSize; + private pbc::PopsicleList defaultRole_ = new pbc::PopsicleList(); + public scg::IList DefaultRoleList { + get { return pbc::Lists.AsReadOnly(defaultRole_); } + } + public int DefaultRoleCount { + get { return defaultRole_.Count; } + } + public uint GetDefaultRole(int index) { + return defaultRole_[index]; + } + + public const int MaxMembersFieldNumber = 6; + private bool hasMaxMembers; + private int maxMembers_; + public bool HasMaxMembers { + get { return hasMaxMembers; } + } + public int MaxMembers { + get { return maxMembers_; } + } + + public const int AttributeFieldNumber = 7; + private pbc::PopsicleList attribute_ = new pbc::PopsicleList(); + public scg::IList AttributeList { + get { return attribute_; } + } + public int AttributeCount { + get { return attribute_.Count; } + } + public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { + return attribute_[index]; + } + + public override bool IsInitialized { + get { + if (!hasProgram) return false; + if (!hasService) return false; + foreach (global::bnet.protocol.Role element in RoleList) { + if (!element.IsInitialized) return false; + } + foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _roleSetFieldNames; + if (hasProgram) { + output.WriteString(1, field_names[3], Program); + } + if (hasService) { + output.WriteString(2, field_names[5], Service); + } + if (hasSubtype) { + output.WriteString(3, field_names[6], Subtype); + } + if (role_.Count > 0) { + output.WriteMessageArray(4, field_names[4], role_); + } + if (defaultRole_.Count > 0) { + output.WritePackedUInt32Array(5, field_names[1], defaultRoleMemoizedSerializedSize, defaultRole_); + } + if (hasMaxMembers) { + output.WriteInt32(6, field_names[2], MaxMembers); + } + if (attribute_.Count > 0) { + output.WriteMessageArray(7, field_names[0], attribute_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasProgram) { + size += pb::CodedOutputStream.ComputeStringSize(1, Program); + } + if (hasService) { + size += pb::CodedOutputStream.ComputeStringSize(2, Service); + } + if (hasSubtype) { + size += pb::CodedOutputStream.ComputeStringSize(3, Subtype); + } + foreach (global::bnet.protocol.Role element in RoleList) { + size += pb::CodedOutputStream.ComputeMessageSize(4, element); + } + { + int dataSize = 0; + foreach (uint element in DefaultRoleList) { + dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); + } + size += dataSize; + if (defaultRole_.Count != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); + } + defaultRoleMemoizedSerializedSize = dataSize; + } + if (hasMaxMembers) { + size += pb::CodedOutputStream.ComputeInt32Size(6, MaxMembers); + } + foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { + size += pb::CodedOutputStream.ComputeMessageSize(7, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static RoleSet ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RoleSet ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RoleSet ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RoleSet ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RoleSet ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RoleSet ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static RoleSet ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static RoleSet ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static RoleSet ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RoleSet ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private RoleSet MakeReadOnly() { + role_.MakeReadOnly(); + defaultRole_.MakeReadOnly(); + attribute_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(RoleSet prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(RoleSet cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private RoleSet result; + + private RoleSet PrepareBuilder() { + if (resultIsReadOnly) { + RoleSet original = result; + result = new RoleSet(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override RoleSet MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.RoleSet.Descriptor; } + } + + public override RoleSet DefaultInstanceForType { + get { return global::bnet.protocol.RoleSet.DefaultInstance; } + } + + public override RoleSet BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is RoleSet) { + return MergeFrom((RoleSet) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(RoleSet other) { + if (other == global::bnet.protocol.RoleSet.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasProgram) { + Program = other.Program; + } + if (other.HasService) { + Service = other.Service; + } + if (other.HasSubtype) { + Subtype = other.Subtype; + } + if (other.role_.Count != 0) { + result.role_.Add(other.role_); + } + if (other.defaultRole_.Count != 0) { + result.defaultRole_.Add(other.defaultRole_); + } + if (other.HasMaxMembers) { + MaxMembers = other.MaxMembers; + } + if (other.attribute_.Count != 0) { + result.attribute_.Add(other.attribute_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_roleSetFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _roleSetFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasProgram = input.ReadString(ref result.program_); + break; + } + case 18: { + result.hasService = input.ReadString(ref result.service_); + break; + } + case 26: { + result.hasSubtype = input.ReadString(ref result.subtype_); + break; + } + case 34: { + input.ReadMessageArray(tag, field_name, result.role_, global::bnet.protocol.Role.DefaultInstance, extensionRegistry); + break; + } + case 42: + case 40: { + input.ReadUInt32Array(tag, field_name, result.defaultRole_); + break; + } + case 48: { + result.hasMaxMembers = input.ReadInt32(ref result.maxMembers_); + break; + } + case 58: { + input.ReadMessageArray(tag, field_name, result.attribute_, global::bnet.protocol.attribute.Attribute.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasProgram { + get { return result.hasProgram; } + } + public string Program { + get { return result.Program; } + set { SetProgram(value); } + } + public Builder SetProgram(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasProgram = true; + result.program_ = value; + return this; + } + public Builder ClearProgram() { + PrepareBuilder(); + result.hasProgram = false; + result.program_ = ""; + return this; + } + + public bool HasService { + get { return result.hasService; } + } + public string Service { + get { return result.Service; } + set { SetService(value); } + } + public Builder SetService(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasService = true; + result.service_ = value; + return this; + } + public Builder ClearService() { + PrepareBuilder(); + result.hasService = false; + result.service_ = ""; + return this; + } + + public bool HasSubtype { + get { return result.hasSubtype; } + } + public string Subtype { + get { return result.Subtype; } + set { SetSubtype(value); } + } + public Builder SetSubtype(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasSubtype = true; + result.subtype_ = value; + return this; + } + public Builder ClearSubtype() { + PrepareBuilder(); + result.hasSubtype = false; + result.subtype_ = "default"; + return this; + } + + public pbc::IPopsicleList RoleList { + get { return PrepareBuilder().role_; } + } + public int RoleCount { + get { return result.RoleCount; } + } + public global::bnet.protocol.Role GetRole(int index) { + return result.GetRole(index); + } + public Builder SetRole(int index, global::bnet.protocol.Role value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.role_[index] = value; + return this; + } + public Builder SetRole(int index, global::bnet.protocol.Role.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.role_[index] = builderForValue.Build(); + return this; + } + public Builder AddRole(global::bnet.protocol.Role value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.role_.Add(value); + return this; + } + public Builder AddRole(global::bnet.protocol.Role.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.role_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeRole(scg::IEnumerable values) { + PrepareBuilder(); + result.role_.Add(values); + return this; + } + public Builder ClearRole() { + PrepareBuilder(); + result.role_.Clear(); + return this; + } + + public pbc::IPopsicleList DefaultRoleList { + get { return PrepareBuilder().defaultRole_; } + } + public int DefaultRoleCount { + get { return result.DefaultRoleCount; } + } + public uint GetDefaultRole(int index) { + return result.GetDefaultRole(index); + } + public Builder SetDefaultRole(int index, uint value) { + PrepareBuilder(); + result.defaultRole_[index] = value; + return this; + } + public Builder AddDefaultRole(uint value) { + PrepareBuilder(); + result.defaultRole_.Add(value); + return this; + } + public Builder AddRangeDefaultRole(scg::IEnumerable values) { + PrepareBuilder(); + result.defaultRole_.Add(values); + return this; + } + public Builder ClearDefaultRole() { + PrepareBuilder(); + result.defaultRole_.Clear(); + return this; + } + + public bool HasMaxMembers { + get { return result.hasMaxMembers; } + } + public int MaxMembers { + get { return result.MaxMembers; } + set { SetMaxMembers(value); } + } + public Builder SetMaxMembers(int value) { + PrepareBuilder(); + result.hasMaxMembers = true; + result.maxMembers_ = value; + return this; + } + public Builder ClearMaxMembers() { + PrepareBuilder(); + result.hasMaxMembers = false; + result.maxMembers_ = 0; + return this; + } + + public pbc::IPopsicleList AttributeList { + get { return PrepareBuilder().attribute_; } + } + public int AttributeCount { + get { return result.AttributeCount; } + } + public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { + return result.GetAttribute(index); + } + public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.attribute_[index] = value; + return this; + } + public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.attribute_[index] = builderForValue.Build(); + return this; + } + public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.attribute_.Add(value); + return this; + } + public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.attribute_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeAttribute(scg::IEnumerable values) { + PrepareBuilder(); + result.attribute_.Add(values); + return this; + } + public Builder ClearAttribute() { + PrepareBuilder(); + result.attribute_.Clear(); + return this; + } + } + static RoleSet() { + object.ReferenceEquals(global::bnet.protocol.Proto.RoleSet.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/LibMooNet/bnet/protocol/Rpc.cs b/src/LibMooNet/bnet/protocol/Rpc.cs new file mode 100644 index 00000000..87556efb --- /dev/null +++ b/src/LibMooNet/bnet/protocol/Rpc.cs @@ -0,0 +1,2551 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace bnet.protocol { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class Rpc { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + registry.Add(global::bnet.protocol.Rpc.MethodId); + } + #endregion + #region Extensions + public const int MethodIdFieldNumber = 50000; + public static pb::GeneratedExtensionBase MethodId; + #endregion + + #region Static variables + internal static pbd::MessageDescriptor internal__static_bnet_protocol_NO_RESPONSE__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_NO_RESPONSE__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_Address__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_Address__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_ProcessId__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_ProcessId__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_ObjectAddress__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_ObjectAddress__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_NoData__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_NoData__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_ErrorInfo__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_ErrorInfo__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_Header__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_Header__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static Rpc() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "Cg5ibmV0L3JwYy5wcm90bxINYm5ldC5wcm90b2NvbBogZ29vZ2xlL3Byb3Rv" + + "YnVmL2Rlc2NyaXB0b3IucHJvdG8iDQoLTk9fUkVTUE9OU0UiKAoHQWRkcmVz" + + "cxIPCgdhZGRyZXNzGAEgAigJEgwKBHBvcnQYAiABKA0iKQoJUHJvY2Vzc0lk" + + "Eg0KBWxhYmVsGAEgAigNEg0KBWVwb2NoGAIgAigNIk0KDU9iamVjdEFkZHJl" + + "c3MSJgoEaG9zdBgBIAIoCzIYLmJuZXQucHJvdG9jb2wuUHJvY2Vzc0lkEhQK" + + "CW9iamVjdF9pZBgCIAEoBDoBMCIICgZOb0RhdGEiegoJRXJyb3JJbmZvEjQK" + + "Dm9iamVjdF9hZGRyZXNzGAEgAigLMhwuYm5ldC5wcm90b2NvbC5PYmplY3RB" + + "ZGRyZXNzEg4KBnN0YXR1cxgCIAIoDRIUCgxzZXJ2aWNlX2hhc2gYAyACKA0S" + + "EQoJbWV0aG9kX2lkGAQgAigNIqEBCgZIZWFkZXISEgoKc2VydmljZV9pZBgB" + + "IAIoDRIRCgltZXRob2RfaWQYAiABKA0SDQoFdG9rZW4YAyACKA0SFAoJb2Jq" + + "ZWN0X2lkGAQgASgEOgEwEg8KBHNpemUYBSABKA06ATASEQoGc3RhdHVzGAYg" + + "ASgNOgEwEicKBWVycm9yGAcgAygLMhguYm5ldC5wcm90b2NvbC5FcnJvcklu" + + "Zm86MwoJbWV0aG9kX2lkEh4uZ29vZ2xlLnByb3RvYnVmLk1ldGhvZE9wdGlv" + + "bnMY0IYDIAEoDQ=="); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_bnet_protocol_NO_RESPONSE__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_NO_RESPONSE__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_NO_RESPONSE__Descriptor, + new string[] { }); + internal__static_bnet_protocol_Address__Descriptor = Descriptor.MessageTypes[1]; + internal__static_bnet_protocol_Address__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_Address__Descriptor, + new string[] { "Address_", "Port", }); + internal__static_bnet_protocol_ProcessId__Descriptor = Descriptor.MessageTypes[2]; + internal__static_bnet_protocol_ProcessId__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_ProcessId__Descriptor, + new string[] { "Label", "Epoch", }); + internal__static_bnet_protocol_ObjectAddress__Descriptor = Descriptor.MessageTypes[3]; + internal__static_bnet_protocol_ObjectAddress__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_ObjectAddress__Descriptor, + new string[] { "Host", "ObjectId", }); + internal__static_bnet_protocol_NoData__Descriptor = Descriptor.MessageTypes[4]; + internal__static_bnet_protocol_NoData__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_NoData__Descriptor, + new string[] { }); + internal__static_bnet_protocol_ErrorInfo__Descriptor = Descriptor.MessageTypes[5]; + internal__static_bnet_protocol_ErrorInfo__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_ErrorInfo__Descriptor, + new string[] { "ObjectAddress", "Status", "ServiceHash", "MethodId", }); + internal__static_bnet_protocol_Header__Descriptor = Descriptor.MessageTypes[6]; + internal__static_bnet_protocol_Header__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_Header__Descriptor, + new string[] { "ServiceId", "MethodId", "Token", "ObjectId", "Size", "Status", "Error", }); + global::bnet.protocol.Rpc.MethodId = pb::GeneratedSingleExtension.CreateInstance(global::bnet.protocol.Rpc.Descriptor.Extensions[0]); + return null; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::Google.ProtocolBuffers.DescriptorProtos.DescriptorProtoFile.Descriptor, + }, assigner); + } + #endregion + + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class NO_RESPONSE : pb::GeneratedMessage { + private NO_RESPONSE() { } + private static readonly NO_RESPONSE defaultInstance = new NO_RESPONSE().MakeReadOnly(); + private static readonly string[] _nORESPONSEFieldNames = new string[] { }; + private static readonly uint[] _nORESPONSEFieldTags = new uint[] { }; + public static NO_RESPONSE DefaultInstance { + get { return defaultInstance; } + } + + public override NO_RESPONSE DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override NO_RESPONSE ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.Rpc.internal__static_bnet_protocol_NO_RESPONSE__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.Rpc.internal__static_bnet_protocol_NO_RESPONSE__FieldAccessorTable; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _nORESPONSEFieldNames; + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static NO_RESPONSE ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static NO_RESPONSE ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static NO_RESPONSE ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static NO_RESPONSE ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static NO_RESPONSE ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static NO_RESPONSE ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static NO_RESPONSE ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static NO_RESPONSE ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static NO_RESPONSE ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static NO_RESPONSE ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private NO_RESPONSE MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(NO_RESPONSE prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(NO_RESPONSE cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private NO_RESPONSE result; + + private NO_RESPONSE PrepareBuilder() { + if (resultIsReadOnly) { + NO_RESPONSE original = result; + result = new NO_RESPONSE(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override NO_RESPONSE MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.NO_RESPONSE.Descriptor; } + } + + public override NO_RESPONSE DefaultInstanceForType { + get { return global::bnet.protocol.NO_RESPONSE.DefaultInstance; } + } + + public override NO_RESPONSE BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is NO_RESPONSE) { + return MergeFrom((NO_RESPONSE) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(NO_RESPONSE other) { + if (other == global::bnet.protocol.NO_RESPONSE.DefaultInstance) return this; + PrepareBuilder(); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_nORESPONSEFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _nORESPONSEFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + } + static NO_RESPONSE() { + object.ReferenceEquals(global::bnet.protocol.Rpc.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Address : pb::GeneratedMessage { + private Address() { } + private static readonly Address defaultInstance = new Address().MakeReadOnly(); + private static readonly string[] _addressFieldNames = new string[] { "address", "port" }; + private static readonly uint[] _addressFieldTags = new uint[] { 10, 16 }; + public static Address DefaultInstance { + get { return defaultInstance; } + } + + public override Address DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Address ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.Rpc.internal__static_bnet_protocol_Address__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.Rpc.internal__static_bnet_protocol_Address__FieldAccessorTable; } + } + + public const int Address_FieldNumber = 1; + private bool hasAddress_; + private string address_ = ""; + public bool HasAddress_ { + get { return hasAddress_; } + } + public string Address_ { + get { return address_; } + } + + public const int PortFieldNumber = 2; + private bool hasPort; + private uint port_; + public bool HasPort { + get { return hasPort; } + } + public uint Port { + get { return port_; } + } + + public override bool IsInitialized { + get { + if (!hasAddress_) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _addressFieldNames; + if (hasAddress_) { + output.WriteString(1, field_names[0], Address_); + } + if (hasPort) { + output.WriteUInt32(2, field_names[1], Port); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAddress_) { + size += pb::CodedOutputStream.ComputeStringSize(1, Address_); + } + if (hasPort) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, Port); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static Address ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Address ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Address ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Address ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Address ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Address ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Address ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Address ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Address ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Address ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Address MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Address prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Address cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Address result; + + private Address PrepareBuilder() { + if (resultIsReadOnly) { + Address original = result; + result = new Address(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Address MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.Address.Descriptor; } + } + + public override Address DefaultInstanceForType { + get { return global::bnet.protocol.Address.DefaultInstance; } + } + + public override Address BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Address) { + return MergeFrom((Address) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Address other) { + if (other == global::bnet.protocol.Address.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAddress_) { + Address_ = other.Address_; + } + if (other.HasPort) { + Port = other.Port; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_addressFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _addressFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasAddress_ = input.ReadString(ref result.address_); + break; + } + case 16: { + result.hasPort = input.ReadUInt32(ref result.port_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAddress_ { + get { return result.hasAddress_; } + } + public string Address_ { + get { return result.Address_; } + set { SetAddress_(value); } + } + public Builder SetAddress_(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAddress_ = true; + result.address_ = value; + return this; + } + public Builder ClearAddress_() { + PrepareBuilder(); + result.hasAddress_ = false; + result.address_ = ""; + return this; + } + + public bool HasPort { + get { return result.hasPort; } + } + public uint Port { + get { return result.Port; } + set { SetPort(value); } + } + public Builder SetPort(uint value) { + PrepareBuilder(); + result.hasPort = true; + result.port_ = value; + return this; + } + public Builder ClearPort() { + PrepareBuilder(); + result.hasPort = false; + result.port_ = 0; + return this; + } + } + static Address() { + object.ReferenceEquals(global::bnet.protocol.Rpc.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ProcessId : pb::GeneratedMessage { + private ProcessId() { } + private static readonly ProcessId defaultInstance = new ProcessId().MakeReadOnly(); + private static readonly string[] _processIdFieldNames = new string[] { "epoch", "label" }; + private static readonly uint[] _processIdFieldTags = new uint[] { 16, 8 }; + public static ProcessId DefaultInstance { + get { return defaultInstance; } + } + + public override ProcessId DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ProcessId ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.Rpc.internal__static_bnet_protocol_ProcessId__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.Rpc.internal__static_bnet_protocol_ProcessId__FieldAccessorTable; } + } + + public const int LabelFieldNumber = 1; + private bool hasLabel; + private uint label_; + public bool HasLabel { + get { return hasLabel; } + } + public uint Label { + get { return label_; } + } + + public const int EpochFieldNumber = 2; + private bool hasEpoch; + private uint epoch_; + public bool HasEpoch { + get { return hasEpoch; } + } + public uint Epoch { + get { return epoch_; } + } + + public override bool IsInitialized { + get { + if (!hasLabel) return false; + if (!hasEpoch) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _processIdFieldNames; + if (hasLabel) { + output.WriteUInt32(1, field_names[1], Label); + } + if (hasEpoch) { + output.WriteUInt32(2, field_names[0], Epoch); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasLabel) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, Label); + } + if (hasEpoch) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, Epoch); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ProcessId ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ProcessId ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ProcessId ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ProcessId ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ProcessId ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ProcessId ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ProcessId ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ProcessId ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ProcessId ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ProcessId ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ProcessId MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ProcessId prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ProcessId cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ProcessId result; + + private ProcessId PrepareBuilder() { + if (resultIsReadOnly) { + ProcessId original = result; + result = new ProcessId(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ProcessId MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.ProcessId.Descriptor; } + } + + public override ProcessId DefaultInstanceForType { + get { return global::bnet.protocol.ProcessId.DefaultInstance; } + } + + public override ProcessId BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ProcessId) { + return MergeFrom((ProcessId) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ProcessId other) { + if (other == global::bnet.protocol.ProcessId.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasLabel) { + Label = other.Label; + } + if (other.HasEpoch) { + Epoch = other.Epoch; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_processIdFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _processIdFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasLabel = input.ReadUInt32(ref result.label_); + break; + } + case 16: { + result.hasEpoch = input.ReadUInt32(ref result.epoch_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasLabel { + get { return result.hasLabel; } + } + public uint Label { + get { return result.Label; } + set { SetLabel(value); } + } + public Builder SetLabel(uint value) { + PrepareBuilder(); + result.hasLabel = true; + result.label_ = value; + return this; + } + public Builder ClearLabel() { + PrepareBuilder(); + result.hasLabel = false; + result.label_ = 0; + return this; + } + + public bool HasEpoch { + get { return result.hasEpoch; } + } + public uint Epoch { + get { return result.Epoch; } + set { SetEpoch(value); } + } + public Builder SetEpoch(uint value) { + PrepareBuilder(); + result.hasEpoch = true; + result.epoch_ = value; + return this; + } + public Builder ClearEpoch() { + PrepareBuilder(); + result.hasEpoch = false; + result.epoch_ = 0; + return this; + } + } + static ProcessId() { + object.ReferenceEquals(global::bnet.protocol.Rpc.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ObjectAddress : pb::GeneratedMessage { + private ObjectAddress() { } + private static readonly ObjectAddress defaultInstance = new ObjectAddress().MakeReadOnly(); + private static readonly string[] _objectAddressFieldNames = new string[] { "host", "object_id" }; + private static readonly uint[] _objectAddressFieldTags = new uint[] { 10, 16 }; + public static ObjectAddress DefaultInstance { + get { return defaultInstance; } + } + + public override ObjectAddress DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ObjectAddress ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.Rpc.internal__static_bnet_protocol_ObjectAddress__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.Rpc.internal__static_bnet_protocol_ObjectAddress__FieldAccessorTable; } + } + + public const int HostFieldNumber = 1; + private bool hasHost; + private global::bnet.protocol.ProcessId host_; + public bool HasHost { + get { return hasHost; } + } + public global::bnet.protocol.ProcessId Host { + get { return host_ ?? global::bnet.protocol.ProcessId.DefaultInstance; } + } + + public const int ObjectIdFieldNumber = 2; + private bool hasObjectId; + private ulong objectId_; + public bool HasObjectId { + get { return hasObjectId; } + } + public ulong ObjectId { + get { return objectId_; } + } + + public override bool IsInitialized { + get { + if (!hasHost) return false; + if (!Host.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _objectAddressFieldNames; + if (hasHost) { + output.WriteMessage(1, field_names[0], Host); + } + if (hasObjectId) { + output.WriteUInt64(2, field_names[1], ObjectId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasHost) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Host); + } + if (hasObjectId) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, ObjectId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ObjectAddress ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ObjectAddress ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ObjectAddress ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ObjectAddress ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ObjectAddress ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ObjectAddress ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ObjectAddress ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ObjectAddress ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ObjectAddress ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ObjectAddress ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ObjectAddress MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ObjectAddress prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ObjectAddress cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ObjectAddress result; + + private ObjectAddress PrepareBuilder() { + if (resultIsReadOnly) { + ObjectAddress original = result; + result = new ObjectAddress(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ObjectAddress MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.ObjectAddress.Descriptor; } + } + + public override ObjectAddress DefaultInstanceForType { + get { return global::bnet.protocol.ObjectAddress.DefaultInstance; } + } + + public override ObjectAddress BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ObjectAddress) { + return MergeFrom((ObjectAddress) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ObjectAddress other) { + if (other == global::bnet.protocol.ObjectAddress.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasHost) { + MergeHost(other.Host); + } + if (other.HasObjectId) { + ObjectId = other.ObjectId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_objectAddressFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _objectAddressFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.ProcessId.Builder subBuilder = global::bnet.protocol.ProcessId.CreateBuilder(); + if (result.hasHost) { + subBuilder.MergeFrom(Host); + } + input.ReadMessage(subBuilder, extensionRegistry); + Host = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasObjectId = input.ReadUInt64(ref result.objectId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasHost { + get { return result.hasHost; } + } + public global::bnet.protocol.ProcessId Host { + get { return result.Host; } + set { SetHost(value); } + } + public Builder SetHost(global::bnet.protocol.ProcessId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasHost = true; + result.host_ = value; + return this; + } + public Builder SetHost(global::bnet.protocol.ProcessId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasHost = true; + result.host_ = builderForValue.Build(); + return this; + } + public Builder MergeHost(global::bnet.protocol.ProcessId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasHost && + result.host_ != global::bnet.protocol.ProcessId.DefaultInstance) { + result.host_ = global::bnet.protocol.ProcessId.CreateBuilder(result.host_).MergeFrom(value).BuildPartial(); + } else { + result.host_ = value; + } + result.hasHost = true; + return this; + } + public Builder ClearHost() { + PrepareBuilder(); + result.hasHost = false; + result.host_ = null; + return this; + } + + public bool HasObjectId { + get { return result.hasObjectId; } + } + public ulong ObjectId { + get { return result.ObjectId; } + set { SetObjectId(value); } + } + public Builder SetObjectId(ulong value) { + PrepareBuilder(); + result.hasObjectId = true; + result.objectId_ = value; + return this; + } + public Builder ClearObjectId() { + PrepareBuilder(); + result.hasObjectId = false; + result.objectId_ = 0UL; + return this; + } + } + static ObjectAddress() { + object.ReferenceEquals(global::bnet.protocol.Rpc.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class NoData : pb::GeneratedMessage { + private NoData() { } + private static readonly NoData defaultInstance = new NoData().MakeReadOnly(); + private static readonly string[] _noDataFieldNames = new string[] { }; + private static readonly uint[] _noDataFieldTags = new uint[] { }; + public static NoData DefaultInstance { + get { return defaultInstance; } + } + + public override NoData DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override NoData ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.Rpc.internal__static_bnet_protocol_NoData__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.Rpc.internal__static_bnet_protocol_NoData__FieldAccessorTable; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _noDataFieldNames; + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static NoData ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static NoData ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static NoData ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static NoData ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static NoData ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static NoData ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static NoData ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static NoData ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static NoData ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static NoData ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private NoData MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(NoData prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(NoData cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private NoData result; + + private NoData PrepareBuilder() { + if (resultIsReadOnly) { + NoData original = result; + result = new NoData(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override NoData MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.NoData.Descriptor; } + } + + public override NoData DefaultInstanceForType { + get { return global::bnet.protocol.NoData.DefaultInstance; } + } + + public override NoData BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is NoData) { + return MergeFrom((NoData) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(NoData other) { + if (other == global::bnet.protocol.NoData.DefaultInstance) return this; + PrepareBuilder(); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_noDataFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _noDataFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + } + static NoData() { + object.ReferenceEquals(global::bnet.protocol.Rpc.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ErrorInfo : pb::GeneratedMessage { + private ErrorInfo() { } + private static readonly ErrorInfo defaultInstance = new ErrorInfo().MakeReadOnly(); + private static readonly string[] _errorInfoFieldNames = new string[] { "method_id", "object_address", "service_hash", "status" }; + private static readonly uint[] _errorInfoFieldTags = new uint[] { 32, 10, 24, 16 }; + public static ErrorInfo DefaultInstance { + get { return defaultInstance; } + } + + public override ErrorInfo DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ErrorInfo ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.Rpc.internal__static_bnet_protocol_ErrorInfo__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.Rpc.internal__static_bnet_protocol_ErrorInfo__FieldAccessorTable; } + } + + public const int ObjectAddressFieldNumber = 1; + private bool hasObjectAddress; + private global::bnet.protocol.ObjectAddress objectAddress_; + public bool HasObjectAddress { + get { return hasObjectAddress; } + } + public global::bnet.protocol.ObjectAddress ObjectAddress { + get { return objectAddress_ ?? global::bnet.protocol.ObjectAddress.DefaultInstance; } + } + + public const int StatusFieldNumber = 2; + private bool hasStatus; + private uint status_; + public bool HasStatus { + get { return hasStatus; } + } + public uint Status { + get { return status_; } + } + + public const int ServiceHashFieldNumber = 3; + private bool hasServiceHash; + private uint serviceHash_; + public bool HasServiceHash { + get { return hasServiceHash; } + } + public uint ServiceHash { + get { return serviceHash_; } + } + + public const int MethodIdFieldNumber = 4; + private bool hasMethodId; + private uint methodId_; + public bool HasMethodId { + get { return hasMethodId; } + } + public uint MethodId { + get { return methodId_; } + } + + public override bool IsInitialized { + get { + if (!hasObjectAddress) return false; + if (!hasStatus) return false; + if (!hasServiceHash) return false; + if (!hasMethodId) return false; + if (!ObjectAddress.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _errorInfoFieldNames; + if (hasObjectAddress) { + output.WriteMessage(1, field_names[1], ObjectAddress); + } + if (hasStatus) { + output.WriteUInt32(2, field_names[3], Status); + } + if (hasServiceHash) { + output.WriteUInt32(3, field_names[2], ServiceHash); + } + if (hasMethodId) { + output.WriteUInt32(4, field_names[0], MethodId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasObjectAddress) { + size += pb::CodedOutputStream.ComputeMessageSize(1, ObjectAddress); + } + if (hasStatus) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, Status); + } + if (hasServiceHash) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, ServiceHash); + } + if (hasMethodId) { + size += pb::CodedOutputStream.ComputeUInt32Size(4, MethodId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ErrorInfo ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ErrorInfo ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ErrorInfo ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ErrorInfo ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ErrorInfo ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ErrorInfo ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ErrorInfo ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ErrorInfo ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ErrorInfo ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ErrorInfo ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ErrorInfo MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ErrorInfo prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ErrorInfo cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ErrorInfo result; + + private ErrorInfo PrepareBuilder() { + if (resultIsReadOnly) { + ErrorInfo original = result; + result = new ErrorInfo(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ErrorInfo MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.ErrorInfo.Descriptor; } + } + + public override ErrorInfo DefaultInstanceForType { + get { return global::bnet.protocol.ErrorInfo.DefaultInstance; } + } + + public override ErrorInfo BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ErrorInfo) { + return MergeFrom((ErrorInfo) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ErrorInfo other) { + if (other == global::bnet.protocol.ErrorInfo.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasObjectAddress) { + MergeObjectAddress(other.ObjectAddress); + } + if (other.HasStatus) { + Status = other.Status; + } + if (other.HasServiceHash) { + ServiceHash = other.ServiceHash; + } + if (other.HasMethodId) { + MethodId = other.MethodId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_errorInfoFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _errorInfoFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.ObjectAddress.Builder subBuilder = global::bnet.protocol.ObjectAddress.CreateBuilder(); + if (result.hasObjectAddress) { + subBuilder.MergeFrom(ObjectAddress); + } + input.ReadMessage(subBuilder, extensionRegistry); + ObjectAddress = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasStatus = input.ReadUInt32(ref result.status_); + break; + } + case 24: { + result.hasServiceHash = input.ReadUInt32(ref result.serviceHash_); + break; + } + case 32: { + result.hasMethodId = input.ReadUInt32(ref result.methodId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasObjectAddress { + get { return result.hasObjectAddress; } + } + public global::bnet.protocol.ObjectAddress ObjectAddress { + get { return result.ObjectAddress; } + set { SetObjectAddress(value); } + } + public Builder SetObjectAddress(global::bnet.protocol.ObjectAddress value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasObjectAddress = true; + result.objectAddress_ = value; + return this; + } + public Builder SetObjectAddress(global::bnet.protocol.ObjectAddress.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasObjectAddress = true; + result.objectAddress_ = builderForValue.Build(); + return this; + } + public Builder MergeObjectAddress(global::bnet.protocol.ObjectAddress value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasObjectAddress && + result.objectAddress_ != global::bnet.protocol.ObjectAddress.DefaultInstance) { + result.objectAddress_ = global::bnet.protocol.ObjectAddress.CreateBuilder(result.objectAddress_).MergeFrom(value).BuildPartial(); + } else { + result.objectAddress_ = value; + } + result.hasObjectAddress = true; + return this; + } + public Builder ClearObjectAddress() { + PrepareBuilder(); + result.hasObjectAddress = false; + result.objectAddress_ = null; + return this; + } + + public bool HasStatus { + get { return result.hasStatus; } + } + public uint Status { + get { return result.Status; } + set { SetStatus(value); } + } + public Builder SetStatus(uint value) { + PrepareBuilder(); + result.hasStatus = true; + result.status_ = value; + return this; + } + public Builder ClearStatus() { + PrepareBuilder(); + result.hasStatus = false; + result.status_ = 0; + return this; + } + + public bool HasServiceHash { + get { return result.hasServiceHash; } + } + public uint ServiceHash { + get { return result.ServiceHash; } + set { SetServiceHash(value); } + } + public Builder SetServiceHash(uint value) { + PrepareBuilder(); + result.hasServiceHash = true; + result.serviceHash_ = value; + return this; + } + public Builder ClearServiceHash() { + PrepareBuilder(); + result.hasServiceHash = false; + result.serviceHash_ = 0; + return this; + } + + public bool HasMethodId { + get { return result.hasMethodId; } + } + public uint MethodId { + get { return result.MethodId; } + set { SetMethodId(value); } + } + public Builder SetMethodId(uint value) { + PrepareBuilder(); + result.hasMethodId = true; + result.methodId_ = value; + return this; + } + public Builder ClearMethodId() { + PrepareBuilder(); + result.hasMethodId = false; + result.methodId_ = 0; + return this; + } + } + static ErrorInfo() { + object.ReferenceEquals(global::bnet.protocol.Rpc.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Header : pb::GeneratedMessage { + private Header() { } + private static readonly Header defaultInstance = new Header().MakeReadOnly(); + private static readonly string[] _headerFieldNames = new string[] { "error", "method_id", "object_id", "service_id", "size", "status", "token" }; + private static readonly uint[] _headerFieldTags = new uint[] { 58, 16, 32, 8, 40, 48, 24 }; + public static Header DefaultInstance { + get { return defaultInstance; } + } + + public override Header DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Header ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.Rpc.internal__static_bnet_protocol_Header__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.Rpc.internal__static_bnet_protocol_Header__FieldAccessorTable; } + } + + public const int ServiceIdFieldNumber = 1; + private bool hasServiceId; + private uint serviceId_; + public bool HasServiceId { + get { return hasServiceId; } + } + public uint ServiceId { + get { return serviceId_; } + } + + public const int MethodIdFieldNumber = 2; + private bool hasMethodId; + private uint methodId_; + public bool HasMethodId { + get { return hasMethodId; } + } + public uint MethodId { + get { return methodId_; } + } + + public const int TokenFieldNumber = 3; + private bool hasToken; + private uint token_; + public bool HasToken { + get { return hasToken; } + } + public uint Token { + get { return token_; } + } + + public const int ObjectIdFieldNumber = 4; + private bool hasObjectId; + private ulong objectId_; + public bool HasObjectId { + get { return hasObjectId; } + } + public ulong ObjectId { + get { return objectId_; } + } + + public const int SizeFieldNumber = 5; + private bool hasSize; + private uint size_; + public bool HasSize { + get { return hasSize; } + } + public uint Size { + get { return size_; } + } + + public const int StatusFieldNumber = 6; + private bool hasStatus; + private uint status_; + public bool HasStatus { + get { return hasStatus; } + } + public uint Status { + get { return status_; } + } + + public const int ErrorFieldNumber = 7; + private pbc::PopsicleList error_ = new pbc::PopsicleList(); + public scg::IList ErrorList { + get { return error_; } + } + public int ErrorCount { + get { return error_.Count; } + } + public global::bnet.protocol.ErrorInfo GetError(int index) { + return error_[index]; + } + + public override bool IsInitialized { + get { + if (!hasServiceId) return false; + if (!hasToken) return false; + foreach (global::bnet.protocol.ErrorInfo element in ErrorList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _headerFieldNames; + if (hasServiceId) { + output.WriteUInt32(1, field_names[3], ServiceId); + } + if (hasMethodId) { + output.WriteUInt32(2, field_names[1], MethodId); + } + if (hasToken) { + output.WriteUInt32(3, field_names[6], Token); + } + if (hasObjectId) { + output.WriteUInt64(4, field_names[2], ObjectId); + } + if (hasSize) { + output.WriteUInt32(5, field_names[4], Size); + } + if (hasStatus) { + output.WriteUInt32(6, field_names[5], Status); + } + if (error_.Count > 0) { + output.WriteMessageArray(7, field_names[0], error_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasServiceId) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, ServiceId); + } + if (hasMethodId) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, MethodId); + } + if (hasToken) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, Token); + } + if (hasObjectId) { + size += pb::CodedOutputStream.ComputeUInt64Size(4, ObjectId); + } + if (hasSize) { + size += pb::CodedOutputStream.ComputeUInt32Size(5, Size); + } + if (hasStatus) { + size += pb::CodedOutputStream.ComputeUInt32Size(6, Status); + } + foreach (global::bnet.protocol.ErrorInfo element in ErrorList) { + size += pb::CodedOutputStream.ComputeMessageSize(7, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static Header ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Header ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Header ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Header ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Header ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Header ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Header ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Header ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Header ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Header ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Header MakeReadOnly() { + error_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Header prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Header cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Header result; + + private Header PrepareBuilder() { + if (resultIsReadOnly) { + Header original = result; + result = new Header(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Header MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.Header.Descriptor; } + } + + public override Header DefaultInstanceForType { + get { return global::bnet.protocol.Header.DefaultInstance; } + } + + public override Header BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Header) { + return MergeFrom((Header) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Header other) { + if (other == global::bnet.protocol.Header.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasServiceId) { + ServiceId = other.ServiceId; + } + if (other.HasMethodId) { + MethodId = other.MethodId; + } + if (other.HasToken) { + Token = other.Token; + } + if (other.HasObjectId) { + ObjectId = other.ObjectId; + } + if (other.HasSize) { + Size = other.Size; + } + if (other.HasStatus) { + Status = other.Status; + } + if (other.error_.Count != 0) { + result.error_.Add(other.error_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_headerFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _headerFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasServiceId = input.ReadUInt32(ref result.serviceId_); + break; + } + case 16: { + result.hasMethodId = input.ReadUInt32(ref result.methodId_); + break; + } + case 24: { + result.hasToken = input.ReadUInt32(ref result.token_); + break; + } + case 32: { + result.hasObjectId = input.ReadUInt64(ref result.objectId_); + break; + } + case 40: { + result.hasSize = input.ReadUInt32(ref result.size_); + break; + } + case 48: { + result.hasStatus = input.ReadUInt32(ref result.status_); + break; + } + case 58: { + input.ReadMessageArray(tag, field_name, result.error_, global::bnet.protocol.ErrorInfo.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasServiceId { + get { return result.hasServiceId; } + } + public uint ServiceId { + get { return result.ServiceId; } + set { SetServiceId(value); } + } + public Builder SetServiceId(uint value) { + PrepareBuilder(); + result.hasServiceId = true; + result.serviceId_ = value; + return this; + } + public Builder ClearServiceId() { + PrepareBuilder(); + result.hasServiceId = false; + result.serviceId_ = 0; + return this; + } + + public bool HasMethodId { + get { return result.hasMethodId; } + } + public uint MethodId { + get { return result.MethodId; } + set { SetMethodId(value); } + } + public Builder SetMethodId(uint value) { + PrepareBuilder(); + result.hasMethodId = true; + result.methodId_ = value; + return this; + } + public Builder ClearMethodId() { + PrepareBuilder(); + result.hasMethodId = false; + result.methodId_ = 0; + return this; + } + + public bool HasToken { + get { return result.hasToken; } + } + public uint Token { + get { return result.Token; } + set { SetToken(value); } + } + public Builder SetToken(uint value) { + PrepareBuilder(); + result.hasToken = true; + result.token_ = value; + return this; + } + public Builder ClearToken() { + PrepareBuilder(); + result.hasToken = false; + result.token_ = 0; + return this; + } + + public bool HasObjectId { + get { return result.hasObjectId; } + } + public ulong ObjectId { + get { return result.ObjectId; } + set { SetObjectId(value); } + } + public Builder SetObjectId(ulong value) { + PrepareBuilder(); + result.hasObjectId = true; + result.objectId_ = value; + return this; + } + public Builder ClearObjectId() { + PrepareBuilder(); + result.hasObjectId = false; + result.objectId_ = 0UL; + return this; + } + + public bool HasSize { + get { return result.hasSize; } + } + public uint Size { + get { return result.Size; } + set { SetSize(value); } + } + public Builder SetSize(uint value) { + PrepareBuilder(); + result.hasSize = true; + result.size_ = value; + return this; + } + public Builder ClearSize() { + PrepareBuilder(); + result.hasSize = false; + result.size_ = 0; + return this; + } + + public bool HasStatus { + get { return result.hasStatus; } + } + public uint Status { + get { return result.Status; } + set { SetStatus(value); } + } + public Builder SetStatus(uint value) { + PrepareBuilder(); + result.hasStatus = true; + result.status_ = value; + return this; + } + public Builder ClearStatus() { + PrepareBuilder(); + result.hasStatus = false; + result.status_ = 0; + return this; + } + + public pbc::IPopsicleList ErrorList { + get { return PrepareBuilder().error_; } + } + public int ErrorCount { + get { return result.ErrorCount; } + } + public global::bnet.protocol.ErrorInfo GetError(int index) { + return result.GetError(index); + } + public Builder SetError(int index, global::bnet.protocol.ErrorInfo value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.error_[index] = value; + return this; + } + public Builder SetError(int index, global::bnet.protocol.ErrorInfo.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.error_[index] = builderForValue.Build(); + return this; + } + public Builder AddError(global::bnet.protocol.ErrorInfo value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.error_.Add(value); + return this; + } + public Builder AddError(global::bnet.protocol.ErrorInfo.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.error_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeError(scg::IEnumerable values) { + PrepareBuilder(); + result.error_.Add(values); + return this; + } + public Builder ClearError() { + PrepareBuilder(); + result.error_.Clear(); + return this; + } + } + static Header() { + object.ReferenceEquals(global::bnet.protocol.Rpc.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/LibMooNet/bnet/protocol/account/AccountTypes.cs b/src/LibMooNet/bnet/protocol/account/AccountTypes.cs new file mode 100644 index 00000000..997643f0 --- /dev/null +++ b/src/LibMooNet/bnet/protocol/account/AccountTypes.cs @@ -0,0 +1,6189 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace bnet.protocol.account { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class AccountTypes { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_bnet_protocol_account_AccountId__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_account_AccountId__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_account_AccountLicense__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_account_AccountLicense__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_account_AccountCredential__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_account_AccountCredential__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_account_AccountBlob__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_account_AccountBlob__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_account_AccountBlobList__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_account_AccountBlobList__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_account_GameAccountHandle__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_account_GameAccountHandle__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_account_GameAccountLink__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_account_GameAccountLink__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_account_GameAccountBlob__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_account_GameAccountBlob__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_account_GameAccountBlobList__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_account_GameAccountBlobList__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_account_AccountReference__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_account_AccountReference__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_account_Wallet__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_account_Wallet__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_account_Wallets__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_account_Wallets__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_account_CurrencyRestriction__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_account_CurrencyRestriction__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static AccountTypes() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "ChhibmV0L2FjY291bnRfdHlwZXMucHJvdG8SFWJuZXQucHJvdG9jb2wuYWNj" + + "b3VudCIXCglBY2NvdW50SWQSCgoCaWQYASACKAciLQoOQWNjb3VudExpY2Vu" + + "c2USCgoCaWQYASACKA0SDwoHZXhwaXJlcxgCIAEoBCItChFBY2NvdW50Q3Jl" + + "ZGVudGlhbBIKCgJpZBgBIAIoDRIMCgRkYXRhGAIgASgMIs0DCgtBY2NvdW50" + + "QmxvYhIKCgJpZBgCIAIoBxIOCgZyZWdpb24YAyACKA0SDQoFZW1haWwYBCAD" + + "KAkSDQoFZmxhZ3MYBSACKAQSFgoOc2VjdXJlX3JlbGVhc2UYBiABKAQSFwoP" + + "d2hpdGVsaXN0X3N0YXJ0GAcgASgEEhUKDXdoaXRlbGlzdF9lbmQYCCABKAQS" + + "EQoJZnVsbF9uYW1lGAogAigJEjcKCGxpY2Vuc2VzGBQgAygLMiUuYm5ldC5w" + + "cm90b2NvbC5hY2NvdW50LkFjY291bnRMaWNlbnNlEj0KC2NyZWRlbnRpYWxz" + + "GBUgAygLMiguYm5ldC5wcm90b2NvbC5hY2NvdW50LkFjY291bnRDcmVkZW50" + + "aWFsEj0KDWFjY291bnRfbGlua3MYFiADKAsyJi5ibmV0LnByb3RvY29sLmFj" + + "Y291bnQuR2FtZUFjY291bnRMaW5rEhIKCmJhdHRsZV90YWcYFyABKAkSGAoQ" + + "ZGVmYXVsdF9jdXJyZW5jeRgZIAEoBxIUCgxsZWdhbF9yZWdpb24YGiABKA0S" + + "FAoMbGVnYWxfbG9jYWxlGBsgASgHEhgKEGNhY2hlX2V4cGlyYXRpb24YHiAC" + + "KAQiQwoPQWNjb3VudEJsb2JMaXN0EjAKBGJsb2IYASADKAsyIi5ibmV0LnBy" + + "b3RvY29sLmFjY291bnQuQWNjb3VudEJsb2IiQAoRR2FtZUFjY291bnRIYW5k" + + "bGUSCgoCaWQYASACKAcSDwoHcHJvZ3JhbRgCIAIoBxIOCgZyZWdpb24YAyAC" + + "KA0iXwoPR2FtZUFjY291bnRMaW5rEj4KDGdhbWVfYWNjb3VudBgBIAIoCzIo" + + "LmJuZXQucHJvdG9jb2wuYWNjb3VudC5HYW1lQWNjb3VudEhhbmRsZRIMCgRu" + + "YW1lGAIgAigJIsgCCg9HYW1lQWNjb3VudEJsb2ISPgoMZ2FtZV9hY2NvdW50" + + "GAEgAigLMiguYm5ldC5wcm90b2NvbC5hY2NvdW50LkdhbWVBY2NvdW50SGFu" + + "ZGxlEg4KBG5hbWUYAiABKAk6ABIcChFyZWFsbV9wZXJtaXNzaW9ucxgDIAEo" + + "DToBMBIOCgZzdGF0dXMYBCACKA0SEAoFZmxhZ3MYBSABKAQ6ATASGAoNYmls" + + "bGluZ19mbGFncxgGIAEoDToBMBIYChBjYWNoZV9leHBpcmF0aW9uGAcgAigE" + + "Eh8KF3N1YnNjcmlwdGlvbl9leHBpcmF0aW9uGAogASgEEhcKD3VuaXRzX3Jl" + + "bWFpbmluZxgLIAEoDRI3CghsaWNlbnNlcxgUIAMoCzIlLmJuZXQucHJvdG9j" + + "b2wuYWNjb3VudC5BY2NvdW50TGljZW5zZSJLChNHYW1lQWNjb3VudEJsb2JM" + + "aXN0EjQKBGJsb2IYASADKAsyJi5ibmV0LnByb3RvY29sLmFjY291bnQuR2Ft" + + "ZUFjY291bnRCbG9iIo4BChBBY2NvdW50UmVmZXJlbmNlEgoKAmlkGAEgASgH" + + "Eg0KBWVtYWlsGAIgASgJEjgKBmhhbmRsZRgDIAEoCzIoLmJuZXQucHJvdG9j" + + "b2wuYWNjb3VudC5HYW1lQWNjb3VudEhhbmRsZRISCgpiYXR0bGVfdGFnGAQg" + + "ASgJEhEKBnJlZ2lvbhgKIAEoDToBMCKcAgoGV2FsbGV0Eg4KBnJlZ2lvbhgB" + + "IAIoDRIRCgl3YWxsZXRfaWQYAiACKAQSEwoLd2FsbGV0X3R5cGUYAyACKA0S" + + "EwoLZGVzY3JpcHRpb24YBCABKAkSEgoKY291bnRyeV9pZBgFIAIoDRINCgVz" + + "dGF0ZRgGIAEoCRIMCgRjaXR5GAcgASgJEhMKC3Bvc3RhbF9jb2RlGAggASgJ" + + "EhQKDHBheW1lbnRfaW5mbxgJIAEoDBILCgNiaW4YCiABKAkSEQoJbG9jYWxl" + + "X2lkGAsgASgJEg4KBnN0cmVldBgMIAEoCRISCgpmaXJzdF9uYW1lGA0gASgJ" + + "EhEKCWxhc3RfbmFtZRgOIAEoCRISCgpiaXJ0aF9kYXRlGA8gASgEIjkKB1dh" + + "bGxldHMSLgoHd2FsbGV0cxgBIAMoCzIdLmJuZXQucHJvdG9jb2wuYWNjb3Vu" + + "dC5XYWxsZXQiVAoTQ3VycmVuY3lSZXN0cmljdGlvbhIQCghjdXJyZW5jeRgB" + + "IAIoCRIZChFhdXRoZW50aWNhdG9yX2NhcBgCIAIoCRIQCghzb2Z0X2NhcBgD" + + "IAIoCQ=="); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_bnet_protocol_account_AccountId__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_account_AccountId__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_account_AccountId__Descriptor, + new string[] { "Id", }); + internal__static_bnet_protocol_account_AccountLicense__Descriptor = Descriptor.MessageTypes[1]; + internal__static_bnet_protocol_account_AccountLicense__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_account_AccountLicense__Descriptor, + new string[] { "Id", "Expires", }); + internal__static_bnet_protocol_account_AccountCredential__Descriptor = Descriptor.MessageTypes[2]; + internal__static_bnet_protocol_account_AccountCredential__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_account_AccountCredential__Descriptor, + new string[] { "Id", "Data", }); + internal__static_bnet_protocol_account_AccountBlob__Descriptor = Descriptor.MessageTypes[3]; + internal__static_bnet_protocol_account_AccountBlob__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_account_AccountBlob__Descriptor, + new string[] { "Id", "Region", "Email", "Flags", "SecureRelease", "WhitelistStart", "WhitelistEnd", "FullName", "Licenses", "Credentials", "AccountLinks", "BattleTag", "DefaultCurrency", "LegalRegion", "LegalLocale", "CacheExpiration", }); + internal__static_bnet_protocol_account_AccountBlobList__Descriptor = Descriptor.MessageTypes[4]; + internal__static_bnet_protocol_account_AccountBlobList__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_account_AccountBlobList__Descriptor, + new string[] { "Blob", }); + internal__static_bnet_protocol_account_GameAccountHandle__Descriptor = Descriptor.MessageTypes[5]; + internal__static_bnet_protocol_account_GameAccountHandle__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_account_GameAccountHandle__Descriptor, + new string[] { "Id", "Program", "Region", }); + internal__static_bnet_protocol_account_GameAccountLink__Descriptor = Descriptor.MessageTypes[6]; + internal__static_bnet_protocol_account_GameAccountLink__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_account_GameAccountLink__Descriptor, + new string[] { "GameAccount", "Name", }); + internal__static_bnet_protocol_account_GameAccountBlob__Descriptor = Descriptor.MessageTypes[7]; + internal__static_bnet_protocol_account_GameAccountBlob__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_account_GameAccountBlob__Descriptor, + new string[] { "GameAccount", "Name", "RealmPermissions", "Status", "Flags", "BillingFlags", "CacheExpiration", "SubscriptionExpiration", "UnitsRemaining", "Licenses", }); + internal__static_bnet_protocol_account_GameAccountBlobList__Descriptor = Descriptor.MessageTypes[8]; + internal__static_bnet_protocol_account_GameAccountBlobList__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_account_GameAccountBlobList__Descriptor, + new string[] { "Blob", }); + internal__static_bnet_protocol_account_AccountReference__Descriptor = Descriptor.MessageTypes[9]; + internal__static_bnet_protocol_account_AccountReference__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_account_AccountReference__Descriptor, + new string[] { "Id", "Email", "Handle", "BattleTag", "Region", }); + internal__static_bnet_protocol_account_Wallet__Descriptor = Descriptor.MessageTypes[10]; + internal__static_bnet_protocol_account_Wallet__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_account_Wallet__Descriptor, + new string[] { "Region", "WalletId", "WalletType", "Description", "CountryId", "State", "City", "PostalCode", "PaymentInfo", "Bin", "LocaleId", "Street", "FirstName", "LastName", "BirthDate", }); + internal__static_bnet_protocol_account_Wallets__Descriptor = Descriptor.MessageTypes[11]; + internal__static_bnet_protocol_account_Wallets__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_account_Wallets__Descriptor, + new string[] { "Wallets_", }); + internal__static_bnet_protocol_account_CurrencyRestriction__Descriptor = Descriptor.MessageTypes[12]; + internal__static_bnet_protocol_account_CurrencyRestriction__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_account_CurrencyRestriction__Descriptor, + new string[] { "Currency", "AuthenticatorCap", "SoftCap", }); + return null; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + }, assigner); + } + #endregion + + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class AccountId : pb::GeneratedMessage { + private AccountId() { } + private static readonly AccountId defaultInstance = new AccountId().MakeReadOnly(); + private static readonly string[] _accountIdFieldNames = new string[] { "id" }; + private static readonly uint[] _accountIdFieldTags = new uint[] { 13 }; + public static AccountId DefaultInstance { + get { return defaultInstance; } + } + + public override AccountId DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override AccountId ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.account.AccountTypes.internal__static_bnet_protocol_account_AccountId__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.account.AccountTypes.internal__static_bnet_protocol_account_AccountId__FieldAccessorTable; } + } + + public const int IdFieldNumber = 1; + private bool hasId; + private uint id_; + public bool HasId { + get { return hasId; } + } + public uint Id { + get { return id_; } + } + + public override bool IsInitialized { + get { + if (!hasId) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _accountIdFieldNames; + if (hasId) { + output.WriteFixed32(1, field_names[0], Id); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasId) { + size += pb::CodedOutputStream.ComputeFixed32Size(1, Id); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static AccountId ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AccountId ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AccountId ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AccountId ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AccountId ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AccountId ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static AccountId ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static AccountId ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static AccountId ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AccountId ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private AccountId MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(AccountId prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(AccountId cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private AccountId result; + + private AccountId PrepareBuilder() { + if (resultIsReadOnly) { + AccountId original = result; + result = new AccountId(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override AccountId MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.account.AccountId.Descriptor; } + } + + public override AccountId DefaultInstanceForType { + get { return global::bnet.protocol.account.AccountId.DefaultInstance; } + } + + public override AccountId BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is AccountId) { + return MergeFrom((AccountId) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(AccountId other) { + if (other == global::bnet.protocol.account.AccountId.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasId) { + Id = other.Id; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_accountIdFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _accountIdFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 13: { + result.hasId = input.ReadFixed32(ref result.id_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasId { + get { return result.hasId; } + } + public uint Id { + get { return result.Id; } + set { SetId(value); } + } + public Builder SetId(uint value) { + PrepareBuilder(); + result.hasId = true; + result.id_ = value; + return this; + } + public Builder ClearId() { + PrepareBuilder(); + result.hasId = false; + result.id_ = 0; + return this; + } + } + static AccountId() { + object.ReferenceEquals(global::bnet.protocol.account.AccountTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class AccountLicense : pb::GeneratedMessage { + private AccountLicense() { } + private static readonly AccountLicense defaultInstance = new AccountLicense().MakeReadOnly(); + private static readonly string[] _accountLicenseFieldNames = new string[] { "expires", "id" }; + private static readonly uint[] _accountLicenseFieldTags = new uint[] { 16, 8 }; + public static AccountLicense DefaultInstance { + get { return defaultInstance; } + } + + public override AccountLicense DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override AccountLicense ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.account.AccountTypes.internal__static_bnet_protocol_account_AccountLicense__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.account.AccountTypes.internal__static_bnet_protocol_account_AccountLicense__FieldAccessorTable; } + } + + public const int IdFieldNumber = 1; + private bool hasId; + private uint id_; + public bool HasId { + get { return hasId; } + } + public uint Id { + get { return id_; } + } + + public const int ExpiresFieldNumber = 2; + private bool hasExpires; + private ulong expires_; + public bool HasExpires { + get { return hasExpires; } + } + public ulong Expires { + get { return expires_; } + } + + public override bool IsInitialized { + get { + if (!hasId) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _accountLicenseFieldNames; + if (hasId) { + output.WriteUInt32(1, field_names[1], Id); + } + if (hasExpires) { + output.WriteUInt64(2, field_names[0], Expires); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasId) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, Id); + } + if (hasExpires) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, Expires); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static AccountLicense ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AccountLicense ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AccountLicense ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AccountLicense ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AccountLicense ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AccountLicense ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static AccountLicense ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static AccountLicense ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static AccountLicense ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AccountLicense ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private AccountLicense MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(AccountLicense prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(AccountLicense cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private AccountLicense result; + + private AccountLicense PrepareBuilder() { + if (resultIsReadOnly) { + AccountLicense original = result; + result = new AccountLicense(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override AccountLicense MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.account.AccountLicense.Descriptor; } + } + + public override AccountLicense DefaultInstanceForType { + get { return global::bnet.protocol.account.AccountLicense.DefaultInstance; } + } + + public override AccountLicense BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is AccountLicense) { + return MergeFrom((AccountLicense) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(AccountLicense other) { + if (other == global::bnet.protocol.account.AccountLicense.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasId) { + Id = other.Id; + } + if (other.HasExpires) { + Expires = other.Expires; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_accountLicenseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _accountLicenseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasId = input.ReadUInt32(ref result.id_); + break; + } + case 16: { + result.hasExpires = input.ReadUInt64(ref result.expires_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasId { + get { return result.hasId; } + } + public uint Id { + get { return result.Id; } + set { SetId(value); } + } + public Builder SetId(uint value) { + PrepareBuilder(); + result.hasId = true; + result.id_ = value; + return this; + } + public Builder ClearId() { + PrepareBuilder(); + result.hasId = false; + result.id_ = 0; + return this; + } + + public bool HasExpires { + get { return result.hasExpires; } + } + public ulong Expires { + get { return result.Expires; } + set { SetExpires(value); } + } + public Builder SetExpires(ulong value) { + PrepareBuilder(); + result.hasExpires = true; + result.expires_ = value; + return this; + } + public Builder ClearExpires() { + PrepareBuilder(); + result.hasExpires = false; + result.expires_ = 0UL; + return this; + } + } + static AccountLicense() { + object.ReferenceEquals(global::bnet.protocol.account.AccountTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class AccountCredential : pb::GeneratedMessage { + private AccountCredential() { } + private static readonly AccountCredential defaultInstance = new AccountCredential().MakeReadOnly(); + private static readonly string[] _accountCredentialFieldNames = new string[] { "data", "id" }; + private static readonly uint[] _accountCredentialFieldTags = new uint[] { 18, 8 }; + public static AccountCredential DefaultInstance { + get { return defaultInstance; } + } + + public override AccountCredential DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override AccountCredential ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.account.AccountTypes.internal__static_bnet_protocol_account_AccountCredential__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.account.AccountTypes.internal__static_bnet_protocol_account_AccountCredential__FieldAccessorTable; } + } + + public const int IdFieldNumber = 1; + private bool hasId; + private uint id_; + public bool HasId { + get { return hasId; } + } + public uint Id { + get { return id_; } + } + + public const int DataFieldNumber = 2; + private bool hasData; + private pb::ByteString data_ = pb::ByteString.Empty; + public bool HasData { + get { return hasData; } + } + public pb::ByteString Data { + get { return data_; } + } + + public override bool IsInitialized { + get { + if (!hasId) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _accountCredentialFieldNames; + if (hasId) { + output.WriteUInt32(1, field_names[1], Id); + } + if (hasData) { + output.WriteBytes(2, field_names[0], Data); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasId) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, Id); + } + if (hasData) { + size += pb::CodedOutputStream.ComputeBytesSize(2, Data); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static AccountCredential ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AccountCredential ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AccountCredential ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AccountCredential ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AccountCredential ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AccountCredential ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static AccountCredential ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static AccountCredential ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static AccountCredential ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AccountCredential ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private AccountCredential MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(AccountCredential prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(AccountCredential cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private AccountCredential result; + + private AccountCredential PrepareBuilder() { + if (resultIsReadOnly) { + AccountCredential original = result; + result = new AccountCredential(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override AccountCredential MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.account.AccountCredential.Descriptor; } + } + + public override AccountCredential DefaultInstanceForType { + get { return global::bnet.protocol.account.AccountCredential.DefaultInstance; } + } + + public override AccountCredential BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is AccountCredential) { + return MergeFrom((AccountCredential) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(AccountCredential other) { + if (other == global::bnet.protocol.account.AccountCredential.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasId) { + Id = other.Id; + } + if (other.HasData) { + Data = other.Data; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_accountCredentialFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _accountCredentialFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasId = input.ReadUInt32(ref result.id_); + break; + } + case 18: { + result.hasData = input.ReadBytes(ref result.data_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasId { + get { return result.hasId; } + } + public uint Id { + get { return result.Id; } + set { SetId(value); } + } + public Builder SetId(uint value) { + PrepareBuilder(); + result.hasId = true; + result.id_ = value; + return this; + } + public Builder ClearId() { + PrepareBuilder(); + result.hasId = false; + result.id_ = 0; + return this; + } + + public bool HasData { + get { return result.hasData; } + } + public pb::ByteString Data { + get { return result.Data; } + set { SetData(value); } + } + public Builder SetData(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasData = true; + result.data_ = value; + return this; + } + public Builder ClearData() { + PrepareBuilder(); + result.hasData = false; + result.data_ = pb::ByteString.Empty; + return this; + } + } + static AccountCredential() { + object.ReferenceEquals(global::bnet.protocol.account.AccountTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class AccountBlob : pb::GeneratedMessage { + private AccountBlob() { } + private static readonly AccountBlob defaultInstance = new AccountBlob().MakeReadOnly(); + private static readonly string[] _accountBlobFieldNames = new string[] { "account_links", "battle_tag", "cache_expiration", "credentials", "default_currency", "email", "flags", "full_name", "id", "legal_locale", "legal_region", "licenses", "region", "secure_release", "whitelist_end", "whitelist_start" }; + private static readonly uint[] _accountBlobFieldTags = new uint[] { 178, 186, 240, 170, 205, 34, 40, 82, 21, 221, 208, 162, 24, 48, 64, 56 }; + public static AccountBlob DefaultInstance { + get { return defaultInstance; } + } + + public override AccountBlob DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override AccountBlob ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.account.AccountTypes.internal__static_bnet_protocol_account_AccountBlob__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.account.AccountTypes.internal__static_bnet_protocol_account_AccountBlob__FieldAccessorTable; } + } + + public const int IdFieldNumber = 2; + private bool hasId; + private uint id_; + public bool HasId { + get { return hasId; } + } + public uint Id { + get { return id_; } + } + + public const int RegionFieldNumber = 3; + private bool hasRegion; + private uint region_; + public bool HasRegion { + get { return hasRegion; } + } + public uint Region { + get { return region_; } + } + + public const int EmailFieldNumber = 4; + private pbc::PopsicleList email_ = new pbc::PopsicleList(); + public scg::IList EmailList { + get { return pbc::Lists.AsReadOnly(email_); } + } + public int EmailCount { + get { return email_.Count; } + } + public string GetEmail(int index) { + return email_[index]; + } + + public const int FlagsFieldNumber = 5; + private bool hasFlags; + private ulong flags_; + public bool HasFlags { + get { return hasFlags; } + } + public ulong Flags { + get { return flags_; } + } + + public const int SecureReleaseFieldNumber = 6; + private bool hasSecureRelease; + private ulong secureRelease_; + public bool HasSecureRelease { + get { return hasSecureRelease; } + } + public ulong SecureRelease { + get { return secureRelease_; } + } + + public const int WhitelistStartFieldNumber = 7; + private bool hasWhitelistStart; + private ulong whitelistStart_; + public bool HasWhitelistStart { + get { return hasWhitelistStart; } + } + public ulong WhitelistStart { + get { return whitelistStart_; } + } + + public const int WhitelistEndFieldNumber = 8; + private bool hasWhitelistEnd; + private ulong whitelistEnd_; + public bool HasWhitelistEnd { + get { return hasWhitelistEnd; } + } + public ulong WhitelistEnd { + get { return whitelistEnd_; } + } + + public const int FullNameFieldNumber = 10; + private bool hasFullName; + private string fullName_ = ""; + public bool HasFullName { + get { return hasFullName; } + } + public string FullName { + get { return fullName_; } + } + + public const int LicensesFieldNumber = 20; + private pbc::PopsicleList licenses_ = new pbc::PopsicleList(); + public scg::IList LicensesList { + get { return licenses_; } + } + public int LicensesCount { + get { return licenses_.Count; } + } + public global::bnet.protocol.account.AccountLicense GetLicenses(int index) { + return licenses_[index]; + } + + public const int CredentialsFieldNumber = 21; + private pbc::PopsicleList credentials_ = new pbc::PopsicleList(); + public scg::IList CredentialsList { + get { return credentials_; } + } + public int CredentialsCount { + get { return credentials_.Count; } + } + public global::bnet.protocol.account.AccountCredential GetCredentials(int index) { + return credentials_[index]; + } + + public const int AccountLinksFieldNumber = 22; + private pbc::PopsicleList accountLinks_ = new pbc::PopsicleList(); + public scg::IList AccountLinksList { + get { return accountLinks_; } + } + public int AccountLinksCount { + get { return accountLinks_.Count; } + } + public global::bnet.protocol.account.GameAccountLink GetAccountLinks(int index) { + return accountLinks_[index]; + } + + public const int BattleTagFieldNumber = 23; + private bool hasBattleTag; + private string battleTag_ = ""; + public bool HasBattleTag { + get { return hasBattleTag; } + } + public string BattleTag { + get { return battleTag_; } + } + + public const int DefaultCurrencyFieldNumber = 25; + private bool hasDefaultCurrency; + private uint defaultCurrency_; + public bool HasDefaultCurrency { + get { return hasDefaultCurrency; } + } + public uint DefaultCurrency { + get { return defaultCurrency_; } + } + + public const int LegalRegionFieldNumber = 26; + private bool hasLegalRegion; + private uint legalRegion_; + public bool HasLegalRegion { + get { return hasLegalRegion; } + } + public uint LegalRegion { + get { return legalRegion_; } + } + + public const int LegalLocaleFieldNumber = 27; + private bool hasLegalLocale; + private uint legalLocale_; + public bool HasLegalLocale { + get { return hasLegalLocale; } + } + public uint LegalLocale { + get { return legalLocale_; } + } + + public const int CacheExpirationFieldNumber = 30; + private bool hasCacheExpiration; + private ulong cacheExpiration_; + public bool HasCacheExpiration { + get { return hasCacheExpiration; } + } + public ulong CacheExpiration { + get { return cacheExpiration_; } + } + + public override bool IsInitialized { + get { + if (!hasId) return false; + if (!hasRegion) return false; + if (!hasFlags) return false; + if (!hasFullName) return false; + if (!hasCacheExpiration) return false; + foreach (global::bnet.protocol.account.AccountLicense element in LicensesList) { + if (!element.IsInitialized) return false; + } + foreach (global::bnet.protocol.account.AccountCredential element in CredentialsList) { + if (!element.IsInitialized) return false; + } + foreach (global::bnet.protocol.account.GameAccountLink element in AccountLinksList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _accountBlobFieldNames; + if (hasId) { + output.WriteFixed32(2, field_names[8], Id); + } + if (hasRegion) { + output.WriteUInt32(3, field_names[12], Region); + } + if (email_.Count > 0) { + output.WriteStringArray(4, field_names[5], email_); + } + if (hasFlags) { + output.WriteUInt64(5, field_names[6], Flags); + } + if (hasSecureRelease) { + output.WriteUInt64(6, field_names[13], SecureRelease); + } + if (hasWhitelistStart) { + output.WriteUInt64(7, field_names[15], WhitelistStart); + } + if (hasWhitelistEnd) { + output.WriteUInt64(8, field_names[14], WhitelistEnd); + } + if (hasFullName) { + output.WriteString(10, field_names[7], FullName); + } + if (licenses_.Count > 0) { + output.WriteMessageArray(20, field_names[11], licenses_); + } + if (credentials_.Count > 0) { + output.WriteMessageArray(21, field_names[3], credentials_); + } + if (accountLinks_.Count > 0) { + output.WriteMessageArray(22, field_names[0], accountLinks_); + } + if (hasBattleTag) { + output.WriteString(23, field_names[1], BattleTag); + } + if (hasDefaultCurrency) { + output.WriteFixed32(25, field_names[4], DefaultCurrency); + } + if (hasLegalRegion) { + output.WriteUInt32(26, field_names[10], LegalRegion); + } + if (hasLegalLocale) { + output.WriteFixed32(27, field_names[9], LegalLocale); + } + if (hasCacheExpiration) { + output.WriteUInt64(30, field_names[2], CacheExpiration); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasId) { + size += pb::CodedOutputStream.ComputeFixed32Size(2, Id); + } + if (hasRegion) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, Region); + } + { + int dataSize = 0; + foreach (string element in EmailList) { + dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); + } + size += dataSize; + size += 1 * email_.Count; + } + if (hasFlags) { + size += pb::CodedOutputStream.ComputeUInt64Size(5, Flags); + } + if (hasSecureRelease) { + size += pb::CodedOutputStream.ComputeUInt64Size(6, SecureRelease); + } + if (hasWhitelistStart) { + size += pb::CodedOutputStream.ComputeUInt64Size(7, WhitelistStart); + } + if (hasWhitelistEnd) { + size += pb::CodedOutputStream.ComputeUInt64Size(8, WhitelistEnd); + } + if (hasFullName) { + size += pb::CodedOutputStream.ComputeStringSize(10, FullName); + } + foreach (global::bnet.protocol.account.AccountLicense element in LicensesList) { + size += pb::CodedOutputStream.ComputeMessageSize(20, element); + } + foreach (global::bnet.protocol.account.AccountCredential element in CredentialsList) { + size += pb::CodedOutputStream.ComputeMessageSize(21, element); + } + foreach (global::bnet.protocol.account.GameAccountLink element in AccountLinksList) { + size += pb::CodedOutputStream.ComputeMessageSize(22, element); + } + if (hasBattleTag) { + size += pb::CodedOutputStream.ComputeStringSize(23, BattleTag); + } + if (hasDefaultCurrency) { + size += pb::CodedOutputStream.ComputeFixed32Size(25, DefaultCurrency); + } + if (hasLegalRegion) { + size += pb::CodedOutputStream.ComputeUInt32Size(26, LegalRegion); + } + if (hasLegalLocale) { + size += pb::CodedOutputStream.ComputeFixed32Size(27, LegalLocale); + } + if (hasCacheExpiration) { + size += pb::CodedOutputStream.ComputeUInt64Size(30, CacheExpiration); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static AccountBlob ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AccountBlob ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AccountBlob ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AccountBlob ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AccountBlob ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AccountBlob ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static AccountBlob ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static AccountBlob ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static AccountBlob ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AccountBlob ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private AccountBlob MakeReadOnly() { + email_.MakeReadOnly(); + licenses_.MakeReadOnly(); + credentials_.MakeReadOnly(); + accountLinks_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(AccountBlob prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(AccountBlob cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private AccountBlob result; + + private AccountBlob PrepareBuilder() { + if (resultIsReadOnly) { + AccountBlob original = result; + result = new AccountBlob(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override AccountBlob MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.account.AccountBlob.Descriptor; } + } + + public override AccountBlob DefaultInstanceForType { + get { return global::bnet.protocol.account.AccountBlob.DefaultInstance; } + } + + public override AccountBlob BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is AccountBlob) { + return MergeFrom((AccountBlob) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(AccountBlob other) { + if (other == global::bnet.protocol.account.AccountBlob.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasId) { + Id = other.Id; + } + if (other.HasRegion) { + Region = other.Region; + } + if (other.email_.Count != 0) { + result.email_.Add(other.email_); + } + if (other.HasFlags) { + Flags = other.Flags; + } + if (other.HasSecureRelease) { + SecureRelease = other.SecureRelease; + } + if (other.HasWhitelistStart) { + WhitelistStart = other.WhitelistStart; + } + if (other.HasWhitelistEnd) { + WhitelistEnd = other.WhitelistEnd; + } + if (other.HasFullName) { + FullName = other.FullName; + } + if (other.licenses_.Count != 0) { + result.licenses_.Add(other.licenses_); + } + if (other.credentials_.Count != 0) { + result.credentials_.Add(other.credentials_); + } + if (other.accountLinks_.Count != 0) { + result.accountLinks_.Add(other.accountLinks_); + } + if (other.HasBattleTag) { + BattleTag = other.BattleTag; + } + if (other.HasDefaultCurrency) { + DefaultCurrency = other.DefaultCurrency; + } + if (other.HasLegalRegion) { + LegalRegion = other.LegalRegion; + } + if (other.HasLegalLocale) { + LegalLocale = other.LegalLocale; + } + if (other.HasCacheExpiration) { + CacheExpiration = other.CacheExpiration; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_accountBlobFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _accountBlobFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 21: { + result.hasId = input.ReadFixed32(ref result.id_); + break; + } + case 24: { + result.hasRegion = input.ReadUInt32(ref result.region_); + break; + } + case 34: { + input.ReadStringArray(tag, field_name, result.email_); + break; + } + case 40: { + result.hasFlags = input.ReadUInt64(ref result.flags_); + break; + } + case 48: { + result.hasSecureRelease = input.ReadUInt64(ref result.secureRelease_); + break; + } + case 56: { + result.hasWhitelistStart = input.ReadUInt64(ref result.whitelistStart_); + break; + } + case 64: { + result.hasWhitelistEnd = input.ReadUInt64(ref result.whitelistEnd_); + break; + } + case 82: { + result.hasFullName = input.ReadString(ref result.fullName_); + break; + } + case 162: { + input.ReadMessageArray(tag, field_name, result.licenses_, global::bnet.protocol.account.AccountLicense.DefaultInstance, extensionRegistry); + break; + } + case 170: { + input.ReadMessageArray(tag, field_name, result.credentials_, global::bnet.protocol.account.AccountCredential.DefaultInstance, extensionRegistry); + break; + } + case 178: { + input.ReadMessageArray(tag, field_name, result.accountLinks_, global::bnet.protocol.account.GameAccountLink.DefaultInstance, extensionRegistry); + break; + } + case 186: { + result.hasBattleTag = input.ReadString(ref result.battleTag_); + break; + } + case 205: { + result.hasDefaultCurrency = input.ReadFixed32(ref result.defaultCurrency_); + break; + } + case 208: { + result.hasLegalRegion = input.ReadUInt32(ref result.legalRegion_); + break; + } + case 221: { + result.hasLegalLocale = input.ReadFixed32(ref result.legalLocale_); + break; + } + case 240: { + result.hasCacheExpiration = input.ReadUInt64(ref result.cacheExpiration_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasId { + get { return result.hasId; } + } + public uint Id { + get { return result.Id; } + set { SetId(value); } + } + public Builder SetId(uint value) { + PrepareBuilder(); + result.hasId = true; + result.id_ = value; + return this; + } + public Builder ClearId() { + PrepareBuilder(); + result.hasId = false; + result.id_ = 0; + return this; + } + + public bool HasRegion { + get { return result.hasRegion; } + } + public uint Region { + get { return result.Region; } + set { SetRegion(value); } + } + public Builder SetRegion(uint value) { + PrepareBuilder(); + result.hasRegion = true; + result.region_ = value; + return this; + } + public Builder ClearRegion() { + PrepareBuilder(); + result.hasRegion = false; + result.region_ = 0; + return this; + } + + public pbc::IPopsicleList EmailList { + get { return PrepareBuilder().email_; } + } + public int EmailCount { + get { return result.EmailCount; } + } + public string GetEmail(int index) { + return result.GetEmail(index); + } + public Builder SetEmail(int index, string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.email_[index] = value; + return this; + } + public Builder AddEmail(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.email_.Add(value); + return this; + } + public Builder AddRangeEmail(scg::IEnumerable values) { + PrepareBuilder(); + result.email_.Add(values); + return this; + } + public Builder ClearEmail() { + PrepareBuilder(); + result.email_.Clear(); + return this; + } + + public bool HasFlags { + get { return result.hasFlags; } + } + public ulong Flags { + get { return result.Flags; } + set { SetFlags(value); } + } + public Builder SetFlags(ulong value) { + PrepareBuilder(); + result.hasFlags = true; + result.flags_ = value; + return this; + } + public Builder ClearFlags() { + PrepareBuilder(); + result.hasFlags = false; + result.flags_ = 0UL; + return this; + } + + public bool HasSecureRelease { + get { return result.hasSecureRelease; } + } + public ulong SecureRelease { + get { return result.SecureRelease; } + set { SetSecureRelease(value); } + } + public Builder SetSecureRelease(ulong value) { + PrepareBuilder(); + result.hasSecureRelease = true; + result.secureRelease_ = value; + return this; + } + public Builder ClearSecureRelease() { + PrepareBuilder(); + result.hasSecureRelease = false; + result.secureRelease_ = 0UL; + return this; + } + + public bool HasWhitelistStart { + get { return result.hasWhitelistStart; } + } + public ulong WhitelistStart { + get { return result.WhitelistStart; } + set { SetWhitelistStart(value); } + } + public Builder SetWhitelistStart(ulong value) { + PrepareBuilder(); + result.hasWhitelistStart = true; + result.whitelistStart_ = value; + return this; + } + public Builder ClearWhitelistStart() { + PrepareBuilder(); + result.hasWhitelistStart = false; + result.whitelistStart_ = 0UL; + return this; + } + + public bool HasWhitelistEnd { + get { return result.hasWhitelistEnd; } + } + public ulong WhitelistEnd { + get { return result.WhitelistEnd; } + set { SetWhitelistEnd(value); } + } + public Builder SetWhitelistEnd(ulong value) { + PrepareBuilder(); + result.hasWhitelistEnd = true; + result.whitelistEnd_ = value; + return this; + } + public Builder ClearWhitelistEnd() { + PrepareBuilder(); + result.hasWhitelistEnd = false; + result.whitelistEnd_ = 0UL; + return this; + } + + public bool HasFullName { + get { return result.hasFullName; } + } + public string FullName { + get { return result.FullName; } + set { SetFullName(value); } + } + public Builder SetFullName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasFullName = true; + result.fullName_ = value; + return this; + } + public Builder ClearFullName() { + PrepareBuilder(); + result.hasFullName = false; + result.fullName_ = ""; + return this; + } + + public pbc::IPopsicleList LicensesList { + get { return PrepareBuilder().licenses_; } + } + public int LicensesCount { + get { return result.LicensesCount; } + } + public global::bnet.protocol.account.AccountLicense GetLicenses(int index) { + return result.GetLicenses(index); + } + public Builder SetLicenses(int index, global::bnet.protocol.account.AccountLicense value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.licenses_[index] = value; + return this; + } + public Builder SetLicenses(int index, global::bnet.protocol.account.AccountLicense.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.licenses_[index] = builderForValue.Build(); + return this; + } + public Builder AddLicenses(global::bnet.protocol.account.AccountLicense value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.licenses_.Add(value); + return this; + } + public Builder AddLicenses(global::bnet.protocol.account.AccountLicense.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.licenses_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeLicenses(scg::IEnumerable values) { + PrepareBuilder(); + result.licenses_.Add(values); + return this; + } + public Builder ClearLicenses() { + PrepareBuilder(); + result.licenses_.Clear(); + return this; + } + + public pbc::IPopsicleList CredentialsList { + get { return PrepareBuilder().credentials_; } + } + public int CredentialsCount { + get { return result.CredentialsCount; } + } + public global::bnet.protocol.account.AccountCredential GetCredentials(int index) { + return result.GetCredentials(index); + } + public Builder SetCredentials(int index, global::bnet.protocol.account.AccountCredential value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.credentials_[index] = value; + return this; + } + public Builder SetCredentials(int index, global::bnet.protocol.account.AccountCredential.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.credentials_[index] = builderForValue.Build(); + return this; + } + public Builder AddCredentials(global::bnet.protocol.account.AccountCredential value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.credentials_.Add(value); + return this; + } + public Builder AddCredentials(global::bnet.protocol.account.AccountCredential.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.credentials_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeCredentials(scg::IEnumerable values) { + PrepareBuilder(); + result.credentials_.Add(values); + return this; + } + public Builder ClearCredentials() { + PrepareBuilder(); + result.credentials_.Clear(); + return this; + } + + public pbc::IPopsicleList AccountLinksList { + get { return PrepareBuilder().accountLinks_; } + } + public int AccountLinksCount { + get { return result.AccountLinksCount; } + } + public global::bnet.protocol.account.GameAccountLink GetAccountLinks(int index) { + return result.GetAccountLinks(index); + } + public Builder SetAccountLinks(int index, global::bnet.protocol.account.GameAccountLink value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.accountLinks_[index] = value; + return this; + } + public Builder SetAccountLinks(int index, global::bnet.protocol.account.GameAccountLink.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.accountLinks_[index] = builderForValue.Build(); + return this; + } + public Builder AddAccountLinks(global::bnet.protocol.account.GameAccountLink value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.accountLinks_.Add(value); + return this; + } + public Builder AddAccountLinks(global::bnet.protocol.account.GameAccountLink.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.accountLinks_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeAccountLinks(scg::IEnumerable values) { + PrepareBuilder(); + result.accountLinks_.Add(values); + return this; + } + public Builder ClearAccountLinks() { + PrepareBuilder(); + result.accountLinks_.Clear(); + return this; + } + + public bool HasBattleTag { + get { return result.hasBattleTag; } + } + public string BattleTag { + get { return result.BattleTag; } + set { SetBattleTag(value); } + } + public Builder SetBattleTag(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBattleTag = true; + result.battleTag_ = value; + return this; + } + public Builder ClearBattleTag() { + PrepareBuilder(); + result.hasBattleTag = false; + result.battleTag_ = ""; + return this; + } + + public bool HasDefaultCurrency { + get { return result.hasDefaultCurrency; } + } + public uint DefaultCurrency { + get { return result.DefaultCurrency; } + set { SetDefaultCurrency(value); } + } + public Builder SetDefaultCurrency(uint value) { + PrepareBuilder(); + result.hasDefaultCurrency = true; + result.defaultCurrency_ = value; + return this; + } + public Builder ClearDefaultCurrency() { + PrepareBuilder(); + result.hasDefaultCurrency = false; + result.defaultCurrency_ = 0; + return this; + } + + public bool HasLegalRegion { + get { return result.hasLegalRegion; } + } + public uint LegalRegion { + get { return result.LegalRegion; } + set { SetLegalRegion(value); } + } + public Builder SetLegalRegion(uint value) { + PrepareBuilder(); + result.hasLegalRegion = true; + result.legalRegion_ = value; + return this; + } + public Builder ClearLegalRegion() { + PrepareBuilder(); + result.hasLegalRegion = false; + result.legalRegion_ = 0; + return this; + } + + public bool HasLegalLocale { + get { return result.hasLegalLocale; } + } + public uint LegalLocale { + get { return result.LegalLocale; } + set { SetLegalLocale(value); } + } + public Builder SetLegalLocale(uint value) { + PrepareBuilder(); + result.hasLegalLocale = true; + result.legalLocale_ = value; + return this; + } + public Builder ClearLegalLocale() { + PrepareBuilder(); + result.hasLegalLocale = false; + result.legalLocale_ = 0; + return this; + } + + public bool HasCacheExpiration { + get { return result.hasCacheExpiration; } + } + public ulong CacheExpiration { + get { return result.CacheExpiration; } + set { SetCacheExpiration(value); } + } + public Builder SetCacheExpiration(ulong value) { + PrepareBuilder(); + result.hasCacheExpiration = true; + result.cacheExpiration_ = value; + return this; + } + public Builder ClearCacheExpiration() { + PrepareBuilder(); + result.hasCacheExpiration = false; + result.cacheExpiration_ = 0UL; + return this; + } + } + static AccountBlob() { + object.ReferenceEquals(global::bnet.protocol.account.AccountTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class AccountBlobList : pb::GeneratedMessage { + private AccountBlobList() { } + private static readonly AccountBlobList defaultInstance = new AccountBlobList().MakeReadOnly(); + private static readonly string[] _accountBlobListFieldNames = new string[] { "blob" }; + private static readonly uint[] _accountBlobListFieldTags = new uint[] { 10 }; + public static AccountBlobList DefaultInstance { + get { return defaultInstance; } + } + + public override AccountBlobList DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override AccountBlobList ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.account.AccountTypes.internal__static_bnet_protocol_account_AccountBlobList__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.account.AccountTypes.internal__static_bnet_protocol_account_AccountBlobList__FieldAccessorTable; } + } + + public const int BlobFieldNumber = 1; + private pbc::PopsicleList blob_ = new pbc::PopsicleList(); + public scg::IList BlobList { + get { return blob_; } + } + public int BlobCount { + get { return blob_.Count; } + } + public global::bnet.protocol.account.AccountBlob GetBlob(int index) { + return blob_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.account.AccountBlob element in BlobList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _accountBlobListFieldNames; + if (blob_.Count > 0) { + output.WriteMessageArray(1, field_names[0], blob_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.account.AccountBlob element in BlobList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static AccountBlobList ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AccountBlobList ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AccountBlobList ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AccountBlobList ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AccountBlobList ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AccountBlobList ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static AccountBlobList ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static AccountBlobList ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static AccountBlobList ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AccountBlobList ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private AccountBlobList MakeReadOnly() { + blob_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(AccountBlobList prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(AccountBlobList cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private AccountBlobList result; + + private AccountBlobList PrepareBuilder() { + if (resultIsReadOnly) { + AccountBlobList original = result; + result = new AccountBlobList(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override AccountBlobList MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.account.AccountBlobList.Descriptor; } + } + + public override AccountBlobList DefaultInstanceForType { + get { return global::bnet.protocol.account.AccountBlobList.DefaultInstance; } + } + + public override AccountBlobList BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is AccountBlobList) { + return MergeFrom((AccountBlobList) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(AccountBlobList other) { + if (other == global::bnet.protocol.account.AccountBlobList.DefaultInstance) return this; + PrepareBuilder(); + if (other.blob_.Count != 0) { + result.blob_.Add(other.blob_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_accountBlobListFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _accountBlobListFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.blob_, global::bnet.protocol.account.AccountBlob.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList BlobList { + get { return PrepareBuilder().blob_; } + } + public int BlobCount { + get { return result.BlobCount; } + } + public global::bnet.protocol.account.AccountBlob GetBlob(int index) { + return result.GetBlob(index); + } + public Builder SetBlob(int index, global::bnet.protocol.account.AccountBlob value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.blob_[index] = value; + return this; + } + public Builder SetBlob(int index, global::bnet.protocol.account.AccountBlob.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.blob_[index] = builderForValue.Build(); + return this; + } + public Builder AddBlob(global::bnet.protocol.account.AccountBlob value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.blob_.Add(value); + return this; + } + public Builder AddBlob(global::bnet.protocol.account.AccountBlob.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.blob_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeBlob(scg::IEnumerable values) { + PrepareBuilder(); + result.blob_.Add(values); + return this; + } + public Builder ClearBlob() { + PrepareBuilder(); + result.blob_.Clear(); + return this; + } + } + static AccountBlobList() { + object.ReferenceEquals(global::bnet.protocol.account.AccountTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GameAccountHandle : pb::GeneratedMessage { + private GameAccountHandle() { } + private static readonly GameAccountHandle defaultInstance = new GameAccountHandle().MakeReadOnly(); + private static readonly string[] _gameAccountHandleFieldNames = new string[] { "id", "program", "region" }; + private static readonly uint[] _gameAccountHandleFieldTags = new uint[] { 13, 21, 24 }; + public static GameAccountHandle DefaultInstance { + get { return defaultInstance; } + } + + public override GameAccountHandle DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GameAccountHandle ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.account.AccountTypes.internal__static_bnet_protocol_account_GameAccountHandle__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.account.AccountTypes.internal__static_bnet_protocol_account_GameAccountHandle__FieldAccessorTable; } + } + + public const int IdFieldNumber = 1; + private bool hasId; + private uint id_; + public bool HasId { + get { return hasId; } + } + public uint Id { + get { return id_; } + } + + public const int ProgramFieldNumber = 2; + private bool hasProgram; + private uint program_; + public bool HasProgram { + get { return hasProgram; } + } + public uint Program { + get { return program_; } + } + + public const int RegionFieldNumber = 3; + private bool hasRegion; + private uint region_; + public bool HasRegion { + get { return hasRegion; } + } + public uint Region { + get { return region_; } + } + + public override bool IsInitialized { + get { + if (!hasId) return false; + if (!hasProgram) return false; + if (!hasRegion) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _gameAccountHandleFieldNames; + if (hasId) { + output.WriteFixed32(1, field_names[0], Id); + } + if (hasProgram) { + output.WriteFixed32(2, field_names[1], Program); + } + if (hasRegion) { + output.WriteUInt32(3, field_names[2], Region); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasId) { + size += pb::CodedOutputStream.ComputeFixed32Size(1, Id); + } + if (hasProgram) { + size += pb::CodedOutputStream.ComputeFixed32Size(2, Program); + } + if (hasRegion) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, Region); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GameAccountHandle ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GameAccountHandle ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GameAccountHandle ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GameAccountHandle ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GameAccountHandle ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GameAccountHandle ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GameAccountHandle ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GameAccountHandle ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GameAccountHandle ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GameAccountHandle ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GameAccountHandle MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GameAccountHandle prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GameAccountHandle cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GameAccountHandle result; + + private GameAccountHandle PrepareBuilder() { + if (resultIsReadOnly) { + GameAccountHandle original = result; + result = new GameAccountHandle(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GameAccountHandle MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.account.GameAccountHandle.Descriptor; } + } + + public override GameAccountHandle DefaultInstanceForType { + get { return global::bnet.protocol.account.GameAccountHandle.DefaultInstance; } + } + + public override GameAccountHandle BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GameAccountHandle) { + return MergeFrom((GameAccountHandle) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GameAccountHandle other) { + if (other == global::bnet.protocol.account.GameAccountHandle.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasId) { + Id = other.Id; + } + if (other.HasProgram) { + Program = other.Program; + } + if (other.HasRegion) { + Region = other.Region; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_gameAccountHandleFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _gameAccountHandleFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 13: { + result.hasId = input.ReadFixed32(ref result.id_); + break; + } + case 21: { + result.hasProgram = input.ReadFixed32(ref result.program_); + break; + } + case 24: { + result.hasRegion = input.ReadUInt32(ref result.region_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasId { + get { return result.hasId; } + } + public uint Id { + get { return result.Id; } + set { SetId(value); } + } + public Builder SetId(uint value) { + PrepareBuilder(); + result.hasId = true; + result.id_ = value; + return this; + } + public Builder ClearId() { + PrepareBuilder(); + result.hasId = false; + result.id_ = 0; + return this; + } + + public bool HasProgram { + get { return result.hasProgram; } + } + public uint Program { + get { return result.Program; } + set { SetProgram(value); } + } + public Builder SetProgram(uint value) { + PrepareBuilder(); + result.hasProgram = true; + result.program_ = value; + return this; + } + public Builder ClearProgram() { + PrepareBuilder(); + result.hasProgram = false; + result.program_ = 0; + return this; + } + + public bool HasRegion { + get { return result.hasRegion; } + } + public uint Region { + get { return result.Region; } + set { SetRegion(value); } + } + public Builder SetRegion(uint value) { + PrepareBuilder(); + result.hasRegion = true; + result.region_ = value; + return this; + } + public Builder ClearRegion() { + PrepareBuilder(); + result.hasRegion = false; + result.region_ = 0; + return this; + } + } + static GameAccountHandle() { + object.ReferenceEquals(global::bnet.protocol.account.AccountTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GameAccountLink : pb::GeneratedMessage { + private GameAccountLink() { } + private static readonly GameAccountLink defaultInstance = new GameAccountLink().MakeReadOnly(); + private static readonly string[] _gameAccountLinkFieldNames = new string[] { "game_account", "name" }; + private static readonly uint[] _gameAccountLinkFieldTags = new uint[] { 10, 18 }; + public static GameAccountLink DefaultInstance { + get { return defaultInstance; } + } + + public override GameAccountLink DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GameAccountLink ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.account.AccountTypes.internal__static_bnet_protocol_account_GameAccountLink__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.account.AccountTypes.internal__static_bnet_protocol_account_GameAccountLink__FieldAccessorTable; } + } + + public const int GameAccountFieldNumber = 1; + private bool hasGameAccount; + private global::bnet.protocol.account.GameAccountHandle gameAccount_; + public bool HasGameAccount { + get { return hasGameAccount; } + } + public global::bnet.protocol.account.GameAccountHandle GameAccount { + get { return gameAccount_ ?? global::bnet.protocol.account.GameAccountHandle.DefaultInstance; } + } + + public const int NameFieldNumber = 2; + private bool hasName; + private string name_ = ""; + public bool HasName { + get { return hasName; } + } + public string Name { + get { return name_; } + } + + public override bool IsInitialized { + get { + if (!hasGameAccount) return false; + if (!hasName) return false; + if (!GameAccount.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _gameAccountLinkFieldNames; + if (hasGameAccount) { + output.WriteMessage(1, field_names[0], GameAccount); + } + if (hasName) { + output.WriteString(2, field_names[1], Name); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasGameAccount) { + size += pb::CodedOutputStream.ComputeMessageSize(1, GameAccount); + } + if (hasName) { + size += pb::CodedOutputStream.ComputeStringSize(2, Name); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GameAccountLink ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GameAccountLink ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GameAccountLink ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GameAccountLink ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GameAccountLink ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GameAccountLink ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GameAccountLink ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GameAccountLink ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GameAccountLink ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GameAccountLink ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GameAccountLink MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GameAccountLink prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GameAccountLink cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GameAccountLink result; + + private GameAccountLink PrepareBuilder() { + if (resultIsReadOnly) { + GameAccountLink original = result; + result = new GameAccountLink(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GameAccountLink MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.account.GameAccountLink.Descriptor; } + } + + public override GameAccountLink DefaultInstanceForType { + get { return global::bnet.protocol.account.GameAccountLink.DefaultInstance; } + } + + public override GameAccountLink BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GameAccountLink) { + return MergeFrom((GameAccountLink) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GameAccountLink other) { + if (other == global::bnet.protocol.account.GameAccountLink.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasGameAccount) { + MergeGameAccount(other.GameAccount); + } + if (other.HasName) { + Name = other.Name; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_gameAccountLinkFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _gameAccountLinkFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.account.GameAccountHandle.Builder subBuilder = global::bnet.protocol.account.GameAccountHandle.CreateBuilder(); + if (result.hasGameAccount) { + subBuilder.MergeFrom(GameAccount); + } + input.ReadMessage(subBuilder, extensionRegistry); + GameAccount = subBuilder.BuildPartial(); + break; + } + case 18: { + result.hasName = input.ReadString(ref result.name_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasGameAccount { + get { return result.hasGameAccount; } + } + public global::bnet.protocol.account.GameAccountHandle GameAccount { + get { return result.GameAccount; } + set { SetGameAccount(value); } + } + public Builder SetGameAccount(global::bnet.protocol.account.GameAccountHandle value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasGameAccount = true; + result.gameAccount_ = value; + return this; + } + public Builder SetGameAccount(global::bnet.protocol.account.GameAccountHandle.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasGameAccount = true; + result.gameAccount_ = builderForValue.Build(); + return this; + } + public Builder MergeGameAccount(global::bnet.protocol.account.GameAccountHandle value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasGameAccount && + result.gameAccount_ != global::bnet.protocol.account.GameAccountHandle.DefaultInstance) { + result.gameAccount_ = global::bnet.protocol.account.GameAccountHandle.CreateBuilder(result.gameAccount_).MergeFrom(value).BuildPartial(); + } else { + result.gameAccount_ = value; + } + result.hasGameAccount = true; + return this; + } + public Builder ClearGameAccount() { + PrepareBuilder(); + result.hasGameAccount = false; + result.gameAccount_ = null; + return this; + } + + public bool HasName { + get { return result.hasName; } + } + public string Name { + get { return result.Name; } + set { SetName(value); } + } + public Builder SetName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasName = true; + result.name_ = value; + return this; + } + public Builder ClearName() { + PrepareBuilder(); + result.hasName = false; + result.name_ = ""; + return this; + } + } + static GameAccountLink() { + object.ReferenceEquals(global::bnet.protocol.account.AccountTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GameAccountBlob : pb::GeneratedMessage { + private GameAccountBlob() { } + private static readonly GameAccountBlob defaultInstance = new GameAccountBlob().MakeReadOnly(); + private static readonly string[] _gameAccountBlobFieldNames = new string[] { "billing_flags", "cache_expiration", "flags", "game_account", "licenses", "name", "realm_permissions", "status", "subscription_expiration", "units_remaining" }; + private static readonly uint[] _gameAccountBlobFieldTags = new uint[] { 48, 56, 40, 10, 162, 18, 24, 32, 80, 88 }; + public static GameAccountBlob DefaultInstance { + get { return defaultInstance; } + } + + public override GameAccountBlob DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GameAccountBlob ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.account.AccountTypes.internal__static_bnet_protocol_account_GameAccountBlob__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.account.AccountTypes.internal__static_bnet_protocol_account_GameAccountBlob__FieldAccessorTable; } + } + + public const int GameAccountFieldNumber = 1; + private bool hasGameAccount; + private global::bnet.protocol.account.GameAccountHandle gameAccount_; + public bool HasGameAccount { + get { return hasGameAccount; } + } + public global::bnet.protocol.account.GameAccountHandle GameAccount { + get { return gameAccount_ ?? global::bnet.protocol.account.GameAccountHandle.DefaultInstance; } + } + + public const int NameFieldNumber = 2; + private bool hasName; + private string name_ = ""; + public bool HasName { + get { return hasName; } + } + public string Name { + get { return name_; } + } + + public const int RealmPermissionsFieldNumber = 3; + private bool hasRealmPermissions; + private uint realmPermissions_; + public bool HasRealmPermissions { + get { return hasRealmPermissions; } + } + public uint RealmPermissions { + get { return realmPermissions_; } + } + + public const int StatusFieldNumber = 4; + private bool hasStatus; + private uint status_; + public bool HasStatus { + get { return hasStatus; } + } + public uint Status { + get { return status_; } + } + + public const int FlagsFieldNumber = 5; + private bool hasFlags; + private ulong flags_; + public bool HasFlags { + get { return hasFlags; } + } + public ulong Flags { + get { return flags_; } + } + + public const int BillingFlagsFieldNumber = 6; + private bool hasBillingFlags; + private uint billingFlags_; + public bool HasBillingFlags { + get { return hasBillingFlags; } + } + public uint BillingFlags { + get { return billingFlags_; } + } + + public const int CacheExpirationFieldNumber = 7; + private bool hasCacheExpiration; + private ulong cacheExpiration_; + public bool HasCacheExpiration { + get { return hasCacheExpiration; } + } + public ulong CacheExpiration { + get { return cacheExpiration_; } + } + + public const int SubscriptionExpirationFieldNumber = 10; + private bool hasSubscriptionExpiration; + private ulong subscriptionExpiration_; + public bool HasSubscriptionExpiration { + get { return hasSubscriptionExpiration; } + } + public ulong SubscriptionExpiration { + get { return subscriptionExpiration_; } + } + + public const int UnitsRemainingFieldNumber = 11; + private bool hasUnitsRemaining; + private uint unitsRemaining_; + public bool HasUnitsRemaining { + get { return hasUnitsRemaining; } + } + public uint UnitsRemaining { + get { return unitsRemaining_; } + } + + public const int LicensesFieldNumber = 20; + private pbc::PopsicleList licenses_ = new pbc::PopsicleList(); + public scg::IList LicensesList { + get { return licenses_; } + } + public int LicensesCount { + get { return licenses_.Count; } + } + public global::bnet.protocol.account.AccountLicense GetLicenses(int index) { + return licenses_[index]; + } + + public override bool IsInitialized { + get { + if (!hasGameAccount) return false; + if (!hasStatus) return false; + if (!hasCacheExpiration) return false; + if (!GameAccount.IsInitialized) return false; + foreach (global::bnet.protocol.account.AccountLicense element in LicensesList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _gameAccountBlobFieldNames; + if (hasGameAccount) { + output.WriteMessage(1, field_names[3], GameAccount); + } + if (hasName) { + output.WriteString(2, field_names[5], Name); + } + if (hasRealmPermissions) { + output.WriteUInt32(3, field_names[6], RealmPermissions); + } + if (hasStatus) { + output.WriteUInt32(4, field_names[7], Status); + } + if (hasFlags) { + output.WriteUInt64(5, field_names[2], Flags); + } + if (hasBillingFlags) { + output.WriteUInt32(6, field_names[0], BillingFlags); + } + if (hasCacheExpiration) { + output.WriteUInt64(7, field_names[1], CacheExpiration); + } + if (hasSubscriptionExpiration) { + output.WriteUInt64(10, field_names[8], SubscriptionExpiration); + } + if (hasUnitsRemaining) { + output.WriteUInt32(11, field_names[9], UnitsRemaining); + } + if (licenses_.Count > 0) { + output.WriteMessageArray(20, field_names[4], licenses_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasGameAccount) { + size += pb::CodedOutputStream.ComputeMessageSize(1, GameAccount); + } + if (hasName) { + size += pb::CodedOutputStream.ComputeStringSize(2, Name); + } + if (hasRealmPermissions) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, RealmPermissions); + } + if (hasStatus) { + size += pb::CodedOutputStream.ComputeUInt32Size(4, Status); + } + if (hasFlags) { + size += pb::CodedOutputStream.ComputeUInt64Size(5, Flags); + } + if (hasBillingFlags) { + size += pb::CodedOutputStream.ComputeUInt32Size(6, BillingFlags); + } + if (hasCacheExpiration) { + size += pb::CodedOutputStream.ComputeUInt64Size(7, CacheExpiration); + } + if (hasSubscriptionExpiration) { + size += pb::CodedOutputStream.ComputeUInt64Size(10, SubscriptionExpiration); + } + if (hasUnitsRemaining) { + size += pb::CodedOutputStream.ComputeUInt32Size(11, UnitsRemaining); + } + foreach (global::bnet.protocol.account.AccountLicense element in LicensesList) { + size += pb::CodedOutputStream.ComputeMessageSize(20, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GameAccountBlob ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GameAccountBlob ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GameAccountBlob ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GameAccountBlob ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GameAccountBlob ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GameAccountBlob ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GameAccountBlob ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GameAccountBlob ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GameAccountBlob ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GameAccountBlob ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GameAccountBlob MakeReadOnly() { + licenses_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GameAccountBlob prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GameAccountBlob cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GameAccountBlob result; + + private GameAccountBlob PrepareBuilder() { + if (resultIsReadOnly) { + GameAccountBlob original = result; + result = new GameAccountBlob(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GameAccountBlob MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.account.GameAccountBlob.Descriptor; } + } + + public override GameAccountBlob DefaultInstanceForType { + get { return global::bnet.protocol.account.GameAccountBlob.DefaultInstance; } + } + + public override GameAccountBlob BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GameAccountBlob) { + return MergeFrom((GameAccountBlob) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GameAccountBlob other) { + if (other == global::bnet.protocol.account.GameAccountBlob.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasGameAccount) { + MergeGameAccount(other.GameAccount); + } + if (other.HasName) { + Name = other.Name; + } + if (other.HasRealmPermissions) { + RealmPermissions = other.RealmPermissions; + } + if (other.HasStatus) { + Status = other.Status; + } + if (other.HasFlags) { + Flags = other.Flags; + } + if (other.HasBillingFlags) { + BillingFlags = other.BillingFlags; + } + if (other.HasCacheExpiration) { + CacheExpiration = other.CacheExpiration; + } + if (other.HasSubscriptionExpiration) { + SubscriptionExpiration = other.SubscriptionExpiration; + } + if (other.HasUnitsRemaining) { + UnitsRemaining = other.UnitsRemaining; + } + if (other.licenses_.Count != 0) { + result.licenses_.Add(other.licenses_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_gameAccountBlobFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _gameAccountBlobFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.account.GameAccountHandle.Builder subBuilder = global::bnet.protocol.account.GameAccountHandle.CreateBuilder(); + if (result.hasGameAccount) { + subBuilder.MergeFrom(GameAccount); + } + input.ReadMessage(subBuilder, extensionRegistry); + GameAccount = subBuilder.BuildPartial(); + break; + } + case 18: { + result.hasName = input.ReadString(ref result.name_); + break; + } + case 24: { + result.hasRealmPermissions = input.ReadUInt32(ref result.realmPermissions_); + break; + } + case 32: { + result.hasStatus = input.ReadUInt32(ref result.status_); + break; + } + case 40: { + result.hasFlags = input.ReadUInt64(ref result.flags_); + break; + } + case 48: { + result.hasBillingFlags = input.ReadUInt32(ref result.billingFlags_); + break; + } + case 56: { + result.hasCacheExpiration = input.ReadUInt64(ref result.cacheExpiration_); + break; + } + case 80: { + result.hasSubscriptionExpiration = input.ReadUInt64(ref result.subscriptionExpiration_); + break; + } + case 88: { + result.hasUnitsRemaining = input.ReadUInt32(ref result.unitsRemaining_); + break; + } + case 162: { + input.ReadMessageArray(tag, field_name, result.licenses_, global::bnet.protocol.account.AccountLicense.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasGameAccount { + get { return result.hasGameAccount; } + } + public global::bnet.protocol.account.GameAccountHandle GameAccount { + get { return result.GameAccount; } + set { SetGameAccount(value); } + } + public Builder SetGameAccount(global::bnet.protocol.account.GameAccountHandle value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasGameAccount = true; + result.gameAccount_ = value; + return this; + } + public Builder SetGameAccount(global::bnet.protocol.account.GameAccountHandle.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasGameAccount = true; + result.gameAccount_ = builderForValue.Build(); + return this; + } + public Builder MergeGameAccount(global::bnet.protocol.account.GameAccountHandle value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasGameAccount && + result.gameAccount_ != global::bnet.protocol.account.GameAccountHandle.DefaultInstance) { + result.gameAccount_ = global::bnet.protocol.account.GameAccountHandle.CreateBuilder(result.gameAccount_).MergeFrom(value).BuildPartial(); + } else { + result.gameAccount_ = value; + } + result.hasGameAccount = true; + return this; + } + public Builder ClearGameAccount() { + PrepareBuilder(); + result.hasGameAccount = false; + result.gameAccount_ = null; + return this; + } + + public bool HasName { + get { return result.hasName; } + } + public string Name { + get { return result.Name; } + set { SetName(value); } + } + public Builder SetName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasName = true; + result.name_ = value; + return this; + } + public Builder ClearName() { + PrepareBuilder(); + result.hasName = false; + result.name_ = ""; + return this; + } + + public bool HasRealmPermissions { + get { return result.hasRealmPermissions; } + } + public uint RealmPermissions { + get { return result.RealmPermissions; } + set { SetRealmPermissions(value); } + } + public Builder SetRealmPermissions(uint value) { + PrepareBuilder(); + result.hasRealmPermissions = true; + result.realmPermissions_ = value; + return this; + } + public Builder ClearRealmPermissions() { + PrepareBuilder(); + result.hasRealmPermissions = false; + result.realmPermissions_ = 0; + return this; + } + + public bool HasStatus { + get { return result.hasStatus; } + } + public uint Status { + get { return result.Status; } + set { SetStatus(value); } + } + public Builder SetStatus(uint value) { + PrepareBuilder(); + result.hasStatus = true; + result.status_ = value; + return this; + } + public Builder ClearStatus() { + PrepareBuilder(); + result.hasStatus = false; + result.status_ = 0; + return this; + } + + public bool HasFlags { + get { return result.hasFlags; } + } + public ulong Flags { + get { return result.Flags; } + set { SetFlags(value); } + } + public Builder SetFlags(ulong value) { + PrepareBuilder(); + result.hasFlags = true; + result.flags_ = value; + return this; + } + public Builder ClearFlags() { + PrepareBuilder(); + result.hasFlags = false; + result.flags_ = 0UL; + return this; + } + + public bool HasBillingFlags { + get { return result.hasBillingFlags; } + } + public uint BillingFlags { + get { return result.BillingFlags; } + set { SetBillingFlags(value); } + } + public Builder SetBillingFlags(uint value) { + PrepareBuilder(); + result.hasBillingFlags = true; + result.billingFlags_ = value; + return this; + } + public Builder ClearBillingFlags() { + PrepareBuilder(); + result.hasBillingFlags = false; + result.billingFlags_ = 0; + return this; + } + + public bool HasCacheExpiration { + get { return result.hasCacheExpiration; } + } + public ulong CacheExpiration { + get { return result.CacheExpiration; } + set { SetCacheExpiration(value); } + } + public Builder SetCacheExpiration(ulong value) { + PrepareBuilder(); + result.hasCacheExpiration = true; + result.cacheExpiration_ = value; + return this; + } + public Builder ClearCacheExpiration() { + PrepareBuilder(); + result.hasCacheExpiration = false; + result.cacheExpiration_ = 0UL; + return this; + } + + public bool HasSubscriptionExpiration { + get { return result.hasSubscriptionExpiration; } + } + public ulong SubscriptionExpiration { + get { return result.SubscriptionExpiration; } + set { SetSubscriptionExpiration(value); } + } + public Builder SetSubscriptionExpiration(ulong value) { + PrepareBuilder(); + result.hasSubscriptionExpiration = true; + result.subscriptionExpiration_ = value; + return this; + } + public Builder ClearSubscriptionExpiration() { + PrepareBuilder(); + result.hasSubscriptionExpiration = false; + result.subscriptionExpiration_ = 0UL; + return this; + } + + public bool HasUnitsRemaining { + get { return result.hasUnitsRemaining; } + } + public uint UnitsRemaining { + get { return result.UnitsRemaining; } + set { SetUnitsRemaining(value); } + } + public Builder SetUnitsRemaining(uint value) { + PrepareBuilder(); + result.hasUnitsRemaining = true; + result.unitsRemaining_ = value; + return this; + } + public Builder ClearUnitsRemaining() { + PrepareBuilder(); + result.hasUnitsRemaining = false; + result.unitsRemaining_ = 0; + return this; + } + + public pbc::IPopsicleList LicensesList { + get { return PrepareBuilder().licenses_; } + } + public int LicensesCount { + get { return result.LicensesCount; } + } + public global::bnet.protocol.account.AccountLicense GetLicenses(int index) { + return result.GetLicenses(index); + } + public Builder SetLicenses(int index, global::bnet.protocol.account.AccountLicense value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.licenses_[index] = value; + return this; + } + public Builder SetLicenses(int index, global::bnet.protocol.account.AccountLicense.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.licenses_[index] = builderForValue.Build(); + return this; + } + public Builder AddLicenses(global::bnet.protocol.account.AccountLicense value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.licenses_.Add(value); + return this; + } + public Builder AddLicenses(global::bnet.protocol.account.AccountLicense.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.licenses_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeLicenses(scg::IEnumerable values) { + PrepareBuilder(); + result.licenses_.Add(values); + return this; + } + public Builder ClearLicenses() { + PrepareBuilder(); + result.licenses_.Clear(); + return this; + } + } + static GameAccountBlob() { + object.ReferenceEquals(global::bnet.protocol.account.AccountTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GameAccountBlobList : pb::GeneratedMessage { + private GameAccountBlobList() { } + private static readonly GameAccountBlobList defaultInstance = new GameAccountBlobList().MakeReadOnly(); + private static readonly string[] _gameAccountBlobListFieldNames = new string[] { "blob" }; + private static readonly uint[] _gameAccountBlobListFieldTags = new uint[] { 10 }; + public static GameAccountBlobList DefaultInstance { + get { return defaultInstance; } + } + + public override GameAccountBlobList DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GameAccountBlobList ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.account.AccountTypes.internal__static_bnet_protocol_account_GameAccountBlobList__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.account.AccountTypes.internal__static_bnet_protocol_account_GameAccountBlobList__FieldAccessorTable; } + } + + public const int BlobFieldNumber = 1; + private pbc::PopsicleList blob_ = new pbc::PopsicleList(); + public scg::IList BlobList { + get { return blob_; } + } + public int BlobCount { + get { return blob_.Count; } + } + public global::bnet.protocol.account.GameAccountBlob GetBlob(int index) { + return blob_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.account.GameAccountBlob element in BlobList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _gameAccountBlobListFieldNames; + if (blob_.Count > 0) { + output.WriteMessageArray(1, field_names[0], blob_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.account.GameAccountBlob element in BlobList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GameAccountBlobList ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GameAccountBlobList ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GameAccountBlobList ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GameAccountBlobList ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GameAccountBlobList ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GameAccountBlobList ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GameAccountBlobList ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GameAccountBlobList ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GameAccountBlobList ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GameAccountBlobList ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GameAccountBlobList MakeReadOnly() { + blob_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GameAccountBlobList prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GameAccountBlobList cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GameAccountBlobList result; + + private GameAccountBlobList PrepareBuilder() { + if (resultIsReadOnly) { + GameAccountBlobList original = result; + result = new GameAccountBlobList(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GameAccountBlobList MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.account.GameAccountBlobList.Descriptor; } + } + + public override GameAccountBlobList DefaultInstanceForType { + get { return global::bnet.protocol.account.GameAccountBlobList.DefaultInstance; } + } + + public override GameAccountBlobList BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GameAccountBlobList) { + return MergeFrom((GameAccountBlobList) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GameAccountBlobList other) { + if (other == global::bnet.protocol.account.GameAccountBlobList.DefaultInstance) return this; + PrepareBuilder(); + if (other.blob_.Count != 0) { + result.blob_.Add(other.blob_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_gameAccountBlobListFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _gameAccountBlobListFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.blob_, global::bnet.protocol.account.GameAccountBlob.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList BlobList { + get { return PrepareBuilder().blob_; } + } + public int BlobCount { + get { return result.BlobCount; } + } + public global::bnet.protocol.account.GameAccountBlob GetBlob(int index) { + return result.GetBlob(index); + } + public Builder SetBlob(int index, global::bnet.protocol.account.GameAccountBlob value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.blob_[index] = value; + return this; + } + public Builder SetBlob(int index, global::bnet.protocol.account.GameAccountBlob.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.blob_[index] = builderForValue.Build(); + return this; + } + public Builder AddBlob(global::bnet.protocol.account.GameAccountBlob value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.blob_.Add(value); + return this; + } + public Builder AddBlob(global::bnet.protocol.account.GameAccountBlob.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.blob_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeBlob(scg::IEnumerable values) { + PrepareBuilder(); + result.blob_.Add(values); + return this; + } + public Builder ClearBlob() { + PrepareBuilder(); + result.blob_.Clear(); + return this; + } + } + static GameAccountBlobList() { + object.ReferenceEquals(global::bnet.protocol.account.AccountTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class AccountReference : pb::GeneratedMessage { + private AccountReference() { } + private static readonly AccountReference defaultInstance = new AccountReference().MakeReadOnly(); + private static readonly string[] _accountReferenceFieldNames = new string[] { "battle_tag", "email", "handle", "id", "region" }; + private static readonly uint[] _accountReferenceFieldTags = new uint[] { 34, 18, 26, 13, 80 }; + public static AccountReference DefaultInstance { + get { return defaultInstance; } + } + + public override AccountReference DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override AccountReference ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.account.AccountTypes.internal__static_bnet_protocol_account_AccountReference__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.account.AccountTypes.internal__static_bnet_protocol_account_AccountReference__FieldAccessorTable; } + } + + public const int IdFieldNumber = 1; + private bool hasId; + private uint id_; + public bool HasId { + get { return hasId; } + } + public uint Id { + get { return id_; } + } + + public const int EmailFieldNumber = 2; + private bool hasEmail; + private string email_ = ""; + public bool HasEmail { + get { return hasEmail; } + } + public string Email { + get { return email_; } + } + + public const int HandleFieldNumber = 3; + private bool hasHandle; + private global::bnet.protocol.account.GameAccountHandle handle_; + public bool HasHandle { + get { return hasHandle; } + } + public global::bnet.protocol.account.GameAccountHandle Handle { + get { return handle_ ?? global::bnet.protocol.account.GameAccountHandle.DefaultInstance; } + } + + public const int BattleTagFieldNumber = 4; + private bool hasBattleTag; + private string battleTag_ = ""; + public bool HasBattleTag { + get { return hasBattleTag; } + } + public string BattleTag { + get { return battleTag_; } + } + + public const int RegionFieldNumber = 10; + private bool hasRegion; + private uint region_; + public bool HasRegion { + get { return hasRegion; } + } + public uint Region { + get { return region_; } + } + + public override bool IsInitialized { + get { + if (HasHandle) { + if (!Handle.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _accountReferenceFieldNames; + if (hasId) { + output.WriteFixed32(1, field_names[3], Id); + } + if (hasEmail) { + output.WriteString(2, field_names[1], Email); + } + if (hasHandle) { + output.WriteMessage(3, field_names[2], Handle); + } + if (hasBattleTag) { + output.WriteString(4, field_names[0], BattleTag); + } + if (hasRegion) { + output.WriteUInt32(10, field_names[4], Region); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasId) { + size += pb::CodedOutputStream.ComputeFixed32Size(1, Id); + } + if (hasEmail) { + size += pb::CodedOutputStream.ComputeStringSize(2, Email); + } + if (hasHandle) { + size += pb::CodedOutputStream.ComputeMessageSize(3, Handle); + } + if (hasBattleTag) { + size += pb::CodedOutputStream.ComputeStringSize(4, BattleTag); + } + if (hasRegion) { + size += pb::CodedOutputStream.ComputeUInt32Size(10, Region); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static AccountReference ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AccountReference ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AccountReference ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AccountReference ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AccountReference ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AccountReference ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static AccountReference ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static AccountReference ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static AccountReference ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AccountReference ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private AccountReference MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(AccountReference prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(AccountReference cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private AccountReference result; + + private AccountReference PrepareBuilder() { + if (resultIsReadOnly) { + AccountReference original = result; + result = new AccountReference(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override AccountReference MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.account.AccountReference.Descriptor; } + } + + public override AccountReference DefaultInstanceForType { + get { return global::bnet.protocol.account.AccountReference.DefaultInstance; } + } + + public override AccountReference BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is AccountReference) { + return MergeFrom((AccountReference) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(AccountReference other) { + if (other == global::bnet.protocol.account.AccountReference.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasId) { + Id = other.Id; + } + if (other.HasEmail) { + Email = other.Email; + } + if (other.HasHandle) { + MergeHandle(other.Handle); + } + if (other.HasBattleTag) { + BattleTag = other.BattleTag; + } + if (other.HasRegion) { + Region = other.Region; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_accountReferenceFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _accountReferenceFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 13: { + result.hasId = input.ReadFixed32(ref result.id_); + break; + } + case 18: { + result.hasEmail = input.ReadString(ref result.email_); + break; + } + case 26: { + global::bnet.protocol.account.GameAccountHandle.Builder subBuilder = global::bnet.protocol.account.GameAccountHandle.CreateBuilder(); + if (result.hasHandle) { + subBuilder.MergeFrom(Handle); + } + input.ReadMessage(subBuilder, extensionRegistry); + Handle = subBuilder.BuildPartial(); + break; + } + case 34: { + result.hasBattleTag = input.ReadString(ref result.battleTag_); + break; + } + case 80: { + result.hasRegion = input.ReadUInt32(ref result.region_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasId { + get { return result.hasId; } + } + public uint Id { + get { return result.Id; } + set { SetId(value); } + } + public Builder SetId(uint value) { + PrepareBuilder(); + result.hasId = true; + result.id_ = value; + return this; + } + public Builder ClearId() { + PrepareBuilder(); + result.hasId = false; + result.id_ = 0; + return this; + } + + public bool HasEmail { + get { return result.hasEmail; } + } + public string Email { + get { return result.Email; } + set { SetEmail(value); } + } + public Builder SetEmail(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasEmail = true; + result.email_ = value; + return this; + } + public Builder ClearEmail() { + PrepareBuilder(); + result.hasEmail = false; + result.email_ = ""; + return this; + } + + public bool HasHandle { + get { return result.hasHandle; } + } + public global::bnet.protocol.account.GameAccountHandle Handle { + get { return result.Handle; } + set { SetHandle(value); } + } + public Builder SetHandle(global::bnet.protocol.account.GameAccountHandle value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasHandle = true; + result.handle_ = value; + return this; + } + public Builder SetHandle(global::bnet.protocol.account.GameAccountHandle.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasHandle = true; + result.handle_ = builderForValue.Build(); + return this; + } + public Builder MergeHandle(global::bnet.protocol.account.GameAccountHandle value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasHandle && + result.handle_ != global::bnet.protocol.account.GameAccountHandle.DefaultInstance) { + result.handle_ = global::bnet.protocol.account.GameAccountHandle.CreateBuilder(result.handle_).MergeFrom(value).BuildPartial(); + } else { + result.handle_ = value; + } + result.hasHandle = true; + return this; + } + public Builder ClearHandle() { + PrepareBuilder(); + result.hasHandle = false; + result.handle_ = null; + return this; + } + + public bool HasBattleTag { + get { return result.hasBattleTag; } + } + public string BattleTag { + get { return result.BattleTag; } + set { SetBattleTag(value); } + } + public Builder SetBattleTag(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBattleTag = true; + result.battleTag_ = value; + return this; + } + public Builder ClearBattleTag() { + PrepareBuilder(); + result.hasBattleTag = false; + result.battleTag_ = ""; + return this; + } + + public bool HasRegion { + get { return result.hasRegion; } + } + public uint Region { + get { return result.Region; } + set { SetRegion(value); } + } + public Builder SetRegion(uint value) { + PrepareBuilder(); + result.hasRegion = true; + result.region_ = value; + return this; + } + public Builder ClearRegion() { + PrepareBuilder(); + result.hasRegion = false; + result.region_ = 0; + return this; + } + } + static AccountReference() { + object.ReferenceEquals(global::bnet.protocol.account.AccountTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Wallet : pb::GeneratedMessage { + private Wallet() { } + private static readonly Wallet defaultInstance = new Wallet().MakeReadOnly(); + private static readonly string[] _walletFieldNames = new string[] { "bin", "birth_date", "city", "country_id", "description", "first_name", "last_name", "locale_id", "payment_info", "postal_code", "region", "state", "street", "wallet_id", "wallet_type" }; + private static readonly uint[] _walletFieldTags = new uint[] { 82, 120, 58, 40, 34, 106, 114, 90, 74, 66, 8, 50, 98, 16, 24 }; + public static Wallet DefaultInstance { + get { return defaultInstance; } + } + + public override Wallet DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Wallet ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.account.AccountTypes.internal__static_bnet_protocol_account_Wallet__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.account.AccountTypes.internal__static_bnet_protocol_account_Wallet__FieldAccessorTable; } + } + + public const int RegionFieldNumber = 1; + private bool hasRegion; + private uint region_; + public bool HasRegion { + get { return hasRegion; } + } + public uint Region { + get { return region_; } + } + + public const int WalletIdFieldNumber = 2; + private bool hasWalletId; + private ulong walletId_; + public bool HasWalletId { + get { return hasWalletId; } + } + public ulong WalletId { + get { return walletId_; } + } + + public const int WalletTypeFieldNumber = 3; + private bool hasWalletType; + private uint walletType_; + public bool HasWalletType { + get { return hasWalletType; } + } + public uint WalletType { + get { return walletType_; } + } + + public const int DescriptionFieldNumber = 4; + private bool hasDescription; + private string description_ = ""; + public bool HasDescription { + get { return hasDescription; } + } + public string Description { + get { return description_; } + } + + public const int CountryIdFieldNumber = 5; + private bool hasCountryId; + private uint countryId_; + public bool HasCountryId { + get { return hasCountryId; } + } + public uint CountryId { + get { return countryId_; } + } + + public const int StateFieldNumber = 6; + private bool hasState; + private string state_ = ""; + public bool HasState { + get { return hasState; } + } + public string State { + get { return state_; } + } + + public const int CityFieldNumber = 7; + private bool hasCity; + private string city_ = ""; + public bool HasCity { + get { return hasCity; } + } + public string City { + get { return city_; } + } + + public const int PostalCodeFieldNumber = 8; + private bool hasPostalCode; + private string postalCode_ = ""; + public bool HasPostalCode { + get { return hasPostalCode; } + } + public string PostalCode { + get { return postalCode_; } + } + + public const int PaymentInfoFieldNumber = 9; + private bool hasPaymentInfo; + private pb::ByteString paymentInfo_ = pb::ByteString.Empty; + public bool HasPaymentInfo { + get { return hasPaymentInfo; } + } + public pb::ByteString PaymentInfo { + get { return paymentInfo_; } + } + + public const int BinFieldNumber = 10; + private bool hasBin; + private string bin_ = ""; + public bool HasBin { + get { return hasBin; } + } + public string Bin { + get { return bin_; } + } + + public const int LocaleIdFieldNumber = 11; + private bool hasLocaleId; + private string localeId_ = ""; + public bool HasLocaleId { + get { return hasLocaleId; } + } + public string LocaleId { + get { return localeId_; } + } + + public const int StreetFieldNumber = 12; + private bool hasStreet; + private string street_ = ""; + public bool HasStreet { + get { return hasStreet; } + } + public string Street { + get { return street_; } + } + + public const int FirstNameFieldNumber = 13; + private bool hasFirstName; + private string firstName_ = ""; + public bool HasFirstName { + get { return hasFirstName; } + } + public string FirstName { + get { return firstName_; } + } + + public const int LastNameFieldNumber = 14; + private bool hasLastName; + private string lastName_ = ""; + public bool HasLastName { + get { return hasLastName; } + } + public string LastName { + get { return lastName_; } + } + + public const int BirthDateFieldNumber = 15; + private bool hasBirthDate; + private ulong birthDate_; + public bool HasBirthDate { + get { return hasBirthDate; } + } + public ulong BirthDate { + get { return birthDate_; } + } + + public override bool IsInitialized { + get { + if (!hasRegion) return false; + if (!hasWalletId) return false; + if (!hasWalletType) return false; + if (!hasCountryId) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _walletFieldNames; + if (hasRegion) { + output.WriteUInt32(1, field_names[10], Region); + } + if (hasWalletId) { + output.WriteUInt64(2, field_names[13], WalletId); + } + if (hasWalletType) { + output.WriteUInt32(3, field_names[14], WalletType); + } + if (hasDescription) { + output.WriteString(4, field_names[4], Description); + } + if (hasCountryId) { + output.WriteUInt32(5, field_names[3], CountryId); + } + if (hasState) { + output.WriteString(6, field_names[11], State); + } + if (hasCity) { + output.WriteString(7, field_names[2], City); + } + if (hasPostalCode) { + output.WriteString(8, field_names[9], PostalCode); + } + if (hasPaymentInfo) { + output.WriteBytes(9, field_names[8], PaymentInfo); + } + if (hasBin) { + output.WriteString(10, field_names[0], Bin); + } + if (hasLocaleId) { + output.WriteString(11, field_names[7], LocaleId); + } + if (hasStreet) { + output.WriteString(12, field_names[12], Street); + } + if (hasFirstName) { + output.WriteString(13, field_names[5], FirstName); + } + if (hasLastName) { + output.WriteString(14, field_names[6], LastName); + } + if (hasBirthDate) { + output.WriteUInt64(15, field_names[1], BirthDate); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasRegion) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, Region); + } + if (hasWalletId) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, WalletId); + } + if (hasWalletType) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, WalletType); + } + if (hasDescription) { + size += pb::CodedOutputStream.ComputeStringSize(4, Description); + } + if (hasCountryId) { + size += pb::CodedOutputStream.ComputeUInt32Size(5, CountryId); + } + if (hasState) { + size += pb::CodedOutputStream.ComputeStringSize(6, State); + } + if (hasCity) { + size += pb::CodedOutputStream.ComputeStringSize(7, City); + } + if (hasPostalCode) { + size += pb::CodedOutputStream.ComputeStringSize(8, PostalCode); + } + if (hasPaymentInfo) { + size += pb::CodedOutputStream.ComputeBytesSize(9, PaymentInfo); + } + if (hasBin) { + size += pb::CodedOutputStream.ComputeStringSize(10, Bin); + } + if (hasLocaleId) { + size += pb::CodedOutputStream.ComputeStringSize(11, LocaleId); + } + if (hasStreet) { + size += pb::CodedOutputStream.ComputeStringSize(12, Street); + } + if (hasFirstName) { + size += pb::CodedOutputStream.ComputeStringSize(13, FirstName); + } + if (hasLastName) { + size += pb::CodedOutputStream.ComputeStringSize(14, LastName); + } + if (hasBirthDate) { + size += pb::CodedOutputStream.ComputeUInt64Size(15, BirthDate); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static Wallet ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Wallet ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Wallet ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Wallet ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Wallet ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Wallet ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Wallet ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Wallet ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Wallet ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Wallet ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Wallet MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Wallet prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Wallet cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Wallet result; + + private Wallet PrepareBuilder() { + if (resultIsReadOnly) { + Wallet original = result; + result = new Wallet(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Wallet MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.account.Wallet.Descriptor; } + } + + public override Wallet DefaultInstanceForType { + get { return global::bnet.protocol.account.Wallet.DefaultInstance; } + } + + public override Wallet BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Wallet) { + return MergeFrom((Wallet) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Wallet other) { + if (other == global::bnet.protocol.account.Wallet.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasRegion) { + Region = other.Region; + } + if (other.HasWalletId) { + WalletId = other.WalletId; + } + if (other.HasWalletType) { + WalletType = other.WalletType; + } + if (other.HasDescription) { + Description = other.Description; + } + if (other.HasCountryId) { + CountryId = other.CountryId; + } + if (other.HasState) { + State = other.State; + } + if (other.HasCity) { + City = other.City; + } + if (other.HasPostalCode) { + PostalCode = other.PostalCode; + } + if (other.HasPaymentInfo) { + PaymentInfo = other.PaymentInfo; + } + if (other.HasBin) { + Bin = other.Bin; + } + if (other.HasLocaleId) { + LocaleId = other.LocaleId; + } + if (other.HasStreet) { + Street = other.Street; + } + if (other.HasFirstName) { + FirstName = other.FirstName; + } + if (other.HasLastName) { + LastName = other.LastName; + } + if (other.HasBirthDate) { + BirthDate = other.BirthDate; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_walletFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _walletFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasRegion = input.ReadUInt32(ref result.region_); + break; + } + case 16: { + result.hasWalletId = input.ReadUInt64(ref result.walletId_); + break; + } + case 24: { + result.hasWalletType = input.ReadUInt32(ref result.walletType_); + break; + } + case 34: { + result.hasDescription = input.ReadString(ref result.description_); + break; + } + case 40: { + result.hasCountryId = input.ReadUInt32(ref result.countryId_); + break; + } + case 50: { + result.hasState = input.ReadString(ref result.state_); + break; + } + case 58: { + result.hasCity = input.ReadString(ref result.city_); + break; + } + case 66: { + result.hasPostalCode = input.ReadString(ref result.postalCode_); + break; + } + case 74: { + result.hasPaymentInfo = input.ReadBytes(ref result.paymentInfo_); + break; + } + case 82: { + result.hasBin = input.ReadString(ref result.bin_); + break; + } + case 90: { + result.hasLocaleId = input.ReadString(ref result.localeId_); + break; + } + case 98: { + result.hasStreet = input.ReadString(ref result.street_); + break; + } + case 106: { + result.hasFirstName = input.ReadString(ref result.firstName_); + break; + } + case 114: { + result.hasLastName = input.ReadString(ref result.lastName_); + break; + } + case 120: { + result.hasBirthDate = input.ReadUInt64(ref result.birthDate_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasRegion { + get { return result.hasRegion; } + } + public uint Region { + get { return result.Region; } + set { SetRegion(value); } + } + public Builder SetRegion(uint value) { + PrepareBuilder(); + result.hasRegion = true; + result.region_ = value; + return this; + } + public Builder ClearRegion() { + PrepareBuilder(); + result.hasRegion = false; + result.region_ = 0; + return this; + } + + public bool HasWalletId { + get { return result.hasWalletId; } + } + public ulong WalletId { + get { return result.WalletId; } + set { SetWalletId(value); } + } + public Builder SetWalletId(ulong value) { + PrepareBuilder(); + result.hasWalletId = true; + result.walletId_ = value; + return this; + } + public Builder ClearWalletId() { + PrepareBuilder(); + result.hasWalletId = false; + result.walletId_ = 0UL; + return this; + } + + public bool HasWalletType { + get { return result.hasWalletType; } + } + public uint WalletType { + get { return result.WalletType; } + set { SetWalletType(value); } + } + public Builder SetWalletType(uint value) { + PrepareBuilder(); + result.hasWalletType = true; + result.walletType_ = value; + return this; + } + public Builder ClearWalletType() { + PrepareBuilder(); + result.hasWalletType = false; + result.walletType_ = 0; + return this; + } + + public bool HasDescription { + get { return result.hasDescription; } + } + public string Description { + get { return result.Description; } + set { SetDescription(value); } + } + public Builder SetDescription(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasDescription = true; + result.description_ = value; + return this; + } + public Builder ClearDescription() { + PrepareBuilder(); + result.hasDescription = false; + result.description_ = ""; + return this; + } + + public bool HasCountryId { + get { return result.hasCountryId; } + } + public uint CountryId { + get { return result.CountryId; } + set { SetCountryId(value); } + } + public Builder SetCountryId(uint value) { + PrepareBuilder(); + result.hasCountryId = true; + result.countryId_ = value; + return this; + } + public Builder ClearCountryId() { + PrepareBuilder(); + result.hasCountryId = false; + result.countryId_ = 0; + return this; + } + + public bool HasState { + get { return result.hasState; } + } + public string State { + get { return result.State; } + set { SetState(value); } + } + public Builder SetState(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasState = true; + result.state_ = value; + return this; + } + public Builder ClearState() { + PrepareBuilder(); + result.hasState = false; + result.state_ = ""; + return this; + } + + public bool HasCity { + get { return result.hasCity; } + } + public string City { + get { return result.City; } + set { SetCity(value); } + } + public Builder SetCity(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasCity = true; + result.city_ = value; + return this; + } + public Builder ClearCity() { + PrepareBuilder(); + result.hasCity = false; + result.city_ = ""; + return this; + } + + public bool HasPostalCode { + get { return result.hasPostalCode; } + } + public string PostalCode { + get { return result.PostalCode; } + set { SetPostalCode(value); } + } + public Builder SetPostalCode(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPostalCode = true; + result.postalCode_ = value; + return this; + } + public Builder ClearPostalCode() { + PrepareBuilder(); + result.hasPostalCode = false; + result.postalCode_ = ""; + return this; + } + + public bool HasPaymentInfo { + get { return result.hasPaymentInfo; } + } + public pb::ByteString PaymentInfo { + get { return result.PaymentInfo; } + set { SetPaymentInfo(value); } + } + public Builder SetPaymentInfo(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPaymentInfo = true; + result.paymentInfo_ = value; + return this; + } + public Builder ClearPaymentInfo() { + PrepareBuilder(); + result.hasPaymentInfo = false; + result.paymentInfo_ = pb::ByteString.Empty; + return this; + } + + public bool HasBin { + get { return result.hasBin; } + } + public string Bin { + get { return result.Bin; } + set { SetBin(value); } + } + public Builder SetBin(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBin = true; + result.bin_ = value; + return this; + } + public Builder ClearBin() { + PrepareBuilder(); + result.hasBin = false; + result.bin_ = ""; + return this; + } + + public bool HasLocaleId { + get { return result.hasLocaleId; } + } + public string LocaleId { + get { return result.LocaleId; } + set { SetLocaleId(value); } + } + public Builder SetLocaleId(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasLocaleId = true; + result.localeId_ = value; + return this; + } + public Builder ClearLocaleId() { + PrepareBuilder(); + result.hasLocaleId = false; + result.localeId_ = ""; + return this; + } + + public bool HasStreet { + get { return result.hasStreet; } + } + public string Street { + get { return result.Street; } + set { SetStreet(value); } + } + public Builder SetStreet(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasStreet = true; + result.street_ = value; + return this; + } + public Builder ClearStreet() { + PrepareBuilder(); + result.hasStreet = false; + result.street_ = ""; + return this; + } + + public bool HasFirstName { + get { return result.hasFirstName; } + } + public string FirstName { + get { return result.FirstName; } + set { SetFirstName(value); } + } + public Builder SetFirstName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasFirstName = true; + result.firstName_ = value; + return this; + } + public Builder ClearFirstName() { + PrepareBuilder(); + result.hasFirstName = false; + result.firstName_ = ""; + return this; + } + + public bool HasLastName { + get { return result.hasLastName; } + } + public string LastName { + get { return result.LastName; } + set { SetLastName(value); } + } + public Builder SetLastName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasLastName = true; + result.lastName_ = value; + return this; + } + public Builder ClearLastName() { + PrepareBuilder(); + result.hasLastName = false; + result.lastName_ = ""; + return this; + } + + public bool HasBirthDate { + get { return result.hasBirthDate; } + } + public ulong BirthDate { + get { return result.BirthDate; } + set { SetBirthDate(value); } + } + public Builder SetBirthDate(ulong value) { + PrepareBuilder(); + result.hasBirthDate = true; + result.birthDate_ = value; + return this; + } + public Builder ClearBirthDate() { + PrepareBuilder(); + result.hasBirthDate = false; + result.birthDate_ = 0UL; + return this; + } + } + static Wallet() { + object.ReferenceEquals(global::bnet.protocol.account.AccountTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Wallets : pb::GeneratedMessage { + private Wallets() { } + private static readonly Wallets defaultInstance = new Wallets().MakeReadOnly(); + private static readonly string[] _walletsFieldNames = new string[] { "wallets" }; + private static readonly uint[] _walletsFieldTags = new uint[] { 10 }; + public static Wallets DefaultInstance { + get { return defaultInstance; } + } + + public override Wallets DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Wallets ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.account.AccountTypes.internal__static_bnet_protocol_account_Wallets__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.account.AccountTypes.internal__static_bnet_protocol_account_Wallets__FieldAccessorTable; } + } + + public const int Wallets_FieldNumber = 1; + private pbc::PopsicleList wallets_ = new pbc::PopsicleList(); + public scg::IList Wallets_List { + get { return wallets_; } + } + public int Wallets_Count { + get { return wallets_.Count; } + } + public global::bnet.protocol.account.Wallet GetWallets_(int index) { + return wallets_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.account.Wallet element in wallets_) + { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _walletsFieldNames; + if (wallets_.Count > 0) { + output.WriteMessageArray(1, field_names[0], wallets_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.account.Wallet element in Wallets_List) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static Wallets ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Wallets ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Wallets ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Wallets ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Wallets ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Wallets ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Wallets ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Wallets ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Wallets ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Wallets ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Wallets MakeReadOnly() { + wallets_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Wallets prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Wallets cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Wallets result; + + private Wallets PrepareBuilder() { + if (resultIsReadOnly) { + Wallets original = result; + result = new Wallets(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Wallets MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.account.Wallets.Descriptor; } + } + + public override Wallets DefaultInstanceForType { + get { return global::bnet.protocol.account.Wallets.DefaultInstance; } + } + + public override Wallets BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Wallets) { + return MergeFrom((Wallets) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Wallets other) { + if (other == global::bnet.protocol.account.Wallets.DefaultInstance) return this; + PrepareBuilder(); + if (other.wallets_.Count != 0) { + result.wallets_.Add(other.wallets_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_walletsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _walletsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.wallets_, global::bnet.protocol.account.Wallet.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList Wallets_List { + get { return PrepareBuilder().wallets_; } + } + public int Wallets_Count { + get { return result.Wallets_Count; } + } + public global::bnet.protocol.account.Wallet GetWallets_(int index) { + return result.GetWallets_(index); + } + public Builder SetWallets_(int index, global::bnet.protocol.account.Wallet value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.wallets_[index] = value; + return this; + } + public Builder SetWallets_(int index, global::bnet.protocol.account.Wallet.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.wallets_[index] = builderForValue.Build(); + return this; + } + public Builder AddWallets_(global::bnet.protocol.account.Wallet value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.wallets_.Add(value); + return this; + } + public Builder AddWallets_(global::bnet.protocol.account.Wallet.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.wallets_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeWallets_(scg::IEnumerable values) { + PrepareBuilder(); + result.wallets_.Add(values); + return this; + } + public Builder ClearWallets_() { + PrepareBuilder(); + result.wallets_.Clear(); + return this; + } + } + static Wallets() { + object.ReferenceEquals(global::bnet.protocol.account.AccountTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class CurrencyRestriction : pb::GeneratedMessage { + private CurrencyRestriction() { } + private static readonly CurrencyRestriction defaultInstance = new CurrencyRestriction().MakeReadOnly(); + private static readonly string[] _currencyRestrictionFieldNames = new string[] { "authenticator_cap", "currency", "soft_cap" }; + private static readonly uint[] _currencyRestrictionFieldTags = new uint[] { 18, 10, 26 }; + public static CurrencyRestriction DefaultInstance { + get { return defaultInstance; } + } + + public override CurrencyRestriction DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override CurrencyRestriction ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.account.AccountTypes.internal__static_bnet_protocol_account_CurrencyRestriction__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.account.AccountTypes.internal__static_bnet_protocol_account_CurrencyRestriction__FieldAccessorTable; } + } + + public const int CurrencyFieldNumber = 1; + private bool hasCurrency; + private string currency_ = ""; + public bool HasCurrency { + get { return hasCurrency; } + } + public string Currency { + get { return currency_; } + } + + public const int AuthenticatorCapFieldNumber = 2; + private bool hasAuthenticatorCap; + private string authenticatorCap_ = ""; + public bool HasAuthenticatorCap { + get { return hasAuthenticatorCap; } + } + public string AuthenticatorCap { + get { return authenticatorCap_; } + } + + public const int SoftCapFieldNumber = 3; + private bool hasSoftCap; + private string softCap_ = ""; + public bool HasSoftCap { + get { return hasSoftCap; } + } + public string SoftCap { + get { return softCap_; } + } + + public override bool IsInitialized { + get { + if (!hasCurrency) return false; + if (!hasAuthenticatorCap) return false; + if (!hasSoftCap) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _currencyRestrictionFieldNames; + if (hasCurrency) { + output.WriteString(1, field_names[1], Currency); + } + if (hasAuthenticatorCap) { + output.WriteString(2, field_names[0], AuthenticatorCap); + } + if (hasSoftCap) { + output.WriteString(3, field_names[2], SoftCap); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasCurrency) { + size += pb::CodedOutputStream.ComputeStringSize(1, Currency); + } + if (hasAuthenticatorCap) { + size += pb::CodedOutputStream.ComputeStringSize(2, AuthenticatorCap); + } + if (hasSoftCap) { + size += pb::CodedOutputStream.ComputeStringSize(3, SoftCap); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static CurrencyRestriction ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CurrencyRestriction ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CurrencyRestriction ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CurrencyRestriction ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CurrencyRestriction ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CurrencyRestriction ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static CurrencyRestriction ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static CurrencyRestriction ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static CurrencyRestriction ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CurrencyRestriction ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CurrencyRestriction MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(CurrencyRestriction prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CurrencyRestriction cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CurrencyRestriction result; + + private CurrencyRestriction PrepareBuilder() { + if (resultIsReadOnly) { + CurrencyRestriction original = result; + result = new CurrencyRestriction(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CurrencyRestriction MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.account.CurrencyRestriction.Descriptor; } + } + + public override CurrencyRestriction DefaultInstanceForType { + get { return global::bnet.protocol.account.CurrencyRestriction.DefaultInstance; } + } + + public override CurrencyRestriction BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is CurrencyRestriction) { + return MergeFrom((CurrencyRestriction) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(CurrencyRestriction other) { + if (other == global::bnet.protocol.account.CurrencyRestriction.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasCurrency) { + Currency = other.Currency; + } + if (other.HasAuthenticatorCap) { + AuthenticatorCap = other.AuthenticatorCap; + } + if (other.HasSoftCap) { + SoftCap = other.SoftCap; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_currencyRestrictionFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _currencyRestrictionFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasCurrency = input.ReadString(ref result.currency_); + break; + } + case 18: { + result.hasAuthenticatorCap = input.ReadString(ref result.authenticatorCap_); + break; + } + case 26: { + result.hasSoftCap = input.ReadString(ref result.softCap_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasCurrency { + get { return result.hasCurrency; } + } + public string Currency { + get { return result.Currency; } + set { SetCurrency(value); } + } + public Builder SetCurrency(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasCurrency = true; + result.currency_ = value; + return this; + } + public Builder ClearCurrency() { + PrepareBuilder(); + result.hasCurrency = false; + result.currency_ = ""; + return this; + } + + public bool HasAuthenticatorCap { + get { return result.hasAuthenticatorCap; } + } + public string AuthenticatorCap { + get { return result.AuthenticatorCap; } + set { SetAuthenticatorCap(value); } + } + public Builder SetAuthenticatorCap(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAuthenticatorCap = true; + result.authenticatorCap_ = value; + return this; + } + public Builder ClearAuthenticatorCap() { + PrepareBuilder(); + result.hasAuthenticatorCap = false; + result.authenticatorCap_ = ""; + return this; + } + + public bool HasSoftCap { + get { return result.hasSoftCap; } + } + public string SoftCap { + get { return result.SoftCap; } + set { SetSoftCap(value); } + } + public Builder SetSoftCap(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasSoftCap = true; + result.softCap_ = value; + return this; + } + public Builder ClearSoftCap() { + PrepareBuilder(); + result.hasSoftCap = false; + result.softCap_ = ""; + return this; + } + } + static CurrencyRestriction() { + object.ReferenceEquals(global::bnet.protocol.account.AccountTypes.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/LibMooNet/bnet/protocol/achievements/AchievementsService.cs b/src/LibMooNet/bnet/protocol/achievements/AchievementsService.cs new file mode 100644 index 00000000..8c6abb61 --- /dev/null +++ b/src/LibMooNet/bnet/protocol/achievements/AchievementsService.cs @@ -0,0 +1,10450 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace bnet.protocol.achievements { + + namespace Proto { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class AchievementsService { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_AchievementUpdateRecord__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_AchievementUpdateRecord__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_CriteriaUpdateRecord__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_CriteriaUpdateRecord__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_PostUpdateRecord__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_PostUpdateRecord__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_PostUpdateRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_PostUpdateRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_PostUpdateResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_PostUpdateResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_RegisterWithServiceRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_RegisterWithServiceRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_RegisterWithServiceResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_RegisterWithServiceResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_UnregisterFromServiceRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_UnregisterFromServiceRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_Snapshot__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_Snapshot__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_RequestSnapshotRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_RequestSnapshotRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_RequestSnapshotResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_RequestSnapshotResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_InitializeRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_InitializeRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_InitializeResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_InitializeResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_StaticDataHash__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_StaticDataHash__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_ValidateStaticDataRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_ValidateStaticDataRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_SnapshotUpdateNotification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_SnapshotUpdateNotification__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_FlushFrequencyUpdateNotification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_FlushFrequencyUpdateNotification__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_AchievementStats__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_AchievementStats__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_GetAchievementStatsRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_GetAchievementStatsRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_GetAchievementStatsResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_GetAchievementStatsResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_GetCriteriaStatsRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_GetCriteriaStatsRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_GetCriteriaStatsResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_GetCriteriaStatsResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_RevokeAchievementRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_RevokeAchievementRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_RevokeAchievementResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_RevokeAchievementResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_UpdateCriteriaRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_UpdateCriteriaRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_GrantAchievementRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_GrantAchievementRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_GrantAchievementResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_GrantAchievementResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_CacheKillRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_CacheKillRequest__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static AchievementsService() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "Ch9ibmV0L2FjaGlldmVtZW50c19zZXJ2aWNlLnByb3RvEhpibmV0LnByb3Rv" + + "Y29sLmFjaGlldmVtZW50cxoOYm5ldC9ycGMucHJvdG8aEWJuZXQvZW50aXR5" + + "LnByb3RvGhlibmV0L2NvbnRlbnRfaGFuZGxlLnByb3RvIkUKF0FjaGlldmVt" + + "ZW50VXBkYXRlUmVjb3JkEhYKDmFjaGlldmVtZW50X2lkGAEgAigEEhIKCmNv" + + "bXBsZXRpb24YAiACKAUibAoUQ3JpdGVyaWFVcGRhdGVSZWNvcmQSIgoaY3Jp" + + "dGVyaWFfSWRfMzJfYW5kX2ZsYWdzXzgYASACKA0SGAoNc3RhcnRfdGltZV8z" + + "MhgCIAEoDToBMBIWCgtxdWFudGl0eV8zMhgDIAEoDToBMCKCAQoQUG9zdFVw" + + "ZGF0ZVJlY29yZBIqCgl0YXJnZXRfaWQYASACKAsyFy5ibmV0LnByb3RvY29s" + + "LkVudGl0eUlkEkIKCGNyaXRlcmlhGAIgAygLMjAuYm5ldC5wcm90b2NvbC5h" + + "Y2hpZXZlbWVudHMuQ3JpdGVyaWFVcGRhdGVSZWNvcmQihwEKEVBvc3RVcGRh" + + "dGVSZXF1ZXN0EkgKEnBvc3RfdXBkYXRlX3JlY29yZBgBIAMoCzIsLmJuZXQu" + + "cHJvdG9jb2wuYWNoaWV2ZW1lbnRzLlBvc3RVcGRhdGVSZWNvcmQSFQoKcHJv" + + "Z3JhbV9pZBgCIAEoBzoBMBIRCgZhdGlfaWQYAyABKA06ATAiKAoSUG9zdFVw" + + "ZGF0ZVJlc3BvbnNlEhIKCmVycm9yX2NvZGUYASADKA0ioQEKGlJlZ2lzdGVy" + + "V2l0aFNlcnZpY2VSZXF1ZXN0EioKCXRhcmdldF9pZBgBIAIoCzIXLmJuZXQu" + + "cHJvdG9jb2wuRW50aXR5SWQSEQoJb2JqZWN0X2lkGAIgAigEEhoKEnJlZ2lz" + + "dHJhdGlvbl9mbGFncxgDIAEoDRIVCgpwcm9ncmFtX2lkGAQgASgHOgEwEhEK" + + "BmF0aV9pZBgFIAEoDToBMCJxChtSZWdpc3RlcldpdGhTZXJ2aWNlUmVzcG9u" + + "c2USNgoIc25hcHNob3QYASABKAsyJC5ibmV0LnByb3RvY29sLmFjaGlldmVt" + + "ZW50cy5TbmFwc2hvdBIaChJyZWdpc3RyYXRpb25fZmxhZ3MYAiABKA0icAoc" + + "VW5yZWdpc3RlckZyb21TZXJ2aWNlUmVxdWVzdBIqCgl0YXJnZXRfaWQYASAC" + + "KAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEhEKCW9iamVjdF9pZBgCIAIo" + + "BBIRCgZhdGlfaWQYAyABKA06ATAivQEKCFNuYXBzaG90ElEKFGFjaGlldmVt" + + "ZW50X3NuYXBzaG90GAEgAygLMjMuYm5ldC5wcm90b2NvbC5hY2hpZXZlbWVu" + + "dHMuQWNoaWV2ZW1lbnRVcGRhdGVSZWNvcmQSSwoRY3JpdGVyaWFfc25hcHNo" + + "b3QYAiADKAsyMC5ibmV0LnByb3RvY29sLmFjaGlldmVtZW50cy5Dcml0ZXJp" + + "YVVwZGF0ZVJlY29yZBIRCgZoZWFkZXIYAyABKAQ6ATAiawoWUmVxdWVzdFNu" + + "YXBzaG90UmVxdWVzdBIqCgllbnRpdHlfaWQYASACKAsyFy5ibmV0LnByb3Rv" + + "Y29sLkVudGl0eUlkEg4KBmZpbHRlchgCIAIoDRIVCgpwcm9ncmFtX2lkGAMg" + + "ASgHOgEwIlEKF1JlcXVlc3RTbmFwc2hvdFJlc3BvbnNlEjYKCHNuYXBzaG90" + + "GAEgASgLMiQuYm5ldC5wcm90b2NvbC5hY2hpZXZlbWVudHMuU25hcHNob3Qi" + + "PQoRSW5pdGlhbGl6ZVJlcXVlc3QSFQoKcHJvZ3JhbV9pZBgBIAEoBzoBMBIR" + + "CglvYmplY3RfaWQYAiACKAQi8wEKEkluaXRpYWxpemVSZXNwb25zZRI0Cg5j" + + "b250ZW50X2hhbmRsZRgBIAIoCzIcLmJuZXQucHJvdG9jb2wuQ29udGVudEhh" + + "bmRsZRIhChZtYXhfcmVjb3Jkc19wZXJfdXBkYXRlGAIgASgNOgEwEiIKF21h" + + "eF9jcml0ZXJpYV9wZXJfcmVjb3JkGAMgASgNOgEwEiYKG21heF9hY2hpZXZl" + + "bWVudHNfcGVyX3JlY29yZBgEIAEoDToBMBIcChFtYXhfcmVnaXN0cmF0aW9u" + + "cxgFIAEoDToBMBIaCg9mbHVzaF9mcmVxdWVuY3kYBiABKAQ6ATAiMgoOU3Rh" + + "dGljRGF0YUhhc2gSEgoKcHJvZ3JhbV9pZBgBIAIoBxIMCgRoYXNoGAIgAigJ" + + "ImEKGVZhbGlkYXRlU3RhdGljRGF0YVJlcXVlc3QSRAoQc3RhdGljX2RhdGFf" + + "aGFzaBgBIAMoCzIqLmJuZXQucHJvdG9jb2wuYWNoaWV2ZW1lbnRzLlN0YXRp" + + "Y0RhdGFIYXNoIoABChpTbmFwc2hvdFVwZGF0ZU5vdGlmaWNhdGlvbhIqCgl0" + + "YXJnZXRfaWQYASACKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEjYKCHNu" + + "YXBzaG90GAIgAigLMiQuYm5ldC5wcm90b2NvbC5hY2hpZXZlbWVudHMuU25h" + + "cHNob3QiOwogRmx1c2hGcmVxdWVuY3lVcGRhdGVOb3RpZmljYXRpb24SFwoP" + + "Zmx1c2hfZnJlcXVlbmN5GAEgAigEIi0KEEFjaGlldmVtZW50U3RhdHMSCgoC" + + "aWQYASACKAQSDQoFY291bnQYAiACKAQiMAoaR2V0QWNoaWV2ZW1lbnRTdGF0" + + "c1JlcXVlc3QSEgoKcHJvZ3JhbV9pZBgBIAIoByJaChtHZXRBY2hpZXZlbWVu" + + "dFN0YXRzUmVzcG9uc2USOwoFc3RhdHMYASADKAsyLC5ibmV0LnByb3RvY29s" + + "LmFjaGlldmVtZW50cy5BY2hpZXZlbWVudFN0YXRzIi0KF0dldENyaXRlcmlh" + + "U3RhdHNSZXF1ZXN0EhIKCnByb2dyYW1faWQYASACKAciVwoYR2V0Q3JpdGVy" + + "aWFTdGF0c1Jlc3BvbnNlEjsKBXN0YXRzGAEgAygLMiwuYm5ldC5wcm90b2Nv" + + "bC5hY2hpZXZlbWVudHMuQWNoaWV2ZW1lbnRTdGF0cyJSChhSZXZva2VBY2hp" + + "ZXZlbWVudFJlcXVlc3QSKgoJZW50aXR5X2lkGAEgAigLMhcuYm5ldC5wcm90" + + "b2NvbC5FbnRpdHlJZBIKCgJpZBgCIAIoBCI1ChlSZXZva2VBY2hpZXZlbWVu" + + "dFJlc3BvbnNlEhgKDXJldm9rZWRfY291bnQYASABKA06ATAicwoVVXBkYXRl" + + "Q3JpdGVyaWFSZXF1ZXN0EioKCWVudGl0eV9pZBgBIAIoCzIXLmJuZXQucHJv" + + "dG9jb2wuRW50aXR5SWQSCgoCaWQYAiACKAQSEAoIcXVhbnRpdHkYAyACKAQS" + + "EAoFZmxhZ3MYBCABKA06ATAiUQoXR3JhbnRBY2hpZXZlbWVudFJlcXVlc3QS" + + "KgoJZW50aXR5X2lkGAEgAigLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBIK" + + "CgJpZBgCIAIoBCI0ChhHcmFudEFjaGlldmVtZW50UmVzcG9uc2USGAoNZ3Jh" + + "bnRlZF9jb3VudBgBIAEoDToBMCI+ChBDYWNoZUtpbGxSZXF1ZXN0EioKCWVu" + + "dGl0eV9pZBgBIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQy5wUKE0Fj" + + "aGlldmVtZW50c1NlcnZpY2UScQoKUG9zdFVwZGF0ZRItLmJuZXQucHJvdG9j" + + "b2wuYWNoaWV2ZW1lbnRzLlBvc3RVcGRhdGVSZXF1ZXN0Gi4uYm5ldC5wcm90" + + "b2NvbC5hY2hpZXZlbWVudHMuUG9zdFVwZGF0ZVJlc3BvbnNlIgSAtRgBEowB" + + "ChNSZWdpc3RlcldpdGhTZXJ2aWNlEjYuYm5ldC5wcm90b2NvbC5hY2hpZXZl" + + "bWVudHMuUmVnaXN0ZXJXaXRoU2VydmljZVJlcXVlc3QaNy5ibmV0LnByb3Rv" + + "Y29sLmFjaGlldmVtZW50cy5SZWdpc3RlcldpdGhTZXJ2aWNlUmVzcG9uc2Ui" + + "BIC1GAISgAEKD1JlcXVlc3RTbmFwc2hvdBIyLmJuZXQucHJvdG9jb2wuYWNo" + + "aWV2ZW1lbnRzLlJlcXVlc3RTbmFwc2hvdFJlcXVlc3QaMy5ibmV0LnByb3Rv" + + "Y29sLmFjaGlldmVtZW50cy5SZXF1ZXN0U25hcHNob3RSZXNwb25zZSIEgLUY" + + "AxJuChVVbnJlZ2lzdGVyRnJvbVNlcnZpY2USOC5ibmV0LnByb3RvY29sLmFj" + + "aGlldmVtZW50cy5VbnJlZ2lzdGVyRnJvbVNlcnZpY2VSZXF1ZXN0GhUuYm5l" + + "dC5wcm90b2NvbC5Ob0RhdGEiBIC1GAQScQoKSW5pdGlhbGl6ZRItLmJuZXQu" + + "cHJvdG9jb2wuYWNoaWV2ZW1lbnRzLkluaXRpYWxpemVSZXF1ZXN0Gi4uYm5l" + + "dC5wcm90b2NvbC5hY2hpZXZlbWVudHMuSW5pdGlhbGl6ZVJlc3BvbnNlIgSA" + + "tRgFEmgKElZhbGlkYXRlU3RhdGljRGF0YRI1LmJuZXQucHJvdG9jb2wuYWNo" + + "aWV2ZW1lbnRzLlZhbGlkYXRlU3RhdGljRGF0YVJlcXVlc3QaFS5ibmV0LnBy" + + "b3RvY29sLk5vRGF0YSIEgLUYBjKEAgoSQWNoaWV2ZW1lbnRzTm90aWZ5EnAK" + + "FE5vdGlmeVNuYXBzaG90VXBkYXRlEjYuYm5ldC5wcm90b2NvbC5hY2hpZXZl" + + "bWVudHMuU25hcHNob3RVcGRhdGVOb3RpZmljYXRpb24aGi5ibmV0LnByb3Rv" + + "Y29sLk5PX1JFU1BPTlNFIgSAtRgBEnwKGk5vdGlmeUZsdXNoRnJlcXVlbmN5" + + "VXBkYXRlEjwuYm5ldC5wcm90b2NvbC5hY2hpZXZlbWVudHMuRmx1c2hGcmVx" + + "dWVuY3lVcGRhdGVOb3RpZmljYXRpb24aGi5ibmV0LnByb3RvY29sLk5PX1JF" + + "U1BPTlNFIgSAtRgCMvEFChFBY2hpZXZlbWVudHNVdGlscxKMAQoTR2V0QWNo" + + "aWV2ZW1lbnRTdGF0cxI2LmJuZXQucHJvdG9jb2wuYWNoaWV2ZW1lbnRzLkdl" + + "dEFjaGlldmVtZW50U3RhdHNSZXF1ZXN0GjcuYm5ldC5wcm90b2NvbC5hY2hp" + + "ZXZlbWVudHMuR2V0QWNoaWV2ZW1lbnRTdGF0c1Jlc3BvbnNlIgSAtRgBEoMB" + + "ChBHZXRDcml0ZXJpYVN0YXRzEjMuYm5ldC5wcm90b2NvbC5hY2hpZXZlbWVu" + + "dHMuR2V0Q3JpdGVyaWFTdGF0c1JlcXVlc3QaNC5ibmV0LnByb3RvY29sLmFj" + + "aGlldmVtZW50cy5HZXRDcml0ZXJpYVN0YXRzUmVzcG9uc2UiBIC1GAIShgEK" + + "EVJldm9rZUFjaGlldmVtZW50EjQuYm5ldC5wcm90b2NvbC5hY2hpZXZlbWVu" + + "dHMuUmV2b2tlQWNoaWV2ZW1lbnRSZXF1ZXN0GjUuYm5ldC5wcm90b2NvbC5h" + + "Y2hpZXZlbWVudHMuUmV2b2tlQWNoaWV2ZW1lbnRSZXNwb25zZSIEgLUYAxJg" + + "Cg5VcGRhdGVDcml0ZXJpYRIxLmJuZXQucHJvdG9jb2wuYWNoaWV2ZW1lbnRz" + + "LlVwZGF0ZUNyaXRlcmlhUmVxdWVzdBoVLmJuZXQucHJvdG9jb2wuTm9EYXRh" + + "IgSAtRgEEoMBChBHcmFudEFjaGlldmVtZW50EjMuYm5ldC5wcm90b2NvbC5h" + + "Y2hpZXZlbWVudHMuR3JhbnRBY2hpZXZlbWVudFJlcXVlc3QaNC5ibmV0LnBy" + + "b3RvY29sLmFjaGlldmVtZW50cy5HcmFudEFjaGlldmVtZW50UmVzcG9uc2Ui" + + "BIC1GAUSVgoJQ2FjaGVLaWxsEiwuYm5ldC5wcm90b2NvbC5hY2hpZXZlbWVu" + + "dHMuQ2FjaGVLaWxsUmVxdWVzdBoVLmJuZXQucHJvdG9jb2wuTm9EYXRhIgSA" + + "tRgGQgOAAQA="); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_bnet_protocol_achievements_AchievementUpdateRecord__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_achievements_AchievementUpdateRecord__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_AchievementUpdateRecord__Descriptor, + new string[] { "AchievementId", "Completion", }); + internal__static_bnet_protocol_achievements_CriteriaUpdateRecord__Descriptor = Descriptor.MessageTypes[1]; + internal__static_bnet_protocol_achievements_CriteriaUpdateRecord__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_CriteriaUpdateRecord__Descriptor, + new string[] { "CriteriaId32AndFlags8", "StartTime32", "Quantity32", }); + internal__static_bnet_protocol_achievements_PostUpdateRecord__Descriptor = Descriptor.MessageTypes[2]; + internal__static_bnet_protocol_achievements_PostUpdateRecord__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_PostUpdateRecord__Descriptor, + new string[] { "TargetId", "Criteria", }); + internal__static_bnet_protocol_achievements_PostUpdateRequest__Descriptor = Descriptor.MessageTypes[3]; + internal__static_bnet_protocol_achievements_PostUpdateRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_PostUpdateRequest__Descriptor, + new string[] { "PostUpdateRecord", "ProgramId", "AtiId", }); + internal__static_bnet_protocol_achievements_PostUpdateResponse__Descriptor = Descriptor.MessageTypes[4]; + internal__static_bnet_protocol_achievements_PostUpdateResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_PostUpdateResponse__Descriptor, + new string[] { "ErrorCode", }); + internal__static_bnet_protocol_achievements_RegisterWithServiceRequest__Descriptor = Descriptor.MessageTypes[5]; + internal__static_bnet_protocol_achievements_RegisterWithServiceRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_RegisterWithServiceRequest__Descriptor, + new string[] { "TargetId", "ObjectId", "RegistrationFlags", "ProgramId", "AtiId", }); + internal__static_bnet_protocol_achievements_RegisterWithServiceResponse__Descriptor = Descriptor.MessageTypes[6]; + internal__static_bnet_protocol_achievements_RegisterWithServiceResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_RegisterWithServiceResponse__Descriptor, + new string[] { "Snapshot", "RegistrationFlags", }); + internal__static_bnet_protocol_achievements_UnregisterFromServiceRequest__Descriptor = Descriptor.MessageTypes[7]; + internal__static_bnet_protocol_achievements_UnregisterFromServiceRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_UnregisterFromServiceRequest__Descriptor, + new string[] { "TargetId", "ObjectId", "AtiId", }); + internal__static_bnet_protocol_achievements_Snapshot__Descriptor = Descriptor.MessageTypes[8]; + internal__static_bnet_protocol_achievements_Snapshot__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_Snapshot__Descriptor, + new string[] { "AchievementSnapshot", "CriteriaSnapshot", "Header", }); + internal__static_bnet_protocol_achievements_RequestSnapshotRequest__Descriptor = Descriptor.MessageTypes[9]; + internal__static_bnet_protocol_achievements_RequestSnapshotRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_RequestSnapshotRequest__Descriptor, + new string[] { "EntityId", "Filter", "ProgramId", }); + internal__static_bnet_protocol_achievements_RequestSnapshotResponse__Descriptor = Descriptor.MessageTypes[10]; + internal__static_bnet_protocol_achievements_RequestSnapshotResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_RequestSnapshotResponse__Descriptor, + new string[] { "Snapshot", }); + internal__static_bnet_protocol_achievements_InitializeRequest__Descriptor = Descriptor.MessageTypes[11]; + internal__static_bnet_protocol_achievements_InitializeRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_InitializeRequest__Descriptor, + new string[] { "ProgramId", "ObjectId", }); + internal__static_bnet_protocol_achievements_InitializeResponse__Descriptor = Descriptor.MessageTypes[12]; + internal__static_bnet_protocol_achievements_InitializeResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_InitializeResponse__Descriptor, + new string[] { "ContentHandle", "MaxRecordsPerUpdate", "MaxCriteriaPerRecord", "MaxAchievementsPerRecord", "MaxRegistrations", "FlushFrequency", }); + internal__static_bnet_protocol_achievements_StaticDataHash__Descriptor = Descriptor.MessageTypes[13]; + internal__static_bnet_protocol_achievements_StaticDataHash__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_StaticDataHash__Descriptor, + new string[] { "ProgramId", "Hash", }); + internal__static_bnet_protocol_achievements_ValidateStaticDataRequest__Descriptor = Descriptor.MessageTypes[14]; + internal__static_bnet_protocol_achievements_ValidateStaticDataRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_ValidateStaticDataRequest__Descriptor, + new string[] { "StaticDataHash", }); + internal__static_bnet_protocol_achievements_SnapshotUpdateNotification__Descriptor = Descriptor.MessageTypes[15]; + internal__static_bnet_protocol_achievements_SnapshotUpdateNotification__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_SnapshotUpdateNotification__Descriptor, + new string[] { "TargetId", "Snapshot", }); + internal__static_bnet_protocol_achievements_FlushFrequencyUpdateNotification__Descriptor = Descriptor.MessageTypes[16]; + internal__static_bnet_protocol_achievements_FlushFrequencyUpdateNotification__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_FlushFrequencyUpdateNotification__Descriptor, + new string[] { "FlushFrequency", }); + internal__static_bnet_protocol_achievements_AchievementStats__Descriptor = Descriptor.MessageTypes[17]; + internal__static_bnet_protocol_achievements_AchievementStats__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_AchievementStats__Descriptor, + new string[] { "Id", "Count", }); + internal__static_bnet_protocol_achievements_GetAchievementStatsRequest__Descriptor = Descriptor.MessageTypes[18]; + internal__static_bnet_protocol_achievements_GetAchievementStatsRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_GetAchievementStatsRequest__Descriptor, + new string[] { "ProgramId", }); + internal__static_bnet_protocol_achievements_GetAchievementStatsResponse__Descriptor = Descriptor.MessageTypes[19]; + internal__static_bnet_protocol_achievements_GetAchievementStatsResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_GetAchievementStatsResponse__Descriptor, + new string[] { "Stats", }); + internal__static_bnet_protocol_achievements_GetCriteriaStatsRequest__Descriptor = Descriptor.MessageTypes[20]; + internal__static_bnet_protocol_achievements_GetCriteriaStatsRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_GetCriteriaStatsRequest__Descriptor, + new string[] { "ProgramId", }); + internal__static_bnet_protocol_achievements_GetCriteriaStatsResponse__Descriptor = Descriptor.MessageTypes[21]; + internal__static_bnet_protocol_achievements_GetCriteriaStatsResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_GetCriteriaStatsResponse__Descriptor, + new string[] { "Stats", }); + internal__static_bnet_protocol_achievements_RevokeAchievementRequest__Descriptor = Descriptor.MessageTypes[22]; + internal__static_bnet_protocol_achievements_RevokeAchievementRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_RevokeAchievementRequest__Descriptor, + new string[] { "EntityId", "Id", }); + internal__static_bnet_protocol_achievements_RevokeAchievementResponse__Descriptor = Descriptor.MessageTypes[23]; + internal__static_bnet_protocol_achievements_RevokeAchievementResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_RevokeAchievementResponse__Descriptor, + new string[] { "RevokedCount", }); + internal__static_bnet_protocol_achievements_UpdateCriteriaRequest__Descriptor = Descriptor.MessageTypes[24]; + internal__static_bnet_protocol_achievements_UpdateCriteriaRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_UpdateCriteriaRequest__Descriptor, + new string[] { "EntityId", "Id", "Quantity", "Flags", }); + internal__static_bnet_protocol_achievements_GrantAchievementRequest__Descriptor = Descriptor.MessageTypes[25]; + internal__static_bnet_protocol_achievements_GrantAchievementRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_GrantAchievementRequest__Descriptor, + new string[] { "EntityId", "Id", }); + internal__static_bnet_protocol_achievements_GrantAchievementResponse__Descriptor = Descriptor.MessageTypes[26]; + internal__static_bnet_protocol_achievements_GrantAchievementResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_GrantAchievementResponse__Descriptor, + new string[] { "GrantedCount", }); + internal__static_bnet_protocol_achievements_CacheKillRequest__Descriptor = Descriptor.MessageTypes[27]; + internal__static_bnet_protocol_achievements_CacheKillRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_CacheKillRequest__Descriptor, + new string[] { "EntityId", }); + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + RegisterAllExtensions(registry); + global::bnet.protocol.Rpc.RegisterAllExtensions(registry); + global::bnet.protocol.Entity.RegisterAllExtensions(registry); + global::bnet.protocol.Proto.ContentHandle.RegisterAllExtensions(registry); + return registry; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::bnet.protocol.Rpc.Descriptor, + global::bnet.protocol.Entity.Descriptor, + global::bnet.protocol.Proto.ContentHandle.Descriptor, + }, assigner); + } + #endregion + + } + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class AchievementUpdateRecord : pb::GeneratedMessage { + private AchievementUpdateRecord() { } + private static readonly AchievementUpdateRecord defaultInstance = new AchievementUpdateRecord().MakeReadOnly(); + private static readonly string[] _achievementUpdateRecordFieldNames = new string[] { "achievement_id", "completion" }; + private static readonly uint[] _achievementUpdateRecordFieldTags = new uint[] { 8, 16 }; + public static AchievementUpdateRecord DefaultInstance { + get { return defaultInstance; } + } + + public override AchievementUpdateRecord DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override AchievementUpdateRecord ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_AchievementUpdateRecord__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_AchievementUpdateRecord__FieldAccessorTable; } + } + + public const int AchievementIdFieldNumber = 1; + private bool hasAchievementId; + private ulong achievementId_; + public bool HasAchievementId { + get { return hasAchievementId; } + } + public ulong AchievementId { + get { return achievementId_; } + } + + public const int CompletionFieldNumber = 2; + private bool hasCompletion; + private int completion_; + public bool HasCompletion { + get { return hasCompletion; } + } + public int Completion { + get { return completion_; } + } + + public override bool IsInitialized { + get { + if (!hasAchievementId) return false; + if (!hasCompletion) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _achievementUpdateRecordFieldNames; + if (hasAchievementId) { + output.WriteUInt64(1, field_names[0], AchievementId); + } + if (hasCompletion) { + output.WriteInt32(2, field_names[1], Completion); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAchievementId) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, AchievementId); + } + if (hasCompletion) { + size += pb::CodedOutputStream.ComputeInt32Size(2, Completion); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static AchievementUpdateRecord ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AchievementUpdateRecord ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AchievementUpdateRecord ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AchievementUpdateRecord ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AchievementUpdateRecord ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AchievementUpdateRecord ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static AchievementUpdateRecord ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static AchievementUpdateRecord ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static AchievementUpdateRecord ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AchievementUpdateRecord ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private AchievementUpdateRecord MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(AchievementUpdateRecord prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(AchievementUpdateRecord cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private AchievementUpdateRecord result; + + private AchievementUpdateRecord PrepareBuilder() { + if (resultIsReadOnly) { + AchievementUpdateRecord original = result; + result = new AchievementUpdateRecord(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override AchievementUpdateRecord MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.AchievementUpdateRecord.Descriptor; } + } + + public override AchievementUpdateRecord DefaultInstanceForType { + get { return global::bnet.protocol.achievements.AchievementUpdateRecord.DefaultInstance; } + } + + public override AchievementUpdateRecord BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is AchievementUpdateRecord) { + return MergeFrom((AchievementUpdateRecord) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(AchievementUpdateRecord other) { + if (other == global::bnet.protocol.achievements.AchievementUpdateRecord.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAchievementId) { + AchievementId = other.AchievementId; + } + if (other.HasCompletion) { + Completion = other.Completion; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_achievementUpdateRecordFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _achievementUpdateRecordFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasAchievementId = input.ReadUInt64(ref result.achievementId_); + break; + } + case 16: { + result.hasCompletion = input.ReadInt32(ref result.completion_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAchievementId { + get { return result.hasAchievementId; } + } + public ulong AchievementId { + get { return result.AchievementId; } + set { SetAchievementId(value); } + } + public Builder SetAchievementId(ulong value) { + PrepareBuilder(); + result.hasAchievementId = true; + result.achievementId_ = value; + return this; + } + public Builder ClearAchievementId() { + PrepareBuilder(); + result.hasAchievementId = false; + result.achievementId_ = 0UL; + return this; + } + + public bool HasCompletion { + get { return result.hasCompletion; } + } + public int Completion { + get { return result.Completion; } + set { SetCompletion(value); } + } + public Builder SetCompletion(int value) { + PrepareBuilder(); + result.hasCompletion = true; + result.completion_ = value; + return this; + } + public Builder ClearCompletion() { + PrepareBuilder(); + result.hasCompletion = false; + result.completion_ = 0; + return this; + } + } + static AchievementUpdateRecord() { + object.ReferenceEquals(global::bnet.protocol.achievements.Proto.AchievementsService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class CriteriaUpdateRecord : pb::GeneratedMessage { + private CriteriaUpdateRecord() { } + private static readonly CriteriaUpdateRecord defaultInstance = new CriteriaUpdateRecord().MakeReadOnly(); + private static readonly string[] _criteriaUpdateRecordFieldNames = new string[] { "criteria_Id_32_and_flags_8", "quantity_32", "start_time_32" }; + private static readonly uint[] _criteriaUpdateRecordFieldTags = new uint[] { 8, 24, 16 }; + public static CriteriaUpdateRecord DefaultInstance { + get { return defaultInstance; } + } + + public override CriteriaUpdateRecord DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override CriteriaUpdateRecord ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_CriteriaUpdateRecord__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_CriteriaUpdateRecord__FieldAccessorTable; } + } + + public const int CriteriaId32AndFlags8FieldNumber = 1; + private bool hasCriteriaId32AndFlags8; + private uint criteriaId32AndFlags8_; + public bool HasCriteriaId32AndFlags8 { + get { return hasCriteriaId32AndFlags8; } + } + public uint CriteriaId32AndFlags8 { + get { return criteriaId32AndFlags8_; } + } + + public const int StartTime32FieldNumber = 2; + private bool hasStartTime32; + private uint startTime32_; + public bool HasStartTime32 { + get { return hasStartTime32; } + } + public uint StartTime32 { + get { return startTime32_; } + } + + public const int Quantity32FieldNumber = 3; + private bool hasQuantity32; + private uint quantity32_; + public bool HasQuantity32 { + get { return hasQuantity32; } + } + public uint Quantity32 { + get { return quantity32_; } + } + + public override bool IsInitialized { + get { + if (!hasCriteriaId32AndFlags8) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _criteriaUpdateRecordFieldNames; + if (hasCriteriaId32AndFlags8) { + output.WriteUInt32(1, field_names[0], CriteriaId32AndFlags8); + } + if (hasStartTime32) { + output.WriteUInt32(2, field_names[2], StartTime32); + } + if (hasQuantity32) { + output.WriteUInt32(3, field_names[1], Quantity32); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasCriteriaId32AndFlags8) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, CriteriaId32AndFlags8); + } + if (hasStartTime32) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, StartTime32); + } + if (hasQuantity32) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, Quantity32); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static CriteriaUpdateRecord ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CriteriaUpdateRecord ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CriteriaUpdateRecord ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CriteriaUpdateRecord ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CriteriaUpdateRecord ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CriteriaUpdateRecord ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static CriteriaUpdateRecord ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static CriteriaUpdateRecord ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static CriteriaUpdateRecord ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CriteriaUpdateRecord ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CriteriaUpdateRecord MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(CriteriaUpdateRecord prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CriteriaUpdateRecord cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CriteriaUpdateRecord result; + + private CriteriaUpdateRecord PrepareBuilder() { + if (resultIsReadOnly) { + CriteriaUpdateRecord original = result; + result = new CriteriaUpdateRecord(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CriteriaUpdateRecord MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.CriteriaUpdateRecord.Descriptor; } + } + + public override CriteriaUpdateRecord DefaultInstanceForType { + get { return global::bnet.protocol.achievements.CriteriaUpdateRecord.DefaultInstance; } + } + + public override CriteriaUpdateRecord BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is CriteriaUpdateRecord) { + return MergeFrom((CriteriaUpdateRecord) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(CriteriaUpdateRecord other) { + if (other == global::bnet.protocol.achievements.CriteriaUpdateRecord.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasCriteriaId32AndFlags8) { + CriteriaId32AndFlags8 = other.CriteriaId32AndFlags8; + } + if (other.HasStartTime32) { + StartTime32 = other.StartTime32; + } + if (other.HasQuantity32) { + Quantity32 = other.Quantity32; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_criteriaUpdateRecordFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _criteriaUpdateRecordFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasCriteriaId32AndFlags8 = input.ReadUInt32(ref result.criteriaId32AndFlags8_); + break; + } + case 16: { + result.hasStartTime32 = input.ReadUInt32(ref result.startTime32_); + break; + } + case 24: { + result.hasQuantity32 = input.ReadUInt32(ref result.quantity32_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasCriteriaId32AndFlags8 { + get { return result.hasCriteriaId32AndFlags8; } + } + public uint CriteriaId32AndFlags8 { + get { return result.CriteriaId32AndFlags8; } + set { SetCriteriaId32AndFlags8(value); } + } + public Builder SetCriteriaId32AndFlags8(uint value) { + PrepareBuilder(); + result.hasCriteriaId32AndFlags8 = true; + result.criteriaId32AndFlags8_ = value; + return this; + } + public Builder ClearCriteriaId32AndFlags8() { + PrepareBuilder(); + result.hasCriteriaId32AndFlags8 = false; + result.criteriaId32AndFlags8_ = 0; + return this; + } + + public bool HasStartTime32 { + get { return result.hasStartTime32; } + } + public uint StartTime32 { + get { return result.StartTime32; } + set { SetStartTime32(value); } + } + public Builder SetStartTime32(uint value) { + PrepareBuilder(); + result.hasStartTime32 = true; + result.startTime32_ = value; + return this; + } + public Builder ClearStartTime32() { + PrepareBuilder(); + result.hasStartTime32 = false; + result.startTime32_ = 0; + return this; + } + + public bool HasQuantity32 { + get { return result.hasQuantity32; } + } + public uint Quantity32 { + get { return result.Quantity32; } + set { SetQuantity32(value); } + } + public Builder SetQuantity32(uint value) { + PrepareBuilder(); + result.hasQuantity32 = true; + result.quantity32_ = value; + return this; + } + public Builder ClearQuantity32() { + PrepareBuilder(); + result.hasQuantity32 = false; + result.quantity32_ = 0; + return this; + } + } + static CriteriaUpdateRecord() { + object.ReferenceEquals(global::bnet.protocol.achievements.Proto.AchievementsService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class PostUpdateRecord : pb::GeneratedMessage { + private PostUpdateRecord() { } + private static readonly PostUpdateRecord defaultInstance = new PostUpdateRecord().MakeReadOnly(); + private static readonly string[] _postUpdateRecordFieldNames = new string[] { "criteria", "target_id" }; + private static readonly uint[] _postUpdateRecordFieldTags = new uint[] { 18, 10 }; + public static PostUpdateRecord DefaultInstance { + get { return defaultInstance; } + } + + public override PostUpdateRecord DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override PostUpdateRecord ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_PostUpdateRecord__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_PostUpdateRecord__FieldAccessorTable; } + } + + public const int TargetIdFieldNumber = 1; + private bool hasTargetId; + private global::bnet.protocol.EntityId targetId_; + public bool HasTargetId { + get { return hasTargetId; } + } + public global::bnet.protocol.EntityId TargetId { + get { return targetId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int CriteriaFieldNumber = 2; + private pbc::PopsicleList criteria_ = new pbc::PopsicleList(); + public scg::IList CriteriaList { + get { return criteria_; } + } + public int CriteriaCount { + get { return criteria_.Count; } + } + public global::bnet.protocol.achievements.CriteriaUpdateRecord GetCriteria(int index) { + return criteria_[index]; + } + + public override bool IsInitialized { + get { + if (!hasTargetId) return false; + if (!TargetId.IsInitialized) return false; + foreach (global::bnet.protocol.achievements.CriteriaUpdateRecord element in CriteriaList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _postUpdateRecordFieldNames; + if (hasTargetId) { + output.WriteMessage(1, field_names[1], TargetId); + } + if (criteria_.Count > 0) { + output.WriteMessageArray(2, field_names[0], criteria_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTargetId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, TargetId); + } + foreach (global::bnet.protocol.achievements.CriteriaUpdateRecord element in CriteriaList) { + size += pb::CodedOutputStream.ComputeMessageSize(2, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static PostUpdateRecord ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PostUpdateRecord ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PostUpdateRecord ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PostUpdateRecord ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PostUpdateRecord ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PostUpdateRecord ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static PostUpdateRecord ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static PostUpdateRecord ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static PostUpdateRecord ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PostUpdateRecord ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private PostUpdateRecord MakeReadOnly() { + criteria_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(PostUpdateRecord prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(PostUpdateRecord cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private PostUpdateRecord result; + + private PostUpdateRecord PrepareBuilder() { + if (resultIsReadOnly) { + PostUpdateRecord original = result; + result = new PostUpdateRecord(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override PostUpdateRecord MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.PostUpdateRecord.Descriptor; } + } + + public override PostUpdateRecord DefaultInstanceForType { + get { return global::bnet.protocol.achievements.PostUpdateRecord.DefaultInstance; } + } + + public override PostUpdateRecord BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is PostUpdateRecord) { + return MergeFrom((PostUpdateRecord) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(PostUpdateRecord other) { + if (other == global::bnet.protocol.achievements.PostUpdateRecord.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTargetId) { + MergeTargetId(other.TargetId); + } + if (other.criteria_.Count != 0) { + result.criteria_.Add(other.criteria_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_postUpdateRecordFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _postUpdateRecordFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasTargetId) { + subBuilder.MergeFrom(TargetId); + } + input.ReadMessage(subBuilder, extensionRegistry); + TargetId = subBuilder.BuildPartial(); + break; + } + case 18: { + input.ReadMessageArray(tag, field_name, result.criteria_, global::bnet.protocol.achievements.CriteriaUpdateRecord.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTargetId { + get { return result.hasTargetId; } + } + public global::bnet.protocol.EntityId TargetId { + get { return result.TargetId; } + set { SetTargetId(value); } + } + public Builder SetTargetId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTargetId = true; + result.targetId_ = value; + return this; + } + public Builder SetTargetId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasTargetId = true; + result.targetId_ = builderForValue.Build(); + return this; + } + public Builder MergeTargetId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasTargetId && + result.targetId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.targetId_ = global::bnet.protocol.EntityId.CreateBuilder(result.targetId_).MergeFrom(value).BuildPartial(); + } else { + result.targetId_ = value; + } + result.hasTargetId = true; + return this; + } + public Builder ClearTargetId() { + PrepareBuilder(); + result.hasTargetId = false; + result.targetId_ = null; + return this; + } + + public pbc::IPopsicleList CriteriaList { + get { return PrepareBuilder().criteria_; } + } + public int CriteriaCount { + get { return result.CriteriaCount; } + } + public global::bnet.protocol.achievements.CriteriaUpdateRecord GetCriteria(int index) { + return result.GetCriteria(index); + } + public Builder SetCriteria(int index, global::bnet.protocol.achievements.CriteriaUpdateRecord value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.criteria_[index] = value; + return this; + } + public Builder SetCriteria(int index, global::bnet.protocol.achievements.CriteriaUpdateRecord.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.criteria_[index] = builderForValue.Build(); + return this; + } + public Builder AddCriteria(global::bnet.protocol.achievements.CriteriaUpdateRecord value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.criteria_.Add(value); + return this; + } + public Builder AddCriteria(global::bnet.protocol.achievements.CriteriaUpdateRecord.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.criteria_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeCriteria(scg::IEnumerable values) { + PrepareBuilder(); + result.criteria_.Add(values); + return this; + } + public Builder ClearCriteria() { + PrepareBuilder(); + result.criteria_.Clear(); + return this; + } + } + static PostUpdateRecord() { + object.ReferenceEquals(global::bnet.protocol.achievements.Proto.AchievementsService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class PostUpdateRequest : pb::GeneratedMessage { + private PostUpdateRequest() { } + private static readonly PostUpdateRequest defaultInstance = new PostUpdateRequest().MakeReadOnly(); + private static readonly string[] _postUpdateRequestFieldNames = new string[] { "ati_id", "post_update_record", "program_id" }; + private static readonly uint[] _postUpdateRequestFieldTags = new uint[] { 24, 10, 21 }; + public static PostUpdateRequest DefaultInstance { + get { return defaultInstance; } + } + + public override PostUpdateRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override PostUpdateRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_PostUpdateRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_PostUpdateRequest__FieldAccessorTable; } + } + + public const int PostUpdateRecordFieldNumber = 1; + private pbc::PopsicleList postUpdateRecord_ = new pbc::PopsicleList(); + public scg::IList PostUpdateRecordList { + get { return postUpdateRecord_; } + } + public int PostUpdateRecordCount { + get { return postUpdateRecord_.Count; } + } + public global::bnet.protocol.achievements.PostUpdateRecord GetPostUpdateRecord(int index) { + return postUpdateRecord_[index]; + } + + public const int ProgramIdFieldNumber = 2; + private bool hasProgramId; + private uint programId_; + public bool HasProgramId { + get { return hasProgramId; } + } + public uint ProgramId { + get { return programId_; } + } + + public const int AtiIdFieldNumber = 3; + private bool hasAtiId; + private uint atiId_; + public bool HasAtiId { + get { return hasAtiId; } + } + public uint AtiId { + get { return atiId_; } + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.achievements.PostUpdateRecord element in PostUpdateRecordList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _postUpdateRequestFieldNames; + if (postUpdateRecord_.Count > 0) { + output.WriteMessageArray(1, field_names[1], postUpdateRecord_); + } + if (hasProgramId) { + output.WriteFixed32(2, field_names[2], ProgramId); + } + if (hasAtiId) { + output.WriteUInt32(3, field_names[0], AtiId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.achievements.PostUpdateRecord element in PostUpdateRecordList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + if (hasProgramId) { + size += pb::CodedOutputStream.ComputeFixed32Size(2, ProgramId); + } + if (hasAtiId) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, AtiId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static PostUpdateRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PostUpdateRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PostUpdateRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PostUpdateRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PostUpdateRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PostUpdateRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static PostUpdateRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static PostUpdateRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static PostUpdateRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PostUpdateRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private PostUpdateRequest MakeReadOnly() { + postUpdateRecord_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(PostUpdateRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(PostUpdateRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private PostUpdateRequest result; + + private PostUpdateRequest PrepareBuilder() { + if (resultIsReadOnly) { + PostUpdateRequest original = result; + result = new PostUpdateRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override PostUpdateRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.PostUpdateRequest.Descriptor; } + } + + public override PostUpdateRequest DefaultInstanceForType { + get { return global::bnet.protocol.achievements.PostUpdateRequest.DefaultInstance; } + } + + public override PostUpdateRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is PostUpdateRequest) { + return MergeFrom((PostUpdateRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(PostUpdateRequest other) { + if (other == global::bnet.protocol.achievements.PostUpdateRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.postUpdateRecord_.Count != 0) { + result.postUpdateRecord_.Add(other.postUpdateRecord_); + } + if (other.HasProgramId) { + ProgramId = other.ProgramId; + } + if (other.HasAtiId) { + AtiId = other.AtiId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_postUpdateRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _postUpdateRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.postUpdateRecord_, global::bnet.protocol.achievements.PostUpdateRecord.DefaultInstance, extensionRegistry); + break; + } + case 21: { + result.hasProgramId = input.ReadFixed32(ref result.programId_); + break; + } + case 24: { + result.hasAtiId = input.ReadUInt32(ref result.atiId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList PostUpdateRecordList { + get { return PrepareBuilder().postUpdateRecord_; } + } + public int PostUpdateRecordCount { + get { return result.PostUpdateRecordCount; } + } + public global::bnet.protocol.achievements.PostUpdateRecord GetPostUpdateRecord(int index) { + return result.GetPostUpdateRecord(index); + } + public Builder SetPostUpdateRecord(int index, global::bnet.protocol.achievements.PostUpdateRecord value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.postUpdateRecord_[index] = value; + return this; + } + public Builder SetPostUpdateRecord(int index, global::bnet.protocol.achievements.PostUpdateRecord.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.postUpdateRecord_[index] = builderForValue.Build(); + return this; + } + public Builder AddPostUpdateRecord(global::bnet.protocol.achievements.PostUpdateRecord value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.postUpdateRecord_.Add(value); + return this; + } + public Builder AddPostUpdateRecord(global::bnet.protocol.achievements.PostUpdateRecord.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.postUpdateRecord_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangePostUpdateRecord(scg::IEnumerable values) { + PrepareBuilder(); + result.postUpdateRecord_.Add(values); + return this; + } + public Builder ClearPostUpdateRecord() { + PrepareBuilder(); + result.postUpdateRecord_.Clear(); + return this; + } + + public bool HasProgramId { + get { return result.hasProgramId; } + } + public uint ProgramId { + get { return result.ProgramId; } + set { SetProgramId(value); } + } + public Builder SetProgramId(uint value) { + PrepareBuilder(); + result.hasProgramId = true; + result.programId_ = value; + return this; + } + public Builder ClearProgramId() { + PrepareBuilder(); + result.hasProgramId = false; + result.programId_ = 0; + return this; + } + + public bool HasAtiId { + get { return result.hasAtiId; } + } + public uint AtiId { + get { return result.AtiId; } + set { SetAtiId(value); } + } + public Builder SetAtiId(uint value) { + PrepareBuilder(); + result.hasAtiId = true; + result.atiId_ = value; + return this; + } + public Builder ClearAtiId() { + PrepareBuilder(); + result.hasAtiId = false; + result.atiId_ = 0; + return this; + } + } + static PostUpdateRequest() { + object.ReferenceEquals(global::bnet.protocol.achievements.Proto.AchievementsService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class PostUpdateResponse : pb::GeneratedMessage { + private PostUpdateResponse() { } + private static readonly PostUpdateResponse defaultInstance = new PostUpdateResponse().MakeReadOnly(); + private static readonly string[] _postUpdateResponseFieldNames = new string[] { "error_code" }; + private static readonly uint[] _postUpdateResponseFieldTags = new uint[] { 8 }; + public static PostUpdateResponse DefaultInstance { + get { return defaultInstance; } + } + + public override PostUpdateResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override PostUpdateResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_PostUpdateResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_PostUpdateResponse__FieldAccessorTable; } + } + + public const int ErrorCodeFieldNumber = 1; + private pbc::PopsicleList errorCode_ = new pbc::PopsicleList(); + public scg::IList ErrorCodeList { + get { return pbc::Lists.AsReadOnly(errorCode_); } + } + public int ErrorCodeCount { + get { return errorCode_.Count; } + } + public uint GetErrorCode(int index) { + return errorCode_[index]; + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _postUpdateResponseFieldNames; + if (errorCode_.Count > 0) { + output.WriteUInt32Array(1, field_names[0], errorCode_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + foreach (uint element in ErrorCodeList) { + dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); + } + size += dataSize; + size += 1 * errorCode_.Count; + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static PostUpdateResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PostUpdateResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PostUpdateResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PostUpdateResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PostUpdateResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PostUpdateResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static PostUpdateResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static PostUpdateResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static PostUpdateResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PostUpdateResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private PostUpdateResponse MakeReadOnly() { + errorCode_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(PostUpdateResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(PostUpdateResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private PostUpdateResponse result; + + private PostUpdateResponse PrepareBuilder() { + if (resultIsReadOnly) { + PostUpdateResponse original = result; + result = new PostUpdateResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override PostUpdateResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.PostUpdateResponse.Descriptor; } + } + + public override PostUpdateResponse DefaultInstanceForType { + get { return global::bnet.protocol.achievements.PostUpdateResponse.DefaultInstance; } + } + + public override PostUpdateResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is PostUpdateResponse) { + return MergeFrom((PostUpdateResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(PostUpdateResponse other) { + if (other == global::bnet.protocol.achievements.PostUpdateResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.errorCode_.Count != 0) { + result.errorCode_.Add(other.errorCode_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_postUpdateResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _postUpdateResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: + case 8: { + input.ReadUInt32Array(tag, field_name, result.errorCode_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList ErrorCodeList { + get { return PrepareBuilder().errorCode_; } + } + public int ErrorCodeCount { + get { return result.ErrorCodeCount; } + } + public uint GetErrorCode(int index) { + return result.GetErrorCode(index); + } + public Builder SetErrorCode(int index, uint value) { + PrepareBuilder(); + result.errorCode_[index] = value; + return this; + } + public Builder AddErrorCode(uint value) { + PrepareBuilder(); + result.errorCode_.Add(value); + return this; + } + public Builder AddRangeErrorCode(scg::IEnumerable values) { + PrepareBuilder(); + result.errorCode_.Add(values); + return this; + } + public Builder ClearErrorCode() { + PrepareBuilder(); + result.errorCode_.Clear(); + return this; + } + } + static PostUpdateResponse() { + object.ReferenceEquals(global::bnet.protocol.achievements.Proto.AchievementsService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class RegisterWithServiceRequest : pb::GeneratedMessage { + private RegisterWithServiceRequest() { } + private static readonly RegisterWithServiceRequest defaultInstance = new RegisterWithServiceRequest().MakeReadOnly(); + private static readonly string[] _registerWithServiceRequestFieldNames = new string[] { "ati_id", "object_id", "program_id", "registration_flags", "target_id" }; + private static readonly uint[] _registerWithServiceRequestFieldTags = new uint[] { 40, 16, 37, 24, 10 }; + public static RegisterWithServiceRequest DefaultInstance { + get { return defaultInstance; } + } + + public override RegisterWithServiceRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override RegisterWithServiceRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_RegisterWithServiceRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_RegisterWithServiceRequest__FieldAccessorTable; } + } + + public const int TargetIdFieldNumber = 1; + private bool hasTargetId; + private global::bnet.protocol.EntityId targetId_; + public bool HasTargetId { + get { return hasTargetId; } + } + public global::bnet.protocol.EntityId TargetId { + get { return targetId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int ObjectIdFieldNumber = 2; + private bool hasObjectId; + private ulong objectId_; + public bool HasObjectId { + get { return hasObjectId; } + } + public ulong ObjectId { + get { return objectId_; } + } + + public const int RegistrationFlagsFieldNumber = 3; + private bool hasRegistrationFlags; + private uint registrationFlags_; + public bool HasRegistrationFlags { + get { return hasRegistrationFlags; } + } + public uint RegistrationFlags { + get { return registrationFlags_; } + } + + public const int ProgramIdFieldNumber = 4; + private bool hasProgramId; + private uint programId_; + public bool HasProgramId { + get { return hasProgramId; } + } + public uint ProgramId { + get { return programId_; } + } + + public const int AtiIdFieldNumber = 5; + private bool hasAtiId; + private uint atiId_; + public bool HasAtiId { + get { return hasAtiId; } + } + public uint AtiId { + get { return atiId_; } + } + + public override bool IsInitialized { + get { + if (!hasTargetId) return false; + if (!hasObjectId) return false; + if (!TargetId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _registerWithServiceRequestFieldNames; + if (hasTargetId) { + output.WriteMessage(1, field_names[4], TargetId); + } + if (hasObjectId) { + output.WriteUInt64(2, field_names[1], ObjectId); + } + if (hasRegistrationFlags) { + output.WriteUInt32(3, field_names[3], RegistrationFlags); + } + if (hasProgramId) { + output.WriteFixed32(4, field_names[2], ProgramId); + } + if (hasAtiId) { + output.WriteUInt32(5, field_names[0], AtiId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTargetId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, TargetId); + } + if (hasObjectId) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, ObjectId); + } + if (hasRegistrationFlags) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, RegistrationFlags); + } + if (hasProgramId) { + size += pb::CodedOutputStream.ComputeFixed32Size(4, ProgramId); + } + if (hasAtiId) { + size += pb::CodedOutputStream.ComputeUInt32Size(5, AtiId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static RegisterWithServiceRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RegisterWithServiceRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RegisterWithServiceRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RegisterWithServiceRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RegisterWithServiceRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RegisterWithServiceRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static RegisterWithServiceRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static RegisterWithServiceRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static RegisterWithServiceRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RegisterWithServiceRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private RegisterWithServiceRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(RegisterWithServiceRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(RegisterWithServiceRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private RegisterWithServiceRequest result; + + private RegisterWithServiceRequest PrepareBuilder() { + if (resultIsReadOnly) { + RegisterWithServiceRequest original = result; + result = new RegisterWithServiceRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override RegisterWithServiceRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.RegisterWithServiceRequest.Descriptor; } + } + + public override RegisterWithServiceRequest DefaultInstanceForType { + get { return global::bnet.protocol.achievements.RegisterWithServiceRequest.DefaultInstance; } + } + + public override RegisterWithServiceRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is RegisterWithServiceRequest) { + return MergeFrom((RegisterWithServiceRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(RegisterWithServiceRequest other) { + if (other == global::bnet.protocol.achievements.RegisterWithServiceRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTargetId) { + MergeTargetId(other.TargetId); + } + if (other.HasObjectId) { + ObjectId = other.ObjectId; + } + if (other.HasRegistrationFlags) { + RegistrationFlags = other.RegistrationFlags; + } + if (other.HasProgramId) { + ProgramId = other.ProgramId; + } + if (other.HasAtiId) { + AtiId = other.AtiId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_registerWithServiceRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _registerWithServiceRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasTargetId) { + subBuilder.MergeFrom(TargetId); + } + input.ReadMessage(subBuilder, extensionRegistry); + TargetId = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasObjectId = input.ReadUInt64(ref result.objectId_); + break; + } + case 24: { + result.hasRegistrationFlags = input.ReadUInt32(ref result.registrationFlags_); + break; + } + case 37: { + result.hasProgramId = input.ReadFixed32(ref result.programId_); + break; + } + case 40: { + result.hasAtiId = input.ReadUInt32(ref result.atiId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTargetId { + get { return result.hasTargetId; } + } + public global::bnet.protocol.EntityId TargetId { + get { return result.TargetId; } + set { SetTargetId(value); } + } + public Builder SetTargetId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTargetId = true; + result.targetId_ = value; + return this; + } + public Builder SetTargetId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasTargetId = true; + result.targetId_ = builderForValue.Build(); + return this; + } + public Builder MergeTargetId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasTargetId && + result.targetId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.targetId_ = global::bnet.protocol.EntityId.CreateBuilder(result.targetId_).MergeFrom(value).BuildPartial(); + } else { + result.targetId_ = value; + } + result.hasTargetId = true; + return this; + } + public Builder ClearTargetId() { + PrepareBuilder(); + result.hasTargetId = false; + result.targetId_ = null; + return this; + } + + public bool HasObjectId { + get { return result.hasObjectId; } + } + public ulong ObjectId { + get { return result.ObjectId; } + set { SetObjectId(value); } + } + public Builder SetObjectId(ulong value) { + PrepareBuilder(); + result.hasObjectId = true; + result.objectId_ = value; + return this; + } + public Builder ClearObjectId() { + PrepareBuilder(); + result.hasObjectId = false; + result.objectId_ = 0UL; + return this; + } + + public bool HasRegistrationFlags { + get { return result.hasRegistrationFlags; } + } + public uint RegistrationFlags { + get { return result.RegistrationFlags; } + set { SetRegistrationFlags(value); } + } + public Builder SetRegistrationFlags(uint value) { + PrepareBuilder(); + result.hasRegistrationFlags = true; + result.registrationFlags_ = value; + return this; + } + public Builder ClearRegistrationFlags() { + PrepareBuilder(); + result.hasRegistrationFlags = false; + result.registrationFlags_ = 0; + return this; + } + + public bool HasProgramId { + get { return result.hasProgramId; } + } + public uint ProgramId { + get { return result.ProgramId; } + set { SetProgramId(value); } + } + public Builder SetProgramId(uint value) { + PrepareBuilder(); + result.hasProgramId = true; + result.programId_ = value; + return this; + } + public Builder ClearProgramId() { + PrepareBuilder(); + result.hasProgramId = false; + result.programId_ = 0; + return this; + } + + public bool HasAtiId { + get { return result.hasAtiId; } + } + public uint AtiId { + get { return result.AtiId; } + set { SetAtiId(value); } + } + public Builder SetAtiId(uint value) { + PrepareBuilder(); + result.hasAtiId = true; + result.atiId_ = value; + return this; + } + public Builder ClearAtiId() { + PrepareBuilder(); + result.hasAtiId = false; + result.atiId_ = 0; + return this; + } + } + static RegisterWithServiceRequest() { + object.ReferenceEquals(global::bnet.protocol.achievements.Proto.AchievementsService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class RegisterWithServiceResponse : pb::GeneratedMessage { + private RegisterWithServiceResponse() { } + private static readonly RegisterWithServiceResponse defaultInstance = new RegisterWithServiceResponse().MakeReadOnly(); + private static readonly string[] _registerWithServiceResponseFieldNames = new string[] { "registration_flags", "snapshot" }; + private static readonly uint[] _registerWithServiceResponseFieldTags = new uint[] { 16, 10 }; + public static RegisterWithServiceResponse DefaultInstance { + get { return defaultInstance; } + } + + public override RegisterWithServiceResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override RegisterWithServiceResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_RegisterWithServiceResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_RegisterWithServiceResponse__FieldAccessorTable; } + } + + public const int SnapshotFieldNumber = 1; + private bool hasSnapshot; + private global::bnet.protocol.achievements.Snapshot snapshot_; + public bool HasSnapshot { + get { return hasSnapshot; } + } + public global::bnet.protocol.achievements.Snapshot Snapshot { + get { return snapshot_ ?? global::bnet.protocol.achievements.Snapshot.DefaultInstance; } + } + + public const int RegistrationFlagsFieldNumber = 2; + private bool hasRegistrationFlags; + private uint registrationFlags_; + public bool HasRegistrationFlags { + get { return hasRegistrationFlags; } + } + public uint RegistrationFlags { + get { return registrationFlags_; } + } + + public override bool IsInitialized { + get { + if (HasSnapshot) { + if (!Snapshot.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _registerWithServiceResponseFieldNames; + if (hasSnapshot) { + output.WriteMessage(1, field_names[1], Snapshot); + } + if (hasRegistrationFlags) { + output.WriteUInt32(2, field_names[0], RegistrationFlags); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasSnapshot) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Snapshot); + } + if (hasRegistrationFlags) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, RegistrationFlags); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static RegisterWithServiceResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RegisterWithServiceResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RegisterWithServiceResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RegisterWithServiceResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RegisterWithServiceResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RegisterWithServiceResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static RegisterWithServiceResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static RegisterWithServiceResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static RegisterWithServiceResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RegisterWithServiceResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private RegisterWithServiceResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(RegisterWithServiceResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(RegisterWithServiceResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private RegisterWithServiceResponse result; + + private RegisterWithServiceResponse PrepareBuilder() { + if (resultIsReadOnly) { + RegisterWithServiceResponse original = result; + result = new RegisterWithServiceResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override RegisterWithServiceResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.RegisterWithServiceResponse.Descriptor; } + } + + public override RegisterWithServiceResponse DefaultInstanceForType { + get { return global::bnet.protocol.achievements.RegisterWithServiceResponse.DefaultInstance; } + } + + public override RegisterWithServiceResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is RegisterWithServiceResponse) { + return MergeFrom((RegisterWithServiceResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(RegisterWithServiceResponse other) { + if (other == global::bnet.protocol.achievements.RegisterWithServiceResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasSnapshot) { + MergeSnapshot(other.Snapshot); + } + if (other.HasRegistrationFlags) { + RegistrationFlags = other.RegistrationFlags; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_registerWithServiceResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _registerWithServiceResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.achievements.Snapshot.Builder subBuilder = global::bnet.protocol.achievements.Snapshot.CreateBuilder(); + if (result.hasSnapshot) { + subBuilder.MergeFrom(Snapshot); + } + input.ReadMessage(subBuilder, extensionRegistry); + Snapshot = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasRegistrationFlags = input.ReadUInt32(ref result.registrationFlags_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasSnapshot { + get { return result.hasSnapshot; } + } + public global::bnet.protocol.achievements.Snapshot Snapshot { + get { return result.Snapshot; } + set { SetSnapshot(value); } + } + public Builder SetSnapshot(global::bnet.protocol.achievements.Snapshot value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasSnapshot = true; + result.snapshot_ = value; + return this; + } + public Builder SetSnapshot(global::bnet.protocol.achievements.Snapshot.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasSnapshot = true; + result.snapshot_ = builderForValue.Build(); + return this; + } + public Builder MergeSnapshot(global::bnet.protocol.achievements.Snapshot value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasSnapshot && + result.snapshot_ != global::bnet.protocol.achievements.Snapshot.DefaultInstance) { + result.snapshot_ = global::bnet.protocol.achievements.Snapshot.CreateBuilder(result.snapshot_).MergeFrom(value).BuildPartial(); + } else { + result.snapshot_ = value; + } + result.hasSnapshot = true; + return this; + } + public Builder ClearSnapshot() { + PrepareBuilder(); + result.hasSnapshot = false; + result.snapshot_ = null; + return this; + } + + public bool HasRegistrationFlags { + get { return result.hasRegistrationFlags; } + } + public uint RegistrationFlags { + get { return result.RegistrationFlags; } + set { SetRegistrationFlags(value); } + } + public Builder SetRegistrationFlags(uint value) { + PrepareBuilder(); + result.hasRegistrationFlags = true; + result.registrationFlags_ = value; + return this; + } + public Builder ClearRegistrationFlags() { + PrepareBuilder(); + result.hasRegistrationFlags = false; + result.registrationFlags_ = 0; + return this; + } + } + static RegisterWithServiceResponse() { + object.ReferenceEquals(global::bnet.protocol.achievements.Proto.AchievementsService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class UnregisterFromServiceRequest : pb::GeneratedMessage { + private UnregisterFromServiceRequest() { } + private static readonly UnregisterFromServiceRequest defaultInstance = new UnregisterFromServiceRequest().MakeReadOnly(); + private static readonly string[] _unregisterFromServiceRequestFieldNames = new string[] { "ati_id", "object_id", "target_id" }; + private static readonly uint[] _unregisterFromServiceRequestFieldTags = new uint[] { 24, 16, 10 }; + public static UnregisterFromServiceRequest DefaultInstance { + get { return defaultInstance; } + } + + public override UnregisterFromServiceRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override UnregisterFromServiceRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_UnregisterFromServiceRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_UnregisterFromServiceRequest__FieldAccessorTable; } + } + + public const int TargetIdFieldNumber = 1; + private bool hasTargetId; + private global::bnet.protocol.EntityId targetId_; + public bool HasTargetId { + get { return hasTargetId; } + } + public global::bnet.protocol.EntityId TargetId { + get { return targetId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int ObjectIdFieldNumber = 2; + private bool hasObjectId; + private ulong objectId_; + public bool HasObjectId { + get { return hasObjectId; } + } + public ulong ObjectId { + get { return objectId_; } + } + + public const int AtiIdFieldNumber = 3; + private bool hasAtiId; + private uint atiId_; + public bool HasAtiId { + get { return hasAtiId; } + } + public uint AtiId { + get { return atiId_; } + } + + public override bool IsInitialized { + get { + if (!hasTargetId) return false; + if (!hasObjectId) return false; + if (!TargetId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _unregisterFromServiceRequestFieldNames; + if (hasTargetId) { + output.WriteMessage(1, field_names[2], TargetId); + } + if (hasObjectId) { + output.WriteUInt64(2, field_names[1], ObjectId); + } + if (hasAtiId) { + output.WriteUInt32(3, field_names[0], AtiId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTargetId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, TargetId); + } + if (hasObjectId) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, ObjectId); + } + if (hasAtiId) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, AtiId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static UnregisterFromServiceRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UnregisterFromServiceRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UnregisterFromServiceRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UnregisterFromServiceRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UnregisterFromServiceRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UnregisterFromServiceRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static UnregisterFromServiceRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static UnregisterFromServiceRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static UnregisterFromServiceRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UnregisterFromServiceRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private UnregisterFromServiceRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(UnregisterFromServiceRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(UnregisterFromServiceRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private UnregisterFromServiceRequest result; + + private UnregisterFromServiceRequest PrepareBuilder() { + if (resultIsReadOnly) { + UnregisterFromServiceRequest original = result; + result = new UnregisterFromServiceRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override UnregisterFromServiceRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.UnregisterFromServiceRequest.Descriptor; } + } + + public override UnregisterFromServiceRequest DefaultInstanceForType { + get { return global::bnet.protocol.achievements.UnregisterFromServiceRequest.DefaultInstance; } + } + + public override UnregisterFromServiceRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is UnregisterFromServiceRequest) { + return MergeFrom((UnregisterFromServiceRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(UnregisterFromServiceRequest other) { + if (other == global::bnet.protocol.achievements.UnregisterFromServiceRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTargetId) { + MergeTargetId(other.TargetId); + } + if (other.HasObjectId) { + ObjectId = other.ObjectId; + } + if (other.HasAtiId) { + AtiId = other.AtiId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_unregisterFromServiceRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _unregisterFromServiceRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasTargetId) { + subBuilder.MergeFrom(TargetId); + } + input.ReadMessage(subBuilder, extensionRegistry); + TargetId = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasObjectId = input.ReadUInt64(ref result.objectId_); + break; + } + case 24: { + result.hasAtiId = input.ReadUInt32(ref result.atiId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTargetId { + get { return result.hasTargetId; } + } + public global::bnet.protocol.EntityId TargetId { + get { return result.TargetId; } + set { SetTargetId(value); } + } + public Builder SetTargetId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTargetId = true; + result.targetId_ = value; + return this; + } + public Builder SetTargetId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasTargetId = true; + result.targetId_ = builderForValue.Build(); + return this; + } + public Builder MergeTargetId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasTargetId && + result.targetId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.targetId_ = global::bnet.protocol.EntityId.CreateBuilder(result.targetId_).MergeFrom(value).BuildPartial(); + } else { + result.targetId_ = value; + } + result.hasTargetId = true; + return this; + } + public Builder ClearTargetId() { + PrepareBuilder(); + result.hasTargetId = false; + result.targetId_ = null; + return this; + } + + public bool HasObjectId { + get { return result.hasObjectId; } + } + public ulong ObjectId { + get { return result.ObjectId; } + set { SetObjectId(value); } + } + public Builder SetObjectId(ulong value) { + PrepareBuilder(); + result.hasObjectId = true; + result.objectId_ = value; + return this; + } + public Builder ClearObjectId() { + PrepareBuilder(); + result.hasObjectId = false; + result.objectId_ = 0UL; + return this; + } + + public bool HasAtiId { + get { return result.hasAtiId; } + } + public uint AtiId { + get { return result.AtiId; } + set { SetAtiId(value); } + } + public Builder SetAtiId(uint value) { + PrepareBuilder(); + result.hasAtiId = true; + result.atiId_ = value; + return this; + } + public Builder ClearAtiId() { + PrepareBuilder(); + result.hasAtiId = false; + result.atiId_ = 0; + return this; + } + } + static UnregisterFromServiceRequest() { + object.ReferenceEquals(global::bnet.protocol.achievements.Proto.AchievementsService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Snapshot : pb::GeneratedMessage { + private Snapshot() { } + private static readonly Snapshot defaultInstance = new Snapshot().MakeReadOnly(); + private static readonly string[] _snapshotFieldNames = new string[] { "achievement_snapshot", "criteria_snapshot", "header" }; + private static readonly uint[] _snapshotFieldTags = new uint[] { 10, 18, 24 }; + public static Snapshot DefaultInstance { + get { return defaultInstance; } + } + + public override Snapshot DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Snapshot ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_Snapshot__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_Snapshot__FieldAccessorTable; } + } + + public const int AchievementSnapshotFieldNumber = 1; + private pbc::PopsicleList achievementSnapshot_ = new pbc::PopsicleList(); + public scg::IList AchievementSnapshotList { + get { return achievementSnapshot_; } + } + public int AchievementSnapshotCount { + get { return achievementSnapshot_.Count; } + } + public global::bnet.protocol.achievements.AchievementUpdateRecord GetAchievementSnapshot(int index) { + return achievementSnapshot_[index]; + } + + public const int CriteriaSnapshotFieldNumber = 2; + private pbc::PopsicleList criteriaSnapshot_ = new pbc::PopsicleList(); + public scg::IList CriteriaSnapshotList { + get { return criteriaSnapshot_; } + } + public int CriteriaSnapshotCount { + get { return criteriaSnapshot_.Count; } + } + public global::bnet.protocol.achievements.CriteriaUpdateRecord GetCriteriaSnapshot(int index) { + return criteriaSnapshot_[index]; + } + + public const int HeaderFieldNumber = 3; + private bool hasHeader; + private ulong header_; + public bool HasHeader { + get { return hasHeader; } + } + public ulong Header { + get { return header_; } + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.achievements.AchievementUpdateRecord element in AchievementSnapshotList) { + if (!element.IsInitialized) return false; + } + foreach (global::bnet.protocol.achievements.CriteriaUpdateRecord element in CriteriaSnapshotList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _snapshotFieldNames; + if (achievementSnapshot_.Count > 0) { + output.WriteMessageArray(1, field_names[0], achievementSnapshot_); + } + if (criteriaSnapshot_.Count > 0) { + output.WriteMessageArray(2, field_names[1], criteriaSnapshot_); + } + if (hasHeader) { + output.WriteUInt64(3, field_names[2], Header); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.achievements.AchievementUpdateRecord element in AchievementSnapshotList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + foreach (global::bnet.protocol.achievements.CriteriaUpdateRecord element in CriteriaSnapshotList) { + size += pb::CodedOutputStream.ComputeMessageSize(2, element); + } + if (hasHeader) { + size += pb::CodedOutputStream.ComputeUInt64Size(3, Header); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static Snapshot ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Snapshot ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Snapshot ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Snapshot ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Snapshot ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Snapshot ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Snapshot ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Snapshot ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Snapshot ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Snapshot ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Snapshot MakeReadOnly() { + achievementSnapshot_.MakeReadOnly(); + criteriaSnapshot_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Snapshot prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Snapshot cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Snapshot result; + + private Snapshot PrepareBuilder() { + if (resultIsReadOnly) { + Snapshot original = result; + result = new Snapshot(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Snapshot MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.Snapshot.Descriptor; } + } + + public override Snapshot DefaultInstanceForType { + get { return global::bnet.protocol.achievements.Snapshot.DefaultInstance; } + } + + public override Snapshot BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Snapshot) { + return MergeFrom((Snapshot) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Snapshot other) { + if (other == global::bnet.protocol.achievements.Snapshot.DefaultInstance) return this; + PrepareBuilder(); + if (other.achievementSnapshot_.Count != 0) { + result.achievementSnapshot_.Add(other.achievementSnapshot_); + } + if (other.criteriaSnapshot_.Count != 0) { + result.criteriaSnapshot_.Add(other.criteriaSnapshot_); + } + if (other.HasHeader) { + Header = other.Header; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_snapshotFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _snapshotFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.achievementSnapshot_, global::bnet.protocol.achievements.AchievementUpdateRecord.DefaultInstance, extensionRegistry); + break; + } + case 18: { + input.ReadMessageArray(tag, field_name, result.criteriaSnapshot_, global::bnet.protocol.achievements.CriteriaUpdateRecord.DefaultInstance, extensionRegistry); + break; + } + case 24: { + result.hasHeader = input.ReadUInt64(ref result.header_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList AchievementSnapshotList { + get { return PrepareBuilder().achievementSnapshot_; } + } + public int AchievementSnapshotCount { + get { return result.AchievementSnapshotCount; } + } + public global::bnet.protocol.achievements.AchievementUpdateRecord GetAchievementSnapshot(int index) { + return result.GetAchievementSnapshot(index); + } + public Builder SetAchievementSnapshot(int index, global::bnet.protocol.achievements.AchievementUpdateRecord value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.achievementSnapshot_[index] = value; + return this; + } + public Builder SetAchievementSnapshot(int index, global::bnet.protocol.achievements.AchievementUpdateRecord.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.achievementSnapshot_[index] = builderForValue.Build(); + return this; + } + public Builder AddAchievementSnapshot(global::bnet.protocol.achievements.AchievementUpdateRecord value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.achievementSnapshot_.Add(value); + return this; + } + public Builder AddAchievementSnapshot(global::bnet.protocol.achievements.AchievementUpdateRecord.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.achievementSnapshot_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeAchievementSnapshot(scg::IEnumerable values) { + PrepareBuilder(); + result.achievementSnapshot_.Add(values); + return this; + } + public Builder ClearAchievementSnapshot() { + PrepareBuilder(); + result.achievementSnapshot_.Clear(); + return this; + } + + public pbc::IPopsicleList CriteriaSnapshotList { + get { return PrepareBuilder().criteriaSnapshot_; } + } + public int CriteriaSnapshotCount { + get { return result.CriteriaSnapshotCount; } + } + public global::bnet.protocol.achievements.CriteriaUpdateRecord GetCriteriaSnapshot(int index) { + return result.GetCriteriaSnapshot(index); + } + public Builder SetCriteriaSnapshot(int index, global::bnet.protocol.achievements.CriteriaUpdateRecord value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.criteriaSnapshot_[index] = value; + return this; + } + public Builder SetCriteriaSnapshot(int index, global::bnet.protocol.achievements.CriteriaUpdateRecord.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.criteriaSnapshot_[index] = builderForValue.Build(); + return this; + } + public Builder AddCriteriaSnapshot(global::bnet.protocol.achievements.CriteriaUpdateRecord value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.criteriaSnapshot_.Add(value); + return this; + } + public Builder AddCriteriaSnapshot(global::bnet.protocol.achievements.CriteriaUpdateRecord.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.criteriaSnapshot_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeCriteriaSnapshot(scg::IEnumerable values) { + PrepareBuilder(); + result.criteriaSnapshot_.Add(values); + return this; + } + public Builder ClearCriteriaSnapshot() { + PrepareBuilder(); + result.criteriaSnapshot_.Clear(); + return this; + } + + public bool HasHeader { + get { return result.hasHeader; } + } + public ulong Header { + get { return result.Header; } + set { SetHeader(value); } + } + public Builder SetHeader(ulong value) { + PrepareBuilder(); + result.hasHeader = true; + result.header_ = value; + return this; + } + public Builder ClearHeader() { + PrepareBuilder(); + result.hasHeader = false; + result.header_ = 0UL; + return this; + } + } + static Snapshot() { + object.ReferenceEquals(global::bnet.protocol.achievements.Proto.AchievementsService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class RequestSnapshotRequest : pb::GeneratedMessage { + private RequestSnapshotRequest() { } + private static readonly RequestSnapshotRequest defaultInstance = new RequestSnapshotRequest().MakeReadOnly(); + private static readonly string[] _requestSnapshotRequestFieldNames = new string[] { "entity_id", "filter", "program_id" }; + private static readonly uint[] _requestSnapshotRequestFieldTags = new uint[] { 10, 16, 29 }; + public static RequestSnapshotRequest DefaultInstance { + get { return defaultInstance; } + } + + public override RequestSnapshotRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override RequestSnapshotRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_RequestSnapshotRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_RequestSnapshotRequest__FieldAccessorTable; } + } + + public const int EntityIdFieldNumber = 1; + private bool hasEntityId; + private global::bnet.protocol.EntityId entityId_; + public bool HasEntityId { + get { return hasEntityId; } + } + public global::bnet.protocol.EntityId EntityId { + get { return entityId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int FilterFieldNumber = 2; + private bool hasFilter; + private uint filter_; + public bool HasFilter { + get { return hasFilter; } + } + public uint Filter { + get { return filter_; } + } + + public const int ProgramIdFieldNumber = 3; + private bool hasProgramId; + private uint programId_; + public bool HasProgramId { + get { return hasProgramId; } + } + public uint ProgramId { + get { return programId_; } + } + + public override bool IsInitialized { + get { + if (!hasEntityId) return false; + if (!hasFilter) return false; + if (!EntityId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _requestSnapshotRequestFieldNames; + if (hasEntityId) { + output.WriteMessage(1, field_names[0], EntityId); + } + if (hasFilter) { + output.WriteUInt32(2, field_names[1], Filter); + } + if (hasProgramId) { + output.WriteFixed32(3, field_names[2], ProgramId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasEntityId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, EntityId); + } + if (hasFilter) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, Filter); + } + if (hasProgramId) { + size += pb::CodedOutputStream.ComputeFixed32Size(3, ProgramId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static RequestSnapshotRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RequestSnapshotRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RequestSnapshotRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RequestSnapshotRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RequestSnapshotRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RequestSnapshotRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static RequestSnapshotRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static RequestSnapshotRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static RequestSnapshotRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RequestSnapshotRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private RequestSnapshotRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(RequestSnapshotRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(RequestSnapshotRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private RequestSnapshotRequest result; + + private RequestSnapshotRequest PrepareBuilder() { + if (resultIsReadOnly) { + RequestSnapshotRequest original = result; + result = new RequestSnapshotRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override RequestSnapshotRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.RequestSnapshotRequest.Descriptor; } + } + + public override RequestSnapshotRequest DefaultInstanceForType { + get { return global::bnet.protocol.achievements.RequestSnapshotRequest.DefaultInstance; } + } + + public override RequestSnapshotRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is RequestSnapshotRequest) { + return MergeFrom((RequestSnapshotRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(RequestSnapshotRequest other) { + if (other == global::bnet.protocol.achievements.RequestSnapshotRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasEntityId) { + MergeEntityId(other.EntityId); + } + if (other.HasFilter) { + Filter = other.Filter; + } + if (other.HasProgramId) { + ProgramId = other.ProgramId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_requestSnapshotRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _requestSnapshotRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasEntityId) { + subBuilder.MergeFrom(EntityId); + } + input.ReadMessage(subBuilder, extensionRegistry); + EntityId = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasFilter = input.ReadUInt32(ref result.filter_); + break; + } + case 29: { + result.hasProgramId = input.ReadFixed32(ref result.programId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasEntityId { + get { return result.hasEntityId; } + } + public global::bnet.protocol.EntityId EntityId { + get { return result.EntityId; } + set { SetEntityId(value); } + } + public Builder SetEntityId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasEntityId = true; + result.entityId_ = value; + return this; + } + public Builder SetEntityId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasEntityId = true; + result.entityId_ = builderForValue.Build(); + return this; + } + public Builder MergeEntityId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasEntityId && + result.entityId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.entityId_ = global::bnet.protocol.EntityId.CreateBuilder(result.entityId_).MergeFrom(value).BuildPartial(); + } else { + result.entityId_ = value; + } + result.hasEntityId = true; + return this; + } + public Builder ClearEntityId() { + PrepareBuilder(); + result.hasEntityId = false; + result.entityId_ = null; + return this; + } + + public bool HasFilter { + get { return result.hasFilter; } + } + public uint Filter { + get { return result.Filter; } + set { SetFilter(value); } + } + public Builder SetFilter(uint value) { + PrepareBuilder(); + result.hasFilter = true; + result.filter_ = value; + return this; + } + public Builder ClearFilter() { + PrepareBuilder(); + result.hasFilter = false; + result.filter_ = 0; + return this; + } + + public bool HasProgramId { + get { return result.hasProgramId; } + } + public uint ProgramId { + get { return result.ProgramId; } + set { SetProgramId(value); } + } + public Builder SetProgramId(uint value) { + PrepareBuilder(); + result.hasProgramId = true; + result.programId_ = value; + return this; + } + public Builder ClearProgramId() { + PrepareBuilder(); + result.hasProgramId = false; + result.programId_ = 0; + return this; + } + } + static RequestSnapshotRequest() { + object.ReferenceEquals(global::bnet.protocol.achievements.Proto.AchievementsService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class RequestSnapshotResponse : pb::GeneratedMessage { + private RequestSnapshotResponse() { } + private static readonly RequestSnapshotResponse defaultInstance = new RequestSnapshotResponse().MakeReadOnly(); + private static readonly string[] _requestSnapshotResponseFieldNames = new string[] { "snapshot" }; + private static readonly uint[] _requestSnapshotResponseFieldTags = new uint[] { 10 }; + public static RequestSnapshotResponse DefaultInstance { + get { return defaultInstance; } + } + + public override RequestSnapshotResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override RequestSnapshotResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_RequestSnapshotResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_RequestSnapshotResponse__FieldAccessorTable; } + } + + public const int SnapshotFieldNumber = 1; + private bool hasSnapshot; + private global::bnet.protocol.achievements.Snapshot snapshot_; + public bool HasSnapshot { + get { return hasSnapshot; } + } + public global::bnet.protocol.achievements.Snapshot Snapshot { + get { return snapshot_ ?? global::bnet.protocol.achievements.Snapshot.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (HasSnapshot) { + if (!Snapshot.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _requestSnapshotResponseFieldNames; + if (hasSnapshot) { + output.WriteMessage(1, field_names[0], Snapshot); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasSnapshot) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Snapshot); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static RequestSnapshotResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RequestSnapshotResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RequestSnapshotResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RequestSnapshotResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RequestSnapshotResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RequestSnapshotResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static RequestSnapshotResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static RequestSnapshotResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static RequestSnapshotResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RequestSnapshotResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private RequestSnapshotResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(RequestSnapshotResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(RequestSnapshotResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private RequestSnapshotResponse result; + + private RequestSnapshotResponse PrepareBuilder() { + if (resultIsReadOnly) { + RequestSnapshotResponse original = result; + result = new RequestSnapshotResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override RequestSnapshotResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.RequestSnapshotResponse.Descriptor; } + } + + public override RequestSnapshotResponse DefaultInstanceForType { + get { return global::bnet.protocol.achievements.RequestSnapshotResponse.DefaultInstance; } + } + + public override RequestSnapshotResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is RequestSnapshotResponse) { + return MergeFrom((RequestSnapshotResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(RequestSnapshotResponse other) { + if (other == global::bnet.protocol.achievements.RequestSnapshotResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasSnapshot) { + MergeSnapshot(other.Snapshot); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_requestSnapshotResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _requestSnapshotResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.achievements.Snapshot.Builder subBuilder = global::bnet.protocol.achievements.Snapshot.CreateBuilder(); + if (result.hasSnapshot) { + subBuilder.MergeFrom(Snapshot); + } + input.ReadMessage(subBuilder, extensionRegistry); + Snapshot = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasSnapshot { + get { return result.hasSnapshot; } + } + public global::bnet.protocol.achievements.Snapshot Snapshot { + get { return result.Snapshot; } + set { SetSnapshot(value); } + } + public Builder SetSnapshot(global::bnet.protocol.achievements.Snapshot value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasSnapshot = true; + result.snapshot_ = value; + return this; + } + public Builder SetSnapshot(global::bnet.protocol.achievements.Snapshot.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasSnapshot = true; + result.snapshot_ = builderForValue.Build(); + return this; + } + public Builder MergeSnapshot(global::bnet.protocol.achievements.Snapshot value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasSnapshot && + result.snapshot_ != global::bnet.protocol.achievements.Snapshot.DefaultInstance) { + result.snapshot_ = global::bnet.protocol.achievements.Snapshot.CreateBuilder(result.snapshot_).MergeFrom(value).BuildPartial(); + } else { + result.snapshot_ = value; + } + result.hasSnapshot = true; + return this; + } + public Builder ClearSnapshot() { + PrepareBuilder(); + result.hasSnapshot = false; + result.snapshot_ = null; + return this; + } + } + static RequestSnapshotResponse() { + object.ReferenceEquals(global::bnet.protocol.achievements.Proto.AchievementsService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class InitializeRequest : pb::GeneratedMessage { + private InitializeRequest() { } + private static readonly InitializeRequest defaultInstance = new InitializeRequest().MakeReadOnly(); + private static readonly string[] _initializeRequestFieldNames = new string[] { "object_id", "program_id" }; + private static readonly uint[] _initializeRequestFieldTags = new uint[] { 16, 13 }; + public static InitializeRequest DefaultInstance { + get { return defaultInstance; } + } + + public override InitializeRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override InitializeRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_InitializeRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_InitializeRequest__FieldAccessorTable; } + } + + public const int ProgramIdFieldNumber = 1; + private bool hasProgramId; + private uint programId_; + public bool HasProgramId { + get { return hasProgramId; } + } + public uint ProgramId { + get { return programId_; } + } + + public const int ObjectIdFieldNumber = 2; + private bool hasObjectId; + private ulong objectId_; + public bool HasObjectId { + get { return hasObjectId; } + } + public ulong ObjectId { + get { return objectId_; } + } + + public override bool IsInitialized { + get { + if (!hasObjectId) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _initializeRequestFieldNames; + if (hasProgramId) { + output.WriteFixed32(1, field_names[1], ProgramId); + } + if (hasObjectId) { + output.WriteUInt64(2, field_names[0], ObjectId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasProgramId) { + size += pb::CodedOutputStream.ComputeFixed32Size(1, ProgramId); + } + if (hasObjectId) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, ObjectId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static InitializeRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static InitializeRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static InitializeRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static InitializeRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static InitializeRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static InitializeRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static InitializeRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static InitializeRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static InitializeRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static InitializeRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private InitializeRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(InitializeRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(InitializeRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private InitializeRequest result; + + private InitializeRequest PrepareBuilder() { + if (resultIsReadOnly) { + InitializeRequest original = result; + result = new InitializeRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override InitializeRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.InitializeRequest.Descriptor; } + } + + public override InitializeRequest DefaultInstanceForType { + get { return global::bnet.protocol.achievements.InitializeRequest.DefaultInstance; } + } + + public override InitializeRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is InitializeRequest) { + return MergeFrom((InitializeRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(InitializeRequest other) { + if (other == global::bnet.protocol.achievements.InitializeRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasProgramId) { + ProgramId = other.ProgramId; + } + if (other.HasObjectId) { + ObjectId = other.ObjectId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_initializeRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _initializeRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 13: { + result.hasProgramId = input.ReadFixed32(ref result.programId_); + break; + } + case 16: { + result.hasObjectId = input.ReadUInt64(ref result.objectId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasProgramId { + get { return result.hasProgramId; } + } + public uint ProgramId { + get { return result.ProgramId; } + set { SetProgramId(value); } + } + public Builder SetProgramId(uint value) { + PrepareBuilder(); + result.hasProgramId = true; + result.programId_ = value; + return this; + } + public Builder ClearProgramId() { + PrepareBuilder(); + result.hasProgramId = false; + result.programId_ = 0; + return this; + } + + public bool HasObjectId { + get { return result.hasObjectId; } + } + public ulong ObjectId { + get { return result.ObjectId; } + set { SetObjectId(value); } + } + public Builder SetObjectId(ulong value) { + PrepareBuilder(); + result.hasObjectId = true; + result.objectId_ = value; + return this; + } + public Builder ClearObjectId() { + PrepareBuilder(); + result.hasObjectId = false; + result.objectId_ = 0UL; + return this; + } + } + static InitializeRequest() { + object.ReferenceEquals(global::bnet.protocol.achievements.Proto.AchievementsService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class InitializeResponse : pb::GeneratedMessage { + private InitializeResponse() { } + private static readonly InitializeResponse defaultInstance = new InitializeResponse().MakeReadOnly(); + private static readonly string[] _initializeResponseFieldNames = new string[] { "content_handle", "flush_frequency", "max_achievements_per_record", "max_criteria_per_record", "max_records_per_update", "max_registrations" }; + private static readonly uint[] _initializeResponseFieldTags = new uint[] { 10, 48, 32, 24, 16, 40 }; + public static InitializeResponse DefaultInstance { + get { return defaultInstance; } + } + + public override InitializeResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override InitializeResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_InitializeResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_InitializeResponse__FieldAccessorTable; } + } + + public const int ContentHandleFieldNumber = 1; + private bool hasContentHandle; + private global::bnet.protocol.ContentHandle contentHandle_; + public bool HasContentHandle { + get { return hasContentHandle; } + } + public global::bnet.protocol.ContentHandle ContentHandle { + get { return contentHandle_ ?? global::bnet.protocol.ContentHandle.DefaultInstance; } + } + + public const int MaxRecordsPerUpdateFieldNumber = 2; + private bool hasMaxRecordsPerUpdate; + private uint maxRecordsPerUpdate_; + public bool HasMaxRecordsPerUpdate { + get { return hasMaxRecordsPerUpdate; } + } + public uint MaxRecordsPerUpdate { + get { return maxRecordsPerUpdate_; } + } + + public const int MaxCriteriaPerRecordFieldNumber = 3; + private bool hasMaxCriteriaPerRecord; + private uint maxCriteriaPerRecord_; + public bool HasMaxCriteriaPerRecord { + get { return hasMaxCriteriaPerRecord; } + } + public uint MaxCriteriaPerRecord { + get { return maxCriteriaPerRecord_; } + } + + public const int MaxAchievementsPerRecordFieldNumber = 4; + private bool hasMaxAchievementsPerRecord; + private uint maxAchievementsPerRecord_; + public bool HasMaxAchievementsPerRecord { + get { return hasMaxAchievementsPerRecord; } + } + public uint MaxAchievementsPerRecord { + get { return maxAchievementsPerRecord_; } + } + + public const int MaxRegistrationsFieldNumber = 5; + private bool hasMaxRegistrations; + private uint maxRegistrations_; + public bool HasMaxRegistrations { + get { return hasMaxRegistrations; } + } + public uint MaxRegistrations { + get { return maxRegistrations_; } + } + + public const int FlushFrequencyFieldNumber = 6; + private bool hasFlushFrequency; + private ulong flushFrequency_; + public bool HasFlushFrequency { + get { return hasFlushFrequency; } + } + public ulong FlushFrequency { + get { return flushFrequency_; } + } + + public override bool IsInitialized { + get { + if (!hasContentHandle) return false; + if (!ContentHandle.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _initializeResponseFieldNames; + if (hasContentHandle) { + output.WriteMessage(1, field_names[0], ContentHandle); + } + if (hasMaxRecordsPerUpdate) { + output.WriteUInt32(2, field_names[4], MaxRecordsPerUpdate); + } + if (hasMaxCriteriaPerRecord) { + output.WriteUInt32(3, field_names[3], MaxCriteriaPerRecord); + } + if (hasMaxAchievementsPerRecord) { + output.WriteUInt32(4, field_names[2], MaxAchievementsPerRecord); + } + if (hasMaxRegistrations) { + output.WriteUInt32(5, field_names[5], MaxRegistrations); + } + if (hasFlushFrequency) { + output.WriteUInt64(6, field_names[1], FlushFrequency); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasContentHandle) { + size += pb::CodedOutputStream.ComputeMessageSize(1, ContentHandle); + } + if (hasMaxRecordsPerUpdate) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, MaxRecordsPerUpdate); + } + if (hasMaxCriteriaPerRecord) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, MaxCriteriaPerRecord); + } + if (hasMaxAchievementsPerRecord) { + size += pb::CodedOutputStream.ComputeUInt32Size(4, MaxAchievementsPerRecord); + } + if (hasMaxRegistrations) { + size += pb::CodedOutputStream.ComputeUInt32Size(5, MaxRegistrations); + } + if (hasFlushFrequency) { + size += pb::CodedOutputStream.ComputeUInt64Size(6, FlushFrequency); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static InitializeResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static InitializeResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static InitializeResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static InitializeResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static InitializeResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static InitializeResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static InitializeResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static InitializeResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static InitializeResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static InitializeResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private InitializeResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(InitializeResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(InitializeResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private InitializeResponse result; + + private InitializeResponse PrepareBuilder() { + if (resultIsReadOnly) { + InitializeResponse original = result; + result = new InitializeResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override InitializeResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.InitializeResponse.Descriptor; } + } + + public override InitializeResponse DefaultInstanceForType { + get { return global::bnet.protocol.achievements.InitializeResponse.DefaultInstance; } + } + + public override InitializeResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is InitializeResponse) { + return MergeFrom((InitializeResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(InitializeResponse other) { + if (other == global::bnet.protocol.achievements.InitializeResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasContentHandle) { + MergeContentHandle(other.ContentHandle); + } + if (other.HasMaxRecordsPerUpdate) { + MaxRecordsPerUpdate = other.MaxRecordsPerUpdate; + } + if (other.HasMaxCriteriaPerRecord) { + MaxCriteriaPerRecord = other.MaxCriteriaPerRecord; + } + if (other.HasMaxAchievementsPerRecord) { + MaxAchievementsPerRecord = other.MaxAchievementsPerRecord; + } + if (other.HasMaxRegistrations) { + MaxRegistrations = other.MaxRegistrations; + } + if (other.HasFlushFrequency) { + FlushFrequency = other.FlushFrequency; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_initializeResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _initializeResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.ContentHandle.Builder subBuilder = global::bnet.protocol.ContentHandle.CreateBuilder(); + if (result.hasContentHandle) { + subBuilder.MergeFrom(ContentHandle); + } + input.ReadMessage(subBuilder, extensionRegistry); + ContentHandle = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasMaxRecordsPerUpdate = input.ReadUInt32(ref result.maxRecordsPerUpdate_); + break; + } + case 24: { + result.hasMaxCriteriaPerRecord = input.ReadUInt32(ref result.maxCriteriaPerRecord_); + break; + } + case 32: { + result.hasMaxAchievementsPerRecord = input.ReadUInt32(ref result.maxAchievementsPerRecord_); + break; + } + case 40: { + result.hasMaxRegistrations = input.ReadUInt32(ref result.maxRegistrations_); + break; + } + case 48: { + result.hasFlushFrequency = input.ReadUInt64(ref result.flushFrequency_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasContentHandle { + get { return result.hasContentHandle; } + } + public global::bnet.protocol.ContentHandle ContentHandle { + get { return result.ContentHandle; } + set { SetContentHandle(value); } + } + public Builder SetContentHandle(global::bnet.protocol.ContentHandle value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasContentHandle = true; + result.contentHandle_ = value; + return this; + } + public Builder SetContentHandle(global::bnet.protocol.ContentHandle.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasContentHandle = true; + result.contentHandle_ = builderForValue.Build(); + return this; + } + public Builder MergeContentHandle(global::bnet.protocol.ContentHandle value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasContentHandle && + result.contentHandle_ != global::bnet.protocol.ContentHandle.DefaultInstance) { + result.contentHandle_ = global::bnet.protocol.ContentHandle.CreateBuilder(result.contentHandle_).MergeFrom(value).BuildPartial(); + } else { + result.contentHandle_ = value; + } + result.hasContentHandle = true; + return this; + } + public Builder ClearContentHandle() { + PrepareBuilder(); + result.hasContentHandle = false; + result.contentHandle_ = null; + return this; + } + + public bool HasMaxRecordsPerUpdate { + get { return result.hasMaxRecordsPerUpdate; } + } + public uint MaxRecordsPerUpdate { + get { return result.MaxRecordsPerUpdate; } + set { SetMaxRecordsPerUpdate(value); } + } + public Builder SetMaxRecordsPerUpdate(uint value) { + PrepareBuilder(); + result.hasMaxRecordsPerUpdate = true; + result.maxRecordsPerUpdate_ = value; + return this; + } + public Builder ClearMaxRecordsPerUpdate() { + PrepareBuilder(); + result.hasMaxRecordsPerUpdate = false; + result.maxRecordsPerUpdate_ = 0; + return this; + } + + public bool HasMaxCriteriaPerRecord { + get { return result.hasMaxCriteriaPerRecord; } + } + public uint MaxCriteriaPerRecord { + get { return result.MaxCriteriaPerRecord; } + set { SetMaxCriteriaPerRecord(value); } + } + public Builder SetMaxCriteriaPerRecord(uint value) { + PrepareBuilder(); + result.hasMaxCriteriaPerRecord = true; + result.maxCriteriaPerRecord_ = value; + return this; + } + public Builder ClearMaxCriteriaPerRecord() { + PrepareBuilder(); + result.hasMaxCriteriaPerRecord = false; + result.maxCriteriaPerRecord_ = 0; + return this; + } + + public bool HasMaxAchievementsPerRecord { + get { return result.hasMaxAchievementsPerRecord; } + } + public uint MaxAchievementsPerRecord { + get { return result.MaxAchievementsPerRecord; } + set { SetMaxAchievementsPerRecord(value); } + } + public Builder SetMaxAchievementsPerRecord(uint value) { + PrepareBuilder(); + result.hasMaxAchievementsPerRecord = true; + result.maxAchievementsPerRecord_ = value; + return this; + } + public Builder ClearMaxAchievementsPerRecord() { + PrepareBuilder(); + result.hasMaxAchievementsPerRecord = false; + result.maxAchievementsPerRecord_ = 0; + return this; + } + + public bool HasMaxRegistrations { + get { return result.hasMaxRegistrations; } + } + public uint MaxRegistrations { + get { return result.MaxRegistrations; } + set { SetMaxRegistrations(value); } + } + public Builder SetMaxRegistrations(uint value) { + PrepareBuilder(); + result.hasMaxRegistrations = true; + result.maxRegistrations_ = value; + return this; + } + public Builder ClearMaxRegistrations() { + PrepareBuilder(); + result.hasMaxRegistrations = false; + result.maxRegistrations_ = 0; + return this; + } + + public bool HasFlushFrequency { + get { return result.hasFlushFrequency; } + } + public ulong FlushFrequency { + get { return result.FlushFrequency; } + set { SetFlushFrequency(value); } + } + public Builder SetFlushFrequency(ulong value) { + PrepareBuilder(); + result.hasFlushFrequency = true; + result.flushFrequency_ = value; + return this; + } + public Builder ClearFlushFrequency() { + PrepareBuilder(); + result.hasFlushFrequency = false; + result.flushFrequency_ = 0UL; + return this; + } + } + static InitializeResponse() { + object.ReferenceEquals(global::bnet.protocol.achievements.Proto.AchievementsService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class StaticDataHash : pb::GeneratedMessage { + private StaticDataHash() { } + private static readonly StaticDataHash defaultInstance = new StaticDataHash().MakeReadOnly(); + private static readonly string[] _staticDataHashFieldNames = new string[] { "hash", "program_id" }; + private static readonly uint[] _staticDataHashFieldTags = new uint[] { 18, 13 }; + public static StaticDataHash DefaultInstance { + get { return defaultInstance; } + } + + public override StaticDataHash DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override StaticDataHash ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_StaticDataHash__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_StaticDataHash__FieldAccessorTable; } + } + + public const int ProgramIdFieldNumber = 1; + private bool hasProgramId; + private uint programId_; + public bool HasProgramId { + get { return hasProgramId; } + } + public uint ProgramId { + get { return programId_; } + } + + public const int HashFieldNumber = 2; + private bool hasHash; + private string hash_ = ""; + public bool HasHash { + get { return hasHash; } + } + public string Hash { + get { return hash_; } + } + + public override bool IsInitialized { + get { + if (!hasProgramId) return false; + if (!hasHash) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _staticDataHashFieldNames; + if (hasProgramId) { + output.WriteFixed32(1, field_names[1], ProgramId); + } + if (hasHash) { + output.WriteString(2, field_names[0], Hash); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasProgramId) { + size += pb::CodedOutputStream.ComputeFixed32Size(1, ProgramId); + } + if (hasHash) { + size += pb::CodedOutputStream.ComputeStringSize(2, Hash); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static StaticDataHash ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static StaticDataHash ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static StaticDataHash ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static StaticDataHash ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static StaticDataHash ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static StaticDataHash ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static StaticDataHash ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static StaticDataHash ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static StaticDataHash ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static StaticDataHash ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private StaticDataHash MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(StaticDataHash prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(StaticDataHash cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private StaticDataHash result; + + private StaticDataHash PrepareBuilder() { + if (resultIsReadOnly) { + StaticDataHash original = result; + result = new StaticDataHash(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override StaticDataHash MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.StaticDataHash.Descriptor; } + } + + public override StaticDataHash DefaultInstanceForType { + get { return global::bnet.protocol.achievements.StaticDataHash.DefaultInstance; } + } + + public override StaticDataHash BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is StaticDataHash) { + return MergeFrom((StaticDataHash) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(StaticDataHash other) { + if (other == global::bnet.protocol.achievements.StaticDataHash.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasProgramId) { + ProgramId = other.ProgramId; + } + if (other.HasHash) { + Hash = other.Hash; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_staticDataHashFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _staticDataHashFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 13: { + result.hasProgramId = input.ReadFixed32(ref result.programId_); + break; + } + case 18: { + result.hasHash = input.ReadString(ref result.hash_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasProgramId { + get { return result.hasProgramId; } + } + public uint ProgramId { + get { return result.ProgramId; } + set { SetProgramId(value); } + } + public Builder SetProgramId(uint value) { + PrepareBuilder(); + result.hasProgramId = true; + result.programId_ = value; + return this; + } + public Builder ClearProgramId() { + PrepareBuilder(); + result.hasProgramId = false; + result.programId_ = 0; + return this; + } + + public bool HasHash { + get { return result.hasHash; } + } + public string Hash { + get { return result.Hash; } + set { SetHash(value); } + } + public Builder SetHash(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasHash = true; + result.hash_ = value; + return this; + } + public Builder ClearHash() { + PrepareBuilder(); + result.hasHash = false; + result.hash_ = ""; + return this; + } + } + static StaticDataHash() { + object.ReferenceEquals(global::bnet.protocol.achievements.Proto.AchievementsService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ValidateStaticDataRequest : pb::GeneratedMessage { + private ValidateStaticDataRequest() { } + private static readonly ValidateStaticDataRequest defaultInstance = new ValidateStaticDataRequest().MakeReadOnly(); + private static readonly string[] _validateStaticDataRequestFieldNames = new string[] { "static_data_hash" }; + private static readonly uint[] _validateStaticDataRequestFieldTags = new uint[] { 10 }; + public static ValidateStaticDataRequest DefaultInstance { + get { return defaultInstance; } + } + + public override ValidateStaticDataRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ValidateStaticDataRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_ValidateStaticDataRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_ValidateStaticDataRequest__FieldAccessorTable; } + } + + public const int StaticDataHashFieldNumber = 1; + private pbc::PopsicleList staticDataHash_ = new pbc::PopsicleList(); + public scg::IList StaticDataHashList { + get { return staticDataHash_; } + } + public int StaticDataHashCount { + get { return staticDataHash_.Count; } + } + public global::bnet.protocol.achievements.StaticDataHash GetStaticDataHash(int index) { + return staticDataHash_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.achievements.StaticDataHash element in StaticDataHashList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _validateStaticDataRequestFieldNames; + if (staticDataHash_.Count > 0) { + output.WriteMessageArray(1, field_names[0], staticDataHash_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.achievements.StaticDataHash element in StaticDataHashList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ValidateStaticDataRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ValidateStaticDataRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ValidateStaticDataRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ValidateStaticDataRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ValidateStaticDataRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ValidateStaticDataRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ValidateStaticDataRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ValidateStaticDataRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ValidateStaticDataRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ValidateStaticDataRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ValidateStaticDataRequest MakeReadOnly() { + staticDataHash_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ValidateStaticDataRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ValidateStaticDataRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ValidateStaticDataRequest result; + + private ValidateStaticDataRequest PrepareBuilder() { + if (resultIsReadOnly) { + ValidateStaticDataRequest original = result; + result = new ValidateStaticDataRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ValidateStaticDataRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.ValidateStaticDataRequest.Descriptor; } + } + + public override ValidateStaticDataRequest DefaultInstanceForType { + get { return global::bnet.protocol.achievements.ValidateStaticDataRequest.DefaultInstance; } + } + + public override ValidateStaticDataRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ValidateStaticDataRequest) { + return MergeFrom((ValidateStaticDataRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ValidateStaticDataRequest other) { + if (other == global::bnet.protocol.achievements.ValidateStaticDataRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.staticDataHash_.Count != 0) { + result.staticDataHash_.Add(other.staticDataHash_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_validateStaticDataRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _validateStaticDataRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.staticDataHash_, global::bnet.protocol.achievements.StaticDataHash.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList StaticDataHashList { + get { return PrepareBuilder().staticDataHash_; } + } + public int StaticDataHashCount { + get { return result.StaticDataHashCount; } + } + public global::bnet.protocol.achievements.StaticDataHash GetStaticDataHash(int index) { + return result.GetStaticDataHash(index); + } + public Builder SetStaticDataHash(int index, global::bnet.protocol.achievements.StaticDataHash value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.staticDataHash_[index] = value; + return this; + } + public Builder SetStaticDataHash(int index, global::bnet.protocol.achievements.StaticDataHash.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.staticDataHash_[index] = builderForValue.Build(); + return this; + } + public Builder AddStaticDataHash(global::bnet.protocol.achievements.StaticDataHash value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.staticDataHash_.Add(value); + return this; + } + public Builder AddStaticDataHash(global::bnet.protocol.achievements.StaticDataHash.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.staticDataHash_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeStaticDataHash(scg::IEnumerable values) { + PrepareBuilder(); + result.staticDataHash_.Add(values); + return this; + } + public Builder ClearStaticDataHash() { + PrepareBuilder(); + result.staticDataHash_.Clear(); + return this; + } + } + static ValidateStaticDataRequest() { + object.ReferenceEquals(global::bnet.protocol.achievements.Proto.AchievementsService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class SnapshotUpdateNotification : pb::GeneratedMessage { + private SnapshotUpdateNotification() { } + private static readonly SnapshotUpdateNotification defaultInstance = new SnapshotUpdateNotification().MakeReadOnly(); + private static readonly string[] _snapshotUpdateNotificationFieldNames = new string[] { "snapshot", "target_id" }; + private static readonly uint[] _snapshotUpdateNotificationFieldTags = new uint[] { 18, 10 }; + public static SnapshotUpdateNotification DefaultInstance { + get { return defaultInstance; } + } + + public override SnapshotUpdateNotification DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SnapshotUpdateNotification ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_SnapshotUpdateNotification__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_SnapshotUpdateNotification__FieldAccessorTable; } + } + + public const int TargetIdFieldNumber = 1; + private bool hasTargetId; + private global::bnet.protocol.EntityId targetId_; + public bool HasTargetId { + get { return hasTargetId; } + } + public global::bnet.protocol.EntityId TargetId { + get { return targetId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int SnapshotFieldNumber = 2; + private bool hasSnapshot; + private global::bnet.protocol.achievements.Snapshot snapshot_; + public bool HasSnapshot { + get { return hasSnapshot; } + } + public global::bnet.protocol.achievements.Snapshot Snapshot { + get { return snapshot_ ?? global::bnet.protocol.achievements.Snapshot.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasTargetId) return false; + if (!hasSnapshot) return false; + if (!TargetId.IsInitialized) return false; + if (!Snapshot.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _snapshotUpdateNotificationFieldNames; + if (hasTargetId) { + output.WriteMessage(1, field_names[1], TargetId); + } + if (hasSnapshot) { + output.WriteMessage(2, field_names[0], Snapshot); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTargetId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, TargetId); + } + if (hasSnapshot) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Snapshot); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static SnapshotUpdateNotification ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SnapshotUpdateNotification ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SnapshotUpdateNotification ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SnapshotUpdateNotification ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SnapshotUpdateNotification ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SnapshotUpdateNotification ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SnapshotUpdateNotification ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SnapshotUpdateNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SnapshotUpdateNotification ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SnapshotUpdateNotification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SnapshotUpdateNotification MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SnapshotUpdateNotification prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SnapshotUpdateNotification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SnapshotUpdateNotification result; + + private SnapshotUpdateNotification PrepareBuilder() { + if (resultIsReadOnly) { + SnapshotUpdateNotification original = result; + result = new SnapshotUpdateNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SnapshotUpdateNotification MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.SnapshotUpdateNotification.Descriptor; } + } + + public override SnapshotUpdateNotification DefaultInstanceForType { + get { return global::bnet.protocol.achievements.SnapshotUpdateNotification.DefaultInstance; } + } + + public override SnapshotUpdateNotification BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SnapshotUpdateNotification) { + return MergeFrom((SnapshotUpdateNotification) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SnapshotUpdateNotification other) { + if (other == global::bnet.protocol.achievements.SnapshotUpdateNotification.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTargetId) { + MergeTargetId(other.TargetId); + } + if (other.HasSnapshot) { + MergeSnapshot(other.Snapshot); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_snapshotUpdateNotificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _snapshotUpdateNotificationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasTargetId) { + subBuilder.MergeFrom(TargetId); + } + input.ReadMessage(subBuilder, extensionRegistry); + TargetId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.achievements.Snapshot.Builder subBuilder = global::bnet.protocol.achievements.Snapshot.CreateBuilder(); + if (result.hasSnapshot) { + subBuilder.MergeFrom(Snapshot); + } + input.ReadMessage(subBuilder, extensionRegistry); + Snapshot = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTargetId { + get { return result.hasTargetId; } + } + public global::bnet.protocol.EntityId TargetId { + get { return result.TargetId; } + set { SetTargetId(value); } + } + public Builder SetTargetId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTargetId = true; + result.targetId_ = value; + return this; + } + public Builder SetTargetId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasTargetId = true; + result.targetId_ = builderForValue.Build(); + return this; + } + public Builder MergeTargetId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasTargetId && + result.targetId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.targetId_ = global::bnet.protocol.EntityId.CreateBuilder(result.targetId_).MergeFrom(value).BuildPartial(); + } else { + result.targetId_ = value; + } + result.hasTargetId = true; + return this; + } + public Builder ClearTargetId() { + PrepareBuilder(); + result.hasTargetId = false; + result.targetId_ = null; + return this; + } + + public bool HasSnapshot { + get { return result.hasSnapshot; } + } + public global::bnet.protocol.achievements.Snapshot Snapshot { + get { return result.Snapshot; } + set { SetSnapshot(value); } + } + public Builder SetSnapshot(global::bnet.protocol.achievements.Snapshot value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasSnapshot = true; + result.snapshot_ = value; + return this; + } + public Builder SetSnapshot(global::bnet.protocol.achievements.Snapshot.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasSnapshot = true; + result.snapshot_ = builderForValue.Build(); + return this; + } + public Builder MergeSnapshot(global::bnet.protocol.achievements.Snapshot value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasSnapshot && + result.snapshot_ != global::bnet.protocol.achievements.Snapshot.DefaultInstance) { + result.snapshot_ = global::bnet.protocol.achievements.Snapshot.CreateBuilder(result.snapshot_).MergeFrom(value).BuildPartial(); + } else { + result.snapshot_ = value; + } + result.hasSnapshot = true; + return this; + } + public Builder ClearSnapshot() { + PrepareBuilder(); + result.hasSnapshot = false; + result.snapshot_ = null; + return this; + } + } + static SnapshotUpdateNotification() { + object.ReferenceEquals(global::bnet.protocol.achievements.Proto.AchievementsService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class FlushFrequencyUpdateNotification : pb::GeneratedMessage { + private FlushFrequencyUpdateNotification() { } + private static readonly FlushFrequencyUpdateNotification defaultInstance = new FlushFrequencyUpdateNotification().MakeReadOnly(); + private static readonly string[] _flushFrequencyUpdateNotificationFieldNames = new string[] { "flush_frequency" }; + private static readonly uint[] _flushFrequencyUpdateNotificationFieldTags = new uint[] { 8 }; + public static FlushFrequencyUpdateNotification DefaultInstance { + get { return defaultInstance; } + } + + public override FlushFrequencyUpdateNotification DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override FlushFrequencyUpdateNotification ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_FlushFrequencyUpdateNotification__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_FlushFrequencyUpdateNotification__FieldAccessorTable; } + } + + public const int FlushFrequencyFieldNumber = 1; + private bool hasFlushFrequency; + private ulong flushFrequency_; + public bool HasFlushFrequency { + get { return hasFlushFrequency; } + } + public ulong FlushFrequency { + get { return flushFrequency_; } + } + + public override bool IsInitialized { + get { + if (!hasFlushFrequency) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _flushFrequencyUpdateNotificationFieldNames; + if (hasFlushFrequency) { + output.WriteUInt64(1, field_names[0], FlushFrequency); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasFlushFrequency) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, FlushFrequency); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static FlushFrequencyUpdateNotification ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FlushFrequencyUpdateNotification ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FlushFrequencyUpdateNotification ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FlushFrequencyUpdateNotification ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FlushFrequencyUpdateNotification ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FlushFrequencyUpdateNotification ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static FlushFrequencyUpdateNotification ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static FlushFrequencyUpdateNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static FlushFrequencyUpdateNotification ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FlushFrequencyUpdateNotification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private FlushFrequencyUpdateNotification MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(FlushFrequencyUpdateNotification prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(FlushFrequencyUpdateNotification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private FlushFrequencyUpdateNotification result; + + private FlushFrequencyUpdateNotification PrepareBuilder() { + if (resultIsReadOnly) { + FlushFrequencyUpdateNotification original = result; + result = new FlushFrequencyUpdateNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override FlushFrequencyUpdateNotification MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.FlushFrequencyUpdateNotification.Descriptor; } + } + + public override FlushFrequencyUpdateNotification DefaultInstanceForType { + get { return global::bnet.protocol.achievements.FlushFrequencyUpdateNotification.DefaultInstance; } + } + + public override FlushFrequencyUpdateNotification BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is FlushFrequencyUpdateNotification) { + return MergeFrom((FlushFrequencyUpdateNotification) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(FlushFrequencyUpdateNotification other) { + if (other == global::bnet.protocol.achievements.FlushFrequencyUpdateNotification.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasFlushFrequency) { + FlushFrequency = other.FlushFrequency; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_flushFrequencyUpdateNotificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _flushFrequencyUpdateNotificationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasFlushFrequency = input.ReadUInt64(ref result.flushFrequency_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasFlushFrequency { + get { return result.hasFlushFrequency; } + } + public ulong FlushFrequency { + get { return result.FlushFrequency; } + set { SetFlushFrequency(value); } + } + public Builder SetFlushFrequency(ulong value) { + PrepareBuilder(); + result.hasFlushFrequency = true; + result.flushFrequency_ = value; + return this; + } + public Builder ClearFlushFrequency() { + PrepareBuilder(); + result.hasFlushFrequency = false; + result.flushFrequency_ = 0UL; + return this; + } + } + static FlushFrequencyUpdateNotification() { + object.ReferenceEquals(global::bnet.protocol.achievements.Proto.AchievementsService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class AchievementStats : pb::GeneratedMessage { + private AchievementStats() { } + private static readonly AchievementStats defaultInstance = new AchievementStats().MakeReadOnly(); + private static readonly string[] _achievementStatsFieldNames = new string[] { "count", "id" }; + private static readonly uint[] _achievementStatsFieldTags = new uint[] { 16, 8 }; + public static AchievementStats DefaultInstance { + get { return defaultInstance; } + } + + public override AchievementStats DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override AchievementStats ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_AchievementStats__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_AchievementStats__FieldAccessorTable; } + } + + public const int IdFieldNumber = 1; + private bool hasId; + private ulong id_; + public bool HasId { + get { return hasId; } + } + public ulong Id { + get { return id_; } + } + + public const int CountFieldNumber = 2; + private bool hasCount; + private ulong count_; + public bool HasCount { + get { return hasCount; } + } + public ulong Count { + get { return count_; } + } + + public override bool IsInitialized { + get { + if (!hasId) return false; + if (!hasCount) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _achievementStatsFieldNames; + if (hasId) { + output.WriteUInt64(1, field_names[1], Id); + } + if (hasCount) { + output.WriteUInt64(2, field_names[0], Count); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasId) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, Id); + } + if (hasCount) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, Count); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static AchievementStats ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AchievementStats ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AchievementStats ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AchievementStats ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AchievementStats ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AchievementStats ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static AchievementStats ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static AchievementStats ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static AchievementStats ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AchievementStats ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private AchievementStats MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(AchievementStats prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(AchievementStats cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private AchievementStats result; + + private AchievementStats PrepareBuilder() { + if (resultIsReadOnly) { + AchievementStats original = result; + result = new AchievementStats(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override AchievementStats MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.AchievementStats.Descriptor; } + } + + public override AchievementStats DefaultInstanceForType { + get { return global::bnet.protocol.achievements.AchievementStats.DefaultInstance; } + } + + public override AchievementStats BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is AchievementStats) { + return MergeFrom((AchievementStats) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(AchievementStats other) { + if (other == global::bnet.protocol.achievements.AchievementStats.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasId) { + Id = other.Id; + } + if (other.HasCount) { + Count = other.Count; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_achievementStatsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _achievementStatsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasId = input.ReadUInt64(ref result.id_); + break; + } + case 16: { + result.hasCount = input.ReadUInt64(ref result.count_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasId { + get { return result.hasId; } + } + public ulong Id { + get { return result.Id; } + set { SetId(value); } + } + public Builder SetId(ulong value) { + PrepareBuilder(); + result.hasId = true; + result.id_ = value; + return this; + } + public Builder ClearId() { + PrepareBuilder(); + result.hasId = false; + result.id_ = 0UL; + return this; + } + + public bool HasCount { + get { return result.hasCount; } + } + public ulong Count { + get { return result.Count; } + set { SetCount(value); } + } + public Builder SetCount(ulong value) { + PrepareBuilder(); + result.hasCount = true; + result.count_ = value; + return this; + } + public Builder ClearCount() { + PrepareBuilder(); + result.hasCount = false; + result.count_ = 0UL; + return this; + } + } + static AchievementStats() { + object.ReferenceEquals(global::bnet.protocol.achievements.Proto.AchievementsService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetAchievementStatsRequest : pb::GeneratedMessage { + private GetAchievementStatsRequest() { } + private static readonly GetAchievementStatsRequest defaultInstance = new GetAchievementStatsRequest().MakeReadOnly(); + private static readonly string[] _getAchievementStatsRequestFieldNames = new string[] { "program_id" }; + private static readonly uint[] _getAchievementStatsRequestFieldTags = new uint[] { 13 }; + public static GetAchievementStatsRequest DefaultInstance { + get { return defaultInstance; } + } + + public override GetAchievementStatsRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetAchievementStatsRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_GetAchievementStatsRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_GetAchievementStatsRequest__FieldAccessorTable; } + } + + public const int ProgramIdFieldNumber = 1; + private bool hasProgramId; + private uint programId_; + public bool HasProgramId { + get { return hasProgramId; } + } + public uint ProgramId { + get { return programId_; } + } + + public override bool IsInitialized { + get { + if (!hasProgramId) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getAchievementStatsRequestFieldNames; + if (hasProgramId) { + output.WriteFixed32(1, field_names[0], ProgramId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasProgramId) { + size += pb::CodedOutputStream.ComputeFixed32Size(1, ProgramId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetAchievementStatsRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetAchievementStatsRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetAchievementStatsRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetAchievementStatsRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetAchievementStatsRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetAchievementStatsRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetAchievementStatsRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetAchievementStatsRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetAchievementStatsRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetAchievementStatsRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetAchievementStatsRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetAchievementStatsRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetAchievementStatsRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetAchievementStatsRequest result; + + private GetAchievementStatsRequest PrepareBuilder() { + if (resultIsReadOnly) { + GetAchievementStatsRequest original = result; + result = new GetAchievementStatsRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetAchievementStatsRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.GetAchievementStatsRequest.Descriptor; } + } + + public override GetAchievementStatsRequest DefaultInstanceForType { + get { return global::bnet.protocol.achievements.GetAchievementStatsRequest.DefaultInstance; } + } + + public override GetAchievementStatsRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetAchievementStatsRequest) { + return MergeFrom((GetAchievementStatsRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetAchievementStatsRequest other) { + if (other == global::bnet.protocol.achievements.GetAchievementStatsRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasProgramId) { + ProgramId = other.ProgramId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getAchievementStatsRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getAchievementStatsRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 13: { + result.hasProgramId = input.ReadFixed32(ref result.programId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasProgramId { + get { return result.hasProgramId; } + } + public uint ProgramId { + get { return result.ProgramId; } + set { SetProgramId(value); } + } + public Builder SetProgramId(uint value) { + PrepareBuilder(); + result.hasProgramId = true; + result.programId_ = value; + return this; + } + public Builder ClearProgramId() { + PrepareBuilder(); + result.hasProgramId = false; + result.programId_ = 0; + return this; + } + } + static GetAchievementStatsRequest() { + object.ReferenceEquals(global::bnet.protocol.achievements.Proto.AchievementsService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetAchievementStatsResponse : pb::GeneratedMessage { + private GetAchievementStatsResponse() { } + private static readonly GetAchievementStatsResponse defaultInstance = new GetAchievementStatsResponse().MakeReadOnly(); + private static readonly string[] _getAchievementStatsResponseFieldNames = new string[] { "stats" }; + private static readonly uint[] _getAchievementStatsResponseFieldTags = new uint[] { 10 }; + public static GetAchievementStatsResponse DefaultInstance { + get { return defaultInstance; } + } + + public override GetAchievementStatsResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetAchievementStatsResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_GetAchievementStatsResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_GetAchievementStatsResponse__FieldAccessorTable; } + } + + public const int StatsFieldNumber = 1; + private pbc::PopsicleList stats_ = new pbc::PopsicleList(); + public scg::IList StatsList { + get { return stats_; } + } + public int StatsCount { + get { return stats_.Count; } + } + public global::bnet.protocol.achievements.AchievementStats GetStats(int index) { + return stats_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.achievements.AchievementStats element in StatsList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getAchievementStatsResponseFieldNames; + if (stats_.Count > 0) { + output.WriteMessageArray(1, field_names[0], stats_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.achievements.AchievementStats element in StatsList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetAchievementStatsResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetAchievementStatsResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetAchievementStatsResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetAchievementStatsResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetAchievementStatsResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetAchievementStatsResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetAchievementStatsResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetAchievementStatsResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetAchievementStatsResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetAchievementStatsResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetAchievementStatsResponse MakeReadOnly() { + stats_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetAchievementStatsResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetAchievementStatsResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetAchievementStatsResponse result; + + private GetAchievementStatsResponse PrepareBuilder() { + if (resultIsReadOnly) { + GetAchievementStatsResponse original = result; + result = new GetAchievementStatsResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetAchievementStatsResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.GetAchievementStatsResponse.Descriptor; } + } + + public override GetAchievementStatsResponse DefaultInstanceForType { + get { return global::bnet.protocol.achievements.GetAchievementStatsResponse.DefaultInstance; } + } + + public override GetAchievementStatsResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetAchievementStatsResponse) { + return MergeFrom((GetAchievementStatsResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetAchievementStatsResponse other) { + if (other == global::bnet.protocol.achievements.GetAchievementStatsResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.stats_.Count != 0) { + result.stats_.Add(other.stats_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getAchievementStatsResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getAchievementStatsResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.stats_, global::bnet.protocol.achievements.AchievementStats.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList StatsList { + get { return PrepareBuilder().stats_; } + } + public int StatsCount { + get { return result.StatsCount; } + } + public global::bnet.protocol.achievements.AchievementStats GetStats(int index) { + return result.GetStats(index); + } + public Builder SetStats(int index, global::bnet.protocol.achievements.AchievementStats value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.stats_[index] = value; + return this; + } + public Builder SetStats(int index, global::bnet.protocol.achievements.AchievementStats.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.stats_[index] = builderForValue.Build(); + return this; + } + public Builder AddStats(global::bnet.protocol.achievements.AchievementStats value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.stats_.Add(value); + return this; + } + public Builder AddStats(global::bnet.protocol.achievements.AchievementStats.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.stats_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeStats(scg::IEnumerable values) { + PrepareBuilder(); + result.stats_.Add(values); + return this; + } + public Builder ClearStats() { + PrepareBuilder(); + result.stats_.Clear(); + return this; + } + } + static GetAchievementStatsResponse() { + object.ReferenceEquals(global::bnet.protocol.achievements.Proto.AchievementsService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetCriteriaStatsRequest : pb::GeneratedMessage { + private GetCriteriaStatsRequest() { } + private static readonly GetCriteriaStatsRequest defaultInstance = new GetCriteriaStatsRequest().MakeReadOnly(); + private static readonly string[] _getCriteriaStatsRequestFieldNames = new string[] { "program_id" }; + private static readonly uint[] _getCriteriaStatsRequestFieldTags = new uint[] { 13 }; + public static GetCriteriaStatsRequest DefaultInstance { + get { return defaultInstance; } + } + + public override GetCriteriaStatsRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetCriteriaStatsRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_GetCriteriaStatsRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_GetCriteriaStatsRequest__FieldAccessorTable; } + } + + public const int ProgramIdFieldNumber = 1; + private bool hasProgramId; + private uint programId_; + public bool HasProgramId { + get { return hasProgramId; } + } + public uint ProgramId { + get { return programId_; } + } + + public override bool IsInitialized { + get { + if (!hasProgramId) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getCriteriaStatsRequestFieldNames; + if (hasProgramId) { + output.WriteFixed32(1, field_names[0], ProgramId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasProgramId) { + size += pb::CodedOutputStream.ComputeFixed32Size(1, ProgramId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetCriteriaStatsRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetCriteriaStatsRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetCriteriaStatsRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetCriteriaStatsRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetCriteriaStatsRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetCriteriaStatsRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetCriteriaStatsRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetCriteriaStatsRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetCriteriaStatsRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetCriteriaStatsRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetCriteriaStatsRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetCriteriaStatsRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetCriteriaStatsRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetCriteriaStatsRequest result; + + private GetCriteriaStatsRequest PrepareBuilder() { + if (resultIsReadOnly) { + GetCriteriaStatsRequest original = result; + result = new GetCriteriaStatsRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetCriteriaStatsRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.GetCriteriaStatsRequest.Descriptor; } + } + + public override GetCriteriaStatsRequest DefaultInstanceForType { + get { return global::bnet.protocol.achievements.GetCriteriaStatsRequest.DefaultInstance; } + } + + public override GetCriteriaStatsRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetCriteriaStatsRequest) { + return MergeFrom((GetCriteriaStatsRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetCriteriaStatsRequest other) { + if (other == global::bnet.protocol.achievements.GetCriteriaStatsRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasProgramId) { + ProgramId = other.ProgramId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getCriteriaStatsRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getCriteriaStatsRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 13: { + result.hasProgramId = input.ReadFixed32(ref result.programId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasProgramId { + get { return result.hasProgramId; } + } + public uint ProgramId { + get { return result.ProgramId; } + set { SetProgramId(value); } + } + public Builder SetProgramId(uint value) { + PrepareBuilder(); + result.hasProgramId = true; + result.programId_ = value; + return this; + } + public Builder ClearProgramId() { + PrepareBuilder(); + result.hasProgramId = false; + result.programId_ = 0; + return this; + } + } + static GetCriteriaStatsRequest() { + object.ReferenceEquals(global::bnet.protocol.achievements.Proto.AchievementsService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetCriteriaStatsResponse : pb::GeneratedMessage { + private GetCriteriaStatsResponse() { } + private static readonly GetCriteriaStatsResponse defaultInstance = new GetCriteriaStatsResponse().MakeReadOnly(); + private static readonly string[] _getCriteriaStatsResponseFieldNames = new string[] { "stats" }; + private static readonly uint[] _getCriteriaStatsResponseFieldTags = new uint[] { 10 }; + public static GetCriteriaStatsResponse DefaultInstance { + get { return defaultInstance; } + } + + public override GetCriteriaStatsResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetCriteriaStatsResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_GetCriteriaStatsResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_GetCriteriaStatsResponse__FieldAccessorTable; } + } + + public const int StatsFieldNumber = 1; + private pbc::PopsicleList stats_ = new pbc::PopsicleList(); + public scg::IList StatsList { + get { return stats_; } + } + public int StatsCount { + get { return stats_.Count; } + } + public global::bnet.protocol.achievements.AchievementStats GetStats(int index) { + return stats_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.achievements.AchievementStats element in StatsList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getCriteriaStatsResponseFieldNames; + if (stats_.Count > 0) { + output.WriteMessageArray(1, field_names[0], stats_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.achievements.AchievementStats element in StatsList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetCriteriaStatsResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetCriteriaStatsResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetCriteriaStatsResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetCriteriaStatsResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetCriteriaStatsResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetCriteriaStatsResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetCriteriaStatsResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetCriteriaStatsResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetCriteriaStatsResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetCriteriaStatsResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetCriteriaStatsResponse MakeReadOnly() { + stats_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetCriteriaStatsResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetCriteriaStatsResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetCriteriaStatsResponse result; + + private GetCriteriaStatsResponse PrepareBuilder() { + if (resultIsReadOnly) { + GetCriteriaStatsResponse original = result; + result = new GetCriteriaStatsResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetCriteriaStatsResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.GetCriteriaStatsResponse.Descriptor; } + } + + public override GetCriteriaStatsResponse DefaultInstanceForType { + get { return global::bnet.protocol.achievements.GetCriteriaStatsResponse.DefaultInstance; } + } + + public override GetCriteriaStatsResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetCriteriaStatsResponse) { + return MergeFrom((GetCriteriaStatsResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetCriteriaStatsResponse other) { + if (other == global::bnet.protocol.achievements.GetCriteriaStatsResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.stats_.Count != 0) { + result.stats_.Add(other.stats_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getCriteriaStatsResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getCriteriaStatsResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.stats_, global::bnet.protocol.achievements.AchievementStats.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList StatsList { + get { return PrepareBuilder().stats_; } + } + public int StatsCount { + get { return result.StatsCount; } + } + public global::bnet.protocol.achievements.AchievementStats GetStats(int index) { + return result.GetStats(index); + } + public Builder SetStats(int index, global::bnet.protocol.achievements.AchievementStats value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.stats_[index] = value; + return this; + } + public Builder SetStats(int index, global::bnet.protocol.achievements.AchievementStats.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.stats_[index] = builderForValue.Build(); + return this; + } + public Builder AddStats(global::bnet.protocol.achievements.AchievementStats value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.stats_.Add(value); + return this; + } + public Builder AddStats(global::bnet.protocol.achievements.AchievementStats.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.stats_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeStats(scg::IEnumerable values) { + PrepareBuilder(); + result.stats_.Add(values); + return this; + } + public Builder ClearStats() { + PrepareBuilder(); + result.stats_.Clear(); + return this; + } + } + static GetCriteriaStatsResponse() { + object.ReferenceEquals(global::bnet.protocol.achievements.Proto.AchievementsService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class RevokeAchievementRequest : pb::GeneratedMessage { + private RevokeAchievementRequest() { } + private static readonly RevokeAchievementRequest defaultInstance = new RevokeAchievementRequest().MakeReadOnly(); + private static readonly string[] _revokeAchievementRequestFieldNames = new string[] { "entity_id", "id" }; + private static readonly uint[] _revokeAchievementRequestFieldTags = new uint[] { 10, 16 }; + public static RevokeAchievementRequest DefaultInstance { + get { return defaultInstance; } + } + + public override RevokeAchievementRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override RevokeAchievementRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_RevokeAchievementRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_RevokeAchievementRequest__FieldAccessorTable; } + } + + public const int EntityIdFieldNumber = 1; + private bool hasEntityId; + private global::bnet.protocol.EntityId entityId_; + public bool HasEntityId { + get { return hasEntityId; } + } + public global::bnet.protocol.EntityId EntityId { + get { return entityId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int IdFieldNumber = 2; + private bool hasId; + private ulong id_; + public bool HasId { + get { return hasId; } + } + public ulong Id { + get { return id_; } + } + + public override bool IsInitialized { + get { + if (!hasEntityId) return false; + if (!hasId) return false; + if (!EntityId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _revokeAchievementRequestFieldNames; + if (hasEntityId) { + output.WriteMessage(1, field_names[0], EntityId); + } + if (hasId) { + output.WriteUInt64(2, field_names[1], Id); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasEntityId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, EntityId); + } + if (hasId) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, Id); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static RevokeAchievementRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RevokeAchievementRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RevokeAchievementRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RevokeAchievementRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RevokeAchievementRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RevokeAchievementRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static RevokeAchievementRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static RevokeAchievementRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static RevokeAchievementRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RevokeAchievementRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private RevokeAchievementRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(RevokeAchievementRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(RevokeAchievementRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private RevokeAchievementRequest result; + + private RevokeAchievementRequest PrepareBuilder() { + if (resultIsReadOnly) { + RevokeAchievementRequest original = result; + result = new RevokeAchievementRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override RevokeAchievementRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.RevokeAchievementRequest.Descriptor; } + } + + public override RevokeAchievementRequest DefaultInstanceForType { + get { return global::bnet.protocol.achievements.RevokeAchievementRequest.DefaultInstance; } + } + + public override RevokeAchievementRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is RevokeAchievementRequest) { + return MergeFrom((RevokeAchievementRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(RevokeAchievementRequest other) { + if (other == global::bnet.protocol.achievements.RevokeAchievementRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasEntityId) { + MergeEntityId(other.EntityId); + } + if (other.HasId) { + Id = other.Id; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_revokeAchievementRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _revokeAchievementRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasEntityId) { + subBuilder.MergeFrom(EntityId); + } + input.ReadMessage(subBuilder, extensionRegistry); + EntityId = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasId = input.ReadUInt64(ref result.id_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasEntityId { + get { return result.hasEntityId; } + } + public global::bnet.protocol.EntityId EntityId { + get { return result.EntityId; } + set { SetEntityId(value); } + } + public Builder SetEntityId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasEntityId = true; + result.entityId_ = value; + return this; + } + public Builder SetEntityId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasEntityId = true; + result.entityId_ = builderForValue.Build(); + return this; + } + public Builder MergeEntityId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasEntityId && + result.entityId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.entityId_ = global::bnet.protocol.EntityId.CreateBuilder(result.entityId_).MergeFrom(value).BuildPartial(); + } else { + result.entityId_ = value; + } + result.hasEntityId = true; + return this; + } + public Builder ClearEntityId() { + PrepareBuilder(); + result.hasEntityId = false; + result.entityId_ = null; + return this; + } + + public bool HasId { + get { return result.hasId; } + } + public ulong Id { + get { return result.Id; } + set { SetId(value); } + } + public Builder SetId(ulong value) { + PrepareBuilder(); + result.hasId = true; + result.id_ = value; + return this; + } + public Builder ClearId() { + PrepareBuilder(); + result.hasId = false; + result.id_ = 0UL; + return this; + } + } + static RevokeAchievementRequest() { + object.ReferenceEquals(global::bnet.protocol.achievements.Proto.AchievementsService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class RevokeAchievementResponse : pb::GeneratedMessage { + private RevokeAchievementResponse() { } + private static readonly RevokeAchievementResponse defaultInstance = new RevokeAchievementResponse().MakeReadOnly(); + private static readonly string[] _revokeAchievementResponseFieldNames = new string[] { "revoked_count" }; + private static readonly uint[] _revokeAchievementResponseFieldTags = new uint[] { 8 }; + public static RevokeAchievementResponse DefaultInstance { + get { return defaultInstance; } + } + + public override RevokeAchievementResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override RevokeAchievementResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_RevokeAchievementResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_RevokeAchievementResponse__FieldAccessorTable; } + } + + public const int RevokedCountFieldNumber = 1; + private bool hasRevokedCount; + private uint revokedCount_; + public bool HasRevokedCount { + get { return hasRevokedCount; } + } + public uint RevokedCount { + get { return revokedCount_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _revokeAchievementResponseFieldNames; + if (hasRevokedCount) { + output.WriteUInt32(1, field_names[0], RevokedCount); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasRevokedCount) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, RevokedCount); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static RevokeAchievementResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RevokeAchievementResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RevokeAchievementResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RevokeAchievementResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RevokeAchievementResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RevokeAchievementResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static RevokeAchievementResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static RevokeAchievementResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static RevokeAchievementResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RevokeAchievementResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private RevokeAchievementResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(RevokeAchievementResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(RevokeAchievementResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private RevokeAchievementResponse result; + + private RevokeAchievementResponse PrepareBuilder() { + if (resultIsReadOnly) { + RevokeAchievementResponse original = result; + result = new RevokeAchievementResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override RevokeAchievementResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.RevokeAchievementResponse.Descriptor; } + } + + public override RevokeAchievementResponse DefaultInstanceForType { + get { return global::bnet.protocol.achievements.RevokeAchievementResponse.DefaultInstance; } + } + + public override RevokeAchievementResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is RevokeAchievementResponse) { + return MergeFrom((RevokeAchievementResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(RevokeAchievementResponse other) { + if (other == global::bnet.protocol.achievements.RevokeAchievementResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasRevokedCount) { + RevokedCount = other.RevokedCount; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_revokeAchievementResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _revokeAchievementResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasRevokedCount = input.ReadUInt32(ref result.revokedCount_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasRevokedCount { + get { return result.hasRevokedCount; } + } + public uint RevokedCount { + get { return result.RevokedCount; } + set { SetRevokedCount(value); } + } + public Builder SetRevokedCount(uint value) { + PrepareBuilder(); + result.hasRevokedCount = true; + result.revokedCount_ = value; + return this; + } + public Builder ClearRevokedCount() { + PrepareBuilder(); + result.hasRevokedCount = false; + result.revokedCount_ = 0; + return this; + } + } + static RevokeAchievementResponse() { + object.ReferenceEquals(global::bnet.protocol.achievements.Proto.AchievementsService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class UpdateCriteriaRequest : pb::GeneratedMessage { + private UpdateCriteriaRequest() { } + private static readonly UpdateCriteriaRequest defaultInstance = new UpdateCriteriaRequest().MakeReadOnly(); + private static readonly string[] _updateCriteriaRequestFieldNames = new string[] { "entity_id", "flags", "id", "quantity" }; + private static readonly uint[] _updateCriteriaRequestFieldTags = new uint[] { 10, 32, 16, 24 }; + public static UpdateCriteriaRequest DefaultInstance { + get { return defaultInstance; } + } + + public override UpdateCriteriaRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override UpdateCriteriaRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_UpdateCriteriaRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_UpdateCriteriaRequest__FieldAccessorTable; } + } + + public const int EntityIdFieldNumber = 1; + private bool hasEntityId; + private global::bnet.protocol.EntityId entityId_; + public bool HasEntityId { + get { return hasEntityId; } + } + public global::bnet.protocol.EntityId EntityId { + get { return entityId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int IdFieldNumber = 2; + private bool hasId; + private ulong id_; + public bool HasId { + get { return hasId; } + } + public ulong Id { + get { return id_; } + } + + public const int QuantityFieldNumber = 3; + private bool hasQuantity; + private ulong quantity_; + public bool HasQuantity { + get { return hasQuantity; } + } + public ulong Quantity { + get { return quantity_; } + } + + public const int FlagsFieldNumber = 4; + private bool hasFlags; + private uint flags_; + public bool HasFlags { + get { return hasFlags; } + } + public uint Flags { + get { return flags_; } + } + + public override bool IsInitialized { + get { + if (!hasEntityId) return false; + if (!hasId) return false; + if (!hasQuantity) return false; + if (!EntityId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _updateCriteriaRequestFieldNames; + if (hasEntityId) { + output.WriteMessage(1, field_names[0], EntityId); + } + if (hasId) { + output.WriteUInt64(2, field_names[2], Id); + } + if (hasQuantity) { + output.WriteUInt64(3, field_names[3], Quantity); + } + if (hasFlags) { + output.WriteUInt32(4, field_names[1], Flags); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasEntityId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, EntityId); + } + if (hasId) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, Id); + } + if (hasQuantity) { + size += pb::CodedOutputStream.ComputeUInt64Size(3, Quantity); + } + if (hasFlags) { + size += pb::CodedOutputStream.ComputeUInt32Size(4, Flags); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static UpdateCriteriaRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UpdateCriteriaRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UpdateCriteriaRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UpdateCriteriaRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UpdateCriteriaRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UpdateCriteriaRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static UpdateCriteriaRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static UpdateCriteriaRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static UpdateCriteriaRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UpdateCriteriaRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private UpdateCriteriaRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(UpdateCriteriaRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(UpdateCriteriaRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private UpdateCriteriaRequest result; + + private UpdateCriteriaRequest PrepareBuilder() { + if (resultIsReadOnly) { + UpdateCriteriaRequest original = result; + result = new UpdateCriteriaRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override UpdateCriteriaRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.UpdateCriteriaRequest.Descriptor; } + } + + public override UpdateCriteriaRequest DefaultInstanceForType { + get { return global::bnet.protocol.achievements.UpdateCriteriaRequest.DefaultInstance; } + } + + public override UpdateCriteriaRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is UpdateCriteriaRequest) { + return MergeFrom((UpdateCriteriaRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(UpdateCriteriaRequest other) { + if (other == global::bnet.protocol.achievements.UpdateCriteriaRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasEntityId) { + MergeEntityId(other.EntityId); + } + if (other.HasId) { + Id = other.Id; + } + if (other.HasQuantity) { + Quantity = other.Quantity; + } + if (other.HasFlags) { + Flags = other.Flags; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_updateCriteriaRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _updateCriteriaRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasEntityId) { + subBuilder.MergeFrom(EntityId); + } + input.ReadMessage(subBuilder, extensionRegistry); + EntityId = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasId = input.ReadUInt64(ref result.id_); + break; + } + case 24: { + result.hasQuantity = input.ReadUInt64(ref result.quantity_); + break; + } + case 32: { + result.hasFlags = input.ReadUInt32(ref result.flags_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasEntityId { + get { return result.hasEntityId; } + } + public global::bnet.protocol.EntityId EntityId { + get { return result.EntityId; } + set { SetEntityId(value); } + } + public Builder SetEntityId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasEntityId = true; + result.entityId_ = value; + return this; + } + public Builder SetEntityId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasEntityId = true; + result.entityId_ = builderForValue.Build(); + return this; + } + public Builder MergeEntityId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasEntityId && + result.entityId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.entityId_ = global::bnet.protocol.EntityId.CreateBuilder(result.entityId_).MergeFrom(value).BuildPartial(); + } else { + result.entityId_ = value; + } + result.hasEntityId = true; + return this; + } + public Builder ClearEntityId() { + PrepareBuilder(); + result.hasEntityId = false; + result.entityId_ = null; + return this; + } + + public bool HasId { + get { return result.hasId; } + } + public ulong Id { + get { return result.Id; } + set { SetId(value); } + } + public Builder SetId(ulong value) { + PrepareBuilder(); + result.hasId = true; + result.id_ = value; + return this; + } + public Builder ClearId() { + PrepareBuilder(); + result.hasId = false; + result.id_ = 0UL; + return this; + } + + public bool HasQuantity { + get { return result.hasQuantity; } + } + public ulong Quantity { + get { return result.Quantity; } + set { SetQuantity(value); } + } + public Builder SetQuantity(ulong value) { + PrepareBuilder(); + result.hasQuantity = true; + result.quantity_ = value; + return this; + } + public Builder ClearQuantity() { + PrepareBuilder(); + result.hasQuantity = false; + result.quantity_ = 0UL; + return this; + } + + public bool HasFlags { + get { return result.hasFlags; } + } + public uint Flags { + get { return result.Flags; } + set { SetFlags(value); } + } + public Builder SetFlags(uint value) { + PrepareBuilder(); + result.hasFlags = true; + result.flags_ = value; + return this; + } + public Builder ClearFlags() { + PrepareBuilder(); + result.hasFlags = false; + result.flags_ = 0; + return this; + } + } + static UpdateCriteriaRequest() { + object.ReferenceEquals(global::bnet.protocol.achievements.Proto.AchievementsService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GrantAchievementRequest : pb::GeneratedMessage { + private GrantAchievementRequest() { } + private static readonly GrantAchievementRequest defaultInstance = new GrantAchievementRequest().MakeReadOnly(); + private static readonly string[] _grantAchievementRequestFieldNames = new string[] { "entity_id", "id" }; + private static readonly uint[] _grantAchievementRequestFieldTags = new uint[] { 10, 16 }; + public static GrantAchievementRequest DefaultInstance { + get { return defaultInstance; } + } + + public override GrantAchievementRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GrantAchievementRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_GrantAchievementRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_GrantAchievementRequest__FieldAccessorTable; } + } + + public const int EntityIdFieldNumber = 1; + private bool hasEntityId; + private global::bnet.protocol.EntityId entityId_; + public bool HasEntityId { + get { return hasEntityId; } + } + public global::bnet.protocol.EntityId EntityId { + get { return entityId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int IdFieldNumber = 2; + private bool hasId; + private ulong id_; + public bool HasId { + get { return hasId; } + } + public ulong Id { + get { return id_; } + } + + public override bool IsInitialized { + get { + if (!hasEntityId) return false; + if (!hasId) return false; + if (!EntityId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _grantAchievementRequestFieldNames; + if (hasEntityId) { + output.WriteMessage(1, field_names[0], EntityId); + } + if (hasId) { + output.WriteUInt64(2, field_names[1], Id); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasEntityId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, EntityId); + } + if (hasId) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, Id); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GrantAchievementRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GrantAchievementRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GrantAchievementRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GrantAchievementRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GrantAchievementRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GrantAchievementRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GrantAchievementRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GrantAchievementRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GrantAchievementRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GrantAchievementRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GrantAchievementRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GrantAchievementRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GrantAchievementRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GrantAchievementRequest result; + + private GrantAchievementRequest PrepareBuilder() { + if (resultIsReadOnly) { + GrantAchievementRequest original = result; + result = new GrantAchievementRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GrantAchievementRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.GrantAchievementRequest.Descriptor; } + } + + public override GrantAchievementRequest DefaultInstanceForType { + get { return global::bnet.protocol.achievements.GrantAchievementRequest.DefaultInstance; } + } + + public override GrantAchievementRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GrantAchievementRequest) { + return MergeFrom((GrantAchievementRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GrantAchievementRequest other) { + if (other == global::bnet.protocol.achievements.GrantAchievementRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasEntityId) { + MergeEntityId(other.EntityId); + } + if (other.HasId) { + Id = other.Id; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_grantAchievementRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _grantAchievementRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasEntityId) { + subBuilder.MergeFrom(EntityId); + } + input.ReadMessage(subBuilder, extensionRegistry); + EntityId = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasId = input.ReadUInt64(ref result.id_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasEntityId { + get { return result.hasEntityId; } + } + public global::bnet.protocol.EntityId EntityId { + get { return result.EntityId; } + set { SetEntityId(value); } + } + public Builder SetEntityId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasEntityId = true; + result.entityId_ = value; + return this; + } + public Builder SetEntityId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasEntityId = true; + result.entityId_ = builderForValue.Build(); + return this; + } + public Builder MergeEntityId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasEntityId && + result.entityId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.entityId_ = global::bnet.protocol.EntityId.CreateBuilder(result.entityId_).MergeFrom(value).BuildPartial(); + } else { + result.entityId_ = value; + } + result.hasEntityId = true; + return this; + } + public Builder ClearEntityId() { + PrepareBuilder(); + result.hasEntityId = false; + result.entityId_ = null; + return this; + } + + public bool HasId { + get { return result.hasId; } + } + public ulong Id { + get { return result.Id; } + set { SetId(value); } + } + public Builder SetId(ulong value) { + PrepareBuilder(); + result.hasId = true; + result.id_ = value; + return this; + } + public Builder ClearId() { + PrepareBuilder(); + result.hasId = false; + result.id_ = 0UL; + return this; + } + } + static GrantAchievementRequest() { + object.ReferenceEquals(global::bnet.protocol.achievements.Proto.AchievementsService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GrantAchievementResponse : pb::GeneratedMessage { + private GrantAchievementResponse() { } + private static readonly GrantAchievementResponse defaultInstance = new GrantAchievementResponse().MakeReadOnly(); + private static readonly string[] _grantAchievementResponseFieldNames = new string[] { "granted_count" }; + private static readonly uint[] _grantAchievementResponseFieldTags = new uint[] { 8 }; + public static GrantAchievementResponse DefaultInstance { + get { return defaultInstance; } + } + + public override GrantAchievementResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GrantAchievementResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_GrantAchievementResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_GrantAchievementResponse__FieldAccessorTable; } + } + + public const int GrantedCountFieldNumber = 1; + private bool hasGrantedCount; + private uint grantedCount_; + public bool HasGrantedCount { + get { return hasGrantedCount; } + } + public uint GrantedCount { + get { return grantedCount_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _grantAchievementResponseFieldNames; + if (hasGrantedCount) { + output.WriteUInt32(1, field_names[0], GrantedCount); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasGrantedCount) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, GrantedCount); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GrantAchievementResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GrantAchievementResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GrantAchievementResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GrantAchievementResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GrantAchievementResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GrantAchievementResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GrantAchievementResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GrantAchievementResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GrantAchievementResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GrantAchievementResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GrantAchievementResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GrantAchievementResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GrantAchievementResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GrantAchievementResponse result; + + private GrantAchievementResponse PrepareBuilder() { + if (resultIsReadOnly) { + GrantAchievementResponse original = result; + result = new GrantAchievementResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GrantAchievementResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.GrantAchievementResponse.Descriptor; } + } + + public override GrantAchievementResponse DefaultInstanceForType { + get { return global::bnet.protocol.achievements.GrantAchievementResponse.DefaultInstance; } + } + + public override GrantAchievementResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GrantAchievementResponse) { + return MergeFrom((GrantAchievementResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GrantAchievementResponse other) { + if (other == global::bnet.protocol.achievements.GrantAchievementResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasGrantedCount) { + GrantedCount = other.GrantedCount; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_grantAchievementResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _grantAchievementResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasGrantedCount = input.ReadUInt32(ref result.grantedCount_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasGrantedCount { + get { return result.hasGrantedCount; } + } + public uint GrantedCount { + get { return result.GrantedCount; } + set { SetGrantedCount(value); } + } + public Builder SetGrantedCount(uint value) { + PrepareBuilder(); + result.hasGrantedCount = true; + result.grantedCount_ = value; + return this; + } + public Builder ClearGrantedCount() { + PrepareBuilder(); + result.hasGrantedCount = false; + result.grantedCount_ = 0; + return this; + } + } + static GrantAchievementResponse() { + object.ReferenceEquals(global::bnet.protocol.achievements.Proto.AchievementsService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class CacheKillRequest : pb::GeneratedMessage { + private CacheKillRequest() { } + private static readonly CacheKillRequest defaultInstance = new CacheKillRequest().MakeReadOnly(); + private static readonly string[] _cacheKillRequestFieldNames = new string[] { "entity_id" }; + private static readonly uint[] _cacheKillRequestFieldTags = new uint[] { 10 }; + public static CacheKillRequest DefaultInstance { + get { return defaultInstance; } + } + + public override CacheKillRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override CacheKillRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_CacheKillRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Proto.AchievementsService.internal__static_bnet_protocol_achievements_CacheKillRequest__FieldAccessorTable; } + } + + public const int EntityIdFieldNumber = 1; + private bool hasEntityId; + private global::bnet.protocol.EntityId entityId_; + public bool HasEntityId { + get { return hasEntityId; } + } + public global::bnet.protocol.EntityId EntityId { + get { return entityId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (HasEntityId) { + if (!EntityId.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _cacheKillRequestFieldNames; + if (hasEntityId) { + output.WriteMessage(1, field_names[0], EntityId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasEntityId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, EntityId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static CacheKillRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CacheKillRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CacheKillRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CacheKillRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CacheKillRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CacheKillRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static CacheKillRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static CacheKillRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static CacheKillRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CacheKillRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CacheKillRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(CacheKillRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CacheKillRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CacheKillRequest result; + + private CacheKillRequest PrepareBuilder() { + if (resultIsReadOnly) { + CacheKillRequest original = result; + result = new CacheKillRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CacheKillRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.CacheKillRequest.Descriptor; } + } + + public override CacheKillRequest DefaultInstanceForType { + get { return global::bnet.protocol.achievements.CacheKillRequest.DefaultInstance; } + } + + public override CacheKillRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is CacheKillRequest) { + return MergeFrom((CacheKillRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(CacheKillRequest other) { + if (other == global::bnet.protocol.achievements.CacheKillRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasEntityId) { + MergeEntityId(other.EntityId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_cacheKillRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _cacheKillRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasEntityId) { + subBuilder.MergeFrom(EntityId); + } + input.ReadMessage(subBuilder, extensionRegistry); + EntityId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasEntityId { + get { return result.hasEntityId; } + } + public global::bnet.protocol.EntityId EntityId { + get { return result.EntityId; } + set { SetEntityId(value); } + } + public Builder SetEntityId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasEntityId = true; + result.entityId_ = value; + return this; + } + public Builder SetEntityId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasEntityId = true; + result.entityId_ = builderForValue.Build(); + return this; + } + public Builder MergeEntityId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasEntityId && + result.entityId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.entityId_ = global::bnet.protocol.EntityId.CreateBuilder(result.entityId_).MergeFrom(value).BuildPartial(); + } else { + result.entityId_ = value; + } + result.hasEntityId = true; + return this; + } + public Builder ClearEntityId() { + PrepareBuilder(); + result.hasEntityId = false; + result.entityId_ = null; + return this; + } + } + static CacheKillRequest() { + object.ReferenceEquals(global::bnet.protocol.achievements.Proto.AchievementsService.Descriptor, null); + } + } + + #endregion + + #region Services + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public abstract class AchievementsService : pb::IService { + public abstract void PostUpdate( + pb::IRpcController controller, + global::bnet.protocol.achievements.PostUpdateRequest request, + global::System.Action done); + public abstract void RegisterWithService( + pb::IRpcController controller, + global::bnet.protocol.achievements.RegisterWithServiceRequest request, + global::System.Action done); + public abstract void RequestSnapshot( + pb::IRpcController controller, + global::bnet.protocol.achievements.RequestSnapshotRequest request, + global::System.Action done); + public abstract void UnregisterFromService( + pb::IRpcController controller, + global::bnet.protocol.achievements.UnregisterFromServiceRequest request, + global::System.Action done); + public abstract void Initialize( + pb::IRpcController controller, + global::bnet.protocol.achievements.InitializeRequest request, + global::System.Action done); + public abstract void ValidateStaticData( + pb::IRpcController controller, + global::bnet.protocol.achievements.ValidateStaticDataRequest request, + global::System.Action done); + + public static pbd::ServiceDescriptor Descriptor { + get { return Proto.AchievementsService.Descriptor.Services[0]; } + } + public pbd::ServiceDescriptor DescriptorForType { + get { return Descriptor; } + } + + public void CallMethod( + pbd::MethodDescriptor method, + pb::IRpcController controller, + pb::IMessage request, + global::System.Action done) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.CallMethod() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + this.PostUpdate(controller, (global::bnet.protocol.achievements.PostUpdateRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 1: + this.RegisterWithService(controller, (global::bnet.protocol.achievements.RegisterWithServiceRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 2: + this.RequestSnapshot(controller, (global::bnet.protocol.achievements.RequestSnapshotRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 3: + this.UnregisterFromService(controller, (global::bnet.protocol.achievements.UnregisterFromServiceRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 4: + this.Initialize(controller, (global::bnet.protocol.achievements.InitializeRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 5: + this.ValidateStaticData(controller, (global::bnet.protocol.achievements.ValidateStaticDataRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetRequestPrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.achievements.PostUpdateRequest.DefaultInstance; + case 1: + return global::bnet.protocol.achievements.RegisterWithServiceRequest.DefaultInstance; + case 2: + return global::bnet.protocol.achievements.RequestSnapshotRequest.DefaultInstance; + case 3: + return global::bnet.protocol.achievements.UnregisterFromServiceRequest.DefaultInstance; + case 4: + return global::bnet.protocol.achievements.InitializeRequest.DefaultInstance; + case 5: + return global::bnet.protocol.achievements.ValidateStaticDataRequest.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetResponsePrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.achievements.PostUpdateResponse.DefaultInstance; + case 1: + return global::bnet.protocol.achievements.RegisterWithServiceResponse.DefaultInstance; + case 2: + return global::bnet.protocol.achievements.RequestSnapshotResponse.DefaultInstance; + case 3: + return global::bnet.protocol.NoData.DefaultInstance; + case 4: + return global::bnet.protocol.achievements.InitializeResponse.DefaultInstance; + case 5: + return global::bnet.protocol.NoData.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public static Stub CreateStub(pb::IRpcChannel channel) { + return new Stub(channel); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public class Stub : global::bnet.protocol.achievements.AchievementsService { + internal Stub(pb::IRpcChannel channel) { + this.channel = channel; + } + + private readonly pb::IRpcChannel channel; + + public pb::IRpcChannel Channel { + get { return channel; } + } + + public override void PostUpdate( + pb::IRpcController controller, + global::bnet.protocol.achievements.PostUpdateRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[0], + controller, request, global::bnet.protocol.achievements.PostUpdateResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.achievements.PostUpdateResponse.DefaultInstance)); + } + + public override void RegisterWithService( + pb::IRpcController controller, + global::bnet.protocol.achievements.RegisterWithServiceRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[1], + controller, request, global::bnet.protocol.achievements.RegisterWithServiceResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.achievements.RegisterWithServiceResponse.DefaultInstance)); + } + + public override void RequestSnapshot( + pb::IRpcController controller, + global::bnet.protocol.achievements.RequestSnapshotRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[2], + controller, request, global::bnet.protocol.achievements.RequestSnapshotResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.achievements.RequestSnapshotResponse.DefaultInstance)); + } + + public override void UnregisterFromService( + pb::IRpcController controller, + global::bnet.protocol.achievements.UnregisterFromServiceRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[3], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void Initialize( + pb::IRpcController controller, + global::bnet.protocol.achievements.InitializeRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[4], + controller, request, global::bnet.protocol.achievements.InitializeResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.achievements.InitializeResponse.DefaultInstance)); + } + + public override void ValidateStaticData( + pb::IRpcController controller, + global::bnet.protocol.achievements.ValidateStaticDataRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[5], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public abstract class AchievementsNotify : pb::IService { + public abstract void NotifySnapshotUpdate( + pb::IRpcController controller, + global::bnet.protocol.achievements.SnapshotUpdateNotification request, + global::System.Action done); + public abstract void NotifyFlushFrequencyUpdate( + pb::IRpcController controller, + global::bnet.protocol.achievements.FlushFrequencyUpdateNotification request, + global::System.Action done); + + public static pbd::ServiceDescriptor Descriptor { + get { return Proto.AchievementsService.Descriptor.Services[1]; } + } + public pbd::ServiceDescriptor DescriptorForType { + get { return Descriptor; } + } + + public void CallMethod( + pbd::MethodDescriptor method, + pb::IRpcController controller, + pb::IMessage request, + global::System.Action done) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.CallMethod() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + this.NotifySnapshotUpdate(controller, (global::bnet.protocol.achievements.SnapshotUpdateNotification) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 1: + this.NotifyFlushFrequencyUpdate(controller, (global::bnet.protocol.achievements.FlushFrequencyUpdateNotification) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetRequestPrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.achievements.SnapshotUpdateNotification.DefaultInstance; + case 1: + return global::bnet.protocol.achievements.FlushFrequencyUpdateNotification.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetResponsePrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.NO_RESPONSE.DefaultInstance; + case 1: + return global::bnet.protocol.NO_RESPONSE.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public static Stub CreateStub(pb::IRpcChannel channel) { + return new Stub(channel); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public class Stub : global::bnet.protocol.achievements.AchievementsNotify { + internal Stub(pb::IRpcChannel channel) { + this.channel = channel; + } + + private readonly pb::IRpcChannel channel; + + public pb::IRpcChannel Channel { + get { return channel; } + } + + public override void NotifySnapshotUpdate( + pb::IRpcController controller, + global::bnet.protocol.achievements.SnapshotUpdateNotification request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[0], + controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); + } + + public override void NotifyFlushFrequencyUpdate( + pb::IRpcController controller, + global::bnet.protocol.achievements.FlushFrequencyUpdateNotification request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[1], + controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); + } + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public abstract class AchievementsUtils : pb::IService { + public abstract void GetAchievementStats( + pb::IRpcController controller, + global::bnet.protocol.achievements.GetAchievementStatsRequest request, + global::System.Action done); + public abstract void GetCriteriaStats( + pb::IRpcController controller, + global::bnet.protocol.achievements.GetCriteriaStatsRequest request, + global::System.Action done); + public abstract void RevokeAchievement( + pb::IRpcController controller, + global::bnet.protocol.achievements.RevokeAchievementRequest request, + global::System.Action done); + public abstract void UpdateCriteria( + pb::IRpcController controller, + global::bnet.protocol.achievements.UpdateCriteriaRequest request, + global::System.Action done); + public abstract void GrantAchievement( + pb::IRpcController controller, + global::bnet.protocol.achievements.GrantAchievementRequest request, + global::System.Action done); + public abstract void CacheKill( + pb::IRpcController controller, + global::bnet.protocol.achievements.CacheKillRequest request, + global::System.Action done); + + public static pbd::ServiceDescriptor Descriptor { + get { return Proto.AchievementsService.Descriptor.Services[2]; } + } + public pbd::ServiceDescriptor DescriptorForType { + get { return Descriptor; } + } + + public void CallMethod( + pbd::MethodDescriptor method, + pb::IRpcController controller, + pb::IMessage request, + global::System.Action done) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.CallMethod() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + this.GetAchievementStats(controller, (global::bnet.protocol.achievements.GetAchievementStatsRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 1: + this.GetCriteriaStats(controller, (global::bnet.protocol.achievements.GetCriteriaStatsRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 2: + this.RevokeAchievement(controller, (global::bnet.protocol.achievements.RevokeAchievementRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 3: + this.UpdateCriteria(controller, (global::bnet.protocol.achievements.UpdateCriteriaRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 4: + this.GrantAchievement(controller, (global::bnet.protocol.achievements.GrantAchievementRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 5: + this.CacheKill(controller, (global::bnet.protocol.achievements.CacheKillRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetRequestPrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.achievements.GetAchievementStatsRequest.DefaultInstance; + case 1: + return global::bnet.protocol.achievements.GetCriteriaStatsRequest.DefaultInstance; + case 2: + return global::bnet.protocol.achievements.RevokeAchievementRequest.DefaultInstance; + case 3: + return global::bnet.protocol.achievements.UpdateCriteriaRequest.DefaultInstance; + case 4: + return global::bnet.protocol.achievements.GrantAchievementRequest.DefaultInstance; + case 5: + return global::bnet.protocol.achievements.CacheKillRequest.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetResponsePrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.achievements.GetAchievementStatsResponse.DefaultInstance; + case 1: + return global::bnet.protocol.achievements.GetCriteriaStatsResponse.DefaultInstance; + case 2: + return global::bnet.protocol.achievements.RevokeAchievementResponse.DefaultInstance; + case 3: + return global::bnet.protocol.NoData.DefaultInstance; + case 4: + return global::bnet.protocol.achievements.GrantAchievementResponse.DefaultInstance; + case 5: + return global::bnet.protocol.NoData.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public static Stub CreateStub(pb::IRpcChannel channel) { + return new Stub(channel); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public class Stub : global::bnet.protocol.achievements.AchievementsUtils { + internal Stub(pb::IRpcChannel channel) { + this.channel = channel; + } + + private readonly pb::IRpcChannel channel; + + public pb::IRpcChannel Channel { + get { return channel; } + } + + public override void GetAchievementStats( + pb::IRpcController controller, + global::bnet.protocol.achievements.GetAchievementStatsRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[0], + controller, request, global::bnet.protocol.achievements.GetAchievementStatsResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.achievements.GetAchievementStatsResponse.DefaultInstance)); + } + + public override void GetCriteriaStats( + pb::IRpcController controller, + global::bnet.protocol.achievements.GetCriteriaStatsRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[1], + controller, request, global::bnet.protocol.achievements.GetCriteriaStatsResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.achievements.GetCriteriaStatsResponse.DefaultInstance)); + } + + public override void RevokeAchievement( + pb::IRpcController controller, + global::bnet.protocol.achievements.RevokeAchievementRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[2], + controller, request, global::bnet.protocol.achievements.RevokeAchievementResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.achievements.RevokeAchievementResponse.DefaultInstance)); + } + + public override void UpdateCriteria( + pb::IRpcController controller, + global::bnet.protocol.achievements.UpdateCriteriaRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[3], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void GrantAchievement( + pb::IRpcController controller, + global::bnet.protocol.achievements.GrantAchievementRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[4], + controller, request, global::bnet.protocol.achievements.GrantAchievementResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.achievements.GrantAchievementResponse.DefaultInstance)); + } + + public override void CacheKill( + pb::IRpcController controller, + global::bnet.protocol.achievements.CacheKillRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[5], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + } + } + #endregion + +} + +#endregion Designer generated code diff --git a/src/LibMooNet/bnet/protocol/achievements/AchievementsStaticData.cs b/src/LibMooNet/bnet/protocol/achievements/AchievementsStaticData.cs new file mode 100644 index 00000000..ac8a9e9b --- /dev/null +++ b/src/LibMooNet/bnet/protocol/achievements/AchievementsStaticData.cs @@ -0,0 +1,3730 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace bnet.protocol.achievements { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class AchievementsStaticData { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_Attribute__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_Attribute__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_CriteriaModifier__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_CriteriaModifier__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_CriteriaEvent__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_CriteriaEvent__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_StaticCategoryDefinition__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_StaticCategoryDefinition__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_StaticAchievementDefinition__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_StaticAchievementDefinition__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_StaticCriteriaDefinition__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_StaticCriteriaDefinition__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_achievements_AchievementFile__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_AchievementFile__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static AchievementsStaticData() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "CiNibmV0L2FjaGlldmVtZW50c19zdGF0aWNfZGF0YS5wcm90bxIaYm5ldC5w" + + "cm90b2NvbC5hY2hpZXZlbWVudHMiJwoJQXR0cmlidXRlEgsKA2tleRgBIAIo" + + "CRINCgV2YWx1ZRgCIAIoCSJjChBDcml0ZXJpYU1vZGlmaWVyEhsKE25lY2Vz" + + "c2FyeV9jb25kaXRpb24YASACKAQSDgoGdGFyZ2V0GAIgAigHEg8KB29wZXJh" + + "bmQYAyACKA0SEQoJY29tcGFyYW5kGAQgAigEIokBCg1Dcml0ZXJpYUV2ZW50" + + "EgoKAmlkGAEgAigEEhQKCWNvbXBhcmFuZBgCIAEoBDoBMBI+Cghtb2RpZmll" + + "chgDIAMoCzIsLmJuZXQucHJvdG9jb2wuYWNoaWV2ZW1lbnRzLkNyaXRlcmlh" + + "TW9kaWZpZXISFgoOdGltZXJfZHVyYXRpb24YBCABKA0isgEKGFN0YXRpY0Nh" + + "dGVnb3J5RGVmaW5pdGlvbhIKCgJpZBgBIAIoDRIRCglwYXJlbnRfaWQYAiAB" + + "KAQSKAogT0JTT0xFVEVfZmVhdHVyZWRfYWNoaWV2ZW1lbnRfaWQYAyABKAQS" + + "EgoKb3JkZXJfaGludBgEIAIoDRI5CgphdHRyaWJ1dGVzGAUgAygLMiUuYm5l" + + "dC5wcm90b2NvbC5hY2hpZXZlbWVudHMuQXR0cmlidXRlIp0CChtTdGF0aWNB" + + "Y2hpZXZlbWVudERlZmluaXRpb24SCgoCaWQYASACKAQSIgoac3VwZXJzZWRp" + + "bmdfYWNoaWV2ZW1lbnRfaWQYAiABKAQSEwoLY2F0ZWdvcnlfaWQYAyACKA0S" + + "GAoQbWluaW11bV9jcml0ZXJpYRgEIAEoDRIUCgxwb2ludHNfdmFsdWUYBSAC" + + "KA0SDQoFZmxhZ3MYBiACKA0SEgoKb3JkZXJfaGludBgHIAIoDRIrCiNjcml0" + + "ZXJpYV9zaGFyZWRfd2l0aF9hY2hpZXZlbWVudF9pZBgIIAEoBBI5CgphdHRy" + + "aWJ1dGVzGAkgAygLMiUuYm5ldC5wcm90b2NvbC5hY2hpZXZlbWVudHMuQXR0" + + "cmlidXRlIqQDChhTdGF0aWNDcml0ZXJpYURlZmluaXRpb24SEwoLY3JpdGVy" + + "aWFfaWQYASACKAQSHQoVcGFyZW50X2FjaGlldmVtZW50X2lkGAIgAigEEj4K" + + "C3N0YXJ0X2V2ZW50GAMgASgLMikuYm5ldC5wcm90b2NvbC5hY2hpZXZlbWVu" + + "dHMuQ3JpdGVyaWFFdmVudBJACg1hZHZhbmNlX2V2ZW50GAQgASgLMikuYm5l" + + "dC5wcm90b2NvbC5hY2hpZXZlbWVudHMuQ3JpdGVyaWFFdmVudBI9CgpmYWls" + + "X2V2ZW50GAUgASgLMikuYm5ldC5wcm90b2NvbC5hY2hpZXZlbWVudHMuQ3Jp" + + "dGVyaWFFdmVudBIaChJuZWNlc3NhcnlfcXVhbnRpdHkYBiACKAQSEgoKb3Jk" + + "ZXJfaGludBgHIAEoDRIZChFldmFsdXRhdGlvbl9jbGFzcxgIIAIoBxINCgVm" + + "bGFncxgJIAIoDRI5CgphdHRyaWJ1dGVzGAogAygLMiUuYm5ldC5wcm90b2Nv" + + "bC5hY2hpZXZlbWVudHMuQXR0cmlidXRlIqoCCg9BY2hpZXZlbWVudEZpbGUS" + + "RgoIY2F0ZWdvcnkYASADKAsyNC5ibmV0LnByb3RvY29sLmFjaGlldmVtZW50" + + "cy5TdGF0aWNDYXRlZ29yeURlZmluaXRpb24STAoLYWNoaWV2ZW1lbnQYAiAD" + + "KAsyNy5ibmV0LnByb3RvY29sLmFjaGlldmVtZW50cy5TdGF0aWNBY2hpZXZl" + + "bWVudERlZmluaXRpb24SRgoIY3JpdGVyaWEYAyADKAsyNC5ibmV0LnByb3Rv" + + "Y29sLmFjaGlldmVtZW50cy5TdGF0aWNDcml0ZXJpYURlZmluaXRpb24SOQoK" + + "YXR0cmlidXRlcxgEIAMoCzIlLmJuZXQucHJvdG9jb2wuYWNoaWV2ZW1lbnRz" + + "LkF0dHJpYnV0ZSozChFNb2RpZmVyVGFyZ2V0VHlwZRIPCgdTVUJKRUNUEOrE" + + "1ZsFEg0KBk9CSkVDVBDqxL0C"); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_bnet_protocol_achievements_Attribute__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_achievements_Attribute__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_Attribute__Descriptor, + new string[] { "Key", "Value", }); + internal__static_bnet_protocol_achievements_CriteriaModifier__Descriptor = Descriptor.MessageTypes[1]; + internal__static_bnet_protocol_achievements_CriteriaModifier__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_CriteriaModifier__Descriptor, + new string[] { "NecessaryCondition", "Target", "Operand", "Comparand", }); + internal__static_bnet_protocol_achievements_CriteriaEvent__Descriptor = Descriptor.MessageTypes[2]; + internal__static_bnet_protocol_achievements_CriteriaEvent__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_CriteriaEvent__Descriptor, + new string[] { "Id", "Comparand", "Modifier", "TimerDuration", }); + internal__static_bnet_protocol_achievements_StaticCategoryDefinition__Descriptor = Descriptor.MessageTypes[3]; + internal__static_bnet_protocol_achievements_StaticCategoryDefinition__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_StaticCategoryDefinition__Descriptor, + new string[] { "Id", "ParentId", "OBSOLETEFeaturedAchievementId", "OrderHint", "Attributes", }); + internal__static_bnet_protocol_achievements_StaticAchievementDefinition__Descriptor = Descriptor.MessageTypes[4]; + internal__static_bnet_protocol_achievements_StaticAchievementDefinition__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_StaticAchievementDefinition__Descriptor, + new string[] { "Id", "SupersedingAchievementId", "CategoryId", "MinimumCriteria", "PointsValue", "Flags", "OrderHint", "CriteriaSharedWithAchievementId", "Attributes", }); + internal__static_bnet_protocol_achievements_StaticCriteriaDefinition__Descriptor = Descriptor.MessageTypes[5]; + internal__static_bnet_protocol_achievements_StaticCriteriaDefinition__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_StaticCriteriaDefinition__Descriptor, + new string[] { "CriteriaId", "ParentAchievementId", "StartEvent", "AdvanceEvent", "FailEvent", "NecessaryQuantity", "OrderHint", "EvalutationClass", "Flags", "Attributes", }); + internal__static_bnet_protocol_achievements_AchievementFile__Descriptor = Descriptor.MessageTypes[6]; + internal__static_bnet_protocol_achievements_AchievementFile__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_AchievementFile__Descriptor, + new string[] { "Category", "Achievement", "Criteria", "Attributes", }); + return null; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + }, assigner); + } + #endregion + + } + #region Enums + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public enum ModiferTargetType { + SUBJECT = 1400201834, + OBJECT = 5202538, + } + + #endregion + + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Attribute : pb::GeneratedMessage { + private Attribute() { } + private static readonly Attribute defaultInstance = new Attribute().MakeReadOnly(); + private static readonly string[] _attributeFieldNames = new string[] { "key", "value" }; + private static readonly uint[] _attributeFieldTags = new uint[] { 10, 18 }; + public static Attribute DefaultInstance { + get { return defaultInstance; } + } + + public override Attribute DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Attribute ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.AchievementsStaticData.internal__static_bnet_protocol_achievements_Attribute__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.AchievementsStaticData.internal__static_bnet_protocol_achievements_Attribute__FieldAccessorTable; } + } + + public const int KeyFieldNumber = 1; + private bool hasKey; + private string key_ = ""; + public bool HasKey { + get { return hasKey; } + } + public string Key { + get { return key_; } + } + + public const int ValueFieldNumber = 2; + private bool hasValue; + private string value_ = ""; + public bool HasValue { + get { return hasValue; } + } + public string Value { + get { return value_; } + } + + public override bool IsInitialized { + get { + if (!hasKey) return false; + if (!hasValue) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _attributeFieldNames; + if (hasKey) { + output.WriteString(1, field_names[0], Key); + } + if (hasValue) { + output.WriteString(2, field_names[1], Value); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasKey) { + size += pb::CodedOutputStream.ComputeStringSize(1, Key); + } + if (hasValue) { + size += pb::CodedOutputStream.ComputeStringSize(2, Value); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static Attribute ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Attribute ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Attribute ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Attribute ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Attribute ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Attribute ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Attribute ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Attribute ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Attribute ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Attribute ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Attribute MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Attribute prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Attribute cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Attribute result; + + private Attribute PrepareBuilder() { + if (resultIsReadOnly) { + Attribute original = result; + result = new Attribute(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Attribute MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.Attribute.Descriptor; } + } + + public override Attribute DefaultInstanceForType { + get { return global::bnet.protocol.achievements.Attribute.DefaultInstance; } + } + + public override Attribute BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Attribute) { + return MergeFrom((Attribute) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Attribute other) { + if (other == global::bnet.protocol.achievements.Attribute.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasKey) { + Key = other.Key; + } + if (other.HasValue) { + Value = other.Value; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_attributeFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _attributeFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasKey = input.ReadString(ref result.key_); + break; + } + case 18: { + result.hasValue = input.ReadString(ref result.value_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasKey { + get { return result.hasKey; } + } + public string Key { + get { return result.Key; } + set { SetKey(value); } + } + public Builder SetKey(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasKey = true; + result.key_ = value; + return this; + } + public Builder ClearKey() { + PrepareBuilder(); + result.hasKey = false; + result.key_ = ""; + return this; + } + + public bool HasValue { + get { return result.hasValue; } + } + public string Value { + get { return result.Value; } + set { SetValue(value); } + } + public Builder SetValue(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasValue = true; + result.value_ = value; + return this; + } + public Builder ClearValue() { + PrepareBuilder(); + result.hasValue = false; + result.value_ = ""; + return this; + } + } + static Attribute() { + object.ReferenceEquals(global::bnet.protocol.achievements.AchievementsStaticData.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class CriteriaModifier : pb::GeneratedMessage { + private CriteriaModifier() { } + private static readonly CriteriaModifier defaultInstance = new CriteriaModifier().MakeReadOnly(); + private static readonly string[] _criteriaModifierFieldNames = new string[] { "comparand", "necessary_condition", "operand", "target" }; + private static readonly uint[] _criteriaModifierFieldTags = new uint[] { 32, 8, 24, 21 }; + public static CriteriaModifier DefaultInstance { + get { return defaultInstance; } + } + + public override CriteriaModifier DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override CriteriaModifier ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.AchievementsStaticData.internal__static_bnet_protocol_achievements_CriteriaModifier__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.AchievementsStaticData.internal__static_bnet_protocol_achievements_CriteriaModifier__FieldAccessorTable; } + } + + public const int NecessaryConditionFieldNumber = 1; + private bool hasNecessaryCondition; + private ulong necessaryCondition_; + public bool HasNecessaryCondition { + get { return hasNecessaryCondition; } + } + public ulong NecessaryCondition { + get { return necessaryCondition_; } + } + + public const int TargetFieldNumber = 2; + private bool hasTarget; + private uint target_; + public bool HasTarget { + get { return hasTarget; } + } + public uint Target { + get { return target_; } + } + + public const int OperandFieldNumber = 3; + private bool hasOperand; + private uint operand_; + public bool HasOperand { + get { return hasOperand; } + } + public uint Operand { + get { return operand_; } + } + + public const int ComparandFieldNumber = 4; + private bool hasComparand; + private ulong comparand_; + public bool HasComparand { + get { return hasComparand; } + } + public ulong Comparand { + get { return comparand_; } + } + + public override bool IsInitialized { + get { + if (!hasNecessaryCondition) return false; + if (!hasTarget) return false; + if (!hasOperand) return false; + if (!hasComparand) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _criteriaModifierFieldNames; + if (hasNecessaryCondition) { + output.WriteUInt64(1, field_names[1], NecessaryCondition); + } + if (hasTarget) { + output.WriteFixed32(2, field_names[3], Target); + } + if (hasOperand) { + output.WriteUInt32(3, field_names[2], Operand); + } + if (hasComparand) { + output.WriteUInt64(4, field_names[0], Comparand); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasNecessaryCondition) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, NecessaryCondition); + } + if (hasTarget) { + size += pb::CodedOutputStream.ComputeFixed32Size(2, Target); + } + if (hasOperand) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, Operand); + } + if (hasComparand) { + size += pb::CodedOutputStream.ComputeUInt64Size(4, Comparand); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static CriteriaModifier ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CriteriaModifier ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CriteriaModifier ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CriteriaModifier ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CriteriaModifier ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CriteriaModifier ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static CriteriaModifier ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static CriteriaModifier ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static CriteriaModifier ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CriteriaModifier ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CriteriaModifier MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(CriteriaModifier prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CriteriaModifier cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CriteriaModifier result; + + private CriteriaModifier PrepareBuilder() { + if (resultIsReadOnly) { + CriteriaModifier original = result; + result = new CriteriaModifier(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CriteriaModifier MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.CriteriaModifier.Descriptor; } + } + + public override CriteriaModifier DefaultInstanceForType { + get { return global::bnet.protocol.achievements.CriteriaModifier.DefaultInstance; } + } + + public override CriteriaModifier BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is CriteriaModifier) { + return MergeFrom((CriteriaModifier) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(CriteriaModifier other) { + if (other == global::bnet.protocol.achievements.CriteriaModifier.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasNecessaryCondition) { + NecessaryCondition = other.NecessaryCondition; + } + if (other.HasTarget) { + Target = other.Target; + } + if (other.HasOperand) { + Operand = other.Operand; + } + if (other.HasComparand) { + Comparand = other.Comparand; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_criteriaModifierFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _criteriaModifierFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasNecessaryCondition = input.ReadUInt64(ref result.necessaryCondition_); + break; + } + case 21: { + result.hasTarget = input.ReadFixed32(ref result.target_); + break; + } + case 24: { + result.hasOperand = input.ReadUInt32(ref result.operand_); + break; + } + case 32: { + result.hasComparand = input.ReadUInt64(ref result.comparand_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasNecessaryCondition { + get { return result.hasNecessaryCondition; } + } + public ulong NecessaryCondition { + get { return result.NecessaryCondition; } + set { SetNecessaryCondition(value); } + } + public Builder SetNecessaryCondition(ulong value) { + PrepareBuilder(); + result.hasNecessaryCondition = true; + result.necessaryCondition_ = value; + return this; + } + public Builder ClearNecessaryCondition() { + PrepareBuilder(); + result.hasNecessaryCondition = false; + result.necessaryCondition_ = 0UL; + return this; + } + + public bool HasTarget { + get { return result.hasTarget; } + } + public uint Target { + get { return result.Target; } + set { SetTarget(value); } + } + public Builder SetTarget(uint value) { + PrepareBuilder(); + result.hasTarget = true; + result.target_ = value; + return this; + } + public Builder ClearTarget() { + PrepareBuilder(); + result.hasTarget = false; + result.target_ = 0; + return this; + } + + public bool HasOperand { + get { return result.hasOperand; } + } + public uint Operand { + get { return result.Operand; } + set { SetOperand(value); } + } + public Builder SetOperand(uint value) { + PrepareBuilder(); + result.hasOperand = true; + result.operand_ = value; + return this; + } + public Builder ClearOperand() { + PrepareBuilder(); + result.hasOperand = false; + result.operand_ = 0; + return this; + } + + public bool HasComparand { + get { return result.hasComparand; } + } + public ulong Comparand { + get { return result.Comparand; } + set { SetComparand(value); } + } + public Builder SetComparand(ulong value) { + PrepareBuilder(); + result.hasComparand = true; + result.comparand_ = value; + return this; + } + public Builder ClearComparand() { + PrepareBuilder(); + result.hasComparand = false; + result.comparand_ = 0UL; + return this; + } + } + static CriteriaModifier() { + object.ReferenceEquals(global::bnet.protocol.achievements.AchievementsStaticData.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class CriteriaEvent : pb::GeneratedMessage { + private CriteriaEvent() { } + private static readonly CriteriaEvent defaultInstance = new CriteriaEvent().MakeReadOnly(); + private static readonly string[] _criteriaEventFieldNames = new string[] { "comparand", "id", "modifier", "timer_duration" }; + private static readonly uint[] _criteriaEventFieldTags = new uint[] { 16, 8, 26, 32 }; + public static CriteriaEvent DefaultInstance { + get { return defaultInstance; } + } + + public override CriteriaEvent DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override CriteriaEvent ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.AchievementsStaticData.internal__static_bnet_protocol_achievements_CriteriaEvent__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.AchievementsStaticData.internal__static_bnet_protocol_achievements_CriteriaEvent__FieldAccessorTable; } + } + + public const int IdFieldNumber = 1; + private bool hasId; + private ulong id_; + public bool HasId { + get { return hasId; } + } + public ulong Id { + get { return id_; } + } + + public const int ComparandFieldNumber = 2; + private bool hasComparand; + private ulong comparand_; + public bool HasComparand { + get { return hasComparand; } + } + public ulong Comparand { + get { return comparand_; } + } + + public const int ModifierFieldNumber = 3; + private pbc::PopsicleList modifier_ = new pbc::PopsicleList(); + public scg::IList ModifierList { + get { return modifier_; } + } + public int ModifierCount { + get { return modifier_.Count; } + } + public global::bnet.protocol.achievements.CriteriaModifier GetModifier(int index) { + return modifier_[index]; + } + + public const int TimerDurationFieldNumber = 4; + private bool hasTimerDuration; + private uint timerDuration_; + public bool HasTimerDuration { + get { return hasTimerDuration; } + } + public uint TimerDuration { + get { return timerDuration_; } + } + + public override bool IsInitialized { + get { + if (!hasId) return false; + foreach (global::bnet.protocol.achievements.CriteriaModifier element in ModifierList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _criteriaEventFieldNames; + if (hasId) { + output.WriteUInt64(1, field_names[1], Id); + } + if (hasComparand) { + output.WriteUInt64(2, field_names[0], Comparand); + } + if (modifier_.Count > 0) { + output.WriteMessageArray(3, field_names[2], modifier_); + } + if (hasTimerDuration) { + output.WriteUInt32(4, field_names[3], TimerDuration); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasId) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, Id); + } + if (hasComparand) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, Comparand); + } + foreach (global::bnet.protocol.achievements.CriteriaModifier element in ModifierList) { + size += pb::CodedOutputStream.ComputeMessageSize(3, element); + } + if (hasTimerDuration) { + size += pb::CodedOutputStream.ComputeUInt32Size(4, TimerDuration); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static CriteriaEvent ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CriteriaEvent ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CriteriaEvent ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CriteriaEvent ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CriteriaEvent ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CriteriaEvent ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static CriteriaEvent ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static CriteriaEvent ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static CriteriaEvent ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CriteriaEvent ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CriteriaEvent MakeReadOnly() { + modifier_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(CriteriaEvent prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CriteriaEvent cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CriteriaEvent result; + + private CriteriaEvent PrepareBuilder() { + if (resultIsReadOnly) { + CriteriaEvent original = result; + result = new CriteriaEvent(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CriteriaEvent MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.CriteriaEvent.Descriptor; } + } + + public override CriteriaEvent DefaultInstanceForType { + get { return global::bnet.protocol.achievements.CriteriaEvent.DefaultInstance; } + } + + public override CriteriaEvent BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is CriteriaEvent) { + return MergeFrom((CriteriaEvent) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(CriteriaEvent other) { + if (other == global::bnet.protocol.achievements.CriteriaEvent.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasId) { + Id = other.Id; + } + if (other.HasComparand) { + Comparand = other.Comparand; + } + if (other.modifier_.Count != 0) { + result.modifier_.Add(other.modifier_); + } + if (other.HasTimerDuration) { + TimerDuration = other.TimerDuration; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_criteriaEventFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _criteriaEventFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasId = input.ReadUInt64(ref result.id_); + break; + } + case 16: { + result.hasComparand = input.ReadUInt64(ref result.comparand_); + break; + } + case 26: { + input.ReadMessageArray(tag, field_name, result.modifier_, global::bnet.protocol.achievements.CriteriaModifier.DefaultInstance, extensionRegistry); + break; + } + case 32: { + result.hasTimerDuration = input.ReadUInt32(ref result.timerDuration_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasId { + get { return result.hasId; } + } + public ulong Id { + get { return result.Id; } + set { SetId(value); } + } + public Builder SetId(ulong value) { + PrepareBuilder(); + result.hasId = true; + result.id_ = value; + return this; + } + public Builder ClearId() { + PrepareBuilder(); + result.hasId = false; + result.id_ = 0UL; + return this; + } + + public bool HasComparand { + get { return result.hasComparand; } + } + public ulong Comparand { + get { return result.Comparand; } + set { SetComparand(value); } + } + public Builder SetComparand(ulong value) { + PrepareBuilder(); + result.hasComparand = true; + result.comparand_ = value; + return this; + } + public Builder ClearComparand() { + PrepareBuilder(); + result.hasComparand = false; + result.comparand_ = 0UL; + return this; + } + + public pbc::IPopsicleList ModifierList { + get { return PrepareBuilder().modifier_; } + } + public int ModifierCount { + get { return result.ModifierCount; } + } + public global::bnet.protocol.achievements.CriteriaModifier GetModifier(int index) { + return result.GetModifier(index); + } + public Builder SetModifier(int index, global::bnet.protocol.achievements.CriteriaModifier value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.modifier_[index] = value; + return this; + } + public Builder SetModifier(int index, global::bnet.protocol.achievements.CriteriaModifier.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.modifier_[index] = builderForValue.Build(); + return this; + } + public Builder AddModifier(global::bnet.protocol.achievements.CriteriaModifier value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.modifier_.Add(value); + return this; + } + public Builder AddModifier(global::bnet.protocol.achievements.CriteriaModifier.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.modifier_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeModifier(scg::IEnumerable values) { + PrepareBuilder(); + result.modifier_.Add(values); + return this; + } + public Builder ClearModifier() { + PrepareBuilder(); + result.modifier_.Clear(); + return this; + } + + public bool HasTimerDuration { + get { return result.hasTimerDuration; } + } + public uint TimerDuration { + get { return result.TimerDuration; } + set { SetTimerDuration(value); } + } + public Builder SetTimerDuration(uint value) { + PrepareBuilder(); + result.hasTimerDuration = true; + result.timerDuration_ = value; + return this; + } + public Builder ClearTimerDuration() { + PrepareBuilder(); + result.hasTimerDuration = false; + result.timerDuration_ = 0; + return this; + } + } + static CriteriaEvent() { + object.ReferenceEquals(global::bnet.protocol.achievements.AchievementsStaticData.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class StaticCategoryDefinition : pb::GeneratedMessage { + private StaticCategoryDefinition() { } + private static readonly StaticCategoryDefinition defaultInstance = new StaticCategoryDefinition().MakeReadOnly(); + private static readonly string[] _staticCategoryDefinitionFieldNames = new string[] { "OBSOLETE_featured_achievement_id", "attributes", "id", "order_hint", "parent_id" }; + private static readonly uint[] _staticCategoryDefinitionFieldTags = new uint[] { 24, 42, 8, 32, 16 }; + public static StaticCategoryDefinition DefaultInstance { + get { return defaultInstance; } + } + + public override StaticCategoryDefinition DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override StaticCategoryDefinition ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.AchievementsStaticData.internal__static_bnet_protocol_achievements_StaticCategoryDefinition__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.AchievementsStaticData.internal__static_bnet_protocol_achievements_StaticCategoryDefinition__FieldAccessorTable; } + } + + public const int IdFieldNumber = 1; + private bool hasId; + private uint id_; + public bool HasId { + get { return hasId; } + } + public uint Id { + get { return id_; } + } + + public const int ParentIdFieldNumber = 2; + private bool hasParentId; + private ulong parentId_; + public bool HasParentId { + get { return hasParentId; } + } + public ulong ParentId { + get { return parentId_; } + } + + public const int OBSOLETEFeaturedAchievementIdFieldNumber = 3; + private bool hasOBSOLETEFeaturedAchievementId; + private ulong oBSOLETEFeaturedAchievementId_; + public bool HasOBSOLETEFeaturedAchievementId { + get { return hasOBSOLETEFeaturedAchievementId; } + } + public ulong OBSOLETEFeaturedAchievementId { + get { return oBSOLETEFeaturedAchievementId_; } + } + + public const int OrderHintFieldNumber = 4; + private bool hasOrderHint; + private uint orderHint_; + public bool HasOrderHint { + get { return hasOrderHint; } + } + public uint OrderHint { + get { return orderHint_; } + } + + public const int AttributesFieldNumber = 5; + private pbc::PopsicleList attributes_ = new pbc::PopsicleList(); + public scg::IList AttributesList { + get { return attributes_; } + } + public int AttributesCount { + get { return attributes_.Count; } + } + public global::bnet.protocol.achievements.Attribute GetAttributes(int index) { + return attributes_[index]; + } + + public override bool IsInitialized { + get { + if (!hasId) return false; + if (!hasOrderHint) return false; + foreach (global::bnet.protocol.achievements.Attribute element in AttributesList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _staticCategoryDefinitionFieldNames; + if (hasId) { + output.WriteUInt32(1, field_names[2], Id); + } + if (hasParentId) { + output.WriteUInt64(2, field_names[4], ParentId); + } + if (hasOBSOLETEFeaturedAchievementId) { + output.WriteUInt64(3, field_names[0], OBSOLETEFeaturedAchievementId); + } + if (hasOrderHint) { + output.WriteUInt32(4, field_names[3], OrderHint); + } + if (attributes_.Count > 0) { + output.WriteMessageArray(5, field_names[1], attributes_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasId) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, Id); + } + if (hasParentId) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, ParentId); + } + if (hasOBSOLETEFeaturedAchievementId) { + size += pb::CodedOutputStream.ComputeUInt64Size(3, OBSOLETEFeaturedAchievementId); + } + if (hasOrderHint) { + size += pb::CodedOutputStream.ComputeUInt32Size(4, OrderHint); + } + foreach (global::bnet.protocol.achievements.Attribute element in AttributesList) { + size += pb::CodedOutputStream.ComputeMessageSize(5, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static StaticCategoryDefinition ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static StaticCategoryDefinition ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static StaticCategoryDefinition ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static StaticCategoryDefinition ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static StaticCategoryDefinition ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static StaticCategoryDefinition ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static StaticCategoryDefinition ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static StaticCategoryDefinition ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static StaticCategoryDefinition ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static StaticCategoryDefinition ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private StaticCategoryDefinition MakeReadOnly() { + attributes_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(StaticCategoryDefinition prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(StaticCategoryDefinition cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private StaticCategoryDefinition result; + + private StaticCategoryDefinition PrepareBuilder() { + if (resultIsReadOnly) { + StaticCategoryDefinition original = result; + result = new StaticCategoryDefinition(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override StaticCategoryDefinition MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.StaticCategoryDefinition.Descriptor; } + } + + public override StaticCategoryDefinition DefaultInstanceForType { + get { return global::bnet.protocol.achievements.StaticCategoryDefinition.DefaultInstance; } + } + + public override StaticCategoryDefinition BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is StaticCategoryDefinition) { + return MergeFrom((StaticCategoryDefinition) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(StaticCategoryDefinition other) { + if (other == global::bnet.protocol.achievements.StaticCategoryDefinition.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasId) { + Id = other.Id; + } + if (other.HasParentId) { + ParentId = other.ParentId; + } + if (other.HasOBSOLETEFeaturedAchievementId) { + OBSOLETEFeaturedAchievementId = other.OBSOLETEFeaturedAchievementId; + } + if (other.HasOrderHint) { + OrderHint = other.OrderHint; + } + if (other.attributes_.Count != 0) { + result.attributes_.Add(other.attributes_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_staticCategoryDefinitionFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _staticCategoryDefinitionFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasId = input.ReadUInt32(ref result.id_); + break; + } + case 16: { + result.hasParentId = input.ReadUInt64(ref result.parentId_); + break; + } + case 24: { + result.hasOBSOLETEFeaturedAchievementId = input.ReadUInt64(ref result.oBSOLETEFeaturedAchievementId_); + break; + } + case 32: { + result.hasOrderHint = input.ReadUInt32(ref result.orderHint_); + break; + } + case 42: { + input.ReadMessageArray(tag, field_name, result.attributes_, global::bnet.protocol.achievements.Attribute.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasId { + get { return result.hasId; } + } + public uint Id { + get { return result.Id; } + set { SetId(value); } + } + public Builder SetId(uint value) { + PrepareBuilder(); + result.hasId = true; + result.id_ = value; + return this; + } + public Builder ClearId() { + PrepareBuilder(); + result.hasId = false; + result.id_ = 0; + return this; + } + + public bool HasParentId { + get { return result.hasParentId; } + } + public ulong ParentId { + get { return result.ParentId; } + set { SetParentId(value); } + } + public Builder SetParentId(ulong value) { + PrepareBuilder(); + result.hasParentId = true; + result.parentId_ = value; + return this; + } + public Builder ClearParentId() { + PrepareBuilder(); + result.hasParentId = false; + result.parentId_ = 0UL; + return this; + } + + public bool HasOBSOLETEFeaturedAchievementId { + get { return result.hasOBSOLETEFeaturedAchievementId; } + } + public ulong OBSOLETEFeaturedAchievementId { + get { return result.OBSOLETEFeaturedAchievementId; } + set { SetOBSOLETEFeaturedAchievementId(value); } + } + public Builder SetOBSOLETEFeaturedAchievementId(ulong value) { + PrepareBuilder(); + result.hasOBSOLETEFeaturedAchievementId = true; + result.oBSOLETEFeaturedAchievementId_ = value; + return this; + } + public Builder ClearOBSOLETEFeaturedAchievementId() { + PrepareBuilder(); + result.hasOBSOLETEFeaturedAchievementId = false; + result.oBSOLETEFeaturedAchievementId_ = 0UL; + return this; + } + + public bool HasOrderHint { + get { return result.hasOrderHint; } + } + public uint OrderHint { + get { return result.OrderHint; } + set { SetOrderHint(value); } + } + public Builder SetOrderHint(uint value) { + PrepareBuilder(); + result.hasOrderHint = true; + result.orderHint_ = value; + return this; + } + public Builder ClearOrderHint() { + PrepareBuilder(); + result.hasOrderHint = false; + result.orderHint_ = 0; + return this; + } + + public pbc::IPopsicleList AttributesList { + get { return PrepareBuilder().attributes_; } + } + public int AttributesCount { + get { return result.AttributesCount; } + } + public global::bnet.protocol.achievements.Attribute GetAttributes(int index) { + return result.GetAttributes(index); + } + public Builder SetAttributes(int index, global::bnet.protocol.achievements.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.attributes_[index] = value; + return this; + } + public Builder SetAttributes(int index, global::bnet.protocol.achievements.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.attributes_[index] = builderForValue.Build(); + return this; + } + public Builder AddAttributes(global::bnet.protocol.achievements.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.attributes_.Add(value); + return this; + } + public Builder AddAttributes(global::bnet.protocol.achievements.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.attributes_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeAttributes(scg::IEnumerable values) { + PrepareBuilder(); + result.attributes_.Add(values); + return this; + } + public Builder ClearAttributes() { + PrepareBuilder(); + result.attributes_.Clear(); + return this; + } + } + static StaticCategoryDefinition() { + object.ReferenceEquals(global::bnet.protocol.achievements.AchievementsStaticData.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class StaticAchievementDefinition : pb::GeneratedMessage { + private StaticAchievementDefinition() { } + private static readonly StaticAchievementDefinition defaultInstance = new StaticAchievementDefinition().MakeReadOnly(); + private static readonly string[] _staticAchievementDefinitionFieldNames = new string[] { "attributes", "category_id", "criteria_shared_with_achievement_id", "flags", "id", "minimum_criteria", "order_hint", "points_value", "superseding_achievement_id" }; + private static readonly uint[] _staticAchievementDefinitionFieldTags = new uint[] { 74, 24, 64, 48, 8, 32, 56, 40, 16 }; + public static StaticAchievementDefinition DefaultInstance { + get { return defaultInstance; } + } + + public override StaticAchievementDefinition DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override StaticAchievementDefinition ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.AchievementsStaticData.internal__static_bnet_protocol_achievements_StaticAchievementDefinition__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.AchievementsStaticData.internal__static_bnet_protocol_achievements_StaticAchievementDefinition__FieldAccessorTable; } + } + + public const int IdFieldNumber = 1; + private bool hasId; + private ulong id_; + public bool HasId { + get { return hasId; } + } + public ulong Id { + get { return id_; } + } + + public const int SupersedingAchievementIdFieldNumber = 2; + private bool hasSupersedingAchievementId; + private ulong supersedingAchievementId_; + public bool HasSupersedingAchievementId { + get { return hasSupersedingAchievementId; } + } + public ulong SupersedingAchievementId { + get { return supersedingAchievementId_; } + } + + public const int CategoryIdFieldNumber = 3; + private bool hasCategoryId; + private uint categoryId_; + public bool HasCategoryId { + get { return hasCategoryId; } + } + public uint CategoryId { + get { return categoryId_; } + } + + public const int MinimumCriteriaFieldNumber = 4; + private bool hasMinimumCriteria; + private uint minimumCriteria_; + public bool HasMinimumCriteria { + get { return hasMinimumCriteria; } + } + public uint MinimumCriteria { + get { return minimumCriteria_; } + } + + public const int PointsValueFieldNumber = 5; + private bool hasPointsValue; + private uint pointsValue_; + public bool HasPointsValue { + get { return hasPointsValue; } + } + public uint PointsValue { + get { return pointsValue_; } + } + + public const int FlagsFieldNumber = 6; + private bool hasFlags; + private uint flags_; + public bool HasFlags { + get { return hasFlags; } + } + public uint Flags { + get { return flags_; } + } + + public const int OrderHintFieldNumber = 7; + private bool hasOrderHint; + private uint orderHint_; + public bool HasOrderHint { + get { return hasOrderHint; } + } + public uint OrderHint { + get { return orderHint_; } + } + + public const int CriteriaSharedWithAchievementIdFieldNumber = 8; + private bool hasCriteriaSharedWithAchievementId; + private ulong criteriaSharedWithAchievementId_; + public bool HasCriteriaSharedWithAchievementId { + get { return hasCriteriaSharedWithAchievementId; } + } + public ulong CriteriaSharedWithAchievementId { + get { return criteriaSharedWithAchievementId_; } + } + + public const int AttributesFieldNumber = 9; + private pbc::PopsicleList attributes_ = new pbc::PopsicleList(); + public scg::IList AttributesList { + get { return attributes_; } + } + public int AttributesCount { + get { return attributes_.Count; } + } + public global::bnet.protocol.achievements.Attribute GetAttributes(int index) { + return attributes_[index]; + } + + public override bool IsInitialized { + get { + if (!hasId) return false; + if (!hasCategoryId) return false; + if (!hasPointsValue) return false; + if (!hasFlags) return false; + if (!hasOrderHint) return false; + foreach (global::bnet.protocol.achievements.Attribute element in AttributesList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _staticAchievementDefinitionFieldNames; + if (hasId) { + output.WriteUInt64(1, field_names[4], Id); + } + if (hasSupersedingAchievementId) { + output.WriteUInt64(2, field_names[8], SupersedingAchievementId); + } + if (hasCategoryId) { + output.WriteUInt32(3, field_names[1], CategoryId); + } + if (hasMinimumCriteria) { + output.WriteUInt32(4, field_names[5], MinimumCriteria); + } + if (hasPointsValue) { + output.WriteUInt32(5, field_names[7], PointsValue); + } + if (hasFlags) { + output.WriteUInt32(6, field_names[3], Flags); + } + if (hasOrderHint) { + output.WriteUInt32(7, field_names[6], OrderHint); + } + if (hasCriteriaSharedWithAchievementId) { + output.WriteUInt64(8, field_names[2], CriteriaSharedWithAchievementId); + } + if (attributes_.Count > 0) { + output.WriteMessageArray(9, field_names[0], attributes_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasId) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, Id); + } + if (hasSupersedingAchievementId) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, SupersedingAchievementId); + } + if (hasCategoryId) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, CategoryId); + } + if (hasMinimumCriteria) { + size += pb::CodedOutputStream.ComputeUInt32Size(4, MinimumCriteria); + } + if (hasPointsValue) { + size += pb::CodedOutputStream.ComputeUInt32Size(5, PointsValue); + } + if (hasFlags) { + size += pb::CodedOutputStream.ComputeUInt32Size(6, Flags); + } + if (hasOrderHint) { + size += pb::CodedOutputStream.ComputeUInt32Size(7, OrderHint); + } + if (hasCriteriaSharedWithAchievementId) { + size += pb::CodedOutputStream.ComputeUInt64Size(8, CriteriaSharedWithAchievementId); + } + foreach (global::bnet.protocol.achievements.Attribute element in AttributesList) { + size += pb::CodedOutputStream.ComputeMessageSize(9, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static StaticAchievementDefinition ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static StaticAchievementDefinition ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static StaticAchievementDefinition ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static StaticAchievementDefinition ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static StaticAchievementDefinition ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static StaticAchievementDefinition ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static StaticAchievementDefinition ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static StaticAchievementDefinition ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static StaticAchievementDefinition ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static StaticAchievementDefinition ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private StaticAchievementDefinition MakeReadOnly() { + attributes_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(StaticAchievementDefinition prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(StaticAchievementDefinition cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private StaticAchievementDefinition result; + + private StaticAchievementDefinition PrepareBuilder() { + if (resultIsReadOnly) { + StaticAchievementDefinition original = result; + result = new StaticAchievementDefinition(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override StaticAchievementDefinition MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.StaticAchievementDefinition.Descriptor; } + } + + public override StaticAchievementDefinition DefaultInstanceForType { + get { return global::bnet.protocol.achievements.StaticAchievementDefinition.DefaultInstance; } + } + + public override StaticAchievementDefinition BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is StaticAchievementDefinition) { + return MergeFrom((StaticAchievementDefinition) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(StaticAchievementDefinition other) { + if (other == global::bnet.protocol.achievements.StaticAchievementDefinition.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasId) { + Id = other.Id; + } + if (other.HasSupersedingAchievementId) { + SupersedingAchievementId = other.SupersedingAchievementId; + } + if (other.HasCategoryId) { + CategoryId = other.CategoryId; + } + if (other.HasMinimumCriteria) { + MinimumCriteria = other.MinimumCriteria; + } + if (other.HasPointsValue) { + PointsValue = other.PointsValue; + } + if (other.HasFlags) { + Flags = other.Flags; + } + if (other.HasOrderHint) { + OrderHint = other.OrderHint; + } + if (other.HasCriteriaSharedWithAchievementId) { + CriteriaSharedWithAchievementId = other.CriteriaSharedWithAchievementId; + } + if (other.attributes_.Count != 0) { + result.attributes_.Add(other.attributes_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_staticAchievementDefinitionFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _staticAchievementDefinitionFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasId = input.ReadUInt64(ref result.id_); + break; + } + case 16: { + result.hasSupersedingAchievementId = input.ReadUInt64(ref result.supersedingAchievementId_); + break; + } + case 24: { + result.hasCategoryId = input.ReadUInt32(ref result.categoryId_); + break; + } + case 32: { + result.hasMinimumCriteria = input.ReadUInt32(ref result.minimumCriteria_); + break; + } + case 40: { + result.hasPointsValue = input.ReadUInt32(ref result.pointsValue_); + break; + } + case 48: { + result.hasFlags = input.ReadUInt32(ref result.flags_); + break; + } + case 56: { + result.hasOrderHint = input.ReadUInt32(ref result.orderHint_); + break; + } + case 64: { + result.hasCriteriaSharedWithAchievementId = input.ReadUInt64(ref result.criteriaSharedWithAchievementId_); + break; + } + case 74: { + input.ReadMessageArray(tag, field_name, result.attributes_, global::bnet.protocol.achievements.Attribute.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasId { + get { return result.hasId; } + } + public ulong Id { + get { return result.Id; } + set { SetId(value); } + } + public Builder SetId(ulong value) { + PrepareBuilder(); + result.hasId = true; + result.id_ = value; + return this; + } + public Builder ClearId() { + PrepareBuilder(); + result.hasId = false; + result.id_ = 0UL; + return this; + } + + public bool HasSupersedingAchievementId { + get { return result.hasSupersedingAchievementId; } + } + public ulong SupersedingAchievementId { + get { return result.SupersedingAchievementId; } + set { SetSupersedingAchievementId(value); } + } + public Builder SetSupersedingAchievementId(ulong value) { + PrepareBuilder(); + result.hasSupersedingAchievementId = true; + result.supersedingAchievementId_ = value; + return this; + } + public Builder ClearSupersedingAchievementId() { + PrepareBuilder(); + result.hasSupersedingAchievementId = false; + result.supersedingAchievementId_ = 0UL; + return this; + } + + public bool HasCategoryId { + get { return result.hasCategoryId; } + } + public uint CategoryId { + get { return result.CategoryId; } + set { SetCategoryId(value); } + } + public Builder SetCategoryId(uint value) { + PrepareBuilder(); + result.hasCategoryId = true; + result.categoryId_ = value; + return this; + } + public Builder ClearCategoryId() { + PrepareBuilder(); + result.hasCategoryId = false; + result.categoryId_ = 0; + return this; + } + + public bool HasMinimumCriteria { + get { return result.hasMinimumCriteria; } + } + public uint MinimumCriteria { + get { return result.MinimumCriteria; } + set { SetMinimumCriteria(value); } + } + public Builder SetMinimumCriteria(uint value) { + PrepareBuilder(); + result.hasMinimumCriteria = true; + result.minimumCriteria_ = value; + return this; + } + public Builder ClearMinimumCriteria() { + PrepareBuilder(); + result.hasMinimumCriteria = false; + result.minimumCriteria_ = 0; + return this; + } + + public bool HasPointsValue { + get { return result.hasPointsValue; } + } + public uint PointsValue { + get { return result.PointsValue; } + set { SetPointsValue(value); } + } + public Builder SetPointsValue(uint value) { + PrepareBuilder(); + result.hasPointsValue = true; + result.pointsValue_ = value; + return this; + } + public Builder ClearPointsValue() { + PrepareBuilder(); + result.hasPointsValue = false; + result.pointsValue_ = 0; + return this; + } + + public bool HasFlags { + get { return result.hasFlags; } + } + public uint Flags { + get { return result.Flags; } + set { SetFlags(value); } + } + public Builder SetFlags(uint value) { + PrepareBuilder(); + result.hasFlags = true; + result.flags_ = value; + return this; + } + public Builder ClearFlags() { + PrepareBuilder(); + result.hasFlags = false; + result.flags_ = 0; + return this; + } + + public bool HasOrderHint { + get { return result.hasOrderHint; } + } + public uint OrderHint { + get { return result.OrderHint; } + set { SetOrderHint(value); } + } + public Builder SetOrderHint(uint value) { + PrepareBuilder(); + result.hasOrderHint = true; + result.orderHint_ = value; + return this; + } + public Builder ClearOrderHint() { + PrepareBuilder(); + result.hasOrderHint = false; + result.orderHint_ = 0; + return this; + } + + public bool HasCriteriaSharedWithAchievementId { + get { return result.hasCriteriaSharedWithAchievementId; } + } + public ulong CriteriaSharedWithAchievementId { + get { return result.CriteriaSharedWithAchievementId; } + set { SetCriteriaSharedWithAchievementId(value); } + } + public Builder SetCriteriaSharedWithAchievementId(ulong value) { + PrepareBuilder(); + result.hasCriteriaSharedWithAchievementId = true; + result.criteriaSharedWithAchievementId_ = value; + return this; + } + public Builder ClearCriteriaSharedWithAchievementId() { + PrepareBuilder(); + result.hasCriteriaSharedWithAchievementId = false; + result.criteriaSharedWithAchievementId_ = 0UL; + return this; + } + + public pbc::IPopsicleList AttributesList { + get { return PrepareBuilder().attributes_; } + } + public int AttributesCount { + get { return result.AttributesCount; } + } + public global::bnet.protocol.achievements.Attribute GetAttributes(int index) { + return result.GetAttributes(index); + } + public Builder SetAttributes(int index, global::bnet.protocol.achievements.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.attributes_[index] = value; + return this; + } + public Builder SetAttributes(int index, global::bnet.protocol.achievements.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.attributes_[index] = builderForValue.Build(); + return this; + } + public Builder AddAttributes(global::bnet.protocol.achievements.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.attributes_.Add(value); + return this; + } + public Builder AddAttributes(global::bnet.protocol.achievements.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.attributes_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeAttributes(scg::IEnumerable values) { + PrepareBuilder(); + result.attributes_.Add(values); + return this; + } + public Builder ClearAttributes() { + PrepareBuilder(); + result.attributes_.Clear(); + return this; + } + } + static StaticAchievementDefinition() { + object.ReferenceEquals(global::bnet.protocol.achievements.AchievementsStaticData.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class StaticCriteriaDefinition : pb::GeneratedMessage { + private StaticCriteriaDefinition() { } + private static readonly StaticCriteriaDefinition defaultInstance = new StaticCriteriaDefinition().MakeReadOnly(); + private static readonly string[] _staticCriteriaDefinitionFieldNames = new string[] { "advance_event", "attributes", "criteria_id", "evalutation_class", "fail_event", "flags", "necessary_quantity", "order_hint", "parent_achievement_id", "start_event" }; + private static readonly uint[] _staticCriteriaDefinitionFieldTags = new uint[] { 34, 82, 8, 69, 42, 72, 48, 56, 16, 26 }; + public static StaticCriteriaDefinition DefaultInstance { + get { return defaultInstance; } + } + + public override StaticCriteriaDefinition DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override StaticCriteriaDefinition ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.AchievementsStaticData.internal__static_bnet_protocol_achievements_StaticCriteriaDefinition__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.AchievementsStaticData.internal__static_bnet_protocol_achievements_StaticCriteriaDefinition__FieldAccessorTable; } + } + + public const int CriteriaIdFieldNumber = 1; + private bool hasCriteriaId; + private ulong criteriaId_; + public bool HasCriteriaId { + get { return hasCriteriaId; } + } + public ulong CriteriaId { + get { return criteriaId_; } + } + + public const int ParentAchievementIdFieldNumber = 2; + private bool hasParentAchievementId; + private ulong parentAchievementId_; + public bool HasParentAchievementId { + get { return hasParentAchievementId; } + } + public ulong ParentAchievementId { + get { return parentAchievementId_; } + } + + public const int StartEventFieldNumber = 3; + private bool hasStartEvent; + private global::bnet.protocol.achievements.CriteriaEvent startEvent_; + public bool HasStartEvent { + get { return hasStartEvent; } + } + public global::bnet.protocol.achievements.CriteriaEvent StartEvent { + get { return startEvent_ ?? global::bnet.protocol.achievements.CriteriaEvent.DefaultInstance; } + } + + public const int AdvanceEventFieldNumber = 4; + private bool hasAdvanceEvent; + private global::bnet.protocol.achievements.CriteriaEvent advanceEvent_; + public bool HasAdvanceEvent { + get { return hasAdvanceEvent; } + } + public global::bnet.protocol.achievements.CriteriaEvent AdvanceEvent { + get { return advanceEvent_ ?? global::bnet.protocol.achievements.CriteriaEvent.DefaultInstance; } + } + + public const int FailEventFieldNumber = 5; + private bool hasFailEvent; + private global::bnet.protocol.achievements.CriteriaEvent failEvent_; + public bool HasFailEvent { + get { return hasFailEvent; } + } + public global::bnet.protocol.achievements.CriteriaEvent FailEvent { + get { return failEvent_ ?? global::bnet.protocol.achievements.CriteriaEvent.DefaultInstance; } + } + + public const int NecessaryQuantityFieldNumber = 6; + private bool hasNecessaryQuantity; + private ulong necessaryQuantity_; + public bool HasNecessaryQuantity { + get { return hasNecessaryQuantity; } + } + public ulong NecessaryQuantity { + get { return necessaryQuantity_; } + } + + public const int OrderHintFieldNumber = 7; + private bool hasOrderHint; + private uint orderHint_; + public bool HasOrderHint { + get { return hasOrderHint; } + } + public uint OrderHint { + get { return orderHint_; } + } + + public const int EvalutationClassFieldNumber = 8; + private bool hasEvalutationClass; + private uint evalutationClass_; + public bool HasEvalutationClass { + get { return hasEvalutationClass; } + } + public uint EvalutationClass { + get { return evalutationClass_; } + } + + public const int FlagsFieldNumber = 9; + private bool hasFlags; + private uint flags_; + public bool HasFlags { + get { return hasFlags; } + } + public uint Flags { + get { return flags_; } + } + + public const int AttributesFieldNumber = 10; + private pbc::PopsicleList attributes_ = new pbc::PopsicleList(); + public scg::IList AttributesList { + get { return attributes_; } + } + public int AttributesCount { + get { return attributes_.Count; } + } + public global::bnet.protocol.achievements.Attribute GetAttributes(int index) { + return attributes_[index]; + } + + public override bool IsInitialized { + get { + if (!hasCriteriaId) return false; + if (!hasParentAchievementId) return false; + if (!hasNecessaryQuantity) return false; + if (!hasEvalutationClass) return false; + if (!hasFlags) return false; + if (HasStartEvent) { + if (!StartEvent.IsInitialized) return false; + } + if (HasAdvanceEvent) { + if (!AdvanceEvent.IsInitialized) return false; + } + if (HasFailEvent) { + if (!FailEvent.IsInitialized) return false; + } + foreach (global::bnet.protocol.achievements.Attribute element in AttributesList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _staticCriteriaDefinitionFieldNames; + if (hasCriteriaId) { + output.WriteUInt64(1, field_names[2], CriteriaId); + } + if (hasParentAchievementId) { + output.WriteUInt64(2, field_names[8], ParentAchievementId); + } + if (hasStartEvent) { + output.WriteMessage(3, field_names[9], StartEvent); + } + if (hasAdvanceEvent) { + output.WriteMessage(4, field_names[0], AdvanceEvent); + } + if (hasFailEvent) { + output.WriteMessage(5, field_names[4], FailEvent); + } + if (hasNecessaryQuantity) { + output.WriteUInt64(6, field_names[6], NecessaryQuantity); + } + if (hasOrderHint) { + output.WriteUInt32(7, field_names[7], OrderHint); + } + if (hasEvalutationClass) { + output.WriteFixed32(8, field_names[3], EvalutationClass); + } + if (hasFlags) { + output.WriteUInt32(9, field_names[5], Flags); + } + if (attributes_.Count > 0) { + output.WriteMessageArray(10, field_names[1], attributes_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasCriteriaId) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, CriteriaId); + } + if (hasParentAchievementId) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, ParentAchievementId); + } + if (hasStartEvent) { + size += pb::CodedOutputStream.ComputeMessageSize(3, StartEvent); + } + if (hasAdvanceEvent) { + size += pb::CodedOutputStream.ComputeMessageSize(4, AdvanceEvent); + } + if (hasFailEvent) { + size += pb::CodedOutputStream.ComputeMessageSize(5, FailEvent); + } + if (hasNecessaryQuantity) { + size += pb::CodedOutputStream.ComputeUInt64Size(6, NecessaryQuantity); + } + if (hasOrderHint) { + size += pb::CodedOutputStream.ComputeUInt32Size(7, OrderHint); + } + if (hasEvalutationClass) { + size += pb::CodedOutputStream.ComputeFixed32Size(8, EvalutationClass); + } + if (hasFlags) { + size += pb::CodedOutputStream.ComputeUInt32Size(9, Flags); + } + foreach (global::bnet.protocol.achievements.Attribute element in AttributesList) { + size += pb::CodedOutputStream.ComputeMessageSize(10, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static StaticCriteriaDefinition ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static StaticCriteriaDefinition ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static StaticCriteriaDefinition ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static StaticCriteriaDefinition ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static StaticCriteriaDefinition ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static StaticCriteriaDefinition ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static StaticCriteriaDefinition ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static StaticCriteriaDefinition ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static StaticCriteriaDefinition ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static StaticCriteriaDefinition ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private StaticCriteriaDefinition MakeReadOnly() { + attributes_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(StaticCriteriaDefinition prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(StaticCriteriaDefinition cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private StaticCriteriaDefinition result; + + private StaticCriteriaDefinition PrepareBuilder() { + if (resultIsReadOnly) { + StaticCriteriaDefinition original = result; + result = new StaticCriteriaDefinition(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override StaticCriteriaDefinition MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.StaticCriteriaDefinition.Descriptor; } + } + + public override StaticCriteriaDefinition DefaultInstanceForType { + get { return global::bnet.protocol.achievements.StaticCriteriaDefinition.DefaultInstance; } + } + + public override StaticCriteriaDefinition BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is StaticCriteriaDefinition) { + return MergeFrom((StaticCriteriaDefinition) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(StaticCriteriaDefinition other) { + if (other == global::bnet.protocol.achievements.StaticCriteriaDefinition.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasCriteriaId) { + CriteriaId = other.CriteriaId; + } + if (other.HasParentAchievementId) { + ParentAchievementId = other.ParentAchievementId; + } + if (other.HasStartEvent) { + MergeStartEvent(other.StartEvent); + } + if (other.HasAdvanceEvent) { + MergeAdvanceEvent(other.AdvanceEvent); + } + if (other.HasFailEvent) { + MergeFailEvent(other.FailEvent); + } + if (other.HasNecessaryQuantity) { + NecessaryQuantity = other.NecessaryQuantity; + } + if (other.HasOrderHint) { + OrderHint = other.OrderHint; + } + if (other.HasEvalutationClass) { + EvalutationClass = other.EvalutationClass; + } + if (other.HasFlags) { + Flags = other.Flags; + } + if (other.attributes_.Count != 0) { + result.attributes_.Add(other.attributes_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_staticCriteriaDefinitionFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _staticCriteriaDefinitionFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasCriteriaId = input.ReadUInt64(ref result.criteriaId_); + break; + } + case 16: { + result.hasParentAchievementId = input.ReadUInt64(ref result.parentAchievementId_); + break; + } + case 26: { + global::bnet.protocol.achievements.CriteriaEvent.Builder subBuilder = global::bnet.protocol.achievements.CriteriaEvent.CreateBuilder(); + if (result.hasStartEvent) { + subBuilder.MergeFrom(StartEvent); + } + input.ReadMessage(subBuilder, extensionRegistry); + StartEvent = subBuilder.BuildPartial(); + break; + } + case 34: { + global::bnet.protocol.achievements.CriteriaEvent.Builder subBuilder = global::bnet.protocol.achievements.CriteriaEvent.CreateBuilder(); + if (result.hasAdvanceEvent) { + subBuilder.MergeFrom(AdvanceEvent); + } + input.ReadMessage(subBuilder, extensionRegistry); + AdvanceEvent = subBuilder.BuildPartial(); + break; + } + case 42: { + global::bnet.protocol.achievements.CriteriaEvent.Builder subBuilder = global::bnet.protocol.achievements.CriteriaEvent.CreateBuilder(); + if (result.hasFailEvent) { + subBuilder.MergeFrom(FailEvent); + } + input.ReadMessage(subBuilder, extensionRegistry); + FailEvent = subBuilder.BuildPartial(); + break; + } + case 48: { + result.hasNecessaryQuantity = input.ReadUInt64(ref result.necessaryQuantity_); + break; + } + case 56: { + result.hasOrderHint = input.ReadUInt32(ref result.orderHint_); + break; + } + case 69: { + result.hasEvalutationClass = input.ReadFixed32(ref result.evalutationClass_); + break; + } + case 72: { + result.hasFlags = input.ReadUInt32(ref result.flags_); + break; + } + case 82: { + input.ReadMessageArray(tag, field_name, result.attributes_, global::bnet.protocol.achievements.Attribute.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasCriteriaId { + get { return result.hasCriteriaId; } + } + public ulong CriteriaId { + get { return result.CriteriaId; } + set { SetCriteriaId(value); } + } + public Builder SetCriteriaId(ulong value) { + PrepareBuilder(); + result.hasCriteriaId = true; + result.criteriaId_ = value; + return this; + } + public Builder ClearCriteriaId() { + PrepareBuilder(); + result.hasCriteriaId = false; + result.criteriaId_ = 0UL; + return this; + } + + public bool HasParentAchievementId { + get { return result.hasParentAchievementId; } + } + public ulong ParentAchievementId { + get { return result.ParentAchievementId; } + set { SetParentAchievementId(value); } + } + public Builder SetParentAchievementId(ulong value) { + PrepareBuilder(); + result.hasParentAchievementId = true; + result.parentAchievementId_ = value; + return this; + } + public Builder ClearParentAchievementId() { + PrepareBuilder(); + result.hasParentAchievementId = false; + result.parentAchievementId_ = 0UL; + return this; + } + + public bool HasStartEvent { + get { return result.hasStartEvent; } + } + public global::bnet.protocol.achievements.CriteriaEvent StartEvent { + get { return result.StartEvent; } + set { SetStartEvent(value); } + } + public Builder SetStartEvent(global::bnet.protocol.achievements.CriteriaEvent value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasStartEvent = true; + result.startEvent_ = value; + return this; + } + public Builder SetStartEvent(global::bnet.protocol.achievements.CriteriaEvent.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasStartEvent = true; + result.startEvent_ = builderForValue.Build(); + return this; + } + public Builder MergeStartEvent(global::bnet.protocol.achievements.CriteriaEvent value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasStartEvent && + result.startEvent_ != global::bnet.protocol.achievements.CriteriaEvent.DefaultInstance) { + result.startEvent_ = global::bnet.protocol.achievements.CriteriaEvent.CreateBuilder(result.startEvent_).MergeFrom(value).BuildPartial(); + } else { + result.startEvent_ = value; + } + result.hasStartEvent = true; + return this; + } + public Builder ClearStartEvent() { + PrepareBuilder(); + result.hasStartEvent = false; + result.startEvent_ = null; + return this; + } + + public bool HasAdvanceEvent { + get { return result.hasAdvanceEvent; } + } + public global::bnet.protocol.achievements.CriteriaEvent AdvanceEvent { + get { return result.AdvanceEvent; } + set { SetAdvanceEvent(value); } + } + public Builder SetAdvanceEvent(global::bnet.protocol.achievements.CriteriaEvent value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAdvanceEvent = true; + result.advanceEvent_ = value; + return this; + } + public Builder SetAdvanceEvent(global::bnet.protocol.achievements.CriteriaEvent.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAdvanceEvent = true; + result.advanceEvent_ = builderForValue.Build(); + return this; + } + public Builder MergeAdvanceEvent(global::bnet.protocol.achievements.CriteriaEvent value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAdvanceEvent && + result.advanceEvent_ != global::bnet.protocol.achievements.CriteriaEvent.DefaultInstance) { + result.advanceEvent_ = global::bnet.protocol.achievements.CriteriaEvent.CreateBuilder(result.advanceEvent_).MergeFrom(value).BuildPartial(); + } else { + result.advanceEvent_ = value; + } + result.hasAdvanceEvent = true; + return this; + } + public Builder ClearAdvanceEvent() { + PrepareBuilder(); + result.hasAdvanceEvent = false; + result.advanceEvent_ = null; + return this; + } + + public bool HasFailEvent { + get { return result.hasFailEvent; } + } + public global::bnet.protocol.achievements.CriteriaEvent FailEvent { + get { return result.FailEvent; } + set { SetFailEvent(value); } + } + public Builder SetFailEvent(global::bnet.protocol.achievements.CriteriaEvent value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasFailEvent = true; + result.failEvent_ = value; + return this; + } + public Builder SetFailEvent(global::bnet.protocol.achievements.CriteriaEvent.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasFailEvent = true; + result.failEvent_ = builderForValue.Build(); + return this; + } + public Builder MergeFailEvent(global::bnet.protocol.achievements.CriteriaEvent value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasFailEvent && + result.failEvent_ != global::bnet.protocol.achievements.CriteriaEvent.DefaultInstance) { + result.failEvent_ = global::bnet.protocol.achievements.CriteriaEvent.CreateBuilder(result.failEvent_).MergeFrom(value).BuildPartial(); + } else { + result.failEvent_ = value; + } + result.hasFailEvent = true; + return this; + } + public Builder ClearFailEvent() { + PrepareBuilder(); + result.hasFailEvent = false; + result.failEvent_ = null; + return this; + } + + public bool HasNecessaryQuantity { + get { return result.hasNecessaryQuantity; } + } + public ulong NecessaryQuantity { + get { return result.NecessaryQuantity; } + set { SetNecessaryQuantity(value); } + } + public Builder SetNecessaryQuantity(ulong value) { + PrepareBuilder(); + result.hasNecessaryQuantity = true; + result.necessaryQuantity_ = value; + return this; + } + public Builder ClearNecessaryQuantity() { + PrepareBuilder(); + result.hasNecessaryQuantity = false; + result.necessaryQuantity_ = 0UL; + return this; + } + + public bool HasOrderHint { + get { return result.hasOrderHint; } + } + public uint OrderHint { + get { return result.OrderHint; } + set { SetOrderHint(value); } + } + public Builder SetOrderHint(uint value) { + PrepareBuilder(); + result.hasOrderHint = true; + result.orderHint_ = value; + return this; + } + public Builder ClearOrderHint() { + PrepareBuilder(); + result.hasOrderHint = false; + result.orderHint_ = 0; + return this; + } + + public bool HasEvalutationClass { + get { return result.hasEvalutationClass; } + } + public uint EvalutationClass { + get { return result.EvalutationClass; } + set { SetEvalutationClass(value); } + } + public Builder SetEvalutationClass(uint value) { + PrepareBuilder(); + result.hasEvalutationClass = true; + result.evalutationClass_ = value; + return this; + } + public Builder ClearEvalutationClass() { + PrepareBuilder(); + result.hasEvalutationClass = false; + result.evalutationClass_ = 0; + return this; + } + + public bool HasFlags { + get { return result.hasFlags; } + } + public uint Flags { + get { return result.Flags; } + set { SetFlags(value); } + } + public Builder SetFlags(uint value) { + PrepareBuilder(); + result.hasFlags = true; + result.flags_ = value; + return this; + } + public Builder ClearFlags() { + PrepareBuilder(); + result.hasFlags = false; + result.flags_ = 0; + return this; + } + + public pbc::IPopsicleList AttributesList { + get { return PrepareBuilder().attributes_; } + } + public int AttributesCount { + get { return result.AttributesCount; } + } + public global::bnet.protocol.achievements.Attribute GetAttributes(int index) { + return result.GetAttributes(index); + } + public Builder SetAttributes(int index, global::bnet.protocol.achievements.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.attributes_[index] = value; + return this; + } + public Builder SetAttributes(int index, global::bnet.protocol.achievements.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.attributes_[index] = builderForValue.Build(); + return this; + } + public Builder AddAttributes(global::bnet.protocol.achievements.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.attributes_.Add(value); + return this; + } + public Builder AddAttributes(global::bnet.protocol.achievements.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.attributes_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeAttributes(scg::IEnumerable values) { + PrepareBuilder(); + result.attributes_.Add(values); + return this; + } + public Builder ClearAttributes() { + PrepareBuilder(); + result.attributes_.Clear(); + return this; + } + } + static StaticCriteriaDefinition() { + object.ReferenceEquals(global::bnet.protocol.achievements.AchievementsStaticData.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class AchievementFile : pb::GeneratedMessage { + private AchievementFile() { } + private static readonly AchievementFile defaultInstance = new AchievementFile().MakeReadOnly(); + private static readonly string[] _achievementFileFieldNames = new string[] { "achievement", "attributes", "category", "criteria" }; + private static readonly uint[] _achievementFileFieldTags = new uint[] { 18, 34, 10, 26 }; + public static AchievementFile DefaultInstance { + get { return defaultInstance; } + } + + public override AchievementFile DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override AchievementFile ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.achievements.AchievementsStaticData.internal__static_bnet_protocol_achievements_AchievementFile__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.AchievementsStaticData.internal__static_bnet_protocol_achievements_AchievementFile__FieldAccessorTable; } + } + + public const int CategoryFieldNumber = 1; + private pbc::PopsicleList category_ = new pbc::PopsicleList(); + public scg::IList CategoryList { + get { return category_; } + } + public int CategoryCount { + get { return category_.Count; } + } + public global::bnet.protocol.achievements.StaticCategoryDefinition GetCategory(int index) { + return category_[index]; + } + + public const int AchievementFieldNumber = 2; + private pbc::PopsicleList achievement_ = new pbc::PopsicleList(); + public scg::IList AchievementList { + get { return achievement_; } + } + public int AchievementCount { + get { return achievement_.Count; } + } + public global::bnet.protocol.achievements.StaticAchievementDefinition GetAchievement(int index) { + return achievement_[index]; + } + + public const int CriteriaFieldNumber = 3; + private pbc::PopsicleList criteria_ = new pbc::PopsicleList(); + public scg::IList CriteriaList { + get { return criteria_; } + } + public int CriteriaCount { + get { return criteria_.Count; } + } + public global::bnet.protocol.achievements.StaticCriteriaDefinition GetCriteria(int index) { + return criteria_[index]; + } + + public const int AttributesFieldNumber = 4; + private pbc::PopsicleList attributes_ = new pbc::PopsicleList(); + public scg::IList AttributesList { + get { return attributes_; } + } + public int AttributesCount { + get { return attributes_.Count; } + } + public global::bnet.protocol.achievements.Attribute GetAttributes(int index) { + return attributes_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.achievements.StaticCategoryDefinition element in CategoryList) { + if (!element.IsInitialized) return false; + } + foreach (global::bnet.protocol.achievements.StaticAchievementDefinition element in AchievementList) { + if (!element.IsInitialized) return false; + } + foreach (global::bnet.protocol.achievements.StaticCriteriaDefinition element in CriteriaList) { + if (!element.IsInitialized) return false; + } + foreach (global::bnet.protocol.achievements.Attribute element in AttributesList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _achievementFileFieldNames; + if (category_.Count > 0) { + output.WriteMessageArray(1, field_names[2], category_); + } + if (achievement_.Count > 0) { + output.WriteMessageArray(2, field_names[0], achievement_); + } + if (criteria_.Count > 0) { + output.WriteMessageArray(3, field_names[3], criteria_); + } + if (attributes_.Count > 0) { + output.WriteMessageArray(4, field_names[1], attributes_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.achievements.StaticCategoryDefinition element in CategoryList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + foreach (global::bnet.protocol.achievements.StaticAchievementDefinition element in AchievementList) { + size += pb::CodedOutputStream.ComputeMessageSize(2, element); + } + foreach (global::bnet.protocol.achievements.StaticCriteriaDefinition element in CriteriaList) { + size += pb::CodedOutputStream.ComputeMessageSize(3, element); + } + foreach (global::bnet.protocol.achievements.Attribute element in AttributesList) { + size += pb::CodedOutputStream.ComputeMessageSize(4, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static AchievementFile ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AchievementFile ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AchievementFile ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AchievementFile ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AchievementFile ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AchievementFile ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static AchievementFile ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static AchievementFile ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static AchievementFile ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AchievementFile ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private AchievementFile MakeReadOnly() { + category_.MakeReadOnly(); + achievement_.MakeReadOnly(); + criteria_.MakeReadOnly(); + attributes_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(AchievementFile prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(AchievementFile cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private AchievementFile result; + + private AchievementFile PrepareBuilder() { + if (resultIsReadOnly) { + AchievementFile original = result; + result = new AchievementFile(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override AchievementFile MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.achievements.AchievementFile.Descriptor; } + } + + public override AchievementFile DefaultInstanceForType { + get { return global::bnet.protocol.achievements.AchievementFile.DefaultInstance; } + } + + public override AchievementFile BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is AchievementFile) { + return MergeFrom((AchievementFile) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(AchievementFile other) { + if (other == global::bnet.protocol.achievements.AchievementFile.DefaultInstance) return this; + PrepareBuilder(); + if (other.category_.Count != 0) { + result.category_.Add(other.category_); + } + if (other.achievement_.Count != 0) { + result.achievement_.Add(other.achievement_); + } + if (other.criteria_.Count != 0) { + result.criteria_.Add(other.criteria_); + } + if (other.attributes_.Count != 0) { + result.attributes_.Add(other.attributes_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_achievementFileFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _achievementFileFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.category_, global::bnet.protocol.achievements.StaticCategoryDefinition.DefaultInstance, extensionRegistry); + break; + } + case 18: { + input.ReadMessageArray(tag, field_name, result.achievement_, global::bnet.protocol.achievements.StaticAchievementDefinition.DefaultInstance, extensionRegistry); + break; + } + case 26: { + input.ReadMessageArray(tag, field_name, result.criteria_, global::bnet.protocol.achievements.StaticCriteriaDefinition.DefaultInstance, extensionRegistry); + break; + } + case 34: { + input.ReadMessageArray(tag, field_name, result.attributes_, global::bnet.protocol.achievements.Attribute.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList CategoryList { + get { return PrepareBuilder().category_; } + } + public int CategoryCount { + get { return result.CategoryCount; } + } + public global::bnet.protocol.achievements.StaticCategoryDefinition GetCategory(int index) { + return result.GetCategory(index); + } + public Builder SetCategory(int index, global::bnet.protocol.achievements.StaticCategoryDefinition value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.category_[index] = value; + return this; + } + public Builder SetCategory(int index, global::bnet.protocol.achievements.StaticCategoryDefinition.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.category_[index] = builderForValue.Build(); + return this; + } + public Builder AddCategory(global::bnet.protocol.achievements.StaticCategoryDefinition value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.category_.Add(value); + return this; + } + public Builder AddCategory(global::bnet.protocol.achievements.StaticCategoryDefinition.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.category_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeCategory(scg::IEnumerable values) { + PrepareBuilder(); + result.category_.Add(values); + return this; + } + public Builder ClearCategory() { + PrepareBuilder(); + result.category_.Clear(); + return this; + } + + public pbc::IPopsicleList AchievementList { + get { return PrepareBuilder().achievement_; } + } + public int AchievementCount { + get { return result.AchievementCount; } + } + public global::bnet.protocol.achievements.StaticAchievementDefinition GetAchievement(int index) { + return result.GetAchievement(index); + } + public Builder SetAchievement(int index, global::bnet.protocol.achievements.StaticAchievementDefinition value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.achievement_[index] = value; + return this; + } + public Builder SetAchievement(int index, global::bnet.protocol.achievements.StaticAchievementDefinition.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.achievement_[index] = builderForValue.Build(); + return this; + } + public Builder AddAchievement(global::bnet.protocol.achievements.StaticAchievementDefinition value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.achievement_.Add(value); + return this; + } + public Builder AddAchievement(global::bnet.protocol.achievements.StaticAchievementDefinition.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.achievement_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeAchievement(scg::IEnumerable values) { + PrepareBuilder(); + result.achievement_.Add(values); + return this; + } + public Builder ClearAchievement() { + PrepareBuilder(); + result.achievement_.Clear(); + return this; + } + + public pbc::IPopsicleList CriteriaList { + get { return PrepareBuilder().criteria_; } + } + public int CriteriaCount { + get { return result.CriteriaCount; } + } + public global::bnet.protocol.achievements.StaticCriteriaDefinition GetCriteria(int index) { + return result.GetCriteria(index); + } + public Builder SetCriteria(int index, global::bnet.protocol.achievements.StaticCriteriaDefinition value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.criteria_[index] = value; + return this; + } + public Builder SetCriteria(int index, global::bnet.protocol.achievements.StaticCriteriaDefinition.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.criteria_[index] = builderForValue.Build(); + return this; + } + public Builder AddCriteria(global::bnet.protocol.achievements.StaticCriteriaDefinition value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.criteria_.Add(value); + return this; + } + public Builder AddCriteria(global::bnet.protocol.achievements.StaticCriteriaDefinition.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.criteria_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeCriteria(scg::IEnumerable values) { + PrepareBuilder(); + result.criteria_.Add(values); + return this; + } + public Builder ClearCriteria() { + PrepareBuilder(); + result.criteria_.Clear(); + return this; + } + + public pbc::IPopsicleList AttributesList { + get { return PrepareBuilder().attributes_; } + } + public int AttributesCount { + get { return result.AttributesCount; } + } + public global::bnet.protocol.achievements.Attribute GetAttributes(int index) { + return result.GetAttributes(index); + } + public Builder SetAttributes(int index, global::bnet.protocol.achievements.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.attributes_[index] = value; + return this; + } + public Builder SetAttributes(int index, global::bnet.protocol.achievements.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.attributes_[index] = builderForValue.Build(); + return this; + } + public Builder AddAttributes(global::bnet.protocol.achievements.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.attributes_.Add(value); + return this; + } + public Builder AddAttributes(global::bnet.protocol.achievements.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.attributes_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeAttributes(scg::IEnumerable values) { + PrepareBuilder(); + result.attributes_.Add(values); + return this; + } + public Builder ClearAttributes() { + PrepareBuilder(); + result.attributes_.Clear(); + return this; + } + } + static AchievementFile() { + object.ReferenceEquals(global::bnet.protocol.achievements.AchievementsStaticData.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code diff --git a/source/D3Proto/bnet/protocol/attribute/Attribute.cs b/src/LibMooNet/bnet/protocol/attribute/Attribute.cs similarity index 64% rename from source/D3Proto/bnet/protocol/attribute/Attribute.cs rename to src/LibMooNet/bnet/protocol/attribute/Attribute.cs index f5c2eea2..211024b9 100644 --- a/source/D3Proto/bnet/protocol/attribute/Attribute.cs +++ b/src/LibMooNet/bnet/protocol/attribute/Attribute.cs @@ -1,4 +1,6 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code using pb = global::Google.ProtocolBuffers; using pbc = global::Google.ProtocolBuffers.Collections; @@ -8,6 +10,9 @@ namespace bnet.protocol.attribute { namespace Proto { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public static partial class Attribute { #region Extension registration @@ -30,25 +35,26 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { static Attribute() { byte[] descriptorData = global::System.Convert.FromBase64String( - "ChxsaWIvcHJvdG9jb2wvYXR0cmlidXRlLnByb3RvEhdibmV0LnByb3RvY29s" + - "LmF0dHJpYnV0ZSKwAQoHVmFyaWFudBISCgpib29sX3ZhbHVlGAIgASgIEhEK" + - "CWludF92YWx1ZRgDIAEoAxITCgtmbG9hdF92YWx1ZRgEIAEoARIUCgxzdHJp" + - "bmdfdmFsdWUYBSABKAkSEgoKYmxvYl92YWx1ZRgGIAEoDBIVCg1tZXNzYWdl" + - "X3ZhbHVlGAcgASgMEhQKDGZvdXJjY192YWx1ZRgIIAEoCRISCgp1aW50X3Zh" + - "bHVlGAkgASgEIkoKCUF0dHJpYnV0ZRIMCgRuYW1lGAEgAigJEi8KBXZhbHVl" + - "GAIgAigLMiAuYm5ldC5wcm90b2NvbC5hdHRyaWJ1dGUuVmFyaWFudCLgAQoP" + - "QXR0cmlidXRlRmlsdGVyEj4KAm9wGAEgAigOMjIuYm5ldC5wcm90b2NvbC5h" + - "dHRyaWJ1dGUuQXR0cmlidXRlRmlsdGVyLk9wZXJhdGlvbhI1CglhdHRyaWJ1" + - "dGUYAiADKAsyIi5ibmV0LnByb3RvY29sLmF0dHJpYnV0ZS5BdHRyaWJ1dGUi" + - "VgoJT3BlcmF0aW9uEg4KCk1BVENIX05PTkUQABINCglNQVRDSF9BTlkQARIN" + - "CglNQVRDSF9BTEwQAhIbChdNQVRDSF9BTExfTU9TVF9TUEVDSUZJQxADQgxC" + - "CkNBdHRyaWJ1dGU="); + "ChRibmV0L2F0dHJpYnV0ZS5wcm90bxIXYm5ldC5wcm90b2NvbC5hdHRyaWJ1" + + "dGUaEWJuZXQvZW50aXR5LnByb3RvIuEBCgdWYXJpYW50EhIKCmJvb2xfdmFs" + + "dWUYAiABKAgSEQoJaW50X3ZhbHVlGAMgASgDEhMKC2Zsb2F0X3ZhbHVlGAQg" + + "ASgBEhQKDHN0cmluZ192YWx1ZRgFIAEoCRISCgpibG9iX3ZhbHVlGAYgASgM" + + "EhUKDW1lc3NhZ2VfdmFsdWUYByABKAwSFAoMZm91cmNjX3ZhbHVlGAggASgJ" + + "EhIKCnVpbnRfdmFsdWUYCSABKAQSLwoOZW50aXR5aWRfdmFsdWUYCiABKAsy" + + "Fy5ibmV0LnByb3RvY29sLkVudGl0eUlkIkoKCUF0dHJpYnV0ZRIMCgRuYW1l" + + "GAEgAigJEi8KBXZhbHVlGAIgAigLMiAuYm5ldC5wcm90b2NvbC5hdHRyaWJ1" + + "dGUuVmFyaWFudCLgAQoPQXR0cmlidXRlRmlsdGVyEj4KAm9wGAEgAigOMjIu" + + "Ym5ldC5wcm90b2NvbC5hdHRyaWJ1dGUuQXR0cmlidXRlRmlsdGVyLk9wZXJh" + + "dGlvbhI1CglhdHRyaWJ1dGUYAiADKAsyIi5ibmV0LnByb3RvY29sLmF0dHJp" + + "YnV0ZS5BdHRyaWJ1dGUiVgoJT3BlcmF0aW9uEg4KCk1BVENIX05PTkUQABIN" + + "CglNQVRDSF9BTlkQARINCglNQVRDSF9BTEwQAhIbChdNQVRDSF9BTExfTU9T" + + "VF9TUEVDSUZJQxAD"); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_bnet_protocol_attribute_Variant__Descriptor = Descriptor.MessageTypes[0]; internal__static_bnet_protocol_attribute_Variant__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_attribute_Variant__Descriptor, - new string[] { "BoolValue", "IntValue", "FloatValue", "StringValue", "BlobValue", "MessageValue", "FourccValue", "UintValue", }); + new string[] { "BoolValue", "IntValue", "FloatValue", "StringValue", "BlobValue", "MessageValue", "FourccValue", "UintValue", "EntityidValue", }); internal__static_bnet_protocol_attribute_Attribute__Descriptor = Descriptor.MessageTypes[1]; internal__static_bnet_protocol_attribute_Attribute__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_attribute_Attribute__Descriptor, @@ -61,6 +67,7 @@ static Attribute() { }; pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbd::FileDescriptor[] { + global::bnet.protocol.Entity.Descriptor, }, assigner); } #endregion @@ -68,14 +75,20 @@ static Attribute() { } } #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Variant : pb::GeneratedMessage { - private static readonly Variant defaultInstance = new Builder().BuildPartial(); + private Variant() { } + private static readonly Variant defaultInstance = new Variant().MakeReadOnly(); + private static readonly string[] _variantFieldNames = new string[] { "blob_value", "bool_value", "entityid_value", "float_value", "fourcc_value", "int_value", "message_value", "string_value", "uint_value" }; + private static readonly uint[] _variantFieldTags = new uint[] { 50, 16, 82, 33, 66, 24, 58, 42, 72 }; public static Variant DefaultInstance { get { return defaultInstance; } } public override Variant DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override Variant ThisMessage { @@ -92,7 +105,7 @@ protected override Variant ThisMessage { public const int BoolValueFieldNumber = 2; private bool hasBoolValue; - private bool boolValue_ = false; + private bool boolValue_; public bool HasBoolValue { get { return hasBoolValue; } } @@ -102,7 +115,7 @@ public bool BoolValue { public const int IntValueFieldNumber = 3; private bool hasIntValue; - private long intValue_ = 0L; + private long intValue_; public bool HasIntValue { get { return hasIntValue; } } @@ -112,7 +125,7 @@ public long IntValue { public const int FloatValueFieldNumber = 4; private bool hasFloatValue; - private double floatValue_ = 0D; + private double floatValue_; public bool HasFloatValue { get { return hasFloatValue; } } @@ -162,7 +175,7 @@ public string FourccValue { public const int UintValueFieldNumber = 9; private bool hasUintValue; - private ulong uintValue_ = 0UL; + private ulong uintValue_; public bool HasUintValue { get { return hasUintValue; } } @@ -170,37 +183,54 @@ public ulong UintValue { get { return uintValue_; } } + public const int EntityidValueFieldNumber = 10; + private bool hasEntityidValue; + private global::bnet.protocol.EntityId entityidValue_; + public bool HasEntityidValue { + get { return hasEntityidValue; } + } + public global::bnet.protocol.EntityId EntityidValue { + get { return entityidValue_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + public override bool IsInitialized { get { + if (HasEntityidValue) { + if (!EntityidValue.IsInitialized) return false; + } return true; } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasBoolValue) { - output.WriteBool(2, BoolValue); + string[] field_names = _variantFieldNames; + if (hasBoolValue) { + output.WriteBool(2, field_names[1], BoolValue); + } + if (hasIntValue) { + output.WriteInt64(3, field_names[5], IntValue); } - if (HasIntValue) { - output.WriteInt64(3, IntValue); + if (hasFloatValue) { + output.WriteDouble(4, field_names[3], FloatValue); } - if (HasFloatValue) { - output.WriteDouble(4, FloatValue); + if (hasStringValue) { + output.WriteString(5, field_names[7], StringValue); } - if (HasStringValue) { - output.WriteString(5, StringValue); + if (hasBlobValue) { + output.WriteBytes(6, field_names[0], BlobValue); } - if (HasBlobValue) { - output.WriteBytes(6, BlobValue); + if (hasMessageValue) { + output.WriteBytes(7, field_names[6], MessageValue); } - if (HasMessageValue) { - output.WriteBytes(7, MessageValue); + if (hasFourccValue) { + output.WriteString(8, field_names[4], FourccValue); } - if (HasFourccValue) { - output.WriteString(8, FourccValue); + if (hasUintValue) { + output.WriteUInt64(9, field_names[8], UintValue); } - if (HasUintValue) { - output.WriteUInt64(9, UintValue); + if (hasEntityidValue) { + output.WriteMessage(10, field_names[2], EntityidValue); } UnknownFields.WriteTo(output); } @@ -212,30 +242,33 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasBoolValue) { + if (hasBoolValue) { size += pb::CodedOutputStream.ComputeBoolSize(2, BoolValue); } - if (HasIntValue) { + if (hasIntValue) { size += pb::CodedOutputStream.ComputeInt64Size(3, IntValue); } - if (HasFloatValue) { + if (hasFloatValue) { size += pb::CodedOutputStream.ComputeDoubleSize(4, FloatValue); } - if (HasStringValue) { + if (hasStringValue) { size += pb::CodedOutputStream.ComputeStringSize(5, StringValue); } - if (HasBlobValue) { + if (hasBlobValue) { size += pb::CodedOutputStream.ComputeBytesSize(6, BlobValue); } - if (HasMessageValue) { + if (hasMessageValue) { size += pb::CodedOutputStream.ComputeBytesSize(7, MessageValue); } - if (HasFourccValue) { + if (hasFourccValue) { size += pb::CodedOutputStream.ComputeStringSize(8, FourccValue); } - if (HasUintValue) { + if (hasUintValue) { size += pb::CodedOutputStream.ComputeUInt64Size(9, UintValue); } + if (hasEntityidValue) { + size += pb::CodedOutputStream.ComputeMessageSize(10, EntityidValue); + } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; return size; @@ -266,38 +299,72 @@ public static Variant ParseDelimitedFrom(global::System.IO.Stream input) { public static Variant ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static Variant ParseFrom(pb::CodedInputStream input) { + public static Variant ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Variant ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static Variant ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private Variant MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(Variant prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Variant cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - Variant result = new Variant(); + private bool resultIsReadOnly; + private Variant result; + + private Variant PrepareBuilder() { + if (resultIsReadOnly) { + Variant original = result; + result = new Variant(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override Variant MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new Variant(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -309,12 +376,11 @@ public override Variant DefaultInstanceForType { } public override Variant BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - Variant returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -328,6 +394,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Variant other) { if (other == global::bnet.protocol.attribute.Variant.DefaultInstance) return this; + PrepareBuilder(); if (other.HasBoolValue) { BoolValue = other.BoolValue; } @@ -352,24 +419,38 @@ public override Builder MergeFrom(Variant other) { if (other.HasUintValue) { UintValue = other.UintValue; } + if (other.HasEntityidValue) { + MergeEntityidValue(other.EntityidValue); + } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_variantFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _variantFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -381,102 +462,122 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 16: { - BoolValue = input.ReadBool(); + result.hasBoolValue = input.ReadBool(ref result.boolValue_); break; } case 24: { - IntValue = input.ReadInt64(); + result.hasIntValue = input.ReadInt64(ref result.intValue_); break; } case 33: { - FloatValue = input.ReadDouble(); + result.hasFloatValue = input.ReadDouble(ref result.floatValue_); break; } case 42: { - StringValue = input.ReadString(); + result.hasStringValue = input.ReadString(ref result.stringValue_); break; } case 50: { - BlobValue = input.ReadBytes(); + result.hasBlobValue = input.ReadBytes(ref result.blobValue_); break; } case 58: { - MessageValue = input.ReadBytes(); + result.hasMessageValue = input.ReadBytes(ref result.messageValue_); break; } case 66: { - FourccValue = input.ReadString(); + result.hasFourccValue = input.ReadString(ref result.fourccValue_); break; } case 72: { - UintValue = input.ReadUInt64(); + result.hasUintValue = input.ReadUInt64(ref result.uintValue_); + break; + } + case 82: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasEntityidValue) { + subBuilder.MergeFrom(EntityidValue); + } + input.ReadMessage(subBuilder, extensionRegistry); + EntityidValue = subBuilder.BuildPartial(); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasBoolValue { - get { return result.HasBoolValue; } + get { return result.hasBoolValue; } } public bool BoolValue { get { return result.BoolValue; } set { SetBoolValue(value); } } public Builder SetBoolValue(bool value) { + PrepareBuilder(); result.hasBoolValue = true; result.boolValue_ = value; return this; } public Builder ClearBoolValue() { + PrepareBuilder(); result.hasBoolValue = false; result.boolValue_ = false; return this; } public bool HasIntValue { - get { return result.HasIntValue; } + get { return result.hasIntValue; } } public long IntValue { get { return result.IntValue; } set { SetIntValue(value); } } public Builder SetIntValue(long value) { + PrepareBuilder(); result.hasIntValue = true; result.intValue_ = value; return this; } public Builder ClearIntValue() { + PrepareBuilder(); result.hasIntValue = false; result.intValue_ = 0L; return this; } public bool HasFloatValue { - get { return result.HasFloatValue; } + get { return result.hasFloatValue; } } public double FloatValue { get { return result.FloatValue; } set { SetFloatValue(value); } } public Builder SetFloatValue(double value) { + PrepareBuilder(); result.hasFloatValue = true; result.floatValue_ = value; return this; } public Builder ClearFloatValue() { + PrepareBuilder(); result.hasFloatValue = false; result.floatValue_ = 0D; return this; } public bool HasStringValue { - get { return result.HasStringValue; } + get { return result.hasStringValue; } } public string StringValue { get { return result.StringValue; } @@ -484,18 +585,20 @@ public string StringValue { } public Builder SetStringValue(string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasStringValue = true; result.stringValue_ = value; return this; } public Builder ClearStringValue() { + PrepareBuilder(); result.hasStringValue = false; result.stringValue_ = ""; return this; } public bool HasBlobValue { - get { return result.HasBlobValue; } + get { return result.hasBlobValue; } } public pb::ByteString BlobValue { get { return result.BlobValue; } @@ -503,18 +606,20 @@ public bool HasBlobValue { } public Builder SetBlobValue(pb::ByteString value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasBlobValue = true; result.blobValue_ = value; return this; } public Builder ClearBlobValue() { + PrepareBuilder(); result.hasBlobValue = false; result.blobValue_ = pb::ByteString.Empty; return this; } public bool HasMessageValue { - get { return result.HasMessageValue; } + get { return result.hasMessageValue; } } public pb::ByteString MessageValue { get { return result.MessageValue; } @@ -522,18 +627,20 @@ public bool HasMessageValue { } public Builder SetMessageValue(pb::ByteString value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasMessageValue = true; result.messageValue_ = value; return this; } public Builder ClearMessageValue() { + PrepareBuilder(); result.hasMessageValue = false; result.messageValue_ = pb::ByteString.Empty; return this; } public bool HasFourccValue { - get { return result.HasFourccValue; } + get { return result.hasFourccValue; } } public string FourccValue { get { return result.FourccValue; } @@ -541,47 +648,97 @@ public string FourccValue { } public Builder SetFourccValue(string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasFourccValue = true; result.fourccValue_ = value; return this; } public Builder ClearFourccValue() { + PrepareBuilder(); result.hasFourccValue = false; result.fourccValue_ = ""; return this; } public bool HasUintValue { - get { return result.HasUintValue; } + get { return result.hasUintValue; } } public ulong UintValue { get { return result.UintValue; } set { SetUintValue(value); } } public Builder SetUintValue(ulong value) { + PrepareBuilder(); result.hasUintValue = true; result.uintValue_ = value; return this; } public Builder ClearUintValue() { + PrepareBuilder(); result.hasUintValue = false; result.uintValue_ = 0UL; return this; } + + public bool HasEntityidValue { + get { return result.hasEntityidValue; } + } + public global::bnet.protocol.EntityId EntityidValue { + get { return result.EntityidValue; } + set { SetEntityidValue(value); } + } + public Builder SetEntityidValue(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasEntityidValue = true; + result.entityidValue_ = value; + return this; + } + public Builder SetEntityidValue(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasEntityidValue = true; + result.entityidValue_ = builderForValue.Build(); + return this; + } + public Builder MergeEntityidValue(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasEntityidValue && + result.entityidValue_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.entityidValue_ = global::bnet.protocol.EntityId.CreateBuilder(result.entityidValue_).MergeFrom(value).BuildPartial(); + } else { + result.entityidValue_ = value; + } + result.hasEntityidValue = true; + return this; + } + public Builder ClearEntityidValue() { + PrepareBuilder(); + result.hasEntityidValue = false; + result.entityidValue_ = null; + return this; + } } static Variant() { object.ReferenceEquals(global::bnet.protocol.attribute.Proto.Attribute.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Attribute : pb::GeneratedMessage { - private static readonly Attribute defaultInstance = new Builder().BuildPartial(); + private Attribute() { } + private static readonly Attribute defaultInstance = new Attribute().MakeReadOnly(); + private static readonly string[] _attributeFieldNames = new string[] { "name", "value" }; + private static readonly uint[] _attributeFieldTags = new uint[] { 10, 18 }; public static Attribute DefaultInstance { get { return defaultInstance; } } public override Attribute DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override Attribute ThisMessage { @@ -608,29 +765,31 @@ public string Name { public const int ValueFieldNumber = 2; private bool hasValue; - private global::bnet.protocol.attribute.Variant value_ = global::bnet.protocol.attribute.Variant.DefaultInstance; + private global::bnet.protocol.attribute.Variant value_; public bool HasValue { get { return hasValue; } } public global::bnet.protocol.attribute.Variant Value { - get { return value_; } + get { return value_ ?? global::bnet.protocol.attribute.Variant.DefaultInstance; } } public override bool IsInitialized { get { if (!hasName) return false; if (!hasValue) return false; + if (!Value.IsInitialized) return false; return true; } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasName) { - output.WriteString(1, Name); + string[] field_names = _attributeFieldNames; + if (hasName) { + output.WriteString(1, field_names[0], Name); } - if (HasValue) { - output.WriteMessage(2, Value); + if (hasValue) { + output.WriteMessage(2, field_names[1], Value); } UnknownFields.WriteTo(output); } @@ -642,10 +801,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasName) { + if (hasName) { size += pb::CodedOutputStream.ComputeStringSize(1, Name); } - if (HasValue) { + if (hasValue) { size += pb::CodedOutputStream.ComputeMessageSize(2, Value); } size += UnknownFields.SerializedSize; @@ -678,38 +837,72 @@ public static Attribute ParseDelimitedFrom(global::System.IO.Stream input) { public static Attribute ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static Attribute ParseFrom(pb::CodedInputStream input) { + public static Attribute ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Attribute ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static Attribute ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private Attribute MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(Attribute prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Attribute cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Attribute result; + + private Attribute PrepareBuilder() { + if (resultIsReadOnly) { + Attribute original = result; + result = new Attribute(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - Attribute result = new Attribute(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override Attribute MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new Attribute(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -721,12 +914,11 @@ public override Attribute DefaultInstanceForType { } public override Attribute BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - Attribute returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -740,6 +932,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Attribute other) { if (other == global::bnet.protocol.attribute.Attribute.DefaultInstance) return this; + PrepareBuilder(); if (other.HasName) { Name = other.Name; } @@ -750,20 +943,31 @@ public override Builder MergeFrom(Attribute other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_attributeFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _attributeFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -775,16 +979,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { - Name = input.ReadString(); + result.hasName = input.ReadString(ref result.name_); break; } case 18: { global::bnet.protocol.attribute.Variant.Builder subBuilder = global::bnet.protocol.attribute.Variant.CreateBuilder(); - if (HasValue) { + if (result.hasValue) { subBuilder.MergeFrom(Value); } input.ReadMessage(subBuilder, extensionRegistry); @@ -793,11 +997,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasName { - get { return result.HasName; } + get { return result.hasName; } } public string Name { get { return result.Name; } @@ -805,18 +1014,20 @@ public string Name { } public Builder SetName(string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasName = true; result.name_ = value; return this; } public Builder ClearName() { + PrepareBuilder(); result.hasName = false; result.name_ = ""; return this; } public bool HasValue { - get { return result.HasValue; } + get { return result.hasValue; } } public global::bnet.protocol.attribute.Variant Value { get { return result.Value; } @@ -824,19 +1035,22 @@ public bool HasValue { } public Builder SetValue(global::bnet.protocol.attribute.Variant value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasValue = true; result.value_ = value; return this; } public Builder SetValue(global::bnet.protocol.attribute.Variant.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasValue = true; result.value_ = builderForValue.Build(); return this; } public Builder MergeValue(global::bnet.protocol.attribute.Variant value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasValue && + PrepareBuilder(); + if (result.hasValue && result.value_ != global::bnet.protocol.attribute.Variant.DefaultInstance) { result.value_ = global::bnet.protocol.attribute.Variant.CreateBuilder(result.value_).MergeFrom(value).BuildPartial(); } else { @@ -846,8 +1060,9 @@ public Builder MergeValue(global::bnet.protocol.attribute.Variant value) { return this; } public Builder ClearValue() { + PrepareBuilder(); result.hasValue = false; - result.value_ = global::bnet.protocol.attribute.Variant.DefaultInstance; + result.value_ = null; return this; } } @@ -856,14 +1071,20 @@ static Attribute() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class AttributeFilter : pb::GeneratedMessage { - private static readonly AttributeFilter defaultInstance = new Builder().BuildPartial(); + private AttributeFilter() { } + private static readonly AttributeFilter defaultInstance = new AttributeFilter().MakeReadOnly(); + private static readonly string[] _attributeFilterFieldNames = new string[] { "attribute", "op" }; + private static readonly uint[] _attributeFilterFieldTags = new uint[] { 18, 8 }; public static AttributeFilter DefaultInstance { get { return defaultInstance; } } public override AttributeFilter DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override AttributeFilter ThisMessage { @@ -879,7 +1100,12 @@ protected override AttributeFilter ThisMessage { } #region Nested types + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public static class Types { + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public enum Operation { MATCH_NONE = 0, MATCH_ANY = 1, @@ -922,13 +1148,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasOp) { - output.WriteEnum(1, (int) Op); + string[] field_names = _attributeFilterFieldNames; + if (hasOp) { + output.WriteEnum(1, field_names[1], (int) Op, Op); } - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - output.WriteMessage(2, element); + if (attribute_.Count > 0) { + output.WriteMessageArray(2, field_names[0], attribute_); } UnknownFields.WriteTo(output); } @@ -940,7 +1167,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasOp) { + if (hasOp) { size += pb::CodedOutputStream.ComputeEnumSize(1, (int) Op); } foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { @@ -976,38 +1203,73 @@ public static AttributeFilter ParseDelimitedFrom(global::System.IO.Stream input) public static AttributeFilter ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static AttributeFilter ParseFrom(pb::CodedInputStream input) { + public static AttributeFilter ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static AttributeFilter ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static AttributeFilter ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private AttributeFilter MakeReadOnly() { + attribute_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(AttributeFilter prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(AttributeFilter cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private AttributeFilter result; + + private AttributeFilter PrepareBuilder() { + if (resultIsReadOnly) { + AttributeFilter original = result; + result = new AttributeFilter(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - AttributeFilter result = new AttributeFilter(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override AttributeFilter MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new AttributeFilter(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -1019,13 +1281,11 @@ public override AttributeFilter DefaultInstanceForType { } public override AttributeFilter BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.attribute_.MakeReadOnly(); - AttributeFilter returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1039,30 +1299,42 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(AttributeFilter other) { if (other == global::bnet.protocol.attribute.AttributeFilter.DefaultInstance) return this; + PrepareBuilder(); if (other.HasOp) { Op = other.Op; } if (other.attribute_.Count != 0) { - base.AddRange(other.attribute_, result.attribute_); + result.attribute_.Add(other.attribute_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_attributeFilterFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _attributeFilterFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1074,52 +1346,57 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 8: { - int rawValue = input.ReadEnum(); - if (!global::System.Enum.IsDefined(typeof(global::bnet.protocol.attribute.AttributeFilter.Types.Operation), rawValue)) { + object unknown; + if(input.ReadEnum(ref result.op_, out unknown)) { + result.hasOp = true; + } else if(unknown is int) { if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - unknownFields.MergeVarintField(1, (ulong) rawValue); - } else { - Op = (global::bnet.protocol.attribute.AttributeFilter.Types.Operation) rawValue; + unknownFields.MergeVarintField(1, (ulong)(int)unknown); } break; } case 18: { - global::bnet.protocol.attribute.Attribute.Builder subBuilder = global::bnet.protocol.attribute.Attribute.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddAttribute(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.attribute_, global::bnet.protocol.attribute.Attribute.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasOp { - get { return result.HasOp; } + get { return result.hasOp; } } public global::bnet.protocol.attribute.AttributeFilter.Types.Operation Op { get { return result.Op; } set { SetOp(value); } } public Builder SetOp(global::bnet.protocol.attribute.AttributeFilter.Types.Operation value) { + PrepareBuilder(); result.hasOp = true; result.op_ = value; return this; } public Builder ClearOp() { + PrepareBuilder(); result.hasOp = false; result.op_ = global::bnet.protocol.attribute.AttributeFilter.Types.Operation.MATCH_NONE; return this; } public pbc::IPopsicleList AttributeList { - get { return result.attribute_; } + get { return PrepareBuilder().attribute_; } } public int AttributeCount { get { return result.AttributeCount; } @@ -1129,29 +1406,35 @@ public int AttributeCount { } public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.attribute_[index] = value; return this; } public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.attribute_[index] = builderForValue.Build(); return this; } public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.attribute_.Add(value); return this; } public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.attribute_.Add(builderForValue.Build()); return this; } public Builder AddRangeAttribute(scg::IEnumerable values) { - base.AddRange(values, result.attribute_); + PrepareBuilder(); + result.attribute_.Add(values); return this; } public Builder ClearAttribute() { + PrepareBuilder(); result.attribute_.Clear(); return this; } @@ -1164,3 +1447,5 @@ static AttributeFilter() { #endregion } + +#endregion Designer generated code diff --git a/src/LibMooNet/bnet/protocol/authentication/AuthenticationService.cs b/src/LibMooNet/bnet/protocol/authentication/AuthenticationService.cs new file mode 100644 index 00000000..75281bc1 --- /dev/null +++ b/src/LibMooNet/bnet/protocol/authentication/AuthenticationService.cs @@ -0,0 +1,4221 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace bnet.protocol.authentication { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class AuthenticationService { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_bnet_protocol_authentication_ModuleLoadRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_authentication_ModuleLoadRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_authentication_ModuleNotification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_authentication_ModuleNotification__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_authentication_ModuleMessageRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_authentication_ModuleMessageRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_authentication_LogonRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_authentication_LogonRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_authentication_LogonResult__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_authentication_LogonResult__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_authentication_LogonUpdateRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_authentication_LogonUpdateRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_authentication_AccountSettingsNotification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_authentication_AccountSettingsNotification__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_authentication_ServerStateChangeRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_authentication_ServerStateChangeRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_authentication_MemModuleLoadRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_authentication_MemModuleLoadRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_authentication_MemModuleLoadResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_authentication_MemModuleLoadResponse__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static AuthenticationService() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "CiFibmV0L2F1dGhlbnRpY2F0aW9uX3NlcnZpY2UucHJvdG8SHGJuZXQucHJv" + + "dG9jb2wuYXV0aGVudGljYXRpb24aGGJuZXQvYWNjb3VudF90eXBlcy5wcm90" + + "bxoOYm5ldC9ycGMucHJvdG8aGWJuZXQvY29udGVudF9oYW5kbGUucHJvdG8a" + + "EWJuZXQvZW50aXR5LnByb3RvIlkKEU1vZHVsZUxvYWRSZXF1ZXN0EjMKDW1v" + + "ZHVsZV9oYW5kbGUYASACKAsyHC5ibmV0LnByb3RvY29sLkNvbnRlbnRIYW5k" + + "bGUSDwoHbWVzc2FnZRgCIAEoDCI3ChJNb2R1bGVOb3RpZmljYXRpb24SEQoJ" + + "bW9kdWxlX2lkGAIgASgFEg4KBnJlc3VsdBgDIAEoDSI6ChRNb2R1bGVNZXNz" + + "YWdlUmVxdWVzdBIRCgltb2R1bGVfaWQYASACKAUSDwoHbWVzc2FnZRgCIAEo" + + "DCKTAQoMTG9nb25SZXF1ZXN0Eg8KB3Byb2dyYW0YASABKAkSEAoIcGxhdGZv" + + "cm0YAiABKAkSDgoGbG9jYWxlGAMgASgJEg0KBWVtYWlsGAQgASgJEg8KB3Zl" + + "cnNpb24YBSABKAkSGwoTYXBwbGljYXRpb25fdmVyc2lvbhgGIAEoBRITCgtj" + + "b29raWVfb25seRgHIAEoCCJ6CgtMb2dvblJlc3VsdBISCgplcnJvcl9jb2Rl" + + "GAEgAigNEigKB2FjY291bnQYAiABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0" + + "eUlkEi0KDGdhbWVfYWNjb3VudBgDIAMoCzIXLmJuZXQucHJvdG9jb2wuRW50" + + "aXR5SWQiKAoSTG9nb25VcGRhdGVSZXF1ZXN0EhIKCmVycm9yX2NvZGUYASAC" + + "KA0ivAEKG0FjY291bnRTZXR0aW5nc05vdGlmaWNhdGlvbhI3CghsaWNlbnNl" + + "cxgBIAMoCzIlLmJuZXQucHJvdG9jb2wuYWNjb3VudC5BY2NvdW50TGljZW5z" + + "ZRIUCgxpc191c2luZ19yaWQYAiABKAgSGwoTaXNfcGxheWluZ19mcm9tX2ln" + + "chgDIAEoCBIZChFjYW5fcmVjZWl2ZV92b2ljZRgEIAEoCBIWCg5jYW5fc2Vu" + + "ZF92b2ljZRgFIAEoCCI9ChhTZXJ2ZXJTdGF0ZUNoYW5nZVJlcXVlc3QSDQoF" + + "c3RhdGUYASACKA0SEgoKZXZlbnRfdGltZRgCIAIoBCJgChRNZW1Nb2R1bGVM" + + "b2FkUmVxdWVzdBIsCgZoYW5kbGUYASACKAsyHC5ibmV0LnByb3RvY29sLkNv" + + "bnRlbnRIYW5kbGUSCwoDa2V5GAIgAigMEg0KBWlucHV0GAMgAigMIiUKFU1l" + + "bU1vZHVsZUxvYWRSZXNwb25zZRIMCgRkYXRhGAEgAigMMvkFChRBdXRoZW50" + + "aWNhdGlvbkNsaWVudBJfCgpNb2R1bGVMb2FkEi8uYm5ldC5wcm90b2NvbC5h" + + "dXRoZW50aWNhdGlvbi5Nb2R1bGVMb2FkUmVxdWVzdBoaLmJuZXQucHJvdG9j" + + "b2wuTk9fUkVTUE9OU0UiBIC1GAESYAoNTW9kdWxlTWVzc2FnZRIyLmJuZXQu" + + "cHJvdG9jb2wuYXV0aGVudGljYXRpb24uTW9kdWxlTWVzc2FnZVJlcXVlc3Qa" + + "FS5ibmV0LnByb3RvY29sLk5vRGF0YSIEgLUYAhJuCg9BY2NvdW50U2V0dGlu" + + "Z3MSOS5ibmV0LnByb3RvY29sLmF1dGhlbnRpY2F0aW9uLkFjY291bnRTZXR0" + + "aW5nc05vdGlmaWNhdGlvbhoaLmJuZXQucHJvdG9jb2wuTk9fUkVTUE9OU0Ui" + + "BIC1GAMSbQoRU2VydmVyU3RhdGVDaGFuZ2USNi5ibmV0LnByb3RvY29sLmF1" + + "dGhlbnRpY2F0aW9uLlNlcnZlclN0YXRlQ2hhbmdlUmVxdWVzdBoaLmJuZXQu" + + "cHJvdG9jb2wuTk9fUkVTUE9OU0UiBIC1GAQSXAoNTG9nb25Db21wbGV0ZRIp" + + "LmJuZXQucHJvdG9jb2wuYXV0aGVudGljYXRpb24uTG9nb25SZXN1bHQaGi5i" + + "bmV0LnByb3RvY29sLk5PX1JFU1BPTlNFIgSAtRgFEn4KDU1lbU1vZHVsZUxv" + + "YWQSMi5ibmV0LnByb3RvY29sLmF1dGhlbnRpY2F0aW9uLk1lbU1vZHVsZUxv" + + "YWRSZXF1ZXN0GjMuYm5ldC5wcm90b2NvbC5hdXRoZW50aWNhdGlvbi5NZW1N" + + "b2R1bGVMb2FkUmVzcG9uc2UiBIC1GAYSYQoLTG9nb25VcGRhdGUSMC5ibmV0" + + "LnByb3RvY29sLmF1dGhlbnRpY2F0aW9uLkxvZ29uVXBkYXRlUmVxdWVzdBoa" + + "LmJuZXQucHJvdG9jb2wuTk9fUkVTUE9OU0UiBIC1GAoy9AIKFEF1dGhlbnRp" + + "Y2F0aW9uU2VydmVyElAKBUxvZ29uEiouYm5ldC5wcm90b2NvbC5hdXRoZW50" + + "aWNhdGlvbi5Mb2dvblJlcXVlc3QaFS5ibmV0LnByb3RvY29sLk5vRGF0YSIE" + + "gLUYARJdCgxNb2R1bGVOb3RpZnkSMC5ibmV0LnByb3RvY29sLmF1dGhlbnRp" + + "Y2F0aW9uLk1vZHVsZU5vdGlmaWNhdGlvbhoVLmJuZXQucHJvdG9jb2wuTm9E" + + "YXRhIgSAtRgCEmAKDU1vZHVsZU1lc3NhZ2USMi5ibmV0LnByb3RvY29sLmF1" + + "dGhlbnRpY2F0aW9uLk1vZHVsZU1lc3NhZ2VSZXF1ZXN0GhUuYm5ldC5wcm90" + + "b2NvbC5Ob0RhdGEiBIC1GAMSSQoRU2VsZWN0R2FtZUFjY291bnQSFy5ibmV0" + + "LnByb3RvY29sLkVudGl0eUlkGhUuYm5ldC5wcm90b2NvbC5Ob0RhdGEiBIC1" + + "GARCA4ABAA=="); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_bnet_protocol_authentication_ModuleLoadRequest__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_authentication_ModuleLoadRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_authentication_ModuleLoadRequest__Descriptor, + new string[] { "ModuleHandle", "Message", }); + internal__static_bnet_protocol_authentication_ModuleNotification__Descriptor = Descriptor.MessageTypes[1]; + internal__static_bnet_protocol_authentication_ModuleNotification__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_authentication_ModuleNotification__Descriptor, + new string[] { "ModuleId", "Result", }); + internal__static_bnet_protocol_authentication_ModuleMessageRequest__Descriptor = Descriptor.MessageTypes[2]; + internal__static_bnet_protocol_authentication_ModuleMessageRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_authentication_ModuleMessageRequest__Descriptor, + new string[] { "ModuleId", "Message", }); + internal__static_bnet_protocol_authentication_LogonRequest__Descriptor = Descriptor.MessageTypes[3]; + internal__static_bnet_protocol_authentication_LogonRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_authentication_LogonRequest__Descriptor, + new string[] { "Program", "Platform", "Locale", "Email", "Version", "ApplicationVersion", "CookieOnly", }); + internal__static_bnet_protocol_authentication_LogonResult__Descriptor = Descriptor.MessageTypes[4]; + internal__static_bnet_protocol_authentication_LogonResult__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_authentication_LogonResult__Descriptor, + new string[] { "ErrorCode", "Account", "GameAccount", }); + internal__static_bnet_protocol_authentication_LogonUpdateRequest__Descriptor = Descriptor.MessageTypes[5]; + internal__static_bnet_protocol_authentication_LogonUpdateRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_authentication_LogonUpdateRequest__Descriptor, + new string[] { "ErrorCode", }); + internal__static_bnet_protocol_authentication_AccountSettingsNotification__Descriptor = Descriptor.MessageTypes[6]; + internal__static_bnet_protocol_authentication_AccountSettingsNotification__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_authentication_AccountSettingsNotification__Descriptor, + new string[] { "Licenses", "IsUsingRid", "IsPlayingFromIgr", "CanReceiveVoice", "CanSendVoice", }); + internal__static_bnet_protocol_authentication_ServerStateChangeRequest__Descriptor = Descriptor.MessageTypes[7]; + internal__static_bnet_protocol_authentication_ServerStateChangeRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_authentication_ServerStateChangeRequest__Descriptor, + new string[] { "State", "EventTime", }); + internal__static_bnet_protocol_authentication_MemModuleLoadRequest__Descriptor = Descriptor.MessageTypes[8]; + internal__static_bnet_protocol_authentication_MemModuleLoadRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_authentication_MemModuleLoadRequest__Descriptor, + new string[] { "Handle", "Key", "Input", }); + internal__static_bnet_protocol_authentication_MemModuleLoadResponse__Descriptor = Descriptor.MessageTypes[9]; + internal__static_bnet_protocol_authentication_MemModuleLoadResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_authentication_MemModuleLoadResponse__Descriptor, + new string[] { "Data", }); + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + RegisterAllExtensions(registry); + global::bnet.protocol.account.AccountTypes.RegisterAllExtensions(registry); + global::bnet.protocol.Rpc.RegisterAllExtensions(registry); + global::bnet.protocol.Proto.ContentHandle.RegisterAllExtensions(registry); + global::bnet.protocol.Entity.RegisterAllExtensions(registry); + return registry; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::bnet.protocol.account.AccountTypes.Descriptor, + global::bnet.protocol.Rpc.Descriptor, + global::bnet.protocol.Proto.ContentHandle.Descriptor, + global::bnet.protocol.Entity.Descriptor, + }, assigner); + } + #endregion + + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ModuleLoadRequest : pb::GeneratedMessage { + private ModuleLoadRequest() { } + private static readonly ModuleLoadRequest defaultInstance = new ModuleLoadRequest().MakeReadOnly(); + private static readonly string[] _moduleLoadRequestFieldNames = new string[] { "message", "module_handle" }; + private static readonly uint[] _moduleLoadRequestFieldTags = new uint[] { 18, 10 }; + public static ModuleLoadRequest DefaultInstance { + get { return defaultInstance; } + } + + public override ModuleLoadRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ModuleLoadRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.authentication.AuthenticationService.internal__static_bnet_protocol_authentication_ModuleLoadRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.authentication.AuthenticationService.internal__static_bnet_protocol_authentication_ModuleLoadRequest__FieldAccessorTable; } + } + + public const int ModuleHandleFieldNumber = 1; + private bool hasModuleHandle; + private global::bnet.protocol.ContentHandle moduleHandle_; + public bool HasModuleHandle { + get { return hasModuleHandle; } + } + public global::bnet.protocol.ContentHandle ModuleHandle { + get { return moduleHandle_ ?? global::bnet.protocol.ContentHandle.DefaultInstance; } + } + + public const int MessageFieldNumber = 2; + private bool hasMessage; + private pb::ByteString message_ = pb::ByteString.Empty; + public bool HasMessage { + get { return hasMessage; } + } + public pb::ByteString Message { + get { return message_; } + } + + public override bool IsInitialized { + get { + if (!hasModuleHandle) return false; + if (!ModuleHandle.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _moduleLoadRequestFieldNames; + if (hasModuleHandle) { + output.WriteMessage(1, field_names[1], ModuleHandle); + } + if (hasMessage) { + output.WriteBytes(2, field_names[0], Message); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasModuleHandle) { + size += pb::CodedOutputStream.ComputeMessageSize(1, ModuleHandle); + } + if (hasMessage) { + size += pb::CodedOutputStream.ComputeBytesSize(2, Message); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ModuleLoadRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ModuleLoadRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ModuleLoadRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ModuleLoadRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ModuleLoadRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ModuleLoadRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ModuleLoadRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ModuleLoadRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ModuleLoadRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ModuleLoadRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ModuleLoadRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ModuleLoadRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ModuleLoadRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ModuleLoadRequest result; + + private ModuleLoadRequest PrepareBuilder() { + if (resultIsReadOnly) { + ModuleLoadRequest original = result; + result = new ModuleLoadRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ModuleLoadRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.authentication.ModuleLoadRequest.Descriptor; } + } + + public override ModuleLoadRequest DefaultInstanceForType { + get { return global::bnet.protocol.authentication.ModuleLoadRequest.DefaultInstance; } + } + + public override ModuleLoadRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ModuleLoadRequest) { + return MergeFrom((ModuleLoadRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ModuleLoadRequest other) { + if (other == global::bnet.protocol.authentication.ModuleLoadRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasModuleHandle) { + MergeModuleHandle(other.ModuleHandle); + } + if (other.HasMessage) { + Message = other.Message; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_moduleLoadRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _moduleLoadRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.ContentHandle.Builder subBuilder = global::bnet.protocol.ContentHandle.CreateBuilder(); + if (result.hasModuleHandle) { + subBuilder.MergeFrom(ModuleHandle); + } + input.ReadMessage(subBuilder, extensionRegistry); + ModuleHandle = subBuilder.BuildPartial(); + break; + } + case 18: { + result.hasMessage = input.ReadBytes(ref result.message_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasModuleHandle { + get { return result.hasModuleHandle; } + } + public global::bnet.protocol.ContentHandle ModuleHandle { + get { return result.ModuleHandle; } + set { SetModuleHandle(value); } + } + public Builder SetModuleHandle(global::bnet.protocol.ContentHandle value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasModuleHandle = true; + result.moduleHandle_ = value; + return this; + } + public Builder SetModuleHandle(global::bnet.protocol.ContentHandle.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasModuleHandle = true; + result.moduleHandle_ = builderForValue.Build(); + return this; + } + public Builder MergeModuleHandle(global::bnet.protocol.ContentHandle value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasModuleHandle && + result.moduleHandle_ != global::bnet.protocol.ContentHandle.DefaultInstance) { + result.moduleHandle_ = global::bnet.protocol.ContentHandle.CreateBuilder(result.moduleHandle_).MergeFrom(value).BuildPartial(); + } else { + result.moduleHandle_ = value; + } + result.hasModuleHandle = true; + return this; + } + public Builder ClearModuleHandle() { + PrepareBuilder(); + result.hasModuleHandle = false; + result.moduleHandle_ = null; + return this; + } + + public bool HasMessage { + get { return result.hasMessage; } + } + public pb::ByteString Message { + get { return result.Message; } + set { SetMessage(value); } + } + public Builder SetMessage(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasMessage = true; + result.message_ = value; + return this; + } + public Builder ClearMessage() { + PrepareBuilder(); + result.hasMessage = false; + result.message_ = pb::ByteString.Empty; + return this; + } + } + static ModuleLoadRequest() { + object.ReferenceEquals(global::bnet.protocol.authentication.AuthenticationService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ModuleNotification : pb::GeneratedMessage { + private ModuleNotification() { } + private static readonly ModuleNotification defaultInstance = new ModuleNotification().MakeReadOnly(); + private static readonly string[] _moduleNotificationFieldNames = new string[] { "module_id", "result" }; + private static readonly uint[] _moduleNotificationFieldTags = new uint[] { 16, 24 }; + public static ModuleNotification DefaultInstance { + get { return defaultInstance; } + } + + public override ModuleNotification DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ModuleNotification ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.authentication.AuthenticationService.internal__static_bnet_protocol_authentication_ModuleNotification__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.authentication.AuthenticationService.internal__static_bnet_protocol_authentication_ModuleNotification__FieldAccessorTable; } + } + + public const int ModuleIdFieldNumber = 2; + private bool hasModuleId; + private int moduleId_; + public bool HasModuleId { + get { return hasModuleId; } + } + public int ModuleId { + get { return moduleId_; } + } + + public const int ResultFieldNumber = 3; + private bool hasResult; + private uint result_; + public bool HasResult { + get { return hasResult; } + } + public uint Result { + get { return result_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _moduleNotificationFieldNames; + if (hasModuleId) { + output.WriteInt32(2, field_names[0], ModuleId); + } + if (hasResult) { + output.WriteUInt32(3, field_names[1], Result); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasModuleId) { + size += pb::CodedOutputStream.ComputeInt32Size(2, ModuleId); + } + if (hasResult) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, Result); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ModuleNotification ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ModuleNotification ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ModuleNotification ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ModuleNotification ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ModuleNotification ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ModuleNotification ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ModuleNotification ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ModuleNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ModuleNotification ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ModuleNotification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ModuleNotification MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ModuleNotification prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ModuleNotification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ModuleNotification result; + + private ModuleNotification PrepareBuilder() { + if (resultIsReadOnly) { + ModuleNotification original = result; + result = new ModuleNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ModuleNotification MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.authentication.ModuleNotification.Descriptor; } + } + + public override ModuleNotification DefaultInstanceForType { + get { return global::bnet.protocol.authentication.ModuleNotification.DefaultInstance; } + } + + public override ModuleNotification BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ModuleNotification) { + return MergeFrom((ModuleNotification) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ModuleNotification other) { + if (other == global::bnet.protocol.authentication.ModuleNotification.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasModuleId) { + ModuleId = other.ModuleId; + } + if (other.HasResult) { + Result = other.Result; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_moduleNotificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _moduleNotificationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 16: { + result.hasModuleId = input.ReadInt32(ref result.moduleId_); + break; + } + case 24: { + result.hasResult = input.ReadUInt32(ref result.result_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasModuleId { + get { return result.hasModuleId; } + } + public int ModuleId { + get { return result.ModuleId; } + set { SetModuleId(value); } + } + public Builder SetModuleId(int value) { + PrepareBuilder(); + result.hasModuleId = true; + result.moduleId_ = value; + return this; + } + public Builder ClearModuleId() { + PrepareBuilder(); + result.hasModuleId = false; + result.moduleId_ = 0; + return this; + } + + public bool HasResult { + get { return result.hasResult; } + } + public uint Result { + get { return result.Result; } + set { SetResult(value); } + } + public Builder SetResult(uint value) { + PrepareBuilder(); + result.hasResult = true; + result.result_ = value; + return this; + } + public Builder ClearResult() { + PrepareBuilder(); + result.hasResult = false; + result.result_ = 0; + return this; + } + } + static ModuleNotification() { + object.ReferenceEquals(global::bnet.protocol.authentication.AuthenticationService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ModuleMessageRequest : pb::GeneratedMessage { + private ModuleMessageRequest() { } + private static readonly ModuleMessageRequest defaultInstance = new ModuleMessageRequest().MakeReadOnly(); + private static readonly string[] _moduleMessageRequestFieldNames = new string[] { "message", "module_id" }; + private static readonly uint[] _moduleMessageRequestFieldTags = new uint[] { 18, 8 }; + public static ModuleMessageRequest DefaultInstance { + get { return defaultInstance; } + } + + public override ModuleMessageRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ModuleMessageRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.authentication.AuthenticationService.internal__static_bnet_protocol_authentication_ModuleMessageRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.authentication.AuthenticationService.internal__static_bnet_protocol_authentication_ModuleMessageRequest__FieldAccessorTable; } + } + + public const int ModuleIdFieldNumber = 1; + private bool hasModuleId; + private int moduleId_; + public bool HasModuleId { + get { return hasModuleId; } + } + public int ModuleId { + get { return moduleId_; } + } + + public const int MessageFieldNumber = 2; + private bool hasMessage; + private pb::ByteString message_ = pb::ByteString.Empty; + public bool HasMessage { + get { return hasMessage; } + } + public pb::ByteString Message { + get { return message_; } + } + + public override bool IsInitialized { + get { + if (!hasModuleId) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _moduleMessageRequestFieldNames; + if (hasModuleId) { + output.WriteInt32(1, field_names[1], ModuleId); + } + if (hasMessage) { + output.WriteBytes(2, field_names[0], Message); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasModuleId) { + size += pb::CodedOutputStream.ComputeInt32Size(1, ModuleId); + } + if (hasMessage) { + size += pb::CodedOutputStream.ComputeBytesSize(2, Message); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ModuleMessageRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ModuleMessageRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ModuleMessageRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ModuleMessageRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ModuleMessageRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ModuleMessageRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ModuleMessageRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ModuleMessageRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ModuleMessageRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ModuleMessageRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ModuleMessageRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ModuleMessageRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ModuleMessageRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ModuleMessageRequest result; + + private ModuleMessageRequest PrepareBuilder() { + if (resultIsReadOnly) { + ModuleMessageRequest original = result; + result = new ModuleMessageRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ModuleMessageRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.authentication.ModuleMessageRequest.Descriptor; } + } + + public override ModuleMessageRequest DefaultInstanceForType { + get { return global::bnet.protocol.authentication.ModuleMessageRequest.DefaultInstance; } + } + + public override ModuleMessageRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ModuleMessageRequest) { + return MergeFrom((ModuleMessageRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ModuleMessageRequest other) { + if (other == global::bnet.protocol.authentication.ModuleMessageRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasModuleId) { + ModuleId = other.ModuleId; + } + if (other.HasMessage) { + Message = other.Message; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_moduleMessageRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _moduleMessageRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasModuleId = input.ReadInt32(ref result.moduleId_); + break; + } + case 18: { + result.hasMessage = input.ReadBytes(ref result.message_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasModuleId { + get { return result.hasModuleId; } + } + public int ModuleId { + get { return result.ModuleId; } + set { SetModuleId(value); } + } + public Builder SetModuleId(int value) { + PrepareBuilder(); + result.hasModuleId = true; + result.moduleId_ = value; + return this; + } + public Builder ClearModuleId() { + PrepareBuilder(); + result.hasModuleId = false; + result.moduleId_ = 0; + return this; + } + + public bool HasMessage { + get { return result.hasMessage; } + } + public pb::ByteString Message { + get { return result.Message; } + set { SetMessage(value); } + } + public Builder SetMessage(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasMessage = true; + result.message_ = value; + return this; + } + public Builder ClearMessage() { + PrepareBuilder(); + result.hasMessage = false; + result.message_ = pb::ByteString.Empty; + return this; + } + } + static ModuleMessageRequest() { + object.ReferenceEquals(global::bnet.protocol.authentication.AuthenticationService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class LogonRequest : pb::GeneratedMessage { + private LogonRequest() { } + private static readonly LogonRequest defaultInstance = new LogonRequest().MakeReadOnly(); + private static readonly string[] _logonRequestFieldNames = new string[] { "application_version", "cookie_only", "email", "locale", "platform", "program", "version" }; + private static readonly uint[] _logonRequestFieldTags = new uint[] { 48, 56, 34, 26, 18, 10, 42 }; + public static LogonRequest DefaultInstance { + get { return defaultInstance; } + } + + public override LogonRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override LogonRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.authentication.AuthenticationService.internal__static_bnet_protocol_authentication_LogonRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.authentication.AuthenticationService.internal__static_bnet_protocol_authentication_LogonRequest__FieldAccessorTable; } + } + + public const int ProgramFieldNumber = 1; + private bool hasProgram; + private string program_ = ""; + public bool HasProgram { + get { return hasProgram; } + } + public string Program { + get { return program_; } + } + + public const int PlatformFieldNumber = 2; + private bool hasPlatform; + private string platform_ = ""; + public bool HasPlatform { + get { return hasPlatform; } + } + public string Platform { + get { return platform_; } + } + + public const int LocaleFieldNumber = 3; + private bool hasLocale; + private string locale_ = ""; + public bool HasLocale { + get { return hasLocale; } + } + public string Locale { + get { return locale_; } + } + + public const int EmailFieldNumber = 4; + private bool hasEmail; + private string email_ = ""; + public bool HasEmail { + get { return hasEmail; } + } + public string Email { + get { return email_; } + } + + public const int VersionFieldNumber = 5; + private bool hasVersion; + private string version_ = ""; + public bool HasVersion { + get { return hasVersion; } + } + public string Version { + get { return version_; } + } + + public const int ApplicationVersionFieldNumber = 6; + private bool hasApplicationVersion; + private int applicationVersion_; + public bool HasApplicationVersion { + get { return hasApplicationVersion; } + } + public int ApplicationVersion { + get { return applicationVersion_; } + } + + public const int CookieOnlyFieldNumber = 7; + private bool hasCookieOnly; + private bool cookieOnly_; + public bool HasCookieOnly { + get { return hasCookieOnly; } + } + public bool CookieOnly { + get { return cookieOnly_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _logonRequestFieldNames; + if (hasProgram) { + output.WriteString(1, field_names[5], Program); + } + if (hasPlatform) { + output.WriteString(2, field_names[4], Platform); + } + if (hasLocale) { + output.WriteString(3, field_names[3], Locale); + } + if (hasEmail) { + output.WriteString(4, field_names[2], Email); + } + if (hasVersion) { + output.WriteString(5, field_names[6], Version); + } + if (hasApplicationVersion) { + output.WriteInt32(6, field_names[0], ApplicationVersion); + } + if (hasCookieOnly) { + output.WriteBool(7, field_names[1], CookieOnly); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasProgram) { + size += pb::CodedOutputStream.ComputeStringSize(1, Program); + } + if (hasPlatform) { + size += pb::CodedOutputStream.ComputeStringSize(2, Platform); + } + if (hasLocale) { + size += pb::CodedOutputStream.ComputeStringSize(3, Locale); + } + if (hasEmail) { + size += pb::CodedOutputStream.ComputeStringSize(4, Email); + } + if (hasVersion) { + size += pb::CodedOutputStream.ComputeStringSize(5, Version); + } + if (hasApplicationVersion) { + size += pb::CodedOutputStream.ComputeInt32Size(6, ApplicationVersion); + } + if (hasCookieOnly) { + size += pb::CodedOutputStream.ComputeBoolSize(7, CookieOnly); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static LogonRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static LogonRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static LogonRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static LogonRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static LogonRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static LogonRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static LogonRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static LogonRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static LogonRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static LogonRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private LogonRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(LogonRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(LogonRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private LogonRequest result; + + private LogonRequest PrepareBuilder() { + if (resultIsReadOnly) { + LogonRequest original = result; + result = new LogonRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override LogonRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.authentication.LogonRequest.Descriptor; } + } + + public override LogonRequest DefaultInstanceForType { + get { return global::bnet.protocol.authentication.LogonRequest.DefaultInstance; } + } + + public override LogonRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is LogonRequest) { + return MergeFrom((LogonRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(LogonRequest other) { + if (other == global::bnet.protocol.authentication.LogonRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasProgram) { + Program = other.Program; + } + if (other.HasPlatform) { + Platform = other.Platform; + } + if (other.HasLocale) { + Locale = other.Locale; + } + if (other.HasEmail) { + Email = other.Email; + } + if (other.HasVersion) { + Version = other.Version; + } + if (other.HasApplicationVersion) { + ApplicationVersion = other.ApplicationVersion; + } + if (other.HasCookieOnly) { + CookieOnly = other.CookieOnly; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_logonRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _logonRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasProgram = input.ReadString(ref result.program_); + break; + } + case 18: { + result.hasPlatform = input.ReadString(ref result.platform_); + break; + } + case 26: { + result.hasLocale = input.ReadString(ref result.locale_); + break; + } + case 34: { + result.hasEmail = input.ReadString(ref result.email_); + break; + } + case 42: { + result.hasVersion = input.ReadString(ref result.version_); + break; + } + case 48: { + result.hasApplicationVersion = input.ReadInt32(ref result.applicationVersion_); + break; + } + case 56: { + result.hasCookieOnly = input.ReadBool(ref result.cookieOnly_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasProgram { + get { return result.hasProgram; } + } + public string Program { + get { return result.Program; } + set { SetProgram(value); } + } + public Builder SetProgram(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasProgram = true; + result.program_ = value; + return this; + } + public Builder ClearProgram() { + PrepareBuilder(); + result.hasProgram = false; + result.program_ = ""; + return this; + } + + public bool HasPlatform { + get { return result.hasPlatform; } + } + public string Platform { + get { return result.Platform; } + set { SetPlatform(value); } + } + public Builder SetPlatform(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPlatform = true; + result.platform_ = value; + return this; + } + public Builder ClearPlatform() { + PrepareBuilder(); + result.hasPlatform = false; + result.platform_ = ""; + return this; + } + + public bool HasLocale { + get { return result.hasLocale; } + } + public string Locale { + get { return result.Locale; } + set { SetLocale(value); } + } + public Builder SetLocale(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasLocale = true; + result.locale_ = value; + return this; + } + public Builder ClearLocale() { + PrepareBuilder(); + result.hasLocale = false; + result.locale_ = ""; + return this; + } + + public bool HasEmail { + get { return result.hasEmail; } + } + public string Email { + get { return result.Email; } + set { SetEmail(value); } + } + public Builder SetEmail(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasEmail = true; + result.email_ = value; + return this; + } + public Builder ClearEmail() { + PrepareBuilder(); + result.hasEmail = false; + result.email_ = ""; + return this; + } + + public bool HasVersion { + get { return result.hasVersion; } + } + public string Version { + get { return result.Version; } + set { SetVersion(value); } + } + public Builder SetVersion(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasVersion = true; + result.version_ = value; + return this; + } + public Builder ClearVersion() { + PrepareBuilder(); + result.hasVersion = false; + result.version_ = ""; + return this; + } + + public bool HasApplicationVersion { + get { return result.hasApplicationVersion; } + } + public int ApplicationVersion { + get { return result.ApplicationVersion; } + set { SetApplicationVersion(value); } + } + public Builder SetApplicationVersion(int value) { + PrepareBuilder(); + result.hasApplicationVersion = true; + result.applicationVersion_ = value; + return this; + } + public Builder ClearApplicationVersion() { + PrepareBuilder(); + result.hasApplicationVersion = false; + result.applicationVersion_ = 0; + return this; + } + + public bool HasCookieOnly { + get { return result.hasCookieOnly; } + } + public bool CookieOnly { + get { return result.CookieOnly; } + set { SetCookieOnly(value); } + } + public Builder SetCookieOnly(bool value) { + PrepareBuilder(); + result.hasCookieOnly = true; + result.cookieOnly_ = value; + return this; + } + public Builder ClearCookieOnly() { + PrepareBuilder(); + result.hasCookieOnly = false; + result.cookieOnly_ = false; + return this; + } + } + static LogonRequest() { + object.ReferenceEquals(global::bnet.protocol.authentication.AuthenticationService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class LogonResult : pb::GeneratedMessage { + private LogonResult() { } + private static readonly LogonResult defaultInstance = new LogonResult().MakeReadOnly(); + private static readonly string[] _logonResultFieldNames = new string[] { "account", "error_code", "game_account" }; + private static readonly uint[] _logonResultFieldTags = new uint[] { 18, 8, 26 }; + public static LogonResult DefaultInstance { + get { return defaultInstance; } + } + + public override LogonResult DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override LogonResult ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.authentication.AuthenticationService.internal__static_bnet_protocol_authentication_LogonResult__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.authentication.AuthenticationService.internal__static_bnet_protocol_authentication_LogonResult__FieldAccessorTable; } + } + + public const int ErrorCodeFieldNumber = 1; + private bool hasErrorCode; + private uint errorCode_; + public bool HasErrorCode { + get { return hasErrorCode; } + } + public uint ErrorCode { + get { return errorCode_; } + } + + public const int AccountFieldNumber = 2; + private bool hasAccount; + private global::bnet.protocol.EntityId account_; + public bool HasAccount { + get { return hasAccount; } + } + public global::bnet.protocol.EntityId Account { + get { return account_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int GameAccountFieldNumber = 3; + private pbc::PopsicleList gameAccount_ = new pbc::PopsicleList(); + public scg::IList GameAccountList { + get { return gameAccount_; } + } + public int GameAccountCount { + get { return gameAccount_.Count; } + } + public global::bnet.protocol.EntityId GetGameAccount(int index) { + return gameAccount_[index]; + } + + public override bool IsInitialized { + get { + if (!hasErrorCode) return false; + if (HasAccount) { + if (!Account.IsInitialized) return false; + } + foreach (global::bnet.protocol.EntityId element in GameAccountList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _logonResultFieldNames; + if (hasErrorCode) { + output.WriteUInt32(1, field_names[1], ErrorCode); + } + if (hasAccount) { + output.WriteMessage(2, field_names[0], Account); + } + if (gameAccount_.Count > 0) { + output.WriteMessageArray(3, field_names[2], gameAccount_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasErrorCode) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, ErrorCode); + } + if (hasAccount) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Account); + } + foreach (global::bnet.protocol.EntityId element in GameAccountList) { + size += pb::CodedOutputStream.ComputeMessageSize(3, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static LogonResult ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static LogonResult ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static LogonResult ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static LogonResult ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static LogonResult ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static LogonResult ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static LogonResult ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static LogonResult ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static LogonResult ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static LogonResult ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private LogonResult MakeReadOnly() { + gameAccount_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(LogonResult prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(LogonResult cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private LogonResult result; + + private LogonResult PrepareBuilder() { + if (resultIsReadOnly) { + LogonResult original = result; + result = new LogonResult(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override LogonResult MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.authentication.LogonResult.Descriptor; } + } + + public override LogonResult DefaultInstanceForType { + get { return global::bnet.protocol.authentication.LogonResult.DefaultInstance; } + } + + public override LogonResult BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is LogonResult) { + return MergeFrom((LogonResult) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(LogonResult other) { + if (other == global::bnet.protocol.authentication.LogonResult.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasErrorCode) { + ErrorCode = other.ErrorCode; + } + if (other.HasAccount) { + MergeAccount(other.Account); + } + if (other.gameAccount_.Count != 0) { + result.gameAccount_.Add(other.gameAccount_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_logonResultFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _logonResultFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasErrorCode = input.ReadUInt32(ref result.errorCode_); + break; + } + case 18: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasAccount) { + subBuilder.MergeFrom(Account); + } + input.ReadMessage(subBuilder, extensionRegistry); + Account = subBuilder.BuildPartial(); + break; + } + case 26: { + input.ReadMessageArray(tag, field_name, result.gameAccount_, global::bnet.protocol.EntityId.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasErrorCode { + get { return result.hasErrorCode; } + } + public uint ErrorCode { + get { return result.ErrorCode; } + set { SetErrorCode(value); } + } + public Builder SetErrorCode(uint value) { + PrepareBuilder(); + result.hasErrorCode = true; + result.errorCode_ = value; + return this; + } + public Builder ClearErrorCode() { + PrepareBuilder(); + result.hasErrorCode = false; + result.errorCode_ = 0; + return this; + } + + public bool HasAccount { + get { return result.hasAccount; } + } + public global::bnet.protocol.EntityId Account { + get { return result.Account; } + set { SetAccount(value); } + } + public Builder SetAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccount = true; + result.account_ = value; + return this; + } + public Builder SetAccount(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccount = true; + result.account_ = builderForValue.Build(); + return this; + } + public Builder MergeAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccount && + result.account_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.account_ = global::bnet.protocol.EntityId.CreateBuilder(result.account_).MergeFrom(value).BuildPartial(); + } else { + result.account_ = value; + } + result.hasAccount = true; + return this; + } + public Builder ClearAccount() { + PrepareBuilder(); + result.hasAccount = false; + result.account_ = null; + return this; + } + + public pbc::IPopsicleList GameAccountList { + get { return PrepareBuilder().gameAccount_; } + } + public int GameAccountCount { + get { return result.GameAccountCount; } + } + public global::bnet.protocol.EntityId GetGameAccount(int index) { + return result.GetGameAccount(index); + } + public Builder SetGameAccount(int index, global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.gameAccount_[index] = value; + return this; + } + public Builder SetGameAccount(int index, global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.gameAccount_[index] = builderForValue.Build(); + return this; + } + public Builder AddGameAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.gameAccount_.Add(value); + return this; + } + public Builder AddGameAccount(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.gameAccount_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeGameAccount(scg::IEnumerable values) { + PrepareBuilder(); + result.gameAccount_.Add(values); + return this; + } + public Builder ClearGameAccount() { + PrepareBuilder(); + result.gameAccount_.Clear(); + return this; + } + } + static LogonResult() { + object.ReferenceEquals(global::bnet.protocol.authentication.AuthenticationService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class LogonUpdateRequest : pb::GeneratedMessage { + private LogonUpdateRequest() { } + private static readonly LogonUpdateRequest defaultInstance = new LogonUpdateRequest().MakeReadOnly(); + private static readonly string[] _logonUpdateRequestFieldNames = new string[] { "error_code" }; + private static readonly uint[] _logonUpdateRequestFieldTags = new uint[] { 8 }; + public static LogonUpdateRequest DefaultInstance { + get { return defaultInstance; } + } + + public override LogonUpdateRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override LogonUpdateRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.authentication.AuthenticationService.internal__static_bnet_protocol_authentication_LogonUpdateRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.authentication.AuthenticationService.internal__static_bnet_protocol_authentication_LogonUpdateRequest__FieldAccessorTable; } + } + + public const int ErrorCodeFieldNumber = 1; + private bool hasErrorCode; + private uint errorCode_; + public bool HasErrorCode { + get { return hasErrorCode; } + } + public uint ErrorCode { + get { return errorCode_; } + } + + public override bool IsInitialized { + get { + if (!hasErrorCode) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _logonUpdateRequestFieldNames; + if (hasErrorCode) { + output.WriteUInt32(1, field_names[0], ErrorCode); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasErrorCode) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, ErrorCode); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static LogonUpdateRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static LogonUpdateRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static LogonUpdateRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static LogonUpdateRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static LogonUpdateRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static LogonUpdateRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static LogonUpdateRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static LogonUpdateRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static LogonUpdateRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static LogonUpdateRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private LogonUpdateRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(LogonUpdateRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(LogonUpdateRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private LogonUpdateRequest result; + + private LogonUpdateRequest PrepareBuilder() { + if (resultIsReadOnly) { + LogonUpdateRequest original = result; + result = new LogonUpdateRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override LogonUpdateRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.authentication.LogonUpdateRequest.Descriptor; } + } + + public override LogonUpdateRequest DefaultInstanceForType { + get { return global::bnet.protocol.authentication.LogonUpdateRequest.DefaultInstance; } + } + + public override LogonUpdateRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is LogonUpdateRequest) { + return MergeFrom((LogonUpdateRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(LogonUpdateRequest other) { + if (other == global::bnet.protocol.authentication.LogonUpdateRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasErrorCode) { + ErrorCode = other.ErrorCode; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_logonUpdateRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _logonUpdateRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasErrorCode = input.ReadUInt32(ref result.errorCode_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasErrorCode { + get { return result.hasErrorCode; } + } + public uint ErrorCode { + get { return result.ErrorCode; } + set { SetErrorCode(value); } + } + public Builder SetErrorCode(uint value) { + PrepareBuilder(); + result.hasErrorCode = true; + result.errorCode_ = value; + return this; + } + public Builder ClearErrorCode() { + PrepareBuilder(); + result.hasErrorCode = false; + result.errorCode_ = 0; + return this; + } + } + static LogonUpdateRequest() { + object.ReferenceEquals(global::bnet.protocol.authentication.AuthenticationService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class AccountSettingsNotification : pb::GeneratedMessage { + private AccountSettingsNotification() { } + private static readonly AccountSettingsNotification defaultInstance = new AccountSettingsNotification().MakeReadOnly(); + private static readonly string[] _accountSettingsNotificationFieldNames = new string[] { "can_receive_voice", "can_send_voice", "is_playing_from_igr", "is_using_rid", "licenses" }; + private static readonly uint[] _accountSettingsNotificationFieldTags = new uint[] { 32, 40, 24, 16, 10 }; + public static AccountSettingsNotification DefaultInstance { + get { return defaultInstance; } + } + + public override AccountSettingsNotification DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override AccountSettingsNotification ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.authentication.AuthenticationService.internal__static_bnet_protocol_authentication_AccountSettingsNotification__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.authentication.AuthenticationService.internal__static_bnet_protocol_authentication_AccountSettingsNotification__FieldAccessorTable; } + } + + public const int LicensesFieldNumber = 1; + private pbc::PopsicleList licenses_ = new pbc::PopsicleList(); + public scg::IList LicensesList { + get { return licenses_; } + } + public int LicensesCount { + get { return licenses_.Count; } + } + public global::bnet.protocol.account.AccountLicense GetLicenses(int index) { + return licenses_[index]; + } + + public const int IsUsingRidFieldNumber = 2; + private bool hasIsUsingRid; + private bool isUsingRid_; + public bool HasIsUsingRid { + get { return hasIsUsingRid; } + } + public bool IsUsingRid { + get { return isUsingRid_; } + } + + public const int IsPlayingFromIgrFieldNumber = 3; + private bool hasIsPlayingFromIgr; + private bool isPlayingFromIgr_; + public bool HasIsPlayingFromIgr { + get { return hasIsPlayingFromIgr; } + } + public bool IsPlayingFromIgr { + get { return isPlayingFromIgr_; } + } + + public const int CanReceiveVoiceFieldNumber = 4; + private bool hasCanReceiveVoice; + private bool canReceiveVoice_; + public bool HasCanReceiveVoice { + get { return hasCanReceiveVoice; } + } + public bool CanReceiveVoice { + get { return canReceiveVoice_; } + } + + public const int CanSendVoiceFieldNumber = 5; + private bool hasCanSendVoice; + private bool canSendVoice_; + public bool HasCanSendVoice { + get { return hasCanSendVoice; } + } + public bool CanSendVoice { + get { return canSendVoice_; } + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.account.AccountLicense element in LicensesList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _accountSettingsNotificationFieldNames; + if (licenses_.Count > 0) { + output.WriteMessageArray(1, field_names[4], licenses_); + } + if (hasIsUsingRid) { + output.WriteBool(2, field_names[3], IsUsingRid); + } + if (hasIsPlayingFromIgr) { + output.WriteBool(3, field_names[2], IsPlayingFromIgr); + } + if (hasCanReceiveVoice) { + output.WriteBool(4, field_names[0], CanReceiveVoice); + } + if (hasCanSendVoice) { + output.WriteBool(5, field_names[1], CanSendVoice); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.account.AccountLicense element in LicensesList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + if (hasIsUsingRid) { + size += pb::CodedOutputStream.ComputeBoolSize(2, IsUsingRid); + } + if (hasIsPlayingFromIgr) { + size += pb::CodedOutputStream.ComputeBoolSize(3, IsPlayingFromIgr); + } + if (hasCanReceiveVoice) { + size += pb::CodedOutputStream.ComputeBoolSize(4, CanReceiveVoice); + } + if (hasCanSendVoice) { + size += pb::CodedOutputStream.ComputeBoolSize(5, CanSendVoice); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static AccountSettingsNotification ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AccountSettingsNotification ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AccountSettingsNotification ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AccountSettingsNotification ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AccountSettingsNotification ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AccountSettingsNotification ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static AccountSettingsNotification ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static AccountSettingsNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static AccountSettingsNotification ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AccountSettingsNotification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private AccountSettingsNotification MakeReadOnly() { + licenses_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(AccountSettingsNotification prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(AccountSettingsNotification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private AccountSettingsNotification result; + + private AccountSettingsNotification PrepareBuilder() { + if (resultIsReadOnly) { + AccountSettingsNotification original = result; + result = new AccountSettingsNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override AccountSettingsNotification MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.authentication.AccountSettingsNotification.Descriptor; } + } + + public override AccountSettingsNotification DefaultInstanceForType { + get { return global::bnet.protocol.authentication.AccountSettingsNotification.DefaultInstance; } + } + + public override AccountSettingsNotification BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is AccountSettingsNotification) { + return MergeFrom((AccountSettingsNotification) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(AccountSettingsNotification other) { + if (other == global::bnet.protocol.authentication.AccountSettingsNotification.DefaultInstance) return this; + PrepareBuilder(); + if (other.licenses_.Count != 0) { + result.licenses_.Add(other.licenses_); + } + if (other.HasIsUsingRid) { + IsUsingRid = other.IsUsingRid; + } + if (other.HasIsPlayingFromIgr) { + IsPlayingFromIgr = other.IsPlayingFromIgr; + } + if (other.HasCanReceiveVoice) { + CanReceiveVoice = other.CanReceiveVoice; + } + if (other.HasCanSendVoice) { + CanSendVoice = other.CanSendVoice; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_accountSettingsNotificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _accountSettingsNotificationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.licenses_, global::bnet.protocol.account.AccountLicense.DefaultInstance, extensionRegistry); + break; + } + case 16: { + result.hasIsUsingRid = input.ReadBool(ref result.isUsingRid_); + break; + } + case 24: { + result.hasIsPlayingFromIgr = input.ReadBool(ref result.isPlayingFromIgr_); + break; + } + case 32: { + result.hasCanReceiveVoice = input.ReadBool(ref result.canReceiveVoice_); + break; + } + case 40: { + result.hasCanSendVoice = input.ReadBool(ref result.canSendVoice_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList LicensesList { + get { return PrepareBuilder().licenses_; } + } + public int LicensesCount { + get { return result.LicensesCount; } + } + public global::bnet.protocol.account.AccountLicense GetLicenses(int index) { + return result.GetLicenses(index); + } + public Builder SetLicenses(int index, global::bnet.protocol.account.AccountLicense value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.licenses_[index] = value; + return this; + } + public Builder SetLicenses(int index, global::bnet.protocol.account.AccountLicense.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.licenses_[index] = builderForValue.Build(); + return this; + } + public Builder AddLicenses(global::bnet.protocol.account.AccountLicense value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.licenses_.Add(value); + return this; + } + public Builder AddLicenses(global::bnet.protocol.account.AccountLicense.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.licenses_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeLicenses(scg::IEnumerable values) { + PrepareBuilder(); + result.licenses_.Add(values); + return this; + } + public Builder ClearLicenses() { + PrepareBuilder(); + result.licenses_.Clear(); + return this; + } + + public bool HasIsUsingRid { + get { return result.hasIsUsingRid; } + } + public bool IsUsingRid { + get { return result.IsUsingRid; } + set { SetIsUsingRid(value); } + } + public Builder SetIsUsingRid(bool value) { + PrepareBuilder(); + result.hasIsUsingRid = true; + result.isUsingRid_ = value; + return this; + } + public Builder ClearIsUsingRid() { + PrepareBuilder(); + result.hasIsUsingRid = false; + result.isUsingRid_ = false; + return this; + } + + public bool HasIsPlayingFromIgr { + get { return result.hasIsPlayingFromIgr; } + } + public bool IsPlayingFromIgr { + get { return result.IsPlayingFromIgr; } + set { SetIsPlayingFromIgr(value); } + } + public Builder SetIsPlayingFromIgr(bool value) { + PrepareBuilder(); + result.hasIsPlayingFromIgr = true; + result.isPlayingFromIgr_ = value; + return this; + } + public Builder ClearIsPlayingFromIgr() { + PrepareBuilder(); + result.hasIsPlayingFromIgr = false; + result.isPlayingFromIgr_ = false; + return this; + } + + public bool HasCanReceiveVoice { + get { return result.hasCanReceiveVoice; } + } + public bool CanReceiveVoice { + get { return result.CanReceiveVoice; } + set { SetCanReceiveVoice(value); } + } + public Builder SetCanReceiveVoice(bool value) { + PrepareBuilder(); + result.hasCanReceiveVoice = true; + result.canReceiveVoice_ = value; + return this; + } + public Builder ClearCanReceiveVoice() { + PrepareBuilder(); + result.hasCanReceiveVoice = false; + result.canReceiveVoice_ = false; + return this; + } + + public bool HasCanSendVoice { + get { return result.hasCanSendVoice; } + } + public bool CanSendVoice { + get { return result.CanSendVoice; } + set { SetCanSendVoice(value); } + } + public Builder SetCanSendVoice(bool value) { + PrepareBuilder(); + result.hasCanSendVoice = true; + result.canSendVoice_ = value; + return this; + } + public Builder ClearCanSendVoice() { + PrepareBuilder(); + result.hasCanSendVoice = false; + result.canSendVoice_ = false; + return this; + } + } + static AccountSettingsNotification() { + object.ReferenceEquals(global::bnet.protocol.authentication.AuthenticationService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ServerStateChangeRequest : pb::GeneratedMessage { + private ServerStateChangeRequest() { } + private static readonly ServerStateChangeRequest defaultInstance = new ServerStateChangeRequest().MakeReadOnly(); + private static readonly string[] _serverStateChangeRequestFieldNames = new string[] { "event_time", "state" }; + private static readonly uint[] _serverStateChangeRequestFieldTags = new uint[] { 16, 8 }; + public static ServerStateChangeRequest DefaultInstance { + get { return defaultInstance; } + } + + public override ServerStateChangeRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ServerStateChangeRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.authentication.AuthenticationService.internal__static_bnet_protocol_authentication_ServerStateChangeRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.authentication.AuthenticationService.internal__static_bnet_protocol_authentication_ServerStateChangeRequest__FieldAccessorTable; } + } + + public const int StateFieldNumber = 1; + private bool hasState; + private uint state_; + public bool HasState { + get { return hasState; } + } + public uint State { + get { return state_; } + } + + public const int EventTimeFieldNumber = 2; + private bool hasEventTime; + private ulong eventTime_; + public bool HasEventTime { + get { return hasEventTime; } + } + public ulong EventTime { + get { return eventTime_; } + } + + public override bool IsInitialized { + get { + if (!hasState) return false; + if (!hasEventTime) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _serverStateChangeRequestFieldNames; + if (hasState) { + output.WriteUInt32(1, field_names[1], State); + } + if (hasEventTime) { + output.WriteUInt64(2, field_names[0], EventTime); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasState) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, State); + } + if (hasEventTime) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, EventTime); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ServerStateChangeRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ServerStateChangeRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ServerStateChangeRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ServerStateChangeRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ServerStateChangeRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ServerStateChangeRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ServerStateChangeRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ServerStateChangeRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ServerStateChangeRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ServerStateChangeRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ServerStateChangeRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ServerStateChangeRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ServerStateChangeRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ServerStateChangeRequest result; + + private ServerStateChangeRequest PrepareBuilder() { + if (resultIsReadOnly) { + ServerStateChangeRequest original = result; + result = new ServerStateChangeRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ServerStateChangeRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.authentication.ServerStateChangeRequest.Descriptor; } + } + + public override ServerStateChangeRequest DefaultInstanceForType { + get { return global::bnet.protocol.authentication.ServerStateChangeRequest.DefaultInstance; } + } + + public override ServerStateChangeRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ServerStateChangeRequest) { + return MergeFrom((ServerStateChangeRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ServerStateChangeRequest other) { + if (other == global::bnet.protocol.authentication.ServerStateChangeRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasState) { + State = other.State; + } + if (other.HasEventTime) { + EventTime = other.EventTime; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_serverStateChangeRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _serverStateChangeRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasState = input.ReadUInt32(ref result.state_); + break; + } + case 16: { + result.hasEventTime = input.ReadUInt64(ref result.eventTime_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasState { + get { return result.hasState; } + } + public uint State { + get { return result.State; } + set { SetState(value); } + } + public Builder SetState(uint value) { + PrepareBuilder(); + result.hasState = true; + result.state_ = value; + return this; + } + public Builder ClearState() { + PrepareBuilder(); + result.hasState = false; + result.state_ = 0; + return this; + } + + public bool HasEventTime { + get { return result.hasEventTime; } + } + public ulong EventTime { + get { return result.EventTime; } + set { SetEventTime(value); } + } + public Builder SetEventTime(ulong value) { + PrepareBuilder(); + result.hasEventTime = true; + result.eventTime_ = value; + return this; + } + public Builder ClearEventTime() { + PrepareBuilder(); + result.hasEventTime = false; + result.eventTime_ = 0UL; + return this; + } + } + static ServerStateChangeRequest() { + object.ReferenceEquals(global::bnet.protocol.authentication.AuthenticationService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class MemModuleLoadRequest : pb::GeneratedMessage { + private MemModuleLoadRequest() { } + private static readonly MemModuleLoadRequest defaultInstance = new MemModuleLoadRequest().MakeReadOnly(); + private static readonly string[] _memModuleLoadRequestFieldNames = new string[] { "handle", "input", "key" }; + private static readonly uint[] _memModuleLoadRequestFieldTags = new uint[] { 10, 26, 18 }; + public static MemModuleLoadRequest DefaultInstance { + get { return defaultInstance; } + } + + public override MemModuleLoadRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override MemModuleLoadRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.authentication.AuthenticationService.internal__static_bnet_protocol_authentication_MemModuleLoadRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.authentication.AuthenticationService.internal__static_bnet_protocol_authentication_MemModuleLoadRequest__FieldAccessorTable; } + } + + public const int HandleFieldNumber = 1; + private bool hasHandle; + private global::bnet.protocol.ContentHandle handle_; + public bool HasHandle { + get { return hasHandle; } + } + public global::bnet.protocol.ContentHandle Handle { + get { return handle_ ?? global::bnet.protocol.ContentHandle.DefaultInstance; } + } + + public const int KeyFieldNumber = 2; + private bool hasKey; + private pb::ByteString key_ = pb::ByteString.Empty; + public bool HasKey { + get { return hasKey; } + } + public pb::ByteString Key { + get { return key_; } + } + + public const int InputFieldNumber = 3; + private bool hasInput; + private pb::ByteString input_ = pb::ByteString.Empty; + public bool HasInput { + get { return hasInput; } + } + public pb::ByteString Input { + get { return input_; } + } + + public override bool IsInitialized { + get { + if (!hasHandle) return false; + if (!hasKey) return false; + if (!hasInput) return false; + if (!Handle.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _memModuleLoadRequestFieldNames; + if (hasHandle) { + output.WriteMessage(1, field_names[0], Handle); + } + if (hasKey) { + output.WriteBytes(2, field_names[2], Key); + } + if (hasInput) { + output.WriteBytes(3, field_names[1], Input); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasHandle) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Handle); + } + if (hasKey) { + size += pb::CodedOutputStream.ComputeBytesSize(2, Key); + } + if (hasInput) { + size += pb::CodedOutputStream.ComputeBytesSize(3, Input); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static MemModuleLoadRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static MemModuleLoadRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static MemModuleLoadRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static MemModuleLoadRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static MemModuleLoadRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static MemModuleLoadRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static MemModuleLoadRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static MemModuleLoadRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static MemModuleLoadRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static MemModuleLoadRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private MemModuleLoadRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(MemModuleLoadRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(MemModuleLoadRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private MemModuleLoadRequest result; + + private MemModuleLoadRequest PrepareBuilder() { + if (resultIsReadOnly) { + MemModuleLoadRequest original = result; + result = new MemModuleLoadRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override MemModuleLoadRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.authentication.MemModuleLoadRequest.Descriptor; } + } + + public override MemModuleLoadRequest DefaultInstanceForType { + get { return global::bnet.protocol.authentication.MemModuleLoadRequest.DefaultInstance; } + } + + public override MemModuleLoadRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is MemModuleLoadRequest) { + return MergeFrom((MemModuleLoadRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(MemModuleLoadRequest other) { + if (other == global::bnet.protocol.authentication.MemModuleLoadRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasHandle) { + MergeHandle(other.Handle); + } + if (other.HasKey) { + Key = other.Key; + } + if (other.HasInput) { + Input = other.Input; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_memModuleLoadRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _memModuleLoadRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.ContentHandle.Builder subBuilder = global::bnet.protocol.ContentHandle.CreateBuilder(); + if (result.hasHandle) { + subBuilder.MergeFrom(Handle); + } + input.ReadMessage(subBuilder, extensionRegistry); + Handle = subBuilder.BuildPartial(); + break; + } + case 18: { + result.hasKey = input.ReadBytes(ref result.key_); + break; + } + case 26: { + result.hasInput = input.ReadBytes(ref result.input_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasHandle { + get { return result.hasHandle; } + } + public global::bnet.protocol.ContentHandle Handle { + get { return result.Handle; } + set { SetHandle(value); } + } + public Builder SetHandle(global::bnet.protocol.ContentHandle value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasHandle = true; + result.handle_ = value; + return this; + } + public Builder SetHandle(global::bnet.protocol.ContentHandle.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasHandle = true; + result.handle_ = builderForValue.Build(); + return this; + } + public Builder MergeHandle(global::bnet.protocol.ContentHandle value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasHandle && + result.handle_ != global::bnet.protocol.ContentHandle.DefaultInstance) { + result.handle_ = global::bnet.protocol.ContentHandle.CreateBuilder(result.handle_).MergeFrom(value).BuildPartial(); + } else { + result.handle_ = value; + } + result.hasHandle = true; + return this; + } + public Builder ClearHandle() { + PrepareBuilder(); + result.hasHandle = false; + result.handle_ = null; + return this; + } + + public bool HasKey { + get { return result.hasKey; } + } + public pb::ByteString Key { + get { return result.Key; } + set { SetKey(value); } + } + public Builder SetKey(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasKey = true; + result.key_ = value; + return this; + } + public Builder ClearKey() { + PrepareBuilder(); + result.hasKey = false; + result.key_ = pb::ByteString.Empty; + return this; + } + + public bool HasInput { + get { return result.hasInput; } + } + public pb::ByteString Input { + get { return result.Input; } + set { SetInput(value); } + } + public Builder SetInput(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasInput = true; + result.input_ = value; + return this; + } + public Builder ClearInput() { + PrepareBuilder(); + result.hasInput = false; + result.input_ = pb::ByteString.Empty; + return this; + } + } + static MemModuleLoadRequest() { + object.ReferenceEquals(global::bnet.protocol.authentication.AuthenticationService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class MemModuleLoadResponse : pb::GeneratedMessage { + private MemModuleLoadResponse() { } + private static readonly MemModuleLoadResponse defaultInstance = new MemModuleLoadResponse().MakeReadOnly(); + private static readonly string[] _memModuleLoadResponseFieldNames = new string[] { "data" }; + private static readonly uint[] _memModuleLoadResponseFieldTags = new uint[] { 10 }; + public static MemModuleLoadResponse DefaultInstance { + get { return defaultInstance; } + } + + public override MemModuleLoadResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override MemModuleLoadResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.authentication.AuthenticationService.internal__static_bnet_protocol_authentication_MemModuleLoadResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.authentication.AuthenticationService.internal__static_bnet_protocol_authentication_MemModuleLoadResponse__FieldAccessorTable; } + } + + public const int DataFieldNumber = 1; + private bool hasData; + private pb::ByteString data_ = pb::ByteString.Empty; + public bool HasData { + get { return hasData; } + } + public pb::ByteString Data { + get { return data_; } + } + + public override bool IsInitialized { + get { + if (!hasData) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _memModuleLoadResponseFieldNames; + if (hasData) { + output.WriteBytes(1, field_names[0], Data); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasData) { + size += pb::CodedOutputStream.ComputeBytesSize(1, Data); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static MemModuleLoadResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static MemModuleLoadResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static MemModuleLoadResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static MemModuleLoadResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static MemModuleLoadResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static MemModuleLoadResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static MemModuleLoadResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static MemModuleLoadResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static MemModuleLoadResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static MemModuleLoadResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private MemModuleLoadResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(MemModuleLoadResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(MemModuleLoadResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private MemModuleLoadResponse result; + + private MemModuleLoadResponse PrepareBuilder() { + if (resultIsReadOnly) { + MemModuleLoadResponse original = result; + result = new MemModuleLoadResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override MemModuleLoadResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.authentication.MemModuleLoadResponse.Descriptor; } + } + + public override MemModuleLoadResponse DefaultInstanceForType { + get { return global::bnet.protocol.authentication.MemModuleLoadResponse.DefaultInstance; } + } + + public override MemModuleLoadResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is MemModuleLoadResponse) { + return MergeFrom((MemModuleLoadResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(MemModuleLoadResponse other) { + if (other == global::bnet.protocol.authentication.MemModuleLoadResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasData) { + Data = other.Data; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_memModuleLoadResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _memModuleLoadResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasData = input.ReadBytes(ref result.data_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasData { + get { return result.hasData; } + } + public pb::ByteString Data { + get { return result.Data; } + set { SetData(value); } + } + public Builder SetData(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasData = true; + result.data_ = value; + return this; + } + public Builder ClearData() { + PrepareBuilder(); + result.hasData = false; + result.data_ = pb::ByteString.Empty; + return this; + } + } + static MemModuleLoadResponse() { + object.ReferenceEquals(global::bnet.protocol.authentication.AuthenticationService.Descriptor, null); + } + } + + #endregion + + #region Services + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public abstract class AuthenticationClient : pb::IService { + public abstract void ModuleLoad( + pb::IRpcController controller, + global::bnet.protocol.authentication.ModuleLoadRequest request, + global::System.Action done); + public abstract void ModuleMessage( + pb::IRpcController controller, + global::bnet.protocol.authentication.ModuleMessageRequest request, + global::System.Action done); + public abstract void AccountSettings( + pb::IRpcController controller, + global::bnet.protocol.authentication.AccountSettingsNotification request, + global::System.Action done); + public abstract void ServerStateChange( + pb::IRpcController controller, + global::bnet.protocol.authentication.ServerStateChangeRequest request, + global::System.Action done); + public abstract void LogonComplete( + pb::IRpcController controller, + global::bnet.protocol.authentication.LogonResult request, + global::System.Action done); + public abstract void MemModuleLoad( + pb::IRpcController controller, + global::bnet.protocol.authentication.MemModuleLoadRequest request, + global::System.Action done); + public abstract void LogonUpdate( + pb::IRpcController controller, + global::bnet.protocol.authentication.LogonUpdateRequest request, + global::System.Action done); + + public static pbd::ServiceDescriptor Descriptor { + get { return AuthenticationService.Descriptor.Services[0]; } + } + public pbd::ServiceDescriptor DescriptorForType { + get { return Descriptor; } + } + + public void CallMethod( + pbd::MethodDescriptor method, + pb::IRpcController controller, + pb::IMessage request, + global::System.Action done) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.CallMethod() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + this.ModuleLoad(controller, (global::bnet.protocol.authentication.ModuleLoadRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 1: + this.ModuleMessage(controller, (global::bnet.protocol.authentication.ModuleMessageRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 2: + this.AccountSettings(controller, (global::bnet.protocol.authentication.AccountSettingsNotification) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 3: + this.ServerStateChange(controller, (global::bnet.protocol.authentication.ServerStateChangeRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 4: + this.LogonComplete(controller, (global::bnet.protocol.authentication.LogonResult) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 5: + this.MemModuleLoad(controller, (global::bnet.protocol.authentication.MemModuleLoadRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 6: + this.LogonUpdate(controller, (global::bnet.protocol.authentication.LogonUpdateRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetRequestPrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.authentication.ModuleLoadRequest.DefaultInstance; + case 1: + return global::bnet.protocol.authentication.ModuleMessageRequest.DefaultInstance; + case 2: + return global::bnet.protocol.authentication.AccountSettingsNotification.DefaultInstance; + case 3: + return global::bnet.protocol.authentication.ServerStateChangeRequest.DefaultInstance; + case 4: + return global::bnet.protocol.authentication.LogonResult.DefaultInstance; + case 5: + return global::bnet.protocol.authentication.MemModuleLoadRequest.DefaultInstance; + case 6: + return global::bnet.protocol.authentication.LogonUpdateRequest.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetResponsePrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.NO_RESPONSE.DefaultInstance; + case 1: + return global::bnet.protocol.NoData.DefaultInstance; + case 2: + return global::bnet.protocol.NO_RESPONSE.DefaultInstance; + case 3: + return global::bnet.protocol.NO_RESPONSE.DefaultInstance; + case 4: + return global::bnet.protocol.NO_RESPONSE.DefaultInstance; + case 5: + return global::bnet.protocol.authentication.MemModuleLoadResponse.DefaultInstance; + case 6: + return global::bnet.protocol.NO_RESPONSE.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public static Stub CreateStub(pb::IRpcChannel channel) { + return new Stub(channel); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public class Stub : global::bnet.protocol.authentication.AuthenticationClient { + internal Stub(pb::IRpcChannel channel) { + this.channel = channel; + } + + private readonly pb::IRpcChannel channel; + + public pb::IRpcChannel Channel { + get { return channel; } + } + + public override void ModuleLoad( + pb::IRpcController controller, + global::bnet.protocol.authentication.ModuleLoadRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[0], + controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); + } + + public override void ModuleMessage( + pb::IRpcController controller, + global::bnet.protocol.authentication.ModuleMessageRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[1], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void AccountSettings( + pb::IRpcController controller, + global::bnet.protocol.authentication.AccountSettingsNotification request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[2], + controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); + } + + public override void ServerStateChange( + pb::IRpcController controller, + global::bnet.protocol.authentication.ServerStateChangeRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[3], + controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); + } + + public override void LogonComplete( + pb::IRpcController controller, + global::bnet.protocol.authentication.LogonResult request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[4], + controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); + } + + public override void MemModuleLoad( + pb::IRpcController controller, + global::bnet.protocol.authentication.MemModuleLoadRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[5], + controller, request, global::bnet.protocol.authentication.MemModuleLoadResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.authentication.MemModuleLoadResponse.DefaultInstance)); + } + + public override void LogonUpdate( + pb::IRpcController controller, + global::bnet.protocol.authentication.LogonUpdateRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[6], + controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); + } + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public abstract class AuthenticationServer : pb::IService { + public abstract void Logon( + pb::IRpcController controller, + global::bnet.protocol.authentication.LogonRequest request, + global::System.Action done); + public abstract void ModuleNotify( + pb::IRpcController controller, + global::bnet.protocol.authentication.ModuleNotification request, + global::System.Action done); + public abstract void ModuleMessage( + pb::IRpcController controller, + global::bnet.protocol.authentication.ModuleMessageRequest request, + global::System.Action done); + public abstract void SelectGameAccount( + pb::IRpcController controller, + global::bnet.protocol.EntityId request, + global::System.Action done); + + public static pbd::ServiceDescriptor Descriptor { + get { return AuthenticationService.Descriptor.Services[1]; } + } + public pbd::ServiceDescriptor DescriptorForType { + get { return Descriptor; } + } + + public void CallMethod( + pbd::MethodDescriptor method, + pb::IRpcController controller, + pb::IMessage request, + global::System.Action done) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.CallMethod() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + this.Logon(controller, (global::bnet.protocol.authentication.LogonRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 1: + this.ModuleNotify(controller, (global::bnet.protocol.authentication.ModuleNotification) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 2: + this.ModuleMessage(controller, (global::bnet.protocol.authentication.ModuleMessageRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 3: + this.SelectGameAccount(controller, (global::bnet.protocol.EntityId) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetRequestPrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.authentication.LogonRequest.DefaultInstance; + case 1: + return global::bnet.protocol.authentication.ModuleNotification.DefaultInstance; + case 2: + return global::bnet.protocol.authentication.ModuleMessageRequest.DefaultInstance; + case 3: + return global::bnet.protocol.EntityId.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetResponsePrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.NoData.DefaultInstance; + case 1: + return global::bnet.protocol.NoData.DefaultInstance; + case 2: + return global::bnet.protocol.NoData.DefaultInstance; + case 3: + return global::bnet.protocol.NoData.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public static Stub CreateStub(pb::IRpcChannel channel) { + return new Stub(channel); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public class Stub : global::bnet.protocol.authentication.AuthenticationServer { + internal Stub(pb::IRpcChannel channel) { + this.channel = channel; + } + + private readonly pb::IRpcChannel channel; + + public pb::IRpcChannel Channel { + get { return channel; } + } + + public override void Logon( + pb::IRpcController controller, + global::bnet.protocol.authentication.LogonRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[0], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void ModuleNotify( + pb::IRpcController controller, + global::bnet.protocol.authentication.ModuleNotification request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[1], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void ModuleMessage( + pb::IRpcController controller, + global::bnet.protocol.authentication.ModuleMessageRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[2], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void SelectGameAccount( + pb::IRpcController controller, + global::bnet.protocol.EntityId request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[3], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + } + } + #endregion + +} + +#endregion Designer generated code diff --git a/src/LibMooNet/bnet/protocol/challenge/ChallengeService.cs b/src/LibMooNet/bnet/protocol/challenge/ChallengeService.cs new file mode 100644 index 00000000..519f4196 --- /dev/null +++ b/src/LibMooNet/bnet/protocol/challenge/ChallengeService.cs @@ -0,0 +1,2468 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace bnet.protocol.challenge { + + namespace Proto { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class ChallengeService { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_bnet_protocol_challenge_Challenge__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_challenge_Challenge__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_challenge_ChallengePickedRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_challenge_ChallengePickedRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_challenge_ChallengeAnsweredRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_challenge_ChallengeAnsweredRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_challenge_SendChallengeToUserRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_challenge_SendChallengeToUserRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_challenge_SendChallengeToUserResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_challenge_SendChallengeToUserResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_challenge_ChallengeUserRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_challenge_ChallengeUserRequest__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static ChallengeService() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "ChxibmV0L2NoYWxsZW5nZV9zZXJ2aWNlLnByb3RvEhdibmV0LnByb3RvY29s" + + "LmNoYWxsZW5nZRoUYm5ldC9hdHRyaWJ1dGUucHJvdG8aEWJuZXQvZW50aXR5" + + "LnByb3RvGg5ibmV0L3JwYy5wcm90bxoYYm5ldC9maWVsZF9vcHRpb25zLnBy" + + "b3RvIkgKCUNoYWxsZW5nZRIMCgR0eXBlGAEgAigHEgwKBGluZm8YAiABKAkS" + + "DgoGYW5zd2VyGAMgASgJEg8KB3JldHJpZXMYBCABKA0iKwoWQ2hhbGxlbmdl" + + "UGlja2VkUmVxdWVzdBIRCgljaGFsbGVuZ2UYASACKAciKgoYQ2hhbGxlbmdl" + + "QW5zd2VyZWRSZXF1ZXN0Eg4KBmFuc3dlchgBIAIoCSLCAQoaU2VuZENoYWxs" + + "ZW5nZVRvVXNlclJlcXVlc3QSKQoHcGVlcl9pZBgBIAEoCzIYLmJuZXQucHJv" + + "dG9jb2wuUHJvY2Vzc0lkEjAKD2dhbWVfYWNjb3VudF9pZBgCIAEoCzIXLmJu" + + "ZXQucHJvdG9jb2wuRW50aXR5SWQSNgoKY2hhbGxlbmdlcxgDIAMoCzIiLmJu" + + "ZXQucHJvdG9jb2wuY2hhbGxlbmdlLkNoYWxsZW5nZRIPCgdjb250ZXh0GAQg" + + "AigHIlQKG1NlbmRDaGFsbGVuZ2VUb1VzZXJSZXNwb25zZRI1CgljaGFsbGVu" + + "Z2UYASACKAsyIi5ibmV0LnByb3RvY29sLmNoYWxsZW5nZS5DaGFsbGVuZ2Ui" + + "XwoUQ2hhbGxlbmdlVXNlclJlcXVlc3QSNgoKY2hhbGxlbmdlcxgBIAMoCzIi" + + "LmJuZXQucHJvdG9jb2wuY2hhbGxlbmdlLkNoYWxsZW5nZRIPCgdjb250ZXh0" + + "GAIgAigHMrUDChBDaGFsbGVuZ2VTZXJ2aWNlEmQKD0NoYWxsZW5nZVBpY2tl" + + "ZBIvLmJuZXQucHJvdG9jb2wuY2hhbGxlbmdlLkNoYWxsZW5nZVBpY2tlZFJl" + + "cXVlc3QaGi5ibmV0LnByb3RvY29sLk5PX1JFU1BPTlNFIgSAtRgBEmMKEUNo" + + "YWxsZW5nZUFuc3dlcmVkEjEuYm5ldC5wcm90b2NvbC5jaGFsbGVuZ2UuQ2hh" + + "bGxlbmdlQW5zd2VyZWRSZXF1ZXN0GhUuYm5ldC5wcm90b2NvbC5Ob0RhdGEi" + + "BIC1GAISTQoSQ2hhbGxlbmdlQ2FuY2VsbGVkEhUuYm5ldC5wcm90b2NvbC5O" + + "b0RhdGEaGi5ibmV0LnByb3RvY29sLk5PX1JFU1BPTlNFIgSAtRgDEoYBChNT" + + "ZW5kQ2hhbGxlbmdlVG9Vc2VyEjMuYm5ldC5wcm90b2NvbC5jaGFsbGVuZ2Uu" + + "U2VuZENoYWxsZW5nZVRvVXNlclJlcXVlc3QaNC5ibmV0LnByb3RvY29sLmNo" + + "YWxsZW5nZS5TZW5kQ2hhbGxlbmdlVG9Vc2VyUmVzcG9uc2UiBIC1GAQycwoP" + + "Q2hhbGxlbmdlTm90aWZ5EmAKDUNoYWxsZW5nZVVzZXISLS5ibmV0LnByb3Rv" + + "Y29sLmNoYWxsZW5nZS5DaGFsbGVuZ2VVc2VyUmVxdWVzdBoaLmJuZXQucHJv" + + "dG9jb2wuTk9fUkVTUE9OU0UiBIC1GAFCA4ABAA=="); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_bnet_protocol_challenge_Challenge__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_challenge_Challenge__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_challenge_Challenge__Descriptor, + new string[] { "Type", "Info", "Answer", "Retries", }); + internal__static_bnet_protocol_challenge_ChallengePickedRequest__Descriptor = Descriptor.MessageTypes[1]; + internal__static_bnet_protocol_challenge_ChallengePickedRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_challenge_ChallengePickedRequest__Descriptor, + new string[] { "Challenge", }); + internal__static_bnet_protocol_challenge_ChallengeAnsweredRequest__Descriptor = Descriptor.MessageTypes[2]; + internal__static_bnet_protocol_challenge_ChallengeAnsweredRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_challenge_ChallengeAnsweredRequest__Descriptor, + new string[] { "Answer", }); + internal__static_bnet_protocol_challenge_SendChallengeToUserRequest__Descriptor = Descriptor.MessageTypes[3]; + internal__static_bnet_protocol_challenge_SendChallengeToUserRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_challenge_SendChallengeToUserRequest__Descriptor, + new string[] { "PeerId", "GameAccountId", "Challenges", "Context", }); + internal__static_bnet_protocol_challenge_SendChallengeToUserResponse__Descriptor = Descriptor.MessageTypes[4]; + internal__static_bnet_protocol_challenge_SendChallengeToUserResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_challenge_SendChallengeToUserResponse__Descriptor, + new string[] { "Challenge", }); + internal__static_bnet_protocol_challenge_ChallengeUserRequest__Descriptor = Descriptor.MessageTypes[5]; + internal__static_bnet_protocol_challenge_ChallengeUserRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_challenge_ChallengeUserRequest__Descriptor, + new string[] { "Challenges", "Context", }); + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + RegisterAllExtensions(registry); + global::bnet.protocol.attribute.Proto.Attribute.RegisterAllExtensions(registry); + global::bnet.protocol.Entity.RegisterAllExtensions(registry); + global::bnet.protocol.Rpc.RegisterAllExtensions(registry); + global::bnet.protocol.FieldOptions.RegisterAllExtensions(registry); + return registry; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::bnet.protocol.attribute.Proto.Attribute.Descriptor, + global::bnet.protocol.Entity.Descriptor, + global::bnet.protocol.Rpc.Descriptor, + global::bnet.protocol.FieldOptions.Descriptor, + }, assigner); + } + #endregion + + } + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Challenge : pb::GeneratedMessage { + private Challenge() { } + private static readonly Challenge defaultInstance = new Challenge().MakeReadOnly(); + private static readonly string[] _challengeFieldNames = new string[] { "answer", "info", "retries", "type" }; + private static readonly uint[] _challengeFieldTags = new uint[] { 26, 18, 32, 13 }; + public static Challenge DefaultInstance { + get { return defaultInstance; } + } + + public override Challenge DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Challenge ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.challenge.Proto.ChallengeService.internal__static_bnet_protocol_challenge_Challenge__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.challenge.Proto.ChallengeService.internal__static_bnet_protocol_challenge_Challenge__FieldAccessorTable; } + } + + public const int TypeFieldNumber = 1; + private bool hasType; + private uint type_; + public bool HasType { + get { return hasType; } + } + public uint Type { + get { return type_; } + } + + public const int InfoFieldNumber = 2; + private bool hasInfo; + private string info_ = ""; + public bool HasInfo { + get { return hasInfo; } + } + public string Info { + get { return info_; } + } + + public const int AnswerFieldNumber = 3; + private bool hasAnswer; + private string answer_ = ""; + public bool HasAnswer { + get { return hasAnswer; } + } + public string Answer { + get { return answer_; } + } + + public const int RetriesFieldNumber = 4; + private bool hasRetries; + private uint retries_; + public bool HasRetries { + get { return hasRetries; } + } + public uint Retries { + get { return retries_; } + } + + public override bool IsInitialized { + get { + if (!hasType) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _challengeFieldNames; + if (hasType) { + output.WriteFixed32(1, field_names[3], Type); + } + if (hasInfo) { + output.WriteString(2, field_names[1], Info); + } + if (hasAnswer) { + output.WriteString(3, field_names[0], Answer); + } + if (hasRetries) { + output.WriteUInt32(4, field_names[2], Retries); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasType) { + size += pb::CodedOutputStream.ComputeFixed32Size(1, Type); + } + if (hasInfo) { + size += pb::CodedOutputStream.ComputeStringSize(2, Info); + } + if (hasAnswer) { + size += pb::CodedOutputStream.ComputeStringSize(3, Answer); + } + if (hasRetries) { + size += pb::CodedOutputStream.ComputeUInt32Size(4, Retries); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static Challenge ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Challenge ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Challenge ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Challenge ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Challenge ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Challenge ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Challenge ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Challenge ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Challenge ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Challenge ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Challenge MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Challenge prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Challenge cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Challenge result; + + private Challenge PrepareBuilder() { + if (resultIsReadOnly) { + Challenge original = result; + result = new Challenge(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Challenge MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.challenge.Challenge.Descriptor; } + } + + public override Challenge DefaultInstanceForType { + get { return global::bnet.protocol.challenge.Challenge.DefaultInstance; } + } + + public override Challenge BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Challenge) { + return MergeFrom((Challenge) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Challenge other) { + if (other == global::bnet.protocol.challenge.Challenge.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasType) { + Type = other.Type; + } + if (other.HasInfo) { + Info = other.Info; + } + if (other.HasAnswer) { + Answer = other.Answer; + } + if (other.HasRetries) { + Retries = other.Retries; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_challengeFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _challengeFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 13: { + result.hasType = input.ReadFixed32(ref result.type_); + break; + } + case 18: { + result.hasInfo = input.ReadString(ref result.info_); + break; + } + case 26: { + result.hasAnswer = input.ReadString(ref result.answer_); + break; + } + case 32: { + result.hasRetries = input.ReadUInt32(ref result.retries_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasType { + get { return result.hasType; } + } + public uint Type { + get { return result.Type; } + set { SetType(value); } + } + public Builder SetType(uint value) { + PrepareBuilder(); + result.hasType = true; + result.type_ = value; + return this; + } + public Builder ClearType() { + PrepareBuilder(); + result.hasType = false; + result.type_ = 0; + return this; + } + + public bool HasInfo { + get { return result.hasInfo; } + } + public string Info { + get { return result.Info; } + set { SetInfo(value); } + } + public Builder SetInfo(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasInfo = true; + result.info_ = value; + return this; + } + public Builder ClearInfo() { + PrepareBuilder(); + result.hasInfo = false; + result.info_ = ""; + return this; + } + + public bool HasAnswer { + get { return result.hasAnswer; } + } + public string Answer { + get { return result.Answer; } + set { SetAnswer(value); } + } + public Builder SetAnswer(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAnswer = true; + result.answer_ = value; + return this; + } + public Builder ClearAnswer() { + PrepareBuilder(); + result.hasAnswer = false; + result.answer_ = ""; + return this; + } + + public bool HasRetries { + get { return result.hasRetries; } + } + public uint Retries { + get { return result.Retries; } + set { SetRetries(value); } + } + public Builder SetRetries(uint value) { + PrepareBuilder(); + result.hasRetries = true; + result.retries_ = value; + return this; + } + public Builder ClearRetries() { + PrepareBuilder(); + result.hasRetries = false; + result.retries_ = 0; + return this; + } + } + static Challenge() { + object.ReferenceEquals(global::bnet.protocol.challenge.Proto.ChallengeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ChallengePickedRequest : pb::GeneratedMessage { + private ChallengePickedRequest() { } + private static readonly ChallengePickedRequest defaultInstance = new ChallengePickedRequest().MakeReadOnly(); + private static readonly string[] _challengePickedRequestFieldNames = new string[] { "challenge" }; + private static readonly uint[] _challengePickedRequestFieldTags = new uint[] { 13 }; + public static ChallengePickedRequest DefaultInstance { + get { return defaultInstance; } + } + + public override ChallengePickedRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ChallengePickedRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.challenge.Proto.ChallengeService.internal__static_bnet_protocol_challenge_ChallengePickedRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.challenge.Proto.ChallengeService.internal__static_bnet_protocol_challenge_ChallengePickedRequest__FieldAccessorTable; } + } + + public const int ChallengeFieldNumber = 1; + private bool hasChallenge; + private uint challenge_; + public bool HasChallenge { + get { return hasChallenge; } + } + public uint Challenge { + get { return challenge_; } + } + + public override bool IsInitialized { + get { + if (!hasChallenge) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _challengePickedRequestFieldNames; + if (hasChallenge) { + output.WriteFixed32(1, field_names[0], Challenge); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasChallenge) { + size += pb::CodedOutputStream.ComputeFixed32Size(1, Challenge); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ChallengePickedRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ChallengePickedRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ChallengePickedRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ChallengePickedRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ChallengePickedRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ChallengePickedRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ChallengePickedRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ChallengePickedRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ChallengePickedRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ChallengePickedRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ChallengePickedRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ChallengePickedRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ChallengePickedRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ChallengePickedRequest result; + + private ChallengePickedRequest PrepareBuilder() { + if (resultIsReadOnly) { + ChallengePickedRequest original = result; + result = new ChallengePickedRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ChallengePickedRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.challenge.ChallengePickedRequest.Descriptor; } + } + + public override ChallengePickedRequest DefaultInstanceForType { + get { return global::bnet.protocol.challenge.ChallengePickedRequest.DefaultInstance; } + } + + public override ChallengePickedRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ChallengePickedRequest) { + return MergeFrom((ChallengePickedRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ChallengePickedRequest other) { + if (other == global::bnet.protocol.challenge.ChallengePickedRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasChallenge) { + Challenge = other.Challenge; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_challengePickedRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _challengePickedRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 13: { + result.hasChallenge = input.ReadFixed32(ref result.challenge_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasChallenge { + get { return result.hasChallenge; } + } + public uint Challenge { + get { return result.Challenge; } + set { SetChallenge(value); } + } + public Builder SetChallenge(uint value) { + PrepareBuilder(); + result.hasChallenge = true; + result.challenge_ = value; + return this; + } + public Builder ClearChallenge() { + PrepareBuilder(); + result.hasChallenge = false; + result.challenge_ = 0; + return this; + } + } + static ChallengePickedRequest() { + object.ReferenceEquals(global::bnet.protocol.challenge.Proto.ChallengeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ChallengeAnsweredRequest : pb::GeneratedMessage { + private ChallengeAnsweredRequest() { } + private static readonly ChallengeAnsweredRequest defaultInstance = new ChallengeAnsweredRequest().MakeReadOnly(); + private static readonly string[] _challengeAnsweredRequestFieldNames = new string[] { "answer" }; + private static readonly uint[] _challengeAnsweredRequestFieldTags = new uint[] { 10 }; + public static ChallengeAnsweredRequest DefaultInstance { + get { return defaultInstance; } + } + + public override ChallengeAnsweredRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ChallengeAnsweredRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.challenge.Proto.ChallengeService.internal__static_bnet_protocol_challenge_ChallengeAnsweredRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.challenge.Proto.ChallengeService.internal__static_bnet_protocol_challenge_ChallengeAnsweredRequest__FieldAccessorTable; } + } + + public const int AnswerFieldNumber = 1; + private bool hasAnswer; + private string answer_ = ""; + public bool HasAnswer { + get { return hasAnswer; } + } + public string Answer { + get { return answer_; } + } + + public override bool IsInitialized { + get { + if (!hasAnswer) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _challengeAnsweredRequestFieldNames; + if (hasAnswer) { + output.WriteString(1, field_names[0], Answer); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAnswer) { + size += pb::CodedOutputStream.ComputeStringSize(1, Answer); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ChallengeAnsweredRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ChallengeAnsweredRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ChallengeAnsweredRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ChallengeAnsweredRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ChallengeAnsweredRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ChallengeAnsweredRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ChallengeAnsweredRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ChallengeAnsweredRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ChallengeAnsweredRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ChallengeAnsweredRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ChallengeAnsweredRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ChallengeAnsweredRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ChallengeAnsweredRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ChallengeAnsweredRequest result; + + private ChallengeAnsweredRequest PrepareBuilder() { + if (resultIsReadOnly) { + ChallengeAnsweredRequest original = result; + result = new ChallengeAnsweredRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ChallengeAnsweredRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.challenge.ChallengeAnsweredRequest.Descriptor; } + } + + public override ChallengeAnsweredRequest DefaultInstanceForType { + get { return global::bnet.protocol.challenge.ChallengeAnsweredRequest.DefaultInstance; } + } + + public override ChallengeAnsweredRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ChallengeAnsweredRequest) { + return MergeFrom((ChallengeAnsweredRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ChallengeAnsweredRequest other) { + if (other == global::bnet.protocol.challenge.ChallengeAnsweredRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAnswer) { + Answer = other.Answer; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_challengeAnsweredRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _challengeAnsweredRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasAnswer = input.ReadString(ref result.answer_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAnswer { + get { return result.hasAnswer; } + } + public string Answer { + get { return result.Answer; } + set { SetAnswer(value); } + } + public Builder SetAnswer(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAnswer = true; + result.answer_ = value; + return this; + } + public Builder ClearAnswer() { + PrepareBuilder(); + result.hasAnswer = false; + result.answer_ = ""; + return this; + } + } + static ChallengeAnsweredRequest() { + object.ReferenceEquals(global::bnet.protocol.challenge.Proto.ChallengeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class SendChallengeToUserRequest : pb::GeneratedMessage { + private SendChallengeToUserRequest() { } + private static readonly SendChallengeToUserRequest defaultInstance = new SendChallengeToUserRequest().MakeReadOnly(); + private static readonly string[] _sendChallengeToUserRequestFieldNames = new string[] { "challenges", "context", "game_account_id", "peer_id" }; + private static readonly uint[] _sendChallengeToUserRequestFieldTags = new uint[] { 26, 37, 18, 10 }; + public static SendChallengeToUserRequest DefaultInstance { + get { return defaultInstance; } + } + + public override SendChallengeToUserRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SendChallengeToUserRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.challenge.Proto.ChallengeService.internal__static_bnet_protocol_challenge_SendChallengeToUserRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.challenge.Proto.ChallengeService.internal__static_bnet_protocol_challenge_SendChallengeToUserRequest__FieldAccessorTable; } + } + + public const int PeerIdFieldNumber = 1; + private bool hasPeerId; + private global::bnet.protocol.ProcessId peerId_; + public bool HasPeerId { + get { return hasPeerId; } + } + public global::bnet.protocol.ProcessId PeerId { + get { return peerId_ ?? global::bnet.protocol.ProcessId.DefaultInstance; } + } + + public const int GameAccountIdFieldNumber = 2; + private bool hasGameAccountId; + private global::bnet.protocol.EntityId gameAccountId_; + public bool HasGameAccountId { + get { return hasGameAccountId; } + } + public global::bnet.protocol.EntityId GameAccountId { + get { return gameAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int ChallengesFieldNumber = 3; + private pbc::PopsicleList challenges_ = new pbc::PopsicleList(); + public scg::IList ChallengesList { + get { return challenges_; } + } + public int ChallengesCount { + get { return challenges_.Count; } + } + public global::bnet.protocol.challenge.Challenge GetChallenges(int index) { + return challenges_[index]; + } + + public const int ContextFieldNumber = 4; + private bool hasContext; + private uint context_; + public bool HasContext { + get { return hasContext; } + } + public uint Context { + get { return context_; } + } + + public override bool IsInitialized { + get { + if (!hasContext) return false; + if (HasPeerId) { + if (!PeerId.IsInitialized) return false; + } + if (HasGameAccountId) { + if (!GameAccountId.IsInitialized) return false; + } + foreach (global::bnet.protocol.challenge.Challenge element in ChallengesList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _sendChallengeToUserRequestFieldNames; + if (hasPeerId) { + output.WriteMessage(1, field_names[3], PeerId); + } + if (hasGameAccountId) { + output.WriteMessage(2, field_names[2], GameAccountId); + } + if (challenges_.Count > 0) { + output.WriteMessageArray(3, field_names[0], challenges_); + } + if (hasContext) { + output.WriteFixed32(4, field_names[1], Context); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasPeerId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, PeerId); + } + if (hasGameAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, GameAccountId); + } + foreach (global::bnet.protocol.challenge.Challenge element in ChallengesList) { + size += pb::CodedOutputStream.ComputeMessageSize(3, element); + } + if (hasContext) { + size += pb::CodedOutputStream.ComputeFixed32Size(4, Context); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static SendChallengeToUserRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SendChallengeToUserRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SendChallengeToUserRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SendChallengeToUserRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SendChallengeToUserRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SendChallengeToUserRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SendChallengeToUserRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SendChallengeToUserRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SendChallengeToUserRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SendChallengeToUserRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SendChallengeToUserRequest MakeReadOnly() { + challenges_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SendChallengeToUserRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SendChallengeToUserRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SendChallengeToUserRequest result; + + private SendChallengeToUserRequest PrepareBuilder() { + if (resultIsReadOnly) { + SendChallengeToUserRequest original = result; + result = new SendChallengeToUserRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SendChallengeToUserRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.challenge.SendChallengeToUserRequest.Descriptor; } + } + + public override SendChallengeToUserRequest DefaultInstanceForType { + get { return global::bnet.protocol.challenge.SendChallengeToUserRequest.DefaultInstance; } + } + + public override SendChallengeToUserRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SendChallengeToUserRequest) { + return MergeFrom((SendChallengeToUserRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SendChallengeToUserRequest other) { + if (other == global::bnet.protocol.challenge.SendChallengeToUserRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasPeerId) { + MergePeerId(other.PeerId); + } + if (other.HasGameAccountId) { + MergeGameAccountId(other.GameAccountId); + } + if (other.challenges_.Count != 0) { + result.challenges_.Add(other.challenges_); + } + if (other.HasContext) { + Context = other.Context; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_sendChallengeToUserRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _sendChallengeToUserRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.ProcessId.Builder subBuilder = global::bnet.protocol.ProcessId.CreateBuilder(); + if (result.hasPeerId) { + subBuilder.MergeFrom(PeerId); + } + input.ReadMessage(subBuilder, extensionRegistry); + PeerId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasGameAccountId) { + subBuilder.MergeFrom(GameAccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + GameAccountId = subBuilder.BuildPartial(); + break; + } + case 26: { + input.ReadMessageArray(tag, field_name, result.challenges_, global::bnet.protocol.challenge.Challenge.DefaultInstance, extensionRegistry); + break; + } + case 37: { + result.hasContext = input.ReadFixed32(ref result.context_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasPeerId { + get { return result.hasPeerId; } + } + public global::bnet.protocol.ProcessId PeerId { + get { return result.PeerId; } + set { SetPeerId(value); } + } + public Builder SetPeerId(global::bnet.protocol.ProcessId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPeerId = true; + result.peerId_ = value; + return this; + } + public Builder SetPeerId(global::bnet.protocol.ProcessId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPeerId = true; + result.peerId_ = builderForValue.Build(); + return this; + } + public Builder MergePeerId(global::bnet.protocol.ProcessId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasPeerId && + result.peerId_ != global::bnet.protocol.ProcessId.DefaultInstance) { + result.peerId_ = global::bnet.protocol.ProcessId.CreateBuilder(result.peerId_).MergeFrom(value).BuildPartial(); + } else { + result.peerId_ = value; + } + result.hasPeerId = true; + return this; + } + public Builder ClearPeerId() { + PrepareBuilder(); + result.hasPeerId = false; + result.peerId_ = null; + return this; + } + + public bool HasGameAccountId { + get { return result.hasGameAccountId; } + } + public global::bnet.protocol.EntityId GameAccountId { + get { return result.GameAccountId; } + set { SetGameAccountId(value); } + } + public Builder SetGameAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasGameAccountId = true; + result.gameAccountId_ = value; + return this; + } + public Builder SetGameAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasGameAccountId = true; + result.gameAccountId_ = builderForValue.Build(); + return this; + } + public Builder MergeGameAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasGameAccountId && + result.gameAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.gameAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccountId_).MergeFrom(value).BuildPartial(); + } else { + result.gameAccountId_ = value; + } + result.hasGameAccountId = true; + return this; + } + public Builder ClearGameAccountId() { + PrepareBuilder(); + result.hasGameAccountId = false; + result.gameAccountId_ = null; + return this; + } + + public pbc::IPopsicleList ChallengesList { + get { return PrepareBuilder().challenges_; } + } + public int ChallengesCount { + get { return result.ChallengesCount; } + } + public global::bnet.protocol.challenge.Challenge GetChallenges(int index) { + return result.GetChallenges(index); + } + public Builder SetChallenges(int index, global::bnet.protocol.challenge.Challenge value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.challenges_[index] = value; + return this; + } + public Builder SetChallenges(int index, global::bnet.protocol.challenge.Challenge.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.challenges_[index] = builderForValue.Build(); + return this; + } + public Builder AddChallenges(global::bnet.protocol.challenge.Challenge value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.challenges_.Add(value); + return this; + } + public Builder AddChallenges(global::bnet.protocol.challenge.Challenge.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.challenges_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeChallenges(scg::IEnumerable values) { + PrepareBuilder(); + result.challenges_.Add(values); + return this; + } + public Builder ClearChallenges() { + PrepareBuilder(); + result.challenges_.Clear(); + return this; + } + + public bool HasContext { + get { return result.hasContext; } + } + public uint Context { + get { return result.Context; } + set { SetContext(value); } + } + public Builder SetContext(uint value) { + PrepareBuilder(); + result.hasContext = true; + result.context_ = value; + return this; + } + public Builder ClearContext() { + PrepareBuilder(); + result.hasContext = false; + result.context_ = 0; + return this; + } + } + static SendChallengeToUserRequest() { + object.ReferenceEquals(global::bnet.protocol.challenge.Proto.ChallengeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class SendChallengeToUserResponse : pb::GeneratedMessage { + private SendChallengeToUserResponse() { } + private static readonly SendChallengeToUserResponse defaultInstance = new SendChallengeToUserResponse().MakeReadOnly(); + private static readonly string[] _sendChallengeToUserResponseFieldNames = new string[] { "challenge" }; + private static readonly uint[] _sendChallengeToUserResponseFieldTags = new uint[] { 10 }; + public static SendChallengeToUserResponse DefaultInstance { + get { return defaultInstance; } + } + + public override SendChallengeToUserResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SendChallengeToUserResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.challenge.Proto.ChallengeService.internal__static_bnet_protocol_challenge_SendChallengeToUserResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.challenge.Proto.ChallengeService.internal__static_bnet_protocol_challenge_SendChallengeToUserResponse__FieldAccessorTable; } + } + + public const int ChallengeFieldNumber = 1; + private bool hasChallenge; + private global::bnet.protocol.challenge.Challenge challenge_; + public bool HasChallenge { + get { return hasChallenge; } + } + public global::bnet.protocol.challenge.Challenge Challenge { + get { return challenge_ ?? global::bnet.protocol.challenge.Challenge.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasChallenge) return false; + if (!Challenge.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _sendChallengeToUserResponseFieldNames; + if (hasChallenge) { + output.WriteMessage(1, field_names[0], Challenge); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasChallenge) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Challenge); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static SendChallengeToUserResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SendChallengeToUserResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SendChallengeToUserResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SendChallengeToUserResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SendChallengeToUserResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SendChallengeToUserResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SendChallengeToUserResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SendChallengeToUserResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SendChallengeToUserResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SendChallengeToUserResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SendChallengeToUserResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SendChallengeToUserResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SendChallengeToUserResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SendChallengeToUserResponse result; + + private SendChallengeToUserResponse PrepareBuilder() { + if (resultIsReadOnly) { + SendChallengeToUserResponse original = result; + result = new SendChallengeToUserResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SendChallengeToUserResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.challenge.SendChallengeToUserResponse.Descriptor; } + } + + public override SendChallengeToUserResponse DefaultInstanceForType { + get { return global::bnet.protocol.challenge.SendChallengeToUserResponse.DefaultInstance; } + } + + public override SendChallengeToUserResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SendChallengeToUserResponse) { + return MergeFrom((SendChallengeToUserResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SendChallengeToUserResponse other) { + if (other == global::bnet.protocol.challenge.SendChallengeToUserResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasChallenge) { + MergeChallenge(other.Challenge); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_sendChallengeToUserResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _sendChallengeToUserResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.challenge.Challenge.Builder subBuilder = global::bnet.protocol.challenge.Challenge.CreateBuilder(); + if (result.hasChallenge) { + subBuilder.MergeFrom(Challenge); + } + input.ReadMessage(subBuilder, extensionRegistry); + Challenge = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasChallenge { + get { return result.hasChallenge; } + } + public global::bnet.protocol.challenge.Challenge Challenge { + get { return result.Challenge; } + set { SetChallenge(value); } + } + public Builder SetChallenge(global::bnet.protocol.challenge.Challenge value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasChallenge = true; + result.challenge_ = value; + return this; + } + public Builder SetChallenge(global::bnet.protocol.challenge.Challenge.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasChallenge = true; + result.challenge_ = builderForValue.Build(); + return this; + } + public Builder MergeChallenge(global::bnet.protocol.challenge.Challenge value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasChallenge && + result.challenge_ != global::bnet.protocol.challenge.Challenge.DefaultInstance) { + result.challenge_ = global::bnet.protocol.challenge.Challenge.CreateBuilder(result.challenge_).MergeFrom(value).BuildPartial(); + } else { + result.challenge_ = value; + } + result.hasChallenge = true; + return this; + } + public Builder ClearChallenge() { + PrepareBuilder(); + result.hasChallenge = false; + result.challenge_ = null; + return this; + } + } + static SendChallengeToUserResponse() { + object.ReferenceEquals(global::bnet.protocol.challenge.Proto.ChallengeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ChallengeUserRequest : pb::GeneratedMessage { + private ChallengeUserRequest() { } + private static readonly ChallengeUserRequest defaultInstance = new ChallengeUserRequest().MakeReadOnly(); + private static readonly string[] _challengeUserRequestFieldNames = new string[] { "challenges", "context" }; + private static readonly uint[] _challengeUserRequestFieldTags = new uint[] { 10, 21 }; + public static ChallengeUserRequest DefaultInstance { + get { return defaultInstance; } + } + + public override ChallengeUserRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ChallengeUserRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.challenge.Proto.ChallengeService.internal__static_bnet_protocol_challenge_ChallengeUserRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.challenge.Proto.ChallengeService.internal__static_bnet_protocol_challenge_ChallengeUserRequest__FieldAccessorTable; } + } + + public const int ChallengesFieldNumber = 1; + private pbc::PopsicleList challenges_ = new pbc::PopsicleList(); + public scg::IList ChallengesList { + get { return challenges_; } + } + public int ChallengesCount { + get { return challenges_.Count; } + } + public global::bnet.protocol.challenge.Challenge GetChallenges(int index) { + return challenges_[index]; + } + + public const int ContextFieldNumber = 2; + private bool hasContext; + private uint context_; + public bool HasContext { + get { return hasContext; } + } + public uint Context { + get { return context_; } + } + + public override bool IsInitialized { + get { + if (!hasContext) return false; + foreach (global::bnet.protocol.challenge.Challenge element in ChallengesList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _challengeUserRequestFieldNames; + if (challenges_.Count > 0) { + output.WriteMessageArray(1, field_names[0], challenges_); + } + if (hasContext) { + output.WriteFixed32(2, field_names[1], Context); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.challenge.Challenge element in ChallengesList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + if (hasContext) { + size += pb::CodedOutputStream.ComputeFixed32Size(2, Context); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ChallengeUserRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ChallengeUserRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ChallengeUserRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ChallengeUserRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ChallengeUserRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ChallengeUserRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ChallengeUserRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ChallengeUserRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ChallengeUserRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ChallengeUserRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ChallengeUserRequest MakeReadOnly() { + challenges_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ChallengeUserRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ChallengeUserRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ChallengeUserRequest result; + + private ChallengeUserRequest PrepareBuilder() { + if (resultIsReadOnly) { + ChallengeUserRequest original = result; + result = new ChallengeUserRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ChallengeUserRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.challenge.ChallengeUserRequest.Descriptor; } + } + + public override ChallengeUserRequest DefaultInstanceForType { + get { return global::bnet.protocol.challenge.ChallengeUserRequest.DefaultInstance; } + } + + public override ChallengeUserRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ChallengeUserRequest) { + return MergeFrom((ChallengeUserRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ChallengeUserRequest other) { + if (other == global::bnet.protocol.challenge.ChallengeUserRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.challenges_.Count != 0) { + result.challenges_.Add(other.challenges_); + } + if (other.HasContext) { + Context = other.Context; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_challengeUserRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _challengeUserRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.challenges_, global::bnet.protocol.challenge.Challenge.DefaultInstance, extensionRegistry); + break; + } + case 21: { + result.hasContext = input.ReadFixed32(ref result.context_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList ChallengesList { + get { return PrepareBuilder().challenges_; } + } + public int ChallengesCount { + get { return result.ChallengesCount; } + } + public global::bnet.protocol.challenge.Challenge GetChallenges(int index) { + return result.GetChallenges(index); + } + public Builder SetChallenges(int index, global::bnet.protocol.challenge.Challenge value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.challenges_[index] = value; + return this; + } + public Builder SetChallenges(int index, global::bnet.protocol.challenge.Challenge.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.challenges_[index] = builderForValue.Build(); + return this; + } + public Builder AddChallenges(global::bnet.protocol.challenge.Challenge value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.challenges_.Add(value); + return this; + } + public Builder AddChallenges(global::bnet.protocol.challenge.Challenge.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.challenges_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeChallenges(scg::IEnumerable values) { + PrepareBuilder(); + result.challenges_.Add(values); + return this; + } + public Builder ClearChallenges() { + PrepareBuilder(); + result.challenges_.Clear(); + return this; + } + + public bool HasContext { + get { return result.hasContext; } + } + public uint Context { + get { return result.Context; } + set { SetContext(value); } + } + public Builder SetContext(uint value) { + PrepareBuilder(); + result.hasContext = true; + result.context_ = value; + return this; + } + public Builder ClearContext() { + PrepareBuilder(); + result.hasContext = false; + result.context_ = 0; + return this; + } + } + static ChallengeUserRequest() { + object.ReferenceEquals(global::bnet.protocol.challenge.Proto.ChallengeService.Descriptor, null); + } + } + + #endregion + + #region Services + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public abstract class ChallengeService : pb::IService { + public abstract void ChallengePicked( + pb::IRpcController controller, + global::bnet.protocol.challenge.ChallengePickedRequest request, + global::System.Action done); + public abstract void ChallengeAnswered( + pb::IRpcController controller, + global::bnet.protocol.challenge.ChallengeAnsweredRequest request, + global::System.Action done); + public abstract void ChallengeCancelled( + pb::IRpcController controller, + global::bnet.protocol.NoData request, + global::System.Action done); + public abstract void SendChallengeToUser( + pb::IRpcController controller, + global::bnet.protocol.challenge.SendChallengeToUserRequest request, + global::System.Action done); + + public static pbd::ServiceDescriptor Descriptor { + get { return Proto.ChallengeService.Descriptor.Services[0]; } + } + public pbd::ServiceDescriptor DescriptorForType { + get { return Descriptor; } + } + + public void CallMethod( + pbd::MethodDescriptor method, + pb::IRpcController controller, + pb::IMessage request, + global::System.Action done) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.CallMethod() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + this.ChallengePicked(controller, (global::bnet.protocol.challenge.ChallengePickedRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 1: + this.ChallengeAnswered(controller, (global::bnet.protocol.challenge.ChallengeAnsweredRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 2: + this.ChallengeCancelled(controller, (global::bnet.protocol.NoData) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 3: + this.SendChallengeToUser(controller, (global::bnet.protocol.challenge.SendChallengeToUserRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetRequestPrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.challenge.ChallengePickedRequest.DefaultInstance; + case 1: + return global::bnet.protocol.challenge.ChallengeAnsweredRequest.DefaultInstance; + case 2: + return global::bnet.protocol.NoData.DefaultInstance; + case 3: + return global::bnet.protocol.challenge.SendChallengeToUserRequest.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetResponsePrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.NO_RESPONSE.DefaultInstance; + case 1: + return global::bnet.protocol.NoData.DefaultInstance; + case 2: + return global::bnet.protocol.NO_RESPONSE.DefaultInstance; + case 3: + return global::bnet.protocol.challenge.SendChallengeToUserResponse.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public static Stub CreateStub(pb::IRpcChannel channel) { + return new Stub(channel); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public class Stub : global::bnet.protocol.challenge.ChallengeService { + internal Stub(pb::IRpcChannel channel) { + this.channel = channel; + } + + private readonly pb::IRpcChannel channel; + + public pb::IRpcChannel Channel { + get { return channel; } + } + + public override void ChallengePicked( + pb::IRpcController controller, + global::bnet.protocol.challenge.ChallengePickedRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[0], + controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); + } + + public override void ChallengeAnswered( + pb::IRpcController controller, + global::bnet.protocol.challenge.ChallengeAnsweredRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[1], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void ChallengeCancelled( + pb::IRpcController controller, + global::bnet.protocol.NoData request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[2], + controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); + } + + public override void SendChallengeToUser( + pb::IRpcController controller, + global::bnet.protocol.challenge.SendChallengeToUserRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[3], + controller, request, global::bnet.protocol.challenge.SendChallengeToUserResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.challenge.SendChallengeToUserResponse.DefaultInstance)); + } + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public abstract class ChallengeNotify : pb::IService { + public abstract void ChallengeUser( + pb::IRpcController controller, + global::bnet.protocol.challenge.ChallengeUserRequest request, + global::System.Action done); + + public static pbd::ServiceDescriptor Descriptor { + get { return Proto.ChallengeService.Descriptor.Services[1]; } + } + public pbd::ServiceDescriptor DescriptorForType { + get { return Descriptor; } + } + + public void CallMethod( + pbd::MethodDescriptor method, + pb::IRpcController controller, + pb::IMessage request, + global::System.Action done) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.CallMethod() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + this.ChallengeUser(controller, (global::bnet.protocol.challenge.ChallengeUserRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetRequestPrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.challenge.ChallengeUserRequest.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetResponsePrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.NO_RESPONSE.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public static Stub CreateStub(pb::IRpcChannel channel) { + return new Stub(channel); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public class Stub : global::bnet.protocol.challenge.ChallengeNotify { + internal Stub(pb::IRpcChannel channel) { + this.channel = channel; + } + + private readonly pb::IRpcChannel channel; + + public pb::IRpcChannel Channel { + get { return channel; } + } + + public override void ChallengeUser( + pb::IRpcController controller, + global::bnet.protocol.challenge.ChallengeUserRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[0], + controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); + } + } + } + #endregion + +} + +#endregion Designer generated code diff --git a/src/LibMooNet/bnet/protocol/channel/ChannelOwner.cs b/src/LibMooNet/bnet/protocol/channel/ChannelOwner.cs new file mode 100644 index 00000000..20100b29 --- /dev/null +++ b/src/LibMooNet/bnet/protocol/channel/ChannelOwner.cs @@ -0,0 +1,4081 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace bnet.protocol.channel { + + namespace Proto { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class ChannelOwner { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_GetChannelIdRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_GetChannelIdRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_GetChannelIdResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_GetChannelIdResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_CreateChannelRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_CreateChannelRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_CreateChannelResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_CreateChannelResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_JoinChannelRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_JoinChannelRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_JoinChannelResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_JoinChannelResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_FindChannelRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_FindChannelRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_FindChannelResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_FindChannelResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_GetChannelInfoRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_GetChannelInfoRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_GetChannelInfoResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_GetChannelInfoResponse__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static ChannelOwner() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "ChhibmV0L2NoYW5uZWxfb3duZXIucHJvdG8SFWJuZXQucHJvdG9jb2wuY2hh" + + "bm5lbBoUYm5ldC9hdHRyaWJ1dGUucHJvdG8aEWJuZXQvZW50aXR5LnByb3Rv" + + "Gg5ibmV0L3JwYy5wcm90bxoYYm5ldC9jaGFubmVsX3R5cGVzLnByb3RvIhUK" + + "E0dldENoYW5uZWxJZFJlcXVlc3QiQwoUR2V0Q2hhbm5lbElkUmVzcG9uc2US" + + "KwoKY2hhbm5lbF9pZBgBIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQi" + + "/QEKFENyZWF0ZUNoYW5uZWxSZXF1ZXN0Ei8KDmFnZW50X2lkZW50aXR5GAEg" + + "ASgLMhcuYm5ldC5wcm90b2NvbC5JZGVudGl0eRI4CgxtZW1iZXJfc3RhdGUY" + + "AiABKAsyIi5ibmV0LnByb3RvY29sLmNoYW5uZWwuTWVtYmVyU3RhdGUSOgoN" + + "Y2hhbm5lbF9zdGF0ZRgDIAEoCzIjLmJuZXQucHJvdG9jb2wuY2hhbm5lbC5D" + + "aGFubmVsU3RhdGUSKwoKY2hhbm5lbF9pZBgEIAEoCzIXLmJuZXQucHJvdG9j" + + "b2wuRW50aXR5SWQSEQoJb2JqZWN0X2lkGAUgASgEIlcKFUNyZWF0ZUNoYW5u" + + "ZWxSZXNwb25zZRIRCglvYmplY3RfaWQYASACKAQSKwoKY2hhbm5lbF9pZBgC" + + "IAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQi8wEKEkpvaW5DaGFubmVs" + + "UmVxdWVzdBIvCg5hZ2VudF9pZGVudGl0eRgBIAEoCzIXLmJuZXQucHJvdG9j" + + "b2wuSWRlbnRpdHkSOAoMbWVtYmVyX3N0YXRlGAIgASgLMiIuYm5ldC5wcm90" + + "b2NvbC5jaGFubmVsLk1lbWJlclN0YXRlEisKCmNoYW5uZWxfaWQYAyACKAsy" + + "Fy5ibmV0LnByb3RvY29sLkVudGl0eUlkEhEKCW9iamVjdF9pZBgEIAIoBBIy" + + "ChFmcmllbmRfYWNjb3VudF9pZBgFIAMoCzIXLmJuZXQucHJvdG9jb2wuRW50" + + "aXR5SWQihwEKE0pvaW5DaGFubmVsUmVzcG9uc2USEQoJb2JqZWN0X2lkGAEg" + + "ASgEEigKGXJlcXVpcmVfZnJpZW5kX3ZhbGlkYXRpb24YAiABKAg6BWZhbHNl" + + "EjMKEnByaXZpbGVnZWRfYWNjb3VudBgDIAMoCzIXLmJuZXQucHJvdG9jb2wu" + + "RW50aXR5SWQigQEKEkZpbmRDaGFubmVsUmVxdWVzdBIvCg5hZ2VudF9pZGVu" + + "dGl0eRgBIAEoCzIXLmJuZXQucHJvdG9jb2wuSWRlbnRpdHkSOgoHb3B0aW9u" + + "cxgCIAIoCzIpLmJuZXQucHJvdG9jb2wuY2hhbm5lbC5GaW5kQ2hhbm5lbE9w" + + "dGlvbnMiUQoTRmluZENoYW5uZWxSZXNwb25zZRI6CgdjaGFubmVsGAEgAygL" + + "MikuYm5ldC5wcm90b2NvbC5jaGFubmVsLkNoYW5uZWxEZXNjcmlwdGlvbiJv" + + "ChVHZXRDaGFubmVsSW5mb1JlcXVlc3QSKQoIYWdlbnRfaWQYASABKAsyFy5i" + + "bmV0LnByb3RvY29sLkVudGl0eUlkEisKCmNoYW5uZWxfaWQYAiACKAsyFy5i" + + "bmV0LnByb3RvY29sLkVudGl0eUlkIlIKFkdldENoYW5uZWxJbmZvUmVzcG9u" + + "c2USOAoMY2hhbm5lbF9pbmZvGAEgASgLMiIuYm5ldC5wcm90b2NvbC5jaGFu" + + "bmVsLkNoYW5uZWxJbmZvMrwECgxDaGFubmVsT3duZXISbQoMR2V0Q2hhbm5l" + + "bElkEiouYm5ldC5wcm90b2NvbC5jaGFubmVsLkdldENoYW5uZWxJZFJlcXVl" + + "c3QaKy5ibmV0LnByb3RvY29sLmNoYW5uZWwuR2V0Q2hhbm5lbElkUmVzcG9u" + + "c2UiBIC1GAEScAoNQ3JlYXRlQ2hhbm5lbBIrLmJuZXQucHJvdG9jb2wuY2hh" + + "bm5lbC5DcmVhdGVDaGFubmVsUmVxdWVzdBosLmJuZXQucHJvdG9jb2wuY2hh" + + "bm5lbC5DcmVhdGVDaGFubmVsUmVzcG9uc2UiBIC1GAISagoLSm9pbkNoYW5u" + + "ZWwSKS5ibmV0LnByb3RvY29sLmNoYW5uZWwuSm9pbkNoYW5uZWxSZXF1ZXN0" + + "GiouYm5ldC5wcm90b2NvbC5jaGFubmVsLkpvaW5DaGFubmVsUmVzcG9uc2Ui" + + "BIC1GAMSagoLRmluZENoYW5uZWwSKS5ibmV0LnByb3RvY29sLmNoYW5uZWwu" + + "RmluZENoYW5uZWxSZXF1ZXN0GiouYm5ldC5wcm90b2NvbC5jaGFubmVsLkZp" + + "bmRDaGFubmVsUmVzcG9uc2UiBIC1GAQScwoOR2V0Q2hhbm5lbEluZm8SLC5i" + + "bmV0LnByb3RvY29sLmNoYW5uZWwuR2V0Q2hhbm5lbEluZm9SZXF1ZXN0Gi0u" + + "Ym5ldC5wcm90b2NvbC5jaGFubmVsLkdldENoYW5uZWxJbmZvUmVzcG9uc2Ui" + + "BIC1GAVCA4ABAA=="); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_bnet_protocol_channel_GetChannelIdRequest__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_channel_GetChannelIdRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_GetChannelIdRequest__Descriptor, + new string[] { }); + internal__static_bnet_protocol_channel_GetChannelIdResponse__Descriptor = Descriptor.MessageTypes[1]; + internal__static_bnet_protocol_channel_GetChannelIdResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_GetChannelIdResponse__Descriptor, + new string[] { "ChannelId", }); + internal__static_bnet_protocol_channel_CreateChannelRequest__Descriptor = Descriptor.MessageTypes[2]; + internal__static_bnet_protocol_channel_CreateChannelRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_CreateChannelRequest__Descriptor, + new string[] { "AgentIdentity", "MemberState", "ChannelState", "ChannelId", "ObjectId", }); + internal__static_bnet_protocol_channel_CreateChannelResponse__Descriptor = Descriptor.MessageTypes[3]; + internal__static_bnet_protocol_channel_CreateChannelResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_CreateChannelResponse__Descriptor, + new string[] { "ObjectId", "ChannelId", }); + internal__static_bnet_protocol_channel_JoinChannelRequest__Descriptor = Descriptor.MessageTypes[4]; + internal__static_bnet_protocol_channel_JoinChannelRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_JoinChannelRequest__Descriptor, + new string[] { "AgentIdentity", "MemberState", "ChannelId", "ObjectId", "FriendAccountId", }); + internal__static_bnet_protocol_channel_JoinChannelResponse__Descriptor = Descriptor.MessageTypes[5]; + internal__static_bnet_protocol_channel_JoinChannelResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_JoinChannelResponse__Descriptor, + new string[] { "ObjectId", "RequireFriendValidation", "PrivilegedAccount", }); + internal__static_bnet_protocol_channel_FindChannelRequest__Descriptor = Descriptor.MessageTypes[6]; + internal__static_bnet_protocol_channel_FindChannelRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_FindChannelRequest__Descriptor, + new string[] { "AgentIdentity", "Options", }); + internal__static_bnet_protocol_channel_FindChannelResponse__Descriptor = Descriptor.MessageTypes[7]; + internal__static_bnet_protocol_channel_FindChannelResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_FindChannelResponse__Descriptor, + new string[] { "Channel", }); + internal__static_bnet_protocol_channel_GetChannelInfoRequest__Descriptor = Descriptor.MessageTypes[8]; + internal__static_bnet_protocol_channel_GetChannelInfoRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_GetChannelInfoRequest__Descriptor, + new string[] { "AgentId", "ChannelId", }); + internal__static_bnet_protocol_channel_GetChannelInfoResponse__Descriptor = Descriptor.MessageTypes[9]; + internal__static_bnet_protocol_channel_GetChannelInfoResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_GetChannelInfoResponse__Descriptor, + new string[] { "ChannelInfo", }); + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + RegisterAllExtensions(registry); + global::bnet.protocol.attribute.Proto.Attribute.RegisterAllExtensions(registry); + global::bnet.protocol.Entity.RegisterAllExtensions(registry); + global::bnet.protocol.Rpc.RegisterAllExtensions(registry); + global::bnet.protocol.channel.ChannelTypes.RegisterAllExtensions(registry); + return registry; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::bnet.protocol.attribute.Proto.Attribute.Descriptor, + global::bnet.protocol.Entity.Descriptor, + global::bnet.protocol.Rpc.Descriptor, + global::bnet.protocol.channel.ChannelTypes.Descriptor, + }, assigner); + } + #endregion + + } + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetChannelIdRequest : pb::GeneratedMessage { + private GetChannelIdRequest() { } + private static readonly GetChannelIdRequest defaultInstance = new GetChannelIdRequest().MakeReadOnly(); + private static readonly string[] _getChannelIdRequestFieldNames = new string[] { }; + private static readonly uint[] _getChannelIdRequestFieldTags = new uint[] { }; + public static GetChannelIdRequest DefaultInstance { + get { return defaultInstance; } + } + + public override GetChannelIdRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetChannelIdRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.channel.Proto.ChannelOwner.internal__static_bnet_protocol_channel_GetChannelIdRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.channel.Proto.ChannelOwner.internal__static_bnet_protocol_channel_GetChannelIdRequest__FieldAccessorTable; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getChannelIdRequestFieldNames; + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetChannelIdRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetChannelIdRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetChannelIdRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetChannelIdRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetChannelIdRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetChannelIdRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetChannelIdRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetChannelIdRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetChannelIdRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetChannelIdRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetChannelIdRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetChannelIdRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetChannelIdRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetChannelIdRequest result; + + private GetChannelIdRequest PrepareBuilder() { + if (resultIsReadOnly) { + GetChannelIdRequest original = result; + result = new GetChannelIdRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetChannelIdRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.channel.GetChannelIdRequest.Descriptor; } + } + + public override GetChannelIdRequest DefaultInstanceForType { + get { return global::bnet.protocol.channel.GetChannelIdRequest.DefaultInstance; } + } + + public override GetChannelIdRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetChannelIdRequest) { + return MergeFrom((GetChannelIdRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetChannelIdRequest other) { + if (other == global::bnet.protocol.channel.GetChannelIdRequest.DefaultInstance) return this; + PrepareBuilder(); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getChannelIdRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getChannelIdRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + } + static GetChannelIdRequest() { + object.ReferenceEquals(global::bnet.protocol.channel.Proto.ChannelOwner.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetChannelIdResponse : pb::GeneratedMessage { + private GetChannelIdResponse() { } + private static readonly GetChannelIdResponse defaultInstance = new GetChannelIdResponse().MakeReadOnly(); + private static readonly string[] _getChannelIdResponseFieldNames = new string[] { "channel_id" }; + private static readonly uint[] _getChannelIdResponseFieldTags = new uint[] { 10 }; + public static GetChannelIdResponse DefaultInstance { + get { return defaultInstance; } + } + + public override GetChannelIdResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetChannelIdResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.channel.Proto.ChannelOwner.internal__static_bnet_protocol_channel_GetChannelIdResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.channel.Proto.ChannelOwner.internal__static_bnet_protocol_channel_GetChannelIdResponse__FieldAccessorTable; } + } + + public const int ChannelIdFieldNumber = 1; + private bool hasChannelId; + private global::bnet.protocol.EntityId channelId_; + public bool HasChannelId { + get { return hasChannelId; } + } + public global::bnet.protocol.EntityId ChannelId { + get { return channelId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (HasChannelId) { + if (!ChannelId.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getChannelIdResponseFieldNames; + if (hasChannelId) { + output.WriteMessage(1, field_names[0], ChannelId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasChannelId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, ChannelId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetChannelIdResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetChannelIdResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetChannelIdResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetChannelIdResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetChannelIdResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetChannelIdResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetChannelIdResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetChannelIdResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetChannelIdResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetChannelIdResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetChannelIdResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetChannelIdResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetChannelIdResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetChannelIdResponse result; + + private GetChannelIdResponse PrepareBuilder() { + if (resultIsReadOnly) { + GetChannelIdResponse original = result; + result = new GetChannelIdResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetChannelIdResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.channel.GetChannelIdResponse.Descriptor; } + } + + public override GetChannelIdResponse DefaultInstanceForType { + get { return global::bnet.protocol.channel.GetChannelIdResponse.DefaultInstance; } + } + + public override GetChannelIdResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetChannelIdResponse) { + return MergeFrom((GetChannelIdResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetChannelIdResponse other) { + if (other == global::bnet.protocol.channel.GetChannelIdResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasChannelId) { + MergeChannelId(other.ChannelId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getChannelIdResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getChannelIdResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasChannelId) { + subBuilder.MergeFrom(ChannelId); + } + input.ReadMessage(subBuilder, extensionRegistry); + ChannelId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasChannelId { + get { return result.hasChannelId; } + } + public global::bnet.protocol.EntityId ChannelId { + get { return result.ChannelId; } + set { SetChannelId(value); } + } + public Builder SetChannelId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasChannelId = true; + result.channelId_ = value; + return this; + } + public Builder SetChannelId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasChannelId = true; + result.channelId_ = builderForValue.Build(); + return this; + } + public Builder MergeChannelId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasChannelId && + result.channelId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.channelId_ = global::bnet.protocol.EntityId.CreateBuilder(result.channelId_).MergeFrom(value).BuildPartial(); + } else { + result.channelId_ = value; + } + result.hasChannelId = true; + return this; + } + public Builder ClearChannelId() { + PrepareBuilder(); + result.hasChannelId = false; + result.channelId_ = null; + return this; + } + } + static GetChannelIdResponse() { + object.ReferenceEquals(global::bnet.protocol.channel.Proto.ChannelOwner.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class CreateChannelRequest : pb::GeneratedMessage { + private CreateChannelRequest() { } + private static readonly CreateChannelRequest defaultInstance = new CreateChannelRequest().MakeReadOnly(); + private static readonly string[] _createChannelRequestFieldNames = new string[] { "agent_identity", "channel_id", "channel_state", "member_state", "object_id" }; + private static readonly uint[] _createChannelRequestFieldTags = new uint[] { 10, 34, 26, 18, 40 }; + public static CreateChannelRequest DefaultInstance { + get { return defaultInstance; } + } + + public override CreateChannelRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override CreateChannelRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.channel.Proto.ChannelOwner.internal__static_bnet_protocol_channel_CreateChannelRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.channel.Proto.ChannelOwner.internal__static_bnet_protocol_channel_CreateChannelRequest__FieldAccessorTable; } + } + + public const int AgentIdentityFieldNumber = 1; + private bool hasAgentIdentity; + private global::bnet.protocol.Identity agentIdentity_; + public bool HasAgentIdentity { + get { return hasAgentIdentity; } + } + public global::bnet.protocol.Identity AgentIdentity { + get { return agentIdentity_ ?? global::bnet.protocol.Identity.DefaultInstance; } + } + + public const int MemberStateFieldNumber = 2; + private bool hasMemberState; + private global::bnet.protocol.channel.MemberState memberState_; + public bool HasMemberState { + get { return hasMemberState; } + } + public global::bnet.protocol.channel.MemberState MemberState { + get { return memberState_ ?? global::bnet.protocol.channel.MemberState.DefaultInstance; } + } + + public const int ChannelStateFieldNumber = 3; + private bool hasChannelState; + private global::bnet.protocol.channel.ChannelState channelState_; + public bool HasChannelState { + get { return hasChannelState; } + } + public global::bnet.protocol.channel.ChannelState ChannelState { + get { return channelState_ ?? global::bnet.protocol.channel.ChannelState.DefaultInstance; } + } + + public const int ChannelIdFieldNumber = 4; + private bool hasChannelId; + private global::bnet.protocol.EntityId channelId_; + public bool HasChannelId { + get { return hasChannelId; } + } + public global::bnet.protocol.EntityId ChannelId { + get { return channelId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int ObjectIdFieldNumber = 5; + private bool hasObjectId; + private ulong objectId_; + public bool HasObjectId { + get { return hasObjectId; } + } + public ulong ObjectId { + get { return objectId_; } + } + + public override bool IsInitialized { + get { + if (HasAgentIdentity) { + if (!AgentIdentity.IsInitialized) return false; + } + if (HasMemberState) { + if (!MemberState.IsInitialized) return false; + } + if (HasChannelState) { + if (!ChannelState.IsInitialized) return false; + } + if (HasChannelId) { + if (!ChannelId.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _createChannelRequestFieldNames; + if (hasAgentIdentity) { + output.WriteMessage(1, field_names[0], AgentIdentity); + } + if (hasMemberState) { + output.WriteMessage(2, field_names[3], MemberState); + } + if (hasChannelState) { + output.WriteMessage(3, field_names[2], ChannelState); + } + if (hasChannelId) { + output.WriteMessage(4, field_names[1], ChannelId); + } + if (hasObjectId) { + output.WriteUInt64(5, field_names[4], ObjectId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAgentIdentity) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AgentIdentity); + } + if (hasMemberState) { + size += pb::CodedOutputStream.ComputeMessageSize(2, MemberState); + } + if (hasChannelState) { + size += pb::CodedOutputStream.ComputeMessageSize(3, ChannelState); + } + if (hasChannelId) { + size += pb::CodedOutputStream.ComputeMessageSize(4, ChannelId); + } + if (hasObjectId) { + size += pb::CodedOutputStream.ComputeUInt64Size(5, ObjectId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static CreateChannelRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CreateChannelRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CreateChannelRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CreateChannelRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CreateChannelRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CreateChannelRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static CreateChannelRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static CreateChannelRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static CreateChannelRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CreateChannelRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CreateChannelRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(CreateChannelRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CreateChannelRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CreateChannelRequest result; + + private CreateChannelRequest PrepareBuilder() { + if (resultIsReadOnly) { + CreateChannelRequest original = result; + result = new CreateChannelRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CreateChannelRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.channel.CreateChannelRequest.Descriptor; } + } + + public override CreateChannelRequest DefaultInstanceForType { + get { return global::bnet.protocol.channel.CreateChannelRequest.DefaultInstance; } + } + + public override CreateChannelRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is CreateChannelRequest) { + return MergeFrom((CreateChannelRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(CreateChannelRequest other) { + if (other == global::bnet.protocol.channel.CreateChannelRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAgentIdentity) { + MergeAgentIdentity(other.AgentIdentity); + } + if (other.HasMemberState) { + MergeMemberState(other.MemberState); + } + if (other.HasChannelState) { + MergeChannelState(other.ChannelState); + } + if (other.HasChannelId) { + MergeChannelId(other.ChannelId); + } + if (other.HasObjectId) { + ObjectId = other.ObjectId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_createChannelRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _createChannelRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.Identity.Builder subBuilder = global::bnet.protocol.Identity.CreateBuilder(); + if (result.hasAgentIdentity) { + subBuilder.MergeFrom(AgentIdentity); + } + input.ReadMessage(subBuilder, extensionRegistry); + AgentIdentity = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.channel.MemberState.Builder subBuilder = global::bnet.protocol.channel.MemberState.CreateBuilder(); + if (result.hasMemberState) { + subBuilder.MergeFrom(MemberState); + } + input.ReadMessage(subBuilder, extensionRegistry); + MemberState = subBuilder.BuildPartial(); + break; + } + case 26: { + global::bnet.protocol.channel.ChannelState.Builder subBuilder = global::bnet.protocol.channel.ChannelState.CreateBuilder(); + if (result.hasChannelState) { + subBuilder.MergeFrom(ChannelState); + } + input.ReadMessage(subBuilder, extensionRegistry); + ChannelState = subBuilder.BuildPartial(); + break; + } + case 34: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasChannelId) { + subBuilder.MergeFrom(ChannelId); + } + input.ReadMessage(subBuilder, extensionRegistry); + ChannelId = subBuilder.BuildPartial(); + break; + } + case 40: { + result.hasObjectId = input.ReadUInt64(ref result.objectId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAgentIdentity { + get { return result.hasAgentIdentity; } + } + public global::bnet.protocol.Identity AgentIdentity { + get { return result.AgentIdentity; } + set { SetAgentIdentity(value); } + } + public Builder SetAgentIdentity(global::bnet.protocol.Identity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAgentIdentity = true; + result.agentIdentity_ = value; + return this; + } + public Builder SetAgentIdentity(global::bnet.protocol.Identity.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAgentIdentity = true; + result.agentIdentity_ = builderForValue.Build(); + return this; + } + public Builder MergeAgentIdentity(global::bnet.protocol.Identity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAgentIdentity && + result.agentIdentity_ != global::bnet.protocol.Identity.DefaultInstance) { + result.agentIdentity_ = global::bnet.protocol.Identity.CreateBuilder(result.agentIdentity_).MergeFrom(value).BuildPartial(); + } else { + result.agentIdentity_ = value; + } + result.hasAgentIdentity = true; + return this; + } + public Builder ClearAgentIdentity() { + PrepareBuilder(); + result.hasAgentIdentity = false; + result.agentIdentity_ = null; + return this; + } + + public bool HasMemberState { + get { return result.hasMemberState; } + } + public global::bnet.protocol.channel.MemberState MemberState { + get { return result.MemberState; } + set { SetMemberState(value); } + } + public Builder SetMemberState(global::bnet.protocol.channel.MemberState value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasMemberState = true; + result.memberState_ = value; + return this; + } + public Builder SetMemberState(global::bnet.protocol.channel.MemberState.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasMemberState = true; + result.memberState_ = builderForValue.Build(); + return this; + } + public Builder MergeMemberState(global::bnet.protocol.channel.MemberState value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasMemberState && + result.memberState_ != global::bnet.protocol.channel.MemberState.DefaultInstance) { + result.memberState_ = global::bnet.protocol.channel.MemberState.CreateBuilder(result.memberState_).MergeFrom(value).BuildPartial(); + } else { + result.memberState_ = value; + } + result.hasMemberState = true; + return this; + } + public Builder ClearMemberState() { + PrepareBuilder(); + result.hasMemberState = false; + result.memberState_ = null; + return this; + } + + public bool HasChannelState { + get { return result.hasChannelState; } + } + public global::bnet.protocol.channel.ChannelState ChannelState { + get { return result.ChannelState; } + set { SetChannelState(value); } + } + public Builder SetChannelState(global::bnet.protocol.channel.ChannelState value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasChannelState = true; + result.channelState_ = value; + return this; + } + public Builder SetChannelState(global::bnet.protocol.channel.ChannelState.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasChannelState = true; + result.channelState_ = builderForValue.Build(); + return this; + } + public Builder MergeChannelState(global::bnet.protocol.channel.ChannelState value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasChannelState && + result.channelState_ != global::bnet.protocol.channel.ChannelState.DefaultInstance) { + result.channelState_ = global::bnet.protocol.channel.ChannelState.CreateBuilder(result.channelState_).MergeFrom(value).BuildPartial(); + } else { + result.channelState_ = value; + } + result.hasChannelState = true; + return this; + } + public Builder ClearChannelState() { + PrepareBuilder(); + result.hasChannelState = false; + result.channelState_ = null; + return this; + } + + public bool HasChannelId { + get { return result.hasChannelId; } + } + public global::bnet.protocol.EntityId ChannelId { + get { return result.ChannelId; } + set { SetChannelId(value); } + } + public Builder SetChannelId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasChannelId = true; + result.channelId_ = value; + return this; + } + public Builder SetChannelId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasChannelId = true; + result.channelId_ = builderForValue.Build(); + return this; + } + public Builder MergeChannelId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasChannelId && + result.channelId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.channelId_ = global::bnet.protocol.EntityId.CreateBuilder(result.channelId_).MergeFrom(value).BuildPartial(); + } else { + result.channelId_ = value; + } + result.hasChannelId = true; + return this; + } + public Builder ClearChannelId() { + PrepareBuilder(); + result.hasChannelId = false; + result.channelId_ = null; + return this; + } + + public bool HasObjectId { + get { return result.hasObjectId; } + } + public ulong ObjectId { + get { return result.ObjectId; } + set { SetObjectId(value); } + } + public Builder SetObjectId(ulong value) { + PrepareBuilder(); + result.hasObjectId = true; + result.objectId_ = value; + return this; + } + public Builder ClearObjectId() { + PrepareBuilder(); + result.hasObjectId = false; + result.objectId_ = 0UL; + return this; + } + } + static CreateChannelRequest() { + object.ReferenceEquals(global::bnet.protocol.channel.Proto.ChannelOwner.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class CreateChannelResponse : pb::GeneratedMessage { + private CreateChannelResponse() { } + private static readonly CreateChannelResponse defaultInstance = new CreateChannelResponse().MakeReadOnly(); + private static readonly string[] _createChannelResponseFieldNames = new string[] { "channel_id", "object_id" }; + private static readonly uint[] _createChannelResponseFieldTags = new uint[] { 18, 8 }; + public static CreateChannelResponse DefaultInstance { + get { return defaultInstance; } + } + + public override CreateChannelResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override CreateChannelResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.channel.Proto.ChannelOwner.internal__static_bnet_protocol_channel_CreateChannelResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.channel.Proto.ChannelOwner.internal__static_bnet_protocol_channel_CreateChannelResponse__FieldAccessorTable; } + } + + public const int ObjectIdFieldNumber = 1; + private bool hasObjectId; + private ulong objectId_; + public bool HasObjectId { + get { return hasObjectId; } + } + public ulong ObjectId { + get { return objectId_; } + } + + public const int ChannelIdFieldNumber = 2; + private bool hasChannelId; + private global::bnet.protocol.EntityId channelId_; + public bool HasChannelId { + get { return hasChannelId; } + } + public global::bnet.protocol.EntityId ChannelId { + get { return channelId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasObjectId) return false; + if (HasChannelId) { + if (!ChannelId.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _createChannelResponseFieldNames; + if (hasObjectId) { + output.WriteUInt64(1, field_names[1], ObjectId); + } + if (hasChannelId) { + output.WriteMessage(2, field_names[0], ChannelId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasObjectId) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, ObjectId); + } + if (hasChannelId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, ChannelId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static CreateChannelResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CreateChannelResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CreateChannelResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CreateChannelResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CreateChannelResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CreateChannelResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static CreateChannelResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static CreateChannelResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static CreateChannelResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CreateChannelResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CreateChannelResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(CreateChannelResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CreateChannelResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CreateChannelResponse result; + + private CreateChannelResponse PrepareBuilder() { + if (resultIsReadOnly) { + CreateChannelResponse original = result; + result = new CreateChannelResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CreateChannelResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.channel.CreateChannelResponse.Descriptor; } + } + + public override CreateChannelResponse DefaultInstanceForType { + get { return global::bnet.protocol.channel.CreateChannelResponse.DefaultInstance; } + } + + public override CreateChannelResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is CreateChannelResponse) { + return MergeFrom((CreateChannelResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(CreateChannelResponse other) { + if (other == global::bnet.protocol.channel.CreateChannelResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasObjectId) { + ObjectId = other.ObjectId; + } + if (other.HasChannelId) { + MergeChannelId(other.ChannelId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_createChannelResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _createChannelResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasObjectId = input.ReadUInt64(ref result.objectId_); + break; + } + case 18: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasChannelId) { + subBuilder.MergeFrom(ChannelId); + } + input.ReadMessage(subBuilder, extensionRegistry); + ChannelId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasObjectId { + get { return result.hasObjectId; } + } + public ulong ObjectId { + get { return result.ObjectId; } + set { SetObjectId(value); } + } + public Builder SetObjectId(ulong value) { + PrepareBuilder(); + result.hasObjectId = true; + result.objectId_ = value; + return this; + } + public Builder ClearObjectId() { + PrepareBuilder(); + result.hasObjectId = false; + result.objectId_ = 0UL; + return this; + } + + public bool HasChannelId { + get { return result.hasChannelId; } + } + public global::bnet.protocol.EntityId ChannelId { + get { return result.ChannelId; } + set { SetChannelId(value); } + } + public Builder SetChannelId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasChannelId = true; + result.channelId_ = value; + return this; + } + public Builder SetChannelId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasChannelId = true; + result.channelId_ = builderForValue.Build(); + return this; + } + public Builder MergeChannelId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasChannelId && + result.channelId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.channelId_ = global::bnet.protocol.EntityId.CreateBuilder(result.channelId_).MergeFrom(value).BuildPartial(); + } else { + result.channelId_ = value; + } + result.hasChannelId = true; + return this; + } + public Builder ClearChannelId() { + PrepareBuilder(); + result.hasChannelId = false; + result.channelId_ = null; + return this; + } + } + static CreateChannelResponse() { + object.ReferenceEquals(global::bnet.protocol.channel.Proto.ChannelOwner.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class JoinChannelRequest : pb::GeneratedMessage { + private JoinChannelRequest() { } + private static readonly JoinChannelRequest defaultInstance = new JoinChannelRequest().MakeReadOnly(); + private static readonly string[] _joinChannelRequestFieldNames = new string[] { "agent_identity", "channel_id", "friend_account_id", "member_state", "object_id" }; + private static readonly uint[] _joinChannelRequestFieldTags = new uint[] { 10, 26, 42, 18, 32 }; + public static JoinChannelRequest DefaultInstance { + get { return defaultInstance; } + } + + public override JoinChannelRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override JoinChannelRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.channel.Proto.ChannelOwner.internal__static_bnet_protocol_channel_JoinChannelRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.channel.Proto.ChannelOwner.internal__static_bnet_protocol_channel_JoinChannelRequest__FieldAccessorTable; } + } + + public const int AgentIdentityFieldNumber = 1; + private bool hasAgentIdentity; + private global::bnet.protocol.Identity agentIdentity_; + public bool HasAgentIdentity { + get { return hasAgentIdentity; } + } + public global::bnet.protocol.Identity AgentIdentity { + get { return agentIdentity_ ?? global::bnet.protocol.Identity.DefaultInstance; } + } + + public const int MemberStateFieldNumber = 2; + private bool hasMemberState; + private global::bnet.protocol.channel.MemberState memberState_; + public bool HasMemberState { + get { return hasMemberState; } + } + public global::bnet.protocol.channel.MemberState MemberState { + get { return memberState_ ?? global::bnet.protocol.channel.MemberState.DefaultInstance; } + } + + public const int ChannelIdFieldNumber = 3; + private bool hasChannelId; + private global::bnet.protocol.EntityId channelId_; + public bool HasChannelId { + get { return hasChannelId; } + } + public global::bnet.protocol.EntityId ChannelId { + get { return channelId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int ObjectIdFieldNumber = 4; + private bool hasObjectId; + private ulong objectId_; + public bool HasObjectId { + get { return hasObjectId; } + } + public ulong ObjectId { + get { return objectId_; } + } + + public const int FriendAccountIdFieldNumber = 5; + private pbc::PopsicleList friendAccountId_ = new pbc::PopsicleList(); + public scg::IList FriendAccountIdList { + get { return friendAccountId_; } + } + public int FriendAccountIdCount { + get { return friendAccountId_.Count; } + } + public global::bnet.protocol.EntityId GetFriendAccountId(int index) { + return friendAccountId_[index]; + } + + public override bool IsInitialized { + get { + if (!hasChannelId) return false; + if (!hasObjectId) return false; + if (HasAgentIdentity) { + if (!AgentIdentity.IsInitialized) return false; + } + if (HasMemberState) { + if (!MemberState.IsInitialized) return false; + } + if (!ChannelId.IsInitialized) return false; + foreach (global::bnet.protocol.EntityId element in FriendAccountIdList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _joinChannelRequestFieldNames; + if (hasAgentIdentity) { + output.WriteMessage(1, field_names[0], AgentIdentity); + } + if (hasMemberState) { + output.WriteMessage(2, field_names[3], MemberState); + } + if (hasChannelId) { + output.WriteMessage(3, field_names[1], ChannelId); + } + if (hasObjectId) { + output.WriteUInt64(4, field_names[4], ObjectId); + } + if (friendAccountId_.Count > 0) { + output.WriteMessageArray(5, field_names[2], friendAccountId_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAgentIdentity) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AgentIdentity); + } + if (hasMemberState) { + size += pb::CodedOutputStream.ComputeMessageSize(2, MemberState); + } + if (hasChannelId) { + size += pb::CodedOutputStream.ComputeMessageSize(3, ChannelId); + } + if (hasObjectId) { + size += pb::CodedOutputStream.ComputeUInt64Size(4, ObjectId); + } + foreach (global::bnet.protocol.EntityId element in FriendAccountIdList) { + size += pb::CodedOutputStream.ComputeMessageSize(5, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static JoinChannelRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static JoinChannelRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static JoinChannelRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static JoinChannelRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static JoinChannelRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static JoinChannelRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static JoinChannelRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static JoinChannelRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static JoinChannelRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static JoinChannelRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private JoinChannelRequest MakeReadOnly() { + friendAccountId_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(JoinChannelRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(JoinChannelRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private JoinChannelRequest result; + + private JoinChannelRequest PrepareBuilder() { + if (resultIsReadOnly) { + JoinChannelRequest original = result; + result = new JoinChannelRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override JoinChannelRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.channel.JoinChannelRequest.Descriptor; } + } + + public override JoinChannelRequest DefaultInstanceForType { + get { return global::bnet.protocol.channel.JoinChannelRequest.DefaultInstance; } + } + + public override JoinChannelRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is JoinChannelRequest) { + return MergeFrom((JoinChannelRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(JoinChannelRequest other) { + if (other == global::bnet.protocol.channel.JoinChannelRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAgentIdentity) { + MergeAgentIdentity(other.AgentIdentity); + } + if (other.HasMemberState) { + MergeMemberState(other.MemberState); + } + if (other.HasChannelId) { + MergeChannelId(other.ChannelId); + } + if (other.HasObjectId) { + ObjectId = other.ObjectId; + } + if (other.friendAccountId_.Count != 0) { + result.friendAccountId_.Add(other.friendAccountId_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_joinChannelRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _joinChannelRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.Identity.Builder subBuilder = global::bnet.protocol.Identity.CreateBuilder(); + if (result.hasAgentIdentity) { + subBuilder.MergeFrom(AgentIdentity); + } + input.ReadMessage(subBuilder, extensionRegistry); + AgentIdentity = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.channel.MemberState.Builder subBuilder = global::bnet.protocol.channel.MemberState.CreateBuilder(); + if (result.hasMemberState) { + subBuilder.MergeFrom(MemberState); + } + input.ReadMessage(subBuilder, extensionRegistry); + MemberState = subBuilder.BuildPartial(); + break; + } + case 26: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasChannelId) { + subBuilder.MergeFrom(ChannelId); + } + input.ReadMessage(subBuilder, extensionRegistry); + ChannelId = subBuilder.BuildPartial(); + break; + } + case 32: { + result.hasObjectId = input.ReadUInt64(ref result.objectId_); + break; + } + case 42: { + input.ReadMessageArray(tag, field_name, result.friendAccountId_, global::bnet.protocol.EntityId.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAgentIdentity { + get { return result.hasAgentIdentity; } + } + public global::bnet.protocol.Identity AgentIdentity { + get { return result.AgentIdentity; } + set { SetAgentIdentity(value); } + } + public Builder SetAgentIdentity(global::bnet.protocol.Identity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAgentIdentity = true; + result.agentIdentity_ = value; + return this; + } + public Builder SetAgentIdentity(global::bnet.protocol.Identity.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAgentIdentity = true; + result.agentIdentity_ = builderForValue.Build(); + return this; + } + public Builder MergeAgentIdentity(global::bnet.protocol.Identity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAgentIdentity && + result.agentIdentity_ != global::bnet.protocol.Identity.DefaultInstance) { + result.agentIdentity_ = global::bnet.protocol.Identity.CreateBuilder(result.agentIdentity_).MergeFrom(value).BuildPartial(); + } else { + result.agentIdentity_ = value; + } + result.hasAgentIdentity = true; + return this; + } + public Builder ClearAgentIdentity() { + PrepareBuilder(); + result.hasAgentIdentity = false; + result.agentIdentity_ = null; + return this; + } + + public bool HasMemberState { + get { return result.hasMemberState; } + } + public global::bnet.protocol.channel.MemberState MemberState { + get { return result.MemberState; } + set { SetMemberState(value); } + } + public Builder SetMemberState(global::bnet.protocol.channel.MemberState value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasMemberState = true; + result.memberState_ = value; + return this; + } + public Builder SetMemberState(global::bnet.protocol.channel.MemberState.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasMemberState = true; + result.memberState_ = builderForValue.Build(); + return this; + } + public Builder MergeMemberState(global::bnet.protocol.channel.MemberState value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasMemberState && + result.memberState_ != global::bnet.protocol.channel.MemberState.DefaultInstance) { + result.memberState_ = global::bnet.protocol.channel.MemberState.CreateBuilder(result.memberState_).MergeFrom(value).BuildPartial(); + } else { + result.memberState_ = value; + } + result.hasMemberState = true; + return this; + } + public Builder ClearMemberState() { + PrepareBuilder(); + result.hasMemberState = false; + result.memberState_ = null; + return this; + } + + public bool HasChannelId { + get { return result.hasChannelId; } + } + public global::bnet.protocol.EntityId ChannelId { + get { return result.ChannelId; } + set { SetChannelId(value); } + } + public Builder SetChannelId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasChannelId = true; + result.channelId_ = value; + return this; + } + public Builder SetChannelId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasChannelId = true; + result.channelId_ = builderForValue.Build(); + return this; + } + public Builder MergeChannelId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasChannelId && + result.channelId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.channelId_ = global::bnet.protocol.EntityId.CreateBuilder(result.channelId_).MergeFrom(value).BuildPartial(); + } else { + result.channelId_ = value; + } + result.hasChannelId = true; + return this; + } + public Builder ClearChannelId() { + PrepareBuilder(); + result.hasChannelId = false; + result.channelId_ = null; + return this; + } + + public bool HasObjectId { + get { return result.hasObjectId; } + } + public ulong ObjectId { + get { return result.ObjectId; } + set { SetObjectId(value); } + } + public Builder SetObjectId(ulong value) { + PrepareBuilder(); + result.hasObjectId = true; + result.objectId_ = value; + return this; + } + public Builder ClearObjectId() { + PrepareBuilder(); + result.hasObjectId = false; + result.objectId_ = 0UL; + return this; + } + + public pbc::IPopsicleList FriendAccountIdList { + get { return PrepareBuilder().friendAccountId_; } + } + public int FriendAccountIdCount { + get { return result.FriendAccountIdCount; } + } + public global::bnet.protocol.EntityId GetFriendAccountId(int index) { + return result.GetFriendAccountId(index); + } + public Builder SetFriendAccountId(int index, global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.friendAccountId_[index] = value; + return this; + } + public Builder SetFriendAccountId(int index, global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.friendAccountId_[index] = builderForValue.Build(); + return this; + } + public Builder AddFriendAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.friendAccountId_.Add(value); + return this; + } + public Builder AddFriendAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.friendAccountId_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeFriendAccountId(scg::IEnumerable values) { + PrepareBuilder(); + result.friendAccountId_.Add(values); + return this; + } + public Builder ClearFriendAccountId() { + PrepareBuilder(); + result.friendAccountId_.Clear(); + return this; + } + } + static JoinChannelRequest() { + object.ReferenceEquals(global::bnet.protocol.channel.Proto.ChannelOwner.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class JoinChannelResponse : pb::GeneratedMessage { + private JoinChannelResponse() { } + private static readonly JoinChannelResponse defaultInstance = new JoinChannelResponse().MakeReadOnly(); + private static readonly string[] _joinChannelResponseFieldNames = new string[] { "object_id", "privileged_account", "require_friend_validation" }; + private static readonly uint[] _joinChannelResponseFieldTags = new uint[] { 8, 26, 16 }; + public static JoinChannelResponse DefaultInstance { + get { return defaultInstance; } + } + + public override JoinChannelResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override JoinChannelResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.channel.Proto.ChannelOwner.internal__static_bnet_protocol_channel_JoinChannelResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.channel.Proto.ChannelOwner.internal__static_bnet_protocol_channel_JoinChannelResponse__FieldAccessorTable; } + } + + public const int ObjectIdFieldNumber = 1; + private bool hasObjectId; + private ulong objectId_; + public bool HasObjectId { + get { return hasObjectId; } + } + public ulong ObjectId { + get { return objectId_; } + } + + public const int RequireFriendValidationFieldNumber = 2; + private bool hasRequireFriendValidation; + private bool requireFriendValidation_; + public bool HasRequireFriendValidation { + get { return hasRequireFriendValidation; } + } + public bool RequireFriendValidation { + get { return requireFriendValidation_; } + } + + public const int PrivilegedAccountFieldNumber = 3; + private pbc::PopsicleList privilegedAccount_ = new pbc::PopsicleList(); + public scg::IList PrivilegedAccountList { + get { return privilegedAccount_; } + } + public int PrivilegedAccountCount { + get { return privilegedAccount_.Count; } + } + public global::bnet.protocol.EntityId GetPrivilegedAccount(int index) { + return privilegedAccount_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.EntityId element in PrivilegedAccountList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _joinChannelResponseFieldNames; + if (hasObjectId) { + output.WriteUInt64(1, field_names[0], ObjectId); + } + if (hasRequireFriendValidation) { + output.WriteBool(2, field_names[2], RequireFriendValidation); + } + if (privilegedAccount_.Count > 0) { + output.WriteMessageArray(3, field_names[1], privilegedAccount_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasObjectId) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, ObjectId); + } + if (hasRequireFriendValidation) { + size += pb::CodedOutputStream.ComputeBoolSize(2, RequireFriendValidation); + } + foreach (global::bnet.protocol.EntityId element in PrivilegedAccountList) { + size += pb::CodedOutputStream.ComputeMessageSize(3, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static JoinChannelResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static JoinChannelResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static JoinChannelResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static JoinChannelResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static JoinChannelResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static JoinChannelResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static JoinChannelResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static JoinChannelResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static JoinChannelResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static JoinChannelResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private JoinChannelResponse MakeReadOnly() { + privilegedAccount_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(JoinChannelResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(JoinChannelResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private JoinChannelResponse result; + + private JoinChannelResponse PrepareBuilder() { + if (resultIsReadOnly) { + JoinChannelResponse original = result; + result = new JoinChannelResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override JoinChannelResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.channel.JoinChannelResponse.Descriptor; } + } + + public override JoinChannelResponse DefaultInstanceForType { + get { return global::bnet.protocol.channel.JoinChannelResponse.DefaultInstance; } + } + + public override JoinChannelResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is JoinChannelResponse) { + return MergeFrom((JoinChannelResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(JoinChannelResponse other) { + if (other == global::bnet.protocol.channel.JoinChannelResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasObjectId) { + ObjectId = other.ObjectId; + } + if (other.HasRequireFriendValidation) { + RequireFriendValidation = other.RequireFriendValidation; + } + if (other.privilegedAccount_.Count != 0) { + result.privilegedAccount_.Add(other.privilegedAccount_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_joinChannelResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _joinChannelResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasObjectId = input.ReadUInt64(ref result.objectId_); + break; + } + case 16: { + result.hasRequireFriendValidation = input.ReadBool(ref result.requireFriendValidation_); + break; + } + case 26: { + input.ReadMessageArray(tag, field_name, result.privilegedAccount_, global::bnet.protocol.EntityId.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasObjectId { + get { return result.hasObjectId; } + } + public ulong ObjectId { + get { return result.ObjectId; } + set { SetObjectId(value); } + } + public Builder SetObjectId(ulong value) { + PrepareBuilder(); + result.hasObjectId = true; + result.objectId_ = value; + return this; + } + public Builder ClearObjectId() { + PrepareBuilder(); + result.hasObjectId = false; + result.objectId_ = 0UL; + return this; + } + + public bool HasRequireFriendValidation { + get { return result.hasRequireFriendValidation; } + } + public bool RequireFriendValidation { + get { return result.RequireFriendValidation; } + set { SetRequireFriendValidation(value); } + } + public Builder SetRequireFriendValidation(bool value) { + PrepareBuilder(); + result.hasRequireFriendValidation = true; + result.requireFriendValidation_ = value; + return this; + } + public Builder ClearRequireFriendValidation() { + PrepareBuilder(); + result.hasRequireFriendValidation = false; + result.requireFriendValidation_ = false; + return this; + } + + public pbc::IPopsicleList PrivilegedAccountList { + get { return PrepareBuilder().privilegedAccount_; } + } + public int PrivilegedAccountCount { + get { return result.PrivilegedAccountCount; } + } + public global::bnet.protocol.EntityId GetPrivilegedAccount(int index) { + return result.GetPrivilegedAccount(index); + } + public Builder SetPrivilegedAccount(int index, global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.privilegedAccount_[index] = value; + return this; + } + public Builder SetPrivilegedAccount(int index, global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.privilegedAccount_[index] = builderForValue.Build(); + return this; + } + public Builder AddPrivilegedAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.privilegedAccount_.Add(value); + return this; + } + public Builder AddPrivilegedAccount(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.privilegedAccount_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangePrivilegedAccount(scg::IEnumerable values) { + PrepareBuilder(); + result.privilegedAccount_.Add(values); + return this; + } + public Builder ClearPrivilegedAccount() { + PrepareBuilder(); + result.privilegedAccount_.Clear(); + return this; + } + } + static JoinChannelResponse() { + object.ReferenceEquals(global::bnet.protocol.channel.Proto.ChannelOwner.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class FindChannelRequest : pb::GeneratedMessage { + private FindChannelRequest() { } + private static readonly FindChannelRequest defaultInstance = new FindChannelRequest().MakeReadOnly(); + private static readonly string[] _findChannelRequestFieldNames = new string[] { "agent_identity", "options" }; + private static readonly uint[] _findChannelRequestFieldTags = new uint[] { 10, 18 }; + public static FindChannelRequest DefaultInstance { + get { return defaultInstance; } + } + + public override FindChannelRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override FindChannelRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.channel.Proto.ChannelOwner.internal__static_bnet_protocol_channel_FindChannelRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.channel.Proto.ChannelOwner.internal__static_bnet_protocol_channel_FindChannelRequest__FieldAccessorTable; } + } + + public const int AgentIdentityFieldNumber = 1; + private bool hasAgentIdentity; + private global::bnet.protocol.Identity agentIdentity_; + public bool HasAgentIdentity { + get { return hasAgentIdentity; } + } + public global::bnet.protocol.Identity AgentIdentity { + get { return agentIdentity_ ?? global::bnet.protocol.Identity.DefaultInstance; } + } + + public const int OptionsFieldNumber = 2; + private bool hasOptions; + private global::bnet.protocol.channel.FindChannelOptions options_; + public bool HasOptions { + get { return hasOptions; } + } + public global::bnet.protocol.channel.FindChannelOptions Options { + get { return options_ ?? global::bnet.protocol.channel.FindChannelOptions.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasOptions) return false; + if (HasAgentIdentity) { + if (!AgentIdentity.IsInitialized) return false; + } + if (!Options.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _findChannelRequestFieldNames; + if (hasAgentIdentity) { + output.WriteMessage(1, field_names[0], AgentIdentity); + } + if (hasOptions) { + output.WriteMessage(2, field_names[1], Options); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAgentIdentity) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AgentIdentity); + } + if (hasOptions) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Options); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static FindChannelRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FindChannelRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FindChannelRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FindChannelRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FindChannelRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FindChannelRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static FindChannelRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static FindChannelRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static FindChannelRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FindChannelRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private FindChannelRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(FindChannelRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(FindChannelRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private FindChannelRequest result; + + private FindChannelRequest PrepareBuilder() { + if (resultIsReadOnly) { + FindChannelRequest original = result; + result = new FindChannelRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override FindChannelRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.channel.FindChannelRequest.Descriptor; } + } + + public override FindChannelRequest DefaultInstanceForType { + get { return global::bnet.protocol.channel.FindChannelRequest.DefaultInstance; } + } + + public override FindChannelRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is FindChannelRequest) { + return MergeFrom((FindChannelRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(FindChannelRequest other) { + if (other == global::bnet.protocol.channel.FindChannelRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAgentIdentity) { + MergeAgentIdentity(other.AgentIdentity); + } + if (other.HasOptions) { + MergeOptions(other.Options); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_findChannelRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _findChannelRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.Identity.Builder subBuilder = global::bnet.protocol.Identity.CreateBuilder(); + if (result.hasAgentIdentity) { + subBuilder.MergeFrom(AgentIdentity); + } + input.ReadMessage(subBuilder, extensionRegistry); + AgentIdentity = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.channel.FindChannelOptions.Builder subBuilder = global::bnet.protocol.channel.FindChannelOptions.CreateBuilder(); + if (result.hasOptions) { + subBuilder.MergeFrom(Options); + } + input.ReadMessage(subBuilder, extensionRegistry); + Options = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAgentIdentity { + get { return result.hasAgentIdentity; } + } + public global::bnet.protocol.Identity AgentIdentity { + get { return result.AgentIdentity; } + set { SetAgentIdentity(value); } + } + public Builder SetAgentIdentity(global::bnet.protocol.Identity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAgentIdentity = true; + result.agentIdentity_ = value; + return this; + } + public Builder SetAgentIdentity(global::bnet.protocol.Identity.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAgentIdentity = true; + result.agentIdentity_ = builderForValue.Build(); + return this; + } + public Builder MergeAgentIdentity(global::bnet.protocol.Identity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAgentIdentity && + result.agentIdentity_ != global::bnet.protocol.Identity.DefaultInstance) { + result.agentIdentity_ = global::bnet.protocol.Identity.CreateBuilder(result.agentIdentity_).MergeFrom(value).BuildPartial(); + } else { + result.agentIdentity_ = value; + } + result.hasAgentIdentity = true; + return this; + } + public Builder ClearAgentIdentity() { + PrepareBuilder(); + result.hasAgentIdentity = false; + result.agentIdentity_ = null; + return this; + } + + public bool HasOptions { + get { return result.hasOptions; } + } + public global::bnet.protocol.channel.FindChannelOptions Options { + get { return result.Options; } + set { SetOptions(value); } + } + public Builder SetOptions(global::bnet.protocol.channel.FindChannelOptions value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOptions = true; + result.options_ = value; + return this; + } + public Builder SetOptions(global::bnet.protocol.channel.FindChannelOptions.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOptions = true; + result.options_ = builderForValue.Build(); + return this; + } + public Builder MergeOptions(global::bnet.protocol.channel.FindChannelOptions value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOptions && + result.options_ != global::bnet.protocol.channel.FindChannelOptions.DefaultInstance) { + result.options_ = global::bnet.protocol.channel.FindChannelOptions.CreateBuilder(result.options_).MergeFrom(value).BuildPartial(); + } else { + result.options_ = value; + } + result.hasOptions = true; + return this; + } + public Builder ClearOptions() { + PrepareBuilder(); + result.hasOptions = false; + result.options_ = null; + return this; + } + } + static FindChannelRequest() { + object.ReferenceEquals(global::bnet.protocol.channel.Proto.ChannelOwner.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class FindChannelResponse : pb::GeneratedMessage { + private FindChannelResponse() { } + private static readonly FindChannelResponse defaultInstance = new FindChannelResponse().MakeReadOnly(); + private static readonly string[] _findChannelResponseFieldNames = new string[] { "channel" }; + private static readonly uint[] _findChannelResponseFieldTags = new uint[] { 10 }; + public static FindChannelResponse DefaultInstance { + get { return defaultInstance; } + } + + public override FindChannelResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override FindChannelResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.channel.Proto.ChannelOwner.internal__static_bnet_protocol_channel_FindChannelResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.channel.Proto.ChannelOwner.internal__static_bnet_protocol_channel_FindChannelResponse__FieldAccessorTable; } + } + + public const int ChannelFieldNumber = 1; + private pbc::PopsicleList channel_ = new pbc::PopsicleList(); + public scg::IList ChannelList { + get { return channel_; } + } + public int ChannelCount { + get { return channel_.Count; } + } + public global::bnet.protocol.channel.ChannelDescription GetChannel(int index) { + return channel_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.channel.ChannelDescription element in ChannelList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _findChannelResponseFieldNames; + if (channel_.Count > 0) { + output.WriteMessageArray(1, field_names[0], channel_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.channel.ChannelDescription element in ChannelList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static FindChannelResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FindChannelResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FindChannelResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FindChannelResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FindChannelResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FindChannelResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static FindChannelResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static FindChannelResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static FindChannelResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FindChannelResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private FindChannelResponse MakeReadOnly() { + channel_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(FindChannelResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(FindChannelResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private FindChannelResponse result; + + private FindChannelResponse PrepareBuilder() { + if (resultIsReadOnly) { + FindChannelResponse original = result; + result = new FindChannelResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override FindChannelResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.channel.FindChannelResponse.Descriptor; } + } + + public override FindChannelResponse DefaultInstanceForType { + get { return global::bnet.protocol.channel.FindChannelResponse.DefaultInstance; } + } + + public override FindChannelResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is FindChannelResponse) { + return MergeFrom((FindChannelResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(FindChannelResponse other) { + if (other == global::bnet.protocol.channel.FindChannelResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.channel_.Count != 0) { + result.channel_.Add(other.channel_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_findChannelResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _findChannelResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.channel_, global::bnet.protocol.channel.ChannelDescription.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList ChannelList { + get { return PrepareBuilder().channel_; } + } + public int ChannelCount { + get { return result.ChannelCount; } + } + public global::bnet.protocol.channel.ChannelDescription GetChannel(int index) { + return result.GetChannel(index); + } + public Builder SetChannel(int index, global::bnet.protocol.channel.ChannelDescription value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.channel_[index] = value; + return this; + } + public Builder SetChannel(int index, global::bnet.protocol.channel.ChannelDescription.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.channel_[index] = builderForValue.Build(); + return this; + } + public Builder AddChannel(global::bnet.protocol.channel.ChannelDescription value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.channel_.Add(value); + return this; + } + public Builder AddChannel(global::bnet.protocol.channel.ChannelDescription.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.channel_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeChannel(scg::IEnumerable values) { + PrepareBuilder(); + result.channel_.Add(values); + return this; + } + public Builder ClearChannel() { + PrepareBuilder(); + result.channel_.Clear(); + return this; + } + } + static FindChannelResponse() { + object.ReferenceEquals(global::bnet.protocol.channel.Proto.ChannelOwner.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetChannelInfoRequest : pb::GeneratedMessage { + private GetChannelInfoRequest() { } + private static readonly GetChannelInfoRequest defaultInstance = new GetChannelInfoRequest().MakeReadOnly(); + private static readonly string[] _getChannelInfoRequestFieldNames = new string[] { "agent_id", "channel_id" }; + private static readonly uint[] _getChannelInfoRequestFieldTags = new uint[] { 10, 18 }; + public static GetChannelInfoRequest DefaultInstance { + get { return defaultInstance; } + } + + public override GetChannelInfoRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetChannelInfoRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.channel.Proto.ChannelOwner.internal__static_bnet_protocol_channel_GetChannelInfoRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.channel.Proto.ChannelOwner.internal__static_bnet_protocol_channel_GetChannelInfoRequest__FieldAccessorTable; } + } + + public const int AgentIdFieldNumber = 1; + private bool hasAgentId; + private global::bnet.protocol.EntityId agentId_; + public bool HasAgentId { + get { return hasAgentId; } + } + public global::bnet.protocol.EntityId AgentId { + get { return agentId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int ChannelIdFieldNumber = 2; + private bool hasChannelId; + private global::bnet.protocol.EntityId channelId_; + public bool HasChannelId { + get { return hasChannelId; } + } + public global::bnet.protocol.EntityId ChannelId { + get { return channelId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasChannelId) return false; + if (HasAgentId) { + if (!AgentId.IsInitialized) return false; + } + if (!ChannelId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getChannelInfoRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); + } + if (hasChannelId) { + output.WriteMessage(2, field_names[1], ChannelId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAgentId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); + } + if (hasChannelId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, ChannelId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetChannelInfoRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetChannelInfoRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetChannelInfoRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetChannelInfoRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetChannelInfoRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetChannelInfoRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetChannelInfoRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetChannelInfoRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetChannelInfoRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetChannelInfoRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetChannelInfoRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetChannelInfoRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetChannelInfoRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetChannelInfoRequest result; + + private GetChannelInfoRequest PrepareBuilder() { + if (resultIsReadOnly) { + GetChannelInfoRequest original = result; + result = new GetChannelInfoRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetChannelInfoRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.channel.GetChannelInfoRequest.Descriptor; } + } + + public override GetChannelInfoRequest DefaultInstanceForType { + get { return global::bnet.protocol.channel.GetChannelInfoRequest.DefaultInstance; } + } + + public override GetChannelInfoRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetChannelInfoRequest) { + return MergeFrom((GetChannelInfoRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetChannelInfoRequest other) { + if (other == global::bnet.protocol.channel.GetChannelInfoRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAgentId) { + MergeAgentId(other.AgentId); + } + if (other.HasChannelId) { + MergeChannelId(other.ChannelId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getChannelInfoRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getChannelInfoRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasAgentId) { + subBuilder.MergeFrom(AgentId); + } + input.ReadMessage(subBuilder, extensionRegistry); + AgentId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasChannelId) { + subBuilder.MergeFrom(ChannelId); + } + input.ReadMessage(subBuilder, extensionRegistry); + ChannelId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAgentId { + get { return result.hasAgentId; } + } + public global::bnet.protocol.EntityId AgentId { + get { return result.AgentId; } + set { SetAgentId(value); } + } + public Builder SetAgentId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAgentId = true; + result.agentId_ = value; + return this; + } + public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAgentId = true; + result.agentId_ = builderForValue.Build(); + return this; + } + public Builder MergeAgentId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAgentId && + result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); + } else { + result.agentId_ = value; + } + result.hasAgentId = true; + return this; + } + public Builder ClearAgentId() { + PrepareBuilder(); + result.hasAgentId = false; + result.agentId_ = null; + return this; + } + + public bool HasChannelId { + get { return result.hasChannelId; } + } + public global::bnet.protocol.EntityId ChannelId { + get { return result.ChannelId; } + set { SetChannelId(value); } + } + public Builder SetChannelId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasChannelId = true; + result.channelId_ = value; + return this; + } + public Builder SetChannelId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasChannelId = true; + result.channelId_ = builderForValue.Build(); + return this; + } + public Builder MergeChannelId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasChannelId && + result.channelId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.channelId_ = global::bnet.protocol.EntityId.CreateBuilder(result.channelId_).MergeFrom(value).BuildPartial(); + } else { + result.channelId_ = value; + } + result.hasChannelId = true; + return this; + } + public Builder ClearChannelId() { + PrepareBuilder(); + result.hasChannelId = false; + result.channelId_ = null; + return this; + } + } + static GetChannelInfoRequest() { + object.ReferenceEquals(global::bnet.protocol.channel.Proto.ChannelOwner.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetChannelInfoResponse : pb::GeneratedMessage { + private GetChannelInfoResponse() { } + private static readonly GetChannelInfoResponse defaultInstance = new GetChannelInfoResponse().MakeReadOnly(); + private static readonly string[] _getChannelInfoResponseFieldNames = new string[] { "channel_info" }; + private static readonly uint[] _getChannelInfoResponseFieldTags = new uint[] { 10 }; + public static GetChannelInfoResponse DefaultInstance { + get { return defaultInstance; } + } + + public override GetChannelInfoResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetChannelInfoResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.channel.Proto.ChannelOwner.internal__static_bnet_protocol_channel_GetChannelInfoResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.channel.Proto.ChannelOwner.internal__static_bnet_protocol_channel_GetChannelInfoResponse__FieldAccessorTable; } + } + + public const int ChannelInfoFieldNumber = 1; + private bool hasChannelInfo; + private global::bnet.protocol.channel.ChannelInfo channelInfo_; + public bool HasChannelInfo { + get { return hasChannelInfo; } + } + public global::bnet.protocol.channel.ChannelInfo ChannelInfo { + get { return channelInfo_ ?? global::bnet.protocol.channel.ChannelInfo.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (HasChannelInfo) { + if (!ChannelInfo.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getChannelInfoResponseFieldNames; + if (hasChannelInfo) { + output.WriteMessage(1, field_names[0], ChannelInfo); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasChannelInfo) { + size += pb::CodedOutputStream.ComputeMessageSize(1, ChannelInfo); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetChannelInfoResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetChannelInfoResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetChannelInfoResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetChannelInfoResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetChannelInfoResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetChannelInfoResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetChannelInfoResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetChannelInfoResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetChannelInfoResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetChannelInfoResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetChannelInfoResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetChannelInfoResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetChannelInfoResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetChannelInfoResponse result; + + private GetChannelInfoResponse PrepareBuilder() { + if (resultIsReadOnly) { + GetChannelInfoResponse original = result; + result = new GetChannelInfoResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetChannelInfoResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.channel.GetChannelInfoResponse.Descriptor; } + } + + public override GetChannelInfoResponse DefaultInstanceForType { + get { return global::bnet.protocol.channel.GetChannelInfoResponse.DefaultInstance; } + } + + public override GetChannelInfoResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetChannelInfoResponse) { + return MergeFrom((GetChannelInfoResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetChannelInfoResponse other) { + if (other == global::bnet.protocol.channel.GetChannelInfoResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasChannelInfo) { + MergeChannelInfo(other.ChannelInfo); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getChannelInfoResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getChannelInfoResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.channel.ChannelInfo.Builder subBuilder = global::bnet.protocol.channel.ChannelInfo.CreateBuilder(); + if (result.hasChannelInfo) { + subBuilder.MergeFrom(ChannelInfo); + } + input.ReadMessage(subBuilder, extensionRegistry); + ChannelInfo = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasChannelInfo { + get { return result.hasChannelInfo; } + } + public global::bnet.protocol.channel.ChannelInfo ChannelInfo { + get { return result.ChannelInfo; } + set { SetChannelInfo(value); } + } + public Builder SetChannelInfo(global::bnet.protocol.channel.ChannelInfo value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasChannelInfo = true; + result.channelInfo_ = value; + return this; + } + public Builder SetChannelInfo(global::bnet.protocol.channel.ChannelInfo.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasChannelInfo = true; + result.channelInfo_ = builderForValue.Build(); + return this; + } + public Builder MergeChannelInfo(global::bnet.protocol.channel.ChannelInfo value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasChannelInfo && + result.channelInfo_ != global::bnet.protocol.channel.ChannelInfo.DefaultInstance) { + result.channelInfo_ = global::bnet.protocol.channel.ChannelInfo.CreateBuilder(result.channelInfo_).MergeFrom(value).BuildPartial(); + } else { + result.channelInfo_ = value; + } + result.hasChannelInfo = true; + return this; + } + public Builder ClearChannelInfo() { + PrepareBuilder(); + result.hasChannelInfo = false; + result.channelInfo_ = null; + return this; + } + } + static GetChannelInfoResponse() { + object.ReferenceEquals(global::bnet.protocol.channel.Proto.ChannelOwner.Descriptor, null); + } + } + + #endregion + + #region Services + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public abstract class ChannelOwner : pb::IService { + public abstract void GetChannelId( + pb::IRpcController controller, + global::bnet.protocol.channel.GetChannelIdRequest request, + global::System.Action done); + public abstract void CreateChannel( + pb::IRpcController controller, + global::bnet.protocol.channel.CreateChannelRequest request, + global::System.Action done); + public abstract void JoinChannel( + pb::IRpcController controller, + global::bnet.protocol.channel.JoinChannelRequest request, + global::System.Action done); + public abstract void FindChannel( + pb::IRpcController controller, + global::bnet.protocol.channel.FindChannelRequest request, + global::System.Action done); + public abstract void GetChannelInfo( + pb::IRpcController controller, + global::bnet.protocol.channel.GetChannelInfoRequest request, + global::System.Action done); + + public static pbd::ServiceDescriptor Descriptor { + get { return Proto.ChannelOwner.Descriptor.Services[0]; } + } + public pbd::ServiceDescriptor DescriptorForType { + get { return Descriptor; } + } + + public void CallMethod( + pbd::MethodDescriptor method, + pb::IRpcController controller, + pb::IMessage request, + global::System.Action done) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.CallMethod() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + this.GetChannelId(controller, (global::bnet.protocol.channel.GetChannelIdRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 1: + this.CreateChannel(controller, (global::bnet.protocol.channel.CreateChannelRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 2: + this.JoinChannel(controller, (global::bnet.protocol.channel.JoinChannelRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 3: + this.FindChannel(controller, (global::bnet.protocol.channel.FindChannelRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 4: + this.GetChannelInfo(controller, (global::bnet.protocol.channel.GetChannelInfoRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetRequestPrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.channel.GetChannelIdRequest.DefaultInstance; + case 1: + return global::bnet.protocol.channel.CreateChannelRequest.DefaultInstance; + case 2: + return global::bnet.protocol.channel.JoinChannelRequest.DefaultInstance; + case 3: + return global::bnet.protocol.channel.FindChannelRequest.DefaultInstance; + case 4: + return global::bnet.protocol.channel.GetChannelInfoRequest.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetResponsePrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.channel.GetChannelIdResponse.DefaultInstance; + case 1: + return global::bnet.protocol.channel.CreateChannelResponse.DefaultInstance; + case 2: + return global::bnet.protocol.channel.JoinChannelResponse.DefaultInstance; + case 3: + return global::bnet.protocol.channel.FindChannelResponse.DefaultInstance; + case 4: + return global::bnet.protocol.channel.GetChannelInfoResponse.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public static Stub CreateStub(pb::IRpcChannel channel) { + return new Stub(channel); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public class Stub : global::bnet.protocol.channel.ChannelOwner { + internal Stub(pb::IRpcChannel channel) { + this.channel = channel; + } + + private readonly pb::IRpcChannel channel; + + public pb::IRpcChannel Channel { + get { return channel; } + } + + public override void GetChannelId( + pb::IRpcController controller, + global::bnet.protocol.channel.GetChannelIdRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[0], + controller, request, global::bnet.protocol.channel.GetChannelIdResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.channel.GetChannelIdResponse.DefaultInstance)); + } + + public override void CreateChannel( + pb::IRpcController controller, + global::bnet.protocol.channel.CreateChannelRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[1], + controller, request, global::bnet.protocol.channel.CreateChannelResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.channel.CreateChannelResponse.DefaultInstance)); + } + + public override void JoinChannel( + pb::IRpcController controller, + global::bnet.protocol.channel.JoinChannelRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[2], + controller, request, global::bnet.protocol.channel.JoinChannelResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.channel.JoinChannelResponse.DefaultInstance)); + } + + public override void FindChannel( + pb::IRpcController controller, + global::bnet.protocol.channel.FindChannelRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[3], + controller, request, global::bnet.protocol.channel.FindChannelResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.channel.FindChannelResponse.DefaultInstance)); + } + + public override void GetChannelInfo( + pb::IRpcController controller, + global::bnet.protocol.channel.GetChannelInfoRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[4], + controller, request, global::bnet.protocol.channel.GetChannelInfoResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.channel.GetChannelInfoResponse.DefaultInstance)); + } + } + } + #endregion + +} + +#endregion Designer generated code diff --git a/source/D3Proto/bnet/protocol/channel/Channel.cs b/src/LibMooNet/bnet/protocol/channel/ChannelService.cs similarity index 63% rename from source/D3Proto/bnet/protocol/channel/Channel.cs rename to src/LibMooNet/bnet/protocol/channel/ChannelService.cs index af39c4c9..55d37eb2 100644 --- a/source/D3Proto/bnet/protocol/channel/Channel.cs +++ b/src/LibMooNet/bnet/protocol/channel/ChannelService.cs @@ -1,4 +1,6 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code using pb = global::Google.ProtocolBuffers; using pbc = global::Google.ProtocolBuffers.Collections; @@ -6,218 +8,219 @@ using scg = global::System.Collections.Generic; namespace bnet.protocol.channel { - namespace Proto { - - public static partial class Channel { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_AddMemberRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_AddMemberRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_RemoveMemberRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_RemoveMemberRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_SendMessageRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_SendMessageRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_UpdateChannelStateRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_UpdateChannelStateRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_UpdateMemberStateRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_UpdateMemberStateRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_DissolveRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_DissolveRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_SetRolesRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_SetRolesRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_AddNotification__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_AddNotification__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_JoinNotification__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_JoinNotification__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_RemoveNotification__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_RemoveNotification__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_LeaveNotification__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_LeaveNotification__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_SendMessageNotification__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_SendMessageNotification__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_UpdateChannelStateNotification__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_UpdateChannelStateNotification__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_UpdateMemberStateNotification__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_UpdateMemberStateNotification__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static Channel() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "CihzZXJ2aWNlL2NoYW5uZWwvZGVmaW5pdGlvbi9jaGFubmVsLnByb3RvEhVi" + - "bmV0LnByb3RvY29sLmNoYW5uZWwaHGxpYi9wcm90b2NvbC9hdHRyaWJ1dGUu" + - "cHJvdG8aGWxpYi9wcm90b2NvbC9lbnRpdHkucHJvdG8aEWxpYi9ycGMvcnBj" + - "LnByb3RvGiNzZXJ2aWNlL2NoYW5uZWwvY2hhbm5lbF90eXBlcy5wcm90byK1" + - "AQoQQWRkTWVtYmVyUmVxdWVzdBIpCghhZ2VudF9pZBgBIAEoCzIXLmJuZXQu" + - "cHJvdG9jb2wuRW50aXR5SWQSMAoPbWVtYmVyX2lkZW50aXR5GAIgAigLMhcu" + - "Ym5ldC5wcm90b2NvbC5JZGVudGl0eRIxCgVzdGF0ZRgDIAIoCzIiLmJuZXQu" + - "cHJvdG9jb2wuY2hhbm5lbC5NZW1iZXJTdGF0ZRIRCglvYmplY3RfaWQYBCAC" + - "KAQifAoTUmVtb3ZlTWVtYmVyUmVxdWVzdBIpCghhZ2VudF9pZBgBIAEoCzIX" + - "LmJuZXQucHJvdG9jb2wuRW50aXR5SWQSKgoJbWVtYmVyX2lkGAIgAigLMhcu" + - "Ym5ldC5wcm90b2NvbC5FbnRpdHlJZBIOCgZyZWFzb24YAyABKA0ikAEKElNl" + - "bmRNZXNzYWdlUmVxdWVzdBIpCghhZ2VudF9pZBgBIAEoCzIXLmJuZXQucHJv" + - "dG9jb2wuRW50aXR5SWQSLwoHbWVzc2FnZRgCIAIoCzIeLmJuZXQucHJvdG9j" + - "b2wuY2hhbm5lbC5NZXNzYWdlEh4KE3JlcXVpcmVkX3ByaXZpbGVnZXMYAyAB" + - "KAQ6ATAigQEKGVVwZGF0ZUNoYW5uZWxTdGF0ZVJlcXVlc3QSKQoIYWdlbnRf" + - "aWQYASABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEjkKDHN0YXRlX2No" + - "YW5nZRgCIAIoCzIjLmJuZXQucHJvdG9jb2wuY2hhbm5lbC5DaGFubmVsU3Rh" + - "dGUiegoYVXBkYXRlTWVtYmVyU3RhdGVSZXF1ZXN0EikKCGFnZW50X2lkGAEg" + - "ASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBIzCgxzdGF0ZV9jaGFuZ2UY" + - "AiADKAsyHS5ibmV0LnByb3RvY29sLmNoYW5uZWwuTWVtYmVyIkwKD0Rpc3Nv" + - "bHZlUmVxdWVzdBIpCghhZ2VudF9pZBgBIAEoCzIXLmJuZXQucHJvdG9jb2wu" + - "RW50aXR5SWQSDgoGcmVhc29uGAIgASgNInYKD1NldFJvbGVzUmVxdWVzdBIp" + - "CghhZ2VudF9pZBgBIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSDAoE" + - "cm9sZRgCIAMoDRIqCgltZW1iZXJfaWQYAyADKAsyFy5ibmV0LnByb3RvY29s" + - "LkVudGl0eUlkIqkBCg9BZGROb3RpZmljYXRpb24SKwoEc2VsZhgBIAEoCzId" + - "LmJuZXQucHJvdG9jb2wuY2hhbm5lbC5NZW1iZXISLQoGbWVtYmVyGAIgAygL" + - "Mh0uYm5ldC5wcm90b2NvbC5jaGFubmVsLk1lbWJlchI6Cg1jaGFubmVsX3N0" + - "YXRlGAMgAigLMiMuYm5ldC5wcm90b2NvbC5jaGFubmVsLkNoYW5uZWxTdGF0" + - "ZSJBChBKb2luTm90aWZpY2F0aW9uEi0KBm1lbWJlchgBIAIoCzIdLmJuZXQu" + - "cHJvdG9jb2wuY2hhbm5lbC5NZW1iZXIiewoSUmVtb3ZlTm90aWZpY2F0aW9u" + - "EikKCGFnZW50X2lkGAEgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBIq" + - "CgltZW1iZXJfaWQYAiACKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEg4K" + - "BnJlYXNvbhgDIAEoDSJqChFMZWF2ZU5vdGlmaWNhdGlvbhIpCghhZ2VudF9p" + - "ZBgBIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSKgoJbWVtYmVyX2lk" + - "GAIgAigLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZCKVAQoXU2VuZE1lc3Nh" + - "Z2VOb3RpZmljYXRpb24SKQoIYWdlbnRfaWQYASABKAsyFy5ibmV0LnByb3Rv" + - "Y29sLkVudGl0eUlkEi8KB21lc3NhZ2UYAiACKAsyHi5ibmV0LnByb3RvY29s" + - "LmNoYW5uZWwuTWVzc2FnZRIeChNyZXF1aXJlZF9wcml2aWxlZ2VzGAMgASgE" + - "OgEwIoYBCh5VcGRhdGVDaGFubmVsU3RhdGVOb3RpZmljYXRpb24SKQoIYWdl" + - "bnRfaWQYASABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEjkKDHN0YXRl" + - "X2NoYW5nZRgCIAIoCzIjLmJuZXQucHJvdG9jb2wuY2hhbm5lbC5DaGFubmVs" + - "U3RhdGUifwodVXBkYXRlTWVtYmVyU3RhdGVOb3RpZmljYXRpb24SKQoIYWdl" + - "bnRfaWQYASABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEjMKDHN0YXRl" + - "X2NoYW5nZRgCIAMoCzIdLmJuZXQucHJvdG9jb2wuY2hhbm5lbC5NZW1iZXIy" + - "zAQKB0NoYW5uZWwSSwoJQWRkTWVtYmVyEicuYm5ldC5wcm90b2NvbC5jaGFu" + - "bmVsLkFkZE1lbWJlclJlcXVlc3QaFS5ibmV0LnByb3RvY29sLk5vRGF0YRJR" + - "CgxSZW1vdmVNZW1iZXISKi5ibmV0LnByb3RvY29sLmNoYW5uZWwuUmVtb3Zl" + - "TWVtYmVyUmVxdWVzdBoVLmJuZXQucHJvdG9jb2wuTm9EYXRhEk8KC1NlbmRN" + - "ZXNzYWdlEikuYm5ldC5wcm90b2NvbC5jaGFubmVsLlNlbmRNZXNzYWdlUmVx" + - "dWVzdBoVLmJuZXQucHJvdG9jb2wuTm9EYXRhEl0KElVwZGF0ZUNoYW5uZWxT" + - "dGF0ZRIwLmJuZXQucHJvdG9jb2wuY2hhbm5lbC5VcGRhdGVDaGFubmVsU3Rh" + - "dGVSZXF1ZXN0GhUuYm5ldC5wcm90b2NvbC5Ob0RhdGESWwoRVXBkYXRlTWVt" + - "YmVyU3RhdGUSLy5ibmV0LnByb3RvY29sLmNoYW5uZWwuVXBkYXRlTWVtYmVy" + - "U3RhdGVSZXF1ZXN0GhUuYm5ldC5wcm90b2NvbC5Ob0RhdGESSQoIRGlzc29s" + - "dmUSJi5ibmV0LnByb3RvY29sLmNoYW5uZWwuRGlzc29sdmVSZXF1ZXN0GhUu" + - "Ym5ldC5wcm90b2NvbC5Ob0RhdGESSQoIU2V0Um9sZXMSJi5ibmV0LnByb3Rv" + - "Y29sLmNoYW5uZWwuU2V0Um9sZXNSZXF1ZXN0GhUuYm5ldC5wcm90b2NvbC5O" + - "b0RhdGEyngQKDENoYW5uZWxPd25lchJnCgxHZXRDaGFubmVsSWQSKi5ibmV0" + - "LnByb3RvY29sLmNoYW5uZWwuR2V0Q2hhbm5lbElkUmVxdWVzdBorLmJuZXQu" + - "cHJvdG9jb2wuY2hhbm5lbC5HZXRDaGFubmVsSWRSZXNwb25zZRJqCg1DcmVh" + - "dGVDaGFubmVsEisuYm5ldC5wcm90b2NvbC5jaGFubmVsLkNyZWF0ZUNoYW5u" + - "ZWxSZXF1ZXN0GiwuYm5ldC5wcm90b2NvbC5jaGFubmVsLkNyZWF0ZUNoYW5u" + - "ZWxSZXNwb25zZRJkCgtKb2luQ2hhbm5lbBIpLmJuZXQucHJvdG9jb2wuY2hh" + - "bm5lbC5Kb2luQ2hhbm5lbFJlcXVlc3QaKi5ibmV0LnByb3RvY29sLmNoYW5u" + - "ZWwuSm9pbkNoYW5uZWxSZXNwb25zZRJkCgtGaW5kQ2hhbm5lbBIpLmJuZXQu" + - "cHJvdG9jb2wuY2hhbm5lbC5GaW5kQ2hhbm5lbFJlcXVlc3QaKi5ibmV0LnBy" + - "b3RvY29sLmNoYW5uZWwuRmluZENoYW5uZWxSZXNwb25zZRJtCg5HZXRDaGFu" + - "bmVsSW5mbxIsLmJuZXQucHJvdG9jb2wuY2hhbm5lbC5HZXRDaGFubmVsSW5m" + - "b1JlcXVlc3QaLS5ibmV0LnByb3RvY29sLmNoYW5uZWwuR2V0Q2hhbm5lbElu" + - "Zm9SZXNwb25zZTKgBQoRQ2hhbm5lbFN1YnNjcmliZXISTwoJTm90aWZ5QWRk" + - "EiYuYm5ldC5wcm90b2NvbC5jaGFubmVsLkFkZE5vdGlmaWNhdGlvbhoaLmJu" + - "ZXQucHJvdG9jb2wuTk9fUkVTUE9OU0USUQoKTm90aWZ5Sm9pbhInLmJuZXQu" + - "cHJvdG9jb2wuY2hhbm5lbC5Kb2luTm90aWZpY2F0aW9uGhouYm5ldC5wcm90" + - "b2NvbC5OT19SRVNQT05TRRJVCgxOb3RpZnlSZW1vdmUSKS5ibmV0LnByb3Rv" + - "Y29sLmNoYW5uZWwuUmVtb3ZlTm90aWZpY2F0aW9uGhouYm5ldC5wcm90b2Nv" + - "bC5OT19SRVNQT05TRRJTCgtOb3RpZnlMZWF2ZRIoLmJuZXQucHJvdG9jb2wu" + - "Y2hhbm5lbC5MZWF2ZU5vdGlmaWNhdGlvbhoaLmJuZXQucHJvdG9jb2wuTk9f" + - "UkVTUE9OU0USXwoRTm90aWZ5U2VuZE1lc3NhZ2USLi5ibmV0LnByb3RvY29s" + - "LmNoYW5uZWwuU2VuZE1lc3NhZ2VOb3RpZmljYXRpb24aGi5ibmV0LnByb3Rv" + - "Y29sLk5PX1JFU1BPTlNFEm0KGE5vdGlmeVVwZGF0ZUNoYW5uZWxTdGF0ZRI1" + - "LmJuZXQucHJvdG9jb2wuY2hhbm5lbC5VcGRhdGVDaGFubmVsU3RhdGVOb3Rp" + - "ZmljYXRpb24aGi5ibmV0LnByb3RvY29sLk5PX1JFU1BPTlNFEmsKF05vdGlm" + - "eVVwZGF0ZU1lbWJlclN0YXRlEjQuYm5ldC5wcm90b2NvbC5jaGFubmVsLlVw" + - "ZGF0ZU1lbWJlclN0YXRlTm90aWZpY2F0aW9uGhouYm5ldC5wcm90b2NvbC5O" + - "T19SRVNQT05TRUINQghDQ2hhbm5lbIABAQ=="); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_bnet_protocol_channel_AddMemberRequest__Descriptor = Descriptor.MessageTypes[0]; - internal__static_bnet_protocol_channel_AddMemberRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_AddMemberRequest__Descriptor, - new string[] { "AgentId", "MemberIdentity", "State", "ObjectId", }); - internal__static_bnet_protocol_channel_RemoveMemberRequest__Descriptor = Descriptor.MessageTypes[1]; - internal__static_bnet_protocol_channel_RemoveMemberRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_RemoveMemberRequest__Descriptor, - new string[] { "AgentId", "MemberId", "Reason", }); - internal__static_bnet_protocol_channel_SendMessageRequest__Descriptor = Descriptor.MessageTypes[2]; - internal__static_bnet_protocol_channel_SendMessageRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_SendMessageRequest__Descriptor, - new string[] { "AgentId", "Message", "RequiredPrivileges", }); - internal__static_bnet_protocol_channel_UpdateChannelStateRequest__Descriptor = Descriptor.MessageTypes[3]; - internal__static_bnet_protocol_channel_UpdateChannelStateRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_UpdateChannelStateRequest__Descriptor, - new string[] { "AgentId", "StateChange", }); - internal__static_bnet_protocol_channel_UpdateMemberStateRequest__Descriptor = Descriptor.MessageTypes[4]; - internal__static_bnet_protocol_channel_UpdateMemberStateRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_UpdateMemberStateRequest__Descriptor, - new string[] { "AgentId", "StateChange", }); - internal__static_bnet_protocol_channel_DissolveRequest__Descriptor = Descriptor.MessageTypes[5]; - internal__static_bnet_protocol_channel_DissolveRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_DissolveRequest__Descriptor, - new string[] { "AgentId", "Reason", }); - internal__static_bnet_protocol_channel_SetRolesRequest__Descriptor = Descriptor.MessageTypes[6]; - internal__static_bnet_protocol_channel_SetRolesRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_SetRolesRequest__Descriptor, - new string[] { "AgentId", "Role", "MemberId", }); - internal__static_bnet_protocol_channel_AddNotification__Descriptor = Descriptor.MessageTypes[7]; - internal__static_bnet_protocol_channel_AddNotification__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_AddNotification__Descriptor, - new string[] { "Self", "Member", "ChannelState", }); - internal__static_bnet_protocol_channel_JoinNotification__Descriptor = Descriptor.MessageTypes[8]; - internal__static_bnet_protocol_channel_JoinNotification__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_JoinNotification__Descriptor, - new string[] { "Member", }); - internal__static_bnet_protocol_channel_RemoveNotification__Descriptor = Descriptor.MessageTypes[9]; - internal__static_bnet_protocol_channel_RemoveNotification__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_RemoveNotification__Descriptor, - new string[] { "AgentId", "MemberId", "Reason", }); - internal__static_bnet_protocol_channel_LeaveNotification__Descriptor = Descriptor.MessageTypes[10]; - internal__static_bnet_protocol_channel_LeaveNotification__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_LeaveNotification__Descriptor, - new string[] { "AgentId", "MemberId", }); - internal__static_bnet_protocol_channel_SendMessageNotification__Descriptor = Descriptor.MessageTypes[11]; - internal__static_bnet_protocol_channel_SendMessageNotification__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_SendMessageNotification__Descriptor, - new string[] { "AgentId", "Message", "RequiredPrivileges", }); - internal__static_bnet_protocol_channel_UpdateChannelStateNotification__Descriptor = Descriptor.MessageTypes[12]; - internal__static_bnet_protocol_channel_UpdateChannelStateNotification__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_UpdateChannelStateNotification__Descriptor, - new string[] { "AgentId", "StateChange", }); - internal__static_bnet_protocol_channel_UpdateMemberStateNotification__Descriptor = Descriptor.MessageTypes[13]; - internal__static_bnet_protocol_channel_UpdateMemberStateNotification__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_UpdateMemberStateNotification__Descriptor, - new string[] { "AgentId", "StateChange", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::bnet.protocol.attribute.Proto.Attribute.Descriptor, - global::bnet.protocol.Entity.Descriptor, - global::bnet.protocol.Rpc.Descriptor, - global::bnet.protocol.channel.ChannelTypes.Descriptor, - }, assigner); - } - #endregion - - } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class ChannelService { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_AddMemberRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_AddMemberRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_RemoveMemberRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_RemoveMemberRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_SendMessageRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_SendMessageRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_UpdateChannelStateRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_UpdateChannelStateRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_UpdateMemberStateRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_UpdateMemberStateRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_DissolveRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_DissolveRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_SetRolesRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_SetRolesRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_AddNotification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_AddNotification__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_JoinNotification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_JoinNotification__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_RemoveNotification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_RemoveNotification__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_LeaveNotification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_LeaveNotification__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_SendMessageNotification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_SendMessageNotification__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_UpdateChannelStateNotification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_UpdateChannelStateNotification__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_UpdateMemberStateNotification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_UpdateMemberStateNotification__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static ChannelService() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "ChpibmV0L2NoYW5uZWxfc2VydmljZS5wcm90bxIVYm5ldC5wcm90b2NvbC5j" + + "aGFubmVsGhRibmV0L2F0dHJpYnV0ZS5wcm90bxoRYm5ldC9lbnRpdHkucHJv" + + "dG8aDmJuZXQvcnBjLnByb3RvGhhibmV0L2NoYW5uZWxfdHlwZXMucHJvdG8i" + + "vAEKEEFkZE1lbWJlclJlcXVlc3QSKQoIYWdlbnRfaWQYASABKAsyFy5ibmV0" + + "LnByb3RvY29sLkVudGl0eUlkEjAKD21lbWJlcl9pZGVudGl0eRgCIAIoCzIX" + + "LmJuZXQucHJvdG9jb2wuSWRlbnRpdHkSOAoMbWVtYmVyX3N0YXRlGAMgAigL" + + "MiIuYm5ldC5wcm90b2NvbC5jaGFubmVsLk1lbWJlclN0YXRlEhEKCW9iamVj" + + "dF9pZBgEIAIoBCJ8ChNSZW1vdmVNZW1iZXJSZXF1ZXN0EikKCGFnZW50X2lk" + + "GAEgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBIqCgltZW1iZXJfaWQY" + + "AiACKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEg4KBnJlYXNvbhgDIAEo" + + "DSKQAQoSU2VuZE1lc3NhZ2VSZXF1ZXN0EikKCGFnZW50X2lkGAEgASgLMhcu" + + "Ym5ldC5wcm90b2NvbC5FbnRpdHlJZBIvCgdtZXNzYWdlGAIgAigLMh4uYm5l" + + "dC5wcm90b2NvbC5jaGFubmVsLk1lc3NhZ2USHgoTcmVxdWlyZWRfcHJpdmls" + + "ZWdlcxgDIAEoBDoBMCKBAQoZVXBkYXRlQ2hhbm5lbFN0YXRlUmVxdWVzdBIp" + + "CghhZ2VudF9pZBgBIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSOQoM" + + "c3RhdGVfY2hhbmdlGAIgAigLMiMuYm5ldC5wcm90b2NvbC5jaGFubmVsLkNo" + + "YW5uZWxTdGF0ZSJ6ChhVcGRhdGVNZW1iZXJTdGF0ZVJlcXVlc3QSKQoIYWdl" + + "bnRfaWQYASABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEjMKDHN0YXRl" + + "X2NoYW5nZRgCIAMoCzIdLmJuZXQucHJvdG9jb2wuY2hhbm5lbC5NZW1iZXIi" + + "TAoPRGlzc29sdmVSZXF1ZXN0EikKCGFnZW50X2lkGAEgASgLMhcuYm5ldC5w" + + "cm90b2NvbC5FbnRpdHlJZBIOCgZyZWFzb24YAiABKA0iegoPU2V0Um9sZXNS" + + "ZXF1ZXN0EikKCGFnZW50X2lkGAEgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRp" + + "dHlJZBIQCgRyb2xlGAIgAygNQgIQARIqCgltZW1iZXJfaWQYAyADKAsyFy5i" + + "bmV0LnByb3RvY29sLkVudGl0eUlkIqkBCg9BZGROb3RpZmljYXRpb24SKwoE" + + "c2VsZhgBIAEoCzIdLmJuZXQucHJvdG9jb2wuY2hhbm5lbC5NZW1iZXISLQoG" + + "bWVtYmVyGAIgAygLMh0uYm5ldC5wcm90b2NvbC5jaGFubmVsLk1lbWJlchI6" + + "Cg1jaGFubmVsX3N0YXRlGAMgAigLMiMuYm5ldC5wcm90b2NvbC5jaGFubmVs" + + "LkNoYW5uZWxTdGF0ZSJBChBKb2luTm90aWZpY2F0aW9uEi0KBm1lbWJlchgB" + + "IAIoCzIdLmJuZXQucHJvdG9jb2wuY2hhbm5lbC5NZW1iZXIiewoSUmVtb3Zl" + + "Tm90aWZpY2F0aW9uEikKCGFnZW50X2lkGAEgASgLMhcuYm5ldC5wcm90b2Nv" + + "bC5FbnRpdHlJZBIqCgltZW1iZXJfaWQYAiACKAsyFy5ibmV0LnByb3RvY29s" + + "LkVudGl0eUlkEg4KBnJlYXNvbhgDIAEoDSJ6ChFMZWF2ZU5vdGlmaWNhdGlv" + + "bhIpCghhZ2VudF9pZBgBIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQS" + + "KgoJbWVtYmVyX2lkGAIgAigLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBIO" + + "CgZyZWFzb24YAyABKA0ilQEKF1NlbmRNZXNzYWdlTm90aWZpY2F0aW9uEikK" + + "CGFnZW50X2lkGAEgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBIvCgdt" + + "ZXNzYWdlGAIgAigLMh4uYm5ldC5wcm90b2NvbC5jaGFubmVsLk1lc3NhZ2US" + + "HgoTcmVxdWlyZWRfcHJpdmlsZWdlcxgDIAEoBDoBMCKGAQoeVXBkYXRlQ2hh" + + "bm5lbFN0YXRlTm90aWZpY2F0aW9uEikKCGFnZW50X2lkGAEgASgLMhcuYm5l" + + "dC5wcm90b2NvbC5FbnRpdHlJZBI5CgxzdGF0ZV9jaGFuZ2UYAiACKAsyIy5i" + + "bmV0LnByb3RvY29sLmNoYW5uZWwuQ2hhbm5lbFN0YXRlIn8KHVVwZGF0ZU1l" + + "bWJlclN0YXRlTm90aWZpY2F0aW9uEikKCGFnZW50X2lkGAEgASgLMhcuYm5l" + + "dC5wcm90b2NvbC5FbnRpdHlJZBIzCgxzdGF0ZV9jaGFuZ2UYAiADKAsyHS5i" + + "bmV0LnByb3RvY29sLmNoYW5uZWwuTWVtYmVyMvYECgdDaGFubmVsElEKCUFk" + + "ZE1lbWJlchInLmJuZXQucHJvdG9jb2wuY2hhbm5lbC5BZGRNZW1iZXJSZXF1" + + "ZXN0GhUuYm5ldC5wcm90b2NvbC5Ob0RhdGEiBIC1GAESVwoMUmVtb3ZlTWVt" + + "YmVyEiouYm5ldC5wcm90b2NvbC5jaGFubmVsLlJlbW92ZU1lbWJlclJlcXVl" + + "c3QaFS5ibmV0LnByb3RvY29sLk5vRGF0YSIEgLUYAhJVCgtTZW5kTWVzc2Fn" + + "ZRIpLmJuZXQucHJvdG9jb2wuY2hhbm5lbC5TZW5kTWVzc2FnZVJlcXVlc3Qa" + + "FS5ibmV0LnByb3RvY29sLk5vRGF0YSIEgLUYAxJjChJVcGRhdGVDaGFubmVs" + + "U3RhdGUSMC5ibmV0LnByb3RvY29sLmNoYW5uZWwuVXBkYXRlQ2hhbm5lbFN0" + + "YXRlUmVxdWVzdBoVLmJuZXQucHJvdG9jb2wuTm9EYXRhIgSAtRgEEmEKEVVw" + + "ZGF0ZU1lbWJlclN0YXRlEi8uYm5ldC5wcm90b2NvbC5jaGFubmVsLlVwZGF0" + + "ZU1lbWJlclN0YXRlUmVxdWVzdBoVLmJuZXQucHJvdG9jb2wuTm9EYXRhIgSA" + + "tRgFEk8KCERpc3NvbHZlEiYuYm5ldC5wcm90b2NvbC5jaGFubmVsLkRpc3Nv" + + "bHZlUmVxdWVzdBoVLmJuZXQucHJvdG9jb2wuTm9EYXRhIgSAtRgGEk8KCFNl" + + "dFJvbGVzEiYuYm5ldC5wcm90b2NvbC5jaGFubmVsLlNldFJvbGVzUmVxdWVz" + + "dBoVLmJuZXQucHJvdG9jb2wuTm9EYXRhIgSAtRgHMsoFChFDaGFubmVsU3Vi" + + "c2NyaWJlchJVCglOb3RpZnlBZGQSJi5ibmV0LnByb3RvY29sLmNoYW5uZWwu" + + "QWRkTm90aWZpY2F0aW9uGhouYm5ldC5wcm90b2NvbC5OT19SRVNQT05TRSIE" + + "gLUYARJXCgpOb3RpZnlKb2luEicuYm5ldC5wcm90b2NvbC5jaGFubmVsLkpv" + + "aW5Ob3RpZmljYXRpb24aGi5ibmV0LnByb3RvY29sLk5PX1JFU1BPTlNFIgSA" + + "tRgCElsKDE5vdGlmeVJlbW92ZRIpLmJuZXQucHJvdG9jb2wuY2hhbm5lbC5S" + + "ZW1vdmVOb3RpZmljYXRpb24aGi5ibmV0LnByb3RvY29sLk5PX1JFU1BPTlNF" + + "IgSAtRgDElkKC05vdGlmeUxlYXZlEiguYm5ldC5wcm90b2NvbC5jaGFubmVs" + + "LkxlYXZlTm90aWZpY2F0aW9uGhouYm5ldC5wcm90b2NvbC5OT19SRVNQT05T" + + "RSIEgLUYBBJlChFOb3RpZnlTZW5kTWVzc2FnZRIuLmJuZXQucHJvdG9jb2wu" + + "Y2hhbm5lbC5TZW5kTWVzc2FnZU5vdGlmaWNhdGlvbhoaLmJuZXQucHJvdG9j" + + "b2wuTk9fUkVTUE9OU0UiBIC1GAUScwoYTm90aWZ5VXBkYXRlQ2hhbm5lbFN0" + + "YXRlEjUuYm5ldC5wcm90b2NvbC5jaGFubmVsLlVwZGF0ZUNoYW5uZWxTdGF0" + + "ZU5vdGlmaWNhdGlvbhoaLmJuZXQucHJvdG9jb2wuTk9fUkVTUE9OU0UiBIC1" + + "GAYScQoXTm90aWZ5VXBkYXRlTWVtYmVyU3RhdGUSNC5ibmV0LnByb3RvY29s" + + "LmNoYW5uZWwuVXBkYXRlTWVtYmVyU3RhdGVOb3RpZmljYXRpb24aGi5ibmV0" + + "LnByb3RvY29sLk5PX1JFU1BPTlNFIgSAtRgHQgOAAQA="); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_bnet_protocol_channel_AddMemberRequest__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_channel_AddMemberRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_AddMemberRequest__Descriptor, + new string[] { "AgentId", "MemberIdentity", "MemberState", "ObjectId", }); + internal__static_bnet_protocol_channel_RemoveMemberRequest__Descriptor = Descriptor.MessageTypes[1]; + internal__static_bnet_protocol_channel_RemoveMemberRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_RemoveMemberRequest__Descriptor, + new string[] { "AgentId", "MemberId", "Reason", }); + internal__static_bnet_protocol_channel_SendMessageRequest__Descriptor = Descriptor.MessageTypes[2]; + internal__static_bnet_protocol_channel_SendMessageRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_SendMessageRequest__Descriptor, + new string[] { "AgentId", "Message", "RequiredPrivileges", }); + internal__static_bnet_protocol_channel_UpdateChannelStateRequest__Descriptor = Descriptor.MessageTypes[3]; + internal__static_bnet_protocol_channel_UpdateChannelStateRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_UpdateChannelStateRequest__Descriptor, + new string[] { "AgentId", "StateChange", }); + internal__static_bnet_protocol_channel_UpdateMemberStateRequest__Descriptor = Descriptor.MessageTypes[4]; + internal__static_bnet_protocol_channel_UpdateMemberStateRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_UpdateMemberStateRequest__Descriptor, + new string[] { "AgentId", "StateChange", }); + internal__static_bnet_protocol_channel_DissolveRequest__Descriptor = Descriptor.MessageTypes[5]; + internal__static_bnet_protocol_channel_DissolveRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_DissolveRequest__Descriptor, + new string[] { "AgentId", "Reason", }); + internal__static_bnet_protocol_channel_SetRolesRequest__Descriptor = Descriptor.MessageTypes[6]; + internal__static_bnet_protocol_channel_SetRolesRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_SetRolesRequest__Descriptor, + new string[] { "AgentId", "Role", "MemberId", }); + internal__static_bnet_protocol_channel_AddNotification__Descriptor = Descriptor.MessageTypes[7]; + internal__static_bnet_protocol_channel_AddNotification__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_AddNotification__Descriptor, + new string[] { "Self", "Member", "ChannelState", }); + internal__static_bnet_protocol_channel_JoinNotification__Descriptor = Descriptor.MessageTypes[8]; + internal__static_bnet_protocol_channel_JoinNotification__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_JoinNotification__Descriptor, + new string[] { "Member", }); + internal__static_bnet_protocol_channel_RemoveNotification__Descriptor = Descriptor.MessageTypes[9]; + internal__static_bnet_protocol_channel_RemoveNotification__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_RemoveNotification__Descriptor, + new string[] { "AgentId", "MemberId", "Reason", }); + internal__static_bnet_protocol_channel_LeaveNotification__Descriptor = Descriptor.MessageTypes[10]; + internal__static_bnet_protocol_channel_LeaveNotification__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_LeaveNotification__Descriptor, + new string[] { "AgentId", "MemberId", "Reason", }); + internal__static_bnet_protocol_channel_SendMessageNotification__Descriptor = Descriptor.MessageTypes[11]; + internal__static_bnet_protocol_channel_SendMessageNotification__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_SendMessageNotification__Descriptor, + new string[] { "AgentId", "Message", "RequiredPrivileges", }); + internal__static_bnet_protocol_channel_UpdateChannelStateNotification__Descriptor = Descriptor.MessageTypes[12]; + internal__static_bnet_protocol_channel_UpdateChannelStateNotification__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_UpdateChannelStateNotification__Descriptor, + new string[] { "AgentId", "StateChange", }); + internal__static_bnet_protocol_channel_UpdateMemberStateNotification__Descriptor = Descriptor.MessageTypes[13]; + internal__static_bnet_protocol_channel_UpdateMemberStateNotification__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_UpdateMemberStateNotification__Descriptor, + new string[] { "AgentId", "StateChange", }); + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + RegisterAllExtensions(registry); + global::bnet.protocol.attribute.Proto.Attribute.RegisterAllExtensions(registry); + global::bnet.protocol.Entity.RegisterAllExtensions(registry); + global::bnet.protocol.Rpc.RegisterAllExtensions(registry); + global::bnet.protocol.channel.ChannelTypes.RegisterAllExtensions(registry); + return registry; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::bnet.protocol.attribute.Proto.Attribute.Descriptor, + global::bnet.protocol.Entity.Descriptor, + global::bnet.protocol.Rpc.Descriptor, + global::bnet.protocol.channel.ChannelTypes.Descriptor, + }, assigner); + } + #endregion + } #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class AddMemberRequest : pb::GeneratedMessage { - private static readonly AddMemberRequest defaultInstance = new Builder().BuildPartial(); + private AddMemberRequest() { } + private static readonly AddMemberRequest defaultInstance = new AddMemberRequest().MakeReadOnly(); + private static readonly string[] _addMemberRequestFieldNames = new string[] { "agent_id", "member_identity", "member_state", "object_id" }; + private static readonly uint[] _addMemberRequestFieldTags = new uint[] { 10, 18, 26, 32 }; public static AddMemberRequest DefaultInstance { get { return defaultInstance; } } public override AddMemberRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override AddMemberRequest ThisMessage { @@ -225,46 +228,46 @@ protected override AddMemberRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel.Proto.Channel.internal__static_bnet_protocol_channel_AddMemberRequest__Descriptor; } + get { return global::bnet.protocol.channel.ChannelService.internal__static_bnet_protocol_channel_AddMemberRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel.Proto.Channel.internal__static_bnet_protocol_channel_AddMemberRequest__FieldAccessorTable; } + get { return global::bnet.protocol.channel.ChannelService.internal__static_bnet_protocol_channel_AddMemberRequest__FieldAccessorTable; } } public const int AgentIdFieldNumber = 1; private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId agentId_; public bool HasAgentId { get { return hasAgentId; } } public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } + get { return agentId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int MemberIdentityFieldNumber = 2; private bool hasMemberIdentity; - private global::bnet.protocol.Identity memberIdentity_ = global::bnet.protocol.Identity.DefaultInstance; + private global::bnet.protocol.Identity memberIdentity_; public bool HasMemberIdentity { get { return hasMemberIdentity; } } public global::bnet.protocol.Identity MemberIdentity { - get { return memberIdentity_; } + get { return memberIdentity_ ?? global::bnet.protocol.Identity.DefaultInstance; } } - public const int StateFieldNumber = 3; - private bool hasState; - private global::bnet.protocol.channel.MemberState state_ = global::bnet.protocol.channel.MemberState.DefaultInstance; - public bool HasState { - get { return hasState; } + public const int MemberStateFieldNumber = 3; + private bool hasMemberState; + private global::bnet.protocol.channel.MemberState memberState_; + public bool HasMemberState { + get { return hasMemberState; } } - public global::bnet.protocol.channel.MemberState State { - get { return state_; } + public global::bnet.protocol.channel.MemberState MemberState { + get { return memberState_ ?? global::bnet.protocol.channel.MemberState.DefaultInstance; } } public const int ObjectIdFieldNumber = 4; private bool hasObjectId; - private ulong objectId_ = 0UL; + private ulong objectId_; public bool HasObjectId { get { return hasObjectId; } } @@ -275,30 +278,31 @@ public ulong ObjectId { public override bool IsInitialized { get { if (!hasMemberIdentity) return false; - if (!hasState) return false; + if (!hasMemberState) return false; if (!hasObjectId) return false; if (HasAgentId) { if (!AgentId.IsInitialized) return false; } if (!MemberIdentity.IsInitialized) return false; - if (!State.IsInitialized) return false; + if (!MemberState.IsInitialized) return false; return true; } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasAgentId) { - output.WriteMessage(1, AgentId); + string[] field_names = _addMemberRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); } - if (HasMemberIdentity) { - output.WriteMessage(2, MemberIdentity); + if (hasMemberIdentity) { + output.WriteMessage(2, field_names[1], MemberIdentity); } - if (HasState) { - output.WriteMessage(3, State); + if (hasMemberState) { + output.WriteMessage(3, field_names[2], MemberState); } - if (HasObjectId) { - output.WriteUInt64(4, ObjectId); + if (hasObjectId) { + output.WriteUInt64(4, field_names[3], ObjectId); } UnknownFields.WriteTo(output); } @@ -310,16 +314,16 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAgentId) { + if (hasAgentId) { size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); } - if (HasMemberIdentity) { + if (hasMemberIdentity) { size += pb::CodedOutputStream.ComputeMessageSize(2, MemberIdentity); } - if (HasState) { - size += pb::CodedOutputStream.ComputeMessageSize(3, State); + if (hasMemberState) { + size += pb::CodedOutputStream.ComputeMessageSize(3, MemberState); } - if (HasObjectId) { + if (hasObjectId) { size += pb::CodedOutputStream.ComputeUInt64Size(4, ObjectId); } size += UnknownFields.SerializedSize; @@ -352,38 +356,72 @@ public static AddMemberRequest ParseDelimitedFrom(global::System.IO.Stream input public static AddMemberRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static AddMemberRequest ParseFrom(pb::CodedInputStream input) { + public static AddMemberRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static AddMemberRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static AddMemberRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private AddMemberRequest MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(AddMemberRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(AddMemberRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - AddMemberRequest result = new AddMemberRequest(); + private bool resultIsReadOnly; + private AddMemberRequest result; + + private AddMemberRequest PrepareBuilder() { + if (resultIsReadOnly) { + AddMemberRequest original = result; + result = new AddMemberRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override AddMemberRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new AddMemberRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -395,12 +433,11 @@ public override AddMemberRequest DefaultInstanceForType { } public override AddMemberRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - AddMemberRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -414,14 +451,15 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(AddMemberRequest other) { if (other == global::bnet.protocol.channel.AddMemberRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAgentId) { MergeAgentId(other.AgentId); } if (other.HasMemberIdentity) { MergeMemberIdentity(other.MemberIdentity); } - if (other.HasState) { - MergeState(other.State); + if (other.HasMemberState) { + MergeMemberState(other.MemberState); } if (other.HasObjectId) { ObjectId = other.ObjectId; @@ -430,20 +468,31 @@ public override Builder MergeFrom(AddMemberRequest other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_addMemberRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _addMemberRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -455,12 +504,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { + if (result.hasAgentId) { subBuilder.MergeFrom(AgentId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -469,7 +518,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.Identity.Builder subBuilder = global::bnet.protocol.Identity.CreateBuilder(); - if (HasMemberIdentity) { + if (result.hasMemberIdentity) { subBuilder.MergeFrom(MemberIdentity); } input.ReadMessage(subBuilder, extensionRegistry); @@ -478,24 +527,29 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 26: { global::bnet.protocol.channel.MemberState.Builder subBuilder = global::bnet.protocol.channel.MemberState.CreateBuilder(); - if (HasState) { - subBuilder.MergeFrom(State); + if (result.hasMemberState) { + subBuilder.MergeFrom(MemberState); } input.ReadMessage(subBuilder, extensionRegistry); - State = subBuilder.BuildPartial(); + MemberState = subBuilder.BuildPartial(); break; } case 32: { - ObjectId = input.ReadUInt64(); + result.hasObjectId = input.ReadUInt64(ref result.objectId_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasAgentId { - get { return result.HasAgentId; } + get { return result.hasAgentId; } } public global::bnet.protocol.EntityId AgentId { get { return result.AgentId; } @@ -503,19 +557,22 @@ public bool HasAgentId { } public Builder SetAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = value; return this; } public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = builderForValue.Build(); return this; } public Builder MergeAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && + PrepareBuilder(); + if (result.hasAgentId && result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); } else { @@ -525,13 +582,14 @@ public Builder MergeAgentId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearAgentId() { + PrepareBuilder(); result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.agentId_ = null; return this; } public bool HasMemberIdentity { - get { return result.HasMemberIdentity; } + get { return result.hasMemberIdentity; } } public global::bnet.protocol.Identity MemberIdentity { get { return result.MemberIdentity; } @@ -539,19 +597,22 @@ public bool HasMemberIdentity { } public Builder SetMemberIdentity(global::bnet.protocol.Identity value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasMemberIdentity = true; result.memberIdentity_ = value; return this; } public Builder SetMemberIdentity(global::bnet.protocol.Identity.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasMemberIdentity = true; result.memberIdentity_ = builderForValue.Build(); return this; } public Builder MergeMemberIdentity(global::bnet.protocol.Identity value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasMemberIdentity && + PrepareBuilder(); + if (result.hasMemberIdentity && result.memberIdentity_ != global::bnet.protocol.Identity.DefaultInstance) { result.memberIdentity_ = global::bnet.protocol.Identity.CreateBuilder(result.memberIdentity_).MergeFrom(value).BuildPartial(); } else { @@ -561,78 +622,91 @@ public Builder MergeMemberIdentity(global::bnet.protocol.Identity value) { return this; } public Builder ClearMemberIdentity() { + PrepareBuilder(); result.hasMemberIdentity = false; - result.memberIdentity_ = global::bnet.protocol.Identity.DefaultInstance; + result.memberIdentity_ = null; return this; } - public bool HasState { - get { return result.HasState; } + public bool HasMemberState { + get { return result.hasMemberState; } } - public global::bnet.protocol.channel.MemberState State { - get { return result.State; } - set { SetState(value); } + public global::bnet.protocol.channel.MemberState MemberState { + get { return result.MemberState; } + set { SetMemberState(value); } } - public Builder SetState(global::bnet.protocol.channel.MemberState value) { + public Builder SetMemberState(global::bnet.protocol.channel.MemberState value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasState = true; - result.state_ = value; + PrepareBuilder(); + result.hasMemberState = true; + result.memberState_ = value; return this; } - public Builder SetState(global::bnet.protocol.channel.MemberState.Builder builderForValue) { + public Builder SetMemberState(global::bnet.protocol.channel.MemberState.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasState = true; - result.state_ = builderForValue.Build(); + PrepareBuilder(); + result.hasMemberState = true; + result.memberState_ = builderForValue.Build(); return this; } - public Builder MergeState(global::bnet.protocol.channel.MemberState value) { + public Builder MergeMemberState(global::bnet.protocol.channel.MemberState value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasState && - result.state_ != global::bnet.protocol.channel.MemberState.DefaultInstance) { - result.state_ = global::bnet.protocol.channel.MemberState.CreateBuilder(result.state_).MergeFrom(value).BuildPartial(); + PrepareBuilder(); + if (result.hasMemberState && + result.memberState_ != global::bnet.protocol.channel.MemberState.DefaultInstance) { + result.memberState_ = global::bnet.protocol.channel.MemberState.CreateBuilder(result.memberState_).MergeFrom(value).BuildPartial(); } else { - result.state_ = value; + result.memberState_ = value; } - result.hasState = true; + result.hasMemberState = true; return this; } - public Builder ClearState() { - result.hasState = false; - result.state_ = global::bnet.protocol.channel.MemberState.DefaultInstance; + public Builder ClearMemberState() { + PrepareBuilder(); + result.hasMemberState = false; + result.memberState_ = null; return this; } public bool HasObjectId { - get { return result.HasObjectId; } + get { return result.hasObjectId; } } public ulong ObjectId { get { return result.ObjectId; } set { SetObjectId(value); } } public Builder SetObjectId(ulong value) { + PrepareBuilder(); result.hasObjectId = true; result.objectId_ = value; return this; } public Builder ClearObjectId() { + PrepareBuilder(); result.hasObjectId = false; result.objectId_ = 0UL; return this; } } static AddMemberRequest() { - object.ReferenceEquals(global::bnet.protocol.channel.Proto.Channel.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.channel.ChannelService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class RemoveMemberRequest : pb::GeneratedMessage { - private static readonly RemoveMemberRequest defaultInstance = new Builder().BuildPartial(); + private RemoveMemberRequest() { } + private static readonly RemoveMemberRequest defaultInstance = new RemoveMemberRequest().MakeReadOnly(); + private static readonly string[] _removeMemberRequestFieldNames = new string[] { "agent_id", "member_id", "reason" }; + private static readonly uint[] _removeMemberRequestFieldTags = new uint[] { 10, 18, 24 }; public static RemoveMemberRequest DefaultInstance { get { return defaultInstance; } } public override RemoveMemberRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override RemoveMemberRequest ThisMessage { @@ -640,36 +714,36 @@ protected override RemoveMemberRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel.Proto.Channel.internal__static_bnet_protocol_channel_RemoveMemberRequest__Descriptor; } + get { return global::bnet.protocol.channel.ChannelService.internal__static_bnet_protocol_channel_RemoveMemberRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel.Proto.Channel.internal__static_bnet_protocol_channel_RemoveMemberRequest__FieldAccessorTable; } + get { return global::bnet.protocol.channel.ChannelService.internal__static_bnet_protocol_channel_RemoveMemberRequest__FieldAccessorTable; } } public const int AgentIdFieldNumber = 1; private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId agentId_; public bool HasAgentId { get { return hasAgentId; } } public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } + get { return agentId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int MemberIdFieldNumber = 2; private bool hasMemberId; - private global::bnet.protocol.EntityId memberId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId memberId_; public bool HasMemberId { get { return hasMemberId; } } public global::bnet.protocol.EntityId MemberId { - get { return memberId_; } + get { return memberId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int ReasonFieldNumber = 3; private bool hasReason; - private uint reason_ = 0; + private uint reason_; public bool HasReason { get { return hasReason; } } @@ -688,16 +762,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasAgentId) { - output.WriteMessage(1, AgentId); + string[] field_names = _removeMemberRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); } - if (HasMemberId) { - output.WriteMessage(2, MemberId); + if (hasMemberId) { + output.WriteMessage(2, field_names[1], MemberId); } - if (HasReason) { - output.WriteUInt32(3, Reason); + if (hasReason) { + output.WriteUInt32(3, field_names[2], Reason); } UnknownFields.WriteTo(output); } @@ -709,13 +784,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAgentId) { + if (hasAgentId) { size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); } - if (HasMemberId) { + if (hasMemberId) { size += pb::CodedOutputStream.ComputeMessageSize(2, MemberId); } - if (HasReason) { + if (hasReason) { size += pb::CodedOutputStream.ComputeUInt32Size(3, Reason); } size += UnknownFields.SerializedSize; @@ -748,38 +823,72 @@ public static RemoveMemberRequest ParseDelimitedFrom(global::System.IO.Stream in public static RemoveMemberRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static RemoveMemberRequest ParseFrom(pb::CodedInputStream input) { + public static RemoveMemberRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static RemoveMemberRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static RemoveMemberRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private RemoveMemberRequest MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(RemoveMemberRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(RemoveMemberRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private RemoveMemberRequest result; + + private RemoveMemberRequest PrepareBuilder() { + if (resultIsReadOnly) { + RemoveMemberRequest original = result; + result = new RemoveMemberRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - RemoveMemberRequest result = new RemoveMemberRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override RemoveMemberRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new RemoveMemberRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -791,12 +900,11 @@ public override RemoveMemberRequest DefaultInstanceForType { } public override RemoveMemberRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - RemoveMemberRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -810,6 +918,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(RemoveMemberRequest other) { if (other == global::bnet.protocol.channel.RemoveMemberRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAgentId) { MergeAgentId(other.AgentId); } @@ -823,20 +932,31 @@ public override Builder MergeFrom(RemoveMemberRequest other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_removeMemberRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _removeMemberRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -848,12 +968,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { + if (result.hasAgentId) { subBuilder.MergeFrom(AgentId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -862,7 +982,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasMemberId) { + if (result.hasMemberId) { subBuilder.MergeFrom(MemberId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -870,16 +990,21 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 24: { - Reason = input.ReadUInt32(); + result.hasReason = input.ReadUInt32(ref result.reason_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasAgentId { - get { return result.HasAgentId; } + get { return result.hasAgentId; } } public global::bnet.protocol.EntityId AgentId { get { return result.AgentId; } @@ -887,19 +1012,22 @@ public bool HasAgentId { } public Builder SetAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = value; return this; } public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = builderForValue.Build(); return this; } public Builder MergeAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && + PrepareBuilder(); + if (result.hasAgentId && result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); } else { @@ -909,13 +1037,14 @@ public Builder MergeAgentId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearAgentId() { + PrepareBuilder(); result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.agentId_ = null; return this; } public bool HasMemberId { - get { return result.HasMemberId; } + get { return result.hasMemberId; } } public global::bnet.protocol.EntityId MemberId { get { return result.MemberId; } @@ -923,19 +1052,22 @@ public bool HasMemberId { } public Builder SetMemberId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasMemberId = true; result.memberId_ = value; return this; } public Builder SetMemberId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasMemberId = true; result.memberId_ = builderForValue.Build(); return this; } public Builder MergeMemberId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasMemberId && + PrepareBuilder(); + if (result.hasMemberId && result.memberId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.memberId_ = global::bnet.protocol.EntityId.CreateBuilder(result.memberId_).MergeFrom(value).BuildPartial(); } else { @@ -945,42 +1077,51 @@ public Builder MergeMemberId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearMemberId() { + PrepareBuilder(); result.hasMemberId = false; - result.memberId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.memberId_ = null; return this; } public bool HasReason { - get { return result.HasReason; } + get { return result.hasReason; } } public uint Reason { get { return result.Reason; } set { SetReason(value); } } public Builder SetReason(uint value) { + PrepareBuilder(); result.hasReason = true; result.reason_ = value; return this; } public Builder ClearReason() { + PrepareBuilder(); result.hasReason = false; result.reason_ = 0; return this; } } static RemoveMemberRequest() { - object.ReferenceEquals(global::bnet.protocol.channel.Proto.Channel.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.channel.ChannelService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class SendMessageRequest : pb::GeneratedMessage { - private static readonly SendMessageRequest defaultInstance = new Builder().BuildPartial(); + private SendMessageRequest() { } + private static readonly SendMessageRequest defaultInstance = new SendMessageRequest().MakeReadOnly(); + private static readonly string[] _sendMessageRequestFieldNames = new string[] { "agent_id", "message", "required_privileges" }; + private static readonly uint[] _sendMessageRequestFieldTags = new uint[] { 10, 18, 24 }; public static SendMessageRequest DefaultInstance { get { return defaultInstance; } } public override SendMessageRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override SendMessageRequest ThisMessage { @@ -988,36 +1129,36 @@ protected override SendMessageRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel.Proto.Channel.internal__static_bnet_protocol_channel_SendMessageRequest__Descriptor; } + get { return global::bnet.protocol.channel.ChannelService.internal__static_bnet_protocol_channel_SendMessageRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel.Proto.Channel.internal__static_bnet_protocol_channel_SendMessageRequest__FieldAccessorTable; } + get { return global::bnet.protocol.channel.ChannelService.internal__static_bnet_protocol_channel_SendMessageRequest__FieldAccessorTable; } } public const int AgentIdFieldNumber = 1; private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId agentId_; public bool HasAgentId { get { return hasAgentId; } } public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } + get { return agentId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int MessageFieldNumber = 2; private bool hasMessage; - private global::bnet.protocol.channel.Message message_ = global::bnet.protocol.channel.Message.DefaultInstance; + private global::bnet.protocol.channel.Message message_; public bool HasMessage { get { return hasMessage; } } public global::bnet.protocol.channel.Message Message { - get { return message_; } + get { return message_ ?? global::bnet.protocol.channel.Message.DefaultInstance; } } public const int RequiredPrivilegesFieldNumber = 3; private bool hasRequiredPrivileges; - private ulong requiredPrivileges_ = 0UL; + private ulong requiredPrivileges_; public bool HasRequiredPrivileges { get { return hasRequiredPrivileges; } } @@ -1036,16 +1177,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasAgentId) { - output.WriteMessage(1, AgentId); + string[] field_names = _sendMessageRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); } - if (HasMessage) { - output.WriteMessage(2, Message); + if (hasMessage) { + output.WriteMessage(2, field_names[1], Message); } - if (HasRequiredPrivileges) { - output.WriteUInt64(3, RequiredPrivileges); + if (hasRequiredPrivileges) { + output.WriteUInt64(3, field_names[2], RequiredPrivileges); } UnknownFields.WriteTo(output); } @@ -1057,13 +1199,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAgentId) { + if (hasAgentId) { size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); } - if (HasMessage) { + if (hasMessage) { size += pb::CodedOutputStream.ComputeMessageSize(2, Message); } - if (HasRequiredPrivileges) { + if (hasRequiredPrivileges) { size += pb::CodedOutputStream.ComputeUInt64Size(3, RequiredPrivileges); } size += UnknownFields.SerializedSize; @@ -1096,38 +1238,72 @@ public static SendMessageRequest ParseDelimitedFrom(global::System.IO.Stream inp public static SendMessageRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static SendMessageRequest ParseFrom(pb::CodedInputStream input) { + public static SendMessageRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SendMessageRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static SendMessageRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private SendMessageRequest MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(SendMessageRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SendMessageRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SendMessageRequest result; + + private SendMessageRequest PrepareBuilder() { + if (resultIsReadOnly) { + SendMessageRequest original = result; + result = new SendMessageRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - SendMessageRequest result = new SendMessageRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override SendMessageRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SendMessageRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -1139,12 +1315,11 @@ public override SendMessageRequest DefaultInstanceForType { } public override SendMessageRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - SendMessageRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1158,6 +1333,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SendMessageRequest other) { if (other == global::bnet.protocol.channel.SendMessageRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAgentId) { MergeAgentId(other.AgentId); } @@ -1171,20 +1347,31 @@ public override Builder MergeFrom(SendMessageRequest other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_sendMessageRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _sendMessageRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1196,12 +1383,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { + if (result.hasAgentId) { subBuilder.MergeFrom(AgentId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1210,7 +1397,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.channel.Message.Builder subBuilder = global::bnet.protocol.channel.Message.CreateBuilder(); - if (HasMessage) { + if (result.hasMessage) { subBuilder.MergeFrom(Message); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1218,16 +1405,21 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 24: { - RequiredPrivileges = input.ReadUInt64(); + result.hasRequiredPrivileges = input.ReadUInt64(ref result.requiredPrivileges_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasAgentId { - get { return result.HasAgentId; } + get { return result.hasAgentId; } } public global::bnet.protocol.EntityId AgentId { get { return result.AgentId; } @@ -1235,19 +1427,22 @@ public bool HasAgentId { } public Builder SetAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = value; return this; } public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = builderForValue.Build(); return this; } public Builder MergeAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && + PrepareBuilder(); + if (result.hasAgentId && result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); } else { @@ -1257,13 +1452,14 @@ public Builder MergeAgentId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearAgentId() { + PrepareBuilder(); result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.agentId_ = null; return this; } public bool HasMessage { - get { return result.HasMessage; } + get { return result.hasMessage; } } public global::bnet.protocol.channel.Message Message { get { return result.Message; } @@ -1271,19 +1467,22 @@ public bool HasMessage { } public Builder SetMessage(global::bnet.protocol.channel.Message value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasMessage = true; result.message_ = value; return this; } public Builder SetMessage(global::bnet.protocol.channel.Message.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasMessage = true; result.message_ = builderForValue.Build(); return this; } public Builder MergeMessage(global::bnet.protocol.channel.Message value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasMessage && + PrepareBuilder(); + if (result.hasMessage && result.message_ != global::bnet.protocol.channel.Message.DefaultInstance) { result.message_ = global::bnet.protocol.channel.Message.CreateBuilder(result.message_).MergeFrom(value).BuildPartial(); } else { @@ -1293,42 +1492,51 @@ public Builder MergeMessage(global::bnet.protocol.channel.Message value) { return this; } public Builder ClearMessage() { + PrepareBuilder(); result.hasMessage = false; - result.message_ = global::bnet.protocol.channel.Message.DefaultInstance; + result.message_ = null; return this; } public bool HasRequiredPrivileges { - get { return result.HasRequiredPrivileges; } + get { return result.hasRequiredPrivileges; } } public ulong RequiredPrivileges { get { return result.RequiredPrivileges; } set { SetRequiredPrivileges(value); } } public Builder SetRequiredPrivileges(ulong value) { + PrepareBuilder(); result.hasRequiredPrivileges = true; result.requiredPrivileges_ = value; return this; } public Builder ClearRequiredPrivileges() { + PrepareBuilder(); result.hasRequiredPrivileges = false; result.requiredPrivileges_ = 0UL; return this; } } static SendMessageRequest() { - object.ReferenceEquals(global::bnet.protocol.channel.Proto.Channel.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.channel.ChannelService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class UpdateChannelStateRequest : pb::GeneratedMessage { - private static readonly UpdateChannelStateRequest defaultInstance = new Builder().BuildPartial(); + private UpdateChannelStateRequest() { } + private static readonly UpdateChannelStateRequest defaultInstance = new UpdateChannelStateRequest().MakeReadOnly(); + private static readonly string[] _updateChannelStateRequestFieldNames = new string[] { "agent_id", "state_change" }; + private static readonly uint[] _updateChannelStateRequestFieldTags = new uint[] { 10, 18 }; public static UpdateChannelStateRequest DefaultInstance { get { return defaultInstance; } } public override UpdateChannelStateRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override UpdateChannelStateRequest ThisMessage { @@ -1336,31 +1544,31 @@ protected override UpdateChannelStateRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel.Proto.Channel.internal__static_bnet_protocol_channel_UpdateChannelStateRequest__Descriptor; } + get { return global::bnet.protocol.channel.ChannelService.internal__static_bnet_protocol_channel_UpdateChannelStateRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel.Proto.Channel.internal__static_bnet_protocol_channel_UpdateChannelStateRequest__FieldAccessorTable; } + get { return global::bnet.protocol.channel.ChannelService.internal__static_bnet_protocol_channel_UpdateChannelStateRequest__FieldAccessorTable; } } public const int AgentIdFieldNumber = 1; private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId agentId_; public bool HasAgentId { get { return hasAgentId; } } public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } + get { return agentId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int StateChangeFieldNumber = 2; private bool hasStateChange; - private global::bnet.protocol.channel.ChannelState stateChange_ = global::bnet.protocol.channel.ChannelState.DefaultInstance; + private global::bnet.protocol.channel.ChannelState stateChange_; public bool HasStateChange { get { return hasStateChange; } } public global::bnet.protocol.channel.ChannelState StateChange { - get { return stateChange_; } + get { return stateChange_ ?? global::bnet.protocol.channel.ChannelState.DefaultInstance; } } public override bool IsInitialized { @@ -1374,13 +1582,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasAgentId) { - output.WriteMessage(1, AgentId); + string[] field_names = _updateChannelStateRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); } - if (HasStateChange) { - output.WriteMessage(2, StateChange); + if (hasStateChange) { + output.WriteMessage(2, field_names[1], StateChange); } UnknownFields.WriteTo(output); } @@ -1392,10 +1601,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAgentId) { + if (hasAgentId) { size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); } - if (HasStateChange) { + if (hasStateChange) { size += pb::CodedOutputStream.ComputeMessageSize(2, StateChange); } size += UnknownFields.SerializedSize; @@ -1428,38 +1637,72 @@ public static UpdateChannelStateRequest ParseDelimitedFrom(global::System.IO.Str public static UpdateChannelStateRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static UpdateChannelStateRequest ParseFrom(pb::CodedInputStream input) { + public static UpdateChannelStateRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static UpdateChannelStateRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static UpdateChannelStateRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private UpdateChannelStateRequest MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(UpdateChannelStateRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(UpdateChannelStateRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - UpdateChannelStateRequest result = new UpdateChannelStateRequest(); + private bool resultIsReadOnly; + private UpdateChannelStateRequest result; + + private UpdateChannelStateRequest PrepareBuilder() { + if (resultIsReadOnly) { + UpdateChannelStateRequest original = result; + result = new UpdateChannelStateRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override UpdateChannelStateRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new UpdateChannelStateRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -1471,12 +1714,11 @@ public override UpdateChannelStateRequest DefaultInstanceForType { } public override UpdateChannelStateRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - UpdateChannelStateRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1490,6 +1732,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(UpdateChannelStateRequest other) { if (other == global::bnet.protocol.channel.UpdateChannelStateRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAgentId) { MergeAgentId(other.AgentId); } @@ -1500,20 +1743,31 @@ public override Builder MergeFrom(UpdateChannelStateRequest other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_updateChannelStateRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _updateChannelStateRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1525,12 +1779,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { + if (result.hasAgentId) { subBuilder.MergeFrom(AgentId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1539,7 +1793,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.channel.ChannelState.Builder subBuilder = global::bnet.protocol.channel.ChannelState.CreateBuilder(); - if (HasStateChange) { + if (result.hasStateChange) { subBuilder.MergeFrom(StateChange); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1548,11 +1802,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasAgentId { - get { return result.HasAgentId; } + get { return result.hasAgentId; } } public global::bnet.protocol.EntityId AgentId { get { return result.AgentId; } @@ -1560,19 +1819,22 @@ public bool HasAgentId { } public Builder SetAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = value; return this; } public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = builderForValue.Build(); return this; } public Builder MergeAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && + PrepareBuilder(); + if (result.hasAgentId && result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); } else { @@ -1582,13 +1844,14 @@ public Builder MergeAgentId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearAgentId() { + PrepareBuilder(); result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.agentId_ = null; return this; } public bool HasStateChange { - get { return result.HasStateChange; } + get { return result.hasStateChange; } } public global::bnet.protocol.channel.ChannelState StateChange { get { return result.StateChange; } @@ -1596,19 +1859,22 @@ public bool HasStateChange { } public Builder SetStateChange(global::bnet.protocol.channel.ChannelState value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasStateChange = true; result.stateChange_ = value; return this; } public Builder SetStateChange(global::bnet.protocol.channel.ChannelState.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasStateChange = true; result.stateChange_ = builderForValue.Build(); return this; } public Builder MergeStateChange(global::bnet.protocol.channel.ChannelState value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasStateChange && + PrepareBuilder(); + if (result.hasStateChange && result.stateChange_ != global::bnet.protocol.channel.ChannelState.DefaultInstance) { result.stateChange_ = global::bnet.protocol.channel.ChannelState.CreateBuilder(result.stateChange_).MergeFrom(value).BuildPartial(); } else { @@ -1618,24 +1884,31 @@ public Builder MergeStateChange(global::bnet.protocol.channel.ChannelState value return this; } public Builder ClearStateChange() { + PrepareBuilder(); result.hasStateChange = false; - result.stateChange_ = global::bnet.protocol.channel.ChannelState.DefaultInstance; + result.stateChange_ = null; return this; } } static UpdateChannelStateRequest() { - object.ReferenceEquals(global::bnet.protocol.channel.Proto.Channel.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.channel.ChannelService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class UpdateMemberStateRequest : pb::GeneratedMessage { - private static readonly UpdateMemberStateRequest defaultInstance = new Builder().BuildPartial(); + private UpdateMemberStateRequest() { } + private static readonly UpdateMemberStateRequest defaultInstance = new UpdateMemberStateRequest().MakeReadOnly(); + private static readonly string[] _updateMemberStateRequestFieldNames = new string[] { "agent_id", "state_change" }; + private static readonly uint[] _updateMemberStateRequestFieldTags = new uint[] { 10, 18 }; public static UpdateMemberStateRequest DefaultInstance { get { return defaultInstance; } } public override UpdateMemberStateRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override UpdateMemberStateRequest ThisMessage { @@ -1643,21 +1916,21 @@ protected override UpdateMemberStateRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel.Proto.Channel.internal__static_bnet_protocol_channel_UpdateMemberStateRequest__Descriptor; } + get { return global::bnet.protocol.channel.ChannelService.internal__static_bnet_protocol_channel_UpdateMemberStateRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel.Proto.Channel.internal__static_bnet_protocol_channel_UpdateMemberStateRequest__FieldAccessorTable; } + get { return global::bnet.protocol.channel.ChannelService.internal__static_bnet_protocol_channel_UpdateMemberStateRequest__FieldAccessorTable; } } public const int AgentIdFieldNumber = 1; private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId agentId_; public bool HasAgentId { get { return hasAgentId; } } public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } + get { return agentId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int StateChangeFieldNumber = 2; @@ -1684,13 +1957,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasAgentId) { - output.WriteMessage(1, AgentId); + string[] field_names = _updateMemberStateRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); } - foreach (global::bnet.protocol.channel.Member element in StateChangeList) { - output.WriteMessage(2, element); + if (stateChange_.Count > 0) { + output.WriteMessageArray(2, field_names[1], stateChange_); } UnknownFields.WriteTo(output); } @@ -1702,7 +1976,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAgentId) { + if (hasAgentId) { size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); } foreach (global::bnet.protocol.channel.Member element in StateChangeList) { @@ -1738,38 +2012,73 @@ public static UpdateMemberStateRequest ParseDelimitedFrom(global::System.IO.Stre public static UpdateMemberStateRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static UpdateMemberStateRequest ParseFrom(pb::CodedInputStream input) { + public static UpdateMemberStateRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static UpdateMemberStateRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static UpdateMemberStateRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private UpdateMemberStateRequest MakeReadOnly() { + stateChange_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(UpdateMemberStateRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(UpdateMemberStateRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - UpdateMemberStateRequest result = new UpdateMemberStateRequest(); + private bool resultIsReadOnly; + private UpdateMemberStateRequest result; + + private UpdateMemberStateRequest PrepareBuilder() { + if (resultIsReadOnly) { + UpdateMemberStateRequest original = result; + result = new UpdateMemberStateRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override UpdateMemberStateRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new UpdateMemberStateRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -1781,13 +2090,11 @@ public override UpdateMemberStateRequest DefaultInstanceForType { } public override UpdateMemberStateRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.stateChange_.MakeReadOnly(); - UpdateMemberStateRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1801,30 +2108,42 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(UpdateMemberStateRequest other) { if (other == global::bnet.protocol.channel.UpdateMemberStateRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAgentId) { MergeAgentId(other.AgentId); } if (other.stateChange_.Count != 0) { - base.AddRange(other.stateChange_, result.stateChange_); + result.stateChange_.Add(other.stateChange_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_updateMemberStateRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _updateMemberStateRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1836,12 +2155,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { + if (result.hasAgentId) { subBuilder.MergeFrom(AgentId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1849,18 +2168,21 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 18: { - global::bnet.protocol.channel.Member.Builder subBuilder = global::bnet.protocol.channel.Member.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddStateChange(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.stateChange_, global::bnet.protocol.channel.Member.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasAgentId { - get { return result.HasAgentId; } + get { return result.hasAgentId; } } public global::bnet.protocol.EntityId AgentId { get { return result.AgentId; } @@ -1868,19 +2190,22 @@ public bool HasAgentId { } public Builder SetAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = value; return this; } public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = builderForValue.Build(); return this; } public Builder MergeAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && + PrepareBuilder(); + if (result.hasAgentId && result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); } else { @@ -1890,13 +2215,14 @@ public Builder MergeAgentId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearAgentId() { + PrepareBuilder(); result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.agentId_ = null; return this; } public pbc::IPopsicleList StateChangeList { - get { return result.stateChange_; } + get { return PrepareBuilder().stateChange_; } } public int StateChangeCount { get { return result.StateChangeCount; } @@ -1906,46 +2232,58 @@ public int StateChangeCount { } public Builder SetStateChange(int index, global::bnet.protocol.channel.Member value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.stateChange_[index] = value; return this; } public Builder SetStateChange(int index, global::bnet.protocol.channel.Member.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.stateChange_[index] = builderForValue.Build(); return this; } public Builder AddStateChange(global::bnet.protocol.channel.Member value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.stateChange_.Add(value); return this; } public Builder AddStateChange(global::bnet.protocol.channel.Member.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.stateChange_.Add(builderForValue.Build()); return this; } public Builder AddRangeStateChange(scg::IEnumerable values) { - base.AddRange(values, result.stateChange_); + PrepareBuilder(); + result.stateChange_.Add(values); return this; } public Builder ClearStateChange() { + PrepareBuilder(); result.stateChange_.Clear(); return this; } } static UpdateMemberStateRequest() { - object.ReferenceEquals(global::bnet.protocol.channel.Proto.Channel.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.channel.ChannelService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class DissolveRequest : pb::GeneratedMessage { - private static readonly DissolveRequest defaultInstance = new Builder().BuildPartial(); + private DissolveRequest() { } + private static readonly DissolveRequest defaultInstance = new DissolveRequest().MakeReadOnly(); + private static readonly string[] _dissolveRequestFieldNames = new string[] { "agent_id", "reason" }; + private static readonly uint[] _dissolveRequestFieldTags = new uint[] { 10, 16 }; public static DissolveRequest DefaultInstance { get { return defaultInstance; } } public override DissolveRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override DissolveRequest ThisMessage { @@ -1953,26 +2291,26 @@ protected override DissolveRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel.Proto.Channel.internal__static_bnet_protocol_channel_DissolveRequest__Descriptor; } + get { return global::bnet.protocol.channel.ChannelService.internal__static_bnet_protocol_channel_DissolveRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel.Proto.Channel.internal__static_bnet_protocol_channel_DissolveRequest__FieldAccessorTable; } + get { return global::bnet.protocol.channel.ChannelService.internal__static_bnet_protocol_channel_DissolveRequest__FieldAccessorTable; } } public const int AgentIdFieldNumber = 1; private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId agentId_; public bool HasAgentId { get { return hasAgentId; } } public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } + get { return agentId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int ReasonFieldNumber = 2; private bool hasReason; - private uint reason_ = 0; + private uint reason_; public bool HasReason { get { return hasReason; } } @@ -1989,13 +2327,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasAgentId) { - output.WriteMessage(1, AgentId); + string[] field_names = _dissolveRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); } - if (HasReason) { - output.WriteUInt32(2, Reason); + if (hasReason) { + output.WriteUInt32(2, field_names[1], Reason); } UnknownFields.WriteTo(output); } @@ -2007,10 +2346,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAgentId) { + if (hasAgentId) { size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); } - if (HasReason) { + if (hasReason) { size += pb::CodedOutputStream.ComputeUInt32Size(2, Reason); } size += UnknownFields.SerializedSize; @@ -2043,38 +2382,72 @@ public static DissolveRequest ParseDelimitedFrom(global::System.IO.Stream input) public static DissolveRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static DissolveRequest ParseFrom(pb::CodedInputStream input) { + public static DissolveRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static DissolveRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static DissolveRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private DissolveRequest MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(DissolveRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(DissolveRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - DissolveRequest result = new DissolveRequest(); + private bool resultIsReadOnly; + private DissolveRequest result; + + private DissolveRequest PrepareBuilder() { + if (resultIsReadOnly) { + DissolveRequest original = result; + result = new DissolveRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override DissolveRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new DissolveRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -2086,12 +2459,11 @@ public override DissolveRequest DefaultInstanceForType { } public override DissolveRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - DissolveRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2105,6 +2477,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(DissolveRequest other) { if (other == global::bnet.protocol.channel.DissolveRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAgentId) { MergeAgentId(other.AgentId); } @@ -2115,20 +2488,31 @@ public override Builder MergeFrom(DissolveRequest other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_dissolveRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _dissolveRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -2140,12 +2524,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { + if (result.hasAgentId) { subBuilder.MergeFrom(AgentId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2153,16 +2537,21 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 16: { - Reason = input.ReadUInt32(); + result.hasReason = input.ReadUInt32(ref result.reason_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasAgentId { - get { return result.HasAgentId; } + get { return result.hasAgentId; } } public global::bnet.protocol.EntityId AgentId { get { return result.AgentId; } @@ -2170,19 +2559,22 @@ public bool HasAgentId { } public Builder SetAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = value; return this; } public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = builderForValue.Build(); return this; } public Builder MergeAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && + PrepareBuilder(); + if (result.hasAgentId && result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); } else { @@ -2192,42 +2584,51 @@ public Builder MergeAgentId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearAgentId() { + PrepareBuilder(); result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.agentId_ = null; return this; } public bool HasReason { - get { return result.HasReason; } + get { return result.hasReason; } } public uint Reason { get { return result.Reason; } set { SetReason(value); } } public Builder SetReason(uint value) { + PrepareBuilder(); result.hasReason = true; result.reason_ = value; return this; } public Builder ClearReason() { + PrepareBuilder(); result.hasReason = false; result.reason_ = 0; return this; } } static DissolveRequest() { - object.ReferenceEquals(global::bnet.protocol.channel.Proto.Channel.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.channel.ChannelService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class SetRolesRequest : pb::GeneratedMessage { - private static readonly SetRolesRequest defaultInstance = new Builder().BuildPartial(); + private SetRolesRequest() { } + private static readonly SetRolesRequest defaultInstance = new SetRolesRequest().MakeReadOnly(); + private static readonly string[] _setRolesRequestFieldNames = new string[] { "agent_id", "member_id", "role" }; + private static readonly uint[] _setRolesRequestFieldTags = new uint[] { 10, 26, 18 }; public static SetRolesRequest DefaultInstance { get { return defaultInstance; } } public override SetRolesRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override SetRolesRequest ThisMessage { @@ -2235,24 +2636,25 @@ protected override SetRolesRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel.Proto.Channel.internal__static_bnet_protocol_channel_SetRolesRequest__Descriptor; } + get { return global::bnet.protocol.channel.ChannelService.internal__static_bnet_protocol_channel_SetRolesRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel.Proto.Channel.internal__static_bnet_protocol_channel_SetRolesRequest__FieldAccessorTable; } + get { return global::bnet.protocol.channel.ChannelService.internal__static_bnet_protocol_channel_SetRolesRequest__FieldAccessorTable; } } public const int AgentIdFieldNumber = 1; private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId agentId_; public bool HasAgentId { get { return hasAgentId; } } public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } + get { return agentId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int RoleFieldNumber = 2; + private int roleMemoizedSerializedSize; private pbc::PopsicleList role_ = new pbc::PopsicleList(); public scg::IList RoleList { get { return pbc::Lists.AsReadOnly(role_); } @@ -2288,18 +2690,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasAgentId) { - output.WriteMessage(1, AgentId); + string[] field_names = _setRolesRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); } if (role_.Count > 0) { - foreach (uint element in role_) { - output.WriteUInt32(2, element); - } + output.WritePackedUInt32Array(2, field_names[2], roleMemoizedSerializedSize, role_); } - foreach (global::bnet.protocol.EntityId element in MemberIdList) { - output.WriteMessage(3, element); + if (memberId_.Count > 0) { + output.WriteMessageArray(3, field_names[1], memberId_); } UnknownFields.WriteTo(output); } @@ -2311,7 +2712,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAgentId) { + if (hasAgentId) { size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); } { @@ -2320,7 +2721,10 @@ public override int SerializedSize { dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); } size += dataSize; - size += 1 * role_.Count; + if (role_.Count != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); + } + roleMemoizedSerializedSize = dataSize; } foreach (global::bnet.protocol.EntityId element in MemberIdList) { size += pb::CodedOutputStream.ComputeMessageSize(3, element); @@ -2355,38 +2759,74 @@ public static SetRolesRequest ParseDelimitedFrom(global::System.IO.Stream input) public static SetRolesRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static SetRolesRequest ParseFrom(pb::CodedInputStream input) { + public static SetRolesRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SetRolesRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static SetRolesRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private SetRolesRequest MakeReadOnly() { + role_.MakeReadOnly(); + memberId_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(SetRolesRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SetRolesRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - SetRolesRequest result = new SetRolesRequest(); + private bool resultIsReadOnly; + private SetRolesRequest result; + + private SetRolesRequest PrepareBuilder() { + if (resultIsReadOnly) { + SetRolesRequest original = result; + result = new SetRolesRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override SetRolesRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SetRolesRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -2398,14 +2838,11 @@ public override SetRolesRequest DefaultInstanceForType { } public override SetRolesRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.role_.MakeReadOnly(); - result.memberId_.MakeReadOnly(); - SetRolesRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2419,33 +2856,45 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SetRolesRequest other) { if (other == global::bnet.protocol.channel.SetRolesRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAgentId) { MergeAgentId(other.AgentId); } if (other.role_.Count != 0) { - base.AddRange(other.role_, result.role_); + result.role_.Add(other.role_); } if (other.memberId_.Count != 0) { - base.AddRange(other.memberId_, result.memberId_); + result.memberId_.Add(other.memberId_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_setRolesRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _setRolesRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -2457,35 +2906,39 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { + if (result.hasAgentId) { subBuilder.MergeFrom(AgentId); } input.ReadMessage(subBuilder, extensionRegistry); AgentId = subBuilder.BuildPartial(); break; } + case 18: case 16: { - AddRole(input.ReadUInt32()); + input.ReadUInt32Array(tag, field_name, result.role_); break; } case 26: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddMemberId(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.memberId_, global::bnet.protocol.EntityId.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasAgentId { - get { return result.HasAgentId; } + get { return result.hasAgentId; } } public global::bnet.protocol.EntityId AgentId { get { return result.AgentId; } @@ -2493,19 +2946,22 @@ public bool HasAgentId { } public Builder SetAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = value; return this; } public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = builderForValue.Build(); return this; } public Builder MergeAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && + PrepareBuilder(); + if (result.hasAgentId && result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); } else { @@ -2515,13 +2971,14 @@ public Builder MergeAgentId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearAgentId() { + PrepareBuilder(); result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.agentId_ = null; return this; } public pbc::IPopsicleList RoleList { - get { return result.role_; } + get { return PrepareBuilder().role_; } } public int RoleCount { get { return result.RoleCount; } @@ -2530,24 +2987,28 @@ public uint GetRole(int index) { return result.GetRole(index); } public Builder SetRole(int index, uint value) { + PrepareBuilder(); result.role_[index] = value; return this; } public Builder AddRole(uint value) { + PrepareBuilder(); result.role_.Add(value); return this; } public Builder AddRangeRole(scg::IEnumerable values) { - base.AddRange(values, result.role_); + PrepareBuilder(); + result.role_.Add(values); return this; } public Builder ClearRole() { + PrepareBuilder(); result.role_.Clear(); return this; } public pbc::IPopsicleList MemberIdList { - get { return result.memberId_; } + get { return PrepareBuilder().memberId_; } } public int MemberIdCount { get { return result.MemberIdCount; } @@ -2557,46 +3018,58 @@ public int MemberIdCount { } public Builder SetMemberId(int index, global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.memberId_[index] = value; return this; } public Builder SetMemberId(int index, global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.memberId_[index] = builderForValue.Build(); return this; } public Builder AddMemberId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.memberId_.Add(value); return this; } public Builder AddMemberId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.memberId_.Add(builderForValue.Build()); return this; } public Builder AddRangeMemberId(scg::IEnumerable values) { - base.AddRange(values, result.memberId_); + PrepareBuilder(); + result.memberId_.Add(values); return this; } public Builder ClearMemberId() { + PrepareBuilder(); result.memberId_.Clear(); return this; } } static SetRolesRequest() { - object.ReferenceEquals(global::bnet.protocol.channel.Proto.Channel.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.channel.ChannelService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class AddNotification : pb::GeneratedMessage { - private static readonly AddNotification defaultInstance = new Builder().BuildPartial(); + private AddNotification() { } + private static readonly AddNotification defaultInstance = new AddNotification().MakeReadOnly(); + private static readonly string[] _addNotificationFieldNames = new string[] { "channel_state", "member", "self" }; + private static readonly uint[] _addNotificationFieldTags = new uint[] { 26, 18, 10 }; public static AddNotification DefaultInstance { get { return defaultInstance; } } public override AddNotification DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override AddNotification ThisMessage { @@ -2604,21 +3077,21 @@ protected override AddNotification ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel.Proto.Channel.internal__static_bnet_protocol_channel_AddNotification__Descriptor; } + get { return global::bnet.protocol.channel.ChannelService.internal__static_bnet_protocol_channel_AddNotification__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel.Proto.Channel.internal__static_bnet_protocol_channel_AddNotification__FieldAccessorTable; } + get { return global::bnet.protocol.channel.ChannelService.internal__static_bnet_protocol_channel_AddNotification__FieldAccessorTable; } } public const int SelfFieldNumber = 1; private bool hasSelf; - private global::bnet.protocol.channel.Member self_ = global::bnet.protocol.channel.Member.DefaultInstance; + private global::bnet.protocol.channel.Member self_; public bool HasSelf { get { return hasSelf; } } public global::bnet.protocol.channel.Member Self { - get { return self_; } + get { return self_ ?? global::bnet.protocol.channel.Member.DefaultInstance; } } public const int MemberFieldNumber = 2; @@ -2635,12 +3108,12 @@ public int MemberCount { public const int ChannelStateFieldNumber = 3; private bool hasChannelState; - private global::bnet.protocol.channel.ChannelState channelState_ = global::bnet.protocol.channel.ChannelState.DefaultInstance; + private global::bnet.protocol.channel.ChannelState channelState_; public bool HasChannelState { get { return hasChannelState; } } public global::bnet.protocol.channel.ChannelState ChannelState { - get { return channelState_; } + get { return channelState_ ?? global::bnet.protocol.channel.ChannelState.DefaultInstance; } } public override bool IsInitialized { @@ -2657,16 +3130,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasSelf) { - output.WriteMessage(1, Self); + string[] field_names = _addNotificationFieldNames; + if (hasSelf) { + output.WriteMessage(1, field_names[2], Self); } - foreach (global::bnet.protocol.channel.Member element in MemberList) { - output.WriteMessage(2, element); + if (member_.Count > 0) { + output.WriteMessageArray(2, field_names[1], member_); } - if (HasChannelState) { - output.WriteMessage(3, ChannelState); + if (hasChannelState) { + output.WriteMessage(3, field_names[0], ChannelState); } UnknownFields.WriteTo(output); } @@ -2678,13 +3152,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasSelf) { + if (hasSelf) { size += pb::CodedOutputStream.ComputeMessageSize(1, Self); } foreach (global::bnet.protocol.channel.Member element in MemberList) { size += pb::CodedOutputStream.ComputeMessageSize(2, element); } - if (HasChannelState) { + if (hasChannelState) { size += pb::CodedOutputStream.ComputeMessageSize(3, ChannelState); } size += UnknownFields.SerializedSize; @@ -2717,38 +3191,73 @@ public static AddNotification ParseDelimitedFrom(global::System.IO.Stream input) public static AddNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static AddNotification ParseFrom(pb::CodedInputStream input) { + public static AddNotification ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static AddNotification ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static AddNotification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private AddNotification MakeReadOnly() { + member_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(AddNotification prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(AddNotification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - AddNotification result = new AddNotification(); + private bool resultIsReadOnly; + private AddNotification result; + + private AddNotification PrepareBuilder() { + if (resultIsReadOnly) { + AddNotification original = result; + result = new AddNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override AddNotification MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new AddNotification(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -2760,13 +3269,11 @@ public override AddNotification DefaultInstanceForType { } public override AddNotification BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.member_.MakeReadOnly(); - AddNotification returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2780,11 +3287,12 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(AddNotification other) { if (other == global::bnet.protocol.channel.AddNotification.DefaultInstance) return this; + PrepareBuilder(); if (other.HasSelf) { MergeSelf(other.Self); } if (other.member_.Count != 0) { - base.AddRange(other.member_, result.member_); + result.member_.Add(other.member_); } if (other.HasChannelState) { MergeChannelState(other.ChannelState); @@ -2793,20 +3301,31 @@ public override Builder MergeFrom(AddNotification other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_addNotificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _addNotificationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -2818,12 +3337,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.channel.Member.Builder subBuilder = global::bnet.protocol.channel.Member.CreateBuilder(); - if (HasSelf) { + if (result.hasSelf) { subBuilder.MergeFrom(Self); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2831,14 +3350,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 18: { - global::bnet.protocol.channel.Member.Builder subBuilder = global::bnet.protocol.channel.Member.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddMember(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.member_, global::bnet.protocol.channel.Member.DefaultInstance, extensionRegistry); break; } case 26: { global::bnet.protocol.channel.ChannelState.Builder subBuilder = global::bnet.protocol.channel.ChannelState.CreateBuilder(); - if (HasChannelState) { + if (result.hasChannelState) { subBuilder.MergeFrom(ChannelState); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2847,11 +3364,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasSelf { - get { return result.HasSelf; } + get { return result.hasSelf; } } public global::bnet.protocol.channel.Member Self { get { return result.Self; } @@ -2859,19 +3381,22 @@ public bool HasSelf { } public Builder SetSelf(global::bnet.protocol.channel.Member value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasSelf = true; result.self_ = value; return this; } public Builder SetSelf(global::bnet.protocol.channel.Member.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasSelf = true; result.self_ = builderForValue.Build(); return this; } public Builder MergeSelf(global::bnet.protocol.channel.Member value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasSelf && + PrepareBuilder(); + if (result.hasSelf && result.self_ != global::bnet.protocol.channel.Member.DefaultInstance) { result.self_ = global::bnet.protocol.channel.Member.CreateBuilder(result.self_).MergeFrom(value).BuildPartial(); } else { @@ -2881,13 +3406,14 @@ public Builder MergeSelf(global::bnet.protocol.channel.Member value) { return this; } public Builder ClearSelf() { + PrepareBuilder(); result.hasSelf = false; - result.self_ = global::bnet.protocol.channel.Member.DefaultInstance; + result.self_ = null; return this; } public pbc::IPopsicleList MemberList { - get { return result.member_; } + get { return PrepareBuilder().member_; } } public int MemberCount { get { return result.MemberCount; } @@ -2897,35 +3423,41 @@ public int MemberCount { } public Builder SetMember(int index, global::bnet.protocol.channel.Member value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.member_[index] = value; return this; } public Builder SetMember(int index, global::bnet.protocol.channel.Member.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.member_[index] = builderForValue.Build(); return this; } public Builder AddMember(global::bnet.protocol.channel.Member value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.member_.Add(value); return this; } public Builder AddMember(global::bnet.protocol.channel.Member.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.member_.Add(builderForValue.Build()); return this; } public Builder AddRangeMember(scg::IEnumerable values) { - base.AddRange(values, result.member_); + PrepareBuilder(); + result.member_.Add(values); return this; } public Builder ClearMember() { + PrepareBuilder(); result.member_.Clear(); return this; } public bool HasChannelState { - get { return result.HasChannelState; } + get { return result.hasChannelState; } } public global::bnet.protocol.channel.ChannelState ChannelState { get { return result.ChannelState; } @@ -2933,19 +3465,22 @@ public bool HasChannelState { } public Builder SetChannelState(global::bnet.protocol.channel.ChannelState value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasChannelState = true; result.channelState_ = value; return this; } public Builder SetChannelState(global::bnet.protocol.channel.ChannelState.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasChannelState = true; result.channelState_ = builderForValue.Build(); return this; } public Builder MergeChannelState(global::bnet.protocol.channel.ChannelState value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasChannelState && + PrepareBuilder(); + if (result.hasChannelState && result.channelState_ != global::bnet.protocol.channel.ChannelState.DefaultInstance) { result.channelState_ = global::bnet.protocol.channel.ChannelState.CreateBuilder(result.channelState_).MergeFrom(value).BuildPartial(); } else { @@ -2955,24 +3490,31 @@ public Builder MergeChannelState(global::bnet.protocol.channel.ChannelState valu return this; } public Builder ClearChannelState() { + PrepareBuilder(); result.hasChannelState = false; - result.channelState_ = global::bnet.protocol.channel.ChannelState.DefaultInstance; + result.channelState_ = null; return this; } } static AddNotification() { - object.ReferenceEquals(global::bnet.protocol.channel.Proto.Channel.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.channel.ChannelService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class JoinNotification : pb::GeneratedMessage { - private static readonly JoinNotification defaultInstance = new Builder().BuildPartial(); + private JoinNotification() { } + private static readonly JoinNotification defaultInstance = new JoinNotification().MakeReadOnly(); + private static readonly string[] _joinNotificationFieldNames = new string[] { "member" }; + private static readonly uint[] _joinNotificationFieldTags = new uint[] { 10 }; public static JoinNotification DefaultInstance { get { return defaultInstance; } } public override JoinNotification DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override JoinNotification ThisMessage { @@ -2980,21 +3522,21 @@ protected override JoinNotification ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel.Proto.Channel.internal__static_bnet_protocol_channel_JoinNotification__Descriptor; } + get { return global::bnet.protocol.channel.ChannelService.internal__static_bnet_protocol_channel_JoinNotification__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel.Proto.Channel.internal__static_bnet_protocol_channel_JoinNotification__FieldAccessorTable; } + get { return global::bnet.protocol.channel.ChannelService.internal__static_bnet_protocol_channel_JoinNotification__FieldAccessorTable; } } public const int MemberFieldNumber = 1; private bool hasMember; - private global::bnet.protocol.channel.Member member_ = global::bnet.protocol.channel.Member.DefaultInstance; + private global::bnet.protocol.channel.Member member_; public bool HasMember { get { return hasMember; } } public global::bnet.protocol.channel.Member Member { - get { return member_; } + get { return member_ ?? global::bnet.protocol.channel.Member.DefaultInstance; } } public override bool IsInitialized { @@ -3005,10 +3547,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasMember) { - output.WriteMessage(1, Member); + string[] field_names = _joinNotificationFieldNames; + if (hasMember) { + output.WriteMessage(1, field_names[0], Member); } UnknownFields.WriteTo(output); } @@ -3020,7 +3563,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasMember) { + if (hasMember) { size += pb::CodedOutputStream.ComputeMessageSize(1, Member); } size += UnknownFields.SerializedSize; @@ -3053,38 +3596,72 @@ public static JoinNotification ParseDelimitedFrom(global::System.IO.Stream input public static JoinNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static JoinNotification ParseFrom(pb::CodedInputStream input) { + public static JoinNotification ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static JoinNotification ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static JoinNotification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private JoinNotification MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(JoinNotification prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(JoinNotification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - JoinNotification result = new JoinNotification(); + private bool resultIsReadOnly; + private JoinNotification result; + + private JoinNotification PrepareBuilder() { + if (resultIsReadOnly) { + JoinNotification original = result; + result = new JoinNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override JoinNotification MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new JoinNotification(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -3096,12 +3673,11 @@ public override JoinNotification DefaultInstanceForType { } public override JoinNotification BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - JoinNotification returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -3115,6 +3691,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(JoinNotification other) { if (other == global::bnet.protocol.channel.JoinNotification.DefaultInstance) return this; + PrepareBuilder(); if (other.HasMember) { MergeMember(other.Member); } @@ -3122,20 +3699,31 @@ public override Builder MergeFrom(JoinNotification other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_joinNotificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _joinNotificationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -3147,12 +3735,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.channel.Member.Builder subBuilder = global::bnet.protocol.channel.Member.CreateBuilder(); - if (HasMember) { + if (result.hasMember) { subBuilder.MergeFrom(Member); } input.ReadMessage(subBuilder, extensionRegistry); @@ -3161,11 +3749,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasMember { - get { return result.HasMember; } + get { return result.hasMember; } } public global::bnet.protocol.channel.Member Member { get { return result.Member; } @@ -3173,19 +3766,22 @@ public bool HasMember { } public Builder SetMember(global::bnet.protocol.channel.Member value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasMember = true; result.member_ = value; return this; } public Builder SetMember(global::bnet.protocol.channel.Member.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasMember = true; result.member_ = builderForValue.Build(); return this; } public Builder MergeMember(global::bnet.protocol.channel.Member value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasMember && + PrepareBuilder(); + if (result.hasMember && result.member_ != global::bnet.protocol.channel.Member.DefaultInstance) { result.member_ = global::bnet.protocol.channel.Member.CreateBuilder(result.member_).MergeFrom(value).BuildPartial(); } else { @@ -3195,24 +3791,31 @@ public Builder MergeMember(global::bnet.protocol.channel.Member value) { return this; } public Builder ClearMember() { + PrepareBuilder(); result.hasMember = false; - result.member_ = global::bnet.protocol.channel.Member.DefaultInstance; + result.member_ = null; return this; } } static JoinNotification() { - object.ReferenceEquals(global::bnet.protocol.channel.Proto.Channel.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.channel.ChannelService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class RemoveNotification : pb::GeneratedMessage { - private static readonly RemoveNotification defaultInstance = new Builder().BuildPartial(); + private RemoveNotification() { } + private static readonly RemoveNotification defaultInstance = new RemoveNotification().MakeReadOnly(); + private static readonly string[] _removeNotificationFieldNames = new string[] { "agent_id", "member_id", "reason" }; + private static readonly uint[] _removeNotificationFieldTags = new uint[] { 10, 18, 24 }; public static RemoveNotification DefaultInstance { get { return defaultInstance; } } public override RemoveNotification DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override RemoveNotification ThisMessage { @@ -3220,36 +3823,36 @@ protected override RemoveNotification ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel.Proto.Channel.internal__static_bnet_protocol_channel_RemoveNotification__Descriptor; } + get { return global::bnet.protocol.channel.ChannelService.internal__static_bnet_protocol_channel_RemoveNotification__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel.Proto.Channel.internal__static_bnet_protocol_channel_RemoveNotification__FieldAccessorTable; } + get { return global::bnet.protocol.channel.ChannelService.internal__static_bnet_protocol_channel_RemoveNotification__FieldAccessorTable; } } public const int AgentIdFieldNumber = 1; private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId agentId_; public bool HasAgentId { get { return hasAgentId; } } public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } + get { return agentId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int MemberIdFieldNumber = 2; private bool hasMemberId; - private global::bnet.protocol.EntityId memberId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId memberId_; public bool HasMemberId { get { return hasMemberId; } } public global::bnet.protocol.EntityId MemberId { - get { return memberId_; } + get { return memberId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int ReasonFieldNumber = 3; private bool hasReason; - private uint reason_ = 0; + private uint reason_; public bool HasReason { get { return hasReason; } } @@ -3268,16 +3871,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasAgentId) { - output.WriteMessage(1, AgentId); + string[] field_names = _removeNotificationFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); } - if (HasMemberId) { - output.WriteMessage(2, MemberId); + if (hasMemberId) { + output.WriteMessage(2, field_names[1], MemberId); } - if (HasReason) { - output.WriteUInt32(3, Reason); + if (hasReason) { + output.WriteUInt32(3, field_names[2], Reason); } UnknownFields.WriteTo(output); } @@ -3289,13 +3893,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAgentId) { + if (hasAgentId) { size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); } - if (HasMemberId) { + if (hasMemberId) { size += pb::CodedOutputStream.ComputeMessageSize(2, MemberId); } - if (HasReason) { + if (hasReason) { size += pb::CodedOutputStream.ComputeUInt32Size(3, Reason); } size += UnknownFields.SerializedSize; @@ -3328,38 +3932,72 @@ public static RemoveNotification ParseDelimitedFrom(global::System.IO.Stream inp public static RemoveNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static RemoveNotification ParseFrom(pb::CodedInputStream input) { + public static RemoveNotification ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static RemoveNotification ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static RemoveNotification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private RemoveNotification MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(RemoveNotification prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(RemoveNotification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - RemoveNotification result = new RemoveNotification(); + private bool resultIsReadOnly; + private RemoveNotification result; + + private RemoveNotification PrepareBuilder() { + if (resultIsReadOnly) { + RemoveNotification original = result; + result = new RemoveNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override RemoveNotification MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new RemoveNotification(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -3371,12 +4009,11 @@ public override RemoveNotification DefaultInstanceForType { } public override RemoveNotification BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - RemoveNotification returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -3390,6 +4027,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(RemoveNotification other) { if (other == global::bnet.protocol.channel.RemoveNotification.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAgentId) { MergeAgentId(other.AgentId); } @@ -3403,20 +4041,31 @@ public override Builder MergeFrom(RemoveNotification other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_removeNotificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _removeNotificationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -3428,12 +4077,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { + if (result.hasAgentId) { subBuilder.MergeFrom(AgentId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -3442,7 +4091,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasMemberId) { + if (result.hasMemberId) { subBuilder.MergeFrom(MemberId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -3450,16 +4099,21 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 24: { - Reason = input.ReadUInt32(); + result.hasReason = input.ReadUInt32(ref result.reason_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasAgentId { - get { return result.HasAgentId; } + get { return result.hasAgentId; } } public global::bnet.protocol.EntityId AgentId { get { return result.AgentId; } @@ -3467,19 +4121,22 @@ public bool HasAgentId { } public Builder SetAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = value; return this; } public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = builderForValue.Build(); return this; } public Builder MergeAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && + PrepareBuilder(); + if (result.hasAgentId && result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); } else { @@ -3489,13 +4146,14 @@ public Builder MergeAgentId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearAgentId() { + PrepareBuilder(); result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.agentId_ = null; return this; } public bool HasMemberId { - get { return result.HasMemberId; } + get { return result.hasMemberId; } } public global::bnet.protocol.EntityId MemberId { get { return result.MemberId; } @@ -3503,19 +4161,22 @@ public bool HasMemberId { } public Builder SetMemberId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasMemberId = true; result.memberId_ = value; return this; } public Builder SetMemberId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasMemberId = true; result.memberId_ = builderForValue.Build(); return this; } public Builder MergeMemberId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasMemberId && + PrepareBuilder(); + if (result.hasMemberId && result.memberId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.memberId_ = global::bnet.protocol.EntityId.CreateBuilder(result.memberId_).MergeFrom(value).BuildPartial(); } else { @@ -3525,42 +4186,51 @@ public Builder MergeMemberId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearMemberId() { + PrepareBuilder(); result.hasMemberId = false; - result.memberId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.memberId_ = null; return this; } public bool HasReason { - get { return result.HasReason; } + get { return result.hasReason; } } public uint Reason { get { return result.Reason; } set { SetReason(value); } } public Builder SetReason(uint value) { + PrepareBuilder(); result.hasReason = true; result.reason_ = value; return this; } public Builder ClearReason() { + PrepareBuilder(); result.hasReason = false; result.reason_ = 0; return this; } } static RemoveNotification() { - object.ReferenceEquals(global::bnet.protocol.channel.Proto.Channel.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.channel.ChannelService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class LeaveNotification : pb::GeneratedMessage { - private static readonly LeaveNotification defaultInstance = new Builder().BuildPartial(); + private LeaveNotification() { } + private static readonly LeaveNotification defaultInstance = new LeaveNotification().MakeReadOnly(); + private static readonly string[] _leaveNotificationFieldNames = new string[] { "agent_id", "member_id", "reason" }; + private static readonly uint[] _leaveNotificationFieldTags = new uint[] { 10, 18, 24 }; public static LeaveNotification DefaultInstance { get { return defaultInstance; } } public override LeaveNotification DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override LeaveNotification ThisMessage { @@ -3568,31 +4238,41 @@ protected override LeaveNotification ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel.Proto.Channel.internal__static_bnet_protocol_channel_LeaveNotification__Descriptor; } + get { return global::bnet.protocol.channel.ChannelService.internal__static_bnet_protocol_channel_LeaveNotification__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel.Proto.Channel.internal__static_bnet_protocol_channel_LeaveNotification__FieldAccessorTable; } + get { return global::bnet.protocol.channel.ChannelService.internal__static_bnet_protocol_channel_LeaveNotification__FieldAccessorTable; } } public const int AgentIdFieldNumber = 1; private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId agentId_; public bool HasAgentId { get { return hasAgentId; } } public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } + get { return agentId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int MemberIdFieldNumber = 2; private bool hasMemberId; - private global::bnet.protocol.EntityId memberId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId memberId_; public bool HasMemberId { get { return hasMemberId; } } public global::bnet.protocol.EntityId MemberId { - get { return memberId_; } + get { return memberId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int ReasonFieldNumber = 3; + private bool hasReason; + private uint reason_; + public bool HasReason { + get { return hasReason; } + } + public uint Reason { + get { return reason_; } } public override bool IsInitialized { @@ -3606,13 +4286,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasAgentId) { - output.WriteMessage(1, AgentId); + string[] field_names = _leaveNotificationFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); } - if (HasMemberId) { - output.WriteMessage(2, MemberId); + if (hasMemberId) { + output.WriteMessage(2, field_names[1], MemberId); + } + if (hasReason) { + output.WriteUInt32(3, field_names[2], Reason); } UnknownFields.WriteTo(output); } @@ -3624,12 +4308,15 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAgentId) { + if (hasAgentId) { size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); } - if (HasMemberId) { + if (hasMemberId) { size += pb::CodedOutputStream.ComputeMessageSize(2, MemberId); } + if (hasReason) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, Reason); + } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; return size; @@ -3660,38 +4347,72 @@ public static LeaveNotification ParseDelimitedFrom(global::System.IO.Stream inpu public static LeaveNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static LeaveNotification ParseFrom(pb::CodedInputStream input) { + public static LeaveNotification ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static LeaveNotification ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static LeaveNotification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private LeaveNotification MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(LeaveNotification prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(LeaveNotification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private LeaveNotification result; + + private LeaveNotification PrepareBuilder() { + if (resultIsReadOnly) { + LeaveNotification original = result; + result = new LeaveNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - LeaveNotification result = new LeaveNotification(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override LeaveNotification MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new LeaveNotification(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -3703,12 +4424,11 @@ public override LeaveNotification DefaultInstanceForType { } public override LeaveNotification BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - LeaveNotification returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -3722,30 +4442,45 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(LeaveNotification other) { if (other == global::bnet.protocol.channel.LeaveNotification.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAgentId) { MergeAgentId(other.AgentId); } if (other.HasMemberId) { MergeMemberId(other.MemberId); } + if (other.HasReason) { + Reason = other.Reason; + } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_leaveNotificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _leaveNotificationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -3757,12 +4492,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { + if (result.hasAgentId) { subBuilder.MergeFrom(AgentId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -3771,20 +4506,29 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasMemberId) { + if (result.hasMemberId) { subBuilder.MergeFrom(MemberId); } input.ReadMessage(subBuilder, extensionRegistry); MemberId = subBuilder.BuildPartial(); break; } + case 24: { + result.hasReason = input.ReadUInt32(ref result.reason_); + break; + } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasAgentId { - get { return result.HasAgentId; } + get { return result.hasAgentId; } } public global::bnet.protocol.EntityId AgentId { get { return result.AgentId; } @@ -3792,19 +4536,22 @@ public bool HasAgentId { } public Builder SetAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = value; return this; } public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = builderForValue.Build(); return this; } public Builder MergeAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && + PrepareBuilder(); + if (result.hasAgentId && result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); } else { @@ -3814,13 +4561,14 @@ public Builder MergeAgentId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearAgentId() { + PrepareBuilder(); result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.agentId_ = null; return this; } public bool HasMemberId { - get { return result.HasMemberId; } + get { return result.hasMemberId; } } public global::bnet.protocol.EntityId MemberId { get { return result.MemberId; } @@ -3828,19 +4576,22 @@ public bool HasMemberId { } public Builder SetMemberId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasMemberId = true; result.memberId_ = value; return this; } public Builder SetMemberId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasMemberId = true; result.memberId_ = builderForValue.Build(); return this; } public Builder MergeMemberId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasMemberId && + PrepareBuilder(); + if (result.hasMemberId && result.memberId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.memberId_ = global::bnet.protocol.EntityId.CreateBuilder(result.memberId_).MergeFrom(value).BuildPartial(); } else { @@ -3850,24 +4601,51 @@ public Builder MergeMemberId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearMemberId() { + PrepareBuilder(); result.hasMemberId = false; - result.memberId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.memberId_ = null; + return this; + } + + public bool HasReason { + get { return result.hasReason; } + } + public uint Reason { + get { return result.Reason; } + set { SetReason(value); } + } + public Builder SetReason(uint value) { + PrepareBuilder(); + result.hasReason = true; + result.reason_ = value; + return this; + } + public Builder ClearReason() { + PrepareBuilder(); + result.hasReason = false; + result.reason_ = 0; return this; } } static LeaveNotification() { - object.ReferenceEquals(global::bnet.protocol.channel.Proto.Channel.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.channel.ChannelService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class SendMessageNotification : pb::GeneratedMessage { - private static readonly SendMessageNotification defaultInstance = new Builder().BuildPartial(); + private SendMessageNotification() { } + private static readonly SendMessageNotification defaultInstance = new SendMessageNotification().MakeReadOnly(); + private static readonly string[] _sendMessageNotificationFieldNames = new string[] { "agent_id", "message", "required_privileges" }; + private static readonly uint[] _sendMessageNotificationFieldTags = new uint[] { 10, 18, 24 }; public static SendMessageNotification DefaultInstance { get { return defaultInstance; } } public override SendMessageNotification DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override SendMessageNotification ThisMessage { @@ -3875,36 +4653,36 @@ protected override SendMessageNotification ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel.Proto.Channel.internal__static_bnet_protocol_channel_SendMessageNotification__Descriptor; } + get { return global::bnet.protocol.channel.ChannelService.internal__static_bnet_protocol_channel_SendMessageNotification__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel.Proto.Channel.internal__static_bnet_protocol_channel_SendMessageNotification__FieldAccessorTable; } + get { return global::bnet.protocol.channel.ChannelService.internal__static_bnet_protocol_channel_SendMessageNotification__FieldAccessorTable; } } public const int AgentIdFieldNumber = 1; private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId agentId_; public bool HasAgentId { get { return hasAgentId; } } public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } + get { return agentId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int MessageFieldNumber = 2; private bool hasMessage; - private global::bnet.protocol.channel.Message message_ = global::bnet.protocol.channel.Message.DefaultInstance; + private global::bnet.protocol.channel.Message message_; public bool HasMessage { get { return hasMessage; } } public global::bnet.protocol.channel.Message Message { - get { return message_; } + get { return message_ ?? global::bnet.protocol.channel.Message.DefaultInstance; } } public const int RequiredPrivilegesFieldNumber = 3; private bool hasRequiredPrivileges; - private ulong requiredPrivileges_ = 0UL; + private ulong requiredPrivileges_; public bool HasRequiredPrivileges { get { return hasRequiredPrivileges; } } @@ -3923,16 +4701,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasAgentId) { - output.WriteMessage(1, AgentId); + string[] field_names = _sendMessageNotificationFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); } - if (HasMessage) { - output.WriteMessage(2, Message); + if (hasMessage) { + output.WriteMessage(2, field_names[1], Message); } - if (HasRequiredPrivileges) { - output.WriteUInt64(3, RequiredPrivileges); + if (hasRequiredPrivileges) { + output.WriteUInt64(3, field_names[2], RequiredPrivileges); } UnknownFields.WriteTo(output); } @@ -3944,13 +4723,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAgentId) { + if (hasAgentId) { size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); } - if (HasMessage) { + if (hasMessage) { size += pb::CodedOutputStream.ComputeMessageSize(2, Message); } - if (HasRequiredPrivileges) { + if (hasRequiredPrivileges) { size += pb::CodedOutputStream.ComputeUInt64Size(3, RequiredPrivileges); } size += UnknownFields.SerializedSize; @@ -3983,38 +4762,72 @@ public static SendMessageNotification ParseDelimitedFrom(global::System.IO.Strea public static SendMessageNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static SendMessageNotification ParseFrom(pb::CodedInputStream input) { + public static SendMessageNotification ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SendMessageNotification ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static SendMessageNotification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private SendMessageNotification MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(SendMessageNotification prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SendMessageNotification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - SendMessageNotification result = new SendMessageNotification(); + private bool resultIsReadOnly; + private SendMessageNotification result; + + private SendMessageNotification PrepareBuilder() { + if (resultIsReadOnly) { + SendMessageNotification original = result; + result = new SendMessageNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override SendMessageNotification MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SendMessageNotification(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -4026,12 +4839,11 @@ public override SendMessageNotification DefaultInstanceForType { } public override SendMessageNotification BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - SendMessageNotification returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -4045,6 +4857,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SendMessageNotification other) { if (other == global::bnet.protocol.channel.SendMessageNotification.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAgentId) { MergeAgentId(other.AgentId); } @@ -4058,20 +4871,31 @@ public override Builder MergeFrom(SendMessageNotification other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_sendMessageNotificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _sendMessageNotificationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -4083,12 +4907,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { + if (result.hasAgentId) { subBuilder.MergeFrom(AgentId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -4097,7 +4921,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.channel.Message.Builder subBuilder = global::bnet.protocol.channel.Message.CreateBuilder(); - if (HasMessage) { + if (result.hasMessage) { subBuilder.MergeFrom(Message); } input.ReadMessage(subBuilder, extensionRegistry); @@ -4105,16 +4929,21 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 24: { - RequiredPrivileges = input.ReadUInt64(); + result.hasRequiredPrivileges = input.ReadUInt64(ref result.requiredPrivileges_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasAgentId { - get { return result.HasAgentId; } + get { return result.hasAgentId; } } public global::bnet.protocol.EntityId AgentId { get { return result.AgentId; } @@ -4122,19 +4951,22 @@ public bool HasAgentId { } public Builder SetAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = value; return this; } public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = builderForValue.Build(); return this; } public Builder MergeAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && + PrepareBuilder(); + if (result.hasAgentId && result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); } else { @@ -4144,13 +4976,14 @@ public Builder MergeAgentId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearAgentId() { + PrepareBuilder(); result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.agentId_ = null; return this; } public bool HasMessage { - get { return result.HasMessage; } + get { return result.hasMessage; } } public global::bnet.protocol.channel.Message Message { get { return result.Message; } @@ -4158,19 +4991,22 @@ public bool HasMessage { } public Builder SetMessage(global::bnet.protocol.channel.Message value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasMessage = true; result.message_ = value; return this; } public Builder SetMessage(global::bnet.protocol.channel.Message.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasMessage = true; result.message_ = builderForValue.Build(); return this; } public Builder MergeMessage(global::bnet.protocol.channel.Message value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasMessage && + PrepareBuilder(); + if (result.hasMessage && result.message_ != global::bnet.protocol.channel.Message.DefaultInstance) { result.message_ = global::bnet.protocol.channel.Message.CreateBuilder(result.message_).MergeFrom(value).BuildPartial(); } else { @@ -4180,42 +5016,51 @@ public Builder MergeMessage(global::bnet.protocol.channel.Message value) { return this; } public Builder ClearMessage() { + PrepareBuilder(); result.hasMessage = false; - result.message_ = global::bnet.protocol.channel.Message.DefaultInstance; + result.message_ = null; return this; } public bool HasRequiredPrivileges { - get { return result.HasRequiredPrivileges; } + get { return result.hasRequiredPrivileges; } } public ulong RequiredPrivileges { get { return result.RequiredPrivileges; } set { SetRequiredPrivileges(value); } } public Builder SetRequiredPrivileges(ulong value) { + PrepareBuilder(); result.hasRequiredPrivileges = true; result.requiredPrivileges_ = value; return this; } public Builder ClearRequiredPrivileges() { + PrepareBuilder(); result.hasRequiredPrivileges = false; result.requiredPrivileges_ = 0UL; return this; } } static SendMessageNotification() { - object.ReferenceEquals(global::bnet.protocol.channel.Proto.Channel.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.channel.ChannelService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class UpdateChannelStateNotification : pb::GeneratedMessage { - private static readonly UpdateChannelStateNotification defaultInstance = new Builder().BuildPartial(); + private UpdateChannelStateNotification() { } + private static readonly UpdateChannelStateNotification defaultInstance = new UpdateChannelStateNotification().MakeReadOnly(); + private static readonly string[] _updateChannelStateNotificationFieldNames = new string[] { "agent_id", "state_change" }; + private static readonly uint[] _updateChannelStateNotificationFieldTags = new uint[] { 10, 18 }; public static UpdateChannelStateNotification DefaultInstance { get { return defaultInstance; } } public override UpdateChannelStateNotification DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override UpdateChannelStateNotification ThisMessage { @@ -4223,31 +5068,31 @@ protected override UpdateChannelStateNotification ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel.Proto.Channel.internal__static_bnet_protocol_channel_UpdateChannelStateNotification__Descriptor; } + get { return global::bnet.protocol.channel.ChannelService.internal__static_bnet_protocol_channel_UpdateChannelStateNotification__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel.Proto.Channel.internal__static_bnet_protocol_channel_UpdateChannelStateNotification__FieldAccessorTable; } + get { return global::bnet.protocol.channel.ChannelService.internal__static_bnet_protocol_channel_UpdateChannelStateNotification__FieldAccessorTable; } } public const int AgentIdFieldNumber = 1; private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId agentId_; public bool HasAgentId { get { return hasAgentId; } } public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } + get { return agentId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int StateChangeFieldNumber = 2; private bool hasStateChange; - private global::bnet.protocol.channel.ChannelState stateChange_ = global::bnet.protocol.channel.ChannelState.DefaultInstance; + private global::bnet.protocol.channel.ChannelState stateChange_; public bool HasStateChange { get { return hasStateChange; } } public global::bnet.protocol.channel.ChannelState StateChange { - get { return stateChange_; } + get { return stateChange_ ?? global::bnet.protocol.channel.ChannelState.DefaultInstance; } } public override bool IsInitialized { @@ -4261,13 +5106,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasAgentId) { - output.WriteMessage(1, AgentId); + string[] field_names = _updateChannelStateNotificationFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); } - if (HasStateChange) { - output.WriteMessage(2, StateChange); + if (hasStateChange) { + output.WriteMessage(2, field_names[1], StateChange); } UnknownFields.WriteTo(output); } @@ -4279,10 +5125,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAgentId) { + if (hasAgentId) { size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); } - if (HasStateChange) { + if (hasStateChange) { size += pb::CodedOutputStream.ComputeMessageSize(2, StateChange); } size += UnknownFields.SerializedSize; @@ -4315,38 +5161,72 @@ public static UpdateChannelStateNotification ParseDelimitedFrom(global::System.I public static UpdateChannelStateNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static UpdateChannelStateNotification ParseFrom(pb::CodedInputStream input) { + public static UpdateChannelStateNotification ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static UpdateChannelStateNotification ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static UpdateChannelStateNotification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private UpdateChannelStateNotification MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(UpdateChannelStateNotification prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(UpdateChannelStateNotification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - UpdateChannelStateNotification result = new UpdateChannelStateNotification(); + private bool resultIsReadOnly; + private UpdateChannelStateNotification result; + + private UpdateChannelStateNotification PrepareBuilder() { + if (resultIsReadOnly) { + UpdateChannelStateNotification original = result; + result = new UpdateChannelStateNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override UpdateChannelStateNotification MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new UpdateChannelStateNotification(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -4358,12 +5238,11 @@ public override UpdateChannelStateNotification DefaultInstanceForType { } public override UpdateChannelStateNotification BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - UpdateChannelStateNotification returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -4377,6 +5256,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(UpdateChannelStateNotification other) { if (other == global::bnet.protocol.channel.UpdateChannelStateNotification.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAgentId) { MergeAgentId(other.AgentId); } @@ -4387,20 +5267,31 @@ public override Builder MergeFrom(UpdateChannelStateNotification other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_updateChannelStateNotificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _updateChannelStateNotificationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -4412,12 +5303,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { + if (result.hasAgentId) { subBuilder.MergeFrom(AgentId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -4426,7 +5317,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.channel.ChannelState.Builder subBuilder = global::bnet.protocol.channel.ChannelState.CreateBuilder(); - if (HasStateChange) { + if (result.hasStateChange) { subBuilder.MergeFrom(StateChange); } input.ReadMessage(subBuilder, extensionRegistry); @@ -4435,11 +5326,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasAgentId { - get { return result.HasAgentId; } + get { return result.hasAgentId; } } public global::bnet.protocol.EntityId AgentId { get { return result.AgentId; } @@ -4447,19 +5343,22 @@ public bool HasAgentId { } public Builder SetAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = value; return this; } public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = builderForValue.Build(); return this; } public Builder MergeAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && + PrepareBuilder(); + if (result.hasAgentId && result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); } else { @@ -4469,13 +5368,14 @@ public Builder MergeAgentId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearAgentId() { + PrepareBuilder(); result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.agentId_ = null; return this; } public bool HasStateChange { - get { return result.HasStateChange; } + get { return result.hasStateChange; } } public global::bnet.protocol.channel.ChannelState StateChange { get { return result.StateChange; } @@ -4483,19 +5383,22 @@ public bool HasStateChange { } public Builder SetStateChange(global::bnet.protocol.channel.ChannelState value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasStateChange = true; result.stateChange_ = value; return this; } public Builder SetStateChange(global::bnet.protocol.channel.ChannelState.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasStateChange = true; result.stateChange_ = builderForValue.Build(); return this; } public Builder MergeStateChange(global::bnet.protocol.channel.ChannelState value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasStateChange && + PrepareBuilder(); + if (result.hasStateChange && result.stateChange_ != global::bnet.protocol.channel.ChannelState.DefaultInstance) { result.stateChange_ = global::bnet.protocol.channel.ChannelState.CreateBuilder(result.stateChange_).MergeFrom(value).BuildPartial(); } else { @@ -4505,24 +5408,31 @@ public Builder MergeStateChange(global::bnet.protocol.channel.ChannelState value return this; } public Builder ClearStateChange() { + PrepareBuilder(); result.hasStateChange = false; - result.stateChange_ = global::bnet.protocol.channel.ChannelState.DefaultInstance; + result.stateChange_ = null; return this; } } static UpdateChannelStateNotification() { - object.ReferenceEquals(global::bnet.protocol.channel.Proto.Channel.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.channel.ChannelService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class UpdateMemberStateNotification : pb::GeneratedMessage { - private static readonly UpdateMemberStateNotification defaultInstance = new Builder().BuildPartial(); + private UpdateMemberStateNotification() { } + private static readonly UpdateMemberStateNotification defaultInstance = new UpdateMemberStateNotification().MakeReadOnly(); + private static readonly string[] _updateMemberStateNotificationFieldNames = new string[] { "agent_id", "state_change" }; + private static readonly uint[] _updateMemberStateNotificationFieldTags = new uint[] { 10, 18 }; public static UpdateMemberStateNotification DefaultInstance { get { return defaultInstance; } } public override UpdateMemberStateNotification DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override UpdateMemberStateNotification ThisMessage { @@ -4530,21 +5440,21 @@ protected override UpdateMemberStateNotification ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel.Proto.Channel.internal__static_bnet_protocol_channel_UpdateMemberStateNotification__Descriptor; } + get { return global::bnet.protocol.channel.ChannelService.internal__static_bnet_protocol_channel_UpdateMemberStateNotification__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel.Proto.Channel.internal__static_bnet_protocol_channel_UpdateMemberStateNotification__FieldAccessorTable; } + get { return global::bnet.protocol.channel.ChannelService.internal__static_bnet_protocol_channel_UpdateMemberStateNotification__FieldAccessorTable; } } public const int AgentIdFieldNumber = 1; private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId agentId_; public bool HasAgentId { get { return hasAgentId; } } public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } + get { return agentId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int StateChangeFieldNumber = 2; @@ -4571,13 +5481,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasAgentId) { - output.WriteMessage(1, AgentId); + string[] field_names = _updateMemberStateNotificationFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); } - foreach (global::bnet.protocol.channel.Member element in StateChangeList) { - output.WriteMessage(2, element); + if (stateChange_.Count > 0) { + output.WriteMessageArray(2, field_names[1], stateChange_); } UnknownFields.WriteTo(output); } @@ -4589,7 +5500,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAgentId) { + if (hasAgentId) { size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); } foreach (global::bnet.protocol.channel.Member element in StateChangeList) { @@ -4625,38 +5536,73 @@ public static UpdateMemberStateNotification ParseDelimitedFrom(global::System.IO public static UpdateMemberStateNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static UpdateMemberStateNotification ParseFrom(pb::CodedInputStream input) { + public static UpdateMemberStateNotification ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static UpdateMemberStateNotification ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static UpdateMemberStateNotification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private UpdateMemberStateNotification MakeReadOnly() { + stateChange_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(UpdateMemberStateNotification prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(UpdateMemberStateNotification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private UpdateMemberStateNotification result; + + private UpdateMemberStateNotification PrepareBuilder() { + if (resultIsReadOnly) { + UpdateMemberStateNotification original = result; + result = new UpdateMemberStateNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - UpdateMemberStateNotification result = new UpdateMemberStateNotification(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override UpdateMemberStateNotification MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new UpdateMemberStateNotification(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -4668,13 +5614,11 @@ public override UpdateMemberStateNotification DefaultInstanceForType { } public override UpdateMemberStateNotification BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.stateChange_.MakeReadOnly(); - UpdateMemberStateNotification returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -4688,30 +5632,42 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(UpdateMemberStateNotification other) { if (other == global::bnet.protocol.channel.UpdateMemberStateNotification.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAgentId) { MergeAgentId(other.AgentId); } if (other.stateChange_.Count != 0) { - base.AddRange(other.stateChange_, result.stateChange_); + result.stateChange_.Add(other.stateChange_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_updateMemberStateNotificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _updateMemberStateNotificationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -4723,12 +5679,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { + if (result.hasAgentId) { subBuilder.MergeFrom(AgentId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -4736,18 +5692,21 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 18: { - global::bnet.protocol.channel.Member.Builder subBuilder = global::bnet.protocol.channel.Member.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddStateChange(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.stateChange_, global::bnet.protocol.channel.Member.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasAgentId { - get { return result.HasAgentId; } + get { return result.hasAgentId; } } public global::bnet.protocol.EntityId AgentId { get { return result.AgentId; } @@ -4755,19 +5714,22 @@ public bool HasAgentId { } public Builder SetAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = value; return this; } public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = builderForValue.Build(); return this; } public Builder MergeAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && + PrepareBuilder(); + if (result.hasAgentId && result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); } else { @@ -4777,13 +5739,14 @@ public Builder MergeAgentId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearAgentId() { + PrepareBuilder(); result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.agentId_ = null; return this; } public pbc::IPopsicleList StateChangeList { - get { return result.stateChange_; } + get { return PrepareBuilder().stateChange_; } } public int StateChangeCount { get { return result.StateChangeCount; } @@ -4793,41 +5756,50 @@ public int StateChangeCount { } public Builder SetStateChange(int index, global::bnet.protocol.channel.Member value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.stateChange_[index] = value; return this; } public Builder SetStateChange(int index, global::bnet.protocol.channel.Member.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.stateChange_[index] = builderForValue.Build(); return this; } public Builder AddStateChange(global::bnet.protocol.channel.Member value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.stateChange_.Add(value); return this; } public Builder AddStateChange(global::bnet.protocol.channel.Member.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.stateChange_.Add(builderForValue.Build()); return this; } public Builder AddRangeStateChange(scg::IEnumerable values) { - base.AddRange(values, result.stateChange_); + PrepareBuilder(); + result.stateChange_.Add(values); return this; } public Builder ClearStateChange() { + PrepareBuilder(); result.stateChange_.Clear(); return this; } } static UpdateMemberStateNotification() { - object.ReferenceEquals(global::bnet.protocol.channel.Proto.Channel.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.channel.ChannelService.Descriptor, null); } } #endregion #region Services + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public abstract class Channel : pb::IService { public abstract void AddMember( pb::IRpcController controller, @@ -4859,7 +5831,7 @@ public abstract void SetRoles( global::System.Action done); public static pbd::ServiceDescriptor Descriptor { - get { return Proto.Channel.Descriptor.Services[0]; } + get { return ChannelService.Descriptor.Services[0]; } } public pbd::ServiceDescriptor DescriptorForType { get { return Descriptor; } @@ -4969,6 +5941,9 @@ public static Stub CreateStub(pb::IRpcChannel channel) { return new Stub(channel); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public class Stub : global::bnet.protocol.channel.Channel { internal Stub(pb::IRpcChannel channel) { this.channel = channel; @@ -5044,178 +6019,9 @@ public override void SetRoles( } } } - public abstract class ChannelOwner : pb::IService { - public abstract void GetChannelId( - pb::IRpcController controller, - global::bnet.protocol.channel.GetChannelIdRequest request, - global::System.Action done); - public abstract void CreateChannel( - pb::IRpcController controller, - global::bnet.protocol.channel.CreateChannelRequest request, - global::System.Action done); - public abstract void JoinChannel( - pb::IRpcController controller, - global::bnet.protocol.channel.JoinChannelRequest request, - global::System.Action done); - public abstract void FindChannel( - pb::IRpcController controller, - global::bnet.protocol.channel.FindChannelRequest request, - global::System.Action done); - public abstract void GetChannelInfo( - pb::IRpcController controller, - global::bnet.protocol.channel.GetChannelInfoRequest request, - global::System.Action done); - - public static pbd::ServiceDescriptor Descriptor { - get { return Proto.Channel.Descriptor.Services[1]; } - } - public pbd::ServiceDescriptor DescriptorForType { - get { return Descriptor; } - } - - public void CallMethod( - pbd::MethodDescriptor method, - pb::IRpcController controller, - pb::IMessage request, - global::System.Action done) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.CallMethod() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - this.GetChannelId(controller, (global::bnet.protocol.channel.GetChannelIdRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 1: - this.CreateChannel(controller, (global::bnet.protocol.channel.CreateChannelRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 2: - this.JoinChannel(controller, (global::bnet.protocol.channel.JoinChannelRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 3: - this.FindChannel(controller, (global::bnet.protocol.channel.FindChannelRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - case 4: - this.GetChannelInfo(controller, (global::bnet.protocol.channel.GetChannelInfoRequest) request, - pb::RpcUtil.SpecializeCallback( - done)); - return; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetRequestPrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::bnet.protocol.channel.GetChannelIdRequest.DefaultInstance; - case 1: - return global::bnet.protocol.channel.CreateChannelRequest.DefaultInstance; - case 2: - return global::bnet.protocol.channel.JoinChannelRequest.DefaultInstance; - case 3: - return global::bnet.protocol.channel.FindChannelRequest.DefaultInstance; - case 4: - return global::bnet.protocol.channel.GetChannelInfoRequest.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { - if (method.Service != Descriptor) { - throw new global::System.ArgumentException( - "Service.GetResponsePrototype() given method descriptor for wrong service type."); - } - switch(method.Index) { - case 0: - return global::bnet.protocol.channel.GetChannelIdResponse.DefaultInstance; - case 1: - return global::bnet.protocol.channel.CreateChannelResponse.DefaultInstance; - case 2: - return global::bnet.protocol.channel.JoinChannelResponse.DefaultInstance; - case 3: - return global::bnet.protocol.channel.FindChannelResponse.DefaultInstance; - case 4: - return global::bnet.protocol.channel.GetChannelInfoResponse.DefaultInstance; - default: - throw new global::System.InvalidOperationException("Can't get here."); - } - } - - public static Stub CreateStub(pb::IRpcChannel channel) { - return new Stub(channel); - } - - public class Stub : global::bnet.protocol.channel.ChannelOwner { - internal Stub(pb::IRpcChannel channel) { - this.channel = channel; - } - - private readonly pb::IRpcChannel channel; - - public pb::IRpcChannel Channel { - get { return channel; } - } - - public override void GetChannelId( - pb::IRpcController controller, - global::bnet.protocol.channel.GetChannelIdRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[0], - controller, request, global::bnet.protocol.channel.GetChannelIdResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.channel.GetChannelIdResponse.DefaultInstance)); - } - - public override void CreateChannel( - pb::IRpcController controller, - global::bnet.protocol.channel.CreateChannelRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[1], - controller, request, global::bnet.protocol.channel.CreateChannelResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.channel.CreateChannelResponse.DefaultInstance)); - } - - public override void JoinChannel( - pb::IRpcController controller, - global::bnet.protocol.channel.JoinChannelRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[2], - controller, request, global::bnet.protocol.channel.JoinChannelResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.channel.JoinChannelResponse.DefaultInstance)); - } - - public override void FindChannel( - pb::IRpcController controller, - global::bnet.protocol.channel.FindChannelRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[3], - controller, request, global::bnet.protocol.channel.FindChannelResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.channel.FindChannelResponse.DefaultInstance)); - } - - public override void GetChannelInfo( - pb::IRpcController controller, - global::bnet.protocol.channel.GetChannelInfoRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[4], - controller, request, global::bnet.protocol.channel.GetChannelInfoResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.channel.GetChannelInfoResponse.DefaultInstance)); - } - } - } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public abstract class ChannelSubscriber : pb::IService { public abstract void NotifyAdd( pb::IRpcController controller, @@ -5247,7 +6053,7 @@ public abstract void NotifyUpdateMemberState( global::System.Action done); public static pbd::ServiceDescriptor Descriptor { - get { return Proto.Channel.Descriptor.Services[2]; } + get { return ChannelService.Descriptor.Services[1]; } } public pbd::ServiceDescriptor DescriptorForType { get { return Descriptor; } @@ -5357,6 +6163,9 @@ public static Stub CreateStub(pb::IRpcChannel channel) { return new Stub(channel); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public class Stub : global::bnet.protocol.channel.ChannelSubscriber { internal Stub(pb::IRpcChannel channel) { this.channel = channel; @@ -5435,3 +6244,5 @@ public override void NotifyUpdateMemberState( #endregion } + +#endregion Designer generated code diff --git a/src/LibMooNet/bnet/protocol/channel/ChannelTypes.cs b/src/LibMooNet/bnet/protocol/channel/ChannelTypes.cs new file mode 100644 index 00000000..e6b22086 --- /dev/null +++ b/src/LibMooNet/bnet/protocol/channel/ChannelTypes.cs @@ -0,0 +1,3447 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace bnet.protocol.channel { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class ChannelTypes { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_Message__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_Message__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_FindChannelOptions__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_FindChannelOptions__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_ChannelDescription__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_ChannelDescription__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_ChannelInfo__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_ChannelInfo__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_ChannelState__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_ChannelState__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_MemberState__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_MemberState__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_Member__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_Member__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static ChannelTypes() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "ChhibmV0L2NoYW5uZWxfdHlwZXMucHJvdG8SFWJuZXQucHJvdG9jb2wuY2hh" + + "bm5lbBoUYm5ldC9hdHRyaWJ1dGUucHJvdG8aEWJuZXQvZW50aXR5LnByb3Rv" + + "GhtibmV0L2ludml0YXRpb25fdHlwZXMucHJvdG8iVQoHTWVzc2FnZRI1Cglh" + + "dHRyaWJ1dGUYASADKAsyIi5ibmV0LnByb3RvY29sLmF0dHJpYnV0ZS5BdHRy" + + "aWJ1dGUSDAoEcm9sZRgCIAEoDSoFCGQQkU4i1gEKEkZpbmRDaGFubmVsT3B0" + + "aW9ucxIWCgtzdGFydF9pbmRleBgBIAEoDToBMBIXCgttYXhfcmVzdWx0cxgC" + + "IAEoDToCMTYSDAoEbmFtZRgDIAEoCRIPCgdwcm9ncmFtGAQgASgHEg4KBmxv" + + "Y2FsZRgFIAEoBxIVCg1jYXBhY2l0eV9mdWxsGAYgASgNEkIKEGF0dHJpYnV0" + + "ZV9maWx0ZXIYByACKAsyKC5ibmV0LnByb3RvY29sLmF0dHJpYnV0ZS5BdHRy" + + "aWJ1dGVGaWx0ZXIqBQhkEJFOIo4BChJDaGFubmVsRGVzY3JpcHRpb24SKwoK" + + "Y2hhbm5lbF9pZBgBIAIoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSFwoP" + + "Y3VycmVudF9tZW1iZXJzGAIgASgNEjIKBXN0YXRlGAMgASgLMiMuYm5ldC5w" + + "cm90b2NvbC5jaGFubmVsLkNoYW5uZWxTdGF0ZSKDAQoLQ2hhbm5lbEluZm8S" + + "PgoLZGVzY3JpcHRpb24YASACKAsyKS5ibmV0LnByb3RvY29sLmNoYW5uZWwu" + + "Q2hhbm5lbERlc2NyaXB0aW9uEi0KBm1lbWJlchgCIAMoCzIdLmJuZXQucHJv" + + "dG9jb2wuY2hhbm5lbC5NZW1iZXIqBQhkEJFOIo4ECgxDaGFubmVsU3RhdGUS" + + "EwoLbWF4X21lbWJlcnMYASABKA0SEwoLbWluX21lbWJlcnMYAiABKA0SNQoJ" + + "YXR0cmlidXRlGAMgAygLMiIuYm5ldC5wcm90b2NvbC5hdHRyaWJ1dGUuQXR0" + + "cmlidXRlEjgKCmludml0YXRpb24YBCADKAsyJC5ibmV0LnByb3RvY29sLmlu" + + "dml0YXRpb24uSW52aXRhdGlvbhIXCg9tYXhfaW52aXRhdGlvbnMYBSABKA0S" + + "DgoGcmVhc29uGAYgASgNElsKDXByaXZhY3lfbGV2ZWwYByABKA4yMC5ibmV0" + + "LnByb3RvY29sLmNoYW5uZWwuQ2hhbm5lbFN0YXRlLlByaXZhY3lMZXZlbDoS" + + "UFJJVkFDWV9MRVZFTF9PUEVOEgwKBG5hbWUYCCABKAkSFQoNZGVsZWdhdGVf" + + "bmFtZRgJIAEoCRIdCgxjaGFubmVsX3R5cGUYCiABKAk6B2RlZmF1bHQikQEK" + + "DFByaXZhY3lMZXZlbBIWChJQUklWQUNZX0xFVkVMX09QRU4QARIsCihQUklW" + + "QUNZX0xFVkVMX09QRU5fSU5WSVRBVElPTl9BTkRfRlJJRU5EEAISIQodUFJJ" + + "VkFDWV9MRVZFTF9PUEVOX0lOVklUQVRJT04QAxIYChRQUklWQUNZX0xFVkVM" + + "X0NMT1NFRBAEKgUIZBCRTiKeAQoLTWVtYmVyU3RhdGUSNQoJYXR0cmlidXRl" + + "GAEgAygLMiIuYm5ldC5wcm90b2NvbC5hdHRyaWJ1dGUuQXR0cmlidXRlEhAK" + + "BHJvbGUYAiADKA1CAhABEhUKCnByaXZpbGVnZXMYAyABKAQ6ATASKAoEaW5m" + + "bxgEIAEoCzIaLmJuZXQucHJvdG9jb2wuQWNjb3VudEluZm8qBQhkEJFOImYK" + + "Bk1lbWJlchIpCghpZGVudGl0eRgBIAIoCzIXLmJuZXQucHJvdG9jb2wuSWRl" + + "bnRpdHkSMQoFc3RhdGUYAiACKAsyIi5ibmV0LnByb3RvY29sLmNoYW5uZWwu" + + "TWVtYmVyU3RhdGU="); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_bnet_protocol_channel_Message__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_channel_Message__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_Message__Descriptor, + new string[] { "Attribute", "Role", }); + internal__static_bnet_protocol_channel_FindChannelOptions__Descriptor = Descriptor.MessageTypes[1]; + internal__static_bnet_protocol_channel_FindChannelOptions__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_FindChannelOptions__Descriptor, + new string[] { "StartIndex", "MaxResults", "Name", "Program", "Locale", "CapacityFull", "AttributeFilter", }); + internal__static_bnet_protocol_channel_ChannelDescription__Descriptor = Descriptor.MessageTypes[2]; + internal__static_bnet_protocol_channel_ChannelDescription__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_ChannelDescription__Descriptor, + new string[] { "ChannelId", "CurrentMembers", "State", }); + internal__static_bnet_protocol_channel_ChannelInfo__Descriptor = Descriptor.MessageTypes[3]; + internal__static_bnet_protocol_channel_ChannelInfo__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_ChannelInfo__Descriptor, + new string[] { "Description", "Member", }); + internal__static_bnet_protocol_channel_ChannelState__Descriptor = Descriptor.MessageTypes[4]; + internal__static_bnet_protocol_channel_ChannelState__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_ChannelState__Descriptor, + new string[] { "MaxMembers", "MinMembers", "Attribute", "Invitation", "MaxInvitations", "Reason", "PrivacyLevel", "Name", "DelegateName", "ChannelType", }); + internal__static_bnet_protocol_channel_MemberState__Descriptor = Descriptor.MessageTypes[5]; + internal__static_bnet_protocol_channel_MemberState__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_MemberState__Descriptor, + new string[] { "Attribute", "Role", "Privileges", "Info", }); + internal__static_bnet_protocol_channel_Member__Descriptor = Descriptor.MessageTypes[6]; + internal__static_bnet_protocol_channel_Member__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_Member__Descriptor, + new string[] { "Identity", "State", }); + return null; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::bnet.protocol.attribute.Proto.Attribute.Descriptor, + global::bnet.protocol.Entity.Descriptor, + global::bnet.protocol.invitation.InvitationTypes.Descriptor, + }, assigner); + } + #endregion + + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Message : pb::ExtendableMessage { + private Message() { } + private static readonly Message defaultInstance = new Message().MakeReadOnly(); + private static readonly string[] _messageFieldNames = new string[] { "attribute", "role" }; + private static readonly uint[] _messageFieldTags = new uint[] { 10, 16 }; + public static Message DefaultInstance { + get { return defaultInstance; } + } + + public override Message DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Message ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_Message__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_Message__FieldAccessorTable; } + } + + public const int AttributeFieldNumber = 1; + private pbc::PopsicleList attribute_ = new pbc::PopsicleList(); + public scg::IList AttributeList { + get { return attribute_; } + } + public int AttributeCount { + get { return attribute_.Count; } + } + public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { + return attribute_[index]; + } + + public const int RoleFieldNumber = 2; + private bool hasRole; + private uint role_; + public bool HasRole { + get { return hasRole; } + } + public uint Role { + get { return role_; } + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { + if (!element.IsInitialized) return false; + } + if (!ExtensionsAreInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _messageFieldNames; + pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); + if (attribute_.Count > 0) { + output.WriteMessageArray(1, field_names[0], attribute_); + } + if (hasRole) { + output.WriteUInt32(2, field_names[1], Role); + } + extensionWriter.WriteUntil(10001, output); + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + if (hasRole) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, Role); + } + size += ExtensionsSerializedSize; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static Message ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Message ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Message ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Message ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Message ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Message ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Message ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Message ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Message ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Message ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Message MakeReadOnly() { + attribute_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Message prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::ExtendableBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Message cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Message result; + + private Message PrepareBuilder() { + if (resultIsReadOnly) { + Message original = result; + result = new Message(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Message MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.channel.Message.Descriptor; } + } + + public override Message DefaultInstanceForType { + get { return global::bnet.protocol.channel.Message.DefaultInstance; } + } + + public override Message BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Message) { + return MergeFrom((Message) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Message other) { + if (other == global::bnet.protocol.channel.Message.DefaultInstance) return this; + PrepareBuilder(); + if (other.attribute_.Count != 0) { + result.attribute_.Add(other.attribute_); + } + if (other.HasRole) { + Role = other.Role; + } + this.MergeExtensionFields(other); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_messageFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _messageFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.attribute_, global::bnet.protocol.attribute.Attribute.DefaultInstance, extensionRegistry); + break; + } + case 16: { + result.hasRole = input.ReadUInt32(ref result.role_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList AttributeList { + get { return PrepareBuilder().attribute_; } + } + public int AttributeCount { + get { return result.AttributeCount; } + } + public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { + return result.GetAttribute(index); + } + public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.attribute_[index] = value; + return this; + } + public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.attribute_[index] = builderForValue.Build(); + return this; + } + public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.attribute_.Add(value); + return this; + } + public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.attribute_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeAttribute(scg::IEnumerable values) { + PrepareBuilder(); + result.attribute_.Add(values); + return this; + } + public Builder ClearAttribute() { + PrepareBuilder(); + result.attribute_.Clear(); + return this; + } + + public bool HasRole { + get { return result.hasRole; } + } + public uint Role { + get { return result.Role; } + set { SetRole(value); } + } + public Builder SetRole(uint value) { + PrepareBuilder(); + result.hasRole = true; + result.role_ = value; + return this; + } + public Builder ClearRole() { + PrepareBuilder(); + result.hasRole = false; + result.role_ = 0; + return this; + } + } + static Message() { + object.ReferenceEquals(global::bnet.protocol.channel.ChannelTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class FindChannelOptions : pb::ExtendableMessage { + private FindChannelOptions() { } + private static readonly FindChannelOptions defaultInstance = new FindChannelOptions().MakeReadOnly(); + private static readonly string[] _findChannelOptionsFieldNames = new string[] { "attribute_filter", "capacity_full", "locale", "max_results", "name", "program", "start_index" }; + private static readonly uint[] _findChannelOptionsFieldTags = new uint[] { 58, 48, 45, 16, 26, 37, 8 }; + public static FindChannelOptions DefaultInstance { + get { return defaultInstance; } + } + + public override FindChannelOptions DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override FindChannelOptions ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_FindChannelOptions__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_FindChannelOptions__FieldAccessorTable; } + } + + public const int StartIndexFieldNumber = 1; + private bool hasStartIndex; + private uint startIndex_; + public bool HasStartIndex { + get { return hasStartIndex; } + } + public uint StartIndex { + get { return startIndex_; } + } + + public const int MaxResultsFieldNumber = 2; + private bool hasMaxResults; + private uint maxResults_ = 16; + public bool HasMaxResults { + get { return hasMaxResults; } + } + public uint MaxResults { + get { return maxResults_; } + } + + public const int NameFieldNumber = 3; + private bool hasName; + private string name_ = ""; + public bool HasName { + get { return hasName; } + } + public string Name { + get { return name_; } + } + + public const int ProgramFieldNumber = 4; + private bool hasProgram; + private uint program_; + public bool HasProgram { + get { return hasProgram; } + } + public uint Program { + get { return program_; } + } + + public const int LocaleFieldNumber = 5; + private bool hasLocale; + private uint locale_; + public bool HasLocale { + get { return hasLocale; } + } + public uint Locale { + get { return locale_; } + } + + public const int CapacityFullFieldNumber = 6; + private bool hasCapacityFull; + private uint capacityFull_; + public bool HasCapacityFull { + get { return hasCapacityFull; } + } + public uint CapacityFull { + get { return capacityFull_; } + } + + public const int AttributeFilterFieldNumber = 7; + private bool hasAttributeFilter; + private global::bnet.protocol.attribute.AttributeFilter attributeFilter_; + public bool HasAttributeFilter { + get { return hasAttributeFilter; } + } + public global::bnet.protocol.attribute.AttributeFilter AttributeFilter { + get { return attributeFilter_ ?? global::bnet.protocol.attribute.AttributeFilter.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasAttributeFilter) return false; + if (!AttributeFilter.IsInitialized) return false; + if (!ExtensionsAreInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _findChannelOptionsFieldNames; + pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); + if (hasStartIndex) { + output.WriteUInt32(1, field_names[6], StartIndex); + } + if (hasMaxResults) { + output.WriteUInt32(2, field_names[3], MaxResults); + } + if (hasName) { + output.WriteString(3, field_names[4], Name); + } + if (hasProgram) { + output.WriteFixed32(4, field_names[5], Program); + } + if (hasLocale) { + output.WriteFixed32(5, field_names[2], Locale); + } + if (hasCapacityFull) { + output.WriteUInt32(6, field_names[1], CapacityFull); + } + if (hasAttributeFilter) { + output.WriteMessage(7, field_names[0], AttributeFilter); + } + extensionWriter.WriteUntil(10001, output); + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasStartIndex) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, StartIndex); + } + if (hasMaxResults) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, MaxResults); + } + if (hasName) { + size += pb::CodedOutputStream.ComputeStringSize(3, Name); + } + if (hasProgram) { + size += pb::CodedOutputStream.ComputeFixed32Size(4, Program); + } + if (hasLocale) { + size += pb::CodedOutputStream.ComputeFixed32Size(5, Locale); + } + if (hasCapacityFull) { + size += pb::CodedOutputStream.ComputeUInt32Size(6, CapacityFull); + } + if (hasAttributeFilter) { + size += pb::CodedOutputStream.ComputeMessageSize(7, AttributeFilter); + } + size += ExtensionsSerializedSize; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static FindChannelOptions ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FindChannelOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FindChannelOptions ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FindChannelOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FindChannelOptions ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FindChannelOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static FindChannelOptions ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static FindChannelOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static FindChannelOptions ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FindChannelOptions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private FindChannelOptions MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(FindChannelOptions prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::ExtendableBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(FindChannelOptions cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private FindChannelOptions result; + + private FindChannelOptions PrepareBuilder() { + if (resultIsReadOnly) { + FindChannelOptions original = result; + result = new FindChannelOptions(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override FindChannelOptions MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.channel.FindChannelOptions.Descriptor; } + } + + public override FindChannelOptions DefaultInstanceForType { + get { return global::bnet.protocol.channel.FindChannelOptions.DefaultInstance; } + } + + public override FindChannelOptions BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is FindChannelOptions) { + return MergeFrom((FindChannelOptions) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(FindChannelOptions other) { + if (other == global::bnet.protocol.channel.FindChannelOptions.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasStartIndex) { + StartIndex = other.StartIndex; + } + if (other.HasMaxResults) { + MaxResults = other.MaxResults; + } + if (other.HasName) { + Name = other.Name; + } + if (other.HasProgram) { + Program = other.Program; + } + if (other.HasLocale) { + Locale = other.Locale; + } + if (other.HasCapacityFull) { + CapacityFull = other.CapacityFull; + } + if (other.HasAttributeFilter) { + MergeAttributeFilter(other.AttributeFilter); + } + this.MergeExtensionFields(other); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_findChannelOptionsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _findChannelOptionsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasStartIndex = input.ReadUInt32(ref result.startIndex_); + break; + } + case 16: { + result.hasMaxResults = input.ReadUInt32(ref result.maxResults_); + break; + } + case 26: { + result.hasName = input.ReadString(ref result.name_); + break; + } + case 37: { + result.hasProgram = input.ReadFixed32(ref result.program_); + break; + } + case 45: { + result.hasLocale = input.ReadFixed32(ref result.locale_); + break; + } + case 48: { + result.hasCapacityFull = input.ReadUInt32(ref result.capacityFull_); + break; + } + case 58: { + global::bnet.protocol.attribute.AttributeFilter.Builder subBuilder = global::bnet.protocol.attribute.AttributeFilter.CreateBuilder(); + if (result.hasAttributeFilter) { + subBuilder.MergeFrom(AttributeFilter); + } + input.ReadMessage(subBuilder, extensionRegistry); + AttributeFilter = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasStartIndex { + get { return result.hasStartIndex; } + } + public uint StartIndex { + get { return result.StartIndex; } + set { SetStartIndex(value); } + } + public Builder SetStartIndex(uint value) { + PrepareBuilder(); + result.hasStartIndex = true; + result.startIndex_ = value; + return this; + } + public Builder ClearStartIndex() { + PrepareBuilder(); + result.hasStartIndex = false; + result.startIndex_ = 0; + return this; + } + + public bool HasMaxResults { + get { return result.hasMaxResults; } + } + public uint MaxResults { + get { return result.MaxResults; } + set { SetMaxResults(value); } + } + public Builder SetMaxResults(uint value) { + PrepareBuilder(); + result.hasMaxResults = true; + result.maxResults_ = value; + return this; + } + public Builder ClearMaxResults() { + PrepareBuilder(); + result.hasMaxResults = false; + result.maxResults_ = 16; + return this; + } + + public bool HasName { + get { return result.hasName; } + } + public string Name { + get { return result.Name; } + set { SetName(value); } + } + public Builder SetName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasName = true; + result.name_ = value; + return this; + } + public Builder ClearName() { + PrepareBuilder(); + result.hasName = false; + result.name_ = ""; + return this; + } + + public bool HasProgram { + get { return result.hasProgram; } + } + public uint Program { + get { return result.Program; } + set { SetProgram(value); } + } + public Builder SetProgram(uint value) { + PrepareBuilder(); + result.hasProgram = true; + result.program_ = value; + return this; + } + public Builder ClearProgram() { + PrepareBuilder(); + result.hasProgram = false; + result.program_ = 0; + return this; + } + + public bool HasLocale { + get { return result.hasLocale; } + } + public uint Locale { + get { return result.Locale; } + set { SetLocale(value); } + } + public Builder SetLocale(uint value) { + PrepareBuilder(); + result.hasLocale = true; + result.locale_ = value; + return this; + } + public Builder ClearLocale() { + PrepareBuilder(); + result.hasLocale = false; + result.locale_ = 0; + return this; + } + + public bool HasCapacityFull { + get { return result.hasCapacityFull; } + } + public uint CapacityFull { + get { return result.CapacityFull; } + set { SetCapacityFull(value); } + } + public Builder SetCapacityFull(uint value) { + PrepareBuilder(); + result.hasCapacityFull = true; + result.capacityFull_ = value; + return this; + } + public Builder ClearCapacityFull() { + PrepareBuilder(); + result.hasCapacityFull = false; + result.capacityFull_ = 0; + return this; + } + + public bool HasAttributeFilter { + get { return result.hasAttributeFilter; } + } + public global::bnet.protocol.attribute.AttributeFilter AttributeFilter { + get { return result.AttributeFilter; } + set { SetAttributeFilter(value); } + } + public Builder SetAttributeFilter(global::bnet.protocol.attribute.AttributeFilter value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAttributeFilter = true; + result.attributeFilter_ = value; + return this; + } + public Builder SetAttributeFilter(global::bnet.protocol.attribute.AttributeFilter.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAttributeFilter = true; + result.attributeFilter_ = builderForValue.Build(); + return this; + } + public Builder MergeAttributeFilter(global::bnet.protocol.attribute.AttributeFilter value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAttributeFilter && + result.attributeFilter_ != global::bnet.protocol.attribute.AttributeFilter.DefaultInstance) { + result.attributeFilter_ = global::bnet.protocol.attribute.AttributeFilter.CreateBuilder(result.attributeFilter_).MergeFrom(value).BuildPartial(); + } else { + result.attributeFilter_ = value; + } + result.hasAttributeFilter = true; + return this; + } + public Builder ClearAttributeFilter() { + PrepareBuilder(); + result.hasAttributeFilter = false; + result.attributeFilter_ = null; + return this; + } + } + static FindChannelOptions() { + object.ReferenceEquals(global::bnet.protocol.channel.ChannelTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ChannelDescription : pb::GeneratedMessage { + private ChannelDescription() { } + private static readonly ChannelDescription defaultInstance = new ChannelDescription().MakeReadOnly(); + private static readonly string[] _channelDescriptionFieldNames = new string[] { "channel_id", "current_members", "state" }; + private static readonly uint[] _channelDescriptionFieldTags = new uint[] { 10, 16, 26 }; + public static ChannelDescription DefaultInstance { + get { return defaultInstance; } + } + + public override ChannelDescription DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ChannelDescription ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_ChannelDescription__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_ChannelDescription__FieldAccessorTable; } + } + + public const int ChannelIdFieldNumber = 1; + private bool hasChannelId; + private global::bnet.protocol.EntityId channelId_; + public bool HasChannelId { + get { return hasChannelId; } + } + public global::bnet.protocol.EntityId ChannelId { + get { return channelId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int CurrentMembersFieldNumber = 2; + private bool hasCurrentMembers; + private uint currentMembers_; + public bool HasCurrentMembers { + get { return hasCurrentMembers; } + } + public uint CurrentMembers { + get { return currentMembers_; } + } + + public const int StateFieldNumber = 3; + private bool hasState; + private global::bnet.protocol.channel.ChannelState state_; + public bool HasState { + get { return hasState; } + } + public global::bnet.protocol.channel.ChannelState State { + get { return state_ ?? global::bnet.protocol.channel.ChannelState.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasChannelId) return false; + if (!ChannelId.IsInitialized) return false; + if (HasState) { + if (!State.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _channelDescriptionFieldNames; + if (hasChannelId) { + output.WriteMessage(1, field_names[0], ChannelId); + } + if (hasCurrentMembers) { + output.WriteUInt32(2, field_names[1], CurrentMembers); + } + if (hasState) { + output.WriteMessage(3, field_names[2], State); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasChannelId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, ChannelId); + } + if (hasCurrentMembers) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, CurrentMembers); + } + if (hasState) { + size += pb::CodedOutputStream.ComputeMessageSize(3, State); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ChannelDescription ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ChannelDescription ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ChannelDescription ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ChannelDescription ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ChannelDescription ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ChannelDescription ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ChannelDescription ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ChannelDescription ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ChannelDescription ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ChannelDescription ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ChannelDescription MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ChannelDescription prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ChannelDescription cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ChannelDescription result; + + private ChannelDescription PrepareBuilder() { + if (resultIsReadOnly) { + ChannelDescription original = result; + result = new ChannelDescription(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ChannelDescription MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.channel.ChannelDescription.Descriptor; } + } + + public override ChannelDescription DefaultInstanceForType { + get { return global::bnet.protocol.channel.ChannelDescription.DefaultInstance; } + } + + public override ChannelDescription BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ChannelDescription) { + return MergeFrom((ChannelDescription) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ChannelDescription other) { + if (other == global::bnet.protocol.channel.ChannelDescription.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasChannelId) { + MergeChannelId(other.ChannelId); + } + if (other.HasCurrentMembers) { + CurrentMembers = other.CurrentMembers; + } + if (other.HasState) { + MergeState(other.State); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_channelDescriptionFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _channelDescriptionFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasChannelId) { + subBuilder.MergeFrom(ChannelId); + } + input.ReadMessage(subBuilder, extensionRegistry); + ChannelId = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasCurrentMembers = input.ReadUInt32(ref result.currentMembers_); + break; + } + case 26: { + global::bnet.protocol.channel.ChannelState.Builder subBuilder = global::bnet.protocol.channel.ChannelState.CreateBuilder(); + if (result.hasState) { + subBuilder.MergeFrom(State); + } + input.ReadMessage(subBuilder, extensionRegistry); + State = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasChannelId { + get { return result.hasChannelId; } + } + public global::bnet.protocol.EntityId ChannelId { + get { return result.ChannelId; } + set { SetChannelId(value); } + } + public Builder SetChannelId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasChannelId = true; + result.channelId_ = value; + return this; + } + public Builder SetChannelId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasChannelId = true; + result.channelId_ = builderForValue.Build(); + return this; + } + public Builder MergeChannelId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasChannelId && + result.channelId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.channelId_ = global::bnet.protocol.EntityId.CreateBuilder(result.channelId_).MergeFrom(value).BuildPartial(); + } else { + result.channelId_ = value; + } + result.hasChannelId = true; + return this; + } + public Builder ClearChannelId() { + PrepareBuilder(); + result.hasChannelId = false; + result.channelId_ = null; + return this; + } + + public bool HasCurrentMembers { + get { return result.hasCurrentMembers; } + } + public uint CurrentMembers { + get { return result.CurrentMembers; } + set { SetCurrentMembers(value); } + } + public Builder SetCurrentMembers(uint value) { + PrepareBuilder(); + result.hasCurrentMembers = true; + result.currentMembers_ = value; + return this; + } + public Builder ClearCurrentMembers() { + PrepareBuilder(); + result.hasCurrentMembers = false; + result.currentMembers_ = 0; + return this; + } + + public bool HasState { + get { return result.hasState; } + } + public global::bnet.protocol.channel.ChannelState State { + get { return result.State; } + set { SetState(value); } + } + public Builder SetState(global::bnet.protocol.channel.ChannelState value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasState = true; + result.state_ = value; + return this; + } + public Builder SetState(global::bnet.protocol.channel.ChannelState.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasState = true; + result.state_ = builderForValue.Build(); + return this; + } + public Builder MergeState(global::bnet.protocol.channel.ChannelState value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasState && + result.state_ != global::bnet.protocol.channel.ChannelState.DefaultInstance) { + result.state_ = global::bnet.protocol.channel.ChannelState.CreateBuilder(result.state_).MergeFrom(value).BuildPartial(); + } else { + result.state_ = value; + } + result.hasState = true; + return this; + } + public Builder ClearState() { + PrepareBuilder(); + result.hasState = false; + result.state_ = null; + return this; + } + } + static ChannelDescription() { + object.ReferenceEquals(global::bnet.protocol.channel.ChannelTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ChannelInfo : pb::ExtendableMessage { + private ChannelInfo() { } + private static readonly ChannelInfo defaultInstance = new ChannelInfo().MakeReadOnly(); + private static readonly string[] _channelInfoFieldNames = new string[] { "description", "member" }; + private static readonly uint[] _channelInfoFieldTags = new uint[] { 10, 18 }; + public static ChannelInfo DefaultInstance { + get { return defaultInstance; } + } + + public override ChannelInfo DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ChannelInfo ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_ChannelInfo__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_ChannelInfo__FieldAccessorTable; } + } + + public const int DescriptionFieldNumber = 1; + private bool hasDescription; + private global::bnet.protocol.channel.ChannelDescription description_; + public bool HasDescription { + get { return hasDescription; } + } + public global::bnet.protocol.channel.ChannelDescription Description { + get { return description_ ?? global::bnet.protocol.channel.ChannelDescription.DefaultInstance; } + } + + public const int MemberFieldNumber = 2; + private pbc::PopsicleList member_ = new pbc::PopsicleList(); + public scg::IList MemberList { + get { return member_; } + } + public int MemberCount { + get { return member_.Count; } + } + public global::bnet.protocol.channel.Member GetMember(int index) { + return member_[index]; + } + + public override bool IsInitialized { + get { + if (!hasDescription) return false; + if (!Description.IsInitialized) return false; + foreach (global::bnet.protocol.channel.Member element in MemberList) { + if (!element.IsInitialized) return false; + } + if (!ExtensionsAreInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _channelInfoFieldNames; + pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); + if (hasDescription) { + output.WriteMessage(1, field_names[0], Description); + } + if (member_.Count > 0) { + output.WriteMessageArray(2, field_names[1], member_); + } + extensionWriter.WriteUntil(10001, output); + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasDescription) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Description); + } + foreach (global::bnet.protocol.channel.Member element in MemberList) { + size += pb::CodedOutputStream.ComputeMessageSize(2, element); + } + size += ExtensionsSerializedSize; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ChannelInfo ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ChannelInfo ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ChannelInfo ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ChannelInfo ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ChannelInfo ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ChannelInfo ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ChannelInfo ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ChannelInfo ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ChannelInfo ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ChannelInfo ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ChannelInfo MakeReadOnly() { + member_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ChannelInfo prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::ExtendableBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ChannelInfo cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ChannelInfo result; + + private ChannelInfo PrepareBuilder() { + if (resultIsReadOnly) { + ChannelInfo original = result; + result = new ChannelInfo(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ChannelInfo MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.channel.ChannelInfo.Descriptor; } + } + + public override ChannelInfo DefaultInstanceForType { + get { return global::bnet.protocol.channel.ChannelInfo.DefaultInstance; } + } + + public override ChannelInfo BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ChannelInfo) { + return MergeFrom((ChannelInfo) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ChannelInfo other) { + if (other == global::bnet.protocol.channel.ChannelInfo.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasDescription) { + MergeDescription(other.Description); + } + if (other.member_.Count != 0) { + result.member_.Add(other.member_); + } + this.MergeExtensionFields(other); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_channelInfoFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _channelInfoFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.channel.ChannelDescription.Builder subBuilder = global::bnet.protocol.channel.ChannelDescription.CreateBuilder(); + if (result.hasDescription) { + subBuilder.MergeFrom(Description); + } + input.ReadMessage(subBuilder, extensionRegistry); + Description = subBuilder.BuildPartial(); + break; + } + case 18: { + input.ReadMessageArray(tag, field_name, result.member_, global::bnet.protocol.channel.Member.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasDescription { + get { return result.hasDescription; } + } + public global::bnet.protocol.channel.ChannelDescription Description { + get { return result.Description; } + set { SetDescription(value); } + } + public Builder SetDescription(global::bnet.protocol.channel.ChannelDescription value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasDescription = true; + result.description_ = value; + return this; + } + public Builder SetDescription(global::bnet.protocol.channel.ChannelDescription.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasDescription = true; + result.description_ = builderForValue.Build(); + return this; + } + public Builder MergeDescription(global::bnet.protocol.channel.ChannelDescription value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasDescription && + result.description_ != global::bnet.protocol.channel.ChannelDescription.DefaultInstance) { + result.description_ = global::bnet.protocol.channel.ChannelDescription.CreateBuilder(result.description_).MergeFrom(value).BuildPartial(); + } else { + result.description_ = value; + } + result.hasDescription = true; + return this; + } + public Builder ClearDescription() { + PrepareBuilder(); + result.hasDescription = false; + result.description_ = null; + return this; + } + + public pbc::IPopsicleList MemberList { + get { return PrepareBuilder().member_; } + } + public int MemberCount { + get { return result.MemberCount; } + } + public global::bnet.protocol.channel.Member GetMember(int index) { + return result.GetMember(index); + } + public Builder SetMember(int index, global::bnet.protocol.channel.Member value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.member_[index] = value; + return this; + } + public Builder SetMember(int index, global::bnet.protocol.channel.Member.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.member_[index] = builderForValue.Build(); + return this; + } + public Builder AddMember(global::bnet.protocol.channel.Member value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.member_.Add(value); + return this; + } + public Builder AddMember(global::bnet.protocol.channel.Member.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.member_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeMember(scg::IEnumerable values) { + PrepareBuilder(); + result.member_.Add(values); + return this; + } + public Builder ClearMember() { + PrepareBuilder(); + result.member_.Clear(); + return this; + } + } + static ChannelInfo() { + object.ReferenceEquals(global::bnet.protocol.channel.ChannelTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ChannelState : pb::ExtendableMessage { + private ChannelState() { } + private static readonly ChannelState defaultInstance = new ChannelState().MakeReadOnly(); + private static readonly string[] _channelStateFieldNames = new string[] { "attribute", "channel_type", "delegate_name", "invitation", "max_invitations", "max_members", "min_members", "name", "privacy_level", "reason" }; + private static readonly uint[] _channelStateFieldTags = new uint[] { 26, 82, 74, 34, 40, 8, 16, 66, 56, 48 }; + public static ChannelState DefaultInstance { + get { return defaultInstance; } + } + + public override ChannelState DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ChannelState ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_ChannelState__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_ChannelState__FieldAccessorTable; } + } + + #region Nested types + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static class Types { + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public enum PrivacyLevel { + PRIVACY_LEVEL_OPEN = 1, + PRIVACY_LEVEL_OPEN_INVITATION_AND_FRIEND = 2, + PRIVACY_LEVEL_OPEN_INVITATION = 3, + PRIVACY_LEVEL_CLOSED = 4, + } + + } + #endregion + + public const int MaxMembersFieldNumber = 1; + private bool hasMaxMembers; + private uint maxMembers_; + public bool HasMaxMembers { + get { return hasMaxMembers; } + } + public uint MaxMembers { + get { return maxMembers_; } + } + + public const int MinMembersFieldNumber = 2; + private bool hasMinMembers; + private uint minMembers_; + public bool HasMinMembers { + get { return hasMinMembers; } + } + public uint MinMembers { + get { return minMembers_; } + } + + public const int AttributeFieldNumber = 3; + private pbc::PopsicleList attribute_ = new pbc::PopsicleList(); + public scg::IList AttributeList { + get { return attribute_; } + } + public int AttributeCount { + get { return attribute_.Count; } + } + public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { + return attribute_[index]; + } + + public const int InvitationFieldNumber = 4; + private pbc::PopsicleList invitation_ = new pbc::PopsicleList(); + public scg::IList InvitationList { + get { return invitation_; } + } + public int InvitationCount { + get { return invitation_.Count; } + } + public global::bnet.protocol.invitation.Invitation GetInvitation(int index) { + return invitation_[index]; + } + + public const int MaxInvitationsFieldNumber = 5; + private bool hasMaxInvitations; + private uint maxInvitations_; + public bool HasMaxInvitations { + get { return hasMaxInvitations; } + } + public uint MaxInvitations { + get { return maxInvitations_; } + } + + public const int ReasonFieldNumber = 6; + private bool hasReason; + private uint reason_; + public bool HasReason { + get { return hasReason; } + } + public uint Reason { + get { return reason_; } + } + + public const int PrivacyLevelFieldNumber = 7; + private bool hasPrivacyLevel; + private global::bnet.protocol.channel.ChannelState.Types.PrivacyLevel privacyLevel_ = global::bnet.protocol.channel.ChannelState.Types.PrivacyLevel.PRIVACY_LEVEL_OPEN; + public bool HasPrivacyLevel { + get { return hasPrivacyLevel; } + } + public global::bnet.protocol.channel.ChannelState.Types.PrivacyLevel PrivacyLevel { + get { return privacyLevel_; } + } + + public const int NameFieldNumber = 8; + private bool hasName; + private string name_ = ""; + public bool HasName { + get { return hasName; } + } + public string Name { + get { return name_; } + } + + public const int DelegateNameFieldNumber = 9; + private bool hasDelegateName; + private string delegateName_ = ""; + public bool HasDelegateName { + get { return hasDelegateName; } + } + public string DelegateName { + get { return delegateName_; } + } + + public const int ChannelTypeFieldNumber = 10; + private bool hasChannelType; + private string channelType_ = "default"; + public bool HasChannelType { + get { return hasChannelType; } + } + public string ChannelType { + get { return channelType_; } + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { + if (!element.IsInitialized) return false; + } + foreach (global::bnet.protocol.invitation.Invitation element in InvitationList) { + if (!element.IsInitialized) return false; + } + if (!ExtensionsAreInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _channelStateFieldNames; + pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); + if (hasMaxMembers) { + output.WriteUInt32(1, field_names[5], MaxMembers); + } + if (hasMinMembers) { + output.WriteUInt32(2, field_names[6], MinMembers); + } + if (attribute_.Count > 0) { + output.WriteMessageArray(3, field_names[0], attribute_); + } + if (invitation_.Count > 0) { + output.WriteMessageArray(4, field_names[3], invitation_); + } + if (hasMaxInvitations) { + output.WriteUInt32(5, field_names[4], MaxInvitations); + } + if (hasReason) { + output.WriteUInt32(6, field_names[9], Reason); + } + if (hasPrivacyLevel) { + output.WriteEnum(7, field_names[8], (int) PrivacyLevel, PrivacyLevel); + } + if (hasName) { + output.WriteString(8, field_names[7], Name); + } + if (hasDelegateName) { + output.WriteString(9, field_names[2], DelegateName); + } + if (hasChannelType) { + output.WriteString(10, field_names[1], ChannelType); + } + extensionWriter.WriteUntil(10001, output); + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasMaxMembers) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, MaxMembers); + } + if (hasMinMembers) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, MinMembers); + } + foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { + size += pb::CodedOutputStream.ComputeMessageSize(3, element); + } + foreach (global::bnet.protocol.invitation.Invitation element in InvitationList) { + size += pb::CodedOutputStream.ComputeMessageSize(4, element); + } + if (hasMaxInvitations) { + size += pb::CodedOutputStream.ComputeUInt32Size(5, MaxInvitations); + } + if (hasReason) { + size += pb::CodedOutputStream.ComputeUInt32Size(6, Reason); + } + if (hasPrivacyLevel) { + size += pb::CodedOutputStream.ComputeEnumSize(7, (int) PrivacyLevel); + } + if (hasName) { + size += pb::CodedOutputStream.ComputeStringSize(8, Name); + } + if (hasDelegateName) { + size += pb::CodedOutputStream.ComputeStringSize(9, DelegateName); + } + if (hasChannelType) { + size += pb::CodedOutputStream.ComputeStringSize(10, ChannelType); + } + size += ExtensionsSerializedSize; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ChannelState ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ChannelState ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ChannelState ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ChannelState ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ChannelState ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ChannelState ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ChannelState ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ChannelState ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ChannelState ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ChannelState ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ChannelState MakeReadOnly() { + attribute_.MakeReadOnly(); + invitation_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ChannelState prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::ExtendableBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ChannelState cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ChannelState result; + + private ChannelState PrepareBuilder() { + if (resultIsReadOnly) { + ChannelState original = result; + result = new ChannelState(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ChannelState MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.channel.ChannelState.Descriptor; } + } + + public override ChannelState DefaultInstanceForType { + get { return global::bnet.protocol.channel.ChannelState.DefaultInstance; } + } + + public override ChannelState BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ChannelState) { + return MergeFrom((ChannelState) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ChannelState other) { + if (other == global::bnet.protocol.channel.ChannelState.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasMaxMembers) { + MaxMembers = other.MaxMembers; + } + if (other.HasMinMembers) { + MinMembers = other.MinMembers; + } + if (other.attribute_.Count != 0) { + result.attribute_.Add(other.attribute_); + } + if (other.invitation_.Count != 0) { + result.invitation_.Add(other.invitation_); + } + if (other.HasMaxInvitations) { + MaxInvitations = other.MaxInvitations; + } + if (other.HasReason) { + Reason = other.Reason; + } + if (other.HasPrivacyLevel) { + PrivacyLevel = other.PrivacyLevel; + } + if (other.HasName) { + Name = other.Name; + } + if (other.HasDelegateName) { + DelegateName = other.DelegateName; + } + if (other.HasChannelType) { + ChannelType = other.ChannelType; + } + this.MergeExtensionFields(other); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_channelStateFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _channelStateFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasMaxMembers = input.ReadUInt32(ref result.maxMembers_); + break; + } + case 16: { + result.hasMinMembers = input.ReadUInt32(ref result.minMembers_); + break; + } + case 26: { + input.ReadMessageArray(tag, field_name, result.attribute_, global::bnet.protocol.attribute.Attribute.DefaultInstance, extensionRegistry); + break; + } + case 34: { + input.ReadMessageArray(tag, field_name, result.invitation_, global::bnet.protocol.invitation.Invitation.DefaultInstance, extensionRegistry); + break; + } + case 40: { + result.hasMaxInvitations = input.ReadUInt32(ref result.maxInvitations_); + break; + } + case 48: { + result.hasReason = input.ReadUInt32(ref result.reason_); + break; + } + case 56: { + object unknown; + if(input.ReadEnum(ref result.privacyLevel_, out unknown)) { + result.hasPrivacyLevel = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(7, (ulong)(int)unknown); + } + break; + } + case 66: { + result.hasName = input.ReadString(ref result.name_); + break; + } + case 74: { + result.hasDelegateName = input.ReadString(ref result.delegateName_); + break; + } + case 82: { + result.hasChannelType = input.ReadString(ref result.channelType_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasMaxMembers { + get { return result.hasMaxMembers; } + } + public uint MaxMembers { + get { return result.MaxMembers; } + set { SetMaxMembers(value); } + } + public Builder SetMaxMembers(uint value) { + PrepareBuilder(); + result.hasMaxMembers = true; + result.maxMembers_ = value; + return this; + } + public Builder ClearMaxMembers() { + PrepareBuilder(); + result.hasMaxMembers = false; + result.maxMembers_ = 0; + return this; + } + + public bool HasMinMembers { + get { return result.hasMinMembers; } + } + public uint MinMembers { + get { return result.MinMembers; } + set { SetMinMembers(value); } + } + public Builder SetMinMembers(uint value) { + PrepareBuilder(); + result.hasMinMembers = true; + result.minMembers_ = value; + return this; + } + public Builder ClearMinMembers() { + PrepareBuilder(); + result.hasMinMembers = false; + result.minMembers_ = 0; + return this; + } + + public pbc::IPopsicleList AttributeList { + get { return PrepareBuilder().attribute_; } + } + public int AttributeCount { + get { return result.AttributeCount; } + } + public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { + return result.GetAttribute(index); + } + public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.attribute_[index] = value; + return this; + } + public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.attribute_[index] = builderForValue.Build(); + return this; + } + public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.attribute_.Add(value); + return this; + } + public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.attribute_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeAttribute(scg::IEnumerable values) { + PrepareBuilder(); + result.attribute_.Add(values); + return this; + } + public Builder ClearAttribute() { + PrepareBuilder(); + result.attribute_.Clear(); + return this; + } + + public pbc::IPopsicleList InvitationList { + get { return PrepareBuilder().invitation_; } + } + public int InvitationCount { + get { return result.InvitationCount; } + } + public global::bnet.protocol.invitation.Invitation GetInvitation(int index) { + return result.GetInvitation(index); + } + public Builder SetInvitation(int index, global::bnet.protocol.invitation.Invitation value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.invitation_[index] = value; + return this; + } + public Builder SetInvitation(int index, global::bnet.protocol.invitation.Invitation.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.invitation_[index] = builderForValue.Build(); + return this; + } + public Builder AddInvitation(global::bnet.protocol.invitation.Invitation value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.invitation_.Add(value); + return this; + } + public Builder AddInvitation(global::bnet.protocol.invitation.Invitation.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.invitation_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeInvitation(scg::IEnumerable values) { + PrepareBuilder(); + result.invitation_.Add(values); + return this; + } + public Builder ClearInvitation() { + PrepareBuilder(); + result.invitation_.Clear(); + return this; + } + + public bool HasMaxInvitations { + get { return result.hasMaxInvitations; } + } + public uint MaxInvitations { + get { return result.MaxInvitations; } + set { SetMaxInvitations(value); } + } + public Builder SetMaxInvitations(uint value) { + PrepareBuilder(); + result.hasMaxInvitations = true; + result.maxInvitations_ = value; + return this; + } + public Builder ClearMaxInvitations() { + PrepareBuilder(); + result.hasMaxInvitations = false; + result.maxInvitations_ = 0; + return this; + } + + public bool HasReason { + get { return result.hasReason; } + } + public uint Reason { + get { return result.Reason; } + set { SetReason(value); } + } + public Builder SetReason(uint value) { + PrepareBuilder(); + result.hasReason = true; + result.reason_ = value; + return this; + } + public Builder ClearReason() { + PrepareBuilder(); + result.hasReason = false; + result.reason_ = 0; + return this; + } + + public bool HasPrivacyLevel { + get { return result.hasPrivacyLevel; } + } + public global::bnet.protocol.channel.ChannelState.Types.PrivacyLevel PrivacyLevel { + get { return result.PrivacyLevel; } + set { SetPrivacyLevel(value); } + } + public Builder SetPrivacyLevel(global::bnet.protocol.channel.ChannelState.Types.PrivacyLevel value) { + PrepareBuilder(); + result.hasPrivacyLevel = true; + result.privacyLevel_ = value; + return this; + } + public Builder ClearPrivacyLevel() { + PrepareBuilder(); + result.hasPrivacyLevel = false; + result.privacyLevel_ = global::bnet.protocol.channel.ChannelState.Types.PrivacyLevel.PRIVACY_LEVEL_OPEN; + return this; + } + + public bool HasName { + get { return result.hasName; } + } + public string Name { + get { return result.Name; } + set { SetName(value); } + } + public Builder SetName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasName = true; + result.name_ = value; + return this; + } + public Builder ClearName() { + PrepareBuilder(); + result.hasName = false; + result.name_ = ""; + return this; + } + + public bool HasDelegateName { + get { return result.hasDelegateName; } + } + public string DelegateName { + get { return result.DelegateName; } + set { SetDelegateName(value); } + } + public Builder SetDelegateName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasDelegateName = true; + result.delegateName_ = value; + return this; + } + public Builder ClearDelegateName() { + PrepareBuilder(); + result.hasDelegateName = false; + result.delegateName_ = ""; + return this; + } + + public bool HasChannelType { + get { return result.hasChannelType; } + } + public string ChannelType { + get { return result.ChannelType; } + set { SetChannelType(value); } + } + public Builder SetChannelType(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasChannelType = true; + result.channelType_ = value; + return this; + } + public Builder ClearChannelType() { + PrepareBuilder(); + result.hasChannelType = false; + result.channelType_ = "default"; + return this; + } + } + static ChannelState() { + object.ReferenceEquals(global::bnet.protocol.channel.ChannelTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class MemberState : pb::ExtendableMessage { + private MemberState() { } + private static readonly MemberState defaultInstance = new MemberState().MakeReadOnly(); + private static readonly string[] _memberStateFieldNames = new string[] { "attribute", "info", "privileges", "role" }; + private static readonly uint[] _memberStateFieldTags = new uint[] { 10, 34, 24, 18 }; + public static MemberState DefaultInstance { + get { return defaultInstance; } + } + + public override MemberState DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override MemberState ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_MemberState__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_MemberState__FieldAccessorTable; } + } + + public const int AttributeFieldNumber = 1; + private pbc::PopsicleList attribute_ = new pbc::PopsicleList(); + public scg::IList AttributeList { + get { return attribute_; } + } + public int AttributeCount { + get { return attribute_.Count; } + } + public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { + return attribute_[index]; + } + + public const int RoleFieldNumber = 2; + private int roleMemoizedSerializedSize; + private pbc::PopsicleList role_ = new pbc::PopsicleList(); + public scg::IList RoleList { + get { return pbc::Lists.AsReadOnly(role_); } + } + public int RoleCount { + get { return role_.Count; } + } + public uint GetRole(int index) { + return role_[index]; + } + + public const int PrivilegesFieldNumber = 3; + private bool hasPrivileges; + private ulong privileges_; + public bool HasPrivileges { + get { return hasPrivileges; } + } + public ulong Privileges { + get { return privileges_; } + } + + public const int InfoFieldNumber = 4; + private bool hasInfo; + private global::bnet.protocol.AccountInfo info_; + public bool HasInfo { + get { return hasInfo; } + } + public global::bnet.protocol.AccountInfo Info { + get { return info_ ?? global::bnet.protocol.AccountInfo.DefaultInstance; } + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { + if (!element.IsInitialized) return false; + } + if (!ExtensionsAreInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _memberStateFieldNames; + pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); + if (attribute_.Count > 0) { + output.WriteMessageArray(1, field_names[0], attribute_); + } + if (role_.Count > 0) { + output.WritePackedUInt32Array(2, field_names[3], roleMemoizedSerializedSize, role_); + } + if (hasPrivileges) { + output.WriteUInt64(3, field_names[2], Privileges); + } + if (hasInfo) { + output.WriteMessage(4, field_names[1], Info); + } + extensionWriter.WriteUntil(10001, output); + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + { + int dataSize = 0; + foreach (uint element in RoleList) { + dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); + } + size += dataSize; + if (role_.Count != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); + } + roleMemoizedSerializedSize = dataSize; + } + if (hasPrivileges) { + size += pb::CodedOutputStream.ComputeUInt64Size(3, Privileges); + } + if (hasInfo) { + size += pb::CodedOutputStream.ComputeMessageSize(4, Info); + } + size += ExtensionsSerializedSize; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static MemberState ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static MemberState ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static MemberState ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static MemberState ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static MemberState ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static MemberState ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static MemberState ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static MemberState ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static MemberState ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static MemberState ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private MemberState MakeReadOnly() { + attribute_.MakeReadOnly(); + role_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(MemberState prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::ExtendableBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(MemberState cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private MemberState result; + + private MemberState PrepareBuilder() { + if (resultIsReadOnly) { + MemberState original = result; + result = new MemberState(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override MemberState MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.channel.MemberState.Descriptor; } + } + + public override MemberState DefaultInstanceForType { + get { return global::bnet.protocol.channel.MemberState.DefaultInstance; } + } + + public override MemberState BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is MemberState) { + return MergeFrom((MemberState) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(MemberState other) { + if (other == global::bnet.protocol.channel.MemberState.DefaultInstance) return this; + PrepareBuilder(); + if (other.attribute_.Count != 0) { + result.attribute_.Add(other.attribute_); + } + if (other.role_.Count != 0) { + result.role_.Add(other.role_); + } + if (other.HasPrivileges) { + Privileges = other.Privileges; + } + if (other.HasInfo) { + MergeInfo(other.Info); + } + this.MergeExtensionFields(other); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_memberStateFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _memberStateFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.attribute_, global::bnet.protocol.attribute.Attribute.DefaultInstance, extensionRegistry); + break; + } + case 18: + case 16: { + input.ReadUInt32Array(tag, field_name, result.role_); + break; + } + case 24: { + result.hasPrivileges = input.ReadUInt64(ref result.privileges_); + break; + } + case 34: { + global::bnet.protocol.AccountInfo.Builder subBuilder = global::bnet.protocol.AccountInfo.CreateBuilder(); + if (result.hasInfo) { + subBuilder.MergeFrom(Info); + } + input.ReadMessage(subBuilder, extensionRegistry); + Info = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList AttributeList { + get { return PrepareBuilder().attribute_; } + } + public int AttributeCount { + get { return result.AttributeCount; } + } + public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { + return result.GetAttribute(index); + } + public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.attribute_[index] = value; + return this; + } + public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.attribute_[index] = builderForValue.Build(); + return this; + } + public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.attribute_.Add(value); + return this; + } + public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.attribute_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeAttribute(scg::IEnumerable values) { + PrepareBuilder(); + result.attribute_.Add(values); + return this; + } + public Builder ClearAttribute() { + PrepareBuilder(); + result.attribute_.Clear(); + return this; + } + + public pbc::IPopsicleList RoleList { + get { return PrepareBuilder().role_; } + } + public int RoleCount { + get { return result.RoleCount; } + } + public uint GetRole(int index) { + return result.GetRole(index); + } + public Builder SetRole(int index, uint value) { + PrepareBuilder(); + result.role_[index] = value; + return this; + } + public Builder AddRole(uint value) { + PrepareBuilder(); + result.role_.Add(value); + return this; + } + public Builder AddRangeRole(scg::IEnumerable values) { + PrepareBuilder(); + result.role_.Add(values); + return this; + } + public Builder ClearRole() { + PrepareBuilder(); + result.role_.Clear(); + return this; + } + + public bool HasPrivileges { + get { return result.hasPrivileges; } + } + public ulong Privileges { + get { return result.Privileges; } + set { SetPrivileges(value); } + } + public Builder SetPrivileges(ulong value) { + PrepareBuilder(); + result.hasPrivileges = true; + result.privileges_ = value; + return this; + } + public Builder ClearPrivileges() { + PrepareBuilder(); + result.hasPrivileges = false; + result.privileges_ = 0UL; + return this; + } + + public bool HasInfo { + get { return result.hasInfo; } + } + public global::bnet.protocol.AccountInfo Info { + get { return result.Info; } + set { SetInfo(value); } + } + public Builder SetInfo(global::bnet.protocol.AccountInfo value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasInfo = true; + result.info_ = value; + return this; + } + public Builder SetInfo(global::bnet.protocol.AccountInfo.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasInfo = true; + result.info_ = builderForValue.Build(); + return this; + } + public Builder MergeInfo(global::bnet.protocol.AccountInfo value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasInfo && + result.info_ != global::bnet.protocol.AccountInfo.DefaultInstance) { + result.info_ = global::bnet.protocol.AccountInfo.CreateBuilder(result.info_).MergeFrom(value).BuildPartial(); + } else { + result.info_ = value; + } + result.hasInfo = true; + return this; + } + public Builder ClearInfo() { + PrepareBuilder(); + result.hasInfo = false; + result.info_ = null; + return this; + } + } + static MemberState() { + object.ReferenceEquals(global::bnet.protocol.channel.ChannelTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Member : pb::GeneratedMessage { + private Member() { } + private static readonly Member defaultInstance = new Member().MakeReadOnly(); + private static readonly string[] _memberFieldNames = new string[] { "identity", "state" }; + private static readonly uint[] _memberFieldTags = new uint[] { 10, 18 }; + public static Member DefaultInstance { + get { return defaultInstance; } + } + + public override Member DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Member ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_Member__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.channel.ChannelTypes.internal__static_bnet_protocol_channel_Member__FieldAccessorTable; } + } + + public const int IdentityFieldNumber = 1; + private bool hasIdentity; + private global::bnet.protocol.Identity identity_; + public bool HasIdentity { + get { return hasIdentity; } + } + public global::bnet.protocol.Identity Identity { + get { return identity_ ?? global::bnet.protocol.Identity.DefaultInstance; } + } + + public const int StateFieldNumber = 2; + private bool hasState; + private global::bnet.protocol.channel.MemberState state_; + public bool HasState { + get { return hasState; } + } + public global::bnet.protocol.channel.MemberState State { + get { return state_ ?? global::bnet.protocol.channel.MemberState.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasIdentity) return false; + if (!hasState) return false; + if (!Identity.IsInitialized) return false; + if (!State.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _memberFieldNames; + if (hasIdentity) { + output.WriteMessage(1, field_names[0], Identity); + } + if (hasState) { + output.WriteMessage(2, field_names[1], State); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasIdentity) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Identity); + } + if (hasState) { + size += pb::CodedOutputStream.ComputeMessageSize(2, State); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static Member ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Member ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Member ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Member ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Member ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Member ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Member ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Member ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Member ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Member ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Member MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Member prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Member cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Member result; + + private Member PrepareBuilder() { + if (resultIsReadOnly) { + Member original = result; + result = new Member(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Member MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.channel.Member.Descriptor; } + } + + public override Member DefaultInstanceForType { + get { return global::bnet.protocol.channel.Member.DefaultInstance; } + } + + public override Member BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Member) { + return MergeFrom((Member) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Member other) { + if (other == global::bnet.protocol.channel.Member.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasIdentity) { + MergeIdentity(other.Identity); + } + if (other.HasState) { + MergeState(other.State); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_memberFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _memberFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.Identity.Builder subBuilder = global::bnet.protocol.Identity.CreateBuilder(); + if (result.hasIdentity) { + subBuilder.MergeFrom(Identity); + } + input.ReadMessage(subBuilder, extensionRegistry); + Identity = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.channel.MemberState.Builder subBuilder = global::bnet.protocol.channel.MemberState.CreateBuilder(); + if (result.hasState) { + subBuilder.MergeFrom(State); + } + input.ReadMessage(subBuilder, extensionRegistry); + State = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasIdentity { + get { return result.hasIdentity; } + } + public global::bnet.protocol.Identity Identity { + get { return result.Identity; } + set { SetIdentity(value); } + } + public Builder SetIdentity(global::bnet.protocol.Identity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasIdentity = true; + result.identity_ = value; + return this; + } + public Builder SetIdentity(global::bnet.protocol.Identity.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasIdentity = true; + result.identity_ = builderForValue.Build(); + return this; + } + public Builder MergeIdentity(global::bnet.protocol.Identity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasIdentity && + result.identity_ != global::bnet.protocol.Identity.DefaultInstance) { + result.identity_ = global::bnet.protocol.Identity.CreateBuilder(result.identity_).MergeFrom(value).BuildPartial(); + } else { + result.identity_ = value; + } + result.hasIdentity = true; + return this; + } + public Builder ClearIdentity() { + PrepareBuilder(); + result.hasIdentity = false; + result.identity_ = null; + return this; + } + + public bool HasState { + get { return result.hasState; } + } + public global::bnet.protocol.channel.MemberState State { + get { return result.State; } + set { SetState(value); } + } + public Builder SetState(global::bnet.protocol.channel.MemberState value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasState = true; + result.state_ = value; + return this; + } + public Builder SetState(global::bnet.protocol.channel.MemberState.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasState = true; + result.state_ = builderForValue.Build(); + return this; + } + public Builder MergeState(global::bnet.protocol.channel.MemberState value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasState && + result.state_ != global::bnet.protocol.channel.MemberState.DefaultInstance) { + result.state_ = global::bnet.protocol.channel.MemberState.CreateBuilder(result.state_).MergeFrom(value).BuildPartial(); + } else { + result.state_ = value; + } + result.hasState = true; + return this; + } + public Builder ClearState() { + PrepareBuilder(); + result.hasState = false; + result.state_ = null; + return this; + } + } + static Member() { + object.ReferenceEquals(global::bnet.protocol.channel.ChannelTypes.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code diff --git a/source/D3Proto/bnet/protocol/channel_invitation/ChannelInvitation.cs b/src/LibMooNet/bnet/protocol/channel_invitation/ChannelInvitationService.cs similarity index 59% rename from source/D3Proto/bnet/protocol/channel_invitation/ChannelInvitation.cs rename to src/LibMooNet/bnet/protocol/channel_invitation/ChannelInvitationService.cs index 3455765c..20aae2f3 100644 --- a/source/D3Proto/bnet/protocol/channel_invitation/ChannelInvitation.cs +++ b/src/LibMooNet/bnet/protocol/channel_invitation/ChannelInvitationService.cs @@ -1,4 +1,6 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code using pb = global::Google.ProtocolBuffers; using pbc = global::Google.ProtocolBuffers.Collections; @@ -6,175 +8,204 @@ using scg = global::System.Collections.Generic; namespace bnet.protocol.channel_invitation { - public static partial class ChannelInvitation { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_invitation_AcceptInvitationRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_invitation_AcceptInvitationRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_invitation_AcceptInvitationResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_invitation_AcceptInvitationResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_invitation_SubscribeRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_invitation_SubscribeRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_invitation_SubscribeResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_invitation_SubscribeResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_invitation_UnsubscribeRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_invitation_UnsubscribeRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_invitation_SuggestInvitationRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_invitation_SuggestInvitationRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_invitation_RevokeInvitationRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_invitation_RevokeInvitationRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_invitation_HasRoomForInvitationRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_invitation_HasRoomForInvitationRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_invitation_InvitationAddedNotification__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_invitation_InvitationAddedNotification__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_invitation_InvitationRemovedNotification__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_invitation_InvitationRemovedNotification__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_invitation_SuggestionAddedNotification__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_invitation_SuggestionAddedNotification__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static ChannelInvitation() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "Cj5zZXJ2aWNlL2NoYW5uZWxfaW52aXRhdGlvbi9kZWZpbml0aW9uL2NoYW5u" + - "ZWxfaW52aXRhdGlvbi5wcm90bxIgYm5ldC5wcm90b2NvbC5jaGFubmVsX2lu" + - "dml0YXRpb24aGWxpYi9wcm90b2NvbC9lbnRpdHkucHJvdG8aHWxpYi9wcm90" + - "b2NvbC9pbnZpdGF0aW9uLnByb3RvGhFsaWIvcnBjL3JwYy5wcm90bxooc2Vy" + - "dmljZS9jaGFubmVsL2RlZmluaXRpb24vY2hhbm5lbC5wcm90bxo5c2Vydmlj" + - "ZS9jaGFubmVsX2ludml0YXRpb24vY2hhbm5lbF9pbnZpdGF0aW9uX3R5cGVz" + - "LnByb3RvIm4KF0FjY2VwdEludml0YXRpb25SZXF1ZXN0EikKCGFnZW50X2lk" + - "GAEgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBIVCg1pbnZpdGF0aW9u" + - "X2lkGAIgAigGEhEKCW9iamVjdF9pZBgDIAIoBCItChhBY2NlcHRJbnZpdGF0" + - "aW9uUmVzcG9uc2USEQoJb2JqZWN0X2lkGAEgAigEIlAKEFN1YnNjcmliZVJl" + - "cXVlc3QSKQoIYWdlbnRfaWQYASABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0" + - "eUlkEhEKCW9iamVjdF9pZBgCIAIoBCKiAQoRU3Vic2NyaWJlUmVzcG9uc2US" + - "SgoKY29sbGVjdGlvbhgBIAMoCzI2LmJuZXQucHJvdG9jb2wuY2hhbm5lbF9p" + - "bnZpdGF0aW9uLkludml0YXRpb25Db2xsZWN0aW9uEkEKE3JlY2VpdmVkX2lu" + - "dml0YXRpb24YAiADKAsyJC5ibmV0LnByb3RvY29sLmludml0YXRpb24uSW52" + - "aXRhdGlvbiI/ChJVbnN1YnNjcmliZVJlcXVlc3QSKQoIYWdlbnRfaWQYASAB" + - "KAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkIswBChhTdWdnZXN0SW52aXRh" + - "dGlvblJlcXVlc3QSKQoIYWdlbnRfaWQYASABKAsyFy5ibmV0LnByb3RvY29s" + - "LkVudGl0eUlkEisKCmNoYW5uZWxfaWQYAiACKAsyFy5ibmV0LnByb3RvY29s" + - "LkVudGl0eUlkEioKCXRhcmdldF9pZBgDIAIoCzIXLmJuZXQucHJvdG9jb2wu" + - "RW50aXR5SWQSLAoLYXBwcm92YWxfaWQYBCABKAsyFy5ibmV0LnByb3RvY29s" + - "LkVudGl0eUlkIrQBChdSZXZva2VJbnZpdGF0aW9uUmVxdWVzdBIpCghhZ2Vu" + - "dF9pZBgBIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSKgoJdGFyZ2V0" + - "X2lkGAIgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBIVCg1pbnZpdGF0" + - "aW9uX2lkGAMgAigGEisKCmNoYW5uZWxfaWQYBCACKAsyFy5ibmV0LnByb3Rv" + - "Y29sLkVudGl0eUlkIjMKG0hhc1Jvb21Gb3JJbnZpdGF0aW9uUmVxdWVzdBIU" + - "CgxzZXJ2aWNlX3R5cGUYASACKA0iVwobSW52aXRhdGlvbkFkZGVkTm90aWZp" + - "Y2F0aW9uEjgKCmludml0YXRpb24YASACKAsyJC5ibmV0LnByb3RvY29sLmlu" + - "dml0YXRpb24uSW52aXRhdGlvbiJpCh1JbnZpdGF0aW9uUmVtb3ZlZE5vdGlm" + - "aWNhdGlvbhI4CgppbnZpdGF0aW9uGAEgAigLMiQuYm5ldC5wcm90b2NvbC5p" + - "bnZpdGF0aW9uLkludml0YXRpb24SDgoGcmVhc29uGAIgASgNIlcKG1N1Z2dl" + - "c3Rpb25BZGRlZE5vdGlmaWNhdGlvbhI4CgpzdWdnZXN0aW9uGAEgAigLMiQu" + - "Ym5ldC5wcm90b2NvbC5pbnZpdGF0aW9uLlN1Z2dlc3Rpb24ykQYKGENoYW5u" + - "ZWxJbnZpdGF0aW9uU2VydmljZRJ0CglTdWJzY3JpYmUSMi5ibmV0LnByb3Rv" + - "Y29sLmNoYW5uZWxfaW52aXRhdGlvbi5TdWJzY3JpYmVSZXF1ZXN0GjMuYm5l" + - "dC5wcm90b2NvbC5jaGFubmVsX2ludml0YXRpb24uU3Vic2NyaWJlUmVzcG9u" + - "c2USWgoLVW5zdWJzY3JpYmUSNC5ibmV0LnByb3RvY29sLmNoYW5uZWxfaW52" + - "aXRhdGlvbi5VbnN1YnNjcmliZVJlcXVlc3QaFS5ibmV0LnByb3RvY29sLk5v" + - "RGF0YRJzCg5TZW5kSW52aXRhdGlvbhIvLmJuZXQucHJvdG9jb2wuaW52aXRh" + - "dGlvbi5TZW5kSW52aXRhdGlvblJlcXVlc3QaMC5ibmV0LnByb3RvY29sLmlu" + - "dml0YXRpb24uU2VuZEludml0YXRpb25SZXNwb25zZRKJAQoQQWNjZXB0SW52" + - "aXRhdGlvbhI5LmJuZXQucHJvdG9jb2wuY2hhbm5lbF9pbnZpdGF0aW9uLkFj" + - "Y2VwdEludml0YXRpb25SZXF1ZXN0GjouYm5ldC5wcm90b2NvbC5jaGFubmVs" + - "X2ludml0YXRpb24uQWNjZXB0SW52aXRhdGlvblJlc3BvbnNlElQKEURlY2xp" + - "bmVJbnZpdGF0aW9uEiguYm5ldC5wcm90b2NvbC5pbnZpdGF0aW9uLkdlbmVy" + - "aWNSZXF1ZXN0GhUuYm5ldC5wcm90b2NvbC5Ob0RhdGESZAoQUmV2b2tlSW52" + - "aXRhdGlvbhI5LmJuZXQucHJvdG9jb2wuY2hhbm5lbF9pbnZpdGF0aW9uLlJl" + - "dm9rZUludml0YXRpb25SZXF1ZXN0GhUuYm5ldC5wcm90b2NvbC5Ob0RhdGES" + - "ZgoRU3VnZ2VzdEludml0YXRpb24SOi5ibmV0LnByb3RvY29sLmNoYW5uZWxf" + - "aW52aXRhdGlvbi5TdWdnZXN0SW52aXRhdGlvblJlcXVlc3QaFS5ibmV0LnBy" + - "b3RvY29sLk5vRGF0YTL/AwoXQ2hhbm5lbEludml0YXRpb25Ob3RpZnkSegod" + - "Tm90aWZ5UmVjZWl2ZWRJbnZpdGF0aW9uQWRkZWQSPS5ibmV0LnByb3RvY29s" + - "LmNoYW5uZWxfaW52aXRhdGlvbi5JbnZpdGF0aW9uQWRkZWROb3RpZmljYXRp" + - "b24aGi5ibmV0LnByb3RvY29sLk5PX1JFU1BPTlNFEn4KH05vdGlmeVJlY2Vp" + - "dmVkSW52aXRhdGlvblJlbW92ZWQSPy5ibmV0LnByb3RvY29sLmNoYW5uZWxf" + - "aW52aXRhdGlvbi5JbnZpdGF0aW9uUmVtb3ZlZE5vdGlmaWNhdGlvbhoaLmJu" + - "ZXQucHJvdG9jb2wuTk9fUkVTUE9OU0USegodTm90aWZ5UmVjZWl2ZWRTdWdn" + - "ZXN0aW9uQWRkZWQSPS5ibmV0LnByb3RvY29sLmNoYW5uZWxfaW52aXRhdGlv" + - "bi5TdWdnZXN0aW9uQWRkZWROb3RpZmljYXRpb24aGi5ibmV0LnByb3RvY29s" + - "Lk5PX1JFU1BPTlNFEmwKFEhhc1Jvb21Gb3JJbnZpdGF0aW9uEj0uYm5ldC5w" + - "cm90b2NvbC5jaGFubmVsX2ludml0YXRpb24uSGFzUm9vbUZvckludml0YXRp" + - "b25SZXF1ZXN0GhUuYm5ldC5wcm90b2NvbC5Ob0RhdGFCA4ABAQ=="); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_bnet_protocol_channel_invitation_AcceptInvitationRequest__Descriptor = Descriptor.MessageTypes[0]; - internal__static_bnet_protocol_channel_invitation_AcceptInvitationRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_invitation_AcceptInvitationRequest__Descriptor, - new string[] { "AgentId", "InvitationId", "ObjectId", }); - internal__static_bnet_protocol_channel_invitation_AcceptInvitationResponse__Descriptor = Descriptor.MessageTypes[1]; - internal__static_bnet_protocol_channel_invitation_AcceptInvitationResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_invitation_AcceptInvitationResponse__Descriptor, - new string[] { "ObjectId", }); - internal__static_bnet_protocol_channel_invitation_SubscribeRequest__Descriptor = Descriptor.MessageTypes[2]; - internal__static_bnet_protocol_channel_invitation_SubscribeRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_invitation_SubscribeRequest__Descriptor, - new string[] { "AgentId", "ObjectId", }); - internal__static_bnet_protocol_channel_invitation_SubscribeResponse__Descriptor = Descriptor.MessageTypes[3]; - internal__static_bnet_protocol_channel_invitation_SubscribeResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_invitation_SubscribeResponse__Descriptor, - new string[] { "Collection", "ReceivedInvitation", }); - internal__static_bnet_protocol_channel_invitation_UnsubscribeRequest__Descriptor = Descriptor.MessageTypes[4]; - internal__static_bnet_protocol_channel_invitation_UnsubscribeRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_invitation_UnsubscribeRequest__Descriptor, - new string[] { "AgentId", }); - internal__static_bnet_protocol_channel_invitation_SuggestInvitationRequest__Descriptor = Descriptor.MessageTypes[5]; - internal__static_bnet_protocol_channel_invitation_SuggestInvitationRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_invitation_SuggestInvitationRequest__Descriptor, - new string[] { "AgentId", "ChannelId", "TargetId", "ApprovalId", }); - internal__static_bnet_protocol_channel_invitation_RevokeInvitationRequest__Descriptor = Descriptor.MessageTypes[6]; - internal__static_bnet_protocol_channel_invitation_RevokeInvitationRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_invitation_RevokeInvitationRequest__Descriptor, - new string[] { "AgentId", "TargetId", "InvitationId", "ChannelId", }); - internal__static_bnet_protocol_channel_invitation_HasRoomForInvitationRequest__Descriptor = Descriptor.MessageTypes[7]; - internal__static_bnet_protocol_channel_invitation_HasRoomForInvitationRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_invitation_HasRoomForInvitationRequest__Descriptor, - new string[] { "ServiceType", }); - internal__static_bnet_protocol_channel_invitation_InvitationAddedNotification__Descriptor = Descriptor.MessageTypes[8]; - internal__static_bnet_protocol_channel_invitation_InvitationAddedNotification__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_invitation_InvitationAddedNotification__Descriptor, - new string[] { "Invitation", }); - internal__static_bnet_protocol_channel_invitation_InvitationRemovedNotification__Descriptor = Descriptor.MessageTypes[9]; - internal__static_bnet_protocol_channel_invitation_InvitationRemovedNotification__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_invitation_InvitationRemovedNotification__Descriptor, - new string[] { "Invitation", "Reason", }); - internal__static_bnet_protocol_channel_invitation_SuggestionAddedNotification__Descriptor = Descriptor.MessageTypes[10]; - internal__static_bnet_protocol_channel_invitation_SuggestionAddedNotification__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_invitation_SuggestionAddedNotification__Descriptor, - new string[] { "Suggestion", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::bnet.protocol.Entity.Descriptor, - global::bnet.protocol.invitation.Proto.Invitation.Descriptor, - global::bnet.protocol.Rpc.Descriptor, - global::bnet.protocol.channel.Proto.Channel.Descriptor, - global::bnet.protocol.channel_invitation.ChannelInvitationTypes.Descriptor, - }, assigner); - } - #endregion - + namespace Proto { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class ChannelInvitationService { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_invitation_AcceptInvitationRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_invitation_AcceptInvitationRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_invitation_AcceptInvitationResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_invitation_AcceptInvitationResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_invitation_SubscribeRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_invitation_SubscribeRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_invitation_SubscribeResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_invitation_SubscribeResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_invitation_UnsubscribeRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_invitation_UnsubscribeRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_invitation_SuggestInvitationRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_invitation_SuggestInvitationRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_invitation_RevokeInvitationRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_invitation_RevokeInvitationRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_invitation_HasRoomForInvitationRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_invitation_HasRoomForInvitationRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_invitation_InvitationAddedNotification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_invitation_InvitationAddedNotification__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_invitation_InvitationRemovedNotification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_invitation_InvitationRemovedNotification__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_invitation_SuggestionAddedNotification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_invitation_SuggestionAddedNotification__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static ChannelInvitationService() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "Ch1ibmV0L2NoYW5uZWxfaW52aXRhdGlvbi5wcm90bxIgYm5ldC5wcm90b2Nv" + + "bC5jaGFubmVsX2ludml0YXRpb24aJGdvb2dsZS9wcm90b2J1Zi9jc2hhcnBf" + + "b3B0aW9ucy5wcm90bxoRYm5ldC9lbnRpdHkucHJvdG8aG2JuZXQvaW52aXRh" + + "dGlvbl90eXBlcy5wcm90bxoOYm5ldC9ycGMucHJvdG8aGmJuZXQvY2hhbm5l" + + "bF9zZXJ2aWNlLnByb3RvGiNibmV0L2NoYW5uZWxfaW52aXRhdGlvbl90eXBl" + + "cy5wcm90bxoYYm5ldC9jaGFubmVsX3R5cGVzLnByb3RvIqgBChdBY2NlcHRJ" + + "bnZpdGF0aW9uUmVxdWVzdBIpCghhZ2VudF9pZBgBIAEoCzIXLmJuZXQucHJv" + + "dG9jb2wuRW50aXR5SWQSOAoMbWVtYmVyX3N0YXRlGAIgASgLMiIuYm5ldC5w" + + "cm90b2NvbC5jaGFubmVsLk1lbWJlclN0YXRlEhUKDWludml0YXRpb25faWQY" + + "AyACKAYSEQoJb2JqZWN0X2lkGAQgAigEIi0KGEFjY2VwdEludml0YXRpb25S" + + "ZXNwb25zZRIRCglvYmplY3RfaWQYASACKAQiUAoQU3Vic2NyaWJlUmVxdWVz" + + "dBIpCghhZ2VudF9pZBgBIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQS" + + "EQoJb2JqZWN0X2lkGAIgAigEIqIBChFTdWJzY3JpYmVSZXNwb25zZRJKCgpj" + + "b2xsZWN0aW9uGAEgAygLMjYuYm5ldC5wcm90b2NvbC5jaGFubmVsX2ludml0" + + "YXRpb24uSW52aXRhdGlvbkNvbGxlY3Rpb24SQQoTcmVjZWl2ZWRfaW52aXRh" + + "dGlvbhgCIAMoCzIkLmJuZXQucHJvdG9jb2wuaW52aXRhdGlvbi5JbnZpdGF0" + + "aW9uIj8KElVuc3Vic2NyaWJlUmVxdWVzdBIpCghhZ2VudF9pZBgBIAEoCzIX" + + "LmJuZXQucHJvdG9jb2wuRW50aXR5SWQirQIKGFN1Z2dlc3RJbnZpdGF0aW9u" + + "UmVxdWVzdBIpCghhZ2VudF9pZBgBIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50" + + "aXR5SWQSKwoKY2hhbm5lbF9pZBgCIAIoCzIXLmJuZXQucHJvdG9jb2wuRW50" + + "aXR5SWQSKgoJdGFyZ2V0X2lkGAMgAigLMhcuYm5ldC5wcm90b2NvbC5FbnRp" + + "dHlJZBIsCgthcHByb3ZhbF9pZBgEIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50" + + "aXR5SWQSLwoOYWdlbnRfaWRlbnRpdHkYBSABKAsyFy5ibmV0LnByb3RvY29s" + + "LklkZW50aXR5Ei4KCmFnZW50X2luZm8YBiABKAsyGi5ibmV0LnByb3RvY29s" + + "LkFjY291bnRJbmZvIrQBChdSZXZva2VJbnZpdGF0aW9uUmVxdWVzdBIpCghh" + + "Z2VudF9pZBgBIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSKgoJdGFy" + + "Z2V0X2lkGAIgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBIVCg1pbnZp" + + "dGF0aW9uX2lkGAMgAigGEisKCmNoYW5uZWxfaWQYBCACKAsyFy5ibmV0LnBy" + + "b3RvY29sLkVudGl0eUlkIjMKG0hhc1Jvb21Gb3JJbnZpdGF0aW9uUmVxdWVz" + + "dBIUCgxzZXJ2aWNlX3R5cGUYASACKA0iVwobSW52aXRhdGlvbkFkZGVkTm90" + + "aWZpY2F0aW9uEjgKCmludml0YXRpb24YASACKAsyJC5ibmV0LnByb3RvY29s" + + "Lmludml0YXRpb24uSW52aXRhdGlvbiJpCh1JbnZpdGF0aW9uUmVtb3ZlZE5v" + + "dGlmaWNhdGlvbhI4CgppbnZpdGF0aW9uGAEgAigLMiQuYm5ldC5wcm90b2Nv" + + "bC5pbnZpdGF0aW9uLkludml0YXRpb24SDgoGcmVhc29uGAIgASgNIlcKG1N1" + + "Z2dlc3Rpb25BZGRlZE5vdGlmaWNhdGlvbhI4CgpzdWdnZXN0aW9uGAEgAigL" + + "MiQuYm5ldC5wcm90b2NvbC5pbnZpdGF0aW9uLlN1Z2dlc3Rpb24yuwYKGENo" + + "YW5uZWxJbnZpdGF0aW9uU2VydmljZRJ6CglTdWJzY3JpYmUSMi5ibmV0LnBy" + + "b3RvY29sLmNoYW5uZWxfaW52aXRhdGlvbi5TdWJzY3JpYmVSZXF1ZXN0GjMu" + + "Ym5ldC5wcm90b2NvbC5jaGFubmVsX2ludml0YXRpb24uU3Vic2NyaWJlUmVz" + + "cG9uc2UiBIC1GAESYAoLVW5zdWJzY3JpYmUSNC5ibmV0LnByb3RvY29sLmNo" + + "YW5uZWxfaW52aXRhdGlvbi5VbnN1YnNjcmliZVJlcXVlc3QaFS5ibmV0LnBy" + + "b3RvY29sLk5vRGF0YSIEgLUYAhJ5Cg5TZW5kSW52aXRhdGlvbhIvLmJuZXQu" + + "cHJvdG9jb2wuaW52aXRhdGlvbi5TZW5kSW52aXRhdGlvblJlcXVlc3QaMC5i" + + "bmV0LnByb3RvY29sLmludml0YXRpb24uU2VuZEludml0YXRpb25SZXNwb25z" + + "ZSIEgLUYAxKPAQoQQWNjZXB0SW52aXRhdGlvbhI5LmJuZXQucHJvdG9jb2wu" + + "Y2hhbm5lbF9pbnZpdGF0aW9uLkFjY2VwdEludml0YXRpb25SZXF1ZXN0Gjou" + + "Ym5ldC5wcm90b2NvbC5jaGFubmVsX2ludml0YXRpb24uQWNjZXB0SW52aXRh" + + "dGlvblJlc3BvbnNlIgSAtRgEEloKEURlY2xpbmVJbnZpdGF0aW9uEiguYm5l" + + "dC5wcm90b2NvbC5pbnZpdGF0aW9uLkdlbmVyaWNSZXF1ZXN0GhUuYm5ldC5w" + + "cm90b2NvbC5Ob0RhdGEiBIC1GAUSagoQUmV2b2tlSW52aXRhdGlvbhI5LmJu" + + "ZXQucHJvdG9jb2wuY2hhbm5lbF9pbnZpdGF0aW9uLlJldm9rZUludml0YXRp" + + "b25SZXF1ZXN0GhUuYm5ldC5wcm90b2NvbC5Ob0RhdGEiBIC1GAYSbAoRU3Vn" + + "Z2VzdEludml0YXRpb24SOi5ibmV0LnByb3RvY29sLmNoYW5uZWxfaW52aXRh" + + "dGlvbi5TdWdnZXN0SW52aXRhdGlvblJlcXVlc3QaFS5ibmV0LnByb3RvY29s" + + "Lk5vRGF0YSIEgLUYBzKaBAoXQ2hhbm5lbEludml0YXRpb25Ob3RpZnkSgAEK" + + "HU5vdGlmeVJlY2VpdmVkSW52aXRhdGlvbkFkZGVkEj0uYm5ldC5wcm90b2Nv" + + "bC5jaGFubmVsX2ludml0YXRpb24uSW52aXRhdGlvbkFkZGVkTm90aWZpY2F0" + + "aW9uGhouYm5ldC5wcm90b2NvbC5OT19SRVNQT05TRSIEgLUYARKEAQofTm90" + + "aWZ5UmVjZWl2ZWRJbnZpdGF0aW9uUmVtb3ZlZBI/LmJuZXQucHJvdG9jb2wu" + + "Y2hhbm5lbF9pbnZpdGF0aW9uLkludml0YXRpb25SZW1vdmVkTm90aWZpY2F0" + + "aW9uGhouYm5ldC5wcm90b2NvbC5OT19SRVNQT05TRSIEgLUYAhKAAQodTm90" + + "aWZ5UmVjZWl2ZWRTdWdnZXN0aW9uQWRkZWQSPS5ibmV0LnByb3RvY29sLmNo" + + "YW5uZWxfaW52aXRhdGlvbi5TdWdnZXN0aW9uQWRkZWROb3RpZmljYXRpb24a" + + "Gi5ibmV0LnByb3RvY29sLk5PX1JFU1BPTlNFIgSAtRgDEnIKFEhhc1Jvb21G" + + "b3JJbnZpdGF0aW9uEj0uYm5ldC5wcm90b2NvbC5jaGFubmVsX2ludml0YXRp" + + "b24uSGFzUm9vbUZvckludml0YXRpb25SZXF1ZXN0GhUuYm5ldC5wcm90b2Nv" + + "bC5Ob0RhdGEiBIC1GARCIIABAMI+GhIYQ2hhbm5lbEludml0YXRpb25TZXJ2" + + "aWNl"); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_bnet_protocol_channel_invitation_AcceptInvitationRequest__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_channel_invitation_AcceptInvitationRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_invitation_AcceptInvitationRequest__Descriptor, + new string[] { "AgentId", "MemberState", "InvitationId", "ObjectId", }); + internal__static_bnet_protocol_channel_invitation_AcceptInvitationResponse__Descriptor = Descriptor.MessageTypes[1]; + internal__static_bnet_protocol_channel_invitation_AcceptInvitationResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_invitation_AcceptInvitationResponse__Descriptor, + new string[] { "ObjectId", }); + internal__static_bnet_protocol_channel_invitation_SubscribeRequest__Descriptor = Descriptor.MessageTypes[2]; + internal__static_bnet_protocol_channel_invitation_SubscribeRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_invitation_SubscribeRequest__Descriptor, + new string[] { "AgentId", "ObjectId", }); + internal__static_bnet_protocol_channel_invitation_SubscribeResponse__Descriptor = Descriptor.MessageTypes[3]; + internal__static_bnet_protocol_channel_invitation_SubscribeResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_invitation_SubscribeResponse__Descriptor, + new string[] { "Collection", "ReceivedInvitation", }); + internal__static_bnet_protocol_channel_invitation_UnsubscribeRequest__Descriptor = Descriptor.MessageTypes[4]; + internal__static_bnet_protocol_channel_invitation_UnsubscribeRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_invitation_UnsubscribeRequest__Descriptor, + new string[] { "AgentId", }); + internal__static_bnet_protocol_channel_invitation_SuggestInvitationRequest__Descriptor = Descriptor.MessageTypes[5]; + internal__static_bnet_protocol_channel_invitation_SuggestInvitationRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_invitation_SuggestInvitationRequest__Descriptor, + new string[] { "AgentId", "ChannelId", "TargetId", "ApprovalId", "AgentIdentity", "AgentInfo", }); + internal__static_bnet_protocol_channel_invitation_RevokeInvitationRequest__Descriptor = Descriptor.MessageTypes[6]; + internal__static_bnet_protocol_channel_invitation_RevokeInvitationRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_invitation_RevokeInvitationRequest__Descriptor, + new string[] { "AgentId", "TargetId", "InvitationId", "ChannelId", }); + internal__static_bnet_protocol_channel_invitation_HasRoomForInvitationRequest__Descriptor = Descriptor.MessageTypes[7]; + internal__static_bnet_protocol_channel_invitation_HasRoomForInvitationRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_invitation_HasRoomForInvitationRequest__Descriptor, + new string[] { "ServiceType", }); + internal__static_bnet_protocol_channel_invitation_InvitationAddedNotification__Descriptor = Descriptor.MessageTypes[8]; + internal__static_bnet_protocol_channel_invitation_InvitationAddedNotification__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_invitation_InvitationAddedNotification__Descriptor, + new string[] { "Invitation", }); + internal__static_bnet_protocol_channel_invitation_InvitationRemovedNotification__Descriptor = Descriptor.MessageTypes[9]; + internal__static_bnet_protocol_channel_invitation_InvitationRemovedNotification__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_invitation_InvitationRemovedNotification__Descriptor, + new string[] { "Invitation", "Reason", }); + internal__static_bnet_protocol_channel_invitation_SuggestionAddedNotification__Descriptor = Descriptor.MessageTypes[10]; + internal__static_bnet_protocol_channel_invitation_SuggestionAddedNotification__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_invitation_SuggestionAddedNotification__Descriptor, + new string[] { "Suggestion", }); + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + RegisterAllExtensions(registry); + global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry); + global::bnet.protocol.Entity.RegisterAllExtensions(registry); + global::bnet.protocol.invitation.InvitationTypes.RegisterAllExtensions(registry); + global::bnet.protocol.Rpc.RegisterAllExtensions(registry); + global::bnet.protocol.channel.ChannelService.RegisterAllExtensions(registry); + global::bnet.protocol.channel_invitation.ChannelInvitationTypes.RegisterAllExtensions(registry); + global::bnet.protocol.channel.ChannelTypes.RegisterAllExtensions(registry); + return registry; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor, + global::bnet.protocol.Entity.Descriptor, + global::bnet.protocol.invitation.InvitationTypes.Descriptor, + global::bnet.protocol.Rpc.Descriptor, + global::bnet.protocol.channel.ChannelService.Descriptor, + global::bnet.protocol.channel_invitation.ChannelInvitationTypes.Descriptor, + global::bnet.protocol.channel.ChannelTypes.Descriptor, + }, assigner); + } + #endregion + + } } #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class AcceptInvitationRequest : pb::GeneratedMessage { - private static readonly AcceptInvitationRequest defaultInstance = new Builder().BuildPartial(); + private AcceptInvitationRequest() { } + private static readonly AcceptInvitationRequest defaultInstance = new AcceptInvitationRequest().MakeReadOnly(); + private static readonly string[] _acceptInvitationRequestFieldNames = new string[] { "agent_id", "invitation_id", "member_state", "object_id" }; + private static readonly uint[] _acceptInvitationRequestFieldTags = new uint[] { 10, 25, 18, 32 }; public static AcceptInvitationRequest DefaultInstance { get { return defaultInstance; } } public override AcceptInvitationRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override AcceptInvitationRequest ThisMessage { @@ -182,26 +213,36 @@ protected override AcceptInvitationRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel_invitation.ChannelInvitation.internal__static_bnet_protocol_channel_invitation_AcceptInvitationRequest__Descriptor; } + get { return global::bnet.protocol.channel_invitation.Proto.ChannelInvitationService.internal__static_bnet_protocol_channel_invitation_AcceptInvitationRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel_invitation.ChannelInvitation.internal__static_bnet_protocol_channel_invitation_AcceptInvitationRequest__FieldAccessorTable; } + get { return global::bnet.protocol.channel_invitation.Proto.ChannelInvitationService.internal__static_bnet_protocol_channel_invitation_AcceptInvitationRequest__FieldAccessorTable; } } public const int AgentIdFieldNumber = 1; private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId agentId_; public bool HasAgentId { get { return hasAgentId; } } public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } + get { return agentId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } - public const int InvitationIdFieldNumber = 2; + public const int MemberStateFieldNumber = 2; + private bool hasMemberState; + private global::bnet.protocol.channel.MemberState memberState_; + public bool HasMemberState { + get { return hasMemberState; } + } + public global::bnet.protocol.channel.MemberState MemberState { + get { return memberState_ ?? global::bnet.protocol.channel.MemberState.DefaultInstance; } + } + + public const int InvitationIdFieldNumber = 3; private bool hasInvitationId; - private ulong invitationId_ = 0; + private ulong invitationId_; public bool HasInvitationId { get { return hasInvitationId; } } @@ -209,9 +250,9 @@ public ulong InvitationId { get { return invitationId_; } } - public const int ObjectIdFieldNumber = 3; + public const int ObjectIdFieldNumber = 4; private bool hasObjectId; - private ulong objectId_ = 0UL; + private ulong objectId_; public bool HasObjectId { get { return hasObjectId; } } @@ -226,20 +267,27 @@ public override bool IsInitialized { if (HasAgentId) { if (!AgentId.IsInitialized) return false; } + if (HasMemberState) { + if (!MemberState.IsInitialized) return false; + } return true; } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasAgentId) { - output.WriteMessage(1, AgentId); + string[] field_names = _acceptInvitationRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); + } + if (hasMemberState) { + output.WriteMessage(2, field_names[2], MemberState); } - if (HasInvitationId) { - output.WriteFixed64(2, InvitationId); + if (hasInvitationId) { + output.WriteFixed64(3, field_names[1], InvitationId); } - if (HasObjectId) { - output.WriteUInt64(3, ObjectId); + if (hasObjectId) { + output.WriteUInt64(4, field_names[3], ObjectId); } UnknownFields.WriteTo(output); } @@ -251,14 +299,17 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAgentId) { + if (hasAgentId) { size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); } - if (HasInvitationId) { - size += pb::CodedOutputStream.ComputeFixed64Size(2, InvitationId); + if (hasMemberState) { + size += pb::CodedOutputStream.ComputeMessageSize(2, MemberState); + } + if (hasInvitationId) { + size += pb::CodedOutputStream.ComputeFixed64Size(3, InvitationId); } - if (HasObjectId) { - size += pb::CodedOutputStream.ComputeUInt64Size(3, ObjectId); + if (hasObjectId) { + size += pb::CodedOutputStream.ComputeUInt64Size(4, ObjectId); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -290,38 +341,72 @@ public static AcceptInvitationRequest ParseDelimitedFrom(global::System.IO.Strea public static AcceptInvitationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static AcceptInvitationRequest ParseFrom(pb::CodedInputStream input) { + public static AcceptInvitationRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static AcceptInvitationRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static AcceptInvitationRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private AcceptInvitationRequest MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(AcceptInvitationRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(AcceptInvitationRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private AcceptInvitationRequest result; + + private AcceptInvitationRequest PrepareBuilder() { + if (resultIsReadOnly) { + AcceptInvitationRequest original = result; + result = new AcceptInvitationRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - AcceptInvitationRequest result = new AcceptInvitationRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override AcceptInvitationRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new AcceptInvitationRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -333,12 +418,11 @@ public override AcceptInvitationRequest DefaultInstanceForType { } public override AcceptInvitationRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - AcceptInvitationRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -352,9 +436,13 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(AcceptInvitationRequest other) { if (other == global::bnet.protocol.channel_invitation.AcceptInvitationRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAgentId) { MergeAgentId(other.AgentId); } + if (other.HasMemberState) { + MergeMemberState(other.MemberState); + } if (other.HasInvitationId) { InvitationId = other.InvitationId; } @@ -365,20 +453,31 @@ public override Builder MergeFrom(AcceptInvitationRequest other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_acceptInvitationRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _acceptInvitationRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -390,33 +489,47 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { + if (result.hasAgentId) { subBuilder.MergeFrom(AgentId); } input.ReadMessage(subBuilder, extensionRegistry); AgentId = subBuilder.BuildPartial(); break; } - case 17: { - InvitationId = input.ReadFixed64(); + case 18: { + global::bnet.protocol.channel.MemberState.Builder subBuilder = global::bnet.protocol.channel.MemberState.CreateBuilder(); + if (result.hasMemberState) { + subBuilder.MergeFrom(MemberState); + } + input.ReadMessage(subBuilder, extensionRegistry); + MemberState = subBuilder.BuildPartial(); + break; + } + case 25: { + result.hasInvitationId = input.ReadFixed64(ref result.invitationId_); break; } - case 24: { - ObjectId = input.ReadUInt64(); + case 32: { + result.hasObjectId = input.ReadUInt64(ref result.objectId_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasAgentId { - get { return result.HasAgentId; } + get { return result.hasAgentId; } } public global::bnet.protocol.EntityId AgentId { get { return result.AgentId; } @@ -424,19 +537,22 @@ public bool HasAgentId { } public Builder SetAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = value; return this; } public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = builderForValue.Build(); return this; } public Builder MergeAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && + PrepareBuilder(); + if (result.hasAgentId && result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); } else { @@ -446,60 +562,111 @@ public Builder MergeAgentId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearAgentId() { + PrepareBuilder(); result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.agentId_ = null; + return this; + } + + public bool HasMemberState { + get { return result.hasMemberState; } + } + public global::bnet.protocol.channel.MemberState MemberState { + get { return result.MemberState; } + set { SetMemberState(value); } + } + public Builder SetMemberState(global::bnet.protocol.channel.MemberState value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasMemberState = true; + result.memberState_ = value; + return this; + } + public Builder SetMemberState(global::bnet.protocol.channel.MemberState.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasMemberState = true; + result.memberState_ = builderForValue.Build(); + return this; + } + public Builder MergeMemberState(global::bnet.protocol.channel.MemberState value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasMemberState && + result.memberState_ != global::bnet.protocol.channel.MemberState.DefaultInstance) { + result.memberState_ = global::bnet.protocol.channel.MemberState.CreateBuilder(result.memberState_).MergeFrom(value).BuildPartial(); + } else { + result.memberState_ = value; + } + result.hasMemberState = true; + return this; + } + public Builder ClearMemberState() { + PrepareBuilder(); + result.hasMemberState = false; + result.memberState_ = null; return this; } public bool HasInvitationId { - get { return result.HasInvitationId; } + get { return result.hasInvitationId; } } public ulong InvitationId { get { return result.InvitationId; } set { SetInvitationId(value); } } public Builder SetInvitationId(ulong value) { + PrepareBuilder(); result.hasInvitationId = true; result.invitationId_ = value; return this; } public Builder ClearInvitationId() { + PrepareBuilder(); result.hasInvitationId = false; result.invitationId_ = 0; return this; } public bool HasObjectId { - get { return result.HasObjectId; } + get { return result.hasObjectId; } } public ulong ObjectId { get { return result.ObjectId; } set { SetObjectId(value); } } public Builder SetObjectId(ulong value) { + PrepareBuilder(); result.hasObjectId = true; result.objectId_ = value; return this; } public Builder ClearObjectId() { + PrepareBuilder(); result.hasObjectId = false; result.objectId_ = 0UL; return this; } } static AcceptInvitationRequest() { - object.ReferenceEquals(global::bnet.protocol.channel_invitation.ChannelInvitation.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.channel_invitation.Proto.ChannelInvitationService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class AcceptInvitationResponse : pb::GeneratedMessage { - private static readonly AcceptInvitationResponse defaultInstance = new Builder().BuildPartial(); + private AcceptInvitationResponse() { } + private static readonly AcceptInvitationResponse defaultInstance = new AcceptInvitationResponse().MakeReadOnly(); + private static readonly string[] _acceptInvitationResponseFieldNames = new string[] { "object_id" }; + private static readonly uint[] _acceptInvitationResponseFieldTags = new uint[] { 8 }; public static AcceptInvitationResponse DefaultInstance { get { return defaultInstance; } } public override AcceptInvitationResponse DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override AcceptInvitationResponse ThisMessage { @@ -507,16 +674,16 @@ protected override AcceptInvitationResponse ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel_invitation.ChannelInvitation.internal__static_bnet_protocol_channel_invitation_AcceptInvitationResponse__Descriptor; } + get { return global::bnet.protocol.channel_invitation.Proto.ChannelInvitationService.internal__static_bnet_protocol_channel_invitation_AcceptInvitationResponse__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel_invitation.ChannelInvitation.internal__static_bnet_protocol_channel_invitation_AcceptInvitationResponse__FieldAccessorTable; } + get { return global::bnet.protocol.channel_invitation.Proto.ChannelInvitationService.internal__static_bnet_protocol_channel_invitation_AcceptInvitationResponse__FieldAccessorTable; } } public const int ObjectIdFieldNumber = 1; private bool hasObjectId; - private ulong objectId_ = 0UL; + private ulong objectId_; public bool HasObjectId { get { return hasObjectId; } } @@ -531,10 +698,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasObjectId) { - output.WriteUInt64(1, ObjectId); + string[] field_names = _acceptInvitationResponseFieldNames; + if (hasObjectId) { + output.WriteUInt64(1, field_names[0], ObjectId); } UnknownFields.WriteTo(output); } @@ -546,7 +714,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasObjectId) { + if (hasObjectId) { size += pb::CodedOutputStream.ComputeUInt64Size(1, ObjectId); } size += UnknownFields.SerializedSize; @@ -579,38 +747,72 @@ public static AcceptInvitationResponse ParseDelimitedFrom(global::System.IO.Stre public static AcceptInvitationResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static AcceptInvitationResponse ParseFrom(pb::CodedInputStream input) { + public static AcceptInvitationResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static AcceptInvitationResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static AcceptInvitationResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private AcceptInvitationResponse MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(AcceptInvitationResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(AcceptInvitationResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - AcceptInvitationResponse result = new AcceptInvitationResponse(); + private bool resultIsReadOnly; + private AcceptInvitationResponse result; + + private AcceptInvitationResponse PrepareBuilder() { + if (resultIsReadOnly) { + AcceptInvitationResponse original = result; + result = new AcceptInvitationResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override AcceptInvitationResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new AcceptInvitationResponse(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -622,12 +824,11 @@ public override AcceptInvitationResponse DefaultInstanceForType { } public override AcceptInvitationResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - AcceptInvitationResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -641,6 +842,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(AcceptInvitationResponse other) { if (other == global::bnet.protocol.channel_invitation.AcceptInvitationResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.HasObjectId) { ObjectId = other.ObjectId; } @@ -648,20 +850,31 @@ public override Builder MergeFrom(AcceptInvitationResponse other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_acceptInvitationResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _acceptInvitationResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -673,49 +886,62 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 8: { - ObjectId = input.ReadUInt64(); + result.hasObjectId = input.ReadUInt64(ref result.objectId_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasObjectId { - get { return result.HasObjectId; } + get { return result.hasObjectId; } } public ulong ObjectId { get { return result.ObjectId; } set { SetObjectId(value); } } public Builder SetObjectId(ulong value) { + PrepareBuilder(); result.hasObjectId = true; result.objectId_ = value; return this; } public Builder ClearObjectId() { + PrepareBuilder(); result.hasObjectId = false; result.objectId_ = 0UL; return this; } } static AcceptInvitationResponse() { - object.ReferenceEquals(global::bnet.protocol.channel_invitation.ChannelInvitation.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.channel_invitation.Proto.ChannelInvitationService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class SubscribeRequest : pb::GeneratedMessage { - private static readonly SubscribeRequest defaultInstance = new Builder().BuildPartial(); + private SubscribeRequest() { } + private static readonly SubscribeRequest defaultInstance = new SubscribeRequest().MakeReadOnly(); + private static readonly string[] _subscribeRequestFieldNames = new string[] { "agent_id", "object_id" }; + private static readonly uint[] _subscribeRequestFieldTags = new uint[] { 10, 16 }; public static SubscribeRequest DefaultInstance { get { return defaultInstance; } } public override SubscribeRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override SubscribeRequest ThisMessage { @@ -723,26 +949,26 @@ protected override SubscribeRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel_invitation.ChannelInvitation.internal__static_bnet_protocol_channel_invitation_SubscribeRequest__Descriptor; } + get { return global::bnet.protocol.channel_invitation.Proto.ChannelInvitationService.internal__static_bnet_protocol_channel_invitation_SubscribeRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel_invitation.ChannelInvitation.internal__static_bnet_protocol_channel_invitation_SubscribeRequest__FieldAccessorTable; } + get { return global::bnet.protocol.channel_invitation.Proto.ChannelInvitationService.internal__static_bnet_protocol_channel_invitation_SubscribeRequest__FieldAccessorTable; } } public const int AgentIdFieldNumber = 1; private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId agentId_; public bool HasAgentId { get { return hasAgentId; } } public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } + get { return agentId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int ObjectIdFieldNumber = 2; private bool hasObjectId; - private ulong objectId_ = 0UL; + private ulong objectId_; public bool HasObjectId { get { return hasObjectId; } } @@ -760,13 +986,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasAgentId) { - output.WriteMessage(1, AgentId); + string[] field_names = _subscribeRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); } - if (HasObjectId) { - output.WriteUInt64(2, ObjectId); + if (hasObjectId) { + output.WriteUInt64(2, field_names[1], ObjectId); } UnknownFields.WriteTo(output); } @@ -778,10 +1005,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAgentId) { + if (hasAgentId) { size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); } - if (HasObjectId) { + if (hasObjectId) { size += pb::CodedOutputStream.ComputeUInt64Size(2, ObjectId); } size += UnknownFields.SerializedSize; @@ -814,38 +1041,72 @@ public static SubscribeRequest ParseDelimitedFrom(global::System.IO.Stream input public static SubscribeRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static SubscribeRequest ParseFrom(pb::CodedInputStream input) { + public static SubscribeRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SubscribeRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static SubscribeRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private SubscribeRequest MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(SubscribeRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SubscribeRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SubscribeRequest result; + + private SubscribeRequest PrepareBuilder() { + if (resultIsReadOnly) { + SubscribeRequest original = result; + result = new SubscribeRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - SubscribeRequest result = new SubscribeRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override SubscribeRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SubscribeRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -857,12 +1118,11 @@ public override SubscribeRequest DefaultInstanceForType { } public override SubscribeRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - SubscribeRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -876,6 +1136,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SubscribeRequest other) { if (other == global::bnet.protocol.channel_invitation.SubscribeRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAgentId) { MergeAgentId(other.AgentId); } @@ -886,20 +1147,31 @@ public override Builder MergeFrom(SubscribeRequest other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_subscribeRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _subscribeRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -911,12 +1183,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { + if (result.hasAgentId) { subBuilder.MergeFrom(AgentId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -924,16 +1196,21 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 16: { - ObjectId = input.ReadUInt64(); + result.hasObjectId = input.ReadUInt64(ref result.objectId_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasAgentId { - get { return result.HasAgentId; } + get { return result.hasAgentId; } } public global::bnet.protocol.EntityId AgentId { get { return result.AgentId; } @@ -941,19 +1218,22 @@ public bool HasAgentId { } public Builder SetAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = value; return this; } public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = builderForValue.Build(); return this; } public Builder MergeAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && + PrepareBuilder(); + if (result.hasAgentId && result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); } else { @@ -963,42 +1243,51 @@ public Builder MergeAgentId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearAgentId() { + PrepareBuilder(); result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.agentId_ = null; return this; } public bool HasObjectId { - get { return result.HasObjectId; } + get { return result.hasObjectId; } } public ulong ObjectId { get { return result.ObjectId; } set { SetObjectId(value); } } public Builder SetObjectId(ulong value) { + PrepareBuilder(); result.hasObjectId = true; result.objectId_ = value; return this; } public Builder ClearObjectId() { + PrepareBuilder(); result.hasObjectId = false; result.objectId_ = 0UL; return this; } } static SubscribeRequest() { - object.ReferenceEquals(global::bnet.protocol.channel_invitation.ChannelInvitation.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.channel_invitation.Proto.ChannelInvitationService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class SubscribeResponse : pb::GeneratedMessage { - private static readonly SubscribeResponse defaultInstance = new Builder().BuildPartial(); + private SubscribeResponse() { } + private static readonly SubscribeResponse defaultInstance = new SubscribeResponse().MakeReadOnly(); + private static readonly string[] _subscribeResponseFieldNames = new string[] { "collection", "received_invitation" }; + private static readonly uint[] _subscribeResponseFieldTags = new uint[] { 10, 18 }; public static SubscribeResponse DefaultInstance { get { return defaultInstance; } } public override SubscribeResponse DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override SubscribeResponse ThisMessage { @@ -1006,11 +1295,11 @@ protected override SubscribeResponse ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel_invitation.ChannelInvitation.internal__static_bnet_protocol_channel_invitation_SubscribeResponse__Descriptor; } + get { return global::bnet.protocol.channel_invitation.Proto.ChannelInvitationService.internal__static_bnet_protocol_channel_invitation_SubscribeResponse__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel_invitation.ChannelInvitation.internal__static_bnet_protocol_channel_invitation_SubscribeResponse__FieldAccessorTable; } + get { return global::bnet.protocol.channel_invitation.Proto.ChannelInvitationService.internal__static_bnet_protocol_channel_invitation_SubscribeResponse__FieldAccessorTable; } } public const int CollectionFieldNumber = 1; @@ -1049,13 +1338,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - foreach (global::bnet.protocol.channel_invitation.InvitationCollection element in CollectionList) { - output.WriteMessage(1, element); + string[] field_names = _subscribeResponseFieldNames; + if (collection_.Count > 0) { + output.WriteMessageArray(1, field_names[0], collection_); } - foreach (global::bnet.protocol.invitation.Invitation element in ReceivedInvitationList) { - output.WriteMessage(2, element); + if (receivedInvitation_.Count > 0) { + output.WriteMessageArray(2, field_names[1], receivedInvitation_); } UnknownFields.WriteTo(output); } @@ -1103,38 +1393,74 @@ public static SubscribeResponse ParseDelimitedFrom(global::System.IO.Stream inpu public static SubscribeResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static SubscribeResponse ParseFrom(pb::CodedInputStream input) { + public static SubscribeResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SubscribeResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static SubscribeResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private SubscribeResponse MakeReadOnly() { + collection_.MakeReadOnly(); + receivedInvitation_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(SubscribeResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SubscribeResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SubscribeResponse result; + + private SubscribeResponse PrepareBuilder() { + if (resultIsReadOnly) { + SubscribeResponse original = result; + result = new SubscribeResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - SubscribeResponse result = new SubscribeResponse(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override SubscribeResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SubscribeResponse(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -1146,14 +1472,11 @@ public override SubscribeResponse DefaultInstanceForType { } public override SubscribeResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.collection_.MakeReadOnly(); - result.receivedInvitation_.MakeReadOnly(); - SubscribeResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1167,30 +1490,42 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SubscribeResponse other) { if (other == global::bnet.protocol.channel_invitation.SubscribeResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.collection_.Count != 0) { - base.AddRange(other.collection_, result.collection_); + result.collection_.Add(other.collection_); } if (other.receivedInvitation_.Count != 0) { - base.AddRange(other.receivedInvitation_, result.receivedInvitation_); + result.receivedInvitation_.Add(other.receivedInvitation_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_subscribeResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _subscribeResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1202,28 +1537,29 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { - global::bnet.protocol.channel_invitation.InvitationCollection.Builder subBuilder = global::bnet.protocol.channel_invitation.InvitationCollection.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddCollection(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.collection_, global::bnet.protocol.channel_invitation.InvitationCollection.DefaultInstance, extensionRegistry); break; } case 18: { - global::bnet.protocol.invitation.Invitation.Builder subBuilder = global::bnet.protocol.invitation.Invitation.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddReceivedInvitation(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.receivedInvitation_, global::bnet.protocol.invitation.Invitation.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public pbc::IPopsicleList CollectionList { - get { return result.collection_; } + get { return PrepareBuilder().collection_; } } public int CollectionCount { get { return result.CollectionCount; } @@ -1233,35 +1569,41 @@ public int CollectionCount { } public Builder SetCollection(int index, global::bnet.protocol.channel_invitation.InvitationCollection value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.collection_[index] = value; return this; } public Builder SetCollection(int index, global::bnet.protocol.channel_invitation.InvitationCollection.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.collection_[index] = builderForValue.Build(); return this; } public Builder AddCollection(global::bnet.protocol.channel_invitation.InvitationCollection value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.collection_.Add(value); return this; } public Builder AddCollection(global::bnet.protocol.channel_invitation.InvitationCollection.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.collection_.Add(builderForValue.Build()); return this; } public Builder AddRangeCollection(scg::IEnumerable values) { - base.AddRange(values, result.collection_); + PrepareBuilder(); + result.collection_.Add(values); return this; } public Builder ClearCollection() { + PrepareBuilder(); result.collection_.Clear(); return this; } public pbc::IPopsicleList ReceivedInvitationList { - get { return result.receivedInvitation_; } + get { return PrepareBuilder().receivedInvitation_; } } public int ReceivedInvitationCount { get { return result.ReceivedInvitationCount; } @@ -1271,46 +1613,58 @@ public int ReceivedInvitationCount { } public Builder SetReceivedInvitation(int index, global::bnet.protocol.invitation.Invitation value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.receivedInvitation_[index] = value; return this; } public Builder SetReceivedInvitation(int index, global::bnet.protocol.invitation.Invitation.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.receivedInvitation_[index] = builderForValue.Build(); return this; } public Builder AddReceivedInvitation(global::bnet.protocol.invitation.Invitation value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.receivedInvitation_.Add(value); return this; } public Builder AddReceivedInvitation(global::bnet.protocol.invitation.Invitation.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.receivedInvitation_.Add(builderForValue.Build()); return this; } public Builder AddRangeReceivedInvitation(scg::IEnumerable values) { - base.AddRange(values, result.receivedInvitation_); + PrepareBuilder(); + result.receivedInvitation_.Add(values); return this; } public Builder ClearReceivedInvitation() { + PrepareBuilder(); result.receivedInvitation_.Clear(); return this; } } static SubscribeResponse() { - object.ReferenceEquals(global::bnet.protocol.channel_invitation.ChannelInvitation.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.channel_invitation.Proto.ChannelInvitationService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class UnsubscribeRequest : pb::GeneratedMessage { - private static readonly UnsubscribeRequest defaultInstance = new Builder().BuildPartial(); + private UnsubscribeRequest() { } + private static readonly UnsubscribeRequest defaultInstance = new UnsubscribeRequest().MakeReadOnly(); + private static readonly string[] _unsubscribeRequestFieldNames = new string[] { "agent_id" }; + private static readonly uint[] _unsubscribeRequestFieldTags = new uint[] { 10 }; public static UnsubscribeRequest DefaultInstance { get { return defaultInstance; } } public override UnsubscribeRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override UnsubscribeRequest ThisMessage { @@ -1318,21 +1672,21 @@ protected override UnsubscribeRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel_invitation.ChannelInvitation.internal__static_bnet_protocol_channel_invitation_UnsubscribeRequest__Descriptor; } + get { return global::bnet.protocol.channel_invitation.Proto.ChannelInvitationService.internal__static_bnet_protocol_channel_invitation_UnsubscribeRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel_invitation.ChannelInvitation.internal__static_bnet_protocol_channel_invitation_UnsubscribeRequest__FieldAccessorTable; } + get { return global::bnet.protocol.channel_invitation.Proto.ChannelInvitationService.internal__static_bnet_protocol_channel_invitation_UnsubscribeRequest__FieldAccessorTable; } } public const int AgentIdFieldNumber = 1; private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId agentId_; public bool HasAgentId { get { return hasAgentId; } } public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } + get { return agentId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public override bool IsInitialized { @@ -1344,10 +1698,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasAgentId) { - output.WriteMessage(1, AgentId); + string[] field_names = _unsubscribeRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); } UnknownFields.WriteTo(output); } @@ -1359,7 +1714,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAgentId) { + if (hasAgentId) { size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); } size += UnknownFields.SerializedSize; @@ -1392,38 +1747,72 @@ public static UnsubscribeRequest ParseDelimitedFrom(global::System.IO.Stream inp public static UnsubscribeRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static UnsubscribeRequest ParseFrom(pb::CodedInputStream input) { + public static UnsubscribeRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static UnsubscribeRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static UnsubscribeRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private UnsubscribeRequest MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(UnsubscribeRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(UnsubscribeRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - UnsubscribeRequest result = new UnsubscribeRequest(); + private bool resultIsReadOnly; + private UnsubscribeRequest result; + + private UnsubscribeRequest PrepareBuilder() { + if (resultIsReadOnly) { + UnsubscribeRequest original = result; + result = new UnsubscribeRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override UnsubscribeRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new UnsubscribeRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -1435,12 +1824,11 @@ public override UnsubscribeRequest DefaultInstanceForType { } public override UnsubscribeRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - UnsubscribeRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1454,6 +1842,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(UnsubscribeRequest other) { if (other == global::bnet.protocol.channel_invitation.UnsubscribeRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAgentId) { MergeAgentId(other.AgentId); } @@ -1461,20 +1850,31 @@ public override Builder MergeFrom(UnsubscribeRequest other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_unsubscribeRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _unsubscribeRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1486,12 +1886,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { + if (result.hasAgentId) { subBuilder.MergeFrom(AgentId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1500,11 +1900,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasAgentId { - get { return result.HasAgentId; } + get { return result.hasAgentId; } } public global::bnet.protocol.EntityId AgentId { get { return result.AgentId; } @@ -1512,19 +1917,22 @@ public bool HasAgentId { } public Builder SetAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = value; return this; } public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = builderForValue.Build(); return this; } public Builder MergeAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && + PrepareBuilder(); + if (result.hasAgentId && result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); } else { @@ -1534,24 +1942,31 @@ public Builder MergeAgentId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearAgentId() { + PrepareBuilder(); result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.agentId_ = null; return this; } } static UnsubscribeRequest() { - object.ReferenceEquals(global::bnet.protocol.channel_invitation.ChannelInvitation.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.channel_invitation.Proto.ChannelInvitationService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class SuggestInvitationRequest : pb::GeneratedMessage { - private static readonly SuggestInvitationRequest defaultInstance = new Builder().BuildPartial(); + private SuggestInvitationRequest() { } + private static readonly SuggestInvitationRequest defaultInstance = new SuggestInvitationRequest().MakeReadOnly(); + private static readonly string[] _suggestInvitationRequestFieldNames = new string[] { "agent_id", "agent_identity", "agent_info", "approval_id", "channel_id", "target_id" }; + private static readonly uint[] _suggestInvitationRequestFieldTags = new uint[] { 10, 42, 50, 34, 18, 26 }; public static SuggestInvitationRequest DefaultInstance { get { return defaultInstance; } } public override SuggestInvitationRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override SuggestInvitationRequest ThisMessage { @@ -1559,51 +1974,71 @@ protected override SuggestInvitationRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel_invitation.ChannelInvitation.internal__static_bnet_protocol_channel_invitation_SuggestInvitationRequest__Descriptor; } + get { return global::bnet.protocol.channel_invitation.Proto.ChannelInvitationService.internal__static_bnet_protocol_channel_invitation_SuggestInvitationRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel_invitation.ChannelInvitation.internal__static_bnet_protocol_channel_invitation_SuggestInvitationRequest__FieldAccessorTable; } + get { return global::bnet.protocol.channel_invitation.Proto.ChannelInvitationService.internal__static_bnet_protocol_channel_invitation_SuggestInvitationRequest__FieldAccessorTable; } } public const int AgentIdFieldNumber = 1; private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId agentId_; public bool HasAgentId { get { return hasAgentId; } } public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } + get { return agentId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int ChannelIdFieldNumber = 2; private bool hasChannelId; - private global::bnet.protocol.EntityId channelId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId channelId_; public bool HasChannelId { get { return hasChannelId; } } public global::bnet.protocol.EntityId ChannelId { - get { return channelId_; } + get { return channelId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int TargetIdFieldNumber = 3; private bool hasTargetId; - private global::bnet.protocol.EntityId targetId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId targetId_; public bool HasTargetId { get { return hasTargetId; } } public global::bnet.protocol.EntityId TargetId { - get { return targetId_; } + get { return targetId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int ApprovalIdFieldNumber = 4; private bool hasApprovalId; - private global::bnet.protocol.EntityId approvalId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId approvalId_; public bool HasApprovalId { get { return hasApprovalId; } } public global::bnet.protocol.EntityId ApprovalId { - get { return approvalId_; } + get { return approvalId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int AgentIdentityFieldNumber = 5; + private bool hasAgentIdentity; + private global::bnet.protocol.Identity agentIdentity_; + public bool HasAgentIdentity { + get { return hasAgentIdentity; } + } + public global::bnet.protocol.Identity AgentIdentity { + get { return agentIdentity_ ?? global::bnet.protocol.Identity.DefaultInstance; } + } + + public const int AgentInfoFieldNumber = 6; + private bool hasAgentInfo; + private global::bnet.protocol.AccountInfo agentInfo_; + public bool HasAgentInfo { + get { return hasAgentInfo; } + } + public global::bnet.protocol.AccountInfo AgentInfo { + get { return agentInfo_ ?? global::bnet.protocol.AccountInfo.DefaultInstance; } } public override bool IsInitialized { @@ -1618,23 +2053,33 @@ public override bool IsInitialized { if (HasApprovalId) { if (!ApprovalId.IsInitialized) return false; } + if (HasAgentIdentity) { + if (!AgentIdentity.IsInitialized) return false; + } return true; } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasAgentId) { - output.WriteMessage(1, AgentId); + string[] field_names = _suggestInvitationRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); + } + if (hasChannelId) { + output.WriteMessage(2, field_names[4], ChannelId); + } + if (hasTargetId) { + output.WriteMessage(3, field_names[5], TargetId); } - if (HasChannelId) { - output.WriteMessage(2, ChannelId); + if (hasApprovalId) { + output.WriteMessage(4, field_names[3], ApprovalId); } - if (HasTargetId) { - output.WriteMessage(3, TargetId); + if (hasAgentIdentity) { + output.WriteMessage(5, field_names[1], AgentIdentity); } - if (HasApprovalId) { - output.WriteMessage(4, ApprovalId); + if (hasAgentInfo) { + output.WriteMessage(6, field_names[2], AgentInfo); } UnknownFields.WriteTo(output); } @@ -1646,18 +2091,24 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAgentId) { + if (hasAgentId) { size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); } - if (HasChannelId) { + if (hasChannelId) { size += pb::CodedOutputStream.ComputeMessageSize(2, ChannelId); } - if (HasTargetId) { + if (hasTargetId) { size += pb::CodedOutputStream.ComputeMessageSize(3, TargetId); } - if (HasApprovalId) { + if (hasApprovalId) { size += pb::CodedOutputStream.ComputeMessageSize(4, ApprovalId); } + if (hasAgentIdentity) { + size += pb::CodedOutputStream.ComputeMessageSize(5, AgentIdentity); + } + if (hasAgentInfo) { + size += pb::CodedOutputStream.ComputeMessageSize(6, AgentInfo); + } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; return size; @@ -1688,38 +2139,72 @@ public static SuggestInvitationRequest ParseDelimitedFrom(global::System.IO.Stre public static SuggestInvitationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static SuggestInvitationRequest ParseFrom(pb::CodedInputStream input) { + public static SuggestInvitationRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SuggestInvitationRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static SuggestInvitationRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private SuggestInvitationRequest MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(SuggestInvitationRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SuggestInvitationRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - SuggestInvitationRequest result = new SuggestInvitationRequest(); + private bool resultIsReadOnly; + private SuggestInvitationRequest result; + + private SuggestInvitationRequest PrepareBuilder() { + if (resultIsReadOnly) { + SuggestInvitationRequest original = result; + result = new SuggestInvitationRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override SuggestInvitationRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SuggestInvitationRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -1731,12 +2216,11 @@ public override SuggestInvitationRequest DefaultInstanceForType { } public override SuggestInvitationRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - SuggestInvitationRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1750,6 +2234,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SuggestInvitationRequest other) { if (other == global::bnet.protocol.channel_invitation.SuggestInvitationRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAgentId) { MergeAgentId(other.AgentId); } @@ -1762,24 +2247,41 @@ public override Builder MergeFrom(SuggestInvitationRequest other) { if (other.HasApprovalId) { MergeApprovalId(other.ApprovalId); } + if (other.HasAgentIdentity) { + MergeAgentIdentity(other.AgentIdentity); + } + if (other.HasAgentInfo) { + MergeAgentInfo(other.AgentInfo); + } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_suggestInvitationRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _suggestInvitationRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1791,12 +2293,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { + if (result.hasAgentId) { subBuilder.MergeFrom(AgentId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1805,7 +2307,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasChannelId) { + if (result.hasChannelId) { subBuilder.MergeFrom(ChannelId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1814,7 +2316,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 26: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasTargetId) { + if (result.hasTargetId) { subBuilder.MergeFrom(TargetId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1823,20 +2325,43 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 34: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasApprovalId) { + if (result.hasApprovalId) { subBuilder.MergeFrom(ApprovalId); } input.ReadMessage(subBuilder, extensionRegistry); ApprovalId = subBuilder.BuildPartial(); break; } + case 42: { + global::bnet.protocol.Identity.Builder subBuilder = global::bnet.protocol.Identity.CreateBuilder(); + if (result.hasAgentIdentity) { + subBuilder.MergeFrom(AgentIdentity); + } + input.ReadMessage(subBuilder, extensionRegistry); + AgentIdentity = subBuilder.BuildPartial(); + break; + } + case 50: { + global::bnet.protocol.AccountInfo.Builder subBuilder = global::bnet.protocol.AccountInfo.CreateBuilder(); + if (result.hasAgentInfo) { + subBuilder.MergeFrom(AgentInfo); + } + input.ReadMessage(subBuilder, extensionRegistry); + AgentInfo = subBuilder.BuildPartial(); + break; + } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasAgentId { - get { return result.HasAgentId; } + get { return result.hasAgentId; } } public global::bnet.protocol.EntityId AgentId { get { return result.AgentId; } @@ -1844,19 +2369,22 @@ public bool HasAgentId { } public Builder SetAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = value; return this; } public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = builderForValue.Build(); return this; } public Builder MergeAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && + PrepareBuilder(); + if (result.hasAgentId && result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); } else { @@ -1866,13 +2394,14 @@ public Builder MergeAgentId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearAgentId() { + PrepareBuilder(); result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.agentId_ = null; return this; } public bool HasChannelId { - get { return result.HasChannelId; } + get { return result.hasChannelId; } } public global::bnet.protocol.EntityId ChannelId { get { return result.ChannelId; } @@ -1880,19 +2409,22 @@ public bool HasChannelId { } public Builder SetChannelId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasChannelId = true; result.channelId_ = value; return this; } public Builder SetChannelId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasChannelId = true; result.channelId_ = builderForValue.Build(); return this; } public Builder MergeChannelId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasChannelId && + PrepareBuilder(); + if (result.hasChannelId && result.channelId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.channelId_ = global::bnet.protocol.EntityId.CreateBuilder(result.channelId_).MergeFrom(value).BuildPartial(); } else { @@ -1902,13 +2434,14 @@ public Builder MergeChannelId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearChannelId() { + PrepareBuilder(); result.hasChannelId = false; - result.channelId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.channelId_ = null; return this; } public bool HasTargetId { - get { return result.HasTargetId; } + get { return result.hasTargetId; } } public global::bnet.protocol.EntityId TargetId { get { return result.TargetId; } @@ -1916,19 +2449,22 @@ public bool HasTargetId { } public Builder SetTargetId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasTargetId = true; result.targetId_ = value; return this; } public Builder SetTargetId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasTargetId = true; result.targetId_ = builderForValue.Build(); return this; } public Builder MergeTargetId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasTargetId && + PrepareBuilder(); + if (result.hasTargetId && result.targetId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.targetId_ = global::bnet.protocol.EntityId.CreateBuilder(result.targetId_).MergeFrom(value).BuildPartial(); } else { @@ -1938,13 +2474,14 @@ public Builder MergeTargetId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearTargetId() { + PrepareBuilder(); result.hasTargetId = false; - result.targetId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.targetId_ = null; return this; } public bool HasApprovalId { - get { return result.HasApprovalId; } + get { return result.hasApprovalId; } } public global::bnet.protocol.EntityId ApprovalId { get { return result.ApprovalId; } @@ -1952,19 +2489,22 @@ public bool HasApprovalId { } public Builder SetApprovalId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasApprovalId = true; result.approvalId_ = value; return this; } public Builder SetApprovalId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasApprovalId = true; result.approvalId_ = builderForValue.Build(); return this; } public Builder MergeApprovalId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasApprovalId && + PrepareBuilder(); + if (result.hasApprovalId && result.approvalId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.approvalId_ = global::bnet.protocol.EntityId.CreateBuilder(result.approvalId_).MergeFrom(value).BuildPartial(); } else { @@ -1974,24 +2514,111 @@ public Builder MergeApprovalId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearApprovalId() { + PrepareBuilder(); result.hasApprovalId = false; - result.approvalId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.approvalId_ = null; + return this; + } + + public bool HasAgentIdentity { + get { return result.hasAgentIdentity; } + } + public global::bnet.protocol.Identity AgentIdentity { + get { return result.AgentIdentity; } + set { SetAgentIdentity(value); } + } + public Builder SetAgentIdentity(global::bnet.protocol.Identity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAgentIdentity = true; + result.agentIdentity_ = value; + return this; + } + public Builder SetAgentIdentity(global::bnet.protocol.Identity.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAgentIdentity = true; + result.agentIdentity_ = builderForValue.Build(); + return this; + } + public Builder MergeAgentIdentity(global::bnet.protocol.Identity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAgentIdentity && + result.agentIdentity_ != global::bnet.protocol.Identity.DefaultInstance) { + result.agentIdentity_ = global::bnet.protocol.Identity.CreateBuilder(result.agentIdentity_).MergeFrom(value).BuildPartial(); + } else { + result.agentIdentity_ = value; + } + result.hasAgentIdentity = true; + return this; + } + public Builder ClearAgentIdentity() { + PrepareBuilder(); + result.hasAgentIdentity = false; + result.agentIdentity_ = null; + return this; + } + + public bool HasAgentInfo { + get { return result.hasAgentInfo; } + } + public global::bnet.protocol.AccountInfo AgentInfo { + get { return result.AgentInfo; } + set { SetAgentInfo(value); } + } + public Builder SetAgentInfo(global::bnet.protocol.AccountInfo value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAgentInfo = true; + result.agentInfo_ = value; + return this; + } + public Builder SetAgentInfo(global::bnet.protocol.AccountInfo.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAgentInfo = true; + result.agentInfo_ = builderForValue.Build(); + return this; + } + public Builder MergeAgentInfo(global::bnet.protocol.AccountInfo value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAgentInfo && + result.agentInfo_ != global::bnet.protocol.AccountInfo.DefaultInstance) { + result.agentInfo_ = global::bnet.protocol.AccountInfo.CreateBuilder(result.agentInfo_).MergeFrom(value).BuildPartial(); + } else { + result.agentInfo_ = value; + } + result.hasAgentInfo = true; + return this; + } + public Builder ClearAgentInfo() { + PrepareBuilder(); + result.hasAgentInfo = false; + result.agentInfo_ = null; return this; } } static SuggestInvitationRequest() { - object.ReferenceEquals(global::bnet.protocol.channel_invitation.ChannelInvitation.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.channel_invitation.Proto.ChannelInvitationService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class RevokeInvitationRequest : pb::GeneratedMessage { - private static readonly RevokeInvitationRequest defaultInstance = new Builder().BuildPartial(); + private RevokeInvitationRequest() { } + private static readonly RevokeInvitationRequest defaultInstance = new RevokeInvitationRequest().MakeReadOnly(); + private static readonly string[] _revokeInvitationRequestFieldNames = new string[] { "agent_id", "channel_id", "invitation_id", "target_id" }; + private static readonly uint[] _revokeInvitationRequestFieldTags = new uint[] { 10, 34, 25, 18 }; public static RevokeInvitationRequest DefaultInstance { get { return defaultInstance; } } public override RevokeInvitationRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override RevokeInvitationRequest ThisMessage { @@ -1999,36 +2626,36 @@ protected override RevokeInvitationRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel_invitation.ChannelInvitation.internal__static_bnet_protocol_channel_invitation_RevokeInvitationRequest__Descriptor; } + get { return global::bnet.protocol.channel_invitation.Proto.ChannelInvitationService.internal__static_bnet_protocol_channel_invitation_RevokeInvitationRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel_invitation.ChannelInvitation.internal__static_bnet_protocol_channel_invitation_RevokeInvitationRequest__FieldAccessorTable; } + get { return global::bnet.protocol.channel_invitation.Proto.ChannelInvitationService.internal__static_bnet_protocol_channel_invitation_RevokeInvitationRequest__FieldAccessorTable; } } public const int AgentIdFieldNumber = 1; private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId agentId_; public bool HasAgentId { get { return hasAgentId; } } public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } + get { return agentId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int TargetIdFieldNumber = 2; private bool hasTargetId; - private global::bnet.protocol.EntityId targetId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId targetId_; public bool HasTargetId { get { return hasTargetId; } } public global::bnet.protocol.EntityId TargetId { - get { return targetId_; } + get { return targetId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int InvitationIdFieldNumber = 3; private bool hasInvitationId; - private ulong invitationId_ = 0; + private ulong invitationId_; public bool HasInvitationId { get { return hasInvitationId; } } @@ -2038,12 +2665,12 @@ public ulong InvitationId { public const int ChannelIdFieldNumber = 4; private bool hasChannelId; - private global::bnet.protocol.EntityId channelId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId channelId_; public bool HasChannelId { get { return hasChannelId; } } public global::bnet.protocol.EntityId ChannelId { - get { return channelId_; } + get { return channelId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public override bool IsInitialized { @@ -2061,19 +2688,20 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasAgentId) { - output.WriteMessage(1, AgentId); + string[] field_names = _revokeInvitationRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); } - if (HasTargetId) { - output.WriteMessage(2, TargetId); + if (hasTargetId) { + output.WriteMessage(2, field_names[3], TargetId); } - if (HasInvitationId) { - output.WriteFixed64(3, InvitationId); + if (hasInvitationId) { + output.WriteFixed64(3, field_names[2], InvitationId); } - if (HasChannelId) { - output.WriteMessage(4, ChannelId); + if (hasChannelId) { + output.WriteMessage(4, field_names[1], ChannelId); } UnknownFields.WriteTo(output); } @@ -2085,16 +2713,16 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAgentId) { + if (hasAgentId) { size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); } - if (HasTargetId) { + if (hasTargetId) { size += pb::CodedOutputStream.ComputeMessageSize(2, TargetId); } - if (HasInvitationId) { + if (hasInvitationId) { size += pb::CodedOutputStream.ComputeFixed64Size(3, InvitationId); } - if (HasChannelId) { + if (hasChannelId) { size += pb::CodedOutputStream.ComputeMessageSize(4, ChannelId); } size += UnknownFields.SerializedSize; @@ -2127,38 +2755,72 @@ public static RevokeInvitationRequest ParseDelimitedFrom(global::System.IO.Strea public static RevokeInvitationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static RevokeInvitationRequest ParseFrom(pb::CodedInputStream input) { + public static RevokeInvitationRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static RevokeInvitationRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static RevokeInvitationRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private RevokeInvitationRequest MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(RevokeInvitationRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(RevokeInvitationRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private RevokeInvitationRequest result; + + private RevokeInvitationRequest PrepareBuilder() { + if (resultIsReadOnly) { + RevokeInvitationRequest original = result; + result = new RevokeInvitationRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - RevokeInvitationRequest result = new RevokeInvitationRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override RevokeInvitationRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new RevokeInvitationRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -2170,12 +2832,11 @@ public override RevokeInvitationRequest DefaultInstanceForType { } public override RevokeInvitationRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - RevokeInvitationRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2189,6 +2850,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(RevokeInvitationRequest other) { if (other == global::bnet.protocol.channel_invitation.RevokeInvitationRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAgentId) { MergeAgentId(other.AgentId); } @@ -2205,20 +2867,31 @@ public override Builder MergeFrom(RevokeInvitationRequest other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_revokeInvitationRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _revokeInvitationRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -2230,12 +2903,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { + if (result.hasAgentId) { subBuilder.MergeFrom(AgentId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2244,7 +2917,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasTargetId) { + if (result.hasTargetId) { subBuilder.MergeFrom(TargetId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2252,12 +2925,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 25: { - InvitationId = input.ReadFixed64(); + result.hasInvitationId = input.ReadFixed64(ref result.invitationId_); break; } case 34: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasChannelId) { + if (result.hasChannelId) { subBuilder.MergeFrom(ChannelId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2266,11 +2939,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasAgentId { - get { return result.HasAgentId; } + get { return result.hasAgentId; } } public global::bnet.protocol.EntityId AgentId { get { return result.AgentId; } @@ -2278,19 +2956,22 @@ public bool HasAgentId { } public Builder SetAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = value; return this; } public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = builderForValue.Build(); return this; } public Builder MergeAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && + PrepareBuilder(); + if (result.hasAgentId && result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); } else { @@ -2300,13 +2981,14 @@ public Builder MergeAgentId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearAgentId() { + PrepareBuilder(); result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.agentId_ = null; return this; } public bool HasTargetId { - get { return result.HasTargetId; } + get { return result.hasTargetId; } } public global::bnet.protocol.EntityId TargetId { get { return result.TargetId; } @@ -2314,19 +2996,22 @@ public bool HasTargetId { } public Builder SetTargetId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasTargetId = true; result.targetId_ = value; return this; } public Builder SetTargetId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasTargetId = true; result.targetId_ = builderForValue.Build(); return this; } public Builder MergeTargetId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasTargetId && + PrepareBuilder(); + if (result.hasTargetId && result.targetId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.targetId_ = global::bnet.protocol.EntityId.CreateBuilder(result.targetId_).MergeFrom(value).BuildPartial(); } else { @@ -2336,31 +3021,34 @@ public Builder MergeTargetId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearTargetId() { + PrepareBuilder(); result.hasTargetId = false; - result.targetId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.targetId_ = null; return this; } public bool HasInvitationId { - get { return result.HasInvitationId; } + get { return result.hasInvitationId; } } public ulong InvitationId { get { return result.InvitationId; } set { SetInvitationId(value); } } public Builder SetInvitationId(ulong value) { + PrepareBuilder(); result.hasInvitationId = true; result.invitationId_ = value; return this; } public Builder ClearInvitationId() { + PrepareBuilder(); result.hasInvitationId = false; result.invitationId_ = 0; return this; } public bool HasChannelId { - get { return result.HasChannelId; } + get { return result.hasChannelId; } } public global::bnet.protocol.EntityId ChannelId { get { return result.ChannelId; } @@ -2368,19 +3056,22 @@ public bool HasChannelId { } public Builder SetChannelId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasChannelId = true; result.channelId_ = value; return this; } public Builder SetChannelId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasChannelId = true; result.channelId_ = builderForValue.Build(); return this; } public Builder MergeChannelId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasChannelId && + PrepareBuilder(); + if (result.hasChannelId && result.channelId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.channelId_ = global::bnet.protocol.EntityId.CreateBuilder(result.channelId_).MergeFrom(value).BuildPartial(); } else { @@ -2390,24 +3081,31 @@ public Builder MergeChannelId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearChannelId() { + PrepareBuilder(); result.hasChannelId = false; - result.channelId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.channelId_ = null; return this; } } static RevokeInvitationRequest() { - object.ReferenceEquals(global::bnet.protocol.channel_invitation.ChannelInvitation.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.channel_invitation.Proto.ChannelInvitationService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class HasRoomForInvitationRequest : pb::GeneratedMessage { - private static readonly HasRoomForInvitationRequest defaultInstance = new Builder().BuildPartial(); + private HasRoomForInvitationRequest() { } + private static readonly HasRoomForInvitationRequest defaultInstance = new HasRoomForInvitationRequest().MakeReadOnly(); + private static readonly string[] _hasRoomForInvitationRequestFieldNames = new string[] { "service_type" }; + private static readonly uint[] _hasRoomForInvitationRequestFieldTags = new uint[] { 8 }; public static HasRoomForInvitationRequest DefaultInstance { get { return defaultInstance; } } public override HasRoomForInvitationRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override HasRoomForInvitationRequest ThisMessage { @@ -2415,16 +3113,16 @@ protected override HasRoomForInvitationRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel_invitation.ChannelInvitation.internal__static_bnet_protocol_channel_invitation_HasRoomForInvitationRequest__Descriptor; } + get { return global::bnet.protocol.channel_invitation.Proto.ChannelInvitationService.internal__static_bnet_protocol_channel_invitation_HasRoomForInvitationRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel_invitation.ChannelInvitation.internal__static_bnet_protocol_channel_invitation_HasRoomForInvitationRequest__FieldAccessorTable; } + get { return global::bnet.protocol.channel_invitation.Proto.ChannelInvitationService.internal__static_bnet_protocol_channel_invitation_HasRoomForInvitationRequest__FieldAccessorTable; } } public const int ServiceTypeFieldNumber = 1; private bool hasServiceType; - private uint serviceType_ = 0; + private uint serviceType_; public bool HasServiceType { get { return hasServiceType; } } @@ -2439,10 +3137,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasServiceType) { - output.WriteUInt32(1, ServiceType); + string[] field_names = _hasRoomForInvitationRequestFieldNames; + if (hasServiceType) { + output.WriteUInt32(1, field_names[0], ServiceType); } UnknownFields.WriteTo(output); } @@ -2454,7 +3153,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasServiceType) { + if (hasServiceType) { size += pb::CodedOutputStream.ComputeUInt32Size(1, ServiceType); } size += UnknownFields.SerializedSize; @@ -2487,38 +3186,72 @@ public static HasRoomForInvitationRequest ParseDelimitedFrom(global::System.IO.S public static HasRoomForInvitationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static HasRoomForInvitationRequest ParseFrom(pb::CodedInputStream input) { + public static HasRoomForInvitationRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static HasRoomForInvitationRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static HasRoomForInvitationRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private HasRoomForInvitationRequest MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(HasRoomForInvitationRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(HasRoomForInvitationRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private HasRoomForInvitationRequest result; - HasRoomForInvitationRequest result = new HasRoomForInvitationRequest(); + private HasRoomForInvitationRequest PrepareBuilder() { + if (resultIsReadOnly) { + HasRoomForInvitationRequest original = result; + result = new HasRoomForInvitationRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override HasRoomForInvitationRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new HasRoomForInvitationRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -2530,12 +3263,11 @@ public override HasRoomForInvitationRequest DefaultInstanceForType { } public override HasRoomForInvitationRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - HasRoomForInvitationRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2549,6 +3281,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(HasRoomForInvitationRequest other) { if (other == global::bnet.protocol.channel_invitation.HasRoomForInvitationRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasServiceType) { ServiceType = other.ServiceType; } @@ -2556,20 +3289,31 @@ public override Builder MergeFrom(HasRoomForInvitationRequest other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_hasRoomForInvitationRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _hasRoomForInvitationRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -2581,49 +3325,62 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 8: { - ServiceType = input.ReadUInt32(); + result.hasServiceType = input.ReadUInt32(ref result.serviceType_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasServiceType { - get { return result.HasServiceType; } + get { return result.hasServiceType; } } public uint ServiceType { get { return result.ServiceType; } set { SetServiceType(value); } } public Builder SetServiceType(uint value) { + PrepareBuilder(); result.hasServiceType = true; result.serviceType_ = value; return this; } public Builder ClearServiceType() { + PrepareBuilder(); result.hasServiceType = false; result.serviceType_ = 0; return this; } } static HasRoomForInvitationRequest() { - object.ReferenceEquals(global::bnet.protocol.channel_invitation.ChannelInvitation.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.channel_invitation.Proto.ChannelInvitationService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class InvitationAddedNotification : pb::GeneratedMessage { - private static readonly InvitationAddedNotification defaultInstance = new Builder().BuildPartial(); + private InvitationAddedNotification() { } + private static readonly InvitationAddedNotification defaultInstance = new InvitationAddedNotification().MakeReadOnly(); + private static readonly string[] _invitationAddedNotificationFieldNames = new string[] { "invitation" }; + private static readonly uint[] _invitationAddedNotificationFieldTags = new uint[] { 10 }; public static InvitationAddedNotification DefaultInstance { get { return defaultInstance; } } public override InvitationAddedNotification DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override InvitationAddedNotification ThisMessage { @@ -2631,21 +3388,21 @@ protected override InvitationAddedNotification ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel_invitation.ChannelInvitation.internal__static_bnet_protocol_channel_invitation_InvitationAddedNotification__Descriptor; } + get { return global::bnet.protocol.channel_invitation.Proto.ChannelInvitationService.internal__static_bnet_protocol_channel_invitation_InvitationAddedNotification__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel_invitation.ChannelInvitation.internal__static_bnet_protocol_channel_invitation_InvitationAddedNotification__FieldAccessorTable; } + get { return global::bnet.protocol.channel_invitation.Proto.ChannelInvitationService.internal__static_bnet_protocol_channel_invitation_InvitationAddedNotification__FieldAccessorTable; } } public const int InvitationFieldNumber = 1; private bool hasInvitation; - private global::bnet.protocol.invitation.Invitation invitation_ = global::bnet.protocol.invitation.Invitation.DefaultInstance; + private global::bnet.protocol.invitation.Invitation invitation_; public bool HasInvitation { get { return hasInvitation; } } public global::bnet.protocol.invitation.Invitation Invitation { - get { return invitation_; } + get { return invitation_ ?? global::bnet.protocol.invitation.Invitation.DefaultInstance; } } public override bool IsInitialized { @@ -2656,10 +3413,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasInvitation) { - output.WriteMessage(1, Invitation); + string[] field_names = _invitationAddedNotificationFieldNames; + if (hasInvitation) { + output.WriteMessage(1, field_names[0], Invitation); } UnknownFields.WriteTo(output); } @@ -2671,7 +3429,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasInvitation) { + if (hasInvitation) { size += pb::CodedOutputStream.ComputeMessageSize(1, Invitation); } size += UnknownFields.SerializedSize; @@ -2704,38 +3462,72 @@ public static InvitationAddedNotification ParseDelimitedFrom(global::System.IO.S public static InvitationAddedNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static InvitationAddedNotification ParseFrom(pb::CodedInputStream input) { + public static InvitationAddedNotification ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static InvitationAddedNotification ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static InvitationAddedNotification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private InvitationAddedNotification MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(InvitationAddedNotification prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(InvitationAddedNotification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private InvitationAddedNotification result; + + private InvitationAddedNotification PrepareBuilder() { + if (resultIsReadOnly) { + InvitationAddedNotification original = result; + result = new InvitationAddedNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - InvitationAddedNotification result = new InvitationAddedNotification(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override InvitationAddedNotification MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new InvitationAddedNotification(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -2747,12 +3539,11 @@ public override InvitationAddedNotification DefaultInstanceForType { } public override InvitationAddedNotification BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - InvitationAddedNotification returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2766,6 +3557,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(InvitationAddedNotification other) { if (other == global::bnet.protocol.channel_invitation.InvitationAddedNotification.DefaultInstance) return this; + PrepareBuilder(); if (other.HasInvitation) { MergeInvitation(other.Invitation); } @@ -2773,20 +3565,31 @@ public override Builder MergeFrom(InvitationAddedNotification other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_invitationAddedNotificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _invitationAddedNotificationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -2798,12 +3601,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.invitation.Invitation.Builder subBuilder = global::bnet.protocol.invitation.Invitation.CreateBuilder(); - if (HasInvitation) { + if (result.hasInvitation) { subBuilder.MergeFrom(Invitation); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2812,11 +3615,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasInvitation { - get { return result.HasInvitation; } + get { return result.hasInvitation; } } public global::bnet.protocol.invitation.Invitation Invitation { get { return result.Invitation; } @@ -2824,19 +3632,22 @@ public bool HasInvitation { } public Builder SetInvitation(global::bnet.protocol.invitation.Invitation value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasInvitation = true; result.invitation_ = value; return this; } public Builder SetInvitation(global::bnet.protocol.invitation.Invitation.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasInvitation = true; result.invitation_ = builderForValue.Build(); return this; } public Builder MergeInvitation(global::bnet.protocol.invitation.Invitation value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasInvitation && + PrepareBuilder(); + if (result.hasInvitation && result.invitation_ != global::bnet.protocol.invitation.Invitation.DefaultInstance) { result.invitation_ = global::bnet.protocol.invitation.Invitation.CreateBuilder(result.invitation_).MergeFrom(value).BuildPartial(); } else { @@ -2846,24 +3657,31 @@ public Builder MergeInvitation(global::bnet.protocol.invitation.Invitation value return this; } public Builder ClearInvitation() { + PrepareBuilder(); result.hasInvitation = false; - result.invitation_ = global::bnet.protocol.invitation.Invitation.DefaultInstance; + result.invitation_ = null; return this; } } static InvitationAddedNotification() { - object.ReferenceEquals(global::bnet.protocol.channel_invitation.ChannelInvitation.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.channel_invitation.Proto.ChannelInvitationService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class InvitationRemovedNotification : pb::GeneratedMessage { - private static readonly InvitationRemovedNotification defaultInstance = new Builder().BuildPartial(); + private InvitationRemovedNotification() { } + private static readonly InvitationRemovedNotification defaultInstance = new InvitationRemovedNotification().MakeReadOnly(); + private static readonly string[] _invitationRemovedNotificationFieldNames = new string[] { "invitation", "reason" }; + private static readonly uint[] _invitationRemovedNotificationFieldTags = new uint[] { 10, 16 }; public static InvitationRemovedNotification DefaultInstance { get { return defaultInstance; } } public override InvitationRemovedNotification DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override InvitationRemovedNotification ThisMessage { @@ -2871,26 +3689,26 @@ protected override InvitationRemovedNotification ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel_invitation.ChannelInvitation.internal__static_bnet_protocol_channel_invitation_InvitationRemovedNotification__Descriptor; } + get { return global::bnet.protocol.channel_invitation.Proto.ChannelInvitationService.internal__static_bnet_protocol_channel_invitation_InvitationRemovedNotification__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel_invitation.ChannelInvitation.internal__static_bnet_protocol_channel_invitation_InvitationRemovedNotification__FieldAccessorTable; } + get { return global::bnet.protocol.channel_invitation.Proto.ChannelInvitationService.internal__static_bnet_protocol_channel_invitation_InvitationRemovedNotification__FieldAccessorTable; } } public const int InvitationFieldNumber = 1; private bool hasInvitation; - private global::bnet.protocol.invitation.Invitation invitation_ = global::bnet.protocol.invitation.Invitation.DefaultInstance; + private global::bnet.protocol.invitation.Invitation invitation_; public bool HasInvitation { get { return hasInvitation; } } public global::bnet.protocol.invitation.Invitation Invitation { - get { return invitation_; } + get { return invitation_ ?? global::bnet.protocol.invitation.Invitation.DefaultInstance; } } public const int ReasonFieldNumber = 2; private bool hasReason; - private uint reason_ = 0; + private uint reason_; public bool HasReason { get { return hasReason; } } @@ -2906,13 +3724,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasInvitation) { - output.WriteMessage(1, Invitation); + string[] field_names = _invitationRemovedNotificationFieldNames; + if (hasInvitation) { + output.WriteMessage(1, field_names[0], Invitation); } - if (HasReason) { - output.WriteUInt32(2, Reason); + if (hasReason) { + output.WriteUInt32(2, field_names[1], Reason); } UnknownFields.WriteTo(output); } @@ -2924,10 +3743,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasInvitation) { + if (hasInvitation) { size += pb::CodedOutputStream.ComputeMessageSize(1, Invitation); } - if (HasReason) { + if (hasReason) { size += pb::CodedOutputStream.ComputeUInt32Size(2, Reason); } size += UnknownFields.SerializedSize; @@ -2960,38 +3779,72 @@ public static InvitationRemovedNotification ParseDelimitedFrom(global::System.IO public static InvitationRemovedNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static InvitationRemovedNotification ParseFrom(pb::CodedInputStream input) { + public static InvitationRemovedNotification ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static InvitationRemovedNotification ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static InvitationRemovedNotification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private InvitationRemovedNotification MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(InvitationRemovedNotification prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(InvitationRemovedNotification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - InvitationRemovedNotification result = new InvitationRemovedNotification(); + private bool resultIsReadOnly; + private InvitationRemovedNotification result; + + private InvitationRemovedNotification PrepareBuilder() { + if (resultIsReadOnly) { + InvitationRemovedNotification original = result; + result = new InvitationRemovedNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override InvitationRemovedNotification MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new InvitationRemovedNotification(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -3003,12 +3856,11 @@ public override InvitationRemovedNotification DefaultInstanceForType { } public override InvitationRemovedNotification BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - InvitationRemovedNotification returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -3022,6 +3874,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(InvitationRemovedNotification other) { if (other == global::bnet.protocol.channel_invitation.InvitationRemovedNotification.DefaultInstance) return this; + PrepareBuilder(); if (other.HasInvitation) { MergeInvitation(other.Invitation); } @@ -3032,20 +3885,31 @@ public override Builder MergeFrom(InvitationRemovedNotification other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_invitationRemovedNotificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _invitationRemovedNotificationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -3057,12 +3921,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.invitation.Invitation.Builder subBuilder = global::bnet.protocol.invitation.Invitation.CreateBuilder(); - if (HasInvitation) { + if (result.hasInvitation) { subBuilder.MergeFrom(Invitation); } input.ReadMessage(subBuilder, extensionRegistry); @@ -3070,16 +3934,21 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 16: { - Reason = input.ReadUInt32(); + result.hasReason = input.ReadUInt32(ref result.reason_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasInvitation { - get { return result.HasInvitation; } + get { return result.hasInvitation; } } public global::bnet.protocol.invitation.Invitation Invitation { get { return result.Invitation; } @@ -3087,19 +3956,22 @@ public bool HasInvitation { } public Builder SetInvitation(global::bnet.protocol.invitation.Invitation value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasInvitation = true; result.invitation_ = value; return this; } public Builder SetInvitation(global::bnet.protocol.invitation.Invitation.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasInvitation = true; result.invitation_ = builderForValue.Build(); return this; } public Builder MergeInvitation(global::bnet.protocol.invitation.Invitation value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasInvitation && + PrepareBuilder(); + if (result.hasInvitation && result.invitation_ != global::bnet.protocol.invitation.Invitation.DefaultInstance) { result.invitation_ = global::bnet.protocol.invitation.Invitation.CreateBuilder(result.invitation_).MergeFrom(value).BuildPartial(); } else { @@ -3109,42 +3981,51 @@ public Builder MergeInvitation(global::bnet.protocol.invitation.Invitation value return this; } public Builder ClearInvitation() { + PrepareBuilder(); result.hasInvitation = false; - result.invitation_ = global::bnet.protocol.invitation.Invitation.DefaultInstance; + result.invitation_ = null; return this; } public bool HasReason { - get { return result.HasReason; } + get { return result.hasReason; } } public uint Reason { get { return result.Reason; } set { SetReason(value); } } public Builder SetReason(uint value) { + PrepareBuilder(); result.hasReason = true; result.reason_ = value; return this; } public Builder ClearReason() { + PrepareBuilder(); result.hasReason = false; result.reason_ = 0; return this; } } static InvitationRemovedNotification() { - object.ReferenceEquals(global::bnet.protocol.channel_invitation.ChannelInvitation.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.channel_invitation.Proto.ChannelInvitationService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class SuggestionAddedNotification : pb::GeneratedMessage { - private static readonly SuggestionAddedNotification defaultInstance = new Builder().BuildPartial(); + private SuggestionAddedNotification() { } + private static readonly SuggestionAddedNotification defaultInstance = new SuggestionAddedNotification().MakeReadOnly(); + private static readonly string[] _suggestionAddedNotificationFieldNames = new string[] { "suggestion" }; + private static readonly uint[] _suggestionAddedNotificationFieldTags = new uint[] { 10 }; public static SuggestionAddedNotification DefaultInstance { get { return defaultInstance; } } public override SuggestionAddedNotification DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override SuggestionAddedNotification ThisMessage { @@ -3152,21 +4033,21 @@ protected override SuggestionAddedNotification ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel_invitation.ChannelInvitation.internal__static_bnet_protocol_channel_invitation_SuggestionAddedNotification__Descriptor; } + get { return global::bnet.protocol.channel_invitation.Proto.ChannelInvitationService.internal__static_bnet_protocol_channel_invitation_SuggestionAddedNotification__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel_invitation.ChannelInvitation.internal__static_bnet_protocol_channel_invitation_SuggestionAddedNotification__FieldAccessorTable; } + get { return global::bnet.protocol.channel_invitation.Proto.ChannelInvitationService.internal__static_bnet_protocol_channel_invitation_SuggestionAddedNotification__FieldAccessorTable; } } public const int SuggestionFieldNumber = 1; private bool hasSuggestion; - private global::bnet.protocol.invitation.Suggestion suggestion_ = global::bnet.protocol.invitation.Suggestion.DefaultInstance; + private global::bnet.protocol.invitation.Suggestion suggestion_; public bool HasSuggestion { get { return hasSuggestion; } } public global::bnet.protocol.invitation.Suggestion Suggestion { - get { return suggestion_; } + get { return suggestion_ ?? global::bnet.protocol.invitation.Suggestion.DefaultInstance; } } public override bool IsInitialized { @@ -3177,10 +4058,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasSuggestion) { - output.WriteMessage(1, Suggestion); + string[] field_names = _suggestionAddedNotificationFieldNames; + if (hasSuggestion) { + output.WriteMessage(1, field_names[0], Suggestion); } UnknownFields.WriteTo(output); } @@ -3192,7 +4074,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasSuggestion) { + if (hasSuggestion) { size += pb::CodedOutputStream.ComputeMessageSize(1, Suggestion); } size += UnknownFields.SerializedSize; @@ -3225,38 +4107,72 @@ public static SuggestionAddedNotification ParseDelimitedFrom(global::System.IO.S public static SuggestionAddedNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static SuggestionAddedNotification ParseFrom(pb::CodedInputStream input) { + public static SuggestionAddedNotification ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SuggestionAddedNotification ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static SuggestionAddedNotification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private SuggestionAddedNotification MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(SuggestionAddedNotification prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SuggestionAddedNotification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SuggestionAddedNotification result; + + private SuggestionAddedNotification PrepareBuilder() { + if (resultIsReadOnly) { + SuggestionAddedNotification original = result; + result = new SuggestionAddedNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - SuggestionAddedNotification result = new SuggestionAddedNotification(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override SuggestionAddedNotification MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SuggestionAddedNotification(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -3268,12 +4184,11 @@ public override SuggestionAddedNotification DefaultInstanceForType { } public override SuggestionAddedNotification BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - SuggestionAddedNotification returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -3287,6 +4202,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SuggestionAddedNotification other) { if (other == global::bnet.protocol.channel_invitation.SuggestionAddedNotification.DefaultInstance) return this; + PrepareBuilder(); if (other.HasSuggestion) { MergeSuggestion(other.Suggestion); } @@ -3294,20 +4210,31 @@ public override Builder MergeFrom(SuggestionAddedNotification other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_suggestionAddedNotificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _suggestionAddedNotificationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -3319,12 +4246,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.invitation.Suggestion.Builder subBuilder = global::bnet.protocol.invitation.Suggestion.CreateBuilder(); - if (HasSuggestion) { + if (result.hasSuggestion) { subBuilder.MergeFrom(Suggestion); } input.ReadMessage(subBuilder, extensionRegistry); @@ -3333,11 +4260,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasSuggestion { - get { return result.HasSuggestion; } + get { return result.hasSuggestion; } } public global::bnet.protocol.invitation.Suggestion Suggestion { get { return result.Suggestion; } @@ -3345,19 +4277,22 @@ public bool HasSuggestion { } public Builder SetSuggestion(global::bnet.protocol.invitation.Suggestion value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasSuggestion = true; result.suggestion_ = value; return this; } public Builder SetSuggestion(global::bnet.protocol.invitation.Suggestion.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasSuggestion = true; result.suggestion_ = builderForValue.Build(); return this; } public Builder MergeSuggestion(global::bnet.protocol.invitation.Suggestion value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasSuggestion && + PrepareBuilder(); + if (result.hasSuggestion && result.suggestion_ != global::bnet.protocol.invitation.Suggestion.DefaultInstance) { result.suggestion_ = global::bnet.protocol.invitation.Suggestion.CreateBuilder(result.suggestion_).MergeFrom(value).BuildPartial(); } else { @@ -3367,19 +4302,23 @@ public Builder MergeSuggestion(global::bnet.protocol.invitation.Suggestion value return this; } public Builder ClearSuggestion() { + PrepareBuilder(); result.hasSuggestion = false; - result.suggestion_ = global::bnet.protocol.invitation.Suggestion.DefaultInstance; + result.suggestion_ = null; return this; } } static SuggestionAddedNotification() { - object.ReferenceEquals(global::bnet.protocol.channel_invitation.ChannelInvitation.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.channel_invitation.Proto.ChannelInvitationService.Descriptor, null); } } #endregion #region Services + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public abstract class ChannelInvitationService : pb::IService { public abstract void Subscribe( pb::IRpcController controller, @@ -3411,7 +4350,7 @@ public abstract void SuggestInvitation( global::System.Action done); public static pbd::ServiceDescriptor Descriptor { - get { return ChannelInvitation.Descriptor.Services[0]; } + get { return Proto.ChannelInvitationService.Descriptor.Services[0]; } } public pbd::ServiceDescriptor DescriptorForType { get { return Descriptor; } @@ -3521,6 +4460,9 @@ public static Stub CreateStub(pb::IRpcChannel channel) { return new Stub(channel); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public class Stub : global::bnet.protocol.channel_invitation.ChannelInvitationService { internal Stub(pb::IRpcChannel channel) { this.channel = channel; @@ -3596,6 +4538,9 @@ public override void SuggestInvitation( } } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public abstract class ChannelInvitationNotify : pb::IService { public abstract void NotifyReceivedInvitationAdded( pb::IRpcController controller, @@ -3615,7 +4560,7 @@ public abstract void HasRoomForInvitation( global::System.Action done); public static pbd::ServiceDescriptor Descriptor { - get { return ChannelInvitation.Descriptor.Services[1]; } + get { return Proto.ChannelInvitationService.Descriptor.Services[1]; } } public pbd::ServiceDescriptor DescriptorForType { get { return Descriptor; } @@ -3698,6 +4643,9 @@ public static Stub CreateStub(pb::IRpcChannel channel) { return new Stub(channel); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public class Stub : global::bnet.protocol.channel_invitation.ChannelInvitationNotify { internal Stub(pb::IRpcChannel channel) { this.channel = channel; @@ -3749,3 +4697,5 @@ public override void HasRoomForInvitation( #endregion } + +#endregion Designer generated code diff --git a/source/D3Proto/bnet/protocol/channel_invitation/ChannelInvitationTypes.cs b/src/LibMooNet/bnet/protocol/channel_invitation/ChannelInvitationTypes.cs similarity index 56% rename from source/D3Proto/bnet/protocol/channel_invitation/ChannelInvitationTypes.cs rename to src/LibMooNet/bnet/protocol/channel_invitation/ChannelInvitationTypes.cs index 66c6dcfd..8fa6f0ee 100644 --- a/source/D3Proto/bnet/protocol/channel_invitation/ChannelInvitationTypes.cs +++ b/src/LibMooNet/bnet/protocol/channel_invitation/ChannelInvitationTypes.cs @@ -1,4 +1,6 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code using pb = global::Google.ProtocolBuffers; using pbc = global::Google.ProtocolBuffers.Collections; @@ -6,19 +8,22 @@ using scg = global::System.Collections.Generic; namespace bnet.protocol.channel_invitation { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public static partial class ChannelInvitationTypes { #region Extension registration public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - registry.Add(global::bnet.protocol.channel_invitation.Invitation.ChannelInvitation); - registry.Add(global::bnet.protocol.channel_invitation.SendInvitationRequest.ChannelInvitation); + registry.Add(global::bnet.protocol.channel_invitation.ChannelInvitation.ChannelInvitationProp); + registry.Add(global::bnet.protocol.channel_invitation.ChannelInvitationParams.ChannelParams); } #endregion #region Static variables - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_invitation_Invitation__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_invitation_Invitation__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_invitation_SendInvitationRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_invitation_SendInvitationRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_invitation_ChannelInvitation__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_invitation_ChannelInvitation__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_invitation_ChannelInvitationParams__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_invitation_ChannelInvitationParams__FieldAccessorTable; internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_invitation_InvitationCollection__Descriptor; internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_channel_invitation_InvitationCollection__FieldAccessorTable; #endregion @@ -30,38 +35,37 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { static ChannelInvitationTypes() { byte[] descriptorData = global::System.Convert.FromBase64String( - "CjlzZXJ2aWNlL2NoYW5uZWxfaW52aXRhdGlvbi9jaGFubmVsX2ludml0YXRp" + - "b25fdHlwZXMucHJvdG8SIGJuZXQucHJvdG9jb2wuY2hhbm5lbF9pbnZpdGF0" + - "aW9uGh1saWIvcHJvdG9jb2wvaW52aXRhdGlvbi5wcm90bxoZbGliL3Byb3Rv" + - "Y29sL2VudGl0eS5wcm90bxojc2VydmljZS9jaGFubmVsL2NoYW5uZWxfdHlw" + - "ZXMucHJvdG8iigIKCkludml0YXRpb24SRgoTY2hhbm5lbF9kZXNjcmlwdGlv" + - "bhgBIAIoCzIpLmJuZXQucHJvdG9jb2wuY2hhbm5lbC5DaGFubmVsRGVzY3Jp" + - "cHRpb24SFwoIcmVzZXJ2ZWQYAiABKAg6BWZhbHNlEhUKBnJlam9pbhgDIAEo" + - "CDoFZmFsc2USFAoMc2VydmljZV90eXBlGAQgASgNMm4KEmNoYW5uZWxfaW52" + - "aXRhdGlvbhIkLmJuZXQucHJvdG9jb2wuaW52aXRhdGlvbi5JbnZpdGF0aW9u" + - "GGkgASgLMiwuYm5ldC5wcm90b2NvbC5jaGFubmVsX2ludml0YXRpb24uSW52" + - "aXRhdGlvbiKDAgoVU2VuZEludml0YXRpb25SZXF1ZXN0EisKCmNoYW5uZWxf" + - "aWQYASABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEhAKCHJlc2VydmVk" + - "GAIgASgIEg4KBnJlam9pbhgDIAEoCBIUCgxzZXJ2aWNlX3R5cGUYBCABKA0y" + - "hAEKEmNoYW5uZWxfaW52aXRhdGlvbhIvLmJuZXQucHJvdG9jb2wuaW52aXRh" + - "dGlvbi5TZW5kSW52aXRhdGlvblJlcXVlc3QYaSABKAsyNy5ibmV0LnByb3Rv" + - "Y29sLmNoYW5uZWxfaW52aXRhdGlvbi5TZW5kSW52aXRhdGlvblJlcXVlc3Qi" + - "pAEKFEludml0YXRpb25Db2xsZWN0aW9uEhQKDHNlcnZpY2VfdHlwZRgBIAEo" + - "DRIgChhtYXhfcmVjZWl2ZWRfaW52aXRhdGlvbnMYAiABKA0SEQoJb2JqZWN0" + - "X2lkGAMgASgEEkEKE3JlY2VpdmVkX2ludml0YXRpb24YBCADKAsyJC5ibmV0" + - "LnByb3RvY29sLmludml0YXRpb24uSW52aXRhdGlvbg=="); + "CiNibmV0L2NoYW5uZWxfaW52aXRhdGlvbl90eXBlcy5wcm90bxIgYm5ldC5w" + + "cm90b2NvbC5jaGFubmVsX2ludml0YXRpb24aG2JuZXQvaW52aXRhdGlvbl90" + + "eXBlcy5wcm90bxoRYm5ldC9lbnRpdHkucHJvdG8aGGJuZXQvY2hhbm5lbF90" + + "eXBlcy5wcm90byKYAgoRQ2hhbm5lbEludml0YXRpb24SRgoTY2hhbm5lbF9k" + + "ZXNjcmlwdGlvbhgBIAIoCzIpLmJuZXQucHJvdG9jb2wuY2hhbm5lbC5DaGFu" + + "bmVsRGVzY3JpcHRpb24SFwoIcmVzZXJ2ZWQYAiABKAg6BWZhbHNlEhUKBnJl" + + "am9pbhgDIAEoCDoFZmFsc2USFAoMc2VydmljZV90eXBlGAQgAigNMnUKEmNo" + + "YW5uZWxfaW52aXRhdGlvbhIkLmJuZXQucHJvdG9jb2wuaW52aXRhdGlvbi5J" + + "bnZpdGF0aW9uGGkgASgLMjMuYm5ldC5wcm90b2NvbC5jaGFubmVsX2ludml0" + + "YXRpb24uQ2hhbm5lbEludml0YXRpb24i/QEKF0NoYW5uZWxJbnZpdGF0aW9u" + + "UGFyYW1zEisKCmNoYW5uZWxfaWQYASACKAsyFy5ibmV0LnByb3RvY29sLkVu" + + "dGl0eUlkEhAKCHJlc2VydmVkGAIgASgIEg4KBnJlam9pbhgDIAEoCBIUCgxz" + + "ZXJ2aWNlX3R5cGUYBCACKA0yfQoOY2hhbm5lbF9wYXJhbXMSKi5ibmV0LnBy" + + "b3RvY29sLmludml0YXRpb24uSW52aXRhdGlvblBhcmFtcxhpIAEoCzI5LmJu" + + "ZXQucHJvdG9jb2wuY2hhbm5lbF9pbnZpdGF0aW9uLkNoYW5uZWxJbnZpdGF0" + + "aW9uUGFyYW1zIqQBChRJbnZpdGF0aW9uQ29sbGVjdGlvbhIUCgxzZXJ2aWNl" + + "X3R5cGUYASABKA0SIAoYbWF4X3JlY2VpdmVkX2ludml0YXRpb25zGAIgASgN" + + "EhEKCW9iamVjdF9pZBgDIAEoBBJBChNyZWNlaXZlZF9pbnZpdGF0aW9uGAQg" + + "AygLMiQuYm5ldC5wcm90b2NvbC5pbnZpdGF0aW9uLkludml0YXRpb24="); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; - internal__static_bnet_protocol_channel_invitation_Invitation__Descriptor = Descriptor.MessageTypes[0]; - internal__static_bnet_protocol_channel_invitation_Invitation__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_invitation_Invitation__Descriptor, + internal__static_bnet_protocol_channel_invitation_ChannelInvitation__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_channel_invitation_ChannelInvitation__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_invitation_ChannelInvitation__Descriptor, new string[] { "ChannelDescription", "Reserved", "Rejoin", "ServiceType", }); - global::bnet.protocol.channel_invitation.Invitation.ChannelInvitation = pb::GeneratedSingleExtension.CreateInstance(global::bnet.protocol.channel_invitation.Invitation.Descriptor.Extensions[0]); - internal__static_bnet_protocol_channel_invitation_SendInvitationRequest__Descriptor = Descriptor.MessageTypes[1]; - internal__static_bnet_protocol_channel_invitation_SendInvitationRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_invitation_SendInvitationRequest__Descriptor, + global::bnet.protocol.channel_invitation.ChannelInvitation.ChannelInvitationProp = pb::GeneratedSingleExtension.CreateInstance(global::bnet.protocol.channel_invitation.ChannelInvitation.Descriptor.Extensions[0]); + internal__static_bnet_protocol_channel_invitation_ChannelInvitationParams__Descriptor = Descriptor.MessageTypes[1]; + internal__static_bnet_protocol_channel_invitation_ChannelInvitationParams__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_invitation_ChannelInvitationParams__Descriptor, new string[] { "ChannelId", "Reserved", "Rejoin", "ServiceType", }); - global::bnet.protocol.channel_invitation.SendInvitationRequest.ChannelInvitation = pb::GeneratedSingleExtension.CreateInstance(global::bnet.protocol.channel_invitation.SendInvitationRequest.Descriptor.Extensions[0]); + global::bnet.protocol.channel_invitation.ChannelInvitationParams.ChannelParams = pb::GeneratedSingleExtension.CreateInstance(global::bnet.protocol.channel_invitation.ChannelInvitationParams.Descriptor.Extensions[0]); internal__static_bnet_protocol_channel_invitation_InvitationCollection__Descriptor = Descriptor.MessageTypes[2]; internal__static_bnet_protocol_channel_invitation_InvitationCollection__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_invitation_InvitationCollection__Descriptor, @@ -70,7 +74,7 @@ static ChannelInvitationTypes() { }; pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbd::FileDescriptor[] { - global::bnet.protocol.invitation.Proto.Invitation.Descriptor, + global::bnet.protocol.invitation.InvitationTypes.Descriptor, global::bnet.protocol.Entity.Descriptor, global::bnet.protocol.channel.ChannelTypes.Descriptor, }, assigner); @@ -79,43 +83,49 @@ static ChannelInvitationTypes() { } #region Messages - public sealed partial class Invitation : pb::GeneratedMessage { - private static readonly Invitation defaultInstance = new Builder().BuildPartial(); - public static Invitation DefaultInstance { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ChannelInvitation : pb::GeneratedMessage { + private ChannelInvitation() { } + private static readonly ChannelInvitation defaultInstance = new ChannelInvitation().MakeReadOnly(); + private static readonly string[] _channelInvitationFieldNames = new string[] { "channel_description", "rejoin", "reserved", "service_type" }; + private static readonly uint[] _channelInvitationFieldTags = new uint[] { 10, 24, 16, 32 }; + public static ChannelInvitation DefaultInstance { get { return defaultInstance; } } - public override Invitation DefaultInstanceForType { - get { return defaultInstance; } + public override ChannelInvitation DefaultInstanceForType { + get { return DefaultInstance; } } - protected override Invitation ThisMessage { + protected override ChannelInvitation ThisMessage { get { return this; } } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel_invitation.ChannelInvitationTypes.internal__static_bnet_protocol_channel_invitation_Invitation__Descriptor; } + get { return global::bnet.protocol.channel_invitation.ChannelInvitationTypes.internal__static_bnet_protocol_channel_invitation_ChannelInvitation__Descriptor; } } - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel_invitation.ChannelInvitationTypes.internal__static_bnet_protocol_channel_invitation_Invitation__FieldAccessorTable; } + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.channel_invitation.ChannelInvitationTypes.internal__static_bnet_protocol_channel_invitation_ChannelInvitation__FieldAccessorTable; } } public const int ChannelInvitationFieldNumber = 105; - public static pb::GeneratedExtensionBase ChannelInvitation; + public static pb::GeneratedExtensionBase ChannelInvitationProp; public const int ChannelDescriptionFieldNumber = 1; private bool hasChannelDescription; - private global::bnet.protocol.channel.ChannelDescription channelDescription_ = global::bnet.protocol.channel.ChannelDescription.DefaultInstance; + private global::bnet.protocol.channel.ChannelDescription channelDescription_; public bool HasChannelDescription { get { return hasChannelDescription; } } public global::bnet.protocol.channel.ChannelDescription ChannelDescription { - get { return channelDescription_; } + get { return channelDescription_ ?? global::bnet.protocol.channel.ChannelDescription.DefaultInstance; } } public const int ReservedFieldNumber = 2; private bool hasReserved; - private bool reserved_ = false; + private bool reserved_; public bool HasReserved { get { return hasReserved; } } @@ -125,7 +135,7 @@ public bool Reserved { public const int RejoinFieldNumber = 3; private bool hasRejoin; - private bool rejoin_ = false; + private bool rejoin_; public bool HasRejoin { get { return hasRejoin; } } @@ -135,7 +145,7 @@ public bool Rejoin { public const int ServiceTypeFieldNumber = 4; private bool hasServiceType; - private uint serviceType_ = 0; + private uint serviceType_; public bool HasServiceType { get { return hasServiceType; } } @@ -146,24 +156,26 @@ public uint ServiceType { public override bool IsInitialized { get { if (!hasChannelDescription) return false; + if (!hasServiceType) return false; if (!ChannelDescription.IsInitialized) return false; return true; } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasChannelDescription) { - output.WriteMessage(1, ChannelDescription); + string[] field_names = _channelInvitationFieldNames; + if (hasChannelDescription) { + output.WriteMessage(1, field_names[0], ChannelDescription); } - if (HasReserved) { - output.WriteBool(2, Reserved); + if (hasReserved) { + output.WriteBool(2, field_names[2], Reserved); } - if (HasRejoin) { - output.WriteBool(3, Rejoin); + if (hasRejoin) { + output.WriteBool(3, field_names[1], Rejoin); } - if (HasServiceType) { - output.WriteUInt32(4, ServiceType); + if (hasServiceType) { + output.WriteUInt32(4, field_names[3], ServiceType); } UnknownFields.WriteTo(output); } @@ -175,16 +187,16 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasChannelDescription) { + if (hasChannelDescription) { size += pb::CodedOutputStream.ComputeMessageSize(1, ChannelDescription); } - if (HasReserved) { + if (hasReserved) { size += pb::CodedOutputStream.ComputeBoolSize(2, Reserved); } - if (HasRejoin) { + if (hasRejoin) { size += pb::CodedOutputStream.ComputeBoolSize(3, Rejoin); } - if (HasServiceType) { + if (hasServiceType) { size += pb::CodedOutputStream.ComputeUInt32Size(4, ServiceType); } size += UnknownFields.SerializedSize; @@ -193,92 +205,126 @@ public override int SerializedSize { } } - public static Invitation ParseFrom(pb::ByteString data) { + public static ChannelInvitation ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static Invitation ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static ChannelInvitation ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static Invitation ParseFrom(byte[] data) { + public static ChannelInvitation ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static Invitation ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static ChannelInvitation ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static Invitation ParseFrom(global::System.IO.Stream input) { + public static ChannelInvitation ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Invitation ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static ChannelInvitation ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } - public static Invitation ParseDelimitedFrom(global::System.IO.Stream input) { + public static ChannelInvitation ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static Invitation ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static ChannelInvitation ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static Invitation ParseFrom(pb::CodedInputStream input) { + public static ChannelInvitation ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Invitation ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static ChannelInvitation ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private ChannelInvitation MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Invitation prototype) { - return (Builder) new Builder().MergeFrom(prototype); + public static Builder CreateBuilder(ChannelInvitation prototype) { + return new Builder(prototype); } - public sealed partial class Builder : pb::GeneratedBuilder { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ChannelInvitation cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - Invitation result = new Invitation(); + private bool resultIsReadOnly; + private ChannelInvitation result; - protected override Invitation MessageBeingBuilt { - get { return result; } + private ChannelInvitation PrepareBuilder() { + if (resultIsReadOnly) { + ChannelInvitation original = result; + result = new ChannelInvitation(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ChannelInvitation MessageBeingBuilt { + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new Invitation(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.channel_invitation.Invitation.Descriptor; } + get { return global::bnet.protocol.channel_invitation.ChannelInvitation.Descriptor; } } - public override Invitation DefaultInstanceForType { - get { return global::bnet.protocol.channel_invitation.Invitation.DefaultInstance; } + public override ChannelInvitation DefaultInstanceForType { + get { return global::bnet.protocol.channel_invitation.ChannelInvitation.DefaultInstance; } } - public override Invitation BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override ChannelInvitation BuildPartial() { + if (resultIsReadOnly) { + return result; } - Invitation returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is Invitation) { - return MergeFrom((Invitation) other); + if (other is ChannelInvitation) { + return MergeFrom((ChannelInvitation) other); } else { base.MergeFrom(other); return this; } } - public override Builder MergeFrom(Invitation other) { - if (other == global::bnet.protocol.channel_invitation.Invitation.DefaultInstance) return this; + public override Builder MergeFrom(ChannelInvitation other) { + if (other == global::bnet.protocol.channel_invitation.ChannelInvitation.DefaultInstance) return this; + PrepareBuilder(); if (other.HasChannelDescription) { MergeChannelDescription(other.ChannelDescription); } @@ -295,20 +341,31 @@ public override Builder MergeFrom(Invitation other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_channelInvitationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _channelInvitationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -320,12 +377,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.channel.ChannelDescription.Builder subBuilder = global::bnet.protocol.channel.ChannelDescription.CreateBuilder(); - if (HasChannelDescription) { + if (result.hasChannelDescription) { subBuilder.MergeFrom(ChannelDescription); } input.ReadMessage(subBuilder, extensionRegistry); @@ -333,24 +390,29 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 16: { - Reserved = input.ReadBool(); + result.hasReserved = input.ReadBool(ref result.reserved_); break; } case 24: { - Rejoin = input.ReadBool(); + result.hasRejoin = input.ReadBool(ref result.rejoin_); break; } case 32: { - ServiceType = input.ReadUInt32(); + result.hasServiceType = input.ReadUInt32(ref result.serviceType_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasChannelDescription { - get { return result.HasChannelDescription; } + get { return result.hasChannelDescription; } } public global::bnet.protocol.channel.ChannelDescription ChannelDescription { get { return result.ChannelDescription; } @@ -358,19 +420,22 @@ public bool HasChannelDescription { } public Builder SetChannelDescription(global::bnet.protocol.channel.ChannelDescription value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasChannelDescription = true; result.channelDescription_ = value; return this; } public Builder SetChannelDescription(global::bnet.protocol.channel.ChannelDescription.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasChannelDescription = true; result.channelDescription_ = builderForValue.Build(); return this; } public Builder MergeChannelDescription(global::bnet.protocol.channel.ChannelDescription value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasChannelDescription && + PrepareBuilder(); + if (result.hasChannelDescription && result.channelDescription_ != global::bnet.protocol.channel.ChannelDescription.DefaultInstance) { result.channelDescription_ = global::bnet.protocol.channel.ChannelDescription.CreateBuilder(result.channelDescription_).MergeFrom(value).BuildPartial(); } else { @@ -380,107 +445,120 @@ public Builder MergeChannelDescription(global::bnet.protocol.channel.ChannelDesc return this; } public Builder ClearChannelDescription() { + PrepareBuilder(); result.hasChannelDescription = false; - result.channelDescription_ = global::bnet.protocol.channel.ChannelDescription.DefaultInstance; + result.channelDescription_ = null; return this; } public bool HasReserved { - get { return result.HasReserved; } + get { return result.hasReserved; } } public bool Reserved { get { return result.Reserved; } set { SetReserved(value); } } public Builder SetReserved(bool value) { + PrepareBuilder(); result.hasReserved = true; result.reserved_ = value; return this; } public Builder ClearReserved() { + PrepareBuilder(); result.hasReserved = false; result.reserved_ = false; return this; } public bool HasRejoin { - get { return result.HasRejoin; } + get { return result.hasRejoin; } } public bool Rejoin { get { return result.Rejoin; } set { SetRejoin(value); } } public Builder SetRejoin(bool value) { + PrepareBuilder(); result.hasRejoin = true; result.rejoin_ = value; return this; } public Builder ClearRejoin() { + PrepareBuilder(); result.hasRejoin = false; result.rejoin_ = false; return this; } public bool HasServiceType { - get { return result.HasServiceType; } + get { return result.hasServiceType; } } public uint ServiceType { get { return result.ServiceType; } set { SetServiceType(value); } } public Builder SetServiceType(uint value) { + PrepareBuilder(); result.hasServiceType = true; result.serviceType_ = value; return this; } public Builder ClearServiceType() { + PrepareBuilder(); result.hasServiceType = false; result.serviceType_ = 0; return this; } } - static Invitation() { + static ChannelInvitation() { object.ReferenceEquals(global::bnet.protocol.channel_invitation.ChannelInvitationTypes.Descriptor, null); } } - public sealed partial class SendInvitationRequest : pb::GeneratedMessage { - private static readonly SendInvitationRequest defaultInstance = new Builder().BuildPartial(); - public static SendInvitationRequest DefaultInstance { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ChannelInvitationParams : pb::GeneratedMessage { + private ChannelInvitationParams() { } + private static readonly ChannelInvitationParams defaultInstance = new ChannelInvitationParams().MakeReadOnly(); + private static readonly string[] _channelInvitationParamsFieldNames = new string[] { "channel_id", "rejoin", "reserved", "service_type" }; + private static readonly uint[] _channelInvitationParamsFieldTags = new uint[] { 10, 24, 16, 32 }; + public static ChannelInvitationParams DefaultInstance { get { return defaultInstance; } } - public override SendInvitationRequest DefaultInstanceForType { - get { return defaultInstance; } + public override ChannelInvitationParams DefaultInstanceForType { + get { return DefaultInstance; } } - protected override SendInvitationRequest ThisMessage { + protected override ChannelInvitationParams ThisMessage { get { return this; } } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.channel_invitation.ChannelInvitationTypes.internal__static_bnet_protocol_channel_invitation_SendInvitationRequest__Descriptor; } + get { return global::bnet.protocol.channel_invitation.ChannelInvitationTypes.internal__static_bnet_protocol_channel_invitation_ChannelInvitationParams__Descriptor; } } - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.channel_invitation.ChannelInvitationTypes.internal__static_bnet_protocol_channel_invitation_SendInvitationRequest__FieldAccessorTable; } + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.channel_invitation.ChannelInvitationTypes.internal__static_bnet_protocol_channel_invitation_ChannelInvitationParams__FieldAccessorTable; } } - public const int ChannelInvitationFieldNumber = 105; - public static pb::GeneratedExtensionBase ChannelInvitation; + public const int ChannelParamsFieldNumber = 105; + public static pb::GeneratedExtensionBase ChannelParams; public const int ChannelIdFieldNumber = 1; private bool hasChannelId; - private global::bnet.protocol.EntityId channelId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId channelId_; public bool HasChannelId { get { return hasChannelId; } } public global::bnet.protocol.EntityId ChannelId { - get { return channelId_; } + get { return channelId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int ReservedFieldNumber = 2; private bool hasReserved; - private bool reserved_ = false; + private bool reserved_; public bool HasReserved { get { return hasReserved; } } @@ -490,7 +568,7 @@ public bool Reserved { public const int RejoinFieldNumber = 3; private bool hasRejoin; - private bool rejoin_ = false; + private bool rejoin_; public bool HasRejoin { get { return hasRejoin; } } @@ -500,7 +578,7 @@ public bool Rejoin { public const int ServiceTypeFieldNumber = 4; private bool hasServiceType; - private uint serviceType_ = 0; + private uint serviceType_; public bool HasServiceType { get { return hasServiceType; } } @@ -510,26 +588,27 @@ public uint ServiceType { public override bool IsInitialized { get { - if (HasChannelId) { - if (!ChannelId.IsInitialized) return false; - } + if (!hasChannelId) return false; + if (!hasServiceType) return false; + if (!ChannelId.IsInitialized) return false; return true; } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasChannelId) { - output.WriteMessage(1, ChannelId); + string[] field_names = _channelInvitationParamsFieldNames; + if (hasChannelId) { + output.WriteMessage(1, field_names[0], ChannelId); } - if (HasReserved) { - output.WriteBool(2, Reserved); + if (hasReserved) { + output.WriteBool(2, field_names[2], Reserved); } - if (HasRejoin) { - output.WriteBool(3, Rejoin); + if (hasRejoin) { + output.WriteBool(3, field_names[1], Rejoin); } - if (HasServiceType) { - output.WriteUInt32(4, ServiceType); + if (hasServiceType) { + output.WriteUInt32(4, field_names[3], ServiceType); } UnknownFields.WriteTo(output); } @@ -541,16 +620,16 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasChannelId) { + if (hasChannelId) { size += pb::CodedOutputStream.ComputeMessageSize(1, ChannelId); } - if (HasReserved) { + if (hasReserved) { size += pb::CodedOutputStream.ComputeBoolSize(2, Reserved); } - if (HasRejoin) { + if (hasRejoin) { size += pb::CodedOutputStream.ComputeBoolSize(3, Rejoin); } - if (HasServiceType) { + if (hasServiceType) { size += pb::CodedOutputStream.ComputeUInt32Size(4, ServiceType); } size += UnknownFields.SerializedSize; @@ -559,92 +638,126 @@ public override int SerializedSize { } } - public static SendInvitationRequest ParseFrom(pb::ByteString data) { + public static ChannelInvitationParams ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static SendInvitationRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static ChannelInvitationParams ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static SendInvitationRequest ParseFrom(byte[] data) { + public static ChannelInvitationParams ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static SendInvitationRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static ChannelInvitationParams ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static SendInvitationRequest ParseFrom(global::System.IO.Stream input) { + public static ChannelInvitationParams ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SendInvitationRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static ChannelInvitationParams ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } - public static SendInvitationRequest ParseDelimitedFrom(global::System.IO.Stream input) { + public static ChannelInvitationParams ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static SendInvitationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static ChannelInvitationParams ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static SendInvitationRequest ParseFrom(pb::CodedInputStream input) { + public static ChannelInvitationParams ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SendInvitationRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static ChannelInvitationParams ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private ChannelInvitationParams MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SendInvitationRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + public static Builder CreateBuilder(ChannelInvitationParams prototype) { + return new Builder(prototype); } - public sealed partial class Builder : pb::GeneratedBuilder { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ChannelInvitationParams cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ChannelInvitationParams result; + + private ChannelInvitationParams PrepareBuilder() { + if (resultIsReadOnly) { + ChannelInvitationParams original = result; + result = new ChannelInvitationParams(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - SendInvitationRequest result = new SendInvitationRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } - protected override SendInvitationRequest MessageBeingBuilt { - get { return result; } + protected override ChannelInvitationParams MessageBeingBuilt { + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SendInvitationRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.channel_invitation.SendInvitationRequest.Descriptor; } + get { return global::bnet.protocol.channel_invitation.ChannelInvitationParams.Descriptor; } } - public override SendInvitationRequest DefaultInstanceForType { - get { return global::bnet.protocol.channel_invitation.SendInvitationRequest.DefaultInstance; } + public override ChannelInvitationParams DefaultInstanceForType { + get { return global::bnet.protocol.channel_invitation.ChannelInvitationParams.DefaultInstance; } } - public override SendInvitationRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override ChannelInvitationParams BuildPartial() { + if (resultIsReadOnly) { + return result; } - SendInvitationRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is SendInvitationRequest) { - return MergeFrom((SendInvitationRequest) other); + if (other is ChannelInvitationParams) { + return MergeFrom((ChannelInvitationParams) other); } else { base.MergeFrom(other); return this; } } - public override Builder MergeFrom(SendInvitationRequest other) { - if (other == global::bnet.protocol.channel_invitation.SendInvitationRequest.DefaultInstance) return this; + public override Builder MergeFrom(ChannelInvitationParams other) { + if (other == global::bnet.protocol.channel_invitation.ChannelInvitationParams.DefaultInstance) return this; + PrepareBuilder(); if (other.HasChannelId) { MergeChannelId(other.ChannelId); } @@ -661,20 +774,31 @@ public override Builder MergeFrom(SendInvitationRequest other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_channelInvitationParamsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _channelInvitationParamsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -686,12 +810,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasChannelId) { + if (result.hasChannelId) { subBuilder.MergeFrom(ChannelId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -699,24 +823,29 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 16: { - Reserved = input.ReadBool(); + result.hasReserved = input.ReadBool(ref result.reserved_); break; } case 24: { - Rejoin = input.ReadBool(); + result.hasRejoin = input.ReadBool(ref result.rejoin_); break; } case 32: { - ServiceType = input.ReadUInt32(); + result.hasServiceType = input.ReadUInt32(ref result.serviceType_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasChannelId { - get { return result.HasChannelId; } + get { return result.hasChannelId; } } public global::bnet.protocol.EntityId ChannelId { get { return result.ChannelId; } @@ -724,19 +853,22 @@ public bool HasChannelId { } public Builder SetChannelId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasChannelId = true; result.channelId_ = value; return this; } public Builder SetChannelId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasChannelId = true; result.channelId_ = builderForValue.Build(); return this; } public Builder MergeChannelId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasChannelId && + PrepareBuilder(); + if (result.hasChannelId && result.channelId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.channelId_ = global::bnet.protocol.EntityId.CreateBuilder(result.channelId_).MergeFrom(value).BuildPartial(); } else { @@ -746,78 +878,91 @@ public Builder MergeChannelId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearChannelId() { + PrepareBuilder(); result.hasChannelId = false; - result.channelId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.channelId_ = null; return this; } public bool HasReserved { - get { return result.HasReserved; } + get { return result.hasReserved; } } public bool Reserved { get { return result.Reserved; } set { SetReserved(value); } } public Builder SetReserved(bool value) { + PrepareBuilder(); result.hasReserved = true; result.reserved_ = value; return this; } public Builder ClearReserved() { + PrepareBuilder(); result.hasReserved = false; result.reserved_ = false; return this; } public bool HasRejoin { - get { return result.HasRejoin; } + get { return result.hasRejoin; } } public bool Rejoin { get { return result.Rejoin; } set { SetRejoin(value); } } public Builder SetRejoin(bool value) { + PrepareBuilder(); result.hasRejoin = true; result.rejoin_ = value; return this; } public Builder ClearRejoin() { + PrepareBuilder(); result.hasRejoin = false; result.rejoin_ = false; return this; } public bool HasServiceType { - get { return result.HasServiceType; } + get { return result.hasServiceType; } } public uint ServiceType { get { return result.ServiceType; } set { SetServiceType(value); } } public Builder SetServiceType(uint value) { + PrepareBuilder(); result.hasServiceType = true; result.serviceType_ = value; return this; } public Builder ClearServiceType() { + PrepareBuilder(); result.hasServiceType = false; result.serviceType_ = 0; return this; } } - static SendInvitationRequest() { + static ChannelInvitationParams() { object.ReferenceEquals(global::bnet.protocol.channel_invitation.ChannelInvitationTypes.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class InvitationCollection : pb::GeneratedMessage { - private static readonly InvitationCollection defaultInstance = new Builder().BuildPartial(); + private InvitationCollection() { } + private static readonly InvitationCollection defaultInstance = new InvitationCollection().MakeReadOnly(); + private static readonly string[] _invitationCollectionFieldNames = new string[] { "max_received_invitations", "object_id", "received_invitation", "service_type" }; + private static readonly uint[] _invitationCollectionFieldTags = new uint[] { 16, 24, 34, 8 }; public static InvitationCollection DefaultInstance { get { return defaultInstance; } } public override InvitationCollection DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override InvitationCollection ThisMessage { @@ -834,7 +979,7 @@ protected override InvitationCollection ThisMessage { public const int ServiceTypeFieldNumber = 1; private bool hasServiceType; - private uint serviceType_ = 0; + private uint serviceType_; public bool HasServiceType { get { return hasServiceType; } } @@ -844,7 +989,7 @@ public uint ServiceType { public const int MaxReceivedInvitationsFieldNumber = 2; private bool hasMaxReceivedInvitations; - private uint maxReceivedInvitations_ = 0; + private uint maxReceivedInvitations_; public bool HasMaxReceivedInvitations { get { return hasMaxReceivedInvitations; } } @@ -854,7 +999,7 @@ public uint MaxReceivedInvitations { public const int ObjectIdFieldNumber = 3; private bool hasObjectId; - private ulong objectId_ = 0UL; + private ulong objectId_; public bool HasObjectId { get { return hasObjectId; } } @@ -883,19 +1028,20 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasServiceType) { - output.WriteUInt32(1, ServiceType); + string[] field_names = _invitationCollectionFieldNames; + if (hasServiceType) { + output.WriteUInt32(1, field_names[3], ServiceType); } - if (HasMaxReceivedInvitations) { - output.WriteUInt32(2, MaxReceivedInvitations); + if (hasMaxReceivedInvitations) { + output.WriteUInt32(2, field_names[0], MaxReceivedInvitations); } - if (HasObjectId) { - output.WriteUInt64(3, ObjectId); + if (hasObjectId) { + output.WriteUInt64(3, field_names[1], ObjectId); } - foreach (global::bnet.protocol.invitation.Invitation element in ReceivedInvitationList) { - output.WriteMessage(4, element); + if (receivedInvitation_.Count > 0) { + output.WriteMessageArray(4, field_names[2], receivedInvitation_); } UnknownFields.WriteTo(output); } @@ -907,13 +1053,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasServiceType) { + if (hasServiceType) { size += pb::CodedOutputStream.ComputeUInt32Size(1, ServiceType); } - if (HasMaxReceivedInvitations) { + if (hasMaxReceivedInvitations) { size += pb::CodedOutputStream.ComputeUInt32Size(2, MaxReceivedInvitations); } - if (HasObjectId) { + if (hasObjectId) { size += pb::CodedOutputStream.ComputeUInt64Size(3, ObjectId); } foreach (global::bnet.protocol.invitation.Invitation element in ReceivedInvitationList) { @@ -949,38 +1095,73 @@ public static InvitationCollection ParseDelimitedFrom(global::System.IO.Stream i public static InvitationCollection ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static InvitationCollection ParseFrom(pb::CodedInputStream input) { + public static InvitationCollection ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static InvitationCollection ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static InvitationCollection ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private InvitationCollection MakeReadOnly() { + receivedInvitation_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(InvitationCollection prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(InvitationCollection cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - InvitationCollection result = new InvitationCollection(); + private bool resultIsReadOnly; + private InvitationCollection result; + + private InvitationCollection PrepareBuilder() { + if (resultIsReadOnly) { + InvitationCollection original = result; + result = new InvitationCollection(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override InvitationCollection MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new InvitationCollection(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -992,13 +1173,11 @@ public override InvitationCollection DefaultInstanceForType { } public override InvitationCollection BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.receivedInvitation_.MakeReadOnly(); - InvitationCollection returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1012,6 +1191,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(InvitationCollection other) { if (other == global::bnet.protocol.channel_invitation.InvitationCollection.DefaultInstance) return this; + PrepareBuilder(); if (other.HasServiceType) { ServiceType = other.ServiceType; } @@ -1022,26 +1202,37 @@ public override Builder MergeFrom(InvitationCollection other) { ObjectId = other.ObjectId; } if (other.receivedInvitation_.Count != 0) { - base.AddRange(other.receivedInvitation_, result.receivedInvitation_); + result.receivedInvitation_.Add(other.receivedInvitation_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_invitationCollectionFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _invitationCollectionFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1053,88 +1244,97 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 8: { - ServiceType = input.ReadUInt32(); + result.hasServiceType = input.ReadUInt32(ref result.serviceType_); break; } case 16: { - MaxReceivedInvitations = input.ReadUInt32(); + result.hasMaxReceivedInvitations = input.ReadUInt32(ref result.maxReceivedInvitations_); break; } case 24: { - ObjectId = input.ReadUInt64(); + result.hasObjectId = input.ReadUInt64(ref result.objectId_); break; } case 34: { - global::bnet.protocol.invitation.Invitation.Builder subBuilder = global::bnet.protocol.invitation.Invitation.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddReceivedInvitation(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.receivedInvitation_, global::bnet.protocol.invitation.Invitation.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasServiceType { - get { return result.HasServiceType; } + get { return result.hasServiceType; } } public uint ServiceType { get { return result.ServiceType; } set { SetServiceType(value); } } public Builder SetServiceType(uint value) { + PrepareBuilder(); result.hasServiceType = true; result.serviceType_ = value; return this; } public Builder ClearServiceType() { + PrepareBuilder(); result.hasServiceType = false; result.serviceType_ = 0; return this; } public bool HasMaxReceivedInvitations { - get { return result.HasMaxReceivedInvitations; } + get { return result.hasMaxReceivedInvitations; } } public uint MaxReceivedInvitations { get { return result.MaxReceivedInvitations; } set { SetMaxReceivedInvitations(value); } } public Builder SetMaxReceivedInvitations(uint value) { + PrepareBuilder(); result.hasMaxReceivedInvitations = true; result.maxReceivedInvitations_ = value; return this; } public Builder ClearMaxReceivedInvitations() { + PrepareBuilder(); result.hasMaxReceivedInvitations = false; result.maxReceivedInvitations_ = 0; return this; } public bool HasObjectId { - get { return result.HasObjectId; } + get { return result.hasObjectId; } } public ulong ObjectId { get { return result.ObjectId; } set { SetObjectId(value); } } public Builder SetObjectId(ulong value) { + PrepareBuilder(); result.hasObjectId = true; result.objectId_ = value; return this; } public Builder ClearObjectId() { + PrepareBuilder(); result.hasObjectId = false; result.objectId_ = 0UL; return this; } public pbc::IPopsicleList ReceivedInvitationList { - get { return result.receivedInvitation_; } + get { return PrepareBuilder().receivedInvitation_; } } public int ReceivedInvitationCount { get { return result.ReceivedInvitationCount; } @@ -1144,29 +1344,35 @@ public int ReceivedInvitationCount { } public Builder SetReceivedInvitation(int index, global::bnet.protocol.invitation.Invitation value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.receivedInvitation_[index] = value; return this; } public Builder SetReceivedInvitation(int index, global::bnet.protocol.invitation.Invitation.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.receivedInvitation_[index] = builderForValue.Build(); return this; } public Builder AddReceivedInvitation(global::bnet.protocol.invitation.Invitation value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.receivedInvitation_.Add(value); return this; } public Builder AddReceivedInvitation(global::bnet.protocol.invitation.Invitation.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.receivedInvitation_.Add(builderForValue.Build()); return this; } public Builder AddRangeReceivedInvitation(scg::IEnumerable values) { - base.AddRange(values, result.receivedInvitation_); + PrepareBuilder(); + result.receivedInvitation_.Add(values); return this; } public Builder ClearReceivedInvitation() { + PrepareBuilder(); result.receivedInvitation_.Clear(); return this; } @@ -1179,3 +1385,5 @@ static InvitationCollection() { #endregion } + +#endregion Designer generated code diff --git a/source/D3Proto/bnet/protocol/chat/ChatTypes.cs b/src/LibMooNet/bnet/protocol/chat/ChatTypes.cs similarity index 57% rename from source/D3Proto/bnet/protocol/chat/ChatTypes.cs rename to src/LibMooNet/bnet/protocol/chat/ChatTypes.cs index 96e507e9..905b9950 100644 --- a/source/D3Proto/bnet/protocol/chat/ChatTypes.cs +++ b/src/LibMooNet/bnet/protocol/chat/ChatTypes.cs @@ -1,4 +1,6 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code using pb = global::Google.ProtocolBuffers; using pbc = global::Google.ProtocolBuffers.Collections; @@ -6,6 +8,9 @@ using scg = global::System.Collections.Generic; namespace bnet.protocol.chat { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public static partial class ChatTypes { #region Extension registration @@ -25,18 +30,18 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { static ChatTypes() { byte[] descriptorData = global::System.Convert.FromBase64String( - "CihzZXJ2aWNlL2NoYXQvZGVmaW5pdGlvbi9jaGF0X3R5cGVzLnByb3RvEhJi" + - "bmV0LnByb3RvY29sLmNoYXQaI3NlcnZpY2UvY2hhbm5lbC9jaGFubmVsX3R5" + - "cGVzLnByb3RvIpYBCgxDaGFubmVsU3RhdGUSEAoIaWRlbnRpdHkYASABKAkS" + - "DwoHcHJvZ3JhbRgCIAEoBxIOCgZsb2NhbGUYAyABKAcyUwoEY2hhdBIjLmJu" + - "ZXQucHJvdG9jb2wuY2hhbm5lbC5DaGFubmVsU3RhdGUYZCABKAsyIC5ibmV0" + - "LnByb3RvY29sLmNoYXQuQ2hhbm5lbFN0YXRl"); + "ChVibmV0L2NoYXRfdHlwZXMucHJvdG8SEmJuZXQucHJvdG9jb2wuY2hhdBoY" + + "Ym5ldC9jaGFubmVsX3R5cGVzLnByb3RvIsMBCgxDaGFubmVsU3RhdGUSEAoI" + + "aWRlbnRpdHkYASABKAkSDwoHcHJvZ3JhbRgCIAEoBxIOCgZsb2NhbGUYAyAB" + + "KAcSFQoGcHVibGljGAQgASgIOgVmYWxzZRIUCgxidWNrZXRfaW5kZXgYBSAB" + + "KA0yUwoEY2hhdBIjLmJuZXQucHJvdG9jb2wuY2hhbm5lbC5DaGFubmVsU3Rh" + + "dGUYZCABKAsyIC5ibmV0LnByb3RvY29sLmNoYXQuQ2hhbm5lbFN0YXRl"); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_bnet_protocol_chat_ChannelState__Descriptor = Descriptor.MessageTypes[0]; internal__static_bnet_protocol_chat_ChannelState__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_chat_ChannelState__Descriptor, - new string[] { "Identity", "Program", "Locale", }); + new string[] { "Identity", "Program", "Locale", "Public", "BucketIndex", }); global::bnet.protocol.chat.ChannelState.Chat = pb::GeneratedSingleExtension.CreateInstance(global::bnet.protocol.chat.ChannelState.Descriptor.Extensions[0]); return null; }; @@ -49,14 +54,20 @@ static ChatTypes() { } #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class ChannelState : pb::GeneratedMessage { - private static readonly ChannelState defaultInstance = new Builder().BuildPartial(); + private ChannelState() { } + private static readonly ChannelState defaultInstance = new ChannelState().MakeReadOnly(); + private static readonly string[] _channelStateFieldNames = new string[] { "bucket_index", "identity", "locale", "program", "public" }; + private static readonly uint[] _channelStateFieldTags = new uint[] { 40, 10, 29, 21, 32 }; public static ChannelState DefaultInstance { get { return defaultInstance; } } public override ChannelState DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ChannelState ThisMessage { @@ -85,7 +96,7 @@ public string Identity { public const int ProgramFieldNumber = 2; private bool hasProgram; - private uint program_ = 0; + private uint program_; public bool HasProgram { get { return hasProgram; } } @@ -95,7 +106,7 @@ public uint Program { public const int LocaleFieldNumber = 3; private bool hasLocale; - private uint locale_ = 0; + private uint locale_; public bool HasLocale { get { return hasLocale; } } @@ -103,22 +114,49 @@ public uint Locale { get { return locale_; } } + public const int PublicFieldNumber = 4; + private bool hasPublic; + private bool public_; + public bool HasPublic { + get { return hasPublic; } + } + public bool Public { + get { return public_; } + } + + public const int BucketIndexFieldNumber = 5; + private bool hasBucketIndex; + private uint bucketIndex_; + public bool HasBucketIndex { + get { return hasBucketIndex; } + } + public uint BucketIndex { + get { return bucketIndex_; } + } + public override bool IsInitialized { get { return true; } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasIdentity) { - output.WriteString(1, Identity); + string[] field_names = _channelStateFieldNames; + if (hasIdentity) { + output.WriteString(1, field_names[1], Identity); } - if (HasProgram) { - output.WriteFixed32(2, Program); + if (hasProgram) { + output.WriteFixed32(2, field_names[3], Program); } - if (HasLocale) { - output.WriteFixed32(3, Locale); + if (hasLocale) { + output.WriteFixed32(3, field_names[2], Locale); + } + if (hasPublic) { + output.WriteBool(4, field_names[4], Public); + } + if (hasBucketIndex) { + output.WriteUInt32(5, field_names[0], BucketIndex); } UnknownFields.WriteTo(output); } @@ -130,15 +168,21 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasIdentity) { + if (hasIdentity) { size += pb::CodedOutputStream.ComputeStringSize(1, Identity); } - if (HasProgram) { + if (hasProgram) { size += pb::CodedOutputStream.ComputeFixed32Size(2, Program); } - if (HasLocale) { + if (hasLocale) { size += pb::CodedOutputStream.ComputeFixed32Size(3, Locale); } + if (hasPublic) { + size += pb::CodedOutputStream.ComputeBoolSize(4, Public); + } + if (hasBucketIndex) { + size += pb::CodedOutputStream.ComputeUInt32Size(5, BucketIndex); + } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; return size; @@ -169,38 +213,72 @@ public static ChannelState ParseDelimitedFrom(global::System.IO.Stream input) { public static ChannelState ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static ChannelState ParseFrom(pb::CodedInputStream input) { + public static ChannelState ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ChannelState ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static ChannelState ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private ChannelState MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(ChannelState prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ChannelState cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - ChannelState result = new ChannelState(); + private bool resultIsReadOnly; + private ChannelState result; + + private ChannelState PrepareBuilder() { + if (resultIsReadOnly) { + ChannelState original = result; + result = new ChannelState(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override ChannelState MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ChannelState(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -212,12 +290,11 @@ public override ChannelState DefaultInstanceForType { } public override ChannelState BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - ChannelState returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -231,6 +308,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(ChannelState other) { if (other == global::bnet.protocol.chat.ChannelState.DefaultInstance) return this; + PrepareBuilder(); if (other.HasIdentity) { Identity = other.Identity; } @@ -240,24 +318,41 @@ public override Builder MergeFrom(ChannelState other) { if (other.HasLocale) { Locale = other.Locale; } + if (other.HasPublic) { + Public = other.Public; + } + if (other.HasBucketIndex) { + BucketIndex = other.BucketIndex; + } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_channelStateFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _channelStateFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -269,28 +364,41 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { - Identity = input.ReadString(); + result.hasIdentity = input.ReadString(ref result.identity_); break; } case 21: { - Program = input.ReadFixed32(); + result.hasProgram = input.ReadFixed32(ref result.program_); break; } case 29: { - Locale = input.ReadFixed32(); + result.hasLocale = input.ReadFixed32(ref result.locale_); + break; + } + case 32: { + result.hasPublic = input.ReadBool(ref result.public_); + break; + } + case 40: { + result.hasBucketIndex = input.ReadUInt32(ref result.bucketIndex_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasIdentity { - get { return result.HasIdentity; } + get { return result.hasIdentity; } } public string Identity { get { return result.Identity; } @@ -298,51 +406,97 @@ public string Identity { } public Builder SetIdentity(string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasIdentity = true; result.identity_ = value; return this; } public Builder ClearIdentity() { + PrepareBuilder(); result.hasIdentity = false; result.identity_ = ""; return this; } public bool HasProgram { - get { return result.HasProgram; } + get { return result.hasProgram; } } public uint Program { get { return result.Program; } set { SetProgram(value); } } public Builder SetProgram(uint value) { + PrepareBuilder(); result.hasProgram = true; result.program_ = value; return this; } public Builder ClearProgram() { + PrepareBuilder(); result.hasProgram = false; result.program_ = 0; return this; } public bool HasLocale { - get { return result.HasLocale; } + get { return result.hasLocale; } } public uint Locale { get { return result.Locale; } set { SetLocale(value); } } public Builder SetLocale(uint value) { + PrepareBuilder(); result.hasLocale = true; result.locale_ = value; return this; } public Builder ClearLocale() { + PrepareBuilder(); result.hasLocale = false; result.locale_ = 0; return this; } + + public bool HasPublic { + get { return result.hasPublic; } + } + public bool Public { + get { return result.Public; } + set { SetPublic(value); } + } + public Builder SetPublic(bool value) { + PrepareBuilder(); + result.hasPublic = true; + result.public_ = value; + return this; + } + public Builder ClearPublic() { + PrepareBuilder(); + result.hasPublic = false; + result.public_ = false; + return this; + } + + public bool HasBucketIndex { + get { return result.hasBucketIndex; } + } + public uint BucketIndex { + get { return result.BucketIndex; } + set { SetBucketIndex(value); } + } + public Builder SetBucketIndex(uint value) { + PrepareBuilder(); + result.hasBucketIndex = true; + result.bucketIndex_ = value; + return this; + } + public Builder ClearBucketIndex() { + PrepareBuilder(); + result.hasBucketIndex = false; + result.bucketIndex_ = 0; + return this; + } } static ChannelState() { object.ReferenceEquals(global::bnet.protocol.chat.ChatTypes.Descriptor, null); @@ -352,3 +506,5 @@ static ChannelState() { #endregion } + +#endregion Designer generated code diff --git a/src/LibMooNet/bnet/protocol/config/Locale.cs b/src/LibMooNet/bnet/protocol/config/Locale.cs new file mode 100644 index 00000000..f59e451c --- /dev/null +++ b/src/LibMooNet/bnet/protocol/config/Locale.cs @@ -0,0 +1,753 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace bnet.protocol.config { + + namespace Proto { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class Locale { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_bnet_protocol_config_Locale__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_config_Locale__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_config_Locales__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_config_Locales__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static Locale() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "ChFibmV0L2xvY2FsZS5wcm90bxIUYm5ldC5wcm90b2NvbC5jb25maWciPwoG" + + "TG9jYWxlEhIKCmlkZW50aWZpZXIYASACKAkSEwoLZGVzY3JpcHRpb24YAiAC" + + "KAkSDAoEZmxhZxgDIAMoCSI3CgdMb2NhbGVzEiwKBmxvY2FsZRgBIAMoCzIc" + + "LmJuZXQucHJvdG9jb2wuY29uZmlnLkxvY2FsZQ=="); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_bnet_protocol_config_Locale__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_config_Locale__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_config_Locale__Descriptor, + new string[] { "Identifier", "Description", "Flag", }); + internal__static_bnet_protocol_config_Locales__Descriptor = Descriptor.MessageTypes[1]; + internal__static_bnet_protocol_config_Locales__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_config_Locales__Descriptor, + new string[] { "Locale", }); + return null; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + }, assigner); + } + #endregion + + } + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Locale : pb::GeneratedMessage { + private Locale() { } + private static readonly Locale defaultInstance = new Locale().MakeReadOnly(); + private static readonly string[] _localeFieldNames = new string[] { "description", "flag", "identifier" }; + private static readonly uint[] _localeFieldTags = new uint[] { 18, 26, 10 }; + public static Locale DefaultInstance { + get { return defaultInstance; } + } + + public override Locale DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Locale ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.config.Proto.Locale.internal__static_bnet_protocol_config_Locale__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.config.Proto.Locale.internal__static_bnet_protocol_config_Locale__FieldAccessorTable; } + } + + public const int IdentifierFieldNumber = 1; + private bool hasIdentifier; + private string identifier_ = ""; + public bool HasIdentifier { + get { return hasIdentifier; } + } + public string Identifier { + get { return identifier_; } + } + + public const int DescriptionFieldNumber = 2; + private bool hasDescription; + private string description_ = ""; + public bool HasDescription { + get { return hasDescription; } + } + public string Description { + get { return description_; } + } + + public const int FlagFieldNumber = 3; + private pbc::PopsicleList flag_ = new pbc::PopsicleList(); + public scg::IList FlagList { + get { return pbc::Lists.AsReadOnly(flag_); } + } + public int FlagCount { + get { return flag_.Count; } + } + public string GetFlag(int index) { + return flag_[index]; + } + + public override bool IsInitialized { + get { + if (!hasIdentifier) return false; + if (!hasDescription) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _localeFieldNames; + if (hasIdentifier) { + output.WriteString(1, field_names[2], Identifier); + } + if (hasDescription) { + output.WriteString(2, field_names[0], Description); + } + if (flag_.Count > 0) { + output.WriteStringArray(3, field_names[1], flag_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasIdentifier) { + size += pb::CodedOutputStream.ComputeStringSize(1, Identifier); + } + if (hasDescription) { + size += pb::CodedOutputStream.ComputeStringSize(2, Description); + } + { + int dataSize = 0; + foreach (string element in FlagList) { + dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); + } + size += dataSize; + size += 1 * flag_.Count; + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static Locale ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Locale ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Locale ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Locale ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Locale ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Locale ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Locale ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Locale ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Locale ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Locale ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Locale MakeReadOnly() { + flag_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Locale prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Locale cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Locale result; + + private Locale PrepareBuilder() { + if (resultIsReadOnly) { + Locale original = result; + result = new Locale(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Locale MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.config.Locale.Descriptor; } + } + + public override Locale DefaultInstanceForType { + get { return global::bnet.protocol.config.Locale.DefaultInstance; } + } + + public override Locale BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Locale) { + return MergeFrom((Locale) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Locale other) { + if (other == global::bnet.protocol.config.Locale.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasIdentifier) { + Identifier = other.Identifier; + } + if (other.HasDescription) { + Description = other.Description; + } + if (other.flag_.Count != 0) { + result.flag_.Add(other.flag_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_localeFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _localeFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasIdentifier = input.ReadString(ref result.identifier_); + break; + } + case 18: { + result.hasDescription = input.ReadString(ref result.description_); + break; + } + case 26: { + input.ReadStringArray(tag, field_name, result.flag_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasIdentifier { + get { return result.hasIdentifier; } + } + public string Identifier { + get { return result.Identifier; } + set { SetIdentifier(value); } + } + public Builder SetIdentifier(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasIdentifier = true; + result.identifier_ = value; + return this; + } + public Builder ClearIdentifier() { + PrepareBuilder(); + result.hasIdentifier = false; + result.identifier_ = ""; + return this; + } + + public bool HasDescription { + get { return result.hasDescription; } + } + public string Description { + get { return result.Description; } + set { SetDescription(value); } + } + public Builder SetDescription(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasDescription = true; + result.description_ = value; + return this; + } + public Builder ClearDescription() { + PrepareBuilder(); + result.hasDescription = false; + result.description_ = ""; + return this; + } + + public pbc::IPopsicleList FlagList { + get { return PrepareBuilder().flag_; } + } + public int FlagCount { + get { return result.FlagCount; } + } + public string GetFlag(int index) { + return result.GetFlag(index); + } + public Builder SetFlag(int index, string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.flag_[index] = value; + return this; + } + public Builder AddFlag(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.flag_.Add(value); + return this; + } + public Builder AddRangeFlag(scg::IEnumerable values) { + PrepareBuilder(); + result.flag_.Add(values); + return this; + } + public Builder ClearFlag() { + PrepareBuilder(); + result.flag_.Clear(); + return this; + } + } + static Locale() { + object.ReferenceEquals(global::bnet.protocol.config.Proto.Locale.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Locales : pb::GeneratedMessage { + private Locales() { } + private static readonly Locales defaultInstance = new Locales().MakeReadOnly(); + private static readonly string[] _localesFieldNames = new string[] { "locale" }; + private static readonly uint[] _localesFieldTags = new uint[] { 10 }; + public static Locales DefaultInstance { + get { return defaultInstance; } + } + + public override Locales DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Locales ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.config.Proto.Locale.internal__static_bnet_protocol_config_Locales__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.config.Proto.Locale.internal__static_bnet_protocol_config_Locales__FieldAccessorTable; } + } + + public const int LocaleFieldNumber = 1; + private pbc::PopsicleList locale_ = new pbc::PopsicleList(); + public scg::IList LocaleList { + get { return locale_; } + } + public int LocaleCount { + get { return locale_.Count; } + } + public global::bnet.protocol.config.Locale GetLocale(int index) { + return locale_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.config.Locale element in LocaleList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _localesFieldNames; + if (locale_.Count > 0) { + output.WriteMessageArray(1, field_names[0], locale_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.config.Locale element in LocaleList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static Locales ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Locales ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Locales ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Locales ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Locales ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Locales ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Locales ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Locales ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Locales ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Locales ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Locales MakeReadOnly() { + locale_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Locales prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Locales cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Locales result; + + private Locales PrepareBuilder() { + if (resultIsReadOnly) { + Locales original = result; + result = new Locales(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Locales MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.config.Locales.Descriptor; } + } + + public override Locales DefaultInstanceForType { + get { return global::bnet.protocol.config.Locales.DefaultInstance; } + } + + public override Locales BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Locales) { + return MergeFrom((Locales) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Locales other) { + if (other == global::bnet.protocol.config.Locales.DefaultInstance) return this; + PrepareBuilder(); + if (other.locale_.Count != 0) { + result.locale_.Add(other.locale_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_localesFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _localesFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.locale_, global::bnet.protocol.config.Locale.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList LocaleList { + get { return PrepareBuilder().locale_; } + } + public int LocaleCount { + get { return result.LocaleCount; } + } + public global::bnet.protocol.config.Locale GetLocale(int index) { + return result.GetLocale(index); + } + public Builder SetLocale(int index, global::bnet.protocol.config.Locale value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.locale_[index] = value; + return this; + } + public Builder SetLocale(int index, global::bnet.protocol.config.Locale.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.locale_[index] = builderForValue.Build(); + return this; + } + public Builder AddLocale(global::bnet.protocol.config.Locale value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.locale_.Add(value); + return this; + } + public Builder AddLocale(global::bnet.protocol.config.Locale.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.locale_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeLocale(scg::IEnumerable values) { + PrepareBuilder(); + result.locale_.Add(values); + return this; + } + public Builder ClearLocale() { + PrepareBuilder(); + result.locale_.Clear(); + return this; + } + } + static Locales() { + object.ReferenceEquals(global::bnet.protocol.config.Proto.Locale.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/LibMooNet/bnet/protocol/config/RpcConfig.cs b/src/LibMooNet/bnet/protocol/config/RpcConfig.cs new file mode 100644 index 00000000..ee9176c0 --- /dev/null +++ b/src/LibMooNet/bnet/protocol/config/RpcConfig.cs @@ -0,0 +1,1250 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace bnet.protocol.config { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class RpcConfig { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_bnet_protocol_config_RPCMethodConfig__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_config_RPCMethodConfig__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_config_RPCMeterConfig__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_config_RPCMeterConfig__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static RpcConfig() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "ChVibmV0L3JwY19jb25maWcucHJvdG8SFGJuZXQucHJvdG9jb2wuY29uZmln" + + "Gg5ibmV0L3JwYy5wcm90byKnAgoPUlBDTWV0aG9kQ29uZmlnEhQKDHNlcnZp" + + "Y2VfbmFtZRgBIAEoCRITCgttZXRob2RfbmFtZRgCIAEoCRIaCg9maXhlZF9j" + + "YWxsX2Nvc3QYAyABKA06ATESHAoRZml4ZWRfcGFja2V0X3NpemUYBCABKA06" + + "ATASHgoTdmFyaWFibGVfbXVsdGlwbGllchgFIAEoAjoBMBIVCgptdWx0aXBs" + + "aWVyGAYgASgCOgExEhgKEHJhdGVfbGltaXRfY291bnQYByABKA0SGgoScmF0" + + "ZV9saW1pdF9zZWNvbmRzGAggASgNEhcKD21heF9wYWNrZXRfc2l6ZRgJIAEo" + + "DRIYChBtYXhfZW5jb2RlZF9zaXplGAogASgNEg8KB3RpbWVvdXQYCyABKAIi" + + "rgEKDlJQQ01ldGVyQ29uZmlnEjUKBm1ldGhvZBgBIAMoCzIlLmJuZXQucHJv" + + "dG9jb2wuY29uZmlnLlJQQ01ldGhvZENvbmZpZxIcChFpbmNvbWVfcGVyX3Nl" + + "Y29uZBgCIAEoDToBMRIXCg9pbml0aWFsX2JhbGFuY2UYAyABKA0SEwoLY2Fw" + + "X2JhbGFuY2UYBCABKA0SGQoOc3RhcnR1cF9wZXJpb2QYBSABKAI6ATA="); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_bnet_protocol_config_RPCMethodConfig__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_config_RPCMethodConfig__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_config_RPCMethodConfig__Descriptor, + new string[] { "ServiceName", "MethodName", "FixedCallCost", "FixedPacketSize", "VariableMultiplier", "Multiplier", "RateLimitCount", "RateLimitSeconds", "MaxPacketSize", "MaxEncodedSize", "Timeout", }); + internal__static_bnet_protocol_config_RPCMeterConfig__Descriptor = Descriptor.MessageTypes[1]; + internal__static_bnet_protocol_config_RPCMeterConfig__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_config_RPCMeterConfig__Descriptor, + new string[] { "Method", "IncomePerSecond", "InitialBalance", "CapBalance", "StartupPeriod", }); + return null; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::bnet.protocol.Rpc.Descriptor, + }, assigner); + } + #endregion + + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class RPCMethodConfig : pb::GeneratedMessage { + private RPCMethodConfig() { } + private static readonly RPCMethodConfig defaultInstance = new RPCMethodConfig().MakeReadOnly(); + private static readonly string[] _rPCMethodConfigFieldNames = new string[] { "fixed_call_cost", "fixed_packet_size", "max_encoded_size", "max_packet_size", "method_name", "multiplier", "rate_limit_count", "rate_limit_seconds", "service_name", "timeout", "variable_multiplier" }; + private static readonly uint[] _rPCMethodConfigFieldTags = new uint[] { 24, 32, 80, 72, 18, 53, 56, 64, 10, 93, 45 }; + public static RPCMethodConfig DefaultInstance { + get { return defaultInstance; } + } + + public override RPCMethodConfig DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override RPCMethodConfig ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.config.RpcConfig.internal__static_bnet_protocol_config_RPCMethodConfig__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.config.RpcConfig.internal__static_bnet_protocol_config_RPCMethodConfig__FieldAccessorTable; } + } + + public const int ServiceNameFieldNumber = 1; + private bool hasServiceName; + private string serviceName_ = ""; + public bool HasServiceName { + get { return hasServiceName; } + } + public string ServiceName { + get { return serviceName_; } + } + + public const int MethodNameFieldNumber = 2; + private bool hasMethodName; + private string methodName_ = ""; + public bool HasMethodName { + get { return hasMethodName; } + } + public string MethodName { + get { return methodName_; } + } + + public const int FixedCallCostFieldNumber = 3; + private bool hasFixedCallCost; + private uint fixedCallCost_ = 1; + public bool HasFixedCallCost { + get { return hasFixedCallCost; } + } + public uint FixedCallCost { + get { return fixedCallCost_; } + } + + public const int FixedPacketSizeFieldNumber = 4; + private bool hasFixedPacketSize; + private uint fixedPacketSize_; + public bool HasFixedPacketSize { + get { return hasFixedPacketSize; } + } + public uint FixedPacketSize { + get { return fixedPacketSize_; } + } + + public const int VariableMultiplierFieldNumber = 5; + private bool hasVariableMultiplier; + private float variableMultiplier_; + public bool HasVariableMultiplier { + get { return hasVariableMultiplier; } + } + public float VariableMultiplier { + get { return variableMultiplier_; } + } + + public const int MultiplierFieldNumber = 6; + private bool hasMultiplier; + private float multiplier_ = 1F; + public bool HasMultiplier { + get { return hasMultiplier; } + } + public float Multiplier { + get { return multiplier_; } + } + + public const int RateLimitCountFieldNumber = 7; + private bool hasRateLimitCount; + private uint rateLimitCount_; + public bool HasRateLimitCount { + get { return hasRateLimitCount; } + } + public uint RateLimitCount { + get { return rateLimitCount_; } + } + + public const int RateLimitSecondsFieldNumber = 8; + private bool hasRateLimitSeconds; + private uint rateLimitSeconds_; + public bool HasRateLimitSeconds { + get { return hasRateLimitSeconds; } + } + public uint RateLimitSeconds { + get { return rateLimitSeconds_; } + } + + public const int MaxPacketSizeFieldNumber = 9; + private bool hasMaxPacketSize; + private uint maxPacketSize_; + public bool HasMaxPacketSize { + get { return hasMaxPacketSize; } + } + public uint MaxPacketSize { + get { return maxPacketSize_; } + } + + public const int MaxEncodedSizeFieldNumber = 10; + private bool hasMaxEncodedSize; + private uint maxEncodedSize_; + public bool HasMaxEncodedSize { + get { return hasMaxEncodedSize; } + } + public uint MaxEncodedSize { + get { return maxEncodedSize_; } + } + + public const int TimeoutFieldNumber = 11; + private bool hasTimeout; + private float timeout_; + public bool HasTimeout { + get { return hasTimeout; } + } + public float Timeout { + get { return timeout_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _rPCMethodConfigFieldNames; + if (hasServiceName) { + output.WriteString(1, field_names[8], ServiceName); + } + if (hasMethodName) { + output.WriteString(2, field_names[4], MethodName); + } + if (hasFixedCallCost) { + output.WriteUInt32(3, field_names[0], FixedCallCost); + } + if (hasFixedPacketSize) { + output.WriteUInt32(4, field_names[1], FixedPacketSize); + } + if (hasVariableMultiplier) { + output.WriteFloat(5, field_names[10], VariableMultiplier); + } + if (hasMultiplier) { + output.WriteFloat(6, field_names[5], Multiplier); + } + if (hasRateLimitCount) { + output.WriteUInt32(7, field_names[6], RateLimitCount); + } + if (hasRateLimitSeconds) { + output.WriteUInt32(8, field_names[7], RateLimitSeconds); + } + if (hasMaxPacketSize) { + output.WriteUInt32(9, field_names[3], MaxPacketSize); + } + if (hasMaxEncodedSize) { + output.WriteUInt32(10, field_names[2], MaxEncodedSize); + } + if (hasTimeout) { + output.WriteFloat(11, field_names[9], Timeout); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasServiceName) { + size += pb::CodedOutputStream.ComputeStringSize(1, ServiceName); + } + if (hasMethodName) { + size += pb::CodedOutputStream.ComputeStringSize(2, MethodName); + } + if (hasFixedCallCost) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, FixedCallCost); + } + if (hasFixedPacketSize) { + size += pb::CodedOutputStream.ComputeUInt32Size(4, FixedPacketSize); + } + if (hasVariableMultiplier) { + size += pb::CodedOutputStream.ComputeFloatSize(5, VariableMultiplier); + } + if (hasMultiplier) { + size += pb::CodedOutputStream.ComputeFloatSize(6, Multiplier); + } + if (hasRateLimitCount) { + size += pb::CodedOutputStream.ComputeUInt32Size(7, RateLimitCount); + } + if (hasRateLimitSeconds) { + size += pb::CodedOutputStream.ComputeUInt32Size(8, RateLimitSeconds); + } + if (hasMaxPacketSize) { + size += pb::CodedOutputStream.ComputeUInt32Size(9, MaxPacketSize); + } + if (hasMaxEncodedSize) { + size += pb::CodedOutputStream.ComputeUInt32Size(10, MaxEncodedSize); + } + if (hasTimeout) { + size += pb::CodedOutputStream.ComputeFloatSize(11, Timeout); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static RPCMethodConfig ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RPCMethodConfig ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RPCMethodConfig ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RPCMethodConfig ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RPCMethodConfig ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RPCMethodConfig ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static RPCMethodConfig ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static RPCMethodConfig ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static RPCMethodConfig ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RPCMethodConfig ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private RPCMethodConfig MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(RPCMethodConfig prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(RPCMethodConfig cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private RPCMethodConfig result; + + private RPCMethodConfig PrepareBuilder() { + if (resultIsReadOnly) { + RPCMethodConfig original = result; + result = new RPCMethodConfig(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override RPCMethodConfig MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.config.RPCMethodConfig.Descriptor; } + } + + public override RPCMethodConfig DefaultInstanceForType { + get { return global::bnet.protocol.config.RPCMethodConfig.DefaultInstance; } + } + + public override RPCMethodConfig BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is RPCMethodConfig) { + return MergeFrom((RPCMethodConfig) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(RPCMethodConfig other) { + if (other == global::bnet.protocol.config.RPCMethodConfig.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasServiceName) { + ServiceName = other.ServiceName; + } + if (other.HasMethodName) { + MethodName = other.MethodName; + } + if (other.HasFixedCallCost) { + FixedCallCost = other.FixedCallCost; + } + if (other.HasFixedPacketSize) { + FixedPacketSize = other.FixedPacketSize; + } + if (other.HasVariableMultiplier) { + VariableMultiplier = other.VariableMultiplier; + } + if (other.HasMultiplier) { + Multiplier = other.Multiplier; + } + if (other.HasRateLimitCount) { + RateLimitCount = other.RateLimitCount; + } + if (other.HasRateLimitSeconds) { + RateLimitSeconds = other.RateLimitSeconds; + } + if (other.HasMaxPacketSize) { + MaxPacketSize = other.MaxPacketSize; + } + if (other.HasMaxEncodedSize) { + MaxEncodedSize = other.MaxEncodedSize; + } + if (other.HasTimeout) { + Timeout = other.Timeout; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_rPCMethodConfigFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _rPCMethodConfigFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasServiceName = input.ReadString(ref result.serviceName_); + break; + } + case 18: { + result.hasMethodName = input.ReadString(ref result.methodName_); + break; + } + case 24: { + result.hasFixedCallCost = input.ReadUInt32(ref result.fixedCallCost_); + break; + } + case 32: { + result.hasFixedPacketSize = input.ReadUInt32(ref result.fixedPacketSize_); + break; + } + case 45: { + result.hasVariableMultiplier = input.ReadFloat(ref result.variableMultiplier_); + break; + } + case 53: { + result.hasMultiplier = input.ReadFloat(ref result.multiplier_); + break; + } + case 56: { + result.hasRateLimitCount = input.ReadUInt32(ref result.rateLimitCount_); + break; + } + case 64: { + result.hasRateLimitSeconds = input.ReadUInt32(ref result.rateLimitSeconds_); + break; + } + case 72: { + result.hasMaxPacketSize = input.ReadUInt32(ref result.maxPacketSize_); + break; + } + case 80: { + result.hasMaxEncodedSize = input.ReadUInt32(ref result.maxEncodedSize_); + break; + } + case 93: { + result.hasTimeout = input.ReadFloat(ref result.timeout_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasServiceName { + get { return result.hasServiceName; } + } + public string ServiceName { + get { return result.ServiceName; } + set { SetServiceName(value); } + } + public Builder SetServiceName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasServiceName = true; + result.serviceName_ = value; + return this; + } + public Builder ClearServiceName() { + PrepareBuilder(); + result.hasServiceName = false; + result.serviceName_ = ""; + return this; + } + + public bool HasMethodName { + get { return result.hasMethodName; } + } + public string MethodName { + get { return result.MethodName; } + set { SetMethodName(value); } + } + public Builder SetMethodName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasMethodName = true; + result.methodName_ = value; + return this; + } + public Builder ClearMethodName() { + PrepareBuilder(); + result.hasMethodName = false; + result.methodName_ = ""; + return this; + } + + public bool HasFixedCallCost { + get { return result.hasFixedCallCost; } + } + public uint FixedCallCost { + get { return result.FixedCallCost; } + set { SetFixedCallCost(value); } + } + public Builder SetFixedCallCost(uint value) { + PrepareBuilder(); + result.hasFixedCallCost = true; + result.fixedCallCost_ = value; + return this; + } + public Builder ClearFixedCallCost() { + PrepareBuilder(); + result.hasFixedCallCost = false; + result.fixedCallCost_ = 1; + return this; + } + + public bool HasFixedPacketSize { + get { return result.hasFixedPacketSize; } + } + public uint FixedPacketSize { + get { return result.FixedPacketSize; } + set { SetFixedPacketSize(value); } + } + public Builder SetFixedPacketSize(uint value) { + PrepareBuilder(); + result.hasFixedPacketSize = true; + result.fixedPacketSize_ = value; + return this; + } + public Builder ClearFixedPacketSize() { + PrepareBuilder(); + result.hasFixedPacketSize = false; + result.fixedPacketSize_ = 0; + return this; + } + + public bool HasVariableMultiplier { + get { return result.hasVariableMultiplier; } + } + public float VariableMultiplier { + get { return result.VariableMultiplier; } + set { SetVariableMultiplier(value); } + } + public Builder SetVariableMultiplier(float value) { + PrepareBuilder(); + result.hasVariableMultiplier = true; + result.variableMultiplier_ = value; + return this; + } + public Builder ClearVariableMultiplier() { + PrepareBuilder(); + result.hasVariableMultiplier = false; + result.variableMultiplier_ = 0F; + return this; + } + + public bool HasMultiplier { + get { return result.hasMultiplier; } + } + public float Multiplier { + get { return result.Multiplier; } + set { SetMultiplier(value); } + } + public Builder SetMultiplier(float value) { + PrepareBuilder(); + result.hasMultiplier = true; + result.multiplier_ = value; + return this; + } + public Builder ClearMultiplier() { + PrepareBuilder(); + result.hasMultiplier = false; + result.multiplier_ = 1F; + return this; + } + + public bool HasRateLimitCount { + get { return result.hasRateLimitCount; } + } + public uint RateLimitCount { + get { return result.RateLimitCount; } + set { SetRateLimitCount(value); } + } + public Builder SetRateLimitCount(uint value) { + PrepareBuilder(); + result.hasRateLimitCount = true; + result.rateLimitCount_ = value; + return this; + } + public Builder ClearRateLimitCount() { + PrepareBuilder(); + result.hasRateLimitCount = false; + result.rateLimitCount_ = 0; + return this; + } + + public bool HasRateLimitSeconds { + get { return result.hasRateLimitSeconds; } + } + public uint RateLimitSeconds { + get { return result.RateLimitSeconds; } + set { SetRateLimitSeconds(value); } + } + public Builder SetRateLimitSeconds(uint value) { + PrepareBuilder(); + result.hasRateLimitSeconds = true; + result.rateLimitSeconds_ = value; + return this; + } + public Builder ClearRateLimitSeconds() { + PrepareBuilder(); + result.hasRateLimitSeconds = false; + result.rateLimitSeconds_ = 0; + return this; + } + + public bool HasMaxPacketSize { + get { return result.hasMaxPacketSize; } + } + public uint MaxPacketSize { + get { return result.MaxPacketSize; } + set { SetMaxPacketSize(value); } + } + public Builder SetMaxPacketSize(uint value) { + PrepareBuilder(); + result.hasMaxPacketSize = true; + result.maxPacketSize_ = value; + return this; + } + public Builder ClearMaxPacketSize() { + PrepareBuilder(); + result.hasMaxPacketSize = false; + result.maxPacketSize_ = 0; + return this; + } + + public bool HasMaxEncodedSize { + get { return result.hasMaxEncodedSize; } + } + public uint MaxEncodedSize { + get { return result.MaxEncodedSize; } + set { SetMaxEncodedSize(value); } + } + public Builder SetMaxEncodedSize(uint value) { + PrepareBuilder(); + result.hasMaxEncodedSize = true; + result.maxEncodedSize_ = value; + return this; + } + public Builder ClearMaxEncodedSize() { + PrepareBuilder(); + result.hasMaxEncodedSize = false; + result.maxEncodedSize_ = 0; + return this; + } + + public bool HasTimeout { + get { return result.hasTimeout; } + } + public float Timeout { + get { return result.Timeout; } + set { SetTimeout(value); } + } + public Builder SetTimeout(float value) { + PrepareBuilder(); + result.hasTimeout = true; + result.timeout_ = value; + return this; + } + public Builder ClearTimeout() { + PrepareBuilder(); + result.hasTimeout = false; + result.timeout_ = 0F; + return this; + } + } + static RPCMethodConfig() { + object.ReferenceEquals(global::bnet.protocol.config.RpcConfig.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class RPCMeterConfig : pb::GeneratedMessage { + private RPCMeterConfig() { } + private static readonly RPCMeterConfig defaultInstance = new RPCMeterConfig().MakeReadOnly(); + private static readonly string[] _rPCMeterConfigFieldNames = new string[] { "cap_balance", "income_per_second", "initial_balance", "method", "startup_period" }; + private static readonly uint[] _rPCMeterConfigFieldTags = new uint[] { 32, 16, 24, 10, 45 }; + public static RPCMeterConfig DefaultInstance { + get { return defaultInstance; } + } + + public override RPCMeterConfig DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override RPCMeterConfig ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.config.RpcConfig.internal__static_bnet_protocol_config_RPCMeterConfig__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.config.RpcConfig.internal__static_bnet_protocol_config_RPCMeterConfig__FieldAccessorTable; } + } + + public const int MethodFieldNumber = 1; + private pbc::PopsicleList method_ = new pbc::PopsicleList(); + public scg::IList MethodList { + get { return method_; } + } + public int MethodCount { + get { return method_.Count; } + } + public global::bnet.protocol.config.RPCMethodConfig GetMethod(int index) { + return method_[index]; + } + + public const int IncomePerSecondFieldNumber = 2; + private bool hasIncomePerSecond; + private uint incomePerSecond_ = 1; + public bool HasIncomePerSecond { + get { return hasIncomePerSecond; } + } + public uint IncomePerSecond { + get { return incomePerSecond_; } + } + + public const int InitialBalanceFieldNumber = 3; + private bool hasInitialBalance; + private uint initialBalance_; + public bool HasInitialBalance { + get { return hasInitialBalance; } + } + public uint InitialBalance { + get { return initialBalance_; } + } + + public const int CapBalanceFieldNumber = 4; + private bool hasCapBalance; + private uint capBalance_; + public bool HasCapBalance { + get { return hasCapBalance; } + } + public uint CapBalance { + get { return capBalance_; } + } + + public const int StartupPeriodFieldNumber = 5; + private bool hasStartupPeriod; + private float startupPeriod_; + public bool HasStartupPeriod { + get { return hasStartupPeriod; } + } + public float StartupPeriod { + get { return startupPeriod_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _rPCMeterConfigFieldNames; + if (method_.Count > 0) { + output.WriteMessageArray(1, field_names[3], method_); + } + if (hasIncomePerSecond) { + output.WriteUInt32(2, field_names[1], IncomePerSecond); + } + if (hasInitialBalance) { + output.WriteUInt32(3, field_names[2], InitialBalance); + } + if (hasCapBalance) { + output.WriteUInt32(4, field_names[0], CapBalance); + } + if (hasStartupPeriod) { + output.WriteFloat(5, field_names[4], StartupPeriod); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.config.RPCMethodConfig element in MethodList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + if (hasIncomePerSecond) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, IncomePerSecond); + } + if (hasInitialBalance) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, InitialBalance); + } + if (hasCapBalance) { + size += pb::CodedOutputStream.ComputeUInt32Size(4, CapBalance); + } + if (hasStartupPeriod) { + size += pb::CodedOutputStream.ComputeFloatSize(5, StartupPeriod); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static RPCMeterConfig ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RPCMeterConfig ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RPCMeterConfig ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RPCMeterConfig ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RPCMeterConfig ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RPCMeterConfig ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static RPCMeterConfig ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static RPCMeterConfig ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static RPCMeterConfig ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RPCMeterConfig ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private RPCMeterConfig MakeReadOnly() { + method_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(RPCMeterConfig prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(RPCMeterConfig cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private RPCMeterConfig result; + + private RPCMeterConfig PrepareBuilder() { + if (resultIsReadOnly) { + RPCMeterConfig original = result; + result = new RPCMeterConfig(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override RPCMeterConfig MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.config.RPCMeterConfig.Descriptor; } + } + + public override RPCMeterConfig DefaultInstanceForType { + get { return global::bnet.protocol.config.RPCMeterConfig.DefaultInstance; } + } + + public override RPCMeterConfig BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is RPCMeterConfig) { + return MergeFrom((RPCMeterConfig) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(RPCMeterConfig other) { + if (other == global::bnet.protocol.config.RPCMeterConfig.DefaultInstance) return this; + PrepareBuilder(); + if (other.method_.Count != 0) { + result.method_.Add(other.method_); + } + if (other.HasIncomePerSecond) { + IncomePerSecond = other.IncomePerSecond; + } + if (other.HasInitialBalance) { + InitialBalance = other.InitialBalance; + } + if (other.HasCapBalance) { + CapBalance = other.CapBalance; + } + if (other.HasStartupPeriod) { + StartupPeriod = other.StartupPeriod; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_rPCMeterConfigFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _rPCMeterConfigFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.method_, global::bnet.protocol.config.RPCMethodConfig.DefaultInstance, extensionRegistry); + break; + } + case 16: { + result.hasIncomePerSecond = input.ReadUInt32(ref result.incomePerSecond_); + break; + } + case 24: { + result.hasInitialBalance = input.ReadUInt32(ref result.initialBalance_); + break; + } + case 32: { + result.hasCapBalance = input.ReadUInt32(ref result.capBalance_); + break; + } + case 45: { + result.hasStartupPeriod = input.ReadFloat(ref result.startupPeriod_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList MethodList { + get { return PrepareBuilder().method_; } + } + public int MethodCount { + get { return result.MethodCount; } + } + public global::bnet.protocol.config.RPCMethodConfig GetMethod(int index) { + return result.GetMethod(index); + } + public Builder SetMethod(int index, global::bnet.protocol.config.RPCMethodConfig value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.method_[index] = value; + return this; + } + public Builder SetMethod(int index, global::bnet.protocol.config.RPCMethodConfig.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.method_[index] = builderForValue.Build(); + return this; + } + public Builder AddMethod(global::bnet.protocol.config.RPCMethodConfig value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.method_.Add(value); + return this; + } + public Builder AddMethod(global::bnet.protocol.config.RPCMethodConfig.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.method_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeMethod(scg::IEnumerable values) { + PrepareBuilder(); + result.method_.Add(values); + return this; + } + public Builder ClearMethod() { + PrepareBuilder(); + result.method_.Clear(); + return this; + } + + public bool HasIncomePerSecond { + get { return result.hasIncomePerSecond; } + } + public uint IncomePerSecond { + get { return result.IncomePerSecond; } + set { SetIncomePerSecond(value); } + } + public Builder SetIncomePerSecond(uint value) { + PrepareBuilder(); + result.hasIncomePerSecond = true; + result.incomePerSecond_ = value; + return this; + } + public Builder ClearIncomePerSecond() { + PrepareBuilder(); + result.hasIncomePerSecond = false; + result.incomePerSecond_ = 1; + return this; + } + + public bool HasInitialBalance { + get { return result.hasInitialBalance; } + } + public uint InitialBalance { + get { return result.InitialBalance; } + set { SetInitialBalance(value); } + } + public Builder SetInitialBalance(uint value) { + PrepareBuilder(); + result.hasInitialBalance = true; + result.initialBalance_ = value; + return this; + } + public Builder ClearInitialBalance() { + PrepareBuilder(); + result.hasInitialBalance = false; + result.initialBalance_ = 0; + return this; + } + + public bool HasCapBalance { + get { return result.hasCapBalance; } + } + public uint CapBalance { + get { return result.CapBalance; } + set { SetCapBalance(value); } + } + public Builder SetCapBalance(uint value) { + PrepareBuilder(); + result.hasCapBalance = true; + result.capBalance_ = value; + return this; + } + public Builder ClearCapBalance() { + PrepareBuilder(); + result.hasCapBalance = false; + result.capBalance_ = 0; + return this; + } + + public bool HasStartupPeriod { + get { return result.hasStartupPeriod; } + } + public float StartupPeriod { + get { return result.StartupPeriod; } + set { SetStartupPeriod(value); } + } + public Builder SetStartupPeriod(float value) { + PrepareBuilder(); + result.hasStartupPeriod = true; + result.startupPeriod_ = value; + return this; + } + public Builder ClearStartupPeriod() { + PrepareBuilder(); + result.hasStartupPeriod = false; + result.startupPeriod_ = 0F; + return this; + } + } + static RPCMeterConfig() { + object.ReferenceEquals(global::bnet.protocol.config.RpcConfig.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code diff --git a/source/D3Proto/bnet/protocol/connection/Connection.cs b/src/LibMooNet/bnet/protocol/connection/ConnectionService.cs similarity index 51% rename from source/D3Proto/bnet/protocol/connection/Connection.cs rename to src/LibMooNet/bnet/protocol/connection/ConnectionService.cs index c0c34f36..ae9a7ebb 100644 --- a/source/D3Proto/bnet/protocol/connection/Connection.cs +++ b/src/LibMooNet/bnet/protocol/connection/ConnectionService.cs @@ -1,4 +1,6 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code using pb = global::Google.ProtocolBuffers; using pbc = global::Google.ProtocolBuffers.Collections; @@ -6,139 +8,171 @@ using scg = global::System.Collections.Generic; namespace bnet.protocol.connection { - public static partial class Connection { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_bnet_protocol_connection_ConnectRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_connection_ConnectRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_connection_ConnectResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_connection_ConnectResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_connection_BoundService__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_connection_BoundService__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_connection_BindRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_connection_BindRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_connection_BindResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_connection_BindResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_connection_EchoRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_connection_EchoRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_connection_EchoResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_connection_EchoResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_connection_DisconnectRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_connection_DisconnectRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_connection_DisconnectNotification__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_connection_DisconnectNotification__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_connection_NullRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_connection_NullRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_connection_EncryptRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_connection_EncryptRequest__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static Connection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "ChhsaWIvcnBjL2Nvbm5lY3Rpb24ucHJvdG8SGGJuZXQucHJvdG9jb2wuY29u" + - "bmVjdGlvbhoRbGliL3JwYy9ycGMucHJvdG8iPQoOQ29ubmVjdFJlcXVlc3QS" + - "KwoJY2xpZW50X2lkGAEgASgLMhguYm5ldC5wcm90b2NvbC5Qcm9jZXNzSWQi" + - "awoPQ29ubmVjdFJlc3BvbnNlEisKCXNlcnZlcl9pZBgBIAIoCzIYLmJuZXQu" + - "cHJvdG9jb2wuUHJvY2Vzc0lkEisKCWNsaWVudF9pZBgCIAEoCzIYLmJuZXQu" + - "cHJvdG9jb2wuUHJvY2Vzc0lkIigKDEJvdW5kU2VydmljZRIMCgRoYXNoGAEg" + - "AigHEgoKAmlkGAIgAigNInIKC0JpbmRSZXF1ZXN0EiEKFWltcG9ydGVkX3Nl" + - "cnZpY2VfaGFzaBgBIAMoB0ICEAESQAoQZXhwb3J0ZWRfc2VydmljZRgCIAMo" + - "CzImLmJuZXQucHJvdG9jb2wuY29ubmVjdGlvbi5Cb3VuZFNlcnZpY2UiLwoM" + - "QmluZFJlc3BvbnNlEh8KE2ltcG9ydGVkX3NlcnZpY2VfaWQYASADKA1CAhAB" + - "IkkKC0VjaG9SZXF1ZXN0EgwKBHRpbWUYASABKAYSGwoMbmV0d29ya19vbmx5" + - "GAIgASgIOgVmYWxzZRIPCgdwYXlsb2FkGAMgASgMIi0KDEVjaG9SZXNwb25z" + - "ZRIMCgR0aW1lGAEgASgGEg8KB3BheWxvYWQYAiABKAwiJwoRRGlzY29ubmVj" + - "dFJlcXVlc3QSEgoKZXJyb3JfY29kZRgBIAIoDSI8ChZEaXNjb25uZWN0Tm90" + - "aWZpY2F0aW9uEhIKCmVycm9yX2NvZGUYASACKA0SDgoGcmVhc29uGAIgASgJ" + - "Ig0KC051bGxSZXF1ZXN0IhAKDkVuY3J5cHRSZXF1ZXN0MvcEChFDb25uZWN0" + - "aW9uU2VydmljZRJeCgdDb25uZWN0EiguYm5ldC5wcm90b2NvbC5jb25uZWN0" + - "aW9uLkNvbm5lY3RSZXF1ZXN0GikuYm5ldC5wcm90b2NvbC5jb25uZWN0aW9u" + - "LkNvbm5lY3RSZXNwb25zZRJVCgRCaW5kEiUuYm5ldC5wcm90b2NvbC5jb25u" + - "ZWN0aW9uLkJpbmRSZXF1ZXN0GiYuYm5ldC5wcm90b2NvbC5jb25uZWN0aW9u" + - "LkJpbmRSZXNwb25zZRJVCgRFY2hvEiUuYm5ldC5wcm90b2NvbC5jb25uZWN0" + - "aW9uLkVjaG9SZXF1ZXN0GiYuYm5ldC5wcm90b2NvbC5jb25uZWN0aW9uLkVj" + - "aG9SZXNwb25zZRJfCg9Gb3JjZURpc2Nvbm5lY3QSMC5ibmV0LnByb3RvY29s" + - "LmNvbm5lY3Rpb24uRGlzY29ubmVjdE5vdGlmaWNhdGlvbhoaLmJuZXQucHJv" + - "dG9jb2wuTk9fUkVTUE9OU0USSQoETnVsbBIlLmJuZXQucHJvdG9jb2wuY29u" + - "bmVjdGlvbi5OdWxsUmVxdWVzdBoaLmJuZXQucHJvdG9jb2wuTk9fUkVTUE9O" + - "U0USSgoHRW5jcnlwdBIoLmJuZXQucHJvdG9jb2wuY29ubmVjdGlvbi5FbmNy" + - "eXB0UmVxdWVzdBoVLmJuZXQucHJvdG9jb2wuTm9EYXRhElwKEVJlcXVlc3RE" + - "aXNjb25uZWN0EisuYm5ldC5wcm90b2NvbC5jb25uZWN0aW9uLkRpc2Nvbm5l" + - "Y3RSZXF1ZXN0GhouYm5ldC5wcm90b2NvbC5OT19SRVNQT05TRUIDgAEB"); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_bnet_protocol_connection_ConnectRequest__Descriptor = Descriptor.MessageTypes[0]; - internal__static_bnet_protocol_connection_ConnectRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_connection_ConnectRequest__Descriptor, - new string[] { "ClientId", }); - internal__static_bnet_protocol_connection_ConnectResponse__Descriptor = Descriptor.MessageTypes[1]; - internal__static_bnet_protocol_connection_ConnectResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_connection_ConnectResponse__Descriptor, - new string[] { "ServerId", "ClientId", }); - internal__static_bnet_protocol_connection_BoundService__Descriptor = Descriptor.MessageTypes[2]; - internal__static_bnet_protocol_connection_BoundService__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_connection_BoundService__Descriptor, - new string[] { "Hash", "Id", }); - internal__static_bnet_protocol_connection_BindRequest__Descriptor = Descriptor.MessageTypes[3]; - internal__static_bnet_protocol_connection_BindRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_connection_BindRequest__Descriptor, - new string[] { "ImportedServiceHash", "ExportedService", }); - internal__static_bnet_protocol_connection_BindResponse__Descriptor = Descriptor.MessageTypes[4]; - internal__static_bnet_protocol_connection_BindResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_connection_BindResponse__Descriptor, - new string[] { "ImportedServiceId", }); - internal__static_bnet_protocol_connection_EchoRequest__Descriptor = Descriptor.MessageTypes[5]; - internal__static_bnet_protocol_connection_EchoRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_connection_EchoRequest__Descriptor, - new string[] { "Time", "NetworkOnly", "Payload", }); - internal__static_bnet_protocol_connection_EchoResponse__Descriptor = Descriptor.MessageTypes[6]; - internal__static_bnet_protocol_connection_EchoResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_connection_EchoResponse__Descriptor, - new string[] { "Time", "Payload", }); - internal__static_bnet_protocol_connection_DisconnectRequest__Descriptor = Descriptor.MessageTypes[7]; - internal__static_bnet_protocol_connection_DisconnectRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_connection_DisconnectRequest__Descriptor, - new string[] { "ErrorCode", }); - internal__static_bnet_protocol_connection_DisconnectNotification__Descriptor = Descriptor.MessageTypes[8]; - internal__static_bnet_protocol_connection_DisconnectNotification__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_connection_DisconnectNotification__Descriptor, - new string[] { "ErrorCode", "Reason", }); - internal__static_bnet_protocol_connection_NullRequest__Descriptor = Descriptor.MessageTypes[9]; - internal__static_bnet_protocol_connection_NullRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_connection_NullRequest__Descriptor, - new string[] { }); - internal__static_bnet_protocol_connection_EncryptRequest__Descriptor = Descriptor.MessageTypes[10]; - internal__static_bnet_protocol_connection_EncryptRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_connection_EncryptRequest__Descriptor, - new string[] { }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::bnet.protocol.Rpc.Descriptor, - }, assigner); - } - #endregion + namespace Proto { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class ConnectionService { + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_bnet_protocol_connection_ConnectRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_connection_ConnectRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_connection_ConnectionMeteringContentHandles__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_connection_ConnectionMeteringContentHandles__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_connection_ConnectResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_connection_ConnectResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_connection_BoundService__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_connection_BoundService__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_connection_BindRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_connection_BindRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_connection_BindResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_connection_BindResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_connection_EchoRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_connection_EchoRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_connection_EchoResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_connection_EchoResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_connection_DisconnectRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_connection_DisconnectRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_connection_DisconnectNotification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_connection_DisconnectNotification__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_connection_NullRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_connection_NullRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_connection_EncryptRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_connection_EncryptRequest__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static ConnectionService() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "Ch1ibmV0L2Nvbm5lY3Rpb25fc2VydmljZS5wcm90bxIYYm5ldC5wcm90b2Nv" + + "bC5jb25uZWN0aW9uGhlibmV0L2NvbnRlbnRfaGFuZGxlLnByb3RvGg5ibmV0" + + "L3JwYy5wcm90byJ6Cg5Db25uZWN0UmVxdWVzdBIrCgljbGllbnRfaWQYASAB" + + "KAsyGC5ibmV0LnByb3RvY29sLlByb2Nlc3NJZBI7CgxiaW5kX3JlcXVlc3QY" + + "AiABKAsyJS5ibmV0LnByb3RvY29sLmNvbm5lY3Rpb24uQmluZFJlcXVlc3Qi" + + "WAogQ29ubmVjdGlvbk1ldGVyaW5nQ29udGVudEhhbmRsZXMSNAoOY29udGVu" + + "dF9oYW5kbGUYASADKAsyHC5ibmV0LnByb3RvY29sLkNvbnRlbnRIYW5kbGUi" + + "mQIKD0Nvbm5lY3RSZXNwb25zZRIrCglzZXJ2ZXJfaWQYASACKAsyGC5ibmV0" + + "LnByb3RvY29sLlByb2Nlc3NJZBIrCgljbGllbnRfaWQYAiABKAsyGC5ibmV0" + + "LnByb3RvY29sLlByb2Nlc3NJZBITCgtiaW5kX3Jlc3VsdBgDIAEoDRI9Cg1i" + + "aW5kX3Jlc3BvbnNlGAQgASgLMiYuYm5ldC5wcm90b2NvbC5jb25uZWN0aW9u" + + "LkJpbmRSZXNwb25zZRJYChRjb250ZW50X2hhbmRsZV9hcnJheRgFIAEoCzI6" + + "LmJuZXQucHJvdG9jb2wuY29ubmVjdGlvbi5Db25uZWN0aW9uTWV0ZXJpbmdD" + + "b250ZW50SGFuZGxlcyIoCgxCb3VuZFNlcnZpY2USDAoEaGFzaBgBIAIoBxIK" + + "CgJpZBgCIAIoDSJyCgtCaW5kUmVxdWVzdBIhChVpbXBvcnRlZF9zZXJ2aWNl" + + "X2hhc2gYASADKAdCAhABEkAKEGV4cG9ydGVkX3NlcnZpY2UYAiADKAsyJi5i" + + "bmV0LnByb3RvY29sLmNvbm5lY3Rpb24uQm91bmRTZXJ2aWNlIi8KDEJpbmRS" + + "ZXNwb25zZRIfChNpbXBvcnRlZF9zZXJ2aWNlX2lkGAEgAygNQgIQASJJCgtF" + + "Y2hvUmVxdWVzdBIMCgR0aW1lGAEgASgGEhsKDG5ldHdvcmtfb25seRgCIAEo" + + "CDoFZmFsc2USDwoHcGF5bG9hZBgDIAEoDCItCgxFY2hvUmVzcG9uc2USDAoE" + + "dGltZRgBIAEoBhIPCgdwYXlsb2FkGAIgASgMIicKEURpc2Nvbm5lY3RSZXF1" + + "ZXN0EhIKCmVycm9yX2NvZGUYASACKA0iPAoWRGlzY29ubmVjdE5vdGlmaWNh" + + "dGlvbhISCgplcnJvcl9jb2RlGAEgAigNEg4KBnJlYXNvbhgCIAEoCSINCgtO" + + "dWxsUmVxdWVzdCIQCg5FbmNyeXB0UmVxdWVzdDKhBQoRQ29ubmVjdGlvblNl" + + "cnZpY2USZAoHQ29ubmVjdBIoLmJuZXQucHJvdG9jb2wuY29ubmVjdGlvbi5D" + + "b25uZWN0UmVxdWVzdBopLmJuZXQucHJvdG9jb2wuY29ubmVjdGlvbi5Db25u" + + "ZWN0UmVzcG9uc2UiBIC1GAESWwoEQmluZBIlLmJuZXQucHJvdG9jb2wuY29u" + + "bmVjdGlvbi5CaW5kUmVxdWVzdBomLmJuZXQucHJvdG9jb2wuY29ubmVjdGlv" + + "bi5CaW5kUmVzcG9uc2UiBIC1GAISWwoERWNobxIlLmJuZXQucHJvdG9jb2wu" + + "Y29ubmVjdGlvbi5FY2hvUmVxdWVzdBomLmJuZXQucHJvdG9jb2wuY29ubmVj" + + "dGlvbi5FY2hvUmVzcG9uc2UiBIC1GAMSZQoPRm9yY2VEaXNjb25uZWN0EjAu" + + "Ym5ldC5wcm90b2NvbC5jb25uZWN0aW9uLkRpc2Nvbm5lY3ROb3RpZmljYXRp" + + "b24aGi5ibmV0LnByb3RvY29sLk5PX1JFU1BPTlNFIgSAtRgEEk8KBE51bGwS" + + "JS5ibmV0LnByb3RvY29sLmNvbm5lY3Rpb24uTnVsbFJlcXVlc3QaGi5ibmV0" + + "LnByb3RvY29sLk5PX1JFU1BPTlNFIgSAtRgFElAKB0VuY3J5cHQSKC5ibmV0" + + "LnByb3RvY29sLmNvbm5lY3Rpb24uRW5jcnlwdFJlcXVlc3QaFS5ibmV0LnBy" + + "b3RvY29sLk5vRGF0YSIEgLUYBhJiChFSZXF1ZXN0RGlzY29ubmVjdBIrLmJu" + + "ZXQucHJvdG9jb2wuY29ubmVjdGlvbi5EaXNjb25uZWN0UmVxdWVzdBoaLmJu" + + "ZXQucHJvdG9jb2wuTk9fUkVTUE9OU0UiBIC1GAdCA4ABAA=="); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_bnet_protocol_connection_ConnectRequest__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_connection_ConnectRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_connection_ConnectRequest__Descriptor, + new string[] { "ClientId", "BindRequest", }); + internal__static_bnet_protocol_connection_ConnectionMeteringContentHandles__Descriptor = Descriptor.MessageTypes[1]; + internal__static_bnet_protocol_connection_ConnectionMeteringContentHandles__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_connection_ConnectionMeteringContentHandles__Descriptor, + new string[] { "ContentHandle", }); + internal__static_bnet_protocol_connection_ConnectResponse__Descriptor = Descriptor.MessageTypes[2]; + internal__static_bnet_protocol_connection_ConnectResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_connection_ConnectResponse__Descriptor, + new string[] { "ServerId", "ClientId", "BindResult", "BindResponse", "ContentHandleArray", }); + internal__static_bnet_protocol_connection_BoundService__Descriptor = Descriptor.MessageTypes[3]; + internal__static_bnet_protocol_connection_BoundService__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_connection_BoundService__Descriptor, + new string[] { "Hash", "Id", }); + internal__static_bnet_protocol_connection_BindRequest__Descriptor = Descriptor.MessageTypes[4]; + internal__static_bnet_protocol_connection_BindRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_connection_BindRequest__Descriptor, + new string[] { "ImportedServiceHash", "ExportedService", }); + internal__static_bnet_protocol_connection_BindResponse__Descriptor = Descriptor.MessageTypes[5]; + internal__static_bnet_protocol_connection_BindResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_connection_BindResponse__Descriptor, + new string[] { "ImportedServiceId", }); + internal__static_bnet_protocol_connection_EchoRequest__Descriptor = Descriptor.MessageTypes[6]; + internal__static_bnet_protocol_connection_EchoRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_connection_EchoRequest__Descriptor, + new string[] { "Time", "NetworkOnly", "Payload", }); + internal__static_bnet_protocol_connection_EchoResponse__Descriptor = Descriptor.MessageTypes[7]; + internal__static_bnet_protocol_connection_EchoResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_connection_EchoResponse__Descriptor, + new string[] { "Time", "Payload", }); + internal__static_bnet_protocol_connection_DisconnectRequest__Descriptor = Descriptor.MessageTypes[8]; + internal__static_bnet_protocol_connection_DisconnectRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_connection_DisconnectRequest__Descriptor, + new string[] { "ErrorCode", }); + internal__static_bnet_protocol_connection_DisconnectNotification__Descriptor = Descriptor.MessageTypes[9]; + internal__static_bnet_protocol_connection_DisconnectNotification__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_connection_DisconnectNotification__Descriptor, + new string[] { "ErrorCode", "Reason", }); + internal__static_bnet_protocol_connection_NullRequest__Descriptor = Descriptor.MessageTypes[10]; + internal__static_bnet_protocol_connection_NullRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_connection_NullRequest__Descriptor, + new string[] { }); + internal__static_bnet_protocol_connection_EncryptRequest__Descriptor = Descriptor.MessageTypes[11]; + internal__static_bnet_protocol_connection_EncryptRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_connection_EncryptRequest__Descriptor, + new string[] { }); + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + RegisterAllExtensions(registry); + global::bnet.protocol.Proto.ContentHandle.RegisterAllExtensions(registry); + global::bnet.protocol.Rpc.RegisterAllExtensions(registry); + return registry; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::bnet.protocol.Proto.ContentHandle.Descriptor, + global::bnet.protocol.Rpc.Descriptor, + }, assigner); + } + #endregion + + } } #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class ConnectRequest : pb::GeneratedMessage { - private static readonly ConnectRequest defaultInstance = new Builder().BuildPartial(); + private ConnectRequest() { } + private static readonly ConnectRequest defaultInstance = new ConnectRequest().MakeReadOnly(); + private static readonly string[] _connectRequestFieldNames = new string[] { "bind_request", "client_id" }; + private static readonly uint[] _connectRequestFieldTags = new uint[] { 18, 10 }; public static ConnectRequest DefaultInstance { get { return defaultInstance; } } public override ConnectRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ConnectRequest ThisMessage { @@ -146,21 +180,31 @@ protected override ConnectRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.connection.Connection.internal__static_bnet_protocol_connection_ConnectRequest__Descriptor; } + get { return global::bnet.protocol.connection.Proto.ConnectionService.internal__static_bnet_protocol_connection_ConnectRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.connection.Connection.internal__static_bnet_protocol_connection_ConnectRequest__FieldAccessorTable; } + get { return global::bnet.protocol.connection.Proto.ConnectionService.internal__static_bnet_protocol_connection_ConnectRequest__FieldAccessorTable; } } public const int ClientIdFieldNumber = 1; private bool hasClientId; - private global::bnet.protocol.ProcessId clientId_ = global::bnet.protocol.ProcessId.DefaultInstance; + private global::bnet.protocol.ProcessId clientId_; public bool HasClientId { get { return hasClientId; } } public global::bnet.protocol.ProcessId ClientId { - get { return clientId_; } + get { return clientId_ ?? global::bnet.protocol.ProcessId.DefaultInstance; } + } + + public const int BindRequestFieldNumber = 2; + private bool hasBindRequest; + private global::bnet.protocol.connection.BindRequest bindRequest_; + public bool HasBindRequest { + get { return hasBindRequest; } + } + public global::bnet.protocol.connection.BindRequest BindRequest { + get { return bindRequest_ ?? global::bnet.protocol.connection.BindRequest.DefaultInstance; } } public override bool IsInitialized { @@ -168,14 +212,21 @@ public override bool IsInitialized { if (HasClientId) { if (!ClientId.IsInitialized) return false; } + if (HasBindRequest) { + if (!BindRequest.IsInitialized) return false; + } return true; } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasClientId) { - output.WriteMessage(1, ClientId); + string[] field_names = _connectRequestFieldNames; + if (hasClientId) { + output.WriteMessage(1, field_names[1], ClientId); + } + if (hasBindRequest) { + output.WriteMessage(2, field_names[0], BindRequest); } UnknownFields.WriteTo(output); } @@ -187,9 +238,12 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasClientId) { + if (hasClientId) { size += pb::CodedOutputStream.ComputeMessageSize(1, ClientId); } + if (hasBindRequest) { + size += pb::CodedOutputStream.ComputeMessageSize(2, BindRequest); + } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; return size; @@ -220,38 +274,72 @@ public static ConnectRequest ParseDelimitedFrom(global::System.IO.Stream input) public static ConnectRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static ConnectRequest ParseFrom(pb::CodedInputStream input) { + public static ConnectRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ConnectRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static ConnectRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private ConnectRequest MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(ConnectRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ConnectRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - ConnectRequest result = new ConnectRequest(); + private bool resultIsReadOnly; + private ConnectRequest result; + + private ConnectRequest PrepareBuilder() { + if (resultIsReadOnly) { + ConnectRequest original = result; + result = new ConnectRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override ConnectRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ConnectRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -263,12 +351,11 @@ public override ConnectRequest DefaultInstanceForType { } public override ConnectRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - ConnectRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -282,27 +369,42 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(ConnectRequest other) { if (other == global::bnet.protocol.connection.ConnectRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasClientId) { MergeClientId(other.ClientId); } + if (other.HasBindRequest) { + MergeBindRequest(other.BindRequest); + } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_connectRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _connectRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -314,25 +416,39 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.ProcessId.Builder subBuilder = global::bnet.protocol.ProcessId.CreateBuilder(); - if (HasClientId) { + if (result.hasClientId) { subBuilder.MergeFrom(ClientId); } input.ReadMessage(subBuilder, extensionRegistry); ClientId = subBuilder.BuildPartial(); break; } + case 18: { + global::bnet.protocol.connection.BindRequest.Builder subBuilder = global::bnet.protocol.connection.BindRequest.CreateBuilder(); + if (result.hasBindRequest) { + subBuilder.MergeFrom(BindRequest); + } + input.ReadMessage(subBuilder, extensionRegistry); + BindRequest = subBuilder.BuildPartial(); + break; + } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasClientId { - get { return result.HasClientId; } + get { return result.hasClientId; } } public global::bnet.protocol.ProcessId ClientId { get { return result.ClientId; } @@ -340,19 +456,22 @@ public bool HasClientId { } public Builder SetClientId(global::bnet.protocol.ProcessId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasClientId = true; result.clientId_ = value; return this; } public Builder SetClientId(global::bnet.protocol.ProcessId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasClientId = true; result.clientId_ = builderForValue.Build(); return this; } public Builder MergeClientId(global::bnet.protocol.ProcessId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasClientId && + PrepareBuilder(); + if (result.hasClientId && result.clientId_ != global::bnet.protocol.ProcessId.DefaultInstance) { result.clientId_ = global::bnet.protocol.ProcessId.CreateBuilder(result.clientId_).MergeFrom(value).BuildPartial(); } else { @@ -362,24 +481,375 @@ public Builder MergeClientId(global::bnet.protocol.ProcessId value) { return this; } public Builder ClearClientId() { + PrepareBuilder(); result.hasClientId = false; - result.clientId_ = global::bnet.protocol.ProcessId.DefaultInstance; + result.clientId_ = null; + return this; + } + + public bool HasBindRequest { + get { return result.hasBindRequest; } + } + public global::bnet.protocol.connection.BindRequest BindRequest { + get { return result.BindRequest; } + set { SetBindRequest(value); } + } + public Builder SetBindRequest(global::bnet.protocol.connection.BindRequest value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBindRequest = true; + result.bindRequest_ = value; + return this; + } + public Builder SetBindRequest(global::bnet.protocol.connection.BindRequest.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBindRequest = true; + result.bindRequest_ = builderForValue.Build(); + return this; + } + public Builder MergeBindRequest(global::bnet.protocol.connection.BindRequest value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBindRequest && + result.bindRequest_ != global::bnet.protocol.connection.BindRequest.DefaultInstance) { + result.bindRequest_ = global::bnet.protocol.connection.BindRequest.CreateBuilder(result.bindRequest_).MergeFrom(value).BuildPartial(); + } else { + result.bindRequest_ = value; + } + result.hasBindRequest = true; + return this; + } + public Builder ClearBindRequest() { + PrepareBuilder(); + result.hasBindRequest = false; + result.bindRequest_ = null; return this; } } static ConnectRequest() { - object.ReferenceEquals(global::bnet.protocol.connection.Connection.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.connection.Proto.ConnectionService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ConnectionMeteringContentHandles : pb::GeneratedMessage { + private ConnectionMeteringContentHandles() { } + private static readonly ConnectionMeteringContentHandles defaultInstance = new ConnectionMeteringContentHandles().MakeReadOnly(); + private static readonly string[] _connectionMeteringContentHandlesFieldNames = new string[] { "content_handle" }; + private static readonly uint[] _connectionMeteringContentHandlesFieldTags = new uint[] { 10 }; + public static ConnectionMeteringContentHandles DefaultInstance { + get { return defaultInstance; } + } + + public override ConnectionMeteringContentHandles DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ConnectionMeteringContentHandles ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.connection.Proto.ConnectionService.internal__static_bnet_protocol_connection_ConnectionMeteringContentHandles__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.connection.Proto.ConnectionService.internal__static_bnet_protocol_connection_ConnectionMeteringContentHandles__FieldAccessorTable; } + } + + public const int ContentHandleFieldNumber = 1; + private pbc::PopsicleList contentHandle_ = new pbc::PopsicleList(); + public scg::IList ContentHandleList { + get { return contentHandle_; } + } + public int ContentHandleCount { + get { return contentHandle_.Count; } + } + public global::bnet.protocol.ContentHandle GetContentHandle(int index) { + return contentHandle_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.ContentHandle element in ContentHandleList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _connectionMeteringContentHandlesFieldNames; + if (contentHandle_.Count > 0) { + output.WriteMessageArray(1, field_names[0], contentHandle_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.ContentHandle element in ContentHandleList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ConnectionMeteringContentHandles ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ConnectionMeteringContentHandles ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ConnectionMeteringContentHandles ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ConnectionMeteringContentHandles ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ConnectionMeteringContentHandles ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ConnectionMeteringContentHandles ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ConnectionMeteringContentHandles ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ConnectionMeteringContentHandles ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ConnectionMeteringContentHandles ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ConnectionMeteringContentHandles ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ConnectionMeteringContentHandles MakeReadOnly() { + contentHandle_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ConnectionMeteringContentHandles prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ConnectionMeteringContentHandles cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ConnectionMeteringContentHandles result; + + private ConnectionMeteringContentHandles PrepareBuilder() { + if (resultIsReadOnly) { + ConnectionMeteringContentHandles original = result; + result = new ConnectionMeteringContentHandles(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ConnectionMeteringContentHandles MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.connection.ConnectionMeteringContentHandles.Descriptor; } + } + + public override ConnectionMeteringContentHandles DefaultInstanceForType { + get { return global::bnet.protocol.connection.ConnectionMeteringContentHandles.DefaultInstance; } + } + + public override ConnectionMeteringContentHandles BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ConnectionMeteringContentHandles) { + return MergeFrom((ConnectionMeteringContentHandles) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ConnectionMeteringContentHandles other) { + if (other == global::bnet.protocol.connection.ConnectionMeteringContentHandles.DefaultInstance) return this; + PrepareBuilder(); + if (other.contentHandle_.Count != 0) { + result.contentHandle_.Add(other.contentHandle_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_connectionMeteringContentHandlesFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _connectionMeteringContentHandlesFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.contentHandle_, global::bnet.protocol.ContentHandle.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList ContentHandleList { + get { return PrepareBuilder().contentHandle_; } + } + public int ContentHandleCount { + get { return result.ContentHandleCount; } + } + public global::bnet.protocol.ContentHandle GetContentHandle(int index) { + return result.GetContentHandle(index); + } + public Builder SetContentHandle(int index, global::bnet.protocol.ContentHandle value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.contentHandle_[index] = value; + return this; + } + public Builder SetContentHandle(int index, global::bnet.protocol.ContentHandle.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.contentHandle_[index] = builderForValue.Build(); + return this; + } + public Builder AddContentHandle(global::bnet.protocol.ContentHandle value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.contentHandle_.Add(value); + return this; + } + public Builder AddContentHandle(global::bnet.protocol.ContentHandle.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.contentHandle_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeContentHandle(scg::IEnumerable values) { + PrepareBuilder(); + result.contentHandle_.Add(values); + return this; + } + public Builder ClearContentHandle() { + PrepareBuilder(); + result.contentHandle_.Clear(); + return this; + } + } + static ConnectionMeteringContentHandles() { + object.ReferenceEquals(global::bnet.protocol.connection.Proto.ConnectionService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class ConnectResponse : pb::GeneratedMessage { - private static readonly ConnectResponse defaultInstance = new Builder().BuildPartial(); + private ConnectResponse() { } + private static readonly ConnectResponse defaultInstance = new ConnectResponse().MakeReadOnly(); + private static readonly string[] _connectResponseFieldNames = new string[] { "bind_response", "bind_result", "client_id", "content_handle_array", "server_id" }; + private static readonly uint[] _connectResponseFieldTags = new uint[] { 34, 24, 18, 42, 10 }; public static ConnectResponse DefaultInstance { get { return defaultInstance; } } public override ConnectResponse DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ConnectResponse ThisMessage { @@ -387,31 +857,61 @@ protected override ConnectResponse ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.connection.Connection.internal__static_bnet_protocol_connection_ConnectResponse__Descriptor; } + get { return global::bnet.protocol.connection.Proto.ConnectionService.internal__static_bnet_protocol_connection_ConnectResponse__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.connection.Connection.internal__static_bnet_protocol_connection_ConnectResponse__FieldAccessorTable; } + get { return global::bnet.protocol.connection.Proto.ConnectionService.internal__static_bnet_protocol_connection_ConnectResponse__FieldAccessorTable; } } public const int ServerIdFieldNumber = 1; private bool hasServerId; - private global::bnet.protocol.ProcessId serverId_ = global::bnet.protocol.ProcessId.DefaultInstance; + private global::bnet.protocol.ProcessId serverId_; public bool HasServerId { get { return hasServerId; } } public global::bnet.protocol.ProcessId ServerId { - get { return serverId_; } + get { return serverId_ ?? global::bnet.protocol.ProcessId.DefaultInstance; } } public const int ClientIdFieldNumber = 2; private bool hasClientId; - private global::bnet.protocol.ProcessId clientId_ = global::bnet.protocol.ProcessId.DefaultInstance; + private global::bnet.protocol.ProcessId clientId_; public bool HasClientId { get { return hasClientId; } } public global::bnet.protocol.ProcessId ClientId { - get { return clientId_; } + get { return clientId_ ?? global::bnet.protocol.ProcessId.DefaultInstance; } + } + + public const int BindResultFieldNumber = 3; + private bool hasBindResult; + private uint bindResult_; + public bool HasBindResult { + get { return hasBindResult; } + } + public uint BindResult { + get { return bindResult_; } + } + + public const int BindResponseFieldNumber = 4; + private bool hasBindResponse; + private global::bnet.protocol.connection.BindResponse bindResponse_; + public bool HasBindResponse { + get { return hasBindResponse; } + } + public global::bnet.protocol.connection.BindResponse BindResponse { + get { return bindResponse_ ?? global::bnet.protocol.connection.BindResponse.DefaultInstance; } + } + + public const int ContentHandleArrayFieldNumber = 5; + private bool hasContentHandleArray; + private global::bnet.protocol.connection.ConnectionMeteringContentHandles contentHandleArray_; + public bool HasContentHandleArray { + get { return hasContentHandleArray; } + } + public global::bnet.protocol.connection.ConnectionMeteringContentHandles ContentHandleArray { + get { return contentHandleArray_ ?? global::bnet.protocol.connection.ConnectionMeteringContentHandles.DefaultInstance; } } public override bool IsInitialized { @@ -421,17 +921,30 @@ public override bool IsInitialized { if (HasClientId) { if (!ClientId.IsInitialized) return false; } + if (HasContentHandleArray) { + if (!ContentHandleArray.IsInitialized) return false; + } return true; } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasServerId) { - output.WriteMessage(1, ServerId); + string[] field_names = _connectResponseFieldNames; + if (hasServerId) { + output.WriteMessage(1, field_names[4], ServerId); + } + if (hasClientId) { + output.WriteMessage(2, field_names[2], ClientId); + } + if (hasBindResult) { + output.WriteUInt32(3, field_names[1], BindResult); } - if (HasClientId) { - output.WriteMessage(2, ClientId); + if (hasBindResponse) { + output.WriteMessage(4, field_names[0], BindResponse); + } + if (hasContentHandleArray) { + output.WriteMessage(5, field_names[3], ContentHandleArray); } UnknownFields.WriteTo(output); } @@ -443,12 +956,21 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasServerId) { + if (hasServerId) { size += pb::CodedOutputStream.ComputeMessageSize(1, ServerId); } - if (HasClientId) { + if (hasClientId) { size += pb::CodedOutputStream.ComputeMessageSize(2, ClientId); } + if (hasBindResult) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, BindResult); + } + if (hasBindResponse) { + size += pb::CodedOutputStream.ComputeMessageSize(4, BindResponse); + } + if (hasContentHandleArray) { + size += pb::CodedOutputStream.ComputeMessageSize(5, ContentHandleArray); + } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; return size; @@ -479,38 +1001,72 @@ public static ConnectResponse ParseDelimitedFrom(global::System.IO.Stream input) public static ConnectResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static ConnectResponse ParseFrom(pb::CodedInputStream input) { + public static ConnectResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ConnectResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static ConnectResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private ConnectResponse MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(ConnectResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ConnectResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ConnectResponse result; + + private ConnectResponse PrepareBuilder() { + if (resultIsReadOnly) { + ConnectResponse original = result; + result = new ConnectResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - ConnectResponse result = new ConnectResponse(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override ConnectResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ConnectResponse(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -522,12 +1078,11 @@ public override ConnectResponse DefaultInstanceForType { } public override ConnectResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - ConnectResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -541,30 +1096,51 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(ConnectResponse other) { if (other == global::bnet.protocol.connection.ConnectResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.HasServerId) { MergeServerId(other.ServerId); } if (other.HasClientId) { MergeClientId(other.ClientId); } + if (other.HasBindResult) { + BindResult = other.BindResult; + } + if (other.HasBindResponse) { + MergeBindResponse(other.BindResponse); + } + if (other.HasContentHandleArray) { + MergeContentHandleArray(other.ContentHandleArray); + } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_connectResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _connectResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -576,12 +1152,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.ProcessId.Builder subBuilder = global::bnet.protocol.ProcessId.CreateBuilder(); - if (HasServerId) { + if (result.hasServerId) { subBuilder.MergeFrom(ServerId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -590,20 +1166,47 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.ProcessId.Builder subBuilder = global::bnet.protocol.ProcessId.CreateBuilder(); - if (HasClientId) { + if (result.hasClientId) { subBuilder.MergeFrom(ClientId); } input.ReadMessage(subBuilder, extensionRegistry); ClientId = subBuilder.BuildPartial(); break; } + case 24: { + result.hasBindResult = input.ReadUInt32(ref result.bindResult_); + break; + } + case 34: { + global::bnet.protocol.connection.BindResponse.Builder subBuilder = global::bnet.protocol.connection.BindResponse.CreateBuilder(); + if (result.hasBindResponse) { + subBuilder.MergeFrom(BindResponse); + } + input.ReadMessage(subBuilder, extensionRegistry); + BindResponse = subBuilder.BuildPartial(); + break; + } + case 42: { + global::bnet.protocol.connection.ConnectionMeteringContentHandles.Builder subBuilder = global::bnet.protocol.connection.ConnectionMeteringContentHandles.CreateBuilder(); + if (result.hasContentHandleArray) { + subBuilder.MergeFrom(ContentHandleArray); + } + input.ReadMessage(subBuilder, extensionRegistry); + ContentHandleArray = subBuilder.BuildPartial(); + break; + } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasServerId { - get { return result.HasServerId; } + get { return result.hasServerId; } } public global::bnet.protocol.ProcessId ServerId { get { return result.ServerId; } @@ -611,19 +1214,22 @@ public bool HasServerId { } public Builder SetServerId(global::bnet.protocol.ProcessId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasServerId = true; result.serverId_ = value; return this; } public Builder SetServerId(global::bnet.protocol.ProcessId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasServerId = true; result.serverId_ = builderForValue.Build(); return this; } public Builder MergeServerId(global::bnet.protocol.ProcessId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasServerId && + PrepareBuilder(); + if (result.hasServerId && result.serverId_ != global::bnet.protocol.ProcessId.DefaultInstance) { result.serverId_ = global::bnet.protocol.ProcessId.CreateBuilder(result.serverId_).MergeFrom(value).BuildPartial(); } else { @@ -633,13 +1239,14 @@ public Builder MergeServerId(global::bnet.protocol.ProcessId value) { return this; } public Builder ClearServerId() { + PrepareBuilder(); result.hasServerId = false; - result.serverId_ = global::bnet.protocol.ProcessId.DefaultInstance; + result.serverId_ = null; return this; } public bool HasClientId { - get { return result.HasClientId; } + get { return result.hasClientId; } } public global::bnet.protocol.ProcessId ClientId { get { return result.ClientId; } @@ -647,19 +1254,22 @@ public bool HasClientId { } public Builder SetClientId(global::bnet.protocol.ProcessId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasClientId = true; result.clientId_ = value; return this; } public Builder SetClientId(global::bnet.protocol.ProcessId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasClientId = true; result.clientId_ = builderForValue.Build(); return this; } public Builder MergeClientId(global::bnet.protocol.ProcessId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasClientId && + PrepareBuilder(); + if (result.hasClientId && result.clientId_ != global::bnet.protocol.ProcessId.DefaultInstance) { result.clientId_ = global::bnet.protocol.ProcessId.CreateBuilder(result.clientId_).MergeFrom(value).BuildPartial(); } else { @@ -669,24 +1279,131 @@ public Builder MergeClientId(global::bnet.protocol.ProcessId value) { return this; } public Builder ClearClientId() { + PrepareBuilder(); result.hasClientId = false; - result.clientId_ = global::bnet.protocol.ProcessId.DefaultInstance; + result.clientId_ = null; + return this; + } + + public bool HasBindResult { + get { return result.hasBindResult; } + } + public uint BindResult { + get { return result.BindResult; } + set { SetBindResult(value); } + } + public Builder SetBindResult(uint value) { + PrepareBuilder(); + result.hasBindResult = true; + result.bindResult_ = value; + return this; + } + public Builder ClearBindResult() { + PrepareBuilder(); + result.hasBindResult = false; + result.bindResult_ = 0; + return this; + } + + public bool HasBindResponse { + get { return result.hasBindResponse; } + } + public global::bnet.protocol.connection.BindResponse BindResponse { + get { return result.BindResponse; } + set { SetBindResponse(value); } + } + public Builder SetBindResponse(global::bnet.protocol.connection.BindResponse value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBindResponse = true; + result.bindResponse_ = value; + return this; + } + public Builder SetBindResponse(global::bnet.protocol.connection.BindResponse.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBindResponse = true; + result.bindResponse_ = builderForValue.Build(); + return this; + } + public Builder MergeBindResponse(global::bnet.protocol.connection.BindResponse value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBindResponse && + result.bindResponse_ != global::bnet.protocol.connection.BindResponse.DefaultInstance) { + result.bindResponse_ = global::bnet.protocol.connection.BindResponse.CreateBuilder(result.bindResponse_).MergeFrom(value).BuildPartial(); + } else { + result.bindResponse_ = value; + } + result.hasBindResponse = true; + return this; + } + public Builder ClearBindResponse() { + PrepareBuilder(); + result.hasBindResponse = false; + result.bindResponse_ = null; + return this; + } + + public bool HasContentHandleArray { + get { return result.hasContentHandleArray; } + } + public global::bnet.protocol.connection.ConnectionMeteringContentHandles ContentHandleArray { + get { return result.ContentHandleArray; } + set { SetContentHandleArray(value); } + } + public Builder SetContentHandleArray(global::bnet.protocol.connection.ConnectionMeteringContentHandles value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasContentHandleArray = true; + result.contentHandleArray_ = value; + return this; + } + public Builder SetContentHandleArray(global::bnet.protocol.connection.ConnectionMeteringContentHandles.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasContentHandleArray = true; + result.contentHandleArray_ = builderForValue.Build(); + return this; + } + public Builder MergeContentHandleArray(global::bnet.protocol.connection.ConnectionMeteringContentHandles value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasContentHandleArray && + result.contentHandleArray_ != global::bnet.protocol.connection.ConnectionMeteringContentHandles.DefaultInstance) { + result.contentHandleArray_ = global::bnet.protocol.connection.ConnectionMeteringContentHandles.CreateBuilder(result.contentHandleArray_).MergeFrom(value).BuildPartial(); + } else { + result.contentHandleArray_ = value; + } + result.hasContentHandleArray = true; + return this; + } + public Builder ClearContentHandleArray() { + PrepareBuilder(); + result.hasContentHandleArray = false; + result.contentHandleArray_ = null; return this; } } static ConnectResponse() { - object.ReferenceEquals(global::bnet.protocol.connection.Connection.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.connection.Proto.ConnectionService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class BoundService : pb::GeneratedMessage { - private static readonly BoundService defaultInstance = new Builder().BuildPartial(); + private BoundService() { } + private static readonly BoundService defaultInstance = new BoundService().MakeReadOnly(); + private static readonly string[] _boundServiceFieldNames = new string[] { "hash", "id" }; + private static readonly uint[] _boundServiceFieldTags = new uint[] { 13, 16 }; public static BoundService DefaultInstance { get { return defaultInstance; } } public override BoundService DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override BoundService ThisMessage { @@ -694,16 +1411,16 @@ protected override BoundService ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.connection.Connection.internal__static_bnet_protocol_connection_BoundService__Descriptor; } + get { return global::bnet.protocol.connection.Proto.ConnectionService.internal__static_bnet_protocol_connection_BoundService__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.connection.Connection.internal__static_bnet_protocol_connection_BoundService__FieldAccessorTable; } + get { return global::bnet.protocol.connection.Proto.ConnectionService.internal__static_bnet_protocol_connection_BoundService__FieldAccessorTable; } } public const int HashFieldNumber = 1; private bool hasHash; - private uint hash_ = 0; + private uint hash_; public bool HasHash { get { return hasHash; } } @@ -713,7 +1430,7 @@ public uint Hash { public const int IdFieldNumber = 2; private bool hasId; - private uint id_ = 0; + private uint id_; public bool HasId { get { return hasId; } } @@ -729,13 +1446,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasHash) { - output.WriteFixed32(1, Hash); + string[] field_names = _boundServiceFieldNames; + if (hasHash) { + output.WriteFixed32(1, field_names[0], Hash); } - if (HasId) { - output.WriteUInt32(2, Id); + if (hasId) { + output.WriteUInt32(2, field_names[1], Id); } UnknownFields.WriteTo(output); } @@ -747,10 +1465,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasHash) { + if (hasHash) { size += pb::CodedOutputStream.ComputeFixed32Size(1, Hash); } - if (HasId) { + if (hasId) { size += pb::CodedOutputStream.ComputeUInt32Size(2, Id); } size += UnknownFields.SerializedSize; @@ -783,38 +1501,72 @@ public static BoundService ParseDelimitedFrom(global::System.IO.Stream input) { public static BoundService ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static BoundService ParseFrom(pb::CodedInputStream input) { + public static BoundService ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static BoundService ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static BoundService ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private BoundService MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(BoundService prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(BoundService cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private BoundService result; + + private BoundService PrepareBuilder() { + if (resultIsReadOnly) { + BoundService original = result; + result = new BoundService(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - BoundService result = new BoundService(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override BoundService MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new BoundService(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -826,12 +1578,11 @@ public override BoundService DefaultInstanceForType { } public override BoundService BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - BoundService returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -845,6 +1596,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(BoundService other) { if (other == global::bnet.protocol.connection.BoundService.DefaultInstance) return this; + PrepareBuilder(); if (other.HasHash) { Hash = other.Hash; } @@ -855,20 +1607,31 @@ public override Builder MergeFrom(BoundService other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_boundServiceFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _boundServiceFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -880,71 +1643,86 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 13: { - Hash = input.ReadFixed32(); + result.hasHash = input.ReadFixed32(ref result.hash_); break; } case 16: { - Id = input.ReadUInt32(); + result.hasId = input.ReadUInt32(ref result.id_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasHash { - get { return result.HasHash; } + get { return result.hasHash; } } public uint Hash { get { return result.Hash; } set { SetHash(value); } } public Builder SetHash(uint value) { + PrepareBuilder(); result.hasHash = true; result.hash_ = value; return this; } public Builder ClearHash() { + PrepareBuilder(); result.hasHash = false; result.hash_ = 0; return this; } public bool HasId { - get { return result.HasId; } + get { return result.hasId; } } public uint Id { get { return result.Id; } set { SetId(value); } } public Builder SetId(uint value) { + PrepareBuilder(); result.hasId = true; result.id_ = value; return this; } public Builder ClearId() { + PrepareBuilder(); result.hasId = false; result.id_ = 0; return this; } } static BoundService() { - object.ReferenceEquals(global::bnet.protocol.connection.Connection.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.connection.Proto.ConnectionService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class BindRequest : pb::GeneratedMessage { - private static readonly BindRequest defaultInstance = new Builder().BuildPartial(); + private BindRequest() { } + private static readonly BindRequest defaultInstance = new BindRequest().MakeReadOnly(); + private static readonly string[] _bindRequestFieldNames = new string[] { "exported_service", "imported_service_hash" }; + private static readonly uint[] _bindRequestFieldTags = new uint[] { 18, 10 }; public static BindRequest DefaultInstance { get { return defaultInstance; } } public override BindRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override BindRequest ThisMessage { @@ -952,11 +1730,11 @@ protected override BindRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.connection.Connection.internal__static_bnet_protocol_connection_BindRequest__Descriptor; } + get { return global::bnet.protocol.connection.Proto.ConnectionService.internal__static_bnet_protocol_connection_BindRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.connection.Connection.internal__static_bnet_protocol_connection_BindRequest__FieldAccessorTable; } + get { return global::bnet.protocol.connection.Proto.ConnectionService.internal__static_bnet_protocol_connection_BindRequest__FieldAccessorTable; } } public const int ImportedServiceHashFieldNumber = 1; @@ -993,17 +1771,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; + string[] field_names = _bindRequestFieldNames; if (importedServiceHash_.Count > 0) { - output.WriteRawVarint32(10); - output.WriteRawVarint32((uint) importedServiceHashMemoizedSerializedSize); - foreach (uint element in importedServiceHash_) { - output.WriteFixed32NoTag(element); - } + output.WritePackedFixed32Array(1, field_names[1], importedServiceHashMemoizedSerializedSize, importedServiceHash_); } - foreach (global::bnet.protocol.connection.BoundService element in ExportedServiceList) { - output.WriteMessage(2, element); + if (exportedService_.Count > 0) { + output.WriteMessageArray(2, field_names[0], exportedService_); } UnknownFields.WriteTo(output); } @@ -1057,38 +1832,74 @@ public static BindRequest ParseDelimitedFrom(global::System.IO.Stream input) { public static BindRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static BindRequest ParseFrom(pb::CodedInputStream input) { + public static BindRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static BindRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static BindRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private BindRequest MakeReadOnly() { + importedServiceHash_.MakeReadOnly(); + exportedService_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(BindRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(BindRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private BindRequest result; + + private BindRequest PrepareBuilder() { + if (resultIsReadOnly) { + BindRequest original = result; + result = new BindRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - BindRequest result = new BindRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override BindRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new BindRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -1100,14 +1911,11 @@ public override BindRequest DefaultInstanceForType { } public override BindRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.importedServiceHash_.MakeReadOnly(); - result.exportedService_.MakeReadOnly(); - BindRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1121,30 +1929,42 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(BindRequest other) { if (other == global::bnet.protocol.connection.BindRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.importedServiceHash_.Count != 0) { - base.AddRange(other.importedServiceHash_, result.importedServiceHash_); + result.importedServiceHash_.Add(other.importedServiceHash_); } if (other.exportedService_.Count != 0) { - base.AddRange(other.exportedService_, result.exportedService_); + result.exportedService_.Add(other.exportedService_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_bindRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _bindRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1156,31 +1976,30 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } - case 10: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddImportedServiceHash(input.ReadFixed32()); - } - input.PopLimit(limit); + case 10: + case 13: { + input.ReadFixed32Array(tag, field_name, result.importedServiceHash_); break; } case 18: { - global::bnet.protocol.connection.BoundService.Builder subBuilder = global::bnet.protocol.connection.BoundService.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddExportedService(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.exportedService_, global::bnet.protocol.connection.BoundService.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public pbc::IPopsicleList ImportedServiceHashList { - get { return result.importedServiceHash_; } + get { return PrepareBuilder().importedServiceHash_; } } public int ImportedServiceHashCount { get { return result.ImportedServiceHashCount; } @@ -1189,24 +2008,28 @@ public uint GetImportedServiceHash(int index) { return result.GetImportedServiceHash(index); } public Builder SetImportedServiceHash(int index, uint value) { + PrepareBuilder(); result.importedServiceHash_[index] = value; return this; } public Builder AddImportedServiceHash(uint value) { + PrepareBuilder(); result.importedServiceHash_.Add(value); return this; } public Builder AddRangeImportedServiceHash(scg::IEnumerable values) { - base.AddRange(values, result.importedServiceHash_); + PrepareBuilder(); + result.importedServiceHash_.Add(values); return this; } public Builder ClearImportedServiceHash() { + PrepareBuilder(); result.importedServiceHash_.Clear(); return this; } public pbc::IPopsicleList ExportedServiceList { - get { return result.exportedService_; } + get { return PrepareBuilder().exportedService_; } } public int ExportedServiceCount { get { return result.ExportedServiceCount; } @@ -1216,46 +2039,58 @@ public int ExportedServiceCount { } public Builder SetExportedService(int index, global::bnet.protocol.connection.BoundService value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.exportedService_[index] = value; return this; } public Builder SetExportedService(int index, global::bnet.protocol.connection.BoundService.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.exportedService_[index] = builderForValue.Build(); return this; } public Builder AddExportedService(global::bnet.protocol.connection.BoundService value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.exportedService_.Add(value); return this; } public Builder AddExportedService(global::bnet.protocol.connection.BoundService.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.exportedService_.Add(builderForValue.Build()); return this; } public Builder AddRangeExportedService(scg::IEnumerable values) { - base.AddRange(values, result.exportedService_); + PrepareBuilder(); + result.exportedService_.Add(values); return this; } public Builder ClearExportedService() { + PrepareBuilder(); result.exportedService_.Clear(); return this; } } static BindRequest() { - object.ReferenceEquals(global::bnet.protocol.connection.Connection.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.connection.Proto.ConnectionService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class BindResponse : pb::GeneratedMessage { - private static readonly BindResponse defaultInstance = new Builder().BuildPartial(); + private BindResponse() { } + private static readonly BindResponse defaultInstance = new BindResponse().MakeReadOnly(); + private static readonly string[] _bindResponseFieldNames = new string[] { "imported_service_id" }; + private static readonly uint[] _bindResponseFieldTags = new uint[] { 10 }; public static BindResponse DefaultInstance { get { return defaultInstance; } } public override BindResponse DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override BindResponse ThisMessage { @@ -1263,11 +2098,11 @@ protected override BindResponse ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.connection.Connection.internal__static_bnet_protocol_connection_BindResponse__Descriptor; } + get { return global::bnet.protocol.connection.Proto.ConnectionService.internal__static_bnet_protocol_connection_BindResponse__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.connection.Connection.internal__static_bnet_protocol_connection_BindResponse__FieldAccessorTable; } + get { return global::bnet.protocol.connection.Proto.ConnectionService.internal__static_bnet_protocol_connection_BindResponse__FieldAccessorTable; } } public const int ImportedServiceIdFieldNumber = 1; @@ -1289,14 +2124,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; + string[] field_names = _bindResponseFieldNames; if (importedServiceId_.Count > 0) { - output.WriteRawVarint32(10); - output.WriteRawVarint32((uint) importedServiceIdMemoizedSerializedSize); - foreach (uint element in importedServiceId_) { - output.WriteUInt32NoTag(element); - } + output.WritePackedUInt32Array(1, field_names[0], importedServiceIdMemoizedSerializedSize, importedServiceId_); } UnknownFields.WriteTo(output); } @@ -1349,38 +2181,73 @@ public static BindResponse ParseDelimitedFrom(global::System.IO.Stream input) { public static BindResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static BindResponse ParseFrom(pb::CodedInputStream input) { + public static BindResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static BindResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static BindResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private BindResponse MakeReadOnly() { + importedServiceId_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(BindResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(BindResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private BindResponse result; + + private BindResponse PrepareBuilder() { + if (resultIsReadOnly) { + BindResponse original = result; + result = new BindResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - BindResponse result = new BindResponse(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override BindResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new BindResponse(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -1392,13 +2259,11 @@ public override BindResponse DefaultInstanceForType { } public override BindResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.importedServiceId_.MakeReadOnly(); - BindResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1412,27 +2277,39 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(BindResponse other) { if (other == global::bnet.protocol.connection.BindResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.importedServiceId_.Count != 0) { - base.AddRange(other.importedServiceId_, result.importedServiceId_); + result.importedServiceId_.Add(other.importedServiceId_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_bindResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _bindResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1444,25 +2321,26 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } - case 10: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddImportedServiceId(input.ReadUInt32()); - } - input.PopLimit(limit); + case 10: + case 8: { + input.ReadUInt32Array(tag, field_name, result.importedServiceId_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public pbc::IPopsicleList ImportedServiceIdList { - get { return result.importedServiceId_; } + get { return PrepareBuilder().importedServiceId_; } } public int ImportedServiceIdCount { get { return result.ImportedServiceIdCount; } @@ -1471,35 +2349,45 @@ public uint GetImportedServiceId(int index) { return result.GetImportedServiceId(index); } public Builder SetImportedServiceId(int index, uint value) { + PrepareBuilder(); result.importedServiceId_[index] = value; return this; } public Builder AddImportedServiceId(uint value) { + PrepareBuilder(); result.importedServiceId_.Add(value); return this; } public Builder AddRangeImportedServiceId(scg::IEnumerable values) { - base.AddRange(values, result.importedServiceId_); + PrepareBuilder(); + result.importedServiceId_.Add(values); return this; } public Builder ClearImportedServiceId() { + PrepareBuilder(); result.importedServiceId_.Clear(); return this; } } static BindResponse() { - object.ReferenceEquals(global::bnet.protocol.connection.Connection.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.connection.Proto.ConnectionService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class EchoRequest : pb::GeneratedMessage { - private static readonly EchoRequest defaultInstance = new Builder().BuildPartial(); + private EchoRequest() { } + private static readonly EchoRequest defaultInstance = new EchoRequest().MakeReadOnly(); + private static readonly string[] _echoRequestFieldNames = new string[] { "network_only", "payload", "time" }; + private static readonly uint[] _echoRequestFieldTags = new uint[] { 16, 26, 9 }; public static EchoRequest DefaultInstance { get { return defaultInstance; } } public override EchoRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override EchoRequest ThisMessage { @@ -1507,16 +2395,16 @@ protected override EchoRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.connection.Connection.internal__static_bnet_protocol_connection_EchoRequest__Descriptor; } + get { return global::bnet.protocol.connection.Proto.ConnectionService.internal__static_bnet_protocol_connection_EchoRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.connection.Connection.internal__static_bnet_protocol_connection_EchoRequest__FieldAccessorTable; } + get { return global::bnet.protocol.connection.Proto.ConnectionService.internal__static_bnet_protocol_connection_EchoRequest__FieldAccessorTable; } } public const int TimeFieldNumber = 1; private bool hasTime; - private ulong time_ = 0; + private ulong time_; public bool HasTime { get { return hasTime; } } @@ -1526,7 +2414,7 @@ public ulong Time { public const int NetworkOnlyFieldNumber = 2; private bool hasNetworkOnly; - private bool networkOnly_ = false; + private bool networkOnly_; public bool HasNetworkOnly { get { return hasNetworkOnly; } } @@ -1550,16 +2438,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasTime) { - output.WriteFixed64(1, Time); + string[] field_names = _echoRequestFieldNames; + if (hasTime) { + output.WriteFixed64(1, field_names[2], Time); } - if (HasNetworkOnly) { - output.WriteBool(2, NetworkOnly); + if (hasNetworkOnly) { + output.WriteBool(2, field_names[0], NetworkOnly); } - if (HasPayload) { - output.WriteBytes(3, Payload); + if (hasPayload) { + output.WriteBytes(3, field_names[1], Payload); } UnknownFields.WriteTo(output); } @@ -1571,13 +2460,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasTime) { + if (hasTime) { size += pb::CodedOutputStream.ComputeFixed64Size(1, Time); } - if (HasNetworkOnly) { + if (hasNetworkOnly) { size += pb::CodedOutputStream.ComputeBoolSize(2, NetworkOnly); } - if (HasPayload) { + if (hasPayload) { size += pb::CodedOutputStream.ComputeBytesSize(3, Payload); } size += UnknownFields.SerializedSize; @@ -1610,38 +2499,72 @@ public static EchoRequest ParseDelimitedFrom(global::System.IO.Stream input) { public static EchoRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static EchoRequest ParseFrom(pb::CodedInputStream input) { + public static EchoRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static EchoRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static EchoRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private EchoRequest MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(EchoRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(EchoRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private EchoRequest result; + + private EchoRequest PrepareBuilder() { + if (resultIsReadOnly) { + EchoRequest original = result; + result = new EchoRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - EchoRequest result = new EchoRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override EchoRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new EchoRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -1653,12 +2576,11 @@ public override EchoRequest DefaultInstanceForType { } public override EchoRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - EchoRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1672,6 +2594,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(EchoRequest other) { if (other == global::bnet.protocol.connection.EchoRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasTime) { Time = other.Time; } @@ -1685,20 +2608,31 @@ public override Builder MergeFrom(EchoRequest other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_echoRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _echoRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1710,64 +2644,73 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 9: { - Time = input.ReadFixed64(); + result.hasTime = input.ReadFixed64(ref result.time_); break; } case 16: { - NetworkOnly = input.ReadBool(); + result.hasNetworkOnly = input.ReadBool(ref result.networkOnly_); break; } case 26: { - Payload = input.ReadBytes(); + result.hasPayload = input.ReadBytes(ref result.payload_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasTime { - get { return result.HasTime; } + get { return result.hasTime; } } public ulong Time { get { return result.Time; } set { SetTime(value); } } public Builder SetTime(ulong value) { + PrepareBuilder(); result.hasTime = true; result.time_ = value; return this; } public Builder ClearTime() { + PrepareBuilder(); result.hasTime = false; result.time_ = 0; return this; } public bool HasNetworkOnly { - get { return result.HasNetworkOnly; } + get { return result.hasNetworkOnly; } } public bool NetworkOnly { get { return result.NetworkOnly; } set { SetNetworkOnly(value); } } public Builder SetNetworkOnly(bool value) { + PrepareBuilder(); result.hasNetworkOnly = true; result.networkOnly_ = value; return this; } public Builder ClearNetworkOnly() { + PrepareBuilder(); result.hasNetworkOnly = false; result.networkOnly_ = false; return this; } public bool HasPayload { - get { return result.HasPayload; } + get { return result.hasPayload; } } public pb::ByteString Payload { get { return result.Payload; } @@ -1775,29 +2718,37 @@ public bool HasPayload { } public Builder SetPayload(pb::ByteString value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasPayload = true; result.payload_ = value; return this; } public Builder ClearPayload() { + PrepareBuilder(); result.hasPayload = false; result.payload_ = pb::ByteString.Empty; return this; } } static EchoRequest() { - object.ReferenceEquals(global::bnet.protocol.connection.Connection.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.connection.Proto.ConnectionService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class EchoResponse : pb::GeneratedMessage { - private static readonly EchoResponse defaultInstance = new Builder().BuildPartial(); + private EchoResponse() { } + private static readonly EchoResponse defaultInstance = new EchoResponse().MakeReadOnly(); + private static readonly string[] _echoResponseFieldNames = new string[] { "payload", "time" }; + private static readonly uint[] _echoResponseFieldTags = new uint[] { 18, 9 }; public static EchoResponse DefaultInstance { get { return defaultInstance; } } public override EchoResponse DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override EchoResponse ThisMessage { @@ -1805,16 +2756,16 @@ protected override EchoResponse ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.connection.Connection.internal__static_bnet_protocol_connection_EchoResponse__Descriptor; } + get { return global::bnet.protocol.connection.Proto.ConnectionService.internal__static_bnet_protocol_connection_EchoResponse__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.connection.Connection.internal__static_bnet_protocol_connection_EchoResponse__FieldAccessorTable; } + get { return global::bnet.protocol.connection.Proto.ConnectionService.internal__static_bnet_protocol_connection_EchoResponse__FieldAccessorTable; } } public const int TimeFieldNumber = 1; private bool hasTime; - private ulong time_ = 0; + private ulong time_; public bool HasTime { get { return hasTime; } } @@ -1838,13 +2789,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasTime) { - output.WriteFixed64(1, Time); + string[] field_names = _echoResponseFieldNames; + if (hasTime) { + output.WriteFixed64(1, field_names[1], Time); } - if (HasPayload) { - output.WriteBytes(2, Payload); + if (hasPayload) { + output.WriteBytes(2, field_names[0], Payload); } UnknownFields.WriteTo(output); } @@ -1856,10 +2808,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasTime) { + if (hasTime) { size += pb::CodedOutputStream.ComputeFixed64Size(1, Time); } - if (HasPayload) { + if (hasPayload) { size += pb::CodedOutputStream.ComputeBytesSize(2, Payload); } size += UnknownFields.SerializedSize; @@ -1892,38 +2844,72 @@ public static EchoResponse ParseDelimitedFrom(global::System.IO.Stream input) { public static EchoResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static EchoResponse ParseFrom(pb::CodedInputStream input) { + public static EchoResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static EchoResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static EchoResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private EchoResponse MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(EchoResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(EchoResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private EchoResponse result; + + private EchoResponse PrepareBuilder() { + if (resultIsReadOnly) { + EchoResponse original = result; + result = new EchoResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - EchoResponse result = new EchoResponse(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override EchoResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new EchoResponse(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -1935,12 +2921,11 @@ public override EchoResponse DefaultInstanceForType { } public override EchoResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - EchoResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1954,6 +2939,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(EchoResponse other) { if (other == global::bnet.protocol.connection.EchoResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.HasTime) { Time = other.Time; } @@ -1964,20 +2950,31 @@ public override Builder MergeFrom(EchoResponse other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_echoResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _echoResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1989,42 +2986,49 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 9: { - Time = input.ReadFixed64(); + result.hasTime = input.ReadFixed64(ref result.time_); break; } case 18: { - Payload = input.ReadBytes(); + result.hasPayload = input.ReadBytes(ref result.payload_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasTime { - get { return result.HasTime; } + get { return result.hasTime; } } public ulong Time { get { return result.Time; } set { SetTime(value); } } public Builder SetTime(ulong value) { + PrepareBuilder(); result.hasTime = true; result.time_ = value; return this; } public Builder ClearTime() { + PrepareBuilder(); result.hasTime = false; result.time_ = 0; return this; } public bool HasPayload { - get { return result.HasPayload; } + get { return result.hasPayload; } } public pb::ByteString Payload { get { return result.Payload; } @@ -2032,29 +3036,37 @@ public bool HasPayload { } public Builder SetPayload(pb::ByteString value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasPayload = true; result.payload_ = value; return this; } public Builder ClearPayload() { + PrepareBuilder(); result.hasPayload = false; result.payload_ = pb::ByteString.Empty; return this; } } static EchoResponse() { - object.ReferenceEquals(global::bnet.protocol.connection.Connection.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.connection.Proto.ConnectionService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class DisconnectRequest : pb::GeneratedMessage { - private static readonly DisconnectRequest defaultInstance = new Builder().BuildPartial(); + private DisconnectRequest() { } + private static readonly DisconnectRequest defaultInstance = new DisconnectRequest().MakeReadOnly(); + private static readonly string[] _disconnectRequestFieldNames = new string[] { "error_code" }; + private static readonly uint[] _disconnectRequestFieldTags = new uint[] { 8 }; public static DisconnectRequest DefaultInstance { get { return defaultInstance; } } public override DisconnectRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override DisconnectRequest ThisMessage { @@ -2062,16 +3074,16 @@ protected override DisconnectRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.connection.Connection.internal__static_bnet_protocol_connection_DisconnectRequest__Descriptor; } + get { return global::bnet.protocol.connection.Proto.ConnectionService.internal__static_bnet_protocol_connection_DisconnectRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.connection.Connection.internal__static_bnet_protocol_connection_DisconnectRequest__FieldAccessorTable; } + get { return global::bnet.protocol.connection.Proto.ConnectionService.internal__static_bnet_protocol_connection_DisconnectRequest__FieldAccessorTable; } } public const int ErrorCodeFieldNumber = 1; private bool hasErrorCode; - private uint errorCode_ = 0; + private uint errorCode_; public bool HasErrorCode { get { return hasErrorCode; } } @@ -2086,10 +3098,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasErrorCode) { - output.WriteUInt32(1, ErrorCode); + string[] field_names = _disconnectRequestFieldNames; + if (hasErrorCode) { + output.WriteUInt32(1, field_names[0], ErrorCode); } UnknownFields.WriteTo(output); } @@ -2101,7 +3114,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasErrorCode) { + if (hasErrorCode) { size += pb::CodedOutputStream.ComputeUInt32Size(1, ErrorCode); } size += UnknownFields.SerializedSize; @@ -2134,38 +3147,72 @@ public static DisconnectRequest ParseDelimitedFrom(global::System.IO.Stream inpu public static DisconnectRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static DisconnectRequest ParseFrom(pb::CodedInputStream input) { + public static DisconnectRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static DisconnectRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static DisconnectRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private DisconnectRequest MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(DisconnectRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(DisconnectRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - DisconnectRequest result = new DisconnectRequest(); + private bool resultIsReadOnly; + private DisconnectRequest result; + + private DisconnectRequest PrepareBuilder() { + if (resultIsReadOnly) { + DisconnectRequest original = result; + result = new DisconnectRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override DisconnectRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new DisconnectRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -2177,12 +3224,11 @@ public override DisconnectRequest DefaultInstanceForType { } public override DisconnectRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - DisconnectRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2196,6 +3242,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(DisconnectRequest other) { if (other == global::bnet.protocol.connection.DisconnectRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasErrorCode) { ErrorCode = other.ErrorCode; } @@ -2203,20 +3250,31 @@ public override Builder MergeFrom(DisconnectRequest other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_disconnectRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _disconnectRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -2228,49 +3286,62 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 8: { - ErrorCode = input.ReadUInt32(); + result.hasErrorCode = input.ReadUInt32(ref result.errorCode_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasErrorCode { - get { return result.HasErrorCode; } + get { return result.hasErrorCode; } } public uint ErrorCode { get { return result.ErrorCode; } set { SetErrorCode(value); } } public Builder SetErrorCode(uint value) { + PrepareBuilder(); result.hasErrorCode = true; result.errorCode_ = value; return this; } public Builder ClearErrorCode() { + PrepareBuilder(); result.hasErrorCode = false; result.errorCode_ = 0; return this; } } static DisconnectRequest() { - object.ReferenceEquals(global::bnet.protocol.connection.Connection.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.connection.Proto.ConnectionService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class DisconnectNotification : pb::GeneratedMessage { - private static readonly DisconnectNotification defaultInstance = new Builder().BuildPartial(); + private DisconnectNotification() { } + private static readonly DisconnectNotification defaultInstance = new DisconnectNotification().MakeReadOnly(); + private static readonly string[] _disconnectNotificationFieldNames = new string[] { "error_code", "reason" }; + private static readonly uint[] _disconnectNotificationFieldTags = new uint[] { 8, 18 }; public static DisconnectNotification DefaultInstance { get { return defaultInstance; } } public override DisconnectNotification DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override DisconnectNotification ThisMessage { @@ -2278,16 +3349,16 @@ protected override DisconnectNotification ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.connection.Connection.internal__static_bnet_protocol_connection_DisconnectNotification__Descriptor; } + get { return global::bnet.protocol.connection.Proto.ConnectionService.internal__static_bnet_protocol_connection_DisconnectNotification__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.connection.Connection.internal__static_bnet_protocol_connection_DisconnectNotification__FieldAccessorTable; } + get { return global::bnet.protocol.connection.Proto.ConnectionService.internal__static_bnet_protocol_connection_DisconnectNotification__FieldAccessorTable; } } public const int ErrorCodeFieldNumber = 1; private bool hasErrorCode; - private uint errorCode_ = 0; + private uint errorCode_; public bool HasErrorCode { get { return hasErrorCode; } } @@ -2312,13 +3383,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasErrorCode) { - output.WriteUInt32(1, ErrorCode); + string[] field_names = _disconnectNotificationFieldNames; + if (hasErrorCode) { + output.WriteUInt32(1, field_names[0], ErrorCode); } - if (HasReason) { - output.WriteString(2, Reason); + if (hasReason) { + output.WriteString(2, field_names[1], Reason); } UnknownFields.WriteTo(output); } @@ -2330,10 +3402,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasErrorCode) { + if (hasErrorCode) { size += pb::CodedOutputStream.ComputeUInt32Size(1, ErrorCode); } - if (HasReason) { + if (hasReason) { size += pb::CodedOutputStream.ComputeStringSize(2, Reason); } size += UnknownFields.SerializedSize; @@ -2366,38 +3438,72 @@ public static DisconnectNotification ParseDelimitedFrom(global::System.IO.Stream public static DisconnectNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static DisconnectNotification ParseFrom(pb::CodedInputStream input) { + public static DisconnectNotification ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static DisconnectNotification ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static DisconnectNotification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private DisconnectNotification MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(DisconnectNotification prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(DisconnectNotification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private DisconnectNotification result; + + private DisconnectNotification PrepareBuilder() { + if (resultIsReadOnly) { + DisconnectNotification original = result; + result = new DisconnectNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - DisconnectNotification result = new DisconnectNotification(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override DisconnectNotification MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new DisconnectNotification(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -2409,12 +3515,11 @@ public override DisconnectNotification DefaultInstanceForType { } public override DisconnectNotification BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - DisconnectNotification returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2428,6 +3533,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(DisconnectNotification other) { if (other == global::bnet.protocol.connection.DisconnectNotification.DefaultInstance) return this; + PrepareBuilder(); if (other.HasErrorCode) { ErrorCode = other.ErrorCode; } @@ -2438,20 +3544,31 @@ public override Builder MergeFrom(DisconnectNotification other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_disconnectNotificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _disconnectNotificationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -2463,42 +3580,49 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 8: { - ErrorCode = input.ReadUInt32(); + result.hasErrorCode = input.ReadUInt32(ref result.errorCode_); break; } case 18: { - Reason = input.ReadString(); + result.hasReason = input.ReadString(ref result.reason_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasErrorCode { - get { return result.HasErrorCode; } + get { return result.hasErrorCode; } } public uint ErrorCode { get { return result.ErrorCode; } set { SetErrorCode(value); } } public Builder SetErrorCode(uint value) { + PrepareBuilder(); result.hasErrorCode = true; result.errorCode_ = value; return this; } public Builder ClearErrorCode() { + PrepareBuilder(); result.hasErrorCode = false; result.errorCode_ = 0; return this; } public bool HasReason { - get { return result.HasReason; } + get { return result.hasReason; } } public string Reason { get { return result.Reason; } @@ -2506,29 +3630,37 @@ public string Reason { } public Builder SetReason(string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasReason = true; result.reason_ = value; return this; } public Builder ClearReason() { + PrepareBuilder(); result.hasReason = false; result.reason_ = ""; return this; } } static DisconnectNotification() { - object.ReferenceEquals(global::bnet.protocol.connection.Connection.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.connection.Proto.ConnectionService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class NullRequest : pb::GeneratedMessage { - private static readonly NullRequest defaultInstance = new Builder().BuildPartial(); + private NullRequest() { } + private static readonly NullRequest defaultInstance = new NullRequest().MakeReadOnly(); + private static readonly string[] _nullRequestFieldNames = new string[] { }; + private static readonly uint[] _nullRequestFieldTags = new uint[] { }; public static NullRequest DefaultInstance { get { return defaultInstance; } } public override NullRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override NullRequest ThisMessage { @@ -2536,11 +3668,11 @@ protected override NullRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.connection.Connection.internal__static_bnet_protocol_connection_NullRequest__Descriptor; } + get { return global::bnet.protocol.connection.Proto.ConnectionService.internal__static_bnet_protocol_connection_NullRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.connection.Connection.internal__static_bnet_protocol_connection_NullRequest__FieldAccessorTable; } + get { return global::bnet.protocol.connection.Proto.ConnectionService.internal__static_bnet_protocol_connection_NullRequest__FieldAccessorTable; } } public override bool IsInitialized { @@ -2549,8 +3681,9 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; + string[] field_names = _nullRequestFieldNames; UnknownFields.WriteTo(output); } @@ -2591,38 +3724,72 @@ public static NullRequest ParseDelimitedFrom(global::System.IO.Stream input) { public static NullRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static NullRequest ParseFrom(pb::CodedInputStream input) { + public static NullRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static NullRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static NullRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private NullRequest MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(NullRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(NullRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private NullRequest result; + + private NullRequest PrepareBuilder() { + if (resultIsReadOnly) { + NullRequest original = result; + result = new NullRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - NullRequest result = new NullRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override NullRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new NullRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -2634,12 +3801,11 @@ public override NullRequest DefaultInstanceForType { } public override NullRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - NullRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2653,24 +3819,36 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(NullRequest other) { if (other == global::bnet.protocol.connection.NullRequest.DefaultInstance) return this; + PrepareBuilder(); this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_nullRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _nullRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -2682,27 +3860,38 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } } static NullRequest() { - object.ReferenceEquals(global::bnet.protocol.connection.Connection.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.connection.Proto.ConnectionService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class EncryptRequest : pb::GeneratedMessage { - private static readonly EncryptRequest defaultInstance = new Builder().BuildPartial(); + private EncryptRequest() { } + private static readonly EncryptRequest defaultInstance = new EncryptRequest().MakeReadOnly(); + private static readonly string[] _encryptRequestFieldNames = new string[] { }; + private static readonly uint[] _encryptRequestFieldTags = new uint[] { }; public static EncryptRequest DefaultInstance { get { return defaultInstance; } } public override EncryptRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override EncryptRequest ThisMessage { @@ -2710,11 +3899,11 @@ protected override EncryptRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.connection.Connection.internal__static_bnet_protocol_connection_EncryptRequest__Descriptor; } + get { return global::bnet.protocol.connection.Proto.ConnectionService.internal__static_bnet_protocol_connection_EncryptRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.connection.Connection.internal__static_bnet_protocol_connection_EncryptRequest__FieldAccessorTable; } + get { return global::bnet.protocol.connection.Proto.ConnectionService.internal__static_bnet_protocol_connection_EncryptRequest__FieldAccessorTable; } } public override bool IsInitialized { @@ -2723,8 +3912,9 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; + string[] field_names = _encryptRequestFieldNames; UnknownFields.WriteTo(output); } @@ -2765,38 +3955,72 @@ public static EncryptRequest ParseDelimitedFrom(global::System.IO.Stream input) public static EncryptRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static EncryptRequest ParseFrom(pb::CodedInputStream input) { + public static EncryptRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static EncryptRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static EncryptRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private EncryptRequest MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(EncryptRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(EncryptRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private EncryptRequest result; + + private EncryptRequest PrepareBuilder() { + if (resultIsReadOnly) { + EncryptRequest original = result; + result = new EncryptRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - EncryptRequest result = new EncryptRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override EncryptRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new EncryptRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -2808,12 +4032,11 @@ public override EncryptRequest DefaultInstanceForType { } public override EncryptRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - EncryptRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2827,24 +4050,36 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(EncryptRequest other) { if (other == global::bnet.protocol.connection.EncryptRequest.DefaultInstance) return this; + PrepareBuilder(); this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_encryptRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _encryptRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -2856,22 +4091,30 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } } static EncryptRequest() { - object.ReferenceEquals(global::bnet.protocol.connection.Connection.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.connection.Proto.ConnectionService.Descriptor, null); } } #endregion #region Services + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public abstract class ConnectionService : pb::IService { public abstract void Connect( pb::IRpcController controller, @@ -2903,7 +4146,7 @@ public abstract void RequestDisconnect( global::System.Action done); public static pbd::ServiceDescriptor Descriptor { - get { return Connection.Descriptor.Services[0]; } + get { return Proto.ConnectionService.Descriptor.Services[0]; } } public pbd::ServiceDescriptor DescriptorForType { get { return Descriptor; } @@ -3013,6 +4256,9 @@ public static Stub CreateStub(pb::IRpcChannel channel) { return new Stub(channel); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public class Stub : global::bnet.protocol.connection.ConnectionService { internal Stub(pb::IRpcChannel channel) { this.channel = channel; @@ -3091,3 +4337,5 @@ public override void RequestDisconnect( #endregion } + +#endregion Designer generated code diff --git a/src/LibMooNet/bnet/protocol/exchange/Exchange.cs b/src/LibMooNet/bnet/protocol/exchange/Exchange.cs new file mode 100644 index 00000000..a357df91 --- /dev/null +++ b/src/LibMooNet/bnet/protocol/exchange/Exchange.cs @@ -0,0 +1,2231 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace bnet.protocol.exchange { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class Exchange { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_PartitionId__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_PartitionId__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_BlobFrom__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_BlobFrom__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_BlobOfType__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_BlobOfType__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_BlobFromOfType__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_BlobFromOfType__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_ActionResultDetail__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_ActionResultDetail__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_BillingAddress__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_BillingAddress__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static Exchange() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "ChNibmV0L2V4Y2hhbmdlLnByb3RvEhZibmV0LnByb3RvY29sLmV4Y2hhbmdl" + + "GhhibmV0L2ZpZWxkX29wdGlvbnMucHJvdG8iKAoLUGFydGl0aW9uSWQSDAoE" + + "aGlnaBgBIAIoBhILCgNsb3cYAiACKAYiPAoIQmxvYkZyb20SDgoGc291cmNl" + + "GAEgAigHEgwKBGRhdGEYAiACKAwSEgoKZXh0cmFfZGF0YRgDIAEoDCI8CgpC" + + "bG9iT2ZUeXBlEgwKBHR5cGUYASACKAkSDAoEZGF0YRgCIAEoDBISCgpleHRy" + + "YV9kYXRhGAMgASgMIjwKDkJsb2JGcm9tT2ZUeXBlEg4KBnNvdXJjZRgBIAIo" + + "BxIMCgR0eXBlGAIgAigJEgwKBGRhdGEYAyACKAwiPQoSQWN0aW9uUmVzdWx0" + + "RGV0YWlsEhAKCGNhdGVnb3J5GAEgAigNEhUKDXJlc3VsdF9yZWFzb24YAiAB" + + "KA0iVgoOQmlsbGluZ0FkZHJlc3MSEgoKY291bnRyeV9pZBgBIAIoBRIMCgRj" + + "aXR5GAIgASgJEg0KBXN0YXRlGAMgASgJEhMKC3Bvc3RhbF9jb2RlGAQgASgJ" + + "QgOAAQA="); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_bnet_protocol_exchange_PartitionId__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_exchange_PartitionId__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_PartitionId__Descriptor, + new string[] { "High", "Low", }); + internal__static_bnet_protocol_exchange_BlobFrom__Descriptor = Descriptor.MessageTypes[1]; + internal__static_bnet_protocol_exchange_BlobFrom__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_BlobFrom__Descriptor, + new string[] { "Source", "Data", "ExtraData", }); + internal__static_bnet_protocol_exchange_BlobOfType__Descriptor = Descriptor.MessageTypes[2]; + internal__static_bnet_protocol_exchange_BlobOfType__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_BlobOfType__Descriptor, + new string[] { "Type", "Data", "ExtraData", }); + internal__static_bnet_protocol_exchange_BlobFromOfType__Descriptor = Descriptor.MessageTypes[3]; + internal__static_bnet_protocol_exchange_BlobFromOfType__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_BlobFromOfType__Descriptor, + new string[] { "Source", "Type", "Data", }); + internal__static_bnet_protocol_exchange_ActionResultDetail__Descriptor = Descriptor.MessageTypes[4]; + internal__static_bnet_protocol_exchange_ActionResultDetail__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_ActionResultDetail__Descriptor, + new string[] { "Category", "ResultReason", }); + internal__static_bnet_protocol_exchange_BillingAddress__Descriptor = Descriptor.MessageTypes[5]; + internal__static_bnet_protocol_exchange_BillingAddress__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_BillingAddress__Descriptor, + new string[] { "CountryId", "City", "State", "PostalCode", }); + return null; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::bnet.protocol.FieldOptions.Descriptor, + }, assigner); + } + #endregion + + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class PartitionId : pb::GeneratedMessage { + private PartitionId() { } + private static readonly PartitionId defaultInstance = new PartitionId().MakeReadOnly(); + private static readonly string[] _partitionIdFieldNames = new string[] { "high", "low" }; + private static readonly uint[] _partitionIdFieldTags = new uint[] { 9, 17 }; + public static PartitionId DefaultInstance { + get { return defaultInstance; } + } + + public override PartitionId DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override PartitionId ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Exchange.internal__static_bnet_protocol_exchange_PartitionId__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Exchange.internal__static_bnet_protocol_exchange_PartitionId__FieldAccessorTable; } + } + + public const int HighFieldNumber = 1; + private bool hasHigh; + private ulong high_; + public bool HasHigh { + get { return hasHigh; } + } + public ulong High { + get { return high_; } + } + + public const int LowFieldNumber = 2; + private bool hasLow; + private ulong low_; + public bool HasLow { + get { return hasLow; } + } + public ulong Low { + get { return low_; } + } + + public override bool IsInitialized { + get { + if (!hasHigh) return false; + if (!hasLow) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _partitionIdFieldNames; + if (hasHigh) { + output.WriteFixed64(1, field_names[0], High); + } + if (hasLow) { + output.WriteFixed64(2, field_names[1], Low); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasHigh) { + size += pb::CodedOutputStream.ComputeFixed64Size(1, High); + } + if (hasLow) { + size += pb::CodedOutputStream.ComputeFixed64Size(2, Low); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static PartitionId ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PartitionId ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PartitionId ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PartitionId ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PartitionId ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PartitionId ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static PartitionId ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static PartitionId ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static PartitionId ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PartitionId ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private PartitionId MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(PartitionId prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(PartitionId cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private PartitionId result; + + private PartitionId PrepareBuilder() { + if (resultIsReadOnly) { + PartitionId original = result; + result = new PartitionId(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override PartitionId MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.PartitionId.Descriptor; } + } + + public override PartitionId DefaultInstanceForType { + get { return global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public override PartitionId BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is PartitionId) { + return MergeFrom((PartitionId) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(PartitionId other) { + if (other == global::bnet.protocol.exchange.PartitionId.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasHigh) { + High = other.High; + } + if (other.HasLow) { + Low = other.Low; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_partitionIdFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _partitionIdFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 9: { + result.hasHigh = input.ReadFixed64(ref result.high_); + break; + } + case 17: { + result.hasLow = input.ReadFixed64(ref result.low_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasHigh { + get { return result.hasHigh; } + } + public ulong High { + get { return result.High; } + set { SetHigh(value); } + } + public Builder SetHigh(ulong value) { + PrepareBuilder(); + result.hasHigh = true; + result.high_ = value; + return this; + } + public Builder ClearHigh() { + PrepareBuilder(); + result.hasHigh = false; + result.high_ = 0; + return this; + } + + public bool HasLow { + get { return result.hasLow; } + } + public ulong Low { + get { return result.Low; } + set { SetLow(value); } + } + public Builder SetLow(ulong value) { + PrepareBuilder(); + result.hasLow = true; + result.low_ = value; + return this; + } + public Builder ClearLow() { + PrepareBuilder(); + result.hasLow = false; + result.low_ = 0; + return this; + } + } + static PartitionId() { + object.ReferenceEquals(global::bnet.protocol.exchange.Exchange.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class BlobFrom : pb::GeneratedMessage { + private BlobFrom() { } + private static readonly BlobFrom defaultInstance = new BlobFrom().MakeReadOnly(); + private static readonly string[] _blobFromFieldNames = new string[] { "data", "extra_data", "source" }; + private static readonly uint[] _blobFromFieldTags = new uint[] { 18, 26, 13 }; + public static BlobFrom DefaultInstance { + get { return defaultInstance; } + } + + public override BlobFrom DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override BlobFrom ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Exchange.internal__static_bnet_protocol_exchange_BlobFrom__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Exchange.internal__static_bnet_protocol_exchange_BlobFrom__FieldAccessorTable; } + } + + public const int SourceFieldNumber = 1; + private bool hasSource; + private uint source_; + public bool HasSource { + get { return hasSource; } + } + public uint Source { + get { return source_; } + } + + public const int DataFieldNumber = 2; + private bool hasData; + private pb::ByteString data_ = pb::ByteString.Empty; + public bool HasData { + get { return hasData; } + } + public pb::ByteString Data { + get { return data_; } + } + + public const int ExtraDataFieldNumber = 3; + private bool hasExtraData; + private pb::ByteString extraData_ = pb::ByteString.Empty; + public bool HasExtraData { + get { return hasExtraData; } + } + public pb::ByteString ExtraData { + get { return extraData_; } + } + + public override bool IsInitialized { + get { + if (!hasSource) return false; + if (!hasData) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _blobFromFieldNames; + if (hasSource) { + output.WriteFixed32(1, field_names[2], Source); + } + if (hasData) { + output.WriteBytes(2, field_names[0], Data); + } + if (hasExtraData) { + output.WriteBytes(3, field_names[1], ExtraData); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasSource) { + size += pb::CodedOutputStream.ComputeFixed32Size(1, Source); + } + if (hasData) { + size += pb::CodedOutputStream.ComputeBytesSize(2, Data); + } + if (hasExtraData) { + size += pb::CodedOutputStream.ComputeBytesSize(3, ExtraData); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static BlobFrom ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static BlobFrom ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static BlobFrom ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static BlobFrom ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static BlobFrom ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static BlobFrom ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static BlobFrom ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static BlobFrom ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static BlobFrom ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static BlobFrom ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private BlobFrom MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(BlobFrom prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(BlobFrom cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private BlobFrom result; + + private BlobFrom PrepareBuilder() { + if (resultIsReadOnly) { + BlobFrom original = result; + result = new BlobFrom(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override BlobFrom MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.BlobFrom.Descriptor; } + } + + public override BlobFrom DefaultInstanceForType { + get { return global::bnet.protocol.exchange.BlobFrom.DefaultInstance; } + } + + public override BlobFrom BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is BlobFrom) { + return MergeFrom((BlobFrom) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(BlobFrom other) { + if (other == global::bnet.protocol.exchange.BlobFrom.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasSource) { + Source = other.Source; + } + if (other.HasData) { + Data = other.Data; + } + if (other.HasExtraData) { + ExtraData = other.ExtraData; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_blobFromFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _blobFromFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 13: { + result.hasSource = input.ReadFixed32(ref result.source_); + break; + } + case 18: { + result.hasData = input.ReadBytes(ref result.data_); + break; + } + case 26: { + result.hasExtraData = input.ReadBytes(ref result.extraData_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasSource { + get { return result.hasSource; } + } + public uint Source { + get { return result.Source; } + set { SetSource(value); } + } + public Builder SetSource(uint value) { + PrepareBuilder(); + result.hasSource = true; + result.source_ = value; + return this; + } + public Builder ClearSource() { + PrepareBuilder(); + result.hasSource = false; + result.source_ = 0; + return this; + } + + public bool HasData { + get { return result.hasData; } + } + public pb::ByteString Data { + get { return result.Data; } + set { SetData(value); } + } + public Builder SetData(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasData = true; + result.data_ = value; + return this; + } + public Builder ClearData() { + PrepareBuilder(); + result.hasData = false; + result.data_ = pb::ByteString.Empty; + return this; + } + + public bool HasExtraData { + get { return result.hasExtraData; } + } + public pb::ByteString ExtraData { + get { return result.ExtraData; } + set { SetExtraData(value); } + } + public Builder SetExtraData(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasExtraData = true; + result.extraData_ = value; + return this; + } + public Builder ClearExtraData() { + PrepareBuilder(); + result.hasExtraData = false; + result.extraData_ = pb::ByteString.Empty; + return this; + } + } + static BlobFrom() { + object.ReferenceEquals(global::bnet.protocol.exchange.Exchange.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class BlobOfType : pb::GeneratedMessage { + private BlobOfType() { } + private static readonly BlobOfType defaultInstance = new BlobOfType().MakeReadOnly(); + private static readonly string[] _blobOfTypeFieldNames = new string[] { "data", "extra_data", "type" }; + private static readonly uint[] _blobOfTypeFieldTags = new uint[] { 18, 26, 10 }; + public static BlobOfType DefaultInstance { + get { return defaultInstance; } + } + + public override BlobOfType DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override BlobOfType ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Exchange.internal__static_bnet_protocol_exchange_BlobOfType__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Exchange.internal__static_bnet_protocol_exchange_BlobOfType__FieldAccessorTable; } + } + + public const int TypeFieldNumber = 1; + private bool hasType; + private string type_ = ""; + public bool HasType { + get { return hasType; } + } + public string Type { + get { return type_; } + } + + public const int DataFieldNumber = 2; + private bool hasData; + private pb::ByteString data_ = pb::ByteString.Empty; + public bool HasData { + get { return hasData; } + } + public pb::ByteString Data { + get { return data_; } + } + + public const int ExtraDataFieldNumber = 3; + private bool hasExtraData; + private pb::ByteString extraData_ = pb::ByteString.Empty; + public bool HasExtraData { + get { return hasExtraData; } + } + public pb::ByteString ExtraData { + get { return extraData_; } + } + + public override bool IsInitialized { + get { + if (!hasType) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _blobOfTypeFieldNames; + if (hasType) { + output.WriteString(1, field_names[2], Type); + } + if (hasData) { + output.WriteBytes(2, field_names[0], Data); + } + if (hasExtraData) { + output.WriteBytes(3, field_names[1], ExtraData); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasType) { + size += pb::CodedOutputStream.ComputeStringSize(1, Type); + } + if (hasData) { + size += pb::CodedOutputStream.ComputeBytesSize(2, Data); + } + if (hasExtraData) { + size += pb::CodedOutputStream.ComputeBytesSize(3, ExtraData); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static BlobOfType ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static BlobOfType ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static BlobOfType ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static BlobOfType ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static BlobOfType ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static BlobOfType ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static BlobOfType ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static BlobOfType ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static BlobOfType ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static BlobOfType ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private BlobOfType MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(BlobOfType prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(BlobOfType cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private BlobOfType result; + + private BlobOfType PrepareBuilder() { + if (resultIsReadOnly) { + BlobOfType original = result; + result = new BlobOfType(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override BlobOfType MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.BlobOfType.Descriptor; } + } + + public override BlobOfType DefaultInstanceForType { + get { return global::bnet.protocol.exchange.BlobOfType.DefaultInstance; } + } + + public override BlobOfType BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is BlobOfType) { + return MergeFrom((BlobOfType) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(BlobOfType other) { + if (other == global::bnet.protocol.exchange.BlobOfType.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasType) { + Type = other.Type; + } + if (other.HasData) { + Data = other.Data; + } + if (other.HasExtraData) { + ExtraData = other.ExtraData; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_blobOfTypeFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _blobOfTypeFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasType = input.ReadString(ref result.type_); + break; + } + case 18: { + result.hasData = input.ReadBytes(ref result.data_); + break; + } + case 26: { + result.hasExtraData = input.ReadBytes(ref result.extraData_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasType { + get { return result.hasType; } + } + public string Type { + get { return result.Type; } + set { SetType(value); } + } + public Builder SetType(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasType = true; + result.type_ = value; + return this; + } + public Builder ClearType() { + PrepareBuilder(); + result.hasType = false; + result.type_ = ""; + return this; + } + + public bool HasData { + get { return result.hasData; } + } + public pb::ByteString Data { + get { return result.Data; } + set { SetData(value); } + } + public Builder SetData(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasData = true; + result.data_ = value; + return this; + } + public Builder ClearData() { + PrepareBuilder(); + result.hasData = false; + result.data_ = pb::ByteString.Empty; + return this; + } + + public bool HasExtraData { + get { return result.hasExtraData; } + } + public pb::ByteString ExtraData { + get { return result.ExtraData; } + set { SetExtraData(value); } + } + public Builder SetExtraData(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasExtraData = true; + result.extraData_ = value; + return this; + } + public Builder ClearExtraData() { + PrepareBuilder(); + result.hasExtraData = false; + result.extraData_ = pb::ByteString.Empty; + return this; + } + } + static BlobOfType() { + object.ReferenceEquals(global::bnet.protocol.exchange.Exchange.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class BlobFromOfType : pb::GeneratedMessage { + private BlobFromOfType() { } + private static readonly BlobFromOfType defaultInstance = new BlobFromOfType().MakeReadOnly(); + private static readonly string[] _blobFromOfTypeFieldNames = new string[] { "data", "source", "type" }; + private static readonly uint[] _blobFromOfTypeFieldTags = new uint[] { 26, 13, 18 }; + public static BlobFromOfType DefaultInstance { + get { return defaultInstance; } + } + + public override BlobFromOfType DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override BlobFromOfType ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Exchange.internal__static_bnet_protocol_exchange_BlobFromOfType__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Exchange.internal__static_bnet_protocol_exchange_BlobFromOfType__FieldAccessorTable; } + } + + public const int SourceFieldNumber = 1; + private bool hasSource; + private uint source_; + public bool HasSource { + get { return hasSource; } + } + public uint Source { + get { return source_; } + } + + public const int TypeFieldNumber = 2; + private bool hasType; + private string type_ = ""; + public bool HasType { + get { return hasType; } + } + public string Type { + get { return type_; } + } + + public const int DataFieldNumber = 3; + private bool hasData; + private pb::ByteString data_ = pb::ByteString.Empty; + public bool HasData { + get { return hasData; } + } + public pb::ByteString Data { + get { return data_; } + } + + public override bool IsInitialized { + get { + if (!hasSource) return false; + if (!hasType) return false; + if (!hasData) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _blobFromOfTypeFieldNames; + if (hasSource) { + output.WriteFixed32(1, field_names[1], Source); + } + if (hasType) { + output.WriteString(2, field_names[2], Type); + } + if (hasData) { + output.WriteBytes(3, field_names[0], Data); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasSource) { + size += pb::CodedOutputStream.ComputeFixed32Size(1, Source); + } + if (hasType) { + size += pb::CodedOutputStream.ComputeStringSize(2, Type); + } + if (hasData) { + size += pb::CodedOutputStream.ComputeBytesSize(3, Data); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static BlobFromOfType ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static BlobFromOfType ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static BlobFromOfType ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static BlobFromOfType ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static BlobFromOfType ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static BlobFromOfType ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static BlobFromOfType ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static BlobFromOfType ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static BlobFromOfType ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static BlobFromOfType ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private BlobFromOfType MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(BlobFromOfType prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(BlobFromOfType cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private BlobFromOfType result; + + private BlobFromOfType PrepareBuilder() { + if (resultIsReadOnly) { + BlobFromOfType original = result; + result = new BlobFromOfType(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override BlobFromOfType MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.BlobFromOfType.Descriptor; } + } + + public override BlobFromOfType DefaultInstanceForType { + get { return global::bnet.protocol.exchange.BlobFromOfType.DefaultInstance; } + } + + public override BlobFromOfType BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is BlobFromOfType) { + return MergeFrom((BlobFromOfType) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(BlobFromOfType other) { + if (other == global::bnet.protocol.exchange.BlobFromOfType.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasSource) { + Source = other.Source; + } + if (other.HasType) { + Type = other.Type; + } + if (other.HasData) { + Data = other.Data; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_blobFromOfTypeFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _blobFromOfTypeFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 13: { + result.hasSource = input.ReadFixed32(ref result.source_); + break; + } + case 18: { + result.hasType = input.ReadString(ref result.type_); + break; + } + case 26: { + result.hasData = input.ReadBytes(ref result.data_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasSource { + get { return result.hasSource; } + } + public uint Source { + get { return result.Source; } + set { SetSource(value); } + } + public Builder SetSource(uint value) { + PrepareBuilder(); + result.hasSource = true; + result.source_ = value; + return this; + } + public Builder ClearSource() { + PrepareBuilder(); + result.hasSource = false; + result.source_ = 0; + return this; + } + + public bool HasType { + get { return result.hasType; } + } + public string Type { + get { return result.Type; } + set { SetType(value); } + } + public Builder SetType(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasType = true; + result.type_ = value; + return this; + } + public Builder ClearType() { + PrepareBuilder(); + result.hasType = false; + result.type_ = ""; + return this; + } + + public bool HasData { + get { return result.hasData; } + } + public pb::ByteString Data { + get { return result.Data; } + set { SetData(value); } + } + public Builder SetData(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasData = true; + result.data_ = value; + return this; + } + public Builder ClearData() { + PrepareBuilder(); + result.hasData = false; + result.data_ = pb::ByteString.Empty; + return this; + } + } + static BlobFromOfType() { + object.ReferenceEquals(global::bnet.protocol.exchange.Exchange.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ActionResultDetail : pb::GeneratedMessage { + private ActionResultDetail() { } + private static readonly ActionResultDetail defaultInstance = new ActionResultDetail().MakeReadOnly(); + private static readonly string[] _actionResultDetailFieldNames = new string[] { "category", "result_reason" }; + private static readonly uint[] _actionResultDetailFieldTags = new uint[] { 8, 16 }; + public static ActionResultDetail DefaultInstance { + get { return defaultInstance; } + } + + public override ActionResultDetail DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ActionResultDetail ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Exchange.internal__static_bnet_protocol_exchange_ActionResultDetail__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Exchange.internal__static_bnet_protocol_exchange_ActionResultDetail__FieldAccessorTable; } + } + + public const int CategoryFieldNumber = 1; + private bool hasCategory; + private uint category_; + public bool HasCategory { + get { return hasCategory; } + } + public uint Category { + get { return category_; } + } + + public const int ResultReasonFieldNumber = 2; + private bool hasResultReason; + private uint resultReason_; + public bool HasResultReason { + get { return hasResultReason; } + } + public uint ResultReason { + get { return resultReason_; } + } + + public override bool IsInitialized { + get { + if (!hasCategory) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _actionResultDetailFieldNames; + if (hasCategory) { + output.WriteUInt32(1, field_names[0], Category); + } + if (hasResultReason) { + output.WriteUInt32(2, field_names[1], ResultReason); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasCategory) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, Category); + } + if (hasResultReason) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, ResultReason); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ActionResultDetail ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ActionResultDetail ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ActionResultDetail ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ActionResultDetail ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ActionResultDetail ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ActionResultDetail ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ActionResultDetail ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ActionResultDetail ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ActionResultDetail ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ActionResultDetail ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ActionResultDetail MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ActionResultDetail prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ActionResultDetail cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ActionResultDetail result; + + private ActionResultDetail PrepareBuilder() { + if (resultIsReadOnly) { + ActionResultDetail original = result; + result = new ActionResultDetail(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ActionResultDetail MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.ActionResultDetail.Descriptor; } + } + + public override ActionResultDetail DefaultInstanceForType { + get { return global::bnet.protocol.exchange.ActionResultDetail.DefaultInstance; } + } + + public override ActionResultDetail BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ActionResultDetail) { + return MergeFrom((ActionResultDetail) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ActionResultDetail other) { + if (other == global::bnet.protocol.exchange.ActionResultDetail.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasCategory) { + Category = other.Category; + } + if (other.HasResultReason) { + ResultReason = other.ResultReason; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_actionResultDetailFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _actionResultDetailFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasCategory = input.ReadUInt32(ref result.category_); + break; + } + case 16: { + result.hasResultReason = input.ReadUInt32(ref result.resultReason_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasCategory { + get { return result.hasCategory; } + } + public uint Category { + get { return result.Category; } + set { SetCategory(value); } + } + public Builder SetCategory(uint value) { + PrepareBuilder(); + result.hasCategory = true; + result.category_ = value; + return this; + } + public Builder ClearCategory() { + PrepareBuilder(); + result.hasCategory = false; + result.category_ = 0; + return this; + } + + public bool HasResultReason { + get { return result.hasResultReason; } + } + public uint ResultReason { + get { return result.ResultReason; } + set { SetResultReason(value); } + } + public Builder SetResultReason(uint value) { + PrepareBuilder(); + result.hasResultReason = true; + result.resultReason_ = value; + return this; + } + public Builder ClearResultReason() { + PrepareBuilder(); + result.hasResultReason = false; + result.resultReason_ = 0; + return this; + } + } + static ActionResultDetail() { + object.ReferenceEquals(global::bnet.protocol.exchange.Exchange.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class BillingAddress : pb::GeneratedMessage { + private BillingAddress() { } + private static readonly BillingAddress defaultInstance = new BillingAddress().MakeReadOnly(); + private static readonly string[] _billingAddressFieldNames = new string[] { "city", "country_id", "postal_code", "state" }; + private static readonly uint[] _billingAddressFieldTags = new uint[] { 18, 8, 34, 26 }; + public static BillingAddress DefaultInstance { + get { return defaultInstance; } + } + + public override BillingAddress DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override BillingAddress ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Exchange.internal__static_bnet_protocol_exchange_BillingAddress__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Exchange.internal__static_bnet_protocol_exchange_BillingAddress__FieldAccessorTable; } + } + + public const int CountryIdFieldNumber = 1; + private bool hasCountryId; + private int countryId_; + public bool HasCountryId { + get { return hasCountryId; } + } + public int CountryId { + get { return countryId_; } + } + + public const int CityFieldNumber = 2; + private bool hasCity; + private string city_ = ""; + public bool HasCity { + get { return hasCity; } + } + public string City { + get { return city_; } + } + + public const int StateFieldNumber = 3; + private bool hasState; + private string state_ = ""; + public bool HasState { + get { return hasState; } + } + public string State { + get { return state_; } + } + + public const int PostalCodeFieldNumber = 4; + private bool hasPostalCode; + private string postalCode_ = ""; + public bool HasPostalCode { + get { return hasPostalCode; } + } + public string PostalCode { + get { return postalCode_; } + } + + public override bool IsInitialized { + get { + if (!hasCountryId) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _billingAddressFieldNames; + if (hasCountryId) { + output.WriteInt32(1, field_names[1], CountryId); + } + if (hasCity) { + output.WriteString(2, field_names[0], City); + } + if (hasState) { + output.WriteString(3, field_names[3], State); + } + if (hasPostalCode) { + output.WriteString(4, field_names[2], PostalCode); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasCountryId) { + size += pb::CodedOutputStream.ComputeInt32Size(1, CountryId); + } + if (hasCity) { + size += pb::CodedOutputStream.ComputeStringSize(2, City); + } + if (hasState) { + size += pb::CodedOutputStream.ComputeStringSize(3, State); + } + if (hasPostalCode) { + size += pb::CodedOutputStream.ComputeStringSize(4, PostalCode); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static BillingAddress ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static BillingAddress ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static BillingAddress ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static BillingAddress ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static BillingAddress ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static BillingAddress ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static BillingAddress ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static BillingAddress ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static BillingAddress ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static BillingAddress ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private BillingAddress MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(BillingAddress prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(BillingAddress cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private BillingAddress result; + + private BillingAddress PrepareBuilder() { + if (resultIsReadOnly) { + BillingAddress original = result; + result = new BillingAddress(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override BillingAddress MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.BillingAddress.Descriptor; } + } + + public override BillingAddress DefaultInstanceForType { + get { return global::bnet.protocol.exchange.BillingAddress.DefaultInstance; } + } + + public override BillingAddress BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is BillingAddress) { + return MergeFrom((BillingAddress) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(BillingAddress other) { + if (other == global::bnet.protocol.exchange.BillingAddress.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasCountryId) { + CountryId = other.CountryId; + } + if (other.HasCity) { + City = other.City; + } + if (other.HasState) { + State = other.State; + } + if (other.HasPostalCode) { + PostalCode = other.PostalCode; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_billingAddressFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _billingAddressFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasCountryId = input.ReadInt32(ref result.countryId_); + break; + } + case 18: { + result.hasCity = input.ReadString(ref result.city_); + break; + } + case 26: { + result.hasState = input.ReadString(ref result.state_); + break; + } + case 34: { + result.hasPostalCode = input.ReadString(ref result.postalCode_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasCountryId { + get { return result.hasCountryId; } + } + public int CountryId { + get { return result.CountryId; } + set { SetCountryId(value); } + } + public Builder SetCountryId(int value) { + PrepareBuilder(); + result.hasCountryId = true; + result.countryId_ = value; + return this; + } + public Builder ClearCountryId() { + PrepareBuilder(); + result.hasCountryId = false; + result.countryId_ = 0; + return this; + } + + public bool HasCity { + get { return result.hasCity; } + } + public string City { + get { return result.City; } + set { SetCity(value); } + } + public Builder SetCity(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasCity = true; + result.city_ = value; + return this; + } + public Builder ClearCity() { + PrepareBuilder(); + result.hasCity = false; + result.city_ = ""; + return this; + } + + public bool HasState { + get { return result.hasState; } + } + public string State { + get { return result.State; } + set { SetState(value); } + } + public Builder SetState(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasState = true; + result.state_ = value; + return this; + } + public Builder ClearState() { + PrepareBuilder(); + result.hasState = false; + result.state_ = ""; + return this; + } + + public bool HasPostalCode { + get { return result.hasPostalCode; } + } + public string PostalCode { + get { return result.PostalCode; } + set { SetPostalCode(value); } + } + public Builder SetPostalCode(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPostalCode = true; + result.postalCode_ = value; + return this; + } + public Builder ClearPostalCode() { + PrepareBuilder(); + result.hasPostalCode = false; + result.postalCode_ = ""; + return this; + } + } + static BillingAddress() { + object.ReferenceEquals(global::bnet.protocol.exchange.Exchange.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/LibMooNet/bnet/protocol/exchange/ExchangeService.cs b/src/LibMooNet/bnet/protocol/exchange/ExchangeService.cs new file mode 100644 index 00000000..5d530f49 --- /dev/null +++ b/src/LibMooNet/bnet/protocol/exchange/ExchangeService.cs @@ -0,0 +1,24554 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace bnet.protocol.exchange { + + namespace Proto { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class ExchangeService { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_CreateOrderBookRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_CreateOrderBookRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_CreateOrderBookResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_CreateOrderBookResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_PlaceOfferOnOrderBookRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_PlaceOfferOnOrderBookRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_PlaceOfferOnOrderBookResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_PlaceOfferOnOrderBookResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_PlaceOfferCreateOrderBookIfNeededRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_PlaceOfferCreateOrderBookIfNeededRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_PlaceOfferCreateOrderBookIfNeededResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_PlaceOfferCreateOrderBookIfNeededResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_PlaceBidOnOrderBookRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_PlaceBidOnOrderBookRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_PlaceBidOnOrderBookResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_PlaceBidOnOrderBookResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_PlaceBidCreateOrderBookIfNeededRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_PlaceBidCreateOrderBookIfNeededRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_PlaceBidCreateOrderBookIfNeededResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_PlaceBidCreateOrderBookIfNeededResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_QueryOffersByOrderBookRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_QueryOffersByOrderBookRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_QueryOffersByOrderBookResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_QueryOffersByOrderBookResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_QueryBidsByOrderBookRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_QueryBidsByOrderBookRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_QueryBidsByOrderBookResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_QueryBidsByOrderBookResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_QueryOffersByAccountForItemRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_QueryOffersByAccountForItemRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_QueryOffersByAccountForItemResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_QueryOffersByAccountForItemResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_QueryBidsByAccountForItemRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_QueryBidsByAccountForItemRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_QueryBidsByAccountForItemResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_QueryBidsByAccountForItemResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_QueryOrderBooksSummaryRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_QueryOrderBooksSummaryRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_QueryOrderBooksSummaryResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_QueryOrderBooksSummaryResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_SubscribeOrderBookStatusChangeRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_SubscribeOrderBookStatusChangeRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_UnsubscribeOrderBookStatusChangeRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_UnsubscribeOrderBookStatusChangeRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_SubscribeOrderUpdateRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_SubscribeOrderUpdateRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_UnsubscribeOrderUpdateRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_UnsubscribeOrderUpdateRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_SubscribeAdvancedOrderUpdateRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_SubscribeAdvancedOrderUpdateRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_UnsubscribeAdvancedOrderUpdateRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_UnsubscribeAdvancedOrderUpdateRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_ClaimRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_ClaimRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_CancelRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_CancelRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_RefundRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_RefundRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_GetConfigurationRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_GetConfigurationRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_GetConfigurationResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_GetConfigurationResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_GetOfferFeeEstimationRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_GetOfferFeeEstimationRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_GetBidFeeEstimationRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_GetBidFeeEstimationRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_GetFeeEstimationResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_GetFeeEstimationResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_OrderBookNotificationRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_OrderBookNotificationRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_OfferNotificationRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_OfferNotificationRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_BidNotificationRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_BidNotificationRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_CustomNotificationRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_CustomNotificationRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_QueryOrdersByAccountForItemRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_QueryOrdersByAccountForItemRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_QueryOrdersByAccountForItemResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_QueryOrdersByAccountForItemResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_GetFeeDetailsRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_GetFeeDetailsRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_GetFeeDetailsResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_GetFeeDetailsResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_GetOrderBookStatisticsRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_GetOrderBookStatisticsRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_GetOrderBookStatisticsResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_GetOrderBookStatisticsResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_GetBidDetailsRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_GetBidDetailsRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_GetBidDetailsResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_GetBidDetailsResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_GetOfferDetailsRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_GetOfferDetailsRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_GetOfferDetailsResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_GetOfferDetailsResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_GetSystemTimeResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_GetSystemTimeResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_CreateCSTradeRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_CreateCSTradeRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_CreateCSTradeItemRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_CreateCSTradeItemRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_CreateCSTradeMoneyRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_CreateCSTradeMoneyRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_CreateCSTradeResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_CreateCSTradeResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_GetOrderCountRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_GetOrderCountRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_GetOrderCountResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_GetOrderCountResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_HistoriesForCSRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_HistoriesForCSRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_HistoriesForCSResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_HistoriesForCSResponse__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static ExchangeService() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "ChtibmV0L2V4Y2hhbmdlX3NlcnZpY2UucHJvdG8SFmJuZXQucHJvdG9jb2wu" + + "ZXhjaGFuZ2UaDmJuZXQvcnBjLnByb3RvGhNibmV0L2V4Y2hhbmdlLnByb3Rv" + + "GilibmV0L2V4Y2hhbmdlX29iamVjdF9wcm92aWRlcl90eXBlcy5wcm90bxoe" + + "Ym5ldC9leGNoYW5nZV9yaXNrX3R5cGVzLnByb3RvGhFibmV0L2VudGl0eS5w" + + "cm90bxoYYm5ldC9hY2NvdW50X3R5cGVzLnByb3RvGhlibmV0L2V4Y2hhbmdl" + + "X3R5cGVzLnByb3RvIooBChZDcmVhdGVPcmRlckJvb2tSZXF1ZXN0EjkKDHBh" + + "cnRpdGlvbl9pZBgBIAIoCzIjLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuUGFy" + + "dGl0aW9uSWQSNQoKb3JkZXJfYm9vaxgCIAIoCzIhLmJuZXQucHJvdG9jb2wu" + + "ZXhjaGFuZ2UuT3JkZXJCb29rIjAKF0NyZWF0ZU9yZGVyQm9va1Jlc3BvbnNl" + + "EhUKDW9yZGVyX2Jvb2tfaWQYASABKAQimAEKHFBsYWNlT2ZmZXJPbk9yZGVy" + + "Qm9va1JlcXVlc3QSOQoMcGFydGl0aW9uX2lkGAEgAigLMiMuYm5ldC5wcm90" + + "b2NvbC5leGNoYW5nZS5QYXJ0aXRpb25JZBI9Cg5vZmZlcl9jcmVhdGlvbhgC" + + "IAIoCzIlLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuT2ZmZXJDcmVhdGlvbiJI" + + "Ch1QbGFjZU9mZmVyT25PcmRlckJvb2tSZXNwb25zZRIVCg1vcmRlcl9ib29r" + + "X2lkGAEgASgEEhAKCG9mZmVyX2lkGAIgASgEItsBCihQbGFjZU9mZmVyQ3Jl" + + "YXRlT3JkZXJCb29rSWZOZWVkZWRSZXF1ZXN0EjkKDHBhcnRpdGlvbl9pZBgB" + + "IAIoCzIjLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuUGFydGl0aW9uSWQSNQoK" + + "b3JkZXJfYm9vaxgCIAIoCzIhLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuT3Jk" + + "ZXJCb29rEj0KDm9mZmVyX2NyZWF0aW9uGAMgAigLMiUuYm5ldC5wcm90b2Nv" + + "bC5leGNoYW5nZS5PZmZlckNyZWF0aW9uIlQKKVBsYWNlT2ZmZXJDcmVhdGVP" + + "cmRlckJvb2tJZk5lZWRlZFJlc3BvbnNlEhUKDW9yZGVyX2Jvb2tfaWQYASAB" + + "KAQSEAoIb2ZmZXJfaWQYAiABKAQikgEKGlBsYWNlQmlkT25PcmRlckJvb2tS" + + "ZXF1ZXN0EjkKDHBhcnRpdGlvbl9pZBgBIAIoCzIjLmJuZXQucHJvdG9jb2wu" + + "ZXhjaGFuZ2UuUGFydGl0aW9uSWQSOQoMYmlkX2NyZWF0aW9uGAIgAigLMiMu" + + "Ym5ldC5wcm90b2NvbC5leGNoYW5nZS5CaWRDcmVhdGlvbiJEChtQbGFjZUJp" + + "ZE9uT3JkZXJCb29rUmVzcG9uc2USFQoNb3JkZXJfYm9va19pZBgBIAEoBBIO" + + "CgZiaWRfaWQYAiABKAQi1QEKJlBsYWNlQmlkQ3JlYXRlT3JkZXJCb29rSWZO" + + "ZWVkZWRSZXF1ZXN0EjkKDHBhcnRpdGlvbl9pZBgBIAIoCzIjLmJuZXQucHJv" + + "dG9jb2wuZXhjaGFuZ2UuUGFydGl0aW9uSWQSNQoKb3JkZXJfYm9vaxgCIAIo" + + "CzIhLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuT3JkZXJCb29rEjkKDGJpZF9j" + + "cmVhdGlvbhgDIAIoCzIjLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuQmlkQ3Jl" + + "YXRpb24iUAonUGxhY2VCaWRDcmVhdGVPcmRlckJvb2tJZk5lZWRlZFJlc3Bv" + + "bnNlEhUKDW9yZGVyX2Jvb2tfaWQYASABKAQSDgoGYmlkX2lkGAIgASgEIqgB" + + "Ch1RdWVyeU9mZmVyc0J5T3JkZXJCb29rUmVxdWVzdBI5CgxwYXJ0aXRpb25f" + + "aWQYASACKAsyIy5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLlBhcnRpdGlvbklk" + + "EjwKBmZpbHRlchgCIAIoCzIsLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuUXVl" + + "cnlGaWx0ZXJCeU9yZGVySWQSDgoGc3RhdHVzGAMgAigFImwKHlF1ZXJ5T2Zm" + + "ZXJzQnlPcmRlckJvb2tSZXNwb25zZRI1CgZvZmZlcnMYASADKAsyJS5ibmV0" + + "LnByb3RvY29sLmV4Y2hhbmdlLk9mZmVyRXh0ZW5kZWQSEwoLdG90YWxfY291" + + "bnQYAiACKA0ipgEKG1F1ZXJ5Qmlkc0J5T3JkZXJCb29rUmVxdWVzdBI5Cgxw" + + "YXJ0aXRpb25faWQYASACKAsyIy5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLlBh" + + "cnRpdGlvbklkEjwKBmZpbHRlchgCIAIoCzIsLmJuZXQucHJvdG9jb2wuZXhj" + + "aGFuZ2UuUXVlcnlGaWx0ZXJCeU9yZGVySWQSDgoGc3RhdHVzGAMgAigFImYK" + + "HFF1ZXJ5Qmlkc0J5T3JkZXJCb29rUmVzcG9uc2USMQoEYmlkcxgBIAMoCzIj" + + "LmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuQmlkRXh0ZW5kZWQSEwoLdG90YWxf" + + "Y291bnQYAiACKA0i0QEKIlF1ZXJ5T2ZmZXJzQnlBY2NvdW50Rm9ySXRlbVJl" + + "cXVlc3QSOgoQYWNjb3VudF9mb3JfaXRlbRgBIAIoCzIgLmJuZXQucHJvdG9j" + + "b2wuZXhjaGFuZ2UuQmxvYkZyb20SQAoGZmlsdGVyGAIgAigLMjAuYm5ldC5w" + + "cm90b2NvbC5leGNoYW5nZS5RdWVyeUZpbHRlckJ5Q3JlYXRlZFRpbWUSLQoM" + + "Ym5ldF9hY2NvdW50GAMgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZCJx" + + "CiNRdWVyeU9mZmVyc0J5QWNjb3VudEZvckl0ZW1SZXNwb25zZRI1CgZvZmZl" + + "cnMYASADKAsyJS5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLk9mZmVyRXh0ZW5k" + + "ZWQSEwoLdG90YWxfY291bnQYAiACKA0izwEKIFF1ZXJ5Qmlkc0J5QWNjb3Vu" + + "dEZvckl0ZW1SZXF1ZXN0EjoKEGFjY291bnRfZm9yX2l0ZW0YASACKAsyIC5i" + + "bmV0LnByb3RvY29sLmV4Y2hhbmdlLkJsb2JGcm9tEkAKBmZpbHRlchgCIAIo" + + "CzIwLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuUXVlcnlGaWx0ZXJCeUNyZWF0" + + "ZWRUaW1lEi0KDGJuZXRfYWNjb3VudBgDIAEoCzIXLmJuZXQucHJvdG9jb2wu" + + "RW50aXR5SWQiawohUXVlcnlCaWRzQnlBY2NvdW50Rm9ySXRlbVJlc3BvbnNl" + + "EjEKBGJpZHMYASADKAsyIy5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLkJpZEV4" + + "dGVuZGVkEhMKC3RvdGFsX2NvdW50GAIgAigNIlkKHVF1ZXJ5T3JkZXJCb29r" + + "c1N1bW1hcnlSZXF1ZXN0EjgKB2hhbmRsZXMYASADKAsyJy5ibmV0LnByb3Rv" + + "Y29sLmV4Y2hhbmdlLk9yZGVyQm9va0hhbmRsZSJfCh5RdWVyeU9yZGVyQm9v" + + "a3NTdW1tYXJ5UmVzcG9uc2USPQoLb3JkZXJfYm9va3MYASADKAsyKC5ibmV0" + + "LnByb3RvY29sLmV4Y2hhbmdlLk9yZGVyQm9va1N1bW1hcnkiuQIKJVN1YnNj" + + "cmliZU9yZGVyQm9va1N0YXR1c0NoYW5nZVJlcXVlc3QSEQoJb2JqZWN0X2lk" + + "GAEgAigEEj0KEG1pbl9wYXJ0aXRpb25faWQYAiACKAsyIy5ibmV0LnByb3Rv" + + "Y29sLmV4Y2hhbmdlLlBhcnRpdGlvbklkEj0KEG1heF9wYXJ0aXRpb25faWQY" + + "AyACKAsyIy5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLlBhcnRpdGlvbklkEg8K" + + "B3Byb2dyYW0YBCACKAcSDgoGc3RhdHVzGAUgAigFEhAKCGN1cnJlbmN5GAYg" + + "AigJEhIKCnNwZWNpYWxpc3QYByACKAUSEQoJYm9vdHN0cmFwGAggASgIEiUK" + + "HWJvb3RzdHJhcF9vbGRlc3RfY3JlYXRlZF90aW1lGAkgASgEIikKJ1Vuc3Vi" + + "c2NyaWJlT3JkZXJCb29rU3RhdHVzQ2hhbmdlUmVxdWVzdCJbChtTdWJzY3Jp" + + "YmVPcmRlclVwZGF0ZVJlcXVlc3QSKQoIYWdlbnRfaWQYASACKAsyFy5ibmV0" + + "LnByb3RvY29sLkVudGl0eUlkEhEKCW9iamVjdF9pZBgCIAIoBCJdCh1VbnN1" + + "YnNjcmliZU9yZGVyVXBkYXRlUmVxdWVzdBIpCghhZ2VudF9pZBgBIAIoCzIX" + + "LmJuZXQucHJvdG9jb2wuRW50aXR5SWQSEQoJb2JqZWN0X2lkGAIgAigEIvUB" + + "CiNTdWJzY3JpYmVBZHZhbmNlZE9yZGVyVXBkYXRlUmVxdWVzdBIRCglvYmpl" + + "Y3RfaWQYASACKAQSPQoQbWluX3BhcnRpdGlvbl9pZBgCIAIoCzIjLmJuZXQu" + + "cHJvdG9jb2wuZXhjaGFuZ2UuUGFydGl0aW9uSWQSPQoQbWF4X3BhcnRpdGlv" + + "bl9pZBgDIAIoCzIjLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuUGFydGl0aW9u" + + "SWQSPQoHZmlsdGVycxgEIAMoCzIsLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2Uu" + + "QWR2YW5jZWRTdWJzY3JpcHRpb24iJwolVW5zdWJzY3JpYmVBZHZhbmNlZE9y" + + "ZGVyVXBkYXRlUmVxdWVzdCLSAQoMQ2xhaW1SZXF1ZXN0EjkKDHBhcnRpdGlv" + + "bl9pZBgBIAEoCzIjLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuUGFydGl0aW9u" + + "SWQSEAoIb3JkZXJfaWQYAiABKAQSDwoHcHJvZ3JhbRgDIAEoBxItCgxibmV0" + + "X2FjY291bnQYBCABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEjUKC2lu" + + "Zm9ybWF0aW9uGAUgASgLMiAuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5CbG9i" + + "RnJvbSKbAQoNQ2FuY2VsUmVxdWVzdBI5CgxwYXJ0aXRpb25faWQYASACKAsy" + + "Iy5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLlBhcnRpdGlvbklkEhAKCG9yZGVy" + + "X2lkGAIgAigEEg4KBnJlYXNvbhgDIAEoDRItCgxibmV0X2FjY291bnQYBCAB" + + "KAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkIoIBCg1SZWZ1bmRSZXF1ZXN0" + + "EjkKDHBhcnRpdGlvbl9pZBgBIAIoCzIjLmJuZXQucHJvdG9jb2wuZXhjaGFu" + + "Z2UuUGFydGl0aW9uSWQSEAoIb3JkZXJfaWQYAiACKAQSEAoIY3Nfbm90ZXMY" + + "AyACKAkSEgoKY3NfdXNlcl9pZBgEIAIoBCIqChdHZXRDb25maWd1cmF0aW9u" + + "UmVxdWVzdBIPCgdwcm9ncmFtGAEgAigHIskBChhHZXRDb25maWd1cmF0aW9u" + + "UmVzcG9uc2USOQoHY29uZmlncxgBIAMoCzIoLmJuZXQucHJvdG9jb2wuZXhj" + + "aGFuZ2UuU3BlY2lhbGlzdENvbmZpZxJIChlybXRfcmVzdHJpY3RlZF9ieV9s" + + "aWNlbnNlGAIgASgLMiUuYm5ldC5wcm90b2NvbC5hY2NvdW50LkFjY291bnRM" + + "aWNlbnNlEigKIHJlY29tbWVuZGVkX2RlZmF1bHRfcm10X2N1cnJlbmN5GAMg" + + "ASgJIpIBChxHZXRPZmZlckZlZUVzdGltYXRpb25SZXF1ZXN0EjkKDHBhcnRp" + + "dGlvbl9pZBgBIAIoCzIjLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuUGFydGl0" + + "aW9uSWQSNwoEZGF0YRgCIAIoCzIpLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2Uu" + + "RmVlRXN0aW1hdGlvbkRhdGEikAEKGkdldEJpZEZlZUVzdGltYXRpb25SZXF1" + + "ZXN0EjkKDHBhcnRpdGlvbl9pZBgBIAIoCzIjLmJuZXQucHJvdG9jb2wuZXhj" + + "aGFuZ2UuUGFydGl0aW9uSWQSNwoEZGF0YRgCIAIoCzIpLmJuZXQucHJvdG9j" + + "b2wuZXhjaGFuZ2UuRmVlRXN0aW1hdGlvbkRhdGEiZgoYR2V0RmVlRXN0aW1h" + + "dGlvblJlc3BvbnNlEhIKCmZlZV9hbW91bnQYASACKAQSNgoLZmVlX2RldGFp" + + "bHMYAiADKAsyIS5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLkZlZURldGFpbCJ9" + + "ChxPcmRlckJvb2tOb3RpZmljYXRpb25SZXF1ZXN0EkQKDW5vdGlmaWNhdGlv" + + "bnMYASADKAsyLS5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLk9yZGVyQm9va05v" + + "dGlmaWNhdGlvbhIXCg9ib290X3N0cmFwX2xhc3QYAiABKAgipwEKGE9mZmVy" + + "Tm90aWZpY2F0aW9uUmVxdWVzdBI0CgVvZmZlchgBIAIoCzIlLmJuZXQucHJv" + + "dG9jb2wuZXhjaGFuZ2UuT2ZmZXJFeHRlbmRlZBINCgVldmVudBgCIAIoDRIT" + + "CgtvYmplY3RfdHlwZRgDIAEoDRIUCgxjbGFpbV9yZXN1bHQYBCABKA0SGwoT" + + "Y2xhaW1fcmVzdWx0X3JlYXNvbhgFIAEoDSKhAQoWQmlkTm90aWZpY2F0aW9u" + + "UmVxdWVzdBIwCgNiaWQYASACKAsyIy5ibmV0LnByb3RvY29sLmV4Y2hhbmdl" + + "LkJpZEV4dGVuZGVkEg0KBWV2ZW50GAIgAigNEhMKC29iamVjdF90eXBlGAMg" + + "ASgNEhQKDGNsYWltX3Jlc3VsdBgEIAEoDRIbChNjbGFpbV9yZXN1bHRfcmVh" + + "c29uGAUgASgNIpYBChlDdXN0b21Ob3RpZmljYXRpb25SZXF1ZXN0EjcKBmhh" + + "bmRsZRgBIAIoCzInLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuT3JkZXJCb29r" + + "SGFuZGxlEhAKCG9yZGVyX2lkGAIgAigEEi4KBGluZm8YAyACKAsyIC5ibmV0" + + "LnByb3RvY29sLmV4Y2hhbmdlLkJsb2JGcm9tIskBCiJRdWVyeU9yZGVyc0J5" + + "QWNjb3VudEZvckl0ZW1SZXF1ZXN0EjoKEGFjY291bnRfZm9yX2l0ZW0YASAC" + + "KAsyIC5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLkJsb2JGcm9tEi0KDGJuZXRf" + + "YWNjb3VudBgCIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSOAoGZmls" + + "dGVyGAMgAigLMiguYm5ldC5wcm90b2NvbC5leGNoYW5nZS5RdWVyeU9yZGVy" + + "RmlsdGVyInEKI1F1ZXJ5T3JkZXJzQnlBY2NvdW50Rm9ySXRlbVJlc3BvbnNl" + + "EjUKBm9yZGVycxgBIAMoCzIlLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuT3Jk" + + "ZXJFeHRlbmRlZBITCgt0b3RhbF9jb3VudBgCIAIoDSKSAQoUR2V0RmVlRGV0" + + "YWlsc1JlcXVlc3QSOQoMcGFydGl0aW9uX2lkGAEgAigLMiMuYm5ldC5wcm90" + + "b2NvbC5leGNoYW5nZS5QYXJ0aXRpb25JZBIQCghvcmRlcl9pZBgCIAIoBBIt" + + "CgxibmV0X2FjY291bnQYAyABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlk" + + "Io4BChVHZXRGZWVEZXRhaWxzUmVzcG9uc2USOQoOZmVlX2RldGFpbHNfaW4Y" + + "ASADKAsyIS5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLkZlZURldGFpbBI6Cg9m" + + "ZWVfZGV0YWlsc19vdXQYAiADKAsyIS5ibmV0LnByb3RvY29sLmV4Y2hhbmdl" + + "LkZlZURldGFpbCKoAQodR2V0T3JkZXJCb29rU3RhdGlzdGljc1JlcXVlc3QS" + + "OQoMcGFydGl0aW9uX2lkGAEgAigLMiMuYm5ldC5wcm90b2NvbC5leGNoYW5n" + + "ZS5QYXJ0aXRpb25JZBISCgpvcmRlcl90eXBlGAIgAigNEhAKCHF1YW50aXR5" + + "GAMgAigEEhMKC2xhc3RfdHJhZGVzGAQgAigNEhEKCWxhc3RfZGF5cxgFIAIo" + + "DSKUAQoeR2V0T3JkZXJCb29rU3RhdGlzdGljc1Jlc3BvbnNlEjoKDXByaWNl" + + "X2RldGFpbHMYASADKAsyIy5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLlByaWNl" + + "RGV0YWlsEhsKE2xhc3RfdHJhZGVzX2F2ZXJhZ2UYAiACKAQSGQoRbGFzdF9k" + + "YXlzX2F2ZXJhZ2UYAyACKAQiYwoUR2V0QmlkRGV0YWlsc1JlcXVlc3QSEAoI" + + "b3JkZXJfaWQYASACKAQSOQoMcGFydGl0aW9uX2lkGAIgAigLMiMuYm5ldC5w" + + "cm90b2NvbC5leGNoYW5nZS5QYXJ0aXRpb25JZCJLChVHZXRCaWREZXRhaWxz" + + "UmVzcG9uc2USMgoDYmlkGAEgAigLMiUuYm5ldC5wcm90b2NvbC5leGNoYW5n" + + "ZS5PcmRlckV4dGVuZGVkImUKFkdldE9mZmVyRGV0YWlsc1JlcXVlc3QSEAoI" + + "b3JkZXJfaWQYASACKAQSOQoMcGFydGl0aW9uX2lkGAIgAigLMiMuYm5ldC5w" + + "cm90b2NvbC5leGNoYW5nZS5QYXJ0aXRpb25JZCJPChdHZXRPZmZlckRldGFp" + + "bHNSZXNwb25zZRI0CgVvZmZlchgBIAIoCzIlLmJuZXQucHJvdG9jb2wuZXhj" + + "aGFuZ2UuT3JkZXJFeHRlbmRlZCIlChVHZXRTeXN0ZW1UaW1lUmVzcG9uc2US" + + "DAoEdGltZRgBIAIoBCLYAgoUQ3JlYXRlQ1NUcmFkZVJlcXVlc3QSOQoMcGFy" + + "dGl0aW9uX2lkGAEgASgLMiMuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5QYXJ0" + + "aXRpb25JZBI1CgpvcmRlcl9ib29rGAIgAigLMiEuYm5ldC5wcm90b2NvbC5l" + + "eGNoYW5nZS5PcmRlckJvb2sSDgoGYW1vdW50GAMgAigNEi0KDGJuZXRfYWNj" + + "b3VudBgEIAIoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSLQoMZ2FtZV9h" + + "Y2NvdW50GAUgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBI6ChBhY2Nv" + + "dW50X2Zvcl9pdGVtGAYgAigLMiAuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5C" + + "bG9iRnJvbRIQCghjc19ub3RlcxgHIAIoCRISCgpjc191c2VyX2lkGAggAigE" + + "ItwCChhDcmVhdGVDU1RyYWRlSXRlbVJlcXVlc3QSOQoMcGFydGl0aW9uX2lk" + + "GAEgASgLMiMuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5QYXJ0aXRpb25JZBI1" + + "CgpvcmRlcl9ib29rGAIgAigLMiEuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5P" + + "cmRlckJvb2sSDgoGYW1vdW50GAMgAigNEi0KDGJuZXRfYWNjb3VudBgEIAIo" + + "CzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSLQoMZ2FtZV9hY2NvdW50GAUg" + + "ASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBI6ChBhY2NvdW50X2Zvcl9p" + + "dGVtGAYgAigLMiAuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5CbG9iRnJvbRIQ" + + "Cghjc19ub3RlcxgHIAIoCRISCgpjc191c2VyX2lkGAggAigEIpoDChlDcmVh" + + "dGVDU1RyYWRlTW9uZXlSZXF1ZXN0EjkKDHBhcnRpdGlvbl9pZBgBIAEoCzIj" + + "LmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuUGFydGl0aW9uSWQSNQoKb3JkZXJf" + + "Ym9vaxgCIAIoCzIhLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuT3JkZXJCb29r" + + "Eg4KBmFtb3VudBgDIAIoDRItCgxibmV0X2FjY291bnQYBCACKAsyFy5ibmV0" + + "LnByb3RvY29sLkVudGl0eUlkEi0KDGdhbWVfYWNjb3VudBgFIAEoCzIXLmJu" + + "ZXQucHJvdG9jb2wuRW50aXR5SWQSOgoQYWNjb3VudF9mb3JfaXRlbRgGIAIo" + + "CzIgLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuQmxvYkZyb20SEAoIY3Nfbm90" + + "ZXMYByACKAkSEgoKY3NfdXNlcl9pZBgIIAIoBBI7ChFhY2NvdW50X2Zvcl9t" + + "b25leRgJIAEoCzIgLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuQmxvYkZyb20i" + + "LgoVQ3JlYXRlQ1NUcmFkZVJlc3BvbnNlEhUKDW9yZGVyX2Jvb2tfaWQYASAB" + + "KAQiuQEKFEdldE9yZGVyQ291bnRSZXF1ZXN0EhAKCGN1cnJlbmN5GAEgASgJ" + + "Eg4KBnNvdXJjZRgCIAEoBxItCgxibmV0X2FjY291bnQYAyABKAsyFy5ibmV0" + + "LnByb3RvY29sLkVudGl0eUlkEiUKFm5vdF9jbG9zZWRfb2ZmZXJfY291bnQY" + + "BCABKAg6BWZhbHNlEikKGm9yZGVyX3dpdGhfY2xhaW1hYmxlX2NvdW50GAUg" + + "ASgIOgVmYWxzZSKZAQoVR2V0T3JkZXJDb3VudFJlc3BvbnNlEj0KFm5vdF9j" + + "bG9zZWRfb2ZmZXJfY291bnQYASABKAsyHS5ibmV0LnByb3RvY29sLmV4Y2hh" + + "bmdlLkNvdW50EkEKGm9yZGVyX3dpdGhfY2xhaW1hYmxlX2NvdW50GAIgASgL" + + "Mh0uYm5ldC5wcm90b2NvbC5leGNoYW5nZS5Db3VudCKAAQoVSGlzdG9yaWVz" + + "Rm9yQ1NSZXF1ZXN0Ei0KDGJuZXRfYWNjb3VudBgBIAIoCzIXLmJuZXQucHJv" + + "dG9jb2wuRW50aXR5SWQSDwoHcHJvZ3JhbRgCIAIoBxISCgpsb3dlcl90aW1l" + + "GAMgAigEEhMKC2hpZ2hlcl90aW1lGAQgAigEIlMKFkhpc3Rvcmllc0ZvckNT" + + "UmVzcG9uc2USOQoMaGlzdG9yeV9kYXRhGAEgAygLMiMuYm5ldC5wcm90b2Nv" + + "bC5leGNoYW5nZS5IaXN0b3J5RGF0YTLiKwoPRXhjaGFuZ2VTZXJ2aWNlEngK" + + "D0NyZWF0ZU9yZGVyQm9vaxIuLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuQ3Jl" + + "YXRlT3JkZXJCb29rUmVxdWVzdBovLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2Uu" + + "Q3JlYXRlT3JkZXJCb29rUmVzcG9uc2UiBIC1GAESigEKFVBsYWNlT2ZmZXJP" + + "bk9yZGVyQm9vaxI0LmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuUGxhY2VPZmZl" + + "ck9uT3JkZXJCb29rUmVxdWVzdBo1LmJuZXQucHJvdG9jb2wuZXhjaGFuZ2Uu" + + "UGxhY2VPZmZlck9uT3JkZXJCb29rUmVzcG9uc2UiBIC1GAISrgEKIVBsYWNl" + + "T2ZmZXJDcmVhdGVPcmRlckJvb2tJZk5lZWRlZBJALmJuZXQucHJvdG9jb2wu" + + "ZXhjaGFuZ2UuUGxhY2VPZmZlckNyZWF0ZU9yZGVyQm9va0lmTmVlZGVkUmVx" + + "dWVzdBpBLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuUGxhY2VPZmZlckNyZWF0" + + "ZU9yZGVyQm9va0lmTmVlZGVkUmVzcG9uc2UiBIC1GAMShAEKE1BsYWNlQmlk" + + "T25PcmRlckJvb2sSMi5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLlBsYWNlQmlk" + + "T25PcmRlckJvb2tSZXF1ZXN0GjMuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5Q" + + "bGFjZUJpZE9uT3JkZXJCb29rUmVzcG9uc2UiBIC1GAQSqAEKH1BsYWNlQmlk" + + "Q3JlYXRlT3JkZXJCb29rSWZOZWVkZWQSPi5ibmV0LnByb3RvY29sLmV4Y2hh" + + "bmdlLlBsYWNlQmlkQ3JlYXRlT3JkZXJCb29rSWZOZWVkZWRSZXF1ZXN0Gj8u" + + "Ym5ldC5wcm90b2NvbC5leGNoYW5nZS5QbGFjZUJpZENyZWF0ZU9yZGVyQm9v" + + "a0lmTmVlZGVkUmVzcG9uc2UiBIC1GAUSjQEKFlF1ZXJ5T2ZmZXJzQnlPcmRl" + + "ckJvb2sSNS5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLlF1ZXJ5T2ZmZXJzQnlP" + + "cmRlckJvb2tSZXF1ZXN0GjYuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5RdWVy" + + "eU9mZmVyc0J5T3JkZXJCb29rUmVzcG9uc2UiBIC1GAYShwEKFFF1ZXJ5Qmlk" + + "c0J5T3JkZXJCb29rEjMuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5RdWVyeUJp" + + "ZHNCeU9yZGVyQm9va1JlcXVlc3QaNC5ibmV0LnByb3RvY29sLmV4Y2hhbmdl" + + "LlF1ZXJ5Qmlkc0J5T3JkZXJCb29rUmVzcG9uc2UiBIC1GAcSnAEKG1F1ZXJ5" + + "T2ZmZXJzQnlBY2NvdW50Rm9ySXRlbRI6LmJuZXQucHJvdG9jb2wuZXhjaGFu" + + "Z2UuUXVlcnlPZmZlcnNCeUFjY291bnRGb3JJdGVtUmVxdWVzdBo7LmJuZXQu" + + "cHJvdG9jb2wuZXhjaGFuZ2UuUXVlcnlPZmZlcnNCeUFjY291bnRGb3JJdGVt" + + "UmVzcG9uc2UiBIC1GAgSlgEKGVF1ZXJ5Qmlkc0J5QWNjb3VudEZvckl0ZW0S" + + "OC5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLlF1ZXJ5Qmlkc0J5QWNjb3VudEZv" + + "ckl0ZW1SZXF1ZXN0GjkuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5RdWVyeUJp" + + "ZHNCeUFjY291bnRGb3JJdGVtUmVzcG9uc2UiBIC1GAkSjQEKFlF1ZXJ5T3Jk" + + "ZXJCb29rc1N1bW1hcnkSNS5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLlF1ZXJ5" + + "T3JkZXJCb29rc1N1bW1hcnlSZXF1ZXN0GjYuYm5ldC5wcm90b2NvbC5leGNo" + + "YW5nZS5RdWVyeU9yZGVyQm9va3NTdW1tYXJ5UmVzcG9uc2UiBIC1GAsSbgoP" + + "UmVwb3J0QXV0aG9yaXplEj4uYm5ldC5wcm90b2NvbC5leGNoYW5nZV9vYmpl" + + "Y3RfcHJvdmlkZXIuUmVwb3J0QXV0aG9yaXplUmVxdWVzdBoVLmJuZXQucHJv" + + "dG9jb2wuTm9EYXRhIgSAtRgNEmgKDFJlcG9ydFNldHRsZRI7LmJuZXQucHJv" + + "dG9jb2wuZXhjaGFuZ2Vfb2JqZWN0X3Byb3ZpZGVyLlJlcG9ydFNldHRsZVJl" + + "cXVlc3QaFS5ibmV0LnByb3RvY29sLk5vRGF0YSIEgLUYDhJoCgxSZXBvcnRD" + + "YW5jZWwSOy5ibmV0LnByb3RvY29sLmV4Y2hhbmdlX29iamVjdF9wcm92aWRl" + + "ci5SZXBvcnRDYW5jZWxSZXF1ZXN0GhUuYm5ldC5wcm90b2NvbC5Ob0RhdGEi" + + "BIC1GA8SfAoeU3Vic2NyaWJlT3JkZXJCb29rU3RhdHVzQ2hhbmdlEj0uYm5l" + + "dC5wcm90b2NvbC5leGNoYW5nZS5TdWJzY3JpYmVPcmRlckJvb2tTdGF0dXND" + + "aGFuZ2VSZXF1ZXN0GhUuYm5ldC5wcm90b2NvbC5Ob0RhdGEiBIC1GBASgAEK" + + "IFVuc3Vic2NyaWJlT3JkZXJCb29rU3RhdHVzQ2hhbmdlEj8uYm5ldC5wcm90" + + "b2NvbC5leGNoYW5nZS5VbnN1YnNjcmliZU9yZGVyQm9va1N0YXR1c0NoYW5n" + + "ZVJlcXVlc3QaFS5ibmV0LnByb3RvY29sLk5vRGF0YSIEgLUYERJoChRTdWJz" + + "Y3JpYmVPcmRlclVwZGF0ZRIzLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuU3Vi" + + "c2NyaWJlT3JkZXJVcGRhdGVSZXF1ZXN0GhUuYm5ldC5wcm90b2NvbC5Ob0Rh" + + "dGEiBIC1GBISbAoWVW5zdWJzY3JpYmVPcmRlclVwZGF0ZRI1LmJuZXQucHJv" + + "dG9jb2wuZXhjaGFuZ2UuVW5zdWJzY3JpYmVPcmRlclVwZGF0ZVJlcXVlc3Qa" + + "FS5ibmV0LnByb3RvY29sLk5vRGF0YSIEgLUYExKeAQoRR2V0UGF5bWVudE1l" + + "dGhvZHMSQC5ibmV0LnByb3RvY29sLmV4Y2hhbmdlX29iamVjdF9wcm92aWRl" + + "ci5HZXRQYXltZW50TWV0aG9kc1JlcXVlc3QaQS5ibmV0LnByb3RvY29sLmV4" + + "Y2hhbmdlX29iamVjdF9wcm92aWRlci5HZXRQYXltZW50TWV0aG9kc1Jlc3Bv" + + "bnNlIgSAtRgUElEKDENsYWltQmlkSXRlbRIkLmJuZXQucHJvdG9jb2wuZXhj" + + "aGFuZ2UuQ2xhaW1SZXF1ZXN0GhUuYm5ldC5wcm90b2NvbC5Ob0RhdGEiBIC1" + + "GBUSUgoNQ2xhaW1CaWRNb25leRIkLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2Uu" + + "Q2xhaW1SZXF1ZXN0GhUuYm5ldC5wcm90b2NvbC5Ob0RhdGEiBIC1GBYSUwoO" + + "Q2xhaW1PZmZlckl0ZW0SJC5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLkNsYWlt" + + "UmVxdWVzdBoVLmJuZXQucHJvdG9jb2wuTm9EYXRhIgSAtRgXElQKD0NsYWlt" + + "T2ZmZXJNb25leRIkLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuQ2xhaW1SZXF1" + + "ZXN0GhUuYm5ldC5wcm90b2NvbC5Ob0RhdGEiBIC1GBgSTwoJQ2FuY2VsQmlk" + + "EiUuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5DYW5jZWxSZXF1ZXN0GhUuYm5l" + + "dC5wcm90b2NvbC5Ob0RhdGEiBIC1GBkSUQoLQ2FuY2VsT2ZmZXISJS5ibmV0" + + "LnByb3RvY29sLmV4Y2hhbmdlLkNhbmNlbFJlcXVlc3QaFS5ibmV0LnByb3Rv" + + "Y29sLk5vRGF0YSIEgLUYGhJ7ChBHZXRDb25maWd1cmF0aW9uEi8uYm5ldC5w" + + "cm90b2NvbC5leGNoYW5nZS5HZXRDb25maWd1cmF0aW9uUmVxdWVzdBowLmJu" + + "ZXQucHJvdG9jb2wuZXhjaGFuZ2UuR2V0Q29uZmlndXJhdGlvblJlc3BvbnNl" + + "IgSAtRgbEoEBChNHZXRCaWRGZWVFc3RpbWF0aW9uEjIuYm5ldC5wcm90b2Nv" + + "bC5leGNoYW5nZS5HZXRCaWRGZWVFc3RpbWF0aW9uUmVxdWVzdBowLmJuZXQu" + + "cHJvdG9jb2wuZXhjaGFuZ2UuR2V0RmVlRXN0aW1hdGlvblJlc3BvbnNlIgSA" + + "tRgcEoUBChVHZXRPZmZlckZlZUVzdGltYXRpb24SNC5ibmV0LnByb3RvY29s" + + "LmV4Y2hhbmdlLkdldE9mZmVyRmVlRXN0aW1hdGlvblJlcXVlc3QaMC5ibmV0" + + "LnByb3RvY29sLmV4Y2hhbmdlLkdldEZlZUVzdGltYXRpb25SZXNwb25zZSIE" + + "gLUYHRKcAQobUXVlcnlPcmRlcnNCeUFjY291bnRGb3JJdGVtEjouYm5ldC5w" + + "cm90b2NvbC5leGNoYW5nZS5RdWVyeU9yZGVyc0J5QWNjb3VudEZvckl0ZW1S" + + "ZXF1ZXN0GjsuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5RdWVyeU9yZGVyc0J5" + + "QWNjb3VudEZvckl0ZW1SZXNwb25zZSIEgLUYHhJ5ChpSZXBvcnRBdXRob3Jp" + + "emVSaXNrVmVyZGljdBI+LmJuZXQucHJvdG9jb2wuZXhjaGFuZ2Vfcmlzay5S" + + "ZXBvcnRBdXRob3JpemVSaXNrVmVyZGljdFJlcXVlc3QaFS5ibmV0LnByb3Rv" + + "Y29sLk5vRGF0YSIEgLUYHxJzChdSZXBvcnRTZXR0bGVSaXNrVmVyZGljdBI7" + + "LmJuZXQucHJvdG9jb2wuZXhjaGFuZ2Vfcmlzay5SZXBvcnRTZXR0bGVSaXNr" + + "VmVyZGljdFJlcXVlc3QaFS5ibmV0LnByb3RvY29sLk5vRGF0YSIEgLUYIBJx" + + "ChZEZWxheVNldHRsZVJpc2tWZXJkaWN0EjouYm5ldC5wcm90b2NvbC5leGNo" + + "YW5nZV9yaXNrLkRlbGF5U2V0dGxlUmlza1ZlcmRpY3RSZXF1ZXN0GhUuYm5l" + + "dC5wcm90b2NvbC5Ob0RhdGEiBIC1GCEScgoNR2V0RmVlRGV0YWlscxIsLmJu" + + "ZXQucHJvdG9jb2wuZXhjaGFuZ2UuR2V0RmVlRGV0YWlsc1JlcXVlc3QaLS5i" + + "bmV0LnByb3RvY29sLmV4Y2hhbmdlLkdldEZlZURldGFpbHNSZXNwb25zZSIE" + + "gLUYIhKNAQoWR2V0T3JkZXJCb29rU3RhdGlzdGljcxI1LmJuZXQucHJvdG9j" + + "b2wuZXhjaGFuZ2UuR2V0T3JkZXJCb29rU3RhdGlzdGljc1JlcXVlc3QaNi5i" + + "bmV0LnByb3RvY29sLmV4Y2hhbmdlLkdldE9yZGVyQm9va1N0YXRpc3RpY3NS" + + "ZXNwb25zZSIEgLUYIxJyCg1HZXRCaWREZXRhaWxzEiwuYm5ldC5wcm90b2Nv" + + "bC5leGNoYW5nZS5HZXRCaWREZXRhaWxzUmVxdWVzdBotLmJuZXQucHJvdG9j" + + "b2wuZXhjaGFuZ2UuR2V0QmlkRGV0YWlsc1Jlc3BvbnNlIgSAtRgkEngKD0dl" + + "dE9mZmVyRGV0YWlscxIuLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuR2V0T2Zm" + + "ZXJEZXRhaWxzUmVxdWVzdBovLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuR2V0" + + "T2ZmZXJEZXRhaWxzUmVzcG9uc2UiBIC1GCUSWwoNR2V0U3lzdGVtVGltZRIV" + + "LmJuZXQucHJvdG9jb2wuTm9EYXRhGi0uYm5ldC5wcm90b2NvbC5leGNoYW5n" + + "ZS5HZXRTeXN0ZW1UaW1lUmVzcG9uc2UiBIC1GCYSWgoNQ3JlYXRlQ1NUcmFk" + + "ZRIsLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuQ3JlYXRlQ1NUcmFkZVJlcXVl" + + "c3QaFS5ibmV0LnByb3RvY29sLk5vRGF0YSIEgLUYJxJPCglSZWZ1bmRCaWQS" + + "JS5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLlJlZnVuZFJlcXVlc3QaFS5ibmV0" + + "LnByb3RvY29sLk5vRGF0YSIEgLUYKBJoCgxSZXBvcnRSZWZ1bmQSOy5ibmV0" + + "LnByb3RvY29sLmV4Y2hhbmdlX29iamVjdF9wcm92aWRlci5SZXBvcnRSZWZ1" + + "bmRSZXF1ZXN0GhUuYm5ldC5wcm90b2NvbC5Ob0RhdGEiBIC1GCkScgoNR2V0" + + "T3JkZXJDb3VudBIsLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuR2V0T3JkZXJD" + + "b3VudFJlcXVlc3QaLS5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLkdldE9yZGVy" + + "Q291bnRSZXNwb25zZSIEgLUYKhJ4ChxTdWJzY3JpYmVBZHZhbmNlZE9yZGVy" + + "VXBkYXRlEjsuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5TdWJzY3JpYmVBZHZh" + + "bmNlZE9yZGVyVXBkYXRlUmVxdWVzdBoVLmJuZXQucHJvdG9jb2wuTm9EYXRh" + + "IgSAtRgrEnwKHlVuc3Vic2NyaWJlQWR2YW5jZWRPcmRlclVwZGF0ZRI9LmJu" + + "ZXQucHJvdG9jb2wuZXhjaGFuZ2UuVW5zdWJzY3JpYmVBZHZhbmNlZE9yZGVy" + + "VXBkYXRlUmVxdWVzdBoVLmJuZXQucHJvdG9jb2wuTm9EYXRhIgSAtRgsEnsK" + + "FFNldHRsZUhpc3Rvcmllc0ZvckNTEi0uYm5ldC5wcm90b2NvbC5leGNoYW5n" + + "ZS5IaXN0b3JpZXNGb3JDU1JlcXVlc3QaLi5ibmV0LnByb3RvY29sLmV4Y2hh" + + "bmdlLkhpc3Rvcmllc0ZvckNTUmVzcG9uc2UiBIC1GC0SewoUQ2FuY2VsSGlz" + + "dG9yaWVzRm9yQ1MSLS5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLkhpc3Rvcmll" + + "c0ZvckNTUmVxdWVzdBouLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuSGlzdG9y" + + "aWVzRm9yQ1NSZXNwb25zZSIEgLUYLhJ6ChFDcmVhdGVDU1RyYWRlSXRlbRIw" + + "LmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuQ3JlYXRlQ1NUcmFkZUl0ZW1SZXF1" + + "ZXN0Gi0uYm5ldC5wcm90b2NvbC5leGNoYW5nZS5DcmVhdGVDU1RyYWRlUmVz" + + "cG9uc2UiBIC1GC8SfAoSQ3JlYXRlQ1NUcmFkZU1vbmV5EjEuYm5ldC5wcm90" + + "b2NvbC5leGNoYW5nZS5DcmVhdGVDU1RyYWRlTW9uZXlSZXF1ZXN0Gi0uYm5l" + + "dC5wcm90b2NvbC5leGNoYW5nZS5DcmVhdGVDU1RyYWRlUmVzcG9uc2UiBIC1" + + "GDAywQMKDkV4Y2hhbmdlTm90aWZ5EnUKG05vdGlmeU9yZGVyQm9va1N0YXR1" + + "c0NoYW5nZRI0LmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuT3JkZXJCb29rTm90" + + "aWZpY2F0aW9uUmVxdWVzdBoaLmJuZXQucHJvdG9jb2wuTk9fUkVTUE9OU0Ui" + + "BIC1GAESZwoRTm90aWZ5T2ZmZXJVcGRhdGUSMC5ibmV0LnByb3RvY29sLmV4" + + "Y2hhbmdlLk9mZmVyTm90aWZpY2F0aW9uUmVxdWVzdBoaLmJuZXQucHJvdG9j" + + "b2wuTk9fUkVTUE9OU0UiBIC1GAISYwoPTm90aWZ5QmlkVXBkYXRlEi4uYm5l" + + "dC5wcm90b2NvbC5leGNoYW5nZS5CaWROb3RpZmljYXRpb25SZXF1ZXN0Ghou" + + "Ym5ldC5wcm90b2NvbC5OT19SRVNQT05TRSIEgLUYAxJqChNOb3RpZnlDdXN0" + + "b21NZXNzYWdlEjEuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5DdXN0b21Ob3Rp" + + "ZmljYXRpb25SZXF1ZXN0GhouYm5ldC5wcm90b2NvbC5OT19SRVNQT05TRSIE" + + "gLUYBEIDgAEA"); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_bnet_protocol_exchange_CreateOrderBookRequest__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_exchange_CreateOrderBookRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_CreateOrderBookRequest__Descriptor, + new string[] { "PartitionId", "OrderBook", }); + internal__static_bnet_protocol_exchange_CreateOrderBookResponse__Descriptor = Descriptor.MessageTypes[1]; + internal__static_bnet_protocol_exchange_CreateOrderBookResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_CreateOrderBookResponse__Descriptor, + new string[] { "OrderBookId", }); + internal__static_bnet_protocol_exchange_PlaceOfferOnOrderBookRequest__Descriptor = Descriptor.MessageTypes[2]; + internal__static_bnet_protocol_exchange_PlaceOfferOnOrderBookRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_PlaceOfferOnOrderBookRequest__Descriptor, + new string[] { "PartitionId", "OfferCreation", }); + internal__static_bnet_protocol_exchange_PlaceOfferOnOrderBookResponse__Descriptor = Descriptor.MessageTypes[3]; + internal__static_bnet_protocol_exchange_PlaceOfferOnOrderBookResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_PlaceOfferOnOrderBookResponse__Descriptor, + new string[] { "OrderBookId", "OfferId", }); + internal__static_bnet_protocol_exchange_PlaceOfferCreateOrderBookIfNeededRequest__Descriptor = Descriptor.MessageTypes[4]; + internal__static_bnet_protocol_exchange_PlaceOfferCreateOrderBookIfNeededRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_PlaceOfferCreateOrderBookIfNeededRequest__Descriptor, + new string[] { "PartitionId", "OrderBook", "OfferCreation", }); + internal__static_bnet_protocol_exchange_PlaceOfferCreateOrderBookIfNeededResponse__Descriptor = Descriptor.MessageTypes[5]; + internal__static_bnet_protocol_exchange_PlaceOfferCreateOrderBookIfNeededResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_PlaceOfferCreateOrderBookIfNeededResponse__Descriptor, + new string[] { "OrderBookId", "OfferId", }); + internal__static_bnet_protocol_exchange_PlaceBidOnOrderBookRequest__Descriptor = Descriptor.MessageTypes[6]; + internal__static_bnet_protocol_exchange_PlaceBidOnOrderBookRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_PlaceBidOnOrderBookRequest__Descriptor, + new string[] { "PartitionId", "BidCreation", }); + internal__static_bnet_protocol_exchange_PlaceBidOnOrderBookResponse__Descriptor = Descriptor.MessageTypes[7]; + internal__static_bnet_protocol_exchange_PlaceBidOnOrderBookResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_PlaceBidOnOrderBookResponse__Descriptor, + new string[] { "OrderBookId", "BidId", }); + internal__static_bnet_protocol_exchange_PlaceBidCreateOrderBookIfNeededRequest__Descriptor = Descriptor.MessageTypes[8]; + internal__static_bnet_protocol_exchange_PlaceBidCreateOrderBookIfNeededRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_PlaceBidCreateOrderBookIfNeededRequest__Descriptor, + new string[] { "PartitionId", "OrderBook", "BidCreation", }); + internal__static_bnet_protocol_exchange_PlaceBidCreateOrderBookIfNeededResponse__Descriptor = Descriptor.MessageTypes[9]; + internal__static_bnet_protocol_exchange_PlaceBidCreateOrderBookIfNeededResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_PlaceBidCreateOrderBookIfNeededResponse__Descriptor, + new string[] { "OrderBookId", "BidId", }); + internal__static_bnet_protocol_exchange_QueryOffersByOrderBookRequest__Descriptor = Descriptor.MessageTypes[10]; + internal__static_bnet_protocol_exchange_QueryOffersByOrderBookRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_QueryOffersByOrderBookRequest__Descriptor, + new string[] { "PartitionId", "Filter", "Status", }); + internal__static_bnet_protocol_exchange_QueryOffersByOrderBookResponse__Descriptor = Descriptor.MessageTypes[11]; + internal__static_bnet_protocol_exchange_QueryOffersByOrderBookResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_QueryOffersByOrderBookResponse__Descriptor, + new string[] { "Offers", "TotalCount", }); + internal__static_bnet_protocol_exchange_QueryBidsByOrderBookRequest__Descriptor = Descriptor.MessageTypes[12]; + internal__static_bnet_protocol_exchange_QueryBidsByOrderBookRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_QueryBidsByOrderBookRequest__Descriptor, + new string[] { "PartitionId", "Filter", "Status", }); + internal__static_bnet_protocol_exchange_QueryBidsByOrderBookResponse__Descriptor = Descriptor.MessageTypes[13]; + internal__static_bnet_protocol_exchange_QueryBidsByOrderBookResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_QueryBidsByOrderBookResponse__Descriptor, + new string[] { "Bids", "TotalCount", }); + internal__static_bnet_protocol_exchange_QueryOffersByAccountForItemRequest__Descriptor = Descriptor.MessageTypes[14]; + internal__static_bnet_protocol_exchange_QueryOffersByAccountForItemRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_QueryOffersByAccountForItemRequest__Descriptor, + new string[] { "AccountForItem", "Filter", "BnetAccount", }); + internal__static_bnet_protocol_exchange_QueryOffersByAccountForItemResponse__Descriptor = Descriptor.MessageTypes[15]; + internal__static_bnet_protocol_exchange_QueryOffersByAccountForItemResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_QueryOffersByAccountForItemResponse__Descriptor, + new string[] { "Offers", "TotalCount", }); + internal__static_bnet_protocol_exchange_QueryBidsByAccountForItemRequest__Descriptor = Descriptor.MessageTypes[16]; + internal__static_bnet_protocol_exchange_QueryBidsByAccountForItemRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_QueryBidsByAccountForItemRequest__Descriptor, + new string[] { "AccountForItem", "Filter", "BnetAccount", }); + internal__static_bnet_protocol_exchange_QueryBidsByAccountForItemResponse__Descriptor = Descriptor.MessageTypes[17]; + internal__static_bnet_protocol_exchange_QueryBidsByAccountForItemResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_QueryBidsByAccountForItemResponse__Descriptor, + new string[] { "Bids", "TotalCount", }); + internal__static_bnet_protocol_exchange_QueryOrderBooksSummaryRequest__Descriptor = Descriptor.MessageTypes[18]; + internal__static_bnet_protocol_exchange_QueryOrderBooksSummaryRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_QueryOrderBooksSummaryRequest__Descriptor, + new string[] { "Handles", }); + internal__static_bnet_protocol_exchange_QueryOrderBooksSummaryResponse__Descriptor = Descriptor.MessageTypes[19]; + internal__static_bnet_protocol_exchange_QueryOrderBooksSummaryResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_QueryOrderBooksSummaryResponse__Descriptor, + new string[] { "OrderBooks", }); + internal__static_bnet_protocol_exchange_SubscribeOrderBookStatusChangeRequest__Descriptor = Descriptor.MessageTypes[20]; + internal__static_bnet_protocol_exchange_SubscribeOrderBookStatusChangeRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_SubscribeOrderBookStatusChangeRequest__Descriptor, + new string[] { "ObjectId", "MinPartitionId", "MaxPartitionId", "Program", "Status", "Currency", "Specialist", "Bootstrap", "BootstrapOldestCreatedTime", }); + internal__static_bnet_protocol_exchange_UnsubscribeOrderBookStatusChangeRequest__Descriptor = Descriptor.MessageTypes[21]; + internal__static_bnet_protocol_exchange_UnsubscribeOrderBookStatusChangeRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_UnsubscribeOrderBookStatusChangeRequest__Descriptor, + new string[] { }); + internal__static_bnet_protocol_exchange_SubscribeOrderUpdateRequest__Descriptor = Descriptor.MessageTypes[22]; + internal__static_bnet_protocol_exchange_SubscribeOrderUpdateRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_SubscribeOrderUpdateRequest__Descriptor, + new string[] { "AgentId", "ObjectId", }); + internal__static_bnet_protocol_exchange_UnsubscribeOrderUpdateRequest__Descriptor = Descriptor.MessageTypes[23]; + internal__static_bnet_protocol_exchange_UnsubscribeOrderUpdateRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_UnsubscribeOrderUpdateRequest__Descriptor, + new string[] { "AgentId", "ObjectId", }); + internal__static_bnet_protocol_exchange_SubscribeAdvancedOrderUpdateRequest__Descriptor = Descriptor.MessageTypes[24]; + internal__static_bnet_protocol_exchange_SubscribeAdvancedOrderUpdateRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_SubscribeAdvancedOrderUpdateRequest__Descriptor, + new string[] { "ObjectId", "MinPartitionId", "MaxPartitionId", "Filters", }); + internal__static_bnet_protocol_exchange_UnsubscribeAdvancedOrderUpdateRequest__Descriptor = Descriptor.MessageTypes[25]; + internal__static_bnet_protocol_exchange_UnsubscribeAdvancedOrderUpdateRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_UnsubscribeAdvancedOrderUpdateRequest__Descriptor, + new string[] { }); + internal__static_bnet_protocol_exchange_ClaimRequest__Descriptor = Descriptor.MessageTypes[26]; + internal__static_bnet_protocol_exchange_ClaimRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_ClaimRequest__Descriptor, + new string[] { "PartitionId", "OrderId", "Program", "BnetAccount", "Information", }); + internal__static_bnet_protocol_exchange_CancelRequest__Descriptor = Descriptor.MessageTypes[27]; + internal__static_bnet_protocol_exchange_CancelRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_CancelRequest__Descriptor, + new string[] { "PartitionId", "OrderId", "Reason", "BnetAccount", }); + internal__static_bnet_protocol_exchange_RefundRequest__Descriptor = Descriptor.MessageTypes[28]; + internal__static_bnet_protocol_exchange_RefundRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_RefundRequest__Descriptor, + new string[] { "PartitionId", "OrderId", "CsNotes", "CsUserId", }); + internal__static_bnet_protocol_exchange_GetConfigurationRequest__Descriptor = Descriptor.MessageTypes[29]; + internal__static_bnet_protocol_exchange_GetConfigurationRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_GetConfigurationRequest__Descriptor, + new string[] { "Program", }); + internal__static_bnet_protocol_exchange_GetConfigurationResponse__Descriptor = Descriptor.MessageTypes[30]; + internal__static_bnet_protocol_exchange_GetConfigurationResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_GetConfigurationResponse__Descriptor, + new string[] { "Configs", "RmtRestrictedByLicense", "RecommendedDefaultRmtCurrency", }); + internal__static_bnet_protocol_exchange_GetOfferFeeEstimationRequest__Descriptor = Descriptor.MessageTypes[31]; + internal__static_bnet_protocol_exchange_GetOfferFeeEstimationRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_GetOfferFeeEstimationRequest__Descriptor, + new string[] { "PartitionId", "Data", }); + internal__static_bnet_protocol_exchange_GetBidFeeEstimationRequest__Descriptor = Descriptor.MessageTypes[32]; + internal__static_bnet_protocol_exchange_GetBidFeeEstimationRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_GetBidFeeEstimationRequest__Descriptor, + new string[] { "PartitionId", "Data", }); + internal__static_bnet_protocol_exchange_GetFeeEstimationResponse__Descriptor = Descriptor.MessageTypes[33]; + internal__static_bnet_protocol_exchange_GetFeeEstimationResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_GetFeeEstimationResponse__Descriptor, + new string[] { "FeeAmount", "FeeDetails", }); + internal__static_bnet_protocol_exchange_OrderBookNotificationRequest__Descriptor = Descriptor.MessageTypes[34]; + internal__static_bnet_protocol_exchange_OrderBookNotificationRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_OrderBookNotificationRequest__Descriptor, + new string[] { "Notifications", "BootStrapLast", }); + internal__static_bnet_protocol_exchange_OfferNotificationRequest__Descriptor = Descriptor.MessageTypes[35]; + internal__static_bnet_protocol_exchange_OfferNotificationRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_OfferNotificationRequest__Descriptor, + new string[] { "Offer", "Event", "ObjectType", "ClaimResult", "ClaimResultReason", }); + internal__static_bnet_protocol_exchange_BidNotificationRequest__Descriptor = Descriptor.MessageTypes[36]; + internal__static_bnet_protocol_exchange_BidNotificationRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_BidNotificationRequest__Descriptor, + new string[] { "Bid", "Event", "ObjectType", "ClaimResult", "ClaimResultReason", }); + internal__static_bnet_protocol_exchange_CustomNotificationRequest__Descriptor = Descriptor.MessageTypes[37]; + internal__static_bnet_protocol_exchange_CustomNotificationRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_CustomNotificationRequest__Descriptor, + new string[] { "Handle", "OrderId", "Info", }); + internal__static_bnet_protocol_exchange_QueryOrdersByAccountForItemRequest__Descriptor = Descriptor.MessageTypes[38]; + internal__static_bnet_protocol_exchange_QueryOrdersByAccountForItemRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_QueryOrdersByAccountForItemRequest__Descriptor, + new string[] { "AccountForItem", "BnetAccount", "Filter", }); + internal__static_bnet_protocol_exchange_QueryOrdersByAccountForItemResponse__Descriptor = Descriptor.MessageTypes[39]; + internal__static_bnet_protocol_exchange_QueryOrdersByAccountForItemResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_QueryOrdersByAccountForItemResponse__Descriptor, + new string[] { "Orders", "TotalCount", }); + internal__static_bnet_protocol_exchange_GetFeeDetailsRequest__Descriptor = Descriptor.MessageTypes[40]; + internal__static_bnet_protocol_exchange_GetFeeDetailsRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_GetFeeDetailsRequest__Descriptor, + new string[] { "PartitionId", "OrderId", "BnetAccount", }); + internal__static_bnet_protocol_exchange_GetFeeDetailsResponse__Descriptor = Descriptor.MessageTypes[41]; + internal__static_bnet_protocol_exchange_GetFeeDetailsResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_GetFeeDetailsResponse__Descriptor, + new string[] { "FeeDetailsIn", "FeeDetailsOut", }); + internal__static_bnet_protocol_exchange_GetOrderBookStatisticsRequest__Descriptor = Descriptor.MessageTypes[42]; + internal__static_bnet_protocol_exchange_GetOrderBookStatisticsRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_GetOrderBookStatisticsRequest__Descriptor, + new string[] { "PartitionId", "OrderType", "Quantity", "LastTrades", "LastDays", }); + internal__static_bnet_protocol_exchange_GetOrderBookStatisticsResponse__Descriptor = Descriptor.MessageTypes[43]; + internal__static_bnet_protocol_exchange_GetOrderBookStatisticsResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_GetOrderBookStatisticsResponse__Descriptor, + new string[] { "PriceDetails", "LastTradesAverage", "LastDaysAverage", }); + internal__static_bnet_protocol_exchange_GetBidDetailsRequest__Descriptor = Descriptor.MessageTypes[44]; + internal__static_bnet_protocol_exchange_GetBidDetailsRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_GetBidDetailsRequest__Descriptor, + new string[] { "OrderId", "PartitionId", }); + internal__static_bnet_protocol_exchange_GetBidDetailsResponse__Descriptor = Descriptor.MessageTypes[45]; + internal__static_bnet_protocol_exchange_GetBidDetailsResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_GetBidDetailsResponse__Descriptor, + new string[] { "Bid", }); + internal__static_bnet_protocol_exchange_GetOfferDetailsRequest__Descriptor = Descriptor.MessageTypes[46]; + internal__static_bnet_protocol_exchange_GetOfferDetailsRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_GetOfferDetailsRequest__Descriptor, + new string[] { "OrderId", "PartitionId", }); + internal__static_bnet_protocol_exchange_GetOfferDetailsResponse__Descriptor = Descriptor.MessageTypes[47]; + internal__static_bnet_protocol_exchange_GetOfferDetailsResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_GetOfferDetailsResponse__Descriptor, + new string[] { "Offer", }); + internal__static_bnet_protocol_exchange_GetSystemTimeResponse__Descriptor = Descriptor.MessageTypes[48]; + internal__static_bnet_protocol_exchange_GetSystemTimeResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_GetSystemTimeResponse__Descriptor, + new string[] { "Time", }); + internal__static_bnet_protocol_exchange_CreateCSTradeRequest__Descriptor = Descriptor.MessageTypes[49]; + internal__static_bnet_protocol_exchange_CreateCSTradeRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_CreateCSTradeRequest__Descriptor, + new string[] { "PartitionId", "OrderBook", "Amount", "BnetAccount", "GameAccount", "AccountForItem", "CsNotes", "CsUserId", }); + internal__static_bnet_protocol_exchange_CreateCSTradeItemRequest__Descriptor = Descriptor.MessageTypes[50]; + internal__static_bnet_protocol_exchange_CreateCSTradeItemRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_CreateCSTradeItemRequest__Descriptor, + new string[] { "PartitionId", "OrderBook", "Amount", "BnetAccount", "GameAccount", "AccountForItem", "CsNotes", "CsUserId", }); + internal__static_bnet_protocol_exchange_CreateCSTradeMoneyRequest__Descriptor = Descriptor.MessageTypes[51]; + internal__static_bnet_protocol_exchange_CreateCSTradeMoneyRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_CreateCSTradeMoneyRequest__Descriptor, + new string[] { "PartitionId", "OrderBook", "Amount", "BnetAccount", "GameAccount", "AccountForItem", "CsNotes", "CsUserId", "AccountForMoney", }); + internal__static_bnet_protocol_exchange_CreateCSTradeResponse__Descriptor = Descriptor.MessageTypes[52]; + internal__static_bnet_protocol_exchange_CreateCSTradeResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_CreateCSTradeResponse__Descriptor, + new string[] { "OrderBookId", }); + internal__static_bnet_protocol_exchange_GetOrderCountRequest__Descriptor = Descriptor.MessageTypes[53]; + internal__static_bnet_protocol_exchange_GetOrderCountRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_GetOrderCountRequest__Descriptor, + new string[] { "Currency", "Source", "BnetAccount", "NotClosedOfferCount", "OrderWithClaimableCount", }); + internal__static_bnet_protocol_exchange_GetOrderCountResponse__Descriptor = Descriptor.MessageTypes[54]; + internal__static_bnet_protocol_exchange_GetOrderCountResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_GetOrderCountResponse__Descriptor, + new string[] { "NotClosedOfferCount", "OrderWithClaimableCount", }); + internal__static_bnet_protocol_exchange_HistoriesForCSRequest__Descriptor = Descriptor.MessageTypes[55]; + internal__static_bnet_protocol_exchange_HistoriesForCSRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_HistoriesForCSRequest__Descriptor, + new string[] { "BnetAccount", "Program", "LowerTime", "HigherTime", }); + internal__static_bnet_protocol_exchange_HistoriesForCSResponse__Descriptor = Descriptor.MessageTypes[56]; + internal__static_bnet_protocol_exchange_HistoriesForCSResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_HistoriesForCSResponse__Descriptor, + new string[] { "HistoryData", }); + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + RegisterAllExtensions(registry); + global::bnet.protocol.Rpc.RegisterAllExtensions(registry); + global::bnet.protocol.exchange.Exchange.RegisterAllExtensions(registry); + global::bnet.protocol.exchange_object_provider.ExchangeObjectProviderTypes.RegisterAllExtensions(registry); + global::bnet.protocol.exchange_risk.ExchangeRiskTypes.RegisterAllExtensions(registry); + global::bnet.protocol.Entity.RegisterAllExtensions(registry); + global::bnet.protocol.account.AccountTypes.RegisterAllExtensions(registry); + global::bnet.protocol.exchange.ExchangeTypes.RegisterAllExtensions(registry); + return registry; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::bnet.protocol.Rpc.Descriptor, + global::bnet.protocol.exchange.Exchange.Descriptor, + global::bnet.protocol.exchange_object_provider.ExchangeObjectProviderTypes.Descriptor, + global::bnet.protocol.exchange_risk.ExchangeRiskTypes.Descriptor, + global::bnet.protocol.Entity.Descriptor, + global::bnet.protocol.account.AccountTypes.Descriptor, + global::bnet.protocol.exchange.ExchangeTypes.Descriptor, + }, assigner); + } + #endregion + + } + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class CreateOrderBookRequest : pb::GeneratedMessage { + private CreateOrderBookRequest() { } + private static readonly CreateOrderBookRequest defaultInstance = new CreateOrderBookRequest().MakeReadOnly(); + private static readonly string[] _createOrderBookRequestFieldNames = new string[] { "order_book", "partition_id" }; + private static readonly uint[] _createOrderBookRequestFieldTags = new uint[] { 18, 10 }; + public static CreateOrderBookRequest DefaultInstance { + get { return defaultInstance; } + } + + public override CreateOrderBookRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override CreateOrderBookRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_CreateOrderBookRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_CreateOrderBookRequest__FieldAccessorTable; } + } + + public const int PartitionIdFieldNumber = 1; + private bool hasPartitionId; + private global::bnet.protocol.exchange.PartitionId partitionId_; + public bool HasPartitionId { + get { return hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int OrderBookFieldNumber = 2; + private bool hasOrderBook; + private global::bnet.protocol.exchange.OrderBook orderBook_; + public bool HasOrderBook { + get { return hasOrderBook; } + } + public global::bnet.protocol.exchange.OrderBook OrderBook { + get { return orderBook_ ?? global::bnet.protocol.exchange.OrderBook.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasPartitionId) return false; + if (!hasOrderBook) return false; + if (!PartitionId.IsInitialized) return false; + if (!OrderBook.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _createOrderBookRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[1], PartitionId); + } + if (hasOrderBook) { + output.WriteMessage(2, field_names[0], OrderBook); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); + } + if (hasOrderBook) { + size += pb::CodedOutputStream.ComputeMessageSize(2, OrderBook); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static CreateOrderBookRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CreateOrderBookRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CreateOrderBookRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CreateOrderBookRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CreateOrderBookRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CreateOrderBookRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static CreateOrderBookRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static CreateOrderBookRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static CreateOrderBookRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CreateOrderBookRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CreateOrderBookRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(CreateOrderBookRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CreateOrderBookRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CreateOrderBookRequest result; + + private CreateOrderBookRequest PrepareBuilder() { + if (resultIsReadOnly) { + CreateOrderBookRequest original = result; + result = new CreateOrderBookRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CreateOrderBookRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.CreateOrderBookRequest.Descriptor; } + } + + public override CreateOrderBookRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.CreateOrderBookRequest.DefaultInstance; } + } + + public override CreateOrderBookRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is CreateOrderBookRequest) { + return MergeFrom((CreateOrderBookRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(CreateOrderBookRequest other) { + if (other == global::bnet.protocol.exchange.CreateOrderBookRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasPartitionId) { + MergePartitionId(other.PartitionId); + } + if (other.HasOrderBook) { + MergeOrderBook(other.OrderBook); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_createOrderBookRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _createOrderBookRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasPartitionId) { + subBuilder.MergeFrom(PartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + PartitionId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.exchange.OrderBook.Builder subBuilder = global::bnet.protocol.exchange.OrderBook.CreateBuilder(); + if (result.hasOrderBook) { + subBuilder.MergeFrom(OrderBook); + } + input.ReadMessage(subBuilder, extensionRegistry); + OrderBook = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasPartitionId { + get { return result.hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = value; + return this; + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = builderForValue.Build(); + return this; + } + public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasPartitionId && + result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); + } else { + result.partitionId_ = value; + } + result.hasPartitionId = true; + return this; + } + public Builder ClearPartitionId() { + PrepareBuilder(); + result.hasPartitionId = false; + result.partitionId_ = null; + return this; + } + + public bool HasOrderBook { + get { return result.hasOrderBook; } + } + public global::bnet.protocol.exchange.OrderBook OrderBook { + get { return result.OrderBook; } + set { SetOrderBook(value); } + } + public Builder SetOrderBook(global::bnet.protocol.exchange.OrderBook value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOrderBook = true; + result.orderBook_ = value; + return this; + } + public Builder SetOrderBook(global::bnet.protocol.exchange.OrderBook.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOrderBook = true; + result.orderBook_ = builderForValue.Build(); + return this; + } + public Builder MergeOrderBook(global::bnet.protocol.exchange.OrderBook value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOrderBook && + result.orderBook_ != global::bnet.protocol.exchange.OrderBook.DefaultInstance) { + result.orderBook_ = global::bnet.protocol.exchange.OrderBook.CreateBuilder(result.orderBook_).MergeFrom(value).BuildPartial(); + } else { + result.orderBook_ = value; + } + result.hasOrderBook = true; + return this; + } + public Builder ClearOrderBook() { + PrepareBuilder(); + result.hasOrderBook = false; + result.orderBook_ = null; + return this; + } + } + static CreateOrderBookRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class CreateOrderBookResponse : pb::GeneratedMessage { + private CreateOrderBookResponse() { } + private static readonly CreateOrderBookResponse defaultInstance = new CreateOrderBookResponse().MakeReadOnly(); + private static readonly string[] _createOrderBookResponseFieldNames = new string[] { "order_book_id" }; + private static readonly uint[] _createOrderBookResponseFieldTags = new uint[] { 8 }; + public static CreateOrderBookResponse DefaultInstance { + get { return defaultInstance; } + } + + public override CreateOrderBookResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override CreateOrderBookResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_CreateOrderBookResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_CreateOrderBookResponse__FieldAccessorTable; } + } + + public const int OrderBookIdFieldNumber = 1; + private bool hasOrderBookId; + private ulong orderBookId_; + public bool HasOrderBookId { + get { return hasOrderBookId; } + } + public ulong OrderBookId { + get { return orderBookId_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _createOrderBookResponseFieldNames; + if (hasOrderBookId) { + output.WriteUInt64(1, field_names[0], OrderBookId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasOrderBookId) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, OrderBookId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static CreateOrderBookResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CreateOrderBookResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CreateOrderBookResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CreateOrderBookResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CreateOrderBookResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CreateOrderBookResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static CreateOrderBookResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static CreateOrderBookResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static CreateOrderBookResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CreateOrderBookResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CreateOrderBookResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(CreateOrderBookResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CreateOrderBookResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CreateOrderBookResponse result; + + private CreateOrderBookResponse PrepareBuilder() { + if (resultIsReadOnly) { + CreateOrderBookResponse original = result; + result = new CreateOrderBookResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CreateOrderBookResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.CreateOrderBookResponse.Descriptor; } + } + + public override CreateOrderBookResponse DefaultInstanceForType { + get { return global::bnet.protocol.exchange.CreateOrderBookResponse.DefaultInstance; } + } + + public override CreateOrderBookResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is CreateOrderBookResponse) { + return MergeFrom((CreateOrderBookResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(CreateOrderBookResponse other) { + if (other == global::bnet.protocol.exchange.CreateOrderBookResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasOrderBookId) { + OrderBookId = other.OrderBookId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_createOrderBookResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _createOrderBookResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasOrderBookId = input.ReadUInt64(ref result.orderBookId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasOrderBookId { + get { return result.hasOrderBookId; } + } + public ulong OrderBookId { + get { return result.OrderBookId; } + set { SetOrderBookId(value); } + } + public Builder SetOrderBookId(ulong value) { + PrepareBuilder(); + result.hasOrderBookId = true; + result.orderBookId_ = value; + return this; + } + public Builder ClearOrderBookId() { + PrepareBuilder(); + result.hasOrderBookId = false; + result.orderBookId_ = 0UL; + return this; + } + } + static CreateOrderBookResponse() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class PlaceOfferOnOrderBookRequest : pb::GeneratedMessage { + private PlaceOfferOnOrderBookRequest() { } + private static readonly PlaceOfferOnOrderBookRequest defaultInstance = new PlaceOfferOnOrderBookRequest().MakeReadOnly(); + private static readonly string[] _placeOfferOnOrderBookRequestFieldNames = new string[] { "offer_creation", "partition_id" }; + private static readonly uint[] _placeOfferOnOrderBookRequestFieldTags = new uint[] { 18, 10 }; + public static PlaceOfferOnOrderBookRequest DefaultInstance { + get { return defaultInstance; } + } + + public override PlaceOfferOnOrderBookRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override PlaceOfferOnOrderBookRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_PlaceOfferOnOrderBookRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_PlaceOfferOnOrderBookRequest__FieldAccessorTable; } + } + + public const int PartitionIdFieldNumber = 1; + private bool hasPartitionId; + private global::bnet.protocol.exchange.PartitionId partitionId_; + public bool HasPartitionId { + get { return hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int OfferCreationFieldNumber = 2; + private bool hasOfferCreation; + private global::bnet.protocol.exchange.OfferCreation offerCreation_; + public bool HasOfferCreation { + get { return hasOfferCreation; } + } + public global::bnet.protocol.exchange.OfferCreation OfferCreation { + get { return offerCreation_ ?? global::bnet.protocol.exchange.OfferCreation.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasPartitionId) return false; + if (!hasOfferCreation) return false; + if (!PartitionId.IsInitialized) return false; + if (!OfferCreation.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _placeOfferOnOrderBookRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[1], PartitionId); + } + if (hasOfferCreation) { + output.WriteMessage(2, field_names[0], OfferCreation); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); + } + if (hasOfferCreation) { + size += pb::CodedOutputStream.ComputeMessageSize(2, OfferCreation); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static PlaceOfferOnOrderBookRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PlaceOfferOnOrderBookRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PlaceOfferOnOrderBookRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PlaceOfferOnOrderBookRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PlaceOfferOnOrderBookRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PlaceOfferOnOrderBookRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static PlaceOfferOnOrderBookRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static PlaceOfferOnOrderBookRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static PlaceOfferOnOrderBookRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PlaceOfferOnOrderBookRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private PlaceOfferOnOrderBookRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(PlaceOfferOnOrderBookRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(PlaceOfferOnOrderBookRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private PlaceOfferOnOrderBookRequest result; + + private PlaceOfferOnOrderBookRequest PrepareBuilder() { + if (resultIsReadOnly) { + PlaceOfferOnOrderBookRequest original = result; + result = new PlaceOfferOnOrderBookRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override PlaceOfferOnOrderBookRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.PlaceOfferOnOrderBookRequest.Descriptor; } + } + + public override PlaceOfferOnOrderBookRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.PlaceOfferOnOrderBookRequest.DefaultInstance; } + } + + public override PlaceOfferOnOrderBookRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is PlaceOfferOnOrderBookRequest) { + return MergeFrom((PlaceOfferOnOrderBookRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(PlaceOfferOnOrderBookRequest other) { + if (other == global::bnet.protocol.exchange.PlaceOfferOnOrderBookRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasPartitionId) { + MergePartitionId(other.PartitionId); + } + if (other.HasOfferCreation) { + MergeOfferCreation(other.OfferCreation); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_placeOfferOnOrderBookRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _placeOfferOnOrderBookRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasPartitionId) { + subBuilder.MergeFrom(PartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + PartitionId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.exchange.OfferCreation.Builder subBuilder = global::bnet.protocol.exchange.OfferCreation.CreateBuilder(); + if (result.hasOfferCreation) { + subBuilder.MergeFrom(OfferCreation); + } + input.ReadMessage(subBuilder, extensionRegistry); + OfferCreation = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasPartitionId { + get { return result.hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = value; + return this; + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = builderForValue.Build(); + return this; + } + public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasPartitionId && + result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); + } else { + result.partitionId_ = value; + } + result.hasPartitionId = true; + return this; + } + public Builder ClearPartitionId() { + PrepareBuilder(); + result.hasPartitionId = false; + result.partitionId_ = null; + return this; + } + + public bool HasOfferCreation { + get { return result.hasOfferCreation; } + } + public global::bnet.protocol.exchange.OfferCreation OfferCreation { + get { return result.OfferCreation; } + set { SetOfferCreation(value); } + } + public Builder SetOfferCreation(global::bnet.protocol.exchange.OfferCreation value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOfferCreation = true; + result.offerCreation_ = value; + return this; + } + public Builder SetOfferCreation(global::bnet.protocol.exchange.OfferCreation.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOfferCreation = true; + result.offerCreation_ = builderForValue.Build(); + return this; + } + public Builder MergeOfferCreation(global::bnet.protocol.exchange.OfferCreation value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOfferCreation && + result.offerCreation_ != global::bnet.protocol.exchange.OfferCreation.DefaultInstance) { + result.offerCreation_ = global::bnet.protocol.exchange.OfferCreation.CreateBuilder(result.offerCreation_).MergeFrom(value).BuildPartial(); + } else { + result.offerCreation_ = value; + } + result.hasOfferCreation = true; + return this; + } + public Builder ClearOfferCreation() { + PrepareBuilder(); + result.hasOfferCreation = false; + result.offerCreation_ = null; + return this; + } + } + static PlaceOfferOnOrderBookRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class PlaceOfferOnOrderBookResponse : pb::GeneratedMessage { + private PlaceOfferOnOrderBookResponse() { } + private static readonly PlaceOfferOnOrderBookResponse defaultInstance = new PlaceOfferOnOrderBookResponse().MakeReadOnly(); + private static readonly string[] _placeOfferOnOrderBookResponseFieldNames = new string[] { "offer_id", "order_book_id" }; + private static readonly uint[] _placeOfferOnOrderBookResponseFieldTags = new uint[] { 16, 8 }; + public static PlaceOfferOnOrderBookResponse DefaultInstance { + get { return defaultInstance; } + } + + public override PlaceOfferOnOrderBookResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override PlaceOfferOnOrderBookResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_PlaceOfferOnOrderBookResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_PlaceOfferOnOrderBookResponse__FieldAccessorTable; } + } + + public const int OrderBookIdFieldNumber = 1; + private bool hasOrderBookId; + private ulong orderBookId_; + public bool HasOrderBookId { + get { return hasOrderBookId; } + } + public ulong OrderBookId { + get { return orderBookId_; } + } + + public const int OfferIdFieldNumber = 2; + private bool hasOfferId; + private ulong offerId_; + public bool HasOfferId { + get { return hasOfferId; } + } + public ulong OfferId { + get { return offerId_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _placeOfferOnOrderBookResponseFieldNames; + if (hasOrderBookId) { + output.WriteUInt64(1, field_names[1], OrderBookId); + } + if (hasOfferId) { + output.WriteUInt64(2, field_names[0], OfferId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasOrderBookId) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, OrderBookId); + } + if (hasOfferId) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, OfferId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static PlaceOfferOnOrderBookResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PlaceOfferOnOrderBookResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PlaceOfferOnOrderBookResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PlaceOfferOnOrderBookResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PlaceOfferOnOrderBookResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PlaceOfferOnOrderBookResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static PlaceOfferOnOrderBookResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static PlaceOfferOnOrderBookResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static PlaceOfferOnOrderBookResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PlaceOfferOnOrderBookResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private PlaceOfferOnOrderBookResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(PlaceOfferOnOrderBookResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(PlaceOfferOnOrderBookResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private PlaceOfferOnOrderBookResponse result; + + private PlaceOfferOnOrderBookResponse PrepareBuilder() { + if (resultIsReadOnly) { + PlaceOfferOnOrderBookResponse original = result; + result = new PlaceOfferOnOrderBookResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override PlaceOfferOnOrderBookResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.PlaceOfferOnOrderBookResponse.Descriptor; } + } + + public override PlaceOfferOnOrderBookResponse DefaultInstanceForType { + get { return global::bnet.protocol.exchange.PlaceOfferOnOrderBookResponse.DefaultInstance; } + } + + public override PlaceOfferOnOrderBookResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is PlaceOfferOnOrderBookResponse) { + return MergeFrom((PlaceOfferOnOrderBookResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(PlaceOfferOnOrderBookResponse other) { + if (other == global::bnet.protocol.exchange.PlaceOfferOnOrderBookResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasOrderBookId) { + OrderBookId = other.OrderBookId; + } + if (other.HasOfferId) { + OfferId = other.OfferId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_placeOfferOnOrderBookResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _placeOfferOnOrderBookResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasOrderBookId = input.ReadUInt64(ref result.orderBookId_); + break; + } + case 16: { + result.hasOfferId = input.ReadUInt64(ref result.offerId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasOrderBookId { + get { return result.hasOrderBookId; } + } + public ulong OrderBookId { + get { return result.OrderBookId; } + set { SetOrderBookId(value); } + } + public Builder SetOrderBookId(ulong value) { + PrepareBuilder(); + result.hasOrderBookId = true; + result.orderBookId_ = value; + return this; + } + public Builder ClearOrderBookId() { + PrepareBuilder(); + result.hasOrderBookId = false; + result.orderBookId_ = 0UL; + return this; + } + + public bool HasOfferId { + get { return result.hasOfferId; } + } + public ulong OfferId { + get { return result.OfferId; } + set { SetOfferId(value); } + } + public Builder SetOfferId(ulong value) { + PrepareBuilder(); + result.hasOfferId = true; + result.offerId_ = value; + return this; + } + public Builder ClearOfferId() { + PrepareBuilder(); + result.hasOfferId = false; + result.offerId_ = 0UL; + return this; + } + } + static PlaceOfferOnOrderBookResponse() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class PlaceOfferCreateOrderBookIfNeededRequest : pb::GeneratedMessage { + private PlaceOfferCreateOrderBookIfNeededRequest() { } + private static readonly PlaceOfferCreateOrderBookIfNeededRequest defaultInstance = new PlaceOfferCreateOrderBookIfNeededRequest().MakeReadOnly(); + private static readonly string[] _placeOfferCreateOrderBookIfNeededRequestFieldNames = new string[] { "offer_creation", "order_book", "partition_id" }; + private static readonly uint[] _placeOfferCreateOrderBookIfNeededRequestFieldTags = new uint[] { 26, 18, 10 }; + public static PlaceOfferCreateOrderBookIfNeededRequest DefaultInstance { + get { return defaultInstance; } + } + + public override PlaceOfferCreateOrderBookIfNeededRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override PlaceOfferCreateOrderBookIfNeededRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_PlaceOfferCreateOrderBookIfNeededRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_PlaceOfferCreateOrderBookIfNeededRequest__FieldAccessorTable; } + } + + public const int PartitionIdFieldNumber = 1; + private bool hasPartitionId; + private global::bnet.protocol.exchange.PartitionId partitionId_; + public bool HasPartitionId { + get { return hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int OrderBookFieldNumber = 2; + private bool hasOrderBook; + private global::bnet.protocol.exchange.OrderBook orderBook_; + public bool HasOrderBook { + get { return hasOrderBook; } + } + public global::bnet.protocol.exchange.OrderBook OrderBook { + get { return orderBook_ ?? global::bnet.protocol.exchange.OrderBook.DefaultInstance; } + } + + public const int OfferCreationFieldNumber = 3; + private bool hasOfferCreation; + private global::bnet.protocol.exchange.OfferCreation offerCreation_; + public bool HasOfferCreation { + get { return hasOfferCreation; } + } + public global::bnet.protocol.exchange.OfferCreation OfferCreation { + get { return offerCreation_ ?? global::bnet.protocol.exchange.OfferCreation.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasPartitionId) return false; + if (!hasOrderBook) return false; + if (!hasOfferCreation) return false; + if (!PartitionId.IsInitialized) return false; + if (!OrderBook.IsInitialized) return false; + if (!OfferCreation.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _placeOfferCreateOrderBookIfNeededRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[2], PartitionId); + } + if (hasOrderBook) { + output.WriteMessage(2, field_names[1], OrderBook); + } + if (hasOfferCreation) { + output.WriteMessage(3, field_names[0], OfferCreation); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); + } + if (hasOrderBook) { + size += pb::CodedOutputStream.ComputeMessageSize(2, OrderBook); + } + if (hasOfferCreation) { + size += pb::CodedOutputStream.ComputeMessageSize(3, OfferCreation); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static PlaceOfferCreateOrderBookIfNeededRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PlaceOfferCreateOrderBookIfNeededRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PlaceOfferCreateOrderBookIfNeededRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PlaceOfferCreateOrderBookIfNeededRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PlaceOfferCreateOrderBookIfNeededRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PlaceOfferCreateOrderBookIfNeededRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static PlaceOfferCreateOrderBookIfNeededRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static PlaceOfferCreateOrderBookIfNeededRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static PlaceOfferCreateOrderBookIfNeededRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PlaceOfferCreateOrderBookIfNeededRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private PlaceOfferCreateOrderBookIfNeededRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(PlaceOfferCreateOrderBookIfNeededRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(PlaceOfferCreateOrderBookIfNeededRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private PlaceOfferCreateOrderBookIfNeededRequest result; + + private PlaceOfferCreateOrderBookIfNeededRequest PrepareBuilder() { + if (resultIsReadOnly) { + PlaceOfferCreateOrderBookIfNeededRequest original = result; + result = new PlaceOfferCreateOrderBookIfNeededRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override PlaceOfferCreateOrderBookIfNeededRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.PlaceOfferCreateOrderBookIfNeededRequest.Descriptor; } + } + + public override PlaceOfferCreateOrderBookIfNeededRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.PlaceOfferCreateOrderBookIfNeededRequest.DefaultInstance; } + } + + public override PlaceOfferCreateOrderBookIfNeededRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is PlaceOfferCreateOrderBookIfNeededRequest) { + return MergeFrom((PlaceOfferCreateOrderBookIfNeededRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(PlaceOfferCreateOrderBookIfNeededRequest other) { + if (other == global::bnet.protocol.exchange.PlaceOfferCreateOrderBookIfNeededRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasPartitionId) { + MergePartitionId(other.PartitionId); + } + if (other.HasOrderBook) { + MergeOrderBook(other.OrderBook); + } + if (other.HasOfferCreation) { + MergeOfferCreation(other.OfferCreation); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_placeOfferCreateOrderBookIfNeededRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _placeOfferCreateOrderBookIfNeededRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasPartitionId) { + subBuilder.MergeFrom(PartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + PartitionId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.exchange.OrderBook.Builder subBuilder = global::bnet.protocol.exchange.OrderBook.CreateBuilder(); + if (result.hasOrderBook) { + subBuilder.MergeFrom(OrderBook); + } + input.ReadMessage(subBuilder, extensionRegistry); + OrderBook = subBuilder.BuildPartial(); + break; + } + case 26: { + global::bnet.protocol.exchange.OfferCreation.Builder subBuilder = global::bnet.protocol.exchange.OfferCreation.CreateBuilder(); + if (result.hasOfferCreation) { + subBuilder.MergeFrom(OfferCreation); + } + input.ReadMessage(subBuilder, extensionRegistry); + OfferCreation = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasPartitionId { + get { return result.hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = value; + return this; + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = builderForValue.Build(); + return this; + } + public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasPartitionId && + result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); + } else { + result.partitionId_ = value; + } + result.hasPartitionId = true; + return this; + } + public Builder ClearPartitionId() { + PrepareBuilder(); + result.hasPartitionId = false; + result.partitionId_ = null; + return this; + } + + public bool HasOrderBook { + get { return result.hasOrderBook; } + } + public global::bnet.protocol.exchange.OrderBook OrderBook { + get { return result.OrderBook; } + set { SetOrderBook(value); } + } + public Builder SetOrderBook(global::bnet.protocol.exchange.OrderBook value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOrderBook = true; + result.orderBook_ = value; + return this; + } + public Builder SetOrderBook(global::bnet.protocol.exchange.OrderBook.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOrderBook = true; + result.orderBook_ = builderForValue.Build(); + return this; + } + public Builder MergeOrderBook(global::bnet.protocol.exchange.OrderBook value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOrderBook && + result.orderBook_ != global::bnet.protocol.exchange.OrderBook.DefaultInstance) { + result.orderBook_ = global::bnet.protocol.exchange.OrderBook.CreateBuilder(result.orderBook_).MergeFrom(value).BuildPartial(); + } else { + result.orderBook_ = value; + } + result.hasOrderBook = true; + return this; + } + public Builder ClearOrderBook() { + PrepareBuilder(); + result.hasOrderBook = false; + result.orderBook_ = null; + return this; + } + + public bool HasOfferCreation { + get { return result.hasOfferCreation; } + } + public global::bnet.protocol.exchange.OfferCreation OfferCreation { + get { return result.OfferCreation; } + set { SetOfferCreation(value); } + } + public Builder SetOfferCreation(global::bnet.protocol.exchange.OfferCreation value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOfferCreation = true; + result.offerCreation_ = value; + return this; + } + public Builder SetOfferCreation(global::bnet.protocol.exchange.OfferCreation.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOfferCreation = true; + result.offerCreation_ = builderForValue.Build(); + return this; + } + public Builder MergeOfferCreation(global::bnet.protocol.exchange.OfferCreation value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOfferCreation && + result.offerCreation_ != global::bnet.protocol.exchange.OfferCreation.DefaultInstance) { + result.offerCreation_ = global::bnet.protocol.exchange.OfferCreation.CreateBuilder(result.offerCreation_).MergeFrom(value).BuildPartial(); + } else { + result.offerCreation_ = value; + } + result.hasOfferCreation = true; + return this; + } + public Builder ClearOfferCreation() { + PrepareBuilder(); + result.hasOfferCreation = false; + result.offerCreation_ = null; + return this; + } + } + static PlaceOfferCreateOrderBookIfNeededRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class PlaceOfferCreateOrderBookIfNeededResponse : pb::GeneratedMessage { + private PlaceOfferCreateOrderBookIfNeededResponse() { } + private static readonly PlaceOfferCreateOrderBookIfNeededResponse defaultInstance = new PlaceOfferCreateOrderBookIfNeededResponse().MakeReadOnly(); + private static readonly string[] _placeOfferCreateOrderBookIfNeededResponseFieldNames = new string[] { "offer_id", "order_book_id" }; + private static readonly uint[] _placeOfferCreateOrderBookIfNeededResponseFieldTags = new uint[] { 16, 8 }; + public static PlaceOfferCreateOrderBookIfNeededResponse DefaultInstance { + get { return defaultInstance; } + } + + public override PlaceOfferCreateOrderBookIfNeededResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override PlaceOfferCreateOrderBookIfNeededResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_PlaceOfferCreateOrderBookIfNeededResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_PlaceOfferCreateOrderBookIfNeededResponse__FieldAccessorTable; } + } + + public const int OrderBookIdFieldNumber = 1; + private bool hasOrderBookId; + private ulong orderBookId_; + public bool HasOrderBookId { + get { return hasOrderBookId; } + } + public ulong OrderBookId { + get { return orderBookId_; } + } + + public const int OfferIdFieldNumber = 2; + private bool hasOfferId; + private ulong offerId_; + public bool HasOfferId { + get { return hasOfferId; } + } + public ulong OfferId { + get { return offerId_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _placeOfferCreateOrderBookIfNeededResponseFieldNames; + if (hasOrderBookId) { + output.WriteUInt64(1, field_names[1], OrderBookId); + } + if (hasOfferId) { + output.WriteUInt64(2, field_names[0], OfferId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasOrderBookId) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, OrderBookId); + } + if (hasOfferId) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, OfferId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static PlaceOfferCreateOrderBookIfNeededResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PlaceOfferCreateOrderBookIfNeededResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PlaceOfferCreateOrderBookIfNeededResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PlaceOfferCreateOrderBookIfNeededResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PlaceOfferCreateOrderBookIfNeededResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PlaceOfferCreateOrderBookIfNeededResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static PlaceOfferCreateOrderBookIfNeededResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static PlaceOfferCreateOrderBookIfNeededResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static PlaceOfferCreateOrderBookIfNeededResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PlaceOfferCreateOrderBookIfNeededResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private PlaceOfferCreateOrderBookIfNeededResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(PlaceOfferCreateOrderBookIfNeededResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(PlaceOfferCreateOrderBookIfNeededResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private PlaceOfferCreateOrderBookIfNeededResponse result; + + private PlaceOfferCreateOrderBookIfNeededResponse PrepareBuilder() { + if (resultIsReadOnly) { + PlaceOfferCreateOrderBookIfNeededResponse original = result; + result = new PlaceOfferCreateOrderBookIfNeededResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override PlaceOfferCreateOrderBookIfNeededResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.PlaceOfferCreateOrderBookIfNeededResponse.Descriptor; } + } + + public override PlaceOfferCreateOrderBookIfNeededResponse DefaultInstanceForType { + get { return global::bnet.protocol.exchange.PlaceOfferCreateOrderBookIfNeededResponse.DefaultInstance; } + } + + public override PlaceOfferCreateOrderBookIfNeededResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is PlaceOfferCreateOrderBookIfNeededResponse) { + return MergeFrom((PlaceOfferCreateOrderBookIfNeededResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(PlaceOfferCreateOrderBookIfNeededResponse other) { + if (other == global::bnet.protocol.exchange.PlaceOfferCreateOrderBookIfNeededResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasOrderBookId) { + OrderBookId = other.OrderBookId; + } + if (other.HasOfferId) { + OfferId = other.OfferId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_placeOfferCreateOrderBookIfNeededResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _placeOfferCreateOrderBookIfNeededResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasOrderBookId = input.ReadUInt64(ref result.orderBookId_); + break; + } + case 16: { + result.hasOfferId = input.ReadUInt64(ref result.offerId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasOrderBookId { + get { return result.hasOrderBookId; } + } + public ulong OrderBookId { + get { return result.OrderBookId; } + set { SetOrderBookId(value); } + } + public Builder SetOrderBookId(ulong value) { + PrepareBuilder(); + result.hasOrderBookId = true; + result.orderBookId_ = value; + return this; + } + public Builder ClearOrderBookId() { + PrepareBuilder(); + result.hasOrderBookId = false; + result.orderBookId_ = 0UL; + return this; + } + + public bool HasOfferId { + get { return result.hasOfferId; } + } + public ulong OfferId { + get { return result.OfferId; } + set { SetOfferId(value); } + } + public Builder SetOfferId(ulong value) { + PrepareBuilder(); + result.hasOfferId = true; + result.offerId_ = value; + return this; + } + public Builder ClearOfferId() { + PrepareBuilder(); + result.hasOfferId = false; + result.offerId_ = 0UL; + return this; + } + } + static PlaceOfferCreateOrderBookIfNeededResponse() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class PlaceBidOnOrderBookRequest : pb::GeneratedMessage { + private PlaceBidOnOrderBookRequest() { } + private static readonly PlaceBidOnOrderBookRequest defaultInstance = new PlaceBidOnOrderBookRequest().MakeReadOnly(); + private static readonly string[] _placeBidOnOrderBookRequestFieldNames = new string[] { "bid_creation", "partition_id" }; + private static readonly uint[] _placeBidOnOrderBookRequestFieldTags = new uint[] { 18, 10 }; + public static PlaceBidOnOrderBookRequest DefaultInstance { + get { return defaultInstance; } + } + + public override PlaceBidOnOrderBookRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override PlaceBidOnOrderBookRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_PlaceBidOnOrderBookRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_PlaceBidOnOrderBookRequest__FieldAccessorTable; } + } + + public const int PartitionIdFieldNumber = 1; + private bool hasPartitionId; + private global::bnet.protocol.exchange.PartitionId partitionId_; + public bool HasPartitionId { + get { return hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int BidCreationFieldNumber = 2; + private bool hasBidCreation; + private global::bnet.protocol.exchange.BidCreation bidCreation_; + public bool HasBidCreation { + get { return hasBidCreation; } + } + public global::bnet.protocol.exchange.BidCreation BidCreation { + get { return bidCreation_ ?? global::bnet.protocol.exchange.BidCreation.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasPartitionId) return false; + if (!hasBidCreation) return false; + if (!PartitionId.IsInitialized) return false; + if (!BidCreation.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _placeBidOnOrderBookRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[1], PartitionId); + } + if (hasBidCreation) { + output.WriteMessage(2, field_names[0], BidCreation); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); + } + if (hasBidCreation) { + size += pb::CodedOutputStream.ComputeMessageSize(2, BidCreation); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static PlaceBidOnOrderBookRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PlaceBidOnOrderBookRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PlaceBidOnOrderBookRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PlaceBidOnOrderBookRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PlaceBidOnOrderBookRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PlaceBidOnOrderBookRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static PlaceBidOnOrderBookRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static PlaceBidOnOrderBookRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static PlaceBidOnOrderBookRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PlaceBidOnOrderBookRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private PlaceBidOnOrderBookRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(PlaceBidOnOrderBookRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(PlaceBidOnOrderBookRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private PlaceBidOnOrderBookRequest result; + + private PlaceBidOnOrderBookRequest PrepareBuilder() { + if (resultIsReadOnly) { + PlaceBidOnOrderBookRequest original = result; + result = new PlaceBidOnOrderBookRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override PlaceBidOnOrderBookRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.PlaceBidOnOrderBookRequest.Descriptor; } + } + + public override PlaceBidOnOrderBookRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.PlaceBidOnOrderBookRequest.DefaultInstance; } + } + + public override PlaceBidOnOrderBookRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is PlaceBidOnOrderBookRequest) { + return MergeFrom((PlaceBidOnOrderBookRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(PlaceBidOnOrderBookRequest other) { + if (other == global::bnet.protocol.exchange.PlaceBidOnOrderBookRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasPartitionId) { + MergePartitionId(other.PartitionId); + } + if (other.HasBidCreation) { + MergeBidCreation(other.BidCreation); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_placeBidOnOrderBookRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _placeBidOnOrderBookRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasPartitionId) { + subBuilder.MergeFrom(PartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + PartitionId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.exchange.BidCreation.Builder subBuilder = global::bnet.protocol.exchange.BidCreation.CreateBuilder(); + if (result.hasBidCreation) { + subBuilder.MergeFrom(BidCreation); + } + input.ReadMessage(subBuilder, extensionRegistry); + BidCreation = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasPartitionId { + get { return result.hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = value; + return this; + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = builderForValue.Build(); + return this; + } + public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasPartitionId && + result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); + } else { + result.partitionId_ = value; + } + result.hasPartitionId = true; + return this; + } + public Builder ClearPartitionId() { + PrepareBuilder(); + result.hasPartitionId = false; + result.partitionId_ = null; + return this; + } + + public bool HasBidCreation { + get { return result.hasBidCreation; } + } + public global::bnet.protocol.exchange.BidCreation BidCreation { + get { return result.BidCreation; } + set { SetBidCreation(value); } + } + public Builder SetBidCreation(global::bnet.protocol.exchange.BidCreation value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBidCreation = true; + result.bidCreation_ = value; + return this; + } + public Builder SetBidCreation(global::bnet.protocol.exchange.BidCreation.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBidCreation = true; + result.bidCreation_ = builderForValue.Build(); + return this; + } + public Builder MergeBidCreation(global::bnet.protocol.exchange.BidCreation value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBidCreation && + result.bidCreation_ != global::bnet.protocol.exchange.BidCreation.DefaultInstance) { + result.bidCreation_ = global::bnet.protocol.exchange.BidCreation.CreateBuilder(result.bidCreation_).MergeFrom(value).BuildPartial(); + } else { + result.bidCreation_ = value; + } + result.hasBidCreation = true; + return this; + } + public Builder ClearBidCreation() { + PrepareBuilder(); + result.hasBidCreation = false; + result.bidCreation_ = null; + return this; + } + } + static PlaceBidOnOrderBookRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class PlaceBidOnOrderBookResponse : pb::GeneratedMessage { + private PlaceBidOnOrderBookResponse() { } + private static readonly PlaceBidOnOrderBookResponse defaultInstance = new PlaceBidOnOrderBookResponse().MakeReadOnly(); + private static readonly string[] _placeBidOnOrderBookResponseFieldNames = new string[] { "bid_id", "order_book_id" }; + private static readonly uint[] _placeBidOnOrderBookResponseFieldTags = new uint[] { 16, 8 }; + public static PlaceBidOnOrderBookResponse DefaultInstance { + get { return defaultInstance; } + } + + public override PlaceBidOnOrderBookResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override PlaceBidOnOrderBookResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_PlaceBidOnOrderBookResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_PlaceBidOnOrderBookResponse__FieldAccessorTable; } + } + + public const int OrderBookIdFieldNumber = 1; + private bool hasOrderBookId; + private ulong orderBookId_; + public bool HasOrderBookId { + get { return hasOrderBookId; } + } + public ulong OrderBookId { + get { return orderBookId_; } + } + + public const int BidIdFieldNumber = 2; + private bool hasBidId; + private ulong bidId_; + public bool HasBidId { + get { return hasBidId; } + } + public ulong BidId { + get { return bidId_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _placeBidOnOrderBookResponseFieldNames; + if (hasOrderBookId) { + output.WriteUInt64(1, field_names[1], OrderBookId); + } + if (hasBidId) { + output.WriteUInt64(2, field_names[0], BidId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasOrderBookId) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, OrderBookId); + } + if (hasBidId) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, BidId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static PlaceBidOnOrderBookResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PlaceBidOnOrderBookResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PlaceBidOnOrderBookResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PlaceBidOnOrderBookResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PlaceBidOnOrderBookResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PlaceBidOnOrderBookResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static PlaceBidOnOrderBookResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static PlaceBidOnOrderBookResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static PlaceBidOnOrderBookResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PlaceBidOnOrderBookResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private PlaceBidOnOrderBookResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(PlaceBidOnOrderBookResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(PlaceBidOnOrderBookResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private PlaceBidOnOrderBookResponse result; + + private PlaceBidOnOrderBookResponse PrepareBuilder() { + if (resultIsReadOnly) { + PlaceBidOnOrderBookResponse original = result; + result = new PlaceBidOnOrderBookResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override PlaceBidOnOrderBookResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.PlaceBidOnOrderBookResponse.Descriptor; } + } + + public override PlaceBidOnOrderBookResponse DefaultInstanceForType { + get { return global::bnet.protocol.exchange.PlaceBidOnOrderBookResponse.DefaultInstance; } + } + + public override PlaceBidOnOrderBookResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is PlaceBidOnOrderBookResponse) { + return MergeFrom((PlaceBidOnOrderBookResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(PlaceBidOnOrderBookResponse other) { + if (other == global::bnet.protocol.exchange.PlaceBidOnOrderBookResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasOrderBookId) { + OrderBookId = other.OrderBookId; + } + if (other.HasBidId) { + BidId = other.BidId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_placeBidOnOrderBookResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _placeBidOnOrderBookResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasOrderBookId = input.ReadUInt64(ref result.orderBookId_); + break; + } + case 16: { + result.hasBidId = input.ReadUInt64(ref result.bidId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasOrderBookId { + get { return result.hasOrderBookId; } + } + public ulong OrderBookId { + get { return result.OrderBookId; } + set { SetOrderBookId(value); } + } + public Builder SetOrderBookId(ulong value) { + PrepareBuilder(); + result.hasOrderBookId = true; + result.orderBookId_ = value; + return this; + } + public Builder ClearOrderBookId() { + PrepareBuilder(); + result.hasOrderBookId = false; + result.orderBookId_ = 0UL; + return this; + } + + public bool HasBidId { + get { return result.hasBidId; } + } + public ulong BidId { + get { return result.BidId; } + set { SetBidId(value); } + } + public Builder SetBidId(ulong value) { + PrepareBuilder(); + result.hasBidId = true; + result.bidId_ = value; + return this; + } + public Builder ClearBidId() { + PrepareBuilder(); + result.hasBidId = false; + result.bidId_ = 0UL; + return this; + } + } + static PlaceBidOnOrderBookResponse() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class PlaceBidCreateOrderBookIfNeededRequest : pb::GeneratedMessage { + private PlaceBidCreateOrderBookIfNeededRequest() { } + private static readonly PlaceBidCreateOrderBookIfNeededRequest defaultInstance = new PlaceBidCreateOrderBookIfNeededRequest().MakeReadOnly(); + private static readonly string[] _placeBidCreateOrderBookIfNeededRequestFieldNames = new string[] { "bid_creation", "order_book", "partition_id" }; + private static readonly uint[] _placeBidCreateOrderBookIfNeededRequestFieldTags = new uint[] { 26, 18, 10 }; + public static PlaceBidCreateOrderBookIfNeededRequest DefaultInstance { + get { return defaultInstance; } + } + + public override PlaceBidCreateOrderBookIfNeededRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override PlaceBidCreateOrderBookIfNeededRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_PlaceBidCreateOrderBookIfNeededRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_PlaceBidCreateOrderBookIfNeededRequest__FieldAccessorTable; } + } + + public const int PartitionIdFieldNumber = 1; + private bool hasPartitionId; + private global::bnet.protocol.exchange.PartitionId partitionId_; + public bool HasPartitionId { + get { return hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int OrderBookFieldNumber = 2; + private bool hasOrderBook; + private global::bnet.protocol.exchange.OrderBook orderBook_; + public bool HasOrderBook { + get { return hasOrderBook; } + } + public global::bnet.protocol.exchange.OrderBook OrderBook { + get { return orderBook_ ?? global::bnet.protocol.exchange.OrderBook.DefaultInstance; } + } + + public const int BidCreationFieldNumber = 3; + private bool hasBidCreation; + private global::bnet.protocol.exchange.BidCreation bidCreation_; + public bool HasBidCreation { + get { return hasBidCreation; } + } + public global::bnet.protocol.exchange.BidCreation BidCreation { + get { return bidCreation_ ?? global::bnet.protocol.exchange.BidCreation.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasPartitionId) return false; + if (!hasOrderBook) return false; + if (!hasBidCreation) return false; + if (!PartitionId.IsInitialized) return false; + if (!OrderBook.IsInitialized) return false; + if (!BidCreation.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _placeBidCreateOrderBookIfNeededRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[2], PartitionId); + } + if (hasOrderBook) { + output.WriteMessage(2, field_names[1], OrderBook); + } + if (hasBidCreation) { + output.WriteMessage(3, field_names[0], BidCreation); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); + } + if (hasOrderBook) { + size += pb::CodedOutputStream.ComputeMessageSize(2, OrderBook); + } + if (hasBidCreation) { + size += pb::CodedOutputStream.ComputeMessageSize(3, BidCreation); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static PlaceBidCreateOrderBookIfNeededRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PlaceBidCreateOrderBookIfNeededRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PlaceBidCreateOrderBookIfNeededRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PlaceBidCreateOrderBookIfNeededRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PlaceBidCreateOrderBookIfNeededRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PlaceBidCreateOrderBookIfNeededRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static PlaceBidCreateOrderBookIfNeededRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static PlaceBidCreateOrderBookIfNeededRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static PlaceBidCreateOrderBookIfNeededRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PlaceBidCreateOrderBookIfNeededRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private PlaceBidCreateOrderBookIfNeededRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(PlaceBidCreateOrderBookIfNeededRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(PlaceBidCreateOrderBookIfNeededRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private PlaceBidCreateOrderBookIfNeededRequest result; + + private PlaceBidCreateOrderBookIfNeededRequest PrepareBuilder() { + if (resultIsReadOnly) { + PlaceBidCreateOrderBookIfNeededRequest original = result; + result = new PlaceBidCreateOrderBookIfNeededRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override PlaceBidCreateOrderBookIfNeededRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.PlaceBidCreateOrderBookIfNeededRequest.Descriptor; } + } + + public override PlaceBidCreateOrderBookIfNeededRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.PlaceBidCreateOrderBookIfNeededRequest.DefaultInstance; } + } + + public override PlaceBidCreateOrderBookIfNeededRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is PlaceBidCreateOrderBookIfNeededRequest) { + return MergeFrom((PlaceBidCreateOrderBookIfNeededRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(PlaceBidCreateOrderBookIfNeededRequest other) { + if (other == global::bnet.protocol.exchange.PlaceBidCreateOrderBookIfNeededRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasPartitionId) { + MergePartitionId(other.PartitionId); + } + if (other.HasOrderBook) { + MergeOrderBook(other.OrderBook); + } + if (other.HasBidCreation) { + MergeBidCreation(other.BidCreation); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_placeBidCreateOrderBookIfNeededRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _placeBidCreateOrderBookIfNeededRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasPartitionId) { + subBuilder.MergeFrom(PartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + PartitionId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.exchange.OrderBook.Builder subBuilder = global::bnet.protocol.exchange.OrderBook.CreateBuilder(); + if (result.hasOrderBook) { + subBuilder.MergeFrom(OrderBook); + } + input.ReadMessage(subBuilder, extensionRegistry); + OrderBook = subBuilder.BuildPartial(); + break; + } + case 26: { + global::bnet.protocol.exchange.BidCreation.Builder subBuilder = global::bnet.protocol.exchange.BidCreation.CreateBuilder(); + if (result.hasBidCreation) { + subBuilder.MergeFrom(BidCreation); + } + input.ReadMessage(subBuilder, extensionRegistry); + BidCreation = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasPartitionId { + get { return result.hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = value; + return this; + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = builderForValue.Build(); + return this; + } + public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasPartitionId && + result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); + } else { + result.partitionId_ = value; + } + result.hasPartitionId = true; + return this; + } + public Builder ClearPartitionId() { + PrepareBuilder(); + result.hasPartitionId = false; + result.partitionId_ = null; + return this; + } + + public bool HasOrderBook { + get { return result.hasOrderBook; } + } + public global::bnet.protocol.exchange.OrderBook OrderBook { + get { return result.OrderBook; } + set { SetOrderBook(value); } + } + public Builder SetOrderBook(global::bnet.protocol.exchange.OrderBook value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOrderBook = true; + result.orderBook_ = value; + return this; + } + public Builder SetOrderBook(global::bnet.protocol.exchange.OrderBook.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOrderBook = true; + result.orderBook_ = builderForValue.Build(); + return this; + } + public Builder MergeOrderBook(global::bnet.protocol.exchange.OrderBook value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOrderBook && + result.orderBook_ != global::bnet.protocol.exchange.OrderBook.DefaultInstance) { + result.orderBook_ = global::bnet.protocol.exchange.OrderBook.CreateBuilder(result.orderBook_).MergeFrom(value).BuildPartial(); + } else { + result.orderBook_ = value; + } + result.hasOrderBook = true; + return this; + } + public Builder ClearOrderBook() { + PrepareBuilder(); + result.hasOrderBook = false; + result.orderBook_ = null; + return this; + } + + public bool HasBidCreation { + get { return result.hasBidCreation; } + } + public global::bnet.protocol.exchange.BidCreation BidCreation { + get { return result.BidCreation; } + set { SetBidCreation(value); } + } + public Builder SetBidCreation(global::bnet.protocol.exchange.BidCreation value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBidCreation = true; + result.bidCreation_ = value; + return this; + } + public Builder SetBidCreation(global::bnet.protocol.exchange.BidCreation.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBidCreation = true; + result.bidCreation_ = builderForValue.Build(); + return this; + } + public Builder MergeBidCreation(global::bnet.protocol.exchange.BidCreation value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBidCreation && + result.bidCreation_ != global::bnet.protocol.exchange.BidCreation.DefaultInstance) { + result.bidCreation_ = global::bnet.protocol.exchange.BidCreation.CreateBuilder(result.bidCreation_).MergeFrom(value).BuildPartial(); + } else { + result.bidCreation_ = value; + } + result.hasBidCreation = true; + return this; + } + public Builder ClearBidCreation() { + PrepareBuilder(); + result.hasBidCreation = false; + result.bidCreation_ = null; + return this; + } + } + static PlaceBidCreateOrderBookIfNeededRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class PlaceBidCreateOrderBookIfNeededResponse : pb::GeneratedMessage { + private PlaceBidCreateOrderBookIfNeededResponse() { } + private static readonly PlaceBidCreateOrderBookIfNeededResponse defaultInstance = new PlaceBidCreateOrderBookIfNeededResponse().MakeReadOnly(); + private static readonly string[] _placeBidCreateOrderBookIfNeededResponseFieldNames = new string[] { "bid_id", "order_book_id" }; + private static readonly uint[] _placeBidCreateOrderBookIfNeededResponseFieldTags = new uint[] { 16, 8 }; + public static PlaceBidCreateOrderBookIfNeededResponse DefaultInstance { + get { return defaultInstance; } + } + + public override PlaceBidCreateOrderBookIfNeededResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override PlaceBidCreateOrderBookIfNeededResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_PlaceBidCreateOrderBookIfNeededResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_PlaceBidCreateOrderBookIfNeededResponse__FieldAccessorTable; } + } + + public const int OrderBookIdFieldNumber = 1; + private bool hasOrderBookId; + private ulong orderBookId_; + public bool HasOrderBookId { + get { return hasOrderBookId; } + } + public ulong OrderBookId { + get { return orderBookId_; } + } + + public const int BidIdFieldNumber = 2; + private bool hasBidId; + private ulong bidId_; + public bool HasBidId { + get { return hasBidId; } + } + public ulong BidId { + get { return bidId_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _placeBidCreateOrderBookIfNeededResponseFieldNames; + if (hasOrderBookId) { + output.WriteUInt64(1, field_names[1], OrderBookId); + } + if (hasBidId) { + output.WriteUInt64(2, field_names[0], BidId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasOrderBookId) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, OrderBookId); + } + if (hasBidId) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, BidId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static PlaceBidCreateOrderBookIfNeededResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PlaceBidCreateOrderBookIfNeededResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PlaceBidCreateOrderBookIfNeededResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PlaceBidCreateOrderBookIfNeededResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PlaceBidCreateOrderBookIfNeededResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PlaceBidCreateOrderBookIfNeededResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static PlaceBidCreateOrderBookIfNeededResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static PlaceBidCreateOrderBookIfNeededResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static PlaceBidCreateOrderBookIfNeededResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PlaceBidCreateOrderBookIfNeededResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private PlaceBidCreateOrderBookIfNeededResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(PlaceBidCreateOrderBookIfNeededResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(PlaceBidCreateOrderBookIfNeededResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private PlaceBidCreateOrderBookIfNeededResponse result; + + private PlaceBidCreateOrderBookIfNeededResponse PrepareBuilder() { + if (resultIsReadOnly) { + PlaceBidCreateOrderBookIfNeededResponse original = result; + result = new PlaceBidCreateOrderBookIfNeededResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override PlaceBidCreateOrderBookIfNeededResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.PlaceBidCreateOrderBookIfNeededResponse.Descriptor; } + } + + public override PlaceBidCreateOrderBookIfNeededResponse DefaultInstanceForType { + get { return global::bnet.protocol.exchange.PlaceBidCreateOrderBookIfNeededResponse.DefaultInstance; } + } + + public override PlaceBidCreateOrderBookIfNeededResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is PlaceBidCreateOrderBookIfNeededResponse) { + return MergeFrom((PlaceBidCreateOrderBookIfNeededResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(PlaceBidCreateOrderBookIfNeededResponse other) { + if (other == global::bnet.protocol.exchange.PlaceBidCreateOrderBookIfNeededResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasOrderBookId) { + OrderBookId = other.OrderBookId; + } + if (other.HasBidId) { + BidId = other.BidId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_placeBidCreateOrderBookIfNeededResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _placeBidCreateOrderBookIfNeededResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasOrderBookId = input.ReadUInt64(ref result.orderBookId_); + break; + } + case 16: { + result.hasBidId = input.ReadUInt64(ref result.bidId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasOrderBookId { + get { return result.hasOrderBookId; } + } + public ulong OrderBookId { + get { return result.OrderBookId; } + set { SetOrderBookId(value); } + } + public Builder SetOrderBookId(ulong value) { + PrepareBuilder(); + result.hasOrderBookId = true; + result.orderBookId_ = value; + return this; + } + public Builder ClearOrderBookId() { + PrepareBuilder(); + result.hasOrderBookId = false; + result.orderBookId_ = 0UL; + return this; + } + + public bool HasBidId { + get { return result.hasBidId; } + } + public ulong BidId { + get { return result.BidId; } + set { SetBidId(value); } + } + public Builder SetBidId(ulong value) { + PrepareBuilder(); + result.hasBidId = true; + result.bidId_ = value; + return this; + } + public Builder ClearBidId() { + PrepareBuilder(); + result.hasBidId = false; + result.bidId_ = 0UL; + return this; + } + } + static PlaceBidCreateOrderBookIfNeededResponse() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class QueryOffersByOrderBookRequest : pb::GeneratedMessage { + private QueryOffersByOrderBookRequest() { } + private static readonly QueryOffersByOrderBookRequest defaultInstance = new QueryOffersByOrderBookRequest().MakeReadOnly(); + private static readonly string[] _queryOffersByOrderBookRequestFieldNames = new string[] { "filter", "partition_id", "status" }; + private static readonly uint[] _queryOffersByOrderBookRequestFieldTags = new uint[] { 18, 10, 24 }; + public static QueryOffersByOrderBookRequest DefaultInstance { + get { return defaultInstance; } + } + + public override QueryOffersByOrderBookRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override QueryOffersByOrderBookRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryOffersByOrderBookRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryOffersByOrderBookRequest__FieldAccessorTable; } + } + + public const int PartitionIdFieldNumber = 1; + private bool hasPartitionId; + private global::bnet.protocol.exchange.PartitionId partitionId_; + public bool HasPartitionId { + get { return hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int FilterFieldNumber = 2; + private bool hasFilter; + private global::bnet.protocol.exchange.QueryFilterByOrderId filter_; + public bool HasFilter { + get { return hasFilter; } + } + public global::bnet.protocol.exchange.QueryFilterByOrderId Filter { + get { return filter_ ?? global::bnet.protocol.exchange.QueryFilterByOrderId.DefaultInstance; } + } + + public const int StatusFieldNumber = 3; + private bool hasStatus; + private int status_; + public bool HasStatus { + get { return hasStatus; } + } + public int Status { + get { return status_; } + } + + public override bool IsInitialized { + get { + if (!hasPartitionId) return false; + if (!hasFilter) return false; + if (!hasStatus) return false; + if (!PartitionId.IsInitialized) return false; + if (!Filter.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _queryOffersByOrderBookRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[1], PartitionId); + } + if (hasFilter) { + output.WriteMessage(2, field_names[0], Filter); + } + if (hasStatus) { + output.WriteInt32(3, field_names[2], Status); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); + } + if (hasFilter) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Filter); + } + if (hasStatus) { + size += pb::CodedOutputStream.ComputeInt32Size(3, Status); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static QueryOffersByOrderBookRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static QueryOffersByOrderBookRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static QueryOffersByOrderBookRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static QueryOffersByOrderBookRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static QueryOffersByOrderBookRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static QueryOffersByOrderBookRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static QueryOffersByOrderBookRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static QueryOffersByOrderBookRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static QueryOffersByOrderBookRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static QueryOffersByOrderBookRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private QueryOffersByOrderBookRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(QueryOffersByOrderBookRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(QueryOffersByOrderBookRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private QueryOffersByOrderBookRequest result; + + private QueryOffersByOrderBookRequest PrepareBuilder() { + if (resultIsReadOnly) { + QueryOffersByOrderBookRequest original = result; + result = new QueryOffersByOrderBookRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override QueryOffersByOrderBookRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.QueryOffersByOrderBookRequest.Descriptor; } + } + + public override QueryOffersByOrderBookRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.QueryOffersByOrderBookRequest.DefaultInstance; } + } + + public override QueryOffersByOrderBookRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is QueryOffersByOrderBookRequest) { + return MergeFrom((QueryOffersByOrderBookRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(QueryOffersByOrderBookRequest other) { + if (other == global::bnet.protocol.exchange.QueryOffersByOrderBookRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasPartitionId) { + MergePartitionId(other.PartitionId); + } + if (other.HasFilter) { + MergeFilter(other.Filter); + } + if (other.HasStatus) { + Status = other.Status; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_queryOffersByOrderBookRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _queryOffersByOrderBookRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasPartitionId) { + subBuilder.MergeFrom(PartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + PartitionId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.exchange.QueryFilterByOrderId.Builder subBuilder = global::bnet.protocol.exchange.QueryFilterByOrderId.CreateBuilder(); + if (result.hasFilter) { + subBuilder.MergeFrom(Filter); + } + input.ReadMessage(subBuilder, extensionRegistry); + Filter = subBuilder.BuildPartial(); + break; + } + case 24: { + result.hasStatus = input.ReadInt32(ref result.status_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasPartitionId { + get { return result.hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = value; + return this; + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = builderForValue.Build(); + return this; + } + public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasPartitionId && + result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); + } else { + result.partitionId_ = value; + } + result.hasPartitionId = true; + return this; + } + public Builder ClearPartitionId() { + PrepareBuilder(); + result.hasPartitionId = false; + result.partitionId_ = null; + return this; + } + + public bool HasFilter { + get { return result.hasFilter; } + } + public global::bnet.protocol.exchange.QueryFilterByOrderId Filter { + get { return result.Filter; } + set { SetFilter(value); } + } + public Builder SetFilter(global::bnet.protocol.exchange.QueryFilterByOrderId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasFilter = true; + result.filter_ = value; + return this; + } + public Builder SetFilter(global::bnet.protocol.exchange.QueryFilterByOrderId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasFilter = true; + result.filter_ = builderForValue.Build(); + return this; + } + public Builder MergeFilter(global::bnet.protocol.exchange.QueryFilterByOrderId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasFilter && + result.filter_ != global::bnet.protocol.exchange.QueryFilterByOrderId.DefaultInstance) { + result.filter_ = global::bnet.protocol.exchange.QueryFilterByOrderId.CreateBuilder(result.filter_).MergeFrom(value).BuildPartial(); + } else { + result.filter_ = value; + } + result.hasFilter = true; + return this; + } + public Builder ClearFilter() { + PrepareBuilder(); + result.hasFilter = false; + result.filter_ = null; + return this; + } + + public bool HasStatus { + get { return result.hasStatus; } + } + public int Status { + get { return result.Status; } + set { SetStatus(value); } + } + public Builder SetStatus(int value) { + PrepareBuilder(); + result.hasStatus = true; + result.status_ = value; + return this; + } + public Builder ClearStatus() { + PrepareBuilder(); + result.hasStatus = false; + result.status_ = 0; + return this; + } + } + static QueryOffersByOrderBookRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class QueryOffersByOrderBookResponse : pb::GeneratedMessage { + private QueryOffersByOrderBookResponse() { } + private static readonly QueryOffersByOrderBookResponse defaultInstance = new QueryOffersByOrderBookResponse().MakeReadOnly(); + private static readonly string[] _queryOffersByOrderBookResponseFieldNames = new string[] { "offers", "total_count" }; + private static readonly uint[] _queryOffersByOrderBookResponseFieldTags = new uint[] { 10, 16 }; + public static QueryOffersByOrderBookResponse DefaultInstance { + get { return defaultInstance; } + } + + public override QueryOffersByOrderBookResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override QueryOffersByOrderBookResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryOffersByOrderBookResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryOffersByOrderBookResponse__FieldAccessorTable; } + } + + public const int OffersFieldNumber = 1; + private pbc::PopsicleList offers_ = new pbc::PopsicleList(); + public scg::IList OffersList { + get { return offers_; } + } + public int OffersCount { + get { return offers_.Count; } + } + public global::bnet.protocol.exchange.OfferExtended GetOffers(int index) { + return offers_[index]; + } + + public const int TotalCountFieldNumber = 2; + private bool hasTotalCount; + private uint totalCount_; + public bool HasTotalCount { + get { return hasTotalCount; } + } + public uint TotalCount { + get { return totalCount_; } + } + + public override bool IsInitialized { + get { + if (!hasTotalCount) return false; + foreach (global::bnet.protocol.exchange.OfferExtended element in OffersList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _queryOffersByOrderBookResponseFieldNames; + if (offers_.Count > 0) { + output.WriteMessageArray(1, field_names[0], offers_); + } + if (hasTotalCount) { + output.WriteUInt32(2, field_names[1], TotalCount); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.exchange.OfferExtended element in OffersList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + if (hasTotalCount) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, TotalCount); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static QueryOffersByOrderBookResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static QueryOffersByOrderBookResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static QueryOffersByOrderBookResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static QueryOffersByOrderBookResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static QueryOffersByOrderBookResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static QueryOffersByOrderBookResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static QueryOffersByOrderBookResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static QueryOffersByOrderBookResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static QueryOffersByOrderBookResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static QueryOffersByOrderBookResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private QueryOffersByOrderBookResponse MakeReadOnly() { + offers_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(QueryOffersByOrderBookResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(QueryOffersByOrderBookResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private QueryOffersByOrderBookResponse result; + + private QueryOffersByOrderBookResponse PrepareBuilder() { + if (resultIsReadOnly) { + QueryOffersByOrderBookResponse original = result; + result = new QueryOffersByOrderBookResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override QueryOffersByOrderBookResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.QueryOffersByOrderBookResponse.Descriptor; } + } + + public override QueryOffersByOrderBookResponse DefaultInstanceForType { + get { return global::bnet.protocol.exchange.QueryOffersByOrderBookResponse.DefaultInstance; } + } + + public override QueryOffersByOrderBookResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is QueryOffersByOrderBookResponse) { + return MergeFrom((QueryOffersByOrderBookResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(QueryOffersByOrderBookResponse other) { + if (other == global::bnet.protocol.exchange.QueryOffersByOrderBookResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.offers_.Count != 0) { + result.offers_.Add(other.offers_); + } + if (other.HasTotalCount) { + TotalCount = other.TotalCount; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_queryOffersByOrderBookResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _queryOffersByOrderBookResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.offers_, global::bnet.protocol.exchange.OfferExtended.DefaultInstance, extensionRegistry); + break; + } + case 16: { + result.hasTotalCount = input.ReadUInt32(ref result.totalCount_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList OffersList { + get { return PrepareBuilder().offers_; } + } + public int OffersCount { + get { return result.OffersCount; } + } + public global::bnet.protocol.exchange.OfferExtended GetOffers(int index) { + return result.GetOffers(index); + } + public Builder SetOffers(int index, global::bnet.protocol.exchange.OfferExtended value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.offers_[index] = value; + return this; + } + public Builder SetOffers(int index, global::bnet.protocol.exchange.OfferExtended.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.offers_[index] = builderForValue.Build(); + return this; + } + public Builder AddOffers(global::bnet.protocol.exchange.OfferExtended value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.offers_.Add(value); + return this; + } + public Builder AddOffers(global::bnet.protocol.exchange.OfferExtended.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.offers_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeOffers(scg::IEnumerable values) { + PrepareBuilder(); + result.offers_.Add(values); + return this; + } + public Builder ClearOffers() { + PrepareBuilder(); + result.offers_.Clear(); + return this; + } + + public bool HasTotalCount { + get { return result.hasTotalCount; } + } + public uint TotalCount { + get { return result.TotalCount; } + set { SetTotalCount(value); } + } + public Builder SetTotalCount(uint value) { + PrepareBuilder(); + result.hasTotalCount = true; + result.totalCount_ = value; + return this; + } + public Builder ClearTotalCount() { + PrepareBuilder(); + result.hasTotalCount = false; + result.totalCount_ = 0; + return this; + } + } + static QueryOffersByOrderBookResponse() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class QueryBidsByOrderBookRequest : pb::GeneratedMessage { + private QueryBidsByOrderBookRequest() { } + private static readonly QueryBidsByOrderBookRequest defaultInstance = new QueryBidsByOrderBookRequest().MakeReadOnly(); + private static readonly string[] _queryBidsByOrderBookRequestFieldNames = new string[] { "filter", "partition_id", "status" }; + private static readonly uint[] _queryBidsByOrderBookRequestFieldTags = new uint[] { 18, 10, 24 }; + public static QueryBidsByOrderBookRequest DefaultInstance { + get { return defaultInstance; } + } + + public override QueryBidsByOrderBookRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override QueryBidsByOrderBookRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryBidsByOrderBookRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryBidsByOrderBookRequest__FieldAccessorTable; } + } + + public const int PartitionIdFieldNumber = 1; + private bool hasPartitionId; + private global::bnet.protocol.exchange.PartitionId partitionId_; + public bool HasPartitionId { + get { return hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int FilterFieldNumber = 2; + private bool hasFilter; + private global::bnet.protocol.exchange.QueryFilterByOrderId filter_; + public bool HasFilter { + get { return hasFilter; } + } + public global::bnet.protocol.exchange.QueryFilterByOrderId Filter { + get { return filter_ ?? global::bnet.protocol.exchange.QueryFilterByOrderId.DefaultInstance; } + } + + public const int StatusFieldNumber = 3; + private bool hasStatus; + private int status_; + public bool HasStatus { + get { return hasStatus; } + } + public int Status { + get { return status_; } + } + + public override bool IsInitialized { + get { + if (!hasPartitionId) return false; + if (!hasFilter) return false; + if (!hasStatus) return false; + if (!PartitionId.IsInitialized) return false; + if (!Filter.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _queryBidsByOrderBookRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[1], PartitionId); + } + if (hasFilter) { + output.WriteMessage(2, field_names[0], Filter); + } + if (hasStatus) { + output.WriteInt32(3, field_names[2], Status); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); + } + if (hasFilter) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Filter); + } + if (hasStatus) { + size += pb::CodedOutputStream.ComputeInt32Size(3, Status); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static QueryBidsByOrderBookRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static QueryBidsByOrderBookRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static QueryBidsByOrderBookRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static QueryBidsByOrderBookRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static QueryBidsByOrderBookRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static QueryBidsByOrderBookRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static QueryBidsByOrderBookRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static QueryBidsByOrderBookRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static QueryBidsByOrderBookRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static QueryBidsByOrderBookRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private QueryBidsByOrderBookRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(QueryBidsByOrderBookRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(QueryBidsByOrderBookRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private QueryBidsByOrderBookRequest result; + + private QueryBidsByOrderBookRequest PrepareBuilder() { + if (resultIsReadOnly) { + QueryBidsByOrderBookRequest original = result; + result = new QueryBidsByOrderBookRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override QueryBidsByOrderBookRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.QueryBidsByOrderBookRequest.Descriptor; } + } + + public override QueryBidsByOrderBookRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.QueryBidsByOrderBookRequest.DefaultInstance; } + } + + public override QueryBidsByOrderBookRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is QueryBidsByOrderBookRequest) { + return MergeFrom((QueryBidsByOrderBookRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(QueryBidsByOrderBookRequest other) { + if (other == global::bnet.protocol.exchange.QueryBidsByOrderBookRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasPartitionId) { + MergePartitionId(other.PartitionId); + } + if (other.HasFilter) { + MergeFilter(other.Filter); + } + if (other.HasStatus) { + Status = other.Status; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_queryBidsByOrderBookRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _queryBidsByOrderBookRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasPartitionId) { + subBuilder.MergeFrom(PartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + PartitionId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.exchange.QueryFilterByOrderId.Builder subBuilder = global::bnet.protocol.exchange.QueryFilterByOrderId.CreateBuilder(); + if (result.hasFilter) { + subBuilder.MergeFrom(Filter); + } + input.ReadMessage(subBuilder, extensionRegistry); + Filter = subBuilder.BuildPartial(); + break; + } + case 24: { + result.hasStatus = input.ReadInt32(ref result.status_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasPartitionId { + get { return result.hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = value; + return this; + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = builderForValue.Build(); + return this; + } + public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasPartitionId && + result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); + } else { + result.partitionId_ = value; + } + result.hasPartitionId = true; + return this; + } + public Builder ClearPartitionId() { + PrepareBuilder(); + result.hasPartitionId = false; + result.partitionId_ = null; + return this; + } + + public bool HasFilter { + get { return result.hasFilter; } + } + public global::bnet.protocol.exchange.QueryFilterByOrderId Filter { + get { return result.Filter; } + set { SetFilter(value); } + } + public Builder SetFilter(global::bnet.protocol.exchange.QueryFilterByOrderId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasFilter = true; + result.filter_ = value; + return this; + } + public Builder SetFilter(global::bnet.protocol.exchange.QueryFilterByOrderId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasFilter = true; + result.filter_ = builderForValue.Build(); + return this; + } + public Builder MergeFilter(global::bnet.protocol.exchange.QueryFilterByOrderId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasFilter && + result.filter_ != global::bnet.protocol.exchange.QueryFilterByOrderId.DefaultInstance) { + result.filter_ = global::bnet.protocol.exchange.QueryFilterByOrderId.CreateBuilder(result.filter_).MergeFrom(value).BuildPartial(); + } else { + result.filter_ = value; + } + result.hasFilter = true; + return this; + } + public Builder ClearFilter() { + PrepareBuilder(); + result.hasFilter = false; + result.filter_ = null; + return this; + } + + public bool HasStatus { + get { return result.hasStatus; } + } + public int Status { + get { return result.Status; } + set { SetStatus(value); } + } + public Builder SetStatus(int value) { + PrepareBuilder(); + result.hasStatus = true; + result.status_ = value; + return this; + } + public Builder ClearStatus() { + PrepareBuilder(); + result.hasStatus = false; + result.status_ = 0; + return this; + } + } + static QueryBidsByOrderBookRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class QueryBidsByOrderBookResponse : pb::GeneratedMessage { + private QueryBidsByOrderBookResponse() { } + private static readonly QueryBidsByOrderBookResponse defaultInstance = new QueryBidsByOrderBookResponse().MakeReadOnly(); + private static readonly string[] _queryBidsByOrderBookResponseFieldNames = new string[] { "bids", "total_count" }; + private static readonly uint[] _queryBidsByOrderBookResponseFieldTags = new uint[] { 10, 16 }; + public static QueryBidsByOrderBookResponse DefaultInstance { + get { return defaultInstance; } + } + + public override QueryBidsByOrderBookResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override QueryBidsByOrderBookResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryBidsByOrderBookResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryBidsByOrderBookResponse__FieldAccessorTable; } + } + + public const int BidsFieldNumber = 1; + private pbc::PopsicleList bids_ = new pbc::PopsicleList(); + public scg::IList BidsList { + get { return bids_; } + } + public int BidsCount { + get { return bids_.Count; } + } + public global::bnet.protocol.exchange.BidExtended GetBids(int index) { + return bids_[index]; + } + + public const int TotalCountFieldNumber = 2; + private bool hasTotalCount; + private uint totalCount_; + public bool HasTotalCount { + get { return hasTotalCount; } + } + public uint TotalCount { + get { return totalCount_; } + } + + public override bool IsInitialized { + get { + if (!hasTotalCount) return false; + foreach (global::bnet.protocol.exchange.BidExtended element in BidsList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _queryBidsByOrderBookResponseFieldNames; + if (bids_.Count > 0) { + output.WriteMessageArray(1, field_names[0], bids_); + } + if (hasTotalCount) { + output.WriteUInt32(2, field_names[1], TotalCount); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.exchange.BidExtended element in BidsList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + if (hasTotalCount) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, TotalCount); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static QueryBidsByOrderBookResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static QueryBidsByOrderBookResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static QueryBidsByOrderBookResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static QueryBidsByOrderBookResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static QueryBidsByOrderBookResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static QueryBidsByOrderBookResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static QueryBidsByOrderBookResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static QueryBidsByOrderBookResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static QueryBidsByOrderBookResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static QueryBidsByOrderBookResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private QueryBidsByOrderBookResponse MakeReadOnly() { + bids_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(QueryBidsByOrderBookResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(QueryBidsByOrderBookResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private QueryBidsByOrderBookResponse result; + + private QueryBidsByOrderBookResponse PrepareBuilder() { + if (resultIsReadOnly) { + QueryBidsByOrderBookResponse original = result; + result = new QueryBidsByOrderBookResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override QueryBidsByOrderBookResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.QueryBidsByOrderBookResponse.Descriptor; } + } + + public override QueryBidsByOrderBookResponse DefaultInstanceForType { + get { return global::bnet.protocol.exchange.QueryBidsByOrderBookResponse.DefaultInstance; } + } + + public override QueryBidsByOrderBookResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is QueryBidsByOrderBookResponse) { + return MergeFrom((QueryBidsByOrderBookResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(QueryBidsByOrderBookResponse other) { + if (other == global::bnet.protocol.exchange.QueryBidsByOrderBookResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.bids_.Count != 0) { + result.bids_.Add(other.bids_); + } + if (other.HasTotalCount) { + TotalCount = other.TotalCount; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_queryBidsByOrderBookResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _queryBidsByOrderBookResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.bids_, global::bnet.protocol.exchange.BidExtended.DefaultInstance, extensionRegistry); + break; + } + case 16: { + result.hasTotalCount = input.ReadUInt32(ref result.totalCount_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList BidsList { + get { return PrepareBuilder().bids_; } + } + public int BidsCount { + get { return result.BidsCount; } + } + public global::bnet.protocol.exchange.BidExtended GetBids(int index) { + return result.GetBids(index); + } + public Builder SetBids(int index, global::bnet.protocol.exchange.BidExtended value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.bids_[index] = value; + return this; + } + public Builder SetBids(int index, global::bnet.protocol.exchange.BidExtended.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.bids_[index] = builderForValue.Build(); + return this; + } + public Builder AddBids(global::bnet.protocol.exchange.BidExtended value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.bids_.Add(value); + return this; + } + public Builder AddBids(global::bnet.protocol.exchange.BidExtended.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.bids_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeBids(scg::IEnumerable values) { + PrepareBuilder(); + result.bids_.Add(values); + return this; + } + public Builder ClearBids() { + PrepareBuilder(); + result.bids_.Clear(); + return this; + } + + public bool HasTotalCount { + get { return result.hasTotalCount; } + } + public uint TotalCount { + get { return result.TotalCount; } + set { SetTotalCount(value); } + } + public Builder SetTotalCount(uint value) { + PrepareBuilder(); + result.hasTotalCount = true; + result.totalCount_ = value; + return this; + } + public Builder ClearTotalCount() { + PrepareBuilder(); + result.hasTotalCount = false; + result.totalCount_ = 0; + return this; + } + } + static QueryBidsByOrderBookResponse() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class QueryOffersByAccountForItemRequest : pb::GeneratedMessage { + private QueryOffersByAccountForItemRequest() { } + private static readonly QueryOffersByAccountForItemRequest defaultInstance = new QueryOffersByAccountForItemRequest().MakeReadOnly(); + private static readonly string[] _queryOffersByAccountForItemRequestFieldNames = new string[] { "account_for_item", "bnet_account", "filter" }; + private static readonly uint[] _queryOffersByAccountForItemRequestFieldTags = new uint[] { 10, 26, 18 }; + public static QueryOffersByAccountForItemRequest DefaultInstance { + get { return defaultInstance; } + } + + public override QueryOffersByAccountForItemRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override QueryOffersByAccountForItemRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryOffersByAccountForItemRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryOffersByAccountForItemRequest__FieldAccessorTable; } + } + + public const int AccountForItemFieldNumber = 1; + private bool hasAccountForItem; + private global::bnet.protocol.exchange.BlobFrom accountForItem_; + public bool HasAccountForItem { + get { return hasAccountForItem; } + } + public global::bnet.protocol.exchange.BlobFrom AccountForItem { + get { return accountForItem_ ?? global::bnet.protocol.exchange.BlobFrom.DefaultInstance; } + } + + public const int FilterFieldNumber = 2; + private bool hasFilter; + private global::bnet.protocol.exchange.QueryFilterByCreatedTime filter_; + public bool HasFilter { + get { return hasFilter; } + } + public global::bnet.protocol.exchange.QueryFilterByCreatedTime Filter { + get { return filter_ ?? global::bnet.protocol.exchange.QueryFilterByCreatedTime.DefaultInstance; } + } + + public const int BnetAccountFieldNumber = 3; + private bool hasBnetAccount; + private global::bnet.protocol.EntityId bnetAccount_; + public bool HasBnetAccount { + get { return hasBnetAccount; } + } + public global::bnet.protocol.EntityId BnetAccount { + get { return bnetAccount_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasAccountForItem) return false; + if (!hasFilter) return false; + if (!AccountForItem.IsInitialized) return false; + if (!Filter.IsInitialized) return false; + if (HasBnetAccount) { + if (!BnetAccount.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _queryOffersByAccountForItemRequestFieldNames; + if (hasAccountForItem) { + output.WriteMessage(1, field_names[0], AccountForItem); + } + if (hasFilter) { + output.WriteMessage(2, field_names[2], Filter); + } + if (hasBnetAccount) { + output.WriteMessage(3, field_names[1], BnetAccount); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAccountForItem) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AccountForItem); + } + if (hasFilter) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Filter); + } + if (hasBnetAccount) { + size += pb::CodedOutputStream.ComputeMessageSize(3, BnetAccount); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static QueryOffersByAccountForItemRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static QueryOffersByAccountForItemRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static QueryOffersByAccountForItemRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static QueryOffersByAccountForItemRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static QueryOffersByAccountForItemRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static QueryOffersByAccountForItemRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static QueryOffersByAccountForItemRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static QueryOffersByAccountForItemRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static QueryOffersByAccountForItemRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static QueryOffersByAccountForItemRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private QueryOffersByAccountForItemRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(QueryOffersByAccountForItemRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(QueryOffersByAccountForItemRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private QueryOffersByAccountForItemRequest result; + + private QueryOffersByAccountForItemRequest PrepareBuilder() { + if (resultIsReadOnly) { + QueryOffersByAccountForItemRequest original = result; + result = new QueryOffersByAccountForItemRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override QueryOffersByAccountForItemRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.QueryOffersByAccountForItemRequest.Descriptor; } + } + + public override QueryOffersByAccountForItemRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.QueryOffersByAccountForItemRequest.DefaultInstance; } + } + + public override QueryOffersByAccountForItemRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is QueryOffersByAccountForItemRequest) { + return MergeFrom((QueryOffersByAccountForItemRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(QueryOffersByAccountForItemRequest other) { + if (other == global::bnet.protocol.exchange.QueryOffersByAccountForItemRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAccountForItem) { + MergeAccountForItem(other.AccountForItem); + } + if (other.HasFilter) { + MergeFilter(other.Filter); + } + if (other.HasBnetAccount) { + MergeBnetAccount(other.BnetAccount); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_queryOffersByAccountForItemRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _queryOffersByAccountForItemRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.BlobFrom.Builder subBuilder = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(); + if (result.hasAccountForItem) { + subBuilder.MergeFrom(AccountForItem); + } + input.ReadMessage(subBuilder, extensionRegistry); + AccountForItem = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.exchange.QueryFilterByCreatedTime.Builder subBuilder = global::bnet.protocol.exchange.QueryFilterByCreatedTime.CreateBuilder(); + if (result.hasFilter) { + subBuilder.MergeFrom(Filter); + } + input.ReadMessage(subBuilder, extensionRegistry); + Filter = subBuilder.BuildPartial(); + break; + } + case 26: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasBnetAccount) { + subBuilder.MergeFrom(BnetAccount); + } + input.ReadMessage(subBuilder, extensionRegistry); + BnetAccount = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAccountForItem { + get { return result.hasAccountForItem; } + } + public global::bnet.protocol.exchange.BlobFrom AccountForItem { + get { return result.AccountForItem; } + set { SetAccountForItem(value); } + } + public Builder SetAccountForItem(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccountForItem = true; + result.accountForItem_ = value; + return this; + } + public Builder SetAccountForItem(global::bnet.protocol.exchange.BlobFrom.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccountForItem = true; + result.accountForItem_ = builderForValue.Build(); + return this; + } + public Builder MergeAccountForItem(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccountForItem && + result.accountForItem_ != global::bnet.protocol.exchange.BlobFrom.DefaultInstance) { + result.accountForItem_ = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(result.accountForItem_).MergeFrom(value).BuildPartial(); + } else { + result.accountForItem_ = value; + } + result.hasAccountForItem = true; + return this; + } + public Builder ClearAccountForItem() { + PrepareBuilder(); + result.hasAccountForItem = false; + result.accountForItem_ = null; + return this; + } + + public bool HasFilter { + get { return result.hasFilter; } + } + public global::bnet.protocol.exchange.QueryFilterByCreatedTime Filter { + get { return result.Filter; } + set { SetFilter(value); } + } + public Builder SetFilter(global::bnet.protocol.exchange.QueryFilterByCreatedTime value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasFilter = true; + result.filter_ = value; + return this; + } + public Builder SetFilter(global::bnet.protocol.exchange.QueryFilterByCreatedTime.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasFilter = true; + result.filter_ = builderForValue.Build(); + return this; + } + public Builder MergeFilter(global::bnet.protocol.exchange.QueryFilterByCreatedTime value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasFilter && + result.filter_ != global::bnet.protocol.exchange.QueryFilterByCreatedTime.DefaultInstance) { + result.filter_ = global::bnet.protocol.exchange.QueryFilterByCreatedTime.CreateBuilder(result.filter_).MergeFrom(value).BuildPartial(); + } else { + result.filter_ = value; + } + result.hasFilter = true; + return this; + } + public Builder ClearFilter() { + PrepareBuilder(); + result.hasFilter = false; + result.filter_ = null; + return this; + } + + public bool HasBnetAccount { + get { return result.hasBnetAccount; } + } + public global::bnet.protocol.EntityId BnetAccount { + get { return result.BnetAccount; } + set { SetBnetAccount(value); } + } + public Builder SetBnetAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBnetAccount = true; + result.bnetAccount_ = value; + return this; + } + public Builder SetBnetAccount(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBnetAccount = true; + result.bnetAccount_ = builderForValue.Build(); + return this; + } + public Builder MergeBnetAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBnetAccount && + result.bnetAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.bnetAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccount_).MergeFrom(value).BuildPartial(); + } else { + result.bnetAccount_ = value; + } + result.hasBnetAccount = true; + return this; + } + public Builder ClearBnetAccount() { + PrepareBuilder(); + result.hasBnetAccount = false; + result.bnetAccount_ = null; + return this; + } + } + static QueryOffersByAccountForItemRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class QueryOffersByAccountForItemResponse : pb::GeneratedMessage { + private QueryOffersByAccountForItemResponse() { } + private static readonly QueryOffersByAccountForItemResponse defaultInstance = new QueryOffersByAccountForItemResponse().MakeReadOnly(); + private static readonly string[] _queryOffersByAccountForItemResponseFieldNames = new string[] { "offers", "total_count" }; + private static readonly uint[] _queryOffersByAccountForItemResponseFieldTags = new uint[] { 10, 16 }; + public static QueryOffersByAccountForItemResponse DefaultInstance { + get { return defaultInstance; } + } + + public override QueryOffersByAccountForItemResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override QueryOffersByAccountForItemResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryOffersByAccountForItemResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryOffersByAccountForItemResponse__FieldAccessorTable; } + } + + public const int OffersFieldNumber = 1; + private pbc::PopsicleList offers_ = new pbc::PopsicleList(); + public scg::IList OffersList { + get { return offers_; } + } + public int OffersCount { + get { return offers_.Count; } + } + public global::bnet.protocol.exchange.OfferExtended GetOffers(int index) { + return offers_[index]; + } + + public const int TotalCountFieldNumber = 2; + private bool hasTotalCount; + private uint totalCount_; + public bool HasTotalCount { + get { return hasTotalCount; } + } + public uint TotalCount { + get { return totalCount_; } + } + + public override bool IsInitialized { + get { + if (!hasTotalCount) return false; + foreach (global::bnet.protocol.exchange.OfferExtended element in OffersList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _queryOffersByAccountForItemResponseFieldNames; + if (offers_.Count > 0) { + output.WriteMessageArray(1, field_names[0], offers_); + } + if (hasTotalCount) { + output.WriteUInt32(2, field_names[1], TotalCount); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.exchange.OfferExtended element in OffersList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + if (hasTotalCount) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, TotalCount); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static QueryOffersByAccountForItemResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static QueryOffersByAccountForItemResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static QueryOffersByAccountForItemResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static QueryOffersByAccountForItemResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static QueryOffersByAccountForItemResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static QueryOffersByAccountForItemResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static QueryOffersByAccountForItemResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static QueryOffersByAccountForItemResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static QueryOffersByAccountForItemResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static QueryOffersByAccountForItemResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private QueryOffersByAccountForItemResponse MakeReadOnly() { + offers_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(QueryOffersByAccountForItemResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(QueryOffersByAccountForItemResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private QueryOffersByAccountForItemResponse result; + + private QueryOffersByAccountForItemResponse PrepareBuilder() { + if (resultIsReadOnly) { + QueryOffersByAccountForItemResponse original = result; + result = new QueryOffersByAccountForItemResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override QueryOffersByAccountForItemResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.QueryOffersByAccountForItemResponse.Descriptor; } + } + + public override QueryOffersByAccountForItemResponse DefaultInstanceForType { + get { return global::bnet.protocol.exchange.QueryOffersByAccountForItemResponse.DefaultInstance; } + } + + public override QueryOffersByAccountForItemResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is QueryOffersByAccountForItemResponse) { + return MergeFrom((QueryOffersByAccountForItemResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(QueryOffersByAccountForItemResponse other) { + if (other == global::bnet.protocol.exchange.QueryOffersByAccountForItemResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.offers_.Count != 0) { + result.offers_.Add(other.offers_); + } + if (other.HasTotalCount) { + TotalCount = other.TotalCount; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_queryOffersByAccountForItemResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _queryOffersByAccountForItemResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.offers_, global::bnet.protocol.exchange.OfferExtended.DefaultInstance, extensionRegistry); + break; + } + case 16: { + result.hasTotalCount = input.ReadUInt32(ref result.totalCount_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList OffersList { + get { return PrepareBuilder().offers_; } + } + public int OffersCount { + get { return result.OffersCount; } + } + public global::bnet.protocol.exchange.OfferExtended GetOffers(int index) { + return result.GetOffers(index); + } + public Builder SetOffers(int index, global::bnet.protocol.exchange.OfferExtended value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.offers_[index] = value; + return this; + } + public Builder SetOffers(int index, global::bnet.protocol.exchange.OfferExtended.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.offers_[index] = builderForValue.Build(); + return this; + } + public Builder AddOffers(global::bnet.protocol.exchange.OfferExtended value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.offers_.Add(value); + return this; + } + public Builder AddOffers(global::bnet.protocol.exchange.OfferExtended.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.offers_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeOffers(scg::IEnumerable values) { + PrepareBuilder(); + result.offers_.Add(values); + return this; + } + public Builder ClearOffers() { + PrepareBuilder(); + result.offers_.Clear(); + return this; + } + + public bool HasTotalCount { + get { return result.hasTotalCount; } + } + public uint TotalCount { + get { return result.TotalCount; } + set { SetTotalCount(value); } + } + public Builder SetTotalCount(uint value) { + PrepareBuilder(); + result.hasTotalCount = true; + result.totalCount_ = value; + return this; + } + public Builder ClearTotalCount() { + PrepareBuilder(); + result.hasTotalCount = false; + result.totalCount_ = 0; + return this; + } + } + static QueryOffersByAccountForItemResponse() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class QueryBidsByAccountForItemRequest : pb::GeneratedMessage { + private QueryBidsByAccountForItemRequest() { } + private static readonly QueryBidsByAccountForItemRequest defaultInstance = new QueryBidsByAccountForItemRequest().MakeReadOnly(); + private static readonly string[] _queryBidsByAccountForItemRequestFieldNames = new string[] { "account_for_item", "bnet_account", "filter" }; + private static readonly uint[] _queryBidsByAccountForItemRequestFieldTags = new uint[] { 10, 26, 18 }; + public static QueryBidsByAccountForItemRequest DefaultInstance { + get { return defaultInstance; } + } + + public override QueryBidsByAccountForItemRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override QueryBidsByAccountForItemRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryBidsByAccountForItemRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryBidsByAccountForItemRequest__FieldAccessorTable; } + } + + public const int AccountForItemFieldNumber = 1; + private bool hasAccountForItem; + private global::bnet.protocol.exchange.BlobFrom accountForItem_; + public bool HasAccountForItem { + get { return hasAccountForItem; } + } + public global::bnet.protocol.exchange.BlobFrom AccountForItem { + get { return accountForItem_ ?? global::bnet.protocol.exchange.BlobFrom.DefaultInstance; } + } + + public const int FilterFieldNumber = 2; + private bool hasFilter; + private global::bnet.protocol.exchange.QueryFilterByCreatedTime filter_; + public bool HasFilter { + get { return hasFilter; } + } + public global::bnet.protocol.exchange.QueryFilterByCreatedTime Filter { + get { return filter_ ?? global::bnet.protocol.exchange.QueryFilterByCreatedTime.DefaultInstance; } + } + + public const int BnetAccountFieldNumber = 3; + private bool hasBnetAccount; + private global::bnet.protocol.EntityId bnetAccount_; + public bool HasBnetAccount { + get { return hasBnetAccount; } + } + public global::bnet.protocol.EntityId BnetAccount { + get { return bnetAccount_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasAccountForItem) return false; + if (!hasFilter) return false; + if (!AccountForItem.IsInitialized) return false; + if (!Filter.IsInitialized) return false; + if (HasBnetAccount) { + if (!BnetAccount.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _queryBidsByAccountForItemRequestFieldNames; + if (hasAccountForItem) { + output.WriteMessage(1, field_names[0], AccountForItem); + } + if (hasFilter) { + output.WriteMessage(2, field_names[2], Filter); + } + if (hasBnetAccount) { + output.WriteMessage(3, field_names[1], BnetAccount); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAccountForItem) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AccountForItem); + } + if (hasFilter) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Filter); + } + if (hasBnetAccount) { + size += pb::CodedOutputStream.ComputeMessageSize(3, BnetAccount); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static QueryBidsByAccountForItemRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static QueryBidsByAccountForItemRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static QueryBidsByAccountForItemRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static QueryBidsByAccountForItemRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static QueryBidsByAccountForItemRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static QueryBidsByAccountForItemRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static QueryBidsByAccountForItemRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static QueryBidsByAccountForItemRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static QueryBidsByAccountForItemRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static QueryBidsByAccountForItemRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private QueryBidsByAccountForItemRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(QueryBidsByAccountForItemRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(QueryBidsByAccountForItemRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private QueryBidsByAccountForItemRequest result; + + private QueryBidsByAccountForItemRequest PrepareBuilder() { + if (resultIsReadOnly) { + QueryBidsByAccountForItemRequest original = result; + result = new QueryBidsByAccountForItemRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override QueryBidsByAccountForItemRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.QueryBidsByAccountForItemRequest.Descriptor; } + } + + public override QueryBidsByAccountForItemRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.QueryBidsByAccountForItemRequest.DefaultInstance; } + } + + public override QueryBidsByAccountForItemRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is QueryBidsByAccountForItemRequest) { + return MergeFrom((QueryBidsByAccountForItemRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(QueryBidsByAccountForItemRequest other) { + if (other == global::bnet.protocol.exchange.QueryBidsByAccountForItemRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAccountForItem) { + MergeAccountForItem(other.AccountForItem); + } + if (other.HasFilter) { + MergeFilter(other.Filter); + } + if (other.HasBnetAccount) { + MergeBnetAccount(other.BnetAccount); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_queryBidsByAccountForItemRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _queryBidsByAccountForItemRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.BlobFrom.Builder subBuilder = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(); + if (result.hasAccountForItem) { + subBuilder.MergeFrom(AccountForItem); + } + input.ReadMessage(subBuilder, extensionRegistry); + AccountForItem = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.exchange.QueryFilterByCreatedTime.Builder subBuilder = global::bnet.protocol.exchange.QueryFilterByCreatedTime.CreateBuilder(); + if (result.hasFilter) { + subBuilder.MergeFrom(Filter); + } + input.ReadMessage(subBuilder, extensionRegistry); + Filter = subBuilder.BuildPartial(); + break; + } + case 26: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasBnetAccount) { + subBuilder.MergeFrom(BnetAccount); + } + input.ReadMessage(subBuilder, extensionRegistry); + BnetAccount = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAccountForItem { + get { return result.hasAccountForItem; } + } + public global::bnet.protocol.exchange.BlobFrom AccountForItem { + get { return result.AccountForItem; } + set { SetAccountForItem(value); } + } + public Builder SetAccountForItem(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccountForItem = true; + result.accountForItem_ = value; + return this; + } + public Builder SetAccountForItem(global::bnet.protocol.exchange.BlobFrom.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccountForItem = true; + result.accountForItem_ = builderForValue.Build(); + return this; + } + public Builder MergeAccountForItem(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccountForItem && + result.accountForItem_ != global::bnet.protocol.exchange.BlobFrom.DefaultInstance) { + result.accountForItem_ = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(result.accountForItem_).MergeFrom(value).BuildPartial(); + } else { + result.accountForItem_ = value; + } + result.hasAccountForItem = true; + return this; + } + public Builder ClearAccountForItem() { + PrepareBuilder(); + result.hasAccountForItem = false; + result.accountForItem_ = null; + return this; + } + + public bool HasFilter { + get { return result.hasFilter; } + } + public global::bnet.protocol.exchange.QueryFilterByCreatedTime Filter { + get { return result.Filter; } + set { SetFilter(value); } + } + public Builder SetFilter(global::bnet.protocol.exchange.QueryFilterByCreatedTime value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasFilter = true; + result.filter_ = value; + return this; + } + public Builder SetFilter(global::bnet.protocol.exchange.QueryFilterByCreatedTime.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasFilter = true; + result.filter_ = builderForValue.Build(); + return this; + } + public Builder MergeFilter(global::bnet.protocol.exchange.QueryFilterByCreatedTime value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasFilter && + result.filter_ != global::bnet.protocol.exchange.QueryFilterByCreatedTime.DefaultInstance) { + result.filter_ = global::bnet.protocol.exchange.QueryFilterByCreatedTime.CreateBuilder(result.filter_).MergeFrom(value).BuildPartial(); + } else { + result.filter_ = value; + } + result.hasFilter = true; + return this; + } + public Builder ClearFilter() { + PrepareBuilder(); + result.hasFilter = false; + result.filter_ = null; + return this; + } + + public bool HasBnetAccount { + get { return result.hasBnetAccount; } + } + public global::bnet.protocol.EntityId BnetAccount { + get { return result.BnetAccount; } + set { SetBnetAccount(value); } + } + public Builder SetBnetAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBnetAccount = true; + result.bnetAccount_ = value; + return this; + } + public Builder SetBnetAccount(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBnetAccount = true; + result.bnetAccount_ = builderForValue.Build(); + return this; + } + public Builder MergeBnetAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBnetAccount && + result.bnetAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.bnetAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccount_).MergeFrom(value).BuildPartial(); + } else { + result.bnetAccount_ = value; + } + result.hasBnetAccount = true; + return this; + } + public Builder ClearBnetAccount() { + PrepareBuilder(); + result.hasBnetAccount = false; + result.bnetAccount_ = null; + return this; + } + } + static QueryBidsByAccountForItemRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class QueryBidsByAccountForItemResponse : pb::GeneratedMessage { + private QueryBidsByAccountForItemResponse() { } + private static readonly QueryBidsByAccountForItemResponse defaultInstance = new QueryBidsByAccountForItemResponse().MakeReadOnly(); + private static readonly string[] _queryBidsByAccountForItemResponseFieldNames = new string[] { "bids", "total_count" }; + private static readonly uint[] _queryBidsByAccountForItemResponseFieldTags = new uint[] { 10, 16 }; + public static QueryBidsByAccountForItemResponse DefaultInstance { + get { return defaultInstance; } + } + + public override QueryBidsByAccountForItemResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override QueryBidsByAccountForItemResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryBidsByAccountForItemResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryBidsByAccountForItemResponse__FieldAccessorTable; } + } + + public const int BidsFieldNumber = 1; + private pbc::PopsicleList bids_ = new pbc::PopsicleList(); + public scg::IList BidsList { + get { return bids_; } + } + public int BidsCount { + get { return bids_.Count; } + } + public global::bnet.protocol.exchange.BidExtended GetBids(int index) { + return bids_[index]; + } + + public const int TotalCountFieldNumber = 2; + private bool hasTotalCount; + private uint totalCount_; + public bool HasTotalCount { + get { return hasTotalCount; } + } + public uint TotalCount { + get { return totalCount_; } + } + + public override bool IsInitialized { + get { + if (!hasTotalCount) return false; + foreach (global::bnet.protocol.exchange.BidExtended element in BidsList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _queryBidsByAccountForItemResponseFieldNames; + if (bids_.Count > 0) { + output.WriteMessageArray(1, field_names[0], bids_); + } + if (hasTotalCount) { + output.WriteUInt32(2, field_names[1], TotalCount); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.exchange.BidExtended element in BidsList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + if (hasTotalCount) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, TotalCount); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static QueryBidsByAccountForItemResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static QueryBidsByAccountForItemResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static QueryBidsByAccountForItemResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static QueryBidsByAccountForItemResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static QueryBidsByAccountForItemResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static QueryBidsByAccountForItemResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static QueryBidsByAccountForItemResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static QueryBidsByAccountForItemResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static QueryBidsByAccountForItemResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static QueryBidsByAccountForItemResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private QueryBidsByAccountForItemResponse MakeReadOnly() { + bids_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(QueryBidsByAccountForItemResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(QueryBidsByAccountForItemResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private QueryBidsByAccountForItemResponse result; + + private QueryBidsByAccountForItemResponse PrepareBuilder() { + if (resultIsReadOnly) { + QueryBidsByAccountForItemResponse original = result; + result = new QueryBidsByAccountForItemResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override QueryBidsByAccountForItemResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.QueryBidsByAccountForItemResponse.Descriptor; } + } + + public override QueryBidsByAccountForItemResponse DefaultInstanceForType { + get { return global::bnet.protocol.exchange.QueryBidsByAccountForItemResponse.DefaultInstance; } + } + + public override QueryBidsByAccountForItemResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is QueryBidsByAccountForItemResponse) { + return MergeFrom((QueryBidsByAccountForItemResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(QueryBidsByAccountForItemResponse other) { + if (other == global::bnet.protocol.exchange.QueryBidsByAccountForItemResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.bids_.Count != 0) { + result.bids_.Add(other.bids_); + } + if (other.HasTotalCount) { + TotalCount = other.TotalCount; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_queryBidsByAccountForItemResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _queryBidsByAccountForItemResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.bids_, global::bnet.protocol.exchange.BidExtended.DefaultInstance, extensionRegistry); + break; + } + case 16: { + result.hasTotalCount = input.ReadUInt32(ref result.totalCount_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList BidsList { + get { return PrepareBuilder().bids_; } + } + public int BidsCount { + get { return result.BidsCount; } + } + public global::bnet.protocol.exchange.BidExtended GetBids(int index) { + return result.GetBids(index); + } + public Builder SetBids(int index, global::bnet.protocol.exchange.BidExtended value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.bids_[index] = value; + return this; + } + public Builder SetBids(int index, global::bnet.protocol.exchange.BidExtended.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.bids_[index] = builderForValue.Build(); + return this; + } + public Builder AddBids(global::bnet.protocol.exchange.BidExtended value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.bids_.Add(value); + return this; + } + public Builder AddBids(global::bnet.protocol.exchange.BidExtended.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.bids_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeBids(scg::IEnumerable values) { + PrepareBuilder(); + result.bids_.Add(values); + return this; + } + public Builder ClearBids() { + PrepareBuilder(); + result.bids_.Clear(); + return this; + } + + public bool HasTotalCount { + get { return result.hasTotalCount; } + } + public uint TotalCount { + get { return result.TotalCount; } + set { SetTotalCount(value); } + } + public Builder SetTotalCount(uint value) { + PrepareBuilder(); + result.hasTotalCount = true; + result.totalCount_ = value; + return this; + } + public Builder ClearTotalCount() { + PrepareBuilder(); + result.hasTotalCount = false; + result.totalCount_ = 0; + return this; + } + } + static QueryBidsByAccountForItemResponse() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class QueryOrderBooksSummaryRequest : pb::GeneratedMessage { + private QueryOrderBooksSummaryRequest() { } + private static readonly QueryOrderBooksSummaryRequest defaultInstance = new QueryOrderBooksSummaryRequest().MakeReadOnly(); + private static readonly string[] _queryOrderBooksSummaryRequestFieldNames = new string[] { "handles" }; + private static readonly uint[] _queryOrderBooksSummaryRequestFieldTags = new uint[] { 10 }; + public static QueryOrderBooksSummaryRequest DefaultInstance { + get { return defaultInstance; } + } + + public override QueryOrderBooksSummaryRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override QueryOrderBooksSummaryRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryOrderBooksSummaryRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryOrderBooksSummaryRequest__FieldAccessorTable; } + } + + public const int HandlesFieldNumber = 1; + private pbc::PopsicleList handles_ = new pbc::PopsicleList(); + public scg::IList HandlesList { + get { return handles_; } + } + public int HandlesCount { + get { return handles_.Count; } + } + public global::bnet.protocol.exchange.OrderBookHandle GetHandles(int index) { + return handles_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.exchange.OrderBookHandle element in HandlesList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _queryOrderBooksSummaryRequestFieldNames; + if (handles_.Count > 0) { + output.WriteMessageArray(1, field_names[0], handles_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.exchange.OrderBookHandle element in HandlesList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static QueryOrderBooksSummaryRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static QueryOrderBooksSummaryRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static QueryOrderBooksSummaryRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static QueryOrderBooksSummaryRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static QueryOrderBooksSummaryRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static QueryOrderBooksSummaryRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static QueryOrderBooksSummaryRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static QueryOrderBooksSummaryRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static QueryOrderBooksSummaryRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static QueryOrderBooksSummaryRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private QueryOrderBooksSummaryRequest MakeReadOnly() { + handles_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(QueryOrderBooksSummaryRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(QueryOrderBooksSummaryRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private QueryOrderBooksSummaryRequest result; + + private QueryOrderBooksSummaryRequest PrepareBuilder() { + if (resultIsReadOnly) { + QueryOrderBooksSummaryRequest original = result; + result = new QueryOrderBooksSummaryRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override QueryOrderBooksSummaryRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.QueryOrderBooksSummaryRequest.Descriptor; } + } + + public override QueryOrderBooksSummaryRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.QueryOrderBooksSummaryRequest.DefaultInstance; } + } + + public override QueryOrderBooksSummaryRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is QueryOrderBooksSummaryRequest) { + return MergeFrom((QueryOrderBooksSummaryRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(QueryOrderBooksSummaryRequest other) { + if (other == global::bnet.protocol.exchange.QueryOrderBooksSummaryRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.handles_.Count != 0) { + result.handles_.Add(other.handles_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_queryOrderBooksSummaryRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _queryOrderBooksSummaryRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.handles_, global::bnet.protocol.exchange.OrderBookHandle.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList HandlesList { + get { return PrepareBuilder().handles_; } + } + public int HandlesCount { + get { return result.HandlesCount; } + } + public global::bnet.protocol.exchange.OrderBookHandle GetHandles(int index) { + return result.GetHandles(index); + } + public Builder SetHandles(int index, global::bnet.protocol.exchange.OrderBookHandle value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.handles_[index] = value; + return this; + } + public Builder SetHandles(int index, global::bnet.protocol.exchange.OrderBookHandle.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.handles_[index] = builderForValue.Build(); + return this; + } + public Builder AddHandles(global::bnet.protocol.exchange.OrderBookHandle value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.handles_.Add(value); + return this; + } + public Builder AddHandles(global::bnet.protocol.exchange.OrderBookHandle.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.handles_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeHandles(scg::IEnumerable values) { + PrepareBuilder(); + result.handles_.Add(values); + return this; + } + public Builder ClearHandles() { + PrepareBuilder(); + result.handles_.Clear(); + return this; + } + } + static QueryOrderBooksSummaryRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class QueryOrderBooksSummaryResponse : pb::GeneratedMessage { + private QueryOrderBooksSummaryResponse() { } + private static readonly QueryOrderBooksSummaryResponse defaultInstance = new QueryOrderBooksSummaryResponse().MakeReadOnly(); + private static readonly string[] _queryOrderBooksSummaryResponseFieldNames = new string[] { "order_books" }; + private static readonly uint[] _queryOrderBooksSummaryResponseFieldTags = new uint[] { 10 }; + public static QueryOrderBooksSummaryResponse DefaultInstance { + get { return defaultInstance; } + } + + public override QueryOrderBooksSummaryResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override QueryOrderBooksSummaryResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryOrderBooksSummaryResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryOrderBooksSummaryResponse__FieldAccessorTable; } + } + + public const int OrderBooksFieldNumber = 1; + private pbc::PopsicleList orderBooks_ = new pbc::PopsicleList(); + public scg::IList OrderBooksList { + get { return orderBooks_; } + } + public int OrderBooksCount { + get { return orderBooks_.Count; } + } + public global::bnet.protocol.exchange.OrderBookSummary GetOrderBooks(int index) { + return orderBooks_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.exchange.OrderBookSummary element in OrderBooksList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _queryOrderBooksSummaryResponseFieldNames; + if (orderBooks_.Count > 0) { + output.WriteMessageArray(1, field_names[0], orderBooks_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.exchange.OrderBookSummary element in OrderBooksList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static QueryOrderBooksSummaryResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static QueryOrderBooksSummaryResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static QueryOrderBooksSummaryResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static QueryOrderBooksSummaryResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static QueryOrderBooksSummaryResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static QueryOrderBooksSummaryResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static QueryOrderBooksSummaryResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static QueryOrderBooksSummaryResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static QueryOrderBooksSummaryResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static QueryOrderBooksSummaryResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private QueryOrderBooksSummaryResponse MakeReadOnly() { + orderBooks_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(QueryOrderBooksSummaryResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(QueryOrderBooksSummaryResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private QueryOrderBooksSummaryResponse result; + + private QueryOrderBooksSummaryResponse PrepareBuilder() { + if (resultIsReadOnly) { + QueryOrderBooksSummaryResponse original = result; + result = new QueryOrderBooksSummaryResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override QueryOrderBooksSummaryResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.QueryOrderBooksSummaryResponse.Descriptor; } + } + + public override QueryOrderBooksSummaryResponse DefaultInstanceForType { + get { return global::bnet.protocol.exchange.QueryOrderBooksSummaryResponse.DefaultInstance; } + } + + public override QueryOrderBooksSummaryResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is QueryOrderBooksSummaryResponse) { + return MergeFrom((QueryOrderBooksSummaryResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(QueryOrderBooksSummaryResponse other) { + if (other == global::bnet.protocol.exchange.QueryOrderBooksSummaryResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.orderBooks_.Count != 0) { + result.orderBooks_.Add(other.orderBooks_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_queryOrderBooksSummaryResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _queryOrderBooksSummaryResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.orderBooks_, global::bnet.protocol.exchange.OrderBookSummary.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList OrderBooksList { + get { return PrepareBuilder().orderBooks_; } + } + public int OrderBooksCount { + get { return result.OrderBooksCount; } + } + public global::bnet.protocol.exchange.OrderBookSummary GetOrderBooks(int index) { + return result.GetOrderBooks(index); + } + public Builder SetOrderBooks(int index, global::bnet.protocol.exchange.OrderBookSummary value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.orderBooks_[index] = value; + return this; + } + public Builder SetOrderBooks(int index, global::bnet.protocol.exchange.OrderBookSummary.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.orderBooks_[index] = builderForValue.Build(); + return this; + } + public Builder AddOrderBooks(global::bnet.protocol.exchange.OrderBookSummary value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.orderBooks_.Add(value); + return this; + } + public Builder AddOrderBooks(global::bnet.protocol.exchange.OrderBookSummary.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.orderBooks_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeOrderBooks(scg::IEnumerable values) { + PrepareBuilder(); + result.orderBooks_.Add(values); + return this; + } + public Builder ClearOrderBooks() { + PrepareBuilder(); + result.orderBooks_.Clear(); + return this; + } + } + static QueryOrderBooksSummaryResponse() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class SubscribeOrderBookStatusChangeRequest : pb::GeneratedMessage { + private SubscribeOrderBookStatusChangeRequest() { } + private static readonly SubscribeOrderBookStatusChangeRequest defaultInstance = new SubscribeOrderBookStatusChangeRequest().MakeReadOnly(); + private static readonly string[] _subscribeOrderBookStatusChangeRequestFieldNames = new string[] { "bootstrap", "bootstrap_oldest_created_time", "currency", "max_partition_id", "min_partition_id", "object_id", "program", "specialist", "status" }; + private static readonly uint[] _subscribeOrderBookStatusChangeRequestFieldTags = new uint[] { 64, 72, 50, 26, 18, 8, 37, 56, 40 }; + public static SubscribeOrderBookStatusChangeRequest DefaultInstance { + get { return defaultInstance; } + } + + public override SubscribeOrderBookStatusChangeRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SubscribeOrderBookStatusChangeRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_SubscribeOrderBookStatusChangeRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_SubscribeOrderBookStatusChangeRequest__FieldAccessorTable; } + } + + public const int ObjectIdFieldNumber = 1; + private bool hasObjectId; + private ulong objectId_; + public bool HasObjectId { + get { return hasObjectId; } + } + public ulong ObjectId { + get { return objectId_; } + } + + public const int MinPartitionIdFieldNumber = 2; + private bool hasMinPartitionId; + private global::bnet.protocol.exchange.PartitionId minPartitionId_; + public bool HasMinPartitionId { + get { return hasMinPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId MinPartitionId { + get { return minPartitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int MaxPartitionIdFieldNumber = 3; + private bool hasMaxPartitionId; + private global::bnet.protocol.exchange.PartitionId maxPartitionId_; + public bool HasMaxPartitionId { + get { return hasMaxPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId MaxPartitionId { + get { return maxPartitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int ProgramFieldNumber = 4; + private bool hasProgram; + private uint program_; + public bool HasProgram { + get { return hasProgram; } + } + public uint Program { + get { return program_; } + } + + public const int StatusFieldNumber = 5; + private bool hasStatus; + private int status_; + public bool HasStatus { + get { return hasStatus; } + } + public int Status { + get { return status_; } + } + + public const int CurrencyFieldNumber = 6; + private bool hasCurrency; + private string currency_ = ""; + public bool HasCurrency { + get { return hasCurrency; } + } + public string Currency { + get { return currency_; } + } + + public const int SpecialistFieldNumber = 7; + private bool hasSpecialist; + private int specialist_; + public bool HasSpecialist { + get { return hasSpecialist; } + } + public int Specialist { + get { return specialist_; } + } + + public const int BootstrapFieldNumber = 8; + private bool hasBootstrap; + private bool bootstrap_; + public bool HasBootstrap { + get { return hasBootstrap; } + } + public bool Bootstrap { + get { return bootstrap_; } + } + + public const int BootstrapOldestCreatedTimeFieldNumber = 9; + private bool hasBootstrapOldestCreatedTime; + private ulong bootstrapOldestCreatedTime_; + public bool HasBootstrapOldestCreatedTime { + get { return hasBootstrapOldestCreatedTime; } + } + public ulong BootstrapOldestCreatedTime { + get { return bootstrapOldestCreatedTime_; } + } + + public override bool IsInitialized { + get { + if (!hasObjectId) return false; + if (!hasMinPartitionId) return false; + if (!hasMaxPartitionId) return false; + if (!hasProgram) return false; + if (!hasStatus) return false; + if (!hasCurrency) return false; + if (!hasSpecialist) return false; + if (!MinPartitionId.IsInitialized) return false; + if (!MaxPartitionId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _subscribeOrderBookStatusChangeRequestFieldNames; + if (hasObjectId) { + output.WriteUInt64(1, field_names[5], ObjectId); + } + if (hasMinPartitionId) { + output.WriteMessage(2, field_names[4], MinPartitionId); + } + if (hasMaxPartitionId) { + output.WriteMessage(3, field_names[3], MaxPartitionId); + } + if (hasProgram) { + output.WriteFixed32(4, field_names[6], Program); + } + if (hasStatus) { + output.WriteInt32(5, field_names[8], Status); + } + if (hasCurrency) { + output.WriteString(6, field_names[2], Currency); + } + if (hasSpecialist) { + output.WriteInt32(7, field_names[7], Specialist); + } + if (hasBootstrap) { + output.WriteBool(8, field_names[0], Bootstrap); + } + if (hasBootstrapOldestCreatedTime) { + output.WriteUInt64(9, field_names[1], BootstrapOldestCreatedTime); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasObjectId) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, ObjectId); + } + if (hasMinPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, MinPartitionId); + } + if (hasMaxPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(3, MaxPartitionId); + } + if (hasProgram) { + size += pb::CodedOutputStream.ComputeFixed32Size(4, Program); + } + if (hasStatus) { + size += pb::CodedOutputStream.ComputeInt32Size(5, Status); + } + if (hasCurrency) { + size += pb::CodedOutputStream.ComputeStringSize(6, Currency); + } + if (hasSpecialist) { + size += pb::CodedOutputStream.ComputeInt32Size(7, Specialist); + } + if (hasBootstrap) { + size += pb::CodedOutputStream.ComputeBoolSize(8, Bootstrap); + } + if (hasBootstrapOldestCreatedTime) { + size += pb::CodedOutputStream.ComputeUInt64Size(9, BootstrapOldestCreatedTime); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static SubscribeOrderBookStatusChangeRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SubscribeOrderBookStatusChangeRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SubscribeOrderBookStatusChangeRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SubscribeOrderBookStatusChangeRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SubscribeOrderBookStatusChangeRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SubscribeOrderBookStatusChangeRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SubscribeOrderBookStatusChangeRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SubscribeOrderBookStatusChangeRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SubscribeOrderBookStatusChangeRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SubscribeOrderBookStatusChangeRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SubscribeOrderBookStatusChangeRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SubscribeOrderBookStatusChangeRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SubscribeOrderBookStatusChangeRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SubscribeOrderBookStatusChangeRequest result; + + private SubscribeOrderBookStatusChangeRequest PrepareBuilder() { + if (resultIsReadOnly) { + SubscribeOrderBookStatusChangeRequest original = result; + result = new SubscribeOrderBookStatusChangeRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SubscribeOrderBookStatusChangeRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.SubscribeOrderBookStatusChangeRequest.Descriptor; } + } + + public override SubscribeOrderBookStatusChangeRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.SubscribeOrderBookStatusChangeRequest.DefaultInstance; } + } + + public override SubscribeOrderBookStatusChangeRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SubscribeOrderBookStatusChangeRequest) { + return MergeFrom((SubscribeOrderBookStatusChangeRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SubscribeOrderBookStatusChangeRequest other) { + if (other == global::bnet.protocol.exchange.SubscribeOrderBookStatusChangeRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasObjectId) { + ObjectId = other.ObjectId; + } + if (other.HasMinPartitionId) { + MergeMinPartitionId(other.MinPartitionId); + } + if (other.HasMaxPartitionId) { + MergeMaxPartitionId(other.MaxPartitionId); + } + if (other.HasProgram) { + Program = other.Program; + } + if (other.HasStatus) { + Status = other.Status; + } + if (other.HasCurrency) { + Currency = other.Currency; + } + if (other.HasSpecialist) { + Specialist = other.Specialist; + } + if (other.HasBootstrap) { + Bootstrap = other.Bootstrap; + } + if (other.HasBootstrapOldestCreatedTime) { + BootstrapOldestCreatedTime = other.BootstrapOldestCreatedTime; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_subscribeOrderBookStatusChangeRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _subscribeOrderBookStatusChangeRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasObjectId = input.ReadUInt64(ref result.objectId_); + break; + } + case 18: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasMinPartitionId) { + subBuilder.MergeFrom(MinPartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + MinPartitionId = subBuilder.BuildPartial(); + break; + } + case 26: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasMaxPartitionId) { + subBuilder.MergeFrom(MaxPartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + MaxPartitionId = subBuilder.BuildPartial(); + break; + } + case 37: { + result.hasProgram = input.ReadFixed32(ref result.program_); + break; + } + case 40: { + result.hasStatus = input.ReadInt32(ref result.status_); + break; + } + case 50: { + result.hasCurrency = input.ReadString(ref result.currency_); + break; + } + case 56: { + result.hasSpecialist = input.ReadInt32(ref result.specialist_); + break; + } + case 64: { + result.hasBootstrap = input.ReadBool(ref result.bootstrap_); + break; + } + case 72: { + result.hasBootstrapOldestCreatedTime = input.ReadUInt64(ref result.bootstrapOldestCreatedTime_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasObjectId { + get { return result.hasObjectId; } + } + public ulong ObjectId { + get { return result.ObjectId; } + set { SetObjectId(value); } + } + public Builder SetObjectId(ulong value) { + PrepareBuilder(); + result.hasObjectId = true; + result.objectId_ = value; + return this; + } + public Builder ClearObjectId() { + PrepareBuilder(); + result.hasObjectId = false; + result.objectId_ = 0UL; + return this; + } + + public bool HasMinPartitionId { + get { return result.hasMinPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId MinPartitionId { + get { return result.MinPartitionId; } + set { SetMinPartitionId(value); } + } + public Builder SetMinPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasMinPartitionId = true; + result.minPartitionId_ = value; + return this; + } + public Builder SetMinPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasMinPartitionId = true; + result.minPartitionId_ = builderForValue.Build(); + return this; + } + public Builder MergeMinPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasMinPartitionId && + result.minPartitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.minPartitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.minPartitionId_).MergeFrom(value).BuildPartial(); + } else { + result.minPartitionId_ = value; + } + result.hasMinPartitionId = true; + return this; + } + public Builder ClearMinPartitionId() { + PrepareBuilder(); + result.hasMinPartitionId = false; + result.minPartitionId_ = null; + return this; + } + + public bool HasMaxPartitionId { + get { return result.hasMaxPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId MaxPartitionId { + get { return result.MaxPartitionId; } + set { SetMaxPartitionId(value); } + } + public Builder SetMaxPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasMaxPartitionId = true; + result.maxPartitionId_ = value; + return this; + } + public Builder SetMaxPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasMaxPartitionId = true; + result.maxPartitionId_ = builderForValue.Build(); + return this; + } + public Builder MergeMaxPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasMaxPartitionId && + result.maxPartitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.maxPartitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.maxPartitionId_).MergeFrom(value).BuildPartial(); + } else { + result.maxPartitionId_ = value; + } + result.hasMaxPartitionId = true; + return this; + } + public Builder ClearMaxPartitionId() { + PrepareBuilder(); + result.hasMaxPartitionId = false; + result.maxPartitionId_ = null; + return this; + } + + public bool HasProgram { + get { return result.hasProgram; } + } + public uint Program { + get { return result.Program; } + set { SetProgram(value); } + } + public Builder SetProgram(uint value) { + PrepareBuilder(); + result.hasProgram = true; + result.program_ = value; + return this; + } + public Builder ClearProgram() { + PrepareBuilder(); + result.hasProgram = false; + result.program_ = 0; + return this; + } + + public bool HasStatus { + get { return result.hasStatus; } + } + public int Status { + get { return result.Status; } + set { SetStatus(value); } + } + public Builder SetStatus(int value) { + PrepareBuilder(); + result.hasStatus = true; + result.status_ = value; + return this; + } + public Builder ClearStatus() { + PrepareBuilder(); + result.hasStatus = false; + result.status_ = 0; + return this; + } + + public bool HasCurrency { + get { return result.hasCurrency; } + } + public string Currency { + get { return result.Currency; } + set { SetCurrency(value); } + } + public Builder SetCurrency(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasCurrency = true; + result.currency_ = value; + return this; + } + public Builder ClearCurrency() { + PrepareBuilder(); + result.hasCurrency = false; + result.currency_ = ""; + return this; + } + + public bool HasSpecialist { + get { return result.hasSpecialist; } + } + public int Specialist { + get { return result.Specialist; } + set { SetSpecialist(value); } + } + public Builder SetSpecialist(int value) { + PrepareBuilder(); + result.hasSpecialist = true; + result.specialist_ = value; + return this; + } + public Builder ClearSpecialist() { + PrepareBuilder(); + result.hasSpecialist = false; + result.specialist_ = 0; + return this; + } + + public bool HasBootstrap { + get { return result.hasBootstrap; } + } + public bool Bootstrap { + get { return result.Bootstrap; } + set { SetBootstrap(value); } + } + public Builder SetBootstrap(bool value) { + PrepareBuilder(); + result.hasBootstrap = true; + result.bootstrap_ = value; + return this; + } + public Builder ClearBootstrap() { + PrepareBuilder(); + result.hasBootstrap = false; + result.bootstrap_ = false; + return this; + } + + public bool HasBootstrapOldestCreatedTime { + get { return result.hasBootstrapOldestCreatedTime; } + } + public ulong BootstrapOldestCreatedTime { + get { return result.BootstrapOldestCreatedTime; } + set { SetBootstrapOldestCreatedTime(value); } + } + public Builder SetBootstrapOldestCreatedTime(ulong value) { + PrepareBuilder(); + result.hasBootstrapOldestCreatedTime = true; + result.bootstrapOldestCreatedTime_ = value; + return this; + } + public Builder ClearBootstrapOldestCreatedTime() { + PrepareBuilder(); + result.hasBootstrapOldestCreatedTime = false; + result.bootstrapOldestCreatedTime_ = 0UL; + return this; + } + } + static SubscribeOrderBookStatusChangeRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class UnsubscribeOrderBookStatusChangeRequest : pb::GeneratedMessage { + private UnsubscribeOrderBookStatusChangeRequest() { } + private static readonly UnsubscribeOrderBookStatusChangeRequest defaultInstance = new UnsubscribeOrderBookStatusChangeRequest().MakeReadOnly(); + private static readonly string[] _unsubscribeOrderBookStatusChangeRequestFieldNames = new string[] { }; + private static readonly uint[] _unsubscribeOrderBookStatusChangeRequestFieldTags = new uint[] { }; + public static UnsubscribeOrderBookStatusChangeRequest DefaultInstance { + get { return defaultInstance; } + } + + public override UnsubscribeOrderBookStatusChangeRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override UnsubscribeOrderBookStatusChangeRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_UnsubscribeOrderBookStatusChangeRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_UnsubscribeOrderBookStatusChangeRequest__FieldAccessorTable; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _unsubscribeOrderBookStatusChangeRequestFieldNames; + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static UnsubscribeOrderBookStatusChangeRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UnsubscribeOrderBookStatusChangeRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UnsubscribeOrderBookStatusChangeRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UnsubscribeOrderBookStatusChangeRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UnsubscribeOrderBookStatusChangeRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UnsubscribeOrderBookStatusChangeRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static UnsubscribeOrderBookStatusChangeRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static UnsubscribeOrderBookStatusChangeRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static UnsubscribeOrderBookStatusChangeRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UnsubscribeOrderBookStatusChangeRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private UnsubscribeOrderBookStatusChangeRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(UnsubscribeOrderBookStatusChangeRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(UnsubscribeOrderBookStatusChangeRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private UnsubscribeOrderBookStatusChangeRequest result; + + private UnsubscribeOrderBookStatusChangeRequest PrepareBuilder() { + if (resultIsReadOnly) { + UnsubscribeOrderBookStatusChangeRequest original = result; + result = new UnsubscribeOrderBookStatusChangeRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override UnsubscribeOrderBookStatusChangeRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.UnsubscribeOrderBookStatusChangeRequest.Descriptor; } + } + + public override UnsubscribeOrderBookStatusChangeRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.UnsubscribeOrderBookStatusChangeRequest.DefaultInstance; } + } + + public override UnsubscribeOrderBookStatusChangeRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is UnsubscribeOrderBookStatusChangeRequest) { + return MergeFrom((UnsubscribeOrderBookStatusChangeRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(UnsubscribeOrderBookStatusChangeRequest other) { + if (other == global::bnet.protocol.exchange.UnsubscribeOrderBookStatusChangeRequest.DefaultInstance) return this; + PrepareBuilder(); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_unsubscribeOrderBookStatusChangeRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _unsubscribeOrderBookStatusChangeRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + } + static UnsubscribeOrderBookStatusChangeRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class SubscribeOrderUpdateRequest : pb::GeneratedMessage { + private SubscribeOrderUpdateRequest() { } + private static readonly SubscribeOrderUpdateRequest defaultInstance = new SubscribeOrderUpdateRequest().MakeReadOnly(); + private static readonly string[] _subscribeOrderUpdateRequestFieldNames = new string[] { "agent_id", "object_id" }; + private static readonly uint[] _subscribeOrderUpdateRequestFieldTags = new uint[] { 10, 16 }; + public static SubscribeOrderUpdateRequest DefaultInstance { + get { return defaultInstance; } + } + + public override SubscribeOrderUpdateRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SubscribeOrderUpdateRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_SubscribeOrderUpdateRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_SubscribeOrderUpdateRequest__FieldAccessorTable; } + } + + public const int AgentIdFieldNumber = 1; + private bool hasAgentId; + private global::bnet.protocol.EntityId agentId_; + public bool HasAgentId { + get { return hasAgentId; } + } + public global::bnet.protocol.EntityId AgentId { + get { return agentId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int ObjectIdFieldNumber = 2; + private bool hasObjectId; + private ulong objectId_; + public bool HasObjectId { + get { return hasObjectId; } + } + public ulong ObjectId { + get { return objectId_; } + } + + public override bool IsInitialized { + get { + if (!hasAgentId) return false; + if (!hasObjectId) return false; + if (!AgentId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _subscribeOrderUpdateRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); + } + if (hasObjectId) { + output.WriteUInt64(2, field_names[1], ObjectId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAgentId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); + } + if (hasObjectId) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, ObjectId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static SubscribeOrderUpdateRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SubscribeOrderUpdateRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SubscribeOrderUpdateRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SubscribeOrderUpdateRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SubscribeOrderUpdateRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SubscribeOrderUpdateRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SubscribeOrderUpdateRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SubscribeOrderUpdateRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SubscribeOrderUpdateRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SubscribeOrderUpdateRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SubscribeOrderUpdateRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SubscribeOrderUpdateRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SubscribeOrderUpdateRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SubscribeOrderUpdateRequest result; + + private SubscribeOrderUpdateRequest PrepareBuilder() { + if (resultIsReadOnly) { + SubscribeOrderUpdateRequest original = result; + result = new SubscribeOrderUpdateRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SubscribeOrderUpdateRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.SubscribeOrderUpdateRequest.Descriptor; } + } + + public override SubscribeOrderUpdateRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.SubscribeOrderUpdateRequest.DefaultInstance; } + } + + public override SubscribeOrderUpdateRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SubscribeOrderUpdateRequest) { + return MergeFrom((SubscribeOrderUpdateRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SubscribeOrderUpdateRequest other) { + if (other == global::bnet.protocol.exchange.SubscribeOrderUpdateRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAgentId) { + MergeAgentId(other.AgentId); + } + if (other.HasObjectId) { + ObjectId = other.ObjectId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_subscribeOrderUpdateRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _subscribeOrderUpdateRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasAgentId) { + subBuilder.MergeFrom(AgentId); + } + input.ReadMessage(subBuilder, extensionRegistry); + AgentId = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasObjectId = input.ReadUInt64(ref result.objectId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAgentId { + get { return result.hasAgentId; } + } + public global::bnet.protocol.EntityId AgentId { + get { return result.AgentId; } + set { SetAgentId(value); } + } + public Builder SetAgentId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAgentId = true; + result.agentId_ = value; + return this; + } + public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAgentId = true; + result.agentId_ = builderForValue.Build(); + return this; + } + public Builder MergeAgentId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAgentId && + result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); + } else { + result.agentId_ = value; + } + result.hasAgentId = true; + return this; + } + public Builder ClearAgentId() { + PrepareBuilder(); + result.hasAgentId = false; + result.agentId_ = null; + return this; + } + + public bool HasObjectId { + get { return result.hasObjectId; } + } + public ulong ObjectId { + get { return result.ObjectId; } + set { SetObjectId(value); } + } + public Builder SetObjectId(ulong value) { + PrepareBuilder(); + result.hasObjectId = true; + result.objectId_ = value; + return this; + } + public Builder ClearObjectId() { + PrepareBuilder(); + result.hasObjectId = false; + result.objectId_ = 0UL; + return this; + } + } + static SubscribeOrderUpdateRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class UnsubscribeOrderUpdateRequest : pb::GeneratedMessage { + private UnsubscribeOrderUpdateRequest() { } + private static readonly UnsubscribeOrderUpdateRequest defaultInstance = new UnsubscribeOrderUpdateRequest().MakeReadOnly(); + private static readonly string[] _unsubscribeOrderUpdateRequestFieldNames = new string[] { "agent_id", "object_id" }; + private static readonly uint[] _unsubscribeOrderUpdateRequestFieldTags = new uint[] { 10, 16 }; + public static UnsubscribeOrderUpdateRequest DefaultInstance { + get { return defaultInstance; } + } + + public override UnsubscribeOrderUpdateRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override UnsubscribeOrderUpdateRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_UnsubscribeOrderUpdateRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_UnsubscribeOrderUpdateRequest__FieldAccessorTable; } + } + + public const int AgentIdFieldNumber = 1; + private bool hasAgentId; + private global::bnet.protocol.EntityId agentId_; + public bool HasAgentId { + get { return hasAgentId; } + } + public global::bnet.protocol.EntityId AgentId { + get { return agentId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int ObjectIdFieldNumber = 2; + private bool hasObjectId; + private ulong objectId_; + public bool HasObjectId { + get { return hasObjectId; } + } + public ulong ObjectId { + get { return objectId_; } + } + + public override bool IsInitialized { + get { + if (!hasAgentId) return false; + if (!hasObjectId) return false; + if (!AgentId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _unsubscribeOrderUpdateRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); + } + if (hasObjectId) { + output.WriteUInt64(2, field_names[1], ObjectId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAgentId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); + } + if (hasObjectId) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, ObjectId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static UnsubscribeOrderUpdateRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UnsubscribeOrderUpdateRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UnsubscribeOrderUpdateRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UnsubscribeOrderUpdateRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UnsubscribeOrderUpdateRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UnsubscribeOrderUpdateRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static UnsubscribeOrderUpdateRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static UnsubscribeOrderUpdateRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static UnsubscribeOrderUpdateRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UnsubscribeOrderUpdateRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private UnsubscribeOrderUpdateRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(UnsubscribeOrderUpdateRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(UnsubscribeOrderUpdateRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private UnsubscribeOrderUpdateRequest result; + + private UnsubscribeOrderUpdateRequest PrepareBuilder() { + if (resultIsReadOnly) { + UnsubscribeOrderUpdateRequest original = result; + result = new UnsubscribeOrderUpdateRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override UnsubscribeOrderUpdateRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.UnsubscribeOrderUpdateRequest.Descriptor; } + } + + public override UnsubscribeOrderUpdateRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.UnsubscribeOrderUpdateRequest.DefaultInstance; } + } + + public override UnsubscribeOrderUpdateRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is UnsubscribeOrderUpdateRequest) { + return MergeFrom((UnsubscribeOrderUpdateRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(UnsubscribeOrderUpdateRequest other) { + if (other == global::bnet.protocol.exchange.UnsubscribeOrderUpdateRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAgentId) { + MergeAgentId(other.AgentId); + } + if (other.HasObjectId) { + ObjectId = other.ObjectId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_unsubscribeOrderUpdateRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _unsubscribeOrderUpdateRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasAgentId) { + subBuilder.MergeFrom(AgentId); + } + input.ReadMessage(subBuilder, extensionRegistry); + AgentId = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasObjectId = input.ReadUInt64(ref result.objectId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAgentId { + get { return result.hasAgentId; } + } + public global::bnet.protocol.EntityId AgentId { + get { return result.AgentId; } + set { SetAgentId(value); } + } + public Builder SetAgentId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAgentId = true; + result.agentId_ = value; + return this; + } + public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAgentId = true; + result.agentId_ = builderForValue.Build(); + return this; + } + public Builder MergeAgentId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAgentId && + result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); + } else { + result.agentId_ = value; + } + result.hasAgentId = true; + return this; + } + public Builder ClearAgentId() { + PrepareBuilder(); + result.hasAgentId = false; + result.agentId_ = null; + return this; + } + + public bool HasObjectId { + get { return result.hasObjectId; } + } + public ulong ObjectId { + get { return result.ObjectId; } + set { SetObjectId(value); } + } + public Builder SetObjectId(ulong value) { + PrepareBuilder(); + result.hasObjectId = true; + result.objectId_ = value; + return this; + } + public Builder ClearObjectId() { + PrepareBuilder(); + result.hasObjectId = false; + result.objectId_ = 0UL; + return this; + } + } + static UnsubscribeOrderUpdateRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class SubscribeAdvancedOrderUpdateRequest : pb::GeneratedMessage { + private SubscribeAdvancedOrderUpdateRequest() { } + private static readonly SubscribeAdvancedOrderUpdateRequest defaultInstance = new SubscribeAdvancedOrderUpdateRequest().MakeReadOnly(); + private static readonly string[] _subscribeAdvancedOrderUpdateRequestFieldNames = new string[] { "filters", "max_partition_id", "min_partition_id", "object_id" }; + private static readonly uint[] _subscribeAdvancedOrderUpdateRequestFieldTags = new uint[] { 34, 26, 18, 8 }; + public static SubscribeAdvancedOrderUpdateRequest DefaultInstance { + get { return defaultInstance; } + } + + public override SubscribeAdvancedOrderUpdateRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SubscribeAdvancedOrderUpdateRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_SubscribeAdvancedOrderUpdateRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_SubscribeAdvancedOrderUpdateRequest__FieldAccessorTable; } + } + + public const int ObjectIdFieldNumber = 1; + private bool hasObjectId; + private ulong objectId_; + public bool HasObjectId { + get { return hasObjectId; } + } + public ulong ObjectId { + get { return objectId_; } + } + + public const int MinPartitionIdFieldNumber = 2; + private bool hasMinPartitionId; + private global::bnet.protocol.exchange.PartitionId minPartitionId_; + public bool HasMinPartitionId { + get { return hasMinPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId MinPartitionId { + get { return minPartitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int MaxPartitionIdFieldNumber = 3; + private bool hasMaxPartitionId; + private global::bnet.protocol.exchange.PartitionId maxPartitionId_; + public bool HasMaxPartitionId { + get { return hasMaxPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId MaxPartitionId { + get { return maxPartitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int FiltersFieldNumber = 4; + private pbc::PopsicleList filters_ = new pbc::PopsicleList(); + public scg::IList FiltersList { + get { return filters_; } + } + public int FiltersCount { + get { return filters_.Count; } + } + public global::bnet.protocol.exchange.AdvancedSubscription GetFilters(int index) { + return filters_[index]; + } + + public override bool IsInitialized { + get { + if (!hasObjectId) return false; + if (!hasMinPartitionId) return false; + if (!hasMaxPartitionId) return false; + if (!MinPartitionId.IsInitialized) return false; + if (!MaxPartitionId.IsInitialized) return false; + foreach (global::bnet.protocol.exchange.AdvancedSubscription element in FiltersList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _subscribeAdvancedOrderUpdateRequestFieldNames; + if (hasObjectId) { + output.WriteUInt64(1, field_names[3], ObjectId); + } + if (hasMinPartitionId) { + output.WriteMessage(2, field_names[2], MinPartitionId); + } + if (hasMaxPartitionId) { + output.WriteMessage(3, field_names[1], MaxPartitionId); + } + if (filters_.Count > 0) { + output.WriteMessageArray(4, field_names[0], filters_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasObjectId) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, ObjectId); + } + if (hasMinPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, MinPartitionId); + } + if (hasMaxPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(3, MaxPartitionId); + } + foreach (global::bnet.protocol.exchange.AdvancedSubscription element in FiltersList) { + size += pb::CodedOutputStream.ComputeMessageSize(4, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static SubscribeAdvancedOrderUpdateRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SubscribeAdvancedOrderUpdateRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SubscribeAdvancedOrderUpdateRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SubscribeAdvancedOrderUpdateRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SubscribeAdvancedOrderUpdateRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SubscribeAdvancedOrderUpdateRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SubscribeAdvancedOrderUpdateRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SubscribeAdvancedOrderUpdateRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SubscribeAdvancedOrderUpdateRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SubscribeAdvancedOrderUpdateRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SubscribeAdvancedOrderUpdateRequest MakeReadOnly() { + filters_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SubscribeAdvancedOrderUpdateRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SubscribeAdvancedOrderUpdateRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SubscribeAdvancedOrderUpdateRequest result; + + private SubscribeAdvancedOrderUpdateRequest PrepareBuilder() { + if (resultIsReadOnly) { + SubscribeAdvancedOrderUpdateRequest original = result; + result = new SubscribeAdvancedOrderUpdateRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SubscribeAdvancedOrderUpdateRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.SubscribeAdvancedOrderUpdateRequest.Descriptor; } + } + + public override SubscribeAdvancedOrderUpdateRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.SubscribeAdvancedOrderUpdateRequest.DefaultInstance; } + } + + public override SubscribeAdvancedOrderUpdateRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SubscribeAdvancedOrderUpdateRequest) { + return MergeFrom((SubscribeAdvancedOrderUpdateRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SubscribeAdvancedOrderUpdateRequest other) { + if (other == global::bnet.protocol.exchange.SubscribeAdvancedOrderUpdateRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasObjectId) { + ObjectId = other.ObjectId; + } + if (other.HasMinPartitionId) { + MergeMinPartitionId(other.MinPartitionId); + } + if (other.HasMaxPartitionId) { + MergeMaxPartitionId(other.MaxPartitionId); + } + if (other.filters_.Count != 0) { + result.filters_.Add(other.filters_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_subscribeAdvancedOrderUpdateRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _subscribeAdvancedOrderUpdateRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasObjectId = input.ReadUInt64(ref result.objectId_); + break; + } + case 18: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasMinPartitionId) { + subBuilder.MergeFrom(MinPartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + MinPartitionId = subBuilder.BuildPartial(); + break; + } + case 26: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasMaxPartitionId) { + subBuilder.MergeFrom(MaxPartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + MaxPartitionId = subBuilder.BuildPartial(); + break; + } + case 34: { + input.ReadMessageArray(tag, field_name, result.filters_, global::bnet.protocol.exchange.AdvancedSubscription.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasObjectId { + get { return result.hasObjectId; } + } + public ulong ObjectId { + get { return result.ObjectId; } + set { SetObjectId(value); } + } + public Builder SetObjectId(ulong value) { + PrepareBuilder(); + result.hasObjectId = true; + result.objectId_ = value; + return this; + } + public Builder ClearObjectId() { + PrepareBuilder(); + result.hasObjectId = false; + result.objectId_ = 0UL; + return this; + } + + public bool HasMinPartitionId { + get { return result.hasMinPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId MinPartitionId { + get { return result.MinPartitionId; } + set { SetMinPartitionId(value); } + } + public Builder SetMinPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasMinPartitionId = true; + result.minPartitionId_ = value; + return this; + } + public Builder SetMinPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasMinPartitionId = true; + result.minPartitionId_ = builderForValue.Build(); + return this; + } + public Builder MergeMinPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasMinPartitionId && + result.minPartitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.minPartitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.minPartitionId_).MergeFrom(value).BuildPartial(); + } else { + result.minPartitionId_ = value; + } + result.hasMinPartitionId = true; + return this; + } + public Builder ClearMinPartitionId() { + PrepareBuilder(); + result.hasMinPartitionId = false; + result.minPartitionId_ = null; + return this; + } + + public bool HasMaxPartitionId { + get { return result.hasMaxPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId MaxPartitionId { + get { return result.MaxPartitionId; } + set { SetMaxPartitionId(value); } + } + public Builder SetMaxPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasMaxPartitionId = true; + result.maxPartitionId_ = value; + return this; + } + public Builder SetMaxPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasMaxPartitionId = true; + result.maxPartitionId_ = builderForValue.Build(); + return this; + } + public Builder MergeMaxPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasMaxPartitionId && + result.maxPartitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.maxPartitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.maxPartitionId_).MergeFrom(value).BuildPartial(); + } else { + result.maxPartitionId_ = value; + } + result.hasMaxPartitionId = true; + return this; + } + public Builder ClearMaxPartitionId() { + PrepareBuilder(); + result.hasMaxPartitionId = false; + result.maxPartitionId_ = null; + return this; + } + + public pbc::IPopsicleList FiltersList { + get { return PrepareBuilder().filters_; } + } + public int FiltersCount { + get { return result.FiltersCount; } + } + public global::bnet.protocol.exchange.AdvancedSubscription GetFilters(int index) { + return result.GetFilters(index); + } + public Builder SetFilters(int index, global::bnet.protocol.exchange.AdvancedSubscription value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.filters_[index] = value; + return this; + } + public Builder SetFilters(int index, global::bnet.protocol.exchange.AdvancedSubscription.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.filters_[index] = builderForValue.Build(); + return this; + } + public Builder AddFilters(global::bnet.protocol.exchange.AdvancedSubscription value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.filters_.Add(value); + return this; + } + public Builder AddFilters(global::bnet.protocol.exchange.AdvancedSubscription.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.filters_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeFilters(scg::IEnumerable values) { + PrepareBuilder(); + result.filters_.Add(values); + return this; + } + public Builder ClearFilters() { + PrepareBuilder(); + result.filters_.Clear(); + return this; + } + } + static SubscribeAdvancedOrderUpdateRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class UnsubscribeAdvancedOrderUpdateRequest : pb::GeneratedMessage { + private UnsubscribeAdvancedOrderUpdateRequest() { } + private static readonly UnsubscribeAdvancedOrderUpdateRequest defaultInstance = new UnsubscribeAdvancedOrderUpdateRequest().MakeReadOnly(); + private static readonly string[] _unsubscribeAdvancedOrderUpdateRequestFieldNames = new string[] { }; + private static readonly uint[] _unsubscribeAdvancedOrderUpdateRequestFieldTags = new uint[] { }; + public static UnsubscribeAdvancedOrderUpdateRequest DefaultInstance { + get { return defaultInstance; } + } + + public override UnsubscribeAdvancedOrderUpdateRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override UnsubscribeAdvancedOrderUpdateRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_UnsubscribeAdvancedOrderUpdateRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_UnsubscribeAdvancedOrderUpdateRequest__FieldAccessorTable; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _unsubscribeAdvancedOrderUpdateRequestFieldNames; + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static UnsubscribeAdvancedOrderUpdateRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UnsubscribeAdvancedOrderUpdateRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UnsubscribeAdvancedOrderUpdateRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UnsubscribeAdvancedOrderUpdateRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UnsubscribeAdvancedOrderUpdateRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UnsubscribeAdvancedOrderUpdateRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static UnsubscribeAdvancedOrderUpdateRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static UnsubscribeAdvancedOrderUpdateRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static UnsubscribeAdvancedOrderUpdateRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UnsubscribeAdvancedOrderUpdateRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private UnsubscribeAdvancedOrderUpdateRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(UnsubscribeAdvancedOrderUpdateRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(UnsubscribeAdvancedOrderUpdateRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private UnsubscribeAdvancedOrderUpdateRequest result; + + private UnsubscribeAdvancedOrderUpdateRequest PrepareBuilder() { + if (resultIsReadOnly) { + UnsubscribeAdvancedOrderUpdateRequest original = result; + result = new UnsubscribeAdvancedOrderUpdateRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override UnsubscribeAdvancedOrderUpdateRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.UnsubscribeAdvancedOrderUpdateRequest.Descriptor; } + } + + public override UnsubscribeAdvancedOrderUpdateRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.UnsubscribeAdvancedOrderUpdateRequest.DefaultInstance; } + } + + public override UnsubscribeAdvancedOrderUpdateRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is UnsubscribeAdvancedOrderUpdateRequest) { + return MergeFrom((UnsubscribeAdvancedOrderUpdateRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(UnsubscribeAdvancedOrderUpdateRequest other) { + if (other == global::bnet.protocol.exchange.UnsubscribeAdvancedOrderUpdateRequest.DefaultInstance) return this; + PrepareBuilder(); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_unsubscribeAdvancedOrderUpdateRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _unsubscribeAdvancedOrderUpdateRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + } + static UnsubscribeAdvancedOrderUpdateRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ClaimRequest : pb::GeneratedMessage { + private ClaimRequest() { } + private static readonly ClaimRequest defaultInstance = new ClaimRequest().MakeReadOnly(); + private static readonly string[] _claimRequestFieldNames = new string[] { "bnet_account", "information", "order_id", "partition_id", "program" }; + private static readonly uint[] _claimRequestFieldTags = new uint[] { 34, 42, 16, 10, 29 }; + public static ClaimRequest DefaultInstance { + get { return defaultInstance; } + } + + public override ClaimRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ClaimRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_ClaimRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_ClaimRequest__FieldAccessorTable; } + } + + public const int PartitionIdFieldNumber = 1; + private bool hasPartitionId; + private global::bnet.protocol.exchange.PartitionId partitionId_; + public bool HasPartitionId { + get { return hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int OrderIdFieldNumber = 2; + private bool hasOrderId; + private ulong orderId_; + public bool HasOrderId { + get { return hasOrderId; } + } + public ulong OrderId { + get { return orderId_; } + } + + public const int ProgramFieldNumber = 3; + private bool hasProgram; + private uint program_; + public bool HasProgram { + get { return hasProgram; } + } + public uint Program { + get { return program_; } + } + + public const int BnetAccountFieldNumber = 4; + private bool hasBnetAccount; + private global::bnet.protocol.EntityId bnetAccount_; + public bool HasBnetAccount { + get { return hasBnetAccount; } + } + public global::bnet.protocol.EntityId BnetAccount { + get { return bnetAccount_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int InformationFieldNumber = 5; + private bool hasInformation; + private global::bnet.protocol.exchange.BlobFrom information_; + public bool HasInformation { + get { return hasInformation; } + } + public global::bnet.protocol.exchange.BlobFrom Information { + get { return information_ ?? global::bnet.protocol.exchange.BlobFrom.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (HasPartitionId) { + if (!PartitionId.IsInitialized) return false; + } + if (HasBnetAccount) { + if (!BnetAccount.IsInitialized) return false; + } + if (HasInformation) { + if (!Information.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _claimRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[3], PartitionId); + } + if (hasOrderId) { + output.WriteUInt64(2, field_names[2], OrderId); + } + if (hasProgram) { + output.WriteFixed32(3, field_names[4], Program); + } + if (hasBnetAccount) { + output.WriteMessage(4, field_names[0], BnetAccount); + } + if (hasInformation) { + output.WriteMessage(5, field_names[1], Information); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); + } + if (hasOrderId) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, OrderId); + } + if (hasProgram) { + size += pb::CodedOutputStream.ComputeFixed32Size(3, Program); + } + if (hasBnetAccount) { + size += pb::CodedOutputStream.ComputeMessageSize(4, BnetAccount); + } + if (hasInformation) { + size += pb::CodedOutputStream.ComputeMessageSize(5, Information); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ClaimRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ClaimRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ClaimRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ClaimRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ClaimRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ClaimRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ClaimRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ClaimRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ClaimRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ClaimRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ClaimRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ClaimRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ClaimRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ClaimRequest result; + + private ClaimRequest PrepareBuilder() { + if (resultIsReadOnly) { + ClaimRequest original = result; + result = new ClaimRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ClaimRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.ClaimRequest.Descriptor; } + } + + public override ClaimRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.ClaimRequest.DefaultInstance; } + } + + public override ClaimRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ClaimRequest) { + return MergeFrom((ClaimRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ClaimRequest other) { + if (other == global::bnet.protocol.exchange.ClaimRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasPartitionId) { + MergePartitionId(other.PartitionId); + } + if (other.HasOrderId) { + OrderId = other.OrderId; + } + if (other.HasProgram) { + Program = other.Program; + } + if (other.HasBnetAccount) { + MergeBnetAccount(other.BnetAccount); + } + if (other.HasInformation) { + MergeInformation(other.Information); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_claimRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _claimRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasPartitionId) { + subBuilder.MergeFrom(PartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + PartitionId = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasOrderId = input.ReadUInt64(ref result.orderId_); + break; + } + case 29: { + result.hasProgram = input.ReadFixed32(ref result.program_); + break; + } + case 34: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasBnetAccount) { + subBuilder.MergeFrom(BnetAccount); + } + input.ReadMessage(subBuilder, extensionRegistry); + BnetAccount = subBuilder.BuildPartial(); + break; + } + case 42: { + global::bnet.protocol.exchange.BlobFrom.Builder subBuilder = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(); + if (result.hasInformation) { + subBuilder.MergeFrom(Information); + } + input.ReadMessage(subBuilder, extensionRegistry); + Information = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasPartitionId { + get { return result.hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = value; + return this; + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = builderForValue.Build(); + return this; + } + public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasPartitionId && + result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); + } else { + result.partitionId_ = value; + } + result.hasPartitionId = true; + return this; + } + public Builder ClearPartitionId() { + PrepareBuilder(); + result.hasPartitionId = false; + result.partitionId_ = null; + return this; + } + + public bool HasOrderId { + get { return result.hasOrderId; } + } + public ulong OrderId { + get { return result.OrderId; } + set { SetOrderId(value); } + } + public Builder SetOrderId(ulong value) { + PrepareBuilder(); + result.hasOrderId = true; + result.orderId_ = value; + return this; + } + public Builder ClearOrderId() { + PrepareBuilder(); + result.hasOrderId = false; + result.orderId_ = 0UL; + return this; + } + + public bool HasProgram { + get { return result.hasProgram; } + } + public uint Program { + get { return result.Program; } + set { SetProgram(value); } + } + public Builder SetProgram(uint value) { + PrepareBuilder(); + result.hasProgram = true; + result.program_ = value; + return this; + } + public Builder ClearProgram() { + PrepareBuilder(); + result.hasProgram = false; + result.program_ = 0; + return this; + } + + public bool HasBnetAccount { + get { return result.hasBnetAccount; } + } + public global::bnet.protocol.EntityId BnetAccount { + get { return result.BnetAccount; } + set { SetBnetAccount(value); } + } + public Builder SetBnetAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBnetAccount = true; + result.bnetAccount_ = value; + return this; + } + public Builder SetBnetAccount(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBnetAccount = true; + result.bnetAccount_ = builderForValue.Build(); + return this; + } + public Builder MergeBnetAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBnetAccount && + result.bnetAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.bnetAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccount_).MergeFrom(value).BuildPartial(); + } else { + result.bnetAccount_ = value; + } + result.hasBnetAccount = true; + return this; + } + public Builder ClearBnetAccount() { + PrepareBuilder(); + result.hasBnetAccount = false; + result.bnetAccount_ = null; + return this; + } + + public bool HasInformation { + get { return result.hasInformation; } + } + public global::bnet.protocol.exchange.BlobFrom Information { + get { return result.Information; } + set { SetInformation(value); } + } + public Builder SetInformation(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasInformation = true; + result.information_ = value; + return this; + } + public Builder SetInformation(global::bnet.protocol.exchange.BlobFrom.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasInformation = true; + result.information_ = builderForValue.Build(); + return this; + } + public Builder MergeInformation(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasInformation && + result.information_ != global::bnet.protocol.exchange.BlobFrom.DefaultInstance) { + result.information_ = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(result.information_).MergeFrom(value).BuildPartial(); + } else { + result.information_ = value; + } + result.hasInformation = true; + return this; + } + public Builder ClearInformation() { + PrepareBuilder(); + result.hasInformation = false; + result.information_ = null; + return this; + } + } + static ClaimRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class CancelRequest : pb::GeneratedMessage { + private CancelRequest() { } + private static readonly CancelRequest defaultInstance = new CancelRequest().MakeReadOnly(); + private static readonly string[] _cancelRequestFieldNames = new string[] { "bnet_account", "order_id", "partition_id", "reason" }; + private static readonly uint[] _cancelRequestFieldTags = new uint[] { 34, 16, 10, 24 }; + public static CancelRequest DefaultInstance { + get { return defaultInstance; } + } + + public override CancelRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override CancelRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_CancelRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_CancelRequest__FieldAccessorTable; } + } + + public const int PartitionIdFieldNumber = 1; + private bool hasPartitionId; + private global::bnet.protocol.exchange.PartitionId partitionId_; + public bool HasPartitionId { + get { return hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int OrderIdFieldNumber = 2; + private bool hasOrderId; + private ulong orderId_; + public bool HasOrderId { + get { return hasOrderId; } + } + public ulong OrderId { + get { return orderId_; } + } + + public const int ReasonFieldNumber = 3; + private bool hasReason; + private uint reason_; + public bool HasReason { + get { return hasReason; } + } + public uint Reason { + get { return reason_; } + } + + public const int BnetAccountFieldNumber = 4; + private bool hasBnetAccount; + private global::bnet.protocol.EntityId bnetAccount_; + public bool HasBnetAccount { + get { return hasBnetAccount; } + } + public global::bnet.protocol.EntityId BnetAccount { + get { return bnetAccount_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasPartitionId) return false; + if (!hasOrderId) return false; + if (!PartitionId.IsInitialized) return false; + if (HasBnetAccount) { + if (!BnetAccount.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _cancelRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[2], PartitionId); + } + if (hasOrderId) { + output.WriteUInt64(2, field_names[1], OrderId); + } + if (hasReason) { + output.WriteUInt32(3, field_names[3], Reason); + } + if (hasBnetAccount) { + output.WriteMessage(4, field_names[0], BnetAccount); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); + } + if (hasOrderId) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, OrderId); + } + if (hasReason) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, Reason); + } + if (hasBnetAccount) { + size += pb::CodedOutputStream.ComputeMessageSize(4, BnetAccount); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static CancelRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CancelRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CancelRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CancelRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CancelRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CancelRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static CancelRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static CancelRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static CancelRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CancelRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CancelRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(CancelRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CancelRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CancelRequest result; + + private CancelRequest PrepareBuilder() { + if (resultIsReadOnly) { + CancelRequest original = result; + result = new CancelRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CancelRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.CancelRequest.Descriptor; } + } + + public override CancelRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.CancelRequest.DefaultInstance; } + } + + public override CancelRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is CancelRequest) { + return MergeFrom((CancelRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(CancelRequest other) { + if (other == global::bnet.protocol.exchange.CancelRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasPartitionId) { + MergePartitionId(other.PartitionId); + } + if (other.HasOrderId) { + OrderId = other.OrderId; + } + if (other.HasReason) { + Reason = other.Reason; + } + if (other.HasBnetAccount) { + MergeBnetAccount(other.BnetAccount); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_cancelRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _cancelRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasPartitionId) { + subBuilder.MergeFrom(PartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + PartitionId = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasOrderId = input.ReadUInt64(ref result.orderId_); + break; + } + case 24: { + result.hasReason = input.ReadUInt32(ref result.reason_); + break; + } + case 34: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasBnetAccount) { + subBuilder.MergeFrom(BnetAccount); + } + input.ReadMessage(subBuilder, extensionRegistry); + BnetAccount = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasPartitionId { + get { return result.hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = value; + return this; + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = builderForValue.Build(); + return this; + } + public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasPartitionId && + result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); + } else { + result.partitionId_ = value; + } + result.hasPartitionId = true; + return this; + } + public Builder ClearPartitionId() { + PrepareBuilder(); + result.hasPartitionId = false; + result.partitionId_ = null; + return this; + } + + public bool HasOrderId { + get { return result.hasOrderId; } + } + public ulong OrderId { + get { return result.OrderId; } + set { SetOrderId(value); } + } + public Builder SetOrderId(ulong value) { + PrepareBuilder(); + result.hasOrderId = true; + result.orderId_ = value; + return this; + } + public Builder ClearOrderId() { + PrepareBuilder(); + result.hasOrderId = false; + result.orderId_ = 0UL; + return this; + } + + public bool HasReason { + get { return result.hasReason; } + } + public uint Reason { + get { return result.Reason; } + set { SetReason(value); } + } + public Builder SetReason(uint value) { + PrepareBuilder(); + result.hasReason = true; + result.reason_ = value; + return this; + } + public Builder ClearReason() { + PrepareBuilder(); + result.hasReason = false; + result.reason_ = 0; + return this; + } + + public bool HasBnetAccount { + get { return result.hasBnetAccount; } + } + public global::bnet.protocol.EntityId BnetAccount { + get { return result.BnetAccount; } + set { SetBnetAccount(value); } + } + public Builder SetBnetAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBnetAccount = true; + result.bnetAccount_ = value; + return this; + } + public Builder SetBnetAccount(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBnetAccount = true; + result.bnetAccount_ = builderForValue.Build(); + return this; + } + public Builder MergeBnetAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBnetAccount && + result.bnetAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.bnetAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccount_).MergeFrom(value).BuildPartial(); + } else { + result.bnetAccount_ = value; + } + result.hasBnetAccount = true; + return this; + } + public Builder ClearBnetAccount() { + PrepareBuilder(); + result.hasBnetAccount = false; + result.bnetAccount_ = null; + return this; + } + } + static CancelRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class RefundRequest : pb::GeneratedMessage { + private RefundRequest() { } + private static readonly RefundRequest defaultInstance = new RefundRequest().MakeReadOnly(); + private static readonly string[] _refundRequestFieldNames = new string[] { "cs_notes", "cs_user_id", "order_id", "partition_id" }; + private static readonly uint[] _refundRequestFieldTags = new uint[] { 26, 32, 16, 10 }; + public static RefundRequest DefaultInstance { + get { return defaultInstance; } + } + + public override RefundRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override RefundRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_RefundRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_RefundRequest__FieldAccessorTable; } + } + + public const int PartitionIdFieldNumber = 1; + private bool hasPartitionId; + private global::bnet.protocol.exchange.PartitionId partitionId_; + public bool HasPartitionId { + get { return hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int OrderIdFieldNumber = 2; + private bool hasOrderId; + private ulong orderId_; + public bool HasOrderId { + get { return hasOrderId; } + } + public ulong OrderId { + get { return orderId_; } + } + + public const int CsNotesFieldNumber = 3; + private bool hasCsNotes; + private string csNotes_ = ""; + public bool HasCsNotes { + get { return hasCsNotes; } + } + public string CsNotes { + get { return csNotes_; } + } + + public const int CsUserIdFieldNumber = 4; + private bool hasCsUserId; + private ulong csUserId_; + public bool HasCsUserId { + get { return hasCsUserId; } + } + public ulong CsUserId { + get { return csUserId_; } + } + + public override bool IsInitialized { + get { + if (!hasPartitionId) return false; + if (!hasOrderId) return false; + if (!hasCsNotes) return false; + if (!hasCsUserId) return false; + if (!PartitionId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _refundRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[3], PartitionId); + } + if (hasOrderId) { + output.WriteUInt64(2, field_names[2], OrderId); + } + if (hasCsNotes) { + output.WriteString(3, field_names[0], CsNotes); + } + if (hasCsUserId) { + output.WriteUInt64(4, field_names[1], CsUserId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); + } + if (hasOrderId) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, OrderId); + } + if (hasCsNotes) { + size += pb::CodedOutputStream.ComputeStringSize(3, CsNotes); + } + if (hasCsUserId) { + size += pb::CodedOutputStream.ComputeUInt64Size(4, CsUserId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static RefundRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RefundRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RefundRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RefundRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RefundRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RefundRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static RefundRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static RefundRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static RefundRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RefundRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private RefundRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(RefundRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(RefundRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private RefundRequest result; + + private RefundRequest PrepareBuilder() { + if (resultIsReadOnly) { + RefundRequest original = result; + result = new RefundRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override RefundRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.RefundRequest.Descriptor; } + } + + public override RefundRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.RefundRequest.DefaultInstance; } + } + + public override RefundRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is RefundRequest) { + return MergeFrom((RefundRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(RefundRequest other) { + if (other == global::bnet.protocol.exchange.RefundRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasPartitionId) { + MergePartitionId(other.PartitionId); + } + if (other.HasOrderId) { + OrderId = other.OrderId; + } + if (other.HasCsNotes) { + CsNotes = other.CsNotes; + } + if (other.HasCsUserId) { + CsUserId = other.CsUserId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_refundRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _refundRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasPartitionId) { + subBuilder.MergeFrom(PartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + PartitionId = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasOrderId = input.ReadUInt64(ref result.orderId_); + break; + } + case 26: { + result.hasCsNotes = input.ReadString(ref result.csNotes_); + break; + } + case 32: { + result.hasCsUserId = input.ReadUInt64(ref result.csUserId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasPartitionId { + get { return result.hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = value; + return this; + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = builderForValue.Build(); + return this; + } + public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasPartitionId && + result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); + } else { + result.partitionId_ = value; + } + result.hasPartitionId = true; + return this; + } + public Builder ClearPartitionId() { + PrepareBuilder(); + result.hasPartitionId = false; + result.partitionId_ = null; + return this; + } + + public bool HasOrderId { + get { return result.hasOrderId; } + } + public ulong OrderId { + get { return result.OrderId; } + set { SetOrderId(value); } + } + public Builder SetOrderId(ulong value) { + PrepareBuilder(); + result.hasOrderId = true; + result.orderId_ = value; + return this; + } + public Builder ClearOrderId() { + PrepareBuilder(); + result.hasOrderId = false; + result.orderId_ = 0UL; + return this; + } + + public bool HasCsNotes { + get { return result.hasCsNotes; } + } + public string CsNotes { + get { return result.CsNotes; } + set { SetCsNotes(value); } + } + public Builder SetCsNotes(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasCsNotes = true; + result.csNotes_ = value; + return this; + } + public Builder ClearCsNotes() { + PrepareBuilder(); + result.hasCsNotes = false; + result.csNotes_ = ""; + return this; + } + + public bool HasCsUserId { + get { return result.hasCsUserId; } + } + public ulong CsUserId { + get { return result.CsUserId; } + set { SetCsUserId(value); } + } + public Builder SetCsUserId(ulong value) { + PrepareBuilder(); + result.hasCsUserId = true; + result.csUserId_ = value; + return this; + } + public Builder ClearCsUserId() { + PrepareBuilder(); + result.hasCsUserId = false; + result.csUserId_ = 0UL; + return this; + } + } + static RefundRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetConfigurationRequest : pb::GeneratedMessage { + private GetConfigurationRequest() { } + private static readonly GetConfigurationRequest defaultInstance = new GetConfigurationRequest().MakeReadOnly(); + private static readonly string[] _getConfigurationRequestFieldNames = new string[] { "program" }; + private static readonly uint[] _getConfigurationRequestFieldTags = new uint[] { 13 }; + public static GetConfigurationRequest DefaultInstance { + get { return defaultInstance; } + } + + public override GetConfigurationRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetConfigurationRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetConfigurationRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetConfigurationRequest__FieldAccessorTable; } + } + + public const int ProgramFieldNumber = 1; + private bool hasProgram; + private uint program_; + public bool HasProgram { + get { return hasProgram; } + } + public uint Program { + get { return program_; } + } + + public override bool IsInitialized { + get { + if (!hasProgram) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getConfigurationRequestFieldNames; + if (hasProgram) { + output.WriteFixed32(1, field_names[0], Program); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasProgram) { + size += pb::CodedOutputStream.ComputeFixed32Size(1, Program); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetConfigurationRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetConfigurationRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetConfigurationRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetConfigurationRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetConfigurationRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetConfigurationRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetConfigurationRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetConfigurationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetConfigurationRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetConfigurationRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetConfigurationRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetConfigurationRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetConfigurationRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetConfigurationRequest result; + + private GetConfigurationRequest PrepareBuilder() { + if (resultIsReadOnly) { + GetConfigurationRequest original = result; + result = new GetConfigurationRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetConfigurationRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.GetConfigurationRequest.Descriptor; } + } + + public override GetConfigurationRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.GetConfigurationRequest.DefaultInstance; } + } + + public override GetConfigurationRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetConfigurationRequest) { + return MergeFrom((GetConfigurationRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetConfigurationRequest other) { + if (other == global::bnet.protocol.exchange.GetConfigurationRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasProgram) { + Program = other.Program; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getConfigurationRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getConfigurationRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 13: { + result.hasProgram = input.ReadFixed32(ref result.program_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasProgram { + get { return result.hasProgram; } + } + public uint Program { + get { return result.Program; } + set { SetProgram(value); } + } + public Builder SetProgram(uint value) { + PrepareBuilder(); + result.hasProgram = true; + result.program_ = value; + return this; + } + public Builder ClearProgram() { + PrepareBuilder(); + result.hasProgram = false; + result.program_ = 0; + return this; + } + } + static GetConfigurationRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetConfigurationResponse : pb::GeneratedMessage { + private GetConfigurationResponse() { } + private static readonly GetConfigurationResponse defaultInstance = new GetConfigurationResponse().MakeReadOnly(); + private static readonly string[] _getConfigurationResponseFieldNames = new string[] { "configs", "recommended_default_rmt_currency", "rmt_restricted_by_license" }; + private static readonly uint[] _getConfigurationResponseFieldTags = new uint[] { 10, 26, 18 }; + public static GetConfigurationResponse DefaultInstance { + get { return defaultInstance; } + } + + public override GetConfigurationResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetConfigurationResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetConfigurationResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetConfigurationResponse__FieldAccessorTable; } + } + + public const int ConfigsFieldNumber = 1; + private pbc::PopsicleList configs_ = new pbc::PopsicleList(); + public scg::IList ConfigsList { + get { return configs_; } + } + public int ConfigsCount { + get { return configs_.Count; } + } + public global::bnet.protocol.exchange.SpecialistConfig GetConfigs(int index) { + return configs_[index]; + } + + public const int RmtRestrictedByLicenseFieldNumber = 2; + private bool hasRmtRestrictedByLicense; + private global::bnet.protocol.account.AccountLicense rmtRestrictedByLicense_; + public bool HasRmtRestrictedByLicense { + get { return hasRmtRestrictedByLicense; } + } + public global::bnet.protocol.account.AccountLicense RmtRestrictedByLicense { + get { return rmtRestrictedByLicense_ ?? global::bnet.protocol.account.AccountLicense.DefaultInstance; } + } + + public const int RecommendedDefaultRmtCurrencyFieldNumber = 3; + private bool hasRecommendedDefaultRmtCurrency; + private string recommendedDefaultRmtCurrency_ = ""; + public bool HasRecommendedDefaultRmtCurrency { + get { return hasRecommendedDefaultRmtCurrency; } + } + public string RecommendedDefaultRmtCurrency { + get { return recommendedDefaultRmtCurrency_; } + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.exchange.SpecialistConfig element in ConfigsList) { + if (!element.IsInitialized) return false; + } + if (HasRmtRestrictedByLicense) { + if (!RmtRestrictedByLicense.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getConfigurationResponseFieldNames; + if (configs_.Count > 0) { + output.WriteMessageArray(1, field_names[0], configs_); + } + if (hasRmtRestrictedByLicense) { + output.WriteMessage(2, field_names[2], RmtRestrictedByLicense); + } + if (hasRecommendedDefaultRmtCurrency) { + output.WriteString(3, field_names[1], RecommendedDefaultRmtCurrency); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.exchange.SpecialistConfig element in ConfigsList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + if (hasRmtRestrictedByLicense) { + size += pb::CodedOutputStream.ComputeMessageSize(2, RmtRestrictedByLicense); + } + if (hasRecommendedDefaultRmtCurrency) { + size += pb::CodedOutputStream.ComputeStringSize(3, RecommendedDefaultRmtCurrency); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetConfigurationResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetConfigurationResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetConfigurationResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetConfigurationResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetConfigurationResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetConfigurationResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetConfigurationResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetConfigurationResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetConfigurationResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetConfigurationResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetConfigurationResponse MakeReadOnly() { + configs_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetConfigurationResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetConfigurationResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetConfigurationResponse result; + + private GetConfigurationResponse PrepareBuilder() { + if (resultIsReadOnly) { + GetConfigurationResponse original = result; + result = new GetConfigurationResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetConfigurationResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.GetConfigurationResponse.Descriptor; } + } + + public override GetConfigurationResponse DefaultInstanceForType { + get { return global::bnet.protocol.exchange.GetConfigurationResponse.DefaultInstance; } + } + + public override GetConfigurationResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetConfigurationResponse) { + return MergeFrom((GetConfigurationResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetConfigurationResponse other) { + if (other == global::bnet.protocol.exchange.GetConfigurationResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.configs_.Count != 0) { + result.configs_.Add(other.configs_); + } + if (other.HasRmtRestrictedByLicense) { + MergeRmtRestrictedByLicense(other.RmtRestrictedByLicense); + } + if (other.HasRecommendedDefaultRmtCurrency) { + RecommendedDefaultRmtCurrency = other.RecommendedDefaultRmtCurrency; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getConfigurationResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getConfigurationResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.configs_, global::bnet.protocol.exchange.SpecialistConfig.DefaultInstance, extensionRegistry); + break; + } + case 18: { + global::bnet.protocol.account.AccountLicense.Builder subBuilder = global::bnet.protocol.account.AccountLicense.CreateBuilder(); + if (result.hasRmtRestrictedByLicense) { + subBuilder.MergeFrom(RmtRestrictedByLicense); + } + input.ReadMessage(subBuilder, extensionRegistry); + RmtRestrictedByLicense = subBuilder.BuildPartial(); + break; + } + case 26: { + result.hasRecommendedDefaultRmtCurrency = input.ReadString(ref result.recommendedDefaultRmtCurrency_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList ConfigsList { + get { return PrepareBuilder().configs_; } + } + public int ConfigsCount { + get { return result.ConfigsCount; } + } + public global::bnet.protocol.exchange.SpecialistConfig GetConfigs(int index) { + return result.GetConfigs(index); + } + public Builder SetConfigs(int index, global::bnet.protocol.exchange.SpecialistConfig value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.configs_[index] = value; + return this; + } + public Builder SetConfigs(int index, global::bnet.protocol.exchange.SpecialistConfig.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.configs_[index] = builderForValue.Build(); + return this; + } + public Builder AddConfigs(global::bnet.protocol.exchange.SpecialistConfig value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.configs_.Add(value); + return this; + } + public Builder AddConfigs(global::bnet.protocol.exchange.SpecialistConfig.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.configs_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeConfigs(scg::IEnumerable values) { + PrepareBuilder(); + result.configs_.Add(values); + return this; + } + public Builder ClearConfigs() { + PrepareBuilder(); + result.configs_.Clear(); + return this; + } + + public bool HasRmtRestrictedByLicense { + get { return result.hasRmtRestrictedByLicense; } + } + public global::bnet.protocol.account.AccountLicense RmtRestrictedByLicense { + get { return result.RmtRestrictedByLicense; } + set { SetRmtRestrictedByLicense(value); } + } + public Builder SetRmtRestrictedByLicense(global::bnet.protocol.account.AccountLicense value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasRmtRestrictedByLicense = true; + result.rmtRestrictedByLicense_ = value; + return this; + } + public Builder SetRmtRestrictedByLicense(global::bnet.protocol.account.AccountLicense.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasRmtRestrictedByLicense = true; + result.rmtRestrictedByLicense_ = builderForValue.Build(); + return this; + } + public Builder MergeRmtRestrictedByLicense(global::bnet.protocol.account.AccountLicense value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasRmtRestrictedByLicense && + result.rmtRestrictedByLicense_ != global::bnet.protocol.account.AccountLicense.DefaultInstance) { + result.rmtRestrictedByLicense_ = global::bnet.protocol.account.AccountLicense.CreateBuilder(result.rmtRestrictedByLicense_).MergeFrom(value).BuildPartial(); + } else { + result.rmtRestrictedByLicense_ = value; + } + result.hasRmtRestrictedByLicense = true; + return this; + } + public Builder ClearRmtRestrictedByLicense() { + PrepareBuilder(); + result.hasRmtRestrictedByLicense = false; + result.rmtRestrictedByLicense_ = null; + return this; + } + + public bool HasRecommendedDefaultRmtCurrency { + get { return result.hasRecommendedDefaultRmtCurrency; } + } + public string RecommendedDefaultRmtCurrency { + get { return result.RecommendedDefaultRmtCurrency; } + set { SetRecommendedDefaultRmtCurrency(value); } + } + public Builder SetRecommendedDefaultRmtCurrency(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasRecommendedDefaultRmtCurrency = true; + result.recommendedDefaultRmtCurrency_ = value; + return this; + } + public Builder ClearRecommendedDefaultRmtCurrency() { + PrepareBuilder(); + result.hasRecommendedDefaultRmtCurrency = false; + result.recommendedDefaultRmtCurrency_ = ""; + return this; + } + } + static GetConfigurationResponse() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetOfferFeeEstimationRequest : pb::GeneratedMessage { + private GetOfferFeeEstimationRequest() { } + private static readonly GetOfferFeeEstimationRequest defaultInstance = new GetOfferFeeEstimationRequest().MakeReadOnly(); + private static readonly string[] _getOfferFeeEstimationRequestFieldNames = new string[] { "data", "partition_id" }; + private static readonly uint[] _getOfferFeeEstimationRequestFieldTags = new uint[] { 18, 10 }; + public static GetOfferFeeEstimationRequest DefaultInstance { + get { return defaultInstance; } + } + + public override GetOfferFeeEstimationRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetOfferFeeEstimationRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetOfferFeeEstimationRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetOfferFeeEstimationRequest__FieldAccessorTable; } + } + + public const int PartitionIdFieldNumber = 1; + private bool hasPartitionId; + private global::bnet.protocol.exchange.PartitionId partitionId_; + public bool HasPartitionId { + get { return hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int DataFieldNumber = 2; + private bool hasData; + private global::bnet.protocol.exchange.FeeEstimationData data_; + public bool HasData { + get { return hasData; } + } + public global::bnet.protocol.exchange.FeeEstimationData Data { + get { return data_ ?? global::bnet.protocol.exchange.FeeEstimationData.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasPartitionId) return false; + if (!hasData) return false; + if (!PartitionId.IsInitialized) return false; + if (!Data.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getOfferFeeEstimationRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[1], PartitionId); + } + if (hasData) { + output.WriteMessage(2, field_names[0], Data); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); + } + if (hasData) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Data); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetOfferFeeEstimationRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetOfferFeeEstimationRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetOfferFeeEstimationRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetOfferFeeEstimationRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetOfferFeeEstimationRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetOfferFeeEstimationRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetOfferFeeEstimationRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetOfferFeeEstimationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetOfferFeeEstimationRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetOfferFeeEstimationRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetOfferFeeEstimationRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetOfferFeeEstimationRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetOfferFeeEstimationRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetOfferFeeEstimationRequest result; + + private GetOfferFeeEstimationRequest PrepareBuilder() { + if (resultIsReadOnly) { + GetOfferFeeEstimationRequest original = result; + result = new GetOfferFeeEstimationRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetOfferFeeEstimationRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.GetOfferFeeEstimationRequest.Descriptor; } + } + + public override GetOfferFeeEstimationRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.GetOfferFeeEstimationRequest.DefaultInstance; } + } + + public override GetOfferFeeEstimationRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetOfferFeeEstimationRequest) { + return MergeFrom((GetOfferFeeEstimationRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetOfferFeeEstimationRequest other) { + if (other == global::bnet.protocol.exchange.GetOfferFeeEstimationRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasPartitionId) { + MergePartitionId(other.PartitionId); + } + if (other.HasData) { + MergeData(other.Data); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getOfferFeeEstimationRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getOfferFeeEstimationRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasPartitionId) { + subBuilder.MergeFrom(PartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + PartitionId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.exchange.FeeEstimationData.Builder subBuilder = global::bnet.protocol.exchange.FeeEstimationData.CreateBuilder(); + if (result.hasData) { + subBuilder.MergeFrom(Data); + } + input.ReadMessage(subBuilder, extensionRegistry); + Data = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasPartitionId { + get { return result.hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = value; + return this; + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = builderForValue.Build(); + return this; + } + public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasPartitionId && + result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); + } else { + result.partitionId_ = value; + } + result.hasPartitionId = true; + return this; + } + public Builder ClearPartitionId() { + PrepareBuilder(); + result.hasPartitionId = false; + result.partitionId_ = null; + return this; + } + + public bool HasData { + get { return result.hasData; } + } + public global::bnet.protocol.exchange.FeeEstimationData Data { + get { return result.Data; } + set { SetData(value); } + } + public Builder SetData(global::bnet.protocol.exchange.FeeEstimationData value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasData = true; + result.data_ = value; + return this; + } + public Builder SetData(global::bnet.protocol.exchange.FeeEstimationData.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasData = true; + result.data_ = builderForValue.Build(); + return this; + } + public Builder MergeData(global::bnet.protocol.exchange.FeeEstimationData value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasData && + result.data_ != global::bnet.protocol.exchange.FeeEstimationData.DefaultInstance) { + result.data_ = global::bnet.protocol.exchange.FeeEstimationData.CreateBuilder(result.data_).MergeFrom(value).BuildPartial(); + } else { + result.data_ = value; + } + result.hasData = true; + return this; + } + public Builder ClearData() { + PrepareBuilder(); + result.hasData = false; + result.data_ = null; + return this; + } + } + static GetOfferFeeEstimationRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetBidFeeEstimationRequest : pb::GeneratedMessage { + private GetBidFeeEstimationRequest() { } + private static readonly GetBidFeeEstimationRequest defaultInstance = new GetBidFeeEstimationRequest().MakeReadOnly(); + private static readonly string[] _getBidFeeEstimationRequestFieldNames = new string[] { "data", "partition_id" }; + private static readonly uint[] _getBidFeeEstimationRequestFieldTags = new uint[] { 18, 10 }; + public static GetBidFeeEstimationRequest DefaultInstance { + get { return defaultInstance; } + } + + public override GetBidFeeEstimationRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetBidFeeEstimationRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetBidFeeEstimationRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetBidFeeEstimationRequest__FieldAccessorTable; } + } + + public const int PartitionIdFieldNumber = 1; + private bool hasPartitionId; + private global::bnet.protocol.exchange.PartitionId partitionId_; + public bool HasPartitionId { + get { return hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int DataFieldNumber = 2; + private bool hasData; + private global::bnet.protocol.exchange.FeeEstimationData data_; + public bool HasData { + get { return hasData; } + } + public global::bnet.protocol.exchange.FeeEstimationData Data { + get { return data_ ?? global::bnet.protocol.exchange.FeeEstimationData.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasPartitionId) return false; + if (!hasData) return false; + if (!PartitionId.IsInitialized) return false; + if (!Data.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getBidFeeEstimationRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[1], PartitionId); + } + if (hasData) { + output.WriteMessage(2, field_names[0], Data); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); + } + if (hasData) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Data); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetBidFeeEstimationRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetBidFeeEstimationRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetBidFeeEstimationRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetBidFeeEstimationRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetBidFeeEstimationRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetBidFeeEstimationRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetBidFeeEstimationRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetBidFeeEstimationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetBidFeeEstimationRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetBidFeeEstimationRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetBidFeeEstimationRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetBidFeeEstimationRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetBidFeeEstimationRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetBidFeeEstimationRequest result; + + private GetBidFeeEstimationRequest PrepareBuilder() { + if (resultIsReadOnly) { + GetBidFeeEstimationRequest original = result; + result = new GetBidFeeEstimationRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetBidFeeEstimationRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.GetBidFeeEstimationRequest.Descriptor; } + } + + public override GetBidFeeEstimationRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.GetBidFeeEstimationRequest.DefaultInstance; } + } + + public override GetBidFeeEstimationRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetBidFeeEstimationRequest) { + return MergeFrom((GetBidFeeEstimationRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetBidFeeEstimationRequest other) { + if (other == global::bnet.protocol.exchange.GetBidFeeEstimationRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasPartitionId) { + MergePartitionId(other.PartitionId); + } + if (other.HasData) { + MergeData(other.Data); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getBidFeeEstimationRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getBidFeeEstimationRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasPartitionId) { + subBuilder.MergeFrom(PartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + PartitionId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.exchange.FeeEstimationData.Builder subBuilder = global::bnet.protocol.exchange.FeeEstimationData.CreateBuilder(); + if (result.hasData) { + subBuilder.MergeFrom(Data); + } + input.ReadMessage(subBuilder, extensionRegistry); + Data = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasPartitionId { + get { return result.hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = value; + return this; + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = builderForValue.Build(); + return this; + } + public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasPartitionId && + result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); + } else { + result.partitionId_ = value; + } + result.hasPartitionId = true; + return this; + } + public Builder ClearPartitionId() { + PrepareBuilder(); + result.hasPartitionId = false; + result.partitionId_ = null; + return this; + } + + public bool HasData { + get { return result.hasData; } + } + public global::bnet.protocol.exchange.FeeEstimationData Data { + get { return result.Data; } + set { SetData(value); } + } + public Builder SetData(global::bnet.protocol.exchange.FeeEstimationData value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasData = true; + result.data_ = value; + return this; + } + public Builder SetData(global::bnet.protocol.exchange.FeeEstimationData.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasData = true; + result.data_ = builderForValue.Build(); + return this; + } + public Builder MergeData(global::bnet.protocol.exchange.FeeEstimationData value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasData && + result.data_ != global::bnet.protocol.exchange.FeeEstimationData.DefaultInstance) { + result.data_ = global::bnet.protocol.exchange.FeeEstimationData.CreateBuilder(result.data_).MergeFrom(value).BuildPartial(); + } else { + result.data_ = value; + } + result.hasData = true; + return this; + } + public Builder ClearData() { + PrepareBuilder(); + result.hasData = false; + result.data_ = null; + return this; + } + } + static GetBidFeeEstimationRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetFeeEstimationResponse : pb::GeneratedMessage { + private GetFeeEstimationResponse() { } + private static readonly GetFeeEstimationResponse defaultInstance = new GetFeeEstimationResponse().MakeReadOnly(); + private static readonly string[] _getFeeEstimationResponseFieldNames = new string[] { "fee_amount", "fee_details" }; + private static readonly uint[] _getFeeEstimationResponseFieldTags = new uint[] { 8, 18 }; + public static GetFeeEstimationResponse DefaultInstance { + get { return defaultInstance; } + } + + public override GetFeeEstimationResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetFeeEstimationResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetFeeEstimationResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetFeeEstimationResponse__FieldAccessorTable; } + } + + public const int FeeAmountFieldNumber = 1; + private bool hasFeeAmount; + private ulong feeAmount_; + public bool HasFeeAmount { + get { return hasFeeAmount; } + } + public ulong FeeAmount { + get { return feeAmount_; } + } + + public const int FeeDetailsFieldNumber = 2; + private pbc::PopsicleList feeDetails_ = new pbc::PopsicleList(); + public scg::IList FeeDetailsList { + get { return feeDetails_; } + } + public int FeeDetailsCount { + get { return feeDetails_.Count; } + } + public global::bnet.protocol.exchange.FeeDetail GetFeeDetails(int index) { + return feeDetails_[index]; + } + + public override bool IsInitialized { + get { + if (!hasFeeAmount) return false; + foreach (global::bnet.protocol.exchange.FeeDetail element in FeeDetailsList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getFeeEstimationResponseFieldNames; + if (hasFeeAmount) { + output.WriteUInt64(1, field_names[0], FeeAmount); + } + if (feeDetails_.Count > 0) { + output.WriteMessageArray(2, field_names[1], feeDetails_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasFeeAmount) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, FeeAmount); + } + foreach (global::bnet.protocol.exchange.FeeDetail element in FeeDetailsList) { + size += pb::CodedOutputStream.ComputeMessageSize(2, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetFeeEstimationResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetFeeEstimationResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetFeeEstimationResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetFeeEstimationResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetFeeEstimationResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetFeeEstimationResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetFeeEstimationResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetFeeEstimationResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetFeeEstimationResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetFeeEstimationResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetFeeEstimationResponse MakeReadOnly() { + feeDetails_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetFeeEstimationResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetFeeEstimationResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetFeeEstimationResponse result; + + private GetFeeEstimationResponse PrepareBuilder() { + if (resultIsReadOnly) { + GetFeeEstimationResponse original = result; + result = new GetFeeEstimationResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetFeeEstimationResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.GetFeeEstimationResponse.Descriptor; } + } + + public override GetFeeEstimationResponse DefaultInstanceForType { + get { return global::bnet.protocol.exchange.GetFeeEstimationResponse.DefaultInstance; } + } + + public override GetFeeEstimationResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetFeeEstimationResponse) { + return MergeFrom((GetFeeEstimationResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetFeeEstimationResponse other) { + if (other == global::bnet.protocol.exchange.GetFeeEstimationResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasFeeAmount) { + FeeAmount = other.FeeAmount; + } + if (other.feeDetails_.Count != 0) { + result.feeDetails_.Add(other.feeDetails_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getFeeEstimationResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getFeeEstimationResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasFeeAmount = input.ReadUInt64(ref result.feeAmount_); + break; + } + case 18: { + input.ReadMessageArray(tag, field_name, result.feeDetails_, global::bnet.protocol.exchange.FeeDetail.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasFeeAmount { + get { return result.hasFeeAmount; } + } + public ulong FeeAmount { + get { return result.FeeAmount; } + set { SetFeeAmount(value); } + } + public Builder SetFeeAmount(ulong value) { + PrepareBuilder(); + result.hasFeeAmount = true; + result.feeAmount_ = value; + return this; + } + public Builder ClearFeeAmount() { + PrepareBuilder(); + result.hasFeeAmount = false; + result.feeAmount_ = 0UL; + return this; + } + + public pbc::IPopsicleList FeeDetailsList { + get { return PrepareBuilder().feeDetails_; } + } + public int FeeDetailsCount { + get { return result.FeeDetailsCount; } + } + public global::bnet.protocol.exchange.FeeDetail GetFeeDetails(int index) { + return result.GetFeeDetails(index); + } + public Builder SetFeeDetails(int index, global::bnet.protocol.exchange.FeeDetail value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.feeDetails_[index] = value; + return this; + } + public Builder SetFeeDetails(int index, global::bnet.protocol.exchange.FeeDetail.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.feeDetails_[index] = builderForValue.Build(); + return this; + } + public Builder AddFeeDetails(global::bnet.protocol.exchange.FeeDetail value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.feeDetails_.Add(value); + return this; + } + public Builder AddFeeDetails(global::bnet.protocol.exchange.FeeDetail.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.feeDetails_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeFeeDetails(scg::IEnumerable values) { + PrepareBuilder(); + result.feeDetails_.Add(values); + return this; + } + public Builder ClearFeeDetails() { + PrepareBuilder(); + result.feeDetails_.Clear(); + return this; + } + } + static GetFeeEstimationResponse() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class OrderBookNotificationRequest : pb::GeneratedMessage { + private OrderBookNotificationRequest() { } + private static readonly OrderBookNotificationRequest defaultInstance = new OrderBookNotificationRequest().MakeReadOnly(); + private static readonly string[] _orderBookNotificationRequestFieldNames = new string[] { "boot_strap_last", "notifications" }; + private static readonly uint[] _orderBookNotificationRequestFieldTags = new uint[] { 16, 10 }; + public static OrderBookNotificationRequest DefaultInstance { + get { return defaultInstance; } + } + + public override OrderBookNotificationRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override OrderBookNotificationRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_OrderBookNotificationRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_OrderBookNotificationRequest__FieldAccessorTable; } + } + + public const int NotificationsFieldNumber = 1; + private pbc::PopsicleList notifications_ = new pbc::PopsicleList(); + public scg::IList NotificationsList { + get { return notifications_; } + } + public int NotificationsCount { + get { return notifications_.Count; } + } + public global::bnet.protocol.exchange.OrderBookNotification GetNotifications(int index) { + return notifications_[index]; + } + + public const int BootStrapLastFieldNumber = 2; + private bool hasBootStrapLast; + private bool bootStrapLast_; + public bool HasBootStrapLast { + get { return hasBootStrapLast; } + } + public bool BootStrapLast { + get { return bootStrapLast_; } + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.exchange.OrderBookNotification element in NotificationsList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _orderBookNotificationRequestFieldNames; + if (notifications_.Count > 0) { + output.WriteMessageArray(1, field_names[1], notifications_); + } + if (hasBootStrapLast) { + output.WriteBool(2, field_names[0], BootStrapLast); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.exchange.OrderBookNotification element in NotificationsList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + if (hasBootStrapLast) { + size += pb::CodedOutputStream.ComputeBoolSize(2, BootStrapLast); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static OrderBookNotificationRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static OrderBookNotificationRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static OrderBookNotificationRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static OrderBookNotificationRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static OrderBookNotificationRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static OrderBookNotificationRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static OrderBookNotificationRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static OrderBookNotificationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static OrderBookNotificationRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static OrderBookNotificationRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private OrderBookNotificationRequest MakeReadOnly() { + notifications_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(OrderBookNotificationRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(OrderBookNotificationRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private OrderBookNotificationRequest result; + + private OrderBookNotificationRequest PrepareBuilder() { + if (resultIsReadOnly) { + OrderBookNotificationRequest original = result; + result = new OrderBookNotificationRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override OrderBookNotificationRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.OrderBookNotificationRequest.Descriptor; } + } + + public override OrderBookNotificationRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.OrderBookNotificationRequest.DefaultInstance; } + } + + public override OrderBookNotificationRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is OrderBookNotificationRequest) { + return MergeFrom((OrderBookNotificationRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(OrderBookNotificationRequest other) { + if (other == global::bnet.protocol.exchange.OrderBookNotificationRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.notifications_.Count != 0) { + result.notifications_.Add(other.notifications_); + } + if (other.HasBootStrapLast) { + BootStrapLast = other.BootStrapLast; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_orderBookNotificationRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _orderBookNotificationRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.notifications_, global::bnet.protocol.exchange.OrderBookNotification.DefaultInstance, extensionRegistry); + break; + } + case 16: { + result.hasBootStrapLast = input.ReadBool(ref result.bootStrapLast_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList NotificationsList { + get { return PrepareBuilder().notifications_; } + } + public int NotificationsCount { + get { return result.NotificationsCount; } + } + public global::bnet.protocol.exchange.OrderBookNotification GetNotifications(int index) { + return result.GetNotifications(index); + } + public Builder SetNotifications(int index, global::bnet.protocol.exchange.OrderBookNotification value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.notifications_[index] = value; + return this; + } + public Builder SetNotifications(int index, global::bnet.protocol.exchange.OrderBookNotification.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.notifications_[index] = builderForValue.Build(); + return this; + } + public Builder AddNotifications(global::bnet.protocol.exchange.OrderBookNotification value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.notifications_.Add(value); + return this; + } + public Builder AddNotifications(global::bnet.protocol.exchange.OrderBookNotification.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.notifications_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeNotifications(scg::IEnumerable values) { + PrepareBuilder(); + result.notifications_.Add(values); + return this; + } + public Builder ClearNotifications() { + PrepareBuilder(); + result.notifications_.Clear(); + return this; + } + + public bool HasBootStrapLast { + get { return result.hasBootStrapLast; } + } + public bool BootStrapLast { + get { return result.BootStrapLast; } + set { SetBootStrapLast(value); } + } + public Builder SetBootStrapLast(bool value) { + PrepareBuilder(); + result.hasBootStrapLast = true; + result.bootStrapLast_ = value; + return this; + } + public Builder ClearBootStrapLast() { + PrepareBuilder(); + result.hasBootStrapLast = false; + result.bootStrapLast_ = false; + return this; + } + } + static OrderBookNotificationRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class OfferNotificationRequest : pb::GeneratedMessage { + private OfferNotificationRequest() { } + private static readonly OfferNotificationRequest defaultInstance = new OfferNotificationRequest().MakeReadOnly(); + private static readonly string[] _offerNotificationRequestFieldNames = new string[] { "claim_result", "claim_result_reason", "event", "object_type", "offer" }; + private static readonly uint[] _offerNotificationRequestFieldTags = new uint[] { 32, 40, 16, 24, 10 }; + public static OfferNotificationRequest DefaultInstance { + get { return defaultInstance; } + } + + public override OfferNotificationRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override OfferNotificationRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_OfferNotificationRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_OfferNotificationRequest__FieldAccessorTable; } + } + + public const int OfferFieldNumber = 1; + private bool hasOffer; + private global::bnet.protocol.exchange.OfferExtended offer_; + public bool HasOffer { + get { return hasOffer; } + } + public global::bnet.protocol.exchange.OfferExtended Offer { + get { return offer_ ?? global::bnet.protocol.exchange.OfferExtended.DefaultInstance; } + } + + public const int EventFieldNumber = 2; + private bool hasEvent; + private uint event_; + public bool HasEvent { + get { return hasEvent; } + } + public uint Event { + get { return event_; } + } + + public const int ObjectTypeFieldNumber = 3; + private bool hasObjectType; + private uint objectType_; + public bool HasObjectType { + get { return hasObjectType; } + } + public uint ObjectType { + get { return objectType_; } + } + + public const int ClaimResultFieldNumber = 4; + private bool hasClaimResult; + private uint claimResult_; + public bool HasClaimResult { + get { return hasClaimResult; } + } + public uint ClaimResult { + get { return claimResult_; } + } + + public const int ClaimResultReasonFieldNumber = 5; + private bool hasClaimResultReason; + private uint claimResultReason_; + public bool HasClaimResultReason { + get { return hasClaimResultReason; } + } + public uint ClaimResultReason { + get { return claimResultReason_; } + } + + public override bool IsInitialized { + get { + if (!hasOffer) return false; + if (!hasEvent) return false; + if (!Offer.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _offerNotificationRequestFieldNames; + if (hasOffer) { + output.WriteMessage(1, field_names[4], Offer); + } + if (hasEvent) { + output.WriteUInt32(2, field_names[2], Event); + } + if (hasObjectType) { + output.WriteUInt32(3, field_names[3], ObjectType); + } + if (hasClaimResult) { + output.WriteUInt32(4, field_names[0], ClaimResult); + } + if (hasClaimResultReason) { + output.WriteUInt32(5, field_names[1], ClaimResultReason); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasOffer) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Offer); + } + if (hasEvent) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, Event); + } + if (hasObjectType) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, ObjectType); + } + if (hasClaimResult) { + size += pb::CodedOutputStream.ComputeUInt32Size(4, ClaimResult); + } + if (hasClaimResultReason) { + size += pb::CodedOutputStream.ComputeUInt32Size(5, ClaimResultReason); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static OfferNotificationRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static OfferNotificationRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static OfferNotificationRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static OfferNotificationRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static OfferNotificationRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static OfferNotificationRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static OfferNotificationRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static OfferNotificationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static OfferNotificationRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static OfferNotificationRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private OfferNotificationRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(OfferNotificationRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(OfferNotificationRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private OfferNotificationRequest result; + + private OfferNotificationRequest PrepareBuilder() { + if (resultIsReadOnly) { + OfferNotificationRequest original = result; + result = new OfferNotificationRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override OfferNotificationRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.OfferNotificationRequest.Descriptor; } + } + + public override OfferNotificationRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.OfferNotificationRequest.DefaultInstance; } + } + + public override OfferNotificationRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is OfferNotificationRequest) { + return MergeFrom((OfferNotificationRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(OfferNotificationRequest other) { + if (other == global::bnet.protocol.exchange.OfferNotificationRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasOffer) { + MergeOffer(other.Offer); + } + if (other.HasEvent) { + Event = other.Event; + } + if (other.HasObjectType) { + ObjectType = other.ObjectType; + } + if (other.HasClaimResult) { + ClaimResult = other.ClaimResult; + } + if (other.HasClaimResultReason) { + ClaimResultReason = other.ClaimResultReason; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_offerNotificationRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _offerNotificationRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.OfferExtended.Builder subBuilder = global::bnet.protocol.exchange.OfferExtended.CreateBuilder(); + if (result.hasOffer) { + subBuilder.MergeFrom(Offer); + } + input.ReadMessage(subBuilder, extensionRegistry); + Offer = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasEvent = input.ReadUInt32(ref result.event_); + break; + } + case 24: { + result.hasObjectType = input.ReadUInt32(ref result.objectType_); + break; + } + case 32: { + result.hasClaimResult = input.ReadUInt32(ref result.claimResult_); + break; + } + case 40: { + result.hasClaimResultReason = input.ReadUInt32(ref result.claimResultReason_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasOffer { + get { return result.hasOffer; } + } + public global::bnet.protocol.exchange.OfferExtended Offer { + get { return result.Offer; } + set { SetOffer(value); } + } + public Builder SetOffer(global::bnet.protocol.exchange.OfferExtended value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOffer = true; + result.offer_ = value; + return this; + } + public Builder SetOffer(global::bnet.protocol.exchange.OfferExtended.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOffer = true; + result.offer_ = builderForValue.Build(); + return this; + } + public Builder MergeOffer(global::bnet.protocol.exchange.OfferExtended value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOffer && + result.offer_ != global::bnet.protocol.exchange.OfferExtended.DefaultInstance) { + result.offer_ = global::bnet.protocol.exchange.OfferExtended.CreateBuilder(result.offer_).MergeFrom(value).BuildPartial(); + } else { + result.offer_ = value; + } + result.hasOffer = true; + return this; + } + public Builder ClearOffer() { + PrepareBuilder(); + result.hasOffer = false; + result.offer_ = null; + return this; + } + + public bool HasEvent { + get { return result.hasEvent; } + } + public uint Event { + get { return result.Event; } + set { SetEvent(value); } + } + public Builder SetEvent(uint value) { + PrepareBuilder(); + result.hasEvent = true; + result.event_ = value; + return this; + } + public Builder ClearEvent() { + PrepareBuilder(); + result.hasEvent = false; + result.event_ = 0; + return this; + } + + public bool HasObjectType { + get { return result.hasObjectType; } + } + public uint ObjectType { + get { return result.ObjectType; } + set { SetObjectType(value); } + } + public Builder SetObjectType(uint value) { + PrepareBuilder(); + result.hasObjectType = true; + result.objectType_ = value; + return this; + } + public Builder ClearObjectType() { + PrepareBuilder(); + result.hasObjectType = false; + result.objectType_ = 0; + return this; + } + + public bool HasClaimResult { + get { return result.hasClaimResult; } + } + public uint ClaimResult { + get { return result.ClaimResult; } + set { SetClaimResult(value); } + } + public Builder SetClaimResult(uint value) { + PrepareBuilder(); + result.hasClaimResult = true; + result.claimResult_ = value; + return this; + } + public Builder ClearClaimResult() { + PrepareBuilder(); + result.hasClaimResult = false; + result.claimResult_ = 0; + return this; + } + + public bool HasClaimResultReason { + get { return result.hasClaimResultReason; } + } + public uint ClaimResultReason { + get { return result.ClaimResultReason; } + set { SetClaimResultReason(value); } + } + public Builder SetClaimResultReason(uint value) { + PrepareBuilder(); + result.hasClaimResultReason = true; + result.claimResultReason_ = value; + return this; + } + public Builder ClearClaimResultReason() { + PrepareBuilder(); + result.hasClaimResultReason = false; + result.claimResultReason_ = 0; + return this; + } + } + static OfferNotificationRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class BidNotificationRequest : pb::GeneratedMessage { + private BidNotificationRequest() { } + private static readonly BidNotificationRequest defaultInstance = new BidNotificationRequest().MakeReadOnly(); + private static readonly string[] _bidNotificationRequestFieldNames = new string[] { "bid", "claim_result", "claim_result_reason", "event", "object_type" }; + private static readonly uint[] _bidNotificationRequestFieldTags = new uint[] { 10, 32, 40, 16, 24 }; + public static BidNotificationRequest DefaultInstance { + get { return defaultInstance; } + } + + public override BidNotificationRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override BidNotificationRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_BidNotificationRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_BidNotificationRequest__FieldAccessorTable; } + } + + public const int BidFieldNumber = 1; + private bool hasBid; + private global::bnet.protocol.exchange.BidExtended bid_; + public bool HasBid { + get { return hasBid; } + } + public global::bnet.protocol.exchange.BidExtended Bid { + get { return bid_ ?? global::bnet.protocol.exchange.BidExtended.DefaultInstance; } + } + + public const int EventFieldNumber = 2; + private bool hasEvent; + private uint event_; + public bool HasEvent { + get { return hasEvent; } + } + public uint Event { + get { return event_; } + } + + public const int ObjectTypeFieldNumber = 3; + private bool hasObjectType; + private uint objectType_; + public bool HasObjectType { + get { return hasObjectType; } + } + public uint ObjectType { + get { return objectType_; } + } + + public const int ClaimResultFieldNumber = 4; + private bool hasClaimResult; + private uint claimResult_; + public bool HasClaimResult { + get { return hasClaimResult; } + } + public uint ClaimResult { + get { return claimResult_; } + } + + public const int ClaimResultReasonFieldNumber = 5; + private bool hasClaimResultReason; + private uint claimResultReason_; + public bool HasClaimResultReason { + get { return hasClaimResultReason; } + } + public uint ClaimResultReason { + get { return claimResultReason_; } + } + + public override bool IsInitialized { + get { + if (!hasBid) return false; + if (!hasEvent) return false; + if (!Bid.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _bidNotificationRequestFieldNames; + if (hasBid) { + output.WriteMessage(1, field_names[0], Bid); + } + if (hasEvent) { + output.WriteUInt32(2, field_names[3], Event); + } + if (hasObjectType) { + output.WriteUInt32(3, field_names[4], ObjectType); + } + if (hasClaimResult) { + output.WriteUInt32(4, field_names[1], ClaimResult); + } + if (hasClaimResultReason) { + output.WriteUInt32(5, field_names[2], ClaimResultReason); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasBid) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Bid); + } + if (hasEvent) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, Event); + } + if (hasObjectType) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, ObjectType); + } + if (hasClaimResult) { + size += pb::CodedOutputStream.ComputeUInt32Size(4, ClaimResult); + } + if (hasClaimResultReason) { + size += pb::CodedOutputStream.ComputeUInt32Size(5, ClaimResultReason); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static BidNotificationRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static BidNotificationRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static BidNotificationRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static BidNotificationRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static BidNotificationRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static BidNotificationRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static BidNotificationRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static BidNotificationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static BidNotificationRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static BidNotificationRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private BidNotificationRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(BidNotificationRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(BidNotificationRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private BidNotificationRequest result; + + private BidNotificationRequest PrepareBuilder() { + if (resultIsReadOnly) { + BidNotificationRequest original = result; + result = new BidNotificationRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override BidNotificationRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.BidNotificationRequest.Descriptor; } + } + + public override BidNotificationRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.BidNotificationRequest.DefaultInstance; } + } + + public override BidNotificationRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is BidNotificationRequest) { + return MergeFrom((BidNotificationRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(BidNotificationRequest other) { + if (other == global::bnet.protocol.exchange.BidNotificationRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasBid) { + MergeBid(other.Bid); + } + if (other.HasEvent) { + Event = other.Event; + } + if (other.HasObjectType) { + ObjectType = other.ObjectType; + } + if (other.HasClaimResult) { + ClaimResult = other.ClaimResult; + } + if (other.HasClaimResultReason) { + ClaimResultReason = other.ClaimResultReason; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_bidNotificationRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _bidNotificationRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.BidExtended.Builder subBuilder = global::bnet.protocol.exchange.BidExtended.CreateBuilder(); + if (result.hasBid) { + subBuilder.MergeFrom(Bid); + } + input.ReadMessage(subBuilder, extensionRegistry); + Bid = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasEvent = input.ReadUInt32(ref result.event_); + break; + } + case 24: { + result.hasObjectType = input.ReadUInt32(ref result.objectType_); + break; + } + case 32: { + result.hasClaimResult = input.ReadUInt32(ref result.claimResult_); + break; + } + case 40: { + result.hasClaimResultReason = input.ReadUInt32(ref result.claimResultReason_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasBid { + get { return result.hasBid; } + } + public global::bnet.protocol.exchange.BidExtended Bid { + get { return result.Bid; } + set { SetBid(value); } + } + public Builder SetBid(global::bnet.protocol.exchange.BidExtended value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBid = true; + result.bid_ = value; + return this; + } + public Builder SetBid(global::bnet.protocol.exchange.BidExtended.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBid = true; + result.bid_ = builderForValue.Build(); + return this; + } + public Builder MergeBid(global::bnet.protocol.exchange.BidExtended value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBid && + result.bid_ != global::bnet.protocol.exchange.BidExtended.DefaultInstance) { + result.bid_ = global::bnet.protocol.exchange.BidExtended.CreateBuilder(result.bid_).MergeFrom(value).BuildPartial(); + } else { + result.bid_ = value; + } + result.hasBid = true; + return this; + } + public Builder ClearBid() { + PrepareBuilder(); + result.hasBid = false; + result.bid_ = null; + return this; + } + + public bool HasEvent { + get { return result.hasEvent; } + } + public uint Event { + get { return result.Event; } + set { SetEvent(value); } + } + public Builder SetEvent(uint value) { + PrepareBuilder(); + result.hasEvent = true; + result.event_ = value; + return this; + } + public Builder ClearEvent() { + PrepareBuilder(); + result.hasEvent = false; + result.event_ = 0; + return this; + } + + public bool HasObjectType { + get { return result.hasObjectType; } + } + public uint ObjectType { + get { return result.ObjectType; } + set { SetObjectType(value); } + } + public Builder SetObjectType(uint value) { + PrepareBuilder(); + result.hasObjectType = true; + result.objectType_ = value; + return this; + } + public Builder ClearObjectType() { + PrepareBuilder(); + result.hasObjectType = false; + result.objectType_ = 0; + return this; + } + + public bool HasClaimResult { + get { return result.hasClaimResult; } + } + public uint ClaimResult { + get { return result.ClaimResult; } + set { SetClaimResult(value); } + } + public Builder SetClaimResult(uint value) { + PrepareBuilder(); + result.hasClaimResult = true; + result.claimResult_ = value; + return this; + } + public Builder ClearClaimResult() { + PrepareBuilder(); + result.hasClaimResult = false; + result.claimResult_ = 0; + return this; + } + + public bool HasClaimResultReason { + get { return result.hasClaimResultReason; } + } + public uint ClaimResultReason { + get { return result.ClaimResultReason; } + set { SetClaimResultReason(value); } + } + public Builder SetClaimResultReason(uint value) { + PrepareBuilder(); + result.hasClaimResultReason = true; + result.claimResultReason_ = value; + return this; + } + public Builder ClearClaimResultReason() { + PrepareBuilder(); + result.hasClaimResultReason = false; + result.claimResultReason_ = 0; + return this; + } + } + static BidNotificationRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class CustomNotificationRequest : pb::GeneratedMessage { + private CustomNotificationRequest() { } + private static readonly CustomNotificationRequest defaultInstance = new CustomNotificationRequest().MakeReadOnly(); + private static readonly string[] _customNotificationRequestFieldNames = new string[] { "handle", "info", "order_id" }; + private static readonly uint[] _customNotificationRequestFieldTags = new uint[] { 10, 26, 16 }; + public static CustomNotificationRequest DefaultInstance { + get { return defaultInstance; } + } + + public override CustomNotificationRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override CustomNotificationRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_CustomNotificationRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_CustomNotificationRequest__FieldAccessorTable; } + } + + public const int HandleFieldNumber = 1; + private bool hasHandle; + private global::bnet.protocol.exchange.OrderBookHandle handle_; + public bool HasHandle { + get { return hasHandle; } + } + public global::bnet.protocol.exchange.OrderBookHandle Handle { + get { return handle_ ?? global::bnet.protocol.exchange.OrderBookHandle.DefaultInstance; } + } + + public const int OrderIdFieldNumber = 2; + private bool hasOrderId; + private ulong orderId_; + public bool HasOrderId { + get { return hasOrderId; } + } + public ulong OrderId { + get { return orderId_; } + } + + public const int InfoFieldNumber = 3; + private bool hasInfo; + private global::bnet.protocol.exchange.BlobFrom info_; + public bool HasInfo { + get { return hasInfo; } + } + public global::bnet.protocol.exchange.BlobFrom Info { + get { return info_ ?? global::bnet.protocol.exchange.BlobFrom.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasHandle) return false; + if (!hasOrderId) return false; + if (!hasInfo) return false; + if (!Handle.IsInitialized) return false; + if (!Info.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _customNotificationRequestFieldNames; + if (hasHandle) { + output.WriteMessage(1, field_names[0], Handle); + } + if (hasOrderId) { + output.WriteUInt64(2, field_names[2], OrderId); + } + if (hasInfo) { + output.WriteMessage(3, field_names[1], Info); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasHandle) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Handle); + } + if (hasOrderId) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, OrderId); + } + if (hasInfo) { + size += pb::CodedOutputStream.ComputeMessageSize(3, Info); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static CustomNotificationRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CustomNotificationRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CustomNotificationRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CustomNotificationRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CustomNotificationRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CustomNotificationRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static CustomNotificationRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static CustomNotificationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static CustomNotificationRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CustomNotificationRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CustomNotificationRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(CustomNotificationRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CustomNotificationRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CustomNotificationRequest result; + + private CustomNotificationRequest PrepareBuilder() { + if (resultIsReadOnly) { + CustomNotificationRequest original = result; + result = new CustomNotificationRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CustomNotificationRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.CustomNotificationRequest.Descriptor; } + } + + public override CustomNotificationRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.CustomNotificationRequest.DefaultInstance; } + } + + public override CustomNotificationRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is CustomNotificationRequest) { + return MergeFrom((CustomNotificationRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(CustomNotificationRequest other) { + if (other == global::bnet.protocol.exchange.CustomNotificationRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasHandle) { + MergeHandle(other.Handle); + } + if (other.HasOrderId) { + OrderId = other.OrderId; + } + if (other.HasInfo) { + MergeInfo(other.Info); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_customNotificationRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _customNotificationRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.OrderBookHandle.Builder subBuilder = global::bnet.protocol.exchange.OrderBookHandle.CreateBuilder(); + if (result.hasHandle) { + subBuilder.MergeFrom(Handle); + } + input.ReadMessage(subBuilder, extensionRegistry); + Handle = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasOrderId = input.ReadUInt64(ref result.orderId_); + break; + } + case 26: { + global::bnet.protocol.exchange.BlobFrom.Builder subBuilder = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(); + if (result.hasInfo) { + subBuilder.MergeFrom(Info); + } + input.ReadMessage(subBuilder, extensionRegistry); + Info = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasHandle { + get { return result.hasHandle; } + } + public global::bnet.protocol.exchange.OrderBookHandle Handle { + get { return result.Handle; } + set { SetHandle(value); } + } + public Builder SetHandle(global::bnet.protocol.exchange.OrderBookHandle value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasHandle = true; + result.handle_ = value; + return this; + } + public Builder SetHandle(global::bnet.protocol.exchange.OrderBookHandle.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasHandle = true; + result.handle_ = builderForValue.Build(); + return this; + } + public Builder MergeHandle(global::bnet.protocol.exchange.OrderBookHandle value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasHandle && + result.handle_ != global::bnet.protocol.exchange.OrderBookHandle.DefaultInstance) { + result.handle_ = global::bnet.protocol.exchange.OrderBookHandle.CreateBuilder(result.handle_).MergeFrom(value).BuildPartial(); + } else { + result.handle_ = value; + } + result.hasHandle = true; + return this; + } + public Builder ClearHandle() { + PrepareBuilder(); + result.hasHandle = false; + result.handle_ = null; + return this; + } + + public bool HasOrderId { + get { return result.hasOrderId; } + } + public ulong OrderId { + get { return result.OrderId; } + set { SetOrderId(value); } + } + public Builder SetOrderId(ulong value) { + PrepareBuilder(); + result.hasOrderId = true; + result.orderId_ = value; + return this; + } + public Builder ClearOrderId() { + PrepareBuilder(); + result.hasOrderId = false; + result.orderId_ = 0UL; + return this; + } + + public bool HasInfo { + get { return result.hasInfo; } + } + public global::bnet.protocol.exchange.BlobFrom Info { + get { return result.Info; } + set { SetInfo(value); } + } + public Builder SetInfo(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasInfo = true; + result.info_ = value; + return this; + } + public Builder SetInfo(global::bnet.protocol.exchange.BlobFrom.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasInfo = true; + result.info_ = builderForValue.Build(); + return this; + } + public Builder MergeInfo(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasInfo && + result.info_ != global::bnet.protocol.exchange.BlobFrom.DefaultInstance) { + result.info_ = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(result.info_).MergeFrom(value).BuildPartial(); + } else { + result.info_ = value; + } + result.hasInfo = true; + return this; + } + public Builder ClearInfo() { + PrepareBuilder(); + result.hasInfo = false; + result.info_ = null; + return this; + } + } + static CustomNotificationRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class QueryOrdersByAccountForItemRequest : pb::GeneratedMessage { + private QueryOrdersByAccountForItemRequest() { } + private static readonly QueryOrdersByAccountForItemRequest defaultInstance = new QueryOrdersByAccountForItemRequest().MakeReadOnly(); + private static readonly string[] _queryOrdersByAccountForItemRequestFieldNames = new string[] { "account_for_item", "bnet_account", "filter" }; + private static readonly uint[] _queryOrdersByAccountForItemRequestFieldTags = new uint[] { 10, 18, 26 }; + public static QueryOrdersByAccountForItemRequest DefaultInstance { + get { return defaultInstance; } + } + + public override QueryOrdersByAccountForItemRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override QueryOrdersByAccountForItemRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryOrdersByAccountForItemRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryOrdersByAccountForItemRequest__FieldAccessorTable; } + } + + public const int AccountForItemFieldNumber = 1; + private bool hasAccountForItem; + private global::bnet.protocol.exchange.BlobFrom accountForItem_; + public bool HasAccountForItem { + get { return hasAccountForItem; } + } + public global::bnet.protocol.exchange.BlobFrom AccountForItem { + get { return accountForItem_ ?? global::bnet.protocol.exchange.BlobFrom.DefaultInstance; } + } + + public const int BnetAccountFieldNumber = 2; + private bool hasBnetAccount; + private global::bnet.protocol.EntityId bnetAccount_; + public bool HasBnetAccount { + get { return hasBnetAccount; } + } + public global::bnet.protocol.EntityId BnetAccount { + get { return bnetAccount_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int FilterFieldNumber = 3; + private bool hasFilter; + private global::bnet.protocol.exchange.QueryOrderFilter filter_; + public bool HasFilter { + get { return hasFilter; } + } + public global::bnet.protocol.exchange.QueryOrderFilter Filter { + get { return filter_ ?? global::bnet.protocol.exchange.QueryOrderFilter.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasAccountForItem) return false; + if (!hasFilter) return false; + if (!AccountForItem.IsInitialized) return false; + if (HasBnetAccount) { + if (!BnetAccount.IsInitialized) return false; + } + if (!Filter.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _queryOrdersByAccountForItemRequestFieldNames; + if (hasAccountForItem) { + output.WriteMessage(1, field_names[0], AccountForItem); + } + if (hasBnetAccount) { + output.WriteMessage(2, field_names[1], BnetAccount); + } + if (hasFilter) { + output.WriteMessage(3, field_names[2], Filter); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAccountForItem) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AccountForItem); + } + if (hasBnetAccount) { + size += pb::CodedOutputStream.ComputeMessageSize(2, BnetAccount); + } + if (hasFilter) { + size += pb::CodedOutputStream.ComputeMessageSize(3, Filter); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static QueryOrdersByAccountForItemRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static QueryOrdersByAccountForItemRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static QueryOrdersByAccountForItemRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static QueryOrdersByAccountForItemRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static QueryOrdersByAccountForItemRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static QueryOrdersByAccountForItemRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static QueryOrdersByAccountForItemRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static QueryOrdersByAccountForItemRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static QueryOrdersByAccountForItemRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static QueryOrdersByAccountForItemRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private QueryOrdersByAccountForItemRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(QueryOrdersByAccountForItemRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(QueryOrdersByAccountForItemRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private QueryOrdersByAccountForItemRequest result; + + private QueryOrdersByAccountForItemRequest PrepareBuilder() { + if (resultIsReadOnly) { + QueryOrdersByAccountForItemRequest original = result; + result = new QueryOrdersByAccountForItemRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override QueryOrdersByAccountForItemRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.QueryOrdersByAccountForItemRequest.Descriptor; } + } + + public override QueryOrdersByAccountForItemRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.QueryOrdersByAccountForItemRequest.DefaultInstance; } + } + + public override QueryOrdersByAccountForItemRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is QueryOrdersByAccountForItemRequest) { + return MergeFrom((QueryOrdersByAccountForItemRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(QueryOrdersByAccountForItemRequest other) { + if (other == global::bnet.protocol.exchange.QueryOrdersByAccountForItemRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAccountForItem) { + MergeAccountForItem(other.AccountForItem); + } + if (other.HasBnetAccount) { + MergeBnetAccount(other.BnetAccount); + } + if (other.HasFilter) { + MergeFilter(other.Filter); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_queryOrdersByAccountForItemRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _queryOrdersByAccountForItemRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.BlobFrom.Builder subBuilder = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(); + if (result.hasAccountForItem) { + subBuilder.MergeFrom(AccountForItem); + } + input.ReadMessage(subBuilder, extensionRegistry); + AccountForItem = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasBnetAccount) { + subBuilder.MergeFrom(BnetAccount); + } + input.ReadMessage(subBuilder, extensionRegistry); + BnetAccount = subBuilder.BuildPartial(); + break; + } + case 26: { + global::bnet.protocol.exchange.QueryOrderFilter.Builder subBuilder = global::bnet.protocol.exchange.QueryOrderFilter.CreateBuilder(); + if (result.hasFilter) { + subBuilder.MergeFrom(Filter); + } + input.ReadMessage(subBuilder, extensionRegistry); + Filter = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAccountForItem { + get { return result.hasAccountForItem; } + } + public global::bnet.protocol.exchange.BlobFrom AccountForItem { + get { return result.AccountForItem; } + set { SetAccountForItem(value); } + } + public Builder SetAccountForItem(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccountForItem = true; + result.accountForItem_ = value; + return this; + } + public Builder SetAccountForItem(global::bnet.protocol.exchange.BlobFrom.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccountForItem = true; + result.accountForItem_ = builderForValue.Build(); + return this; + } + public Builder MergeAccountForItem(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccountForItem && + result.accountForItem_ != global::bnet.protocol.exchange.BlobFrom.DefaultInstance) { + result.accountForItem_ = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(result.accountForItem_).MergeFrom(value).BuildPartial(); + } else { + result.accountForItem_ = value; + } + result.hasAccountForItem = true; + return this; + } + public Builder ClearAccountForItem() { + PrepareBuilder(); + result.hasAccountForItem = false; + result.accountForItem_ = null; + return this; + } + + public bool HasBnetAccount { + get { return result.hasBnetAccount; } + } + public global::bnet.protocol.EntityId BnetAccount { + get { return result.BnetAccount; } + set { SetBnetAccount(value); } + } + public Builder SetBnetAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBnetAccount = true; + result.bnetAccount_ = value; + return this; + } + public Builder SetBnetAccount(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBnetAccount = true; + result.bnetAccount_ = builderForValue.Build(); + return this; + } + public Builder MergeBnetAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBnetAccount && + result.bnetAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.bnetAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccount_).MergeFrom(value).BuildPartial(); + } else { + result.bnetAccount_ = value; + } + result.hasBnetAccount = true; + return this; + } + public Builder ClearBnetAccount() { + PrepareBuilder(); + result.hasBnetAccount = false; + result.bnetAccount_ = null; + return this; + } + + public bool HasFilter { + get { return result.hasFilter; } + } + public global::bnet.protocol.exchange.QueryOrderFilter Filter { + get { return result.Filter; } + set { SetFilter(value); } + } + public Builder SetFilter(global::bnet.protocol.exchange.QueryOrderFilter value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasFilter = true; + result.filter_ = value; + return this; + } + public Builder SetFilter(global::bnet.protocol.exchange.QueryOrderFilter.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasFilter = true; + result.filter_ = builderForValue.Build(); + return this; + } + public Builder MergeFilter(global::bnet.protocol.exchange.QueryOrderFilter value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasFilter && + result.filter_ != global::bnet.protocol.exchange.QueryOrderFilter.DefaultInstance) { + result.filter_ = global::bnet.protocol.exchange.QueryOrderFilter.CreateBuilder(result.filter_).MergeFrom(value).BuildPartial(); + } else { + result.filter_ = value; + } + result.hasFilter = true; + return this; + } + public Builder ClearFilter() { + PrepareBuilder(); + result.hasFilter = false; + result.filter_ = null; + return this; + } + } + static QueryOrdersByAccountForItemRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class QueryOrdersByAccountForItemResponse : pb::GeneratedMessage { + private QueryOrdersByAccountForItemResponse() { } + private static readonly QueryOrdersByAccountForItemResponse defaultInstance = new QueryOrdersByAccountForItemResponse().MakeReadOnly(); + private static readonly string[] _queryOrdersByAccountForItemResponseFieldNames = new string[] { "orders", "total_count" }; + private static readonly uint[] _queryOrdersByAccountForItemResponseFieldTags = new uint[] { 10, 16 }; + public static QueryOrdersByAccountForItemResponse DefaultInstance { + get { return defaultInstance; } + } + + public override QueryOrdersByAccountForItemResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override QueryOrdersByAccountForItemResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryOrdersByAccountForItemResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryOrdersByAccountForItemResponse__FieldAccessorTable; } + } + + public const int OrdersFieldNumber = 1; + private pbc::PopsicleList orders_ = new pbc::PopsicleList(); + public scg::IList OrdersList { + get { return orders_; } + } + public int OrdersCount { + get { return orders_.Count; } + } + public global::bnet.protocol.exchange.OrderExtended GetOrders(int index) { + return orders_[index]; + } + + public const int TotalCountFieldNumber = 2; + private bool hasTotalCount; + private uint totalCount_; + public bool HasTotalCount { + get { return hasTotalCount; } + } + public uint TotalCount { + get { return totalCount_; } + } + + public override bool IsInitialized { + get { + if (!hasTotalCount) return false; + foreach (global::bnet.protocol.exchange.OrderExtended element in OrdersList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _queryOrdersByAccountForItemResponseFieldNames; + if (orders_.Count > 0) { + output.WriteMessageArray(1, field_names[0], orders_); + } + if (hasTotalCount) { + output.WriteUInt32(2, field_names[1], TotalCount); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.exchange.OrderExtended element in OrdersList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + if (hasTotalCount) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, TotalCount); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static QueryOrdersByAccountForItemResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static QueryOrdersByAccountForItemResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static QueryOrdersByAccountForItemResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static QueryOrdersByAccountForItemResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static QueryOrdersByAccountForItemResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static QueryOrdersByAccountForItemResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static QueryOrdersByAccountForItemResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static QueryOrdersByAccountForItemResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static QueryOrdersByAccountForItemResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static QueryOrdersByAccountForItemResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private QueryOrdersByAccountForItemResponse MakeReadOnly() { + orders_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(QueryOrdersByAccountForItemResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(QueryOrdersByAccountForItemResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private QueryOrdersByAccountForItemResponse result; + + private QueryOrdersByAccountForItemResponse PrepareBuilder() { + if (resultIsReadOnly) { + QueryOrdersByAccountForItemResponse original = result; + result = new QueryOrdersByAccountForItemResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override QueryOrdersByAccountForItemResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.QueryOrdersByAccountForItemResponse.Descriptor; } + } + + public override QueryOrdersByAccountForItemResponse DefaultInstanceForType { + get { return global::bnet.protocol.exchange.QueryOrdersByAccountForItemResponse.DefaultInstance; } + } + + public override QueryOrdersByAccountForItemResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is QueryOrdersByAccountForItemResponse) { + return MergeFrom((QueryOrdersByAccountForItemResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(QueryOrdersByAccountForItemResponse other) { + if (other == global::bnet.protocol.exchange.QueryOrdersByAccountForItemResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.orders_.Count != 0) { + result.orders_.Add(other.orders_); + } + if (other.HasTotalCount) { + TotalCount = other.TotalCount; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_queryOrdersByAccountForItemResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _queryOrdersByAccountForItemResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.orders_, global::bnet.protocol.exchange.OrderExtended.DefaultInstance, extensionRegistry); + break; + } + case 16: { + result.hasTotalCount = input.ReadUInt32(ref result.totalCount_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList OrdersList { + get { return PrepareBuilder().orders_; } + } + public int OrdersCount { + get { return result.OrdersCount; } + } + public global::bnet.protocol.exchange.OrderExtended GetOrders(int index) { + return result.GetOrders(index); + } + public Builder SetOrders(int index, global::bnet.protocol.exchange.OrderExtended value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.orders_[index] = value; + return this; + } + public Builder SetOrders(int index, global::bnet.protocol.exchange.OrderExtended.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.orders_[index] = builderForValue.Build(); + return this; + } + public Builder AddOrders(global::bnet.protocol.exchange.OrderExtended value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.orders_.Add(value); + return this; + } + public Builder AddOrders(global::bnet.protocol.exchange.OrderExtended.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.orders_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeOrders(scg::IEnumerable values) { + PrepareBuilder(); + result.orders_.Add(values); + return this; + } + public Builder ClearOrders() { + PrepareBuilder(); + result.orders_.Clear(); + return this; + } + + public bool HasTotalCount { + get { return result.hasTotalCount; } + } + public uint TotalCount { + get { return result.TotalCount; } + set { SetTotalCount(value); } + } + public Builder SetTotalCount(uint value) { + PrepareBuilder(); + result.hasTotalCount = true; + result.totalCount_ = value; + return this; + } + public Builder ClearTotalCount() { + PrepareBuilder(); + result.hasTotalCount = false; + result.totalCount_ = 0; + return this; + } + } + static QueryOrdersByAccountForItemResponse() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetFeeDetailsRequest : pb::GeneratedMessage { + private GetFeeDetailsRequest() { } + private static readonly GetFeeDetailsRequest defaultInstance = new GetFeeDetailsRequest().MakeReadOnly(); + private static readonly string[] _getFeeDetailsRequestFieldNames = new string[] { "bnet_account", "order_id", "partition_id" }; + private static readonly uint[] _getFeeDetailsRequestFieldTags = new uint[] { 26, 16, 10 }; + public static GetFeeDetailsRequest DefaultInstance { + get { return defaultInstance; } + } + + public override GetFeeDetailsRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetFeeDetailsRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetFeeDetailsRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetFeeDetailsRequest__FieldAccessorTable; } + } + + public const int PartitionIdFieldNumber = 1; + private bool hasPartitionId; + private global::bnet.protocol.exchange.PartitionId partitionId_; + public bool HasPartitionId { + get { return hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int OrderIdFieldNumber = 2; + private bool hasOrderId; + private ulong orderId_; + public bool HasOrderId { + get { return hasOrderId; } + } + public ulong OrderId { + get { return orderId_; } + } + + public const int BnetAccountFieldNumber = 3; + private bool hasBnetAccount; + private global::bnet.protocol.EntityId bnetAccount_; + public bool HasBnetAccount { + get { return hasBnetAccount; } + } + public global::bnet.protocol.EntityId BnetAccount { + get { return bnetAccount_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasPartitionId) return false; + if (!hasOrderId) return false; + if (!PartitionId.IsInitialized) return false; + if (HasBnetAccount) { + if (!BnetAccount.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getFeeDetailsRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[2], PartitionId); + } + if (hasOrderId) { + output.WriteUInt64(2, field_names[1], OrderId); + } + if (hasBnetAccount) { + output.WriteMessage(3, field_names[0], BnetAccount); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); + } + if (hasOrderId) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, OrderId); + } + if (hasBnetAccount) { + size += pb::CodedOutputStream.ComputeMessageSize(3, BnetAccount); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetFeeDetailsRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetFeeDetailsRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetFeeDetailsRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetFeeDetailsRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetFeeDetailsRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetFeeDetailsRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetFeeDetailsRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetFeeDetailsRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetFeeDetailsRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetFeeDetailsRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetFeeDetailsRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetFeeDetailsRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetFeeDetailsRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetFeeDetailsRequest result; + + private GetFeeDetailsRequest PrepareBuilder() { + if (resultIsReadOnly) { + GetFeeDetailsRequest original = result; + result = new GetFeeDetailsRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetFeeDetailsRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.GetFeeDetailsRequest.Descriptor; } + } + + public override GetFeeDetailsRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.GetFeeDetailsRequest.DefaultInstance; } + } + + public override GetFeeDetailsRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetFeeDetailsRequest) { + return MergeFrom((GetFeeDetailsRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetFeeDetailsRequest other) { + if (other == global::bnet.protocol.exchange.GetFeeDetailsRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasPartitionId) { + MergePartitionId(other.PartitionId); + } + if (other.HasOrderId) { + OrderId = other.OrderId; + } + if (other.HasBnetAccount) { + MergeBnetAccount(other.BnetAccount); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getFeeDetailsRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getFeeDetailsRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasPartitionId) { + subBuilder.MergeFrom(PartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + PartitionId = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasOrderId = input.ReadUInt64(ref result.orderId_); + break; + } + case 26: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasBnetAccount) { + subBuilder.MergeFrom(BnetAccount); + } + input.ReadMessage(subBuilder, extensionRegistry); + BnetAccount = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasPartitionId { + get { return result.hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = value; + return this; + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = builderForValue.Build(); + return this; + } + public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasPartitionId && + result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); + } else { + result.partitionId_ = value; + } + result.hasPartitionId = true; + return this; + } + public Builder ClearPartitionId() { + PrepareBuilder(); + result.hasPartitionId = false; + result.partitionId_ = null; + return this; + } + + public bool HasOrderId { + get { return result.hasOrderId; } + } + public ulong OrderId { + get { return result.OrderId; } + set { SetOrderId(value); } + } + public Builder SetOrderId(ulong value) { + PrepareBuilder(); + result.hasOrderId = true; + result.orderId_ = value; + return this; + } + public Builder ClearOrderId() { + PrepareBuilder(); + result.hasOrderId = false; + result.orderId_ = 0UL; + return this; + } + + public bool HasBnetAccount { + get { return result.hasBnetAccount; } + } + public global::bnet.protocol.EntityId BnetAccount { + get { return result.BnetAccount; } + set { SetBnetAccount(value); } + } + public Builder SetBnetAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBnetAccount = true; + result.bnetAccount_ = value; + return this; + } + public Builder SetBnetAccount(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBnetAccount = true; + result.bnetAccount_ = builderForValue.Build(); + return this; + } + public Builder MergeBnetAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBnetAccount && + result.bnetAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.bnetAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccount_).MergeFrom(value).BuildPartial(); + } else { + result.bnetAccount_ = value; + } + result.hasBnetAccount = true; + return this; + } + public Builder ClearBnetAccount() { + PrepareBuilder(); + result.hasBnetAccount = false; + result.bnetAccount_ = null; + return this; + } + } + static GetFeeDetailsRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetFeeDetailsResponse : pb::GeneratedMessage { + private GetFeeDetailsResponse() { } + private static readonly GetFeeDetailsResponse defaultInstance = new GetFeeDetailsResponse().MakeReadOnly(); + private static readonly string[] _getFeeDetailsResponseFieldNames = new string[] { "fee_details_in", "fee_details_out" }; + private static readonly uint[] _getFeeDetailsResponseFieldTags = new uint[] { 10, 18 }; + public static GetFeeDetailsResponse DefaultInstance { + get { return defaultInstance; } + } + + public override GetFeeDetailsResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetFeeDetailsResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetFeeDetailsResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetFeeDetailsResponse__FieldAccessorTable; } + } + + public const int FeeDetailsInFieldNumber = 1; + private pbc::PopsicleList feeDetailsIn_ = new pbc::PopsicleList(); + public scg::IList FeeDetailsInList { + get { return feeDetailsIn_; } + } + public int FeeDetailsInCount { + get { return feeDetailsIn_.Count; } + } + public global::bnet.protocol.exchange.FeeDetail GetFeeDetailsIn(int index) { + return feeDetailsIn_[index]; + } + + public const int FeeDetailsOutFieldNumber = 2; + private pbc::PopsicleList feeDetailsOut_ = new pbc::PopsicleList(); + public scg::IList FeeDetailsOutList { + get { return feeDetailsOut_; } + } + public int FeeDetailsOutCount { + get { return feeDetailsOut_.Count; } + } + public global::bnet.protocol.exchange.FeeDetail GetFeeDetailsOut(int index) { + return feeDetailsOut_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.exchange.FeeDetail element in FeeDetailsInList) { + if (!element.IsInitialized) return false; + } + foreach (global::bnet.protocol.exchange.FeeDetail element in FeeDetailsOutList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getFeeDetailsResponseFieldNames; + if (feeDetailsIn_.Count > 0) { + output.WriteMessageArray(1, field_names[0], feeDetailsIn_); + } + if (feeDetailsOut_.Count > 0) { + output.WriteMessageArray(2, field_names[1], feeDetailsOut_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.exchange.FeeDetail element in FeeDetailsInList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + foreach (global::bnet.protocol.exchange.FeeDetail element in FeeDetailsOutList) { + size += pb::CodedOutputStream.ComputeMessageSize(2, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetFeeDetailsResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetFeeDetailsResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetFeeDetailsResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetFeeDetailsResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetFeeDetailsResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetFeeDetailsResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetFeeDetailsResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetFeeDetailsResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetFeeDetailsResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetFeeDetailsResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetFeeDetailsResponse MakeReadOnly() { + feeDetailsIn_.MakeReadOnly(); + feeDetailsOut_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetFeeDetailsResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetFeeDetailsResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetFeeDetailsResponse result; + + private GetFeeDetailsResponse PrepareBuilder() { + if (resultIsReadOnly) { + GetFeeDetailsResponse original = result; + result = new GetFeeDetailsResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetFeeDetailsResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.GetFeeDetailsResponse.Descriptor; } + } + + public override GetFeeDetailsResponse DefaultInstanceForType { + get { return global::bnet.protocol.exchange.GetFeeDetailsResponse.DefaultInstance; } + } + + public override GetFeeDetailsResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetFeeDetailsResponse) { + return MergeFrom((GetFeeDetailsResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetFeeDetailsResponse other) { + if (other == global::bnet.protocol.exchange.GetFeeDetailsResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.feeDetailsIn_.Count != 0) { + result.feeDetailsIn_.Add(other.feeDetailsIn_); + } + if (other.feeDetailsOut_.Count != 0) { + result.feeDetailsOut_.Add(other.feeDetailsOut_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getFeeDetailsResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getFeeDetailsResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.feeDetailsIn_, global::bnet.protocol.exchange.FeeDetail.DefaultInstance, extensionRegistry); + break; + } + case 18: { + input.ReadMessageArray(tag, field_name, result.feeDetailsOut_, global::bnet.protocol.exchange.FeeDetail.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList FeeDetailsInList { + get { return PrepareBuilder().feeDetailsIn_; } + } + public int FeeDetailsInCount { + get { return result.FeeDetailsInCount; } + } + public global::bnet.protocol.exchange.FeeDetail GetFeeDetailsIn(int index) { + return result.GetFeeDetailsIn(index); + } + public Builder SetFeeDetailsIn(int index, global::bnet.protocol.exchange.FeeDetail value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.feeDetailsIn_[index] = value; + return this; + } + public Builder SetFeeDetailsIn(int index, global::bnet.protocol.exchange.FeeDetail.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.feeDetailsIn_[index] = builderForValue.Build(); + return this; + } + public Builder AddFeeDetailsIn(global::bnet.protocol.exchange.FeeDetail value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.feeDetailsIn_.Add(value); + return this; + } + public Builder AddFeeDetailsIn(global::bnet.protocol.exchange.FeeDetail.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.feeDetailsIn_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeFeeDetailsIn(scg::IEnumerable values) { + PrepareBuilder(); + result.feeDetailsIn_.Add(values); + return this; + } + public Builder ClearFeeDetailsIn() { + PrepareBuilder(); + result.feeDetailsIn_.Clear(); + return this; + } + + public pbc::IPopsicleList FeeDetailsOutList { + get { return PrepareBuilder().feeDetailsOut_; } + } + public int FeeDetailsOutCount { + get { return result.FeeDetailsOutCount; } + } + public global::bnet.protocol.exchange.FeeDetail GetFeeDetailsOut(int index) { + return result.GetFeeDetailsOut(index); + } + public Builder SetFeeDetailsOut(int index, global::bnet.protocol.exchange.FeeDetail value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.feeDetailsOut_[index] = value; + return this; + } + public Builder SetFeeDetailsOut(int index, global::bnet.protocol.exchange.FeeDetail.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.feeDetailsOut_[index] = builderForValue.Build(); + return this; + } + public Builder AddFeeDetailsOut(global::bnet.protocol.exchange.FeeDetail value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.feeDetailsOut_.Add(value); + return this; + } + public Builder AddFeeDetailsOut(global::bnet.protocol.exchange.FeeDetail.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.feeDetailsOut_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeFeeDetailsOut(scg::IEnumerable values) { + PrepareBuilder(); + result.feeDetailsOut_.Add(values); + return this; + } + public Builder ClearFeeDetailsOut() { + PrepareBuilder(); + result.feeDetailsOut_.Clear(); + return this; + } + } + static GetFeeDetailsResponse() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetOrderBookStatisticsRequest : pb::GeneratedMessage { + private GetOrderBookStatisticsRequest() { } + private static readonly GetOrderBookStatisticsRequest defaultInstance = new GetOrderBookStatisticsRequest().MakeReadOnly(); + private static readonly string[] _getOrderBookStatisticsRequestFieldNames = new string[] { "last_days", "last_trades", "order_type", "partition_id", "quantity" }; + private static readonly uint[] _getOrderBookStatisticsRequestFieldTags = new uint[] { 40, 32, 16, 10, 24 }; + public static GetOrderBookStatisticsRequest DefaultInstance { + get { return defaultInstance; } + } + + public override GetOrderBookStatisticsRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetOrderBookStatisticsRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetOrderBookStatisticsRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetOrderBookStatisticsRequest__FieldAccessorTable; } + } + + public const int PartitionIdFieldNumber = 1; + private bool hasPartitionId; + private global::bnet.protocol.exchange.PartitionId partitionId_; + public bool HasPartitionId { + get { return hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int OrderTypeFieldNumber = 2; + private bool hasOrderType; + private uint orderType_; + public bool HasOrderType { + get { return hasOrderType; } + } + public uint OrderType { + get { return orderType_; } + } + + public const int QuantityFieldNumber = 3; + private bool hasQuantity; + private ulong quantity_; + public bool HasQuantity { + get { return hasQuantity; } + } + public ulong Quantity { + get { return quantity_; } + } + + public const int LastTradesFieldNumber = 4; + private bool hasLastTrades; + private uint lastTrades_; + public bool HasLastTrades { + get { return hasLastTrades; } + } + public uint LastTrades { + get { return lastTrades_; } + } + + public const int LastDaysFieldNumber = 5; + private bool hasLastDays; + private uint lastDays_; + public bool HasLastDays { + get { return hasLastDays; } + } + public uint LastDays { + get { return lastDays_; } + } + + public override bool IsInitialized { + get { + if (!hasPartitionId) return false; + if (!hasOrderType) return false; + if (!hasQuantity) return false; + if (!hasLastTrades) return false; + if (!hasLastDays) return false; + if (!PartitionId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getOrderBookStatisticsRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[3], PartitionId); + } + if (hasOrderType) { + output.WriteUInt32(2, field_names[2], OrderType); + } + if (hasQuantity) { + output.WriteUInt64(3, field_names[4], Quantity); + } + if (hasLastTrades) { + output.WriteUInt32(4, field_names[1], LastTrades); + } + if (hasLastDays) { + output.WriteUInt32(5, field_names[0], LastDays); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); + } + if (hasOrderType) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, OrderType); + } + if (hasQuantity) { + size += pb::CodedOutputStream.ComputeUInt64Size(3, Quantity); + } + if (hasLastTrades) { + size += pb::CodedOutputStream.ComputeUInt32Size(4, LastTrades); + } + if (hasLastDays) { + size += pb::CodedOutputStream.ComputeUInt32Size(5, LastDays); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetOrderBookStatisticsRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetOrderBookStatisticsRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetOrderBookStatisticsRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetOrderBookStatisticsRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetOrderBookStatisticsRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetOrderBookStatisticsRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetOrderBookStatisticsRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetOrderBookStatisticsRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetOrderBookStatisticsRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetOrderBookStatisticsRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetOrderBookStatisticsRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetOrderBookStatisticsRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetOrderBookStatisticsRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetOrderBookStatisticsRequest result; + + private GetOrderBookStatisticsRequest PrepareBuilder() { + if (resultIsReadOnly) { + GetOrderBookStatisticsRequest original = result; + result = new GetOrderBookStatisticsRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetOrderBookStatisticsRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.GetOrderBookStatisticsRequest.Descriptor; } + } + + public override GetOrderBookStatisticsRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.GetOrderBookStatisticsRequest.DefaultInstance; } + } + + public override GetOrderBookStatisticsRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetOrderBookStatisticsRequest) { + return MergeFrom((GetOrderBookStatisticsRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetOrderBookStatisticsRequest other) { + if (other == global::bnet.protocol.exchange.GetOrderBookStatisticsRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasPartitionId) { + MergePartitionId(other.PartitionId); + } + if (other.HasOrderType) { + OrderType = other.OrderType; + } + if (other.HasQuantity) { + Quantity = other.Quantity; + } + if (other.HasLastTrades) { + LastTrades = other.LastTrades; + } + if (other.HasLastDays) { + LastDays = other.LastDays; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getOrderBookStatisticsRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getOrderBookStatisticsRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasPartitionId) { + subBuilder.MergeFrom(PartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + PartitionId = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasOrderType = input.ReadUInt32(ref result.orderType_); + break; + } + case 24: { + result.hasQuantity = input.ReadUInt64(ref result.quantity_); + break; + } + case 32: { + result.hasLastTrades = input.ReadUInt32(ref result.lastTrades_); + break; + } + case 40: { + result.hasLastDays = input.ReadUInt32(ref result.lastDays_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasPartitionId { + get { return result.hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = value; + return this; + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = builderForValue.Build(); + return this; + } + public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasPartitionId && + result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); + } else { + result.partitionId_ = value; + } + result.hasPartitionId = true; + return this; + } + public Builder ClearPartitionId() { + PrepareBuilder(); + result.hasPartitionId = false; + result.partitionId_ = null; + return this; + } + + public bool HasOrderType { + get { return result.hasOrderType; } + } + public uint OrderType { + get { return result.OrderType; } + set { SetOrderType(value); } + } + public Builder SetOrderType(uint value) { + PrepareBuilder(); + result.hasOrderType = true; + result.orderType_ = value; + return this; + } + public Builder ClearOrderType() { + PrepareBuilder(); + result.hasOrderType = false; + result.orderType_ = 0; + return this; + } + + public bool HasQuantity { + get { return result.hasQuantity; } + } + public ulong Quantity { + get { return result.Quantity; } + set { SetQuantity(value); } + } + public Builder SetQuantity(ulong value) { + PrepareBuilder(); + result.hasQuantity = true; + result.quantity_ = value; + return this; + } + public Builder ClearQuantity() { + PrepareBuilder(); + result.hasQuantity = false; + result.quantity_ = 0UL; + return this; + } + + public bool HasLastTrades { + get { return result.hasLastTrades; } + } + public uint LastTrades { + get { return result.LastTrades; } + set { SetLastTrades(value); } + } + public Builder SetLastTrades(uint value) { + PrepareBuilder(); + result.hasLastTrades = true; + result.lastTrades_ = value; + return this; + } + public Builder ClearLastTrades() { + PrepareBuilder(); + result.hasLastTrades = false; + result.lastTrades_ = 0; + return this; + } + + public bool HasLastDays { + get { return result.hasLastDays; } + } + public uint LastDays { + get { return result.LastDays; } + set { SetLastDays(value); } + } + public Builder SetLastDays(uint value) { + PrepareBuilder(); + result.hasLastDays = true; + result.lastDays_ = value; + return this; + } + public Builder ClearLastDays() { + PrepareBuilder(); + result.hasLastDays = false; + result.lastDays_ = 0; + return this; + } + } + static GetOrderBookStatisticsRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetOrderBookStatisticsResponse : pb::GeneratedMessage { + private GetOrderBookStatisticsResponse() { } + private static readonly GetOrderBookStatisticsResponse defaultInstance = new GetOrderBookStatisticsResponse().MakeReadOnly(); + private static readonly string[] _getOrderBookStatisticsResponseFieldNames = new string[] { "last_days_average", "last_trades_average", "price_details" }; + private static readonly uint[] _getOrderBookStatisticsResponseFieldTags = new uint[] { 24, 16, 10 }; + public static GetOrderBookStatisticsResponse DefaultInstance { + get { return defaultInstance; } + } + + public override GetOrderBookStatisticsResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetOrderBookStatisticsResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetOrderBookStatisticsResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetOrderBookStatisticsResponse__FieldAccessorTable; } + } + + public const int PriceDetailsFieldNumber = 1; + private pbc::PopsicleList priceDetails_ = new pbc::PopsicleList(); + public scg::IList PriceDetailsList { + get { return priceDetails_; } + } + public int PriceDetailsCount { + get { return priceDetails_.Count; } + } + public global::bnet.protocol.exchange.PriceDetail GetPriceDetails(int index) { + return priceDetails_[index]; + } + + public const int LastTradesAverageFieldNumber = 2; + private bool hasLastTradesAverage; + private ulong lastTradesAverage_; + public bool HasLastTradesAverage { + get { return hasLastTradesAverage; } + } + public ulong LastTradesAverage { + get { return lastTradesAverage_; } + } + + public const int LastDaysAverageFieldNumber = 3; + private bool hasLastDaysAverage; + private ulong lastDaysAverage_; + public bool HasLastDaysAverage { + get { return hasLastDaysAverage; } + } + public ulong LastDaysAverage { + get { return lastDaysAverage_; } + } + + public override bool IsInitialized { + get { + if (!hasLastTradesAverage) return false; + if (!hasLastDaysAverage) return false; + foreach (global::bnet.protocol.exchange.PriceDetail element in PriceDetailsList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getOrderBookStatisticsResponseFieldNames; + if (priceDetails_.Count > 0) { + output.WriteMessageArray(1, field_names[2], priceDetails_); + } + if (hasLastTradesAverage) { + output.WriteUInt64(2, field_names[1], LastTradesAverage); + } + if (hasLastDaysAverage) { + output.WriteUInt64(3, field_names[0], LastDaysAverage); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.exchange.PriceDetail element in PriceDetailsList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + if (hasLastTradesAverage) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, LastTradesAverage); + } + if (hasLastDaysAverage) { + size += pb::CodedOutputStream.ComputeUInt64Size(3, LastDaysAverage); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetOrderBookStatisticsResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetOrderBookStatisticsResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetOrderBookStatisticsResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetOrderBookStatisticsResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetOrderBookStatisticsResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetOrderBookStatisticsResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetOrderBookStatisticsResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetOrderBookStatisticsResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetOrderBookStatisticsResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetOrderBookStatisticsResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetOrderBookStatisticsResponse MakeReadOnly() { + priceDetails_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetOrderBookStatisticsResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetOrderBookStatisticsResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetOrderBookStatisticsResponse result; + + private GetOrderBookStatisticsResponse PrepareBuilder() { + if (resultIsReadOnly) { + GetOrderBookStatisticsResponse original = result; + result = new GetOrderBookStatisticsResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetOrderBookStatisticsResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.GetOrderBookStatisticsResponse.Descriptor; } + } + + public override GetOrderBookStatisticsResponse DefaultInstanceForType { + get { return global::bnet.protocol.exchange.GetOrderBookStatisticsResponse.DefaultInstance; } + } + + public override GetOrderBookStatisticsResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetOrderBookStatisticsResponse) { + return MergeFrom((GetOrderBookStatisticsResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetOrderBookStatisticsResponse other) { + if (other == global::bnet.protocol.exchange.GetOrderBookStatisticsResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.priceDetails_.Count != 0) { + result.priceDetails_.Add(other.priceDetails_); + } + if (other.HasLastTradesAverage) { + LastTradesAverage = other.LastTradesAverage; + } + if (other.HasLastDaysAverage) { + LastDaysAverage = other.LastDaysAverage; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getOrderBookStatisticsResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getOrderBookStatisticsResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.priceDetails_, global::bnet.protocol.exchange.PriceDetail.DefaultInstance, extensionRegistry); + break; + } + case 16: { + result.hasLastTradesAverage = input.ReadUInt64(ref result.lastTradesAverage_); + break; + } + case 24: { + result.hasLastDaysAverage = input.ReadUInt64(ref result.lastDaysAverage_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList PriceDetailsList { + get { return PrepareBuilder().priceDetails_; } + } + public int PriceDetailsCount { + get { return result.PriceDetailsCount; } + } + public global::bnet.protocol.exchange.PriceDetail GetPriceDetails(int index) { + return result.GetPriceDetails(index); + } + public Builder SetPriceDetails(int index, global::bnet.protocol.exchange.PriceDetail value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.priceDetails_[index] = value; + return this; + } + public Builder SetPriceDetails(int index, global::bnet.protocol.exchange.PriceDetail.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.priceDetails_[index] = builderForValue.Build(); + return this; + } + public Builder AddPriceDetails(global::bnet.protocol.exchange.PriceDetail value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.priceDetails_.Add(value); + return this; + } + public Builder AddPriceDetails(global::bnet.protocol.exchange.PriceDetail.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.priceDetails_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangePriceDetails(scg::IEnumerable values) { + PrepareBuilder(); + result.priceDetails_.Add(values); + return this; + } + public Builder ClearPriceDetails() { + PrepareBuilder(); + result.priceDetails_.Clear(); + return this; + } + + public bool HasLastTradesAverage { + get { return result.hasLastTradesAverage; } + } + public ulong LastTradesAverage { + get { return result.LastTradesAverage; } + set { SetLastTradesAverage(value); } + } + public Builder SetLastTradesAverage(ulong value) { + PrepareBuilder(); + result.hasLastTradesAverage = true; + result.lastTradesAverage_ = value; + return this; + } + public Builder ClearLastTradesAverage() { + PrepareBuilder(); + result.hasLastTradesAverage = false; + result.lastTradesAverage_ = 0UL; + return this; + } + + public bool HasLastDaysAverage { + get { return result.hasLastDaysAverage; } + } + public ulong LastDaysAverage { + get { return result.LastDaysAverage; } + set { SetLastDaysAverage(value); } + } + public Builder SetLastDaysAverage(ulong value) { + PrepareBuilder(); + result.hasLastDaysAverage = true; + result.lastDaysAverage_ = value; + return this; + } + public Builder ClearLastDaysAverage() { + PrepareBuilder(); + result.hasLastDaysAverage = false; + result.lastDaysAverage_ = 0UL; + return this; + } + } + static GetOrderBookStatisticsResponse() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetBidDetailsRequest : pb::GeneratedMessage { + private GetBidDetailsRequest() { } + private static readonly GetBidDetailsRequest defaultInstance = new GetBidDetailsRequest().MakeReadOnly(); + private static readonly string[] _getBidDetailsRequestFieldNames = new string[] { "order_id", "partition_id" }; + private static readonly uint[] _getBidDetailsRequestFieldTags = new uint[] { 8, 18 }; + public static GetBidDetailsRequest DefaultInstance { + get { return defaultInstance; } + } + + public override GetBidDetailsRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetBidDetailsRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetBidDetailsRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetBidDetailsRequest__FieldAccessorTable; } + } + + public const int OrderIdFieldNumber = 1; + private bool hasOrderId; + private ulong orderId_; + public bool HasOrderId { + get { return hasOrderId; } + } + public ulong OrderId { + get { return orderId_; } + } + + public const int PartitionIdFieldNumber = 2; + private bool hasPartitionId; + private global::bnet.protocol.exchange.PartitionId partitionId_; + public bool HasPartitionId { + get { return hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasOrderId) return false; + if (!hasPartitionId) return false; + if (!PartitionId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getBidDetailsRequestFieldNames; + if (hasOrderId) { + output.WriteUInt64(1, field_names[0], OrderId); + } + if (hasPartitionId) { + output.WriteMessage(2, field_names[1], PartitionId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasOrderId) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, OrderId); + } + if (hasPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, PartitionId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetBidDetailsRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetBidDetailsRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetBidDetailsRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetBidDetailsRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetBidDetailsRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetBidDetailsRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetBidDetailsRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetBidDetailsRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetBidDetailsRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetBidDetailsRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetBidDetailsRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetBidDetailsRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetBidDetailsRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetBidDetailsRequest result; + + private GetBidDetailsRequest PrepareBuilder() { + if (resultIsReadOnly) { + GetBidDetailsRequest original = result; + result = new GetBidDetailsRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetBidDetailsRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.GetBidDetailsRequest.Descriptor; } + } + + public override GetBidDetailsRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.GetBidDetailsRequest.DefaultInstance; } + } + + public override GetBidDetailsRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetBidDetailsRequest) { + return MergeFrom((GetBidDetailsRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetBidDetailsRequest other) { + if (other == global::bnet.protocol.exchange.GetBidDetailsRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasOrderId) { + OrderId = other.OrderId; + } + if (other.HasPartitionId) { + MergePartitionId(other.PartitionId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getBidDetailsRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getBidDetailsRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasOrderId = input.ReadUInt64(ref result.orderId_); + break; + } + case 18: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasPartitionId) { + subBuilder.MergeFrom(PartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + PartitionId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasOrderId { + get { return result.hasOrderId; } + } + public ulong OrderId { + get { return result.OrderId; } + set { SetOrderId(value); } + } + public Builder SetOrderId(ulong value) { + PrepareBuilder(); + result.hasOrderId = true; + result.orderId_ = value; + return this; + } + public Builder ClearOrderId() { + PrepareBuilder(); + result.hasOrderId = false; + result.orderId_ = 0UL; + return this; + } + + public bool HasPartitionId { + get { return result.hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = value; + return this; + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = builderForValue.Build(); + return this; + } + public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasPartitionId && + result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); + } else { + result.partitionId_ = value; + } + result.hasPartitionId = true; + return this; + } + public Builder ClearPartitionId() { + PrepareBuilder(); + result.hasPartitionId = false; + result.partitionId_ = null; + return this; + } + } + static GetBidDetailsRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetBidDetailsResponse : pb::GeneratedMessage { + private GetBidDetailsResponse() { } + private static readonly GetBidDetailsResponse defaultInstance = new GetBidDetailsResponse().MakeReadOnly(); + private static readonly string[] _getBidDetailsResponseFieldNames = new string[] { "bid" }; + private static readonly uint[] _getBidDetailsResponseFieldTags = new uint[] { 10 }; + public static GetBidDetailsResponse DefaultInstance { + get { return defaultInstance; } + } + + public override GetBidDetailsResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetBidDetailsResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetBidDetailsResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetBidDetailsResponse__FieldAccessorTable; } + } + + public const int BidFieldNumber = 1; + private bool hasBid; + private global::bnet.protocol.exchange.OrderExtended bid_; + public bool HasBid { + get { return hasBid; } + } + public global::bnet.protocol.exchange.OrderExtended Bid { + get { return bid_ ?? global::bnet.protocol.exchange.OrderExtended.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasBid) return false; + if (!Bid.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getBidDetailsResponseFieldNames; + if (hasBid) { + output.WriteMessage(1, field_names[0], Bid); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasBid) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Bid); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetBidDetailsResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetBidDetailsResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetBidDetailsResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetBidDetailsResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetBidDetailsResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetBidDetailsResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetBidDetailsResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetBidDetailsResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetBidDetailsResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetBidDetailsResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetBidDetailsResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetBidDetailsResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetBidDetailsResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetBidDetailsResponse result; + + private GetBidDetailsResponse PrepareBuilder() { + if (resultIsReadOnly) { + GetBidDetailsResponse original = result; + result = new GetBidDetailsResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetBidDetailsResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.GetBidDetailsResponse.Descriptor; } + } + + public override GetBidDetailsResponse DefaultInstanceForType { + get { return global::bnet.protocol.exchange.GetBidDetailsResponse.DefaultInstance; } + } + + public override GetBidDetailsResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetBidDetailsResponse) { + return MergeFrom((GetBidDetailsResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetBidDetailsResponse other) { + if (other == global::bnet.protocol.exchange.GetBidDetailsResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasBid) { + MergeBid(other.Bid); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getBidDetailsResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getBidDetailsResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.OrderExtended.Builder subBuilder = global::bnet.protocol.exchange.OrderExtended.CreateBuilder(); + if (result.hasBid) { + subBuilder.MergeFrom(Bid); + } + input.ReadMessage(subBuilder, extensionRegistry); + Bid = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasBid { + get { return result.hasBid; } + } + public global::bnet.protocol.exchange.OrderExtended Bid { + get { return result.Bid; } + set { SetBid(value); } + } + public Builder SetBid(global::bnet.protocol.exchange.OrderExtended value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBid = true; + result.bid_ = value; + return this; + } + public Builder SetBid(global::bnet.protocol.exchange.OrderExtended.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBid = true; + result.bid_ = builderForValue.Build(); + return this; + } + public Builder MergeBid(global::bnet.protocol.exchange.OrderExtended value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBid && + result.bid_ != global::bnet.protocol.exchange.OrderExtended.DefaultInstance) { + result.bid_ = global::bnet.protocol.exchange.OrderExtended.CreateBuilder(result.bid_).MergeFrom(value).BuildPartial(); + } else { + result.bid_ = value; + } + result.hasBid = true; + return this; + } + public Builder ClearBid() { + PrepareBuilder(); + result.hasBid = false; + result.bid_ = null; + return this; + } + } + static GetBidDetailsResponse() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetOfferDetailsRequest : pb::GeneratedMessage { + private GetOfferDetailsRequest() { } + private static readonly GetOfferDetailsRequest defaultInstance = new GetOfferDetailsRequest().MakeReadOnly(); + private static readonly string[] _getOfferDetailsRequestFieldNames = new string[] { "order_id", "partition_id" }; + private static readonly uint[] _getOfferDetailsRequestFieldTags = new uint[] { 8, 18 }; + public static GetOfferDetailsRequest DefaultInstance { + get { return defaultInstance; } + } + + public override GetOfferDetailsRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetOfferDetailsRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetOfferDetailsRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetOfferDetailsRequest__FieldAccessorTable; } + } + + public const int OrderIdFieldNumber = 1; + private bool hasOrderId; + private ulong orderId_; + public bool HasOrderId { + get { return hasOrderId; } + } + public ulong OrderId { + get { return orderId_; } + } + + public const int PartitionIdFieldNumber = 2; + private bool hasPartitionId; + private global::bnet.protocol.exchange.PartitionId partitionId_; + public bool HasPartitionId { + get { return hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasOrderId) return false; + if (!hasPartitionId) return false; + if (!PartitionId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getOfferDetailsRequestFieldNames; + if (hasOrderId) { + output.WriteUInt64(1, field_names[0], OrderId); + } + if (hasPartitionId) { + output.WriteMessage(2, field_names[1], PartitionId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasOrderId) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, OrderId); + } + if (hasPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, PartitionId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetOfferDetailsRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetOfferDetailsRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetOfferDetailsRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetOfferDetailsRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetOfferDetailsRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetOfferDetailsRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetOfferDetailsRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetOfferDetailsRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetOfferDetailsRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetOfferDetailsRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetOfferDetailsRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetOfferDetailsRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetOfferDetailsRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetOfferDetailsRequest result; + + private GetOfferDetailsRequest PrepareBuilder() { + if (resultIsReadOnly) { + GetOfferDetailsRequest original = result; + result = new GetOfferDetailsRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetOfferDetailsRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.GetOfferDetailsRequest.Descriptor; } + } + + public override GetOfferDetailsRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.GetOfferDetailsRequest.DefaultInstance; } + } + + public override GetOfferDetailsRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetOfferDetailsRequest) { + return MergeFrom((GetOfferDetailsRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetOfferDetailsRequest other) { + if (other == global::bnet.protocol.exchange.GetOfferDetailsRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasOrderId) { + OrderId = other.OrderId; + } + if (other.HasPartitionId) { + MergePartitionId(other.PartitionId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getOfferDetailsRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getOfferDetailsRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasOrderId = input.ReadUInt64(ref result.orderId_); + break; + } + case 18: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasPartitionId) { + subBuilder.MergeFrom(PartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + PartitionId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasOrderId { + get { return result.hasOrderId; } + } + public ulong OrderId { + get { return result.OrderId; } + set { SetOrderId(value); } + } + public Builder SetOrderId(ulong value) { + PrepareBuilder(); + result.hasOrderId = true; + result.orderId_ = value; + return this; + } + public Builder ClearOrderId() { + PrepareBuilder(); + result.hasOrderId = false; + result.orderId_ = 0UL; + return this; + } + + public bool HasPartitionId { + get { return result.hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = value; + return this; + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = builderForValue.Build(); + return this; + } + public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasPartitionId && + result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); + } else { + result.partitionId_ = value; + } + result.hasPartitionId = true; + return this; + } + public Builder ClearPartitionId() { + PrepareBuilder(); + result.hasPartitionId = false; + result.partitionId_ = null; + return this; + } + } + static GetOfferDetailsRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetOfferDetailsResponse : pb::GeneratedMessage { + private GetOfferDetailsResponse() { } + private static readonly GetOfferDetailsResponse defaultInstance = new GetOfferDetailsResponse().MakeReadOnly(); + private static readonly string[] _getOfferDetailsResponseFieldNames = new string[] { "offer" }; + private static readonly uint[] _getOfferDetailsResponseFieldTags = new uint[] { 10 }; + public static GetOfferDetailsResponse DefaultInstance { + get { return defaultInstance; } + } + + public override GetOfferDetailsResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetOfferDetailsResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetOfferDetailsResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetOfferDetailsResponse__FieldAccessorTable; } + } + + public const int OfferFieldNumber = 1; + private bool hasOffer; + private global::bnet.protocol.exchange.OrderExtended offer_; + public bool HasOffer { + get { return hasOffer; } + } + public global::bnet.protocol.exchange.OrderExtended Offer { + get { return offer_ ?? global::bnet.protocol.exchange.OrderExtended.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasOffer) return false; + if (!Offer.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getOfferDetailsResponseFieldNames; + if (hasOffer) { + output.WriteMessage(1, field_names[0], Offer); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasOffer) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Offer); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetOfferDetailsResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetOfferDetailsResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetOfferDetailsResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetOfferDetailsResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetOfferDetailsResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetOfferDetailsResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetOfferDetailsResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetOfferDetailsResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetOfferDetailsResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetOfferDetailsResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetOfferDetailsResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetOfferDetailsResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetOfferDetailsResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetOfferDetailsResponse result; + + private GetOfferDetailsResponse PrepareBuilder() { + if (resultIsReadOnly) { + GetOfferDetailsResponse original = result; + result = new GetOfferDetailsResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetOfferDetailsResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.GetOfferDetailsResponse.Descriptor; } + } + + public override GetOfferDetailsResponse DefaultInstanceForType { + get { return global::bnet.protocol.exchange.GetOfferDetailsResponse.DefaultInstance; } + } + + public override GetOfferDetailsResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetOfferDetailsResponse) { + return MergeFrom((GetOfferDetailsResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetOfferDetailsResponse other) { + if (other == global::bnet.protocol.exchange.GetOfferDetailsResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasOffer) { + MergeOffer(other.Offer); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getOfferDetailsResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getOfferDetailsResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.OrderExtended.Builder subBuilder = global::bnet.protocol.exchange.OrderExtended.CreateBuilder(); + if (result.hasOffer) { + subBuilder.MergeFrom(Offer); + } + input.ReadMessage(subBuilder, extensionRegistry); + Offer = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasOffer { + get { return result.hasOffer; } + } + public global::bnet.protocol.exchange.OrderExtended Offer { + get { return result.Offer; } + set { SetOffer(value); } + } + public Builder SetOffer(global::bnet.protocol.exchange.OrderExtended value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOffer = true; + result.offer_ = value; + return this; + } + public Builder SetOffer(global::bnet.protocol.exchange.OrderExtended.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOffer = true; + result.offer_ = builderForValue.Build(); + return this; + } + public Builder MergeOffer(global::bnet.protocol.exchange.OrderExtended value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOffer && + result.offer_ != global::bnet.protocol.exchange.OrderExtended.DefaultInstance) { + result.offer_ = global::bnet.protocol.exchange.OrderExtended.CreateBuilder(result.offer_).MergeFrom(value).BuildPartial(); + } else { + result.offer_ = value; + } + result.hasOffer = true; + return this; + } + public Builder ClearOffer() { + PrepareBuilder(); + result.hasOffer = false; + result.offer_ = null; + return this; + } + } + static GetOfferDetailsResponse() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetSystemTimeResponse : pb::GeneratedMessage { + private GetSystemTimeResponse() { } + private static readonly GetSystemTimeResponse defaultInstance = new GetSystemTimeResponse().MakeReadOnly(); + private static readonly string[] _getSystemTimeResponseFieldNames = new string[] { "time" }; + private static readonly uint[] _getSystemTimeResponseFieldTags = new uint[] { 8 }; + public static GetSystemTimeResponse DefaultInstance { + get { return defaultInstance; } + } + + public override GetSystemTimeResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetSystemTimeResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetSystemTimeResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetSystemTimeResponse__FieldAccessorTable; } + } + + public const int TimeFieldNumber = 1; + private bool hasTime; + private ulong time_; + public bool HasTime { + get { return hasTime; } + } + public ulong Time { + get { return time_; } + } + + public override bool IsInitialized { + get { + if (!hasTime) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getSystemTimeResponseFieldNames; + if (hasTime) { + output.WriteUInt64(1, field_names[0], Time); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTime) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, Time); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetSystemTimeResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetSystemTimeResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetSystemTimeResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetSystemTimeResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetSystemTimeResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetSystemTimeResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetSystemTimeResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetSystemTimeResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetSystemTimeResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetSystemTimeResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetSystemTimeResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetSystemTimeResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetSystemTimeResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetSystemTimeResponse result; + + private GetSystemTimeResponse PrepareBuilder() { + if (resultIsReadOnly) { + GetSystemTimeResponse original = result; + result = new GetSystemTimeResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetSystemTimeResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.GetSystemTimeResponse.Descriptor; } + } + + public override GetSystemTimeResponse DefaultInstanceForType { + get { return global::bnet.protocol.exchange.GetSystemTimeResponse.DefaultInstance; } + } + + public override GetSystemTimeResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetSystemTimeResponse) { + return MergeFrom((GetSystemTimeResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetSystemTimeResponse other) { + if (other == global::bnet.protocol.exchange.GetSystemTimeResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTime) { + Time = other.Time; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getSystemTimeResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getSystemTimeResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasTime = input.ReadUInt64(ref result.time_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTime { + get { return result.hasTime; } + } + public ulong Time { + get { return result.Time; } + set { SetTime(value); } + } + public Builder SetTime(ulong value) { + PrepareBuilder(); + result.hasTime = true; + result.time_ = value; + return this; + } + public Builder ClearTime() { + PrepareBuilder(); + result.hasTime = false; + result.time_ = 0UL; + return this; + } + } + static GetSystemTimeResponse() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class CreateCSTradeRequest : pb::GeneratedMessage { + private CreateCSTradeRequest() { } + private static readonly CreateCSTradeRequest defaultInstance = new CreateCSTradeRequest().MakeReadOnly(); + private static readonly string[] _createCSTradeRequestFieldNames = new string[] { "account_for_item", "amount", "bnet_account", "cs_notes", "cs_user_id", "game_account", "order_book", "partition_id" }; + private static readonly uint[] _createCSTradeRequestFieldTags = new uint[] { 50, 24, 34, 58, 64, 42, 18, 10 }; + public static CreateCSTradeRequest DefaultInstance { + get { return defaultInstance; } + } + + public override CreateCSTradeRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override CreateCSTradeRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_CreateCSTradeRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_CreateCSTradeRequest__FieldAccessorTable; } + } + + public const int PartitionIdFieldNumber = 1; + private bool hasPartitionId; + private global::bnet.protocol.exchange.PartitionId partitionId_; + public bool HasPartitionId { + get { return hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int OrderBookFieldNumber = 2; + private bool hasOrderBook; + private global::bnet.protocol.exchange.OrderBook orderBook_; + public bool HasOrderBook { + get { return hasOrderBook; } + } + public global::bnet.protocol.exchange.OrderBook OrderBook { + get { return orderBook_ ?? global::bnet.protocol.exchange.OrderBook.DefaultInstance; } + } + + public const int AmountFieldNumber = 3; + private bool hasAmount; + private uint amount_; + public bool HasAmount { + get { return hasAmount; } + } + public uint Amount { + get { return amount_; } + } + + public const int BnetAccountFieldNumber = 4; + private bool hasBnetAccount; + private global::bnet.protocol.EntityId bnetAccount_; + public bool HasBnetAccount { + get { return hasBnetAccount; } + } + public global::bnet.protocol.EntityId BnetAccount { + get { return bnetAccount_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int GameAccountFieldNumber = 5; + private bool hasGameAccount; + private global::bnet.protocol.EntityId gameAccount_; + public bool HasGameAccount { + get { return hasGameAccount; } + } + public global::bnet.protocol.EntityId GameAccount { + get { return gameAccount_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int AccountForItemFieldNumber = 6; + private bool hasAccountForItem; + private global::bnet.protocol.exchange.BlobFrom accountForItem_; + public bool HasAccountForItem { + get { return hasAccountForItem; } + } + public global::bnet.protocol.exchange.BlobFrom AccountForItem { + get { return accountForItem_ ?? global::bnet.protocol.exchange.BlobFrom.DefaultInstance; } + } + + public const int CsNotesFieldNumber = 7; + private bool hasCsNotes; + private string csNotes_ = ""; + public bool HasCsNotes { + get { return hasCsNotes; } + } + public string CsNotes { + get { return csNotes_; } + } + + public const int CsUserIdFieldNumber = 8; + private bool hasCsUserId; + private ulong csUserId_; + public bool HasCsUserId { + get { return hasCsUserId; } + } + public ulong CsUserId { + get { return csUserId_; } + } + + public override bool IsInitialized { + get { + if (!hasOrderBook) return false; + if (!hasAmount) return false; + if (!hasBnetAccount) return false; + if (!hasAccountForItem) return false; + if (!hasCsNotes) return false; + if (!hasCsUserId) return false; + if (HasPartitionId) { + if (!PartitionId.IsInitialized) return false; + } + if (!OrderBook.IsInitialized) return false; + if (!BnetAccount.IsInitialized) return false; + if (HasGameAccount) { + if (!GameAccount.IsInitialized) return false; + } + if (!AccountForItem.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _createCSTradeRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[7], PartitionId); + } + if (hasOrderBook) { + output.WriteMessage(2, field_names[6], OrderBook); + } + if (hasAmount) { + output.WriteUInt32(3, field_names[1], Amount); + } + if (hasBnetAccount) { + output.WriteMessage(4, field_names[2], BnetAccount); + } + if (hasGameAccount) { + output.WriteMessage(5, field_names[5], GameAccount); + } + if (hasAccountForItem) { + output.WriteMessage(6, field_names[0], AccountForItem); + } + if (hasCsNotes) { + output.WriteString(7, field_names[3], CsNotes); + } + if (hasCsUserId) { + output.WriteUInt64(8, field_names[4], CsUserId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); + } + if (hasOrderBook) { + size += pb::CodedOutputStream.ComputeMessageSize(2, OrderBook); + } + if (hasAmount) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, Amount); + } + if (hasBnetAccount) { + size += pb::CodedOutputStream.ComputeMessageSize(4, BnetAccount); + } + if (hasGameAccount) { + size += pb::CodedOutputStream.ComputeMessageSize(5, GameAccount); + } + if (hasAccountForItem) { + size += pb::CodedOutputStream.ComputeMessageSize(6, AccountForItem); + } + if (hasCsNotes) { + size += pb::CodedOutputStream.ComputeStringSize(7, CsNotes); + } + if (hasCsUserId) { + size += pb::CodedOutputStream.ComputeUInt64Size(8, CsUserId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static CreateCSTradeRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CreateCSTradeRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CreateCSTradeRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CreateCSTradeRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CreateCSTradeRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CreateCSTradeRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static CreateCSTradeRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static CreateCSTradeRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static CreateCSTradeRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CreateCSTradeRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CreateCSTradeRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(CreateCSTradeRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CreateCSTradeRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CreateCSTradeRequest result; + + private CreateCSTradeRequest PrepareBuilder() { + if (resultIsReadOnly) { + CreateCSTradeRequest original = result; + result = new CreateCSTradeRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CreateCSTradeRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.CreateCSTradeRequest.Descriptor; } + } + + public override CreateCSTradeRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.CreateCSTradeRequest.DefaultInstance; } + } + + public override CreateCSTradeRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is CreateCSTradeRequest) { + return MergeFrom((CreateCSTradeRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(CreateCSTradeRequest other) { + if (other == global::bnet.protocol.exchange.CreateCSTradeRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasPartitionId) { + MergePartitionId(other.PartitionId); + } + if (other.HasOrderBook) { + MergeOrderBook(other.OrderBook); + } + if (other.HasAmount) { + Amount = other.Amount; + } + if (other.HasBnetAccount) { + MergeBnetAccount(other.BnetAccount); + } + if (other.HasGameAccount) { + MergeGameAccount(other.GameAccount); + } + if (other.HasAccountForItem) { + MergeAccountForItem(other.AccountForItem); + } + if (other.HasCsNotes) { + CsNotes = other.CsNotes; + } + if (other.HasCsUserId) { + CsUserId = other.CsUserId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_createCSTradeRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _createCSTradeRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasPartitionId) { + subBuilder.MergeFrom(PartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + PartitionId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.exchange.OrderBook.Builder subBuilder = global::bnet.protocol.exchange.OrderBook.CreateBuilder(); + if (result.hasOrderBook) { + subBuilder.MergeFrom(OrderBook); + } + input.ReadMessage(subBuilder, extensionRegistry); + OrderBook = subBuilder.BuildPartial(); + break; + } + case 24: { + result.hasAmount = input.ReadUInt32(ref result.amount_); + break; + } + case 34: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasBnetAccount) { + subBuilder.MergeFrom(BnetAccount); + } + input.ReadMessage(subBuilder, extensionRegistry); + BnetAccount = subBuilder.BuildPartial(); + break; + } + case 42: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasGameAccount) { + subBuilder.MergeFrom(GameAccount); + } + input.ReadMessage(subBuilder, extensionRegistry); + GameAccount = subBuilder.BuildPartial(); + break; + } + case 50: { + global::bnet.protocol.exchange.BlobFrom.Builder subBuilder = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(); + if (result.hasAccountForItem) { + subBuilder.MergeFrom(AccountForItem); + } + input.ReadMessage(subBuilder, extensionRegistry); + AccountForItem = subBuilder.BuildPartial(); + break; + } + case 58: { + result.hasCsNotes = input.ReadString(ref result.csNotes_); + break; + } + case 64: { + result.hasCsUserId = input.ReadUInt64(ref result.csUserId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasPartitionId { + get { return result.hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = value; + return this; + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = builderForValue.Build(); + return this; + } + public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasPartitionId && + result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); + } else { + result.partitionId_ = value; + } + result.hasPartitionId = true; + return this; + } + public Builder ClearPartitionId() { + PrepareBuilder(); + result.hasPartitionId = false; + result.partitionId_ = null; + return this; + } + + public bool HasOrderBook { + get { return result.hasOrderBook; } + } + public global::bnet.protocol.exchange.OrderBook OrderBook { + get { return result.OrderBook; } + set { SetOrderBook(value); } + } + public Builder SetOrderBook(global::bnet.protocol.exchange.OrderBook value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOrderBook = true; + result.orderBook_ = value; + return this; + } + public Builder SetOrderBook(global::bnet.protocol.exchange.OrderBook.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOrderBook = true; + result.orderBook_ = builderForValue.Build(); + return this; + } + public Builder MergeOrderBook(global::bnet.protocol.exchange.OrderBook value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOrderBook && + result.orderBook_ != global::bnet.protocol.exchange.OrderBook.DefaultInstance) { + result.orderBook_ = global::bnet.protocol.exchange.OrderBook.CreateBuilder(result.orderBook_).MergeFrom(value).BuildPartial(); + } else { + result.orderBook_ = value; + } + result.hasOrderBook = true; + return this; + } + public Builder ClearOrderBook() { + PrepareBuilder(); + result.hasOrderBook = false; + result.orderBook_ = null; + return this; + } + + public bool HasAmount { + get { return result.hasAmount; } + } + public uint Amount { + get { return result.Amount; } + set { SetAmount(value); } + } + public Builder SetAmount(uint value) { + PrepareBuilder(); + result.hasAmount = true; + result.amount_ = value; + return this; + } + public Builder ClearAmount() { + PrepareBuilder(); + result.hasAmount = false; + result.amount_ = 0; + return this; + } + + public bool HasBnetAccount { + get { return result.hasBnetAccount; } + } + public global::bnet.protocol.EntityId BnetAccount { + get { return result.BnetAccount; } + set { SetBnetAccount(value); } + } + public Builder SetBnetAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBnetAccount = true; + result.bnetAccount_ = value; + return this; + } + public Builder SetBnetAccount(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBnetAccount = true; + result.bnetAccount_ = builderForValue.Build(); + return this; + } + public Builder MergeBnetAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBnetAccount && + result.bnetAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.bnetAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccount_).MergeFrom(value).BuildPartial(); + } else { + result.bnetAccount_ = value; + } + result.hasBnetAccount = true; + return this; + } + public Builder ClearBnetAccount() { + PrepareBuilder(); + result.hasBnetAccount = false; + result.bnetAccount_ = null; + return this; + } + + public bool HasGameAccount { + get { return result.hasGameAccount; } + } + public global::bnet.protocol.EntityId GameAccount { + get { return result.GameAccount; } + set { SetGameAccount(value); } + } + public Builder SetGameAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasGameAccount = true; + result.gameAccount_ = value; + return this; + } + public Builder SetGameAccount(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasGameAccount = true; + result.gameAccount_ = builderForValue.Build(); + return this; + } + public Builder MergeGameAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasGameAccount && + result.gameAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.gameAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccount_).MergeFrom(value).BuildPartial(); + } else { + result.gameAccount_ = value; + } + result.hasGameAccount = true; + return this; + } + public Builder ClearGameAccount() { + PrepareBuilder(); + result.hasGameAccount = false; + result.gameAccount_ = null; + return this; + } + + public bool HasAccountForItem { + get { return result.hasAccountForItem; } + } + public global::bnet.protocol.exchange.BlobFrom AccountForItem { + get { return result.AccountForItem; } + set { SetAccountForItem(value); } + } + public Builder SetAccountForItem(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccountForItem = true; + result.accountForItem_ = value; + return this; + } + public Builder SetAccountForItem(global::bnet.protocol.exchange.BlobFrom.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccountForItem = true; + result.accountForItem_ = builderForValue.Build(); + return this; + } + public Builder MergeAccountForItem(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccountForItem && + result.accountForItem_ != global::bnet.protocol.exchange.BlobFrom.DefaultInstance) { + result.accountForItem_ = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(result.accountForItem_).MergeFrom(value).BuildPartial(); + } else { + result.accountForItem_ = value; + } + result.hasAccountForItem = true; + return this; + } + public Builder ClearAccountForItem() { + PrepareBuilder(); + result.hasAccountForItem = false; + result.accountForItem_ = null; + return this; + } + + public bool HasCsNotes { + get { return result.hasCsNotes; } + } + public string CsNotes { + get { return result.CsNotes; } + set { SetCsNotes(value); } + } + public Builder SetCsNotes(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasCsNotes = true; + result.csNotes_ = value; + return this; + } + public Builder ClearCsNotes() { + PrepareBuilder(); + result.hasCsNotes = false; + result.csNotes_ = ""; + return this; + } + + public bool HasCsUserId { + get { return result.hasCsUserId; } + } + public ulong CsUserId { + get { return result.CsUserId; } + set { SetCsUserId(value); } + } + public Builder SetCsUserId(ulong value) { + PrepareBuilder(); + result.hasCsUserId = true; + result.csUserId_ = value; + return this; + } + public Builder ClearCsUserId() { + PrepareBuilder(); + result.hasCsUserId = false; + result.csUserId_ = 0UL; + return this; + } + } + static CreateCSTradeRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class CreateCSTradeItemRequest : pb::GeneratedMessage { + private CreateCSTradeItemRequest() { } + private static readonly CreateCSTradeItemRequest defaultInstance = new CreateCSTradeItemRequest().MakeReadOnly(); + private static readonly string[] _createCSTradeItemRequestFieldNames = new string[] { "account_for_item", "amount", "bnet_account", "cs_notes", "cs_user_id", "game_account", "order_book", "partition_id" }; + private static readonly uint[] _createCSTradeItemRequestFieldTags = new uint[] { 50, 24, 34, 58, 64, 42, 18, 10 }; + public static CreateCSTradeItemRequest DefaultInstance { + get { return defaultInstance; } + } + + public override CreateCSTradeItemRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override CreateCSTradeItemRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_CreateCSTradeItemRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_CreateCSTradeItemRequest__FieldAccessorTable; } + } + + public const int PartitionIdFieldNumber = 1; + private bool hasPartitionId; + private global::bnet.protocol.exchange.PartitionId partitionId_; + public bool HasPartitionId { + get { return hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int OrderBookFieldNumber = 2; + private bool hasOrderBook; + private global::bnet.protocol.exchange.OrderBook orderBook_; + public bool HasOrderBook { + get { return hasOrderBook; } + } + public global::bnet.protocol.exchange.OrderBook OrderBook { + get { return orderBook_ ?? global::bnet.protocol.exchange.OrderBook.DefaultInstance; } + } + + public const int AmountFieldNumber = 3; + private bool hasAmount; + private uint amount_; + public bool HasAmount { + get { return hasAmount; } + } + public uint Amount { + get { return amount_; } + } + + public const int BnetAccountFieldNumber = 4; + private bool hasBnetAccount; + private global::bnet.protocol.EntityId bnetAccount_; + public bool HasBnetAccount { + get { return hasBnetAccount; } + } + public global::bnet.protocol.EntityId BnetAccount { + get { return bnetAccount_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int GameAccountFieldNumber = 5; + private bool hasGameAccount; + private global::bnet.protocol.EntityId gameAccount_; + public bool HasGameAccount { + get { return hasGameAccount; } + } + public global::bnet.protocol.EntityId GameAccount { + get { return gameAccount_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int AccountForItemFieldNumber = 6; + private bool hasAccountForItem; + private global::bnet.protocol.exchange.BlobFrom accountForItem_; + public bool HasAccountForItem { + get { return hasAccountForItem; } + } + public global::bnet.protocol.exchange.BlobFrom AccountForItem { + get { return accountForItem_ ?? global::bnet.protocol.exchange.BlobFrom.DefaultInstance; } + } + + public const int CsNotesFieldNumber = 7; + private bool hasCsNotes; + private string csNotes_ = ""; + public bool HasCsNotes { + get { return hasCsNotes; } + } + public string CsNotes { + get { return csNotes_; } + } + + public const int CsUserIdFieldNumber = 8; + private bool hasCsUserId; + private ulong csUserId_; + public bool HasCsUserId { + get { return hasCsUserId; } + } + public ulong CsUserId { + get { return csUserId_; } + } + + public override bool IsInitialized { + get { + if (!hasOrderBook) return false; + if (!hasAmount) return false; + if (!hasBnetAccount) return false; + if (!hasAccountForItem) return false; + if (!hasCsNotes) return false; + if (!hasCsUserId) return false; + if (HasPartitionId) { + if (!PartitionId.IsInitialized) return false; + } + if (!OrderBook.IsInitialized) return false; + if (!BnetAccount.IsInitialized) return false; + if (HasGameAccount) { + if (!GameAccount.IsInitialized) return false; + } + if (!AccountForItem.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _createCSTradeItemRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[7], PartitionId); + } + if (hasOrderBook) { + output.WriteMessage(2, field_names[6], OrderBook); + } + if (hasAmount) { + output.WriteUInt32(3, field_names[1], Amount); + } + if (hasBnetAccount) { + output.WriteMessage(4, field_names[2], BnetAccount); + } + if (hasGameAccount) { + output.WriteMessage(5, field_names[5], GameAccount); + } + if (hasAccountForItem) { + output.WriteMessage(6, field_names[0], AccountForItem); + } + if (hasCsNotes) { + output.WriteString(7, field_names[3], CsNotes); + } + if (hasCsUserId) { + output.WriteUInt64(8, field_names[4], CsUserId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); + } + if (hasOrderBook) { + size += pb::CodedOutputStream.ComputeMessageSize(2, OrderBook); + } + if (hasAmount) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, Amount); + } + if (hasBnetAccount) { + size += pb::CodedOutputStream.ComputeMessageSize(4, BnetAccount); + } + if (hasGameAccount) { + size += pb::CodedOutputStream.ComputeMessageSize(5, GameAccount); + } + if (hasAccountForItem) { + size += pb::CodedOutputStream.ComputeMessageSize(6, AccountForItem); + } + if (hasCsNotes) { + size += pb::CodedOutputStream.ComputeStringSize(7, CsNotes); + } + if (hasCsUserId) { + size += pb::CodedOutputStream.ComputeUInt64Size(8, CsUserId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static CreateCSTradeItemRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CreateCSTradeItemRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CreateCSTradeItemRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CreateCSTradeItemRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CreateCSTradeItemRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CreateCSTradeItemRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static CreateCSTradeItemRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static CreateCSTradeItemRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static CreateCSTradeItemRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CreateCSTradeItemRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CreateCSTradeItemRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(CreateCSTradeItemRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CreateCSTradeItemRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CreateCSTradeItemRequest result; + + private CreateCSTradeItemRequest PrepareBuilder() { + if (resultIsReadOnly) { + CreateCSTradeItemRequest original = result; + result = new CreateCSTradeItemRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CreateCSTradeItemRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.CreateCSTradeItemRequest.Descriptor; } + } + + public override CreateCSTradeItemRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.CreateCSTradeItemRequest.DefaultInstance; } + } + + public override CreateCSTradeItemRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is CreateCSTradeItemRequest) { + return MergeFrom((CreateCSTradeItemRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(CreateCSTradeItemRequest other) { + if (other == global::bnet.protocol.exchange.CreateCSTradeItemRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasPartitionId) { + MergePartitionId(other.PartitionId); + } + if (other.HasOrderBook) { + MergeOrderBook(other.OrderBook); + } + if (other.HasAmount) { + Amount = other.Amount; + } + if (other.HasBnetAccount) { + MergeBnetAccount(other.BnetAccount); + } + if (other.HasGameAccount) { + MergeGameAccount(other.GameAccount); + } + if (other.HasAccountForItem) { + MergeAccountForItem(other.AccountForItem); + } + if (other.HasCsNotes) { + CsNotes = other.CsNotes; + } + if (other.HasCsUserId) { + CsUserId = other.CsUserId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_createCSTradeItemRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _createCSTradeItemRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasPartitionId) { + subBuilder.MergeFrom(PartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + PartitionId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.exchange.OrderBook.Builder subBuilder = global::bnet.protocol.exchange.OrderBook.CreateBuilder(); + if (result.hasOrderBook) { + subBuilder.MergeFrom(OrderBook); + } + input.ReadMessage(subBuilder, extensionRegistry); + OrderBook = subBuilder.BuildPartial(); + break; + } + case 24: { + result.hasAmount = input.ReadUInt32(ref result.amount_); + break; + } + case 34: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasBnetAccount) { + subBuilder.MergeFrom(BnetAccount); + } + input.ReadMessage(subBuilder, extensionRegistry); + BnetAccount = subBuilder.BuildPartial(); + break; + } + case 42: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasGameAccount) { + subBuilder.MergeFrom(GameAccount); + } + input.ReadMessage(subBuilder, extensionRegistry); + GameAccount = subBuilder.BuildPartial(); + break; + } + case 50: { + global::bnet.protocol.exchange.BlobFrom.Builder subBuilder = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(); + if (result.hasAccountForItem) { + subBuilder.MergeFrom(AccountForItem); + } + input.ReadMessage(subBuilder, extensionRegistry); + AccountForItem = subBuilder.BuildPartial(); + break; + } + case 58: { + result.hasCsNotes = input.ReadString(ref result.csNotes_); + break; + } + case 64: { + result.hasCsUserId = input.ReadUInt64(ref result.csUserId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasPartitionId { + get { return result.hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = value; + return this; + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = builderForValue.Build(); + return this; + } + public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasPartitionId && + result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); + } else { + result.partitionId_ = value; + } + result.hasPartitionId = true; + return this; + } + public Builder ClearPartitionId() { + PrepareBuilder(); + result.hasPartitionId = false; + result.partitionId_ = null; + return this; + } + + public bool HasOrderBook { + get { return result.hasOrderBook; } + } + public global::bnet.protocol.exchange.OrderBook OrderBook { + get { return result.OrderBook; } + set { SetOrderBook(value); } + } + public Builder SetOrderBook(global::bnet.protocol.exchange.OrderBook value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOrderBook = true; + result.orderBook_ = value; + return this; + } + public Builder SetOrderBook(global::bnet.protocol.exchange.OrderBook.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOrderBook = true; + result.orderBook_ = builderForValue.Build(); + return this; + } + public Builder MergeOrderBook(global::bnet.protocol.exchange.OrderBook value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOrderBook && + result.orderBook_ != global::bnet.protocol.exchange.OrderBook.DefaultInstance) { + result.orderBook_ = global::bnet.protocol.exchange.OrderBook.CreateBuilder(result.orderBook_).MergeFrom(value).BuildPartial(); + } else { + result.orderBook_ = value; + } + result.hasOrderBook = true; + return this; + } + public Builder ClearOrderBook() { + PrepareBuilder(); + result.hasOrderBook = false; + result.orderBook_ = null; + return this; + } + + public bool HasAmount { + get { return result.hasAmount; } + } + public uint Amount { + get { return result.Amount; } + set { SetAmount(value); } + } + public Builder SetAmount(uint value) { + PrepareBuilder(); + result.hasAmount = true; + result.amount_ = value; + return this; + } + public Builder ClearAmount() { + PrepareBuilder(); + result.hasAmount = false; + result.amount_ = 0; + return this; + } + + public bool HasBnetAccount { + get { return result.hasBnetAccount; } + } + public global::bnet.protocol.EntityId BnetAccount { + get { return result.BnetAccount; } + set { SetBnetAccount(value); } + } + public Builder SetBnetAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBnetAccount = true; + result.bnetAccount_ = value; + return this; + } + public Builder SetBnetAccount(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBnetAccount = true; + result.bnetAccount_ = builderForValue.Build(); + return this; + } + public Builder MergeBnetAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBnetAccount && + result.bnetAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.bnetAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccount_).MergeFrom(value).BuildPartial(); + } else { + result.bnetAccount_ = value; + } + result.hasBnetAccount = true; + return this; + } + public Builder ClearBnetAccount() { + PrepareBuilder(); + result.hasBnetAccount = false; + result.bnetAccount_ = null; + return this; + } + + public bool HasGameAccount { + get { return result.hasGameAccount; } + } + public global::bnet.protocol.EntityId GameAccount { + get { return result.GameAccount; } + set { SetGameAccount(value); } + } + public Builder SetGameAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasGameAccount = true; + result.gameAccount_ = value; + return this; + } + public Builder SetGameAccount(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasGameAccount = true; + result.gameAccount_ = builderForValue.Build(); + return this; + } + public Builder MergeGameAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasGameAccount && + result.gameAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.gameAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccount_).MergeFrom(value).BuildPartial(); + } else { + result.gameAccount_ = value; + } + result.hasGameAccount = true; + return this; + } + public Builder ClearGameAccount() { + PrepareBuilder(); + result.hasGameAccount = false; + result.gameAccount_ = null; + return this; + } + + public bool HasAccountForItem { + get { return result.hasAccountForItem; } + } + public global::bnet.protocol.exchange.BlobFrom AccountForItem { + get { return result.AccountForItem; } + set { SetAccountForItem(value); } + } + public Builder SetAccountForItem(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccountForItem = true; + result.accountForItem_ = value; + return this; + } + public Builder SetAccountForItem(global::bnet.protocol.exchange.BlobFrom.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccountForItem = true; + result.accountForItem_ = builderForValue.Build(); + return this; + } + public Builder MergeAccountForItem(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccountForItem && + result.accountForItem_ != global::bnet.protocol.exchange.BlobFrom.DefaultInstance) { + result.accountForItem_ = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(result.accountForItem_).MergeFrom(value).BuildPartial(); + } else { + result.accountForItem_ = value; + } + result.hasAccountForItem = true; + return this; + } + public Builder ClearAccountForItem() { + PrepareBuilder(); + result.hasAccountForItem = false; + result.accountForItem_ = null; + return this; + } + + public bool HasCsNotes { + get { return result.hasCsNotes; } + } + public string CsNotes { + get { return result.CsNotes; } + set { SetCsNotes(value); } + } + public Builder SetCsNotes(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasCsNotes = true; + result.csNotes_ = value; + return this; + } + public Builder ClearCsNotes() { + PrepareBuilder(); + result.hasCsNotes = false; + result.csNotes_ = ""; + return this; + } + + public bool HasCsUserId { + get { return result.hasCsUserId; } + } + public ulong CsUserId { + get { return result.CsUserId; } + set { SetCsUserId(value); } + } + public Builder SetCsUserId(ulong value) { + PrepareBuilder(); + result.hasCsUserId = true; + result.csUserId_ = value; + return this; + } + public Builder ClearCsUserId() { + PrepareBuilder(); + result.hasCsUserId = false; + result.csUserId_ = 0UL; + return this; + } + } + static CreateCSTradeItemRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class CreateCSTradeMoneyRequest : pb::GeneratedMessage { + private CreateCSTradeMoneyRequest() { } + private static readonly CreateCSTradeMoneyRequest defaultInstance = new CreateCSTradeMoneyRequest().MakeReadOnly(); + private static readonly string[] _createCSTradeMoneyRequestFieldNames = new string[] { "account_for_item", "account_for_money", "amount", "bnet_account", "cs_notes", "cs_user_id", "game_account", "order_book", "partition_id" }; + private static readonly uint[] _createCSTradeMoneyRequestFieldTags = new uint[] { 50, 74, 24, 34, 58, 64, 42, 18, 10 }; + public static CreateCSTradeMoneyRequest DefaultInstance { + get { return defaultInstance; } + } + + public override CreateCSTradeMoneyRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override CreateCSTradeMoneyRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_CreateCSTradeMoneyRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_CreateCSTradeMoneyRequest__FieldAccessorTable; } + } + + public const int PartitionIdFieldNumber = 1; + private bool hasPartitionId; + private global::bnet.protocol.exchange.PartitionId partitionId_; + public bool HasPartitionId { + get { return hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int OrderBookFieldNumber = 2; + private bool hasOrderBook; + private global::bnet.protocol.exchange.OrderBook orderBook_; + public bool HasOrderBook { + get { return hasOrderBook; } + } + public global::bnet.protocol.exchange.OrderBook OrderBook { + get { return orderBook_ ?? global::bnet.protocol.exchange.OrderBook.DefaultInstance; } + } + + public const int AmountFieldNumber = 3; + private bool hasAmount; + private uint amount_; + public bool HasAmount { + get { return hasAmount; } + } + public uint Amount { + get { return amount_; } + } + + public const int BnetAccountFieldNumber = 4; + private bool hasBnetAccount; + private global::bnet.protocol.EntityId bnetAccount_; + public bool HasBnetAccount { + get { return hasBnetAccount; } + } + public global::bnet.protocol.EntityId BnetAccount { + get { return bnetAccount_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int GameAccountFieldNumber = 5; + private bool hasGameAccount; + private global::bnet.protocol.EntityId gameAccount_; + public bool HasGameAccount { + get { return hasGameAccount; } + } + public global::bnet.protocol.EntityId GameAccount { + get { return gameAccount_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int AccountForItemFieldNumber = 6; + private bool hasAccountForItem; + private global::bnet.protocol.exchange.BlobFrom accountForItem_; + public bool HasAccountForItem { + get { return hasAccountForItem; } + } + public global::bnet.protocol.exchange.BlobFrom AccountForItem { + get { return accountForItem_ ?? global::bnet.protocol.exchange.BlobFrom.DefaultInstance; } + } + + public const int CsNotesFieldNumber = 7; + private bool hasCsNotes; + private string csNotes_ = ""; + public bool HasCsNotes { + get { return hasCsNotes; } + } + public string CsNotes { + get { return csNotes_; } + } + + public const int CsUserIdFieldNumber = 8; + private bool hasCsUserId; + private ulong csUserId_; + public bool HasCsUserId { + get { return hasCsUserId; } + } + public ulong CsUserId { + get { return csUserId_; } + } + + public const int AccountForMoneyFieldNumber = 9; + private bool hasAccountForMoney; + private global::bnet.protocol.exchange.BlobFrom accountForMoney_; + public bool HasAccountForMoney { + get { return hasAccountForMoney; } + } + public global::bnet.protocol.exchange.BlobFrom AccountForMoney { + get { return accountForMoney_ ?? global::bnet.protocol.exchange.BlobFrom.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasOrderBook) return false; + if (!hasAmount) return false; + if (!hasBnetAccount) return false; + if (!hasAccountForItem) return false; + if (!hasCsNotes) return false; + if (!hasCsUserId) return false; + if (HasPartitionId) { + if (!PartitionId.IsInitialized) return false; + } + if (!OrderBook.IsInitialized) return false; + if (!BnetAccount.IsInitialized) return false; + if (HasGameAccount) { + if (!GameAccount.IsInitialized) return false; + } + if (!AccountForItem.IsInitialized) return false; + if (HasAccountForMoney) { + if (!AccountForMoney.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _createCSTradeMoneyRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[8], PartitionId); + } + if (hasOrderBook) { + output.WriteMessage(2, field_names[7], OrderBook); + } + if (hasAmount) { + output.WriteUInt32(3, field_names[2], Amount); + } + if (hasBnetAccount) { + output.WriteMessage(4, field_names[3], BnetAccount); + } + if (hasGameAccount) { + output.WriteMessage(5, field_names[6], GameAccount); + } + if (hasAccountForItem) { + output.WriteMessage(6, field_names[0], AccountForItem); + } + if (hasCsNotes) { + output.WriteString(7, field_names[4], CsNotes); + } + if (hasCsUserId) { + output.WriteUInt64(8, field_names[5], CsUserId); + } + if (hasAccountForMoney) { + output.WriteMessage(9, field_names[1], AccountForMoney); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); + } + if (hasOrderBook) { + size += pb::CodedOutputStream.ComputeMessageSize(2, OrderBook); + } + if (hasAmount) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, Amount); + } + if (hasBnetAccount) { + size += pb::CodedOutputStream.ComputeMessageSize(4, BnetAccount); + } + if (hasGameAccount) { + size += pb::CodedOutputStream.ComputeMessageSize(5, GameAccount); + } + if (hasAccountForItem) { + size += pb::CodedOutputStream.ComputeMessageSize(6, AccountForItem); + } + if (hasCsNotes) { + size += pb::CodedOutputStream.ComputeStringSize(7, CsNotes); + } + if (hasCsUserId) { + size += pb::CodedOutputStream.ComputeUInt64Size(8, CsUserId); + } + if (hasAccountForMoney) { + size += pb::CodedOutputStream.ComputeMessageSize(9, AccountForMoney); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static CreateCSTradeMoneyRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CreateCSTradeMoneyRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CreateCSTradeMoneyRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CreateCSTradeMoneyRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CreateCSTradeMoneyRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CreateCSTradeMoneyRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static CreateCSTradeMoneyRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static CreateCSTradeMoneyRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static CreateCSTradeMoneyRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CreateCSTradeMoneyRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CreateCSTradeMoneyRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(CreateCSTradeMoneyRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CreateCSTradeMoneyRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CreateCSTradeMoneyRequest result; + + private CreateCSTradeMoneyRequest PrepareBuilder() { + if (resultIsReadOnly) { + CreateCSTradeMoneyRequest original = result; + result = new CreateCSTradeMoneyRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CreateCSTradeMoneyRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.CreateCSTradeMoneyRequest.Descriptor; } + } + + public override CreateCSTradeMoneyRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.CreateCSTradeMoneyRequest.DefaultInstance; } + } + + public override CreateCSTradeMoneyRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is CreateCSTradeMoneyRequest) { + return MergeFrom((CreateCSTradeMoneyRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(CreateCSTradeMoneyRequest other) { + if (other == global::bnet.protocol.exchange.CreateCSTradeMoneyRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasPartitionId) { + MergePartitionId(other.PartitionId); + } + if (other.HasOrderBook) { + MergeOrderBook(other.OrderBook); + } + if (other.HasAmount) { + Amount = other.Amount; + } + if (other.HasBnetAccount) { + MergeBnetAccount(other.BnetAccount); + } + if (other.HasGameAccount) { + MergeGameAccount(other.GameAccount); + } + if (other.HasAccountForItem) { + MergeAccountForItem(other.AccountForItem); + } + if (other.HasCsNotes) { + CsNotes = other.CsNotes; + } + if (other.HasCsUserId) { + CsUserId = other.CsUserId; + } + if (other.HasAccountForMoney) { + MergeAccountForMoney(other.AccountForMoney); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_createCSTradeMoneyRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _createCSTradeMoneyRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasPartitionId) { + subBuilder.MergeFrom(PartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + PartitionId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.exchange.OrderBook.Builder subBuilder = global::bnet.protocol.exchange.OrderBook.CreateBuilder(); + if (result.hasOrderBook) { + subBuilder.MergeFrom(OrderBook); + } + input.ReadMessage(subBuilder, extensionRegistry); + OrderBook = subBuilder.BuildPartial(); + break; + } + case 24: { + result.hasAmount = input.ReadUInt32(ref result.amount_); + break; + } + case 34: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasBnetAccount) { + subBuilder.MergeFrom(BnetAccount); + } + input.ReadMessage(subBuilder, extensionRegistry); + BnetAccount = subBuilder.BuildPartial(); + break; + } + case 42: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasGameAccount) { + subBuilder.MergeFrom(GameAccount); + } + input.ReadMessage(subBuilder, extensionRegistry); + GameAccount = subBuilder.BuildPartial(); + break; + } + case 50: { + global::bnet.protocol.exchange.BlobFrom.Builder subBuilder = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(); + if (result.hasAccountForItem) { + subBuilder.MergeFrom(AccountForItem); + } + input.ReadMessage(subBuilder, extensionRegistry); + AccountForItem = subBuilder.BuildPartial(); + break; + } + case 58: { + result.hasCsNotes = input.ReadString(ref result.csNotes_); + break; + } + case 64: { + result.hasCsUserId = input.ReadUInt64(ref result.csUserId_); + break; + } + case 74: { + global::bnet.protocol.exchange.BlobFrom.Builder subBuilder = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(); + if (result.hasAccountForMoney) { + subBuilder.MergeFrom(AccountForMoney); + } + input.ReadMessage(subBuilder, extensionRegistry); + AccountForMoney = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasPartitionId { + get { return result.hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = value; + return this; + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = builderForValue.Build(); + return this; + } + public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasPartitionId && + result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); + } else { + result.partitionId_ = value; + } + result.hasPartitionId = true; + return this; + } + public Builder ClearPartitionId() { + PrepareBuilder(); + result.hasPartitionId = false; + result.partitionId_ = null; + return this; + } + + public bool HasOrderBook { + get { return result.hasOrderBook; } + } + public global::bnet.protocol.exchange.OrderBook OrderBook { + get { return result.OrderBook; } + set { SetOrderBook(value); } + } + public Builder SetOrderBook(global::bnet.protocol.exchange.OrderBook value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOrderBook = true; + result.orderBook_ = value; + return this; + } + public Builder SetOrderBook(global::bnet.protocol.exchange.OrderBook.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOrderBook = true; + result.orderBook_ = builderForValue.Build(); + return this; + } + public Builder MergeOrderBook(global::bnet.protocol.exchange.OrderBook value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOrderBook && + result.orderBook_ != global::bnet.protocol.exchange.OrderBook.DefaultInstance) { + result.orderBook_ = global::bnet.protocol.exchange.OrderBook.CreateBuilder(result.orderBook_).MergeFrom(value).BuildPartial(); + } else { + result.orderBook_ = value; + } + result.hasOrderBook = true; + return this; + } + public Builder ClearOrderBook() { + PrepareBuilder(); + result.hasOrderBook = false; + result.orderBook_ = null; + return this; + } + + public bool HasAmount { + get { return result.hasAmount; } + } + public uint Amount { + get { return result.Amount; } + set { SetAmount(value); } + } + public Builder SetAmount(uint value) { + PrepareBuilder(); + result.hasAmount = true; + result.amount_ = value; + return this; + } + public Builder ClearAmount() { + PrepareBuilder(); + result.hasAmount = false; + result.amount_ = 0; + return this; + } + + public bool HasBnetAccount { + get { return result.hasBnetAccount; } + } + public global::bnet.protocol.EntityId BnetAccount { + get { return result.BnetAccount; } + set { SetBnetAccount(value); } + } + public Builder SetBnetAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBnetAccount = true; + result.bnetAccount_ = value; + return this; + } + public Builder SetBnetAccount(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBnetAccount = true; + result.bnetAccount_ = builderForValue.Build(); + return this; + } + public Builder MergeBnetAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBnetAccount && + result.bnetAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.bnetAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccount_).MergeFrom(value).BuildPartial(); + } else { + result.bnetAccount_ = value; + } + result.hasBnetAccount = true; + return this; + } + public Builder ClearBnetAccount() { + PrepareBuilder(); + result.hasBnetAccount = false; + result.bnetAccount_ = null; + return this; + } + + public bool HasGameAccount { + get { return result.hasGameAccount; } + } + public global::bnet.protocol.EntityId GameAccount { + get { return result.GameAccount; } + set { SetGameAccount(value); } + } + public Builder SetGameAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasGameAccount = true; + result.gameAccount_ = value; + return this; + } + public Builder SetGameAccount(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasGameAccount = true; + result.gameAccount_ = builderForValue.Build(); + return this; + } + public Builder MergeGameAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasGameAccount && + result.gameAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.gameAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccount_).MergeFrom(value).BuildPartial(); + } else { + result.gameAccount_ = value; + } + result.hasGameAccount = true; + return this; + } + public Builder ClearGameAccount() { + PrepareBuilder(); + result.hasGameAccount = false; + result.gameAccount_ = null; + return this; + } + + public bool HasAccountForItem { + get { return result.hasAccountForItem; } + } + public global::bnet.protocol.exchange.BlobFrom AccountForItem { + get { return result.AccountForItem; } + set { SetAccountForItem(value); } + } + public Builder SetAccountForItem(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccountForItem = true; + result.accountForItem_ = value; + return this; + } + public Builder SetAccountForItem(global::bnet.protocol.exchange.BlobFrom.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccountForItem = true; + result.accountForItem_ = builderForValue.Build(); + return this; + } + public Builder MergeAccountForItem(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccountForItem && + result.accountForItem_ != global::bnet.protocol.exchange.BlobFrom.DefaultInstance) { + result.accountForItem_ = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(result.accountForItem_).MergeFrom(value).BuildPartial(); + } else { + result.accountForItem_ = value; + } + result.hasAccountForItem = true; + return this; + } + public Builder ClearAccountForItem() { + PrepareBuilder(); + result.hasAccountForItem = false; + result.accountForItem_ = null; + return this; + } + + public bool HasCsNotes { + get { return result.hasCsNotes; } + } + public string CsNotes { + get { return result.CsNotes; } + set { SetCsNotes(value); } + } + public Builder SetCsNotes(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasCsNotes = true; + result.csNotes_ = value; + return this; + } + public Builder ClearCsNotes() { + PrepareBuilder(); + result.hasCsNotes = false; + result.csNotes_ = ""; + return this; + } + + public bool HasCsUserId { + get { return result.hasCsUserId; } + } + public ulong CsUserId { + get { return result.CsUserId; } + set { SetCsUserId(value); } + } + public Builder SetCsUserId(ulong value) { + PrepareBuilder(); + result.hasCsUserId = true; + result.csUserId_ = value; + return this; + } + public Builder ClearCsUserId() { + PrepareBuilder(); + result.hasCsUserId = false; + result.csUserId_ = 0UL; + return this; + } + + public bool HasAccountForMoney { + get { return result.hasAccountForMoney; } + } + public global::bnet.protocol.exchange.BlobFrom AccountForMoney { + get { return result.AccountForMoney; } + set { SetAccountForMoney(value); } + } + public Builder SetAccountForMoney(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccountForMoney = true; + result.accountForMoney_ = value; + return this; + } + public Builder SetAccountForMoney(global::bnet.protocol.exchange.BlobFrom.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccountForMoney = true; + result.accountForMoney_ = builderForValue.Build(); + return this; + } + public Builder MergeAccountForMoney(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccountForMoney && + result.accountForMoney_ != global::bnet.protocol.exchange.BlobFrom.DefaultInstance) { + result.accountForMoney_ = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(result.accountForMoney_).MergeFrom(value).BuildPartial(); + } else { + result.accountForMoney_ = value; + } + result.hasAccountForMoney = true; + return this; + } + public Builder ClearAccountForMoney() { + PrepareBuilder(); + result.hasAccountForMoney = false; + result.accountForMoney_ = null; + return this; + } + } + static CreateCSTradeMoneyRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class CreateCSTradeResponse : pb::GeneratedMessage { + private CreateCSTradeResponse() { } + private static readonly CreateCSTradeResponse defaultInstance = new CreateCSTradeResponse().MakeReadOnly(); + private static readonly string[] _createCSTradeResponseFieldNames = new string[] { "order_book_id" }; + private static readonly uint[] _createCSTradeResponseFieldTags = new uint[] { 8 }; + public static CreateCSTradeResponse DefaultInstance { + get { return defaultInstance; } + } + + public override CreateCSTradeResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override CreateCSTradeResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_CreateCSTradeResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_CreateCSTradeResponse__FieldAccessorTable; } + } + + public const int OrderBookIdFieldNumber = 1; + private bool hasOrderBookId; + private ulong orderBookId_; + public bool HasOrderBookId { + get { return hasOrderBookId; } + } + public ulong OrderBookId { + get { return orderBookId_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _createCSTradeResponseFieldNames; + if (hasOrderBookId) { + output.WriteUInt64(1, field_names[0], OrderBookId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasOrderBookId) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, OrderBookId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static CreateCSTradeResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CreateCSTradeResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CreateCSTradeResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CreateCSTradeResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CreateCSTradeResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CreateCSTradeResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static CreateCSTradeResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static CreateCSTradeResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static CreateCSTradeResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CreateCSTradeResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CreateCSTradeResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(CreateCSTradeResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CreateCSTradeResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CreateCSTradeResponse result; + + private CreateCSTradeResponse PrepareBuilder() { + if (resultIsReadOnly) { + CreateCSTradeResponse original = result; + result = new CreateCSTradeResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CreateCSTradeResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.CreateCSTradeResponse.Descriptor; } + } + + public override CreateCSTradeResponse DefaultInstanceForType { + get { return global::bnet.protocol.exchange.CreateCSTradeResponse.DefaultInstance; } + } + + public override CreateCSTradeResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is CreateCSTradeResponse) { + return MergeFrom((CreateCSTradeResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(CreateCSTradeResponse other) { + if (other == global::bnet.protocol.exchange.CreateCSTradeResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasOrderBookId) { + OrderBookId = other.OrderBookId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_createCSTradeResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _createCSTradeResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasOrderBookId = input.ReadUInt64(ref result.orderBookId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasOrderBookId { + get { return result.hasOrderBookId; } + } + public ulong OrderBookId { + get { return result.OrderBookId; } + set { SetOrderBookId(value); } + } + public Builder SetOrderBookId(ulong value) { + PrepareBuilder(); + result.hasOrderBookId = true; + result.orderBookId_ = value; + return this; + } + public Builder ClearOrderBookId() { + PrepareBuilder(); + result.hasOrderBookId = false; + result.orderBookId_ = 0UL; + return this; + } + } + static CreateCSTradeResponse() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetOrderCountRequest : pb::GeneratedMessage { + private GetOrderCountRequest() { } + private static readonly GetOrderCountRequest defaultInstance = new GetOrderCountRequest().MakeReadOnly(); + private static readonly string[] _getOrderCountRequestFieldNames = new string[] { "bnet_account", "currency", "not_closed_offer_count", "order_with_claimable_count", "source" }; + private static readonly uint[] _getOrderCountRequestFieldTags = new uint[] { 26, 10, 32, 40, 21 }; + public static GetOrderCountRequest DefaultInstance { + get { return defaultInstance; } + } + + public override GetOrderCountRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetOrderCountRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetOrderCountRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetOrderCountRequest__FieldAccessorTable; } + } + + public const int CurrencyFieldNumber = 1; + private bool hasCurrency; + private string currency_ = ""; + public bool HasCurrency { + get { return hasCurrency; } + } + public string Currency { + get { return currency_; } + } + + public const int SourceFieldNumber = 2; + private bool hasSource; + private uint source_; + public bool HasSource { + get { return hasSource; } + } + public uint Source { + get { return source_; } + } + + public const int BnetAccountFieldNumber = 3; + private bool hasBnetAccount; + private global::bnet.protocol.EntityId bnetAccount_; + public bool HasBnetAccount { + get { return hasBnetAccount; } + } + public global::bnet.protocol.EntityId BnetAccount { + get { return bnetAccount_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int NotClosedOfferCountFieldNumber = 4; + private bool hasNotClosedOfferCount; + private bool notClosedOfferCount_; + public bool HasNotClosedOfferCount { + get { return hasNotClosedOfferCount; } + } + public bool NotClosedOfferCount { + get { return notClosedOfferCount_; } + } + + public const int OrderWithClaimableCountFieldNumber = 5; + private bool hasOrderWithClaimableCount; + private bool orderWithClaimableCount_; + public bool HasOrderWithClaimableCount { + get { return hasOrderWithClaimableCount; } + } + public bool OrderWithClaimableCount { + get { return orderWithClaimableCount_; } + } + + public override bool IsInitialized { + get { + if (HasBnetAccount) { + if (!BnetAccount.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getOrderCountRequestFieldNames; + if (hasCurrency) { + output.WriteString(1, field_names[1], Currency); + } + if (hasSource) { + output.WriteFixed32(2, field_names[4], Source); + } + if (hasBnetAccount) { + output.WriteMessage(3, field_names[0], BnetAccount); + } + if (hasNotClosedOfferCount) { + output.WriteBool(4, field_names[2], NotClosedOfferCount); + } + if (hasOrderWithClaimableCount) { + output.WriteBool(5, field_names[3], OrderWithClaimableCount); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasCurrency) { + size += pb::CodedOutputStream.ComputeStringSize(1, Currency); + } + if (hasSource) { + size += pb::CodedOutputStream.ComputeFixed32Size(2, Source); + } + if (hasBnetAccount) { + size += pb::CodedOutputStream.ComputeMessageSize(3, BnetAccount); + } + if (hasNotClosedOfferCount) { + size += pb::CodedOutputStream.ComputeBoolSize(4, NotClosedOfferCount); + } + if (hasOrderWithClaimableCount) { + size += pb::CodedOutputStream.ComputeBoolSize(5, OrderWithClaimableCount); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetOrderCountRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetOrderCountRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetOrderCountRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetOrderCountRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetOrderCountRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetOrderCountRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetOrderCountRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetOrderCountRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetOrderCountRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetOrderCountRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetOrderCountRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetOrderCountRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetOrderCountRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetOrderCountRequest result; + + private GetOrderCountRequest PrepareBuilder() { + if (resultIsReadOnly) { + GetOrderCountRequest original = result; + result = new GetOrderCountRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetOrderCountRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.GetOrderCountRequest.Descriptor; } + } + + public override GetOrderCountRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.GetOrderCountRequest.DefaultInstance; } + } + + public override GetOrderCountRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetOrderCountRequest) { + return MergeFrom((GetOrderCountRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetOrderCountRequest other) { + if (other == global::bnet.protocol.exchange.GetOrderCountRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasCurrency) { + Currency = other.Currency; + } + if (other.HasSource) { + Source = other.Source; + } + if (other.HasBnetAccount) { + MergeBnetAccount(other.BnetAccount); + } + if (other.HasNotClosedOfferCount) { + NotClosedOfferCount = other.NotClosedOfferCount; + } + if (other.HasOrderWithClaimableCount) { + OrderWithClaimableCount = other.OrderWithClaimableCount; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getOrderCountRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getOrderCountRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasCurrency = input.ReadString(ref result.currency_); + break; + } + case 21: { + result.hasSource = input.ReadFixed32(ref result.source_); + break; + } + case 26: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasBnetAccount) { + subBuilder.MergeFrom(BnetAccount); + } + input.ReadMessage(subBuilder, extensionRegistry); + BnetAccount = subBuilder.BuildPartial(); + break; + } + case 32: { + result.hasNotClosedOfferCount = input.ReadBool(ref result.notClosedOfferCount_); + break; + } + case 40: { + result.hasOrderWithClaimableCount = input.ReadBool(ref result.orderWithClaimableCount_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasCurrency { + get { return result.hasCurrency; } + } + public string Currency { + get { return result.Currency; } + set { SetCurrency(value); } + } + public Builder SetCurrency(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasCurrency = true; + result.currency_ = value; + return this; + } + public Builder ClearCurrency() { + PrepareBuilder(); + result.hasCurrency = false; + result.currency_ = ""; + return this; + } + + public bool HasSource { + get { return result.hasSource; } + } + public uint Source { + get { return result.Source; } + set { SetSource(value); } + } + public Builder SetSource(uint value) { + PrepareBuilder(); + result.hasSource = true; + result.source_ = value; + return this; + } + public Builder ClearSource() { + PrepareBuilder(); + result.hasSource = false; + result.source_ = 0; + return this; + } + + public bool HasBnetAccount { + get { return result.hasBnetAccount; } + } + public global::bnet.protocol.EntityId BnetAccount { + get { return result.BnetAccount; } + set { SetBnetAccount(value); } + } + public Builder SetBnetAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBnetAccount = true; + result.bnetAccount_ = value; + return this; + } + public Builder SetBnetAccount(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBnetAccount = true; + result.bnetAccount_ = builderForValue.Build(); + return this; + } + public Builder MergeBnetAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBnetAccount && + result.bnetAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.bnetAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccount_).MergeFrom(value).BuildPartial(); + } else { + result.bnetAccount_ = value; + } + result.hasBnetAccount = true; + return this; + } + public Builder ClearBnetAccount() { + PrepareBuilder(); + result.hasBnetAccount = false; + result.bnetAccount_ = null; + return this; + } + + public bool HasNotClosedOfferCount { + get { return result.hasNotClosedOfferCount; } + } + public bool NotClosedOfferCount { + get { return result.NotClosedOfferCount; } + set { SetNotClosedOfferCount(value); } + } + public Builder SetNotClosedOfferCount(bool value) { + PrepareBuilder(); + result.hasNotClosedOfferCount = true; + result.notClosedOfferCount_ = value; + return this; + } + public Builder ClearNotClosedOfferCount() { + PrepareBuilder(); + result.hasNotClosedOfferCount = false; + result.notClosedOfferCount_ = false; + return this; + } + + public bool HasOrderWithClaimableCount { + get { return result.hasOrderWithClaimableCount; } + } + public bool OrderWithClaimableCount { + get { return result.OrderWithClaimableCount; } + set { SetOrderWithClaimableCount(value); } + } + public Builder SetOrderWithClaimableCount(bool value) { + PrepareBuilder(); + result.hasOrderWithClaimableCount = true; + result.orderWithClaimableCount_ = value; + return this; + } + public Builder ClearOrderWithClaimableCount() { + PrepareBuilder(); + result.hasOrderWithClaimableCount = false; + result.orderWithClaimableCount_ = false; + return this; + } + } + static GetOrderCountRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetOrderCountResponse : pb::GeneratedMessage { + private GetOrderCountResponse() { } + private static readonly GetOrderCountResponse defaultInstance = new GetOrderCountResponse().MakeReadOnly(); + private static readonly string[] _getOrderCountResponseFieldNames = new string[] { "not_closed_offer_count", "order_with_claimable_count" }; + private static readonly uint[] _getOrderCountResponseFieldTags = new uint[] { 10, 18 }; + public static GetOrderCountResponse DefaultInstance { + get { return defaultInstance; } + } + + public override GetOrderCountResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetOrderCountResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetOrderCountResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetOrderCountResponse__FieldAccessorTable; } + } + + public const int NotClosedOfferCountFieldNumber = 1; + private bool hasNotClosedOfferCount; + private global::bnet.protocol.exchange.Count notClosedOfferCount_; + public bool HasNotClosedOfferCount { + get { return hasNotClosedOfferCount; } + } + public global::bnet.protocol.exchange.Count NotClosedOfferCount { + get { return notClosedOfferCount_ ?? global::bnet.protocol.exchange.Count.DefaultInstance; } + } + + public const int OrderWithClaimableCountFieldNumber = 2; + private bool hasOrderWithClaimableCount; + private global::bnet.protocol.exchange.Count orderWithClaimableCount_; + public bool HasOrderWithClaimableCount { + get { return hasOrderWithClaimableCount; } + } + public global::bnet.protocol.exchange.Count OrderWithClaimableCount { + get { return orderWithClaimableCount_ ?? global::bnet.protocol.exchange.Count.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (HasNotClosedOfferCount) { + if (!NotClosedOfferCount.IsInitialized) return false; + } + if (HasOrderWithClaimableCount) { + if (!OrderWithClaimableCount.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getOrderCountResponseFieldNames; + if (hasNotClosedOfferCount) { + output.WriteMessage(1, field_names[0], NotClosedOfferCount); + } + if (hasOrderWithClaimableCount) { + output.WriteMessage(2, field_names[1], OrderWithClaimableCount); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasNotClosedOfferCount) { + size += pb::CodedOutputStream.ComputeMessageSize(1, NotClosedOfferCount); + } + if (hasOrderWithClaimableCount) { + size += pb::CodedOutputStream.ComputeMessageSize(2, OrderWithClaimableCount); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetOrderCountResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetOrderCountResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetOrderCountResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetOrderCountResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetOrderCountResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetOrderCountResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetOrderCountResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetOrderCountResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetOrderCountResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetOrderCountResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetOrderCountResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetOrderCountResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetOrderCountResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetOrderCountResponse result; + + private GetOrderCountResponse PrepareBuilder() { + if (resultIsReadOnly) { + GetOrderCountResponse original = result; + result = new GetOrderCountResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetOrderCountResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.GetOrderCountResponse.Descriptor; } + } + + public override GetOrderCountResponse DefaultInstanceForType { + get { return global::bnet.protocol.exchange.GetOrderCountResponse.DefaultInstance; } + } + + public override GetOrderCountResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetOrderCountResponse) { + return MergeFrom((GetOrderCountResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetOrderCountResponse other) { + if (other == global::bnet.protocol.exchange.GetOrderCountResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasNotClosedOfferCount) { + MergeNotClosedOfferCount(other.NotClosedOfferCount); + } + if (other.HasOrderWithClaimableCount) { + MergeOrderWithClaimableCount(other.OrderWithClaimableCount); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getOrderCountResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getOrderCountResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.Count.Builder subBuilder = global::bnet.protocol.exchange.Count.CreateBuilder(); + if (result.hasNotClosedOfferCount) { + subBuilder.MergeFrom(NotClosedOfferCount); + } + input.ReadMessage(subBuilder, extensionRegistry); + NotClosedOfferCount = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.exchange.Count.Builder subBuilder = global::bnet.protocol.exchange.Count.CreateBuilder(); + if (result.hasOrderWithClaimableCount) { + subBuilder.MergeFrom(OrderWithClaimableCount); + } + input.ReadMessage(subBuilder, extensionRegistry); + OrderWithClaimableCount = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasNotClosedOfferCount { + get { return result.hasNotClosedOfferCount; } + } + public global::bnet.protocol.exchange.Count NotClosedOfferCount { + get { return result.NotClosedOfferCount; } + set { SetNotClosedOfferCount(value); } + } + public Builder SetNotClosedOfferCount(global::bnet.protocol.exchange.Count value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasNotClosedOfferCount = true; + result.notClosedOfferCount_ = value; + return this; + } + public Builder SetNotClosedOfferCount(global::bnet.protocol.exchange.Count.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasNotClosedOfferCount = true; + result.notClosedOfferCount_ = builderForValue.Build(); + return this; + } + public Builder MergeNotClosedOfferCount(global::bnet.protocol.exchange.Count value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasNotClosedOfferCount && + result.notClosedOfferCount_ != global::bnet.protocol.exchange.Count.DefaultInstance) { + result.notClosedOfferCount_ = global::bnet.protocol.exchange.Count.CreateBuilder(result.notClosedOfferCount_).MergeFrom(value).BuildPartial(); + } else { + result.notClosedOfferCount_ = value; + } + result.hasNotClosedOfferCount = true; + return this; + } + public Builder ClearNotClosedOfferCount() { + PrepareBuilder(); + result.hasNotClosedOfferCount = false; + result.notClosedOfferCount_ = null; + return this; + } + + public bool HasOrderWithClaimableCount { + get { return result.hasOrderWithClaimableCount; } + } + public global::bnet.protocol.exchange.Count OrderWithClaimableCount { + get { return result.OrderWithClaimableCount; } + set { SetOrderWithClaimableCount(value); } + } + public Builder SetOrderWithClaimableCount(global::bnet.protocol.exchange.Count value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOrderWithClaimableCount = true; + result.orderWithClaimableCount_ = value; + return this; + } + public Builder SetOrderWithClaimableCount(global::bnet.protocol.exchange.Count.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOrderWithClaimableCount = true; + result.orderWithClaimableCount_ = builderForValue.Build(); + return this; + } + public Builder MergeOrderWithClaimableCount(global::bnet.protocol.exchange.Count value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOrderWithClaimableCount && + result.orderWithClaimableCount_ != global::bnet.protocol.exchange.Count.DefaultInstance) { + result.orderWithClaimableCount_ = global::bnet.protocol.exchange.Count.CreateBuilder(result.orderWithClaimableCount_).MergeFrom(value).BuildPartial(); + } else { + result.orderWithClaimableCount_ = value; + } + result.hasOrderWithClaimableCount = true; + return this; + } + public Builder ClearOrderWithClaimableCount() { + PrepareBuilder(); + result.hasOrderWithClaimableCount = false; + result.orderWithClaimableCount_ = null; + return this; + } + } + static GetOrderCountResponse() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class HistoriesForCSRequest : pb::GeneratedMessage { + private HistoriesForCSRequest() { } + private static readonly HistoriesForCSRequest defaultInstance = new HistoriesForCSRequest().MakeReadOnly(); + private static readonly string[] _historiesForCSRequestFieldNames = new string[] { "bnet_account", "higher_time", "lower_time", "program" }; + private static readonly uint[] _historiesForCSRequestFieldTags = new uint[] { 10, 32, 24, 21 }; + public static HistoriesForCSRequest DefaultInstance { + get { return defaultInstance; } + } + + public override HistoriesForCSRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override HistoriesForCSRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_HistoriesForCSRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_HistoriesForCSRequest__FieldAccessorTable; } + } + + public const int BnetAccountFieldNumber = 1; + private bool hasBnetAccount; + private global::bnet.protocol.EntityId bnetAccount_; + public bool HasBnetAccount { + get { return hasBnetAccount; } + } + public global::bnet.protocol.EntityId BnetAccount { + get { return bnetAccount_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int ProgramFieldNumber = 2; + private bool hasProgram; + private uint program_; + public bool HasProgram { + get { return hasProgram; } + } + public uint Program { + get { return program_; } + } + + public const int LowerTimeFieldNumber = 3; + private bool hasLowerTime; + private ulong lowerTime_; + public bool HasLowerTime { + get { return hasLowerTime; } + } + public ulong LowerTime { + get { return lowerTime_; } + } + + public const int HigherTimeFieldNumber = 4; + private bool hasHigherTime; + private ulong higherTime_; + public bool HasHigherTime { + get { return hasHigherTime; } + } + public ulong HigherTime { + get { return higherTime_; } + } + + public override bool IsInitialized { + get { + if (!hasBnetAccount) return false; + if (!hasProgram) return false; + if (!hasLowerTime) return false; + if (!hasHigherTime) return false; + if (!BnetAccount.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _historiesForCSRequestFieldNames; + if (hasBnetAccount) { + output.WriteMessage(1, field_names[0], BnetAccount); + } + if (hasProgram) { + output.WriteFixed32(2, field_names[3], Program); + } + if (hasLowerTime) { + output.WriteUInt64(3, field_names[2], LowerTime); + } + if (hasHigherTime) { + output.WriteUInt64(4, field_names[1], HigherTime); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasBnetAccount) { + size += pb::CodedOutputStream.ComputeMessageSize(1, BnetAccount); + } + if (hasProgram) { + size += pb::CodedOutputStream.ComputeFixed32Size(2, Program); + } + if (hasLowerTime) { + size += pb::CodedOutputStream.ComputeUInt64Size(3, LowerTime); + } + if (hasHigherTime) { + size += pb::CodedOutputStream.ComputeUInt64Size(4, HigherTime); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static HistoriesForCSRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static HistoriesForCSRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static HistoriesForCSRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static HistoriesForCSRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static HistoriesForCSRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static HistoriesForCSRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static HistoriesForCSRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static HistoriesForCSRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static HistoriesForCSRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static HistoriesForCSRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private HistoriesForCSRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(HistoriesForCSRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(HistoriesForCSRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private HistoriesForCSRequest result; + + private HistoriesForCSRequest PrepareBuilder() { + if (resultIsReadOnly) { + HistoriesForCSRequest original = result; + result = new HistoriesForCSRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override HistoriesForCSRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.HistoriesForCSRequest.Descriptor; } + } + + public override HistoriesForCSRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.HistoriesForCSRequest.DefaultInstance; } + } + + public override HistoriesForCSRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is HistoriesForCSRequest) { + return MergeFrom((HistoriesForCSRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(HistoriesForCSRequest other) { + if (other == global::bnet.protocol.exchange.HistoriesForCSRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasBnetAccount) { + MergeBnetAccount(other.BnetAccount); + } + if (other.HasProgram) { + Program = other.Program; + } + if (other.HasLowerTime) { + LowerTime = other.LowerTime; + } + if (other.HasHigherTime) { + HigherTime = other.HigherTime; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_historiesForCSRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _historiesForCSRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasBnetAccount) { + subBuilder.MergeFrom(BnetAccount); + } + input.ReadMessage(subBuilder, extensionRegistry); + BnetAccount = subBuilder.BuildPartial(); + break; + } + case 21: { + result.hasProgram = input.ReadFixed32(ref result.program_); + break; + } + case 24: { + result.hasLowerTime = input.ReadUInt64(ref result.lowerTime_); + break; + } + case 32: { + result.hasHigherTime = input.ReadUInt64(ref result.higherTime_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasBnetAccount { + get { return result.hasBnetAccount; } + } + public global::bnet.protocol.EntityId BnetAccount { + get { return result.BnetAccount; } + set { SetBnetAccount(value); } + } + public Builder SetBnetAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBnetAccount = true; + result.bnetAccount_ = value; + return this; + } + public Builder SetBnetAccount(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBnetAccount = true; + result.bnetAccount_ = builderForValue.Build(); + return this; + } + public Builder MergeBnetAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBnetAccount && + result.bnetAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.bnetAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccount_).MergeFrom(value).BuildPartial(); + } else { + result.bnetAccount_ = value; + } + result.hasBnetAccount = true; + return this; + } + public Builder ClearBnetAccount() { + PrepareBuilder(); + result.hasBnetAccount = false; + result.bnetAccount_ = null; + return this; + } + + public bool HasProgram { + get { return result.hasProgram; } + } + public uint Program { + get { return result.Program; } + set { SetProgram(value); } + } + public Builder SetProgram(uint value) { + PrepareBuilder(); + result.hasProgram = true; + result.program_ = value; + return this; + } + public Builder ClearProgram() { + PrepareBuilder(); + result.hasProgram = false; + result.program_ = 0; + return this; + } + + public bool HasLowerTime { + get { return result.hasLowerTime; } + } + public ulong LowerTime { + get { return result.LowerTime; } + set { SetLowerTime(value); } + } + public Builder SetLowerTime(ulong value) { + PrepareBuilder(); + result.hasLowerTime = true; + result.lowerTime_ = value; + return this; + } + public Builder ClearLowerTime() { + PrepareBuilder(); + result.hasLowerTime = false; + result.lowerTime_ = 0UL; + return this; + } + + public bool HasHigherTime { + get { return result.hasHigherTime; } + } + public ulong HigherTime { + get { return result.HigherTime; } + set { SetHigherTime(value); } + } + public Builder SetHigherTime(ulong value) { + PrepareBuilder(); + result.hasHigherTime = true; + result.higherTime_ = value; + return this; + } + public Builder ClearHigherTime() { + PrepareBuilder(); + result.hasHigherTime = false; + result.higherTime_ = 0UL; + return this; + } + } + static HistoriesForCSRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class HistoriesForCSResponse : pb::GeneratedMessage { + private HistoriesForCSResponse() { } + private static readonly HistoriesForCSResponse defaultInstance = new HistoriesForCSResponse().MakeReadOnly(); + private static readonly string[] _historiesForCSResponseFieldNames = new string[] { "history_data" }; + private static readonly uint[] _historiesForCSResponseFieldTags = new uint[] { 10 }; + public static HistoriesForCSResponse DefaultInstance { + get { return defaultInstance; } + } + + public override HistoriesForCSResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override HistoriesForCSResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_HistoriesForCSResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_HistoriesForCSResponse__FieldAccessorTable; } + } + + public const int HistoryDataFieldNumber = 1; + private pbc::PopsicleList historyData_ = new pbc::PopsicleList(); + public scg::IList HistoryDataList { + get { return historyData_; } + } + public int HistoryDataCount { + get { return historyData_.Count; } + } + public global::bnet.protocol.exchange.HistoryData GetHistoryData(int index) { + return historyData_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.exchange.HistoryData element in HistoryDataList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _historiesForCSResponseFieldNames; + if (historyData_.Count > 0) { + output.WriteMessageArray(1, field_names[0], historyData_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.exchange.HistoryData element in HistoryDataList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static HistoriesForCSResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static HistoriesForCSResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static HistoriesForCSResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static HistoriesForCSResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static HistoriesForCSResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static HistoriesForCSResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static HistoriesForCSResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static HistoriesForCSResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static HistoriesForCSResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static HistoriesForCSResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private HistoriesForCSResponse MakeReadOnly() { + historyData_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(HistoriesForCSResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(HistoriesForCSResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private HistoriesForCSResponse result; + + private HistoriesForCSResponse PrepareBuilder() { + if (resultIsReadOnly) { + HistoriesForCSResponse original = result; + result = new HistoriesForCSResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override HistoriesForCSResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.HistoriesForCSResponse.Descriptor; } + } + + public override HistoriesForCSResponse DefaultInstanceForType { + get { return global::bnet.protocol.exchange.HistoriesForCSResponse.DefaultInstance; } + } + + public override HistoriesForCSResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is HistoriesForCSResponse) { + return MergeFrom((HistoriesForCSResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(HistoriesForCSResponse other) { + if (other == global::bnet.protocol.exchange.HistoriesForCSResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.historyData_.Count != 0) { + result.historyData_.Add(other.historyData_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_historiesForCSResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _historiesForCSResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.historyData_, global::bnet.protocol.exchange.HistoryData.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList HistoryDataList { + get { return PrepareBuilder().historyData_; } + } + public int HistoryDataCount { + get { return result.HistoryDataCount; } + } + public global::bnet.protocol.exchange.HistoryData GetHistoryData(int index) { + return result.GetHistoryData(index); + } + public Builder SetHistoryData(int index, global::bnet.protocol.exchange.HistoryData value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.historyData_[index] = value; + return this; + } + public Builder SetHistoryData(int index, global::bnet.protocol.exchange.HistoryData.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.historyData_[index] = builderForValue.Build(); + return this; + } + public Builder AddHistoryData(global::bnet.protocol.exchange.HistoryData value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.historyData_.Add(value); + return this; + } + public Builder AddHistoryData(global::bnet.protocol.exchange.HistoryData.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.historyData_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeHistoryData(scg::IEnumerable values) { + PrepareBuilder(); + result.historyData_.Add(values); + return this; + } + public Builder ClearHistoryData() { + PrepareBuilder(); + result.historyData_.Clear(); + return this; + } + } + static HistoriesForCSResponse() { + object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); + } + } + + #endregion + + #region Services + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public abstract class ExchangeService : pb::IService { + public abstract void CreateOrderBook( + pb::IRpcController controller, + global::bnet.protocol.exchange.CreateOrderBookRequest request, + global::System.Action done); + public abstract void PlaceOfferOnOrderBook( + pb::IRpcController controller, + global::bnet.protocol.exchange.PlaceOfferOnOrderBookRequest request, + global::System.Action done); + public abstract void PlaceOfferCreateOrderBookIfNeeded( + pb::IRpcController controller, + global::bnet.protocol.exchange.PlaceOfferCreateOrderBookIfNeededRequest request, + global::System.Action done); + public abstract void PlaceBidOnOrderBook( + pb::IRpcController controller, + global::bnet.protocol.exchange.PlaceBidOnOrderBookRequest request, + global::System.Action done); + public abstract void PlaceBidCreateOrderBookIfNeeded( + pb::IRpcController controller, + global::bnet.protocol.exchange.PlaceBidCreateOrderBookIfNeededRequest request, + global::System.Action done); + public abstract void QueryOffersByOrderBook( + pb::IRpcController controller, + global::bnet.protocol.exchange.QueryOffersByOrderBookRequest request, + global::System.Action done); + public abstract void QueryBidsByOrderBook( + pb::IRpcController controller, + global::bnet.protocol.exchange.QueryBidsByOrderBookRequest request, + global::System.Action done); + public abstract void QueryOffersByAccountForItem( + pb::IRpcController controller, + global::bnet.protocol.exchange.QueryOffersByAccountForItemRequest request, + global::System.Action done); + public abstract void QueryBidsByAccountForItem( + pb::IRpcController controller, + global::bnet.protocol.exchange.QueryBidsByAccountForItemRequest request, + global::System.Action done); + public abstract void QueryOrderBooksSummary( + pb::IRpcController controller, + global::bnet.protocol.exchange.QueryOrderBooksSummaryRequest request, + global::System.Action done); + public abstract void ReportAuthorize( + pb::IRpcController controller, + global::bnet.protocol.exchange_object_provider.ReportAuthorizeRequest request, + global::System.Action done); + public abstract void ReportSettle( + pb::IRpcController controller, + global::bnet.protocol.exchange_object_provider.ReportSettleRequest request, + global::System.Action done); + public abstract void ReportCancel( + pb::IRpcController controller, + global::bnet.protocol.exchange_object_provider.ReportCancelRequest request, + global::System.Action done); + public abstract void SubscribeOrderBookStatusChange( + pb::IRpcController controller, + global::bnet.protocol.exchange.SubscribeOrderBookStatusChangeRequest request, + global::System.Action done); + public abstract void UnsubscribeOrderBookStatusChange( + pb::IRpcController controller, + global::bnet.protocol.exchange.UnsubscribeOrderBookStatusChangeRequest request, + global::System.Action done); + public abstract void SubscribeOrderUpdate( + pb::IRpcController controller, + global::bnet.protocol.exchange.SubscribeOrderUpdateRequest request, + global::System.Action done); + public abstract void UnsubscribeOrderUpdate( + pb::IRpcController controller, + global::bnet.protocol.exchange.UnsubscribeOrderUpdateRequest request, + global::System.Action done); + public abstract void GetPaymentMethods( + pb::IRpcController controller, + global::bnet.protocol.exchange_object_provider.GetPaymentMethodsRequest request, + global::System.Action done); + public abstract void ClaimBidItem( + pb::IRpcController controller, + global::bnet.protocol.exchange.ClaimRequest request, + global::System.Action done); + public abstract void ClaimBidMoney( + pb::IRpcController controller, + global::bnet.protocol.exchange.ClaimRequest request, + global::System.Action done); + public abstract void ClaimOfferItem( + pb::IRpcController controller, + global::bnet.protocol.exchange.ClaimRequest request, + global::System.Action done); + public abstract void ClaimOfferMoney( + pb::IRpcController controller, + global::bnet.protocol.exchange.ClaimRequest request, + global::System.Action done); + public abstract void CancelBid( + pb::IRpcController controller, + global::bnet.protocol.exchange.CancelRequest request, + global::System.Action done); + public abstract void CancelOffer( + pb::IRpcController controller, + global::bnet.protocol.exchange.CancelRequest request, + global::System.Action done); + public abstract void GetConfiguration( + pb::IRpcController controller, + global::bnet.protocol.exchange.GetConfigurationRequest request, + global::System.Action done); + public abstract void GetBidFeeEstimation( + pb::IRpcController controller, + global::bnet.protocol.exchange.GetBidFeeEstimationRequest request, + global::System.Action done); + public abstract void GetOfferFeeEstimation( + pb::IRpcController controller, + global::bnet.protocol.exchange.GetOfferFeeEstimationRequest request, + global::System.Action done); + public abstract void QueryOrdersByAccountForItem( + pb::IRpcController controller, + global::bnet.protocol.exchange.QueryOrdersByAccountForItemRequest request, + global::System.Action done); + public abstract void ReportAuthorizeRiskVerdict( + pb::IRpcController controller, + global::bnet.protocol.exchange_risk.ReportAuthorizeRiskVerdictRequest request, + global::System.Action done); + public abstract void ReportSettleRiskVerdict( + pb::IRpcController controller, + global::bnet.protocol.exchange_risk.ReportSettleRiskVerdictRequest request, + global::System.Action done); + public abstract void DelaySettleRiskVerdict( + pb::IRpcController controller, + global::bnet.protocol.exchange_risk.DelaySettleRiskVerdictRequest request, + global::System.Action done); + public abstract void GetFeeDetails( + pb::IRpcController controller, + global::bnet.protocol.exchange.GetFeeDetailsRequest request, + global::System.Action done); + public abstract void GetOrderBookStatistics( + pb::IRpcController controller, + global::bnet.protocol.exchange.GetOrderBookStatisticsRequest request, + global::System.Action done); + public abstract void GetBidDetails( + pb::IRpcController controller, + global::bnet.protocol.exchange.GetBidDetailsRequest request, + global::System.Action done); + public abstract void GetOfferDetails( + pb::IRpcController controller, + global::bnet.protocol.exchange.GetOfferDetailsRequest request, + global::System.Action done); + public abstract void GetSystemTime( + pb::IRpcController controller, + global::bnet.protocol.NoData request, + global::System.Action done); + public abstract void CreateCSTrade( + pb::IRpcController controller, + global::bnet.protocol.exchange.CreateCSTradeRequest request, + global::System.Action done); + public abstract void RefundBid( + pb::IRpcController controller, + global::bnet.protocol.exchange.RefundRequest request, + global::System.Action done); + public abstract void ReportRefund( + pb::IRpcController controller, + global::bnet.protocol.exchange_object_provider.ReportRefundRequest request, + global::System.Action done); + public abstract void GetOrderCount( + pb::IRpcController controller, + global::bnet.protocol.exchange.GetOrderCountRequest request, + global::System.Action done); + public abstract void SubscribeAdvancedOrderUpdate( + pb::IRpcController controller, + global::bnet.protocol.exchange.SubscribeAdvancedOrderUpdateRequest request, + global::System.Action done); + public abstract void UnsubscribeAdvancedOrderUpdate( + pb::IRpcController controller, + global::bnet.protocol.exchange.UnsubscribeAdvancedOrderUpdateRequest request, + global::System.Action done); + public abstract void SettleHistoriesForCS( + pb::IRpcController controller, + global::bnet.protocol.exchange.HistoriesForCSRequest request, + global::System.Action done); + public abstract void CancelHistoriesForCS( + pb::IRpcController controller, + global::bnet.protocol.exchange.HistoriesForCSRequest request, + global::System.Action done); + public abstract void CreateCSTradeItem( + pb::IRpcController controller, + global::bnet.protocol.exchange.CreateCSTradeItemRequest request, + global::System.Action done); + public abstract void CreateCSTradeMoney( + pb::IRpcController controller, + global::bnet.protocol.exchange.CreateCSTradeMoneyRequest request, + global::System.Action done); + + public static pbd::ServiceDescriptor Descriptor { + get { return Proto.ExchangeService.Descriptor.Services[0]; } + } + public pbd::ServiceDescriptor DescriptorForType { + get { return Descriptor; } + } + + public void CallMethod( + pbd::MethodDescriptor method, + pb::IRpcController controller, + pb::IMessage request, + global::System.Action done) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.CallMethod() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + this.CreateOrderBook(controller, (global::bnet.protocol.exchange.CreateOrderBookRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 1: + this.PlaceOfferOnOrderBook(controller, (global::bnet.protocol.exchange.PlaceOfferOnOrderBookRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 2: + this.PlaceOfferCreateOrderBookIfNeeded(controller, (global::bnet.protocol.exchange.PlaceOfferCreateOrderBookIfNeededRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 3: + this.PlaceBidOnOrderBook(controller, (global::bnet.protocol.exchange.PlaceBidOnOrderBookRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 4: + this.PlaceBidCreateOrderBookIfNeeded(controller, (global::bnet.protocol.exchange.PlaceBidCreateOrderBookIfNeededRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 5: + this.QueryOffersByOrderBook(controller, (global::bnet.protocol.exchange.QueryOffersByOrderBookRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 6: + this.QueryBidsByOrderBook(controller, (global::bnet.protocol.exchange.QueryBidsByOrderBookRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 7: + this.QueryOffersByAccountForItem(controller, (global::bnet.protocol.exchange.QueryOffersByAccountForItemRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 8: + this.QueryBidsByAccountForItem(controller, (global::bnet.protocol.exchange.QueryBidsByAccountForItemRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 9: + this.QueryOrderBooksSummary(controller, (global::bnet.protocol.exchange.QueryOrderBooksSummaryRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 10: + this.ReportAuthorize(controller, (global::bnet.protocol.exchange_object_provider.ReportAuthorizeRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 11: + this.ReportSettle(controller, (global::bnet.protocol.exchange_object_provider.ReportSettleRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 12: + this.ReportCancel(controller, (global::bnet.protocol.exchange_object_provider.ReportCancelRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 13: + this.SubscribeOrderBookStatusChange(controller, (global::bnet.protocol.exchange.SubscribeOrderBookStatusChangeRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 14: + this.UnsubscribeOrderBookStatusChange(controller, (global::bnet.protocol.exchange.UnsubscribeOrderBookStatusChangeRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 15: + this.SubscribeOrderUpdate(controller, (global::bnet.protocol.exchange.SubscribeOrderUpdateRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 16: + this.UnsubscribeOrderUpdate(controller, (global::bnet.protocol.exchange.UnsubscribeOrderUpdateRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 17: + this.GetPaymentMethods(controller, (global::bnet.protocol.exchange_object_provider.GetPaymentMethodsRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 18: + this.ClaimBidItem(controller, (global::bnet.protocol.exchange.ClaimRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 19: + this.ClaimBidMoney(controller, (global::bnet.protocol.exchange.ClaimRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 20: + this.ClaimOfferItem(controller, (global::bnet.protocol.exchange.ClaimRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 21: + this.ClaimOfferMoney(controller, (global::bnet.protocol.exchange.ClaimRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 22: + this.CancelBid(controller, (global::bnet.protocol.exchange.CancelRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 23: + this.CancelOffer(controller, (global::bnet.protocol.exchange.CancelRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 24: + this.GetConfiguration(controller, (global::bnet.protocol.exchange.GetConfigurationRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 25: + this.GetBidFeeEstimation(controller, (global::bnet.protocol.exchange.GetBidFeeEstimationRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 26: + this.GetOfferFeeEstimation(controller, (global::bnet.protocol.exchange.GetOfferFeeEstimationRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 27: + this.QueryOrdersByAccountForItem(controller, (global::bnet.protocol.exchange.QueryOrdersByAccountForItemRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 28: + this.ReportAuthorizeRiskVerdict(controller, (global::bnet.protocol.exchange_risk.ReportAuthorizeRiskVerdictRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 29: + this.ReportSettleRiskVerdict(controller, (global::bnet.protocol.exchange_risk.ReportSettleRiskVerdictRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 30: + this.DelaySettleRiskVerdict(controller, (global::bnet.protocol.exchange_risk.DelaySettleRiskVerdictRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 31: + this.GetFeeDetails(controller, (global::bnet.protocol.exchange.GetFeeDetailsRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 32: + this.GetOrderBookStatistics(controller, (global::bnet.protocol.exchange.GetOrderBookStatisticsRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 33: + this.GetBidDetails(controller, (global::bnet.protocol.exchange.GetBidDetailsRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 34: + this.GetOfferDetails(controller, (global::bnet.protocol.exchange.GetOfferDetailsRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 35: + this.GetSystemTime(controller, (global::bnet.protocol.NoData) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 36: + this.CreateCSTrade(controller, (global::bnet.protocol.exchange.CreateCSTradeRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 37: + this.RefundBid(controller, (global::bnet.protocol.exchange.RefundRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 38: + this.ReportRefund(controller, (global::bnet.protocol.exchange_object_provider.ReportRefundRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 39: + this.GetOrderCount(controller, (global::bnet.protocol.exchange.GetOrderCountRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 40: + this.SubscribeAdvancedOrderUpdate(controller, (global::bnet.protocol.exchange.SubscribeAdvancedOrderUpdateRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 41: + this.UnsubscribeAdvancedOrderUpdate(controller, (global::bnet.protocol.exchange.UnsubscribeAdvancedOrderUpdateRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 42: + this.SettleHistoriesForCS(controller, (global::bnet.protocol.exchange.HistoriesForCSRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 43: + this.CancelHistoriesForCS(controller, (global::bnet.protocol.exchange.HistoriesForCSRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 44: + this.CreateCSTradeItem(controller, (global::bnet.protocol.exchange.CreateCSTradeItemRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 45: + this.CreateCSTradeMoney(controller, (global::bnet.protocol.exchange.CreateCSTradeMoneyRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetRequestPrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.exchange.CreateOrderBookRequest.DefaultInstance; + case 1: + return global::bnet.protocol.exchange.PlaceOfferOnOrderBookRequest.DefaultInstance; + case 2: + return global::bnet.protocol.exchange.PlaceOfferCreateOrderBookIfNeededRequest.DefaultInstance; + case 3: + return global::bnet.protocol.exchange.PlaceBidOnOrderBookRequest.DefaultInstance; + case 4: + return global::bnet.protocol.exchange.PlaceBidCreateOrderBookIfNeededRequest.DefaultInstance; + case 5: + return global::bnet.protocol.exchange.QueryOffersByOrderBookRequest.DefaultInstance; + case 6: + return global::bnet.protocol.exchange.QueryBidsByOrderBookRequest.DefaultInstance; + case 7: + return global::bnet.protocol.exchange.QueryOffersByAccountForItemRequest.DefaultInstance; + case 8: + return global::bnet.protocol.exchange.QueryBidsByAccountForItemRequest.DefaultInstance; + case 9: + return global::bnet.protocol.exchange.QueryOrderBooksSummaryRequest.DefaultInstance; + case 10: + return global::bnet.protocol.exchange_object_provider.ReportAuthorizeRequest.DefaultInstance; + case 11: + return global::bnet.protocol.exchange_object_provider.ReportSettleRequest.DefaultInstance; + case 12: + return global::bnet.protocol.exchange_object_provider.ReportCancelRequest.DefaultInstance; + case 13: + return global::bnet.protocol.exchange.SubscribeOrderBookStatusChangeRequest.DefaultInstance; + case 14: + return global::bnet.protocol.exchange.UnsubscribeOrderBookStatusChangeRequest.DefaultInstance; + case 15: + return global::bnet.protocol.exchange.SubscribeOrderUpdateRequest.DefaultInstance; + case 16: + return global::bnet.protocol.exchange.UnsubscribeOrderUpdateRequest.DefaultInstance; + case 17: + return global::bnet.protocol.exchange_object_provider.GetPaymentMethodsRequest.DefaultInstance; + case 18: + return global::bnet.protocol.exchange.ClaimRequest.DefaultInstance; + case 19: + return global::bnet.protocol.exchange.ClaimRequest.DefaultInstance; + case 20: + return global::bnet.protocol.exchange.ClaimRequest.DefaultInstance; + case 21: + return global::bnet.protocol.exchange.ClaimRequest.DefaultInstance; + case 22: + return global::bnet.protocol.exchange.CancelRequest.DefaultInstance; + case 23: + return global::bnet.protocol.exchange.CancelRequest.DefaultInstance; + case 24: + return global::bnet.protocol.exchange.GetConfigurationRequest.DefaultInstance; + case 25: + return global::bnet.protocol.exchange.GetBidFeeEstimationRequest.DefaultInstance; + case 26: + return global::bnet.protocol.exchange.GetOfferFeeEstimationRequest.DefaultInstance; + case 27: + return global::bnet.protocol.exchange.QueryOrdersByAccountForItemRequest.DefaultInstance; + case 28: + return global::bnet.protocol.exchange_risk.ReportAuthorizeRiskVerdictRequest.DefaultInstance; + case 29: + return global::bnet.protocol.exchange_risk.ReportSettleRiskVerdictRequest.DefaultInstance; + case 30: + return global::bnet.protocol.exchange_risk.DelaySettleRiskVerdictRequest.DefaultInstance; + case 31: + return global::bnet.protocol.exchange.GetFeeDetailsRequest.DefaultInstance; + case 32: + return global::bnet.protocol.exchange.GetOrderBookStatisticsRequest.DefaultInstance; + case 33: + return global::bnet.protocol.exchange.GetBidDetailsRequest.DefaultInstance; + case 34: + return global::bnet.protocol.exchange.GetOfferDetailsRequest.DefaultInstance; + case 35: + return global::bnet.protocol.NoData.DefaultInstance; + case 36: + return global::bnet.protocol.exchange.CreateCSTradeRequest.DefaultInstance; + case 37: + return global::bnet.protocol.exchange.RefundRequest.DefaultInstance; + case 38: + return global::bnet.protocol.exchange_object_provider.ReportRefundRequest.DefaultInstance; + case 39: + return global::bnet.protocol.exchange.GetOrderCountRequest.DefaultInstance; + case 40: + return global::bnet.protocol.exchange.SubscribeAdvancedOrderUpdateRequest.DefaultInstance; + case 41: + return global::bnet.protocol.exchange.UnsubscribeAdvancedOrderUpdateRequest.DefaultInstance; + case 42: + return global::bnet.protocol.exchange.HistoriesForCSRequest.DefaultInstance; + case 43: + return global::bnet.protocol.exchange.HistoriesForCSRequest.DefaultInstance; + case 44: + return global::bnet.protocol.exchange.CreateCSTradeItemRequest.DefaultInstance; + case 45: + return global::bnet.protocol.exchange.CreateCSTradeMoneyRequest.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetResponsePrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.exchange.CreateOrderBookResponse.DefaultInstance; + case 1: + return global::bnet.protocol.exchange.PlaceOfferOnOrderBookResponse.DefaultInstance; + case 2: + return global::bnet.protocol.exchange.PlaceOfferCreateOrderBookIfNeededResponse.DefaultInstance; + case 3: + return global::bnet.protocol.exchange.PlaceBidOnOrderBookResponse.DefaultInstance; + case 4: + return global::bnet.protocol.exchange.PlaceBidCreateOrderBookIfNeededResponse.DefaultInstance; + case 5: + return global::bnet.protocol.exchange.QueryOffersByOrderBookResponse.DefaultInstance; + case 6: + return global::bnet.protocol.exchange.QueryBidsByOrderBookResponse.DefaultInstance; + case 7: + return global::bnet.protocol.exchange.QueryOffersByAccountForItemResponse.DefaultInstance; + case 8: + return global::bnet.protocol.exchange.QueryBidsByAccountForItemResponse.DefaultInstance; + case 9: + return global::bnet.protocol.exchange.QueryOrderBooksSummaryResponse.DefaultInstance; + case 10: + return global::bnet.protocol.NoData.DefaultInstance; + case 11: + return global::bnet.protocol.NoData.DefaultInstance; + case 12: + return global::bnet.protocol.NoData.DefaultInstance; + case 13: + return global::bnet.protocol.NoData.DefaultInstance; + case 14: + return global::bnet.protocol.NoData.DefaultInstance; + case 15: + return global::bnet.protocol.NoData.DefaultInstance; + case 16: + return global::bnet.protocol.NoData.DefaultInstance; + case 17: + return global::bnet.protocol.exchange_object_provider.GetPaymentMethodsResponse.DefaultInstance; + case 18: + return global::bnet.protocol.NoData.DefaultInstance; + case 19: + return global::bnet.protocol.NoData.DefaultInstance; + case 20: + return global::bnet.protocol.NoData.DefaultInstance; + case 21: + return global::bnet.protocol.NoData.DefaultInstance; + case 22: + return global::bnet.protocol.NoData.DefaultInstance; + case 23: + return global::bnet.protocol.NoData.DefaultInstance; + case 24: + return global::bnet.protocol.exchange.GetConfigurationResponse.DefaultInstance; + case 25: + return global::bnet.protocol.exchange.GetFeeEstimationResponse.DefaultInstance; + case 26: + return global::bnet.protocol.exchange.GetFeeEstimationResponse.DefaultInstance; + case 27: + return global::bnet.protocol.exchange.QueryOrdersByAccountForItemResponse.DefaultInstance; + case 28: + return global::bnet.protocol.NoData.DefaultInstance; + case 29: + return global::bnet.protocol.NoData.DefaultInstance; + case 30: + return global::bnet.protocol.NoData.DefaultInstance; + case 31: + return global::bnet.protocol.exchange.GetFeeDetailsResponse.DefaultInstance; + case 32: + return global::bnet.protocol.exchange.GetOrderBookStatisticsResponse.DefaultInstance; + case 33: + return global::bnet.protocol.exchange.GetBidDetailsResponse.DefaultInstance; + case 34: + return global::bnet.protocol.exchange.GetOfferDetailsResponse.DefaultInstance; + case 35: + return global::bnet.protocol.exchange.GetSystemTimeResponse.DefaultInstance; + case 36: + return global::bnet.protocol.NoData.DefaultInstance; + case 37: + return global::bnet.protocol.NoData.DefaultInstance; + case 38: + return global::bnet.protocol.NoData.DefaultInstance; + case 39: + return global::bnet.protocol.exchange.GetOrderCountResponse.DefaultInstance; + case 40: + return global::bnet.protocol.NoData.DefaultInstance; + case 41: + return global::bnet.protocol.NoData.DefaultInstance; + case 42: + return global::bnet.protocol.exchange.HistoriesForCSResponse.DefaultInstance; + case 43: + return global::bnet.protocol.exchange.HistoriesForCSResponse.DefaultInstance; + case 44: + return global::bnet.protocol.exchange.CreateCSTradeResponse.DefaultInstance; + case 45: + return global::bnet.protocol.exchange.CreateCSTradeResponse.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public static Stub CreateStub(pb::IRpcChannel channel) { + return new Stub(channel); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public class Stub : global::bnet.protocol.exchange.ExchangeService { + internal Stub(pb::IRpcChannel channel) { + this.channel = channel; + } + + private readonly pb::IRpcChannel channel; + + public pb::IRpcChannel Channel { + get { return channel; } + } + + public override void CreateOrderBook( + pb::IRpcController controller, + global::bnet.protocol.exchange.CreateOrderBookRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[0], + controller, request, global::bnet.protocol.exchange.CreateOrderBookResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.CreateOrderBookResponse.DefaultInstance)); + } + + public override void PlaceOfferOnOrderBook( + pb::IRpcController controller, + global::bnet.protocol.exchange.PlaceOfferOnOrderBookRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[1], + controller, request, global::bnet.protocol.exchange.PlaceOfferOnOrderBookResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.PlaceOfferOnOrderBookResponse.DefaultInstance)); + } + + public override void PlaceOfferCreateOrderBookIfNeeded( + pb::IRpcController controller, + global::bnet.protocol.exchange.PlaceOfferCreateOrderBookIfNeededRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[2], + controller, request, global::bnet.protocol.exchange.PlaceOfferCreateOrderBookIfNeededResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.PlaceOfferCreateOrderBookIfNeededResponse.DefaultInstance)); + } + + public override void PlaceBidOnOrderBook( + pb::IRpcController controller, + global::bnet.protocol.exchange.PlaceBidOnOrderBookRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[3], + controller, request, global::bnet.protocol.exchange.PlaceBidOnOrderBookResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.PlaceBidOnOrderBookResponse.DefaultInstance)); + } + + public override void PlaceBidCreateOrderBookIfNeeded( + pb::IRpcController controller, + global::bnet.protocol.exchange.PlaceBidCreateOrderBookIfNeededRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[4], + controller, request, global::bnet.protocol.exchange.PlaceBidCreateOrderBookIfNeededResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.PlaceBidCreateOrderBookIfNeededResponse.DefaultInstance)); + } + + public override void QueryOffersByOrderBook( + pb::IRpcController controller, + global::bnet.protocol.exchange.QueryOffersByOrderBookRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[5], + controller, request, global::bnet.protocol.exchange.QueryOffersByOrderBookResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.QueryOffersByOrderBookResponse.DefaultInstance)); + } + + public override void QueryBidsByOrderBook( + pb::IRpcController controller, + global::bnet.protocol.exchange.QueryBidsByOrderBookRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[6], + controller, request, global::bnet.protocol.exchange.QueryBidsByOrderBookResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.QueryBidsByOrderBookResponse.DefaultInstance)); + } + + public override void QueryOffersByAccountForItem( + pb::IRpcController controller, + global::bnet.protocol.exchange.QueryOffersByAccountForItemRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[7], + controller, request, global::bnet.protocol.exchange.QueryOffersByAccountForItemResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.QueryOffersByAccountForItemResponse.DefaultInstance)); + } + + public override void QueryBidsByAccountForItem( + pb::IRpcController controller, + global::bnet.protocol.exchange.QueryBidsByAccountForItemRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[8], + controller, request, global::bnet.protocol.exchange.QueryBidsByAccountForItemResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.QueryBidsByAccountForItemResponse.DefaultInstance)); + } + + public override void QueryOrderBooksSummary( + pb::IRpcController controller, + global::bnet.protocol.exchange.QueryOrderBooksSummaryRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[9], + controller, request, global::bnet.protocol.exchange.QueryOrderBooksSummaryResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.QueryOrderBooksSummaryResponse.DefaultInstance)); + } + + public override void ReportAuthorize( + pb::IRpcController controller, + global::bnet.protocol.exchange_object_provider.ReportAuthorizeRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[10], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void ReportSettle( + pb::IRpcController controller, + global::bnet.protocol.exchange_object_provider.ReportSettleRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[11], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void ReportCancel( + pb::IRpcController controller, + global::bnet.protocol.exchange_object_provider.ReportCancelRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[12], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void SubscribeOrderBookStatusChange( + pb::IRpcController controller, + global::bnet.protocol.exchange.SubscribeOrderBookStatusChangeRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[13], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void UnsubscribeOrderBookStatusChange( + pb::IRpcController controller, + global::bnet.protocol.exchange.UnsubscribeOrderBookStatusChangeRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[14], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void SubscribeOrderUpdate( + pb::IRpcController controller, + global::bnet.protocol.exchange.SubscribeOrderUpdateRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[15], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void UnsubscribeOrderUpdate( + pb::IRpcController controller, + global::bnet.protocol.exchange.UnsubscribeOrderUpdateRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[16], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void GetPaymentMethods( + pb::IRpcController controller, + global::bnet.protocol.exchange_object_provider.GetPaymentMethodsRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[17], + controller, request, global::bnet.protocol.exchange_object_provider.GetPaymentMethodsResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange_object_provider.GetPaymentMethodsResponse.DefaultInstance)); + } + + public override void ClaimBidItem( + pb::IRpcController controller, + global::bnet.protocol.exchange.ClaimRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[18], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void ClaimBidMoney( + pb::IRpcController controller, + global::bnet.protocol.exchange.ClaimRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[19], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void ClaimOfferItem( + pb::IRpcController controller, + global::bnet.protocol.exchange.ClaimRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[20], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void ClaimOfferMoney( + pb::IRpcController controller, + global::bnet.protocol.exchange.ClaimRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[21], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void CancelBid( + pb::IRpcController controller, + global::bnet.protocol.exchange.CancelRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[22], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void CancelOffer( + pb::IRpcController controller, + global::bnet.protocol.exchange.CancelRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[23], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void GetConfiguration( + pb::IRpcController controller, + global::bnet.protocol.exchange.GetConfigurationRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[24], + controller, request, global::bnet.protocol.exchange.GetConfigurationResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.GetConfigurationResponse.DefaultInstance)); + } + + public override void GetBidFeeEstimation( + pb::IRpcController controller, + global::bnet.protocol.exchange.GetBidFeeEstimationRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[25], + controller, request, global::bnet.protocol.exchange.GetFeeEstimationResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.GetFeeEstimationResponse.DefaultInstance)); + } + + public override void GetOfferFeeEstimation( + pb::IRpcController controller, + global::bnet.protocol.exchange.GetOfferFeeEstimationRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[26], + controller, request, global::bnet.protocol.exchange.GetFeeEstimationResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.GetFeeEstimationResponse.DefaultInstance)); + } + + public override void QueryOrdersByAccountForItem( + pb::IRpcController controller, + global::bnet.protocol.exchange.QueryOrdersByAccountForItemRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[27], + controller, request, global::bnet.protocol.exchange.QueryOrdersByAccountForItemResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.QueryOrdersByAccountForItemResponse.DefaultInstance)); + } + + public override void ReportAuthorizeRiskVerdict( + pb::IRpcController controller, + global::bnet.protocol.exchange_risk.ReportAuthorizeRiskVerdictRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[28], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void ReportSettleRiskVerdict( + pb::IRpcController controller, + global::bnet.protocol.exchange_risk.ReportSettleRiskVerdictRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[29], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void DelaySettleRiskVerdict( + pb::IRpcController controller, + global::bnet.protocol.exchange_risk.DelaySettleRiskVerdictRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[30], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void GetFeeDetails( + pb::IRpcController controller, + global::bnet.protocol.exchange.GetFeeDetailsRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[31], + controller, request, global::bnet.protocol.exchange.GetFeeDetailsResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.GetFeeDetailsResponse.DefaultInstance)); + } + + public override void GetOrderBookStatistics( + pb::IRpcController controller, + global::bnet.protocol.exchange.GetOrderBookStatisticsRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[32], + controller, request, global::bnet.protocol.exchange.GetOrderBookStatisticsResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.GetOrderBookStatisticsResponse.DefaultInstance)); + } + + public override void GetBidDetails( + pb::IRpcController controller, + global::bnet.protocol.exchange.GetBidDetailsRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[33], + controller, request, global::bnet.protocol.exchange.GetBidDetailsResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.GetBidDetailsResponse.DefaultInstance)); + } + + public override void GetOfferDetails( + pb::IRpcController controller, + global::bnet.protocol.exchange.GetOfferDetailsRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[34], + controller, request, global::bnet.protocol.exchange.GetOfferDetailsResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.GetOfferDetailsResponse.DefaultInstance)); + } + + public override void GetSystemTime( + pb::IRpcController controller, + global::bnet.protocol.NoData request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[35], + controller, request, global::bnet.protocol.exchange.GetSystemTimeResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.GetSystemTimeResponse.DefaultInstance)); + } + + public override void CreateCSTrade( + pb::IRpcController controller, + global::bnet.protocol.exchange.CreateCSTradeRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[36], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void RefundBid( + pb::IRpcController controller, + global::bnet.protocol.exchange.RefundRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[37], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void ReportRefund( + pb::IRpcController controller, + global::bnet.protocol.exchange_object_provider.ReportRefundRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[38], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void GetOrderCount( + pb::IRpcController controller, + global::bnet.protocol.exchange.GetOrderCountRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[39], + controller, request, global::bnet.protocol.exchange.GetOrderCountResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.GetOrderCountResponse.DefaultInstance)); + } + + public override void SubscribeAdvancedOrderUpdate( + pb::IRpcController controller, + global::bnet.protocol.exchange.SubscribeAdvancedOrderUpdateRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[40], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void UnsubscribeAdvancedOrderUpdate( + pb::IRpcController controller, + global::bnet.protocol.exchange.UnsubscribeAdvancedOrderUpdateRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[41], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void SettleHistoriesForCS( + pb::IRpcController controller, + global::bnet.protocol.exchange.HistoriesForCSRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[42], + controller, request, global::bnet.protocol.exchange.HistoriesForCSResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.HistoriesForCSResponse.DefaultInstance)); + } + + public override void CancelHistoriesForCS( + pb::IRpcController controller, + global::bnet.protocol.exchange.HistoriesForCSRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[43], + controller, request, global::bnet.protocol.exchange.HistoriesForCSResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.HistoriesForCSResponse.DefaultInstance)); + } + + public override void CreateCSTradeItem( + pb::IRpcController controller, + global::bnet.protocol.exchange.CreateCSTradeItemRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[44], + controller, request, global::bnet.protocol.exchange.CreateCSTradeResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.CreateCSTradeResponse.DefaultInstance)); + } + + public override void CreateCSTradeMoney( + pb::IRpcController controller, + global::bnet.protocol.exchange.CreateCSTradeMoneyRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[45], + controller, request, global::bnet.protocol.exchange.CreateCSTradeResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.CreateCSTradeResponse.DefaultInstance)); + } + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public abstract class ExchangeNotify : pb::IService { + public abstract void NotifyOrderBookStatusChange( + pb::IRpcController controller, + global::bnet.protocol.exchange.OrderBookNotificationRequest request, + global::System.Action done); + public abstract void NotifyOfferUpdate( + pb::IRpcController controller, + global::bnet.protocol.exchange.OfferNotificationRequest request, + global::System.Action done); + public abstract void NotifyBidUpdate( + pb::IRpcController controller, + global::bnet.protocol.exchange.BidNotificationRequest request, + global::System.Action done); + public abstract void NotifyCustomMessage( + pb::IRpcController controller, + global::bnet.protocol.exchange.CustomNotificationRequest request, + global::System.Action done); + + public static pbd::ServiceDescriptor Descriptor { + get { return Proto.ExchangeService.Descriptor.Services[1]; } + } + public pbd::ServiceDescriptor DescriptorForType { + get { return Descriptor; } + } + + public void CallMethod( + pbd::MethodDescriptor method, + pb::IRpcController controller, + pb::IMessage request, + global::System.Action done) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.CallMethod() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + this.NotifyOrderBookStatusChange(controller, (global::bnet.protocol.exchange.OrderBookNotificationRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 1: + this.NotifyOfferUpdate(controller, (global::bnet.protocol.exchange.OfferNotificationRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 2: + this.NotifyBidUpdate(controller, (global::bnet.protocol.exchange.BidNotificationRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 3: + this.NotifyCustomMessage(controller, (global::bnet.protocol.exchange.CustomNotificationRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetRequestPrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.exchange.OrderBookNotificationRequest.DefaultInstance; + case 1: + return global::bnet.protocol.exchange.OfferNotificationRequest.DefaultInstance; + case 2: + return global::bnet.protocol.exchange.BidNotificationRequest.DefaultInstance; + case 3: + return global::bnet.protocol.exchange.CustomNotificationRequest.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetResponsePrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.NO_RESPONSE.DefaultInstance; + case 1: + return global::bnet.protocol.NO_RESPONSE.DefaultInstance; + case 2: + return global::bnet.protocol.NO_RESPONSE.DefaultInstance; + case 3: + return global::bnet.protocol.NO_RESPONSE.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public static Stub CreateStub(pb::IRpcChannel channel) { + return new Stub(channel); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public class Stub : global::bnet.protocol.exchange.ExchangeNotify { + internal Stub(pb::IRpcChannel channel) { + this.channel = channel; + } + + private readonly pb::IRpcChannel channel; + + public pb::IRpcChannel Channel { + get { return channel; } + } + + public override void NotifyOrderBookStatusChange( + pb::IRpcController controller, + global::bnet.protocol.exchange.OrderBookNotificationRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[0], + controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); + } + + public override void NotifyOfferUpdate( + pb::IRpcController controller, + global::bnet.protocol.exchange.OfferNotificationRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[1], + controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); + } + + public override void NotifyBidUpdate( + pb::IRpcController controller, + global::bnet.protocol.exchange.BidNotificationRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[2], + controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); + } + + public override void NotifyCustomMessage( + pb::IRpcController controller, + global::bnet.protocol.exchange.CustomNotificationRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[3], + controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); + } + } + } + #endregion + +} + +#endregion Designer generated code diff --git a/src/LibMooNet/bnet/protocol/exchange/ExchangeTypes.cs b/src/LibMooNet/bnet/protocol/exchange/ExchangeTypes.cs new file mode 100644 index 00000000..0daa1d16 --- /dev/null +++ b/src/LibMooNet/bnet/protocol/exchange/ExchangeTypes.cs @@ -0,0 +1,14795 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace bnet.protocol.exchange { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class ExchangeTypes { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_OrderBook__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_OrderBook__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_OrderBookHandle__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_OrderBookHandle__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_OrderBookNotification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_OrderBookNotification__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_OrderBookSummary__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_OrderBookSummary__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_Order__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_Order__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_Extension__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_Extension__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_Offer__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_Offer__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_OfferExtended__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_OfferExtended__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_OfferCreation__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_OfferCreation__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_Bid__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_Bid__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_BidExtended__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_BidExtended__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_BidCreation__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_BidCreation__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_OrderExtended__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_OrderExtended__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_QueryFilterByOrderId__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_QueryFilterByOrderId__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_QueryFilterByCreatedTime__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_QueryFilterByCreatedTime__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_QueryOrderFilter__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_QueryOrderFilter__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_CurrencyConfig__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_CurrencyConfig__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_SpecialistConfig__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_SpecialistConfig__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_FeeEstimationData__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_FeeEstimationData__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_FeeDetail__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_FeeDetail__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_PriceDetail__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_PriceDetail__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_Count__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_Count__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_AdvancedSubscription__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_AdvancedSubscription__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_HistoryData__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_HistoryData__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static ExchangeTypes() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "ChlibmV0L2V4Y2hhbmdlX3R5cGVzLnByb3RvEhZibmV0LnByb3RvY29sLmV4" + + "Y2hhbmdlGhFibmV0L2VudGl0eS5wcm90bxoTYm5ldC9leGNoYW5nZS5wcm90" + + "byKkAQoJT3JkZXJCb29rEjIKBm9iamVjdBgBIAIoCzIiLmJuZXQucHJvdG9j" + + "b2wuZXhjaGFuZ2UuQmxvYk9mVHlwZRIPCgdwcm9ncmFtGAIgAigHEhUKDWNv" + + "bXBhdGliaWxpdHkYAyACKA0SEAoIY3VycmVuY3kYBCACKAkSEgoKc3BlY2lh" + + "bGlzdBgFIAIoBRIVCg1hbGxvd2VkX3JlYWxtGAYgAigNImMKD09yZGVyQm9v" + + "a0hhbmRsZRI5CgxwYXJ0aXRpb25faWQYASACKAsyIy5ibmV0LnByb3RvY29s" + + "LmV4Y2hhbmdlLlBhcnRpdGlvbklkEhUKDW9yZGVyX2Jvb2tfaWQYAiACKAQi" + + "qgIKFU9yZGVyQm9va05vdGlmaWNhdGlvbhI1CgpvcmRlcl9ib29rGAEgAigL" + + "MiEuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5PcmRlckJvb2sSOQoMcGFydGl0" + + "aW9uX2lkGAIgAigLMiMuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5QYXJ0aXRp" + + "b25JZBIVCg1vcmRlcl9ib29rX2lkGAMgAigEEhoKD3RyYWRlX25vd19wcmlj" + + "ZRgEIAEoBDoBMBIYCg13aW5uaW5nX3ByaWNlGAUgASgEOgEwEg4KBnN0YXR1" + + "cxgGIAIoDRITCgt1cGRhdGVfdGltZRgHIAIoBBIWCgtjbG9zZWRfdGltZRgI" + + "IAEoBDoBMBIVCg1maWxsZWRfYW1vdW50GAkgAigEIvsCChBPcmRlckJvb2tT" + + "dW1tYXJ5EjkKDHBhcnRpdGlvbl9pZBgBIAIoCzIjLmJuZXQucHJvdG9jb2wu" + + "ZXhjaGFuZ2UuUGFydGl0aW9uSWQSFQoNb3JkZXJfYm9va19pZBgCIAIoBBIO" + + "CgZyZXN1bHQYAyACKA0SNQoKb3JkZXJfYm9vaxgEIAEoCzIhLmJuZXQucHJv" + + "dG9jb2wuZXhjaGFuZ2UuT3JkZXJCb29rEg4KBmFtb3VudBgFIAEoBBIYChBi" + + "ZXN0X29mZmVyX3ByaWNlGAYgASgEEhYKDmJlc3RfYmlkX3ByaWNlGAcgASgE" + + "EhAKCGVuZF90aW1lGAggASgEEg4KBnN0YXR1cxgJIAEoBRIUCgxjcmVhdGVk" + + "X3RpbWUYCiABKAQSEwoLYWN0aXZlX3RpbWUYCyABKAQSEwoLY2xvc2VkX3Rp" + + "bWUYDCABKAQSDgoGcmVhc29uGA0gASgNEhoKEm91dF9iaWRfdW5pdF9wcmlj" + + "ZRgOIAEoBCLNAgoFT3JkZXISDgoGYW1vdW50GAEgAigNEhIKCnN0YXJ0X3Rp" + + "bWUYAiABKAQSEAoIZW5kX3RpbWUYAyABKAQSOwoRYWNjb3VudF9mb3JfbW9u" + + "ZXkYBCABKAsyIC5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLkJsb2JGcm9tEjoK" + + "EGFjY291bnRfZm9yX2l0ZW0YBSABKAsyIC5ibmV0LnByb3RvY29sLmV4Y2hh" + + "bmdlLkJsb2JGcm9tEi0KDGJuZXRfYWNjb3VudBgGIAEoCzIXLmJuZXQucHJv" + + "dG9jb2wuRW50aXR5SWQSLQoMZ2FtZV9hY2NvdW50GAcgASgLMhcuYm5ldC5w" + + "cm90b2NvbC5FbnRpdHlJZBI3CgpzZXNzaW9uX2lkGAggASgLMiMuYm5ldC5w" + + "cm90b2NvbC5leGNoYW5nZS5QYXJ0aXRpb25JZCKqBAoJRXh0ZW5zaW9uEjkK" + + "DHBhcnRpdGlvbl9pZBgBIAIoCzIjLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2Uu" + + "UGFydGl0aW9uSWQSFQoNb3JkZXJfYm9va19pZBgCIAIoBBIQCghvcmRlcl9p" + + "ZBgDIAIoBBIVCg1maWxsZWRfYW1vdW50GAQgASgEEhQKDG9yZGVyX3N0YXR1" + + "cxgFIAEoBRIXCg9hdXRob3JpemVkX3RpbWUYBiABKAQSFAoMY3JlYXRlZF90" + + "aW1lGAcgASgEEhMKC2Nsb3NlZF90aW1lGAggASgEEg4KBnJlYXNvbhgJIAEo" + + "DRI1CgpvcmRlcl9ib29rGAogASgLMiEuYm5ldC5wcm90b2NvbC5leGNoYW5n" + + "ZS5PcmRlckJvb2sSGQoRb3JkZXJfYm9va19zdGF0dXMYCyABKAQSFgoObW9u" + + "ZXlfdG9fY2xhaW0YDCABKAQSFgoOaXRlbXNfdG9fY2xhaW0YDSABKAQSGwoM" + + "cmlza19kZWxheWVkGA4gASgIOgVmYWxzZRIZChFmYWlsX29yZGVyX2FjdGlv" + + "bhgPIAEoDRIYChBmYWlsX29iamVjdF90eXBlGBAgASgNEhcKD2ZhaWxfZXJy" + + "b3JfY29kZRgRIAEoDRIdChVmYWlsX2V4dHJhX2Vycm9yX2NvZGUYEiABKA0S" + + "EAoIcmVmdW5kZWQYEyABKAQSGgoSZmlsbGVkX2Z1bmRfYW1vdW50GBQgASgE" + + "InwKBU9mZmVyEiwKBW9yZGVyGAEgAigLMh0uYm5ldC5wcm90b2NvbC5leGNo" + + "YW5nZS5PcmRlchIXCg90cmFkZV9ub3dfcHJpY2UYAiABKAQSFQoNcmVzZXJ2" + + "ZV9wcmljZRgDIAEoBBIVCg1vdXRfYmlkX3ByaWNlGAQgASgEIpIBCg1PZmZl" + + "ckV4dGVuZGVkEiwKBW9mZmVyGAEgAigLMh0uYm5ldC5wcm90b2NvbC5leGNo" + + "YW5nZS5PZmZlchI0CglleHRlbnNpb24YAiACKAsyIS5ibmV0LnByb3RvY29s" + + "LmV4Y2hhbmdlLkV4dGVuc2lvbhIdChVjdXJyZW50X3dpbm5pbmdfcHJpY2UY" + + "AyABKAQitQEKDU9mZmVyQ3JlYXRpb24SLAoFb2ZmZXIYASACKAsyHS5ibmV0" + + "LnByb3RvY29sLmV4Y2hhbmdlLk9mZmVyEhgKEGF1Y3Rpb25fZHVyYXRpb24Y" + + "AiABKAQSGwoTYXVjdGlvbl9zdGFydF9kZWxheRgDIAEoBBI/Cg9iaWxsaW5n" + + "X2FkZHJlc3MYBCABKAsyJi5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLkJpbGxp" + + "bmdBZGRyZXNzImcKA0JpZBIsCgVvcmRlchgBIAIoCzIdLmJuZXQucHJvdG9j" + + "b2wuZXhjaGFuZ2UuT3JkZXISGgoSY3VycmVudF91bml0X3ByaWNlGAIgASgE" + + "EhYKDm1heF91bml0X3ByaWNlGAMgASgEIooCCgtCaWRFeHRlbmRlZBIoCgNi" + + "aWQYASACKAsyGy5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLkJpZBI0CglleHRl" + + "bnNpb24YAiACKAsyIS5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLkV4dGVuc2lv" + + "bhIbChNvZmZlcl9vdXRfYmlkX3ByaWNlGAMgASgEEh0KFW9mZmVyX3RyYWRl" + + "X25vd19wcmljZRgEIAEoBBIjChtvZmZlcl9jdXJyZW50X3dpbm5pbmdfcHJp" + + "Y2UYBSABKAQSHgoWYmlkX2N1cnJlbnRfdW5pdF9wcmljZRgGIAEoBBIaChJi" + + "aWRfbWF4X3VuaXRfcHJpY2UYByABKAQizAEKC0JpZENyZWF0aW9uEigKA2Jp" + + "ZBgBIAIoCzIbLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuQmlkEhgKEGF1Y3Rp" + + "b25fZHVyYXRpb24YAiABKAQSGwoTYXVjdGlvbl9zdGFydF9kZWxheRgDIAEo" + + "BBI/Cg9iaWxsaW5nX2FkZHJlc3MYBCABKAsyJi5ibmV0LnByb3RvY29sLmV4" + + "Y2hhbmdlLkJpbGxpbmdBZGRyZXNzEhsKDGZpbGxfb3Jfa2lsbBgFIAEoCDoF" + + "ZmFsc2UinQEKDU9yZGVyRXh0ZW5kZWQSEgoKb3JkZXJfdHlwZRgBIAIoDRI5" + + "CgxiaWRfZXh0ZW5kZWQYAiABKAsyIy5ibmV0LnByb3RvY29sLmV4Y2hhbmdl" + + "LkJpZEV4dGVuZGVkEj0KDm9mZmVyX2V4dGVuZGVkGAMgASgLMiUuYm5ldC5w" + + "cm90b2NvbC5leGNoYW5nZS5PZmZlckV4dGVuZGVkIlMKFFF1ZXJ5RmlsdGVy" + + "QnlPcmRlcklkEhIKCm1heF9yZXN1bHQYASACKA0SFAoMcmVmX29yZGVyX2lk" + + "GAIgASgEEhEKCXJlZl9wcmljZRgDIAEoBCJaChhRdWVyeUZpbHRlckJ5Q3Jl" + + "YXRlZFRpbWUSEgoKbWF4X3Jlc3VsdBgBIAIoDRIYChByZWZfY3JlYXRlZF90" + + "aW1lGAIgASgEEhAKCGN1cnJlbmN5GAMgASgJIvYBChBRdWVyeU9yZGVyRmls" + + "dGVyEhAKCGN1cnJlbmN5GAEgASgJEhIKCnNwZWNpYWxpc3QYAiABKA0SEgoK" + + "b3JkZXJfdHlwZRgDIAEoDRIUCgljbGFpbWFibGUYBCABKA06ATASGQoRb3Jk" + + "ZXJfc3RhdHVzX21hc2sYBSABKA0SFQoGcm9sbHVwGAYgASgIOgVmYWxzZRJF" + + "Cgt0aW1lX2ZpbHRlchgHIAIoCzIwLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2Uu" + + "UXVlcnlGaWx0ZXJCeUNyZWF0ZWRUaW1lEhkKEW9yZGVyX2Jvb2tfc3RhdHVz" + + "GAggASgNIpcBCg5DdXJyZW5jeUNvbmZpZxIQCghjdXJyZW5jeRgBIAIoCRIR" + + "Cgl0aWNrX3NpemUYAiABKAQSFgoObWluX3VuaXRfcHJpY2UYAyABKAQSFgoO" + + "bWF4X3VuaXRfcHJpY2UYBCABKAQSFwoPbWluX3RvdGFsX3ByaWNlGAUgASgE" + + "EhcKD21heF90b3RhbF9wcmljZRgGIAEoBCKvAwoQU3BlY2lhbGlzdENvbmZp" + + "ZxISCgpzcGVjaWFsaXN0GAEgAigFEh0KEWF1Y3Rpb25fZHVyYXRpb25zGAIg" + + "AygEQgIQARIgChRhdWN0aW9uX3N0YXJ0X2RlbGF5cxgDIAMoBEICEAESJAoc" + + "YW50aV9zbmlwaW5nX2V4dGVuc2lvbl9kZWxheRgEIAEoBBIbChBtYXhfaXRl" + + "bXNfYW1vdW50GAUgASgEOgEwEiAKGHN0YXJ0aW5nX3VuaXRfcHJpY2VfcnVs" + + "ZRgGIAEoBRIgChhyZXNlcnZlZF91bml0X3ByaWNlX3J1bGUYByABKAUSIQoZ" + + "dHJhZGVfbm93X3VuaXRfcHJpY2VfcnVsZRgIIAEoBRIfChdjdXJyZW50X3Vu" + + "aXRfcHJpY2VfcnVsZRgJIAEoBRIfChdtYXhpbXVtX3VuaXRfcHJpY2VfcnVs" + + "ZRgKIAEoBRI/Cg9jdXJyZW5jeV9jb25maWcYCyADKAsyJi5ibmV0LnByb3Rv" + + "Y29sLmV4Y2hhbmdlLkN1cnJlbmN5Q29uZmlnEhkKEWZpbGxfb3Jfa2lsbF9y" + + "dWxlGAwgASgFIvUBChFGZWVFc3RpbWF0aW9uRGF0YRIPCgdwcm9ncmFtGAEg" + + "AigHEhIKCnNwZWNpYWxpc3QYAiACKAUSEAoIY3VycmVuY3kYAyACKAkSDgoG" + + "c291cmNlGAQgAigHEhQKDG1vbmV5X2Ftb3VudBgFIAIoBBITCgtpdGVtX2Ft" + + "b3VudBgGIAIoBBItCgxibmV0X2FjY291bnQYByABKAsyFy5ibmV0LnByb3Rv" + + "Y29sLkVudGl0eUlkEj8KD2JpbGxpbmdfYWRkcmVzcxgIIAEoCzImLmJuZXQu" + + "cHJvdG9jb2wuZXhjaGFuZ2UuQmlsbGluZ0FkZHJlc3MioQMKCUZlZURldGFp" + + "bBIOCgZyb3dudW0YASACKAQSGgoSZmVlX2F1dGhfZGV0YWlsX2lkGAIgAigE" + + "Eg4KBmZlZV9pZBgDIAEoBBISCgpmZWVfYW1vdW50GAQgASgEEhcKD2Rpc2Nv" + + "dW50X2Ftb3VudBgFIAEoBBIUCgxmZWVfZ3JvdXBfaWQYBiABKAQSFgoOZmVl" + + "X2dyb3VwX25hbWUYByABKAkSFwoPZmxhdF9mZWVfYW1vdW50GAggASgEEhgK" + + "EHNjYWxpbmdfZmVlX3JhdGUYCSABKAISFgoObWF4X2ZlZV9hbW91bnQYCiAB" + + "KAQSFwoPZmVlX2Rlc2NyaXB0aW9uGAsgASgJEg4KBmlzX3RheBgMIAIoCBIW" + + "Cg5jb3Vwb25fYm9va19pZBgNIAEoBBITCgtjb3Vwb25fdHlwZRgOIAEoBBIa" + + "ChJjb3Vwb25fZGVzY3JpcHRpb24YDyABKAkSHwoXbGVmdF9vdmVyX2NvdXBv" + + "bl9jcmVkaXQYECABKAQSHwoXbGVmdF9vdmVyX2NvdXBvbl9jaGFyZ2UYESAB" + + "KAQiMgoLUHJpY2VEZXRhaWwSEwoLdHJhZGVfcHJpY2UYASACKAQSDgoGYW1v" + + "dW50GAIgAigEIiUKBUNvdW50Eg0KBWNvdW50GAEgAigNEg0KBWxpbWl0GAIg" + + "ASgNIkYKFEFkdmFuY2VkU3Vic2NyaXB0aW9uEg8KB3Byb2dyYW0YASACKAcS" + + "DQoFZXZlbnQYAiACKA0SDgoGcmVhc29uGAMgAygNIoMHCgtIaXN0b3J5RGF0" + + "YRIVCg1vcmRlcl9ib29rX2lkGAEgAigEEjkKDHBhcnRpdGlvbl9pZBgCIAIo" + + "CzIjLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuUGFydGl0aW9uSWQSEQoJYWN0" + + "aW9uX2lkGAMgAigEEhgKEHBhcmVudF9zZXR0bGVfaWQYBCABKAQSFgoOcGFy" + + "ZW50X3NldHRsZWQYBSABKAgSGQoRYXV0aG9yaXplZF9hbW91bnQYBiACKAQS" + + "HQoVYXV0aG9yaXplZF9mZWVfYW1vdW50GAcgASgEEg4KBmFtb3VudBgIIAIo" + + "BBISCgpmZWVfYW1vdW50GAkgASgEEhAKCGRlZmVycmVkGAogAigIEhkKEWhh" + + "c19iZWVuX2RlZmVycmVkGAsgAigIEhAKCHByb2dyZXNzGAwgAigEEg8KB2Ny" + + "ZWF0ZWQYDSACKAQSFgoOcmlza19jb21wbGV0ZWQYDiABKAQSEwoLcmlza19y" + + "ZXN1bHQYDyABKAQSFAoMcmlza192ZXJkaWN0GBAgASgEEhEKCWNvbXBsZXRl" + + "ZBgRIAEoBBITCgtyZXN1bHRfY29kZRgSIAEoBBI6ChBhY2NvdW50X2Zvcl9p" + + "dGVtGBMgAigLMiAuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5CbG9iRnJvbRI7" + + "ChFhY2NvdW50X2Zvcl9tb25leRgUIAIoCzIgLmJuZXQucHJvdG9jb2wuZXhj" + + "aGFuZ2UuQmxvYkZyb20SEgoKb3JkZXJfdHlwZRgVIAIoDRIQCghvcmRlcl9p" + + "ZBgWIAIoBBIPCgdhdXRoX2lkGBcgAigEEhgKEGF1dGhfb2JqZWN0X3R5cGUY" + + "GCACKA0SFwoPdHJhbnNfZGlyZWN0aW9uGBkgAigJEh4KFmF1dGhfY29tcGxl" + + "dGVfcHJvZ3Jlc3MYGiACKAQSHAoUYXV0aF9maWxsZWRfcHJvZ3Jlc3MYGyAC" + + "KAQSGwoTYXV0aF90b3RhbF9wcm9ncmVzcxgcIAIoBBI7CgthdXRoX2hhbmRs" + + "ZRgdIAIoCzImLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuQmxvYkZyb21PZlR5" + + "cGUSFQoNYXV0aF9kZWZlcnJlZBgeIAIoCBIyCgV0b2tlbhgfIAIoCzIjLmJu" + + "ZXQucHJvdG9jb2wuZXhjaGFuZ2UuUGFydGl0aW9uSWQ="); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_bnet_protocol_exchange_OrderBook__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_exchange_OrderBook__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_OrderBook__Descriptor, + new string[] { "Object", "Program", "Compatibility", "Currency", "Specialist", "AllowedRealm", }); + internal__static_bnet_protocol_exchange_OrderBookHandle__Descriptor = Descriptor.MessageTypes[1]; + internal__static_bnet_protocol_exchange_OrderBookHandle__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_OrderBookHandle__Descriptor, + new string[] { "PartitionId", "OrderBookId", }); + internal__static_bnet_protocol_exchange_OrderBookNotification__Descriptor = Descriptor.MessageTypes[2]; + internal__static_bnet_protocol_exchange_OrderBookNotification__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_OrderBookNotification__Descriptor, + new string[] { "OrderBook", "PartitionId", "OrderBookId", "TradeNowPrice", "WinningPrice", "Status", "UpdateTime", "ClosedTime", "FilledAmount", }); + internal__static_bnet_protocol_exchange_OrderBookSummary__Descriptor = Descriptor.MessageTypes[3]; + internal__static_bnet_protocol_exchange_OrderBookSummary__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_OrderBookSummary__Descriptor, + new string[] { "PartitionId", "OrderBookId", "Result", "OrderBook", "Amount", "BestOfferPrice", "BestBidPrice", "EndTime", "Status", "CreatedTime", "ActiveTime", "ClosedTime", "Reason", "OutBidUnitPrice", }); + internal__static_bnet_protocol_exchange_Order__Descriptor = Descriptor.MessageTypes[4]; + internal__static_bnet_protocol_exchange_Order__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_Order__Descriptor, + new string[] { "Amount", "StartTime", "EndTime", "AccountForMoney", "AccountForItem", "BnetAccount", "GameAccount", "SessionId", }); + internal__static_bnet_protocol_exchange_Extension__Descriptor = Descriptor.MessageTypes[5]; + internal__static_bnet_protocol_exchange_Extension__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_Extension__Descriptor, + new string[] { "PartitionId", "OrderBookId", "OrderId", "FilledAmount", "OrderStatus", "AuthorizedTime", "CreatedTime", "ClosedTime", "Reason", "OrderBook", "OrderBookStatus", "MoneyToClaim", "ItemsToClaim", "RiskDelayed", "FailOrderAction", "FailObjectType", "FailErrorCode", "FailExtraErrorCode", "Refunded", "FilledFundAmount", }); + internal__static_bnet_protocol_exchange_Offer__Descriptor = Descriptor.MessageTypes[6]; + internal__static_bnet_protocol_exchange_Offer__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_Offer__Descriptor, + new string[] { "Order", "TradeNowPrice", "ReservePrice", "OutBidPrice", }); + internal__static_bnet_protocol_exchange_OfferExtended__Descriptor = Descriptor.MessageTypes[7]; + internal__static_bnet_protocol_exchange_OfferExtended__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_OfferExtended__Descriptor, + new string[] { "Offer", "Extension", "CurrentWinningPrice", }); + internal__static_bnet_protocol_exchange_OfferCreation__Descriptor = Descriptor.MessageTypes[8]; + internal__static_bnet_protocol_exchange_OfferCreation__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_OfferCreation__Descriptor, + new string[] { "Offer", "AuctionDuration", "AuctionStartDelay", "BillingAddress", }); + internal__static_bnet_protocol_exchange_Bid__Descriptor = Descriptor.MessageTypes[9]; + internal__static_bnet_protocol_exchange_Bid__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_Bid__Descriptor, + new string[] { "Order", "CurrentUnitPrice", "MaxUnitPrice", }); + internal__static_bnet_protocol_exchange_BidExtended__Descriptor = Descriptor.MessageTypes[10]; + internal__static_bnet_protocol_exchange_BidExtended__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_BidExtended__Descriptor, + new string[] { "Bid", "Extension", "OfferOutBidPrice", "OfferTradeNowPrice", "OfferCurrentWinningPrice", "BidCurrentUnitPrice", "BidMaxUnitPrice", }); + internal__static_bnet_protocol_exchange_BidCreation__Descriptor = Descriptor.MessageTypes[11]; + internal__static_bnet_protocol_exchange_BidCreation__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_BidCreation__Descriptor, + new string[] { "Bid", "AuctionDuration", "AuctionStartDelay", "BillingAddress", "FillOrKill", }); + internal__static_bnet_protocol_exchange_OrderExtended__Descriptor = Descriptor.MessageTypes[12]; + internal__static_bnet_protocol_exchange_OrderExtended__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_OrderExtended__Descriptor, + new string[] { "OrderType", "BidExtended", "OfferExtended", }); + internal__static_bnet_protocol_exchange_QueryFilterByOrderId__Descriptor = Descriptor.MessageTypes[13]; + internal__static_bnet_protocol_exchange_QueryFilterByOrderId__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_QueryFilterByOrderId__Descriptor, + new string[] { "MaxResult", "RefOrderId", "RefPrice", }); + internal__static_bnet_protocol_exchange_QueryFilterByCreatedTime__Descriptor = Descriptor.MessageTypes[14]; + internal__static_bnet_protocol_exchange_QueryFilterByCreatedTime__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_QueryFilterByCreatedTime__Descriptor, + new string[] { "MaxResult", "RefCreatedTime", "Currency", }); + internal__static_bnet_protocol_exchange_QueryOrderFilter__Descriptor = Descriptor.MessageTypes[15]; + internal__static_bnet_protocol_exchange_QueryOrderFilter__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_QueryOrderFilter__Descriptor, + new string[] { "Currency", "Specialist", "OrderType", "Claimable", "OrderStatusMask", "Rollup", "TimeFilter", "OrderBookStatus", }); + internal__static_bnet_protocol_exchange_CurrencyConfig__Descriptor = Descriptor.MessageTypes[16]; + internal__static_bnet_protocol_exchange_CurrencyConfig__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_CurrencyConfig__Descriptor, + new string[] { "Currency", "TickSize", "MinUnitPrice", "MaxUnitPrice", "MinTotalPrice", "MaxTotalPrice", }); + internal__static_bnet_protocol_exchange_SpecialistConfig__Descriptor = Descriptor.MessageTypes[17]; + internal__static_bnet_protocol_exchange_SpecialistConfig__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_SpecialistConfig__Descriptor, + new string[] { "Specialist", "AuctionDurations", "AuctionStartDelays", "AntiSnipingExtensionDelay", "MaxItemsAmount", "StartingUnitPriceRule", "ReservedUnitPriceRule", "TradeNowUnitPriceRule", "CurrentUnitPriceRule", "MaximumUnitPriceRule", "CurrencyConfig", "FillOrKillRule", }); + internal__static_bnet_protocol_exchange_FeeEstimationData__Descriptor = Descriptor.MessageTypes[18]; + internal__static_bnet_protocol_exchange_FeeEstimationData__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_FeeEstimationData__Descriptor, + new string[] { "Program", "Specialist", "Currency", "Source", "MoneyAmount", "ItemAmount", "BnetAccount", "BillingAddress", }); + internal__static_bnet_protocol_exchange_FeeDetail__Descriptor = Descriptor.MessageTypes[19]; + internal__static_bnet_protocol_exchange_FeeDetail__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_FeeDetail__Descriptor, + new string[] { "Rownum", "FeeAuthDetailId", "FeeId", "FeeAmount", "DiscountAmount", "FeeGroupId", "FeeGroupName", "FlatFeeAmount", "ScalingFeeRate", "MaxFeeAmount", "FeeDescription", "IsTax", "CouponBookId", "CouponType", "CouponDescription", "LeftOverCouponCredit", "LeftOverCouponCharge", }); + internal__static_bnet_protocol_exchange_PriceDetail__Descriptor = Descriptor.MessageTypes[20]; + internal__static_bnet_protocol_exchange_PriceDetail__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_PriceDetail__Descriptor, + new string[] { "TradePrice", "Amount", }); + internal__static_bnet_protocol_exchange_Count__Descriptor = Descriptor.MessageTypes[21]; + internal__static_bnet_protocol_exchange_Count__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_Count__Descriptor, + new string[] { "Count_", "Limit", }); + internal__static_bnet_protocol_exchange_AdvancedSubscription__Descriptor = Descriptor.MessageTypes[22]; + internal__static_bnet_protocol_exchange_AdvancedSubscription__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_AdvancedSubscription__Descriptor, + new string[] { "Program", "Event", "Reason", }); + internal__static_bnet_protocol_exchange_HistoryData__Descriptor = Descriptor.MessageTypes[23]; + internal__static_bnet_protocol_exchange_HistoryData__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_HistoryData__Descriptor, + new string[] { "OrderBookId", "PartitionId", "ActionId", "ParentSettleId", "ParentSettled", "AuthorizedAmount", "AuthorizedFeeAmount", "Amount", "FeeAmount", "Deferred", "HasBeenDeferred", "Progress", "Created", "RiskCompleted", "RiskResult", "RiskVerdict", "Completed", "ResultCode", "AccountForItem", "AccountForMoney", "OrderType", "OrderId", "AuthId", "AuthObjectType", "TransDirection", "AuthCompleteProgress", "AuthFilledProgress", "AuthTotalProgress", "AuthHandle", "AuthDeferred", "Token", }); + return null; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::bnet.protocol.Entity.Descriptor, + global::bnet.protocol.exchange.Exchange.Descriptor, + }, assigner); + } + #endregion + + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class OrderBook : pb::GeneratedMessage { + private OrderBook() { } + private static readonly OrderBook defaultInstance = new OrderBook().MakeReadOnly(); + private static readonly string[] _orderBookFieldNames = new string[] { "allowed_realm", "compatibility", "currency", "object", "program", "specialist" }; + private static readonly uint[] _orderBookFieldTags = new uint[] { 48, 24, 34, 10, 21, 40 }; + public static OrderBook DefaultInstance { + get { return defaultInstance; } + } + + public override OrderBook DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override OrderBook ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_OrderBook__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_OrderBook__FieldAccessorTable; } + } + + public const int ObjectFieldNumber = 1; + private bool hasObject; + private global::bnet.protocol.exchange.BlobOfType object_; + public bool HasObject { + get { return hasObject; } + } + public global::bnet.protocol.exchange.BlobOfType Object { + get { return object_ ?? global::bnet.protocol.exchange.BlobOfType.DefaultInstance; } + } + + public const int ProgramFieldNumber = 2; + private bool hasProgram; + private uint program_; + public bool HasProgram { + get { return hasProgram; } + } + public uint Program { + get { return program_; } + } + + public const int CompatibilityFieldNumber = 3; + private bool hasCompatibility; + private uint compatibility_; + public bool HasCompatibility { + get { return hasCompatibility; } + } + public uint Compatibility { + get { return compatibility_; } + } + + public const int CurrencyFieldNumber = 4; + private bool hasCurrency; + private string currency_ = ""; + public bool HasCurrency { + get { return hasCurrency; } + } + public string Currency { + get { return currency_; } + } + + public const int SpecialistFieldNumber = 5; + private bool hasSpecialist; + private int specialist_; + public bool HasSpecialist { + get { return hasSpecialist; } + } + public int Specialist { + get { return specialist_; } + } + + public const int AllowedRealmFieldNumber = 6; + private bool hasAllowedRealm; + private uint allowedRealm_; + public bool HasAllowedRealm { + get { return hasAllowedRealm; } + } + public uint AllowedRealm { + get { return allowedRealm_; } + } + + public override bool IsInitialized { + get { + if (!hasObject) return false; + if (!hasProgram) return false; + if (!hasCompatibility) return false; + if (!hasCurrency) return false; + if (!hasSpecialist) return false; + if (!hasAllowedRealm) return false; + if (!Object.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _orderBookFieldNames; + if (hasObject) { + output.WriteMessage(1, field_names[3], Object); + } + if (hasProgram) { + output.WriteFixed32(2, field_names[4], Program); + } + if (hasCompatibility) { + output.WriteUInt32(3, field_names[1], Compatibility); + } + if (hasCurrency) { + output.WriteString(4, field_names[2], Currency); + } + if (hasSpecialist) { + output.WriteInt32(5, field_names[5], Specialist); + } + if (hasAllowedRealm) { + output.WriteUInt32(6, field_names[0], AllowedRealm); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasObject) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Object); + } + if (hasProgram) { + size += pb::CodedOutputStream.ComputeFixed32Size(2, Program); + } + if (hasCompatibility) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, Compatibility); + } + if (hasCurrency) { + size += pb::CodedOutputStream.ComputeStringSize(4, Currency); + } + if (hasSpecialist) { + size += pb::CodedOutputStream.ComputeInt32Size(5, Specialist); + } + if (hasAllowedRealm) { + size += pb::CodedOutputStream.ComputeUInt32Size(6, AllowedRealm); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static OrderBook ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static OrderBook ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static OrderBook ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static OrderBook ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static OrderBook ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static OrderBook ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static OrderBook ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static OrderBook ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static OrderBook ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static OrderBook ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private OrderBook MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(OrderBook prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(OrderBook cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private OrderBook result; + + private OrderBook PrepareBuilder() { + if (resultIsReadOnly) { + OrderBook original = result; + result = new OrderBook(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override OrderBook MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.OrderBook.Descriptor; } + } + + public override OrderBook DefaultInstanceForType { + get { return global::bnet.protocol.exchange.OrderBook.DefaultInstance; } + } + + public override OrderBook BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is OrderBook) { + return MergeFrom((OrderBook) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(OrderBook other) { + if (other == global::bnet.protocol.exchange.OrderBook.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasObject) { + MergeObject(other.Object); + } + if (other.HasProgram) { + Program = other.Program; + } + if (other.HasCompatibility) { + Compatibility = other.Compatibility; + } + if (other.HasCurrency) { + Currency = other.Currency; + } + if (other.HasSpecialist) { + Specialist = other.Specialist; + } + if (other.HasAllowedRealm) { + AllowedRealm = other.AllowedRealm; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_orderBookFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _orderBookFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.BlobOfType.Builder subBuilder = global::bnet.protocol.exchange.BlobOfType.CreateBuilder(); + if (result.hasObject) { + subBuilder.MergeFrom(Object); + } + input.ReadMessage(subBuilder, extensionRegistry); + Object = subBuilder.BuildPartial(); + break; + } + case 21: { + result.hasProgram = input.ReadFixed32(ref result.program_); + break; + } + case 24: { + result.hasCompatibility = input.ReadUInt32(ref result.compatibility_); + break; + } + case 34: { + result.hasCurrency = input.ReadString(ref result.currency_); + break; + } + case 40: { + result.hasSpecialist = input.ReadInt32(ref result.specialist_); + break; + } + case 48: { + result.hasAllowedRealm = input.ReadUInt32(ref result.allowedRealm_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasObject { + get { return result.hasObject; } + } + public global::bnet.protocol.exchange.BlobOfType Object { + get { return result.Object; } + set { SetObject(value); } + } + public Builder SetObject(global::bnet.protocol.exchange.BlobOfType value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasObject = true; + result.object_ = value; + return this; + } + public Builder SetObject(global::bnet.protocol.exchange.BlobOfType.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasObject = true; + result.object_ = builderForValue.Build(); + return this; + } + public Builder MergeObject(global::bnet.protocol.exchange.BlobOfType value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasObject && + result.object_ != global::bnet.protocol.exchange.BlobOfType.DefaultInstance) { + result.object_ = global::bnet.protocol.exchange.BlobOfType.CreateBuilder(result.object_).MergeFrom(value).BuildPartial(); + } else { + result.object_ = value; + } + result.hasObject = true; + return this; + } + public Builder ClearObject() { + PrepareBuilder(); + result.hasObject = false; + result.object_ = null; + return this; + } + + public bool HasProgram { + get { return result.hasProgram; } + } + public uint Program { + get { return result.Program; } + set { SetProgram(value); } + } + public Builder SetProgram(uint value) { + PrepareBuilder(); + result.hasProgram = true; + result.program_ = value; + return this; + } + public Builder ClearProgram() { + PrepareBuilder(); + result.hasProgram = false; + result.program_ = 0; + return this; + } + + public bool HasCompatibility { + get { return result.hasCompatibility; } + } + public uint Compatibility { + get { return result.Compatibility; } + set { SetCompatibility(value); } + } + public Builder SetCompatibility(uint value) { + PrepareBuilder(); + result.hasCompatibility = true; + result.compatibility_ = value; + return this; + } + public Builder ClearCompatibility() { + PrepareBuilder(); + result.hasCompatibility = false; + result.compatibility_ = 0; + return this; + } + + public bool HasCurrency { + get { return result.hasCurrency; } + } + public string Currency { + get { return result.Currency; } + set { SetCurrency(value); } + } + public Builder SetCurrency(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasCurrency = true; + result.currency_ = value; + return this; + } + public Builder ClearCurrency() { + PrepareBuilder(); + result.hasCurrency = false; + result.currency_ = ""; + return this; + } + + public bool HasSpecialist { + get { return result.hasSpecialist; } + } + public int Specialist { + get { return result.Specialist; } + set { SetSpecialist(value); } + } + public Builder SetSpecialist(int value) { + PrepareBuilder(); + result.hasSpecialist = true; + result.specialist_ = value; + return this; + } + public Builder ClearSpecialist() { + PrepareBuilder(); + result.hasSpecialist = false; + result.specialist_ = 0; + return this; + } + + public bool HasAllowedRealm { + get { return result.hasAllowedRealm; } + } + public uint AllowedRealm { + get { return result.AllowedRealm; } + set { SetAllowedRealm(value); } + } + public Builder SetAllowedRealm(uint value) { + PrepareBuilder(); + result.hasAllowedRealm = true; + result.allowedRealm_ = value; + return this; + } + public Builder ClearAllowedRealm() { + PrepareBuilder(); + result.hasAllowedRealm = false; + result.allowedRealm_ = 0; + return this; + } + } + static OrderBook() { + object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class OrderBookHandle : pb::GeneratedMessage { + private OrderBookHandle() { } + private static readonly OrderBookHandle defaultInstance = new OrderBookHandle().MakeReadOnly(); + private static readonly string[] _orderBookHandleFieldNames = new string[] { "order_book_id", "partition_id" }; + private static readonly uint[] _orderBookHandleFieldTags = new uint[] { 16, 10 }; + public static OrderBookHandle DefaultInstance { + get { return defaultInstance; } + } + + public override OrderBookHandle DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override OrderBookHandle ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_OrderBookHandle__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_OrderBookHandle__FieldAccessorTable; } + } + + public const int PartitionIdFieldNumber = 1; + private bool hasPartitionId; + private global::bnet.protocol.exchange.PartitionId partitionId_; + public bool HasPartitionId { + get { return hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int OrderBookIdFieldNumber = 2; + private bool hasOrderBookId; + private ulong orderBookId_; + public bool HasOrderBookId { + get { return hasOrderBookId; } + } + public ulong OrderBookId { + get { return orderBookId_; } + } + + public override bool IsInitialized { + get { + if (!hasPartitionId) return false; + if (!hasOrderBookId) return false; + if (!PartitionId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _orderBookHandleFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[1], PartitionId); + } + if (hasOrderBookId) { + output.WriteUInt64(2, field_names[0], OrderBookId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); + } + if (hasOrderBookId) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, OrderBookId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static OrderBookHandle ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static OrderBookHandle ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static OrderBookHandle ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static OrderBookHandle ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static OrderBookHandle ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static OrderBookHandle ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static OrderBookHandle ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static OrderBookHandle ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static OrderBookHandle ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static OrderBookHandle ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private OrderBookHandle MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(OrderBookHandle prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(OrderBookHandle cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private OrderBookHandle result; + + private OrderBookHandle PrepareBuilder() { + if (resultIsReadOnly) { + OrderBookHandle original = result; + result = new OrderBookHandle(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override OrderBookHandle MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.OrderBookHandle.Descriptor; } + } + + public override OrderBookHandle DefaultInstanceForType { + get { return global::bnet.protocol.exchange.OrderBookHandle.DefaultInstance; } + } + + public override OrderBookHandle BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is OrderBookHandle) { + return MergeFrom((OrderBookHandle) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(OrderBookHandle other) { + if (other == global::bnet.protocol.exchange.OrderBookHandle.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasPartitionId) { + MergePartitionId(other.PartitionId); + } + if (other.HasOrderBookId) { + OrderBookId = other.OrderBookId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_orderBookHandleFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _orderBookHandleFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasPartitionId) { + subBuilder.MergeFrom(PartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + PartitionId = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasOrderBookId = input.ReadUInt64(ref result.orderBookId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasPartitionId { + get { return result.hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = value; + return this; + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = builderForValue.Build(); + return this; + } + public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasPartitionId && + result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); + } else { + result.partitionId_ = value; + } + result.hasPartitionId = true; + return this; + } + public Builder ClearPartitionId() { + PrepareBuilder(); + result.hasPartitionId = false; + result.partitionId_ = null; + return this; + } + + public bool HasOrderBookId { + get { return result.hasOrderBookId; } + } + public ulong OrderBookId { + get { return result.OrderBookId; } + set { SetOrderBookId(value); } + } + public Builder SetOrderBookId(ulong value) { + PrepareBuilder(); + result.hasOrderBookId = true; + result.orderBookId_ = value; + return this; + } + public Builder ClearOrderBookId() { + PrepareBuilder(); + result.hasOrderBookId = false; + result.orderBookId_ = 0UL; + return this; + } + } + static OrderBookHandle() { + object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class OrderBookNotification : pb::GeneratedMessage { + private OrderBookNotification() { } + private static readonly OrderBookNotification defaultInstance = new OrderBookNotification().MakeReadOnly(); + private static readonly string[] _orderBookNotificationFieldNames = new string[] { "closed_time", "filled_amount", "order_book", "order_book_id", "partition_id", "status", "trade_now_price", "update_time", "winning_price" }; + private static readonly uint[] _orderBookNotificationFieldTags = new uint[] { 64, 72, 10, 24, 18, 48, 32, 56, 40 }; + public static OrderBookNotification DefaultInstance { + get { return defaultInstance; } + } + + public override OrderBookNotification DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override OrderBookNotification ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_OrderBookNotification__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_OrderBookNotification__FieldAccessorTable; } + } + + public const int OrderBookFieldNumber = 1; + private bool hasOrderBook; + private global::bnet.protocol.exchange.OrderBook orderBook_; + public bool HasOrderBook { + get { return hasOrderBook; } + } + public global::bnet.protocol.exchange.OrderBook OrderBook { + get { return orderBook_ ?? global::bnet.protocol.exchange.OrderBook.DefaultInstance; } + } + + public const int PartitionIdFieldNumber = 2; + private bool hasPartitionId; + private global::bnet.protocol.exchange.PartitionId partitionId_; + public bool HasPartitionId { + get { return hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int OrderBookIdFieldNumber = 3; + private bool hasOrderBookId; + private ulong orderBookId_; + public bool HasOrderBookId { + get { return hasOrderBookId; } + } + public ulong OrderBookId { + get { return orderBookId_; } + } + + public const int TradeNowPriceFieldNumber = 4; + private bool hasTradeNowPrice; + private ulong tradeNowPrice_; + public bool HasTradeNowPrice { + get { return hasTradeNowPrice; } + } + public ulong TradeNowPrice { + get { return tradeNowPrice_; } + } + + public const int WinningPriceFieldNumber = 5; + private bool hasWinningPrice; + private ulong winningPrice_; + public bool HasWinningPrice { + get { return hasWinningPrice; } + } + public ulong WinningPrice { + get { return winningPrice_; } + } + + public const int StatusFieldNumber = 6; + private bool hasStatus; + private uint status_; + public bool HasStatus { + get { return hasStatus; } + } + public uint Status { + get { return status_; } + } + + public const int UpdateTimeFieldNumber = 7; + private bool hasUpdateTime; + private ulong updateTime_; + public bool HasUpdateTime { + get { return hasUpdateTime; } + } + public ulong UpdateTime { + get { return updateTime_; } + } + + public const int ClosedTimeFieldNumber = 8; + private bool hasClosedTime; + private ulong closedTime_; + public bool HasClosedTime { + get { return hasClosedTime; } + } + public ulong ClosedTime { + get { return closedTime_; } + } + + public const int FilledAmountFieldNumber = 9; + private bool hasFilledAmount; + private ulong filledAmount_; + public bool HasFilledAmount { + get { return hasFilledAmount; } + } + public ulong FilledAmount { + get { return filledAmount_; } + } + + public override bool IsInitialized { + get { + if (!hasOrderBook) return false; + if (!hasPartitionId) return false; + if (!hasOrderBookId) return false; + if (!hasStatus) return false; + if (!hasUpdateTime) return false; + if (!hasFilledAmount) return false; + if (!OrderBook.IsInitialized) return false; + if (!PartitionId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _orderBookNotificationFieldNames; + if (hasOrderBook) { + output.WriteMessage(1, field_names[2], OrderBook); + } + if (hasPartitionId) { + output.WriteMessage(2, field_names[4], PartitionId); + } + if (hasOrderBookId) { + output.WriteUInt64(3, field_names[3], OrderBookId); + } + if (hasTradeNowPrice) { + output.WriteUInt64(4, field_names[6], TradeNowPrice); + } + if (hasWinningPrice) { + output.WriteUInt64(5, field_names[8], WinningPrice); + } + if (hasStatus) { + output.WriteUInt32(6, field_names[5], Status); + } + if (hasUpdateTime) { + output.WriteUInt64(7, field_names[7], UpdateTime); + } + if (hasClosedTime) { + output.WriteUInt64(8, field_names[0], ClosedTime); + } + if (hasFilledAmount) { + output.WriteUInt64(9, field_names[1], FilledAmount); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasOrderBook) { + size += pb::CodedOutputStream.ComputeMessageSize(1, OrderBook); + } + if (hasPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, PartitionId); + } + if (hasOrderBookId) { + size += pb::CodedOutputStream.ComputeUInt64Size(3, OrderBookId); + } + if (hasTradeNowPrice) { + size += pb::CodedOutputStream.ComputeUInt64Size(4, TradeNowPrice); + } + if (hasWinningPrice) { + size += pb::CodedOutputStream.ComputeUInt64Size(5, WinningPrice); + } + if (hasStatus) { + size += pb::CodedOutputStream.ComputeUInt32Size(6, Status); + } + if (hasUpdateTime) { + size += pb::CodedOutputStream.ComputeUInt64Size(7, UpdateTime); + } + if (hasClosedTime) { + size += pb::CodedOutputStream.ComputeUInt64Size(8, ClosedTime); + } + if (hasFilledAmount) { + size += pb::CodedOutputStream.ComputeUInt64Size(9, FilledAmount); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static OrderBookNotification ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static OrderBookNotification ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static OrderBookNotification ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static OrderBookNotification ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static OrderBookNotification ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static OrderBookNotification ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static OrderBookNotification ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static OrderBookNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static OrderBookNotification ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static OrderBookNotification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private OrderBookNotification MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(OrderBookNotification prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(OrderBookNotification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private OrderBookNotification result; + + private OrderBookNotification PrepareBuilder() { + if (resultIsReadOnly) { + OrderBookNotification original = result; + result = new OrderBookNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override OrderBookNotification MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.OrderBookNotification.Descriptor; } + } + + public override OrderBookNotification DefaultInstanceForType { + get { return global::bnet.protocol.exchange.OrderBookNotification.DefaultInstance; } + } + + public override OrderBookNotification BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is OrderBookNotification) { + return MergeFrom((OrderBookNotification) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(OrderBookNotification other) { + if (other == global::bnet.protocol.exchange.OrderBookNotification.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasOrderBook) { + MergeOrderBook(other.OrderBook); + } + if (other.HasPartitionId) { + MergePartitionId(other.PartitionId); + } + if (other.HasOrderBookId) { + OrderBookId = other.OrderBookId; + } + if (other.HasTradeNowPrice) { + TradeNowPrice = other.TradeNowPrice; + } + if (other.HasWinningPrice) { + WinningPrice = other.WinningPrice; + } + if (other.HasStatus) { + Status = other.Status; + } + if (other.HasUpdateTime) { + UpdateTime = other.UpdateTime; + } + if (other.HasClosedTime) { + ClosedTime = other.ClosedTime; + } + if (other.HasFilledAmount) { + FilledAmount = other.FilledAmount; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_orderBookNotificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _orderBookNotificationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.OrderBook.Builder subBuilder = global::bnet.protocol.exchange.OrderBook.CreateBuilder(); + if (result.hasOrderBook) { + subBuilder.MergeFrom(OrderBook); + } + input.ReadMessage(subBuilder, extensionRegistry); + OrderBook = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasPartitionId) { + subBuilder.MergeFrom(PartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + PartitionId = subBuilder.BuildPartial(); + break; + } + case 24: { + result.hasOrderBookId = input.ReadUInt64(ref result.orderBookId_); + break; + } + case 32: { + result.hasTradeNowPrice = input.ReadUInt64(ref result.tradeNowPrice_); + break; + } + case 40: { + result.hasWinningPrice = input.ReadUInt64(ref result.winningPrice_); + break; + } + case 48: { + result.hasStatus = input.ReadUInt32(ref result.status_); + break; + } + case 56: { + result.hasUpdateTime = input.ReadUInt64(ref result.updateTime_); + break; + } + case 64: { + result.hasClosedTime = input.ReadUInt64(ref result.closedTime_); + break; + } + case 72: { + result.hasFilledAmount = input.ReadUInt64(ref result.filledAmount_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasOrderBook { + get { return result.hasOrderBook; } + } + public global::bnet.protocol.exchange.OrderBook OrderBook { + get { return result.OrderBook; } + set { SetOrderBook(value); } + } + public Builder SetOrderBook(global::bnet.protocol.exchange.OrderBook value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOrderBook = true; + result.orderBook_ = value; + return this; + } + public Builder SetOrderBook(global::bnet.protocol.exchange.OrderBook.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOrderBook = true; + result.orderBook_ = builderForValue.Build(); + return this; + } + public Builder MergeOrderBook(global::bnet.protocol.exchange.OrderBook value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOrderBook && + result.orderBook_ != global::bnet.protocol.exchange.OrderBook.DefaultInstance) { + result.orderBook_ = global::bnet.protocol.exchange.OrderBook.CreateBuilder(result.orderBook_).MergeFrom(value).BuildPartial(); + } else { + result.orderBook_ = value; + } + result.hasOrderBook = true; + return this; + } + public Builder ClearOrderBook() { + PrepareBuilder(); + result.hasOrderBook = false; + result.orderBook_ = null; + return this; + } + + public bool HasPartitionId { + get { return result.hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = value; + return this; + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = builderForValue.Build(); + return this; + } + public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasPartitionId && + result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); + } else { + result.partitionId_ = value; + } + result.hasPartitionId = true; + return this; + } + public Builder ClearPartitionId() { + PrepareBuilder(); + result.hasPartitionId = false; + result.partitionId_ = null; + return this; + } + + public bool HasOrderBookId { + get { return result.hasOrderBookId; } + } + public ulong OrderBookId { + get { return result.OrderBookId; } + set { SetOrderBookId(value); } + } + public Builder SetOrderBookId(ulong value) { + PrepareBuilder(); + result.hasOrderBookId = true; + result.orderBookId_ = value; + return this; + } + public Builder ClearOrderBookId() { + PrepareBuilder(); + result.hasOrderBookId = false; + result.orderBookId_ = 0UL; + return this; + } + + public bool HasTradeNowPrice { + get { return result.hasTradeNowPrice; } + } + public ulong TradeNowPrice { + get { return result.TradeNowPrice; } + set { SetTradeNowPrice(value); } + } + public Builder SetTradeNowPrice(ulong value) { + PrepareBuilder(); + result.hasTradeNowPrice = true; + result.tradeNowPrice_ = value; + return this; + } + public Builder ClearTradeNowPrice() { + PrepareBuilder(); + result.hasTradeNowPrice = false; + result.tradeNowPrice_ = 0UL; + return this; + } + + public bool HasWinningPrice { + get { return result.hasWinningPrice; } + } + public ulong WinningPrice { + get { return result.WinningPrice; } + set { SetWinningPrice(value); } + } + public Builder SetWinningPrice(ulong value) { + PrepareBuilder(); + result.hasWinningPrice = true; + result.winningPrice_ = value; + return this; + } + public Builder ClearWinningPrice() { + PrepareBuilder(); + result.hasWinningPrice = false; + result.winningPrice_ = 0UL; + return this; + } + + public bool HasStatus { + get { return result.hasStatus; } + } + public uint Status { + get { return result.Status; } + set { SetStatus(value); } + } + public Builder SetStatus(uint value) { + PrepareBuilder(); + result.hasStatus = true; + result.status_ = value; + return this; + } + public Builder ClearStatus() { + PrepareBuilder(); + result.hasStatus = false; + result.status_ = 0; + return this; + } + + public bool HasUpdateTime { + get { return result.hasUpdateTime; } + } + public ulong UpdateTime { + get { return result.UpdateTime; } + set { SetUpdateTime(value); } + } + public Builder SetUpdateTime(ulong value) { + PrepareBuilder(); + result.hasUpdateTime = true; + result.updateTime_ = value; + return this; + } + public Builder ClearUpdateTime() { + PrepareBuilder(); + result.hasUpdateTime = false; + result.updateTime_ = 0UL; + return this; + } + + public bool HasClosedTime { + get { return result.hasClosedTime; } + } + public ulong ClosedTime { + get { return result.ClosedTime; } + set { SetClosedTime(value); } + } + public Builder SetClosedTime(ulong value) { + PrepareBuilder(); + result.hasClosedTime = true; + result.closedTime_ = value; + return this; + } + public Builder ClearClosedTime() { + PrepareBuilder(); + result.hasClosedTime = false; + result.closedTime_ = 0UL; + return this; + } + + public bool HasFilledAmount { + get { return result.hasFilledAmount; } + } + public ulong FilledAmount { + get { return result.FilledAmount; } + set { SetFilledAmount(value); } + } + public Builder SetFilledAmount(ulong value) { + PrepareBuilder(); + result.hasFilledAmount = true; + result.filledAmount_ = value; + return this; + } + public Builder ClearFilledAmount() { + PrepareBuilder(); + result.hasFilledAmount = false; + result.filledAmount_ = 0UL; + return this; + } + } + static OrderBookNotification() { + object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class OrderBookSummary : pb::GeneratedMessage { + private OrderBookSummary() { } + private static readonly OrderBookSummary defaultInstance = new OrderBookSummary().MakeReadOnly(); + private static readonly string[] _orderBookSummaryFieldNames = new string[] { "active_time", "amount", "best_bid_price", "best_offer_price", "closed_time", "created_time", "end_time", "order_book", "order_book_id", "out_bid_unit_price", "partition_id", "reason", "result", "status" }; + private static readonly uint[] _orderBookSummaryFieldTags = new uint[] { 88, 40, 56, 48, 96, 80, 64, 34, 16, 112, 10, 104, 24, 72 }; + public static OrderBookSummary DefaultInstance { + get { return defaultInstance; } + } + + public override OrderBookSummary DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override OrderBookSummary ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_OrderBookSummary__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_OrderBookSummary__FieldAccessorTable; } + } + + public const int PartitionIdFieldNumber = 1; + private bool hasPartitionId; + private global::bnet.protocol.exchange.PartitionId partitionId_; + public bool HasPartitionId { + get { return hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int OrderBookIdFieldNumber = 2; + private bool hasOrderBookId; + private ulong orderBookId_; + public bool HasOrderBookId { + get { return hasOrderBookId; } + } + public ulong OrderBookId { + get { return orderBookId_; } + } + + public const int ResultFieldNumber = 3; + private bool hasResult; + private uint result_; + public bool HasResult { + get { return hasResult; } + } + public uint Result { + get { return result_; } + } + + public const int OrderBookFieldNumber = 4; + private bool hasOrderBook; + private global::bnet.protocol.exchange.OrderBook orderBook_; + public bool HasOrderBook { + get { return hasOrderBook; } + } + public global::bnet.protocol.exchange.OrderBook OrderBook { + get { return orderBook_ ?? global::bnet.protocol.exchange.OrderBook.DefaultInstance; } + } + + public const int AmountFieldNumber = 5; + private bool hasAmount; + private ulong amount_; + public bool HasAmount { + get { return hasAmount; } + } + public ulong Amount { + get { return amount_; } + } + + public const int BestOfferPriceFieldNumber = 6; + private bool hasBestOfferPrice; + private ulong bestOfferPrice_; + public bool HasBestOfferPrice { + get { return hasBestOfferPrice; } + } + public ulong BestOfferPrice { + get { return bestOfferPrice_; } + } + + public const int BestBidPriceFieldNumber = 7; + private bool hasBestBidPrice; + private ulong bestBidPrice_; + public bool HasBestBidPrice { + get { return hasBestBidPrice; } + } + public ulong BestBidPrice { + get { return bestBidPrice_; } + } + + public const int EndTimeFieldNumber = 8; + private bool hasEndTime; + private ulong endTime_; + public bool HasEndTime { + get { return hasEndTime; } + } + public ulong EndTime { + get { return endTime_; } + } + + public const int StatusFieldNumber = 9; + private bool hasStatus; + private int status_; + public bool HasStatus { + get { return hasStatus; } + } + public int Status { + get { return status_; } + } + + public const int CreatedTimeFieldNumber = 10; + private bool hasCreatedTime; + private ulong createdTime_; + public bool HasCreatedTime { + get { return hasCreatedTime; } + } + public ulong CreatedTime { + get { return createdTime_; } + } + + public const int ActiveTimeFieldNumber = 11; + private bool hasActiveTime; + private ulong activeTime_; + public bool HasActiveTime { + get { return hasActiveTime; } + } + public ulong ActiveTime { + get { return activeTime_; } + } + + public const int ClosedTimeFieldNumber = 12; + private bool hasClosedTime; + private ulong closedTime_; + public bool HasClosedTime { + get { return hasClosedTime; } + } + public ulong ClosedTime { + get { return closedTime_; } + } + + public const int ReasonFieldNumber = 13; + private bool hasReason; + private uint reason_; + public bool HasReason { + get { return hasReason; } + } + public uint Reason { + get { return reason_; } + } + + public const int OutBidUnitPriceFieldNumber = 14; + private bool hasOutBidUnitPrice; + private ulong outBidUnitPrice_; + public bool HasOutBidUnitPrice { + get { return hasOutBidUnitPrice; } + } + public ulong OutBidUnitPrice { + get { return outBidUnitPrice_; } + } + + public override bool IsInitialized { + get { + if (!hasPartitionId) return false; + if (!hasOrderBookId) return false; + if (!hasResult) return false; + if (!PartitionId.IsInitialized) return false; + if (HasOrderBook) { + if (!OrderBook.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _orderBookSummaryFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[10], PartitionId); + } + if (hasOrderBookId) { + output.WriteUInt64(2, field_names[8], OrderBookId); + } + if (hasResult) { + output.WriteUInt32(3, field_names[12], Result); + } + if (hasOrderBook) { + output.WriteMessage(4, field_names[7], OrderBook); + } + if (hasAmount) { + output.WriteUInt64(5, field_names[1], Amount); + } + if (hasBestOfferPrice) { + output.WriteUInt64(6, field_names[3], BestOfferPrice); + } + if (hasBestBidPrice) { + output.WriteUInt64(7, field_names[2], BestBidPrice); + } + if (hasEndTime) { + output.WriteUInt64(8, field_names[6], EndTime); + } + if (hasStatus) { + output.WriteInt32(9, field_names[13], Status); + } + if (hasCreatedTime) { + output.WriteUInt64(10, field_names[5], CreatedTime); + } + if (hasActiveTime) { + output.WriteUInt64(11, field_names[0], ActiveTime); + } + if (hasClosedTime) { + output.WriteUInt64(12, field_names[4], ClosedTime); + } + if (hasReason) { + output.WriteUInt32(13, field_names[11], Reason); + } + if (hasOutBidUnitPrice) { + output.WriteUInt64(14, field_names[9], OutBidUnitPrice); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); + } + if (hasOrderBookId) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, OrderBookId); + } + if (hasResult) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, Result); + } + if (hasOrderBook) { + size += pb::CodedOutputStream.ComputeMessageSize(4, OrderBook); + } + if (hasAmount) { + size += pb::CodedOutputStream.ComputeUInt64Size(5, Amount); + } + if (hasBestOfferPrice) { + size += pb::CodedOutputStream.ComputeUInt64Size(6, BestOfferPrice); + } + if (hasBestBidPrice) { + size += pb::CodedOutputStream.ComputeUInt64Size(7, BestBidPrice); + } + if (hasEndTime) { + size += pb::CodedOutputStream.ComputeUInt64Size(8, EndTime); + } + if (hasStatus) { + size += pb::CodedOutputStream.ComputeInt32Size(9, Status); + } + if (hasCreatedTime) { + size += pb::CodedOutputStream.ComputeUInt64Size(10, CreatedTime); + } + if (hasActiveTime) { + size += pb::CodedOutputStream.ComputeUInt64Size(11, ActiveTime); + } + if (hasClosedTime) { + size += pb::CodedOutputStream.ComputeUInt64Size(12, ClosedTime); + } + if (hasReason) { + size += pb::CodedOutputStream.ComputeUInt32Size(13, Reason); + } + if (hasOutBidUnitPrice) { + size += pb::CodedOutputStream.ComputeUInt64Size(14, OutBidUnitPrice); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static OrderBookSummary ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static OrderBookSummary ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static OrderBookSummary ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static OrderBookSummary ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static OrderBookSummary ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static OrderBookSummary ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static OrderBookSummary ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static OrderBookSummary ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static OrderBookSummary ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static OrderBookSummary ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private OrderBookSummary MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(OrderBookSummary prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(OrderBookSummary cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private OrderBookSummary result; + + private OrderBookSummary PrepareBuilder() { + if (resultIsReadOnly) { + OrderBookSummary original = result; + result = new OrderBookSummary(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override OrderBookSummary MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.OrderBookSummary.Descriptor; } + } + + public override OrderBookSummary DefaultInstanceForType { + get { return global::bnet.protocol.exchange.OrderBookSummary.DefaultInstance; } + } + + public override OrderBookSummary BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is OrderBookSummary) { + return MergeFrom((OrderBookSummary) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(OrderBookSummary other) { + if (other == global::bnet.protocol.exchange.OrderBookSummary.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasPartitionId) { + MergePartitionId(other.PartitionId); + } + if (other.HasOrderBookId) { + OrderBookId = other.OrderBookId; + } + if (other.HasResult) { + Result = other.Result; + } + if (other.HasOrderBook) { + MergeOrderBook(other.OrderBook); + } + if (other.HasAmount) { + Amount = other.Amount; + } + if (other.HasBestOfferPrice) { + BestOfferPrice = other.BestOfferPrice; + } + if (other.HasBestBidPrice) { + BestBidPrice = other.BestBidPrice; + } + if (other.HasEndTime) { + EndTime = other.EndTime; + } + if (other.HasStatus) { + Status = other.Status; + } + if (other.HasCreatedTime) { + CreatedTime = other.CreatedTime; + } + if (other.HasActiveTime) { + ActiveTime = other.ActiveTime; + } + if (other.HasClosedTime) { + ClosedTime = other.ClosedTime; + } + if (other.HasReason) { + Reason = other.Reason; + } + if (other.HasOutBidUnitPrice) { + OutBidUnitPrice = other.OutBidUnitPrice; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_orderBookSummaryFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _orderBookSummaryFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasPartitionId) { + subBuilder.MergeFrom(PartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + PartitionId = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasOrderBookId = input.ReadUInt64(ref result.orderBookId_); + break; + } + case 24: { + result.hasResult = input.ReadUInt32(ref result.result_); + break; + } + case 34: { + global::bnet.protocol.exchange.OrderBook.Builder subBuilder = global::bnet.protocol.exchange.OrderBook.CreateBuilder(); + if (result.hasOrderBook) { + subBuilder.MergeFrom(OrderBook); + } + input.ReadMessage(subBuilder, extensionRegistry); + OrderBook = subBuilder.BuildPartial(); + break; + } + case 40: { + result.hasAmount = input.ReadUInt64(ref result.amount_); + break; + } + case 48: { + result.hasBestOfferPrice = input.ReadUInt64(ref result.bestOfferPrice_); + break; + } + case 56: { + result.hasBestBidPrice = input.ReadUInt64(ref result.bestBidPrice_); + break; + } + case 64: { + result.hasEndTime = input.ReadUInt64(ref result.endTime_); + break; + } + case 72: { + result.hasStatus = input.ReadInt32(ref result.status_); + break; + } + case 80: { + result.hasCreatedTime = input.ReadUInt64(ref result.createdTime_); + break; + } + case 88: { + result.hasActiveTime = input.ReadUInt64(ref result.activeTime_); + break; + } + case 96: { + result.hasClosedTime = input.ReadUInt64(ref result.closedTime_); + break; + } + case 104: { + result.hasReason = input.ReadUInt32(ref result.reason_); + break; + } + case 112: { + result.hasOutBidUnitPrice = input.ReadUInt64(ref result.outBidUnitPrice_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasPartitionId { + get { return result.hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = value; + return this; + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = builderForValue.Build(); + return this; + } + public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasPartitionId && + result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); + } else { + result.partitionId_ = value; + } + result.hasPartitionId = true; + return this; + } + public Builder ClearPartitionId() { + PrepareBuilder(); + result.hasPartitionId = false; + result.partitionId_ = null; + return this; + } + + public bool HasOrderBookId { + get { return result.hasOrderBookId; } + } + public ulong OrderBookId { + get { return result.OrderBookId; } + set { SetOrderBookId(value); } + } + public Builder SetOrderBookId(ulong value) { + PrepareBuilder(); + result.hasOrderBookId = true; + result.orderBookId_ = value; + return this; + } + public Builder ClearOrderBookId() { + PrepareBuilder(); + result.hasOrderBookId = false; + result.orderBookId_ = 0UL; + return this; + } + + public bool HasResult { + get { return result.hasResult; } + } + public uint Result { + get { return result.Result; } + set { SetResult(value); } + } + public Builder SetResult(uint value) { + PrepareBuilder(); + result.hasResult = true; + result.result_ = value; + return this; + } + public Builder ClearResult() { + PrepareBuilder(); + result.hasResult = false; + result.result_ = 0; + return this; + } + + public bool HasOrderBook { + get { return result.hasOrderBook; } + } + public global::bnet.protocol.exchange.OrderBook OrderBook { + get { return result.OrderBook; } + set { SetOrderBook(value); } + } + public Builder SetOrderBook(global::bnet.protocol.exchange.OrderBook value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOrderBook = true; + result.orderBook_ = value; + return this; + } + public Builder SetOrderBook(global::bnet.protocol.exchange.OrderBook.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOrderBook = true; + result.orderBook_ = builderForValue.Build(); + return this; + } + public Builder MergeOrderBook(global::bnet.protocol.exchange.OrderBook value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOrderBook && + result.orderBook_ != global::bnet.protocol.exchange.OrderBook.DefaultInstance) { + result.orderBook_ = global::bnet.protocol.exchange.OrderBook.CreateBuilder(result.orderBook_).MergeFrom(value).BuildPartial(); + } else { + result.orderBook_ = value; + } + result.hasOrderBook = true; + return this; + } + public Builder ClearOrderBook() { + PrepareBuilder(); + result.hasOrderBook = false; + result.orderBook_ = null; + return this; + } + + public bool HasAmount { + get { return result.hasAmount; } + } + public ulong Amount { + get { return result.Amount; } + set { SetAmount(value); } + } + public Builder SetAmount(ulong value) { + PrepareBuilder(); + result.hasAmount = true; + result.amount_ = value; + return this; + } + public Builder ClearAmount() { + PrepareBuilder(); + result.hasAmount = false; + result.amount_ = 0UL; + return this; + } + + public bool HasBestOfferPrice { + get { return result.hasBestOfferPrice; } + } + public ulong BestOfferPrice { + get { return result.BestOfferPrice; } + set { SetBestOfferPrice(value); } + } + public Builder SetBestOfferPrice(ulong value) { + PrepareBuilder(); + result.hasBestOfferPrice = true; + result.bestOfferPrice_ = value; + return this; + } + public Builder ClearBestOfferPrice() { + PrepareBuilder(); + result.hasBestOfferPrice = false; + result.bestOfferPrice_ = 0UL; + return this; + } + + public bool HasBestBidPrice { + get { return result.hasBestBidPrice; } + } + public ulong BestBidPrice { + get { return result.BestBidPrice; } + set { SetBestBidPrice(value); } + } + public Builder SetBestBidPrice(ulong value) { + PrepareBuilder(); + result.hasBestBidPrice = true; + result.bestBidPrice_ = value; + return this; + } + public Builder ClearBestBidPrice() { + PrepareBuilder(); + result.hasBestBidPrice = false; + result.bestBidPrice_ = 0UL; + return this; + } + + public bool HasEndTime { + get { return result.hasEndTime; } + } + public ulong EndTime { + get { return result.EndTime; } + set { SetEndTime(value); } + } + public Builder SetEndTime(ulong value) { + PrepareBuilder(); + result.hasEndTime = true; + result.endTime_ = value; + return this; + } + public Builder ClearEndTime() { + PrepareBuilder(); + result.hasEndTime = false; + result.endTime_ = 0UL; + return this; + } + + public bool HasStatus { + get { return result.hasStatus; } + } + public int Status { + get { return result.Status; } + set { SetStatus(value); } + } + public Builder SetStatus(int value) { + PrepareBuilder(); + result.hasStatus = true; + result.status_ = value; + return this; + } + public Builder ClearStatus() { + PrepareBuilder(); + result.hasStatus = false; + result.status_ = 0; + return this; + } + + public bool HasCreatedTime { + get { return result.hasCreatedTime; } + } + public ulong CreatedTime { + get { return result.CreatedTime; } + set { SetCreatedTime(value); } + } + public Builder SetCreatedTime(ulong value) { + PrepareBuilder(); + result.hasCreatedTime = true; + result.createdTime_ = value; + return this; + } + public Builder ClearCreatedTime() { + PrepareBuilder(); + result.hasCreatedTime = false; + result.createdTime_ = 0UL; + return this; + } + + public bool HasActiveTime { + get { return result.hasActiveTime; } + } + public ulong ActiveTime { + get { return result.ActiveTime; } + set { SetActiveTime(value); } + } + public Builder SetActiveTime(ulong value) { + PrepareBuilder(); + result.hasActiveTime = true; + result.activeTime_ = value; + return this; + } + public Builder ClearActiveTime() { + PrepareBuilder(); + result.hasActiveTime = false; + result.activeTime_ = 0UL; + return this; + } + + public bool HasClosedTime { + get { return result.hasClosedTime; } + } + public ulong ClosedTime { + get { return result.ClosedTime; } + set { SetClosedTime(value); } + } + public Builder SetClosedTime(ulong value) { + PrepareBuilder(); + result.hasClosedTime = true; + result.closedTime_ = value; + return this; + } + public Builder ClearClosedTime() { + PrepareBuilder(); + result.hasClosedTime = false; + result.closedTime_ = 0UL; + return this; + } + + public bool HasReason { + get { return result.hasReason; } + } + public uint Reason { + get { return result.Reason; } + set { SetReason(value); } + } + public Builder SetReason(uint value) { + PrepareBuilder(); + result.hasReason = true; + result.reason_ = value; + return this; + } + public Builder ClearReason() { + PrepareBuilder(); + result.hasReason = false; + result.reason_ = 0; + return this; + } + + public bool HasOutBidUnitPrice { + get { return result.hasOutBidUnitPrice; } + } + public ulong OutBidUnitPrice { + get { return result.OutBidUnitPrice; } + set { SetOutBidUnitPrice(value); } + } + public Builder SetOutBidUnitPrice(ulong value) { + PrepareBuilder(); + result.hasOutBidUnitPrice = true; + result.outBidUnitPrice_ = value; + return this; + } + public Builder ClearOutBidUnitPrice() { + PrepareBuilder(); + result.hasOutBidUnitPrice = false; + result.outBidUnitPrice_ = 0UL; + return this; + } + } + static OrderBookSummary() { + object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Order : pb::GeneratedMessage { + private Order() { } + private static readonly Order defaultInstance = new Order().MakeReadOnly(); + private static readonly string[] _orderFieldNames = new string[] { "account_for_item", "account_for_money", "amount", "bnet_account", "end_time", "game_account", "session_id", "start_time" }; + private static readonly uint[] _orderFieldTags = new uint[] { 42, 34, 8, 50, 24, 58, 66, 16 }; + public static Order DefaultInstance { + get { return defaultInstance; } + } + + public override Order DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Order ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_Order__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_Order__FieldAccessorTable; } + } + + public const int AmountFieldNumber = 1; + private bool hasAmount; + private uint amount_; + public bool HasAmount { + get { return hasAmount; } + } + public uint Amount { + get { return amount_; } + } + + public const int StartTimeFieldNumber = 2; + private bool hasStartTime; + private ulong startTime_; + public bool HasStartTime { + get { return hasStartTime; } + } + public ulong StartTime { + get { return startTime_; } + } + + public const int EndTimeFieldNumber = 3; + private bool hasEndTime; + private ulong endTime_; + public bool HasEndTime { + get { return hasEndTime; } + } + public ulong EndTime { + get { return endTime_; } + } + + public const int AccountForMoneyFieldNumber = 4; + private bool hasAccountForMoney; + private global::bnet.protocol.exchange.BlobFrom accountForMoney_; + public bool HasAccountForMoney { + get { return hasAccountForMoney; } + } + public global::bnet.protocol.exchange.BlobFrom AccountForMoney { + get { return accountForMoney_ ?? global::bnet.protocol.exchange.BlobFrom.DefaultInstance; } + } + + public const int AccountForItemFieldNumber = 5; + private bool hasAccountForItem; + private global::bnet.protocol.exchange.BlobFrom accountForItem_; + public bool HasAccountForItem { + get { return hasAccountForItem; } + } + public global::bnet.protocol.exchange.BlobFrom AccountForItem { + get { return accountForItem_ ?? global::bnet.protocol.exchange.BlobFrom.DefaultInstance; } + } + + public const int BnetAccountFieldNumber = 6; + private bool hasBnetAccount; + private global::bnet.protocol.EntityId bnetAccount_; + public bool HasBnetAccount { + get { return hasBnetAccount; } + } + public global::bnet.protocol.EntityId BnetAccount { + get { return bnetAccount_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int GameAccountFieldNumber = 7; + private bool hasGameAccount; + private global::bnet.protocol.EntityId gameAccount_; + public bool HasGameAccount { + get { return hasGameAccount; } + } + public global::bnet.protocol.EntityId GameAccount { + get { return gameAccount_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int SessionIdFieldNumber = 8; + private bool hasSessionId; + private global::bnet.protocol.exchange.PartitionId sessionId_; + public bool HasSessionId { + get { return hasSessionId; } + } + public global::bnet.protocol.exchange.PartitionId SessionId { + get { return sessionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasAmount) return false; + if (HasAccountForMoney) { + if (!AccountForMoney.IsInitialized) return false; + } + if (HasAccountForItem) { + if (!AccountForItem.IsInitialized) return false; + } + if (HasBnetAccount) { + if (!BnetAccount.IsInitialized) return false; + } + if (HasGameAccount) { + if (!GameAccount.IsInitialized) return false; + } + if (HasSessionId) { + if (!SessionId.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _orderFieldNames; + if (hasAmount) { + output.WriteUInt32(1, field_names[2], Amount); + } + if (hasStartTime) { + output.WriteUInt64(2, field_names[7], StartTime); + } + if (hasEndTime) { + output.WriteUInt64(3, field_names[4], EndTime); + } + if (hasAccountForMoney) { + output.WriteMessage(4, field_names[1], AccountForMoney); + } + if (hasAccountForItem) { + output.WriteMessage(5, field_names[0], AccountForItem); + } + if (hasBnetAccount) { + output.WriteMessage(6, field_names[3], BnetAccount); + } + if (hasGameAccount) { + output.WriteMessage(7, field_names[5], GameAccount); + } + if (hasSessionId) { + output.WriteMessage(8, field_names[6], SessionId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAmount) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, Amount); + } + if (hasStartTime) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, StartTime); + } + if (hasEndTime) { + size += pb::CodedOutputStream.ComputeUInt64Size(3, EndTime); + } + if (hasAccountForMoney) { + size += pb::CodedOutputStream.ComputeMessageSize(4, AccountForMoney); + } + if (hasAccountForItem) { + size += pb::CodedOutputStream.ComputeMessageSize(5, AccountForItem); + } + if (hasBnetAccount) { + size += pb::CodedOutputStream.ComputeMessageSize(6, BnetAccount); + } + if (hasGameAccount) { + size += pb::CodedOutputStream.ComputeMessageSize(7, GameAccount); + } + if (hasSessionId) { + size += pb::CodedOutputStream.ComputeMessageSize(8, SessionId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static Order ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Order ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Order ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Order ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Order ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Order ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Order ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Order ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Order ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Order ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Order MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Order prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Order cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Order result; + + private Order PrepareBuilder() { + if (resultIsReadOnly) { + Order original = result; + result = new Order(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Order MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.Order.Descriptor; } + } + + public override Order DefaultInstanceForType { + get { return global::bnet.protocol.exchange.Order.DefaultInstance; } + } + + public override Order BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Order) { + return MergeFrom((Order) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Order other) { + if (other == global::bnet.protocol.exchange.Order.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAmount) { + Amount = other.Amount; + } + if (other.HasStartTime) { + StartTime = other.StartTime; + } + if (other.HasEndTime) { + EndTime = other.EndTime; + } + if (other.HasAccountForMoney) { + MergeAccountForMoney(other.AccountForMoney); + } + if (other.HasAccountForItem) { + MergeAccountForItem(other.AccountForItem); + } + if (other.HasBnetAccount) { + MergeBnetAccount(other.BnetAccount); + } + if (other.HasGameAccount) { + MergeGameAccount(other.GameAccount); + } + if (other.HasSessionId) { + MergeSessionId(other.SessionId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_orderFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _orderFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasAmount = input.ReadUInt32(ref result.amount_); + break; + } + case 16: { + result.hasStartTime = input.ReadUInt64(ref result.startTime_); + break; + } + case 24: { + result.hasEndTime = input.ReadUInt64(ref result.endTime_); + break; + } + case 34: { + global::bnet.protocol.exchange.BlobFrom.Builder subBuilder = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(); + if (result.hasAccountForMoney) { + subBuilder.MergeFrom(AccountForMoney); + } + input.ReadMessage(subBuilder, extensionRegistry); + AccountForMoney = subBuilder.BuildPartial(); + break; + } + case 42: { + global::bnet.protocol.exchange.BlobFrom.Builder subBuilder = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(); + if (result.hasAccountForItem) { + subBuilder.MergeFrom(AccountForItem); + } + input.ReadMessage(subBuilder, extensionRegistry); + AccountForItem = subBuilder.BuildPartial(); + break; + } + case 50: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasBnetAccount) { + subBuilder.MergeFrom(BnetAccount); + } + input.ReadMessage(subBuilder, extensionRegistry); + BnetAccount = subBuilder.BuildPartial(); + break; + } + case 58: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasGameAccount) { + subBuilder.MergeFrom(GameAccount); + } + input.ReadMessage(subBuilder, extensionRegistry); + GameAccount = subBuilder.BuildPartial(); + break; + } + case 66: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasSessionId) { + subBuilder.MergeFrom(SessionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + SessionId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAmount { + get { return result.hasAmount; } + } + public uint Amount { + get { return result.Amount; } + set { SetAmount(value); } + } + public Builder SetAmount(uint value) { + PrepareBuilder(); + result.hasAmount = true; + result.amount_ = value; + return this; + } + public Builder ClearAmount() { + PrepareBuilder(); + result.hasAmount = false; + result.amount_ = 0; + return this; + } + + public bool HasStartTime { + get { return result.hasStartTime; } + } + public ulong StartTime { + get { return result.StartTime; } + set { SetStartTime(value); } + } + public Builder SetStartTime(ulong value) { + PrepareBuilder(); + result.hasStartTime = true; + result.startTime_ = value; + return this; + } + public Builder ClearStartTime() { + PrepareBuilder(); + result.hasStartTime = false; + result.startTime_ = 0UL; + return this; + } + + public bool HasEndTime { + get { return result.hasEndTime; } + } + public ulong EndTime { + get { return result.EndTime; } + set { SetEndTime(value); } + } + public Builder SetEndTime(ulong value) { + PrepareBuilder(); + result.hasEndTime = true; + result.endTime_ = value; + return this; + } + public Builder ClearEndTime() { + PrepareBuilder(); + result.hasEndTime = false; + result.endTime_ = 0UL; + return this; + } + + public bool HasAccountForMoney { + get { return result.hasAccountForMoney; } + } + public global::bnet.protocol.exchange.BlobFrom AccountForMoney { + get { return result.AccountForMoney; } + set { SetAccountForMoney(value); } + } + public Builder SetAccountForMoney(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccountForMoney = true; + result.accountForMoney_ = value; + return this; + } + public Builder SetAccountForMoney(global::bnet.protocol.exchange.BlobFrom.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccountForMoney = true; + result.accountForMoney_ = builderForValue.Build(); + return this; + } + public Builder MergeAccountForMoney(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccountForMoney && + result.accountForMoney_ != global::bnet.protocol.exchange.BlobFrom.DefaultInstance) { + result.accountForMoney_ = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(result.accountForMoney_).MergeFrom(value).BuildPartial(); + } else { + result.accountForMoney_ = value; + } + result.hasAccountForMoney = true; + return this; + } + public Builder ClearAccountForMoney() { + PrepareBuilder(); + result.hasAccountForMoney = false; + result.accountForMoney_ = null; + return this; + } + + public bool HasAccountForItem { + get { return result.hasAccountForItem; } + } + public global::bnet.protocol.exchange.BlobFrom AccountForItem { + get { return result.AccountForItem; } + set { SetAccountForItem(value); } + } + public Builder SetAccountForItem(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccountForItem = true; + result.accountForItem_ = value; + return this; + } + public Builder SetAccountForItem(global::bnet.protocol.exchange.BlobFrom.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccountForItem = true; + result.accountForItem_ = builderForValue.Build(); + return this; + } + public Builder MergeAccountForItem(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccountForItem && + result.accountForItem_ != global::bnet.protocol.exchange.BlobFrom.DefaultInstance) { + result.accountForItem_ = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(result.accountForItem_).MergeFrom(value).BuildPartial(); + } else { + result.accountForItem_ = value; + } + result.hasAccountForItem = true; + return this; + } + public Builder ClearAccountForItem() { + PrepareBuilder(); + result.hasAccountForItem = false; + result.accountForItem_ = null; + return this; + } + + public bool HasBnetAccount { + get { return result.hasBnetAccount; } + } + public global::bnet.protocol.EntityId BnetAccount { + get { return result.BnetAccount; } + set { SetBnetAccount(value); } + } + public Builder SetBnetAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBnetAccount = true; + result.bnetAccount_ = value; + return this; + } + public Builder SetBnetAccount(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBnetAccount = true; + result.bnetAccount_ = builderForValue.Build(); + return this; + } + public Builder MergeBnetAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBnetAccount && + result.bnetAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.bnetAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccount_).MergeFrom(value).BuildPartial(); + } else { + result.bnetAccount_ = value; + } + result.hasBnetAccount = true; + return this; + } + public Builder ClearBnetAccount() { + PrepareBuilder(); + result.hasBnetAccount = false; + result.bnetAccount_ = null; + return this; + } + + public bool HasGameAccount { + get { return result.hasGameAccount; } + } + public global::bnet.protocol.EntityId GameAccount { + get { return result.GameAccount; } + set { SetGameAccount(value); } + } + public Builder SetGameAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasGameAccount = true; + result.gameAccount_ = value; + return this; + } + public Builder SetGameAccount(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasGameAccount = true; + result.gameAccount_ = builderForValue.Build(); + return this; + } + public Builder MergeGameAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasGameAccount && + result.gameAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.gameAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccount_).MergeFrom(value).BuildPartial(); + } else { + result.gameAccount_ = value; + } + result.hasGameAccount = true; + return this; + } + public Builder ClearGameAccount() { + PrepareBuilder(); + result.hasGameAccount = false; + result.gameAccount_ = null; + return this; + } + + public bool HasSessionId { + get { return result.hasSessionId; } + } + public global::bnet.protocol.exchange.PartitionId SessionId { + get { return result.SessionId; } + set { SetSessionId(value); } + } + public Builder SetSessionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasSessionId = true; + result.sessionId_ = value; + return this; + } + public Builder SetSessionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasSessionId = true; + result.sessionId_ = builderForValue.Build(); + return this; + } + public Builder MergeSessionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasSessionId && + result.sessionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.sessionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.sessionId_).MergeFrom(value).BuildPartial(); + } else { + result.sessionId_ = value; + } + result.hasSessionId = true; + return this; + } + public Builder ClearSessionId() { + PrepareBuilder(); + result.hasSessionId = false; + result.sessionId_ = null; + return this; + } + } + static Order() { + object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Extension : pb::GeneratedMessage { + private Extension() { } + private static readonly Extension defaultInstance = new Extension().MakeReadOnly(); + private static readonly string[] _extensionFieldNames = new string[] { "authorized_time", "closed_time", "created_time", "fail_error_code", "fail_extra_error_code", "fail_object_type", "fail_order_action", "filled_amount", "filled_fund_amount", "items_to_claim", "money_to_claim", "order_book", "order_book_id", "order_book_status", "order_id", "order_status", "partition_id", "reason", "refunded", "risk_delayed" }; + private static readonly uint[] _extensionFieldTags = new uint[] { 48, 64, 56, 136, 144, 128, 120, 32, 160, 104, 96, 82, 16, 88, 24, 40, 10, 72, 152, 112 }; + public static Extension DefaultInstance { + get { return defaultInstance; } + } + + public override Extension DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Extension ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_Extension__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_Extension__FieldAccessorTable; } + } + + public const int PartitionIdFieldNumber = 1; + private bool hasPartitionId; + private global::bnet.protocol.exchange.PartitionId partitionId_; + public bool HasPartitionId { + get { return hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int OrderBookIdFieldNumber = 2; + private bool hasOrderBookId; + private ulong orderBookId_; + public bool HasOrderBookId { + get { return hasOrderBookId; } + } + public ulong OrderBookId { + get { return orderBookId_; } + } + + public const int OrderIdFieldNumber = 3; + private bool hasOrderId; + private ulong orderId_; + public bool HasOrderId { + get { return hasOrderId; } + } + public ulong OrderId { + get { return orderId_; } + } + + public const int FilledAmountFieldNumber = 4; + private bool hasFilledAmount; + private ulong filledAmount_; + public bool HasFilledAmount { + get { return hasFilledAmount; } + } + public ulong FilledAmount { + get { return filledAmount_; } + } + + public const int OrderStatusFieldNumber = 5; + private bool hasOrderStatus; + private int orderStatus_; + public bool HasOrderStatus { + get { return hasOrderStatus; } + } + public int OrderStatus { + get { return orderStatus_; } + } + + public const int AuthorizedTimeFieldNumber = 6; + private bool hasAuthorizedTime; + private ulong authorizedTime_; + public bool HasAuthorizedTime { + get { return hasAuthorizedTime; } + } + public ulong AuthorizedTime { + get { return authorizedTime_; } + } + + public const int CreatedTimeFieldNumber = 7; + private bool hasCreatedTime; + private ulong createdTime_; + public bool HasCreatedTime { + get { return hasCreatedTime; } + } + public ulong CreatedTime { + get { return createdTime_; } + } + + public const int ClosedTimeFieldNumber = 8; + private bool hasClosedTime; + private ulong closedTime_; + public bool HasClosedTime { + get { return hasClosedTime; } + } + public ulong ClosedTime { + get { return closedTime_; } + } + + public const int ReasonFieldNumber = 9; + private bool hasReason; + private uint reason_; + public bool HasReason { + get { return hasReason; } + } + public uint Reason { + get { return reason_; } + } + + public const int OrderBookFieldNumber = 10; + private bool hasOrderBook; + private global::bnet.protocol.exchange.OrderBook orderBook_; + public bool HasOrderBook { + get { return hasOrderBook; } + } + public global::bnet.protocol.exchange.OrderBook OrderBook { + get { return orderBook_ ?? global::bnet.protocol.exchange.OrderBook.DefaultInstance; } + } + + public const int OrderBookStatusFieldNumber = 11; + private bool hasOrderBookStatus; + private ulong orderBookStatus_; + public bool HasOrderBookStatus { + get { return hasOrderBookStatus; } + } + public ulong OrderBookStatus { + get { return orderBookStatus_; } + } + + public const int MoneyToClaimFieldNumber = 12; + private bool hasMoneyToClaim; + private ulong moneyToClaim_; + public bool HasMoneyToClaim { + get { return hasMoneyToClaim; } + } + public ulong MoneyToClaim { + get { return moneyToClaim_; } + } + + public const int ItemsToClaimFieldNumber = 13; + private bool hasItemsToClaim; + private ulong itemsToClaim_; + public bool HasItemsToClaim { + get { return hasItemsToClaim; } + } + public ulong ItemsToClaim { + get { return itemsToClaim_; } + } + + public const int RiskDelayedFieldNumber = 14; + private bool hasRiskDelayed; + private bool riskDelayed_; + public bool HasRiskDelayed { + get { return hasRiskDelayed; } + } + public bool RiskDelayed { + get { return riskDelayed_; } + } + + public const int FailOrderActionFieldNumber = 15; + private bool hasFailOrderAction; + private uint failOrderAction_; + public bool HasFailOrderAction { + get { return hasFailOrderAction; } + } + public uint FailOrderAction { + get { return failOrderAction_; } + } + + public const int FailObjectTypeFieldNumber = 16; + private bool hasFailObjectType; + private uint failObjectType_; + public bool HasFailObjectType { + get { return hasFailObjectType; } + } + public uint FailObjectType { + get { return failObjectType_; } + } + + public const int FailErrorCodeFieldNumber = 17; + private bool hasFailErrorCode; + private uint failErrorCode_; + public bool HasFailErrorCode { + get { return hasFailErrorCode; } + } + public uint FailErrorCode { + get { return failErrorCode_; } + } + + public const int FailExtraErrorCodeFieldNumber = 18; + private bool hasFailExtraErrorCode; + private uint failExtraErrorCode_; + public bool HasFailExtraErrorCode { + get { return hasFailExtraErrorCode; } + } + public uint FailExtraErrorCode { + get { return failExtraErrorCode_; } + } + + public const int RefundedFieldNumber = 19; + private bool hasRefunded; + private ulong refunded_; + public bool HasRefunded { + get { return hasRefunded; } + } + public ulong Refunded { + get { return refunded_; } + } + + public const int FilledFundAmountFieldNumber = 20; + private bool hasFilledFundAmount; + private ulong filledFundAmount_; + public bool HasFilledFundAmount { + get { return hasFilledFundAmount; } + } + public ulong FilledFundAmount { + get { return filledFundAmount_; } + } + + public override bool IsInitialized { + get { + if (!hasPartitionId) return false; + if (!hasOrderBookId) return false; + if (!hasOrderId) return false; + if (!PartitionId.IsInitialized) return false; + if (HasOrderBook) { + if (!OrderBook.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _extensionFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[16], PartitionId); + } + if (hasOrderBookId) { + output.WriteUInt64(2, field_names[12], OrderBookId); + } + if (hasOrderId) { + output.WriteUInt64(3, field_names[14], OrderId); + } + if (hasFilledAmount) { + output.WriteUInt64(4, field_names[7], FilledAmount); + } + if (hasOrderStatus) { + output.WriteInt32(5, field_names[15], OrderStatus); + } + if (hasAuthorizedTime) { + output.WriteUInt64(6, field_names[0], AuthorizedTime); + } + if (hasCreatedTime) { + output.WriteUInt64(7, field_names[2], CreatedTime); + } + if (hasClosedTime) { + output.WriteUInt64(8, field_names[1], ClosedTime); + } + if (hasReason) { + output.WriteUInt32(9, field_names[17], Reason); + } + if (hasOrderBook) { + output.WriteMessage(10, field_names[11], OrderBook); + } + if (hasOrderBookStatus) { + output.WriteUInt64(11, field_names[13], OrderBookStatus); + } + if (hasMoneyToClaim) { + output.WriteUInt64(12, field_names[10], MoneyToClaim); + } + if (hasItemsToClaim) { + output.WriteUInt64(13, field_names[9], ItemsToClaim); + } + if (hasRiskDelayed) { + output.WriteBool(14, field_names[19], RiskDelayed); + } + if (hasFailOrderAction) { + output.WriteUInt32(15, field_names[6], FailOrderAction); + } + if (hasFailObjectType) { + output.WriteUInt32(16, field_names[5], FailObjectType); + } + if (hasFailErrorCode) { + output.WriteUInt32(17, field_names[3], FailErrorCode); + } + if (hasFailExtraErrorCode) { + output.WriteUInt32(18, field_names[4], FailExtraErrorCode); + } + if (hasRefunded) { + output.WriteUInt64(19, field_names[18], Refunded); + } + if (hasFilledFundAmount) { + output.WriteUInt64(20, field_names[8], FilledFundAmount); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); + } + if (hasOrderBookId) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, OrderBookId); + } + if (hasOrderId) { + size += pb::CodedOutputStream.ComputeUInt64Size(3, OrderId); + } + if (hasFilledAmount) { + size += pb::CodedOutputStream.ComputeUInt64Size(4, FilledAmount); + } + if (hasOrderStatus) { + size += pb::CodedOutputStream.ComputeInt32Size(5, OrderStatus); + } + if (hasAuthorizedTime) { + size += pb::CodedOutputStream.ComputeUInt64Size(6, AuthorizedTime); + } + if (hasCreatedTime) { + size += pb::CodedOutputStream.ComputeUInt64Size(7, CreatedTime); + } + if (hasClosedTime) { + size += pb::CodedOutputStream.ComputeUInt64Size(8, ClosedTime); + } + if (hasReason) { + size += pb::CodedOutputStream.ComputeUInt32Size(9, Reason); + } + if (hasOrderBook) { + size += pb::CodedOutputStream.ComputeMessageSize(10, OrderBook); + } + if (hasOrderBookStatus) { + size += pb::CodedOutputStream.ComputeUInt64Size(11, OrderBookStatus); + } + if (hasMoneyToClaim) { + size += pb::CodedOutputStream.ComputeUInt64Size(12, MoneyToClaim); + } + if (hasItemsToClaim) { + size += pb::CodedOutputStream.ComputeUInt64Size(13, ItemsToClaim); + } + if (hasRiskDelayed) { + size += pb::CodedOutputStream.ComputeBoolSize(14, RiskDelayed); + } + if (hasFailOrderAction) { + size += pb::CodedOutputStream.ComputeUInt32Size(15, FailOrderAction); + } + if (hasFailObjectType) { + size += pb::CodedOutputStream.ComputeUInt32Size(16, FailObjectType); + } + if (hasFailErrorCode) { + size += pb::CodedOutputStream.ComputeUInt32Size(17, FailErrorCode); + } + if (hasFailExtraErrorCode) { + size += pb::CodedOutputStream.ComputeUInt32Size(18, FailExtraErrorCode); + } + if (hasRefunded) { + size += pb::CodedOutputStream.ComputeUInt64Size(19, Refunded); + } + if (hasFilledFundAmount) { + size += pb::CodedOutputStream.ComputeUInt64Size(20, FilledFundAmount); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static Extension ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Extension ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Extension ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Extension ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Extension ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Extension ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Extension ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Extension ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Extension ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Extension ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Extension MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Extension prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Extension cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Extension result; + + private Extension PrepareBuilder() { + if (resultIsReadOnly) { + Extension original = result; + result = new Extension(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Extension MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.Extension.Descriptor; } + } + + public override Extension DefaultInstanceForType { + get { return global::bnet.protocol.exchange.Extension.DefaultInstance; } + } + + public override Extension BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Extension) { + return MergeFrom((Extension) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Extension other) { + if (other == global::bnet.protocol.exchange.Extension.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasPartitionId) { + MergePartitionId(other.PartitionId); + } + if (other.HasOrderBookId) { + OrderBookId = other.OrderBookId; + } + if (other.HasOrderId) { + OrderId = other.OrderId; + } + if (other.HasFilledAmount) { + FilledAmount = other.FilledAmount; + } + if (other.HasOrderStatus) { + OrderStatus = other.OrderStatus; + } + if (other.HasAuthorizedTime) { + AuthorizedTime = other.AuthorizedTime; + } + if (other.HasCreatedTime) { + CreatedTime = other.CreatedTime; + } + if (other.HasClosedTime) { + ClosedTime = other.ClosedTime; + } + if (other.HasReason) { + Reason = other.Reason; + } + if (other.HasOrderBook) { + MergeOrderBook(other.OrderBook); + } + if (other.HasOrderBookStatus) { + OrderBookStatus = other.OrderBookStatus; + } + if (other.HasMoneyToClaim) { + MoneyToClaim = other.MoneyToClaim; + } + if (other.HasItemsToClaim) { + ItemsToClaim = other.ItemsToClaim; + } + if (other.HasRiskDelayed) { + RiskDelayed = other.RiskDelayed; + } + if (other.HasFailOrderAction) { + FailOrderAction = other.FailOrderAction; + } + if (other.HasFailObjectType) { + FailObjectType = other.FailObjectType; + } + if (other.HasFailErrorCode) { + FailErrorCode = other.FailErrorCode; + } + if (other.HasFailExtraErrorCode) { + FailExtraErrorCode = other.FailExtraErrorCode; + } + if (other.HasRefunded) { + Refunded = other.Refunded; + } + if (other.HasFilledFundAmount) { + FilledFundAmount = other.FilledFundAmount; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_extensionFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _extensionFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasPartitionId) { + subBuilder.MergeFrom(PartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + PartitionId = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasOrderBookId = input.ReadUInt64(ref result.orderBookId_); + break; + } + case 24: { + result.hasOrderId = input.ReadUInt64(ref result.orderId_); + break; + } + case 32: { + result.hasFilledAmount = input.ReadUInt64(ref result.filledAmount_); + break; + } + case 40: { + result.hasOrderStatus = input.ReadInt32(ref result.orderStatus_); + break; + } + case 48: { + result.hasAuthorizedTime = input.ReadUInt64(ref result.authorizedTime_); + break; + } + case 56: { + result.hasCreatedTime = input.ReadUInt64(ref result.createdTime_); + break; + } + case 64: { + result.hasClosedTime = input.ReadUInt64(ref result.closedTime_); + break; + } + case 72: { + result.hasReason = input.ReadUInt32(ref result.reason_); + break; + } + case 82: { + global::bnet.protocol.exchange.OrderBook.Builder subBuilder = global::bnet.protocol.exchange.OrderBook.CreateBuilder(); + if (result.hasOrderBook) { + subBuilder.MergeFrom(OrderBook); + } + input.ReadMessage(subBuilder, extensionRegistry); + OrderBook = subBuilder.BuildPartial(); + break; + } + case 88: { + result.hasOrderBookStatus = input.ReadUInt64(ref result.orderBookStatus_); + break; + } + case 96: { + result.hasMoneyToClaim = input.ReadUInt64(ref result.moneyToClaim_); + break; + } + case 104: { + result.hasItemsToClaim = input.ReadUInt64(ref result.itemsToClaim_); + break; + } + case 112: { + result.hasRiskDelayed = input.ReadBool(ref result.riskDelayed_); + break; + } + case 120: { + result.hasFailOrderAction = input.ReadUInt32(ref result.failOrderAction_); + break; + } + case 128: { + result.hasFailObjectType = input.ReadUInt32(ref result.failObjectType_); + break; + } + case 136: { + result.hasFailErrorCode = input.ReadUInt32(ref result.failErrorCode_); + break; + } + case 144: { + result.hasFailExtraErrorCode = input.ReadUInt32(ref result.failExtraErrorCode_); + break; + } + case 152: { + result.hasRefunded = input.ReadUInt64(ref result.refunded_); + break; + } + case 160: { + result.hasFilledFundAmount = input.ReadUInt64(ref result.filledFundAmount_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasPartitionId { + get { return result.hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = value; + return this; + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = builderForValue.Build(); + return this; + } + public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasPartitionId && + result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); + } else { + result.partitionId_ = value; + } + result.hasPartitionId = true; + return this; + } + public Builder ClearPartitionId() { + PrepareBuilder(); + result.hasPartitionId = false; + result.partitionId_ = null; + return this; + } + + public bool HasOrderBookId { + get { return result.hasOrderBookId; } + } + public ulong OrderBookId { + get { return result.OrderBookId; } + set { SetOrderBookId(value); } + } + public Builder SetOrderBookId(ulong value) { + PrepareBuilder(); + result.hasOrderBookId = true; + result.orderBookId_ = value; + return this; + } + public Builder ClearOrderBookId() { + PrepareBuilder(); + result.hasOrderBookId = false; + result.orderBookId_ = 0UL; + return this; + } + + public bool HasOrderId { + get { return result.hasOrderId; } + } + public ulong OrderId { + get { return result.OrderId; } + set { SetOrderId(value); } + } + public Builder SetOrderId(ulong value) { + PrepareBuilder(); + result.hasOrderId = true; + result.orderId_ = value; + return this; + } + public Builder ClearOrderId() { + PrepareBuilder(); + result.hasOrderId = false; + result.orderId_ = 0UL; + return this; + } + + public bool HasFilledAmount { + get { return result.hasFilledAmount; } + } + public ulong FilledAmount { + get { return result.FilledAmount; } + set { SetFilledAmount(value); } + } + public Builder SetFilledAmount(ulong value) { + PrepareBuilder(); + result.hasFilledAmount = true; + result.filledAmount_ = value; + return this; + } + public Builder ClearFilledAmount() { + PrepareBuilder(); + result.hasFilledAmount = false; + result.filledAmount_ = 0UL; + return this; + } + + public bool HasOrderStatus { + get { return result.hasOrderStatus; } + } + public int OrderStatus { + get { return result.OrderStatus; } + set { SetOrderStatus(value); } + } + public Builder SetOrderStatus(int value) { + PrepareBuilder(); + result.hasOrderStatus = true; + result.orderStatus_ = value; + return this; + } + public Builder ClearOrderStatus() { + PrepareBuilder(); + result.hasOrderStatus = false; + result.orderStatus_ = 0; + return this; + } + + public bool HasAuthorizedTime { + get { return result.hasAuthorizedTime; } + } + public ulong AuthorizedTime { + get { return result.AuthorizedTime; } + set { SetAuthorizedTime(value); } + } + public Builder SetAuthorizedTime(ulong value) { + PrepareBuilder(); + result.hasAuthorizedTime = true; + result.authorizedTime_ = value; + return this; + } + public Builder ClearAuthorizedTime() { + PrepareBuilder(); + result.hasAuthorizedTime = false; + result.authorizedTime_ = 0UL; + return this; + } + + public bool HasCreatedTime { + get { return result.hasCreatedTime; } + } + public ulong CreatedTime { + get { return result.CreatedTime; } + set { SetCreatedTime(value); } + } + public Builder SetCreatedTime(ulong value) { + PrepareBuilder(); + result.hasCreatedTime = true; + result.createdTime_ = value; + return this; + } + public Builder ClearCreatedTime() { + PrepareBuilder(); + result.hasCreatedTime = false; + result.createdTime_ = 0UL; + return this; + } + + public bool HasClosedTime { + get { return result.hasClosedTime; } + } + public ulong ClosedTime { + get { return result.ClosedTime; } + set { SetClosedTime(value); } + } + public Builder SetClosedTime(ulong value) { + PrepareBuilder(); + result.hasClosedTime = true; + result.closedTime_ = value; + return this; + } + public Builder ClearClosedTime() { + PrepareBuilder(); + result.hasClosedTime = false; + result.closedTime_ = 0UL; + return this; + } + + public bool HasReason { + get { return result.hasReason; } + } + public uint Reason { + get { return result.Reason; } + set { SetReason(value); } + } + public Builder SetReason(uint value) { + PrepareBuilder(); + result.hasReason = true; + result.reason_ = value; + return this; + } + public Builder ClearReason() { + PrepareBuilder(); + result.hasReason = false; + result.reason_ = 0; + return this; + } + + public bool HasOrderBook { + get { return result.hasOrderBook; } + } + public global::bnet.protocol.exchange.OrderBook OrderBook { + get { return result.OrderBook; } + set { SetOrderBook(value); } + } + public Builder SetOrderBook(global::bnet.protocol.exchange.OrderBook value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOrderBook = true; + result.orderBook_ = value; + return this; + } + public Builder SetOrderBook(global::bnet.protocol.exchange.OrderBook.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOrderBook = true; + result.orderBook_ = builderForValue.Build(); + return this; + } + public Builder MergeOrderBook(global::bnet.protocol.exchange.OrderBook value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOrderBook && + result.orderBook_ != global::bnet.protocol.exchange.OrderBook.DefaultInstance) { + result.orderBook_ = global::bnet.protocol.exchange.OrderBook.CreateBuilder(result.orderBook_).MergeFrom(value).BuildPartial(); + } else { + result.orderBook_ = value; + } + result.hasOrderBook = true; + return this; + } + public Builder ClearOrderBook() { + PrepareBuilder(); + result.hasOrderBook = false; + result.orderBook_ = null; + return this; + } + + public bool HasOrderBookStatus { + get { return result.hasOrderBookStatus; } + } + public ulong OrderBookStatus { + get { return result.OrderBookStatus; } + set { SetOrderBookStatus(value); } + } + public Builder SetOrderBookStatus(ulong value) { + PrepareBuilder(); + result.hasOrderBookStatus = true; + result.orderBookStatus_ = value; + return this; + } + public Builder ClearOrderBookStatus() { + PrepareBuilder(); + result.hasOrderBookStatus = false; + result.orderBookStatus_ = 0UL; + return this; + } + + public bool HasMoneyToClaim { + get { return result.hasMoneyToClaim; } + } + public ulong MoneyToClaim { + get { return result.MoneyToClaim; } + set { SetMoneyToClaim(value); } + } + public Builder SetMoneyToClaim(ulong value) { + PrepareBuilder(); + result.hasMoneyToClaim = true; + result.moneyToClaim_ = value; + return this; + } + public Builder ClearMoneyToClaim() { + PrepareBuilder(); + result.hasMoneyToClaim = false; + result.moneyToClaim_ = 0UL; + return this; + } + + public bool HasItemsToClaim { + get { return result.hasItemsToClaim; } + } + public ulong ItemsToClaim { + get { return result.ItemsToClaim; } + set { SetItemsToClaim(value); } + } + public Builder SetItemsToClaim(ulong value) { + PrepareBuilder(); + result.hasItemsToClaim = true; + result.itemsToClaim_ = value; + return this; + } + public Builder ClearItemsToClaim() { + PrepareBuilder(); + result.hasItemsToClaim = false; + result.itemsToClaim_ = 0UL; + return this; + } + + public bool HasRiskDelayed { + get { return result.hasRiskDelayed; } + } + public bool RiskDelayed { + get { return result.RiskDelayed; } + set { SetRiskDelayed(value); } + } + public Builder SetRiskDelayed(bool value) { + PrepareBuilder(); + result.hasRiskDelayed = true; + result.riskDelayed_ = value; + return this; + } + public Builder ClearRiskDelayed() { + PrepareBuilder(); + result.hasRiskDelayed = false; + result.riskDelayed_ = false; + return this; + } + + public bool HasFailOrderAction { + get { return result.hasFailOrderAction; } + } + public uint FailOrderAction { + get { return result.FailOrderAction; } + set { SetFailOrderAction(value); } + } + public Builder SetFailOrderAction(uint value) { + PrepareBuilder(); + result.hasFailOrderAction = true; + result.failOrderAction_ = value; + return this; + } + public Builder ClearFailOrderAction() { + PrepareBuilder(); + result.hasFailOrderAction = false; + result.failOrderAction_ = 0; + return this; + } + + public bool HasFailObjectType { + get { return result.hasFailObjectType; } + } + public uint FailObjectType { + get { return result.FailObjectType; } + set { SetFailObjectType(value); } + } + public Builder SetFailObjectType(uint value) { + PrepareBuilder(); + result.hasFailObjectType = true; + result.failObjectType_ = value; + return this; + } + public Builder ClearFailObjectType() { + PrepareBuilder(); + result.hasFailObjectType = false; + result.failObjectType_ = 0; + return this; + } + + public bool HasFailErrorCode { + get { return result.hasFailErrorCode; } + } + public uint FailErrorCode { + get { return result.FailErrorCode; } + set { SetFailErrorCode(value); } + } + public Builder SetFailErrorCode(uint value) { + PrepareBuilder(); + result.hasFailErrorCode = true; + result.failErrorCode_ = value; + return this; + } + public Builder ClearFailErrorCode() { + PrepareBuilder(); + result.hasFailErrorCode = false; + result.failErrorCode_ = 0; + return this; + } + + public bool HasFailExtraErrorCode { + get { return result.hasFailExtraErrorCode; } + } + public uint FailExtraErrorCode { + get { return result.FailExtraErrorCode; } + set { SetFailExtraErrorCode(value); } + } + public Builder SetFailExtraErrorCode(uint value) { + PrepareBuilder(); + result.hasFailExtraErrorCode = true; + result.failExtraErrorCode_ = value; + return this; + } + public Builder ClearFailExtraErrorCode() { + PrepareBuilder(); + result.hasFailExtraErrorCode = false; + result.failExtraErrorCode_ = 0; + return this; + } + + public bool HasRefunded { + get { return result.hasRefunded; } + } + public ulong Refunded { + get { return result.Refunded; } + set { SetRefunded(value); } + } + public Builder SetRefunded(ulong value) { + PrepareBuilder(); + result.hasRefunded = true; + result.refunded_ = value; + return this; + } + public Builder ClearRefunded() { + PrepareBuilder(); + result.hasRefunded = false; + result.refunded_ = 0UL; + return this; + } + + public bool HasFilledFundAmount { + get { return result.hasFilledFundAmount; } + } + public ulong FilledFundAmount { + get { return result.FilledFundAmount; } + set { SetFilledFundAmount(value); } + } + public Builder SetFilledFundAmount(ulong value) { + PrepareBuilder(); + result.hasFilledFundAmount = true; + result.filledFundAmount_ = value; + return this; + } + public Builder ClearFilledFundAmount() { + PrepareBuilder(); + result.hasFilledFundAmount = false; + result.filledFundAmount_ = 0UL; + return this; + } + } + static Extension() { + object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Offer : pb::GeneratedMessage { + private Offer() { } + private static readonly Offer defaultInstance = new Offer().MakeReadOnly(); + private static readonly string[] _offerFieldNames = new string[] { "order", "out_bid_price", "reserve_price", "trade_now_price" }; + private static readonly uint[] _offerFieldTags = new uint[] { 10, 32, 24, 16 }; + public static Offer DefaultInstance { + get { return defaultInstance; } + } + + public override Offer DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Offer ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_Offer__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_Offer__FieldAccessorTable; } + } + + public const int OrderFieldNumber = 1; + private bool hasOrder; + private global::bnet.protocol.exchange.Order order_; + public bool HasOrder { + get { return hasOrder; } + } + public global::bnet.protocol.exchange.Order Order { + get { return order_ ?? global::bnet.protocol.exchange.Order.DefaultInstance; } + } + + public const int TradeNowPriceFieldNumber = 2; + private bool hasTradeNowPrice; + private ulong tradeNowPrice_; + public bool HasTradeNowPrice { + get { return hasTradeNowPrice; } + } + public ulong TradeNowPrice { + get { return tradeNowPrice_; } + } + + public const int ReservePriceFieldNumber = 3; + private bool hasReservePrice; + private ulong reservePrice_; + public bool HasReservePrice { + get { return hasReservePrice; } + } + public ulong ReservePrice { + get { return reservePrice_; } + } + + public const int OutBidPriceFieldNumber = 4; + private bool hasOutBidPrice; + private ulong outBidPrice_; + public bool HasOutBidPrice { + get { return hasOutBidPrice; } + } + public ulong OutBidPrice { + get { return outBidPrice_; } + } + + public override bool IsInitialized { + get { + if (!hasOrder) return false; + if (!Order.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _offerFieldNames; + if (hasOrder) { + output.WriteMessage(1, field_names[0], Order); + } + if (hasTradeNowPrice) { + output.WriteUInt64(2, field_names[3], TradeNowPrice); + } + if (hasReservePrice) { + output.WriteUInt64(3, field_names[2], ReservePrice); + } + if (hasOutBidPrice) { + output.WriteUInt64(4, field_names[1], OutBidPrice); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasOrder) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Order); + } + if (hasTradeNowPrice) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, TradeNowPrice); + } + if (hasReservePrice) { + size += pb::CodedOutputStream.ComputeUInt64Size(3, ReservePrice); + } + if (hasOutBidPrice) { + size += pb::CodedOutputStream.ComputeUInt64Size(4, OutBidPrice); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static Offer ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Offer ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Offer ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Offer ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Offer ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Offer ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Offer ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Offer ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Offer ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Offer ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Offer MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Offer prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Offer cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Offer result; + + private Offer PrepareBuilder() { + if (resultIsReadOnly) { + Offer original = result; + result = new Offer(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Offer MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.Offer.Descriptor; } + } + + public override Offer DefaultInstanceForType { + get { return global::bnet.protocol.exchange.Offer.DefaultInstance; } + } + + public override Offer BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Offer) { + return MergeFrom((Offer) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Offer other) { + if (other == global::bnet.protocol.exchange.Offer.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasOrder) { + MergeOrder(other.Order); + } + if (other.HasTradeNowPrice) { + TradeNowPrice = other.TradeNowPrice; + } + if (other.HasReservePrice) { + ReservePrice = other.ReservePrice; + } + if (other.HasOutBidPrice) { + OutBidPrice = other.OutBidPrice; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_offerFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _offerFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.Order.Builder subBuilder = global::bnet.protocol.exchange.Order.CreateBuilder(); + if (result.hasOrder) { + subBuilder.MergeFrom(Order); + } + input.ReadMessage(subBuilder, extensionRegistry); + Order = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasTradeNowPrice = input.ReadUInt64(ref result.tradeNowPrice_); + break; + } + case 24: { + result.hasReservePrice = input.ReadUInt64(ref result.reservePrice_); + break; + } + case 32: { + result.hasOutBidPrice = input.ReadUInt64(ref result.outBidPrice_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasOrder { + get { return result.hasOrder; } + } + public global::bnet.protocol.exchange.Order Order { + get { return result.Order; } + set { SetOrder(value); } + } + public Builder SetOrder(global::bnet.protocol.exchange.Order value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOrder = true; + result.order_ = value; + return this; + } + public Builder SetOrder(global::bnet.protocol.exchange.Order.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOrder = true; + result.order_ = builderForValue.Build(); + return this; + } + public Builder MergeOrder(global::bnet.protocol.exchange.Order value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOrder && + result.order_ != global::bnet.protocol.exchange.Order.DefaultInstance) { + result.order_ = global::bnet.protocol.exchange.Order.CreateBuilder(result.order_).MergeFrom(value).BuildPartial(); + } else { + result.order_ = value; + } + result.hasOrder = true; + return this; + } + public Builder ClearOrder() { + PrepareBuilder(); + result.hasOrder = false; + result.order_ = null; + return this; + } + + public bool HasTradeNowPrice { + get { return result.hasTradeNowPrice; } + } + public ulong TradeNowPrice { + get { return result.TradeNowPrice; } + set { SetTradeNowPrice(value); } + } + public Builder SetTradeNowPrice(ulong value) { + PrepareBuilder(); + result.hasTradeNowPrice = true; + result.tradeNowPrice_ = value; + return this; + } + public Builder ClearTradeNowPrice() { + PrepareBuilder(); + result.hasTradeNowPrice = false; + result.tradeNowPrice_ = 0UL; + return this; + } + + public bool HasReservePrice { + get { return result.hasReservePrice; } + } + public ulong ReservePrice { + get { return result.ReservePrice; } + set { SetReservePrice(value); } + } + public Builder SetReservePrice(ulong value) { + PrepareBuilder(); + result.hasReservePrice = true; + result.reservePrice_ = value; + return this; + } + public Builder ClearReservePrice() { + PrepareBuilder(); + result.hasReservePrice = false; + result.reservePrice_ = 0UL; + return this; + } + + public bool HasOutBidPrice { + get { return result.hasOutBidPrice; } + } + public ulong OutBidPrice { + get { return result.OutBidPrice; } + set { SetOutBidPrice(value); } + } + public Builder SetOutBidPrice(ulong value) { + PrepareBuilder(); + result.hasOutBidPrice = true; + result.outBidPrice_ = value; + return this; + } + public Builder ClearOutBidPrice() { + PrepareBuilder(); + result.hasOutBidPrice = false; + result.outBidPrice_ = 0UL; + return this; + } + } + static Offer() { + object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class OfferExtended : pb::GeneratedMessage { + private OfferExtended() { } + private static readonly OfferExtended defaultInstance = new OfferExtended().MakeReadOnly(); + private static readonly string[] _offerExtendedFieldNames = new string[] { "current_winning_price", "extension", "offer" }; + private static readonly uint[] _offerExtendedFieldTags = new uint[] { 24, 18, 10 }; + public static OfferExtended DefaultInstance { + get { return defaultInstance; } + } + + public override OfferExtended DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override OfferExtended ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_OfferExtended__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_OfferExtended__FieldAccessorTable; } + } + + public const int OfferFieldNumber = 1; + private bool hasOffer; + private global::bnet.protocol.exchange.Offer offer_; + public bool HasOffer { + get { return hasOffer; } + } + public global::bnet.protocol.exchange.Offer Offer { + get { return offer_ ?? global::bnet.protocol.exchange.Offer.DefaultInstance; } + } + + public const int ExtensionFieldNumber = 2; + private bool hasExtension; + private global::bnet.protocol.exchange.Extension extension_; + public bool HasExtension { + get { return hasExtension; } + } + public global::bnet.protocol.exchange.Extension Extension { + get { return extension_ ?? global::bnet.protocol.exchange.Extension.DefaultInstance; } + } + + public const int CurrentWinningPriceFieldNumber = 3; + private bool hasCurrentWinningPrice; + private ulong currentWinningPrice_; + public bool HasCurrentWinningPrice { + get { return hasCurrentWinningPrice; } + } + public ulong CurrentWinningPrice { + get { return currentWinningPrice_; } + } + + public override bool IsInitialized { + get { + if (!hasOffer) return false; + if (!hasExtension) return false; + if (!Offer.IsInitialized) return false; + if (!Extension.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _offerExtendedFieldNames; + if (hasOffer) { + output.WriteMessage(1, field_names[2], Offer); + } + if (hasExtension) { + output.WriteMessage(2, field_names[1], Extension); + } + if (hasCurrentWinningPrice) { + output.WriteUInt64(3, field_names[0], CurrentWinningPrice); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasOffer) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Offer); + } + if (hasExtension) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Extension); + } + if (hasCurrentWinningPrice) { + size += pb::CodedOutputStream.ComputeUInt64Size(3, CurrentWinningPrice); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static OfferExtended ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static OfferExtended ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static OfferExtended ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static OfferExtended ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static OfferExtended ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static OfferExtended ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static OfferExtended ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static OfferExtended ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static OfferExtended ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static OfferExtended ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private OfferExtended MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(OfferExtended prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(OfferExtended cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private OfferExtended result; + + private OfferExtended PrepareBuilder() { + if (resultIsReadOnly) { + OfferExtended original = result; + result = new OfferExtended(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override OfferExtended MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.OfferExtended.Descriptor; } + } + + public override OfferExtended DefaultInstanceForType { + get { return global::bnet.protocol.exchange.OfferExtended.DefaultInstance; } + } + + public override OfferExtended BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is OfferExtended) { + return MergeFrom((OfferExtended) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(OfferExtended other) { + if (other == global::bnet.protocol.exchange.OfferExtended.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasOffer) { + MergeOffer(other.Offer); + } + if (other.HasExtension) { + MergeExtension(other.Extension); + } + if (other.HasCurrentWinningPrice) { + CurrentWinningPrice = other.CurrentWinningPrice; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_offerExtendedFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _offerExtendedFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.Offer.Builder subBuilder = global::bnet.protocol.exchange.Offer.CreateBuilder(); + if (result.hasOffer) { + subBuilder.MergeFrom(Offer); + } + input.ReadMessage(subBuilder, extensionRegistry); + Offer = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.exchange.Extension.Builder subBuilder = global::bnet.protocol.exchange.Extension.CreateBuilder(); + if (result.hasExtension) { + subBuilder.MergeFrom(Extension); + } + input.ReadMessage(subBuilder, extensionRegistry); + Extension = subBuilder.BuildPartial(); + break; + } + case 24: { + result.hasCurrentWinningPrice = input.ReadUInt64(ref result.currentWinningPrice_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasOffer { + get { return result.hasOffer; } + } + public global::bnet.protocol.exchange.Offer Offer { + get { return result.Offer; } + set { SetOffer(value); } + } + public Builder SetOffer(global::bnet.protocol.exchange.Offer value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOffer = true; + result.offer_ = value; + return this; + } + public Builder SetOffer(global::bnet.protocol.exchange.Offer.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOffer = true; + result.offer_ = builderForValue.Build(); + return this; + } + public Builder MergeOffer(global::bnet.protocol.exchange.Offer value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOffer && + result.offer_ != global::bnet.protocol.exchange.Offer.DefaultInstance) { + result.offer_ = global::bnet.protocol.exchange.Offer.CreateBuilder(result.offer_).MergeFrom(value).BuildPartial(); + } else { + result.offer_ = value; + } + result.hasOffer = true; + return this; + } + public Builder ClearOffer() { + PrepareBuilder(); + result.hasOffer = false; + result.offer_ = null; + return this; + } + + public bool HasExtension { + get { return result.hasExtension; } + } + public global::bnet.protocol.exchange.Extension Extension { + get { return result.Extension; } + set { SetExtension(value); } + } + public Builder SetExtension(global::bnet.protocol.exchange.Extension value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasExtension = true; + result.extension_ = value; + return this; + } + public Builder SetExtension(global::bnet.protocol.exchange.Extension.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasExtension = true; + result.extension_ = builderForValue.Build(); + return this; + } + public Builder MergeExtension(global::bnet.protocol.exchange.Extension value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasExtension && + result.extension_ != global::bnet.protocol.exchange.Extension.DefaultInstance) { + result.extension_ = global::bnet.protocol.exchange.Extension.CreateBuilder(result.extension_).MergeFrom(value).BuildPartial(); + } else { + result.extension_ = value; + } + result.hasExtension = true; + return this; + } + public Builder ClearExtension() { + PrepareBuilder(); + result.hasExtension = false; + result.extension_ = null; + return this; + } + + public bool HasCurrentWinningPrice { + get { return result.hasCurrentWinningPrice; } + } + public ulong CurrentWinningPrice { + get { return result.CurrentWinningPrice; } + set { SetCurrentWinningPrice(value); } + } + public Builder SetCurrentWinningPrice(ulong value) { + PrepareBuilder(); + result.hasCurrentWinningPrice = true; + result.currentWinningPrice_ = value; + return this; + } + public Builder ClearCurrentWinningPrice() { + PrepareBuilder(); + result.hasCurrentWinningPrice = false; + result.currentWinningPrice_ = 0UL; + return this; + } + } + static OfferExtended() { + object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class OfferCreation : pb::GeneratedMessage { + private OfferCreation() { } + private static readonly OfferCreation defaultInstance = new OfferCreation().MakeReadOnly(); + private static readonly string[] _offerCreationFieldNames = new string[] { "auction_duration", "auction_start_delay", "billing_address", "offer" }; + private static readonly uint[] _offerCreationFieldTags = new uint[] { 16, 24, 34, 10 }; + public static OfferCreation DefaultInstance { + get { return defaultInstance; } + } + + public override OfferCreation DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override OfferCreation ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_OfferCreation__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_OfferCreation__FieldAccessorTable; } + } + + public const int OfferFieldNumber = 1; + private bool hasOffer; + private global::bnet.protocol.exchange.Offer offer_; + public bool HasOffer { + get { return hasOffer; } + } + public global::bnet.protocol.exchange.Offer Offer { + get { return offer_ ?? global::bnet.protocol.exchange.Offer.DefaultInstance; } + } + + public const int AuctionDurationFieldNumber = 2; + private bool hasAuctionDuration; + private ulong auctionDuration_; + public bool HasAuctionDuration { + get { return hasAuctionDuration; } + } + public ulong AuctionDuration { + get { return auctionDuration_; } + } + + public const int AuctionStartDelayFieldNumber = 3; + private bool hasAuctionStartDelay; + private ulong auctionStartDelay_; + public bool HasAuctionStartDelay { + get { return hasAuctionStartDelay; } + } + public ulong AuctionStartDelay { + get { return auctionStartDelay_; } + } + + public const int BillingAddressFieldNumber = 4; + private bool hasBillingAddress; + private global::bnet.protocol.exchange.BillingAddress billingAddress_; + public bool HasBillingAddress { + get { return hasBillingAddress; } + } + public global::bnet.protocol.exchange.BillingAddress BillingAddress { + get { return billingAddress_ ?? global::bnet.protocol.exchange.BillingAddress.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasOffer) return false; + if (!Offer.IsInitialized) return false; + if (HasBillingAddress) { + if (!BillingAddress.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _offerCreationFieldNames; + if (hasOffer) { + output.WriteMessage(1, field_names[3], Offer); + } + if (hasAuctionDuration) { + output.WriteUInt64(2, field_names[0], AuctionDuration); + } + if (hasAuctionStartDelay) { + output.WriteUInt64(3, field_names[1], AuctionStartDelay); + } + if (hasBillingAddress) { + output.WriteMessage(4, field_names[2], BillingAddress); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasOffer) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Offer); + } + if (hasAuctionDuration) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, AuctionDuration); + } + if (hasAuctionStartDelay) { + size += pb::CodedOutputStream.ComputeUInt64Size(3, AuctionStartDelay); + } + if (hasBillingAddress) { + size += pb::CodedOutputStream.ComputeMessageSize(4, BillingAddress); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static OfferCreation ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static OfferCreation ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static OfferCreation ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static OfferCreation ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static OfferCreation ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static OfferCreation ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static OfferCreation ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static OfferCreation ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static OfferCreation ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static OfferCreation ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private OfferCreation MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(OfferCreation prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(OfferCreation cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private OfferCreation result; + + private OfferCreation PrepareBuilder() { + if (resultIsReadOnly) { + OfferCreation original = result; + result = new OfferCreation(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override OfferCreation MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.OfferCreation.Descriptor; } + } + + public override OfferCreation DefaultInstanceForType { + get { return global::bnet.protocol.exchange.OfferCreation.DefaultInstance; } + } + + public override OfferCreation BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is OfferCreation) { + return MergeFrom((OfferCreation) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(OfferCreation other) { + if (other == global::bnet.protocol.exchange.OfferCreation.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasOffer) { + MergeOffer(other.Offer); + } + if (other.HasAuctionDuration) { + AuctionDuration = other.AuctionDuration; + } + if (other.HasAuctionStartDelay) { + AuctionStartDelay = other.AuctionStartDelay; + } + if (other.HasBillingAddress) { + MergeBillingAddress(other.BillingAddress); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_offerCreationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _offerCreationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.Offer.Builder subBuilder = global::bnet.protocol.exchange.Offer.CreateBuilder(); + if (result.hasOffer) { + subBuilder.MergeFrom(Offer); + } + input.ReadMessage(subBuilder, extensionRegistry); + Offer = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasAuctionDuration = input.ReadUInt64(ref result.auctionDuration_); + break; + } + case 24: { + result.hasAuctionStartDelay = input.ReadUInt64(ref result.auctionStartDelay_); + break; + } + case 34: { + global::bnet.protocol.exchange.BillingAddress.Builder subBuilder = global::bnet.protocol.exchange.BillingAddress.CreateBuilder(); + if (result.hasBillingAddress) { + subBuilder.MergeFrom(BillingAddress); + } + input.ReadMessage(subBuilder, extensionRegistry); + BillingAddress = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasOffer { + get { return result.hasOffer; } + } + public global::bnet.protocol.exchange.Offer Offer { + get { return result.Offer; } + set { SetOffer(value); } + } + public Builder SetOffer(global::bnet.protocol.exchange.Offer value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOffer = true; + result.offer_ = value; + return this; + } + public Builder SetOffer(global::bnet.protocol.exchange.Offer.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOffer = true; + result.offer_ = builderForValue.Build(); + return this; + } + public Builder MergeOffer(global::bnet.protocol.exchange.Offer value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOffer && + result.offer_ != global::bnet.protocol.exchange.Offer.DefaultInstance) { + result.offer_ = global::bnet.protocol.exchange.Offer.CreateBuilder(result.offer_).MergeFrom(value).BuildPartial(); + } else { + result.offer_ = value; + } + result.hasOffer = true; + return this; + } + public Builder ClearOffer() { + PrepareBuilder(); + result.hasOffer = false; + result.offer_ = null; + return this; + } + + public bool HasAuctionDuration { + get { return result.hasAuctionDuration; } + } + public ulong AuctionDuration { + get { return result.AuctionDuration; } + set { SetAuctionDuration(value); } + } + public Builder SetAuctionDuration(ulong value) { + PrepareBuilder(); + result.hasAuctionDuration = true; + result.auctionDuration_ = value; + return this; + } + public Builder ClearAuctionDuration() { + PrepareBuilder(); + result.hasAuctionDuration = false; + result.auctionDuration_ = 0UL; + return this; + } + + public bool HasAuctionStartDelay { + get { return result.hasAuctionStartDelay; } + } + public ulong AuctionStartDelay { + get { return result.AuctionStartDelay; } + set { SetAuctionStartDelay(value); } + } + public Builder SetAuctionStartDelay(ulong value) { + PrepareBuilder(); + result.hasAuctionStartDelay = true; + result.auctionStartDelay_ = value; + return this; + } + public Builder ClearAuctionStartDelay() { + PrepareBuilder(); + result.hasAuctionStartDelay = false; + result.auctionStartDelay_ = 0UL; + return this; + } + + public bool HasBillingAddress { + get { return result.hasBillingAddress; } + } + public global::bnet.protocol.exchange.BillingAddress BillingAddress { + get { return result.BillingAddress; } + set { SetBillingAddress(value); } + } + public Builder SetBillingAddress(global::bnet.protocol.exchange.BillingAddress value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBillingAddress = true; + result.billingAddress_ = value; + return this; + } + public Builder SetBillingAddress(global::bnet.protocol.exchange.BillingAddress.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBillingAddress = true; + result.billingAddress_ = builderForValue.Build(); + return this; + } + public Builder MergeBillingAddress(global::bnet.protocol.exchange.BillingAddress value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBillingAddress && + result.billingAddress_ != global::bnet.protocol.exchange.BillingAddress.DefaultInstance) { + result.billingAddress_ = global::bnet.protocol.exchange.BillingAddress.CreateBuilder(result.billingAddress_).MergeFrom(value).BuildPartial(); + } else { + result.billingAddress_ = value; + } + result.hasBillingAddress = true; + return this; + } + public Builder ClearBillingAddress() { + PrepareBuilder(); + result.hasBillingAddress = false; + result.billingAddress_ = null; + return this; + } + } + static OfferCreation() { + object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Bid : pb::GeneratedMessage { + private Bid() { } + private static readonly Bid defaultInstance = new Bid().MakeReadOnly(); + private static readonly string[] _bidFieldNames = new string[] { "current_unit_price", "max_unit_price", "order" }; + private static readonly uint[] _bidFieldTags = new uint[] { 16, 24, 10 }; + public static Bid DefaultInstance { + get { return defaultInstance; } + } + + public override Bid DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Bid ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_Bid__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_Bid__FieldAccessorTable; } + } + + public const int OrderFieldNumber = 1; + private bool hasOrder; + private global::bnet.protocol.exchange.Order order_; + public bool HasOrder { + get { return hasOrder; } + } + public global::bnet.protocol.exchange.Order Order { + get { return order_ ?? global::bnet.protocol.exchange.Order.DefaultInstance; } + } + + public const int CurrentUnitPriceFieldNumber = 2; + private bool hasCurrentUnitPrice; + private ulong currentUnitPrice_; + public bool HasCurrentUnitPrice { + get { return hasCurrentUnitPrice; } + } + public ulong CurrentUnitPrice { + get { return currentUnitPrice_; } + } + + public const int MaxUnitPriceFieldNumber = 3; + private bool hasMaxUnitPrice; + private ulong maxUnitPrice_; + public bool HasMaxUnitPrice { + get { return hasMaxUnitPrice; } + } + public ulong MaxUnitPrice { + get { return maxUnitPrice_; } + } + + public override bool IsInitialized { + get { + if (!hasOrder) return false; + if (!Order.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _bidFieldNames; + if (hasOrder) { + output.WriteMessage(1, field_names[2], Order); + } + if (hasCurrentUnitPrice) { + output.WriteUInt64(2, field_names[0], CurrentUnitPrice); + } + if (hasMaxUnitPrice) { + output.WriteUInt64(3, field_names[1], MaxUnitPrice); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasOrder) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Order); + } + if (hasCurrentUnitPrice) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, CurrentUnitPrice); + } + if (hasMaxUnitPrice) { + size += pb::CodedOutputStream.ComputeUInt64Size(3, MaxUnitPrice); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static Bid ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Bid ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Bid ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Bid ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Bid ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Bid ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Bid ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Bid ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Bid ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Bid ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Bid MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Bid prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Bid cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Bid result; + + private Bid PrepareBuilder() { + if (resultIsReadOnly) { + Bid original = result; + result = new Bid(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Bid MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.Bid.Descriptor; } + } + + public override Bid DefaultInstanceForType { + get { return global::bnet.protocol.exchange.Bid.DefaultInstance; } + } + + public override Bid BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Bid) { + return MergeFrom((Bid) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Bid other) { + if (other == global::bnet.protocol.exchange.Bid.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasOrder) { + MergeOrder(other.Order); + } + if (other.HasCurrentUnitPrice) { + CurrentUnitPrice = other.CurrentUnitPrice; + } + if (other.HasMaxUnitPrice) { + MaxUnitPrice = other.MaxUnitPrice; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_bidFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _bidFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.Order.Builder subBuilder = global::bnet.protocol.exchange.Order.CreateBuilder(); + if (result.hasOrder) { + subBuilder.MergeFrom(Order); + } + input.ReadMessage(subBuilder, extensionRegistry); + Order = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasCurrentUnitPrice = input.ReadUInt64(ref result.currentUnitPrice_); + break; + } + case 24: { + result.hasMaxUnitPrice = input.ReadUInt64(ref result.maxUnitPrice_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasOrder { + get { return result.hasOrder; } + } + public global::bnet.protocol.exchange.Order Order { + get { return result.Order; } + set { SetOrder(value); } + } + public Builder SetOrder(global::bnet.protocol.exchange.Order value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOrder = true; + result.order_ = value; + return this; + } + public Builder SetOrder(global::bnet.protocol.exchange.Order.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOrder = true; + result.order_ = builderForValue.Build(); + return this; + } + public Builder MergeOrder(global::bnet.protocol.exchange.Order value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOrder && + result.order_ != global::bnet.protocol.exchange.Order.DefaultInstance) { + result.order_ = global::bnet.protocol.exchange.Order.CreateBuilder(result.order_).MergeFrom(value).BuildPartial(); + } else { + result.order_ = value; + } + result.hasOrder = true; + return this; + } + public Builder ClearOrder() { + PrepareBuilder(); + result.hasOrder = false; + result.order_ = null; + return this; + } + + public bool HasCurrentUnitPrice { + get { return result.hasCurrentUnitPrice; } + } + public ulong CurrentUnitPrice { + get { return result.CurrentUnitPrice; } + set { SetCurrentUnitPrice(value); } + } + public Builder SetCurrentUnitPrice(ulong value) { + PrepareBuilder(); + result.hasCurrentUnitPrice = true; + result.currentUnitPrice_ = value; + return this; + } + public Builder ClearCurrentUnitPrice() { + PrepareBuilder(); + result.hasCurrentUnitPrice = false; + result.currentUnitPrice_ = 0UL; + return this; + } + + public bool HasMaxUnitPrice { + get { return result.hasMaxUnitPrice; } + } + public ulong MaxUnitPrice { + get { return result.MaxUnitPrice; } + set { SetMaxUnitPrice(value); } + } + public Builder SetMaxUnitPrice(ulong value) { + PrepareBuilder(); + result.hasMaxUnitPrice = true; + result.maxUnitPrice_ = value; + return this; + } + public Builder ClearMaxUnitPrice() { + PrepareBuilder(); + result.hasMaxUnitPrice = false; + result.maxUnitPrice_ = 0UL; + return this; + } + } + static Bid() { + object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class BidExtended : pb::GeneratedMessage { + private BidExtended() { } + private static readonly BidExtended defaultInstance = new BidExtended().MakeReadOnly(); + private static readonly string[] _bidExtendedFieldNames = new string[] { "bid", "bid_current_unit_price", "bid_max_unit_price", "extension", "offer_current_winning_price", "offer_out_bid_price", "offer_trade_now_price" }; + private static readonly uint[] _bidExtendedFieldTags = new uint[] { 10, 48, 56, 18, 40, 24, 32 }; + public static BidExtended DefaultInstance { + get { return defaultInstance; } + } + + public override BidExtended DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override BidExtended ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_BidExtended__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_BidExtended__FieldAccessorTable; } + } + + public const int BidFieldNumber = 1; + private bool hasBid; + private global::bnet.protocol.exchange.Bid bid_; + public bool HasBid { + get { return hasBid; } + } + public global::bnet.protocol.exchange.Bid Bid { + get { return bid_ ?? global::bnet.protocol.exchange.Bid.DefaultInstance; } + } + + public const int ExtensionFieldNumber = 2; + private bool hasExtension; + private global::bnet.protocol.exchange.Extension extension_; + public bool HasExtension { + get { return hasExtension; } + } + public global::bnet.protocol.exchange.Extension Extension { + get { return extension_ ?? global::bnet.protocol.exchange.Extension.DefaultInstance; } + } + + public const int OfferOutBidPriceFieldNumber = 3; + private bool hasOfferOutBidPrice; + private ulong offerOutBidPrice_; + public bool HasOfferOutBidPrice { + get { return hasOfferOutBidPrice; } + } + public ulong OfferOutBidPrice { + get { return offerOutBidPrice_; } + } + + public const int OfferTradeNowPriceFieldNumber = 4; + private bool hasOfferTradeNowPrice; + private ulong offerTradeNowPrice_; + public bool HasOfferTradeNowPrice { + get { return hasOfferTradeNowPrice; } + } + public ulong OfferTradeNowPrice { + get { return offerTradeNowPrice_; } + } + + public const int OfferCurrentWinningPriceFieldNumber = 5; + private bool hasOfferCurrentWinningPrice; + private ulong offerCurrentWinningPrice_; + public bool HasOfferCurrentWinningPrice { + get { return hasOfferCurrentWinningPrice; } + } + public ulong OfferCurrentWinningPrice { + get { return offerCurrentWinningPrice_; } + } + + public const int BidCurrentUnitPriceFieldNumber = 6; + private bool hasBidCurrentUnitPrice; + private ulong bidCurrentUnitPrice_; + public bool HasBidCurrentUnitPrice { + get { return hasBidCurrentUnitPrice; } + } + public ulong BidCurrentUnitPrice { + get { return bidCurrentUnitPrice_; } + } + + public const int BidMaxUnitPriceFieldNumber = 7; + private bool hasBidMaxUnitPrice; + private ulong bidMaxUnitPrice_; + public bool HasBidMaxUnitPrice { + get { return hasBidMaxUnitPrice; } + } + public ulong BidMaxUnitPrice { + get { return bidMaxUnitPrice_; } + } + + public override bool IsInitialized { + get { + if (!hasBid) return false; + if (!hasExtension) return false; + if (!Bid.IsInitialized) return false; + if (!Extension.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _bidExtendedFieldNames; + if (hasBid) { + output.WriteMessage(1, field_names[0], Bid); + } + if (hasExtension) { + output.WriteMessage(2, field_names[3], Extension); + } + if (hasOfferOutBidPrice) { + output.WriteUInt64(3, field_names[5], OfferOutBidPrice); + } + if (hasOfferTradeNowPrice) { + output.WriteUInt64(4, field_names[6], OfferTradeNowPrice); + } + if (hasOfferCurrentWinningPrice) { + output.WriteUInt64(5, field_names[4], OfferCurrentWinningPrice); + } + if (hasBidCurrentUnitPrice) { + output.WriteUInt64(6, field_names[1], BidCurrentUnitPrice); + } + if (hasBidMaxUnitPrice) { + output.WriteUInt64(7, field_names[2], BidMaxUnitPrice); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasBid) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Bid); + } + if (hasExtension) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Extension); + } + if (hasOfferOutBidPrice) { + size += pb::CodedOutputStream.ComputeUInt64Size(3, OfferOutBidPrice); + } + if (hasOfferTradeNowPrice) { + size += pb::CodedOutputStream.ComputeUInt64Size(4, OfferTradeNowPrice); + } + if (hasOfferCurrentWinningPrice) { + size += pb::CodedOutputStream.ComputeUInt64Size(5, OfferCurrentWinningPrice); + } + if (hasBidCurrentUnitPrice) { + size += pb::CodedOutputStream.ComputeUInt64Size(6, BidCurrentUnitPrice); + } + if (hasBidMaxUnitPrice) { + size += pb::CodedOutputStream.ComputeUInt64Size(7, BidMaxUnitPrice); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static BidExtended ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static BidExtended ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static BidExtended ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static BidExtended ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static BidExtended ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static BidExtended ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static BidExtended ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static BidExtended ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static BidExtended ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static BidExtended ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private BidExtended MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(BidExtended prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(BidExtended cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private BidExtended result; + + private BidExtended PrepareBuilder() { + if (resultIsReadOnly) { + BidExtended original = result; + result = new BidExtended(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override BidExtended MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.BidExtended.Descriptor; } + } + + public override BidExtended DefaultInstanceForType { + get { return global::bnet.protocol.exchange.BidExtended.DefaultInstance; } + } + + public override BidExtended BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is BidExtended) { + return MergeFrom((BidExtended) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(BidExtended other) { + if (other == global::bnet.protocol.exchange.BidExtended.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasBid) { + MergeBid(other.Bid); + } + if (other.HasExtension) { + MergeExtension(other.Extension); + } + if (other.HasOfferOutBidPrice) { + OfferOutBidPrice = other.OfferOutBidPrice; + } + if (other.HasOfferTradeNowPrice) { + OfferTradeNowPrice = other.OfferTradeNowPrice; + } + if (other.HasOfferCurrentWinningPrice) { + OfferCurrentWinningPrice = other.OfferCurrentWinningPrice; + } + if (other.HasBidCurrentUnitPrice) { + BidCurrentUnitPrice = other.BidCurrentUnitPrice; + } + if (other.HasBidMaxUnitPrice) { + BidMaxUnitPrice = other.BidMaxUnitPrice; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_bidExtendedFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _bidExtendedFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.Bid.Builder subBuilder = global::bnet.protocol.exchange.Bid.CreateBuilder(); + if (result.hasBid) { + subBuilder.MergeFrom(Bid); + } + input.ReadMessage(subBuilder, extensionRegistry); + Bid = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.exchange.Extension.Builder subBuilder = global::bnet.protocol.exchange.Extension.CreateBuilder(); + if (result.hasExtension) { + subBuilder.MergeFrom(Extension); + } + input.ReadMessage(subBuilder, extensionRegistry); + Extension = subBuilder.BuildPartial(); + break; + } + case 24: { + result.hasOfferOutBidPrice = input.ReadUInt64(ref result.offerOutBidPrice_); + break; + } + case 32: { + result.hasOfferTradeNowPrice = input.ReadUInt64(ref result.offerTradeNowPrice_); + break; + } + case 40: { + result.hasOfferCurrentWinningPrice = input.ReadUInt64(ref result.offerCurrentWinningPrice_); + break; + } + case 48: { + result.hasBidCurrentUnitPrice = input.ReadUInt64(ref result.bidCurrentUnitPrice_); + break; + } + case 56: { + result.hasBidMaxUnitPrice = input.ReadUInt64(ref result.bidMaxUnitPrice_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasBid { + get { return result.hasBid; } + } + public global::bnet.protocol.exchange.Bid Bid { + get { return result.Bid; } + set { SetBid(value); } + } + public Builder SetBid(global::bnet.protocol.exchange.Bid value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBid = true; + result.bid_ = value; + return this; + } + public Builder SetBid(global::bnet.protocol.exchange.Bid.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBid = true; + result.bid_ = builderForValue.Build(); + return this; + } + public Builder MergeBid(global::bnet.protocol.exchange.Bid value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBid && + result.bid_ != global::bnet.protocol.exchange.Bid.DefaultInstance) { + result.bid_ = global::bnet.protocol.exchange.Bid.CreateBuilder(result.bid_).MergeFrom(value).BuildPartial(); + } else { + result.bid_ = value; + } + result.hasBid = true; + return this; + } + public Builder ClearBid() { + PrepareBuilder(); + result.hasBid = false; + result.bid_ = null; + return this; + } + + public bool HasExtension { + get { return result.hasExtension; } + } + public global::bnet.protocol.exchange.Extension Extension { + get { return result.Extension; } + set { SetExtension(value); } + } + public Builder SetExtension(global::bnet.protocol.exchange.Extension value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasExtension = true; + result.extension_ = value; + return this; + } + public Builder SetExtension(global::bnet.protocol.exchange.Extension.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasExtension = true; + result.extension_ = builderForValue.Build(); + return this; + } + public Builder MergeExtension(global::bnet.protocol.exchange.Extension value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasExtension && + result.extension_ != global::bnet.protocol.exchange.Extension.DefaultInstance) { + result.extension_ = global::bnet.protocol.exchange.Extension.CreateBuilder(result.extension_).MergeFrom(value).BuildPartial(); + } else { + result.extension_ = value; + } + result.hasExtension = true; + return this; + } + public Builder ClearExtension() { + PrepareBuilder(); + result.hasExtension = false; + result.extension_ = null; + return this; + } + + public bool HasOfferOutBidPrice { + get { return result.hasOfferOutBidPrice; } + } + public ulong OfferOutBidPrice { + get { return result.OfferOutBidPrice; } + set { SetOfferOutBidPrice(value); } + } + public Builder SetOfferOutBidPrice(ulong value) { + PrepareBuilder(); + result.hasOfferOutBidPrice = true; + result.offerOutBidPrice_ = value; + return this; + } + public Builder ClearOfferOutBidPrice() { + PrepareBuilder(); + result.hasOfferOutBidPrice = false; + result.offerOutBidPrice_ = 0UL; + return this; + } + + public bool HasOfferTradeNowPrice { + get { return result.hasOfferTradeNowPrice; } + } + public ulong OfferTradeNowPrice { + get { return result.OfferTradeNowPrice; } + set { SetOfferTradeNowPrice(value); } + } + public Builder SetOfferTradeNowPrice(ulong value) { + PrepareBuilder(); + result.hasOfferTradeNowPrice = true; + result.offerTradeNowPrice_ = value; + return this; + } + public Builder ClearOfferTradeNowPrice() { + PrepareBuilder(); + result.hasOfferTradeNowPrice = false; + result.offerTradeNowPrice_ = 0UL; + return this; + } + + public bool HasOfferCurrentWinningPrice { + get { return result.hasOfferCurrentWinningPrice; } + } + public ulong OfferCurrentWinningPrice { + get { return result.OfferCurrentWinningPrice; } + set { SetOfferCurrentWinningPrice(value); } + } + public Builder SetOfferCurrentWinningPrice(ulong value) { + PrepareBuilder(); + result.hasOfferCurrentWinningPrice = true; + result.offerCurrentWinningPrice_ = value; + return this; + } + public Builder ClearOfferCurrentWinningPrice() { + PrepareBuilder(); + result.hasOfferCurrentWinningPrice = false; + result.offerCurrentWinningPrice_ = 0UL; + return this; + } + + public bool HasBidCurrentUnitPrice { + get { return result.hasBidCurrentUnitPrice; } + } + public ulong BidCurrentUnitPrice { + get { return result.BidCurrentUnitPrice; } + set { SetBidCurrentUnitPrice(value); } + } + public Builder SetBidCurrentUnitPrice(ulong value) { + PrepareBuilder(); + result.hasBidCurrentUnitPrice = true; + result.bidCurrentUnitPrice_ = value; + return this; + } + public Builder ClearBidCurrentUnitPrice() { + PrepareBuilder(); + result.hasBidCurrentUnitPrice = false; + result.bidCurrentUnitPrice_ = 0UL; + return this; + } + + public bool HasBidMaxUnitPrice { + get { return result.hasBidMaxUnitPrice; } + } + public ulong BidMaxUnitPrice { + get { return result.BidMaxUnitPrice; } + set { SetBidMaxUnitPrice(value); } + } + public Builder SetBidMaxUnitPrice(ulong value) { + PrepareBuilder(); + result.hasBidMaxUnitPrice = true; + result.bidMaxUnitPrice_ = value; + return this; + } + public Builder ClearBidMaxUnitPrice() { + PrepareBuilder(); + result.hasBidMaxUnitPrice = false; + result.bidMaxUnitPrice_ = 0UL; + return this; + } + } + static BidExtended() { + object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class BidCreation : pb::GeneratedMessage { + private BidCreation() { } + private static readonly BidCreation defaultInstance = new BidCreation().MakeReadOnly(); + private static readonly string[] _bidCreationFieldNames = new string[] { "auction_duration", "auction_start_delay", "bid", "billing_address", "fill_or_kill" }; + private static readonly uint[] _bidCreationFieldTags = new uint[] { 16, 24, 10, 34, 40 }; + public static BidCreation DefaultInstance { + get { return defaultInstance; } + } + + public override BidCreation DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override BidCreation ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_BidCreation__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_BidCreation__FieldAccessorTable; } + } + + public const int BidFieldNumber = 1; + private bool hasBid; + private global::bnet.protocol.exchange.Bid bid_; + public bool HasBid { + get { return hasBid; } + } + public global::bnet.protocol.exchange.Bid Bid { + get { return bid_ ?? global::bnet.protocol.exchange.Bid.DefaultInstance; } + } + + public const int AuctionDurationFieldNumber = 2; + private bool hasAuctionDuration; + private ulong auctionDuration_; + public bool HasAuctionDuration { + get { return hasAuctionDuration; } + } + public ulong AuctionDuration { + get { return auctionDuration_; } + } + + public const int AuctionStartDelayFieldNumber = 3; + private bool hasAuctionStartDelay; + private ulong auctionStartDelay_; + public bool HasAuctionStartDelay { + get { return hasAuctionStartDelay; } + } + public ulong AuctionStartDelay { + get { return auctionStartDelay_; } + } + + public const int BillingAddressFieldNumber = 4; + private bool hasBillingAddress; + private global::bnet.protocol.exchange.BillingAddress billingAddress_; + public bool HasBillingAddress { + get { return hasBillingAddress; } + } + public global::bnet.protocol.exchange.BillingAddress BillingAddress { + get { return billingAddress_ ?? global::bnet.protocol.exchange.BillingAddress.DefaultInstance; } + } + + public const int FillOrKillFieldNumber = 5; + private bool hasFillOrKill; + private bool fillOrKill_; + public bool HasFillOrKill { + get { return hasFillOrKill; } + } + public bool FillOrKill { + get { return fillOrKill_; } + } + + public override bool IsInitialized { + get { + if (!hasBid) return false; + if (!Bid.IsInitialized) return false; + if (HasBillingAddress) { + if (!BillingAddress.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _bidCreationFieldNames; + if (hasBid) { + output.WriteMessage(1, field_names[2], Bid); + } + if (hasAuctionDuration) { + output.WriteUInt64(2, field_names[0], AuctionDuration); + } + if (hasAuctionStartDelay) { + output.WriteUInt64(3, field_names[1], AuctionStartDelay); + } + if (hasBillingAddress) { + output.WriteMessage(4, field_names[3], BillingAddress); + } + if (hasFillOrKill) { + output.WriteBool(5, field_names[4], FillOrKill); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasBid) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Bid); + } + if (hasAuctionDuration) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, AuctionDuration); + } + if (hasAuctionStartDelay) { + size += pb::CodedOutputStream.ComputeUInt64Size(3, AuctionStartDelay); + } + if (hasBillingAddress) { + size += pb::CodedOutputStream.ComputeMessageSize(4, BillingAddress); + } + if (hasFillOrKill) { + size += pb::CodedOutputStream.ComputeBoolSize(5, FillOrKill); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static BidCreation ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static BidCreation ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static BidCreation ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static BidCreation ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static BidCreation ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static BidCreation ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static BidCreation ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static BidCreation ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static BidCreation ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static BidCreation ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private BidCreation MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(BidCreation prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(BidCreation cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private BidCreation result; + + private BidCreation PrepareBuilder() { + if (resultIsReadOnly) { + BidCreation original = result; + result = new BidCreation(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override BidCreation MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.BidCreation.Descriptor; } + } + + public override BidCreation DefaultInstanceForType { + get { return global::bnet.protocol.exchange.BidCreation.DefaultInstance; } + } + + public override BidCreation BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is BidCreation) { + return MergeFrom((BidCreation) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(BidCreation other) { + if (other == global::bnet.protocol.exchange.BidCreation.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasBid) { + MergeBid(other.Bid); + } + if (other.HasAuctionDuration) { + AuctionDuration = other.AuctionDuration; + } + if (other.HasAuctionStartDelay) { + AuctionStartDelay = other.AuctionStartDelay; + } + if (other.HasBillingAddress) { + MergeBillingAddress(other.BillingAddress); + } + if (other.HasFillOrKill) { + FillOrKill = other.FillOrKill; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_bidCreationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _bidCreationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.Bid.Builder subBuilder = global::bnet.protocol.exchange.Bid.CreateBuilder(); + if (result.hasBid) { + subBuilder.MergeFrom(Bid); + } + input.ReadMessage(subBuilder, extensionRegistry); + Bid = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasAuctionDuration = input.ReadUInt64(ref result.auctionDuration_); + break; + } + case 24: { + result.hasAuctionStartDelay = input.ReadUInt64(ref result.auctionStartDelay_); + break; + } + case 34: { + global::bnet.protocol.exchange.BillingAddress.Builder subBuilder = global::bnet.protocol.exchange.BillingAddress.CreateBuilder(); + if (result.hasBillingAddress) { + subBuilder.MergeFrom(BillingAddress); + } + input.ReadMessage(subBuilder, extensionRegistry); + BillingAddress = subBuilder.BuildPartial(); + break; + } + case 40: { + result.hasFillOrKill = input.ReadBool(ref result.fillOrKill_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasBid { + get { return result.hasBid; } + } + public global::bnet.protocol.exchange.Bid Bid { + get { return result.Bid; } + set { SetBid(value); } + } + public Builder SetBid(global::bnet.protocol.exchange.Bid value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBid = true; + result.bid_ = value; + return this; + } + public Builder SetBid(global::bnet.protocol.exchange.Bid.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBid = true; + result.bid_ = builderForValue.Build(); + return this; + } + public Builder MergeBid(global::bnet.protocol.exchange.Bid value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBid && + result.bid_ != global::bnet.protocol.exchange.Bid.DefaultInstance) { + result.bid_ = global::bnet.protocol.exchange.Bid.CreateBuilder(result.bid_).MergeFrom(value).BuildPartial(); + } else { + result.bid_ = value; + } + result.hasBid = true; + return this; + } + public Builder ClearBid() { + PrepareBuilder(); + result.hasBid = false; + result.bid_ = null; + return this; + } + + public bool HasAuctionDuration { + get { return result.hasAuctionDuration; } + } + public ulong AuctionDuration { + get { return result.AuctionDuration; } + set { SetAuctionDuration(value); } + } + public Builder SetAuctionDuration(ulong value) { + PrepareBuilder(); + result.hasAuctionDuration = true; + result.auctionDuration_ = value; + return this; + } + public Builder ClearAuctionDuration() { + PrepareBuilder(); + result.hasAuctionDuration = false; + result.auctionDuration_ = 0UL; + return this; + } + + public bool HasAuctionStartDelay { + get { return result.hasAuctionStartDelay; } + } + public ulong AuctionStartDelay { + get { return result.AuctionStartDelay; } + set { SetAuctionStartDelay(value); } + } + public Builder SetAuctionStartDelay(ulong value) { + PrepareBuilder(); + result.hasAuctionStartDelay = true; + result.auctionStartDelay_ = value; + return this; + } + public Builder ClearAuctionStartDelay() { + PrepareBuilder(); + result.hasAuctionStartDelay = false; + result.auctionStartDelay_ = 0UL; + return this; + } + + public bool HasBillingAddress { + get { return result.hasBillingAddress; } + } + public global::bnet.protocol.exchange.BillingAddress BillingAddress { + get { return result.BillingAddress; } + set { SetBillingAddress(value); } + } + public Builder SetBillingAddress(global::bnet.protocol.exchange.BillingAddress value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBillingAddress = true; + result.billingAddress_ = value; + return this; + } + public Builder SetBillingAddress(global::bnet.protocol.exchange.BillingAddress.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBillingAddress = true; + result.billingAddress_ = builderForValue.Build(); + return this; + } + public Builder MergeBillingAddress(global::bnet.protocol.exchange.BillingAddress value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBillingAddress && + result.billingAddress_ != global::bnet.protocol.exchange.BillingAddress.DefaultInstance) { + result.billingAddress_ = global::bnet.protocol.exchange.BillingAddress.CreateBuilder(result.billingAddress_).MergeFrom(value).BuildPartial(); + } else { + result.billingAddress_ = value; + } + result.hasBillingAddress = true; + return this; + } + public Builder ClearBillingAddress() { + PrepareBuilder(); + result.hasBillingAddress = false; + result.billingAddress_ = null; + return this; + } + + public bool HasFillOrKill { + get { return result.hasFillOrKill; } + } + public bool FillOrKill { + get { return result.FillOrKill; } + set { SetFillOrKill(value); } + } + public Builder SetFillOrKill(bool value) { + PrepareBuilder(); + result.hasFillOrKill = true; + result.fillOrKill_ = value; + return this; + } + public Builder ClearFillOrKill() { + PrepareBuilder(); + result.hasFillOrKill = false; + result.fillOrKill_ = false; + return this; + } + } + static BidCreation() { + object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class OrderExtended : pb::GeneratedMessage { + private OrderExtended() { } + private static readonly OrderExtended defaultInstance = new OrderExtended().MakeReadOnly(); + private static readonly string[] _orderExtendedFieldNames = new string[] { "bid_extended", "offer_extended", "order_type" }; + private static readonly uint[] _orderExtendedFieldTags = new uint[] { 18, 26, 8 }; + public static OrderExtended DefaultInstance { + get { return defaultInstance; } + } + + public override OrderExtended DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override OrderExtended ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_OrderExtended__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_OrderExtended__FieldAccessorTable; } + } + + public const int OrderTypeFieldNumber = 1; + private bool hasOrderType; + private uint orderType_; + public bool HasOrderType { + get { return hasOrderType; } + } + public uint OrderType { + get { return orderType_; } + } + + public const int BidExtendedFieldNumber = 2; + private bool hasBidExtended; + private global::bnet.protocol.exchange.BidExtended bidExtended_; + public bool HasBidExtended { + get { return hasBidExtended; } + } + public global::bnet.protocol.exchange.BidExtended BidExtended { + get { return bidExtended_ ?? global::bnet.protocol.exchange.BidExtended.DefaultInstance; } + } + + public const int OfferExtendedFieldNumber = 3; + private bool hasOfferExtended; + private global::bnet.protocol.exchange.OfferExtended offerExtended_; + public bool HasOfferExtended { + get { return hasOfferExtended; } + } + public global::bnet.protocol.exchange.OfferExtended OfferExtended { + get { return offerExtended_ ?? global::bnet.protocol.exchange.OfferExtended.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasOrderType) return false; + if (HasBidExtended) { + if (!BidExtended.IsInitialized) return false; + } + if (HasOfferExtended) { + if (!OfferExtended.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _orderExtendedFieldNames; + if (hasOrderType) { + output.WriteUInt32(1, field_names[2], OrderType); + } + if (hasBidExtended) { + output.WriteMessage(2, field_names[0], BidExtended); + } + if (hasOfferExtended) { + output.WriteMessage(3, field_names[1], OfferExtended); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasOrderType) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, OrderType); + } + if (hasBidExtended) { + size += pb::CodedOutputStream.ComputeMessageSize(2, BidExtended); + } + if (hasOfferExtended) { + size += pb::CodedOutputStream.ComputeMessageSize(3, OfferExtended); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static OrderExtended ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static OrderExtended ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static OrderExtended ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static OrderExtended ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static OrderExtended ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static OrderExtended ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static OrderExtended ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static OrderExtended ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static OrderExtended ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static OrderExtended ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private OrderExtended MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(OrderExtended prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(OrderExtended cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private OrderExtended result; + + private OrderExtended PrepareBuilder() { + if (resultIsReadOnly) { + OrderExtended original = result; + result = new OrderExtended(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override OrderExtended MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.OrderExtended.Descriptor; } + } + + public override OrderExtended DefaultInstanceForType { + get { return global::bnet.protocol.exchange.OrderExtended.DefaultInstance; } + } + + public override OrderExtended BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is OrderExtended) { + return MergeFrom((OrderExtended) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(OrderExtended other) { + if (other == global::bnet.protocol.exchange.OrderExtended.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasOrderType) { + OrderType = other.OrderType; + } + if (other.HasBidExtended) { + MergeBidExtended(other.BidExtended); + } + if (other.HasOfferExtended) { + MergeOfferExtended(other.OfferExtended); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_orderExtendedFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _orderExtendedFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasOrderType = input.ReadUInt32(ref result.orderType_); + break; + } + case 18: { + global::bnet.protocol.exchange.BidExtended.Builder subBuilder = global::bnet.protocol.exchange.BidExtended.CreateBuilder(); + if (result.hasBidExtended) { + subBuilder.MergeFrom(BidExtended); + } + input.ReadMessage(subBuilder, extensionRegistry); + BidExtended = subBuilder.BuildPartial(); + break; + } + case 26: { + global::bnet.protocol.exchange.OfferExtended.Builder subBuilder = global::bnet.protocol.exchange.OfferExtended.CreateBuilder(); + if (result.hasOfferExtended) { + subBuilder.MergeFrom(OfferExtended); + } + input.ReadMessage(subBuilder, extensionRegistry); + OfferExtended = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasOrderType { + get { return result.hasOrderType; } + } + public uint OrderType { + get { return result.OrderType; } + set { SetOrderType(value); } + } + public Builder SetOrderType(uint value) { + PrepareBuilder(); + result.hasOrderType = true; + result.orderType_ = value; + return this; + } + public Builder ClearOrderType() { + PrepareBuilder(); + result.hasOrderType = false; + result.orderType_ = 0; + return this; + } + + public bool HasBidExtended { + get { return result.hasBidExtended; } + } + public global::bnet.protocol.exchange.BidExtended BidExtended { + get { return result.BidExtended; } + set { SetBidExtended(value); } + } + public Builder SetBidExtended(global::bnet.protocol.exchange.BidExtended value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBidExtended = true; + result.bidExtended_ = value; + return this; + } + public Builder SetBidExtended(global::bnet.protocol.exchange.BidExtended.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBidExtended = true; + result.bidExtended_ = builderForValue.Build(); + return this; + } + public Builder MergeBidExtended(global::bnet.protocol.exchange.BidExtended value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBidExtended && + result.bidExtended_ != global::bnet.protocol.exchange.BidExtended.DefaultInstance) { + result.bidExtended_ = global::bnet.protocol.exchange.BidExtended.CreateBuilder(result.bidExtended_).MergeFrom(value).BuildPartial(); + } else { + result.bidExtended_ = value; + } + result.hasBidExtended = true; + return this; + } + public Builder ClearBidExtended() { + PrepareBuilder(); + result.hasBidExtended = false; + result.bidExtended_ = null; + return this; + } + + public bool HasOfferExtended { + get { return result.hasOfferExtended; } + } + public global::bnet.protocol.exchange.OfferExtended OfferExtended { + get { return result.OfferExtended; } + set { SetOfferExtended(value); } + } + public Builder SetOfferExtended(global::bnet.protocol.exchange.OfferExtended value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOfferExtended = true; + result.offerExtended_ = value; + return this; + } + public Builder SetOfferExtended(global::bnet.protocol.exchange.OfferExtended.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOfferExtended = true; + result.offerExtended_ = builderForValue.Build(); + return this; + } + public Builder MergeOfferExtended(global::bnet.protocol.exchange.OfferExtended value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOfferExtended && + result.offerExtended_ != global::bnet.protocol.exchange.OfferExtended.DefaultInstance) { + result.offerExtended_ = global::bnet.protocol.exchange.OfferExtended.CreateBuilder(result.offerExtended_).MergeFrom(value).BuildPartial(); + } else { + result.offerExtended_ = value; + } + result.hasOfferExtended = true; + return this; + } + public Builder ClearOfferExtended() { + PrepareBuilder(); + result.hasOfferExtended = false; + result.offerExtended_ = null; + return this; + } + } + static OrderExtended() { + object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class QueryFilterByOrderId : pb::GeneratedMessage { + private QueryFilterByOrderId() { } + private static readonly QueryFilterByOrderId defaultInstance = new QueryFilterByOrderId().MakeReadOnly(); + private static readonly string[] _queryFilterByOrderIdFieldNames = new string[] { "max_result", "ref_order_id", "ref_price" }; + private static readonly uint[] _queryFilterByOrderIdFieldTags = new uint[] { 8, 16, 24 }; + public static QueryFilterByOrderId DefaultInstance { + get { return defaultInstance; } + } + + public override QueryFilterByOrderId DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override QueryFilterByOrderId ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_QueryFilterByOrderId__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_QueryFilterByOrderId__FieldAccessorTable; } + } + + public const int MaxResultFieldNumber = 1; + private bool hasMaxResult; + private uint maxResult_; + public bool HasMaxResult { + get { return hasMaxResult; } + } + public uint MaxResult { + get { return maxResult_; } + } + + public const int RefOrderIdFieldNumber = 2; + private bool hasRefOrderId; + private ulong refOrderId_; + public bool HasRefOrderId { + get { return hasRefOrderId; } + } + public ulong RefOrderId { + get { return refOrderId_; } + } + + public const int RefPriceFieldNumber = 3; + private bool hasRefPrice; + private ulong refPrice_; + public bool HasRefPrice { + get { return hasRefPrice; } + } + public ulong RefPrice { + get { return refPrice_; } + } + + public override bool IsInitialized { + get { + if (!hasMaxResult) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _queryFilterByOrderIdFieldNames; + if (hasMaxResult) { + output.WriteUInt32(1, field_names[0], MaxResult); + } + if (hasRefOrderId) { + output.WriteUInt64(2, field_names[1], RefOrderId); + } + if (hasRefPrice) { + output.WriteUInt64(3, field_names[2], RefPrice); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasMaxResult) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, MaxResult); + } + if (hasRefOrderId) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, RefOrderId); + } + if (hasRefPrice) { + size += pb::CodedOutputStream.ComputeUInt64Size(3, RefPrice); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static QueryFilterByOrderId ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static QueryFilterByOrderId ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static QueryFilterByOrderId ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static QueryFilterByOrderId ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static QueryFilterByOrderId ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static QueryFilterByOrderId ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static QueryFilterByOrderId ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static QueryFilterByOrderId ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static QueryFilterByOrderId ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static QueryFilterByOrderId ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private QueryFilterByOrderId MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(QueryFilterByOrderId prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(QueryFilterByOrderId cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private QueryFilterByOrderId result; + + private QueryFilterByOrderId PrepareBuilder() { + if (resultIsReadOnly) { + QueryFilterByOrderId original = result; + result = new QueryFilterByOrderId(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override QueryFilterByOrderId MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.QueryFilterByOrderId.Descriptor; } + } + + public override QueryFilterByOrderId DefaultInstanceForType { + get { return global::bnet.protocol.exchange.QueryFilterByOrderId.DefaultInstance; } + } + + public override QueryFilterByOrderId BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is QueryFilterByOrderId) { + return MergeFrom((QueryFilterByOrderId) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(QueryFilterByOrderId other) { + if (other == global::bnet.protocol.exchange.QueryFilterByOrderId.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasMaxResult) { + MaxResult = other.MaxResult; + } + if (other.HasRefOrderId) { + RefOrderId = other.RefOrderId; + } + if (other.HasRefPrice) { + RefPrice = other.RefPrice; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_queryFilterByOrderIdFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _queryFilterByOrderIdFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasMaxResult = input.ReadUInt32(ref result.maxResult_); + break; + } + case 16: { + result.hasRefOrderId = input.ReadUInt64(ref result.refOrderId_); + break; + } + case 24: { + result.hasRefPrice = input.ReadUInt64(ref result.refPrice_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasMaxResult { + get { return result.hasMaxResult; } + } + public uint MaxResult { + get { return result.MaxResult; } + set { SetMaxResult(value); } + } + public Builder SetMaxResult(uint value) { + PrepareBuilder(); + result.hasMaxResult = true; + result.maxResult_ = value; + return this; + } + public Builder ClearMaxResult() { + PrepareBuilder(); + result.hasMaxResult = false; + result.maxResult_ = 0; + return this; + } + + public bool HasRefOrderId { + get { return result.hasRefOrderId; } + } + public ulong RefOrderId { + get { return result.RefOrderId; } + set { SetRefOrderId(value); } + } + public Builder SetRefOrderId(ulong value) { + PrepareBuilder(); + result.hasRefOrderId = true; + result.refOrderId_ = value; + return this; + } + public Builder ClearRefOrderId() { + PrepareBuilder(); + result.hasRefOrderId = false; + result.refOrderId_ = 0UL; + return this; + } + + public bool HasRefPrice { + get { return result.hasRefPrice; } + } + public ulong RefPrice { + get { return result.RefPrice; } + set { SetRefPrice(value); } + } + public Builder SetRefPrice(ulong value) { + PrepareBuilder(); + result.hasRefPrice = true; + result.refPrice_ = value; + return this; + } + public Builder ClearRefPrice() { + PrepareBuilder(); + result.hasRefPrice = false; + result.refPrice_ = 0UL; + return this; + } + } + static QueryFilterByOrderId() { + object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class QueryFilterByCreatedTime : pb::GeneratedMessage { + private QueryFilterByCreatedTime() { } + private static readonly QueryFilterByCreatedTime defaultInstance = new QueryFilterByCreatedTime().MakeReadOnly(); + private static readonly string[] _queryFilterByCreatedTimeFieldNames = new string[] { "currency", "max_result", "ref_created_time" }; + private static readonly uint[] _queryFilterByCreatedTimeFieldTags = new uint[] { 26, 8, 16 }; + public static QueryFilterByCreatedTime DefaultInstance { + get { return defaultInstance; } + } + + public override QueryFilterByCreatedTime DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override QueryFilterByCreatedTime ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_QueryFilterByCreatedTime__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_QueryFilterByCreatedTime__FieldAccessorTable; } + } + + public const int MaxResultFieldNumber = 1; + private bool hasMaxResult; + private uint maxResult_; + public bool HasMaxResult { + get { return hasMaxResult; } + } + public uint MaxResult { + get { return maxResult_; } + } + + public const int RefCreatedTimeFieldNumber = 2; + private bool hasRefCreatedTime; + private ulong refCreatedTime_; + public bool HasRefCreatedTime { + get { return hasRefCreatedTime; } + } + public ulong RefCreatedTime { + get { return refCreatedTime_; } + } + + public const int CurrencyFieldNumber = 3; + private bool hasCurrency; + private string currency_ = ""; + public bool HasCurrency { + get { return hasCurrency; } + } + public string Currency { + get { return currency_; } + } + + public override bool IsInitialized { + get { + if (!hasMaxResult) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _queryFilterByCreatedTimeFieldNames; + if (hasMaxResult) { + output.WriteUInt32(1, field_names[1], MaxResult); + } + if (hasRefCreatedTime) { + output.WriteUInt64(2, field_names[2], RefCreatedTime); + } + if (hasCurrency) { + output.WriteString(3, field_names[0], Currency); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasMaxResult) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, MaxResult); + } + if (hasRefCreatedTime) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, RefCreatedTime); + } + if (hasCurrency) { + size += pb::CodedOutputStream.ComputeStringSize(3, Currency); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static QueryFilterByCreatedTime ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static QueryFilterByCreatedTime ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static QueryFilterByCreatedTime ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static QueryFilterByCreatedTime ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static QueryFilterByCreatedTime ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static QueryFilterByCreatedTime ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static QueryFilterByCreatedTime ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static QueryFilterByCreatedTime ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static QueryFilterByCreatedTime ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static QueryFilterByCreatedTime ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private QueryFilterByCreatedTime MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(QueryFilterByCreatedTime prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(QueryFilterByCreatedTime cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private QueryFilterByCreatedTime result; + + private QueryFilterByCreatedTime PrepareBuilder() { + if (resultIsReadOnly) { + QueryFilterByCreatedTime original = result; + result = new QueryFilterByCreatedTime(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override QueryFilterByCreatedTime MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.QueryFilterByCreatedTime.Descriptor; } + } + + public override QueryFilterByCreatedTime DefaultInstanceForType { + get { return global::bnet.protocol.exchange.QueryFilterByCreatedTime.DefaultInstance; } + } + + public override QueryFilterByCreatedTime BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is QueryFilterByCreatedTime) { + return MergeFrom((QueryFilterByCreatedTime) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(QueryFilterByCreatedTime other) { + if (other == global::bnet.protocol.exchange.QueryFilterByCreatedTime.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasMaxResult) { + MaxResult = other.MaxResult; + } + if (other.HasRefCreatedTime) { + RefCreatedTime = other.RefCreatedTime; + } + if (other.HasCurrency) { + Currency = other.Currency; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_queryFilterByCreatedTimeFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _queryFilterByCreatedTimeFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasMaxResult = input.ReadUInt32(ref result.maxResult_); + break; + } + case 16: { + result.hasRefCreatedTime = input.ReadUInt64(ref result.refCreatedTime_); + break; + } + case 26: { + result.hasCurrency = input.ReadString(ref result.currency_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasMaxResult { + get { return result.hasMaxResult; } + } + public uint MaxResult { + get { return result.MaxResult; } + set { SetMaxResult(value); } + } + public Builder SetMaxResult(uint value) { + PrepareBuilder(); + result.hasMaxResult = true; + result.maxResult_ = value; + return this; + } + public Builder ClearMaxResult() { + PrepareBuilder(); + result.hasMaxResult = false; + result.maxResult_ = 0; + return this; + } + + public bool HasRefCreatedTime { + get { return result.hasRefCreatedTime; } + } + public ulong RefCreatedTime { + get { return result.RefCreatedTime; } + set { SetRefCreatedTime(value); } + } + public Builder SetRefCreatedTime(ulong value) { + PrepareBuilder(); + result.hasRefCreatedTime = true; + result.refCreatedTime_ = value; + return this; + } + public Builder ClearRefCreatedTime() { + PrepareBuilder(); + result.hasRefCreatedTime = false; + result.refCreatedTime_ = 0UL; + return this; + } + + public bool HasCurrency { + get { return result.hasCurrency; } + } + public string Currency { + get { return result.Currency; } + set { SetCurrency(value); } + } + public Builder SetCurrency(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasCurrency = true; + result.currency_ = value; + return this; + } + public Builder ClearCurrency() { + PrepareBuilder(); + result.hasCurrency = false; + result.currency_ = ""; + return this; + } + } + static QueryFilterByCreatedTime() { + object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class QueryOrderFilter : pb::GeneratedMessage { + private QueryOrderFilter() { } + private static readonly QueryOrderFilter defaultInstance = new QueryOrderFilter().MakeReadOnly(); + private static readonly string[] _queryOrderFilterFieldNames = new string[] { "claimable", "currency", "order_book_status", "order_status_mask", "order_type", "rollup", "specialist", "time_filter" }; + private static readonly uint[] _queryOrderFilterFieldTags = new uint[] { 32, 10, 64, 40, 24, 48, 16, 58 }; + public static QueryOrderFilter DefaultInstance { + get { return defaultInstance; } + } + + public override QueryOrderFilter DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override QueryOrderFilter ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_QueryOrderFilter__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_QueryOrderFilter__FieldAccessorTable; } + } + + public const int CurrencyFieldNumber = 1; + private bool hasCurrency; + private string currency_ = ""; + public bool HasCurrency { + get { return hasCurrency; } + } + public string Currency { + get { return currency_; } + } + + public const int SpecialistFieldNumber = 2; + private bool hasSpecialist; + private uint specialist_; + public bool HasSpecialist { + get { return hasSpecialist; } + } + public uint Specialist { + get { return specialist_; } + } + + public const int OrderTypeFieldNumber = 3; + private bool hasOrderType; + private uint orderType_; + public bool HasOrderType { + get { return hasOrderType; } + } + public uint OrderType { + get { return orderType_; } + } + + public const int ClaimableFieldNumber = 4; + private bool hasClaimable; + private uint claimable_; + public bool HasClaimable { + get { return hasClaimable; } + } + public uint Claimable { + get { return claimable_; } + } + + public const int OrderStatusMaskFieldNumber = 5; + private bool hasOrderStatusMask; + private uint orderStatusMask_; + public bool HasOrderStatusMask { + get { return hasOrderStatusMask; } + } + public uint OrderStatusMask { + get { return orderStatusMask_; } + } + + public const int RollupFieldNumber = 6; + private bool hasRollup; + private bool rollup_; + public bool HasRollup { + get { return hasRollup; } + } + public bool Rollup { + get { return rollup_; } + } + + public const int TimeFilterFieldNumber = 7; + private bool hasTimeFilter; + private global::bnet.protocol.exchange.QueryFilterByCreatedTime timeFilter_; + public bool HasTimeFilter { + get { return hasTimeFilter; } + } + public global::bnet.protocol.exchange.QueryFilterByCreatedTime TimeFilter { + get { return timeFilter_ ?? global::bnet.protocol.exchange.QueryFilterByCreatedTime.DefaultInstance; } + } + + public const int OrderBookStatusFieldNumber = 8; + private bool hasOrderBookStatus; + private uint orderBookStatus_; + public bool HasOrderBookStatus { + get { return hasOrderBookStatus; } + } + public uint OrderBookStatus { + get { return orderBookStatus_; } + } + + public override bool IsInitialized { + get { + if (!hasTimeFilter) return false; + if (!TimeFilter.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _queryOrderFilterFieldNames; + if (hasCurrency) { + output.WriteString(1, field_names[1], Currency); + } + if (hasSpecialist) { + output.WriteUInt32(2, field_names[6], Specialist); + } + if (hasOrderType) { + output.WriteUInt32(3, field_names[4], OrderType); + } + if (hasClaimable) { + output.WriteUInt32(4, field_names[0], Claimable); + } + if (hasOrderStatusMask) { + output.WriteUInt32(5, field_names[3], OrderStatusMask); + } + if (hasRollup) { + output.WriteBool(6, field_names[5], Rollup); + } + if (hasTimeFilter) { + output.WriteMessage(7, field_names[7], TimeFilter); + } + if (hasOrderBookStatus) { + output.WriteUInt32(8, field_names[2], OrderBookStatus); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasCurrency) { + size += pb::CodedOutputStream.ComputeStringSize(1, Currency); + } + if (hasSpecialist) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, Specialist); + } + if (hasOrderType) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, OrderType); + } + if (hasClaimable) { + size += pb::CodedOutputStream.ComputeUInt32Size(4, Claimable); + } + if (hasOrderStatusMask) { + size += pb::CodedOutputStream.ComputeUInt32Size(5, OrderStatusMask); + } + if (hasRollup) { + size += pb::CodedOutputStream.ComputeBoolSize(6, Rollup); + } + if (hasTimeFilter) { + size += pb::CodedOutputStream.ComputeMessageSize(7, TimeFilter); + } + if (hasOrderBookStatus) { + size += pb::CodedOutputStream.ComputeUInt32Size(8, OrderBookStatus); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static QueryOrderFilter ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static QueryOrderFilter ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static QueryOrderFilter ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static QueryOrderFilter ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static QueryOrderFilter ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static QueryOrderFilter ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static QueryOrderFilter ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static QueryOrderFilter ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static QueryOrderFilter ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static QueryOrderFilter ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private QueryOrderFilter MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(QueryOrderFilter prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(QueryOrderFilter cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private QueryOrderFilter result; + + private QueryOrderFilter PrepareBuilder() { + if (resultIsReadOnly) { + QueryOrderFilter original = result; + result = new QueryOrderFilter(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override QueryOrderFilter MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.QueryOrderFilter.Descriptor; } + } + + public override QueryOrderFilter DefaultInstanceForType { + get { return global::bnet.protocol.exchange.QueryOrderFilter.DefaultInstance; } + } + + public override QueryOrderFilter BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is QueryOrderFilter) { + return MergeFrom((QueryOrderFilter) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(QueryOrderFilter other) { + if (other == global::bnet.protocol.exchange.QueryOrderFilter.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasCurrency) { + Currency = other.Currency; + } + if (other.HasSpecialist) { + Specialist = other.Specialist; + } + if (other.HasOrderType) { + OrderType = other.OrderType; + } + if (other.HasClaimable) { + Claimable = other.Claimable; + } + if (other.HasOrderStatusMask) { + OrderStatusMask = other.OrderStatusMask; + } + if (other.HasRollup) { + Rollup = other.Rollup; + } + if (other.HasTimeFilter) { + MergeTimeFilter(other.TimeFilter); + } + if (other.HasOrderBookStatus) { + OrderBookStatus = other.OrderBookStatus; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_queryOrderFilterFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _queryOrderFilterFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasCurrency = input.ReadString(ref result.currency_); + break; + } + case 16: { + result.hasSpecialist = input.ReadUInt32(ref result.specialist_); + break; + } + case 24: { + result.hasOrderType = input.ReadUInt32(ref result.orderType_); + break; + } + case 32: { + result.hasClaimable = input.ReadUInt32(ref result.claimable_); + break; + } + case 40: { + result.hasOrderStatusMask = input.ReadUInt32(ref result.orderStatusMask_); + break; + } + case 48: { + result.hasRollup = input.ReadBool(ref result.rollup_); + break; + } + case 58: { + global::bnet.protocol.exchange.QueryFilterByCreatedTime.Builder subBuilder = global::bnet.protocol.exchange.QueryFilterByCreatedTime.CreateBuilder(); + if (result.hasTimeFilter) { + subBuilder.MergeFrom(TimeFilter); + } + input.ReadMessage(subBuilder, extensionRegistry); + TimeFilter = subBuilder.BuildPartial(); + break; + } + case 64: { + result.hasOrderBookStatus = input.ReadUInt32(ref result.orderBookStatus_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasCurrency { + get { return result.hasCurrency; } + } + public string Currency { + get { return result.Currency; } + set { SetCurrency(value); } + } + public Builder SetCurrency(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasCurrency = true; + result.currency_ = value; + return this; + } + public Builder ClearCurrency() { + PrepareBuilder(); + result.hasCurrency = false; + result.currency_ = ""; + return this; + } + + public bool HasSpecialist { + get { return result.hasSpecialist; } + } + public uint Specialist { + get { return result.Specialist; } + set { SetSpecialist(value); } + } + public Builder SetSpecialist(uint value) { + PrepareBuilder(); + result.hasSpecialist = true; + result.specialist_ = value; + return this; + } + public Builder ClearSpecialist() { + PrepareBuilder(); + result.hasSpecialist = false; + result.specialist_ = 0; + return this; + } + + public bool HasOrderType { + get { return result.hasOrderType; } + } + public uint OrderType { + get { return result.OrderType; } + set { SetOrderType(value); } + } + public Builder SetOrderType(uint value) { + PrepareBuilder(); + result.hasOrderType = true; + result.orderType_ = value; + return this; + } + public Builder ClearOrderType() { + PrepareBuilder(); + result.hasOrderType = false; + result.orderType_ = 0; + return this; + } + + public bool HasClaimable { + get { return result.hasClaimable; } + } + public uint Claimable { + get { return result.Claimable; } + set { SetClaimable(value); } + } + public Builder SetClaimable(uint value) { + PrepareBuilder(); + result.hasClaimable = true; + result.claimable_ = value; + return this; + } + public Builder ClearClaimable() { + PrepareBuilder(); + result.hasClaimable = false; + result.claimable_ = 0; + return this; + } + + public bool HasOrderStatusMask { + get { return result.hasOrderStatusMask; } + } + public uint OrderStatusMask { + get { return result.OrderStatusMask; } + set { SetOrderStatusMask(value); } + } + public Builder SetOrderStatusMask(uint value) { + PrepareBuilder(); + result.hasOrderStatusMask = true; + result.orderStatusMask_ = value; + return this; + } + public Builder ClearOrderStatusMask() { + PrepareBuilder(); + result.hasOrderStatusMask = false; + result.orderStatusMask_ = 0; + return this; + } + + public bool HasRollup { + get { return result.hasRollup; } + } + public bool Rollup { + get { return result.Rollup; } + set { SetRollup(value); } + } + public Builder SetRollup(bool value) { + PrepareBuilder(); + result.hasRollup = true; + result.rollup_ = value; + return this; + } + public Builder ClearRollup() { + PrepareBuilder(); + result.hasRollup = false; + result.rollup_ = false; + return this; + } + + public bool HasTimeFilter { + get { return result.hasTimeFilter; } + } + public global::bnet.protocol.exchange.QueryFilterByCreatedTime TimeFilter { + get { return result.TimeFilter; } + set { SetTimeFilter(value); } + } + public Builder SetTimeFilter(global::bnet.protocol.exchange.QueryFilterByCreatedTime value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTimeFilter = true; + result.timeFilter_ = value; + return this; + } + public Builder SetTimeFilter(global::bnet.protocol.exchange.QueryFilterByCreatedTime.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasTimeFilter = true; + result.timeFilter_ = builderForValue.Build(); + return this; + } + public Builder MergeTimeFilter(global::bnet.protocol.exchange.QueryFilterByCreatedTime value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasTimeFilter && + result.timeFilter_ != global::bnet.protocol.exchange.QueryFilterByCreatedTime.DefaultInstance) { + result.timeFilter_ = global::bnet.protocol.exchange.QueryFilterByCreatedTime.CreateBuilder(result.timeFilter_).MergeFrom(value).BuildPartial(); + } else { + result.timeFilter_ = value; + } + result.hasTimeFilter = true; + return this; + } + public Builder ClearTimeFilter() { + PrepareBuilder(); + result.hasTimeFilter = false; + result.timeFilter_ = null; + return this; + } + + public bool HasOrderBookStatus { + get { return result.hasOrderBookStatus; } + } + public uint OrderBookStatus { + get { return result.OrderBookStatus; } + set { SetOrderBookStatus(value); } + } + public Builder SetOrderBookStatus(uint value) { + PrepareBuilder(); + result.hasOrderBookStatus = true; + result.orderBookStatus_ = value; + return this; + } + public Builder ClearOrderBookStatus() { + PrepareBuilder(); + result.hasOrderBookStatus = false; + result.orderBookStatus_ = 0; + return this; + } + } + static QueryOrderFilter() { + object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class CurrencyConfig : pb::GeneratedMessage { + private CurrencyConfig() { } + private static readonly CurrencyConfig defaultInstance = new CurrencyConfig().MakeReadOnly(); + private static readonly string[] _currencyConfigFieldNames = new string[] { "currency", "max_total_price", "max_unit_price", "min_total_price", "min_unit_price", "tick_size" }; + private static readonly uint[] _currencyConfigFieldTags = new uint[] { 10, 48, 32, 40, 24, 16 }; + public static CurrencyConfig DefaultInstance { + get { return defaultInstance; } + } + + public override CurrencyConfig DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override CurrencyConfig ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_CurrencyConfig__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_CurrencyConfig__FieldAccessorTable; } + } + + public const int CurrencyFieldNumber = 1; + private bool hasCurrency; + private string currency_ = ""; + public bool HasCurrency { + get { return hasCurrency; } + } + public string Currency { + get { return currency_; } + } + + public const int TickSizeFieldNumber = 2; + private bool hasTickSize; + private ulong tickSize_; + public bool HasTickSize { + get { return hasTickSize; } + } + public ulong TickSize { + get { return tickSize_; } + } + + public const int MinUnitPriceFieldNumber = 3; + private bool hasMinUnitPrice; + private ulong minUnitPrice_; + public bool HasMinUnitPrice { + get { return hasMinUnitPrice; } + } + public ulong MinUnitPrice { + get { return minUnitPrice_; } + } + + public const int MaxUnitPriceFieldNumber = 4; + private bool hasMaxUnitPrice; + private ulong maxUnitPrice_; + public bool HasMaxUnitPrice { + get { return hasMaxUnitPrice; } + } + public ulong MaxUnitPrice { + get { return maxUnitPrice_; } + } + + public const int MinTotalPriceFieldNumber = 5; + private bool hasMinTotalPrice; + private ulong minTotalPrice_; + public bool HasMinTotalPrice { + get { return hasMinTotalPrice; } + } + public ulong MinTotalPrice { + get { return minTotalPrice_; } + } + + public const int MaxTotalPriceFieldNumber = 6; + private bool hasMaxTotalPrice; + private ulong maxTotalPrice_; + public bool HasMaxTotalPrice { + get { return hasMaxTotalPrice; } + } + public ulong MaxTotalPrice { + get { return maxTotalPrice_; } + } + + public override bool IsInitialized { + get { + if (!hasCurrency) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _currencyConfigFieldNames; + if (hasCurrency) { + output.WriteString(1, field_names[0], Currency); + } + if (hasTickSize) { + output.WriteUInt64(2, field_names[5], TickSize); + } + if (hasMinUnitPrice) { + output.WriteUInt64(3, field_names[4], MinUnitPrice); + } + if (hasMaxUnitPrice) { + output.WriteUInt64(4, field_names[2], MaxUnitPrice); + } + if (hasMinTotalPrice) { + output.WriteUInt64(5, field_names[3], MinTotalPrice); + } + if (hasMaxTotalPrice) { + output.WriteUInt64(6, field_names[1], MaxTotalPrice); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasCurrency) { + size += pb::CodedOutputStream.ComputeStringSize(1, Currency); + } + if (hasTickSize) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, TickSize); + } + if (hasMinUnitPrice) { + size += pb::CodedOutputStream.ComputeUInt64Size(3, MinUnitPrice); + } + if (hasMaxUnitPrice) { + size += pb::CodedOutputStream.ComputeUInt64Size(4, MaxUnitPrice); + } + if (hasMinTotalPrice) { + size += pb::CodedOutputStream.ComputeUInt64Size(5, MinTotalPrice); + } + if (hasMaxTotalPrice) { + size += pb::CodedOutputStream.ComputeUInt64Size(6, MaxTotalPrice); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static CurrencyConfig ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CurrencyConfig ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CurrencyConfig ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CurrencyConfig ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CurrencyConfig ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CurrencyConfig ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static CurrencyConfig ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static CurrencyConfig ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static CurrencyConfig ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CurrencyConfig ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CurrencyConfig MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(CurrencyConfig prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CurrencyConfig cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CurrencyConfig result; + + private CurrencyConfig PrepareBuilder() { + if (resultIsReadOnly) { + CurrencyConfig original = result; + result = new CurrencyConfig(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CurrencyConfig MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.CurrencyConfig.Descriptor; } + } + + public override CurrencyConfig DefaultInstanceForType { + get { return global::bnet.protocol.exchange.CurrencyConfig.DefaultInstance; } + } + + public override CurrencyConfig BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is CurrencyConfig) { + return MergeFrom((CurrencyConfig) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(CurrencyConfig other) { + if (other == global::bnet.protocol.exchange.CurrencyConfig.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasCurrency) { + Currency = other.Currency; + } + if (other.HasTickSize) { + TickSize = other.TickSize; + } + if (other.HasMinUnitPrice) { + MinUnitPrice = other.MinUnitPrice; + } + if (other.HasMaxUnitPrice) { + MaxUnitPrice = other.MaxUnitPrice; + } + if (other.HasMinTotalPrice) { + MinTotalPrice = other.MinTotalPrice; + } + if (other.HasMaxTotalPrice) { + MaxTotalPrice = other.MaxTotalPrice; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_currencyConfigFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _currencyConfigFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasCurrency = input.ReadString(ref result.currency_); + break; + } + case 16: { + result.hasTickSize = input.ReadUInt64(ref result.tickSize_); + break; + } + case 24: { + result.hasMinUnitPrice = input.ReadUInt64(ref result.minUnitPrice_); + break; + } + case 32: { + result.hasMaxUnitPrice = input.ReadUInt64(ref result.maxUnitPrice_); + break; + } + case 40: { + result.hasMinTotalPrice = input.ReadUInt64(ref result.minTotalPrice_); + break; + } + case 48: { + result.hasMaxTotalPrice = input.ReadUInt64(ref result.maxTotalPrice_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasCurrency { + get { return result.hasCurrency; } + } + public string Currency { + get { return result.Currency; } + set { SetCurrency(value); } + } + public Builder SetCurrency(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasCurrency = true; + result.currency_ = value; + return this; + } + public Builder ClearCurrency() { + PrepareBuilder(); + result.hasCurrency = false; + result.currency_ = ""; + return this; + } + + public bool HasTickSize { + get { return result.hasTickSize; } + } + public ulong TickSize { + get { return result.TickSize; } + set { SetTickSize(value); } + } + public Builder SetTickSize(ulong value) { + PrepareBuilder(); + result.hasTickSize = true; + result.tickSize_ = value; + return this; + } + public Builder ClearTickSize() { + PrepareBuilder(); + result.hasTickSize = false; + result.tickSize_ = 0UL; + return this; + } + + public bool HasMinUnitPrice { + get { return result.hasMinUnitPrice; } + } + public ulong MinUnitPrice { + get { return result.MinUnitPrice; } + set { SetMinUnitPrice(value); } + } + public Builder SetMinUnitPrice(ulong value) { + PrepareBuilder(); + result.hasMinUnitPrice = true; + result.minUnitPrice_ = value; + return this; + } + public Builder ClearMinUnitPrice() { + PrepareBuilder(); + result.hasMinUnitPrice = false; + result.minUnitPrice_ = 0UL; + return this; + } + + public bool HasMaxUnitPrice { + get { return result.hasMaxUnitPrice; } + } + public ulong MaxUnitPrice { + get { return result.MaxUnitPrice; } + set { SetMaxUnitPrice(value); } + } + public Builder SetMaxUnitPrice(ulong value) { + PrepareBuilder(); + result.hasMaxUnitPrice = true; + result.maxUnitPrice_ = value; + return this; + } + public Builder ClearMaxUnitPrice() { + PrepareBuilder(); + result.hasMaxUnitPrice = false; + result.maxUnitPrice_ = 0UL; + return this; + } + + public bool HasMinTotalPrice { + get { return result.hasMinTotalPrice; } + } + public ulong MinTotalPrice { + get { return result.MinTotalPrice; } + set { SetMinTotalPrice(value); } + } + public Builder SetMinTotalPrice(ulong value) { + PrepareBuilder(); + result.hasMinTotalPrice = true; + result.minTotalPrice_ = value; + return this; + } + public Builder ClearMinTotalPrice() { + PrepareBuilder(); + result.hasMinTotalPrice = false; + result.minTotalPrice_ = 0UL; + return this; + } + + public bool HasMaxTotalPrice { + get { return result.hasMaxTotalPrice; } + } + public ulong MaxTotalPrice { + get { return result.MaxTotalPrice; } + set { SetMaxTotalPrice(value); } + } + public Builder SetMaxTotalPrice(ulong value) { + PrepareBuilder(); + result.hasMaxTotalPrice = true; + result.maxTotalPrice_ = value; + return this; + } + public Builder ClearMaxTotalPrice() { + PrepareBuilder(); + result.hasMaxTotalPrice = false; + result.maxTotalPrice_ = 0UL; + return this; + } + } + static CurrencyConfig() { + object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class SpecialistConfig : pb::GeneratedMessage { + private SpecialistConfig() { } + private static readonly SpecialistConfig defaultInstance = new SpecialistConfig().MakeReadOnly(); + private static readonly string[] _specialistConfigFieldNames = new string[] { "anti_sniping_extension_delay", "auction_durations", "auction_start_delays", "currency_config", "current_unit_price_rule", "fill_or_kill_rule", "max_items_amount", "maximum_unit_price_rule", "reserved_unit_price_rule", "specialist", "starting_unit_price_rule", "trade_now_unit_price_rule" }; + private static readonly uint[] _specialistConfigFieldTags = new uint[] { 32, 18, 26, 90, 72, 96, 40, 80, 56, 8, 48, 64 }; + public static SpecialistConfig DefaultInstance { + get { return defaultInstance; } + } + + public override SpecialistConfig DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SpecialistConfig ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_SpecialistConfig__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_SpecialistConfig__FieldAccessorTable; } + } + + public const int SpecialistFieldNumber = 1; + private bool hasSpecialist; + private int specialist_; + public bool HasSpecialist { + get { return hasSpecialist; } + } + public int Specialist { + get { return specialist_; } + } + + public const int AuctionDurationsFieldNumber = 2; + private int auctionDurationsMemoizedSerializedSize; + private pbc::PopsicleList auctionDurations_ = new pbc::PopsicleList(); + public scg::IList AuctionDurationsList { + get { return pbc::Lists.AsReadOnly(auctionDurations_); } + } + public int AuctionDurationsCount { + get { return auctionDurations_.Count; } + } + public ulong GetAuctionDurations(int index) { + return auctionDurations_[index]; + } + + public const int AuctionStartDelaysFieldNumber = 3; + private int auctionStartDelaysMemoizedSerializedSize; + private pbc::PopsicleList auctionStartDelays_ = new pbc::PopsicleList(); + public scg::IList AuctionStartDelaysList { + get { return pbc::Lists.AsReadOnly(auctionStartDelays_); } + } + public int AuctionStartDelaysCount { + get { return auctionStartDelays_.Count; } + } + public ulong GetAuctionStartDelays(int index) { + return auctionStartDelays_[index]; + } + + public const int AntiSnipingExtensionDelayFieldNumber = 4; + private bool hasAntiSnipingExtensionDelay; + private ulong antiSnipingExtensionDelay_; + public bool HasAntiSnipingExtensionDelay { + get { return hasAntiSnipingExtensionDelay; } + } + public ulong AntiSnipingExtensionDelay { + get { return antiSnipingExtensionDelay_; } + } + + public const int MaxItemsAmountFieldNumber = 5; + private bool hasMaxItemsAmount; + private ulong maxItemsAmount_; + public bool HasMaxItemsAmount { + get { return hasMaxItemsAmount; } + } + public ulong MaxItemsAmount { + get { return maxItemsAmount_; } + } + + public const int StartingUnitPriceRuleFieldNumber = 6; + private bool hasStartingUnitPriceRule; + private int startingUnitPriceRule_; + public bool HasStartingUnitPriceRule { + get { return hasStartingUnitPriceRule; } + } + public int StartingUnitPriceRule { + get { return startingUnitPriceRule_; } + } + + public const int ReservedUnitPriceRuleFieldNumber = 7; + private bool hasReservedUnitPriceRule; + private int reservedUnitPriceRule_; + public bool HasReservedUnitPriceRule { + get { return hasReservedUnitPriceRule; } + } + public int ReservedUnitPriceRule { + get { return reservedUnitPriceRule_; } + } + + public const int TradeNowUnitPriceRuleFieldNumber = 8; + private bool hasTradeNowUnitPriceRule; + private int tradeNowUnitPriceRule_; + public bool HasTradeNowUnitPriceRule { + get { return hasTradeNowUnitPriceRule; } + } + public int TradeNowUnitPriceRule { + get { return tradeNowUnitPriceRule_; } + } + + public const int CurrentUnitPriceRuleFieldNumber = 9; + private bool hasCurrentUnitPriceRule; + private int currentUnitPriceRule_; + public bool HasCurrentUnitPriceRule { + get { return hasCurrentUnitPriceRule; } + } + public int CurrentUnitPriceRule { + get { return currentUnitPriceRule_; } + } + + public const int MaximumUnitPriceRuleFieldNumber = 10; + private bool hasMaximumUnitPriceRule; + private int maximumUnitPriceRule_; + public bool HasMaximumUnitPriceRule { + get { return hasMaximumUnitPriceRule; } + } + public int MaximumUnitPriceRule { + get { return maximumUnitPriceRule_; } + } + + public const int CurrencyConfigFieldNumber = 11; + private pbc::PopsicleList currencyConfig_ = new pbc::PopsicleList(); + public scg::IList CurrencyConfigList { + get { return currencyConfig_; } + } + public int CurrencyConfigCount { + get { return currencyConfig_.Count; } + } + public global::bnet.protocol.exchange.CurrencyConfig GetCurrencyConfig(int index) { + return currencyConfig_[index]; + } + + public const int FillOrKillRuleFieldNumber = 12; + private bool hasFillOrKillRule; + private int fillOrKillRule_; + public bool HasFillOrKillRule { + get { return hasFillOrKillRule; } + } + public int FillOrKillRule { + get { return fillOrKillRule_; } + } + + public override bool IsInitialized { + get { + if (!hasSpecialist) return false; + foreach (global::bnet.protocol.exchange.CurrencyConfig element in CurrencyConfigList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _specialistConfigFieldNames; + if (hasSpecialist) { + output.WriteInt32(1, field_names[9], Specialist); + } + if (auctionDurations_.Count > 0) { + output.WritePackedUInt64Array(2, field_names[1], auctionDurationsMemoizedSerializedSize, auctionDurations_); + } + if (auctionStartDelays_.Count > 0) { + output.WritePackedUInt64Array(3, field_names[2], auctionStartDelaysMemoizedSerializedSize, auctionStartDelays_); + } + if (hasAntiSnipingExtensionDelay) { + output.WriteUInt64(4, field_names[0], AntiSnipingExtensionDelay); + } + if (hasMaxItemsAmount) { + output.WriteUInt64(5, field_names[6], MaxItemsAmount); + } + if (hasStartingUnitPriceRule) { + output.WriteInt32(6, field_names[10], StartingUnitPriceRule); + } + if (hasReservedUnitPriceRule) { + output.WriteInt32(7, field_names[8], ReservedUnitPriceRule); + } + if (hasTradeNowUnitPriceRule) { + output.WriteInt32(8, field_names[11], TradeNowUnitPriceRule); + } + if (hasCurrentUnitPriceRule) { + output.WriteInt32(9, field_names[4], CurrentUnitPriceRule); + } + if (hasMaximumUnitPriceRule) { + output.WriteInt32(10, field_names[7], MaximumUnitPriceRule); + } + if (currencyConfig_.Count > 0) { + output.WriteMessageArray(11, field_names[3], currencyConfig_); + } + if (hasFillOrKillRule) { + output.WriteInt32(12, field_names[5], FillOrKillRule); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasSpecialist) { + size += pb::CodedOutputStream.ComputeInt32Size(1, Specialist); + } + { + int dataSize = 0; + foreach (ulong element in AuctionDurationsList) { + dataSize += pb::CodedOutputStream.ComputeUInt64SizeNoTag(element); + } + size += dataSize; + if (auctionDurations_.Count != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); + } + auctionDurationsMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + foreach (ulong element in AuctionStartDelaysList) { + dataSize += pb::CodedOutputStream.ComputeUInt64SizeNoTag(element); + } + size += dataSize; + if (auctionStartDelays_.Count != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); + } + auctionStartDelaysMemoizedSerializedSize = dataSize; + } + if (hasAntiSnipingExtensionDelay) { + size += pb::CodedOutputStream.ComputeUInt64Size(4, AntiSnipingExtensionDelay); + } + if (hasMaxItemsAmount) { + size += pb::CodedOutputStream.ComputeUInt64Size(5, MaxItemsAmount); + } + if (hasStartingUnitPriceRule) { + size += pb::CodedOutputStream.ComputeInt32Size(6, StartingUnitPriceRule); + } + if (hasReservedUnitPriceRule) { + size += pb::CodedOutputStream.ComputeInt32Size(7, ReservedUnitPriceRule); + } + if (hasTradeNowUnitPriceRule) { + size += pb::CodedOutputStream.ComputeInt32Size(8, TradeNowUnitPriceRule); + } + if (hasCurrentUnitPriceRule) { + size += pb::CodedOutputStream.ComputeInt32Size(9, CurrentUnitPriceRule); + } + if (hasMaximumUnitPriceRule) { + size += pb::CodedOutputStream.ComputeInt32Size(10, MaximumUnitPriceRule); + } + foreach (global::bnet.protocol.exchange.CurrencyConfig element in CurrencyConfigList) { + size += pb::CodedOutputStream.ComputeMessageSize(11, element); + } + if (hasFillOrKillRule) { + size += pb::CodedOutputStream.ComputeInt32Size(12, FillOrKillRule); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static SpecialistConfig ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SpecialistConfig ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SpecialistConfig ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SpecialistConfig ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SpecialistConfig ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SpecialistConfig ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SpecialistConfig ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SpecialistConfig ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SpecialistConfig ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SpecialistConfig ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SpecialistConfig MakeReadOnly() { + auctionDurations_.MakeReadOnly(); + auctionStartDelays_.MakeReadOnly(); + currencyConfig_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SpecialistConfig prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SpecialistConfig cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SpecialistConfig result; + + private SpecialistConfig PrepareBuilder() { + if (resultIsReadOnly) { + SpecialistConfig original = result; + result = new SpecialistConfig(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SpecialistConfig MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.SpecialistConfig.Descriptor; } + } + + public override SpecialistConfig DefaultInstanceForType { + get { return global::bnet.protocol.exchange.SpecialistConfig.DefaultInstance; } + } + + public override SpecialistConfig BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SpecialistConfig) { + return MergeFrom((SpecialistConfig) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SpecialistConfig other) { + if (other == global::bnet.protocol.exchange.SpecialistConfig.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasSpecialist) { + Specialist = other.Specialist; + } + if (other.auctionDurations_.Count != 0) { + result.auctionDurations_.Add(other.auctionDurations_); + } + if (other.auctionStartDelays_.Count != 0) { + result.auctionStartDelays_.Add(other.auctionStartDelays_); + } + if (other.HasAntiSnipingExtensionDelay) { + AntiSnipingExtensionDelay = other.AntiSnipingExtensionDelay; + } + if (other.HasMaxItemsAmount) { + MaxItemsAmount = other.MaxItemsAmount; + } + if (other.HasStartingUnitPriceRule) { + StartingUnitPriceRule = other.StartingUnitPriceRule; + } + if (other.HasReservedUnitPriceRule) { + ReservedUnitPriceRule = other.ReservedUnitPriceRule; + } + if (other.HasTradeNowUnitPriceRule) { + TradeNowUnitPriceRule = other.TradeNowUnitPriceRule; + } + if (other.HasCurrentUnitPriceRule) { + CurrentUnitPriceRule = other.CurrentUnitPriceRule; + } + if (other.HasMaximumUnitPriceRule) { + MaximumUnitPriceRule = other.MaximumUnitPriceRule; + } + if (other.currencyConfig_.Count != 0) { + result.currencyConfig_.Add(other.currencyConfig_); + } + if (other.HasFillOrKillRule) { + FillOrKillRule = other.FillOrKillRule; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_specialistConfigFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _specialistConfigFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasSpecialist = input.ReadInt32(ref result.specialist_); + break; + } + case 18: + case 16: { + input.ReadUInt64Array(tag, field_name, result.auctionDurations_); + break; + } + case 26: + case 24: { + input.ReadUInt64Array(tag, field_name, result.auctionStartDelays_); + break; + } + case 32: { + result.hasAntiSnipingExtensionDelay = input.ReadUInt64(ref result.antiSnipingExtensionDelay_); + break; + } + case 40: { + result.hasMaxItemsAmount = input.ReadUInt64(ref result.maxItemsAmount_); + break; + } + case 48: { + result.hasStartingUnitPriceRule = input.ReadInt32(ref result.startingUnitPriceRule_); + break; + } + case 56: { + result.hasReservedUnitPriceRule = input.ReadInt32(ref result.reservedUnitPriceRule_); + break; + } + case 64: { + result.hasTradeNowUnitPriceRule = input.ReadInt32(ref result.tradeNowUnitPriceRule_); + break; + } + case 72: { + result.hasCurrentUnitPriceRule = input.ReadInt32(ref result.currentUnitPriceRule_); + break; + } + case 80: { + result.hasMaximumUnitPriceRule = input.ReadInt32(ref result.maximumUnitPriceRule_); + break; + } + case 90: { + input.ReadMessageArray(tag, field_name, result.currencyConfig_, global::bnet.protocol.exchange.CurrencyConfig.DefaultInstance, extensionRegistry); + break; + } + case 96: { + result.hasFillOrKillRule = input.ReadInt32(ref result.fillOrKillRule_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasSpecialist { + get { return result.hasSpecialist; } + } + public int Specialist { + get { return result.Specialist; } + set { SetSpecialist(value); } + } + public Builder SetSpecialist(int value) { + PrepareBuilder(); + result.hasSpecialist = true; + result.specialist_ = value; + return this; + } + public Builder ClearSpecialist() { + PrepareBuilder(); + result.hasSpecialist = false; + result.specialist_ = 0; + return this; + } + + public pbc::IPopsicleList AuctionDurationsList { + get { return PrepareBuilder().auctionDurations_; } + } + public int AuctionDurationsCount { + get { return result.AuctionDurationsCount; } + } + public ulong GetAuctionDurations(int index) { + return result.GetAuctionDurations(index); + } + public Builder SetAuctionDurations(int index, ulong value) { + PrepareBuilder(); + result.auctionDurations_[index] = value; + return this; + } + public Builder AddAuctionDurations(ulong value) { + PrepareBuilder(); + result.auctionDurations_.Add(value); + return this; + } + public Builder AddRangeAuctionDurations(scg::IEnumerable values) { + PrepareBuilder(); + result.auctionDurations_.Add(values); + return this; + } + public Builder ClearAuctionDurations() { + PrepareBuilder(); + result.auctionDurations_.Clear(); + return this; + } + + public pbc::IPopsicleList AuctionStartDelaysList { + get { return PrepareBuilder().auctionStartDelays_; } + } + public int AuctionStartDelaysCount { + get { return result.AuctionStartDelaysCount; } + } + public ulong GetAuctionStartDelays(int index) { + return result.GetAuctionStartDelays(index); + } + public Builder SetAuctionStartDelays(int index, ulong value) { + PrepareBuilder(); + result.auctionStartDelays_[index] = value; + return this; + } + public Builder AddAuctionStartDelays(ulong value) { + PrepareBuilder(); + result.auctionStartDelays_.Add(value); + return this; + } + public Builder AddRangeAuctionStartDelays(scg::IEnumerable values) { + PrepareBuilder(); + result.auctionStartDelays_.Add(values); + return this; + } + public Builder ClearAuctionStartDelays() { + PrepareBuilder(); + result.auctionStartDelays_.Clear(); + return this; + } + + public bool HasAntiSnipingExtensionDelay { + get { return result.hasAntiSnipingExtensionDelay; } + } + public ulong AntiSnipingExtensionDelay { + get { return result.AntiSnipingExtensionDelay; } + set { SetAntiSnipingExtensionDelay(value); } + } + public Builder SetAntiSnipingExtensionDelay(ulong value) { + PrepareBuilder(); + result.hasAntiSnipingExtensionDelay = true; + result.antiSnipingExtensionDelay_ = value; + return this; + } + public Builder ClearAntiSnipingExtensionDelay() { + PrepareBuilder(); + result.hasAntiSnipingExtensionDelay = false; + result.antiSnipingExtensionDelay_ = 0UL; + return this; + } + + public bool HasMaxItemsAmount { + get { return result.hasMaxItemsAmount; } + } + public ulong MaxItemsAmount { + get { return result.MaxItemsAmount; } + set { SetMaxItemsAmount(value); } + } + public Builder SetMaxItemsAmount(ulong value) { + PrepareBuilder(); + result.hasMaxItemsAmount = true; + result.maxItemsAmount_ = value; + return this; + } + public Builder ClearMaxItemsAmount() { + PrepareBuilder(); + result.hasMaxItemsAmount = false; + result.maxItemsAmount_ = 0UL; + return this; + } + + public bool HasStartingUnitPriceRule { + get { return result.hasStartingUnitPriceRule; } + } + public int StartingUnitPriceRule { + get { return result.StartingUnitPriceRule; } + set { SetStartingUnitPriceRule(value); } + } + public Builder SetStartingUnitPriceRule(int value) { + PrepareBuilder(); + result.hasStartingUnitPriceRule = true; + result.startingUnitPriceRule_ = value; + return this; + } + public Builder ClearStartingUnitPriceRule() { + PrepareBuilder(); + result.hasStartingUnitPriceRule = false; + result.startingUnitPriceRule_ = 0; + return this; + } + + public bool HasReservedUnitPriceRule { + get { return result.hasReservedUnitPriceRule; } + } + public int ReservedUnitPriceRule { + get { return result.ReservedUnitPriceRule; } + set { SetReservedUnitPriceRule(value); } + } + public Builder SetReservedUnitPriceRule(int value) { + PrepareBuilder(); + result.hasReservedUnitPriceRule = true; + result.reservedUnitPriceRule_ = value; + return this; + } + public Builder ClearReservedUnitPriceRule() { + PrepareBuilder(); + result.hasReservedUnitPriceRule = false; + result.reservedUnitPriceRule_ = 0; + return this; + } + + public bool HasTradeNowUnitPriceRule { + get { return result.hasTradeNowUnitPriceRule; } + } + public int TradeNowUnitPriceRule { + get { return result.TradeNowUnitPriceRule; } + set { SetTradeNowUnitPriceRule(value); } + } + public Builder SetTradeNowUnitPriceRule(int value) { + PrepareBuilder(); + result.hasTradeNowUnitPriceRule = true; + result.tradeNowUnitPriceRule_ = value; + return this; + } + public Builder ClearTradeNowUnitPriceRule() { + PrepareBuilder(); + result.hasTradeNowUnitPriceRule = false; + result.tradeNowUnitPriceRule_ = 0; + return this; + } + + public bool HasCurrentUnitPriceRule { + get { return result.hasCurrentUnitPriceRule; } + } + public int CurrentUnitPriceRule { + get { return result.CurrentUnitPriceRule; } + set { SetCurrentUnitPriceRule(value); } + } + public Builder SetCurrentUnitPriceRule(int value) { + PrepareBuilder(); + result.hasCurrentUnitPriceRule = true; + result.currentUnitPriceRule_ = value; + return this; + } + public Builder ClearCurrentUnitPriceRule() { + PrepareBuilder(); + result.hasCurrentUnitPriceRule = false; + result.currentUnitPriceRule_ = 0; + return this; + } + + public bool HasMaximumUnitPriceRule { + get { return result.hasMaximumUnitPriceRule; } + } + public int MaximumUnitPriceRule { + get { return result.MaximumUnitPriceRule; } + set { SetMaximumUnitPriceRule(value); } + } + public Builder SetMaximumUnitPriceRule(int value) { + PrepareBuilder(); + result.hasMaximumUnitPriceRule = true; + result.maximumUnitPriceRule_ = value; + return this; + } + public Builder ClearMaximumUnitPriceRule() { + PrepareBuilder(); + result.hasMaximumUnitPriceRule = false; + result.maximumUnitPriceRule_ = 0; + return this; + } + + public pbc::IPopsicleList CurrencyConfigList { + get { return PrepareBuilder().currencyConfig_; } + } + public int CurrencyConfigCount { + get { return result.CurrencyConfigCount; } + } + public global::bnet.protocol.exchange.CurrencyConfig GetCurrencyConfig(int index) { + return result.GetCurrencyConfig(index); + } + public Builder SetCurrencyConfig(int index, global::bnet.protocol.exchange.CurrencyConfig value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.currencyConfig_[index] = value; + return this; + } + public Builder SetCurrencyConfig(int index, global::bnet.protocol.exchange.CurrencyConfig.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.currencyConfig_[index] = builderForValue.Build(); + return this; + } + public Builder AddCurrencyConfig(global::bnet.protocol.exchange.CurrencyConfig value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.currencyConfig_.Add(value); + return this; + } + public Builder AddCurrencyConfig(global::bnet.protocol.exchange.CurrencyConfig.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.currencyConfig_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeCurrencyConfig(scg::IEnumerable values) { + PrepareBuilder(); + result.currencyConfig_.Add(values); + return this; + } + public Builder ClearCurrencyConfig() { + PrepareBuilder(); + result.currencyConfig_.Clear(); + return this; + } + + public bool HasFillOrKillRule { + get { return result.hasFillOrKillRule; } + } + public int FillOrKillRule { + get { return result.FillOrKillRule; } + set { SetFillOrKillRule(value); } + } + public Builder SetFillOrKillRule(int value) { + PrepareBuilder(); + result.hasFillOrKillRule = true; + result.fillOrKillRule_ = value; + return this; + } + public Builder ClearFillOrKillRule() { + PrepareBuilder(); + result.hasFillOrKillRule = false; + result.fillOrKillRule_ = 0; + return this; + } + } + static SpecialistConfig() { + object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class FeeEstimationData : pb::GeneratedMessage { + private FeeEstimationData() { } + private static readonly FeeEstimationData defaultInstance = new FeeEstimationData().MakeReadOnly(); + private static readonly string[] _feeEstimationDataFieldNames = new string[] { "billing_address", "bnet_account", "currency", "item_amount", "money_amount", "program", "source", "specialist" }; + private static readonly uint[] _feeEstimationDataFieldTags = new uint[] { 66, 58, 26, 48, 40, 13, 37, 16 }; + public static FeeEstimationData DefaultInstance { + get { return defaultInstance; } + } + + public override FeeEstimationData DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override FeeEstimationData ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_FeeEstimationData__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_FeeEstimationData__FieldAccessorTable; } + } + + public const int ProgramFieldNumber = 1; + private bool hasProgram; + private uint program_; + public bool HasProgram { + get { return hasProgram; } + } + public uint Program { + get { return program_; } + } + + public const int SpecialistFieldNumber = 2; + private bool hasSpecialist; + private int specialist_; + public bool HasSpecialist { + get { return hasSpecialist; } + } + public int Specialist { + get { return specialist_; } + } + + public const int CurrencyFieldNumber = 3; + private bool hasCurrency; + private string currency_ = ""; + public bool HasCurrency { + get { return hasCurrency; } + } + public string Currency { + get { return currency_; } + } + + public const int SourceFieldNumber = 4; + private bool hasSource; + private uint source_; + public bool HasSource { + get { return hasSource; } + } + public uint Source { + get { return source_; } + } + + public const int MoneyAmountFieldNumber = 5; + private bool hasMoneyAmount; + private ulong moneyAmount_; + public bool HasMoneyAmount { + get { return hasMoneyAmount; } + } + public ulong MoneyAmount { + get { return moneyAmount_; } + } + + public const int ItemAmountFieldNumber = 6; + private bool hasItemAmount; + private ulong itemAmount_; + public bool HasItemAmount { + get { return hasItemAmount; } + } + public ulong ItemAmount { + get { return itemAmount_; } + } + + public const int BnetAccountFieldNumber = 7; + private bool hasBnetAccount; + private global::bnet.protocol.EntityId bnetAccount_; + public bool HasBnetAccount { + get { return hasBnetAccount; } + } + public global::bnet.protocol.EntityId BnetAccount { + get { return bnetAccount_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int BillingAddressFieldNumber = 8; + private bool hasBillingAddress; + private global::bnet.protocol.exchange.BillingAddress billingAddress_; + public bool HasBillingAddress { + get { return hasBillingAddress; } + } + public global::bnet.protocol.exchange.BillingAddress BillingAddress { + get { return billingAddress_ ?? global::bnet.protocol.exchange.BillingAddress.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasProgram) return false; + if (!hasSpecialist) return false; + if (!hasCurrency) return false; + if (!hasSource) return false; + if (!hasMoneyAmount) return false; + if (!hasItemAmount) return false; + if (HasBnetAccount) { + if (!BnetAccount.IsInitialized) return false; + } + if (HasBillingAddress) { + if (!BillingAddress.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _feeEstimationDataFieldNames; + if (hasProgram) { + output.WriteFixed32(1, field_names[5], Program); + } + if (hasSpecialist) { + output.WriteInt32(2, field_names[7], Specialist); + } + if (hasCurrency) { + output.WriteString(3, field_names[2], Currency); + } + if (hasSource) { + output.WriteFixed32(4, field_names[6], Source); + } + if (hasMoneyAmount) { + output.WriteUInt64(5, field_names[4], MoneyAmount); + } + if (hasItemAmount) { + output.WriteUInt64(6, field_names[3], ItemAmount); + } + if (hasBnetAccount) { + output.WriteMessage(7, field_names[1], BnetAccount); + } + if (hasBillingAddress) { + output.WriteMessage(8, field_names[0], BillingAddress); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasProgram) { + size += pb::CodedOutputStream.ComputeFixed32Size(1, Program); + } + if (hasSpecialist) { + size += pb::CodedOutputStream.ComputeInt32Size(2, Specialist); + } + if (hasCurrency) { + size += pb::CodedOutputStream.ComputeStringSize(3, Currency); + } + if (hasSource) { + size += pb::CodedOutputStream.ComputeFixed32Size(4, Source); + } + if (hasMoneyAmount) { + size += pb::CodedOutputStream.ComputeUInt64Size(5, MoneyAmount); + } + if (hasItemAmount) { + size += pb::CodedOutputStream.ComputeUInt64Size(6, ItemAmount); + } + if (hasBnetAccount) { + size += pb::CodedOutputStream.ComputeMessageSize(7, BnetAccount); + } + if (hasBillingAddress) { + size += pb::CodedOutputStream.ComputeMessageSize(8, BillingAddress); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static FeeEstimationData ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FeeEstimationData ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FeeEstimationData ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FeeEstimationData ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FeeEstimationData ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FeeEstimationData ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static FeeEstimationData ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static FeeEstimationData ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static FeeEstimationData ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FeeEstimationData ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private FeeEstimationData MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(FeeEstimationData prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(FeeEstimationData cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private FeeEstimationData result; + + private FeeEstimationData PrepareBuilder() { + if (resultIsReadOnly) { + FeeEstimationData original = result; + result = new FeeEstimationData(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override FeeEstimationData MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.FeeEstimationData.Descriptor; } + } + + public override FeeEstimationData DefaultInstanceForType { + get { return global::bnet.protocol.exchange.FeeEstimationData.DefaultInstance; } + } + + public override FeeEstimationData BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is FeeEstimationData) { + return MergeFrom((FeeEstimationData) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(FeeEstimationData other) { + if (other == global::bnet.protocol.exchange.FeeEstimationData.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasProgram) { + Program = other.Program; + } + if (other.HasSpecialist) { + Specialist = other.Specialist; + } + if (other.HasCurrency) { + Currency = other.Currency; + } + if (other.HasSource) { + Source = other.Source; + } + if (other.HasMoneyAmount) { + MoneyAmount = other.MoneyAmount; + } + if (other.HasItemAmount) { + ItemAmount = other.ItemAmount; + } + if (other.HasBnetAccount) { + MergeBnetAccount(other.BnetAccount); + } + if (other.HasBillingAddress) { + MergeBillingAddress(other.BillingAddress); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_feeEstimationDataFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _feeEstimationDataFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 13: { + result.hasProgram = input.ReadFixed32(ref result.program_); + break; + } + case 16: { + result.hasSpecialist = input.ReadInt32(ref result.specialist_); + break; + } + case 26: { + result.hasCurrency = input.ReadString(ref result.currency_); + break; + } + case 37: { + result.hasSource = input.ReadFixed32(ref result.source_); + break; + } + case 40: { + result.hasMoneyAmount = input.ReadUInt64(ref result.moneyAmount_); + break; + } + case 48: { + result.hasItemAmount = input.ReadUInt64(ref result.itemAmount_); + break; + } + case 58: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasBnetAccount) { + subBuilder.MergeFrom(BnetAccount); + } + input.ReadMessage(subBuilder, extensionRegistry); + BnetAccount = subBuilder.BuildPartial(); + break; + } + case 66: { + global::bnet.protocol.exchange.BillingAddress.Builder subBuilder = global::bnet.protocol.exchange.BillingAddress.CreateBuilder(); + if (result.hasBillingAddress) { + subBuilder.MergeFrom(BillingAddress); + } + input.ReadMessage(subBuilder, extensionRegistry); + BillingAddress = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasProgram { + get { return result.hasProgram; } + } + public uint Program { + get { return result.Program; } + set { SetProgram(value); } + } + public Builder SetProgram(uint value) { + PrepareBuilder(); + result.hasProgram = true; + result.program_ = value; + return this; + } + public Builder ClearProgram() { + PrepareBuilder(); + result.hasProgram = false; + result.program_ = 0; + return this; + } + + public bool HasSpecialist { + get { return result.hasSpecialist; } + } + public int Specialist { + get { return result.Specialist; } + set { SetSpecialist(value); } + } + public Builder SetSpecialist(int value) { + PrepareBuilder(); + result.hasSpecialist = true; + result.specialist_ = value; + return this; + } + public Builder ClearSpecialist() { + PrepareBuilder(); + result.hasSpecialist = false; + result.specialist_ = 0; + return this; + } + + public bool HasCurrency { + get { return result.hasCurrency; } + } + public string Currency { + get { return result.Currency; } + set { SetCurrency(value); } + } + public Builder SetCurrency(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasCurrency = true; + result.currency_ = value; + return this; + } + public Builder ClearCurrency() { + PrepareBuilder(); + result.hasCurrency = false; + result.currency_ = ""; + return this; + } + + public bool HasSource { + get { return result.hasSource; } + } + public uint Source { + get { return result.Source; } + set { SetSource(value); } + } + public Builder SetSource(uint value) { + PrepareBuilder(); + result.hasSource = true; + result.source_ = value; + return this; + } + public Builder ClearSource() { + PrepareBuilder(); + result.hasSource = false; + result.source_ = 0; + return this; + } + + public bool HasMoneyAmount { + get { return result.hasMoneyAmount; } + } + public ulong MoneyAmount { + get { return result.MoneyAmount; } + set { SetMoneyAmount(value); } + } + public Builder SetMoneyAmount(ulong value) { + PrepareBuilder(); + result.hasMoneyAmount = true; + result.moneyAmount_ = value; + return this; + } + public Builder ClearMoneyAmount() { + PrepareBuilder(); + result.hasMoneyAmount = false; + result.moneyAmount_ = 0UL; + return this; + } + + public bool HasItemAmount { + get { return result.hasItemAmount; } + } + public ulong ItemAmount { + get { return result.ItemAmount; } + set { SetItemAmount(value); } + } + public Builder SetItemAmount(ulong value) { + PrepareBuilder(); + result.hasItemAmount = true; + result.itemAmount_ = value; + return this; + } + public Builder ClearItemAmount() { + PrepareBuilder(); + result.hasItemAmount = false; + result.itemAmount_ = 0UL; + return this; + } + + public bool HasBnetAccount { + get { return result.hasBnetAccount; } + } + public global::bnet.protocol.EntityId BnetAccount { + get { return result.BnetAccount; } + set { SetBnetAccount(value); } + } + public Builder SetBnetAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBnetAccount = true; + result.bnetAccount_ = value; + return this; + } + public Builder SetBnetAccount(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBnetAccount = true; + result.bnetAccount_ = builderForValue.Build(); + return this; + } + public Builder MergeBnetAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBnetAccount && + result.bnetAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.bnetAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccount_).MergeFrom(value).BuildPartial(); + } else { + result.bnetAccount_ = value; + } + result.hasBnetAccount = true; + return this; + } + public Builder ClearBnetAccount() { + PrepareBuilder(); + result.hasBnetAccount = false; + result.bnetAccount_ = null; + return this; + } + + public bool HasBillingAddress { + get { return result.hasBillingAddress; } + } + public global::bnet.protocol.exchange.BillingAddress BillingAddress { + get { return result.BillingAddress; } + set { SetBillingAddress(value); } + } + public Builder SetBillingAddress(global::bnet.protocol.exchange.BillingAddress value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBillingAddress = true; + result.billingAddress_ = value; + return this; + } + public Builder SetBillingAddress(global::bnet.protocol.exchange.BillingAddress.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBillingAddress = true; + result.billingAddress_ = builderForValue.Build(); + return this; + } + public Builder MergeBillingAddress(global::bnet.protocol.exchange.BillingAddress value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBillingAddress && + result.billingAddress_ != global::bnet.protocol.exchange.BillingAddress.DefaultInstance) { + result.billingAddress_ = global::bnet.protocol.exchange.BillingAddress.CreateBuilder(result.billingAddress_).MergeFrom(value).BuildPartial(); + } else { + result.billingAddress_ = value; + } + result.hasBillingAddress = true; + return this; + } + public Builder ClearBillingAddress() { + PrepareBuilder(); + result.hasBillingAddress = false; + result.billingAddress_ = null; + return this; + } + } + static FeeEstimationData() { + object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class FeeDetail : pb::GeneratedMessage { + private FeeDetail() { } + private static readonly FeeDetail defaultInstance = new FeeDetail().MakeReadOnly(); + private static readonly string[] _feeDetailFieldNames = new string[] { "coupon_book_id", "coupon_description", "coupon_type", "discount_amount", "fee_amount", "fee_auth_detail_id", "fee_description", "fee_group_id", "fee_group_name", "fee_id", "flat_fee_amount", "is_tax", "left_over_coupon_charge", "left_over_coupon_credit", "max_fee_amount", "rownum", "scaling_fee_rate" }; + private static readonly uint[] _feeDetailFieldTags = new uint[] { 104, 122, 112, 40, 32, 16, 90, 48, 58, 24, 64, 96, 136, 128, 80, 8, 77 }; + public static FeeDetail DefaultInstance { + get { return defaultInstance; } + } + + public override FeeDetail DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override FeeDetail ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_FeeDetail__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_FeeDetail__FieldAccessorTable; } + } + + public const int RownumFieldNumber = 1; + private bool hasRownum; + private ulong rownum_; + public bool HasRownum { + get { return hasRownum; } + } + public ulong Rownum { + get { return rownum_; } + } + + public const int FeeAuthDetailIdFieldNumber = 2; + private bool hasFeeAuthDetailId; + private ulong feeAuthDetailId_; + public bool HasFeeAuthDetailId { + get { return hasFeeAuthDetailId; } + } + public ulong FeeAuthDetailId { + get { return feeAuthDetailId_; } + } + + public const int FeeIdFieldNumber = 3; + private bool hasFeeId; + private ulong feeId_; + public bool HasFeeId { + get { return hasFeeId; } + } + public ulong FeeId { + get { return feeId_; } + } + + public const int FeeAmountFieldNumber = 4; + private bool hasFeeAmount; + private ulong feeAmount_; + public bool HasFeeAmount { + get { return hasFeeAmount; } + } + public ulong FeeAmount { + get { return feeAmount_; } + } + + public const int DiscountAmountFieldNumber = 5; + private bool hasDiscountAmount; + private ulong discountAmount_; + public bool HasDiscountAmount { + get { return hasDiscountAmount; } + } + public ulong DiscountAmount { + get { return discountAmount_; } + } + + public const int FeeGroupIdFieldNumber = 6; + private bool hasFeeGroupId; + private ulong feeGroupId_; + public bool HasFeeGroupId { + get { return hasFeeGroupId; } + } + public ulong FeeGroupId { + get { return feeGroupId_; } + } + + public const int FeeGroupNameFieldNumber = 7; + private bool hasFeeGroupName; + private string feeGroupName_ = ""; + public bool HasFeeGroupName { + get { return hasFeeGroupName; } + } + public string FeeGroupName { + get { return feeGroupName_; } + } + + public const int FlatFeeAmountFieldNumber = 8; + private bool hasFlatFeeAmount; + private ulong flatFeeAmount_; + public bool HasFlatFeeAmount { + get { return hasFlatFeeAmount; } + } + public ulong FlatFeeAmount { + get { return flatFeeAmount_; } + } + + public const int ScalingFeeRateFieldNumber = 9; + private bool hasScalingFeeRate; + private float scalingFeeRate_; + public bool HasScalingFeeRate { + get { return hasScalingFeeRate; } + } + public float ScalingFeeRate { + get { return scalingFeeRate_; } + } + + public const int MaxFeeAmountFieldNumber = 10; + private bool hasMaxFeeAmount; + private ulong maxFeeAmount_; + public bool HasMaxFeeAmount { + get { return hasMaxFeeAmount; } + } + public ulong MaxFeeAmount { + get { return maxFeeAmount_; } + } + + public const int FeeDescriptionFieldNumber = 11; + private bool hasFeeDescription; + private string feeDescription_ = ""; + public bool HasFeeDescription { + get { return hasFeeDescription; } + } + public string FeeDescription { + get { return feeDescription_; } + } + + public const int IsTaxFieldNumber = 12; + private bool hasIsTax; + private bool isTax_; + public bool HasIsTax { + get { return hasIsTax; } + } + public bool IsTax { + get { return isTax_; } + } + + public const int CouponBookIdFieldNumber = 13; + private bool hasCouponBookId; + private ulong couponBookId_; + public bool HasCouponBookId { + get { return hasCouponBookId; } + } + public ulong CouponBookId { + get { return couponBookId_; } + } + + public const int CouponTypeFieldNumber = 14; + private bool hasCouponType; + private ulong couponType_; + public bool HasCouponType { + get { return hasCouponType; } + } + public ulong CouponType { + get { return couponType_; } + } + + public const int CouponDescriptionFieldNumber = 15; + private bool hasCouponDescription; + private string couponDescription_ = ""; + public bool HasCouponDescription { + get { return hasCouponDescription; } + } + public string CouponDescription { + get { return couponDescription_; } + } + + public const int LeftOverCouponCreditFieldNumber = 16; + private bool hasLeftOverCouponCredit; + private ulong leftOverCouponCredit_; + public bool HasLeftOverCouponCredit { + get { return hasLeftOverCouponCredit; } + } + public ulong LeftOverCouponCredit { + get { return leftOverCouponCredit_; } + } + + public const int LeftOverCouponChargeFieldNumber = 17; + private bool hasLeftOverCouponCharge; + private ulong leftOverCouponCharge_; + public bool HasLeftOverCouponCharge { + get { return hasLeftOverCouponCharge; } + } + public ulong LeftOverCouponCharge { + get { return leftOverCouponCharge_; } + } + + public override bool IsInitialized { + get { + if (!hasRownum) return false; + if (!hasFeeAuthDetailId) return false; + if (!hasIsTax) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _feeDetailFieldNames; + if (hasRownum) { + output.WriteUInt64(1, field_names[15], Rownum); + } + if (hasFeeAuthDetailId) { + output.WriteUInt64(2, field_names[5], FeeAuthDetailId); + } + if (hasFeeId) { + output.WriteUInt64(3, field_names[9], FeeId); + } + if (hasFeeAmount) { + output.WriteUInt64(4, field_names[4], FeeAmount); + } + if (hasDiscountAmount) { + output.WriteUInt64(5, field_names[3], DiscountAmount); + } + if (hasFeeGroupId) { + output.WriteUInt64(6, field_names[7], FeeGroupId); + } + if (hasFeeGroupName) { + output.WriteString(7, field_names[8], FeeGroupName); + } + if (hasFlatFeeAmount) { + output.WriteUInt64(8, field_names[10], FlatFeeAmount); + } + if (hasScalingFeeRate) { + output.WriteFloat(9, field_names[16], ScalingFeeRate); + } + if (hasMaxFeeAmount) { + output.WriteUInt64(10, field_names[14], MaxFeeAmount); + } + if (hasFeeDescription) { + output.WriteString(11, field_names[6], FeeDescription); + } + if (hasIsTax) { + output.WriteBool(12, field_names[11], IsTax); + } + if (hasCouponBookId) { + output.WriteUInt64(13, field_names[0], CouponBookId); + } + if (hasCouponType) { + output.WriteUInt64(14, field_names[2], CouponType); + } + if (hasCouponDescription) { + output.WriteString(15, field_names[1], CouponDescription); + } + if (hasLeftOverCouponCredit) { + output.WriteUInt64(16, field_names[13], LeftOverCouponCredit); + } + if (hasLeftOverCouponCharge) { + output.WriteUInt64(17, field_names[12], LeftOverCouponCharge); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasRownum) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, Rownum); + } + if (hasFeeAuthDetailId) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, FeeAuthDetailId); + } + if (hasFeeId) { + size += pb::CodedOutputStream.ComputeUInt64Size(3, FeeId); + } + if (hasFeeAmount) { + size += pb::CodedOutputStream.ComputeUInt64Size(4, FeeAmount); + } + if (hasDiscountAmount) { + size += pb::CodedOutputStream.ComputeUInt64Size(5, DiscountAmount); + } + if (hasFeeGroupId) { + size += pb::CodedOutputStream.ComputeUInt64Size(6, FeeGroupId); + } + if (hasFeeGroupName) { + size += pb::CodedOutputStream.ComputeStringSize(7, FeeGroupName); + } + if (hasFlatFeeAmount) { + size += pb::CodedOutputStream.ComputeUInt64Size(8, FlatFeeAmount); + } + if (hasScalingFeeRate) { + size += pb::CodedOutputStream.ComputeFloatSize(9, ScalingFeeRate); + } + if (hasMaxFeeAmount) { + size += pb::CodedOutputStream.ComputeUInt64Size(10, MaxFeeAmount); + } + if (hasFeeDescription) { + size += pb::CodedOutputStream.ComputeStringSize(11, FeeDescription); + } + if (hasIsTax) { + size += pb::CodedOutputStream.ComputeBoolSize(12, IsTax); + } + if (hasCouponBookId) { + size += pb::CodedOutputStream.ComputeUInt64Size(13, CouponBookId); + } + if (hasCouponType) { + size += pb::CodedOutputStream.ComputeUInt64Size(14, CouponType); + } + if (hasCouponDescription) { + size += pb::CodedOutputStream.ComputeStringSize(15, CouponDescription); + } + if (hasLeftOverCouponCredit) { + size += pb::CodedOutputStream.ComputeUInt64Size(16, LeftOverCouponCredit); + } + if (hasLeftOverCouponCharge) { + size += pb::CodedOutputStream.ComputeUInt64Size(17, LeftOverCouponCharge); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static FeeDetail ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FeeDetail ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FeeDetail ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FeeDetail ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FeeDetail ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FeeDetail ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static FeeDetail ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static FeeDetail ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static FeeDetail ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FeeDetail ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private FeeDetail MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(FeeDetail prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(FeeDetail cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private FeeDetail result; + + private FeeDetail PrepareBuilder() { + if (resultIsReadOnly) { + FeeDetail original = result; + result = new FeeDetail(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override FeeDetail MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.FeeDetail.Descriptor; } + } + + public override FeeDetail DefaultInstanceForType { + get { return global::bnet.protocol.exchange.FeeDetail.DefaultInstance; } + } + + public override FeeDetail BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is FeeDetail) { + return MergeFrom((FeeDetail) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(FeeDetail other) { + if (other == global::bnet.protocol.exchange.FeeDetail.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasRownum) { + Rownum = other.Rownum; + } + if (other.HasFeeAuthDetailId) { + FeeAuthDetailId = other.FeeAuthDetailId; + } + if (other.HasFeeId) { + FeeId = other.FeeId; + } + if (other.HasFeeAmount) { + FeeAmount = other.FeeAmount; + } + if (other.HasDiscountAmount) { + DiscountAmount = other.DiscountAmount; + } + if (other.HasFeeGroupId) { + FeeGroupId = other.FeeGroupId; + } + if (other.HasFeeGroupName) { + FeeGroupName = other.FeeGroupName; + } + if (other.HasFlatFeeAmount) { + FlatFeeAmount = other.FlatFeeAmount; + } + if (other.HasScalingFeeRate) { + ScalingFeeRate = other.ScalingFeeRate; + } + if (other.HasMaxFeeAmount) { + MaxFeeAmount = other.MaxFeeAmount; + } + if (other.HasFeeDescription) { + FeeDescription = other.FeeDescription; + } + if (other.HasIsTax) { + IsTax = other.IsTax; + } + if (other.HasCouponBookId) { + CouponBookId = other.CouponBookId; + } + if (other.HasCouponType) { + CouponType = other.CouponType; + } + if (other.HasCouponDescription) { + CouponDescription = other.CouponDescription; + } + if (other.HasLeftOverCouponCredit) { + LeftOverCouponCredit = other.LeftOverCouponCredit; + } + if (other.HasLeftOverCouponCharge) { + LeftOverCouponCharge = other.LeftOverCouponCharge; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_feeDetailFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _feeDetailFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasRownum = input.ReadUInt64(ref result.rownum_); + break; + } + case 16: { + result.hasFeeAuthDetailId = input.ReadUInt64(ref result.feeAuthDetailId_); + break; + } + case 24: { + result.hasFeeId = input.ReadUInt64(ref result.feeId_); + break; + } + case 32: { + result.hasFeeAmount = input.ReadUInt64(ref result.feeAmount_); + break; + } + case 40: { + result.hasDiscountAmount = input.ReadUInt64(ref result.discountAmount_); + break; + } + case 48: { + result.hasFeeGroupId = input.ReadUInt64(ref result.feeGroupId_); + break; + } + case 58: { + result.hasFeeGroupName = input.ReadString(ref result.feeGroupName_); + break; + } + case 64: { + result.hasFlatFeeAmount = input.ReadUInt64(ref result.flatFeeAmount_); + break; + } + case 77: { + result.hasScalingFeeRate = input.ReadFloat(ref result.scalingFeeRate_); + break; + } + case 80: { + result.hasMaxFeeAmount = input.ReadUInt64(ref result.maxFeeAmount_); + break; + } + case 90: { + result.hasFeeDescription = input.ReadString(ref result.feeDescription_); + break; + } + case 96: { + result.hasIsTax = input.ReadBool(ref result.isTax_); + break; + } + case 104: { + result.hasCouponBookId = input.ReadUInt64(ref result.couponBookId_); + break; + } + case 112: { + result.hasCouponType = input.ReadUInt64(ref result.couponType_); + break; + } + case 122: { + result.hasCouponDescription = input.ReadString(ref result.couponDescription_); + break; + } + case 128: { + result.hasLeftOverCouponCredit = input.ReadUInt64(ref result.leftOverCouponCredit_); + break; + } + case 136: { + result.hasLeftOverCouponCharge = input.ReadUInt64(ref result.leftOverCouponCharge_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasRownum { + get { return result.hasRownum; } + } + public ulong Rownum { + get { return result.Rownum; } + set { SetRownum(value); } + } + public Builder SetRownum(ulong value) { + PrepareBuilder(); + result.hasRownum = true; + result.rownum_ = value; + return this; + } + public Builder ClearRownum() { + PrepareBuilder(); + result.hasRownum = false; + result.rownum_ = 0UL; + return this; + } + + public bool HasFeeAuthDetailId { + get { return result.hasFeeAuthDetailId; } + } + public ulong FeeAuthDetailId { + get { return result.FeeAuthDetailId; } + set { SetFeeAuthDetailId(value); } + } + public Builder SetFeeAuthDetailId(ulong value) { + PrepareBuilder(); + result.hasFeeAuthDetailId = true; + result.feeAuthDetailId_ = value; + return this; + } + public Builder ClearFeeAuthDetailId() { + PrepareBuilder(); + result.hasFeeAuthDetailId = false; + result.feeAuthDetailId_ = 0UL; + return this; + } + + public bool HasFeeId { + get { return result.hasFeeId; } + } + public ulong FeeId { + get { return result.FeeId; } + set { SetFeeId(value); } + } + public Builder SetFeeId(ulong value) { + PrepareBuilder(); + result.hasFeeId = true; + result.feeId_ = value; + return this; + } + public Builder ClearFeeId() { + PrepareBuilder(); + result.hasFeeId = false; + result.feeId_ = 0UL; + return this; + } + + public bool HasFeeAmount { + get { return result.hasFeeAmount; } + } + public ulong FeeAmount { + get { return result.FeeAmount; } + set { SetFeeAmount(value); } + } + public Builder SetFeeAmount(ulong value) { + PrepareBuilder(); + result.hasFeeAmount = true; + result.feeAmount_ = value; + return this; + } + public Builder ClearFeeAmount() { + PrepareBuilder(); + result.hasFeeAmount = false; + result.feeAmount_ = 0UL; + return this; + } + + public bool HasDiscountAmount { + get { return result.hasDiscountAmount; } + } + public ulong DiscountAmount { + get { return result.DiscountAmount; } + set { SetDiscountAmount(value); } + } + public Builder SetDiscountAmount(ulong value) { + PrepareBuilder(); + result.hasDiscountAmount = true; + result.discountAmount_ = value; + return this; + } + public Builder ClearDiscountAmount() { + PrepareBuilder(); + result.hasDiscountAmount = false; + result.discountAmount_ = 0UL; + return this; + } + + public bool HasFeeGroupId { + get { return result.hasFeeGroupId; } + } + public ulong FeeGroupId { + get { return result.FeeGroupId; } + set { SetFeeGroupId(value); } + } + public Builder SetFeeGroupId(ulong value) { + PrepareBuilder(); + result.hasFeeGroupId = true; + result.feeGroupId_ = value; + return this; + } + public Builder ClearFeeGroupId() { + PrepareBuilder(); + result.hasFeeGroupId = false; + result.feeGroupId_ = 0UL; + return this; + } + + public bool HasFeeGroupName { + get { return result.hasFeeGroupName; } + } + public string FeeGroupName { + get { return result.FeeGroupName; } + set { SetFeeGroupName(value); } + } + public Builder SetFeeGroupName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasFeeGroupName = true; + result.feeGroupName_ = value; + return this; + } + public Builder ClearFeeGroupName() { + PrepareBuilder(); + result.hasFeeGroupName = false; + result.feeGroupName_ = ""; + return this; + } + + public bool HasFlatFeeAmount { + get { return result.hasFlatFeeAmount; } + } + public ulong FlatFeeAmount { + get { return result.FlatFeeAmount; } + set { SetFlatFeeAmount(value); } + } + public Builder SetFlatFeeAmount(ulong value) { + PrepareBuilder(); + result.hasFlatFeeAmount = true; + result.flatFeeAmount_ = value; + return this; + } + public Builder ClearFlatFeeAmount() { + PrepareBuilder(); + result.hasFlatFeeAmount = false; + result.flatFeeAmount_ = 0UL; + return this; + } + + public bool HasScalingFeeRate { + get { return result.hasScalingFeeRate; } + } + public float ScalingFeeRate { + get { return result.ScalingFeeRate; } + set { SetScalingFeeRate(value); } + } + public Builder SetScalingFeeRate(float value) { + PrepareBuilder(); + result.hasScalingFeeRate = true; + result.scalingFeeRate_ = value; + return this; + } + public Builder ClearScalingFeeRate() { + PrepareBuilder(); + result.hasScalingFeeRate = false; + result.scalingFeeRate_ = 0F; + return this; + } + + public bool HasMaxFeeAmount { + get { return result.hasMaxFeeAmount; } + } + public ulong MaxFeeAmount { + get { return result.MaxFeeAmount; } + set { SetMaxFeeAmount(value); } + } + public Builder SetMaxFeeAmount(ulong value) { + PrepareBuilder(); + result.hasMaxFeeAmount = true; + result.maxFeeAmount_ = value; + return this; + } + public Builder ClearMaxFeeAmount() { + PrepareBuilder(); + result.hasMaxFeeAmount = false; + result.maxFeeAmount_ = 0UL; + return this; + } + + public bool HasFeeDescription { + get { return result.hasFeeDescription; } + } + public string FeeDescription { + get { return result.FeeDescription; } + set { SetFeeDescription(value); } + } + public Builder SetFeeDescription(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasFeeDescription = true; + result.feeDescription_ = value; + return this; + } + public Builder ClearFeeDescription() { + PrepareBuilder(); + result.hasFeeDescription = false; + result.feeDescription_ = ""; + return this; + } + + public bool HasIsTax { + get { return result.hasIsTax; } + } + public bool IsTax { + get { return result.IsTax; } + set { SetIsTax(value); } + } + public Builder SetIsTax(bool value) { + PrepareBuilder(); + result.hasIsTax = true; + result.isTax_ = value; + return this; + } + public Builder ClearIsTax() { + PrepareBuilder(); + result.hasIsTax = false; + result.isTax_ = false; + return this; + } + + public bool HasCouponBookId { + get { return result.hasCouponBookId; } + } + public ulong CouponBookId { + get { return result.CouponBookId; } + set { SetCouponBookId(value); } + } + public Builder SetCouponBookId(ulong value) { + PrepareBuilder(); + result.hasCouponBookId = true; + result.couponBookId_ = value; + return this; + } + public Builder ClearCouponBookId() { + PrepareBuilder(); + result.hasCouponBookId = false; + result.couponBookId_ = 0UL; + return this; + } + + public bool HasCouponType { + get { return result.hasCouponType; } + } + public ulong CouponType { + get { return result.CouponType; } + set { SetCouponType(value); } + } + public Builder SetCouponType(ulong value) { + PrepareBuilder(); + result.hasCouponType = true; + result.couponType_ = value; + return this; + } + public Builder ClearCouponType() { + PrepareBuilder(); + result.hasCouponType = false; + result.couponType_ = 0UL; + return this; + } + + public bool HasCouponDescription { + get { return result.hasCouponDescription; } + } + public string CouponDescription { + get { return result.CouponDescription; } + set { SetCouponDescription(value); } + } + public Builder SetCouponDescription(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasCouponDescription = true; + result.couponDescription_ = value; + return this; + } + public Builder ClearCouponDescription() { + PrepareBuilder(); + result.hasCouponDescription = false; + result.couponDescription_ = ""; + return this; + } + + public bool HasLeftOverCouponCredit { + get { return result.hasLeftOverCouponCredit; } + } + public ulong LeftOverCouponCredit { + get { return result.LeftOverCouponCredit; } + set { SetLeftOverCouponCredit(value); } + } + public Builder SetLeftOverCouponCredit(ulong value) { + PrepareBuilder(); + result.hasLeftOverCouponCredit = true; + result.leftOverCouponCredit_ = value; + return this; + } + public Builder ClearLeftOverCouponCredit() { + PrepareBuilder(); + result.hasLeftOverCouponCredit = false; + result.leftOverCouponCredit_ = 0UL; + return this; + } + + public bool HasLeftOverCouponCharge { + get { return result.hasLeftOverCouponCharge; } + } + public ulong LeftOverCouponCharge { + get { return result.LeftOverCouponCharge; } + set { SetLeftOverCouponCharge(value); } + } + public Builder SetLeftOverCouponCharge(ulong value) { + PrepareBuilder(); + result.hasLeftOverCouponCharge = true; + result.leftOverCouponCharge_ = value; + return this; + } + public Builder ClearLeftOverCouponCharge() { + PrepareBuilder(); + result.hasLeftOverCouponCharge = false; + result.leftOverCouponCharge_ = 0UL; + return this; + } + } + static FeeDetail() { + object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class PriceDetail : pb::GeneratedMessage { + private PriceDetail() { } + private static readonly PriceDetail defaultInstance = new PriceDetail().MakeReadOnly(); + private static readonly string[] _priceDetailFieldNames = new string[] { "amount", "trade_price" }; + private static readonly uint[] _priceDetailFieldTags = new uint[] { 16, 8 }; + public static PriceDetail DefaultInstance { + get { return defaultInstance; } + } + + public override PriceDetail DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override PriceDetail ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_PriceDetail__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_PriceDetail__FieldAccessorTable; } + } + + public const int TradePriceFieldNumber = 1; + private bool hasTradePrice; + private ulong tradePrice_; + public bool HasTradePrice { + get { return hasTradePrice; } + } + public ulong TradePrice { + get { return tradePrice_; } + } + + public const int AmountFieldNumber = 2; + private bool hasAmount; + private ulong amount_; + public bool HasAmount { + get { return hasAmount; } + } + public ulong Amount { + get { return amount_; } + } + + public override bool IsInitialized { + get { + if (!hasTradePrice) return false; + if (!hasAmount) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _priceDetailFieldNames; + if (hasTradePrice) { + output.WriteUInt64(1, field_names[1], TradePrice); + } + if (hasAmount) { + output.WriteUInt64(2, field_names[0], Amount); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTradePrice) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, TradePrice); + } + if (hasAmount) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, Amount); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static PriceDetail ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PriceDetail ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PriceDetail ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PriceDetail ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PriceDetail ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PriceDetail ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static PriceDetail ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static PriceDetail ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static PriceDetail ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PriceDetail ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private PriceDetail MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(PriceDetail prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(PriceDetail cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private PriceDetail result; + + private PriceDetail PrepareBuilder() { + if (resultIsReadOnly) { + PriceDetail original = result; + result = new PriceDetail(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override PriceDetail MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.PriceDetail.Descriptor; } + } + + public override PriceDetail DefaultInstanceForType { + get { return global::bnet.protocol.exchange.PriceDetail.DefaultInstance; } + } + + public override PriceDetail BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is PriceDetail) { + return MergeFrom((PriceDetail) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(PriceDetail other) { + if (other == global::bnet.protocol.exchange.PriceDetail.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTradePrice) { + TradePrice = other.TradePrice; + } + if (other.HasAmount) { + Amount = other.Amount; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_priceDetailFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _priceDetailFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasTradePrice = input.ReadUInt64(ref result.tradePrice_); + break; + } + case 16: { + result.hasAmount = input.ReadUInt64(ref result.amount_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTradePrice { + get { return result.hasTradePrice; } + } + public ulong TradePrice { + get { return result.TradePrice; } + set { SetTradePrice(value); } + } + public Builder SetTradePrice(ulong value) { + PrepareBuilder(); + result.hasTradePrice = true; + result.tradePrice_ = value; + return this; + } + public Builder ClearTradePrice() { + PrepareBuilder(); + result.hasTradePrice = false; + result.tradePrice_ = 0UL; + return this; + } + + public bool HasAmount { + get { return result.hasAmount; } + } + public ulong Amount { + get { return result.Amount; } + set { SetAmount(value); } + } + public Builder SetAmount(ulong value) { + PrepareBuilder(); + result.hasAmount = true; + result.amount_ = value; + return this; + } + public Builder ClearAmount() { + PrepareBuilder(); + result.hasAmount = false; + result.amount_ = 0UL; + return this; + } + } + static PriceDetail() { + object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Count : pb::GeneratedMessage { + private Count() { } + private static readonly Count defaultInstance = new Count().MakeReadOnly(); + private static readonly string[] _countFieldNames = new string[] { "count", "limit" }; + private static readonly uint[] _countFieldTags = new uint[] { 8, 16 }; + public static Count DefaultInstance { + get { return defaultInstance; } + } + + public override Count DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Count ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_Count__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_Count__FieldAccessorTable; } + } + + public const int Count_FieldNumber = 1; + private bool hasCount_; + private uint count_; + public bool HasCount_ { + get { return hasCount_; } + } + public uint Count_ { + get { return count_; } + } + + public const int LimitFieldNumber = 2; + private bool hasLimit; + private uint limit_; + public bool HasLimit { + get { return hasLimit; } + } + public uint Limit { + get { return limit_; } + } + + public override bool IsInitialized { + get { + if (!hasCount_) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _countFieldNames; + if (hasCount_) { + output.WriteUInt32(1, field_names[0], Count_); + } + if (hasLimit) { + output.WriteUInt32(2, field_names[1], Limit); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasCount_) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, Count_); + } + if (hasLimit) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, Limit); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static Count ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Count ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Count ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Count ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Count ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Count ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Count ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Count ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Count ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Count ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Count MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Count prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Count cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Count result; + + private Count PrepareBuilder() { + if (resultIsReadOnly) { + Count original = result; + result = new Count(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Count MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.Count.Descriptor; } + } + + public override Count DefaultInstanceForType { + get { return global::bnet.protocol.exchange.Count.DefaultInstance; } + } + + public override Count BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Count) { + return MergeFrom((Count) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Count other) { + if (other == global::bnet.protocol.exchange.Count.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasCount_) { + Count_ = other.Count_; + } + if (other.HasLimit) { + Limit = other.Limit; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_countFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _countFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasCount_ = input.ReadUInt32(ref result.count_); + break; + } + case 16: { + result.hasLimit = input.ReadUInt32(ref result.limit_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasCount_ { + get { return result.hasCount_; } + } + public uint Count_ { + get { return result.Count_; } + set { SetCount_(value); } + } + public Builder SetCount_(uint value) { + PrepareBuilder(); + result.hasCount_ = true; + result.count_ = value; + return this; + } + public Builder ClearCount_() { + PrepareBuilder(); + result.hasCount_ = false; + result.count_ = 0; + return this; + } + + public bool HasLimit { + get { return result.hasLimit; } + } + public uint Limit { + get { return result.Limit; } + set { SetLimit(value); } + } + public Builder SetLimit(uint value) { + PrepareBuilder(); + result.hasLimit = true; + result.limit_ = value; + return this; + } + public Builder ClearLimit() { + PrepareBuilder(); + result.hasLimit = false; + result.limit_ = 0; + return this; + } + } + static Count() { + object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class AdvancedSubscription : pb::GeneratedMessage { + private AdvancedSubscription() { } + private static readonly AdvancedSubscription defaultInstance = new AdvancedSubscription().MakeReadOnly(); + private static readonly string[] _advancedSubscriptionFieldNames = new string[] { "event", "program", "reason" }; + private static readonly uint[] _advancedSubscriptionFieldTags = new uint[] { 16, 13, 24 }; + public static AdvancedSubscription DefaultInstance { + get { return defaultInstance; } + } + + public override AdvancedSubscription DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override AdvancedSubscription ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_AdvancedSubscription__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_AdvancedSubscription__FieldAccessorTable; } + } + + public const int ProgramFieldNumber = 1; + private bool hasProgram; + private uint program_; + public bool HasProgram { + get { return hasProgram; } + } + public uint Program { + get { return program_; } + } + + public const int EventFieldNumber = 2; + private bool hasEvent; + private uint event_; + public bool HasEvent { + get { return hasEvent; } + } + public uint Event { + get { return event_; } + } + + public const int ReasonFieldNumber = 3; + private pbc::PopsicleList reason_ = new pbc::PopsicleList(); + public scg::IList ReasonList { + get { return pbc::Lists.AsReadOnly(reason_); } + } + public int ReasonCount { + get { return reason_.Count; } + } + public uint GetReason(int index) { + return reason_[index]; + } + + public override bool IsInitialized { + get { + if (!hasProgram) return false; + if (!hasEvent) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _advancedSubscriptionFieldNames; + if (hasProgram) { + output.WriteFixed32(1, field_names[1], Program); + } + if (hasEvent) { + output.WriteUInt32(2, field_names[0], Event); + } + if (reason_.Count > 0) { + output.WriteUInt32Array(3, field_names[2], reason_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasProgram) { + size += pb::CodedOutputStream.ComputeFixed32Size(1, Program); + } + if (hasEvent) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, Event); + } + { + int dataSize = 0; + foreach (uint element in ReasonList) { + dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); + } + size += dataSize; + size += 1 * reason_.Count; + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static AdvancedSubscription ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AdvancedSubscription ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AdvancedSubscription ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AdvancedSubscription ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AdvancedSubscription ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AdvancedSubscription ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static AdvancedSubscription ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static AdvancedSubscription ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static AdvancedSubscription ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AdvancedSubscription ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private AdvancedSubscription MakeReadOnly() { + reason_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(AdvancedSubscription prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(AdvancedSubscription cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private AdvancedSubscription result; + + private AdvancedSubscription PrepareBuilder() { + if (resultIsReadOnly) { + AdvancedSubscription original = result; + result = new AdvancedSubscription(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override AdvancedSubscription MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.AdvancedSubscription.Descriptor; } + } + + public override AdvancedSubscription DefaultInstanceForType { + get { return global::bnet.protocol.exchange.AdvancedSubscription.DefaultInstance; } + } + + public override AdvancedSubscription BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is AdvancedSubscription) { + return MergeFrom((AdvancedSubscription) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(AdvancedSubscription other) { + if (other == global::bnet.protocol.exchange.AdvancedSubscription.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasProgram) { + Program = other.Program; + } + if (other.HasEvent) { + Event = other.Event; + } + if (other.reason_.Count != 0) { + result.reason_.Add(other.reason_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_advancedSubscriptionFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _advancedSubscriptionFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 13: { + result.hasProgram = input.ReadFixed32(ref result.program_); + break; + } + case 16: { + result.hasEvent = input.ReadUInt32(ref result.event_); + break; + } + case 26: + case 24: { + input.ReadUInt32Array(tag, field_name, result.reason_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasProgram { + get { return result.hasProgram; } + } + public uint Program { + get { return result.Program; } + set { SetProgram(value); } + } + public Builder SetProgram(uint value) { + PrepareBuilder(); + result.hasProgram = true; + result.program_ = value; + return this; + } + public Builder ClearProgram() { + PrepareBuilder(); + result.hasProgram = false; + result.program_ = 0; + return this; + } + + public bool HasEvent { + get { return result.hasEvent; } + } + public uint Event { + get { return result.Event; } + set { SetEvent(value); } + } + public Builder SetEvent(uint value) { + PrepareBuilder(); + result.hasEvent = true; + result.event_ = value; + return this; + } + public Builder ClearEvent() { + PrepareBuilder(); + result.hasEvent = false; + result.event_ = 0; + return this; + } + + public pbc::IPopsicleList ReasonList { + get { return PrepareBuilder().reason_; } + } + public int ReasonCount { + get { return result.ReasonCount; } + } + public uint GetReason(int index) { + return result.GetReason(index); + } + public Builder SetReason(int index, uint value) { + PrepareBuilder(); + result.reason_[index] = value; + return this; + } + public Builder AddReason(uint value) { + PrepareBuilder(); + result.reason_.Add(value); + return this; + } + public Builder AddRangeReason(scg::IEnumerable values) { + PrepareBuilder(); + result.reason_.Add(values); + return this; + } + public Builder ClearReason() { + PrepareBuilder(); + result.reason_.Clear(); + return this; + } + } + static AdvancedSubscription() { + object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class HistoryData : pb::GeneratedMessage { + private HistoryData() { } + private static readonly HistoryData defaultInstance = new HistoryData().MakeReadOnly(); + private static readonly string[] _historyDataFieldNames = new string[] { "account_for_item", "account_for_money", "action_id", "amount", "auth_complete_progress", "auth_deferred", "auth_filled_progress", "auth_handle", "auth_id", "auth_object_type", "auth_total_progress", "authorized_amount", "authorized_fee_amount", "completed", "created", "deferred", "fee_amount", "has_been_deferred", "order_book_id", "order_id", "order_type", "parent_settle_id", "parent_settled", "partition_id", "progress", "result_code", "risk_completed", "risk_result", "risk_verdict", "token", "trans_direction" }; + private static readonly uint[] _historyDataFieldTags = new uint[] { 154, 162, 24, 64, 208, 240, 216, 234, 184, 192, 224, 48, 56, 136, 104, 80, 72, 88, 8, 176, 168, 32, 40, 18, 96, 144, 112, 120, 128, 250, 202 }; + public static HistoryData DefaultInstance { + get { return defaultInstance; } + } + + public override HistoryData DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override HistoryData ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_HistoryData__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_HistoryData__FieldAccessorTable; } + } + + public const int OrderBookIdFieldNumber = 1; + private bool hasOrderBookId; + private ulong orderBookId_; + public bool HasOrderBookId { + get { return hasOrderBookId; } + } + public ulong OrderBookId { + get { return orderBookId_; } + } + + public const int PartitionIdFieldNumber = 2; + private bool hasPartitionId; + private global::bnet.protocol.exchange.PartitionId partitionId_; + public bool HasPartitionId { + get { return hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int ActionIdFieldNumber = 3; + private bool hasActionId; + private ulong actionId_; + public bool HasActionId { + get { return hasActionId; } + } + public ulong ActionId { + get { return actionId_; } + } + + public const int ParentSettleIdFieldNumber = 4; + private bool hasParentSettleId; + private ulong parentSettleId_; + public bool HasParentSettleId { + get { return hasParentSettleId; } + } + public ulong ParentSettleId { + get { return parentSettleId_; } + } + + public const int ParentSettledFieldNumber = 5; + private bool hasParentSettled; + private bool parentSettled_; + public bool HasParentSettled { + get { return hasParentSettled; } + } + public bool ParentSettled { + get { return parentSettled_; } + } + + public const int AuthorizedAmountFieldNumber = 6; + private bool hasAuthorizedAmount; + private ulong authorizedAmount_; + public bool HasAuthorizedAmount { + get { return hasAuthorizedAmount; } + } + public ulong AuthorizedAmount { + get { return authorizedAmount_; } + } + + public const int AuthorizedFeeAmountFieldNumber = 7; + private bool hasAuthorizedFeeAmount; + private ulong authorizedFeeAmount_; + public bool HasAuthorizedFeeAmount { + get { return hasAuthorizedFeeAmount; } + } + public ulong AuthorizedFeeAmount { + get { return authorizedFeeAmount_; } + } + + public const int AmountFieldNumber = 8; + private bool hasAmount; + private ulong amount_; + public bool HasAmount { + get { return hasAmount; } + } + public ulong Amount { + get { return amount_; } + } + + public const int FeeAmountFieldNumber = 9; + private bool hasFeeAmount; + private ulong feeAmount_; + public bool HasFeeAmount { + get { return hasFeeAmount; } + } + public ulong FeeAmount { + get { return feeAmount_; } + } + + public const int DeferredFieldNumber = 10; + private bool hasDeferred; + private bool deferred_; + public bool HasDeferred { + get { return hasDeferred; } + } + public bool Deferred { + get { return deferred_; } + } + + public const int HasBeenDeferredFieldNumber = 11; + private bool hasHasBeenDeferred; + private bool hasBeenDeferred_; + public bool HasHasBeenDeferred { + get { return hasHasBeenDeferred; } + } + public bool HasBeenDeferred { + get { return hasBeenDeferred_; } + } + + public const int ProgressFieldNumber = 12; + private bool hasProgress; + private ulong progress_; + public bool HasProgress { + get { return hasProgress; } + } + public ulong Progress { + get { return progress_; } + } + + public const int CreatedFieldNumber = 13; + private bool hasCreated; + private ulong created_; + public bool HasCreated { + get { return hasCreated; } + } + public ulong Created { + get { return created_; } + } + + public const int RiskCompletedFieldNumber = 14; + private bool hasRiskCompleted; + private ulong riskCompleted_; + public bool HasRiskCompleted { + get { return hasRiskCompleted; } + } + public ulong RiskCompleted { + get { return riskCompleted_; } + } + + public const int RiskResultFieldNumber = 15; + private bool hasRiskResult; + private ulong riskResult_; + public bool HasRiskResult { + get { return hasRiskResult; } + } + public ulong RiskResult { + get { return riskResult_; } + } + + public const int RiskVerdictFieldNumber = 16; + private bool hasRiskVerdict; + private ulong riskVerdict_; + public bool HasRiskVerdict { + get { return hasRiskVerdict; } + } + public ulong RiskVerdict { + get { return riskVerdict_; } + } + + public const int CompletedFieldNumber = 17; + private bool hasCompleted; + private ulong completed_; + public bool HasCompleted { + get { return hasCompleted; } + } + public ulong Completed { + get { return completed_; } + } + + public const int ResultCodeFieldNumber = 18; + private bool hasResultCode; + private ulong resultCode_; + public bool HasResultCode { + get { return hasResultCode; } + } + public ulong ResultCode { + get { return resultCode_; } + } + + public const int AccountForItemFieldNumber = 19; + private bool hasAccountForItem; + private global::bnet.protocol.exchange.BlobFrom accountForItem_; + public bool HasAccountForItem { + get { return hasAccountForItem; } + } + public global::bnet.protocol.exchange.BlobFrom AccountForItem { + get { return accountForItem_ ?? global::bnet.protocol.exchange.BlobFrom.DefaultInstance; } + } + + public const int AccountForMoneyFieldNumber = 20; + private bool hasAccountForMoney; + private global::bnet.protocol.exchange.BlobFrom accountForMoney_; + public bool HasAccountForMoney { + get { return hasAccountForMoney; } + } + public global::bnet.protocol.exchange.BlobFrom AccountForMoney { + get { return accountForMoney_ ?? global::bnet.protocol.exchange.BlobFrom.DefaultInstance; } + } + + public const int OrderTypeFieldNumber = 21; + private bool hasOrderType; + private uint orderType_; + public bool HasOrderType { + get { return hasOrderType; } + } + public uint OrderType { + get { return orderType_; } + } + + public const int OrderIdFieldNumber = 22; + private bool hasOrderId; + private ulong orderId_; + public bool HasOrderId { + get { return hasOrderId; } + } + public ulong OrderId { + get { return orderId_; } + } + + public const int AuthIdFieldNumber = 23; + private bool hasAuthId; + private ulong authId_; + public bool HasAuthId { + get { return hasAuthId; } + } + public ulong AuthId { + get { return authId_; } + } + + public const int AuthObjectTypeFieldNumber = 24; + private bool hasAuthObjectType; + private uint authObjectType_; + public bool HasAuthObjectType { + get { return hasAuthObjectType; } + } + public uint AuthObjectType { + get { return authObjectType_; } + } + + public const int TransDirectionFieldNumber = 25; + private bool hasTransDirection; + private string transDirection_ = ""; + public bool HasTransDirection { + get { return hasTransDirection; } + } + public string TransDirection { + get { return transDirection_; } + } + + public const int AuthCompleteProgressFieldNumber = 26; + private bool hasAuthCompleteProgress; + private ulong authCompleteProgress_; + public bool HasAuthCompleteProgress { + get { return hasAuthCompleteProgress; } + } + public ulong AuthCompleteProgress { + get { return authCompleteProgress_; } + } + + public const int AuthFilledProgressFieldNumber = 27; + private bool hasAuthFilledProgress; + private ulong authFilledProgress_; + public bool HasAuthFilledProgress { + get { return hasAuthFilledProgress; } + } + public ulong AuthFilledProgress { + get { return authFilledProgress_; } + } + + public const int AuthTotalProgressFieldNumber = 28; + private bool hasAuthTotalProgress; + private ulong authTotalProgress_; + public bool HasAuthTotalProgress { + get { return hasAuthTotalProgress; } + } + public ulong AuthTotalProgress { + get { return authTotalProgress_; } + } + + public const int AuthHandleFieldNumber = 29; + private bool hasAuthHandle; + private global::bnet.protocol.exchange.BlobFromOfType authHandle_; + public bool HasAuthHandle { + get { return hasAuthHandle; } + } + public global::bnet.protocol.exchange.BlobFromOfType AuthHandle { + get { return authHandle_ ?? global::bnet.protocol.exchange.BlobFromOfType.DefaultInstance; } + } + + public const int AuthDeferredFieldNumber = 30; + private bool hasAuthDeferred; + private bool authDeferred_; + public bool HasAuthDeferred { + get { return hasAuthDeferred; } + } + public bool AuthDeferred { + get { return authDeferred_; } + } + + public const int TokenFieldNumber = 31; + private bool hasToken; + private global::bnet.protocol.exchange.PartitionId token_; + public bool HasToken { + get { return hasToken; } + } + public global::bnet.protocol.exchange.PartitionId Token { + get { return token_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasOrderBookId) return false; + if (!hasPartitionId) return false; + if (!hasActionId) return false; + if (!hasAuthorizedAmount) return false; + if (!hasAmount) return false; + if (!hasDeferred) return false; + if (!hasHasBeenDeferred) return false; + if (!hasProgress) return false; + if (!hasCreated) return false; + if (!hasAccountForItem) return false; + if (!hasAccountForMoney) return false; + if (!hasOrderType) return false; + if (!hasOrderId) return false; + if (!hasAuthId) return false; + if (!hasAuthObjectType) return false; + if (!hasTransDirection) return false; + if (!hasAuthCompleteProgress) return false; + if (!hasAuthFilledProgress) return false; + if (!hasAuthTotalProgress) return false; + if (!hasAuthHandle) return false; + if (!hasAuthDeferred) return false; + if (!hasToken) return false; + if (!PartitionId.IsInitialized) return false; + if (!AccountForItem.IsInitialized) return false; + if (!AccountForMoney.IsInitialized) return false; + if (!AuthHandle.IsInitialized) return false; + if (!Token.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _historyDataFieldNames; + if (hasOrderBookId) { + output.WriteUInt64(1, field_names[18], OrderBookId); + } + if (hasPartitionId) { + output.WriteMessage(2, field_names[23], PartitionId); + } + if (hasActionId) { + output.WriteUInt64(3, field_names[2], ActionId); + } + if (hasParentSettleId) { + output.WriteUInt64(4, field_names[21], ParentSettleId); + } + if (hasParentSettled) { + output.WriteBool(5, field_names[22], ParentSettled); + } + if (hasAuthorizedAmount) { + output.WriteUInt64(6, field_names[11], AuthorizedAmount); + } + if (hasAuthorizedFeeAmount) { + output.WriteUInt64(7, field_names[12], AuthorizedFeeAmount); + } + if (hasAmount) { + output.WriteUInt64(8, field_names[3], Amount); + } + if (hasFeeAmount) { + output.WriteUInt64(9, field_names[16], FeeAmount); + } + if (hasDeferred) { + output.WriteBool(10, field_names[15], Deferred); + } + if (hasHasBeenDeferred) { + output.WriteBool(11, field_names[17], HasBeenDeferred); + } + if (hasProgress) { + output.WriteUInt64(12, field_names[24], Progress); + } + if (hasCreated) { + output.WriteUInt64(13, field_names[14], Created); + } + if (hasRiskCompleted) { + output.WriteUInt64(14, field_names[26], RiskCompleted); + } + if (hasRiskResult) { + output.WriteUInt64(15, field_names[27], RiskResult); + } + if (hasRiskVerdict) { + output.WriteUInt64(16, field_names[28], RiskVerdict); + } + if (hasCompleted) { + output.WriteUInt64(17, field_names[13], Completed); + } + if (hasResultCode) { + output.WriteUInt64(18, field_names[25], ResultCode); + } + if (hasAccountForItem) { + output.WriteMessage(19, field_names[0], AccountForItem); + } + if (hasAccountForMoney) { + output.WriteMessage(20, field_names[1], AccountForMoney); + } + if (hasOrderType) { + output.WriteUInt32(21, field_names[20], OrderType); + } + if (hasOrderId) { + output.WriteUInt64(22, field_names[19], OrderId); + } + if (hasAuthId) { + output.WriteUInt64(23, field_names[8], AuthId); + } + if (hasAuthObjectType) { + output.WriteUInt32(24, field_names[9], AuthObjectType); + } + if (hasTransDirection) { + output.WriteString(25, field_names[30], TransDirection); + } + if (hasAuthCompleteProgress) { + output.WriteUInt64(26, field_names[4], AuthCompleteProgress); + } + if (hasAuthFilledProgress) { + output.WriteUInt64(27, field_names[6], AuthFilledProgress); + } + if (hasAuthTotalProgress) { + output.WriteUInt64(28, field_names[10], AuthTotalProgress); + } + if (hasAuthHandle) { + output.WriteMessage(29, field_names[7], AuthHandle); + } + if (hasAuthDeferred) { + output.WriteBool(30, field_names[5], AuthDeferred); + } + if (hasToken) { + output.WriteMessage(31, field_names[29], Token); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasOrderBookId) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, OrderBookId); + } + if (hasPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, PartitionId); + } + if (hasActionId) { + size += pb::CodedOutputStream.ComputeUInt64Size(3, ActionId); + } + if (hasParentSettleId) { + size += pb::CodedOutputStream.ComputeUInt64Size(4, ParentSettleId); + } + if (hasParentSettled) { + size += pb::CodedOutputStream.ComputeBoolSize(5, ParentSettled); + } + if (hasAuthorizedAmount) { + size += pb::CodedOutputStream.ComputeUInt64Size(6, AuthorizedAmount); + } + if (hasAuthorizedFeeAmount) { + size += pb::CodedOutputStream.ComputeUInt64Size(7, AuthorizedFeeAmount); + } + if (hasAmount) { + size += pb::CodedOutputStream.ComputeUInt64Size(8, Amount); + } + if (hasFeeAmount) { + size += pb::CodedOutputStream.ComputeUInt64Size(9, FeeAmount); + } + if (hasDeferred) { + size += pb::CodedOutputStream.ComputeBoolSize(10, Deferred); + } + if (hasHasBeenDeferred) { + size += pb::CodedOutputStream.ComputeBoolSize(11, HasBeenDeferred); + } + if (hasProgress) { + size += pb::CodedOutputStream.ComputeUInt64Size(12, Progress); + } + if (hasCreated) { + size += pb::CodedOutputStream.ComputeUInt64Size(13, Created); + } + if (hasRiskCompleted) { + size += pb::CodedOutputStream.ComputeUInt64Size(14, RiskCompleted); + } + if (hasRiskResult) { + size += pb::CodedOutputStream.ComputeUInt64Size(15, RiskResult); + } + if (hasRiskVerdict) { + size += pb::CodedOutputStream.ComputeUInt64Size(16, RiskVerdict); + } + if (hasCompleted) { + size += pb::CodedOutputStream.ComputeUInt64Size(17, Completed); + } + if (hasResultCode) { + size += pb::CodedOutputStream.ComputeUInt64Size(18, ResultCode); + } + if (hasAccountForItem) { + size += pb::CodedOutputStream.ComputeMessageSize(19, AccountForItem); + } + if (hasAccountForMoney) { + size += pb::CodedOutputStream.ComputeMessageSize(20, AccountForMoney); + } + if (hasOrderType) { + size += pb::CodedOutputStream.ComputeUInt32Size(21, OrderType); + } + if (hasOrderId) { + size += pb::CodedOutputStream.ComputeUInt64Size(22, OrderId); + } + if (hasAuthId) { + size += pb::CodedOutputStream.ComputeUInt64Size(23, AuthId); + } + if (hasAuthObjectType) { + size += pb::CodedOutputStream.ComputeUInt32Size(24, AuthObjectType); + } + if (hasTransDirection) { + size += pb::CodedOutputStream.ComputeStringSize(25, TransDirection); + } + if (hasAuthCompleteProgress) { + size += pb::CodedOutputStream.ComputeUInt64Size(26, AuthCompleteProgress); + } + if (hasAuthFilledProgress) { + size += pb::CodedOutputStream.ComputeUInt64Size(27, AuthFilledProgress); + } + if (hasAuthTotalProgress) { + size += pb::CodedOutputStream.ComputeUInt64Size(28, AuthTotalProgress); + } + if (hasAuthHandle) { + size += pb::CodedOutputStream.ComputeMessageSize(29, AuthHandle); + } + if (hasAuthDeferred) { + size += pb::CodedOutputStream.ComputeBoolSize(30, AuthDeferred); + } + if (hasToken) { + size += pb::CodedOutputStream.ComputeMessageSize(31, Token); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static HistoryData ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static HistoryData ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static HistoryData ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static HistoryData ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static HistoryData ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static HistoryData ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static HistoryData ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static HistoryData ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static HistoryData ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static HistoryData ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private HistoryData MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(HistoryData prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(HistoryData cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private HistoryData result; + + private HistoryData PrepareBuilder() { + if (resultIsReadOnly) { + HistoryData original = result; + result = new HistoryData(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override HistoryData MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.HistoryData.Descriptor; } + } + + public override HistoryData DefaultInstanceForType { + get { return global::bnet.protocol.exchange.HistoryData.DefaultInstance; } + } + + public override HistoryData BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is HistoryData) { + return MergeFrom((HistoryData) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(HistoryData other) { + if (other == global::bnet.protocol.exchange.HistoryData.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasOrderBookId) { + OrderBookId = other.OrderBookId; + } + if (other.HasPartitionId) { + MergePartitionId(other.PartitionId); + } + if (other.HasActionId) { + ActionId = other.ActionId; + } + if (other.HasParentSettleId) { + ParentSettleId = other.ParentSettleId; + } + if (other.HasParentSettled) { + ParentSettled = other.ParentSettled; + } + if (other.HasAuthorizedAmount) { + AuthorizedAmount = other.AuthorizedAmount; + } + if (other.HasAuthorizedFeeAmount) { + AuthorizedFeeAmount = other.AuthorizedFeeAmount; + } + if (other.HasAmount) { + Amount = other.Amount; + } + if (other.HasFeeAmount) { + FeeAmount = other.FeeAmount; + } + if (other.HasDeferred) { + Deferred = other.Deferred; + } + if (other.HasHasBeenDeferred) { + HasBeenDeferred = other.HasBeenDeferred; + } + if (other.HasProgress) { + Progress = other.Progress; + } + if (other.HasCreated) { + Created = other.Created; + } + if (other.HasRiskCompleted) { + RiskCompleted = other.RiskCompleted; + } + if (other.HasRiskResult) { + RiskResult = other.RiskResult; + } + if (other.HasRiskVerdict) { + RiskVerdict = other.RiskVerdict; + } + if (other.HasCompleted) { + Completed = other.Completed; + } + if (other.HasResultCode) { + ResultCode = other.ResultCode; + } + if (other.HasAccountForItem) { + MergeAccountForItem(other.AccountForItem); + } + if (other.HasAccountForMoney) { + MergeAccountForMoney(other.AccountForMoney); + } + if (other.HasOrderType) { + OrderType = other.OrderType; + } + if (other.HasOrderId) { + OrderId = other.OrderId; + } + if (other.HasAuthId) { + AuthId = other.AuthId; + } + if (other.HasAuthObjectType) { + AuthObjectType = other.AuthObjectType; + } + if (other.HasTransDirection) { + TransDirection = other.TransDirection; + } + if (other.HasAuthCompleteProgress) { + AuthCompleteProgress = other.AuthCompleteProgress; + } + if (other.HasAuthFilledProgress) { + AuthFilledProgress = other.AuthFilledProgress; + } + if (other.HasAuthTotalProgress) { + AuthTotalProgress = other.AuthTotalProgress; + } + if (other.HasAuthHandle) { + MergeAuthHandle(other.AuthHandle); + } + if (other.HasAuthDeferred) { + AuthDeferred = other.AuthDeferred; + } + if (other.HasToken) { + MergeToken(other.Token); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_historyDataFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _historyDataFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasOrderBookId = input.ReadUInt64(ref result.orderBookId_); + break; + } + case 18: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasPartitionId) { + subBuilder.MergeFrom(PartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + PartitionId = subBuilder.BuildPartial(); + break; + } + case 24: { + result.hasActionId = input.ReadUInt64(ref result.actionId_); + break; + } + case 32: { + result.hasParentSettleId = input.ReadUInt64(ref result.parentSettleId_); + break; + } + case 40: { + result.hasParentSettled = input.ReadBool(ref result.parentSettled_); + break; + } + case 48: { + result.hasAuthorizedAmount = input.ReadUInt64(ref result.authorizedAmount_); + break; + } + case 56: { + result.hasAuthorizedFeeAmount = input.ReadUInt64(ref result.authorizedFeeAmount_); + break; + } + case 64: { + result.hasAmount = input.ReadUInt64(ref result.amount_); + break; + } + case 72: { + result.hasFeeAmount = input.ReadUInt64(ref result.feeAmount_); + break; + } + case 80: { + result.hasDeferred = input.ReadBool(ref result.deferred_); + break; + } + case 88: { + result.hasHasBeenDeferred = input.ReadBool(ref result.hasBeenDeferred_); + break; + } + case 96: { + result.hasProgress = input.ReadUInt64(ref result.progress_); + break; + } + case 104: { + result.hasCreated = input.ReadUInt64(ref result.created_); + break; + } + case 112: { + result.hasRiskCompleted = input.ReadUInt64(ref result.riskCompleted_); + break; + } + case 120: { + result.hasRiskResult = input.ReadUInt64(ref result.riskResult_); + break; + } + case 128: { + result.hasRiskVerdict = input.ReadUInt64(ref result.riskVerdict_); + break; + } + case 136: { + result.hasCompleted = input.ReadUInt64(ref result.completed_); + break; + } + case 144: { + result.hasResultCode = input.ReadUInt64(ref result.resultCode_); + break; + } + case 154: { + global::bnet.protocol.exchange.BlobFrom.Builder subBuilder = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(); + if (result.hasAccountForItem) { + subBuilder.MergeFrom(AccountForItem); + } + input.ReadMessage(subBuilder, extensionRegistry); + AccountForItem = subBuilder.BuildPartial(); + break; + } + case 162: { + global::bnet.protocol.exchange.BlobFrom.Builder subBuilder = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(); + if (result.hasAccountForMoney) { + subBuilder.MergeFrom(AccountForMoney); + } + input.ReadMessage(subBuilder, extensionRegistry); + AccountForMoney = subBuilder.BuildPartial(); + break; + } + case 168: { + result.hasOrderType = input.ReadUInt32(ref result.orderType_); + break; + } + case 176: { + result.hasOrderId = input.ReadUInt64(ref result.orderId_); + break; + } + case 184: { + result.hasAuthId = input.ReadUInt64(ref result.authId_); + break; + } + case 192: { + result.hasAuthObjectType = input.ReadUInt32(ref result.authObjectType_); + break; + } + case 202: { + result.hasTransDirection = input.ReadString(ref result.transDirection_); + break; + } + case 208: { + result.hasAuthCompleteProgress = input.ReadUInt64(ref result.authCompleteProgress_); + break; + } + case 216: { + result.hasAuthFilledProgress = input.ReadUInt64(ref result.authFilledProgress_); + break; + } + case 224: { + result.hasAuthTotalProgress = input.ReadUInt64(ref result.authTotalProgress_); + break; + } + case 234: { + global::bnet.protocol.exchange.BlobFromOfType.Builder subBuilder = global::bnet.protocol.exchange.BlobFromOfType.CreateBuilder(); + if (result.hasAuthHandle) { + subBuilder.MergeFrom(AuthHandle); + } + input.ReadMessage(subBuilder, extensionRegistry); + AuthHandle = subBuilder.BuildPartial(); + break; + } + case 240: { + result.hasAuthDeferred = input.ReadBool(ref result.authDeferred_); + break; + } + case 250: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasToken) { + subBuilder.MergeFrom(Token); + } + input.ReadMessage(subBuilder, extensionRegistry); + Token = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasOrderBookId { + get { return result.hasOrderBookId; } + } + public ulong OrderBookId { + get { return result.OrderBookId; } + set { SetOrderBookId(value); } + } + public Builder SetOrderBookId(ulong value) { + PrepareBuilder(); + result.hasOrderBookId = true; + result.orderBookId_ = value; + return this; + } + public Builder ClearOrderBookId() { + PrepareBuilder(); + result.hasOrderBookId = false; + result.orderBookId_ = 0UL; + return this; + } + + public bool HasPartitionId { + get { return result.hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = value; + return this; + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = builderForValue.Build(); + return this; + } + public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasPartitionId && + result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); + } else { + result.partitionId_ = value; + } + result.hasPartitionId = true; + return this; + } + public Builder ClearPartitionId() { + PrepareBuilder(); + result.hasPartitionId = false; + result.partitionId_ = null; + return this; + } + + public bool HasActionId { + get { return result.hasActionId; } + } + public ulong ActionId { + get { return result.ActionId; } + set { SetActionId(value); } + } + public Builder SetActionId(ulong value) { + PrepareBuilder(); + result.hasActionId = true; + result.actionId_ = value; + return this; + } + public Builder ClearActionId() { + PrepareBuilder(); + result.hasActionId = false; + result.actionId_ = 0UL; + return this; + } + + public bool HasParentSettleId { + get { return result.hasParentSettleId; } + } + public ulong ParentSettleId { + get { return result.ParentSettleId; } + set { SetParentSettleId(value); } + } + public Builder SetParentSettleId(ulong value) { + PrepareBuilder(); + result.hasParentSettleId = true; + result.parentSettleId_ = value; + return this; + } + public Builder ClearParentSettleId() { + PrepareBuilder(); + result.hasParentSettleId = false; + result.parentSettleId_ = 0UL; + return this; + } + + public bool HasParentSettled { + get { return result.hasParentSettled; } + } + public bool ParentSettled { + get { return result.ParentSettled; } + set { SetParentSettled(value); } + } + public Builder SetParentSettled(bool value) { + PrepareBuilder(); + result.hasParentSettled = true; + result.parentSettled_ = value; + return this; + } + public Builder ClearParentSettled() { + PrepareBuilder(); + result.hasParentSettled = false; + result.parentSettled_ = false; + return this; + } + + public bool HasAuthorizedAmount { + get { return result.hasAuthorizedAmount; } + } + public ulong AuthorizedAmount { + get { return result.AuthorizedAmount; } + set { SetAuthorizedAmount(value); } + } + public Builder SetAuthorizedAmount(ulong value) { + PrepareBuilder(); + result.hasAuthorizedAmount = true; + result.authorizedAmount_ = value; + return this; + } + public Builder ClearAuthorizedAmount() { + PrepareBuilder(); + result.hasAuthorizedAmount = false; + result.authorizedAmount_ = 0UL; + return this; + } + + public bool HasAuthorizedFeeAmount { + get { return result.hasAuthorizedFeeAmount; } + } + public ulong AuthorizedFeeAmount { + get { return result.AuthorizedFeeAmount; } + set { SetAuthorizedFeeAmount(value); } + } + public Builder SetAuthorizedFeeAmount(ulong value) { + PrepareBuilder(); + result.hasAuthorizedFeeAmount = true; + result.authorizedFeeAmount_ = value; + return this; + } + public Builder ClearAuthorizedFeeAmount() { + PrepareBuilder(); + result.hasAuthorizedFeeAmount = false; + result.authorizedFeeAmount_ = 0UL; + return this; + } + + public bool HasAmount { + get { return result.hasAmount; } + } + public ulong Amount { + get { return result.Amount; } + set { SetAmount(value); } + } + public Builder SetAmount(ulong value) { + PrepareBuilder(); + result.hasAmount = true; + result.amount_ = value; + return this; + } + public Builder ClearAmount() { + PrepareBuilder(); + result.hasAmount = false; + result.amount_ = 0UL; + return this; + } + + public bool HasFeeAmount { + get { return result.hasFeeAmount; } + } + public ulong FeeAmount { + get { return result.FeeAmount; } + set { SetFeeAmount(value); } + } + public Builder SetFeeAmount(ulong value) { + PrepareBuilder(); + result.hasFeeAmount = true; + result.feeAmount_ = value; + return this; + } + public Builder ClearFeeAmount() { + PrepareBuilder(); + result.hasFeeAmount = false; + result.feeAmount_ = 0UL; + return this; + } + + public bool HasDeferred { + get { return result.hasDeferred; } + } + public bool Deferred { + get { return result.Deferred; } + set { SetDeferred(value); } + } + public Builder SetDeferred(bool value) { + PrepareBuilder(); + result.hasDeferred = true; + result.deferred_ = value; + return this; + } + public Builder ClearDeferred() { + PrepareBuilder(); + result.hasDeferred = false; + result.deferred_ = false; + return this; + } + + public bool HasHasBeenDeferred { + get { return result.hasHasBeenDeferred; } + } + public bool HasBeenDeferred { + get { return result.HasBeenDeferred; } + set { SetHasBeenDeferred(value); } + } + public Builder SetHasBeenDeferred(bool value) { + PrepareBuilder(); + result.hasHasBeenDeferred = true; + result.hasBeenDeferred_ = value; + return this; + } + public Builder ClearHasBeenDeferred() { + PrepareBuilder(); + result.hasHasBeenDeferred = false; + result.hasBeenDeferred_ = false; + return this; + } + + public bool HasProgress { + get { return result.hasProgress; } + } + public ulong Progress { + get { return result.Progress; } + set { SetProgress(value); } + } + public Builder SetProgress(ulong value) { + PrepareBuilder(); + result.hasProgress = true; + result.progress_ = value; + return this; + } + public Builder ClearProgress() { + PrepareBuilder(); + result.hasProgress = false; + result.progress_ = 0UL; + return this; + } + + public bool HasCreated { + get { return result.hasCreated; } + } + public ulong Created { + get { return result.Created; } + set { SetCreated(value); } + } + public Builder SetCreated(ulong value) { + PrepareBuilder(); + result.hasCreated = true; + result.created_ = value; + return this; + } + public Builder ClearCreated() { + PrepareBuilder(); + result.hasCreated = false; + result.created_ = 0UL; + return this; + } + + public bool HasRiskCompleted { + get { return result.hasRiskCompleted; } + } + public ulong RiskCompleted { + get { return result.RiskCompleted; } + set { SetRiskCompleted(value); } + } + public Builder SetRiskCompleted(ulong value) { + PrepareBuilder(); + result.hasRiskCompleted = true; + result.riskCompleted_ = value; + return this; + } + public Builder ClearRiskCompleted() { + PrepareBuilder(); + result.hasRiskCompleted = false; + result.riskCompleted_ = 0UL; + return this; + } + + public bool HasRiskResult { + get { return result.hasRiskResult; } + } + public ulong RiskResult { + get { return result.RiskResult; } + set { SetRiskResult(value); } + } + public Builder SetRiskResult(ulong value) { + PrepareBuilder(); + result.hasRiskResult = true; + result.riskResult_ = value; + return this; + } + public Builder ClearRiskResult() { + PrepareBuilder(); + result.hasRiskResult = false; + result.riskResult_ = 0UL; + return this; + } + + public bool HasRiskVerdict { + get { return result.hasRiskVerdict; } + } + public ulong RiskVerdict { + get { return result.RiskVerdict; } + set { SetRiskVerdict(value); } + } + public Builder SetRiskVerdict(ulong value) { + PrepareBuilder(); + result.hasRiskVerdict = true; + result.riskVerdict_ = value; + return this; + } + public Builder ClearRiskVerdict() { + PrepareBuilder(); + result.hasRiskVerdict = false; + result.riskVerdict_ = 0UL; + return this; + } + + public bool HasCompleted { + get { return result.hasCompleted; } + } + public ulong Completed { + get { return result.Completed; } + set { SetCompleted(value); } + } + public Builder SetCompleted(ulong value) { + PrepareBuilder(); + result.hasCompleted = true; + result.completed_ = value; + return this; + } + public Builder ClearCompleted() { + PrepareBuilder(); + result.hasCompleted = false; + result.completed_ = 0UL; + return this; + } + + public bool HasResultCode { + get { return result.hasResultCode; } + } + public ulong ResultCode { + get { return result.ResultCode; } + set { SetResultCode(value); } + } + public Builder SetResultCode(ulong value) { + PrepareBuilder(); + result.hasResultCode = true; + result.resultCode_ = value; + return this; + } + public Builder ClearResultCode() { + PrepareBuilder(); + result.hasResultCode = false; + result.resultCode_ = 0UL; + return this; + } + + public bool HasAccountForItem { + get { return result.hasAccountForItem; } + } + public global::bnet.protocol.exchange.BlobFrom AccountForItem { + get { return result.AccountForItem; } + set { SetAccountForItem(value); } + } + public Builder SetAccountForItem(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccountForItem = true; + result.accountForItem_ = value; + return this; + } + public Builder SetAccountForItem(global::bnet.protocol.exchange.BlobFrom.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccountForItem = true; + result.accountForItem_ = builderForValue.Build(); + return this; + } + public Builder MergeAccountForItem(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccountForItem && + result.accountForItem_ != global::bnet.protocol.exchange.BlobFrom.DefaultInstance) { + result.accountForItem_ = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(result.accountForItem_).MergeFrom(value).BuildPartial(); + } else { + result.accountForItem_ = value; + } + result.hasAccountForItem = true; + return this; + } + public Builder ClearAccountForItem() { + PrepareBuilder(); + result.hasAccountForItem = false; + result.accountForItem_ = null; + return this; + } + + public bool HasAccountForMoney { + get { return result.hasAccountForMoney; } + } + public global::bnet.protocol.exchange.BlobFrom AccountForMoney { + get { return result.AccountForMoney; } + set { SetAccountForMoney(value); } + } + public Builder SetAccountForMoney(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccountForMoney = true; + result.accountForMoney_ = value; + return this; + } + public Builder SetAccountForMoney(global::bnet.protocol.exchange.BlobFrom.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccountForMoney = true; + result.accountForMoney_ = builderForValue.Build(); + return this; + } + public Builder MergeAccountForMoney(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccountForMoney && + result.accountForMoney_ != global::bnet.protocol.exchange.BlobFrom.DefaultInstance) { + result.accountForMoney_ = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(result.accountForMoney_).MergeFrom(value).BuildPartial(); + } else { + result.accountForMoney_ = value; + } + result.hasAccountForMoney = true; + return this; + } + public Builder ClearAccountForMoney() { + PrepareBuilder(); + result.hasAccountForMoney = false; + result.accountForMoney_ = null; + return this; + } + + public bool HasOrderType { + get { return result.hasOrderType; } + } + public uint OrderType { + get { return result.OrderType; } + set { SetOrderType(value); } + } + public Builder SetOrderType(uint value) { + PrepareBuilder(); + result.hasOrderType = true; + result.orderType_ = value; + return this; + } + public Builder ClearOrderType() { + PrepareBuilder(); + result.hasOrderType = false; + result.orderType_ = 0; + return this; + } + + public bool HasOrderId { + get { return result.hasOrderId; } + } + public ulong OrderId { + get { return result.OrderId; } + set { SetOrderId(value); } + } + public Builder SetOrderId(ulong value) { + PrepareBuilder(); + result.hasOrderId = true; + result.orderId_ = value; + return this; + } + public Builder ClearOrderId() { + PrepareBuilder(); + result.hasOrderId = false; + result.orderId_ = 0UL; + return this; + } + + public bool HasAuthId { + get { return result.hasAuthId; } + } + public ulong AuthId { + get { return result.AuthId; } + set { SetAuthId(value); } + } + public Builder SetAuthId(ulong value) { + PrepareBuilder(); + result.hasAuthId = true; + result.authId_ = value; + return this; + } + public Builder ClearAuthId() { + PrepareBuilder(); + result.hasAuthId = false; + result.authId_ = 0UL; + return this; + } + + public bool HasAuthObjectType { + get { return result.hasAuthObjectType; } + } + public uint AuthObjectType { + get { return result.AuthObjectType; } + set { SetAuthObjectType(value); } + } + public Builder SetAuthObjectType(uint value) { + PrepareBuilder(); + result.hasAuthObjectType = true; + result.authObjectType_ = value; + return this; + } + public Builder ClearAuthObjectType() { + PrepareBuilder(); + result.hasAuthObjectType = false; + result.authObjectType_ = 0; + return this; + } + + public bool HasTransDirection { + get { return result.hasTransDirection; } + } + public string TransDirection { + get { return result.TransDirection; } + set { SetTransDirection(value); } + } + public Builder SetTransDirection(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTransDirection = true; + result.transDirection_ = value; + return this; + } + public Builder ClearTransDirection() { + PrepareBuilder(); + result.hasTransDirection = false; + result.transDirection_ = ""; + return this; + } + + public bool HasAuthCompleteProgress { + get { return result.hasAuthCompleteProgress; } + } + public ulong AuthCompleteProgress { + get { return result.AuthCompleteProgress; } + set { SetAuthCompleteProgress(value); } + } + public Builder SetAuthCompleteProgress(ulong value) { + PrepareBuilder(); + result.hasAuthCompleteProgress = true; + result.authCompleteProgress_ = value; + return this; + } + public Builder ClearAuthCompleteProgress() { + PrepareBuilder(); + result.hasAuthCompleteProgress = false; + result.authCompleteProgress_ = 0UL; + return this; + } + + public bool HasAuthFilledProgress { + get { return result.hasAuthFilledProgress; } + } + public ulong AuthFilledProgress { + get { return result.AuthFilledProgress; } + set { SetAuthFilledProgress(value); } + } + public Builder SetAuthFilledProgress(ulong value) { + PrepareBuilder(); + result.hasAuthFilledProgress = true; + result.authFilledProgress_ = value; + return this; + } + public Builder ClearAuthFilledProgress() { + PrepareBuilder(); + result.hasAuthFilledProgress = false; + result.authFilledProgress_ = 0UL; + return this; + } + + public bool HasAuthTotalProgress { + get { return result.hasAuthTotalProgress; } + } + public ulong AuthTotalProgress { + get { return result.AuthTotalProgress; } + set { SetAuthTotalProgress(value); } + } + public Builder SetAuthTotalProgress(ulong value) { + PrepareBuilder(); + result.hasAuthTotalProgress = true; + result.authTotalProgress_ = value; + return this; + } + public Builder ClearAuthTotalProgress() { + PrepareBuilder(); + result.hasAuthTotalProgress = false; + result.authTotalProgress_ = 0UL; + return this; + } + + public bool HasAuthHandle { + get { return result.hasAuthHandle; } + } + public global::bnet.protocol.exchange.BlobFromOfType AuthHandle { + get { return result.AuthHandle; } + set { SetAuthHandle(value); } + } + public Builder SetAuthHandle(global::bnet.protocol.exchange.BlobFromOfType value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAuthHandle = true; + result.authHandle_ = value; + return this; + } + public Builder SetAuthHandle(global::bnet.protocol.exchange.BlobFromOfType.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAuthHandle = true; + result.authHandle_ = builderForValue.Build(); + return this; + } + public Builder MergeAuthHandle(global::bnet.protocol.exchange.BlobFromOfType value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAuthHandle && + result.authHandle_ != global::bnet.protocol.exchange.BlobFromOfType.DefaultInstance) { + result.authHandle_ = global::bnet.protocol.exchange.BlobFromOfType.CreateBuilder(result.authHandle_).MergeFrom(value).BuildPartial(); + } else { + result.authHandle_ = value; + } + result.hasAuthHandle = true; + return this; + } + public Builder ClearAuthHandle() { + PrepareBuilder(); + result.hasAuthHandle = false; + result.authHandle_ = null; + return this; + } + + public bool HasAuthDeferred { + get { return result.hasAuthDeferred; } + } + public bool AuthDeferred { + get { return result.AuthDeferred; } + set { SetAuthDeferred(value); } + } + public Builder SetAuthDeferred(bool value) { + PrepareBuilder(); + result.hasAuthDeferred = true; + result.authDeferred_ = value; + return this; + } + public Builder ClearAuthDeferred() { + PrepareBuilder(); + result.hasAuthDeferred = false; + result.authDeferred_ = false; + return this; + } + + public bool HasToken { + get { return result.hasToken; } + } + public global::bnet.protocol.exchange.PartitionId Token { + get { return result.Token; } + set { SetToken(value); } + } + public Builder SetToken(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasToken = true; + result.token_ = value; + return this; + } + public Builder SetToken(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasToken = true; + result.token_ = builderForValue.Build(); + return this; + } + public Builder MergeToken(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasToken && + result.token_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.token_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.token_).MergeFrom(value).BuildPartial(); + } else { + result.token_ = value; + } + result.hasToken = true; + return this; + } + public Builder ClearToken() { + PrepareBuilder(); + result.hasToken = false; + result.token_ = null; + return this; + } + } + static HistoryData() { + object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/LibMooNet/bnet/protocol/exchange_object_provider/ExchangeObjectProviderTypes.cs b/src/LibMooNet/bnet/protocol/exchange_object_provider/ExchangeObjectProviderTypes.cs new file mode 100644 index 00000000..963267d5 --- /dev/null +++ b/src/LibMooNet/bnet/protocol/exchange_object_provider/ExchangeObjectProviderTypes.cs @@ -0,0 +1,4251 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace bnet.protocol.exchange_object_provider { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class ExchangeObjectProviderTypes { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_object_provider_ReportAuthorizeRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_object_provider_ReportAuthorizeRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_object_provider_ReportSettleRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_object_provider_ReportSettleRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_object_provider_ReportCancelRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_object_provider_ReportCancelRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_object_provider_ReportRefundRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_object_provider_ReportRefundRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_object_provider_GetPaymentMethodsRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_object_provider_GetPaymentMethodsRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_object_provider_PaymentMethod__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_object_provider_PaymentMethod__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_object_provider_GetPaymentMethodsResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_object_provider_GetPaymentMethodsResponse__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static ExchangeObjectProviderTypes() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "CilibmV0L2V4Y2hhbmdlX29iamVjdF9wcm92aWRlcl90eXBlcy5wcm90bxIm" + + "Ym5ldC5wcm90b2NvbC5leGNoYW5nZV9vYmplY3RfcHJvdmlkZXIaEWJuZXQv" + + "ZW50aXR5LnByb3RvGhNibmV0L2V4Y2hhbmdlLnByb3RvIswDChZSZXBvcnRB" + + "dXRob3JpemVSZXF1ZXN0EjkKDHBhcnRpdGlvbl9pZBgBIAIoCzIjLmJuZXQu" + + "cHJvdG9jb2wuZXhjaGFuZ2UuUGFydGl0aW9uSWQSMgoFdG9rZW4YAiACKAsy" + + "Iy5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLlBhcnRpdGlvbklkEg4KBnJlc3Vs" + + "dBgDIAIoBBI7CgthdXRoX2hhbmRsZRgEIAEoCzImLmJuZXQucHJvdG9jb2wu" + + "ZXhjaGFuZ2UuQmxvYkZyb21PZlR5cGUSFgoOZGVmZXJfZGVsaXZlcnkYBSAB" + + "KAgSMAoPYm5ldF9hY2NvdW50X2lkGAYgAigLMhcuYm5ldC5wcm90b2NvbC5F" + + "bnRpdHlJZBJBCg1yZXN1bHRfZGV0YWlsGAcgASgLMiouYm5ldC5wcm90b2Nv" + + "bC5leGNoYW5nZS5BY3Rpb25SZXN1bHREZXRhaWwSEgoKYXZzX3Jlc3VsdBgI" + + "IAEoCRISCgpjdnZfcmVzdWx0GAkgASgJEkEKF25vdGlmaWNhdGlvbl9leHRy" + + "YV9pbmZvGAogASgLMiAuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5CbG9iRnJv" + + "bSKaAgoTUmVwb3J0U2V0dGxlUmVxdWVzdBI5CgxwYXJ0aXRpb25faWQYASAC" + + "KAsyIy5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLlBhcnRpdGlvbklkEjIKBXRv" + + "a2VuGAIgAigLMiMuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5QYXJ0aXRpb25J" + + "ZBIOCgZyZXN1bHQYAyACKAQSQQoXbm90aWZpY2F0aW9uX2V4dHJhX2luZm8Y" + + "BCABKAsyIC5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLkJsb2JGcm9tEkEKDXJl" + + "c3VsdF9kZXRhaWwYBSABKAsyKi5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLkFj" + + "dGlvblJlc3VsdERldGFpbCKaAgoTUmVwb3J0Q2FuY2VsUmVxdWVzdBI5Cgxw" + + "YXJ0aXRpb25faWQYASACKAsyIy5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLlBh" + + "cnRpdGlvbklkEjIKBXRva2VuGAIgAigLMiMuYm5ldC5wcm90b2NvbC5leGNo" + + "YW5nZS5QYXJ0aXRpb25JZBIOCgZyZXN1bHQYAyACKAQSQQoXbm90aWZpY2F0" + + "aW9uX2V4dHJhX2luZm8YBCABKAsyIC5ibmV0LnByb3RvY29sLmV4Y2hhbmdl" + + "LkJsb2JGcm9tEkEKDXJlc3VsdF9kZXRhaWwYBSABKAsyKi5ibmV0LnByb3Rv" + + "Y29sLmV4Y2hhbmdlLkFjdGlvblJlc3VsdERldGFpbCKaAgoTUmVwb3J0UmVm" + + "dW5kUmVxdWVzdBI5CgxwYXJ0aXRpb25faWQYASACKAsyIy5ibmV0LnByb3Rv" + + "Y29sLmV4Y2hhbmdlLlBhcnRpdGlvbklkEjIKBXRva2VuGAIgAigLMiMuYm5l" + + "dC5wcm90b2NvbC5leGNoYW5nZS5QYXJ0aXRpb25JZBIOCgZyZXN1bHQYAyAC" + + "KAQSQQoXbm90aWZpY2F0aW9uX2V4dHJhX2luZm8YBCABKAsyIC5ibmV0LnBy" + + "b3RvY29sLmV4Y2hhbmdlLkJsb2JGcm9tEkEKDXJlc3VsdF9kZXRhaWwYBSAB" + + "KAsyKi5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLkFjdGlvblJlc3VsdERldGFp" + + "bCKUAgoYR2V0UGF5bWVudE1ldGhvZHNSZXF1ZXN0Ei0KDGJuZXRfYWNjb3Vu" + + "dBgBIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSLQoMZ2FtZV9hY2Nv" + + "dW50GAIgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBIQCghjdXJyZW5j" + + "eRgDIAIoCRIYChBjYXNoX2luX291dF9tYXNrGAQgAigNEisKHHJlZnJlc2hf" + + "cGF5bWVudF9tZXRob2RfY2FjaGUYBSABKAg6BWZhbHNlEiYKF3JlZnJlc2hf" + + "ZV9iYWxhbmNlX2NhY2hlGAYgASgIOgVmYWxzZRIZCgpzbXNfZW5hYmxlGAcg" + + "ASgIOgVmYWxzZSK0AgoNUGF5bWVudE1ldGhvZBIxCgdhY2NvdW50GAEgAigL" + + "MiAuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5CbG9iRnJvbRITCgtkZXNjcmlw" + + "dGlvbhgCIAEoCRIOCgZhbW91bnQYAyABKAQSGwoQY2FzaF9pbl9vdXRfbWFz" + + "axgEIAEoDToBMxI/Cg9iaWxsaW5nX2FkZHJlc3MYBSABKAsyJi5ibmV0LnBy" + + "b3RvY29sLmV4Y2hhbmdlLkJpbGxpbmdBZGRyZXNzEhEKCXdhbGxldF9pZBgG" + + "IAIoBBIXCg9jYXBfcmVzdHJpY3Rpb24YByABKA0SGQoRYXV0aGVudGljYXRv" + + "cl9jYXAYCCABKAQSEAoIc29mdF9jYXAYCSABKAQSFAoGYWN0aXZlGAogASgI" + + "OgR0cnVlImMKGUdldFBheW1lbnRNZXRob2RzUmVzcG9uc2USRgoHbWV0aG9k" + + "cxgBIAMoCzI1LmJuZXQucHJvdG9jb2wuZXhjaGFuZ2Vfb2JqZWN0X3Byb3Zp" + + "ZGVyLlBheW1lbnRNZXRob2RCA4ABAA=="); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_bnet_protocol_exchange_object_provider_ReportAuthorizeRequest__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_exchange_object_provider_ReportAuthorizeRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_object_provider_ReportAuthorizeRequest__Descriptor, + new string[] { "PartitionId", "Token", "Result", "AuthHandle", "DeferDelivery", "BnetAccountId", "ResultDetail", "AvsResult", "CvvResult", "NotificationExtraInfo", }); + internal__static_bnet_protocol_exchange_object_provider_ReportSettleRequest__Descriptor = Descriptor.MessageTypes[1]; + internal__static_bnet_protocol_exchange_object_provider_ReportSettleRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_object_provider_ReportSettleRequest__Descriptor, + new string[] { "PartitionId", "Token", "Result", "NotificationExtraInfo", "ResultDetail", }); + internal__static_bnet_protocol_exchange_object_provider_ReportCancelRequest__Descriptor = Descriptor.MessageTypes[2]; + internal__static_bnet_protocol_exchange_object_provider_ReportCancelRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_object_provider_ReportCancelRequest__Descriptor, + new string[] { "PartitionId", "Token", "Result", "NotificationExtraInfo", "ResultDetail", }); + internal__static_bnet_protocol_exchange_object_provider_ReportRefundRequest__Descriptor = Descriptor.MessageTypes[3]; + internal__static_bnet_protocol_exchange_object_provider_ReportRefundRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_object_provider_ReportRefundRequest__Descriptor, + new string[] { "PartitionId", "Token", "Result", "NotificationExtraInfo", "ResultDetail", }); + internal__static_bnet_protocol_exchange_object_provider_GetPaymentMethodsRequest__Descriptor = Descriptor.MessageTypes[4]; + internal__static_bnet_protocol_exchange_object_provider_GetPaymentMethodsRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_object_provider_GetPaymentMethodsRequest__Descriptor, + new string[] { "BnetAccount", "GameAccount", "Currency", "CashInOutMask", "RefreshPaymentMethodCache", "RefreshEBalanceCache", "SmsEnable", }); + internal__static_bnet_protocol_exchange_object_provider_PaymentMethod__Descriptor = Descriptor.MessageTypes[5]; + internal__static_bnet_protocol_exchange_object_provider_PaymentMethod__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_object_provider_PaymentMethod__Descriptor, + new string[] { "Account", "Description", "Amount", "CashInOutMask", "BillingAddress", "WalletId", "CapRestriction", "AuthenticatorCap", "SoftCap", "Active", }); + internal__static_bnet_protocol_exchange_object_provider_GetPaymentMethodsResponse__Descriptor = Descriptor.MessageTypes[6]; + internal__static_bnet_protocol_exchange_object_provider_GetPaymentMethodsResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_object_provider_GetPaymentMethodsResponse__Descriptor, + new string[] { "Methods", }); + return null; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::bnet.protocol.Entity.Descriptor, + global::bnet.protocol.exchange.Exchange.Descriptor, + }, assigner); + } + #endregion + + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ReportAuthorizeRequest : pb::GeneratedMessage { + private ReportAuthorizeRequest() { } + private static readonly ReportAuthorizeRequest defaultInstance = new ReportAuthorizeRequest().MakeReadOnly(); + private static readonly string[] _reportAuthorizeRequestFieldNames = new string[] { "auth_handle", "avs_result", "bnet_account_id", "cvv_result", "defer_delivery", "notification_extra_info", "partition_id", "result", "result_detail", "token" }; + private static readonly uint[] _reportAuthorizeRequestFieldTags = new uint[] { 34, 66, 50, 74, 40, 82, 10, 24, 58, 18 }; + public static ReportAuthorizeRequest DefaultInstance { + get { return defaultInstance; } + } + + public override ReportAuthorizeRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ReportAuthorizeRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange_object_provider.ExchangeObjectProviderTypes.internal__static_bnet_protocol_exchange_object_provider_ReportAuthorizeRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange_object_provider.ExchangeObjectProviderTypes.internal__static_bnet_protocol_exchange_object_provider_ReportAuthorizeRequest__FieldAccessorTable; } + } + + public const int PartitionIdFieldNumber = 1; + private bool hasPartitionId; + private global::bnet.protocol.exchange.PartitionId partitionId_; + public bool HasPartitionId { + get { return hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int TokenFieldNumber = 2; + private bool hasToken; + private global::bnet.protocol.exchange.PartitionId token_; + public bool HasToken { + get { return hasToken; } + } + public global::bnet.protocol.exchange.PartitionId Token { + get { return token_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int ResultFieldNumber = 3; + private bool hasResult; + private ulong result_; + public bool HasResult { + get { return hasResult; } + } + public ulong Result { + get { return result_; } + } + + public const int AuthHandleFieldNumber = 4; + private bool hasAuthHandle; + private global::bnet.protocol.exchange.BlobFromOfType authHandle_; + public bool HasAuthHandle { + get { return hasAuthHandle; } + } + public global::bnet.protocol.exchange.BlobFromOfType AuthHandle { + get { return authHandle_ ?? global::bnet.protocol.exchange.BlobFromOfType.DefaultInstance; } + } + + public const int DeferDeliveryFieldNumber = 5; + private bool hasDeferDelivery; + private bool deferDelivery_; + public bool HasDeferDelivery { + get { return hasDeferDelivery; } + } + public bool DeferDelivery { + get { return deferDelivery_; } + } + + public const int BnetAccountIdFieldNumber = 6; + private bool hasBnetAccountId; + private global::bnet.protocol.EntityId bnetAccountId_; + public bool HasBnetAccountId { + get { return hasBnetAccountId; } + } + public global::bnet.protocol.EntityId BnetAccountId { + get { return bnetAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int ResultDetailFieldNumber = 7; + private bool hasResultDetail; + private global::bnet.protocol.exchange.ActionResultDetail resultDetail_; + public bool HasResultDetail { + get { return hasResultDetail; } + } + public global::bnet.protocol.exchange.ActionResultDetail ResultDetail { + get { return resultDetail_ ?? global::bnet.protocol.exchange.ActionResultDetail.DefaultInstance; } + } + + public const int AvsResultFieldNumber = 8; + private bool hasAvsResult; + private string avsResult_ = ""; + public bool HasAvsResult { + get { return hasAvsResult; } + } + public string AvsResult { + get { return avsResult_; } + } + + public const int CvvResultFieldNumber = 9; + private bool hasCvvResult; + private string cvvResult_ = ""; + public bool HasCvvResult { + get { return hasCvvResult; } + } + public string CvvResult { + get { return cvvResult_; } + } + + public const int NotificationExtraInfoFieldNumber = 10; + private bool hasNotificationExtraInfo; + private global::bnet.protocol.exchange.BlobFrom notificationExtraInfo_; + public bool HasNotificationExtraInfo { + get { return hasNotificationExtraInfo; } + } + public global::bnet.protocol.exchange.BlobFrom NotificationExtraInfo { + get { return notificationExtraInfo_ ?? global::bnet.protocol.exchange.BlobFrom.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasPartitionId) return false; + if (!hasToken) return false; + if (!hasResult) return false; + if (!hasBnetAccountId) return false; + if (!PartitionId.IsInitialized) return false; + if (!Token.IsInitialized) return false; + if (HasAuthHandle) { + if (!AuthHandle.IsInitialized) return false; + } + if (!BnetAccountId.IsInitialized) return false; + if (HasResultDetail) { + if (!ResultDetail.IsInitialized) return false; + } + if (HasNotificationExtraInfo) { + if (!NotificationExtraInfo.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _reportAuthorizeRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[6], PartitionId); + } + if (hasToken) { + output.WriteMessage(2, field_names[9], Token); + } + if (hasResult) { + output.WriteUInt64(3, field_names[7], Result); + } + if (hasAuthHandle) { + output.WriteMessage(4, field_names[0], AuthHandle); + } + if (hasDeferDelivery) { + output.WriteBool(5, field_names[4], DeferDelivery); + } + if (hasBnetAccountId) { + output.WriteMessage(6, field_names[2], BnetAccountId); + } + if (hasResultDetail) { + output.WriteMessage(7, field_names[8], ResultDetail); + } + if (hasAvsResult) { + output.WriteString(8, field_names[1], AvsResult); + } + if (hasCvvResult) { + output.WriteString(9, field_names[3], CvvResult); + } + if (hasNotificationExtraInfo) { + output.WriteMessage(10, field_names[5], NotificationExtraInfo); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); + } + if (hasToken) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Token); + } + if (hasResult) { + size += pb::CodedOutputStream.ComputeUInt64Size(3, Result); + } + if (hasAuthHandle) { + size += pb::CodedOutputStream.ComputeMessageSize(4, AuthHandle); + } + if (hasDeferDelivery) { + size += pb::CodedOutputStream.ComputeBoolSize(5, DeferDelivery); + } + if (hasBnetAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(6, BnetAccountId); + } + if (hasResultDetail) { + size += pb::CodedOutputStream.ComputeMessageSize(7, ResultDetail); + } + if (hasAvsResult) { + size += pb::CodedOutputStream.ComputeStringSize(8, AvsResult); + } + if (hasCvvResult) { + size += pb::CodedOutputStream.ComputeStringSize(9, CvvResult); + } + if (hasNotificationExtraInfo) { + size += pb::CodedOutputStream.ComputeMessageSize(10, NotificationExtraInfo); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ReportAuthorizeRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ReportAuthorizeRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ReportAuthorizeRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ReportAuthorizeRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ReportAuthorizeRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ReportAuthorizeRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ReportAuthorizeRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ReportAuthorizeRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ReportAuthorizeRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ReportAuthorizeRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ReportAuthorizeRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ReportAuthorizeRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ReportAuthorizeRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ReportAuthorizeRequest result; + + private ReportAuthorizeRequest PrepareBuilder() { + if (resultIsReadOnly) { + ReportAuthorizeRequest original = result; + result = new ReportAuthorizeRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ReportAuthorizeRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange_object_provider.ReportAuthorizeRequest.Descriptor; } + } + + public override ReportAuthorizeRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange_object_provider.ReportAuthorizeRequest.DefaultInstance; } + } + + public override ReportAuthorizeRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ReportAuthorizeRequest) { + return MergeFrom((ReportAuthorizeRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ReportAuthorizeRequest other) { + if (other == global::bnet.protocol.exchange_object_provider.ReportAuthorizeRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasPartitionId) { + MergePartitionId(other.PartitionId); + } + if (other.HasToken) { + MergeToken(other.Token); + } + if (other.HasResult) { + Result = other.Result; + } + if (other.HasAuthHandle) { + MergeAuthHandle(other.AuthHandle); + } + if (other.HasDeferDelivery) { + DeferDelivery = other.DeferDelivery; + } + if (other.HasBnetAccountId) { + MergeBnetAccountId(other.BnetAccountId); + } + if (other.HasResultDetail) { + MergeResultDetail(other.ResultDetail); + } + if (other.HasAvsResult) { + AvsResult = other.AvsResult; + } + if (other.HasCvvResult) { + CvvResult = other.CvvResult; + } + if (other.HasNotificationExtraInfo) { + MergeNotificationExtraInfo(other.NotificationExtraInfo); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_reportAuthorizeRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _reportAuthorizeRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasPartitionId) { + subBuilder.MergeFrom(PartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + PartitionId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasToken) { + subBuilder.MergeFrom(Token); + } + input.ReadMessage(subBuilder, extensionRegistry); + Token = subBuilder.BuildPartial(); + break; + } + case 24: { + result.hasResult = input.ReadUInt64(ref result.result_); + break; + } + case 34: { + global::bnet.protocol.exchange.BlobFromOfType.Builder subBuilder = global::bnet.protocol.exchange.BlobFromOfType.CreateBuilder(); + if (result.hasAuthHandle) { + subBuilder.MergeFrom(AuthHandle); + } + input.ReadMessage(subBuilder, extensionRegistry); + AuthHandle = subBuilder.BuildPartial(); + break; + } + case 40: { + result.hasDeferDelivery = input.ReadBool(ref result.deferDelivery_); + break; + } + case 50: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasBnetAccountId) { + subBuilder.MergeFrom(BnetAccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + BnetAccountId = subBuilder.BuildPartial(); + break; + } + case 58: { + global::bnet.protocol.exchange.ActionResultDetail.Builder subBuilder = global::bnet.protocol.exchange.ActionResultDetail.CreateBuilder(); + if (result.hasResultDetail) { + subBuilder.MergeFrom(ResultDetail); + } + input.ReadMessage(subBuilder, extensionRegistry); + ResultDetail = subBuilder.BuildPartial(); + break; + } + case 66: { + result.hasAvsResult = input.ReadString(ref result.avsResult_); + break; + } + case 74: { + result.hasCvvResult = input.ReadString(ref result.cvvResult_); + break; + } + case 82: { + global::bnet.protocol.exchange.BlobFrom.Builder subBuilder = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(); + if (result.hasNotificationExtraInfo) { + subBuilder.MergeFrom(NotificationExtraInfo); + } + input.ReadMessage(subBuilder, extensionRegistry); + NotificationExtraInfo = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasPartitionId { + get { return result.hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = value; + return this; + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = builderForValue.Build(); + return this; + } + public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasPartitionId && + result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); + } else { + result.partitionId_ = value; + } + result.hasPartitionId = true; + return this; + } + public Builder ClearPartitionId() { + PrepareBuilder(); + result.hasPartitionId = false; + result.partitionId_ = null; + return this; + } + + public bool HasToken { + get { return result.hasToken; } + } + public global::bnet.protocol.exchange.PartitionId Token { + get { return result.Token; } + set { SetToken(value); } + } + public Builder SetToken(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasToken = true; + result.token_ = value; + return this; + } + public Builder SetToken(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasToken = true; + result.token_ = builderForValue.Build(); + return this; + } + public Builder MergeToken(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasToken && + result.token_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.token_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.token_).MergeFrom(value).BuildPartial(); + } else { + result.token_ = value; + } + result.hasToken = true; + return this; + } + public Builder ClearToken() { + PrepareBuilder(); + result.hasToken = false; + result.token_ = null; + return this; + } + + public bool HasResult { + get { return result.hasResult; } + } + public ulong Result { + get { return result.Result; } + set { SetResult(value); } + } + public Builder SetResult(ulong value) { + PrepareBuilder(); + result.hasResult = true; + result.result_ = value; + return this; + } + public Builder ClearResult() { + PrepareBuilder(); + result.hasResult = false; + result.result_ = 0UL; + return this; + } + + public bool HasAuthHandle { + get { return result.hasAuthHandle; } + } + public global::bnet.protocol.exchange.BlobFromOfType AuthHandle { + get { return result.AuthHandle; } + set { SetAuthHandle(value); } + } + public Builder SetAuthHandle(global::bnet.protocol.exchange.BlobFromOfType value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAuthHandle = true; + result.authHandle_ = value; + return this; + } + public Builder SetAuthHandle(global::bnet.protocol.exchange.BlobFromOfType.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAuthHandle = true; + result.authHandle_ = builderForValue.Build(); + return this; + } + public Builder MergeAuthHandle(global::bnet.protocol.exchange.BlobFromOfType value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAuthHandle && + result.authHandle_ != global::bnet.protocol.exchange.BlobFromOfType.DefaultInstance) { + result.authHandle_ = global::bnet.protocol.exchange.BlobFromOfType.CreateBuilder(result.authHandle_).MergeFrom(value).BuildPartial(); + } else { + result.authHandle_ = value; + } + result.hasAuthHandle = true; + return this; + } + public Builder ClearAuthHandle() { + PrepareBuilder(); + result.hasAuthHandle = false; + result.authHandle_ = null; + return this; + } + + public bool HasDeferDelivery { + get { return result.hasDeferDelivery; } + } + public bool DeferDelivery { + get { return result.DeferDelivery; } + set { SetDeferDelivery(value); } + } + public Builder SetDeferDelivery(bool value) { + PrepareBuilder(); + result.hasDeferDelivery = true; + result.deferDelivery_ = value; + return this; + } + public Builder ClearDeferDelivery() { + PrepareBuilder(); + result.hasDeferDelivery = false; + result.deferDelivery_ = false; + return this; + } + + public bool HasBnetAccountId { + get { return result.hasBnetAccountId; } + } + public global::bnet.protocol.EntityId BnetAccountId { + get { return result.BnetAccountId; } + set { SetBnetAccountId(value); } + } + public Builder SetBnetAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBnetAccountId = true; + result.bnetAccountId_ = value; + return this; + } + public Builder SetBnetAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBnetAccountId = true; + result.bnetAccountId_ = builderForValue.Build(); + return this; + } + public Builder MergeBnetAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBnetAccountId && + result.bnetAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.bnetAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccountId_).MergeFrom(value).BuildPartial(); + } else { + result.bnetAccountId_ = value; + } + result.hasBnetAccountId = true; + return this; + } + public Builder ClearBnetAccountId() { + PrepareBuilder(); + result.hasBnetAccountId = false; + result.bnetAccountId_ = null; + return this; + } + + public bool HasResultDetail { + get { return result.hasResultDetail; } + } + public global::bnet.protocol.exchange.ActionResultDetail ResultDetail { + get { return result.ResultDetail; } + set { SetResultDetail(value); } + } + public Builder SetResultDetail(global::bnet.protocol.exchange.ActionResultDetail value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasResultDetail = true; + result.resultDetail_ = value; + return this; + } + public Builder SetResultDetail(global::bnet.protocol.exchange.ActionResultDetail.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasResultDetail = true; + result.resultDetail_ = builderForValue.Build(); + return this; + } + public Builder MergeResultDetail(global::bnet.protocol.exchange.ActionResultDetail value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasResultDetail && + result.resultDetail_ != global::bnet.protocol.exchange.ActionResultDetail.DefaultInstance) { + result.resultDetail_ = global::bnet.protocol.exchange.ActionResultDetail.CreateBuilder(result.resultDetail_).MergeFrom(value).BuildPartial(); + } else { + result.resultDetail_ = value; + } + result.hasResultDetail = true; + return this; + } + public Builder ClearResultDetail() { + PrepareBuilder(); + result.hasResultDetail = false; + result.resultDetail_ = null; + return this; + } + + public bool HasAvsResult { + get { return result.hasAvsResult; } + } + public string AvsResult { + get { return result.AvsResult; } + set { SetAvsResult(value); } + } + public Builder SetAvsResult(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAvsResult = true; + result.avsResult_ = value; + return this; + } + public Builder ClearAvsResult() { + PrepareBuilder(); + result.hasAvsResult = false; + result.avsResult_ = ""; + return this; + } + + public bool HasCvvResult { + get { return result.hasCvvResult; } + } + public string CvvResult { + get { return result.CvvResult; } + set { SetCvvResult(value); } + } + public Builder SetCvvResult(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasCvvResult = true; + result.cvvResult_ = value; + return this; + } + public Builder ClearCvvResult() { + PrepareBuilder(); + result.hasCvvResult = false; + result.cvvResult_ = ""; + return this; + } + + public bool HasNotificationExtraInfo { + get { return result.hasNotificationExtraInfo; } + } + public global::bnet.protocol.exchange.BlobFrom NotificationExtraInfo { + get { return result.NotificationExtraInfo; } + set { SetNotificationExtraInfo(value); } + } + public Builder SetNotificationExtraInfo(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasNotificationExtraInfo = true; + result.notificationExtraInfo_ = value; + return this; + } + public Builder SetNotificationExtraInfo(global::bnet.protocol.exchange.BlobFrom.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasNotificationExtraInfo = true; + result.notificationExtraInfo_ = builderForValue.Build(); + return this; + } + public Builder MergeNotificationExtraInfo(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasNotificationExtraInfo && + result.notificationExtraInfo_ != global::bnet.protocol.exchange.BlobFrom.DefaultInstance) { + result.notificationExtraInfo_ = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(result.notificationExtraInfo_).MergeFrom(value).BuildPartial(); + } else { + result.notificationExtraInfo_ = value; + } + result.hasNotificationExtraInfo = true; + return this; + } + public Builder ClearNotificationExtraInfo() { + PrepareBuilder(); + result.hasNotificationExtraInfo = false; + result.notificationExtraInfo_ = null; + return this; + } + } + static ReportAuthorizeRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange_object_provider.ExchangeObjectProviderTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ReportSettleRequest : pb::GeneratedMessage { + private ReportSettleRequest() { } + private static readonly ReportSettleRequest defaultInstance = new ReportSettleRequest().MakeReadOnly(); + private static readonly string[] _reportSettleRequestFieldNames = new string[] { "notification_extra_info", "partition_id", "result", "result_detail", "token" }; + private static readonly uint[] _reportSettleRequestFieldTags = new uint[] { 34, 10, 24, 42, 18 }; + public static ReportSettleRequest DefaultInstance { + get { return defaultInstance; } + } + + public override ReportSettleRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ReportSettleRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange_object_provider.ExchangeObjectProviderTypes.internal__static_bnet_protocol_exchange_object_provider_ReportSettleRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange_object_provider.ExchangeObjectProviderTypes.internal__static_bnet_protocol_exchange_object_provider_ReportSettleRequest__FieldAccessorTable; } + } + + public const int PartitionIdFieldNumber = 1; + private bool hasPartitionId; + private global::bnet.protocol.exchange.PartitionId partitionId_; + public bool HasPartitionId { + get { return hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int TokenFieldNumber = 2; + private bool hasToken; + private global::bnet.protocol.exchange.PartitionId token_; + public bool HasToken { + get { return hasToken; } + } + public global::bnet.protocol.exchange.PartitionId Token { + get { return token_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int ResultFieldNumber = 3; + private bool hasResult; + private ulong result_; + public bool HasResult { + get { return hasResult; } + } + public ulong Result { + get { return result_; } + } + + public const int NotificationExtraInfoFieldNumber = 4; + private bool hasNotificationExtraInfo; + private global::bnet.protocol.exchange.BlobFrom notificationExtraInfo_; + public bool HasNotificationExtraInfo { + get { return hasNotificationExtraInfo; } + } + public global::bnet.protocol.exchange.BlobFrom NotificationExtraInfo { + get { return notificationExtraInfo_ ?? global::bnet.protocol.exchange.BlobFrom.DefaultInstance; } + } + + public const int ResultDetailFieldNumber = 5; + private bool hasResultDetail; + private global::bnet.protocol.exchange.ActionResultDetail resultDetail_; + public bool HasResultDetail { + get { return hasResultDetail; } + } + public global::bnet.protocol.exchange.ActionResultDetail ResultDetail { + get { return resultDetail_ ?? global::bnet.protocol.exchange.ActionResultDetail.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasPartitionId) return false; + if (!hasToken) return false; + if (!hasResult) return false; + if (!PartitionId.IsInitialized) return false; + if (!Token.IsInitialized) return false; + if (HasNotificationExtraInfo) { + if (!NotificationExtraInfo.IsInitialized) return false; + } + if (HasResultDetail) { + if (!ResultDetail.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _reportSettleRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[1], PartitionId); + } + if (hasToken) { + output.WriteMessage(2, field_names[4], Token); + } + if (hasResult) { + output.WriteUInt64(3, field_names[2], Result); + } + if (hasNotificationExtraInfo) { + output.WriteMessage(4, field_names[0], NotificationExtraInfo); + } + if (hasResultDetail) { + output.WriteMessage(5, field_names[3], ResultDetail); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); + } + if (hasToken) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Token); + } + if (hasResult) { + size += pb::CodedOutputStream.ComputeUInt64Size(3, Result); + } + if (hasNotificationExtraInfo) { + size += pb::CodedOutputStream.ComputeMessageSize(4, NotificationExtraInfo); + } + if (hasResultDetail) { + size += pb::CodedOutputStream.ComputeMessageSize(5, ResultDetail); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ReportSettleRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ReportSettleRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ReportSettleRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ReportSettleRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ReportSettleRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ReportSettleRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ReportSettleRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ReportSettleRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ReportSettleRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ReportSettleRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ReportSettleRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ReportSettleRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ReportSettleRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ReportSettleRequest result; + + private ReportSettleRequest PrepareBuilder() { + if (resultIsReadOnly) { + ReportSettleRequest original = result; + result = new ReportSettleRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ReportSettleRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange_object_provider.ReportSettleRequest.Descriptor; } + } + + public override ReportSettleRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange_object_provider.ReportSettleRequest.DefaultInstance; } + } + + public override ReportSettleRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ReportSettleRequest) { + return MergeFrom((ReportSettleRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ReportSettleRequest other) { + if (other == global::bnet.protocol.exchange_object_provider.ReportSettleRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasPartitionId) { + MergePartitionId(other.PartitionId); + } + if (other.HasToken) { + MergeToken(other.Token); + } + if (other.HasResult) { + Result = other.Result; + } + if (other.HasNotificationExtraInfo) { + MergeNotificationExtraInfo(other.NotificationExtraInfo); + } + if (other.HasResultDetail) { + MergeResultDetail(other.ResultDetail); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_reportSettleRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _reportSettleRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasPartitionId) { + subBuilder.MergeFrom(PartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + PartitionId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasToken) { + subBuilder.MergeFrom(Token); + } + input.ReadMessage(subBuilder, extensionRegistry); + Token = subBuilder.BuildPartial(); + break; + } + case 24: { + result.hasResult = input.ReadUInt64(ref result.result_); + break; + } + case 34: { + global::bnet.protocol.exchange.BlobFrom.Builder subBuilder = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(); + if (result.hasNotificationExtraInfo) { + subBuilder.MergeFrom(NotificationExtraInfo); + } + input.ReadMessage(subBuilder, extensionRegistry); + NotificationExtraInfo = subBuilder.BuildPartial(); + break; + } + case 42: { + global::bnet.protocol.exchange.ActionResultDetail.Builder subBuilder = global::bnet.protocol.exchange.ActionResultDetail.CreateBuilder(); + if (result.hasResultDetail) { + subBuilder.MergeFrom(ResultDetail); + } + input.ReadMessage(subBuilder, extensionRegistry); + ResultDetail = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasPartitionId { + get { return result.hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = value; + return this; + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = builderForValue.Build(); + return this; + } + public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasPartitionId && + result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); + } else { + result.partitionId_ = value; + } + result.hasPartitionId = true; + return this; + } + public Builder ClearPartitionId() { + PrepareBuilder(); + result.hasPartitionId = false; + result.partitionId_ = null; + return this; + } + + public bool HasToken { + get { return result.hasToken; } + } + public global::bnet.protocol.exchange.PartitionId Token { + get { return result.Token; } + set { SetToken(value); } + } + public Builder SetToken(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasToken = true; + result.token_ = value; + return this; + } + public Builder SetToken(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasToken = true; + result.token_ = builderForValue.Build(); + return this; + } + public Builder MergeToken(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasToken && + result.token_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.token_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.token_).MergeFrom(value).BuildPartial(); + } else { + result.token_ = value; + } + result.hasToken = true; + return this; + } + public Builder ClearToken() { + PrepareBuilder(); + result.hasToken = false; + result.token_ = null; + return this; + } + + public bool HasResult { + get { return result.hasResult; } + } + public ulong Result { + get { return result.Result; } + set { SetResult(value); } + } + public Builder SetResult(ulong value) { + PrepareBuilder(); + result.hasResult = true; + result.result_ = value; + return this; + } + public Builder ClearResult() { + PrepareBuilder(); + result.hasResult = false; + result.result_ = 0UL; + return this; + } + + public bool HasNotificationExtraInfo { + get { return result.hasNotificationExtraInfo; } + } + public global::bnet.protocol.exchange.BlobFrom NotificationExtraInfo { + get { return result.NotificationExtraInfo; } + set { SetNotificationExtraInfo(value); } + } + public Builder SetNotificationExtraInfo(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasNotificationExtraInfo = true; + result.notificationExtraInfo_ = value; + return this; + } + public Builder SetNotificationExtraInfo(global::bnet.protocol.exchange.BlobFrom.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasNotificationExtraInfo = true; + result.notificationExtraInfo_ = builderForValue.Build(); + return this; + } + public Builder MergeNotificationExtraInfo(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasNotificationExtraInfo && + result.notificationExtraInfo_ != global::bnet.protocol.exchange.BlobFrom.DefaultInstance) { + result.notificationExtraInfo_ = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(result.notificationExtraInfo_).MergeFrom(value).BuildPartial(); + } else { + result.notificationExtraInfo_ = value; + } + result.hasNotificationExtraInfo = true; + return this; + } + public Builder ClearNotificationExtraInfo() { + PrepareBuilder(); + result.hasNotificationExtraInfo = false; + result.notificationExtraInfo_ = null; + return this; + } + + public bool HasResultDetail { + get { return result.hasResultDetail; } + } + public global::bnet.protocol.exchange.ActionResultDetail ResultDetail { + get { return result.ResultDetail; } + set { SetResultDetail(value); } + } + public Builder SetResultDetail(global::bnet.protocol.exchange.ActionResultDetail value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasResultDetail = true; + result.resultDetail_ = value; + return this; + } + public Builder SetResultDetail(global::bnet.protocol.exchange.ActionResultDetail.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasResultDetail = true; + result.resultDetail_ = builderForValue.Build(); + return this; + } + public Builder MergeResultDetail(global::bnet.protocol.exchange.ActionResultDetail value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasResultDetail && + result.resultDetail_ != global::bnet.protocol.exchange.ActionResultDetail.DefaultInstance) { + result.resultDetail_ = global::bnet.protocol.exchange.ActionResultDetail.CreateBuilder(result.resultDetail_).MergeFrom(value).BuildPartial(); + } else { + result.resultDetail_ = value; + } + result.hasResultDetail = true; + return this; + } + public Builder ClearResultDetail() { + PrepareBuilder(); + result.hasResultDetail = false; + result.resultDetail_ = null; + return this; + } + } + static ReportSettleRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange_object_provider.ExchangeObjectProviderTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ReportCancelRequest : pb::GeneratedMessage { + private ReportCancelRequest() { } + private static readonly ReportCancelRequest defaultInstance = new ReportCancelRequest().MakeReadOnly(); + private static readonly string[] _reportCancelRequestFieldNames = new string[] { "notification_extra_info", "partition_id", "result", "result_detail", "token" }; + private static readonly uint[] _reportCancelRequestFieldTags = new uint[] { 34, 10, 24, 42, 18 }; + public static ReportCancelRequest DefaultInstance { + get { return defaultInstance; } + } + + public override ReportCancelRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ReportCancelRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange_object_provider.ExchangeObjectProviderTypes.internal__static_bnet_protocol_exchange_object_provider_ReportCancelRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange_object_provider.ExchangeObjectProviderTypes.internal__static_bnet_protocol_exchange_object_provider_ReportCancelRequest__FieldAccessorTable; } + } + + public const int PartitionIdFieldNumber = 1; + private bool hasPartitionId; + private global::bnet.protocol.exchange.PartitionId partitionId_; + public bool HasPartitionId { + get { return hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int TokenFieldNumber = 2; + private bool hasToken; + private global::bnet.protocol.exchange.PartitionId token_; + public bool HasToken { + get { return hasToken; } + } + public global::bnet.protocol.exchange.PartitionId Token { + get { return token_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int ResultFieldNumber = 3; + private bool hasResult; + private ulong result_; + public bool HasResult { + get { return hasResult; } + } + public ulong Result { + get { return result_; } + } + + public const int NotificationExtraInfoFieldNumber = 4; + private bool hasNotificationExtraInfo; + private global::bnet.protocol.exchange.BlobFrom notificationExtraInfo_; + public bool HasNotificationExtraInfo { + get { return hasNotificationExtraInfo; } + } + public global::bnet.protocol.exchange.BlobFrom NotificationExtraInfo { + get { return notificationExtraInfo_ ?? global::bnet.protocol.exchange.BlobFrom.DefaultInstance; } + } + + public const int ResultDetailFieldNumber = 5; + private bool hasResultDetail; + private global::bnet.protocol.exchange.ActionResultDetail resultDetail_; + public bool HasResultDetail { + get { return hasResultDetail; } + } + public global::bnet.protocol.exchange.ActionResultDetail ResultDetail { + get { return resultDetail_ ?? global::bnet.protocol.exchange.ActionResultDetail.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasPartitionId) return false; + if (!hasToken) return false; + if (!hasResult) return false; + if (!PartitionId.IsInitialized) return false; + if (!Token.IsInitialized) return false; + if (HasNotificationExtraInfo) { + if (!NotificationExtraInfo.IsInitialized) return false; + } + if (HasResultDetail) { + if (!ResultDetail.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _reportCancelRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[1], PartitionId); + } + if (hasToken) { + output.WriteMessage(2, field_names[4], Token); + } + if (hasResult) { + output.WriteUInt64(3, field_names[2], Result); + } + if (hasNotificationExtraInfo) { + output.WriteMessage(4, field_names[0], NotificationExtraInfo); + } + if (hasResultDetail) { + output.WriteMessage(5, field_names[3], ResultDetail); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); + } + if (hasToken) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Token); + } + if (hasResult) { + size += pb::CodedOutputStream.ComputeUInt64Size(3, Result); + } + if (hasNotificationExtraInfo) { + size += pb::CodedOutputStream.ComputeMessageSize(4, NotificationExtraInfo); + } + if (hasResultDetail) { + size += pb::CodedOutputStream.ComputeMessageSize(5, ResultDetail); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ReportCancelRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ReportCancelRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ReportCancelRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ReportCancelRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ReportCancelRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ReportCancelRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ReportCancelRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ReportCancelRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ReportCancelRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ReportCancelRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ReportCancelRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ReportCancelRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ReportCancelRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ReportCancelRequest result; + + private ReportCancelRequest PrepareBuilder() { + if (resultIsReadOnly) { + ReportCancelRequest original = result; + result = new ReportCancelRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ReportCancelRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange_object_provider.ReportCancelRequest.Descriptor; } + } + + public override ReportCancelRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange_object_provider.ReportCancelRequest.DefaultInstance; } + } + + public override ReportCancelRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ReportCancelRequest) { + return MergeFrom((ReportCancelRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ReportCancelRequest other) { + if (other == global::bnet.protocol.exchange_object_provider.ReportCancelRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasPartitionId) { + MergePartitionId(other.PartitionId); + } + if (other.HasToken) { + MergeToken(other.Token); + } + if (other.HasResult) { + Result = other.Result; + } + if (other.HasNotificationExtraInfo) { + MergeNotificationExtraInfo(other.NotificationExtraInfo); + } + if (other.HasResultDetail) { + MergeResultDetail(other.ResultDetail); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_reportCancelRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _reportCancelRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasPartitionId) { + subBuilder.MergeFrom(PartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + PartitionId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasToken) { + subBuilder.MergeFrom(Token); + } + input.ReadMessage(subBuilder, extensionRegistry); + Token = subBuilder.BuildPartial(); + break; + } + case 24: { + result.hasResult = input.ReadUInt64(ref result.result_); + break; + } + case 34: { + global::bnet.protocol.exchange.BlobFrom.Builder subBuilder = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(); + if (result.hasNotificationExtraInfo) { + subBuilder.MergeFrom(NotificationExtraInfo); + } + input.ReadMessage(subBuilder, extensionRegistry); + NotificationExtraInfo = subBuilder.BuildPartial(); + break; + } + case 42: { + global::bnet.protocol.exchange.ActionResultDetail.Builder subBuilder = global::bnet.protocol.exchange.ActionResultDetail.CreateBuilder(); + if (result.hasResultDetail) { + subBuilder.MergeFrom(ResultDetail); + } + input.ReadMessage(subBuilder, extensionRegistry); + ResultDetail = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasPartitionId { + get { return result.hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = value; + return this; + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = builderForValue.Build(); + return this; + } + public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasPartitionId && + result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); + } else { + result.partitionId_ = value; + } + result.hasPartitionId = true; + return this; + } + public Builder ClearPartitionId() { + PrepareBuilder(); + result.hasPartitionId = false; + result.partitionId_ = null; + return this; + } + + public bool HasToken { + get { return result.hasToken; } + } + public global::bnet.protocol.exchange.PartitionId Token { + get { return result.Token; } + set { SetToken(value); } + } + public Builder SetToken(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasToken = true; + result.token_ = value; + return this; + } + public Builder SetToken(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasToken = true; + result.token_ = builderForValue.Build(); + return this; + } + public Builder MergeToken(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasToken && + result.token_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.token_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.token_).MergeFrom(value).BuildPartial(); + } else { + result.token_ = value; + } + result.hasToken = true; + return this; + } + public Builder ClearToken() { + PrepareBuilder(); + result.hasToken = false; + result.token_ = null; + return this; + } + + public bool HasResult { + get { return result.hasResult; } + } + public ulong Result { + get { return result.Result; } + set { SetResult(value); } + } + public Builder SetResult(ulong value) { + PrepareBuilder(); + result.hasResult = true; + result.result_ = value; + return this; + } + public Builder ClearResult() { + PrepareBuilder(); + result.hasResult = false; + result.result_ = 0UL; + return this; + } + + public bool HasNotificationExtraInfo { + get { return result.hasNotificationExtraInfo; } + } + public global::bnet.protocol.exchange.BlobFrom NotificationExtraInfo { + get { return result.NotificationExtraInfo; } + set { SetNotificationExtraInfo(value); } + } + public Builder SetNotificationExtraInfo(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasNotificationExtraInfo = true; + result.notificationExtraInfo_ = value; + return this; + } + public Builder SetNotificationExtraInfo(global::bnet.protocol.exchange.BlobFrom.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasNotificationExtraInfo = true; + result.notificationExtraInfo_ = builderForValue.Build(); + return this; + } + public Builder MergeNotificationExtraInfo(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasNotificationExtraInfo && + result.notificationExtraInfo_ != global::bnet.protocol.exchange.BlobFrom.DefaultInstance) { + result.notificationExtraInfo_ = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(result.notificationExtraInfo_).MergeFrom(value).BuildPartial(); + } else { + result.notificationExtraInfo_ = value; + } + result.hasNotificationExtraInfo = true; + return this; + } + public Builder ClearNotificationExtraInfo() { + PrepareBuilder(); + result.hasNotificationExtraInfo = false; + result.notificationExtraInfo_ = null; + return this; + } + + public bool HasResultDetail { + get { return result.hasResultDetail; } + } + public global::bnet.protocol.exchange.ActionResultDetail ResultDetail { + get { return result.ResultDetail; } + set { SetResultDetail(value); } + } + public Builder SetResultDetail(global::bnet.protocol.exchange.ActionResultDetail value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasResultDetail = true; + result.resultDetail_ = value; + return this; + } + public Builder SetResultDetail(global::bnet.protocol.exchange.ActionResultDetail.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasResultDetail = true; + result.resultDetail_ = builderForValue.Build(); + return this; + } + public Builder MergeResultDetail(global::bnet.protocol.exchange.ActionResultDetail value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasResultDetail && + result.resultDetail_ != global::bnet.protocol.exchange.ActionResultDetail.DefaultInstance) { + result.resultDetail_ = global::bnet.protocol.exchange.ActionResultDetail.CreateBuilder(result.resultDetail_).MergeFrom(value).BuildPartial(); + } else { + result.resultDetail_ = value; + } + result.hasResultDetail = true; + return this; + } + public Builder ClearResultDetail() { + PrepareBuilder(); + result.hasResultDetail = false; + result.resultDetail_ = null; + return this; + } + } + static ReportCancelRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange_object_provider.ExchangeObjectProviderTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ReportRefundRequest : pb::GeneratedMessage { + private ReportRefundRequest() { } + private static readonly ReportRefundRequest defaultInstance = new ReportRefundRequest().MakeReadOnly(); + private static readonly string[] _reportRefundRequestFieldNames = new string[] { "notification_extra_info", "partition_id", "result", "result_detail", "token" }; + private static readonly uint[] _reportRefundRequestFieldTags = new uint[] { 34, 10, 24, 42, 18 }; + public static ReportRefundRequest DefaultInstance { + get { return defaultInstance; } + } + + public override ReportRefundRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ReportRefundRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange_object_provider.ExchangeObjectProviderTypes.internal__static_bnet_protocol_exchange_object_provider_ReportRefundRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange_object_provider.ExchangeObjectProviderTypes.internal__static_bnet_protocol_exchange_object_provider_ReportRefundRequest__FieldAccessorTable; } + } + + public const int PartitionIdFieldNumber = 1; + private bool hasPartitionId; + private global::bnet.protocol.exchange.PartitionId partitionId_; + public bool HasPartitionId { + get { return hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int TokenFieldNumber = 2; + private bool hasToken; + private global::bnet.protocol.exchange.PartitionId token_; + public bool HasToken { + get { return hasToken; } + } + public global::bnet.protocol.exchange.PartitionId Token { + get { return token_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int ResultFieldNumber = 3; + private bool hasResult; + private ulong result_; + public bool HasResult { + get { return hasResult; } + } + public ulong Result { + get { return result_; } + } + + public const int NotificationExtraInfoFieldNumber = 4; + private bool hasNotificationExtraInfo; + private global::bnet.protocol.exchange.BlobFrom notificationExtraInfo_; + public bool HasNotificationExtraInfo { + get { return hasNotificationExtraInfo; } + } + public global::bnet.protocol.exchange.BlobFrom NotificationExtraInfo { + get { return notificationExtraInfo_ ?? global::bnet.protocol.exchange.BlobFrom.DefaultInstance; } + } + + public const int ResultDetailFieldNumber = 5; + private bool hasResultDetail; + private global::bnet.protocol.exchange.ActionResultDetail resultDetail_; + public bool HasResultDetail { + get { return hasResultDetail; } + } + public global::bnet.protocol.exchange.ActionResultDetail ResultDetail { + get { return resultDetail_ ?? global::bnet.protocol.exchange.ActionResultDetail.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasPartitionId) return false; + if (!hasToken) return false; + if (!hasResult) return false; + if (!PartitionId.IsInitialized) return false; + if (!Token.IsInitialized) return false; + if (HasNotificationExtraInfo) { + if (!NotificationExtraInfo.IsInitialized) return false; + } + if (HasResultDetail) { + if (!ResultDetail.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _reportRefundRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[1], PartitionId); + } + if (hasToken) { + output.WriteMessage(2, field_names[4], Token); + } + if (hasResult) { + output.WriteUInt64(3, field_names[2], Result); + } + if (hasNotificationExtraInfo) { + output.WriteMessage(4, field_names[0], NotificationExtraInfo); + } + if (hasResultDetail) { + output.WriteMessage(5, field_names[3], ResultDetail); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); + } + if (hasToken) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Token); + } + if (hasResult) { + size += pb::CodedOutputStream.ComputeUInt64Size(3, Result); + } + if (hasNotificationExtraInfo) { + size += pb::CodedOutputStream.ComputeMessageSize(4, NotificationExtraInfo); + } + if (hasResultDetail) { + size += pb::CodedOutputStream.ComputeMessageSize(5, ResultDetail); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ReportRefundRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ReportRefundRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ReportRefundRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ReportRefundRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ReportRefundRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ReportRefundRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ReportRefundRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ReportRefundRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ReportRefundRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ReportRefundRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ReportRefundRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ReportRefundRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ReportRefundRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ReportRefundRequest result; + + private ReportRefundRequest PrepareBuilder() { + if (resultIsReadOnly) { + ReportRefundRequest original = result; + result = new ReportRefundRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ReportRefundRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange_object_provider.ReportRefundRequest.Descriptor; } + } + + public override ReportRefundRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange_object_provider.ReportRefundRequest.DefaultInstance; } + } + + public override ReportRefundRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ReportRefundRequest) { + return MergeFrom((ReportRefundRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ReportRefundRequest other) { + if (other == global::bnet.protocol.exchange_object_provider.ReportRefundRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasPartitionId) { + MergePartitionId(other.PartitionId); + } + if (other.HasToken) { + MergeToken(other.Token); + } + if (other.HasResult) { + Result = other.Result; + } + if (other.HasNotificationExtraInfo) { + MergeNotificationExtraInfo(other.NotificationExtraInfo); + } + if (other.HasResultDetail) { + MergeResultDetail(other.ResultDetail); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_reportRefundRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _reportRefundRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasPartitionId) { + subBuilder.MergeFrom(PartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + PartitionId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasToken) { + subBuilder.MergeFrom(Token); + } + input.ReadMessage(subBuilder, extensionRegistry); + Token = subBuilder.BuildPartial(); + break; + } + case 24: { + result.hasResult = input.ReadUInt64(ref result.result_); + break; + } + case 34: { + global::bnet.protocol.exchange.BlobFrom.Builder subBuilder = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(); + if (result.hasNotificationExtraInfo) { + subBuilder.MergeFrom(NotificationExtraInfo); + } + input.ReadMessage(subBuilder, extensionRegistry); + NotificationExtraInfo = subBuilder.BuildPartial(); + break; + } + case 42: { + global::bnet.protocol.exchange.ActionResultDetail.Builder subBuilder = global::bnet.protocol.exchange.ActionResultDetail.CreateBuilder(); + if (result.hasResultDetail) { + subBuilder.MergeFrom(ResultDetail); + } + input.ReadMessage(subBuilder, extensionRegistry); + ResultDetail = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasPartitionId { + get { return result.hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = value; + return this; + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = builderForValue.Build(); + return this; + } + public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasPartitionId && + result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); + } else { + result.partitionId_ = value; + } + result.hasPartitionId = true; + return this; + } + public Builder ClearPartitionId() { + PrepareBuilder(); + result.hasPartitionId = false; + result.partitionId_ = null; + return this; + } + + public bool HasToken { + get { return result.hasToken; } + } + public global::bnet.protocol.exchange.PartitionId Token { + get { return result.Token; } + set { SetToken(value); } + } + public Builder SetToken(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasToken = true; + result.token_ = value; + return this; + } + public Builder SetToken(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasToken = true; + result.token_ = builderForValue.Build(); + return this; + } + public Builder MergeToken(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasToken && + result.token_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.token_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.token_).MergeFrom(value).BuildPartial(); + } else { + result.token_ = value; + } + result.hasToken = true; + return this; + } + public Builder ClearToken() { + PrepareBuilder(); + result.hasToken = false; + result.token_ = null; + return this; + } + + public bool HasResult { + get { return result.hasResult; } + } + public ulong Result { + get { return result.Result; } + set { SetResult(value); } + } + public Builder SetResult(ulong value) { + PrepareBuilder(); + result.hasResult = true; + result.result_ = value; + return this; + } + public Builder ClearResult() { + PrepareBuilder(); + result.hasResult = false; + result.result_ = 0UL; + return this; + } + + public bool HasNotificationExtraInfo { + get { return result.hasNotificationExtraInfo; } + } + public global::bnet.protocol.exchange.BlobFrom NotificationExtraInfo { + get { return result.NotificationExtraInfo; } + set { SetNotificationExtraInfo(value); } + } + public Builder SetNotificationExtraInfo(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasNotificationExtraInfo = true; + result.notificationExtraInfo_ = value; + return this; + } + public Builder SetNotificationExtraInfo(global::bnet.protocol.exchange.BlobFrom.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasNotificationExtraInfo = true; + result.notificationExtraInfo_ = builderForValue.Build(); + return this; + } + public Builder MergeNotificationExtraInfo(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasNotificationExtraInfo && + result.notificationExtraInfo_ != global::bnet.protocol.exchange.BlobFrom.DefaultInstance) { + result.notificationExtraInfo_ = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(result.notificationExtraInfo_).MergeFrom(value).BuildPartial(); + } else { + result.notificationExtraInfo_ = value; + } + result.hasNotificationExtraInfo = true; + return this; + } + public Builder ClearNotificationExtraInfo() { + PrepareBuilder(); + result.hasNotificationExtraInfo = false; + result.notificationExtraInfo_ = null; + return this; + } + + public bool HasResultDetail { + get { return result.hasResultDetail; } + } + public global::bnet.protocol.exchange.ActionResultDetail ResultDetail { + get { return result.ResultDetail; } + set { SetResultDetail(value); } + } + public Builder SetResultDetail(global::bnet.protocol.exchange.ActionResultDetail value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasResultDetail = true; + result.resultDetail_ = value; + return this; + } + public Builder SetResultDetail(global::bnet.protocol.exchange.ActionResultDetail.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasResultDetail = true; + result.resultDetail_ = builderForValue.Build(); + return this; + } + public Builder MergeResultDetail(global::bnet.protocol.exchange.ActionResultDetail value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasResultDetail && + result.resultDetail_ != global::bnet.protocol.exchange.ActionResultDetail.DefaultInstance) { + result.resultDetail_ = global::bnet.protocol.exchange.ActionResultDetail.CreateBuilder(result.resultDetail_).MergeFrom(value).BuildPartial(); + } else { + result.resultDetail_ = value; + } + result.hasResultDetail = true; + return this; + } + public Builder ClearResultDetail() { + PrepareBuilder(); + result.hasResultDetail = false; + result.resultDetail_ = null; + return this; + } + } + static ReportRefundRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange_object_provider.ExchangeObjectProviderTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetPaymentMethodsRequest : pb::GeneratedMessage { + private GetPaymentMethodsRequest() { } + private static readonly GetPaymentMethodsRequest defaultInstance = new GetPaymentMethodsRequest().MakeReadOnly(); + private static readonly string[] _getPaymentMethodsRequestFieldNames = new string[] { "bnet_account", "cash_in_out_mask", "currency", "game_account", "refresh_e_balance_cache", "refresh_payment_method_cache", "sms_enable" }; + private static readonly uint[] _getPaymentMethodsRequestFieldTags = new uint[] { 10, 32, 26, 18, 48, 40, 56 }; + public static GetPaymentMethodsRequest DefaultInstance { + get { return defaultInstance; } + } + + public override GetPaymentMethodsRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetPaymentMethodsRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange_object_provider.ExchangeObjectProviderTypes.internal__static_bnet_protocol_exchange_object_provider_GetPaymentMethodsRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange_object_provider.ExchangeObjectProviderTypes.internal__static_bnet_protocol_exchange_object_provider_GetPaymentMethodsRequest__FieldAccessorTable; } + } + + public const int BnetAccountFieldNumber = 1; + private bool hasBnetAccount; + private global::bnet.protocol.EntityId bnetAccount_; + public bool HasBnetAccount { + get { return hasBnetAccount; } + } + public global::bnet.protocol.EntityId BnetAccount { + get { return bnetAccount_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int GameAccountFieldNumber = 2; + private bool hasGameAccount; + private global::bnet.protocol.EntityId gameAccount_; + public bool HasGameAccount { + get { return hasGameAccount; } + } + public global::bnet.protocol.EntityId GameAccount { + get { return gameAccount_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int CurrencyFieldNumber = 3; + private bool hasCurrency; + private string currency_ = ""; + public bool HasCurrency { + get { return hasCurrency; } + } + public string Currency { + get { return currency_; } + } + + public const int CashInOutMaskFieldNumber = 4; + private bool hasCashInOutMask; + private uint cashInOutMask_; + public bool HasCashInOutMask { + get { return hasCashInOutMask; } + } + public uint CashInOutMask { + get { return cashInOutMask_; } + } + + public const int RefreshPaymentMethodCacheFieldNumber = 5; + private bool hasRefreshPaymentMethodCache; + private bool refreshPaymentMethodCache_; + public bool HasRefreshPaymentMethodCache { + get { return hasRefreshPaymentMethodCache; } + } + public bool RefreshPaymentMethodCache { + get { return refreshPaymentMethodCache_; } + } + + public const int RefreshEBalanceCacheFieldNumber = 6; + private bool hasRefreshEBalanceCache; + private bool refreshEBalanceCache_; + public bool HasRefreshEBalanceCache { + get { return hasRefreshEBalanceCache; } + } + public bool RefreshEBalanceCache { + get { return refreshEBalanceCache_; } + } + + public const int SmsEnableFieldNumber = 7; + private bool hasSmsEnable; + private bool smsEnable_; + public bool HasSmsEnable { + get { return hasSmsEnable; } + } + public bool SmsEnable { + get { return smsEnable_; } + } + + public override bool IsInitialized { + get { + if (!hasCurrency) return false; + if (!hasCashInOutMask) return false; + if (HasBnetAccount) { + if (!BnetAccount.IsInitialized) return false; + } + if (HasGameAccount) { + if (!GameAccount.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getPaymentMethodsRequestFieldNames; + if (hasBnetAccount) { + output.WriteMessage(1, field_names[0], BnetAccount); + } + if (hasGameAccount) { + output.WriteMessage(2, field_names[3], GameAccount); + } + if (hasCurrency) { + output.WriteString(3, field_names[2], Currency); + } + if (hasCashInOutMask) { + output.WriteUInt32(4, field_names[1], CashInOutMask); + } + if (hasRefreshPaymentMethodCache) { + output.WriteBool(5, field_names[5], RefreshPaymentMethodCache); + } + if (hasRefreshEBalanceCache) { + output.WriteBool(6, field_names[4], RefreshEBalanceCache); + } + if (hasSmsEnable) { + output.WriteBool(7, field_names[6], SmsEnable); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasBnetAccount) { + size += pb::CodedOutputStream.ComputeMessageSize(1, BnetAccount); + } + if (hasGameAccount) { + size += pb::CodedOutputStream.ComputeMessageSize(2, GameAccount); + } + if (hasCurrency) { + size += pb::CodedOutputStream.ComputeStringSize(3, Currency); + } + if (hasCashInOutMask) { + size += pb::CodedOutputStream.ComputeUInt32Size(4, CashInOutMask); + } + if (hasRefreshPaymentMethodCache) { + size += pb::CodedOutputStream.ComputeBoolSize(5, RefreshPaymentMethodCache); + } + if (hasRefreshEBalanceCache) { + size += pb::CodedOutputStream.ComputeBoolSize(6, RefreshEBalanceCache); + } + if (hasSmsEnable) { + size += pb::CodedOutputStream.ComputeBoolSize(7, SmsEnable); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetPaymentMethodsRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetPaymentMethodsRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetPaymentMethodsRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetPaymentMethodsRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetPaymentMethodsRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetPaymentMethodsRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetPaymentMethodsRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetPaymentMethodsRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetPaymentMethodsRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetPaymentMethodsRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetPaymentMethodsRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetPaymentMethodsRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetPaymentMethodsRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetPaymentMethodsRequest result; + + private GetPaymentMethodsRequest PrepareBuilder() { + if (resultIsReadOnly) { + GetPaymentMethodsRequest original = result; + result = new GetPaymentMethodsRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetPaymentMethodsRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange_object_provider.GetPaymentMethodsRequest.Descriptor; } + } + + public override GetPaymentMethodsRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange_object_provider.GetPaymentMethodsRequest.DefaultInstance; } + } + + public override GetPaymentMethodsRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetPaymentMethodsRequest) { + return MergeFrom((GetPaymentMethodsRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetPaymentMethodsRequest other) { + if (other == global::bnet.protocol.exchange_object_provider.GetPaymentMethodsRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasBnetAccount) { + MergeBnetAccount(other.BnetAccount); + } + if (other.HasGameAccount) { + MergeGameAccount(other.GameAccount); + } + if (other.HasCurrency) { + Currency = other.Currency; + } + if (other.HasCashInOutMask) { + CashInOutMask = other.CashInOutMask; + } + if (other.HasRefreshPaymentMethodCache) { + RefreshPaymentMethodCache = other.RefreshPaymentMethodCache; + } + if (other.HasRefreshEBalanceCache) { + RefreshEBalanceCache = other.RefreshEBalanceCache; + } + if (other.HasSmsEnable) { + SmsEnable = other.SmsEnable; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getPaymentMethodsRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getPaymentMethodsRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasBnetAccount) { + subBuilder.MergeFrom(BnetAccount); + } + input.ReadMessage(subBuilder, extensionRegistry); + BnetAccount = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasGameAccount) { + subBuilder.MergeFrom(GameAccount); + } + input.ReadMessage(subBuilder, extensionRegistry); + GameAccount = subBuilder.BuildPartial(); + break; + } + case 26: { + result.hasCurrency = input.ReadString(ref result.currency_); + break; + } + case 32: { + result.hasCashInOutMask = input.ReadUInt32(ref result.cashInOutMask_); + break; + } + case 40: { + result.hasRefreshPaymentMethodCache = input.ReadBool(ref result.refreshPaymentMethodCache_); + break; + } + case 48: { + result.hasRefreshEBalanceCache = input.ReadBool(ref result.refreshEBalanceCache_); + break; + } + case 56: { + result.hasSmsEnable = input.ReadBool(ref result.smsEnable_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasBnetAccount { + get { return result.hasBnetAccount; } + } + public global::bnet.protocol.EntityId BnetAccount { + get { return result.BnetAccount; } + set { SetBnetAccount(value); } + } + public Builder SetBnetAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBnetAccount = true; + result.bnetAccount_ = value; + return this; + } + public Builder SetBnetAccount(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBnetAccount = true; + result.bnetAccount_ = builderForValue.Build(); + return this; + } + public Builder MergeBnetAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBnetAccount && + result.bnetAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.bnetAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccount_).MergeFrom(value).BuildPartial(); + } else { + result.bnetAccount_ = value; + } + result.hasBnetAccount = true; + return this; + } + public Builder ClearBnetAccount() { + PrepareBuilder(); + result.hasBnetAccount = false; + result.bnetAccount_ = null; + return this; + } + + public bool HasGameAccount { + get { return result.hasGameAccount; } + } + public global::bnet.protocol.EntityId GameAccount { + get { return result.GameAccount; } + set { SetGameAccount(value); } + } + public Builder SetGameAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasGameAccount = true; + result.gameAccount_ = value; + return this; + } + public Builder SetGameAccount(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasGameAccount = true; + result.gameAccount_ = builderForValue.Build(); + return this; + } + public Builder MergeGameAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasGameAccount && + result.gameAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.gameAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccount_).MergeFrom(value).BuildPartial(); + } else { + result.gameAccount_ = value; + } + result.hasGameAccount = true; + return this; + } + public Builder ClearGameAccount() { + PrepareBuilder(); + result.hasGameAccount = false; + result.gameAccount_ = null; + return this; + } + + public bool HasCurrency { + get { return result.hasCurrency; } + } + public string Currency { + get { return result.Currency; } + set { SetCurrency(value); } + } + public Builder SetCurrency(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasCurrency = true; + result.currency_ = value; + return this; + } + public Builder ClearCurrency() { + PrepareBuilder(); + result.hasCurrency = false; + result.currency_ = ""; + return this; + } + + public bool HasCashInOutMask { + get { return result.hasCashInOutMask; } + } + public uint CashInOutMask { + get { return result.CashInOutMask; } + set { SetCashInOutMask(value); } + } + public Builder SetCashInOutMask(uint value) { + PrepareBuilder(); + result.hasCashInOutMask = true; + result.cashInOutMask_ = value; + return this; + } + public Builder ClearCashInOutMask() { + PrepareBuilder(); + result.hasCashInOutMask = false; + result.cashInOutMask_ = 0; + return this; + } + + public bool HasRefreshPaymentMethodCache { + get { return result.hasRefreshPaymentMethodCache; } + } + public bool RefreshPaymentMethodCache { + get { return result.RefreshPaymentMethodCache; } + set { SetRefreshPaymentMethodCache(value); } + } + public Builder SetRefreshPaymentMethodCache(bool value) { + PrepareBuilder(); + result.hasRefreshPaymentMethodCache = true; + result.refreshPaymentMethodCache_ = value; + return this; + } + public Builder ClearRefreshPaymentMethodCache() { + PrepareBuilder(); + result.hasRefreshPaymentMethodCache = false; + result.refreshPaymentMethodCache_ = false; + return this; + } + + public bool HasRefreshEBalanceCache { + get { return result.hasRefreshEBalanceCache; } + } + public bool RefreshEBalanceCache { + get { return result.RefreshEBalanceCache; } + set { SetRefreshEBalanceCache(value); } + } + public Builder SetRefreshEBalanceCache(bool value) { + PrepareBuilder(); + result.hasRefreshEBalanceCache = true; + result.refreshEBalanceCache_ = value; + return this; + } + public Builder ClearRefreshEBalanceCache() { + PrepareBuilder(); + result.hasRefreshEBalanceCache = false; + result.refreshEBalanceCache_ = false; + return this; + } + + public bool HasSmsEnable { + get { return result.hasSmsEnable; } + } + public bool SmsEnable { + get { return result.SmsEnable; } + set { SetSmsEnable(value); } + } + public Builder SetSmsEnable(bool value) { + PrepareBuilder(); + result.hasSmsEnable = true; + result.smsEnable_ = value; + return this; + } + public Builder ClearSmsEnable() { + PrepareBuilder(); + result.hasSmsEnable = false; + result.smsEnable_ = false; + return this; + } + } + static GetPaymentMethodsRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange_object_provider.ExchangeObjectProviderTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class PaymentMethod : pb::GeneratedMessage { + private PaymentMethod() { } + private static readonly PaymentMethod defaultInstance = new PaymentMethod().MakeReadOnly(); + private static readonly string[] _paymentMethodFieldNames = new string[] { "account", "active", "amount", "authenticator_cap", "billing_address", "cap_restriction", "cash_in_out_mask", "description", "soft_cap", "wallet_id" }; + private static readonly uint[] _paymentMethodFieldTags = new uint[] { 10, 80, 24, 64, 42, 56, 32, 18, 72, 48 }; + public static PaymentMethod DefaultInstance { + get { return defaultInstance; } + } + + public override PaymentMethod DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override PaymentMethod ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange_object_provider.ExchangeObjectProviderTypes.internal__static_bnet_protocol_exchange_object_provider_PaymentMethod__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange_object_provider.ExchangeObjectProviderTypes.internal__static_bnet_protocol_exchange_object_provider_PaymentMethod__FieldAccessorTable; } + } + + public const int AccountFieldNumber = 1; + private bool hasAccount; + private global::bnet.protocol.exchange.BlobFrom account_; + public bool HasAccount { + get { return hasAccount; } + } + public global::bnet.protocol.exchange.BlobFrom Account { + get { return account_ ?? global::bnet.protocol.exchange.BlobFrom.DefaultInstance; } + } + + public const int DescriptionFieldNumber = 2; + private bool hasDescription; + private string description_ = ""; + public bool HasDescription { + get { return hasDescription; } + } + public string Description { + get { return description_; } + } + + public const int AmountFieldNumber = 3; + private bool hasAmount; + private ulong amount_; + public bool HasAmount { + get { return hasAmount; } + } + public ulong Amount { + get { return amount_; } + } + + public const int CashInOutMaskFieldNumber = 4; + private bool hasCashInOutMask; + private uint cashInOutMask_ = 3; + public bool HasCashInOutMask { + get { return hasCashInOutMask; } + } + public uint CashInOutMask { + get { return cashInOutMask_; } + } + + public const int BillingAddressFieldNumber = 5; + private bool hasBillingAddress; + private global::bnet.protocol.exchange.BillingAddress billingAddress_; + public bool HasBillingAddress { + get { return hasBillingAddress; } + } + public global::bnet.protocol.exchange.BillingAddress BillingAddress { + get { return billingAddress_ ?? global::bnet.protocol.exchange.BillingAddress.DefaultInstance; } + } + + public const int WalletIdFieldNumber = 6; + private bool hasWalletId; + private ulong walletId_; + public bool HasWalletId { + get { return hasWalletId; } + } + public ulong WalletId { + get { return walletId_; } + } + + public const int CapRestrictionFieldNumber = 7; + private bool hasCapRestriction; + private uint capRestriction_; + public bool HasCapRestriction { + get { return hasCapRestriction; } + } + public uint CapRestriction { + get { return capRestriction_; } + } + + public const int AuthenticatorCapFieldNumber = 8; + private bool hasAuthenticatorCap; + private ulong authenticatorCap_; + public bool HasAuthenticatorCap { + get { return hasAuthenticatorCap; } + } + public ulong AuthenticatorCap { + get { return authenticatorCap_; } + } + + public const int SoftCapFieldNumber = 9; + private bool hasSoftCap; + private ulong softCap_; + public bool HasSoftCap { + get { return hasSoftCap; } + } + public ulong SoftCap { + get { return softCap_; } + } + + public const int ActiveFieldNumber = 10; + private bool hasActive; + private bool active_ = true; + public bool HasActive { + get { return hasActive; } + } + public bool Active { + get { return active_; } + } + + public override bool IsInitialized { + get { + if (!hasAccount) return false; + if (!hasWalletId) return false; + if (!Account.IsInitialized) return false; + if (HasBillingAddress) { + if (!BillingAddress.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _paymentMethodFieldNames; + if (hasAccount) { + output.WriteMessage(1, field_names[0], Account); + } + if (hasDescription) { + output.WriteString(2, field_names[7], Description); + } + if (hasAmount) { + output.WriteUInt64(3, field_names[2], Amount); + } + if (hasCashInOutMask) { + output.WriteUInt32(4, field_names[6], CashInOutMask); + } + if (hasBillingAddress) { + output.WriteMessage(5, field_names[4], BillingAddress); + } + if (hasWalletId) { + output.WriteUInt64(6, field_names[9], WalletId); + } + if (hasCapRestriction) { + output.WriteUInt32(7, field_names[5], CapRestriction); + } + if (hasAuthenticatorCap) { + output.WriteUInt64(8, field_names[3], AuthenticatorCap); + } + if (hasSoftCap) { + output.WriteUInt64(9, field_names[8], SoftCap); + } + if (hasActive) { + output.WriteBool(10, field_names[1], Active); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAccount) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Account); + } + if (hasDescription) { + size += pb::CodedOutputStream.ComputeStringSize(2, Description); + } + if (hasAmount) { + size += pb::CodedOutputStream.ComputeUInt64Size(3, Amount); + } + if (hasCashInOutMask) { + size += pb::CodedOutputStream.ComputeUInt32Size(4, CashInOutMask); + } + if (hasBillingAddress) { + size += pb::CodedOutputStream.ComputeMessageSize(5, BillingAddress); + } + if (hasWalletId) { + size += pb::CodedOutputStream.ComputeUInt64Size(6, WalletId); + } + if (hasCapRestriction) { + size += pb::CodedOutputStream.ComputeUInt32Size(7, CapRestriction); + } + if (hasAuthenticatorCap) { + size += pb::CodedOutputStream.ComputeUInt64Size(8, AuthenticatorCap); + } + if (hasSoftCap) { + size += pb::CodedOutputStream.ComputeUInt64Size(9, SoftCap); + } + if (hasActive) { + size += pb::CodedOutputStream.ComputeBoolSize(10, Active); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static PaymentMethod ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PaymentMethod ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PaymentMethod ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PaymentMethod ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PaymentMethod ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PaymentMethod ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static PaymentMethod ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static PaymentMethod ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static PaymentMethod ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PaymentMethod ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private PaymentMethod MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(PaymentMethod prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(PaymentMethod cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private PaymentMethod result; + + private PaymentMethod PrepareBuilder() { + if (resultIsReadOnly) { + PaymentMethod original = result; + result = new PaymentMethod(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override PaymentMethod MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange_object_provider.PaymentMethod.Descriptor; } + } + + public override PaymentMethod DefaultInstanceForType { + get { return global::bnet.protocol.exchange_object_provider.PaymentMethod.DefaultInstance; } + } + + public override PaymentMethod BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is PaymentMethod) { + return MergeFrom((PaymentMethod) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(PaymentMethod other) { + if (other == global::bnet.protocol.exchange_object_provider.PaymentMethod.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAccount) { + MergeAccount(other.Account); + } + if (other.HasDescription) { + Description = other.Description; + } + if (other.HasAmount) { + Amount = other.Amount; + } + if (other.HasCashInOutMask) { + CashInOutMask = other.CashInOutMask; + } + if (other.HasBillingAddress) { + MergeBillingAddress(other.BillingAddress); + } + if (other.HasWalletId) { + WalletId = other.WalletId; + } + if (other.HasCapRestriction) { + CapRestriction = other.CapRestriction; + } + if (other.HasAuthenticatorCap) { + AuthenticatorCap = other.AuthenticatorCap; + } + if (other.HasSoftCap) { + SoftCap = other.SoftCap; + } + if (other.HasActive) { + Active = other.Active; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_paymentMethodFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _paymentMethodFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.BlobFrom.Builder subBuilder = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(); + if (result.hasAccount) { + subBuilder.MergeFrom(Account); + } + input.ReadMessage(subBuilder, extensionRegistry); + Account = subBuilder.BuildPartial(); + break; + } + case 18: { + result.hasDescription = input.ReadString(ref result.description_); + break; + } + case 24: { + result.hasAmount = input.ReadUInt64(ref result.amount_); + break; + } + case 32: { + result.hasCashInOutMask = input.ReadUInt32(ref result.cashInOutMask_); + break; + } + case 42: { + global::bnet.protocol.exchange.BillingAddress.Builder subBuilder = global::bnet.protocol.exchange.BillingAddress.CreateBuilder(); + if (result.hasBillingAddress) { + subBuilder.MergeFrom(BillingAddress); + } + input.ReadMessage(subBuilder, extensionRegistry); + BillingAddress = subBuilder.BuildPartial(); + break; + } + case 48: { + result.hasWalletId = input.ReadUInt64(ref result.walletId_); + break; + } + case 56: { + result.hasCapRestriction = input.ReadUInt32(ref result.capRestriction_); + break; + } + case 64: { + result.hasAuthenticatorCap = input.ReadUInt64(ref result.authenticatorCap_); + break; + } + case 72: { + result.hasSoftCap = input.ReadUInt64(ref result.softCap_); + break; + } + case 80: { + result.hasActive = input.ReadBool(ref result.active_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAccount { + get { return result.hasAccount; } + } + public global::bnet.protocol.exchange.BlobFrom Account { + get { return result.Account; } + set { SetAccount(value); } + } + public Builder SetAccount(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAccount = true; + result.account_ = value; + return this; + } + public Builder SetAccount(global::bnet.protocol.exchange.BlobFrom.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAccount = true; + result.account_ = builderForValue.Build(); + return this; + } + public Builder MergeAccount(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAccount && + result.account_ != global::bnet.protocol.exchange.BlobFrom.DefaultInstance) { + result.account_ = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(result.account_).MergeFrom(value).BuildPartial(); + } else { + result.account_ = value; + } + result.hasAccount = true; + return this; + } + public Builder ClearAccount() { + PrepareBuilder(); + result.hasAccount = false; + result.account_ = null; + return this; + } + + public bool HasDescription { + get { return result.hasDescription; } + } + public string Description { + get { return result.Description; } + set { SetDescription(value); } + } + public Builder SetDescription(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasDescription = true; + result.description_ = value; + return this; + } + public Builder ClearDescription() { + PrepareBuilder(); + result.hasDescription = false; + result.description_ = ""; + return this; + } + + public bool HasAmount { + get { return result.hasAmount; } + } + public ulong Amount { + get { return result.Amount; } + set { SetAmount(value); } + } + public Builder SetAmount(ulong value) { + PrepareBuilder(); + result.hasAmount = true; + result.amount_ = value; + return this; + } + public Builder ClearAmount() { + PrepareBuilder(); + result.hasAmount = false; + result.amount_ = 0UL; + return this; + } + + public bool HasCashInOutMask { + get { return result.hasCashInOutMask; } + } + public uint CashInOutMask { + get { return result.CashInOutMask; } + set { SetCashInOutMask(value); } + } + public Builder SetCashInOutMask(uint value) { + PrepareBuilder(); + result.hasCashInOutMask = true; + result.cashInOutMask_ = value; + return this; + } + public Builder ClearCashInOutMask() { + PrepareBuilder(); + result.hasCashInOutMask = false; + result.cashInOutMask_ = 3; + return this; + } + + public bool HasBillingAddress { + get { return result.hasBillingAddress; } + } + public global::bnet.protocol.exchange.BillingAddress BillingAddress { + get { return result.BillingAddress; } + set { SetBillingAddress(value); } + } + public Builder SetBillingAddress(global::bnet.protocol.exchange.BillingAddress value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBillingAddress = true; + result.billingAddress_ = value; + return this; + } + public Builder SetBillingAddress(global::bnet.protocol.exchange.BillingAddress.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBillingAddress = true; + result.billingAddress_ = builderForValue.Build(); + return this; + } + public Builder MergeBillingAddress(global::bnet.protocol.exchange.BillingAddress value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBillingAddress && + result.billingAddress_ != global::bnet.protocol.exchange.BillingAddress.DefaultInstance) { + result.billingAddress_ = global::bnet.protocol.exchange.BillingAddress.CreateBuilder(result.billingAddress_).MergeFrom(value).BuildPartial(); + } else { + result.billingAddress_ = value; + } + result.hasBillingAddress = true; + return this; + } + public Builder ClearBillingAddress() { + PrepareBuilder(); + result.hasBillingAddress = false; + result.billingAddress_ = null; + return this; + } + + public bool HasWalletId { + get { return result.hasWalletId; } + } + public ulong WalletId { + get { return result.WalletId; } + set { SetWalletId(value); } + } + public Builder SetWalletId(ulong value) { + PrepareBuilder(); + result.hasWalletId = true; + result.walletId_ = value; + return this; + } + public Builder ClearWalletId() { + PrepareBuilder(); + result.hasWalletId = false; + result.walletId_ = 0UL; + return this; + } + + public bool HasCapRestriction { + get { return result.hasCapRestriction; } + } + public uint CapRestriction { + get { return result.CapRestriction; } + set { SetCapRestriction(value); } + } + public Builder SetCapRestriction(uint value) { + PrepareBuilder(); + result.hasCapRestriction = true; + result.capRestriction_ = value; + return this; + } + public Builder ClearCapRestriction() { + PrepareBuilder(); + result.hasCapRestriction = false; + result.capRestriction_ = 0; + return this; + } + + public bool HasAuthenticatorCap { + get { return result.hasAuthenticatorCap; } + } + public ulong AuthenticatorCap { + get { return result.AuthenticatorCap; } + set { SetAuthenticatorCap(value); } + } + public Builder SetAuthenticatorCap(ulong value) { + PrepareBuilder(); + result.hasAuthenticatorCap = true; + result.authenticatorCap_ = value; + return this; + } + public Builder ClearAuthenticatorCap() { + PrepareBuilder(); + result.hasAuthenticatorCap = false; + result.authenticatorCap_ = 0UL; + return this; + } + + public bool HasSoftCap { + get { return result.hasSoftCap; } + } + public ulong SoftCap { + get { return result.SoftCap; } + set { SetSoftCap(value); } + } + public Builder SetSoftCap(ulong value) { + PrepareBuilder(); + result.hasSoftCap = true; + result.softCap_ = value; + return this; + } + public Builder ClearSoftCap() { + PrepareBuilder(); + result.hasSoftCap = false; + result.softCap_ = 0UL; + return this; + } + + public bool HasActive { + get { return result.hasActive; } + } + public bool Active { + get { return result.Active; } + set { SetActive(value); } + } + public Builder SetActive(bool value) { + PrepareBuilder(); + result.hasActive = true; + result.active_ = value; + return this; + } + public Builder ClearActive() { + PrepareBuilder(); + result.hasActive = false; + result.active_ = true; + return this; + } + } + static PaymentMethod() { + object.ReferenceEquals(global::bnet.protocol.exchange_object_provider.ExchangeObjectProviderTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GetPaymentMethodsResponse : pb::GeneratedMessage { + private GetPaymentMethodsResponse() { } + private static readonly GetPaymentMethodsResponse defaultInstance = new GetPaymentMethodsResponse().MakeReadOnly(); + private static readonly string[] _getPaymentMethodsResponseFieldNames = new string[] { "methods" }; + private static readonly uint[] _getPaymentMethodsResponseFieldTags = new uint[] { 10 }; + public static GetPaymentMethodsResponse DefaultInstance { + get { return defaultInstance; } + } + + public override GetPaymentMethodsResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetPaymentMethodsResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange_object_provider.ExchangeObjectProviderTypes.internal__static_bnet_protocol_exchange_object_provider_GetPaymentMethodsResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange_object_provider.ExchangeObjectProviderTypes.internal__static_bnet_protocol_exchange_object_provider_GetPaymentMethodsResponse__FieldAccessorTable; } + } + + public const int MethodsFieldNumber = 1; + private pbc::PopsicleList methods_ = new pbc::PopsicleList(); + public scg::IList MethodsList { + get { return methods_; } + } + public int MethodsCount { + get { return methods_.Count; } + } + public global::bnet.protocol.exchange_object_provider.PaymentMethod GetMethods(int index) { + return methods_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.exchange_object_provider.PaymentMethod element in MethodsList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getPaymentMethodsResponseFieldNames; + if (methods_.Count > 0) { + output.WriteMessageArray(1, field_names[0], methods_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.exchange_object_provider.PaymentMethod element in MethodsList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GetPaymentMethodsResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetPaymentMethodsResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetPaymentMethodsResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetPaymentMethodsResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetPaymentMethodsResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetPaymentMethodsResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetPaymentMethodsResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetPaymentMethodsResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetPaymentMethodsResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetPaymentMethodsResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetPaymentMethodsResponse MakeReadOnly() { + methods_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetPaymentMethodsResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetPaymentMethodsResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetPaymentMethodsResponse result; + + private GetPaymentMethodsResponse PrepareBuilder() { + if (resultIsReadOnly) { + GetPaymentMethodsResponse original = result; + result = new GetPaymentMethodsResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetPaymentMethodsResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange_object_provider.GetPaymentMethodsResponse.Descriptor; } + } + + public override GetPaymentMethodsResponse DefaultInstanceForType { + get { return global::bnet.protocol.exchange_object_provider.GetPaymentMethodsResponse.DefaultInstance; } + } + + public override GetPaymentMethodsResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetPaymentMethodsResponse) { + return MergeFrom((GetPaymentMethodsResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetPaymentMethodsResponse other) { + if (other == global::bnet.protocol.exchange_object_provider.GetPaymentMethodsResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.methods_.Count != 0) { + result.methods_.Add(other.methods_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getPaymentMethodsResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getPaymentMethodsResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.methods_, global::bnet.protocol.exchange_object_provider.PaymentMethod.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList MethodsList { + get { return PrepareBuilder().methods_; } + } + public int MethodsCount { + get { return result.MethodsCount; } + } + public global::bnet.protocol.exchange_object_provider.PaymentMethod GetMethods(int index) { + return result.GetMethods(index); + } + public Builder SetMethods(int index, global::bnet.protocol.exchange_object_provider.PaymentMethod value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.methods_[index] = value; + return this; + } + public Builder SetMethods(int index, global::bnet.protocol.exchange_object_provider.PaymentMethod.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.methods_[index] = builderForValue.Build(); + return this; + } + public Builder AddMethods(global::bnet.protocol.exchange_object_provider.PaymentMethod value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.methods_.Add(value); + return this; + } + public Builder AddMethods(global::bnet.protocol.exchange_object_provider.PaymentMethod.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.methods_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeMethods(scg::IEnumerable values) { + PrepareBuilder(); + result.methods_.Add(values); + return this; + } + public Builder ClearMethods() { + PrepareBuilder(); + result.methods_.Clear(); + return this; + } + } + static GetPaymentMethodsResponse() { + object.ReferenceEquals(global::bnet.protocol.exchange_object_provider.ExchangeObjectProviderTypes.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/LibMooNet/bnet/protocol/exchange_risk/ExchangeRiskTypes.cs b/src/LibMooNet/bnet/protocol/exchange_risk/ExchangeRiskTypes.cs new file mode 100644 index 00000000..808c1412 --- /dev/null +++ b/src/LibMooNet/bnet/protocol/exchange_risk/ExchangeRiskTypes.cs @@ -0,0 +1,1329 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace bnet.protocol.exchange_risk { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class ExchangeRiskTypes { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_risk_ReportAuthorizeRiskVerdictRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_risk_ReportAuthorizeRiskVerdictRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_risk_ReportSettleRiskVerdictRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_risk_ReportSettleRiskVerdictRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_exchange_risk_DelaySettleRiskVerdictRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_exchange_risk_DelaySettleRiskVerdictRequest__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static ExchangeRiskTypes() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "Ch5ibmV0L2V4Y2hhbmdlX3Jpc2tfdHlwZXMucHJvdG8SG2JuZXQucHJvdG9j" + + "b2wuZXhjaGFuZ2VfcmlzaxoTYm5ldC9leGNoYW5nZS5wcm90byKQAQohUmVw" + + "b3J0QXV0aG9yaXplUmlza1ZlcmRpY3RSZXF1ZXN0EjkKDHBhcnRpdGlvbl9p" + + "ZBgBIAIoCzIjLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuUGFydGl0aW9uSWQS" + + "DwoHYXV0aF9pZBgCIAIoBBIOCgZyZXN1bHQYAyACKAQSDwoHdmVyZGljdBgE" + + "IAEoBCKPAQoeUmVwb3J0U2V0dGxlUmlza1ZlcmRpY3RSZXF1ZXN0EjkKDHBh" + + "cnRpdGlvbl9pZBgBIAIoCzIjLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuUGFy" + + "dGl0aW9uSWQSEQoJc2V0dGxlX2lkGAIgAigEEg4KBnJlc3VsdBgDIAIoBBIP" + + "Cgd2ZXJkaWN0GAQgASgEIoMBCh1EZWxheVNldHRsZVJpc2tWZXJkaWN0UmVx" + + "dWVzdBI5CgxwYXJ0aXRpb25faWQYASACKAsyIy5ibmV0LnByb3RvY29sLmV4" + + "Y2hhbmdlLlBhcnRpdGlvbklkEhEKCXNldHRsZV9pZBgCIAIoBBIUCgxkZWxh" + + "eV9pbl9taW4YAyABKARCA4ABAA=="); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_bnet_protocol_exchange_risk_ReportAuthorizeRiskVerdictRequest__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_exchange_risk_ReportAuthorizeRiskVerdictRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_risk_ReportAuthorizeRiskVerdictRequest__Descriptor, + new string[] { "PartitionId", "AuthId", "Result", "Verdict", }); + internal__static_bnet_protocol_exchange_risk_ReportSettleRiskVerdictRequest__Descriptor = Descriptor.MessageTypes[1]; + internal__static_bnet_protocol_exchange_risk_ReportSettleRiskVerdictRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_risk_ReportSettleRiskVerdictRequest__Descriptor, + new string[] { "PartitionId", "SettleId", "Result", "Verdict", }); + internal__static_bnet_protocol_exchange_risk_DelaySettleRiskVerdictRequest__Descriptor = Descriptor.MessageTypes[2]; + internal__static_bnet_protocol_exchange_risk_DelaySettleRiskVerdictRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_risk_DelaySettleRiskVerdictRequest__Descriptor, + new string[] { "PartitionId", "SettleId", "DelayInMin", }); + return null; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::bnet.protocol.exchange.Exchange.Descriptor, + }, assigner); + } + #endregion + + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ReportAuthorizeRiskVerdictRequest : pb::GeneratedMessage { + private ReportAuthorizeRiskVerdictRequest() { } + private static readonly ReportAuthorizeRiskVerdictRequest defaultInstance = new ReportAuthorizeRiskVerdictRequest().MakeReadOnly(); + private static readonly string[] _reportAuthorizeRiskVerdictRequestFieldNames = new string[] { "auth_id", "partition_id", "result", "verdict" }; + private static readonly uint[] _reportAuthorizeRiskVerdictRequestFieldTags = new uint[] { 16, 10, 24, 32 }; + public static ReportAuthorizeRiskVerdictRequest DefaultInstance { + get { return defaultInstance; } + } + + public override ReportAuthorizeRiskVerdictRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ReportAuthorizeRiskVerdictRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange_risk.ExchangeRiskTypes.internal__static_bnet_protocol_exchange_risk_ReportAuthorizeRiskVerdictRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange_risk.ExchangeRiskTypes.internal__static_bnet_protocol_exchange_risk_ReportAuthorizeRiskVerdictRequest__FieldAccessorTable; } + } + + public const int PartitionIdFieldNumber = 1; + private bool hasPartitionId; + private global::bnet.protocol.exchange.PartitionId partitionId_; + public bool HasPartitionId { + get { return hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int AuthIdFieldNumber = 2; + private bool hasAuthId; + private ulong authId_; + public bool HasAuthId { + get { return hasAuthId; } + } + public ulong AuthId { + get { return authId_; } + } + + public const int ResultFieldNumber = 3; + private bool hasResult; + private ulong result_; + public bool HasResult { + get { return hasResult; } + } + public ulong Result { + get { return result_; } + } + + public const int VerdictFieldNumber = 4; + private bool hasVerdict; + private ulong verdict_; + public bool HasVerdict { + get { return hasVerdict; } + } + public ulong Verdict { + get { return verdict_; } + } + + public override bool IsInitialized { + get { + if (!hasPartitionId) return false; + if (!hasAuthId) return false; + if (!hasResult) return false; + if (!PartitionId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _reportAuthorizeRiskVerdictRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[1], PartitionId); + } + if (hasAuthId) { + output.WriteUInt64(2, field_names[0], AuthId); + } + if (hasResult) { + output.WriteUInt64(3, field_names[2], Result); + } + if (hasVerdict) { + output.WriteUInt64(4, field_names[3], Verdict); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); + } + if (hasAuthId) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, AuthId); + } + if (hasResult) { + size += pb::CodedOutputStream.ComputeUInt64Size(3, Result); + } + if (hasVerdict) { + size += pb::CodedOutputStream.ComputeUInt64Size(4, Verdict); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ReportAuthorizeRiskVerdictRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ReportAuthorizeRiskVerdictRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ReportAuthorizeRiskVerdictRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ReportAuthorizeRiskVerdictRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ReportAuthorizeRiskVerdictRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ReportAuthorizeRiskVerdictRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ReportAuthorizeRiskVerdictRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ReportAuthorizeRiskVerdictRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ReportAuthorizeRiskVerdictRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ReportAuthorizeRiskVerdictRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ReportAuthorizeRiskVerdictRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ReportAuthorizeRiskVerdictRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ReportAuthorizeRiskVerdictRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ReportAuthorizeRiskVerdictRequest result; + + private ReportAuthorizeRiskVerdictRequest PrepareBuilder() { + if (resultIsReadOnly) { + ReportAuthorizeRiskVerdictRequest original = result; + result = new ReportAuthorizeRiskVerdictRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ReportAuthorizeRiskVerdictRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange_risk.ReportAuthorizeRiskVerdictRequest.Descriptor; } + } + + public override ReportAuthorizeRiskVerdictRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange_risk.ReportAuthorizeRiskVerdictRequest.DefaultInstance; } + } + + public override ReportAuthorizeRiskVerdictRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ReportAuthorizeRiskVerdictRequest) { + return MergeFrom((ReportAuthorizeRiskVerdictRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ReportAuthorizeRiskVerdictRequest other) { + if (other == global::bnet.protocol.exchange_risk.ReportAuthorizeRiskVerdictRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasPartitionId) { + MergePartitionId(other.PartitionId); + } + if (other.HasAuthId) { + AuthId = other.AuthId; + } + if (other.HasResult) { + Result = other.Result; + } + if (other.HasVerdict) { + Verdict = other.Verdict; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_reportAuthorizeRiskVerdictRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _reportAuthorizeRiskVerdictRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasPartitionId) { + subBuilder.MergeFrom(PartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + PartitionId = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasAuthId = input.ReadUInt64(ref result.authId_); + break; + } + case 24: { + result.hasResult = input.ReadUInt64(ref result.result_); + break; + } + case 32: { + result.hasVerdict = input.ReadUInt64(ref result.verdict_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasPartitionId { + get { return result.hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = value; + return this; + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = builderForValue.Build(); + return this; + } + public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasPartitionId && + result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); + } else { + result.partitionId_ = value; + } + result.hasPartitionId = true; + return this; + } + public Builder ClearPartitionId() { + PrepareBuilder(); + result.hasPartitionId = false; + result.partitionId_ = null; + return this; + } + + public bool HasAuthId { + get { return result.hasAuthId; } + } + public ulong AuthId { + get { return result.AuthId; } + set { SetAuthId(value); } + } + public Builder SetAuthId(ulong value) { + PrepareBuilder(); + result.hasAuthId = true; + result.authId_ = value; + return this; + } + public Builder ClearAuthId() { + PrepareBuilder(); + result.hasAuthId = false; + result.authId_ = 0UL; + return this; + } + + public bool HasResult { + get { return result.hasResult; } + } + public ulong Result { + get { return result.Result; } + set { SetResult(value); } + } + public Builder SetResult(ulong value) { + PrepareBuilder(); + result.hasResult = true; + result.result_ = value; + return this; + } + public Builder ClearResult() { + PrepareBuilder(); + result.hasResult = false; + result.result_ = 0UL; + return this; + } + + public bool HasVerdict { + get { return result.hasVerdict; } + } + public ulong Verdict { + get { return result.Verdict; } + set { SetVerdict(value); } + } + public Builder SetVerdict(ulong value) { + PrepareBuilder(); + result.hasVerdict = true; + result.verdict_ = value; + return this; + } + public Builder ClearVerdict() { + PrepareBuilder(); + result.hasVerdict = false; + result.verdict_ = 0UL; + return this; + } + } + static ReportAuthorizeRiskVerdictRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange_risk.ExchangeRiskTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ReportSettleRiskVerdictRequest : pb::GeneratedMessage { + private ReportSettleRiskVerdictRequest() { } + private static readonly ReportSettleRiskVerdictRequest defaultInstance = new ReportSettleRiskVerdictRequest().MakeReadOnly(); + private static readonly string[] _reportSettleRiskVerdictRequestFieldNames = new string[] { "partition_id", "result", "settle_id", "verdict" }; + private static readonly uint[] _reportSettleRiskVerdictRequestFieldTags = new uint[] { 10, 24, 16, 32 }; + public static ReportSettleRiskVerdictRequest DefaultInstance { + get { return defaultInstance; } + } + + public override ReportSettleRiskVerdictRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ReportSettleRiskVerdictRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange_risk.ExchangeRiskTypes.internal__static_bnet_protocol_exchange_risk_ReportSettleRiskVerdictRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange_risk.ExchangeRiskTypes.internal__static_bnet_protocol_exchange_risk_ReportSettleRiskVerdictRequest__FieldAccessorTable; } + } + + public const int PartitionIdFieldNumber = 1; + private bool hasPartitionId; + private global::bnet.protocol.exchange.PartitionId partitionId_; + public bool HasPartitionId { + get { return hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int SettleIdFieldNumber = 2; + private bool hasSettleId; + private ulong settleId_; + public bool HasSettleId { + get { return hasSettleId; } + } + public ulong SettleId { + get { return settleId_; } + } + + public const int ResultFieldNumber = 3; + private bool hasResult; + private ulong result_; + public bool HasResult { + get { return hasResult; } + } + public ulong Result { + get { return result_; } + } + + public const int VerdictFieldNumber = 4; + private bool hasVerdict; + private ulong verdict_; + public bool HasVerdict { + get { return hasVerdict; } + } + public ulong Verdict { + get { return verdict_; } + } + + public override bool IsInitialized { + get { + if (!hasPartitionId) return false; + if (!hasSettleId) return false; + if (!hasResult) return false; + if (!PartitionId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _reportSettleRiskVerdictRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[0], PartitionId); + } + if (hasSettleId) { + output.WriteUInt64(2, field_names[2], SettleId); + } + if (hasResult) { + output.WriteUInt64(3, field_names[1], Result); + } + if (hasVerdict) { + output.WriteUInt64(4, field_names[3], Verdict); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); + } + if (hasSettleId) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, SettleId); + } + if (hasResult) { + size += pb::CodedOutputStream.ComputeUInt64Size(3, Result); + } + if (hasVerdict) { + size += pb::CodedOutputStream.ComputeUInt64Size(4, Verdict); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ReportSettleRiskVerdictRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ReportSettleRiskVerdictRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ReportSettleRiskVerdictRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ReportSettleRiskVerdictRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ReportSettleRiskVerdictRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ReportSettleRiskVerdictRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ReportSettleRiskVerdictRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ReportSettleRiskVerdictRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ReportSettleRiskVerdictRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ReportSettleRiskVerdictRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ReportSettleRiskVerdictRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ReportSettleRiskVerdictRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ReportSettleRiskVerdictRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ReportSettleRiskVerdictRequest result; + + private ReportSettleRiskVerdictRequest PrepareBuilder() { + if (resultIsReadOnly) { + ReportSettleRiskVerdictRequest original = result; + result = new ReportSettleRiskVerdictRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ReportSettleRiskVerdictRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange_risk.ReportSettleRiskVerdictRequest.Descriptor; } + } + + public override ReportSettleRiskVerdictRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange_risk.ReportSettleRiskVerdictRequest.DefaultInstance; } + } + + public override ReportSettleRiskVerdictRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ReportSettleRiskVerdictRequest) { + return MergeFrom((ReportSettleRiskVerdictRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ReportSettleRiskVerdictRequest other) { + if (other == global::bnet.protocol.exchange_risk.ReportSettleRiskVerdictRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasPartitionId) { + MergePartitionId(other.PartitionId); + } + if (other.HasSettleId) { + SettleId = other.SettleId; + } + if (other.HasResult) { + Result = other.Result; + } + if (other.HasVerdict) { + Verdict = other.Verdict; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_reportSettleRiskVerdictRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _reportSettleRiskVerdictRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasPartitionId) { + subBuilder.MergeFrom(PartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + PartitionId = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasSettleId = input.ReadUInt64(ref result.settleId_); + break; + } + case 24: { + result.hasResult = input.ReadUInt64(ref result.result_); + break; + } + case 32: { + result.hasVerdict = input.ReadUInt64(ref result.verdict_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasPartitionId { + get { return result.hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = value; + return this; + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = builderForValue.Build(); + return this; + } + public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasPartitionId && + result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); + } else { + result.partitionId_ = value; + } + result.hasPartitionId = true; + return this; + } + public Builder ClearPartitionId() { + PrepareBuilder(); + result.hasPartitionId = false; + result.partitionId_ = null; + return this; + } + + public bool HasSettleId { + get { return result.hasSettleId; } + } + public ulong SettleId { + get { return result.SettleId; } + set { SetSettleId(value); } + } + public Builder SetSettleId(ulong value) { + PrepareBuilder(); + result.hasSettleId = true; + result.settleId_ = value; + return this; + } + public Builder ClearSettleId() { + PrepareBuilder(); + result.hasSettleId = false; + result.settleId_ = 0UL; + return this; + } + + public bool HasResult { + get { return result.hasResult; } + } + public ulong Result { + get { return result.Result; } + set { SetResult(value); } + } + public Builder SetResult(ulong value) { + PrepareBuilder(); + result.hasResult = true; + result.result_ = value; + return this; + } + public Builder ClearResult() { + PrepareBuilder(); + result.hasResult = false; + result.result_ = 0UL; + return this; + } + + public bool HasVerdict { + get { return result.hasVerdict; } + } + public ulong Verdict { + get { return result.Verdict; } + set { SetVerdict(value); } + } + public Builder SetVerdict(ulong value) { + PrepareBuilder(); + result.hasVerdict = true; + result.verdict_ = value; + return this; + } + public Builder ClearVerdict() { + PrepareBuilder(); + result.hasVerdict = false; + result.verdict_ = 0UL; + return this; + } + } + static ReportSettleRiskVerdictRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange_risk.ExchangeRiskTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class DelaySettleRiskVerdictRequest : pb::GeneratedMessage { + private DelaySettleRiskVerdictRequest() { } + private static readonly DelaySettleRiskVerdictRequest defaultInstance = new DelaySettleRiskVerdictRequest().MakeReadOnly(); + private static readonly string[] _delaySettleRiskVerdictRequestFieldNames = new string[] { "delay_in_min", "partition_id", "settle_id" }; + private static readonly uint[] _delaySettleRiskVerdictRequestFieldTags = new uint[] { 24, 10, 16 }; + public static DelaySettleRiskVerdictRequest DefaultInstance { + get { return defaultInstance; } + } + + public override DelaySettleRiskVerdictRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override DelaySettleRiskVerdictRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.exchange_risk.ExchangeRiskTypes.internal__static_bnet_protocol_exchange_risk_DelaySettleRiskVerdictRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange_risk.ExchangeRiskTypes.internal__static_bnet_protocol_exchange_risk_DelaySettleRiskVerdictRequest__FieldAccessorTable; } + } + + public const int PartitionIdFieldNumber = 1; + private bool hasPartitionId; + private global::bnet.protocol.exchange.PartitionId partitionId_; + public bool HasPartitionId { + get { return hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } + } + + public const int SettleIdFieldNumber = 2; + private bool hasSettleId; + private ulong settleId_; + public bool HasSettleId { + get { return hasSettleId; } + } + public ulong SettleId { + get { return settleId_; } + } + + public const int DelayInMinFieldNumber = 3; + private bool hasDelayInMin; + private ulong delayInMin_; + public bool HasDelayInMin { + get { return hasDelayInMin; } + } + public ulong DelayInMin { + get { return delayInMin_; } + } + + public override bool IsInitialized { + get { + if (!hasPartitionId) return false; + if (!hasSettleId) return false; + if (!PartitionId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _delaySettleRiskVerdictRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[1], PartitionId); + } + if (hasSettleId) { + output.WriteUInt64(2, field_names[2], SettleId); + } + if (hasDelayInMin) { + output.WriteUInt64(3, field_names[0], DelayInMin); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); + } + if (hasSettleId) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, SettleId); + } + if (hasDelayInMin) { + size += pb::CodedOutputStream.ComputeUInt64Size(3, DelayInMin); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static DelaySettleRiskVerdictRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DelaySettleRiskVerdictRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DelaySettleRiskVerdictRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DelaySettleRiskVerdictRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DelaySettleRiskVerdictRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DelaySettleRiskVerdictRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static DelaySettleRiskVerdictRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static DelaySettleRiskVerdictRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static DelaySettleRiskVerdictRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DelaySettleRiskVerdictRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private DelaySettleRiskVerdictRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(DelaySettleRiskVerdictRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(DelaySettleRiskVerdictRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private DelaySettleRiskVerdictRequest result; + + private DelaySettleRiskVerdictRequest PrepareBuilder() { + if (resultIsReadOnly) { + DelaySettleRiskVerdictRequest original = result; + result = new DelaySettleRiskVerdictRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override DelaySettleRiskVerdictRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange_risk.DelaySettleRiskVerdictRequest.Descriptor; } + } + + public override DelaySettleRiskVerdictRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange_risk.DelaySettleRiskVerdictRequest.DefaultInstance; } + } + + public override DelaySettleRiskVerdictRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is DelaySettleRiskVerdictRequest) { + return MergeFrom((DelaySettleRiskVerdictRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(DelaySettleRiskVerdictRequest other) { + if (other == global::bnet.protocol.exchange_risk.DelaySettleRiskVerdictRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasPartitionId) { + MergePartitionId(other.PartitionId); + } + if (other.HasSettleId) { + SettleId = other.SettleId; + } + if (other.HasDelayInMin) { + DelayInMin = other.DelayInMin; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_delaySettleRiskVerdictRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _delaySettleRiskVerdictRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasPartitionId) { + subBuilder.MergeFrom(PartitionId); + } + input.ReadMessage(subBuilder, extensionRegistry); + PartitionId = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasSettleId = input.ReadUInt64(ref result.settleId_); + break; + } + case 24: { + result.hasDelayInMin = input.ReadUInt64(ref result.delayInMin_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasPartitionId { + get { return result.hasPartitionId; } + } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = value; + return this; + } + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = builderForValue.Build(); + return this; + } + public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasPartitionId && + result.partitionId_ != global::bnet.protocol.exchange.PartitionId.DefaultInstance) { + result.partitionId_ = global::bnet.protocol.exchange.PartitionId.CreateBuilder(result.partitionId_).MergeFrom(value).BuildPartial(); + } else { + result.partitionId_ = value; + } + result.hasPartitionId = true; + return this; + } + public Builder ClearPartitionId() { + PrepareBuilder(); + result.hasPartitionId = false; + result.partitionId_ = null; + return this; + } + + public bool HasSettleId { + get { return result.hasSettleId; } + } + public ulong SettleId { + get { return result.SettleId; } + set { SetSettleId(value); } + } + public Builder SetSettleId(ulong value) { + PrepareBuilder(); + result.hasSettleId = true; + result.settleId_ = value; + return this; + } + public Builder ClearSettleId() { + PrepareBuilder(); + result.hasSettleId = false; + result.settleId_ = 0UL; + return this; + } + + public bool HasDelayInMin { + get { return result.hasDelayInMin; } + } + public ulong DelayInMin { + get { return result.DelayInMin; } + set { SetDelayInMin(value); } + } + public Builder SetDelayInMin(ulong value) { + PrepareBuilder(); + result.hasDelayInMin = true; + result.delayInMin_ = value; + return this; + } + public Builder ClearDelayInMin() { + PrepareBuilder(); + result.hasDelayInMin = false; + result.delayInMin_ = 0UL; + return this; + } + } + static DelaySettleRiskVerdictRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange_risk.ExchangeRiskTypes.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code diff --git a/source/D3Proto/bnet/protocol/friends/Friends.cs b/src/LibMooNet/bnet/protocol/friends/FriendsService.cs similarity index 55% rename from source/D3Proto/bnet/protocol/friends/Friends.cs rename to src/LibMooNet/bnet/protocol/friends/FriendsService.cs index 1acac017..3f4d4aec 100644 --- a/source/D3Proto/bnet/protocol/friends/Friends.cs +++ b/src/LibMooNet/bnet/protocol/friends/FriendsService.cs @@ -1,4 +1,6 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code using pb = global::Google.ProtocolBuffers; using pbc = global::Google.ProtocolBuffers.Collections; @@ -6,207 +8,226 @@ using scg = global::System.Collections.Generic; namespace bnet.protocol.friends { - public static partial class Friends { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - registry.Add(global::bnet.protocol.friends.SendInvitationRequest.FriendRequest); - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_bnet_protocol_friends_SubscribeToFriendsRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_friends_SubscribeToFriendsRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_friends_SubscribeToFriendsResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_friends_SubscribeToFriendsResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_friends_UnsubscribeToFriendsRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_friends_UnsubscribeToFriendsRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_friends_GenericFriendRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_friends_GenericFriendRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_friends_GenericFriendResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_friends_GenericFriendResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_friends_SendInvitationRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_friends_SendInvitationRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_friends_ViewFriendsRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_friends_ViewFriendsRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_friends_ViewFriendsResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_friends_ViewFriendsResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_friends_UpdateFriendStateRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_friends_UpdateFriendStateRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_friends_UpdateFriendStateResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_friends_UpdateFriendStateResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_friends_FriendNotification__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_friends_FriendNotification__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_friends_InvitationAddedNotification__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_friends_InvitationAddedNotification__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_friends_InvitationRemovedNotification__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_friends_InvitationRemovedNotification__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static Friends() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "CihzZXJ2aWNlL2ZyaWVuZHMvZGVmaW5pdGlvbi9mcmllbmRzLnByb3RvEhVi" + - "bmV0LnByb3RvY29sLmZyaWVuZHMaHGxpYi9wcm90b2NvbC9hdHRyaWJ1dGUu" + - "cHJvdG8aGWxpYi9wcm90b2NvbC9lbnRpdHkucHJvdG8aHWxpYi9wcm90b2Nv" + - "bC9pbnZpdGF0aW9uLnByb3RvGhFsaWIvcnBjL3JwYy5wcm90bxojc2Vydmlj" + - "ZS9mcmllbmRzL2ZyaWVuZHNfdHlwZXMucHJvdG8iWQoZU3Vic2NyaWJlVG9G" + - "cmllbmRzUmVxdWVzdBIpCghhZ2VudF9pZBgBIAEoCzIXLmJuZXQucHJvdG9j" + - "b2wuRW50aXR5SWQSEQoJb2JqZWN0X2lkGAIgAigEIqUCChpTdWJzY3JpYmVU" + - "b0ZyaWVuZHNSZXNwb25zZRITCgttYXhfZnJpZW5kcxgCIAEoDRIgChhtYXhf" + - "cmVjZWl2ZWRfaW52aXRhdGlvbnMYAyABKA0SHAoUbWF4X3NlbnRfaW52aXRh" + - "dGlvbnMYBCABKA0SLgoHZnJpZW5kcxgFIAMoCzIdLmJuZXQucHJvdG9jb2wu" + - "ZnJpZW5kcy5GcmllbmQSPgoQc2VudF9pbnZpdGF0aW9ucxgGIAMoCzIkLmJu" + - "ZXQucHJvdG9jb2wuaW52aXRhdGlvbi5JbnZpdGF0aW9uEkIKFHJlY2VpdmVk" + - "X2ludml0YXRpb25zGAcgAygLMiQuYm5ldC5wcm90b2NvbC5pbnZpdGF0aW9u" + - "Lkludml0YXRpb24iWwobVW5zdWJzY3JpYmVUb0ZyaWVuZHNSZXF1ZXN0EikK" + - "CGFnZW50X2lkGAEgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBIRCglv" + - "YmplY3RfaWQYAiABKAQibQoUR2VuZXJpY0ZyaWVuZFJlcXVlc3QSKQoIYWdl" + - "bnRfaWQYASABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEioKCXRhcmdl" + - "dF9pZBgCIAIoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQiTQoVR2VuZXJp" + - "Y0ZyaWVuZFJlc3BvbnNlEjQKDXRhcmdldF9mcmllbmQYAiABKAsyHS5ibmV0" + - "LnByb3RvY29sLmZyaWVuZHMuRnJpZW5kIrwBChVTZW5kSW52aXRhdGlvblJl" + - "cXVlc3QSFAoMdGFyZ2V0X2VtYWlsGAMgASgJEhYKDmRpc3BsYXlfc3RyaW5n" + - "GAQgASgJMnUKDmZyaWVuZF9yZXF1ZXN0Ei8uYm5ldC5wcm90b2NvbC5pbnZp" + - "dGF0aW9uLlNlbmRJbnZpdGF0aW9uUmVxdWVzdBhnIAEoCzIsLmJuZXQucHJv" + - "dG9jb2wuZnJpZW5kcy5TZW5kSW52aXRhdGlvblJlcXVlc3Qi1wEKElZpZXdG" + - "cmllbmRzUmVxdWVzdBIpCghhZ2VudF9pZBgBIAEoCzIXLmJuZXQucHJvdG9j" + - "b2wuRW50aXR5SWQSKgoJdGFyZ2V0X2lkGAIgAigLMhcuYm5ldC5wcm90b2Nv" + - "bC5FbnRpdHlJZBI4CgZmaWx0ZXIYAyACKAsyKC5ibmV0LnByb3RvY29sLmF0" + - "dHJpYnV0ZS5BdHRyaWJ1dGVGaWx0ZXISFgoLc3RhcnRfaW5kZXgYBCABKA06" + - "ATASGAoLbWF4X3Jlc3VsdHMYBSABKA06AzEwMCJcChNWaWV3RnJpZW5kc1Jl" + - "c3BvbnNlEi4KB2ZyaWVuZHMYASADKAsyHS5ibmV0LnByb3RvY29sLmZyaWVu" + - "ZHMuRnJpZW5kEhUKDXRvdGFsX3Jlc3VsdHMYAiABKA0iqAEKGFVwZGF0ZUZy" + - "aWVuZFN0YXRlUmVxdWVzdBIpCghhZ2VudF9pZBgBIAEoCzIXLmJuZXQucHJv" + - "dG9jb2wuRW50aXR5SWQSKgoJdGFyZ2V0X2lkGAIgAigLMhcuYm5ldC5wcm90" + - "b2NvbC5FbnRpdHlJZBI1CglhdHRyaWJ1dGUYAyADKAsyIi5ibmV0LnByb3Rv" + - "Y29sLmF0dHJpYnV0ZS5BdHRyaWJ1dGUifgoZVXBkYXRlRnJpZW5kU3RhdGVS" + - "ZXNwb25zZRIqCgl0YXJnZXRfaWQYAiACKAsyFy5ibmV0LnByb3RvY29sLkVu" + - "dGl0eUlkEjUKCWF0dHJpYnV0ZRgDIAMoCzIiLmJuZXQucHJvdG9jb2wuYXR0" + - "cmlidXRlLkF0dHJpYnV0ZSJDChJGcmllbmROb3RpZmljYXRpb24SLQoGdGFy" + - "Z2V0GAEgAigLMh0uYm5ldC5wcm90b2NvbC5mcmllbmRzLkZyaWVuZCJXChtJ" + - "bnZpdGF0aW9uQWRkZWROb3RpZmljYXRpb24SOAoKaW52aXRhdGlvbhgBIAIo" + - "CzIkLmJuZXQucHJvdG9jb2wuaW52aXRhdGlvbi5JbnZpdGF0aW9uIp4BCh1J" + - "bnZpdGF0aW9uUmVtb3ZlZE5vdGlmaWNhdGlvbhI4CgppbnZpdGF0aW9uGAEg" + - "AigLMiQuYm5ldC5wcm90b2NvbC5pbnZpdGF0aW9uLkludml0YXRpb24SDgoG" + - "cmVhc29uGAIgASgNEjMKDGFkZGVkX2ZyaWVuZBgDIAEoCzIdLmJuZXQucHJv" + - "dG9jb2wuZnJpZW5kcy5GcmllbmQygQgKDkZyaWVuZHNTZXJ2aWNlEnkKElN1" + - "YnNjcmliZVRvRnJpZW5kcxIwLmJuZXQucHJvdG9jb2wuZnJpZW5kcy5TdWJz" + - "Y3JpYmVUb0ZyaWVuZHNSZXF1ZXN0GjEuYm5ldC5wcm90b2NvbC5mcmllbmRz" + - "LlN1YnNjcmliZVRvRnJpZW5kc1Jlc3BvbnNlEnMKDlNlbmRJbnZpdGF0aW9u" + - "Ei8uYm5ldC5wcm90b2NvbC5pbnZpdGF0aW9uLlNlbmRJbnZpdGF0aW9uUmVx" + - "dWVzdBowLmJuZXQucHJvdG9jb2wuaW52aXRhdGlvbi5TZW5kSW52aXRhdGlv" + - "blJlc3BvbnNlElMKEEFjY2VwdEludml0YXRpb24SKC5ibmV0LnByb3RvY29s" + - "Lmludml0YXRpb24uR2VuZXJpY1JlcXVlc3QaFS5ibmV0LnByb3RvY29sLk5v" + - "RGF0YRJTChBSZXZva2VJbnZpdGF0aW9uEiguYm5ldC5wcm90b2NvbC5pbnZp" + - "dGF0aW9uLkdlbmVyaWNSZXF1ZXN0GhUuYm5ldC5wcm90b2NvbC5Ob0RhdGES" + - "VAoRRGVjbGluZUludml0YXRpb24SKC5ibmV0LnByb3RvY29sLmludml0YXRp" + - "b24uR2VuZXJpY1JlcXVlc3QaFS5ibmV0LnByb3RvY29sLk5vRGF0YRJTChBJ" + - "Z25vcmVJbnZpdGF0aW9uEiguYm5ldC5wcm90b2NvbC5pbnZpdGF0aW9uLkdl" + - "bmVyaWNSZXF1ZXN0GhUuYm5ldC5wcm90b2NvbC5Ob0RhdGESaQoMUmVtb3Zl" + - "RnJpZW5kEisuYm5ldC5wcm90b2NvbC5mcmllbmRzLkdlbmVyaWNGcmllbmRS" + - "ZXF1ZXN0GiwuYm5ldC5wcm90b2NvbC5mcmllbmRzLkdlbmVyaWNGcmllbmRS" + - "ZXNwb25zZRJkCgtWaWV3RnJpZW5kcxIpLmJuZXQucHJvdG9jb2wuZnJpZW5k" + - "cy5WaWV3RnJpZW5kc1JlcXVlc3QaKi5ibmV0LnByb3RvY29sLmZyaWVuZHMu" + - "Vmlld0ZyaWVuZHNSZXNwb25zZRJ2ChFVcGRhdGVGcmllbmRTdGF0ZRIvLmJu" + - "ZXQucHJvdG9jb2wuZnJpZW5kcy5VcGRhdGVGcmllbmRTdGF0ZVJlcXVlc3Qa" + - "MC5ibmV0LnByb3RvY29sLmZyaWVuZHMuVXBkYXRlRnJpZW5kU3RhdGVSZXNw" + - "b25zZRJhChRVbnN1YnNjcmliZVRvRnJpZW5kcxIyLmJuZXQucHJvdG9jb2wu" + - "ZnJpZW5kcy5VbnN1YnNjcmliZVRvRnJpZW5kc1JlcXVlc3QaFS5ibmV0LnBy" + - "b3RvY29sLk5vRGF0YTKgBAoNRnJpZW5kc05vdGlmeRJaChFOb3RpZnlGcmll" + - "bmRBZGRlZBIpLmJuZXQucHJvdG9jb2wuZnJpZW5kcy5GcmllbmROb3RpZmlj" + - "YXRpb24aGi5ibmV0LnByb3RvY29sLk5PX1JFU1BPTlNFElwKE05vdGlmeUZy" + - "aWVuZFJlbW92ZWQSKS5ibmV0LnByb3RvY29sLmZyaWVuZHMuRnJpZW5kTm90" + - "aWZpY2F0aW9uGhouYm5ldC5wcm90b2NvbC5OT19SRVNQT05TRRJvCh1Ob3Rp" + - "ZnlSZWNlaXZlZEludml0YXRpb25BZGRlZBIyLmJuZXQucHJvdG9jb2wuZnJp" + - "ZW5kcy5JbnZpdGF0aW9uQWRkZWROb3RpZmljYXRpb24aGi5ibmV0LnByb3Rv" + - "Y29sLk5PX1JFU1BPTlNFEnMKH05vdGlmeVJlY2VpdmVkSW52aXRhdGlvblJl" + - "bW92ZWQSNC5ibmV0LnByb3RvY29sLmZyaWVuZHMuSW52aXRhdGlvblJlbW92" + - "ZWROb3RpZmljYXRpb24aGi5ibmV0LnByb3RvY29sLk5PX1JFU1BPTlNFEm8K" + - "G05vdGlmeVNlbnRJbnZpdGF0aW9uUmVtb3ZlZBI0LmJuZXQucHJvdG9jb2wu" + - "ZnJpZW5kcy5JbnZpdGF0aW9uUmVtb3ZlZE5vdGlmaWNhdGlvbhoaLmJuZXQu" + - "cHJvdG9jb2wuTk9fUkVTUE9OU0VCA4ABAQ=="); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_bnet_protocol_friends_SubscribeToFriendsRequest__Descriptor = Descriptor.MessageTypes[0]; - internal__static_bnet_protocol_friends_SubscribeToFriendsRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_friends_SubscribeToFriendsRequest__Descriptor, - new string[] { "AgentId", "ObjectId", }); - internal__static_bnet_protocol_friends_SubscribeToFriendsResponse__Descriptor = Descriptor.MessageTypes[1]; - internal__static_bnet_protocol_friends_SubscribeToFriendsResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_friends_SubscribeToFriendsResponse__Descriptor, - new string[] { "MaxFriends", "MaxReceivedInvitations", "MaxSentInvitations", "Friends", "SentInvitations", "ReceivedInvitations", }); - internal__static_bnet_protocol_friends_UnsubscribeToFriendsRequest__Descriptor = Descriptor.MessageTypes[2]; - internal__static_bnet_protocol_friends_UnsubscribeToFriendsRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_friends_UnsubscribeToFriendsRequest__Descriptor, - new string[] { "AgentId", "ObjectId", }); - internal__static_bnet_protocol_friends_GenericFriendRequest__Descriptor = Descriptor.MessageTypes[3]; - internal__static_bnet_protocol_friends_GenericFriendRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_friends_GenericFriendRequest__Descriptor, - new string[] { "AgentId", "TargetId", }); - internal__static_bnet_protocol_friends_GenericFriendResponse__Descriptor = Descriptor.MessageTypes[4]; - internal__static_bnet_protocol_friends_GenericFriendResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_friends_GenericFriendResponse__Descriptor, - new string[] { "TargetFriend", }); - internal__static_bnet_protocol_friends_SendInvitationRequest__Descriptor = Descriptor.MessageTypes[5]; - internal__static_bnet_protocol_friends_SendInvitationRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_friends_SendInvitationRequest__Descriptor, - new string[] { "TargetEmail", "DisplayString", }); - global::bnet.protocol.friends.SendInvitationRequest.FriendRequest = pb::GeneratedSingleExtension.CreateInstance(global::bnet.protocol.friends.SendInvitationRequest.Descriptor.Extensions[0]); - internal__static_bnet_protocol_friends_ViewFriendsRequest__Descriptor = Descriptor.MessageTypes[6]; - internal__static_bnet_protocol_friends_ViewFriendsRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_friends_ViewFriendsRequest__Descriptor, - new string[] { "AgentId", "TargetId", "Filter", "StartIndex", "MaxResults", }); - internal__static_bnet_protocol_friends_ViewFriendsResponse__Descriptor = Descriptor.MessageTypes[7]; - internal__static_bnet_protocol_friends_ViewFriendsResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_friends_ViewFriendsResponse__Descriptor, - new string[] { "Friends", "TotalResults", }); - internal__static_bnet_protocol_friends_UpdateFriendStateRequest__Descriptor = Descriptor.MessageTypes[8]; - internal__static_bnet_protocol_friends_UpdateFriendStateRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_friends_UpdateFriendStateRequest__Descriptor, - new string[] { "AgentId", "TargetId", "Attribute", }); - internal__static_bnet_protocol_friends_UpdateFriendStateResponse__Descriptor = Descriptor.MessageTypes[9]; - internal__static_bnet_protocol_friends_UpdateFriendStateResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_friends_UpdateFriendStateResponse__Descriptor, - new string[] { "TargetId", "Attribute", }); - internal__static_bnet_protocol_friends_FriendNotification__Descriptor = Descriptor.MessageTypes[10]; - internal__static_bnet_protocol_friends_FriendNotification__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_friends_FriendNotification__Descriptor, - new string[] { "Target", }); - internal__static_bnet_protocol_friends_InvitationAddedNotification__Descriptor = Descriptor.MessageTypes[11]; - internal__static_bnet_protocol_friends_InvitationAddedNotification__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_friends_InvitationAddedNotification__Descriptor, - new string[] { "Invitation", }); - internal__static_bnet_protocol_friends_InvitationRemovedNotification__Descriptor = Descriptor.MessageTypes[12]; - internal__static_bnet_protocol_friends_InvitationRemovedNotification__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_friends_InvitationRemovedNotification__Descriptor, - new string[] { "Invitation", "Reason", "AddedFriend", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::bnet.protocol.attribute.Proto.Attribute.Descriptor, - global::bnet.protocol.Entity.Descriptor, - global::bnet.protocol.invitation.Proto.Invitation.Descriptor, - global::bnet.protocol.Rpc.Descriptor, - global::bnet.protocol.friends.FriendsTypes.Descriptor, - }, assigner); - } - #endregion - + namespace Proto { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class FriendsService { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_bnet_protocol_friends_SubscribeToFriendsRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_friends_SubscribeToFriendsRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_friends_SubscribeToFriendsResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_friends_SubscribeToFriendsResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_friends_UnsubscribeToFriendsRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_friends_UnsubscribeToFriendsRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_friends_GenericFriendRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_friends_GenericFriendRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_friends_GenericFriendResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_friends_GenericFriendResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_friends_AssignRoleRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_friends_AssignRoleRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_friends_ViewFriendsRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_friends_ViewFriendsRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_friends_ViewFriendsResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_friends_ViewFriendsResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_friends_UpdateFriendStateRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_friends_UpdateFriendStateRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_friends_FriendNotification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_friends_FriendNotification__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_friends_UpdateFriendStateNotification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_friends_UpdateFriendStateNotification__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_friends_InvitationNotification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_friends_InvitationNotification__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static FriendsService() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "ChpibmV0L2ZyaWVuZHNfc2VydmljZS5wcm90bxIVYm5ldC5wcm90b2NvbC5m" + + "cmllbmRzGhhibmV0L2ZyaWVuZHNfdHlwZXMucHJvdG8aG2JuZXQvaW52aXRh" + + "dGlvbl90eXBlcy5wcm90bxoTYm5ldC9yb2xlX3NldC5wcm90bxoUYm5ldC9h" + + "dHRyaWJ1dGUucHJvdG8aEWJuZXQvZW50aXR5LnByb3RvGg5ibmV0L3JwYy5w" + + "cm90byJZChlTdWJzY3JpYmVUb0ZyaWVuZHNSZXF1ZXN0EikKCGFnZW50X2lk" + + "GAEgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBIRCglvYmplY3RfaWQY" + + "AiACKAQiyAIKGlN1YnNjcmliZVRvRnJpZW5kc1Jlc3BvbnNlEhMKC21heF9m" + + "cmllbmRzGAEgASgNEiAKGG1heF9yZWNlaXZlZF9pbnZpdGF0aW9ucxgCIAEo" + + "DRIcChRtYXhfc2VudF9pbnZpdGF0aW9ucxgDIAEoDRIhCgRyb2xlGAQgAygL" + + "MhMuYm5ldC5wcm90b2NvbC5Sb2xlEi4KB2ZyaWVuZHMYBSADKAsyHS5ibmV0" + + "LnByb3RvY29sLmZyaWVuZHMuRnJpZW5kEj4KEHNlbnRfaW52aXRhdGlvbnMY" + + "BiADKAsyJC5ibmV0LnByb3RvY29sLmludml0YXRpb24uSW52aXRhdGlvbhJC" + + "ChRyZWNlaXZlZF9pbnZpdGF0aW9ucxgHIAMoCzIkLmJuZXQucHJvdG9jb2wu" + + "aW52aXRhdGlvbi5JbnZpdGF0aW9uIlsKG1Vuc3Vic2NyaWJlVG9GcmllbmRz" + + "UmVxdWVzdBIpCghhZ2VudF9pZBgBIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50" + + "aXR5SWQSEQoJb2JqZWN0X2lkGAIgASgEIm0KFEdlbmVyaWNGcmllbmRSZXF1" + + "ZXN0EikKCGFnZW50X2lkGAEgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJ" + + "ZBIqCgl0YXJnZXRfaWQYAiACKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlk" + + "Ik0KFUdlbmVyaWNGcmllbmRSZXNwb25zZRI0Cg10YXJnZXRfZnJpZW5kGAEg" + + "ASgLMh0uYm5ldC5wcm90b2NvbC5mcmllbmRzLkZyaWVuZCJ4ChFBc3NpZ25S" + + "b2xlUmVxdWVzdBIpCghhZ2VudF9pZBgBIAEoCzIXLmJuZXQucHJvdG9jb2wu" + + "RW50aXR5SWQSKgoJdGFyZ2V0X2lkGAIgAigLMhcuYm5ldC5wcm90b2NvbC5F" + + "bnRpdHlJZBIMCgRyb2xlGAMgAygFItcBChJWaWV3RnJpZW5kc1JlcXVlc3QS" + + "KQoIYWdlbnRfaWQYASABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEioK" + + "CXRhcmdldF9pZBgCIAIoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSOAoG" + + "ZmlsdGVyGAMgAigLMiguYm5ldC5wcm90b2NvbC5hdHRyaWJ1dGUuQXR0cmli" + + "dXRlRmlsdGVyEhYKC3N0YXJ0X2luZGV4GAQgASgNOgEwEhgKC21heF9yZXN1" + + "bHRzGAUgASgNOgMxMDAiXAoTVmlld0ZyaWVuZHNSZXNwb25zZRIuCgdmcmll" + + "bmRzGAEgAygLMh0uYm5ldC5wcm90b2NvbC5mcmllbmRzLkZyaWVuZBIVCg10" + + "b3RhbF9yZXN1bHRzGAIgASgNIsIBChhVcGRhdGVGcmllbmRTdGF0ZVJlcXVl" + + "c3QSKQoIYWdlbnRfaWQYASABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlk" + + "EioKCXRhcmdldF9pZBgCIAIoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQS" + + "NQoJYXR0cmlidXRlGAMgAygLMiIuYm5ldC5wcm90b2NvbC5hdHRyaWJ1dGUu" + + "QXR0cmlidXRlEhgKEGF0dHJpYnV0ZXNfZXBvY2gYBCABKAQidQoSRnJpZW5k" + + "Tm90aWZpY2F0aW9uEi0KBnRhcmdldBgBIAIoCzIdLmJuZXQucHJvdG9jb2wu" + + "ZnJpZW5kcy5GcmllbmQSMAoPZ2FtZV9hY2NvdW50X2lkGAIgASgLMhcuYm5l" + + "dC5wcm90b2NvbC5FbnRpdHlJZCKIAQodVXBkYXRlRnJpZW5kU3RhdGVOb3Rp" + + "ZmljYXRpb24SNQoOY2hhbmdlZF9mcmllbmQYASACKAsyHS5ibmV0LnByb3Rv" + + "Y29sLmZyaWVuZHMuRnJpZW5kEjAKD2dhbWVfYWNjb3VudF9pZBgCIAEoCzIX" + + "LmJuZXQucHJvdG9jb2wuRW50aXR5SWQilwEKFkludml0YXRpb25Ob3RpZmlj" + + "YXRpb24SOAoKaW52aXRhdGlvbhgBIAIoCzIkLmJuZXQucHJvdG9jb2wuaW52" + + "aXRhdGlvbi5JbnZpdGF0aW9uEjAKD2dhbWVfYWNjb3VudF9pZBgCIAEoCzIX" + + "LmJuZXQucHJvdG9jb2wuRW50aXR5SWQSEQoGcmVhc29uGAMgASgNOgEwMtwI" + + "Cg5GcmllbmRzU2VydmljZRJ/ChJTdWJzY3JpYmVUb0ZyaWVuZHMSMC5ibmV0" + + "LnByb3RvY29sLmZyaWVuZHMuU3Vic2NyaWJlVG9GcmllbmRzUmVxdWVzdBox" + + "LmJuZXQucHJvdG9jb2wuZnJpZW5kcy5TdWJzY3JpYmVUb0ZyaWVuZHNSZXNw" + + "b25zZSIEgLUYARJeCg5TZW5kSW52aXRhdGlvbhIvLmJuZXQucHJvdG9jb2wu" + + "aW52aXRhdGlvbi5TZW5kSW52aXRhdGlvblJlcXVlc3QaFS5ibmV0LnByb3Rv" + + "Y29sLk5vRGF0YSIEgLUYAhJZChBBY2NlcHRJbnZpdGF0aW9uEiguYm5ldC5w" + + "cm90b2NvbC5pbnZpdGF0aW9uLkdlbmVyaWNSZXF1ZXN0GhUuYm5ldC5wcm90" + + "b2NvbC5Ob0RhdGEiBIC1GAMSWQoQUmV2b2tlSW52aXRhdGlvbhIoLmJuZXQu" + + "cHJvdG9jb2wuaW52aXRhdGlvbi5HZW5lcmljUmVxdWVzdBoVLmJuZXQucHJv" + + "dG9jb2wuTm9EYXRhIgSAtRgEEloKEURlY2xpbmVJbnZpdGF0aW9uEiguYm5l" + + "dC5wcm90b2NvbC5pbnZpdGF0aW9uLkdlbmVyaWNSZXF1ZXN0GhUuYm5ldC5w" + + "cm90b2NvbC5Ob0RhdGEiBIC1GAUSWQoQSWdub3JlSW52aXRhdGlvbhIoLmJu" + + "ZXQucHJvdG9jb2wuaW52aXRhdGlvbi5HZW5lcmljUmVxdWVzdBoVLmJuZXQu" + + "cHJvdG9jb2wuTm9EYXRhIgSAtRgGElMKCkFzc2lnblJvbGUSKC5ibmV0LnBy" + + "b3RvY29sLmZyaWVuZHMuQXNzaWduUm9sZVJlcXVlc3QaFS5ibmV0LnByb3Rv" + + "Y29sLk5vRGF0YSIEgLUYBxJvCgxSZW1vdmVGcmllbmQSKy5ibmV0LnByb3Rv" + + "Y29sLmZyaWVuZHMuR2VuZXJpY0ZyaWVuZFJlcXVlc3QaLC5ibmV0LnByb3Rv" + + "Y29sLmZyaWVuZHMuR2VuZXJpY0ZyaWVuZFJlc3BvbnNlIgSAtRgIEmoKC1Zp" + + "ZXdGcmllbmRzEikuYm5ldC5wcm90b2NvbC5mcmllbmRzLlZpZXdGcmllbmRz" + + "UmVxdWVzdBoqLmJuZXQucHJvdG9jb2wuZnJpZW5kcy5WaWV3RnJpZW5kc1Jl" + + "c3BvbnNlIgSAtRgJEmEKEVVwZGF0ZUZyaWVuZFN0YXRlEi8uYm5ldC5wcm90" + + "b2NvbC5mcmllbmRzLlVwZGF0ZUZyaWVuZFN0YXRlUmVxdWVzdBoVLmJuZXQu" + + "cHJvdG9jb2wuTm9EYXRhIgSAtRgKEmcKFFVuc3Vic2NyaWJlVG9GcmllbmRz" + + "EjIuYm5ldC5wcm90b2NvbC5mcmllbmRzLlVuc3Vic2NyaWJlVG9GcmllbmRz" + + "UmVxdWVzdBoVLmJuZXQucHJvdG9jb2wuTm9EYXRhIgSAtRgLMowGCg1Gcmll" + + "bmRzTm90aWZ5EmAKEU5vdGlmeUZyaWVuZEFkZGVkEikuYm5ldC5wcm90b2Nv" + + "bC5mcmllbmRzLkZyaWVuZE5vdGlmaWNhdGlvbhoaLmJuZXQucHJvdG9jb2wu" + + "Tk9fUkVTUE9OU0UiBIC1GAESYgoTTm90aWZ5RnJpZW5kUmVtb3ZlZBIpLmJu" + + "ZXQucHJvdG9jb2wuZnJpZW5kcy5GcmllbmROb3RpZmljYXRpb24aGi5ibmV0" + + "LnByb3RvY29sLk5PX1JFU1BPTlNFIgSAtRgCEnAKHU5vdGlmeVJlY2VpdmVk" + + "SW52aXRhdGlvbkFkZGVkEi0uYm5ldC5wcm90b2NvbC5mcmllbmRzLkludml0" + + "YXRpb25Ob3RpZmljYXRpb24aGi5ibmV0LnByb3RvY29sLk5PX1JFU1BPTlNF" + + "IgSAtRgDEnIKH05vdGlmeVJlY2VpdmVkSW52aXRhdGlvblJlbW92ZWQSLS5i" + + "bmV0LnByb3RvY29sLmZyaWVuZHMuSW52aXRhdGlvbk5vdGlmaWNhdGlvbhoa" + + "LmJuZXQucHJvdG9jb2wuTk9fUkVTUE9OU0UiBIC1GAQSbAoZTm90aWZ5U2Vu" + + "dEludml0YXRpb25BZGRlZBItLmJuZXQucHJvdG9jb2wuZnJpZW5kcy5JbnZp" + + "dGF0aW9uTm90aWZpY2F0aW9uGhouYm5ldC5wcm90b2NvbC5OT19SRVNQT05T" + + "RSIEgLUYBRJuChtOb3RpZnlTZW50SW52aXRhdGlvblJlbW92ZWQSLS5ibmV0" + + "LnByb3RvY29sLmZyaWVuZHMuSW52aXRhdGlvbk5vdGlmaWNhdGlvbhoaLmJu" + + "ZXQucHJvdG9jb2wuTk9fUkVTUE9OU0UiBIC1GAYScQoXTm90aWZ5VXBkYXRl" + + "RnJpZW5kU3RhdGUSNC5ibmV0LnByb3RvY29sLmZyaWVuZHMuVXBkYXRlRnJp" + + "ZW5kU3RhdGVOb3RpZmljYXRpb24aGi5ibmV0LnByb3RvY29sLk5PX1JFU1BP" + + "TlNFIgSAtRgHQgOAAQA="); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_bnet_protocol_friends_SubscribeToFriendsRequest__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_friends_SubscribeToFriendsRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_friends_SubscribeToFriendsRequest__Descriptor, + new string[] { "AgentId", "ObjectId", }); + internal__static_bnet_protocol_friends_SubscribeToFriendsResponse__Descriptor = Descriptor.MessageTypes[1]; + internal__static_bnet_protocol_friends_SubscribeToFriendsResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_friends_SubscribeToFriendsResponse__Descriptor, + new string[] { "MaxFriends", "MaxReceivedInvitations", "MaxSentInvitations", "Role", "Friends", "SentInvitations", "ReceivedInvitations", }); + internal__static_bnet_protocol_friends_UnsubscribeToFriendsRequest__Descriptor = Descriptor.MessageTypes[2]; + internal__static_bnet_protocol_friends_UnsubscribeToFriendsRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_friends_UnsubscribeToFriendsRequest__Descriptor, + new string[] { "AgentId", "ObjectId", }); + internal__static_bnet_protocol_friends_GenericFriendRequest__Descriptor = Descriptor.MessageTypes[3]; + internal__static_bnet_protocol_friends_GenericFriendRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_friends_GenericFriendRequest__Descriptor, + new string[] { "AgentId", "TargetId", }); + internal__static_bnet_protocol_friends_GenericFriendResponse__Descriptor = Descriptor.MessageTypes[4]; + internal__static_bnet_protocol_friends_GenericFriendResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_friends_GenericFriendResponse__Descriptor, + new string[] { "TargetFriend", }); + internal__static_bnet_protocol_friends_AssignRoleRequest__Descriptor = Descriptor.MessageTypes[5]; + internal__static_bnet_protocol_friends_AssignRoleRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_friends_AssignRoleRequest__Descriptor, + new string[] { "AgentId", "TargetId", "Role", }); + internal__static_bnet_protocol_friends_ViewFriendsRequest__Descriptor = Descriptor.MessageTypes[6]; + internal__static_bnet_protocol_friends_ViewFriendsRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_friends_ViewFriendsRequest__Descriptor, + new string[] { "AgentId", "TargetId", "Filter", "StartIndex", "MaxResults", }); + internal__static_bnet_protocol_friends_ViewFriendsResponse__Descriptor = Descriptor.MessageTypes[7]; + internal__static_bnet_protocol_friends_ViewFriendsResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_friends_ViewFriendsResponse__Descriptor, + new string[] { "Friends", "TotalResults", }); + internal__static_bnet_protocol_friends_UpdateFriendStateRequest__Descriptor = Descriptor.MessageTypes[8]; + internal__static_bnet_protocol_friends_UpdateFriendStateRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_friends_UpdateFriendStateRequest__Descriptor, + new string[] { "AgentId", "TargetId", "Attribute", "AttributesEpoch", }); + internal__static_bnet_protocol_friends_FriendNotification__Descriptor = Descriptor.MessageTypes[9]; + internal__static_bnet_protocol_friends_FriendNotification__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_friends_FriendNotification__Descriptor, + new string[] { "Target", "GameAccountId", }); + internal__static_bnet_protocol_friends_UpdateFriendStateNotification__Descriptor = Descriptor.MessageTypes[10]; + internal__static_bnet_protocol_friends_UpdateFriendStateNotification__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_friends_UpdateFriendStateNotification__Descriptor, + new string[] { "ChangedFriend", "GameAccountId", }); + internal__static_bnet_protocol_friends_InvitationNotification__Descriptor = Descriptor.MessageTypes[11]; + internal__static_bnet_protocol_friends_InvitationNotification__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_friends_InvitationNotification__Descriptor, + new string[] { "Invitation", "GameAccountId", "Reason", }); + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + RegisterAllExtensions(registry); + global::bnet.protocol.friends.FriendsTypes.RegisterAllExtensions(registry); + global::bnet.protocol.invitation.InvitationTypes.RegisterAllExtensions(registry); + global::bnet.protocol.Proto.RoleSet.RegisterAllExtensions(registry); + global::bnet.protocol.attribute.Proto.Attribute.RegisterAllExtensions(registry); + global::bnet.protocol.Entity.RegisterAllExtensions(registry); + global::bnet.protocol.Rpc.RegisterAllExtensions(registry); + return registry; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::bnet.protocol.friends.FriendsTypes.Descriptor, + global::bnet.protocol.invitation.InvitationTypes.Descriptor, + global::bnet.protocol.Proto.RoleSet.Descriptor, + global::bnet.protocol.attribute.Proto.Attribute.Descriptor, + global::bnet.protocol.Entity.Descriptor, + global::bnet.protocol.Rpc.Descriptor, + }, assigner); + } + #endregion + + } } #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class SubscribeToFriendsRequest : pb::GeneratedMessage { - private static readonly SubscribeToFriendsRequest defaultInstance = new Builder().BuildPartial(); + private SubscribeToFriendsRequest() { } + private static readonly SubscribeToFriendsRequest defaultInstance = new SubscribeToFriendsRequest().MakeReadOnly(); + private static readonly string[] _subscribeToFriendsRequestFieldNames = new string[] { "agent_id", "object_id" }; + private static readonly uint[] _subscribeToFriendsRequestFieldTags = new uint[] { 10, 16 }; public static SubscribeToFriendsRequest DefaultInstance { get { return defaultInstance; } } public override SubscribeToFriendsRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override SubscribeToFriendsRequest ThisMessage { @@ -214,26 +235,26 @@ protected override SubscribeToFriendsRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.friends.Friends.internal__static_bnet_protocol_friends_SubscribeToFriendsRequest__Descriptor; } + get { return global::bnet.protocol.friends.Proto.FriendsService.internal__static_bnet_protocol_friends_SubscribeToFriendsRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.friends.Friends.internal__static_bnet_protocol_friends_SubscribeToFriendsRequest__FieldAccessorTable; } + get { return global::bnet.protocol.friends.Proto.FriendsService.internal__static_bnet_protocol_friends_SubscribeToFriendsRequest__FieldAccessorTable; } } public const int AgentIdFieldNumber = 1; private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId agentId_; public bool HasAgentId { get { return hasAgentId; } } public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } + get { return agentId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int ObjectIdFieldNumber = 2; private bool hasObjectId; - private ulong objectId_ = 0UL; + private ulong objectId_; public bool HasObjectId { get { return hasObjectId; } } @@ -251,13 +272,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasAgentId) { - output.WriteMessage(1, AgentId); + string[] field_names = _subscribeToFriendsRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); } - if (HasObjectId) { - output.WriteUInt64(2, ObjectId); + if (hasObjectId) { + output.WriteUInt64(2, field_names[1], ObjectId); } UnknownFields.WriteTo(output); } @@ -269,10 +291,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAgentId) { + if (hasAgentId) { size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); } - if (HasObjectId) { + if (hasObjectId) { size += pb::CodedOutputStream.ComputeUInt64Size(2, ObjectId); } size += UnknownFields.SerializedSize; @@ -305,38 +327,72 @@ public static SubscribeToFriendsRequest ParseDelimitedFrom(global::System.IO.Str public static SubscribeToFriendsRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static SubscribeToFriendsRequest ParseFrom(pb::CodedInputStream input) { + public static SubscribeToFriendsRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SubscribeToFriendsRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static SubscribeToFriendsRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private SubscribeToFriendsRequest MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(SubscribeToFriendsRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SubscribeToFriendsRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SubscribeToFriendsRequest result; + + private SubscribeToFriendsRequest PrepareBuilder() { + if (resultIsReadOnly) { + SubscribeToFriendsRequest original = result; + result = new SubscribeToFriendsRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - SubscribeToFriendsRequest result = new SubscribeToFriendsRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override SubscribeToFriendsRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SubscribeToFriendsRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -348,12 +404,11 @@ public override SubscribeToFriendsRequest DefaultInstanceForType { } public override SubscribeToFriendsRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - SubscribeToFriendsRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -367,6 +422,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SubscribeToFriendsRequest other) { if (other == global::bnet.protocol.friends.SubscribeToFriendsRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAgentId) { MergeAgentId(other.AgentId); } @@ -377,20 +433,31 @@ public override Builder MergeFrom(SubscribeToFriendsRequest other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_subscribeToFriendsRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _subscribeToFriendsRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -402,12 +469,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { + if (result.hasAgentId) { subBuilder.MergeFrom(AgentId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -415,16 +482,21 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 16: { - ObjectId = input.ReadUInt64(); + result.hasObjectId = input.ReadUInt64(ref result.objectId_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasAgentId { - get { return result.HasAgentId; } + get { return result.hasAgentId; } } public global::bnet.protocol.EntityId AgentId { get { return result.AgentId; } @@ -432,19 +504,22 @@ public bool HasAgentId { } public Builder SetAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = value; return this; } public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = builderForValue.Build(); return this; } public Builder MergeAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && + PrepareBuilder(); + if (result.hasAgentId && result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); } else { @@ -454,42 +529,51 @@ public Builder MergeAgentId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearAgentId() { + PrepareBuilder(); result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.agentId_ = null; return this; } public bool HasObjectId { - get { return result.HasObjectId; } + get { return result.hasObjectId; } } public ulong ObjectId { get { return result.ObjectId; } set { SetObjectId(value); } } public Builder SetObjectId(ulong value) { + PrepareBuilder(); result.hasObjectId = true; result.objectId_ = value; return this; } public Builder ClearObjectId() { + PrepareBuilder(); result.hasObjectId = false; result.objectId_ = 0UL; return this; } } static SubscribeToFriendsRequest() { - object.ReferenceEquals(global::bnet.protocol.friends.Friends.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.friends.Proto.FriendsService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class SubscribeToFriendsResponse : pb::GeneratedMessage { - private static readonly SubscribeToFriendsResponse defaultInstance = new Builder().BuildPartial(); + private SubscribeToFriendsResponse() { } + private static readonly SubscribeToFriendsResponse defaultInstance = new SubscribeToFriendsResponse().MakeReadOnly(); + private static readonly string[] _subscribeToFriendsResponseFieldNames = new string[] { "friends", "max_friends", "max_received_invitations", "max_sent_invitations", "received_invitations", "role", "sent_invitations" }; + private static readonly uint[] _subscribeToFriendsResponseFieldTags = new uint[] { 42, 8, 16, 24, 58, 34, 50 }; public static SubscribeToFriendsResponse DefaultInstance { get { return defaultInstance; } } public override SubscribeToFriendsResponse DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override SubscribeToFriendsResponse ThisMessage { @@ -497,16 +581,16 @@ protected override SubscribeToFriendsResponse ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.friends.Friends.internal__static_bnet_protocol_friends_SubscribeToFriendsResponse__Descriptor; } + get { return global::bnet.protocol.friends.Proto.FriendsService.internal__static_bnet_protocol_friends_SubscribeToFriendsResponse__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.friends.Friends.internal__static_bnet_protocol_friends_SubscribeToFriendsResponse__FieldAccessorTable; } + get { return global::bnet.protocol.friends.Proto.FriendsService.internal__static_bnet_protocol_friends_SubscribeToFriendsResponse__FieldAccessorTable; } } - public const int MaxFriendsFieldNumber = 2; + public const int MaxFriendsFieldNumber = 1; private bool hasMaxFriends; - private uint maxFriends_ = 0; + private uint maxFriends_; public bool HasMaxFriends { get { return hasMaxFriends; } } @@ -514,9 +598,9 @@ public uint MaxFriends { get { return maxFriends_; } } - public const int MaxReceivedInvitationsFieldNumber = 3; + public const int MaxReceivedInvitationsFieldNumber = 2; private bool hasMaxReceivedInvitations; - private uint maxReceivedInvitations_ = 0; + private uint maxReceivedInvitations_; public bool HasMaxReceivedInvitations { get { return hasMaxReceivedInvitations; } } @@ -524,9 +608,9 @@ public uint MaxReceivedInvitations { get { return maxReceivedInvitations_; } } - public const int MaxSentInvitationsFieldNumber = 4; + public const int MaxSentInvitationsFieldNumber = 3; private bool hasMaxSentInvitations; - private uint maxSentInvitations_ = 0; + private uint maxSentInvitations_; public bool HasMaxSentInvitations { get { return hasMaxSentInvitations; } } @@ -534,6 +618,18 @@ public uint MaxSentInvitations { get { return maxSentInvitations_; } } + public const int RoleFieldNumber = 4; + private pbc::PopsicleList role_ = new pbc::PopsicleList(); + public scg::IList RoleList { + get { return role_; } + } + public int RoleCount { + get { return role_.Count; } + } + public global::bnet.protocol.Role GetRole(int index) { + return role_[index]; + } + public const int FriendsFieldNumber = 5; private pbc::PopsicleList friends_ = new pbc::PopsicleList(); public scg::IList FriendsList { @@ -572,6 +668,9 @@ public int ReceivedInvitationsCount { public override bool IsInitialized { get { + foreach (global::bnet.protocol.Role element in RoleList) { + if (!element.IsInitialized) return false; + } foreach (global::bnet.protocol.friends.Friend element in FriendsList) { if (!element.IsInitialized) return false; } @@ -585,25 +684,29 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasMaxFriends) { - output.WriteUInt32(2, MaxFriends); + string[] field_names = _subscribeToFriendsResponseFieldNames; + if (hasMaxFriends) { + output.WriteUInt32(1, field_names[1], MaxFriends); + } + if (hasMaxReceivedInvitations) { + output.WriteUInt32(2, field_names[2], MaxReceivedInvitations); } - if (HasMaxReceivedInvitations) { - output.WriteUInt32(3, MaxReceivedInvitations); + if (hasMaxSentInvitations) { + output.WriteUInt32(3, field_names[3], MaxSentInvitations); } - if (HasMaxSentInvitations) { - output.WriteUInt32(4, MaxSentInvitations); + if (role_.Count > 0) { + output.WriteMessageArray(4, field_names[5], role_); } - foreach (global::bnet.protocol.friends.Friend element in FriendsList) { - output.WriteMessage(5, element); + if (friends_.Count > 0) { + output.WriteMessageArray(5, field_names[0], friends_); } - foreach (global::bnet.protocol.invitation.Invitation element in SentInvitationsList) { - output.WriteMessage(6, element); + if (sentInvitations_.Count > 0) { + output.WriteMessageArray(6, field_names[6], sentInvitations_); } - foreach (global::bnet.protocol.invitation.Invitation element in ReceivedInvitationsList) { - output.WriteMessage(7, element); + if (receivedInvitations_.Count > 0) { + output.WriteMessageArray(7, field_names[4], receivedInvitations_); } UnknownFields.WriteTo(output); } @@ -615,14 +718,17 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasMaxFriends) { - size += pb::CodedOutputStream.ComputeUInt32Size(2, MaxFriends); + if (hasMaxFriends) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, MaxFriends); } - if (HasMaxReceivedInvitations) { - size += pb::CodedOutputStream.ComputeUInt32Size(3, MaxReceivedInvitations); + if (hasMaxReceivedInvitations) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, MaxReceivedInvitations); } - if (HasMaxSentInvitations) { - size += pb::CodedOutputStream.ComputeUInt32Size(4, MaxSentInvitations); + if (hasMaxSentInvitations) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, MaxSentInvitations); + } + foreach (global::bnet.protocol.Role element in RoleList) { + size += pb::CodedOutputStream.ComputeMessageSize(4, element); } foreach (global::bnet.protocol.friends.Friend element in FriendsList) { size += pb::CodedOutputStream.ComputeMessageSize(5, element); @@ -663,38 +769,76 @@ public static SubscribeToFriendsResponse ParseDelimitedFrom(global::System.IO.St public static SubscribeToFriendsResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static SubscribeToFriendsResponse ParseFrom(pb::CodedInputStream input) { + public static SubscribeToFriendsResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SubscribeToFriendsResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static SubscribeToFriendsResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private SubscribeToFriendsResponse MakeReadOnly() { + role_.MakeReadOnly(); + friends_.MakeReadOnly(); + sentInvitations_.MakeReadOnly(); + receivedInvitations_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(SubscribeToFriendsResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SubscribeToFriendsResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SubscribeToFriendsResponse result; + + private SubscribeToFriendsResponse PrepareBuilder() { + if (resultIsReadOnly) { + SubscribeToFriendsResponse original = result; + result = new SubscribeToFriendsResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - SubscribeToFriendsResponse result = new SubscribeToFriendsResponse(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override SubscribeToFriendsResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SubscribeToFriendsResponse(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -706,15 +850,11 @@ public override SubscribeToFriendsResponse DefaultInstanceForType { } public override SubscribeToFriendsResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.friends_.MakeReadOnly(); - result.sentInvitations_.MakeReadOnly(); - result.receivedInvitations_.MakeReadOnly(); - SubscribeToFriendsResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -728,6 +868,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SubscribeToFriendsResponse other) { if (other == global::bnet.protocol.friends.SubscribeToFriendsResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.HasMaxFriends) { MaxFriends = other.MaxFriends; } @@ -737,33 +878,47 @@ public override Builder MergeFrom(SubscribeToFriendsResponse other) { if (other.HasMaxSentInvitations) { MaxSentInvitations = other.MaxSentInvitations; } + if (other.role_.Count != 0) { + result.role_.Add(other.role_); + } if (other.friends_.Count != 0) { - base.AddRange(other.friends_, result.friends_); + result.friends_.Add(other.friends_); } if (other.sentInvitations_.Count != 0) { - base.AddRange(other.sentInvitations_, result.sentInvitations_); + result.sentInvitations_.Add(other.sentInvitations_); } if (other.receivedInvitations_.Count != 0) { - base.AddRange(other.receivedInvitations_, result.receivedInvitations_); + result.receivedInvitations_.Add(other.receivedInvitations_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_subscribeToFriendsResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _subscribeToFriendsResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -775,100 +930,153 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasMaxFriends = input.ReadUInt32(ref result.maxFriends_); break; } case 16: { - MaxFriends = input.ReadUInt32(); + result.hasMaxReceivedInvitations = input.ReadUInt32(ref result.maxReceivedInvitations_); break; } case 24: { - MaxReceivedInvitations = input.ReadUInt32(); + result.hasMaxSentInvitations = input.ReadUInt32(ref result.maxSentInvitations_); break; } - case 32: { - MaxSentInvitations = input.ReadUInt32(); + case 34: { + input.ReadMessageArray(tag, field_name, result.role_, global::bnet.protocol.Role.DefaultInstance, extensionRegistry); break; } case 42: { - global::bnet.protocol.friends.Friend.Builder subBuilder = global::bnet.protocol.friends.Friend.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddFriends(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.friends_, global::bnet.protocol.friends.Friend.DefaultInstance, extensionRegistry); break; } case 50: { - global::bnet.protocol.invitation.Invitation.Builder subBuilder = global::bnet.protocol.invitation.Invitation.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddSentInvitations(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.sentInvitations_, global::bnet.protocol.invitation.Invitation.DefaultInstance, extensionRegistry); break; } case 58: { - global::bnet.protocol.invitation.Invitation.Builder subBuilder = global::bnet.protocol.invitation.Invitation.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddReceivedInvitations(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.receivedInvitations_, global::bnet.protocol.invitation.Invitation.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasMaxFriends { - get { return result.HasMaxFriends; } + get { return result.hasMaxFriends; } } public uint MaxFriends { get { return result.MaxFriends; } set { SetMaxFriends(value); } } public Builder SetMaxFriends(uint value) { + PrepareBuilder(); result.hasMaxFriends = true; result.maxFriends_ = value; return this; } public Builder ClearMaxFriends() { + PrepareBuilder(); result.hasMaxFriends = false; result.maxFriends_ = 0; return this; } public bool HasMaxReceivedInvitations { - get { return result.HasMaxReceivedInvitations; } + get { return result.hasMaxReceivedInvitations; } } public uint MaxReceivedInvitations { get { return result.MaxReceivedInvitations; } set { SetMaxReceivedInvitations(value); } } public Builder SetMaxReceivedInvitations(uint value) { + PrepareBuilder(); result.hasMaxReceivedInvitations = true; result.maxReceivedInvitations_ = value; return this; } public Builder ClearMaxReceivedInvitations() { + PrepareBuilder(); result.hasMaxReceivedInvitations = false; result.maxReceivedInvitations_ = 0; return this; } public bool HasMaxSentInvitations { - get { return result.HasMaxSentInvitations; } + get { return result.hasMaxSentInvitations; } } public uint MaxSentInvitations { get { return result.MaxSentInvitations; } set { SetMaxSentInvitations(value); } } public Builder SetMaxSentInvitations(uint value) { + PrepareBuilder(); result.hasMaxSentInvitations = true; result.maxSentInvitations_ = value; return this; } public Builder ClearMaxSentInvitations() { + PrepareBuilder(); result.hasMaxSentInvitations = false; result.maxSentInvitations_ = 0; return this; } + public pbc::IPopsicleList RoleList { + get { return PrepareBuilder().role_; } + } + public int RoleCount { + get { return result.RoleCount; } + } + public global::bnet.protocol.Role GetRole(int index) { + return result.GetRole(index); + } + public Builder SetRole(int index, global::bnet.protocol.Role value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.role_[index] = value; + return this; + } + public Builder SetRole(int index, global::bnet.protocol.Role.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.role_[index] = builderForValue.Build(); + return this; + } + public Builder AddRole(global::bnet.protocol.Role value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.role_.Add(value); + return this; + } + public Builder AddRole(global::bnet.protocol.Role.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.role_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeRole(scg::IEnumerable values) { + PrepareBuilder(); + result.role_.Add(values); + return this; + } + public Builder ClearRole() { + PrepareBuilder(); + result.role_.Clear(); + return this; + } + public pbc::IPopsicleList FriendsList { - get { return result.friends_; } + get { return PrepareBuilder().friends_; } } public int FriendsCount { get { return result.FriendsCount; } @@ -878,35 +1086,41 @@ public int FriendsCount { } public Builder SetFriends(int index, global::bnet.protocol.friends.Friend value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.friends_[index] = value; return this; } public Builder SetFriends(int index, global::bnet.protocol.friends.Friend.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.friends_[index] = builderForValue.Build(); return this; } public Builder AddFriends(global::bnet.protocol.friends.Friend value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.friends_.Add(value); return this; } public Builder AddFriends(global::bnet.protocol.friends.Friend.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.friends_.Add(builderForValue.Build()); return this; } public Builder AddRangeFriends(scg::IEnumerable values) { - base.AddRange(values, result.friends_); + PrepareBuilder(); + result.friends_.Add(values); return this; } public Builder ClearFriends() { + PrepareBuilder(); result.friends_.Clear(); return this; } public pbc::IPopsicleList SentInvitationsList { - get { return result.sentInvitations_; } + get { return PrepareBuilder().sentInvitations_; } } public int SentInvitationsCount { get { return result.SentInvitationsCount; } @@ -916,35 +1130,41 @@ public int SentInvitationsCount { } public Builder SetSentInvitations(int index, global::bnet.protocol.invitation.Invitation value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.sentInvitations_[index] = value; return this; } public Builder SetSentInvitations(int index, global::bnet.protocol.invitation.Invitation.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.sentInvitations_[index] = builderForValue.Build(); return this; } public Builder AddSentInvitations(global::bnet.protocol.invitation.Invitation value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.sentInvitations_.Add(value); return this; } public Builder AddSentInvitations(global::bnet.protocol.invitation.Invitation.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.sentInvitations_.Add(builderForValue.Build()); return this; } public Builder AddRangeSentInvitations(scg::IEnumerable values) { - base.AddRange(values, result.sentInvitations_); + PrepareBuilder(); + result.sentInvitations_.Add(values); return this; } public Builder ClearSentInvitations() { + PrepareBuilder(); result.sentInvitations_.Clear(); return this; } public pbc::IPopsicleList ReceivedInvitationsList { - get { return result.receivedInvitations_; } + get { return PrepareBuilder().receivedInvitations_; } } public int ReceivedInvitationsCount { get { return result.ReceivedInvitationsCount; } @@ -954,46 +1174,58 @@ public int ReceivedInvitationsCount { } public Builder SetReceivedInvitations(int index, global::bnet.protocol.invitation.Invitation value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.receivedInvitations_[index] = value; return this; } public Builder SetReceivedInvitations(int index, global::bnet.protocol.invitation.Invitation.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.receivedInvitations_[index] = builderForValue.Build(); return this; } public Builder AddReceivedInvitations(global::bnet.protocol.invitation.Invitation value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.receivedInvitations_.Add(value); return this; } public Builder AddReceivedInvitations(global::bnet.protocol.invitation.Invitation.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.receivedInvitations_.Add(builderForValue.Build()); return this; } public Builder AddRangeReceivedInvitations(scg::IEnumerable values) { - base.AddRange(values, result.receivedInvitations_); + PrepareBuilder(); + result.receivedInvitations_.Add(values); return this; } public Builder ClearReceivedInvitations() { + PrepareBuilder(); result.receivedInvitations_.Clear(); return this; } } static SubscribeToFriendsResponse() { - object.ReferenceEquals(global::bnet.protocol.friends.Friends.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.friends.Proto.FriendsService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class UnsubscribeToFriendsRequest : pb::GeneratedMessage { - private static readonly UnsubscribeToFriendsRequest defaultInstance = new Builder().BuildPartial(); + private UnsubscribeToFriendsRequest() { } + private static readonly UnsubscribeToFriendsRequest defaultInstance = new UnsubscribeToFriendsRequest().MakeReadOnly(); + private static readonly string[] _unsubscribeToFriendsRequestFieldNames = new string[] { "agent_id", "object_id" }; + private static readonly uint[] _unsubscribeToFriendsRequestFieldTags = new uint[] { 10, 16 }; public static UnsubscribeToFriendsRequest DefaultInstance { get { return defaultInstance; } } public override UnsubscribeToFriendsRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override UnsubscribeToFriendsRequest ThisMessage { @@ -1001,26 +1233,26 @@ protected override UnsubscribeToFriendsRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.friends.Friends.internal__static_bnet_protocol_friends_UnsubscribeToFriendsRequest__Descriptor; } + get { return global::bnet.protocol.friends.Proto.FriendsService.internal__static_bnet_protocol_friends_UnsubscribeToFriendsRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.friends.Friends.internal__static_bnet_protocol_friends_UnsubscribeToFriendsRequest__FieldAccessorTable; } + get { return global::bnet.protocol.friends.Proto.FriendsService.internal__static_bnet_protocol_friends_UnsubscribeToFriendsRequest__FieldAccessorTable; } } public const int AgentIdFieldNumber = 1; private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId agentId_; public bool HasAgentId { get { return hasAgentId; } } public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } + get { return agentId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int ObjectIdFieldNumber = 2; private bool hasObjectId; - private ulong objectId_ = 0UL; + private ulong objectId_; public bool HasObjectId { get { return hasObjectId; } } @@ -1037,13 +1269,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasAgentId) { - output.WriteMessage(1, AgentId); + string[] field_names = _unsubscribeToFriendsRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); } - if (HasObjectId) { - output.WriteUInt64(2, ObjectId); + if (hasObjectId) { + output.WriteUInt64(2, field_names[1], ObjectId); } UnknownFields.WriteTo(output); } @@ -1055,10 +1288,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAgentId) { + if (hasAgentId) { size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); } - if (HasObjectId) { + if (hasObjectId) { size += pb::CodedOutputStream.ComputeUInt64Size(2, ObjectId); } size += UnknownFields.SerializedSize; @@ -1091,38 +1324,72 @@ public static UnsubscribeToFriendsRequest ParseDelimitedFrom(global::System.IO.S public static UnsubscribeToFriendsRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static UnsubscribeToFriendsRequest ParseFrom(pb::CodedInputStream input) { + public static UnsubscribeToFriendsRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static UnsubscribeToFriendsRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static UnsubscribeToFriendsRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private UnsubscribeToFriendsRequest MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(UnsubscribeToFriendsRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(UnsubscribeToFriendsRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private UnsubscribeToFriendsRequest result; + + private UnsubscribeToFriendsRequest PrepareBuilder() { + if (resultIsReadOnly) { + UnsubscribeToFriendsRequest original = result; + result = new UnsubscribeToFriendsRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - UnsubscribeToFriendsRequest result = new UnsubscribeToFriendsRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override UnsubscribeToFriendsRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new UnsubscribeToFriendsRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -1134,12 +1401,11 @@ public override UnsubscribeToFriendsRequest DefaultInstanceForType { } public override UnsubscribeToFriendsRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - UnsubscribeToFriendsRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1153,6 +1419,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(UnsubscribeToFriendsRequest other) { if (other == global::bnet.protocol.friends.UnsubscribeToFriendsRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAgentId) { MergeAgentId(other.AgentId); } @@ -1163,20 +1430,31 @@ public override Builder MergeFrom(UnsubscribeToFriendsRequest other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_unsubscribeToFriendsRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _unsubscribeToFriendsRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1188,12 +1466,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { + if (result.hasAgentId) { subBuilder.MergeFrom(AgentId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1201,16 +1479,21 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 16: { - ObjectId = input.ReadUInt64(); + result.hasObjectId = input.ReadUInt64(ref result.objectId_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasAgentId { - get { return result.HasAgentId; } + get { return result.hasAgentId; } } public global::bnet.protocol.EntityId AgentId { get { return result.AgentId; } @@ -1218,19 +1501,22 @@ public bool HasAgentId { } public Builder SetAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = value; return this; } public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = builderForValue.Build(); return this; } public Builder MergeAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && + PrepareBuilder(); + if (result.hasAgentId && result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); } else { @@ -1240,42 +1526,51 @@ public Builder MergeAgentId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearAgentId() { + PrepareBuilder(); result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.agentId_ = null; return this; } public bool HasObjectId { - get { return result.HasObjectId; } + get { return result.hasObjectId; } } public ulong ObjectId { get { return result.ObjectId; } set { SetObjectId(value); } } public Builder SetObjectId(ulong value) { + PrepareBuilder(); result.hasObjectId = true; result.objectId_ = value; return this; } public Builder ClearObjectId() { + PrepareBuilder(); result.hasObjectId = false; result.objectId_ = 0UL; return this; } } static UnsubscribeToFriendsRequest() { - object.ReferenceEquals(global::bnet.protocol.friends.Friends.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.friends.Proto.FriendsService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class GenericFriendRequest : pb::GeneratedMessage { - private static readonly GenericFriendRequest defaultInstance = new Builder().BuildPartial(); + private GenericFriendRequest() { } + private static readonly GenericFriendRequest defaultInstance = new GenericFriendRequest().MakeReadOnly(); + private static readonly string[] _genericFriendRequestFieldNames = new string[] { "agent_id", "target_id" }; + private static readonly uint[] _genericFriendRequestFieldTags = new uint[] { 10, 18 }; public static GenericFriendRequest DefaultInstance { get { return defaultInstance; } } public override GenericFriendRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override GenericFriendRequest ThisMessage { @@ -1283,31 +1578,31 @@ protected override GenericFriendRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.friends.Friends.internal__static_bnet_protocol_friends_GenericFriendRequest__Descriptor; } + get { return global::bnet.protocol.friends.Proto.FriendsService.internal__static_bnet_protocol_friends_GenericFriendRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.friends.Friends.internal__static_bnet_protocol_friends_GenericFriendRequest__FieldAccessorTable; } + get { return global::bnet.protocol.friends.Proto.FriendsService.internal__static_bnet_protocol_friends_GenericFriendRequest__FieldAccessorTable; } } public const int AgentIdFieldNumber = 1; private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId agentId_; public bool HasAgentId { get { return hasAgentId; } } public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } + get { return agentId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int TargetIdFieldNumber = 2; private bool hasTargetId; - private global::bnet.protocol.EntityId targetId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId targetId_; public bool HasTargetId { get { return hasTargetId; } } public global::bnet.protocol.EntityId TargetId { - get { return targetId_; } + get { return targetId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public override bool IsInitialized { @@ -1321,13 +1616,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasAgentId) { - output.WriteMessage(1, AgentId); + string[] field_names = _genericFriendRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); } - if (HasTargetId) { - output.WriteMessage(2, TargetId); + if (hasTargetId) { + output.WriteMessage(2, field_names[1], TargetId); } UnknownFields.WriteTo(output); } @@ -1339,10 +1635,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAgentId) { + if (hasAgentId) { size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); } - if (HasTargetId) { + if (hasTargetId) { size += pb::CodedOutputStream.ComputeMessageSize(2, TargetId); } size += UnknownFields.SerializedSize; @@ -1375,38 +1671,72 @@ public static GenericFriendRequest ParseDelimitedFrom(global::System.IO.Stream i public static GenericFriendRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static GenericFriendRequest ParseFrom(pb::CodedInputStream input) { + public static GenericFriendRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static GenericFriendRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static GenericFriendRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private GenericFriendRequest MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(GenericFriendRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GenericFriendRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GenericFriendRequest result; + + private GenericFriendRequest PrepareBuilder() { + if (resultIsReadOnly) { + GenericFriendRequest original = result; + result = new GenericFriendRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - GenericFriendRequest result = new GenericFriendRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override GenericFriendRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new GenericFriendRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -1418,12 +1748,11 @@ public override GenericFriendRequest DefaultInstanceForType { } public override GenericFriendRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - GenericFriendRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1437,6 +1766,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(GenericFriendRequest other) { if (other == global::bnet.protocol.friends.GenericFriendRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAgentId) { MergeAgentId(other.AgentId); } @@ -1447,20 +1777,31 @@ public override Builder MergeFrom(GenericFriendRequest other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_genericFriendRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _genericFriendRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1472,12 +1813,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { + if (result.hasAgentId) { subBuilder.MergeFrom(AgentId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1486,7 +1827,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasTargetId) { + if (result.hasTargetId) { subBuilder.MergeFrom(TargetId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1495,11 +1836,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasAgentId { - get { return result.HasAgentId; } + get { return result.hasAgentId; } } public global::bnet.protocol.EntityId AgentId { get { return result.AgentId; } @@ -1507,19 +1853,22 @@ public bool HasAgentId { } public Builder SetAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = value; return this; } public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = builderForValue.Build(); return this; } public Builder MergeAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && + PrepareBuilder(); + if (result.hasAgentId && result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); } else { @@ -1529,13 +1878,14 @@ public Builder MergeAgentId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearAgentId() { + PrepareBuilder(); result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.agentId_ = null; return this; } public bool HasTargetId { - get { return result.HasTargetId; } + get { return result.hasTargetId; } } public global::bnet.protocol.EntityId TargetId { get { return result.TargetId; } @@ -1543,19 +1893,22 @@ public bool HasTargetId { } public Builder SetTargetId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasTargetId = true; result.targetId_ = value; return this; } public Builder SetTargetId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasTargetId = true; result.targetId_ = builderForValue.Build(); return this; } public Builder MergeTargetId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasTargetId && + PrepareBuilder(); + if (result.hasTargetId && result.targetId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.targetId_ = global::bnet.protocol.EntityId.CreateBuilder(result.targetId_).MergeFrom(value).BuildPartial(); } else { @@ -1565,24 +1918,31 @@ public Builder MergeTargetId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearTargetId() { + PrepareBuilder(); result.hasTargetId = false; - result.targetId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.targetId_ = null; return this; } } static GenericFriendRequest() { - object.ReferenceEquals(global::bnet.protocol.friends.Friends.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.friends.Proto.FriendsService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class GenericFriendResponse : pb::GeneratedMessage { - private static readonly GenericFriendResponse defaultInstance = new Builder().BuildPartial(); + private GenericFriendResponse() { } + private static readonly GenericFriendResponse defaultInstance = new GenericFriendResponse().MakeReadOnly(); + private static readonly string[] _genericFriendResponseFieldNames = new string[] { "target_friend" }; + private static readonly uint[] _genericFriendResponseFieldTags = new uint[] { 10 }; public static GenericFriendResponse DefaultInstance { get { return defaultInstance; } } public override GenericFriendResponse DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override GenericFriendResponse ThisMessage { @@ -1590,21 +1950,21 @@ protected override GenericFriendResponse ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.friends.Friends.internal__static_bnet_protocol_friends_GenericFriendResponse__Descriptor; } + get { return global::bnet.protocol.friends.Proto.FriendsService.internal__static_bnet_protocol_friends_GenericFriendResponse__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.friends.Friends.internal__static_bnet_protocol_friends_GenericFriendResponse__FieldAccessorTable; } + get { return global::bnet.protocol.friends.Proto.FriendsService.internal__static_bnet_protocol_friends_GenericFriendResponse__FieldAccessorTable; } } - public const int TargetFriendFieldNumber = 2; + public const int TargetFriendFieldNumber = 1; private bool hasTargetFriend; - private global::bnet.protocol.friends.Friend targetFriend_ = global::bnet.protocol.friends.Friend.DefaultInstance; + private global::bnet.protocol.friends.Friend targetFriend_; public bool HasTargetFriend { get { return hasTargetFriend; } } public global::bnet.protocol.friends.Friend TargetFriend { - get { return targetFriend_; } + get { return targetFriend_ ?? global::bnet.protocol.friends.Friend.DefaultInstance; } } public override bool IsInitialized { @@ -1616,10 +1976,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasTargetFriend) { - output.WriteMessage(2, TargetFriend); + string[] field_names = _genericFriendResponseFieldNames; + if (hasTargetFriend) { + output.WriteMessage(1, field_names[0], TargetFriend); } UnknownFields.WriteTo(output); } @@ -1631,8 +1992,8 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasTargetFriend) { - size += pb::CodedOutputStream.ComputeMessageSize(2, TargetFriend); + if (hasTargetFriend) { + size += pb::CodedOutputStream.ComputeMessageSize(1, TargetFriend); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -1664,38 +2025,72 @@ public static GenericFriendResponse ParseDelimitedFrom(global::System.IO.Stream public static GenericFriendResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static GenericFriendResponse ParseFrom(pb::CodedInputStream input) { + public static GenericFriendResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static GenericFriendResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static GenericFriendResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private GenericFriendResponse MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(GenericFriendResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GenericFriendResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - GenericFriendResponse result = new GenericFriendResponse(); + private bool resultIsReadOnly; + private GenericFriendResponse result; + + private GenericFriendResponse PrepareBuilder() { + if (resultIsReadOnly) { + GenericFriendResponse original = result; + result = new GenericFriendResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override GenericFriendResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new GenericFriendResponse(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -1707,12 +2102,11 @@ public override GenericFriendResponse DefaultInstanceForType { } public override GenericFriendResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - GenericFriendResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1726,6 +2120,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(GenericFriendResponse other) { if (other == global::bnet.protocol.friends.GenericFriendResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.HasTargetFriend) { MergeTargetFriend(other.TargetFriend); } @@ -1733,20 +2128,31 @@ public override Builder MergeFrom(GenericFriendResponse other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_genericFriendResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _genericFriendResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1758,12 +2164,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } - case 18: { + case 10: { global::bnet.protocol.friends.Friend.Builder subBuilder = global::bnet.protocol.friends.Friend.CreateBuilder(); - if (HasTargetFriend) { + if (result.hasTargetFriend) { subBuilder.MergeFrom(TargetFriend); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1772,11 +2178,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasTargetFriend { - get { return result.HasTargetFriend; } + get { return result.hasTargetFriend; } } public global::bnet.protocol.friends.Friend TargetFriend { get { return result.TargetFriend; } @@ -1784,19 +2195,22 @@ public bool HasTargetFriend { } public Builder SetTargetFriend(global::bnet.protocol.friends.Friend value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasTargetFriend = true; result.targetFriend_ = value; return this; } public Builder SetTargetFriend(global::bnet.protocol.friends.Friend.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasTargetFriend = true; result.targetFriend_ = builderForValue.Build(); return this; } public Builder MergeTargetFriend(global::bnet.protocol.friends.Friend value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasTargetFriend && + PrepareBuilder(); + if (result.hasTargetFriend && result.targetFriend_ != global::bnet.protocol.friends.Friend.DefaultInstance) { result.targetFriend_ = global::bnet.protocol.friends.Friend.CreateBuilder(result.targetFriend_).MergeFrom(value).BuildPartial(); } else { @@ -1806,73 +2220,99 @@ public Builder MergeTargetFriend(global::bnet.protocol.friends.Friend value) { return this; } public Builder ClearTargetFriend() { + PrepareBuilder(); result.hasTargetFriend = false; - result.targetFriend_ = global::bnet.protocol.friends.Friend.DefaultInstance; + result.targetFriend_ = null; return this; } } static GenericFriendResponse() { - object.ReferenceEquals(global::bnet.protocol.friends.Friends.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.friends.Proto.FriendsService.Descriptor, null); } } - public sealed partial class SendInvitationRequest : pb::GeneratedMessage { - private static readonly SendInvitationRequest defaultInstance = new Builder().BuildPartial(); - public static SendInvitationRequest DefaultInstance { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class AssignRoleRequest : pb::GeneratedMessage { + private AssignRoleRequest() { } + private static readonly AssignRoleRequest defaultInstance = new AssignRoleRequest().MakeReadOnly(); + private static readonly string[] _assignRoleRequestFieldNames = new string[] { "agent_id", "role", "target_id" }; + private static readonly uint[] _assignRoleRequestFieldTags = new uint[] { 10, 24, 18 }; + public static AssignRoleRequest DefaultInstance { get { return defaultInstance; } } - public override SendInvitationRequest DefaultInstanceForType { - get { return defaultInstance; } + public override AssignRoleRequest DefaultInstanceForType { + get { return DefaultInstance; } } - protected override SendInvitationRequest ThisMessage { + protected override AssignRoleRequest ThisMessage { get { return this; } } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.friends.Friends.internal__static_bnet_protocol_friends_SendInvitationRequest__Descriptor; } + get { return global::bnet.protocol.friends.Proto.FriendsService.internal__static_bnet_protocol_friends_AssignRoleRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.friends.Proto.FriendsService.internal__static_bnet_protocol_friends_AssignRoleRequest__FieldAccessorTable; } } - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.friends.Friends.internal__static_bnet_protocol_friends_SendInvitationRequest__FieldAccessorTable; } + public const int AgentIdFieldNumber = 1; + private bool hasAgentId; + private global::bnet.protocol.EntityId agentId_; + public bool HasAgentId { + get { return hasAgentId; } + } + public global::bnet.protocol.EntityId AgentId { + get { return agentId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } - public const int FriendRequestFieldNumber = 103; - public static pb::GeneratedExtensionBase FriendRequest; - public const int TargetEmailFieldNumber = 3; - private bool hasTargetEmail; - private string targetEmail_ = ""; - public bool HasTargetEmail { - get { return hasTargetEmail; } + public const int TargetIdFieldNumber = 2; + private bool hasTargetId; + private global::bnet.protocol.EntityId targetId_; + public bool HasTargetId { + get { return hasTargetId; } } - public string TargetEmail { - get { return targetEmail_; } + public global::bnet.protocol.EntityId TargetId { + get { return targetId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } - public const int DisplayStringFieldNumber = 4; - private bool hasDisplayString; - private string displayString_ = ""; - public bool HasDisplayString { - get { return hasDisplayString; } + public const int RoleFieldNumber = 3; + private pbc::PopsicleList role_ = new pbc::PopsicleList(); + public scg::IList RoleList { + get { return pbc::Lists.AsReadOnly(role_); } } - public string DisplayString { - get { return displayString_; } + public int RoleCount { + get { return role_.Count; } + } + public int GetRole(int index) { + return role_[index]; } public override bool IsInitialized { get { + if (!hasTargetId) return false; + if (HasAgentId) { + if (!AgentId.IsInitialized) return false; + } + if (!TargetId.IsInitialized) return false; return true; } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasTargetEmail) { - output.WriteString(3, TargetEmail); + string[] field_names = _assignRoleRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); } - if (HasDisplayString) { - output.WriteString(4, DisplayString); + if (hasTargetId) { + output.WriteMessage(2, field_names[2], TargetId); + } + if (role_.Count > 0) { + output.WriteInt32Array(3, field_names[1], role_); } UnknownFields.WriteTo(output); } @@ -1884,11 +2324,19 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasTargetEmail) { - size += pb::CodedOutputStream.ComputeStringSize(3, TargetEmail); + if (hasAgentId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); } - if (HasDisplayString) { - size += pb::CodedOutputStream.ComputeStringSize(4, DisplayString); + if (hasTargetId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, TargetId); + } + { + int dataSize = 0; + foreach (int element in RoleList) { + dataSize += pb::CodedOutputStream.ComputeInt32SizeNoTag(element); + } + size += dataSize; + size += 1 * role_.Count; } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -1896,116 +2344,165 @@ public override int SerializedSize { } } - public static SendInvitationRequest ParseFrom(pb::ByteString data) { + public static AssignRoleRequest ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static SendInvitationRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static AssignRoleRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static SendInvitationRequest ParseFrom(byte[] data) { + public static AssignRoleRequest ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static SendInvitationRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static AssignRoleRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static SendInvitationRequest ParseFrom(global::System.IO.Stream input) { + public static AssignRoleRequest ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SendInvitationRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static AssignRoleRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } - public static SendInvitationRequest ParseDelimitedFrom(global::System.IO.Stream input) { + public static AssignRoleRequest ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static SendInvitationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static AssignRoleRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static SendInvitationRequest ParseFrom(pb::CodedInputStream input) { + public static AssignRoleRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SendInvitationRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static AssignRoleRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private AssignRoleRequest MakeReadOnly() { + role_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SendInvitationRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + public static Builder CreateBuilder(AssignRoleRequest prototype) { + return new Builder(prototype); } - public sealed partial class Builder : pb::GeneratedBuilder { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(AssignRoleRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private AssignRoleRequest result; + + private AssignRoleRequest PrepareBuilder() { + if (resultIsReadOnly) { + AssignRoleRequest original = result; + result = new AssignRoleRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - SendInvitationRequest result = new SendInvitationRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } - protected override SendInvitationRequest MessageBeingBuilt { - get { return result; } + protected override AssignRoleRequest MessageBeingBuilt { + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SendInvitationRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.friends.SendInvitationRequest.Descriptor; } + get { return global::bnet.protocol.friends.AssignRoleRequest.Descriptor; } } - public override SendInvitationRequest DefaultInstanceForType { - get { return global::bnet.protocol.friends.SendInvitationRequest.DefaultInstance; } + public override AssignRoleRequest DefaultInstanceForType { + get { return global::bnet.protocol.friends.AssignRoleRequest.DefaultInstance; } } - public override SendInvitationRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override AssignRoleRequest BuildPartial() { + if (resultIsReadOnly) { + return result; } - SendInvitationRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is SendInvitationRequest) { - return MergeFrom((SendInvitationRequest) other); + if (other is AssignRoleRequest) { + return MergeFrom((AssignRoleRequest) other); } else { base.MergeFrom(other); return this; } } - public override Builder MergeFrom(SendInvitationRequest other) { - if (other == global::bnet.protocol.friends.SendInvitationRequest.DefaultInstance) return this; - if (other.HasTargetEmail) { - TargetEmail = other.TargetEmail; + public override Builder MergeFrom(AssignRoleRequest other) { + if (other == global::bnet.protocol.friends.AssignRoleRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAgentId) { + MergeAgentId(other.AgentId); } - if (other.HasDisplayString) { - DisplayString = other.DisplayString; + if (other.HasTargetId) { + MergeTargetId(other.TargetId); + } + if (other.role_.Count != 0) { + result.role_.Add(other.role_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_assignRoleRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _assignRoleRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -2017,73 +2514,171 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } - case 26: { - TargetEmail = input.ReadString(); + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasAgentId) { + subBuilder.MergeFrom(AgentId); + } + input.ReadMessage(subBuilder, extensionRegistry); + AgentId = subBuilder.BuildPartial(); break; } - case 34: { - DisplayString = input.ReadString(); + case 18: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasTargetId) { + subBuilder.MergeFrom(TargetId); + } + input.ReadMessage(subBuilder, extensionRegistry); + TargetId = subBuilder.BuildPartial(); + break; + } + case 26: + case 24: { + input.ReadInt32Array(tag, field_name, result.role_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } - public bool HasTargetEmail { - get { return result.HasTargetEmail; } + public bool HasAgentId { + get { return result.hasAgentId; } + } + public global::bnet.protocol.EntityId AgentId { + get { return result.AgentId; } + set { SetAgentId(value); } + } + public Builder SetAgentId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAgentId = true; + result.agentId_ = value; + return this; } - public string TargetEmail { - get { return result.TargetEmail; } - set { SetTargetEmail(value); } + public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAgentId = true; + result.agentId_ = builderForValue.Build(); + return this; } - public Builder SetTargetEmail(string value) { + public Builder MergeAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasTargetEmail = true; - result.targetEmail_ = value; + PrepareBuilder(); + if (result.hasAgentId && + result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); + } else { + result.agentId_ = value; + } + result.hasAgentId = true; return this; } - public Builder ClearTargetEmail() { - result.hasTargetEmail = false; - result.targetEmail_ = ""; + public Builder ClearAgentId() { + PrepareBuilder(); + result.hasAgentId = false; + result.agentId_ = null; return this; } - public bool HasDisplayString { - get { return result.HasDisplayString; } + public bool HasTargetId { + get { return result.hasTargetId; } } - public string DisplayString { - get { return result.DisplayString; } - set { SetDisplayString(value); } + public global::bnet.protocol.EntityId TargetId { + get { return result.TargetId; } + set { SetTargetId(value); } } - public Builder SetDisplayString(string value) { + public Builder SetTargetId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasDisplayString = true; - result.displayString_ = value; - return this; - } - public Builder ClearDisplayString() { - result.hasDisplayString = false; - result.displayString_ = ""; + PrepareBuilder(); + result.hasTargetId = true; + result.targetId_ = value; + return this; + } + public Builder SetTargetId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasTargetId = true; + result.targetId_ = builderForValue.Build(); + return this; + } + public Builder MergeTargetId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasTargetId && + result.targetId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.targetId_ = global::bnet.protocol.EntityId.CreateBuilder(result.targetId_).MergeFrom(value).BuildPartial(); + } else { + result.targetId_ = value; + } + result.hasTargetId = true; + return this; + } + public Builder ClearTargetId() { + PrepareBuilder(); + result.hasTargetId = false; + result.targetId_ = null; + return this; + } + + public pbc::IPopsicleList RoleList { + get { return PrepareBuilder().role_; } + } + public int RoleCount { + get { return result.RoleCount; } + } + public int GetRole(int index) { + return result.GetRole(index); + } + public Builder SetRole(int index, int value) { + PrepareBuilder(); + result.role_[index] = value; + return this; + } + public Builder AddRole(int value) { + PrepareBuilder(); + result.role_.Add(value); + return this; + } + public Builder AddRangeRole(scg::IEnumerable values) { + PrepareBuilder(); + result.role_.Add(values); + return this; + } + public Builder ClearRole() { + PrepareBuilder(); + result.role_.Clear(); return this; } } - static SendInvitationRequest() { - object.ReferenceEquals(global::bnet.protocol.friends.Friends.Descriptor, null); - } + static AssignRoleRequest() { + object.ReferenceEquals(global::bnet.protocol.friends.Proto.FriendsService.Descriptor, null); + } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class ViewFriendsRequest : pb::GeneratedMessage { - private static readonly ViewFriendsRequest defaultInstance = new Builder().BuildPartial(); + private ViewFriendsRequest() { } + private static readonly ViewFriendsRequest defaultInstance = new ViewFriendsRequest().MakeReadOnly(); + private static readonly string[] _viewFriendsRequestFieldNames = new string[] { "agent_id", "filter", "max_results", "start_index", "target_id" }; + private static readonly uint[] _viewFriendsRequestFieldTags = new uint[] { 10, 26, 40, 32, 18 }; public static ViewFriendsRequest DefaultInstance { get { return defaultInstance; } } public override ViewFriendsRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ViewFriendsRequest ThisMessage { @@ -2091,46 +2686,46 @@ protected override ViewFriendsRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.friends.Friends.internal__static_bnet_protocol_friends_ViewFriendsRequest__Descriptor; } + get { return global::bnet.protocol.friends.Proto.FriendsService.internal__static_bnet_protocol_friends_ViewFriendsRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.friends.Friends.internal__static_bnet_protocol_friends_ViewFriendsRequest__FieldAccessorTable; } + get { return global::bnet.protocol.friends.Proto.FriendsService.internal__static_bnet_protocol_friends_ViewFriendsRequest__FieldAccessorTable; } } public const int AgentIdFieldNumber = 1; private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId agentId_; public bool HasAgentId { get { return hasAgentId; } } public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } + get { return agentId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int TargetIdFieldNumber = 2; private bool hasTargetId; - private global::bnet.protocol.EntityId targetId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId targetId_; public bool HasTargetId { get { return hasTargetId; } } public global::bnet.protocol.EntityId TargetId { - get { return targetId_; } + get { return targetId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int FilterFieldNumber = 3; private bool hasFilter; - private global::bnet.protocol.attribute.AttributeFilter filter_ = global::bnet.protocol.attribute.AttributeFilter.DefaultInstance; + private global::bnet.protocol.attribute.AttributeFilter filter_; public bool HasFilter { get { return hasFilter; } } public global::bnet.protocol.attribute.AttributeFilter Filter { - get { return filter_; } + get { return filter_ ?? global::bnet.protocol.attribute.AttributeFilter.DefaultInstance; } } public const int StartIndexFieldNumber = 4; private bool hasStartIndex; - private uint startIndex_ = 0; + private uint startIndex_; public bool HasStartIndex { get { return hasStartIndex; } } @@ -2161,22 +2756,23 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasAgentId) { - output.WriteMessage(1, AgentId); + string[] field_names = _viewFriendsRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); } - if (HasTargetId) { - output.WriteMessage(2, TargetId); + if (hasTargetId) { + output.WriteMessage(2, field_names[4], TargetId); } - if (HasFilter) { - output.WriteMessage(3, Filter); + if (hasFilter) { + output.WriteMessage(3, field_names[1], Filter); } - if (HasStartIndex) { - output.WriteUInt32(4, StartIndex); + if (hasStartIndex) { + output.WriteUInt32(4, field_names[3], StartIndex); } - if (HasMaxResults) { - output.WriteUInt32(5, MaxResults); + if (hasMaxResults) { + output.WriteUInt32(5, field_names[2], MaxResults); } UnknownFields.WriteTo(output); } @@ -2188,19 +2784,19 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAgentId) { + if (hasAgentId) { size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); } - if (HasTargetId) { + if (hasTargetId) { size += pb::CodedOutputStream.ComputeMessageSize(2, TargetId); } - if (HasFilter) { + if (hasFilter) { size += pb::CodedOutputStream.ComputeMessageSize(3, Filter); } - if (HasStartIndex) { + if (hasStartIndex) { size += pb::CodedOutputStream.ComputeUInt32Size(4, StartIndex); } - if (HasMaxResults) { + if (hasMaxResults) { size += pb::CodedOutputStream.ComputeUInt32Size(5, MaxResults); } size += UnknownFields.SerializedSize; @@ -2233,38 +2829,72 @@ public static ViewFriendsRequest ParseDelimitedFrom(global::System.IO.Stream inp public static ViewFriendsRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static ViewFriendsRequest ParseFrom(pb::CodedInputStream input) { + public static ViewFriendsRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ViewFriendsRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static ViewFriendsRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private ViewFriendsRequest MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(ViewFriendsRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ViewFriendsRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ViewFriendsRequest result; + + private ViewFriendsRequest PrepareBuilder() { + if (resultIsReadOnly) { + ViewFriendsRequest original = result; + result = new ViewFriendsRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - ViewFriendsRequest result = new ViewFriendsRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override ViewFriendsRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ViewFriendsRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -2276,12 +2906,11 @@ public override ViewFriendsRequest DefaultInstanceForType { } public override ViewFriendsRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - ViewFriendsRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2295,6 +2924,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(ViewFriendsRequest other) { if (other == global::bnet.protocol.friends.ViewFriendsRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAgentId) { MergeAgentId(other.AgentId); } @@ -2314,20 +2944,31 @@ public override Builder MergeFrom(ViewFriendsRequest other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_viewFriendsRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _viewFriendsRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -2339,12 +2980,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { + if (result.hasAgentId) { subBuilder.MergeFrom(AgentId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2353,7 +2994,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasTargetId) { + if (result.hasTargetId) { subBuilder.MergeFrom(TargetId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2362,7 +3003,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 26: { global::bnet.protocol.attribute.AttributeFilter.Builder subBuilder = global::bnet.protocol.attribute.AttributeFilter.CreateBuilder(); - if (HasFilter) { + if (result.hasFilter) { subBuilder.MergeFrom(Filter); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2370,20 +3011,25 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 32: { - StartIndex = input.ReadUInt32(); + result.hasStartIndex = input.ReadUInt32(ref result.startIndex_); break; } case 40: { - MaxResults = input.ReadUInt32(); + result.hasMaxResults = input.ReadUInt32(ref result.maxResults_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasAgentId { - get { return result.HasAgentId; } + get { return result.hasAgentId; } } public global::bnet.protocol.EntityId AgentId { get { return result.AgentId; } @@ -2391,19 +3037,22 @@ public bool HasAgentId { } public Builder SetAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = value; return this; } public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = builderForValue.Build(); return this; } public Builder MergeAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && + PrepareBuilder(); + if (result.hasAgentId && result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); } else { @@ -2413,13 +3062,14 @@ public Builder MergeAgentId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearAgentId() { + PrepareBuilder(); result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.agentId_ = null; return this; } public bool HasTargetId { - get { return result.HasTargetId; } + get { return result.hasTargetId; } } public global::bnet.protocol.EntityId TargetId { get { return result.TargetId; } @@ -2427,19 +3077,22 @@ public bool HasTargetId { } public Builder SetTargetId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasTargetId = true; result.targetId_ = value; return this; } public Builder SetTargetId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasTargetId = true; result.targetId_ = builderForValue.Build(); return this; } public Builder MergeTargetId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasTargetId && + PrepareBuilder(); + if (result.hasTargetId && result.targetId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.targetId_ = global::bnet.protocol.EntityId.CreateBuilder(result.targetId_).MergeFrom(value).BuildPartial(); } else { @@ -2449,13 +3102,14 @@ public Builder MergeTargetId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearTargetId() { + PrepareBuilder(); result.hasTargetId = false; - result.targetId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.targetId_ = null; return this; } public bool HasFilter { - get { return result.HasFilter; } + get { return result.hasFilter; } } public global::bnet.protocol.attribute.AttributeFilter Filter { get { return result.Filter; } @@ -2463,19 +3117,22 @@ public bool HasFilter { } public Builder SetFilter(global::bnet.protocol.attribute.AttributeFilter value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasFilter = true; result.filter_ = value; return this; } public Builder SetFilter(global::bnet.protocol.attribute.AttributeFilter.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasFilter = true; result.filter_ = builderForValue.Build(); return this; } public Builder MergeFilter(global::bnet.protocol.attribute.AttributeFilter value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasFilter && + PrepareBuilder(); + if (result.hasFilter && result.filter_ != global::bnet.protocol.attribute.AttributeFilter.DefaultInstance) { result.filter_ = global::bnet.protocol.attribute.AttributeFilter.CreateBuilder(result.filter_).MergeFrom(value).BuildPartial(); } else { @@ -2485,60 +3142,71 @@ public Builder MergeFilter(global::bnet.protocol.attribute.AttributeFilter value return this; } public Builder ClearFilter() { + PrepareBuilder(); result.hasFilter = false; - result.filter_ = global::bnet.protocol.attribute.AttributeFilter.DefaultInstance; + result.filter_ = null; return this; } public bool HasStartIndex { - get { return result.HasStartIndex; } + get { return result.hasStartIndex; } } public uint StartIndex { get { return result.StartIndex; } set { SetStartIndex(value); } } public Builder SetStartIndex(uint value) { + PrepareBuilder(); result.hasStartIndex = true; result.startIndex_ = value; return this; } public Builder ClearStartIndex() { + PrepareBuilder(); result.hasStartIndex = false; result.startIndex_ = 0; return this; } public bool HasMaxResults { - get { return result.HasMaxResults; } + get { return result.hasMaxResults; } } public uint MaxResults { get { return result.MaxResults; } set { SetMaxResults(value); } } public Builder SetMaxResults(uint value) { + PrepareBuilder(); result.hasMaxResults = true; result.maxResults_ = value; return this; } public Builder ClearMaxResults() { + PrepareBuilder(); result.hasMaxResults = false; result.maxResults_ = 100; return this; } } static ViewFriendsRequest() { - object.ReferenceEquals(global::bnet.protocol.friends.Friends.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.friends.Proto.FriendsService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class ViewFriendsResponse : pb::GeneratedMessage { - private static readonly ViewFriendsResponse defaultInstance = new Builder().BuildPartial(); + private ViewFriendsResponse() { } + private static readonly ViewFriendsResponse defaultInstance = new ViewFriendsResponse().MakeReadOnly(); + private static readonly string[] _viewFriendsResponseFieldNames = new string[] { "friends", "total_results" }; + private static readonly uint[] _viewFriendsResponseFieldTags = new uint[] { 10, 16 }; public static ViewFriendsResponse DefaultInstance { get { return defaultInstance; } } public override ViewFriendsResponse DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ViewFriendsResponse ThisMessage { @@ -2546,11 +3214,11 @@ protected override ViewFriendsResponse ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.friends.Friends.internal__static_bnet_protocol_friends_ViewFriendsResponse__Descriptor; } + get { return global::bnet.protocol.friends.Proto.FriendsService.internal__static_bnet_protocol_friends_ViewFriendsResponse__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.friends.Friends.internal__static_bnet_protocol_friends_ViewFriendsResponse__FieldAccessorTable; } + get { return global::bnet.protocol.friends.Proto.FriendsService.internal__static_bnet_protocol_friends_ViewFriendsResponse__FieldAccessorTable; } } public const int FriendsFieldNumber = 1; @@ -2567,7 +3235,7 @@ public int FriendsCount { public const int TotalResultsFieldNumber = 2; private bool hasTotalResults; - private uint totalResults_ = 0; + private uint totalResults_; public bool HasTotalResults { get { return hasTotalResults; } } @@ -2584,13 +3252,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - foreach (global::bnet.protocol.friends.Friend element in FriendsList) { - output.WriteMessage(1, element); + string[] field_names = _viewFriendsResponseFieldNames; + if (friends_.Count > 0) { + output.WriteMessageArray(1, field_names[0], friends_); } - if (HasTotalResults) { - output.WriteUInt32(2, TotalResults); + if (hasTotalResults) { + output.WriteUInt32(2, field_names[1], TotalResults); } UnknownFields.WriteTo(output); } @@ -2605,7 +3274,7 @@ public override int SerializedSize { foreach (global::bnet.protocol.friends.Friend element in FriendsList) { size += pb::CodedOutputStream.ComputeMessageSize(1, element); } - if (HasTotalResults) { + if (hasTotalResults) { size += pb::CodedOutputStream.ComputeUInt32Size(2, TotalResults); } size += UnknownFields.SerializedSize; @@ -2638,38 +3307,73 @@ public static ViewFriendsResponse ParseDelimitedFrom(global::System.IO.Stream in public static ViewFriendsResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static ViewFriendsResponse ParseFrom(pb::CodedInputStream input) { + public static ViewFriendsResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ViewFriendsResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static ViewFriendsResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private ViewFriendsResponse MakeReadOnly() { + friends_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(ViewFriendsResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ViewFriendsResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ViewFriendsResponse result; + + private ViewFriendsResponse PrepareBuilder() { + if (resultIsReadOnly) { + ViewFriendsResponse original = result; + result = new ViewFriendsResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - ViewFriendsResponse result = new ViewFriendsResponse(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override ViewFriendsResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ViewFriendsResponse(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -2681,13 +3385,11 @@ public override ViewFriendsResponse DefaultInstanceForType { } public override ViewFriendsResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.friends_.MakeReadOnly(); - ViewFriendsResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2701,8 +3403,9 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(ViewFriendsResponse other) { if (other == global::bnet.protocol.friends.ViewFriendsResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.friends_.Count != 0) { - base.AddRange(other.friends_, result.friends_); + result.friends_.Add(other.friends_); } if (other.HasTotalResults) { TotalResults = other.TotalResults; @@ -2711,20 +3414,31 @@ public override Builder MergeFrom(ViewFriendsResponse other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_viewFriendsResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _viewFriendsResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -2736,26 +3450,29 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { - global::bnet.protocol.friends.Friend.Builder subBuilder = global::bnet.protocol.friends.Friend.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddFriends(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.friends_, global::bnet.protocol.friends.Friend.DefaultInstance, extensionRegistry); break; } case 16: { - TotalResults = input.ReadUInt32(); + result.hasTotalResults = input.ReadUInt32(ref result.totalResults_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public pbc::IPopsicleList FriendsList { - get { return result.friends_; } + get { return PrepareBuilder().friends_; } } public int FriendsCount { get { return result.FriendsCount; } @@ -2765,64 +3482,78 @@ public int FriendsCount { } public Builder SetFriends(int index, global::bnet.protocol.friends.Friend value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.friends_[index] = value; return this; } public Builder SetFriends(int index, global::bnet.protocol.friends.Friend.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.friends_[index] = builderForValue.Build(); return this; } public Builder AddFriends(global::bnet.protocol.friends.Friend value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.friends_.Add(value); return this; } public Builder AddFriends(global::bnet.protocol.friends.Friend.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.friends_.Add(builderForValue.Build()); return this; } public Builder AddRangeFriends(scg::IEnumerable values) { - base.AddRange(values, result.friends_); + PrepareBuilder(); + result.friends_.Add(values); return this; } public Builder ClearFriends() { + PrepareBuilder(); result.friends_.Clear(); return this; } public bool HasTotalResults { - get { return result.HasTotalResults; } + get { return result.hasTotalResults; } } public uint TotalResults { get { return result.TotalResults; } set { SetTotalResults(value); } } public Builder SetTotalResults(uint value) { + PrepareBuilder(); result.hasTotalResults = true; result.totalResults_ = value; return this; } public Builder ClearTotalResults() { + PrepareBuilder(); result.hasTotalResults = false; result.totalResults_ = 0; return this; } } static ViewFriendsResponse() { - object.ReferenceEquals(global::bnet.protocol.friends.Friends.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.friends.Proto.FriendsService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class UpdateFriendStateRequest : pb::GeneratedMessage { - private static readonly UpdateFriendStateRequest defaultInstance = new Builder().BuildPartial(); + private UpdateFriendStateRequest() { } + private static readonly UpdateFriendStateRequest defaultInstance = new UpdateFriendStateRequest().MakeReadOnly(); + private static readonly string[] _updateFriendStateRequestFieldNames = new string[] { "agent_id", "attribute", "attributes_epoch", "target_id" }; + private static readonly uint[] _updateFriendStateRequestFieldTags = new uint[] { 10, 26, 32, 18 }; public static UpdateFriendStateRequest DefaultInstance { get { return defaultInstance; } } public override UpdateFriendStateRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override UpdateFriendStateRequest ThisMessage { @@ -2830,31 +3561,31 @@ protected override UpdateFriendStateRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.friends.Friends.internal__static_bnet_protocol_friends_UpdateFriendStateRequest__Descriptor; } + get { return global::bnet.protocol.friends.Proto.FriendsService.internal__static_bnet_protocol_friends_UpdateFriendStateRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.friends.Friends.internal__static_bnet_protocol_friends_UpdateFriendStateRequest__FieldAccessorTable; } + get { return global::bnet.protocol.friends.Proto.FriendsService.internal__static_bnet_protocol_friends_UpdateFriendStateRequest__FieldAccessorTable; } } public const int AgentIdFieldNumber = 1; private bool hasAgentId; - private global::bnet.protocol.EntityId agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId agentId_; public bool HasAgentId { get { return hasAgentId; } } public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } + get { return agentId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int TargetIdFieldNumber = 2; private bool hasTargetId; - private global::bnet.protocol.EntityId targetId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId targetId_; public bool HasTargetId { get { return hasTargetId; } } public global::bnet.protocol.EntityId TargetId { - get { return targetId_; } + get { return targetId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int AttributeFieldNumber = 3; @@ -2869,6 +3600,16 @@ public int AttributeCount { return attribute_[index]; } + public const int AttributesEpochFieldNumber = 4; + private bool hasAttributesEpoch; + private ulong attributesEpoch_; + public bool HasAttributesEpoch { + get { return hasAttributesEpoch; } + } + public ulong AttributesEpoch { + get { return attributesEpoch_; } + } + public override bool IsInitialized { get { if (!hasTargetId) return false; @@ -2883,16 +3624,20 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasAgentId) { - output.WriteMessage(1, AgentId); + string[] field_names = _updateFriendStateRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); } - if (HasTargetId) { - output.WriteMessage(2, TargetId); + if (hasTargetId) { + output.WriteMessage(2, field_names[3], TargetId); } - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - output.WriteMessage(3, element); + if (attribute_.Count > 0) { + output.WriteMessageArray(3, field_names[1], attribute_); + } + if (hasAttributesEpoch) { + output.WriteUInt64(4, field_names[2], AttributesEpoch); } UnknownFields.WriteTo(output); } @@ -2904,15 +3649,18 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAgentId) { + if (hasAgentId) { size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); } - if (HasTargetId) { + if (hasTargetId) { size += pb::CodedOutputStream.ComputeMessageSize(2, TargetId); } foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { size += pb::CodedOutputStream.ComputeMessageSize(3, element); } + if (hasAttributesEpoch) { + size += pb::CodedOutputStream.ComputeUInt64Size(4, AttributesEpoch); + } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; return size; @@ -2943,38 +3691,73 @@ public static UpdateFriendStateRequest ParseDelimitedFrom(global::System.IO.Stre public static UpdateFriendStateRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static UpdateFriendStateRequest ParseFrom(pb::CodedInputStream input) { + public static UpdateFriendStateRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static UpdateFriendStateRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static UpdateFriendStateRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private UpdateFriendStateRequest MakeReadOnly() { + attribute_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(UpdateFriendStateRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(UpdateFriendStateRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private UpdateFriendStateRequest result; + + private UpdateFriendStateRequest PrepareBuilder() { + if (resultIsReadOnly) { + UpdateFriendStateRequest original = result; + result = new UpdateFriendStateRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - UpdateFriendStateRequest result = new UpdateFriendStateRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override UpdateFriendStateRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new UpdateFriendStateRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -2986,13 +3769,11 @@ public override UpdateFriendStateRequest DefaultInstanceForType { } public override UpdateFriendStateRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.attribute_.MakeReadOnly(); - UpdateFriendStateRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -3006,6 +3787,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(UpdateFriendStateRequest other) { if (other == global::bnet.protocol.friends.UpdateFriendStateRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAgentId) { MergeAgentId(other.AgentId); } @@ -3013,26 +3795,40 @@ public override Builder MergeFrom(UpdateFriendStateRequest other) { MergeTargetId(other.TargetId); } if (other.attribute_.Count != 0) { - base.AddRange(other.attribute_, result.attribute_); + result.attribute_.Add(other.attribute_); + } + if (other.HasAttributesEpoch) { + AttributesEpoch = other.AttributesEpoch; } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_updateFriendStateRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _updateFriendStateRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -3044,12 +3840,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { + if (result.hasAgentId) { subBuilder.MergeFrom(AgentId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -3058,7 +3854,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasTargetId) { + if (result.hasTargetId) { subBuilder.MergeFrom(TargetId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -3066,18 +3862,25 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 26: { - global::bnet.protocol.attribute.Attribute.Builder subBuilder = global::bnet.protocol.attribute.Attribute.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddAttribute(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.attribute_, global::bnet.protocol.attribute.Attribute.DefaultInstance, extensionRegistry); + break; + } + case 32: { + result.hasAttributesEpoch = input.ReadUInt64(ref result.attributesEpoch_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasAgentId { - get { return result.HasAgentId; } + get { return result.hasAgentId; } } public global::bnet.protocol.EntityId AgentId { get { return result.AgentId; } @@ -3085,19 +3888,22 @@ public bool HasAgentId { } public Builder SetAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = value; return this; } public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasAgentId = true; result.agentId_ = builderForValue.Build(); return this; } public Builder MergeAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAgentId && + PrepareBuilder(); + if (result.hasAgentId && result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); } else { @@ -3107,13 +3913,14 @@ public Builder MergeAgentId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearAgentId() { + PrepareBuilder(); result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.agentId_ = null; return this; } public bool HasTargetId { - get { return result.HasTargetId; } + get { return result.hasTargetId; } } public global::bnet.protocol.EntityId TargetId { get { return result.TargetId; } @@ -3121,19 +3928,22 @@ public bool HasTargetId { } public Builder SetTargetId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasTargetId = true; result.targetId_ = value; return this; } public Builder SetTargetId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasTargetId = true; result.targetId_ = builderForValue.Build(); return this; } public Builder MergeTargetId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasTargetId && + PrepareBuilder(); + if (result.hasTargetId && result.targetId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.targetId_ = global::bnet.protocol.EntityId.CreateBuilder(result.targetId_).MergeFrom(value).BuildPartial(); } else { @@ -3143,13 +3953,14 @@ public Builder MergeTargetId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearTargetId() { + PrepareBuilder(); result.hasTargetId = false; - result.targetId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.targetId_ = null; return this; } public pbc::IPopsicleList AttributeList { - get { return result.attribute_; } + get { return PrepareBuilder().attribute_; } } public int AttributeCount { get { return result.AttributeCount; } @@ -3159,100 +3970,131 @@ public int AttributeCount { } public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.attribute_[index] = value; return this; } public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.attribute_[index] = builderForValue.Build(); return this; } public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.attribute_.Add(value); return this; } public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.attribute_.Add(builderForValue.Build()); return this; } public Builder AddRangeAttribute(scg::IEnumerable values) { - base.AddRange(values, result.attribute_); + PrepareBuilder(); + result.attribute_.Add(values); return this; } public Builder ClearAttribute() { + PrepareBuilder(); result.attribute_.Clear(); return this; } + + public bool HasAttributesEpoch { + get { return result.hasAttributesEpoch; } + } + public ulong AttributesEpoch { + get { return result.AttributesEpoch; } + set { SetAttributesEpoch(value); } + } + public Builder SetAttributesEpoch(ulong value) { + PrepareBuilder(); + result.hasAttributesEpoch = true; + result.attributesEpoch_ = value; + return this; + } + public Builder ClearAttributesEpoch() { + PrepareBuilder(); + result.hasAttributesEpoch = false; + result.attributesEpoch_ = 0UL; + return this; + } } static UpdateFriendStateRequest() { - object.ReferenceEquals(global::bnet.protocol.friends.Friends.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.friends.Proto.FriendsService.Descriptor, null); } } - public sealed partial class UpdateFriendStateResponse : pb::GeneratedMessage { - private static readonly UpdateFriendStateResponse defaultInstance = new Builder().BuildPartial(); - public static UpdateFriendStateResponse DefaultInstance { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class FriendNotification : pb::GeneratedMessage { + private FriendNotification() { } + private static readonly FriendNotification defaultInstance = new FriendNotification().MakeReadOnly(); + private static readonly string[] _friendNotificationFieldNames = new string[] { "game_account_id", "target" }; + private static readonly uint[] _friendNotificationFieldTags = new uint[] { 18, 10 }; + public static FriendNotification DefaultInstance { get { return defaultInstance; } } - public override UpdateFriendStateResponse DefaultInstanceForType { - get { return defaultInstance; } + public override FriendNotification DefaultInstanceForType { + get { return DefaultInstance; } } - protected override UpdateFriendStateResponse ThisMessage { + protected override FriendNotification ThisMessage { get { return this; } } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.friends.Friends.internal__static_bnet_protocol_friends_UpdateFriendStateResponse__Descriptor; } + get { return global::bnet.protocol.friends.Proto.FriendsService.internal__static_bnet_protocol_friends_FriendNotification__Descriptor; } } - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.friends.Friends.internal__static_bnet_protocol_friends_UpdateFriendStateResponse__FieldAccessorTable; } + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.friends.Proto.FriendsService.internal__static_bnet_protocol_friends_FriendNotification__FieldAccessorTable; } } - public const int TargetIdFieldNumber = 2; - private bool hasTargetId; - private global::bnet.protocol.EntityId targetId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasTargetId { - get { return hasTargetId; } + public const int TargetFieldNumber = 1; + private bool hasTarget; + private global::bnet.protocol.friends.Friend target_; + public bool HasTarget { + get { return hasTarget; } } - public global::bnet.protocol.EntityId TargetId { - get { return targetId_; } + public global::bnet.protocol.friends.Friend Target { + get { return target_ ?? global::bnet.protocol.friends.Friend.DefaultInstance; } } - public const int AttributeFieldNumber = 3; - private pbc::PopsicleList attribute_ = new pbc::PopsicleList(); - public scg::IList AttributeList { - get { return attribute_; } - } - public int AttributeCount { - get { return attribute_.Count; } + public const int GameAccountIdFieldNumber = 2; + private bool hasGameAccountId; + private global::bnet.protocol.EntityId gameAccountId_; + public bool HasGameAccountId { + get { return hasGameAccountId; } } - public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { - return attribute_[index]; + public global::bnet.protocol.EntityId GameAccountId { + get { return gameAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public override bool IsInitialized { get { - if (!hasTargetId) return false; - if (!TargetId.IsInitialized) return false; - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - if (!element.IsInitialized) return false; + if (!hasTarget) return false; + if (!Target.IsInitialized) return false; + if (HasGameAccountId) { + if (!GameAccountId.IsInitialized) return false; } return true; } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasTargetId) { - output.WriteMessage(2, TargetId); + string[] field_names = _friendNotificationFieldNames; + if (hasTarget) { + output.WriteMessage(1, field_names[1], Target); } - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - output.WriteMessage(3, element); + if (hasGameAccountId) { + output.WriteMessage(2, field_names[0], GameAccountId); } UnknownFields.WriteTo(output); } @@ -3264,11 +4106,11 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasTargetId) { - size += pb::CodedOutputStream.ComputeMessageSize(2, TargetId); + if (hasTarget) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Target); } - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - size += pb::CodedOutputStream.ComputeMessageSize(3, element); + if (hasGameAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, GameAccountId); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -3276,117 +4118,161 @@ public override int SerializedSize { } } - public static UpdateFriendStateResponse ParseFrom(pb::ByteString data) { + public static FriendNotification ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static UpdateFriendStateResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static FriendNotification ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static UpdateFriendStateResponse ParseFrom(byte[] data) { + public static FriendNotification ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static UpdateFriendStateResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static FriendNotification ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static UpdateFriendStateResponse ParseFrom(global::System.IO.Stream input) { + public static FriendNotification ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static UpdateFriendStateResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static FriendNotification ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } - public static UpdateFriendStateResponse ParseDelimitedFrom(global::System.IO.Stream input) { + public static FriendNotification ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static UpdateFriendStateResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static FriendNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static UpdateFriendStateResponse ParseFrom(pb::CodedInputStream input) { + public static FriendNotification ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static UpdateFriendStateResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static FriendNotification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private FriendNotification MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(UpdateFriendStateResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); + public static Builder CreateBuilder(FriendNotification prototype) { + return new Builder(prototype); } - public sealed partial class Builder : pb::GeneratedBuilder { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(FriendNotification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private FriendNotification result; + + private FriendNotification PrepareBuilder() { + if (resultIsReadOnly) { + FriendNotification original = result; + result = new FriendNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - UpdateFriendStateResponse result = new UpdateFriendStateResponse(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } - protected override UpdateFriendStateResponse MessageBeingBuilt { - get { return result; } + protected override FriendNotification MessageBeingBuilt { + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new UpdateFriendStateResponse(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.friends.UpdateFriendStateResponse.Descriptor; } + get { return global::bnet.protocol.friends.FriendNotification.Descriptor; } } - public override UpdateFriendStateResponse DefaultInstanceForType { - get { return global::bnet.protocol.friends.UpdateFriendStateResponse.DefaultInstance; } + public override FriendNotification DefaultInstanceForType { + get { return global::bnet.protocol.friends.FriendNotification.DefaultInstance; } } - public override UpdateFriendStateResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override FriendNotification BuildPartial() { + if (resultIsReadOnly) { + return result; } - result.attribute_.MakeReadOnly(); - UpdateFriendStateResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is UpdateFriendStateResponse) { - return MergeFrom((UpdateFriendStateResponse) other); + if (other is FriendNotification) { + return MergeFrom((FriendNotification) other); } else { base.MergeFrom(other); return this; } } - public override Builder MergeFrom(UpdateFriendStateResponse other) { - if (other == global::bnet.protocol.friends.UpdateFriendStateResponse.DefaultInstance) return this; - if (other.HasTargetId) { - MergeTargetId(other.TargetId); + public override Builder MergeFrom(FriendNotification other) { + if (other == global::bnet.protocol.friends.FriendNotification.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTarget) { + MergeTarget(other.Target); } - if (other.attribute_.Count != 0) { - base.AddRange(other.attribute_, result.attribute_); + if (other.HasGameAccountId) { + MergeGameAccountId(other.GameAccountId); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_friendNotificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _friendNotificationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -3398,152 +4284,189 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } - case 18: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasTargetId) { - subBuilder.MergeFrom(TargetId); + case 10: { + global::bnet.protocol.friends.Friend.Builder subBuilder = global::bnet.protocol.friends.Friend.CreateBuilder(); + if (result.hasTarget) { + subBuilder.MergeFrom(Target); } input.ReadMessage(subBuilder, extensionRegistry); - TargetId = subBuilder.BuildPartial(); + Target = subBuilder.BuildPartial(); break; } - case 26: { - global::bnet.protocol.attribute.Attribute.Builder subBuilder = global::bnet.protocol.attribute.Attribute.CreateBuilder(); + case 18: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasGameAccountId) { + subBuilder.MergeFrom(GameAccountId); + } input.ReadMessage(subBuilder, extensionRegistry); - AddAttribute(subBuilder.BuildPartial()); + GameAccountId = subBuilder.BuildPartial(); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } - public bool HasTargetId { - get { return result.HasTargetId; } + public bool HasTarget { + get { return result.hasTarget; } } - public global::bnet.protocol.EntityId TargetId { - get { return result.TargetId; } - set { SetTargetId(value); } + public global::bnet.protocol.friends.Friend Target { + get { return result.Target; } + set { SetTarget(value); } } - public Builder SetTargetId(global::bnet.protocol.EntityId value) { + public Builder SetTarget(global::bnet.protocol.friends.Friend value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasTargetId = true; - result.targetId_ = value; + PrepareBuilder(); + result.hasTarget = true; + result.target_ = value; return this; } - public Builder SetTargetId(global::bnet.protocol.EntityId.Builder builderForValue) { + public Builder SetTarget(global::bnet.protocol.friends.Friend.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasTargetId = true; - result.targetId_ = builderForValue.Build(); + PrepareBuilder(); + result.hasTarget = true; + result.target_ = builderForValue.Build(); return this; } - public Builder MergeTargetId(global::bnet.protocol.EntityId value) { + public Builder MergeTarget(global::bnet.protocol.friends.Friend value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasTargetId && - result.targetId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.targetId_ = global::bnet.protocol.EntityId.CreateBuilder(result.targetId_).MergeFrom(value).BuildPartial(); + PrepareBuilder(); + if (result.hasTarget && + result.target_ != global::bnet.protocol.friends.Friend.DefaultInstance) { + result.target_ = global::bnet.protocol.friends.Friend.CreateBuilder(result.target_).MergeFrom(value).BuildPartial(); } else { - result.targetId_ = value; + result.target_ = value; } - result.hasTargetId = true; + result.hasTarget = true; return this; } - public Builder ClearTargetId() { - result.hasTargetId = false; - result.targetId_ = global::bnet.protocol.EntityId.DefaultInstance; + public Builder ClearTarget() { + PrepareBuilder(); + result.hasTarget = false; + result.target_ = null; return this; } - public pbc::IPopsicleList AttributeList { - get { return result.attribute_; } - } - public int AttributeCount { - get { return result.AttributeCount; } + public bool HasGameAccountId { + get { return result.hasGameAccountId; } } - public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { - return result.GetAttribute(index); + public global::bnet.protocol.EntityId GameAccountId { + get { return result.GameAccountId; } + set { SetGameAccountId(value); } } - public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { + public Builder SetGameAccountId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - result.attribute_[index] = value; + PrepareBuilder(); + result.hasGameAccountId = true; + result.gameAccountId_ = value; return this; } - public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { + public Builder SetGameAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.attribute_[index] = builderForValue.Build(); + PrepareBuilder(); + result.hasGameAccountId = true; + result.gameAccountId_ = builderForValue.Build(); return this; } - public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { + public Builder MergeGameAccountId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - result.attribute_.Add(value); + PrepareBuilder(); + if (result.hasGameAccountId && + result.gameAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.gameAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccountId_).MergeFrom(value).BuildPartial(); + } else { + result.gameAccountId_ = value; + } + result.hasGameAccountId = true; return this; } - public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.attribute_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeAttribute(scg::IEnumerable values) { - base.AddRange(values, result.attribute_); - return this; - } - public Builder ClearAttribute() { - result.attribute_.Clear(); + public Builder ClearGameAccountId() { + PrepareBuilder(); + result.hasGameAccountId = false; + result.gameAccountId_ = null; return this; } } - static UpdateFriendStateResponse() { - object.ReferenceEquals(global::bnet.protocol.friends.Friends.Descriptor, null); + static FriendNotification() { + object.ReferenceEquals(global::bnet.protocol.friends.Proto.FriendsService.Descriptor, null); } } - public sealed partial class FriendNotification : pb::GeneratedMessage { - private static readonly FriendNotification defaultInstance = new Builder().BuildPartial(); - public static FriendNotification DefaultInstance { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class UpdateFriendStateNotification : pb::GeneratedMessage { + private UpdateFriendStateNotification() { } + private static readonly UpdateFriendStateNotification defaultInstance = new UpdateFriendStateNotification().MakeReadOnly(); + private static readonly string[] _updateFriendStateNotificationFieldNames = new string[] { "changed_friend", "game_account_id" }; + private static readonly uint[] _updateFriendStateNotificationFieldTags = new uint[] { 10, 18 }; + public static UpdateFriendStateNotification DefaultInstance { get { return defaultInstance; } } - public override FriendNotification DefaultInstanceForType { - get { return defaultInstance; } + public override UpdateFriendStateNotification DefaultInstanceForType { + get { return DefaultInstance; } } - protected override FriendNotification ThisMessage { + protected override UpdateFriendStateNotification ThisMessage { get { return this; } } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.friends.Friends.internal__static_bnet_protocol_friends_FriendNotification__Descriptor; } + get { return global::bnet.protocol.friends.Proto.FriendsService.internal__static_bnet_protocol_friends_UpdateFriendStateNotification__Descriptor; } } - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.friends.Friends.internal__static_bnet_protocol_friends_FriendNotification__FieldAccessorTable; } + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.friends.Proto.FriendsService.internal__static_bnet_protocol_friends_UpdateFriendStateNotification__FieldAccessorTable; } } - public const int TargetFieldNumber = 1; - private bool hasTarget; - private global::bnet.protocol.friends.Friend target_ = global::bnet.protocol.friends.Friend.DefaultInstance; - public bool HasTarget { - get { return hasTarget; } + public const int ChangedFriendFieldNumber = 1; + private bool hasChangedFriend; + private global::bnet.protocol.friends.Friend changedFriend_; + public bool HasChangedFriend { + get { return hasChangedFriend; } } - public global::bnet.protocol.friends.Friend Target { - get { return target_; } + public global::bnet.protocol.friends.Friend ChangedFriend { + get { return changedFriend_ ?? global::bnet.protocol.friends.Friend.DefaultInstance; } + } + + public const int GameAccountIdFieldNumber = 2; + private bool hasGameAccountId; + private global::bnet.protocol.EntityId gameAccountId_; + public bool HasGameAccountId { + get { return hasGameAccountId; } + } + public global::bnet.protocol.EntityId GameAccountId { + get { return gameAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public override bool IsInitialized { get { - if (!hasTarget) return false; - if (!Target.IsInitialized) return false; + if (!hasChangedFriend) return false; + if (!ChangedFriend.IsInitialized) return false; + if (HasGameAccountId) { + if (!GameAccountId.IsInitialized) return false; + } return true; } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasTarget) { - output.WriteMessage(1, Target); + string[] field_names = _updateFriendStateNotificationFieldNames; + if (hasChangedFriend) { + output.WriteMessage(1, field_names[0], ChangedFriend); + } + if (hasGameAccountId) { + output.WriteMessage(2, field_names[1], GameAccountId); } UnknownFields.WriteTo(output); } @@ -3555,8 +4478,11 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasTarget) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Target); + if (hasChangedFriend) { + size += pb::CodedOutputStream.ComputeMessageSize(1, ChangedFriend); + } + if (hasGameAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, GameAccountId); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -3564,113 +4490,161 @@ public override int SerializedSize { } } - public static FriendNotification ParseFrom(pb::ByteString data) { + public static UpdateFriendStateNotification ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static FriendNotification ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static UpdateFriendStateNotification ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static FriendNotification ParseFrom(byte[] data) { + public static UpdateFriendStateNotification ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static FriendNotification ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static UpdateFriendStateNotification ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static FriendNotification ParseFrom(global::System.IO.Stream input) { + public static UpdateFriendStateNotification ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static FriendNotification ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static UpdateFriendStateNotification ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } - public static FriendNotification ParseDelimitedFrom(global::System.IO.Stream input) { + public static UpdateFriendStateNotification ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static FriendNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static UpdateFriendStateNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static FriendNotification ParseFrom(pb::CodedInputStream input) { + public static UpdateFriendStateNotification ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static FriendNotification ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static UpdateFriendStateNotification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private UpdateFriendStateNotification MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(FriendNotification prototype) { - return (Builder) new Builder().MergeFrom(prototype); + public static Builder CreateBuilder(UpdateFriendStateNotification prototype) { + return new Builder(prototype); } - public sealed partial class Builder : pb::GeneratedBuilder { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(UpdateFriendStateNotification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - FriendNotification result = new FriendNotification(); + private bool resultIsReadOnly; + private UpdateFriendStateNotification result; - protected override FriendNotification MessageBeingBuilt { - get { return result; } + private UpdateFriendStateNotification PrepareBuilder() { + if (resultIsReadOnly) { + UpdateFriendStateNotification original = result; + result = new UpdateFriendStateNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override UpdateFriendStateNotification MessageBeingBuilt { + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new FriendNotification(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.friends.FriendNotification.Descriptor; } + get { return global::bnet.protocol.friends.UpdateFriendStateNotification.Descriptor; } } - public override FriendNotification DefaultInstanceForType { - get { return global::bnet.protocol.friends.FriendNotification.DefaultInstance; } + public override UpdateFriendStateNotification DefaultInstanceForType { + get { return global::bnet.protocol.friends.UpdateFriendStateNotification.DefaultInstance; } } - public override FriendNotification BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override UpdateFriendStateNotification BuildPartial() { + if (resultIsReadOnly) { + return result; } - FriendNotification returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is FriendNotification) { - return MergeFrom((FriendNotification) other); + if (other is UpdateFriendStateNotification) { + return MergeFrom((UpdateFriendStateNotification) other); } else { base.MergeFrom(other); return this; } } - public override Builder MergeFrom(FriendNotification other) { - if (other == global::bnet.protocol.friends.FriendNotification.DefaultInstance) return this; - if (other.HasTarget) { - MergeTarget(other.Target); + public override Builder MergeFrom(UpdateFriendStateNotification other) { + if (other == global::bnet.protocol.friends.UpdateFriendStateNotification.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasChangedFriend) { + MergeChangedFriend(other.ChangedFriend); + } + if (other.HasGameAccountId) { + MergeGameAccountId(other.GameAccountId); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_updateFriendStateNotificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _updateFriendStateNotificationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -3682,339 +4656,173 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.friends.Friend.Builder subBuilder = global::bnet.protocol.friends.Friend.CreateBuilder(); - if (HasTarget) { - subBuilder.MergeFrom(Target); + if (result.hasChangedFriend) { + subBuilder.MergeFrom(ChangedFriend); } input.ReadMessage(subBuilder, extensionRegistry); - Target = subBuilder.BuildPartial(); + ChangedFriend = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasGameAccountId) { + subBuilder.MergeFrom(GameAccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + GameAccountId = subBuilder.BuildPartial(); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } - public bool HasTarget { - get { return result.HasTarget; } + public bool HasChangedFriend { + get { return result.hasChangedFriend; } } - public global::bnet.protocol.friends.Friend Target { - get { return result.Target; } - set { SetTarget(value); } + public global::bnet.protocol.friends.Friend ChangedFriend { + get { return result.ChangedFriend; } + set { SetChangedFriend(value); } } - public Builder SetTarget(global::bnet.protocol.friends.Friend value) { + public Builder SetChangedFriend(global::bnet.protocol.friends.Friend value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasTarget = true; - result.target_ = value; + PrepareBuilder(); + result.hasChangedFriend = true; + result.changedFriend_ = value; return this; } - public Builder SetTarget(global::bnet.protocol.friends.Friend.Builder builderForValue) { + public Builder SetChangedFriend(global::bnet.protocol.friends.Friend.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasTarget = true; - result.target_ = builderForValue.Build(); + PrepareBuilder(); + result.hasChangedFriend = true; + result.changedFriend_ = builderForValue.Build(); return this; } - public Builder MergeTarget(global::bnet.protocol.friends.Friend value) { + public Builder MergeChangedFriend(global::bnet.protocol.friends.Friend value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasTarget && - result.target_ != global::bnet.protocol.friends.Friend.DefaultInstance) { - result.target_ = global::bnet.protocol.friends.Friend.CreateBuilder(result.target_).MergeFrom(value).BuildPartial(); + PrepareBuilder(); + if (result.hasChangedFriend && + result.changedFriend_ != global::bnet.protocol.friends.Friend.DefaultInstance) { + result.changedFriend_ = global::bnet.protocol.friends.Friend.CreateBuilder(result.changedFriend_).MergeFrom(value).BuildPartial(); } else { - result.target_ = value; + result.changedFriend_ = value; } - result.hasTarget = true; + result.hasChangedFriend = true; return this; } - public Builder ClearTarget() { - result.hasTarget = false; - result.target_ = global::bnet.protocol.friends.Friend.DefaultInstance; + public Builder ClearChangedFriend() { + PrepareBuilder(); + result.hasChangedFriend = false; + result.changedFriend_ = null; return this; } - } - static FriendNotification() { - object.ReferenceEquals(global::bnet.protocol.friends.Friends.Descriptor, null); - } - } - - public sealed partial class InvitationAddedNotification : pb::GeneratedMessage { - private static readonly InvitationAddedNotification defaultInstance = new Builder().BuildPartial(); - public static InvitationAddedNotification DefaultInstance { - get { return defaultInstance; } - } - - public override InvitationAddedNotification DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override InvitationAddedNotification ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.friends.Friends.internal__static_bnet_protocol_friends_InvitationAddedNotification__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.friends.Friends.internal__static_bnet_protocol_friends_InvitationAddedNotification__FieldAccessorTable; } - } - - public const int InvitationFieldNumber = 1; - private bool hasInvitation; - private global::bnet.protocol.invitation.Invitation invitation_ = global::bnet.protocol.invitation.Invitation.DefaultInstance; - public bool HasInvitation { - get { return hasInvitation; } - } - public global::bnet.protocol.invitation.Invitation Invitation { - get { return invitation_; } - } - - public override bool IsInitialized { - get { - if (!hasInvitation) return false; - if (!Invitation.IsInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasInvitation) { - output.WriteMessage(1, Invitation); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasInvitation) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Invitation); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static InvitationAddedNotification ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static InvitationAddedNotification ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static InvitationAddedNotification ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static InvitationAddedNotification ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static InvitationAddedNotification ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static InvitationAddedNotification ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static InvitationAddedNotification ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static InvitationAddedNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static InvitationAddedNotification ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static InvitationAddedNotification ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(InvitationAddedNotification prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - InvitationAddedNotification result = new InvitationAddedNotification(); - - protected override InvitationAddedNotification MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new InvitationAddedNotification(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.friends.InvitationAddedNotification.Descriptor; } - } - - public override InvitationAddedNotification DefaultInstanceForType { - get { return global::bnet.protocol.friends.InvitationAddedNotification.DefaultInstance; } - } - public override InvitationAddedNotification BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - InvitationAddedNotification returnMe = result; - result = null; - return returnMe; + public bool HasGameAccountId { + get { return result.hasGameAccountId; } } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is InvitationAddedNotification) { - return MergeFrom((InvitationAddedNotification) other); - } else { - base.MergeFrom(other); - return this; - } + public global::bnet.protocol.EntityId GameAccountId { + get { return result.GameAccountId; } + set { SetGameAccountId(value); } } - - public override Builder MergeFrom(InvitationAddedNotification other) { - if (other == global::bnet.protocol.friends.InvitationAddedNotification.DefaultInstance) return this; - if (other.HasInvitation) { - MergeInvitation(other.Invitation); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - global::bnet.protocol.invitation.Invitation.Builder subBuilder = global::bnet.protocol.invitation.Invitation.CreateBuilder(); - if (HasInvitation) { - subBuilder.MergeFrom(Invitation); - } - input.ReadMessage(subBuilder, extensionRegistry); - Invitation = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasInvitation { - get { return result.HasInvitation; } - } - public global::bnet.protocol.invitation.Invitation Invitation { - get { return result.Invitation; } - set { SetInvitation(value); } - } - public Builder SetInvitation(global::bnet.protocol.invitation.Invitation value) { + public Builder SetGameAccountId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasInvitation = true; - result.invitation_ = value; + PrepareBuilder(); + result.hasGameAccountId = true; + result.gameAccountId_ = value; return this; } - public Builder SetInvitation(global::bnet.protocol.invitation.Invitation.Builder builderForValue) { + public Builder SetGameAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasInvitation = true; - result.invitation_ = builderForValue.Build(); + PrepareBuilder(); + result.hasGameAccountId = true; + result.gameAccountId_ = builderForValue.Build(); return this; } - public Builder MergeInvitation(global::bnet.protocol.invitation.Invitation value) { + public Builder MergeGameAccountId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasInvitation && - result.invitation_ != global::bnet.protocol.invitation.Invitation.DefaultInstance) { - result.invitation_ = global::bnet.protocol.invitation.Invitation.CreateBuilder(result.invitation_).MergeFrom(value).BuildPartial(); + PrepareBuilder(); + if (result.hasGameAccountId && + result.gameAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.gameAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccountId_).MergeFrom(value).BuildPartial(); } else { - result.invitation_ = value; + result.gameAccountId_ = value; } - result.hasInvitation = true; + result.hasGameAccountId = true; return this; } - public Builder ClearInvitation() { - result.hasInvitation = false; - result.invitation_ = global::bnet.protocol.invitation.Invitation.DefaultInstance; + public Builder ClearGameAccountId() { + PrepareBuilder(); + result.hasGameAccountId = false; + result.gameAccountId_ = null; return this; } } - static InvitationAddedNotification() { - object.ReferenceEquals(global::bnet.protocol.friends.Friends.Descriptor, null); + static UpdateFriendStateNotification() { + object.ReferenceEquals(global::bnet.protocol.friends.Proto.FriendsService.Descriptor, null); } } - public sealed partial class InvitationRemovedNotification : pb::GeneratedMessage { - private static readonly InvitationRemovedNotification defaultInstance = new Builder().BuildPartial(); - public static InvitationRemovedNotification DefaultInstance { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class InvitationNotification : pb::GeneratedMessage { + private InvitationNotification() { } + private static readonly InvitationNotification defaultInstance = new InvitationNotification().MakeReadOnly(); + private static readonly string[] _invitationNotificationFieldNames = new string[] { "game_account_id", "invitation", "reason" }; + private static readonly uint[] _invitationNotificationFieldTags = new uint[] { 18, 10, 24 }; + public static InvitationNotification DefaultInstance { get { return defaultInstance; } } - public override InvitationRemovedNotification DefaultInstanceForType { - get { return defaultInstance; } + public override InvitationNotification DefaultInstanceForType { + get { return DefaultInstance; } } - protected override InvitationRemovedNotification ThisMessage { + protected override InvitationNotification ThisMessage { get { return this; } } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.friends.Friends.internal__static_bnet_protocol_friends_InvitationRemovedNotification__Descriptor; } + get { return global::bnet.protocol.friends.Proto.FriendsService.internal__static_bnet_protocol_friends_InvitationNotification__Descriptor; } } - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.friends.Friends.internal__static_bnet_protocol_friends_InvitationRemovedNotification__FieldAccessorTable; } + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.friends.Proto.FriendsService.internal__static_bnet_protocol_friends_InvitationNotification__FieldAccessorTable; } } public const int InvitationFieldNumber = 1; private bool hasInvitation; - private global::bnet.protocol.invitation.Invitation invitation_ = global::bnet.protocol.invitation.Invitation.DefaultInstance; + private global::bnet.protocol.invitation.Invitation invitation_; public bool HasInvitation { get { return hasInvitation; } } public global::bnet.protocol.invitation.Invitation Invitation { - get { return invitation_; } + get { return invitation_ ?? global::bnet.protocol.invitation.Invitation.DefaultInstance; } } - public const int ReasonFieldNumber = 2; + public const int GameAccountIdFieldNumber = 2; + private bool hasGameAccountId; + private global::bnet.protocol.EntityId gameAccountId_; + public bool HasGameAccountId { + get { return hasGameAccountId; } + } + public global::bnet.protocol.EntityId GameAccountId { + get { return gameAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int ReasonFieldNumber = 3; private bool hasReason; - private uint reason_ = 0; + private uint reason_; public bool HasReason { get { return hasReason; } } @@ -4022,37 +4830,28 @@ public uint Reason { get { return reason_; } } - public const int AddedFriendFieldNumber = 3; - private bool hasAddedFriend; - private global::bnet.protocol.friends.Friend addedFriend_ = global::bnet.protocol.friends.Friend.DefaultInstance; - public bool HasAddedFriend { - get { return hasAddedFriend; } - } - public global::bnet.protocol.friends.Friend AddedFriend { - get { return addedFriend_; } - } - public override bool IsInitialized { get { if (!hasInvitation) return false; if (!Invitation.IsInitialized) return false; - if (HasAddedFriend) { - if (!AddedFriend.IsInitialized) return false; + if (HasGameAccountId) { + if (!GameAccountId.IsInitialized) return false; } return true; } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasInvitation) { - output.WriteMessage(1, Invitation); + string[] field_names = _invitationNotificationFieldNames; + if (hasInvitation) { + output.WriteMessage(1, field_names[1], Invitation); } - if (HasReason) { - output.WriteUInt32(2, Reason); + if (hasGameAccountId) { + output.WriteMessage(2, field_names[0], GameAccountId); } - if (HasAddedFriend) { - output.WriteMessage(3, AddedFriend); + if (hasReason) { + output.WriteUInt32(3, field_names[2], Reason); } UnknownFields.WriteTo(output); } @@ -4064,14 +4863,14 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasInvitation) { + if (hasInvitation) { size += pb::CodedOutputStream.ComputeMessageSize(1, Invitation); } - if (HasReason) { - size += pb::CodedOutputStream.ComputeUInt32Size(2, Reason); + if (hasGameAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, GameAccountId); } - if (HasAddedFriend) { - size += pb::CodedOutputStream.ComputeMessageSize(3, AddedFriend); + if (hasReason) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, Reason); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -4079,119 +4878,164 @@ public override int SerializedSize { } } - public static InvitationRemovedNotification ParseFrom(pb::ByteString data) { + public static InvitationNotification ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static InvitationRemovedNotification ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static InvitationNotification ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static InvitationRemovedNotification ParseFrom(byte[] data) { + public static InvitationNotification ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static InvitationRemovedNotification ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static InvitationNotification ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static InvitationRemovedNotification ParseFrom(global::System.IO.Stream input) { + public static InvitationNotification ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static InvitationRemovedNotification ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static InvitationNotification ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } - public static InvitationRemovedNotification ParseDelimitedFrom(global::System.IO.Stream input) { + public static InvitationNotification ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static InvitationRemovedNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static InvitationNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static InvitationRemovedNotification ParseFrom(pb::CodedInputStream input) { + public static InvitationNotification ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static InvitationRemovedNotification ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static InvitationNotification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private InvitationNotification MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(InvitationRemovedNotification prototype) { - return (Builder) new Builder().MergeFrom(prototype); + public static Builder CreateBuilder(InvitationNotification prototype) { + return new Builder(prototype); } - public sealed partial class Builder : pb::GeneratedBuilder { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(InvitationNotification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - InvitationRemovedNotification result = new InvitationRemovedNotification(); + private bool resultIsReadOnly; + private InvitationNotification result; - protected override InvitationRemovedNotification MessageBeingBuilt { - get { return result; } + private InvitationNotification PrepareBuilder() { + if (resultIsReadOnly) { + InvitationNotification original = result; + result = new InvitationNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override InvitationNotification MessageBeingBuilt { + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new InvitationRemovedNotification(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.friends.InvitationRemovedNotification.Descriptor; } + get { return global::bnet.protocol.friends.InvitationNotification.Descriptor; } } - public override InvitationRemovedNotification DefaultInstanceForType { - get { return global::bnet.protocol.friends.InvitationRemovedNotification.DefaultInstance; } + public override InvitationNotification DefaultInstanceForType { + get { return global::bnet.protocol.friends.InvitationNotification.DefaultInstance; } } - public override InvitationRemovedNotification BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override InvitationNotification BuildPartial() { + if (resultIsReadOnly) { + return result; } - InvitationRemovedNotification returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is InvitationRemovedNotification) { - return MergeFrom((InvitationRemovedNotification) other); + if (other is InvitationNotification) { + return MergeFrom((InvitationNotification) other); } else { base.MergeFrom(other); return this; } } - public override Builder MergeFrom(InvitationRemovedNotification other) { - if (other == global::bnet.protocol.friends.InvitationRemovedNotification.DefaultInstance) return this; + public override Builder MergeFrom(InvitationNotification other) { + if (other == global::bnet.protocol.friends.InvitationNotification.DefaultInstance) return this; + PrepareBuilder(); if (other.HasInvitation) { MergeInvitation(other.Invitation); } + if (other.HasGameAccountId) { + MergeGameAccountId(other.GameAccountId); + } if (other.HasReason) { Reason = other.Reason; } - if (other.HasAddedFriend) { - MergeAddedFriend(other.AddedFriend); - } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_invitationNotificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _invitationNotificationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -4203,38 +5047,43 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.invitation.Invitation.Builder subBuilder = global::bnet.protocol.invitation.Invitation.CreateBuilder(); - if (HasInvitation) { + if (result.hasInvitation) { subBuilder.MergeFrom(Invitation); } input.ReadMessage(subBuilder, extensionRegistry); Invitation = subBuilder.BuildPartial(); break; } - case 16: { - Reason = input.ReadUInt32(); - break; - } - case 26: { - global::bnet.protocol.friends.Friend.Builder subBuilder = global::bnet.protocol.friends.Friend.CreateBuilder(); - if (HasAddedFriend) { - subBuilder.MergeFrom(AddedFriend); + case 18: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasGameAccountId) { + subBuilder.MergeFrom(GameAccountId); } input.ReadMessage(subBuilder, extensionRegistry); - AddedFriend = subBuilder.BuildPartial(); + GameAccountId = subBuilder.BuildPartial(); + break; + } + case 24: { + result.hasReason = input.ReadUInt32(ref result.reason_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasInvitation { - get { return result.HasInvitation; } + get { return result.hasInvitation; } } public global::bnet.protocol.invitation.Invitation Invitation { get { return result.Invitation; } @@ -4242,19 +5091,22 @@ public bool HasInvitation { } public Builder SetInvitation(global::bnet.protocol.invitation.Invitation value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasInvitation = true; result.invitation_ = value; return this; } public Builder SetInvitation(global::bnet.protocol.invitation.Invitation.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasInvitation = true; result.invitation_ = builderForValue.Build(); return this; } public Builder MergeInvitation(global::bnet.protocol.invitation.Invitation value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasInvitation && + PrepareBuilder(); + if (result.hasInvitation && result.invitation_ != global::bnet.protocol.invitation.Invitation.DefaultInstance) { result.invitation_ = global::bnet.protocol.invitation.Invitation.CreateBuilder(result.invitation_).MergeFrom(value).BuildPartial(); } else { @@ -4264,73 +5116,83 @@ public Builder MergeInvitation(global::bnet.protocol.invitation.Invitation value return this; } public Builder ClearInvitation() { + PrepareBuilder(); result.hasInvitation = false; - result.invitation_ = global::bnet.protocol.invitation.Invitation.DefaultInstance; + result.invitation_ = null; + return this; + } + + public bool HasGameAccountId { + get { return result.hasGameAccountId; } + } + public global::bnet.protocol.EntityId GameAccountId { + get { return result.GameAccountId; } + set { SetGameAccountId(value); } + } + public Builder SetGameAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasGameAccountId = true; + result.gameAccountId_ = value; + return this; + } + public Builder SetGameAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasGameAccountId = true; + result.gameAccountId_ = builderForValue.Build(); + return this; + } + public Builder MergeGameAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasGameAccountId && + result.gameAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.gameAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccountId_).MergeFrom(value).BuildPartial(); + } else { + result.gameAccountId_ = value; + } + result.hasGameAccountId = true; + return this; + } + public Builder ClearGameAccountId() { + PrepareBuilder(); + result.hasGameAccountId = false; + result.gameAccountId_ = null; return this; } public bool HasReason { - get { return result.HasReason; } + get { return result.hasReason; } } public uint Reason { get { return result.Reason; } set { SetReason(value); } } public Builder SetReason(uint value) { + PrepareBuilder(); result.hasReason = true; result.reason_ = value; return this; } public Builder ClearReason() { + PrepareBuilder(); result.hasReason = false; result.reason_ = 0; return this; } - - public bool HasAddedFriend { - get { return result.HasAddedFriend; } - } - public global::bnet.protocol.friends.Friend AddedFriend { - get { return result.AddedFriend; } - set { SetAddedFriend(value); } - } - public Builder SetAddedFriend(global::bnet.protocol.friends.Friend value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasAddedFriend = true; - result.addedFriend_ = value; - return this; - } - public Builder SetAddedFriend(global::bnet.protocol.friends.Friend.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasAddedFriend = true; - result.addedFriend_ = builderForValue.Build(); - return this; - } - public Builder MergeAddedFriend(global::bnet.protocol.friends.Friend value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasAddedFriend && - result.addedFriend_ != global::bnet.protocol.friends.Friend.DefaultInstance) { - result.addedFriend_ = global::bnet.protocol.friends.Friend.CreateBuilder(result.addedFriend_).MergeFrom(value).BuildPartial(); - } else { - result.addedFriend_ = value; - } - result.hasAddedFriend = true; - return this; - } - public Builder ClearAddedFriend() { - result.hasAddedFriend = false; - result.addedFriend_ = global::bnet.protocol.friends.Friend.DefaultInstance; - return this; - } } - static InvitationRemovedNotification() { - object.ReferenceEquals(global::bnet.protocol.friends.Friends.Descriptor, null); + static InvitationNotification() { + object.ReferenceEquals(global::bnet.protocol.friends.Proto.FriendsService.Descriptor, null); } } #endregion #region Services + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public abstract class FriendsService : pb::IService { public abstract void SubscribeToFriends( pb::IRpcController controller, @@ -4339,7 +5201,7 @@ public abstract void SubscribeToFriends( public abstract void SendInvitation( pb::IRpcController controller, global::bnet.protocol.invitation.SendInvitationRequest request, - global::System.Action done); + global::System.Action done); public abstract void AcceptInvitation( pb::IRpcController controller, global::bnet.protocol.invitation.GenericRequest request, @@ -4356,6 +5218,10 @@ public abstract void IgnoreInvitation( pb::IRpcController controller, global::bnet.protocol.invitation.GenericRequest request, global::System.Action done); + public abstract void AssignRole( + pb::IRpcController controller, + global::bnet.protocol.friends.AssignRoleRequest request, + global::System.Action done); public abstract void RemoveFriend( pb::IRpcController controller, global::bnet.protocol.friends.GenericFriendRequest request, @@ -4367,14 +5233,14 @@ public abstract void ViewFriends( public abstract void UpdateFriendState( pb::IRpcController controller, global::bnet.protocol.friends.UpdateFriendStateRequest request, - global::System.Action done); + global::System.Action done); public abstract void UnsubscribeToFriends( pb::IRpcController controller, global::bnet.protocol.friends.UnsubscribeToFriendsRequest request, global::System.Action done); public static pbd::ServiceDescriptor Descriptor { - get { return Friends.Descriptor.Services[0]; } + get { return Proto.FriendsService.Descriptor.Services[0]; } } public pbd::ServiceDescriptor DescriptorForType { get { return Descriptor; } @@ -4397,7 +5263,7 @@ public void CallMethod( return; case 1: this.SendInvitation(controller, (global::bnet.protocol.invitation.SendInvitationRequest) request, - pb::RpcUtil.SpecializeCallback( + pb::RpcUtil.SpecializeCallback( done)); return; case 2: @@ -4421,21 +5287,26 @@ public void CallMethod( done)); return; case 6: + this.AssignRole(controller, (global::bnet.protocol.friends.AssignRoleRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 7: this.RemoveFriend(controller, (global::bnet.protocol.friends.GenericFriendRequest) request, pb::RpcUtil.SpecializeCallback( done)); return; - case 7: + case 8: this.ViewFriends(controller, (global::bnet.protocol.friends.ViewFriendsRequest) request, pb::RpcUtil.SpecializeCallback( done)); return; - case 8: + case 9: this.UpdateFriendState(controller, (global::bnet.protocol.friends.UpdateFriendStateRequest) request, - pb::RpcUtil.SpecializeCallback( + pb::RpcUtil.SpecializeCallback( done)); return; - case 9: + case 10: this.UnsubscribeToFriends(controller, (global::bnet.protocol.friends.UnsubscribeToFriendsRequest) request, pb::RpcUtil.SpecializeCallback( done)); @@ -4464,12 +5335,14 @@ public void CallMethod( case 5: return global::bnet.protocol.invitation.GenericRequest.DefaultInstance; case 6: - return global::bnet.protocol.friends.GenericFriendRequest.DefaultInstance; + return global::bnet.protocol.friends.AssignRoleRequest.DefaultInstance; case 7: - return global::bnet.protocol.friends.ViewFriendsRequest.DefaultInstance; + return global::bnet.protocol.friends.GenericFriendRequest.DefaultInstance; case 8: - return global::bnet.protocol.friends.UpdateFriendStateRequest.DefaultInstance; + return global::bnet.protocol.friends.ViewFriendsRequest.DefaultInstance; case 9: + return global::bnet.protocol.friends.UpdateFriendStateRequest.DefaultInstance; + case 10: return global::bnet.protocol.friends.UnsubscribeToFriendsRequest.DefaultInstance; default: throw new global::System.InvalidOperationException("Can't get here."); @@ -4485,7 +5358,7 @@ public void CallMethod( case 0: return global::bnet.protocol.friends.SubscribeToFriendsResponse.DefaultInstance; case 1: - return global::bnet.protocol.invitation.SendInvitationResponse.DefaultInstance; + return global::bnet.protocol.NoData.DefaultInstance; case 2: return global::bnet.protocol.NoData.DefaultInstance; case 3: @@ -4495,13 +5368,15 @@ public void CallMethod( case 5: return global::bnet.protocol.NoData.DefaultInstance; case 6: - return global::bnet.protocol.friends.GenericFriendResponse.DefaultInstance; + return global::bnet.protocol.NoData.DefaultInstance; case 7: - return global::bnet.protocol.friends.ViewFriendsResponse.DefaultInstance; + return global::bnet.protocol.friends.GenericFriendResponse.DefaultInstance; case 8: - return global::bnet.protocol.friends.UpdateFriendStateResponse.DefaultInstance; + return global::bnet.protocol.friends.ViewFriendsResponse.DefaultInstance; case 9: return global::bnet.protocol.NoData.DefaultInstance; + case 10: + return global::bnet.protocol.NoData.DefaultInstance; default: throw new global::System.InvalidOperationException("Can't get here."); } @@ -4511,6 +5386,9 @@ public static Stub CreateStub(pb::IRpcChannel channel) { return new Stub(channel); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public class Stub : global::bnet.protocol.friends.FriendsService { internal Stub(pb::IRpcChannel channel) { this.channel = channel; @@ -4534,10 +5412,10 @@ public override void SubscribeToFriends( public override void SendInvitation( pb::IRpcController controller, global::bnet.protocol.invitation.SendInvitationRequest request, - global::System.Action done) { + global::System.Action done) { channel.CallMethod(Descriptor.Methods[1], - controller, request, global::bnet.protocol.invitation.SendInvitationResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.invitation.SendInvitationResponse.DefaultInstance)); + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); } public override void AcceptInvitation( @@ -4576,11 +5454,20 @@ public override void IgnoreInvitation( pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); } + public override void AssignRole( + pb::IRpcController controller, + global::bnet.protocol.friends.AssignRoleRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[6], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + public override void RemoveFriend( pb::IRpcController controller, global::bnet.protocol.friends.GenericFriendRequest request, global::System.Action done) { - channel.CallMethod(Descriptor.Methods[6], + channel.CallMethod(Descriptor.Methods[7], controller, request, global::bnet.protocol.friends.GenericFriendResponse.DefaultInstance, pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.friends.GenericFriendResponse.DefaultInstance)); } @@ -4589,7 +5476,7 @@ public override void ViewFriends( pb::IRpcController controller, global::bnet.protocol.friends.ViewFriendsRequest request, global::System.Action done) { - channel.CallMethod(Descriptor.Methods[7], + channel.CallMethod(Descriptor.Methods[8], controller, request, global::bnet.protocol.friends.ViewFriendsResponse.DefaultInstance, pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.friends.ViewFriendsResponse.DefaultInstance)); } @@ -4597,22 +5484,25 @@ public override void ViewFriends( public override void UpdateFriendState( pb::IRpcController controller, global::bnet.protocol.friends.UpdateFriendStateRequest request, - global::System.Action done) { - channel.CallMethod(Descriptor.Methods[8], - controller, request, global::bnet.protocol.friends.UpdateFriendStateResponse.DefaultInstance, - pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.friends.UpdateFriendStateResponse.DefaultInstance)); + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[9], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); } public override void UnsubscribeToFriends( pb::IRpcController controller, global::bnet.protocol.friends.UnsubscribeToFriendsRequest request, global::System.Action done) { - channel.CallMethod(Descriptor.Methods[9], + channel.CallMethod(Descriptor.Methods[10], controller, request, global::bnet.protocol.NoData.DefaultInstance, pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); } } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public abstract class FriendsNotify : pb::IService { public abstract void NotifyFriendAdded( pb::IRpcController controller, @@ -4624,19 +5514,27 @@ public abstract void NotifyFriendRemoved( global::System.Action done); public abstract void NotifyReceivedInvitationAdded( pb::IRpcController controller, - global::bnet.protocol.friends.InvitationAddedNotification request, + global::bnet.protocol.friends.InvitationNotification request, global::System.Action done); public abstract void NotifyReceivedInvitationRemoved( pb::IRpcController controller, - global::bnet.protocol.friends.InvitationRemovedNotification request, + global::bnet.protocol.friends.InvitationNotification request, + global::System.Action done); + public abstract void NotifySentInvitationAdded( + pb::IRpcController controller, + global::bnet.protocol.friends.InvitationNotification request, global::System.Action done); public abstract void NotifySentInvitationRemoved( pb::IRpcController controller, - global::bnet.protocol.friends.InvitationRemovedNotification request, + global::bnet.protocol.friends.InvitationNotification request, + global::System.Action done); + public abstract void NotifyUpdateFriendState( + pb::IRpcController controller, + global::bnet.protocol.friends.UpdateFriendStateNotification request, global::System.Action done); public static pbd::ServiceDescriptor Descriptor { - get { return Friends.Descriptor.Services[1]; } + get { return Proto.FriendsService.Descriptor.Services[1]; } } public pbd::ServiceDescriptor DescriptorForType { get { return Descriptor; } @@ -4663,17 +5561,27 @@ public void CallMethod( done)); return; case 2: - this.NotifyReceivedInvitationAdded(controller, (global::bnet.protocol.friends.InvitationAddedNotification) request, + this.NotifyReceivedInvitationAdded(controller, (global::bnet.protocol.friends.InvitationNotification) request, pb::RpcUtil.SpecializeCallback( done)); return; case 3: - this.NotifyReceivedInvitationRemoved(controller, (global::bnet.protocol.friends.InvitationRemovedNotification) request, + this.NotifyReceivedInvitationRemoved(controller, (global::bnet.protocol.friends.InvitationNotification) request, pb::RpcUtil.SpecializeCallback( done)); return; case 4: - this.NotifySentInvitationRemoved(controller, (global::bnet.protocol.friends.InvitationRemovedNotification) request, + this.NotifySentInvitationAdded(controller, (global::bnet.protocol.friends.InvitationNotification) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 5: + this.NotifySentInvitationRemoved(controller, (global::bnet.protocol.friends.InvitationNotification) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 6: + this.NotifyUpdateFriendState(controller, (global::bnet.protocol.friends.UpdateFriendStateNotification) request, pb::RpcUtil.SpecializeCallback( done)); return; @@ -4693,11 +5601,15 @@ public void CallMethod( case 1: return global::bnet.protocol.friends.FriendNotification.DefaultInstance; case 2: - return global::bnet.protocol.friends.InvitationAddedNotification.DefaultInstance; + return global::bnet.protocol.friends.InvitationNotification.DefaultInstance; case 3: - return global::bnet.protocol.friends.InvitationRemovedNotification.DefaultInstance; + return global::bnet.protocol.friends.InvitationNotification.DefaultInstance; case 4: - return global::bnet.protocol.friends.InvitationRemovedNotification.DefaultInstance; + return global::bnet.protocol.friends.InvitationNotification.DefaultInstance; + case 5: + return global::bnet.protocol.friends.InvitationNotification.DefaultInstance; + case 6: + return global::bnet.protocol.friends.UpdateFriendStateNotification.DefaultInstance; default: throw new global::System.InvalidOperationException("Can't get here."); } @@ -4719,6 +5631,10 @@ public void CallMethod( return global::bnet.protocol.NO_RESPONSE.DefaultInstance; case 4: return global::bnet.protocol.NO_RESPONSE.DefaultInstance; + case 5: + return global::bnet.protocol.NO_RESPONSE.DefaultInstance; + case 6: + return global::bnet.protocol.NO_RESPONSE.DefaultInstance; default: throw new global::System.InvalidOperationException("Can't get here."); } @@ -4728,6 +5644,9 @@ public static Stub CreateStub(pb::IRpcChannel channel) { return new Stub(channel); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public class Stub : global::bnet.protocol.friends.FriendsNotify { internal Stub(pb::IRpcChannel channel) { this.channel = channel; @@ -4759,7 +5678,7 @@ public override void NotifyFriendRemoved( public override void NotifyReceivedInvitationAdded( pb::IRpcController controller, - global::bnet.protocol.friends.InvitationAddedNotification request, + global::bnet.protocol.friends.InvitationNotification request, global::System.Action done) { channel.CallMethod(Descriptor.Methods[2], controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, @@ -4768,23 +5687,43 @@ public override void NotifyReceivedInvitationAdded( public override void NotifyReceivedInvitationRemoved( pb::IRpcController controller, - global::bnet.protocol.friends.InvitationRemovedNotification request, + global::bnet.protocol.friends.InvitationNotification request, global::System.Action done) { channel.CallMethod(Descriptor.Methods[3], controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); } - public override void NotifySentInvitationRemoved( + public override void NotifySentInvitationAdded( pb::IRpcController controller, - global::bnet.protocol.friends.InvitationRemovedNotification request, + global::bnet.protocol.friends.InvitationNotification request, global::System.Action done) { channel.CallMethod(Descriptor.Methods[4], controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); } + + public override void NotifySentInvitationRemoved( + pb::IRpcController controller, + global::bnet.protocol.friends.InvitationNotification request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[5], + controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); + } + + public override void NotifyUpdateFriendState( + pb::IRpcController controller, + global::bnet.protocol.friends.UpdateFriendStateNotification request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[6], + controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); + } } } #endregion } + +#endregion Designer generated code diff --git a/src/LibMooNet/bnet/protocol/friends/FriendsTypes.cs b/src/LibMooNet/bnet/protocol/friends/FriendsTypes.cs new file mode 100644 index 00000000..1681fb3c --- /dev/null +++ b/src/LibMooNet/bnet/protocol/friends/FriendsTypes.cs @@ -0,0 +1,1475 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace bnet.protocol.friends { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class FriendsTypes { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + registry.Add(global::bnet.protocol.friends.FriendInvitation.FriendInvitationProp); + registry.Add(global::bnet.protocol.friends.FriendInvitationParams.FriendParams); + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_bnet_protocol_friends_Friend__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_friends_Friend__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_friends_FriendInvitation__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_friends_FriendInvitation__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_friends_FriendInvitationParams__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_friends_FriendInvitationParams__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static FriendsTypes() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "ChhibmV0L2ZyaWVuZHNfdHlwZXMucHJvdG8SFWJuZXQucHJvdG9jb2wuZnJp" + + "ZW5kcxoUYm5ldC9hdHRyaWJ1dGUucHJvdG8aEWJuZXQvZW50aXR5LnByb3Rv" + + "GhtibmV0L2ludml0YXRpb25fdHlwZXMucHJvdG8ipwEKBkZyaWVuZBIjCgJp" + + "ZBgBIAIoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSNQoJYXR0cmlidXRl" + + "GAIgAygLMiIuYm5ldC5wcm90b2NvbC5hdHRyaWJ1dGUuQXR0cmlidXRlEhAK" + + "BHJvbGUYAyADKA1CAhABEhUKCnByaXZpbGVnZXMYBCABKAQ6ATASGAoQYXR0" + + "cmlidXRlc19lcG9jaBgFIAEoBCKtAQoQRnJpZW5kSW52aXRhdGlvbhIdCg5m" + + "aXJzdF9yZWNlaXZlZBgBIAEoCDoFZmFsc2USEAoEcm9sZRgCIAMoDUICEAEy" + + "aAoRZnJpZW5kX2ludml0YXRpb24SJC5ibmV0LnByb3RvY29sLmludml0YXRp" + + "b24uSW52aXRhdGlvbhhnIAEoCzInLmJuZXQucHJvdG9jb2wuZnJpZW5kcy5G" + + "cmllbmRJbnZpdGF0aW9uIqICChZGcmllbmRJbnZpdGF0aW9uUGFyYW1zEhQK" + + "DHRhcmdldF9lbWFpbBgBIAEoCRIZChF0YXJnZXRfYmF0dGxlX3RhZxgCIAEo" + + "CRIaChJpbnZpdGVyX2JhdHRsZV90YWcYAyABKAkSGQoRaW52aXRlcl9mdWxs" + + "X25hbWUYBCABKAkSHAoUaW52aXRlZV9kaXNwbGF5X25hbWUYBSABKAkSEAoE" + + "cm9sZRgGIAMoDUICEAEycAoNZnJpZW5kX3BhcmFtcxIqLmJuZXQucHJvdG9j" + + "b2wuaW52aXRhdGlvbi5JbnZpdGF0aW9uUGFyYW1zGGcgASgLMi0uYm5ldC5w" + + "cm90b2NvbC5mcmllbmRzLkZyaWVuZEludml0YXRpb25QYXJhbXM="); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_bnet_protocol_friends_Friend__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_friends_Friend__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_friends_Friend__Descriptor, + new string[] { "Id", "Attribute", "Role", "Privileges", "AttributesEpoch", }); + internal__static_bnet_protocol_friends_FriendInvitation__Descriptor = Descriptor.MessageTypes[1]; + internal__static_bnet_protocol_friends_FriendInvitation__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_friends_FriendInvitation__Descriptor, + new string[] { "FirstReceived", "Role", }); + global::bnet.protocol.friends.FriendInvitation.FriendInvitationProp = pb::GeneratedSingleExtension.CreateInstance(global::bnet.protocol.friends.FriendInvitation.Descriptor.Extensions[0]); + internal__static_bnet_protocol_friends_FriendInvitationParams__Descriptor = Descriptor.MessageTypes[2]; + internal__static_bnet_protocol_friends_FriendInvitationParams__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_friends_FriendInvitationParams__Descriptor, + new string[] { "TargetEmail", "TargetBattleTag", "InviterBattleTag", "InviterFullName", "InviteeDisplayName", "Role", }); + global::bnet.protocol.friends.FriendInvitationParams.FriendParams = pb::GeneratedSingleExtension.CreateInstance(global::bnet.protocol.friends.FriendInvitationParams.Descriptor.Extensions[0]); + return null; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::bnet.protocol.attribute.Proto.Attribute.Descriptor, + global::bnet.protocol.Entity.Descriptor, + global::bnet.protocol.invitation.InvitationTypes.Descriptor, + }, assigner); + } + #endregion + + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Friend : pb::GeneratedMessage { + private Friend() { } + private static readonly Friend defaultInstance = new Friend().MakeReadOnly(); + private static readonly string[] _friendFieldNames = new string[] { "attribute", "attributes_epoch", "id", "privileges", "role" }; + private static readonly uint[] _friendFieldTags = new uint[] { 18, 40, 10, 32, 26 }; + public static Friend DefaultInstance { + get { return defaultInstance; } + } + + public override Friend DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Friend ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.friends.FriendsTypes.internal__static_bnet_protocol_friends_Friend__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.friends.FriendsTypes.internal__static_bnet_protocol_friends_Friend__FieldAccessorTable; } + } + + public const int IdFieldNumber = 1; + private bool hasId; + private global::bnet.protocol.EntityId id_; + public bool HasId { + get { return hasId; } + } + public global::bnet.protocol.EntityId Id { + get { return id_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int AttributeFieldNumber = 2; + private pbc::PopsicleList attribute_ = new pbc::PopsicleList(); + public scg::IList AttributeList { + get { return attribute_; } + } + public int AttributeCount { + get { return attribute_.Count; } + } + public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { + return attribute_[index]; + } + + public const int RoleFieldNumber = 3; + private int roleMemoizedSerializedSize; + private pbc::PopsicleList role_ = new pbc::PopsicleList(); + public scg::IList RoleList { + get { return pbc::Lists.AsReadOnly(role_); } + } + public int RoleCount { + get { return role_.Count; } + } + public uint GetRole(int index) { + return role_[index]; + } + + public const int PrivilegesFieldNumber = 4; + private bool hasPrivileges; + private ulong privileges_; + public bool HasPrivileges { + get { return hasPrivileges; } + } + public ulong Privileges { + get { return privileges_; } + } + + public const int AttributesEpochFieldNumber = 5; + private bool hasAttributesEpoch; + private ulong attributesEpoch_; + public bool HasAttributesEpoch { + get { return hasAttributesEpoch; } + } + public ulong AttributesEpoch { + get { return attributesEpoch_; } + } + + public override bool IsInitialized { + get { + if (!hasId) return false; + if (!Id.IsInitialized) return false; + foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _friendFieldNames; + if (hasId) { + output.WriteMessage(1, field_names[2], Id); + } + if (attribute_.Count > 0) { + output.WriteMessageArray(2, field_names[0], attribute_); + } + if (role_.Count > 0) { + output.WritePackedUInt32Array(3, field_names[4], roleMemoizedSerializedSize, role_); + } + if (hasPrivileges) { + output.WriteUInt64(4, field_names[3], Privileges); + } + if (hasAttributesEpoch) { + output.WriteUInt64(5, field_names[1], AttributesEpoch); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Id); + } + foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { + size += pb::CodedOutputStream.ComputeMessageSize(2, element); + } + { + int dataSize = 0; + foreach (uint element in RoleList) { + dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); + } + size += dataSize; + if (role_.Count != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); + } + roleMemoizedSerializedSize = dataSize; + } + if (hasPrivileges) { + size += pb::CodedOutputStream.ComputeUInt64Size(4, Privileges); + } + if (hasAttributesEpoch) { + size += pb::CodedOutputStream.ComputeUInt64Size(5, AttributesEpoch); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static Friend ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Friend ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Friend ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Friend ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Friend ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Friend ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Friend ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Friend ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Friend ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Friend ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Friend MakeReadOnly() { + attribute_.MakeReadOnly(); + role_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Friend prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Friend cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Friend result; + + private Friend PrepareBuilder() { + if (resultIsReadOnly) { + Friend original = result; + result = new Friend(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Friend MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.friends.Friend.Descriptor; } + } + + public override Friend DefaultInstanceForType { + get { return global::bnet.protocol.friends.Friend.DefaultInstance; } + } + + public override Friend BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Friend) { + return MergeFrom((Friend) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Friend other) { + if (other == global::bnet.protocol.friends.Friend.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasId) { + MergeId(other.Id); + } + if (other.attribute_.Count != 0) { + result.attribute_.Add(other.attribute_); + } + if (other.role_.Count != 0) { + result.role_.Add(other.role_); + } + if (other.HasPrivileges) { + Privileges = other.Privileges; + } + if (other.HasAttributesEpoch) { + AttributesEpoch = other.AttributesEpoch; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_friendFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _friendFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasId) { + subBuilder.MergeFrom(Id); + } + input.ReadMessage(subBuilder, extensionRegistry); + Id = subBuilder.BuildPartial(); + break; + } + case 18: { + input.ReadMessageArray(tag, field_name, result.attribute_, global::bnet.protocol.attribute.Attribute.DefaultInstance, extensionRegistry); + break; + } + case 26: + case 24: { + input.ReadUInt32Array(tag, field_name, result.role_); + break; + } + case 32: { + result.hasPrivileges = input.ReadUInt64(ref result.privileges_); + break; + } + case 40: { + result.hasAttributesEpoch = input.ReadUInt64(ref result.attributesEpoch_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasId { + get { return result.hasId; } + } + public global::bnet.protocol.EntityId Id { + get { return result.Id; } + set { SetId(value); } + } + public Builder SetId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasId = true; + result.id_ = value; + return this; + } + public Builder SetId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasId = true; + result.id_ = builderForValue.Build(); + return this; + } + public Builder MergeId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasId && + result.id_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.id_ = global::bnet.protocol.EntityId.CreateBuilder(result.id_).MergeFrom(value).BuildPartial(); + } else { + result.id_ = value; + } + result.hasId = true; + return this; + } + public Builder ClearId() { + PrepareBuilder(); + result.hasId = false; + result.id_ = null; + return this; + } + + public pbc::IPopsicleList AttributeList { + get { return PrepareBuilder().attribute_; } + } + public int AttributeCount { + get { return result.AttributeCount; } + } + public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { + return result.GetAttribute(index); + } + public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.attribute_[index] = value; + return this; + } + public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.attribute_[index] = builderForValue.Build(); + return this; + } + public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.attribute_.Add(value); + return this; + } + public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.attribute_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeAttribute(scg::IEnumerable values) { + PrepareBuilder(); + result.attribute_.Add(values); + return this; + } + public Builder ClearAttribute() { + PrepareBuilder(); + result.attribute_.Clear(); + return this; + } + + public pbc::IPopsicleList RoleList { + get { return PrepareBuilder().role_; } + } + public int RoleCount { + get { return result.RoleCount; } + } + public uint GetRole(int index) { + return result.GetRole(index); + } + public Builder SetRole(int index, uint value) { + PrepareBuilder(); + result.role_[index] = value; + return this; + } + public Builder AddRole(uint value) { + PrepareBuilder(); + result.role_.Add(value); + return this; + } + public Builder AddRangeRole(scg::IEnumerable values) { + PrepareBuilder(); + result.role_.Add(values); + return this; + } + public Builder ClearRole() { + PrepareBuilder(); + result.role_.Clear(); + return this; + } + + public bool HasPrivileges { + get { return result.hasPrivileges; } + } + public ulong Privileges { + get { return result.Privileges; } + set { SetPrivileges(value); } + } + public Builder SetPrivileges(ulong value) { + PrepareBuilder(); + result.hasPrivileges = true; + result.privileges_ = value; + return this; + } + public Builder ClearPrivileges() { + PrepareBuilder(); + result.hasPrivileges = false; + result.privileges_ = 0UL; + return this; + } + + public bool HasAttributesEpoch { + get { return result.hasAttributesEpoch; } + } + public ulong AttributesEpoch { + get { return result.AttributesEpoch; } + set { SetAttributesEpoch(value); } + } + public Builder SetAttributesEpoch(ulong value) { + PrepareBuilder(); + result.hasAttributesEpoch = true; + result.attributesEpoch_ = value; + return this; + } + public Builder ClearAttributesEpoch() { + PrepareBuilder(); + result.hasAttributesEpoch = false; + result.attributesEpoch_ = 0UL; + return this; + } + } + static Friend() { + object.ReferenceEquals(global::bnet.protocol.friends.FriendsTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class FriendInvitation : pb::GeneratedMessage { + private FriendInvitation() { } + private static readonly FriendInvitation defaultInstance = new FriendInvitation().MakeReadOnly(); + private static readonly string[] _friendInvitationFieldNames = new string[] { "first_received", "role" }; + private static readonly uint[] _friendInvitationFieldTags = new uint[] { 8, 18 }; + public static FriendInvitation DefaultInstance { + get { return defaultInstance; } + } + + public override FriendInvitation DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override FriendInvitation ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.friends.FriendsTypes.internal__static_bnet_protocol_friends_FriendInvitation__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.friends.FriendsTypes.internal__static_bnet_protocol_friends_FriendInvitation__FieldAccessorTable; } + } + + public const int FriendInvitationFieldNumber = 103; + public static pb::GeneratedExtensionBase FriendInvitationProp; + public const int FirstReceivedFieldNumber = 1; + private bool hasFirstReceived; + private bool firstReceived_; + public bool HasFirstReceived { + get { return hasFirstReceived; } + } + public bool FirstReceived { + get { return firstReceived_; } + } + + public const int RoleFieldNumber = 2; + private int roleMemoizedSerializedSize; + private pbc::PopsicleList role_ = new pbc::PopsicleList(); + public scg::IList RoleList { + get { return pbc::Lists.AsReadOnly(role_); } + } + public int RoleCount { + get { return role_.Count; } + } + public uint GetRole(int index) { + return role_[index]; + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _friendInvitationFieldNames; + if (hasFirstReceived) { + output.WriteBool(1, field_names[0], FirstReceived); + } + if (role_.Count > 0) { + output.WritePackedUInt32Array(2, field_names[1], roleMemoizedSerializedSize, role_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasFirstReceived) { + size += pb::CodedOutputStream.ComputeBoolSize(1, FirstReceived); + } + { + int dataSize = 0; + foreach (uint element in RoleList) { + dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); + } + size += dataSize; + if (role_.Count != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); + } + roleMemoizedSerializedSize = dataSize; + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static FriendInvitation ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FriendInvitation ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FriendInvitation ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FriendInvitation ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FriendInvitation ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FriendInvitation ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static FriendInvitation ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static FriendInvitation ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static FriendInvitation ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FriendInvitation ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private FriendInvitation MakeReadOnly() { + role_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(FriendInvitation prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(FriendInvitation cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private FriendInvitation result; + + private FriendInvitation PrepareBuilder() { + if (resultIsReadOnly) { + FriendInvitation original = result; + result = new FriendInvitation(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override FriendInvitation MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.friends.FriendInvitation.Descriptor; } + } + + public override FriendInvitation DefaultInstanceForType { + get { return global::bnet.protocol.friends.FriendInvitation.DefaultInstance; } + } + + public override FriendInvitation BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is FriendInvitation) { + return MergeFrom((FriendInvitation) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(FriendInvitation other) { + if (other == global::bnet.protocol.friends.FriendInvitation.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasFirstReceived) { + FirstReceived = other.FirstReceived; + } + if (other.role_.Count != 0) { + result.role_.Add(other.role_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_friendInvitationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _friendInvitationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasFirstReceived = input.ReadBool(ref result.firstReceived_); + break; + } + case 18: + case 16: { + input.ReadUInt32Array(tag, field_name, result.role_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasFirstReceived { + get { return result.hasFirstReceived; } + } + public bool FirstReceived { + get { return result.FirstReceived; } + set { SetFirstReceived(value); } + } + public Builder SetFirstReceived(bool value) { + PrepareBuilder(); + result.hasFirstReceived = true; + result.firstReceived_ = value; + return this; + } + public Builder ClearFirstReceived() { + PrepareBuilder(); + result.hasFirstReceived = false; + result.firstReceived_ = false; + return this; + } + + public pbc::IPopsicleList RoleList { + get { return PrepareBuilder().role_; } + } + public int RoleCount { + get { return result.RoleCount; } + } + public uint GetRole(int index) { + return result.GetRole(index); + } + public Builder SetRole(int index, uint value) { + PrepareBuilder(); + result.role_[index] = value; + return this; + } + public Builder AddRole(uint value) { + PrepareBuilder(); + result.role_.Add(value); + return this; + } + public Builder AddRangeRole(scg::IEnumerable values) { + PrepareBuilder(); + result.role_.Add(values); + return this; + } + public Builder ClearRole() { + PrepareBuilder(); + result.role_.Clear(); + return this; + } + } + static FriendInvitation() { + object.ReferenceEquals(global::bnet.protocol.friends.FriendsTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class FriendInvitationParams : pb::GeneratedMessage { + private FriendInvitationParams() { } + private static readonly FriendInvitationParams defaultInstance = new FriendInvitationParams().MakeReadOnly(); + private static readonly string[] _friendInvitationParamsFieldNames = new string[] { "invitee_display_name", "inviter_battle_tag", "inviter_full_name", "role", "target_battle_tag", "target_email" }; + private static readonly uint[] _friendInvitationParamsFieldTags = new uint[] { 42, 26, 34, 50, 18, 10 }; + public static FriendInvitationParams DefaultInstance { + get { return defaultInstance; } + } + + public override FriendInvitationParams DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override FriendInvitationParams ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.friends.FriendsTypes.internal__static_bnet_protocol_friends_FriendInvitationParams__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.friends.FriendsTypes.internal__static_bnet_protocol_friends_FriendInvitationParams__FieldAccessorTable; } + } + + public const int FriendParamsFieldNumber = 103; + public static pb::GeneratedExtensionBase FriendParams; + public const int TargetEmailFieldNumber = 1; + private bool hasTargetEmail; + private string targetEmail_ = ""; + public bool HasTargetEmail { + get { return hasTargetEmail; } + } + public string TargetEmail { + get { return targetEmail_; } + } + + public const int TargetBattleTagFieldNumber = 2; + private bool hasTargetBattleTag; + private string targetBattleTag_ = ""; + public bool HasTargetBattleTag { + get { return hasTargetBattleTag; } + } + public string TargetBattleTag { + get { return targetBattleTag_; } + } + + public const int InviterBattleTagFieldNumber = 3; + private bool hasInviterBattleTag; + private string inviterBattleTag_ = ""; + public bool HasInviterBattleTag { + get { return hasInviterBattleTag; } + } + public string InviterBattleTag { + get { return inviterBattleTag_; } + } + + public const int InviterFullNameFieldNumber = 4; + private bool hasInviterFullName; + private string inviterFullName_ = ""; + public bool HasInviterFullName { + get { return hasInviterFullName; } + } + public string InviterFullName { + get { return inviterFullName_; } + } + + public const int InviteeDisplayNameFieldNumber = 5; + private bool hasInviteeDisplayName; + private string inviteeDisplayName_ = ""; + public bool HasInviteeDisplayName { + get { return hasInviteeDisplayName; } + } + public string InviteeDisplayName { + get { return inviteeDisplayName_; } + } + + public const int RoleFieldNumber = 6; + private int roleMemoizedSerializedSize; + private pbc::PopsicleList role_ = new pbc::PopsicleList(); + public scg::IList RoleList { + get { return pbc::Lists.AsReadOnly(role_); } + } + public int RoleCount { + get { return role_.Count; } + } + public uint GetRole(int index) { + return role_[index]; + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _friendInvitationParamsFieldNames; + if (hasTargetEmail) { + output.WriteString(1, field_names[5], TargetEmail); + } + if (hasTargetBattleTag) { + output.WriteString(2, field_names[4], TargetBattleTag); + } + if (hasInviterBattleTag) { + output.WriteString(3, field_names[1], InviterBattleTag); + } + if (hasInviterFullName) { + output.WriteString(4, field_names[2], InviterFullName); + } + if (hasInviteeDisplayName) { + output.WriteString(5, field_names[0], InviteeDisplayName); + } + if (role_.Count > 0) { + output.WritePackedUInt32Array(6, field_names[3], roleMemoizedSerializedSize, role_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTargetEmail) { + size += pb::CodedOutputStream.ComputeStringSize(1, TargetEmail); + } + if (hasTargetBattleTag) { + size += pb::CodedOutputStream.ComputeStringSize(2, TargetBattleTag); + } + if (hasInviterBattleTag) { + size += pb::CodedOutputStream.ComputeStringSize(3, InviterBattleTag); + } + if (hasInviterFullName) { + size += pb::CodedOutputStream.ComputeStringSize(4, InviterFullName); + } + if (hasInviteeDisplayName) { + size += pb::CodedOutputStream.ComputeStringSize(5, InviteeDisplayName); + } + { + int dataSize = 0; + foreach (uint element in RoleList) { + dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); + } + size += dataSize; + if (role_.Count != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); + } + roleMemoizedSerializedSize = dataSize; + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static FriendInvitationParams ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FriendInvitationParams ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FriendInvitationParams ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FriendInvitationParams ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FriendInvitationParams ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FriendInvitationParams ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static FriendInvitationParams ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static FriendInvitationParams ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static FriendInvitationParams ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FriendInvitationParams ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private FriendInvitationParams MakeReadOnly() { + role_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(FriendInvitationParams prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(FriendInvitationParams cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private FriendInvitationParams result; + + private FriendInvitationParams PrepareBuilder() { + if (resultIsReadOnly) { + FriendInvitationParams original = result; + result = new FriendInvitationParams(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override FriendInvitationParams MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.friends.FriendInvitationParams.Descriptor; } + } + + public override FriendInvitationParams DefaultInstanceForType { + get { return global::bnet.protocol.friends.FriendInvitationParams.DefaultInstance; } + } + + public override FriendInvitationParams BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is FriendInvitationParams) { + return MergeFrom((FriendInvitationParams) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(FriendInvitationParams other) { + if (other == global::bnet.protocol.friends.FriendInvitationParams.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTargetEmail) { + TargetEmail = other.TargetEmail; + } + if (other.HasTargetBattleTag) { + TargetBattleTag = other.TargetBattleTag; + } + if (other.HasInviterBattleTag) { + InviterBattleTag = other.InviterBattleTag; + } + if (other.HasInviterFullName) { + InviterFullName = other.InviterFullName; + } + if (other.HasInviteeDisplayName) { + InviteeDisplayName = other.InviteeDisplayName; + } + if (other.role_.Count != 0) { + result.role_.Add(other.role_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_friendInvitationParamsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _friendInvitationParamsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasTargetEmail = input.ReadString(ref result.targetEmail_); + break; + } + case 18: { + result.hasTargetBattleTag = input.ReadString(ref result.targetBattleTag_); + break; + } + case 26: { + result.hasInviterBattleTag = input.ReadString(ref result.inviterBattleTag_); + break; + } + case 34: { + result.hasInviterFullName = input.ReadString(ref result.inviterFullName_); + break; + } + case 42: { + result.hasInviteeDisplayName = input.ReadString(ref result.inviteeDisplayName_); + break; + } + case 50: + case 48: { + input.ReadUInt32Array(tag, field_name, result.role_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTargetEmail { + get { return result.hasTargetEmail; } + } + public string TargetEmail { + get { return result.TargetEmail; } + set { SetTargetEmail(value); } + } + public Builder SetTargetEmail(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTargetEmail = true; + result.targetEmail_ = value; + return this; + } + public Builder ClearTargetEmail() { + PrepareBuilder(); + result.hasTargetEmail = false; + result.targetEmail_ = ""; + return this; + } + + public bool HasTargetBattleTag { + get { return result.hasTargetBattleTag; } + } + public string TargetBattleTag { + get { return result.TargetBattleTag; } + set { SetTargetBattleTag(value); } + } + public Builder SetTargetBattleTag(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTargetBattleTag = true; + result.targetBattleTag_ = value; + return this; + } + public Builder ClearTargetBattleTag() { + PrepareBuilder(); + result.hasTargetBattleTag = false; + result.targetBattleTag_ = ""; + return this; + } + + public bool HasInviterBattleTag { + get { return result.hasInviterBattleTag; } + } + public string InviterBattleTag { + get { return result.InviterBattleTag; } + set { SetInviterBattleTag(value); } + } + public Builder SetInviterBattleTag(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasInviterBattleTag = true; + result.inviterBattleTag_ = value; + return this; + } + public Builder ClearInviterBattleTag() { + PrepareBuilder(); + result.hasInviterBattleTag = false; + result.inviterBattleTag_ = ""; + return this; + } + + public bool HasInviterFullName { + get { return result.hasInviterFullName; } + } + public string InviterFullName { + get { return result.InviterFullName; } + set { SetInviterFullName(value); } + } + public Builder SetInviterFullName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasInviterFullName = true; + result.inviterFullName_ = value; + return this; + } + public Builder ClearInviterFullName() { + PrepareBuilder(); + result.hasInviterFullName = false; + result.inviterFullName_ = ""; + return this; + } + + public bool HasInviteeDisplayName { + get { return result.hasInviteeDisplayName; } + } + public string InviteeDisplayName { + get { return result.InviteeDisplayName; } + set { SetInviteeDisplayName(value); } + } + public Builder SetInviteeDisplayName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasInviteeDisplayName = true; + result.inviteeDisplayName_ = value; + return this; + } + public Builder ClearInviteeDisplayName() { + PrepareBuilder(); + result.hasInviteeDisplayName = false; + result.inviteeDisplayName_ = ""; + return this; + } + + public pbc::IPopsicleList RoleList { + get { return PrepareBuilder().role_; } + } + public int RoleCount { + get { return result.RoleCount; } + } + public uint GetRole(int index) { + return result.GetRole(index); + } + public Builder SetRole(int index, uint value) { + PrepareBuilder(); + result.role_[index] = value; + return this; + } + public Builder AddRole(uint value) { + PrepareBuilder(); + result.role_.Add(value); + return this; + } + public Builder AddRangeRole(scg::IEnumerable values) { + PrepareBuilder(); + result.role_.Add(values); + return this; + } + public Builder ClearRole() { + PrepareBuilder(); + result.role_.Clear(); + return this; + } + } + static FriendInvitationParams() { + object.ReferenceEquals(global::bnet.protocol.friends.FriendsTypes.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code diff --git a/source/D3Proto/bnet/protocol/game_master/GameFactory.cs b/src/LibMooNet/bnet/protocol/game_master/GameFactory.cs similarity index 55% rename from source/D3Proto/bnet/protocol/game_master/GameFactory.cs rename to src/LibMooNet/bnet/protocol/game_master/GameFactory.cs index 8037d01c..3cb5800c 100644 --- a/source/D3Proto/bnet/protocol/game_master/GameFactory.cs +++ b/src/LibMooNet/bnet/protocol/game_master/GameFactory.cs @@ -1,4 +1,6 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code using pb = global::Google.ProtocolBuffers; using pbc = global::Google.ProtocolBuffers.Collections; @@ -6,6 +8,9 @@ using scg = global::System.Collections.Generic; namespace bnet.protocol.game_master { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public static partial class GameFactory { #region Extension registration @@ -24,18 +29,19 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { static GameFactory() { byte[] descriptorData = global::System.Convert.FromBase64String( - "CiZzZXJ2aWNlL2dhbWVfbWFzdGVyL2dhbWVfZmFjdG9yeS5wcm90bxIZYm5l" + - "dC5wcm90b2NvbC5nYW1lX21hc3RlchocbGliL3Byb3RvY29sL2F0dHJpYnV0" + - "ZS5wcm90bxoZbGliL3Byb3RvY29sL2VudGl0eS5wcm90byKJAQoOR2FtZVBy" + - "b3BlcnRpZXMSOAoGZmlsdGVyGAEgASgLMiguYm5ldC5wcm90b2NvbC5hdHRy" + - "aWJ1dGUuQXR0cmlidXRlRmlsdGVyEhUKBmNyZWF0ZRgCIAEoCDoFZmFsc2US" + - "EgoEb3BlbhgDIAEoCDoEdHJ1ZRISCgpwcm9ncmFtX2lkGAQgASgH"); + "ChdibmV0L2dhbWVfZmFjdG9yeS5wcm90bxIZYm5ldC5wcm90b2NvbC5nYW1l" + + "X21hc3RlchoUYm5ldC9hdHRyaWJ1dGUucHJvdG8aEWJuZXQvZW50aXR5LnBy" + + "b3RvIsoBCg5HYW1lUHJvcGVydGllcxI/ChNjcmVhdGlvbl9hdHRyaWJ1dGVz" + + "GAEgAygLMiIuYm5ldC5wcm90b2NvbC5hdHRyaWJ1dGUuQXR0cmlidXRlEjgK" + + "BmZpbHRlchgCIAEoCzIoLmJuZXQucHJvdG9jb2wuYXR0cmlidXRlLkF0dHJp" + + "YnV0ZUZpbHRlchIVCgZjcmVhdGUYAyABKAg6BWZhbHNlEhIKBG9wZW4YBCAB" + + "KAg6BHRydWUSEgoKcHJvZ3JhbV9pZBgFIAEoBw=="); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_bnet_protocol_game_master_GameProperties__Descriptor = Descriptor.MessageTypes[0]; internal__static_bnet_protocol_game_master_GameProperties__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_GameProperties__Descriptor, - new string[] { "Filter", "Create", "Open", "ProgramId", }); + new string[] { "CreationAttributes", "Filter", "Create", "Open", "ProgramId", }); return null; }; pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, @@ -48,14 +54,20 @@ static GameFactory() { } #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class GameProperties : pb::GeneratedMessage { - private static readonly GameProperties defaultInstance = new Builder().BuildPartial(); + private GameProperties() { } + private static readonly GameProperties defaultInstance = new GameProperties().MakeReadOnly(); + private static readonly string[] _gamePropertiesFieldNames = new string[] { "create", "creation_attributes", "filter", "open", "program_id" }; + private static readonly uint[] _gamePropertiesFieldTags = new uint[] { 24, 10, 18, 32, 45 }; public static GameProperties DefaultInstance { get { return defaultInstance; } } public override GameProperties DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override GameProperties ThisMessage { @@ -70,19 +82,31 @@ protected override GameProperties ThisMessage { get { return global::bnet.protocol.game_master.GameFactory.internal__static_bnet_protocol_game_master_GameProperties__FieldAccessorTable; } } - public const int FilterFieldNumber = 1; + public const int CreationAttributesFieldNumber = 1; + private pbc::PopsicleList creationAttributes_ = new pbc::PopsicleList(); + public scg::IList CreationAttributesList { + get { return creationAttributes_; } + } + public int CreationAttributesCount { + get { return creationAttributes_.Count; } + } + public global::bnet.protocol.attribute.Attribute GetCreationAttributes(int index) { + return creationAttributes_[index]; + } + + public const int FilterFieldNumber = 2; private bool hasFilter; - private global::bnet.protocol.attribute.AttributeFilter filter_ = global::bnet.protocol.attribute.AttributeFilter.DefaultInstance; + private global::bnet.protocol.attribute.AttributeFilter filter_; public bool HasFilter { get { return hasFilter; } } public global::bnet.protocol.attribute.AttributeFilter Filter { - get { return filter_; } + get { return filter_ ?? global::bnet.protocol.attribute.AttributeFilter.DefaultInstance; } } - public const int CreateFieldNumber = 2; + public const int CreateFieldNumber = 3; private bool hasCreate; - private bool create_ = false; + private bool create_; public bool HasCreate { get { return hasCreate; } } @@ -90,7 +114,7 @@ public bool Create { get { return create_; } } - public const int OpenFieldNumber = 3; + public const int OpenFieldNumber = 4; private bool hasOpen; private bool open_ = true; public bool HasOpen { @@ -100,9 +124,9 @@ public bool Open { get { return open_; } } - public const int ProgramIdFieldNumber = 4; + public const int ProgramIdFieldNumber = 5; private bool hasProgramId; - private uint programId_ = 0; + private uint programId_; public bool HasProgramId { get { return hasProgramId; } } @@ -112,6 +136,9 @@ public uint ProgramId { public override bool IsInitialized { get { + foreach (global::bnet.protocol.attribute.Attribute element in CreationAttributesList) { + if (!element.IsInitialized) return false; + } if (HasFilter) { if (!Filter.IsInitialized) return false; } @@ -119,19 +146,23 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasFilter) { - output.WriteMessage(1, Filter); + string[] field_names = _gamePropertiesFieldNames; + if (creationAttributes_.Count > 0) { + output.WriteMessageArray(1, field_names[1], creationAttributes_); + } + if (hasFilter) { + output.WriteMessage(2, field_names[2], Filter); } - if (HasCreate) { - output.WriteBool(2, Create); + if (hasCreate) { + output.WriteBool(3, field_names[0], Create); } - if (HasOpen) { - output.WriteBool(3, Open); + if (hasOpen) { + output.WriteBool(4, field_names[3], Open); } - if (HasProgramId) { - output.WriteFixed32(4, ProgramId); + if (hasProgramId) { + output.WriteFixed32(5, field_names[4], ProgramId); } UnknownFields.WriteTo(output); } @@ -143,17 +174,20 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasFilter) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Filter); + foreach (global::bnet.protocol.attribute.Attribute element in CreationAttributesList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + if (hasFilter) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Filter); } - if (HasCreate) { - size += pb::CodedOutputStream.ComputeBoolSize(2, Create); + if (hasCreate) { + size += pb::CodedOutputStream.ComputeBoolSize(3, Create); } - if (HasOpen) { - size += pb::CodedOutputStream.ComputeBoolSize(3, Open); + if (hasOpen) { + size += pb::CodedOutputStream.ComputeBoolSize(4, Open); } - if (HasProgramId) { - size += pb::CodedOutputStream.ComputeFixed32Size(4, ProgramId); + if (hasProgramId) { + size += pb::CodedOutputStream.ComputeFixed32Size(5, ProgramId); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -185,38 +219,73 @@ public static GameProperties ParseDelimitedFrom(global::System.IO.Stream input) public static GameProperties ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static GameProperties ParseFrom(pb::CodedInputStream input) { + public static GameProperties ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static GameProperties ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static GameProperties ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private GameProperties MakeReadOnly() { + creationAttributes_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(GameProperties prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GameProperties cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GameProperties result; + + private GameProperties PrepareBuilder() { + if (resultIsReadOnly) { + GameProperties original = result; + result = new GameProperties(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - GameProperties result = new GameProperties(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override GameProperties MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new GameProperties(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -228,12 +297,11 @@ public override GameProperties DefaultInstanceForType { } public override GameProperties BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - GameProperties returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -247,6 +315,10 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(GameProperties other) { if (other == global::bnet.protocol.game_master.GameProperties.DefaultInstance) return this; + PrepareBuilder(); + if (other.creationAttributes_.Count != 0) { + result.creationAttributes_.Add(other.creationAttributes_); + } if (other.HasFilter) { MergeFilter(other.Filter); } @@ -263,20 +335,31 @@ public override Builder MergeFrom(GameProperties other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_gamePropertiesFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _gamePropertiesFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -288,37 +371,90 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { + input.ReadMessageArray(tag, field_name, result.creationAttributes_, global::bnet.protocol.attribute.Attribute.DefaultInstance, extensionRegistry); + break; + } + case 18: { global::bnet.protocol.attribute.AttributeFilter.Builder subBuilder = global::bnet.protocol.attribute.AttributeFilter.CreateBuilder(); - if (HasFilter) { + if (result.hasFilter) { subBuilder.MergeFrom(Filter); } input.ReadMessage(subBuilder, extensionRegistry); Filter = subBuilder.BuildPartial(); break; } - case 16: { - Create = input.ReadBool(); + case 24: { + result.hasCreate = input.ReadBool(ref result.create_); break; } - case 24: { - Open = input.ReadBool(); + case 32: { + result.hasOpen = input.ReadBool(ref result.open_); break; } - case 37: { - ProgramId = input.ReadFixed32(); + case 45: { + result.hasProgramId = input.ReadFixed32(ref result.programId_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } + public pbc::IPopsicleList CreationAttributesList { + get { return PrepareBuilder().creationAttributes_; } + } + public int CreationAttributesCount { + get { return result.CreationAttributesCount; } + } + public global::bnet.protocol.attribute.Attribute GetCreationAttributes(int index) { + return result.GetCreationAttributes(index); + } + public Builder SetCreationAttributes(int index, global::bnet.protocol.attribute.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.creationAttributes_[index] = value; + return this; + } + public Builder SetCreationAttributes(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.creationAttributes_[index] = builderForValue.Build(); + return this; + } + public Builder AddCreationAttributes(global::bnet.protocol.attribute.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.creationAttributes_.Add(value); + return this; + } + public Builder AddCreationAttributes(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.creationAttributes_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeCreationAttributes(scg::IEnumerable values) { + PrepareBuilder(); + result.creationAttributes_.Add(values); + return this; + } + public Builder ClearCreationAttributes() { + PrepareBuilder(); + result.creationAttributes_.Clear(); + return this; + } + public bool HasFilter { - get { return result.HasFilter; } + get { return result.hasFilter; } } public global::bnet.protocol.attribute.AttributeFilter Filter { get { return result.Filter; } @@ -326,19 +462,22 @@ public bool HasFilter { } public Builder SetFilter(global::bnet.protocol.attribute.AttributeFilter value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasFilter = true; result.filter_ = value; return this; } public Builder SetFilter(global::bnet.protocol.attribute.AttributeFilter.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasFilter = true; result.filter_ = builderForValue.Build(); return this; } public Builder MergeFilter(global::bnet.protocol.attribute.AttributeFilter value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasFilter && + PrepareBuilder(); + if (result.hasFilter && result.filter_ != global::bnet.protocol.attribute.AttributeFilter.DefaultInstance) { result.filter_ = global::bnet.protocol.attribute.AttributeFilter.CreateBuilder(result.filter_).MergeFrom(value).BuildPartial(); } else { @@ -348,60 +487,67 @@ public Builder MergeFilter(global::bnet.protocol.attribute.AttributeFilter value return this; } public Builder ClearFilter() { + PrepareBuilder(); result.hasFilter = false; - result.filter_ = global::bnet.protocol.attribute.AttributeFilter.DefaultInstance; + result.filter_ = null; return this; } public bool HasCreate { - get { return result.HasCreate; } + get { return result.hasCreate; } } public bool Create { get { return result.Create; } set { SetCreate(value); } } public Builder SetCreate(bool value) { + PrepareBuilder(); result.hasCreate = true; result.create_ = value; return this; } public Builder ClearCreate() { + PrepareBuilder(); result.hasCreate = false; result.create_ = false; return this; } public bool HasOpen { - get { return result.HasOpen; } + get { return result.hasOpen; } } public bool Open { get { return result.Open; } set { SetOpen(value); } } public Builder SetOpen(bool value) { + PrepareBuilder(); result.hasOpen = true; result.open_ = value; return this; } public Builder ClearOpen() { + PrepareBuilder(); result.hasOpen = false; result.open_ = true; return this; } public bool HasProgramId { - get { return result.HasProgramId; } + get { return result.hasProgramId; } } public uint ProgramId { get { return result.ProgramId; } set { SetProgramId(value); } } public Builder SetProgramId(uint value) { + PrepareBuilder(); result.hasProgramId = true; result.programId_ = value; return this; } public Builder ClearProgramId() { + PrepareBuilder(); result.hasProgramId = false; result.programId_ = 0; return this; @@ -415,3 +561,5 @@ static GameProperties() { #endregion } + +#endregion Designer generated code diff --git a/source/D3Proto/bnet/protocol/game_master/GameMaster.cs b/src/LibMooNet/bnet/protocol/game_master/GameMasterService.cs similarity index 61% rename from source/D3Proto/bnet/protocol/game_master/GameMaster.cs rename to src/LibMooNet/bnet/protocol/game_master/GameMasterService.cs index 85d0844f..4ac76558 100644 --- a/source/D3Proto/bnet/protocol/game_master/GameMaster.cs +++ b/src/LibMooNet/bnet/protocol/game_master/GameMasterService.cs @@ -1,4 +1,6 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code using pb = global::Google.ProtocolBuffers; using pbc = global::Google.ProtocolBuffers.Collections; @@ -6,295 +8,300 @@ using scg = global::System.Collections.Generic; namespace bnet.protocol.game_master { - namespace Proto { - - public static partial class GameMaster { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_JoinGameRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_JoinGameRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_JoinGameResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_JoinGameResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_ListFactoriesRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_ListFactoriesRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_ListFactoriesResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_ListFactoriesResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_FindGameRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_FindGameRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_FindGameResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_FindGameResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_CancelFindGameRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_CancelFindGameRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_GameEndedNotification__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_GameEndedNotification__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_PlayerLeftNotification__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_PlayerLeftNotification__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_RegisterServerRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_RegisterServerRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_UnregisterServerRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_UnregisterServerRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_RegisterUtilitiesRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_RegisterUtilitiesRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_UnregisterUtilitiesRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_UnregisterUtilitiesRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_SubscribeRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_SubscribeRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_SubscribeResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_SubscribeResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_UnsubscribeRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_UnsubscribeRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_ChangeGameRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_ChangeGameRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_GetFactoryInfoRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_GetFactoryInfoRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_GetFactoryInfoResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_GetFactoryInfoResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_GetGameStatsRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_GetGameStatsRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_GetGameStatsResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_GetGameStatsResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_FactoryUpdateNotification__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_FactoryUpdateNotification__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_GameFoundNotification__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_GameFoundNotification__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static GameMaster() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "CiVzZXJ2aWNlL2dhbWVfbWFzdGVyL2dhbWVfbWFzdGVyLnByb3RvEhlibmV0" + - "LnByb3RvY29sLmdhbWVfbWFzdGVyGiZzZXJ2aWNlL2dhbWVfbWFzdGVyL2dh" + - "bWVfZmFjdG9yeS5wcm90bxolc2VydmljZS9zZXJ2ZXJfcG9vbC9zZXJ2ZXJf" + - "cG9vbC5wcm90bxojc2VydmljZS9jaGFubmVsL2NoYW5uZWxfdHlwZXMucHJv" + - "dG8aHGxpYi9wcm90b2NvbC9hdHRyaWJ1dGUucHJvdG8aGWxpYi9wcm90b2Nv" + - "bC9lbnRpdHkucHJvdG8aEWxpYi9ycGMvcnBjLnByb3RvGitzZXJ2aWNlL2dh" + - "bWVfbWFzdGVyL2dhbWVfbWFzdGVyX3R5cGVzLnByb3RvIsQBCg9Kb2luR2Ft" + - "ZVJlcXVlc3QSOgoLZ2FtZV9oYW5kbGUYASACKAsyJS5ibmV0LnByb3RvY29s" + - "LmdhbWVfbWFzdGVyLkdhbWVIYW5kbGUSMQoGcGxheWVyGAIgAygLMiEuYm5l" + - "dC5wcm90b2NvbC5nYW1lX21hc3Rlci5QbGF5ZXISQgoPY2hhbm5lbF9yZXF1" + - "ZXN0GAMgASgLMikuYm5ldC5wcm90b2NvbC5jaGFubmVsLkpvaW5DaGFubmVs" + - "UmVxdWVzdCJQChBKb2luR2FtZVJlc3BvbnNlEjwKDGNvbm5lY3RfaW5mbxgB" + - "IAMoCzImLmJuZXQucHJvdG9jb2wuZ2FtZV9tYXN0ZXIuQ29ubmVjdEluZm8i" + - "ggEKFExpc3RGYWN0b3JpZXNSZXF1ZXN0EjgKBmZpbHRlchgBIAIoCzIoLmJu" + - "ZXQucHJvdG9jb2wuYXR0cmlidXRlLkF0dHJpYnV0ZUZpbHRlchIWCgtzdGFy" + - "dF9pbmRleBgCIAEoDToBMBIYCgttYXhfcmVzdWx0cxgDIAEoDToDMTAwInYK" + - "FUxpc3RGYWN0b3JpZXNSZXNwb25zZRJGCgtkZXNjcmlwdGlvbhgBIAMoCzIx" + - "LmJuZXQucHJvdG9jb2wuZ2FtZV9tYXN0ZXIuR2FtZUZhY3RvcnlEZXNjcmlw" + - "dGlvbhIVCg10b3RhbF9yZXN1bHRzGAIgASgNIvABCg9GaW5kR2FtZVJlcXVl" + - "c3QSMQoGcGxheWVyGAEgAygLMiEuYm5ldC5wcm90b2NvbC5nYW1lX21hc3Rl" + - "ci5QbGF5ZXISEgoKZmFjdG9yeV9pZBgCIAEoBhI9Cgpwcm9wZXJ0aWVzGAMg" + - "ASgLMikuYm5ldC5wcm90b2NvbC5nYW1lX21hc3Rlci5HYW1lUHJvcGVydGll" + - "cxIRCglvYmplY3RfaWQYBCACKAQSRAoPY2hhbm5lbF9yZXF1ZXN0GAUgASgL" + - "MisuYm5ldC5wcm90b2NvbC5jaGFubmVsLkNyZWF0ZUNoYW5uZWxSZXF1ZXN0" + - "IjoKEEZpbmRHYW1lUmVzcG9uc2USEgoKcmVxdWVzdF9pZBgBIAEoBBISCgpm" + - "YWN0b3J5X2lkGAIgASgGIj8KFUNhbmNlbEZpbmRHYW1lUmVxdWVzdBISCgpm" + - "YWN0b3J5X2lkGAEgAigGEhIKCnJlcXVlc3RfaWQYAiACKAQiUwoVR2FtZUVu" + - "ZGVkTm90aWZpY2F0aW9uEjoKC2dhbWVfaGFuZGxlGAEgAigLMiUuYm5ldC5w" + - "cm90b2NvbC5nYW1lX21hc3Rlci5HYW1lSGFuZGxlIpEBChZQbGF5ZXJMZWZ0" + - "Tm90aWZpY2F0aW9uEjoKC2dhbWVfaGFuZGxlGAEgAigLMiUuYm5ldC5wcm90" + - "b2NvbC5nYW1lX21hc3Rlci5HYW1lSGFuZGxlEigKB3Rvb25faWQYAiACKAsy" + - "Fy5ibmV0LnByb3RvY29sLkVudGl0eUlkEhEKBnJlYXNvbhgDIAEoDToBMCKZ" + - "AQoVUmVnaXN0ZXJTZXJ2ZXJSZXF1ZXN0EjUKCWF0dHJpYnV0ZRgBIAMoCzIi" + - "LmJuZXQucHJvdG9jb2wuYXR0cmlidXRlLkF0dHJpYnV0ZRI1CgVzdGF0ZRgC" + - "IAEoCzImLmJuZXQucHJvdG9jb2wuc2VydmVyX3Bvb2wuU2VydmVyU3RhdGUS" + - "EgoKcHJvZ3JhbV9pZBgDIAIoByIZChdVbnJlZ2lzdGVyU2VydmVyUmVxdWVz" + - "dCKcAQoYUmVnaXN0ZXJVdGlsaXRpZXNSZXF1ZXN0EjUKCWF0dHJpYnV0ZRgB" + - "IAMoCzIiLmJuZXQucHJvdG9jb2wuYXR0cmlidXRlLkF0dHJpYnV0ZRI1CgVz" + - "dGF0ZRgCIAEoCzImLmJuZXQucHJvdG9jb2wuc2VydmVyX3Bvb2wuU2VydmVy" + - "U3RhdGUSEgoKcHJvZ3JhbV9pZBgDIAIoByIcChpVbnJlZ2lzdGVyVXRpbGl0" + - "aWVzUmVxdWVzdCIlChBTdWJzY3JpYmVSZXF1ZXN0EhEKCW9iamVjdF9pZBgB" + - "IAIoBCIsChFTdWJzY3JpYmVSZXNwb25zZRIXCg9zdWJzY3JpcHRpb25faWQY" + - "ASABKAQiLQoSVW5zdWJzY3JpYmVSZXF1ZXN0EhcKD3N1YnNjcmlwdGlvbl9p" + - "ZBgBIAIoBCKsAQoRQ2hhbmdlR2FtZVJlcXVlc3QSOgoLZ2FtZV9oYW5kbGUY" + - "ASACKAsyJS5ibmV0LnByb3RvY29sLmdhbWVfbWFzdGVyLkdhbWVIYW5kbGUS" + - "DAoEb3BlbhgCIAEoCBI1CglhdHRyaWJ1dGUYAyADKAsyIi5ibmV0LnByb3Rv" + - "Y29sLmF0dHJpYnV0ZS5BdHRyaWJ1dGUSFgoHcmVwbGFjZRgEIAEoCDoFZmFs" + - "c2UiKwoVR2V0RmFjdG9yeUluZm9SZXF1ZXN0EhIKCmZhY3RvcnlfaWQYASAC" + - "KAYikQEKFkdldEZhY3RvcnlJbmZvUmVzcG9uc2USNQoJYXR0cmlidXRlGAEg" + - "AygLMiIuYm5ldC5wcm90b2NvbC5hdHRyaWJ1dGUuQXR0cmlidXRlEkAKDHN0" + - "YXRzX2J1Y2tldBgCIAMoCzIqLmJuZXQucHJvdG9jb2wuZ2FtZV9tYXN0ZXIu" + - "R2FtZVN0YXRzQnVja2V0ImMKE0dldEdhbWVTdGF0c1JlcXVlc3QSEgoKZmFj" + - "dG9yeV9pZBgBIAIoBhI4CgZmaWx0ZXIYAiACKAsyKC5ibmV0LnByb3RvY29s" + - "LmF0dHJpYnV0ZS5BdHRyaWJ1dGVGaWx0ZXIiWAoUR2V0R2FtZVN0YXRzUmVz" + - "cG9uc2USQAoMc3RhdHNfYnVja2V0GAEgAygLMiouYm5ldC5wcm90b2NvbC5n" + - "YW1lX21hc3Rlci5HYW1lU3RhdHNCdWNrZXQi8QEKGUZhY3RvcnlVcGRhdGVO" + - "b3RpZmljYXRpb24SSgoCb3AYASACKA4yPi5ibmV0LnByb3RvY29sLmdhbWVf" + - "bWFzdGVyLkZhY3RvcnlVcGRhdGVOb3RpZmljYXRpb24uT3BlcmF0aW9uEkYK" + - "C2Rlc2NyaXB0aW9uGAIgAigLMjEuYm5ldC5wcm90b2NvbC5nYW1lX21hc3Rl" + - "ci5HYW1lRmFjdG9yeURlc2NyaXB0aW9uEhIKCnByb2dyYW1faWQYAyABKAci" + - "LAoJT3BlcmF0aW9uEgcKA0FERBABEgoKBlJFTU9WRRACEgoKBkNIQU5HRRAD" + - "IrwBChVHYW1lRm91bmROb3RpZmljYXRpb24SEgoKcmVxdWVzdF9pZBgBIAIo" + - "BBIVCgplcnJvcl9jb2RlGAIgASgNOgEwEjoKC2dhbWVfaGFuZGxlGAMgASgL" + - "MiUuYm5ldC5wcm90b2NvbC5nYW1lX21hc3Rlci5HYW1lSGFuZGxlEjwKDGNv" + - "bm5lY3RfaW5mbxgEIAMoCzImLmJuZXQucHJvdG9jb2wuZ2FtZV9tYXN0ZXIu" + - "Q29ubmVjdEluZm8y5AsKCkdhbWVNYXN0ZXISYwoISm9pbkdhbWUSKi5ibmV0" + - "LnByb3RvY29sLmdhbWVfbWFzdGVyLkpvaW5HYW1lUmVxdWVzdBorLmJuZXQu" + - "cHJvdG9jb2wuZ2FtZV9tYXN0ZXIuSm9pbkdhbWVSZXNwb25zZRJyCg1MaXN0" + - "RmFjdG9yaWVzEi8uYm5ldC5wcm90b2NvbC5nYW1lX21hc3Rlci5MaXN0RmFj" + - "dG9yaWVzUmVxdWVzdBowLmJuZXQucHJvdG9jb2wuZ2FtZV9tYXN0ZXIuTGlz" + - "dEZhY3Rvcmllc1Jlc3BvbnNlEmMKCEZpbmRHYW1lEiouYm5ldC5wcm90b2Nv" + - "bC5nYW1lX21hc3Rlci5GaW5kR2FtZVJlcXVlc3QaKy5ibmV0LnByb3RvY29s" + - "LmdhbWVfbWFzdGVyLkZpbmRHYW1lUmVzcG9uc2USWQoOQ2FuY2VsRmluZEdh" + - "bWUSMC5ibmV0LnByb3RvY29sLmdhbWVfbWFzdGVyLkNhbmNlbEZpbmRHYW1l" + - "UmVxdWVzdBoVLmJuZXQucHJvdG9jb2wuTm9EYXRhElkKCUdhbWVFbmRlZBIw" + - "LmJuZXQucHJvdG9jb2wuZ2FtZV9tYXN0ZXIuR2FtZUVuZGVkTm90aWZpY2F0" + - "aW9uGhouYm5ldC5wcm90b2NvbC5OT19SRVNQT05TRRJbCgpQbGF5ZXJMZWZ0" + - "EjEuYm5ldC5wcm90b2NvbC5nYW1lX21hc3Rlci5QbGF5ZXJMZWZ0Tm90aWZp" + - "Y2F0aW9uGhouYm5ldC5wcm90b2NvbC5OT19SRVNQT05TRRJZCg5SZWdpc3Rl" + - "clNlcnZlchIwLmJuZXQucHJvdG9jb2wuZ2FtZV9tYXN0ZXIuUmVnaXN0ZXJT" + - "ZXJ2ZXJSZXF1ZXN0GhUuYm5ldC5wcm90b2NvbC5Ob0RhdGESYgoQVW5yZWdp" + - "c3RlclNlcnZlchIyLmJuZXQucHJvdG9jb2wuZ2FtZV9tYXN0ZXIuVW5yZWdp" + - "c3RlclNlcnZlclJlcXVlc3QaGi5ibmV0LnByb3RvY29sLk5PX1JFU1BPTlNF" + - "El8KEVJlZ2lzdGVyVXRpbGl0aWVzEjMuYm5ldC5wcm90b2NvbC5nYW1lX21h" + - "c3Rlci5SZWdpc3RlclV0aWxpdGllc1JlcXVlc3QaFS5ibmV0LnByb3RvY29s" + - "Lk5vRGF0YRJoChNVbnJlZ2lzdGVyVXRpbGl0aWVzEjUuYm5ldC5wcm90b2Nv" + - "bC5nYW1lX21hc3Rlci5VbnJlZ2lzdGVyVXRpbGl0aWVzUmVxdWVzdBoaLmJu" + - "ZXQucHJvdG9jb2wuTk9fUkVTUE9OU0USZgoJU3Vic2NyaWJlEisuYm5ldC5w" + - "cm90b2NvbC5nYW1lX21hc3Rlci5TdWJzY3JpYmVSZXF1ZXN0GiwuYm5ldC5w" + - "cm90b2NvbC5nYW1lX21hc3Rlci5TdWJzY3JpYmVSZXNwb25zZRJYCgtVbnN1" + - "YnNjcmliZRItLmJuZXQucHJvdG9jb2wuZ2FtZV9tYXN0ZXIuVW5zdWJzY3Jp" + - "YmVSZXF1ZXN0GhouYm5ldC5wcm90b2NvbC5OT19SRVNQT05TRRJRCgpDaGFu" + - "Z2VHYW1lEiwuYm5ldC5wcm90b2NvbC5nYW1lX21hc3Rlci5DaGFuZ2VHYW1l" + - "UmVxdWVzdBoVLmJuZXQucHJvdG9jb2wuTm9EYXRhEnUKDkdldEZhY3RvcnlJ" + - "bmZvEjAuYm5ldC5wcm90b2NvbC5nYW1lX21hc3Rlci5HZXRGYWN0b3J5SW5m" + - "b1JlcXVlc3QaMS5ibmV0LnByb3RvY29sLmdhbWVfbWFzdGVyLkdldEZhY3Rv" + - "cnlJbmZvUmVzcG9uc2USbwoMR2V0R2FtZVN0YXRzEi4uYm5ldC5wcm90b2Nv" + - "bC5nYW1lX21hc3Rlci5HZXRHYW1lU3RhdHNSZXF1ZXN0Gi8uYm5ldC5wcm90" + - "b2NvbC5nYW1lX21hc3Rlci5HZXRHYW1lU3RhdHNSZXNwb25zZTJ/ChRHYW1l" + - "TWFzdGVyU3Vic2NyaWJlchJnChNOb3RpZnlGYWN0b3J5VXBkYXRlEjQuYm5l" + - "dC5wcm90b2NvbC5nYW1lX21hc3Rlci5GYWN0b3J5VXBkYXRlTm90aWZpY2F0" + - "aW9uGhouYm5ldC5wcm90b2NvbC5OT19SRVNQT05TRTJ4ChVHYW1lRmFjdG9y" + - "eVN1YnNjcmliZXISXwoPTm90aWZ5R2FtZUZvdW5kEjAuYm5ldC5wcm90b2Nv" + - "bC5nYW1lX21hc3Rlci5HYW1lRm91bmROb3RpZmljYXRpb24aGi5ibmV0LnBy" + - "b3RvY29sLk5PX1JFU1BPTlNFQhBCC0NHYW1lTWFzdGVygAEB"); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_bnet_protocol_game_master_JoinGameRequest__Descriptor = Descriptor.MessageTypes[0]; - internal__static_bnet_protocol_game_master_JoinGameRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_JoinGameRequest__Descriptor, - new string[] { "GameHandle", "Player", "ChannelRequest", }); - internal__static_bnet_protocol_game_master_JoinGameResponse__Descriptor = Descriptor.MessageTypes[1]; - internal__static_bnet_protocol_game_master_JoinGameResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_JoinGameResponse__Descriptor, - new string[] { "ConnectInfo", }); - internal__static_bnet_protocol_game_master_ListFactoriesRequest__Descriptor = Descriptor.MessageTypes[2]; - internal__static_bnet_protocol_game_master_ListFactoriesRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_ListFactoriesRequest__Descriptor, - new string[] { "Filter", "StartIndex", "MaxResults", }); - internal__static_bnet_protocol_game_master_ListFactoriesResponse__Descriptor = Descriptor.MessageTypes[3]; - internal__static_bnet_protocol_game_master_ListFactoriesResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_ListFactoriesResponse__Descriptor, - new string[] { "Description", "TotalResults", }); - internal__static_bnet_protocol_game_master_FindGameRequest__Descriptor = Descriptor.MessageTypes[4]; - internal__static_bnet_protocol_game_master_FindGameRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_FindGameRequest__Descriptor, - new string[] { "Player", "FactoryId", "Properties", "ObjectId", "ChannelRequest", }); - internal__static_bnet_protocol_game_master_FindGameResponse__Descriptor = Descriptor.MessageTypes[5]; - internal__static_bnet_protocol_game_master_FindGameResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_FindGameResponse__Descriptor, - new string[] { "RequestId", "FactoryId", }); - internal__static_bnet_protocol_game_master_CancelFindGameRequest__Descriptor = Descriptor.MessageTypes[6]; - internal__static_bnet_protocol_game_master_CancelFindGameRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_CancelFindGameRequest__Descriptor, - new string[] { "FactoryId", "RequestId", }); - internal__static_bnet_protocol_game_master_GameEndedNotification__Descriptor = Descriptor.MessageTypes[7]; - internal__static_bnet_protocol_game_master_GameEndedNotification__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_GameEndedNotification__Descriptor, - new string[] { "GameHandle", }); - internal__static_bnet_protocol_game_master_PlayerLeftNotification__Descriptor = Descriptor.MessageTypes[8]; - internal__static_bnet_protocol_game_master_PlayerLeftNotification__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_PlayerLeftNotification__Descriptor, - new string[] { "GameHandle", "ToonId", "Reason", }); - internal__static_bnet_protocol_game_master_RegisterServerRequest__Descriptor = Descriptor.MessageTypes[9]; - internal__static_bnet_protocol_game_master_RegisterServerRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_RegisterServerRequest__Descriptor, - new string[] { "Attribute", "State", "ProgramId", }); - internal__static_bnet_protocol_game_master_UnregisterServerRequest__Descriptor = Descriptor.MessageTypes[10]; - internal__static_bnet_protocol_game_master_UnregisterServerRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_UnregisterServerRequest__Descriptor, - new string[] { }); - internal__static_bnet_protocol_game_master_RegisterUtilitiesRequest__Descriptor = Descriptor.MessageTypes[11]; - internal__static_bnet_protocol_game_master_RegisterUtilitiesRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_RegisterUtilitiesRequest__Descriptor, - new string[] { "Attribute", "State", "ProgramId", }); - internal__static_bnet_protocol_game_master_UnregisterUtilitiesRequest__Descriptor = Descriptor.MessageTypes[12]; - internal__static_bnet_protocol_game_master_UnregisterUtilitiesRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_UnregisterUtilitiesRequest__Descriptor, - new string[] { }); - internal__static_bnet_protocol_game_master_SubscribeRequest__Descriptor = Descriptor.MessageTypes[13]; - internal__static_bnet_protocol_game_master_SubscribeRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_SubscribeRequest__Descriptor, - new string[] { "ObjectId", }); - internal__static_bnet_protocol_game_master_SubscribeResponse__Descriptor = Descriptor.MessageTypes[14]; - internal__static_bnet_protocol_game_master_SubscribeResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_SubscribeResponse__Descriptor, - new string[] { "SubscriptionId", }); - internal__static_bnet_protocol_game_master_UnsubscribeRequest__Descriptor = Descriptor.MessageTypes[15]; - internal__static_bnet_protocol_game_master_UnsubscribeRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_UnsubscribeRequest__Descriptor, - new string[] { "SubscriptionId", }); - internal__static_bnet_protocol_game_master_ChangeGameRequest__Descriptor = Descriptor.MessageTypes[16]; - internal__static_bnet_protocol_game_master_ChangeGameRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_ChangeGameRequest__Descriptor, - new string[] { "GameHandle", "Open", "Attribute", "Replace", }); - internal__static_bnet_protocol_game_master_GetFactoryInfoRequest__Descriptor = Descriptor.MessageTypes[17]; - internal__static_bnet_protocol_game_master_GetFactoryInfoRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_GetFactoryInfoRequest__Descriptor, - new string[] { "FactoryId", }); - internal__static_bnet_protocol_game_master_GetFactoryInfoResponse__Descriptor = Descriptor.MessageTypes[18]; - internal__static_bnet_protocol_game_master_GetFactoryInfoResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_GetFactoryInfoResponse__Descriptor, - new string[] { "Attribute", "StatsBucket", }); - internal__static_bnet_protocol_game_master_GetGameStatsRequest__Descriptor = Descriptor.MessageTypes[19]; - internal__static_bnet_protocol_game_master_GetGameStatsRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_GetGameStatsRequest__Descriptor, - new string[] { "FactoryId", "Filter", }); - internal__static_bnet_protocol_game_master_GetGameStatsResponse__Descriptor = Descriptor.MessageTypes[20]; - internal__static_bnet_protocol_game_master_GetGameStatsResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_GetGameStatsResponse__Descriptor, - new string[] { "StatsBucket", }); - internal__static_bnet_protocol_game_master_FactoryUpdateNotification__Descriptor = Descriptor.MessageTypes[21]; - internal__static_bnet_protocol_game_master_FactoryUpdateNotification__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_FactoryUpdateNotification__Descriptor, - new string[] { "Op", "Description", "ProgramId", }); - internal__static_bnet_protocol_game_master_GameFoundNotification__Descriptor = Descriptor.MessageTypes[22]; - internal__static_bnet_protocol_game_master_GameFoundNotification__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_GameFoundNotification__Descriptor, - new string[] { "RequestId", "ErrorCode", "GameHandle", "ConnectInfo", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::bnet.protocol.game_master.GameFactory.Descriptor, - global::bnet.protocol.server_pool.ServerPool.Descriptor, - global::bnet.protocol.channel.ChannelTypes.Descriptor, - global::bnet.protocol.attribute.Proto.Attribute.Descriptor, - global::bnet.protocol.Entity.Descriptor, - global::bnet.protocol.Rpc.Descriptor, - global::bnet.protocol.game_master.GameMasterTypes.Descriptor, - }, assigner); - } - #endregion - + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class GameMasterService { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_JoinGameRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_JoinGameRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_JoinGameResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_JoinGameResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_ListFactoriesRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_ListFactoriesRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_ListFactoriesResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_ListFactoriesResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_FindGameRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_FindGameRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_FindGameResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_FindGameResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_GameEndedNotification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_GameEndedNotification__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_PlayerLeftNotification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_PlayerLeftNotification__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_RegisterServerRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_RegisterServerRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_UnregisterServerRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_UnregisterServerRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_RegisterUtilitiesRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_RegisterUtilitiesRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_UnregisterUtilitiesRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_UnregisterUtilitiesRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_SubscribeRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_SubscribeRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_SubscribeResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_SubscribeResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_UnsubscribeRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_UnsubscribeRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_ChangeGameRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_ChangeGameRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_GetFactoryInfoRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_GetFactoryInfoRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_GetFactoryInfoResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_GetFactoryInfoResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_GetGameStatsRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_GetGameStatsRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_GetGameStatsResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_GetGameStatsResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_FactoryUpdateNotification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_FactoryUpdateNotification__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_GameFoundNotification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_GameFoundNotification__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static GameMasterService() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "Ch5ibmV0L2dhbWVfbWFzdGVyX3NlcnZpY2UucHJvdG8SGWJuZXQucHJvdG9j" + + "b2wuZ2FtZV9tYXN0ZXIaF2JuZXQvZ2FtZV9mYWN0b3J5LnByb3RvGh5ibmV0" + + "L3NlcnZlcl9wb29sX3NlcnZpY2UucHJvdG8aFGJuZXQvYXR0cmlidXRlLnBy" + + "b3RvGhFibmV0L2VudGl0eS5wcm90bxoOYm5ldC9ycGMucHJvdG8aHGJuZXQv" + + "Z2FtZV9tYXN0ZXJfdHlwZXMucHJvdG8igAEKD0pvaW5HYW1lUmVxdWVzdBI6" + + "CgtnYW1lX2hhbmRsZRgBIAIoCzIlLmJuZXQucHJvdG9jb2wuZ2FtZV9tYXN0" + + "ZXIuR2FtZUhhbmRsZRIxCgZwbGF5ZXIYAiADKAsyIS5ibmV0LnByb3RvY29s" + + "LmdhbWVfbWFzdGVyLlBsYXllciJ7ChBKb2luR2FtZVJlc3BvbnNlEhIKCnJl" + + "cXVlc3RfaWQYASABKAYSFQoGcXVldWVkGAIgASgIOgVmYWxzZRI8Cgxjb25u" + + "ZWN0X2luZm8YAyADKAsyJi5ibmV0LnByb3RvY29sLmdhbWVfbWFzdGVyLkNv" + + "bm5lY3RJbmZvIoIBChRMaXN0RmFjdG9yaWVzUmVxdWVzdBI4CgZmaWx0ZXIY" + + "ASACKAsyKC5ibmV0LnByb3RvY29sLmF0dHJpYnV0ZS5BdHRyaWJ1dGVGaWx0" + + "ZXISFgoLc3RhcnRfaW5kZXgYAiABKA06ATASGAoLbWF4X3Jlc3VsdHMYAyAB" + + "KA06AzEwMCJ2ChVMaXN0RmFjdG9yaWVzUmVzcG9uc2USRgoLZGVzY3JpcHRp" + + "b24YASADKAsyMS5ibmV0LnByb3RvY29sLmdhbWVfbWFzdGVyLkdhbWVGYWN0" + + "b3J5RGVzY3JpcHRpb24SFQoNdG90YWxfcmVzdWx0cxgCIAEoDSLGAQoPRmlu" + + "ZEdhbWVSZXF1ZXN0EjEKBnBsYXllchgBIAMoCzIhLmJuZXQucHJvdG9jb2wu" + + "Z2FtZV9tYXN0ZXIuUGxheWVyEhIKCmZhY3RvcnlfaWQYAiABKAYSPQoKcHJv" + + "cGVydGllcxgDIAEoCzIpLmJuZXQucHJvdG9jb2wuZ2FtZV9tYXN0ZXIuR2Ft" + + "ZVByb3BlcnRpZXMSGQoRZmFjdG9yeV9vYmplY3RfaWQYBCABKAQSEgoKcmVx" + + "dWVzdF9pZBgFIAEoBiJRChBGaW5kR2FtZVJlc3BvbnNlEhIKCnJlcXVlc3Rf" + + "aWQYASABKAYSEgoKZmFjdG9yeV9pZBgCIAEoBhIVCgZxdWV1ZWQYAyABKAg6" + + "BWZhbHNlImYKFUdhbWVFbmRlZE5vdGlmaWNhdGlvbhI6CgtnYW1lX2hhbmRs" + + "ZRgBIAIoCzIlLmJuZXQucHJvdG9jb2wuZ2FtZV9tYXN0ZXIuR2FtZUhhbmRs" + + "ZRIRCgZyZWFzb24YAiABKA06ATAikwEKFlBsYXllckxlZnROb3RpZmljYXRp" + + "b24SOgoLZ2FtZV9oYW5kbGUYASACKAsyJS5ibmV0LnByb3RvY29sLmdhbWVf" + + "bWFzdGVyLkdhbWVIYW5kbGUSKgoJbWVtYmVyX2lkGAIgAigLMhcuYm5ldC5w" + + "cm90b2NvbC5FbnRpdHlJZBIRCgZyZWFzb24YAyABKA06ATEimQEKFVJlZ2lz" + + "dGVyU2VydmVyUmVxdWVzdBI1CglhdHRyaWJ1dGUYASADKAsyIi5ibmV0LnBy" + + "b3RvY29sLmF0dHJpYnV0ZS5BdHRyaWJ1dGUSNQoFc3RhdGUYAiABKAsyJi5i" + + "bmV0LnByb3RvY29sLnNlcnZlcl9wb29sLlNlcnZlclN0YXRlEhIKCnByb2dy" + + "YW1faWQYAyACKAciGQoXVW5yZWdpc3RlclNlcnZlclJlcXVlc3QinAEKGFJl" + + "Z2lzdGVyVXRpbGl0aWVzUmVxdWVzdBI1CglhdHRyaWJ1dGUYASADKAsyIi5i" + + "bmV0LnByb3RvY29sLmF0dHJpYnV0ZS5BdHRyaWJ1dGUSNQoFc3RhdGUYAiAB" + + "KAsyJi5ibmV0LnByb3RvY29sLnNlcnZlcl9wb29sLlNlcnZlclN0YXRlEhIK" + + "CnByb2dyYW1faWQYAyACKAciHAoaVW5yZWdpc3RlclV0aWxpdGllc1JlcXVl" + + "c3QiJQoQU3Vic2NyaWJlUmVxdWVzdBIRCglvYmplY3RfaWQYASACKAQiLAoR" + + "U3Vic2NyaWJlUmVzcG9uc2USFwoPc3Vic2NyaXB0aW9uX2lkGAEgASgEIi0K" + + "ElVuc3Vic2NyaWJlUmVxdWVzdBIXCg9zdWJzY3JpcHRpb25faWQYASACKAQi" + + "rAEKEUNoYW5nZUdhbWVSZXF1ZXN0EjoKC2dhbWVfaGFuZGxlGAEgAigLMiUu" + + "Ym5ldC5wcm90b2NvbC5nYW1lX21hc3Rlci5HYW1lSGFuZGxlEgwKBG9wZW4Y" + + "AiABKAgSNQoJYXR0cmlidXRlGAMgAygLMiIuYm5ldC5wcm90b2NvbC5hdHRy" + + "aWJ1dGUuQXR0cmlidXRlEhYKB3JlcGxhY2UYBCABKAg6BWZhbHNlIisKFUdl" + + "dEZhY3RvcnlJbmZvUmVxdWVzdBISCgpmYWN0b3J5X2lkGAEgAigGIpEBChZH" + + "ZXRGYWN0b3J5SW5mb1Jlc3BvbnNlEjUKCWF0dHJpYnV0ZRgBIAMoCzIiLmJu" + + "ZXQucHJvdG9jb2wuYXR0cmlidXRlLkF0dHJpYnV0ZRJACgxzdGF0c19idWNr" + + "ZXQYAiADKAsyKi5ibmV0LnByb3RvY29sLmdhbWVfbWFzdGVyLkdhbWVTdGF0" + + "c0J1Y2tldCJjChNHZXRHYW1lU3RhdHNSZXF1ZXN0EhIKCmZhY3RvcnlfaWQY" + + "ASACKAYSOAoGZmlsdGVyGAIgAigLMiguYm5ldC5wcm90b2NvbC5hdHRyaWJ1" + + "dGUuQXR0cmlidXRlRmlsdGVyIlgKFEdldEdhbWVTdGF0c1Jlc3BvbnNlEkAK" + + "DHN0YXRzX2J1Y2tldBgBIAMoCzIqLmJuZXQucHJvdG9jb2wuZ2FtZV9tYXN0" + + "ZXIuR2FtZVN0YXRzQnVja2V0IvEBChlGYWN0b3J5VXBkYXRlTm90aWZpY2F0" + + "aW9uEkoKAm9wGAEgAigOMj4uYm5ldC5wcm90b2NvbC5nYW1lX21hc3Rlci5G" + + "YWN0b3J5VXBkYXRlTm90aWZpY2F0aW9uLk9wZXJhdGlvbhJGCgtkZXNjcmlw" + + "dGlvbhgCIAIoCzIxLmJuZXQucHJvdG9jb2wuZ2FtZV9tYXN0ZXIuR2FtZUZh" + + "Y3RvcnlEZXNjcmlwdGlvbhISCgpwcm9ncmFtX2lkGAMgASgHIiwKCU9wZXJh" + + "dGlvbhIHCgNBREQQARIKCgZSRU1PVkUQAhIKCgZDSEFOR0UQAyK8AQoVR2Ft" + + "ZUZvdW5kTm90aWZpY2F0aW9uEhIKCnJlcXVlc3RfaWQYASACKAYSFQoKZXJy" + + "b3JfY29kZRgCIAEoDToBMBI6CgtnYW1lX2hhbmRsZRgDIAEoCzIlLmJuZXQu" + + "cHJvdG9jb2wuZ2FtZV9tYXN0ZXIuR2FtZUhhbmRsZRI8Cgxjb25uZWN0X2lu" + + "Zm8YBCADKAsyJi5ibmV0LnByb3RvY29sLmdhbWVfbWFzdGVyLkNvbm5lY3RJ" + + "bmZvMsAMCgpHYW1lTWFzdGVyEmkKCEpvaW5HYW1lEiouYm5ldC5wcm90b2Nv" + + "bC5nYW1lX21hc3Rlci5Kb2luR2FtZVJlcXVlc3QaKy5ibmV0LnByb3RvY29s" + + "LmdhbWVfbWFzdGVyLkpvaW5HYW1lUmVzcG9uc2UiBIC1GAESeAoNTGlzdEZh" + + "Y3RvcmllcxIvLmJuZXQucHJvdG9jb2wuZ2FtZV9tYXN0ZXIuTGlzdEZhY3Rv" + + "cmllc1JlcXVlc3QaMC5ibmV0LnByb3RvY29sLmdhbWVfbWFzdGVyLkxpc3RG" + + "YWN0b3JpZXNSZXNwb25zZSIEgLUYAhJpCghGaW5kR2FtZRIqLmJuZXQucHJv" + + "dG9jb2wuZ2FtZV9tYXN0ZXIuRmluZEdhbWVSZXF1ZXN0GisuYm5ldC5wcm90" + + "b2NvbC5nYW1lX21hc3Rlci5GaW5kR2FtZVJlc3BvbnNlIgSAtRgDEmEKD0Nh" + + "bmNlbEdhbWVFbnRyeRIxLmJuZXQucHJvdG9jb2wuZ2FtZV9tYXN0ZXIuQ2Fu" + + "Y2VsR2FtZUVudHJ5UmVxdWVzdBoVLmJuZXQucHJvdG9jb2wuTm9EYXRhIgSA" + + "tRgEEl8KCUdhbWVFbmRlZBIwLmJuZXQucHJvdG9jb2wuZ2FtZV9tYXN0ZXIu" + + "R2FtZUVuZGVkTm90aWZpY2F0aW9uGhouYm5ldC5wcm90b2NvbC5OT19SRVNQ" + + "T05TRSIEgLUYBRJhCgpQbGF5ZXJMZWZ0EjEuYm5ldC5wcm90b2NvbC5nYW1l" + + "X21hc3Rlci5QbGF5ZXJMZWZ0Tm90aWZpY2F0aW9uGhouYm5ldC5wcm90b2Nv" + + "bC5OT19SRVNQT05TRSIEgLUYBhJfCg5SZWdpc3RlclNlcnZlchIwLmJuZXQu" + + "cHJvdG9jb2wuZ2FtZV9tYXN0ZXIuUmVnaXN0ZXJTZXJ2ZXJSZXF1ZXN0GhUu" + + "Ym5ldC5wcm90b2NvbC5Ob0RhdGEiBIC1GAcSaAoQVW5yZWdpc3RlclNlcnZl" + + "chIyLmJuZXQucHJvdG9jb2wuZ2FtZV9tYXN0ZXIuVW5yZWdpc3RlclNlcnZl" + + "clJlcXVlc3QaGi5ibmV0LnByb3RvY29sLk5PX1JFU1BPTlNFIgSAtRgIEmUK" + + "EVJlZ2lzdGVyVXRpbGl0aWVzEjMuYm5ldC5wcm90b2NvbC5nYW1lX21hc3Rl" + + "ci5SZWdpc3RlclV0aWxpdGllc1JlcXVlc3QaFS5ibmV0LnByb3RvY29sLk5v" + + "RGF0YSIEgLUYCRJuChNVbnJlZ2lzdGVyVXRpbGl0aWVzEjUuYm5ldC5wcm90" + + "b2NvbC5nYW1lX21hc3Rlci5VbnJlZ2lzdGVyVXRpbGl0aWVzUmVxdWVzdBoa" + + "LmJuZXQucHJvdG9jb2wuTk9fUkVTUE9OU0UiBIC1GAoSbAoJU3Vic2NyaWJl" + + "EisuYm5ldC5wcm90b2NvbC5nYW1lX21hc3Rlci5TdWJzY3JpYmVSZXF1ZXN0" + + "GiwuYm5ldC5wcm90b2NvbC5nYW1lX21hc3Rlci5TdWJzY3JpYmVSZXNwb25z" + + "ZSIEgLUYCxJeCgtVbnN1YnNjcmliZRItLmJuZXQucHJvdG9jb2wuZ2FtZV9t" + + "YXN0ZXIuVW5zdWJzY3JpYmVSZXF1ZXN0GhouYm5ldC5wcm90b2NvbC5OT19S" + + "RVNQT05TRSIEgLUYDBJXCgpDaGFuZ2VHYW1lEiwuYm5ldC5wcm90b2NvbC5n" + + "YW1lX21hc3Rlci5DaGFuZ2VHYW1lUmVxdWVzdBoVLmJuZXQucHJvdG9jb2wu" + + "Tm9EYXRhIgSAtRgNEnsKDkdldEZhY3RvcnlJbmZvEjAuYm5ldC5wcm90b2Nv" + + "bC5nYW1lX21hc3Rlci5HZXRGYWN0b3J5SW5mb1JlcXVlc3QaMS5ibmV0LnBy" + + "b3RvY29sLmdhbWVfbWFzdGVyLkdldEZhY3RvcnlJbmZvUmVzcG9uc2UiBIC1" + + "GA4SdQoMR2V0R2FtZVN0YXRzEi4uYm5ldC5wcm90b2NvbC5nYW1lX21hc3Rl" + + "ci5HZXRHYW1lU3RhdHNSZXF1ZXN0Gi8uYm5ldC5wcm90b2NvbC5nYW1lX21h" + + "c3Rlci5HZXRHYW1lU3RhdHNSZXNwb25zZSIEgLUYDzKFAQoUR2FtZU1hc3Rl" + + "clN1YnNjcmliZXISbQoTTm90aWZ5RmFjdG9yeVVwZGF0ZRI0LmJuZXQucHJv" + + "dG9jb2wuZ2FtZV9tYXN0ZXIuRmFjdG9yeVVwZGF0ZU5vdGlmaWNhdGlvbhoa" + + "LmJuZXQucHJvdG9jb2wuTk9fUkVTUE9OU0UiBIC1GAEyfgoVR2FtZUZhY3Rv" + + "cnlTdWJzY3JpYmVyEmUKD05vdGlmeUdhbWVGb3VuZBIwLmJuZXQucHJvdG9j" + + "b2wuZ2FtZV9tYXN0ZXIuR2FtZUZvdW5kTm90aWZpY2F0aW9uGhouYm5ldC5w" + + "cm90b2NvbC5OT19SRVNQT05TRSIEgLUYAUIDgAEA"); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_bnet_protocol_game_master_JoinGameRequest__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_game_master_JoinGameRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_JoinGameRequest__Descriptor, + new string[] { "GameHandle", "Player", }); + internal__static_bnet_protocol_game_master_JoinGameResponse__Descriptor = Descriptor.MessageTypes[1]; + internal__static_bnet_protocol_game_master_JoinGameResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_JoinGameResponse__Descriptor, + new string[] { "RequestId", "Queued", "ConnectInfo", }); + internal__static_bnet_protocol_game_master_ListFactoriesRequest__Descriptor = Descriptor.MessageTypes[2]; + internal__static_bnet_protocol_game_master_ListFactoriesRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_ListFactoriesRequest__Descriptor, + new string[] { "Filter", "StartIndex", "MaxResults", }); + internal__static_bnet_protocol_game_master_ListFactoriesResponse__Descriptor = Descriptor.MessageTypes[3]; + internal__static_bnet_protocol_game_master_ListFactoriesResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_ListFactoriesResponse__Descriptor, + new string[] { "Description", "TotalResults", }); + internal__static_bnet_protocol_game_master_FindGameRequest__Descriptor = Descriptor.MessageTypes[4]; + internal__static_bnet_protocol_game_master_FindGameRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_FindGameRequest__Descriptor, + new string[] { "Player", "FactoryId", "Properties", "FactoryObjectId", "RequestId", }); + internal__static_bnet_protocol_game_master_FindGameResponse__Descriptor = Descriptor.MessageTypes[5]; + internal__static_bnet_protocol_game_master_FindGameResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_FindGameResponse__Descriptor, + new string[] { "RequestId", "FactoryId", "Queued", }); + internal__static_bnet_protocol_game_master_GameEndedNotification__Descriptor = Descriptor.MessageTypes[6]; + internal__static_bnet_protocol_game_master_GameEndedNotification__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_GameEndedNotification__Descriptor, + new string[] { "GameHandle", "Reason", }); + internal__static_bnet_protocol_game_master_PlayerLeftNotification__Descriptor = Descriptor.MessageTypes[7]; + internal__static_bnet_protocol_game_master_PlayerLeftNotification__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_PlayerLeftNotification__Descriptor, + new string[] { "GameHandle", "MemberId", "Reason", }); + internal__static_bnet_protocol_game_master_RegisterServerRequest__Descriptor = Descriptor.MessageTypes[8]; + internal__static_bnet_protocol_game_master_RegisterServerRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_RegisterServerRequest__Descriptor, + new string[] { "Attribute", "State", "ProgramId", }); + internal__static_bnet_protocol_game_master_UnregisterServerRequest__Descriptor = Descriptor.MessageTypes[9]; + internal__static_bnet_protocol_game_master_UnregisterServerRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_UnregisterServerRequest__Descriptor, + new string[] { }); + internal__static_bnet_protocol_game_master_RegisterUtilitiesRequest__Descriptor = Descriptor.MessageTypes[10]; + internal__static_bnet_protocol_game_master_RegisterUtilitiesRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_RegisterUtilitiesRequest__Descriptor, + new string[] { "Attribute", "State", "ProgramId", }); + internal__static_bnet_protocol_game_master_UnregisterUtilitiesRequest__Descriptor = Descriptor.MessageTypes[11]; + internal__static_bnet_protocol_game_master_UnregisterUtilitiesRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_UnregisterUtilitiesRequest__Descriptor, + new string[] { }); + internal__static_bnet_protocol_game_master_SubscribeRequest__Descriptor = Descriptor.MessageTypes[12]; + internal__static_bnet_protocol_game_master_SubscribeRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_SubscribeRequest__Descriptor, + new string[] { "ObjectId", }); + internal__static_bnet_protocol_game_master_SubscribeResponse__Descriptor = Descriptor.MessageTypes[13]; + internal__static_bnet_protocol_game_master_SubscribeResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_SubscribeResponse__Descriptor, + new string[] { "SubscriptionId", }); + internal__static_bnet_protocol_game_master_UnsubscribeRequest__Descriptor = Descriptor.MessageTypes[14]; + internal__static_bnet_protocol_game_master_UnsubscribeRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_UnsubscribeRequest__Descriptor, + new string[] { "SubscriptionId", }); + internal__static_bnet_protocol_game_master_ChangeGameRequest__Descriptor = Descriptor.MessageTypes[15]; + internal__static_bnet_protocol_game_master_ChangeGameRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_ChangeGameRequest__Descriptor, + new string[] { "GameHandle", "Open", "Attribute", "Replace", }); + internal__static_bnet_protocol_game_master_GetFactoryInfoRequest__Descriptor = Descriptor.MessageTypes[16]; + internal__static_bnet_protocol_game_master_GetFactoryInfoRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_GetFactoryInfoRequest__Descriptor, + new string[] { "FactoryId", }); + internal__static_bnet_protocol_game_master_GetFactoryInfoResponse__Descriptor = Descriptor.MessageTypes[17]; + internal__static_bnet_protocol_game_master_GetFactoryInfoResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_GetFactoryInfoResponse__Descriptor, + new string[] { "Attribute", "StatsBucket", }); + internal__static_bnet_protocol_game_master_GetGameStatsRequest__Descriptor = Descriptor.MessageTypes[18]; + internal__static_bnet_protocol_game_master_GetGameStatsRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_GetGameStatsRequest__Descriptor, + new string[] { "FactoryId", "Filter", }); + internal__static_bnet_protocol_game_master_GetGameStatsResponse__Descriptor = Descriptor.MessageTypes[19]; + internal__static_bnet_protocol_game_master_GetGameStatsResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_GetGameStatsResponse__Descriptor, + new string[] { "StatsBucket", }); + internal__static_bnet_protocol_game_master_FactoryUpdateNotification__Descriptor = Descriptor.MessageTypes[20]; + internal__static_bnet_protocol_game_master_FactoryUpdateNotification__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_FactoryUpdateNotification__Descriptor, + new string[] { "Op", "Description", "ProgramId", }); + internal__static_bnet_protocol_game_master_GameFoundNotification__Descriptor = Descriptor.MessageTypes[21]; + internal__static_bnet_protocol_game_master_GameFoundNotification__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_GameFoundNotification__Descriptor, + new string[] { "RequestId", "ErrorCode", "GameHandle", "ConnectInfo", }); + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + RegisterAllExtensions(registry); + global::bnet.protocol.game_master.GameFactory.RegisterAllExtensions(registry); + global::bnet.protocol.server_pool.Proto.ServerPoolService.RegisterAllExtensions(registry); + global::bnet.protocol.attribute.Proto.Attribute.RegisterAllExtensions(registry); + global::bnet.protocol.Entity.RegisterAllExtensions(registry); + global::bnet.protocol.Rpc.RegisterAllExtensions(registry); + global::bnet.protocol.game_master.GameMasterTypes.RegisterAllExtensions(registry); + return registry; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::bnet.protocol.game_master.GameFactory.Descriptor, + global::bnet.protocol.server_pool.Proto.ServerPoolService.Descriptor, + global::bnet.protocol.attribute.Proto.Attribute.Descriptor, + global::bnet.protocol.Entity.Descriptor, + global::bnet.protocol.Rpc.Descriptor, + global::bnet.protocol.game_master.GameMasterTypes.Descriptor, + }, assigner); } + #endregion + } #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class JoinGameRequest : pb::GeneratedMessage { - private static readonly JoinGameRequest defaultInstance = new Builder().BuildPartial(); + private JoinGameRequest() { } + private static readonly JoinGameRequest defaultInstance = new JoinGameRequest().MakeReadOnly(); + private static readonly string[] _joinGameRequestFieldNames = new string[] { "game_handle", "player" }; + private static readonly uint[] _joinGameRequestFieldTags = new uint[] { 10, 18 }; public static JoinGameRequest DefaultInstance { get { return defaultInstance; } } public override JoinGameRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override JoinGameRequest ThisMessage { @@ -302,21 +309,21 @@ protected override JoinGameRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_JoinGameRequest__Descriptor; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_JoinGameRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_JoinGameRequest__FieldAccessorTable; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_JoinGameRequest__FieldAccessorTable; } } public const int GameHandleFieldNumber = 1; private bool hasGameHandle; - private global::bnet.protocol.game_master.GameHandle gameHandle_ = global::bnet.protocol.game_master.GameHandle.DefaultInstance; + private global::bnet.protocol.game_master.GameHandle gameHandle_; public bool HasGameHandle { get { return hasGameHandle; } } public global::bnet.protocol.game_master.GameHandle GameHandle { - get { return gameHandle_; } + get { return gameHandle_ ?? global::bnet.protocol.game_master.GameHandle.DefaultInstance; } } public const int PlayerFieldNumber = 2; @@ -331,16 +338,6 @@ public int PlayerCount { return player_[index]; } - public const int ChannelRequestFieldNumber = 3; - private bool hasChannelRequest; - private global::bnet.protocol.channel.JoinChannelRequest channelRequest_ = global::bnet.protocol.channel.JoinChannelRequest.DefaultInstance; - public bool HasChannelRequest { - get { return hasChannelRequest; } - } - public global::bnet.protocol.channel.JoinChannelRequest ChannelRequest { - get { return channelRequest_; } - } - public override bool IsInitialized { get { if (!hasGameHandle) return false; @@ -348,23 +345,18 @@ public override bool IsInitialized { foreach (global::bnet.protocol.game_master.Player element in PlayerList) { if (!element.IsInitialized) return false; } - if (HasChannelRequest) { - if (!ChannelRequest.IsInitialized) return false; - } return true; } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasGameHandle) { - output.WriteMessage(1, GameHandle); + string[] field_names = _joinGameRequestFieldNames; + if (hasGameHandle) { + output.WriteMessage(1, field_names[0], GameHandle); } - foreach (global::bnet.protocol.game_master.Player element in PlayerList) { - output.WriteMessage(2, element); - } - if (HasChannelRequest) { - output.WriteMessage(3, ChannelRequest); + if (player_.Count > 0) { + output.WriteMessageArray(2, field_names[1], player_); } UnknownFields.WriteTo(output); } @@ -376,15 +368,12 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasGameHandle) { + if (hasGameHandle) { size += pb::CodedOutputStream.ComputeMessageSize(1, GameHandle); } foreach (global::bnet.protocol.game_master.Player element in PlayerList) { size += pb::CodedOutputStream.ComputeMessageSize(2, element); } - if (HasChannelRequest) { - size += pb::CodedOutputStream.ComputeMessageSize(3, ChannelRequest); - } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; return size; @@ -415,38 +404,73 @@ public static JoinGameRequest ParseDelimitedFrom(global::System.IO.Stream input) public static JoinGameRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static JoinGameRequest ParseFrom(pb::CodedInputStream input) { + public static JoinGameRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static JoinGameRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static JoinGameRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private JoinGameRequest MakeReadOnly() { + player_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(JoinGameRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(JoinGameRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private JoinGameRequest result; + + private JoinGameRequest PrepareBuilder() { + if (resultIsReadOnly) { + JoinGameRequest original = result; + result = new JoinGameRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - JoinGameRequest result = new JoinGameRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override JoinGameRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new JoinGameRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -458,13 +482,11 @@ public override JoinGameRequest DefaultInstanceForType { } public override JoinGameRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.player_.MakeReadOnly(); - JoinGameRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -478,33 +500,42 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(JoinGameRequest other) { if (other == global::bnet.protocol.game_master.JoinGameRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasGameHandle) { MergeGameHandle(other.GameHandle); } if (other.player_.Count != 0) { - base.AddRange(other.player_, result.player_); - } - if (other.HasChannelRequest) { - MergeChannelRequest(other.ChannelRequest); + result.player_.Add(other.player_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_joinGameRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _joinGameRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -516,12 +547,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.game_master.GameHandle.Builder subBuilder = global::bnet.protocol.game_master.GameHandle.CreateBuilder(); - if (HasGameHandle) { + if (result.hasGameHandle) { subBuilder.MergeFrom(GameHandle); } input.ReadMessage(subBuilder, extensionRegistry); @@ -529,27 +560,21 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 18: { - global::bnet.protocol.game_master.Player.Builder subBuilder = global::bnet.protocol.game_master.Player.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddPlayer(subBuilder.BuildPartial()); - break; - } - case 26: { - global::bnet.protocol.channel.JoinChannelRequest.Builder subBuilder = global::bnet.protocol.channel.JoinChannelRequest.CreateBuilder(); - if (HasChannelRequest) { - subBuilder.MergeFrom(ChannelRequest); - } - input.ReadMessage(subBuilder, extensionRegistry); - ChannelRequest = subBuilder.BuildPartial(); + input.ReadMessageArray(tag, field_name, result.player_, global::bnet.protocol.game_master.Player.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasGameHandle { - get { return result.HasGameHandle; } + get { return result.hasGameHandle; } } public global::bnet.protocol.game_master.GameHandle GameHandle { get { return result.GameHandle; } @@ -557,19 +582,22 @@ public bool HasGameHandle { } public Builder SetGameHandle(global::bnet.protocol.game_master.GameHandle value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasGameHandle = true; result.gameHandle_ = value; return this; } public Builder SetGameHandle(global::bnet.protocol.game_master.GameHandle.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasGameHandle = true; result.gameHandle_ = builderForValue.Build(); return this; } public Builder MergeGameHandle(global::bnet.protocol.game_master.GameHandle value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasGameHandle && + PrepareBuilder(); + if (result.hasGameHandle && result.gameHandle_ != global::bnet.protocol.game_master.GameHandle.DefaultInstance) { result.gameHandle_ = global::bnet.protocol.game_master.GameHandle.CreateBuilder(result.gameHandle_).MergeFrom(value).BuildPartial(); } else { @@ -579,13 +607,14 @@ public Builder MergeGameHandle(global::bnet.protocol.game_master.GameHandle valu return this; } public Builder ClearGameHandle() { + PrepareBuilder(); result.hasGameHandle = false; - result.gameHandle_ = global::bnet.protocol.game_master.GameHandle.DefaultInstance; + result.gameHandle_ = null; return this; } public pbc::IPopsicleList PlayerList { - get { return result.player_; } + get { return PrepareBuilder().player_; } } public int PlayerCount { get { return result.PlayerCount; } @@ -595,82 +624,58 @@ public int PlayerCount { } public Builder SetPlayer(int index, global::bnet.protocol.game_master.Player value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.player_[index] = value; return this; } public Builder SetPlayer(int index, global::bnet.protocol.game_master.Player.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.player_[index] = builderForValue.Build(); return this; } public Builder AddPlayer(global::bnet.protocol.game_master.Player value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.player_.Add(value); return this; } public Builder AddPlayer(global::bnet.protocol.game_master.Player.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.player_.Add(builderForValue.Build()); return this; } public Builder AddRangePlayer(scg::IEnumerable values) { - base.AddRange(values, result.player_); + PrepareBuilder(); + result.player_.Add(values); return this; } public Builder ClearPlayer() { + PrepareBuilder(); result.player_.Clear(); return this; } - - public bool HasChannelRequest { - get { return result.HasChannelRequest; } - } - public global::bnet.protocol.channel.JoinChannelRequest ChannelRequest { - get { return result.ChannelRequest; } - set { SetChannelRequest(value); } - } - public Builder SetChannelRequest(global::bnet.protocol.channel.JoinChannelRequest value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasChannelRequest = true; - result.channelRequest_ = value; - return this; - } - public Builder SetChannelRequest(global::bnet.protocol.channel.JoinChannelRequest.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasChannelRequest = true; - result.channelRequest_ = builderForValue.Build(); - return this; - } - public Builder MergeChannelRequest(global::bnet.protocol.channel.JoinChannelRequest value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasChannelRequest && - result.channelRequest_ != global::bnet.protocol.channel.JoinChannelRequest.DefaultInstance) { - result.channelRequest_ = global::bnet.protocol.channel.JoinChannelRequest.CreateBuilder(result.channelRequest_).MergeFrom(value).BuildPartial(); - } else { - result.channelRequest_ = value; - } - result.hasChannelRequest = true; - return this; - } - public Builder ClearChannelRequest() { - result.hasChannelRequest = false; - result.channelRequest_ = global::bnet.protocol.channel.JoinChannelRequest.DefaultInstance; - return this; - } } static JoinGameRequest() { - object.ReferenceEquals(global::bnet.protocol.game_master.Proto.GameMaster.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.game_master.GameMasterService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class JoinGameResponse : pb::GeneratedMessage { - private static readonly JoinGameResponse defaultInstance = new Builder().BuildPartial(); + private JoinGameResponse() { } + private static readonly JoinGameResponse defaultInstance = new JoinGameResponse().MakeReadOnly(); + private static readonly string[] _joinGameResponseFieldNames = new string[] { "connect_info", "queued", "request_id" }; + private static readonly uint[] _joinGameResponseFieldTags = new uint[] { 26, 16, 9 }; public static JoinGameResponse DefaultInstance { get { return defaultInstance; } } public override JoinGameResponse DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override JoinGameResponse ThisMessage { @@ -678,14 +683,34 @@ protected override JoinGameResponse ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_JoinGameResponse__Descriptor; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_JoinGameResponse__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_JoinGameResponse__FieldAccessorTable; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_JoinGameResponse__FieldAccessorTable; } + } + + public const int RequestIdFieldNumber = 1; + private bool hasRequestId; + private ulong requestId_; + public bool HasRequestId { + get { return hasRequestId; } + } + public ulong RequestId { + get { return requestId_; } } - public const int ConnectInfoFieldNumber = 1; + public const int QueuedFieldNumber = 2; + private bool hasQueued; + private bool queued_; + public bool HasQueued { + get { return hasQueued; } + } + public bool Queued { + get { return queued_; } + } + + public const int ConnectInfoFieldNumber = 3; private pbc::PopsicleList connectInfo_ = new pbc::PopsicleList(); public scg::IList ConnectInfoList { get { return connectInfo_; } @@ -706,10 +731,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - foreach (global::bnet.protocol.game_master.ConnectInfo element in ConnectInfoList) { - output.WriteMessage(1, element); + string[] field_names = _joinGameResponseFieldNames; + if (hasRequestId) { + output.WriteFixed64(1, field_names[2], RequestId); + } + if (hasQueued) { + output.WriteBool(2, field_names[1], Queued); + } + if (connectInfo_.Count > 0) { + output.WriteMessageArray(3, field_names[0], connectInfo_); } UnknownFields.WriteTo(output); } @@ -721,8 +753,14 @@ public override int SerializedSize { if (size != -1) return size; size = 0; + if (hasRequestId) { + size += pb::CodedOutputStream.ComputeFixed64Size(1, RequestId); + } + if (hasQueued) { + size += pb::CodedOutputStream.ComputeBoolSize(2, Queued); + } foreach (global::bnet.protocol.game_master.ConnectInfo element in ConnectInfoList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); + size += pb::CodedOutputStream.ComputeMessageSize(3, element); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -754,38 +792,73 @@ public static JoinGameResponse ParseDelimitedFrom(global::System.IO.Stream input public static JoinGameResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static JoinGameResponse ParseFrom(pb::CodedInputStream input) { + public static JoinGameResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static JoinGameResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static JoinGameResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private JoinGameResponse MakeReadOnly() { + connectInfo_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(JoinGameResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(JoinGameResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private JoinGameResponse result; + + private JoinGameResponse PrepareBuilder() { + if (resultIsReadOnly) { + JoinGameResponse original = result; + result = new JoinGameResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - JoinGameResponse result = new JoinGameResponse(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override JoinGameResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new JoinGameResponse(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -797,13 +870,11 @@ public override JoinGameResponse DefaultInstanceForType { } public override JoinGameResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.connectInfo_.MakeReadOnly(); - JoinGameResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -817,27 +888,45 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(JoinGameResponse other) { if (other == global::bnet.protocol.game_master.JoinGameResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasRequestId) { + RequestId = other.RequestId; + } + if (other.HasQueued) { + Queued = other.Queued; + } if (other.connectInfo_.Count != 0) { - base.AddRange(other.connectInfo_, result.connectInfo_); + result.connectInfo_.Add(other.connectInfo_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_joinGameResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _joinGameResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -849,22 +938,73 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } - case 10: { - global::bnet.protocol.game_master.ConnectInfo.Builder subBuilder = global::bnet.protocol.game_master.ConnectInfo.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddConnectInfo(subBuilder.BuildPartial()); + case 9: { + result.hasRequestId = input.ReadFixed64(ref result.requestId_); + break; + } + case 16: { + result.hasQueued = input.ReadBool(ref result.queued_); + break; + } + case 26: { + input.ReadMessageArray(tag, field_name, result.connectInfo_, global::bnet.protocol.game_master.ConnectInfo.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasRequestId { + get { return result.hasRequestId; } + } + public ulong RequestId { + get { return result.RequestId; } + set { SetRequestId(value); } + } + public Builder SetRequestId(ulong value) { + PrepareBuilder(); + result.hasRequestId = true; + result.requestId_ = value; + return this; + } + public Builder ClearRequestId() { + PrepareBuilder(); + result.hasRequestId = false; + result.requestId_ = 0; + return this; } + public bool HasQueued { + get { return result.hasQueued; } + } + public bool Queued { + get { return result.Queued; } + set { SetQueued(value); } + } + public Builder SetQueued(bool value) { + PrepareBuilder(); + result.hasQueued = true; + result.queued_ = value; + return this; + } + public Builder ClearQueued() { + PrepareBuilder(); + result.hasQueued = false; + result.queued_ = false; + return this; + } public pbc::IPopsicleList ConnectInfoList { - get { return result.connectInfo_; } + get { return PrepareBuilder().connectInfo_; } } public int ConnectInfoCount { get { return result.ConnectInfoCount; } @@ -874,46 +1014,58 @@ public int ConnectInfoCount { } public Builder SetConnectInfo(int index, global::bnet.protocol.game_master.ConnectInfo value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.connectInfo_[index] = value; return this; } public Builder SetConnectInfo(int index, global::bnet.protocol.game_master.ConnectInfo.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.connectInfo_[index] = builderForValue.Build(); return this; } public Builder AddConnectInfo(global::bnet.protocol.game_master.ConnectInfo value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.connectInfo_.Add(value); return this; } public Builder AddConnectInfo(global::bnet.protocol.game_master.ConnectInfo.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.connectInfo_.Add(builderForValue.Build()); return this; } public Builder AddRangeConnectInfo(scg::IEnumerable values) { - base.AddRange(values, result.connectInfo_); + PrepareBuilder(); + result.connectInfo_.Add(values); return this; } public Builder ClearConnectInfo() { + PrepareBuilder(); result.connectInfo_.Clear(); return this; } } static JoinGameResponse() { - object.ReferenceEquals(global::bnet.protocol.game_master.Proto.GameMaster.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.game_master.GameMasterService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class ListFactoriesRequest : pb::GeneratedMessage { - private static readonly ListFactoriesRequest defaultInstance = new Builder().BuildPartial(); + private ListFactoriesRequest() { } + private static readonly ListFactoriesRequest defaultInstance = new ListFactoriesRequest().MakeReadOnly(); + private static readonly string[] _listFactoriesRequestFieldNames = new string[] { "filter", "max_results", "start_index" }; + private static readonly uint[] _listFactoriesRequestFieldTags = new uint[] { 10, 24, 16 }; public static ListFactoriesRequest DefaultInstance { get { return defaultInstance; } } public override ListFactoriesRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ListFactoriesRequest ThisMessage { @@ -921,26 +1073,26 @@ protected override ListFactoriesRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_ListFactoriesRequest__Descriptor; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_ListFactoriesRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_ListFactoriesRequest__FieldAccessorTable; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_ListFactoriesRequest__FieldAccessorTable; } } public const int FilterFieldNumber = 1; private bool hasFilter; - private global::bnet.protocol.attribute.AttributeFilter filter_ = global::bnet.protocol.attribute.AttributeFilter.DefaultInstance; + private global::bnet.protocol.attribute.AttributeFilter filter_; public bool HasFilter { get { return hasFilter; } } public global::bnet.protocol.attribute.AttributeFilter Filter { - get { return filter_; } + get { return filter_ ?? global::bnet.protocol.attribute.AttributeFilter.DefaultInstance; } } public const int StartIndexFieldNumber = 2; private bool hasStartIndex; - private uint startIndex_ = 0; + private uint startIndex_; public bool HasStartIndex { get { return hasStartIndex; } } @@ -966,16 +1118,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasFilter) { - output.WriteMessage(1, Filter); + string[] field_names = _listFactoriesRequestFieldNames; + if (hasFilter) { + output.WriteMessage(1, field_names[0], Filter); } - if (HasStartIndex) { - output.WriteUInt32(2, StartIndex); + if (hasStartIndex) { + output.WriteUInt32(2, field_names[2], StartIndex); } - if (HasMaxResults) { - output.WriteUInt32(3, MaxResults); + if (hasMaxResults) { + output.WriteUInt32(3, field_names[1], MaxResults); } UnknownFields.WriteTo(output); } @@ -987,13 +1140,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasFilter) { + if (hasFilter) { size += pb::CodedOutputStream.ComputeMessageSize(1, Filter); } - if (HasStartIndex) { + if (hasStartIndex) { size += pb::CodedOutputStream.ComputeUInt32Size(2, StartIndex); } - if (HasMaxResults) { + if (hasMaxResults) { size += pb::CodedOutputStream.ComputeUInt32Size(3, MaxResults); } size += UnknownFields.SerializedSize; @@ -1026,38 +1179,72 @@ public static ListFactoriesRequest ParseDelimitedFrom(global::System.IO.Stream i public static ListFactoriesRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static ListFactoriesRequest ParseFrom(pb::CodedInputStream input) { + public static ListFactoriesRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ListFactoriesRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static ListFactoriesRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private ListFactoriesRequest MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(ListFactoriesRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ListFactoriesRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ListFactoriesRequest result; + + private ListFactoriesRequest PrepareBuilder() { + if (resultIsReadOnly) { + ListFactoriesRequest original = result; + result = new ListFactoriesRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - ListFactoriesRequest result = new ListFactoriesRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override ListFactoriesRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ListFactoriesRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -1069,12 +1256,11 @@ public override ListFactoriesRequest DefaultInstanceForType { } public override ListFactoriesRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - ListFactoriesRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1088,6 +1274,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(ListFactoriesRequest other) { if (other == global::bnet.protocol.game_master.ListFactoriesRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasFilter) { MergeFilter(other.Filter); } @@ -1101,20 +1288,31 @@ public override Builder MergeFrom(ListFactoriesRequest other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_listFactoriesRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _listFactoriesRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1126,12 +1324,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.attribute.AttributeFilter.Builder subBuilder = global::bnet.protocol.attribute.AttributeFilter.CreateBuilder(); - if (HasFilter) { + if (result.hasFilter) { subBuilder.MergeFrom(Filter); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1139,20 +1337,25 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 16: { - StartIndex = input.ReadUInt32(); + result.hasStartIndex = input.ReadUInt32(ref result.startIndex_); break; } case 24: { - MaxResults = input.ReadUInt32(); + result.hasMaxResults = input.ReadUInt32(ref result.maxResults_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasFilter { - get { return result.HasFilter; } + get { return result.hasFilter; } } public global::bnet.protocol.attribute.AttributeFilter Filter { get { return result.Filter; } @@ -1160,19 +1363,22 @@ public bool HasFilter { } public Builder SetFilter(global::bnet.protocol.attribute.AttributeFilter value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasFilter = true; result.filter_ = value; return this; } public Builder SetFilter(global::bnet.protocol.attribute.AttributeFilter.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasFilter = true; result.filter_ = builderForValue.Build(); return this; } public Builder MergeFilter(global::bnet.protocol.attribute.AttributeFilter value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasFilter && + PrepareBuilder(); + if (result.hasFilter && result.filter_ != global::bnet.protocol.attribute.AttributeFilter.DefaultInstance) { result.filter_ = global::bnet.protocol.attribute.AttributeFilter.CreateBuilder(result.filter_).MergeFrom(value).BuildPartial(); } else { @@ -1182,60 +1388,71 @@ public Builder MergeFilter(global::bnet.protocol.attribute.AttributeFilter value return this; } public Builder ClearFilter() { + PrepareBuilder(); result.hasFilter = false; - result.filter_ = global::bnet.protocol.attribute.AttributeFilter.DefaultInstance; + result.filter_ = null; return this; } public bool HasStartIndex { - get { return result.HasStartIndex; } + get { return result.hasStartIndex; } } public uint StartIndex { get { return result.StartIndex; } set { SetStartIndex(value); } } public Builder SetStartIndex(uint value) { + PrepareBuilder(); result.hasStartIndex = true; result.startIndex_ = value; return this; } public Builder ClearStartIndex() { + PrepareBuilder(); result.hasStartIndex = false; result.startIndex_ = 0; return this; } public bool HasMaxResults { - get { return result.HasMaxResults; } + get { return result.hasMaxResults; } } public uint MaxResults { get { return result.MaxResults; } set { SetMaxResults(value); } } public Builder SetMaxResults(uint value) { + PrepareBuilder(); result.hasMaxResults = true; result.maxResults_ = value; return this; } public Builder ClearMaxResults() { + PrepareBuilder(); result.hasMaxResults = false; result.maxResults_ = 100; return this; } } static ListFactoriesRequest() { - object.ReferenceEquals(global::bnet.protocol.game_master.Proto.GameMaster.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.game_master.GameMasterService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class ListFactoriesResponse : pb::GeneratedMessage { - private static readonly ListFactoriesResponse defaultInstance = new Builder().BuildPartial(); + private ListFactoriesResponse() { } + private static readonly ListFactoriesResponse defaultInstance = new ListFactoriesResponse().MakeReadOnly(); + private static readonly string[] _listFactoriesResponseFieldNames = new string[] { "description", "total_results" }; + private static readonly uint[] _listFactoriesResponseFieldTags = new uint[] { 10, 16 }; public static ListFactoriesResponse DefaultInstance { get { return defaultInstance; } } public override ListFactoriesResponse DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ListFactoriesResponse ThisMessage { @@ -1243,11 +1460,11 @@ protected override ListFactoriesResponse ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_ListFactoriesResponse__Descriptor; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_ListFactoriesResponse__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_ListFactoriesResponse__FieldAccessorTable; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_ListFactoriesResponse__FieldAccessorTable; } } public const int DescriptionFieldNumber = 1; @@ -1264,7 +1481,7 @@ public int DescriptionCount { public const int TotalResultsFieldNumber = 2; private bool hasTotalResults; - private uint totalResults_ = 0; + private uint totalResults_; public bool HasTotalResults { get { return hasTotalResults; } } @@ -1281,13 +1498,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - foreach (global::bnet.protocol.game_master.GameFactoryDescription element in DescriptionList) { - output.WriteMessage(1, element); + string[] field_names = _listFactoriesResponseFieldNames; + if (description_.Count > 0) { + output.WriteMessageArray(1, field_names[0], description_); } - if (HasTotalResults) { - output.WriteUInt32(2, TotalResults); + if (hasTotalResults) { + output.WriteUInt32(2, field_names[1], TotalResults); } UnknownFields.WriteTo(output); } @@ -1302,7 +1520,7 @@ public override int SerializedSize { foreach (global::bnet.protocol.game_master.GameFactoryDescription element in DescriptionList) { size += pb::CodedOutputStream.ComputeMessageSize(1, element); } - if (HasTotalResults) { + if (hasTotalResults) { size += pb::CodedOutputStream.ComputeUInt32Size(2, TotalResults); } size += UnknownFields.SerializedSize; @@ -1335,38 +1553,73 @@ public static ListFactoriesResponse ParseDelimitedFrom(global::System.IO.Stream public static ListFactoriesResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static ListFactoriesResponse ParseFrom(pb::CodedInputStream input) { + public static ListFactoriesResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ListFactoriesResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static ListFactoriesResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private ListFactoriesResponse MakeReadOnly() { + description_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(ListFactoriesResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ListFactoriesResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ListFactoriesResponse result; + + private ListFactoriesResponse PrepareBuilder() { + if (resultIsReadOnly) { + ListFactoriesResponse original = result; + result = new ListFactoriesResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - ListFactoriesResponse result = new ListFactoriesResponse(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override ListFactoriesResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ListFactoriesResponse(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -1378,13 +1631,11 @@ public override ListFactoriesResponse DefaultInstanceForType { } public override ListFactoriesResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.description_.MakeReadOnly(); - ListFactoriesResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1398,8 +1649,9 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(ListFactoriesResponse other) { if (other == global::bnet.protocol.game_master.ListFactoriesResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.description_.Count != 0) { - base.AddRange(other.description_, result.description_); + result.description_.Add(other.description_); } if (other.HasTotalResults) { TotalResults = other.TotalResults; @@ -1408,20 +1660,31 @@ public override Builder MergeFrom(ListFactoriesResponse other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_listFactoriesResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _listFactoriesResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1433,26 +1696,29 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { - global::bnet.protocol.game_master.GameFactoryDescription.Builder subBuilder = global::bnet.protocol.game_master.GameFactoryDescription.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddDescription(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.description_, global::bnet.protocol.game_master.GameFactoryDescription.DefaultInstance, extensionRegistry); break; } case 16: { - TotalResults = input.ReadUInt32(); + result.hasTotalResults = input.ReadUInt32(ref result.totalResults_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public pbc::IPopsicleList DescriptionList { - get { return result.description_; } + get { return PrepareBuilder().description_; } } public int DescriptionCount { get { return result.DescriptionCount; } @@ -1462,64 +1728,78 @@ public int DescriptionCount { } public Builder SetDescription(int index, global::bnet.protocol.game_master.GameFactoryDescription value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.description_[index] = value; return this; } public Builder SetDescription(int index, global::bnet.protocol.game_master.GameFactoryDescription.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.description_[index] = builderForValue.Build(); return this; } public Builder AddDescription(global::bnet.protocol.game_master.GameFactoryDescription value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.description_.Add(value); return this; } public Builder AddDescription(global::bnet.protocol.game_master.GameFactoryDescription.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.description_.Add(builderForValue.Build()); return this; } public Builder AddRangeDescription(scg::IEnumerable values) { - base.AddRange(values, result.description_); + PrepareBuilder(); + result.description_.Add(values); return this; } public Builder ClearDescription() { + PrepareBuilder(); result.description_.Clear(); return this; } public bool HasTotalResults { - get { return result.HasTotalResults; } + get { return result.hasTotalResults; } } public uint TotalResults { get { return result.TotalResults; } set { SetTotalResults(value); } } public Builder SetTotalResults(uint value) { + PrepareBuilder(); result.hasTotalResults = true; result.totalResults_ = value; return this; } public Builder ClearTotalResults() { + PrepareBuilder(); result.hasTotalResults = false; result.totalResults_ = 0; return this; } } static ListFactoriesResponse() { - object.ReferenceEquals(global::bnet.protocol.game_master.Proto.GameMaster.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.game_master.GameMasterService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class FindGameRequest : pb::GeneratedMessage { - private static readonly FindGameRequest defaultInstance = new Builder().BuildPartial(); + private FindGameRequest() { } + private static readonly FindGameRequest defaultInstance = new FindGameRequest().MakeReadOnly(); + private static readonly string[] _findGameRequestFieldNames = new string[] { "factory_id", "factory_object_id", "player", "properties", "request_id" }; + private static readonly uint[] _findGameRequestFieldTags = new uint[] { 17, 32, 10, 26, 41 }; public static FindGameRequest DefaultInstance { get { return defaultInstance; } } public override FindGameRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override FindGameRequest ThisMessage { @@ -1527,11 +1807,11 @@ protected override FindGameRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_FindGameRequest__Descriptor; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_FindGameRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_FindGameRequest__FieldAccessorTable; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_FindGameRequest__FieldAccessorTable; } } public const int PlayerFieldNumber = 1; @@ -1548,7 +1828,7 @@ public int PlayerCount { public const int FactoryIdFieldNumber = 2; private bool hasFactoryId; - private ulong factoryId_ = 0; + private ulong factoryId_; public bool HasFactoryId { get { return hasFactoryId; } } @@ -1558,66 +1838,63 @@ public ulong FactoryId { public const int PropertiesFieldNumber = 3; private bool hasProperties; - private global::bnet.protocol.game_master.GameProperties properties_ = global::bnet.protocol.game_master.GameProperties.DefaultInstance; + private global::bnet.protocol.game_master.GameProperties properties_; public bool HasProperties { get { return hasProperties; } } public global::bnet.protocol.game_master.GameProperties Properties { - get { return properties_; } + get { return properties_ ?? global::bnet.protocol.game_master.GameProperties.DefaultInstance; } } - public const int ObjectIdFieldNumber = 4; - private bool hasObjectId; - private ulong objectId_ = 0UL; - public bool HasObjectId { - get { return hasObjectId; } + public const int FactoryObjectIdFieldNumber = 4; + private bool hasFactoryObjectId; + private ulong factoryObjectId_; + public bool HasFactoryObjectId { + get { return hasFactoryObjectId; } } - public ulong ObjectId { - get { return objectId_; } + public ulong FactoryObjectId { + get { return factoryObjectId_; } } - public const int ChannelRequestFieldNumber = 5; - private bool hasChannelRequest; - private global::bnet.protocol.channel.CreateChannelRequest channelRequest_ = global::bnet.protocol.channel.CreateChannelRequest.DefaultInstance; - public bool HasChannelRequest { - get { return hasChannelRequest; } + public const int RequestIdFieldNumber = 5; + private bool hasRequestId; + private ulong requestId_; + public bool HasRequestId { + get { return hasRequestId; } } - public global::bnet.protocol.channel.CreateChannelRequest ChannelRequest { - get { return channelRequest_; } + public ulong RequestId { + get { return requestId_; } } public override bool IsInitialized { get { - if (!hasObjectId) return false; foreach (global::bnet.protocol.game_master.Player element in PlayerList) { if (!element.IsInitialized) return false; } if (HasProperties) { if (!Properties.IsInitialized) return false; } - if (HasChannelRequest) { - if (!ChannelRequest.IsInitialized) return false; - } return true; } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - foreach (global::bnet.protocol.game_master.Player element in PlayerList) { - output.WriteMessage(1, element); + string[] field_names = _findGameRequestFieldNames; + if (player_.Count > 0) { + output.WriteMessageArray(1, field_names[2], player_); } - if (HasFactoryId) { - output.WriteFixed64(2, FactoryId); + if (hasFactoryId) { + output.WriteFixed64(2, field_names[0], FactoryId); } - if (HasProperties) { - output.WriteMessage(3, Properties); + if (hasProperties) { + output.WriteMessage(3, field_names[3], Properties); } - if (HasObjectId) { - output.WriteUInt64(4, ObjectId); + if (hasFactoryObjectId) { + output.WriteUInt64(4, field_names[1], FactoryObjectId); } - if (HasChannelRequest) { - output.WriteMessage(5, ChannelRequest); + if (hasRequestId) { + output.WriteFixed64(5, field_names[4], RequestId); } UnknownFields.WriteTo(output); } @@ -1632,17 +1909,17 @@ public override int SerializedSize { foreach (global::bnet.protocol.game_master.Player element in PlayerList) { size += pb::CodedOutputStream.ComputeMessageSize(1, element); } - if (HasFactoryId) { + if (hasFactoryId) { size += pb::CodedOutputStream.ComputeFixed64Size(2, FactoryId); } - if (HasProperties) { + if (hasProperties) { size += pb::CodedOutputStream.ComputeMessageSize(3, Properties); } - if (HasObjectId) { - size += pb::CodedOutputStream.ComputeUInt64Size(4, ObjectId); + if (hasFactoryObjectId) { + size += pb::CodedOutputStream.ComputeUInt64Size(4, FactoryObjectId); } - if (HasChannelRequest) { - size += pb::CodedOutputStream.ComputeMessageSize(5, ChannelRequest); + if (hasRequestId) { + size += pb::CodedOutputStream.ComputeFixed64Size(5, RequestId); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -1674,38 +1951,73 @@ public static FindGameRequest ParseDelimitedFrom(global::System.IO.Stream input) public static FindGameRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static FindGameRequest ParseFrom(pb::CodedInputStream input) { + public static FindGameRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static FindGameRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static FindGameRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private FindGameRequest MakeReadOnly() { + player_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(FindGameRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(FindGameRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private FindGameRequest result; + + private FindGameRequest PrepareBuilder() { + if (resultIsReadOnly) { + FindGameRequest original = result; + result = new FindGameRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - FindGameRequest result = new FindGameRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override FindGameRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new FindGameRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -1717,13 +2029,11 @@ public override FindGameRequest DefaultInstanceForType { } public override FindGameRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.player_.MakeReadOnly(); - FindGameRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1737,8 +2047,9 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(FindGameRequest other) { if (other == global::bnet.protocol.game_master.FindGameRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.player_.Count != 0) { - base.AddRange(other.player_, result.player_); + result.player_.Add(other.player_); } if (other.HasFactoryId) { FactoryId = other.FactoryId; @@ -1746,30 +2057,41 @@ public override Builder MergeFrom(FindGameRequest other) { if (other.HasProperties) { MergeProperties(other.Properties); } - if (other.HasObjectId) { - ObjectId = other.ObjectId; + if (other.HasFactoryObjectId) { + FactoryObjectId = other.FactoryObjectId; } - if (other.HasChannelRequest) { - MergeChannelRequest(other.ChannelRequest); + if (other.HasRequestId) { + RequestId = other.RequestId; } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_findGameRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _findGameRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1781,22 +2103,20 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { - global::bnet.protocol.game_master.Player.Builder subBuilder = global::bnet.protocol.game_master.Player.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddPlayer(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.player_, global::bnet.protocol.game_master.Player.DefaultInstance, extensionRegistry); break; } case 17: { - FactoryId = input.ReadFixed64(); + result.hasFactoryId = input.ReadFixed64(ref result.factoryId_); break; } case 26: { global::bnet.protocol.game_master.GameProperties.Builder subBuilder = global::bnet.protocol.game_master.GameProperties.CreateBuilder(); - if (HasProperties) { + if (result.hasProperties) { subBuilder.MergeFrom(Properties); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1804,25 +2124,25 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 32: { - ObjectId = input.ReadUInt64(); + result.hasFactoryObjectId = input.ReadUInt64(ref result.factoryObjectId_); break; } - case 42: { - global::bnet.protocol.channel.CreateChannelRequest.Builder subBuilder = global::bnet.protocol.channel.CreateChannelRequest.CreateBuilder(); - if (HasChannelRequest) { - subBuilder.MergeFrom(ChannelRequest); - } - input.ReadMessage(subBuilder, extensionRegistry); - ChannelRequest = subBuilder.BuildPartial(); + case 41: { + result.hasRequestId = input.ReadFixed64(ref result.requestId_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public pbc::IPopsicleList PlayerList { - get { return result.player_; } + get { return PrepareBuilder().player_; } } public int PlayerCount { get { return result.PlayerCount; } @@ -1832,53 +2152,61 @@ public int PlayerCount { } public Builder SetPlayer(int index, global::bnet.protocol.game_master.Player value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.player_[index] = value; return this; } public Builder SetPlayer(int index, global::bnet.protocol.game_master.Player.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.player_[index] = builderForValue.Build(); return this; } public Builder AddPlayer(global::bnet.protocol.game_master.Player value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.player_.Add(value); return this; } public Builder AddPlayer(global::bnet.protocol.game_master.Player.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.player_.Add(builderForValue.Build()); return this; } public Builder AddRangePlayer(scg::IEnumerable values) { - base.AddRange(values, result.player_); + PrepareBuilder(); + result.player_.Add(values); return this; } public Builder ClearPlayer() { + PrepareBuilder(); result.player_.Clear(); return this; } public bool HasFactoryId { - get { return result.HasFactoryId; } + get { return result.hasFactoryId; } } public ulong FactoryId { get { return result.FactoryId; } set { SetFactoryId(value); } } public Builder SetFactoryId(ulong value) { + PrepareBuilder(); result.hasFactoryId = true; result.factoryId_ = value; return this; } public Builder ClearFactoryId() { + PrepareBuilder(); result.hasFactoryId = false; result.factoryId_ = 0; return this; } public bool HasProperties { - get { return result.HasProperties; } + get { return result.hasProperties; } } public global::bnet.protocol.game_master.GameProperties Properties { get { return result.Properties; } @@ -1886,19 +2214,22 @@ public bool HasProperties { } public Builder SetProperties(global::bnet.protocol.game_master.GameProperties value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasProperties = true; result.properties_ = value; return this; } public Builder SetProperties(global::bnet.protocol.game_master.GameProperties.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasProperties = true; result.properties_ = builderForValue.Build(); return this; } public Builder MergeProperties(global::bnet.protocol.game_master.GameProperties value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasProperties && + PrepareBuilder(); + if (result.hasProperties && result.properties_ != global::bnet.protocol.game_master.GameProperties.DefaultInstance) { result.properties_ = global::bnet.protocol.game_master.GameProperties.CreateBuilder(result.properties_).MergeFrom(value).BuildPartial(); } else { @@ -1908,78 +2239,71 @@ public Builder MergeProperties(global::bnet.protocol.game_master.GameProperties return this; } public Builder ClearProperties() { + PrepareBuilder(); result.hasProperties = false; - result.properties_ = global::bnet.protocol.game_master.GameProperties.DefaultInstance; + result.properties_ = null; return this; } - public bool HasObjectId { - get { return result.HasObjectId; } + public bool HasFactoryObjectId { + get { return result.hasFactoryObjectId; } } - public ulong ObjectId { - get { return result.ObjectId; } - set { SetObjectId(value); } + public ulong FactoryObjectId { + get { return result.FactoryObjectId; } + set { SetFactoryObjectId(value); } } - public Builder SetObjectId(ulong value) { - result.hasObjectId = true; - result.objectId_ = value; + public Builder SetFactoryObjectId(ulong value) { + PrepareBuilder(); + result.hasFactoryObjectId = true; + result.factoryObjectId_ = value; return this; } - public Builder ClearObjectId() { - result.hasObjectId = false; - result.objectId_ = 0UL; + public Builder ClearFactoryObjectId() { + PrepareBuilder(); + result.hasFactoryObjectId = false; + result.factoryObjectId_ = 0UL; return this; } - public bool HasChannelRequest { - get { return result.HasChannelRequest; } - } - public global::bnet.protocol.channel.CreateChannelRequest ChannelRequest { - get { return result.ChannelRequest; } - set { SetChannelRequest(value); } - } - public Builder SetChannelRequest(global::bnet.protocol.channel.CreateChannelRequest value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasChannelRequest = true; - result.channelRequest_ = value; - return this; + public bool HasRequestId { + get { return result.hasRequestId; } } - public Builder SetChannelRequest(global::bnet.protocol.channel.CreateChannelRequest.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasChannelRequest = true; - result.channelRequest_ = builderForValue.Build(); - return this; + public ulong RequestId { + get { return result.RequestId; } + set { SetRequestId(value); } } - public Builder MergeChannelRequest(global::bnet.protocol.channel.CreateChannelRequest value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasChannelRequest && - result.channelRequest_ != global::bnet.protocol.channel.CreateChannelRequest.DefaultInstance) { - result.channelRequest_ = global::bnet.protocol.channel.CreateChannelRequest.CreateBuilder(result.channelRequest_).MergeFrom(value).BuildPartial(); - } else { - result.channelRequest_ = value; - } - result.hasChannelRequest = true; + public Builder SetRequestId(ulong value) { + PrepareBuilder(); + result.hasRequestId = true; + result.requestId_ = value; return this; } - public Builder ClearChannelRequest() { - result.hasChannelRequest = false; - result.channelRequest_ = global::bnet.protocol.channel.CreateChannelRequest.DefaultInstance; + public Builder ClearRequestId() { + PrepareBuilder(); + result.hasRequestId = false; + result.requestId_ = 0; return this; } } static FindGameRequest() { - object.ReferenceEquals(global::bnet.protocol.game_master.Proto.GameMaster.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.game_master.GameMasterService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class FindGameResponse : pb::GeneratedMessage { - private static readonly FindGameResponse defaultInstance = new Builder().BuildPartial(); + private FindGameResponse() { } + private static readonly FindGameResponse defaultInstance = new FindGameResponse().MakeReadOnly(); + private static readonly string[] _findGameResponseFieldNames = new string[] { "factory_id", "queued", "request_id" }; + private static readonly uint[] _findGameResponseFieldTags = new uint[] { 17, 24, 9 }; public static FindGameResponse DefaultInstance { get { return defaultInstance; } } public override FindGameResponse DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override FindGameResponse ThisMessage { @@ -1987,16 +2311,16 @@ protected override FindGameResponse ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_FindGameResponse__Descriptor; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_FindGameResponse__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_FindGameResponse__FieldAccessorTable; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_FindGameResponse__FieldAccessorTable; } } public const int RequestIdFieldNumber = 1; private bool hasRequestId; - private ulong requestId_ = 0UL; + private ulong requestId_; public bool HasRequestId { get { return hasRequestId; } } @@ -2006,7 +2330,7 @@ public ulong RequestId { public const int FactoryIdFieldNumber = 2; private bool hasFactoryId; - private ulong factoryId_ = 0; + private ulong factoryId_; public bool HasFactoryId { get { return hasFactoryId; } } @@ -2014,19 +2338,33 @@ public ulong FactoryId { get { return factoryId_; } } + public const int QueuedFieldNumber = 3; + private bool hasQueued; + private bool queued_; + public bool HasQueued { + get { return hasQueued; } + } + public bool Queued { + get { return queued_; } + } + public override bool IsInitialized { get { return true; } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasRequestId) { - output.WriteUInt64(1, RequestId); + string[] field_names = _findGameResponseFieldNames; + if (hasRequestId) { + output.WriteFixed64(1, field_names[2], RequestId); } - if (HasFactoryId) { - output.WriteFixed64(2, FactoryId); + if (hasFactoryId) { + output.WriteFixed64(2, field_names[0], FactoryId); + } + if (hasQueued) { + output.WriteBool(3, field_names[1], Queued); } UnknownFields.WriteTo(output); } @@ -2038,12 +2376,15 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasRequestId) { - size += pb::CodedOutputStream.ComputeUInt64Size(1, RequestId); + if (hasRequestId) { + size += pb::CodedOutputStream.ComputeFixed64Size(1, RequestId); } - if (HasFactoryId) { + if (hasFactoryId) { size += pb::CodedOutputStream.ComputeFixed64Size(2, FactoryId); } + if (hasQueued) { + size += pb::CodedOutputStream.ComputeBoolSize(3, Queued); + } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; return size; @@ -2074,38 +2415,72 @@ public static FindGameResponse ParseDelimitedFrom(global::System.IO.Stream input public static FindGameResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static FindGameResponse ParseFrom(pb::CodedInputStream input) { + public static FindGameResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static FindGameResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static FindGameResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private FindGameResponse MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(FindGameResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(FindGameResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - FindGameResponse result = new FindGameResponse(); + private bool resultIsReadOnly; + private FindGameResponse result; + + private FindGameResponse PrepareBuilder() { + if (resultIsReadOnly) { + FindGameResponse original = result; + result = new FindGameResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override FindGameResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new FindGameResponse(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -2117,12 +2492,11 @@ public override FindGameResponse DefaultInstanceForType { } public override FindGameResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - FindGameResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2136,30 +2510,45 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(FindGameResponse other) { if (other == global::bnet.protocol.game_master.FindGameResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.HasRequestId) { RequestId = other.RequestId; } if (other.HasFactoryId) { FactoryId = other.FactoryId; } + if (other.HasQueued) { + Queued = other.Queued; + } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_findGameResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _findGameResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -2171,329 +2560,110 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } - case 8: { - RequestId = input.ReadUInt64(); + case 9: { + result.hasRequestId = input.ReadFixed64(ref result.requestId_); break; } case 17: { - FactoryId = input.ReadFixed64(); + result.hasFactoryId = input.ReadFixed64(ref result.factoryId_); + break; + } + case 24: { + result.hasQueued = input.ReadBool(ref result.queued_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasRequestId { - get { return result.HasRequestId; } + get { return result.hasRequestId; } } public ulong RequestId { get { return result.RequestId; } set { SetRequestId(value); } } public Builder SetRequestId(ulong value) { + PrepareBuilder(); result.hasRequestId = true; result.requestId_ = value; return this; } public Builder ClearRequestId() { + PrepareBuilder(); result.hasRequestId = false; - result.requestId_ = 0UL; + result.requestId_ = 0; return this; } public bool HasFactoryId { - get { return result.HasFactoryId; } - } - public ulong FactoryId { - get { return result.FactoryId; } - set { SetFactoryId(value); } - } - public Builder SetFactoryId(ulong value) { - result.hasFactoryId = true; - result.factoryId_ = value; - return this; - } - public Builder ClearFactoryId() { - result.hasFactoryId = false; - result.factoryId_ = 0; - return this; - } - } - static FindGameResponse() { - object.ReferenceEquals(global::bnet.protocol.game_master.Proto.GameMaster.Descriptor, null); - } - } - - public sealed partial class CancelFindGameRequest : pb::GeneratedMessage { - private static readonly CancelFindGameRequest defaultInstance = new Builder().BuildPartial(); - public static CancelFindGameRequest DefaultInstance { - get { return defaultInstance; } - } - - public override CancelFindGameRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override CancelFindGameRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_CancelFindGameRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_CancelFindGameRequest__FieldAccessorTable; } - } - - public const int FactoryIdFieldNumber = 1; - private bool hasFactoryId; - private ulong factoryId_ = 0; - public bool HasFactoryId { - get { return hasFactoryId; } - } - public ulong FactoryId { - get { return factoryId_; } - } - - public const int RequestIdFieldNumber = 2; - private bool hasRequestId; - private ulong requestId_ = 0UL; - public bool HasRequestId { - get { return hasRequestId; } - } - public ulong RequestId { - get { return requestId_; } - } - - public override bool IsInitialized { - get { - if (!hasFactoryId) return false; - if (!hasRequestId) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - int size = SerializedSize; - if (HasFactoryId) { - output.WriteFixed64(1, FactoryId); - } - if (HasRequestId) { - output.WriteUInt64(2, RequestId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasFactoryId) { - size += pb::CodedOutputStream.ComputeFixed64Size(1, FactoryId); - } - if (HasRequestId) { - size += pb::CodedOutputStream.ComputeUInt64Size(2, RequestId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static CancelFindGameRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CancelFindGameRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CancelFindGameRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CancelFindGameRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CancelFindGameRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CancelFindGameRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CancelFindGameRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CancelFindGameRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CancelFindGameRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CancelFindGameRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CancelFindGameRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - CancelFindGameRequest result = new CancelFindGameRequest(); - - protected override CancelFindGameRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new CancelFindGameRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::bnet.protocol.game_master.CancelFindGameRequest.Descriptor; } - } - - public override CancelFindGameRequest DefaultInstanceForType { - get { return global::bnet.protocol.game_master.CancelFindGameRequest.DefaultInstance; } - } - - public override CancelFindGameRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - CancelFindGameRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CancelFindGameRequest) { - return MergeFrom((CancelFindGameRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CancelFindGameRequest other) { - if (other == global::bnet.protocol.game_master.CancelFindGameRequest.DefaultInstance) return this; - if (other.HasFactoryId) { - FactoryId = other.FactoryId; - } - if (other.HasRequestId) { - RequestId = other.RequestId; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 9: { - FactoryId = input.ReadFixed64(); - break; - } - case 16: { - RequestId = input.ReadUInt64(); - break; - } - } - } - } - - - public bool HasFactoryId { - get { return result.HasFactoryId; } + get { return result.hasFactoryId; } } public ulong FactoryId { get { return result.FactoryId; } set { SetFactoryId(value); } } public Builder SetFactoryId(ulong value) { + PrepareBuilder(); result.hasFactoryId = true; result.factoryId_ = value; return this; } public Builder ClearFactoryId() { + PrepareBuilder(); result.hasFactoryId = false; result.factoryId_ = 0; return this; } - public bool HasRequestId { - get { return result.HasRequestId; } + public bool HasQueued { + get { return result.hasQueued; } } - public ulong RequestId { - get { return result.RequestId; } - set { SetRequestId(value); } + public bool Queued { + get { return result.Queued; } + set { SetQueued(value); } } - public Builder SetRequestId(ulong value) { - result.hasRequestId = true; - result.requestId_ = value; + public Builder SetQueued(bool value) { + PrepareBuilder(); + result.hasQueued = true; + result.queued_ = value; return this; } - public Builder ClearRequestId() { - result.hasRequestId = false; - result.requestId_ = 0UL; + public Builder ClearQueued() { + PrepareBuilder(); + result.hasQueued = false; + result.queued_ = false; return this; } } - static CancelFindGameRequest() { - object.ReferenceEquals(global::bnet.protocol.game_master.Proto.GameMaster.Descriptor, null); + static FindGameResponse() { + object.ReferenceEquals(global::bnet.protocol.game_master.GameMasterService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class GameEndedNotification : pb::GeneratedMessage { - private static readonly GameEndedNotification defaultInstance = new Builder().BuildPartial(); + private GameEndedNotification() { } + private static readonly GameEndedNotification defaultInstance = new GameEndedNotification().MakeReadOnly(); + private static readonly string[] _gameEndedNotificationFieldNames = new string[] { "game_handle", "reason" }; + private static readonly uint[] _gameEndedNotificationFieldTags = new uint[] { 10, 16 }; public static GameEndedNotification DefaultInstance { get { return defaultInstance; } } public override GameEndedNotification DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override GameEndedNotification ThisMessage { @@ -2501,21 +2671,31 @@ protected override GameEndedNotification ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_GameEndedNotification__Descriptor; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_GameEndedNotification__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_GameEndedNotification__FieldAccessorTable; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_GameEndedNotification__FieldAccessorTable; } } public const int GameHandleFieldNumber = 1; private bool hasGameHandle; - private global::bnet.protocol.game_master.GameHandle gameHandle_ = global::bnet.protocol.game_master.GameHandle.DefaultInstance; + private global::bnet.protocol.game_master.GameHandle gameHandle_; public bool HasGameHandle { get { return hasGameHandle; } } public global::bnet.protocol.game_master.GameHandle GameHandle { - get { return gameHandle_; } + get { return gameHandle_ ?? global::bnet.protocol.game_master.GameHandle.DefaultInstance; } + } + + public const int ReasonFieldNumber = 2; + private bool hasReason; + private uint reason_; + public bool HasReason { + get { return hasReason; } + } + public uint Reason { + get { return reason_; } } public override bool IsInitialized { @@ -2526,10 +2706,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasGameHandle) { - output.WriteMessage(1, GameHandle); + string[] field_names = _gameEndedNotificationFieldNames; + if (hasGameHandle) { + output.WriteMessage(1, field_names[0], GameHandle); + } + if (hasReason) { + output.WriteUInt32(2, field_names[1], Reason); } UnknownFields.WriteTo(output); } @@ -2541,9 +2725,12 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasGameHandle) { + if (hasGameHandle) { size += pb::CodedOutputStream.ComputeMessageSize(1, GameHandle); } + if (hasReason) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, Reason); + } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; return size; @@ -2574,38 +2761,72 @@ public static GameEndedNotification ParseDelimitedFrom(global::System.IO.Stream public static GameEndedNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static GameEndedNotification ParseFrom(pb::CodedInputStream input) { + public static GameEndedNotification ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static GameEndedNotification ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static GameEndedNotification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private GameEndedNotification MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(GameEndedNotification prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GameEndedNotification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GameEndedNotification result; + + private GameEndedNotification PrepareBuilder() { + if (resultIsReadOnly) { + GameEndedNotification original = result; + result = new GameEndedNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - GameEndedNotification result = new GameEndedNotification(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override GameEndedNotification MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new GameEndedNotification(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -2617,12 +2838,11 @@ public override GameEndedNotification DefaultInstanceForType { } public override GameEndedNotification BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - GameEndedNotification returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2636,27 +2856,42 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(GameEndedNotification other) { if (other == global::bnet.protocol.game_master.GameEndedNotification.DefaultInstance) return this; + PrepareBuilder(); if (other.HasGameHandle) { MergeGameHandle(other.GameHandle); } + if (other.HasReason) { + Reason = other.Reason; + } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_gameEndedNotificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _gameEndedNotificationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -2668,25 +2903,34 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.game_master.GameHandle.Builder subBuilder = global::bnet.protocol.game_master.GameHandle.CreateBuilder(); - if (HasGameHandle) { + if (result.hasGameHandle) { subBuilder.MergeFrom(GameHandle); } input.ReadMessage(subBuilder, extensionRegistry); GameHandle = subBuilder.BuildPartial(); break; } + case 16: { + result.hasReason = input.ReadUInt32(ref result.reason_); + break; + } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasGameHandle { - get { return result.HasGameHandle; } + get { return result.hasGameHandle; } } public global::bnet.protocol.game_master.GameHandle GameHandle { get { return result.GameHandle; } @@ -2694,19 +2938,22 @@ public bool HasGameHandle { } public Builder SetGameHandle(global::bnet.protocol.game_master.GameHandle value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasGameHandle = true; result.gameHandle_ = value; return this; } public Builder SetGameHandle(global::bnet.protocol.game_master.GameHandle.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasGameHandle = true; result.gameHandle_ = builderForValue.Build(); return this; } public Builder MergeGameHandle(global::bnet.protocol.game_master.GameHandle value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasGameHandle && + PrepareBuilder(); + if (result.hasGameHandle && result.gameHandle_ != global::bnet.protocol.game_master.GameHandle.DefaultInstance) { result.gameHandle_ = global::bnet.protocol.game_master.GameHandle.CreateBuilder(result.gameHandle_).MergeFrom(value).BuildPartial(); } else { @@ -2716,24 +2963,51 @@ public Builder MergeGameHandle(global::bnet.protocol.game_master.GameHandle valu return this; } public Builder ClearGameHandle() { + PrepareBuilder(); result.hasGameHandle = false; - result.gameHandle_ = global::bnet.protocol.game_master.GameHandle.DefaultInstance; + result.gameHandle_ = null; + return this; + } + + public bool HasReason { + get { return result.hasReason; } + } + public uint Reason { + get { return result.Reason; } + set { SetReason(value); } + } + public Builder SetReason(uint value) { + PrepareBuilder(); + result.hasReason = true; + result.reason_ = value; + return this; + } + public Builder ClearReason() { + PrepareBuilder(); + result.hasReason = false; + result.reason_ = 0; return this; } } static GameEndedNotification() { - object.ReferenceEquals(global::bnet.protocol.game_master.Proto.GameMaster.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.game_master.GameMasterService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class PlayerLeftNotification : pb::GeneratedMessage { - private static readonly PlayerLeftNotification defaultInstance = new Builder().BuildPartial(); + private PlayerLeftNotification() { } + private static readonly PlayerLeftNotification defaultInstance = new PlayerLeftNotification().MakeReadOnly(); + private static readonly string[] _playerLeftNotificationFieldNames = new string[] { "game_handle", "member_id", "reason" }; + private static readonly uint[] _playerLeftNotificationFieldTags = new uint[] { 10, 18, 24 }; public static PlayerLeftNotification DefaultInstance { get { return defaultInstance; } } public override PlayerLeftNotification DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override PlayerLeftNotification ThisMessage { @@ -2741,36 +3015,36 @@ protected override PlayerLeftNotification ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_PlayerLeftNotification__Descriptor; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_PlayerLeftNotification__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_PlayerLeftNotification__FieldAccessorTable; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_PlayerLeftNotification__FieldAccessorTable; } } public const int GameHandleFieldNumber = 1; private bool hasGameHandle; - private global::bnet.protocol.game_master.GameHandle gameHandle_ = global::bnet.protocol.game_master.GameHandle.DefaultInstance; + private global::bnet.protocol.game_master.GameHandle gameHandle_; public bool HasGameHandle { get { return hasGameHandle; } } public global::bnet.protocol.game_master.GameHandle GameHandle { - get { return gameHandle_; } + get { return gameHandle_ ?? global::bnet.protocol.game_master.GameHandle.DefaultInstance; } } - public const int ToonIdFieldNumber = 2; - private bool hasToonId; - private global::bnet.protocol.EntityId toonId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasToonId { - get { return hasToonId; } + public const int MemberIdFieldNumber = 2; + private bool hasMemberId; + private global::bnet.protocol.EntityId memberId_; + public bool HasMemberId { + get { return hasMemberId; } } - public global::bnet.protocol.EntityId ToonId { - get { return toonId_; } + public global::bnet.protocol.EntityId MemberId { + get { return memberId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int ReasonFieldNumber = 3; private bool hasReason; - private uint reason_ = 0; + private uint reason_ = 1; public bool HasReason { get { return hasReason; } } @@ -2781,23 +3055,24 @@ public uint Reason { public override bool IsInitialized { get { if (!hasGameHandle) return false; - if (!hasToonId) return false; + if (!hasMemberId) return false; if (!GameHandle.IsInitialized) return false; - if (!ToonId.IsInitialized) return false; + if (!MemberId.IsInitialized) return false; return true; } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasGameHandle) { - output.WriteMessage(1, GameHandle); + string[] field_names = _playerLeftNotificationFieldNames; + if (hasGameHandle) { + output.WriteMessage(1, field_names[0], GameHandle); } - if (HasToonId) { - output.WriteMessage(2, ToonId); + if (hasMemberId) { + output.WriteMessage(2, field_names[1], MemberId); } - if (HasReason) { - output.WriteUInt32(3, Reason); + if (hasReason) { + output.WriteUInt32(3, field_names[2], Reason); } UnknownFields.WriteTo(output); } @@ -2809,13 +3084,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasGameHandle) { + if (hasGameHandle) { size += pb::CodedOutputStream.ComputeMessageSize(1, GameHandle); } - if (HasToonId) { - size += pb::CodedOutputStream.ComputeMessageSize(2, ToonId); + if (hasMemberId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, MemberId); } - if (HasReason) { + if (hasReason) { size += pb::CodedOutputStream.ComputeUInt32Size(3, Reason); } size += UnknownFields.SerializedSize; @@ -2848,38 +3123,72 @@ public static PlayerLeftNotification ParseDelimitedFrom(global::System.IO.Stream public static PlayerLeftNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static PlayerLeftNotification ParseFrom(pb::CodedInputStream input) { + public static PlayerLeftNotification ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static PlayerLeftNotification ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static PlayerLeftNotification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private PlayerLeftNotification MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(PlayerLeftNotification prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(PlayerLeftNotification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - PlayerLeftNotification result = new PlayerLeftNotification(); + private bool resultIsReadOnly; + private PlayerLeftNotification result; + + private PlayerLeftNotification PrepareBuilder() { + if (resultIsReadOnly) { + PlayerLeftNotification original = result; + result = new PlayerLeftNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override PlayerLeftNotification MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new PlayerLeftNotification(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -2891,12 +3200,11 @@ public override PlayerLeftNotification DefaultInstanceForType { } public override PlayerLeftNotification BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - PlayerLeftNotification returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2910,11 +3218,12 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(PlayerLeftNotification other) { if (other == global::bnet.protocol.game_master.PlayerLeftNotification.DefaultInstance) return this; + PrepareBuilder(); if (other.HasGameHandle) { MergeGameHandle(other.GameHandle); } - if (other.HasToonId) { - MergeToonId(other.ToonId); + if (other.HasMemberId) { + MergeMemberId(other.MemberId); } if (other.HasReason) { Reason = other.Reason; @@ -2923,20 +3232,31 @@ public override Builder MergeFrom(PlayerLeftNotification other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_playerLeftNotificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _playerLeftNotificationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -2948,12 +3268,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.game_master.GameHandle.Builder subBuilder = global::bnet.protocol.game_master.GameHandle.CreateBuilder(); - if (HasGameHandle) { + if (result.hasGameHandle) { subBuilder.MergeFrom(GameHandle); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2962,24 +3282,29 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasToonId) { - subBuilder.MergeFrom(ToonId); + if (result.hasMemberId) { + subBuilder.MergeFrom(MemberId); } input.ReadMessage(subBuilder, extensionRegistry); - ToonId = subBuilder.BuildPartial(); + MemberId = subBuilder.BuildPartial(); break; } case 24: { - Reason = input.ReadUInt32(); + result.hasReason = input.ReadUInt32(ref result.reason_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasGameHandle { - get { return result.HasGameHandle; } + get { return result.hasGameHandle; } } public global::bnet.protocol.game_master.GameHandle GameHandle { get { return result.GameHandle; } @@ -2987,19 +3312,22 @@ public bool HasGameHandle { } public Builder SetGameHandle(global::bnet.protocol.game_master.GameHandle value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasGameHandle = true; result.gameHandle_ = value; return this; } public Builder SetGameHandle(global::bnet.protocol.game_master.GameHandle.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasGameHandle = true; result.gameHandle_ = builderForValue.Build(); return this; } public Builder MergeGameHandle(global::bnet.protocol.game_master.GameHandle value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasGameHandle && + PrepareBuilder(); + if (result.hasGameHandle && result.gameHandle_ != global::bnet.protocol.game_master.GameHandle.DefaultInstance) { result.gameHandle_ = global::bnet.protocol.game_master.GameHandle.CreateBuilder(result.gameHandle_).MergeFrom(value).BuildPartial(); } else { @@ -3009,78 +3337,91 @@ public Builder MergeGameHandle(global::bnet.protocol.game_master.GameHandle valu return this; } public Builder ClearGameHandle() { + PrepareBuilder(); result.hasGameHandle = false; - result.gameHandle_ = global::bnet.protocol.game_master.GameHandle.DefaultInstance; + result.gameHandle_ = null; return this; } - public bool HasToonId { - get { return result.HasToonId; } + public bool HasMemberId { + get { return result.hasMemberId; } } - public global::bnet.protocol.EntityId ToonId { - get { return result.ToonId; } - set { SetToonId(value); } + public global::bnet.protocol.EntityId MemberId { + get { return result.MemberId; } + set { SetMemberId(value); } } - public Builder SetToonId(global::bnet.protocol.EntityId value) { + public Builder SetMemberId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasToonId = true; - result.toonId_ = value; + PrepareBuilder(); + result.hasMemberId = true; + result.memberId_ = value; return this; } - public Builder SetToonId(global::bnet.protocol.EntityId.Builder builderForValue) { + public Builder SetMemberId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasToonId = true; - result.toonId_ = builderForValue.Build(); + PrepareBuilder(); + result.hasMemberId = true; + result.memberId_ = builderForValue.Build(); return this; } - public Builder MergeToonId(global::bnet.protocol.EntityId value) { + public Builder MergeMemberId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasToonId && - result.toonId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.toonId_ = global::bnet.protocol.EntityId.CreateBuilder(result.toonId_).MergeFrom(value).BuildPartial(); + PrepareBuilder(); + if (result.hasMemberId && + result.memberId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.memberId_ = global::bnet.protocol.EntityId.CreateBuilder(result.memberId_).MergeFrom(value).BuildPartial(); } else { - result.toonId_ = value; + result.memberId_ = value; } - result.hasToonId = true; + result.hasMemberId = true; return this; } - public Builder ClearToonId() { - result.hasToonId = false; - result.toonId_ = global::bnet.protocol.EntityId.DefaultInstance; + public Builder ClearMemberId() { + PrepareBuilder(); + result.hasMemberId = false; + result.memberId_ = null; return this; } public bool HasReason { - get { return result.HasReason; } + get { return result.hasReason; } } public uint Reason { get { return result.Reason; } set { SetReason(value); } } public Builder SetReason(uint value) { + PrepareBuilder(); result.hasReason = true; result.reason_ = value; return this; } public Builder ClearReason() { + PrepareBuilder(); result.hasReason = false; - result.reason_ = 0; + result.reason_ = 1; return this; } } static PlayerLeftNotification() { - object.ReferenceEquals(global::bnet.protocol.game_master.Proto.GameMaster.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.game_master.GameMasterService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class RegisterServerRequest : pb::GeneratedMessage { - private static readonly RegisterServerRequest defaultInstance = new Builder().BuildPartial(); + private RegisterServerRequest() { } + private static readonly RegisterServerRequest defaultInstance = new RegisterServerRequest().MakeReadOnly(); + private static readonly string[] _registerServerRequestFieldNames = new string[] { "attribute", "program_id", "state" }; + private static readonly uint[] _registerServerRequestFieldTags = new uint[] { 10, 29, 18 }; public static RegisterServerRequest DefaultInstance { get { return defaultInstance; } } public override RegisterServerRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override RegisterServerRequest ThisMessage { @@ -3088,11 +3429,11 @@ protected override RegisterServerRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_RegisterServerRequest__Descriptor; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_RegisterServerRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_RegisterServerRequest__FieldAccessorTable; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_RegisterServerRequest__FieldAccessorTable; } } public const int AttributeFieldNumber = 1; @@ -3109,17 +3450,17 @@ public int AttributeCount { public const int StateFieldNumber = 2; private bool hasState; - private global::bnet.protocol.server_pool.ServerState state_ = global::bnet.protocol.server_pool.ServerState.DefaultInstance; + private global::bnet.protocol.server_pool.ServerState state_; public bool HasState { get { return hasState; } } public global::bnet.protocol.server_pool.ServerState State { - get { return state_; } + get { return state_ ?? global::bnet.protocol.server_pool.ServerState.DefaultInstance; } } public const int ProgramIdFieldNumber = 3; private bool hasProgramId; - private uint programId_ = 0; + private uint programId_; public bool HasProgramId { get { return hasProgramId; } } @@ -3137,16 +3478,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - output.WriteMessage(1, element); + string[] field_names = _registerServerRequestFieldNames; + if (attribute_.Count > 0) { + output.WriteMessageArray(1, field_names[0], attribute_); } - if (HasState) { - output.WriteMessage(2, State); + if (hasState) { + output.WriteMessage(2, field_names[2], State); } - if (HasProgramId) { - output.WriteFixed32(3, ProgramId); + if (hasProgramId) { + output.WriteFixed32(3, field_names[1], ProgramId); } UnknownFields.WriteTo(output); } @@ -3161,10 +3503,10 @@ public override int SerializedSize { foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { size += pb::CodedOutputStream.ComputeMessageSize(1, element); } - if (HasState) { + if (hasState) { size += pb::CodedOutputStream.ComputeMessageSize(2, State); } - if (HasProgramId) { + if (hasProgramId) { size += pb::CodedOutputStream.ComputeFixed32Size(3, ProgramId); } size += UnknownFields.SerializedSize; @@ -3197,38 +3539,73 @@ public static RegisterServerRequest ParseDelimitedFrom(global::System.IO.Stream public static RegisterServerRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static RegisterServerRequest ParseFrom(pb::CodedInputStream input) { + public static RegisterServerRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static RegisterServerRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static RegisterServerRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private RegisterServerRequest MakeReadOnly() { + attribute_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(RegisterServerRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(RegisterServerRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private RegisterServerRequest result; + + private RegisterServerRequest PrepareBuilder() { + if (resultIsReadOnly) { + RegisterServerRequest original = result; + result = new RegisterServerRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - RegisterServerRequest result = new RegisterServerRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override RegisterServerRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new RegisterServerRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -3240,13 +3617,11 @@ public override RegisterServerRequest DefaultInstanceForType { } public override RegisterServerRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.attribute_.MakeReadOnly(); - RegisterServerRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -3260,8 +3635,9 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(RegisterServerRequest other) { if (other == global::bnet.protocol.game_master.RegisterServerRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.attribute_.Count != 0) { - base.AddRange(other.attribute_, result.attribute_); + result.attribute_.Add(other.attribute_); } if (other.HasState) { MergeState(other.State); @@ -3273,20 +3649,31 @@ public override Builder MergeFrom(RegisterServerRequest other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_registerServerRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _registerServerRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -3298,18 +3685,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { - global::bnet.protocol.attribute.Attribute.Builder subBuilder = global::bnet.protocol.attribute.Attribute.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddAttribute(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.attribute_, global::bnet.protocol.attribute.Attribute.DefaultInstance, extensionRegistry); break; } case 18: { global::bnet.protocol.server_pool.ServerState.Builder subBuilder = global::bnet.protocol.server_pool.ServerState.CreateBuilder(); - if (HasState) { + if (result.hasState) { subBuilder.MergeFrom(State); } input.ReadMessage(subBuilder, extensionRegistry); @@ -3317,16 +3702,21 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 29: { - ProgramId = input.ReadFixed32(); + result.hasProgramId = input.ReadFixed32(ref result.programId_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public pbc::IPopsicleList AttributeList { - get { return result.attribute_; } + get { return PrepareBuilder().attribute_; } } public int AttributeCount { get { return result.AttributeCount; } @@ -3336,35 +3726,41 @@ public int AttributeCount { } public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.attribute_[index] = value; return this; } public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.attribute_[index] = builderForValue.Build(); return this; } public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.attribute_.Add(value); return this; } public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.attribute_.Add(builderForValue.Build()); return this; } public Builder AddRangeAttribute(scg::IEnumerable values) { - base.AddRange(values, result.attribute_); + PrepareBuilder(); + result.attribute_.Add(values); return this; } public Builder ClearAttribute() { + PrepareBuilder(); result.attribute_.Clear(); return this; } public bool HasState { - get { return result.HasState; } + get { return result.hasState; } } public global::bnet.protocol.server_pool.ServerState State { get { return result.State; } @@ -3372,19 +3768,22 @@ public bool HasState { } public Builder SetState(global::bnet.protocol.server_pool.ServerState value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasState = true; result.state_ = value; return this; } public Builder SetState(global::bnet.protocol.server_pool.ServerState.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasState = true; result.state_ = builderForValue.Build(); return this; } public Builder MergeState(global::bnet.protocol.server_pool.ServerState value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasState && + PrepareBuilder(); + if (result.hasState && result.state_ != global::bnet.protocol.server_pool.ServerState.DefaultInstance) { result.state_ = global::bnet.protocol.server_pool.ServerState.CreateBuilder(result.state_).MergeFrom(value).BuildPartial(); } else { @@ -3394,42 +3793,51 @@ public Builder MergeState(global::bnet.protocol.server_pool.ServerState value) { return this; } public Builder ClearState() { + PrepareBuilder(); result.hasState = false; - result.state_ = global::bnet.protocol.server_pool.ServerState.DefaultInstance; + result.state_ = null; return this; } public bool HasProgramId { - get { return result.HasProgramId; } + get { return result.hasProgramId; } } public uint ProgramId { get { return result.ProgramId; } set { SetProgramId(value); } } public Builder SetProgramId(uint value) { + PrepareBuilder(); result.hasProgramId = true; result.programId_ = value; return this; } public Builder ClearProgramId() { + PrepareBuilder(); result.hasProgramId = false; result.programId_ = 0; return this; } } static RegisterServerRequest() { - object.ReferenceEquals(global::bnet.protocol.game_master.Proto.GameMaster.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.game_master.GameMasterService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class UnregisterServerRequest : pb::GeneratedMessage { - private static readonly UnregisterServerRequest defaultInstance = new Builder().BuildPartial(); + private UnregisterServerRequest() { } + private static readonly UnregisterServerRequest defaultInstance = new UnregisterServerRequest().MakeReadOnly(); + private static readonly string[] _unregisterServerRequestFieldNames = new string[] { }; + private static readonly uint[] _unregisterServerRequestFieldTags = new uint[] { }; public static UnregisterServerRequest DefaultInstance { get { return defaultInstance; } } public override UnregisterServerRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override UnregisterServerRequest ThisMessage { @@ -3437,11 +3845,11 @@ protected override UnregisterServerRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_UnregisterServerRequest__Descriptor; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_UnregisterServerRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_UnregisterServerRequest__FieldAccessorTable; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_UnregisterServerRequest__FieldAccessorTable; } } public override bool IsInitialized { @@ -3450,8 +3858,9 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; + string[] field_names = _unregisterServerRequestFieldNames; UnknownFields.WriteTo(output); } @@ -3492,38 +3901,72 @@ public static UnregisterServerRequest ParseDelimitedFrom(global::System.IO.Strea public static UnregisterServerRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static UnregisterServerRequest ParseFrom(pb::CodedInputStream input) { + public static UnregisterServerRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static UnregisterServerRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static UnregisterServerRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private UnregisterServerRequest MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(UnregisterServerRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(UnregisterServerRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private UnregisterServerRequest result; + + private UnregisterServerRequest PrepareBuilder() { + if (resultIsReadOnly) { + UnregisterServerRequest original = result; + result = new UnregisterServerRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - UnregisterServerRequest result = new UnregisterServerRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override UnregisterServerRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new UnregisterServerRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -3535,12 +3978,11 @@ public override UnregisterServerRequest DefaultInstanceForType { } public override UnregisterServerRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - UnregisterServerRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -3554,24 +3996,36 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(UnregisterServerRequest other) { if (other == global::bnet.protocol.game_master.UnregisterServerRequest.DefaultInstance) return this; + PrepareBuilder(); this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_unregisterServerRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _unregisterServerRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -3583,27 +4037,38 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } } static UnregisterServerRequest() { - object.ReferenceEquals(global::bnet.protocol.game_master.Proto.GameMaster.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.game_master.GameMasterService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class RegisterUtilitiesRequest : pb::GeneratedMessage { - private static readonly RegisterUtilitiesRequest defaultInstance = new Builder().BuildPartial(); + private RegisterUtilitiesRequest() { } + private static readonly RegisterUtilitiesRequest defaultInstance = new RegisterUtilitiesRequest().MakeReadOnly(); + private static readonly string[] _registerUtilitiesRequestFieldNames = new string[] { "attribute", "program_id", "state" }; + private static readonly uint[] _registerUtilitiesRequestFieldTags = new uint[] { 10, 29, 18 }; public static RegisterUtilitiesRequest DefaultInstance { get { return defaultInstance; } } public override RegisterUtilitiesRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override RegisterUtilitiesRequest ThisMessage { @@ -3611,11 +4076,11 @@ protected override RegisterUtilitiesRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_RegisterUtilitiesRequest__Descriptor; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_RegisterUtilitiesRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_RegisterUtilitiesRequest__FieldAccessorTable; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_RegisterUtilitiesRequest__FieldAccessorTable; } } public const int AttributeFieldNumber = 1; @@ -3632,17 +4097,17 @@ public int AttributeCount { public const int StateFieldNumber = 2; private bool hasState; - private global::bnet.protocol.server_pool.ServerState state_ = global::bnet.protocol.server_pool.ServerState.DefaultInstance; + private global::bnet.protocol.server_pool.ServerState state_; public bool HasState { get { return hasState; } } public global::bnet.protocol.server_pool.ServerState State { - get { return state_; } + get { return state_ ?? global::bnet.protocol.server_pool.ServerState.DefaultInstance; } } public const int ProgramIdFieldNumber = 3; private bool hasProgramId; - private uint programId_ = 0; + private uint programId_; public bool HasProgramId { get { return hasProgramId; } } @@ -3660,16 +4125,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - output.WriteMessage(1, element); + string[] field_names = _registerUtilitiesRequestFieldNames; + if (attribute_.Count > 0) { + output.WriteMessageArray(1, field_names[0], attribute_); } - if (HasState) { - output.WriteMessage(2, State); + if (hasState) { + output.WriteMessage(2, field_names[2], State); } - if (HasProgramId) { - output.WriteFixed32(3, ProgramId); + if (hasProgramId) { + output.WriteFixed32(3, field_names[1], ProgramId); } UnknownFields.WriteTo(output); } @@ -3684,10 +4150,10 @@ public override int SerializedSize { foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { size += pb::CodedOutputStream.ComputeMessageSize(1, element); } - if (HasState) { + if (hasState) { size += pb::CodedOutputStream.ComputeMessageSize(2, State); } - if (HasProgramId) { + if (hasProgramId) { size += pb::CodedOutputStream.ComputeFixed32Size(3, ProgramId); } size += UnknownFields.SerializedSize; @@ -3720,38 +4186,73 @@ public static RegisterUtilitiesRequest ParseDelimitedFrom(global::System.IO.Stre public static RegisterUtilitiesRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static RegisterUtilitiesRequest ParseFrom(pb::CodedInputStream input) { + public static RegisterUtilitiesRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static RegisterUtilitiesRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static RegisterUtilitiesRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private RegisterUtilitiesRequest MakeReadOnly() { + attribute_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(RegisterUtilitiesRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(RegisterUtilitiesRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private RegisterUtilitiesRequest result; + + private RegisterUtilitiesRequest PrepareBuilder() { + if (resultIsReadOnly) { + RegisterUtilitiesRequest original = result; + result = new RegisterUtilitiesRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - RegisterUtilitiesRequest result = new RegisterUtilitiesRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override RegisterUtilitiesRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new RegisterUtilitiesRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -3763,13 +4264,11 @@ public override RegisterUtilitiesRequest DefaultInstanceForType { } public override RegisterUtilitiesRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.attribute_.MakeReadOnly(); - RegisterUtilitiesRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -3783,8 +4282,9 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(RegisterUtilitiesRequest other) { if (other == global::bnet.protocol.game_master.RegisterUtilitiesRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.attribute_.Count != 0) { - base.AddRange(other.attribute_, result.attribute_); + result.attribute_.Add(other.attribute_); } if (other.HasState) { MergeState(other.State); @@ -3796,20 +4296,31 @@ public override Builder MergeFrom(RegisterUtilitiesRequest other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_registerUtilitiesRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _registerUtilitiesRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -3821,18 +4332,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { - global::bnet.protocol.attribute.Attribute.Builder subBuilder = global::bnet.protocol.attribute.Attribute.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddAttribute(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.attribute_, global::bnet.protocol.attribute.Attribute.DefaultInstance, extensionRegistry); break; } case 18: { global::bnet.protocol.server_pool.ServerState.Builder subBuilder = global::bnet.protocol.server_pool.ServerState.CreateBuilder(); - if (HasState) { + if (result.hasState) { subBuilder.MergeFrom(State); } input.ReadMessage(subBuilder, extensionRegistry); @@ -3840,16 +4349,21 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 29: { - ProgramId = input.ReadFixed32(); + result.hasProgramId = input.ReadFixed32(ref result.programId_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public pbc::IPopsicleList AttributeList { - get { return result.attribute_; } + get { return PrepareBuilder().attribute_; } } public int AttributeCount { get { return result.AttributeCount; } @@ -3859,35 +4373,41 @@ public int AttributeCount { } public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.attribute_[index] = value; return this; } public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.attribute_[index] = builderForValue.Build(); return this; } public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.attribute_.Add(value); return this; } public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.attribute_.Add(builderForValue.Build()); return this; } public Builder AddRangeAttribute(scg::IEnumerable values) { - base.AddRange(values, result.attribute_); + PrepareBuilder(); + result.attribute_.Add(values); return this; } public Builder ClearAttribute() { + PrepareBuilder(); result.attribute_.Clear(); return this; } public bool HasState { - get { return result.HasState; } + get { return result.hasState; } } public global::bnet.protocol.server_pool.ServerState State { get { return result.State; } @@ -3895,19 +4415,22 @@ public bool HasState { } public Builder SetState(global::bnet.protocol.server_pool.ServerState value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasState = true; result.state_ = value; return this; } public Builder SetState(global::bnet.protocol.server_pool.ServerState.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasState = true; result.state_ = builderForValue.Build(); return this; } public Builder MergeState(global::bnet.protocol.server_pool.ServerState value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasState && + PrepareBuilder(); + if (result.hasState && result.state_ != global::bnet.protocol.server_pool.ServerState.DefaultInstance) { result.state_ = global::bnet.protocol.server_pool.ServerState.CreateBuilder(result.state_).MergeFrom(value).BuildPartial(); } else { @@ -3917,42 +4440,51 @@ public Builder MergeState(global::bnet.protocol.server_pool.ServerState value) { return this; } public Builder ClearState() { + PrepareBuilder(); result.hasState = false; - result.state_ = global::bnet.protocol.server_pool.ServerState.DefaultInstance; + result.state_ = null; return this; } public bool HasProgramId { - get { return result.HasProgramId; } + get { return result.hasProgramId; } } public uint ProgramId { get { return result.ProgramId; } set { SetProgramId(value); } } public Builder SetProgramId(uint value) { + PrepareBuilder(); result.hasProgramId = true; result.programId_ = value; return this; } public Builder ClearProgramId() { + PrepareBuilder(); result.hasProgramId = false; result.programId_ = 0; return this; } } static RegisterUtilitiesRequest() { - object.ReferenceEquals(global::bnet.protocol.game_master.Proto.GameMaster.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.game_master.GameMasterService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class UnregisterUtilitiesRequest : pb::GeneratedMessage { - private static readonly UnregisterUtilitiesRequest defaultInstance = new Builder().BuildPartial(); + private UnregisterUtilitiesRequest() { } + private static readonly UnregisterUtilitiesRequest defaultInstance = new UnregisterUtilitiesRequest().MakeReadOnly(); + private static readonly string[] _unregisterUtilitiesRequestFieldNames = new string[] { }; + private static readonly uint[] _unregisterUtilitiesRequestFieldTags = new uint[] { }; public static UnregisterUtilitiesRequest DefaultInstance { get { return defaultInstance; } } public override UnregisterUtilitiesRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override UnregisterUtilitiesRequest ThisMessage { @@ -3960,11 +4492,11 @@ protected override UnregisterUtilitiesRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_UnregisterUtilitiesRequest__Descriptor; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_UnregisterUtilitiesRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_UnregisterUtilitiesRequest__FieldAccessorTable; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_UnregisterUtilitiesRequest__FieldAccessorTable; } } public override bool IsInitialized { @@ -3973,8 +4505,9 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; + string[] field_names = _unregisterUtilitiesRequestFieldNames; UnknownFields.WriteTo(output); } @@ -4015,38 +4548,72 @@ public static UnregisterUtilitiesRequest ParseDelimitedFrom(global::System.IO.St public static UnregisterUtilitiesRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static UnregisterUtilitiesRequest ParseFrom(pb::CodedInputStream input) { + public static UnregisterUtilitiesRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static UnregisterUtilitiesRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static UnregisterUtilitiesRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private UnregisterUtilitiesRequest MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(UnregisterUtilitiesRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(UnregisterUtilitiesRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private UnregisterUtilitiesRequest result; + + private UnregisterUtilitiesRequest PrepareBuilder() { + if (resultIsReadOnly) { + UnregisterUtilitiesRequest original = result; + result = new UnregisterUtilitiesRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - UnregisterUtilitiesRequest result = new UnregisterUtilitiesRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override UnregisterUtilitiesRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new UnregisterUtilitiesRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -4058,12 +4625,11 @@ public override UnregisterUtilitiesRequest DefaultInstanceForType { } public override UnregisterUtilitiesRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - UnregisterUtilitiesRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -4077,24 +4643,36 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(UnregisterUtilitiesRequest other) { if (other == global::bnet.protocol.game_master.UnregisterUtilitiesRequest.DefaultInstance) return this; + PrepareBuilder(); this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_unregisterUtilitiesRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _unregisterUtilitiesRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -4106,27 +4684,38 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } } static UnregisterUtilitiesRequest() { - object.ReferenceEquals(global::bnet.protocol.game_master.Proto.GameMaster.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.game_master.GameMasterService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class SubscribeRequest : pb::GeneratedMessage { - private static readonly SubscribeRequest defaultInstance = new Builder().BuildPartial(); + private SubscribeRequest() { } + private static readonly SubscribeRequest defaultInstance = new SubscribeRequest().MakeReadOnly(); + private static readonly string[] _subscribeRequestFieldNames = new string[] { "object_id" }; + private static readonly uint[] _subscribeRequestFieldTags = new uint[] { 8 }; public static SubscribeRequest DefaultInstance { get { return defaultInstance; } } public override SubscribeRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override SubscribeRequest ThisMessage { @@ -4134,16 +4723,16 @@ protected override SubscribeRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_SubscribeRequest__Descriptor; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_SubscribeRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_SubscribeRequest__FieldAccessorTable; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_SubscribeRequest__FieldAccessorTable; } } public const int ObjectIdFieldNumber = 1; private bool hasObjectId; - private ulong objectId_ = 0UL; + private ulong objectId_; public bool HasObjectId { get { return hasObjectId; } } @@ -4158,10 +4747,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasObjectId) { - output.WriteUInt64(1, ObjectId); + string[] field_names = _subscribeRequestFieldNames; + if (hasObjectId) { + output.WriteUInt64(1, field_names[0], ObjectId); } UnknownFields.WriteTo(output); } @@ -4173,7 +4763,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasObjectId) { + if (hasObjectId) { size += pb::CodedOutputStream.ComputeUInt64Size(1, ObjectId); } size += UnknownFields.SerializedSize; @@ -4206,38 +4796,72 @@ public static SubscribeRequest ParseDelimitedFrom(global::System.IO.Stream input public static SubscribeRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static SubscribeRequest ParseFrom(pb::CodedInputStream input) { + public static SubscribeRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SubscribeRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static SubscribeRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private SubscribeRequest MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(SubscribeRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SubscribeRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - SubscribeRequest result = new SubscribeRequest(); + private bool resultIsReadOnly; + private SubscribeRequest result; + + private SubscribeRequest PrepareBuilder() { + if (resultIsReadOnly) { + SubscribeRequest original = result; + result = new SubscribeRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override SubscribeRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SubscribeRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -4249,12 +4873,11 @@ public override SubscribeRequest DefaultInstanceForType { } public override SubscribeRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - SubscribeRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -4268,6 +4891,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SubscribeRequest other) { if (other == global::bnet.protocol.game_master.SubscribeRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasObjectId) { ObjectId = other.ObjectId; } @@ -4275,20 +4899,31 @@ public override Builder MergeFrom(SubscribeRequest other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_subscribeRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _subscribeRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -4300,49 +4935,62 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 8: { - ObjectId = input.ReadUInt64(); + result.hasObjectId = input.ReadUInt64(ref result.objectId_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasObjectId { - get { return result.HasObjectId; } + get { return result.hasObjectId; } } public ulong ObjectId { get { return result.ObjectId; } set { SetObjectId(value); } } public Builder SetObjectId(ulong value) { + PrepareBuilder(); result.hasObjectId = true; result.objectId_ = value; return this; } public Builder ClearObjectId() { + PrepareBuilder(); result.hasObjectId = false; result.objectId_ = 0UL; return this; } } static SubscribeRequest() { - object.ReferenceEquals(global::bnet.protocol.game_master.Proto.GameMaster.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.game_master.GameMasterService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class SubscribeResponse : pb::GeneratedMessage { - private static readonly SubscribeResponse defaultInstance = new Builder().BuildPartial(); + private SubscribeResponse() { } + private static readonly SubscribeResponse defaultInstance = new SubscribeResponse().MakeReadOnly(); + private static readonly string[] _subscribeResponseFieldNames = new string[] { "subscription_id" }; + private static readonly uint[] _subscribeResponseFieldTags = new uint[] { 8 }; public static SubscribeResponse DefaultInstance { get { return defaultInstance; } } public override SubscribeResponse DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override SubscribeResponse ThisMessage { @@ -4350,16 +4998,16 @@ protected override SubscribeResponse ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_SubscribeResponse__Descriptor; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_SubscribeResponse__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_SubscribeResponse__FieldAccessorTable; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_SubscribeResponse__FieldAccessorTable; } } public const int SubscriptionIdFieldNumber = 1; private bool hasSubscriptionId; - private ulong subscriptionId_ = 0UL; + private ulong subscriptionId_; public bool HasSubscriptionId { get { return hasSubscriptionId; } } @@ -4373,10 +5021,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasSubscriptionId) { - output.WriteUInt64(1, SubscriptionId); + string[] field_names = _subscribeResponseFieldNames; + if (hasSubscriptionId) { + output.WriteUInt64(1, field_names[0], SubscriptionId); } UnknownFields.WriteTo(output); } @@ -4388,7 +5037,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasSubscriptionId) { + if (hasSubscriptionId) { size += pb::CodedOutputStream.ComputeUInt64Size(1, SubscriptionId); } size += UnknownFields.SerializedSize; @@ -4421,38 +5070,72 @@ public static SubscribeResponse ParseDelimitedFrom(global::System.IO.Stream inpu public static SubscribeResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static SubscribeResponse ParseFrom(pb::CodedInputStream input) { + public static SubscribeResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SubscribeResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static SubscribeResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private SubscribeResponse MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(SubscribeResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SubscribeResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SubscribeResponse result; + + private SubscribeResponse PrepareBuilder() { + if (resultIsReadOnly) { + SubscribeResponse original = result; + result = new SubscribeResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - SubscribeResponse result = new SubscribeResponse(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override SubscribeResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SubscribeResponse(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -4464,12 +5147,11 @@ public override SubscribeResponse DefaultInstanceForType { } public override SubscribeResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - SubscribeResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -4483,6 +5165,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SubscribeResponse other) { if (other == global::bnet.protocol.game_master.SubscribeResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.HasSubscriptionId) { SubscriptionId = other.SubscriptionId; } @@ -4490,20 +5173,31 @@ public override Builder MergeFrom(SubscribeResponse other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_subscribeResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _subscribeResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -4515,49 +5209,62 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 8: { - SubscriptionId = input.ReadUInt64(); + result.hasSubscriptionId = input.ReadUInt64(ref result.subscriptionId_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasSubscriptionId { - get { return result.HasSubscriptionId; } + get { return result.hasSubscriptionId; } } public ulong SubscriptionId { get { return result.SubscriptionId; } set { SetSubscriptionId(value); } } public Builder SetSubscriptionId(ulong value) { + PrepareBuilder(); result.hasSubscriptionId = true; result.subscriptionId_ = value; return this; } public Builder ClearSubscriptionId() { + PrepareBuilder(); result.hasSubscriptionId = false; result.subscriptionId_ = 0UL; return this; } } static SubscribeResponse() { - object.ReferenceEquals(global::bnet.protocol.game_master.Proto.GameMaster.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.game_master.GameMasterService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class UnsubscribeRequest : pb::GeneratedMessage { - private static readonly UnsubscribeRequest defaultInstance = new Builder().BuildPartial(); + private UnsubscribeRequest() { } + private static readonly UnsubscribeRequest defaultInstance = new UnsubscribeRequest().MakeReadOnly(); + private static readonly string[] _unsubscribeRequestFieldNames = new string[] { "subscription_id" }; + private static readonly uint[] _unsubscribeRequestFieldTags = new uint[] { 8 }; public static UnsubscribeRequest DefaultInstance { get { return defaultInstance; } } public override UnsubscribeRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override UnsubscribeRequest ThisMessage { @@ -4565,16 +5272,16 @@ protected override UnsubscribeRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_UnsubscribeRequest__Descriptor; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_UnsubscribeRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_UnsubscribeRequest__FieldAccessorTable; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_UnsubscribeRequest__FieldAccessorTable; } } public const int SubscriptionIdFieldNumber = 1; private bool hasSubscriptionId; - private ulong subscriptionId_ = 0UL; + private ulong subscriptionId_; public bool HasSubscriptionId { get { return hasSubscriptionId; } } @@ -4589,10 +5296,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasSubscriptionId) { - output.WriteUInt64(1, SubscriptionId); + string[] field_names = _unsubscribeRequestFieldNames; + if (hasSubscriptionId) { + output.WriteUInt64(1, field_names[0], SubscriptionId); } UnknownFields.WriteTo(output); } @@ -4604,7 +5312,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasSubscriptionId) { + if (hasSubscriptionId) { size += pb::CodedOutputStream.ComputeUInt64Size(1, SubscriptionId); } size += UnknownFields.SerializedSize; @@ -4637,38 +5345,72 @@ public static UnsubscribeRequest ParseDelimitedFrom(global::System.IO.Stream inp public static UnsubscribeRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static UnsubscribeRequest ParseFrom(pb::CodedInputStream input) { + public static UnsubscribeRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static UnsubscribeRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static UnsubscribeRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private UnsubscribeRequest MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(UnsubscribeRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(UnsubscribeRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private UnsubscribeRequest result; + + private UnsubscribeRequest PrepareBuilder() { + if (resultIsReadOnly) { + UnsubscribeRequest original = result; + result = new UnsubscribeRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - UnsubscribeRequest result = new UnsubscribeRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override UnsubscribeRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new UnsubscribeRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -4680,12 +5422,11 @@ public override UnsubscribeRequest DefaultInstanceForType { } public override UnsubscribeRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - UnsubscribeRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -4699,6 +5440,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(UnsubscribeRequest other) { if (other == global::bnet.protocol.game_master.UnsubscribeRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasSubscriptionId) { SubscriptionId = other.SubscriptionId; } @@ -4706,20 +5448,31 @@ public override Builder MergeFrom(UnsubscribeRequest other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_unsubscribeRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _unsubscribeRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -4731,49 +5484,62 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 8: { - SubscriptionId = input.ReadUInt64(); + result.hasSubscriptionId = input.ReadUInt64(ref result.subscriptionId_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasSubscriptionId { - get { return result.HasSubscriptionId; } + get { return result.hasSubscriptionId; } } public ulong SubscriptionId { get { return result.SubscriptionId; } set { SetSubscriptionId(value); } } public Builder SetSubscriptionId(ulong value) { + PrepareBuilder(); result.hasSubscriptionId = true; result.subscriptionId_ = value; return this; } public Builder ClearSubscriptionId() { + PrepareBuilder(); result.hasSubscriptionId = false; result.subscriptionId_ = 0UL; return this; } } static UnsubscribeRequest() { - object.ReferenceEquals(global::bnet.protocol.game_master.Proto.GameMaster.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.game_master.GameMasterService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class ChangeGameRequest : pb::GeneratedMessage { - private static readonly ChangeGameRequest defaultInstance = new Builder().BuildPartial(); + private ChangeGameRequest() { } + private static readonly ChangeGameRequest defaultInstance = new ChangeGameRequest().MakeReadOnly(); + private static readonly string[] _changeGameRequestFieldNames = new string[] { "attribute", "game_handle", "open", "replace" }; + private static readonly uint[] _changeGameRequestFieldTags = new uint[] { 26, 10, 16, 32 }; public static ChangeGameRequest DefaultInstance { get { return defaultInstance; } } public override ChangeGameRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ChangeGameRequest ThisMessage { @@ -4781,26 +5547,26 @@ protected override ChangeGameRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_ChangeGameRequest__Descriptor; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_ChangeGameRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_ChangeGameRequest__FieldAccessorTable; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_ChangeGameRequest__FieldAccessorTable; } } public const int GameHandleFieldNumber = 1; private bool hasGameHandle; - private global::bnet.protocol.game_master.GameHandle gameHandle_ = global::bnet.protocol.game_master.GameHandle.DefaultInstance; + private global::bnet.protocol.game_master.GameHandle gameHandle_; public bool HasGameHandle { get { return hasGameHandle; } } public global::bnet.protocol.game_master.GameHandle GameHandle { - get { return gameHandle_; } + get { return gameHandle_ ?? global::bnet.protocol.game_master.GameHandle.DefaultInstance; } } public const int OpenFieldNumber = 2; private bool hasOpen; - private bool open_ = false; + private bool open_; public bool HasOpen { get { return hasOpen; } } @@ -4822,7 +5588,7 @@ public int AttributeCount { public const int ReplaceFieldNumber = 4; private bool hasReplace; - private bool replace_ = false; + private bool replace_; public bool HasReplace { get { return hasReplace; } } @@ -4841,19 +5607,20 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasGameHandle) { - output.WriteMessage(1, GameHandle); + string[] field_names = _changeGameRequestFieldNames; + if (hasGameHandle) { + output.WriteMessage(1, field_names[1], GameHandle); } - if (HasOpen) { - output.WriteBool(2, Open); + if (hasOpen) { + output.WriteBool(2, field_names[2], Open); } - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - output.WriteMessage(3, element); + if (attribute_.Count > 0) { + output.WriteMessageArray(3, field_names[0], attribute_); } - if (HasReplace) { - output.WriteBool(4, Replace); + if (hasReplace) { + output.WriteBool(4, field_names[3], Replace); } UnknownFields.WriteTo(output); } @@ -4865,16 +5632,16 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasGameHandle) { + if (hasGameHandle) { size += pb::CodedOutputStream.ComputeMessageSize(1, GameHandle); } - if (HasOpen) { + if (hasOpen) { size += pb::CodedOutputStream.ComputeBoolSize(2, Open); } foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { size += pb::CodedOutputStream.ComputeMessageSize(3, element); } - if (HasReplace) { + if (hasReplace) { size += pb::CodedOutputStream.ComputeBoolSize(4, Replace); } size += UnknownFields.SerializedSize; @@ -4907,38 +5674,73 @@ public static ChangeGameRequest ParseDelimitedFrom(global::System.IO.Stream inpu public static ChangeGameRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static ChangeGameRequest ParseFrom(pb::CodedInputStream input) { + public static ChangeGameRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ChangeGameRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static ChangeGameRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private ChangeGameRequest MakeReadOnly() { + attribute_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(ChangeGameRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ChangeGameRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - ChangeGameRequest result = new ChangeGameRequest(); + private bool resultIsReadOnly; + private ChangeGameRequest result; + + private ChangeGameRequest PrepareBuilder() { + if (resultIsReadOnly) { + ChangeGameRequest original = result; + result = new ChangeGameRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override ChangeGameRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ChangeGameRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -4950,13 +5752,11 @@ public override ChangeGameRequest DefaultInstanceForType { } public override ChangeGameRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.attribute_.MakeReadOnly(); - ChangeGameRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -4970,6 +5770,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(ChangeGameRequest other) { if (other == global::bnet.protocol.game_master.ChangeGameRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasGameHandle) { MergeGameHandle(other.GameHandle); } @@ -4977,7 +5778,7 @@ public override Builder MergeFrom(ChangeGameRequest other) { Open = other.Open; } if (other.attribute_.Count != 0) { - base.AddRange(other.attribute_, result.attribute_); + result.attribute_.Add(other.attribute_); } if (other.HasReplace) { Replace = other.Replace; @@ -4986,20 +5787,31 @@ public override Builder MergeFrom(ChangeGameRequest other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_changeGameRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _changeGameRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -5011,12 +5823,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.game_master.GameHandle.Builder subBuilder = global::bnet.protocol.game_master.GameHandle.CreateBuilder(); - if (HasGameHandle) { + if (result.hasGameHandle) { subBuilder.MergeFrom(GameHandle); } input.ReadMessage(subBuilder, extensionRegistry); @@ -5024,26 +5836,29 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 16: { - Open = input.ReadBool(); + result.hasOpen = input.ReadBool(ref result.open_); break; } case 26: { - global::bnet.protocol.attribute.Attribute.Builder subBuilder = global::bnet.protocol.attribute.Attribute.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddAttribute(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.attribute_, global::bnet.protocol.attribute.Attribute.DefaultInstance, extensionRegistry); break; } case 32: { - Replace = input.ReadBool(); + result.hasReplace = input.ReadBool(ref result.replace_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasGameHandle { - get { return result.HasGameHandle; } + get { return result.hasGameHandle; } } public global::bnet.protocol.game_master.GameHandle GameHandle { get { return result.GameHandle; } @@ -5051,19 +5866,22 @@ public bool HasGameHandle { } public Builder SetGameHandle(global::bnet.protocol.game_master.GameHandle value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasGameHandle = true; result.gameHandle_ = value; return this; } public Builder SetGameHandle(global::bnet.protocol.game_master.GameHandle.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasGameHandle = true; result.gameHandle_ = builderForValue.Build(); return this; } public Builder MergeGameHandle(global::bnet.protocol.game_master.GameHandle value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasGameHandle && + PrepareBuilder(); + if (result.hasGameHandle && result.gameHandle_ != global::bnet.protocol.game_master.GameHandle.DefaultInstance) { result.gameHandle_ = global::bnet.protocol.game_master.GameHandle.CreateBuilder(result.gameHandle_).MergeFrom(value).BuildPartial(); } else { @@ -5073,31 +5891,34 @@ public Builder MergeGameHandle(global::bnet.protocol.game_master.GameHandle valu return this; } public Builder ClearGameHandle() { + PrepareBuilder(); result.hasGameHandle = false; - result.gameHandle_ = global::bnet.protocol.game_master.GameHandle.DefaultInstance; + result.gameHandle_ = null; return this; } public bool HasOpen { - get { return result.HasOpen; } + get { return result.hasOpen; } } public bool Open { get { return result.Open; } set { SetOpen(value); } } public Builder SetOpen(bool value) { + PrepareBuilder(); result.hasOpen = true; result.open_ = value; return this; } public Builder ClearOpen() { + PrepareBuilder(); result.hasOpen = false; result.open_ = false; return this; } public pbc::IPopsicleList AttributeList { - get { return result.attribute_; } + get { return PrepareBuilder().attribute_; } } public int AttributeCount { get { return result.AttributeCount; } @@ -5107,64 +5928,78 @@ public int AttributeCount { } public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.attribute_[index] = value; return this; } public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.attribute_[index] = builderForValue.Build(); return this; } public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.attribute_.Add(value); return this; } public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.attribute_.Add(builderForValue.Build()); return this; } public Builder AddRangeAttribute(scg::IEnumerable values) { - base.AddRange(values, result.attribute_); + PrepareBuilder(); + result.attribute_.Add(values); return this; } public Builder ClearAttribute() { + PrepareBuilder(); result.attribute_.Clear(); return this; } public bool HasReplace { - get { return result.HasReplace; } + get { return result.hasReplace; } } public bool Replace { get { return result.Replace; } set { SetReplace(value); } } public Builder SetReplace(bool value) { + PrepareBuilder(); result.hasReplace = true; result.replace_ = value; return this; } public Builder ClearReplace() { + PrepareBuilder(); result.hasReplace = false; result.replace_ = false; return this; } } static ChangeGameRequest() { - object.ReferenceEquals(global::bnet.protocol.game_master.Proto.GameMaster.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.game_master.GameMasterService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class GetFactoryInfoRequest : pb::GeneratedMessage { - private static readonly GetFactoryInfoRequest defaultInstance = new Builder().BuildPartial(); + private GetFactoryInfoRequest() { } + private static readonly GetFactoryInfoRequest defaultInstance = new GetFactoryInfoRequest().MakeReadOnly(); + private static readonly string[] _getFactoryInfoRequestFieldNames = new string[] { "factory_id" }; + private static readonly uint[] _getFactoryInfoRequestFieldTags = new uint[] { 9 }; public static GetFactoryInfoRequest DefaultInstance { get { return defaultInstance; } } public override GetFactoryInfoRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override GetFactoryInfoRequest ThisMessage { @@ -5172,16 +6007,16 @@ protected override GetFactoryInfoRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_GetFactoryInfoRequest__Descriptor; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_GetFactoryInfoRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_GetFactoryInfoRequest__FieldAccessorTable; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_GetFactoryInfoRequest__FieldAccessorTable; } } public const int FactoryIdFieldNumber = 1; private bool hasFactoryId; - private ulong factoryId_ = 0; + private ulong factoryId_; public bool HasFactoryId { get { return hasFactoryId; } } @@ -5196,10 +6031,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasFactoryId) { - output.WriteFixed64(1, FactoryId); + string[] field_names = _getFactoryInfoRequestFieldNames; + if (hasFactoryId) { + output.WriteFixed64(1, field_names[0], FactoryId); } UnknownFields.WriteTo(output); } @@ -5211,7 +6047,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasFactoryId) { + if (hasFactoryId) { size += pb::CodedOutputStream.ComputeFixed64Size(1, FactoryId); } size += UnknownFields.SerializedSize; @@ -5244,38 +6080,72 @@ public static GetFactoryInfoRequest ParseDelimitedFrom(global::System.IO.Stream public static GetFactoryInfoRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static GetFactoryInfoRequest ParseFrom(pb::CodedInputStream input) { + public static GetFactoryInfoRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static GetFactoryInfoRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static GetFactoryInfoRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private GetFactoryInfoRequest MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(GetFactoryInfoRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetFactoryInfoRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetFactoryInfoRequest result; + + private GetFactoryInfoRequest PrepareBuilder() { + if (resultIsReadOnly) { + GetFactoryInfoRequest original = result; + result = new GetFactoryInfoRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - GetFactoryInfoRequest result = new GetFactoryInfoRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override GetFactoryInfoRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new GetFactoryInfoRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -5287,12 +6157,11 @@ public override GetFactoryInfoRequest DefaultInstanceForType { } public override GetFactoryInfoRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - GetFactoryInfoRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -5306,6 +6175,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(GetFactoryInfoRequest other) { if (other == global::bnet.protocol.game_master.GetFactoryInfoRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasFactoryId) { FactoryId = other.FactoryId; } @@ -5313,20 +6183,31 @@ public override Builder MergeFrom(GetFactoryInfoRequest other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getFactoryInfoRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getFactoryInfoRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -5338,49 +6219,62 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 9: { - FactoryId = input.ReadFixed64(); + result.hasFactoryId = input.ReadFixed64(ref result.factoryId_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasFactoryId { - get { return result.HasFactoryId; } + get { return result.hasFactoryId; } } public ulong FactoryId { get { return result.FactoryId; } set { SetFactoryId(value); } } public Builder SetFactoryId(ulong value) { + PrepareBuilder(); result.hasFactoryId = true; result.factoryId_ = value; return this; } public Builder ClearFactoryId() { + PrepareBuilder(); result.hasFactoryId = false; result.factoryId_ = 0; return this; } } static GetFactoryInfoRequest() { - object.ReferenceEquals(global::bnet.protocol.game_master.Proto.GameMaster.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.game_master.GameMasterService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class GetFactoryInfoResponse : pb::GeneratedMessage { - private static readonly GetFactoryInfoResponse defaultInstance = new Builder().BuildPartial(); + private GetFactoryInfoResponse() { } + private static readonly GetFactoryInfoResponse defaultInstance = new GetFactoryInfoResponse().MakeReadOnly(); + private static readonly string[] _getFactoryInfoResponseFieldNames = new string[] { "attribute", "stats_bucket" }; + private static readonly uint[] _getFactoryInfoResponseFieldTags = new uint[] { 10, 18 }; public static GetFactoryInfoResponse DefaultInstance { get { return defaultInstance; } } public override GetFactoryInfoResponse DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override GetFactoryInfoResponse ThisMessage { @@ -5388,11 +6282,11 @@ protected override GetFactoryInfoResponse ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_GetFactoryInfoResponse__Descriptor; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_GetFactoryInfoResponse__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_GetFactoryInfoResponse__FieldAccessorTable; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_GetFactoryInfoResponse__FieldAccessorTable; } } public const int AttributeFieldNumber = 1; @@ -5428,13 +6322,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - output.WriteMessage(1, element); + string[] field_names = _getFactoryInfoResponseFieldNames; + if (attribute_.Count > 0) { + output.WriteMessageArray(1, field_names[0], attribute_); } - foreach (global::bnet.protocol.game_master.GameStatsBucket element in StatsBucketList) { - output.WriteMessage(2, element); + if (statsBucket_.Count > 0) { + output.WriteMessageArray(2, field_names[1], statsBucket_); } UnknownFields.WriteTo(output); } @@ -5482,38 +6377,74 @@ public static GetFactoryInfoResponse ParseDelimitedFrom(global::System.IO.Stream public static GetFactoryInfoResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static GetFactoryInfoResponse ParseFrom(pb::CodedInputStream input) { + public static GetFactoryInfoResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static GetFactoryInfoResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static GetFactoryInfoResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private GetFactoryInfoResponse MakeReadOnly() { + attribute_.MakeReadOnly(); + statsBucket_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(GetFactoryInfoResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetFactoryInfoResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetFactoryInfoResponse result; + + private GetFactoryInfoResponse PrepareBuilder() { + if (resultIsReadOnly) { + GetFactoryInfoResponse original = result; + result = new GetFactoryInfoResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - GetFactoryInfoResponse result = new GetFactoryInfoResponse(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override GetFactoryInfoResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new GetFactoryInfoResponse(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -5525,14 +6456,11 @@ public override GetFactoryInfoResponse DefaultInstanceForType { } public override GetFactoryInfoResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.attribute_.MakeReadOnly(); - result.statsBucket_.MakeReadOnly(); - GetFactoryInfoResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -5546,30 +6474,42 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(GetFactoryInfoResponse other) { if (other == global::bnet.protocol.game_master.GetFactoryInfoResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.attribute_.Count != 0) { - base.AddRange(other.attribute_, result.attribute_); + result.attribute_.Add(other.attribute_); } if (other.statsBucket_.Count != 0) { - base.AddRange(other.statsBucket_, result.statsBucket_); + result.statsBucket_.Add(other.statsBucket_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getFactoryInfoResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getFactoryInfoResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -5581,28 +6521,29 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { - global::bnet.protocol.attribute.Attribute.Builder subBuilder = global::bnet.protocol.attribute.Attribute.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddAttribute(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.attribute_, global::bnet.protocol.attribute.Attribute.DefaultInstance, extensionRegistry); break; } case 18: { - global::bnet.protocol.game_master.GameStatsBucket.Builder subBuilder = global::bnet.protocol.game_master.GameStatsBucket.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddStatsBucket(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.statsBucket_, global::bnet.protocol.game_master.GameStatsBucket.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public pbc::IPopsicleList AttributeList { - get { return result.attribute_; } + get { return PrepareBuilder().attribute_; } } public int AttributeCount { get { return result.AttributeCount; } @@ -5612,35 +6553,41 @@ public int AttributeCount { } public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.attribute_[index] = value; return this; } public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.attribute_[index] = builderForValue.Build(); return this; } public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.attribute_.Add(value); return this; } public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.attribute_.Add(builderForValue.Build()); return this; } public Builder AddRangeAttribute(scg::IEnumerable values) { - base.AddRange(values, result.attribute_); + PrepareBuilder(); + result.attribute_.Add(values); return this; } public Builder ClearAttribute() { + PrepareBuilder(); result.attribute_.Clear(); return this; } public pbc::IPopsicleList StatsBucketList { - get { return result.statsBucket_; } + get { return PrepareBuilder().statsBucket_; } } public int StatsBucketCount { get { return result.StatsBucketCount; } @@ -5650,46 +6597,58 @@ public int StatsBucketCount { } public Builder SetStatsBucket(int index, global::bnet.protocol.game_master.GameStatsBucket value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.statsBucket_[index] = value; return this; } public Builder SetStatsBucket(int index, global::bnet.protocol.game_master.GameStatsBucket.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.statsBucket_[index] = builderForValue.Build(); return this; } public Builder AddStatsBucket(global::bnet.protocol.game_master.GameStatsBucket value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.statsBucket_.Add(value); return this; } public Builder AddStatsBucket(global::bnet.protocol.game_master.GameStatsBucket.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.statsBucket_.Add(builderForValue.Build()); return this; } public Builder AddRangeStatsBucket(scg::IEnumerable values) { - base.AddRange(values, result.statsBucket_); + PrepareBuilder(); + result.statsBucket_.Add(values); return this; } public Builder ClearStatsBucket() { + PrepareBuilder(); result.statsBucket_.Clear(); return this; } } static GetFactoryInfoResponse() { - object.ReferenceEquals(global::bnet.protocol.game_master.Proto.GameMaster.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.game_master.GameMasterService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class GetGameStatsRequest : pb::GeneratedMessage { - private static readonly GetGameStatsRequest defaultInstance = new Builder().BuildPartial(); + private GetGameStatsRequest() { } + private static readonly GetGameStatsRequest defaultInstance = new GetGameStatsRequest().MakeReadOnly(); + private static readonly string[] _getGameStatsRequestFieldNames = new string[] { "factory_id", "filter" }; + private static readonly uint[] _getGameStatsRequestFieldTags = new uint[] { 9, 18 }; public static GetGameStatsRequest DefaultInstance { get { return defaultInstance; } } public override GetGameStatsRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override GetGameStatsRequest ThisMessage { @@ -5697,16 +6656,16 @@ protected override GetGameStatsRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_GetGameStatsRequest__Descriptor; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_GetGameStatsRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_GetGameStatsRequest__FieldAccessorTable; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_GetGameStatsRequest__FieldAccessorTable; } } public const int FactoryIdFieldNumber = 1; private bool hasFactoryId; - private ulong factoryId_ = 0; + private ulong factoryId_; public bool HasFactoryId { get { return hasFactoryId; } } @@ -5716,12 +6675,12 @@ public ulong FactoryId { public const int FilterFieldNumber = 2; private bool hasFilter; - private global::bnet.protocol.attribute.AttributeFilter filter_ = global::bnet.protocol.attribute.AttributeFilter.DefaultInstance; + private global::bnet.protocol.attribute.AttributeFilter filter_; public bool HasFilter { get { return hasFilter; } } public global::bnet.protocol.attribute.AttributeFilter Filter { - get { return filter_; } + get { return filter_ ?? global::bnet.protocol.attribute.AttributeFilter.DefaultInstance; } } public override bool IsInitialized { @@ -5733,13 +6692,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasFactoryId) { - output.WriteFixed64(1, FactoryId); + string[] field_names = _getGameStatsRequestFieldNames; + if (hasFactoryId) { + output.WriteFixed64(1, field_names[0], FactoryId); } - if (HasFilter) { - output.WriteMessage(2, Filter); + if (hasFilter) { + output.WriteMessage(2, field_names[1], Filter); } UnknownFields.WriteTo(output); } @@ -5751,10 +6711,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasFactoryId) { + if (hasFactoryId) { size += pb::CodedOutputStream.ComputeFixed64Size(1, FactoryId); } - if (HasFilter) { + if (hasFilter) { size += pb::CodedOutputStream.ComputeMessageSize(2, Filter); } size += UnknownFields.SerializedSize; @@ -5787,38 +6747,72 @@ public static GetGameStatsRequest ParseDelimitedFrom(global::System.IO.Stream in public static GetGameStatsRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static GetGameStatsRequest ParseFrom(pb::CodedInputStream input) { + public static GetGameStatsRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static GetGameStatsRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static GetGameStatsRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private GetGameStatsRequest MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(GetGameStatsRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetGameStatsRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetGameStatsRequest result; + + private GetGameStatsRequest PrepareBuilder() { + if (resultIsReadOnly) { + GetGameStatsRequest original = result; + result = new GetGameStatsRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - GetGameStatsRequest result = new GetGameStatsRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override GetGameStatsRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new GetGameStatsRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -5830,12 +6824,11 @@ public override GetGameStatsRequest DefaultInstanceForType { } public override GetGameStatsRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - GetGameStatsRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -5849,6 +6842,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(GetGameStatsRequest other) { if (other == global::bnet.protocol.game_master.GetGameStatsRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasFactoryId) { FactoryId = other.FactoryId; } @@ -5859,20 +6853,31 @@ public override Builder MergeFrom(GetGameStatsRequest other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getGameStatsRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getGameStatsRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -5884,16 +6889,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 9: { - FactoryId = input.ReadFixed64(); + result.hasFactoryId = input.ReadFixed64(ref result.factoryId_); break; } case 18: { global::bnet.protocol.attribute.AttributeFilter.Builder subBuilder = global::bnet.protocol.attribute.AttributeFilter.CreateBuilder(); - if (HasFilter) { + if (result.hasFilter) { subBuilder.MergeFrom(Filter); } input.ReadMessage(subBuilder, extensionRegistry); @@ -5902,29 +6907,36 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasFactoryId { - get { return result.HasFactoryId; } + get { return result.hasFactoryId; } } public ulong FactoryId { get { return result.FactoryId; } set { SetFactoryId(value); } } public Builder SetFactoryId(ulong value) { + PrepareBuilder(); result.hasFactoryId = true; result.factoryId_ = value; return this; } public Builder ClearFactoryId() { + PrepareBuilder(); result.hasFactoryId = false; result.factoryId_ = 0; return this; } public bool HasFilter { - get { return result.HasFilter; } + get { return result.hasFilter; } } public global::bnet.protocol.attribute.AttributeFilter Filter { get { return result.Filter; } @@ -5932,19 +6944,22 @@ public bool HasFilter { } public Builder SetFilter(global::bnet.protocol.attribute.AttributeFilter value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasFilter = true; result.filter_ = value; return this; } public Builder SetFilter(global::bnet.protocol.attribute.AttributeFilter.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasFilter = true; result.filter_ = builderForValue.Build(); return this; } public Builder MergeFilter(global::bnet.protocol.attribute.AttributeFilter value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasFilter && + PrepareBuilder(); + if (result.hasFilter && result.filter_ != global::bnet.protocol.attribute.AttributeFilter.DefaultInstance) { result.filter_ = global::bnet.protocol.attribute.AttributeFilter.CreateBuilder(result.filter_).MergeFrom(value).BuildPartial(); } else { @@ -5954,24 +6969,31 @@ public Builder MergeFilter(global::bnet.protocol.attribute.AttributeFilter value return this; } public Builder ClearFilter() { + PrepareBuilder(); result.hasFilter = false; - result.filter_ = global::bnet.protocol.attribute.AttributeFilter.DefaultInstance; + result.filter_ = null; return this; } } static GetGameStatsRequest() { - object.ReferenceEquals(global::bnet.protocol.game_master.Proto.GameMaster.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.game_master.GameMasterService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class GetGameStatsResponse : pb::GeneratedMessage { - private static readonly GetGameStatsResponse defaultInstance = new Builder().BuildPartial(); + private GetGameStatsResponse() { } + private static readonly GetGameStatsResponse defaultInstance = new GetGameStatsResponse().MakeReadOnly(); + private static readonly string[] _getGameStatsResponseFieldNames = new string[] { "stats_bucket" }; + private static readonly uint[] _getGameStatsResponseFieldTags = new uint[] { 10 }; public static GetGameStatsResponse DefaultInstance { get { return defaultInstance; } } public override GetGameStatsResponse DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override GetGameStatsResponse ThisMessage { @@ -5979,11 +7001,11 @@ protected override GetGameStatsResponse ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_GetGameStatsResponse__Descriptor; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_GetGameStatsResponse__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_GetGameStatsResponse__FieldAccessorTable; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_GetGameStatsResponse__FieldAccessorTable; } } public const int StatsBucketFieldNumber = 1; @@ -6004,10 +7026,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - foreach (global::bnet.protocol.game_master.GameStatsBucket element in StatsBucketList) { - output.WriteMessage(1, element); + string[] field_names = _getGameStatsResponseFieldNames; + if (statsBucket_.Count > 0) { + output.WriteMessageArray(1, field_names[0], statsBucket_); } UnknownFields.WriteTo(output); } @@ -6052,38 +7075,73 @@ public static GetGameStatsResponse ParseDelimitedFrom(global::System.IO.Stream i public static GetGameStatsResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static GetGameStatsResponse ParseFrom(pb::CodedInputStream input) { + public static GetGameStatsResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static GetGameStatsResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static GetGameStatsResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private GetGameStatsResponse MakeReadOnly() { + statsBucket_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(GetGameStatsResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetGameStatsResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetGameStatsResponse result; + + private GetGameStatsResponse PrepareBuilder() { + if (resultIsReadOnly) { + GetGameStatsResponse original = result; + result = new GetGameStatsResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - GetGameStatsResponse result = new GetGameStatsResponse(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override GetGameStatsResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new GetGameStatsResponse(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -6095,13 +7153,11 @@ public override GetGameStatsResponse DefaultInstanceForType { } public override GetGameStatsResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.statsBucket_.MakeReadOnly(); - GetGameStatsResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -6115,27 +7171,39 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(GetGameStatsResponse other) { if (other == global::bnet.protocol.game_master.GetGameStatsResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.statsBucket_.Count != 0) { - base.AddRange(other.statsBucket_, result.statsBucket_); + result.statsBucket_.Add(other.statsBucket_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getGameStatsResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getGameStatsResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -6147,22 +7215,25 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { - global::bnet.protocol.game_master.GameStatsBucket.Builder subBuilder = global::bnet.protocol.game_master.GameStatsBucket.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddStatsBucket(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.statsBucket_, global::bnet.protocol.game_master.GameStatsBucket.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public pbc::IPopsicleList StatsBucketList { - get { return result.statsBucket_; } + get { return PrepareBuilder().statsBucket_; } } public int StatsBucketCount { get { return result.StatsBucketCount; } @@ -6172,46 +7243,58 @@ public int StatsBucketCount { } public Builder SetStatsBucket(int index, global::bnet.protocol.game_master.GameStatsBucket value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.statsBucket_[index] = value; return this; } public Builder SetStatsBucket(int index, global::bnet.protocol.game_master.GameStatsBucket.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.statsBucket_[index] = builderForValue.Build(); return this; } public Builder AddStatsBucket(global::bnet.protocol.game_master.GameStatsBucket value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.statsBucket_.Add(value); return this; } public Builder AddStatsBucket(global::bnet.protocol.game_master.GameStatsBucket.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.statsBucket_.Add(builderForValue.Build()); return this; } public Builder AddRangeStatsBucket(scg::IEnumerable values) { - base.AddRange(values, result.statsBucket_); + PrepareBuilder(); + result.statsBucket_.Add(values); return this; } public Builder ClearStatsBucket() { + PrepareBuilder(); result.statsBucket_.Clear(); return this; } } static GetGameStatsResponse() { - object.ReferenceEquals(global::bnet.protocol.game_master.Proto.GameMaster.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.game_master.GameMasterService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class FactoryUpdateNotification : pb::GeneratedMessage { - private static readonly FactoryUpdateNotification defaultInstance = new Builder().BuildPartial(); + private FactoryUpdateNotification() { } + private static readonly FactoryUpdateNotification defaultInstance = new FactoryUpdateNotification().MakeReadOnly(); + private static readonly string[] _factoryUpdateNotificationFieldNames = new string[] { "description", "op", "program_id" }; + private static readonly uint[] _factoryUpdateNotificationFieldTags = new uint[] { 18, 8, 29 }; public static FactoryUpdateNotification DefaultInstance { get { return defaultInstance; } } public override FactoryUpdateNotification DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override FactoryUpdateNotification ThisMessage { @@ -6219,15 +7302,20 @@ protected override FactoryUpdateNotification ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_FactoryUpdateNotification__Descriptor; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_FactoryUpdateNotification__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_FactoryUpdateNotification__FieldAccessorTable; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_FactoryUpdateNotification__FieldAccessorTable; } } #region Nested types + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public static class Types { + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public enum Operation { ADD = 1, REMOVE = 2, @@ -6249,17 +7337,17 @@ public bool HasOp { public const int DescriptionFieldNumber = 2; private bool hasDescription; - private global::bnet.protocol.game_master.GameFactoryDescription description_ = global::bnet.protocol.game_master.GameFactoryDescription.DefaultInstance; + private global::bnet.protocol.game_master.GameFactoryDescription description_; public bool HasDescription { get { return hasDescription; } } public global::bnet.protocol.game_master.GameFactoryDescription Description { - get { return description_; } + get { return description_ ?? global::bnet.protocol.game_master.GameFactoryDescription.DefaultInstance; } } public const int ProgramIdFieldNumber = 3; private bool hasProgramId; - private uint programId_ = 0; + private uint programId_; public bool HasProgramId { get { return hasProgramId; } } @@ -6276,16 +7364,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasOp) { - output.WriteEnum(1, (int) Op); + string[] field_names = _factoryUpdateNotificationFieldNames; + if (hasOp) { + output.WriteEnum(1, field_names[1], (int) Op, Op); } - if (HasDescription) { - output.WriteMessage(2, Description); + if (hasDescription) { + output.WriteMessage(2, field_names[0], Description); } - if (HasProgramId) { - output.WriteFixed32(3, ProgramId); + if (hasProgramId) { + output.WriteFixed32(3, field_names[2], ProgramId); } UnknownFields.WriteTo(output); } @@ -6297,13 +7386,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasOp) { + if (hasOp) { size += pb::CodedOutputStream.ComputeEnumSize(1, (int) Op); } - if (HasDescription) { + if (hasDescription) { size += pb::CodedOutputStream.ComputeMessageSize(2, Description); } - if (HasProgramId) { + if (hasProgramId) { size += pb::CodedOutputStream.ComputeFixed32Size(3, ProgramId); } size += UnknownFields.SerializedSize; @@ -6336,38 +7425,72 @@ public static FactoryUpdateNotification ParseDelimitedFrom(global::System.IO.Str public static FactoryUpdateNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static FactoryUpdateNotification ParseFrom(pb::CodedInputStream input) { + public static FactoryUpdateNotification ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static FactoryUpdateNotification ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static FactoryUpdateNotification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private FactoryUpdateNotification MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(FactoryUpdateNotification prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(FactoryUpdateNotification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private FactoryUpdateNotification result; + + private FactoryUpdateNotification PrepareBuilder() { + if (resultIsReadOnly) { + FactoryUpdateNotification original = result; + result = new FactoryUpdateNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - FactoryUpdateNotification result = new FactoryUpdateNotification(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override FactoryUpdateNotification MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new FactoryUpdateNotification(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -6379,12 +7502,11 @@ public override FactoryUpdateNotification DefaultInstanceForType { } public override FactoryUpdateNotification BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - FactoryUpdateNotification returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -6398,6 +7520,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(FactoryUpdateNotification other) { if (other == global::bnet.protocol.game_master.FactoryUpdateNotification.DefaultInstance) return this; + PrepareBuilder(); if (other.HasOp) { Op = other.Op; } @@ -6411,20 +7534,31 @@ public override Builder MergeFrom(FactoryUpdateNotification other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_factoryUpdateNotificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _factoryUpdateNotificationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -6436,24 +7570,24 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 8: { - int rawValue = input.ReadEnum(); - if (!global::System.Enum.IsDefined(typeof(global::bnet.protocol.game_master.FactoryUpdateNotification.Types.Operation), rawValue)) { + object unknown; + if(input.ReadEnum(ref result.op_, out unknown)) { + result.hasOp = true; + } else if(unknown is int) { if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - unknownFields.MergeVarintField(1, (ulong) rawValue); - } else { - Op = (global::bnet.protocol.game_master.FactoryUpdateNotification.Types.Operation) rawValue; + unknownFields.MergeVarintField(1, (ulong)(int)unknown); } break; } case 18: { global::bnet.protocol.game_master.GameFactoryDescription.Builder subBuilder = global::bnet.protocol.game_master.GameFactoryDescription.CreateBuilder(); - if (HasDescription) { + if (result.hasDescription) { subBuilder.MergeFrom(Description); } input.ReadMessage(subBuilder, extensionRegistry); @@ -6461,34 +7595,41 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 29: { - ProgramId = input.ReadFixed32(); + result.hasProgramId = input.ReadFixed32(ref result.programId_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasOp { - get { return result.HasOp; } + get { return result.hasOp; } } public global::bnet.protocol.game_master.FactoryUpdateNotification.Types.Operation Op { get { return result.Op; } set { SetOp(value); } } public Builder SetOp(global::bnet.protocol.game_master.FactoryUpdateNotification.Types.Operation value) { + PrepareBuilder(); result.hasOp = true; result.op_ = value; return this; } public Builder ClearOp() { + PrepareBuilder(); result.hasOp = false; result.op_ = global::bnet.protocol.game_master.FactoryUpdateNotification.Types.Operation.ADD; return this; } public bool HasDescription { - get { return result.HasDescription; } + get { return result.hasDescription; } } public global::bnet.protocol.game_master.GameFactoryDescription Description { get { return result.Description; } @@ -6496,19 +7637,22 @@ public bool HasDescription { } public Builder SetDescription(global::bnet.protocol.game_master.GameFactoryDescription value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasDescription = true; result.description_ = value; return this; } public Builder SetDescription(global::bnet.protocol.game_master.GameFactoryDescription.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasDescription = true; result.description_ = builderForValue.Build(); return this; } public Builder MergeDescription(global::bnet.protocol.game_master.GameFactoryDescription value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasDescription && + PrepareBuilder(); + if (result.hasDescription && result.description_ != global::bnet.protocol.game_master.GameFactoryDescription.DefaultInstance) { result.description_ = global::bnet.protocol.game_master.GameFactoryDescription.CreateBuilder(result.description_).MergeFrom(value).BuildPartial(); } else { @@ -6518,42 +7662,51 @@ public Builder MergeDescription(global::bnet.protocol.game_master.GameFactoryDes return this; } public Builder ClearDescription() { + PrepareBuilder(); result.hasDescription = false; - result.description_ = global::bnet.protocol.game_master.GameFactoryDescription.DefaultInstance; + result.description_ = null; return this; } public bool HasProgramId { - get { return result.HasProgramId; } + get { return result.hasProgramId; } } public uint ProgramId { get { return result.ProgramId; } set { SetProgramId(value); } } public Builder SetProgramId(uint value) { + PrepareBuilder(); result.hasProgramId = true; result.programId_ = value; return this; } public Builder ClearProgramId() { + PrepareBuilder(); result.hasProgramId = false; result.programId_ = 0; return this; } } static FactoryUpdateNotification() { - object.ReferenceEquals(global::bnet.protocol.game_master.Proto.GameMaster.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.game_master.GameMasterService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class GameFoundNotification : pb::GeneratedMessage { - private static readonly GameFoundNotification defaultInstance = new Builder().BuildPartial(); + private GameFoundNotification() { } + private static readonly GameFoundNotification defaultInstance = new GameFoundNotification().MakeReadOnly(); + private static readonly string[] _gameFoundNotificationFieldNames = new string[] { "connect_info", "error_code", "game_handle", "request_id" }; + private static readonly uint[] _gameFoundNotificationFieldTags = new uint[] { 34, 16, 26, 9 }; public static GameFoundNotification DefaultInstance { get { return defaultInstance; } } public override GameFoundNotification DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override GameFoundNotification ThisMessage { @@ -6561,16 +7714,16 @@ protected override GameFoundNotification ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_GameFoundNotification__Descriptor; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_GameFoundNotification__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_master.Proto.GameMaster.internal__static_bnet_protocol_game_master_GameFoundNotification__FieldAccessorTable; } + get { return global::bnet.protocol.game_master.GameMasterService.internal__static_bnet_protocol_game_master_GameFoundNotification__FieldAccessorTable; } } public const int RequestIdFieldNumber = 1; private bool hasRequestId; - private ulong requestId_ = 0UL; + private ulong requestId_; public bool HasRequestId { get { return hasRequestId; } } @@ -6580,7 +7733,7 @@ public ulong RequestId { public const int ErrorCodeFieldNumber = 2; private bool hasErrorCode; - private uint errorCode_ = 0; + private uint errorCode_; public bool HasErrorCode { get { return hasErrorCode; } } @@ -6590,12 +7743,12 @@ public uint ErrorCode { public const int GameHandleFieldNumber = 3; private bool hasGameHandle; - private global::bnet.protocol.game_master.GameHandle gameHandle_ = global::bnet.protocol.game_master.GameHandle.DefaultInstance; + private global::bnet.protocol.game_master.GameHandle gameHandle_; public bool HasGameHandle { get { return hasGameHandle; } } public global::bnet.protocol.game_master.GameHandle GameHandle { - get { return gameHandle_; } + get { return gameHandle_ ?? global::bnet.protocol.game_master.GameHandle.DefaultInstance; } } public const int ConnectInfoFieldNumber = 4; @@ -6623,19 +7776,20 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasRequestId) { - output.WriteUInt64(1, RequestId); + string[] field_names = _gameFoundNotificationFieldNames; + if (hasRequestId) { + output.WriteFixed64(1, field_names[3], RequestId); } - if (HasErrorCode) { - output.WriteUInt32(2, ErrorCode); + if (hasErrorCode) { + output.WriteUInt32(2, field_names[1], ErrorCode); } - if (HasGameHandle) { - output.WriteMessage(3, GameHandle); + if (hasGameHandle) { + output.WriteMessage(3, field_names[2], GameHandle); } - foreach (global::bnet.protocol.game_master.ConnectInfo element in ConnectInfoList) { - output.WriteMessage(4, element); + if (connectInfo_.Count > 0) { + output.WriteMessageArray(4, field_names[0], connectInfo_); } UnknownFields.WriteTo(output); } @@ -6647,13 +7801,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasRequestId) { - size += pb::CodedOutputStream.ComputeUInt64Size(1, RequestId); + if (hasRequestId) { + size += pb::CodedOutputStream.ComputeFixed64Size(1, RequestId); } - if (HasErrorCode) { + if (hasErrorCode) { size += pb::CodedOutputStream.ComputeUInt32Size(2, ErrorCode); } - if (HasGameHandle) { + if (hasGameHandle) { size += pb::CodedOutputStream.ComputeMessageSize(3, GameHandle); } foreach (global::bnet.protocol.game_master.ConnectInfo element in ConnectInfoList) { @@ -6689,38 +7843,73 @@ public static GameFoundNotification ParseDelimitedFrom(global::System.IO.Stream public static GameFoundNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static GameFoundNotification ParseFrom(pb::CodedInputStream input) { + public static GameFoundNotification ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static GameFoundNotification ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static GameFoundNotification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private GameFoundNotification MakeReadOnly() { + connectInfo_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(GameFoundNotification prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GameFoundNotification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GameFoundNotification result; + + private GameFoundNotification PrepareBuilder() { + if (resultIsReadOnly) { + GameFoundNotification original = result; + result = new GameFoundNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - GameFoundNotification result = new GameFoundNotification(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override GameFoundNotification MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new GameFoundNotification(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -6732,13 +7921,11 @@ public override GameFoundNotification DefaultInstanceForType { } public override GameFoundNotification BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.connectInfo_.MakeReadOnly(); - GameFoundNotification returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -6752,6 +7939,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(GameFoundNotification other) { if (other == global::bnet.protocol.game_master.GameFoundNotification.DefaultInstance) return this; + PrepareBuilder(); if (other.HasRequestId) { RequestId = other.RequestId; } @@ -6762,26 +7950,37 @@ public override Builder MergeFrom(GameFoundNotification other) { MergeGameHandle(other.GameHandle); } if (other.connectInfo_.Count != 0) { - base.AddRange(other.connectInfo_, result.connectInfo_); + result.connectInfo_.Add(other.connectInfo_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_gameFoundNotificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _gameFoundNotificationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -6793,20 +7992,20 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } - case 8: { - RequestId = input.ReadUInt64(); + case 9: { + result.hasRequestId = input.ReadFixed64(ref result.requestId_); break; } case 16: { - ErrorCode = input.ReadUInt32(); + result.hasErrorCode = input.ReadUInt32(ref result.errorCode_); break; } case 26: { global::bnet.protocol.game_master.GameHandle.Builder subBuilder = global::bnet.protocol.game_master.GameHandle.CreateBuilder(); - if (HasGameHandle) { + if (result.hasGameHandle) { subBuilder.MergeFrom(GameHandle); } input.ReadMessage(subBuilder, extensionRegistry); @@ -6814,54 +8013,61 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 34: { - global::bnet.protocol.game_master.ConnectInfo.Builder subBuilder = global::bnet.protocol.game_master.ConnectInfo.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddConnectInfo(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.connectInfo_, global::bnet.protocol.game_master.ConnectInfo.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasRequestId { - get { return result.HasRequestId; } + get { return result.hasRequestId; } } public ulong RequestId { get { return result.RequestId; } set { SetRequestId(value); } } public Builder SetRequestId(ulong value) { + PrepareBuilder(); result.hasRequestId = true; result.requestId_ = value; return this; } public Builder ClearRequestId() { + PrepareBuilder(); result.hasRequestId = false; - result.requestId_ = 0UL; + result.requestId_ = 0; return this; } public bool HasErrorCode { - get { return result.HasErrorCode; } + get { return result.hasErrorCode; } } public uint ErrorCode { get { return result.ErrorCode; } set { SetErrorCode(value); } } public Builder SetErrorCode(uint value) { + PrepareBuilder(); result.hasErrorCode = true; result.errorCode_ = value; return this; } public Builder ClearErrorCode() { + PrepareBuilder(); result.hasErrorCode = false; result.errorCode_ = 0; return this; } public bool HasGameHandle { - get { return result.HasGameHandle; } + get { return result.hasGameHandle; } } public global::bnet.protocol.game_master.GameHandle GameHandle { get { return result.GameHandle; } @@ -6869,19 +8075,22 @@ public bool HasGameHandle { } public Builder SetGameHandle(global::bnet.protocol.game_master.GameHandle value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasGameHandle = true; result.gameHandle_ = value; return this; } public Builder SetGameHandle(global::bnet.protocol.game_master.GameHandle.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasGameHandle = true; result.gameHandle_ = builderForValue.Build(); return this; } public Builder MergeGameHandle(global::bnet.protocol.game_master.GameHandle value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasGameHandle && + PrepareBuilder(); + if (result.hasGameHandle && result.gameHandle_ != global::bnet.protocol.game_master.GameHandle.DefaultInstance) { result.gameHandle_ = global::bnet.protocol.game_master.GameHandle.CreateBuilder(result.gameHandle_).MergeFrom(value).BuildPartial(); } else { @@ -6891,13 +8100,14 @@ public Builder MergeGameHandle(global::bnet.protocol.game_master.GameHandle valu return this; } public Builder ClearGameHandle() { + PrepareBuilder(); result.hasGameHandle = false; - result.gameHandle_ = global::bnet.protocol.game_master.GameHandle.DefaultInstance; + result.gameHandle_ = null; return this; } public pbc::IPopsicleList ConnectInfoList { - get { return result.connectInfo_; } + get { return PrepareBuilder().connectInfo_; } } public int ConnectInfoCount { get { return result.ConnectInfoCount; } @@ -6907,41 +8117,50 @@ public int ConnectInfoCount { } public Builder SetConnectInfo(int index, global::bnet.protocol.game_master.ConnectInfo value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.connectInfo_[index] = value; return this; } public Builder SetConnectInfo(int index, global::bnet.protocol.game_master.ConnectInfo.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.connectInfo_[index] = builderForValue.Build(); return this; } public Builder AddConnectInfo(global::bnet.protocol.game_master.ConnectInfo value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.connectInfo_.Add(value); return this; } public Builder AddConnectInfo(global::bnet.protocol.game_master.ConnectInfo.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.connectInfo_.Add(builderForValue.Build()); return this; } public Builder AddRangeConnectInfo(scg::IEnumerable values) { - base.AddRange(values, result.connectInfo_); + PrepareBuilder(); + result.connectInfo_.Add(values); return this; } public Builder ClearConnectInfo() { + PrepareBuilder(); result.connectInfo_.Clear(); return this; } } static GameFoundNotification() { - object.ReferenceEquals(global::bnet.protocol.game_master.Proto.GameMaster.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.game_master.GameMasterService.Descriptor, null); } } #endregion #region Services + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public abstract class GameMaster : pb::IService { public abstract void JoinGame( pb::IRpcController controller, @@ -6955,9 +8174,9 @@ public abstract void FindGame( pb::IRpcController controller, global::bnet.protocol.game_master.FindGameRequest request, global::System.Action done); - public abstract void CancelFindGame( + public abstract void CancelGameEntry( pb::IRpcController controller, - global::bnet.protocol.game_master.CancelFindGameRequest request, + global::bnet.protocol.game_master.CancelGameEntryRequest request, global::System.Action done); public abstract void GameEnded( pb::IRpcController controller, @@ -7005,7 +8224,7 @@ public abstract void GetGameStats( global::System.Action done); public static pbd::ServiceDescriptor Descriptor { - get { return Proto.GameMaster.Descriptor.Services[0]; } + get { return GameMasterService.Descriptor.Services[0]; } } public pbd::ServiceDescriptor DescriptorForType { get { return Descriptor; } @@ -7037,7 +8256,7 @@ public void CallMethod( done)); return; case 3: - this.CancelFindGame(controller, (global::bnet.protocol.game_master.CancelFindGameRequest) request, + this.CancelGameEntry(controller, (global::bnet.protocol.game_master.CancelGameEntryRequest) request, pb::RpcUtil.SpecializeCallback( done)); return; @@ -7114,7 +8333,7 @@ public void CallMethod( case 2: return global::bnet.protocol.game_master.FindGameRequest.DefaultInstance; case 3: - return global::bnet.protocol.game_master.CancelFindGameRequest.DefaultInstance; + return global::bnet.protocol.game_master.CancelGameEntryRequest.DefaultInstance; case 4: return global::bnet.protocol.game_master.GameEndedNotification.DefaultInstance; case 5: @@ -7187,6 +8406,9 @@ public static Stub CreateStub(pb::IRpcChannel channel) { return new Stub(channel); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public class Stub : global::bnet.protocol.game_master.GameMaster { internal Stub(pb::IRpcChannel channel) { this.channel = channel; @@ -7225,9 +8447,9 @@ public override void FindGame( pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.game_master.FindGameResponse.DefaultInstance)); } - public override void CancelFindGame( + public override void CancelGameEntry( pb::IRpcController controller, - global::bnet.protocol.game_master.CancelFindGameRequest request, + global::bnet.protocol.game_master.CancelGameEntryRequest request, global::System.Action done) { channel.CallMethod(Descriptor.Methods[3], controller, request, global::bnet.protocol.NoData.DefaultInstance, @@ -7334,6 +8556,9 @@ public override void GetGameStats( } } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public abstract class GameMasterSubscriber : pb::IService { public abstract void NotifyFactoryUpdate( pb::IRpcController controller, @@ -7341,7 +8566,7 @@ public abstract void NotifyFactoryUpdate( global::System.Action done); public static pbd::ServiceDescriptor Descriptor { - get { return Proto.GameMaster.Descriptor.Services[1]; } + get { return GameMasterService.Descriptor.Services[1]; } } public pbd::ServiceDescriptor DescriptorForType { get { return Descriptor; } @@ -7397,6 +8622,9 @@ public static Stub CreateStub(pb::IRpcChannel channel) { return new Stub(channel); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public class Stub : global::bnet.protocol.game_master.GameMasterSubscriber { internal Stub(pb::IRpcChannel channel) { this.channel = channel; @@ -7418,6 +8646,9 @@ public override void NotifyFactoryUpdate( } } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public abstract class GameFactorySubscriber : pb::IService { public abstract void NotifyGameFound( pb::IRpcController controller, @@ -7425,7 +8656,7 @@ public abstract void NotifyGameFound( global::System.Action done); public static pbd::ServiceDescriptor Descriptor { - get { return Proto.GameMaster.Descriptor.Services[2]; } + get { return GameMasterService.Descriptor.Services[2]; } } public pbd::ServiceDescriptor DescriptorForType { get { return Descriptor; } @@ -7481,6 +8712,9 @@ public static Stub CreateStub(pb::IRpcChannel channel) { return new Stub(channel); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public class Stub : global::bnet.protocol.game_master.GameFactorySubscriber { internal Stub(pb::IRpcChannel channel) { this.channel = channel; @@ -7505,3 +8739,5 @@ public override void NotifyGameFound( #endregion } + +#endregion Designer generated code diff --git a/source/D3Proto/bnet/protocol/game_master/GameMasterTypes.cs b/src/LibMooNet/bnet/protocol/game_master/GameMasterTypes.cs similarity index 56% rename from source/D3Proto/bnet/protocol/game_master/GameMasterTypes.cs rename to src/LibMooNet/bnet/protocol/game_master/GameMasterTypes.cs index 7aedb1e8..e3ca6370 100644 --- a/source/D3Proto/bnet/protocol/game_master/GameMasterTypes.cs +++ b/src/LibMooNet/bnet/protocol/game_master/GameMasterTypes.cs @@ -1,4 +1,6 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code using pb = global::Google.ProtocolBuffers; using pbc = global::Google.ProtocolBuffers.Collections; @@ -6,6 +8,9 @@ using scg = global::System.Collections.Generic; namespace bnet.protocol.game_master { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public static partial class GameMasterTypes { #region Extension registration @@ -23,6 +28,8 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_GameFactoryDescription__FieldAccessorTable; internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_GameHandle__Descriptor; internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_GameHandle__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_master_CancelGameEntryRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_master_CancelGameEntryRequest__FieldAccessorTable; #endregion #region Descriptor public static pbd::FileDescriptor Descriptor { @@ -32,40 +39,41 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { static GameMasterTypes() { byte[] descriptorData = global::System.Convert.FromBase64String( - "CitzZXJ2aWNlL2dhbWVfbWFzdGVyL2dhbWVfbWFzdGVyX3R5cGVzLnByb3Rv" + - "EhlibmV0LnByb3RvY29sLmdhbWVfbWFzdGVyGhxsaWIvcHJvdG9jb2wvYXR0" + - "cmlidXRlLnByb3RvGhlsaWIvcHJvdG9jb2wvZW50aXR5LnByb3RvIqkCCgZQ" + - "bGF5ZXISOgoEdHlwZRgBIAEoDjImLmJuZXQucHJvdG9jb2wuZ2FtZV9tYXN0" + - "ZXIuUGxheWVyLlR5cGU6BFRPT04SKAoHdG9vbl9pZBgCIAEoCzIXLmJuZXQu" + - "cHJvdG9jb2wuRW50aXR5SWQSMAoPZ2FtZV9hY2NvdW50X2lkGAMgASgLMhcu" + - "Ym5ldC5wcm90b2NvbC5FbnRpdHlJZBIwCg9ibmV0X2FjY291bnRfaWQYBCAB" + - "KAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEjUKCWF0dHJpYnV0ZRgFIAMo" + - "CzIiLmJuZXQucHJvdG9jb2wuYXR0cmlidXRlLkF0dHJpYnV0ZSIeCgRUeXBl" + - "EggKBFRPT04QABIMCghDT01QVVRFUhABIpkBCgtDb25uZWN0SW5mbxIoCgd0" + - "b29uX2lkGAEgAigLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBIMCgRob3N0" + - "GAIgAigJEgwKBHBvcnQYAyACKAUSDQoFdG9rZW4YBCABKAwSNQoJYXR0cmli" + - "dXRlGAUgAygLMiIuYm5ldC5wcm90b2NvbC5hdHRyaWJ1dGUuQXR0cmlidXRl" + - "Iu8BCg9HYW1lU3RhdHNCdWNrZXQSFQoKYnVja2V0X21pbhgBIAEoAjoBMBIi" + - "CgpidWNrZXRfbWF4GAIgASgCOg40LjI5NDk2NzNlKzAwORIcChF3YWl0X21p" + - "bGxpc2Vjb25kcxgDIAEoDToBMBIZCg5nYW1lc19wZXJfaG91chgEIAEoDToB" + - "MBIXCgxhY3RpdmVfZ2FtZXMYBSABKA06ATASGQoOYWN0aXZlX3BsYXllcnMY" + - "BiABKA06ATASGAoNZm9ybWluZ19nYW1lcxgHIAEoDToBMBIaCg93YWl0aW5n" + - "X3BsYXllcnMYCCABKA06ATAiqwEKFkdhbWVGYWN0b3J5RGVzY3JpcHRpb24S" + - "CgoCaWQYASACKAYSDAoEbmFtZRgCIAEoCRI1CglhdHRyaWJ1dGUYAyADKAsy" + - "Ii5ibmV0LnByb3RvY29sLmF0dHJpYnV0ZS5BdHRyaWJ1dGUSQAoMc3RhdHNf" + - "YnVja2V0GAQgAygLMiouYm5ldC5wcm90b2NvbC5nYW1lX21hc3Rlci5HYW1l" + - "U3RhdHNCdWNrZXQiSgoKR2FtZUhhbmRsZRISCgpmYWN0b3J5X2lkGAEgAigG" + - "EigKB2dhbWVfaWQYAiACKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlk"); + "ChxibmV0L2dhbWVfbWFzdGVyX3R5cGVzLnByb3RvEhlibmV0LnByb3RvY29s" + + "LmdhbWVfbWFzdGVyGhRibmV0L2F0dHJpYnV0ZS5wcm90bxoRYm5ldC9lbnRp" + + "dHkucHJvdG8iyAEKBlBsYXllchI7CgR0eXBlGAEgASgOMiYuYm5ldC5wcm90" + + "b2NvbC5nYW1lX21hc3Rlci5QbGF5ZXIuVHlwZToFSFVNQU4SKQoIaWRlbnRp" + + "dHkYAiABKAsyFy5ibmV0LnByb3RvY29sLklkZW50aXR5EjUKCWF0dHJpYnV0" + + "ZRgDIAMoCzIiLmJuZXQucHJvdG9jb2wuYXR0cmlidXRlLkF0dHJpYnV0ZSIf" + + "CgRUeXBlEgkKBUhVTUFOEAASDAoIQ09NUFVURVIQASKbAQoLQ29ubmVjdElu" + + "Zm8SKgoJbWVtYmVyX2lkGAEgAigLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJ" + + "ZBIMCgRob3N0GAIgAigJEgwKBHBvcnQYAyACKAUSDQoFdG9rZW4YBCABKAwS" + + "NQoJYXR0cmlidXRlGAUgAygLMiIuYm5ldC5wcm90b2NvbC5hdHRyaWJ1dGUu" + + "QXR0cmlidXRlIu8BCg9HYW1lU3RhdHNCdWNrZXQSFQoKYnVja2V0X21pbhgB" + + "IAEoAjoBMBIiCgpidWNrZXRfbWF4GAIgASgCOg40LjI5NDk2NzNlKzAwORIc" + + "ChF3YWl0X21pbGxpc2Vjb25kcxgDIAEoDToBMBIZCg5nYW1lc19wZXJfaG91" + + "chgEIAEoDToBMBIXCgxhY3RpdmVfZ2FtZXMYBSABKA06ATASGQoOYWN0aXZl" + + "X3BsYXllcnMYBiABKA06ATASGAoNZm9ybWluZ19nYW1lcxgHIAEoDToBMBIa" + + "Cg93YWl0aW5nX3BsYXllcnMYCCABKA06ATAiwwEKFkdhbWVGYWN0b3J5RGVz" + + "Y3JpcHRpb24SCgoCaWQYASACKAYSDAoEbmFtZRgCIAEoCRI1CglhdHRyaWJ1" + + "dGUYAyADKAsyIi5ibmV0LnByb3RvY29sLmF0dHJpYnV0ZS5BdHRyaWJ1dGUS" + + "QAoMc3RhdHNfYnVja2V0GAQgAygLMiouYm5ldC5wcm90b2NvbC5nYW1lX21h" + + "c3Rlci5HYW1lU3RhdHNCdWNrZXQSFgoLdW5zZWVkZWRfaWQYBSABKAY6ATAi" + + "SgoKR2FtZUhhbmRsZRISCgpmYWN0b3J5X2lkGAEgAigGEigKB2dhbWVfaWQY" + + "AiACKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkInMKFkNhbmNlbEdhbWVF" + + "bnRyeVJlcXVlc3QSEgoKcmVxdWVzdF9pZBgBIAIoBhISCgpmYWN0b3J5X2lk" + + "GAIgASgGEjEKBnBsYXllchgDIAMoCzIhLmJuZXQucHJvdG9jb2wuZ2FtZV9t" + + "YXN0ZXIuUGxheWVy"); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_bnet_protocol_game_master_Player__Descriptor = Descriptor.MessageTypes[0]; internal__static_bnet_protocol_game_master_Player__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_Player__Descriptor, - new string[] { "Type", "ToonId", "GameAccountId", "BnetAccountId", "Attribute", }); + new string[] { "Type", "Identity", "Attribute", }); internal__static_bnet_protocol_game_master_ConnectInfo__Descriptor = Descriptor.MessageTypes[1]; internal__static_bnet_protocol_game_master_ConnectInfo__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_ConnectInfo__Descriptor, - new string[] { "ToonId", "Host", "Port", "Token", "Attribute", }); + new string[] { "MemberId", "Host", "Port", "Token", "Attribute", }); internal__static_bnet_protocol_game_master_GameStatsBucket__Descriptor = Descriptor.MessageTypes[2]; internal__static_bnet_protocol_game_master_GameStatsBucket__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_GameStatsBucket__Descriptor, @@ -73,11 +81,15 @@ static GameMasterTypes() { internal__static_bnet_protocol_game_master_GameFactoryDescription__Descriptor = Descriptor.MessageTypes[3]; internal__static_bnet_protocol_game_master_GameFactoryDescription__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_GameFactoryDescription__Descriptor, - new string[] { "Id", "Name", "Attribute", "StatsBucket", }); + new string[] { "Id", "Name", "Attribute", "StatsBucket", "UnseededId", }); internal__static_bnet_protocol_game_master_GameHandle__Descriptor = Descriptor.MessageTypes[4]; internal__static_bnet_protocol_game_master_GameHandle__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_GameHandle__Descriptor, new string[] { "FactoryId", "GameId", }); + internal__static_bnet_protocol_game_master_CancelGameEntryRequest__Descriptor = Descriptor.MessageTypes[5]; + internal__static_bnet_protocol_game_master_CancelGameEntryRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_master_CancelGameEntryRequest__Descriptor, + new string[] { "RequestId", "FactoryId", "Player", }); return null; }; pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, @@ -90,14 +102,20 @@ static GameMasterTypes() { } #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Player : pb::GeneratedMessage { - private static readonly Player defaultInstance = new Builder().BuildPartial(); + private Player() { } + private static readonly Player defaultInstance = new Player().MakeReadOnly(); + private static readonly string[] _playerFieldNames = new string[] { "attribute", "identity", "type" }; + private static readonly uint[] _playerFieldTags = new uint[] { 26, 18, 8 }; public static Player DefaultInstance { get { return defaultInstance; } } public override Player DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override Player ThisMessage { @@ -113,9 +131,14 @@ protected override Player ThisMessage { } #region Nested types + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public static class Types { + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public enum Type { - TOON = 0, + HUMAN = 0, COMPUTER = 1, } @@ -124,7 +147,7 @@ public enum Type { public const int TypeFieldNumber = 1; private bool hasType; - private global::bnet.protocol.game_master.Player.Types.Type type_ = global::bnet.protocol.game_master.Player.Types.Type.TOON; + private global::bnet.protocol.game_master.Player.Types.Type type_ = global::bnet.protocol.game_master.Player.Types.Type.HUMAN; public bool HasType { get { return hasType; } } @@ -132,37 +155,17 @@ public bool HasType { get { return type_; } } - public const int ToonIdFieldNumber = 2; - private bool hasToonId; - private global::bnet.protocol.EntityId toonId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasToonId { - get { return hasToonId; } - } - public global::bnet.protocol.EntityId ToonId { - get { return toonId_; } - } - - public const int GameAccountIdFieldNumber = 3; - private bool hasGameAccountId; - private global::bnet.protocol.EntityId gameAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasGameAccountId { - get { return hasGameAccountId; } - } - public global::bnet.protocol.EntityId GameAccountId { - get { return gameAccountId_; } - } - - public const int BnetAccountIdFieldNumber = 4; - private bool hasBnetAccountId; - private global::bnet.protocol.EntityId bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasBnetAccountId { - get { return hasBnetAccountId; } + public const int IdentityFieldNumber = 2; + private bool hasIdentity; + private global::bnet.protocol.Identity identity_; + public bool HasIdentity { + get { return hasIdentity; } } - public global::bnet.protocol.EntityId BnetAccountId { - get { return bnetAccountId_; } + public global::bnet.protocol.Identity Identity { + get { return identity_ ?? global::bnet.protocol.Identity.DefaultInstance; } } - public const int AttributeFieldNumber = 5; + public const int AttributeFieldNumber = 3; private pbc::PopsicleList attribute_ = new pbc::PopsicleList(); public scg::IList AttributeList { get { return attribute_; } @@ -176,14 +179,8 @@ public int AttributeCount { public override bool IsInitialized { get { - if (HasToonId) { - if (!ToonId.IsInitialized) return false; - } - if (HasGameAccountId) { - if (!GameAccountId.IsInitialized) return false; - } - if (HasBnetAccountId) { - if (!BnetAccountId.IsInitialized) return false; + if (HasIdentity) { + if (!Identity.IsInitialized) return false; } foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { if (!element.IsInitialized) return false; @@ -192,22 +189,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasType) { - output.WriteEnum(1, (int) Type); - } - if (HasToonId) { - output.WriteMessage(2, ToonId); - } - if (HasGameAccountId) { - output.WriteMessage(3, GameAccountId); + string[] field_names = _playerFieldNames; + if (hasType) { + output.WriteEnum(1, field_names[2], (int) Type, Type); } - if (HasBnetAccountId) { - output.WriteMessage(4, BnetAccountId); + if (hasIdentity) { + output.WriteMessage(2, field_names[1], Identity); } - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - output.WriteMessage(5, element); + if (attribute_.Count > 0) { + output.WriteMessageArray(3, field_names[0], attribute_); } UnknownFields.WriteTo(output); } @@ -219,20 +211,14 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasType) { + if (hasType) { size += pb::CodedOutputStream.ComputeEnumSize(1, (int) Type); } - if (HasToonId) { - size += pb::CodedOutputStream.ComputeMessageSize(2, ToonId); - } - if (HasGameAccountId) { - size += pb::CodedOutputStream.ComputeMessageSize(3, GameAccountId); - } - if (HasBnetAccountId) { - size += pb::CodedOutputStream.ComputeMessageSize(4, BnetAccountId); + if (hasIdentity) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Identity); } foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - size += pb::CodedOutputStream.ComputeMessageSize(5, element); + size += pb::CodedOutputStream.ComputeMessageSize(3, element); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -264,38 +250,73 @@ public static Player ParseDelimitedFrom(global::System.IO.Stream input) { public static Player ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static Player ParseFrom(pb::CodedInputStream input) { + public static Player ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Player ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static Player ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private Player MakeReadOnly() { + attribute_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(Player prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Player cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Player result; + + private Player PrepareBuilder() { + if (resultIsReadOnly) { + Player original = result; + result = new Player(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - Player result = new Player(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override Player MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new Player(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -307,13 +328,11 @@ public override Player DefaultInstanceForType { } public override Player BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.attribute_.MakeReadOnly(); - Player returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -327,39 +346,45 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Player other) { if (other == global::bnet.protocol.game_master.Player.DefaultInstance) return this; + PrepareBuilder(); if (other.HasType) { Type = other.Type; } - if (other.HasToonId) { - MergeToonId(other.ToonId); - } - if (other.HasGameAccountId) { - MergeGameAccountId(other.GameAccountId); - } - if (other.HasBnetAccountId) { - MergeBnetAccountId(other.BnetAccountId); + if (other.HasIdentity) { + MergeIdentity(other.Identity); } if (other.attribute_.Count != 0) { - base.AddRange(other.attribute_, result.attribute_); + result.attribute_.Add(other.attribute_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_playerFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _playerFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -371,187 +396,106 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 8: { - int rawValue = input.ReadEnum(); - if (!global::System.Enum.IsDefined(typeof(global::bnet.protocol.game_master.Player.Types.Type), rawValue)) { + object unknown; + if(input.ReadEnum(ref result.type_, out unknown)) { + result.hasType = true; + } else if(unknown is int) { if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - unknownFields.MergeVarintField(1, (ulong) rawValue); - } else { - Type = (global::bnet.protocol.game_master.Player.Types.Type) rawValue; + unknownFields.MergeVarintField(1, (ulong)(int)unknown); } break; } case 18: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasToonId) { - subBuilder.MergeFrom(ToonId); + global::bnet.protocol.Identity.Builder subBuilder = global::bnet.protocol.Identity.CreateBuilder(); + if (result.hasIdentity) { + subBuilder.MergeFrom(Identity); } input.ReadMessage(subBuilder, extensionRegistry); - ToonId = subBuilder.BuildPartial(); + Identity = subBuilder.BuildPartial(); break; } case 26: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasGameAccountId) { - subBuilder.MergeFrom(GameAccountId); - } - input.ReadMessage(subBuilder, extensionRegistry); - GameAccountId = subBuilder.BuildPartial(); - break; - } - case 34: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasBnetAccountId) { - subBuilder.MergeFrom(BnetAccountId); - } - input.ReadMessage(subBuilder, extensionRegistry); - BnetAccountId = subBuilder.BuildPartial(); - break; - } - case 42: { - global::bnet.protocol.attribute.Attribute.Builder subBuilder = global::bnet.protocol.attribute.Attribute.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddAttribute(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.attribute_, global::bnet.protocol.attribute.Attribute.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasType { - get { return result.HasType; } + get { return result.hasType; } } public global::bnet.protocol.game_master.Player.Types.Type Type { get { return result.Type; } set { SetType(value); } } public Builder SetType(global::bnet.protocol.game_master.Player.Types.Type value) { + PrepareBuilder(); result.hasType = true; result.type_ = value; return this; } public Builder ClearType() { + PrepareBuilder(); result.hasType = false; - result.type_ = global::bnet.protocol.game_master.Player.Types.Type.TOON; - return this; - } - - public bool HasToonId { - get { return result.HasToonId; } - } - public global::bnet.protocol.EntityId ToonId { - get { return result.ToonId; } - set { SetToonId(value); } - } - public Builder SetToonId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasToonId = true; - result.toonId_ = value; - return this; - } - public Builder SetToonId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasToonId = true; - result.toonId_ = builderForValue.Build(); - return this; - } - public Builder MergeToonId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasToonId && - result.toonId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.toonId_ = global::bnet.protocol.EntityId.CreateBuilder(result.toonId_).MergeFrom(value).BuildPartial(); - } else { - result.toonId_ = value; - } - result.hasToonId = true; - return this; - } - public Builder ClearToonId() { - result.hasToonId = false; - result.toonId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.type_ = global::bnet.protocol.game_master.Player.Types.Type.HUMAN; return this; } - public bool HasGameAccountId { - get { return result.HasGameAccountId; } + public bool HasIdentity { + get { return result.hasIdentity; } } - public global::bnet.protocol.EntityId GameAccountId { - get { return result.GameAccountId; } - set { SetGameAccountId(value); } + public global::bnet.protocol.Identity Identity { + get { return result.Identity; } + set { SetIdentity(value); } } - public Builder SetGameAccountId(global::bnet.protocol.EntityId value) { + public Builder SetIdentity(global::bnet.protocol.Identity value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasGameAccountId = true; - result.gameAccountId_ = value; + PrepareBuilder(); + result.hasIdentity = true; + result.identity_ = value; return this; } - public Builder SetGameAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { + public Builder SetIdentity(global::bnet.protocol.Identity.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasGameAccountId = true; - result.gameAccountId_ = builderForValue.Build(); + PrepareBuilder(); + result.hasIdentity = true; + result.identity_ = builderForValue.Build(); return this; } - public Builder MergeGameAccountId(global::bnet.protocol.EntityId value) { + public Builder MergeIdentity(global::bnet.protocol.Identity value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasGameAccountId && - result.gameAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.gameAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccountId_).MergeFrom(value).BuildPartial(); + PrepareBuilder(); + if (result.hasIdentity && + result.identity_ != global::bnet.protocol.Identity.DefaultInstance) { + result.identity_ = global::bnet.protocol.Identity.CreateBuilder(result.identity_).MergeFrom(value).BuildPartial(); } else { - result.gameAccountId_ = value; + result.identity_ = value; } - result.hasGameAccountId = true; + result.hasIdentity = true; return this; } - public Builder ClearGameAccountId() { - result.hasGameAccountId = false; - result.gameAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasBnetAccountId { - get { return result.HasBnetAccountId; } - } - public global::bnet.protocol.EntityId BnetAccountId { - get { return result.BnetAccountId; } - set { SetBnetAccountId(value); } - } - public Builder SetBnetAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBnetAccountId = true; - result.bnetAccountId_ = value; - return this; - } - public Builder SetBnetAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBnetAccountId = true; - result.bnetAccountId_ = builderForValue.Build(); - return this; - } - public Builder MergeBnetAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasBnetAccountId && - result.bnetAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.bnetAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccountId_).MergeFrom(value).BuildPartial(); - } else { - result.bnetAccountId_ = value; - } - result.hasBnetAccountId = true; - return this; - } - public Builder ClearBnetAccountId() { - result.hasBnetAccountId = false; - result.bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; + public Builder ClearIdentity() { + PrepareBuilder(); + result.hasIdentity = false; + result.identity_ = null; return this; } public pbc::IPopsicleList AttributeList { - get { return result.attribute_; } + get { return PrepareBuilder().attribute_; } } public int AttributeCount { get { return result.AttributeCount; } @@ -561,29 +505,35 @@ public int AttributeCount { } public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.attribute_[index] = value; return this; } public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.attribute_[index] = builderForValue.Build(); return this; } public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.attribute_.Add(value); return this; } public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.attribute_.Add(builderForValue.Build()); return this; } public Builder AddRangeAttribute(scg::IEnumerable values) { - base.AddRange(values, result.attribute_); + PrepareBuilder(); + result.attribute_.Add(values); return this; } public Builder ClearAttribute() { + PrepareBuilder(); result.attribute_.Clear(); return this; } @@ -593,14 +543,20 @@ static Player() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class ConnectInfo : pb::GeneratedMessage { - private static readonly ConnectInfo defaultInstance = new Builder().BuildPartial(); + private ConnectInfo() { } + private static readonly ConnectInfo defaultInstance = new ConnectInfo().MakeReadOnly(); + private static readonly string[] _connectInfoFieldNames = new string[] { "attribute", "host", "member_id", "port", "token" }; + private static readonly uint[] _connectInfoFieldTags = new uint[] { 42, 18, 10, 24, 34 }; public static ConnectInfo DefaultInstance { get { return defaultInstance; } } public override ConnectInfo DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ConnectInfo ThisMessage { @@ -615,14 +571,14 @@ protected override ConnectInfo ThisMessage { get { return global::bnet.protocol.game_master.GameMasterTypes.internal__static_bnet_protocol_game_master_ConnectInfo__FieldAccessorTable; } } - public const int ToonIdFieldNumber = 1; - private bool hasToonId; - private global::bnet.protocol.EntityId toonId_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasToonId { - get { return hasToonId; } + public const int MemberIdFieldNumber = 1; + private bool hasMemberId; + private global::bnet.protocol.EntityId memberId_; + public bool HasMemberId { + get { return hasMemberId; } } - public global::bnet.protocol.EntityId ToonId { - get { return toonId_; } + public global::bnet.protocol.EntityId MemberId { + get { return memberId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int HostFieldNumber = 2; @@ -637,7 +593,7 @@ public string Host { public const int PortFieldNumber = 3; private bool hasPort; - private int port_ = 0; + private int port_; public bool HasPort { get { return hasPort; } } @@ -669,10 +625,10 @@ public int AttributeCount { public override bool IsInitialized { get { - if (!hasToonId) return false; + if (!hasMemberId) return false; if (!hasHost) return false; if (!hasPort) return false; - if (!ToonId.IsInitialized) return false; + if (!MemberId.IsInitialized) return false; foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { if (!element.IsInitialized) return false; } @@ -680,22 +636,23 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasToonId) { - output.WriteMessage(1, ToonId); + string[] field_names = _connectInfoFieldNames; + if (hasMemberId) { + output.WriteMessage(1, field_names[2], MemberId); } - if (HasHost) { - output.WriteString(2, Host); + if (hasHost) { + output.WriteString(2, field_names[1], Host); } - if (HasPort) { - output.WriteInt32(3, Port); + if (hasPort) { + output.WriteInt32(3, field_names[3], Port); } - if (HasToken) { - output.WriteBytes(4, Token); + if (hasToken) { + output.WriteBytes(4, field_names[4], Token); } - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - output.WriteMessage(5, element); + if (attribute_.Count > 0) { + output.WriteMessageArray(5, field_names[0], attribute_); } UnknownFields.WriteTo(output); } @@ -707,16 +664,16 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasToonId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, ToonId); + if (hasMemberId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, MemberId); } - if (HasHost) { + if (hasHost) { size += pb::CodedOutputStream.ComputeStringSize(2, Host); } - if (HasPort) { + if (hasPort) { size += pb::CodedOutputStream.ComputeInt32Size(3, Port); } - if (HasToken) { + if (hasToken) { size += pb::CodedOutputStream.ComputeBytesSize(4, Token); } foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { @@ -752,38 +709,73 @@ public static ConnectInfo ParseDelimitedFrom(global::System.IO.Stream input) { public static ConnectInfo ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static ConnectInfo ParseFrom(pb::CodedInputStream input) { + public static ConnectInfo ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ConnectInfo ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static ConnectInfo ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private ConnectInfo MakeReadOnly() { + attribute_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(ConnectInfo prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ConnectInfo cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - ConnectInfo result = new ConnectInfo(); + private bool resultIsReadOnly; + private ConnectInfo result; + + private ConnectInfo PrepareBuilder() { + if (resultIsReadOnly) { + ConnectInfo original = result; + result = new ConnectInfo(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override ConnectInfo MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ConnectInfo(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -795,13 +787,11 @@ public override ConnectInfo DefaultInstanceForType { } public override ConnectInfo BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.attribute_.MakeReadOnly(); - ConnectInfo returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -815,8 +805,9 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(ConnectInfo other) { if (other == global::bnet.protocol.game_master.ConnectInfo.DefaultInstance) return this; - if (other.HasToonId) { - MergeToonId(other.ToonId); + PrepareBuilder(); + if (other.HasMemberId) { + MergeMemberId(other.MemberId); } if (other.HasHost) { Host = other.Host; @@ -828,26 +819,37 @@ public override Builder MergeFrom(ConnectInfo other) { Token = other.Token; } if (other.attribute_.Count != 0) { - base.AddRange(other.attribute_, result.attribute_); + result.attribute_.Add(other.attribute_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_connectInfoFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _connectInfoFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -859,79 +861,86 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasToonId) { - subBuilder.MergeFrom(ToonId); + if (result.hasMemberId) { + subBuilder.MergeFrom(MemberId); } input.ReadMessage(subBuilder, extensionRegistry); - ToonId = subBuilder.BuildPartial(); + MemberId = subBuilder.BuildPartial(); break; } case 18: { - Host = input.ReadString(); + result.hasHost = input.ReadString(ref result.host_); break; } case 24: { - Port = input.ReadInt32(); + result.hasPort = input.ReadInt32(ref result.port_); break; } case 34: { - Token = input.ReadBytes(); + result.hasToken = input.ReadBytes(ref result.token_); break; } case 42: { - global::bnet.protocol.attribute.Attribute.Builder subBuilder = global::bnet.protocol.attribute.Attribute.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddAttribute(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.attribute_, global::bnet.protocol.attribute.Attribute.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } - public bool HasToonId { - get { return result.HasToonId; } + public bool HasMemberId { + get { return result.hasMemberId; } } - public global::bnet.protocol.EntityId ToonId { - get { return result.ToonId; } - set { SetToonId(value); } + public global::bnet.protocol.EntityId MemberId { + get { return result.MemberId; } + set { SetMemberId(value); } } - public Builder SetToonId(global::bnet.protocol.EntityId value) { + public Builder SetMemberId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasToonId = true; - result.toonId_ = value; + PrepareBuilder(); + result.hasMemberId = true; + result.memberId_ = value; return this; } - public Builder SetToonId(global::bnet.protocol.EntityId.Builder builderForValue) { + public Builder SetMemberId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasToonId = true; - result.toonId_ = builderForValue.Build(); + PrepareBuilder(); + result.hasMemberId = true; + result.memberId_ = builderForValue.Build(); return this; } - public Builder MergeToonId(global::bnet.protocol.EntityId value) { + public Builder MergeMemberId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasToonId && - result.toonId_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.toonId_ = global::bnet.protocol.EntityId.CreateBuilder(result.toonId_).MergeFrom(value).BuildPartial(); + PrepareBuilder(); + if (result.hasMemberId && + result.memberId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.memberId_ = global::bnet.protocol.EntityId.CreateBuilder(result.memberId_).MergeFrom(value).BuildPartial(); } else { - result.toonId_ = value; + result.memberId_ = value; } - result.hasToonId = true; + result.hasMemberId = true; return this; } - public Builder ClearToonId() { - result.hasToonId = false; - result.toonId_ = global::bnet.protocol.EntityId.DefaultInstance; + public Builder ClearMemberId() { + PrepareBuilder(); + result.hasMemberId = false; + result.memberId_ = null; return this; } public bool HasHost { - get { return result.HasHost; } + get { return result.hasHost; } } public string Host { get { return result.Host; } @@ -939,36 +948,40 @@ public string Host { } public Builder SetHost(string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasHost = true; result.host_ = value; return this; } public Builder ClearHost() { + PrepareBuilder(); result.hasHost = false; result.host_ = ""; return this; } public bool HasPort { - get { return result.HasPort; } + get { return result.hasPort; } } public int Port { get { return result.Port; } set { SetPort(value); } } public Builder SetPort(int value) { + PrepareBuilder(); result.hasPort = true; result.port_ = value; return this; } public Builder ClearPort() { + PrepareBuilder(); result.hasPort = false; result.port_ = 0; return this; } public bool HasToken { - get { return result.HasToken; } + get { return result.hasToken; } } public pb::ByteString Token { get { return result.Token; } @@ -976,18 +989,20 @@ public bool HasToken { } public Builder SetToken(pb::ByteString value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasToken = true; result.token_ = value; return this; } public Builder ClearToken() { + PrepareBuilder(); result.hasToken = false; result.token_ = pb::ByteString.Empty; return this; } public pbc::IPopsicleList AttributeList { - get { return result.attribute_; } + get { return PrepareBuilder().attribute_; } } public int AttributeCount { get { return result.AttributeCount; } @@ -997,29 +1012,35 @@ public int AttributeCount { } public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.attribute_[index] = value; return this; } public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.attribute_[index] = builderForValue.Build(); return this; } public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.attribute_.Add(value); return this; } public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.attribute_.Add(builderForValue.Build()); return this; } public Builder AddRangeAttribute(scg::IEnumerable values) { - base.AddRange(values, result.attribute_); + PrepareBuilder(); + result.attribute_.Add(values); return this; } public Builder ClearAttribute() { + PrepareBuilder(); result.attribute_.Clear(); return this; } @@ -1029,14 +1050,20 @@ static ConnectInfo() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class GameStatsBucket : pb::GeneratedMessage { - private static readonly GameStatsBucket defaultInstance = new Builder().BuildPartial(); + private GameStatsBucket() { } + private static readonly GameStatsBucket defaultInstance = new GameStatsBucket().MakeReadOnly(); + private static readonly string[] _gameStatsBucketFieldNames = new string[] { "active_games", "active_players", "bucket_max", "bucket_min", "forming_games", "games_per_hour", "wait_milliseconds", "waiting_players" }; + private static readonly uint[] _gameStatsBucketFieldTags = new uint[] { 40, 48, 21, 13, 56, 32, 24, 64 }; public static GameStatsBucket DefaultInstance { get { return defaultInstance; } } public override GameStatsBucket DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override GameStatsBucket ThisMessage { @@ -1053,7 +1080,7 @@ protected override GameStatsBucket ThisMessage { public const int BucketMinFieldNumber = 1; private bool hasBucketMin; - private float bucketMin_ = 0F; + private float bucketMin_; public bool HasBucketMin { get { return hasBucketMin; } } @@ -1073,7 +1100,7 @@ public float BucketMax { public const int WaitMillisecondsFieldNumber = 3; private bool hasWaitMilliseconds; - private uint waitMilliseconds_ = 0; + private uint waitMilliseconds_; public bool HasWaitMilliseconds { get { return hasWaitMilliseconds; } } @@ -1083,7 +1110,7 @@ public uint WaitMilliseconds { public const int GamesPerHourFieldNumber = 4; private bool hasGamesPerHour; - private uint gamesPerHour_ = 0; + private uint gamesPerHour_; public bool HasGamesPerHour { get { return hasGamesPerHour; } } @@ -1093,7 +1120,7 @@ public uint GamesPerHour { public const int ActiveGamesFieldNumber = 5; private bool hasActiveGames; - private uint activeGames_ = 0; + private uint activeGames_; public bool HasActiveGames { get { return hasActiveGames; } } @@ -1103,7 +1130,7 @@ public uint ActiveGames { public const int ActivePlayersFieldNumber = 6; private bool hasActivePlayers; - private uint activePlayers_ = 0; + private uint activePlayers_; public bool HasActivePlayers { get { return hasActivePlayers; } } @@ -1113,7 +1140,7 @@ public uint ActivePlayers { public const int FormingGamesFieldNumber = 7; private bool hasFormingGames; - private uint formingGames_ = 0; + private uint formingGames_; public bool HasFormingGames { get { return hasFormingGames; } } @@ -1123,7 +1150,7 @@ public uint FormingGames { public const int WaitingPlayersFieldNumber = 8; private bool hasWaitingPlayers; - private uint waitingPlayers_ = 0; + private uint waitingPlayers_; public bool HasWaitingPlayers { get { return hasWaitingPlayers; } } @@ -1137,31 +1164,32 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasBucketMin) { - output.WriteFloat(1, BucketMin); + string[] field_names = _gameStatsBucketFieldNames; + if (hasBucketMin) { + output.WriteFloat(1, field_names[3], BucketMin); } - if (HasBucketMax) { - output.WriteFloat(2, BucketMax); + if (hasBucketMax) { + output.WriteFloat(2, field_names[2], BucketMax); } - if (HasWaitMilliseconds) { - output.WriteUInt32(3, WaitMilliseconds); + if (hasWaitMilliseconds) { + output.WriteUInt32(3, field_names[6], WaitMilliseconds); } - if (HasGamesPerHour) { - output.WriteUInt32(4, GamesPerHour); + if (hasGamesPerHour) { + output.WriteUInt32(4, field_names[5], GamesPerHour); } - if (HasActiveGames) { - output.WriteUInt32(5, ActiveGames); + if (hasActiveGames) { + output.WriteUInt32(5, field_names[0], ActiveGames); } - if (HasActivePlayers) { - output.WriteUInt32(6, ActivePlayers); + if (hasActivePlayers) { + output.WriteUInt32(6, field_names[1], ActivePlayers); } - if (HasFormingGames) { - output.WriteUInt32(7, FormingGames); + if (hasFormingGames) { + output.WriteUInt32(7, field_names[4], FormingGames); } - if (HasWaitingPlayers) { - output.WriteUInt32(8, WaitingPlayers); + if (hasWaitingPlayers) { + output.WriteUInt32(8, field_names[7], WaitingPlayers); } UnknownFields.WriteTo(output); } @@ -1173,28 +1201,28 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasBucketMin) { + if (hasBucketMin) { size += pb::CodedOutputStream.ComputeFloatSize(1, BucketMin); } - if (HasBucketMax) { + if (hasBucketMax) { size += pb::CodedOutputStream.ComputeFloatSize(2, BucketMax); } - if (HasWaitMilliseconds) { + if (hasWaitMilliseconds) { size += pb::CodedOutputStream.ComputeUInt32Size(3, WaitMilliseconds); } - if (HasGamesPerHour) { + if (hasGamesPerHour) { size += pb::CodedOutputStream.ComputeUInt32Size(4, GamesPerHour); } - if (HasActiveGames) { + if (hasActiveGames) { size += pb::CodedOutputStream.ComputeUInt32Size(5, ActiveGames); } - if (HasActivePlayers) { + if (hasActivePlayers) { size += pb::CodedOutputStream.ComputeUInt32Size(6, ActivePlayers); } - if (HasFormingGames) { + if (hasFormingGames) { size += pb::CodedOutputStream.ComputeUInt32Size(7, FormingGames); } - if (HasWaitingPlayers) { + if (hasWaitingPlayers) { size += pb::CodedOutputStream.ComputeUInt32Size(8, WaitingPlayers); } size += UnknownFields.SerializedSize; @@ -1227,38 +1255,72 @@ public static GameStatsBucket ParseDelimitedFrom(global::System.IO.Stream input) public static GameStatsBucket ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static GameStatsBucket ParseFrom(pb::CodedInputStream input) { + public static GameStatsBucket ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static GameStatsBucket ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static GameStatsBucket ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private GameStatsBucket MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(GameStatsBucket prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GameStatsBucket cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GameStatsBucket result; + + private GameStatsBucket PrepareBuilder() { + if (resultIsReadOnly) { + GameStatsBucket original = result; + result = new GameStatsBucket(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - GameStatsBucket result = new GameStatsBucket(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override GameStatsBucket MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new GameStatsBucket(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -1270,12 +1332,11 @@ public override GameStatsBucket DefaultInstanceForType { } public override GameStatsBucket BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - GameStatsBucket returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1289,6 +1350,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(GameStatsBucket other) { if (other == global::bnet.protocol.game_master.GameStatsBucket.DefaultInstance) return this; + PrepareBuilder(); if (other.HasBucketMin) { BucketMin = other.BucketMin; } @@ -1317,20 +1379,31 @@ public override Builder MergeFrom(GameStatsBucket other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_gameStatsBucketFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _gameStatsBucketFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1342,185 +1415,206 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 13: { - BucketMin = input.ReadFloat(); + result.hasBucketMin = input.ReadFloat(ref result.bucketMin_); break; } case 21: { - BucketMax = input.ReadFloat(); + result.hasBucketMax = input.ReadFloat(ref result.bucketMax_); break; } case 24: { - WaitMilliseconds = input.ReadUInt32(); + result.hasWaitMilliseconds = input.ReadUInt32(ref result.waitMilliseconds_); break; } case 32: { - GamesPerHour = input.ReadUInt32(); + result.hasGamesPerHour = input.ReadUInt32(ref result.gamesPerHour_); break; } case 40: { - ActiveGames = input.ReadUInt32(); + result.hasActiveGames = input.ReadUInt32(ref result.activeGames_); break; } case 48: { - ActivePlayers = input.ReadUInt32(); + result.hasActivePlayers = input.ReadUInt32(ref result.activePlayers_); break; } case 56: { - FormingGames = input.ReadUInt32(); + result.hasFormingGames = input.ReadUInt32(ref result.formingGames_); break; } case 64: { - WaitingPlayers = input.ReadUInt32(); + result.hasWaitingPlayers = input.ReadUInt32(ref result.waitingPlayers_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasBucketMin { - get { return result.HasBucketMin; } + get { return result.hasBucketMin; } } public float BucketMin { get { return result.BucketMin; } set { SetBucketMin(value); } } public Builder SetBucketMin(float value) { + PrepareBuilder(); result.hasBucketMin = true; result.bucketMin_ = value; return this; } public Builder ClearBucketMin() { + PrepareBuilder(); result.hasBucketMin = false; result.bucketMin_ = 0F; return this; } public bool HasBucketMax { - get { return result.HasBucketMax; } + get { return result.hasBucketMax; } } public float BucketMax { get { return result.BucketMax; } set { SetBucketMax(value); } } public Builder SetBucketMax(float value) { + PrepareBuilder(); result.hasBucketMax = true; result.bucketMax_ = value; return this; } public Builder ClearBucketMax() { + PrepareBuilder(); result.hasBucketMax = false; result.bucketMax_ = 4.294967E+09F; return this; } public bool HasWaitMilliseconds { - get { return result.HasWaitMilliseconds; } + get { return result.hasWaitMilliseconds; } } public uint WaitMilliseconds { get { return result.WaitMilliseconds; } set { SetWaitMilliseconds(value); } } public Builder SetWaitMilliseconds(uint value) { + PrepareBuilder(); result.hasWaitMilliseconds = true; result.waitMilliseconds_ = value; return this; } public Builder ClearWaitMilliseconds() { + PrepareBuilder(); result.hasWaitMilliseconds = false; result.waitMilliseconds_ = 0; return this; } public bool HasGamesPerHour { - get { return result.HasGamesPerHour; } + get { return result.hasGamesPerHour; } } public uint GamesPerHour { get { return result.GamesPerHour; } set { SetGamesPerHour(value); } } public Builder SetGamesPerHour(uint value) { + PrepareBuilder(); result.hasGamesPerHour = true; result.gamesPerHour_ = value; return this; } public Builder ClearGamesPerHour() { + PrepareBuilder(); result.hasGamesPerHour = false; result.gamesPerHour_ = 0; return this; } public bool HasActiveGames { - get { return result.HasActiveGames; } + get { return result.hasActiveGames; } } public uint ActiveGames { get { return result.ActiveGames; } set { SetActiveGames(value); } } public Builder SetActiveGames(uint value) { + PrepareBuilder(); result.hasActiveGames = true; result.activeGames_ = value; return this; } public Builder ClearActiveGames() { + PrepareBuilder(); result.hasActiveGames = false; result.activeGames_ = 0; return this; } public bool HasActivePlayers { - get { return result.HasActivePlayers; } + get { return result.hasActivePlayers; } } public uint ActivePlayers { get { return result.ActivePlayers; } set { SetActivePlayers(value); } } public Builder SetActivePlayers(uint value) { + PrepareBuilder(); result.hasActivePlayers = true; result.activePlayers_ = value; return this; } public Builder ClearActivePlayers() { + PrepareBuilder(); result.hasActivePlayers = false; result.activePlayers_ = 0; return this; } public bool HasFormingGames { - get { return result.HasFormingGames; } + get { return result.hasFormingGames; } } public uint FormingGames { get { return result.FormingGames; } set { SetFormingGames(value); } } public Builder SetFormingGames(uint value) { + PrepareBuilder(); result.hasFormingGames = true; result.formingGames_ = value; return this; } public Builder ClearFormingGames() { + PrepareBuilder(); result.hasFormingGames = false; result.formingGames_ = 0; return this; } public bool HasWaitingPlayers { - get { return result.HasWaitingPlayers; } + get { return result.hasWaitingPlayers; } } public uint WaitingPlayers { get { return result.WaitingPlayers; } set { SetWaitingPlayers(value); } } public Builder SetWaitingPlayers(uint value) { + PrepareBuilder(); result.hasWaitingPlayers = true; result.waitingPlayers_ = value; return this; } public Builder ClearWaitingPlayers() { + PrepareBuilder(); result.hasWaitingPlayers = false; result.waitingPlayers_ = 0; return this; @@ -1531,14 +1625,20 @@ static GameStatsBucket() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class GameFactoryDescription : pb::GeneratedMessage { - private static readonly GameFactoryDescription defaultInstance = new Builder().BuildPartial(); + private GameFactoryDescription() { } + private static readonly GameFactoryDescription defaultInstance = new GameFactoryDescription().MakeReadOnly(); + private static readonly string[] _gameFactoryDescriptionFieldNames = new string[] { "attribute", "id", "name", "stats_bucket", "unseeded_id" }; + private static readonly uint[] _gameFactoryDescriptionFieldTags = new uint[] { 26, 9, 18, 34, 41 }; public static GameFactoryDescription DefaultInstance { get { return defaultInstance; } } public override GameFactoryDescription DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override GameFactoryDescription ThisMessage { @@ -1555,7 +1655,7 @@ protected override GameFactoryDescription ThisMessage { public const int IdFieldNumber = 1; private bool hasId; - private ulong id_ = 0; + private ulong id_; public bool HasId { get { return hasId; } } @@ -1597,6 +1697,16 @@ public int StatsBucketCount { return statsBucket_[index]; } + public const int UnseededIdFieldNumber = 5; + private bool hasUnseededId; + private ulong unseededId_; + public bool HasUnseededId { + get { return hasUnseededId; } + } + public ulong UnseededId { + get { return unseededId_; } + } + public override bool IsInitialized { get { if (!hasId) return false; @@ -1607,19 +1717,23 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasId) { - output.WriteFixed64(1, Id); + string[] field_names = _gameFactoryDescriptionFieldNames; + if (hasId) { + output.WriteFixed64(1, field_names[1], Id); + } + if (hasName) { + output.WriteString(2, field_names[2], Name); } - if (HasName) { - output.WriteString(2, Name); + if (attribute_.Count > 0) { + output.WriteMessageArray(3, field_names[0], attribute_); } - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - output.WriteMessage(3, element); + if (statsBucket_.Count > 0) { + output.WriteMessageArray(4, field_names[3], statsBucket_); } - foreach (global::bnet.protocol.game_master.GameStatsBucket element in StatsBucketList) { - output.WriteMessage(4, element); + if (hasUnseededId) { + output.WriteFixed64(5, field_names[4], UnseededId); } UnknownFields.WriteTo(output); } @@ -1631,10 +1745,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasId) { + if (hasId) { size += pb::CodedOutputStream.ComputeFixed64Size(1, Id); } - if (HasName) { + if (hasName) { size += pb::CodedOutputStream.ComputeStringSize(2, Name); } foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { @@ -1643,6 +1757,9 @@ public override int SerializedSize { foreach (global::bnet.protocol.game_master.GameStatsBucket element in StatsBucketList) { size += pb::CodedOutputStream.ComputeMessageSize(4, element); } + if (hasUnseededId) { + size += pb::CodedOutputStream.ComputeFixed64Size(5, UnseededId); + } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; return size; @@ -1673,38 +1790,74 @@ public static GameFactoryDescription ParseDelimitedFrom(global::System.IO.Stream public static GameFactoryDescription ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static GameFactoryDescription ParseFrom(pb::CodedInputStream input) { + public static GameFactoryDescription ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static GameFactoryDescription ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static GameFactoryDescription ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private GameFactoryDescription MakeReadOnly() { + attribute_.MakeReadOnly(); + statsBucket_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(GameFactoryDescription prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GameFactoryDescription cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GameFactoryDescription result; - GameFactoryDescription result = new GameFactoryDescription(); + private GameFactoryDescription PrepareBuilder() { + if (resultIsReadOnly) { + GameFactoryDescription original = result; + result = new GameFactoryDescription(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override GameFactoryDescription MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new GameFactoryDescription(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -1716,14 +1869,11 @@ public override GameFactoryDescription DefaultInstanceForType { } public override GameFactoryDescription BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.attribute_.MakeReadOnly(); - result.statsBucket_.MakeReadOnly(); - GameFactoryDescription returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1737,6 +1887,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(GameFactoryDescription other) { if (other == global::bnet.protocol.game_master.GameFactoryDescription.DefaultInstance) return this; + PrepareBuilder(); if (other.HasId) { Id = other.Id; } @@ -1744,29 +1895,43 @@ public override Builder MergeFrom(GameFactoryDescription other) { Name = other.Name; } if (other.attribute_.Count != 0) { - base.AddRange(other.attribute_, result.attribute_); + result.attribute_.Add(other.attribute_); } if (other.statsBucket_.Count != 0) { - base.AddRange(other.statsBucket_, result.statsBucket_); + result.statsBucket_.Add(other.statsBucket_); + } + if (other.HasUnseededId) { + UnseededId = other.UnseededId; } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_gameFactoryDescriptionFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _gameFactoryDescriptionFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1778,54 +1943,61 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 9: { - Id = input.ReadFixed64(); + result.hasId = input.ReadFixed64(ref result.id_); break; } case 18: { - Name = input.ReadString(); + result.hasName = input.ReadString(ref result.name_); break; } case 26: { - global::bnet.protocol.attribute.Attribute.Builder subBuilder = global::bnet.protocol.attribute.Attribute.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddAttribute(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.attribute_, global::bnet.protocol.attribute.Attribute.DefaultInstance, extensionRegistry); break; } case 34: { - global::bnet.protocol.game_master.GameStatsBucket.Builder subBuilder = global::bnet.protocol.game_master.GameStatsBucket.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddStatsBucket(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.statsBucket_, global::bnet.protocol.game_master.GameStatsBucket.DefaultInstance, extensionRegistry); + break; + } + case 41: { + result.hasUnseededId = input.ReadFixed64(ref result.unseededId_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasId { - get { return result.HasId; } + get { return result.hasId; } } public ulong Id { get { return result.Id; } set { SetId(value); } } public Builder SetId(ulong value) { + PrepareBuilder(); result.hasId = true; result.id_ = value; return this; } public Builder ClearId() { + PrepareBuilder(); result.hasId = false; result.id_ = 0; return this; } public bool HasName { - get { return result.HasName; } + get { return result.hasName; } } public string Name { get { return result.Name; } @@ -1833,18 +2005,20 @@ public string Name { } public Builder SetName(string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasName = true; result.name_ = value; return this; } public Builder ClearName() { + PrepareBuilder(); result.hasName = false; result.name_ = ""; return this; } public pbc::IPopsicleList AttributeList { - get { return result.attribute_; } + get { return PrepareBuilder().attribute_; } } public int AttributeCount { get { return result.AttributeCount; } @@ -1854,35 +2028,41 @@ public int AttributeCount { } public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.attribute_[index] = value; return this; } public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.attribute_[index] = builderForValue.Build(); return this; } public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.attribute_.Add(value); return this; } public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.attribute_.Add(builderForValue.Build()); return this; } public Builder AddRangeAttribute(scg::IEnumerable values) { - base.AddRange(values, result.attribute_); + PrepareBuilder(); + result.attribute_.Add(values); return this; } public Builder ClearAttribute() { + PrepareBuilder(); result.attribute_.Clear(); return this; } public pbc::IPopsicleList StatsBucketList { - get { return result.statsBucket_; } + get { return PrepareBuilder().statsBucket_; } } public int StatsBucketCount { get { return result.StatsBucketCount; } @@ -1892,46 +2072,78 @@ public int StatsBucketCount { } public Builder SetStatsBucket(int index, global::bnet.protocol.game_master.GameStatsBucket value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.statsBucket_[index] = value; return this; } public Builder SetStatsBucket(int index, global::bnet.protocol.game_master.GameStatsBucket.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.statsBucket_[index] = builderForValue.Build(); return this; } public Builder AddStatsBucket(global::bnet.protocol.game_master.GameStatsBucket value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.statsBucket_.Add(value); return this; } public Builder AddStatsBucket(global::bnet.protocol.game_master.GameStatsBucket.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.statsBucket_.Add(builderForValue.Build()); return this; } public Builder AddRangeStatsBucket(scg::IEnumerable values) { - base.AddRange(values, result.statsBucket_); + PrepareBuilder(); + result.statsBucket_.Add(values); return this; } public Builder ClearStatsBucket() { + PrepareBuilder(); result.statsBucket_.Clear(); return this; } + + public bool HasUnseededId { + get { return result.hasUnseededId; } + } + public ulong UnseededId { + get { return result.UnseededId; } + set { SetUnseededId(value); } + } + public Builder SetUnseededId(ulong value) { + PrepareBuilder(); + result.hasUnseededId = true; + result.unseededId_ = value; + return this; + } + public Builder ClearUnseededId() { + PrepareBuilder(); + result.hasUnseededId = false; + result.unseededId_ = 0; + return this; + } } static GameFactoryDescription() { object.ReferenceEquals(global::bnet.protocol.game_master.GameMasterTypes.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class GameHandle : pb::GeneratedMessage { - private static readonly GameHandle defaultInstance = new Builder().BuildPartial(); + private GameHandle() { } + private static readonly GameHandle defaultInstance = new GameHandle().MakeReadOnly(); + private static readonly string[] _gameHandleFieldNames = new string[] { "factory_id", "game_id" }; + private static readonly uint[] _gameHandleFieldTags = new uint[] { 9, 18 }; public static GameHandle DefaultInstance { get { return defaultInstance; } } public override GameHandle DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override GameHandle ThisMessage { @@ -1948,7 +2160,7 @@ protected override GameHandle ThisMessage { public const int FactoryIdFieldNumber = 1; private bool hasFactoryId; - private ulong factoryId_ = 0; + private ulong factoryId_; public bool HasFactoryId { get { return hasFactoryId; } } @@ -1958,12 +2170,12 @@ public ulong FactoryId { public const int GameIdFieldNumber = 2; private bool hasGameId; - private global::bnet.protocol.EntityId gameId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId gameId_; public bool HasGameId { get { return hasGameId; } } public global::bnet.protocol.EntityId GameId { - get { return gameId_; } + get { return gameId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public override bool IsInitialized { @@ -1975,13 +2187,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasFactoryId) { - output.WriteFixed64(1, FactoryId); + string[] field_names = _gameHandleFieldNames; + if (hasFactoryId) { + output.WriteFixed64(1, field_names[0], FactoryId); } - if (HasGameId) { - output.WriteMessage(2, GameId); + if (hasGameId) { + output.WriteMessage(2, field_names[1], GameId); } UnknownFields.WriteTo(output); } @@ -1993,10 +2206,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasFactoryId) { + if (hasFactoryId) { size += pb::CodedOutputStream.ComputeFixed64Size(1, FactoryId); } - if (HasGameId) { + if (hasGameId) { size += pb::CodedOutputStream.ComputeMessageSize(2, GameId); } size += UnknownFields.SerializedSize; @@ -2029,38 +2242,72 @@ public static GameHandle ParseDelimitedFrom(global::System.IO.Stream input) { public static GameHandle ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static GameHandle ParseFrom(pb::CodedInputStream input) { + public static GameHandle ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static GameHandle ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static GameHandle ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private GameHandle MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(GameHandle prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GameHandle cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - GameHandle result = new GameHandle(); + private bool resultIsReadOnly; + private GameHandle result; + + private GameHandle PrepareBuilder() { + if (resultIsReadOnly) { + GameHandle original = result; + result = new GameHandle(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override GameHandle MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new GameHandle(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -2072,12 +2319,11 @@ public override GameHandle DefaultInstanceForType { } public override GameHandle BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - GameHandle returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2091,6 +2337,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(GameHandle other) { if (other == global::bnet.protocol.game_master.GameHandle.DefaultInstance) return this; + PrepareBuilder(); if (other.HasFactoryId) { FactoryId = other.FactoryId; } @@ -2101,20 +2348,31 @@ public override Builder MergeFrom(GameHandle other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_gameHandleFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _gameHandleFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -2126,16 +2384,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 9: { - FactoryId = input.ReadFixed64(); + result.hasFactoryId = input.ReadFixed64(ref result.factoryId_); break; } case 18: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasGameId) { + if (result.hasGameId) { subBuilder.MergeFrom(GameId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2144,29 +2402,36 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasFactoryId { - get { return result.HasFactoryId; } + get { return result.hasFactoryId; } } public ulong FactoryId { get { return result.FactoryId; } set { SetFactoryId(value); } } public Builder SetFactoryId(ulong value) { + PrepareBuilder(); result.hasFactoryId = true; result.factoryId_ = value; return this; } public Builder ClearFactoryId() { + PrepareBuilder(); result.hasFactoryId = false; result.factoryId_ = 0; return this; } public bool HasGameId { - get { return result.HasGameId; } + get { return result.hasGameId; } } public global::bnet.protocol.EntityId GameId { get { return result.GameId; } @@ -2174,19 +2439,22 @@ public bool HasGameId { } public Builder SetGameId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasGameId = true; result.gameId_ = value; return this; } public Builder SetGameId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasGameId = true; result.gameId_ = builderForValue.Build(); return this; } public Builder MergeGameId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasGameId && + PrepareBuilder(); + if (result.hasGameId && result.gameId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.gameId_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameId_).MergeFrom(value).BuildPartial(); } else { @@ -2196,8 +2464,9 @@ public Builder MergeGameId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearGameId() { + PrepareBuilder(); result.hasGameId = false; - result.gameId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.gameId_ = null; return this; } } @@ -2206,6 +2475,399 @@ static GameHandle() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class CancelGameEntryRequest : pb::GeneratedMessage { + private CancelGameEntryRequest() { } + private static readonly CancelGameEntryRequest defaultInstance = new CancelGameEntryRequest().MakeReadOnly(); + private static readonly string[] _cancelGameEntryRequestFieldNames = new string[] { "factory_id", "player", "request_id" }; + private static readonly uint[] _cancelGameEntryRequestFieldTags = new uint[] { 17, 26, 9 }; + public static CancelGameEntryRequest DefaultInstance { + get { return defaultInstance; } + } + + public override CancelGameEntryRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override CancelGameEntryRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.game_master.GameMasterTypes.internal__static_bnet_protocol_game_master_CancelGameEntryRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.game_master.GameMasterTypes.internal__static_bnet_protocol_game_master_CancelGameEntryRequest__FieldAccessorTable; } + } + + public const int RequestIdFieldNumber = 1; + private bool hasRequestId; + private ulong requestId_; + public bool HasRequestId { + get { return hasRequestId; } + } + public ulong RequestId { + get { return requestId_; } + } + + public const int FactoryIdFieldNumber = 2; + private bool hasFactoryId; + private ulong factoryId_; + public bool HasFactoryId { + get { return hasFactoryId; } + } + public ulong FactoryId { + get { return factoryId_; } + } + + public const int PlayerFieldNumber = 3; + private pbc::PopsicleList player_ = new pbc::PopsicleList(); + public scg::IList PlayerList { + get { return player_; } + } + public int PlayerCount { + get { return player_.Count; } + } + public global::bnet.protocol.game_master.Player GetPlayer(int index) { + return player_[index]; + } + + public override bool IsInitialized { + get { + if (!hasRequestId) return false; + foreach (global::bnet.protocol.game_master.Player element in PlayerList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _cancelGameEntryRequestFieldNames; + if (hasRequestId) { + output.WriteFixed64(1, field_names[2], RequestId); + } + if (hasFactoryId) { + output.WriteFixed64(2, field_names[0], FactoryId); + } + if (player_.Count > 0) { + output.WriteMessageArray(3, field_names[1], player_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasRequestId) { + size += pb::CodedOutputStream.ComputeFixed64Size(1, RequestId); + } + if (hasFactoryId) { + size += pb::CodedOutputStream.ComputeFixed64Size(2, FactoryId); + } + foreach (global::bnet.protocol.game_master.Player element in PlayerList) { + size += pb::CodedOutputStream.ComputeMessageSize(3, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static CancelGameEntryRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CancelGameEntryRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CancelGameEntryRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CancelGameEntryRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CancelGameEntryRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CancelGameEntryRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static CancelGameEntryRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static CancelGameEntryRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static CancelGameEntryRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CancelGameEntryRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CancelGameEntryRequest MakeReadOnly() { + player_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(CancelGameEntryRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CancelGameEntryRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CancelGameEntryRequest result; + + private CancelGameEntryRequest PrepareBuilder() { + if (resultIsReadOnly) { + CancelGameEntryRequest original = result; + result = new CancelGameEntryRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CancelGameEntryRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.game_master.CancelGameEntryRequest.Descriptor; } + } + + public override CancelGameEntryRequest DefaultInstanceForType { + get { return global::bnet.protocol.game_master.CancelGameEntryRequest.DefaultInstance; } + } + + public override CancelGameEntryRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is CancelGameEntryRequest) { + return MergeFrom((CancelGameEntryRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(CancelGameEntryRequest other) { + if (other == global::bnet.protocol.game_master.CancelGameEntryRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasRequestId) { + RequestId = other.RequestId; + } + if (other.HasFactoryId) { + FactoryId = other.FactoryId; + } + if (other.player_.Count != 0) { + result.player_.Add(other.player_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_cancelGameEntryRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _cancelGameEntryRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 9: { + result.hasRequestId = input.ReadFixed64(ref result.requestId_); + break; + } + case 17: { + result.hasFactoryId = input.ReadFixed64(ref result.factoryId_); + break; + } + case 26: { + input.ReadMessageArray(tag, field_name, result.player_, global::bnet.protocol.game_master.Player.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasRequestId { + get { return result.hasRequestId; } + } + public ulong RequestId { + get { return result.RequestId; } + set { SetRequestId(value); } + } + public Builder SetRequestId(ulong value) { + PrepareBuilder(); + result.hasRequestId = true; + result.requestId_ = value; + return this; + } + public Builder ClearRequestId() { + PrepareBuilder(); + result.hasRequestId = false; + result.requestId_ = 0; + return this; + } + + public bool HasFactoryId { + get { return result.hasFactoryId; } + } + public ulong FactoryId { + get { return result.FactoryId; } + set { SetFactoryId(value); } + } + public Builder SetFactoryId(ulong value) { + PrepareBuilder(); + result.hasFactoryId = true; + result.factoryId_ = value; + return this; + } + public Builder ClearFactoryId() { + PrepareBuilder(); + result.hasFactoryId = false; + result.factoryId_ = 0; + return this; + } + + public pbc::IPopsicleList PlayerList { + get { return PrepareBuilder().player_; } + } + public int PlayerCount { + get { return result.PlayerCount; } + } + public global::bnet.protocol.game_master.Player GetPlayer(int index) { + return result.GetPlayer(index); + } + public Builder SetPlayer(int index, global::bnet.protocol.game_master.Player value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.player_[index] = value; + return this; + } + public Builder SetPlayer(int index, global::bnet.protocol.game_master.Player.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.player_[index] = builderForValue.Build(); + return this; + } + public Builder AddPlayer(global::bnet.protocol.game_master.Player value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.player_.Add(value); + return this; + } + public Builder AddPlayer(global::bnet.protocol.game_master.Player.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.player_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangePlayer(scg::IEnumerable values) { + PrepareBuilder(); + result.player_.Add(values); + return this; + } + public Builder ClearPlayer() { + PrepareBuilder(); + result.player_.Clear(); + return this; + } + } + static CancelGameEntryRequest() { + object.ReferenceEquals(global::bnet.protocol.game_master.GameMasterTypes.Descriptor, null); + } + } + #endregion } + +#endregion Designer generated code diff --git a/src/LibMooNet/bnet/protocol/game_utilities/GameUtilitiesService.cs b/src/LibMooNet/bnet/protocol/game_utilities/GameUtilitiesService.cs new file mode 100644 index 00000000..8da8c0b9 --- /dev/null +++ b/src/LibMooNet/bnet/protocol/game_utilities/GameUtilitiesService.cs @@ -0,0 +1,4461 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace bnet.protocol.game_utilities { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class GameUtilitiesService { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_utilities_ClientRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_utilities_ClientRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_utilities_ClientResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_utilities_ClientResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_utilities_ServerRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_utilities_ServerRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_utilities_ServerResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_utilities_ServerResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_utilities_PresenceChannelCreatedRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_utilities_PresenceChannelCreatedRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_utilities_PlayerVariablesRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_utilities_PlayerVariablesRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_utilities_GameVariablesRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_utilities_GameVariablesRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_utilities_VariablesResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_utilities_VariablesResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_utilities_GameAccountOnlineNotification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_utilities_GameAccountOnlineNotification__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_game_utilities_GameAccountOfflineNotification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_game_utilities_GameAccountOfflineNotification__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static GameUtilitiesService() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "CiFibmV0L2dhbWVfdXRpbGl0aWVzX3NlcnZpY2UucHJvdG8SHGJuZXQucHJv" + + "dG9jb2wuZ2FtZV91dGlsaXRpZXMaHmJuZXQvZ2FtZV9tYXN0ZXJfc2Vydmlj" + + "ZS5wcm90bxoeYm5ldC9zZXJ2ZXJfcG9vbF9zZXJ2aWNlLnByb3RvGhRibmV0" + + "L2F0dHJpYnV0ZS5wcm90bxoRYm5ldC9lbnRpdHkucHJvdG8aDmJuZXQvcnBj" + + "LnByb3RvItIBCg1DbGllbnRSZXF1ZXN0EjUKCWF0dHJpYnV0ZRgBIAMoCzIi" + + "LmJuZXQucHJvdG9jb2wuYXR0cmlidXRlLkF0dHJpYnV0ZRImCgRob3N0GAIg" + + "ASgLMhguYm5ldC5wcm90b2NvbC5Qcm9jZXNzSWQSMAoPYm5ldF9hY2NvdW50" + + "X2lkGAMgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBIwCg9nYW1lX2Fj" + + "Y291bnRfaWQYBCABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkIkcKDkNs" + + "aWVudFJlc3BvbnNlEjUKCWF0dHJpYnV0ZRgBIAMoCzIiLmJuZXQucHJvdG9j" + + "b2wuYXR0cmlidXRlLkF0dHJpYnV0ZSJ/Cg1TZXJ2ZXJSZXF1ZXN0EjUKCWF0" + + "dHJpYnV0ZRgBIAMoCzIiLmJuZXQucHJvdG9jb2wuYXR0cmlidXRlLkF0dHJp" + + "YnV0ZRIPCgdwcm9ncmFtGAIgAigHEiYKBGhvc3QYAyABKAsyGC5ibmV0LnBy" + + "b3RvY29sLlByb2Nlc3NJZCJHCg5TZXJ2ZXJSZXNwb25zZRI1CglhdHRyaWJ1" + + "dGUYASADKAsyIi5ibmV0LnByb3RvY29sLmF0dHJpYnV0ZS5BdHRyaWJ1dGUi" + + "0AEKHVByZXNlbmNlQ2hhbm5lbENyZWF0ZWRSZXF1ZXN0EiMKAmlkGAEgAigL" + + "MhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBIwCg9nYW1lX2FjY291bnRfaWQY" + + "AyABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEjAKD2JuZXRfYWNjb3Vu" + + "dF9pZBgEIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSJgoEaG9zdBgF" + + "IAEoCzIYLmJuZXQucHJvdG9jb2wuUHJvY2Vzc0lkIrYBChZQbGF5ZXJWYXJp" + + "YWJsZXNSZXF1ZXN0EjAKD2JuZXRfYWNjb3VudF9pZBgBIAIoCzIXLmJuZXQu" + + "cHJvdG9jb2wuRW50aXR5SWQSMAoPZ2FtZV9hY2NvdW50X2lkGAIgAigLMhcu" + + "Ym5ldC5wcm90b2NvbC5FbnRpdHlJZBIQCgh2YXJpYWJsZRgEIAMoCRImCgRo" + + "b3N0GAUgASgLMhguYm5ldC5wcm90b2NvbC5Qcm9jZXNzSWQihwEKFEdhbWVW" + + "YXJpYWJsZXNSZXF1ZXN0EjUKCWF0dHJpYnV0ZRgBIAMoCzIiLmJuZXQucHJv" + + "dG9jb2wuYXR0cmlidXRlLkF0dHJpYnV0ZRIQCgh2YXJpYWJsZRgCIAMoCRIm" + + "CgRob3N0GAMgASgLMhguYm5ldC5wcm90b2NvbC5Qcm9jZXNzSWQiJgoRVmFy" + + "aWFibGVzUmVzcG9uc2USEQoFdmFsdWUYASADKAJCAhABInkKHUdhbWVBY2Nv" + + "dW50T25saW5lTm90aWZpY2F0aW9uEjAKD2dhbWVfYWNjb3VudF9pZBgBIAIo" + + "CzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSJgoEaG9zdBgCIAEoCzIYLmJu" + + "ZXQucHJvdG9jb2wuUHJvY2Vzc0lkInoKHkdhbWVBY2NvdW50T2ZmbGluZU5v" + + "dGlmaWNhdGlvbhIwCg9nYW1lX2FjY291bnRfaWQYASACKAsyFy5ibmV0LnBy" + + "b3RvY29sLkVudGl0eUlkEiYKBGhvc3QYAiABKAsyGC5ibmV0LnByb3RvY29s" + + "LlByb2Nlc3NJZDLSBwoNR2FtZVV0aWxpdGllcxJ3ChRQcm9jZXNzQ2xpZW50" + + "UmVxdWVzdBIrLmJuZXQucHJvdG9jb2wuZ2FtZV91dGlsaXRpZXMuQ2xpZW50" + + "UmVxdWVzdBosLmJuZXQucHJvdG9jb2wuZ2FtZV91dGlsaXRpZXMuQ2xpZW50" + + "UmVzcG9uc2UiBIC1GAEScgoWUHJlc2VuY2VDaGFubmVsQ3JlYXRlZBI7LmJu" + + "ZXQucHJvdG9jb2wuZ2FtZV91dGlsaXRpZXMuUHJlc2VuY2VDaGFubmVsQ3Jl" + + "YXRlZFJlcXVlc3QaFS5ibmV0LnByb3RvY29sLk5vRGF0YSIEgLUYAhKBAQoS" + + "R2V0UGxheWVyVmFyaWFibGVzEjQuYm5ldC5wcm90b2NvbC5nYW1lX3V0aWxp" + + "dGllcy5QbGF5ZXJWYXJpYWJsZXNSZXF1ZXN0Gi8uYm5ldC5wcm90b2NvbC5n" + + "YW1lX3V0aWxpdGllcy5WYXJpYWJsZXNSZXNwb25zZSIEgLUYAxJ9ChBHZXRH" + + "YW1lVmFyaWFibGVzEjIuYm5ldC5wcm90b2NvbC5nYW1lX3V0aWxpdGllcy5H" + + "YW1lVmFyaWFibGVzUmVxdWVzdBovLmJuZXQucHJvdG9jb2wuZ2FtZV91dGls" + + "aXRpZXMuVmFyaWFibGVzUmVzcG9uc2UiBIC1GAQSYgoHR2V0TG9hZBIpLmJu" + + "ZXQucHJvdG9jb2wuc2VydmVyX3Bvb2wuR2V0TG9hZFJlcXVlc3QaJi5ibmV0" + + "LnByb3RvY29sLnNlcnZlcl9wb29sLlNlcnZlclN0YXRlIgSAtRgFEncKFFBy" + + "b2Nlc3NTZXJ2ZXJSZXF1ZXN0EisuYm5ldC5wcm90b2NvbC5nYW1lX3V0aWxp" + + "dGllcy5TZXJ2ZXJSZXF1ZXN0GiwuYm5ldC5wcm90b2NvbC5nYW1lX3V0aWxp" + + "dGllcy5TZXJ2ZXJSZXNwb25zZSIEgLUYBhJ4ChdOb3RpZnlHYW1lQWNjb3Vu" + + "dE9ubGluZRI7LmJuZXQucHJvdG9jb2wuZ2FtZV91dGlsaXRpZXMuR2FtZUFj" + + "Y291bnRPbmxpbmVOb3RpZmljYXRpb24aGi5ibmV0LnByb3RvY29sLk5PX1JF" + + "U1BPTlNFIgSAtRgHEnoKGE5vdGlmeUdhbWVBY2NvdW50T2ZmbGluZRI8LmJu" + + "ZXQucHJvdG9jb2wuZ2FtZV91dGlsaXRpZXMuR2FtZUFjY291bnRPZmZsaW5l" + + "Tm90aWZpY2F0aW9uGhouYm5ldC5wcm90b2NvbC5OT19SRVNQT05TRSIEgLUY" + + "CEIDgAEA"); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_bnet_protocol_game_utilities_ClientRequest__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_game_utilities_ClientRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_utilities_ClientRequest__Descriptor, + new string[] { "Attribute", "Host", "BnetAccountId", "GameAccountId", }); + internal__static_bnet_protocol_game_utilities_ClientResponse__Descriptor = Descriptor.MessageTypes[1]; + internal__static_bnet_protocol_game_utilities_ClientResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_utilities_ClientResponse__Descriptor, + new string[] { "Attribute", }); + internal__static_bnet_protocol_game_utilities_ServerRequest__Descriptor = Descriptor.MessageTypes[2]; + internal__static_bnet_protocol_game_utilities_ServerRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_utilities_ServerRequest__Descriptor, + new string[] { "Attribute", "Program", "Host", }); + internal__static_bnet_protocol_game_utilities_ServerResponse__Descriptor = Descriptor.MessageTypes[3]; + internal__static_bnet_protocol_game_utilities_ServerResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_utilities_ServerResponse__Descriptor, + new string[] { "Attribute", }); + internal__static_bnet_protocol_game_utilities_PresenceChannelCreatedRequest__Descriptor = Descriptor.MessageTypes[4]; + internal__static_bnet_protocol_game_utilities_PresenceChannelCreatedRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_utilities_PresenceChannelCreatedRequest__Descriptor, + new string[] { "Id", "GameAccountId", "BnetAccountId", "Host", }); + internal__static_bnet_protocol_game_utilities_PlayerVariablesRequest__Descriptor = Descriptor.MessageTypes[5]; + internal__static_bnet_protocol_game_utilities_PlayerVariablesRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_utilities_PlayerVariablesRequest__Descriptor, + new string[] { "BnetAccountId", "GameAccountId", "Variable", "Host", }); + internal__static_bnet_protocol_game_utilities_GameVariablesRequest__Descriptor = Descriptor.MessageTypes[6]; + internal__static_bnet_protocol_game_utilities_GameVariablesRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_utilities_GameVariablesRequest__Descriptor, + new string[] { "Attribute", "Variable", "Host", }); + internal__static_bnet_protocol_game_utilities_VariablesResponse__Descriptor = Descriptor.MessageTypes[7]; + internal__static_bnet_protocol_game_utilities_VariablesResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_utilities_VariablesResponse__Descriptor, + new string[] { "Value", }); + internal__static_bnet_protocol_game_utilities_GameAccountOnlineNotification__Descriptor = Descriptor.MessageTypes[8]; + internal__static_bnet_protocol_game_utilities_GameAccountOnlineNotification__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_utilities_GameAccountOnlineNotification__Descriptor, + new string[] { "GameAccountId", "Host", }); + internal__static_bnet_protocol_game_utilities_GameAccountOfflineNotification__Descriptor = Descriptor.MessageTypes[9]; + internal__static_bnet_protocol_game_utilities_GameAccountOfflineNotification__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_game_utilities_GameAccountOfflineNotification__Descriptor, + new string[] { "GameAccountId", "Host", }); + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + RegisterAllExtensions(registry); + global::bnet.protocol.game_master.GameMasterService.RegisterAllExtensions(registry); + global::bnet.protocol.server_pool.Proto.ServerPoolService.RegisterAllExtensions(registry); + global::bnet.protocol.attribute.Proto.Attribute.RegisterAllExtensions(registry); + global::bnet.protocol.Entity.RegisterAllExtensions(registry); + global::bnet.protocol.Rpc.RegisterAllExtensions(registry); + return registry; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::bnet.protocol.game_master.GameMasterService.Descriptor, + global::bnet.protocol.server_pool.Proto.ServerPoolService.Descriptor, + global::bnet.protocol.attribute.Proto.Attribute.Descriptor, + global::bnet.protocol.Entity.Descriptor, + global::bnet.protocol.Rpc.Descriptor, + }, assigner); + } + #endregion + + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ClientRequest : pb::GeneratedMessage { + private ClientRequest() { } + private static readonly ClientRequest defaultInstance = new ClientRequest().MakeReadOnly(); + private static readonly string[] _clientRequestFieldNames = new string[] { "attribute", "bnet_account_id", "game_account_id", "host" }; + private static readonly uint[] _clientRequestFieldTags = new uint[] { 10, 26, 34, 18 }; + public static ClientRequest DefaultInstance { + get { return defaultInstance; } + } + + public override ClientRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ClientRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.game_utilities.GameUtilitiesService.internal__static_bnet_protocol_game_utilities_ClientRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.game_utilities.GameUtilitiesService.internal__static_bnet_protocol_game_utilities_ClientRequest__FieldAccessorTable; } + } + + public const int AttributeFieldNumber = 1; + private pbc::PopsicleList attribute_ = new pbc::PopsicleList(); + public scg::IList AttributeList { + get { return attribute_; } + } + public int AttributeCount { + get { return attribute_.Count; } + } + public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { + return attribute_[index]; + } + + public const int HostFieldNumber = 2; + private bool hasHost; + private global::bnet.protocol.ProcessId host_; + public bool HasHost { + get { return hasHost; } + } + public global::bnet.protocol.ProcessId Host { + get { return host_ ?? global::bnet.protocol.ProcessId.DefaultInstance; } + } + + public const int BnetAccountIdFieldNumber = 3; + private bool hasBnetAccountId; + private global::bnet.protocol.EntityId bnetAccountId_; + public bool HasBnetAccountId { + get { return hasBnetAccountId; } + } + public global::bnet.protocol.EntityId BnetAccountId { + get { return bnetAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int GameAccountIdFieldNumber = 4; + private bool hasGameAccountId; + private global::bnet.protocol.EntityId gameAccountId_; + public bool HasGameAccountId { + get { return hasGameAccountId; } + } + public global::bnet.protocol.EntityId GameAccountId { + get { return gameAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { + if (!element.IsInitialized) return false; + } + if (HasHost) { + if (!Host.IsInitialized) return false; + } + if (HasBnetAccountId) { + if (!BnetAccountId.IsInitialized) return false; + } + if (HasGameAccountId) { + if (!GameAccountId.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _clientRequestFieldNames; + if (attribute_.Count > 0) { + output.WriteMessageArray(1, field_names[0], attribute_); + } + if (hasHost) { + output.WriteMessage(2, field_names[3], Host); + } + if (hasBnetAccountId) { + output.WriteMessage(3, field_names[1], BnetAccountId); + } + if (hasGameAccountId) { + output.WriteMessage(4, field_names[2], GameAccountId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + if (hasHost) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Host); + } + if (hasBnetAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(3, BnetAccountId); + } + if (hasGameAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(4, GameAccountId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ClientRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ClientRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ClientRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ClientRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ClientRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ClientRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ClientRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ClientRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ClientRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ClientRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ClientRequest MakeReadOnly() { + attribute_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ClientRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ClientRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ClientRequest result; + + private ClientRequest PrepareBuilder() { + if (resultIsReadOnly) { + ClientRequest original = result; + result = new ClientRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ClientRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.game_utilities.ClientRequest.Descriptor; } + } + + public override ClientRequest DefaultInstanceForType { + get { return global::bnet.protocol.game_utilities.ClientRequest.DefaultInstance; } + } + + public override ClientRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ClientRequest) { + return MergeFrom((ClientRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ClientRequest other) { + if (other == global::bnet.protocol.game_utilities.ClientRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.attribute_.Count != 0) { + result.attribute_.Add(other.attribute_); + } + if (other.HasHost) { + MergeHost(other.Host); + } + if (other.HasBnetAccountId) { + MergeBnetAccountId(other.BnetAccountId); + } + if (other.HasGameAccountId) { + MergeGameAccountId(other.GameAccountId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_clientRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _clientRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.attribute_, global::bnet.protocol.attribute.Attribute.DefaultInstance, extensionRegistry); + break; + } + case 18: { + global::bnet.protocol.ProcessId.Builder subBuilder = global::bnet.protocol.ProcessId.CreateBuilder(); + if (result.hasHost) { + subBuilder.MergeFrom(Host); + } + input.ReadMessage(subBuilder, extensionRegistry); + Host = subBuilder.BuildPartial(); + break; + } + case 26: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasBnetAccountId) { + subBuilder.MergeFrom(BnetAccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + BnetAccountId = subBuilder.BuildPartial(); + break; + } + case 34: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasGameAccountId) { + subBuilder.MergeFrom(GameAccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + GameAccountId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList AttributeList { + get { return PrepareBuilder().attribute_; } + } + public int AttributeCount { + get { return result.AttributeCount; } + } + public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { + return result.GetAttribute(index); + } + public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.attribute_[index] = value; + return this; + } + public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.attribute_[index] = builderForValue.Build(); + return this; + } + public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.attribute_.Add(value); + return this; + } + public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.attribute_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeAttribute(scg::IEnumerable values) { + PrepareBuilder(); + result.attribute_.Add(values); + return this; + } + public Builder ClearAttribute() { + PrepareBuilder(); + result.attribute_.Clear(); + return this; + } + + public bool HasHost { + get { return result.hasHost; } + } + public global::bnet.protocol.ProcessId Host { + get { return result.Host; } + set { SetHost(value); } + } + public Builder SetHost(global::bnet.protocol.ProcessId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasHost = true; + result.host_ = value; + return this; + } + public Builder SetHost(global::bnet.protocol.ProcessId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasHost = true; + result.host_ = builderForValue.Build(); + return this; + } + public Builder MergeHost(global::bnet.protocol.ProcessId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasHost && + result.host_ != global::bnet.protocol.ProcessId.DefaultInstance) { + result.host_ = global::bnet.protocol.ProcessId.CreateBuilder(result.host_).MergeFrom(value).BuildPartial(); + } else { + result.host_ = value; + } + result.hasHost = true; + return this; + } + public Builder ClearHost() { + PrepareBuilder(); + result.hasHost = false; + result.host_ = null; + return this; + } + + public bool HasBnetAccountId { + get { return result.hasBnetAccountId; } + } + public global::bnet.protocol.EntityId BnetAccountId { + get { return result.BnetAccountId; } + set { SetBnetAccountId(value); } + } + public Builder SetBnetAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBnetAccountId = true; + result.bnetAccountId_ = value; + return this; + } + public Builder SetBnetAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBnetAccountId = true; + result.bnetAccountId_ = builderForValue.Build(); + return this; + } + public Builder MergeBnetAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBnetAccountId && + result.bnetAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.bnetAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccountId_).MergeFrom(value).BuildPartial(); + } else { + result.bnetAccountId_ = value; + } + result.hasBnetAccountId = true; + return this; + } + public Builder ClearBnetAccountId() { + PrepareBuilder(); + result.hasBnetAccountId = false; + result.bnetAccountId_ = null; + return this; + } + + public bool HasGameAccountId { + get { return result.hasGameAccountId; } + } + public global::bnet.protocol.EntityId GameAccountId { + get { return result.GameAccountId; } + set { SetGameAccountId(value); } + } + public Builder SetGameAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasGameAccountId = true; + result.gameAccountId_ = value; + return this; + } + public Builder SetGameAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasGameAccountId = true; + result.gameAccountId_ = builderForValue.Build(); + return this; + } + public Builder MergeGameAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasGameAccountId && + result.gameAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.gameAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccountId_).MergeFrom(value).BuildPartial(); + } else { + result.gameAccountId_ = value; + } + result.hasGameAccountId = true; + return this; + } + public Builder ClearGameAccountId() { + PrepareBuilder(); + result.hasGameAccountId = false; + result.gameAccountId_ = null; + return this; + } + } + static ClientRequest() { + object.ReferenceEquals(global::bnet.protocol.game_utilities.GameUtilitiesService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ClientResponse : pb::GeneratedMessage { + private ClientResponse() { } + private static readonly ClientResponse defaultInstance = new ClientResponse().MakeReadOnly(); + private static readonly string[] _clientResponseFieldNames = new string[] { "attribute" }; + private static readonly uint[] _clientResponseFieldTags = new uint[] { 10 }; + public static ClientResponse DefaultInstance { + get { return defaultInstance; } + } + + public override ClientResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ClientResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.game_utilities.GameUtilitiesService.internal__static_bnet_protocol_game_utilities_ClientResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.game_utilities.GameUtilitiesService.internal__static_bnet_protocol_game_utilities_ClientResponse__FieldAccessorTable; } + } + + public const int AttributeFieldNumber = 1; + private pbc::PopsicleList attribute_ = new pbc::PopsicleList(); + public scg::IList AttributeList { + get { return attribute_; } + } + public int AttributeCount { + get { return attribute_.Count; } + } + public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { + return attribute_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _clientResponseFieldNames; + if (attribute_.Count > 0) { + output.WriteMessageArray(1, field_names[0], attribute_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ClientResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ClientResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ClientResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ClientResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ClientResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ClientResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ClientResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ClientResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ClientResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ClientResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ClientResponse MakeReadOnly() { + attribute_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ClientResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ClientResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ClientResponse result; + + private ClientResponse PrepareBuilder() { + if (resultIsReadOnly) { + ClientResponse original = result; + result = new ClientResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ClientResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.game_utilities.ClientResponse.Descriptor; } + } + + public override ClientResponse DefaultInstanceForType { + get { return global::bnet.protocol.game_utilities.ClientResponse.DefaultInstance; } + } + + public override ClientResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ClientResponse) { + return MergeFrom((ClientResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ClientResponse other) { + if (other == global::bnet.protocol.game_utilities.ClientResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.attribute_.Count != 0) { + result.attribute_.Add(other.attribute_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_clientResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _clientResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.attribute_, global::bnet.protocol.attribute.Attribute.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList AttributeList { + get { return PrepareBuilder().attribute_; } + } + public int AttributeCount { + get { return result.AttributeCount; } + } + public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { + return result.GetAttribute(index); + } + public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.attribute_[index] = value; + return this; + } + public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.attribute_[index] = builderForValue.Build(); + return this; + } + public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.attribute_.Add(value); + return this; + } + public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.attribute_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeAttribute(scg::IEnumerable values) { + PrepareBuilder(); + result.attribute_.Add(values); + return this; + } + public Builder ClearAttribute() { + PrepareBuilder(); + result.attribute_.Clear(); + return this; + } + } + static ClientResponse() { + object.ReferenceEquals(global::bnet.protocol.game_utilities.GameUtilitiesService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ServerRequest : pb::GeneratedMessage { + private ServerRequest() { } + private static readonly ServerRequest defaultInstance = new ServerRequest().MakeReadOnly(); + private static readonly string[] _serverRequestFieldNames = new string[] { "attribute", "host", "program" }; + private static readonly uint[] _serverRequestFieldTags = new uint[] { 10, 26, 21 }; + public static ServerRequest DefaultInstance { + get { return defaultInstance; } + } + + public override ServerRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ServerRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.game_utilities.GameUtilitiesService.internal__static_bnet_protocol_game_utilities_ServerRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.game_utilities.GameUtilitiesService.internal__static_bnet_protocol_game_utilities_ServerRequest__FieldAccessorTable; } + } + + public const int AttributeFieldNumber = 1; + private pbc::PopsicleList attribute_ = new pbc::PopsicleList(); + public scg::IList AttributeList { + get { return attribute_; } + } + public int AttributeCount { + get { return attribute_.Count; } + } + public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { + return attribute_[index]; + } + + public const int ProgramFieldNumber = 2; + private bool hasProgram; + private uint program_; + public bool HasProgram { + get { return hasProgram; } + } + public uint Program { + get { return program_; } + } + + public const int HostFieldNumber = 3; + private bool hasHost; + private global::bnet.protocol.ProcessId host_; + public bool HasHost { + get { return hasHost; } + } + public global::bnet.protocol.ProcessId Host { + get { return host_ ?? global::bnet.protocol.ProcessId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasProgram) return false; + foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { + if (!element.IsInitialized) return false; + } + if (HasHost) { + if (!Host.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _serverRequestFieldNames; + if (attribute_.Count > 0) { + output.WriteMessageArray(1, field_names[0], attribute_); + } + if (hasProgram) { + output.WriteFixed32(2, field_names[2], Program); + } + if (hasHost) { + output.WriteMessage(3, field_names[1], Host); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + if (hasProgram) { + size += pb::CodedOutputStream.ComputeFixed32Size(2, Program); + } + if (hasHost) { + size += pb::CodedOutputStream.ComputeMessageSize(3, Host); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ServerRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ServerRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ServerRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ServerRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ServerRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ServerRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ServerRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ServerRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ServerRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ServerRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ServerRequest MakeReadOnly() { + attribute_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ServerRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ServerRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ServerRequest result; + + private ServerRequest PrepareBuilder() { + if (resultIsReadOnly) { + ServerRequest original = result; + result = new ServerRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ServerRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.game_utilities.ServerRequest.Descriptor; } + } + + public override ServerRequest DefaultInstanceForType { + get { return global::bnet.protocol.game_utilities.ServerRequest.DefaultInstance; } + } + + public override ServerRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ServerRequest) { + return MergeFrom((ServerRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ServerRequest other) { + if (other == global::bnet.protocol.game_utilities.ServerRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.attribute_.Count != 0) { + result.attribute_.Add(other.attribute_); + } + if (other.HasProgram) { + Program = other.Program; + } + if (other.HasHost) { + MergeHost(other.Host); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_serverRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _serverRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.attribute_, global::bnet.protocol.attribute.Attribute.DefaultInstance, extensionRegistry); + break; + } + case 21: { + result.hasProgram = input.ReadFixed32(ref result.program_); + break; + } + case 26: { + global::bnet.protocol.ProcessId.Builder subBuilder = global::bnet.protocol.ProcessId.CreateBuilder(); + if (result.hasHost) { + subBuilder.MergeFrom(Host); + } + input.ReadMessage(subBuilder, extensionRegistry); + Host = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList AttributeList { + get { return PrepareBuilder().attribute_; } + } + public int AttributeCount { + get { return result.AttributeCount; } + } + public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { + return result.GetAttribute(index); + } + public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.attribute_[index] = value; + return this; + } + public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.attribute_[index] = builderForValue.Build(); + return this; + } + public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.attribute_.Add(value); + return this; + } + public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.attribute_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeAttribute(scg::IEnumerable values) { + PrepareBuilder(); + result.attribute_.Add(values); + return this; + } + public Builder ClearAttribute() { + PrepareBuilder(); + result.attribute_.Clear(); + return this; + } + + public bool HasProgram { + get { return result.hasProgram; } + } + public uint Program { + get { return result.Program; } + set { SetProgram(value); } + } + public Builder SetProgram(uint value) { + PrepareBuilder(); + result.hasProgram = true; + result.program_ = value; + return this; + } + public Builder ClearProgram() { + PrepareBuilder(); + result.hasProgram = false; + result.program_ = 0; + return this; + } + + public bool HasHost { + get { return result.hasHost; } + } + public global::bnet.protocol.ProcessId Host { + get { return result.Host; } + set { SetHost(value); } + } + public Builder SetHost(global::bnet.protocol.ProcessId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasHost = true; + result.host_ = value; + return this; + } + public Builder SetHost(global::bnet.protocol.ProcessId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasHost = true; + result.host_ = builderForValue.Build(); + return this; + } + public Builder MergeHost(global::bnet.protocol.ProcessId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasHost && + result.host_ != global::bnet.protocol.ProcessId.DefaultInstance) { + result.host_ = global::bnet.protocol.ProcessId.CreateBuilder(result.host_).MergeFrom(value).BuildPartial(); + } else { + result.host_ = value; + } + result.hasHost = true; + return this; + } + public Builder ClearHost() { + PrepareBuilder(); + result.hasHost = false; + result.host_ = null; + return this; + } + } + static ServerRequest() { + object.ReferenceEquals(global::bnet.protocol.game_utilities.GameUtilitiesService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ServerResponse : pb::GeneratedMessage { + private ServerResponse() { } + private static readonly ServerResponse defaultInstance = new ServerResponse().MakeReadOnly(); + private static readonly string[] _serverResponseFieldNames = new string[] { "attribute" }; + private static readonly uint[] _serverResponseFieldTags = new uint[] { 10 }; + public static ServerResponse DefaultInstance { + get { return defaultInstance; } + } + + public override ServerResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ServerResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.game_utilities.GameUtilitiesService.internal__static_bnet_protocol_game_utilities_ServerResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.game_utilities.GameUtilitiesService.internal__static_bnet_protocol_game_utilities_ServerResponse__FieldAccessorTable; } + } + + public const int AttributeFieldNumber = 1; + private pbc::PopsicleList attribute_ = new pbc::PopsicleList(); + public scg::IList AttributeList { + get { return attribute_; } + } + public int AttributeCount { + get { return attribute_.Count; } + } + public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { + return attribute_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _serverResponseFieldNames; + if (attribute_.Count > 0) { + output.WriteMessageArray(1, field_names[0], attribute_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ServerResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ServerResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ServerResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ServerResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ServerResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ServerResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ServerResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ServerResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ServerResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ServerResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ServerResponse MakeReadOnly() { + attribute_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ServerResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ServerResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ServerResponse result; + + private ServerResponse PrepareBuilder() { + if (resultIsReadOnly) { + ServerResponse original = result; + result = new ServerResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ServerResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.game_utilities.ServerResponse.Descriptor; } + } + + public override ServerResponse DefaultInstanceForType { + get { return global::bnet.protocol.game_utilities.ServerResponse.DefaultInstance; } + } + + public override ServerResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ServerResponse) { + return MergeFrom((ServerResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ServerResponse other) { + if (other == global::bnet.protocol.game_utilities.ServerResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.attribute_.Count != 0) { + result.attribute_.Add(other.attribute_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_serverResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _serverResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.attribute_, global::bnet.protocol.attribute.Attribute.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList AttributeList { + get { return PrepareBuilder().attribute_; } + } + public int AttributeCount { + get { return result.AttributeCount; } + } + public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { + return result.GetAttribute(index); + } + public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.attribute_[index] = value; + return this; + } + public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.attribute_[index] = builderForValue.Build(); + return this; + } + public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.attribute_.Add(value); + return this; + } + public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.attribute_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeAttribute(scg::IEnumerable values) { + PrepareBuilder(); + result.attribute_.Add(values); + return this; + } + public Builder ClearAttribute() { + PrepareBuilder(); + result.attribute_.Clear(); + return this; + } + } + static ServerResponse() { + object.ReferenceEquals(global::bnet.protocol.game_utilities.GameUtilitiesService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class PresenceChannelCreatedRequest : pb::GeneratedMessage { + private PresenceChannelCreatedRequest() { } + private static readonly PresenceChannelCreatedRequest defaultInstance = new PresenceChannelCreatedRequest().MakeReadOnly(); + private static readonly string[] _presenceChannelCreatedRequestFieldNames = new string[] { "bnet_account_id", "game_account_id", "host", "id" }; + private static readonly uint[] _presenceChannelCreatedRequestFieldTags = new uint[] { 34, 26, 42, 10 }; + public static PresenceChannelCreatedRequest DefaultInstance { + get { return defaultInstance; } + } + + public override PresenceChannelCreatedRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override PresenceChannelCreatedRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.game_utilities.GameUtilitiesService.internal__static_bnet_protocol_game_utilities_PresenceChannelCreatedRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.game_utilities.GameUtilitiesService.internal__static_bnet_protocol_game_utilities_PresenceChannelCreatedRequest__FieldAccessorTable; } + } + + public const int IdFieldNumber = 1; + private bool hasId; + private global::bnet.protocol.EntityId id_; + public bool HasId { + get { return hasId; } + } + public global::bnet.protocol.EntityId Id { + get { return id_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int GameAccountIdFieldNumber = 3; + private bool hasGameAccountId; + private global::bnet.protocol.EntityId gameAccountId_; + public bool HasGameAccountId { + get { return hasGameAccountId; } + } + public global::bnet.protocol.EntityId GameAccountId { + get { return gameAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int BnetAccountIdFieldNumber = 4; + private bool hasBnetAccountId; + private global::bnet.protocol.EntityId bnetAccountId_; + public bool HasBnetAccountId { + get { return hasBnetAccountId; } + } + public global::bnet.protocol.EntityId BnetAccountId { + get { return bnetAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int HostFieldNumber = 5; + private bool hasHost; + private global::bnet.protocol.ProcessId host_; + public bool HasHost { + get { return hasHost; } + } + public global::bnet.protocol.ProcessId Host { + get { return host_ ?? global::bnet.protocol.ProcessId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasId) return false; + if (!Id.IsInitialized) return false; + if (HasGameAccountId) { + if (!GameAccountId.IsInitialized) return false; + } + if (HasBnetAccountId) { + if (!BnetAccountId.IsInitialized) return false; + } + if (HasHost) { + if (!Host.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _presenceChannelCreatedRequestFieldNames; + if (hasId) { + output.WriteMessage(1, field_names[3], Id); + } + if (hasGameAccountId) { + output.WriteMessage(3, field_names[1], GameAccountId); + } + if (hasBnetAccountId) { + output.WriteMessage(4, field_names[0], BnetAccountId); + } + if (hasHost) { + output.WriteMessage(5, field_names[2], Host); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Id); + } + if (hasGameAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(3, GameAccountId); + } + if (hasBnetAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(4, BnetAccountId); + } + if (hasHost) { + size += pb::CodedOutputStream.ComputeMessageSize(5, Host); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static PresenceChannelCreatedRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PresenceChannelCreatedRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PresenceChannelCreatedRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PresenceChannelCreatedRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PresenceChannelCreatedRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PresenceChannelCreatedRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static PresenceChannelCreatedRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static PresenceChannelCreatedRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static PresenceChannelCreatedRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PresenceChannelCreatedRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private PresenceChannelCreatedRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(PresenceChannelCreatedRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(PresenceChannelCreatedRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private PresenceChannelCreatedRequest result; + + private PresenceChannelCreatedRequest PrepareBuilder() { + if (resultIsReadOnly) { + PresenceChannelCreatedRequest original = result; + result = new PresenceChannelCreatedRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override PresenceChannelCreatedRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.game_utilities.PresenceChannelCreatedRequest.Descriptor; } + } + + public override PresenceChannelCreatedRequest DefaultInstanceForType { + get { return global::bnet.protocol.game_utilities.PresenceChannelCreatedRequest.DefaultInstance; } + } + + public override PresenceChannelCreatedRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is PresenceChannelCreatedRequest) { + return MergeFrom((PresenceChannelCreatedRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(PresenceChannelCreatedRequest other) { + if (other == global::bnet.protocol.game_utilities.PresenceChannelCreatedRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasId) { + MergeId(other.Id); + } + if (other.HasGameAccountId) { + MergeGameAccountId(other.GameAccountId); + } + if (other.HasBnetAccountId) { + MergeBnetAccountId(other.BnetAccountId); + } + if (other.HasHost) { + MergeHost(other.Host); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_presenceChannelCreatedRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _presenceChannelCreatedRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasId) { + subBuilder.MergeFrom(Id); + } + input.ReadMessage(subBuilder, extensionRegistry); + Id = subBuilder.BuildPartial(); + break; + } + case 26: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasGameAccountId) { + subBuilder.MergeFrom(GameAccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + GameAccountId = subBuilder.BuildPartial(); + break; + } + case 34: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasBnetAccountId) { + subBuilder.MergeFrom(BnetAccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + BnetAccountId = subBuilder.BuildPartial(); + break; + } + case 42: { + global::bnet.protocol.ProcessId.Builder subBuilder = global::bnet.protocol.ProcessId.CreateBuilder(); + if (result.hasHost) { + subBuilder.MergeFrom(Host); + } + input.ReadMessage(subBuilder, extensionRegistry); + Host = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasId { + get { return result.hasId; } + } + public global::bnet.protocol.EntityId Id { + get { return result.Id; } + set { SetId(value); } + } + public Builder SetId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasId = true; + result.id_ = value; + return this; + } + public Builder SetId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasId = true; + result.id_ = builderForValue.Build(); + return this; + } + public Builder MergeId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasId && + result.id_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.id_ = global::bnet.protocol.EntityId.CreateBuilder(result.id_).MergeFrom(value).BuildPartial(); + } else { + result.id_ = value; + } + result.hasId = true; + return this; + } + public Builder ClearId() { + PrepareBuilder(); + result.hasId = false; + result.id_ = null; + return this; + } + + public bool HasGameAccountId { + get { return result.hasGameAccountId; } + } + public global::bnet.protocol.EntityId GameAccountId { + get { return result.GameAccountId; } + set { SetGameAccountId(value); } + } + public Builder SetGameAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasGameAccountId = true; + result.gameAccountId_ = value; + return this; + } + public Builder SetGameAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasGameAccountId = true; + result.gameAccountId_ = builderForValue.Build(); + return this; + } + public Builder MergeGameAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasGameAccountId && + result.gameAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.gameAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccountId_).MergeFrom(value).BuildPartial(); + } else { + result.gameAccountId_ = value; + } + result.hasGameAccountId = true; + return this; + } + public Builder ClearGameAccountId() { + PrepareBuilder(); + result.hasGameAccountId = false; + result.gameAccountId_ = null; + return this; + } + + public bool HasBnetAccountId { + get { return result.hasBnetAccountId; } + } + public global::bnet.protocol.EntityId BnetAccountId { + get { return result.BnetAccountId; } + set { SetBnetAccountId(value); } + } + public Builder SetBnetAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBnetAccountId = true; + result.bnetAccountId_ = value; + return this; + } + public Builder SetBnetAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBnetAccountId = true; + result.bnetAccountId_ = builderForValue.Build(); + return this; + } + public Builder MergeBnetAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBnetAccountId && + result.bnetAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.bnetAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccountId_).MergeFrom(value).BuildPartial(); + } else { + result.bnetAccountId_ = value; + } + result.hasBnetAccountId = true; + return this; + } + public Builder ClearBnetAccountId() { + PrepareBuilder(); + result.hasBnetAccountId = false; + result.bnetAccountId_ = null; + return this; + } + + public bool HasHost { + get { return result.hasHost; } + } + public global::bnet.protocol.ProcessId Host { + get { return result.Host; } + set { SetHost(value); } + } + public Builder SetHost(global::bnet.protocol.ProcessId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasHost = true; + result.host_ = value; + return this; + } + public Builder SetHost(global::bnet.protocol.ProcessId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasHost = true; + result.host_ = builderForValue.Build(); + return this; + } + public Builder MergeHost(global::bnet.protocol.ProcessId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasHost && + result.host_ != global::bnet.protocol.ProcessId.DefaultInstance) { + result.host_ = global::bnet.protocol.ProcessId.CreateBuilder(result.host_).MergeFrom(value).BuildPartial(); + } else { + result.host_ = value; + } + result.hasHost = true; + return this; + } + public Builder ClearHost() { + PrepareBuilder(); + result.hasHost = false; + result.host_ = null; + return this; + } + } + static PresenceChannelCreatedRequest() { + object.ReferenceEquals(global::bnet.protocol.game_utilities.GameUtilitiesService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class PlayerVariablesRequest : pb::GeneratedMessage { + private PlayerVariablesRequest() { } + private static readonly PlayerVariablesRequest defaultInstance = new PlayerVariablesRequest().MakeReadOnly(); + private static readonly string[] _playerVariablesRequestFieldNames = new string[] { "bnet_account_id", "game_account_id", "host", "variable" }; + private static readonly uint[] _playerVariablesRequestFieldTags = new uint[] { 10, 18, 42, 34 }; + public static PlayerVariablesRequest DefaultInstance { + get { return defaultInstance; } + } + + public override PlayerVariablesRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override PlayerVariablesRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.game_utilities.GameUtilitiesService.internal__static_bnet_protocol_game_utilities_PlayerVariablesRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.game_utilities.GameUtilitiesService.internal__static_bnet_protocol_game_utilities_PlayerVariablesRequest__FieldAccessorTable; } + } + + public const int BnetAccountIdFieldNumber = 1; + private bool hasBnetAccountId; + private global::bnet.protocol.EntityId bnetAccountId_; + public bool HasBnetAccountId { + get { return hasBnetAccountId; } + } + public global::bnet.protocol.EntityId BnetAccountId { + get { return bnetAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int GameAccountIdFieldNumber = 2; + private bool hasGameAccountId; + private global::bnet.protocol.EntityId gameAccountId_; + public bool HasGameAccountId { + get { return hasGameAccountId; } + } + public global::bnet.protocol.EntityId GameAccountId { + get { return gameAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int VariableFieldNumber = 4; + private pbc::PopsicleList variable_ = new pbc::PopsicleList(); + public scg::IList VariableList { + get { return pbc::Lists.AsReadOnly(variable_); } + } + public int VariableCount { + get { return variable_.Count; } + } + public string GetVariable(int index) { + return variable_[index]; + } + + public const int HostFieldNumber = 5; + private bool hasHost; + private global::bnet.protocol.ProcessId host_; + public bool HasHost { + get { return hasHost; } + } + public global::bnet.protocol.ProcessId Host { + get { return host_ ?? global::bnet.protocol.ProcessId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasBnetAccountId) return false; + if (!hasGameAccountId) return false; + if (!BnetAccountId.IsInitialized) return false; + if (!GameAccountId.IsInitialized) return false; + if (HasHost) { + if (!Host.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _playerVariablesRequestFieldNames; + if (hasBnetAccountId) { + output.WriteMessage(1, field_names[0], BnetAccountId); + } + if (hasGameAccountId) { + output.WriteMessage(2, field_names[1], GameAccountId); + } + if (variable_.Count > 0) { + output.WriteStringArray(4, field_names[3], variable_); + } + if (hasHost) { + output.WriteMessage(5, field_names[2], Host); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasBnetAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, BnetAccountId); + } + if (hasGameAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, GameAccountId); + } + { + int dataSize = 0; + foreach (string element in VariableList) { + dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); + } + size += dataSize; + size += 1 * variable_.Count; + } + if (hasHost) { + size += pb::CodedOutputStream.ComputeMessageSize(5, Host); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static PlayerVariablesRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PlayerVariablesRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PlayerVariablesRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PlayerVariablesRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PlayerVariablesRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PlayerVariablesRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static PlayerVariablesRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static PlayerVariablesRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static PlayerVariablesRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PlayerVariablesRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private PlayerVariablesRequest MakeReadOnly() { + variable_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(PlayerVariablesRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(PlayerVariablesRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private PlayerVariablesRequest result; + + private PlayerVariablesRequest PrepareBuilder() { + if (resultIsReadOnly) { + PlayerVariablesRequest original = result; + result = new PlayerVariablesRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override PlayerVariablesRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.game_utilities.PlayerVariablesRequest.Descriptor; } + } + + public override PlayerVariablesRequest DefaultInstanceForType { + get { return global::bnet.protocol.game_utilities.PlayerVariablesRequest.DefaultInstance; } + } + + public override PlayerVariablesRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is PlayerVariablesRequest) { + return MergeFrom((PlayerVariablesRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(PlayerVariablesRequest other) { + if (other == global::bnet.protocol.game_utilities.PlayerVariablesRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasBnetAccountId) { + MergeBnetAccountId(other.BnetAccountId); + } + if (other.HasGameAccountId) { + MergeGameAccountId(other.GameAccountId); + } + if (other.variable_.Count != 0) { + result.variable_.Add(other.variable_); + } + if (other.HasHost) { + MergeHost(other.Host); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_playerVariablesRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _playerVariablesRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasBnetAccountId) { + subBuilder.MergeFrom(BnetAccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + BnetAccountId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasGameAccountId) { + subBuilder.MergeFrom(GameAccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + GameAccountId = subBuilder.BuildPartial(); + break; + } + case 34: { + input.ReadStringArray(tag, field_name, result.variable_); + break; + } + case 42: { + global::bnet.protocol.ProcessId.Builder subBuilder = global::bnet.protocol.ProcessId.CreateBuilder(); + if (result.hasHost) { + subBuilder.MergeFrom(Host); + } + input.ReadMessage(subBuilder, extensionRegistry); + Host = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasBnetAccountId { + get { return result.hasBnetAccountId; } + } + public global::bnet.protocol.EntityId BnetAccountId { + get { return result.BnetAccountId; } + set { SetBnetAccountId(value); } + } + public Builder SetBnetAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBnetAccountId = true; + result.bnetAccountId_ = value; + return this; + } + public Builder SetBnetAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBnetAccountId = true; + result.bnetAccountId_ = builderForValue.Build(); + return this; + } + public Builder MergeBnetAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBnetAccountId && + result.bnetAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.bnetAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccountId_).MergeFrom(value).BuildPartial(); + } else { + result.bnetAccountId_ = value; + } + result.hasBnetAccountId = true; + return this; + } + public Builder ClearBnetAccountId() { + PrepareBuilder(); + result.hasBnetAccountId = false; + result.bnetAccountId_ = null; + return this; + } + + public bool HasGameAccountId { + get { return result.hasGameAccountId; } + } + public global::bnet.protocol.EntityId GameAccountId { + get { return result.GameAccountId; } + set { SetGameAccountId(value); } + } + public Builder SetGameAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasGameAccountId = true; + result.gameAccountId_ = value; + return this; + } + public Builder SetGameAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasGameAccountId = true; + result.gameAccountId_ = builderForValue.Build(); + return this; + } + public Builder MergeGameAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasGameAccountId && + result.gameAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.gameAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccountId_).MergeFrom(value).BuildPartial(); + } else { + result.gameAccountId_ = value; + } + result.hasGameAccountId = true; + return this; + } + public Builder ClearGameAccountId() { + PrepareBuilder(); + result.hasGameAccountId = false; + result.gameAccountId_ = null; + return this; + } + + public pbc::IPopsicleList VariableList { + get { return PrepareBuilder().variable_; } + } + public int VariableCount { + get { return result.VariableCount; } + } + public string GetVariable(int index) { + return result.GetVariable(index); + } + public Builder SetVariable(int index, string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.variable_[index] = value; + return this; + } + public Builder AddVariable(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.variable_.Add(value); + return this; + } + public Builder AddRangeVariable(scg::IEnumerable values) { + PrepareBuilder(); + result.variable_.Add(values); + return this; + } + public Builder ClearVariable() { + PrepareBuilder(); + result.variable_.Clear(); + return this; + } + + public bool HasHost { + get { return result.hasHost; } + } + public global::bnet.protocol.ProcessId Host { + get { return result.Host; } + set { SetHost(value); } + } + public Builder SetHost(global::bnet.protocol.ProcessId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasHost = true; + result.host_ = value; + return this; + } + public Builder SetHost(global::bnet.protocol.ProcessId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasHost = true; + result.host_ = builderForValue.Build(); + return this; + } + public Builder MergeHost(global::bnet.protocol.ProcessId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasHost && + result.host_ != global::bnet.protocol.ProcessId.DefaultInstance) { + result.host_ = global::bnet.protocol.ProcessId.CreateBuilder(result.host_).MergeFrom(value).BuildPartial(); + } else { + result.host_ = value; + } + result.hasHost = true; + return this; + } + public Builder ClearHost() { + PrepareBuilder(); + result.hasHost = false; + result.host_ = null; + return this; + } + } + static PlayerVariablesRequest() { + object.ReferenceEquals(global::bnet.protocol.game_utilities.GameUtilitiesService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GameVariablesRequest : pb::GeneratedMessage { + private GameVariablesRequest() { } + private static readonly GameVariablesRequest defaultInstance = new GameVariablesRequest().MakeReadOnly(); + private static readonly string[] _gameVariablesRequestFieldNames = new string[] { "attribute", "host", "variable" }; + private static readonly uint[] _gameVariablesRequestFieldTags = new uint[] { 10, 26, 18 }; + public static GameVariablesRequest DefaultInstance { + get { return defaultInstance; } + } + + public override GameVariablesRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GameVariablesRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.game_utilities.GameUtilitiesService.internal__static_bnet_protocol_game_utilities_GameVariablesRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.game_utilities.GameUtilitiesService.internal__static_bnet_protocol_game_utilities_GameVariablesRequest__FieldAccessorTable; } + } + + public const int AttributeFieldNumber = 1; + private pbc::PopsicleList attribute_ = new pbc::PopsicleList(); + public scg::IList AttributeList { + get { return attribute_; } + } + public int AttributeCount { + get { return attribute_.Count; } + } + public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { + return attribute_[index]; + } + + public const int VariableFieldNumber = 2; + private pbc::PopsicleList variable_ = new pbc::PopsicleList(); + public scg::IList VariableList { + get { return pbc::Lists.AsReadOnly(variable_); } + } + public int VariableCount { + get { return variable_.Count; } + } + public string GetVariable(int index) { + return variable_[index]; + } + + public const int HostFieldNumber = 3; + private bool hasHost; + private global::bnet.protocol.ProcessId host_; + public bool HasHost { + get { return hasHost; } + } + public global::bnet.protocol.ProcessId Host { + get { return host_ ?? global::bnet.protocol.ProcessId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { + if (!element.IsInitialized) return false; + } + if (HasHost) { + if (!Host.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _gameVariablesRequestFieldNames; + if (attribute_.Count > 0) { + output.WriteMessageArray(1, field_names[0], attribute_); + } + if (variable_.Count > 0) { + output.WriteStringArray(2, field_names[2], variable_); + } + if (hasHost) { + output.WriteMessage(3, field_names[1], Host); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + { + int dataSize = 0; + foreach (string element in VariableList) { + dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); + } + size += dataSize; + size += 1 * variable_.Count; + } + if (hasHost) { + size += pb::CodedOutputStream.ComputeMessageSize(3, Host); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GameVariablesRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GameVariablesRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GameVariablesRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GameVariablesRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GameVariablesRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GameVariablesRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GameVariablesRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GameVariablesRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GameVariablesRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GameVariablesRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GameVariablesRequest MakeReadOnly() { + attribute_.MakeReadOnly(); + variable_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GameVariablesRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GameVariablesRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GameVariablesRequest result; + + private GameVariablesRequest PrepareBuilder() { + if (resultIsReadOnly) { + GameVariablesRequest original = result; + result = new GameVariablesRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GameVariablesRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.game_utilities.GameVariablesRequest.Descriptor; } + } + + public override GameVariablesRequest DefaultInstanceForType { + get { return global::bnet.protocol.game_utilities.GameVariablesRequest.DefaultInstance; } + } + + public override GameVariablesRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GameVariablesRequest) { + return MergeFrom((GameVariablesRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GameVariablesRequest other) { + if (other == global::bnet.protocol.game_utilities.GameVariablesRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.attribute_.Count != 0) { + result.attribute_.Add(other.attribute_); + } + if (other.variable_.Count != 0) { + result.variable_.Add(other.variable_); + } + if (other.HasHost) { + MergeHost(other.Host); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_gameVariablesRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _gameVariablesRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.attribute_, global::bnet.protocol.attribute.Attribute.DefaultInstance, extensionRegistry); + break; + } + case 18: { + input.ReadStringArray(tag, field_name, result.variable_); + break; + } + case 26: { + global::bnet.protocol.ProcessId.Builder subBuilder = global::bnet.protocol.ProcessId.CreateBuilder(); + if (result.hasHost) { + subBuilder.MergeFrom(Host); + } + input.ReadMessage(subBuilder, extensionRegistry); + Host = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList AttributeList { + get { return PrepareBuilder().attribute_; } + } + public int AttributeCount { + get { return result.AttributeCount; } + } + public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { + return result.GetAttribute(index); + } + public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.attribute_[index] = value; + return this; + } + public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.attribute_[index] = builderForValue.Build(); + return this; + } + public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.attribute_.Add(value); + return this; + } + public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.attribute_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeAttribute(scg::IEnumerable values) { + PrepareBuilder(); + result.attribute_.Add(values); + return this; + } + public Builder ClearAttribute() { + PrepareBuilder(); + result.attribute_.Clear(); + return this; + } + + public pbc::IPopsicleList VariableList { + get { return PrepareBuilder().variable_; } + } + public int VariableCount { + get { return result.VariableCount; } + } + public string GetVariable(int index) { + return result.GetVariable(index); + } + public Builder SetVariable(int index, string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.variable_[index] = value; + return this; + } + public Builder AddVariable(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.variable_.Add(value); + return this; + } + public Builder AddRangeVariable(scg::IEnumerable values) { + PrepareBuilder(); + result.variable_.Add(values); + return this; + } + public Builder ClearVariable() { + PrepareBuilder(); + result.variable_.Clear(); + return this; + } + + public bool HasHost { + get { return result.hasHost; } + } + public global::bnet.protocol.ProcessId Host { + get { return result.Host; } + set { SetHost(value); } + } + public Builder SetHost(global::bnet.protocol.ProcessId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasHost = true; + result.host_ = value; + return this; + } + public Builder SetHost(global::bnet.protocol.ProcessId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasHost = true; + result.host_ = builderForValue.Build(); + return this; + } + public Builder MergeHost(global::bnet.protocol.ProcessId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasHost && + result.host_ != global::bnet.protocol.ProcessId.DefaultInstance) { + result.host_ = global::bnet.protocol.ProcessId.CreateBuilder(result.host_).MergeFrom(value).BuildPartial(); + } else { + result.host_ = value; + } + result.hasHost = true; + return this; + } + public Builder ClearHost() { + PrepareBuilder(); + result.hasHost = false; + result.host_ = null; + return this; + } + } + static GameVariablesRequest() { + object.ReferenceEquals(global::bnet.protocol.game_utilities.GameUtilitiesService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class VariablesResponse : pb::GeneratedMessage { + private VariablesResponse() { } + private static readonly VariablesResponse defaultInstance = new VariablesResponse().MakeReadOnly(); + private static readonly string[] _variablesResponseFieldNames = new string[] { "value" }; + private static readonly uint[] _variablesResponseFieldTags = new uint[] { 10 }; + public static VariablesResponse DefaultInstance { + get { return defaultInstance; } + } + + public override VariablesResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override VariablesResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.game_utilities.GameUtilitiesService.internal__static_bnet_protocol_game_utilities_VariablesResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.game_utilities.GameUtilitiesService.internal__static_bnet_protocol_game_utilities_VariablesResponse__FieldAccessorTable; } + } + + public const int ValueFieldNumber = 1; + private int valueMemoizedSerializedSize; + private pbc::PopsicleList value_ = new pbc::PopsicleList(); + public scg::IList ValueList { + get { return pbc::Lists.AsReadOnly(value_); } + } + public int ValueCount { + get { return value_.Count; } + } + public float GetValue(int index) { + return value_[index]; + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _variablesResponseFieldNames; + if (value_.Count > 0) { + output.WritePackedFloatArray(1, field_names[0], valueMemoizedSerializedSize, value_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + dataSize = 4 * value_.Count; + size += dataSize; + if (value_.Count != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); + } + valueMemoizedSerializedSize = dataSize; + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static VariablesResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static VariablesResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static VariablesResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static VariablesResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static VariablesResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static VariablesResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static VariablesResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static VariablesResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static VariablesResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static VariablesResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private VariablesResponse MakeReadOnly() { + value_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(VariablesResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(VariablesResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private VariablesResponse result; + + private VariablesResponse PrepareBuilder() { + if (resultIsReadOnly) { + VariablesResponse original = result; + result = new VariablesResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override VariablesResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.game_utilities.VariablesResponse.Descriptor; } + } + + public override VariablesResponse DefaultInstanceForType { + get { return global::bnet.protocol.game_utilities.VariablesResponse.DefaultInstance; } + } + + public override VariablesResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is VariablesResponse) { + return MergeFrom((VariablesResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(VariablesResponse other) { + if (other == global::bnet.protocol.game_utilities.VariablesResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.value_.Count != 0) { + result.value_.Add(other.value_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_variablesResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _variablesResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: + case 13: { + input.ReadFloatArray(tag, field_name, result.value_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList ValueList { + get { return PrepareBuilder().value_; } + } + public int ValueCount { + get { return result.ValueCount; } + } + public float GetValue(int index) { + return result.GetValue(index); + } + public Builder SetValue(int index, float value) { + PrepareBuilder(); + result.value_[index] = value; + return this; + } + public Builder AddValue(float value) { + PrepareBuilder(); + result.value_.Add(value); + return this; + } + public Builder AddRangeValue(scg::IEnumerable values) { + PrepareBuilder(); + result.value_.Add(values); + return this; + } + public Builder ClearValue() { + PrepareBuilder(); + result.value_.Clear(); + return this; + } + } + static VariablesResponse() { + object.ReferenceEquals(global::bnet.protocol.game_utilities.GameUtilitiesService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GameAccountOnlineNotification : pb::GeneratedMessage { + private GameAccountOnlineNotification() { } + private static readonly GameAccountOnlineNotification defaultInstance = new GameAccountOnlineNotification().MakeReadOnly(); + private static readonly string[] _gameAccountOnlineNotificationFieldNames = new string[] { "game_account_id", "host" }; + private static readonly uint[] _gameAccountOnlineNotificationFieldTags = new uint[] { 10, 18 }; + public static GameAccountOnlineNotification DefaultInstance { + get { return defaultInstance; } + } + + public override GameAccountOnlineNotification DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GameAccountOnlineNotification ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.game_utilities.GameUtilitiesService.internal__static_bnet_protocol_game_utilities_GameAccountOnlineNotification__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.game_utilities.GameUtilitiesService.internal__static_bnet_protocol_game_utilities_GameAccountOnlineNotification__FieldAccessorTable; } + } + + public const int GameAccountIdFieldNumber = 1; + private bool hasGameAccountId; + private global::bnet.protocol.EntityId gameAccountId_; + public bool HasGameAccountId { + get { return hasGameAccountId; } + } + public global::bnet.protocol.EntityId GameAccountId { + get { return gameAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int HostFieldNumber = 2; + private bool hasHost; + private global::bnet.protocol.ProcessId host_; + public bool HasHost { + get { return hasHost; } + } + public global::bnet.protocol.ProcessId Host { + get { return host_ ?? global::bnet.protocol.ProcessId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasGameAccountId) return false; + if (!GameAccountId.IsInitialized) return false; + if (HasHost) { + if (!Host.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _gameAccountOnlineNotificationFieldNames; + if (hasGameAccountId) { + output.WriteMessage(1, field_names[0], GameAccountId); + } + if (hasHost) { + output.WriteMessage(2, field_names[1], Host); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasGameAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, GameAccountId); + } + if (hasHost) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Host); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GameAccountOnlineNotification ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GameAccountOnlineNotification ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GameAccountOnlineNotification ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GameAccountOnlineNotification ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GameAccountOnlineNotification ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GameAccountOnlineNotification ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GameAccountOnlineNotification ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GameAccountOnlineNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GameAccountOnlineNotification ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GameAccountOnlineNotification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GameAccountOnlineNotification MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GameAccountOnlineNotification prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GameAccountOnlineNotification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GameAccountOnlineNotification result; + + private GameAccountOnlineNotification PrepareBuilder() { + if (resultIsReadOnly) { + GameAccountOnlineNotification original = result; + result = new GameAccountOnlineNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GameAccountOnlineNotification MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.game_utilities.GameAccountOnlineNotification.Descriptor; } + } + + public override GameAccountOnlineNotification DefaultInstanceForType { + get { return global::bnet.protocol.game_utilities.GameAccountOnlineNotification.DefaultInstance; } + } + + public override GameAccountOnlineNotification BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GameAccountOnlineNotification) { + return MergeFrom((GameAccountOnlineNotification) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GameAccountOnlineNotification other) { + if (other == global::bnet.protocol.game_utilities.GameAccountOnlineNotification.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasGameAccountId) { + MergeGameAccountId(other.GameAccountId); + } + if (other.HasHost) { + MergeHost(other.Host); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_gameAccountOnlineNotificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _gameAccountOnlineNotificationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasGameAccountId) { + subBuilder.MergeFrom(GameAccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + GameAccountId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.ProcessId.Builder subBuilder = global::bnet.protocol.ProcessId.CreateBuilder(); + if (result.hasHost) { + subBuilder.MergeFrom(Host); + } + input.ReadMessage(subBuilder, extensionRegistry); + Host = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasGameAccountId { + get { return result.hasGameAccountId; } + } + public global::bnet.protocol.EntityId GameAccountId { + get { return result.GameAccountId; } + set { SetGameAccountId(value); } + } + public Builder SetGameAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasGameAccountId = true; + result.gameAccountId_ = value; + return this; + } + public Builder SetGameAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasGameAccountId = true; + result.gameAccountId_ = builderForValue.Build(); + return this; + } + public Builder MergeGameAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasGameAccountId && + result.gameAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.gameAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccountId_).MergeFrom(value).BuildPartial(); + } else { + result.gameAccountId_ = value; + } + result.hasGameAccountId = true; + return this; + } + public Builder ClearGameAccountId() { + PrepareBuilder(); + result.hasGameAccountId = false; + result.gameAccountId_ = null; + return this; + } + + public bool HasHost { + get { return result.hasHost; } + } + public global::bnet.protocol.ProcessId Host { + get { return result.Host; } + set { SetHost(value); } + } + public Builder SetHost(global::bnet.protocol.ProcessId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasHost = true; + result.host_ = value; + return this; + } + public Builder SetHost(global::bnet.protocol.ProcessId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasHost = true; + result.host_ = builderForValue.Build(); + return this; + } + public Builder MergeHost(global::bnet.protocol.ProcessId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasHost && + result.host_ != global::bnet.protocol.ProcessId.DefaultInstance) { + result.host_ = global::bnet.protocol.ProcessId.CreateBuilder(result.host_).MergeFrom(value).BuildPartial(); + } else { + result.host_ = value; + } + result.hasHost = true; + return this; + } + public Builder ClearHost() { + PrepareBuilder(); + result.hasHost = false; + result.host_ = null; + return this; + } + } + static GameAccountOnlineNotification() { + object.ReferenceEquals(global::bnet.protocol.game_utilities.GameUtilitiesService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GameAccountOfflineNotification : pb::GeneratedMessage { + private GameAccountOfflineNotification() { } + private static readonly GameAccountOfflineNotification defaultInstance = new GameAccountOfflineNotification().MakeReadOnly(); + private static readonly string[] _gameAccountOfflineNotificationFieldNames = new string[] { "game_account_id", "host" }; + private static readonly uint[] _gameAccountOfflineNotificationFieldTags = new uint[] { 10, 18 }; + public static GameAccountOfflineNotification DefaultInstance { + get { return defaultInstance; } + } + + public override GameAccountOfflineNotification DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GameAccountOfflineNotification ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.game_utilities.GameUtilitiesService.internal__static_bnet_protocol_game_utilities_GameAccountOfflineNotification__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.game_utilities.GameUtilitiesService.internal__static_bnet_protocol_game_utilities_GameAccountOfflineNotification__FieldAccessorTable; } + } + + public const int GameAccountIdFieldNumber = 1; + private bool hasGameAccountId; + private global::bnet.protocol.EntityId gameAccountId_; + public bool HasGameAccountId { + get { return hasGameAccountId; } + } + public global::bnet.protocol.EntityId GameAccountId { + get { return gameAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int HostFieldNumber = 2; + private bool hasHost; + private global::bnet.protocol.ProcessId host_; + public bool HasHost { + get { return hasHost; } + } + public global::bnet.protocol.ProcessId Host { + get { return host_ ?? global::bnet.protocol.ProcessId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasGameAccountId) return false; + if (!GameAccountId.IsInitialized) return false; + if (HasHost) { + if (!Host.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _gameAccountOfflineNotificationFieldNames; + if (hasGameAccountId) { + output.WriteMessage(1, field_names[0], GameAccountId); + } + if (hasHost) { + output.WriteMessage(2, field_names[1], Host); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasGameAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, GameAccountId); + } + if (hasHost) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Host); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GameAccountOfflineNotification ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GameAccountOfflineNotification ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GameAccountOfflineNotification ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GameAccountOfflineNotification ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GameAccountOfflineNotification ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GameAccountOfflineNotification ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GameAccountOfflineNotification ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GameAccountOfflineNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GameAccountOfflineNotification ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GameAccountOfflineNotification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GameAccountOfflineNotification MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GameAccountOfflineNotification prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GameAccountOfflineNotification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GameAccountOfflineNotification result; + + private GameAccountOfflineNotification PrepareBuilder() { + if (resultIsReadOnly) { + GameAccountOfflineNotification original = result; + result = new GameAccountOfflineNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GameAccountOfflineNotification MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.game_utilities.GameAccountOfflineNotification.Descriptor; } + } + + public override GameAccountOfflineNotification DefaultInstanceForType { + get { return global::bnet.protocol.game_utilities.GameAccountOfflineNotification.DefaultInstance; } + } + + public override GameAccountOfflineNotification BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GameAccountOfflineNotification) { + return MergeFrom((GameAccountOfflineNotification) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GameAccountOfflineNotification other) { + if (other == global::bnet.protocol.game_utilities.GameAccountOfflineNotification.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasGameAccountId) { + MergeGameAccountId(other.GameAccountId); + } + if (other.HasHost) { + MergeHost(other.Host); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_gameAccountOfflineNotificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _gameAccountOfflineNotificationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasGameAccountId) { + subBuilder.MergeFrom(GameAccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + GameAccountId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.ProcessId.Builder subBuilder = global::bnet.protocol.ProcessId.CreateBuilder(); + if (result.hasHost) { + subBuilder.MergeFrom(Host); + } + input.ReadMessage(subBuilder, extensionRegistry); + Host = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasGameAccountId { + get { return result.hasGameAccountId; } + } + public global::bnet.protocol.EntityId GameAccountId { + get { return result.GameAccountId; } + set { SetGameAccountId(value); } + } + public Builder SetGameAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasGameAccountId = true; + result.gameAccountId_ = value; + return this; + } + public Builder SetGameAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasGameAccountId = true; + result.gameAccountId_ = builderForValue.Build(); + return this; + } + public Builder MergeGameAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasGameAccountId && + result.gameAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.gameAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccountId_).MergeFrom(value).BuildPartial(); + } else { + result.gameAccountId_ = value; + } + result.hasGameAccountId = true; + return this; + } + public Builder ClearGameAccountId() { + PrepareBuilder(); + result.hasGameAccountId = false; + result.gameAccountId_ = null; + return this; + } + + public bool HasHost { + get { return result.hasHost; } + } + public global::bnet.protocol.ProcessId Host { + get { return result.Host; } + set { SetHost(value); } + } + public Builder SetHost(global::bnet.protocol.ProcessId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasHost = true; + result.host_ = value; + return this; + } + public Builder SetHost(global::bnet.protocol.ProcessId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasHost = true; + result.host_ = builderForValue.Build(); + return this; + } + public Builder MergeHost(global::bnet.protocol.ProcessId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasHost && + result.host_ != global::bnet.protocol.ProcessId.DefaultInstance) { + result.host_ = global::bnet.protocol.ProcessId.CreateBuilder(result.host_).MergeFrom(value).BuildPartial(); + } else { + result.host_ = value; + } + result.hasHost = true; + return this; + } + public Builder ClearHost() { + PrepareBuilder(); + result.hasHost = false; + result.host_ = null; + return this; + } + } + static GameAccountOfflineNotification() { + object.ReferenceEquals(global::bnet.protocol.game_utilities.GameUtilitiesService.Descriptor, null); + } + } + + #endregion + + #region Services + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public abstract class GameUtilities : pb::IService { + public abstract void ProcessClientRequest( + pb::IRpcController controller, + global::bnet.protocol.game_utilities.ClientRequest request, + global::System.Action done); + public abstract void PresenceChannelCreated( + pb::IRpcController controller, + global::bnet.protocol.game_utilities.PresenceChannelCreatedRequest request, + global::System.Action done); + public abstract void GetPlayerVariables( + pb::IRpcController controller, + global::bnet.protocol.game_utilities.PlayerVariablesRequest request, + global::System.Action done); + public abstract void GetGameVariables( + pb::IRpcController controller, + global::bnet.protocol.game_utilities.GameVariablesRequest request, + global::System.Action done); + public abstract void GetLoad( + pb::IRpcController controller, + global::bnet.protocol.server_pool.GetLoadRequest request, + global::System.Action done); + public abstract void ProcessServerRequest( + pb::IRpcController controller, + global::bnet.protocol.game_utilities.ServerRequest request, + global::System.Action done); + public abstract void NotifyGameAccountOnline( + pb::IRpcController controller, + global::bnet.protocol.game_utilities.GameAccountOnlineNotification request, + global::System.Action done); + public abstract void NotifyGameAccountOffline( + pb::IRpcController controller, + global::bnet.protocol.game_utilities.GameAccountOfflineNotification request, + global::System.Action done); + + public static pbd::ServiceDescriptor Descriptor { + get { return GameUtilitiesService.Descriptor.Services[0]; } + } + public pbd::ServiceDescriptor DescriptorForType { + get { return Descriptor; } + } + + public void CallMethod( + pbd::MethodDescriptor method, + pb::IRpcController controller, + pb::IMessage request, + global::System.Action done) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.CallMethod() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + this.ProcessClientRequest(controller, (global::bnet.protocol.game_utilities.ClientRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 1: + this.PresenceChannelCreated(controller, (global::bnet.protocol.game_utilities.PresenceChannelCreatedRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 2: + this.GetPlayerVariables(controller, (global::bnet.protocol.game_utilities.PlayerVariablesRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 3: + this.GetGameVariables(controller, (global::bnet.protocol.game_utilities.GameVariablesRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 4: + this.GetLoad(controller, (global::bnet.protocol.server_pool.GetLoadRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 5: + this.ProcessServerRequest(controller, (global::bnet.protocol.game_utilities.ServerRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 6: + this.NotifyGameAccountOnline(controller, (global::bnet.protocol.game_utilities.GameAccountOnlineNotification) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 7: + this.NotifyGameAccountOffline(controller, (global::bnet.protocol.game_utilities.GameAccountOfflineNotification) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetRequestPrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.game_utilities.ClientRequest.DefaultInstance; + case 1: + return global::bnet.protocol.game_utilities.PresenceChannelCreatedRequest.DefaultInstance; + case 2: + return global::bnet.protocol.game_utilities.PlayerVariablesRequest.DefaultInstance; + case 3: + return global::bnet.protocol.game_utilities.GameVariablesRequest.DefaultInstance; + case 4: + return global::bnet.protocol.server_pool.GetLoadRequest.DefaultInstance; + case 5: + return global::bnet.protocol.game_utilities.ServerRequest.DefaultInstance; + case 6: + return global::bnet.protocol.game_utilities.GameAccountOnlineNotification.DefaultInstance; + case 7: + return global::bnet.protocol.game_utilities.GameAccountOfflineNotification.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetResponsePrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.game_utilities.ClientResponse.DefaultInstance; + case 1: + return global::bnet.protocol.NoData.DefaultInstance; + case 2: + return global::bnet.protocol.game_utilities.VariablesResponse.DefaultInstance; + case 3: + return global::bnet.protocol.game_utilities.VariablesResponse.DefaultInstance; + case 4: + return global::bnet.protocol.server_pool.ServerState.DefaultInstance; + case 5: + return global::bnet.protocol.game_utilities.ServerResponse.DefaultInstance; + case 6: + return global::bnet.protocol.NO_RESPONSE.DefaultInstance; + case 7: + return global::bnet.protocol.NO_RESPONSE.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public static Stub CreateStub(pb::IRpcChannel channel) { + return new Stub(channel); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public class Stub : global::bnet.protocol.game_utilities.GameUtilities { + internal Stub(pb::IRpcChannel channel) { + this.channel = channel; + } + + private readonly pb::IRpcChannel channel; + + public pb::IRpcChannel Channel { + get { return channel; } + } + + public override void ProcessClientRequest( + pb::IRpcController controller, + global::bnet.protocol.game_utilities.ClientRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[0], + controller, request, global::bnet.protocol.game_utilities.ClientResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.game_utilities.ClientResponse.DefaultInstance)); + } + + public override void PresenceChannelCreated( + pb::IRpcController controller, + global::bnet.protocol.game_utilities.PresenceChannelCreatedRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[1], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void GetPlayerVariables( + pb::IRpcController controller, + global::bnet.protocol.game_utilities.PlayerVariablesRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[2], + controller, request, global::bnet.protocol.game_utilities.VariablesResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.game_utilities.VariablesResponse.DefaultInstance)); + } + + public override void GetGameVariables( + pb::IRpcController controller, + global::bnet.protocol.game_utilities.GameVariablesRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[3], + controller, request, global::bnet.protocol.game_utilities.VariablesResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.game_utilities.VariablesResponse.DefaultInstance)); + } + + public override void GetLoad( + pb::IRpcController controller, + global::bnet.protocol.server_pool.GetLoadRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[4], + controller, request, global::bnet.protocol.server_pool.ServerState.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.server_pool.ServerState.DefaultInstance)); + } + + public override void ProcessServerRequest( + pb::IRpcController controller, + global::bnet.protocol.game_utilities.ServerRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[5], + controller, request, global::bnet.protocol.game_utilities.ServerResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.game_utilities.ServerResponse.DefaultInstance)); + } + + public override void NotifyGameAccountOnline( + pb::IRpcController controller, + global::bnet.protocol.game_utilities.GameAccountOnlineNotification request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[6], + controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); + } + + public override void NotifyGameAccountOffline( + pb::IRpcController controller, + global::bnet.protocol.game_utilities.GameAccountOfflineNotification request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[7], + controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); + } + } + } + #endregion + +} + +#endregion Designer generated code diff --git a/src/LibMooNet/bnet/protocol/invitation/InvitationTypes.cs b/src/LibMooNet/bnet/protocol/invitation/InvitationTypes.cs new file mode 100644 index 00000000..c9b02ab4 --- /dev/null +++ b/src/LibMooNet/bnet/protocol/invitation/InvitationTypes.cs @@ -0,0 +1,3546 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace bnet.protocol.invitation { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class InvitationTypes { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_bnet_protocol_invitation_Invitation__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_invitation_Invitation__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_invitation_Suggestion__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_invitation_Suggestion__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_invitation_InvitationParams__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_invitation_InvitationParams__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_invitation_SendInvitationRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_invitation_SendInvitationRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_invitation_SendInvitationResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_invitation_SendInvitationResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_invitation_UpdateInvitationRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_invitation_UpdateInvitationRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_invitation_GenericRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_invitation_GenericRequest__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static InvitationTypes() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "ChtibmV0L2ludml0YXRpb25fdHlwZXMucHJvdG8SGGJuZXQucHJvdG9jb2wu" + + "aW52aXRhdGlvbhoUYm5ldC9hdHRyaWJ1dGUucHJvdG8aEWJuZXQvZW50aXR5" + + "LnByb3RvIv0BCgpJbnZpdGF0aW9uEgoKAmlkGAEgAigGEjEKEGludml0ZXJf" + + "aWRlbnRpdHkYAiACKAsyFy5ibmV0LnByb3RvY29sLklkZW50aXR5EjEKEGlu" + + "dml0ZWVfaWRlbnRpdHkYAyACKAsyFy5ibmV0LnByb3RvY29sLklkZW50aXR5" + + "EhQKDGludml0ZXJfbmFtZRgEIAEoCRIUCgxpbnZpdGVlX25hbWUYBSABKAkS" + + "GgoSaW52aXRhdGlvbl9tZXNzYWdlGAYgASgJEhUKDWNyZWF0aW9uX3RpbWUY" + + "ByABKAQSFwoPZXhwaXJhdGlvbl90aW1lGAggASgEKgUIZBCRTiL+AQoKU3Vn" + + "Z2VzdGlvbhIrCgpjaGFubmVsX2lkGAEgASgLMhcuYm5ldC5wcm90b2NvbC5F" + + "bnRpdHlJZBItCgxzdWdnZXN0ZXJfaWQYAiACKAsyFy5ibmV0LnByb3RvY29s" + + "LkVudGl0eUlkEi0KDHN1Z2dlc3RlZV9pZBgDIAIoCzIXLmJuZXQucHJvdG9j" + + "b2wuRW50aXR5SWQSFgoOc3VnZ2VzdGVyX25hbWUYBCABKAkSFgoOc3VnZ2Vz" + + "dGVlX25hbWUYBSABKAkSNQoUc3VnZ2VzdGVyX2FjY291bnRfaWQYBiABKAsy" + + "Fy5ibmV0LnByb3RvY29sLkVudGl0eUlkIlEKEEludml0YXRpb25QYXJhbXMS" + + "GgoSaW52aXRhdGlvbl9tZXNzYWdlGAEgASgJEhoKD2V4cGlyYXRpb25fdGlt" + + "ZRgCIAEoBDoBMCoFCGQQkU4i4AEKFVNlbmRJbnZpdGF0aW9uUmVxdWVzdBIv" + + "Cg5hZ2VudF9pZGVudGl0eRgBIAEoCzIXLmJuZXQucHJvdG9jb2wuSWRlbnRp" + + "dHkSKgoJdGFyZ2V0X2lkGAIgAigLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJ" + + "ZBI6CgZwYXJhbXMYAyACKAsyKi5ibmV0LnByb3RvY29sLmludml0YXRpb24u" + + "SW52aXRhdGlvblBhcmFtcxIuCgphZ2VudF9pbmZvGAQgASgLMhouYm5ldC5w" + + "cm90b2NvbC5BY2NvdW50SW5mbyJSChZTZW5kSW52aXRhdGlvblJlc3BvbnNl" + + "EjgKCmludml0YXRpb24YAiABKAsyJC5ibmV0LnByb3RvY29sLmludml0YXRp" + + "b24uSW52aXRhdGlvbiKdAQoXVXBkYXRlSW52aXRhdGlvblJlcXVlc3QSLwoO" + + "YWdlbnRfaWRlbnRpdHkYASABKAsyFy5ibmV0LnByb3RvY29sLklkZW50aXR5" + + "EhUKDWludml0YXRpb25faWQYAiACKAYSOgoGcGFyYW1zGAMgAigLMiouYm5l" + + "dC5wcm90b2NvbC5pbnZpdGF0aW9uLkludml0YXRpb25QYXJhbXMi3wEKDkdl" + + "bmVyaWNSZXF1ZXN0EikKCGFnZW50X2lkGAEgASgLMhcuYm5ldC5wcm90b2Nv" + + "bC5FbnRpdHlJZBIqCgl0YXJnZXRfaWQYAiABKAsyFy5ibmV0LnByb3RvY29s" + + "LkVudGl0eUlkEhUKDWludml0YXRpb25faWQYAyACKAYSFAoMaW52aXRlZV9u" + + "YW1lGAQgASgJEhQKDGludml0ZXJfbmFtZRgFIAEoCRIZCg1wcmV2aW91c19y" + + "b2xlGAYgAygNQgIQARIYCgxkZXNpcmVkX3JvbGUYByADKA1CAhAB"); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_bnet_protocol_invitation_Invitation__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_invitation_Invitation__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_invitation_Invitation__Descriptor, + new string[] { "Id", "InviterIdentity", "InviteeIdentity", "InviterName", "InviteeName", "InvitationMessage", "CreationTime", "ExpirationTime", }); + internal__static_bnet_protocol_invitation_Suggestion__Descriptor = Descriptor.MessageTypes[1]; + internal__static_bnet_protocol_invitation_Suggestion__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_invitation_Suggestion__Descriptor, + new string[] { "ChannelId", "SuggesterId", "SuggesteeId", "SuggesterName", "SuggesteeName", "SuggesterAccountId", }); + internal__static_bnet_protocol_invitation_InvitationParams__Descriptor = Descriptor.MessageTypes[2]; + internal__static_bnet_protocol_invitation_InvitationParams__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_invitation_InvitationParams__Descriptor, + new string[] { "InvitationMessage", "ExpirationTime", }); + internal__static_bnet_protocol_invitation_SendInvitationRequest__Descriptor = Descriptor.MessageTypes[3]; + internal__static_bnet_protocol_invitation_SendInvitationRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_invitation_SendInvitationRequest__Descriptor, + new string[] { "AgentIdentity", "TargetId", "Params", "AgentInfo", }); + internal__static_bnet_protocol_invitation_SendInvitationResponse__Descriptor = Descriptor.MessageTypes[4]; + internal__static_bnet_protocol_invitation_SendInvitationResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_invitation_SendInvitationResponse__Descriptor, + new string[] { "Invitation", }); + internal__static_bnet_protocol_invitation_UpdateInvitationRequest__Descriptor = Descriptor.MessageTypes[5]; + internal__static_bnet_protocol_invitation_UpdateInvitationRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_invitation_UpdateInvitationRequest__Descriptor, + new string[] { "AgentIdentity", "InvitationId", "Params", }); + internal__static_bnet_protocol_invitation_GenericRequest__Descriptor = Descriptor.MessageTypes[6]; + internal__static_bnet_protocol_invitation_GenericRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_invitation_GenericRequest__Descriptor, + new string[] { "AgentId", "TargetId", "InvitationId", "InviteeName", "InviterName", "PreviousRole", "DesiredRole", }); + return null; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::bnet.protocol.attribute.Proto.Attribute.Descriptor, + global::bnet.protocol.Entity.Descriptor, + }, assigner); + } + #endregion + + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Invitation : pb::ExtendableMessage { + private Invitation() { } + private static readonly Invitation defaultInstance = new Invitation().MakeReadOnly(); + private static readonly string[] _invitationFieldNames = new string[] { "creation_time", "expiration_time", "id", "invitation_message", "invitee_identity", "invitee_name", "inviter_identity", "inviter_name" }; + private static readonly uint[] _invitationFieldTags = new uint[] { 56, 64, 9, 50, 26, 42, 18, 34 }; + public static Invitation DefaultInstance { + get { return defaultInstance; } + } + + public override Invitation DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Invitation ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.invitation.InvitationTypes.internal__static_bnet_protocol_invitation_Invitation__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.invitation.InvitationTypes.internal__static_bnet_protocol_invitation_Invitation__FieldAccessorTable; } + } + + public const int IdFieldNumber = 1; + private bool hasId; + private ulong id_; + public bool HasId { + get { return hasId; } + } + public ulong Id { + get { return id_; } + } + + public const int InviterIdentityFieldNumber = 2; + private bool hasInviterIdentity; + private global::bnet.protocol.Identity inviterIdentity_; + public bool HasInviterIdentity { + get { return hasInviterIdentity; } + } + public global::bnet.protocol.Identity InviterIdentity { + get { return inviterIdentity_ ?? global::bnet.protocol.Identity.DefaultInstance; } + } + + public const int InviteeIdentityFieldNumber = 3; + private bool hasInviteeIdentity; + private global::bnet.protocol.Identity inviteeIdentity_; + public bool HasInviteeIdentity { + get { return hasInviteeIdentity; } + } + public global::bnet.protocol.Identity InviteeIdentity { + get { return inviteeIdentity_ ?? global::bnet.protocol.Identity.DefaultInstance; } + } + + public const int InviterNameFieldNumber = 4; + private bool hasInviterName; + private string inviterName_ = ""; + public bool HasInviterName { + get { return hasInviterName; } + } + public string InviterName { + get { return inviterName_; } + } + + public const int InviteeNameFieldNumber = 5; + private bool hasInviteeName; + private string inviteeName_ = ""; + public bool HasInviteeName { + get { return hasInviteeName; } + } + public string InviteeName { + get { return inviteeName_; } + } + + public const int InvitationMessageFieldNumber = 6; + private bool hasInvitationMessage; + private string invitationMessage_ = ""; + public bool HasInvitationMessage { + get { return hasInvitationMessage; } + } + public string InvitationMessage { + get { return invitationMessage_; } + } + + public const int CreationTimeFieldNumber = 7; + private bool hasCreationTime; + private ulong creationTime_; + public bool HasCreationTime { + get { return hasCreationTime; } + } + public ulong CreationTime { + get { return creationTime_; } + } + + public const int ExpirationTimeFieldNumber = 8; + private bool hasExpirationTime; + private ulong expirationTime_; + public bool HasExpirationTime { + get { return hasExpirationTime; } + } + public ulong ExpirationTime { + get { return expirationTime_; } + } + + public override bool IsInitialized { + get { + if (!hasId) return false; + if (!hasInviterIdentity) return false; + if (!hasInviteeIdentity) return false; + if (!InviterIdentity.IsInitialized) return false; + if (!InviteeIdentity.IsInitialized) return false; + if (!ExtensionsAreInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _invitationFieldNames; + pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); + if (hasId) { + output.WriteFixed64(1, field_names[2], Id); + } + if (hasInviterIdentity) { + output.WriteMessage(2, field_names[6], InviterIdentity); + } + if (hasInviteeIdentity) { + output.WriteMessage(3, field_names[4], InviteeIdentity); + } + if (hasInviterName) { + output.WriteString(4, field_names[7], InviterName); + } + if (hasInviteeName) { + output.WriteString(5, field_names[5], InviteeName); + } + if (hasInvitationMessage) { + output.WriteString(6, field_names[3], InvitationMessage); + } + if (hasCreationTime) { + output.WriteUInt64(7, field_names[0], CreationTime); + } + if (hasExpirationTime) { + output.WriteUInt64(8, field_names[1], ExpirationTime); + } + extensionWriter.WriteUntil(10001, output); + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasId) { + size += pb::CodedOutputStream.ComputeFixed64Size(1, Id); + } + if (hasInviterIdentity) { + size += pb::CodedOutputStream.ComputeMessageSize(2, InviterIdentity); + } + if (hasInviteeIdentity) { + size += pb::CodedOutputStream.ComputeMessageSize(3, InviteeIdentity); + } + if (hasInviterName) { + size += pb::CodedOutputStream.ComputeStringSize(4, InviterName); + } + if (hasInviteeName) { + size += pb::CodedOutputStream.ComputeStringSize(5, InviteeName); + } + if (hasInvitationMessage) { + size += pb::CodedOutputStream.ComputeStringSize(6, InvitationMessage); + } + if (hasCreationTime) { + size += pb::CodedOutputStream.ComputeUInt64Size(7, CreationTime); + } + if (hasExpirationTime) { + size += pb::CodedOutputStream.ComputeUInt64Size(8, ExpirationTime); + } + size += ExtensionsSerializedSize; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static Invitation ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Invitation ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Invitation ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Invitation ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Invitation ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Invitation ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Invitation ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Invitation ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Invitation ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Invitation ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Invitation MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Invitation prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::ExtendableBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Invitation cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Invitation result; + + private Invitation PrepareBuilder() { + if (resultIsReadOnly) { + Invitation original = result; + result = new Invitation(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Invitation MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.invitation.Invitation.Descriptor; } + } + + public override Invitation DefaultInstanceForType { + get { return global::bnet.protocol.invitation.Invitation.DefaultInstance; } + } + + public override Invitation BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Invitation) { + return MergeFrom((Invitation) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Invitation other) { + if (other == global::bnet.protocol.invitation.Invitation.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasId) { + Id = other.Id; + } + if (other.HasInviterIdentity) { + MergeInviterIdentity(other.InviterIdentity); + } + if (other.HasInviteeIdentity) { + MergeInviteeIdentity(other.InviteeIdentity); + } + if (other.HasInviterName) { + InviterName = other.InviterName; + } + if (other.HasInviteeName) { + InviteeName = other.InviteeName; + } + if (other.HasInvitationMessage) { + InvitationMessage = other.InvitationMessage; + } + if (other.HasCreationTime) { + CreationTime = other.CreationTime; + } + if (other.HasExpirationTime) { + ExpirationTime = other.ExpirationTime; + } + this.MergeExtensionFields(other); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_invitationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _invitationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 9: { + result.hasId = input.ReadFixed64(ref result.id_); + break; + } + case 18: { + global::bnet.protocol.Identity.Builder subBuilder = global::bnet.protocol.Identity.CreateBuilder(); + if (result.hasInviterIdentity) { + subBuilder.MergeFrom(InviterIdentity); + } + input.ReadMessage(subBuilder, extensionRegistry); + InviterIdentity = subBuilder.BuildPartial(); + break; + } + case 26: { + global::bnet.protocol.Identity.Builder subBuilder = global::bnet.protocol.Identity.CreateBuilder(); + if (result.hasInviteeIdentity) { + subBuilder.MergeFrom(InviteeIdentity); + } + input.ReadMessage(subBuilder, extensionRegistry); + InviteeIdentity = subBuilder.BuildPartial(); + break; + } + case 34: { + result.hasInviterName = input.ReadString(ref result.inviterName_); + break; + } + case 42: { + result.hasInviteeName = input.ReadString(ref result.inviteeName_); + break; + } + case 50: { + result.hasInvitationMessage = input.ReadString(ref result.invitationMessage_); + break; + } + case 56: { + result.hasCreationTime = input.ReadUInt64(ref result.creationTime_); + break; + } + case 64: { + result.hasExpirationTime = input.ReadUInt64(ref result.expirationTime_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasId { + get { return result.hasId; } + } + public ulong Id { + get { return result.Id; } + set { SetId(value); } + } + public Builder SetId(ulong value) { + PrepareBuilder(); + result.hasId = true; + result.id_ = value; + return this; + } + public Builder ClearId() { + PrepareBuilder(); + result.hasId = false; + result.id_ = 0; + return this; + } + + public bool HasInviterIdentity { + get { return result.hasInviterIdentity; } + } + public global::bnet.protocol.Identity InviterIdentity { + get { return result.InviterIdentity; } + set { SetInviterIdentity(value); } + } + public Builder SetInviterIdentity(global::bnet.protocol.Identity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasInviterIdentity = true; + result.inviterIdentity_ = value; + return this; + } + public Builder SetInviterIdentity(global::bnet.protocol.Identity.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasInviterIdentity = true; + result.inviterIdentity_ = builderForValue.Build(); + return this; + } + public Builder MergeInviterIdentity(global::bnet.protocol.Identity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasInviterIdentity && + result.inviterIdentity_ != global::bnet.protocol.Identity.DefaultInstance) { + result.inviterIdentity_ = global::bnet.protocol.Identity.CreateBuilder(result.inviterIdentity_).MergeFrom(value).BuildPartial(); + } else { + result.inviterIdentity_ = value; + } + result.hasInviterIdentity = true; + return this; + } + public Builder ClearInviterIdentity() { + PrepareBuilder(); + result.hasInviterIdentity = false; + result.inviterIdentity_ = null; + return this; + } + + public bool HasInviteeIdentity { + get { return result.hasInviteeIdentity; } + } + public global::bnet.protocol.Identity InviteeIdentity { + get { return result.InviteeIdentity; } + set { SetInviteeIdentity(value); } + } + public Builder SetInviteeIdentity(global::bnet.protocol.Identity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasInviteeIdentity = true; + result.inviteeIdentity_ = value; + return this; + } + public Builder SetInviteeIdentity(global::bnet.protocol.Identity.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasInviteeIdentity = true; + result.inviteeIdentity_ = builderForValue.Build(); + return this; + } + public Builder MergeInviteeIdentity(global::bnet.protocol.Identity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasInviteeIdentity && + result.inviteeIdentity_ != global::bnet.protocol.Identity.DefaultInstance) { + result.inviteeIdentity_ = global::bnet.protocol.Identity.CreateBuilder(result.inviteeIdentity_).MergeFrom(value).BuildPartial(); + } else { + result.inviteeIdentity_ = value; + } + result.hasInviteeIdentity = true; + return this; + } + public Builder ClearInviteeIdentity() { + PrepareBuilder(); + result.hasInviteeIdentity = false; + result.inviteeIdentity_ = null; + return this; + } + + public bool HasInviterName { + get { return result.hasInviterName; } + } + public string InviterName { + get { return result.InviterName; } + set { SetInviterName(value); } + } + public Builder SetInviterName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasInviterName = true; + result.inviterName_ = value; + return this; + } + public Builder ClearInviterName() { + PrepareBuilder(); + result.hasInviterName = false; + result.inviterName_ = ""; + return this; + } + + public bool HasInviteeName { + get { return result.hasInviteeName; } + } + public string InviteeName { + get { return result.InviteeName; } + set { SetInviteeName(value); } + } + public Builder SetInviteeName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasInviteeName = true; + result.inviteeName_ = value; + return this; + } + public Builder ClearInviteeName() { + PrepareBuilder(); + result.hasInviteeName = false; + result.inviteeName_ = ""; + return this; + } + + public bool HasInvitationMessage { + get { return result.hasInvitationMessage; } + } + public string InvitationMessage { + get { return result.InvitationMessage; } + set { SetInvitationMessage(value); } + } + public Builder SetInvitationMessage(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasInvitationMessage = true; + result.invitationMessage_ = value; + return this; + } + public Builder ClearInvitationMessage() { + PrepareBuilder(); + result.hasInvitationMessage = false; + result.invitationMessage_ = ""; + return this; + } + + public bool HasCreationTime { + get { return result.hasCreationTime; } + } + public ulong CreationTime { + get { return result.CreationTime; } + set { SetCreationTime(value); } + } + public Builder SetCreationTime(ulong value) { + PrepareBuilder(); + result.hasCreationTime = true; + result.creationTime_ = value; + return this; + } + public Builder ClearCreationTime() { + PrepareBuilder(); + result.hasCreationTime = false; + result.creationTime_ = 0UL; + return this; + } + + public bool HasExpirationTime { + get { return result.hasExpirationTime; } + } + public ulong ExpirationTime { + get { return result.ExpirationTime; } + set { SetExpirationTime(value); } + } + public Builder SetExpirationTime(ulong value) { + PrepareBuilder(); + result.hasExpirationTime = true; + result.expirationTime_ = value; + return this; + } + public Builder ClearExpirationTime() { + PrepareBuilder(); + result.hasExpirationTime = false; + result.expirationTime_ = 0UL; + return this; + } + } + static Invitation() { + object.ReferenceEquals(global::bnet.protocol.invitation.InvitationTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Suggestion : pb::GeneratedMessage { + private Suggestion() { } + private static readonly Suggestion defaultInstance = new Suggestion().MakeReadOnly(); + private static readonly string[] _suggestionFieldNames = new string[] { "channel_id", "suggestee_id", "suggestee_name", "suggester_account_id", "suggester_id", "suggester_name" }; + private static readonly uint[] _suggestionFieldTags = new uint[] { 10, 26, 42, 50, 18, 34 }; + public static Suggestion DefaultInstance { + get { return defaultInstance; } + } + + public override Suggestion DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Suggestion ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.invitation.InvitationTypes.internal__static_bnet_protocol_invitation_Suggestion__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.invitation.InvitationTypes.internal__static_bnet_protocol_invitation_Suggestion__FieldAccessorTable; } + } + + public const int ChannelIdFieldNumber = 1; + private bool hasChannelId; + private global::bnet.protocol.EntityId channelId_; + public bool HasChannelId { + get { return hasChannelId; } + } + public global::bnet.protocol.EntityId ChannelId { + get { return channelId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int SuggesterIdFieldNumber = 2; + private bool hasSuggesterId; + private global::bnet.protocol.EntityId suggesterId_; + public bool HasSuggesterId { + get { return hasSuggesterId; } + } + public global::bnet.protocol.EntityId SuggesterId { + get { return suggesterId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int SuggesteeIdFieldNumber = 3; + private bool hasSuggesteeId; + private global::bnet.protocol.EntityId suggesteeId_; + public bool HasSuggesteeId { + get { return hasSuggesteeId; } + } + public global::bnet.protocol.EntityId SuggesteeId { + get { return suggesteeId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int SuggesterNameFieldNumber = 4; + private bool hasSuggesterName; + private string suggesterName_ = ""; + public bool HasSuggesterName { + get { return hasSuggesterName; } + } + public string SuggesterName { + get { return suggesterName_; } + } + + public const int SuggesteeNameFieldNumber = 5; + private bool hasSuggesteeName; + private string suggesteeName_ = ""; + public bool HasSuggesteeName { + get { return hasSuggesteeName; } + } + public string SuggesteeName { + get { return suggesteeName_; } + } + + public const int SuggesterAccountIdFieldNumber = 6; + private bool hasSuggesterAccountId; + private global::bnet.protocol.EntityId suggesterAccountId_; + public bool HasSuggesterAccountId { + get { return hasSuggesterAccountId; } + } + public global::bnet.protocol.EntityId SuggesterAccountId { + get { return suggesterAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasSuggesterId) return false; + if (!hasSuggesteeId) return false; + if (HasChannelId) { + if (!ChannelId.IsInitialized) return false; + } + if (!SuggesterId.IsInitialized) return false; + if (!SuggesteeId.IsInitialized) return false; + if (HasSuggesterAccountId) { + if (!SuggesterAccountId.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _suggestionFieldNames; + if (hasChannelId) { + output.WriteMessage(1, field_names[0], ChannelId); + } + if (hasSuggesterId) { + output.WriteMessage(2, field_names[4], SuggesterId); + } + if (hasSuggesteeId) { + output.WriteMessage(3, field_names[1], SuggesteeId); + } + if (hasSuggesterName) { + output.WriteString(4, field_names[5], SuggesterName); + } + if (hasSuggesteeName) { + output.WriteString(5, field_names[2], SuggesteeName); + } + if (hasSuggesterAccountId) { + output.WriteMessage(6, field_names[3], SuggesterAccountId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasChannelId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, ChannelId); + } + if (hasSuggesterId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, SuggesterId); + } + if (hasSuggesteeId) { + size += pb::CodedOutputStream.ComputeMessageSize(3, SuggesteeId); + } + if (hasSuggesterName) { + size += pb::CodedOutputStream.ComputeStringSize(4, SuggesterName); + } + if (hasSuggesteeName) { + size += pb::CodedOutputStream.ComputeStringSize(5, SuggesteeName); + } + if (hasSuggesterAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(6, SuggesterAccountId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static Suggestion ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Suggestion ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Suggestion ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Suggestion ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Suggestion ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Suggestion ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Suggestion ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Suggestion ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Suggestion ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Suggestion ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Suggestion MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Suggestion prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Suggestion cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Suggestion result; + + private Suggestion PrepareBuilder() { + if (resultIsReadOnly) { + Suggestion original = result; + result = new Suggestion(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Suggestion MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.invitation.Suggestion.Descriptor; } + } + + public override Suggestion DefaultInstanceForType { + get { return global::bnet.protocol.invitation.Suggestion.DefaultInstance; } + } + + public override Suggestion BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Suggestion) { + return MergeFrom((Suggestion) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Suggestion other) { + if (other == global::bnet.protocol.invitation.Suggestion.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasChannelId) { + MergeChannelId(other.ChannelId); + } + if (other.HasSuggesterId) { + MergeSuggesterId(other.SuggesterId); + } + if (other.HasSuggesteeId) { + MergeSuggesteeId(other.SuggesteeId); + } + if (other.HasSuggesterName) { + SuggesterName = other.SuggesterName; + } + if (other.HasSuggesteeName) { + SuggesteeName = other.SuggesteeName; + } + if (other.HasSuggesterAccountId) { + MergeSuggesterAccountId(other.SuggesterAccountId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_suggestionFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _suggestionFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasChannelId) { + subBuilder.MergeFrom(ChannelId); + } + input.ReadMessage(subBuilder, extensionRegistry); + ChannelId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasSuggesterId) { + subBuilder.MergeFrom(SuggesterId); + } + input.ReadMessage(subBuilder, extensionRegistry); + SuggesterId = subBuilder.BuildPartial(); + break; + } + case 26: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasSuggesteeId) { + subBuilder.MergeFrom(SuggesteeId); + } + input.ReadMessage(subBuilder, extensionRegistry); + SuggesteeId = subBuilder.BuildPartial(); + break; + } + case 34: { + result.hasSuggesterName = input.ReadString(ref result.suggesterName_); + break; + } + case 42: { + result.hasSuggesteeName = input.ReadString(ref result.suggesteeName_); + break; + } + case 50: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasSuggesterAccountId) { + subBuilder.MergeFrom(SuggesterAccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + SuggesterAccountId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasChannelId { + get { return result.hasChannelId; } + } + public global::bnet.protocol.EntityId ChannelId { + get { return result.ChannelId; } + set { SetChannelId(value); } + } + public Builder SetChannelId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasChannelId = true; + result.channelId_ = value; + return this; + } + public Builder SetChannelId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasChannelId = true; + result.channelId_ = builderForValue.Build(); + return this; + } + public Builder MergeChannelId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasChannelId && + result.channelId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.channelId_ = global::bnet.protocol.EntityId.CreateBuilder(result.channelId_).MergeFrom(value).BuildPartial(); + } else { + result.channelId_ = value; + } + result.hasChannelId = true; + return this; + } + public Builder ClearChannelId() { + PrepareBuilder(); + result.hasChannelId = false; + result.channelId_ = null; + return this; + } + + public bool HasSuggesterId { + get { return result.hasSuggesterId; } + } + public global::bnet.protocol.EntityId SuggesterId { + get { return result.SuggesterId; } + set { SetSuggesterId(value); } + } + public Builder SetSuggesterId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasSuggesterId = true; + result.suggesterId_ = value; + return this; + } + public Builder SetSuggesterId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasSuggesterId = true; + result.suggesterId_ = builderForValue.Build(); + return this; + } + public Builder MergeSuggesterId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasSuggesterId && + result.suggesterId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.suggesterId_ = global::bnet.protocol.EntityId.CreateBuilder(result.suggesterId_).MergeFrom(value).BuildPartial(); + } else { + result.suggesterId_ = value; + } + result.hasSuggesterId = true; + return this; + } + public Builder ClearSuggesterId() { + PrepareBuilder(); + result.hasSuggesterId = false; + result.suggesterId_ = null; + return this; + } + + public bool HasSuggesteeId { + get { return result.hasSuggesteeId; } + } + public global::bnet.protocol.EntityId SuggesteeId { + get { return result.SuggesteeId; } + set { SetSuggesteeId(value); } + } + public Builder SetSuggesteeId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasSuggesteeId = true; + result.suggesteeId_ = value; + return this; + } + public Builder SetSuggesteeId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasSuggesteeId = true; + result.suggesteeId_ = builderForValue.Build(); + return this; + } + public Builder MergeSuggesteeId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasSuggesteeId && + result.suggesteeId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.suggesteeId_ = global::bnet.protocol.EntityId.CreateBuilder(result.suggesteeId_).MergeFrom(value).BuildPartial(); + } else { + result.suggesteeId_ = value; + } + result.hasSuggesteeId = true; + return this; + } + public Builder ClearSuggesteeId() { + PrepareBuilder(); + result.hasSuggesteeId = false; + result.suggesteeId_ = null; + return this; + } + + public bool HasSuggesterName { + get { return result.hasSuggesterName; } + } + public string SuggesterName { + get { return result.SuggesterName; } + set { SetSuggesterName(value); } + } + public Builder SetSuggesterName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasSuggesterName = true; + result.suggesterName_ = value; + return this; + } + public Builder ClearSuggesterName() { + PrepareBuilder(); + result.hasSuggesterName = false; + result.suggesterName_ = ""; + return this; + } + + public bool HasSuggesteeName { + get { return result.hasSuggesteeName; } + } + public string SuggesteeName { + get { return result.SuggesteeName; } + set { SetSuggesteeName(value); } + } + public Builder SetSuggesteeName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasSuggesteeName = true; + result.suggesteeName_ = value; + return this; + } + public Builder ClearSuggesteeName() { + PrepareBuilder(); + result.hasSuggesteeName = false; + result.suggesteeName_ = ""; + return this; + } + + public bool HasSuggesterAccountId { + get { return result.hasSuggesterAccountId; } + } + public global::bnet.protocol.EntityId SuggesterAccountId { + get { return result.SuggesterAccountId; } + set { SetSuggesterAccountId(value); } + } + public Builder SetSuggesterAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasSuggesterAccountId = true; + result.suggesterAccountId_ = value; + return this; + } + public Builder SetSuggesterAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasSuggesterAccountId = true; + result.suggesterAccountId_ = builderForValue.Build(); + return this; + } + public Builder MergeSuggesterAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasSuggesterAccountId && + result.suggesterAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.suggesterAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.suggesterAccountId_).MergeFrom(value).BuildPartial(); + } else { + result.suggesterAccountId_ = value; + } + result.hasSuggesterAccountId = true; + return this; + } + public Builder ClearSuggesterAccountId() { + PrepareBuilder(); + result.hasSuggesterAccountId = false; + result.suggesterAccountId_ = null; + return this; + } + } + static Suggestion() { + object.ReferenceEquals(global::bnet.protocol.invitation.InvitationTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class InvitationParams : pb::ExtendableMessage { + private InvitationParams() { } + private static readonly InvitationParams defaultInstance = new InvitationParams().MakeReadOnly(); + private static readonly string[] _invitationParamsFieldNames = new string[] { "expiration_time", "invitation_message" }; + private static readonly uint[] _invitationParamsFieldTags = new uint[] { 16, 10 }; + public static InvitationParams DefaultInstance { + get { return defaultInstance; } + } + + public override InvitationParams DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override InvitationParams ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.invitation.InvitationTypes.internal__static_bnet_protocol_invitation_InvitationParams__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.invitation.InvitationTypes.internal__static_bnet_protocol_invitation_InvitationParams__FieldAccessorTable; } + } + + public const int InvitationMessageFieldNumber = 1; + private bool hasInvitationMessage; + private string invitationMessage_ = ""; + public bool HasInvitationMessage { + get { return hasInvitationMessage; } + } + public string InvitationMessage { + get { return invitationMessage_; } + } + + public const int ExpirationTimeFieldNumber = 2; + private bool hasExpirationTime; + private ulong expirationTime_; + public bool HasExpirationTime { + get { return hasExpirationTime; } + } + public ulong ExpirationTime { + get { return expirationTime_; } + } + + public override bool IsInitialized { + get { + if (!ExtensionsAreInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _invitationParamsFieldNames; + pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); + if (hasInvitationMessage) { + output.WriteString(1, field_names[1], InvitationMessage); + } + if (hasExpirationTime) { + output.WriteUInt64(2, field_names[0], ExpirationTime); + } + extensionWriter.WriteUntil(10001, output); + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasInvitationMessage) { + size += pb::CodedOutputStream.ComputeStringSize(1, InvitationMessage); + } + if (hasExpirationTime) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, ExpirationTime); + } + size += ExtensionsSerializedSize; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static InvitationParams ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static InvitationParams ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static InvitationParams ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static InvitationParams ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static InvitationParams ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static InvitationParams ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static InvitationParams ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static InvitationParams ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static InvitationParams ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static InvitationParams ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private InvitationParams MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(InvitationParams prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::ExtendableBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(InvitationParams cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private InvitationParams result; + + private InvitationParams PrepareBuilder() { + if (resultIsReadOnly) { + InvitationParams original = result; + result = new InvitationParams(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override InvitationParams MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.invitation.InvitationParams.Descriptor; } + } + + public override InvitationParams DefaultInstanceForType { + get { return global::bnet.protocol.invitation.InvitationParams.DefaultInstance; } + } + + public override InvitationParams BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is InvitationParams) { + return MergeFrom((InvitationParams) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(InvitationParams other) { + if (other == global::bnet.protocol.invitation.InvitationParams.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasInvitationMessage) { + InvitationMessage = other.InvitationMessage; + } + if (other.HasExpirationTime) { + ExpirationTime = other.ExpirationTime; + } + this.MergeExtensionFields(other); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_invitationParamsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _invitationParamsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasInvitationMessage = input.ReadString(ref result.invitationMessage_); + break; + } + case 16: { + result.hasExpirationTime = input.ReadUInt64(ref result.expirationTime_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasInvitationMessage { + get { return result.hasInvitationMessage; } + } + public string InvitationMessage { + get { return result.InvitationMessage; } + set { SetInvitationMessage(value); } + } + public Builder SetInvitationMessage(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasInvitationMessage = true; + result.invitationMessage_ = value; + return this; + } + public Builder ClearInvitationMessage() { + PrepareBuilder(); + result.hasInvitationMessage = false; + result.invitationMessage_ = ""; + return this; + } + + public bool HasExpirationTime { + get { return result.hasExpirationTime; } + } + public ulong ExpirationTime { + get { return result.ExpirationTime; } + set { SetExpirationTime(value); } + } + public Builder SetExpirationTime(ulong value) { + PrepareBuilder(); + result.hasExpirationTime = true; + result.expirationTime_ = value; + return this; + } + public Builder ClearExpirationTime() { + PrepareBuilder(); + result.hasExpirationTime = false; + result.expirationTime_ = 0UL; + return this; + } + } + static InvitationParams() { + object.ReferenceEquals(global::bnet.protocol.invitation.InvitationTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class SendInvitationRequest : pb::GeneratedMessage { + private SendInvitationRequest() { } + private static readonly SendInvitationRequest defaultInstance = new SendInvitationRequest().MakeReadOnly(); + private static readonly string[] _sendInvitationRequestFieldNames = new string[] { "agent_identity", "agent_info", "params", "target_id" }; + private static readonly uint[] _sendInvitationRequestFieldTags = new uint[] { 10, 34, 26, 18 }; + public static SendInvitationRequest DefaultInstance { + get { return defaultInstance; } + } + + public override SendInvitationRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SendInvitationRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.invitation.InvitationTypes.internal__static_bnet_protocol_invitation_SendInvitationRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.invitation.InvitationTypes.internal__static_bnet_protocol_invitation_SendInvitationRequest__FieldAccessorTable; } + } + + public const int AgentIdentityFieldNumber = 1; + private bool hasAgentIdentity; + private global::bnet.protocol.Identity agentIdentity_; + public bool HasAgentIdentity { + get { return hasAgentIdentity; } + } + public global::bnet.protocol.Identity AgentIdentity { + get { return agentIdentity_ ?? global::bnet.protocol.Identity.DefaultInstance; } + } + + public const int TargetIdFieldNumber = 2; + private bool hasTargetId; + private global::bnet.protocol.EntityId targetId_; + public bool HasTargetId { + get { return hasTargetId; } + } + public global::bnet.protocol.EntityId TargetId { + get { return targetId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int ParamsFieldNumber = 3; + private bool hasParams; + private global::bnet.protocol.invitation.InvitationParams params_; + public bool HasParams { + get { return hasParams; } + } + public global::bnet.protocol.invitation.InvitationParams Params { + get { return params_ ?? global::bnet.protocol.invitation.InvitationParams.DefaultInstance; } + } + + public const int AgentInfoFieldNumber = 4; + private bool hasAgentInfo; + private global::bnet.protocol.AccountInfo agentInfo_; + public bool HasAgentInfo { + get { return hasAgentInfo; } + } + public global::bnet.protocol.AccountInfo AgentInfo { + get { return agentInfo_ ?? global::bnet.protocol.AccountInfo.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasTargetId) return false; + if (!hasParams) return false; + if (HasAgentIdentity) { + if (!AgentIdentity.IsInitialized) return false; + } + if (!TargetId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _sendInvitationRequestFieldNames; + if (hasAgentIdentity) { + output.WriteMessage(1, field_names[0], AgentIdentity); + } + if (hasTargetId) { + output.WriteMessage(2, field_names[3], TargetId); + } + if (hasParams) { + output.WriteMessage(3, field_names[2], Params); + } + if (hasAgentInfo) { + output.WriteMessage(4, field_names[1], AgentInfo); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAgentIdentity) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AgentIdentity); + } + if (hasTargetId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, TargetId); + } + if (hasParams) { + size += pb::CodedOutputStream.ComputeMessageSize(3, Params); + } + if (hasAgentInfo) { + size += pb::CodedOutputStream.ComputeMessageSize(4, AgentInfo); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static SendInvitationRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SendInvitationRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SendInvitationRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SendInvitationRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SendInvitationRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SendInvitationRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SendInvitationRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SendInvitationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SendInvitationRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SendInvitationRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SendInvitationRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SendInvitationRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SendInvitationRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SendInvitationRequest result; + + private SendInvitationRequest PrepareBuilder() { + if (resultIsReadOnly) { + SendInvitationRequest original = result; + result = new SendInvitationRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SendInvitationRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.invitation.SendInvitationRequest.Descriptor; } + } + + public override SendInvitationRequest DefaultInstanceForType { + get { return global::bnet.protocol.invitation.SendInvitationRequest.DefaultInstance; } + } + + public override SendInvitationRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SendInvitationRequest) { + return MergeFrom((SendInvitationRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SendInvitationRequest other) { + if (other == global::bnet.protocol.invitation.SendInvitationRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAgentIdentity) { + MergeAgentIdentity(other.AgentIdentity); + } + if (other.HasTargetId) { + MergeTargetId(other.TargetId); + } + if (other.HasParams) { + MergeParams(other.Params); + } + if (other.HasAgentInfo) { + MergeAgentInfo(other.AgentInfo); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_sendInvitationRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _sendInvitationRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.Identity.Builder subBuilder = global::bnet.protocol.Identity.CreateBuilder(); + if (result.hasAgentIdentity) { + subBuilder.MergeFrom(AgentIdentity); + } + input.ReadMessage(subBuilder, extensionRegistry); + AgentIdentity = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasTargetId) { + subBuilder.MergeFrom(TargetId); + } + input.ReadMessage(subBuilder, extensionRegistry); + TargetId = subBuilder.BuildPartial(); + break; + } + case 26: { + global::bnet.protocol.invitation.InvitationParams.Builder subBuilder = global::bnet.protocol.invitation.InvitationParams.CreateBuilder(); + if (result.hasParams) { + subBuilder.MergeFrom(Params); + } + input.ReadMessage(subBuilder, extensionRegistry); + Params = subBuilder.BuildPartial(); + break; + } + case 34: { + global::bnet.protocol.AccountInfo.Builder subBuilder = global::bnet.protocol.AccountInfo.CreateBuilder(); + if (result.hasAgentInfo) { + subBuilder.MergeFrom(AgentInfo); + } + input.ReadMessage(subBuilder, extensionRegistry); + AgentInfo = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAgentIdentity { + get { return result.hasAgentIdentity; } + } + public global::bnet.protocol.Identity AgentIdentity { + get { return result.AgentIdentity; } + set { SetAgentIdentity(value); } + } + public Builder SetAgentIdentity(global::bnet.protocol.Identity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAgentIdentity = true; + result.agentIdentity_ = value; + return this; + } + public Builder SetAgentIdentity(global::bnet.protocol.Identity.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAgentIdentity = true; + result.agentIdentity_ = builderForValue.Build(); + return this; + } + public Builder MergeAgentIdentity(global::bnet.protocol.Identity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAgentIdentity && + result.agentIdentity_ != global::bnet.protocol.Identity.DefaultInstance) { + result.agentIdentity_ = global::bnet.protocol.Identity.CreateBuilder(result.agentIdentity_).MergeFrom(value).BuildPartial(); + } else { + result.agentIdentity_ = value; + } + result.hasAgentIdentity = true; + return this; + } + public Builder ClearAgentIdentity() { + PrepareBuilder(); + result.hasAgentIdentity = false; + result.agentIdentity_ = null; + return this; + } + + public bool HasTargetId { + get { return result.hasTargetId; } + } + public global::bnet.protocol.EntityId TargetId { + get { return result.TargetId; } + set { SetTargetId(value); } + } + public Builder SetTargetId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTargetId = true; + result.targetId_ = value; + return this; + } + public Builder SetTargetId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasTargetId = true; + result.targetId_ = builderForValue.Build(); + return this; + } + public Builder MergeTargetId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasTargetId && + result.targetId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.targetId_ = global::bnet.protocol.EntityId.CreateBuilder(result.targetId_).MergeFrom(value).BuildPartial(); + } else { + result.targetId_ = value; + } + result.hasTargetId = true; + return this; + } + public Builder ClearTargetId() { + PrepareBuilder(); + result.hasTargetId = false; + result.targetId_ = null; + return this; + } + + public bool HasParams { + get { return result.hasParams; } + } + public global::bnet.protocol.invitation.InvitationParams Params { + get { return result.Params; } + set { SetParams(value); } + } + public Builder SetParams(global::bnet.protocol.invitation.InvitationParams value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasParams = true; + result.params_ = value; + return this; + } + public Builder SetParams(global::bnet.protocol.invitation.InvitationParams.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasParams = true; + result.params_ = builderForValue.Build(); + return this; + } + public Builder MergeParams(global::bnet.protocol.invitation.InvitationParams value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasParams && + result.params_ != global::bnet.protocol.invitation.InvitationParams.DefaultInstance) { + result.params_ = global::bnet.protocol.invitation.InvitationParams.CreateBuilder(result.params_).MergeFrom(value).BuildPartial(); + } else { + result.params_ = value; + } + result.hasParams = true; + return this; + } + public Builder ClearParams() { + PrepareBuilder(); + result.hasParams = false; + result.params_ = null; + return this; + } + + public bool HasAgentInfo { + get { return result.hasAgentInfo; } + } + public global::bnet.protocol.AccountInfo AgentInfo { + get { return result.AgentInfo; } + set { SetAgentInfo(value); } + } + public Builder SetAgentInfo(global::bnet.protocol.AccountInfo value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAgentInfo = true; + result.agentInfo_ = value; + return this; + } + public Builder SetAgentInfo(global::bnet.protocol.AccountInfo.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAgentInfo = true; + result.agentInfo_ = builderForValue.Build(); + return this; + } + public Builder MergeAgentInfo(global::bnet.protocol.AccountInfo value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAgentInfo && + result.agentInfo_ != global::bnet.protocol.AccountInfo.DefaultInstance) { + result.agentInfo_ = global::bnet.protocol.AccountInfo.CreateBuilder(result.agentInfo_).MergeFrom(value).BuildPartial(); + } else { + result.agentInfo_ = value; + } + result.hasAgentInfo = true; + return this; + } + public Builder ClearAgentInfo() { + PrepareBuilder(); + result.hasAgentInfo = false; + result.agentInfo_ = null; + return this; + } + } + static SendInvitationRequest() { + object.ReferenceEquals(global::bnet.protocol.invitation.InvitationTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class SendInvitationResponse : pb::GeneratedMessage { + private SendInvitationResponse() { } + private static readonly SendInvitationResponse defaultInstance = new SendInvitationResponse().MakeReadOnly(); + private static readonly string[] _sendInvitationResponseFieldNames = new string[] { "invitation" }; + private static readonly uint[] _sendInvitationResponseFieldTags = new uint[] { 18 }; + public static SendInvitationResponse DefaultInstance { + get { return defaultInstance; } + } + + public override SendInvitationResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SendInvitationResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.invitation.InvitationTypes.internal__static_bnet_protocol_invitation_SendInvitationResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.invitation.InvitationTypes.internal__static_bnet_protocol_invitation_SendInvitationResponse__FieldAccessorTable; } + } + + public const int InvitationFieldNumber = 2; + private bool hasInvitation; + private global::bnet.protocol.invitation.Invitation invitation_; + public bool HasInvitation { + get { return hasInvitation; } + } + public global::bnet.protocol.invitation.Invitation Invitation { + get { return invitation_ ?? global::bnet.protocol.invitation.Invitation.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (HasInvitation) { + if (!Invitation.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _sendInvitationResponseFieldNames; + if (hasInvitation) { + output.WriteMessage(2, field_names[0], Invitation); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasInvitation) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Invitation); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static SendInvitationResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SendInvitationResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SendInvitationResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SendInvitationResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SendInvitationResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SendInvitationResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SendInvitationResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SendInvitationResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SendInvitationResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SendInvitationResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SendInvitationResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SendInvitationResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SendInvitationResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SendInvitationResponse result; + + private SendInvitationResponse PrepareBuilder() { + if (resultIsReadOnly) { + SendInvitationResponse original = result; + result = new SendInvitationResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SendInvitationResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.invitation.SendInvitationResponse.Descriptor; } + } + + public override SendInvitationResponse DefaultInstanceForType { + get { return global::bnet.protocol.invitation.SendInvitationResponse.DefaultInstance; } + } + + public override SendInvitationResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SendInvitationResponse) { + return MergeFrom((SendInvitationResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SendInvitationResponse other) { + if (other == global::bnet.protocol.invitation.SendInvitationResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasInvitation) { + MergeInvitation(other.Invitation); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_sendInvitationResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _sendInvitationResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 18: { + global::bnet.protocol.invitation.Invitation.Builder subBuilder = global::bnet.protocol.invitation.Invitation.CreateBuilder(); + if (result.hasInvitation) { + subBuilder.MergeFrom(Invitation); + } + input.ReadMessage(subBuilder, extensionRegistry); + Invitation = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasInvitation { + get { return result.hasInvitation; } + } + public global::bnet.protocol.invitation.Invitation Invitation { + get { return result.Invitation; } + set { SetInvitation(value); } + } + public Builder SetInvitation(global::bnet.protocol.invitation.Invitation value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasInvitation = true; + result.invitation_ = value; + return this; + } + public Builder SetInvitation(global::bnet.protocol.invitation.Invitation.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasInvitation = true; + result.invitation_ = builderForValue.Build(); + return this; + } + public Builder MergeInvitation(global::bnet.protocol.invitation.Invitation value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasInvitation && + result.invitation_ != global::bnet.protocol.invitation.Invitation.DefaultInstance) { + result.invitation_ = global::bnet.protocol.invitation.Invitation.CreateBuilder(result.invitation_).MergeFrom(value).BuildPartial(); + } else { + result.invitation_ = value; + } + result.hasInvitation = true; + return this; + } + public Builder ClearInvitation() { + PrepareBuilder(); + result.hasInvitation = false; + result.invitation_ = null; + return this; + } + } + static SendInvitationResponse() { + object.ReferenceEquals(global::bnet.protocol.invitation.InvitationTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class UpdateInvitationRequest : pb::GeneratedMessage { + private UpdateInvitationRequest() { } + private static readonly UpdateInvitationRequest defaultInstance = new UpdateInvitationRequest().MakeReadOnly(); + private static readonly string[] _updateInvitationRequestFieldNames = new string[] { "agent_identity", "invitation_id", "params" }; + private static readonly uint[] _updateInvitationRequestFieldTags = new uint[] { 10, 17, 26 }; + public static UpdateInvitationRequest DefaultInstance { + get { return defaultInstance; } + } + + public override UpdateInvitationRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override UpdateInvitationRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.invitation.InvitationTypes.internal__static_bnet_protocol_invitation_UpdateInvitationRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.invitation.InvitationTypes.internal__static_bnet_protocol_invitation_UpdateInvitationRequest__FieldAccessorTable; } + } + + public const int AgentIdentityFieldNumber = 1; + private bool hasAgentIdentity; + private global::bnet.protocol.Identity agentIdentity_; + public bool HasAgentIdentity { + get { return hasAgentIdentity; } + } + public global::bnet.protocol.Identity AgentIdentity { + get { return agentIdentity_ ?? global::bnet.protocol.Identity.DefaultInstance; } + } + + public const int InvitationIdFieldNumber = 2; + private bool hasInvitationId; + private ulong invitationId_; + public bool HasInvitationId { + get { return hasInvitationId; } + } + public ulong InvitationId { + get { return invitationId_; } + } + + public const int ParamsFieldNumber = 3; + private bool hasParams; + private global::bnet.protocol.invitation.InvitationParams params_; + public bool HasParams { + get { return hasParams; } + } + public global::bnet.protocol.invitation.InvitationParams Params { + get { return params_ ?? global::bnet.protocol.invitation.InvitationParams.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasInvitationId) return false; + if (!hasParams) return false; + if (HasAgentIdentity) { + if (!AgentIdentity.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _updateInvitationRequestFieldNames; + if (hasAgentIdentity) { + output.WriteMessage(1, field_names[0], AgentIdentity); + } + if (hasInvitationId) { + output.WriteFixed64(2, field_names[1], InvitationId); + } + if (hasParams) { + output.WriteMessage(3, field_names[2], Params); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAgentIdentity) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AgentIdentity); + } + if (hasInvitationId) { + size += pb::CodedOutputStream.ComputeFixed64Size(2, InvitationId); + } + if (hasParams) { + size += pb::CodedOutputStream.ComputeMessageSize(3, Params); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static UpdateInvitationRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UpdateInvitationRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UpdateInvitationRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UpdateInvitationRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UpdateInvitationRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UpdateInvitationRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static UpdateInvitationRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static UpdateInvitationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static UpdateInvitationRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UpdateInvitationRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private UpdateInvitationRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(UpdateInvitationRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(UpdateInvitationRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private UpdateInvitationRequest result; + + private UpdateInvitationRequest PrepareBuilder() { + if (resultIsReadOnly) { + UpdateInvitationRequest original = result; + result = new UpdateInvitationRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override UpdateInvitationRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.invitation.UpdateInvitationRequest.Descriptor; } + } + + public override UpdateInvitationRequest DefaultInstanceForType { + get { return global::bnet.protocol.invitation.UpdateInvitationRequest.DefaultInstance; } + } + + public override UpdateInvitationRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is UpdateInvitationRequest) { + return MergeFrom((UpdateInvitationRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(UpdateInvitationRequest other) { + if (other == global::bnet.protocol.invitation.UpdateInvitationRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAgentIdentity) { + MergeAgentIdentity(other.AgentIdentity); + } + if (other.HasInvitationId) { + InvitationId = other.InvitationId; + } + if (other.HasParams) { + MergeParams(other.Params); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_updateInvitationRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _updateInvitationRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.Identity.Builder subBuilder = global::bnet.protocol.Identity.CreateBuilder(); + if (result.hasAgentIdentity) { + subBuilder.MergeFrom(AgentIdentity); + } + input.ReadMessage(subBuilder, extensionRegistry); + AgentIdentity = subBuilder.BuildPartial(); + break; + } + case 17: { + result.hasInvitationId = input.ReadFixed64(ref result.invitationId_); + break; + } + case 26: { + global::bnet.protocol.invitation.InvitationParams.Builder subBuilder = global::bnet.protocol.invitation.InvitationParams.CreateBuilder(); + if (result.hasParams) { + subBuilder.MergeFrom(Params); + } + input.ReadMessage(subBuilder, extensionRegistry); + Params = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAgentIdentity { + get { return result.hasAgentIdentity; } + } + public global::bnet.protocol.Identity AgentIdentity { + get { return result.AgentIdentity; } + set { SetAgentIdentity(value); } + } + public Builder SetAgentIdentity(global::bnet.protocol.Identity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAgentIdentity = true; + result.agentIdentity_ = value; + return this; + } + public Builder SetAgentIdentity(global::bnet.protocol.Identity.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAgentIdentity = true; + result.agentIdentity_ = builderForValue.Build(); + return this; + } + public Builder MergeAgentIdentity(global::bnet.protocol.Identity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAgentIdentity && + result.agentIdentity_ != global::bnet.protocol.Identity.DefaultInstance) { + result.agentIdentity_ = global::bnet.protocol.Identity.CreateBuilder(result.agentIdentity_).MergeFrom(value).BuildPartial(); + } else { + result.agentIdentity_ = value; + } + result.hasAgentIdentity = true; + return this; + } + public Builder ClearAgentIdentity() { + PrepareBuilder(); + result.hasAgentIdentity = false; + result.agentIdentity_ = null; + return this; + } + + public bool HasInvitationId { + get { return result.hasInvitationId; } + } + public ulong InvitationId { + get { return result.InvitationId; } + set { SetInvitationId(value); } + } + public Builder SetInvitationId(ulong value) { + PrepareBuilder(); + result.hasInvitationId = true; + result.invitationId_ = value; + return this; + } + public Builder ClearInvitationId() { + PrepareBuilder(); + result.hasInvitationId = false; + result.invitationId_ = 0; + return this; + } + + public bool HasParams { + get { return result.hasParams; } + } + public global::bnet.protocol.invitation.InvitationParams Params { + get { return result.Params; } + set { SetParams(value); } + } + public Builder SetParams(global::bnet.protocol.invitation.InvitationParams value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasParams = true; + result.params_ = value; + return this; + } + public Builder SetParams(global::bnet.protocol.invitation.InvitationParams.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasParams = true; + result.params_ = builderForValue.Build(); + return this; + } + public Builder MergeParams(global::bnet.protocol.invitation.InvitationParams value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasParams && + result.params_ != global::bnet.protocol.invitation.InvitationParams.DefaultInstance) { + result.params_ = global::bnet.protocol.invitation.InvitationParams.CreateBuilder(result.params_).MergeFrom(value).BuildPartial(); + } else { + result.params_ = value; + } + result.hasParams = true; + return this; + } + public Builder ClearParams() { + PrepareBuilder(); + result.hasParams = false; + result.params_ = null; + return this; + } + } + static UpdateInvitationRequest() { + object.ReferenceEquals(global::bnet.protocol.invitation.InvitationTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class GenericRequest : pb::GeneratedMessage { + private GenericRequest() { } + private static readonly GenericRequest defaultInstance = new GenericRequest().MakeReadOnly(); + private static readonly string[] _genericRequestFieldNames = new string[] { "agent_id", "desired_role", "invitation_id", "invitee_name", "inviter_name", "previous_role", "target_id" }; + private static readonly uint[] _genericRequestFieldTags = new uint[] { 10, 58, 25, 34, 42, 50, 18 }; + public static GenericRequest DefaultInstance { + get { return defaultInstance; } + } + + public override GenericRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GenericRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.invitation.InvitationTypes.internal__static_bnet_protocol_invitation_GenericRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.invitation.InvitationTypes.internal__static_bnet_protocol_invitation_GenericRequest__FieldAccessorTable; } + } + + public const int AgentIdFieldNumber = 1; + private bool hasAgentId; + private global::bnet.protocol.EntityId agentId_; + public bool HasAgentId { + get { return hasAgentId; } + } + public global::bnet.protocol.EntityId AgentId { + get { return agentId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int TargetIdFieldNumber = 2; + private bool hasTargetId; + private global::bnet.protocol.EntityId targetId_; + public bool HasTargetId { + get { return hasTargetId; } + } + public global::bnet.protocol.EntityId TargetId { + get { return targetId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int InvitationIdFieldNumber = 3; + private bool hasInvitationId; + private ulong invitationId_; + public bool HasInvitationId { + get { return hasInvitationId; } + } + public ulong InvitationId { + get { return invitationId_; } + } + + public const int InviteeNameFieldNumber = 4; + private bool hasInviteeName; + private string inviteeName_ = ""; + public bool HasInviteeName { + get { return hasInviteeName; } + } + public string InviteeName { + get { return inviteeName_; } + } + + public const int InviterNameFieldNumber = 5; + private bool hasInviterName; + private string inviterName_ = ""; + public bool HasInviterName { + get { return hasInviterName; } + } + public string InviterName { + get { return inviterName_; } + } + + public const int PreviousRoleFieldNumber = 6; + private int previousRoleMemoizedSerializedSize; + private pbc::PopsicleList previousRole_ = new pbc::PopsicleList(); + public scg::IList PreviousRoleList { + get { return pbc::Lists.AsReadOnly(previousRole_); } + } + public int PreviousRoleCount { + get { return previousRole_.Count; } + } + public uint GetPreviousRole(int index) { + return previousRole_[index]; + } + + public const int DesiredRoleFieldNumber = 7; + private int desiredRoleMemoizedSerializedSize; + private pbc::PopsicleList desiredRole_ = new pbc::PopsicleList(); + public scg::IList DesiredRoleList { + get { return pbc::Lists.AsReadOnly(desiredRole_); } + } + public int DesiredRoleCount { + get { return desiredRole_.Count; } + } + public uint GetDesiredRole(int index) { + return desiredRole_[index]; + } + + public override bool IsInitialized { + get { + if (!hasInvitationId) return false; + if (HasAgentId) { + if (!AgentId.IsInitialized) return false; + } + if (HasTargetId) { + if (!TargetId.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _genericRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); + } + if (hasTargetId) { + output.WriteMessage(2, field_names[6], TargetId); + } + if (hasInvitationId) { + output.WriteFixed64(3, field_names[2], InvitationId); + } + if (hasInviteeName) { + output.WriteString(4, field_names[3], InviteeName); + } + if (hasInviterName) { + output.WriteString(5, field_names[4], InviterName); + } + if (previousRole_.Count > 0) { + output.WritePackedUInt32Array(6, field_names[5], previousRoleMemoizedSerializedSize, previousRole_); + } + if (desiredRole_.Count > 0) { + output.WritePackedUInt32Array(7, field_names[1], desiredRoleMemoizedSerializedSize, desiredRole_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAgentId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); + } + if (hasTargetId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, TargetId); + } + if (hasInvitationId) { + size += pb::CodedOutputStream.ComputeFixed64Size(3, InvitationId); + } + if (hasInviteeName) { + size += pb::CodedOutputStream.ComputeStringSize(4, InviteeName); + } + if (hasInviterName) { + size += pb::CodedOutputStream.ComputeStringSize(5, InviterName); + } + { + int dataSize = 0; + foreach (uint element in PreviousRoleList) { + dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); + } + size += dataSize; + if (previousRole_.Count != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); + } + previousRoleMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + foreach (uint element in DesiredRoleList) { + dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); + } + size += dataSize; + if (desiredRole_.Count != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); + } + desiredRoleMemoizedSerializedSize = dataSize; + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static GenericRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GenericRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GenericRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GenericRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GenericRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GenericRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GenericRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GenericRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GenericRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GenericRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GenericRequest MakeReadOnly() { + previousRole_.MakeReadOnly(); + desiredRole_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GenericRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GenericRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GenericRequest result; + + private GenericRequest PrepareBuilder() { + if (resultIsReadOnly) { + GenericRequest original = result; + result = new GenericRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GenericRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.invitation.GenericRequest.Descriptor; } + } + + public override GenericRequest DefaultInstanceForType { + get { return global::bnet.protocol.invitation.GenericRequest.DefaultInstance; } + } + + public override GenericRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GenericRequest) { + return MergeFrom((GenericRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GenericRequest other) { + if (other == global::bnet.protocol.invitation.GenericRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAgentId) { + MergeAgentId(other.AgentId); + } + if (other.HasTargetId) { + MergeTargetId(other.TargetId); + } + if (other.HasInvitationId) { + InvitationId = other.InvitationId; + } + if (other.HasInviteeName) { + InviteeName = other.InviteeName; + } + if (other.HasInviterName) { + InviterName = other.InviterName; + } + if (other.previousRole_.Count != 0) { + result.previousRole_.Add(other.previousRole_); + } + if (other.desiredRole_.Count != 0) { + result.desiredRole_.Add(other.desiredRole_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_genericRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _genericRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasAgentId) { + subBuilder.MergeFrom(AgentId); + } + input.ReadMessage(subBuilder, extensionRegistry); + AgentId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasTargetId) { + subBuilder.MergeFrom(TargetId); + } + input.ReadMessage(subBuilder, extensionRegistry); + TargetId = subBuilder.BuildPartial(); + break; + } + case 25: { + result.hasInvitationId = input.ReadFixed64(ref result.invitationId_); + break; + } + case 34: { + result.hasInviteeName = input.ReadString(ref result.inviteeName_); + break; + } + case 42: { + result.hasInviterName = input.ReadString(ref result.inviterName_); + break; + } + case 50: + case 48: { + input.ReadUInt32Array(tag, field_name, result.previousRole_); + break; + } + case 58: + case 56: { + input.ReadUInt32Array(tag, field_name, result.desiredRole_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAgentId { + get { return result.hasAgentId; } + } + public global::bnet.protocol.EntityId AgentId { + get { return result.AgentId; } + set { SetAgentId(value); } + } + public Builder SetAgentId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAgentId = true; + result.agentId_ = value; + return this; + } + public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAgentId = true; + result.agentId_ = builderForValue.Build(); + return this; + } + public Builder MergeAgentId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAgentId && + result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); + } else { + result.agentId_ = value; + } + result.hasAgentId = true; + return this; + } + public Builder ClearAgentId() { + PrepareBuilder(); + result.hasAgentId = false; + result.agentId_ = null; + return this; + } + + public bool HasTargetId { + get { return result.hasTargetId; } + } + public global::bnet.protocol.EntityId TargetId { + get { return result.TargetId; } + set { SetTargetId(value); } + } + public Builder SetTargetId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTargetId = true; + result.targetId_ = value; + return this; + } + public Builder SetTargetId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasTargetId = true; + result.targetId_ = builderForValue.Build(); + return this; + } + public Builder MergeTargetId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasTargetId && + result.targetId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.targetId_ = global::bnet.protocol.EntityId.CreateBuilder(result.targetId_).MergeFrom(value).BuildPartial(); + } else { + result.targetId_ = value; + } + result.hasTargetId = true; + return this; + } + public Builder ClearTargetId() { + PrepareBuilder(); + result.hasTargetId = false; + result.targetId_ = null; + return this; + } + + public bool HasInvitationId { + get { return result.hasInvitationId; } + } + public ulong InvitationId { + get { return result.InvitationId; } + set { SetInvitationId(value); } + } + public Builder SetInvitationId(ulong value) { + PrepareBuilder(); + result.hasInvitationId = true; + result.invitationId_ = value; + return this; + } + public Builder ClearInvitationId() { + PrepareBuilder(); + result.hasInvitationId = false; + result.invitationId_ = 0; + return this; + } + + public bool HasInviteeName { + get { return result.hasInviteeName; } + } + public string InviteeName { + get { return result.InviteeName; } + set { SetInviteeName(value); } + } + public Builder SetInviteeName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasInviteeName = true; + result.inviteeName_ = value; + return this; + } + public Builder ClearInviteeName() { + PrepareBuilder(); + result.hasInviteeName = false; + result.inviteeName_ = ""; + return this; + } + + public bool HasInviterName { + get { return result.hasInviterName; } + } + public string InviterName { + get { return result.InviterName; } + set { SetInviterName(value); } + } + public Builder SetInviterName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasInviterName = true; + result.inviterName_ = value; + return this; + } + public Builder ClearInviterName() { + PrepareBuilder(); + result.hasInviterName = false; + result.inviterName_ = ""; + return this; + } + + public pbc::IPopsicleList PreviousRoleList { + get { return PrepareBuilder().previousRole_; } + } + public int PreviousRoleCount { + get { return result.PreviousRoleCount; } + } + public uint GetPreviousRole(int index) { + return result.GetPreviousRole(index); + } + public Builder SetPreviousRole(int index, uint value) { + PrepareBuilder(); + result.previousRole_[index] = value; + return this; + } + public Builder AddPreviousRole(uint value) { + PrepareBuilder(); + result.previousRole_.Add(value); + return this; + } + public Builder AddRangePreviousRole(scg::IEnumerable values) { + PrepareBuilder(); + result.previousRole_.Add(values); + return this; + } + public Builder ClearPreviousRole() { + PrepareBuilder(); + result.previousRole_.Clear(); + return this; + } + + public pbc::IPopsicleList DesiredRoleList { + get { return PrepareBuilder().desiredRole_; } + } + public int DesiredRoleCount { + get { return result.DesiredRoleCount; } + } + public uint GetDesiredRole(int index) { + return result.GetDesiredRole(index); + } + public Builder SetDesiredRole(int index, uint value) { + PrepareBuilder(); + result.desiredRole_[index] = value; + return this; + } + public Builder AddDesiredRole(uint value) { + PrepareBuilder(); + result.desiredRole_.Add(value); + return this; + } + public Builder AddRangeDesiredRole(scg::IEnumerable values) { + PrepareBuilder(); + result.desiredRole_.Add(values); + return this; + } + public Builder ClearDesiredRole() { + PrepareBuilder(); + result.desiredRole_.Clear(); + return this; + } + } + static GenericRequest() { + object.ReferenceEquals(global::bnet.protocol.invitation.InvitationTypes.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code diff --git a/source/D3Proto/bnet/protocol/notification/Notification.cs b/src/LibMooNet/bnet/protocol/notification/NotificationService.cs similarity index 63% rename from source/D3Proto/bnet/protocol/notification/Notification.cs rename to src/LibMooNet/bnet/protocol/notification/NotificationService.cs index a79b7406..fdf6023d 100644 --- a/source/D3Proto/bnet/protocol/notification/Notification.cs +++ b/src/LibMooNet/bnet/protocol/notification/NotificationService.cs @@ -1,4 +1,6 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code using pb = global::Google.ProtocolBuffers; using pbc = global::Google.ProtocolBuffers.Collections; @@ -8,7 +10,10 @@ namespace bnet.protocol.notification { namespace Proto { - public static partial class Notification { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class NotificationService { #region Extension registration public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { @@ -32,41 +37,45 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { } private static pbd::FileDescriptor descriptor; - static Notification() { + static NotificationService() { byte[] descriptorData = global::System.Convert.FromBase64String( - "CidzZXJ2aWNlL25vdGlmaWNhdGlvbi9ub3RpZmljYXRpb24ucHJvdG8SGmJu" + - "ZXQucHJvdG9jb2wubm90aWZpY2F0aW9uGhxsaWIvcHJvdG9jb2wvYXR0cmli" + - "dXRlLnByb3RvGhlsaWIvcHJvdG9jb2wvZW50aXR5LnByb3RvGhFsaWIvcnBj" + - "L3JwYy5wcm90byLhAQoMTm90aWZpY2F0aW9uEioKCXNlbmRlcl9pZBgBIAEo" + - "CzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSNAoTc2VuZGVyX2dhbWVfYWNj" + - "b3VudBgCIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSKgoJdGFyZ2V0" + - "X2lkGAMgAigLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBIMCgR0eXBlGAQg" + - "AigJEjUKCWF0dHJpYnV0ZRgFIAMoCzIiLmJuZXQucHJvdG9jb2wuYXR0cmli" + - "dXRlLkF0dHJpYnV0ZSI/ChFGaW5kQ2xpZW50UmVxdWVzdBIqCgllbnRpdHlf" + - "aWQYASACKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkIlgKEkZpbmRDbGll" + - "bnRSZXNwb25zZRINCgVsYWJlbBgBIAIoDRIzChFjbGllbnRfcHJvY2Vzc19p" + - "ZBgCIAEoCzIYLmJuZXQucHJvdG9jb2wuUHJvY2Vzc0lkIkMKFVJlZ2lzdGVy" + - "Q2xpZW50UmVxdWVzdBIqCgllbnRpdHlfaWQYASACKAsyFy5ibmV0LnByb3Rv" + - "Y29sLkVudGl0eUlkIkUKF1VucmVnaXN0ZXJDbGllbnRSZXF1ZXN0EioKCWVu" + - "dGl0eV9pZBgBIAIoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQykwMKE05v" + - "dGlmaWNhdGlvblNlcnZpY2USUwoQU2VuZE5vdGlmaWNhdGlvbhIoLmJuZXQu" + - "cHJvdG9jb2wubm90aWZpY2F0aW9uLk5vdGlmaWNhdGlvbhoVLmJuZXQucHJv" + - "dG9jb2wuTm9EYXRhEloKDlJlZ2lzdGVyQ2xpZW50EjEuYm5ldC5wcm90b2Nv" + - "bC5ub3RpZmljYXRpb24uUmVnaXN0ZXJDbGllbnRSZXF1ZXN0GhUuYm5ldC5w" + - "cm90b2NvbC5Ob0RhdGESXgoQVW5yZWdpc3RlckNsaWVudBIzLmJuZXQucHJv" + - "dG9jb2wubm90aWZpY2F0aW9uLlVucmVnaXN0ZXJDbGllbnRSZXF1ZXN0GhUu" + - "Ym5ldC5wcm90b2NvbC5Ob0RhdGESawoKRmluZENsaWVudBItLmJuZXQucHJv" + - "dG9jb2wubm90aWZpY2F0aW9uLkZpbmRDbGllbnRSZXF1ZXN0Gi4uYm5ldC5w" + - "cm90b2NvbC5ub3RpZmljYXRpb24uRmluZENsaWVudFJlc3BvbnNlMnYKFE5v" + - "dGlmaWNhdGlvbkxpc3RlbmVyEl4KFk9uTm90aWZpY2F0aW9uUmVjZWl2ZWQS" + - "KC5ibmV0LnByb3RvY29sLm5vdGlmaWNhdGlvbi5Ob3RpZmljYXRpb24aGi5i" + - "bmV0LnByb3RvY29sLk5PX1JFU1BPTlNFQhJCDUNOb3RpZmljYXRpb26AAQE="); + "Ch9ibmV0L25vdGlmaWNhdGlvbl9zZXJ2aWNlLnByb3RvEhpibmV0LnByb3Rv" + + "Y29sLm5vdGlmaWNhdGlvbhoUYm5ldC9hdHRyaWJ1dGUucHJvdG8aEWJuZXQv" + + "ZW50aXR5LnByb3RvGg5ibmV0L3JwYy5wcm90byKuAgoMTm90aWZpY2F0aW9u" + + "EioKCXNlbmRlcl9pZBgBIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQS" + + "KgoJdGFyZ2V0X2lkGAIgAigLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBIM" + + "CgR0eXBlGAMgAigJEjUKCWF0dHJpYnV0ZRgEIAMoCzIiLmJuZXQucHJvdG9j" + + "b2wuYXR0cmlidXRlLkF0dHJpYnV0ZRIyChFzZW5kZXJfYWNjb3VudF9pZBgF" + + "IAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSMgoRdGFyZ2V0X2FjY291" + + "bnRfaWQYBiABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEhkKEXNlbmRl" + + "cl9iYXR0bGVfdGFnGAcgASgJIj8KEUZpbmRDbGllbnRSZXF1ZXN0EioKCWVu" + + "dGl0eV9pZBgBIAIoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQiWAoSRmlu" + + "ZENsaWVudFJlc3BvbnNlEg0KBWxhYmVsGAEgAigNEjMKEWNsaWVudF9wcm9j" + + "ZXNzX2lkGAIgASgLMhguYm5ldC5wcm90b2NvbC5Qcm9jZXNzSWQiQwoVUmVn" + + "aXN0ZXJDbGllbnRSZXF1ZXN0EioKCWVudGl0eV9pZBgBIAIoCzIXLmJuZXQu" + + "cHJvdG9jb2wuRW50aXR5SWQiRQoXVW5yZWdpc3RlckNsaWVudFJlcXVlc3QS" + + "KgoJZW50aXR5X2lkGAEgAigLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZDKr" + + "AwoTTm90aWZpY2F0aW9uU2VydmljZRJZChBTZW5kTm90aWZpY2F0aW9uEigu" + + "Ym5ldC5wcm90b2NvbC5ub3RpZmljYXRpb24uTm90aWZpY2F0aW9uGhUuYm5l" + + "dC5wcm90b2NvbC5Ob0RhdGEiBIC1GAESYAoOUmVnaXN0ZXJDbGllbnQSMS5i" + + "bmV0LnByb3RvY29sLm5vdGlmaWNhdGlvbi5SZWdpc3RlckNsaWVudFJlcXVl" + + "c3QaFS5ibmV0LnByb3RvY29sLk5vRGF0YSIEgLUYAhJkChBVbnJlZ2lzdGVy" + + "Q2xpZW50EjMuYm5ldC5wcm90b2NvbC5ub3RpZmljYXRpb24uVW5yZWdpc3Rl" + + "ckNsaWVudFJlcXVlc3QaFS5ibmV0LnByb3RvY29sLk5vRGF0YSIEgLUYAxJx" + + "CgpGaW5kQ2xpZW50Ei0uYm5ldC5wcm90b2NvbC5ub3RpZmljYXRpb24uRmlu" + + "ZENsaWVudFJlcXVlc3QaLi5ibmV0LnByb3RvY29sLm5vdGlmaWNhdGlvbi5G" + + "aW5kQ2xpZW50UmVzcG9uc2UiBIC1GAQy3gEKFE5vdGlmaWNhdGlvbkxpc3Rl" + + "bmVyEmQKFk9uTm90aWZpY2F0aW9uUmVjZWl2ZWQSKC5ibmV0LnByb3RvY29s" + + "Lm5vdGlmaWNhdGlvbi5Ob3RpZmljYXRpb24aGi5ibmV0LnByb3RvY29sLk5P" + + "X1JFU1BPTlNFIgSAtRgBEmAKEk9uTm90aWZpY2F0aW9uU2VudBIoLmJuZXQu" + + "cHJvdG9jb2wubm90aWZpY2F0aW9uLk5vdGlmaWNhdGlvbhoaLmJuZXQucHJv" + + "dG9jb2wuTk9fUkVTUE9OU0UiBIC1GAJCA4ABAA=="); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_bnet_protocol_notification_Notification__Descriptor = Descriptor.MessageTypes[0]; internal__static_bnet_protocol_notification_Notification__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_notification_Notification__Descriptor, - new string[] { "SenderId", "SenderGameAccount", "TargetId", "Type", "Attribute", }); + new string[] { "SenderId", "TargetId", "Type", "Attribute", "SenderAccountId", "TargetAccountId", "SenderBattleTag", }); internal__static_bnet_protocol_notification_FindClientRequest__Descriptor = Descriptor.MessageTypes[1]; internal__static_bnet_protocol_notification_FindClientRequest__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_notification_FindClientRequest__Descriptor, @@ -83,7 +92,12 @@ static Notification() { internal__static_bnet_protocol_notification_UnregisterClientRequest__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_notification_UnregisterClientRequest__Descriptor, new string[] { "EntityId", }); - return null; + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + RegisterAllExtensions(registry); + global::bnet.protocol.attribute.Proto.Attribute.RegisterAllExtensions(registry); + global::bnet.protocol.Entity.RegisterAllExtensions(registry); + global::bnet.protocol.Rpc.RegisterAllExtensions(registry); + return registry; }; pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbd::FileDescriptor[] { @@ -97,14 +111,20 @@ static Notification() { } } #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Notification : pb::GeneratedMessage { - private static readonly Notification defaultInstance = new Builder().BuildPartial(); + private Notification() { } + private static readonly Notification defaultInstance = new Notification().MakeReadOnly(); + private static readonly string[] _notificationFieldNames = new string[] { "attribute", "sender_account_id", "sender_battle_tag", "sender_id", "target_account_id", "target_id", "type" }; + private static readonly uint[] _notificationFieldTags = new uint[] { 34, 42, 58, 10, 50, 18, 26 }; public static Notification DefaultInstance { get { return defaultInstance; } } public override Notification DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override Notification ThisMessage { @@ -112,44 +132,34 @@ protected override Notification ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.notification.Proto.Notification.internal__static_bnet_protocol_notification_Notification__Descriptor; } + get { return global::bnet.protocol.notification.Proto.NotificationService.internal__static_bnet_protocol_notification_Notification__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.notification.Proto.Notification.internal__static_bnet_protocol_notification_Notification__FieldAccessorTable; } + get { return global::bnet.protocol.notification.Proto.NotificationService.internal__static_bnet_protocol_notification_Notification__FieldAccessorTable; } } public const int SenderIdFieldNumber = 1; private bool hasSenderId; - private global::bnet.protocol.EntityId senderId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId senderId_; public bool HasSenderId { get { return hasSenderId; } } public global::bnet.protocol.EntityId SenderId { - get { return senderId_; } - } - - public const int SenderGameAccountFieldNumber = 2; - private bool hasSenderGameAccount; - private global::bnet.protocol.EntityId senderGameAccount_ = global::bnet.protocol.EntityId.DefaultInstance; - public bool HasSenderGameAccount { - get { return hasSenderGameAccount; } - } - public global::bnet.protocol.EntityId SenderGameAccount { - get { return senderGameAccount_; } + get { return senderId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } - public const int TargetIdFieldNumber = 3; + public const int TargetIdFieldNumber = 2; private bool hasTargetId; - private global::bnet.protocol.EntityId targetId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId targetId_; public bool HasTargetId { get { return hasTargetId; } } public global::bnet.protocol.EntityId TargetId { - get { return targetId_; } + get { return targetId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } - public const int TypeFieldNumber = 4; + public const int TypeFieldNumber = 3; private bool hasType; private string type_ = ""; public bool HasType { @@ -159,7 +169,7 @@ public string Type { get { return type_; } } - public const int AttributeFieldNumber = 5; + public const int AttributeFieldNumber = 4; private pbc::PopsicleList attribute_ = new pbc::PopsicleList(); public scg::IList AttributeList { get { return attribute_; } @@ -171,6 +181,36 @@ public int AttributeCount { return attribute_[index]; } + public const int SenderAccountIdFieldNumber = 5; + private bool hasSenderAccountId; + private global::bnet.protocol.EntityId senderAccountId_; + public bool HasSenderAccountId { + get { return hasSenderAccountId; } + } + public global::bnet.protocol.EntityId SenderAccountId { + get { return senderAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int TargetAccountIdFieldNumber = 6; + private bool hasTargetAccountId; + private global::bnet.protocol.EntityId targetAccountId_; + public bool HasTargetAccountId { + get { return hasTargetAccountId; } + } + public global::bnet.protocol.EntityId TargetAccountId { + get { return targetAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int SenderBattleTagFieldNumber = 7; + private bool hasSenderBattleTag; + private string senderBattleTag_ = ""; + public bool HasSenderBattleTag { + get { return hasSenderBattleTag; } + } + public string SenderBattleTag { + get { return senderBattleTag_; } + } + public override bool IsInitialized { get { if (!hasTargetId) return false; @@ -178,33 +218,43 @@ public override bool IsInitialized { if (HasSenderId) { if (!SenderId.IsInitialized) return false; } - if (HasSenderGameAccount) { - if (!SenderGameAccount.IsInitialized) return false; - } if (!TargetId.IsInitialized) return false; foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { if (!element.IsInitialized) return false; } + if (HasSenderAccountId) { + if (!SenderAccountId.IsInitialized) return false; + } + if (HasTargetAccountId) { + if (!TargetAccountId.IsInitialized) return false; + } return true; } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasSenderId) { - output.WriteMessage(1, SenderId); + string[] field_names = _notificationFieldNames; + if (hasSenderId) { + output.WriteMessage(1, field_names[3], SenderId); + } + if (hasTargetId) { + output.WriteMessage(2, field_names[5], TargetId); + } + if (hasType) { + output.WriteString(3, field_names[6], Type); } - if (HasSenderGameAccount) { - output.WriteMessage(2, SenderGameAccount); + if (attribute_.Count > 0) { + output.WriteMessageArray(4, field_names[0], attribute_); } - if (HasTargetId) { - output.WriteMessage(3, TargetId); + if (hasSenderAccountId) { + output.WriteMessage(5, field_names[1], SenderAccountId); } - if (HasType) { - output.WriteString(4, Type); + if (hasTargetAccountId) { + output.WriteMessage(6, field_names[4], TargetAccountId); } - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - output.WriteMessage(5, element); + if (hasSenderBattleTag) { + output.WriteString(7, field_names[2], SenderBattleTag); } UnknownFields.WriteTo(output); } @@ -216,20 +266,26 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasSenderId) { + if (hasSenderId) { size += pb::CodedOutputStream.ComputeMessageSize(1, SenderId); } - if (HasSenderGameAccount) { - size += pb::CodedOutputStream.ComputeMessageSize(2, SenderGameAccount); - } - if (HasTargetId) { - size += pb::CodedOutputStream.ComputeMessageSize(3, TargetId); + if (hasTargetId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, TargetId); } - if (HasType) { - size += pb::CodedOutputStream.ComputeStringSize(4, Type); + if (hasType) { + size += pb::CodedOutputStream.ComputeStringSize(3, Type); } foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - size += pb::CodedOutputStream.ComputeMessageSize(5, element); + size += pb::CodedOutputStream.ComputeMessageSize(4, element); + } + if (hasSenderAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(5, SenderAccountId); + } + if (hasTargetAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(6, TargetAccountId); + } + if (hasSenderBattleTag) { + size += pb::CodedOutputStream.ComputeStringSize(7, SenderBattleTag); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -261,38 +317,73 @@ public static Notification ParseDelimitedFrom(global::System.IO.Stream input) { public static Notification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static Notification ParseFrom(pb::CodedInputStream input) { + public static Notification ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Notification ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static Notification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private Notification MakeReadOnly() { + attribute_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(Notification prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Notification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Notification result; + + private Notification PrepareBuilder() { + if (resultIsReadOnly) { + Notification original = result; + result = new Notification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - Notification result = new Notification(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override Notification MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new Notification(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -304,13 +395,11 @@ public override Notification DefaultInstanceForType { } public override Notification BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.attribute_.MakeReadOnly(); - Notification returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -324,12 +413,10 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Notification other) { if (other == global::bnet.protocol.notification.Notification.DefaultInstance) return this; + PrepareBuilder(); if (other.HasSenderId) { MergeSenderId(other.SenderId); } - if (other.HasSenderGameAccount) { - MergeSenderGameAccount(other.SenderGameAccount); - } if (other.HasTargetId) { MergeTargetId(other.TargetId); } @@ -337,26 +424,46 @@ public override Builder MergeFrom(Notification other) { Type = other.Type; } if (other.attribute_.Count != 0) { - base.AddRange(other.attribute_, result.attribute_); + result.attribute_.Add(other.attribute_); + } + if (other.HasSenderAccountId) { + MergeSenderAccountId(other.SenderAccountId); + } + if (other.HasTargetAccountId) { + MergeTargetAccountId(other.TargetAccountId); + } + if (other.HasSenderBattleTag) { + SenderBattleTag = other.SenderBattleTag; } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_notificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _notificationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -368,12 +475,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasSenderId) { + if (result.hasSenderId) { subBuilder.MergeFrom(SenderId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -382,39 +489,55 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasSenderGameAccount) { - subBuilder.MergeFrom(SenderGameAccount); + if (result.hasTargetId) { + subBuilder.MergeFrom(TargetId); } input.ReadMessage(subBuilder, extensionRegistry); - SenderGameAccount = subBuilder.BuildPartial(); + TargetId = subBuilder.BuildPartial(); break; } case 26: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasTargetId) { - subBuilder.MergeFrom(TargetId); - } - input.ReadMessage(subBuilder, extensionRegistry); - TargetId = subBuilder.BuildPartial(); + result.hasType = input.ReadString(ref result.type_); break; } case 34: { - Type = input.ReadString(); + input.ReadMessageArray(tag, field_name, result.attribute_, global::bnet.protocol.attribute.Attribute.DefaultInstance, extensionRegistry); break; } case 42: { - global::bnet.protocol.attribute.Attribute.Builder subBuilder = global::bnet.protocol.attribute.Attribute.CreateBuilder(); + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasSenderAccountId) { + subBuilder.MergeFrom(SenderAccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + SenderAccountId = subBuilder.BuildPartial(); + break; + } + case 50: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasTargetAccountId) { + subBuilder.MergeFrom(TargetAccountId); + } input.ReadMessage(subBuilder, extensionRegistry); - AddAttribute(subBuilder.BuildPartial()); + TargetAccountId = subBuilder.BuildPartial(); + break; + } + case 58: { + result.hasSenderBattleTag = input.ReadString(ref result.senderBattleTag_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasSenderId { - get { return result.HasSenderId; } + get { return result.hasSenderId; } } public global::bnet.protocol.EntityId SenderId { get { return result.SenderId; } @@ -422,19 +545,22 @@ public bool HasSenderId { } public Builder SetSenderId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasSenderId = true; result.senderId_ = value; return this; } public Builder SetSenderId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasSenderId = true; result.senderId_ = builderForValue.Build(); return this; } public Builder MergeSenderId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasSenderId && + PrepareBuilder(); + if (result.hasSenderId && result.senderId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.senderId_ = global::bnet.protocol.EntityId.CreateBuilder(result.senderId_).MergeFrom(value).BuildPartial(); } else { @@ -444,49 +570,14 @@ public Builder MergeSenderId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearSenderId() { + PrepareBuilder(); result.hasSenderId = false; - result.senderId_ = global::bnet.protocol.EntityId.DefaultInstance; - return this; - } - - public bool HasSenderGameAccount { - get { return result.HasSenderGameAccount; } - } - public global::bnet.protocol.EntityId SenderGameAccount { - get { return result.SenderGameAccount; } - set { SetSenderGameAccount(value); } - } - public Builder SetSenderGameAccount(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasSenderGameAccount = true; - result.senderGameAccount_ = value; - return this; - } - public Builder SetSenderGameAccount(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasSenderGameAccount = true; - result.senderGameAccount_ = builderForValue.Build(); - return this; - } - public Builder MergeSenderGameAccount(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasSenderGameAccount && - result.senderGameAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { - result.senderGameAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.senderGameAccount_).MergeFrom(value).BuildPartial(); - } else { - result.senderGameAccount_ = value; - } - result.hasSenderGameAccount = true; - return this; - } - public Builder ClearSenderGameAccount() { - result.hasSenderGameAccount = false; - result.senderGameAccount_ = global::bnet.protocol.EntityId.DefaultInstance; + result.senderId_ = null; return this; } public bool HasTargetId { - get { return result.HasTargetId; } + get { return result.hasTargetId; } } public global::bnet.protocol.EntityId TargetId { get { return result.TargetId; } @@ -494,19 +585,22 @@ public bool HasTargetId { } public Builder SetTargetId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasTargetId = true; result.targetId_ = value; return this; } public Builder SetTargetId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasTargetId = true; result.targetId_ = builderForValue.Build(); return this; } public Builder MergeTargetId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasTargetId && + PrepareBuilder(); + if (result.hasTargetId && result.targetId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.targetId_ = global::bnet.protocol.EntityId.CreateBuilder(result.targetId_).MergeFrom(value).BuildPartial(); } else { @@ -516,13 +610,14 @@ public Builder MergeTargetId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearTargetId() { + PrepareBuilder(); result.hasTargetId = false; - result.targetId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.targetId_ = null; return this; } public bool HasType { - get { return result.HasType; } + get { return result.hasType; } } public string Type { get { return result.Type; } @@ -530,18 +625,20 @@ public string Type { } public Builder SetType(string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasType = true; result.type_ = value; return this; } public Builder ClearType() { + PrepareBuilder(); result.hasType = false; result.type_ = ""; return this; } public pbc::IPopsicleList AttributeList { - get { return result.attribute_; } + get { return PrepareBuilder().attribute_; } } public int AttributeCount { get { return result.AttributeCount; } @@ -551,46 +648,159 @@ public int AttributeCount { } public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.attribute_[index] = value; return this; } public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.attribute_[index] = builderForValue.Build(); return this; } public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.attribute_.Add(value); return this; } public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.attribute_.Add(builderForValue.Build()); return this; } public Builder AddRangeAttribute(scg::IEnumerable values) { - base.AddRange(values, result.attribute_); + PrepareBuilder(); + result.attribute_.Add(values); return this; } public Builder ClearAttribute() { + PrepareBuilder(); result.attribute_.Clear(); return this; } + + public bool HasSenderAccountId { + get { return result.hasSenderAccountId; } + } + public global::bnet.protocol.EntityId SenderAccountId { + get { return result.SenderAccountId; } + set { SetSenderAccountId(value); } + } + public Builder SetSenderAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasSenderAccountId = true; + result.senderAccountId_ = value; + return this; + } + public Builder SetSenderAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasSenderAccountId = true; + result.senderAccountId_ = builderForValue.Build(); + return this; + } + public Builder MergeSenderAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasSenderAccountId && + result.senderAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.senderAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.senderAccountId_).MergeFrom(value).BuildPartial(); + } else { + result.senderAccountId_ = value; + } + result.hasSenderAccountId = true; + return this; + } + public Builder ClearSenderAccountId() { + PrepareBuilder(); + result.hasSenderAccountId = false; + result.senderAccountId_ = null; + return this; + } + + public bool HasTargetAccountId { + get { return result.hasTargetAccountId; } + } + public global::bnet.protocol.EntityId TargetAccountId { + get { return result.TargetAccountId; } + set { SetTargetAccountId(value); } + } + public Builder SetTargetAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTargetAccountId = true; + result.targetAccountId_ = value; + return this; + } + public Builder SetTargetAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasTargetAccountId = true; + result.targetAccountId_ = builderForValue.Build(); + return this; + } + public Builder MergeTargetAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasTargetAccountId && + result.targetAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.targetAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.targetAccountId_).MergeFrom(value).BuildPartial(); + } else { + result.targetAccountId_ = value; + } + result.hasTargetAccountId = true; + return this; + } + public Builder ClearTargetAccountId() { + PrepareBuilder(); + result.hasTargetAccountId = false; + result.targetAccountId_ = null; + return this; + } + + public bool HasSenderBattleTag { + get { return result.hasSenderBattleTag; } + } + public string SenderBattleTag { + get { return result.SenderBattleTag; } + set { SetSenderBattleTag(value); } + } + public Builder SetSenderBattleTag(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasSenderBattleTag = true; + result.senderBattleTag_ = value; + return this; + } + public Builder ClearSenderBattleTag() { + PrepareBuilder(); + result.hasSenderBattleTag = false; + result.senderBattleTag_ = ""; + return this; + } } static Notification() { - object.ReferenceEquals(global::bnet.protocol.notification.Proto.Notification.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.notification.Proto.NotificationService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class FindClientRequest : pb::GeneratedMessage { - private static readonly FindClientRequest defaultInstance = new Builder().BuildPartial(); + private FindClientRequest() { } + private static readonly FindClientRequest defaultInstance = new FindClientRequest().MakeReadOnly(); + private static readonly string[] _findClientRequestFieldNames = new string[] { "entity_id" }; + private static readonly uint[] _findClientRequestFieldTags = new uint[] { 10 }; public static FindClientRequest DefaultInstance { get { return defaultInstance; } } public override FindClientRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override FindClientRequest ThisMessage { @@ -598,21 +808,21 @@ protected override FindClientRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.notification.Proto.Notification.internal__static_bnet_protocol_notification_FindClientRequest__Descriptor; } + get { return global::bnet.protocol.notification.Proto.NotificationService.internal__static_bnet_protocol_notification_FindClientRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.notification.Proto.Notification.internal__static_bnet_protocol_notification_FindClientRequest__FieldAccessorTable; } + get { return global::bnet.protocol.notification.Proto.NotificationService.internal__static_bnet_protocol_notification_FindClientRequest__FieldAccessorTable; } } public const int EntityIdFieldNumber = 1; private bool hasEntityId; - private global::bnet.protocol.EntityId entityId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId entityId_; public bool HasEntityId { get { return hasEntityId; } } public global::bnet.protocol.EntityId EntityId { - get { return entityId_; } + get { return entityId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public override bool IsInitialized { @@ -623,10 +833,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasEntityId) { - output.WriteMessage(1, EntityId); + string[] field_names = _findClientRequestFieldNames; + if (hasEntityId) { + output.WriteMessage(1, field_names[0], EntityId); } UnknownFields.WriteTo(output); } @@ -638,7 +849,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasEntityId) { + if (hasEntityId) { size += pb::CodedOutputStream.ComputeMessageSize(1, EntityId); } size += UnknownFields.SerializedSize; @@ -671,38 +882,72 @@ public static FindClientRequest ParseDelimitedFrom(global::System.IO.Stream inpu public static FindClientRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static FindClientRequest ParseFrom(pb::CodedInputStream input) { + public static FindClientRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static FindClientRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static FindClientRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private FindClientRequest MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(FindClientRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(FindClientRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private FindClientRequest result; + + private FindClientRequest PrepareBuilder() { + if (resultIsReadOnly) { + FindClientRequest original = result; + result = new FindClientRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - FindClientRequest result = new FindClientRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override FindClientRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new FindClientRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -714,12 +959,11 @@ public override FindClientRequest DefaultInstanceForType { } public override FindClientRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - FindClientRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -733,6 +977,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(FindClientRequest other) { if (other == global::bnet.protocol.notification.FindClientRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasEntityId) { MergeEntityId(other.EntityId); } @@ -740,20 +985,31 @@ public override Builder MergeFrom(FindClientRequest other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_findClientRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _findClientRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -765,12 +1021,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasEntityId) { + if (result.hasEntityId) { subBuilder.MergeFrom(EntityId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -779,11 +1035,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasEntityId { - get { return result.HasEntityId; } + get { return result.hasEntityId; } } public global::bnet.protocol.EntityId EntityId { get { return result.EntityId; } @@ -791,19 +1052,22 @@ public bool HasEntityId { } public Builder SetEntityId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasEntityId = true; result.entityId_ = value; return this; } public Builder SetEntityId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasEntityId = true; result.entityId_ = builderForValue.Build(); return this; } public Builder MergeEntityId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasEntityId && + PrepareBuilder(); + if (result.hasEntityId && result.entityId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.entityId_ = global::bnet.protocol.EntityId.CreateBuilder(result.entityId_).MergeFrom(value).BuildPartial(); } else { @@ -813,24 +1077,31 @@ public Builder MergeEntityId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearEntityId() { + PrepareBuilder(); result.hasEntityId = false; - result.entityId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.entityId_ = null; return this; } } static FindClientRequest() { - object.ReferenceEquals(global::bnet.protocol.notification.Proto.Notification.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.notification.Proto.NotificationService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class FindClientResponse : pb::GeneratedMessage { - private static readonly FindClientResponse defaultInstance = new Builder().BuildPartial(); + private FindClientResponse() { } + private static readonly FindClientResponse defaultInstance = new FindClientResponse().MakeReadOnly(); + private static readonly string[] _findClientResponseFieldNames = new string[] { "client_process_id", "label" }; + private static readonly uint[] _findClientResponseFieldTags = new uint[] { 18, 8 }; public static FindClientResponse DefaultInstance { get { return defaultInstance; } } public override FindClientResponse DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override FindClientResponse ThisMessage { @@ -838,16 +1109,16 @@ protected override FindClientResponse ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.notification.Proto.Notification.internal__static_bnet_protocol_notification_FindClientResponse__Descriptor; } + get { return global::bnet.protocol.notification.Proto.NotificationService.internal__static_bnet_protocol_notification_FindClientResponse__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.notification.Proto.Notification.internal__static_bnet_protocol_notification_FindClientResponse__FieldAccessorTable; } + get { return global::bnet.protocol.notification.Proto.NotificationService.internal__static_bnet_protocol_notification_FindClientResponse__FieldAccessorTable; } } public const int LabelFieldNumber = 1; private bool hasLabel; - private uint label_ = 0; + private uint label_; public bool HasLabel { get { return hasLabel; } } @@ -857,12 +1128,12 @@ public uint Label { public const int ClientProcessIdFieldNumber = 2; private bool hasClientProcessId; - private global::bnet.protocol.ProcessId clientProcessId_ = global::bnet.protocol.ProcessId.DefaultInstance; + private global::bnet.protocol.ProcessId clientProcessId_; public bool HasClientProcessId { get { return hasClientProcessId; } } public global::bnet.protocol.ProcessId ClientProcessId { - get { return clientProcessId_; } + get { return clientProcessId_ ?? global::bnet.protocol.ProcessId.DefaultInstance; } } public override bool IsInitialized { @@ -875,13 +1146,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasLabel) { - output.WriteUInt32(1, Label); + string[] field_names = _findClientResponseFieldNames; + if (hasLabel) { + output.WriteUInt32(1, field_names[1], Label); } - if (HasClientProcessId) { - output.WriteMessage(2, ClientProcessId); + if (hasClientProcessId) { + output.WriteMessage(2, field_names[0], ClientProcessId); } UnknownFields.WriteTo(output); } @@ -893,10 +1165,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasLabel) { + if (hasLabel) { size += pb::CodedOutputStream.ComputeUInt32Size(1, Label); } - if (HasClientProcessId) { + if (hasClientProcessId) { size += pb::CodedOutputStream.ComputeMessageSize(2, ClientProcessId); } size += UnknownFields.SerializedSize; @@ -929,38 +1201,72 @@ public static FindClientResponse ParseDelimitedFrom(global::System.IO.Stream inp public static FindClientResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static FindClientResponse ParseFrom(pb::CodedInputStream input) { + public static FindClientResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static FindClientResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static FindClientResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private FindClientResponse MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(FindClientResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(FindClientResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private FindClientResponse result; + + private FindClientResponse PrepareBuilder() { + if (resultIsReadOnly) { + FindClientResponse original = result; + result = new FindClientResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - FindClientResponse result = new FindClientResponse(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override FindClientResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new FindClientResponse(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -972,12 +1278,11 @@ public override FindClientResponse DefaultInstanceForType { } public override FindClientResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - FindClientResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -991,6 +1296,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(FindClientResponse other) { if (other == global::bnet.protocol.notification.FindClientResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.HasLabel) { Label = other.Label; } @@ -1001,20 +1307,31 @@ public override Builder MergeFrom(FindClientResponse other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_findClientResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _findClientResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1026,16 +1343,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 8: { - Label = input.ReadUInt32(); + result.hasLabel = input.ReadUInt32(ref result.label_); break; } case 18: { global::bnet.protocol.ProcessId.Builder subBuilder = global::bnet.protocol.ProcessId.CreateBuilder(); - if (HasClientProcessId) { + if (result.hasClientProcessId) { subBuilder.MergeFrom(ClientProcessId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1044,29 +1361,36 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasLabel { - get { return result.HasLabel; } + get { return result.hasLabel; } } public uint Label { get { return result.Label; } set { SetLabel(value); } } public Builder SetLabel(uint value) { + PrepareBuilder(); result.hasLabel = true; result.label_ = value; return this; } public Builder ClearLabel() { + PrepareBuilder(); result.hasLabel = false; result.label_ = 0; return this; } public bool HasClientProcessId { - get { return result.HasClientProcessId; } + get { return result.hasClientProcessId; } } public global::bnet.protocol.ProcessId ClientProcessId { get { return result.ClientProcessId; } @@ -1074,19 +1398,22 @@ public bool HasClientProcessId { } public Builder SetClientProcessId(global::bnet.protocol.ProcessId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasClientProcessId = true; result.clientProcessId_ = value; return this; } public Builder SetClientProcessId(global::bnet.protocol.ProcessId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasClientProcessId = true; result.clientProcessId_ = builderForValue.Build(); return this; } public Builder MergeClientProcessId(global::bnet.protocol.ProcessId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasClientProcessId && + PrepareBuilder(); + if (result.hasClientProcessId && result.clientProcessId_ != global::bnet.protocol.ProcessId.DefaultInstance) { result.clientProcessId_ = global::bnet.protocol.ProcessId.CreateBuilder(result.clientProcessId_).MergeFrom(value).BuildPartial(); } else { @@ -1096,24 +1423,31 @@ public Builder MergeClientProcessId(global::bnet.protocol.ProcessId value) { return this; } public Builder ClearClientProcessId() { + PrepareBuilder(); result.hasClientProcessId = false; - result.clientProcessId_ = global::bnet.protocol.ProcessId.DefaultInstance; + result.clientProcessId_ = null; return this; } } static FindClientResponse() { - object.ReferenceEquals(global::bnet.protocol.notification.Proto.Notification.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.notification.Proto.NotificationService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class RegisterClientRequest : pb::GeneratedMessage { - private static readonly RegisterClientRequest defaultInstance = new Builder().BuildPartial(); + private RegisterClientRequest() { } + private static readonly RegisterClientRequest defaultInstance = new RegisterClientRequest().MakeReadOnly(); + private static readonly string[] _registerClientRequestFieldNames = new string[] { "entity_id" }; + private static readonly uint[] _registerClientRequestFieldTags = new uint[] { 10 }; public static RegisterClientRequest DefaultInstance { get { return defaultInstance; } } public override RegisterClientRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override RegisterClientRequest ThisMessage { @@ -1121,21 +1455,21 @@ protected override RegisterClientRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.notification.Proto.Notification.internal__static_bnet_protocol_notification_RegisterClientRequest__Descriptor; } + get { return global::bnet.protocol.notification.Proto.NotificationService.internal__static_bnet_protocol_notification_RegisterClientRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.notification.Proto.Notification.internal__static_bnet_protocol_notification_RegisterClientRequest__FieldAccessorTable; } + get { return global::bnet.protocol.notification.Proto.NotificationService.internal__static_bnet_protocol_notification_RegisterClientRequest__FieldAccessorTable; } } public const int EntityIdFieldNumber = 1; private bool hasEntityId; - private global::bnet.protocol.EntityId entityId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId entityId_; public bool HasEntityId { get { return hasEntityId; } } public global::bnet.protocol.EntityId EntityId { - get { return entityId_; } + get { return entityId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public override bool IsInitialized { @@ -1146,10 +1480,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasEntityId) { - output.WriteMessage(1, EntityId); + string[] field_names = _registerClientRequestFieldNames; + if (hasEntityId) { + output.WriteMessage(1, field_names[0], EntityId); } UnknownFields.WriteTo(output); } @@ -1161,7 +1496,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasEntityId) { + if (hasEntityId) { size += pb::CodedOutputStream.ComputeMessageSize(1, EntityId); } size += UnknownFields.SerializedSize; @@ -1194,38 +1529,72 @@ public static RegisterClientRequest ParseDelimitedFrom(global::System.IO.Stream public static RegisterClientRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static RegisterClientRequest ParseFrom(pb::CodedInputStream input) { + public static RegisterClientRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static RegisterClientRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static RegisterClientRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private RegisterClientRequest MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(RegisterClientRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(RegisterClientRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private RegisterClientRequest result; + + private RegisterClientRequest PrepareBuilder() { + if (resultIsReadOnly) { + RegisterClientRequest original = result; + result = new RegisterClientRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - RegisterClientRequest result = new RegisterClientRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override RegisterClientRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new RegisterClientRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -1237,12 +1606,11 @@ public override RegisterClientRequest DefaultInstanceForType { } public override RegisterClientRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - RegisterClientRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1256,6 +1624,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(RegisterClientRequest other) { if (other == global::bnet.protocol.notification.RegisterClientRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasEntityId) { MergeEntityId(other.EntityId); } @@ -1263,20 +1632,31 @@ public override Builder MergeFrom(RegisterClientRequest other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_registerClientRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _registerClientRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1288,12 +1668,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasEntityId) { + if (result.hasEntityId) { subBuilder.MergeFrom(EntityId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1302,11 +1682,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasEntityId { - get { return result.HasEntityId; } + get { return result.hasEntityId; } } public global::bnet.protocol.EntityId EntityId { get { return result.EntityId; } @@ -1314,19 +1699,22 @@ public bool HasEntityId { } public Builder SetEntityId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasEntityId = true; result.entityId_ = value; return this; } public Builder SetEntityId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasEntityId = true; result.entityId_ = builderForValue.Build(); return this; } public Builder MergeEntityId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasEntityId && + PrepareBuilder(); + if (result.hasEntityId && result.entityId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.entityId_ = global::bnet.protocol.EntityId.CreateBuilder(result.entityId_).MergeFrom(value).BuildPartial(); } else { @@ -1336,24 +1724,31 @@ public Builder MergeEntityId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearEntityId() { + PrepareBuilder(); result.hasEntityId = false; - result.entityId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.entityId_ = null; return this; } } static RegisterClientRequest() { - object.ReferenceEquals(global::bnet.protocol.notification.Proto.Notification.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.notification.Proto.NotificationService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class UnregisterClientRequest : pb::GeneratedMessage { - private static readonly UnregisterClientRequest defaultInstance = new Builder().BuildPartial(); + private UnregisterClientRequest() { } + private static readonly UnregisterClientRequest defaultInstance = new UnregisterClientRequest().MakeReadOnly(); + private static readonly string[] _unregisterClientRequestFieldNames = new string[] { "entity_id" }; + private static readonly uint[] _unregisterClientRequestFieldTags = new uint[] { 10 }; public static UnregisterClientRequest DefaultInstance { get { return defaultInstance; } } public override UnregisterClientRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override UnregisterClientRequest ThisMessage { @@ -1361,21 +1756,21 @@ protected override UnregisterClientRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.notification.Proto.Notification.internal__static_bnet_protocol_notification_UnregisterClientRequest__Descriptor; } + get { return global::bnet.protocol.notification.Proto.NotificationService.internal__static_bnet_protocol_notification_UnregisterClientRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.notification.Proto.Notification.internal__static_bnet_protocol_notification_UnregisterClientRequest__FieldAccessorTable; } + get { return global::bnet.protocol.notification.Proto.NotificationService.internal__static_bnet_protocol_notification_UnregisterClientRequest__FieldAccessorTable; } } public const int EntityIdFieldNumber = 1; private bool hasEntityId; - private global::bnet.protocol.EntityId entityId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId entityId_; public bool HasEntityId { get { return hasEntityId; } } public global::bnet.protocol.EntityId EntityId { - get { return entityId_; } + get { return entityId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public override bool IsInitialized { @@ -1386,10 +1781,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasEntityId) { - output.WriteMessage(1, EntityId); + string[] field_names = _unregisterClientRequestFieldNames; + if (hasEntityId) { + output.WriteMessage(1, field_names[0], EntityId); } UnknownFields.WriteTo(output); } @@ -1401,7 +1797,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasEntityId) { + if (hasEntityId) { size += pb::CodedOutputStream.ComputeMessageSize(1, EntityId); } size += UnknownFields.SerializedSize; @@ -1434,38 +1830,72 @@ public static UnregisterClientRequest ParseDelimitedFrom(global::System.IO.Strea public static UnregisterClientRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static UnregisterClientRequest ParseFrom(pb::CodedInputStream input) { + public static UnregisterClientRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static UnregisterClientRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static UnregisterClientRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private UnregisterClientRequest MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(UnregisterClientRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(UnregisterClientRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private UnregisterClientRequest result; + + private UnregisterClientRequest PrepareBuilder() { + if (resultIsReadOnly) { + UnregisterClientRequest original = result; + result = new UnregisterClientRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - UnregisterClientRequest result = new UnregisterClientRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override UnregisterClientRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new UnregisterClientRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -1477,12 +1907,11 @@ public override UnregisterClientRequest DefaultInstanceForType { } public override UnregisterClientRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - UnregisterClientRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1496,6 +1925,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(UnregisterClientRequest other) { if (other == global::bnet.protocol.notification.UnregisterClientRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasEntityId) { MergeEntityId(other.EntityId); } @@ -1503,20 +1933,31 @@ public override Builder MergeFrom(UnregisterClientRequest other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_unregisterClientRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _unregisterClientRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1528,12 +1969,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasEntityId) { + if (result.hasEntityId) { subBuilder.MergeFrom(EntityId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1542,11 +1983,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasEntityId { - get { return result.HasEntityId; } + get { return result.hasEntityId; } } public global::bnet.protocol.EntityId EntityId { get { return result.EntityId; } @@ -1554,19 +2000,22 @@ public bool HasEntityId { } public Builder SetEntityId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasEntityId = true; result.entityId_ = value; return this; } public Builder SetEntityId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasEntityId = true; result.entityId_ = builderForValue.Build(); return this; } public Builder MergeEntityId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasEntityId && + PrepareBuilder(); + if (result.hasEntityId && result.entityId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.entityId_ = global::bnet.protocol.EntityId.CreateBuilder(result.entityId_).MergeFrom(value).BuildPartial(); } else { @@ -1576,19 +2025,23 @@ public Builder MergeEntityId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearEntityId() { + PrepareBuilder(); result.hasEntityId = false; - result.entityId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.entityId_ = null; return this; } } static UnregisterClientRequest() { - object.ReferenceEquals(global::bnet.protocol.notification.Proto.Notification.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.notification.Proto.NotificationService.Descriptor, null); } } #endregion #region Services + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public abstract class NotificationService : pb::IService { public abstract void SendNotification( pb::IRpcController controller, @@ -1608,7 +2061,7 @@ public abstract void FindClient( global::System.Action done); public static pbd::ServiceDescriptor Descriptor { - get { return Proto.Notification.Descriptor.Services[0]; } + get { return Proto.NotificationService.Descriptor.Services[0]; } } public pbd::ServiceDescriptor DescriptorForType { get { return Descriptor; } @@ -1691,6 +2144,9 @@ public static Stub CreateStub(pb::IRpcChannel channel) { return new Stub(channel); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public class Stub : global::bnet.protocol.notification.NotificationService { internal Stub(pb::IRpcChannel channel) { this.channel = channel; @@ -1739,14 +2195,21 @@ public override void FindClient( } } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public abstract class NotificationListener : pb::IService { public abstract void OnNotificationReceived( pb::IRpcController controller, global::bnet.protocol.notification.Notification request, global::System.Action done); + public abstract void OnNotificationSent( + pb::IRpcController controller, + global::bnet.protocol.notification.Notification request, + global::System.Action done); public static pbd::ServiceDescriptor Descriptor { - get { return Proto.Notification.Descriptor.Services[1]; } + get { return Proto.NotificationService.Descriptor.Services[1]; } } public pbd::ServiceDescriptor DescriptorForType { get { return Descriptor; } @@ -1767,6 +2230,11 @@ public void CallMethod( pb::RpcUtil.SpecializeCallback( done)); return; + case 1: + this.OnNotificationSent(controller, (global::bnet.protocol.notification.Notification) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; default: throw new global::System.InvalidOperationException("Can't get here."); } @@ -1780,6 +2248,8 @@ public void CallMethod( switch(method.Index) { case 0: return global::bnet.protocol.notification.Notification.DefaultInstance; + case 1: + return global::bnet.protocol.notification.Notification.DefaultInstance; default: throw new global::System.InvalidOperationException("Can't get here."); } @@ -1793,6 +2263,8 @@ public void CallMethod( switch(method.Index) { case 0: return global::bnet.protocol.NO_RESPONSE.DefaultInstance; + case 1: + return global::bnet.protocol.NO_RESPONSE.DefaultInstance; default: throw new global::System.InvalidOperationException("Can't get here."); } @@ -1802,6 +2274,9 @@ public static Stub CreateStub(pb::IRpcChannel channel) { return new Stub(channel); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public class Stub : global::bnet.protocol.notification.NotificationListener { internal Stub(pb::IRpcChannel channel) { this.channel = channel; @@ -1821,8 +2296,19 @@ public override void OnNotificationReceived( controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); } + + public override void OnNotificationSent( + pb::IRpcController controller, + global::bnet.protocol.notification.Notification request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[1], + controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); + } } } #endregion } + +#endregion Designer generated code diff --git a/src/LibMooNet/bnet/protocol/presence/PresenceService.cs b/src/LibMooNet/bnet/protocol/presence/PresenceService.cs new file mode 100644 index 00000000..f8f71a22 --- /dev/null +++ b/src/LibMooNet/bnet/protocol/presence/PresenceService.cs @@ -0,0 +1,2844 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace bnet.protocol.presence { + + namespace Proto { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class PresenceService { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_bnet_protocol_presence_SubscribeRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_presence_SubscribeRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_presence_SubscribeNotificationRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_presence_SubscribeNotificationRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_presence_UnsubscribeRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_presence_UnsubscribeRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_presence_UpdateRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_presence_UpdateRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_presence_QueryRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_presence_QueryRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_presence_QueryResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_presence_QueryResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_presence_OwnershipRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_presence_OwnershipRequest__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static PresenceService() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "ChtibmV0L3ByZXNlbmNlX3NlcnZpY2UucHJvdG8SFmJuZXQucHJvdG9jb2wu" + + "cHJlc2VuY2UaFGJuZXQvYXR0cmlidXRlLnByb3RvGhFibmV0L2VudGl0eS5w" + + "cm90bxoOYm5ldC9ycGMucHJvdG8aGWJuZXQvcHJlc2VuY2VfdHlwZXMucHJv" + + "dG8ifAoQU3Vic2NyaWJlUmVxdWVzdBIpCghhZ2VudF9pZBgBIAEoCzIXLmJu" + + "ZXQucHJvdG9jb2wuRW50aXR5SWQSKgoJZW50aXR5X2lkGAIgAigLMhcuYm5l" + + "dC5wcm90b2NvbC5FbnRpdHlJZBIRCglvYmplY3RfaWQYAyACKAQiSgocU3Vi" + + "c2NyaWJlTm90aWZpY2F0aW9uUmVxdWVzdBIqCgllbnRpdHlfaWQYASACKAsy" + + "Fy5ibmV0LnByb3RvY29sLkVudGl0eUlkImsKElVuc3Vic2NyaWJlUmVxdWVz" + + "dBIpCghhZ2VudF9pZBgBIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQS" + + "KgoJZW50aXR5X2lkGAIgAigLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZCJ8" + + "Cg1VcGRhdGVSZXF1ZXN0EioKCWVudGl0eV9pZBgBIAIoCzIXLmJuZXQucHJv" + + "dG9jb2wuRW50aXR5SWQSPwoPZmllbGRfb3BlcmF0aW9uGAIgAygLMiYuYm5l" + + "dC5wcm90b2NvbC5wcmVzZW5jZS5GaWVsZE9wZXJhdGlvbiJpCgxRdWVyeVJl" + + "cXVlc3QSKgoJZW50aXR5X2lkGAEgAigLMhcuYm5ldC5wcm90b2NvbC5FbnRp" + + "dHlJZBItCgNrZXkYAiADKAsyIC5ibmV0LnByb3RvY29sLnByZXNlbmNlLkZp" + + "ZWxkS2V5Ij0KDVF1ZXJ5UmVzcG9uc2USLAoFZmllbGQYAiADKAsyHS5ibmV0" + + "LnByb3RvY29sLnByZXNlbmNlLkZpZWxkImAKEE93bmVyc2hpcFJlcXVlc3QS" + + "KgoJZW50aXR5X2lkGAEgAigLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBIg" + + "ChFyZWxlYXNlX293bmVyc2hpcBgCIAEoCDoFZmFsc2Uy8wQKD1ByZXNlbmNl" + + "U2VydmljZRJSCglTdWJzY3JpYmUSKC5ibmV0LnByb3RvY29sLnByZXNlbmNl" + + "LlN1YnNjcmliZVJlcXVlc3QaFS5ibmV0LnByb3RvY29sLk5vRGF0YSIEgLUY" + + "ARJWCgtVbnN1YnNjcmliZRIqLmJuZXQucHJvdG9jb2wucHJlc2VuY2UuVW5z" + + "dWJzY3JpYmVSZXF1ZXN0GhUuYm5ldC5wcm90b2NvbC5Ob0RhdGEiBIC1GAIS" + + "TAoGVXBkYXRlEiUuYm5ldC5wcm90b2NvbC5wcmVzZW5jZS5VcGRhdGVSZXF1" + + "ZXN0GhUuYm5ldC5wcm90b2NvbC5Ob0RhdGEiBIC1GAMSWgoFUXVlcnkSJC5i" + + "bmV0LnByb3RvY29sLnByZXNlbmNlLlF1ZXJ5UmVxdWVzdBolLmJuZXQucHJv" + + "dG9jb2wucHJlc2VuY2UuUXVlcnlSZXNwb25zZSIEgLUYBBJSCglPd25lcnNo" + + "aXASKC5ibmV0LnByb3RvY29sLnByZXNlbmNlLk93bmVyc2hpcFJlcXVlc3Qa" + + "FS5ibmV0LnByb3RvY29sLk5vRGF0YSIEgLUYBRJKCgRIZWFsEiUuYm5ldC5w" + + "cm90b2NvbC5wcmVzZW5jZS5VcGRhdGVSZXF1ZXN0GhUuYm5ldC5wcm90b2Nv" + + "bC5Ob0RhdGEiBIC1GAYSagoVU3Vic2NyaWJlTm90aWZpY2F0aW9uEjQuYm5l" + + "dC5wcm90b2NvbC5wcmVzZW5jZS5TdWJzY3JpYmVOb3RpZmljYXRpb25SZXF1" + + "ZXN0GhUuYm5ldC5wcm90b2NvbC5Ob0RhdGEiBIC1GAdCA4ABAA=="); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_bnet_protocol_presence_SubscribeRequest__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_presence_SubscribeRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_presence_SubscribeRequest__Descriptor, + new string[] { "AgentId", "EntityId", "ObjectId", }); + internal__static_bnet_protocol_presence_SubscribeNotificationRequest__Descriptor = Descriptor.MessageTypes[1]; + internal__static_bnet_protocol_presence_SubscribeNotificationRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_presence_SubscribeNotificationRequest__Descriptor, + new string[] { "EntityId", }); + internal__static_bnet_protocol_presence_UnsubscribeRequest__Descriptor = Descriptor.MessageTypes[2]; + internal__static_bnet_protocol_presence_UnsubscribeRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_presence_UnsubscribeRequest__Descriptor, + new string[] { "AgentId", "EntityId", }); + internal__static_bnet_protocol_presence_UpdateRequest__Descriptor = Descriptor.MessageTypes[3]; + internal__static_bnet_protocol_presence_UpdateRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_presence_UpdateRequest__Descriptor, + new string[] { "EntityId", "FieldOperation", }); + internal__static_bnet_protocol_presence_QueryRequest__Descriptor = Descriptor.MessageTypes[4]; + internal__static_bnet_protocol_presence_QueryRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_presence_QueryRequest__Descriptor, + new string[] { "EntityId", "Key", }); + internal__static_bnet_protocol_presence_QueryResponse__Descriptor = Descriptor.MessageTypes[5]; + internal__static_bnet_protocol_presence_QueryResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_presence_QueryResponse__Descriptor, + new string[] { "Field", }); + internal__static_bnet_protocol_presence_OwnershipRequest__Descriptor = Descriptor.MessageTypes[6]; + internal__static_bnet_protocol_presence_OwnershipRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_presence_OwnershipRequest__Descriptor, + new string[] { "EntityId", "ReleaseOwnership", }); + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + RegisterAllExtensions(registry); + global::bnet.protocol.attribute.Proto.Attribute.RegisterAllExtensions(registry); + global::bnet.protocol.Entity.RegisterAllExtensions(registry); + global::bnet.protocol.Rpc.RegisterAllExtensions(registry); + global::bnet.protocol.presence.PresenceTypes.RegisterAllExtensions(registry); + return registry; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::bnet.protocol.attribute.Proto.Attribute.Descriptor, + global::bnet.protocol.Entity.Descriptor, + global::bnet.protocol.Rpc.Descriptor, + global::bnet.protocol.presence.PresenceTypes.Descriptor, + }, assigner); + } + #endregion + + } + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class SubscribeRequest : pb::GeneratedMessage { + private SubscribeRequest() { } + private static readonly SubscribeRequest defaultInstance = new SubscribeRequest().MakeReadOnly(); + private static readonly string[] _subscribeRequestFieldNames = new string[] { "agent_id", "entity_id", "object_id" }; + private static readonly uint[] _subscribeRequestFieldTags = new uint[] { 10, 18, 24 }; + public static SubscribeRequest DefaultInstance { + get { return defaultInstance; } + } + + public override SubscribeRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SubscribeRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.presence.Proto.PresenceService.internal__static_bnet_protocol_presence_SubscribeRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.presence.Proto.PresenceService.internal__static_bnet_protocol_presence_SubscribeRequest__FieldAccessorTable; } + } + + public const int AgentIdFieldNumber = 1; + private bool hasAgentId; + private global::bnet.protocol.EntityId agentId_; + public bool HasAgentId { + get { return hasAgentId; } + } + public global::bnet.protocol.EntityId AgentId { + get { return agentId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int EntityIdFieldNumber = 2; + private bool hasEntityId; + private global::bnet.protocol.EntityId entityId_; + public bool HasEntityId { + get { return hasEntityId; } + } + public global::bnet.protocol.EntityId EntityId { + get { return entityId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int ObjectIdFieldNumber = 3; + private bool hasObjectId; + private ulong objectId_; + public bool HasObjectId { + get { return hasObjectId; } + } + public ulong ObjectId { + get { return objectId_; } + } + + public override bool IsInitialized { + get { + if (!hasEntityId) return false; + if (!hasObjectId) return false; + if (HasAgentId) { + if (!AgentId.IsInitialized) return false; + } + if (!EntityId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _subscribeRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); + } + if (hasEntityId) { + output.WriteMessage(2, field_names[1], EntityId); + } + if (hasObjectId) { + output.WriteUInt64(3, field_names[2], ObjectId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAgentId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); + } + if (hasEntityId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, EntityId); + } + if (hasObjectId) { + size += pb::CodedOutputStream.ComputeUInt64Size(3, ObjectId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static SubscribeRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SubscribeRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SubscribeRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SubscribeRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SubscribeRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SubscribeRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SubscribeRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SubscribeRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SubscribeRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SubscribeRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SubscribeRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SubscribeRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SubscribeRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SubscribeRequest result; + + private SubscribeRequest PrepareBuilder() { + if (resultIsReadOnly) { + SubscribeRequest original = result; + result = new SubscribeRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SubscribeRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.presence.SubscribeRequest.Descriptor; } + } + + public override SubscribeRequest DefaultInstanceForType { + get { return global::bnet.protocol.presence.SubscribeRequest.DefaultInstance; } + } + + public override SubscribeRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SubscribeRequest) { + return MergeFrom((SubscribeRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SubscribeRequest other) { + if (other == global::bnet.protocol.presence.SubscribeRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAgentId) { + MergeAgentId(other.AgentId); + } + if (other.HasEntityId) { + MergeEntityId(other.EntityId); + } + if (other.HasObjectId) { + ObjectId = other.ObjectId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_subscribeRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _subscribeRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasAgentId) { + subBuilder.MergeFrom(AgentId); + } + input.ReadMessage(subBuilder, extensionRegistry); + AgentId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasEntityId) { + subBuilder.MergeFrom(EntityId); + } + input.ReadMessage(subBuilder, extensionRegistry); + EntityId = subBuilder.BuildPartial(); + break; + } + case 24: { + result.hasObjectId = input.ReadUInt64(ref result.objectId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAgentId { + get { return result.hasAgentId; } + } + public global::bnet.protocol.EntityId AgentId { + get { return result.AgentId; } + set { SetAgentId(value); } + } + public Builder SetAgentId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAgentId = true; + result.agentId_ = value; + return this; + } + public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAgentId = true; + result.agentId_ = builderForValue.Build(); + return this; + } + public Builder MergeAgentId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAgentId && + result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); + } else { + result.agentId_ = value; + } + result.hasAgentId = true; + return this; + } + public Builder ClearAgentId() { + PrepareBuilder(); + result.hasAgentId = false; + result.agentId_ = null; + return this; + } + + public bool HasEntityId { + get { return result.hasEntityId; } + } + public global::bnet.protocol.EntityId EntityId { + get { return result.EntityId; } + set { SetEntityId(value); } + } + public Builder SetEntityId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasEntityId = true; + result.entityId_ = value; + return this; + } + public Builder SetEntityId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasEntityId = true; + result.entityId_ = builderForValue.Build(); + return this; + } + public Builder MergeEntityId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasEntityId && + result.entityId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.entityId_ = global::bnet.protocol.EntityId.CreateBuilder(result.entityId_).MergeFrom(value).BuildPartial(); + } else { + result.entityId_ = value; + } + result.hasEntityId = true; + return this; + } + public Builder ClearEntityId() { + PrepareBuilder(); + result.hasEntityId = false; + result.entityId_ = null; + return this; + } + + public bool HasObjectId { + get { return result.hasObjectId; } + } + public ulong ObjectId { + get { return result.ObjectId; } + set { SetObjectId(value); } + } + public Builder SetObjectId(ulong value) { + PrepareBuilder(); + result.hasObjectId = true; + result.objectId_ = value; + return this; + } + public Builder ClearObjectId() { + PrepareBuilder(); + result.hasObjectId = false; + result.objectId_ = 0UL; + return this; + } + } + static SubscribeRequest() { + object.ReferenceEquals(global::bnet.protocol.presence.Proto.PresenceService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class SubscribeNotificationRequest : pb::GeneratedMessage { + private SubscribeNotificationRequest() { } + private static readonly SubscribeNotificationRequest defaultInstance = new SubscribeNotificationRequest().MakeReadOnly(); + private static readonly string[] _subscribeNotificationRequestFieldNames = new string[] { "entity_id" }; + private static readonly uint[] _subscribeNotificationRequestFieldTags = new uint[] { 10 }; + public static SubscribeNotificationRequest DefaultInstance { + get { return defaultInstance; } + } + + public override SubscribeNotificationRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SubscribeNotificationRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.presence.Proto.PresenceService.internal__static_bnet_protocol_presence_SubscribeNotificationRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.presence.Proto.PresenceService.internal__static_bnet_protocol_presence_SubscribeNotificationRequest__FieldAccessorTable; } + } + + public const int EntityIdFieldNumber = 1; + private bool hasEntityId; + private global::bnet.protocol.EntityId entityId_; + public bool HasEntityId { + get { return hasEntityId; } + } + public global::bnet.protocol.EntityId EntityId { + get { return entityId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasEntityId) return false; + if (!EntityId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _subscribeNotificationRequestFieldNames; + if (hasEntityId) { + output.WriteMessage(1, field_names[0], EntityId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasEntityId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, EntityId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static SubscribeNotificationRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SubscribeNotificationRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SubscribeNotificationRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SubscribeNotificationRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SubscribeNotificationRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SubscribeNotificationRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SubscribeNotificationRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SubscribeNotificationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SubscribeNotificationRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SubscribeNotificationRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SubscribeNotificationRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SubscribeNotificationRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SubscribeNotificationRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SubscribeNotificationRequest result; + + private SubscribeNotificationRequest PrepareBuilder() { + if (resultIsReadOnly) { + SubscribeNotificationRequest original = result; + result = new SubscribeNotificationRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SubscribeNotificationRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.presence.SubscribeNotificationRequest.Descriptor; } + } + + public override SubscribeNotificationRequest DefaultInstanceForType { + get { return global::bnet.protocol.presence.SubscribeNotificationRequest.DefaultInstance; } + } + + public override SubscribeNotificationRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SubscribeNotificationRequest) { + return MergeFrom((SubscribeNotificationRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SubscribeNotificationRequest other) { + if (other == global::bnet.protocol.presence.SubscribeNotificationRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasEntityId) { + MergeEntityId(other.EntityId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_subscribeNotificationRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _subscribeNotificationRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasEntityId) { + subBuilder.MergeFrom(EntityId); + } + input.ReadMessage(subBuilder, extensionRegistry); + EntityId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasEntityId { + get { return result.hasEntityId; } + } + public global::bnet.protocol.EntityId EntityId { + get { return result.EntityId; } + set { SetEntityId(value); } + } + public Builder SetEntityId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasEntityId = true; + result.entityId_ = value; + return this; + } + public Builder SetEntityId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasEntityId = true; + result.entityId_ = builderForValue.Build(); + return this; + } + public Builder MergeEntityId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasEntityId && + result.entityId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.entityId_ = global::bnet.protocol.EntityId.CreateBuilder(result.entityId_).MergeFrom(value).BuildPartial(); + } else { + result.entityId_ = value; + } + result.hasEntityId = true; + return this; + } + public Builder ClearEntityId() { + PrepareBuilder(); + result.hasEntityId = false; + result.entityId_ = null; + return this; + } + } + static SubscribeNotificationRequest() { + object.ReferenceEquals(global::bnet.protocol.presence.Proto.PresenceService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class UnsubscribeRequest : pb::GeneratedMessage { + private UnsubscribeRequest() { } + private static readonly UnsubscribeRequest defaultInstance = new UnsubscribeRequest().MakeReadOnly(); + private static readonly string[] _unsubscribeRequestFieldNames = new string[] { "agent_id", "entity_id" }; + private static readonly uint[] _unsubscribeRequestFieldTags = new uint[] { 10, 18 }; + public static UnsubscribeRequest DefaultInstance { + get { return defaultInstance; } + } + + public override UnsubscribeRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override UnsubscribeRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.presence.Proto.PresenceService.internal__static_bnet_protocol_presence_UnsubscribeRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.presence.Proto.PresenceService.internal__static_bnet_protocol_presence_UnsubscribeRequest__FieldAccessorTable; } + } + + public const int AgentIdFieldNumber = 1; + private bool hasAgentId; + private global::bnet.protocol.EntityId agentId_; + public bool HasAgentId { + get { return hasAgentId; } + } + public global::bnet.protocol.EntityId AgentId { + get { return agentId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int EntityIdFieldNumber = 2; + private bool hasEntityId; + private global::bnet.protocol.EntityId entityId_; + public bool HasEntityId { + get { return hasEntityId; } + } + public global::bnet.protocol.EntityId EntityId { + get { return entityId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasEntityId) return false; + if (HasAgentId) { + if (!AgentId.IsInitialized) return false; + } + if (!EntityId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _unsubscribeRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); + } + if (hasEntityId) { + output.WriteMessage(2, field_names[1], EntityId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAgentId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); + } + if (hasEntityId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, EntityId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static UnsubscribeRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UnsubscribeRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UnsubscribeRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UnsubscribeRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UnsubscribeRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UnsubscribeRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static UnsubscribeRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static UnsubscribeRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static UnsubscribeRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UnsubscribeRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private UnsubscribeRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(UnsubscribeRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(UnsubscribeRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private UnsubscribeRequest result; + + private UnsubscribeRequest PrepareBuilder() { + if (resultIsReadOnly) { + UnsubscribeRequest original = result; + result = new UnsubscribeRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override UnsubscribeRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.presence.UnsubscribeRequest.Descriptor; } + } + + public override UnsubscribeRequest DefaultInstanceForType { + get { return global::bnet.protocol.presence.UnsubscribeRequest.DefaultInstance; } + } + + public override UnsubscribeRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is UnsubscribeRequest) { + return MergeFrom((UnsubscribeRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(UnsubscribeRequest other) { + if (other == global::bnet.protocol.presence.UnsubscribeRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAgentId) { + MergeAgentId(other.AgentId); + } + if (other.HasEntityId) { + MergeEntityId(other.EntityId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_unsubscribeRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _unsubscribeRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasAgentId) { + subBuilder.MergeFrom(AgentId); + } + input.ReadMessage(subBuilder, extensionRegistry); + AgentId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasEntityId) { + subBuilder.MergeFrom(EntityId); + } + input.ReadMessage(subBuilder, extensionRegistry); + EntityId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAgentId { + get { return result.hasAgentId; } + } + public global::bnet.protocol.EntityId AgentId { + get { return result.AgentId; } + set { SetAgentId(value); } + } + public Builder SetAgentId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAgentId = true; + result.agentId_ = value; + return this; + } + public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAgentId = true; + result.agentId_ = builderForValue.Build(); + return this; + } + public Builder MergeAgentId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAgentId && + result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); + } else { + result.agentId_ = value; + } + result.hasAgentId = true; + return this; + } + public Builder ClearAgentId() { + PrepareBuilder(); + result.hasAgentId = false; + result.agentId_ = null; + return this; + } + + public bool HasEntityId { + get { return result.hasEntityId; } + } + public global::bnet.protocol.EntityId EntityId { + get { return result.EntityId; } + set { SetEntityId(value); } + } + public Builder SetEntityId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasEntityId = true; + result.entityId_ = value; + return this; + } + public Builder SetEntityId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasEntityId = true; + result.entityId_ = builderForValue.Build(); + return this; + } + public Builder MergeEntityId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasEntityId && + result.entityId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.entityId_ = global::bnet.protocol.EntityId.CreateBuilder(result.entityId_).MergeFrom(value).BuildPartial(); + } else { + result.entityId_ = value; + } + result.hasEntityId = true; + return this; + } + public Builder ClearEntityId() { + PrepareBuilder(); + result.hasEntityId = false; + result.entityId_ = null; + return this; + } + } + static UnsubscribeRequest() { + object.ReferenceEquals(global::bnet.protocol.presence.Proto.PresenceService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class UpdateRequest : pb::GeneratedMessage { + private UpdateRequest() { } + private static readonly UpdateRequest defaultInstance = new UpdateRequest().MakeReadOnly(); + private static readonly string[] _updateRequestFieldNames = new string[] { "entity_id", "field_operation" }; + private static readonly uint[] _updateRequestFieldTags = new uint[] { 10, 18 }; + public static UpdateRequest DefaultInstance { + get { return defaultInstance; } + } + + public override UpdateRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override UpdateRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.presence.Proto.PresenceService.internal__static_bnet_protocol_presence_UpdateRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.presence.Proto.PresenceService.internal__static_bnet_protocol_presence_UpdateRequest__FieldAccessorTable; } + } + + public const int EntityIdFieldNumber = 1; + private bool hasEntityId; + private global::bnet.protocol.EntityId entityId_; + public bool HasEntityId { + get { return hasEntityId; } + } + public global::bnet.protocol.EntityId EntityId { + get { return entityId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int FieldOperationFieldNumber = 2; + private pbc::PopsicleList fieldOperation_ = new pbc::PopsicleList(); + public scg::IList FieldOperationList { + get { return fieldOperation_; } + } + public int FieldOperationCount { + get { return fieldOperation_.Count; } + } + public global::bnet.protocol.presence.FieldOperation GetFieldOperation(int index) { + return fieldOperation_[index]; + } + + public override bool IsInitialized { + get { + if (!hasEntityId) return false; + if (!EntityId.IsInitialized) return false; + foreach (global::bnet.protocol.presence.FieldOperation element in FieldOperationList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _updateRequestFieldNames; + if (hasEntityId) { + output.WriteMessage(1, field_names[0], EntityId); + } + if (fieldOperation_.Count > 0) { + output.WriteMessageArray(2, field_names[1], fieldOperation_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasEntityId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, EntityId); + } + foreach (global::bnet.protocol.presence.FieldOperation element in FieldOperationList) { + size += pb::CodedOutputStream.ComputeMessageSize(2, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static UpdateRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UpdateRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UpdateRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UpdateRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UpdateRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UpdateRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static UpdateRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static UpdateRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static UpdateRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UpdateRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private UpdateRequest MakeReadOnly() { + fieldOperation_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(UpdateRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(UpdateRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private UpdateRequest result; + + private UpdateRequest PrepareBuilder() { + if (resultIsReadOnly) { + UpdateRequest original = result; + result = new UpdateRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override UpdateRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.presence.UpdateRequest.Descriptor; } + } + + public override UpdateRequest DefaultInstanceForType { + get { return global::bnet.protocol.presence.UpdateRequest.DefaultInstance; } + } + + public override UpdateRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is UpdateRequest) { + return MergeFrom((UpdateRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(UpdateRequest other) { + if (other == global::bnet.protocol.presence.UpdateRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasEntityId) { + MergeEntityId(other.EntityId); + } + if (other.fieldOperation_.Count != 0) { + result.fieldOperation_.Add(other.fieldOperation_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_updateRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _updateRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasEntityId) { + subBuilder.MergeFrom(EntityId); + } + input.ReadMessage(subBuilder, extensionRegistry); + EntityId = subBuilder.BuildPartial(); + break; + } + case 18: { + input.ReadMessageArray(tag, field_name, result.fieldOperation_, global::bnet.protocol.presence.FieldOperation.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasEntityId { + get { return result.hasEntityId; } + } + public global::bnet.protocol.EntityId EntityId { + get { return result.EntityId; } + set { SetEntityId(value); } + } + public Builder SetEntityId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasEntityId = true; + result.entityId_ = value; + return this; + } + public Builder SetEntityId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasEntityId = true; + result.entityId_ = builderForValue.Build(); + return this; + } + public Builder MergeEntityId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasEntityId && + result.entityId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.entityId_ = global::bnet.protocol.EntityId.CreateBuilder(result.entityId_).MergeFrom(value).BuildPartial(); + } else { + result.entityId_ = value; + } + result.hasEntityId = true; + return this; + } + public Builder ClearEntityId() { + PrepareBuilder(); + result.hasEntityId = false; + result.entityId_ = null; + return this; + } + + public pbc::IPopsicleList FieldOperationList { + get { return PrepareBuilder().fieldOperation_; } + } + public int FieldOperationCount { + get { return result.FieldOperationCount; } + } + public global::bnet.protocol.presence.FieldOperation GetFieldOperation(int index) { + return result.GetFieldOperation(index); + } + public Builder SetFieldOperation(int index, global::bnet.protocol.presence.FieldOperation value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.fieldOperation_[index] = value; + return this; + } + public Builder SetFieldOperation(int index, global::bnet.protocol.presence.FieldOperation.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.fieldOperation_[index] = builderForValue.Build(); + return this; + } + public Builder AddFieldOperation(global::bnet.protocol.presence.FieldOperation value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.fieldOperation_.Add(value); + return this; + } + public Builder AddFieldOperation(global::bnet.protocol.presence.FieldOperation.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.fieldOperation_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeFieldOperation(scg::IEnumerable values) { + PrepareBuilder(); + result.fieldOperation_.Add(values); + return this; + } + public Builder ClearFieldOperation() { + PrepareBuilder(); + result.fieldOperation_.Clear(); + return this; + } + } + static UpdateRequest() { + object.ReferenceEquals(global::bnet.protocol.presence.Proto.PresenceService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class QueryRequest : pb::GeneratedMessage { + private QueryRequest() { } + private static readonly QueryRequest defaultInstance = new QueryRequest().MakeReadOnly(); + private static readonly string[] _queryRequestFieldNames = new string[] { "entity_id", "key" }; + private static readonly uint[] _queryRequestFieldTags = new uint[] { 10, 18 }; + public static QueryRequest DefaultInstance { + get { return defaultInstance; } + } + + public override QueryRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override QueryRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.presence.Proto.PresenceService.internal__static_bnet_protocol_presence_QueryRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.presence.Proto.PresenceService.internal__static_bnet_protocol_presence_QueryRequest__FieldAccessorTable; } + } + + public const int EntityIdFieldNumber = 1; + private bool hasEntityId; + private global::bnet.protocol.EntityId entityId_; + public bool HasEntityId { + get { return hasEntityId; } + } + public global::bnet.protocol.EntityId EntityId { + get { return entityId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int KeyFieldNumber = 2; + private pbc::PopsicleList key_ = new pbc::PopsicleList(); + public scg::IList KeyList { + get { return key_; } + } + public int KeyCount { + get { return key_.Count; } + } + public global::bnet.protocol.presence.FieldKey GetKey(int index) { + return key_[index]; + } + + public override bool IsInitialized { + get { + if (!hasEntityId) return false; + if (!EntityId.IsInitialized) return false; + foreach (global::bnet.protocol.presence.FieldKey element in KeyList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _queryRequestFieldNames; + if (hasEntityId) { + output.WriteMessage(1, field_names[0], EntityId); + } + if (key_.Count > 0) { + output.WriteMessageArray(2, field_names[1], key_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasEntityId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, EntityId); + } + foreach (global::bnet.protocol.presence.FieldKey element in KeyList) { + size += pb::CodedOutputStream.ComputeMessageSize(2, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static QueryRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static QueryRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static QueryRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static QueryRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static QueryRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static QueryRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static QueryRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static QueryRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static QueryRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static QueryRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private QueryRequest MakeReadOnly() { + key_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(QueryRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(QueryRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private QueryRequest result; + + private QueryRequest PrepareBuilder() { + if (resultIsReadOnly) { + QueryRequest original = result; + result = new QueryRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override QueryRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.presence.QueryRequest.Descriptor; } + } + + public override QueryRequest DefaultInstanceForType { + get { return global::bnet.protocol.presence.QueryRequest.DefaultInstance; } + } + + public override QueryRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is QueryRequest) { + return MergeFrom((QueryRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(QueryRequest other) { + if (other == global::bnet.protocol.presence.QueryRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasEntityId) { + MergeEntityId(other.EntityId); + } + if (other.key_.Count != 0) { + result.key_.Add(other.key_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_queryRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _queryRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasEntityId) { + subBuilder.MergeFrom(EntityId); + } + input.ReadMessage(subBuilder, extensionRegistry); + EntityId = subBuilder.BuildPartial(); + break; + } + case 18: { + input.ReadMessageArray(tag, field_name, result.key_, global::bnet.protocol.presence.FieldKey.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasEntityId { + get { return result.hasEntityId; } + } + public global::bnet.protocol.EntityId EntityId { + get { return result.EntityId; } + set { SetEntityId(value); } + } + public Builder SetEntityId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasEntityId = true; + result.entityId_ = value; + return this; + } + public Builder SetEntityId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasEntityId = true; + result.entityId_ = builderForValue.Build(); + return this; + } + public Builder MergeEntityId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasEntityId && + result.entityId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.entityId_ = global::bnet.protocol.EntityId.CreateBuilder(result.entityId_).MergeFrom(value).BuildPartial(); + } else { + result.entityId_ = value; + } + result.hasEntityId = true; + return this; + } + public Builder ClearEntityId() { + PrepareBuilder(); + result.hasEntityId = false; + result.entityId_ = null; + return this; + } + + public pbc::IPopsicleList KeyList { + get { return PrepareBuilder().key_; } + } + public int KeyCount { + get { return result.KeyCount; } + } + public global::bnet.protocol.presence.FieldKey GetKey(int index) { + return result.GetKey(index); + } + public Builder SetKey(int index, global::bnet.protocol.presence.FieldKey value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.key_[index] = value; + return this; + } + public Builder SetKey(int index, global::bnet.protocol.presence.FieldKey.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.key_[index] = builderForValue.Build(); + return this; + } + public Builder AddKey(global::bnet.protocol.presence.FieldKey value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.key_.Add(value); + return this; + } + public Builder AddKey(global::bnet.protocol.presence.FieldKey.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.key_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeKey(scg::IEnumerable values) { + PrepareBuilder(); + result.key_.Add(values); + return this; + } + public Builder ClearKey() { + PrepareBuilder(); + result.key_.Clear(); + return this; + } + } + static QueryRequest() { + object.ReferenceEquals(global::bnet.protocol.presence.Proto.PresenceService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class QueryResponse : pb::GeneratedMessage { + private QueryResponse() { } + private static readonly QueryResponse defaultInstance = new QueryResponse().MakeReadOnly(); + private static readonly string[] _queryResponseFieldNames = new string[] { "field" }; + private static readonly uint[] _queryResponseFieldTags = new uint[] { 18 }; + public static QueryResponse DefaultInstance { + get { return defaultInstance; } + } + + public override QueryResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override QueryResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.presence.Proto.PresenceService.internal__static_bnet_protocol_presence_QueryResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.presence.Proto.PresenceService.internal__static_bnet_protocol_presence_QueryResponse__FieldAccessorTable; } + } + + public const int FieldFieldNumber = 2; + private pbc::PopsicleList field_ = new pbc::PopsicleList(); + public scg::IList FieldList { + get { return field_; } + } + public int FieldCount { + get { return field_.Count; } + } + public global::bnet.protocol.presence.Field GetField(int index) { + return field_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.presence.Field element in FieldList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _queryResponseFieldNames; + if (field_.Count > 0) { + output.WriteMessageArray(2, field_names[0], field_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.presence.Field element in FieldList) { + size += pb::CodedOutputStream.ComputeMessageSize(2, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static QueryResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static QueryResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static QueryResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static QueryResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static QueryResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static QueryResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static QueryResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static QueryResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static QueryResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static QueryResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private QueryResponse MakeReadOnly() { + field_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(QueryResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(QueryResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private QueryResponse result; + + private QueryResponse PrepareBuilder() { + if (resultIsReadOnly) { + QueryResponse original = result; + result = new QueryResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override QueryResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.presence.QueryResponse.Descriptor; } + } + + public override QueryResponse DefaultInstanceForType { + get { return global::bnet.protocol.presence.QueryResponse.DefaultInstance; } + } + + public override QueryResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is QueryResponse) { + return MergeFrom((QueryResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(QueryResponse other) { + if (other == global::bnet.protocol.presence.QueryResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.field_.Count != 0) { + result.field_.Add(other.field_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_queryResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _queryResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 18: { + input.ReadMessageArray(tag, field_name, result.field_, global::bnet.protocol.presence.Field.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList FieldList { + get { return PrepareBuilder().field_; } + } + public int FieldCount { + get { return result.FieldCount; } + } + public global::bnet.protocol.presence.Field GetField(int index) { + return result.GetField(index); + } + public Builder SetField(int index, global::bnet.protocol.presence.Field value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.field_[index] = value; + return this; + } + public Builder SetField(int index, global::bnet.protocol.presence.Field.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.field_[index] = builderForValue.Build(); + return this; + } + public Builder AddField(global::bnet.protocol.presence.Field value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.field_.Add(value); + return this; + } + public Builder AddField(global::bnet.protocol.presence.Field.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.field_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeField(scg::IEnumerable values) { + PrepareBuilder(); + result.field_.Add(values); + return this; + } + public Builder ClearField() { + PrepareBuilder(); + result.field_.Clear(); + return this; + } + } + static QueryResponse() { + object.ReferenceEquals(global::bnet.protocol.presence.Proto.PresenceService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class OwnershipRequest : pb::GeneratedMessage { + private OwnershipRequest() { } + private static readonly OwnershipRequest defaultInstance = new OwnershipRequest().MakeReadOnly(); + private static readonly string[] _ownershipRequestFieldNames = new string[] { "entity_id", "release_ownership" }; + private static readonly uint[] _ownershipRequestFieldTags = new uint[] { 10, 16 }; + public static OwnershipRequest DefaultInstance { + get { return defaultInstance; } + } + + public override OwnershipRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override OwnershipRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.presence.Proto.PresenceService.internal__static_bnet_protocol_presence_OwnershipRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.presence.Proto.PresenceService.internal__static_bnet_protocol_presence_OwnershipRequest__FieldAccessorTable; } + } + + public const int EntityIdFieldNumber = 1; + private bool hasEntityId; + private global::bnet.protocol.EntityId entityId_; + public bool HasEntityId { + get { return hasEntityId; } + } + public global::bnet.protocol.EntityId EntityId { + get { return entityId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int ReleaseOwnershipFieldNumber = 2; + private bool hasReleaseOwnership; + private bool releaseOwnership_; + public bool HasReleaseOwnership { + get { return hasReleaseOwnership; } + } + public bool ReleaseOwnership { + get { return releaseOwnership_; } + } + + public override bool IsInitialized { + get { + if (!hasEntityId) return false; + if (!EntityId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _ownershipRequestFieldNames; + if (hasEntityId) { + output.WriteMessage(1, field_names[0], EntityId); + } + if (hasReleaseOwnership) { + output.WriteBool(2, field_names[1], ReleaseOwnership); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasEntityId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, EntityId); + } + if (hasReleaseOwnership) { + size += pb::CodedOutputStream.ComputeBoolSize(2, ReleaseOwnership); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static OwnershipRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static OwnershipRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static OwnershipRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static OwnershipRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static OwnershipRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static OwnershipRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static OwnershipRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static OwnershipRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static OwnershipRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static OwnershipRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private OwnershipRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(OwnershipRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(OwnershipRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private OwnershipRequest result; + + private OwnershipRequest PrepareBuilder() { + if (resultIsReadOnly) { + OwnershipRequest original = result; + result = new OwnershipRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override OwnershipRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.presence.OwnershipRequest.Descriptor; } + } + + public override OwnershipRequest DefaultInstanceForType { + get { return global::bnet.protocol.presence.OwnershipRequest.DefaultInstance; } + } + + public override OwnershipRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is OwnershipRequest) { + return MergeFrom((OwnershipRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(OwnershipRequest other) { + if (other == global::bnet.protocol.presence.OwnershipRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasEntityId) { + MergeEntityId(other.EntityId); + } + if (other.HasReleaseOwnership) { + ReleaseOwnership = other.ReleaseOwnership; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_ownershipRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _ownershipRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasEntityId) { + subBuilder.MergeFrom(EntityId); + } + input.ReadMessage(subBuilder, extensionRegistry); + EntityId = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasReleaseOwnership = input.ReadBool(ref result.releaseOwnership_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasEntityId { + get { return result.hasEntityId; } + } + public global::bnet.protocol.EntityId EntityId { + get { return result.EntityId; } + set { SetEntityId(value); } + } + public Builder SetEntityId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasEntityId = true; + result.entityId_ = value; + return this; + } + public Builder SetEntityId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasEntityId = true; + result.entityId_ = builderForValue.Build(); + return this; + } + public Builder MergeEntityId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasEntityId && + result.entityId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.entityId_ = global::bnet.protocol.EntityId.CreateBuilder(result.entityId_).MergeFrom(value).BuildPartial(); + } else { + result.entityId_ = value; + } + result.hasEntityId = true; + return this; + } + public Builder ClearEntityId() { + PrepareBuilder(); + result.hasEntityId = false; + result.entityId_ = null; + return this; + } + + public bool HasReleaseOwnership { + get { return result.hasReleaseOwnership; } + } + public bool ReleaseOwnership { + get { return result.ReleaseOwnership; } + set { SetReleaseOwnership(value); } + } + public Builder SetReleaseOwnership(bool value) { + PrepareBuilder(); + result.hasReleaseOwnership = true; + result.releaseOwnership_ = value; + return this; + } + public Builder ClearReleaseOwnership() { + PrepareBuilder(); + result.hasReleaseOwnership = false; + result.releaseOwnership_ = false; + return this; + } + } + static OwnershipRequest() { + object.ReferenceEquals(global::bnet.protocol.presence.Proto.PresenceService.Descriptor, null); + } + } + + #endregion + + #region Services + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public abstract class PresenceService : pb::IService { + public abstract void Subscribe( + pb::IRpcController controller, + global::bnet.protocol.presence.SubscribeRequest request, + global::System.Action done); + public abstract void Unsubscribe( + pb::IRpcController controller, + global::bnet.protocol.presence.UnsubscribeRequest request, + global::System.Action done); + public abstract void Update( + pb::IRpcController controller, + global::bnet.protocol.presence.UpdateRequest request, + global::System.Action done); + public abstract void Query( + pb::IRpcController controller, + global::bnet.protocol.presence.QueryRequest request, + global::System.Action done); + public abstract void Ownership( + pb::IRpcController controller, + global::bnet.protocol.presence.OwnershipRequest request, + global::System.Action done); + public abstract void Heal( + pb::IRpcController controller, + global::bnet.protocol.presence.UpdateRequest request, + global::System.Action done); + public abstract void SubscribeNotification( + pb::IRpcController controller, + global::bnet.protocol.presence.SubscribeNotificationRequest request, + global::System.Action done); + + public static pbd::ServiceDescriptor Descriptor { + get { return Proto.PresenceService.Descriptor.Services[0]; } + } + public pbd::ServiceDescriptor DescriptorForType { + get { return Descriptor; } + } + + public void CallMethod( + pbd::MethodDescriptor method, + pb::IRpcController controller, + pb::IMessage request, + global::System.Action done) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.CallMethod() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + this.Subscribe(controller, (global::bnet.protocol.presence.SubscribeRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 1: + this.Unsubscribe(controller, (global::bnet.protocol.presence.UnsubscribeRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 2: + this.Update(controller, (global::bnet.protocol.presence.UpdateRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 3: + this.Query(controller, (global::bnet.protocol.presence.QueryRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 4: + this.Ownership(controller, (global::bnet.protocol.presence.OwnershipRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 5: + this.Heal(controller, (global::bnet.protocol.presence.UpdateRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 6: + this.SubscribeNotification(controller, (global::bnet.protocol.presence.SubscribeNotificationRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetRequestPrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.presence.SubscribeRequest.DefaultInstance; + case 1: + return global::bnet.protocol.presence.UnsubscribeRequest.DefaultInstance; + case 2: + return global::bnet.protocol.presence.UpdateRequest.DefaultInstance; + case 3: + return global::bnet.protocol.presence.QueryRequest.DefaultInstance; + case 4: + return global::bnet.protocol.presence.OwnershipRequest.DefaultInstance; + case 5: + return global::bnet.protocol.presence.UpdateRequest.DefaultInstance; + case 6: + return global::bnet.protocol.presence.SubscribeNotificationRequest.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetResponsePrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.NoData.DefaultInstance; + case 1: + return global::bnet.protocol.NoData.DefaultInstance; + case 2: + return global::bnet.protocol.NoData.DefaultInstance; + case 3: + return global::bnet.protocol.presence.QueryResponse.DefaultInstance; + case 4: + return global::bnet.protocol.NoData.DefaultInstance; + case 5: + return global::bnet.protocol.NoData.DefaultInstance; + case 6: + return global::bnet.protocol.NoData.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public static Stub CreateStub(pb::IRpcChannel channel) { + return new Stub(channel); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public class Stub : global::bnet.protocol.presence.PresenceService { + internal Stub(pb::IRpcChannel channel) { + this.channel = channel; + } + + private readonly pb::IRpcChannel channel; + + public pb::IRpcChannel Channel { + get { return channel; } + } + + public override void Subscribe( + pb::IRpcController controller, + global::bnet.protocol.presence.SubscribeRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[0], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void Unsubscribe( + pb::IRpcController controller, + global::bnet.protocol.presence.UnsubscribeRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[1], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void Update( + pb::IRpcController controller, + global::bnet.protocol.presence.UpdateRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[2], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void Query( + pb::IRpcController controller, + global::bnet.protocol.presence.QueryRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[3], + controller, request, global::bnet.protocol.presence.QueryResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.presence.QueryResponse.DefaultInstance)); + } + + public override void Ownership( + pb::IRpcController controller, + global::bnet.protocol.presence.OwnershipRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[4], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void Heal( + pb::IRpcController controller, + global::bnet.protocol.presence.UpdateRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[5], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void SubscribeNotification( + pb::IRpcController controller, + global::bnet.protocol.presence.SubscribeNotificationRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[6], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + } + } + #endregion + +} + +#endregion Designer generated code diff --git a/source/D3Proto/bnet/protocol/presence/PresenceTypes.cs b/src/LibMooNet/bnet/protocol/presence/PresenceTypes.cs similarity index 55% rename from source/D3Proto/bnet/protocol/presence/PresenceTypes.cs rename to src/LibMooNet/bnet/protocol/presence/PresenceTypes.cs index df849e1f..33bcf450 100644 --- a/source/D3Proto/bnet/protocol/presence/PresenceTypes.cs +++ b/src/LibMooNet/bnet/protocol/presence/PresenceTypes.cs @@ -1,4 +1,6 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code using pb = global::Google.ProtocolBuffers; using pbc = global::Google.ProtocolBuffers.Collections; @@ -6,6 +8,9 @@ using scg = global::System.Collections.Generic; namespace bnet.protocol.presence { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public static partial class PresenceTypes { #region Extension registration @@ -14,6 +19,8 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { } #endregion #region Static variables + internal static pbd::MessageDescriptor internal__static_bnet_protocol_presence_RichPresence__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_presence_RichPresence__FieldAccessorTable; internal static pbd::MessageDescriptor internal__static_bnet_protocol_presence_FieldKey__Descriptor; internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_presence_FieldKey__FieldAccessorTable; internal static pbd::MessageDescriptor internal__static_bnet_protocol_presence_Field__Descriptor; @@ -31,41 +38,46 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { static PresenceTypes() { byte[] descriptorData = global::System.Convert.FromBase64String( - "CiVzZXJ2aWNlL3ByZXNlbmNlL3ByZXNlbmNlX3R5cGVzLnByb3RvEhZibmV0" + - "LnByb3RvY29sLnByZXNlbmNlGhxsaWIvcHJvdG9jb2wvYXR0cmlidXRlLnBy" + - "b3RvGhlsaWIvcHJvdG9jb2wvZW50aXR5LnByb3RvGiNzZXJ2aWNlL2NoYW5u" + - "ZWwvY2hhbm5lbF90eXBlcy5wcm90byJLCghGaWVsZEtleRIPCgdwcm9ncmFt" + - "GAEgAigNEg0KBWdyb3VwGAIgAigNEg0KBWZpZWxkGAMgAigNEhAKBWluZGV4" + - "GAQgASgEOgEwImcKBUZpZWxkEi0KA2tleRgBIAIoCzIgLmJuZXQucHJvdG9j" + - "b2wucHJlc2VuY2UuRmllbGRLZXkSLwoFdmFsdWUYAiACKAsyIC5ibmV0LnBy" + - "b3RvY29sLmF0dHJpYnV0ZS5WYXJpYW50IrEBCg5GaWVsZE9wZXJhdGlvbhIs" + - "CgVmaWVsZBgBIAIoCzIdLmJuZXQucHJvdG9jb2wucHJlc2VuY2UuRmllbGQS" + - "TAoJb3BlcmF0aW9uGAIgASgOMjQuYm5ldC5wcm90b2NvbC5wcmVzZW5jZS5G" + - "aWVsZE9wZXJhdGlvbi5PcGVyYXRpb25UeXBlOgNTRVQiIwoNT3BlcmF0aW9u" + - "VHlwZRIHCgNTRVQQABIJCgVDTEVBUhABItgBCgxDaGFubmVsU3RhdGUSKgoJ" + - "ZW50aXR5X2lkGAEgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBI/Cg9m" + - "aWVsZF9vcGVyYXRpb24YAiADKAsyJi5ibmV0LnByb3RvY29sLnByZXNlbmNl" + - "LkZpZWxkT3BlcmF0aW9uMlsKCHByZXNlbmNlEiMuYm5ldC5wcm90b2NvbC5j" + - "aGFubmVsLkNoYW5uZWxTdGF0ZRhlIAEoCzIkLmJuZXQucHJvdG9jb2wucHJl" + - "c2VuY2UuQ2hhbm5lbFN0YXRl"); + "ChlibmV0L3ByZXNlbmNlX3R5cGVzLnByb3RvEhZibmV0LnByb3RvY29sLnBy" + + "ZXNlbmNlGhRibmV0L2F0dHJpYnV0ZS5wcm90bxoRYm5ldC9lbnRpdHkucHJv" + + "dG8aGGJuZXQvY2hhbm5lbF90eXBlcy5wcm90byJECgxSaWNoUHJlc2VuY2US" + + "EgoKcHJvZ3JhbV9pZBgBIAIoBxIRCglzdHJlYW1faWQYAiACKAcSDQoFaW5k" + + "ZXgYAyACKA0iSwoIRmllbGRLZXkSDwoHcHJvZ3JhbRgBIAIoDRINCgVncm91" + + "cBgCIAIoDRINCgVmaWVsZBgDIAIoDRIQCgVpbmRleBgEIAEoBDoBMCJnCgVG" + + "aWVsZBItCgNrZXkYASACKAsyIC5ibmV0LnByb3RvY29sLnByZXNlbmNlLkZp" + + "ZWxkS2V5Ei8KBXZhbHVlGAIgAigLMiAuYm5ldC5wcm90b2NvbC5hdHRyaWJ1" + + "dGUuVmFyaWFudCKxAQoORmllbGRPcGVyYXRpb24SLAoFZmllbGQYASACKAsy" + + "HS5ibmV0LnByb3RvY29sLnByZXNlbmNlLkZpZWxkEkwKCW9wZXJhdGlvbhgC" + + "IAEoDjI0LmJuZXQucHJvdG9jb2wucHJlc2VuY2UuRmllbGRPcGVyYXRpb24u" + + "T3BlcmF0aW9uVHlwZToDU0VUIiMKDU9wZXJhdGlvblR5cGUSBwoDU0VUEAAS" + + "CQoFQ0xFQVIQASLwAQoMQ2hhbm5lbFN0YXRlEioKCWVudGl0eV9pZBgBIAEo" + + "CzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSPwoPZmllbGRfb3BlcmF0aW9u" + + "GAIgAygLMiYuYm5ldC5wcm90b2NvbC5wcmVzZW5jZS5GaWVsZE9wZXJhdGlv" + + "bhIWCgdoZWFsaW5nGAMgASgIOgVmYWxzZTJbCghwcmVzZW5jZRIjLmJuZXQu" + + "cHJvdG9jb2wuY2hhbm5lbC5DaGFubmVsU3RhdGUYZSABKAsyJC5ibmV0LnBy" + + "b3RvY29sLnByZXNlbmNlLkNoYW5uZWxTdGF0ZQ=="); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; - internal__static_bnet_protocol_presence_FieldKey__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_presence_RichPresence__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_presence_RichPresence__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_presence_RichPresence__Descriptor, + new string[] { "ProgramId", "StreamId", "Index", }); + internal__static_bnet_protocol_presence_FieldKey__Descriptor = Descriptor.MessageTypes[1]; internal__static_bnet_protocol_presence_FieldKey__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_presence_FieldKey__Descriptor, new string[] { "Program", "Group", "Field", "Index", }); - internal__static_bnet_protocol_presence_Field__Descriptor = Descriptor.MessageTypes[1]; + internal__static_bnet_protocol_presence_Field__Descriptor = Descriptor.MessageTypes[2]; internal__static_bnet_protocol_presence_Field__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_presence_Field__Descriptor, new string[] { "Key", "Value", }); - internal__static_bnet_protocol_presence_FieldOperation__Descriptor = Descriptor.MessageTypes[2]; + internal__static_bnet_protocol_presence_FieldOperation__Descriptor = Descriptor.MessageTypes[3]; internal__static_bnet_protocol_presence_FieldOperation__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_presence_FieldOperation__Descriptor, new string[] { "Field", "Operation", }); - internal__static_bnet_protocol_presence_ChannelState__Descriptor = Descriptor.MessageTypes[3]; + internal__static_bnet_protocol_presence_ChannelState__Descriptor = Descriptor.MessageTypes[4]; internal__static_bnet_protocol_presence_ChannelState__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_presence_ChannelState__Descriptor, - new string[] { "EntityId", "FieldOperation", }); + new string[] { "EntityId", "FieldOperation", "Healing", }); global::bnet.protocol.presence.ChannelState.Presence = pb::GeneratedSingleExtension.CreateInstance(global::bnet.protocol.presence.ChannelState.Descriptor.Extensions[0]); return null; }; @@ -80,14 +92,383 @@ static PresenceTypes() { } #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class RichPresence : pb::GeneratedMessage { + private RichPresence() { } + private static readonly RichPresence defaultInstance = new RichPresence().MakeReadOnly(); + private static readonly string[] _richPresenceFieldNames = new string[] { "index", "program_id", "stream_id" }; + private static readonly uint[] _richPresenceFieldTags = new uint[] { 24, 13, 21 }; + public static RichPresence DefaultInstance { + get { return defaultInstance; } + } + + public override RichPresence DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override RichPresence ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.presence.PresenceTypes.internal__static_bnet_protocol_presence_RichPresence__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.presence.PresenceTypes.internal__static_bnet_protocol_presence_RichPresence__FieldAccessorTable; } + } + + public const int ProgramIdFieldNumber = 1; + private bool hasProgramId; + private uint programId_; + public bool HasProgramId { + get { return hasProgramId; } + } + public uint ProgramId { + get { return programId_; } + } + + public const int StreamIdFieldNumber = 2; + private bool hasStreamId; + private uint streamId_; + public bool HasStreamId { + get { return hasStreamId; } + } + public uint StreamId { + get { return streamId_; } + } + + public const int IndexFieldNumber = 3; + private bool hasIndex; + private uint index_; + public bool HasIndex { + get { return hasIndex; } + } + public uint Index { + get { return index_; } + } + + public override bool IsInitialized { + get { + if (!hasProgramId) return false; + if (!hasStreamId) return false; + if (!hasIndex) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _richPresenceFieldNames; + if (hasProgramId) { + output.WriteFixed32(1, field_names[1], ProgramId); + } + if (hasStreamId) { + output.WriteFixed32(2, field_names[2], StreamId); + } + if (hasIndex) { + output.WriteUInt32(3, field_names[0], Index); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasProgramId) { + size += pb::CodedOutputStream.ComputeFixed32Size(1, ProgramId); + } + if (hasStreamId) { + size += pb::CodedOutputStream.ComputeFixed32Size(2, StreamId); + } + if (hasIndex) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, Index); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static RichPresence ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RichPresence ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RichPresence ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RichPresence ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RichPresence ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RichPresence ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static RichPresence ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static RichPresence ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static RichPresence ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RichPresence ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private RichPresence MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(RichPresence prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(RichPresence cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private RichPresence result; + + private RichPresence PrepareBuilder() { + if (resultIsReadOnly) { + RichPresence original = result; + result = new RichPresence(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override RichPresence MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.presence.RichPresence.Descriptor; } + } + + public override RichPresence DefaultInstanceForType { + get { return global::bnet.protocol.presence.RichPresence.DefaultInstance; } + } + + public override RichPresence BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is RichPresence) { + return MergeFrom((RichPresence) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(RichPresence other) { + if (other == global::bnet.protocol.presence.RichPresence.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasProgramId) { + ProgramId = other.ProgramId; + } + if (other.HasStreamId) { + StreamId = other.StreamId; + } + if (other.HasIndex) { + Index = other.Index; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_richPresenceFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _richPresenceFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 13: { + result.hasProgramId = input.ReadFixed32(ref result.programId_); + break; + } + case 21: { + result.hasStreamId = input.ReadFixed32(ref result.streamId_); + break; + } + case 24: { + result.hasIndex = input.ReadUInt32(ref result.index_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasProgramId { + get { return result.hasProgramId; } + } + public uint ProgramId { + get { return result.ProgramId; } + set { SetProgramId(value); } + } + public Builder SetProgramId(uint value) { + PrepareBuilder(); + result.hasProgramId = true; + result.programId_ = value; + return this; + } + public Builder ClearProgramId() { + PrepareBuilder(); + result.hasProgramId = false; + result.programId_ = 0; + return this; + } + + public bool HasStreamId { + get { return result.hasStreamId; } + } + public uint StreamId { + get { return result.StreamId; } + set { SetStreamId(value); } + } + public Builder SetStreamId(uint value) { + PrepareBuilder(); + result.hasStreamId = true; + result.streamId_ = value; + return this; + } + public Builder ClearStreamId() { + PrepareBuilder(); + result.hasStreamId = false; + result.streamId_ = 0; + return this; + } + + public bool HasIndex { + get { return result.hasIndex; } + } + public uint Index { + get { return result.Index; } + set { SetIndex(value); } + } + public Builder SetIndex(uint value) { + PrepareBuilder(); + result.hasIndex = true; + result.index_ = value; + return this; + } + public Builder ClearIndex() { + PrepareBuilder(); + result.hasIndex = false; + result.index_ = 0; + return this; + } + } + static RichPresence() { + object.ReferenceEquals(global::bnet.protocol.presence.PresenceTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class FieldKey : pb::GeneratedMessage { - private static readonly FieldKey defaultInstance = new Builder().BuildPartial(); + private FieldKey() { } + private static readonly FieldKey defaultInstance = new FieldKey().MakeReadOnly(); + private static readonly string[] _fieldKeyFieldNames = new string[] { "field", "group", "index", "program" }; + private static readonly uint[] _fieldKeyFieldTags = new uint[] { 24, 16, 32, 8 }; public static FieldKey DefaultInstance { get { return defaultInstance; } } public override FieldKey DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override FieldKey ThisMessage { @@ -104,7 +485,7 @@ protected override FieldKey ThisMessage { public const int ProgramFieldNumber = 1; private bool hasProgram; - private uint program_ = 0; + private uint program_; public bool HasProgram { get { return hasProgram; } } @@ -114,7 +495,7 @@ public uint Program { public const int GroupFieldNumber = 2; private bool hasGroup; - private uint group_ = 0; + private uint group_; public bool HasGroup { get { return hasGroup; } } @@ -124,7 +505,7 @@ public uint Group { public const int FieldFieldNumber = 3; private bool hasField; - private uint field_ = 0; + private uint field_; public bool HasField { get { return hasField; } } @@ -134,7 +515,7 @@ public uint Field { public const int IndexFieldNumber = 4; private bool hasIndex; - private ulong index_ = 0UL; + private ulong index_; public bool HasIndex { get { return hasIndex; } } @@ -151,19 +532,20 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasProgram) { - output.WriteUInt32(1, Program); + string[] field_names = _fieldKeyFieldNames; + if (hasProgram) { + output.WriteUInt32(1, field_names[3], Program); } - if (HasGroup) { - output.WriteUInt32(2, Group); + if (hasGroup) { + output.WriteUInt32(2, field_names[1], Group); } - if (HasField) { - output.WriteUInt32(3, Field); + if (hasField) { + output.WriteUInt32(3, field_names[0], Field); } - if (HasIndex) { - output.WriteUInt64(4, Index); + if (hasIndex) { + output.WriteUInt64(4, field_names[2], Index); } UnknownFields.WriteTo(output); } @@ -175,16 +557,16 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasProgram) { + if (hasProgram) { size += pb::CodedOutputStream.ComputeUInt32Size(1, Program); } - if (HasGroup) { + if (hasGroup) { size += pb::CodedOutputStream.ComputeUInt32Size(2, Group); } - if (HasField) { + if (hasField) { size += pb::CodedOutputStream.ComputeUInt32Size(3, Field); } - if (HasIndex) { + if (hasIndex) { size += pb::CodedOutputStream.ComputeUInt64Size(4, Index); } size += UnknownFields.SerializedSize; @@ -217,38 +599,72 @@ public static FieldKey ParseDelimitedFrom(global::System.IO.Stream input) { public static FieldKey ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static FieldKey ParseFrom(pb::CodedInputStream input) { + public static FieldKey ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static FieldKey ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static FieldKey ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private FieldKey MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(FieldKey prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(FieldKey cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private FieldKey result; + + private FieldKey PrepareBuilder() { + if (resultIsReadOnly) { + FieldKey original = result; + result = new FieldKey(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - FieldKey result = new FieldKey(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override FieldKey MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new FieldKey(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -260,12 +676,11 @@ public override FieldKey DefaultInstanceForType { } public override FieldKey BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - FieldKey returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -279,6 +694,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(FieldKey other) { if (other == global::bnet.protocol.presence.FieldKey.DefaultInstance) return this; + PrepareBuilder(); if (other.HasProgram) { Program = other.Program; } @@ -295,20 +711,31 @@ public override Builder MergeFrom(FieldKey other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_fieldKeyFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _fieldKeyFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -320,97 +747,110 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 8: { - Program = input.ReadUInt32(); + result.hasProgram = input.ReadUInt32(ref result.program_); break; } case 16: { - Group = input.ReadUInt32(); + result.hasGroup = input.ReadUInt32(ref result.group_); break; } case 24: { - Field = input.ReadUInt32(); + result.hasField = input.ReadUInt32(ref result.field_); break; } case 32: { - Index = input.ReadUInt64(); + result.hasIndex = input.ReadUInt64(ref result.index_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasProgram { - get { return result.HasProgram; } + get { return result.hasProgram; } } public uint Program { get { return result.Program; } set { SetProgram(value); } } public Builder SetProgram(uint value) { + PrepareBuilder(); result.hasProgram = true; result.program_ = value; return this; } public Builder ClearProgram() { + PrepareBuilder(); result.hasProgram = false; result.program_ = 0; return this; } public bool HasGroup { - get { return result.HasGroup; } + get { return result.hasGroup; } } public uint Group { get { return result.Group; } set { SetGroup(value); } } public Builder SetGroup(uint value) { + PrepareBuilder(); result.hasGroup = true; result.group_ = value; return this; } public Builder ClearGroup() { + PrepareBuilder(); result.hasGroup = false; result.group_ = 0; return this; } public bool HasField { - get { return result.HasField; } + get { return result.hasField; } } public uint Field { get { return result.Field; } set { SetField(value); } } public Builder SetField(uint value) { + PrepareBuilder(); result.hasField = true; result.field_ = value; return this; } public Builder ClearField() { + PrepareBuilder(); result.hasField = false; result.field_ = 0; return this; } public bool HasIndex { - get { return result.HasIndex; } + get { return result.hasIndex; } } public ulong Index { get { return result.Index; } set { SetIndex(value); } } public Builder SetIndex(ulong value) { + PrepareBuilder(); result.hasIndex = true; result.index_ = value; return this; } public Builder ClearIndex() { + PrepareBuilder(); result.hasIndex = false; result.index_ = 0UL; return this; @@ -421,14 +861,20 @@ static FieldKey() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Field : pb::GeneratedMessage { - private static readonly Field defaultInstance = new Builder().BuildPartial(); + private Field() { } + private static readonly Field defaultInstance = new Field().MakeReadOnly(); + private static readonly string[] _fieldFieldNames = new string[] { "key", "value" }; + private static readonly uint[] _fieldFieldTags = new uint[] { 10, 18 }; public static Field DefaultInstance { get { return defaultInstance; } } public override Field DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override Field ThisMessage { @@ -445,22 +891,22 @@ protected override Field ThisMessage { public const int KeyFieldNumber = 1; private bool hasKey; - private global::bnet.protocol.presence.FieldKey key_ = global::bnet.protocol.presence.FieldKey.DefaultInstance; + private global::bnet.protocol.presence.FieldKey key_; public bool HasKey { get { return hasKey; } } public global::bnet.protocol.presence.FieldKey Key { - get { return key_; } + get { return key_ ?? global::bnet.protocol.presence.FieldKey.DefaultInstance; } } public const int ValueFieldNumber = 2; private bool hasValue; - private global::bnet.protocol.attribute.Variant value_ = global::bnet.protocol.attribute.Variant.DefaultInstance; + private global::bnet.protocol.attribute.Variant value_; public bool HasValue { get { return hasValue; } } public global::bnet.protocol.attribute.Variant Value { - get { return value_; } + get { return value_ ?? global::bnet.protocol.attribute.Variant.DefaultInstance; } } public override bool IsInitialized { @@ -468,17 +914,19 @@ public override bool IsInitialized { if (!hasKey) return false; if (!hasValue) return false; if (!Key.IsInitialized) return false; + if (!Value.IsInitialized) return false; return true; } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasKey) { - output.WriteMessage(1, Key); + string[] field_names = _fieldFieldNames; + if (hasKey) { + output.WriteMessage(1, field_names[0], Key); } - if (HasValue) { - output.WriteMessage(2, Value); + if (hasValue) { + output.WriteMessage(2, field_names[1], Value); } UnknownFields.WriteTo(output); } @@ -490,10 +938,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasKey) { + if (hasKey) { size += pb::CodedOutputStream.ComputeMessageSize(1, Key); } - if (HasValue) { + if (hasValue) { size += pb::CodedOutputStream.ComputeMessageSize(2, Value); } size += UnknownFields.SerializedSize; @@ -526,38 +974,72 @@ public static Field ParseDelimitedFrom(global::System.IO.Stream input) { public static Field ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static Field ParseFrom(pb::CodedInputStream input) { + public static Field ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Field ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static Field ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private Field MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(Field prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Field cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Field result; + + private Field PrepareBuilder() { + if (resultIsReadOnly) { + Field original = result; + result = new Field(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - Field result = new Field(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override Field MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new Field(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -569,12 +1051,11 @@ public override Field DefaultInstanceForType { } public override Field BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - Field returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -588,6 +1069,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Field other) { if (other == global::bnet.protocol.presence.Field.DefaultInstance) return this; + PrepareBuilder(); if (other.HasKey) { MergeKey(other.Key); } @@ -598,20 +1080,31 @@ public override Builder MergeFrom(Field other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_fieldFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _fieldFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -623,12 +1116,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.presence.FieldKey.Builder subBuilder = global::bnet.protocol.presence.FieldKey.CreateBuilder(); - if (HasKey) { + if (result.hasKey) { subBuilder.MergeFrom(Key); } input.ReadMessage(subBuilder, extensionRegistry); @@ -637,7 +1130,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.attribute.Variant.Builder subBuilder = global::bnet.protocol.attribute.Variant.CreateBuilder(); - if (HasValue) { + if (result.hasValue) { subBuilder.MergeFrom(Value); } input.ReadMessage(subBuilder, extensionRegistry); @@ -646,11 +1139,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasKey { - get { return result.HasKey; } + get { return result.hasKey; } } public global::bnet.protocol.presence.FieldKey Key { get { return result.Key; } @@ -658,19 +1156,22 @@ public bool HasKey { } public Builder SetKey(global::bnet.protocol.presence.FieldKey value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasKey = true; result.key_ = value; return this; } public Builder SetKey(global::bnet.protocol.presence.FieldKey.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasKey = true; result.key_ = builderForValue.Build(); return this; } public Builder MergeKey(global::bnet.protocol.presence.FieldKey value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasKey && + PrepareBuilder(); + if (result.hasKey && result.key_ != global::bnet.protocol.presence.FieldKey.DefaultInstance) { result.key_ = global::bnet.protocol.presence.FieldKey.CreateBuilder(result.key_).MergeFrom(value).BuildPartial(); } else { @@ -680,13 +1181,14 @@ public Builder MergeKey(global::bnet.protocol.presence.FieldKey value) { return this; } public Builder ClearKey() { + PrepareBuilder(); result.hasKey = false; - result.key_ = global::bnet.protocol.presence.FieldKey.DefaultInstance; + result.key_ = null; return this; } public bool HasValue { - get { return result.HasValue; } + get { return result.hasValue; } } public global::bnet.protocol.attribute.Variant Value { get { return result.Value; } @@ -694,19 +1196,22 @@ public bool HasValue { } public Builder SetValue(global::bnet.protocol.attribute.Variant value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasValue = true; result.value_ = value; return this; } public Builder SetValue(global::bnet.protocol.attribute.Variant.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasValue = true; result.value_ = builderForValue.Build(); return this; } public Builder MergeValue(global::bnet.protocol.attribute.Variant value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasValue && + PrepareBuilder(); + if (result.hasValue && result.value_ != global::bnet.protocol.attribute.Variant.DefaultInstance) { result.value_ = global::bnet.protocol.attribute.Variant.CreateBuilder(result.value_).MergeFrom(value).BuildPartial(); } else { @@ -716,8 +1221,9 @@ public Builder MergeValue(global::bnet.protocol.attribute.Variant value) { return this; } public Builder ClearValue() { + PrepareBuilder(); result.hasValue = false; - result.value_ = global::bnet.protocol.attribute.Variant.DefaultInstance; + result.value_ = null; return this; } } @@ -726,14 +1232,20 @@ static Field() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class FieldOperation : pb::GeneratedMessage { - private static readonly FieldOperation defaultInstance = new Builder().BuildPartial(); + private FieldOperation() { } + private static readonly FieldOperation defaultInstance = new FieldOperation().MakeReadOnly(); + private static readonly string[] _fieldOperationFieldNames = new string[] { "field", "operation" }; + private static readonly uint[] _fieldOperationFieldTags = new uint[] { 10, 16 }; public static FieldOperation DefaultInstance { get { return defaultInstance; } } public override FieldOperation DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override FieldOperation ThisMessage { @@ -749,7 +1261,12 @@ protected override FieldOperation ThisMessage { } #region Nested types + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public static class Types { + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public enum OperationType { SET = 0, CLEAR = 1, @@ -760,12 +1277,12 @@ public enum OperationType { public const int FieldFieldNumber = 1; private bool hasField; - private global::bnet.protocol.presence.Field field_ = global::bnet.protocol.presence.Field.DefaultInstance; + private global::bnet.protocol.presence.Field field_; public bool HasField { get { return hasField; } } public global::bnet.protocol.presence.Field Field { - get { return field_; } + get { return field_ ?? global::bnet.protocol.presence.Field.DefaultInstance; } } public const int OperationFieldNumber = 2; @@ -786,13 +1303,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasField) { - output.WriteMessage(1, Field); + string[] field_names = _fieldOperationFieldNames; + if (hasField) { + output.WriteMessage(1, field_names[0], Field); } - if (HasOperation) { - output.WriteEnum(2, (int) Operation); + if (hasOperation) { + output.WriteEnum(2, field_names[1], (int) Operation, Operation); } UnknownFields.WriteTo(output); } @@ -804,10 +1322,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasField) { + if (hasField) { size += pb::CodedOutputStream.ComputeMessageSize(1, Field); } - if (HasOperation) { + if (hasOperation) { size += pb::CodedOutputStream.ComputeEnumSize(2, (int) Operation); } size += UnknownFields.SerializedSize; @@ -840,38 +1358,72 @@ public static FieldOperation ParseDelimitedFrom(global::System.IO.Stream input) public static FieldOperation ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static FieldOperation ParseFrom(pb::CodedInputStream input) { + public static FieldOperation ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static FieldOperation ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static FieldOperation ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private FieldOperation MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(FieldOperation prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(FieldOperation cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private FieldOperation result; + + private FieldOperation PrepareBuilder() { + if (resultIsReadOnly) { + FieldOperation original = result; + result = new FieldOperation(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - FieldOperation result = new FieldOperation(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override FieldOperation MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new FieldOperation(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -883,12 +1435,11 @@ public override FieldOperation DefaultInstanceForType { } public override FieldOperation BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - FieldOperation returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -902,6 +1453,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(FieldOperation other) { if (other == global::bnet.protocol.presence.FieldOperation.DefaultInstance) return this; + PrepareBuilder(); if (other.HasField) { MergeField(other.Field); } @@ -912,20 +1464,31 @@ public override Builder MergeFrom(FieldOperation other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_fieldOperationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _fieldOperationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -937,12 +1500,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.presence.Field.Builder subBuilder = global::bnet.protocol.presence.Field.CreateBuilder(); - if (HasField) { + if (result.hasField) { subBuilder.MergeFrom(Field); } input.ReadMessage(subBuilder, extensionRegistry); @@ -950,24 +1513,29 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 16: { - int rawValue = input.ReadEnum(); - if (!global::System.Enum.IsDefined(typeof(global::bnet.protocol.presence.FieldOperation.Types.OperationType), rawValue)) { + object unknown; + if(input.ReadEnum(ref result.operation_, out unknown)) { + result.hasOperation = true; + } else if(unknown is int) { if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - unknownFields.MergeVarintField(2, (ulong) rawValue); - } else { - Operation = (global::bnet.protocol.presence.FieldOperation.Types.OperationType) rawValue; + unknownFields.MergeVarintField(2, (ulong)(int)unknown); } break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasField { - get { return result.HasField; } + get { return result.hasField; } } public global::bnet.protocol.presence.Field Field { get { return result.Field; } @@ -975,19 +1543,22 @@ public bool HasField { } public Builder SetField(global::bnet.protocol.presence.Field value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasField = true; result.field_ = value; return this; } public Builder SetField(global::bnet.protocol.presence.Field.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasField = true; result.field_ = builderForValue.Build(); return this; } public Builder MergeField(global::bnet.protocol.presence.Field value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasField && + PrepareBuilder(); + if (result.hasField && result.field_ != global::bnet.protocol.presence.Field.DefaultInstance) { result.field_ = global::bnet.protocol.presence.Field.CreateBuilder(result.field_).MergeFrom(value).BuildPartial(); } else { @@ -997,24 +1568,27 @@ public Builder MergeField(global::bnet.protocol.presence.Field value) { return this; } public Builder ClearField() { + PrepareBuilder(); result.hasField = false; - result.field_ = global::bnet.protocol.presence.Field.DefaultInstance; + result.field_ = null; return this; } public bool HasOperation { - get { return result.HasOperation; } + get { return result.hasOperation; } } public global::bnet.protocol.presence.FieldOperation.Types.OperationType Operation { get { return result.Operation; } set { SetOperation(value); } } public Builder SetOperation(global::bnet.protocol.presence.FieldOperation.Types.OperationType value) { + PrepareBuilder(); result.hasOperation = true; result.operation_ = value; return this; } public Builder ClearOperation() { + PrepareBuilder(); result.hasOperation = false; result.operation_ = global::bnet.protocol.presence.FieldOperation.Types.OperationType.SET; return this; @@ -1025,14 +1599,20 @@ static FieldOperation() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class ChannelState : pb::GeneratedMessage { - private static readonly ChannelState defaultInstance = new Builder().BuildPartial(); + private ChannelState() { } + private static readonly ChannelState defaultInstance = new ChannelState().MakeReadOnly(); + private static readonly string[] _channelStateFieldNames = new string[] { "entity_id", "field_operation", "healing" }; + private static readonly uint[] _channelStateFieldTags = new uint[] { 10, 18, 24 }; public static ChannelState DefaultInstance { get { return defaultInstance; } } public override ChannelState DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ChannelState ThisMessage { @@ -1051,12 +1631,12 @@ protected override ChannelState ThisMessage { public static pb::GeneratedExtensionBase Presence; public const int EntityIdFieldNumber = 1; private bool hasEntityId; - private global::bnet.protocol.EntityId entityId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId entityId_; public bool HasEntityId { get { return hasEntityId; } } public global::bnet.protocol.EntityId EntityId { - get { return entityId_; } + get { return entityId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int FieldOperationFieldNumber = 2; @@ -1071,6 +1651,16 @@ public int FieldOperationCount { return fieldOperation_[index]; } + public const int HealingFieldNumber = 3; + private bool hasHealing; + private bool healing_; + public bool HasHealing { + get { return hasHealing; } + } + public bool Healing { + get { return healing_; } + } + public override bool IsInitialized { get { if (HasEntityId) { @@ -1083,13 +1673,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasEntityId) { - output.WriteMessage(1, EntityId); + string[] field_names = _channelStateFieldNames; + if (hasEntityId) { + output.WriteMessage(1, field_names[0], EntityId); + } + if (fieldOperation_.Count > 0) { + output.WriteMessageArray(2, field_names[1], fieldOperation_); } - foreach (global::bnet.protocol.presence.FieldOperation element in FieldOperationList) { - output.WriteMessage(2, element); + if (hasHealing) { + output.WriteBool(3, field_names[2], Healing); } UnknownFields.WriteTo(output); } @@ -1101,12 +1695,15 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasEntityId) { + if (hasEntityId) { size += pb::CodedOutputStream.ComputeMessageSize(1, EntityId); } foreach (global::bnet.protocol.presence.FieldOperation element in FieldOperationList) { size += pb::CodedOutputStream.ComputeMessageSize(2, element); } + if (hasHealing) { + size += pb::CodedOutputStream.ComputeBoolSize(3, Healing); + } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; return size; @@ -1137,38 +1734,73 @@ public static ChannelState ParseDelimitedFrom(global::System.IO.Stream input) { public static ChannelState ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static ChannelState ParseFrom(pb::CodedInputStream input) { + public static ChannelState ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ChannelState ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static ChannelState ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private ChannelState MakeReadOnly() { + fieldOperation_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(ChannelState prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ChannelState cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - ChannelState result = new ChannelState(); + private bool resultIsReadOnly; + private ChannelState result; + + private ChannelState PrepareBuilder() { + if (resultIsReadOnly) { + ChannelState original = result; + result = new ChannelState(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override ChannelState MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ChannelState(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -1180,13 +1812,11 @@ public override ChannelState DefaultInstanceForType { } public override ChannelState BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.fieldOperation_.MakeReadOnly(); - ChannelState returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1200,30 +1830,45 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(ChannelState other) { if (other == global::bnet.protocol.presence.ChannelState.DefaultInstance) return this; + PrepareBuilder(); if (other.HasEntityId) { MergeEntityId(other.EntityId); } if (other.fieldOperation_.Count != 0) { - base.AddRange(other.fieldOperation_, result.fieldOperation_); + result.fieldOperation_.Add(other.fieldOperation_); + } + if (other.HasHealing) { + Healing = other.Healing; } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_channelStateFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _channelStateFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1235,12 +1880,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasEntityId) { + if (result.hasEntityId) { subBuilder.MergeFrom(EntityId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1248,18 +1893,25 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 18: { - global::bnet.protocol.presence.FieldOperation.Builder subBuilder = global::bnet.protocol.presence.FieldOperation.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddFieldOperation(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.fieldOperation_, global::bnet.protocol.presence.FieldOperation.DefaultInstance, extensionRegistry); + break; + } + case 24: { + result.hasHealing = input.ReadBool(ref result.healing_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasEntityId { - get { return result.HasEntityId; } + get { return result.hasEntityId; } } public global::bnet.protocol.EntityId EntityId { get { return result.EntityId; } @@ -1267,19 +1919,22 @@ public bool HasEntityId { } public Builder SetEntityId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasEntityId = true; result.entityId_ = value; return this; } public Builder SetEntityId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasEntityId = true; result.entityId_ = builderForValue.Build(); return this; } public Builder MergeEntityId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasEntityId && + PrepareBuilder(); + if (result.hasEntityId && result.entityId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.entityId_ = global::bnet.protocol.EntityId.CreateBuilder(result.entityId_).MergeFrom(value).BuildPartial(); } else { @@ -1289,13 +1944,14 @@ public Builder MergeEntityId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearEntityId() { + PrepareBuilder(); result.hasEntityId = false; - result.entityId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.entityId_ = null; return this; } public pbc::IPopsicleList FieldOperationList { - get { return result.fieldOperation_; } + get { return PrepareBuilder().fieldOperation_; } } public int FieldOperationCount { get { return result.FieldOperationCount; } @@ -1305,32 +1961,58 @@ public int FieldOperationCount { } public Builder SetFieldOperation(int index, global::bnet.protocol.presence.FieldOperation value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.fieldOperation_[index] = value; return this; } public Builder SetFieldOperation(int index, global::bnet.protocol.presence.FieldOperation.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.fieldOperation_[index] = builderForValue.Build(); return this; } public Builder AddFieldOperation(global::bnet.protocol.presence.FieldOperation value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.fieldOperation_.Add(value); return this; } public Builder AddFieldOperation(global::bnet.protocol.presence.FieldOperation.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.fieldOperation_.Add(builderForValue.Build()); return this; } public Builder AddRangeFieldOperation(scg::IEnumerable values) { - base.AddRange(values, result.fieldOperation_); + PrepareBuilder(); + result.fieldOperation_.Add(values); return this; } public Builder ClearFieldOperation() { + PrepareBuilder(); result.fieldOperation_.Clear(); return this; } + + public bool HasHealing { + get { return result.hasHealing; } + } + public bool Healing { + get { return result.Healing; } + set { SetHealing(value); } + } + public Builder SetHealing(bool value) { + PrepareBuilder(); + result.hasHealing = true; + result.healing_ = value; + return this; + } + public Builder ClearHealing() { + PrepareBuilder(); + result.hasHealing = false; + result.healing_ = false; + return this; + } } static ChannelState() { object.ReferenceEquals(global::bnet.protocol.presence.PresenceTypes.Descriptor, null); @@ -1340,3 +2022,5 @@ static ChannelState() { #endregion } + +#endregion Designer generated code diff --git a/source/D3Proto/bnet/protocol/profanity/Profanity.cs b/src/LibMooNet/bnet/protocol/profanity/Profanity.cs similarity index 67% rename from source/D3Proto/bnet/protocol/profanity/Profanity.cs rename to src/LibMooNet/bnet/protocol/profanity/Profanity.cs index 4bcae78c..364e12d9 100644 --- a/source/D3Proto/bnet/protocol/profanity/Profanity.cs +++ b/src/LibMooNet/bnet/protocol/profanity/Profanity.cs @@ -1,4 +1,6 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code using pb = global::Google.ProtocolBuffers; using pbc = global::Google.ProtocolBuffers.Collections; @@ -6,6 +8,9 @@ using scg = global::System.Collections.Generic; namespace bnet.protocol.profanity { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public static partial class Profanity { #region Extension registration @@ -26,10 +31,10 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { static Profanity() { byte[] descriptorData = global::System.Convert.FromBase64String( - "Ch1saWIvcHJvZmFuaXR5L3Byb2Zhbml0eS5wcm90bxIXYm5ldC5wcm90b2Nv" + - "bC5wcm9mYW5pdHkiKQoKV29yZEZpbHRlchIMCgR0eXBlGAEgAigJEg0KBXJl" + - "Z2V4GAIgAigJIkMKC1dvcmRGaWx0ZXJzEjQKB2ZpbHRlcnMYASADKAsyIy5i" + - "bmV0LnByb3RvY29sLnByb2Zhbml0eS5Xb3JkRmlsdGVy"); + "ChRibmV0L3Byb2Zhbml0eS5wcm90bxIXYm5ldC5wcm90b2NvbC5wcm9mYW5p" + + "dHkiKQoKV29yZEZpbHRlchIMCgR0eXBlGAEgAigJEg0KBXJlZ2V4GAIgAigJ" + + "IkMKC1dvcmRGaWx0ZXJzEjQKB2ZpbHRlcnMYASADKAsyIy5ibmV0LnByb3Rv" + + "Y29sLnByb2Zhbml0eS5Xb3JkRmlsdGVy"); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_bnet_protocol_profanity_WordFilter__Descriptor = Descriptor.MessageTypes[0]; @@ -50,14 +55,20 @@ static Profanity() { } #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class WordFilter : pb::GeneratedMessage { - private static readonly WordFilter defaultInstance = new Builder().BuildPartial(); + private WordFilter() { } + private static readonly WordFilter defaultInstance = new WordFilter().MakeReadOnly(); + private static readonly string[] _wordFilterFieldNames = new string[] { "regex", "type" }; + private static readonly uint[] _wordFilterFieldTags = new uint[] { 18, 10 }; public static WordFilter DefaultInstance { get { return defaultInstance; } } public override WordFilter DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override WordFilter ThisMessage { @@ -100,13 +111,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasType) { - output.WriteString(1, Type); + string[] field_names = _wordFilterFieldNames; + if (hasType) { + output.WriteString(1, field_names[1], Type); } - if (HasRegex) { - output.WriteString(2, Regex); + if (hasRegex) { + output.WriteString(2, field_names[0], Regex); } UnknownFields.WriteTo(output); } @@ -118,10 +130,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasType) { + if (hasType) { size += pb::CodedOutputStream.ComputeStringSize(1, Type); } - if (HasRegex) { + if (hasRegex) { size += pb::CodedOutputStream.ComputeStringSize(2, Regex); } size += UnknownFields.SerializedSize; @@ -154,38 +166,72 @@ public static WordFilter ParseDelimitedFrom(global::System.IO.Stream input) { public static WordFilter ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static WordFilter ParseFrom(pb::CodedInputStream input) { + public static WordFilter ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static WordFilter ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static WordFilter ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private WordFilter MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(WordFilter prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(WordFilter cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - WordFilter result = new WordFilter(); + private bool resultIsReadOnly; + private WordFilter result; + + private WordFilter PrepareBuilder() { + if (resultIsReadOnly) { + WordFilter original = result; + result = new WordFilter(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override WordFilter MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new WordFilter(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -197,12 +243,11 @@ public override WordFilter DefaultInstanceForType { } public override WordFilter BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - WordFilter returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -216,6 +261,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(WordFilter other) { if (other == global::bnet.protocol.profanity.WordFilter.DefaultInstance) return this; + PrepareBuilder(); if (other.HasType) { Type = other.Type; } @@ -226,20 +272,31 @@ public override Builder MergeFrom(WordFilter other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_wordFilterFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _wordFilterFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -251,24 +308,29 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { - Type = input.ReadString(); + result.hasType = input.ReadString(ref result.type_); break; } case 18: { - Regex = input.ReadString(); + result.hasRegex = input.ReadString(ref result.regex_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasType { - get { return result.HasType; } + get { return result.hasType; } } public string Type { get { return result.Type; } @@ -276,18 +338,20 @@ public string Type { } public Builder SetType(string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasType = true; result.type_ = value; return this; } public Builder ClearType() { + PrepareBuilder(); result.hasType = false; result.type_ = ""; return this; } public bool HasRegex { - get { return result.HasRegex; } + get { return result.hasRegex; } } public string Regex { get { return result.Regex; } @@ -295,11 +359,13 @@ public string Regex { } public Builder SetRegex(string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasRegex = true; result.regex_ = value; return this; } public Builder ClearRegex() { + PrepareBuilder(); result.hasRegex = false; result.regex_ = ""; return this; @@ -310,14 +376,20 @@ static WordFilter() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class WordFilters : pb::GeneratedMessage { - private static readonly WordFilters defaultInstance = new Builder().BuildPartial(); + private WordFilters() { } + private static readonly WordFilters defaultInstance = new WordFilters().MakeReadOnly(); + private static readonly string[] _wordFiltersFieldNames = new string[] { "filters" }; + private static readonly uint[] _wordFiltersFieldTags = new uint[] { 10 }; public static WordFilters DefaultInstance { get { return defaultInstance; } } public override WordFilters DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override WordFilters ThisMessage { @@ -353,10 +425,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - foreach (global::bnet.protocol.profanity.WordFilter element in FiltersList) { - output.WriteMessage(1, element); + string[] field_names = _wordFiltersFieldNames; + if (filters_.Count > 0) { + output.WriteMessageArray(1, field_names[0], filters_); } UnknownFields.WriteTo(output); } @@ -401,38 +474,73 @@ public static WordFilters ParseDelimitedFrom(global::System.IO.Stream input) { public static WordFilters ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static WordFilters ParseFrom(pb::CodedInputStream input) { + public static WordFilters ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static WordFilters ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static WordFilters ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private WordFilters MakeReadOnly() { + filters_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(WordFilters prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(WordFilters cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - WordFilters result = new WordFilters(); + private bool resultIsReadOnly; + private WordFilters result; + + private WordFilters PrepareBuilder() { + if (resultIsReadOnly) { + WordFilters original = result; + result = new WordFilters(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override WordFilters MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new WordFilters(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -444,13 +552,11 @@ public override WordFilters DefaultInstanceForType { } public override WordFilters BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.filters_.MakeReadOnly(); - WordFilters returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -464,27 +570,39 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(WordFilters other) { if (other == global::bnet.protocol.profanity.WordFilters.DefaultInstance) return this; + PrepareBuilder(); if (other.filters_.Count != 0) { - base.AddRange(other.filters_, result.filters_); + result.filters_.Add(other.filters_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_wordFiltersFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _wordFiltersFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -496,22 +614,25 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { - global::bnet.protocol.profanity.WordFilter.Builder subBuilder = global::bnet.protocol.profanity.WordFilter.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddFilters(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.filters_, global::bnet.protocol.profanity.WordFilter.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public pbc::IPopsicleList FiltersList { - get { return result.filters_; } + get { return PrepareBuilder().filters_; } } public int FiltersCount { get { return result.FiltersCount; } @@ -521,29 +642,35 @@ public int FiltersCount { } public Builder SetFilters(int index, global::bnet.protocol.profanity.WordFilter value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.filters_[index] = value; return this; } public Builder SetFilters(int index, global::bnet.protocol.profanity.WordFilter.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.filters_[index] = builderForValue.Build(); return this; } public Builder AddFilters(global::bnet.protocol.profanity.WordFilter value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.filters_.Add(value); return this; } public Builder AddFilters(global::bnet.protocol.profanity.WordFilter.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.filters_.Add(builderForValue.Build()); return this; } public Builder AddRangeFilters(scg::IEnumerable values) { - base.AddRange(values, result.filters_); + PrepareBuilder(); + result.filters_.Add(values); return this; } public Builder ClearFilters() { + PrepareBuilder(); result.filters_.Clear(); return this; } @@ -556,3 +683,5 @@ static WordFilters() { #endregion } + +#endregion Designer generated code diff --git a/src/LibMooNet/bnet/protocol/report/ReportService.cs b/src/LibMooNet/bnet/protocol/report/ReportService.cs new file mode 100644 index 00000000..bfe969db --- /dev/null +++ b/src/LibMooNet/bnet/protocol/report/ReportService.cs @@ -0,0 +1,1052 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace bnet.protocol.report { + + namespace Proto { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class ReportService { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_bnet_protocol_report_Report__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_report_Report__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_report_SendReportRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_report_SendReportRequest__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static ReportService() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "ChlibmV0L3JlcG9ydF9zZXJ2aWNlLnByb3RvEhRibmV0LnByb3RvY29sLnJl" + + "cG9ydBoUYm5ldC9hdHRyaWJ1dGUucHJvdG8aEWJuZXQvZW50aXR5LnByb3Rv" + + "Gg5ibmV0L3JwYy5wcm90byLyAQoGUmVwb3J0EhMKC3JlcG9ydF90eXBlGAEg" + + "AigJEjUKCWF0dHJpYnV0ZRgCIAMoCzIiLmJuZXQucHJvdG9jb2wuYXR0cmli" + + "dXRlLkF0dHJpYnV0ZRIVCgpyZXBvcnRfcW9zGAMgASgFOgEwEjIKEXJlcG9y" + + "dGluZ19hY2NvdW50GAQgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBI3" + + "ChZyZXBvcnRpbmdfZ2FtZV9hY2NvdW50GAUgASgLMhcuYm5ldC5wcm90b2Nv" + + "bC5FbnRpdHlJZBIYChByZXBvcnRfdGltZXN0YW1wGAYgASgGIkEKEVNlbmRS" + + "ZXBvcnRSZXF1ZXN0EiwKBnJlcG9ydBgBIAIoCzIcLmJuZXQucHJvdG9jb2wu" + + "cmVwb3J0LlJlcG9ydDJjCg1SZXBvcnRTZXJ2aWNlElIKClNlbmRSZXBvcnQS" + + "Jy5ibmV0LnByb3RvY29sLnJlcG9ydC5TZW5kUmVwb3J0UmVxdWVzdBoVLmJu" + + "ZXQucHJvdG9jb2wuTm9EYXRhIgSAtRgBQgOAAQA="); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_bnet_protocol_report_Report__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_report_Report__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_report_Report__Descriptor, + new string[] { "ReportType", "Attribute", "ReportQos", "ReportingAccount", "ReportingGameAccount", "ReportTimestamp", }); + internal__static_bnet_protocol_report_SendReportRequest__Descriptor = Descriptor.MessageTypes[1]; + internal__static_bnet_protocol_report_SendReportRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_report_SendReportRequest__Descriptor, + new string[] { "Report", }); + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + RegisterAllExtensions(registry); + global::bnet.protocol.attribute.Proto.Attribute.RegisterAllExtensions(registry); + global::bnet.protocol.Entity.RegisterAllExtensions(registry); + global::bnet.protocol.Rpc.RegisterAllExtensions(registry); + return registry; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::bnet.protocol.attribute.Proto.Attribute.Descriptor, + global::bnet.protocol.Entity.Descriptor, + global::bnet.protocol.Rpc.Descriptor, + }, assigner); + } + #endregion + + } + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Report : pb::GeneratedMessage { + private Report() { } + private static readonly Report defaultInstance = new Report().MakeReadOnly(); + private static readonly string[] _reportFieldNames = new string[] { "attribute", "report_qos", "report_timestamp", "report_type", "reporting_account", "reporting_game_account" }; + private static readonly uint[] _reportFieldTags = new uint[] { 18, 24, 49, 10, 34, 42 }; + public static Report DefaultInstance { + get { return defaultInstance; } + } + + public override Report DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Report ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.report.Proto.ReportService.internal__static_bnet_protocol_report_Report__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.report.Proto.ReportService.internal__static_bnet_protocol_report_Report__FieldAccessorTable; } + } + + public const int ReportTypeFieldNumber = 1; + private bool hasReportType; + private string reportType_ = ""; + public bool HasReportType { + get { return hasReportType; } + } + public string ReportType { + get { return reportType_; } + } + + public const int AttributeFieldNumber = 2; + private pbc::PopsicleList attribute_ = new pbc::PopsicleList(); + public scg::IList AttributeList { + get { return attribute_; } + } + public int AttributeCount { + get { return attribute_.Count; } + } + public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { + return attribute_[index]; + } + + public const int ReportQosFieldNumber = 3; + private bool hasReportQos; + private int reportQos_; + public bool HasReportQos { + get { return hasReportQos; } + } + public int ReportQos { + get { return reportQos_; } + } + + public const int ReportingAccountFieldNumber = 4; + private bool hasReportingAccount; + private global::bnet.protocol.EntityId reportingAccount_; + public bool HasReportingAccount { + get { return hasReportingAccount; } + } + public global::bnet.protocol.EntityId ReportingAccount { + get { return reportingAccount_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int ReportingGameAccountFieldNumber = 5; + private bool hasReportingGameAccount; + private global::bnet.protocol.EntityId reportingGameAccount_; + public bool HasReportingGameAccount { + get { return hasReportingGameAccount; } + } + public global::bnet.protocol.EntityId ReportingGameAccount { + get { return reportingGameAccount_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int ReportTimestampFieldNumber = 6; + private bool hasReportTimestamp; + private ulong reportTimestamp_; + public bool HasReportTimestamp { + get { return hasReportTimestamp; } + } + public ulong ReportTimestamp { + get { return reportTimestamp_; } + } + + public override bool IsInitialized { + get { + if (!hasReportType) return false; + foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { + if (!element.IsInitialized) return false; + } + if (HasReportingAccount) { + if (!ReportingAccount.IsInitialized) return false; + } + if (HasReportingGameAccount) { + if (!ReportingGameAccount.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _reportFieldNames; + if (hasReportType) { + output.WriteString(1, field_names[3], ReportType); + } + if (attribute_.Count > 0) { + output.WriteMessageArray(2, field_names[0], attribute_); + } + if (hasReportQos) { + output.WriteInt32(3, field_names[1], ReportQos); + } + if (hasReportingAccount) { + output.WriteMessage(4, field_names[4], ReportingAccount); + } + if (hasReportingGameAccount) { + output.WriteMessage(5, field_names[5], ReportingGameAccount); + } + if (hasReportTimestamp) { + output.WriteFixed64(6, field_names[2], ReportTimestamp); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasReportType) { + size += pb::CodedOutputStream.ComputeStringSize(1, ReportType); + } + foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { + size += pb::CodedOutputStream.ComputeMessageSize(2, element); + } + if (hasReportQos) { + size += pb::CodedOutputStream.ComputeInt32Size(3, ReportQos); + } + if (hasReportingAccount) { + size += pb::CodedOutputStream.ComputeMessageSize(4, ReportingAccount); + } + if (hasReportingGameAccount) { + size += pb::CodedOutputStream.ComputeMessageSize(5, ReportingGameAccount); + } + if (hasReportTimestamp) { + size += pb::CodedOutputStream.ComputeFixed64Size(6, ReportTimestamp); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static Report ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Report ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Report ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Report ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Report ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Report ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Report ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Report ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Report ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Report ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Report MakeReadOnly() { + attribute_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Report prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Report cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Report result; + + private Report PrepareBuilder() { + if (resultIsReadOnly) { + Report original = result; + result = new Report(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Report MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.report.Report.Descriptor; } + } + + public override Report DefaultInstanceForType { + get { return global::bnet.protocol.report.Report.DefaultInstance; } + } + + public override Report BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Report) { + return MergeFrom((Report) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Report other) { + if (other == global::bnet.protocol.report.Report.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasReportType) { + ReportType = other.ReportType; + } + if (other.attribute_.Count != 0) { + result.attribute_.Add(other.attribute_); + } + if (other.HasReportQos) { + ReportQos = other.ReportQos; + } + if (other.HasReportingAccount) { + MergeReportingAccount(other.ReportingAccount); + } + if (other.HasReportingGameAccount) { + MergeReportingGameAccount(other.ReportingGameAccount); + } + if (other.HasReportTimestamp) { + ReportTimestamp = other.ReportTimestamp; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_reportFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _reportFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasReportType = input.ReadString(ref result.reportType_); + break; + } + case 18: { + input.ReadMessageArray(tag, field_name, result.attribute_, global::bnet.protocol.attribute.Attribute.DefaultInstance, extensionRegistry); + break; + } + case 24: { + result.hasReportQos = input.ReadInt32(ref result.reportQos_); + break; + } + case 34: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasReportingAccount) { + subBuilder.MergeFrom(ReportingAccount); + } + input.ReadMessage(subBuilder, extensionRegistry); + ReportingAccount = subBuilder.BuildPartial(); + break; + } + case 42: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasReportingGameAccount) { + subBuilder.MergeFrom(ReportingGameAccount); + } + input.ReadMessage(subBuilder, extensionRegistry); + ReportingGameAccount = subBuilder.BuildPartial(); + break; + } + case 49: { + result.hasReportTimestamp = input.ReadFixed64(ref result.reportTimestamp_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasReportType { + get { return result.hasReportType; } + } + public string ReportType { + get { return result.ReportType; } + set { SetReportType(value); } + } + public Builder SetReportType(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasReportType = true; + result.reportType_ = value; + return this; + } + public Builder ClearReportType() { + PrepareBuilder(); + result.hasReportType = false; + result.reportType_ = ""; + return this; + } + + public pbc::IPopsicleList AttributeList { + get { return PrepareBuilder().attribute_; } + } + public int AttributeCount { + get { return result.AttributeCount; } + } + public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { + return result.GetAttribute(index); + } + public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.attribute_[index] = value; + return this; + } + public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.attribute_[index] = builderForValue.Build(); + return this; + } + public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.attribute_.Add(value); + return this; + } + public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.attribute_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeAttribute(scg::IEnumerable values) { + PrepareBuilder(); + result.attribute_.Add(values); + return this; + } + public Builder ClearAttribute() { + PrepareBuilder(); + result.attribute_.Clear(); + return this; + } + + public bool HasReportQos { + get { return result.hasReportQos; } + } + public int ReportQos { + get { return result.ReportQos; } + set { SetReportQos(value); } + } + public Builder SetReportQos(int value) { + PrepareBuilder(); + result.hasReportQos = true; + result.reportQos_ = value; + return this; + } + public Builder ClearReportQos() { + PrepareBuilder(); + result.hasReportQos = false; + result.reportQos_ = 0; + return this; + } + + public bool HasReportingAccount { + get { return result.hasReportingAccount; } + } + public global::bnet.protocol.EntityId ReportingAccount { + get { return result.ReportingAccount; } + set { SetReportingAccount(value); } + } + public Builder SetReportingAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasReportingAccount = true; + result.reportingAccount_ = value; + return this; + } + public Builder SetReportingAccount(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasReportingAccount = true; + result.reportingAccount_ = builderForValue.Build(); + return this; + } + public Builder MergeReportingAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasReportingAccount && + result.reportingAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.reportingAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.reportingAccount_).MergeFrom(value).BuildPartial(); + } else { + result.reportingAccount_ = value; + } + result.hasReportingAccount = true; + return this; + } + public Builder ClearReportingAccount() { + PrepareBuilder(); + result.hasReportingAccount = false; + result.reportingAccount_ = null; + return this; + } + + public bool HasReportingGameAccount { + get { return result.hasReportingGameAccount; } + } + public global::bnet.protocol.EntityId ReportingGameAccount { + get { return result.ReportingGameAccount; } + set { SetReportingGameAccount(value); } + } + public Builder SetReportingGameAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasReportingGameAccount = true; + result.reportingGameAccount_ = value; + return this; + } + public Builder SetReportingGameAccount(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasReportingGameAccount = true; + result.reportingGameAccount_ = builderForValue.Build(); + return this; + } + public Builder MergeReportingGameAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasReportingGameAccount && + result.reportingGameAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.reportingGameAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.reportingGameAccount_).MergeFrom(value).BuildPartial(); + } else { + result.reportingGameAccount_ = value; + } + result.hasReportingGameAccount = true; + return this; + } + public Builder ClearReportingGameAccount() { + PrepareBuilder(); + result.hasReportingGameAccount = false; + result.reportingGameAccount_ = null; + return this; + } + + public bool HasReportTimestamp { + get { return result.hasReportTimestamp; } + } + public ulong ReportTimestamp { + get { return result.ReportTimestamp; } + set { SetReportTimestamp(value); } + } + public Builder SetReportTimestamp(ulong value) { + PrepareBuilder(); + result.hasReportTimestamp = true; + result.reportTimestamp_ = value; + return this; + } + public Builder ClearReportTimestamp() { + PrepareBuilder(); + result.hasReportTimestamp = false; + result.reportTimestamp_ = 0; + return this; + } + } + static Report() { + object.ReferenceEquals(global::bnet.protocol.report.Proto.ReportService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class SendReportRequest : pb::GeneratedMessage { + private SendReportRequest() { } + private static readonly SendReportRequest defaultInstance = new SendReportRequest().MakeReadOnly(); + private static readonly string[] _sendReportRequestFieldNames = new string[] { "report" }; + private static readonly uint[] _sendReportRequestFieldTags = new uint[] { 10 }; + public static SendReportRequest DefaultInstance { + get { return defaultInstance; } + } + + public override SendReportRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SendReportRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.report.Proto.ReportService.internal__static_bnet_protocol_report_SendReportRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.report.Proto.ReportService.internal__static_bnet_protocol_report_SendReportRequest__FieldAccessorTable; } + } + + public const int ReportFieldNumber = 1; + private bool hasReport; + private global::bnet.protocol.report.Report report_; + public bool HasReport { + get { return hasReport; } + } + public global::bnet.protocol.report.Report Report { + get { return report_ ?? global::bnet.protocol.report.Report.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasReport) return false; + if (!Report.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _sendReportRequestFieldNames; + if (hasReport) { + output.WriteMessage(1, field_names[0], Report); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasReport) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Report); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static SendReportRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SendReportRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SendReportRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SendReportRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SendReportRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SendReportRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SendReportRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SendReportRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SendReportRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SendReportRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SendReportRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SendReportRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SendReportRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SendReportRequest result; + + private SendReportRequest PrepareBuilder() { + if (resultIsReadOnly) { + SendReportRequest original = result; + result = new SendReportRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SendReportRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.report.SendReportRequest.Descriptor; } + } + + public override SendReportRequest DefaultInstanceForType { + get { return global::bnet.protocol.report.SendReportRequest.DefaultInstance; } + } + + public override SendReportRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SendReportRequest) { + return MergeFrom((SendReportRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SendReportRequest other) { + if (other == global::bnet.protocol.report.SendReportRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasReport) { + MergeReport(other.Report); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_sendReportRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _sendReportRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.report.Report.Builder subBuilder = global::bnet.protocol.report.Report.CreateBuilder(); + if (result.hasReport) { + subBuilder.MergeFrom(Report); + } + input.ReadMessage(subBuilder, extensionRegistry); + Report = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasReport { + get { return result.hasReport; } + } + public global::bnet.protocol.report.Report Report { + get { return result.Report; } + set { SetReport(value); } + } + public Builder SetReport(global::bnet.protocol.report.Report value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasReport = true; + result.report_ = value; + return this; + } + public Builder SetReport(global::bnet.protocol.report.Report.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasReport = true; + result.report_ = builderForValue.Build(); + return this; + } + public Builder MergeReport(global::bnet.protocol.report.Report value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasReport && + result.report_ != global::bnet.protocol.report.Report.DefaultInstance) { + result.report_ = global::bnet.protocol.report.Report.CreateBuilder(result.report_).MergeFrom(value).BuildPartial(); + } else { + result.report_ = value; + } + result.hasReport = true; + return this; + } + public Builder ClearReport() { + PrepareBuilder(); + result.hasReport = false; + result.report_ = null; + return this; + } + } + static SendReportRequest() { + object.ReferenceEquals(global::bnet.protocol.report.Proto.ReportService.Descriptor, null); + } + } + + #endregion + + #region Services + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public abstract class ReportService : pb::IService { + public abstract void SendReport( + pb::IRpcController controller, + global::bnet.protocol.report.SendReportRequest request, + global::System.Action done); + + public static pbd::ServiceDescriptor Descriptor { + get { return Proto.ReportService.Descriptor.Services[0]; } + } + public pbd::ServiceDescriptor DescriptorForType { + get { return Descriptor; } + } + + public void CallMethod( + pbd::MethodDescriptor method, + pb::IRpcController controller, + pb::IMessage request, + global::System.Action done) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.CallMethod() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + this.SendReport(controller, (global::bnet.protocol.report.SendReportRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetRequestPrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.report.SendReportRequest.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetResponsePrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.NoData.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public static Stub CreateStub(pb::IRpcChannel channel) { + return new Stub(channel); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public class Stub : global::bnet.protocol.report.ReportService { + internal Stub(pb::IRpcChannel channel) { + this.channel = channel; + } + + private readonly pb::IRpcChannel channel; + + public pb::IRpcChannel Channel { + get { return channel; } + } + + public override void SendReport( + pb::IRpcController controller, + global::bnet.protocol.report.SendReportRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[0], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + } + } + #endregion + +} + +#endregion Designer generated code diff --git a/src/LibMooNet/bnet/protocol/resources/ResourceService.cs b/src/LibMooNet/bnet/protocol/resources/ResourceService.cs new file mode 100644 index 00000000..37f474f8 --- /dev/null +++ b/src/LibMooNet/bnet/protocol/resources/ResourceService.cs @@ -0,0 +1,520 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace bnet.protocol.resources { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class ResourceService { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_bnet_protocol_resources_ContentHandleRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_resources_ContentHandleRequest__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static ResourceService() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "ChtibmV0L3Jlc291cmNlX3NlcnZpY2UucHJvdG8SF2JuZXQucHJvdG9jb2wu" + + "cmVzb3VyY2VzGhlibmV0L2NvbnRlbnRfaGFuZGxlLnByb3RvGg5ibmV0L3Jw" + + "Yy5wcm90byJZChRDb250ZW50SGFuZGxlUmVxdWVzdBISCgpwcm9ncmFtX2lk" + + "GAEgAigHEhEKCXN0cmVhbV9pZBgCIAIoBxIaCgZsb2NhbGUYAyABKAc6CjE3" + + "MDE3Mjk2MTkycgoJUmVzb3VyY2VzEmUKEEdldENvbnRlbnRIYW5kbGUSLS5i" + + "bmV0LnByb3RvY29sLnJlc291cmNlcy5Db250ZW50SGFuZGxlUmVxdWVzdBoc" + + "LmJuZXQucHJvdG9jb2wuQ29udGVudEhhbmRsZSIEgLUYAUIDgAEA"); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_bnet_protocol_resources_ContentHandleRequest__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_resources_ContentHandleRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_resources_ContentHandleRequest__Descriptor, + new string[] { "ProgramId", "StreamId", "Locale", }); + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + RegisterAllExtensions(registry); + global::bnet.protocol.Proto.ContentHandle.RegisterAllExtensions(registry); + global::bnet.protocol.Rpc.RegisterAllExtensions(registry); + return registry; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::bnet.protocol.Proto.ContentHandle.Descriptor, + global::bnet.protocol.Rpc.Descriptor, + }, assigner); + } + #endregion + + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ContentHandleRequest : pb::GeneratedMessage { + private ContentHandleRequest() { } + private static readonly ContentHandleRequest defaultInstance = new ContentHandleRequest().MakeReadOnly(); + private static readonly string[] _contentHandleRequestFieldNames = new string[] { "locale", "program_id", "stream_id" }; + private static readonly uint[] _contentHandleRequestFieldTags = new uint[] { 29, 13, 21 }; + public static ContentHandleRequest DefaultInstance { + get { return defaultInstance; } + } + + public override ContentHandleRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ContentHandleRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.resources.ResourceService.internal__static_bnet_protocol_resources_ContentHandleRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.resources.ResourceService.internal__static_bnet_protocol_resources_ContentHandleRequest__FieldAccessorTable; } + } + + public const int ProgramIdFieldNumber = 1; + private bool hasProgramId; + private uint programId_; + public bool HasProgramId { + get { return hasProgramId; } + } + public uint ProgramId { + get { return programId_; } + } + + public const int StreamIdFieldNumber = 2; + private bool hasStreamId; + private uint streamId_; + public bool HasStreamId { + get { return hasStreamId; } + } + public uint StreamId { + get { return streamId_; } + } + + public const int LocaleFieldNumber = 3; + private bool hasLocale; + private uint locale_ = 1701729619; + public bool HasLocale { + get { return hasLocale; } + } + public uint Locale { + get { return locale_; } + } + + public override bool IsInitialized { + get { + if (!hasProgramId) return false; + if (!hasStreamId) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _contentHandleRequestFieldNames; + if (hasProgramId) { + output.WriteFixed32(1, field_names[1], ProgramId); + } + if (hasStreamId) { + output.WriteFixed32(2, field_names[2], StreamId); + } + if (hasLocale) { + output.WriteFixed32(3, field_names[0], Locale); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasProgramId) { + size += pb::CodedOutputStream.ComputeFixed32Size(1, ProgramId); + } + if (hasStreamId) { + size += pb::CodedOutputStream.ComputeFixed32Size(2, StreamId); + } + if (hasLocale) { + size += pb::CodedOutputStream.ComputeFixed32Size(3, Locale); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ContentHandleRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ContentHandleRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ContentHandleRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ContentHandleRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ContentHandleRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ContentHandleRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ContentHandleRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ContentHandleRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ContentHandleRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ContentHandleRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ContentHandleRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ContentHandleRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ContentHandleRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ContentHandleRequest result; + + private ContentHandleRequest PrepareBuilder() { + if (resultIsReadOnly) { + ContentHandleRequest original = result; + result = new ContentHandleRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ContentHandleRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.resources.ContentHandleRequest.Descriptor; } + } + + public override ContentHandleRequest DefaultInstanceForType { + get { return global::bnet.protocol.resources.ContentHandleRequest.DefaultInstance; } + } + + public override ContentHandleRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ContentHandleRequest) { + return MergeFrom((ContentHandleRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ContentHandleRequest other) { + if (other == global::bnet.protocol.resources.ContentHandleRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasProgramId) { + ProgramId = other.ProgramId; + } + if (other.HasStreamId) { + StreamId = other.StreamId; + } + if (other.HasLocale) { + Locale = other.Locale; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_contentHandleRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _contentHandleRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 13: { + result.hasProgramId = input.ReadFixed32(ref result.programId_); + break; + } + case 21: { + result.hasStreamId = input.ReadFixed32(ref result.streamId_); + break; + } + case 29: { + result.hasLocale = input.ReadFixed32(ref result.locale_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasProgramId { + get { return result.hasProgramId; } + } + public uint ProgramId { + get { return result.ProgramId; } + set { SetProgramId(value); } + } + public Builder SetProgramId(uint value) { + PrepareBuilder(); + result.hasProgramId = true; + result.programId_ = value; + return this; + } + public Builder ClearProgramId() { + PrepareBuilder(); + result.hasProgramId = false; + result.programId_ = 0; + return this; + } + + public bool HasStreamId { + get { return result.hasStreamId; } + } + public uint StreamId { + get { return result.StreamId; } + set { SetStreamId(value); } + } + public Builder SetStreamId(uint value) { + PrepareBuilder(); + result.hasStreamId = true; + result.streamId_ = value; + return this; + } + public Builder ClearStreamId() { + PrepareBuilder(); + result.hasStreamId = false; + result.streamId_ = 0; + return this; + } + + public bool HasLocale { + get { return result.hasLocale; } + } + public uint Locale { + get { return result.Locale; } + set { SetLocale(value); } + } + public Builder SetLocale(uint value) { + PrepareBuilder(); + result.hasLocale = true; + result.locale_ = value; + return this; + } + public Builder ClearLocale() { + PrepareBuilder(); + result.hasLocale = false; + result.locale_ = 1701729619; + return this; + } + } + static ContentHandleRequest() { + object.ReferenceEquals(global::bnet.protocol.resources.ResourceService.Descriptor, null); + } + } + + #endregion + + #region Services + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public abstract class Resources : pb::IService { + public abstract void GetContentHandle( + pb::IRpcController controller, + global::bnet.protocol.resources.ContentHandleRequest request, + global::System.Action done); + + public static pbd::ServiceDescriptor Descriptor { + get { return ResourceService.Descriptor.Services[0]; } + } + public pbd::ServiceDescriptor DescriptorForType { + get { return Descriptor; } + } + + public void CallMethod( + pbd::MethodDescriptor method, + pb::IRpcController controller, + pb::IMessage request, + global::System.Action done) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.CallMethod() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + this.GetContentHandle(controller, (global::bnet.protocol.resources.ContentHandleRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetRequestPrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.resources.ContentHandleRequest.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetResponsePrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.ContentHandle.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public static Stub CreateStub(pb::IRpcChannel channel) { + return new Stub(channel); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public class Stub : global::bnet.protocol.resources.Resources { + internal Stub(pb::IRpcChannel channel) { + this.channel = channel; + } + + private readonly pb::IRpcChannel channel; + + public pb::IRpcChannel Channel { + get { return channel; } + } + + public override void GetContentHandle( + pb::IRpcController controller, + global::bnet.protocol.resources.ContentHandleRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[0], + controller, request, global::bnet.protocol.ContentHandle.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.ContentHandle.DefaultInstance)); + } + } + } + #endregion + +} + +#endregion Designer generated code diff --git a/src/LibMooNet/bnet/protocol/search/SearchService.cs b/src/LibMooNet/bnet/protocol/search/SearchService.cs new file mode 100644 index 00000000..efce7e0f --- /dev/null +++ b/src/LibMooNet/bnet/protocol/search/SearchService.cs @@ -0,0 +1,2975 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace bnet.protocol.search { + + namespace Proto { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class SearchService { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_bnet_protocol_search_FindMatchesRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_search_FindMatchesRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_search_FindMatchesResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_search_FindMatchesResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_search_SetObjectRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_search_SetObjectRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_search_RemoveObjectsRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_search_RemoveObjectsRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_search_IndexBlacklistConfig__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_search_IndexBlacklistConfig__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_search_SearchConfig__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_search_SearchConfig__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_search_SearchUniverseLicenseConfig__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_search_SearchUniverseLicenseConfig__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_search_SearchLicenseConfig__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_search_SearchLicenseConfig__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static SearchService() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "ChlibmV0L3NlYXJjaF9zZXJ2aWNlLnByb3RvEhRibmV0LnByb3RvY29sLnNl" + + "YXJjaBoOYm5ldC9ycGMucHJvdG8aF2JuZXQvc2VhcmNoX3R5cGVzLnByb3Rv" + + "IoIBChJGaW5kTWF0Y2hlc1JlcXVlc3QSEAoIdW5pdmVyc2UYASACKAkSLQoH" + + "ZmlsdGVycxgCIAMoCzIcLmJuZXQucHJvdG9jb2wuc2VhcmNoLkZpbHRlchIZ" + + "Cg5zdGFydGluZ19pbmRleBgDIAEoDToBMBIQCgVjb3VudBgEIAEoDToBMCJ+" + + "ChNGaW5kTWF0Y2hlc1Jlc3BvbnNlEhoKEnRvdGFsX2NvdW50X2NhcHBlZBgB" + + "IAIoDRItCgdvYmplY3RzGAIgAygLMhwuYm5ldC5wcm90b2NvbC5zZWFyY2gu" + + "T2JqZWN0EhwKFHRvdGFsX2NvdW50X3VuY2FwcGVkGAMgASgNIkEKEFNldE9i" + + "amVjdFJlcXVlc3QSLQoHb2JqZWN0cxgBIAMoCzIcLmJuZXQucHJvdG9jb2wu" + + "c2VhcmNoLk9iamVjdCI4ChRSZW1vdmVPYmplY3RzUmVxdWVzdBIQCghzdGFy" + + "dF9pZBgBIAIoDBIOCgZlbmRfaWQYAiACKAwiJQoUSW5kZXhCbGFja2xpc3RD" + + "b25maWcSDQoFaW5kZXgYASADKAQiUwoMU2VhcmNoQ29uZmlnEkMKD2luZGV4" + + "X2JsYWNrbGlzdBgBIAEoCzIqLmJuZXQucHJvdG9jb2wuc2VhcmNoLkluZGV4" + + "QmxhY2tsaXN0Q29uZmlnInYKG1NlYXJjaFVuaXZlcnNlTGljZW5zZUNvbmZp" + + "ZxIQCgh1bml2ZXJzZRgBIAIoCRIhChZzZWFyY2hfZW5hYmxlZF9saWNlbnNl" + + "GAIgASgNOgEwEiIKF3NlYXJjaF9kaXNhYmxlZF9saWNlbnNlGAMgASgNOgEw" + + "ImMKE1NlYXJjaExpY2Vuc2VDb25maWcSTAoRdW5pdmVyc2VfbGljZW5zZXMY" + + "ASADKAsyMS5ibmV0LnByb3RvY29sLnNlYXJjaC5TZWFyY2hVbml2ZXJzZUxp" + + "Y2Vuc2VDb25maWcyrwIKDVNlYXJjaFNlcnZpY2USaAoLRmluZE1hdGNoZXMS" + + "KC5ibmV0LnByb3RvY29sLnNlYXJjaC5GaW5kTWF0Y2hlc1JlcXVlc3QaKS5i" + + "bmV0LnByb3RvY29sLnNlYXJjaC5GaW5kTWF0Y2hlc1Jlc3BvbnNlIgSAtRgB" + + "ElUKCVNldE9iamVjdBImLmJuZXQucHJvdG9jb2wuc2VhcmNoLlNldE9iamVj" + + "dFJlcXVlc3QaGi5ibmV0LnByb3RvY29sLk5PX1JFU1BPTlNFIgSAtRgCEl0K" + + "DVJlbW92ZU9iamVjdHMSKi5ibmV0LnByb3RvY29sLnNlYXJjaC5SZW1vdmVP" + + "YmplY3RzUmVxdWVzdBoaLmJuZXQucHJvdG9jb2wuTk9fUkVTUE9OU0UiBIC1" + + "GANCA4ABAA=="); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_bnet_protocol_search_FindMatchesRequest__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_search_FindMatchesRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_search_FindMatchesRequest__Descriptor, + new string[] { "Universe", "Filters", "StartingIndex", "Count", }); + internal__static_bnet_protocol_search_FindMatchesResponse__Descriptor = Descriptor.MessageTypes[1]; + internal__static_bnet_protocol_search_FindMatchesResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_search_FindMatchesResponse__Descriptor, + new string[] { "TotalCountCapped", "Objects", "TotalCountUncapped", }); + internal__static_bnet_protocol_search_SetObjectRequest__Descriptor = Descriptor.MessageTypes[2]; + internal__static_bnet_protocol_search_SetObjectRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_search_SetObjectRequest__Descriptor, + new string[] { "Objects", }); + internal__static_bnet_protocol_search_RemoveObjectsRequest__Descriptor = Descriptor.MessageTypes[3]; + internal__static_bnet_protocol_search_RemoveObjectsRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_search_RemoveObjectsRequest__Descriptor, + new string[] { "StartId", "EndId", }); + internal__static_bnet_protocol_search_IndexBlacklistConfig__Descriptor = Descriptor.MessageTypes[4]; + internal__static_bnet_protocol_search_IndexBlacklistConfig__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_search_IndexBlacklistConfig__Descriptor, + new string[] { "Index", }); + internal__static_bnet_protocol_search_SearchConfig__Descriptor = Descriptor.MessageTypes[5]; + internal__static_bnet_protocol_search_SearchConfig__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_search_SearchConfig__Descriptor, + new string[] { "IndexBlacklist", }); + internal__static_bnet_protocol_search_SearchUniverseLicenseConfig__Descriptor = Descriptor.MessageTypes[6]; + internal__static_bnet_protocol_search_SearchUniverseLicenseConfig__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_search_SearchUniverseLicenseConfig__Descriptor, + new string[] { "Universe", "SearchEnabledLicense", "SearchDisabledLicense", }); + internal__static_bnet_protocol_search_SearchLicenseConfig__Descriptor = Descriptor.MessageTypes[7]; + internal__static_bnet_protocol_search_SearchLicenseConfig__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_search_SearchLicenseConfig__Descriptor, + new string[] { "UniverseLicenses", }); + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + RegisterAllExtensions(registry); + global::bnet.protocol.Rpc.RegisterAllExtensions(registry); + global::bnet.protocol.search.SearchTypes.RegisterAllExtensions(registry); + return registry; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::bnet.protocol.Rpc.Descriptor, + global::bnet.protocol.search.SearchTypes.Descriptor, + }, assigner); + } + #endregion + + } + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class FindMatchesRequest : pb::GeneratedMessage { + private FindMatchesRequest() { } + private static readonly FindMatchesRequest defaultInstance = new FindMatchesRequest().MakeReadOnly(); + private static readonly string[] _findMatchesRequestFieldNames = new string[] { "count", "filters", "starting_index", "universe" }; + private static readonly uint[] _findMatchesRequestFieldTags = new uint[] { 32, 18, 24, 10 }; + public static FindMatchesRequest DefaultInstance { + get { return defaultInstance; } + } + + public override FindMatchesRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override FindMatchesRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.search.Proto.SearchService.internal__static_bnet_protocol_search_FindMatchesRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.search.Proto.SearchService.internal__static_bnet_protocol_search_FindMatchesRequest__FieldAccessorTable; } + } + + public const int UniverseFieldNumber = 1; + private bool hasUniverse; + private string universe_ = ""; + public bool HasUniverse { + get { return hasUniverse; } + } + public string Universe { + get { return universe_; } + } + + public const int FiltersFieldNumber = 2; + private pbc::PopsicleList filters_ = new pbc::PopsicleList(); + public scg::IList FiltersList { + get { return filters_; } + } + public int FiltersCount { + get { return filters_.Count; } + } + public global::bnet.protocol.search.Filter GetFilters(int index) { + return filters_[index]; + } + + public const int StartingIndexFieldNumber = 3; + private bool hasStartingIndex; + private uint startingIndex_; + public bool HasStartingIndex { + get { return hasStartingIndex; } + } + public uint StartingIndex { + get { return startingIndex_; } + } + + public const int CountFieldNumber = 4; + private bool hasCount; + private uint count_; + public bool HasCount { + get { return hasCount; } + } + public uint Count { + get { return count_; } + } + + public override bool IsInitialized { + get { + if (!hasUniverse) return false; + foreach (global::bnet.protocol.search.Filter element in FiltersList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _findMatchesRequestFieldNames; + if (hasUniverse) { + output.WriteString(1, field_names[3], Universe); + } + if (filters_.Count > 0) { + output.WriteMessageArray(2, field_names[1], filters_); + } + if (hasStartingIndex) { + output.WriteUInt32(3, field_names[2], StartingIndex); + } + if (hasCount) { + output.WriteUInt32(4, field_names[0], Count); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasUniverse) { + size += pb::CodedOutputStream.ComputeStringSize(1, Universe); + } + foreach (global::bnet.protocol.search.Filter element in FiltersList) { + size += pb::CodedOutputStream.ComputeMessageSize(2, element); + } + if (hasStartingIndex) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, StartingIndex); + } + if (hasCount) { + size += pb::CodedOutputStream.ComputeUInt32Size(4, Count); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static FindMatchesRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FindMatchesRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FindMatchesRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FindMatchesRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FindMatchesRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FindMatchesRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static FindMatchesRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static FindMatchesRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static FindMatchesRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FindMatchesRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private FindMatchesRequest MakeReadOnly() { + filters_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(FindMatchesRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(FindMatchesRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private FindMatchesRequest result; + + private FindMatchesRequest PrepareBuilder() { + if (resultIsReadOnly) { + FindMatchesRequest original = result; + result = new FindMatchesRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override FindMatchesRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.search.FindMatchesRequest.Descriptor; } + } + + public override FindMatchesRequest DefaultInstanceForType { + get { return global::bnet.protocol.search.FindMatchesRequest.DefaultInstance; } + } + + public override FindMatchesRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is FindMatchesRequest) { + return MergeFrom((FindMatchesRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(FindMatchesRequest other) { + if (other == global::bnet.protocol.search.FindMatchesRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasUniverse) { + Universe = other.Universe; + } + if (other.filters_.Count != 0) { + result.filters_.Add(other.filters_); + } + if (other.HasStartingIndex) { + StartingIndex = other.StartingIndex; + } + if (other.HasCount) { + Count = other.Count; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_findMatchesRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _findMatchesRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasUniverse = input.ReadString(ref result.universe_); + break; + } + case 18: { + input.ReadMessageArray(tag, field_name, result.filters_, global::bnet.protocol.search.Filter.DefaultInstance, extensionRegistry); + break; + } + case 24: { + result.hasStartingIndex = input.ReadUInt32(ref result.startingIndex_); + break; + } + case 32: { + result.hasCount = input.ReadUInt32(ref result.count_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasUniverse { + get { return result.hasUniverse; } + } + public string Universe { + get { return result.Universe; } + set { SetUniverse(value); } + } + public Builder SetUniverse(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasUniverse = true; + result.universe_ = value; + return this; + } + public Builder ClearUniverse() { + PrepareBuilder(); + result.hasUniverse = false; + result.universe_ = ""; + return this; + } + + public pbc::IPopsicleList FiltersList { + get { return PrepareBuilder().filters_; } + } + public int FiltersCount { + get { return result.FiltersCount; } + } + public global::bnet.protocol.search.Filter GetFilters(int index) { + return result.GetFilters(index); + } + public Builder SetFilters(int index, global::bnet.protocol.search.Filter value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.filters_[index] = value; + return this; + } + public Builder SetFilters(int index, global::bnet.protocol.search.Filter.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.filters_[index] = builderForValue.Build(); + return this; + } + public Builder AddFilters(global::bnet.protocol.search.Filter value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.filters_.Add(value); + return this; + } + public Builder AddFilters(global::bnet.protocol.search.Filter.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.filters_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeFilters(scg::IEnumerable values) { + PrepareBuilder(); + result.filters_.Add(values); + return this; + } + public Builder ClearFilters() { + PrepareBuilder(); + result.filters_.Clear(); + return this; + } + + public bool HasStartingIndex { + get { return result.hasStartingIndex; } + } + public uint StartingIndex { + get { return result.StartingIndex; } + set { SetStartingIndex(value); } + } + public Builder SetStartingIndex(uint value) { + PrepareBuilder(); + result.hasStartingIndex = true; + result.startingIndex_ = value; + return this; + } + public Builder ClearStartingIndex() { + PrepareBuilder(); + result.hasStartingIndex = false; + result.startingIndex_ = 0; + return this; + } + + public bool HasCount { + get { return result.hasCount; } + } + public uint Count { + get { return result.Count; } + set { SetCount(value); } + } + public Builder SetCount(uint value) { + PrepareBuilder(); + result.hasCount = true; + result.count_ = value; + return this; + } + public Builder ClearCount() { + PrepareBuilder(); + result.hasCount = false; + result.count_ = 0; + return this; + } + } + static FindMatchesRequest() { + object.ReferenceEquals(global::bnet.protocol.search.Proto.SearchService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class FindMatchesResponse : pb::GeneratedMessage { + private FindMatchesResponse() { } + private static readonly FindMatchesResponse defaultInstance = new FindMatchesResponse().MakeReadOnly(); + private static readonly string[] _findMatchesResponseFieldNames = new string[] { "objects", "total_count_capped", "total_count_uncapped" }; + private static readonly uint[] _findMatchesResponseFieldTags = new uint[] { 18, 8, 24 }; + public static FindMatchesResponse DefaultInstance { + get { return defaultInstance; } + } + + public override FindMatchesResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override FindMatchesResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.search.Proto.SearchService.internal__static_bnet_protocol_search_FindMatchesResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.search.Proto.SearchService.internal__static_bnet_protocol_search_FindMatchesResponse__FieldAccessorTable; } + } + + public const int TotalCountCappedFieldNumber = 1; + private bool hasTotalCountCapped; + private uint totalCountCapped_; + public bool HasTotalCountCapped { + get { return hasTotalCountCapped; } + } + public uint TotalCountCapped { + get { return totalCountCapped_; } + } + + public const int ObjectsFieldNumber = 2; + private pbc::PopsicleList objects_ = new pbc::PopsicleList(); + public scg::IList ObjectsList { + get { return objects_; } + } + public int ObjectsCount { + get { return objects_.Count; } + } + public global::bnet.protocol.search.Object GetObjects(int index) { + return objects_[index]; + } + + public const int TotalCountUncappedFieldNumber = 3; + private bool hasTotalCountUncapped; + private uint totalCountUncapped_; + public bool HasTotalCountUncapped { + get { return hasTotalCountUncapped; } + } + public uint TotalCountUncapped { + get { return totalCountUncapped_; } + } + + public override bool IsInitialized { + get { + if (!hasTotalCountCapped) return false; + foreach (global::bnet.protocol.search.Object element in ObjectsList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _findMatchesResponseFieldNames; + if (hasTotalCountCapped) { + output.WriteUInt32(1, field_names[1], TotalCountCapped); + } + if (objects_.Count > 0) { + output.WriteMessageArray(2, field_names[0], objects_); + } + if (hasTotalCountUncapped) { + output.WriteUInt32(3, field_names[2], TotalCountUncapped); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTotalCountCapped) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, TotalCountCapped); + } + foreach (global::bnet.protocol.search.Object element in ObjectsList) { + size += pb::CodedOutputStream.ComputeMessageSize(2, element); + } + if (hasTotalCountUncapped) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, TotalCountUncapped); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static FindMatchesResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FindMatchesResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FindMatchesResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FindMatchesResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FindMatchesResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FindMatchesResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static FindMatchesResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static FindMatchesResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static FindMatchesResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FindMatchesResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private FindMatchesResponse MakeReadOnly() { + objects_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(FindMatchesResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(FindMatchesResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private FindMatchesResponse result; + + private FindMatchesResponse PrepareBuilder() { + if (resultIsReadOnly) { + FindMatchesResponse original = result; + result = new FindMatchesResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override FindMatchesResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.search.FindMatchesResponse.Descriptor; } + } + + public override FindMatchesResponse DefaultInstanceForType { + get { return global::bnet.protocol.search.FindMatchesResponse.DefaultInstance; } + } + + public override FindMatchesResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is FindMatchesResponse) { + return MergeFrom((FindMatchesResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(FindMatchesResponse other) { + if (other == global::bnet.protocol.search.FindMatchesResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTotalCountCapped) { + TotalCountCapped = other.TotalCountCapped; + } + if (other.objects_.Count != 0) { + result.objects_.Add(other.objects_); + } + if (other.HasTotalCountUncapped) { + TotalCountUncapped = other.TotalCountUncapped; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_findMatchesResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _findMatchesResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasTotalCountCapped = input.ReadUInt32(ref result.totalCountCapped_); + break; + } + case 18: { + input.ReadMessageArray(tag, field_name, result.objects_, global::bnet.protocol.search.Object.DefaultInstance, extensionRegistry); + break; + } + case 24: { + result.hasTotalCountUncapped = input.ReadUInt32(ref result.totalCountUncapped_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTotalCountCapped { + get { return result.hasTotalCountCapped; } + } + public uint TotalCountCapped { + get { return result.TotalCountCapped; } + set { SetTotalCountCapped(value); } + } + public Builder SetTotalCountCapped(uint value) { + PrepareBuilder(); + result.hasTotalCountCapped = true; + result.totalCountCapped_ = value; + return this; + } + public Builder ClearTotalCountCapped() { + PrepareBuilder(); + result.hasTotalCountCapped = false; + result.totalCountCapped_ = 0; + return this; + } + + public pbc::IPopsicleList ObjectsList { + get { return PrepareBuilder().objects_; } + } + public int ObjectsCount { + get { return result.ObjectsCount; } + } + public global::bnet.protocol.search.Object GetObjects(int index) { + return result.GetObjects(index); + } + public Builder SetObjects(int index, global::bnet.protocol.search.Object value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.objects_[index] = value; + return this; + } + public Builder SetObjects(int index, global::bnet.protocol.search.Object.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.objects_[index] = builderForValue.Build(); + return this; + } + public Builder AddObjects(global::bnet.protocol.search.Object value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.objects_.Add(value); + return this; + } + public Builder AddObjects(global::bnet.protocol.search.Object.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.objects_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeObjects(scg::IEnumerable values) { + PrepareBuilder(); + result.objects_.Add(values); + return this; + } + public Builder ClearObjects() { + PrepareBuilder(); + result.objects_.Clear(); + return this; + } + + public bool HasTotalCountUncapped { + get { return result.hasTotalCountUncapped; } + } + public uint TotalCountUncapped { + get { return result.TotalCountUncapped; } + set { SetTotalCountUncapped(value); } + } + public Builder SetTotalCountUncapped(uint value) { + PrepareBuilder(); + result.hasTotalCountUncapped = true; + result.totalCountUncapped_ = value; + return this; + } + public Builder ClearTotalCountUncapped() { + PrepareBuilder(); + result.hasTotalCountUncapped = false; + result.totalCountUncapped_ = 0; + return this; + } + } + static FindMatchesResponse() { + object.ReferenceEquals(global::bnet.protocol.search.Proto.SearchService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class SetObjectRequest : pb::GeneratedMessage { + private SetObjectRequest() { } + private static readonly SetObjectRequest defaultInstance = new SetObjectRequest().MakeReadOnly(); + private static readonly string[] _setObjectRequestFieldNames = new string[] { "objects" }; + private static readonly uint[] _setObjectRequestFieldTags = new uint[] { 10 }; + public static SetObjectRequest DefaultInstance { + get { return defaultInstance; } + } + + public override SetObjectRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SetObjectRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.search.Proto.SearchService.internal__static_bnet_protocol_search_SetObjectRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.search.Proto.SearchService.internal__static_bnet_protocol_search_SetObjectRequest__FieldAccessorTable; } + } + + public const int ObjectsFieldNumber = 1; + private pbc::PopsicleList objects_ = new pbc::PopsicleList(); + public scg::IList ObjectsList { + get { return objects_; } + } + public int ObjectsCount { + get { return objects_.Count; } + } + public global::bnet.protocol.search.Object GetObjects(int index) { + return objects_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.search.Object element in ObjectsList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _setObjectRequestFieldNames; + if (objects_.Count > 0) { + output.WriteMessageArray(1, field_names[0], objects_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.search.Object element in ObjectsList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static SetObjectRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SetObjectRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SetObjectRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SetObjectRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SetObjectRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SetObjectRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SetObjectRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SetObjectRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SetObjectRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SetObjectRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SetObjectRequest MakeReadOnly() { + objects_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SetObjectRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SetObjectRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SetObjectRequest result; + + private SetObjectRequest PrepareBuilder() { + if (resultIsReadOnly) { + SetObjectRequest original = result; + result = new SetObjectRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SetObjectRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.search.SetObjectRequest.Descriptor; } + } + + public override SetObjectRequest DefaultInstanceForType { + get { return global::bnet.protocol.search.SetObjectRequest.DefaultInstance; } + } + + public override SetObjectRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SetObjectRequest) { + return MergeFrom((SetObjectRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SetObjectRequest other) { + if (other == global::bnet.protocol.search.SetObjectRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.objects_.Count != 0) { + result.objects_.Add(other.objects_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_setObjectRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _setObjectRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.objects_, global::bnet.protocol.search.Object.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList ObjectsList { + get { return PrepareBuilder().objects_; } + } + public int ObjectsCount { + get { return result.ObjectsCount; } + } + public global::bnet.protocol.search.Object GetObjects(int index) { + return result.GetObjects(index); + } + public Builder SetObjects(int index, global::bnet.protocol.search.Object value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.objects_[index] = value; + return this; + } + public Builder SetObjects(int index, global::bnet.protocol.search.Object.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.objects_[index] = builderForValue.Build(); + return this; + } + public Builder AddObjects(global::bnet.protocol.search.Object value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.objects_.Add(value); + return this; + } + public Builder AddObjects(global::bnet.protocol.search.Object.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.objects_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeObjects(scg::IEnumerable values) { + PrepareBuilder(); + result.objects_.Add(values); + return this; + } + public Builder ClearObjects() { + PrepareBuilder(); + result.objects_.Clear(); + return this; + } + } + static SetObjectRequest() { + object.ReferenceEquals(global::bnet.protocol.search.Proto.SearchService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class RemoveObjectsRequest : pb::GeneratedMessage { + private RemoveObjectsRequest() { } + private static readonly RemoveObjectsRequest defaultInstance = new RemoveObjectsRequest().MakeReadOnly(); + private static readonly string[] _removeObjectsRequestFieldNames = new string[] { "end_id", "start_id" }; + private static readonly uint[] _removeObjectsRequestFieldTags = new uint[] { 18, 10 }; + public static RemoveObjectsRequest DefaultInstance { + get { return defaultInstance; } + } + + public override RemoveObjectsRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override RemoveObjectsRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.search.Proto.SearchService.internal__static_bnet_protocol_search_RemoveObjectsRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.search.Proto.SearchService.internal__static_bnet_protocol_search_RemoveObjectsRequest__FieldAccessorTable; } + } + + public const int StartIdFieldNumber = 1; + private bool hasStartId; + private pb::ByteString startId_ = pb::ByteString.Empty; + public bool HasStartId { + get { return hasStartId; } + } + public pb::ByteString StartId { + get { return startId_; } + } + + public const int EndIdFieldNumber = 2; + private bool hasEndId; + private pb::ByteString endId_ = pb::ByteString.Empty; + public bool HasEndId { + get { return hasEndId; } + } + public pb::ByteString EndId { + get { return endId_; } + } + + public override bool IsInitialized { + get { + if (!hasStartId) return false; + if (!hasEndId) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _removeObjectsRequestFieldNames; + if (hasStartId) { + output.WriteBytes(1, field_names[1], StartId); + } + if (hasEndId) { + output.WriteBytes(2, field_names[0], EndId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasStartId) { + size += pb::CodedOutputStream.ComputeBytesSize(1, StartId); + } + if (hasEndId) { + size += pb::CodedOutputStream.ComputeBytesSize(2, EndId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static RemoveObjectsRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RemoveObjectsRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RemoveObjectsRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RemoveObjectsRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RemoveObjectsRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RemoveObjectsRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static RemoveObjectsRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static RemoveObjectsRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static RemoveObjectsRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RemoveObjectsRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private RemoveObjectsRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(RemoveObjectsRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(RemoveObjectsRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private RemoveObjectsRequest result; + + private RemoveObjectsRequest PrepareBuilder() { + if (resultIsReadOnly) { + RemoveObjectsRequest original = result; + result = new RemoveObjectsRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override RemoveObjectsRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.search.RemoveObjectsRequest.Descriptor; } + } + + public override RemoveObjectsRequest DefaultInstanceForType { + get { return global::bnet.protocol.search.RemoveObjectsRequest.DefaultInstance; } + } + + public override RemoveObjectsRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is RemoveObjectsRequest) { + return MergeFrom((RemoveObjectsRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(RemoveObjectsRequest other) { + if (other == global::bnet.protocol.search.RemoveObjectsRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasStartId) { + StartId = other.StartId; + } + if (other.HasEndId) { + EndId = other.EndId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_removeObjectsRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _removeObjectsRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasStartId = input.ReadBytes(ref result.startId_); + break; + } + case 18: { + result.hasEndId = input.ReadBytes(ref result.endId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasStartId { + get { return result.hasStartId; } + } + public pb::ByteString StartId { + get { return result.StartId; } + set { SetStartId(value); } + } + public Builder SetStartId(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasStartId = true; + result.startId_ = value; + return this; + } + public Builder ClearStartId() { + PrepareBuilder(); + result.hasStartId = false; + result.startId_ = pb::ByteString.Empty; + return this; + } + + public bool HasEndId { + get { return result.hasEndId; } + } + public pb::ByteString EndId { + get { return result.EndId; } + set { SetEndId(value); } + } + public Builder SetEndId(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasEndId = true; + result.endId_ = value; + return this; + } + public Builder ClearEndId() { + PrepareBuilder(); + result.hasEndId = false; + result.endId_ = pb::ByteString.Empty; + return this; + } + } + static RemoveObjectsRequest() { + object.ReferenceEquals(global::bnet.protocol.search.Proto.SearchService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class IndexBlacklistConfig : pb::GeneratedMessage { + private IndexBlacklistConfig() { } + private static readonly IndexBlacklistConfig defaultInstance = new IndexBlacklistConfig().MakeReadOnly(); + private static readonly string[] _indexBlacklistConfigFieldNames = new string[] { "index" }; + private static readonly uint[] _indexBlacklistConfigFieldTags = new uint[] { 8 }; + public static IndexBlacklistConfig DefaultInstance { + get { return defaultInstance; } + } + + public override IndexBlacklistConfig DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override IndexBlacklistConfig ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.search.Proto.SearchService.internal__static_bnet_protocol_search_IndexBlacklistConfig__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.search.Proto.SearchService.internal__static_bnet_protocol_search_IndexBlacklistConfig__FieldAccessorTable; } + } + + public const int IndexFieldNumber = 1; + private pbc::PopsicleList index_ = new pbc::PopsicleList(); + public scg::IList IndexList { + get { return pbc::Lists.AsReadOnly(index_); } + } + public int IndexCount { + get { return index_.Count; } + } + public ulong GetIndex(int index) { + return index_[index]; + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _indexBlacklistConfigFieldNames; + if (index_.Count > 0) { + output.WriteUInt64Array(1, field_names[0], index_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + foreach (ulong element in IndexList) { + dataSize += pb::CodedOutputStream.ComputeUInt64SizeNoTag(element); + } + size += dataSize; + size += 1 * index_.Count; + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static IndexBlacklistConfig ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static IndexBlacklistConfig ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static IndexBlacklistConfig ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static IndexBlacklistConfig ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static IndexBlacklistConfig ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static IndexBlacklistConfig ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static IndexBlacklistConfig ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static IndexBlacklistConfig ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static IndexBlacklistConfig ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static IndexBlacklistConfig ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private IndexBlacklistConfig MakeReadOnly() { + index_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(IndexBlacklistConfig prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(IndexBlacklistConfig cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private IndexBlacklistConfig result; + + private IndexBlacklistConfig PrepareBuilder() { + if (resultIsReadOnly) { + IndexBlacklistConfig original = result; + result = new IndexBlacklistConfig(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override IndexBlacklistConfig MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.search.IndexBlacklistConfig.Descriptor; } + } + + public override IndexBlacklistConfig DefaultInstanceForType { + get { return global::bnet.protocol.search.IndexBlacklistConfig.DefaultInstance; } + } + + public override IndexBlacklistConfig BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is IndexBlacklistConfig) { + return MergeFrom((IndexBlacklistConfig) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(IndexBlacklistConfig other) { + if (other == global::bnet.protocol.search.IndexBlacklistConfig.DefaultInstance) return this; + PrepareBuilder(); + if (other.index_.Count != 0) { + result.index_.Add(other.index_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_indexBlacklistConfigFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _indexBlacklistConfigFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: + case 8: { + input.ReadUInt64Array(tag, field_name, result.index_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList IndexList { + get { return PrepareBuilder().index_; } + } + public int IndexCount { + get { return result.IndexCount; } + } + public ulong GetIndex(int index) { + return result.GetIndex(index); + } + public Builder SetIndex(int index, ulong value) { + PrepareBuilder(); + result.index_[index] = value; + return this; + } + public Builder AddIndex(ulong value) { + PrepareBuilder(); + result.index_.Add(value); + return this; + } + public Builder AddRangeIndex(scg::IEnumerable values) { + PrepareBuilder(); + result.index_.Add(values); + return this; + } + public Builder ClearIndex() { + PrepareBuilder(); + result.index_.Clear(); + return this; + } + } + static IndexBlacklistConfig() { + object.ReferenceEquals(global::bnet.protocol.search.Proto.SearchService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class SearchConfig : pb::GeneratedMessage { + private SearchConfig() { } + private static readonly SearchConfig defaultInstance = new SearchConfig().MakeReadOnly(); + private static readonly string[] _searchConfigFieldNames = new string[] { "index_blacklist" }; + private static readonly uint[] _searchConfigFieldTags = new uint[] { 10 }; + public static SearchConfig DefaultInstance { + get { return defaultInstance; } + } + + public override SearchConfig DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SearchConfig ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.search.Proto.SearchService.internal__static_bnet_protocol_search_SearchConfig__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.search.Proto.SearchService.internal__static_bnet_protocol_search_SearchConfig__FieldAccessorTable; } + } + + public const int IndexBlacklistFieldNumber = 1; + private bool hasIndexBlacklist; + private global::bnet.protocol.search.IndexBlacklistConfig indexBlacklist_; + public bool HasIndexBlacklist { + get { return hasIndexBlacklist; } + } + public global::bnet.protocol.search.IndexBlacklistConfig IndexBlacklist { + get { return indexBlacklist_ ?? global::bnet.protocol.search.IndexBlacklistConfig.DefaultInstance; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _searchConfigFieldNames; + if (hasIndexBlacklist) { + output.WriteMessage(1, field_names[0], IndexBlacklist); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasIndexBlacklist) { + size += pb::CodedOutputStream.ComputeMessageSize(1, IndexBlacklist); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static SearchConfig ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SearchConfig ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SearchConfig ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SearchConfig ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SearchConfig ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SearchConfig ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SearchConfig ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SearchConfig ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SearchConfig ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SearchConfig ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SearchConfig MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SearchConfig prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SearchConfig cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SearchConfig result; + + private SearchConfig PrepareBuilder() { + if (resultIsReadOnly) { + SearchConfig original = result; + result = new SearchConfig(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SearchConfig MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.search.SearchConfig.Descriptor; } + } + + public override SearchConfig DefaultInstanceForType { + get { return global::bnet.protocol.search.SearchConfig.DefaultInstance; } + } + + public override SearchConfig BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SearchConfig) { + return MergeFrom((SearchConfig) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SearchConfig other) { + if (other == global::bnet.protocol.search.SearchConfig.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasIndexBlacklist) { + MergeIndexBlacklist(other.IndexBlacklist); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_searchConfigFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _searchConfigFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.search.IndexBlacklistConfig.Builder subBuilder = global::bnet.protocol.search.IndexBlacklistConfig.CreateBuilder(); + if (result.hasIndexBlacklist) { + subBuilder.MergeFrom(IndexBlacklist); + } + input.ReadMessage(subBuilder, extensionRegistry); + IndexBlacklist = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasIndexBlacklist { + get { return result.hasIndexBlacklist; } + } + public global::bnet.protocol.search.IndexBlacklistConfig IndexBlacklist { + get { return result.IndexBlacklist; } + set { SetIndexBlacklist(value); } + } + public Builder SetIndexBlacklist(global::bnet.protocol.search.IndexBlacklistConfig value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasIndexBlacklist = true; + result.indexBlacklist_ = value; + return this; + } + public Builder SetIndexBlacklist(global::bnet.protocol.search.IndexBlacklistConfig.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasIndexBlacklist = true; + result.indexBlacklist_ = builderForValue.Build(); + return this; + } + public Builder MergeIndexBlacklist(global::bnet.protocol.search.IndexBlacklistConfig value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasIndexBlacklist && + result.indexBlacklist_ != global::bnet.protocol.search.IndexBlacklistConfig.DefaultInstance) { + result.indexBlacklist_ = global::bnet.protocol.search.IndexBlacklistConfig.CreateBuilder(result.indexBlacklist_).MergeFrom(value).BuildPartial(); + } else { + result.indexBlacklist_ = value; + } + result.hasIndexBlacklist = true; + return this; + } + public Builder ClearIndexBlacklist() { + PrepareBuilder(); + result.hasIndexBlacklist = false; + result.indexBlacklist_ = null; + return this; + } + } + static SearchConfig() { + object.ReferenceEquals(global::bnet.protocol.search.Proto.SearchService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class SearchUniverseLicenseConfig : pb::GeneratedMessage { + private SearchUniverseLicenseConfig() { } + private static readonly SearchUniverseLicenseConfig defaultInstance = new SearchUniverseLicenseConfig().MakeReadOnly(); + private static readonly string[] _searchUniverseLicenseConfigFieldNames = new string[] { "search_disabled_license", "search_enabled_license", "universe" }; + private static readonly uint[] _searchUniverseLicenseConfigFieldTags = new uint[] { 24, 16, 10 }; + public static SearchUniverseLicenseConfig DefaultInstance { + get { return defaultInstance; } + } + + public override SearchUniverseLicenseConfig DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SearchUniverseLicenseConfig ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.search.Proto.SearchService.internal__static_bnet_protocol_search_SearchUniverseLicenseConfig__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.search.Proto.SearchService.internal__static_bnet_protocol_search_SearchUniverseLicenseConfig__FieldAccessorTable; } + } + + public const int UniverseFieldNumber = 1; + private bool hasUniverse; + private string universe_ = ""; + public bool HasUniverse { + get { return hasUniverse; } + } + public string Universe { + get { return universe_; } + } + + public const int SearchEnabledLicenseFieldNumber = 2; + private bool hasSearchEnabledLicense; + private uint searchEnabledLicense_; + public bool HasSearchEnabledLicense { + get { return hasSearchEnabledLicense; } + } + public uint SearchEnabledLicense { + get { return searchEnabledLicense_; } + } + + public const int SearchDisabledLicenseFieldNumber = 3; + private bool hasSearchDisabledLicense; + private uint searchDisabledLicense_; + public bool HasSearchDisabledLicense { + get { return hasSearchDisabledLicense; } + } + public uint SearchDisabledLicense { + get { return searchDisabledLicense_; } + } + + public override bool IsInitialized { + get { + if (!hasUniverse) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _searchUniverseLicenseConfigFieldNames; + if (hasUniverse) { + output.WriteString(1, field_names[2], Universe); + } + if (hasSearchEnabledLicense) { + output.WriteUInt32(2, field_names[1], SearchEnabledLicense); + } + if (hasSearchDisabledLicense) { + output.WriteUInt32(3, field_names[0], SearchDisabledLicense); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasUniverse) { + size += pb::CodedOutputStream.ComputeStringSize(1, Universe); + } + if (hasSearchEnabledLicense) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, SearchEnabledLicense); + } + if (hasSearchDisabledLicense) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, SearchDisabledLicense); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static SearchUniverseLicenseConfig ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SearchUniverseLicenseConfig ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SearchUniverseLicenseConfig ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SearchUniverseLicenseConfig ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SearchUniverseLicenseConfig ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SearchUniverseLicenseConfig ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SearchUniverseLicenseConfig ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SearchUniverseLicenseConfig ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SearchUniverseLicenseConfig ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SearchUniverseLicenseConfig ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SearchUniverseLicenseConfig MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SearchUniverseLicenseConfig prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SearchUniverseLicenseConfig cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SearchUniverseLicenseConfig result; + + private SearchUniverseLicenseConfig PrepareBuilder() { + if (resultIsReadOnly) { + SearchUniverseLicenseConfig original = result; + result = new SearchUniverseLicenseConfig(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SearchUniverseLicenseConfig MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.search.SearchUniverseLicenseConfig.Descriptor; } + } + + public override SearchUniverseLicenseConfig DefaultInstanceForType { + get { return global::bnet.protocol.search.SearchUniverseLicenseConfig.DefaultInstance; } + } + + public override SearchUniverseLicenseConfig BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SearchUniverseLicenseConfig) { + return MergeFrom((SearchUniverseLicenseConfig) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SearchUniverseLicenseConfig other) { + if (other == global::bnet.protocol.search.SearchUniverseLicenseConfig.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasUniverse) { + Universe = other.Universe; + } + if (other.HasSearchEnabledLicense) { + SearchEnabledLicense = other.SearchEnabledLicense; + } + if (other.HasSearchDisabledLicense) { + SearchDisabledLicense = other.SearchDisabledLicense; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_searchUniverseLicenseConfigFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _searchUniverseLicenseConfigFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasUniverse = input.ReadString(ref result.universe_); + break; + } + case 16: { + result.hasSearchEnabledLicense = input.ReadUInt32(ref result.searchEnabledLicense_); + break; + } + case 24: { + result.hasSearchDisabledLicense = input.ReadUInt32(ref result.searchDisabledLicense_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasUniverse { + get { return result.hasUniverse; } + } + public string Universe { + get { return result.Universe; } + set { SetUniverse(value); } + } + public Builder SetUniverse(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasUniverse = true; + result.universe_ = value; + return this; + } + public Builder ClearUniverse() { + PrepareBuilder(); + result.hasUniverse = false; + result.universe_ = ""; + return this; + } + + public bool HasSearchEnabledLicense { + get { return result.hasSearchEnabledLicense; } + } + public uint SearchEnabledLicense { + get { return result.SearchEnabledLicense; } + set { SetSearchEnabledLicense(value); } + } + public Builder SetSearchEnabledLicense(uint value) { + PrepareBuilder(); + result.hasSearchEnabledLicense = true; + result.searchEnabledLicense_ = value; + return this; + } + public Builder ClearSearchEnabledLicense() { + PrepareBuilder(); + result.hasSearchEnabledLicense = false; + result.searchEnabledLicense_ = 0; + return this; + } + + public bool HasSearchDisabledLicense { + get { return result.hasSearchDisabledLicense; } + } + public uint SearchDisabledLicense { + get { return result.SearchDisabledLicense; } + set { SetSearchDisabledLicense(value); } + } + public Builder SetSearchDisabledLicense(uint value) { + PrepareBuilder(); + result.hasSearchDisabledLicense = true; + result.searchDisabledLicense_ = value; + return this; + } + public Builder ClearSearchDisabledLicense() { + PrepareBuilder(); + result.hasSearchDisabledLicense = false; + result.searchDisabledLicense_ = 0; + return this; + } + } + static SearchUniverseLicenseConfig() { + object.ReferenceEquals(global::bnet.protocol.search.Proto.SearchService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class SearchLicenseConfig : pb::GeneratedMessage { + private SearchLicenseConfig() { } + private static readonly SearchLicenseConfig defaultInstance = new SearchLicenseConfig().MakeReadOnly(); + private static readonly string[] _searchLicenseConfigFieldNames = new string[] { "universe_licenses" }; + private static readonly uint[] _searchLicenseConfigFieldTags = new uint[] { 10 }; + public static SearchLicenseConfig DefaultInstance { + get { return defaultInstance; } + } + + public override SearchLicenseConfig DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SearchLicenseConfig ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.search.Proto.SearchService.internal__static_bnet_protocol_search_SearchLicenseConfig__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.search.Proto.SearchService.internal__static_bnet_protocol_search_SearchLicenseConfig__FieldAccessorTable; } + } + + public const int UniverseLicensesFieldNumber = 1; + private pbc::PopsicleList universeLicenses_ = new pbc::PopsicleList(); + public scg::IList UniverseLicensesList { + get { return universeLicenses_; } + } + public int UniverseLicensesCount { + get { return universeLicenses_.Count; } + } + public global::bnet.protocol.search.SearchUniverseLicenseConfig GetUniverseLicenses(int index) { + return universeLicenses_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.search.SearchUniverseLicenseConfig element in UniverseLicensesList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _searchLicenseConfigFieldNames; + if (universeLicenses_.Count > 0) { + output.WriteMessageArray(1, field_names[0], universeLicenses_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.search.SearchUniverseLicenseConfig element in UniverseLicensesList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static SearchLicenseConfig ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SearchLicenseConfig ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SearchLicenseConfig ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SearchLicenseConfig ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SearchLicenseConfig ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SearchLicenseConfig ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SearchLicenseConfig ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SearchLicenseConfig ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SearchLicenseConfig ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SearchLicenseConfig ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SearchLicenseConfig MakeReadOnly() { + universeLicenses_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SearchLicenseConfig prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SearchLicenseConfig cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SearchLicenseConfig result; + + private SearchLicenseConfig PrepareBuilder() { + if (resultIsReadOnly) { + SearchLicenseConfig original = result; + result = new SearchLicenseConfig(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SearchLicenseConfig MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.search.SearchLicenseConfig.Descriptor; } + } + + public override SearchLicenseConfig DefaultInstanceForType { + get { return global::bnet.protocol.search.SearchLicenseConfig.DefaultInstance; } + } + + public override SearchLicenseConfig BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SearchLicenseConfig) { + return MergeFrom((SearchLicenseConfig) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SearchLicenseConfig other) { + if (other == global::bnet.protocol.search.SearchLicenseConfig.DefaultInstance) return this; + PrepareBuilder(); + if (other.universeLicenses_.Count != 0) { + result.universeLicenses_.Add(other.universeLicenses_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_searchLicenseConfigFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _searchLicenseConfigFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.universeLicenses_, global::bnet.protocol.search.SearchUniverseLicenseConfig.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList UniverseLicensesList { + get { return PrepareBuilder().universeLicenses_; } + } + public int UniverseLicensesCount { + get { return result.UniverseLicensesCount; } + } + public global::bnet.protocol.search.SearchUniverseLicenseConfig GetUniverseLicenses(int index) { + return result.GetUniverseLicenses(index); + } + public Builder SetUniverseLicenses(int index, global::bnet.protocol.search.SearchUniverseLicenseConfig value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.universeLicenses_[index] = value; + return this; + } + public Builder SetUniverseLicenses(int index, global::bnet.protocol.search.SearchUniverseLicenseConfig.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.universeLicenses_[index] = builderForValue.Build(); + return this; + } + public Builder AddUniverseLicenses(global::bnet.protocol.search.SearchUniverseLicenseConfig value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.universeLicenses_.Add(value); + return this; + } + public Builder AddUniverseLicenses(global::bnet.protocol.search.SearchUniverseLicenseConfig.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.universeLicenses_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeUniverseLicenses(scg::IEnumerable values) { + PrepareBuilder(); + result.universeLicenses_.Add(values); + return this; + } + public Builder ClearUniverseLicenses() { + PrepareBuilder(); + result.universeLicenses_.Clear(); + return this; + } + } + static SearchLicenseConfig() { + object.ReferenceEquals(global::bnet.protocol.search.Proto.SearchService.Descriptor, null); + } + } + + #endregion + + #region Services + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public abstract class SearchService : pb::IService { + public abstract void FindMatches( + pb::IRpcController controller, + global::bnet.protocol.search.FindMatchesRequest request, + global::System.Action done); + public abstract void SetObject( + pb::IRpcController controller, + global::bnet.protocol.search.SetObjectRequest request, + global::System.Action done); + public abstract void RemoveObjects( + pb::IRpcController controller, + global::bnet.protocol.search.RemoveObjectsRequest request, + global::System.Action done); + + public static pbd::ServiceDescriptor Descriptor { + get { return Proto.SearchService.Descriptor.Services[0]; } + } + public pbd::ServiceDescriptor DescriptorForType { + get { return Descriptor; } + } + + public void CallMethod( + pbd::MethodDescriptor method, + pb::IRpcController controller, + pb::IMessage request, + global::System.Action done) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.CallMethod() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + this.FindMatches(controller, (global::bnet.protocol.search.FindMatchesRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 1: + this.SetObject(controller, (global::bnet.protocol.search.SetObjectRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 2: + this.RemoveObjects(controller, (global::bnet.protocol.search.RemoveObjectsRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetRequestPrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.search.FindMatchesRequest.DefaultInstance; + case 1: + return global::bnet.protocol.search.SetObjectRequest.DefaultInstance; + case 2: + return global::bnet.protocol.search.RemoveObjectsRequest.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetResponsePrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.search.FindMatchesResponse.DefaultInstance; + case 1: + return global::bnet.protocol.NO_RESPONSE.DefaultInstance; + case 2: + return global::bnet.protocol.NO_RESPONSE.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public static Stub CreateStub(pb::IRpcChannel channel) { + return new Stub(channel); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public class Stub : global::bnet.protocol.search.SearchService { + internal Stub(pb::IRpcChannel channel) { + this.channel = channel; + } + + private readonly pb::IRpcChannel channel; + + public pb::IRpcChannel Channel { + get { return channel; } + } + + public override void FindMatches( + pb::IRpcController controller, + global::bnet.protocol.search.FindMatchesRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[0], + controller, request, global::bnet.protocol.search.FindMatchesResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.search.FindMatchesResponse.DefaultInstance)); + } + + public override void SetObject( + pb::IRpcController controller, + global::bnet.protocol.search.SetObjectRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[1], + controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); + } + + public override void RemoveObjects( + pb::IRpcController controller, + global::bnet.protocol.search.RemoveObjectsRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[2], + controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); + } + } + } + #endregion + +} + +#endregion Designer generated code diff --git a/source/D3Proto/bnet/protocol/search/SearchTypes.cs b/src/LibMooNet/bnet/protocol/search/SearchTypes.cs similarity index 66% rename from source/D3Proto/bnet/protocol/search/SearchTypes.cs rename to src/LibMooNet/bnet/protocol/search/SearchTypes.cs index 8eb81c76..79baf63a 100644 --- a/source/D3Proto/bnet/protocol/search/SearchTypes.cs +++ b/src/LibMooNet/bnet/protocol/search/SearchTypes.cs @@ -1,4 +1,6 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code using pb = global::Google.ProtocolBuffers; using pbc = global::Google.ProtocolBuffers.Collections; @@ -6,6 +8,9 @@ using scg = global::System.Collections.Generic; namespace bnet.protocol.search { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public static partial class SearchTypes { #region Extension registration @@ -28,18 +33,18 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { static SearchTypes() { byte[] descriptorData = global::System.Convert.FromBase64String( - "CiFzZXJ2aWNlL3NlYXJjaC9zZWFyY2hfdHlwZXMucHJvdG8SFGJuZXQucHJv" + - "dG9jb2wuc2VhcmNoIikKCVN0YXRpc3RpYxINCgJpZBgBIAEoDToBMBINCgV2" + - "YWx1ZRgCIAIoBSLTAgoGRmlsdGVyEjIKCXN0YXRpc3RpYxgBIAIoCzIfLmJu" + - "ZXQucHJvdG9jb2wuc2VhcmNoLlN0YXRpc3RpYxI5Cgljb21wYXJhbmQYAiAC" + - "KA4yJi5ibmV0LnByb3RvY29sLnNlYXJjaC5GaWx0ZXIuQ29tcGFyYW5kEkcK" + - "DnNvcnRfZGlyZWN0aW9uGAMgASgOMiouYm5ldC5wcm90b2NvbC5zZWFyY2gu" + - "RmlsdGVyLlNvcnREaXJlY3Rpb246A0FTQyJtCglDb21wYXJhbmQSCgoGRVFV" + - "QUxTEAASDQoJTEVTU19USEFOEAESFwoTTEVTU19USEFOX09SX0VRVUFMUxAC" + - "EhAKDEdSRUFURVJfVEhBThADEhoKFkdSRUFURVJfVEhBTl9PUl9FUVVBTFMQ" + - "BCIiCg1Tb3J0RGlyZWN0aW9uEgcKA0FTQxAAEggKBERFU0MQASJXCgZPYmpl" + - "Y3QSCgoCaWQYASACKAwSDAoEZGF0YRgCIAEoDBIzCgpzdGF0aXN0aWNzGAMg" + - "AygLMh8uYm5ldC5wcm90b2NvbC5zZWFyY2guU3RhdGlzdGlj"); + "ChdibmV0L3NlYXJjaF90eXBlcy5wcm90bxIUYm5ldC5wcm90b2NvbC5zZWFy" + + "Y2giKQoJU3RhdGlzdGljEg0KAmlkGAEgASgEOgEwEg0KBXZhbHVlGAIgAigF" + + "ItMCCgZGaWx0ZXISMgoJc3RhdGlzdGljGAEgAigLMh8uYm5ldC5wcm90b2Nv" + + "bC5zZWFyY2guU3RhdGlzdGljEjkKCWNvbXBhcmFuZBgCIAIoDjImLmJuZXQu" + + "cHJvdG9jb2wuc2VhcmNoLkZpbHRlci5Db21wYXJhbmQSRwoOc29ydF9kaXJl" + + "Y3Rpb24YAyABKA4yKi5ibmV0LnByb3RvY29sLnNlYXJjaC5GaWx0ZXIuU29y" + + "dERpcmVjdGlvbjoDQVNDIm0KCUNvbXBhcmFuZBIKCgZFUVVBTFMQABINCglM" + + "RVNTX1RIQU4QARIXChNMRVNTX1RIQU5fT1JfRVFVQUxTEAISEAoMR1JFQVRF" + + "Ul9USEFOEAMSGgoWR1JFQVRFUl9USEFOX09SX0VRVUFMUxAEIiIKDVNvcnRE" + + "aXJlY3Rpb24SBwoDQVNDEAASCAoEREVTQxABIlcKBk9iamVjdBIKCgJpZBgB" + + "IAIoDBIMCgRkYXRhGAIgASgMEjMKCnN0YXRpc3RpY3MYAyADKAsyHy5ibmV0" + + "LnByb3RvY29sLnNlYXJjaC5TdGF0aXN0aWM="); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_bnet_protocol_search_Statistic__Descriptor = Descriptor.MessageTypes[0]; @@ -64,14 +69,20 @@ static SearchTypes() { } #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Statistic : pb::GeneratedMessage { - private static readonly Statistic defaultInstance = new Builder().BuildPartial(); + private Statistic() { } + private static readonly Statistic defaultInstance = new Statistic().MakeReadOnly(); + private static readonly string[] _statisticFieldNames = new string[] { "id", "value" }; + private static readonly uint[] _statisticFieldTags = new uint[] { 8, 16 }; public static Statistic DefaultInstance { get { return defaultInstance; } } public override Statistic DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override Statistic ThisMessage { @@ -88,17 +99,17 @@ protected override Statistic ThisMessage { public const int IdFieldNumber = 1; private bool hasId; - private uint id_ = 0; + private ulong id_; public bool HasId { get { return hasId; } } - public uint Id { + public ulong Id { get { return id_; } } public const int ValueFieldNumber = 2; private bool hasValue; - private int value_ = 0; + private int value_; public bool HasValue { get { return hasValue; } } @@ -113,13 +124,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasId) { - output.WriteUInt32(1, Id); + string[] field_names = _statisticFieldNames; + if (hasId) { + output.WriteUInt64(1, field_names[0], Id); } - if (HasValue) { - output.WriteInt32(2, Value); + if (hasValue) { + output.WriteInt32(2, field_names[1], Value); } UnknownFields.WriteTo(output); } @@ -131,10 +143,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasId) { - size += pb::CodedOutputStream.ComputeUInt32Size(1, Id); + if (hasId) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, Id); } - if (HasValue) { + if (hasValue) { size += pb::CodedOutputStream.ComputeInt32Size(2, Value); } size += UnknownFields.SerializedSize; @@ -167,38 +179,72 @@ public static Statistic ParseDelimitedFrom(global::System.IO.Stream input) { public static Statistic ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static Statistic ParseFrom(pb::CodedInputStream input) { + public static Statistic ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Statistic ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static Statistic ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private Statistic MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(Statistic prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Statistic cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - Statistic result = new Statistic(); + private bool resultIsReadOnly; + private Statistic result; + + private Statistic PrepareBuilder() { + if (resultIsReadOnly) { + Statistic original = result; + result = new Statistic(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override Statistic MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new Statistic(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -210,12 +256,11 @@ public override Statistic DefaultInstanceForType { } public override Statistic BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - Statistic returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -229,6 +274,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Statistic other) { if (other == global::bnet.protocol.search.Statistic.DefaultInstance) return this; + PrepareBuilder(); if (other.HasId) { Id = other.Id; } @@ -239,20 +285,31 @@ public override Builder MergeFrom(Statistic other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_statisticFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _statisticFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -264,53 +321,62 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 8: { - Id = input.ReadUInt32(); + result.hasId = input.ReadUInt64(ref result.id_); break; } case 16: { - Value = input.ReadInt32(); + result.hasValue = input.ReadInt32(ref result.value_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasId { - get { return result.HasId; } + get { return result.hasId; } } - public uint Id { + public ulong Id { get { return result.Id; } set { SetId(value); } } - public Builder SetId(uint value) { + public Builder SetId(ulong value) { + PrepareBuilder(); result.hasId = true; result.id_ = value; return this; } public Builder ClearId() { + PrepareBuilder(); result.hasId = false; - result.id_ = 0; + result.id_ = 0UL; return this; } public bool HasValue { - get { return result.HasValue; } + get { return result.hasValue; } } public int Value { get { return result.Value; } set { SetValue(value); } } public Builder SetValue(int value) { + PrepareBuilder(); result.hasValue = true; result.value_ = value; return this; } public Builder ClearValue() { + PrepareBuilder(); result.hasValue = false; result.value_ = 0; return this; @@ -321,14 +387,20 @@ static Statistic() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Filter : pb::GeneratedMessage { - private static readonly Filter defaultInstance = new Builder().BuildPartial(); + private Filter() { } + private static readonly Filter defaultInstance = new Filter().MakeReadOnly(); + private static readonly string[] _filterFieldNames = new string[] { "comparand", "sort_direction", "statistic" }; + private static readonly uint[] _filterFieldTags = new uint[] { 16, 24, 10 }; public static Filter DefaultInstance { get { return defaultInstance; } } public override Filter DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override Filter ThisMessage { @@ -344,7 +416,12 @@ protected override Filter ThisMessage { } #region Nested types + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public static class Types { + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public enum Comparand { EQUALS = 0, LESS_THAN = 1, @@ -353,6 +430,8 @@ public enum Comparand { GREATER_THAN_OR_EQUALS = 4, } + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public enum SortDirection { ASC = 0, DESC = 1, @@ -363,12 +442,12 @@ public enum SortDirection { public const int StatisticFieldNumber = 1; private bool hasStatistic; - private global::bnet.protocol.search.Statistic statistic_ = global::bnet.protocol.search.Statistic.DefaultInstance; + private global::bnet.protocol.search.Statistic statistic_; public bool HasStatistic { get { return hasStatistic; } } public global::bnet.protocol.search.Statistic Statistic { - get { return statistic_; } + get { return statistic_ ?? global::bnet.protocol.search.Statistic.DefaultInstance; } } public const int ComparandFieldNumber = 2; @@ -400,16 +479,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasStatistic) { - output.WriteMessage(1, Statistic); + string[] field_names = _filterFieldNames; + if (hasStatistic) { + output.WriteMessage(1, field_names[2], Statistic); } - if (HasComparand) { - output.WriteEnum(2, (int) Comparand); + if (hasComparand) { + output.WriteEnum(2, field_names[0], (int) Comparand, Comparand); } - if (HasSortDirection) { - output.WriteEnum(3, (int) SortDirection); + if (hasSortDirection) { + output.WriteEnum(3, field_names[1], (int) SortDirection, SortDirection); } UnknownFields.WriteTo(output); } @@ -421,13 +501,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasStatistic) { + if (hasStatistic) { size += pb::CodedOutputStream.ComputeMessageSize(1, Statistic); } - if (HasComparand) { + if (hasComparand) { size += pb::CodedOutputStream.ComputeEnumSize(2, (int) Comparand); } - if (HasSortDirection) { + if (hasSortDirection) { size += pb::CodedOutputStream.ComputeEnumSize(3, (int) SortDirection); } size += UnknownFields.SerializedSize; @@ -460,38 +540,72 @@ public static Filter ParseDelimitedFrom(global::System.IO.Stream input) { public static Filter ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static Filter ParseFrom(pb::CodedInputStream input) { + public static Filter ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Filter ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static Filter ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private Filter MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(Filter prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Filter cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Filter result; + + private Filter PrepareBuilder() { + if (resultIsReadOnly) { + Filter original = result; + result = new Filter(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - Filter result = new Filter(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override Filter MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new Filter(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -503,12 +617,11 @@ public override Filter DefaultInstanceForType { } public override Filter BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - Filter returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -522,6 +635,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Filter other) { if (other == global::bnet.protocol.search.Filter.DefaultInstance) return this; + PrepareBuilder(); if (other.HasStatistic) { MergeStatistic(other.Statistic); } @@ -535,20 +649,31 @@ public override Builder MergeFrom(Filter other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_filterFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _filterFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -560,12 +685,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.search.Statistic.Builder subBuilder = global::bnet.protocol.search.Statistic.CreateBuilder(); - if (HasStatistic) { + if (result.hasStatistic) { subBuilder.MergeFrom(Statistic); } input.ReadMessage(subBuilder, extensionRegistry); @@ -573,36 +698,41 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 16: { - int rawValue = input.ReadEnum(); - if (!global::System.Enum.IsDefined(typeof(global::bnet.protocol.search.Filter.Types.Comparand), rawValue)) { + object unknown; + if(input.ReadEnum(ref result.comparand_, out unknown)) { + result.hasComparand = true; + } else if(unknown is int) { if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - unknownFields.MergeVarintField(2, (ulong) rawValue); - } else { - Comparand = (global::bnet.protocol.search.Filter.Types.Comparand) rawValue; + unknownFields.MergeVarintField(2, (ulong)(int)unknown); } break; } case 24: { - int rawValue = input.ReadEnum(); - if (!global::System.Enum.IsDefined(typeof(global::bnet.protocol.search.Filter.Types.SortDirection), rawValue)) { + object unknown; + if(input.ReadEnum(ref result.sortDirection_, out unknown)) { + result.hasSortDirection = true; + } else if(unknown is int) { if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - unknownFields.MergeVarintField(3, (ulong) rawValue); - } else { - SortDirection = (global::bnet.protocol.search.Filter.Types.SortDirection) rawValue; + unknownFields.MergeVarintField(3, (ulong)(int)unknown); } break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasStatistic { - get { return result.HasStatistic; } + get { return result.hasStatistic; } } public global::bnet.protocol.search.Statistic Statistic { get { return result.Statistic; } @@ -610,19 +740,22 @@ public bool HasStatistic { } public Builder SetStatistic(global::bnet.protocol.search.Statistic value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasStatistic = true; result.statistic_ = value; return this; } public Builder SetStatistic(global::bnet.protocol.search.Statistic.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasStatistic = true; result.statistic_ = builderForValue.Build(); return this; } public Builder MergeStatistic(global::bnet.protocol.search.Statistic value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasStatistic && + PrepareBuilder(); + if (result.hasStatistic && result.statistic_ != global::bnet.protocol.search.Statistic.DefaultInstance) { result.statistic_ = global::bnet.protocol.search.Statistic.CreateBuilder(result.statistic_).MergeFrom(value).BuildPartial(); } else { @@ -632,42 +765,47 @@ public Builder MergeStatistic(global::bnet.protocol.search.Statistic value) { return this; } public Builder ClearStatistic() { + PrepareBuilder(); result.hasStatistic = false; - result.statistic_ = global::bnet.protocol.search.Statistic.DefaultInstance; + result.statistic_ = null; return this; } public bool HasComparand { - get { return result.HasComparand; } + get { return result.hasComparand; } } public global::bnet.protocol.search.Filter.Types.Comparand Comparand { get { return result.Comparand; } set { SetComparand(value); } } public Builder SetComparand(global::bnet.protocol.search.Filter.Types.Comparand value) { + PrepareBuilder(); result.hasComparand = true; result.comparand_ = value; return this; } public Builder ClearComparand() { + PrepareBuilder(); result.hasComparand = false; result.comparand_ = global::bnet.protocol.search.Filter.Types.Comparand.EQUALS; return this; } public bool HasSortDirection { - get { return result.HasSortDirection; } + get { return result.hasSortDirection; } } public global::bnet.protocol.search.Filter.Types.SortDirection SortDirection { get { return result.SortDirection; } set { SetSortDirection(value); } } public Builder SetSortDirection(global::bnet.protocol.search.Filter.Types.SortDirection value) { + PrepareBuilder(); result.hasSortDirection = true; result.sortDirection_ = value; return this; } public Builder ClearSortDirection() { + PrepareBuilder(); result.hasSortDirection = false; result.sortDirection_ = global::bnet.protocol.search.Filter.Types.SortDirection.ASC; return this; @@ -678,14 +816,20 @@ static Filter() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Object : pb::GeneratedMessage { - private static readonly Object defaultInstance = new Builder().BuildPartial(); + private Object() { } + private static readonly Object defaultInstance = new Object().MakeReadOnly(); + private static readonly string[] _objectFieldNames = new string[] { "data", "id", "statistics" }; + private static readonly uint[] _objectFieldTags = new uint[] { 18, 10, 26 }; public static Object DefaultInstance { get { return defaultInstance; } } public override Object DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override Object ThisMessage { @@ -742,16 +886,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasId) { - output.WriteBytes(1, Id); + string[] field_names = _objectFieldNames; + if (hasId) { + output.WriteBytes(1, field_names[1], Id); } - if (HasData) { - output.WriteBytes(2, Data); + if (hasData) { + output.WriteBytes(2, field_names[0], Data); } - foreach (global::bnet.protocol.search.Statistic element in StatisticsList) { - output.WriteMessage(3, element); + if (statistics_.Count > 0) { + output.WriteMessageArray(3, field_names[2], statistics_); } UnknownFields.WriteTo(output); } @@ -763,10 +908,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasId) { + if (hasId) { size += pb::CodedOutputStream.ComputeBytesSize(1, Id); } - if (HasData) { + if (hasData) { size += pb::CodedOutputStream.ComputeBytesSize(2, Data); } foreach (global::bnet.protocol.search.Statistic element in StatisticsList) { @@ -802,38 +947,73 @@ public static Object ParseDelimitedFrom(global::System.IO.Stream input) { public static Object ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static Object ParseFrom(pb::CodedInputStream input) { + public static Object ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Object ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static Object ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private Object MakeReadOnly() { + statistics_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(Object prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Object cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Object result; - Object result = new Object(); + private Object PrepareBuilder() { + if (resultIsReadOnly) { + Object original = result; + result = new Object(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override Object MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new Object(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -845,13 +1025,11 @@ public override Object DefaultInstanceForType { } public override Object BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.statistics_.MakeReadOnly(); - Object returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -865,6 +1043,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Object other) { if (other == global::bnet.protocol.search.Object.DefaultInstance) return this; + PrepareBuilder(); if (other.HasId) { Id = other.Id; } @@ -872,26 +1051,37 @@ public override Builder MergeFrom(Object other) { Data = other.Data; } if (other.statistics_.Count != 0) { - base.AddRange(other.statistics_, result.statistics_); + result.statistics_.Add(other.statistics_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_objectFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _objectFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -903,30 +1093,33 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { - Id = input.ReadBytes(); + result.hasId = input.ReadBytes(ref result.id_); break; } case 18: { - Data = input.ReadBytes(); + result.hasData = input.ReadBytes(ref result.data_); break; } case 26: { - global::bnet.protocol.search.Statistic.Builder subBuilder = global::bnet.protocol.search.Statistic.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddStatistics(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.statistics_, global::bnet.protocol.search.Statistic.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasId { - get { return result.HasId; } + get { return result.hasId; } } public pb::ByteString Id { get { return result.Id; } @@ -934,18 +1127,20 @@ public bool HasId { } public Builder SetId(pb::ByteString value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasId = true; result.id_ = value; return this; } public Builder ClearId() { + PrepareBuilder(); result.hasId = false; result.id_ = pb::ByteString.Empty; return this; } public bool HasData { - get { return result.HasData; } + get { return result.hasData; } } public pb::ByteString Data { get { return result.Data; } @@ -953,18 +1148,20 @@ public bool HasData { } public Builder SetData(pb::ByteString value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasData = true; result.data_ = value; return this; } public Builder ClearData() { + PrepareBuilder(); result.hasData = false; result.data_ = pb::ByteString.Empty; return this; } public pbc::IPopsicleList StatisticsList { - get { return result.statistics_; } + get { return PrepareBuilder().statistics_; } } public int StatisticsCount { get { return result.StatisticsCount; } @@ -974,29 +1171,35 @@ public int StatisticsCount { } public Builder SetStatistics(int index, global::bnet.protocol.search.Statistic value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.statistics_[index] = value; return this; } public Builder SetStatistics(int index, global::bnet.protocol.search.Statistic.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.statistics_[index] = builderForValue.Build(); return this; } public Builder AddStatistics(global::bnet.protocol.search.Statistic value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.statistics_.Add(value); return this; } public Builder AddStatistics(global::bnet.protocol.search.Statistic.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.statistics_.Add(builderForValue.Build()); return this; } public Builder AddRangeStatistics(scg::IEnumerable values) { - base.AddRange(values, result.statistics_); + PrepareBuilder(); + result.statistics_.Add(values); return this; } public Builder ClearStatistics() { + PrepareBuilder(); result.statistics_.Clear(); return this; } @@ -1009,3 +1212,5 @@ static Object() { #endregion } + +#endregion Designer generated code diff --git a/source/D3Proto/bnet/protocol/server_pool/ServerPool.cs b/src/LibMooNet/bnet/protocol/server_pool/ServerPoolService.cs similarity index 58% rename from source/D3Proto/bnet/protocol/server_pool/ServerPool.cs rename to src/LibMooNet/bnet/protocol/server_pool/ServerPoolService.cs index 14c36650..05e79409 100644 --- a/source/D3Proto/bnet/protocol/server_pool/ServerPool.cs +++ b/src/LibMooNet/bnet/protocol/server_pool/ServerPoolService.cs @@ -1,4 +1,6 @@ -// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=8fd7408b07f8d2cd. DO NOT EDIT! +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code using pb = global::Google.ProtocolBuffers; using pbc = global::Google.ProtocolBuffers.Collections; @@ -6,89 +8,105 @@ using scg = global::System.Collections.Generic; namespace bnet.protocol.server_pool { - public static partial class ServerPool { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_bnet_protocol_server_pool_GetLoadRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_server_pool_GetLoadRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_server_pool_ServerState__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_server_pool_ServerState__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_server_pool_ServerInfo__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_server_pool_ServerInfo__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_server_pool_PoolStateRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_server_pool_PoolStateRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_bnet_protocol_server_pool_PoolStateResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_server_pool_PoolStateResponse__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static ServerPool() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "CiVzZXJ2aWNlL3NlcnZlcl9wb29sL3NlcnZlcl9wb29sLnByb3RvEhlibmV0" + - "LnByb3RvY29sLnNlcnZlcl9wb29sGhxsaWIvcHJvdG9jb2wvYXR0cmlidXRl" + - "LnByb3RvGhFsaWIvcnBjL3JwYy5wcm90byIQCg5HZXRMb2FkUmVxdWVzdCJW" + - "CgtTZXJ2ZXJTdGF0ZRIXCgxjdXJyZW50X2xvYWQYASABKAI6ATESFQoKZ2Ft" + - "ZV9jb3VudBgCIAEoBToBMBIXCgxwbGF5ZXJfY291bnQYAyABKAU6ATAizgEK" + - "ClNlcnZlckluZm8SJgoEaG9zdBgBIAIoCzIYLmJuZXQucHJvdG9jb2wuUHJv" + - "Y2Vzc0lkEhYKB3JlcGxhY2UYAiABKAg6BWZhbHNlEjUKBXN0YXRlGAMgASgL" + - "MiYuYm5ldC5wcm90b2NvbC5zZXJ2ZXJfcG9vbC5TZXJ2ZXJTdGF0ZRI1Cglh" + - "dHRyaWJ1dGUYBCADKAsyIi5ibmV0LnByb3RvY29sLmF0dHJpYnV0ZS5BdHRy" + - "aWJ1dGUSEgoKcHJvZ3JhbV9pZBgFIAEoByISChBQb29sU3RhdGVSZXF1ZXN0" + - "IkgKEVBvb2xTdGF0ZVJlc3BvbnNlEjMKBGluZm8YASADKAsyJS5ibmV0LnBy" + - "b3RvY29sLnNlcnZlcl9wb29sLlNlcnZlckluZm8yfgoRU2VydmVyUG9vbFNl" + - "cnZpY2USaQoMR2V0UG9vbFN0YXRlEisuYm5ldC5wcm90b2NvbC5zZXJ2ZXJf" + - "cG9vbC5Qb29sU3RhdGVSZXF1ZXN0GiwuYm5ldC5wcm90b2NvbC5zZXJ2ZXJf" + - "cG9vbC5Qb29sU3RhdGVSZXNwb25zZUIDgAEB"); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_bnet_protocol_server_pool_GetLoadRequest__Descriptor = Descriptor.MessageTypes[0]; - internal__static_bnet_protocol_server_pool_GetLoadRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_server_pool_GetLoadRequest__Descriptor, - new string[] { }); - internal__static_bnet_protocol_server_pool_ServerState__Descriptor = Descriptor.MessageTypes[1]; - internal__static_bnet_protocol_server_pool_ServerState__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_server_pool_ServerState__Descriptor, - new string[] { "CurrentLoad", "GameCount", "PlayerCount", }); - internal__static_bnet_protocol_server_pool_ServerInfo__Descriptor = Descriptor.MessageTypes[2]; - internal__static_bnet_protocol_server_pool_ServerInfo__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_server_pool_ServerInfo__Descriptor, - new string[] { "Host", "Replace", "State", "Attribute", "ProgramId", }); - internal__static_bnet_protocol_server_pool_PoolStateRequest__Descriptor = Descriptor.MessageTypes[3]; - internal__static_bnet_protocol_server_pool_PoolStateRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_server_pool_PoolStateRequest__Descriptor, - new string[] { }); - internal__static_bnet_protocol_server_pool_PoolStateResponse__Descriptor = Descriptor.MessageTypes[4]; - internal__static_bnet_protocol_server_pool_PoolStateResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_server_pool_PoolStateResponse__Descriptor, - new string[] { "Info", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - global::bnet.protocol.attribute.Proto.Attribute.Descriptor, - global::bnet.protocol.Rpc.Descriptor, - }, assigner); - } - #endregion + namespace Proto { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class ServerPoolService { + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_bnet_protocol_server_pool_GetLoadRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_server_pool_GetLoadRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_server_pool_ServerState__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_server_pool_ServerState__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_server_pool_ServerInfo__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_server_pool_ServerInfo__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_server_pool_PoolStateRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_server_pool_PoolStateRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_server_pool_PoolStateResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_server_pool_PoolStateResponse__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static ServerPoolService() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "Ch5ibmV0L3NlcnZlcl9wb29sX3NlcnZpY2UucHJvdG8SGWJuZXQucHJvdG9j" + + "b2wuc2VydmVyX3Bvb2waFGJuZXQvYXR0cmlidXRlLnByb3RvGg5ibmV0L3Jw" + + "Yy5wcm90byIQCg5HZXRMb2FkUmVxdWVzdCJWCgtTZXJ2ZXJTdGF0ZRIXCgxj" + + "dXJyZW50X2xvYWQYASABKAI6ATESFQoKZ2FtZV9jb3VudBgCIAEoDToBMBIX" + + "CgxwbGF5ZXJfY291bnQYAyABKA06ATAizgEKClNlcnZlckluZm8SJgoEaG9z" + + "dBgBIAIoCzIYLmJuZXQucHJvdG9jb2wuUHJvY2Vzc0lkEhYKB3JlcGxhY2UY" + + "AiABKAg6BWZhbHNlEjUKBXN0YXRlGAMgASgLMiYuYm5ldC5wcm90b2NvbC5z" + + "ZXJ2ZXJfcG9vbC5TZXJ2ZXJTdGF0ZRI1CglhdHRyaWJ1dGUYBCADKAsyIi5i" + + "bmV0LnByb3RvY29sLmF0dHJpYnV0ZS5BdHRyaWJ1dGUSEgoKcHJvZ3JhbV9p" + + "ZBgFIAEoByISChBQb29sU3RhdGVSZXF1ZXN0IkgKEVBvb2xTdGF0ZVJlc3Bv" + + "bnNlEjMKBGluZm8YASADKAsyJS5ibmV0LnByb3RvY29sLnNlcnZlcl9wb29s" + + "LlNlcnZlckluZm8yhAEKEVNlcnZlclBvb2xTZXJ2aWNlEm8KDEdldFBvb2xT" + + "dGF0ZRIrLmJuZXQucHJvdG9jb2wuc2VydmVyX3Bvb2wuUG9vbFN0YXRlUmVx" + + "dWVzdBosLmJuZXQucHJvdG9jb2wuc2VydmVyX3Bvb2wuUG9vbFN0YXRlUmVz" + + "cG9uc2UiBIC1GAFCA4ABAA=="); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_bnet_protocol_server_pool_GetLoadRequest__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_server_pool_GetLoadRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_server_pool_GetLoadRequest__Descriptor, + new string[] { }); + internal__static_bnet_protocol_server_pool_ServerState__Descriptor = Descriptor.MessageTypes[1]; + internal__static_bnet_protocol_server_pool_ServerState__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_server_pool_ServerState__Descriptor, + new string[] { "CurrentLoad", "GameCount", "PlayerCount", }); + internal__static_bnet_protocol_server_pool_ServerInfo__Descriptor = Descriptor.MessageTypes[2]; + internal__static_bnet_protocol_server_pool_ServerInfo__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_server_pool_ServerInfo__Descriptor, + new string[] { "Host", "Replace", "State", "Attribute", "ProgramId", }); + internal__static_bnet_protocol_server_pool_PoolStateRequest__Descriptor = Descriptor.MessageTypes[3]; + internal__static_bnet_protocol_server_pool_PoolStateRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_server_pool_PoolStateRequest__Descriptor, + new string[] { }); + internal__static_bnet_protocol_server_pool_PoolStateResponse__Descriptor = Descriptor.MessageTypes[4]; + internal__static_bnet_protocol_server_pool_PoolStateResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_server_pool_PoolStateResponse__Descriptor, + new string[] { "Info", }); + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + RegisterAllExtensions(registry); + global::bnet.protocol.attribute.Proto.Attribute.RegisterAllExtensions(registry); + global::bnet.protocol.Rpc.RegisterAllExtensions(registry); + return registry; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::bnet.protocol.attribute.Proto.Attribute.Descriptor, + global::bnet.protocol.Rpc.Descriptor, + }, assigner); + } + #endregion + + } } #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class GetLoadRequest : pb::GeneratedMessage { - private static readonly GetLoadRequest defaultInstance = new Builder().BuildPartial(); + private GetLoadRequest() { } + private static readonly GetLoadRequest defaultInstance = new GetLoadRequest().MakeReadOnly(); + private static readonly string[] _getLoadRequestFieldNames = new string[] { }; + private static readonly uint[] _getLoadRequestFieldTags = new uint[] { }; public static GetLoadRequest DefaultInstance { get { return defaultInstance; } } public override GetLoadRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override GetLoadRequest ThisMessage { @@ -96,11 +114,11 @@ protected override GetLoadRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.server_pool.ServerPool.internal__static_bnet_protocol_server_pool_GetLoadRequest__Descriptor; } + get { return global::bnet.protocol.server_pool.Proto.ServerPoolService.internal__static_bnet_protocol_server_pool_GetLoadRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.server_pool.ServerPool.internal__static_bnet_protocol_server_pool_GetLoadRequest__FieldAccessorTable; } + get { return global::bnet.protocol.server_pool.Proto.ServerPoolService.internal__static_bnet_protocol_server_pool_GetLoadRequest__FieldAccessorTable; } } public override bool IsInitialized { @@ -109,8 +127,9 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; + string[] field_names = _getLoadRequestFieldNames; UnknownFields.WriteTo(output); } @@ -151,38 +170,72 @@ public static GetLoadRequest ParseDelimitedFrom(global::System.IO.Stream input) public static GetLoadRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static GetLoadRequest ParseFrom(pb::CodedInputStream input) { + public static GetLoadRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static GetLoadRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static GetLoadRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private GetLoadRequest MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(GetLoadRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetLoadRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - GetLoadRequest result = new GetLoadRequest(); + private bool resultIsReadOnly; + private GetLoadRequest result; + + private GetLoadRequest PrepareBuilder() { + if (resultIsReadOnly) { + GetLoadRequest original = result; + result = new GetLoadRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override GetLoadRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new GetLoadRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -194,12 +247,11 @@ public override GetLoadRequest DefaultInstanceForType { } public override GetLoadRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - GetLoadRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -213,24 +265,36 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(GetLoadRequest other) { if (other == global::bnet.protocol.server_pool.GetLoadRequest.DefaultInstance) return this; + PrepareBuilder(); this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getLoadRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getLoadRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -242,27 +306,38 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } } static GetLoadRequest() { - object.ReferenceEquals(global::bnet.protocol.server_pool.ServerPool.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.server_pool.Proto.ServerPoolService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class ServerState : pb::GeneratedMessage { - private static readonly ServerState defaultInstance = new Builder().BuildPartial(); + private ServerState() { } + private static readonly ServerState defaultInstance = new ServerState().MakeReadOnly(); + private static readonly string[] _serverStateFieldNames = new string[] { "current_load", "game_count", "player_count" }; + private static readonly uint[] _serverStateFieldTags = new uint[] { 13, 16, 24 }; public static ServerState DefaultInstance { get { return defaultInstance; } } public override ServerState DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ServerState ThisMessage { @@ -270,11 +345,11 @@ protected override ServerState ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.server_pool.ServerPool.internal__static_bnet_protocol_server_pool_ServerState__Descriptor; } + get { return global::bnet.protocol.server_pool.Proto.ServerPoolService.internal__static_bnet_protocol_server_pool_ServerState__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.server_pool.ServerPool.internal__static_bnet_protocol_server_pool_ServerState__FieldAccessorTable; } + get { return global::bnet.protocol.server_pool.Proto.ServerPoolService.internal__static_bnet_protocol_server_pool_ServerState__FieldAccessorTable; } } public const int CurrentLoadFieldNumber = 1; @@ -289,21 +364,21 @@ public float CurrentLoad { public const int GameCountFieldNumber = 2; private bool hasGameCount; - private int gameCount_ = 0; + private uint gameCount_; public bool HasGameCount { get { return hasGameCount; } } - public int GameCount { + public uint GameCount { get { return gameCount_; } } public const int PlayerCountFieldNumber = 3; private bool hasPlayerCount; - private int playerCount_ = 0; + private uint playerCount_; public bool HasPlayerCount { get { return hasPlayerCount; } } - public int PlayerCount { + public uint PlayerCount { get { return playerCount_; } } @@ -313,16 +388,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasCurrentLoad) { - output.WriteFloat(1, CurrentLoad); + string[] field_names = _serverStateFieldNames; + if (hasCurrentLoad) { + output.WriteFloat(1, field_names[0], CurrentLoad); } - if (HasGameCount) { - output.WriteInt32(2, GameCount); + if (hasGameCount) { + output.WriteUInt32(2, field_names[1], GameCount); } - if (HasPlayerCount) { - output.WriteInt32(3, PlayerCount); + if (hasPlayerCount) { + output.WriteUInt32(3, field_names[2], PlayerCount); } UnknownFields.WriteTo(output); } @@ -334,14 +410,14 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasCurrentLoad) { + if (hasCurrentLoad) { size += pb::CodedOutputStream.ComputeFloatSize(1, CurrentLoad); } - if (HasGameCount) { - size += pb::CodedOutputStream.ComputeInt32Size(2, GameCount); + if (hasGameCount) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, GameCount); } - if (HasPlayerCount) { - size += pb::CodedOutputStream.ComputeInt32Size(3, PlayerCount); + if (hasPlayerCount) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, PlayerCount); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -373,38 +449,72 @@ public static ServerState ParseDelimitedFrom(global::System.IO.Stream input) { public static ServerState ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static ServerState ParseFrom(pb::CodedInputStream input) { + public static ServerState ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ServerState ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static ServerState ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private ServerState MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(ServerState prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ServerState cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - ServerState result = new ServerState(); + private bool resultIsReadOnly; + private ServerState result; + + private ServerState PrepareBuilder() { + if (resultIsReadOnly) { + ServerState original = result; + result = new ServerState(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override ServerState MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ServerState(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -416,12 +526,11 @@ public override ServerState DefaultInstanceForType { } public override ServerState BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - ServerState returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -435,6 +544,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(ServerState other) { if (other == global::bnet.protocol.server_pool.ServerState.DefaultInstance) return this; + PrepareBuilder(); if (other.HasCurrentLoad) { CurrentLoad = other.CurrentLoad; } @@ -448,20 +558,31 @@ public override Builder MergeFrom(ServerState other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_serverStateFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _serverStateFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -473,93 +594,110 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 13: { - CurrentLoad = input.ReadFloat(); + result.hasCurrentLoad = input.ReadFloat(ref result.currentLoad_); break; } case 16: { - GameCount = input.ReadInt32(); + result.hasGameCount = input.ReadUInt32(ref result.gameCount_); break; } case 24: { - PlayerCount = input.ReadInt32(); + result.hasPlayerCount = input.ReadUInt32(ref result.playerCount_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasCurrentLoad { - get { return result.HasCurrentLoad; } + get { return result.hasCurrentLoad; } } public float CurrentLoad { get { return result.CurrentLoad; } set { SetCurrentLoad(value); } } public Builder SetCurrentLoad(float value) { + PrepareBuilder(); result.hasCurrentLoad = true; result.currentLoad_ = value; return this; } public Builder ClearCurrentLoad() { + PrepareBuilder(); result.hasCurrentLoad = false; result.currentLoad_ = 1F; return this; } public bool HasGameCount { - get { return result.HasGameCount; } + get { return result.hasGameCount; } } - public int GameCount { + public uint GameCount { get { return result.GameCount; } set { SetGameCount(value); } } - public Builder SetGameCount(int value) { + public Builder SetGameCount(uint value) { + PrepareBuilder(); result.hasGameCount = true; result.gameCount_ = value; return this; } public Builder ClearGameCount() { + PrepareBuilder(); result.hasGameCount = false; result.gameCount_ = 0; return this; } public bool HasPlayerCount { - get { return result.HasPlayerCount; } + get { return result.hasPlayerCount; } } - public int PlayerCount { + public uint PlayerCount { get { return result.PlayerCount; } set { SetPlayerCount(value); } } - public Builder SetPlayerCount(int value) { + public Builder SetPlayerCount(uint value) { + PrepareBuilder(); result.hasPlayerCount = true; result.playerCount_ = value; return this; } public Builder ClearPlayerCount() { + PrepareBuilder(); result.hasPlayerCount = false; result.playerCount_ = 0; return this; } } static ServerState() { - object.ReferenceEquals(global::bnet.protocol.server_pool.ServerPool.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.server_pool.Proto.ServerPoolService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class ServerInfo : pb::GeneratedMessage { - private static readonly ServerInfo defaultInstance = new Builder().BuildPartial(); + private ServerInfo() { } + private static readonly ServerInfo defaultInstance = new ServerInfo().MakeReadOnly(); + private static readonly string[] _serverInfoFieldNames = new string[] { "attribute", "host", "program_id", "replace", "state" }; + private static readonly uint[] _serverInfoFieldTags = new uint[] { 34, 10, 45, 16, 26 }; public static ServerInfo DefaultInstance { get { return defaultInstance; } } public override ServerInfo DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ServerInfo ThisMessage { @@ -567,26 +705,26 @@ protected override ServerInfo ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.server_pool.ServerPool.internal__static_bnet_protocol_server_pool_ServerInfo__Descriptor; } + get { return global::bnet.protocol.server_pool.Proto.ServerPoolService.internal__static_bnet_protocol_server_pool_ServerInfo__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.server_pool.ServerPool.internal__static_bnet_protocol_server_pool_ServerInfo__FieldAccessorTable; } + get { return global::bnet.protocol.server_pool.Proto.ServerPoolService.internal__static_bnet_protocol_server_pool_ServerInfo__FieldAccessorTable; } } public const int HostFieldNumber = 1; private bool hasHost; - private global::bnet.protocol.ProcessId host_ = global::bnet.protocol.ProcessId.DefaultInstance; + private global::bnet.protocol.ProcessId host_; public bool HasHost { get { return hasHost; } } public global::bnet.protocol.ProcessId Host { - get { return host_; } + get { return host_ ?? global::bnet.protocol.ProcessId.DefaultInstance; } } public const int ReplaceFieldNumber = 2; private bool hasReplace; - private bool replace_ = false; + private bool replace_; public bool HasReplace { get { return hasReplace; } } @@ -596,12 +734,12 @@ public bool Replace { public const int StateFieldNumber = 3; private bool hasState; - private global::bnet.protocol.server_pool.ServerState state_ = global::bnet.protocol.server_pool.ServerState.DefaultInstance; + private global::bnet.protocol.server_pool.ServerState state_; public bool HasState { get { return hasState; } } public global::bnet.protocol.server_pool.ServerState State { - get { return state_; } + get { return state_ ?? global::bnet.protocol.server_pool.ServerState.DefaultInstance; } } public const int AttributeFieldNumber = 4; @@ -618,7 +756,7 @@ public int AttributeCount { public const int ProgramIdFieldNumber = 5; private bool hasProgramId; - private uint programId_ = 0; + private uint programId_; public bool HasProgramId { get { return hasProgramId; } } @@ -637,22 +775,23 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasHost) { - output.WriteMessage(1, Host); + string[] field_names = _serverInfoFieldNames; + if (hasHost) { + output.WriteMessage(1, field_names[1], Host); } - if (HasReplace) { - output.WriteBool(2, Replace); + if (hasReplace) { + output.WriteBool(2, field_names[3], Replace); } - if (HasState) { - output.WriteMessage(3, State); + if (hasState) { + output.WriteMessage(3, field_names[4], State); } - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - output.WriteMessage(4, element); + if (attribute_.Count > 0) { + output.WriteMessageArray(4, field_names[0], attribute_); } - if (HasProgramId) { - output.WriteFixed32(5, ProgramId); + if (hasProgramId) { + output.WriteFixed32(5, field_names[2], ProgramId); } UnknownFields.WriteTo(output); } @@ -664,19 +803,19 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasHost) { + if (hasHost) { size += pb::CodedOutputStream.ComputeMessageSize(1, Host); } - if (HasReplace) { + if (hasReplace) { size += pb::CodedOutputStream.ComputeBoolSize(2, Replace); } - if (HasState) { + if (hasState) { size += pb::CodedOutputStream.ComputeMessageSize(3, State); } foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { size += pb::CodedOutputStream.ComputeMessageSize(4, element); } - if (HasProgramId) { + if (hasProgramId) { size += pb::CodedOutputStream.ComputeFixed32Size(5, ProgramId); } size += UnknownFields.SerializedSize; @@ -709,38 +848,73 @@ public static ServerInfo ParseDelimitedFrom(global::System.IO.Stream input) { public static ServerInfo ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static ServerInfo ParseFrom(pb::CodedInputStream input) { + public static ServerInfo ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ServerInfo ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static ServerInfo ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private ServerInfo MakeReadOnly() { + attribute_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(ServerInfo prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ServerInfo cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - ServerInfo result = new ServerInfo(); + private bool resultIsReadOnly; + private ServerInfo result; + + private ServerInfo PrepareBuilder() { + if (resultIsReadOnly) { + ServerInfo original = result; + result = new ServerInfo(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override ServerInfo MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ServerInfo(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -752,13 +926,11 @@ public override ServerInfo DefaultInstanceForType { } public override ServerInfo BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.attribute_.MakeReadOnly(); - ServerInfo returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -772,6 +944,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(ServerInfo other) { if (other == global::bnet.protocol.server_pool.ServerInfo.DefaultInstance) return this; + PrepareBuilder(); if (other.HasHost) { MergeHost(other.Host); } @@ -782,7 +955,7 @@ public override Builder MergeFrom(ServerInfo other) { MergeState(other.State); } if (other.attribute_.Count != 0) { - base.AddRange(other.attribute_, result.attribute_); + result.attribute_.Add(other.attribute_); } if (other.HasProgramId) { ProgramId = other.ProgramId; @@ -791,20 +964,31 @@ public override Builder MergeFrom(ServerInfo other) { return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_serverInfoFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _serverInfoFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -816,12 +1000,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { global::bnet.protocol.ProcessId.Builder subBuilder = global::bnet.protocol.ProcessId.CreateBuilder(); - if (HasHost) { + if (result.hasHost) { subBuilder.MergeFrom(Host); } input.ReadMessage(subBuilder, extensionRegistry); @@ -829,12 +1013,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 16: { - Replace = input.ReadBool(); + result.hasReplace = input.ReadBool(ref result.replace_); break; } case 26: { global::bnet.protocol.server_pool.ServerState.Builder subBuilder = global::bnet.protocol.server_pool.ServerState.CreateBuilder(); - if (HasState) { + if (result.hasState) { subBuilder.MergeFrom(State); } input.ReadMessage(subBuilder, extensionRegistry); @@ -842,22 +1026,25 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 34: { - global::bnet.protocol.attribute.Attribute.Builder subBuilder = global::bnet.protocol.attribute.Attribute.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddAttribute(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.attribute_, global::bnet.protocol.attribute.Attribute.DefaultInstance, extensionRegistry); break; } case 45: { - ProgramId = input.ReadFixed32(); + result.hasProgramId = input.ReadFixed32(ref result.programId_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasHost { - get { return result.HasHost; } + get { return result.hasHost; } } public global::bnet.protocol.ProcessId Host { get { return result.Host; } @@ -865,19 +1052,22 @@ public bool HasHost { } public Builder SetHost(global::bnet.protocol.ProcessId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasHost = true; result.host_ = value; return this; } public Builder SetHost(global::bnet.protocol.ProcessId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasHost = true; result.host_ = builderForValue.Build(); return this; } public Builder MergeHost(global::bnet.protocol.ProcessId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasHost && + PrepareBuilder(); + if (result.hasHost && result.host_ != global::bnet.protocol.ProcessId.DefaultInstance) { result.host_ = global::bnet.protocol.ProcessId.CreateBuilder(result.host_).MergeFrom(value).BuildPartial(); } else { @@ -887,31 +1077,34 @@ public Builder MergeHost(global::bnet.protocol.ProcessId value) { return this; } public Builder ClearHost() { + PrepareBuilder(); result.hasHost = false; - result.host_ = global::bnet.protocol.ProcessId.DefaultInstance; + result.host_ = null; return this; } public bool HasReplace { - get { return result.HasReplace; } + get { return result.hasReplace; } } public bool Replace { get { return result.Replace; } set { SetReplace(value); } } public Builder SetReplace(bool value) { + PrepareBuilder(); result.hasReplace = true; result.replace_ = value; return this; } public Builder ClearReplace() { + PrepareBuilder(); result.hasReplace = false; result.replace_ = false; return this; } public bool HasState { - get { return result.HasState; } + get { return result.hasState; } } public global::bnet.protocol.server_pool.ServerState State { get { return result.State; } @@ -919,19 +1112,22 @@ public bool HasState { } public Builder SetState(global::bnet.protocol.server_pool.ServerState value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasState = true; result.state_ = value; return this; } public Builder SetState(global::bnet.protocol.server_pool.ServerState.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hasState = true; result.state_ = builderForValue.Build(); return this; } public Builder MergeState(global::bnet.protocol.server_pool.ServerState value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasState && + PrepareBuilder(); + if (result.hasState && result.state_ != global::bnet.protocol.server_pool.ServerState.DefaultInstance) { result.state_ = global::bnet.protocol.server_pool.ServerState.CreateBuilder(result.state_).MergeFrom(value).BuildPartial(); } else { @@ -941,13 +1137,14 @@ public Builder MergeState(global::bnet.protocol.server_pool.ServerState value) { return this; } public Builder ClearState() { + PrepareBuilder(); result.hasState = false; - result.state_ = global::bnet.protocol.server_pool.ServerState.DefaultInstance; + result.state_ = null; return this; } public pbc::IPopsicleList AttributeList { - get { return result.attribute_; } + get { return PrepareBuilder().attribute_; } } public int AttributeCount { get { return result.AttributeCount; } @@ -957,64 +1154,78 @@ public int AttributeCount { } public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.attribute_[index] = value; return this; } public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.attribute_[index] = builderForValue.Build(); return this; } public Builder AddAttribute(global::bnet.protocol.attribute.Attribute value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.attribute_.Add(value); return this; } public Builder AddAttribute(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.attribute_.Add(builderForValue.Build()); return this; } public Builder AddRangeAttribute(scg::IEnumerable values) { - base.AddRange(values, result.attribute_); + PrepareBuilder(); + result.attribute_.Add(values); return this; } public Builder ClearAttribute() { + PrepareBuilder(); result.attribute_.Clear(); return this; } public bool HasProgramId { - get { return result.HasProgramId; } + get { return result.hasProgramId; } } public uint ProgramId { get { return result.ProgramId; } set { SetProgramId(value); } } public Builder SetProgramId(uint value) { + PrepareBuilder(); result.hasProgramId = true; result.programId_ = value; return this; } public Builder ClearProgramId() { + PrepareBuilder(); result.hasProgramId = false; result.programId_ = 0; return this; } } static ServerInfo() { - object.ReferenceEquals(global::bnet.protocol.server_pool.ServerPool.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.server_pool.Proto.ServerPoolService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class PoolStateRequest : pb::GeneratedMessage { - private static readonly PoolStateRequest defaultInstance = new Builder().BuildPartial(); + private PoolStateRequest() { } + private static readonly PoolStateRequest defaultInstance = new PoolStateRequest().MakeReadOnly(); + private static readonly string[] _poolStateRequestFieldNames = new string[] { }; + private static readonly uint[] _poolStateRequestFieldTags = new uint[] { }; public static PoolStateRequest DefaultInstance { get { return defaultInstance; } } public override PoolStateRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override PoolStateRequest ThisMessage { @@ -1022,11 +1233,11 @@ protected override PoolStateRequest ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.server_pool.ServerPool.internal__static_bnet_protocol_server_pool_PoolStateRequest__Descriptor; } + get { return global::bnet.protocol.server_pool.Proto.ServerPoolService.internal__static_bnet_protocol_server_pool_PoolStateRequest__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.server_pool.ServerPool.internal__static_bnet_protocol_server_pool_PoolStateRequest__FieldAccessorTable; } + get { return global::bnet.protocol.server_pool.Proto.ServerPoolService.internal__static_bnet_protocol_server_pool_PoolStateRequest__FieldAccessorTable; } } public override bool IsInitialized { @@ -1035,8 +1246,9 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; + string[] field_names = _poolStateRequestFieldNames; UnknownFields.WriteTo(output); } @@ -1077,38 +1289,72 @@ public static PoolStateRequest ParseDelimitedFrom(global::System.IO.Stream input public static PoolStateRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static PoolStateRequest ParseFrom(pb::CodedInputStream input) { + public static PoolStateRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static PoolStateRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static PoolStateRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private PoolStateRequest MakeReadOnly() { + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(PoolStateRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(PoolStateRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private PoolStateRequest result; + + private PoolStateRequest PrepareBuilder() { + if (resultIsReadOnly) { + PoolStateRequest original = result; + result = new PoolStateRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - PoolStateRequest result = new PoolStateRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override PoolStateRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new PoolStateRequest(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -1120,12 +1366,11 @@ public override PoolStateRequest DefaultInstanceForType { } public override PoolStateRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - PoolStateRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1139,24 +1384,36 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(PoolStateRequest other) { if (other == global::bnet.protocol.server_pool.PoolStateRequest.DefaultInstance) return this; + PrepareBuilder(); this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_poolStateRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _poolStateRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1168,27 +1425,38 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } } static PoolStateRequest() { - object.ReferenceEquals(global::bnet.protocol.server_pool.ServerPool.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.server_pool.Proto.ServerPoolService.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class PoolStateResponse : pb::GeneratedMessage { - private static readonly PoolStateResponse defaultInstance = new Builder().BuildPartial(); + private PoolStateResponse() { } + private static readonly PoolStateResponse defaultInstance = new PoolStateResponse().MakeReadOnly(); + private static readonly string[] _poolStateResponseFieldNames = new string[] { "info" }; + private static readonly uint[] _poolStateResponseFieldTags = new uint[] { 10 }; public static PoolStateResponse DefaultInstance { get { return defaultInstance; } } public override PoolStateResponse DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override PoolStateResponse ThisMessage { @@ -1196,11 +1464,11 @@ protected override PoolStateResponse ThisMessage { } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.server_pool.ServerPool.internal__static_bnet_protocol_server_pool_PoolStateResponse__Descriptor; } + get { return global::bnet.protocol.server_pool.Proto.ServerPoolService.internal__static_bnet_protocol_server_pool_PoolStateResponse__Descriptor; } } protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.server_pool.ServerPool.internal__static_bnet_protocol_server_pool_PoolStateResponse__FieldAccessorTable; } + get { return global::bnet.protocol.server_pool.Proto.ServerPoolService.internal__static_bnet_protocol_server_pool_PoolStateResponse__FieldAccessorTable; } } public const int InfoFieldNumber = 1; @@ -1224,10 +1492,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - foreach (global::bnet.protocol.server_pool.ServerInfo element in InfoList) { - output.WriteMessage(1, element); + string[] field_names = _poolStateResponseFieldNames; + if (info_.Count > 0) { + output.WriteMessageArray(1, field_names[0], info_); } UnknownFields.WriteTo(output); } @@ -1272,38 +1541,73 @@ public static PoolStateResponse ParseDelimitedFrom(global::System.IO.Stream inpu public static PoolStateResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static PoolStateResponse ParseFrom(pb::CodedInputStream input) { + public static PoolStateResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static PoolStateResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static PoolStateResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private PoolStateResponse MakeReadOnly() { + info_.MakeReadOnly(); + return this; + } + public static Builder CreateBuilder() { return new Builder(); } public override Builder ToBuilder() { return CreateBuilder(this); } public override Builder CreateBuilderForType() { return new Builder(); } public static Builder CreateBuilder(PoolStateResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Builder : pb::GeneratedBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(PoolStateResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private PoolStateResponse result; + + private PoolStateResponse PrepareBuilder() { + if (resultIsReadOnly) { + PoolStateResponse original = result; + result = new PoolStateResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - PoolStateResponse result = new PoolStateResponse(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override PoolStateResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new PoolStateResponse(); + result = DefaultInstance; + resultIsReadOnly = true; return this; } public override Builder Clone() { - return new Builder().MergeFrom(result); + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } public override pbd::MessageDescriptor DescriptorForType { @@ -1315,13 +1619,11 @@ public override PoolStateResponse DefaultInstanceForType { } public override PoolStateResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.info_.MakeReadOnly(); - PoolStateResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1335,27 +1637,39 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(PoolStateResponse other) { if (other == global::bnet.protocol.server_pool.PoolStateResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.info_.Count != 0) { - base.AddRange(other.info_, result.info_); + result.info_.Add(other.info_); } this.MergeUnknownFields(other.UnknownFields); return this; } - public override Builder MergeFrom(pb::CodedInputStream input) { + public override Builder MergeFrom(pb::ICodedInputStream input) { return MergeFrom(input, pb::ExtensionRegistry.Empty); } - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_poolStateResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _poolStateResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } switch (tag) { case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1367,22 +1681,25 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } case 10: { - global::bnet.protocol.server_pool.ServerInfo.Builder subBuilder = global::bnet.protocol.server_pool.ServerInfo.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddInfo(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.info_, global::bnet.protocol.server_pool.ServerInfo.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public pbc::IPopsicleList InfoList { - get { return result.info_; } + get { return PrepareBuilder().info_; } } public int InfoCount { get { return result.InfoCount; } @@ -1392,41 +1709,50 @@ public int InfoCount { } public Builder SetInfo(int index, global::bnet.protocol.server_pool.ServerInfo value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.info_[index] = value; return this; } public Builder SetInfo(int index, global::bnet.protocol.server_pool.ServerInfo.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.info_[index] = builderForValue.Build(); return this; } public Builder AddInfo(global::bnet.protocol.server_pool.ServerInfo value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.info_.Add(value); return this; } public Builder AddInfo(global::bnet.protocol.server_pool.ServerInfo.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.info_.Add(builderForValue.Build()); return this; } public Builder AddRangeInfo(scg::IEnumerable values) { - base.AddRange(values, result.info_); + PrepareBuilder(); + result.info_.Add(values); return this; } public Builder ClearInfo() { + PrepareBuilder(); result.info_.Clear(); return this; } } static PoolStateResponse() { - object.ReferenceEquals(global::bnet.protocol.server_pool.ServerPool.Descriptor, null); + object.ReferenceEquals(global::bnet.protocol.server_pool.Proto.ServerPoolService.Descriptor, null); } } #endregion #region Services + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public abstract class ServerPoolService : pb::IService { public abstract void GetPoolState( pb::IRpcController controller, @@ -1434,7 +1760,7 @@ public abstract void GetPoolState( global::System.Action done); public static pbd::ServiceDescriptor Descriptor { - get { return ServerPool.Descriptor.Services[0]; } + get { return Proto.ServerPoolService.Descriptor.Services[0]; } } public pbd::ServiceDescriptor DescriptorForType { get { return Descriptor; } @@ -1490,6 +1816,9 @@ public static Stub CreateStub(pb::IRpcChannel channel) { return new Stub(channel); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public class Stub : global::bnet.protocol.server_pool.ServerPoolService { internal Stub(pb::IRpcChannel channel) { this.channel = channel; @@ -1514,3 +1843,5 @@ public override void GetPoolState( #endregion } + +#endregion Designer generated code diff --git a/src/LibMooNet/bnet/protocol/session/SessionService.cs b/src/LibMooNet/bnet/protocol/session/SessionService.cs new file mode 100644 index 00000000..c13e50f9 --- /dev/null +++ b/src/LibMooNet/bnet/protocol/session/SessionService.cs @@ -0,0 +1,696 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace bnet.protocol.session { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class SessionService { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_bnet_protocol_session_SessionNotification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_session_SessionNotification__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static SessionService() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "ChpibmV0L3Nlc3Npb25fc2VydmljZS5wcm90bxIVYm5ldC5wcm90b2NvbC5z" + + "ZXNzaW9uGhRibmV0L2F0dHJpYnV0ZS5wcm90bxoOYm5ldC9ycGMucHJvdG8a" + + "EWJuZXQvZW50aXR5LnByb3RvItUBChNTZXNzaW9uTm90aWZpY2F0aW9uEhQK" + + "DHNlc3Npb25fdHlwZRgBIAIoDRIcChRleHBpcmF0aW9uX3RpbWVzdGFtcBgC" + + "IAEoBhIZChFtaW51dGVzX3JlbWFpbmluZxgDIAEoDRIbChNjYWlzX3BsYXll" + + "ZF9taW51dGVzGAQgASgNEhsKE2NhaXNfcmVzdGVkX21pbnV0ZXMYBSABKA0S" + + "EgoKYmVuZWZhY3RvchgGIAEoCBIhChliaWxsaW5nX21pbnV0ZXNfcmVtYWlu" + + "aW5nGAcgASgNMmcKDVNlc3Npb25Ob3RpZnkSVgoGVXBkYXRlEiouYm5ldC5w" + + "cm90b2NvbC5zZXNzaW9uLlNlc3Npb25Ob3RpZmljYXRpb24aGi5ibmV0LnBy" + + "b3RvY29sLk5PX1JFU1BPTlNFIgSAtRgBQgOAAQA="); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_bnet_protocol_session_SessionNotification__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_session_SessionNotification__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_session_SessionNotification__Descriptor, + new string[] { "SessionType", "ExpirationTimestamp", "MinutesRemaining", "CaisPlayedMinutes", "CaisRestedMinutes", "Benefactor", "BillingMinutesRemaining", }); + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + RegisterAllExtensions(registry); + global::bnet.protocol.attribute.Proto.Attribute.RegisterAllExtensions(registry); + global::bnet.protocol.Rpc.RegisterAllExtensions(registry); + global::bnet.protocol.Entity.RegisterAllExtensions(registry); + return registry; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::bnet.protocol.attribute.Proto.Attribute.Descriptor, + global::bnet.protocol.Rpc.Descriptor, + global::bnet.protocol.Entity.Descriptor, + }, assigner); + } + #endregion + + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class SessionNotification : pb::GeneratedMessage { + private SessionNotification() { } + private static readonly SessionNotification defaultInstance = new SessionNotification().MakeReadOnly(); + private static readonly string[] _sessionNotificationFieldNames = new string[] { "benefactor", "billing_minutes_remaining", "cais_played_minutes", "cais_rested_minutes", "expiration_timestamp", "minutes_remaining", "session_type" }; + private static readonly uint[] _sessionNotificationFieldTags = new uint[] { 48, 56, 32, 40, 17, 24, 8 }; + public static SessionNotification DefaultInstance { + get { return defaultInstance; } + } + + public override SessionNotification DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SessionNotification ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.session.SessionService.internal__static_bnet_protocol_session_SessionNotification__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.session.SessionService.internal__static_bnet_protocol_session_SessionNotification__FieldAccessorTable; } + } + + public const int SessionTypeFieldNumber = 1; + private bool hasSessionType; + private uint sessionType_; + public bool HasSessionType { + get { return hasSessionType; } + } + public uint SessionType { + get { return sessionType_; } + } + + public const int ExpirationTimestampFieldNumber = 2; + private bool hasExpirationTimestamp; + private ulong expirationTimestamp_; + public bool HasExpirationTimestamp { + get { return hasExpirationTimestamp; } + } + public ulong ExpirationTimestamp { + get { return expirationTimestamp_; } + } + + public const int MinutesRemainingFieldNumber = 3; + private bool hasMinutesRemaining; + private uint minutesRemaining_; + public bool HasMinutesRemaining { + get { return hasMinutesRemaining; } + } + public uint MinutesRemaining { + get { return minutesRemaining_; } + } + + public const int CaisPlayedMinutesFieldNumber = 4; + private bool hasCaisPlayedMinutes; + private uint caisPlayedMinutes_; + public bool HasCaisPlayedMinutes { + get { return hasCaisPlayedMinutes; } + } + public uint CaisPlayedMinutes { + get { return caisPlayedMinutes_; } + } + + public const int CaisRestedMinutesFieldNumber = 5; + private bool hasCaisRestedMinutes; + private uint caisRestedMinutes_; + public bool HasCaisRestedMinutes { + get { return hasCaisRestedMinutes; } + } + public uint CaisRestedMinutes { + get { return caisRestedMinutes_; } + } + + public const int BenefactorFieldNumber = 6; + private bool hasBenefactor; + private bool benefactor_; + public bool HasBenefactor { + get { return hasBenefactor; } + } + public bool Benefactor { + get { return benefactor_; } + } + + public const int BillingMinutesRemainingFieldNumber = 7; + private bool hasBillingMinutesRemaining; + private uint billingMinutesRemaining_; + public bool HasBillingMinutesRemaining { + get { return hasBillingMinutesRemaining; } + } + public uint BillingMinutesRemaining { + get { return billingMinutesRemaining_; } + } + + public override bool IsInitialized { + get { + if (!hasSessionType) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _sessionNotificationFieldNames; + if (hasSessionType) { + output.WriteUInt32(1, field_names[6], SessionType); + } + if (hasExpirationTimestamp) { + output.WriteFixed64(2, field_names[4], ExpirationTimestamp); + } + if (hasMinutesRemaining) { + output.WriteUInt32(3, field_names[5], MinutesRemaining); + } + if (hasCaisPlayedMinutes) { + output.WriteUInt32(4, field_names[2], CaisPlayedMinutes); + } + if (hasCaisRestedMinutes) { + output.WriteUInt32(5, field_names[3], CaisRestedMinutes); + } + if (hasBenefactor) { + output.WriteBool(6, field_names[0], Benefactor); + } + if (hasBillingMinutesRemaining) { + output.WriteUInt32(7, field_names[1], BillingMinutesRemaining); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasSessionType) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, SessionType); + } + if (hasExpirationTimestamp) { + size += pb::CodedOutputStream.ComputeFixed64Size(2, ExpirationTimestamp); + } + if (hasMinutesRemaining) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, MinutesRemaining); + } + if (hasCaisPlayedMinutes) { + size += pb::CodedOutputStream.ComputeUInt32Size(4, CaisPlayedMinutes); + } + if (hasCaisRestedMinutes) { + size += pb::CodedOutputStream.ComputeUInt32Size(5, CaisRestedMinutes); + } + if (hasBenefactor) { + size += pb::CodedOutputStream.ComputeBoolSize(6, Benefactor); + } + if (hasBillingMinutesRemaining) { + size += pb::CodedOutputStream.ComputeUInt32Size(7, BillingMinutesRemaining); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static SessionNotification ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SessionNotification ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SessionNotification ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SessionNotification ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SessionNotification ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SessionNotification ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SessionNotification ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SessionNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SessionNotification ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SessionNotification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SessionNotification MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SessionNotification prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SessionNotification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SessionNotification result; + + private SessionNotification PrepareBuilder() { + if (resultIsReadOnly) { + SessionNotification original = result; + result = new SessionNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SessionNotification MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.session.SessionNotification.Descriptor; } + } + + public override SessionNotification DefaultInstanceForType { + get { return global::bnet.protocol.session.SessionNotification.DefaultInstance; } + } + + public override SessionNotification BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SessionNotification) { + return MergeFrom((SessionNotification) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SessionNotification other) { + if (other == global::bnet.protocol.session.SessionNotification.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasSessionType) { + SessionType = other.SessionType; + } + if (other.HasExpirationTimestamp) { + ExpirationTimestamp = other.ExpirationTimestamp; + } + if (other.HasMinutesRemaining) { + MinutesRemaining = other.MinutesRemaining; + } + if (other.HasCaisPlayedMinutes) { + CaisPlayedMinutes = other.CaisPlayedMinutes; + } + if (other.HasCaisRestedMinutes) { + CaisRestedMinutes = other.CaisRestedMinutes; + } + if (other.HasBenefactor) { + Benefactor = other.Benefactor; + } + if (other.HasBillingMinutesRemaining) { + BillingMinutesRemaining = other.BillingMinutesRemaining; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_sessionNotificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _sessionNotificationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasSessionType = input.ReadUInt32(ref result.sessionType_); + break; + } + case 17: { + result.hasExpirationTimestamp = input.ReadFixed64(ref result.expirationTimestamp_); + break; + } + case 24: { + result.hasMinutesRemaining = input.ReadUInt32(ref result.minutesRemaining_); + break; + } + case 32: { + result.hasCaisPlayedMinutes = input.ReadUInt32(ref result.caisPlayedMinutes_); + break; + } + case 40: { + result.hasCaisRestedMinutes = input.ReadUInt32(ref result.caisRestedMinutes_); + break; + } + case 48: { + result.hasBenefactor = input.ReadBool(ref result.benefactor_); + break; + } + case 56: { + result.hasBillingMinutesRemaining = input.ReadUInt32(ref result.billingMinutesRemaining_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasSessionType { + get { return result.hasSessionType; } + } + public uint SessionType { + get { return result.SessionType; } + set { SetSessionType(value); } + } + public Builder SetSessionType(uint value) { + PrepareBuilder(); + result.hasSessionType = true; + result.sessionType_ = value; + return this; + } + public Builder ClearSessionType() { + PrepareBuilder(); + result.hasSessionType = false; + result.sessionType_ = 0; + return this; + } + + public bool HasExpirationTimestamp { + get { return result.hasExpirationTimestamp; } + } + public ulong ExpirationTimestamp { + get { return result.ExpirationTimestamp; } + set { SetExpirationTimestamp(value); } + } + public Builder SetExpirationTimestamp(ulong value) { + PrepareBuilder(); + result.hasExpirationTimestamp = true; + result.expirationTimestamp_ = value; + return this; + } + public Builder ClearExpirationTimestamp() { + PrepareBuilder(); + result.hasExpirationTimestamp = false; + result.expirationTimestamp_ = 0; + return this; + } + + public bool HasMinutesRemaining { + get { return result.hasMinutesRemaining; } + } + public uint MinutesRemaining { + get { return result.MinutesRemaining; } + set { SetMinutesRemaining(value); } + } + public Builder SetMinutesRemaining(uint value) { + PrepareBuilder(); + result.hasMinutesRemaining = true; + result.minutesRemaining_ = value; + return this; + } + public Builder ClearMinutesRemaining() { + PrepareBuilder(); + result.hasMinutesRemaining = false; + result.minutesRemaining_ = 0; + return this; + } + + public bool HasCaisPlayedMinutes { + get { return result.hasCaisPlayedMinutes; } + } + public uint CaisPlayedMinutes { + get { return result.CaisPlayedMinutes; } + set { SetCaisPlayedMinutes(value); } + } + public Builder SetCaisPlayedMinutes(uint value) { + PrepareBuilder(); + result.hasCaisPlayedMinutes = true; + result.caisPlayedMinutes_ = value; + return this; + } + public Builder ClearCaisPlayedMinutes() { + PrepareBuilder(); + result.hasCaisPlayedMinutes = false; + result.caisPlayedMinutes_ = 0; + return this; + } + + public bool HasCaisRestedMinutes { + get { return result.hasCaisRestedMinutes; } + } + public uint CaisRestedMinutes { + get { return result.CaisRestedMinutes; } + set { SetCaisRestedMinutes(value); } + } + public Builder SetCaisRestedMinutes(uint value) { + PrepareBuilder(); + result.hasCaisRestedMinutes = true; + result.caisRestedMinutes_ = value; + return this; + } + public Builder ClearCaisRestedMinutes() { + PrepareBuilder(); + result.hasCaisRestedMinutes = false; + result.caisRestedMinutes_ = 0; + return this; + } + + public bool HasBenefactor { + get { return result.hasBenefactor; } + } + public bool Benefactor { + get { return result.Benefactor; } + set { SetBenefactor(value); } + } + public Builder SetBenefactor(bool value) { + PrepareBuilder(); + result.hasBenefactor = true; + result.benefactor_ = value; + return this; + } + public Builder ClearBenefactor() { + PrepareBuilder(); + result.hasBenefactor = false; + result.benefactor_ = false; + return this; + } + + public bool HasBillingMinutesRemaining { + get { return result.hasBillingMinutesRemaining; } + } + public uint BillingMinutesRemaining { + get { return result.BillingMinutesRemaining; } + set { SetBillingMinutesRemaining(value); } + } + public Builder SetBillingMinutesRemaining(uint value) { + PrepareBuilder(); + result.hasBillingMinutesRemaining = true; + result.billingMinutesRemaining_ = value; + return this; + } + public Builder ClearBillingMinutesRemaining() { + PrepareBuilder(); + result.hasBillingMinutesRemaining = false; + result.billingMinutesRemaining_ = 0; + return this; + } + } + static SessionNotification() { + object.ReferenceEquals(global::bnet.protocol.session.SessionService.Descriptor, null); + } + } + + #endregion + + #region Services + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public abstract class SessionNotify : pb::IService { + public abstract void Update( + pb::IRpcController controller, + global::bnet.protocol.session.SessionNotification request, + global::System.Action done); + + public static pbd::ServiceDescriptor Descriptor { + get { return SessionService.Descriptor.Services[0]; } + } + public pbd::ServiceDescriptor DescriptorForType { + get { return Descriptor; } + } + + public void CallMethod( + pbd::MethodDescriptor method, + pb::IRpcController controller, + pb::IMessage request, + global::System.Action done) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.CallMethod() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + this.Update(controller, (global::bnet.protocol.session.SessionNotification) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetRequestPrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.session.SessionNotification.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetResponsePrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.NO_RESPONSE.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public static Stub CreateStub(pb::IRpcChannel channel) { + return new Stub(channel); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public class Stub : global::bnet.protocol.session.SessionNotify { + internal Stub(pb::IRpcChannel channel) { + this.channel = channel; + } + + private readonly pb::IRpcChannel channel; + + public pb::IRpcChannel Channel { + get { return channel; } + } + + public override void Update( + pb::IRpcController controller, + global::bnet.protocol.session.SessionNotification request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[0], + controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); + } + } + } + #endregion + +} + +#endregion Designer generated code diff --git a/src/LibMooNet/bnet/protocol/user_manager/UserManagerService.cs b/src/LibMooNet/bnet/protocol/user_manager/UserManagerService.cs new file mode 100644 index 00000000..7123a268 --- /dev/null +++ b/src/LibMooNet/bnet/protocol/user_manager/UserManagerService.cs @@ -0,0 +1,4461 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace bnet.protocol.user_manager { + + namespace Proto { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class UserManagerService { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_SubscribeToUserManagerRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_SubscribeToUserManagerRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_SubscribeToUserManagerResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_SubscribeToUserManagerResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_AddRecentPlayersRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_AddRecentPlayersRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_AddRecentPlayersResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_AddRecentPlayersResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_ClearRecentPlayersResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_ClearRecentPlayersResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_BlockEntityRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_BlockEntityRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_UnblockEntityRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_UnblockEntityRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_EntityBlockedNotification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_EntityBlockedNotification__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_EntityUnblockedNotification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_EntityUnblockedNotification__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_RecentPlayersAddedNotification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_RecentPlayersAddedNotification__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_RecentPlayersRemovedNotification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_RecentPlayersRemovedNotification__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static UserManagerService() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "Ch9ibmV0L3VzZXJfbWFuYWdlcl9zZXJ2aWNlLnByb3RvEhpibmV0LnByb3Rv" + + "Y29sLnVzZXJfbWFuYWdlchodYm5ldC91c2VyX21hbmFnZXJfdHlwZXMucHJv" + + "dG8aEWJuZXQvZW50aXR5LnByb3RvGhNibmV0L3JvbGVfc2V0LnByb3RvGg5i" + + "bmV0L3JwYy5wcm90byJdCh1TdWJzY3JpYmVUb1VzZXJNYW5hZ2VyUmVxdWVz" + + "dBIpCghhZ2VudF9pZBgBIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQS" + + "EQoJb2JqZWN0X2lkGAIgAigEIsoBCh5TdWJzY3JpYmVUb1VzZXJNYW5hZ2Vy" + + "UmVzcG9uc2USQwoQYmxvY2tlZF9lbnRpdGllcxgBIAMoCzIpLmJuZXQucHJv" + + "dG9jb2wudXNlcl9tYW5hZ2VyLkJsb2NrZWRFbnRpdHkSQAoOcmVjZW50X3Bs" + + "YXllcnMYAiADKAsyKC5ibmV0LnByb3RvY29sLnVzZXJfbWFuYWdlci5SZWNl" + + "bnRQbGF5ZXISIQoEcm9sZRgDIAMoCzITLmJuZXQucHJvdG9jb2wuUm9sZSJU" + + "ChdBZGRSZWNlbnRQbGF5ZXJzUmVxdWVzdBI5CgdwbGF5ZXJzGAEgAygLMigu" + + "Ym5ldC5wcm90b2NvbC51c2VyX21hbmFnZXIuUmVjZW50UGxheWVyInQKGEFk" + + "ZFJlY2VudFBsYXllcnNSZXNwb25zZRI/Cg1wbGF5ZXJzX2FkZGVkGAEgAygL" + + "MiguYm5ldC5wcm90b2NvbC51c2VyX21hbmFnZXIuUmVjZW50UGxheWVyEhcK" + + "D3BsYXllcnNfcmVtb3ZlZBgDIAMoByI1ChpDbGVhclJlY2VudFBsYXllcnNS" + + "ZXNwb25zZRIXCg9wbGF5ZXJzX3JlbW92ZWQYASADKAcieQoSQmxvY2tFbnRp" + + "dHlSZXF1ZXN0EikKCGFnZW50X2lkGAEgASgLMhcuYm5ldC5wcm90b2NvbC5F" + + "bnRpdHlJZBIqCgl0YXJnZXRfaWQYAiACKAsyFy5ibmV0LnByb3RvY29sLkVu" + + "dGl0eUlkEgwKBHJvbGUYAyABKA0ibQoUVW5ibG9ja0VudGl0eVJlcXVlc3QS" + + "KQoIYWdlbnRfaWQYASABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEioK" + + "CXRhcmdldF9pZBgCIAIoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQikAEK" + + "GUVudGl0eUJsb2NrZWROb3RpZmljYXRpb24SQQoOYmxvY2tlZF9lbnRpdHkY" + + "ASACKAsyKS5ibmV0LnByb3RvY29sLnVzZXJfbWFuYWdlci5CbG9ja2VkRW50" + + "aXR5EjAKD2dhbWVfYWNjb3VudF9pZBgCIAEoCzIXLmJuZXQucHJvdG9jb2wu" + + "RW50aXR5SWQilAEKG0VudGl0eVVuYmxvY2tlZE5vdGlmaWNhdGlvbhJDChB1" + + "bmJsb2NrZWRfZW50aXR5GAEgAigLMikuYm5ldC5wcm90b2NvbC51c2VyX21h" + + "bmFnZXIuQmxvY2tlZEVudGl0eRIwCg9nYW1lX2FjY291bnRfaWQYAiABKAsy" + + "Fy5ibmV0LnByb3RvY29sLkVudGl0eUlkImEKHlJlY2VudFBsYXllcnNBZGRl" + + "ZE5vdGlmaWNhdGlvbhI/Cg1hZGRlZF9wbGF5ZXJzGAEgAygLMiguYm5ldC5w" + + "cm90b2NvbC51c2VyX21hbmFnZXIuUmVjZW50UGxheWVyImUKIFJlY2VudFBs" + + "YXllcnNSZW1vdmVkTm90aWZpY2F0aW9uEkEKD3JlbW92ZWRfcGxheWVycxgB" + + "IAMoCzIoLmJuZXQucHJvdG9jb2wudXNlcl9tYW5hZ2VyLlJlY2VudFBsYXll" + + "cjKGBgoSVXNlck1hbmFnZXJTZXJ2aWNlEpUBChZTdWJzY3JpYmVUb1VzZXJN" + + "YW5hZ2VyEjkuYm5ldC5wcm90b2NvbC51c2VyX21hbmFnZXIuU3Vic2NyaWJl" + + "VG9Vc2VyTWFuYWdlclJlcXVlc3QaOi5ibmV0LnByb3RvY29sLnVzZXJfbWFu" + + "YWdlci5TdWJzY3JpYmVUb1VzZXJNYW5hZ2VyUmVzcG9uc2UiBIC1GAESgwEK" + + "EEFkZFJlY2VudFBsYXllcnMSMy5ibmV0LnByb3RvY29sLnVzZXJfbWFuYWdl" + + "ci5BZGRSZWNlbnRQbGF5ZXJzUmVxdWVzdBo0LmJuZXQucHJvdG9jb2wudXNl" + + "cl9tYW5hZ2VyLkFkZFJlY2VudFBsYXllcnNSZXNwb25zZSIEgLUYChJpChJD" + + "bGVhclJlY2VudFBsYXllcnMSFS5ibmV0LnByb3RvY29sLk5vRGF0YRo2LmJu" + + "ZXQucHJvdG9jb2wudXNlcl9tYW5hZ2VyLkNsZWFyUmVjZW50UGxheWVyc1Jl" + + "c3BvbnNlIgSAtRgLEloKC0Jsb2NrRW50aXR5Ei4uYm5ldC5wcm90b2NvbC51" + + "c2VyX21hbmFnZXIuQmxvY2tFbnRpdHlSZXF1ZXN0GhUuYm5ldC5wcm90b2Nv" + + "bC5Ob0RhdGEiBIC1GBQSXgoNVW5ibG9ja0VudGl0eRIwLmJuZXQucHJvdG9j" + + "b2wudXNlcl9tYW5hZ2VyLlVuYmxvY2tFbnRpdHlSZXF1ZXN0GhUuYm5ldC5w" + + "cm90b2NvbC5Ob0RhdGEiBIC1GBUSZAoVQmxvY2tFbnRpdHlGb3JTZXNzaW9u" + + "Ei4uYm5ldC5wcm90b2NvbC51c2VyX21hbmFnZXIuQmxvY2tFbnRpdHlSZXF1" + + "ZXN0GhUuYm5ldC5wcm90b2NvbC5Ob0RhdGEiBIC1GCgSRQoNTG9hZEJsb2Nr" + + "TGlzdBIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQaFS5ibmV0LnByb3RvY29s" + + "Lk5vRGF0YSIEgLUYMjLvAwoRVXNlck1hbmFnZXJOb3RpZnkSbgoTTm90aWZ5" + + "RW50aXR5QmxvY2tlZBI1LmJuZXQucHJvdG9jb2wudXNlcl9tYW5hZ2VyLkVu" + + "dGl0eUJsb2NrZWROb3RpZmljYXRpb24aGi5ibmV0LnByb3RvY29sLk5PX1JF" + + "U1BPTlNFIgSAtRgBEnIKFU5vdGlmeUVudGl0eVVuYmxvY2tlZBI3LmJuZXQu" + + "cHJvdG9jb2wudXNlcl9tYW5hZ2VyLkVudGl0eVVuYmxvY2tlZE5vdGlmaWNh" + + "dGlvbhoaLmJuZXQucHJvdG9jb2wuTk9fUkVTUE9OU0UiBIC1GAISeAoYTm90" + + "aWZ5UmVjZW50UGxheWVyc0FkZGVkEjouYm5ldC5wcm90b2NvbC51c2VyX21h" + + "bmFnZXIuUmVjZW50UGxheWVyc0FkZGVkTm90aWZpY2F0aW9uGhouYm5ldC5w" + + "cm90b2NvbC5OT19SRVNQT05TRSIEgLUYCxJ8ChpOb3RpZnlSZWNlbnRQbGF5" + + "ZXJzUmVtb3ZlZBI8LmJuZXQucHJvdG9jb2wudXNlcl9tYW5hZ2VyLlJlY2Vu" + + "dFBsYXllcnNSZW1vdmVkTm90aWZpY2F0aW9uGhouYm5ldC5wcm90b2NvbC5O" + + "T19SRVNQT05TRSIEgLUYDEIDgAEA"); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_bnet_protocol_user_manager_SubscribeToUserManagerRequest__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_user_manager_SubscribeToUserManagerRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_SubscribeToUserManagerRequest__Descriptor, + new string[] { "AgentId", "ObjectId", }); + internal__static_bnet_protocol_user_manager_SubscribeToUserManagerResponse__Descriptor = Descriptor.MessageTypes[1]; + internal__static_bnet_protocol_user_manager_SubscribeToUserManagerResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_SubscribeToUserManagerResponse__Descriptor, + new string[] { "BlockedEntities", "RecentPlayers", "Role", }); + internal__static_bnet_protocol_user_manager_AddRecentPlayersRequest__Descriptor = Descriptor.MessageTypes[2]; + internal__static_bnet_protocol_user_manager_AddRecentPlayersRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_AddRecentPlayersRequest__Descriptor, + new string[] { "Players", }); + internal__static_bnet_protocol_user_manager_AddRecentPlayersResponse__Descriptor = Descriptor.MessageTypes[3]; + internal__static_bnet_protocol_user_manager_AddRecentPlayersResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_AddRecentPlayersResponse__Descriptor, + new string[] { "PlayersAdded", "PlayersRemoved", }); + internal__static_bnet_protocol_user_manager_ClearRecentPlayersResponse__Descriptor = Descriptor.MessageTypes[4]; + internal__static_bnet_protocol_user_manager_ClearRecentPlayersResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_ClearRecentPlayersResponse__Descriptor, + new string[] { "PlayersRemoved", }); + internal__static_bnet_protocol_user_manager_BlockEntityRequest__Descriptor = Descriptor.MessageTypes[5]; + internal__static_bnet_protocol_user_manager_BlockEntityRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_BlockEntityRequest__Descriptor, + new string[] { "AgentId", "TargetId", "Role", }); + internal__static_bnet_protocol_user_manager_UnblockEntityRequest__Descriptor = Descriptor.MessageTypes[6]; + internal__static_bnet_protocol_user_manager_UnblockEntityRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_UnblockEntityRequest__Descriptor, + new string[] { "AgentId", "TargetId", }); + internal__static_bnet_protocol_user_manager_EntityBlockedNotification__Descriptor = Descriptor.MessageTypes[7]; + internal__static_bnet_protocol_user_manager_EntityBlockedNotification__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_EntityBlockedNotification__Descriptor, + new string[] { "BlockedEntity", "GameAccountId", }); + internal__static_bnet_protocol_user_manager_EntityUnblockedNotification__Descriptor = Descriptor.MessageTypes[8]; + internal__static_bnet_protocol_user_manager_EntityUnblockedNotification__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_EntityUnblockedNotification__Descriptor, + new string[] { "UnblockedEntity", "GameAccountId", }); + internal__static_bnet_protocol_user_manager_RecentPlayersAddedNotification__Descriptor = Descriptor.MessageTypes[9]; + internal__static_bnet_protocol_user_manager_RecentPlayersAddedNotification__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_RecentPlayersAddedNotification__Descriptor, + new string[] { "AddedPlayers", }); + internal__static_bnet_protocol_user_manager_RecentPlayersRemovedNotification__Descriptor = Descriptor.MessageTypes[10]; + internal__static_bnet_protocol_user_manager_RecentPlayersRemovedNotification__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_RecentPlayersRemovedNotification__Descriptor, + new string[] { "RemovedPlayers", }); + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + RegisterAllExtensions(registry); + global::bnet.protocol.user_manager.UserManagerTypes.RegisterAllExtensions(registry); + global::bnet.protocol.Entity.RegisterAllExtensions(registry); + global::bnet.protocol.Proto.RoleSet.RegisterAllExtensions(registry); + global::bnet.protocol.Rpc.RegisterAllExtensions(registry); + return registry; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::bnet.protocol.user_manager.UserManagerTypes.Descriptor, + global::bnet.protocol.Entity.Descriptor, + global::bnet.protocol.Proto.RoleSet.Descriptor, + global::bnet.protocol.Rpc.Descriptor, + }, assigner); + } + #endregion + + } + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class SubscribeToUserManagerRequest : pb::GeneratedMessage { + private SubscribeToUserManagerRequest() { } + private static readonly SubscribeToUserManagerRequest defaultInstance = new SubscribeToUserManagerRequest().MakeReadOnly(); + private static readonly string[] _subscribeToUserManagerRequestFieldNames = new string[] { "agent_id", "object_id" }; + private static readonly uint[] _subscribeToUserManagerRequestFieldTags = new uint[] { 10, 16 }; + public static SubscribeToUserManagerRequest DefaultInstance { + get { return defaultInstance; } + } + + public override SubscribeToUserManagerRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SubscribeToUserManagerRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.user_manager.Proto.UserManagerService.internal__static_bnet_protocol_user_manager_SubscribeToUserManagerRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.user_manager.Proto.UserManagerService.internal__static_bnet_protocol_user_manager_SubscribeToUserManagerRequest__FieldAccessorTable; } + } + + public const int AgentIdFieldNumber = 1; + private bool hasAgentId; + private global::bnet.protocol.EntityId agentId_; + public bool HasAgentId { + get { return hasAgentId; } + } + public global::bnet.protocol.EntityId AgentId { + get { return agentId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int ObjectIdFieldNumber = 2; + private bool hasObjectId; + private ulong objectId_; + public bool HasObjectId { + get { return hasObjectId; } + } + public ulong ObjectId { + get { return objectId_; } + } + + public override bool IsInitialized { + get { + if (!hasObjectId) return false; + if (HasAgentId) { + if (!AgentId.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _subscribeToUserManagerRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); + } + if (hasObjectId) { + output.WriteUInt64(2, field_names[1], ObjectId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAgentId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); + } + if (hasObjectId) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, ObjectId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static SubscribeToUserManagerRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SubscribeToUserManagerRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SubscribeToUserManagerRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SubscribeToUserManagerRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SubscribeToUserManagerRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SubscribeToUserManagerRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SubscribeToUserManagerRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SubscribeToUserManagerRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SubscribeToUserManagerRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SubscribeToUserManagerRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SubscribeToUserManagerRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SubscribeToUserManagerRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SubscribeToUserManagerRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SubscribeToUserManagerRequest result; + + private SubscribeToUserManagerRequest PrepareBuilder() { + if (resultIsReadOnly) { + SubscribeToUserManagerRequest original = result; + result = new SubscribeToUserManagerRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SubscribeToUserManagerRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.user_manager.SubscribeToUserManagerRequest.Descriptor; } + } + + public override SubscribeToUserManagerRequest DefaultInstanceForType { + get { return global::bnet.protocol.user_manager.SubscribeToUserManagerRequest.DefaultInstance; } + } + + public override SubscribeToUserManagerRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SubscribeToUserManagerRequest) { + return MergeFrom((SubscribeToUserManagerRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SubscribeToUserManagerRequest other) { + if (other == global::bnet.protocol.user_manager.SubscribeToUserManagerRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAgentId) { + MergeAgentId(other.AgentId); + } + if (other.HasObjectId) { + ObjectId = other.ObjectId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_subscribeToUserManagerRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _subscribeToUserManagerRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasAgentId) { + subBuilder.MergeFrom(AgentId); + } + input.ReadMessage(subBuilder, extensionRegistry); + AgentId = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasObjectId = input.ReadUInt64(ref result.objectId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAgentId { + get { return result.hasAgentId; } + } + public global::bnet.protocol.EntityId AgentId { + get { return result.AgentId; } + set { SetAgentId(value); } + } + public Builder SetAgentId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAgentId = true; + result.agentId_ = value; + return this; + } + public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAgentId = true; + result.agentId_ = builderForValue.Build(); + return this; + } + public Builder MergeAgentId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAgentId && + result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); + } else { + result.agentId_ = value; + } + result.hasAgentId = true; + return this; + } + public Builder ClearAgentId() { + PrepareBuilder(); + result.hasAgentId = false; + result.agentId_ = null; + return this; + } + + public bool HasObjectId { + get { return result.hasObjectId; } + } + public ulong ObjectId { + get { return result.ObjectId; } + set { SetObjectId(value); } + } + public Builder SetObjectId(ulong value) { + PrepareBuilder(); + result.hasObjectId = true; + result.objectId_ = value; + return this; + } + public Builder ClearObjectId() { + PrepareBuilder(); + result.hasObjectId = false; + result.objectId_ = 0UL; + return this; + } + } + static SubscribeToUserManagerRequest() { + object.ReferenceEquals(global::bnet.protocol.user_manager.Proto.UserManagerService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class SubscribeToUserManagerResponse : pb::GeneratedMessage { + private SubscribeToUserManagerResponse() { } + private static readonly SubscribeToUserManagerResponse defaultInstance = new SubscribeToUserManagerResponse().MakeReadOnly(); + private static readonly string[] _subscribeToUserManagerResponseFieldNames = new string[] { "blocked_entities", "recent_players", "role" }; + private static readonly uint[] _subscribeToUserManagerResponseFieldTags = new uint[] { 10, 18, 26 }; + public static SubscribeToUserManagerResponse DefaultInstance { + get { return defaultInstance; } + } + + public override SubscribeToUserManagerResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SubscribeToUserManagerResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.user_manager.Proto.UserManagerService.internal__static_bnet_protocol_user_manager_SubscribeToUserManagerResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.user_manager.Proto.UserManagerService.internal__static_bnet_protocol_user_manager_SubscribeToUserManagerResponse__FieldAccessorTable; } + } + + public const int BlockedEntitiesFieldNumber = 1; + private pbc::PopsicleList blockedEntities_ = new pbc::PopsicleList(); + public scg::IList BlockedEntitiesList { + get { return blockedEntities_; } + } + public int BlockedEntitiesCount { + get { return blockedEntities_.Count; } + } + public global::bnet.protocol.user_manager.BlockedEntity GetBlockedEntities(int index) { + return blockedEntities_[index]; + } + + public const int RecentPlayersFieldNumber = 2; + private pbc::PopsicleList recentPlayers_ = new pbc::PopsicleList(); + public scg::IList RecentPlayersList { + get { return recentPlayers_; } + } + public int RecentPlayersCount { + get { return recentPlayers_.Count; } + } + public global::bnet.protocol.user_manager.RecentPlayer GetRecentPlayers(int index) { + return recentPlayers_[index]; + } + + public const int RoleFieldNumber = 3; + private pbc::PopsicleList role_ = new pbc::PopsicleList(); + public scg::IList RoleList { + get { return role_; } + } + public int RoleCount { + get { return role_.Count; } + } + public global::bnet.protocol.Role GetRole(int index) { + return role_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.user_manager.BlockedEntity element in BlockedEntitiesList) { + if (!element.IsInitialized) return false; + } + foreach (global::bnet.protocol.user_manager.RecentPlayer element in RecentPlayersList) { + if (!element.IsInitialized) return false; + } + foreach (global::bnet.protocol.Role element in RoleList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _subscribeToUserManagerResponseFieldNames; + if (blockedEntities_.Count > 0) { + output.WriteMessageArray(1, field_names[0], blockedEntities_); + } + if (recentPlayers_.Count > 0) { + output.WriteMessageArray(2, field_names[1], recentPlayers_); + } + if (role_.Count > 0) { + output.WriteMessageArray(3, field_names[2], role_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.user_manager.BlockedEntity element in BlockedEntitiesList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + foreach (global::bnet.protocol.user_manager.RecentPlayer element in RecentPlayersList) { + size += pb::CodedOutputStream.ComputeMessageSize(2, element); + } + foreach (global::bnet.protocol.Role element in RoleList) { + size += pb::CodedOutputStream.ComputeMessageSize(3, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static SubscribeToUserManagerResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SubscribeToUserManagerResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SubscribeToUserManagerResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SubscribeToUserManagerResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SubscribeToUserManagerResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SubscribeToUserManagerResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SubscribeToUserManagerResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SubscribeToUserManagerResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SubscribeToUserManagerResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SubscribeToUserManagerResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SubscribeToUserManagerResponse MakeReadOnly() { + blockedEntities_.MakeReadOnly(); + recentPlayers_.MakeReadOnly(); + role_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SubscribeToUserManagerResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SubscribeToUserManagerResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SubscribeToUserManagerResponse result; + + private SubscribeToUserManagerResponse PrepareBuilder() { + if (resultIsReadOnly) { + SubscribeToUserManagerResponse original = result; + result = new SubscribeToUserManagerResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SubscribeToUserManagerResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.user_manager.SubscribeToUserManagerResponse.Descriptor; } + } + + public override SubscribeToUserManagerResponse DefaultInstanceForType { + get { return global::bnet.protocol.user_manager.SubscribeToUserManagerResponse.DefaultInstance; } + } + + public override SubscribeToUserManagerResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SubscribeToUserManagerResponse) { + return MergeFrom((SubscribeToUserManagerResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SubscribeToUserManagerResponse other) { + if (other == global::bnet.protocol.user_manager.SubscribeToUserManagerResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.blockedEntities_.Count != 0) { + result.blockedEntities_.Add(other.blockedEntities_); + } + if (other.recentPlayers_.Count != 0) { + result.recentPlayers_.Add(other.recentPlayers_); + } + if (other.role_.Count != 0) { + result.role_.Add(other.role_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_subscribeToUserManagerResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _subscribeToUserManagerResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.blockedEntities_, global::bnet.protocol.user_manager.BlockedEntity.DefaultInstance, extensionRegistry); + break; + } + case 18: { + input.ReadMessageArray(tag, field_name, result.recentPlayers_, global::bnet.protocol.user_manager.RecentPlayer.DefaultInstance, extensionRegistry); + break; + } + case 26: { + input.ReadMessageArray(tag, field_name, result.role_, global::bnet.protocol.Role.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList BlockedEntitiesList { + get { return PrepareBuilder().blockedEntities_; } + } + public int BlockedEntitiesCount { + get { return result.BlockedEntitiesCount; } + } + public global::bnet.protocol.user_manager.BlockedEntity GetBlockedEntities(int index) { + return result.GetBlockedEntities(index); + } + public Builder SetBlockedEntities(int index, global::bnet.protocol.user_manager.BlockedEntity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.blockedEntities_[index] = value; + return this; + } + public Builder SetBlockedEntities(int index, global::bnet.protocol.user_manager.BlockedEntity.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.blockedEntities_[index] = builderForValue.Build(); + return this; + } + public Builder AddBlockedEntities(global::bnet.protocol.user_manager.BlockedEntity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.blockedEntities_.Add(value); + return this; + } + public Builder AddBlockedEntities(global::bnet.protocol.user_manager.BlockedEntity.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.blockedEntities_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeBlockedEntities(scg::IEnumerable values) { + PrepareBuilder(); + result.blockedEntities_.Add(values); + return this; + } + public Builder ClearBlockedEntities() { + PrepareBuilder(); + result.blockedEntities_.Clear(); + return this; + } + + public pbc::IPopsicleList RecentPlayersList { + get { return PrepareBuilder().recentPlayers_; } + } + public int RecentPlayersCount { + get { return result.RecentPlayersCount; } + } + public global::bnet.protocol.user_manager.RecentPlayer GetRecentPlayers(int index) { + return result.GetRecentPlayers(index); + } + public Builder SetRecentPlayers(int index, global::bnet.protocol.user_manager.RecentPlayer value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.recentPlayers_[index] = value; + return this; + } + public Builder SetRecentPlayers(int index, global::bnet.protocol.user_manager.RecentPlayer.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.recentPlayers_[index] = builderForValue.Build(); + return this; + } + public Builder AddRecentPlayers(global::bnet.protocol.user_manager.RecentPlayer value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.recentPlayers_.Add(value); + return this; + } + public Builder AddRecentPlayers(global::bnet.protocol.user_manager.RecentPlayer.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.recentPlayers_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeRecentPlayers(scg::IEnumerable values) { + PrepareBuilder(); + result.recentPlayers_.Add(values); + return this; + } + public Builder ClearRecentPlayers() { + PrepareBuilder(); + result.recentPlayers_.Clear(); + return this; + } + + public pbc::IPopsicleList RoleList { + get { return PrepareBuilder().role_; } + } + public int RoleCount { + get { return result.RoleCount; } + } + public global::bnet.protocol.Role GetRole(int index) { + return result.GetRole(index); + } + public Builder SetRole(int index, global::bnet.protocol.Role value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.role_[index] = value; + return this; + } + public Builder SetRole(int index, global::bnet.protocol.Role.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.role_[index] = builderForValue.Build(); + return this; + } + public Builder AddRole(global::bnet.protocol.Role value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.role_.Add(value); + return this; + } + public Builder AddRole(global::bnet.protocol.Role.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.role_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeRole(scg::IEnumerable values) { + PrepareBuilder(); + result.role_.Add(values); + return this; + } + public Builder ClearRole() { + PrepareBuilder(); + result.role_.Clear(); + return this; + } + } + static SubscribeToUserManagerResponse() { + object.ReferenceEquals(global::bnet.protocol.user_manager.Proto.UserManagerService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class AddRecentPlayersRequest : pb::GeneratedMessage { + private AddRecentPlayersRequest() { } + private static readonly AddRecentPlayersRequest defaultInstance = new AddRecentPlayersRequest().MakeReadOnly(); + private static readonly string[] _addRecentPlayersRequestFieldNames = new string[] { "players" }; + private static readonly uint[] _addRecentPlayersRequestFieldTags = new uint[] { 10 }; + public static AddRecentPlayersRequest DefaultInstance { + get { return defaultInstance; } + } + + public override AddRecentPlayersRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override AddRecentPlayersRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.user_manager.Proto.UserManagerService.internal__static_bnet_protocol_user_manager_AddRecentPlayersRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.user_manager.Proto.UserManagerService.internal__static_bnet_protocol_user_manager_AddRecentPlayersRequest__FieldAccessorTable; } + } + + public const int PlayersFieldNumber = 1; + private pbc::PopsicleList players_ = new pbc::PopsicleList(); + public scg::IList PlayersList { + get { return players_; } + } + public int PlayersCount { + get { return players_.Count; } + } + public global::bnet.protocol.user_manager.RecentPlayer GetPlayers(int index) { + return players_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.user_manager.RecentPlayer element in PlayersList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _addRecentPlayersRequestFieldNames; + if (players_.Count > 0) { + output.WriteMessageArray(1, field_names[0], players_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.user_manager.RecentPlayer element in PlayersList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static AddRecentPlayersRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AddRecentPlayersRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AddRecentPlayersRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AddRecentPlayersRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AddRecentPlayersRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AddRecentPlayersRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static AddRecentPlayersRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static AddRecentPlayersRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static AddRecentPlayersRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AddRecentPlayersRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private AddRecentPlayersRequest MakeReadOnly() { + players_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(AddRecentPlayersRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(AddRecentPlayersRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private AddRecentPlayersRequest result; + + private AddRecentPlayersRequest PrepareBuilder() { + if (resultIsReadOnly) { + AddRecentPlayersRequest original = result; + result = new AddRecentPlayersRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override AddRecentPlayersRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.user_manager.AddRecentPlayersRequest.Descriptor; } + } + + public override AddRecentPlayersRequest DefaultInstanceForType { + get { return global::bnet.protocol.user_manager.AddRecentPlayersRequest.DefaultInstance; } + } + + public override AddRecentPlayersRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is AddRecentPlayersRequest) { + return MergeFrom((AddRecentPlayersRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(AddRecentPlayersRequest other) { + if (other == global::bnet.protocol.user_manager.AddRecentPlayersRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.players_.Count != 0) { + result.players_.Add(other.players_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_addRecentPlayersRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _addRecentPlayersRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.players_, global::bnet.protocol.user_manager.RecentPlayer.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList PlayersList { + get { return PrepareBuilder().players_; } + } + public int PlayersCount { + get { return result.PlayersCount; } + } + public global::bnet.protocol.user_manager.RecentPlayer GetPlayers(int index) { + return result.GetPlayers(index); + } + public Builder SetPlayers(int index, global::bnet.protocol.user_manager.RecentPlayer value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.players_[index] = value; + return this; + } + public Builder SetPlayers(int index, global::bnet.protocol.user_manager.RecentPlayer.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.players_[index] = builderForValue.Build(); + return this; + } + public Builder AddPlayers(global::bnet.protocol.user_manager.RecentPlayer value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.players_.Add(value); + return this; + } + public Builder AddPlayers(global::bnet.protocol.user_manager.RecentPlayer.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.players_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangePlayers(scg::IEnumerable values) { + PrepareBuilder(); + result.players_.Add(values); + return this; + } + public Builder ClearPlayers() { + PrepareBuilder(); + result.players_.Clear(); + return this; + } + } + static AddRecentPlayersRequest() { + object.ReferenceEquals(global::bnet.protocol.user_manager.Proto.UserManagerService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class AddRecentPlayersResponse : pb::GeneratedMessage { + private AddRecentPlayersResponse() { } + private static readonly AddRecentPlayersResponse defaultInstance = new AddRecentPlayersResponse().MakeReadOnly(); + private static readonly string[] _addRecentPlayersResponseFieldNames = new string[] { "players_added", "players_removed" }; + private static readonly uint[] _addRecentPlayersResponseFieldTags = new uint[] { 10, 29 }; + public static AddRecentPlayersResponse DefaultInstance { + get { return defaultInstance; } + } + + public override AddRecentPlayersResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override AddRecentPlayersResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.user_manager.Proto.UserManagerService.internal__static_bnet_protocol_user_manager_AddRecentPlayersResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.user_manager.Proto.UserManagerService.internal__static_bnet_protocol_user_manager_AddRecentPlayersResponse__FieldAccessorTable; } + } + + public const int PlayersAddedFieldNumber = 1; + private pbc::PopsicleList playersAdded_ = new pbc::PopsicleList(); + public scg::IList PlayersAddedList { + get { return playersAdded_; } + } + public int PlayersAddedCount { + get { return playersAdded_.Count; } + } + public global::bnet.protocol.user_manager.RecentPlayer GetPlayersAdded(int index) { + return playersAdded_[index]; + } + + public const int PlayersRemovedFieldNumber = 3; + private pbc::PopsicleList playersRemoved_ = new pbc::PopsicleList(); + public scg::IList PlayersRemovedList { + get { return pbc::Lists.AsReadOnly(playersRemoved_); } + } + public int PlayersRemovedCount { + get { return playersRemoved_.Count; } + } + public uint GetPlayersRemoved(int index) { + return playersRemoved_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.user_manager.RecentPlayer element in PlayersAddedList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _addRecentPlayersResponseFieldNames; + if (playersAdded_.Count > 0) { + output.WriteMessageArray(1, field_names[0], playersAdded_); + } + if (playersRemoved_.Count > 0) { + output.WriteFixed32Array(3, field_names[1], playersRemoved_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.user_manager.RecentPlayer element in PlayersAddedList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + { + int dataSize = 0; + dataSize = 4 * playersRemoved_.Count; + size += dataSize; + size += 1 * playersRemoved_.Count; + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static AddRecentPlayersResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AddRecentPlayersResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AddRecentPlayersResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AddRecentPlayersResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AddRecentPlayersResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AddRecentPlayersResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static AddRecentPlayersResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static AddRecentPlayersResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static AddRecentPlayersResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AddRecentPlayersResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private AddRecentPlayersResponse MakeReadOnly() { + playersAdded_.MakeReadOnly(); + playersRemoved_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(AddRecentPlayersResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(AddRecentPlayersResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private AddRecentPlayersResponse result; + + private AddRecentPlayersResponse PrepareBuilder() { + if (resultIsReadOnly) { + AddRecentPlayersResponse original = result; + result = new AddRecentPlayersResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override AddRecentPlayersResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.user_manager.AddRecentPlayersResponse.Descriptor; } + } + + public override AddRecentPlayersResponse DefaultInstanceForType { + get { return global::bnet.protocol.user_manager.AddRecentPlayersResponse.DefaultInstance; } + } + + public override AddRecentPlayersResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is AddRecentPlayersResponse) { + return MergeFrom((AddRecentPlayersResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(AddRecentPlayersResponse other) { + if (other == global::bnet.protocol.user_manager.AddRecentPlayersResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.playersAdded_.Count != 0) { + result.playersAdded_.Add(other.playersAdded_); + } + if (other.playersRemoved_.Count != 0) { + result.playersRemoved_.Add(other.playersRemoved_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_addRecentPlayersResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _addRecentPlayersResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.playersAdded_, global::bnet.protocol.user_manager.RecentPlayer.DefaultInstance, extensionRegistry); + break; + } + case 26: + case 29: { + input.ReadFixed32Array(tag, field_name, result.playersRemoved_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList PlayersAddedList { + get { return PrepareBuilder().playersAdded_; } + } + public int PlayersAddedCount { + get { return result.PlayersAddedCount; } + } + public global::bnet.protocol.user_manager.RecentPlayer GetPlayersAdded(int index) { + return result.GetPlayersAdded(index); + } + public Builder SetPlayersAdded(int index, global::bnet.protocol.user_manager.RecentPlayer value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.playersAdded_[index] = value; + return this; + } + public Builder SetPlayersAdded(int index, global::bnet.protocol.user_manager.RecentPlayer.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.playersAdded_[index] = builderForValue.Build(); + return this; + } + public Builder AddPlayersAdded(global::bnet.protocol.user_manager.RecentPlayer value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.playersAdded_.Add(value); + return this; + } + public Builder AddPlayersAdded(global::bnet.protocol.user_manager.RecentPlayer.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.playersAdded_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangePlayersAdded(scg::IEnumerable values) { + PrepareBuilder(); + result.playersAdded_.Add(values); + return this; + } + public Builder ClearPlayersAdded() { + PrepareBuilder(); + result.playersAdded_.Clear(); + return this; + } + + public pbc::IPopsicleList PlayersRemovedList { + get { return PrepareBuilder().playersRemoved_; } + } + public int PlayersRemovedCount { + get { return result.PlayersRemovedCount; } + } + public uint GetPlayersRemoved(int index) { + return result.GetPlayersRemoved(index); + } + public Builder SetPlayersRemoved(int index, uint value) { + PrepareBuilder(); + result.playersRemoved_[index] = value; + return this; + } + public Builder AddPlayersRemoved(uint value) { + PrepareBuilder(); + result.playersRemoved_.Add(value); + return this; + } + public Builder AddRangePlayersRemoved(scg::IEnumerable values) { + PrepareBuilder(); + result.playersRemoved_.Add(values); + return this; + } + public Builder ClearPlayersRemoved() { + PrepareBuilder(); + result.playersRemoved_.Clear(); + return this; + } + } + static AddRecentPlayersResponse() { + object.ReferenceEquals(global::bnet.protocol.user_manager.Proto.UserManagerService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ClearRecentPlayersResponse : pb::GeneratedMessage { + private ClearRecentPlayersResponse() { } + private static readonly ClearRecentPlayersResponse defaultInstance = new ClearRecentPlayersResponse().MakeReadOnly(); + private static readonly string[] _clearRecentPlayersResponseFieldNames = new string[] { "players_removed" }; + private static readonly uint[] _clearRecentPlayersResponseFieldTags = new uint[] { 13 }; + public static ClearRecentPlayersResponse DefaultInstance { + get { return defaultInstance; } + } + + public override ClearRecentPlayersResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ClearRecentPlayersResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.user_manager.Proto.UserManagerService.internal__static_bnet_protocol_user_manager_ClearRecentPlayersResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.user_manager.Proto.UserManagerService.internal__static_bnet_protocol_user_manager_ClearRecentPlayersResponse__FieldAccessorTable; } + } + + public const int PlayersRemovedFieldNumber = 1; + private pbc::PopsicleList playersRemoved_ = new pbc::PopsicleList(); + public scg::IList PlayersRemovedList { + get { return pbc::Lists.AsReadOnly(playersRemoved_); } + } + public int PlayersRemovedCount { + get { return playersRemoved_.Count; } + } + public uint GetPlayersRemoved(int index) { + return playersRemoved_[index]; + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _clearRecentPlayersResponseFieldNames; + if (playersRemoved_.Count > 0) { + output.WriteFixed32Array(1, field_names[0], playersRemoved_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + dataSize = 4 * playersRemoved_.Count; + size += dataSize; + size += 1 * playersRemoved_.Count; + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ClearRecentPlayersResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ClearRecentPlayersResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ClearRecentPlayersResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ClearRecentPlayersResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ClearRecentPlayersResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ClearRecentPlayersResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ClearRecentPlayersResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ClearRecentPlayersResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ClearRecentPlayersResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ClearRecentPlayersResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ClearRecentPlayersResponse MakeReadOnly() { + playersRemoved_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ClearRecentPlayersResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ClearRecentPlayersResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ClearRecentPlayersResponse result; + + private ClearRecentPlayersResponse PrepareBuilder() { + if (resultIsReadOnly) { + ClearRecentPlayersResponse original = result; + result = new ClearRecentPlayersResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ClearRecentPlayersResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.user_manager.ClearRecentPlayersResponse.Descriptor; } + } + + public override ClearRecentPlayersResponse DefaultInstanceForType { + get { return global::bnet.protocol.user_manager.ClearRecentPlayersResponse.DefaultInstance; } + } + + public override ClearRecentPlayersResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ClearRecentPlayersResponse) { + return MergeFrom((ClearRecentPlayersResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ClearRecentPlayersResponse other) { + if (other == global::bnet.protocol.user_manager.ClearRecentPlayersResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.playersRemoved_.Count != 0) { + result.playersRemoved_.Add(other.playersRemoved_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_clearRecentPlayersResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _clearRecentPlayersResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: + case 13: { + input.ReadFixed32Array(tag, field_name, result.playersRemoved_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList PlayersRemovedList { + get { return PrepareBuilder().playersRemoved_; } + } + public int PlayersRemovedCount { + get { return result.PlayersRemovedCount; } + } + public uint GetPlayersRemoved(int index) { + return result.GetPlayersRemoved(index); + } + public Builder SetPlayersRemoved(int index, uint value) { + PrepareBuilder(); + result.playersRemoved_[index] = value; + return this; + } + public Builder AddPlayersRemoved(uint value) { + PrepareBuilder(); + result.playersRemoved_.Add(value); + return this; + } + public Builder AddRangePlayersRemoved(scg::IEnumerable values) { + PrepareBuilder(); + result.playersRemoved_.Add(values); + return this; + } + public Builder ClearPlayersRemoved() { + PrepareBuilder(); + result.playersRemoved_.Clear(); + return this; + } + } + static ClearRecentPlayersResponse() { + object.ReferenceEquals(global::bnet.protocol.user_manager.Proto.UserManagerService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class BlockEntityRequest : pb::GeneratedMessage { + private BlockEntityRequest() { } + private static readonly BlockEntityRequest defaultInstance = new BlockEntityRequest().MakeReadOnly(); + private static readonly string[] _blockEntityRequestFieldNames = new string[] { "agent_id", "role", "target_id" }; + private static readonly uint[] _blockEntityRequestFieldTags = new uint[] { 10, 24, 18 }; + public static BlockEntityRequest DefaultInstance { + get { return defaultInstance; } + } + + public override BlockEntityRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override BlockEntityRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.user_manager.Proto.UserManagerService.internal__static_bnet_protocol_user_manager_BlockEntityRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.user_manager.Proto.UserManagerService.internal__static_bnet_protocol_user_manager_BlockEntityRequest__FieldAccessorTable; } + } + + public const int AgentIdFieldNumber = 1; + private bool hasAgentId; + private global::bnet.protocol.EntityId agentId_; + public bool HasAgentId { + get { return hasAgentId; } + } + public global::bnet.protocol.EntityId AgentId { + get { return agentId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int TargetIdFieldNumber = 2; + private bool hasTargetId; + private global::bnet.protocol.EntityId targetId_; + public bool HasTargetId { + get { return hasTargetId; } + } + public global::bnet.protocol.EntityId TargetId { + get { return targetId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int RoleFieldNumber = 3; + private bool hasRole; + private uint role_; + public bool HasRole { + get { return hasRole; } + } + public uint Role { + get { return role_; } + } + + public override bool IsInitialized { + get { + if (!hasTargetId) return false; + if (HasAgentId) { + if (!AgentId.IsInitialized) return false; + } + if (!TargetId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _blockEntityRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); + } + if (hasTargetId) { + output.WriteMessage(2, field_names[2], TargetId); + } + if (hasRole) { + output.WriteUInt32(3, field_names[1], Role); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAgentId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); + } + if (hasTargetId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, TargetId); + } + if (hasRole) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, Role); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static BlockEntityRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static BlockEntityRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static BlockEntityRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static BlockEntityRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static BlockEntityRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static BlockEntityRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static BlockEntityRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static BlockEntityRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static BlockEntityRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static BlockEntityRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private BlockEntityRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(BlockEntityRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(BlockEntityRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private BlockEntityRequest result; + + private BlockEntityRequest PrepareBuilder() { + if (resultIsReadOnly) { + BlockEntityRequest original = result; + result = new BlockEntityRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override BlockEntityRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.user_manager.BlockEntityRequest.Descriptor; } + } + + public override BlockEntityRequest DefaultInstanceForType { + get { return global::bnet.protocol.user_manager.BlockEntityRequest.DefaultInstance; } + } + + public override BlockEntityRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is BlockEntityRequest) { + return MergeFrom((BlockEntityRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(BlockEntityRequest other) { + if (other == global::bnet.protocol.user_manager.BlockEntityRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAgentId) { + MergeAgentId(other.AgentId); + } + if (other.HasTargetId) { + MergeTargetId(other.TargetId); + } + if (other.HasRole) { + Role = other.Role; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_blockEntityRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _blockEntityRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasAgentId) { + subBuilder.MergeFrom(AgentId); + } + input.ReadMessage(subBuilder, extensionRegistry); + AgentId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasTargetId) { + subBuilder.MergeFrom(TargetId); + } + input.ReadMessage(subBuilder, extensionRegistry); + TargetId = subBuilder.BuildPartial(); + break; + } + case 24: { + result.hasRole = input.ReadUInt32(ref result.role_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAgentId { + get { return result.hasAgentId; } + } + public global::bnet.protocol.EntityId AgentId { + get { return result.AgentId; } + set { SetAgentId(value); } + } + public Builder SetAgentId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAgentId = true; + result.agentId_ = value; + return this; + } + public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAgentId = true; + result.agentId_ = builderForValue.Build(); + return this; + } + public Builder MergeAgentId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAgentId && + result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); + } else { + result.agentId_ = value; + } + result.hasAgentId = true; + return this; + } + public Builder ClearAgentId() { + PrepareBuilder(); + result.hasAgentId = false; + result.agentId_ = null; + return this; + } + + public bool HasTargetId { + get { return result.hasTargetId; } + } + public global::bnet.protocol.EntityId TargetId { + get { return result.TargetId; } + set { SetTargetId(value); } + } + public Builder SetTargetId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTargetId = true; + result.targetId_ = value; + return this; + } + public Builder SetTargetId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasTargetId = true; + result.targetId_ = builderForValue.Build(); + return this; + } + public Builder MergeTargetId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasTargetId && + result.targetId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.targetId_ = global::bnet.protocol.EntityId.CreateBuilder(result.targetId_).MergeFrom(value).BuildPartial(); + } else { + result.targetId_ = value; + } + result.hasTargetId = true; + return this; + } + public Builder ClearTargetId() { + PrepareBuilder(); + result.hasTargetId = false; + result.targetId_ = null; + return this; + } + + public bool HasRole { + get { return result.hasRole; } + } + public uint Role { + get { return result.Role; } + set { SetRole(value); } + } + public Builder SetRole(uint value) { + PrepareBuilder(); + result.hasRole = true; + result.role_ = value; + return this; + } + public Builder ClearRole() { + PrepareBuilder(); + result.hasRole = false; + result.role_ = 0; + return this; + } + } + static BlockEntityRequest() { + object.ReferenceEquals(global::bnet.protocol.user_manager.Proto.UserManagerService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class UnblockEntityRequest : pb::GeneratedMessage { + private UnblockEntityRequest() { } + private static readonly UnblockEntityRequest defaultInstance = new UnblockEntityRequest().MakeReadOnly(); + private static readonly string[] _unblockEntityRequestFieldNames = new string[] { "agent_id", "target_id" }; + private static readonly uint[] _unblockEntityRequestFieldTags = new uint[] { 10, 18 }; + public static UnblockEntityRequest DefaultInstance { + get { return defaultInstance; } + } + + public override UnblockEntityRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override UnblockEntityRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.user_manager.Proto.UserManagerService.internal__static_bnet_protocol_user_manager_UnblockEntityRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.user_manager.Proto.UserManagerService.internal__static_bnet_protocol_user_manager_UnblockEntityRequest__FieldAccessorTable; } + } + + public const int AgentIdFieldNumber = 1; + private bool hasAgentId; + private global::bnet.protocol.EntityId agentId_; + public bool HasAgentId { + get { return hasAgentId; } + } + public global::bnet.protocol.EntityId AgentId { + get { return agentId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int TargetIdFieldNumber = 2; + private bool hasTargetId; + private global::bnet.protocol.EntityId targetId_; + public bool HasTargetId { + get { return hasTargetId; } + } + public global::bnet.protocol.EntityId TargetId { + get { return targetId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasTargetId) return false; + if (HasAgentId) { + if (!AgentId.IsInitialized) return false; + } + if (!TargetId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _unblockEntityRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); + } + if (hasTargetId) { + output.WriteMessage(2, field_names[1], TargetId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasAgentId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); + } + if (hasTargetId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, TargetId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static UnblockEntityRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UnblockEntityRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UnblockEntityRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UnblockEntityRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UnblockEntityRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UnblockEntityRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static UnblockEntityRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static UnblockEntityRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static UnblockEntityRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UnblockEntityRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private UnblockEntityRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(UnblockEntityRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(UnblockEntityRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private UnblockEntityRequest result; + + private UnblockEntityRequest PrepareBuilder() { + if (resultIsReadOnly) { + UnblockEntityRequest original = result; + result = new UnblockEntityRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override UnblockEntityRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.user_manager.UnblockEntityRequest.Descriptor; } + } + + public override UnblockEntityRequest DefaultInstanceForType { + get { return global::bnet.protocol.user_manager.UnblockEntityRequest.DefaultInstance; } + } + + public override UnblockEntityRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is UnblockEntityRequest) { + return MergeFrom((UnblockEntityRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(UnblockEntityRequest other) { + if (other == global::bnet.protocol.user_manager.UnblockEntityRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAgentId) { + MergeAgentId(other.AgentId); + } + if (other.HasTargetId) { + MergeTargetId(other.TargetId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_unblockEntityRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _unblockEntityRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasAgentId) { + subBuilder.MergeFrom(AgentId); + } + input.ReadMessage(subBuilder, extensionRegistry); + AgentId = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasTargetId) { + subBuilder.MergeFrom(TargetId); + } + input.ReadMessage(subBuilder, extensionRegistry); + TargetId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasAgentId { + get { return result.hasAgentId; } + } + public global::bnet.protocol.EntityId AgentId { + get { return result.AgentId; } + set { SetAgentId(value); } + } + public Builder SetAgentId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAgentId = true; + result.agentId_ = value; + return this; + } + public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasAgentId = true; + result.agentId_ = builderForValue.Build(); + return this; + } + public Builder MergeAgentId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasAgentId && + result.agentId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.agentId_ = global::bnet.protocol.EntityId.CreateBuilder(result.agentId_).MergeFrom(value).BuildPartial(); + } else { + result.agentId_ = value; + } + result.hasAgentId = true; + return this; + } + public Builder ClearAgentId() { + PrepareBuilder(); + result.hasAgentId = false; + result.agentId_ = null; + return this; + } + + public bool HasTargetId { + get { return result.hasTargetId; } + } + public global::bnet.protocol.EntityId TargetId { + get { return result.TargetId; } + set { SetTargetId(value); } + } + public Builder SetTargetId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTargetId = true; + result.targetId_ = value; + return this; + } + public Builder SetTargetId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasTargetId = true; + result.targetId_ = builderForValue.Build(); + return this; + } + public Builder MergeTargetId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasTargetId && + result.targetId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.targetId_ = global::bnet.protocol.EntityId.CreateBuilder(result.targetId_).MergeFrom(value).BuildPartial(); + } else { + result.targetId_ = value; + } + result.hasTargetId = true; + return this; + } + public Builder ClearTargetId() { + PrepareBuilder(); + result.hasTargetId = false; + result.targetId_ = null; + return this; + } + } + static UnblockEntityRequest() { + object.ReferenceEquals(global::bnet.protocol.user_manager.Proto.UserManagerService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class EntityBlockedNotification : pb::GeneratedMessage { + private EntityBlockedNotification() { } + private static readonly EntityBlockedNotification defaultInstance = new EntityBlockedNotification().MakeReadOnly(); + private static readonly string[] _entityBlockedNotificationFieldNames = new string[] { "blocked_entity", "game_account_id" }; + private static readonly uint[] _entityBlockedNotificationFieldTags = new uint[] { 10, 18 }; + public static EntityBlockedNotification DefaultInstance { + get { return defaultInstance; } + } + + public override EntityBlockedNotification DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override EntityBlockedNotification ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.user_manager.Proto.UserManagerService.internal__static_bnet_protocol_user_manager_EntityBlockedNotification__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.user_manager.Proto.UserManagerService.internal__static_bnet_protocol_user_manager_EntityBlockedNotification__FieldAccessorTable; } + } + + public const int BlockedEntityFieldNumber = 1; + private bool hasBlockedEntity; + private global::bnet.protocol.user_manager.BlockedEntity blockedEntity_; + public bool HasBlockedEntity { + get { return hasBlockedEntity; } + } + public global::bnet.protocol.user_manager.BlockedEntity BlockedEntity { + get { return blockedEntity_ ?? global::bnet.protocol.user_manager.BlockedEntity.DefaultInstance; } + } + + public const int GameAccountIdFieldNumber = 2; + private bool hasGameAccountId; + private global::bnet.protocol.EntityId gameAccountId_; + public bool HasGameAccountId { + get { return hasGameAccountId; } + } + public global::bnet.protocol.EntityId GameAccountId { + get { return gameAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasBlockedEntity) return false; + if (!BlockedEntity.IsInitialized) return false; + if (HasGameAccountId) { + if (!GameAccountId.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _entityBlockedNotificationFieldNames; + if (hasBlockedEntity) { + output.WriteMessage(1, field_names[0], BlockedEntity); + } + if (hasGameAccountId) { + output.WriteMessage(2, field_names[1], GameAccountId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasBlockedEntity) { + size += pb::CodedOutputStream.ComputeMessageSize(1, BlockedEntity); + } + if (hasGameAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, GameAccountId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static EntityBlockedNotification ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static EntityBlockedNotification ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static EntityBlockedNotification ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static EntityBlockedNotification ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static EntityBlockedNotification ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static EntityBlockedNotification ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static EntityBlockedNotification ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static EntityBlockedNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static EntityBlockedNotification ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static EntityBlockedNotification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private EntityBlockedNotification MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(EntityBlockedNotification prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(EntityBlockedNotification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private EntityBlockedNotification result; + + private EntityBlockedNotification PrepareBuilder() { + if (resultIsReadOnly) { + EntityBlockedNotification original = result; + result = new EntityBlockedNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override EntityBlockedNotification MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.user_manager.EntityBlockedNotification.Descriptor; } + } + + public override EntityBlockedNotification DefaultInstanceForType { + get { return global::bnet.protocol.user_manager.EntityBlockedNotification.DefaultInstance; } + } + + public override EntityBlockedNotification BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is EntityBlockedNotification) { + return MergeFrom((EntityBlockedNotification) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(EntityBlockedNotification other) { + if (other == global::bnet.protocol.user_manager.EntityBlockedNotification.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasBlockedEntity) { + MergeBlockedEntity(other.BlockedEntity); + } + if (other.HasGameAccountId) { + MergeGameAccountId(other.GameAccountId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_entityBlockedNotificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _entityBlockedNotificationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.user_manager.BlockedEntity.Builder subBuilder = global::bnet.protocol.user_manager.BlockedEntity.CreateBuilder(); + if (result.hasBlockedEntity) { + subBuilder.MergeFrom(BlockedEntity); + } + input.ReadMessage(subBuilder, extensionRegistry); + BlockedEntity = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasGameAccountId) { + subBuilder.MergeFrom(GameAccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + GameAccountId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasBlockedEntity { + get { return result.hasBlockedEntity; } + } + public global::bnet.protocol.user_manager.BlockedEntity BlockedEntity { + get { return result.BlockedEntity; } + set { SetBlockedEntity(value); } + } + public Builder SetBlockedEntity(global::bnet.protocol.user_manager.BlockedEntity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBlockedEntity = true; + result.blockedEntity_ = value; + return this; + } + public Builder SetBlockedEntity(global::bnet.protocol.user_manager.BlockedEntity.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasBlockedEntity = true; + result.blockedEntity_ = builderForValue.Build(); + return this; + } + public Builder MergeBlockedEntity(global::bnet.protocol.user_manager.BlockedEntity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasBlockedEntity && + result.blockedEntity_ != global::bnet.protocol.user_manager.BlockedEntity.DefaultInstance) { + result.blockedEntity_ = global::bnet.protocol.user_manager.BlockedEntity.CreateBuilder(result.blockedEntity_).MergeFrom(value).BuildPartial(); + } else { + result.blockedEntity_ = value; + } + result.hasBlockedEntity = true; + return this; + } + public Builder ClearBlockedEntity() { + PrepareBuilder(); + result.hasBlockedEntity = false; + result.blockedEntity_ = null; + return this; + } + + public bool HasGameAccountId { + get { return result.hasGameAccountId; } + } + public global::bnet.protocol.EntityId GameAccountId { + get { return result.GameAccountId; } + set { SetGameAccountId(value); } + } + public Builder SetGameAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasGameAccountId = true; + result.gameAccountId_ = value; + return this; + } + public Builder SetGameAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasGameAccountId = true; + result.gameAccountId_ = builderForValue.Build(); + return this; + } + public Builder MergeGameAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasGameAccountId && + result.gameAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.gameAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccountId_).MergeFrom(value).BuildPartial(); + } else { + result.gameAccountId_ = value; + } + result.hasGameAccountId = true; + return this; + } + public Builder ClearGameAccountId() { + PrepareBuilder(); + result.hasGameAccountId = false; + result.gameAccountId_ = null; + return this; + } + } + static EntityBlockedNotification() { + object.ReferenceEquals(global::bnet.protocol.user_manager.Proto.UserManagerService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class EntityUnblockedNotification : pb::GeneratedMessage { + private EntityUnblockedNotification() { } + private static readonly EntityUnblockedNotification defaultInstance = new EntityUnblockedNotification().MakeReadOnly(); + private static readonly string[] _entityUnblockedNotificationFieldNames = new string[] { "game_account_id", "unblocked_entity" }; + private static readonly uint[] _entityUnblockedNotificationFieldTags = new uint[] { 18, 10 }; + public static EntityUnblockedNotification DefaultInstance { + get { return defaultInstance; } + } + + public override EntityUnblockedNotification DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override EntityUnblockedNotification ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.user_manager.Proto.UserManagerService.internal__static_bnet_protocol_user_manager_EntityUnblockedNotification__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.user_manager.Proto.UserManagerService.internal__static_bnet_protocol_user_manager_EntityUnblockedNotification__FieldAccessorTable; } + } + + public const int UnblockedEntityFieldNumber = 1; + private bool hasUnblockedEntity; + private global::bnet.protocol.user_manager.BlockedEntity unblockedEntity_; + public bool HasUnblockedEntity { + get { return hasUnblockedEntity; } + } + public global::bnet.protocol.user_manager.BlockedEntity UnblockedEntity { + get { return unblockedEntity_ ?? global::bnet.protocol.user_manager.BlockedEntity.DefaultInstance; } + } + + public const int GameAccountIdFieldNumber = 2; + private bool hasGameAccountId; + private global::bnet.protocol.EntityId gameAccountId_; + public bool HasGameAccountId { + get { return hasGameAccountId; } + } + public global::bnet.protocol.EntityId GameAccountId { + get { return gameAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasUnblockedEntity) return false; + if (!UnblockedEntity.IsInitialized) return false; + if (HasGameAccountId) { + if (!GameAccountId.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _entityUnblockedNotificationFieldNames; + if (hasUnblockedEntity) { + output.WriteMessage(1, field_names[1], UnblockedEntity); + } + if (hasGameAccountId) { + output.WriteMessage(2, field_names[0], GameAccountId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasUnblockedEntity) { + size += pb::CodedOutputStream.ComputeMessageSize(1, UnblockedEntity); + } + if (hasGameAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, GameAccountId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static EntityUnblockedNotification ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static EntityUnblockedNotification ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static EntityUnblockedNotification ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static EntityUnblockedNotification ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static EntityUnblockedNotification ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static EntityUnblockedNotification ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static EntityUnblockedNotification ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static EntityUnblockedNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static EntityUnblockedNotification ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static EntityUnblockedNotification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private EntityUnblockedNotification MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(EntityUnblockedNotification prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(EntityUnblockedNotification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private EntityUnblockedNotification result; + + private EntityUnblockedNotification PrepareBuilder() { + if (resultIsReadOnly) { + EntityUnblockedNotification original = result; + result = new EntityUnblockedNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override EntityUnblockedNotification MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.user_manager.EntityUnblockedNotification.Descriptor; } + } + + public override EntityUnblockedNotification DefaultInstanceForType { + get { return global::bnet.protocol.user_manager.EntityUnblockedNotification.DefaultInstance; } + } + + public override EntityUnblockedNotification BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is EntityUnblockedNotification) { + return MergeFrom((EntityUnblockedNotification) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(EntityUnblockedNotification other) { + if (other == global::bnet.protocol.user_manager.EntityUnblockedNotification.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasUnblockedEntity) { + MergeUnblockedEntity(other.UnblockedEntity); + } + if (other.HasGameAccountId) { + MergeGameAccountId(other.GameAccountId); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_entityUnblockedNotificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _entityUnblockedNotificationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.user_manager.BlockedEntity.Builder subBuilder = global::bnet.protocol.user_manager.BlockedEntity.CreateBuilder(); + if (result.hasUnblockedEntity) { + subBuilder.MergeFrom(UnblockedEntity); + } + input.ReadMessage(subBuilder, extensionRegistry); + UnblockedEntity = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasGameAccountId) { + subBuilder.MergeFrom(GameAccountId); + } + input.ReadMessage(subBuilder, extensionRegistry); + GameAccountId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasUnblockedEntity { + get { return result.hasUnblockedEntity; } + } + public global::bnet.protocol.user_manager.BlockedEntity UnblockedEntity { + get { return result.UnblockedEntity; } + set { SetUnblockedEntity(value); } + } + public Builder SetUnblockedEntity(global::bnet.protocol.user_manager.BlockedEntity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasUnblockedEntity = true; + result.unblockedEntity_ = value; + return this; + } + public Builder SetUnblockedEntity(global::bnet.protocol.user_manager.BlockedEntity.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasUnblockedEntity = true; + result.unblockedEntity_ = builderForValue.Build(); + return this; + } + public Builder MergeUnblockedEntity(global::bnet.protocol.user_manager.BlockedEntity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasUnblockedEntity && + result.unblockedEntity_ != global::bnet.protocol.user_manager.BlockedEntity.DefaultInstance) { + result.unblockedEntity_ = global::bnet.protocol.user_manager.BlockedEntity.CreateBuilder(result.unblockedEntity_).MergeFrom(value).BuildPartial(); + } else { + result.unblockedEntity_ = value; + } + result.hasUnblockedEntity = true; + return this; + } + public Builder ClearUnblockedEntity() { + PrepareBuilder(); + result.hasUnblockedEntity = false; + result.unblockedEntity_ = null; + return this; + } + + public bool HasGameAccountId { + get { return result.hasGameAccountId; } + } + public global::bnet.protocol.EntityId GameAccountId { + get { return result.GameAccountId; } + set { SetGameAccountId(value); } + } + public Builder SetGameAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasGameAccountId = true; + result.gameAccountId_ = value; + return this; + } + public Builder SetGameAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasGameAccountId = true; + result.gameAccountId_ = builderForValue.Build(); + return this; + } + public Builder MergeGameAccountId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasGameAccountId && + result.gameAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.gameAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccountId_).MergeFrom(value).BuildPartial(); + } else { + result.gameAccountId_ = value; + } + result.hasGameAccountId = true; + return this; + } + public Builder ClearGameAccountId() { + PrepareBuilder(); + result.hasGameAccountId = false; + result.gameAccountId_ = null; + return this; + } + } + static EntityUnblockedNotification() { + object.ReferenceEquals(global::bnet.protocol.user_manager.Proto.UserManagerService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class RecentPlayersAddedNotification : pb::GeneratedMessage { + private RecentPlayersAddedNotification() { } + private static readonly RecentPlayersAddedNotification defaultInstance = new RecentPlayersAddedNotification().MakeReadOnly(); + private static readonly string[] _recentPlayersAddedNotificationFieldNames = new string[] { "added_players" }; + private static readonly uint[] _recentPlayersAddedNotificationFieldTags = new uint[] { 10 }; + public static RecentPlayersAddedNotification DefaultInstance { + get { return defaultInstance; } + } + + public override RecentPlayersAddedNotification DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override RecentPlayersAddedNotification ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.user_manager.Proto.UserManagerService.internal__static_bnet_protocol_user_manager_RecentPlayersAddedNotification__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.user_manager.Proto.UserManagerService.internal__static_bnet_protocol_user_manager_RecentPlayersAddedNotification__FieldAccessorTable; } + } + + public const int AddedPlayersFieldNumber = 1; + private pbc::PopsicleList addedPlayers_ = new pbc::PopsicleList(); + public scg::IList AddedPlayersList { + get { return addedPlayers_; } + } + public int AddedPlayersCount { + get { return addedPlayers_.Count; } + } + public global::bnet.protocol.user_manager.RecentPlayer GetAddedPlayers(int index) { + return addedPlayers_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.user_manager.RecentPlayer element in AddedPlayersList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _recentPlayersAddedNotificationFieldNames; + if (addedPlayers_.Count > 0) { + output.WriteMessageArray(1, field_names[0], addedPlayers_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.user_manager.RecentPlayer element in AddedPlayersList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static RecentPlayersAddedNotification ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RecentPlayersAddedNotification ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RecentPlayersAddedNotification ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RecentPlayersAddedNotification ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RecentPlayersAddedNotification ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RecentPlayersAddedNotification ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static RecentPlayersAddedNotification ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static RecentPlayersAddedNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static RecentPlayersAddedNotification ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RecentPlayersAddedNotification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private RecentPlayersAddedNotification MakeReadOnly() { + addedPlayers_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(RecentPlayersAddedNotification prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(RecentPlayersAddedNotification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private RecentPlayersAddedNotification result; + + private RecentPlayersAddedNotification PrepareBuilder() { + if (resultIsReadOnly) { + RecentPlayersAddedNotification original = result; + result = new RecentPlayersAddedNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override RecentPlayersAddedNotification MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.user_manager.RecentPlayersAddedNotification.Descriptor; } + } + + public override RecentPlayersAddedNotification DefaultInstanceForType { + get { return global::bnet.protocol.user_manager.RecentPlayersAddedNotification.DefaultInstance; } + } + + public override RecentPlayersAddedNotification BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is RecentPlayersAddedNotification) { + return MergeFrom((RecentPlayersAddedNotification) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(RecentPlayersAddedNotification other) { + if (other == global::bnet.protocol.user_manager.RecentPlayersAddedNotification.DefaultInstance) return this; + PrepareBuilder(); + if (other.addedPlayers_.Count != 0) { + result.addedPlayers_.Add(other.addedPlayers_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_recentPlayersAddedNotificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _recentPlayersAddedNotificationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.addedPlayers_, global::bnet.protocol.user_manager.RecentPlayer.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList AddedPlayersList { + get { return PrepareBuilder().addedPlayers_; } + } + public int AddedPlayersCount { + get { return result.AddedPlayersCount; } + } + public global::bnet.protocol.user_manager.RecentPlayer GetAddedPlayers(int index) { + return result.GetAddedPlayers(index); + } + public Builder SetAddedPlayers(int index, global::bnet.protocol.user_manager.RecentPlayer value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.addedPlayers_[index] = value; + return this; + } + public Builder SetAddedPlayers(int index, global::bnet.protocol.user_manager.RecentPlayer.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.addedPlayers_[index] = builderForValue.Build(); + return this; + } + public Builder AddAddedPlayers(global::bnet.protocol.user_manager.RecentPlayer value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.addedPlayers_.Add(value); + return this; + } + public Builder AddAddedPlayers(global::bnet.protocol.user_manager.RecentPlayer.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.addedPlayers_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeAddedPlayers(scg::IEnumerable values) { + PrepareBuilder(); + result.addedPlayers_.Add(values); + return this; + } + public Builder ClearAddedPlayers() { + PrepareBuilder(); + result.addedPlayers_.Clear(); + return this; + } + } + static RecentPlayersAddedNotification() { + object.ReferenceEquals(global::bnet.protocol.user_manager.Proto.UserManagerService.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class RecentPlayersRemovedNotification : pb::GeneratedMessage { + private RecentPlayersRemovedNotification() { } + private static readonly RecentPlayersRemovedNotification defaultInstance = new RecentPlayersRemovedNotification().MakeReadOnly(); + private static readonly string[] _recentPlayersRemovedNotificationFieldNames = new string[] { "removed_players" }; + private static readonly uint[] _recentPlayersRemovedNotificationFieldTags = new uint[] { 10 }; + public static RecentPlayersRemovedNotification DefaultInstance { + get { return defaultInstance; } + } + + public override RecentPlayersRemovedNotification DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override RecentPlayersRemovedNotification ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.user_manager.Proto.UserManagerService.internal__static_bnet_protocol_user_manager_RecentPlayersRemovedNotification__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.user_manager.Proto.UserManagerService.internal__static_bnet_protocol_user_manager_RecentPlayersRemovedNotification__FieldAccessorTable; } + } + + public const int RemovedPlayersFieldNumber = 1; + private pbc::PopsicleList removedPlayers_ = new pbc::PopsicleList(); + public scg::IList RemovedPlayersList { + get { return removedPlayers_; } + } + public int RemovedPlayersCount { + get { return removedPlayers_.Count; } + } + public global::bnet.protocol.user_manager.RecentPlayer GetRemovedPlayers(int index) { + return removedPlayers_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.user_manager.RecentPlayer element in RemovedPlayersList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _recentPlayersRemovedNotificationFieldNames; + if (removedPlayers_.Count > 0) { + output.WriteMessageArray(1, field_names[0], removedPlayers_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::bnet.protocol.user_manager.RecentPlayer element in RemovedPlayersList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static RecentPlayersRemovedNotification ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RecentPlayersRemovedNotification ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RecentPlayersRemovedNotification ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RecentPlayersRemovedNotification ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RecentPlayersRemovedNotification ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RecentPlayersRemovedNotification ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static RecentPlayersRemovedNotification ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static RecentPlayersRemovedNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static RecentPlayersRemovedNotification ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RecentPlayersRemovedNotification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private RecentPlayersRemovedNotification MakeReadOnly() { + removedPlayers_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(RecentPlayersRemovedNotification prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(RecentPlayersRemovedNotification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private RecentPlayersRemovedNotification result; + + private RecentPlayersRemovedNotification PrepareBuilder() { + if (resultIsReadOnly) { + RecentPlayersRemovedNotification original = result; + result = new RecentPlayersRemovedNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override RecentPlayersRemovedNotification MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.user_manager.RecentPlayersRemovedNotification.Descriptor; } + } + + public override RecentPlayersRemovedNotification DefaultInstanceForType { + get { return global::bnet.protocol.user_manager.RecentPlayersRemovedNotification.DefaultInstance; } + } + + public override RecentPlayersRemovedNotification BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is RecentPlayersRemovedNotification) { + return MergeFrom((RecentPlayersRemovedNotification) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(RecentPlayersRemovedNotification other) { + if (other == global::bnet.protocol.user_manager.RecentPlayersRemovedNotification.DefaultInstance) return this; + PrepareBuilder(); + if (other.removedPlayers_.Count != 0) { + result.removedPlayers_.Add(other.removedPlayers_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_recentPlayersRemovedNotificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _recentPlayersRemovedNotificationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.removedPlayers_, global::bnet.protocol.user_manager.RecentPlayer.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList RemovedPlayersList { + get { return PrepareBuilder().removedPlayers_; } + } + public int RemovedPlayersCount { + get { return result.RemovedPlayersCount; } + } + public global::bnet.protocol.user_manager.RecentPlayer GetRemovedPlayers(int index) { + return result.GetRemovedPlayers(index); + } + public Builder SetRemovedPlayers(int index, global::bnet.protocol.user_manager.RecentPlayer value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.removedPlayers_[index] = value; + return this; + } + public Builder SetRemovedPlayers(int index, global::bnet.protocol.user_manager.RecentPlayer.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.removedPlayers_[index] = builderForValue.Build(); + return this; + } + public Builder AddRemovedPlayers(global::bnet.protocol.user_manager.RecentPlayer value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.removedPlayers_.Add(value); + return this; + } + public Builder AddRemovedPlayers(global::bnet.protocol.user_manager.RecentPlayer.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.removedPlayers_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeRemovedPlayers(scg::IEnumerable values) { + PrepareBuilder(); + result.removedPlayers_.Add(values); + return this; + } + public Builder ClearRemovedPlayers() { + PrepareBuilder(); + result.removedPlayers_.Clear(); + return this; + } + } + static RecentPlayersRemovedNotification() { + object.ReferenceEquals(global::bnet.protocol.user_manager.Proto.UserManagerService.Descriptor, null); + } + } + + #endregion + + #region Services + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public abstract class UserManagerService : pb::IService { + public abstract void SubscribeToUserManager( + pb::IRpcController controller, + global::bnet.protocol.user_manager.SubscribeToUserManagerRequest request, + global::System.Action done); + public abstract void AddRecentPlayers( + pb::IRpcController controller, + global::bnet.protocol.user_manager.AddRecentPlayersRequest request, + global::System.Action done); + public abstract void ClearRecentPlayers( + pb::IRpcController controller, + global::bnet.protocol.NoData request, + global::System.Action done); + public abstract void BlockEntity( + pb::IRpcController controller, + global::bnet.protocol.user_manager.BlockEntityRequest request, + global::System.Action done); + public abstract void UnblockEntity( + pb::IRpcController controller, + global::bnet.protocol.user_manager.UnblockEntityRequest request, + global::System.Action done); + public abstract void BlockEntityForSession( + pb::IRpcController controller, + global::bnet.protocol.user_manager.BlockEntityRequest request, + global::System.Action done); + public abstract void LoadBlockList( + pb::IRpcController controller, + global::bnet.protocol.EntityId request, + global::System.Action done); + + public static pbd::ServiceDescriptor Descriptor { + get { return Proto.UserManagerService.Descriptor.Services[0]; } + } + public pbd::ServiceDescriptor DescriptorForType { + get { return Descriptor; } + } + + public void CallMethod( + pbd::MethodDescriptor method, + pb::IRpcController controller, + pb::IMessage request, + global::System.Action done) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.CallMethod() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + this.SubscribeToUserManager(controller, (global::bnet.protocol.user_manager.SubscribeToUserManagerRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 1: + this.AddRecentPlayers(controller, (global::bnet.protocol.user_manager.AddRecentPlayersRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 2: + this.ClearRecentPlayers(controller, (global::bnet.protocol.NoData) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 3: + this.BlockEntity(controller, (global::bnet.protocol.user_manager.BlockEntityRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 4: + this.UnblockEntity(controller, (global::bnet.protocol.user_manager.UnblockEntityRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 5: + this.BlockEntityForSession(controller, (global::bnet.protocol.user_manager.BlockEntityRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 6: + this.LoadBlockList(controller, (global::bnet.protocol.EntityId) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetRequestPrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.user_manager.SubscribeToUserManagerRequest.DefaultInstance; + case 1: + return global::bnet.protocol.user_manager.AddRecentPlayersRequest.DefaultInstance; + case 2: + return global::bnet.protocol.NoData.DefaultInstance; + case 3: + return global::bnet.protocol.user_manager.BlockEntityRequest.DefaultInstance; + case 4: + return global::bnet.protocol.user_manager.UnblockEntityRequest.DefaultInstance; + case 5: + return global::bnet.protocol.user_manager.BlockEntityRequest.DefaultInstance; + case 6: + return global::bnet.protocol.EntityId.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetResponsePrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.user_manager.SubscribeToUserManagerResponse.DefaultInstance; + case 1: + return global::bnet.protocol.user_manager.AddRecentPlayersResponse.DefaultInstance; + case 2: + return global::bnet.protocol.user_manager.ClearRecentPlayersResponse.DefaultInstance; + case 3: + return global::bnet.protocol.NoData.DefaultInstance; + case 4: + return global::bnet.protocol.NoData.DefaultInstance; + case 5: + return global::bnet.protocol.NoData.DefaultInstance; + case 6: + return global::bnet.protocol.NoData.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public static Stub CreateStub(pb::IRpcChannel channel) { + return new Stub(channel); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public class Stub : global::bnet.protocol.user_manager.UserManagerService { + internal Stub(pb::IRpcChannel channel) { + this.channel = channel; + } + + private readonly pb::IRpcChannel channel; + + public pb::IRpcChannel Channel { + get { return channel; } + } + + public override void SubscribeToUserManager( + pb::IRpcController controller, + global::bnet.protocol.user_manager.SubscribeToUserManagerRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[0], + controller, request, global::bnet.protocol.user_manager.SubscribeToUserManagerResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.user_manager.SubscribeToUserManagerResponse.DefaultInstance)); + } + + public override void AddRecentPlayers( + pb::IRpcController controller, + global::bnet.protocol.user_manager.AddRecentPlayersRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[1], + controller, request, global::bnet.protocol.user_manager.AddRecentPlayersResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.user_manager.AddRecentPlayersResponse.DefaultInstance)); + } + + public override void ClearRecentPlayers( + pb::IRpcController controller, + global::bnet.protocol.NoData request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[2], + controller, request, global::bnet.protocol.user_manager.ClearRecentPlayersResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.user_manager.ClearRecentPlayersResponse.DefaultInstance)); + } + + public override void BlockEntity( + pb::IRpcController controller, + global::bnet.protocol.user_manager.BlockEntityRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[3], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void UnblockEntity( + pb::IRpcController controller, + global::bnet.protocol.user_manager.UnblockEntityRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[4], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void BlockEntityForSession( + pb::IRpcController controller, + global::bnet.protocol.user_manager.BlockEntityRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[5], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void LoadBlockList( + pb::IRpcController controller, + global::bnet.protocol.EntityId request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[6], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public abstract class UserManagerNotify : pb::IService { + public abstract void NotifyEntityBlocked( + pb::IRpcController controller, + global::bnet.protocol.user_manager.EntityBlockedNotification request, + global::System.Action done); + public abstract void NotifyEntityUnblocked( + pb::IRpcController controller, + global::bnet.protocol.user_manager.EntityUnblockedNotification request, + global::System.Action done); + public abstract void NotifyRecentPlayersAdded( + pb::IRpcController controller, + global::bnet.protocol.user_manager.RecentPlayersAddedNotification request, + global::System.Action done); + public abstract void NotifyRecentPlayersRemoved( + pb::IRpcController controller, + global::bnet.protocol.user_manager.RecentPlayersRemovedNotification request, + global::System.Action done); + + public static pbd::ServiceDescriptor Descriptor { + get { return Proto.UserManagerService.Descriptor.Services[1]; } + } + public pbd::ServiceDescriptor DescriptorForType { + get { return Descriptor; } + } + + public void CallMethod( + pbd::MethodDescriptor method, + pb::IRpcController controller, + pb::IMessage request, + global::System.Action done) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.CallMethod() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + this.NotifyEntityBlocked(controller, (global::bnet.protocol.user_manager.EntityBlockedNotification) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 1: + this.NotifyEntityUnblocked(controller, (global::bnet.protocol.user_manager.EntityUnblockedNotification) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 2: + this.NotifyRecentPlayersAdded(controller, (global::bnet.protocol.user_manager.RecentPlayersAddedNotification) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 3: + this.NotifyRecentPlayersRemoved(controller, (global::bnet.protocol.user_manager.RecentPlayersRemovedNotification) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetRequestPrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.user_manager.EntityBlockedNotification.DefaultInstance; + case 1: + return global::bnet.protocol.user_manager.EntityUnblockedNotification.DefaultInstance; + case 2: + return global::bnet.protocol.user_manager.RecentPlayersAddedNotification.DefaultInstance; + case 3: + return global::bnet.protocol.user_manager.RecentPlayersRemovedNotification.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) { + if (method.Service != Descriptor) { + throw new global::System.ArgumentException( + "Service.GetResponsePrototype() given method descriptor for wrong service type."); + } + switch(method.Index) { + case 0: + return global::bnet.protocol.NO_RESPONSE.DefaultInstance; + case 1: + return global::bnet.protocol.NO_RESPONSE.DefaultInstance; + case 2: + return global::bnet.protocol.NO_RESPONSE.DefaultInstance; + case 3: + return global::bnet.protocol.NO_RESPONSE.DefaultInstance; + default: + throw new global::System.InvalidOperationException("Can't get here."); + } + } + + public static Stub CreateStub(pb::IRpcChannel channel) { + return new Stub(channel); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public class Stub : global::bnet.protocol.user_manager.UserManagerNotify { + internal Stub(pb::IRpcChannel channel) { + this.channel = channel; + } + + private readonly pb::IRpcChannel channel; + + public pb::IRpcChannel Channel { + get { return channel; } + } + + public override void NotifyEntityBlocked( + pb::IRpcController controller, + global::bnet.protocol.user_manager.EntityBlockedNotification request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[0], + controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); + } + + public override void NotifyEntityUnblocked( + pb::IRpcController controller, + global::bnet.protocol.user_manager.EntityUnblockedNotification request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[1], + controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); + } + + public override void NotifyRecentPlayersAdded( + pb::IRpcController controller, + global::bnet.protocol.user_manager.RecentPlayersAddedNotification request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[2], + controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); + } + + public override void NotifyRecentPlayersRemoved( + pb::IRpcController controller, + global::bnet.protocol.user_manager.RecentPlayersRemovedNotification request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[3], + controller, request, global::bnet.protocol.NO_RESPONSE.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); + } + } + } + #endregion + +} + +#endregion Designer generated code diff --git a/src/LibMooNet/bnet/protocol/user_manager/UserManagerTypes.cs b/src/LibMooNet/bnet/protocol/user_manager/UserManagerTypes.cs new file mode 100644 index 00000000..ed28e126 --- /dev/null +++ b/src/LibMooNet/bnet/protocol/user_manager/UserManagerTypes.cs @@ -0,0 +1,1070 @@ +// Generated by ProtoGen, Version=2.4.1.473, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! +#pragma warning disable 1591, 0612 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace bnet.protocol.user_manager { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public static partial class UserManagerTypes { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_RecentPlayer__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_RecentPlayer__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_BlockedEntity__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_BlockedEntity__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static UserManagerTypes() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "Ch1ibmV0L3VzZXJfbWFuYWdlcl90eXBlcy5wcm90bxIaYm5ldC5wcm90b2Nv" + + "bC51c2VyX21hbmFnZXIaEWJuZXQvZW50aXR5LnByb3RvGhRibmV0L2F0dHJp" + + "YnV0ZS5wcm90byLAAQoMUmVjZW50UGxheWVyEicKBmVudGl0eRgBIAIoCzIX" + + "LmJuZXQucHJvdG9jb2wuRW50aXR5SWQSEgoKcHJvZ3JhbV9pZBgCIAEoCRIY" + + "ChB0aW1lc3RhbXBfcGxheWVkGAMgASgGEjYKCmF0dHJpYnV0ZXMYBCADKAsy" + + "Ii5ibmV0LnByb3RvY29sLmF0dHJpYnV0ZS5BdHRyaWJ1dGUSDQoCaWQYBSAB" + + "KAc6ATASEgoHY291bnRlchgGIAEoBzoBMCJrCg1CbG9ja2VkRW50aXR5EiMK" + + "AmlkGAEgAigLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBIMCgRuYW1lGAIg" + + "ASgJEhAKBHJvbGUYAyADKA1CAhABEhUKCnByaXZpbGVnZXMYBCABKAQ6ATA="); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_bnet_protocol_user_manager_RecentPlayer__Descriptor = Descriptor.MessageTypes[0]; + internal__static_bnet_protocol_user_manager_RecentPlayer__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_RecentPlayer__Descriptor, + new string[] { "Entity", "ProgramId", "TimestampPlayed", "Attributes", "Id", "Counter", }); + internal__static_bnet_protocol_user_manager_BlockedEntity__Descriptor = Descriptor.MessageTypes[1]; + internal__static_bnet_protocol_user_manager_BlockedEntity__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_BlockedEntity__Descriptor, + new string[] { "Id", "Name", "Role", "Privileges", }); + return null; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + global::bnet.protocol.Entity.Descriptor, + global::bnet.protocol.attribute.Proto.Attribute.Descriptor, + }, assigner); + } + #endregion + + } + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class RecentPlayer : pb::GeneratedMessage { + private RecentPlayer() { } + private static readonly RecentPlayer defaultInstance = new RecentPlayer().MakeReadOnly(); + private static readonly string[] _recentPlayerFieldNames = new string[] { "attributes", "counter", "entity", "id", "program_id", "timestamp_played" }; + private static readonly uint[] _recentPlayerFieldTags = new uint[] { 34, 53, 10, 45, 18, 25 }; + public static RecentPlayer DefaultInstance { + get { return defaultInstance; } + } + + public override RecentPlayer DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override RecentPlayer ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.user_manager.UserManagerTypes.internal__static_bnet_protocol_user_manager_RecentPlayer__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.user_manager.UserManagerTypes.internal__static_bnet_protocol_user_manager_RecentPlayer__FieldAccessorTable; } + } + + public const int EntityFieldNumber = 1; + private bool hasEntity; + private global::bnet.protocol.EntityId entity_; + public bool HasEntity { + get { return hasEntity; } + } + public global::bnet.protocol.EntityId Entity { + get { return entity_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int ProgramIdFieldNumber = 2; + private bool hasProgramId; + private string programId_ = ""; + public bool HasProgramId { + get { return hasProgramId; } + } + public string ProgramId { + get { return programId_; } + } + + public const int TimestampPlayedFieldNumber = 3; + private bool hasTimestampPlayed; + private ulong timestampPlayed_; + public bool HasTimestampPlayed { + get { return hasTimestampPlayed; } + } + public ulong TimestampPlayed { + get { return timestampPlayed_; } + } + + public const int AttributesFieldNumber = 4; + private pbc::PopsicleList attributes_ = new pbc::PopsicleList(); + public scg::IList AttributesList { + get { return attributes_; } + } + public int AttributesCount { + get { return attributes_.Count; } + } + public global::bnet.protocol.attribute.Attribute GetAttributes(int index) { + return attributes_[index]; + } + + public const int IdFieldNumber = 5; + private bool hasId; + private uint id_; + public bool HasId { + get { return hasId; } + } + public uint Id { + get { return id_; } + } + + public const int CounterFieldNumber = 6; + private bool hasCounter; + private uint counter_; + public bool HasCounter { + get { return hasCounter; } + } + public uint Counter { + get { return counter_; } + } + + public override bool IsInitialized { + get { + if (!hasEntity) return false; + if (!Entity.IsInitialized) return false; + foreach (global::bnet.protocol.attribute.Attribute element in AttributesList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _recentPlayerFieldNames; + if (hasEntity) { + output.WriteMessage(1, field_names[2], Entity); + } + if (hasProgramId) { + output.WriteString(2, field_names[4], ProgramId); + } + if (hasTimestampPlayed) { + output.WriteFixed64(3, field_names[5], TimestampPlayed); + } + if (attributes_.Count > 0) { + output.WriteMessageArray(4, field_names[0], attributes_); + } + if (hasId) { + output.WriteFixed32(5, field_names[3], Id); + } + if (hasCounter) { + output.WriteFixed32(6, field_names[1], Counter); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasEntity) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Entity); + } + if (hasProgramId) { + size += pb::CodedOutputStream.ComputeStringSize(2, ProgramId); + } + if (hasTimestampPlayed) { + size += pb::CodedOutputStream.ComputeFixed64Size(3, TimestampPlayed); + } + foreach (global::bnet.protocol.attribute.Attribute element in AttributesList) { + size += pb::CodedOutputStream.ComputeMessageSize(4, element); + } + if (hasId) { + size += pb::CodedOutputStream.ComputeFixed32Size(5, Id); + } + if (hasCounter) { + size += pb::CodedOutputStream.ComputeFixed32Size(6, Counter); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static RecentPlayer ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RecentPlayer ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RecentPlayer ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RecentPlayer ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RecentPlayer ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RecentPlayer ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static RecentPlayer ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static RecentPlayer ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static RecentPlayer ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RecentPlayer ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private RecentPlayer MakeReadOnly() { + attributes_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(RecentPlayer prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(RecentPlayer cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private RecentPlayer result; + + private RecentPlayer PrepareBuilder() { + if (resultIsReadOnly) { + RecentPlayer original = result; + result = new RecentPlayer(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override RecentPlayer MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.user_manager.RecentPlayer.Descriptor; } + } + + public override RecentPlayer DefaultInstanceForType { + get { return global::bnet.protocol.user_manager.RecentPlayer.DefaultInstance; } + } + + public override RecentPlayer BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is RecentPlayer) { + return MergeFrom((RecentPlayer) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(RecentPlayer other) { + if (other == global::bnet.protocol.user_manager.RecentPlayer.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasEntity) { + MergeEntity(other.Entity); + } + if (other.HasProgramId) { + ProgramId = other.ProgramId; + } + if (other.HasTimestampPlayed) { + TimestampPlayed = other.TimestampPlayed; + } + if (other.attributes_.Count != 0) { + result.attributes_.Add(other.attributes_); + } + if (other.HasId) { + Id = other.Id; + } + if (other.HasCounter) { + Counter = other.Counter; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_recentPlayerFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _recentPlayerFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasEntity) { + subBuilder.MergeFrom(Entity); + } + input.ReadMessage(subBuilder, extensionRegistry); + Entity = subBuilder.BuildPartial(); + break; + } + case 18: { + result.hasProgramId = input.ReadString(ref result.programId_); + break; + } + case 25: { + result.hasTimestampPlayed = input.ReadFixed64(ref result.timestampPlayed_); + break; + } + case 34: { + input.ReadMessageArray(tag, field_name, result.attributes_, global::bnet.protocol.attribute.Attribute.DefaultInstance, extensionRegistry); + break; + } + case 45: { + result.hasId = input.ReadFixed32(ref result.id_); + break; + } + case 53: { + result.hasCounter = input.ReadFixed32(ref result.counter_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasEntity { + get { return result.hasEntity; } + } + public global::bnet.protocol.EntityId Entity { + get { return result.Entity; } + set { SetEntity(value); } + } + public Builder SetEntity(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasEntity = true; + result.entity_ = value; + return this; + } + public Builder SetEntity(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasEntity = true; + result.entity_ = builderForValue.Build(); + return this; + } + public Builder MergeEntity(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasEntity && + result.entity_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.entity_ = global::bnet.protocol.EntityId.CreateBuilder(result.entity_).MergeFrom(value).BuildPartial(); + } else { + result.entity_ = value; + } + result.hasEntity = true; + return this; + } + public Builder ClearEntity() { + PrepareBuilder(); + result.hasEntity = false; + result.entity_ = null; + return this; + } + + public bool HasProgramId { + get { return result.hasProgramId; } + } + public string ProgramId { + get { return result.ProgramId; } + set { SetProgramId(value); } + } + public Builder SetProgramId(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasProgramId = true; + result.programId_ = value; + return this; + } + public Builder ClearProgramId() { + PrepareBuilder(); + result.hasProgramId = false; + result.programId_ = ""; + return this; + } + + public bool HasTimestampPlayed { + get { return result.hasTimestampPlayed; } + } + public ulong TimestampPlayed { + get { return result.TimestampPlayed; } + set { SetTimestampPlayed(value); } + } + public Builder SetTimestampPlayed(ulong value) { + PrepareBuilder(); + result.hasTimestampPlayed = true; + result.timestampPlayed_ = value; + return this; + } + public Builder ClearTimestampPlayed() { + PrepareBuilder(); + result.hasTimestampPlayed = false; + result.timestampPlayed_ = 0; + return this; + } + + public pbc::IPopsicleList AttributesList { + get { return PrepareBuilder().attributes_; } + } + public int AttributesCount { + get { return result.AttributesCount; } + } + public global::bnet.protocol.attribute.Attribute GetAttributes(int index) { + return result.GetAttributes(index); + } + public Builder SetAttributes(int index, global::bnet.protocol.attribute.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.attributes_[index] = value; + return this; + } + public Builder SetAttributes(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.attributes_[index] = builderForValue.Build(); + return this; + } + public Builder AddAttributes(global::bnet.protocol.attribute.Attribute value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.attributes_.Add(value); + return this; + } + public Builder AddAttributes(global::bnet.protocol.attribute.Attribute.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.attributes_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeAttributes(scg::IEnumerable values) { + PrepareBuilder(); + result.attributes_.Add(values); + return this; + } + public Builder ClearAttributes() { + PrepareBuilder(); + result.attributes_.Clear(); + return this; + } + + public bool HasId { + get { return result.hasId; } + } + public uint Id { + get { return result.Id; } + set { SetId(value); } + } + public Builder SetId(uint value) { + PrepareBuilder(); + result.hasId = true; + result.id_ = value; + return this; + } + public Builder ClearId() { + PrepareBuilder(); + result.hasId = false; + result.id_ = 0; + return this; + } + + public bool HasCounter { + get { return result.hasCounter; } + } + public uint Counter { + get { return result.Counter; } + set { SetCounter(value); } + } + public Builder SetCounter(uint value) { + PrepareBuilder(); + result.hasCounter = true; + result.counter_ = value; + return this; + } + public Builder ClearCounter() { + PrepareBuilder(); + result.hasCounter = false; + result.counter_ = 0; + return this; + } + } + static RecentPlayer() { + object.ReferenceEquals(global::bnet.protocol.user_manager.UserManagerTypes.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class BlockedEntity : pb::GeneratedMessage { + private BlockedEntity() { } + private static readonly BlockedEntity defaultInstance = new BlockedEntity().MakeReadOnly(); + private static readonly string[] _blockedEntityFieldNames = new string[] { "id", "name", "privileges", "role" }; + private static readonly uint[] _blockedEntityFieldTags = new uint[] { 10, 18, 32, 26 }; + public static BlockedEntity DefaultInstance { + get { return defaultInstance; } + } + + public override BlockedEntity DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override BlockedEntity ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.user_manager.UserManagerTypes.internal__static_bnet_protocol_user_manager_BlockedEntity__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.user_manager.UserManagerTypes.internal__static_bnet_protocol_user_manager_BlockedEntity__FieldAccessorTable; } + } + + public const int IdFieldNumber = 1; + private bool hasId; + private global::bnet.protocol.EntityId id_; + public bool HasId { + get { return hasId; } + } + public global::bnet.protocol.EntityId Id { + get { return id_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int NameFieldNumber = 2; + private bool hasName; + private string name_ = ""; + public bool HasName { + get { return hasName; } + } + public string Name { + get { return name_; } + } + + public const int RoleFieldNumber = 3; + private int roleMemoizedSerializedSize; + private pbc::PopsicleList role_ = new pbc::PopsicleList(); + public scg::IList RoleList { + get { return pbc::Lists.AsReadOnly(role_); } + } + public int RoleCount { + get { return role_.Count; } + } + public uint GetRole(int index) { + return role_[index]; + } + + public const int PrivilegesFieldNumber = 4; + private bool hasPrivileges; + private ulong privileges_; + public bool HasPrivileges { + get { return hasPrivileges; } + } + public ulong Privileges { + get { return privileges_; } + } + + public override bool IsInitialized { + get { + if (!hasId) return false; + if (!Id.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _blockedEntityFieldNames; + if (hasId) { + output.WriteMessage(1, field_names[0], Id); + } + if (hasName) { + output.WriteString(2, field_names[1], Name); + } + if (role_.Count > 0) { + output.WritePackedUInt32Array(3, field_names[3], roleMemoizedSerializedSize, role_); + } + if (hasPrivileges) { + output.WriteUInt64(4, field_names[2], Privileges); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Id); + } + if (hasName) { + size += pb::CodedOutputStream.ComputeStringSize(2, Name); + } + { + int dataSize = 0; + foreach (uint element in RoleList) { + dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); + } + size += dataSize; + if (role_.Count != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); + } + roleMemoizedSerializedSize = dataSize; + } + if (hasPrivileges) { + size += pb::CodedOutputStream.ComputeUInt64Size(4, Privileges); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static BlockedEntity ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static BlockedEntity ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static BlockedEntity ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static BlockedEntity ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static BlockedEntity ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static BlockedEntity ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static BlockedEntity ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static BlockedEntity ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static BlockedEntity ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static BlockedEntity ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private BlockedEntity MakeReadOnly() { + role_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(BlockedEntity prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(BlockedEntity cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private BlockedEntity result; + + private BlockedEntity PrepareBuilder() { + if (resultIsReadOnly) { + BlockedEntity original = result; + result = new BlockedEntity(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override BlockedEntity MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.user_manager.BlockedEntity.Descriptor; } + } + + public override BlockedEntity DefaultInstanceForType { + get { return global::bnet.protocol.user_manager.BlockedEntity.DefaultInstance; } + } + + public override BlockedEntity BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is BlockedEntity) { + return MergeFrom((BlockedEntity) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(BlockedEntity other) { + if (other == global::bnet.protocol.user_manager.BlockedEntity.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasId) { + MergeId(other.Id); + } + if (other.HasName) { + Name = other.Name; + } + if (other.role_.Count != 0) { + result.role_.Add(other.role_); + } + if (other.HasPrivileges) { + Privileges = other.Privileges; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_blockedEntityFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _blockedEntityFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasId) { + subBuilder.MergeFrom(Id); + } + input.ReadMessage(subBuilder, extensionRegistry); + Id = subBuilder.BuildPartial(); + break; + } + case 18: { + result.hasName = input.ReadString(ref result.name_); + break; + } + case 26: + case 24: { + input.ReadUInt32Array(tag, field_name, result.role_); + break; + } + case 32: { + result.hasPrivileges = input.ReadUInt64(ref result.privileges_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasId { + get { return result.hasId; } + } + public global::bnet.protocol.EntityId Id { + get { return result.Id; } + set { SetId(value); } + } + public Builder SetId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasId = true; + result.id_ = value; + return this; + } + public Builder SetId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasId = true; + result.id_ = builderForValue.Build(); + return this; + } + public Builder MergeId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasId && + result.id_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.id_ = global::bnet.protocol.EntityId.CreateBuilder(result.id_).MergeFrom(value).BuildPartial(); + } else { + result.id_ = value; + } + result.hasId = true; + return this; + } + public Builder ClearId() { + PrepareBuilder(); + result.hasId = false; + result.id_ = null; + return this; + } + + public bool HasName { + get { return result.hasName; } + } + public string Name { + get { return result.Name; } + set { SetName(value); } + } + public Builder SetName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasName = true; + result.name_ = value; + return this; + } + public Builder ClearName() { + PrepareBuilder(); + result.hasName = false; + result.name_ = ""; + return this; + } + + public pbc::IPopsicleList RoleList { + get { return PrepareBuilder().role_; } + } + public int RoleCount { + get { return result.RoleCount; } + } + public uint GetRole(int index) { + return result.GetRole(index); + } + public Builder SetRole(int index, uint value) { + PrepareBuilder(); + result.role_[index] = value; + return this; + } + public Builder AddRole(uint value) { + PrepareBuilder(); + result.role_.Add(value); + return this; + } + public Builder AddRangeRole(scg::IEnumerable values) { + PrepareBuilder(); + result.role_.Add(values); + return this; + } + public Builder ClearRole() { + PrepareBuilder(); + result.role_.Clear(); + return this; + } + + public bool HasPrivileges { + get { return result.hasPrivileges; } + } + public ulong Privileges { + get { return result.Privileges; } + set { SetPrivileges(value); } + } + public Builder SetPrivileges(ulong value) { + PrepareBuilder(); + result.hasPrivileges = true; + result.privileges_ = value; + return this; + } + public Builder ClearPrivileges() { + PrepareBuilder(); + result.hasPrivileges = false; + result.privileges_ = 0UL; + return this; + } + } + static BlockedEntity() { + object.ReferenceEquals(global::bnet.protocol.user_manager.UserManagerTypes.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code diff --git a/src/Mooege/Common/Config/Config.cs b/src/Mooege/Common/Config/Config.cs new file mode 100644 index 00000000..903c3e6e --- /dev/null +++ b/src/Mooege/Common/Config/Config.cs @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Nini.Config; + +namespace Mooege.Common.Config +{ + public class Config + { + private readonly IConfig _section; + + public Config(string sectionName) + { + this._section = ConfigurationManager.Section(sectionName) ?? ConfigurationManager.AddSection(sectionName); + } + + public void Save() + { + ConfigurationManager.Save(); + } + + protected bool GetBoolean(string key, bool defaultValue) { return this._section.GetBoolean(key, defaultValue); } + protected double GetDouble(string key, double defaultValue) { return this._section.GetDouble(key, defaultValue); } + protected float GetFloat(string key, float defaultValue) { return this._section.GetFloat(key, defaultValue); } + protected int GetInt(string key, int defaultValue) { return this._section.GetInt(key, defaultValue); } + protected int GetInt(string key, int defaultValue, bool fromAlias) { return this._section.GetInt(key, defaultValue, fromAlias); } + protected long GetLong(string key, long defaultValue) { return this._section.GetLong(key, defaultValue); } + protected string GetString(string key, string defaultValue) { return this._section.Get(key, defaultValue); } + protected string[] GetEntryKeys() { return this._section.GetKeys(); } + protected void Set(string key, object value) { this._section.Set(key, value); } + } +} diff --git a/src/Mooege/Common/Config/ConfigManager.cs b/src/Mooege/Common/Config/ConfigManager.cs new file mode 100644 index 00000000..fb901f20 --- /dev/null +++ b/src/Mooege/Common/Config/ConfigManager.cs @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using Mooege.Common.Helpers.IO; +using Mooege.Common.Logging; +using Nini.Config; + +namespace Mooege.Common.Config +{ + public sealed class ConfigurationManager + { + private static readonly Logger Logger = LogManager.CreateLogger(); + private static readonly IniConfigSource Parser; // the ini parser. + private static readonly string ConfigFile; + private static bool _fileExists = false; // does the ini file exists? + + static ConfigurationManager() + { + try + { + ConfigFile = string.Format("{0}/{1}", FileHelpers.AssemblyRoot, "config.ini"); // the config file's location. + Parser = new IniConfigSource(ConfigFile); // see if the file exists by trying to parse it. + _fileExists = true; + } + catch (Exception) + { + Parser = new IniConfigSource(); // initiate a new .ini source. + _fileExists = false; + Logger.Warn("Error loading settings config.ini, will be using default settings."); + } + finally + { + // adds aliases so we can use On and Off directives in ini files. + Parser.Alias.AddAlias("On", true); + Parser.Alias.AddAlias("Off", false); + + // logger level aliases. + Parser.Alias.AddAlias("MinimumLevel", Logger.Level.Trace); + Parser.Alias.AddAlias("MaximumLevel", Logger.Level.Trace); + } + + Parser.ExpandKeyValues(); + } + + static internal IConfig Section(string section) // Returns the asked config section. + { + return Parser.Configs[section]; + } + + static internal IConfig AddSection(string section) // Adds a config section. + { + return Parser.AddConfig(section); + } + + static internal void Save() // Saves the settings. + { + if (_fileExists) Parser.Save(); + else + { + Parser.Save(ConfigFile); + _fileExists = true; + } + } + } +} diff --git a/src/Mooege/Common/Extensions/ArrayExtensions.cs b/src/Mooege/Common/Extensions/ArrayExtensions.cs new file mode 100644 index 00000000..9dd99764 --- /dev/null +++ b/src/Mooege/Common/Extensions/ArrayExtensions.cs @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Mooege.Common.Extensions +{ + public static class ArrayExtensions + { + public static IEnumerable EnumerateFrom(this T[] array, int start) + { + if (array == null) + throw new ArgumentNullException("array"); + + return Enumerate(array, start, array.Length); + } + + public static IEnumerable Enumerate(this T[] array, int start, int count) + { + if (array == null) + throw new ArgumentNullException("array"); + + for (int i = 0; i < count; i++) + yield return array[start + i]; + } + + public static byte[] Append(this byte[] a, byte[] b) + { + var result = new byte[a.Length + b.Length]; + + a.CopyTo(result, 0); + b.CopyTo(result, a.Length); + + return result; + } + + public static bool CompareTo(this byte[] byteArray, byte[] second) + { + if (byteArray.Length != second.Length) + return false; + + return !byteArray.Where((t, i) => second[i] != t).Any(); + } + + public static string Dump(this byte[] array) + { + return EnumerableExtensions.Dump(array); + } + + public static string ToHexString(this byte[] byteArray) + { + return byteArray.Aggregate("", (current, b) => current + b.ToString("X2")); + } + + public static string ToFormatedHexString(this byte[] byteArray) + { + return byteArray.Aggregate("", (current, b) => current + " " + b.ToString("X2")); + } + + public static byte[] ToByteArray(this string str) + { + str = str.Replace(" ", String.Empty); + + var res = new byte[str.Length / 2]; + for (int i = 0; i < res.Length; ++i) + { + string temp = String.Concat(str[i * 2], str[i * 2 + 1]); + res[i] = Convert.ToByte(temp, 16); + } + return res; + } + } +} + diff --git a/src/Mooege/Common/Extensions/BigIntegerExtensions.cs b/src/Mooege/Common/Extensions/BigIntegerExtensions.cs new file mode 100644 index 00000000..644b5148 --- /dev/null +++ b/src/Mooege/Common/Extensions/BigIntegerExtensions.cs @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Numerics; + +namespace Mooege.Common.Extensions +{ + public static class BigIntegerExtensions + { + public static BigInteger ToBigInteger(this byte[] src) + { + var dst = new byte[src.Length + 1]; + Array.Copy(src, dst, src.Length); + return new BigInteger(dst); + } + + public static byte[] ToArray(this BigInteger b) + { + var result = b.ToByteArray(); + if (result[result.Length - 1] == 0 && (result.Length % 0x10) != 0) + Array.Resize(ref result, result.Length - 1); + return result; + } + + public static byte[] ToArray(this BigInteger b, int size) + { + byte[] result = b.ToArray(); + if (result.Length > size) + throw new ArgumentOutOfRangeException("size", size, "must be large enough to convert the BigInteger"); + + // If the size is already correct, return the result. + if (result.Length == size) + return result; + + // Resize the array. + int n = size - result.Length; + Array.Resize(ref result, size); + + // Fill the extra bytes with 0x00. + while (n > 0) + { + result[size - n] = 0x00; + n--; + } + + return result; + } + } +} diff --git a/src/Mooege/Common/Extensions/CodedOutputStream.cs b/src/Mooege/Common/Extensions/CodedOutputStream.cs new file mode 100644 index 00000000..ed4bbe1d --- /dev/null +++ b/src/Mooege/Common/Extensions/CodedOutputStream.cs @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; + +namespace Mooege.Common.Extensions +{ + public static class CodedOutputStreamExtensions + { + public static void WriteInt16NoTag(this Google.ProtocolBuffers.CodedOutputStream s, short value) + { + s.WriteRawBytes(BitConverter.GetBytes(value)); + } + } +} diff --git a/src/Mooege/Common/Extensions/DateTimeExtensions.cs b/src/Mooege/Common/Extensions/DateTimeExtensions.cs new file mode 100644 index 00000000..ffacfbd4 --- /dev/null +++ b/src/Mooege/Common/Extensions/DateTimeExtensions.cs @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; + +namespace Mooege.Common.Extensions +{ + public static class DateTimeExtensions + { + public static uint ToUnixTime(this DateTime time) + { + return (uint)((time.ToUniversalTime().Ticks - 621355968000000000L) / 10000000L); + } + + public static ulong ToExtendedEpoch(this DateTime time) + { + return (ulong)((time.ToUniversalTime().Ticks - 621355968000000000L) / 10L); + } + } +} diff --git a/src/Mooege/Common/Extensions/EnumerableExtensions.cs b/src/Mooege/Common/Extensions/EnumerableExtensions.cs new file mode 100644 index 00000000..6f6f09c9 --- /dev/null +++ b/src/Mooege/Common/Extensions/EnumerableExtensions.cs @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Mooege.Common.Extensions +{ + public static class EnumerableExtensions + { + public static string HexDump(this IEnumerable collection) + { + var sb = new StringBuilder(); + foreach (byte value in collection) + { + sb.Append(value.ToString("X2")); + sb.Append(' '); + } + if (sb.Length > 0) + sb.Remove(sb.Length - 1, 1); + return sb.ToString(); + } + + public static string ToEncodedString(this IEnumerable collection, Encoding encoding) + { + return encoding.GetString(collection.ToArray()); + } + + public static string Dump(this IEnumerable collection) + { + var output = new StringBuilder(); + var hex = new StringBuilder(); + var text = new StringBuilder(); + int i = 0; + foreach (byte value in collection) + { + if (i > 0 && ((i % 16) == 0)) + { + output.Append(hex); + output.Append(' '); + output.Append(text); + output.Append(Environment.NewLine); + hex.Clear(); text.Clear(); + } + hex.Append(value.ToString("X2")); + hex.Append(' '); + text.Append(string.Format("{0}", (char.IsWhiteSpace((char)value) && (char)value != ' ') ? '.' : (char)value)); // prettify text + ++i; + } + var hexstring = hex.ToString(); + if (text.Length < 16) + { + hexstring = hexstring.PadRight(48); // pad the hex representation in-case it's smaller than a regular 16 value line. + } + output.Append(hexstring); + output.Append(' '); + output.Append(text); + return output.ToString(); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Common/Extensions/IMessageExtensions.cs b/src/Mooege/Common/Extensions/IMessageExtensions.cs new file mode 100644 index 00000000..1d1d8580 --- /dev/null +++ b/src/Mooege/Common/Extensions/IMessageExtensions.cs @@ -0,0 +1,238 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Text; +using Google.ProtocolBuffers; +using Google.ProtocolBuffers.Descriptors; + +namespace Mooege.Common.Extensions +{ + static class IMessageExtensions + { + + static void AppendLevel(StringBuilder result, int level) + { + for (int i = 0; i < level; i++) result.Append(' '); + } + + static void AppendLine(StringBuilder result, int level, string str) { for (int i = 0; i < level; i++) result.Append(' '); result.AppendLine(str); } + static char ToHexChar(byte b) + { + return (b >= 0x20 && b < 0x80) ? (char)b : '.'; + } + + static void AppendHexdump(StringBuilder b, int level, byte[] buffer) + { + b.AppendLine(); + AppendLine(b, level++, "[0x" + buffer.Length.ToString("X8") + "] {"); + + int length = Math.Min(buffer.Length, 0xFFFF); + for (int i = 0; i < length; i += 16) + { + + AppendLevel(b, level); + + b.AppendFormat("{0:X4} ", i); + for (int n = 0; n < 8; n++) + { + int o = i + n; + if (o < length) + b.AppendFormat("{0:X2} ", buffer[o]); + else + b.Append(" "); + } + b.Append(" "); + for (int n = 0; n < 8; n++) + { + int o = i + n + 8; + if (o < length) + b.AppendFormat("{0:X2} ", buffer[o]); + else + b.Append(" "); + } + b.Append(" "); + + for (int n = 0; n < 8; n++) + { + int o = i + n; + if (o < length) + b.AppendFormat("{0}", ToHexChar(buffer[o])); + else + b.Append(" "); + } + b.Append(" "); + for (int n = 0; n < 8; n++) + { + int o = i + n + 8; + if (o < length) + b.AppendFormat("{0}", ToHexChar(buffer[o])); + else + b.Append(" "); + } + b.AppendLine(); + } + AppendLine(b, --level, "}"); + } + + static void AppendFieldValue(StringBuilder result, int level, FieldType type, object value) + { + switch (type) + { + case FieldType.Bool: + result.AppendLine((bool)value ? "true" : "false"); + break; + case FieldType.Bytes: + result.AppendLine(EscapeBytes((ByteString)value)); + AppendHexdump(result, level, ((ByteString)value).ToByteArray()); + break; + case FieldType.Double: + result.AppendLine(((double)value).ToString("G")); + break; + case FieldType.Float: + result.AppendLine(((float)value).ToString("G")); + break; + case FieldType.Int32: + case FieldType.SFixed32: + case FieldType.SInt32: + result.AppendLine(value.ToString()); + break; + case FieldType.Int64: + case FieldType.SFixed64: + case FieldType.SInt64: + result.AppendLine("0x" + ((long)value).ToString("X16") + "l (" + ((long)value) + ")"); + break; + case FieldType.Fixed32: + case FieldType.UInt32: + result.AppendLine("0x" + ((uint)value).ToString("X8") + "u (" + ((uint)value) + ")"); + break; + case FieldType.Fixed64: + case FieldType.UInt64: + result.AppendLine("0x" + ((ulong)value).ToString("X16") + "ul (" + ((ulong)value) + ")"); + break; + case FieldType.Message: + result.AppendLine(); + AppendMessage(result, level, (IMessage)value); + break; + case FieldType.Enum: + { + EnumValueDescriptor e = (EnumValueDescriptor)value; + + result.AppendLine(e.Name); + } + break; + case FieldType.String: + result.AppendLine(value.ToString()); + break; + case FieldType.Group: + default: + throw new Exception("Unhandled FieldType"); + } + } + static void AppendField(StringBuilder result, int level, FieldDescriptor fieldDesc, object value) + { + if (value == null) + return; + if (fieldDesc.IsRepeated) + { + var e = ((System.Collections.IEnumerable)value).GetEnumerator(); + while (e.MoveNext()) + { + AppendLevel(result, level); + result.Append(fieldDesc.Name); + result.Append(": "); + AppendFieldValue(result, level, fieldDesc.FieldType, e.Current); + } + } + else + { + AppendLevel(result, level); + result.Append(fieldDesc.Name); + result.Append(": "); + AppendFieldValue(result, level, fieldDesc.FieldType, value); + } + } + + static void AppendMessage(StringBuilder result, int level, IMessage msg) + { + AppendLine(result, level++, "{"); + var fields = msg.AllFields; + foreach (var pair in fields) + AppendField(result, level, pair.Key, pair.Value); + AppendLine(result, --level, "}"); + } + + public static string AsText(this IMessage msg) + { + var msgDesc = msg.DescriptorForType; + StringBuilder result = new StringBuilder(); + result.AppendLine(msgDesc.FullName); + AppendMessage(result, 0, msg); + return result.ToString(); + } + + /// + /// Escapes bytes in the format used in protocol buffer text format, which + /// is the same as the format used for C string literals. All bytes + /// that are not printable 7-bit ASCII characters are escaped, as well as + /// backslash, single-quote, and double-quote characters. Characters for + /// which no defined short-hand escape sequence is defined will be escaped + /// using 3-digit octal sequences. + /// The returned value is guaranteed to be entirely ASCII. + /// + /// + /// Code taken from protobuf-csharp project + /// http://code.google.com/p/protobuf-csharp-port/source/browse/src/ProtocolBuffers/TextFormat.cs + /// + static String EscapeBytes(ByteString input) + { + StringBuilder builder = new StringBuilder(input.Length); + foreach (byte b in input) + { + switch (b) + { + // C# does not use \a or \v + case 0x07: builder.Append("\\a"); break; + case (byte)'\b': builder.Append("\\b"); break; + case (byte)'\f': builder.Append("\\f"); break; + case (byte)'\n': builder.Append("\\n"); break; + case (byte)'\r': builder.Append("\\r"); break; + case (byte)'\t': builder.Append("\\t"); break; + case 0x0b: builder.Append("\\v"); break; + case (byte)'\\': builder.Append("\\\\"); break; + case (byte)'\'': builder.Append("\\\'"); break; + case (byte)'"': builder.Append("\\\""); break; + default: + if (b >= 0x20 && b < 128) + { + builder.Append((char)b); + } + else + { + builder.Append('\\'); + builder.Append((char)('0' + ((b >> 6) & 3))); + builder.Append((char)('0' + ((b >> 3) & 7))); + builder.Append((char)('0' + (b & 7))); + } + break; + } + } + return builder.ToString(); + } + } +} diff --git a/src/Mooege/Common/Extensions/ListExtensions.cs b/src/Mooege/Common/Extensions/ListExtensions.cs new file mode 100644 index 00000000..4749e03f --- /dev/null +++ b/src/Mooege/Common/Extensions/ListExtensions.cs @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; + +namespace Mooege.Common.Extensions +{ + public static class ListExtensions + { + public static bool ContainsAtLeastOne(this List list1, List list2) + { + foreach (T m in list2) + { + if (list1.Contains(m)) + return true; + } + return false; + } + + public static bool ContainsAtLeastOne(this List list, T[] array) + { + foreach (T m in array) + { + if (list.Contains(m)) + return true; + } + return false; + } + } +} diff --git a/src/Mooege/Common/Extensions/StringExtensions.cs b/src/Mooege/Common/Extensions/StringExtensions.cs new file mode 100644 index 00000000..4583c415 --- /dev/null +++ b/src/Mooege/Common/Extensions/StringExtensions.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Mooege.Common.Extensions +{ + public static class StringExtensions + { + public static string ZipCompress(this string value) + { + //Transform string into byte[] + byte[] byteArray = new byte[value.Length]; + int indexBA = 0; + foreach (char item in value.ToCharArray()) + { + byteArray[indexBA++] = (byte)item; + } + + //Prepare for compress + System.IO.MemoryStream ms = new System.IO.MemoryStream(); + System.IO.Compression.GZipStream sw = new System.IO.Compression.GZipStream(ms, + System.IO.Compression.CompressionMode.Compress); + + //Compress + sw.Write(byteArray, 0, byteArray.Length); + //Close, DO NOT FLUSH cause bytes will go missing... + sw.Close(); + + //Transform byte[] zip data to string + byteArray = ms.ToArray(); + System.Text.StringBuilder sB = new System.Text.StringBuilder(byteArray.Length); + foreach (byte item in byteArray) + { + sB.Append((char)item); + } + ms.Close(); + sw.Dispose(); + ms.Dispose(); + return sB.ToString(); + } + + public static string UnZipCompress(this string value) + { + //Transform string into byte[] + byte[] byteArray = new byte[value.Length]; + int indexBA = 0; + foreach (char item in value.ToCharArray()) + { + byteArray[indexBA++] = (byte)item; + } + + //Prepare for decompress + System.IO.MemoryStream ms = new System.IO.MemoryStream(byteArray); + System.IO.Compression.GZipStream sr = new System.IO.Compression.GZipStream(ms, + System.IO.Compression.CompressionMode.Decompress); + + //Reset variable to collect uncompressed result + byteArray = new byte[byteArray.Length]; + + //Decompress + int rByte = sr.Read(byteArray, 0, byteArray.Length); + + //Transform byte[] unzip data to string + System.Text.StringBuilder sB = new System.Text.StringBuilder(rByte); + //Read the number of bytes GZipStream red and do not a for each bytes in + //resultByteArray; + for (int i = 0; i < rByte; i++) + { + sB.Append((char)byteArray[i]); + } + sr.Close(); + ms.Close(); + sr.Dispose(); + ms.Dispose(); + return sB.ToString(); + } + } +} diff --git a/src/Mooege/Common/Helpers/Concurrency/ConcurrentList.cs b/src/Mooege/Common/Helpers/Concurrency/ConcurrentList.cs new file mode 100644 index 00000000..647bc601 --- /dev/null +++ b/src/Mooege/Common/Helpers/Concurrency/ConcurrentList.cs @@ -0,0 +1,265 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +// Original code by: http://www.deanchalk.me.uk/post/Task-Parallel-Concurrent-List-Implementation.aspx + +using System; +using System.Collections; +using System.Collections.Concurrent; +using System.Collections.Generic; + +namespace Mooege.Common.Helpers.Concurrency +{ + public class ConcurrentList : IList, IList + { + private readonly List underlyingList = new List(); + private readonly object syncRoot = new object(); + private readonly ConcurrentQueue underlyingQueue; + private bool requiresSync; + private bool isDirty; + + public ConcurrentList() + { + underlyingQueue = new ConcurrentQueue(); + } + + public ConcurrentList(IEnumerable items) + { + underlyingQueue = new ConcurrentQueue(items); + } + + private void UpdateLists() + { + if (!isDirty) + return; + lock (syncRoot) + { + requiresSync = true; + T temp; + while (underlyingQueue.TryDequeue(out temp)) + underlyingList.Add(temp); + requiresSync = false; + } + } + + public IEnumerator GetEnumerator() + { + lock (syncRoot) + { + UpdateLists(); + return underlyingList.GetEnumerator(); + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + if (requiresSync) + lock (syncRoot) + underlyingQueue.Enqueue(item); + else + underlyingQueue.Enqueue(item); + isDirty = true; + } + + public int Add(object value) + { + if (requiresSync) + lock (syncRoot) + underlyingQueue.Enqueue((T)value); + else + underlyingQueue.Enqueue((T)value); + isDirty = true; + lock (syncRoot) + { + UpdateLists(); + return underlyingList.IndexOf((T)value); + } + } + + public bool Contains(object value) + { + lock (syncRoot) + { + UpdateLists(); + return underlyingList.Contains((T)value); + } + } + + public int IndexOf(object value) + { + lock (syncRoot) + { + UpdateLists(); + return underlyingList.IndexOf((T)value); + } + } + + public void Insert(int index, object value) + { + lock (syncRoot) + { + UpdateLists(); + underlyingList.Insert(index, (T)value); + } + } + + public void Remove(object value) + { + lock (syncRoot) + { + UpdateLists(); + underlyingList.Remove((T)value); + } + } + + public void RemoveAt(int index) + { + lock (syncRoot) + { + UpdateLists(); + underlyingList.RemoveAt(index); + } + } + + T IList.this[int index] + { + get + { + lock (syncRoot) + { + UpdateLists(); + return underlyingList[index]; + } + } + set + { + lock (syncRoot) + { + UpdateLists(); + underlyingList[index] = value; + } + } + } + + object IList.this[int index] + { + get { return ((IList)this)[index]; } + set { ((IList)this)[index] = (T)value; } + } + + public bool IsReadOnly + { + get { return false; } + } + + public bool IsFixedSize + { + get { return false; } + } + + public void Clear() + { + lock (syncRoot) + { + UpdateLists(); + underlyingList.Clear(); + } + } + + public bool Contains(T item) + { + lock (syncRoot) + { + UpdateLists(); + return underlyingList.Contains(item); + } + } + + public void CopyTo(T[] array, int arrayIndex) + { + lock (syncRoot) + { + UpdateLists(); + underlyingList.CopyTo(array, arrayIndex); + } + } + + public bool Remove(T item) + { + lock (syncRoot) + { + UpdateLists(); + return underlyingList.Remove(item); + } + } + + public void CopyTo(Array array, int index) + { + lock (syncRoot) + { + UpdateLists(); + underlyingList.CopyTo((T[])array, index); + } + } + + public int Count + { + get + { + lock (syncRoot) + { + UpdateLists(); + return underlyingList.Count; + } + } + } + + public object SyncRoot + { + get { return syncRoot; } + } + + public bool IsSynchronized + { + get { return true; } + } + + public int IndexOf(T item) + { + lock (syncRoot) + { + UpdateLists(); + return underlyingList.IndexOf(item); + } + } + + public void Insert(int index, T item) + { + lock (syncRoot) + { + UpdateLists(); + underlyingList.Insert(index, item); + } + } + } +} diff --git a/src/Mooege/Common/Helpers/Hash/StringHashHelper.cs b/src/Mooege/Common/Helpers/Hash/StringHashHelper.cs new file mode 100644 index 00000000..bcc48f01 --- /dev/null +++ b/src/Mooege/Common/Helpers/Hash/StringHashHelper.cs @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Linq; +using System.Text; + +namespace Mooege.Common.Helpers.Hash +{ + public class StringHashHelper + { + // Used on the full name of a proto service for their ServiceHash and for toon names + // This algorithm is FNV-1a with prime 0x1000193 /komiga + public static uint HashIdentity(string input) + { + var bytes = Encoding.ASCII.GetBytes(input); + return bytes.Aggregate(0x811C9DC5, (current, t) => 0x1000193 * (t ^ current)); + } + + // Hash algorithm used for item names + // FIXME: Our item name hasher seems to be problematic, for some items even with valid snoId's, bad gbId's are hashed which crashes client on pickup. /raist. + // NOTE: This is the DJB algorithm with a base of 0; and is likely accurate, assuming the base is actually 0 (the normal DJB uses 5381 as the base). + // Someone mentioned that the issues are due to not all assets being available in the beta for some items. /komiga + public static int HashItemName(string input) + { + int hash = 0; + input = input.ToLower(); + for (int i = 0; i < input.Length; ++i) + hash = (hash << 5) + hash + input[i]; + return hash; + } + + /// + /// Hashes a string to an int. This hashing is CASE SENSITIVE + /// + public static int HashNormal(string input) + { + int hash = 0; + for (int i = 0; i < input.Length; ++i) + hash = (hash << 5) + hash + input[i]; + return hash; + } + + } +} diff --git a/src/Mooege/Common/Helpers/IO/FileHelpers.cs b/src/Mooege/Common/Helpers/IO/FileHelpers.cs new file mode 100644 index 00000000..b790e953 --- /dev/null +++ b/src/Mooege/Common/Helpers/IO/FileHelpers.cs @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; + +namespace Mooege.Common.Helpers.IO +{ + public static class FileHelpers + { + public static string AssemblyRoot + { + get { return Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); } + } + + public static List GetFilesByExtensionRecursive(string directory, string fileExtension) + { + var files = new List(); // Store results in the file results list. + var stack = new Stack(); // Store a stack of our directories. + + stack.Push(directory); // Add initial directory. + + while (stack.Count > 0) // Continue while there are directories to process + { + var topDir = stack.Pop(); // Get top directory + var dirInfo = new DirectoryInfo(topDir); + + files.AddRange((from fileInfo in dirInfo.GetFiles() + where string.Compare(fileInfo.Extension, fileExtension, System.StringComparison.OrdinalIgnoreCase) == 0 + select topDir + "/" + fileInfo.Name).ToList()); + + foreach (var dir in Directory.GetDirectories(topDir)) // Add all directories at this directory. + { + stack.Push(dir); + } + } + + return files.Select(file => file.Replace("\\", "/")).ToList(); + } + } +} diff --git a/src/Mooege/Common/Helpers/Math/FastRandom.cs b/src/Mooege/Common/Helpers/Math/FastRandom.cs new file mode 100644 index 00000000..3e032c49 --- /dev/null +++ b/src/Mooege/Common/Helpers/Math/FastRandom.cs @@ -0,0 +1,415 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; + +// Credits goes to SharpNEAT project: http://sharpneat.sourceforge.net/ (GPL v2/LGPL). +// Use MathDotNet.Numerics.Xorshift maybe? http://numerics.mathdotnet.com/random-numbers/ /raist. + +namespace Mooege.Common.Helpers.Math +{ + /// + /// A fast random number generator for .NET + /// Colin Green, January 2005 + /// + /// Key points: + /// 1) Based on a simple and fast xor-shift pseudo random number generator (RNG) specified in: + /// Marsaglia, George. (2003). Xorshift RNGs. + /// http://www.jstatsoft.org/v08/i14/paper + /// + /// This particular implementation of xorshift has a period of 2^128-1. See the above paper to see + /// how this can be easily extened if you need a longer period. At the time of writing I could find no + /// information on the period of System.Random for comparison. + /// + /// 2) Faster than System.Random. Up to 8x faster, depending on which methods are called. + /// + /// 3) Direct replacement for System.Random. This class implements all of the methods that System.Random + /// does plus some additional methods. The like named methods are functionally equivalent. + /// + /// 4) Allows fast re-initialisation with a seed, unlike System.Random which accepts a seed at construction + /// time which then executes a relatively expensive initialisation routine. This provides a vast speed improvement + /// if you need to reset the pseudo-random number sequence many times, e.g. if you want to re-generate the same + /// sequence of random numbers many times. An alternative might be to cache random numbers in an array, but that + /// approach is limited by memory capacity and the fact that you may also want a large number of different sequences + /// cached. Each sequence can be represented by a single seed value (int) when using FastRandom. + /// + /// Notes. + /// A further performance improvement can be obtained by declaring local variables as static, thus avoiding + /// re-allocation of variables on each call. However care should be taken if multiple instances of + /// FastRandom are in use or if being used in a multi-threaded environment. + /// + /// + /// Colin Green, September 4th 2005 + /// - Added NextBytesUnsafe() - commented out by default. + /// - Fixed bug in Reinitialise() - y,z and w variables were not being reset. + /// + /// Colin Green, December 2008. + /// - Fix to Next() - Was previously able to return int.MaxValue, contrary to the method's contract and comments. + /// - Modified NextBool() to use _bitMask instead of a count of remaining bits. Also reset the bit buffer in Reinitialise(). + /// + /// Colin Green, 2011-08-31 + /// - Added NextByte() method. + /// - Added new statically declared seedRng FastRandom to allow easy creation of multiple FastRandoms with different seeds + /// within a single clock tick. + /// + public class FastRandom + { + #region Static Fields + + /// + /// A static RNG that is used to generate seed values when constructing new instances of FastRandom. + /// This overcomes the problem whereby multiple FastRandom instances are instantiated within the same + /// tick count and thus obtain the same seed, that approach can result in extreme biases occuring + /// in some cases depending on how the RNG is used. + /// + private static readonly FastRandom __seedRng = new FastRandom((int)Environment.TickCount); + + /// + /// Creates a static FastRandom instance. + /// + public static readonly FastRandom Instance = new FastRandom(); + + #endregion + + #region Instance Fields + + // The +1 ensures NextDouble doesn't generate 1.0 + const double REAL_UNIT_INT = 1.0 / ((double)int.MaxValue + 1.0); + const double REAL_UNIT_UINT = 1.0 / ((double)uint.MaxValue + 1.0); + const uint Y = 842502087, Z = 3579807591, W = 273326509; + + uint _x, _y, _z, _w; + + #endregion + + #region Constructors + + /// + /// Initialises a new instance using a seed generated from the class's static seed RNG. + /// + public FastRandom() + { + Reinitialise(__seedRng.NextInt()); + } + + /// + /// Initialises a new instance using an int value as seed. + /// This constructor signature is provided to maintain compatibility with + /// System.Random + /// + public FastRandom(int seed) + { + Reinitialise(seed); + } + + #endregion + + #region Public Methods [Reinitialisation] + + /// + /// Reinitialises using an int value as a seed. + /// + public void Reinitialise(int seed) + { + // The only stipulation stated for the xorshift RNG is that at least one of + // the seeds x,y,z,w is non-zero. We fulfill that requirement by only allowing + // resetting of the x seed + _x = (uint)seed; + _y = Y; + _z = Z; + _w = W; + + _bitBuffer = 0; + _bitMask = 1; + } + + #endregion + + #region Public Methods [System.Random functionally equivalent methods] + + /// + /// Generates a random int over the range 0 to int.MaxValue-1. + /// MaxValue is not generated in order to remain functionally equivalent to System.Random.Next(). + /// This does slightly eat into some of the performance gain over System.Random, but not much. + /// For better performance see: + /// + /// Call NextInt() for an int over the range 0 to int.MaxValue. + /// + /// Call NextUInt() and cast the result to an int to generate an int over the full Int32 value range + /// including negative values. + /// + public int Next() + { + uint t = _x ^ (_x << 11); + _x = _y; _y = _z; _z = _w; + _w = (_w ^ (_w >> 19)) ^ (t ^ (t >> 8)); + + // Handle the special case where the value int.MaxValue is generated. This is outside of + // the range of permitted values, so we therefore call Next() to try again. + uint rtn = _w & 0x7FFFFFFF; + if (rtn == 0x7FFFFFFF) + { + return Next(); + } + return (int)rtn; + } + + /// + /// Generates a random int over the range 0 to upperBound-1, and not including upperBound. + /// + public int Next(int upperBound) + { + if (upperBound < 0) + { + throw new ArgumentOutOfRangeException("upperBound", upperBound, "upperBound must be >=0"); + } + + uint t = _x ^ (_x << 11); + _x = _y; _y = _z; _z = _w; + + // ENHANCEMENT: Can we do this without converting to a double and back again? + // The explicit int cast before the first multiplication gives better performance. + // See comments in NextDouble. + return (int)((REAL_UNIT_INT * (int)(0x7FFFFFFF & (_w = (_w ^ (_w >> 19)) ^ (t ^ (t >> 8))))) * upperBound); + } + + /// + /// Generates a random int over the range lowerBound to upperBound-1, and not including upperBound. + /// upperBound must be >= lowerBound. lowerBound may be negative. + /// + public int Next(int lowerBound, int upperBound) + { + if (lowerBound > upperBound) + { + throw new ArgumentOutOfRangeException("upperBound", upperBound, "upperBound must be >=lowerBound"); + } + + uint t = _x ^ (_x << 11); + _x = _y; _y = _z; _z = _w; + + // The explicit int cast before the first multiplication gives better performance. + // See comments in NextDouble. + int range = upperBound - lowerBound; + if (range < 0) + { // If range is <0 then an overflow has occured and must resort to using long integer arithmetic instead (slower). + // We also must use all 32 bits of precision, instead of the normal 31, which again is slower. + return lowerBound + (int)((REAL_UNIT_UINT * (double)(_w = (_w ^ (_w >> 19)) ^ (t ^ (t >> 8)))) * (double)((long)upperBound - (long)lowerBound)); + } + + // 31 bits of precision will suffice if range<=int.MaxValue. This allows us to cast to an int and gain + // a little more performance. + return lowerBound + (int)((REAL_UNIT_INT * (double)(int)(0x7FFFFFFF & (_w = (_w ^ (_w >> 19)) ^ (t ^ (t >> 8))))) * (double)range); + } + + /// + /// Generates a random double. Values returned are from 0.0 up to but not including 1.0. + /// + public double NextDouble() + { + uint t = _x ^ (_x << 11); + _x = _y; _y = _z; _z = _w; + + // Here we can gain a 2x speed improvement by generating a value that can be cast to + // an int instead of the more easily available uint. If we then explicitly cast to an + // int the compiler will then cast the int to a double to perform the multiplication, + // this final cast is a lot faster than casting from a uint to a double. The extra cast + // to an int is very fast (the allocated bits remain the same) and so the overall effect + // of the extra cast is a significant performance improvement. + // + // Also note that the loss of one bit of precision is equivalent to what occurs within + // System.Random. + return REAL_UNIT_INT * (int)(0x7FFFFFFF & (_w = (_w ^ (_w >> 19)) ^ (t ^ (t >> 8)))); + } + + /// + /// Fills the provided byte array with random bytes. + /// This method is functionally equivalent to System.Random.NextBytes(). + /// + public void NextBytes(byte[] buffer) + { + // Fill up the bulk of the buffer in chunks of 4 bytes at a time. + uint x = this._x, y = this._y, z = this._z, w = this._w; + int i = 0; + uint t; + for (int bound = buffer.Length - 3; i < bound; ) + { + // Generate 4 bytes. + // Increased performance is achieved by generating 4 random bytes per loop. + // Also note that no mask needs to be applied to zero out the higher order bytes before + // casting because the cast ignores thos bytes. Thanks to Stefan Trosch�tz for pointing this out. + t = x ^ (x << 11); + x = y; y = z; z = w; + w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); + + buffer[i++] = (byte)w; + buffer[i++] = (byte)(w >> 8); + buffer[i++] = (byte)(w >> 16); + buffer[i++] = (byte)(w >> 24); + } + + // Fill up any remaining bytes in the buffer. + if (i < buffer.Length) + { + // Generate 4 bytes. + t = x ^ (x << 11); + x = y; y = z; z = w; + w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); + + buffer[i++] = (byte)w; + if (i < buffer.Length) + { + buffer[i++] = (byte)(w >> 8); + if (i < buffer.Length) + { + buffer[i++] = (byte)(w >> 16); + if (i < buffer.Length) + { + buffer[i] = (byte)(w >> 24); + } + } + } + } + this._x = x; this._y = y; this._z = z; this._w = w; + } + + ///// + ///// A version of NextBytes that uses a pointer to set 4 bytes of the byte buffer in one operation + ///// thus providing a nice speedup. The loop is also partially unrolled to allow out-of-order-execution, + ///// this results in about a x2 speedup on an AMD Athlon. Thus performance may vary wildly on different CPUs + ///// depending on the number of execution units available. + ///// + ///// Another significant speedup is obtained by setting the 4 bytes by indexing pDWord (e.g. pDWord[i++]=_w) + ///// instead of dereferencing it (e.g. *pDWord++=_w). + ///// + ///// Note that this routine requires the unsafe compilation flag to be specified and so is commented out by default. + ///// + ///// + // public unsafe void NextBytesUnsafe(byte[] buffer) + // { + // if(buffer.Length % 8 != 0) + // throw new ArgumentException("Buffer length must be divisible by 8", "buffer"); + // + // uint _x=this._x, _y=this._y, _z=this._z, _w=this._w; + // + // fixed(byte* pByte0 = buffer) + // { + // uint* pDWord = (uint*)pByte0; + // for(int i=0, len=buffer.Length>>2; i < len; i+=2) + // { + // uint t=(_x^(_x<<11)); + // _x=_y; _y=_z; _z=_w; + // pDWord[i] = _w = (_w^(_w>>19))^(t^(t>>8)); + // + // t=(_x^(_x<<11)); + // _x=_y; _y=_z; _z=_w; + // pDWord[i+1] = _w = (_w^(_w>>19))^(t^(t>>8)); + // } + // } + // + // this._x=_x; this._y=_y; this._z=_z; this._w=_w; + // } + #endregion + + #region Public Methods [Methods not present on System.Random] + + /// + /// Generates a uint. Values returned are over the full range of a uint, + /// uint.MinValue to uint.MaxValue, inclusive. + /// + /// This is the fastest method for generating a single random number because the underlying + /// random number generator algorithm generates 32 random bits that can be cast directly to + /// a uint. + /// + public uint NextUInt() + { + uint t = _x ^ (_x << 11); + _x = _y; _y = _z; _z = _w; + return _w = (_w ^ (_w >> 19)) ^ (t ^ (t >> 8)); + } + + /// + /// Generates a random int over the range 0 to int.MaxValue, inclusive. + /// This method differs from Next() only in that the range is 0 to int.MaxValue + /// and not 0 to int.MaxValue-1. + /// + /// The slight difference in range means this method is slightly faster than Next() + /// but is not functionally equivalent to System.Random.Next(). + /// + public int NextInt() + { + uint t = _x ^ (_x << 11); + _x = _y; _y = _z; _z = _w; + return (int)(0x7FFFFFFF & (_w = (_w ^ (_w >> 19)) ^ (t ^ (t >> 8)))); + } + + // Buffer 32 bits in bitBuffer, return 1 at a time, keep track of how many have been returned + // with bitMask. + uint _bitBuffer; + uint _bitMask; + + /// + /// Generates a single random bit. + /// This method's performance is improved by generating 32 bits in one operation and storing them + /// ready for future calls. + /// + public bool NextBool() + { + if (0 == _bitMask) + { + // Generate 32 more bits. + uint t = _x ^ (_x << 11); + _x = _y; _y = _z; _z = _w; + _bitBuffer = _w = (_w ^ (_w >> 19)) ^ (t ^ (t >> 8)); + + // Reset the bitMask that tells us which bit to read next. + _bitMask = 0x80000000; + return (_bitBuffer & _bitMask) == 0; + } + + return (_bitBuffer & (_bitMask >>= 1)) == 0; + } + + // Buffer of random bytes. A single UInt32 is used to buffer 4 bytes. + // _byteBufferState tracks how bytes remain in the buffer, a value of + // zero indicates that the buffer is empty. + uint _byteBuffer; + byte _byteBufferState; + + /// + /// Generates a signle random byte with range [0,255]. + /// This method's performance is improved by generating 4 bytes in one operation and storing them + /// ready for future calls. + /// + public byte NextByte() + { + if (0 == _byteBufferState) + { + // Generate 4 more bytes. + uint t = _x ^ (_x << 11); + _x = _y; _y = _z; _z = _w; + _byteBuffer = _w = (_w ^ (_w >> 19)) ^ (t ^ (t >> 8)); + _byteBufferState = 0x4; + return (byte)_byteBuffer; // Note. Masking with 0xFF is unnecessary. + } + _byteBufferState >>= 1; + return (byte)(_byteBuffer >>= 1); + } + + #endregion + } +} diff --git a/src/Mooege/Common/Helpers/Math/RandomHelper.cs b/src/Mooege/Common/Helpers/Math/RandomHelper.cs new file mode 100644 index 00000000..ac0c9d74 --- /dev/null +++ b/src/Mooege/Common/Helpers/Math/RandomHelper.cs @@ -0,0 +1,126 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Linq; +using System.Collections.Generic; + +namespace Mooege.Common.Helpers.Math +{ + public class RandomHelper + { + private readonly static Random _random; + + static RandomHelper() + { + _random = new Random(); + } + + public static int Next() + { + return _random.Next(); + } + + public static int Next(Int32 maxValue) + { + return _random.Next(maxValue); + } + + public static int Next(Int32 minValue, Int32 maxValue) + { + return _random.Next(minValue, maxValue); + } + + public static void NextBytes(byte[] buffer) + { + _random.NextBytes(buffer); + } + + public static double NextDouble() + { + return _random.NextDouble(); + } + + /*IEnumerable*/ + public static TValue RandomValue(IDictionary dictionary) + { + List values = Enumerable.ToList(dictionary.Values); + int size = dictionary.Count; + /*while (true) + { + yield return values[_random.Next(size)]; + }*/ + return values[_random.Next(size)]; + } + + /// + /// Picks a random item from a list + /// + /// + /// + /// A function that assigns each item a probability. If the probabilities dont sum up to 1, they are normalized + /// + public static T RandomItem(IEnumerable list, Func probability) + { + int cumulative = (int)list.Select(x => probability(x)).Sum(); + + int randomRoll = RandomHelper.Next(cumulative); + float cumulativePercentages = 0; + + foreach (T element in list) + { + cumulativePercentages += probability(element); + if (cumulativePercentages > randomRoll) + return element; + } + + return list.First(); + } + + } + + public class ItemRandomHelper + { + uint a; + uint b; + public ItemRandomHelper(int seed) + { + a = (uint)seed; + b = 666; + } + + public void ReinitSeed() + { + b = 666; + } + + public uint Next() + { + ulong temp = 1791398085UL * (ulong)a + (ulong)b; + a = (uint)temp; + b = (uint)(temp >> 32); + + return (uint)a; + } + + public float Next(float min, float max) + { + return min + Next() % (uint)(max - min + 1); + } + } +} diff --git a/src/Mooege/Common/Logging/ConsoleTarget.cs b/src/Mooege/Common/Logging/ConsoleTarget.cs new file mode 100644 index 00000000..be460e32 --- /dev/null +++ b/src/Mooege/Common/Logging/ConsoleTarget.cs @@ -0,0 +1,100 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; + +namespace Mooege.Common.Logging +{ + /// + /// Logs messages to console. + /// + public class ConsoleTarget : LogTarget + { + /// + /// Creates a new console target. + /// + /// Minimum level of messages to emit + /// Maximum level of messages to emit + /// Include timestamps in log? + public ConsoleTarget(Logger.Level minLevel, Logger.Level maxLevel, bool includeTimeStamps) + { + MinimumLevel = minLevel; + MaximumLevel = maxLevel; + this.IncludeTimeStamps = includeTimeStamps; + } + + /// + /// Logs a message to console. + /// + /// Log level. + /// Source of the log message. + /// Log message. + public override void LogMessage(Logger.Level level, string logger, string message) + { + var timeStamp = this.IncludeTimeStamps ? "[" + DateTime.Now.ToString("dd.MM.yyyy HH:mm:ss.fff") + "] " : ""; + SetConsoleForegroundColor(level); + Console.WriteLine(string.Format("{0}[{1}] [{2}]: {3}", timeStamp, level.ToString().PadLeft(5), logger, message)); + } + + /// + /// Logs a message and an exception to console. + /// + /// Log level. + /// Source of the log message. + /// Log message. + /// Exception to be included with log message. + public override void LogException(Logger.Level level, string logger, string message, Exception exception) + { + var timeStamp = this.IncludeTimeStamps ? "[" + DateTime.Now.ToString("dd.MM.yyyy HH:mm:ss.fff") + "] " : ""; + SetConsoleForegroundColor(level); + Console.WriteLine(string.Format("{0}[{1}] [{2}]: {3} - [Exception] {4}", timeStamp, level.ToString().PadLeft(5), logger, message, exception)); + } + + /// + /// Sets console's foreground color. + /// + /// + private static void SetConsoleForegroundColor(Logger.Level level) + { + switch (level) + { + case Logger.Level.Trace: + case Logger.Level.PacketDump: + Console.ForegroundColor = ConsoleColor.DarkGray; + break; + case Logger.Level.Debug: + Console.ForegroundColor = ConsoleColor.Cyan; + break; + case Logger.Level.Info: + Console.ForegroundColor = ConsoleColor.White; + break; + case Logger.Level.Warn: + Console.ForegroundColor = ConsoleColor.Yellow; + break; + case Logger.Level.Error: + Console.ForegroundColor = ConsoleColor.Magenta; + break; + case Logger.Level.Fatal: + Console.ForegroundColor = ConsoleColor.Red; + break; + default: + break; + } + } + } +} diff --git a/src/Mooege/Common/Logging/FileTarget.cs b/src/Mooege/Common/Logging/FileTarget.cs new file mode 100644 index 00000000..429eb303 --- /dev/null +++ b/src/Mooege/Common/Logging/FileTarget.cs @@ -0,0 +1,125 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.IO; + +namespace Mooege.Common.Logging +{ + /// + /// Logs messages to a log file. + /// + public class FileTarget : LogTarget, IDisposable + { + private readonly string _fileName; // log-file's filename. + private readonly string _filePath; // log-file's full path. + private FileStream _fileStream; // filestream pointing to logfile. + private StreamWriter _logStream; // stream-writer for flushing logs to disk. + + /// + /// Creates a new log file target. + /// + /// Filename of the logfile. + /// Minimum level of messages to emit + /// Maximum level of messages to emit + /// Include timestamps in log? + /// Reset log file on application startup? + public FileTarget(string fileName, Logger.Level minLevel, Logger.Level maxLevel, bool includeTimeStamps, bool reset = false) + { + this.MinimumLevel = minLevel; + this.MaximumLevel = maxLevel; + this.IncludeTimeStamps = includeTimeStamps; + this._fileName = fileName; + this._filePath = string.Format("{0}/{1}", LogConfig.Instance.LoggingRoot, _fileName); // construct the full path using LoggingRoot defined in config.ini + + if (!Directory.Exists(LogConfig.Instance.LoggingRoot)) // create logging directory if it does not exist yet. + Directory.CreateDirectory(LogConfig.Instance.LoggingRoot); + + this._fileStream = new FileStream(_filePath, reset ? FileMode.Create : FileMode.Append, FileAccess.Write, FileShare.Read); // init the file stream. + this._logStream = new StreamWriter(this._fileStream) { AutoFlush = true }; // init the stream writer. + } + + /// + /// Logs a message to a log-file. + /// + /// Log level. + /// Source of the log message. + /// Log message. + public override void LogMessage(Logger.Level level, string logger, string message) + { + lock (this) // we need this here until we seperate gs / moonet /raist + { + var timeStamp = this.IncludeTimeStamps ? "[" + DateTime.Now.ToString("dd.MM.yyyy HH:mm:ss.fff") + "] " : ""; + + if (!this._disposed) // make sure we're not disposed. + this._logStream.WriteLine(string.Format("{0}[{1}] [{2}]: {3}", timeStamp, level.ToString().PadLeft(5), logger, message)); + } + } + + /// + /// Logs a message and an exception to a log-file. + /// + /// Log level. + /// Source of the log message. + /// Log message. + /// Exception to be included with log message. + public override void LogException(Logger.Level level, string logger, string message, Exception exception) + { + lock (this) // we need this here until we seperate gs / moonet /raist + { + var timeStamp = this.IncludeTimeStamps ? "[" + DateTime.Now.ToString("dd.MM.yyyy HH:mm:ss.fff") + "] " : ""; + + if (!this._disposed) // make sure we're not disposed. + this._logStream.WriteLine(string.Format("{0}[{1}] [{2}]: {3} - [Exception] {4}", timeStamp, level.ToString().PadLeft(5), logger, message, exception)); + } + } + + #region de-ctor + + // IDisposable pattern: http://msdn.microsoft.com/en-us/library/fs2xkftw%28VS.80%29.aspx + + private bool _disposed = false; + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); // Take object out the finalization queue to prevent finalization code for it from executing a second time. + } + + private void Dispose(bool disposing) + { + if (this._disposed) return; // if already disposed, just return + + if (disposing) // only dispose managed resources if we're called from directly or in-directly from user code. + { + this._logStream.Close(); + this._logStream.Dispose(); + this._fileStream.Close(); + this._fileStream.Dispose(); + } + + this._logStream = null; + this._fileStream = null; + + _disposed = true; + } + + ~FileTarget() { Dispose(false); } // finalizer called by the runtime. we should only dispose unmanaged objects and should NOT reference managed ones. + + #endregion + } +} diff --git a/src/Mooege/Common/Logging/LogConfig.cs b/src/Mooege/Common/Logging/LogConfig.cs new file mode 100644 index 00000000..40824a4e --- /dev/null +++ b/src/Mooege/Common/Logging/LogConfig.cs @@ -0,0 +1,134 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace Mooege.Common.Logging +{ + /// + /// Holds configuration info for log manager. + /// + public sealed class LogConfig : Config.Config + { + /// + /// Gets or sets the logging root. + /// + public string LoggingRoot + { + get { return this.GetString("Root", @"logs"); } + set { this.Set("Root", value); } + } + + /// + /// Available log target configs. + /// + public LogTargetConfig[] Targets = new[] + { + new LogTargetConfig("ConsoleLog"), + new LogTargetConfig("ServerLog"), + new LogTargetConfig("PacketLog") + }; + + /// + /// Creates a new log config. + /// + private LogConfig() : + base("Logging") // Call the base ctor with section name 'Logging'. + { } + + /// + /// Singleton instance. + /// + public static LogConfig Instance { get { return _instance; } } + + /// + /// The internal instance pointer. + /// + private static readonly LogConfig _instance = new LogConfig(); + } + + /// + /// Holds configuration of a log target. + /// + public class LogTargetConfig : Config.Config + { + /// + /// Is enabled? + /// + public bool Enabled + { + get { return this.GetBoolean("Enabled", true); } + set { this.Set("Enabled", value); } + } + + /// + /// Target type. Valid values are file and console. + /// + public string Target + { + get { return this.GetString("Target", "Console"); } + set { this.GetString("Target", value); } + } + + /// + /// Include timestamps in logs? + /// + public bool IncludeTimeStamps + { + get { return this.GetBoolean("IncludeTimeStamps", false); } + set { this.Set("IncludeTimeStamps", value); } + } + + /// + /// Filename if logtarget is a file based one. + /// + public string FileName + { + get { return this.GetString("FileName", ""); } + set { this.GetString("FileName", value); } + } + + /// + /// Minimum level of messages to emit. + /// + public Logger.Level MinimumLevel + { + get { return (Logger.Level)(this.GetInt("MinimumLevel", (int)Logger.Level.Info, true)); } + set { this.Set("MinimumLevel", (int)value); } + } + + /// + /// Maximum level of messages to emit + /// + public Logger.Level MaximumLevel + { + get { return (Logger.Level)(this.GetInt("MaximumLevel", (int)Logger.Level.Fatal, true)); } + set { this.Set("MaximumLevel", (int)value); } + } + + /// + /// Reset log file on startup? + /// + public bool ResetOnStartup + { + get { return this.GetBoolean("ResetOnStartup", false); } + set { this.Set("ResetOnStartup", value); } + } + + public LogTargetConfig(string loggerName) + : base(loggerName) { } + } +} diff --git a/src/Mooege/Common/Logging/LogManager.cs b/src/Mooege/Common/Logging/LogManager.cs new file mode 100644 index 00000000..0052cdcb --- /dev/null +++ b/src/Mooege/Common/Logging/LogManager.cs @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; + +namespace Mooege.Common.Logging +{ + /// + /// Log manager class. + /// + public static class LogManager + { + /// + /// Is logging enabled? + /// + public static bool Enabled { get; set; } + + /// + /// Available & configured log targets. + /// + internal readonly static List Targets = new List(); + + /// + /// Available loggers. + /// + internal static readonly Dictionary Loggers = new Dictionary(); + + /// + /// Creates and returns a logger named with declaring type. + /// + /// A instance. + public static Logger CreateLogger() + { + var frame = new StackFrame(1, false); // read stack frame. + var name = frame.GetMethod().DeclaringType.Name; // get declaring type's name. + + if (name == null) // see if we got a name. + throw new Exception("Error getting full name for declaring type."); + + if (!Loggers.ContainsKey(name)) // see if we already have instance for the given name. + Loggers.Add(name, new Logger(name)); // add it to dictionary of loggers. + + return Loggers[name]; // return the newly created logger. + } + + /// + /// Creates and returns a logger with given name. + /// + /// + /// A instance. + public static Logger CreateLogger(string name) + { + if (!Loggers.ContainsKey(name)) // see if we already have instance for the given name. + Loggers.Add(name, new Logger(name)); // add it to dictionary of loggers. + + return Loggers[name]; // return the newly created logger. + } + + /// + /// Attachs a new log target. + /// + /// + public static void AttachLogTarget(LogTarget target) + { + Targets.Add(target); + } + } +} diff --git a/src/Mooege/Common/Logging/LogRouter.cs b/src/Mooege/Common/Logging/LogRouter.cs new file mode 100644 index 00000000..df74f5f2 --- /dev/null +++ b/src/Mooege/Common/Logging/LogRouter.cs @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Linq; + +namespace Mooege.Common.Logging +{ + /// + /// LogRouter class that routes messages to appropriate log-targets. + /// + internal static class LogRouter + { + /// + /// Routes a message to appropriate log-targets. + /// + /// Log level. + /// Source of the log message. + /// Log message. + public static void RouteMessage(Logger.Level level, string logger, string message) + { + if (!LogManager.Enabled) // if we logging is not enabled, + return; // just skip. + + if (LogManager.Targets.Count == 0) // if we don't have any active log-targets, + return; // just skip + + // loop through all available logs targets and route the messages that meet the filters. + foreach (var target in LogManager.Targets.Where(target => level >= target.MinimumLevel && level <= target.MaximumLevel)) + { + target.LogMessage(level, logger, message); + } + } + + /// + /// Routes a message to appropriate log-targets. + /// + /// Log level. + /// Source of the log message. + /// Log message. + /// Exception to be included with log message. + public static void RouteException(Logger.Level level, string logger, string message, Exception exception) + { + if (!LogManager.Enabled) // if we logging is not enabled, + return; // just skip. + + if (LogManager.Targets.Count == 0) // if we don't have any active log-targets, + return; // just skip + + // loop through all available logs targets and route the messages that meet the filters. + foreach (var target in LogManager.Targets.Where(target => level >= target.MinimumLevel && level <= target.MaximumLevel)) + { + target.LogException(level, logger, message, exception); + } + } + } +} diff --git a/src/Mooege/Common/Logging/LogTarget.cs b/src/Mooege/Common/Logging/LogTarget.cs new file mode 100644 index 00000000..00c74695 --- /dev/null +++ b/src/Mooege/Common/Logging/LogTarget.cs @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; + +namespace Mooege.Common.Logging +{ + /// + /// Log target. + /// + public class LogTarget + { + /// + /// Minimum level of messages to emit. + /// + public Logger.Level MinimumLevel { get; protected set; } + + /// + /// Maximum level of messages to emit. + /// + public Logger.Level MaximumLevel { get; protected set; } + + /// + /// Include timestamps in log? + /// + public bool IncludeTimeStamps { get; protected set; } + + /// + /// Logs a message to log-target. + /// + /// Log level. + /// Source of the log message. + /// Log message. + public virtual void LogMessage(Logger.Level level, string logger, string message) + { + throw new NotSupportedException("Vanilla log-targets are not supported! Instead use a log-target implementation."); + } + + /// + /// Logs a message and an exception to log-target. + /// + /// Log level. + /// Source of the log message. + /// Log message. + /// Exception to be included with log message. + public virtual void LogException(Logger.Level level, string logger, string message, Exception exception) + { + throw new NotSupportedException("Vanilla log-targets are not supported! Instead use a log-target implementation."); + } + } +} diff --git a/src/Mooege/Common/Logging/Logger.cs b/src/Mooege/Common/Logging/Logger.cs new file mode 100644 index 00000000..e9b2bc7d --- /dev/null +++ b/src/Mooege/Common/Logging/Logger.cs @@ -0,0 +1,326 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Globalization; +using System.Text; +using Mooege.Common.Extensions; +using Mooege.Net.GS.Message; + +namespace Mooege.Common.Logging +{ + /// + /// Logger class that can log messages and exceptions to available log-targets. + /// + public class Logger + { + /// + /// Name of the logger. + /// + public string Name { get; protected set; } + + /// + /// Creates a new logger with given name. + /// + /// Name of the logger. + public Logger(string name) + { + Name = name; + } + + /// + /// Available log levels. + /// + public enum Level + { + /// + /// Trace messages. + /// + Trace, + /// + /// Debug messages. + /// + Debug, + /// + /// Info messages. + /// + Info, + /// + /// Warning messages. + /// + Warn, + /// + /// Error messages. + /// + Error, + /// + /// Fatal error messages. + /// + Fatal, + /// + /// Packet dumps. + /// + PacketDump, + } + + #region message loggers + + /// + /// Logs a trace message. + /// + /// The log message. + public void Trace(string message) { Log(Level.Trace, message, null); } + + /// + /// Logs a trace message. + /// + /// The log message. + /// Additional arguments. + public void Trace(string message, params object[] args) { Log(Level.Trace, message, args); } + + /// + /// Logs a debug message. + /// + /// The log message. + public void Debug(string message) { Log(Level.Debug, message, null); } + + /// + /// Logs a debug message. + /// + /// The log message. + /// Additional arguments. + public void Debug(string message, params object[] args) { Log(Level.Debug, message, args); } + + /// + /// Logs an info message. + /// + /// The log message. + public void Info(string message) { Log(Level.Info, message, null); } + + /// + /// Logs an info message. + /// + /// The log message. + /// Additional arguments. + public void Info(string message, params object[] args) { Log(Level.Info, message, args); } + + /// + /// Logs a warning message. + /// + /// The log message. + public void Warn(string message) { Log(Level.Warn, message, null); } + + /// + /// Logs a warning message. + /// + /// The log message. + /// Additional arguments. + public void Warn(string message, params object[] args) { Log(Level.Warn, message, args); } + + /// + /// Logs an error message. + /// + /// The log message. + public void Error(string message) { Log(Level.Error, message, null); } + + /// + /// Logs an error message. + /// + /// The log message. + /// Additional arguments. + public void Error(string message, params object[] args) { Log(Level.Error, message, args); } + + /// + /// Logs an fatal error message. + /// + /// The log message. + public void Fatal(string message) { Log(Level.Fatal, message, null); } + + /// + /// Logs an fatal error message. + /// + /// The log message. + /// Additional arguments. + public void Fatal(string message, params object[] args) { Log(Level.Fatal, message, args); } + + #endregion + + #region message loggers with additional exception info included + + /// + /// Logs a trace message with an exception included. + /// + /// The exception to include in log line. + /// The log message. + public void TraceException(Exception exception, string message) { LogException(Level.Trace, message, null, exception); } + + /// + /// Logs a trace message with an exception included. + /// + /// The exception to include in log line. + /// The log message. + /// Additional arguments. + public void TraceException(Exception exception, string message, params object[] args) { LogException(Level.Trace, message, args, exception); } + + /// + /// Logs a debug message with an exception included. + /// + /// The exception to include in log line. + /// The log message. + public void DebugException(Exception exception, string message) { LogException(Level.Debug, message, null, exception); } + + /// + /// Logs a debug message with an exception included. + /// + /// The exception to include in log line. + /// The log message. + /// Additional arguments. + public void DebugException(Exception exception, string message, params object[] args) { LogException(Level.Debug, message, args, exception); } + + /// + /// Logs an info message with an exception included. + /// + /// The exception to include in log line. + /// The log message. + public void InfoException(Exception exception, string message) { LogException(Level.Info, message, null, exception); } + + /// + /// Logs an info message with an exception included. + /// + /// The exception to include in log line. + /// The log message. + /// Additional arguments. + public void InfoException(Exception exception, string message, params object[] args) { LogException(Level.Info, message, args, exception); } + + /// + /// Logs a warning message with an exception included. + /// + /// The exception to include in log line. + /// The log message. + public void WarnException(Exception exception, string message) { LogException(Level.Warn, message, null, exception); } + + /// + /// Logs a warning message with an exception included. + /// + /// The exception to include in log line. + /// The log message. + /// Additional arguments. + public void WarnException(Exception exception, string message, params object[] args) { LogException(Level.Warn, message, args, exception); } + + /// + /// Logs an error message with an exception included. + /// + /// The exception to include in log line. + /// The log message. + public void ErrorException(Exception exception, string message) { LogException(Level.Error, message, null, exception); } + + /// + /// Logs an error message with an exception included. + /// + /// The exception to include in log line. + /// The log message. + /// Additional arguments. + public void ErrorException(Exception exception, string message, params object[] args) { LogException(Level.Error, message, args, exception); } + + /// + /// Logs a fatal error message with an exception included. + /// + /// The exception to include in log line. + /// The log message. + public void FatalException(Exception exception, string message) { LogException(Level.Fatal, message, null, exception); } + + /// + /// Logs a fatal error message with an exception included. + /// + /// The exception to include in log line. + /// The log message. + /// Additional arguments. + public void FatalException(Exception exception, string message, params object[] args) { LogException(Level.Fatal, message, args, exception); } + + #endregion + + #region packet loggers + + /// + /// Logs an incoming moonet (protocol-buffer) packet. + /// + /// Incoming protocol-buffer packet. + /// header + public void LogIncomingPacket(Google.ProtocolBuffers.IMessage message, bnet.protocol.Header header) + { + Log(Level.PacketDump, ShortHeader(header) + "[I] " + message.AsText(), null); + } + + /// + /// Logs an incoming game-server packet. + /// + /// Gameserver packet to log. + public void LogIncomingPacket(GameMessage message) + { + Log(Level.PacketDump, "[I] " + message.AsText(), null); + } + + /// + /// Logs an incoming moonet (protocol-buffer) packet. + /// + /// Outgoing protocol-buffer packet. + /// header + public void LogOutgoingPacket(Google.ProtocolBuffers.IMessage message, bnet.protocol.Header header) + { + Log(Level.PacketDump, ShortHeader(header) + "[O] " + message.AsText(), null); + } + + /// + /// Logs an outgoing game-server packet. + /// + /// Gameserver packet to log. + public void LogOutgoingPacket(GameMessage message) + { + Log(Level.PacketDump, "[O] " + message.AsText(), null); + } + + #endregion + + + #region utility functions + + private void Log(Level level, string message, object[] args) // sends logs to log-router. + { + LogRouter.RouteMessage(level, this.Name, args == null ? message : string.Format(CultureInfo.InvariantCulture, message, args)); + } + + private void LogException(Level level, string message, object[] args, Exception exception) // sends logs to log-router. + { + LogRouter.RouteException(level, this.Name, args == null ? message : string.Format(CultureInfo.InvariantCulture, message, args), exception); + } + + private StringBuilder ShortHeader(bnet.protocol.Header header) + { + var result = new StringBuilder("service_id: " + header.ServiceId); + result.Append(header.HasMethodId ? " method_id: " + header.MethodId.ToString() : ""); + result.Append(header.HasToken ? " token: " + header.Token.ToString() : ""); + result.Append(header.HasObjectId ? " object_id: " + header.ObjectId.ToString() : ""); + result.Append(header.HasSize ? " size: " + header.Size.ToString() : ""); + result.Append(header.HasStatus ? " status: " + header.Status.ToString() : ""); + result.AppendLine(); + return result; + } + + #endregion + } +} diff --git a/src/Mooege/Common/MPQ/Asset.cs b/src/Mooege/Common/MPQ/Asset.cs new file mode 100644 index 00000000..9b71b597 --- /dev/null +++ b/src/Mooege/Common/MPQ/Asset.cs @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Common.Logging; + +namespace Mooege.Common.MPQ +{ + public abstract class Asset + { + public SNOGroup Group { get; private set; } + public Int32 SNOId { get; private set; } + public string Name { get; private set; } + public string FileName { get; protected set; } + public Type Parser { get; set; } + + protected FileFormat _data = null; + protected static readonly Logger Logger = LogManager.CreateLogger(); + + public FileFormat Data + { + get + { + if (_data == null && SourceAvailable && Parser != null) + { + try + { + RunParser(); + } + catch (Exception e) + { + Logger.FatalException(e, "Bad MPQ detected, failed parsing asset: {0}", this.FileName); + } + } + return _data; + } + } + + protected abstract bool SourceAvailable { get; } + + + public Asset(SNOGroup group, Int32 snoId, string name) + { + this.FileName = group + "\\" + name + FileExtensions.Extensions[(int)group]; + this.Group = group; + this.SNOId = snoId; + this.Name = name; + } + + public abstract void RunParser(); + } +} diff --git a/src/Mooege/Common/MPQ/DBAsset.cs b/src/Mooege/Common/MPQ/DBAsset.cs new file mode 100644 index 00000000..ddd498ee --- /dev/null +++ b/src/Mooege/Common/MPQ/DBAsset.cs @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Globalization; +using System.Threading; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Common.Storage; + +namespace Mooege.Common.MPQ +{ + public class DBAsset : Asset + { + + protected override bool SourceAvailable + { + get { return true; } + } + + public DBAsset(SNOGroup group, Int32 snoId, string name) + : base(group, snoId, name) + { + } + + public override void RunParser() + { + Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; // Use invariant culture so that we don't hit pitfalls in non en/US systems with different number formats. + _data = (FileFormat)PersistenceManager.Load(Parser, SNOId.ToString()); + } + } +} diff --git a/src/Mooege/Common/MPQ/Data.cs b/src/Mooege/Common/MPQ/Data.cs new file mode 100644 index 00000000..9ea38455 --- /dev/null +++ b/src/Mooege/Common/MPQ/Data.cs @@ -0,0 +1,229 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Reflection; +using System.Threading.Tasks; +using CrystalMpq; +using Gibbed.IO; +using Mooege.Common.Logging; +using Mooege.Common.Versions; +using Mooege.Core.GS.Common.Types.SNO; +using System.Linq; +using System.Data.SQLite; +using Mooege.Common.Storage; + +namespace Mooege.Common.MPQ +{ + public class Data : MPQPatchChain + { + public Dictionary> Assets = new Dictionary>(); + public readonly Dictionary Parsers = new Dictionary(); + private readonly List _tasks = new List(); + private static readonly SNOGroup[] PatchExceptions = new[] { SNOGroup.TimedEvent, SNOGroup.Script, SNOGroup.AiBehavior, SNOGroup.AiState, SNOGroup.Conductor, SNOGroup.FlagSet, SNOGroup.Code }; + + protected static new readonly Logger Logger = LogManager.CreateLogger(); + + public Data() + : base(VersionInfo.MPQ.RequiredPatchVersion, new List { "CoreData.mpq", "ClientData.mpq" }, "/base/d3-update-base-(?.*?).mpq") + { } + + public void Init() + { + Logger.Info("Reading assets from MPQ data.."); + this.InitCatalog(); // init asset-group dictionaries and parsers. + this.LoadCatalogs(); // process the assets. + } + + private void InitCatalog() + { + foreach (SNOGroup group in Enum.GetValues(typeof(SNOGroup))) + { + this.Assets.Add(group, new ConcurrentDictionary()); + } + + foreach (var type in Assembly.GetExecutingAssembly().GetTypes()) + { + if (!type.IsSubclassOf(typeof(FileFormat))) continue; + var attributes = (FileFormatAttribute[])type.GetCustomAttributes(typeof(FileFormatAttribute), false); + if (attributes.Length == 0) continue; + + Parsers.Add(attributes[0].Group, type); + } + } + + private void LoadCatalogs() + { + this.LoadCatalog("CoreTOC.dat"); // as of patch beta patch 7841, blizz renamed TOC.dat as CoreTOC.dat + this.LoadDBCatalog(); + } + + private void LoadCatalog(string fileName, bool useBaseMPQ = false, List groupsToLoad = null) + { + var catalogFile = this.GetFile(fileName, useBaseMPQ); + this._tasks.Clear(); + + if (catalogFile == null) + { + Logger.Error("Couldn't load catalog file: {0}.", fileName); + return; + } + + var stream = catalogFile.Open(); + var assetsCount = stream.ReadValueS32(); + + var timerStart = DateTime.Now; + + // read all assets from the catalog first and process them (ie. find the parser if any available). + while (stream.Position < stream.Length) + { + var group = (SNOGroup)stream.ReadValueS32(); + var snoId = stream.ReadValueS32(); + var name = stream.ReadString(128, true); + + if (groupsToLoad != null && !groupsToLoad.Contains(group)) // if we're handled groups to load, just ignore the ones not in the list. + continue; + + var asset = new MPQAsset(group, snoId, name); + asset.MpqFile = this.GetFile(asset.FileName, PatchExceptions.Contains(asset.Group)); // get the file. note: if file is in any of the groups in PatchExceptions it'll from load the original version - the reason is that assets in those groups got patched to 0 bytes. /raist. + if (asset.MpqFile != null) + this.ProcessAsset(asset); // process the asset. + } + + stream.Close(); + + // Run the parsers for assets (that have a parser). + + if (this._tasks.Count > 0) // if we're running in tasked mode, run the parser tasks. + { + foreach (var task in this._tasks) + { + task.Start(); + } + + Task.WaitAll(this._tasks.ToArray()); // Wait all tasks to finish. + } + + GC.Collect(); // force a garbage collection. + GC.WaitForPendingFinalizers(); + + var elapsedTime = DateTime.Now - timerStart; + + if (Storage.Config.Instance.LazyLoading) + Logger.Trace("Found a total of {0} assets from {1} catalog and postponed loading because lazy loading is activated.", assetsCount, fileName); + else + Logger.Trace("Found a total of {0} assets from {1} catalog and parsed {2} of them in {3:c}.", assetsCount, fileName, this._tasks.Count, elapsedTime); + } + + /// + /// Load the table of contents from the database. the database toc contains the sno ids of all objects + /// that should / can no longer be loaded from mpq because it is zeroed out or because we need to edit + /// some of the fields + /// + private void LoadDBCatalog() + { + int assetCount = 0; + var timerStart = DateTime.Now; + + using (var cmd = new SQLiteCommand("SELECT * FROM TOC", DBManager.MPQMirror)) + { + var itemReader = cmd.ExecuteReader(); + + if (itemReader.HasRows) + { + while (itemReader.Read()) + { + ProcessAsset(new DBAsset( + (SNOGroup)Enum.Parse(typeof(SNOGroup), itemReader["SNOGroup"].ToString()), + Convert.ToInt32(itemReader["SNOId"]), + itemReader["Name"].ToString())); + assetCount++; + } + } + } + + if (Storage.Config.Instance.LazyLoading) + Logger.Trace("Found a total of {0} assets from DB catalog and postponed loading because lazy loading is activated.", assetCount); + else + Logger.Trace("Found a total of {0} assets from DB catalog and parsed {1} of them in {2:c}.", assetCount, this._tasks.Count, DateTime.Now - timerStart); + + } + + /// + /// Adds the asset to the dictionary and tries to parse it if a parser + /// is found and lazy loading is deactivated + /// + /// New asset to be processed + private void ProcessAsset(Asset asset) + { + this.Assets[asset.Group].TryAdd(asset.SNOId, asset); + if (!this.Parsers.ContainsKey(asset.Group)) return; + + asset.Parser = this.Parsers[asset.Group]; + + // If lazy loading is deactivated, immediatly run parsers sequentially or threaded + if (Storage.Config.Instance.LazyLoading == false) + { + if (Storage.Config.Instance.EnableTasks) + this._tasks.Add(new Task(() => asset.RunParser())); + else + { + try + { + asset.RunParser(); + } + catch (Exception e) + { + Logger.Error("Error parsing {0}.\nMessage: {1}\n InnerException:{2}\nStack Trace:{3}", asset.FileName, e.Message, e.InnerException == null ? "(null)" : e.InnerException.Message, e.StackTrace); + } + } + } + } + + /// + /// Gets a file from the mpq storage. + /// + /// File to read. + /// Use the most available patched version? If you supply false to useMostAvailablePatchedVersion, it'll be looking for file starting from the base mpq up to latest available patch. + /// The MpqFile + private MpqFile GetFile(string fileName, bool startSearchingFromBaseMPQ = false) + { + MpqFile file = null; + + //Ignore loading lvl files for now. + if (fileName.Contains(".lvl")) + return null; + + if (!startSearchingFromBaseMPQ) + file = this.FileSystem.FindFile(fileName); + else + { + foreach (MpqArchive archive in this.FileSystem.Archives.Reverse()) //search mpqs starting from base + { + file = archive.FindFile(fileName); + if (file != null) + break; + } + } + + return file; + } + } +} diff --git a/src/Mooege/Common/MPQ/FileExtensions.cs b/src/Mooege/Common/MPQ/FileExtensions.cs new file mode 100644 index 00000000..a66fc9ec --- /dev/null +++ b/src/Mooege/Common/MPQ/FileExtensions.cs @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace Mooege.Common.MPQ +{ + public static class FileExtensions + { + public static string[] Extensions = new[] + { + "", ".acr", ".adv", ".aib", ".ais", ".ams", ".ani", ".an2", + ".ans", ".app", ".hro", ".clt", ".cnv", ".cnl", ".efg", ".enc", + "", ".xpl", ".flg", ".fnt", ".gam", ".glo", ".lvl", ".lit", + ".mrk", ".mon", ".obs", ".prt", ".phy", ".pow", "", ".qst", + ".rop", ".scn", ".scg", ".scr", ".shm", ".shd", ".shk", ".skl", + ".snd", ".sbk", ".stl", ".srf", ".tex", ".trl", ".ui", ".wth", + ".wrl", ".rcp", "", ".cnd", ".trs", ".acc", ".con", ".tme", + ".act", ".mat", ".qsr", ".lor", ".rev", ".phm", ".mus", ".tut", + ".bos", ".ctr" + }; + } +} diff --git a/src/Mooege/Common/MPQ/FileFormat.cs b/src/Mooege/Common/MPQ/FileFormat.cs new file mode 100644 index 00000000..c91871b6 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormat.cs @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace Mooege.Common.MPQ +{ + public class FileFormat + { } +} diff --git a/src/Mooege/Common/MPQ/FileFormatAttribute.cs b/src/Mooege/Common/MPQ/FileFormatAttribute.cs new file mode 100644 index 00000000..d65e1dfe --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormatAttribute.cs @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using Mooege.Core.GS.Common.Types.SNO; + +namespace Mooege.Common.MPQ +{ + [AttributeUsage(AttributeTargets.Class)] + public class FileFormatAttribute : Attribute + { + public SNOGroup Group { get; private set; } + + public FileFormatAttribute(SNOGroup group) + { + this.Group = group; + } + } +} diff --git a/src/Mooege/Common/MPQ/FileFormats/Act.cs b/src/Mooege/Common/MPQ/FileFormats/Act.cs new file mode 100644 index 00000000..c7330fa7 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/Act.cs @@ -0,0 +1,116 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using CrystalMpq; +using Gibbed.IO; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Common.MPQ.FileFormats.Types; + +namespace Mooege.Common.MPQ.FileFormats +{ + [FileFormat(SNOGroup.Act)] + public class Act : FileFormat + { + public Header Header { get; private set; } + public List ActQuestInfo { get; private set; } + public WaypointInfo[] WayPointInfo { get; private set; } + public ResolvedPortalDestination ResolvedPortalDestination { get; private set; } + public ActStartLocOverride[] ActStartLocOverrides { get; private set; } + + public Act(MpqFile file) + { + var stream = file.Open(); + this.Header = new Header(stream); + + this.ActQuestInfo = stream.ReadSerializedData(); + stream.Position += 12; + + this.WayPointInfo = new WaypointInfo[25]; + for (int i = 0; i < WayPointInfo.Length; i++) + this.WayPointInfo[i] = new WaypointInfo(stream); + + this.ResolvedPortalDestination = new ResolvedPortalDestination(stream); + + this.ActStartLocOverrides = new ActStartLocOverride[6]; + for (int i = 0; i < ActStartLocOverrides.Length; i++) + this.ActStartLocOverrides[i] = new ActStartLocOverride(stream); + + stream.Close(); + } + } + + public class WaypointInfo + { + public int SNOWorld { get; private set; } + public int SNOLevelArea { get; private set; } + public int I0 { get; private set; } + public int I1 { get; private set; } + public int I2 { get; private set; } + public int SNOQuestRange { get; private set; } + public int I3 { get; private set; } + + public WaypointInfo(MpqFileStream stream) + { + SNOWorld = stream.ReadValueS32(); + SNOLevelArea = stream.ReadValueS32(); + I0 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); + I2 = stream.ReadValueS32(); + SNOQuestRange = stream.ReadValueS32(); + I3 = stream.ReadValueS32(); + } + } + + public class ActStartLocOverride + { + public ResolvedPortalDestination ResolvedPortalDestination { get; private set; } + public int SNOQuestRange { get; private set; } + + public ActStartLocOverride(MpqFileStream stream) + { + ResolvedPortalDestination = new ResolvedPortalDestination(stream); + SNOQuestRange = stream.ReadValueS32(); + } + } + + + public class ResolvedPortalDestination + { + public int SNOWorld { get; private set; } + public int I0 { get; private set; } + public int SNODestLevelArea { get; private set; } + + public ResolvedPortalDestination(MpqFileStream stream) + { + SNOWorld = stream.ReadValueS32(); + I0 = stream.ReadValueS32(); + SNODestLevelArea = stream.ReadValueS32(); + } + } + + public class ActQuestInfo : ISerializableData + { + public int SNOQuest { get; private set; } + + public void Read(MpqFileStream stream) + { + SNOQuest = stream.ReadValueS32(); + } + } +} diff --git a/src/Mooege/Common/MPQ/FileFormats/Actor.cs b/src/Mooege/Common/MPQ/FileFormats/Actor.cs new file mode 100644 index 00000000..8c69f782 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/Actor.cs @@ -0,0 +1,192 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using CrystalMpq; +using Gibbed.IO; +using Mooege.Core.GS.Actors; +using Mooege.Core.GS.Common.Types.Collision; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Common.MPQ.FileFormats.Types; +using Mooege.Core.GS.Common.Types.TagMap; + +namespace Mooege.Common.MPQ.FileFormats +{ + [FileFormat(SNOGroup.Actor)] + public class Actor : FileFormat + { + public Header Header { get; private set; } + public int Int0 { get; private set; } + + /// + /// Actor Type + /// + public ActorType Type { get; private set; } + + /// + /// SNO for Apperance + /// + public int ApperanceSNO { get; private set; } + + public int PhysMeshSNO { get; private set; } + public AxialCylinder Cylinder { get; private set; } + public Sphere Sphere { get; private set; } + public AABB AABBBounds { get; private set; } + public TagMap TagMap { get; private set; } + + /// + /// SNO for actor's animset. + /// + public int AnimSetSNO { get; private set; } + + /// + /// MonterSNO if any. + /// + public int MonsterSNO { get; private set; } + public List MsgTriggeredEvents = new List(); + + public int Int1 { get; private set; } + public Vector3D V0 { get; private set; } + public WeightedLook[] Looks { get; private set; } + public int PhysicsSNO { get; private set; } + public int Int2 { get; private set; } + public int Int3 { get; private set; } + public float Float0 { get; private set; } + public float Float1 { get; private set; } + public float Float2 { get; private set; } + public ActorCollisionData ActorCollisionData { get; private set; } + public int[] InventoryImages { get; private set; } + public int Int4 { get; private set; } + public string CastingNotes { get; private set; } + public string VoiceOverRole { get; private set; } + public int BitField0 { get; private set; } // 25 bits - better this this would be an uint + public int BitField1 { get; private set; } // 25 bits - better this this would be an uint + + public Actor(MpqFile file) + { + var stream = file.Open(); + Header = new Header(stream); + + this.Int0 = stream.ReadValueS32(); + this.Type = (ActorType)stream.ReadValueS32(); + this.ApperanceSNO = stream.ReadValueS32(); + this.PhysMeshSNO = stream.ReadValueS32(); + this.Cylinder = new AxialCylinder(stream); + this.Sphere = new Sphere(stream); + this.AABBBounds = new AABB(stream); + + this.TagMap = stream.ReadSerializedItem(); + stream.Position += (2 * 4); + + this.AnimSetSNO = stream.ReadValueS32(); + this.MonsterSNO = stream.ReadValueS32(); + + MsgTriggeredEvents = stream.ReadSerializedData(); + + this.Int1 = stream.ReadValueS32(); + stream.Position += (3 * 4); + this.V0 = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32()); + + this.Looks = new WeightedLook[8]; + for (int i = 0; i < 8; i++) + { + this.Looks[i] = new WeightedLook(stream); + } + + this.PhysicsSNO = stream.ReadValueS32(); + this.Int2 = stream.ReadValueS32(); + this.Int3 = stream.ReadValueS32(); + this.Float0 = stream.ReadValueF32(); + this.Float1 = stream.ReadValueF32(); + this.Float2 = stream.ReadValueF32(); + + this.ActorCollisionData = new ActorCollisionData(stream); + + this.InventoryImages = new int[10]; //Was 5*8/4 - Darklotus + for (int i = 0; i < 10; i++) + { + this.InventoryImages[i] = stream.ReadValueS32(); + } + this.Int4 = stream.ReadValueS32(); + stream.Position += 4; + BitField0 = stream.ReadValueS32(); + CastingNotes = stream.ReadSerializedString(); + VoiceOverRole = stream.ReadSerializedString(); + + // Updated based on BoyC's 010 template and Moack's work. Think we just about read all data from actor now.- DarkLotus + stream.Close(); + } + } + public class ActorCollisionData + { + public ActorCollisionFlags ColFlags { get; private set; } + public int I0 { get; private set; } + public AxialCylinder Cylinder { get; private set; } + public AABB AABB { get; private set; } + public float F0 { get; private set; } + + public ActorCollisionData(MpqFileStream stream) + { + ColFlags = new ActorCollisionFlags(stream); + I0 = stream.ReadValueS32(); + Cylinder = new AxialCylinder(stream); + AABB = new AABB(stream); + F0 = stream.ReadValueF32(); + stream.ReadValueS32();// Testing - DarkLotus + } + } + + public class AxialCylinder + { + public Vector3D Position { get; private set; } + public float Ax1 { get; private set; } + public float Ax2 { get; private set; } + + public AxialCylinder(MpqFileStream stream) + { + this.Position = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32()); + Ax1 = stream.ReadValueF32(); + Ax2 = stream.ReadValueF32(); + } + } + + public class Sphere + { + public Vector3D Position { get; private set; } + public float Radius { get; private set; } + + public Sphere(MpqFileStream stream) + { + Position = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32()); + Radius = stream.ReadValueF32(); + } + } + + public class WeightedLook + { + public string LookLink { get; private set; } + public int Int0 { get; private set; } + + public WeightedLook(MpqFileStream stream) + { + this.LookLink = stream.ReadString(64, true); + Int0 = stream.ReadValueS32(); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Common/MPQ/FileFormats/Adventure.cs b/src/Mooege/Common/MPQ/FileFormats/Adventure.cs new file mode 100644 index 00000000..6754d119 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/Adventure.cs @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using CrystalMpq; +using Gibbed.IO; +using Mooege.Common.MPQ.FileFormats.Types; +using Mooege.Core.GS.Common.Types.SNO; + +namespace Mooege.Common.MPQ.FileFormats +{ + [FileFormat(SNOGroup.Adventure)] + public class Adventure : FileFormat + { + public Header Header { get; private set; } + public int SNOSymbolActor { get; private set; } + public float F0 { get; private set; } + public float F1 { get; private set; } + public float F2 { get; private set; } + public float F3 { get; private set; } + public int SNOMarkerSet { get; private set; } + + public Adventure(MpqFile file) + { + var stream = file.Open(); + this.Header = new Header(stream); + this.SNOSymbolActor = stream.ReadValueS32(); + this.F0 = stream.ReadValueF32(); + this.F1 = stream.ReadValueF32(); + this.F2 = stream.ReadValueF32(); + this.F3 = stream.ReadValueF32(); + this.SNOMarkerSet = stream.ReadValueS32(); + stream.Close(); + } + } +} diff --git a/src/Mooege/Common/MPQ/FileFormats/Anim.cs b/src/Mooege/Common/MPQ/FileFormats/Anim.cs new file mode 100644 index 00000000..43c01118 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/Anim.cs @@ -0,0 +1,274 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using CrystalMpq; +using Gibbed.IO; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Common.MPQ.FileFormats.Types; +using Mooege.Core.GS.Common.Types.Math; + +namespace Mooege.Common.MPQ.FileFormats +{ + [FileFormat(SNOGroup.Anim)] + public class Anim : FileFormat + { + public Header Header { get; private set; } + public int I0 { get; private set; } + public int I1 { get; private set; } + public int SNOAppearance { get; private set; } + public List Permutations { get; private set; } + public int I2 { get; private set; } + public int I3 { get; private set; } + + public Anim(MpqFile file) + { + var stream = file.Open(); + this.Header = new Header(stream); + this.I0 = stream.ReadValueS32(); + this.I1 = stream.ReadValueS32(); + this.SNOAppearance = stream.ReadValueS32(); + this.Permutations = stream.ReadSerializedData(); + this.I2 = stream.ReadValueS32(); + stream.Position += 12; + this.I3 = stream.ReadValueS32(); + stream.Close(); + } + } + + public class AnimPermutation : ISerializableData + { + public int I0 { get; private set; } + public string AnimName { get; private set; } + public float Velocity { get; private set; } + public float F0 { get; private set; } + public float F1 { get; private set; } + public float F2 { get; private set; } + public float F3 { get; private set; } + public int Time1 { get; private set; } + public int Time2 { get; private set; } + public int I1 { get; private set; } + public float F4 { get; private set; } + public float F5 { get; private set; } + public float F6 { get; private set; } + public float F7 { get; private set; } + public int BoneNameCount { get; private set; } + public List BoneNames { get; private set; } + public int KeyframePosCount { get; private set; } + public List TranslationCurves { get; private set; } + public List RotationCurves { get; private set; } + public List ScaleCurves { get; private set; } + public float F8 { get; private set; } + public float F9 { get; private set; } + public float F10 { get; private set; } + public float F11 { get; private set; } + public Vector3D V0 { get; private set; } + public Vector3D V1 { get; private set; } + public Vector3D V2 { get; private set; } + public Vector3D V3 { get; private set; } + public float F12 { get; private set; } + public int KeyedAttachmentsCount { get; private set; } + public List KeyedAttachments { get; private set; } + public List KeyframePosList { get; private set; } + public List NonlinearOffset { get; private set; } + public VelocityVector3D Velocity3D { get; private set; } + public HardPointLink Link { get; private set; } + public string S0 { get; private set; } + public string S1 { get; private set; } + + public void Read(MpqFileStream stream) + { + this.I0 = stream.ReadValueS32(); + this.AnimName = stream.ReadString(65, true); + stream.Position += 3; + this.Velocity = stream.ReadValueF32(); + this.F0 = stream.ReadValueF32(); + this.F1 = stream.ReadValueF32(); + this.F2 = stream.ReadValueF32(); + this.F3 = stream.ReadValueF32(); + this.Time1 = stream.ReadValueS32(); + this.Time2 = stream.ReadValueS32(); + this.I1 = stream.ReadValueS32(); + this.F4 = stream.ReadValueF32(); + this.F5 = stream.ReadValueF32(); + this.F6 = stream.ReadValueF32(); + this.F7 = stream.ReadValueF32(); + this.BoneNameCount = stream.ReadValueS32(); + this.BoneNames = stream.ReadSerializedData(); + stream.Position += 12; + this.KeyframePosCount = stream.ReadValueS32(); + this.TranslationCurves = stream.ReadSerializedData(); + stream.Position += 12; + this.RotationCurves = stream.ReadSerializedData(); + stream.Position += 8; + this.ScaleCurves = stream.ReadSerializedData(); + stream.Position += 8; + this.F8 = stream.ReadValueF32(); + this.F9 = stream.ReadValueF32(); + this.F10 = stream.ReadValueF32(); + this.F11 = stream.ReadValueF32(); + this.V0 = new Vector3D(stream); + this.V1 = new Vector3D(stream); + this.V2 = new Vector3D(stream); + this.V3 = new Vector3D(stream); + this.F12 = stream.ReadValueF32(); + this.KeyedAttachments = stream.ReadSerializedData(); + this.KeyedAttachmentsCount = stream.ReadValueS32(); + stream.Position += 8; + this.KeyframePosList = stream.ReadSerializedData(); + stream.Position += 8; + this.NonlinearOffset = stream.ReadSerializedData(); + stream.Position += 8; + this.Velocity3D = new VelocityVector3D(stream); + this.Link = new HardPointLink(stream); + this.S0 = stream.ReadString(256, true); + this.S1 = stream.ReadString(256, true); + stream.Position += 8; + } + } + + public class BoneName : ISerializableData + { + public string Name { get; private set; } + + public void Read(MpqFileStream stream) + { + this.Name = stream.ReadString(64, true); + } + } + + public class TranslationCurve : ISerializableData + { + public int I0 { get; private set; } + public List Keys { get; private set; } + + public void Read(MpqFileStream stream) + { + this.I0 = stream.ReadValueS32(); + this.Keys = stream.ReadSerializedData(); + } + } + + public class RotationCurve : ISerializableData + { + public int I0 { get; private set; } + public List Keys { get; private set; } + + public void Read(MpqFileStream stream) + { + this.I0 = stream.ReadValueS32(); + this.Keys = stream.ReadSerializedData(); + } + } + + public class ScaleCurve : ISerializableData + { + public int I0 { get; private set; } + public List Keys { get; private set; } + + public void Read(MpqFileStream stream) + { + this.I0 = stream.ReadValueS32(); + this.Keys = stream.ReadSerializedData(); + } + } + + public class TranslationKey : ISerializableData + { + public int I0 { get; private set; } + public Vector3D Location { get; private set; } + + public void Read(MpqFileStream stream) + { + this.I0 = stream.ReadValueS32(); + this.Location = new Vector3D(stream); + } + } + + public class RotationKey : ISerializableData + { + public int I0 { get; private set; } + public Quaternion16 Q0 { get; private set; } + + public void Read(MpqFileStream stream) + { + this.I0 = stream.ReadValueS32(); + this.Q0 = new Quaternion16(stream); + } + } + + public class ScaleKey : ISerializableData + { + public int I0 { get; private set; } + public float Scale { get; private set; } + + public void Read(MpqFileStream stream) + { + this.I0 = stream.ReadValueS32(); + this.Scale = stream.ReadValueF32(); + } + } + + public class KeyframedAttachment : ISerializableData + { + public float F0 { get; private set; } + public TriggerEvent Event { get; private set; } + + public void Read(MpqFileStream stream) + { + this.F0 = stream.ReadValueF32(); + this.Event = new TriggerEvent(stream); + } + } + + public class VelocityVector3D + { + public float VelocityX { get; private set; } + public float VelocityY { get; private set; } + public float VelocityZ { get; private set; } + + public VelocityVector3D(MpqFileStream stream) + { + this.VelocityX = stream.ReadValueF32(); + this.VelocityY = stream.ReadValueF32(); + this.VelocityZ = stream.ReadValueF32(); + } + } + + public class Quaternion16 + { + public short Short0; + public short Short1; + public short Short2; + public short Short3; + + public Quaternion16() { } + + /// + /// Reads Quaternion16 from given MPQFileStream. + /// + /// The MPQFileStream to read from. + public Quaternion16(MpqFileStream stream) + { + this.Short0 = stream.ReadValueS16(); + this.Short1 = stream.ReadValueS16(); + this.Short2 = stream.ReadValueS16(); + this.Short3 = stream.ReadValueS16(); + } + } +} diff --git a/src/Mooege/Common/MPQ/FileFormats/AnimSet.cs b/src/Mooege/Common/MPQ/FileFormats/AnimSet.cs new file mode 100644 index 00000000..06264cbb --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/AnimSet.cs @@ -0,0 +1,181 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using System.Linq; +using CrystalMpq; +using Gibbed.IO; +using Mooege.Common.Helpers.Math; +using Mooege.Common.MPQ.FileFormats.Types; +using Mooege.Core.GS.Common.Types.SNO; +using System; +using Mooege.Common.Helpers; +using Mooege.Core.GS.Common.Types.TagMap; + +namespace Mooege.Common.MPQ.FileFormats +{ + [FileFormat(SNOGroup.AnimSet)] + public class AnimSet : FileFormat + { + public Header Header { get; private set; } + public int SNOParentAnimSet { get; private set; } + public TagMap TagMapAnimDefault { get; private set; } + public TagMap[] AnimSetTagMaps; + + + private Dictionary _animations; + public Dictionary Animations + { + get + { + if (_animations == null) + { + _animations = new Dictionary(); + foreach (var x in TagMapAnimDefault.TagMapEntries) + { + _animations.Add(x.TagID, x.Int); + } + //not sure how better to do this, cant load parents anims on init as they may not be loaded first. - DarkLotus + if (SNOParentAnimSet != -1) + { + var ani = (FileFormats.AnimSet)MPQStorage.Data.Assets[SNOGroup.AnimSet][SNOParentAnimSet].Data; + foreach (var x in ani.Animations) + { + if (!_animations.ContainsKey(x.Key)) + _animations.Add(x.Key, x.Value); + } + } + + } return _animations; + } + } + + public AnimSet(MpqFile file) + { + var stream = file.Open(); + this.Header = new Header(stream); + this.SNOParentAnimSet = stream.ReadValueS32(); + TagMapAnimDefault = stream.ReadSerializedItem(); + stream.Position += 8; + AnimSetTagMaps = new TagMap[19]; + for (int i = 0; i < 19; i++) + { + AnimSetTagMaps[i] = stream.ReadSerializedItem(); + stream.Position += 8; + } + + stream.Close(); + } + public int GetAniSNO(AnimationTags type) + { + if (Animations.Keys.Contains((int)type)) + { + if (Animations[(int)type] != -1) + { + return Animations[(int)type]; + } + } + return -1; + } + public bool TagExists(AnimationTags type) + { + if (Animations.Keys.Contains((int)type)) + { + return true; + } + return false; + } + public int GetAnimationTag(AnimationTags type) + { + if (Animations.Keys.Contains((int)type)) + { + return (int)type; + } + return -1; + } + public int GetRandomDeath() + { + int ani = -1; + if (!TagExists(AnimationTags.DeathDefault)) { return -1; } + while (ani == -1) + { + Array values = Enum.GetValues(typeof(DeathTags)); + ani = GetAniSNO((AnimationTags)values.GetValue(RandomHelper.Next(0, values.Length - 1))); + } + return ani; + } + private enum DeathTags + { + Arcane = 73776, + Fire = 73744, + Lightning = 73760, + Poison = 73792, + Plague = 73856, + Dismember = 73872, + Default = 69712, + Pulverise = 73824, + Cold = 74016, + Lava = 74032, + Holy = 74048, + Spirit = 74064, + FlyingOrDefault = 71424 + } + } + public enum AnimationTags + { + GenericCast = 262144, + Idle2 = 69632, + Idle = 69968, + Spawn = 70097, + + KnockBackLand = 71176, + KnockBackMegaOuttro = 71218, + KnockBack = 71168, + KnockBackMegaIntro = 71216, + RangedAttack = 69840, + Stunned = 69648, + GetHit = 69664, + Dead1 = 79168, + Dead2 = 79152, + Dead3 = 77920, + Dead4 = 77888, + Dead5 = 77904, + Dead6 = 77872, + Dead7 = 77856, + Dead8 = 77840, + SpecialDead = 71440, + Run = 69728, + Walk = 69744, + Attack = 69776, + Attack2 = 69792, + SpecialAttack = 69904, + DeathArcane = 73776, + DeathFire = 73744, + DeathLightning = 73760, + DeathPoison = 73792, + DeathPlague = 73856, + DeathDismember = 73872, + DeathDefault = 69712, + DeathPulverise = 73824, + DeathCold = 74016, + DeathLava = 74032, + DeathHoly = 74048, + DeathSpirit = 74064, + DeathFlyingOrDefault = 71424 + } +} diff --git a/src/Mooege/Common/MPQ/FileFormats/BossEncounter.cs b/src/Mooege/Common/MPQ/FileFormats/BossEncounter.cs new file mode 100644 index 00000000..2f46e3b3 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/BossEncounter.cs @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using CrystalMpq; +using Gibbed.IO; +using Mooege.Common.MPQ.FileFormats.Types; +using Mooege.Core.GS.Common.Types.SNO; + +namespace Mooege.Common.MPQ.FileFormats +{ + [FileFormat(SNOGroup.BossEncounter)] + public class BossEncounter : FileFormat + { + public Header Header { get; private set; } + public int I0 { get; private set; } + public int I1 { get; private set; } + public int I2 { get; private set; } + public int I3 { get; private set; } + public int I4 { get; private set; } + public int I5 { get; private set; } + public int I6 { get; private set; } + public int I7 { get; private set; } + public int I8 { get; private set; } + public int I9 { get; private set; } + public int SNOQuestRange { get; private set; } + public int[] Worlds { get; private set; } + public int[] Scripts { get; private set; } + + public BossEncounter(MpqFile file) + { + var stream = file.Open(); + this.Header = new Header(stream); + this.I0 = stream.ReadValueS32(); + this.I1 = stream.ReadValueS32(); + this.I2 = stream.ReadValueS32(); + this.I3 = stream.ReadValueS32(); + this.I4 = stream.ReadValueS32(); + this.I5 = stream.ReadValueS32(); + this.I6 = stream.ReadValueS32(); + this.I7 = stream.ReadValueS32(); + this.I8 = stream.ReadValueS32(); + this.I9 = stream.ReadValueS32(); + this.SNOQuestRange = stream.ReadValueS32(); + this.Worlds = new int[4]; + for (int i = 0; i < 4; i++) + this.Worlds[i] = stream.ReadValueS32(); + this.Scripts = new int[3]; + for (int i = 0; i < 3; i++) + this.Scripts[i] = stream.ReadValueS32(); + stream.Close(); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Common/MPQ/FileFormats/Condition.cs b/src/Mooege/Common/MPQ/FileFormats/Condition.cs new file mode 100644 index 00000000..e841bc19 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/Condition.cs @@ -0,0 +1,223 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using CrystalMpq; +using Gibbed.IO; +using Mooege.Common.MPQ.FileFormats.Types; +using Mooege.Core.GS.Common.Types.SNO; + +namespace Mooege.Common.MPQ.FileFormats +{ + [FileFormat(SNOGroup.Condition)] + public class Condition : FileFormat + { + public Header Header { get; private set; } + public int I0 { get; private set; } + public int I1 { get; private set; } + public int[] Class { get; private set; } + public int[] Difficulty { get; private set; } + public LoreSubcondition[] LoreCondition { get; private set; } + public QuestSubcondition[] QuestCondition { get; private set; } + public ItemSubcondition[] ItemCondition { get; private set; } + public int I4 { get; private set; } + public int I5 { get; private set; } + public int I6 { get; private set; } + public int I7 { get; private set; } + public int I8 { get; private set; } + public int I9 { get; private set; } + public int SNOCurrentWorld { get; private set; } + public int SNOCurrentLevelArea { get; private set; } + public int SNOQuestRange { get; private set; } + public FollowerSubcondition FollowerCondition { get; private set; } + public LabelSubcondition[] LabelCondition { get; private set; } + public SkillSubcondition[] SkillCondition { get; private set; } + public MonsterSubcondition[] MonsterCondition { get; private set; } + public GameFlagSubcondition[] GameFlagCondition { get; private set; } + public PlayerFlagSubcondition[] PlayerFlagCondition { get; private set; } + + public Condition(MpqFile file) + { + var stream = file.Open(); + this.Header = new Header(stream); + this.I0 = stream.ReadValueS32(); + this.I1 = stream.ReadValueS32(); + this.Class = new int[5]; + for (int i = 0; i < 5; i++) + this.Class[i] = stream.ReadValueS32(); + this.Difficulty = new int[4]; + for (int i = 0; i < 4; i++) + this.Difficulty[i] = stream.ReadValueS32(); + this.LoreCondition = new LoreSubcondition[3]; + for (int i = 0; i < 3; i++) + this.LoreCondition[i] = new LoreSubcondition(stream); + this.QuestCondition = new QuestSubcondition[3]; + for (int i = 0; i < 3; i++) + this.QuestCondition[i] = new QuestSubcondition(stream); + this.ItemCondition = new ItemSubcondition[3]; + for (int i = 0; i < 3; i++) + this.ItemCondition[i] = new ItemSubcondition(stream); + this.I4 = stream.ReadValueS32(); //176 + this.I5 = stream.ReadValueS32(); + stream.Position += 4; + this.I6 = stream.ReadValueS32(); + this.I7 = stream.ReadValueS32(); + this.I8 = stream.ReadValueS32(); + this.I9 = stream.ReadValueS32(); + this.SNOCurrentWorld = stream.ReadValueS32(); + this.SNOCurrentLevelArea = stream.ReadValueS32(); + this.SNOQuestRange = stream.ReadValueS32(); + this.FollowerCondition = new FollowerSubcondition(stream); + this.LabelCondition = new LabelSubcondition[3]; + for (int i = 0; i < 3; i++) + this.LabelCondition[i] = new LabelSubcondition(stream); + this.SkillCondition = new SkillSubcondition[3]; + for (int i = 0; i < 3; i++) + this.SkillCondition[i] = new SkillSubcondition(stream); + this.MonsterCondition = new MonsterSubcondition[3]; + for (int i = 0; i < 3; i++) + this.MonsterCondition[i] = new MonsterSubcondition(stream); + this.GameFlagCondition = new GameFlagSubcondition[3]; + for (int i = 0; i < 3; i++) + this.GameFlagCondition[i] = new GameFlagSubcondition(stream); + this.PlayerFlagCondition = new PlayerFlagSubcondition[3]; + for (int i = 0; i < 3; i++) + this.PlayerFlagCondition[i] = new PlayerFlagSubcondition(stream); + stream.Close(); + } + } + + public class LoreSubcondition + { + public int SNOLore { get; private set; } + public int I0 { get; private set; } + + public LoreSubcondition(MpqFileStream stream) + { + this.SNOLore = stream.ReadValueS32(); + this.I0 = stream.ReadValueS32(); + } + } + + public class QuestSubcondition + { + public int SNOQuest { get; private set; } + public int I0 { get; private set; } + public int I1 { get; private set; } + public int I2 { get; private set; } + + public QuestSubcondition(MpqFileStream stream) + { + this.SNOQuest = stream.ReadValueS32(); + this.I0 = stream.ReadValueS32(); + this.I1 = stream.ReadValueS32(); + this.I2 = stream.ReadValueS32(); + } + } + + public class ItemSubcondition + { + public int ItemGBId { get; private set; } + public int I0 { get; private set; } + public int I1 { get; private set; } + public int I2 { get; private set; } + + public ItemSubcondition(MpqFileStream stream) + { + this.ItemGBId = stream.ReadValueS32(); + this.I0 = stream.ReadValueS32(); + this.I1 = stream.ReadValueS32(); + this.I2 = stream.ReadValueS32(); + } + } + + public class FollowerSubcondition + { + public FollowerType Type { get; private set; } + public int I0 { get; private set; } + + public FollowerSubcondition(MpqFileStream stream) + { + this.Type = (FollowerType)stream.ReadValueS32(); + this.I0 = stream.ReadValueS32(); + } + } + + public class LabelSubcondition + { + public int LabelGBId { get; private set; } + public int I0 { get; private set; } + + public LabelSubcondition(MpqFileStream stream) + { + this.LabelGBId = stream.ReadValueS32(); + this.I0 = stream.ReadValueS32(); + } + } + + public class SkillSubcondition + { + public int SNOSkillPower { get; private set; } + public int I0 { get; private set; } + public int I1 { get; private set; } + + public SkillSubcondition(MpqFileStream stream) + { + this.SNOSkillPower = stream.ReadValueS32(); + this.I0 = stream.ReadValueS32(); + this.I1 = stream.ReadValueS32(); + } + } + + public class MonsterSubcondition + { + public int SNOMonsterActor { get; private set; } + + public MonsterSubcondition(MpqFileStream stream) + { + this.SNOMonsterActor = stream.ReadValueS32(); + } + } + + public class GameFlagSubcondition + { + public string S0 { get; private set; } + + public GameFlagSubcondition(MpqFileStream stream) + { + this.S0 = stream.ReadString(128, true); + } + } + + public class PlayerFlagSubcondition + { + public string S0 { get; private set; } + + public PlayerFlagSubcondition(MpqFileStream stream) + { + this.S0 = stream.ReadString(128, true); + } + } + + public enum FollowerType + { + None = 0, + Templar, + Scoundrel, + Enchantress, + } +} \ No newline at end of file diff --git a/src/Mooege/Common/MPQ/FileFormats/Conversation.cs b/src/Mooege/Common/MPQ/FileFormats/Conversation.cs new file mode 100644 index 00000000..243e839d --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/Conversation.cs @@ -0,0 +1,260 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using CrystalMpq; +using Gibbed.IO; +using Mooege.Common.MPQ.FileFormats.Types; +using Mooege.Core.GS.Common.Types.SNO; +using System.Text; + +namespace Mooege.Common.MPQ.FileFormats +{ + [FileFormat(SNOGroup.Conversation)] + class Conversation : FileFormat + { + public Header Header { get; private set; } + public ConversationTypes ConversationType { get; private set; } + public int I0 { get; private set; } // looks like the conversation icon, its 1 for important quest conversations, 0 otherwise + public int I1 { get; private set; } + public int SNOQuest { get; private set; } + public int I2 { get; private set; } + public int I3 { get; private set; } + public int SNOConvPiggyback { get; private set; } + public int SNOConvUnlock { get; private set; } + public int I4 { get; private set; } + public string Unknown { get; private set; } + public int SNOPrimaryNpc { get; private set; } + public int SNOAltNpc1 { get; private set; } + public int SNOAltNpc2 { get; private set; } + public int SNOAltNpc3 { get; private set; } + public int SNOAltNpc4 { get; private set; } + public int I5 { get; private set; } // not total nodes :-( + public List RootTreeNodes { get; private set; } + public string Unknown2 { get; private set; } + public int I6 { get; private set; } + public string CompiledScript { get; private set; } + public int SNOBossEncounter { get; private set; } + + public Conversation(MpqFile file) + { + MpqFileStream stream = file.Open(); + + this.Header = new Header(stream); + this.ConversationType = (ConversationTypes)stream.ReadValueS32(); + this.I0 = stream.ReadValueS32(); + this.I1 = stream.ReadValueS32(); + this.SNOQuest = stream.ReadValueS32(); + this.I2 = stream.ReadValueS32(); + this.I3 = stream.ReadValueS32(); + this.SNOConvPiggyback = stream.ReadValueS32(); + this.SNOConvUnlock = stream.ReadValueS32(); + this.I4 = stream.ReadValueS32(); + this.Unknown = stream.ReadString(128, true); + this.SNOPrimaryNpc = stream.ReadValueS32(); + this.SNOAltNpc1 = stream.ReadValueS32(); + this.SNOAltNpc2 = stream.ReadValueS32(); + this.SNOAltNpc3 = stream.ReadValueS32(); + this.SNOAltNpc4 = stream.ReadValueS32(); + this.I5 = stream.ReadValueS32(); + + stream.Position += (2 * 4); + RootTreeNodes = stream.ReadSerializedData(); + + this.Unknown2 = stream.ReadString(256, true); + this.I6 = stream.ReadValueS32(); + + stream.Position += 12; + CompiledScript = Encoding.ASCII.GetString(stream.ReadSerializedByteArray()); + stream.Position += 40; + this.SNOBossEncounter = stream.ReadValueS32(); + stream.Close(); + } + + public string AsText(string filename) + { + StringBuilder s = new StringBuilder(); + + s.AppendLine(Header.SNOId + ":" + filename); + s.AppendLine("ConversationType:" + ConversationType); + s.Append("I0:" + I0 + " "); + s.Append("I1:" + I1 + " "); + s.Append("I2:" + I2 + " "); + s.Append("I3:" + I3 + " "); + s.Append("I4:" + I4 + " "); + s.Append("I5:" + I5 + " "); + s.AppendLine("I6:" + I6); + + s.AppendLine("SNOQuest:" + SNOQuest); + s.AppendLine("SNOConvPiggyBack:" + SNOConvPiggyback); + s.AppendLine("SNOConvUnlock:" + SNOConvUnlock); + s.AppendLine("CompiledScript:" + (CompiledScript.Length != 0).ToString()); + + foreach (var node in RootTreeNodes) + node.AsText(s, 0); + return s.ToString(); + } + } + + + public class ConversationTreeNode : ISerializableData + { + public int I0 { get; private set; } + public int I1 { get; private set; } + public int LineID { get; private set; } // clasid ? + public Speaker Speaker1 { get; private set; } + public Speaker Speaker2 { get; private set; } + public int AnimationTag { get; private set; } + public int I4 { get; private set; } + public int ClassFilter { get; private set; } // only used on nodes with i0 == 5, selects the displaylocalconvline + public ConvLocalDisplayTimes[] ConvLocalDisplayTimes = new ConvLocalDisplayTimes[18]; + public string Comment { get; private set; } + public int I6 { get; private set; } + public List TrueNodes { get; private set; } + public List FalseNodes { get; private set; } + public List ChildNodes { get; private set; } + + public void Read(MpqFileStream stream) + { + I0 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); + LineID = stream.ReadValueS32(); + Speaker1 = (Speaker)stream.ReadValueS32(); + Speaker2 = (Speaker)stream.ReadValueS32(); + AnimationTag = stream.ReadValueS32(); + I4 = stream.ReadValueS32(); + ClassFilter = stream.ReadValueS32(); + + for (int i = 0; i < ConvLocalDisplayTimes.Length; i++) + ConvLocalDisplayTimes[i] = new ConvLocalDisplayTimes(stream); + + stream.Position += (2 * 4); + Comment = stream.ReadSerializedString(); + this.I6 = stream.ReadValueS32(); + + stream.Position += 4; // these are unaccounted for...xml offsets just skips ahead + + stream.Position += (2 * 4); + TrueNodes = stream.ReadSerializedData(); + + stream.Position += (2 * 4); + FalseNodes = stream.ReadSerializedData(); + + stream.Position += (2 * 4); + ChildNodes = stream.ReadSerializedData(); + } + + public void AsText(StringBuilder s, int pad) + { + s.Append(' ', pad); + s.Append("I0:" + I0 + " "); + s.Append("I1:" + I1 + " "); + s.Append("LineID:" + LineID + " "); + s.Append("AnimationTag:" + AnimationTag + " "); + s.Append("I4:" + I4 + " "); + s.Append("ClassFilter:" + ClassFilter + " "); + s.AppendLine("I6:" + I6); + s.Append(' ', pad); s.AppendLine("Speaker1:" + Speaker1); + s.Append(' ', pad); s.AppendLine("Speaker2:" + Speaker2); + s.Append(' ', pad); s.AppendLine("Comment:" + Comment); + + s.Append(' ', pad); s.AppendLine("ConvLocalDisplayTimes: not shown"); + //for (int i = 0; i < ConvLocalDisplayTimes.Length; i++) + // ConvLocalDisplayTimes[i].AsText(s, pad); + + if (TrueNodes.Count > 0) + { + s.Append(' ', pad); s.AppendLine("TrueNodes:"); + s.Append(' ', pad); s.AppendLine("{"); + foreach (var node in TrueNodes) + node.AsText(s, pad + 3); + s.Append(' ', pad); s.AppendLine("}"); + } + if (FalseNodes.Count > 0) + { + s.Append(' ', pad); s.AppendLine("FalseNodes:"); + s.Append(' ', pad); s.AppendLine("{"); + foreach (var node in FalseNodes) + node.AsText(s, pad + 3); + s.Append(' ', pad); s.AppendLine("}"); + } + if (ChildNodes.Count > 0) + { + s.Append(' ', pad); s.AppendLine("ChildNodes:"); + s.Append(' ', pad); s.AppendLine("{"); + foreach (var node in ChildNodes) + node.AsText(s, pad + 3); + s.Append(' ', pad); s.AppendLine("}"); + } + } + + } + + public class ConvLocalDisplayTimes + { + public int[] Languages = new int[10]; + + public ConvLocalDisplayTimes(CrystalMpq.MpqFileStream stream) + { + for (int i = 0; i < Languages.Length; i++) + Languages[i] = stream.ReadValueS32(); + } + + public void AsText(StringBuilder s, int pad) + { + s.Append(' ', pad); + for (int i = 0; i < Languages.Length; i++) + s.Append(Languages[i] + " "); + s.AppendLine(); + } + } + + + public enum ConversationTypes + { + FollowerSoundset = 0, + PlayerEmote = 1, + AmbientFloat = 2, + FollowerBanter = 3, + FollowerCallout = 4, + PlayerCallout = 5, + GlobalChatter = 6, + GlobalFloat = 7, + LoreBook = 8, + AmbientGossip = 9, + TalkMenuGossip = 10, + QuestStandard = 11, + QuestFloat = 12, + QuestEvent = 13 + } + + + public enum Speaker + { + None = -1, + Player = 0, + PrimaryNPC = 1, + AltNPC1 = 2, + AltNPC2 = 3, + AltNPC3 = 4, + AltNPC4 = 5, + TemplarFollower = 6, + ScoundrelFollower = 7, + EnchantressFollower = 8 + } +} diff --git a/src/Mooege/Common/MPQ/FileFormats/ConversationList.cs b/src/Mooege/Common/MPQ/FileFormats/ConversationList.cs new file mode 100644 index 00000000..f196a636 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/ConversationList.cs @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using CrystalMpq; +using Gibbed.IO; +using Mooege.Common.MPQ.FileFormats.Types; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Common.Storage; + +namespace Mooege.Common.MPQ.FileFormats +{ + /// + /// List of all possible conversations for an actor and when they are available + /// + [FileFormat(SNOGroup.ConversationList)] + public class ConversationList : FileFormat + { + [PersistentProperty("ConversationList")] + public List ConversationListEntries { get; private set; } + + public ConversationList() { } + } + + public class ConversationListEntry + { + [PersistentProperty("SNOConversation")] + public int SNOConv { get; private set; } + + [PersistentProperty("I0")] + public int I0 { get; private set; } + + [PersistentProperty("I1")] + public int I1 { get; private set; } + + [PersistentProperty("I2")] + public int I2 { get; private set; } + + [PersistentProperty("GbidItem")] + public int GbidItem { get; private set; } + + [PersistentProperty("Noname1")] + public string Noname1 { get; private set; } + + [PersistentProperty("Noname2")] + public string Noname2 { get; private set; } + + [PersistentProperty("SNOQuestCurrent")] + public int SNOQuestCurrent { get; private set; } + + [PersistentProperty("I3")] + public int I3 { get; private set; } + + [PersistentProperty("SNOQuestAssigned")] + public int SNOQuestAssigned { get; private set; } + + [PersistentProperty("SNOQuestActive")] + public int SNOQuestActive { get; private set; } + + [PersistentProperty("SNOQuestComplete")] + public int SNOQuestComplete { get; private set; } + + [PersistentProperty("SNOQuestRange")] + public int SNOQuestRange { get; private set; } + + [PersistentProperty("SNOLevelArea")] + public int SNOLevelArea { get; private set; } + + public ConversationListEntry() { } + } +} \ No newline at end of file diff --git a/src/Mooege/Common/MPQ/FileFormats/EffectGroup.cs b/src/Mooege/Common/MPQ/FileFormats/EffectGroup.cs new file mode 100644 index 00000000..f4bba57c --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/EffectGroup.cs @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using CrystalMpq; +using Gibbed.IO; +using Mooege.Common.MPQ.FileFormats.Types; +using System.Collections.Generic; +using Mooege.Core.GS.Common.Types.SNO; + +namespace Mooege.Common.MPQ.FileFormats +{ + [FileFormat(SNOGroup.EffectGroup)] + public class EffectGroup : FileFormat + { + public Header Header { get; private set; } + public int I0 { get; private set; } + public int I1 { get; private set; } + public int I2 { get; private set; } + public int I3 { get; private set; } + public int I4 { get; private set; } + public int SnoPower { get; private set; } + public List EffectItems = new List(); + + public EffectGroup(MpqFile file) + { + var stream = file.Open(); + this.Header = new Header(stream); + this.I0 = stream.ReadValueS32(); + this.EffectItems = stream.ReadSerializedData(); + this.I1 = stream.ReadValueS32(); + stream.Position += 4; // pad 1 + this.I2 = stream.ReadValueS32(); + this.I3 = stream.ReadValueS32(); + this.I4 = stream.ReadValueS32(); + this.SnoPower = stream.ReadValueS32(); + stream.Close(); + } + } + public class EffectItem : ISerializableData + { + public int I0 { get; private set; } + public string Name { get; private set; } // 64 + public MsgTriggeredEvent TriggeredEvent = new MsgTriggeredEvent(); + + public void Read(MpqFileStream stream) + { + this.I0 = stream.ReadValueS32(); + // Maybe this should stay a Char Array instead of a string. - DarkLotus + this.Name = stream.ReadString(64, true); + this.TriggeredEvent.Read(stream); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Common/MPQ/FileFormats/Encounter.cs b/src/Mooege/Common/MPQ/FileFormats/Encounter.cs new file mode 100644 index 00000000..de12dedf --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/Encounter.cs @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using CrystalMpq; +using Gibbed.IO; +using Mooege.Common.MPQ.FileFormats.Types; +using Mooege.Core.GS.Common.Types.SNO; + +namespace Mooege.Common.MPQ.FileFormats +{ + [FileFormat(SNOGroup.Encounter)] + public class Encounter : FileFormat + { + public Header Header { get; private set; } + public int SNOSpawn { get; private set; } + public List Spawnoptions = new List(); + + public Encounter(MpqFile file) + { + var stream = file.Open(); + this.Header = new Header(stream); + this.SNOSpawn = stream.ReadValueS32(); + stream.Position += (2 * 4);// pad 2 int + this.Spawnoptions = stream.ReadSerializedData(); + stream.Close(); + } + } + + public class EncounterSpawnOptions : ISerializableData + { + public int SNOSpawn { get; private set; } + public int Probability { get; private set; } + public int I1 { get; private set; } + public int I2 { get; private set; } + + public void Read(MpqFileStream stream) + { + this.SNOSpawn = stream.ReadValueS32(); + this.Probability = stream.ReadValueS32(); + this.I1 = stream.ReadValueS32(); + this.I2 = stream.ReadValueS32(); + } + } +} diff --git a/src/Mooege/Common/MPQ/FileFormats/GameBalance.cs b/src/Mooege/Common/MPQ/FileFormats/GameBalance.cs new file mode 100644 index 00000000..1379be44 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/GameBalance.cs @@ -0,0 +1,1824 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.IO; +using System.Collections.Generic; +using CrystalMpq; +using Gibbed.IO; +using Mooege.Common.Extensions; +using Mooege.Common.MPQ.FileFormats.Types; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Common.Helpers; +using Mooege.Common.Helpers.Hash; +using Mooege.Common.Storage; +using Mooege.Net.GS.Message.Fields; + + +namespace Mooege.Common.MPQ.FileFormats +{ + // this file should be fixed with our naming-conventions. /raist + + [FileFormat(SNOGroup.GameBalance)] + public class GameBalance : FileFormat + { + public Header Header { get; private set; } + public BalanceType Type { get; private set; } + public string Gbi { get; private set; } + public string Xls { get; private set; } + public int I0 { get; private set; } + public int I1 { get; private set; } + public List ItemType { get; private set; } + public List Item { get; private set; } + public List Experience { get; private set; } + public List HelpCodes { get; private set; } + public List MonsterLevel { get; private set; } + public List Affixes { get; private set; } + public List Heros { get; private set; } + + [PersistentProperty("MovementStyles")] + public List MovementStyles { get; private set; } + public List Labels { get; private set; } + + [PersistentProperty("LootDistribution")] + public List LootDistribution { get; private set; } + public List RareItemNames { get; private set; } + public List MonsterAffixes { get; private set; } + public List RareMonsterNames { get; private set; } + public List SocketedEffects { get; private set; } + public List ItemEnhancement { get; private set; } + + [PersistentProperty("ItemDropTable")] + public List ItemDropTable { get; private set; } + + [PersistentProperty("ItemLevelModifiers")] + public List ItemLevelModifiers { get; private set; } + + [PersistentProperty("QualityClasses")] + public List QualityClasses { get; private set; } + public List Hirelings { get; private set; } + public List SetItemBonus { get; private set; } + + [PersistentProperty("EliteModifiers")] + public List EliteModifiers { get; private set; } + + [PersistentProperty("ItemTiers")] + public List ItemTiers { get; private set; } + public List PowerFormula { get; private set; } + public List Recipes { get; private set; } + + [PersistentProperty("ScriptedAchievementEvents")] + public List ScriptedAchievementEvents { get; private set; } + + public GameBalance() { } + + public GameBalance(MpqFile file) + { + var stream = file.Open(); + this.Header = new Header(stream); + this.Type = (BalanceType)stream.ReadValueS32(); + Gbi = stream.ReadString(256, true); + Xls = stream.ReadString(256, true); + this.I0 = stream.ReadValueS32(); + this.I1 = stream.ReadValueS32(); + this.ItemType = stream.ReadSerializedData(); //536 + stream.Position += 8; + this.Item = stream.ReadSerializedData(); //552 + stream.Position += 8; + this.Experience = stream.ReadSerializedData(); //568 + stream.Position += 8; + this.HelpCodes = stream.ReadSerializedData(); //584 + stream.Position += 8; + this.MonsterLevel = stream.ReadSerializedData(); //600 + stream.Position += 8; + this.Affixes = stream.ReadSerializedData(); //616 + stream.Position += 8; + this.Heros = stream.ReadSerializedData(); //632 + stream.Position += 8; + this.MovementStyles = stream.ReadSerializedData(); //648 + stream.Position += 8; + this.Labels = stream.ReadSerializedData(); //664 + stream.Position += 8; + this.LootDistribution = stream.ReadSerializedData(); //680 + stream.Position += 8; + this.RareItemNames = stream.ReadSerializedData(); //696 + stream.Position += 8; + this.MonsterAffixes = stream.ReadSerializedData(); //712 + stream.Position += 8; + this.RareMonsterNames = stream.ReadSerializedData(); //728 + stream.Position += 8; + this.SocketedEffects = stream.ReadSerializedData(); //744 + stream.Position += 8; + this.ItemEnhancement = stream.ReadSerializedData(); //760 + stream.Position += 8; + this.ItemDropTable = stream.ReadSerializedData(); //776 + stream.Position += 8; + this.ItemLevelModifiers = stream.ReadSerializedData(); //792 + stream.Position += 8; + this.QualityClasses = stream.ReadSerializedData(); //808 + stream.Position += 8; + this.Hirelings = stream.ReadSerializedData(); //824 + stream.Position += 8; + this.SetItemBonus = stream.ReadSerializedData(); //840 + stream.Position += 8; + this.EliteModifiers = stream.ReadSerializedData(); //856 + stream.Position += 8; + this.ItemTiers = stream.ReadSerializedData(); //872 + stream.Position += 8; + this.PowerFormula = stream.ReadSerializedData(); //888 + stream.Position += 8; + this.Recipes = stream.ReadSerializedData(); //904 + stream.Position += 8; + this.ScriptedAchievementEvents = stream.ReadSerializedData(); //920 + stream.Close(); + } + + } + + public enum BalanceType : int + { + ItemTypes = 1, + Items = 2, + ExperienceTable = 3, + HelpCodes = 24, + MonsterLevels = 5, + Heros = 7, + AffixList = 8, + MovementStyles = 10, + Labels = 11, + LootDistribution = 12, + RareItemNames = 16, + MonsterAffixes = 18, + MonsterNames = 19, + SocketedEffects = 21, + ItemEnhancements = 23, + ItemDropTable = 25, + ItemLevelModifiers = 26, + QualityClasses = 27, + Scenery = 17, + Hirelings = 4, + SetItemBonuses = 33, + EliteModifiers = 34, + ItemTiers = 35, + PowerFormulaTables = 36, + Recipes = 32, + ScripedAchievementEvents = 37 + } + + public class ItemTypeTable : ISerializableData + { + //Total Length: 320 + public int Hash { get; private set; } + public string Name { get; private set; } + public int ParentType { get; private set; } + public int I0 { get; private set; } + public ItemFlags Flags { get; private set; } + public eItemType Type0 { get; private set; } + public eItemType Type1 { get; private set; } + public eItemType Type2 { get; private set; } + public eItemType Type3 { get; private set; } + public int InheritedAffix0 { get; private set; } + public int InheritedAffix1 { get; private set; } + public int InheritedAffix2 { get; private set; } + public int InheritedAffixFamily0 { get; private set; } + public int[] Array { get; private set; } + + public void Read(MpqFileStream stream) + { + stream.Position += 4; + this.Name = stream.ReadString(256, true); + this.Hash = StringHashHelper.HashItemName(this.Name); + this.ParentType = stream.ReadValueS32(); + this.I0 = stream.ReadValueS32(); + this.Flags = (ItemFlags)stream.ReadValueS32(); + this.Type0 = (eItemType)stream.ReadValueS32(); + this.Type1 = (eItemType)stream.ReadValueS32(); + this.Type2 = (eItemType)stream.ReadValueS32(); + this.Type3 = (eItemType)stream.ReadValueS32(); + this.InheritedAffix0 = stream.ReadValueS32(); + this.InheritedAffix1 = stream.ReadValueS32(); + this.InheritedAffix2 = stream.ReadValueS32(); + this.InheritedAffixFamily0 = stream.ReadValueS32(); + this.Array = new int[4]; + for (int i = 0; i < 4; i++) + this.Array[i] = stream.ReadValueS32(); + } + } + + [Flags] + public enum ItemFlags + { + NotEquipable1 = 0x1, + AtLeastMagical = 0x2, + Gem = 0x8, + NotEquipable2 = 0x40, + Socketable = 0x80, + Unknown = 0x1000, + Barbarian = 0x100, + Wizard = 0x200, + WitchDoctor = 0x400, + DemonHunter = 0x800, + Monk = 0x2000, + } + + public enum eItemType + { + PlayerBackpack = 0, + PlayerHead = 1, + PlayerTorso = 2, + PlayerRightHand = 3, + PlayerLeftHand = 4, + PlayerHands = 5, + PlayerWaist = 6, + PlayerFeet = 7, + PlayerShoulders = 8, + PlayerLegs = 9, + PlayerBracers = 10, + PlayerLeftFinger = 11, + PlayerRightFinger = 12, + PlayerNeck = 13, + Merchant = 18, + PetRightHand = 21, + PetLeftHand = 22, + PetSpecial = 23, + PetNeck = 24, + PetRightFinger = 25, + PetLeftFinger = 26, + } + + public class ItemTable : ISerializableData + { + //Total Length: 1488 + public int Hash { get; private set; } + public string Name { get; private set; } + public int SNOActor { get; private set; } + public int ItemType1 { get; private set; } + public int I0 { get; private set; } + public eItem E0 { get; private set; } + public int ItemLevel { get; private set; } + public int I2 { get; private set; } + public int RandomPropertiesCount { get; private set; } + public int MaxSockets { get; private set; } + public int MaxStackAmount { get; private set; } + public int BaseGoldValue { get; private set; } + public int I7 { get; private set; } + public int RequiredLevel { get; private set; } + public int DurabilityMin { get; private set; } + public int DurabilityDelta { get; private set; } + public int I8 { get; private set; } + public int SNOBaseItem { get; private set; } + public int SNOSet { get; private set; } + public int SNOComponentTreasureClass { get; private set; } + public int SNOComponentTreasureClassMagic { get; private set; } + public int SNOComponentTreasureClassRare { get; private set; } + public int SNORareNamePrefixStringList { get; private set; } + public int SNORareNameSuffixStringList { get; private set; } + public int Flags { get; private set; } + public float WeaponDamageMin { get; private set; } + public float WeaponDamageDelta { get; private set; } + public float ArmorValue { get; private set; } + public float F3 { get; private set; } + public float AttacksPerSecond { get; private set; } + public float F4 { get; private set; } + public float F5 { get; private set; } + public int SNOSkill0 { get; private set; } + public int I11 { get; private set; } + public int SNOSkill1 { get; private set; } + public int I12 { get; private set; } + public int SNOSkill2 { get; private set; } + public int I13 { get; private set; } + public int SNOSkill3 { get; private set; } + public int I14 { get; private set; } + public int[] I15 { get; private set; } + public AttributeSpecifier[] Attribute { get; private set; } + public ItemQuality Quality { get; private set; } + public int[] RecipeToGrant { get; private set; } + public int EnhancementToGrant { get; private set; } + public int[] LegendaryAffixFamily { get; private set; } + public int[] MaxAffixLevel { get; private set; } + public int[] I18 { get; private set; } + public GemType Gem { get; private set; } + public int I16 { get; private set; } + public Alpha I17 { get; private set; } + + public void Read(MpqFileStream stream) + { + stream.Position += 4; + this.Name = stream.ReadString(256, true); + this.Hash = StringHashHelper.HashItemName(this.Name); + this.SNOActor = stream.ReadValueS32(); //260 + this.ItemType1 = stream.ReadValueS32(); //264 + this.Flags = stream.ReadValueS32(); //268 + this.I0 = stream.ReadValueS32(); //272 + this.ItemLevel = stream.ReadValueS32(); //276 + this.E0 = (eItem)stream.ReadValueS32(); //280 + this.I2 = stream.ReadValueS32(); //284 + this.RandomPropertiesCount = stream.ReadValueS32(); //288 + this.MaxSockets = stream.ReadValueS32(); //292 + this.MaxStackAmount = stream.ReadValueS32(); //296 + this.BaseGoldValue = stream.ReadValueS32(); //300 + this.I7 = stream.ReadValueS32(); //304 + this.RequiredLevel = stream.ReadValueS32(); //308 + this.DurabilityMin = stream.ReadValueS32(); //312 + this.DurabilityDelta = stream.ReadValueS32(); //316 + this.I8 = stream.ReadValueS32(); //320 + this.SNOBaseItem = stream.ReadValueS32(); //324 + this.SNOSet = stream.ReadValueS32(); //328 + this.SNOComponentTreasureClass = stream.ReadValueS32(); //332 + this.SNOComponentTreasureClassMagic = stream.ReadValueS32(); //336 + this.SNOComponentTreasureClassRare = stream.ReadValueS32(); //340 + this.SNORareNamePrefixStringList = stream.ReadValueS32(); //344 + this.SNORareNameSuffixStringList = stream.ReadValueS32(); //348 + this.I15 = new int[4]; //352 + for (int i = 0; i < 4; i++) + this.I15[i] = stream.ReadValueS32(); + stream.Position += 88; + this.WeaponDamageMin = stream.ReadValueF32(); //456 + this.WeaponDamageDelta = stream.ReadValueF32(); //460 + stream.Position += 84; + this.ArmorValue = stream.ReadValueF32(); //548 + this.F3 = stream.ReadValueF32(); //552 + stream.Position += 168; + this.AttacksPerSecond = stream.ReadValueF32(); //724 + stream.Position += 84; + this.F4 = stream.ReadValueF32(); //812 + this.F5 = stream.ReadValueF32(); //816 + stream.Position += 104; + this.SNOSkill0 = stream.ReadValueS32(); //924 + this.I11 = stream.ReadValueS32(); //928 + this.SNOSkill1 = stream.ReadValueS32(); //932 + this.I12 = stream.ReadValueS32(); //936 + this.SNOSkill2 = stream.ReadValueS32(); //940 + this.I13 = stream.ReadValueS32(); //944 + this.SNOSkill3 = stream.ReadValueS32(); //948 + this.I14 = stream.ReadValueS32(); //952 + stream.Position += 44; + this.Attribute = new AttributeSpecifier[16]; + for (int i = 0; i < 16; i++) + this.Attribute[i] = new AttributeSpecifier(stream); + this.Quality = (ItemQuality)stream.ReadValueS32(); //1384 + this.RecipeToGrant = new int[10]; //1388 + for (int i = 0; i < 10; i++) + this.RecipeToGrant[i] = stream.ReadValueS32(); + this.EnhancementToGrant = stream.ReadValueS32(); //1428 + this.LegendaryAffixFamily = new int[6]; + for (int i = 0; i < 6; i++) + this.LegendaryAffixFamily[i] = stream.ReadValueS32(); //1432 + this.MaxAffixLevel = new int[6]; + for (int i = 0; i < 6; i++) + this.MaxAffixLevel[i] = stream.ReadValueS32(); //1456 + this.I18 = new int[6]; + for (int i = 0; i < 6; i++) + this.I18[i] = stream.ReadValueS32(); //1446 + this.Gem = (GemType)stream.ReadValueS32(); //1504 + this.I16 = stream.ReadValueS32(); //1508 + this.I17 = (Alpha)stream.ReadValueS32(); //1512 + stream.Position += 4; + } + + public enum ItemQuality + { + Invalid = -1, + Inferior, + Normal, + Superior, + Magic1, + Magic2, + Magic3, + Rare4, + Rare5, + Rare6, + Legendary, + Artifact, + } + + [Flags] + public enum eItem + { + Invalid = -1, + A1 = 0, + A2 = 100, + A3 = 200, + A4 = 300, + Test = 1000, + } + + public enum GemType : int + { + Amethyst = 1, + Emerald, + Ruby, + Topaz, + } + + public enum Alpha : int + { + A = 1, + B, + C, + D, + } + } + + public class ExperienceTable : ISerializableData + { + //Total Length: 224 + public int Exp { get; private set; } + public int I1 { get; private set; } + public float F0 { get; private set; } + public float F1 { get; private set; } + public int I2 { get; private set; } + public int I3 { get; private set; } + public int I4 { get; private set; } + public int I5 { get; private set; } + public int I6 { get; private set; } + public int I7 { get; private set; } + public int I8 { get; private set; } + public int I9 { get; private set; } + public int I10 { get; private set; } + public int I11 { get; private set; } + public int I12 { get; private set; } + public int I13 { get; private set; } + public int I14 { get; private set; } + public int I15 { get; private set; } + public int I16 { get; private set; } + public float Multiplier { get; private set; } + public int I17 { get; private set; } + public int I18 { get; private set; } + public int I19 { get; private set; } + public int I20 { get; private set; } + public int I21 { get; private set; } + public int I22 { get; private set; } + public int I23 { get; private set; } + public int I24 { get; private set; } + public int I25 { get; private set; } + public int I26 { get; private set; } + public int I27 { get; private set; } + public int I28 { get; private set; } + public int I29 { get; private set; } + public int I30 { get; private set; } + public int I31 { get; private set; } + public int I32 { get; private set; } + public int I33 { get; private set; } + public int I34 { get; private set; } + public int I35 { get; private set; } + public int I36 { get; private set; } + public int I37 { get; private set; } + public int I38 { get; private set; } + public int I39 { get; private set; } + public int I40 { get; private set; } + public int I41 { get; private set; } + public int I42 { get; private set; } + public int I43 { get; private set; } + public int I44 { get; private set; } + public int I45 { get; private set; } + public int I46 { get; private set; } + public int I47 { get; private set; } + public float F2 { get; private set; } + public float F3 { get; private set; } + public float F4 { get; private set; } + + public void Read(MpqFileStream stream) + { + this.Exp = stream.ReadValueS32(); + this.I1 = stream.ReadValueS32(); + this.F0 = stream.ReadValueF32(); + this.F1 = stream.ReadValueF32(); + this.I2 = stream.ReadValueS32(); + this.I3 = stream.ReadValueS32(); + this.I4 = stream.ReadValueS32(); + this.I5 = stream.ReadValueS32(); + this.I6 = stream.ReadValueS32(); + this.I7 = stream.ReadValueS32(); + this.I8 = stream.ReadValueS32(); + this.I9 = stream.ReadValueS32(); + this.I10 = stream.ReadValueS32(); + this.I11 = stream.ReadValueS32(); + this.I12 = stream.ReadValueS32(); + this.I13 = stream.ReadValueS32(); + this.I14 = stream.ReadValueS32(); + this.I15 = stream.ReadValueS32(); + this.I16 = stream.ReadValueS32(); + this.Multiplier = stream.ReadValueF32(); //76 + this.I16 = stream.ReadValueS32(); //80 + this.I17 = stream.ReadValueS32(); //84 + this.I18 = stream.ReadValueS32(); //88 + this.I19 = stream.ReadValueS32(); //92 + this.I20 = stream.ReadValueS32(); //96 + this.I21 = stream.ReadValueS32(); //100 + this.I22 = stream.ReadValueS32(); //104 + this.I23 = stream.ReadValueS32(); //108 + this.I24 = stream.ReadValueS32(); //112 + this.I25 = stream.ReadValueS32(); //116 + this.I26 = stream.ReadValueS32(); //120 + this.I27 = stream.ReadValueS32(); //124 + this.I28 = stream.ReadValueS32(); //128 + this.I29 = stream.ReadValueS32(); //132 + this.I30 = stream.ReadValueS32(); //136 + this.I31 = stream.ReadValueS32(); //140 + this.I32 = stream.ReadValueS32(); //144 + this.I33 = stream.ReadValueS32(); //148 + this.I34 = stream.ReadValueS32(); //152 + this.I35 = stream.ReadValueS32(); //156 + stream.Position += 16; + this.I36 = stream.ReadValueS32(); //176 + this.I37 = stream.ReadValueS32(); + this.I38 = stream.ReadValueS32(); + this.I39 = stream.ReadValueS32(); + this.I40 = stream.ReadValueS32(); + this.I41 = stream.ReadValueS32(); + this.I42 = stream.ReadValueS32(); + this.I43 = stream.ReadValueS32(); + this.I44 = stream.ReadValueS32(); + this.I45 = stream.ReadValueS32(); + this.I46 = stream.ReadValueS32(); + this.I47 = stream.ReadValueS32(); + stream.Position += 4; + this.F2 = stream.ReadValueF32(); + this.F3 = stream.ReadValueF32(); + this.F4 = stream.ReadValueF32(); + } + } + + public class HelpCodesTable : ISerializableData //unused + { + //Total Length: 640 + public string S0 { get; private set; } + public string S1 { get; private set; } + public string S2 { get; private set; } + + public void Read(MpqFileStream stream) + { + this.S0 = stream.ReadString(256, true); + this.S1 = stream.ReadString(256, true); + this.S2 = stream.ReadString(128, true); + } + } + + public class MonsterLevelTable : ISerializableData + { + //Total Length: 0x22C (556) + public int I0 { get; private set; } + public float F0 { get; private set; } + public float F1 { get; private set; } + public float F2 { get; private set; } + public float F3 { get; private set; } + public float F4 { get; private set; } + public float F5 { get; private set; } + public float F6 { get; private set; } + public float F7 { get; private set; } + public float F8 { get; private set; } + public float F9 { get; private set; } + public float F10 { get; private set; } + public float F11 { get; private set; } + public float F12 { get; private set; } + public float F13 { get; private set; } + public float F14 { get; private set; } + public float F15 { get; private set; } + public float F16 { get; private set; } + public float F17 { get; private set; } + public float F18 { get; private set; } + public float F19 { get; private set; } + public float F20 { get; private set; } + public float F21 { get; private set; } + public float F22 { get; private set; } + public float F23 { get; private set; } + public float F24 { get; private set; } + public float F25 { get; private set; } + public float F26 { get; private set; } + public float F27 { get; private set; } + public float F28 { get; private set; } + public float F29 { get; private set; } + public float F30 { get; private set; } + public float F31 { get; private set; } + public float F32 { get; private set; } + public float F33 { get; private set; } + public float F34 { get; private set; } + public float F35 { get; private set; } + public float F36 { get; private set; } + public float F37 { get; private set; } + public float F38 { get; private set; } + public float F39 { get; private set; } + public float F40 { get; private set; } + public float F41 { get; private set; } + public float F42 { get; private set; } + public float F43 { get; private set; } + public float F44 { get; private set; } + public float F45 { get; private set; } + public float F46 { get; private set; } + public float F47 { get; private set; } + public float F48 { get; private set; } + public float F49 { get; private set; } + public float F50 { get; private set; } + public float F51 { get; private set; } + + public void Read(MpqFileStream stream) + { + this.I0 = stream.ReadValueS32(); //0 + stream.Position += 16; + this.F0 = stream.ReadValueF32(); //20 + stream.Position += 8; + this.F1 = stream.ReadValueF32(); //32 + this.F2 = stream.ReadValueF32(); //36 + this.F3 = stream.ReadValueF32(); //40 + stream.Position += 4; + this.F4 = stream.ReadValueF32(); //48 + stream.Position += 40; + this.F5 = stream.ReadValueF32(); //92 + this.F6 = stream.ReadValueF32(); //96 + this.F7 = stream.ReadValueF32(); //100 + this.F8 = stream.ReadValueF32(); //104 + this.F9 = stream.ReadValueF32(); //108 + this.F10 = stream.ReadValueF32(); //112 + this.F11 = stream.ReadValueF32(); //116 + this.F12 = stream.ReadValueF32(); //120 + this.F13 = stream.ReadValueF32(); //124 + this.F14 = stream.ReadValueF32(); //128 + this.F15 = stream.ReadValueF32(); //132 + this.F16 = stream.ReadValueF32(); //136 + this.F17 = stream.ReadValueF32(); //140 + this.F18 = stream.ReadValueF32(); //144 + this.F19 = stream.ReadValueF32(); //148 + this.F20 = stream.ReadValueF32(); //152 + this.F21 = stream.ReadValueF32(); //156 + this.F22 = stream.ReadValueF32(); //160 + stream.Position += 12; + this.F23 = stream.ReadValueF32(); //176 + this.F24 = stream.ReadValueF32(); //180 + this.F25 = stream.ReadValueF32(); //184 + stream.Position += 32; + this.F26 = stream.ReadValueF32(); //220 + this.F27 = stream.ReadValueF32(); //224 + stream.Position += 4; + this.F28 = stream.ReadValueF32(); //232 + this.F29 = stream.ReadValueF32(); //236 + stream.Position += 28; + this.F30 = stream.ReadValueF32(); //268 + this.F31 = stream.ReadValueF32(); //272 + this.F32 = stream.ReadValueF32(); //276 + this.F33 = stream.ReadValueF32(); //280 + this.F34 = stream.ReadValueF32(); //284 + this.F35 = stream.ReadValueF32(); //288 + this.F36 = stream.ReadValueF32(); //292 + this.F37 = stream.ReadValueF32(); //296 + this.F38 = stream.ReadValueF32(); //300 + stream.Position += 136; + this.F39 = stream.ReadValueF32(); //440 + this.F40 = stream.ReadValueF32(); //444 + stream.Position += 12; + this.F41 = stream.ReadValueF32(); //460 + this.F42 = stream.ReadValueF32(); //464 + this.F43 = stream.ReadValueF32(); //468 + this.F44 = stream.ReadValueF32(); //472 + this.F45 = stream.ReadValueF32(); //476 + stream.Position += 4; + this.F46 = stream.ReadValueF32(); //484 + this.F47 = stream.ReadValueF32(); //488 + this.F48 = stream.ReadValueF32(); //492 + this.F49 = stream.ReadValueF32(); //496 + stream.Position += 4; + this.F50 = stream.ReadValueF32(); //504 + stream.Position += 12; + this.F51 = stream.ReadValueF32(); //520 + stream.Position += 36; + } + } + + public class HeroTable : ISerializableData + { + //Total Length: 868 + public string Name { get; private set; } + public int SNOMaleActor { get; private set; } + public int SNOFemaleActor { get; private set; } + public int SNOInventory { get; private set; } + public int I0 { get; private set; } + public int SNOStartingLMBSkill { get; private set; } + public int SNOStartingRMBSkill { get; private set; } + public int SNOSKillKit0 { get; private set; } + public int SNOSKillKit1 { get; private set; } + public int SNOSKillKit2 { get; private set; } + public int SNOSKillKit3 { get; private set; } + public Resource PrimaryResource { get; private set; } + public Resource SecondaryResource { get; private set; } + public PrimaryAttribute CoreAttribute { get; private set; } + public float F0 { get; private set; } + public int I1 { get; private set; } + public float HitpointsMax { get; private set; } + public float HitpointsFactorLevel { get; private set; } + public float F3 { get; private set; } + public float PrimaryResourceMax { get; private set; } + public float PrimaryResourceFactorLevel { get; private set; } + public float PrimaryResourceRegenPerSecond { get; private set; } + public float SecondaryResourceMax { get; private set; } + public float SecondaryResourceFactorLevel { get; private set; } + public float SecondaryResourceRegenPerSecond { get; private set; } + public float F10 { get; private set; } + public float F11 { get; private set; } + public float CritPercentCap { get; private set; } + public float F13 { get; private set; } + public float F14 { get; private set; } + public float WalkingRate { get; private set; } + public float RunningRate { get; private set; } + public float F17 { get; private set; } + public float F18 { get; private set; } + public float F19 { get; private set; } + public float F20 { get; private set; } + public float F21 { get; private set; } + public float F22 { get; private set; } + public float F23 { get; private set; } + public float F24 { get; private set; } //Resistance? + public float F25 { get; private set; } //ResistanceTotal? + public float F26 { get; private set; } //CastingSpeed? + public float F27 { get; private set; } + public float F28 { get; private set; } + public float F29 { get; private set; } + public float F30 { get; private set; } //HitChance? + public float F31 { get; private set; } + public float F32 { get; private set; } + public float F33 { get; private set; } + public float F34 { get; private set; } + public float Strength { get; private set; } + public float Dexterity { get; private set; } + public float Vitality { get; private set; } + public float Intelligence { get; private set; } + public float GetHitMaxBase { get; private set; } + public float GetHitMaxPerLevel { get; private set; } + public float GetHitRecoveryBase { get; private set; } + public float GetHitRecoveryPerLevel { get; private set; } + public float F35 { get; private set; } + + public void Read(MpqFileStream stream) + { + stream.Position += 4; + this.Name = stream.ReadString(256, true); + this.SNOMaleActor = stream.ReadValueS32(); + this.SNOFemaleActor = stream.ReadValueS32(); + this.SNOInventory = stream.ReadValueS32(); + this.I0 = stream.ReadValueS32(); + this.SNOStartingLMBSkill = stream.ReadValueS32(); + this.SNOStartingRMBSkill = stream.ReadValueS32(); + this.SNOSKillKit0 = stream.ReadValueS32(); + this.SNOSKillKit1 = stream.ReadValueS32(); + this.SNOSKillKit2 = stream.ReadValueS32(); + this.SNOSKillKit3 = stream.ReadValueS32(); + this.PrimaryResource = (Resource)stream.ReadValueS32(); + this.SecondaryResource = (Resource)stream.ReadValueS32(); + this.CoreAttribute = (PrimaryAttribute)stream.ReadValueS32(); + this.F0 = stream.ReadValueF32(); //312 + this.I1 = stream.ReadValueS32(); //316 + stream.Position += 16; + this.HitpointsMax = stream.ReadValueF32(); //336 + this.HitpointsFactorLevel = stream.ReadValueF32(); //340 + stream.Position += 8; + this.F3 = stream.ReadValueF32(); //352 + this.PrimaryResourceMax = stream.ReadValueF32(); //356 + this.PrimaryResourceFactorLevel = stream.ReadValueF32(); //360 + this.PrimaryResourceRegenPerSecond = stream.ReadValueF32(); //364 + stream.Position += 4; + this.SecondaryResourceMax = stream.ReadValueF32(); //372 + this.SecondaryResourceFactorLevel = stream.ReadValueF32(); //376 + this.SecondaryResourceRegenPerSecond = stream.ReadValueF32(); //380 + stream.Position += 24; + this.F10 = stream.ReadValueF32(); //408 + stream.Position += 72; + this.F11 = stream.ReadValueF32(); //484 + this.CritPercentCap = stream.ReadValueF32(); //488 + this.F13 = stream.ReadValueF32(); //492 + stream.Position += 4; + this.F14 = stream.ReadValueF32(); //500 + stream.Position += 32; + this.WalkingRate = stream.ReadValueF32(); //536 + this.RunningRate = stream.ReadValueF32(); //540 + stream.Position += 4; + this.F17 = stream.ReadValueF32(); //548 + stream.Position += 32; + this.F18 = stream.ReadValueF32(); //584 + this.F19 = stream.ReadValueF32(); //588 + this.F20 = stream.ReadValueF32(); //592 + this.F21 = stream.ReadValueF32(); //596 + this.F22 = stream.ReadValueF32(); //600 + this.F23 = stream.ReadValueF32(); //604 + stream.Position += 4; + this.F24 = stream.ReadValueF32(); //612 + this.F25 = stream.ReadValueF32(); //616 + stream.Position += 60; + this.F26 = stream.ReadValueF32(); //680 + stream.Position += 8; + this.F27 = stream.ReadValueF32(); //692 + this.F28 = stream.ReadValueF32(); //696 + this.F29 = stream.ReadValueF32(); //700 + this.F30 = stream.ReadValueF32(); //704 + stream.Position += 12; + this.F31 = stream.ReadValueF32(); //720 + this.F32 = stream.ReadValueF32(); //724 + this.F33 = stream.ReadValueF32(); //728 + stream.Position += 40; + this.F34 = stream.ReadValueF32(); //772 + stream.Position += 24; + this.Strength = stream.ReadValueF32(); //800 + this.Dexterity = stream.ReadValueF32(); //804 + this.Vitality = stream.ReadValueF32(); //808 + this.Intelligence = stream.ReadValueF32(); //812 + stream.Position += 40; + this.GetHitMaxBase = stream.ReadValueF32(); //856 + this.GetHitMaxPerLevel = stream.ReadValueF32(); //860 + this.GetHitRecoveryBase = stream.ReadValueF32(); //864 + this.GetHitRecoveryPerLevel = stream.ReadValueF32(); //866 + this.F35 = stream.ReadValueF32(); + } + + public enum Resource : int + { + None = -1, + Mana = 0, + Arcanum, + Fury, + Spirit, + Power, + Hatred, + Discipline, + } + + } + + public class MovementStyle : ISerializableData //0 byte file + { + //Total Length: 384 + [PersistentPropertyAttribute("Name")] + public string Name { get; private set; } + + [PersistentPropertyAttribute("I0")] + public int I0 { get; private set; } + + [PersistentPropertyAttribute("I1")] + public int I1 { get; private set; } + + [PersistentPropertyAttribute("I2")] + public int I2 { get; private set; } + + [PersistentPropertyAttribute("I3")] + public int I3 { get; private set; } + + [PersistentPropertyAttribute("I4")] + public int I4 { get; private set; } + + [PersistentPropertyAttribute("I5")] + public int I5 { get; private set; } + + [PersistentPropertyAttribute("I6")] + public int I6 { get; private set; } + + [PersistentPropertyAttribute("I7")] + public int I7 { get; private set; } + + [PersistentPropertyAttribute("F0")] + public float F0 { get; private set; } + + [PersistentPropertyAttribute("F1")] + public float F1 { get; private set; } + + [PersistentPropertyAttribute("F2")] + public float F2 { get; private set; } + + [PersistentPropertyAttribute("F3")] + public float F3 { get; private set; } + + [PersistentPropertyAttribute("F4")] + public float F4 { get; private set; } + + [PersistentPropertyAttribute("F5")] + public float F5 { get; private set; } + + [PersistentPropertyAttribute("F6")] + public float F6 { get; private set; } + + [PersistentPropertyAttribute("F7")] + public float F7 { get; private set; } + + [PersistentPropertyAttribute("F8")] + public float F8 { get; private set; } + + [PersistentPropertyAttribute("F9")] + public float F9 { get; private set; } + + [PersistentPropertyAttribute("F10")] + public float F10 { get; private set; } + + [PersistentPropertyAttribute("F11")] + public float F11 { get; private set; } + + [PersistentPropertyAttribute("F12")] + public float F12 { get; private set; } + + [PersistentPropertyAttribute("F13")] + public float F13 { get; private set; } + + [PersistentPropertyAttribute("F14")] + public float F14 { get; private set; } + + [PersistentPropertyAttribute("F15")] + public float F15 { get; private set; } + + [PersistentPropertyAttribute("F16")] + public float F16 { get; private set; } + + [PersistentPropertyAttribute("F17")] + public float F17 { get; private set; } + + [PersistentPropertyAttribute("F18")] + public float F18 { get; private set; } + + [PersistentPropertyAttribute("F19")] + public float F19 { get; private set; } + + [PersistentPropertyAttribute("F20")] + public float F20 { get; private set; } + + [PersistentPropertyAttribute("F21")] + public float F21 { get; private set; } + + [PersistentPropertyAttribute("SNOPowerToBreakObjects")] + public int SNOPowerToBreakObjects { get; private set; } + + public void Read(MpqFileStream stream) + { + stream.Position += 4; + this.Name = stream.ReadString(256, true); + this.I0 = stream.ReadValueS32(); + this.I1 = stream.ReadValueS32(); + this.I2 = stream.ReadValueS32(); + this.I3 = stream.ReadValueS32(); + this.I4 = stream.ReadValueS32(); + this.I5 = stream.ReadValueS32(); + this.I6 = stream.ReadValueS32(); + this.I7 = stream.ReadValueS32(); + this.F0 = stream.ReadValueF32(); + this.F1 = stream.ReadValueF32(); + this.F2 = stream.ReadValueF32(); + this.F3 = stream.ReadValueF32(); + this.F4 = stream.ReadValueF32(); + this.F5 = stream.ReadValueF32(); + this.F6 = stream.ReadValueF32(); + this.F7 = stream.ReadValueF32(); + this.F8 = stream.ReadValueF32(); + this.F9 = stream.ReadValueF32(); + this.F10 = stream.ReadValueF32(); + this.F11 = stream.ReadValueF32(); + this.F12 = stream.ReadValueF32(); + this.F13 = stream.ReadValueF32(); + this.F14 = stream.ReadValueF32(); + this.F15 = stream.ReadValueF32(); + this.F16 = stream.ReadValueF32(); + this.F17 = stream.ReadValueF32(); + this.F18 = stream.ReadValueF32(); + this.F19 = stream.ReadValueF32(); + this.F20 = stream.ReadValueF32(); + this.F21 = stream.ReadValueF32(); + this.SNOPowerToBreakObjects = stream.ReadValueS32(); + } + } + + public class LabelGBIDTable : ISerializableData + { + //Total Length: 264 + public string Name { get; private set; } + public int I0 { get; private set; } + + public void Read(MpqFileStream stream) + { + stream.Position += 4; + this.Name = stream.ReadString(256, true); + this.I0 = stream.ReadValueS32(); + } + } + + public class AffixTable : ISerializableData + { + //Total Length: 544 + public int Hash { get; private set; } + public string Name { get; private set; } + public int I0 { get; private set; } + public int AffixLevel { get; private set; } + public int SupMask { get; private set; } + public int I3 { get; private set; } + public int I4 { get; private set; } + public int I5 { get; private set; } + public int I8 { get; private set; } + public int I9 { get; private set; } + public AffixType1 AffixType1 { get; private set; } + public int I6 { get; private set; } + public int SNORareNamePrefixStringList { get; private set; } + public int SNORareNameSuffixStringList { get; private set; } + public int AffixFamily0 { get; private set; } + public int AffixFamily1 { get; private set; } + public Class Class { get; private set; } + public int ExclusionCategory { get; private set; } + public int[] I7 { get; private set; } + public int[] ItemGroup { get; private set; } + public int[] I10 { get; private set; } + public QualityMask QualityMask { get; private set; } + public AffixType2 AffixType2 { get; private set; } + public int AssociatedAffix { get; private set; } + public AttributeSpecifier[] AttributeSpecifier { get; private set; } + + public void Read(MpqFileStream stream) + { + stream.Position += 4; + this.Name = stream.ReadString(256, true); + this.Hash = StringHashHelper.HashItemName(this.Name); + this.I0 = stream.ReadValueS32(); //260 + this.AffixLevel = stream.ReadValueS32(); //264 + this.SupMask = stream.ReadValueS32(); //268 + this.I3 = stream.ReadValueS32(); //272 + this.I4 = stream.ReadValueS32(); //276 + this.I5 = stream.ReadValueS32(); //280 + this.I8 = stream.ReadValueS32(); //284 + this.I9 = stream.ReadValueS32(); //288 + this.AffixType1 = (AffixType1)stream.ReadValueS32(); //292 + this.I6 = stream.ReadValueS32(); //296 + this.SNORareNamePrefixStringList = stream.ReadValueS32(); //300 + this.SNORareNameSuffixStringList = stream.ReadValueS32(); //304 + this.AffixFamily0 = stream.ReadValueS32(); //308 + this.AffixFamily1 = stream.ReadValueS32(); //312 + this.Class = (Class)stream.ReadValueS32(); //316 + this.ExclusionCategory = stream.ReadValueS32(); //320 + this.I7 = new int[6]; //324 + for (int i = 0; i < 6; i++) + this.I7[i] = stream.ReadValueS32(); + this.ItemGroup = new int[16]; //348 + for (int i = 0; i < 16; i++) + this.ItemGroup[i] = stream.ReadValueS32(); + this.I10 = new int[16]; //412 + for (int i = 0; i < 16; i++) + this.I10[i] = stream.ReadValueS32(); + this.QualityMask = (QualityMask)stream.ReadValueS32(); //476 + this.AffixType2 = (AffixType2)stream.ReadValueS32(); //480 + this.AssociatedAffix = stream.ReadValueS32(); //484 + this.AttributeSpecifier = new AttributeSpecifier[4]; //488 + for (int i = 0; i < 4; i++) + this.AttributeSpecifier[i] = new AttributeSpecifier(stream); + stream.Position += 72; + } + } + + public enum AffixType1 + { + None = 0, + Lightning, + Cold, + Fire, + Poison, + Arcane, + WitchdoctorDamage, + LifeSteal, + ManaSteal, + MagicFind, + GoldFind, + AttackSpeedBonus, + Holy, + WizardDamage, + } + + public enum AffixType2 + { + Prefix = 0, + Suffix = 1, + Inherit = 2, + Title = 5, + Quality = 6, + Immunity = 7, + Random = 9, + Enhancement = 10, + SocketEnhancement = 11, + } + + [Flags] + public enum QualityMask + { + Inferior = 0x1, + Normal = 0x2, + Superior = 0x4, + Magic1 = 0x8, + Magic2 = 0x10, + Magic3 = 0x20, + Rare4 = 0x40, + Rare5 = 0x80, + Rare6 = 0x100, + Legendary = 0x200, + } + + public class AttributeSpecifier + { + //Length: 24 + public int AttributeId { get; private set; } + public int SNOParam { get; private set; } + public List Formula { get; private set; } + + public AttributeSpecifier(MpqFileStream stream) + { + this.AttributeId = stream.ReadValueS32(); + this.SNOParam = stream.ReadValueS32(); + stream.Position += 8; + this.Formula = stream.ReadSerializedInts(); + } + } + + public class LootDistributionTableEntry : ISerializableData //0 byte file + { + //Total Length: 92 + [PersistentPropertyAttribute("I0")] + public int I0 { get; private set; } + + [PersistentPropertyAttribute("I1")] + public int I1 { get; private set; } + + [PersistentPropertyAttribute("I2")] + public int I2 { get; private set; } + + [PersistentPropertyAttribute("I3")] + public int I3 { get; private set; } + + [PersistentPropertyAttribute("I4")] + public int I4 { get; private set; } + + [PersistentPropertyAttribute("I5")] + public int I5 { get; private set; } + + [PersistentPropertyAttribute("I6")] + public int I6 { get; private set; } + + [PersistentPropertyAttribute("I7")] + public int I7 { get; private set; } + + [PersistentPropertyAttribute("I8")] + public int I8 { get; private set; } + + [PersistentPropertyAttribute("I9")] + public int I9 { get; private set; } + + [PersistentPropertyAttribute("F0")] + public float F0 { get; private set; } + + [PersistentPropertyAttribute("F1")] + public float F1 { get; private set; } + + [PersistentPropertyAttribute("F2")] + public float F2 { get; private set; } + + [PersistentPropertyAttribute("F3")] + public float F3 { get; private set; } + + [PersistentPropertyAttribute("F4")] + public float F4 { get; private set; } + + [PersistentPropertyAttribute("F5")] + public float F5 { get; private set; } + + [PersistentPropertyAttribute("F6")] + public float F6 { get; private set; } + + [PersistentPropertyAttribute("F7")] + public float F7 { get; private set; } + + [PersistentPropertyAttribute("F8")] + public float F8 { get; private set; } + + [PersistentPropertyAttribute("F9")] + public float F9 { get; private set; } + + [PersistentPropertyAttribute("F10")] + public float F10 { get; private set; } + + [PersistentPropertyAttribute("I10")] + public int I10 { get; private set; } + + [PersistentPropertyAttribute("I11")] + public int I11 { get; private set; } + + public void Read(MpqFileStream stream) + { + this.I0 = stream.ReadValueS32(); + this.I1 = stream.ReadValueS32(); + this.I2 = stream.ReadValueS32(); + this.I3 = stream.ReadValueS32(); + this.I4 = stream.ReadValueS32(); + this.I5 = stream.ReadValueS32(); + this.I6 = stream.ReadValueS32(); + this.I7 = stream.ReadValueS32(); + this.I8 = stream.ReadValueS32(); + this.I9 = stream.ReadValueS32(); + this.F0 = stream.ReadValueF32(); + this.F1 = stream.ReadValueF32(); + this.F2 = stream.ReadValueF32(); + this.F3 = stream.ReadValueF32(); + this.F4 = stream.ReadValueF32(); + this.F5 = stream.ReadValueF32(); + this.F6 = stream.ReadValueF32(); + this.F7 = stream.ReadValueF32(); + this.F8 = stream.ReadValueF32(); + this.F9 = stream.ReadValueF32(); + this.F10 = stream.ReadValueF32(); + this.I10 = stream.ReadValueS32(); + this.I11 = stream.ReadValueS32(); + } + } + + public class RareItemNamesTable : ISerializableData + { + //Total Length: 272 + public string Name { get; private set; } + public BalanceType Type { get; private set; } + public int RelatedAffixOrItemType { get; private set; } + public AffixType2 AffixType { get; private set; } + + public void Read(MpqFileStream stream) + { + stream.Position += 4; + this.Name = stream.ReadString(256, true); + this.Type = (BalanceType)stream.ReadValueS32(); + this.RelatedAffixOrItemType = stream.ReadValueS32(); + this.AffixType = (AffixType2)stream.ReadValueS32(); + } + } + + public class MonsterAffixesTable : ISerializableData + { + //Total Length: 792 + public string Name { get; private set; } + public int I0 { get; private set; } + public int I1 { get; private set; } + public int I2 { get; private set; } + public MonsterAffix MonsterAffix { get; private set; } + public Resistance Resistance { get; private set; } + public AffixType2 AffixType { get; private set; } + public int I3 { get; private set; } + public int I4 { get; private set; } + public int I5 { get; private set; } + public AttributeSpecifier[] Attributes { get; private set; } + public AttributeSpecifier[] MinionAttributes { get; private set; } + public int SNOOnSpawnPowerMinion { get; private set; } + public int SNOOnSpawnPowerChampion { get; private set; } + public int SNOOnSpawnPowerRare { get; private set; } + + public void Read(MpqFileStream stream) + { + stream.Position += 4; + this.Name = stream.ReadString(256, true); + this.I0 = stream.ReadValueS32(); + this.I1 = stream.ReadValueS32(); + this.I2 = stream.ReadValueS32(); + this.MonsterAffix = (MonsterAffix)stream.ReadValueS32(); + this.Resistance = (Resistance)stream.ReadValueS32(); + this.AffixType = (AffixType2)stream.ReadValueS32(); + this.I3 = stream.ReadValueS32(); + this.I4 = stream.ReadValueS32(); + this.I5 = stream.ReadValueS32(); + this.Attributes = new AttributeSpecifier[10]; + for (int i = 0; i < 10; i++) + this.Attributes[i] = new AttributeSpecifier(stream); + this.MinionAttributes = new AttributeSpecifier[10]; + for (int i = 0; i < 10; i++) + this.MinionAttributes[i] = new AttributeSpecifier(stream); + stream.Position += 4; + this.SNOOnSpawnPowerMinion = stream.ReadValueS32(); + this.SNOOnSpawnPowerChampion = stream.ReadValueS32(); + this.SNOOnSpawnPowerRare = stream.ReadValueS32(); + } + } + + public enum MonsterAffix + { + All = 0, + Rares, + Shooters, + Champions + } + + public enum Resistance + { + Physical = 0, + Fire, + Lightning, + Cold, + Poison, + Arcane, + Holy, + } + + public class MonsterNamesTable : ISerializableData + { + //Total Length: 392 + public string Name { get; private set; } + public AffixType2 AffixType { get; private set; } + public string S0 { get; private set; } + + public void Read(MpqFileStream stream) + { + stream.Position += 4; + this.Name = stream.ReadString(256, true); + this.AffixType = (AffixType2)stream.ReadValueS32(); + this.S0 = stream.ReadString(128, true); + } + + } + + public class SocketedEffectTable : ISerializableData + { + //Total Length: 1416 + public string Name { get; private set; } + public int Item { get; private set; } + public int ItemType { get; private set; } + public AttributeSpecifier[] Attribute { get; private set; } + public AttributeSpecifier[] ReqAttribute { get; private set; } + public string S0 { get; private set; } + + public void Read(MpqFileStream stream) + { + stream.Position += 4; + this.Name = stream.ReadString(256, true); + this.Item = stream.ReadValueS32(); //260 + this.ItemType = stream.ReadValueS32(); //264 + stream.Position += 4; + this.Attribute = new AttributeSpecifier[3]; + for (int i = 0; i < 3; i++) + this.Attribute[i] = new AttributeSpecifier(stream); + this.ReqAttribute = new AttributeSpecifier[2]; + for (int i = 0; i < 2; i++) + this.ReqAttribute[i] = new AttributeSpecifier(stream); + this.S0 = stream.ReadString(1024, true); + } + } + + public class ItemEnhancementTable : ISerializableData + { + //Total Length: 696 + public string Name { get; private set; } + public int I0 { get; private set; } + public int I1 { get; private set; } + public int I2 { get; private set; } + public int I3 { get; private set; } + public AttributeSpecifier[] Attribute { get; private set; } + public int I4 { get; private set; } + public RecipeIngredient[] Ingredients { get; private set; } + + public void Read(MpqFileStream stream) + { + stream.Position += 4; + this.Name = stream.ReadString(256, true); + this.I0 = stream.ReadValueS32(); //260 + this.I1 = stream.ReadValueS32(); //264 + this.I2 = stream.ReadValueS32(); //268 + this.I3 = stream.ReadValueS32(); //272 + stream.Position += 4; + this.Attribute = new AttributeSpecifier[16]; //280 + for (int i = 0; i < 16; i++) + this.Attribute[i] = new AttributeSpecifier(stream); + this.I4 = stream.ReadValueS32(); //664 + this.Ingredients = new RecipeIngredient[3]; //668 + for (int i = 0; i < 3; i++) + this.Ingredients[i] = new RecipeIngredient(stream); + stream.Position += 4; + } + } + + public class RecipeIngredient + { + public int ItemGBId { get; private set; } + public int Count { get; private set; } + + public RecipeIngredient(MpqFileStream stream) + { + this.ItemGBId = stream.ReadValueS32(); + this.Count = stream.ReadValueS32(); + } + } + + public class ItemDropTableEntry : ISerializableData //0 byte file + { + //Total Length: 1140 + [PersistentProperty("Name")] + public string Name { get; private set; } + + [PersistentProperty("I0", 220)] + public int[] I0 { get; private set; } + + public void Read(MpqFileStream stream) + { + stream.Position += 4; + this.Name = stream.ReadString(256, true); + this.I0 = new int[220]; + for (int i = 0; i < 220; i++) + this.I0[i] = stream.ReadValueS32(); + } + } + + public class ItemLevelModifier : ISerializableData //0 byte file + { + //Total Length: 92 + [PersistentPropertyAttribute("I0")] + public int I0 { get; private set; } + + [PersistentPropertyAttribute("F0")] + public float F0 { get; private set; } + + [PersistentPropertyAttribute("F1")] + public float F1 { get; private set; } + + [PersistentPropertyAttribute("F2")] + public float F2 { get; private set; } + + [PersistentPropertyAttribute("F3")] + public float F3 { get; private set; } + + [PersistentPropertyAttribute("F4")] + public float F4 { get; private set; } + + [PersistentPropertyAttribute("F5")] + public float F5 { get; private set; } + + [PersistentPropertyAttribute("F6")] + public float F6 { get; private set; } + + [PersistentPropertyAttribute("F7")] + public float F7 { get; private set; } + + [PersistentPropertyAttribute("F8")] + public float F8 { get; private set; } + + [PersistentPropertyAttribute("F9")] + public float F9 { get; private set; } + + [PersistentPropertyAttribute("F10")] + public float F10 { get; private set; } + + [PersistentPropertyAttribute("I1")] + public int I1 { get; private set; } + + [PersistentPropertyAttribute("I2")] + public int I2 { get; private set; } + + [PersistentPropertyAttribute("I3")] + public int I3 { get; private set; } + + [PersistentPropertyAttribute("I4")] + public int I4 { get; private set; } + + [PersistentPropertyAttribute("I5")] + public int I5 { get; private set; } + + [PersistentPropertyAttribute("I6")] + public int I6 { get; private set; } + + [PersistentPropertyAttribute("I7")] + public int I7 { get; private set; } + + [PersistentPropertyAttribute("I8")] + public int I8 { get; private set; } + + [PersistentPropertyAttribute("I9")] + public int I9 { get; private set; } + + [PersistentPropertyAttribute("I10")] + public int I10 { get; private set; } + + [PersistentPropertyAttribute("I11")] + public int I11 { get; private set; } + + public void Read(MpqFileStream stream) + { + this.I0 = stream.ReadValueS32(); + this.F0 = stream.ReadValueF32(); + this.F1 = stream.ReadValueF32(); + this.F2 = stream.ReadValueF32(); + this.F3 = stream.ReadValueF32(); + this.F4 = stream.ReadValueF32(); + this.F5 = stream.ReadValueF32(); + this.F6 = stream.ReadValueF32(); + this.F7 = stream.ReadValueF32(); + this.F8 = stream.ReadValueF32(); + this.F9 = stream.ReadValueF32(); + this.F10 = stream.ReadValueF32(); + this.I1 = stream.ReadValueS32(); + this.I2 = stream.ReadValueS32(); + this.I3 = stream.ReadValueS32(); + this.I4 = stream.ReadValueS32(); + this.I5 = stream.ReadValueS32(); + this.I6 = stream.ReadValueS32(); + this.I7 = stream.ReadValueS32(); + this.I8 = stream.ReadValueS32(); + this.I9 = stream.ReadValueS32(); + this.I10 = stream.ReadValueS32(); + this.I11 = stream.ReadValueS32(); + } + } + + public class QualityClass : ISerializableData //0 byte file + { + //Total Length: 352 + [PersistentProperty("Name")] + public string Name { get; private set; } + + [PersistentProperty("F0", 22)] + public float[] F0 { get; private set; } + + public void Read(MpqFileStream stream) + { + stream.Position += 4; + this.Name = stream.ReadString(256, true); + stream.Position += 4; + this.F0 = new float[22]; + for (int i = 0; i < 22; i++) + this.F0[i] = stream.ReadValueF32(); + } + } + + public class HirelingTable : ISerializableData + { + //Total Length: 824 + public string Name { get; private set; } + public int SNOActor { get; private set; } + public int SNOProxy { get; private set; } + public int SNOInventory { get; private set; } + public PrimaryAttribute Attribute { get; private set; } + public float F0 { get; private set; } + public float F1 { get; private set; } + public float F2 { get; private set; } + public float F3 { get; private set; } + public float F4 { get; private set; } + public float F5 { get; private set; } + public float F6 { get; private set; } + public float F7 { get; private set; } + public float F8 { get; private set; } + public float F9 { get; private set; } + + public void Read(MpqFileStream stream) + { + stream.Position += 4; + this.Name = stream.ReadString(256, true); + this.SNOActor = stream.ReadValueS32(); + this.SNOProxy = stream.ReadValueS32(); + this.SNOInventory = stream.ReadValueS32(); + this.Attribute = (PrimaryAttribute)stream.ReadValueS32(); + stream.Position += 164; + this.F0 = stream.ReadValueF32(); //440 + this.F1 = stream.ReadValueF32(); //444 + stream.Position += 280; + this.F2 = stream.ReadValueF32(); //728 + stream.Position += 24; + this.F3 = stream.ReadValueF32(); //756 + this.F4 = stream.ReadValueF32(); //760 + this.F5 = stream.ReadValueF32(); //764 + this.F6 = stream.ReadValueF32(); //768 + stream.Position += 8; + this.F7 = stream.ReadValueF32(); //780 + this.F8 = stream.ReadValueF32(); //784 + this.F9 = stream.ReadValueF32(); //788 + stream.Position += 40; + } + + } + + public class SetItemBonusTable : ISerializableData + { + //Total Length: 464 + public string Name { get; private set; } + public int I0 { get; private set; } + public int Set { get; private set; } + public AttributeSpecifier[] Attribute { get; private set; } + + public void Read(MpqFileStream stream) + { + stream.Position += 4; + this.Name = stream.ReadString(256, true); + this.Set = stream.ReadValueS32(); + this.I0 = stream.ReadValueS32(); + stream.Position += 4; + Attribute = new AttributeSpecifier[8]; + for (int i = 0; i < 8; i++) + Attribute[i] = new AttributeSpecifier(stream); + } + + } + + public class EliteModifier : ISerializableData //0 byte file + { + //Total Length: 344 + + [PersistentProperty("Name")] + public string Name { get; private set; } + + [PersistentProperty("F0")] + public float F0 { get; private set; } + + [PersistentProperty("Time0")] + public int Time0 { get; private set; } + + [PersistentProperty("F1")] + public float F1 { get; private set; } + + [PersistentProperty("Time1")] + public int Time1 { get; private set; } + + [PersistentProperty("F2")] + public float F2 { get; private set; } + + [PersistentProperty("Time2")] + public int Time2 { get; private set; } + + [PersistentProperty("F3")] + public float F3 { get; private set; } + + [PersistentProperty("Time3")] + public int Time3 { get; private set; } + + [PersistentProperty("F4")] + public float F4 { get; private set; } + + [PersistentProperty("Time4")] + public int Time4 { get; private set; } + + [PersistentProperty("F5")] + public float F5 { get; private set; } + + [PersistentProperty("Time5")] + public int Time5 { get; private set; } + + [PersistentProperty("F6")] + public float F6 { get; private set; } + + [PersistentProperty("Time6")] + public int Time6 { get; private set; } + + [PersistentProperty("F7")] + public float F7 { get; private set; } + + [PersistentProperty("F8")] + public float F8 { get; private set; } + + [PersistentProperty("Time7")] + public int Time7 { get; private set; } + + [PersistentProperty("F9")] + public float F9 { get; private set; } + + [PersistentProperty("F10")] + public float F10 { get; private set; } + + [PersistentProperty("F11")] + public float F11 { get; private set; } + + [PersistentProperty("F12")] + public float F12 { get; private set; } + + public void Read(MpqFileStream stream) + { + stream.Position += 4; + this.Name = stream.ReadString(256, true); + this.F0 = stream.ReadValueF32(); + this.Time0 = stream.ReadValueS32(); + this.F1 = stream.ReadValueF32(); + this.Time1 = stream.ReadValueS32(); + this.F2 = stream.ReadValueF32(); + this.Time2 = stream.ReadValueS32(); + this.F3 = stream.ReadValueF32(); + this.Time3 = stream.ReadValueS32(); + this.F4 = stream.ReadValueF32(); + this.Time4 = stream.ReadValueS32(); + this.F5 = stream.ReadValueF32(); + this.Time5 = stream.ReadValueS32(); + this.F6 = stream.ReadValueF32(); + this.Time6 = stream.ReadValueS32(); + this.F7 = stream.ReadValueF32(); + this.F8 = stream.ReadValueF32(); + this.Time7 = stream.ReadValueS32(); + this.F9 = stream.ReadValueF32(); + this.F10 = stream.ReadValueF32(); + this.F11 = stream.ReadValueF32(); + this.F12 = stream.ReadValueF32(); + } + } + + public class ItemTier : ISerializableData //0 byte file + { + //Total Length: 32 + + [PersistentPropertyAttribute("Head")] + public int Head { get; private set; } + + [PersistentPropertyAttribute("Torso")] + public int Torso { get; private set; } + + [PersistentPropertyAttribute("Feet")] + public int Feet { get; private set; } + + [PersistentPropertyAttribute("Hands")] + public int Hands { get; private set; } + + [PersistentPropertyAttribute("Shoulders")] + public int Shoulders { get; private set; } + + [PersistentPropertyAttribute("Bracers")] + public int Bracers { get; private set; } + + [PersistentPropertyAttribute("Belt")] + public int Belt { get; private set; } + + public void Read(MpqFileStream stream) + { + this.Head = stream.ReadValueS32(); + this.Torso = stream.ReadValueS32(); + this.Feet = stream.ReadValueS32(); + this.Hands = stream.ReadValueS32(); + this.Shoulders = stream.ReadValueS32(); + this.Bracers = stream.ReadValueS32(); + this.Belt = stream.ReadValueS32(); + } + } + + public class PowerFormulaTable : ISerializableData + { + //Total Length: 1268 + public string S0 { get; private set; } + public float[] F0 { get; private set; } + + public void Read(MpqFileStream stream) + { + this.S0 = stream.ReadString(1024, true); + this.F0 = new float[61]; + for (int i = 0; i < 61; i++) + this.F0[i] = stream.ReadValueF32(); + } + } + + public class RecipeTable : ISerializableData + { + //Total Length: 332 + public string Name { get; private set; } + public int SNORecipe { get; private set; } + public RecipeType Type { get; private set; } + public int I0 { get; private set; } + public int I1 { get; private set; } + public int I2 { get; private set; } + public int I3 { get; private set; } + public RecipeIngredient[] Ingredients { get; private set; } + + public void Read(MpqFileStream stream) + { + stream.Position += 4; + this.Name = stream.ReadString(256, true); + this.SNORecipe = stream.ReadValueS32(); + this.Type = (RecipeType)stream.ReadValueS32(); + this.I0 = stream.ReadValueS32(); + this.I1 = stream.ReadValueS32(); + this.I2 = stream.ReadValueS32(); + this.I3 = stream.ReadValueS32(); + this.Ingredients = new RecipeIngredient[6]; + for (int i = 0; i < 6; i++) + this.Ingredients[i] = new RecipeIngredient(stream); + } + } + + public enum RecipeType + { + Blacksmith = 0, + Jeweler, + Mystic, + None, + } + + public class ScriptedAchievementEventsTable : ISerializableData //0 byte file + { + //Total Length: 260 + [PersistentPropertyAttribute("Name")] + public string Name { get; private set; } + + public void Read(MpqFileStream stream) + { + stream.Position += 4; + this.Name = stream.ReadString(256, true); + } + } + + public enum PrimaryAttribute : int + { + None = -1, + Strength, + Dexterity, + Intelligence, + } +} diff --git a/src/Mooege/Common/MPQ/FileFormats/Globals.cs b/src/Mooege/Common/MPQ/FileFormats/Globals.cs new file mode 100644 index 00000000..8a1c7733 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/Globals.cs @@ -0,0 +1,383 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using CrystalMpq; +using Gibbed.IO; +using Mooege.Common.MPQ.FileFormats.Types; +using Mooege.Core.GS.Common.Types.Misc; +using Mooege.Core.GS.Common.Types.SNO; +using System.Linq; + +namespace Mooege.Common.MPQ.FileFormats +{ + [FileFormat(SNOGroup.Globals)] + public class Globals : FileFormat + { + public Header Header { get; private set; } + public List ServerData { get; private set; } + public int I0 { get; private set; } + public Dictionary StartLocationNames { get; private set; } + public float F0 { get; private set; } + public float F1 { get; private set; } + public float F2 { get; private set; } + public float F3 { get; private set; } + public RGBAColor[] Colors { get; private set; } + public int I1 { get; private set; } + public int I2 { get; private set; } + public float F4 { get; private set; } + public float F5 { get; private set; } + public int I3 { get; private set; } + public float F6 { get; private set; } + public float F7 { get; private set; } + public float F8 { get; private set; } + public float F9 { get; private set; } + public float F10 { get; private set; } + public int I4 { get; private set; } + public int[] I6 { get; private set; } + public BannerParams BannerParams { get; private set; } + public int I5 { get; private set; } + public int I7 { get; private set; } + public int I8 { get; private set; } + public int I9 { get; private set; } + public float F11 { get; private set; } + public float F12 { get; private set; } + public float F13 { get; private set; } + public float F14 { get; private set; } + public float F15 { get; private set; } + public float F16 { get; private set; } + public float F17 { get; private set; } + public float F18 { get; private set; } + + public Globals(MpqFile file) + { + var stream = file.Open(); + this.Header = new Header(stream); + stream.Position += 8; + this.ServerData = stream.ReadSerializedData(); + + stream.Position += 4; + this.I0 = stream.ReadValueS32(); //32 + stream.Position += 12; + this.StartLocationNames = new Dictionary(); + foreach (var startLocation in stream.ReadSerializedData()) + StartLocationNames.Add(startLocation.I0, startLocation); + + this.F0 = stream.ReadValueF32(); //56 + this.F1 = stream.ReadValueF32(); //60 + this.F2 = stream.ReadValueF32(); //64 + this.F3 = stream.ReadValueF32(); //68 + + Colors = new RGBAColor[400]; //72 + for (int i = 0; i < 400; i++) + Colors[i] = new RGBAColor(stream); + + this.I1 = stream.ReadValueS32(); + this.I2 = stream.ReadValueS32(); + this.F4 = stream.ReadValueF32(); + this.F5 = stream.ReadValueF32(); + this.I3 = stream.ReadValueS32(); + this.F6 = stream.ReadValueF32(); + this.F7 = stream.ReadValueF32(); + this.F8 = stream.ReadValueF32(); + this.F9 = stream.ReadValueF32(); + this.F10 = stream.ReadValueF32(); + this.I4 = stream.ReadValueS32(); + this.I6 = new int[4]; + for (int i = 0; i < 4; i++) + this.I6[i] = stream.ReadValueS32(); + stream.Position += 4; + this.BannerParams = new BannerParams(stream); + this.I5 = stream.ReadValueS32(); + this.I7 = stream.ReadValueS32(); + this.I8 = stream.ReadValueS32(); + this.I9 = stream.ReadValueS32(); + this.F11 = stream.ReadValueF32(); + this.F12 = stream.ReadValueF32(); + this.F13 = stream.ReadValueF32(); + this.F14 = stream.ReadValueF32(); + this.F15 = stream.ReadValueF32(); + this.F16 = stream.ReadValueF32(); + this.F17 = stream.ReadValueF32(); + this.F18 = stream.ReadValueF32(); + stream.Close(); + } + } + + public class DifficultyTuningParams + { + public float F0 { get; private set; } + public float F1 { get; private set; } + public float F2 { get; private set; } + public float F3 { get; private set; } + public float F4 { get; private set; } + public float F5 { get; private set; } + public float F6 { get; private set; } + public float F7 { get; private set; } + public float F8 { get; private set; } + public float F9 { get; private set; } + + public DifficultyTuningParams(MpqFileStream stream) + { + this.F0 = stream.ReadValueF32(); + this.F1 = stream.ReadValueF32(); + this.F2 = stream.ReadValueF32(); + this.F3 = stream.ReadValueF32(); + this.F4 = stream.ReadValueF32(); + this.F5 = stream.ReadValueF32(); + this.F6 = stream.ReadValueF32(); + this.F7 = stream.ReadValueF32(); + this.F8 = stream.ReadValueF32(); + this.F9 = stream.ReadValueF32(); + } + } + + public class ActorGroup : ISerializableData + { + public int UHash { get; private set; } + public string S0 { get; private set; } + + public void Read(MpqFileStream stream) + { + this.UHash = stream.ReadValueS32(); + this.S0 = stream.ReadString(64, true); + } + } + + public class StartLocationName : ISerializableData + { + public int I0 { get; private set; } + public string S0 { get; private set; } + + public void Read(MpqFileStream stream) + { + this.I0 = stream.ReadValueS32(); + this.S0 = stream.ReadString(64, true); + } + } + + public class GlobalScriptVariable : ISerializableData + { + public int UHash { get; private set; } + public string S0 { get; private set; } + public float F0 { get; private set; } + + public void Read(MpqFileStream stream) + { + this.UHash = stream.ReadValueS32(); + this.S0 = stream.ReadString(32, true); + this.F0 = stream.ReadValueF32(); + } + } + + public class GlobalServerData : ISerializableData + { + public Dictionary ActorGroups { get; private set; } + public List ScriptGlobalVars { get; private set; } + public DifficultyTuningParams[] TuningParams { get; private set; } + public float F0 { get; private set; } + public float F1 { get; private set; } + public float F2 { get; private set; } + public float F3 { get; private set; } + public float F4 { get; private set; } + public int I0 { get; private set; } + public int I1 { get; private set; } + public float F5 { get; private set; } + public float F6 { get; private set; } + public float F7 { get; private set; } + public float F8 { get; private set; } + public float F20 { get; private set; } + public float F21 { get; private set; } + public float F22 { get; private set; } + public int I5 { get; private set; } + public float F23 { get; private set; } + public int I2 { get; private set; } + public int I3 { get; private set; } + public int I4 { get; private set; } + public float F9 { get; private set; } + public float F10 { get; private set; } + public float F11 { get; private set; } + public float F12 { get; private set; } + public float F13 { get; private set; } + public float F14 { get; private set; } + public float F15 { get; private set; } + public float F16 { get; private set; } + public float F17 { get; private set; } + public float F18 { get; private set; } + public float[] F19 { get; private set; } + + public void Read(MpqFileStream stream) + { + this.ActorGroups = new Dictionary(); + foreach (var group in stream.ReadSerializedData()) //166 + this.ActorGroups.Add(group.UHash, group); + + stream.Position += 8; + this.ScriptGlobalVars = stream.ReadSerializedData(); + stream.Position += 8; + this.TuningParams = new DifficultyTuningParams[4]; + for (int i = 0; i < 4; i++) + this.TuningParams[i] = new DifficultyTuningParams(stream); + this.F0 = stream.ReadValueF32(); + this.F1 = stream.ReadValueF32(); + this.F2 = stream.ReadValueF32(); + this.F3 = stream.ReadValueF32(); + this.F4 = stream.ReadValueF32(); + this.I0 = stream.ReadValueS32(); + this.I1 = stream.ReadValueS32(); + this.F5 = stream.ReadValueF32(); + this.F6 = stream.ReadValueF32(); + this.F7 = stream.ReadValueF32(); + this.F8 = stream.ReadValueF32(); + this.F20 = stream.ReadValueF32(); + this.F21 = stream.ReadValueF32(); + this.F22 = stream.ReadValueF32(); + this.I5 = stream.ReadValueS32(); + this.F23 = stream.ReadValueF32(); + this.I2 = stream.ReadValueS32(); + this.I3 = stream.ReadValueS32(); + this.I4 = stream.ReadValueS32(); + this.F9 = stream.ReadValueF32(); + this.F10 = stream.ReadValueF32(); + this.F11 = stream.ReadValueF32(); + this.F12 = stream.ReadValueF32(); + this.F13 = stream.ReadValueF32(); + this.F14 = stream.ReadValueF32(); + this.F15 = stream.ReadValueF32(); + this.F16 = stream.ReadValueF32(); + this.F17 = stream.ReadValueF32(); + this.F18 = stream.ReadValueF32(); + this.F19 = new float[4]; + for (var i = 0; i < 4; i++) + this.F19[i] = stream.ReadValueF32(); + } + } + + public class BannerParams + { + //Total Length: 232 + public List TexBackgrounds { get; private set; } + public int I0 { get; private set; } + public List TexPatterns { get; private set; } + public List TexMainSigils { get; private set; } + public List TexVariantSigils { get; private set; } + public List TexSigilAccents { get; private set; } + public List ColorSets { get; private set; } + public List SigilPlacements { get; private set; } + public List SNOActorBases { get; private set; } + public List SNOActorCaps { get; private set; } + public List SNOActorPoles { get; private set; } + public List SNOActorRibbons { get; private set; } + public List EpicBannerDescriptions { get; private set; } + + public BannerParams(MpqFileStream stream) + { + stream.Position += 8; + this.TexBackgrounds = stream.ReadSerializedData(); + this.I0 = stream.ReadValueS32(); //16 + stream.Position += 12; + this.TexPatterns = stream.ReadSerializedData(); + this.I0 = stream.ReadValueS32(); //40 + stream.Position += 12; + this.TexMainSigils = stream.ReadSerializedData(); + stream.Position += 8; + this.TexVariantSigils = stream.ReadSerializedData(); + this.I0 = stream.ReadValueS32(); //80 + stream.Position += 12; + this.TexSigilAccents = stream.ReadSerializedData(); + this.I0 = stream.ReadValueS32(); //104 + stream.Position += 12; + this.ColorSets = stream.ReadSerializedData(); + stream.Position += 8; + this.SigilPlacements = stream.ReadSerializedData(); + stream.Position += 8; + this.SNOActorBases = stream.ReadSerializedInts(); + stream.Position += 8; + this.SNOActorCaps = stream.ReadSerializedInts(); + stream.Position += 8; + this.SNOActorPoles = stream.ReadSerializedInts(); + stream.Position += 8; + this.SNOActorRibbons = stream.ReadSerializedInts(); + stream.Position += 8; + this.EpicBannerDescriptions = stream.ReadSerializedData(); + stream.Position += 8; + } + } + + public class BannerTexturePair : ISerializableData + { + public int SNOTexture { get; private set; } + public int I0 { get; private set; } + + public void Read(MpqFileStream stream) + { + this.SNOTexture = stream.ReadValueS32(); + this.I0 = stream.ReadValueS32(); + stream.Position += 4; + } + } + + public class BannerColorSet : ISerializableData + { + public RGBAColor[] Color { get; private set; } + public string String1 { get; private set; } + public int I0 { get; private set; } + public int I1 { get; private set; } + + public void Read(MpqFileStream stream) + { + this.Color = new RGBAColor[2]; + for (int i = 0; i < 2; i++) + this.Color[i] = new RGBAColor(stream); + this.String1 = stream.ReadString(64, true); + this.I0 = stream.ReadValueS32(); + this.I1 = stream.ReadValueS32(); + stream.Position += 4; + } + } + + public class BannerSigilPlacement : ISerializableData + { + public string S0 { get; private set; } + public int I0 { get; private set; } + + public void Read(MpqFileStream stream) + { + this.S0 = stream.ReadString(64, true); + this.I0 = stream.ReadValueS32(); + } + } + + public class EpicBannerDescription : ISerializableData + { + public int SNOBannerShape { get; private set; } + public int SNOBannerBase { get; private set; } + public int SNOBannerPole { get; private set; } + public int I3 { get; private set; } + public string S0 { get; private set; } + + public void Read(MpqFileStream stream) + { + this.SNOBannerShape = stream.ReadValueS32(); + this.SNOBannerBase = stream.ReadValueS32(); + this.SNOBannerPole = stream.ReadValueS32(); + this.I3 = stream.ReadValueS32(); + this.S0 = stream.ReadString(128, true); + } + } +} diff --git a/src/Mooege/Common/MPQ/FileFormats/LevelArea.cs b/src/Mooege/Common/MPQ/FileFormats/LevelArea.cs new file mode 100644 index 00000000..77232b90 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/LevelArea.cs @@ -0,0 +1,207 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using CrystalMpq; +using Gibbed.IO; +using Mooege.Common.MPQ.FileFormats.Types; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Common.Storage; + +namespace Mooege.Common.MPQ.FileFormats +{ + [FileFormat(SNOGroup.LevelArea)] + public class LevelArea : FileFormat + { + public Header Header { get; private set; } + public int[] I0 { get; private set; } + public int I1 { get; private set; } + public int SNOLevelAreaOverrideForGizmoLocs { get; private set; } + public GizmoLocSet LocSet { get; private set; } + public int SpawnPopulationEntries { get; private set; } + + [PersistentProperty("SpawnPopulation")] + public List SpawnPopulation { get; private set; } + + public LevelArea(MpqFile file) + { + var stream = file.Open(); + this.Header = new Header(stream); + this.I0 = new int[4]; + for (int i = 0; i < 4; i++) + this.I0[i] = stream.ReadValueS32(); + this.I1 = stream.ReadValueS32(); + this.SNOLevelAreaOverrideForGizmoLocs = stream.ReadValueS32(); + stream.Position += 4; + this.LocSet = new GizmoLocSet(stream); + this.SpawnPopulationEntries = stream.ReadValueS32(); + stream.Position += 12; + + //mpq reading of spawn populations is disabled because its not working anymore. data is loaded from database instead + //this.SpawnPopulation = stream.ReadSerializedData(); + stream.Close(); + } + } + + public class GizmoLocSet + { + public GizmoLocSpawnType[] SpawnType { get; private set; } + + public GizmoLocSet(MpqFileStream stream) + { + this.SpawnType = new GizmoLocSpawnType[26]; + for (int i = 0; i < 26; i++) + this.SpawnType[i] = new GizmoLocSpawnType(stream); + } + } + + public class GizmoLocSpawnType + { + public List SpawnEntry { get; private set; } + public string Description { get; private set; } + public string Comment { get; private set; } + + public GizmoLocSpawnType(MpqFileStream stream) + { + stream.Position += 8; + this.SpawnEntry = stream.ReadSerializedData(); + this.Description = stream.ReadString(80, true); + this.Comment = stream.ReadString(256, true); + } + } + + public class GizmoLocSpawnEntry : ISerializableData + { + public int Min { get; private set; } + public int Max { get; private set; } + public SNOHandle SNOHandle { get; private set; } + public int I2 { get; private set; } + + public void Read(MpqFileStream stream) + { + this.Min = stream.ReadValueS32(); + this.Max = stream.ReadValueS32(); + this.SNOHandle = new SNOHandle(stream); + this.I2 = stream.ReadValueS32(); + } + } + + public class LevelAreaSpawnPopulation : ISerializableData + { + [PersistentProperty("Description")] + public string Description { get; private set; } + [PersistentProperty("I0")] + public int I0 { get; private set; } + [PersistentProperty("I1", 4)] + public int[] I1 { get; private set; } + + [PersistentProperty("SpawnGroupsCount")] + public int SpawnGroupsCount { get; private set; } + [PersistentProperty("SpawnGroup")] + public List SpawnGroup { get; private set; } + + public void Read(MpqFileStream stream) + { + this.Description = stream.ReadString(64, true); + this.I0 = stream.ReadValueS32(); + this.I1 = new int[4]; + for (int i = 0; i < 4; i++) + this.I1[i] = stream.ReadValueS32(); + this.SpawnGroupsCount = stream.ReadValueS32(); + stream.Position += 8; + this.SpawnGroup = stream.ReadSerializedData(); + } + } + + public class LevelAreaSpawnGroup : ISerializableData + { + [PersistentProperty("GroupType")] + public SpawnGroupType GroupType { get; private set; } + [PersistentProperty("F0")] + public float F0 { get; private set; } + [PersistentProperty("F1")] + public float F1 { get; private set; } + [PersistentProperty("I0")] + public int I0 { get; private set; } + [PersistentProperty("I1")] + public int SpawnItemsCount { get; private set; } + [PersistentProperty("SpawnItems")] + public List SpawnItems { get; private set; } + [PersistentProperty("I2")] + public int I2 { get; private set; } + [PersistentProperty("I3")] + public int I3 { get; private set; } + + public void Read(MpqFileStream stream) + { + this.GroupType = (SpawnGroupType)stream.ReadValueS32(); + this.F0 = stream.ReadValueF32(); + this.F1 = stream.ReadValueF32(); + this.I0 = stream.ReadValueS32(); + this.SpawnItemsCount = stream.ReadValueS32(); + stream.Position += 12; + this.SpawnItems = stream.ReadSerializedData(); + this.I2 = stream.ReadValueS32(); + this.I3 = stream.ReadValueS32(); + } + } + + public enum SpawnGroupType : int + { + Density = 0, + Exactly = 1, + } + + public class LevelAreaSpawnItem : ISerializableData + { + [PersistentProperty("SNOHandle")] + public SNOHandle SNOHandle { get; private set; } + [PersistentProperty("SpawnType")] + public SpawnType SpawnType { get; private set; } + [PersistentProperty("I0")] + public int I0 { get; private set; } + [PersistentProperty("I1")] + public int I1 { get; private set; } + [PersistentProperty("I2")] + public int I2 { get; private set; } + [PersistentProperty("I3")] + public int I3 { get; private set; } + + public void Read(MpqFileStream stream) + { + this.SNOHandle = new SNOHandle(stream); + this.SpawnType = (SpawnType)stream.ReadValueS32(); + this.I0 = stream.ReadValueS32(); + this.I1 = stream.ReadValueS32(); + this.I2 = stream.ReadValueS32(); + this.I3 = stream.ReadValueS32(); + } + } + + public enum SpawnType : int + { + Normal = 0, + Champion, + Rare, + Minion, + Unique, + Hireling, + Clone, + Boss, + } +} diff --git a/src/Mooege/Common/MPQ/FileFormats/Lore.cs b/src/Mooege/Common/MPQ/FileFormats/Lore.cs new file mode 100644 index 00000000..782bf772 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/Lore.cs @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using CrystalMpq; +using Gibbed.IO; +using Mooege.Common.MPQ.FileFormats.Types; +using Mooege.Core.GS.Common.Types.SNO; + +namespace Mooege.Common.MPQ.FileFormats +{ + [FileFormat(SNOGroup.Lore)] + public class Lore : FileFormat + { + public Header Header { get; private set; } + public int I0 { get; private set; } + public LoreCategory Category { get; private set; } + public int I1 { get; private set; } + public int I2 { get; private set; } + public int SNOConversation { get; private set; } + public int I3 { get; private set; } + + public Lore(MpqFile file) + { + var stream = file.Open(); + this.Header = new Header(stream); + this.I0 = stream.ReadValueS32(); + this.Category = (LoreCategory)stream.ReadValueS32(); + this.I1 = stream.ReadValueS32(); + this.I2 = stream.ReadValueS32(); + this.SNOConversation = stream.ReadValueS32(); + this.I3 = stream.ReadValueS32(); + stream.Close(); + } + } + public enum LoreCategory + { + Quest = 0, + World, + People, + Bestiary, + }; +} \ No newline at end of file diff --git a/src/Mooege/Common/MPQ/FileFormats/MarkerSet.cs b/src/Mooege/Common/MPQ/FileFormats/MarkerSet.cs new file mode 100644 index 00000000..9bcb1502 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/MarkerSet.cs @@ -0,0 +1,166 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using CrystalMpq; +using Gibbed.IO; +using Mooege.Common.MPQ.FileFormats.Types; +using Mooege.Core.GS.Common.Types.Collision; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Core.GS.Common.Types.Math; + +namespace Mooege.Common.MPQ.FileFormats +{ + [FileFormat(SNOGroup.MarkerSet)] + public class MarkerSet : FileFormat + { + public Header Header { get; private set; } + public List Markers = new List(); + public AABB AABB { get; private set; } + public bool ContainsActorLocations { get; private set; } + public string FileName { get; private set; } + public int NLabel { get; private set; } + public int SpecialIndexCount { get; private set; } + public List SpecialIndexList { get; private set; } + public List NoSpawns { get; private set; } + + public MarkerSet(MpqFile file) + { + var stream = file.Open(); + this.Header = new Header(stream); + + this.Markers = stream.ReadSerializedData(); + + stream.Position += (15 * 4); + NoSpawns = stream.ReadSerializedData(); + stream.Position += (14 * 4); + this.AABB = new AABB(stream); + int i0 = stream.ReadValueS32(); + if (i0 != 0 && i0 != 1) + throw new System.Exception("Farmy thought this field is a bool, but apparently its not"); + this.ContainsActorLocations = i0 == 1; + + this.FileName = stream.ReadString(256, true); + this.NLabel = stream.ReadValueS32(); + this.SpecialIndexCount = stream.ReadValueS32(); + this.SpecialIndexList = stream.ReadSerializedShorts(); + stream.Close(); + } + } + + public class Marker : ISerializableData + { + public string Name { get; private set; } + public MarkerType Type { get; private set; } + public PRTransform PRTransform { get; private set; } + public SNOHandle SNOHandle { get; private set; } + public TagMap TagMap { get; private set; } + public int MarkerLinksCount { get; private set; } + public List MarkerLinks = new List(); + + public void Read(MpqFileStream stream) + { + this.Name = stream.ReadString(128, true); + this.Type = (MarkerType)stream.ReadValueS32(); + this.PRTransform = new PRTransform(stream); + this.SNOHandle = new SNOHandle(stream); + this.TagMap = stream.ReadSerializedItem(); + stream.Position += 8; + this.MarkerLinksCount = stream.ReadValueS32(); + this.MarkerLinks = stream.ReadSerializedData(); + stream.Position += (3 * 4); + } + + public override string ToString() + { + return string.Format("{0}, {1}", Name, SNOHandle.Name); + } + } + + public class Circle : ISerializableData + { + public Vector2F Center { get; private set; } + public float Radius { get; private set; } + + public void Read(MpqFileStream stream) + { + Center = new Vector2F(stream.ReadValueF32(), stream.ReadValueF32()); + Radius = stream.ReadValueF32(); + } + } + + public class MarkerLink : ISerializableData + { + public string String1 { get; private set; } + public string String2 { get; private set; } + + public void Read(MpqFileStream stream) + { + this.String1 = stream.ReadString(128, true); + this.String2 = stream.ReadString(128, true); + } + } + + public enum MarkerType + { + Actor = 0, + Light, + + AudioVolume = 4, + AmbientSound = 6, + Particle = 7, + + Encounter = 10, + + Script = 13, + + SubScenePosition = 16, + + MinimapMarker = 28, + Event = 29, + + // don't blame me - farmy :-) + GizmoLocationA = 50, + GizmoLocationB = 51, + GizmoLocationC = 52, + GizmoLocationD = 53, + GizmoLocationE = 54, + GizmoLocationF = 55, + GizmoLocationG = 56, + GizmoLocationH = 57, + GizmoLocationI = 58, + GizmoLocationJ = 59, + GizmoLocationK = 60, + GizmoLocationL = 61, + GizmoLocationM = 62, + GizmoLocationN = 63, + GizmoLocationO = 64, + GizmoLocationP = 65, + GizmoLocationQ = 66, + GizmoLocationR = 67, + GizmoLocationS = 68, + GizmoLocationT = 69, + GizmoLocationU = 70, + GizmoLocationV = 71, + GizmoLocationW = 72, + GizmoLocationX = 73, + GizmoLocationY = 74, + GizmoLocationZ = 75, + } +} \ No newline at end of file diff --git a/src/Mooege/Common/MPQ/FileFormats/Monster.cs b/src/Mooege/Common/MPQ/FileFormats/Monster.cs new file mode 100644 index 00000000..86335fc2 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/Monster.cs @@ -0,0 +1,357 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using CrystalMpq; +using Gibbed.IO; +using Mooege.Common.MPQ.FileFormats.Types; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Core.GS.Common.Types.TagMap; + +namespace Mooege.Common.MPQ.FileFormats +{ + [FileFormat(SNOGroup.Monster)] + public class Monster : FileFormat + { + public Header Header { get; private set; } + public int I0 { get; private set; } + public int ActorSNO { get; private set; } + public int I1 { get; private set; } + public MonsterRace Race { get; private set; } + public MonsterSize Size { get; private set; } + public MonsterType Type { get; private set; } + public MonsterDef Monsterdef { get; private set; } + public Resistance Resists { get; private set; } + public int I2 { get; private set; } + public int I3 { get; private set; } + public Levels Level = new Levels(); + public float[] Floats { get; private set; } + public float F0 { get; private set; } + public float F1 { get; private set; } + public float F2 { get; private set; } + public float F3 { get; private set; } + public float F4 { get; private set; } + public float F5 { get; private set; } + public int SNOInventory { get; private set; } + public int SNOSecondaryInventory { get; private set; } + public int SNOLore { get; private set; } + public int I4 { get; private set; } + public HealthDropInfo HealthDropinfo0 { get; private set; } + public HealthDropInfo HealthDropinfo1 { get; private set; } + public HealthDropInfo HealthDropinfo2 { get; private set; } + public HealthDropInfo HealthDropinfo3 { get; private set; } + public int SNOSkillKit { get; private set; } + public MonsterPowerType PowerType { get; private set; } + public SkillDeclaration[] SkillDeclarations { get; private set; } + public MonsterSkillDeclaration[] MonsterSkillDeclarations { get; private set; } + public int SNOTreasureClassFirstKill { get; private set; } + public int SNOTreasureClass { get; private set; } + public int SNOTreasureClassRare { get; private set; } + public int SNOTreasureClassChampion { get; private set; } + public int SNOTreasureClassChampionLight { get; private set; } + public float F6 { get; private set; } + public float F7 { get; private set; } + public float F8 { get; private set; } + public float F9 { get; private set; } + public float F10 { get; private set; } + public int I5 { get; private set; } + public int I6 { get; private set; } + public int I7 { get; private set; } + public int[] AIBehavior { get; private set; } + public int[] GbidArray0 { get; private set; } // 8 + public int[] SNOSummonActor { get; private set; } //6 + public int[] GbidArray1 { get; private set; } // 4 + public int[] GbidArray2 { get; private set; } // 6 + public int I8 { get; private set; } + public int I9 { get; private set; } + public int I10 { get; private set; } + public string Name { get; private set; } // 128 + public TagMap TagMap { get; private set; } + public int I11 { get; private set; } + public List MonsterMinionSpawngroup { get; private set; } + + public Monster(MpqFile file) + { + var stream = file.Open(); + this.Header = new Header(stream); + this.I0 = stream.ReadValueS32(); + this.ActorSNO = stream.ReadValueS32(); + this.I2 = stream.ReadValueS32(); + this.Type = (MonsterType)stream.ReadValueS32(); + this.Race = (MonsterRace)stream.ReadValueS32(); + this.Size = (MonsterSize)stream.ReadValueS32(); + this.Monsterdef = new MonsterDef(stream); + this.Resists = (Resistance)stream.ReadValueS32(); + this.I2 = stream.ReadValueS32(); + this.I3 = stream.ReadValueS32(); + this.Level.Normal = stream.ReadValueS32(); + this.Level.Nightmare = stream.ReadValueS32(); + this.Level.Hell = stream.ReadValueS32(); + this.Level.Inferno = stream.ReadValueS32(); + // 84 - last 6 of these floats are not in the array actually. + Floats = new float[139]; + for (int i = 0; i < 139; i++) + { + Floats[i] = stream.ReadValueF32(); + } + F0 = stream.ReadValueF32(); + F1 = stream.ReadValueF32(); + F2 = stream.ReadValueF32(); + F3 = stream.ReadValueF32(); + F4 = stream.ReadValueF32(); + F5 = stream.ReadValueF32(); + + // 664 + this.I4 = stream.ReadValueS32(); + this.HealthDropinfo0 = new HealthDropInfo(stream); + this.HealthDropinfo1 = new HealthDropInfo(stream); + this.HealthDropinfo2 = new HealthDropInfo(stream); + this.HealthDropinfo3 = new HealthDropInfo(stream); + // 716 + this.SNOSkillKit = stream.ReadValueS32(); + this.SkillDeclarations = new SkillDeclaration[8]; + for (int i = 0; i < 8; i++) + { + this.SkillDeclarations[i] = new SkillDeclaration(stream); + } + this.MonsterSkillDeclarations = new MonsterSkillDeclaration[8]; + for (int i = 0; i < 8; i++) + { + this.MonsterSkillDeclarations[i] = new MonsterSkillDeclaration(stream); + } + // 912 + this.SNOTreasureClassFirstKill = stream.ReadValueS32(); + this.SNOTreasureClass = stream.ReadValueS32(); + this.SNOTreasureClassRare = stream.ReadValueS32(); + this.SNOTreasureClassChampion = stream.ReadValueS32(); + this.SNOTreasureClassChampionLight = stream.ReadValueS32(); + // 932 + this.F6 = stream.ReadValueF32(); + this.F7 = stream.ReadValueF32(); + this.F8 = stream.ReadValueF32(); + this.F9 = stream.ReadValueF32(); + this.I5 = stream.ReadValueS32(); + this.F10 = stream.ReadValueF32(); + this.I6 = stream.ReadValueS32(); + this.I7 = stream.ReadValueS32(); + //964 + this.SNOInventory = stream.ReadValueS32(); + this.SNOSecondaryInventory = stream.ReadValueS32(); + this.SNOLore = stream.ReadValueS32(); + this.AIBehavior = new int[6]; + for (int i = 0; i < 6; i++) + { + this.AIBehavior[i] = stream.ReadValueS32(); + } + this.GbidArray0 = new int[8]; + for (int i = 0; i < 8; i++) + { + this.GbidArray0[i] = stream.ReadValueS32(); + } + this.SNOSummonActor = new int[6]; + for (int i = 0; i < 6; i++) + { + this.SNOSummonActor[i] = stream.ReadValueS32(); + } + GbidArray1 = new int[4]; + for (int i = 0; i < 4; i++) + { + this.GbidArray1[i] = stream.ReadValueS32(); + } + GbidArray2 = new int[6]; + for (int i = 0; i < 6; i++) + { + this.GbidArray2[i] = stream.ReadValueS32(); + } + // 1096 + this.I8 = stream.ReadValueS32(); + this.I9 = stream.ReadValueS32(); + this.I10 = stream.ReadValueS32(); + this.PowerType = (MonsterPowerType)stream.ReadValueS32(); + //1112 + stream.Position += (6 * 4); + // 1136 + this.TagMap = stream.ReadSerializedItem(); + stream.Position += (3 * 4); + this.I11 = stream.ReadValueS32(); + stream.Position += (2 * 4); + this.MonsterMinionSpawngroup = stream.ReadSerializedData(); + this.Name = stream.ReadString(128, true); + stream.Close(); + } + + public class MonsterMinionSpawnGroup : ISerializableData + { + public float F0 { get; private set; } + public int I1 { get; private set; } + public List SpawnItems = new List(); + public void Read(MpqFileStream stream) + { + this.F0 = stream.ReadValueF32(); + this.I1 = stream.ReadValueS32(); + stream.Position += 8; + SpawnItems = stream.ReadSerializedData(); + } + } + + public class MonsterMinionSpawnItem : ISerializableData + { + public int SNOSpawn { get; private set; } + public int I0 { get; private set; } + public int I1 { get; private set; } + public int I2 { get; private set; } + public int I3 { get; private set; } + + public void Read(MpqFileStream stream) + { + this.SNOSpawn = stream.ReadValueS32(); + this.I0 = stream.ReadValueS32(); + this.I1 = stream.ReadValueS32(); + this.I2 = stream.ReadValueS32(); + this.I3 = stream.ReadValueS32(); + } + } + + public class MonsterDef + { + public float F0 { get; private set; } + public float F1 { get; private set; } + public float F2 { get; private set; } + public float F3 { get; private set; } + public int I0 { get; private set; } + + public MonsterDef(MpqFileStream stream) + { + F0 = stream.ReadValueF32(); + F1 = stream.ReadValueF32(); + F2 = stream.ReadValueF32(); + F3 = stream.ReadValueF32(); + I0 = stream.ReadValueS32(); + } + } + public class MonsterSkillDeclaration + { + public float F0 { get; private set; } + public float F1 { get; private set; } + public int I0 { get; private set; } + public float F2 { get; private set; } + + public MonsterSkillDeclaration(MpqFileStream stream) + { + F0 = stream.ReadValueF32(); + F1 = stream.ReadValueF32(); + I0 = stream.ReadValueS32(); + F2 = stream.ReadValueF32(); + } + } + public class SkillDeclaration + { + public int SNOPower { get; private set; } + public int I0 { get; private set; } + + public SkillDeclaration(MpqFileStream stream) + { + SNOPower = stream.ReadValueS32(); + I0 = stream.ReadValueS32(); + } + } + + public enum MonsterPowerType // No idea what this is called - DarkLotus + { + Mana, + Arcanum, + Fury, + Spirit, + Power, + Hatred, + Discipline + } + + public class HealthDropInfo + { + public float F0 { get; private set; } + public int GBID { get; private set; } + public int I1 { get; private set; } + + public HealthDropInfo(MpqFileStream stream) + { + this.F0 = stream.ReadValueF32(); + this.GBID = stream.ReadValueS32(); + this.I1 = stream.ReadValueS32(); + } + } + + public enum Resistance + { + Physical = 0, + Fire = 1, + Lightning = 2, + Cold = 3, + Poison = 4, + Arcane = 5, + Holy = 6 + } + + public class Levels + { + public int Normal; + public int Nightmare; + public int Hell; + public int Inferno; + } + + public enum MonsterSize + { + Unknown = -1, + Big = 3, + Standard = 4, + Ranged = 5, + Swarm = 6, + Boss = 7 + } + + public enum MonsterRace + { + Unknown = -1, + Fallen = 1, + GoatMen = 2, + Rogue = 3, + Skeleton = 4, + Zombie = 5, + SPider = 6, + Triune = 7, + WoodWraith = 8, + Human = 9, + Animal = 10 + } + + public enum MonsterType + { + Unknown = -1, + Undead = 0, + Demon = 1, + Beast = 2, + Human = 3, + Breakable = 4, + Scenery = 5, + Ally = 6, + Team = 7, + Helper = 8 + } + } +} \ No newline at end of file diff --git a/src/Mooege/Common/MPQ/FileFormats/Observer.cs b/src/Mooege/Common/MPQ/FileFormats/Observer.cs new file mode 100644 index 00000000..88759fee --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/Observer.cs @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using CrystalMpq; +using Gibbed.IO; +using Mooege.Common.MPQ.FileFormats.Types; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Common.Types.SNO; + +namespace Mooege.Common.MPQ.FileFormats +{ + [FileFormat(SNOGroup.Observer)] + public class Observer : FileFormat + { + public Header Header { get; private set; } + public int I0 { get; private set; } + public float Angle0 { get; private set; } + public float F0 { get; private set; } + public float F1 { get; private set; } + public float Velocity { get; private set; } + public float Angle1 { get; private set; } + public float Angle2 { get; private set; } + public float F2 { get; private set; } + public Vector3D V0 { get; private set; } + public Vector3D V1 { get; private set; } + public float F3 { get; private set; } + public float F4 { get; private set; } + public float F5 { get; private set; } + public float F6 { get; private set; } + + public Observer(MpqFile file) + { + var stream = file.Open(); + this.Header = new Header(stream); + this.I0 = stream.ReadValueS32(); + this.Angle0 = stream.ReadValueF32(); + this.F0 = stream.ReadValueF32(); + this.F1 = stream.ReadValueF32(); + this.Velocity = stream.ReadValueF32(); + this.Angle1 = stream.ReadValueF32(); + this.Angle2 = stream.ReadValueF32(); + this.F2 = stream.ReadValueF32(); + this.V0 = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32()); + this.V1 = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32()); + this.F3 = stream.ReadValueF32(); + this.F4 = stream.ReadValueF32(); + this.F5 = stream.ReadValueF32(); + this.F6 = stream.ReadValueF32(); + stream.Close(); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Common/MPQ/FileFormats/PhysMesh.cs b/src/Mooege/Common/MPQ/FileFormats/PhysMesh.cs new file mode 100644 index 00000000..e3c96e83 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/PhysMesh.cs @@ -0,0 +1,177 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using CrystalMpq; +using Gibbed.IO; +using Mooege.Common.MPQ.FileFormats.Types; +using Mooege.Core.GS.Common.Types.SNO; + + +namespace Mooege.Common.MPQ.FileFormats +{ + [FileFormat(SNOGroup.PhysMesh)] + public class PhysMesh : FileFormat + { + public Header Header { get; private set; } + public int I0 { get; private set; } + public int CollisionMeshCount { get; private set; } + public List CollisionMeshes { get; private set; } + public int I1 { get; private set; } + public string S0 { get; private set; } + public string S1 { get; private set; } + + public PhysMesh(MpqFile file) + { + var stream = file.Open(); + this.Header = new Header(stream); + this.I0 = stream.ReadValueS32(); + this.CollisionMeshCount = stream.ReadValueS32(); + this.CollisionMeshes = stream.ReadSerializedData(); + stream.Position += 12; + this.S0 = stream.ReadString(256); + this.S1 = stream.ReadString(256); + this.I1 = stream.ReadValueS32(); + stream.Close(); + } + } + + public class CollisionMesh : ISerializableData + { + public Float3 F0 { get; private set; } + public Float3 F1 { get; private set; } + public Float3 F2 { get; private set; } + public int DominoNodeCount { get; private set; } + public int VerticeCount { get; private set; } + public int DominoTriangleCount { get; private set; } + public int DominoEdgeCount { get; private set; } + public int I4 { get; private set; } + public int I5 { get; private set; } + public List Vertices { get; private set; } + public List DominoTriangles { get; private set; } + public List DominoNodes { get; private set; } + public List DominoEdges { get; private set; } + public int I6 { get; private set; } + public int I7 { get; private set; } + + public void Read(MpqFileStream stream) + { + this.F0 = new Float3(stream); + this.F1 = new Float3(stream); + this.F2 = new Float3(stream); + stream.Position += 36; + this.DominoNodeCount = stream.ReadValueS32(); + this.VerticeCount = stream.ReadValueS32(); + this.DominoTriangleCount = stream.ReadValueS32(); + this.DominoEdgeCount = stream.ReadValueS32(); + this.I4 = stream.ReadValueS32(); + this.I5 = stream.ReadValueS32(); + this.Vertices = stream.ReadSerializedData(); + this.DominoTriangles = stream.ReadSerializedData(); + this.DominoNodes = stream.ReadSerializedData(); + this.DominoEdges = stream.ReadSerializedData(); + this.I6 = stream.ReadValueS32(); + this.I7 = stream.ReadValueS32(); + } + } + + public class Float3 : ISerializableData + { + public float X { get; private set; } + public float Y { get; private set; } + public float Z { get; private set; } + + public Float3() { } + + public Float3(MpqFileStream stream) + { + X = stream.ReadValueF32(); + Y = stream.ReadValueF32(); + Z = stream.ReadValueF32(); + } + + public void Read(MpqFileStream stream) + { + X = stream.ReadValueF32(); + Y = stream.ReadValueF32(); + Z = stream.ReadValueF32(); + } + } + + public class MeshTriangle : ISerializableData + { + public int VerticeOneIndex { get; private set; } + public int VerticeTwoIndex { get; private set; } + public int VerticeThreeIndex { get; private set; } + public int I3 { get; private set; } + public int I4 { get; private set; } + public int I5 { get; private set; } + public short I6 { get; private set; } + + public void Read(MpqFileStream stream) + { + VerticeOneIndex = stream.ReadValueS32(); + VerticeTwoIndex = stream.ReadValueS32(); + VerticeThreeIndex = stream.ReadValueS32(); + I3 = stream.ReadValueS32(); + I4 = stream.ReadValueS32(); + I5 = stream.ReadValueS32(); + I6 = (short)stream.ReadValueS32(); // i6 is a word, but struct is 28 bytes - DarkLotus + // + // + + } + } + + public class MeshEdge : ISerializableData + { + public int I0 { get; private set; } + public int I1 { get; private set; } + public int I2 { get; private set; } + public int I3 { get; private set; } + public int I4 { get; private set; } + + public void Read(MpqFileStream stream) + { + I0 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); + I2 = stream.ReadValueS32(); + I3 = stream.ReadValueS32(); + I4 = stream.ReadValueS32(); + } + } + + public class MeshNode : ISerializableData + { + public int I0 { get; private set; } + public short I1 { get; private set; } + public short I2 { get; private set; } + public sbyte B1 { get; private set; } + public sbyte B2 { get; private set; } + + public void Read(MpqFileStream stream) + { + I0 = stream.ReadValueS32(); + I1 = stream.ReadValueS16(); + I2 = stream.ReadValueS16(); + B1 = stream.ReadValueS8(); + B2 = stream.ReadValueS8(); + stream.Position += 2; + } + } +} diff --git a/src/Mooege/Common/MPQ/FileFormats/Power.cs b/src/Mooege/Common/MPQ/FileFormats/Power.cs new file mode 100644 index 00000000..2bdf978f --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/Power.cs @@ -0,0 +1,139 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using CrystalMpq; +using Gibbed.IO; +using Mooege.Common.MPQ.FileFormats.Types; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Core.GS.Common.Types.TagMap; + +namespace Mooege.Common.MPQ.FileFormats +{ + [FileFormat(SNOGroup.Power)] + public class Power : FileFormat + { + public Header Header { get; private set; } + public string LuaName { get; private set; } + public PowerDef Powerdef { get; private set; } + public int I0 { get; private set; } + public int I1 { get; private set; } + public string Chararray2 { get; private set; } + public int ScriptFormulaCount { get; private set; } + public List ScriptFormulaDetails = new List(); + public int i3 { get; private set; } + public string CompiledScript { get; private set; } + public int SNOQuestMetaData { get; private set; } + + public Power(MpqFile file) + { + var stream = file.Open(); + this.Header = new Header(stream); + LuaName = stream.ReadString(64, true); + stream.Position += 4; // pad 1 + Powerdef = new PowerDef(stream); + stream.Position = 440; // Seems like theres a bit of a gap - DarkLotus + I0 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); + Chararray2 = stream.ReadString(256, true); + ScriptFormulaCount = stream.ReadValueS32(); + ScriptFormulaDetails = stream.ReadSerializedData(); + stream.Position += (3 * 4); + i3 = stream.ReadValueS32(); + stream.Position += (3 * 4); + + CompiledScript = System.Text.Encoding.ASCII.GetString(stream.ReadSerializedByteArray()); + SNOQuestMetaData = stream.ReadValueS32(); + stream.Close(); + } + } + + public class PowerDef + { + public TagMap TagMap { get; private set; } + public TagMap GeneralTagMap { get; private set; } + public TagMap PVPGeneralTagMap { get; private set; } + public TagMap ContactTagMap0 { get; private set; } + public TagMap ContactTagMap1 { get; private set; } + public TagMap ContactTagMap2 { get; private set; } + public TagMap ContactTagMap3 { get; private set; } + public TagMap PVPContactTagMap0 { get; private set; } + public TagMap PVPContactTagMap1 { get; private set; } + public TagMap PVPContactTagMap2 { get; private set; } + public TagMap PVPContactTagMap3 { get; private set; } + public int I0 { get; private set; } + public ActorCollisionFlags ActColFlags1 { get; private set; } + public ActorCollisionFlags ActColFlags2 { get; private set; } + public List Buffs = new List(); //4 + + public PowerDef(MpqFileStream stream) + { + TagMap = stream.ReadSerializedItem(); + stream.Position += (2 * 4); + GeneralTagMap = stream.ReadSerializedItem(); + stream.Position += (2 * 4); + PVPGeneralTagMap = stream.ReadSerializedItem(); + stream.Position += (2 * 4); + ContactTagMap0 = stream.ReadSerializedItem(); + ContactTagMap1 = stream.ReadSerializedItem(); + ContactTagMap2 = stream.ReadSerializedItem(); + ContactTagMap3 = stream.ReadSerializedItem(); + stream.Position += (8 * 4); + PVPContactTagMap0 = stream.ReadSerializedItem(); + PVPContactTagMap1 = stream.ReadSerializedItem(); + PVPContactTagMap2 = stream.ReadSerializedItem(); + PVPContactTagMap3 = stream.ReadSerializedItem(); + stream.Position += (8 * 4); + I0 = stream.ReadValueS32(); + ActColFlags1 = new ActorCollisionFlags(stream); + ActColFlags2 = new ActorCollisionFlags(stream); + stream.Position += 4; + for (int i = 0; i < 4; i++) + { + Buffs.Add(new BuffDef(stream)); + stream.Position += (2 * 4); + } + } + + } + public class ActorCollisionFlags + { + public int I0 { get; private set; } + public int I1 { get; private set; } + public int I2 { get; private set; } + public int I3 { get; private set; } + + public ActorCollisionFlags(MpqFileStream stream) + { + this.I0 = stream.ReadValueS32(); + this.I1 = stream.ReadValueS32(); + this.I2 = stream.ReadValueS32(); + this.I3 = stream.ReadValueS32(); + } + } + + public class BuffDef + { + public List BuffFilterPowers = new List(); + + public BuffDef(MpqFileStream stream) + { + BuffFilterPowers = stream.ReadSerializedInts(); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Common/MPQ/FileFormats/Quest.cs b/src/Mooege/Common/MPQ/FileFormats/Quest.cs new file mode 100644 index 00000000..5660cf6a --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/Quest.cs @@ -0,0 +1,353 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using CrystalMpq; +using Gibbed.IO; +using Mooege.Common.MPQ.FileFormats.Types; +using Mooege.Core.GS.Common.Types.SNO; + +namespace Mooege.Common.MPQ.FileFormats +{ + [FileFormat(SNOGroup.Quest)] + class Quest : FileFormat + { + public Header Header { get; private set; } + public QuestType QuestType { get; private set; } + public int NumberOfSteps { get; private set; } + public int NumberOfCompletionSteps { get; private set; } + public int I2 { get; private set; } // not uniqe..10 for like 3 quests + public int I3 { get; private set; } // always 6 except for vendor_rescue_event which has 4 + public int I4 { get; private set; } // always -1 in beta + public int I5 { get; private set; } // always 0 in beta + public QuestUnassignedStep QuestUnassignedStep { get; private set; } + public List QuestSteps { get; private set; } + public List QuestCompletionSteps { get; private set; } + public QuestLevelRange LevelRange1 { get; private set; } + public QuestLevelRange LevelRange2 { get; private set; } + public QuestLevelRange LevelRange3 { get; private set; } + public QuestLevelRange LevelRange4 { get; private set; } + + public Quest(MpqFile file) + { + MpqFileStream stream = file.Open(); + + Header = new Header(stream); + QuestType = (QuestType)stream.ReadValueS32(); + NumberOfSteps = stream.ReadValueS32(); + NumberOfCompletionSteps = stream.ReadValueS32(); + I2 = stream.ReadValueS32(); + I3 = stream.ReadValueS32(); + I4 = stream.ReadValueS32(); + I5 = stream.ReadValueS32(); + + QuestUnassignedStep = new QuestUnassignedStep(stream); + stream.Position += 8; + QuestSteps = stream.ReadSerializedData(); + stream.Position += 8; + QuestCompletionSteps = stream.ReadSerializedData(); + + LevelRange1 = new QuestLevelRange(stream); + LevelRange2 = new QuestLevelRange(stream); + LevelRange3 = new QuestLevelRange(stream); + LevelRange4 = new QuestLevelRange(stream); + + + stream.Close(); + } + } + + + public interface IQuestStep + { + int ID { get; } + List StepObjectiveSets { get; } + } + + public class QuestUnassignedStep : IQuestStep + { + public int ID { get; private set; } + public List StepObjectiveSets { get; private set; } + public List StepFailureConditionSets { get; private set; } + + public QuestUnassignedStep(MpqFileStream stream) + { + ID = stream.ReadValueS32(); + stream.Position += 4; // unaccounted in xml + stream.Position += (2 * 4); + StepObjectiveSets = stream.ReadSerializedData(); + + stream.Position += (2 * 4); + StepFailureConditionSets = stream.ReadSerializedData(); + } + } + + public class QuestStepObjectiveSet : ISerializableData + { + public int FollowUpStepID { get; private set; } + public List StepObjectives { get; private set; } + + public void Read(MpqFileStream stream) + { + FollowUpStepID = stream.ReadValueS32(); + + stream.Position += 4; + stream.Position += 8; + StepObjectives = stream.ReadSerializedData(); + } + } + + public class QuestStepObjective : ISerializableData + { + public int I0 { get; private set; } + public QuestStepObjectiveType ObjectiveType { get; private set; } + public int I2 { get; private set; } + public int CounterTarget { get; private set; } + public SNOHandle SNOName1 { get; private set; } + public SNOHandle SNOName2 { get; private set; } + public int GBID1 { get; private set; } + public int GBID2 { get; private set; } + public string Group1Name { get; private set; } + public string Unknown2 { get; private set; } + public int I4 { get; private set; } // min = 0, max = 1 unless i know what it is im not making it a bool + public int I5 { get; private set; } + public int GBIDItemToShow { get; private set; } + + public void Read(MpqFileStream stream) + { + I0 = stream.ReadValueS32(); + ObjectiveType = (QuestStepObjectiveType)stream.ReadValueS32(); + I2 = stream.ReadValueS32(); + CounterTarget = stream.ReadValueS32(); + SNOName1 = new SNOHandle(stream); + SNOName2 = new SNOHandle(stream); + GBID1 = stream.ReadValueS32(); + GBID2 = stream.ReadValueS32(); + Group1Name = stream.ReadString(256, true); + Unknown2 = stream.ReadString(256, true); + I4 = stream.ReadValueS32(); + I5 = stream.ReadValueS32(); + GBIDItemToShow = stream.ReadValueS32(); + } + } + + public class QuestStepFailureConditionSet : ISerializableData + { + public List QuestStepFailureConditions { get; private set; } + + public void Read(MpqFileStream stream) + { + stream.Position += 8; + QuestStepFailureConditions = stream.ReadSerializedData(); + } + } + + public class QuestStepFailureCondition : ISerializableData + { + public QuestStepFailureConditionType ConditionType { get; private set; } + public int I2 { get; private set; } + public int I3 { get; private set; } + public SNOHandle SNOName1 { get; private set; } + public SNOHandle SNOName2 { get; private set; } + public int GBID1 { get; private set; } + public int GBID2 { get; private set; } + public string Unknown1 { get; private set; } + public string Unknown2 { get; private set; } + + public void Read(MpqFileStream stream) + { + ConditionType = (QuestStepFailureConditionType)stream.ReadValueS32(); + I2 = stream.ReadValueS32(); + I3 = stream.ReadValueS32(); + SNOName1 = new SNOHandle(stream); + SNOName2 = new SNOHandle(stream); + GBID1 = stream.ReadValueS32(); + GBID2 = stream.ReadValueS32(); + Unknown1 = stream.ReadString(256, true); + Unknown2 = stream.ReadString(256, true); + } + } + + public class QuestLevelRange + { + public int Min { get; private set; } + public int Max { get; private set; } + + public QuestLevelRange(MpqFileStream stream) + { + Min = stream.ReadValueS32(); + Max = stream.ReadValueS32(); + } + } + + public class QuestStep : ISerializableData, IQuestStep + { + public string Name { get; private set; } + public int ID { get; private set; } + public int I1 { get; private set; } + public int[] I2 = new int[4]; + public Enum1 Enum1 { get; private set; } + public int[] SNORewardRecipe = new int[5]; + public int SNORewardTreasureClass { get; private set; } + public int I3 { get; private set; } + public int I4 { get; private set; } + public Enum1 Enum2 { get; private set; } + public int[] SNOReplayRewardRecipe = new int[5]; + public int SNOReplayRewardTreasureClass { get; private set; } + public int I5 { get; private set; } + public int I6 { get; private set; } + public int SNOPowerGranted { get; private set; } + public int[] SNOWaypointLevelAreas = new int[2]; + + public List StepObjectiveSets { get; private set; } + public List StepBonusObjectiveSets { get; private set; } + public List StepFailureConditionSets { get; private set; } + + public void Read(MpqFileStream stream) + { + Name = stream.ReadString(64, true); + ID = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); + + for (int i = 0; i < I2.Length; i++) + I2[i] = stream.ReadValueS32(); + + Enum1 = (Enum1)stream.ReadValueS32(); + + for (int i = 0; i < SNORewardRecipe.Length; i++) + SNORewardRecipe[i] = stream.ReadValueS32(); + + SNORewardTreasureClass = stream.ReadValueS32(); + I3 = stream.ReadValueS32(); + I4 = stream.ReadValueS32(); + Enum2 = (Enum1)stream.ReadValueS32(); + + for (int i = 0; i < SNOReplayRewardRecipe.Length; i++) + SNOReplayRewardRecipe[i] = stream.ReadValueS32(); + + SNOReplayRewardTreasureClass = stream.ReadValueS32(); + I5 = stream.ReadValueS32(); + I6 = stream.ReadValueS32(); + SNOPowerGranted = stream.ReadValueS32(); + + for (int i = 0; i < SNOWaypointLevelAreas.Length; i++) + SNOWaypointLevelAreas[i] = stream.ReadValueS32(); + + stream.Position += 4; // unnacounted for in the xml + + stream.Position += 8; + StepObjectiveSets = stream.ReadSerializedData(); + + stream.Position += 8; + StepBonusObjectiveSets = stream.ReadSerializedData(); + + stream.Position += 8; + StepFailureConditionSets = stream.ReadSerializedData(); + } + } + + public class QuestStepBonusObjectiveSet : ISerializableData + { + public int[] I0 = new int[4]; + public int I1 { get; private set; } + public int I2 { get; private set; } + public int I3 { get; private set; } + public int I4 { get; private set; } + public int I5 { get; private set; } + public List StepBonusObjectives { get; private set; } + + public void Read(MpqFileStream stream) + { + for (int i = 0; i < I0.Length; i++) + I0[i] = stream.ReadValueS32(); + + I1 = stream.ReadValueS32(); + I2 = stream.ReadValueS32(); + I3 = stream.ReadValueS32(); + I4 = stream.ReadValueS32(); + I5 = stream.ReadValueS32(); + + stream.Position += 12; + StepBonusObjectives = stream.ReadSerializedData(); + } + } + + public class QuestCompletionStep : ISerializableData, IQuestStep + { + public string Unknown { get; private set; } + public int ID { get; private set; } + public int I2 { get; private set; } + + public void Read(MpqFileStream stream) + { + Unknown = stream.ReadString(64, true); + ID = stream.ReadValueS32(); + I2 = stream.ReadValueS32(); + } + + public List StepObjectiveSets + { + get { return new List(); } + } + } + + + public enum Enum1 + { + NoItem = 0, + SharedRecipe = 1, + ClassRecipe = 2, + TreasureClass = 3 + } + + public enum QuestStepFailureConditionType + { + MonsterDied = 0, + PlayerDied = 1, + ActorDied = 2, + TimedEventExpired = 3, + ItemUsed = 4, + GameFlagSet = 5, + PlayerFlagSet = 6, + EventReceived = 7 + } + + public enum QuestStepObjectiveType + { + HadConversation = 0, + PossessItem = 1, + KillMonster = 2, + InteractWithActor = 3, + EnterLevelArea = 4, + EnterScene = 5, + EnterWorld = 6, + EnterTrigger = 7, + CompleteQuest = 8, + PlayerFlagSet = 9, + TimedEventExpired = 10, + KillGroup = 11, + GameFlagSet = 12, + EventReceived = 13 + } + + public enum QuestType + { + MainQuest = 0, + Event = 2 + } +} diff --git a/src/Mooege/Common/MPQ/FileFormats/QuestRange.cs b/src/Mooege/Common/MPQ/FileFormats/QuestRange.cs new file mode 100644 index 00000000..bba11b3b --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/QuestRange.cs @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using CrystalMpq; +using Gibbed.IO; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Common.MPQ.FileFormats.Types; + +namespace Mooege.Common.MPQ.FileFormats +{ + [FileFormat(SNOGroup.QuestRange)] + public class QuestRange : FileFormat + { + public Header Header { get; private set; } + public QuestTime Start { get; private set; } + public QuestTime End { get; private set; } + + public QuestRange(MpqFile file) + { + var stream = file.Open(); + this.Header = new Header(stream); + this.Start = new QuestTime(stream); + this.End = new QuestTime(stream); + stream.Close(); + } + } + + public class QuestTime + { + public int SNOQuest { get; private set; } + public int StepID { get; private set; } + + public QuestTime(MpqFileStream stream) + { + this.SNOQuest = stream.ReadValueS32(); + this.StepID = stream.ReadValueS32(); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Common/MPQ/FileFormats/Recipe.cs b/src/Mooege/Common/MPQ/FileFormats/Recipe.cs new file mode 100644 index 00000000..332eb5df --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/Recipe.cs @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using CrystalMpq; +using Mooege.Common.MPQ.FileFormats.Types; +using Mooege.Core.GS.Common.Types.SNO; + +// Appears to work fine, created from snodata.xml - DarkLotus +namespace Mooege.Common.MPQ.FileFormats +{ + [FileFormat(SNOGroup.Recipe)] + public class Recipe : FileFormat + { + public Header Header { get; private set; } + public ItemSpecifierData ItemSpecifierData { get; private set; } + + public Recipe(MpqFile file) + { + var stream = file.Open(); + this.Header = new Header(stream); + ItemSpecifierData = new ItemSpecifierData(stream); + stream.Close(); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Common/MPQ/FileFormats/Scene.cs b/src/Mooege/Common/MPQ/FileFormats/Scene.cs new file mode 100644 index 00000000..f314fc06 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/Scene.cs @@ -0,0 +1,270 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using CrystalMpq; +using Gibbed.IO; +using Mooege.Common.MPQ.FileFormats.Types; +using Mooege.Core.GS.Common.Types.Collision; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Common.Types.SNO; + +namespace Mooege.Common.MPQ.FileFormats +{ + [FileFormat(SNOGroup.Scene)] + public class Scene : FileFormat + { + public Header Header { get; private set; } + public int Int0 { get; private set; } + public AABB AABBBounds { get; private set; } + public AABB AABBMarketSetBounds { get; private set; } + public NavMeshDef NavMesh { get; private set; } + public List MarkerSets { get; private set; } + public string LookLink { get; private set; } + public List MsgTriggeredEvent { get; private set; } + public int Int1 { get; private set; } + public NavZoneDef NavZone { get; private set; } + + public List Inclusions = new List(); + public List Exclusions = new List(); + public int SNOAppearance { get; private set; } + public int SNOPhysMesh { get; private set; } + + public Scene(MpqFile file) + { + var stream = file.Open(); + this.Header = new Header(stream); + + Int0 = stream.ReadValueS32(); + this.AABBBounds = new AABB(stream); + this.AABBMarketSetBounds = new AABB(stream); + + this.NavMesh = new NavMeshDef(stream); + this.Exclusions = stream.ReadSerializedInts(); + + stream.Position += (14 * 4); + this.Inclusions = stream.ReadSerializedInts(); + + stream.Position += (14 * 4); + this.MarkerSets = stream.ReadSerializedInts(); + + stream.Position += (14 * 4); + this.LookLink = stream.ReadString(64, true); + + this.MsgTriggeredEvent = stream.ReadSerializedData(); + this.Int1 = stream.ReadValueS32(); + + stream.Position += (3 * 4); + this.NavZone = new NavZoneDef(stream); + this.SNOAppearance = stream.ReadValueS32(); + this.SNOPhysMesh = stream.ReadValueS32(); + stream.Close(); + } + + public class NavMeshDef + { + public int SquaresCountX { get; private set; } + public int SquaresCountY { get; private set; } + public int Int0 { get; private set; } + public int NavMeshSquareCount { get; private set; } + public float Float0 { get; private set; } + public List Squares = new List(); + public byte[,] WalkGrid; + public string Filename { get; private set; } + + public NavMeshDef(MpqFileStream stream) + { + this.SquaresCountX = stream.ReadValueS32(); + this.SquaresCountY = stream.ReadValueS32(); + this.Int0 = stream.ReadValueS32(); + this.NavMeshSquareCount = stream.ReadValueS32(); + this.Float0 = stream.ReadValueF32(); + this.Squares = stream.ReadSerializedData(); + + if (SquaresCountX <= 64 && SquaresCountY <= 64) + { + WalkGrid = new byte[64, 64]; + } + else if (SquaresCountX <= 128 && SquaresCountY <= 128) + { + WalkGrid = new byte[128, 128]; //96*96 + } + else if (SquaresCountX <= 256 && SquaresCountY <= 256) + { + WalkGrid = new byte[256, 256]; + } + else if (SquaresCountX <= 384 && SquaresCountY <= 384) + { + WalkGrid = new byte[384, 384]; + } + else if (SquaresCountX > 384 || SquaresCountY > 384) + { + WalkGrid = new byte[512, 512]; + } + + + // Loop thru each NavmeshSquare in the array, and fills the grid + for (int i = 0; i < NavMeshSquareCount; i++) + { + WalkGrid[i % SquaresCountX, i / SquaresCountY] = (byte)(Squares[i].Flags & Scene.NavCellFlags.AllowWalk); + // Set the grid to 0x1 if its walkable, left as 0 if not. - DarkLotus + } + + stream.Position += (3 * 4); + this.Filename = stream.ReadString(256, true); + } + } + + public class NavZoneDef + { + public int NavCellCount { get; private set; } + public List NavCells = new List(); + public int NeighbourCount { get; private set; } + public List NavCellNeighbours = new List(); + public float Float0 { get; private set; } + public float Float1 { get; private set; } + public int Int2 { get; private set; } + public Vector2D V0 { get; private set; } + public List GridSquares = new List(); + public int Int3 { get; private set; } + public List CellLookups = new List(); + public int BorderDataCount { get; private set; } + public List BorderData = new List(); + + public NavZoneDef(MpqFileStream stream) + { + this.NavCellCount = stream.ReadValueS32(); + stream.Position += (3 * 4); + this.NavCells = stream.ReadSerializedData(); + + this.NeighbourCount = stream.ReadValueS32(); + stream.Position += (3 * 4); + this.NavCellNeighbours = stream.ReadSerializedData(); + + this.Float0 = stream.ReadValueF32(); + this.Float1 = stream.ReadValueF32(); + this.Int2 = stream.ReadValueS32(); + this.V0 = new Vector2D(stream); + + stream.Position += (3 * 4); + this.GridSquares = stream.ReadSerializedData(); + + this.Int3 = stream.ReadValueS32(); + stream.Position += (3 * 4); + this.CellLookups = stream.ReadSerializedData(); + + this.BorderDataCount = stream.ReadValueS32(); + stream.Position += (3 * 4); + this.BorderData = stream.ReadSerializedData(); + } + } + + public class NavMeshSquare : ISerializableData + { + public float Z { get; private set; } + public NavCellFlags Flags { get; private set; } + + public void Read(MpqFileStream stream) + { + this.Z = stream.ReadValueF32(); + this.Flags = (NavCellFlags)stream.ReadValueS32(); + } + } + + public class NavCell : ISerializableData + { + public Vector3D Min { get; private set; } + public Vector3D Max { get; private set; } + public NavCellFlags Flags { get; private set; } + public short NeighbourCount { get; private set; } + public int NeighborsIndex { get; private set; } + public System.Windows.Rect Bounds { get { return new System.Windows.Rect(Min.X, Min.Y, Max.X - Min.X, Max.Y - Min.Y); } } + public void Read(MpqFileStream stream) + { + this.Min = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32()); + this.Max = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32()); + this.Flags = (NavCellFlags)stream.ReadValueS16(); + this.NeighbourCount = stream.ReadValueS16(); + this.NeighborsIndex = stream.ReadValueS32(); + } + } + + /// + /// Flags for NavCell. + /// + [Flags] + public enum NavCellFlags : int + { + AllowWalk = 0x1, + AllowFlier = 0x2, + AllowSpider = 0x4, + LevelAreaBit0 = 0x8, + LevelAreaBit1 = 0x10, + NoNavMeshIntersected = 0x20, + NoSpawn = 0x40, + Special0 = 0x80, + Special1 = 0x100, + SymbolNotFound = 0x200, + AllowProjectile = 0x400, + AllowGhost = 0x800, + RoundedCorner0 = 0x1000, + RoundedCorner1 = 0x2000, + RoundedCorner2 = 0x4000, + RoundedCorner3 = 0x8000 + } + + public class NavCellLookup : ISerializableData + { + public short Flags { get; private set; } + public short WCell { get; private set; } + + public void Read(MpqFileStream stream) + { + this.Flags = stream.ReadValueS16(); + this.WCell = stream.ReadValueS16(); + } + } + + public class NavGridSquare : ISerializableData + { + public short Flags { get; private set; } + public short W1 { get; private set; } + public short W2 { get; private set; } + + public void Read(MpqFileStream stream) + { + Flags = stream.ReadValueS16(); + W1 = stream.ReadValueS16(); + W2 = stream.ReadValueS16(); + } + } + + public class NavCellBorderData : ISerializableData + { + public short W0 { get; private set; } + public short W1 { get; private set; } + + public void Read(MpqFileStream stream) + { + W0 = stream.ReadValueS16(); + W1 = stream.ReadValueS16(); + } + } + } +} diff --git a/src/Mooege/Common/MPQ/FileFormats/SceneGroup.cs b/src/Mooege/Common/MPQ/FileFormats/SceneGroup.cs new file mode 100644 index 00000000..6cc22c72 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/SceneGroup.cs @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using CrystalMpq; +using Gibbed.IO; +using Mooege.Common.MPQ.FileFormats.Types; +using Mooege.Core.GS.Common.Types.SNO; + +namespace Mooege.Common.MPQ.FileFormats +{ + [FileFormat(SNOGroup.SceneGroup)] + public class SceneGroup : FileFormat + { + public Header Header { get; private set; } + public int I0 { get; private set; } + public List Items { get; private set; } + public int I1 { get; private set; } + + public SceneGroup(MpqFile file) + { + var stream = file.Open(); + this.Header = new Header(stream); + this.I0 = stream.ReadValueS32(); + this.Items = stream.ReadSerializedData(); + stream.Position += 8; + this.I1 = stream.ReadValueS32(); + stream.Close(); + } + } + + public class SceneGroupItem : ISerializableData + { + public int SNOScene { get; private set; } + public int I0 { get; private set; } + public int LabelGBId { get; private set; } + + public void Read(MpqFileStream stream) + { + this.SNOScene = stream.ReadValueS32(); + this.I0 = stream.ReadValueS32(); + this.LabelGBId = stream.ReadValueS32(); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Common/MPQ/FileFormats/SkillKit.cs b/src/Mooege/Common/MPQ/FileFormats/SkillKit.cs new file mode 100644 index 00000000..b0315695 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/SkillKit.cs @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using CrystalMpq; +using Gibbed.IO; +using Mooege.Common.MPQ.FileFormats.Types; +using Mooege.Core.GS.Common.Types.SNO; + +namespace Mooege.Common.MPQ.FileFormats +{ + [FileFormat(SNOGroup.SkillKit)] + public class SkillKit : FileFormat + { + public Header Header { get; private set; } + public List TraitEntries { get; private set; } + public List ActiveSkillEntries { get; private set; } + + public SkillKit(MpqFile file) + { + var stream = file.Open(); + this.Header = new Header(stream); + stream.Position += 12; + this.TraitEntries = stream.ReadSerializedData(); + stream.Position += 8; + this.ActiveSkillEntries = stream.ReadSerializedData(); + stream.Close(); + } + } + + public class TraitEntry : ISerializableData + { + public int SNOPower { get; private set; } + public int Category { get; private set; } + public int ReqLevel { get; private set; } + + public void Read(MpqFileStream stream) + { + this.SNOPower = stream.ReadValueS32(); + this.Category = stream.ReadValueS32(); + this.ReqLevel = stream.ReadValueS32(); + } + } + + public class ActiveSkillEntry : ISerializableData + { + public int SNOPower { get; private set; } + public ActiveSkillCategory Category { get; private set; } + public int SkillGroup { get; private set; } // TODO: possible to make an enum for this, like Category has? + public int ReqLevel { get; private set; } + public int RuneNone_ReqLevel { get; private set; } + public int RuneA_ReqLevel { get; private set; } + public int RuneB_ReqLevel { get; private set; } + public int RuneC_ReqLevel { get; private set; } + public int RuneD_ReqLevel { get; private set; } + public int RuneE_ReqLevel { get; private set; } + + public void Read(MpqFileStream stream) + { + this.SNOPower = stream.ReadValueS32(); + this.Category = (ActiveSkillCategory)stream.ReadValueS32(); + this.SkillGroup = stream.ReadValueS32(); + this.ReqLevel = stream.ReadValueS32(); + this.RuneNone_ReqLevel = stream.ReadValueS32(); + this.RuneA_ReqLevel = stream.ReadValueS32(); + this.RuneB_ReqLevel = stream.ReadValueS32(); + this.RuneC_ReqLevel = stream.ReadValueS32(); + this.RuneD_ReqLevel = stream.ReadValueS32(); + this.RuneE_ReqLevel = stream.ReadValueS32(); + } + } + + public enum ActiveSkillCategory + { + FuryGenerator = 0, + FurySpender, + Situational, + Signature, + Offensive, + Utility, + PhysicalRealm, + SpiritRealm, + Support, + HatredGenerator, + HatredSpender, + Discipline, + SpiritGenerator, + SpiritSpender, + Mantras, + } +} diff --git a/src/Mooege/Common/MPQ/FileFormats/TreasureClass.cs b/src/Mooege/Common/MPQ/FileFormats/TreasureClass.cs new file mode 100644 index 00000000..2fa552ac --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/TreasureClass.cs @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using Mooege.Common.MPQ.FileFormats.Types; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Common.Logging; +using Mooege.Core.GS.Items; +using Mooege.Common.Helpers.Math; +using Mooege.Core.GS.Players; +using Mooege.Common.Storage; + +namespace Mooege.Common.MPQ.FileFormats +{ + [FileFormat(SNOGroup.TreasureClass)] + public class TreasureClass : FileFormat + { + Logger Logger = new Logger("TreasureClass"); + + public static TreasureClass GenericTreasure + { + get + { + return new StandardTreasureClass(); + } + } + + public class StandardTreasureClass : TreasureClass + { + public override Item CreateDrop(Player player) + { + return ItemGenerator.CreateGold(player, RandomHelper.Next(1000, 3000)); + } + } + + [PersistentProperty("Percentage")] + public float Percentage { get; private set; } + + [PersistentProperty("I0")] + public int I0 { get; private set; } + + [PersistentProperty("LootDropModifiersCount")] + public int LootDropModifiersCount { get; private set; } + + [PersistentProperty("LootDropModifiers")] + public List LootDropModifiers { get; private set; } + + public TreasureClass() { } + + public virtual Item CreateDrop(Player player) + { + Logger.Warn("Treasure classes not implemented, using generic treasure class"); + return TreasureClass.GenericTreasure.CreateDrop(player); + } + } + + public class LootDropModifier + { + [PersistentProperty("I0")] + public int I0 { get; private set; } + + [PersistentProperty("SNOSubTreasureClass")] + public int SNOSubTreasureClass { get; private set; } + + [PersistentProperty("Percentage")] + public float Percentage { get; private set; } + + [PersistentProperty("I1")] + public int I1 { get; private set; } + + [PersistentProperty("GBIdQualityClass")] + public int GBIdQualityClass { get; private set; } + + [PersistentProperty("I2")] + public int I2 { get; private set; } + + [PersistentProperty("I3")] + public int I3 { get; private set; } + + [PersistentProperty("SNOCondition")] + public int SNOCondition { get; private set; } + + [PersistentProperty("ItemSpecifier")] + public ItemSpecifierData ItemSpecifier { get; private set; } + + [PersistentProperty("I5")] + public int I5 { get; private set; } + + [PersistentProperty("I4", 4)] + public int[] I4 { get; private set; } + + [PersistentProperty("I6")] + public int I6 { get; private set; } + + public LootDropModifier() { } + } +} diff --git a/src/Mooege/Common/MPQ/FileFormats/Tutorial.cs b/src/Mooege/Common/MPQ/FileFormats/Tutorial.cs new file mode 100644 index 00000000..97593ead --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/Tutorial.cs @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using CrystalMpq; +using Gibbed.IO; +using Mooege.Common.MPQ.FileFormats.Types; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Core.GS.Common.Types.Math; + +namespace Mooege.Common.MPQ.FileFormats +{ + [FileFormat(SNOGroup.Tutorial)] + public class Tutorial : FileFormat + { + public Header Header { get; private set; } + public int I0 { get; private set; } + public int I1 { get; private set; } + public int Time { get; private set; } + public int Time2 { get; private set; } + public int I2 { get; private set; } + public int I3 { get; private set; } + public Vector2D V0 { get; private set; } + + public Tutorial(MpqFile file) + { + var stream = file.Open(); + this.Header = new Header(stream); + this.I0 = stream.ReadValueS32(); + this.I1 = stream.ReadValueS32(); + this.Time = stream.ReadValueS32(); + this.Time2 = stream.ReadValueS32(); + this.I2 = stream.ReadValueS32(); + this.I3 = stream.ReadValueS32(); + this.V0 = new Vector2D(stream); + stream.Close(); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Common/MPQ/FileFormats/Types/Common.cs b/src/Mooege/Common/MPQ/FileFormats/Types/Common.cs new file mode 100644 index 00000000..ea653434 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/Types/Common.cs @@ -0,0 +1,312 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using CrystalMpq; +using Gibbed.IO; +using Mooege.Core.GS.Common.Types.Misc; +using Mooege.Core.GS.Common.Types.SNO; +using System.Text; +using Mooege.Common.Storage; + +namespace Mooege.Common.MPQ.FileFormats.Types +{ + public class Header + { + public int DeadBeef { get; private set; } + public int SnoType { get; private set; } + public int Unknown1 { get; private set; } + public int Unknown2 { get; private set; } + public int Unknown3 { get; private set; } + public int Unknown4 { get; private set; } + public int SNOId { get; private set; } + + public Header(MpqFileStream stream) + { + this.DeadBeef = stream.ReadValueS32(); + this.SnoType = stream.ReadValueS32(); + this.Unknown1 = stream.ReadValueS32(); + this.Unknown2 = stream.ReadValueS32(); + this.SNOId = stream.ReadValueS32(); + this.Unknown3 = stream.ReadValueS32(); + this.Unknown4 = stream.ReadValueS32(); + } + } + + public class ScriptFormula + { + [PersistentProperty("I0")] + public int I0 { get; private set; } + + [PersistentProperty("I1")] + public int I1 { get; private set; } + + [PersistentProperty("I2")] + public int I2 { get; private set; } + + [PersistentProperty("I3")] + public int I3 { get; private set; } + + [PersistentProperty("I4")] + public int I4 { get; private set; } + + [PersistentProperty("NameSize")] + public int NameSize { get; private set; } + + [PersistentProperty("I5")] + public int I5 { get; private set; } + + [PersistentProperty("OpcodeSize")] + public int OpcodeSize { get; private set; } + + [PersistentProperty("OpCodeName")] + public string OpCodeName { get; private set; } + + [PersistentProperty("OpCodeArray", -1)] + public byte[] OpCodeArray { get; private set; } + + public ScriptFormula() { } + + public ScriptFormula(MpqFileStream stream) + { + this.I0 = stream.ReadValueS32(); + this.I1 = stream.ReadValueS32(); + this.I2 = stream.ReadValueS32(); + this.I3 = stream.ReadValueS32(); + this.I4 = stream.ReadValueS32(); + this.NameSize = stream.ReadValueS32(); + this.I5 = stream.ReadValueS32(); + this.OpcodeSize = stream.ReadValueS32(); + this.OpCodeName = stream.ReadStringZ(Encoding.ASCII); + + switch (NameSize % 4) + { + case 0: + break; + case 1: + stream.Position += 3; + break; + case 2: + stream.Position += 2; + break; + case 3: + stream.Position += 1; + break; + + } + this.OpCodeArray = new byte[OpcodeSize]; + stream.Read(OpCodeArray, 0, OpcodeSize); + } + + public override string ToString() + { + return OpCodeName; + } + } + + public class ScriptFormulaDetails : ISerializableData + { + public string CharArray1 { get; private set; } + public string CharArray2 { get; private set; } + public int I0 { get; private set; } + public int I1 { get; private set; } + + public void Read(MpqFileStream stream) + { + CharArray1 = stream.ReadString(256, true); + CharArray2 = stream.ReadString(512, true); + I0 = stream.ReadValueS32(); + I1 = stream.ReadValueS32(); + } + } + + // Replace each Look with just a chararay? DarkLotus + public class HardPointLink + { + public string Name { get; private set; } + public int I0 { get; private set; } + + public HardPointLink(MpqFileStream stream) + { + this.Name = stream.ReadString(64, true); + I0 = stream.ReadValueS32(); + } + } + + public class TriggerConditions + { + public int Percent { get; private set; } //0-255 + public int Int1 { get; private set; } + public int Int2 { get; private set; } + public int Int3 { get; private set; } + public int Int4 { get; private set; } + public int Int5 { get; private set; } + public int Int6 { get; private set; } + public int Int7 { get; private set; } + public int Int8 { get; private set; } + + public TriggerConditions(MpqFileStream stream) + { + Percent = stream.ReadByte(); + stream.Position += 3; + Int1 = stream.ReadValueS32(); + Int2 = stream.ReadValueS32(); + Int3 = stream.ReadValueS32(); + Int4 = stream.ReadValueS32(); + Int5 = stream.ReadValueS32(); + Int6 = stream.ReadValueS32(); + Int7 = stream.ReadValueS32(); + Int8 = stream.ReadValueS32(); + } + } + + public class TriggerEvent + { + public int I0 { get; private set; } + public TriggerConditions TriggerConditions { get; private set; } + public int I1 { get; private set; } + public SNOHandle SNOHandle { get; private set; } + public int I2 { get; private set; } + public int I3 { get; private set; } + public int RuneType { get; private set; } + public int UseRuneType { get; private set; } + public HardPointLink[] HardPointLinks { get; private set; } + public string LookLink { get; private set; } + public string ConstraintLink { get; private set; } + public int I4 { get; private set; } + public float F0 { get; private set; } + public int I5 { get; private set; } + public int I6 { get; private set; } + public int I7 { get; private set; } + public int I8 { get; private set; } + public int I9 { get; private set; } + public float F1 { get; private set; } + public float F2 { get; private set; } + public int I10 { get; private set; } + public float F3 { get; private set; } + public int I11 { get; private set; } + public float Velocity { get; private set; } + public int I12 { get; private set; } + public int Ticks1 { get; private set; } // DT_TIME + public RGBAColor Color1 { get; private set; } + public int I14 { get; private set; } // DT_TIME + public RGBAColor Color2 { get; private set; } + public int I15 { get; private set; } // DT_TIME + + public TriggerEvent(MpqFileStream stream) + { + I0 = stream.ReadValueS32(); + TriggerConditions = new TriggerConditions(stream); + I1 = stream.ReadValueS32(); + SNOHandle = new SNOHandle(stream); + I2 = stream.ReadValueS32(); + I3 = stream.ReadValueS32(); + RuneType = stream.ReadValueS32(); + UseRuneType = stream.ReadValueS32(); + HardPointLinks = new HardPointLink[2]; + HardPointLinks[0] = new HardPointLink(stream); + HardPointLinks[1] = new HardPointLink(stream); + this.LookLink = stream.ReadString(64, true); + this.ConstraintLink = stream.ReadString(64, true); + I4 = stream.ReadValueS32(); + F0 = stream.ReadValueF32(); + I5 = stream.ReadValueS32(); + I6 = stream.ReadValueS32(); + I7 = stream.ReadValueS32(); + I8 = stream.ReadValueS32(); + I9 = stream.ReadValueS32(); + F1 = stream.ReadValueF32(); + F2 = stream.ReadValueF32(); + I10 = stream.ReadValueS32(); + F3 = stream.ReadValueF32(); + I11 = stream.ReadValueS32(); + Velocity = stream.ReadValueF32(); + I12 = stream.ReadValueS32(); + Ticks1 = stream.ReadValueS32(); + Color1 = new RGBAColor(stream); + I14 = stream.ReadValueS32(); + Color2 = new RGBAColor(stream); + I15 = stream.ReadValueS32(); + } + } + + public class MsgTriggeredEvent : ISerializableData + { + public int I0 { get; private set; } + public TriggerEvent TriggerEvent { get; private set; } + + public void Read(MpqFileStream stream) + { + I0 = stream.ReadValueS32(); + TriggerEvent = new TriggerEvent(stream); + } + } + + + public class ItemSpecifierData + { + [PersistentProperty("ItemGBId")] + public int ItemGBId { get; private set; } + + [PersistentProperty("I0")] + public int I0 { get; private set; } + + [PersistentProperty("GBIdAffixes", 3)] + public int[] GBIdAffixes { get; private set; } + + [PersistentProperty("I1")] + public int I1 { get; private set; } + + [PersistentProperty("I2")] + public int I2 { get; private set; } + + public ItemSpecifierData() { } + + public ItemSpecifierData(MpqFileStream stream) + { + ItemGBId = stream.ReadValueS32(); + I0 = stream.ReadValueS32(); + GBIdAffixes = new int[3]; + for (int i = 0; i < GBIdAffixes.Length; i++) + { + GBIdAffixes[i] = stream.ReadValueS32(); + } + I1 = stream.ReadValueS32(); + I2 = stream.ReadValueS32(); + } + } + + //public class PostFXParams // unused for now. /raist. + //{ + // public float[] Float0; + // public float[] Float1; + + // public PostFXParams(MpqFileStream stream) + // { + // Float0 = new float[4]; + // for (int i = 0; i < Float0.Length; i++) + // { + // Float0[i] = stream.ReadInt32(); + // } + // Float1 = new float[4]; + // for (int i = 0; i < Float1.Length; i++) + // { + // Float1[i] = stream.ReadInt32(); + // } + // } + //} +} diff --git a/src/Mooege/Common/MPQ/FileFormats/World.cs b/src/Mooege/Common/MPQ/FileFormats/World.cs new file mode 100644 index 00000000..45952ba9 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/World.cs @@ -0,0 +1,616 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using CrystalMpq; +using Gibbed.IO; +using Mooege.Common.MPQ.FileFormats.Types; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Core.GS.Common.Types.Scene; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Common.Storage; + +namespace Mooege.Common.MPQ.FileFormats +{ + [FileFormat(SNOGroup.Worlds)] + public class World : FileFormat + { + public Header Header { get; private set; } + public bool IsGenerated { get; private set; } + public int Int1 { get; private set; } + public int Int2 { get; private set; } + + [PersistentProperty("DRLGParams")] + public List DRLGParams { get; private set; } + [PersistentProperty("SceneParams")] + public SceneParams SceneParams { get; private set; } + public List MarkerSets = new List(); + public Environment Environment { get; private set; } + [PersistentProperty("LabelRuleSet")] + public LabelRuleSet LabelRuleSet { get; private set; } + [PersistentProperty("SceneClusterSet")] + public SceneClusterSet SceneClusterSet { get; private set; } + [PersistentProperty("SNONavMeshFunctions", 4)] + public int[] SNONavMeshFunctions = new int[4]; + public int Int4 { get; private set; } + public float Float0 { get; private set; } + public int Int5 { get; private set; } + public int SNOScript { get; private set; } + public int Int6 { get; private set; } + + public List ServerData { get; private set; } + + public World() { } + + public World(MpqFile file) + { + var stream = file.Open(); + + this.Header = new Header(stream); + + this.IsGenerated = (stream.ReadValueS32() != 0); + stream.Position += 8; + this.ServerData = stream.ReadSerializedData(); + + //this.Int1 = stream.ReadValueS32(); + //this.Int2 = stream.ReadValueS32(); + + ////this.DRLGParams = stream.ReadSerializedData(); // I'm not sure if we can have a list of drlgparams. (then should be calling it with pointer.Size/120) /raist + //stream.Position += 8; // skips reading of DRLG Pointer + //stream.Position += (2 * 4); + //this.SceneParams = stream.ReadSerializedItem(); // I'm not sure if we can have a list of drlgparams. (then should be calling it with pointer.Size/24) /raist + + //stream.Position += (2 * 4); + this.MarkerSets = stream.ReadSerializedInts(); + + stream.Position += (14 * 4); + this.Environment = new Environment(stream); + + //stream.Position += 4; + //LabelRuleSet = new LabelRuleSet(stream); + //this.Int4 = stream.ReadValueS32(); + + //stream.Position += 4; + //this.SceneClusterSet = new SceneClusterSet(stream); + + //for (int i = 0; i < SNONavMeshFunctions.Length; i++) + //{ + // SNONavMeshFunctions[i] = stream.ReadValueS32(); + //} + + //stream.Position += 4; + Float0 = stream.ReadValueF32(); + Int5 = stream.ReadValueS32(); + //SNOScript = stream.ReadValueS32(); + //Int6 = stream.ReadValueS32(); + + stream.Close(); + } + } + + #region scene-params + + public class SceneParams : ISerializableData + { + [PersistentProperty("SceneChunks")] + public List SceneChunks { get; private set; } + [PersistentProperty("ChunkCount")] + public int ChunkCount { get; set; } + + public SceneParams() { } + + public void Read(MpqFileStream stream) + { + this.SceneChunks = stream.ReadSerializedData(); + this.ChunkCount = stream.ReadValueS32(); + stream.Position += (3 * 4); + } + } + + public class SceneChunk : ISerializableData + { + [PersistentProperty("SNOHandle")] + public SNOHandle SNOHandle { get; set; } + [PersistentProperty("PRTransform")] + public PRTransform PRTransform { get; set; } + [PersistentProperty("SceneSpecification")] + public SceneSpecification SceneSpecification { get; set; } + + public SceneChunk() { } + + public void Read(MpqFileStream stream) + { + this.SNOHandle = new SNOHandle(stream); + this.PRTransform = new PRTransform(stream); + this.SceneSpecification = new SceneSpecification(stream); + } + } + + #endregion + + #region drlg-params + + public class DRLGParams : ISerializableData + { + [PersistentProperty("Tiles")] + public List Tiles { get; private set; } + + [PersistentProperty("CommandCount")] + public int CommandCount { get; private set; } + + [PersistentProperty("Commands")] + public List Commands { get; private set; } + + [PersistentProperty("ParentIndices")] + public List ParentIndices { get; private set; } + + [PersistentProperty("TagMap")] + public TagMap TagMap { get; private set; } + + public void Read(MpqFileStream stream) + { + Tiles = stream.ReadSerializedData(); + + stream.Position += (14 * 4); + this.CommandCount = stream.ReadValueS32(); + this.Commands = stream.ReadSerializedData(); + + stream.Position += (3 * 4); + this.ParentIndices = stream.ReadSerializedInts(); + + stream.Position += (2 * 4); + this.TagMap = stream.ReadSerializedItem(); + stream.Position += (2 * 4); + } + } + + public enum TileExits + { + West = 1, + East = 2, + North = 4, + South = 8, + } + + public enum TileTypes + { + Normal = 100, + EventTile1 = 101, // Jar of souls? more? Deadend? + EventTile2 = 102, // 1000 dead + Entrance = 200, + UEntrance1 = 201, // Defiled crypt what there? + Exit = 300, + Filler = 401 + } + + public class TileInfo : ISerializableData + { + [PersistentProperty("Int0")] + public int ExitDirectionBits { get; private set; } + + [PersistentProperty("Int1")] + public int TileType { get; private set; } + + [PersistentProperty("SNOScene")] + public int SNOScene { get; private set; } + + [PersistentProperty("Int2")] + public int Probability { get; private set; } + + [PersistentProperty("TagMap")] + public TagMap TagMap { get; private set; } + + [PersistentProperty("CustomTileInfo")] + public CustomTileInfo CustomTileInfo { get; private set; } + + public void Read(MpqFileStream stream) + { + ExitDirectionBits = stream.ReadValueS32(); + TileType = stream.ReadValueS32(); + SNOScene = stream.ReadValueS32(); + Probability = stream.ReadValueS32(); + this.TagMap = stream.ReadSerializedItem(); + + stream.Position += (2 * 4); + CustomTileInfo = new CustomTileInfo(stream); + } + } + + public enum CommandType + { + Waypoint = 0, + BridleEntrance = 1, + AddExit = 2, + AddHub = 3, + AddSpoke = 4, + Group = 9, //used in DRLG to group tiles together + } + + public class DRLGCommand : ISerializableData + { + [PersistentProperty("Name")] + public string Name { get; private set; } + + [PersistentProperty("I0")] + public int CommandType { get; private set; } + + [PersistentProperty("TagMap")] + public TagMap TagMap { get; private set; } + + public void Read(MpqFileStream stream) + { + this.Name = stream.ReadString(128, true); + CommandType = stream.ReadValueS32(); + this.TagMap = stream.ReadSerializedItem(); + stream.Position += (3 * 4); + } + } + + public class CustomTileInfo + { + [PersistentProperty("I0")] + public int Int0 { get; private set; } + + [PersistentProperty("I1")] + public int Int1 { get; private set; } + + [PersistentProperty("I2")] + public int Int2 { get; private set; } + + [PersistentProperty("V0")] + public Vector2D V0 { get; private set; } + + [PersistentProperty("CustomTileCells")] + public List CustomTileCells { get; private set; } + + public CustomTileInfo() { } + + public CustomTileInfo(MpqFileStream stream) + { + Int0 = stream.ReadValueS32(); + Int1 = stream.ReadValueS32(); + Int2 = stream.ReadValueS32(); + V0 = new Vector2D(stream); + CustomTileCells = stream.ReadSerializedData(); + stream.Position += (3 * 4); + } + } + + public class CustomTileCell : ISerializableData // we're not using this yet. /raist. + { + [PersistentProperty("I0")] + public int Int0 { get; private set; } + + [PersistentProperty("I1")] + public int Int1 { get; private set; } + + [PersistentProperty("I2")] + public int Int2 { get; private set; } + + [PersistentProperty("SNOScene")] + public int SNOScene { get; private set; } + + [PersistentProperty("I3")] + public int Int3 { get; private set; } + + [PersistentProperty("I4", 4)] + public int[] Int4 { get; private set; } + + public CustomTileCell() { } + + public void Read(MpqFileStream stream) + { + Int0 = stream.ReadValueS32(); + Int1 = stream.ReadValueS32(); + Int2 = stream.ReadValueS32(); + SNOScene = stream.ReadValueS32(); + Int3 = stream.ReadValueS32(); + Int4 = new int[4]; + for (int i = 0; i < Int4.Length; i++) + { + Int4[i] = stream.ReadValueS32(); + } + } + } + + #endregion + + #region scene-cluster + + public class SceneClusterSet + { + [PersistentProperty("ClusterCount")] + public int ClusterCount { get; private set; } + [PersistentProperty("SceneClusters")] + public List SceneClusters { get; private set; } + + public SceneClusterSet() { } + + public SceneClusterSet(MpqFileStream stream) + { + this.ClusterCount = stream.ReadValueS32(); + stream.Position += (4 * 3); + this.SceneClusters = stream.ReadSerializedData(); + } + } + + public class SceneCluster : ISerializableData + { + [PersistentProperty("Name")] + public string Name { get; private set; } + [PersistentProperty("ClusterId")] + public int ClusterId { get; private set; } + [PersistentProperty("GroupCount")] + public int GroupCount { get; private set; } + [PersistentProperty("SubSceneGroups")] + public List SubSceneGroups { get; private set; } + public SubSceneGroup Default { get; private set; } + + public SceneCluster() { } + + public void Read(MpqFileStream stream) + { + this.Name = stream.ReadString(128, true); + this.ClusterId = stream.ReadValueS32(); + this.GroupCount = stream.ReadValueS32(); + stream.Position += (2 * 4); + this.SubSceneGroups = stream.ReadSerializedData(); + + this.Default = new SubSceneGroup(stream); + } + } + + public class SubSceneGroup : ISerializableData + { + [PersistentProperty("I0")] + public int I0 { get; private set; } + [PersistentProperty("SubSceneCount")] + public int SubSceneCount { get; private set; } + [PersistentProperty("Entries")] + public List Entries { get; private set; } + + public SubSceneGroup() { } + + public SubSceneGroup(MpqFileStream stream) + { + this.Read(stream); + } + + public void Read(MpqFileStream stream) + { + this.I0 = stream.ReadValueS32(); + this.SubSceneCount = stream.ReadValueS32(); + stream.Position += (2 * 4); + this.Entries = stream.ReadSerializedData(); + } + } + + public class SubSceneEntry : ISerializableData + { + [PersistentProperty("SNOScene")] + public int SNOScene { get; private set; } + [PersistentProperty("Probability")] + public int Probability { get; private set; } + [PersistentProperty("LabelCount")] + public int LabelCount { get; private set; } + [PersistentProperty("Labels")] + public List Labels { get; private set; } + + public SubSceneEntry() { } + + public void Read(MpqFileStream stream) + { + this.SNOScene = stream.ReadValueS32(); + this.Probability = stream.ReadValueS32(); + stream.Position += (3 * 4); + this.LabelCount = stream.ReadValueS32(); + this.Labels = stream.ReadSerializedData(); + } + } + + public class SubSceneLabel : ISerializableData + { + [PersistentProperty("GBId")] + public int GBId { get; private set; } + [PersistentProperty("I0")] + public int I0 { get; private set; } + + public void Read(MpqFileStream stream) + { + GBId = stream.ReadValueS32(); + I0 = stream.ReadValueS32(); + } + } + + #endregion + + #region others + + public class LabelRuleSet + { + [PersistentProperty("Rulecount")] + public int Rulecount { get; private set; } + [PersistentProperty("LabelRules")] + public List LabelRules { get; private set; } + + public LabelRuleSet() { } + + public LabelRuleSet(MpqFileStream stream) + { + Rulecount = stream.ReadValueS32(); + stream.Position += (3 * 4); + this.LabelRules = stream.ReadSerializedData(); + } + } + + public class LabelRule : ISerializableData + { + [PersistentProperty("Name")] + public string Name { get; private set; } + [PersistentProperty("LabelCondition")] + public LabelCondition LabelCondition { get; private set; } + [PersistentProperty("Int0")] + public int Int0 { get; private set; } + [PersistentProperty("LabelCount")] + public int LabelCount { get; private set; } + [PersistentProperty("Entries")] + public List Entries { get; private set; } + + public LabelRule() { } + + public void Read(MpqFileStream stream) + { + this.Name = stream.ReadString(128, true); + LabelCondition = new LabelCondition(stream); + Int0 = stream.ReadValueS32(); + LabelCount = stream.ReadValueS32(); + stream.Position += (2 * 4); + this.Entries = stream.ReadSerializedData(); + } + } + + public class LabelEntry : ISerializableData + { + [PersistentProperty("GBIdLabel")] + public int GBIdLabel { get; private set; } + [PersistentProperty("Int0")] + public int Int0 { get; private set; } + [PersistentProperty("Float0")] + public float Float0 { get; private set; } + [PersistentProperty("Int1")] + public int Int1 { get; private set; } + [PersistentProperty("Int2")] + public int Int2 { get; private set; } + + public LabelEntry() { } + + public void Read(MpqFileStream stream) + { + this.GBIdLabel = stream.ReadValueS32(); + Int0 = stream.ReadValueS32(); + Float0 = stream.ReadValueF32(); + Int1 = stream.ReadValueS32(); + Int2 = stream.ReadValueS32(); + } + } + + public class LabelCondition + { + [PersistentProperty("Enum0")] + public DT_ENUM0 Enum0 { get; private set; } + [PersistentProperty("Int0")] + public int Int0 { get; private set; } + [PersistentProperty("Int1",4)] + public int[] Int1 { get; private set; } + + public LabelCondition() { } + + public LabelCondition(MpqFileStream stream) + { + Enum0 = (DT_ENUM0)stream.ReadValueS32(); + Int0 = stream.ReadValueS32(); + Int1 = new int[4]; + + for (int i = 0; i < Int1.Length; i++) + { + Int1[i] = stream.ReadValueS32(); + } + } + } + + public enum DT_ENUM0 + { + Always = 0, + GameDifficulty = 1, + LabelAlreadySet = 2, + } + + public class Environment + { + /*public RGBAColor RGBAColor0; + public PostFXParams PostFXParams1; + public int int2; + public int int3; + public UberMaterial UberMaterial4; + */ + public int[] Unknown { get; private set; } + public int snoMusic { get; private set; } + public int snoCombatMusic { get; private set; } + public int snoAmbient { get; private set; } + public int snoReverb { get; private set; } + public int snoWeather { get; private set; } + public int snoIrradianceTex { get; private set; } + public int snoIrradianceTexDead { get; private set; } + + public Environment(MpqFileStream stream) + { + Unknown = new int[38]; + for (int i = 0; i < 38; i++) + { + Unknown[i] = stream.ReadValueS32(); + } + + /* RGBAColor0 = new RGBAColor(stream); + PostFXParams1 = new PostFXParams(stream); + int2 = stream.ReadInt32(); + int3 = stream.ReadInt32(); + UberMaterial4 = new UberMaterial(stream); + * */ + snoMusic = stream.ReadValueS32(); + snoCombatMusic = stream.ReadValueS32(); + snoAmbient = stream.ReadValueS32(); + snoReverb = stream.ReadValueS32(); + snoWeather = stream.ReadValueS32(); + snoIrradianceTex = stream.ReadValueS32(); + snoIrradianceTexDead = stream.ReadValueS32(); + } + } + + #endregion + + public class ServerData : ISerializableData + { + public List DRLGParams { get; private set; } + public SceneParams SceneParams { get; private set; } + public LabelRuleSet LabelRuleSet { get; private set; } + public int Int1 { get; private set; } + public SceneClusterSet SceneClusterSet { get; private set; } + public int[] SNONavMeshFunctions = new int[4]; + public int SNOScript { get; private set; } + public int Int2 { get; private set; } + + public void Read(MpqFileStream stream) + { + this.DRLGParams = stream.ReadSerializedData(); + stream.Position += 8; + this.SceneParams = stream.ReadSerializedItem(); + stream.Position += 8; + LabelRuleSet = new LabelRuleSet(stream); + this.Int1 = stream.ReadValueS32(); + this.SceneClusterSet = new SceneClusterSet(stream); + for (int i = 0; i < SNONavMeshFunctions.Length; i++) + { + SNONavMeshFunctions[i] = stream.ReadValueS32(); + } + SNOScript = stream.ReadValueS32(); + Int2 = stream.ReadValueS32(); + } + } + +} \ No newline at end of file diff --git a/src/Mooege/Common/MPQ/MPQAsset.cs b/src/Mooege/Common/MPQ/MPQAsset.cs new file mode 100644 index 00000000..3d71bffe --- /dev/null +++ b/src/Mooege/Common/MPQ/MPQAsset.cs @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Globalization; +using System.Threading; +using CrystalMpq; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Common.Storage; + +namespace Mooege.Common.MPQ +{ + public class MPQAsset : Asset + { + public MpqFile MpqFile { get; set; } + + protected override bool SourceAvailable + { + get { return MpqFile != null && MpqFile.Size != 0; } + } + + public MPQAsset(SNOGroup group, Int32 snoId, string name) + : base(group, snoId, name) + { + } + + public override void RunParser() + { + Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; // Use invariant culture so that we don't hit pitfalls in non en/US systems with different number formats. + _data = (FileFormat)Activator.CreateInstance(Parser, new object[] { MpqFile }); + PersistenceManager.LoadPartial(_data, SNOId.ToString()); + } + } +} diff --git a/src/Mooege/Common/MPQ/MPQPatchChain.cs b/src/Mooege/Common/MPQ/MPQPatchChain.cs new file mode 100644 index 00000000..0144092a --- /dev/null +++ b/src/Mooege/Common/MPQ/MPQPatchChain.cs @@ -0,0 +1,113 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Linq; +using System.Collections.Generic; +using System.Text.RegularExpressions; +using CrystalMpq; +using Mooege.Common.Logging; +using Wintellect.PowerCollections; +using System.IO; + +namespace Mooege.Common.MPQ +{ + public class MPQPatchChain + { + protected static readonly Logger Logger = LogManager.CreateLogger(); + + public bool Loaded { get; private set; } + public List BaseMPQFiles = new List(); + public string PatchPattern { get; private set; } + public int RequiredVersion { get; private set; } + public readonly OrderedMultiDictionary MPQFileList = new OrderedMultiDictionary(false); + public readonly MpqFileSystem FileSystem = new MpqFileSystem(); + + protected MPQPatchChain(int requiredVersion, IEnumerable baseFiles, string patchPattern = null) + { + this.Loaded = false; + this.RequiredVersion = requiredVersion; + + foreach (var file in baseFiles) + { + var mpqFile = MPQStorage.GetMPQFile(file); + if (mpqFile == null) + { + Logger.Error("Cannot find base MPQ file: {0}.", file); + return; + } + this.BaseMPQFiles.Add(mpqFile); + Logger.Trace("Added base-mpq file: {0}.", file); + } + + this.PatchPattern = patchPattern; + this.ConstructChain(); + + var topMostMPQVersion = this.MPQFileList.Reverse().First().Key; // check required version. + if (topMostMPQVersion == this.RequiredVersion) + this.Loaded = true; + else + { + Logger.Error("Required patch-chain version {0} is not satified (found version: {1}).", this.RequiredVersion, topMostMPQVersion); + } + } + + private void ConstructChain() + { + // add base mpq files; + foreach (var mpqFile in this.BaseMPQFiles) + { + MPQFileList.Add(0, mpqFile); + } + + if (PatchPattern == null) return; + + /* match the mpq files for the patch chain */ + var patchRegex = new Regex(this.PatchPattern, RegexOptions.Compiled | RegexOptions.IgnoreCase); + foreach (var file in MPQStorage.MPQList) + { + var match = patchRegex.Match(file); + if (!match.Success) continue; + if (!match.Groups["version"].Success) continue; + + var patchName = match.Groups[0].Value; + var patchVersion = Int32.Parse(match.Groups["version"].Value); + + if (patchVersion > this.RequiredVersion) // ignore the patch if it's version is higher than our required. + { + Logger.Trace("Ignoring patch file {0}.", patchName); + continue; + } + + MPQFileList.Add(patchVersion, file); + Logger.Trace("Found patch file: {0}.", patchName); + } + + /* add mpq's to mpq-file system in reverse-order (highest version first) */ + foreach (var pair in this.MPQFileList.Reverse()) + { + foreach (var mpq in pair.Value) + { + Logger.Trace("Applying patch file: {0}.", System.IO.Path.GetFileName(mpq)); + this.FileSystem.Archives.Add(new MpqArchive(new FileStream(mpq, FileMode.Open, FileAccess.Read, FileShare.ReadWrite), true)); + } + } + Logger.Trace("All files successfully applied."); + } + } +} diff --git a/src/Mooege/Common/MPQ/MPQStorage.cs b/src/Mooege/Common/MPQ/MPQStorage.cs new file mode 100644 index 00000000..628c9624 --- /dev/null +++ b/src/Mooege/Common/MPQ/MPQStorage.cs @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Mooege.Common.Helpers.IO; +using Mooege.Common.Logging; + +namespace Mooege.Common.MPQ +{ + public static class MPQStorage + { + private static readonly Logger Logger = LogManager.CreateLogger(); + private readonly static string MpqRoot = Storage.Config.Instance.MPQRoot; + + public static List MPQList { get; private set; } + public static Data Data { get; private set; } + public static bool Initialized { get; private set; } + + static MPQStorage() + { + Initialized = false; + + if (!Directory.Exists(MpqRoot)) + { + Logger.Error("MPQ root folder does not exist: {0}.", MpqRoot); + return; + } + + Logger.Info("Initializing MPQ storage.."); + MPQList = FileHelpers.GetFilesByExtensionRecursive(MpqRoot, ".mpq"); + + Data = new Data(); + if (Data.Loaded) + { + Data.Init(); + Initialized = true; + } + } + + public static string GetMPQFile(string name) + { + return MPQList.FirstOrDefault(file => file.Contains(name)); + } + } +} diff --git a/src/Mooege/Common/MPQ/SerializableData.cs b/src/Mooege/Common/MPQ/SerializableData.cs new file mode 100644 index 00000000..69b39e08 --- /dev/null +++ b/src/Mooege/Common/MPQ/SerializableData.cs @@ -0,0 +1,195 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using CrystalMpq; +using Gibbed.IO; + +namespace Mooege.Common.MPQ +{ + /// + /// Interface for serializable data structures. + /// + public interface ISerializableData + { + /// + /// Reads serializable type. + /// + /// The MPQFileStream to read from. + void Read(MpqFileStream stream); + } + + /// + /// Provides help function for reading serialized data from MpqFileStreams. + /// + public static class MpqFileStreamExtensions + { + private static Logging.Logger logger = new Logging.Logger("MPQ deserialization"); + + /// + /// Reads all available items for given type. + /// + /// Item type to read. + /// The MPQFileStream to read from. + /// List of items. + public static List ReadSerializedData(this MpqFileStream stream) where T : ISerializableData, new() + { + int offset = stream.ReadValueS32(); // ofset for serialized data. + int size = stream.ReadValueS32(); // size of serialized data. + + if (offset == 0 && size != 0) + logger.Error("Pointer error while deserializing list of {0}. Make sure you dont read too much or too few fields!", typeof(T).Name); + + var items = new List(); // read-items if any. + if (size <= 0 || offset == 0) return items; + + var oldPos = stream.Position; + stream.Position = offset + 16; // offset is relative to actual sno data start, so add that 16 bytes file header to get actual position. /raist + + while (stream.Position < offset + size + 16) + { + var t = new T(); + t.Read(stream); + items.Add(t); + } + + if (stream.Position != offset + size + 16) + logger.Error("Size mismatch while deserializing list of {0}. Make sure you dont read too much or too few fields!", typeof(T).Name); + + stream.Position = oldPos; + return items; + } + + /// + /// Reads a single serialized item for given type. Warning: Use with caution. + /// + /// Item type to read. + /// The MPQFileStream to read from. + /// The read item. + public static T ReadSerializedItem(this MpqFileStream stream) where T : ISerializableData, new() + { + int offset = stream.ReadValueS32(); // ofset for serialized data. + int size = stream.ReadValueS32(); // size of serialized data. + + var t = new T(); + if (size <= 0) return t; + + var oldPos = stream.Position; + stream.Position = offset + 16; // offset is relative to actual sno data start, so add that 16 bytes file header to get actual position. /raist + t.Read(stream); + + if (stream.Position != offset + size + 16) + logger.Error("Size mismatch while deserializing single item of {0}. Make sure you dont read too much or too few fields!", typeof(T).Name); + + stream.Position = oldPos; + return t; + } + + /// + /// Reads all available serialized ints. + /// + /// The MPQFileStream to read from. + /// The list of read ints. + public static List ReadSerializedInts(this MpqFileStream stream) + { + int offset = stream.ReadValueS32(); // ofset for serialized data. + int size = stream.ReadValueS32(); // size of serialized data. + + var items = new List(); // read-items if any. + if (size <= 0) return items; + + var oldPos = stream.Position; + stream.Position = offset + 16; // offset is relative to actual sno data start, so add that 16 bytes file header to get actual position. /raist + + while (stream.Position < offset + size + 16) + { + items.Add(stream.ReadValueS32()); + } + + stream.Position = oldPos; + return items; + } + + /// + /// Reads all available serialized shorts. + /// + /// The MPQFileStream to read from. + /// The list of read shorts. + public static List ReadSerializedShorts(this MpqFileStream stream) + { + int offset = stream.ReadValueS32(); // ofset for serialized data. + int size = stream.ReadValueS32(); // size of serialized data. + + var items = new List(); // read-items if any. + if (size <= 0) return items; + + var oldPos = stream.Position; + stream.Position = offset + 16; // offset is relative to actual sno data start, so add that 16 bytes file header to get actual position. /raist + + while (stream.Position < offset + size + 16) + { + items.Add(stream.ReadValueS16()); + } + + stream.Position = oldPos; + return items; + } + + /// + /// Reads a serialized byte array + /// + /// The MPQFileStream to read from. + /// The serialized byte array + public static byte[] ReadSerializedByteArray(this MpqFileStream stream) + { + int offset = stream.ReadValueS32(); // ofset for serialized data. + int size = stream.ReadValueS32(); // size of serialized data. + + byte[] buffer = new byte[size]; + if (size <= 0) return buffer; + + var oldPos = stream.Position; + stream.Position = offset + 16; // offset is relative to actual sno data start, so add that 16 bytes file header to get actual position. /raist + stream.Read(buffer, 0, size); + stream.Position = oldPos; + return buffer; + } + + /// + /// Reads a serialized string. + /// + /// The MPQFileStream to read from. + /// Read string. + public static string ReadSerializedString(this MpqFileStream stream) + { + int offset = stream.ReadValueS32(); // ofset for serialized data. + int size = stream.ReadValueS32(); // size of serialized data. + + var @string = string.Empty; + if (size <= 0) return @string; + + var oldPos = stream.Position; + stream.Position = offset + 16; // offset is relative to actual sno data start, so add that 16 bytes file header to get actual position. /raist + + @string = stream.ReadString((uint)size, true); + stream.Position = oldPos; + + return @string; + } + } +} diff --git a/src/Mooege/Common/Storage/AccountDataBase/Entities/DBAccount.cs b/src/Mooege/Common/Storage/AccountDataBase/Entities/DBAccount.cs new file mode 100644 index 00000000..839fbe8f --- /dev/null +++ b/src/Mooege/Common/Storage/AccountDataBase/Entities/DBAccount.cs @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using FluentNHibernate.Data; +using Mooege.Core.MooNet.Accounts; + +namespace Mooege.Common.Storage.AccountDataBase.Entities +{ + public class DBAccount : Entity + { + public DBAccount() + { + this.DBGameAccounts = new List(); + this.Friends = new List(); + } + + public virtual new ulong Id { get; protected set; } + public virtual string Email { get; set; } + public virtual byte[] Salt { get; set; } + public virtual byte[] PasswordVerifier { get; set; } + public virtual string BattleTagName { get; set; } + public virtual int HashCode { get; set; } + public virtual Account.UserLevels UserLevel { get; set; } + public virtual long LastOnline { get; set; } + public virtual IList DBGameAccounts { get; protected set; } + public virtual IList Friends { get; protected set; } + } +} diff --git a/src/Mooege/Common/Storage/AccountDataBase/Entities/DBActiveSkills.cs b/src/Mooege/Common/Storage/AccountDataBase/Entities/DBActiveSkills.cs new file mode 100644 index 00000000..ec63d7a1 --- /dev/null +++ b/src/Mooege/Common/Storage/AccountDataBase/Entities/DBActiveSkills.cs @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using FluentNHibernate.Data; + +namespace Mooege.Common.Storage.AccountDataBase.Entities +{ + public class DBActiveSkills : Entity + { + public virtual new ulong Id { get; protected set; } + public virtual DBToon DBToon { get; set; } + public virtual int Skill0 { get; set; } + public virtual int Rune0 { get; set; } + public virtual int Skill1 { get; set; } + public virtual int Rune1 { get; set; } + public virtual int Skill2 { get; set; } + public virtual int Rune2 { get; set; } + public virtual int Skill3 { get; set; } + public virtual int Rune3 { get; set; } + public virtual int Skill4 { get; set; } + public virtual int Rune4 { get; set; } + public virtual int Skill5 { get; set; } + public virtual int Rune5 { get; set; } + + public virtual int Passive0 { get; set; } + public virtual int Passive1 { get; set; } + public virtual int Passive2 { get; set; } + } +} diff --git a/src/Mooege/Common/Storage/AccountDataBase/Entities/DBGameAccount.cs b/src/Mooege/Common/Storage/AccountDataBase/Entities/DBGameAccount.cs new file mode 100644 index 00000000..faefdb54 --- /dev/null +++ b/src/Mooege/Common/Storage/AccountDataBase/Entities/DBGameAccount.cs @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using FluentNHibernate.Data; + +namespace Mooege.Common.Storage.AccountDataBase.Entities +{ + public class DBGameAccount : Entity + { + public DBGameAccount() + { + this.DBToons = new List(); + this.DBInventories = new List(); + } + public new virtual ulong Id { get; protected set; } + public virtual DBAccount DBAccount { get; set; } + public virtual byte[] Banner { get; set; } + public virtual long LastOnline { get; set; } + public virtual IList DBToons { get; protected set; } + public virtual IList DBInventories { get; protected set; } + public virtual DBToon LastPlayedHero { get; set; } + public virtual int Gold { get; set; } + public virtual int StashSize { get; set; } + } +} diff --git a/src/Mooege/Common/Storage/AccountDataBase/Entities/DBInventory.cs b/src/Mooege/Common/Storage/AccountDataBase/Entities/DBInventory.cs new file mode 100644 index 00000000..c4c67b51 --- /dev/null +++ b/src/Mooege/Common/Storage/AccountDataBase/Entities/DBInventory.cs @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using FluentNHibernate.Data; + +namespace Mooege.Common.Storage.AccountDataBase.Entities +{ + public class DBInventory : Entity + { + public new virtual ulong Id { get; set; } + public virtual DBGameAccount DBGameAccount { get; set; } + public virtual DBToon DBToon { get; set; } + public virtual int LocationX { get; set; } + public virtual int LocationY { get; set; } + public virtual int EquipmentSlot { get; set; } + //public virtual int ItemId { get; set; } + public virtual DBItemInstance DBItemInstance { get; set; } + + } +} diff --git a/src/Mooege/Common/Storage/AccountDataBase/Entities/DBItemInstance.cs b/src/Mooege/Common/Storage/AccountDataBase/Entities/DBItemInstance.cs new file mode 100644 index 00000000..ff452b79 --- /dev/null +++ b/src/Mooege/Common/Storage/AccountDataBase/Entities/DBItemInstance.cs @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using FluentNHibernate.Data; + +namespace Mooege.Common.Storage.AccountDataBase.Entities +{ + public class DBItemInstance : Entity + { + public new virtual ulong Id { get; set; } + public virtual int GbId { get; set; } + public virtual string Affixes { get; set; } + public virtual string Attributes { get; set; } + } +} diff --git a/src/Mooege/Common/Storage/AccountDataBase/Entities/DBToon.cs b/src/Mooege/Common/Storage/AccountDataBase/Entities/DBToon.cs new file mode 100644 index 00000000..53195413 --- /dev/null +++ b/src/Mooege/Common/Storage/AccountDataBase/Entities/DBToon.cs @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using FluentNHibernate.Data; +using Mooege.Core.MooNet.Toons; + +namespace Mooege.Common.Storage.AccountDataBase.Entities +{ + public class DBToon : Entity + { + public new virtual ulong Id { get; protected set; } + public virtual string Name { get; set; } + public virtual ToonClass Class { get; set; } + public virtual ToonFlags Flags { get; set; } + public virtual byte Level { get; set; } + public virtual int Experience { get; set; } + public virtual DBGameAccount DBGameAccount { get; set; } + public virtual uint TimePlayed { get; set; } + public virtual bool Deleted { get; set; } + + public virtual DBActiveSkills DBActiveSkills { get; set; } + } +} diff --git a/src/Mooege/Common/Storage/AccountDataBase/Mapper/DBAccountMapper.cs b/src/Mooege/Common/Storage/AccountDataBase/Mapper/DBAccountMapper.cs new file mode 100644 index 00000000..dcd5279e --- /dev/null +++ b/src/Mooege/Common/Storage/AccountDataBase/Mapper/DBAccountMapper.cs @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using FluentNHibernate.Mapping; +using Mooege.Common.Storage.AccountDataBase.Entities; + +namespace Mooege.Common.Storage.AccountDataBase.Mapper +{ + public class DBAccountMapper : ClassMap + { + public DBAccountMapper() + { + Id(e => e.Id).GeneratedBy.Native(); + Map(e => e.Email); + Map(e => e.Salt)/*.CustomSqlType("VarBinary(32)")*/.Length(32); + Map(e => e.PasswordVerifier)/*.CustomSqlType("VarBinary")*/.Length(128); + Map(e => e.BattleTagName); + Map(e => e.HashCode); + Map(e => e.UserLevel); + Map(e => e.LastOnline); + HasMany(e => e.DBGameAccounts).Cascade.All();//Cascade all means if this Account gets deleted/saved/update ALL GameAccounts do the same :) + HasManyToMany(e => e.Friends).ParentKeyColumn("AccountAId").ChildKeyColumn("AccountBId").Cascade.SaveUpdate(); + } + } +} diff --git a/src/Mooege/Common/Storage/AccountDataBase/Mapper/DBActiveSkillsMapper.cs b/src/Mooege/Common/Storage/AccountDataBase/Mapper/DBActiveSkillsMapper.cs new file mode 100644 index 00000000..2c50fd23 --- /dev/null +++ b/src/Mooege/Common/Storage/AccountDataBase/Mapper/DBActiveSkillsMapper.cs @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using FluentNHibernate.Mapping; +using Mooege.Common.Storage.AccountDataBase.Entities; + +namespace Mooege.Common.Storage.AccountDataBase.Mapper +{ + public class DBActiveSkillsMapper : ClassMap + { + public DBActiveSkillsMapper() + { + Id(e => e.Id).GeneratedBy.Native(); + HasOne(e => e.DBToon); + Map(e => e.Rune0); + Map(e => e.Skill0); + Map(e => e.Rune1); + Map(e => e.Skill1); + Map(e => e.Rune2); + Map(e => e.Skill2); + Map(e => e.Rune3); + Map(e => e.Skill3); + Map(e => e.Rune4); + Map(e => e.Skill4); + Map(e => e.Rune5); + Map(e => e.Skill5); + + Map(e => e.Passive0); + Map(e => e.Passive1); + Map(e => e.Passive2); + } + } +} diff --git a/src/Mooege/Common/Storage/AccountDataBase/Mapper/DBGameAccountMapper.cs b/src/Mooege/Common/Storage/AccountDataBase/Mapper/DBGameAccountMapper.cs new file mode 100644 index 00000000..958648eb --- /dev/null +++ b/src/Mooege/Common/Storage/AccountDataBase/Mapper/DBGameAccountMapper.cs @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using FluentNHibernate.Mapping; +using Mooege.Common.Storage.AccountDataBase.Entities; + +namespace Mooege.Common.Storage.AccountDataBase.Mapper +{ + public class DBGameAccountMapper : ClassMap + { + public DBGameAccountMapper() + { + Id(e => e.Id).GeneratedBy.Native(); + References(e => e.DBAccount); + Map(e => e.Banner).CustomSqlType("Blob"); + Map(e => e.LastOnline); + HasMany(e => e.DBToons).Cascade.All(); + HasMany(e => e.DBInventories).Cascade.All(); + References(e => e.LastPlayedHero).Nullable(); + Map(e => e.Gold); + Map(e => e.StashSize); + } + } +} diff --git a/src/Mooege/Common/Storage/AccountDataBase/Mapper/DBInventoryMapper.cs b/src/Mooege/Common/Storage/AccountDataBase/Mapper/DBInventoryMapper.cs new file mode 100644 index 00000000..31863a6f --- /dev/null +++ b/src/Mooege/Common/Storage/AccountDataBase/Mapper/DBInventoryMapper.cs @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using FluentNHibernate.Mapping; +using Mooege.Common.Storage.AccountDataBase.Entities; + +namespace Mooege.Common.Storage.AccountDataBase.Mapper +{ + public class DBInventoryMapper : ClassMap + { + public DBInventoryMapper() + { + Id(e => e.Id).GeneratedBy.Native(); + References(e => e.DBGameAccount).Nullable(); + References(e => e.DBToon).Nullable(); + Map(e => e.EquipmentSlot); + //Map(e => e.ItemId); + Map(e => e.LocationX); + Map(e => e.LocationY); + References(e => e.DBItemInstance).Not.Nullable(); + } + } +} diff --git a/src/Mooege/Common/Storage/AccountDataBase/Mapper/DBItemInstanceMapper.cs b/src/Mooege/Common/Storage/AccountDataBase/Mapper/DBItemInstanceMapper.cs new file mode 100644 index 00000000..58b4b702 --- /dev/null +++ b/src/Mooege/Common/Storage/AccountDataBase/Mapper/DBItemInstanceMapper.cs @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using FluentNHibernate.Mapping; +using Mooege.Common.Storage.AccountDataBase.Entities; + +namespace Mooege.Common.Storage.AccountDataBase.Mapper +{ + public class DBItemInstanceMapper : ClassMap + { + public DBItemInstanceMapper() + { + Id(e => e.Id).GeneratedBy.Native(); + Map(e => e.GbId); + Map(e => e.Affixes); + Map(e => e.Attributes); + } + } + +} diff --git a/src/Mooege/Common/Storage/AccountDataBase/Mapper/DBToonMapper.cs b/src/Mooege/Common/Storage/AccountDataBase/Mapper/DBToonMapper.cs new file mode 100644 index 00000000..649a74f8 --- /dev/null +++ b/src/Mooege/Common/Storage/AccountDataBase/Mapper/DBToonMapper.cs @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using FluentNHibernate.Mapping; +using Mooege.Common.Storage.AccountDataBase.Entities; + +namespace Mooege.Common.Storage.AccountDataBase.Mapper +{ + public class DBToonMapper : ClassMap + { + public DBToonMapper() + { + Id(e => e.Id).GeneratedBy.Native(); + Map(e => e.Class); + References(e => e.DBGameAccount); + Map(e => e.Deleted); + Map(e => e.Experience); + Map(e => e.Flags); + Map(e => e.Level); + Map(e => e.Name); + Map(e => e.TimePlayed); + + HasOne(e => e.DBActiveSkills).Cascade.All(); + } + } +} diff --git a/src/Mooege/Common/Storage/AccountDataBase/SessionProvider.cs b/src/Mooege/Common/Storage/AccountDataBase/SessionProvider.cs new file mode 100644 index 00000000..f10b2ea3 --- /dev/null +++ b/src/Mooege/Common/Storage/AccountDataBase/SessionProvider.cs @@ -0,0 +1,98 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using FluentNHibernate; +using FluentNHibernate.Cfg; +using Mooege.Common.Storage.AccountDataBase.Mapper; +using NHibernate; +using NHibernate.Cfg; +using NHibernate.Tool.hbm2ddl; +using Mooege.Common.Helpers.IO; + +namespace Mooege.Common.Storage.AccountDataBase +{ + public class SessionProvider + { + private static ISessionFactory _sessionFactory; + private static Configuration _config; + private static readonly object Lockobj = new object(); + public static ISessionFactory SessionFactory + { + get + { + lock (Lockobj) + { + return _sessionFactory ?? (_sessionFactory = CreateSessionFactory()); + } + } + } + + + public static Configuration Config + { + get + { + if (_config == null) + { + _config = new Configuration(); + _config = _config.Configure(Path.Combine(FileHelpers.AssemblyRoot, "database.Account.config")); + + + var replacedProperties = new Dictionary(); + foreach (var prop in _config.Properties) + { + var newvalue = prop.Value; + newvalue = newvalue.Replace("{$ASSETBASE}", DBManager.AssetDirectory); + replacedProperties.Add(prop.Key, newvalue); + } + + + _config = _config.SetProperties(replacedProperties); + _config = _config.AddMappingsFromAssembly(Assembly.GetAssembly(typeof(DBAccountMapper))); + if (_config.Properties.ContainsKey("dialect")) + if (_config.GetProperty("dialect").ToLower().Contains("sqlite")) + _config = _config.SetProperty("connection.release_mode", "on_close"); + } + + return _config; + } + } + + private static ISessionFactory CreateSessionFactory() + { + return Fluently.Configure(Config).ExposeConfiguration( + cfg => + new SchemaUpdate(cfg).Execute(true, true) + ). + BuildSessionFactory(); + } + + public static void RebuildSchema() + { + var schema = new SchemaUpdate(Config); + schema.Execute(true, true); + } + } +} + diff --git a/src/Mooege/Common/Storage/Config.cs b/src/Mooege/Common/Storage/Config.cs new file mode 100644 index 00000000..65e91b9d --- /dev/null +++ b/src/Mooege/Common/Storage/Config.cs @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace Mooege.Common.Storage +{ + public sealed class Config : Common.Config.Config + { + public string Root { get { return this.GetString("Root", "Assets"); } set { this.Set("Root", value); } } + public string MPQRoot { get { return this.GetString("MPQRoot", "Assets/MPQ"); } set { this.Set("MPQRoot", value); } } + public bool EnableTasks { get { return this.GetBoolean("EnableTasks", true); } set { this.Set("EnableTasks", value); } } + public bool LazyLoading { get { return this.GetBoolean("LazyLoading", false); } set { this.Set("LazyLoading", value); } } + + private static readonly Config _instance = new Config(); + public static Config Instance { get { return _instance; } } + private Config() : base("Storage") { } + } +} diff --git a/src/Mooege/Common/Storage/DBManager.cs b/src/Mooege/Common/Storage/DBManager.cs new file mode 100644 index 00000000..c210a33e --- /dev/null +++ b/src/Mooege/Common/Storage/DBManager.cs @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Data.SQLite; +using System.IO; +using Mooege.Common.Helpers.IO; +using Mooege.Common.Logging; + +namespace Mooege.Common.Storage +{ + // just a quick hack - not to be meant a final layer. + public static class DBManager + { + public static SQLiteConnection MPQMirror { get; private set; } + + public static readonly Logger Logger = LogManager.CreateLogger(); + + public static string AssetDirectory + { + get + { + var dataDirectory = String.Format(@"{0}/{1}", FileHelpers.AssemblyRoot, Config.Instance.Root); + + if (Path.IsPathRooted(Config.Instance.Root)) + //Path is rooted... dont use assemblyRoot, as its absolute path. + dataDirectory = Config.Instance.Root; + return dataDirectory; + } + } + + static DBManager() + { + Connect(); + } + + private static void Connect() + { + try + { + + MPQMirror = new SQLiteConnection(String.Format("Data Source={0}/mpqdata.db", AssetDirectory)); + MPQMirror.Open(); + } + catch (Exception e) + { + Logger.FatalException(e, "Connect()"); + } + } + } +} diff --git a/src/Mooege/Common/Storage/DBSessions.cs b/src/Mooege/Common/Storage/DBSessions.cs new file mode 100644 index 00000000..29ce607d --- /dev/null +++ b/src/Mooege/Common/Storage/DBSessions.cs @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Common.Storage.AccountDataBase.Entities; +using Mooege.Core.MooNet.Accounts; +using NHibernate; +using NHibernate.Linq; + +namespace Mooege.Common.Storage +{ + public static class DBSessions + { + private static Object _sessionLock = new object(); + private static ISession _accountSession = null; + + public static ISession AccountSession + { + get + { + lock (_sessionLock) + { + if (_accountSession == null || !_accountSession.IsOpen) + { + _accountSession = AccountDataBase.SessionProvider.SessionFactory.OpenSession(); + _accountSession.FlushMode = FlushMode.Always; + } + } + return _accountSession; + } + } + } +} diff --git a/src/Mooege/Common/Storage/PersistenceManager.cs b/src/Mooege/Common/Storage/PersistenceManager.cs new file mode 100644 index 00000000..695912fd --- /dev/null +++ b/src/Mooege/Common/Storage/PersistenceManager.cs @@ -0,0 +1,621 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Reflection; +using System.Data.SQLite; +using Mooege.Common.Storage; +using System.Collections.Generic; +using System.Collections; +using Mooege.Common.MPQ.FileFormats.Types; +using System.Linq; + +namespace Mooege.Common.Storage +{ + + /********************************************************************************************* + Table layout: + Class name -> Table name + Class.Property.Type -> Column name + + If the property is not a simple class (defined in System namespace), and there is a 1:1 + relation of Class and the Property, the Class is 'inlined' + + Class Foo + { + int Borks { get; set; } + Bar BarProperty { get; set; } + } + + Class Bar + { + int Barf { get; set; } + } + + Table FOO, Columns: Borks, BarProperty_Barf + + If the Property of the class is a generic list or dictionary, a MN Table with name + Type_PropertyType_InlinePrefix_PropertyName is created + + Dont know if that inling was such a good idea... + + + + Issues: + + - References are ignored... if two persistend properties point to the same object, they will not do after loading + - Circular references will cause stack overflows + - Dictionary can only use basic types as strings + - No dynamic arrays (except for bytes) + - No arrays of nonbasic classes (use lists instead) + **********************************************************************************************/ + + + + /// + /// This attribute is used to tag properties that are persisted by the persistance manager. + /// The class is mapped to a table with the same name as the class, and by default, each property is + /// mapped to a column with the same name as the property (property, not the type of the property...) + /// unless you override it by setting another name. To save and load arrays, you also have to define how + /// many elements the array has. + /// + public class PersistentPropertyAttribute : Attribute + { + public string Name { get; private set; } + public int Count { get; private set; } + + public PersistentPropertyAttribute(string name) { Name = name; Count = 1; } + public PersistentPropertyAttribute() { } + public PersistentPropertyAttribute(string name, int count) { Name = name; Count = count; } + } + + + /// + /// Loading classes from and saving classes to the mpq mirror database + /// + public class PersistenceManager + { + private class PersistentProperty + { + public static IEnumerable GetPersistentProperties(Type t, string hierarchy, Type parent) + { + foreach (var property in t.GetProperties(BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Public)) + { + if (property.GetCustomAttributes(typeof(PersistentPropertyAttribute), false).Length > 0) + { + yield return new PersistentProperty(property, hierarchy, parent); + } + } + } + + + private string hierarchy; + private Type parent; + + public PropertyInfo Property { get; private set; } + public string ColumnName { get; private set; } + public int ArrayCount { get; private set; } + public bool IsGenericList + { + get + { + return (Property.PropertyType.IsGenericType && Property.PropertyType.GetGenericTypeDefinition() == typeof(List<>)); + } + } + + public bool IsGenericDictionary + { + get + { + return (Property.PropertyType.IsGenericType && Property.PropertyType.GetGenericTypeDefinition() == typeof(Dictionary<,>)); + } + } + + public bool IsSimpleType + { + get + { + return Property.PropertyType.Namespace == "System" || Property.PropertyType.IsEnum; + } + } + + public bool IsInlinedType + { + get + { + return !(IsSimpleType || IsGenericDictionary || IsGenericList); + } + } + + public Type Type + { + get + { + return Property.PropertyType; + } + } + public String RelationTableName + { + get + { + return (parent == null ? Property.DeclaringType.Name : parent.Name) + "_" + ListType.Name + "_" + ColumnName; + } + } + + public Type ListType + { + get + { + if (IsGenericList) return Type.GetGenericArguments()[0]; + if (IsGenericDictionary) return Type.GetGenericArguments()[1]; + throw new Exception("Not a list"); + } + } + + public PersistentProperty(PropertyInfo p, string hierarchy, Type parent) + { + Property = p; + this.parent = parent; + PersistentPropertyAttribute pa = (PersistentPropertyAttribute)p.GetCustomAttributes(typeof(PersistentPropertyAttribute), false)[0]; + ColumnName = hierarchy + (pa.Name == null ? pa.Name : pa.Name); + ArrayCount = pa.Count; + this.hierarchy = hierarchy; + + if (Type.IsArray && ArrayCount == -1 && Type != typeof(byte[])) + throw new Exception(String.Format("Field {0} is a dynamic array. Dynamic Arrays are only supported for bytes. Use a generic list instead.", p.Name)); + } + } + + private static byte[] StringToByteArray(String hex) + { + int NumberChars = hex.Length; + byte[] bytes = new byte[NumberChars / 2]; + for (int i = 0; i < NumberChars; i += 2) + bytes[i / 2] = Convert.ToByte(hex.Substring(i, 2), 16); + return bytes; + } + + private static bool tableExists(string name) + { + using (var cmd = new SQLiteCommand(String.Format("SELECT name FROM sqlite_master WHERE type='table' AND name='{0}'", name), DBManager.MPQMirror)) + { + return (cmd.ExecuteScalar() != null); + } + } + + + #region Loading + + /// + /// Loads a persistent object from the database + /// + /// Type of the persisted object + /// Id of the persisted object + /// + public static object Load(Type type, string id) + { + var instance = Activator.CreateInstance(type); + LoadPartial(instance, id); + return instance; + } + + /// + /// Loads data from the database into an already existing object. This is mainly for mpq filetypes that are still loaded + /// from mpq but have some of their properties 'zeroed out' which are now loaded from the database + /// + /// Object with tagged properties that are to be loaded from database + /// The id of the corresponding entry in the database + public static void LoadPartial(object o, string id) + { + // load the entry and begin reading + if (tableExists(o.GetType().Name)) + { + using (var cmd = new SQLiteCommand(String.Format("SELECT * FROM {0} WHERE Id={1}", o.GetType().Name, id), DBManager.MPQMirror)) + { + var reader = cmd.ExecuteReader(); + if (reader.HasRows) + { + Load(o, null, reader); + } + } + } + } + + // statement used to query all list entries for a given property + // TODO first projection, then join... not the other way around + private static string genericListsql = "SELECT * FROM {0} JOIN {1} ON {0}.{1}Id = {1}.Id WHERE {2}Id = {3}"; + + /// + /// Loads properties of an object from the passed reader. For inlined properties, the parent reader is passed + /// + /// Object to be filled with data + /// Parent type that has the id for inlined classes + /// Reader from which to take the data + /// Prefix for 'inlined' properties (complex types) + private static void Load(object o, Type parent, SQLiteDataReader reader, string embeddedPrefix = "") + { + foreach (var property in PersistentProperty.GetPersistentProperties(o.GetType(), embeddedPrefix, parent)) + { + string entryId = reader["Id"].ToString(); + + // Load generic lists by finding the mn-mapping table and loading every entry recursivly + if (property.IsGenericList) + { + using (var cmd = new SQLiteCommand(String.Format(genericListsql, property.RelationTableName, property.ListType.Name, parent == null ? o.GetType().Name : parent.Name, entryId), DBManager.MPQMirror)) + { + var itemReader = cmd.ExecuteReader(); + var list = Activator.CreateInstance(property.Type); + + if (itemReader.HasRows) + { + while (itemReader.Read()) + { + var item = Activator.CreateInstance(property.ListType); + Load(item, null, itemReader); + (list as IList).Add(item); + } + } + property.Property.SetValue(o, list, null); + + } + continue; + } + + // Load generic dictionaires by finding the mn-mapping table and loading every entry recursivly + if (property.IsGenericDictionary) + { + using (var cmd = new SQLiteCommand(String.Format(genericListsql, property.RelationTableName, property.ListType.Name, parent == null ? o.GetType().Name : parent.Name, entryId), DBManager.MPQMirror)) + { + var itemReader = cmd.ExecuteReader(); + var dictionary = Activator.CreateInstance(property.Type); + + if (itemReader.HasRows) + { + while (itemReader.Read()) + { + var item = Activator.CreateInstance(property.ListType); + Load(item, null, itemReader); + (dictionary as IDictionary).Add(Convert.ChangeType(itemReader["Key"], property.Type.GetGenericArguments()[0]), item); + } + } + property.Property.SetValue(o, dictionary, null); + + } + continue; + } + + // load scalar types + if (property.Type.Namespace == "System") + { + // load array of scalar types. The column name of the i-th array entry is "columnName_i" + if (property.Type.IsArray) + { + if (property.ArrayCount == -1) + { + byte[] blob = StringToByteArray(reader[property.ColumnName].ToString().Replace("-", "")); + property.Property.SetValue(o, blob, null); + } + else + { + Array vals = (Array)Activator.CreateInstance(property.Type, property.ArrayCount); + for (int i = 0; i < vals.Length; i++) + { + vals.SetValue(Convert.ChangeType(reader[property.ColumnName + "_" + i.ToString()], property.Type.GetElementType()), i); + } + + property.Property.SetValue(o, vals, null); + } + } + else + { + property.Property.SetValue(o, Convert.ChangeType(reader[property.ColumnName], property.Type), null); + } + continue; + } + + // load enums + if (property.Type.IsEnum) + { + property.Property.SetValue(o, Enum.Parse(property.Type, reader[property.ColumnName].ToString(), true), null); + continue; + } + + // if its none of the earlier types, its a inlined class. class properties + if (Convert.ToBoolean(reader[property.ColumnName + "_"])) + { + var embedded = Activator.CreateInstance(property.Type); + Load(embedded, o.GetType(), reader, property.ColumnName + "_"); + property.Property.SetValue(o, embedded, null); + } + } + } + + #endregion + + #region Table creation + + private static void CreateTableForType(Type type, Type parent, Dictionary values, string embeddedPrefix = "") + { + // Save all scalar and inline types first, so we have the new entry id for our mn-table later + foreach (var property in PersistentProperty.GetPersistentProperties(type, embeddedPrefix, parent)) + { + if (property.IsSimpleType) + { + // save array of basic types + if (property.Type.IsArray && property.ArrayCount != -1) + { + for (int i = 0; i < property.ArrayCount; i++) + { + values.Add(property.ColumnName + "_" + i, property.Property.PropertyType); + } + } + else + { + values.Add(property.ColumnName, property.Type); + } + continue; + } + + if (property.IsGenericList || property.IsGenericDictionary) + { + string query = ""; + + if (property.IsGenericList) + { + query = "CREATE TABLE {0} ({1}Id NUMERIC, {2}Id NUMERIC)"; + } + + if (property.IsGenericDictionary) + { + query = "CREATE TABLE {0} ({1}Id NUMERIC, {2}Id NUMERIC, Key TEXT)"; + } + + query = String.Format(query, property.RelationTableName, parent == null ? type.Name : parent.Name, property.ListType.Name); + + using (var cmd = new SQLiteCommand(query, DBManager.MPQMirror)) + { + cmd.ExecuteNonQuery(); + } + + CreateTableForType(property.ListType, null, new Dictionary()); + continue; + } + + values.Add(property.ColumnName + "_", typeof(string)); + CreateTableForType(property.Type, parent == null ? type : parent, values, property.ColumnName + "_"); + } + + // Only create tables for parent classes + if (parent == null && !tableExists(type.Name)) + { + if (type.Namespace == "System") + { + values.Add("Value", typeof(string)); + } + + var columnDefinitions = values.Select(v => v.Key + " " + ((v.Value == typeof(String) || v.Value == typeof(byte[])) ? "TEXT" : "NUMERIC")).ToList(); + columnDefinitions.Add("Id INTEGER PRIMARY KEY"); + var tableDefinition = String.Join(",", columnDefinitions.ToArray()); + + using (var cmd = new SQLiteCommand(String.Format("CREATE TABLE {0} ({1})", type.Name, tableDefinition), DBManager.MPQMirror)) + { + cmd.ExecuteNonQuery(); + } + } + } + + #endregion + + #region Saving + + /// + /// Saves an object in the database. Use this for objects that are read from mpq + /// + /// Object to save + /// Id of the object + public static void SavePartial(object o, string id) + { + if (!tableExists(o.GetType().Name)) + { + CreateTableForType(o.GetType(), null, new Dictionary()); + } + + Save(o, id, new Dictionary()); + } + + /// + /// Saves an asset in the database and creates an entry in the db table of contents. Use + /// this for assets completly load from the database. + /// + /// Object to save + /// Descriptive name of the asset + /// Id to identify the object with or null to create a new id + public static void Save(object o, string name, string id = null) + { + if (!tableExists(o.GetType().Name)) + { + CreateTableForType(o.GetType(), null, new Dictionary()); + } + + id = Save(o, id, new Dictionary()); + + using (var cmd = new SQLiteCommand(String.Format("INSERT INTO TOC (SNOGroup, SNOId, Name) VALUES ('{0}', '{1}', '{2}')", o.GetType().Name, id, name), DBManager.MPQMirror)) + { + cmd.ExecuteNonQuery(); + } + } + + private static string Save(object o, string id, Dictionary values, string embeddedPrefix = "") + { + id = SaveBasic(o, null, id, values, embeddedPrefix); + SaveEnumerations(o, null, id, embeddedPrefix); + return id; + } + + /// + /// Save object with all inlined classes to table + /// + /// Object to save + /// Parent type (Type of outmost, not inlined object) + /// Id to use to save or null to create a new + /// Dictionary in wich inlined classes write their property values + /// Prefix to use in inlined classes so all inlined properties have unique column names + /// Id used to save the object + private static string SaveBasic(object o, Type parent, string id, Dictionary values, string embeddedPrefix = "") + { + if (o == null) return ""; + + // save scalar types + if (o.GetType().Namespace != "System" && !o.GetType().IsEnum) + { + + // Save all scalar and inline types first, so we have the new entry id for our mn-table later + foreach (var property in PersistentProperty.GetPersistentProperties(o.GetType(), embeddedPrefix, parent)) + { + if (property.IsSimpleType) + { + if (property.Type.IsArray) + { + if (property.ArrayCount == -1) + { + values.Add(property.ColumnName, "'" + BitConverter.ToString((byte[])property.Property.GetValue(o, null)) + "'"); + } + else + { + for (int i = 0; i < property.ArrayCount; i++) + { + values.Add(property.ColumnName + "_" + i, "'" + (property.Property.GetValue(o, null) as Array).GetValue(i).ToString() + "'"); + } + } + } + else + { + values.Add(property.ColumnName, "'" + property.Property.GetValue(o, null).ToString() + "'"); + } + } + + // save complex object as inlined class + if (property.IsInlinedType) + { + values.Add(property.ColumnName + "_", "'" + (property.Property.GetValue(o, null) != null).ToString() + "'"); + SaveBasic(property.Property.GetValue(o, null), parent == null ? o.GetType() : parent, id, values, property.ColumnName + "_"); + } + } + + } + else + { + values.Add("Value", o.ToString()); + } + + // No parent means this class is not inlined. Add a new entry with all saved values in the class table + if (parent == null) + { + + if (id != null) + { + values.Add("Id", id); + } + + string cnames = String.Join(",", (new List(values.Keys).ToArray())); + string cvalues = String.Join(",", (new List(values.Values).ToArray())); + + using (var cmd = new SQLiteCommand(String.Format("INSERT INTO {0} ({1}) VALUES ({2})", o.GetType().Name, cnames, cvalues), DBManager.MPQMirror)) + { + cmd.ExecuteNonQuery(); + + using (var last = new SQLiteCommand("SELECT last_insert_rowid()", DBManager.MPQMirror)) + { + id = last.ExecuteScalar().ToString(); + } + } + } + + return id; + } + + /// + /// Saves all generic lists and dictionaries of the object and all inlined classes. The object already has to have an id! + /// + /// Object of which to save lists and dictionaries + /// Parent (not inlined) Type + /// Id of the object + /// Prefix used to create unique mn table names for all inlined lists and dictionaries + private static void SaveEnumerations(object o, Type parent, string id, string embeddedPrefix = "") + { + if (o == null) return; + + // Save all scalar and inline types first, so we have the new entry id for our mn-table later + foreach (var property in PersistentProperty.GetPersistentProperties(o.GetType(), embeddedPrefix, parent)) + { + if (property.IsInlinedType) + { + SaveEnumerations(property.Property.GetValue(o, null), parent == null ? o.GetType() : parent, id, property.ColumnName + "_"); + } + + if (property.IsGenericList) + { + IList list = (IList)property.Property.GetValue(o, null); + + foreach (var item in list) + { + string newId = Save(item, null, new Dictionary(), ""); + + using (var cmd = new SQLiteCommand(String.Format( + "INSERT INTO {4} ({0}Id, {1}Id) VALUES ({2}, {3})", + parent == null ? o.GetType().Name : parent.Name, + property.ListType.Name, + id, + newId, + property.RelationTableName + ), DBManager.MPQMirror)) + { + cmd.ExecuteNonQuery(); + } + } + } + + if (property.IsGenericDictionary) + { + IDictionary dictionary = (IDictionary)property.Property.GetValue(o, null); + + foreach (var item in dictionary.Keys) + { + string newId = Save(dictionary[item], null, new Dictionary(), ""); + + using (var cmd = new SQLiteCommand(String.Format( + "INSERT INTO {4} ({0}Id, {1}Id, Key) VALUES ({2}, {3}, {5})", + parent == null ? o.GetType().Name : parent.Name, + property.ListType.Name, + id, + newId, + property.RelationTableName, + item + ), DBManager.MPQMirror)) + { + cmd.ExecuteNonQuery(); + } + } + } + + } + } + + #endregion + } +} \ No newline at end of file diff --git a/src/Mooege/Common/Versions/VersionInfo.cs b/src/Mooege/Common/Versions/VersionInfo.cs new file mode 100644 index 00000000..219ec404 --- /dev/null +++ b/src/Mooege/Common/Versions/VersionInfo.cs @@ -0,0 +1,218 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using Mooege.Common.Extensions; +using Mooege.Net.MooNet; + +namespace Mooege.Common.Versions +{ + /// + /// Supported Versions Info. + /// + /// Put anything related to versions here. + public static class VersionInfo + { + /// + /// Main assembly versions info. + /// + public static class Assembly + { + /// + /// Main assemblies version. + /// + public const string Version = "1.10057.*"; + } + + /// + /// MooNet versions info. + /// + public static class MooNet + { + /// + /// Required client version. + /// + public const int RequiredClientVersion = 10057; + + public static Dictionary ClientVersionMaps = new Dictionary + { + {"Aurora ab0ebd5e2c_public", 10057}, + {"Aurora 24e2d13e54_public", 9991}, + {"Aurora 79fef7ae8e_public", 9950}, // also 9858 + {"Aurora 8018401a9c_public", 9749}, + {"Aurora 31c8df955a_public", 9558}, + {"Aurora 8eac7d44dc_public", 9359}, // also 9327 + {"Aurora _public", 9183}, + {"Aurora bcd3e50524_public", 8896}, + {"Aurora 4a39a60e1b_public", 8815}, + {"Aurora 7f06f1aabd_public", 8610}, + {"Aurora 9e9ccb8fdf_public", 8392}, + {"Aurora f506438e8d_public", 8101}, + {"Aurora fbb3e7d1b4_public", 8059}, + {"Aurora 04768e5dce_public", 7931}, + {"Aurora 0ee3b2e0e2_public", 7841}, + {"Aurora b4367eba86_public", 7728} + }; + + /// + /// Auth modules' hash maps for client platforms. + /// + //TODO: Get Hashes for Mac client. + public static Dictionary PasswordHashMap = new Dictionary() + { + { MooNetClient.ClientPlatform.Win,"8F52906A2C85B416A595702251570F96D3522F39237603115F2F1AB24962043C".ToByteArray() }, + { MooNetClient.ClientPlatform.Mac,"63BC118937E6EA2FAA7B7192676DAEB1B7CA87A9C24ED9F5ACD60E630B4DD7A4".ToByteArray() } + }; + + public static Dictionary ThumbprintHashMap = new Dictionary() + { + { MooNetClient.ClientPlatform.Win,"36b27cd911b33c61730a8b82c8b2495fd16e8024fc3b2dde08861c77a852941c".ToByteArray() }, + { MooNetClient.ClientPlatform.Mac,"36b27cd911b33c61730a8b82c8b2495fd16e8024fc3b2dde08861c77a852941c".ToByteArray() }, + }; + + public static Dictionary TokenHashMap = new Dictionary() + { + { MooNetClient.ClientPlatform.Win,"bfa574bcff509b3c92f7c4b25b2dc2d1decb962209f8c9c8582ddf4f26aac176".ToByteArray() }, + { MooNetClient.ClientPlatform.Mac,"bfa574bcff509b3c92f7c4b25b2dc2d1decb962209f8c9c8582ddf4f26aac176".ToByteArray() }, + }; + + public static Dictionary RiskFingerprintHashMap = new Dictionary() + { + { MooNetClient.ClientPlatform.Win,"bcfa324ab555fc66614976011d018d2be2b9dc23d0b54d94a3bd7d12472aa107".ToByteArray() }, + { MooNetClient.ClientPlatform.Mac,"bcfa324ab555fc66614976011d018d2be2b9dc23d0b54d94a3bd7d12472aa107".ToByteArray() }, + }; + + public static Dictionary AgreementHashMap = new Dictionary() + { + { MooNetClient.ClientPlatform.Win,"41686a009b345b9cbe622ded9c669373950a2969411012a12f7eaac7ea9826ed".ToByteArray() }, + { MooNetClient.ClientPlatform.Mac,"41686a009b345b9cbe622ded9c669373950a2969411012a12f7eaac7ea9826ed".ToByteArray() }, + }; + + public static byte[] TOS = "00736F74006167726500005553014970E37CCD158A64A2844D6D4C05FC1697988A617E049BB2E0407D71B6C6F2".ToByteArray(); + public static byte[] EULA = "00616C75656167726500005553DDD1D77970291A4E8A64BB4FE25B2EA2D69D8915D35D53679AE9FDE5EAE47ECC".ToByteArray(); + public static byte[] RMAH = "0068616D72616772650000555398A3FC047004D6D4A0A1519A874AC9B1FC5FBD62C3EAA23188E095D6793537D7".ToByteArray(); + + public static Dictionary Regions = new Dictionary() + { + { "US", 0x5553 }, + { "XX", 0x5858 }, //Beta Region + }; + + public static string Region = "US"; + + public static class Resources + { + public static string ProfanityFilterHash = "de1862793fdbabb6eb1edec6ad1c95dd99e2fd3fc6ca730ab95091d694318a24"; //9558-10057 + public static string AvailableActs = "bd9e8fc323fe1dbc1ef2e0e95e46355953040488621933d0685feba5e1163a25"; //10057 + public static string AvailableQuests = "9303df8f917e2db14ec20724c04ea5d2af4e4cb6c72606b67a262178b7e18104"; //10057 + + //public static string AvailableActs = "89dd44c90f3b7dca32bd7a289d5c09b253c1398b81e7dbf860cd5e635cb4a763"; //8815 + //public static string AvailableQuests = "e2aeeb41ad31eadd710f7e3729411b249195123d0a804a1b3bf18883f9011b04"; //8815 + //public static string ProfanityFilterHash = "068fec3c7426b8ba9497225a73437c6dffaa92de962c2b05589b5f46fbe5f5b0"; //8815 + //public static string ProfanityFilterHash = "1d9bdf93a409c93cd82a49670deccb36eca150c3f22ab2741666524a7368eb94"; //8896 + } + + public static class Achievements + { + /// + /// AchievementFile hash. + /// + //public static string AchievementFileHash = "9c1b0943a8e68352bb60ec872f35c645036feaabaac92ea13bee8b2f1dc9c5b9"; //8610 + //public static string AchievementFileHash = "ef29e59b9394e7c6f694afbb92b70a74c4fd4c96961a8ec490e770371b72e6ab"; // ?? + //public static string AchievementFileHash = "0b61aeee74bba6ba02b93c9e15089404daf5d3cd1c7e631d7c108685894b3feb"; //8101 + //public static string AchievementFileHash = "c06c3a43f760b9ef2c7965ac229531d17e93279cd2666bf1b9f130b8db5cb2f9"; //8296,8815 + //public static string AchievementFileHash = "99b7ccad605818c95e965b21ce3bf35b8406202ea616f54705c4ebaf45c4c7f2"; //8896 + //public static string AchievementFileHash = "e3440d1a1430864371175afabb81e0b124c2824ea93def5d994cf8250cc1082b"; //9558 + public static string AchievementFileHash = "f0a945924510ece166812b241bd0724af5d0f1569e72430a67b46518fee37fb3"; //10057 + + /// + /// AchievementFile filename. + /// + public static string AchievementFilename = AchievementFileHash + ".achu"; + + /// + /// AchievementFile download URL. + /// + public static string AchievementURL = "http://" + MooNet.Region + ".depot.battle.net:1119/" + AchievementFilename; + + } + } + + /// + /// MPQ storage versions info. + /// + public static class MPQ + { + /// + /// Required MPQ patch version. + /// + public const int RequiredPatchVersion = 10057; + } + + /// + /// Ingame connection & client versions info. + /// + public static class Ingame + { + /// + /// Ingame protocol hash. + /// + public const int ProtocolHash = unchecked((int)0xFDD6012B); //10057 + + // old hashes + //unchecked((int)0xFDD6012B) // 10057 + // 0x33CABB38 // 9183, 9327, 9359, 9749, 9858, 9950, 9991 + // unchecked((int)0x9726E2E3) // 8896 + // 0x375AE194 // 8815 + // unchecked((int)0xA8F17EC5) // 8610 + // 0x01A64B41 // 8296, 8350, 8392 + // 0xBA957E6B // 8059, 8101 + // unchecked((int)0x208CA037) // 7931 + // unchecked((int)0x208CA037) // 7841 + // unchecked((int)0x9E121BBD) // 7728 + // 0x21EEE08D // 7446 + + //This is the server version sent in VersionsMessage + public const string MajorVersion = "1.0.3"; + public const string ServerBuild = "10182"; + public const string VersionString = MajorVersion + "." + ServerBuild; + + // old version strings. + // 1.0.2.9950 // 9950 Retail + // 1.0.2.9858 // 9858 Retail + // 1.0.2.9749 // 9749 Retail + // 1.0.1.9558 // 9558 Retail + // 0.11.0.9359 // 9359 Beta Patch 18 + // 0.11.0.9327 // 9327 Beta Patch 17 + // 0.10.0.9236 // 9183 Beta Patch 16 + // 0.9.0.8922 // 8896 Beta Patch 15 + // 0.8.0.8834 // 8815 Beta Patch 14 + // 0.7.0.8619 // 8610 Beta Patch 13 + // 0.6.2.8392 // 8392 Beta Patch 12 + // 0.6.1.8350 // 8350 Beta Patch 11 + // 0.6.0.8318 // 8296 Beta Patch 10 + // 0.5.1.8115 // 8101 Beta Patch 9 + // 0.5.0.8059 // 8059 Beta Patch 8 + // ?? // 7931 Beta Patch 7 + // ?? // 7841 Beta Patch 6 + // 0.3.1.7779 // 7728 Beta Patch 5 + // 0.3.0.7484 // 7447 Beta Patch 4 + // 0.3.0.7333 // 7733 Beta Patch 3 + } + } +} \ No newline at end of file diff --git a/src/Mooege/Core/Cryptography/ARC4.cs b/src/Mooege/Core/Cryptography/ARC4.cs new file mode 100644 index 00000000..eee91478 --- /dev/null +++ b/src/Mooege/Core/Cryptography/ARC4.cs @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +// Contains code from: https://wcell.svn.codeplex.com/svn/wcell/Services/WCell.RealmServer/Network/RealmClient.cs + +namespace Mooege.Core.Cryptography +{ + public class ARC4 + { + private readonly byte[] _state; + private byte x, y; + + public ARC4(byte[] key) + { + _state = new byte[256]; + x = y = 0; + KeySetup(key); + } + + public int Process(byte[] buffer, int start, int count) + { + return InternalTransformBlock(buffer, start, count, buffer, start); + } + + private void KeySetup(byte[] key) + { + byte index1 = 0; + byte index2 = 0; + + for (int counter = 0; counter < 256; counter++) + { + _state[counter] = (byte)counter; + } + x = 0; + y = 0; + for (int counter = 0; counter < 256; counter++) + { + index2 = (byte)(key[index1] + _state[counter] + index2); + // swap byte + byte tmp = _state[counter]; + _state[counter] = _state[index2]; + _state[index2] = tmp; + index1 = (byte)((index1 + 1) % key.Length); + } + } + + private int InternalTransformBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset) + { + for (int counter = 0; counter < inputCount; counter++) + { + x = (byte)(x + 1); + y = (byte)(_state[x] + y); + // swap byte + byte tmp = _state[x]; + _state[x] = _state[y]; + _state[y] = tmp; + + byte xorIndex = (byte)(_state[x] + _state[y]); + outputBuffer[outputOffset + counter] = (byte)(inputBuffer[inputOffset + counter] ^ _state[xorIndex]); + } + return inputCount; + } + } +} diff --git a/src/Mooege/Core/Cryptography/SRP6a.cs b/src/Mooege/Core/Cryptography/SRP6a.cs new file mode 100644 index 00000000..6f744c54 --- /dev/null +++ b/src/Mooege/Core/Cryptography/SRP6a.cs @@ -0,0 +1,292 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Linq; +using System.Numerics; +using System.Security.Cryptography; +using System.Text; +using Mooege.Common.Extensions; +using Mooege.Core.MooNet.Accounts; + +namespace Mooege.Core.Cryptography +{ + /// + /// SRP6-a implementation. + /// + public class SRP6a + { + // The following is a description of SRP-6 and 6a, the latest versions of SRP: + // --------------------------------------------------------------------------- + // N A large safe prime (N = 2q+1, where q is prime) + // All arithmetic is done modulo N. + // g A generator modulo N + // k Multiplier parameter (k = H(N, g) in SRP-6a, k = 3 for legacy SRP-6) + // s User's salt + // I Username + // p Cleartext Password + // H() One-way hash function + // ^ (Modular) Exponentiation + // u Random scrambling parameter + // a,b Secret ephemeral values + // A,B Public ephemeral values + // x Private key (derived from p and s) + // v Password verifier + // --------------------------------------------------------------------------- + // specification: http://srp.stanford.edu/design.html + // article: http://en.wikipedia.org/wiki/Secure_Remote_Password_protocol + // contains code from tomrus88 (https://github.com/tomrus88/d3proto/blob/master/Core/SRP.cs + + private static readonly SHA256Managed H = new SHA256Managed(); // H() One-way hash function. + + /// + /// Account used within SRP6-a authentication. + /// + public Account Account { get; private set; } + + /// + /// Identity salt that's hashed using account email. + /// + public string IdentitySalt { get; private set; } + + /// + /// K = H(S) - Shared, strong session key. + /// + public byte[] SessionKey { get; private set; } + + /// + /// Server's secret ephemeral value. + /// + private readonly BigInteger b; + + /// + /// Server's public ephemeral value + /// + private readonly BigInteger B; + + /// + /// Returns server's logon challenge message. + /// command = 0 + /// byte identity salt [32]; - identity-salt - generated by hashing account email [static value per account] (skipped when command == 1) + /// byte password salt[32]; - account-salt - generated on account creation [static value per account] + /// byte serverChallenge[128]; - changes every login - server's public ephemeral value (B) + /// byte secondChallenge[128]; - extra challenge + /// + public byte[] LogonChallenge { get; private set; } + + /// + /// Returns logon proof. + /// command == 3 - server sends proof of session key to client + /// byte M_server[32] - server's proof of session key. + /// byte secondProof[128]; // for veriyfing second challenge. + /// + public byte[] LogonProof { get; private set; } + + public SRP6a(Account account) + { + this.Account = account; + this.IdentitySalt = H.ComputeHash(Encoding.ASCII.GetBytes(this.Account.Email)).ToHexString(); // Identity salt that's hashed using account email. + + // calculate server's public ephemeral value. + this.b = GetRandomBytes(128).ToBigInteger(); // server's secret ephemeral value. + var gModb = BigInteger.ModPow(g, b, N); // pow(g, b, N) + var k = H.ComputeHash(new byte[0].Concat(N.ToArray()).Concat(g.ToArray()).ToArray()).ToBigInteger(); // Multiplier parameter (k = H(N, g) in SRP-6a + this.B = BigInteger.Remainder((this.Account.PasswordVerifier.ToBigInteger() * k) + gModb, N); // B = (k * v + pow(g, b, N)) % N + + // cook the logon challenge message + this.LogonChallenge = new byte[0] + .Concat(new byte[] { 0 }) // command = 0 + .Concat(this.IdentitySalt.ToByteArray()) // identity-salt - generated by hashing account email. + .Concat(this.Account.Salt) // account-salt - generated on account creation. + .Concat(B.ToArray(128)) // server's public ephemeral value (B) + .Concat(SecondChallenge.ToArray(128)) // second challenge + .ToArray(); + } + + /// + /// Calculates password verifier for given email, password and salt. + /// + /// The account email. + /// The password. + /// The generated salt. + /// + public static byte[] CalculatePasswordVerifierForAccount(string email, string password, byte[] salt) + { + // x = H(s, p) -> s: randomly choosen salt + // v = g^x (computes password verifier) + + // TODO: it seems hashing identity-salt + password bugs for passwords with >11 chars or so. + // we need to get rid of that identity-salt in pBytes /raist. + + var identitySalt = H.ComputeHash(Encoding.ASCII.GetBytes(email)).ToHexString(); // Identity salt that's hashed using account email. + var pBytes = H.ComputeHash(Encoding.ASCII.GetBytes(identitySalt.ToUpper() + ":" + password.ToUpper())); // p (identitySalt + password) + var x = H.ComputeHash(new byte[0].Concat(salt).Concat(pBytes).ToArray()).ToBigInteger(); // x = H(s, p) + + return BigInteger.ModPow(g, x, N).ToArray(128); + } + + /// + /// Verifies the account using srp6a session provided values by client. + /// + /// Client's public ephemeral + /// Client M. + /// Session seed. + /// + public bool Verify(byte[] A_bytes, byte[] M_client, byte[] seed) + { + var A = A_bytes.ToBigInteger(); // client's public ephemeral + var u = H.ComputeHash(new byte[0].Concat(A_bytes).Concat(B.ToArray(128)).ToArray()).ToBigInteger(); // Random scrambling parameter - u = H(A, B) + + var S_s = BigInteger.ModPow(A * BigInteger.ModPow(this.Account.PasswordVerifier.ToBigInteger(), u, N), b, N); // calculate server session key - S = (Av^u) ^ b + this.SessionKey = Calc_K(S_s.ToArray(128)); // K = H(S) - Shared, strong session key. + byte[] K_s = this.SessionKey; + + var hashgxorhashN = Hash_g_and_N_and_xor_them().ToBigInteger(); // H(N) ^ H(g) + var hashedIdentitySalt = H.ComputeHash(Encoding.ASCII.GetBytes(this.IdentitySalt)); // H(I) + + var M = H.ComputeHash(new byte[0] // verify client M_client - H(H(N) ^ H(g), H(I), s, A, B, K_c) + .Concat(hashgxorhashN.ToArray(32)) + .Concat(hashedIdentitySalt) + .Concat(this.Account.Salt.ToArray()) + .Concat(A_bytes) + .Concat(B.ToArray(128)) + .Concat(K_s) + .ToArray()); + + // We can basically move m_server, secondproof and logonproof calculation behind the M.CompareTo(M_client) check, but as we have an option DisablePasswordChecks + // which allows authentication without the correct password, they should be also calculated for wrong-passsword auths. /raist. + + // calculate server proof of session key + var M_server = H.ComputeHash(new byte[0] // M_server = H(A, M_client, K) + .Concat(A_bytes) + .Concat(M_client) + .Concat(K_s) + .ToArray()); + + var secondProof = GetSecondProof(Encoding.ASCII.GetBytes(this.Account.Email), seed, SecondChallenge.ToArray()); + + // cook logon proof message. + LogonProof = new byte[0] + .Concat(new byte[] { 3 }) // command = 3 - server sends proof of session key to client + .Concat(M_server) // server's proof of session key + .Concat(secondProof.ToArray(128)) // second proof + .ToArray(); + + if (M.CompareTo(M_client)) // successful authentication session. + return true; + else // authentication failed because of invalid credentals. + return false; + } + + public static byte[] GetRandomBytes(int count) + { + var rnd = new Random(); + var result = new byte[count]; + rnd.NextBytes(result); + return result; + } + + // Interleave SHA256 Key + private byte[] Calc_K(byte[] S) + { + var K = new byte[64]; + + var half_S = new byte[64]; + + for (int i = 0; i < 64; ++i) + half_S[i] = S[i * 2]; + + var p1 = H.ComputeHash(half_S); + + for (int i = 0; i < 32; ++i) + K[i * 2] = p1[i]; + + for (int i = 0; i < 64; ++i) + half_S[i] = S[i * 2 + 1]; + + var p2 = H.ComputeHash(half_S); + + for (int i = 0; i < 32; ++i) + K[i * 2 + 1] = p2[i]; + + return K; + } + + /// + /// H(N) ^ H(g) + /// + /// byte[] + private byte[] Hash_g_and_N_and_xor_them() + { + var hash_N = H.ComputeHash(N.ToArray()); + var hash_g = H.ComputeHash(g.ToArray()); + + for (var i = 0; i < 32; ++i) + hash_N[i] ^= hash_g[i]; + + return hash_N; + } + + /// + /// A generator modulo N + /// + private static readonly BigInteger g = new byte[] { 0x02 }.ToBigInteger(); + + /// + /// A large safe prime (N = 2q+1, where q is prime) + /// + private static readonly BigInteger N = new byte[] + { + 0xAB, 0x24, 0x43, 0x63, 0xA9, 0xC2, 0xA6, 0xC3, 0x3B, 0x37, 0xE4, 0x61, 0x84, 0x25, 0x9F, 0x8B, + 0x3F, 0xCB, 0x8A, 0x85, 0x27, 0xFC, 0x3D, 0x87, 0xBE, 0xA0, 0x54, 0xD2, 0x38, 0x5D, 0x12, 0xB7, + 0x61, 0x44, 0x2E, 0x83, 0xFA, 0xC2, 0x21, 0xD9, 0x10, 0x9F, 0xC1, 0x9F, 0xEA, 0x50, 0xE3, 0x09, + 0xA6, 0xE5, 0x5E, 0x23, 0xA7, 0x77, 0xEB, 0x00, 0xC7, 0xBA, 0xBF, 0xF8, 0x55, 0x8A, 0x0E, 0x80, + 0x2B, 0x14, 0x1A, 0xA2, 0xD4, 0x43, 0xA9, 0xD4, 0xAF, 0xAD, 0xB5, 0xE1, 0xF5, 0xAC, 0xA6, 0x13, + 0x1C, 0x69, 0x78, 0x64, 0x0B, 0x7B, 0xAF, 0x9C, 0xC5, 0x50, 0x31, 0x8A, 0x23, 0x08, 0x01, 0xA1, + 0xF5, 0xFE, 0x31, 0x32, 0x7F, 0xE2, 0x05, 0x82, 0xD6, 0x0B, 0xED, 0x4D, 0x55, 0x32, 0x41, 0x94, + 0x29, 0x6F, 0x55, 0x7D, 0xE3, 0x0F, 0x77, 0x19, 0xE5, 0x6C, 0x30, 0xEB, 0xDE, 0xF6, 0xA7, 0x86 + }.ToBigInteger(); + + + private static readonly BigInteger SecondChallenge = new byte[] + { + 0x5B, 0xE8, 0xF1, 0x95, 0x54, 0x3C, 0x1E, 0xD2, 0xA2, 0x2D, 0x84, 0x88, 0xB0, 0x60, 0xA3, 0x94, + 0x23, 0x68, 0x65, 0xD5, 0x00, 0xEC, 0x62, 0x92, 0x95, 0x82, 0xEB, 0xA6, 0x31, 0xEB, 0xF5, 0x0E, + 0xFD, 0x1E, 0x14, 0x8E, 0x9C, 0x55, 0x9C, 0x62, 0x4B, 0x31, 0x72, 0xE8, 0x2E, 0xD4, 0xC2, 0x5D, + 0x0A, 0x96, 0xF1, 0xA5, 0xFD, 0xE8, 0x04, 0xDA, 0xBE, 0x23, 0x72, 0x97, 0x09, 0xA6, 0xB2, 0x92, + 0xD3, 0x67, 0xFF, 0xD8, 0x20, 0xC5, 0xCB, 0xC8, 0xF4, 0x8D, 0x16, 0xD7, 0xD0, 0x12, 0xF8, 0x48, + 0xD1, 0x05, 0xAE, 0x03, 0xBA, 0x58, 0x49, 0x9C, 0x8A, 0xB7, 0x56, 0xAA, 0xC8, 0xFB, 0x18, 0x5E, + 0x7E, 0x4E, 0x1B, 0x2C, 0xD0, 0x4C, 0xDA, 0xA3, 0xB7, 0x52, 0xDD, 0x89, 0x14, 0xE2, 0x1E, 0x73, + 0xA3, 0x98, 0x5D, 0x5A, 0x41, 0xE8, 0x01, 0xDA, 0x90, 0xCD, 0x61, 0x9D, 0x6E, 0xDD, 0x41, 0x68 + }.ToBigInteger(); + + public BigInteger GetSecondProof(byte[] accountNameBytes, byte[] seed, byte[] secondChallenge) + { + return new byte[] { + 0x7D, 0x95, 0x74, 0x0C, 0xAD, 0x32, 0x17, 0x1C, 0xBA, 0x75, 0x02, 0xB3, 0xA5, 0xD1, 0x00, 0x5A, + 0x5A, 0x4C, 0x32, 0x3C, 0xD6, 0x3A, 0x94, 0xF2, 0x55, 0xDB, 0x05, 0x1E, 0x95, 0x30, 0x7D, 0xC2, + 0x69, 0xB8, 0x64, 0x90, 0xE2, 0x79, 0xCA, 0xD7, 0x5D, 0x8D, 0x77, 0x51, 0x7E, 0xC7, 0x29, 0xB7, + 0x03, 0x01, 0xB3, 0x62, 0xC4, 0x6D, 0xEA, 0x4F, 0xF5, 0x44, 0x6E, 0x9C, 0x05, 0x6F, 0x2C, 0x04, + 0xCA, 0x96, 0x32, 0x77, 0x21, 0x29, 0xB8, 0x83, 0xE0, 0x13, 0x3B, 0x5C, 0x99, 0x82, 0x08, 0x7B, + 0x63, 0xBF, 0x0D, 0xDA, 0xB7, 0x77, 0x63, 0xB4, 0xD1, 0xEF, 0x64, 0x60, 0x63, 0x5A, 0xBB, 0xDF, + 0x5C, 0xA5, 0x1C, 0xC3, 0x60, 0xCE, 0x8F, 0xD6, 0xC4, 0x15, 0x55, 0xBB, 0x6D, 0x99, 0xD2, 0x26, + 0x74, 0x1B, 0x4F, 0x2E, 0xE4, 0x42, 0x5C, 0xB5, 0x84, 0x44, 0x40, 0x60, 0xA7, 0xDD, 0x52, 0x18 + }.ToBigInteger(); + } + } +} diff --git a/src/Mooege/Core/Cryptography/SSL/CertificateHelper.cs b/src/Mooege/Core/Cryptography/SSL/CertificateHelper.cs new file mode 100644 index 00000000..a1256dc2 --- /dev/null +++ b/src/Mooege/Core/Cryptography/SSL/CertificateHelper.cs @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using OpenSSL.Core; +using OpenSSL.Crypto; +using OpenSSL.X509; + +namespace Mooege.Core.Cryptography.SSL +{ + public static class CertificateHelper + { + public static X509Certificate Certificate = null; + + static CertificateHelper() + { + Certificate = CreateCertificate(); + } + + private static X509Certificate CreateCertificate() + { + BigNumber bn = 0x10001; + var rsa = new RSA(); + rsa.GenerateKeys(2048, bn, null, null); + var key = new CryptoKey(rsa); + + var cert = new X509Certificate( + new SimpleSerialNumber().Next(), + new X509Name("Mooege"), + new X509Name("Mooege"), + key, + DateTime.Now, + DateTime.Now + TimeSpan.FromDays(365)); + + cert.PrivateKey = key; + return cert; + } + } +} diff --git a/src/Mooege/Core/GS/AI/Brain.cs b/src/Mooege/Core/GS/AI/Brain.cs new file mode 100644 index 00000000..c97e0b22 --- /dev/null +++ b/src/Mooege/Core/GS/AI/Brain.cs @@ -0,0 +1,115 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using Mooege.Common.Logging; +using Mooege.Core.GS.Actors; +using Mooege.Core.GS.Actors.Actions; + +namespace Mooege.Core.GS.AI +{ + public class Brain + { + protected static readonly Logger Logger = LogManager.CreateLogger(); + + /// + /// The body chained to brain. + /// + public Actor Body { get; private set; } + + /// + /// The current brain state. + /// + public BrainState State { get; protected set; } + + /// + /// The current action for the brain. + /// + public ActorAction CurrentAction { get; protected set; } + + /// + /// Actions to be taken. + /// + public Queue Actions { get; protected set; } + + protected Brain(Actor body) + { + this.Body = body; + this.State = BrainState.Idle; + this.Actions = new Queue(); + } + + protected void QueueAction(ActorAction action) + { + this.Actions.Enqueue(action); + } + + public virtual void Update(int tickCounter) + { + if (this.State == BrainState.Dead || this.Body == null || this.Body.World == null || this.State == BrainState.Off) + return; + + this.Think(tickCounter); // let the brain think. + this.Perform(tickCounter); // perform any outstanding actions. + } + + /// + /// Lets the brain think and decide the next action to take. + /// + public virtual void Think(int tickCounter) + { } + + /// + /// Stop all brain activities. + /// + public virtual void Kill() + { + if (this.CurrentAction != null) + { + this.CurrentAction.Cancel(0); + this.CurrentAction = null; + } + this.State = BrainState.Dead; + } + + public void Activate() + { + if (this.State == BrainState.Off) + this.State = BrainState.Idle; + } + + public void DeActivate() + { + this.State = BrainState.Off; + } + + private void Perform(int tickCounter) + { + if (this.CurrentAction == null) + return; + + if (!this.CurrentAction.Started) + this.CurrentAction.Start(tickCounter); + else + this.CurrentAction.Update(tickCounter); + + if (this.CurrentAction.Done) + this.CurrentAction = null; + } + } +} diff --git a/src/Mooege/Core/GS/AI/BrainState.cs b/src/Mooege/Core/GS/AI/BrainState.cs new file mode 100644 index 00000000..3af15796 --- /dev/null +++ b/src/Mooege/Core/GS/AI/BrainState.cs @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace Mooege.Core.GS.AI +{ + /// + /// Available brain states. + /// + public enum BrainState + { + /// + /// The idle state, which basically means brain never got an update. + /// + Idle, + + /// + /// The wandering state. + /// + Wander, + + /// + /// Attack nearby enemies. + /// + Combat, + + /// + /// Follow. + /// + Follow, + + /// + /// Follow and guard. + /// + Guard, + + /// + /// I see dead brains. + /// + Dead, + Off, + End + } +} diff --git a/src/Mooege/Core/GS/AI/Brains/AggressiveNPCBrain.cs b/src/Mooege/Core/GS/AI/Brains/AggressiveNPCBrain.cs new file mode 100644 index 00000000..58d7c039 --- /dev/null +++ b/src/Mooege/Core/GS/AI/Brains/AggressiveNPCBrain.cs @@ -0,0 +1,127 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using Mooege.Common.Helpers.Math; +using Mooege.Core.GS.Actors; +using Mooege.Core.GS.Actors.Movement; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Players; +using Mooege.Core.GS.Actors.Actions; +using Mooege.Net.GS.Message; +using Mooege.Common.MPQ; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Core.GS.Ticker; + +namespace Mooege.Core.GS.AI.Brains +{ + public class AggressiveNPCBrain : Brain + { + // list of power SNOs that are defined for the monster + public List PresetPowers { get; private set; } + private Actor _target { get; set; } + private TickTimer _powerDelay; + + public AggressiveNPCBrain(Actor body) + : base(body) + { + this.PresetPowers = new List(); + + // build list of powers defined in monster mpq data + if (body.ActorData.MonsterSNO > 0) + { + var monsterData = (Mooege.Common.MPQ.FileFormats.Monster)MPQStorage.Data.Assets[SNOGroup.Monster][body.ActorData.MonsterSNO].Data; + foreach (var monsterSkill in monsterData.SkillDeclarations) + { + if (monsterSkill.SNOPower > 0) + { + this.PresetPowers.Add(monsterSkill.SNOPower); + } + } + } + } + + public override void Think(int tickCounter) + { + // this needed? /mdz + //if (this.Body is NPC) return; + + // check if in disabled state, if so cancel any action then do nothing + if (this.Body.Attributes[GameAttribute.Frozen] || + this.Body.Attributes[GameAttribute.Stunned] || + this.Body.Attributes[GameAttribute.Blind] || + this.Body.World.BuffManager.GetFirstBuff(this.Body) != null) + { + if (this.CurrentAction != null) + { + this.CurrentAction.Cancel(tickCounter); + this.CurrentAction = null; + } + _powerDelay = null; + + return; + } + + // select and start executing a power if no active action + if (this.CurrentAction == null) + { + // do a little delay so groups of monsters don't all execute at once + if (_powerDelay == null) + _powerDelay = new SecondsTickTimer(this.Body.World.Game, (float)RandomHelper.NextDouble()); + + if (_powerDelay.TimedOut) + { + + if (this.Body.GetObjectsInRange(40f).Count != 0) + { + _target = this.Body.GetObjectsInRange(40f)[0]; + //System.Console.Out.WriteLine("Enemy in range, use powers"); + //This will only attack when you and your minions are not moving..TODO: FIX. + int powerToUse = PickPowerToUse(); + if (powerToUse > 0) + this.CurrentAction = new PowerAction(this.Body, powerToUse, _target); + } + else + { + //System.Console.Out.WriteLine("No enemies in range, return to master"); + this.CurrentAction = new MoveToPointAction(this.Body, this.Body.CheckPointPosition); + } + } + } + } + + protected virtual int PickPowerToUse() + { + // randomly used an implemented power + if (this.PresetPowers.Count > 0) + { + int powerIndex = RandomHelper.Next(this.PresetPowers.Count); + if (Powers.PowerLoader.HasImplementationForPowerSNO(this.PresetPowers[powerIndex])) + return this.PresetPowers[powerIndex]; + } + + // no usable power + return -1; + } + + public void AddPresetPower(int powerSNO) + { + this.PresetPowers.Add(powerSNO); + } + } +} diff --git a/src/Mooege/Core/GS/AI/Brains/FollowerBrain.cs b/src/Mooege/Core/GS/AI/Brains/FollowerBrain.cs new file mode 100644 index 00000000..eaf1fac9 --- /dev/null +++ b/src/Mooege/Core/GS/AI/Brains/FollowerBrain.cs @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Core.GS.Actors; + +namespace Mooege.Core.GS.AI.Brains +{ + public class FollowerBrain : Brain + { + protected FollowerBrain(Actor body) + : base(body) + { } + + public override void Think(int tickCounter) + { } + } +} diff --git a/src/Mooege/Core/GS/AI/Brains/HirelingBrain.cs b/src/Mooege/Core/GS/AI/Brains/HirelingBrain.cs new file mode 100644 index 00000000..3d5f6ed6 --- /dev/null +++ b/src/Mooege/Core/GS/AI/Brains/HirelingBrain.cs @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Core.GS.Actors; +using Mooege.Core.GS.Players; + +namespace Mooege.Core.GS.AI.Brains +{ + public class HirelingBrain : Brain + { + public Player Owner { get; private set; } + + protected HirelingBrain(Actor body) + : base(body) + { } + + public override void Think(int tickCounter) + { } + } +} diff --git a/src/Mooege/Core/GS/AI/Brains/MinionBrain.cs b/src/Mooege/Core/GS/AI/Brains/MinionBrain.cs new file mode 100644 index 00000000..5bf9430e --- /dev/null +++ b/src/Mooege/Core/GS/AI/Brains/MinionBrain.cs @@ -0,0 +1,126 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using Mooege.Common.Helpers.Math; +using Mooege.Core.GS.Actors; +using Mooege.Core.GS.Actors.Movement; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Players; +using Mooege.Core.GS.Actors.Actions; +using Mooege.Net.GS.Message; +using Mooege.Common.MPQ; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Core.GS.Ticker; + +namespace Mooege.Core.GS.AI.Brains +{ + public class MinionBrain : Brain + { + // list of power SNOs that are defined for the monster + public List PresetPowers { get; private set; } + + private TickTimer _powerDelay; + + public MinionBrain(Actor body) + : base(body) + { + this.PresetPowers = new List(); + + // build list of powers defined in monster mpq data + if (body.ActorData.MonsterSNO > 0) + { + var monsterData = (Mooege.Common.MPQ.FileFormats.Monster)MPQStorage.Data.Assets[SNOGroup.Monster][body.ActorData.MonsterSNO].Data; + foreach (var monsterSkill in monsterData.SkillDeclarations) + { + if (monsterSkill.SNOPower > 0) + { + this.PresetPowers.Add(monsterSkill.SNOPower); + } + } + } + } + + public override void Think(int tickCounter) + { + // this needed? /mdz + if (this.Body is NPC) return; + + // check if in disabled state, if so cancel any action then do nothing + if (this.Body.Attributes[GameAttribute.Frozen] || + this.Body.Attributes[GameAttribute.Stunned] || + this.Body.Attributes[GameAttribute.Blind] || + this.Body.World.BuffManager.GetFirstBuff(this.Body) != null) + { + if (this.CurrentAction != null) + { + this.CurrentAction.Cancel(tickCounter); + this.CurrentAction = null; + } + _powerDelay = null; + + return; + } + + // select and start executing a power if no active action + if (this.CurrentAction == null) + { + // do a little delay so groups of monsters don't all execute at once + if (_powerDelay == null) + _powerDelay = new SecondsTickTimer(this.Body.World.Game, (float)RandomHelper.NextDouble()); + + if (_powerDelay.TimedOut) + { + if (this.Body.GetObjectsInRange(20f).Count != 0) + { + //System.Console.Out.WriteLine("Enemy in range, use powers"); + //This will only attack when you and your minions are not moving..TODO: FIX. + int powerToUse = PickPowerToUse(); + if (powerToUse > 0) + this.CurrentAction = new PowerAction(this.Body, powerToUse); + } + else + { + //System.Console.Out.WriteLine("No enemies in range, return to master"); + //TODO: Minions need to be behind Toons on either side. 1st Master 2nd 3rd + this.CurrentAction = new MoveToPointAction(this.Body, (this.Body as Minion).Master.Position); + } + } + } + } + + protected virtual int PickPowerToUse() + { + // randomly used an implemented power + if (this.PresetPowers.Count > 0) + { + int powerIndex = RandomHelper.Next(this.PresetPowers.Count); + if (Powers.PowerLoader.HasImplementationForPowerSNO(this.PresetPowers[powerIndex])) + return this.PresetPowers[powerIndex]; + } + + // no usable power + return -1; + } + + public void AddPresetPower(int powerSNO) + { + this.PresetPowers.Add(powerSNO); + } + } +} diff --git a/src/Mooege/Core/GS/AI/Brains/MonsterBrain.cs b/src/Mooege/Core/GS/AI/Brains/MonsterBrain.cs new file mode 100644 index 00000000..2f53547c --- /dev/null +++ b/src/Mooege/Core/GS/AI/Brains/MonsterBrain.cs @@ -0,0 +1,148 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using Mooege.Common.Helpers.Math; +using Mooege.Core.GS.Actors; +using Mooege.Core.GS.Actors.Implementations.Monsters; +using Mooege.Core.GS.Actors.Movement; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Players; +using Mooege.Core.GS.Actors.Actions; +using Mooege.Net.GS.Message; +using Mooege.Common.MPQ; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Core.GS.Ticker; +using System.Linq; + +namespace Mooege.Core.GS.AI.Brains +{ + public class MonsterBrain : Brain + { + // list of power SNOs that are defined for the monster + public List PresetPowers { get; private set; } + + private TickTimer _powerDelay; + + private bool _warnedNoPowers; + private int _mpqPowerCount; + + public MonsterBrain(Actor body) + : base(body) + { + this.PresetPowers = new List(); + + // build list of powers defined in monster mpq data + if (body.ActorData.MonsterSNO > 0) + { + var monsterData = (Mooege.Common.MPQ.FileFormats.Monster)MPQStorage.Data.Assets[SNOGroup.Monster][body.ActorData.MonsterSNO].Data; + _mpqPowerCount = monsterData.SkillDeclarations.Count(e => e.SNOPower != -1); + foreach (var monsterSkill in monsterData.SkillDeclarations) + { + if (Powers.PowerLoader.HasImplementationForPowerSNO(monsterSkill.SNOPower)) + { + this.PresetPowers.Add(monsterSkill.SNOPower); + } + } + } + } + + public override void Think(int tickCounter) + { + // this needed? /mdz + if (this.Body is NPC) return; + + // check if in disabled state, if so cancel any action then do nothing + if (this.Body.Attributes[GameAttribute.Frozen] || + this.Body.Attributes[GameAttribute.Stunned] || + this.Body.Attributes[GameAttribute.Blind] || + this.Body.World.BuffManager.GetFirstBuff(this.Body) != null || + this.Body.World.BuffManager.GetFirstBuff(this.Body) != null) + { + if (this.CurrentAction != null) + { + this.CurrentAction.Cancel(tickCounter); + this.CurrentAction = null; + } + _powerDelay = null; + + return; + } + + + // select and start executing a power if no active action + if (this.CurrentAction == null) + { + // do a little delay so groups of monsters don't all execute at once + if (_powerDelay == null) + _powerDelay = new SecondsTickTimer(this.Body.World.Game, (float)RandomHelper.NextDouble()); + + + if (_powerDelay.TimedOut) + { + int powerToUse = PickPowerToUse(); + if (powerToUse > 0) + { + this.CurrentAction = new PowerAction(this.Body, powerToUse); + } + } + } + } + + protected virtual int PickPowerToUse() + { + if (!_warnedNoPowers && this.PresetPowers.Count == 0) + { + Logger.Info("Monster \"{0}\" has no usable powers. {1} are defined in mpq data.", + this.Body.ActorSNO.Name, _mpqPowerCount); + _warnedNoPowers = true; + } + + // randomly used an implemented power + if (this.PresetPowers.Count > 0) + { + int power = this.PresetPowers[RandomHelper.Next(this.PresetPowers.Count)]; + if (Powers.PowerLoader.HasImplementationForPowerSNO(power)) + return power; + } + + // no usable power + return -1; + } + + public void AddPresetPower(int powerSNO) + { + if (this.PresetPowers.Contains(powerSNO)) + { + Logger.Error("AddPresetPower(): power sno {0} already defined for monster \"{1}\"", + powerSNO, this.Body.ActorSNO.Name); + return; + } + + this.PresetPowers.Add(powerSNO); + } + + public void RemovePresetPower(int powerSNO) + { + if (this.PresetPowers.Contains(powerSNO)) + { + this.PresetPowers.Remove(powerSNO); + } + } + } +} diff --git a/src/Mooege/Core/GS/AI/Brains/NPCBrain.cs b/src/Mooege/Core/GS/AI/Brains/NPCBrain.cs new file mode 100644 index 00000000..0ec1db8f --- /dev/null +++ b/src/Mooege/Core/GS/AI/Brains/NPCBrain.cs @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Core.GS.Actors; + +namespace Mooege.Core.GS.AI.Brains +{ + public class NPCBrain : Brain + { + protected NPCBrain(Actor body) + : base(body) + { } + + public override void Think(int tickCounter) + { } + } +} diff --git a/src/Mooege/Core/GS/AI/Pathfinder.cs b/src/Mooege/Core/GS/AI/Pathfinder.cs new file mode 100644 index 00000000..a3de742a --- /dev/null +++ b/src/Mooege/Core/GS/AI/Pathfinder.cs @@ -0,0 +1,275 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using Mooege.Core.GS.Common.Types.Math; +using System.Drawing; +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Common.Types.Misc; +using Algorithms; +using Mooege.Core.GS.Actors; +using Mooege.Common.Logging; + +namespace Mooege.Core.GS.AI +{ + public class Pather + { + private static readonly Logger Logger = LogManager.CreateLogger(); + private System.Collections.Concurrent.ConcurrentDictionary> _completedPathTasks = new System.Collections.Concurrent.ConcurrentDictionary>(); + private System.Collections.Concurrent.ConcurrentDictionary _queuedPathTasks = new System.Collections.Concurrent.ConcurrentDictionary(); + + private Pathfinder aipather; + private Games.Game game; + + public Pather(Games.Game game) + { + + this.game = game; + } + + //This submits a request for a path to the pathfinder thread. This is the main point of entry for usage. - DarkLotus + public PathRequestTask GetPath(Actor owner, Vector3D vector3D, Vector3D heading) + { + if (aipather == null) + aipather = new Pathfinder(); + var pathRequestTask = new PathRequestTask(aipather, owner, owner.Position, heading); + _queuedPathTasks.TryAdd(owner.DynamicID, pathRequestTask); + return pathRequestTask; + } + + + //Runs a copy for each game currently running- Processes all pathrequests queued. + public void UpdateLoop() + { + PathRequestTask temporaryPathTask; + KeyValuePair workPathTask; + while (true) + { + if (!_queuedPathTasks.IsEmpty) + { + workPathTask = _queuedPathTasks.First(); + workPathTask.Value.GetPath(); + _queuedPathTasks.TryRemove(workPathTask.Key, out temporaryPathTask); + } + else { System.Threading.Thread.Sleep(50); } + } + + } + public class Pathfinder + { + //TODO Grab Z axis for each move from scene grid, if Z is desired. Walking works fine sending 0 Z axis. + //Shortcomings; Grids are built off Walkable, no accounting for flying,Ghost allowed movements etc With current method this would require duplicating WalkGrid for each scene with FlyGrid and GhostGrid + //Avg 9ms when finding random 0-40 distance paths - DarkLotus + private static readonly Logger Logger = LogManager.CreateLogger(); + + //This holds a single copy of PathFinderFast for each Scene SNO so they can be reused for later pathing requests. This saves reiniting the pather and allocating 230kb. Multiscene grids are not stored. + private static System.Collections.Concurrent.ConcurrentDictionary listOfPathFinderInstances = new System.Collections.Concurrent.ConcurrentDictionary(); + private Algorithms.PathFinderFast mPathFinder; + private List vectorPathList = new List(); // the list of world vectors that gets returned to the action + private List nodePathList = new List(); //Nodelist returned from the pathfinder algo, coordinates are scene local. + private Point _startSceneLocal = new Point(); // local scene position of the start location + private Point _destinationSceneLocal = new Point(); // + private float _baseX = 0, _baseY = 0; // Used to convert local scene coordinates back to world coordinates. These are the scenes x/y normally. + private Scene _curScene; // scene containing the start location + private Scene _destScene; // scene containing destination + public Pathfinder() + { + } + public List FindPath(Actor actor, Vector3D Start, Vector3D Destination) + { + _baseX = 0; _baseY = 0; // reset to 0 + + // Should only be null first time a path is requested. + if (_curScene == null) + { + _curScene = actor.CurrentScene; + if (!listOfPathFinderInstances.TryGetValue(_curScene.SceneSNO.Id, out mPathFinder)) // Attempts to pull the pathfinder which matches the scenes SNO from the patherlist + { + mPathFinder = new PathFinderFast(_curScene.NavMesh.WalkGrid); // Create a new pather, using the current scenes grid. + listOfPathFinderInstances.TryAdd(_curScene.SceneSNO.Id, mPathFinder); // add it to our patherlist, with the SNO as key. + } + + InitPathFinder(); + } + + // Checks if our path start location is inside current scene, if it isnt, we reset curScene and set mPathfinder to the corrent grid. + if (!_curScene.Bounds.IntersectsWith(new System.Windows.Rect(Start.X, Start.Y, 1, 1))) + { + _curScene = actor.CurrentScene; + if (!listOfPathFinderInstances.TryGetValue(_curScene.SceneSNO.Id, out mPathFinder)) + { + mPathFinder = new PathFinderFast(_curScene.NavMesh.WalkGrid); + listOfPathFinderInstances.TryAdd(_curScene.SceneSNO.Id, mPathFinder); + } + + InitPathFinder(); + } + + _baseX = _curScene.Position.X; //Our base location for working out world > SceneLocal coordinates. + _baseY = _curScene.Position.Y; + + // Path's start and destination are both in same scene. + if (_curScene.Bounds.IntersectsWith(new System.Windows.Rect(Destination.X, Destination.Y, 1, 1))) + { + _destScene = _curScene; + } + else + { + //Builds a new grid on the fly containing both the start and destination scenes. This is not really optimal, but its a trade off. + // Keeping grids Scene based means they can be used cross game even when laid out different in a seperate world. This keeps memory usage down substantially. + // Also limited to a max distance of scene > scene. Again this keeps memory usage low. + _destScene = _curScene.World.QuadTree.Query(new System.Windows.Rect(Destination.X, Destination.Y, 1, 1)).FirstOrDefault(); + mPathFinder = new PathFinderFast(BuildOutOfSceneGrid(_curScene, _destScene, ref _baseX, ref _baseY)); + InitPathFinder(); + } + //2.5f is because Scene navmesh's are based on 96x96 for a 240x240 scene - Darklotus + _startSceneLocal.X = (int)((Start.X - _baseX) / 2.5f); + _startSceneLocal.Y = (int)((Start.Y - _baseY) / 2.5f); + _destinationSceneLocal.X = (int)((Destination.X - _baseX) / 2.5f); + _destinationSceneLocal.Y = (int)((Destination.Y - _baseY) / 2.5f); + //Possibily add a check to ensure start/dest local coords are valid. Unneeded so far. + + nodePathList = mPathFinder.FindPath(_startSceneLocal, _destinationSceneLocal); // The actual pathfind request, the path is found here. + + vectorPathList.Clear(); // Clear the previous path. + + if (nodePathList == null) { return vectorPathList; }// No Path Found. + if (nodePathList.Count < 1) { return vectorPathList; } // Safety net Incase start/dest are the same. + + for (int i = 0; i < nodePathList.Count; i++) + { + // Convert the path into world coordinates for use in Movement. + // TODO Objectpool maybe? + vectorPathList.Insert(0, new Vector3D(nodePathList[i].X * 2.5f + _baseX, nodePathList[i].Y * 2.5f + _baseY, 0)); + } + return vectorPathList; + } + + private void InitPathFinder() + { + + mPathFinder.Formula = HeuristicFormula.Custom1; + mPathFinder.Diagonals = true; // Looks better, they can cut corners with this set to true - DarkLotus + mPathFinder.ReopenCloseNodes = true; + mPathFinder.HeavyDiagonals = false; + mPathFinder.HeuristicEstimate = 1; + mPathFinder.PunishChangeDirection = true; + mPathFinder.TieBreaker = true; ; + mPathFinder.SearchLimit = 75000; + mPathFinder.DebugProgress = false; + mPathFinder.ReopenCloseNodes = true; + mPathFinder.DebugFoundPath = false; + } + + // Builds a 2x2 grid containing the start/dest location hopefully. If start/dest are further apart the grid will not contain both. + private byte[,] BuildOutOfSceneGrid(Scene s1, Scene s2, ref float basex, ref float basey) + { + // This really isnt optimal but its worked in my test cases, only alternative i could think was loading the entire world into a grid, but thats 4k x 4k and would require duplicating as each world is random - DarkLotus + if (s1.SceneSNO.Id == s2.SceneSNO.Id) { return s1.NavMesh.WalkGrid; } + //Logger.Debug("Start scene " + s1.SceneSNO.Name + " dest scene " + s2.SceneSNO.Name); + byte[,] grid = new byte[256, 256]; // should use 512,512 as there is a scene larger than 128x128. -DarkLotus + + //Work out if start or dest scene has lowest X/Y to use as our 0,0 for our new 2x2 scene grid. + if (s1.Position.X < s2.Position.X) + { + basex = s1.Position.X; + } + else if (s1.Position.X >= s2.Position.X) + { + basex = s2.Position.X; + } + if (s1.Position.Y < s2.Position.Y) + { + basey = s1.Position.Y; + } + else if (s1.Position.Y >= s2.Position.Y) + { + basey = s2.Position.Y; + } + + foreach (var s in s1.World.QuadTree.Query(new Circle(basex + 5, basey + 5, 1f))) + { + //Logger.Debug("Inserting Scene: " + s.SceneSNO.Name + " at offset: 0/0"); + InsertSceneGridIntoMultiSceneGrid(ref grid, s, 0, 0); + } + + foreach (var s in s1.World.QuadTree.Query(new Circle(basex + (float)s1.Size.Width + 10, basey + 10, 1f))) + { + //Logger.Debug("Inserting Scene: " + s.SceneSNO.Name + " at offset: " + s1.Size.Width + "/0"); + InsertSceneGridIntoMultiSceneGrid(ref grid, s, (int)(s1.Size.Width / 2.5), 0); + } + foreach (var s in s1.World.QuadTree.Query(new Circle(basex + 10, basey + (float)s1.Size.Height + 10, 1f))) + { + //Logger.Debug("Inserting Scene: " + s.SceneSNO.Name + " at offset: 0/" + s1.Size.Width); + InsertSceneGridIntoMultiSceneGrid(ref grid, s, 0, (int)(s1.Size.Height / 2.5)); + } + foreach (var s in s1.World.QuadTree.Query(new Circle(basex + (float)s1.Size.Width + 10, basey + (float)s1.Size.Height + 10, 1f))) + { + //Logger.Debug("Inserting Scene: " + s.SceneSNO.Name + " at offset: " + s1.Size.Width + "/" + s1.Size.Height); + InsertSceneGridIntoMultiSceneGrid(ref grid, s, (int)(s1.Size.Width / 2.5), (int)(s1.Size.Height / 2.5)); + } + return grid; + + } + + //Inserts a smaller scenes nav grid into a larger grid. + private void InsertSceneGridIntoMultiSceneGrid(ref byte[,] Grid, Scene scene, int offsetx, int offsety) + { + byte[,] smallgrid = scene.NavMesh.WalkGrid; + for (int X = 0; X < scene.NavMesh.SquaresCountX; X++) + { + for (int Y = 0; Y < scene.NavMesh.SquaresCountY; Y++) + { + Grid[X + offsetx, Y + offsety] = smallgrid[X, Y]; + } + } + } + } + + + + + public class PathRequestTask + { + private Pathfinder _pathfinder; + public Actor _actor; + private Vector3D _start; + private Vector3D _destination; + public List Path; + public Boolean PathFound = false; + + public PathRequestTask(Pathfinder pathing, Actor actor, Vector3D Start, Vector3D Destination) + { + this._pathfinder = pathing; + this._actor = actor; + this._start = Start; + this._destination = Destination; + this.Path = new List(); + } + public List GetPath() + { + Path.AddRange(_pathfinder.FindPath(_actor, _start, _destination)); + PathFound = true; + + return Path; + } + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Actions/ActorAction.cs b/src/Mooege/Core/GS/Actors/Actions/ActorAction.cs new file mode 100644 index 00000000..b9f3a774 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Actions/ActorAction.cs @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Common.Logging; + +namespace Mooege.Core.GS.Actors.Actions +{ + public abstract class ActorAction + { + protected static readonly Logger Logger = LogManager.CreateLogger(); + + /// + /// The action owner actor. + /// + public Actor Owner { get; private set; } + + /// + /// Returns true if the action is completed. + /// + public bool Done { get; protected set; } + + /// + /// Returns true if the action is already started. + /// + public bool Started { get; protected set; } + + protected ActorAction(Actor owner) + { + this.Owner = owner; + this.Started = false; + this.Done = false; + } + + public abstract void Start(int tickCounter); + + public abstract void Update(int tickCounter); + + public abstract void Cancel(int tickCounter); + } +} diff --git a/src/Mooege/Core/GS/Actors/Actions/PowerAction.cs b/src/Mooege/Core/GS/Actors/Actions/PowerAction.cs new file mode 100644 index 00000000..1b144681 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Actions/PowerAction.cs @@ -0,0 +1,162 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Core.GS.Powers; +using Mooege.Core.GS.Ticker; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Core.GS.Actors.Movement; +using Mooege.Net.GS.Message; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Net.GS.Message.Definitions.ACD; + +namespace Mooege.Core.GS.Actors.Actions +{ + public class PowerAction : ActorAction + { + const float MaxTargetRange = 60f; + const float PathUpdateDelay = 1f; + + private Actor _target; + private PowerScript _power; + private bool _powerRan; + private TickTimer _powerFinishTimer; + private float _baseAttackRadius; + private ActorMover _ownerMover; + private TickTimer _pathUpdateTimer; + + public PowerAction(Actor owner, int powerSNO, Actor target = null) + : base(owner) + { + _power = PowerLoader.CreateImplementationForPowerSNO(powerSNO); + _power.World = owner.World; + _power.User = owner; + _powerRan = false; + _baseAttackRadius = this.Owner.ActorData.Cylinder.Ax2 + _power.EvalTag(PowerKeys.AttackRadius) + 1.5f; + _ownerMover = new ActorMover(owner); + _target = target; + } + + public override void Start(int tickCounter) + { + this.Started = true; + this.Update(tickCounter); + } + + public override void Update(int tickCounter) + { + // if power executed, wait for attack/cooldown to finish. + if (_powerRan) + { + if (_powerFinishTimer.TimedOut) + this.Done = true; + + return; + } + + // try to get nearest target if no target yet acquired + if (_target == null) + { + if (this.Owner is Minion) // assume minions are player controlled and are targeting monsters + { + _target = this.Owner.GetMonstersInRange(MaxTargetRange).OrderBy( + (monster) => PowerMath.Distance2D(monster.Position, this.Owner.Position)) + .FirstOrDefault(); + } + else // monsters targeting players + { + _target = this.Owner.GetPlayersInRange(MaxTargetRange).OrderBy( + (player) => PowerMath.Distance2D(player.Position, this.Owner.Position)) + .FirstOrDefault(); + } + } + + if (_target != null) + { + float targetDistance = PowerMath.Distance2D(_target.Position, this.Owner.Position); + + // if target has moved out of range, deselect it as the target + if (targetDistance > MaxTargetRange) + { + _target = null; + } + else if (targetDistance < _baseAttackRadius + _target.ActorData.Cylinder.Ax2) // run power if within range + { + // stop any movement + _ownerMover.Move(this.Owner.Position, this.Owner.WalkSpeed); + + this.Owner.World.PowerManager.RunPower(this.Owner, _power, _target, _target.Position); + _powerFinishTimer = new SecondsTickTimer(this.Owner.World.Game, + _power.EvalTag(PowerKeys.AttackSpeed) + _power.EvalTag(PowerKeys.CooldownTime)); + _powerRan = true; + } + else + { + // update or create path movement + if (_pathUpdateTimer == null || _pathUpdateTimer.TimedOut) + { + _pathUpdateTimer = new SecondsTickTimer(this.Owner.World.Game, PathUpdateDelay); + + // move the space between each path update, or up to target. + float moveAmount = this.Owner.WalkSpeed * + (_pathUpdateTimer.TimeoutTick - this.Owner.World.Game.TickCounter); + if (targetDistance < moveAmount) + moveAmount = targetDistance; // -(_baseAttackRadius + _target.ActorData.Cylinder.Ax2) - 0.1f; + Vector3D movePos = PowerMath.TranslateDirection2D(this.Owner.Position, _target.Position, + this.Owner.Position, moveAmount); + + this.Owner.TranslateFacing(_target.Position, false); + + // find suitable movement animation + int aniTag; + if (this.Owner.AnimationSet == null) + aniTag = -1; + else if (this.Owner.AnimationSet.TagExists(Mooege.Common.MPQ.FileFormats.AnimationTags.Walk)) + aniTag = this.Owner.AnimationSet.GetAnimationTag(Mooege.Common.MPQ.FileFormats.AnimationTags.Walk); + else if (this.Owner.AnimationSet.TagExists(Mooege.Common.MPQ.FileFormats.AnimationTags.Run)) + aniTag = this.Owner.AnimationSet.GetAnimationTag(Mooege.Common.MPQ.FileFormats.AnimationTags.Run); + else + aniTag = -1; + + _ownerMover.Move(movePos, this.Owner.WalkSpeed, new ACDTranslateNormalMessage + { + TurnImmediately = false, + AnimationTag = aniTag + }); + } + else + { + _ownerMover.Update(); + } + } + } + } + + public override void Cancel(int tickCounter) + { + // TODO: make this per-power instead? + if (_powerRan) + this.Owner.World.PowerManager.CancelAllPowers(this.Owner); + + this.Done = true; + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Actor.cs b/src/Mooege/Core/GS/Actors/Actor.cs new file mode 100644 index 00000000..90f10c98 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Actor.cs @@ -0,0 +1,856 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using System.Linq; +using System.Windows; +using Mooege.Common.Logging; +using Mooege.Core.GS.Actors.Implementations; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Common.Types.Misc; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Core.GS.Games; +using Mooege.Core.GS.Items; +using Mooege.Core.GS.Objects; +using Mooege.Core.GS.Players; +using Mooege.Core.GS.Map; +using Mooege.Net.GS.Message; +using Mooege.Net.GS.Message.Fields; +using Mooege.Net.GS.Message.Definitions.ACD; +using Mooege.Net.GS.Message.Definitions.Misc; +using Mooege.Core.GS.Common.Types.TagMap; +using System; +using Mooege.Core.GS.Powers; +using Mooege.Net.GS.Message.Definitions.Effect; +using Mooege.Net.GS.Message.Definitions.Animation; + +namespace Mooege.Core.GS.Actors +{ + public abstract class Actor : WorldObject + { + private static readonly Logger Logger = LogManager.CreateLogger(); + + /// + /// ActorSNO. + /// + public SNOHandle ActorSNO { get; private set; } + + /// + /// Gets or sets the sno of the actor used to identify the actor to the player + /// This is usually the same as actorSNO except for actors that have a GBHandle + /// There are few exceptions though like the Inn_Zombies that have both. + /// Used by ACDEnterKnown to name the actor. + /// + public int NameSNOId { get; set; } + + /// + /// The actor type. + /// + public abstract ActorType ActorType { get; } + + /// + /// Current scene for the actor. + /// + public virtual Scene CurrentScene + { + get { return this.World.QuadTree.Query(this.Bounds).FirstOrDefault(); } + } + + /// + /// Returns true if actor is already spawned in the world. + /// + public bool Spawned { get; private set; } + + /// + /// Default lenght value for region based queries. + /// + public const int DefaultQueryProximityLenght = 240; + + /// + /// Default lenght value for range based queries. + /// + public const int DefaultQueryProximityRadius = 120; + + /// + /// PRTransform for the actor. + /// + public virtual PRTransform Transform + { + get { return new PRTransform { Quaternion = new Quaternion { W = this.RotationW, Vector3D = this.RotationAxis }, Vector3D = this.Position }; } + } + + /// + /// Replaces the actor's rotation with one that rotates along the Z-axis by the specified "facing" angle. + /// + /// The angle in radians. + public void SetFacingRotation(float facingAngle) + { + Quaternion q = Quaternion.FacingRotation(facingAngle); + this.RotationW = q.W; + this.RotationAxis = q.Vector3D; + } + + /// + /// Tags read from MPQ's for the actor. + /// + public TagMap Tags { get; private set; } + + /// + /// Attribute map. + /// + public GameAttributeMap Attributes { get; private set; } + + /// + /// Affix list. + /// + public List AffixList { get; set; } + + /// + /// GBHandle. + /// + public GBHandle GBHandle { get; private set; } + + /// + /// Collision flags. + /// + public int CollFlags { get; set; } + + /// + /// Gets whether the actor is visible by questrange, privately set on quest progress + /// + public bool Visible { get; private set; } + + /// + /// The QuestRange specifies the visibility of an actor, depending on quest progress + /// + public Mooege.Common.MPQ.FileFormats.QuestRange _questRange; + + protected Mooege.Common.MPQ.FileFormats.ConversationList ConversationList; + public Vector3D CheckPointPosition { get; set; } + + /// + /// Returns true if actor has world location. + /// TODO: I belive this belongs to WorldObject.cs /raist. + /// + public virtual bool HasWorldLocation + { + get { return true; } + } + + public Mooege.Common.MPQ.FileFormats.Actor ActorData { get; private set; } + + /// + /// The animation set for actor. + /// + public Mooege.Common.MPQ.FileFormats.AnimSet AnimationSet { get; private set; } + + // TODO: read them from MPQ data's instead /raist. + public float WalkSpeed = 0.108f;//0.2797852f; + public float RunSpeed = 0.3598633f; + + // Some ACD uncertainties /komiga. + public int Field2 = 0x00000000; // TODO: Probably flags or actor type. 0x8==monster, 0x1a==item, 0x10=npc, 0x01=other player, 0x09=player-itself /komiga & /raist. + public int Field7 = -1; // Either -1 when ActorNameSNO is -1 or 1 if ActorNameSno is set + + /// + /// Quality of the actor as presented to the client. This is either ItemQualityLevel + /// or LevelArea.SpawnType for monsters or GameBalance.ItemQuality for Items and 0 for all other actors + /// TODO ACDEnterKnown.Quality seems to be overridden by actor.attributes anyways, at least for items, so im not sure if it maybe has some other purpose -farmy + /// + public virtual int Quality { get; set; } + + public byte Field10 = 0x00; // always 0 except for a few loots corpses (not all)... + public int? Field11 = null; // never used at all? + + /// + /// Gets or sets the MarkerSet from which this item has been loaded. + /// TODO MarkerSetData for actors is currently never sent with ACDEnterKnown and it is unclear what it is used for + /// + public int? MarkerSetSNO { get; private set; } + + /// + /// Gets or sets hte index within the markerset actor list which was the + /// source of this actor (markerset may point to an encounter which + /// creates this actor or this actor directly) + /// TODO MarkerSetData for actors is currently never sent with ACDEnterKnown and it is unclear what it is used for + /// + public int? MarkerSetIndex { get; private set; } + + private int snoTriggeredConversation = -1; + + /// + /// Creates a new actor. + /// + /// The world that initially belongs to. + /// SNOId of the actor. + /// TagMapEntry dictionary read for the actor from MPQ's.. + protected Actor(World world, int snoId, TagMap tags) + : base(world, world.NewActorID) + { + this.Attributes = new GameAttributeMap(this); + this.AffixList = new List(); + + this.ActorData = (Mooege.Common.MPQ.FileFormats.Actor)Mooege.Common.MPQ.MPQStorage.Data.Assets[SNOGroup.Actor][snoId].Data; + if (this.ActorData.AnimSetSNO != -1) + this.AnimationSet = (Mooege.Common.MPQ.FileFormats.AnimSet)Mooege.Common.MPQ.MPQStorage.Data.Assets[SNOGroup.AnimSet][this.ActorData.AnimSetSNO].Data; + + this.ActorSNO = new SNOHandle(SNOGroup.Actor, snoId); + this.NameSNOId = snoId; + this.Quality = 0; + + if (ActorData.TagMap.ContainsKey(ActorKeys.TeamID)) + this.Attributes[GameAttribute.TeamID] = ActorData.TagMap[ActorKeys.TeamID]; + this.Spawned = false; + this.Size = new Size(1, 1); + this.GBHandle = new GBHandle { Type = -1, GBID = -1 }; // Seems to be the default. /komiga + this.CollFlags = this.ActorData.ActorCollisionData.ColFlags.I3; + + this.Tags = tags; + this.ReadTags(); + + // Listen for quest progress if the actor has a QuestRange attached to it + foreach (var quest in World.Game.Quests) + if (_questRange != null) + quest.OnQuestProgress += new Games.Quest.QuestProgressDelegate(quest_OnQuestProgress); + UpdateQuestRangeVisbility(); + } + + /// + /// Creates a new actor. + /// + /// The world that initially belongs to. + /// SNOId of the actor. + protected Actor(World world, int snoId) + : this(world, snoId, null) + { } + + protected virtual void quest_OnQuestProgress(Quest quest) + { + UpdateQuestRangeVisbility(); + } + + /// + /// Unregister from quest events when object is destroyed + /// + public override void Destroy() + { + if (_questRange != null) + if (World == null) + Logger.Debug("World is null? {0}", this.GetType()); + else if (World.Game == null) + Logger.Debug("Game is null? {0}", this.GetType()); + else if (World.Game.Quests != null) + foreach (var quest in World.Game.Quests) + quest.OnQuestProgress -= quest_OnQuestProgress; + + base.Destroy(); + } + + + #region enter-world, change-world, teleport helpers + + public void EnterWorld(Vector3D position) + { + if (this.Spawned) + return; + + this.Position = position; + this.CheckPointPosition = position; + + if (this.World != null) // if actor got into a new world. + this.World.Enter(this); // let him enter first. + } + + public virtual void BeforeChangeWorld() + { + + } + + public virtual void AfterChangeWorld() + { + + } + + + public void ChangeWorld(World world, Vector3D position) + { + if (this.World == world) + return; + + this.Position = position; + + if (this.World != null) // if actor is already in a existing-world + this.World.Leave(this); // make him leave it first. + + BeforeChangeWorld(); + + this.World = world; + if (this.World != null) // if actor got into a new world. + this.World.Enter(this); // let him enter first. + + AfterChangeWorld(); + this.CheckPointPosition = position; + world.BroadcastIfRevealed(this.ACDWorldPositionMessage, this); + } + + public void ChangeWorld(World world, StartingPoint startingPoint) + { + this.RotationAxis = startingPoint.RotationAxis; + this.RotationW = startingPoint.RotationW; + + this.ChangeWorld(world, startingPoint.Position); + } + + public void Teleport(Vector3D position) + { + this.Position = position; + this.OnTeleport(); + this.World.BroadcastIfRevealed(this.ACDWorldPositionMessage, this); + } + + #endregion + + #region Movement/Translation + + public void TranslateFacing(Vector3D target, bool immediately = false) + { + float facingAngle = Movement.MovementHelpers.GetFacingAngle(this, target); + this.SetFacingRotation(facingAngle); + + if (this.World == null) return; + + this.World.BroadcastIfRevealed(new ACDTranslateFacingMessage + { + ActorId = DynamicID, + Angle = facingAngle, + TurnImmediately = immediately + }, this); + } + + #endregion + + #region Effects + + public void PlayEffectGroup(int effectGroupSNO) + { + PlayEffect(Effect.PlayEffectGroup, effectGroupSNO); + } + + public void PlayEffectGroup(int effectGroupSNO, Actor target) + { + if (target == null || this.World == null) return; + + World.BroadcastIfRevealed(new EffectGroupACDToACDMessage + { + ActorID = this.DynamicID, + TargetID = target.DynamicID, + EffectSNOId = effectGroupSNO + }, this); + } + + public void PlayHitEffect(int hitEffect, Actor hitDealer) + { + if (hitDealer.World == null || this.World == null) return; + + World.BroadcastIfRevealed(new PlayHitEffectMessage + { + ActorID = DynamicID, + HitDealer = hitDealer.DynamicID, + Field2 = hitEffect, + Field3 = false + }, this); + } + + public void PlayEffect(Effect effect, int? param = null) + { + if (this.World == null) return; + + this.World.BroadcastIfRevealed(new PlayEffectMessage + { + ActorId = this.DynamicID, + Effect = effect, + OptionalParameter = param + }, this); + } + + public void AddRopeEffect(int ropeSNO, Actor target) + { + if (target == null || target.World == null || this.World == null) return; + + this.World.BroadcastIfRevealed(new RopeEffectMessageACDToACD + { + RopeSNO = ropeSNO, + StartSourceActorId = (int)DynamicID, + Field2 = 4, + DestinationActorId = (int)target.DynamicID, + Field4 = 1 + }, this); + } + + public void AddRopeEffect(int ropeSNO, Vector3D target) + { + if (this.World == null) return; + + this.World.BroadcastIfRevealed(new RopeEffectMessageACDToPlace + { + RopeSNO = ropeSNO, + StartSourceActorId = (int)this.DynamicID, + Field2 = 4, + EndPosition = new WorldPlace { Position = target, WorldID = this.World.DynamicID } + }, this); + } + + public void AddComplexEffect(int effectGroupSNO, Actor target) + { + if (target == null || target.World == null || this.World == null) return; + + this.World.BroadcastIfRevealed(new ComplexEffectAddMessage + { + EffectId = (int)this.World.NewActorID, // TODO: maybe not use actor ids? + Field1 = 1, + EffectSNO = effectGroupSNO, + SourceActorId = (int)this.DynamicID, + TargetActorId = (int)target.DynamicID, + Field5 = 0, + Field6 = 0 + }, target); + } + + public void PlayAnimation(int animationType, int animationSNO, float speed = 1.0f, int? ticksToPlay = null) + { + if (this.World == null) return; + + this.World.BroadcastIfRevealed(new PlayAnimationMessage + { + ActorID = this.DynamicID, + Field1 = animationType, + Field2 = 0, + tAnim = new PlayAnimationMessageSpec[] + { + new PlayAnimationMessageSpec + { + Duration = ticksToPlay.HasValue ? ticksToPlay.Value : -2, // -2 = play animation once through + AnimationSNO = animationSNO, + PermutationIndex = 0x0, // TODO: implement variations? + Speed = speed, + } + } + }, this); + } + + public void PlayActionAnimation(int animationSNO, float speed = 1.0f, int? ticksToPlay = null) + { + PlayAnimation(3, animationSNO, speed, ticksToPlay); + } + #endregion + + #region reveal & unreveal handling + + private void UpdateQuestRangeVisbility() + { + if (_questRange != null) + Visible = World.Game.Quests.IsInQuestRange(_questRange); + else + Visible = true; + } + + /// + /// Returns true if the actor is revealed to player. + /// + /// The player. + /// + public bool IsRevealedToPlayer(Player player) + { + return player.RevealedObjects.ContainsKey(this.DynamicID); + } + + public ACDEnterKnownMessage ACDEnterKnown() + { + return new ACDEnterKnownMessage + { + ActorID = this.DynamicID, + ActorSNOId = this.ActorSNO.Id, + Field2 = this.Field2, + Field3 = this.HasWorldLocation ? 0 : 1, + WorldLocation = this.HasWorldLocation ? this.WorldLocationMessage : null, + InventoryLocation = this.HasWorldLocation ? null : this.InventoryLocationMessage, + GBHandle = this.GBHandle, + Field7 = this.Field7, + NameSNOId = this.NameSNOId, + Quality = this.Quality, + Field10 = this.Field10, + Field11 = this.Field11, + MarkerSetSNO = this.MarkerSetSNO, + MarkerSetIndex = this.MarkerSetIndex, + }; + } + + /// + /// Reveals an actor to a player. + /// + /// true if the actor was revealed or false if the actor was already revealed. + public override bool Reveal(Player player) + { + if (player.RevealedObjects.ContainsKey(this.DynamicID)) return false; // already revealed + player.RevealedObjects.Add(this.DynamicID, this); + + var msg = ACDEnterKnown(); + + // normaly when we send acdenterknown for players own actor it's set to 0x09. But while sending the acdenterknown for another player's actor we should set it to 0x01. /raist + if ((this is Player) && this != player) + msg.Field2 = 0x01; + + player.InGameClient.SendMessage(msg); + + // Collision Flags + player.InGameClient.SendMessage(new ACDCollFlagsMessage + { + ActorID = DynamicID, + CollFlags = this.CollFlags + }); + + // Send Attributes + Attributes.SendMessage(player.InGameClient); + + // Actor group + player.InGameClient.SendMessage(new ACDGroupMessage + { + ActorID = DynamicID, + Group1Hash = -1, + Group2Hash = -1, + }); + + // Reveal actor (creates actor and makes it visible to the player) + player.InGameClient.SendMessage(new ACDCreateActorMessage(this.DynamicID)); + + // This is always sent even though it doesn't identify the actor. /komiga + player.InGameClient.SendMessage(new SNONameDataMessage + { + Name = this.ActorSNO + }); + + return true; + } + + /// + /// Unreveals an actor from a player. + /// + /// true if the actor was unrevealed or false if the actor wasn't already revealed. + public override bool Unreveal(Player player) + { + if (!player.RevealedObjects.ContainsKey(this.DynamicID)) return false; // not revealed yet + player.InGameClient.SendMessage(new ACDDestroyActorMessage(this.DynamicID)); + player.RevealedObjects.Remove(this.DynamicID); + return true; + } + + #endregion + + #region proximity-based query helpers + + #region circurlar region queries + + public List GetPlayersInRange(float radius = DefaultQueryProximityRadius) + { + return this.GetObjectsInRange(radius); + } + + public List GetItemsInRange(float radius = DefaultQueryProximityRadius) + { + return this.GetObjectsInRange(radius); + } + + public List GetMonstersInRange(float radius = DefaultQueryProximityRadius) + { + return this.GetObjectsInRange(radius); + } + + public List GetActorsInRange(float radius = DefaultQueryProximityRadius) + { + return this.GetObjectsInRange(radius); + } + + public List GetActorsInRange(float radius = DefaultQueryProximityRadius) where T : Actor + { + return this.GetObjectsInRange(radius); + } + + public List GetScenesInRange(float radius = DefaultQueryProximityRadius) + { + return this.GetObjectsInRange(radius); + } + + public List GetObjectsInRange(float radius = DefaultQueryProximityRadius) + { + return this.GetObjectsInRange(radius); + } + + public List GetObjectsInRange(float radius = DefaultQueryProximityRadius) where T : WorldObject + { + var proximityCircle = new Circle(this.Position.X, this.Position.Y, radius); + return this.World.QuadTree.Query(proximityCircle); + } + + #endregion + + #region rectangluar region queries + + public List GetPlayersInRegion(int lenght = DefaultQueryProximityLenght) + { + return this.GetObjectsInRegion(lenght); + } + + public List GetItemsInRegion(int lenght = DefaultQueryProximityLenght) + { + return this.GetObjectsInRegion(lenght); + } + + public List GetMonstersInRegion(int lenght = DefaultQueryProximityLenght) + { + return this.GetObjectsInRegion(lenght); + } + + public List GetActorsInRegion(int lenght = DefaultQueryProximityLenght) + { + return this.GetObjectsInRegion(lenght); + } + + public List GetActorsInRegion(int lenght = DefaultQueryProximityLenght) where T : Actor + { + return this.GetObjectsInRegion(lenght); + } + + public List GetScenesInRegion(int lenght = DefaultQueryProximityLenght) + { + return this.GetObjectsInRegion(lenght); + } + + public List GetObjectsInRegion(int lenght = DefaultQueryProximityLenght) + { + return this.GetObjectsInRegion(lenght); + } + + public List GetObjectsInRegion(int lenght = DefaultQueryProximityLenght) where T : WorldObject + { + var proximityRectangle = new Rect(this.Position.X - lenght / 2, this.Position.Y - lenght / 2, lenght, lenght); + return this.World.QuadTree.Query(proximityRectangle); + } + + #endregion + + #endregion + + #region events + + + public virtual void OnEnter(World world) + { + + } + + public virtual void OnLeave(World world) + { + + } + + public void OnActorMove(Actor actor, Vector3D prevPosition) + { + // TODO: Unreveal from players that are now outside the actor's range. /komiga + } + + public virtual void OnTargeted(Player player, Mooege.Net.GS.Message.Definitions.World.TargetMessage message) + { + + } + + public virtual void OnTeleport() + { + + } + + /// + /// Called when a player moves close to the actor + /// + public virtual void OnPlayerApproaching(Player player) + { + } + + #endregion + + #region cooked messages + + public virtual InventoryLocationMessageData InventoryLocationMessage + { + // Only used in Item; stubbed here to prevent an overrun in some cases. /komiga + get { return new InventoryLocationMessageData { OwnerID = 0, EquipmentSlot = 0, InventoryLocation = new Vector2D() }; } + } + + public virtual ACDWorldPositionMessage ACDWorldPositionMessage + { + get { return new ACDWorldPositionMessage { ActorID = this.DynamicID, WorldLocation = this.WorldLocationMessage }; } + } + + public virtual ACDInventoryPositionMessage ACDInventoryPositionMessage + { + get + { + return new ACDInventoryPositionMessage() + { + ItemId = this.DynamicID, + InventoryLocation = this.InventoryLocationMessage, + Field2 = 1 // TODO: find out what this is and why it must be 1...is it an enum? + }; + } + } + + public virtual WorldLocationMessageData WorldLocationMessage + { + get + { + return new WorldLocationMessageData { Scale = this.Scale, Transform = this.Transform, WorldID = this.World.DynamicID }; + } + } + + #endregion + + #region tag-readers + + /// + /// Reads known tags from TagMapEntry and set the proper values. + /// + protected virtual void ReadTags() + { + if (this.Tags == null) return; + + // load scale from actor data and override it with marker tags if one is set + this.Scale = ActorData.TagMap.ContainsKey(ActorKeys.Scale) ? ActorData.TagMap[ActorKeys.Scale] : 1; + this.Scale = Tags.ContainsKey(MarkerKeys.Scale) ? Tags[MarkerKeys.Scale] : this.Scale; + + + if (Tags.ContainsKey(MarkerKeys.QuestRange)) + { + int snoQuestRange = Tags[MarkerKeys.QuestRange].Id; + if (Mooege.Common.MPQ.MPQStorage.Data.Assets[SNOGroup.QuestRange].ContainsKey(snoQuestRange)) + _questRange = Mooege.Common.MPQ.MPQStorage.Data.Assets[SNOGroup.QuestRange][snoQuestRange].Data as Mooege.Common.MPQ.FileFormats.QuestRange; + else Logger.Warn("Actor {0} is tagged with unknown QuestRange {1}", NameSNOId, snoQuestRange); + } + + if (Tags.ContainsKey(MarkerKeys.ConversationList)) + { + int snoConversationList = Tags[MarkerKeys.ConversationList].Id; + if (Mooege.Common.MPQ.MPQStorage.Data.Assets[SNOGroup.ConversationList].ContainsKey(snoConversationList)) + ConversationList = Mooege.Common.MPQ.MPQStorage.Data.Assets[SNOGroup.ConversationList][snoConversationList].Data as Mooege.Common.MPQ.FileFormats.ConversationList; + else Logger.Warn("Actor {0} is tagged with unknown ConversationList {1}", NameSNOId, snoConversationList); + } + + + if (this.Tags.ContainsKey(MarkerKeys.TriggeredConversation)) + snoTriggeredConversation = Tags[MarkerKeys.TriggeredConversation].Id; + } + + #endregion + + #region movement + + public void Move(Vector3D point, float facingAngle) + { + this.Position = point; // TODO: will need update Position over time, not instantly. + this.SetFacingRotation(facingAngle); + + // find suitable movement animation + int aniTag; + if (this.AnimationSet == null) + aniTag = -1; + else if (this.AnimationSet.TagExists(Mooege.Common.MPQ.FileFormats.AnimationTags.Walk)) + aniTag = this.AnimationSet.GetAnimationTag(Mooege.Common.MPQ.FileFormats.AnimationTags.Walk); + else if (this.AnimationSet.TagExists(Mooege.Common.MPQ.FileFormats.AnimationTags.Run)) + aniTag = this.AnimationSet.GetAnimationTag(Mooege.Common.MPQ.FileFormats.AnimationTags.Run); + else + aniTag = -1; + + var movementMessage = new ACDTranslateNormalMessage + { + ActorId = (int)this.DynamicID, + Position = point, + Angle = facingAngle, + TurnImmediately = false, + Speed = this.WalkSpeed, + Field5 = 0, + AnimationTag = aniTag + }; + + this.World.BroadcastIfRevealed(movementMessage, this); + } + + public void MoveSnapped(Vector3D point, float facingAngle) + { + this.Position = point; + this.SetFacingRotation(facingAngle); + + this.World.BroadcastIfRevealed(new ACDTranslateSnappedMessage + { + ActorId = (int)this.DynamicID, + Position = point, + Angle = facingAngle, + Field3 = false, + Field4 = 0x900 // TODO: figure out when to use this field + }, this); + } + + #endregion + + public override string ToString() + { + return string.Format("[Actor] [Type: {0}] SNOId:{1} DynamicId: {2} Position: {3} Name: {4}", this.ActorType, this.ActorSNO.Id, this.DynamicID, this.Position, this.ActorSNO.Name); + } + } + + // This is used for GBHandle.Type; uncertain if used elsewhere + public enum GBHandleType : int + { + Invalid = 0, + Monster = 1, + Gizmo = 2, + ClientEffect = 3, + ServerProp = 4, + Environment = 5, + Critter = 6, + Player = 7, + Item = 8, + AxeSymbol = 9, + Projectile = 10, + CustomBrain = 11 + } + + // This should probably be the same as GBHandleType (probably merge them once all actor classes are created) + public enum ActorType + { + Invalid = 0, + Monster = 1, + Gizmo = 2, + ClientEffect = 3, + ServerProp = 4, + Enviroment = 5, + Critter = 6, + Player = 7, + Item = 8, + AxeSymbol = 9, + Projectile = 10, + CustomBrain = 11 + } +} diff --git a/src/Mooege/Core/GS/Actors/ActorFactory.cs b/src/Mooege/Core/GS/Actors/ActorFactory.cs new file mode 100644 index 00000000..fa0decec --- /dev/null +++ b/src/Mooege/Core/GS/Actors/ActorFactory.cs @@ -0,0 +1,166 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using Mooege.Common.MPQ; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Core.GS.Actors.Implementations; +using Mooege.Common.Logging; + +namespace Mooege.Core.GS.Actors +{ + public static class ActorFactory + { + private static readonly Dictionary SNOHandlers = new Dictionary(); + private static Logger Logger = new Logger("ActorFactory"); + + static ActorFactory() + { + LoadSNOHandlers(); + } + + public static Actor Create(World world, int snoId, TagMap tags) + { + if (!MPQStorage.Data.Assets[SNOGroup.Actor].ContainsKey(snoId)) + return null; + + var actorAsset = MPQStorage.Data.Assets[SNOGroup.Actor][snoId]; + var actorData = actorAsset.Data as Mooege.Common.MPQ.FileFormats.Actor; + if (actorData == null) return null; + + if (actorData.Type == ActorType.Invalid) + return null; + + // see if we have an implementation for actor. + if (SNOHandlers.ContainsKey(snoId)) + return (Actor)Activator.CreateInstance(SNOHandlers[snoId], new object[] { world, snoId, tags }); + + switch (actorData.Type) + { + case ActorType.Monster: + if (tags.ContainsKey(MarkerKeys.ConversationList)) + return new InteractiveNPC(world, snoId, tags); + else + if (!MPQStorage.Data.Assets[SNOGroup.Monster].ContainsKey(actorData.MonsterSNO)) + return null; + + var monsterAsset = MPQStorage.Data.Assets[SNOGroup.Monster][actorData.MonsterSNO]; + var monsterData = monsterAsset.Data as Mooege.Common.MPQ.FileFormats.Monster; + if (monsterData.Type == Mooege.Common.MPQ.FileFormats.Monster.MonsterType.Ally || + monsterData.Type == Mooege.Common.MPQ.FileFormats.Monster.MonsterType.Helper) + return new NPC(world, snoId, tags); + else + return new Monster(world, snoId, tags); + case ActorType.Gizmo: + switch (actorData.TagMap[ActorKeys.GizmoGroup]) + { + case GizmoGroup.LootContainer: + return new LootContainer(world, snoId, tags); + case GizmoGroup.Door: + return new Door(world, snoId, tags); + case GizmoGroup.DestructibleLootContainer: + case GizmoGroup.Barricade: + return new DesctructibleLootContainer(world, snoId, tags); + case GizmoGroup.Portal: + //Prevent Development Hell portal from showing + if (tags[MarkerKeys.DestinationWorld].Id != 222591) + return new Portal(world, snoId, tags); + else + return null; + case GizmoGroup.BossPortal: + Logger.Warn("Skipping loading of boss portals"); + return null; + case GizmoGroup.CheckPoint: + return new Checkpoint(world, snoId, tags); + case GizmoGroup.Waypoint: + return new Waypoint(world, snoId, tags); + case GizmoGroup.Savepoint: + return new Savepoint(world, snoId, tags); + case GizmoGroup.ProximityTriggered: + return new ProximityTriggeredGizmo(world, snoId, tags); + case GizmoGroup.Shrine: + return new Shrine(world, snoId, tags); + case GizmoGroup.Healthwell: + return new Healthwell(world, snoId, tags); + case GizmoGroup.StartLocations: + return new StartingPoint(world, snoId, tags); + + case GizmoGroup.ActChangeTempObject: + case GizmoGroup.Banner: + case GizmoGroup.CathedralIdol: + case GizmoGroup.Destructible: + case GizmoGroup.DungeonStonePortal: + case GizmoGroup.Headstone: + case GizmoGroup.HearthPortal: + //case GizmoGroup.NephalemAltar: + case GizmoGroup.Passive: + case GizmoGroup.PlayerSharedStash: + case GizmoGroup.QuestLoot: + case GizmoGroup.Readable: + case GizmoGroup.ServerProp: + case GizmoGroup.Sign: + case GizmoGroup.Spawner: + case GizmoGroup.TownPortal: + case GizmoGroup.Trigger: + case GizmoGroup.WeirdGroup57: + //Logger.Info("GizmoGroup {0} has no proper implementation, using default gizmo instead", actorData.TagMap[ActorKeys.GizmoGroup]); + return CreateGizmo(world, snoId, tags); + default: + Logger.Warn("Unknown gizmo group {0}", actorData.TagMap[ActorKeys.GizmoGroup]); + return CreateGizmo(world, snoId, tags); + } + case ActorType.ServerProp: + return new ServerProp(world, snoId, tags); + } + return null; + } + + private static Actor CreateGizmo(World world, int snoId, TagMap tags) + { + if (tags.ContainsKey(MarkerKeys.DestinationWorld)) + { + if (tags[MarkerKeys.DestinationWorld].Id != 222591) + return new Portal(world, snoId, tags); + } + + return new Gizmo(world, snoId, tags); + } + + public static void LoadSNOHandlers() + { + foreach (var type in Assembly.GetExecutingAssembly().GetTypes()) + { + if (!type.IsSubclassOf(typeof(Actor))) continue; + + var attributes = (HandledSNOAttribute[])type.GetCustomAttributes(typeof(HandledSNOAttribute), true); + if (attributes.Length == 0) continue; + + foreach (var sno in attributes.First().SNOIds) + { + if (!SNOHandlers.ContainsKey(sno)) + SNOHandlers.Add(sno, type); + } + } + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Environment.cs b/src/Mooege/Core/GS/Actors/Environment.cs new file mode 100644 index 00000000..6385a333 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Environment.cs @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Common.Types.TagMap; + +namespace Mooege.Core.GS.Actors +{ + public class Environment : Actor + { + public override ActorType ActorType { get { return ActorType.Enviroment; } } + + public Environment(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + this.Field2 = 16; + this.Field7 = 0x00000001; + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Gizmo.cs b/src/Mooege/Core/GS/Actors/Gizmo.cs new file mode 100644 index 00000000..92d23a6e --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Gizmo.cs @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Common.Logging; + +namespace Mooege.Core.GS.Actors +{ + public class Gizmo : Actor + { + public override ActorType ActorType { get { return ActorType.Gizmo; } } + protected Logger Logger = new Logger("Gizmo"); + + public Gizmo(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + this.Field2 = 16; + this.Field7 = 0x00000001; + + this.Attributes[Mooege.Net.GS.Message.GameAttribute.Hitpoints_Cur] = 1; + } + } +} diff --git a/src/Mooege/Core/GS/Actors/HandledSNO.cs b/src/Mooege/Core/GS/Actors/HandledSNO.cs new file mode 100644 index 00000000..a0746840 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/HandledSNO.cs @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; + +namespace Mooege.Core.GS.Actors +{ + /// + /// Allows implementing actors for given actorSNO's. + /// + [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] + public sealed class HandledSNOAttribute : Attribute + { + public List SNOIds { get; private set; } + + public HandledSNOAttribute(params int[] snoIds) + { + this.SNOIds = new List(); + this.SNOIds.AddRange(snoIds); + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Implementations/Artisans/Artisan.cs b/src/Mooege/Core/GS/Actors/Implementations/Artisans/Artisan.cs new file mode 100644 index 00000000..5fa1c335 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Artisans/Artisan.cs @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Core.GS.Actors.Interactions; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Players; +using Mooege.Net.GS.Message; +using Mooege.Net.GS.Message.Definitions.Artisan; + +namespace Mooege.Core.GS.Actors.Implementations.Artisans +{ + public class Artisan : InteractiveNPC + { + public Artisan(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + this.Attributes[GameAttribute.MinimapActive] = true; + + Interactions.Add(new CraftInteraction()); + } + + public override void OnCraft(Player player) + { + player.InGameClient.SendMessage(new OpenArtisanWindowMessage() { ArtisanID = this.DynamicID }); + } + + } +} diff --git a/src/Mooege/Core/GS/Actors/Implementations/Artisans/ArtisanShortcut.cs b/src/Mooege/Core/GS/Actors/Implementations/Artisans/ArtisanShortcut.cs new file mode 100644 index 00000000..0a7ff5c0 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Artisans/ArtisanShortcut.cs @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Net.GS.Message; +using Mooege.Net.GS.Message.Definitions.Artisan; +using Mooege.Net.GS.Message.Definitions.World; +using Mooege.Core.GS.Players; + +namespace Mooege.Core.GS.Actors.Implementations.Artisans +{ + [HandledSNO(0x0002FA63 /* PT_Blacksmith_ForgeWeaponShortcut.acr */, + 0x0002FA64 /*PT_Blacksmith_ForgeArmorShortcut.acr */, + 0x0002FA62 /*PT_Blacksmith_RepairShortcut.acr */, + 212519 /* Actor PT_Jeweler_AddSocketShortcut */, + 212517 /* Actor PT_Jeweler_CombineShortcut */, + 212521 /* Actor PT_Jeweler_RemoveGemShortcut */, + 212511 /* Actor PT_Mystic_EnhanceShortcut */, + 212510 /* Actor PT_Mystic_IdentifyShortcut */)] + public class ArtisanShortcut : InteractiveNPC + { + public ArtisanShortcut(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + Attributes[GameAttribute.MinimapActive] = false; + Attributes[GameAttribute.Conversation_Icon, 0] = 0; + } + + public override void OnTargeted(Player player, TargetMessage message) + { + player.InGameClient.SendMessage(new OpenArtisanWindowMessage() { ArtisanID = this.DynamicID }); + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Implementations/Artisans/Blacksmith.cs b/src/Mooege/Core/GS/Actors/Implementations/Artisans/Blacksmith.cs new file mode 100644 index 00000000..8e203f78 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Artisans/Blacksmith.cs @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Common.Types.TagMap; + +namespace Mooege.Core.GS.Actors.Implementations.Artisans +{ + [HandledSNO(56947 /* PT_Blacksmith.acr */)] + public class Blacksmith : Artisan + { + public Blacksmith(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + // TODO add all blacksmith functionality? /fasbat + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Implementations/Artisans/Jeweler.cs b/src/Mooege/Core/GS/Actors/Implementations/Artisans/Jeweler.cs new file mode 100644 index 00000000..3ee7e5dd --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Artisans/Jeweler.cs @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Core.GS.Items; +using Mooege.Core.GS.Map; +using Mooege.Net.GS.Message; +using Mooege.Core.GS.Common.Types.TagMap; + +namespace Mooege.Core.GS.Actors.Implementations.Artisans +{ + [HandledSNO(56949 /* PT_Jewler.acr */)] + public class Jeweler : Artisan + { + public Jeweler(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + + public void OnAddSocket(Players.Player player, Item item) + { + // TODO: Animate Jeweler? Who knows. /fasbat + item.Attributes[GameAttribute.Sockets] += 1; + // Why this not work? :/ + item.Attributes.SendChangedMessage(player.InGameClient); + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Implementations/Artisans/Mystic.cs b/src/Mooege/Core/GS/Actors/Implementations/Artisans/Mystic.cs new file mode 100644 index 00000000..52834943 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Artisans/Mystic.cs @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Common.Types.TagMap; + +namespace Mooege.Core.GS.Actors.Implementations.Artisans +{ + [HandledSNO(56948 /* PT_Mystic.acr */)] + public class Mystic : Artisan + { + public Mystic(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } +} \ No newline at end of file diff --git a/src/Mooege/Core/GS/Actors/Implementations/Cain.cs b/src/Mooege/Core/GS/Actors/Implementations/Cain.cs new file mode 100644 index 00000000..09ff2e9b --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Cain.cs @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Players; +using Mooege.Net.GS.Message; +using Mooege.Core.GS.Actors.Interactions; +using Mooege.Core.GS.Common.Types.TagMap; + +namespace Mooege.Core.GS.Actors.Implementations +{ + [HandledSNO(3533)] //Cain + public class Cain : InteractiveNPC + { + public Cain(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { } + + protected override void ReadTags() + { + if (!Tags.ContainsKey(MarkerKeys.ConversationList)) + Tags.Add(MarkerKeys.ConversationList, new TagMapEntry(MarkerKeys.ConversationList.ID, 108832, 2)); + + base.ReadTags(); + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Implementations/CaptainRumford.cs b/src/Mooege/Core/GS/Actors/Implementations/CaptainRumford.cs new file mode 100644 index 00000000..53a04244 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/CaptainRumford.cs @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Common.Types.TagMap; + +namespace Mooege.Core.GS.Actors.Implementations +{ + [HandledSNO(3739)] + class CaptainRumford : InteractiveNPC + { + public CaptainRumford(World world, int snoID, TagMap tags) + : base(world, snoID, tags) + { } + + // One of the rumfords is not tagged with a conversation list, although his conversation list is available. + // there may be two reasons for this: ConversationLists are not used anymore which i doubt as i works beautifully with them + // or the information is no longer available in the client which would be possible tagging and stuff is only relevant to the server + // TODO If the client lacks all information, we need a system to combine mpq data with custom data + protected override void ReadTags() + { + if (!Tags.ContainsKey(MarkerKeys.ConversationList)) + Tags.Add(MarkerKeys.ConversationList, new TagMapEntry(MarkerKeys.ConversationList.ID, 108832, 2)); + + base.ReadTags(); + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Implementations/Checkpoint.cs b/src/Mooege/Core/GS/Actors/Implementations/Checkpoint.cs new file mode 100644 index 00000000..018aaaa5 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Checkpoint.cs @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Net.GS.Message.Definitions.Effect; + +namespace Mooege.Core.GS.Actors.Implementations +{ + /// + /// Implementation of checkpoints. Do they have any other purpose than sending the checkpoint visual? + /// + class Checkpoint : Gizmo + { + private bool _checkpointReached = false; + + public Checkpoint(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + + } + + public override void OnPlayerApproaching(Players.Player player) + { + if (player.Position.DistanceSquared(ref _position) < ActorData.Sphere.Radius * ActorData.Sphere.Radius * this.Scale * this.Scale && !_checkpointReached) + { + _checkpointReached = true; + + this.World.BroadcastIfRevealed(new PlayEffectMessage + { + ActorId = player.DynamicID, + Effect = Effect.Checkpoint + }, this); + } + } + + } +} diff --git a/src/Mooege/Core/GS/Actors/Implementations/DesctructibleLootContainer.cs b/src/Mooege/Core/GS/Actors/Implementations/DesctructibleLootContainer.cs new file mode 100644 index 00000000..6ed35a19 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/DesctructibleLootContainer.cs @@ -0,0 +1,101 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Net.GS.Message.Definitions.Animation; +using Mooege.Net.GS.Message; +using Mooege.Net.GS.Message.Definitions.Misc; +using TreasureClass = Mooege.Common.MPQ.FileFormats.TreasureClass; + +namespace Mooege.Core.GS.Actors.Implementations +{ + /// + /// Class that implements behaviour for killable gizmos. + /// Play die animation on click, then set idle animation, drop loot and remove from server + /// + class DesctructibleLootContainer : Gizmo + { + private TreasureClass TreasureClass; + + public DesctructibleLootContainer(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + if (ActorData.TagMap.ContainsKey(ActorKeys.LootTreasureClass)) + TreasureClass = (TreasureClass)ActorData.TagMap[ActorKeys.LootTreasureClass].Target; + } + + public void ReceiveDamage(Actor source, float damage /* critical, type */) + { + World.BroadcastIfRevealed(new FloatingNumberMessage + { + Number = damage, + ActorID = this.DynamicID, + Type = FloatingNumberMessage.FloatType.White + }, this); + + + Attributes[GameAttribute.Hitpoints_Cur] = Math.Max(Attributes[GameAttribute.Hitpoints_Cur] - damage, 0); + Attributes[GameAttribute.Last_Damage_ACD] = unchecked((int)source.DynamicID); + + Attributes.BroadcastChangedIfRevealed(); + + if (Attributes[GameAttribute.Hitpoints_Cur] == 0) + { + Die(); + } + } + + public void Die() + { + if (this.TreasureClass != null) + foreach (var player in this.GetPlayersInRange(30)) + World.DropItem(this, null, this.TreasureClass.CreateDrop(player)); + + World.BroadcastIfRevealed(new PlayAnimationMessage + { + ActorID = this.DynamicID, + Field1 = 11, + Field2 = 0, + tAnim = new Net.GS.Message.Fields.PlayAnimationMessageSpec[] + { + new Net.GS.Message.Fields.PlayAnimationMessageSpec() + { + Duration = 10, + AnimationSNO = AnimationSet.TagMapAnimDefault[AnimationSetKeys.DeathDefault], + PermutationIndex = 0, + Speed = 1 + } + } + + }, this); + + this.Attributes[GameAttribute.Deleted_On_Server] = true; + this.Attributes[GameAttribute.Could_Have_Ragdolled] = true; + Attributes.BroadcastChangedIfRevealed(); + this.Destroy(); + } + + + public override void OnTargeted(Players.Player player, Net.GS.Message.Definitions.World.TargetMessage message) + { + ReceiveDamage(player, 100); + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Implementations/Door.cs b/src/Mooege/Core/GS/Actors/Implementations/Door.cs new file mode 100644 index 00000000..0dde61de --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Door.cs @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2011-2012 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Net.GS.Message.Definitions.Animation; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Net.GS.Message; +using TreasureClass = Mooege.Common.MPQ.FileFormats.TreasureClass; + +namespace Mooege.Core.GS.Actors.Implementations +{ + /// + /// Class that implements behaviour for clickable door types. + /// Play open animation on click, then set idle animation + /// + class Door : Gizmo + { + public Door(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + + + public override void OnTargeted(Players.Player player, Net.GS.Message.Definitions.World.TargetMessage message) + { + World.BroadcastIfRevealed(new PlayAnimationMessage + { + ActorID = this.DynamicID, + Field1 = 5, + Field2 = 0, + tAnim = new Net.GS.Message.Fields.PlayAnimationMessageSpec[] + { + new Net.GS.Message.Fields.PlayAnimationMessageSpec() + { + Duration = 50, + AnimationSNO = AnimationSet.TagMapAnimDefault[AnimationSetKeys.Opening], + PermutationIndex = 0, + Speed = 1 + } + } + + }, this); + + World.BroadcastIfRevealed(new SetIdleAnimationMessage + { + ActorID = this.DynamicID, + AnimationSNO = AnimationSetKeys.Open.ID + }, this); + + this.Attributes[GameAttribute.Gizmo_Has_Been_Operated] = true; + this.Attributes[GameAttribute.Gizmo_Operator_ACDID] = unchecked((int)player.DynamicID); + this.Attributes[GameAttribute.Gizmo_State] = 1; + Attributes.BroadcastChangedIfRevealed(); + + base.OnTargeted(player, message); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Core/GS/Actors/Implementations/Healthwell.cs b/src/Mooege/Core/GS/Actors/Implementations/Healthwell.cs new file mode 100644 index 00000000..96ea16df --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Healthwell.cs @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Net.GS.Message; + +namespace Mooege.Core.GS.Actors.Implementations +{ + /// + /// Class that implements healthwell, run power on click and change gizmo state + /// + class Healthwell : Gizmo + { + public Healthwell(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + Attributes[GameAttribute.MinimapActive] = true; + Attributes[GameAttribute.Gizmo_State] = 0; + } + + + public override void OnTargeted(Players.Player player, Net.GS.Message.Definitions.World.TargetMessage message) + { + Logger.Warn("Healthwell has no function, Powers not implemented"); + + this.Attributes[GameAttribute.Gizmo_Has_Been_Operated] = true; + this.Attributes[GameAttribute.Gizmo_Operator_ACDID] = unchecked((int)player.DynamicID); + this.Attributes[GameAttribute.Gizmo_State] = 1; + Attributes.BroadcastChangedIfRevealed(); + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Implementations/Hirelings/Enchantress.cs b/src/Mooege/Core/GS/Actors/Implementations/Hirelings/Enchantress.cs new file mode 100644 index 00000000..66108f89 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Hirelings/Enchantress.cs @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Common.Helpers.Hash; +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Common.Types.TagMap; + +namespace Mooege.Core.GS.Actors.Implementations.Hirelings +{ + [HandledSNO(4062 /* Enchantress.acr */)] + public class Enchantress : Hireling + { + public Enchantress(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + mainSNO = 4062; + hirelingSNO = -1; + proxySNO = 192942; + skillKit = 87094; + hirelingGBID = StringHashHelper.HashItemName("Enchantress"); + Attributes[Mooege.Net.GS.Message.GameAttribute.Hireling_Class] = 3; + } + + public override Hireling CreateHireling(World world, int snoId, TagMap tags) + { + return new Enchantress(world, snoId, tags); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Core/GS/Actors/Implementations/Hirelings/Hireling.cs b/src/Mooege/Core/GS/Actors/Implementations/Hirelings/Hireling.cs new file mode 100644 index 00000000..dc3483a1 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Hirelings/Hireling.cs @@ -0,0 +1,437 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Players; +using Mooege.Net.GS.Message; +using Mooege.Core.GS.Actors.Interactions; +using Mooege.Net.GS.Message.Definitions.Inventory; +using Mooege.Net.GS.Message.Fields; +using System; +using Mooege.Core.GS.Common.Types.TagMap; + +namespace Mooege.Core.GS.Actors.Implementations.Hirelings +{ + public class Hireling : InteractiveNPC + { + protected int mainSNO = -1; + protected int hirelingSNO = -1; + protected int proxySNO = -1; + protected int skillKit = -1; + protected int hirelingGBID = -1; + + + private World originalWorld = null; + private PRTransform originalPRT = null; + + protected Player owner = null; + + public bool IsProxy { get { return ActorSNO.Id == proxySNO; } } + public bool IsHireling { get { return ActorSNO.Id == hirelingSNO; } } + public bool HasHireling { get { return this.hirelingSNO != -1; } } + public bool HasProxy { get { return this.proxySNO != -1; } } + public int PetType { get { return IsProxy ? 22 : 0; } } + + + public Hireling(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + //this.Attributes[GameAttribute.TeamID] = 2; + Interactions.Add(new HireInteraction()); + Interactions.Add(new InventoryInteraction()); + } + + private void SetUpAttributes(Player player) + { + this.owner = player; + + var info = player.HirelingInfo[this.Attributes[GameAttribute.Hireling_Class]]; + + // TODO: fix this hardcoded crap + if (!IsProxy) + this.Attributes[GameAttribute.Buff_Visual_Effect, 0x000FFFFF] = true; + + //scripted //this.Attributes[GameAttribute.Hitpoints_Max_Total] = 308.25f; + //scripted //this.Attributes[GameAttribute.Hitpoints_Total_From_Level] = 3.051758E-05f; + + if (!IsHireling && !IsProxy) // original doesn't need more attribs + { + this.Attributes[GameAttribute.Level] = info.Level; + return; + } + + this.Attributes[GameAttribute.Level] = info.Level; + + if (info.Skill1SNOId != -1) + { + //scripted //this.Attributes[GameAttribute.Skill_Total, info.Skill1SNOId] = 1; + this.Attributes[GameAttribute.Skill, info.Skill1SNOId] = 1; + } + + if (info.Skill2SNOId != -1) + { + //scripted //this.Attributes[GameAttribute.Skill_Total, info.Skill2SNOId] = 1; + this.Attributes[GameAttribute.Skill, info.Skill2SNOId] = 1; + } + + if (info.Skill3SNOId != -1) + { + //scripted //this.Attributes[GameAttribute.Skill_Total, info.Skill3SNOId] = 1; + this.Attributes[GameAttribute.Skill, info.Skill3SNOId] = 1; + } + + if (info.Skill4SNOId != -1) + { + //scripted //this.Attributes[GameAttribute.Skill_Total, info.Skill4SNOId] = 1; + this.Attributes[GameAttribute.Skill, info.Skill4SNOId] = 1; + } + + this.Attributes[GameAttribute.SkillKit] = skillKit; + + #region hardcoded attribs :/ + + this.Attributes[GameAttribute.Armor_Item] = 20; + //scripted //this.Attributes[GameAttribute.Armor_Item_SubTotal] = 20; + //scripted //this.Attributes[GameAttribute.Armor_Item_Total] = 20; + //scripted //this.Attributes[GameAttribute.Armor_Total] = 20; + this.Attributes[GameAttribute.Attack] = 23; + this.Attributes[GameAttribute.Attacks_Per_Second] = 1f; + this.Attributes[GameAttribute.Attacks_Per_Second_Item] = 1.199219f; + //scripted //this.Attributes[GameAttribute.Attacks_Per_Second_Item_CurrentHand] = 1.199219f; + //scripted //this.Attributes[GameAttribute.Attacks_Per_Second_Item_MainHand] = 1.199219f; + //scripted //this.Attributes[GameAttribute.Attacks_Per_Second_Item_Subtotal] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Attacks_Per_Second_Item_Total] = 1.199219f; + //scripted //this.Attributes[GameAttribute.Attacks_Per_Second_Item_Total_MainHand] = 1.199219f; + //scripted //this.Attributes[GameAttribute.Attacks_Per_Second_Total] = 1.199219f; + this.Attributes[GameAttribute.Block_Amount_Item_Delta] = 4; + this.Attributes[GameAttribute.Block_Amount_Item_Min] = 6; + //scripted //this.Attributes[GameAttribute.Block_Amount_Total_Min] = 6; + this.Attributes[GameAttribute.Block_Chance_Item] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Block_Chance_Item_Total] = 0.1099854f; + //scripted //this.Attributes[GameAttribute.Block_Chance_Total] = 0.1099854f; + this.Attributes[GameAttribute.Casting_Speed] = 1; + //scripted //this.Attributes[GameAttribute.Casting_Speed_Total] = 1; + this.Attributes[GameAttribute.Damage_Delta, 0] = 2; + //scripted //this.Attributes[GameAttribute.Damage_Delta_Total, 0] = 2; + this.Attributes[GameAttribute.Damage_Min, 0] = 6.808594f; + //scripted //this.Attributes[GameAttribute.Damage_Min_Subtotal, 0] = 6.808594f; + //scripted //this.Attributes[GameAttribute.Damage_Min_Total, 0] = 6.808594f; + this.Attributes[GameAttribute.Damage_Weapon_Delta, 0] = 2; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Delta_SubTotal, 0] = 2; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0] = 2; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Delta_Total_All] = 2; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Delta_Total_CurrentHand, 0] = 2; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Delta_Total_MainHand, 0] = 2; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Max, 0] = 8; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Max_Total, 0] = 8; + this.Attributes[GameAttribute.Damage_Weapon_Min, 0] = 6; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Min_Total, 0] = 6; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Min_Total_All] = 6; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Min_Total_CurrentHand, 0] = 6; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Min_Total_MainHand, 0] = 6; + this.Attributes[GameAttribute.Defense] = 23; + this.Attributes[GameAttribute.Experience_Granted] = 0x28; + this.Attributes[GameAttribute.Experience_Next] = 0x003C19; + this.Attributes[GameAttribute.General_Cooldown] = 0; + this.Attributes[GameAttribute.Get_Hit_Damage] = 20; + //scripted //this.Attributes[GameAttribute.Get_Hit_Max] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Get_Hit_Recovery] = 3.051758E-05f; + this.Attributes[GameAttribute.Hit_Chance] = 1; + this.Attributes[GameAttribute.Hitpoints_Factor_Vitality] = 4f; // TODO: check if this is suppose to be 10 like player's + this.Attributes[GameAttribute.Hitpoints_Max] = 216.25f; + //scripted //this.Attributes[GameAttribute.Hitpoints_Max_Total] = 308.25f; + //scripted //this.Attributes[GameAttribute.Hitpoints_Total_From_Level] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Hitpoints_Total_From_Vitality] = 92; + this.Attributes[GameAttribute.Hitpoints_Cur] = 308.25f; + this.Attributes[GameAttribute.Level_Cap] = 60; + this.Attributes[GameAttribute.Movement_Scalar] = 1; + //scripted //this.Attributes[GameAttribute.Movement_Scalar_Capped_Total] = 1; + //scripted //this.Attributes[GameAttribute.Movement_Scalar_Subtotal] = 1; + //scripted //this.Attributes[GameAttribute.Movement_Scalar_Total] = 1; + this.Attributes[GameAttribute.Precision] = 23; + //scripted //this.Attributes[GameAttribute.Resource_Effective_Max, 0] = 1; + this.Attributes[GameAttribute.Resource_Max, 0] = 1.0f; + //scripted //this.Attributes[GameAttribute.Resource_Max_Total, 0] = 1.0f; + //scripted //this.Attributes[GameAttribute.Resource_Regen_Total, 0] = 3.051758E-05f; + this.Attributes[GameAttribute.Resource_Cur, 0] = 1.0f; + this.Attributes[GameAttribute.Resource_Type_Primary] = 0; + this.Attributes[GameAttribute.Running_Rate] = 0.3598633f; + //scripted //this.Attributes[GameAttribute.Running_Rate_Total] = 0.3598633f; + this.Attributes[GameAttribute.Sprinting_Rate] = 0.3598633f; + //scripted //this.Attributes[GameAttribute.Sprinting_Rate_Total] = 0.3598633f; + this.Attributes[GameAttribute.Strafing_Rate] = 0.1799316f; + //scripted //this.Attributes[GameAttribute.Strafing_Rate_Total] = 0.1799316f; + this.Attributes[GameAttribute.Vitality] = 23; + this.Attributes[GameAttribute.Walking_Rate] = 0.3598633f; + //scripted //this.Attributes[GameAttribute.Walking_Rate_Total] = 0.3598633f; + + if (IsProxy) + return; + + this.Attributes[GameAttribute.Callout_Cooldown, 0x000FFFFF] = 0x00000797; + this.Attributes[GameAttribute.Buff_Visual_Effect, 0x000FFFFF] = true; + this.Attributes[GameAttribute.Buff_Icon_Count0, 0x000075C1] = 1; + this.Attributes[GameAttribute.Buff_Active, 0x000075C1] = true; + this.Attributes[GameAttribute.Conversation_Icon, 0] = 0; + this.Attributes[GameAttribute.Buff_Active, 0x20c51] = true; + this.Attributes[GameAttribute.Buff_Icon_End_Tick0, 0x00020C51] = 0x00000A75; + this.Attributes[GameAttribute.Buff_Icon_Start_Tick0, 0x00020C51] = 0x00000375; + this.Attributes[GameAttribute.Buff_Icon_Count0, 0x00020C51] = 3; + this.Attributes[GameAttribute.Callout_Cooldown, 0x1618a] = 743; + this.Attributes[GameAttribute.Callout_Cooldown, 0x01CAB6] = 743; + #endregion + + } + + public virtual Hireling CreateHireling(World world, int snoId, TagMap tags) + { + throw new NotImplementedException(); + } + + public override void OnHire(Player player) + { + if (hirelingSNO == -1) + return; + + if (IsHireling || IsProxy) + return; // This really shouldn't happen.. /fasbat + + this.Unreveal(player); + var hireling = CreateHireling(this.World, hirelingSNO, this.Tags); + hireling.SetUpAttributes(player); + hireling.originalWorld = this.World; + hireling.originalPRT = this.Transform; + hireling.GBHandle.Type = 4; + hireling.GBHandle.GBID = hirelingGBID; + + hireling.Attributes[GameAttribute.Pet_Creator] = player.PlayerIndex; + hireling.Attributes[GameAttribute.Pet_Type] = 0; + hireling.Attributes[GameAttribute.Pet_Owner] = player.PlayerIndex; + + hireling.RotationW = this.RotationW; + hireling.RotationAxis = this.RotationAxis; + + hireling.EnterWorld(this.Position); + player.ActiveHireling = hireling; + this.Destroy(); + player.SelectedNPC = null; + } + + public override void OnInventory(Player player) + { + if (proxySNO == -1) + return; + + if (IsHireling || IsProxy) + return; + + if (player.ActiveHireling != null && + player.ActiveHireling.Attributes[GameAttribute.Hireling_Class] == this.Attributes[GameAttribute.Hireling_Class]) + return; + + if (player.ActiveHirelingProxy != null && + player.ActiveHirelingProxy.Attributes[GameAttribute.Hireling_Class] == this.Attributes[GameAttribute.Hireling_Class]) + return; + var hireling = CreateHireling(this.World, proxySNO, this.Tags); + hireling.SetUpAttributes(player); + hireling.originalWorld = this.World; + hireling.originalPRT = this.Transform; + hireling.GBHandle.Type = 4; + hireling.GBHandle.GBID = hirelingGBID; + hireling.Attributes[GameAttribute.Is_NPC] = false; + hireling.Attributes[GameAttribute.NPC_Is_Operatable] = false; + hireling.Attributes[GameAttribute.NPC_Has_Interact_Options, 0] = false; + hireling.Attributes[GameAttribute.Buff_Visual_Effect, 0x00FFFFF] = false; + hireling.Attributes[GameAttribute.Pet_Creator] = player.PlayerIndex; + hireling.Attributes[GameAttribute.Pet_Type] = 22; + hireling.Attributes[GameAttribute.Pet_Owner] = player.PlayerIndex; + + hireling.RotationW = this.RotationW; + hireling.RotationAxis = this.RotationAxis; + + hireling.EnterWorld(this.Position); + player.ActiveHirelingProxy = hireling; + } + + public void Dismiss(Player player) + { + this.Unreveal(player); + if (this.IsHireling) + { + var original = CreateHireling(originalWorld, mainSNO, this.Tags); + original.SetUpAttributes(player); + original.RotationW = this.originalPRT.Quaternion.W; + original.RotationAxis = this.originalPRT.Quaternion.Vector3D; + original.EnterWorld(this.originalPRT.Vector3D); + } + this.Destroy(); + } + + public override bool Reveal(Player player) + { + if (owner == null) + SetUpAttributes(player); + else if (IsProxy && owner != player) + return false; + + if (!base.Reveal(player)) + return false; + + if (IsProxy) + { + player.InGameClient.SendMessage(new VisualInventoryMessage() + { + ActorID = this.DynamicID, + EquipmentList = new VisualEquipment() + { + Equipment = new VisualItem[] + { + new VisualItem() + { + GbId = -1, + Field1 = 0, + Field2 = 0, + Field3 = 0, + }, + new VisualItem() + { + GbId = -1, + Field1 = 0, + Field2 = 0, + Field3 = 0, + }, + new VisualItem() + { + GbId = -1, + Field1 = 0, + Field2 = 0, + Field3 = 0, + }, + new VisualItem() + { + GbId = -1, + Field1 = 0, + Field2 = 0, + Field3 = 0, + }, + new VisualItem() + { + GbId = -1, + Field1 = 0, + Field2 = 0, + Field3 = 0, + }, + new VisualItem() + { + GbId = -1, + Field1 = 0, + Field2 = 0, + Field3 = 0, + }, + new VisualItem() + { + GbId = -1, + Field1 = 0, + Field2 = 0, + Field3 = 0, + }, + new VisualItem() + { + GbId = -1, + Field1 = 0, + Field2 = 0, + Field3 = 0, + }, + } + } + }); + return true; + } + + player.InGameClient.SendMessage(new VisualInventoryMessage() + { + ActorID = this.DynamicID, + EquipmentList = new VisualEquipment() + { + Equipment = new VisualItem[] + { + new VisualItem() + { + GbId = -1, + Field1 = 0, + Field2 = 0, + Field3 = 0, + }, + new VisualItem() + { + GbId = -1, + Field1 = 0, + Field2 = 0, + Field3 = 0, + }, + new VisualItem() + { + GbId = -1, + Field1 = 0, + Field2 = 0, + Field3 = 0, + }, + new VisualItem() + { + GbId = -1, + Field1 = 0, + Field2 = 0, + Field3 = 0, + }, + new VisualItem() + { + GbId = unchecked((int)0xF9F6170B), + Field1 = 0, + Field2 = 0, + Field3 = -1, + }, + new VisualItem() + { + GbId = 0x6C3B0389, + Field1 = 0, + Field2 = 0, + Field3 = -1, + }, + new VisualItem() + { + GbId = -1, + Field1 = 0, + Field2 = 0, + Field3 = 0, + }, + new VisualItem() + { + GbId = -1, + Field1 = 0, + Field2 = 0, + Field3 = 0, + }, + } + } + }); + + return true; + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Implementations/Hirelings/Scoundrel.cs b/src/Mooege/Core/GS/Actors/Implementations/Hirelings/Scoundrel.cs new file mode 100644 index 00000000..7e4f0cf8 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Hirelings/Scoundrel.cs @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Common.Helpers.Hash; +using Mooege.Core.GS.Map; +using Mooege.Net.GS.Message; +using Mooege.Core.GS.Common.Types.TagMap; + +namespace Mooege.Core.GS.Actors.Implementations.Hirelings +{ + [HandledSNO(4644 /* Scoundrel.acr */)] + public class Scoundrel : Hireling + { + public Scoundrel(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + mainSNO = 4644; + hirelingSNO = 52694; + proxySNO = 192941; + skillKit = 0x8AFE; + hirelingGBID = StringHashHelper.HashItemName("Scoundrel"); + Attributes[GameAttribute.Hireling_Class] = 2; + } + + public override Hireling CreateHireling(World world, int snoId, TagMap tags) + { + return new Scoundrel(world, snoId, tags); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Core/GS/Actors/Implementations/Hirelings/Templar.cs b/src/Mooege/Core/GS/Actors/Implementations/Hirelings/Templar.cs new file mode 100644 index 00000000..d935b7e2 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Hirelings/Templar.cs @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Common.Helpers.Hash; +using Mooege.Core.GS.Map; +using Mooege.Net.GS.Message; +using Mooege.Core.GS.Common.Types.TagMap; + +namespace Mooege.Core.GS.Actors.Implementations.Hirelings +{ + [HandledSNO(4538 /* Templar.acr */)] + public class Templar : Hireling + { + public Templar(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + mainSNO = 4538; + hirelingSNO = 0x0000CDD5; + proxySNO = 0x0002F1AC; + skillKit = 0x8AFB; + hirelingGBID = StringHashHelper.HashItemName("Templar"); + this.Attributes[GameAttribute.Hireling_Class] = 1; + } + + public override Hireling CreateHireling(World world, int snoId, TagMap tags) + { + return new Templar(world, snoId, tags); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Core/GS/Actors/Implementations/LootContainer.cs b/src/Mooege/Core/GS/Actors/Implementations/LootContainer.cs new file mode 100644 index 00000000..0b43eb85 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/LootContainer.cs @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Net.GS.Message.Definitions.Animation; +using Mooege.Net.GS.Message; +using TreasureClass = Mooege.Common.MPQ.FileFormats.TreasureClass; + +namespace Mooege.Core.GS.Actors.Implementations +{ + /// + /// Class that implements behaviour for clickable loot types. + /// Play open animation on click, then set idle animation and drop loot + /// + class LootContainer : Gizmo + { + private TreasureClass _treasureClass; + + public LootContainer(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + try + { + _treasureClass = (TreasureClass)ActorData.TagMap[ActorKeys.LootTreasureClass].Target; + } + catch (Exception) + { + Logger.Warn("Could not load treasure class for loot actor because it is either not tagged or the treasure class is not available. Using standard treasure class instead"); + _treasureClass = TreasureClass.GenericTreasure; + } + } + + + public override void OnTargeted(Players.Player player, Net.GS.Message.Definitions.World.TargetMessage message) + { + // TODO Are chests dropping loot for everyone or only for the one opening it + foreach (var p in this.GetPlayersInRange(30)) + World.DropItem(this, null, _treasureClass.CreateDrop(player)); + + World.BroadcastIfRevealed(new PlayAnimationMessage + { + ActorID = this.DynamicID, + Field1 = 5, + Field2 = 0, + tAnim = new Net.GS.Message.Fields.PlayAnimationMessageSpec[] + { + new Net.GS.Message.Fields.PlayAnimationMessageSpec() + { + Duration = 50, + AnimationSNO = AnimationSet.TagMapAnimDefault[AnimationSetKeys.Opening], + PermutationIndex = 0, + Speed = 1 + } + } + + }, this); + + World.BroadcastIfRevealed(new SetIdleAnimationMessage + { + ActorID = this.DynamicID, + AnimationSNO = AnimationSetKeys.Open.ID + }, this); + + this.Attributes[GameAttribute.Gizmo_Has_Been_Operated] = true; + this.Attributes[GameAttribute.Gizmo_Operator_ACDID] = unchecked((int)player.DynamicID); + this.Attributes[GameAttribute.Chest_Open, 0xFFFFFF] = true; + Attributes.BroadcastChangedIfRevealed(); + + base.OnTargeted(player, message); + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Implementations/Minions/AncientKorlic.cs b/src/Mooege/Core/GS/Actors/Implementations/Minions/AncientKorlic.cs new file mode 100644 index 00000000..d228a1bd --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Minions/AncientKorlic.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Core.GS.AI; +using Mooege.Core.GS.Powers; +using Mooege.Core.GS.AI.Brains; +using Mooege.Net.GS.Message; +using Mooege.Core.GS.Ticker; +using Mooege.Core.GS.Players; +using Mooege.Net.GS.Message.Definitions.Pet; + +namespace Mooege.Core.GS.Actors.Implementations.Minions +{ + class AncientKorlic : Minion + { + public AncientKorlic(Map.World world, PowerContext context, int AncientsID) + : base(world, 90443, context.User, null) + { + Scale = 1.2f; //they look cooler bigger :) + //TODO: get a proper value for this. + this.WalkSpeed *= 5; + SetBrain(new MinionBrain(this)); + (Brain as MinionBrain).AddPresetPower(30592); //Weapon_Instant + (Brain as MinionBrain).AddPresetPower(187092); //basic melee + (Brain as MinionBrain).AddPresetPower(168823); //cleave + (Brain as MinionBrain).AddPresetPower(168824); //furious charge //Only Active with Rune_A + //TODO: These values should most likely scale, but we don't know how yet, so just temporary values. + Attributes[GameAttribute.Hitpoints_Max] = 20f; + Attributes[GameAttribute.Hitpoints_Cur] = 20f; + Attributes[GameAttribute.Attacks_Per_Second] = 1.0f; + + Attributes[GameAttribute.Damage_Weapon_Min, 0] = context.ScriptFormula(11) * context.User.Attributes[GameAttribute.Damage_Weapon_Min_Total, 0]; + Attributes[GameAttribute.Damage_Weapon_Delta, 0] = context.ScriptFormula(13) * context.User.Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0]; + + Attributes[GameAttribute.Pet_Type] = 0x8; + //Pet_Owner and Pet_Creator seems to be 0 + (context.User as Player).InGameClient.SendMessage(new PetMessage() + { + Field0 = 0, + Field1 = AncientsID, + PetId = this.DynamicID, + Field3 = 0x8, + }); + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Implementations/Minions/AncientMawdawc.cs b/src/Mooege/Core/GS/Actors/Implementations/Minions/AncientMawdawc.cs new file mode 100644 index 00000000..f1b9ff16 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Minions/AncientMawdawc.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Core.GS.Powers; +using Mooege.Core.GS.AI.Brains; +using Mooege.Net.GS.Message; +using Mooege.Core.GS.Ticker; +using Mooege.Core.GS.Players; +using Mooege.Net.GS.Message.Definitions.Pet; + +namespace Mooege.Core.GS.Actors.Implementations.Minions +{ + class AncientMawdawc : Minion + { + public AncientMawdawc(Map.World world, PowerContext context, int AncientsID) + : base(world, 90536, context.User, null) + { + Scale = 1.2f; //they look cooler bigger :) + //TODO: get a proper value for this. + this.WalkSpeed *= 5; + SetBrain(new MinionBrain(this)); + (Brain as MinionBrain).AddPresetPower(30592); //Weapon_Instant + (Brain as MinionBrain).AddPresetPower(187092); //basic melee + (Brain as MinionBrain).AddPresetPower(168827); //Seismic Slam //Only Active with Rune_C + (Brain as MinionBrain).AddPresetPower(168828); //Weapon Throw + //TODO: These values should most likely scale, but we don't know how yet, so just temporary values. + Attributes[GameAttribute.Hitpoints_Max] = 20f; + Attributes[GameAttribute.Hitpoints_Cur] = 20f; + Attributes[GameAttribute.Attacks_Per_Second] = 1.0f; + + Attributes[GameAttribute.Damage_Weapon_Min, 0] = context.ScriptFormula(11) * context.User.Attributes[GameAttribute.Damage_Weapon_Min_Total, 0]; + Attributes[GameAttribute.Damage_Weapon_Delta, 0] = context.ScriptFormula(13) * context.User.Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0]; + + Attributes[GameAttribute.Pet_Type] = 0x8; + //Pet_Owner and Pet_Creator seems to be 0 + (context.User as Player).InGameClient.SendMessage(new PetMessage() + { + Field0 = 0, + Field1 = AncientsID, + PetId = this.DynamicID, + Field3 = 0x8, + }); + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Implementations/Minions/AncientTalic.cs b/src/Mooege/Core/GS/Actors/Implementations/Minions/AncientTalic.cs new file mode 100644 index 00000000..88131ea7 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Minions/AncientTalic.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Core.GS.Powers; +using Mooege.Core.GS.AI.Brains; +using Mooege.Net.GS.Message; +using Mooege.Core.GS.Ticker; +using Mooege.Core.GS.Players; +using Mooege.Net.GS.Message.Definitions.Pet; + +namespace Mooege.Core.GS.Actors.Implementations.Minions +{ + class AncientTalic : Minion + { + public AncientTalic(Map.World world, PowerContext context, int AncientsID) + : base(world, 90535, context.User, null) + { + Scale = 1.2f; //they look cooler bigger :) + //TODO: get a proper value for this. + this.WalkSpeed *= 5; + SetBrain(new MinionBrain(this)); + (Brain as MinionBrain).AddPresetPower(30592); //Weapon_Instant + (Brain as MinionBrain).AddPresetPower(187092); //basic melee + (Brain as MinionBrain).AddPresetPower(168825); //Leap //Only Active with Rune_E + (Brain as MinionBrain).AddPresetPower(168830); //WhirlWind + //TODO: These values should most likely scale, but we don't know how yet, so just temporary values. + Attributes[GameAttribute.Hitpoints_Max] = 20f; + Attributes[GameAttribute.Hitpoints_Cur] = 20f; + Attributes[GameAttribute.Attacks_Per_Second] = 1.0f; + + Attributes[GameAttribute.Damage_Weapon_Min, 0] = context.ScriptFormula(11) * context.User.Attributes[GameAttribute.Damage_Weapon_Min_Total, 0]; + Attributes[GameAttribute.Damage_Weapon_Delta, 0] = context.ScriptFormula(13) * context.User.Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0]; + + Attributes[GameAttribute.Pet_Type] = 0x8; + //Pet_Owner and Pet_Creator seems to be 0 + (context.User as Player).InGameClient.SendMessage(new PetMessage() + { + Field0 = 0, + Field1 = AncientsID, + PetId = this.DynamicID, + Field3 = 0x8, + }); + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Implementations/Minions/CompanionMinion.cs b/src/Mooege/Core/GS/Actors/Implementations/Minions/CompanionMinion.cs new file mode 100644 index 00000000..d02ac00e --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Minions/CompanionMinion.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Core.GS.Powers; +using Mooege.Core.GS.AI.Brains; +using Mooege.Net.GS.Message; +using Mooege.Core.GS.Ticker; +using Mooege.Core.GS.Players; +using Mooege.Net.GS.Message.Definitions.Pet; + +namespace Mooege.Core.GS.Actors.Implementations.Minions +{ + class CompanionMinion : Minion + { + //Changes creature with each rune, + //RuneSelect(133741, 173827, 181748, 159098, 159102, 159144) + + public CompanionMinion(Map.World world, PowerContext context, int CompanionID) + : base(world, 133741, context.User, null) + { + Scale = 1.2f; //they look cooler bigger :) + //TODO: get a proper value for this. + this.WalkSpeed *= 5; + SetBrain(new MinionBrain(this)); + (Brain as MinionBrain).AddPresetPower(169081); //melee_instant + (Brain as MinionBrain).AddPresetPower(133887); //ChargeAttack + //TODO: These values should most likely scale, but we don't know how yet, so just temporary values. + Attributes[GameAttribute.Hitpoints_Max] = 20f; + Attributes[GameAttribute.Hitpoints_Cur] = 20f; + Attributes[GameAttribute.Attacks_Per_Second] = 1.0f; + + Attributes[GameAttribute.Damage_Weapon_Min, 0] = context.ScriptFormula(0) * context.User.Attributes[GameAttribute.Damage_Weapon_Min_Total, 0]; + + Attributes[GameAttribute.Pet_Type] = 0x8; + //Pet_Owner and Pet_Creator seems to be 0 + (context.User as Player).InGameClient.SendMessage(new PetMessage() + { + Field0 = 0, + Field1 = CompanionID, + PetId = this.DynamicID, + Field3 = 0x8, + }); + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Implementations/Minions/CorpseSpider.cs b/src/Mooege/Core/GS/Actors/Implementations/Minions/CorpseSpider.cs new file mode 100644 index 00000000..f5b44572 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Minions/CorpseSpider.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Core.GS.Powers; +using Mooege.Core.GS.AI.Brains; +using Mooege.Net.GS.Message; +using Mooege.Core.GS.Ticker; +using Mooege.Core.GS.Players; +using Mooege.Net.GS.Message.Definitions.Pet; + +namespace Mooege.Core.GS.Actors.Implementations.Minions +{ + class CorpseSpider : Minion + { + + //107031, 106731, 106749, 107067, 107107, 107112 + + public CorpseSpider(Map.World world, PowerContext context, int SpiderID) + : base(world, 107031, context.User, null) + { + Scale = 1.2f; //they look cooler bigger :) + //TODO: get a proper value for this. + this.WalkSpeed *= 5; + SetBrain(new MinionBrain(this)); + (Brain as MinionBrain).AddPresetPower(30592); //melee_instant + (Brain as MinionBrain).AddPresetPower(30005); //AINearby + (Brain as MinionBrain).AddPresetPower(107103); //Spider_leap + //TODO: These values should most likely scale, but we don't know how yet, so just temporary values. + Attributes[GameAttribute.Hitpoints_Max] = 20f; + Attributes[GameAttribute.Hitpoints_Cur] = 20f; + Attributes[GameAttribute.Attacks_Per_Second] = 1.0f; + + Attributes[GameAttribute.Damage_Weapon_Min, 0] = context.ScriptFormula(16) * context.User.Attributes[GameAttribute.Damage_Weapon_Min_Total, 0]; + Attributes[GameAttribute.Damage_Weapon_Delta, 0] = context.ScriptFormula(17) * context.User.Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0]; + + Attributes[GameAttribute.Pet_Type] = 0x8; + //Pet_Owner and Pet_Creator seems to be 0 + (context.User as Player).InGameClient.SendMessage(new PetMessage() + { + Field0 = 0, + Field1 = SpiderID, + PetId = this.DynamicID, + Field3 = 0x8, + }); + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Implementations/Minions/FetishArmyMelee.cs b/src/Mooege/Core/GS/Actors/Implementations/Minions/FetishArmyMelee.cs new file mode 100644 index 00000000..305524b4 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Minions/FetishArmyMelee.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Core.GS.Powers; +using Mooege.Core.GS.AI.Brains; +using Mooege.Net.GS.Message; +using Mooege.Core.GS.Ticker; +using Mooege.Core.GS.Players; +using Mooege.Net.GS.Message.Definitions.Pet; + +namespace Mooege.Core.GS.Actors.Implementations.Minions +{ + class FetishMelee : Minion + { + //Melee - 87189, 89933 - ranged, 90320 - shaman, skeleton? - 89934 + public FetishMelee(Map.World world, PowerContext context, int FetishID) + : base(world, 87189, context.User, null) + { + Scale = 1.2f; //they look cooler bigger :) + //TODO: get a proper value for this. + this.WalkSpeed *= 5; + SetBrain(new MinionBrain(this)); + //TODO: These values should most likely scale, but we don't know how yet, so just temporary values. + Attributes[GameAttribute.Hitpoints_Max] = 20f; + Attributes[GameAttribute.Hitpoints_Cur] = 20f; + Attributes[GameAttribute.Attacks_Per_Second] = 1.0f; + + Attributes[GameAttribute.Damage_Weapon_Min, 0] = context.ScriptFormula(22) * context.User.Attributes[GameAttribute.Damage_Weapon_Min_Total, 0]; + Attributes[GameAttribute.Damage_Weapon_Delta, 0] = context.ScriptFormula(23) * context.User.Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0]; + + Attributes[GameAttribute.Pet_Type] = 0x8; + //Pet_Owner and Pet_Creator seems to be 0 + (context.User as Player).InGameClient.SendMessage(new PetMessage() + { + Field0 = 0, + Field1 = FetishID, + PetId = this.DynamicID, + Field3 = 0x8, + }); + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Implementations/Minions/GargantuanMinion.cs b/src/Mooege/Core/GS/Actors/Implementations/Minions/GargantuanMinion.cs new file mode 100644 index 00000000..529dde51 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Minions/GargantuanMinion.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Core.GS.Powers; +using Mooege.Core.GS.AI.Brains; +using Mooege.Net.GS.Message; +using Mooege.Core.GS.Ticker; +using Mooege.Core.GS.Players; +using Mooege.Net.GS.Message.Definitions.Pet; + +namespace Mooege.Core.GS.Actors.Implementations.Minions +{ + class GargantuanMinion : Minion + { + public GargantuanMinion(Map.World world, PowerContext context, int GargID) + : base(world, 122305, context.User, null) + { + Scale = 1f; + //TODO: get a proper value for this. + this.WalkSpeed *= 5; + SetBrain(new MinionBrain(this)); + + (Brain as MinionBrain).AddPresetPower(30005); + (Brain as MinionBrain).AddPresetPower(30001); + (Brain as MinionBrain).AddPresetPower(30592); + (Brain as MinionBrain).AddPresetPower(30550); + Attributes[GameAttribute.Hitpoints_Max] = 5f; + Attributes[GameAttribute.Hitpoints_Cur] = 5f; + Attributes[GameAttribute.Attacks_Per_Second] = 1.0f; + + + Attributes[GameAttribute.Damage_Weapon_Min, 0] = 5f; + Attributes[GameAttribute.Damage_Weapon_Delta, 0] = 7f; + + Attributes[GameAttribute.Pet_Type] = 0x8; + //Pet_Owner and Pet_Creator seems to be 0 + (context.User as Player).InGameClient.SendMessage(new PetMessage() + { + Field0 = 0, + Field1 = GargID, + PetId = this.DynamicID, + Field3 = 0x8, + }); + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Implementations/Minions/HexMinion.cs b/src/Mooege/Core/GS/Actors/Implementations/Minions/HexMinion.cs new file mode 100644 index 00000000..cf921b98 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Minions/HexMinion.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Core.GS.Powers; +using Mooege.Core.GS.AI.Brains; +using Mooege.Net.GS.Message; +using Mooege.Core.GS.Ticker; +using Mooege.Core.GS.Players; +using Mooege.Net.GS.Message.Definitions.Pet; + +namespace Mooege.Core.GS.Actors.Implementations.Minions +{ + class HexMinion : Minion + { + public HexMinion(Map.World world, PowerContext context, int HexID) + : base(world, 107826, context.User, null) + { + Scale = 1f; + //TODO: get a proper value for this. + this.WalkSpeed *= 5; + SetBrain(new MinionBrain(this)); + (Brain as MinionBrain).AddPresetPower(196974); //chicken_walk.pow + (Brain as MinionBrain).AddPresetPower(188442); //explode.pow + (Brain as MinionBrain).AddPresetPower(107301); //Fetish.pow + (Brain as MinionBrain).AddPresetPower(107742); //Heal + + Attributes[GameAttribute.Hitpoints_Max] = 5f; + Attributes[GameAttribute.Hitpoints_Cur] = 5f; + Attributes[GameAttribute.Attacks_Per_Second] = 1.0f; + + Attributes[GameAttribute.Damage_Weapon_Min, 0] = 5f; + Attributes[GameAttribute.Damage_Weapon_Delta, 0] = 7f; + + Attributes[GameAttribute.Pet_Type] = 0x8; + //Pet_Owner and Pet_Creator seems to be 0 + (context.User as Player).InGameClient.SendMessage(new PetMessage() + { + Field0 = 0, + Field1 = HexID, + PetId = this.DynamicID, + Field3 = 0x8, + }); + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Implementations/Minions/MirrorImageMinion.cs b/src/Mooege/Core/GS/Actors/Implementations/Minions/MirrorImageMinion.cs new file mode 100644 index 00000000..f1aa42f8 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Minions/MirrorImageMinion.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Core.GS.Powers; +using Mooege.Core.GS.AI.Brains; +using Mooege.Net.GS.Message; +using Mooege.Core.GS.Ticker; +using Mooege.Core.GS.Players; +using Mooege.Net.GS.Message.Definitions.Pet; + +namespace Mooege.Core.GS.Actors.Implementations.Minions +{ + class MirrorImageMinion : Minion + { + public MirrorImageMinion(Map.World world, PowerContext context, int ImageID) + : base(world, 98010, context.User, null) //male Mirror images + { + Scale = 1.2f; //they look cooler bigger :) + //TODO: get a proper value for this. + this.WalkSpeed *= 5; + SetBrain(new MinionBrain(this)); + //TODO: These values should most likely scale, but we don't know how yet, so just temporary values. + Attributes[GameAttribute.Hitpoints_Max] = 20f; + Attributes[GameAttribute.Hitpoints_Cur] = 20f; + Attributes[GameAttribute.Attacks_Per_Second] = 1.0f; + + Attributes[GameAttribute.Damage_Weapon_Min, 0] = context.ScriptFormula(11) * context.User.Attributes[GameAttribute.Damage_Weapon_Min_Total, 0]; + Attributes[GameAttribute.Damage_Weapon_Delta, 0] = context.ScriptFormula(13) * context.User.Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0]; + + Attributes[GameAttribute.Pet_Type] = 0x8; + //Pet_Owner and Pet_Creator seems to be 0 + (context.User as Player).InGameClient.SendMessage(new PetMessage() + { + Field0 = 0, + Field1 = ImageID, + PetId = this.DynamicID, + Field3 = 0x8, + }); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Core/GS/Actors/Implementations/Minions/MysticAllyMinion.cs b/src/Mooege/Core/GS/Actors/Implementations/Minions/MysticAllyMinion.cs new file mode 100644 index 00000000..fc59758c --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Minions/MysticAllyMinion.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Core.GS.Powers; +using Mooege.Core.GS.AI.Brains; +using Mooege.Net.GS.Message; +using Mooege.Core.GS.Ticker; +using Mooege.Core.GS.Players; +using Mooege.Net.GS.Message.Definitions.Pet; + +namespace Mooege.Core.GS.Actors.Implementations.Minions +{ + class MysticAllyMinion : Minion + { + //female ->123885 + //male -> 169904 + + public MysticAllyMinion(Map.World world, PowerContext context, int MysticAllyID) + : base(world, 123885, context.User, null) + { + Scale = 1.35f; //they look cooler bigger :) + //TODO: get a proper value for this. + this.WalkSpeed *= 5; + SetBrain(new MinionBrain(this)); + (Brain as MinionBrain).AddPresetPower(169081); //melee_instant + (Brain as MinionBrain).AddPresetPower(169155); //Rune_aKick + (Brain as MinionBrain).AddPresetPower(169325); //Rune_bWaveAttack + (Brain as MinionBrain).AddPresetPower(169715); //Rune_cGroundPunch + (Brain as MinionBrain).AddPresetPower(169728); //Rune_dAoeAttack + //TODO: These values should most likely scale, but we don't know how yet, so just temporary values. + Attributes[GameAttribute.Hitpoints_Max] = context.ScriptFormula(0) * context.User.Attributes[GameAttribute.Hitpoints_Max_Total]; + Attributes[GameAttribute.Hitpoints_Cur] = Attributes[GameAttribute.Hitpoints_Max]; + Attributes[GameAttribute.Attacks_Per_Second] = 1.0f; + + Attributes[GameAttribute.Damage_Weapon_Min, 0] = context.ScriptFormula(1); + + Attributes[GameAttribute.Pet_Type] = 0x8; + //Pet_Owner and Pet_Creator seems to be 0 + (context.User as Player).InGameClient.SendMessage(new PetMessage() + { + Field0 = 0, + Field1 = MysticAllyID, + PetId = this.DynamicID, + Field3 = 0x8, + }); + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Implementations/Minions/ZombieDog.cs b/src/Mooege/Core/GS/Actors/Implementations/Minions/ZombieDog.cs new file mode 100644 index 00000000..09758f1d --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Minions/ZombieDog.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Core.GS.Powers; +using Mooege.Core.GS.AI.Brains; +using Mooege.Net.GS.Message; +using Mooege.Core.GS.Ticker; +using Mooege.Core.GS.Players; +using Mooege.Net.GS.Message.Definitions.Pet; + +namespace Mooege.Core.GS.Actors.Implementations.Minions +{ + class ZombieDog : Minion + { + public ZombieDog(Map.World world, PowerContext context, int dogID) + : base(world, 51353, context.User, null) + { + Scale = 1.35f; + //TODO: get a proper value for this. + this.WalkSpeed *= 3; + SetBrain(new MinionBrain(this)); + //TODO: These values should most likely scale, but we don't know how yet, so just temporary values. + Attributes[GameAttribute.Hitpoints_Max] = 20f; + Attributes[GameAttribute.Hitpoints_Cur] = 20f; + Attributes[GameAttribute.Attacks_Per_Second] = 1.0f; + + Attributes[GameAttribute.Damage_Weapon_Min, 0] = 5f; + Attributes[GameAttribute.Damage_Weapon_Delta, 0] = context.ScriptFormula(13) * context.User.Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0]; + + Attributes[GameAttribute.Pet_Type] = 0x8; + //Pet_Owner and Pet_Creator seems to be 0 + (context.User as Player).InGameClient.SendMessage(new PetMessage() + { + Field0 = 0, + Field1 = dogID, + PetId = this.DynamicID, + Field3 = 0x8, + }); + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Implementations/Monsters/Monsters.cs b/src/Mooege/Core/GS/Actors/Implementations/Monsters/Monsters.cs new file mode 100644 index 00000000..44eb325f --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Monsters/Monsters.cs @@ -0,0 +1,544 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Core.GS.AI.Brains; +using Mooege.Net.GS.Message; + + +namespace Mooege.Core.GS.Actors.Implementations.Monsters +{ + #region Goblins + // + //54862 - spawn goblin portal + // + [HandledSNO(5984)] + public class TreasureGoblin : Monster + { + public TreasureGoblin(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } + + [HandledSNO(5985)] + public class TreasureSeeker : Monster + { + public TreasureSeeker(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } + + [HandledSNO(5987)] + public class TreasureBandit : Monster + { + public TreasureBandit(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } + + [HandledSNO(5988)] + public class TreasurePygmy : Monster + { + public TreasurePygmy(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } + #endregion + #region Spore + [HandledSNO(5482)] + public class Spore : Monster + { + public Spore(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + (Brain as MonsterBrain).AddPresetPower(30525);//SporeCloud.pow + } + } + #endregion + #region QuillDemon + [HandledSNO(4982)] + public class QuillDemon : Monster + { + public QuillDemon(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + (Brain as MonsterBrain).AddPresetPower(107729); + (Brain as MonsterBrain).AddPresetPower(30592); + } + } + #endregion + #region DarkCultists + [HandledSNO(6024)] + public class DarkCultists : Monster + { + public DarkCultists(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } + [HandledSNO(6035)] + public class DarkSummoner : Monster + { + public DarkSummoner(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + (Brain as MonsterBrain).AddPresetPower(30592); + } + } + #endregion + #region Ghost + //Enraged phantom 370, 136943 + [HandledSNO(370, 136943)] + public class EnragedPhantom : Monster + { + public EnragedPhantom(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + this.Attributes[GameAttribute.Damage_Weapon_Min, 0] = 15f; + } + } + #endregion + #region Unburieds + [HandledSNO(6356)] + public class Unburied : Monster + { + public Unburied(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + (Brain as MonsterBrain).AddPresetPower(30592); + } + } + + [HandledSNO(6359)] + public class DisentombHulk : Monster + { + public DisentombHulk(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + (Brain as MonsterBrain).AddPresetPower(30592); + } + } + #endregion + #region WoodWraiths + [HandledSNO(6572, 139454, 139456)] + public class WoodWraith : Monster + { + public WoodWraith(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + (Brain as MonsterBrain).AddPresetPower(30592); + } + } + [HandledSNO(170324, 170325, 495)] + public class HighLandWalker : Monster + { + public HighLandWalker(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + (Brain as MonsterBrain).AddPresetPower(30592); + } + } + [HandledSNO(496)] + public class TheOldMan : Monster + { + public TheOldMan(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + (Brain as MonsterBrain).AddPresetPower(30592); + // Summon Spores + } + } + #endregion + #region Zombies + [HandledSNO(6652)] + public class WalkingCorpse : Monster + { + public WalkingCorpse(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } + [HandledSNO(6653)] + public class HungryCorpse : Monster + { + public HungryCorpse(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } + [HandledSNO(6654)] + public class BloatedCorpse : Monster + { + public BloatedCorpse(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } + [HandledSNO(204256)] + public class RancidStumbler : Monster + { + public RancidStumbler(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } + [HandledSNO(6644)] //ZombieSkinny + public class Risen : Monster + { + public Risen(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } + [HandledSNO(6646)] //ZombieSkinny + public class RavenousDead : Monster + { + public RavenousDead(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } + [HandledSNO(6647)] //ZombieSkinny + public class VoraciousZombie : Monster + { + public VoraciousZombie(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } + [HandledSNO(6651)] //ZombieSkinny + public class Decayer : Monster + { + public Decayer(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } + //Risen + [HandledSNO(218339)] //ZombieSkinny_Custom_A.acr + public class ZombieSkinny : Monster + { + public ZombieSkinny(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } + [HandledSNO(218367)] //ZombieCrawler_Barricade_A.acr + public class CrowlingTorso : Monster + { + public CrowlingTorso(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } + [HandledSNO(203121)] //ZombieSkinny_A_LeahInn.acr + public class LeahInnZombie : Monster + { + public LeahInnZombie(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } + #endregion + #region Skeleton + [HandledSNO(539)] + public class Skeleton : Monster + { + public Skeleton(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } + [HandledSNO(87012)] + public class RoyalHanchman : Monster + { + public RoyalHanchman(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } + [HandledSNO(5395)] + public class Returned : Monster + { + public Returned(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } + [HandledSNO(5397)] + public class SkeletalWarrior : Monster + { + public SkeletalWarrior(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } + [HandledSNO(80652)] + public class SkeletonKnee : Monster + { + public SkeletonKnee(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + //30474 + } + } + [HandledSNO(5411)] + public class SkeletalExecutioner : Monster + { + public SkeletalExecutioner(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } + [HandledSNO(434)] + public class ReturnedExecutioner : Monster + { + public ReturnedExecutioner(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } + #endregion + #region Skeleton_Necromantic_Minion + //Necromantic Minion + [HandledSNO(105863)] + public class NecromanticMinion : Monster + { + public NecromanticMinion(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } + #endregion + #region Skeleton_Summoner + //No Uniques Added + // Tomb Guardian -> All + [HandledSNO(5387)] + public class TombGuardian : Monster + { + public TombGuardian(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + (Brain as MonsterBrain).AddPresetPower(30592); + (Brain as MonsterBrain).AddPresetPower(30503); + (Brain as MonsterBrain).AddPresetPower(30543); //Summon Skeletons + } + } + #endregion + #region Skeleton_Archer + [HandledSNO(5346)] + public class SkeletalArcher : Monster + { + public SkeletalArcher(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } + [HandledSNO(218400)] + public class KillianDamort : Monster + { + public KillianDamort(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + (Brain as MonsterBrain).AddPresetPower(30592); + } + } + [HandledSNO(5347)] + public class ReturnedArcher : Monster + { + public ReturnedArcher(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + (Brain as MonsterBrain).AddPresetPower(30592); + } + } + #endregion + #region Shield_Skeleton + [HandledSNO(5275)] + public class SkeletalShieldBearer : Monster + { + public SkeletalShieldBearer(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + (Brain as MonsterBrain).AddPresetPower(30592); + } + } + [HandledSNO(5276)] + public class ReturnedShieldMan : Monster + { + public ReturnedShieldMan(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + (Brain as MonsterBrain).AddPresetPower(30592); + } + } + [HandledSNO(5277)] + public class SkeletalSentry : Monster + { + public SkeletalSentry(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + (Brain as MonsterBrain).AddPresetPower(30592); + } + } + #endregion + #region Grotesque + [HandledSNO(3847)] + public class Grotesque : Monster + { + //3851 suicide blood, 220536 suicide imps = these happen on different SNOs and happen as they are dying. + + public Grotesque(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + (Brain as MonsterBrain).AddPresetPower(30531); + (Brain as MonsterBrain).AddPresetPower(30530); + (Brain as MonsterBrain).AddPresetPower(30529); //Explode + } + } + [HandledSNO(38484)] + public class Harvester : Monster + { + //3851 suicide blood, 220536 suicide imps = these happen on different SNOs and happen as they are dying. + + public Harvester(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } + [HandledSNO(218307)] + public class RagusGrimlow : Monster + { + //3851 suicide blood, 220536 suicide imps = these happen on different SNOs and happen as they are dying. + + public RagusGrimlow(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } + [HandledSNO(218308)] + public class BralukGrimlow : Monster + { + //3851 suicide blood, 220536 suicide imps = these happen on different SNOs and happen as they are dying. + + public BralukGrimlow(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } + [HandledSNO(218405)] + public class BellyBloatTheScarred : Monster + { + //3851 suicide blood, 220536 suicide imps = these happen on different SNOs and happen as they are dying. + + public BellyBloatTheScarred(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } + [HandledSNO(4564)] + public class CorpseWorm : Monster + { + + public CorpseWorm(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } + + #endregion + #region FleshPitFlyers + [HandledSNO(4156)] + public class CarrionBat : Monster + { + public CarrionBat(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } + [HandledSNO(4157, 81954)] + public class PlagueCarrier : Monster + { + public PlagueCarrier(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } + [HandledSNO(218314)] + public class Glidewing : Monster + { + public Glidewing(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } + [HandledSNO(218362)] + public class Firestarter : Monster + { + public Firestarter(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } + [HandledSNO(195747)] + public class VileHellbat : Monster + { + public VileHellbat(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + } + #endregion + #region CarrionNest + [HandledSNO(4152)] + public class CarrionNest : Monster + { + public CarrionNest(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + (Brain as MonsterBrain).RemovePresetPower(30592); + (Brain as MonsterBrain).AddPresetPower(117580); + } + + } + #endregion + #region Wretched Mothers + [HandledSNO(219725, 108444)] // ZombieFemale_A_TristramQuest_Unique.acr + public class WretchedMother : Monster + { + public WretchedMother(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + (Brain as MonsterBrain).RemovePresetPower(30592); // Only distance attack + (Brain as MonsterBrain).AddPresetPower(94734); + (Brain as MonsterBrain).AddPresetPower(110518); + //this.Attributes[GameAttribute.Damage_Weapon_Min, 0] = 4f; + //this.Attributes[GameAttribute.Damage_Weapon_Delta, 0] = 4f; + } + } + #endregion +} \ No newline at end of file diff --git a/src/Mooege/Core/GS/Actors/Implementations/ProximityTriggeredGizmo.cs b/src/Mooege/Core/GS/Actors/Implementations/ProximityTriggeredGizmo.cs new file mode 100644 index 00000000..bf19d4e9 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/ProximityTriggeredGizmo.cs @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Net.GS.Message.Definitions.Animation; +using Mooege.Net.GS.Message; +using Mooege.Core.GS.Ticker; + +namespace Mooege.Core.GS.Actors.Implementations +{ + class ProximityTriggeredGizmo : Gizmo + { + private bool _collapsed = false; + + public ProximityTriggeredGizmo(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + + public override void OnPlayerApproaching(Players.Player player) + { + if (player.Position.DistanceSquared(ref _position) < ActorData.Sphere.Radius * ActorData.Sphere.Radius * this.Scale * this.Scale && !_collapsed) + { + _collapsed = true; + + // TODO most of the fields here are unknown, find out about animation playing duration + int duration = 500; // ticks + World.BroadcastIfRevealed(new PlayAnimationMessage + { + ActorID = this.DynamicID, + Field1 = 11, + Field2 = 0, + tAnim = new Net.GS.Message.Fields.PlayAnimationMessageSpec[] + { + new Net.GS.Message.Fields.PlayAnimationMessageSpec() + { + Duration = duration, + AnimationSNO = ActorData.TagMap.ContainsKey(ActorKeys.DeathAnimationTag) ? AnimationSet.TagMapAnimDefault[ActorData.TagMap[ActorKeys.DeathAnimationTag]].Int : AnimationSet.TagMapAnimDefault[AnimationSetKeys.DeathDefault] , + PermutationIndex = 0, + Speed = 1 + } + } + + }, this); + + World.BroadcastIfRevealed(new SetIdleAnimationMessage + { + ActorID = this.DynamicID, + AnimationSNO = AnimationSetKeys.DeadDefault.ID + }, this); + + this.Attributes[GameAttribute.Deleted_On_Server] = true; + Attributes.BroadcastChangedIfRevealed(); + + RelativeTickTimer destroy = new RelativeTickTimer(World.Game, duration, x => this.Destroy()); + } + } + + } +} diff --git a/src/Mooege/Core/GS/Actors/Implementations/Savepoint.cs b/src/Mooege/Core/GS/Actors/Implementations/Savepoint.cs new file mode 100644 index 00000000..b371aa02 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Savepoint.cs @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Net.GS.Message.Definitions.Misc; + +namespace Mooege.Core.GS.Actors.Implementations +{ + class Savepoint : Gizmo + { + private bool _savepointReached = false; + + public int SavepointId { get; private set; } + + public Savepoint(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + SavepointId = tags[MarkerKeys.SavepointId]; + } + + public override void OnPlayerApproaching(Players.Player player) + { + if (player.Position.DistanceSquared(ref _position) < ActorData.Sphere.Radius * ActorData.Sphere.Radius * this.Scale * this.Scale && !_savepointReached) + { + _savepointReached = true; + + // TODO send real SavePointInformation, though im not sure if that is used for anything at all + this.World.BroadcastIfRevealed(new SavePointInfoMessage + { + snoLevelArea = 102362, + }, this); + + player.SavePointData = new Net.GS.Message.Fields.SavePointData() { snoWorld = World.WorldSNO.Id, SavepointId = SavepointId }; + player.UpdateHeroState(); + player.CheckPointPosition = this._position; // This seemed easier than having on Death find the SavePoint based on ID, then getting its location. - DarkLotus + } + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Implementations/Shrine.cs b/src/Mooege/Core/GS/Actors/Implementations/Shrine.cs new file mode 100644 index 00000000..9594ee8a --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Shrine.cs @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Net.GS.Message; +using Mooege.Net.GS.Message.Definitions.Misc; + +namespace Mooege.Core.GS.Actors.Implementations +{ + /// + /// Class that implements shrines, run power on click and send activation message + /// + class Shrine : Gizmo + { + public Shrine(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + Attributes[GameAttribute.MinimapActive] = true; + } + + + public override void OnTargeted(Players.Player player, Net.GS.Message.Definitions.World.TargetMessage message) + { + Logger.Warn("Shrine has no function, Powers not implemented"); + World.BroadcastIfRevealed(new ShrineActivatedMessage { ActorID = this.DynamicID }, this); + + this.Attributes[GameAttribute.Gizmo_Has_Been_Operated] = true; + this.Attributes[GameAttribute.Gizmo_Operator_ACDID] = unchecked((int)player.DynamicID); + this.Attributes[GameAttribute.Gizmo_State] = 1; + Attributes.BroadcastChangedIfRevealed(); + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Implementations/StartingPoint.cs b/src/Mooege/Core/GS/Actors/Implementations/StartingPoint.cs new file mode 100644 index 00000000..c522d5ba --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/StartingPoint.cs @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Common.Types.TagMap; + +namespace Mooege.Core.GS.Actors.Implementations +{ + public class StartingPoint : Gizmo + { + public int TargetId { get; private set; } + + public StartingPoint(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + } + + protected override void ReadTags() + { + if (this.Tags == null) return; + + if (this.Tags.ContainsKey(MarkerKeys.ActorTag)) + this.TargetId = this.Tags[MarkerKeys.ActorTag]; + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Implementations/Stash.cs b/src/Mooege/Core/GS/Actors/Implementations/Stash.cs new file mode 100644 index 00000000..5a2af0fe --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Stash.cs @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Players; +using Mooege.Net.GS.Message.Definitions.Stash; +using Mooege.Net.GS.Message.Definitions.World; +using Mooege.Core.GS.Common.Types.TagMap; + +namespace Mooege.Core.GS.Actors.Implementations +{ + [HandledSNO(130400 /* Player_Shared_Stash.acr */)] + public sealed class Stash : Gizmo + { + public Stash(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { } + + public override void OnTargeted(Player player, TargetMessage message) + { + player.InGameClient.SendMessage(new OpenSharedStashMessage((int)this.DynamicID)); + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Implementations/Vendor.cs b/src/Mooege/Core/GS/Actors/Implementations/Vendor.cs new file mode 100644 index 00000000..7a582264 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Vendor.cs @@ -0,0 +1,124 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using Mooege.Core.GS.Items; +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Players; +using Mooege.Net.GS.Message; +using Mooege.Net.GS.Message.Definitions.Trade; +using Mooege.Net.GS.Message.Definitions.World; +using Mooege.Core.GS.Common; +using Mooege.Core.GS.Common.Types.TagMap; + +namespace Mooege.Core.GS.Actors.Implementations +{ + // TODO: this is just a test, do it properly for all vendors? + [HandledSNO( + // Miner_InTown + variations + 177320, 178396, 178401, 178403, 229372, 229373, 229374, 229375, 229376, + // Fence_InTown + variations + 177319, 178388, 178390, 178392, 229367, 229368, 229369, 229370, 229371, + // Collector_InTown + variations + 107535, 178362, 178383, 178385, 229362, 229363, 229364, 229365, 229366)] + public class Vendor : InteractiveNPC + { + private InventoryGrid _vendorGrid; + + public Vendor(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + this.Attributes[GameAttribute.MinimapActive] = true; + _vendorGrid = new InventoryGrid(this, 1, 20, (int)EquipmentSlotId.Vendor); + PopulateItems(); + } + + + // TODO: Proper item loading from droplist? + protected virtual List GetVendorItems() + { + var list = new List + { + ItemGenerator.GenerateRandom(this), + ItemGenerator.GenerateRandom(this), + ItemGenerator.GenerateRandom(this), + ItemGenerator.GenerateRandom(this), + ItemGenerator.GenerateRandom(this), + ItemGenerator.GenerateRandom(this) + }; + + return list; + } + + private void PopulateItems() + { + var items = GetVendorItems(); + if (items.Count > _vendorGrid.Columns) + { + _vendorGrid.ResizeGrid(1, items.Count); + } + + foreach (var item in items) + { + _vendorGrid.AddItem(item); + } + + } + + public override bool Reveal(Player player) + { + if (!base.Reveal(player)) + return false; + + _vendorGrid.Reveal(player); + return true; + } + + public override bool Unreveal(Player player) + { + if (!base.Unreveal(player)) + return false; + + _vendorGrid.Unreveal(player); + return true; + } + + public override void OnTargeted(Player player, TargetMessage message) + { + base.OnTargeted(player, message); + player.InGameClient.SendMessage(new OpenTradeWindowMessage((int)this.DynamicID)); + } + + + public virtual void OnRequestBuyItem(Players.Player player, uint itemId) + { + // TODO: Check gold here + Item item = _vendorGrid.GetItem(itemId); + if (item == null) + return; + + if (!player.Inventory.HasInventorySpace(item)) + { + return; + } + + // TODO: Remove the gold + player.Inventory.BuyItem(item); + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Implementations/Waypoint.cs b/src/Mooege/Core/GS/Actors/Implementations/Waypoint.cs new file mode 100644 index 00000000..0676e5a7 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Waypoint.cs @@ -0,0 +1,140 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Windows; +using Mooege.Common.MPQ; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Players; +using Mooege.Net.GS.Message; +using Mooege.Net.GS.Message.Definitions.Animation; +using Mooege.Net.GS.Message.Definitions.Map; +using Mooege.Net.GS.Message.Definitions.Misc; +using Mooege.Net.GS.Message.Fields; +using Mooege.Core.GS.Common.Types.TagMap; + +namespace Mooege.Core.GS.Actors.Implementations +{ + public sealed class Waypoint : Gizmo + { + public int WaypointId { get; private set; } + + public Waypoint(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + this.Attributes[GameAttribute.MinimapActive] = true; + } + + public override void OnEnter(World world) + { + this.ReadWaypointId(); + } + + private void ReadWaypointId() + { + var actData = (Mooege.Common.MPQ.FileFormats.Act)MPQStorage.Data.Assets[SNOGroup.Act][70015].Data; + var wayPointInfo = actData.WayPointInfo; + + var proximity = new Rect(this.Position.X - 1.0, this.Position.Y - 1.0, 2.0, 2.0); + var scenes = this.World.QuadTree.Query(proximity); + if (scenes.Count == 0) return; // TODO: fixme! /raist + + var scene = scenes[0]; // Parent scene /fasbat + + if (scenes.Count == 2) // What if it's a subscene? /fasbat + { + if (scenes[1].ParentChunkID != 0xFFFFFFFF) + scene = scenes[1]; + } + + for (int i = 0; i < wayPointInfo.Length; i++) + { + if (wayPointInfo[i].SNOLevelArea == -1) + continue; + + if (scene.Specification == null) continue; + foreach (var area in scene.Specification.SNOLevelAreas) + { + if (wayPointInfo[i].SNOWorld != this.World.WorldSNO.Id || wayPointInfo[i].SNOLevelArea != area) + continue; + + this.WaypointId = i; + break; + } + } + } + + public override void OnTargeted(Player player, Net.GS.Message.Definitions.World.TargetMessage message) + { + var world = player.World; + + world.BroadcastIfRevealed(new PlayAnimationMessage() + { + ActorID = this.DynamicID, + Field1 = 5, + Field2 = 0f, + tAnim = new[] + { + new PlayAnimationMessageSpec() + { + Duration = 4, + AnimationSNO = 0x2f761, + PermutationIndex = 0, + Speed = 1f, + } + } + }, this); + + player.InGameClient.SendMessage(new ANNDataMessage(Opcodes.OpenWaypointSelectionWindowMessage) + { + ActorID = this.DynamicID + }); + } + + public override bool Reveal(Player player) + { + if (!base.Reveal(player)) + return false; + + // Show a minimap icon + player.InGameClient.SendMessage(new MapMarkerInfoMessage() + { + Field0 = (int)World.NewActorID, // TODO What is the correct id space for mapmarkers? /fasbat + Field1 = new WorldPlace() + { + Position = this.Position, + WorldID = this.World.DynamicID + }, + Field2 = 0x1FA21, + m_snoStringList = 0xF063, + + Field3 = unchecked((int)0x9799F57B), + Field9 = 0, + Field10 = 0, + Field11 = 0, + Field5 = 0, + Field6 = true, + Field7 = false, + Field8 = false, + Field12 = 0 + }); + + return true; + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Interactions/Interactions.cs b/src/Mooege/Core/GS/Actors/Interactions/Interactions.cs new file mode 100644 index 00000000..dbadee01 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Interactions/Interactions.cs @@ -0,0 +1,114 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Net.GS.Message.Fields; +using Mooege.Core.GS.Players; +using Mooege.Core.GS.Actors.Implementations.Hirelings; + +namespace Mooege.Core.GS.Actors.Interactions +{ + public interface IInteraction + { + NPCInteraction AsNPCInteraction(InteractiveNPC npc, Player player); + } + + public class ConversationInteraction : IInteraction + { + public int ConversationSNO; + public bool Read; + + public ConversationInteraction(int conversationSNO) + { + ConversationSNO = conversationSNO; + Read = false; // Should read from players saved data /fasbat + } + + public NPCInteraction AsNPCInteraction(InteractiveNPC npc, Player player) + { + return new NPCInteraction() + { + Type = NPCInteractionType.Conversation, + ConversationSNO = this.ConversationSNO, + Field2 = -1, + State = (Read ? NPCInteractionState.Used : NPCInteractionState.New), + }; + } + + public void MarkAsRead() // Just a hack to show functionality /fasbat + { + Read = true; + } + } + + public class HireInteraction : IInteraction + { + public NPCInteraction AsNPCInteraction(InteractiveNPC npc, Player player) + { + return new NPCInteraction() + { + Type = NPCInteractionType.Hire, + ConversationSNO = -1, + Field2 = -1, + State = (npc as Hireling).HasHireling ? NPCInteractionState.New : NPCInteractionState.Disabled + }; + } + } + + public class IdentifyAllInteraction : IInteraction + { + public NPCInteraction AsNPCInteraction(InteractiveNPC npc, Player player) + { + return new NPCInteraction() + { + Type = NPCInteractionType.IdentifyAll, + ConversationSNO = -1, + Field2 = -1, + State = NPCInteractionState.New // Has items to identify? If no disable, + }; + } + } + + public class CraftInteraction : IInteraction + { + public NPCInteraction AsNPCInteraction(InteractiveNPC npc, Player player) + { + return new NPCInteraction() + { + Type = NPCInteractionType.Craft, + ConversationSNO = -1, + Field2 = -1, + State = NPCInteractionState.New, + }; + } + } + + public class InventoryInteraction : IInteraction + { + public NPCInteraction AsNPCInteraction(InteractiveNPC npc, Player player) + { + return new NPCInteraction() + { + Type = NPCInteractionType.Inventory, + ConversationSNO = -1, + Field2 = -1, + State = (npc as Hireling).HasProxy ? NPCInteractionState.New : NPCInteractionState.Disabled + }; + } + } + +} diff --git a/src/Mooege/Core/GS/Actors/InteractiveNPC.cs b/src/Mooege/Core/GS/Actors/InteractiveNPC.cs new file mode 100644 index 00000000..de4c2b96 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/InteractiveNPC.cs @@ -0,0 +1,182 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Linq; +using System.Collections.Generic; +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Players; +using Mooege.Net.GS.Message; +using Mooege.Net.GS.Message.Definitions.World; +using Mooege.Core.GS.Actors.Interactions; +using Mooege.Net.GS.Message.Fields; +using Mooege.Net.GS.Message.Definitions.NPC; +using Mooege.Net.GS; +using Mooege.Net.GS.Message.Definitions.Hireling; +using Mooege.Core.GS.Games; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Net.GS.Message.Definitions.Artisan; + +namespace Mooege.Core.GS.Actors +{ + public class InteractiveNPC : NPC, IMessageConsumer + { + public List Interactions { get; private set; } + public List Conversations { get; private set; } + + public InteractiveNPC(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + this.Attributes[GameAttribute.NPC_Has_Interact_Options, 0] = true; + this.Attributes[GameAttribute.NPC_Is_Operatable] = true; + //this.Attributes[GameAttribute.Buff_Visual_Effect, 0x00FFFFF] = true; + Interactions = new List(); + Conversations = new List(); + + foreach (var quest in World.Game.Quests) + quest.OnQuestProgress += new Games.Quest.QuestProgressDelegate(quest_OnQuestProgress); + UpdateConversationList(); // show conversations with no quest dependency + } + + void quest_OnQuestProgress(Quest quest) + { + UpdateConversationList(); + } + + private void UpdateConversationList() + { + if (ConversationList != null) + { + var ConversationsNew = new List(); + foreach (var entry in ConversationList.ConversationListEntries) + { + if (entry.SNOLevelArea == -1 && entry.SNOQuestActive == -1 && entry.SNOQuestAssigned == -1 && entry.SNOQuestComplete == -1 && entry.SNOQuestCurrent == -1 && entry.SNOQuestRange == -1) + ConversationsNew.Add(entry.SNOConv); + + if (Mooege.Common.MPQ.MPQStorage.Data.Assets[Common.Types.SNO.SNOGroup.QuestRange].ContainsKey(entry.SNOQuestRange)) + if (World.Game.Quests.IsInQuestRange(Mooege.Common.MPQ.MPQStorage.Data.Assets[Common.Types.SNO.SNOGroup.QuestRange][entry.SNOQuestRange].Data as Mooege.Common.MPQ.FileFormats.QuestRange)) + ConversationsNew.Add(entry.SNOConv); + + if (World.Game.Quests.HasCurrentQuest(entry.SNOQuestCurrent, entry.I3)) + ConversationsNew.Add(entry.SNOConv); + } + + // remove outdates conversation options and add new ones + Conversations = Conversations.Where(x => ConversationsNew.Contains(x.ConversationSNO)).ToList(); + foreach (var sno in ConversationsNew) + if (!Conversations.Select(x => x.ConversationSNO).Contains(sno)) + Conversations.Add(new ConversationInteraction(sno)); + + // search for an unread questconversation + bool questConversation = false; + foreach (var conversation in Conversations) + if (Mooege.Common.MPQ.MPQStorage.Data.Assets[Common.Types.SNO.SNOGroup.Conversation].ContainsKey(conversation.ConversationSNO)) + if ((Mooege.Common.MPQ.MPQStorage.Data.Assets[Common.Types.SNO.SNOGroup.Conversation][conversation.ConversationSNO].Data as Mooege.Common.MPQ.FileFormats.Conversation).I0 == 1) + if (conversation.Read == false) + questConversation = true; + + // show the exclamation mark if actor has an unread quest conversation + Attributes[GameAttribute.Conversation_Icon, 0] = questConversation ? 1 : 0; + Attributes.BroadcastChangedIfRevealed(); + } + } + + + public override void OnTargeted(Player player, TargetMessage message) + { + player.SelectedNPC = this; + + var count = Interactions.Count + Conversations.Count; + if (count == 0) + return; + + // If there is only one conversation option, immediatly select it without showing menu + if (Interactions.Count == 0 && Conversations.Count == 1) + { + player.Conversations.StartConversation(Conversations[0].ConversationSNO); + Conversations[0].MarkAsRead(); + UpdateConversationList(); + return; + } + + NPCInteraction[] npcInters = new NPCInteraction[count]; + + var it = 0; + foreach (var conv in Conversations) + { + npcInters[it] = conv.AsNPCInteraction(this, player); + it++; + } + + foreach (var inter in Interactions) + { + npcInters[it] = inter.AsNPCInteraction(this, player); + it++; + } + + + player.InGameClient.SendMessage(new NPCInteractOptionsMessage() + { + ActorID = this.DynamicID, + tNPCInteraction = npcInters, + Type = NPCInteractOptionsType.Normal + }); + + // TODO: this has no effect, why is it sent? + player.InGameClient.SendMessage(new Mooege.Net.GS.Message.Definitions.Effect.PlayEffectMessage() + { + ActorId = this.DynamicID, + Effect = Net.GS.Message.Definitions.Effect.Effect.Unknown36 + }); + } + + public void Consume(GameClient client, GameMessage message) + { + if (message is NPCSelectConversationMessage) OnSelectConversation(client.Player, message as NPCSelectConversationMessage); + if (message is HirelingHireMessage) OnHire(client.Player); + if (message is HirelingInventoryMessage) OnInventory(client.Player); + if (message is CraftInteractionMessage) OnCraft(client.Player); + else return; + } + + public virtual void OnCraft(Player player) + { + throw new NotImplementedException(); + } + + public virtual void OnInventory(Player player) + { + throw new NotImplementedException(); + } + + public virtual void OnHire(Player player) + { + throw new NotImplementedException(); + } + + private void OnSelectConversation(Player player, NPCSelectConversationMessage message) + { + var conversation = Conversations.FirstOrDefault(conv => conv.ConversationSNO == message.ConversationSNO); + if (conversation == null) + return; + + player.Conversations.StartConversation(conversation.ConversationSNO); + conversation.MarkAsRead(); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Core/GS/Actors/Living.cs b/src/Mooege/Core/GS/Actors/Living.cs new file mode 100644 index 00000000..0f272206 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Living.cs @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using Mooege.Common.Helpers.Math; +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Players; +using Mooege.Core.GS.Powers; +using Mooege.Core.GS.Powers.Payloads; +using Mooege.Net.GS.Message; +using Mooege.Net.GS.Message.Definitions.Animation; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Core.GS.Common.Types.SNO; + +namespace Mooege.Core.GS.Actors +{ + public class Living : Actor + { + public override ActorType ActorType { get { return ActorType.Monster; } } + + public SNOHandle Monster { get; private set; } + + /// + /// The brain for + /// + public AI.Brain Brain { get; protected set; } + + public Living(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + this.Monster = new SNOHandle(SNOGroup.Monster, (ActorData.MonsterSNO)); + + // FIXME: This is hardcoded crap + this.SetFacingRotation((float)(RandomHelper.NextDouble() * 2.0f * Math.PI)); + this.GBHandle.Type = -1; this.GBHandle.GBID = -1; + this.Field7 = 0x00000001; + this.Field10 = 0x0; + + //scripted //this.Attributes[GameAttribute.Hitpoints_Max_Total] = 4.546875f; + this.Attributes[GameAttribute.Hitpoints_Max] = 4.546875f; + //scripted //this.Attributes[GameAttribute.Hitpoints_Total_From_Level] = 0f; + this.Attributes[GameAttribute.Hitpoints_Cur] = 4.546875f; + + this.Attributes[GameAttribute.Level] = 1; + } + + public override bool Reveal(Player player) + { + if (!base.Reveal(player)) + return false; + if (AnimationSet != null) + { + if (this.AnimationSet.GetAnimationTag(Mooege.Common.MPQ.FileFormats.AnimationTags.Idle) != -1) + { + player.InGameClient.SendMessage(new SetIdleAnimationMessage + { + ActorID = this.DynamicID, + AnimationSNO = this.AnimationSet.GetAnimationTag(Mooege.Common.MPQ.FileFormats.AnimationTags.Idle) + }); + } + + } + return true; + } + + public void Kill(PowerContext context = null, bool lootAndExp = false) + { + var deathload = new DeathPayload(context, Powers.DamageType.Physical, this, lootAndExp); + deathload.Apply(); + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Minion.cs b/src/Mooege/Core/GS/Actors/Minion.cs new file mode 100644 index 00000000..b20eedc3 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Minion.cs @@ -0,0 +1,96 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using System.Linq; +using Mooege.Common.Helpers; +using Mooege.Common.Helpers.Math; +using Mooege.Common.MPQ.FileFormats.Types; +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Objects; +using Mooege.Core.GS.Players; +using Mooege.Net.GS.Message; +using Mooege.Net.GS.Message.Definitions.World; +using Mooege.Net.GS.Message.Fields; +using Mooege.Net.GS.Message.Definitions.Animation; +using Mooege.Net.GS.Message.Definitions.Effect; +using Mooege.Net.GS.Message.Definitions.Misc; +using Mooege.Common.MPQ; +using Mooege.Core.GS.Common.Types.SNO; +using System; +using Mooege.Core.GS.Common.Types.TagMap; +using MonsterFF = Mooege.Common.MPQ.FileFormats.Monster; +using ActorFF = Mooege.Common.MPQ.FileFormats.Actor; +using Mooege.Core.GS.AI.Brains; +using Mooege.Core.GS.Ticker; + + +namespace Mooege.Core.GS.Actors +{ + public class Minion : Living, IUpdateable + { + public Actor Master; //The player who summoned the minion. + + public override ActorType ActorType { get { return ActorType.Monster; } } + + public override int Quality + { + get + { + return (int)Mooege.Common.MPQ.FileFormats.SpawnType.Normal; //Seems like this was never implemented on the clientside, so using 0 is fine. + } + set + { + // Not implemented + } + } + + public Minion(World world, int snoId, Actor master, TagMap tags) + : base(world, snoId, tags) + { + // The following two seems to be shared with monsters. One wonders why there isn't a specific actortype for minions. + this.Master = master; + this.Field2 = 0x8; + this.GBHandle.Type = (int)GBHandleType.Monster; this.GBHandle.GBID = 1; + this.Attributes[GameAttribute.Summoned_By_ACDID] = (int)master.DynamicID; + this.Attributes[GameAttribute.TeamID] = master.Attributes[GameAttribute.TeamID]; + } + + public override void OnTargeted(Player player, TargetMessage message) + { + } + + public void Update(int tickCounter) + { + if (this.Brain == null) + return; + + this.Brain.Update(tickCounter); + } + + public void SetBrain(Mooege.Core.GS.AI.Brain brain) + { + this.Brain = brain; + } + + public void AddPresetPower(int powerSNO) + { + (Brain as MinionBrain).AddPresetPower(powerSNO); + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Monster.cs b/src/Mooege/Core/GS/Actors/Monster.cs new file mode 100644 index 00000000..097d684e --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Monster.cs @@ -0,0 +1,130 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using System.Linq; +using Mooege.Common.Helpers.Math; +using Mooege.Core.GS.AI.Brains; +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Objects; +using Mooege.Core.GS.Players; +using Mooege.Net.GS.Message; +using Mooege.Net.GS.Message.Definitions.World; +using Mooege.Net.GS.Message.Fields; +using Mooege.Net.GS.Message.Definitions.Animation; +using Mooege.Net.GS.Message.Definitions.Effect; +using Mooege.Net.GS.Message.Definitions.Misc; +using Mooege.Core.GS.Common.Types.TagMap; +using MonsterFF = Mooege.Common.MPQ.FileFormats.Monster; +using GameBalance = Mooege.Common.MPQ.FileFormats.GameBalance; +using Mooege.Core.GS.Common.Types.SNO; + +namespace Mooege.Core.GS.Actors +{ + public class Monster : Living, IUpdateable + { + public override ActorType ActorType { get { return ActorType.Monster; } } + + public override int Quality + { + get + { + return (int)Mooege.Common.MPQ.FileFormats.SpawnType.Normal; + } + set + { + // TODO MonsterQuality setter not implemented. Throwing a NotImplementedError is catched as message not beeing implemented and nothing works anymore... + } + } + + public int LoreSNOId + { + get + { + return Monster.IsValid ? (Monster.Target as MonsterFF).SNOLore : -1; + } + } + + /// + /// Gets the Actors summoning fields from the mpq's and returns them in format for Monsters. + /// Useful for the Monsters spawning/summoning skills. + /// + public int[] SNOSummons + { + get + { + return (Monster.Target as MonsterFF).SNOSummonActor; + } + } + + public Monster(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + this.Field2 = 0x8; + this.GBHandle.Type = (int)GBHandleType.Monster; this.GBHandle.GBID = 1; + this.Attributes[GameAttribute.Experience_Granted] = 125; + + // lookup GameBalance MonsterLevels.gam asset + var monsterLevels = (GameBalance)Mooege.Common.MPQ.MPQStorage.Data.Assets[SNOGroup.GameBalance][19760].Data; + var monsterData = (Monster.Target as MonsterFF); + + // always use normal difficulty levels for now + if (monsterData.Level.Normal >= 0 && monsterData.Level.Normal < monsterLevels.MonsterLevel.Count) + { + this.Brain = new MonsterBrain(this); + this.Attributes[GameAttribute.Level] = monsterData.Level.Normal; + this.Attributes[GameAttribute.Hitpoints_Max] = monsterLevels.MonsterLevel[monsterData.Level.Normal].F0; + this.Attributes[GameAttribute.Hitpoints_Cur] = this.Attributes[GameAttribute.Hitpoints_Max_Total]; + this.Attributes[GameAttribute.Attacks_Per_Second] = 1.0f; + this.Attributes[GameAttribute.Damage_Weapon_Min, 0] = 5f; + this.Attributes[GameAttribute.Damage_Weapon_Delta, 0] = 5f; + this.WalkSpeed = monsterData.Floats[129]; // TODO: this is probably multiplied by something + } + } + + public override void OnTargeted(Player player, TargetMessage message) + { + } + + public void Update(int tickCounter) + { + if (this.Brain == null) + return; + + this.Brain.Update(tickCounter); + } + + /// + /// Plays lore for first death of this monster's death. + /// + public void PlayLore() + { + if (LoreSNOId != -1) + { + var players = this.GetPlayersInRange(); + if (players != null) + { + foreach (var player in players.Where(player => !player.HasLore(LoreSNOId))) + { + player.PlayLore(LoreSNOId, false); + } + } + } + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Movement/MoveToPointAction.cs b/src/Mooege/Core/GS/Actors/Movement/MoveToPointAction.cs new file mode 100644 index 00000000..39b0281b --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Movement/MoveToPointAction.cs @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Core.GS.Actors.Actions; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Ticker; + +namespace Mooege.Core.GS.Actors.Movement +{ + public class MoveToPointAction : ActorAction + { + public Vector3D Heading { get; private set; } + + public SteppedRelativeTickTimer Timer; + + public MoveToPointAction(Actor owner, Vector3D heading) + : base(owner) + { + this.Heading = heading; + } + + public override void Start(int tickCounter) + { + var distance = MovementHelpers.GetDistance(this.Owner.Position, this.Heading); + var facingAngle = MovementHelpers.GetFacingAngle(this.Owner, this.Heading); + this.Owner.Move(this.Heading, facingAngle); + + Logger.Trace("Heading: " + this.Heading); + Logger.Trace("Start point: " + this.Owner.Position); + + this.Timer = new SteppedRelativeTickTimer(this.Owner.World.Game, 6, (int)(distance / this.Owner.WalkSpeed), + (tick) => + { + this.Owner.Position = MovementHelpers.GetMovementPosition(this.Owner.Position, this.Owner.WalkSpeed, facingAngle, 6); + Logger.Trace("Step: " + this.Owner.Position); + }, + (tick) => + { + this.Owner.Position = Heading; + Logger.Trace("Completed: " + this.Owner.Position); + this.Done = true; + }); + + this.Started = true; + } + + public override void Update(int tickCounter) + { + this.Timer.Update(tickCounter); + } + + public override void Cancel(int tickCounter) + { + this.Done = true; + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Movement/MoveToPointWithPathfindAction.cs b/src/Mooege/Core/GS/Actors/Movement/MoveToPointWithPathfindAction.cs new file mode 100644 index 00000000..c6fec17a --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Movement/MoveToPointWithPathfindAction.cs @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using System.Linq; +using Mooege.Core.GS.Actors.Actions; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Ticker; + +namespace Mooege.Core.GS.Actors.Movement +{ + public class MoveToPointWithPathfindAction : ActorAction + { + public Vector3D Heading { get; private set; } + + public SteppedRelativeTickTimer Timer; + private List _path = new List(); + private AI.Pather.PathRequestTask _pathRequestTask; + public MoveToPointWithPathfindAction(Actor owner, Vector3D heading) + : base(owner) + { + // Sending a request for a Path to the Pathing thread. + _pathRequestTask = owner.World.Game.Pathfinder.GetPath(owner, owner.Position, heading); + this.Heading = heading; + + } + + public override void Start(int tickCounter) + { + // Just wait, path request hasnt been processed yet, idealy this would be null or something instead - Darklotus + if (!_pathRequestTask.PathFound) + return; + + // No path found, so end Action. + if (_pathRequestTask.Path.Count < 1) + { + this.Started = true; + this.Done = true; + return; + } + _path = _pathRequestTask.Path; + // Each path step will be 2.5f apart roughly, not sure on the math to get correct walk speed for the timer. + // mobs sometimes skip a bit, pretty sure this is because timing isnt correct. :( - DarkLotus + + + this.Timer = new SteppedRelativeTickTimer(this.Owner.World.Game, 18, (int)(_path.Count * 2 / this.Owner.WalkSpeed), + (tick) => + { + //this.Owner.Position = MovementHelpers.GetMovementPosition(this.Owner.Position, this.Owner.WalkSpeed, facingAngle, 6); + if (_path.Count >= 1) + { + this.Owner.Move(this._path.First(), MovementHelpers.GetFacingAngle(this.Owner, this._path.First())); + this.Owner.Position = _path.First(); + _path.RemoveAt(0); + //Logger.Trace("Step left in Queue: " + Path.Count); + } + else + { + this.Owner.Position = Heading; //Logger.Trace("Ticking with no path steps left"); + this.Done = true; + } + + }, + (tick) => + { + this.Owner.Position = Heading; + //Logger.Trace("Completed! Path contains :" + this.Path.Count); + this.Done = true; + }); + + this.Started = true; + } + + public override void Update(int tickCounter) + { + this.Timer.Update(tickCounter); + } + + public override void Cancel(int tickCounter) + { + this.Done = true; + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Movement/MovementHelpers.cs b/src/Mooege/Core/GS/Actors/Movement/MovementHelpers.cs new file mode 100644 index 00000000..c30bd8cf --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Movement/MovementHelpers.cs @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using Mooege.Core.GS.Common.Types.Math; + +namespace Mooege.Core.GS.Actors.Movement +{ + public static class MovementHelpers + { + /// + /// Returns 2D angle to face the target position. + /// + /// The looker. + /// The target. + /// + public static float GetFacingAngle(Vector3D lookerPosition, Vector3D targetPosition) + { + if ((lookerPosition == null) || (targetPosition == null)) + return 0f; + + float a = (float)Math.Atan2((targetPosition.Y - lookerPosition.Y), (targetPosition.X - lookerPosition.X)); + if (a < 0f) + a += (float)Math.PI * 2f; + + return a; + } + + public static float GetFacingAngle(Actor looker, Actor target) + { + return GetFacingAngle(looker.Position, target.Position); + } + + public static float GetFacingAngle(Actor looker, Vector2F targetPosition) + { + return GetFacingAngle(looker.Position, new Vector3D(targetPosition.X, targetPosition.Y, 0)); + } + + public static float GetFacingAngle(Actor looker, Vector3D targetPosition) + { + return GetFacingAngle(looker.Position, targetPosition); + } + + public static float GetDistance(Vector3D startPosition, Vector3D targetPosition) + { + if ((startPosition == null) || (targetPosition == null)) return 0; + return (float)Math.Sqrt(Math.Pow(startPosition.X - targetPosition.X, 2) + Math.Pow(startPosition.Y - targetPosition.Y, 2)); + } + + public static Vector3D GetMovementPosition(Vector3D position, float speed, float facingAngle, int ticks = 6) + { + var xDelta = (speed * ticks) * (float)Math.Cos(facingAngle); + var yDelta = (speed * ticks) * (float)Math.Sin(facingAngle); + + return new Vector3D(position.X + xDelta, position.Y + yDelta, position.Z); + } + } +} diff --git a/src/Mooege/Core/GS/Actors/NPC.cs b/src/Mooege/Core/GS/Actors/NPC.cs new file mode 100644 index 00000000..237e4643 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/NPC.cs @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Core.GS.Map; +using Mooege.Net.GS.Message; +using Mooege.Core.GS.Common.Types.TagMap; + +namespace Mooege.Core.GS.Actors +{ + public class NPC : Living + { + public override ActorType ActorType { get { return ActorType.Monster; } } + + public NPC(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + this.Field2 = 0x9; + this.Field7 = 2; + this.Attributes[GameAttribute.Is_NPC] = true; + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Portal.cs b/src/Mooege/Core/GS/Actors/Portal.cs new file mode 100644 index 00000000..23499365 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Portal.cs @@ -0,0 +1,139 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Common.Helpers.Hash; +using Mooege.Common.Logging; +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Players; +using Mooege.Net.GS.Message.Definitions.Misc; +using Mooege.Net.GS.Message.Definitions.World; +using Mooege.Net.GS.Message.Fields; +using Mooege.Net.GS.Message.Definitions.Map; +using Mooege.Core.GS.Common.Types.TagMap; +using System.Collections.Generic; + +namespace Mooege.Core.GS.Actors +{ + public class Portal : Actor + { + static readonly Logger Logger = LogManager.CreateLogger(); + + public override ActorType ActorType { get { return ActorType.Gizmo; } } + + private ResolvedPortalDestination Destination { get; set; } + private int MinimapIcon; + + public Portal(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + try + { + this.Destination = new ResolvedPortalDestination + { + WorldSNO = tags[MarkerKeys.DestinationWorld].Id, + DestLevelAreaSNO = tags[MarkerKeys.DestinationLevelArea].Id, + StartingPointActorTag = tags[MarkerKeys.DestinationActorTag] + }; + + // Override minimap icon in merkerset tags + if (tags.ContainsKey(MarkerKeys.MinimapTexture)) + { + MinimapIcon = tags[MarkerKeys.MinimapTexture].Id; + } + else + { + MinimapIcon = ActorData.TagMap[ActorKeys.MinimapMarker].Id; + } + + } + catch (KeyNotFoundException) + { + Logger.Warn("Portal {0} has incomplete definition", this.ActorSNO.Id); + } + this.Field2 = 16; + + // FIXME: Hardcoded crap; probably don't need to set most of these. /komiga + //this.Attributes[GameAttribute.MinimapActive] = true; + //this.Attributes[GameAttribute.Hitpoints_Max_Total] = 1f; + //this.Attributes[GameAttribute.Hitpoints_Max] = 0.0009994507f; + //this.Attributes[GameAttribute.Hitpoints_Total_From_Level] = 3.051758E-05f; + //this.Attributes[GameAttribute.Hitpoints_Cur] = 0.0009994507f; + //this.Attributes[GameAttribute.Level] = 1; + } + + public override bool Reveal(Player player) + { + if (!base.Reveal(player) || this.Destination == null) + return false; + + player.InGameClient.SendMessage(new PortalSpecifierMessage() + { + ActorID = this.DynamicID, + Destination = this.Destination + }); + + // Show a minimap icon + Mooege.Common.MPQ.Asset asset; + string markerName = ""; + + if (Mooege.Common.MPQ.MPQStorage.Data.Assets[Common.Types.SNO.SNOGroup.LevelArea].TryGetValue(this.Destination.DestLevelAreaSNO, out asset)) + markerName = System.IO.Path.GetFileNameWithoutExtension(asset.FileName); + + player.InGameClient.SendMessage(new MapMarkerInfoMessage() + { + Field0 = (int)World.NewSceneID, // TODO What is the correct id space for mapmarkers? + Field1 = new WorldPlace() + { + Position = this.Position, + WorldID = this.World.DynamicID + }, + Field2 = MinimapIcon, // 0x00018FB0, /* Marker_DungeonEntrance.tex */ // TODO Dont mark all portals as dungeon entrances... some may be exits too (although d3 does not necesarrily use the correct markers). Also i have found no hacky way to determine whether a portal is entrance or exit - farmy + m_snoStringList = 0x0000CB2E, /* LevelAreaNames.stl */ // TODO Dont use hardcoded numbers + + Field3 = StringHashHelper.HashNormal(markerName), + Field9 = 0, + Field10 = 0, + Field11 = 0, + Field5 = 0, + Field6 = true, + Field7 = false, + Field8 = true, + Field12 = 0 + }); + return true; + } + + public override void OnTargeted(Player player, TargetMessage message) + { + var world = this.World.Game.GetWorld(this.Destination.WorldSNO); + + if (world == null) + { + Logger.Warn("Portal's destination world does not exist (WorldSNO = {0})", this.Destination.WorldSNO); + return; + } + + var startingPoint = world.GetStartingPointById(this.Destination.StartingPointActorTag); + + if (startingPoint != null) + player.ChangeWorld(world, startingPoint); + else + Logger.Warn("Portal's tagged starting point does not exist (Tag = {0})", this.Destination.StartingPointActorTag); + } + } +} diff --git a/src/Mooege/Core/GS/Actors/ServerProp.cs b/src/Mooege/Core/GS/Actors/ServerProp.cs new file mode 100644 index 00000000..42a87a50 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/ServerProp.cs @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Core.GS.Map; + +namespace Mooege.Core.GS.Actors +{ + public class ServerProp : Actor + { + public override ActorType ActorType + { + get { return ActorType.ServerProp; } + } + + public ServerProp(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + this.Field2 = 16; + this.Field7 = 0x00000001; + this.CollFlags = 0; // a hack for passing through blockers /fasbat + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Spawner.cs b/src/Mooege/Core/GS/Actors/Spawner.cs new file mode 100644 index 00000000..2ad09ce3 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Spawner.cs @@ -0,0 +1,99 @@ +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Games; +using Mooege.Core.GS.Common.Types.SNO; + + +namespace Mooege.Core.GS.Actors +{ + public class Spawner : Actor + { + + /// + /// What actor this gizmo will spawn + /// + public SNOHandle ActorToSpawnSNO { get; private set; } + + public override ActorType ActorType + { + get { return ActorType.Gizmo; } + } + + public Spawner(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + this.Field2 = 8; + this.Field7 = 0x00000000; + + //Actor.Data.TagMap contains: {66368 = 291072} + //public static TagKeyInt Spawn2 = new TagKeyInt(291072); + //TODO: Find why Tags is not the same as Actor.Data.TagMap + if (Tags.ContainsKey(MarkerKeys.SpawnActor)) + this.ActorToSpawnSNO = Tags[MarkerKeys.SpawnActor]; + + } + + /// + /// Rewrite the quest handling event + /// + /// + protected override void quest_OnQuestProgress(Quest quest) + { + //Spawn if this is spawner + if (World.Game.Quests.IsInQuestRange(_questRange)) + { + this.Spawn(); + } + } + + /// + /// Override for AfterChangeWorld + /// + public override void AfterChangeWorld() + { + base.AfterChangeWorld(); + } + + /// + /// Main spawn method + /// + public void Spawn() + { + if (this.ActorToSpawnSNO == null) + { + // Logger.Debug("Triggered spawner with no ActorToSpawnSNO found."); + //Try revealing this + foreach (var player in this.World.Players.Values) + { + base.Reveal(player); + } + return; + } + var location = new PRTransform() + { + Quaternion = new Quaternion + { + W = this.RotationW, + Vector3D = this.RotationAxis + }, + Vector3D = this.Position + }; + + Mooege.Core.GS.Generators.WorldGenerator.loadActor(ActorToSpawnSNO, location, this.World, ((Mooege.Common.MPQ.FileFormats.Actor)ActorToSpawnSNO.Target).TagMap); + + //once target spawned this can be destroyed + this.Destroy(); + } + + /// + /// Reveal Override. For Spawner Gizmos there is no reveal necessary. + /// + /// + /// + public override bool Reveal(Players.Player player) + { + return false; + } + } +} diff --git a/src/Mooege/Core/GS/Common/InventoryGrid.cs b/src/Mooege/Core/GS/Common/InventoryGrid.cs new file mode 100644 index 00000000..9a6b947b --- /dev/null +++ b/src/Mooege/Core/GS/Common/InventoryGrid.cs @@ -0,0 +1,279 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using Mooege.Common.Logging; +using Mooege.Core.GS.Actors; +using Mooege.Core.GS.Items; +using Mooege.Core.GS.Objects; +using Mooege.Core.GS.Players; + +namespace Mooege.Core.GS.Common +{ + + /// + /// This class handels the gridlayout of an stash. Possible usecases are the inventory backpack, shared stash, traders stash,... + /// Stash is organized by adding an item to EVERY slot it fills + /// + public class InventoryGrid : IRevealable + { + static readonly Logger Logger = LogManager.CreateLogger(); + + public int EquipmentSlot { get; private set; } + public int Rows { get { return _backpack.GetLength(0); } } + public int Columns { get { return _backpack.GetLength(1); } } + public Dictionary Items { get; private set; } + private uint[,] _backpack; + + private readonly Actor _owner; // Used, because most information is not in the item class but Actors managed by the world + + private struct InventorySize + { + public int Width; + public int Height; + } + + private struct InventorySlot + { + public int Row; + public int Column; + } + + public InventoryGrid(Actor owner, int rows, int columns, int slot = 0) + { + this._backpack = new uint[rows, columns]; + this._owner = owner; + this.Items = new Dictionary(); + this.EquipmentSlot = slot; + } + + public void ResizeGrid(int rows, int columns) + { + var newBackpack = new uint[rows, columns]; + Array.Copy(_backpack, newBackpack, _backpack.Length); + _backpack = newBackpack; + } + + public void Clear() + { + Items.Clear(); + int r = Rows; + int c = Columns; + this._backpack = new uint[r, c]; + } + + // This should be in the database# + // Do all items need a rectangual space in diablo 3? + private InventorySize GetItemInventorySize(Item item) + { + if (EquipmentSlot == (int)EquipmentSlotId.Vendor) + return new InventorySize() { Width = 1, Height = 1 }; + // TODO: identify a belt as 1x1, not as generic armour 1x2 + if (Item.IsWeapon(item.ItemType) || Item.IsArmor(item.ItemType) || Item.IsOffhand(item.ItemType)) + { + return new InventorySize() { Width = 1, Height = 2 }; + } + return new InventorySize() { Width = 1, Height = 1 }; + + } + + public bool FreeSpace(Item item, int row, int column) + { + bool result = true; + InventorySize size = GetItemInventorySize(item); + + for (int r = row; r < Math.Min(row + size.Height, Rows); r++) + for (int c = column; c < Math.Min(column + size.Width, Columns); c++) + if ((_backpack[r, c] != 0) && (_backpack[r, c] != item.DynamicID)) + result = false; + return result; + } + + /// + /// Collects (counts) the items overlapping with the item about to be dropped. + /// If there are none, drop item + /// If there is exacly one, swap it with item (TODO) + /// If there are more, item cannot be dropped + /// + private int CollectOverlappingItems(Item item, int row, int column) + { + InventorySize dropSize = GetItemInventorySize(item); + var overlapping = new List(); + + // For every slot... + for (int r = row; r < _backpack.GetLength(0) && r < row + dropSize.Height; r++) + for (int c = column; c < _backpack.GetLength(1) && c < column + dropSize.Width; c++) + + // that contains an item other than the one we want to drop + if (_backpack[r, c] != 0 && _backpack[r, c] != item.DynamicID) //TODO this would break for an item with id 0 + + // add it to the list if if dropping the item in would need the same slot + //if (r >= row && r <= row + dropSize.Height) + // if (c >= column && c <= column + dropSize.Width) + if (!overlapping.Contains(_backpack[r, c])) + overlapping.Add(_backpack[r, c]); + + return overlapping.Count; + } + + /// + /// Removes an item from the backpack + /// + public void RemoveItem(Item item) + { + if (!Items.ContainsKey(item.DynamicID)) + return; + + Items.Remove(item.DynamicID); + + for (int r = 0; r < Rows; r++) + { + for (int c = 0; c < Columns; c++) + { + if (_backpack[r, c] == item.DynamicID) + { + _backpack[r, c] = 0; + } + } + } + } + + /// + /// Adds an item to the backpack + /// + public void AddItem(Item item, int row, int column) + { + InventorySize size = GetItemInventorySize(item); + + //check backpack boundaries + if (row + size.Width > Rows || column + size.Width > Columns) return; + + Items.Add(item.DynamicID, item); + + for (int r = row; r < Math.Min(row + size.Height, Rows); r++) + for (int c = column; c < Math.Min(column + size.Width, Columns); c++) + { + System.Diagnostics.Debug.Assert(_backpack[r, c] == 0, "You need to remove an item from the backpack before placing another item there"); + _backpack[r, c] = item.DynamicID; + } + + item.Owner = _owner; + item.SetInventoryLocation(EquipmentSlot, column, row); + } + + /// + /// Adds an Item at a free spot to the backpack + /// + /// + public bool AddItem(Item item) + { + return AddItem(-1, -1, item); + } + /// + /// Adds an Item at a free spot to the backpack + /// + /// + /// + /// + public bool AddItem(int minRow, int maxRow, Item item) + { + InventorySlot? slot = FindSlotForItem(minRow, maxRow, item); + if (slot.HasValue) + { + AddItem(item, slot.Value.Row, slot.Value.Column); + return true; + } + else + { + Logger.Error("Can't find slot in backpack to add item {0}", item.ActorSNO); + return false; + } + } + + public Boolean HasFreeSpace(Item item) + { + return (FindSlotForItem(-1, -1, item) != null); + } + + public Boolean HasFreeSpace(int minRow, int maxRow, Item item) + { + return (FindSlotForItem(minRow, maxRow, item) != null); + } + + /// + /// Checks whether the inventory contains an item + /// + public bool Contains(uint itemID) + { + return Items.ContainsKey(itemID); + } + + public bool Contains(Item item) + { + return Contains(item.DynamicID); + } + + /// + /// Find an inventory slot with enough space for an item + /// + /// Slot or null if there is no space in the backpack + private InventorySlot? FindSlotForItem(int minRow, int maxRow, Item item) + { + InventorySize size = GetItemInventorySize(item); + // If we target a specific tab in stash, we need to specify min and max row to fill + int nStartRow = minRow == -1 ? 0 : Math.Min(minRow, Rows); // maybe not needed, because Rows always > minRow + int nEndRow = minRow == -1 ? Rows : Math.Min(maxRow, Rows); + for (int r = nStartRow; r <= nEndRow - size.Height; r++) + for (int c = 0; c <= Columns - size.Width; c++) + if (CollectOverlappingItems(item, r, c) == 0) + return new InventorySlot() { Row = r, Column = c }; + return null; + } + + public bool Reveal(Player player) + { + if (_owner == null || _owner.World == null) + return false; + + foreach (var item in Items.Values) + item.Reveal(player); + + return true; + } + + public bool Unreveal(Player player) + { + if (_owner == null || _owner.World == null) + return false; + + foreach (var item in Items.Values) + item.Unreveal(player); + + return true; + } + + public Item GetItem(uint itemId) + { + Item item; + if (!Items.TryGetValue(itemId, out item)) + return null; + return item; + } + } +} diff --git a/src/Mooege/Core/GS/Common/Types/Collision/AABB.cs b/src/Mooege/Core/GS/Common/Types/Collision/AABB.cs new file mode 100644 index 00000000..c6492231 --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/Collision/AABB.cs @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using CrystalMpq; +using Gibbed.IO; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Net.GS.Message; +using Mooege.Common.Storage; + +namespace Mooege.Core.GS.Common.Types.Collision +{ + public class AABB + { + [PersistentProperty("Min")] + public Vector3D Min { get; private set; } + [PersistentProperty("Max")] + public Vector3D Max { get; private set; } + + public AABB() { } + + /// + /// Reads AABB from given MPQFileStream. + /// + /// The MPQFileStream to read from. + public AABB(MpqFileStream stream) + { + this.Min = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32()); + this.Max = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32()); + } + + /// + /// Parses AABB from given GameBitBuffer. + /// + /// The GameBitBuffer to parse from. + public void Parse(GameBitBuffer buffer) + { + Min = new Vector3D(); + Min.Parse(buffer); + Max = new Vector3D(); + Max.Parse(buffer); + } + + /// + /// Encodes AABB to given GameBitBuffer. + /// + /// The GameBitBuffer to write. + public void Encode(GameBitBuffer buffer) + { + Min.Encode(buffer); + Max.Encode(buffer); + } + + public bool IsWithin(Vector3D v) + { + if (v >= this.Min && + v <= this.Max) + { + return true; + } + return false; + } + + public bool Intersects(AABB other) + { + if (// Max < o.Min + this.Max.X < other.Min.X || + this.Max.Y < other.Min.Y || + this.Max.Z < other.Min.Z || + // Min > o.Max + this.Min.X > other.Max.X || + this.Min.Y > other.Max.Y || + this.Min.Z > other.Max.Z) + { + return false; + } + return true; // Intersects if above fails + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("AABB:"); + b.Append(' ', pad++); + b.AppendLine("{"); + Min.AsText(b, pad); + Max.AsText(b, pad); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + public override string ToString() + { + return string.Format("AABB: min:{0} max:{1}", this.Min, this.Max); + } + } +} diff --git a/src/Mooege/Core/GS/Common/Types/Math/PRTransform.cs b/src/Mooege/Core/GS/Common/Types/Math/PRTransform.cs new file mode 100644 index 00000000..3d026d06 --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/Math/PRTransform.cs @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using CrystalMpq; +using Mooege.Net.GS.Message; +using Mooege.Common.Storage; + +namespace Mooege.Core.GS.Common.Types.Math +{ + public class PRTransform + { + [PersistentProperty("Quaternion")] + public Quaternion Quaternion { get; set; } + [PersistentProperty("Vector3D")] + public Vector3D Vector3D { get; set; } + + public PRTransform() { } + + /// + /// Reads PRTransform from given MPQFileStream. + /// + /// The MPQFileStream to read from. + public PRTransform(MpqFileStream stream) + { + Quaternion = new Quaternion(stream); + Vector3D = new Vector3D(stream); + } + + /// + /// Reads PRTransform from given GameBitBuffer. + /// + /// The GameBitBuffer to parse from. + public void Parse(GameBitBuffer buffer) + { + Quaternion = new Quaternion(); + Quaternion.Parse(buffer); + Vector3D = new Vector3D(); + Vector3D.Parse(buffer); + } + + /// + /// Encodes PRTransform to given GameBitBuffer. + /// + /// The GameBitBuffer to write. + public void Encode(GameBitBuffer buffer) + { + Quaternion.Encode(buffer); + Vector3D.Encode(buffer); + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("PRTransform:"); + b.Append(' ', pad++); + b.AppendLine("{"); + Quaternion.AsText(b, pad); + Vector3D.AsText(b, pad); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} diff --git a/src/Mooege/Core/GS/Common/Types/Math/Quaternion.cs b/src/Mooege/Core/GS/Common/Types/Math/Quaternion.cs new file mode 100644 index 00000000..d9561dcf --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/Math/Quaternion.cs @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using CrystalMpq; +using Gibbed.IO; +using Mooege.Net.GS.Message; +using Mooege.Common.Storage; + +namespace Mooege.Core.GS.Common.Types.Math +{ + public class Quaternion + { + [PersistentProperty("W")] + public float W { get; set; } + [PersistentProperty("Vector3D")] + public Vector3D Vector3D { get; set; } + + public Quaternion() { } + + /// + /// Creates an quaternion that rotates along the Z-axis by the specified "facing" angle. + /// + /// The angle in radians. + /// + public static Quaternion FacingRotation(float facingAngle) + { + return new Quaternion + { + W = (float)System.Math.Cos(facingAngle / 2f), + Vector3D = new Vector3D(0, 0, (float)System.Math.Sin(facingAngle / 2f)) + }; + } + + /// + /// Reads Quaternion from given MPQFileStream. + /// + /// The MPQFileStream to read from. + public Quaternion(MpqFileStream stream) + { + this.Vector3D = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32()); + this.W = stream.ReadValueF32(); + } + + /// + /// Parses Quaternion from given GameBitBuffer. + /// + /// The GameBitBuffer to parse from. + public void Parse(GameBitBuffer buffer) + { + W = buffer.ReadFloat32(); + Vector3D = new Vector3D(); + Vector3D.Parse(buffer); + } + + /// + /// Encodes Quaternion to given GameBitBuffer. + /// + /// The GameBitBuffer to write. + public void Encode(GameBitBuffer buffer) + { + buffer.WriteFloat32(W); + Vector3D.Encode(buffer); + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("Quaternion:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); + b.AppendLine("W: " + W.ToString("G")); + Vector3D.AsText(b, pad); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Core/GS/Common/Types/Math/Vector2D.cs b/src/Mooege/Core/GS/Common/Types/Math/Vector2D.cs new file mode 100644 index 00000000..d47a676d --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/Math/Vector2D.cs @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using CrystalMpq; +using Gibbed.IO; +using Mooege.Net.GS.Message; +using Mooege.Common.Storage; + +namespace Mooege.Core.GS.Common.Types.Math +{ + public class Vector2D + { + [PersistentProperty("X")] + public int X { get; set; } + + [PersistentProperty("Y")] + public int Y { get; set; } + + public Vector2D() { } + + /// + /// Reads Vector2D from given MPQFileStream. + /// + /// The MPQFileStream to read from. + public Vector2D(MpqFileStream stream) + { + X = stream.ReadValueS32(); + Y = stream.ReadValueS32(); + } + + public Vector2D(int x, int y) + { + this.X = x; + this.Y = y; + } + + /// + /// Parses Vector2D from given GameBitBuffer. + /// + /// The GameBitBuffer to parse from. + public void Parse(GameBitBuffer buffer) + { + X = buffer.ReadInt(32); + Y = buffer.ReadInt(32); + } + + /// + /// Encodes Vector2D to given GameBitBuffer. + /// + /// The GameBitBuffer to write. + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, X); + buffer.WriteInt(32, Y); + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("Vector2D:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); + b.AppendLine("X: 0x" + X.ToString("X8") + " (" + X + ")"); + b.Append(' ', pad); + b.AppendLine("Y: 0x" + Y.ToString("X8") + " (" + Y + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + public override string ToString() + { + return string.Format("x:{0} y:{1}", X, Y); + } + } +} diff --git a/src/Mooege/Core/GS/Common/Types/Math/Vector2F.cs b/src/Mooege/Core/GS/Common/Types/Math/Vector2F.cs new file mode 100644 index 00000000..40f9a6d0 --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/Math/Vector2F.cs @@ -0,0 +1,460 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Globalization; + +namespace Mooege.Core.GS.Common.Types.Math +{ + public struct Vector2F : IEquatable + { + public float X; + public float Y; + private static Vector2F _zero; + private static Vector2F _one; + private static Vector2F _unitX; + private static Vector2F _unitY; + + public static Vector2F Zero + { + get { return _zero; } + } + + public static Vector2F One + { + get { return _one; } + } + + public static Vector2F UnitX + { + get { return _unitX; } + } + + public static Vector2F UnitY + { + get { return _unitY; } + } + + public Vector2F(float x, float y) + { + this.X = x; + this.Y = y; + } + + public Vector2F(float value) + { + this.X = this.Y = value; + } + + public override string ToString() + { + CultureInfo currentCulture = CultureInfo.CurrentCulture; + return string.Format(currentCulture, "{{X:{0} Y:{1}}}", + new object[] { this.X.ToString(currentCulture), this.Y.ToString(currentCulture) }); + } + + public bool Equals(Vector2F other) + { + return ((this.X == other.X) && (this.Y == other.Y)); + } + + public override bool Equals(object obj) + { + bool flag = false; + if (obj is Vector2F) + { + flag = this.Equals((Vector2F)obj); + } + return flag; + } + + public override int GetHashCode() + { + return (this.X.GetHashCode() + this.Y.GetHashCode()); + } + + public float Length() + { + float num = (this.X * this.X) + (this.Y * this.Y); + return (float)System.Math.Sqrt((double)num); + } + + public float LengthSquared() + { + return ((this.X * this.X) + (this.Y * this.Y)); + } + + public static float Distance(Vector2F value1, Vector2F value2) + { + float num2 = value1.X - value2.X; + float num = value1.Y - value2.Y; + float num3 = (num2 * num2) + (num * num); + return (float)System.Math.Sqrt((double)num3); + } + + public static void Distance(ref Vector2F value1, ref Vector2F value2, out float result) + { + float num2 = value1.X - value2.X; + float num = value1.Y - value2.Y; + float num3 = (num2 * num2) + (num * num); + result = (float)System.Math.Sqrt((double)num3); + } + + public static float DistanceSquared(Vector2F value1, Vector2F value2) + { + float num2 = value1.X - value2.X; + float num = value1.Y - value2.Y; + return ((num2 * num2) + (num * num)); + } + + public static void DistanceSquared(ref Vector2F value1, ref Vector2F value2, out float result) + { + float num2 = value1.X - value2.X; + float num = value1.Y - value2.Y; + result = (num2 * num2) + (num * num); + } + + public static float Dot(Vector2F value1, Vector2F value2) + { + return ((value1.X * value2.X) + (value1.Y * value2.Y)); + } + + public static void Dot(ref Vector2F value1, ref Vector2F value2, out float result) + { + result = (value1.X * value2.X) + (value1.Y * value2.Y); + } + + public void Normalize() + { + float num2 = (this.X * this.X) + (this.Y * this.Y); + float num = 1f / ((float)System.Math.Sqrt((double)num2)); + this.X *= num; + this.Y *= num; + } + + public static Vector2F Normalize(Vector2F value) + { + Vector2F vector; + float num2 = (value.X * value.X) + (value.Y * value.Y); + float num = 1f / ((float)System.Math.Sqrt((double)num2)); + vector.X = value.X * num; + vector.Y = value.Y * num; + return vector; + } + + public static void Normalize(ref Vector2F value, out Vector2F result) + { + float num2 = (value.X * value.X) + (value.Y * value.Y); + float num = 1f / ((float)System.Math.Sqrt((double)num2)); + result.X = value.X * num; + result.Y = value.Y * num; + } + + /// + /// Returns the angle in radians between this vector and another vector + /// + /// + /// + public float Angle(Vector2F other) + { + return (float)System.Math.Acos(Dot(this, other) / Length() / other.Length()); + } + + /// + /// Returns the rotation of this vector to the x unity vector in radians + /// + /// + /// + public float Rotation() + { + return Angle(Vector2F.UnitY) > Angle(-Vector2F.UnitY) ? -Angle(Vector2F.UnitX) : Angle(Vector2F.UnitX); + } + + + public static Vector2F Reflect(Vector2F vector, Vector2F normal) + { + Vector2F vector2F; + float num = (vector.X * normal.X) + (vector.Y * normal.Y); + vector2F.X = vector.X - ((2f * num) * normal.X); + vector2F.Y = vector.Y - ((2f * num) * normal.Y); + return vector2F; + } + + public static void Reflect(ref Vector2F vector, ref Vector2F normal, out Vector2F result) + { + float num = (vector.X * normal.X) + (vector.Y * normal.Y); + result.X = vector.X - ((2f * num) * normal.X); + result.Y = vector.Y - ((2f * num) * normal.Y); + } + + public static Vector2F Min(Vector2F value1, Vector2F value2) + { + Vector2F vector; + vector.X = (value1.X < value2.X) ? value1.X : value2.X; + vector.Y = (value1.Y < value2.Y) ? value1.Y : value2.Y; + return vector; + } + + public static void Min(ref Vector2F value1, ref Vector2F value2, out Vector2F result) + { + result.X = (value1.X < value2.X) ? value1.X : value2.X; + result.Y = (value1.Y < value2.Y) ? value1.Y : value2.Y; + } + + public static Vector2F Max(Vector2F value1, Vector2F value2) + { + Vector2F vector; + vector.X = (value1.X > value2.X) ? value1.X : value2.X; + vector.Y = (value1.Y > value2.Y) ? value1.Y : value2.Y; + return vector; + } + + public static void Max(ref Vector2F value1, ref Vector2F value2, out Vector2F result) + { + result.X = (value1.X > value2.X) ? value1.X : value2.X; + result.Y = (value1.Y > value2.Y) ? value1.Y : value2.Y; + } + + public static Vector2F Clamp(Vector2F value1, Vector2F min, Vector2F max) + { + Vector2F vector; + float x = value1.X; + x = (x > max.X) ? max.X : x; + x = (x < min.X) ? min.X : x; + float y = value1.Y; + y = (y > max.Y) ? max.Y : y; + y = (y < min.Y) ? min.Y : y; + vector.X = x; + vector.Y = y; + return vector; + } + + public static void Clamp(ref Vector2F value1, ref Vector2F min, ref Vector2F max, out Vector2F result) + { + float x = value1.X; + x = (x > max.X) ? max.X : x; + x = (x < min.X) ? min.X : x; + float y = value1.Y; + y = (y > max.Y) ? max.Y : y; + y = (y < min.Y) ? min.Y : y; + result.X = x; + result.Y = y; + } + + public static Vector2F Lerp(Vector2F value1, Vector2F value2, float amount) + { + Vector2F vector; + vector.X = value1.X + ((value2.X - value1.X) * amount); + vector.Y = value1.Y + ((value2.Y - value1.Y) * amount); + return vector; + } + + public static void Lerp(ref Vector2F value1, ref Vector2F value2, float amount, out Vector2F result) + { + result.X = value1.X + ((value2.X - value1.X) * amount); + result.Y = value1.Y + ((value2.Y - value1.Y) * amount); + } + + public static Vector2F Negate(Vector2F value) + { + Vector2F vector; + vector.X = -value.X; + vector.Y = -value.Y; + return vector; + } + + public static void Negate(ref Vector2F value, out Vector2F result) + { + result.X = -value.X; + result.Y = -value.Y; + } + + public static Vector2F Add(Vector2F value1, Vector2F value2) + { + Vector2F vector; + vector.X = value1.X + value2.X; + vector.Y = value1.Y + value2.Y; + return vector; + } + + public static void Add(ref Vector2F value1, ref Vector2F value2, out Vector2F result) + { + result.X = value1.X + value2.X; + result.Y = value1.Y + value2.Y; + } + + public static Vector2F Subtract(Vector2F value1, Vector2F value2) + { + Vector2F vector; + vector.X = value1.X - value2.X; + vector.Y = value1.Y - value2.Y; + return vector; + } + + public static void Subtract(ref Vector2F value1, ref Vector2F value2, out Vector2F result) + { + result.X = value1.X - value2.X; + result.Y = value1.Y - value2.Y; + } + + public static Vector2F Multiply(Vector2F value1, Vector2F value2) + { + Vector2F vector; + vector.X = value1.X * value2.X; + vector.Y = value1.Y * value2.Y; + return vector; + } + + public static void Multiply(ref Vector2F value1, ref Vector2F value2, out Vector2F result) + { + result.X = value1.X * value2.X; + result.Y = value1.Y * value2.Y; + } + + public static Vector2F Multiply(Vector2F value1, float scaleFactor) + { + Vector2F vector; + vector.X = value1.X * scaleFactor; + vector.Y = value1.Y * scaleFactor; + return vector; + } + + public static void Multiply(ref Vector2F value1, float scaleFactor, out Vector2F result) + { + result.X = value1.X * scaleFactor; + result.Y = value1.Y * scaleFactor; + } + + public static Vector2F Divide(Vector2F value1, Vector2F value2) + { + Vector2F vector; + vector.X = value1.X / value2.X; + vector.Y = value1.Y / value2.Y; + return vector; + } + + public static void Divide(ref Vector2F value1, ref Vector2F value2, out Vector2F result) + { + result.X = value1.X / value2.X; + result.Y = value1.Y / value2.Y; + } + + public static Vector2F Divide(Vector2F value1, float divider) + { + Vector2F vector; + float num = 1f / divider; + vector.X = value1.X * num; + vector.Y = value1.Y * num; + return vector; + } + + public static void Divide(ref Vector2F value1, float divider, out Vector2F result) + { + float num = 1f / divider; + result.X = value1.X * num; + result.Y = value1.Y * num; + } + + public static Vector2F operator -(Vector2F value) + { + Vector2F vector; + vector.X = -value.X; + vector.Y = -value.Y; + return vector; + } + + public static bool operator ==(Vector2F value1, Vector2F value2) + { + return ((value1.X == value2.X) && (value1.Y == value2.Y)); + } + + public static bool operator !=(Vector2F value1, Vector2F value2) + { + if (value1.X == value2.X) + { + return !(value1.Y == value2.Y); + } + return true; + } + + public static Vector2F operator +(Vector2F value1, Vector2F value2) + { + Vector2F vector; + vector.X = value1.X + value2.X; + vector.Y = value1.Y + value2.Y; + return vector; + } + + public static Vector2F operator -(Vector2F value1, Vector2F value2) + { + Vector2F vector; + vector.X = value1.X - value2.X; + vector.Y = value1.Y - value2.Y; + return vector; + } + + public static Vector2F operator *(Vector2F value1, Vector2F value2) + { + Vector2F vector; + vector.X = value1.X * value2.X; + vector.Y = value1.Y * value2.Y; + return vector; + } + + public static Vector2F operator *(Vector2F value, float scaleFactor) + { + Vector2F vector; + vector.X = value.X * scaleFactor; + vector.Y = value.Y * scaleFactor; + return vector; + } + + public static Vector2F operator *(float scaleFactor, Vector2F value) + { + Vector2F vector; + vector.X = value.X * scaleFactor; + vector.Y = value.Y * scaleFactor; + return vector; + } + + public static Vector2F operator /(Vector2F value1, Vector2F value2) + { + Vector2F vector; + vector.X = value1.X / value2.X; + vector.Y = value1.Y / value2.Y; + return vector; + } + + public static Vector2F operator /(Vector2F value1, float divider) + { + Vector2F vector; + float num = 1f / divider; + vector.X = value1.X * num; + vector.Y = value1.Y * num; + return vector; + } + + static Vector2F() + { + _zero = new Vector2F(); + _one = new Vector2F(1f, 1f); + _unitX = new Vector2F(1f, 0f); + _unitY = new Vector2F(0f, 1f); + } + } +} diff --git a/src/Mooege/Core/GS/Common/Types/Math/Vector3D.cs b/src/Mooege/Core/GS/Common/Types/Math/Vector3D.cs new file mode 100644 index 00000000..eba7fb4b --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/Math/Vector3D.cs @@ -0,0 +1,209 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using CrystalMpq; +using Gibbed.IO; +using Mooege.Common.MPQ; +using Mooege.Net.GS.Message; +using Mooege.Common.Storage; + +namespace Mooege.Core.GS.Common.Types.Math +{ + public class Vector3D : ISerializableData + { + [PersistentProperty("X")] + public float X { get; set; } + [PersistentProperty("Y")] + public float Y { get; set; } + [PersistentProperty("Z")] + public float Z { get; set; } + + public Vector3D() + { + this.X = 0; + this.Y = 0; + this.Z = 0; + } + + public Vector3D(Vector3D vector) + { + this.X = vector.X; + this.Y = vector.Y; + this.Z = vector.Z; + } + + public Vector3D(float x, float y, float z) + { + Set(x, y, z); + } + + /// + /// Reads Vector3D from given MPQFileStream. + /// + /// The MPQFileStream to read from. + public Vector3D(MpqFileStream stream) + : this(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32()) + { + } + + public void Read(MpqFileStream stream) + { + X = stream.ReadValueF32(); + Y = stream.ReadValueF32(); + Z = stream.ReadValueF32(); + } + + /// + /// Parses Vector3D from given GameBitBuffer. + /// + /// The GameBitBuffer to parse from. + public void Parse(GameBitBuffer buffer) + { + X = buffer.ReadFloat32(); + Y = buffer.ReadFloat32(); + Z = buffer.ReadFloat32(); + } + + /// + /// Encodes Vector3D to given GameBitBuffer. + /// + /// The GameBitBuffer to write. + public void Encode(GameBitBuffer buffer) + { + buffer.WriteFloat32(X); + buffer.WriteFloat32(Y); + buffer.WriteFloat32(Z); + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("Vector3D:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); + b.AppendLine("X: " + X.ToString("G")); + b.Append(' ', pad); + b.AppendLine("Y: " + Y.ToString("G")); + b.Append(' ', pad); + b.AppendLine("Z: " + Z.ToString("G")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + public void Set(float x, float y, float z) + { + this.X = x; + this.Y = y; + this.Z = z; + } + + /// + /// Calculates the distance squared from this vector to another. + /// + /// the second + /// the distance squared between the vectors + public float DistanceSquared(ref Vector3D point) + { + float x = point.X - X; + float y = point.Y - Y; + float z = point.Z - Z; + + return ((x * x) + (y * y)) + (z * z); + } + + public static bool operator ==(Vector3D a, Vector3D b) + { + if (object.ReferenceEquals(null, a)) + return object.ReferenceEquals(null, b); + return a.Equals(b); + } + + public static bool operator !=(Vector3D a, Vector3D b) + { + return !(a == b); + } + + public static bool operator >(Vector3D a, Vector3D b) + { + if (object.ReferenceEquals(null, a)) + return !object.ReferenceEquals(null, b); + return a.X > b.X + && a.Y > b.Y + && a.Z > b.Z; + } + + public static Vector3D operator +(Vector3D a, Vector3D b) + { + return new Vector3D(a.X + b.X, a.Y + b.Y, a.Z + b.Z); + } + + public static Vector3D operator -(Vector3D a, Vector3D b) + { + return new Vector3D(a.X - b.X, a.Y - b.Y, a.Z - b.Z); + } + + public static bool operator <(Vector3D a, Vector3D b) + { + return !(a > b); + } + + public static bool operator >=(Vector3D a, Vector3D b) + { + if (object.ReferenceEquals(null, a)) + return object.ReferenceEquals(null, b); + return a.X >= b.X + && a.Y >= b.Y + && a.Z >= b.Z; + } + + public static bool operator <=(Vector3D a, Vector3D b) + { + if (object.ReferenceEquals(null, a)) + return object.ReferenceEquals(null, b); + return a.X <= b.X + && a.Y <= b.Y + && a.Z <= b.Z; + } + + public override bool Equals(object o) + { + if (object.ReferenceEquals(this, o)) + return true; + var v = o as Vector3D; + if (v != null) + { + return this.X == v.X + && this.Y == v.Y + && this.Z == v.Z; + } + return false; + } + + public override int GetHashCode() + { + return X.GetHashCode() ^ Y.GetHashCode() ^ Z.GetHashCode(); + } + + public override string ToString() + { + return string.Format("x:{0} y:{1} z:{2}", X, Y, Z); + } + } +} diff --git a/src/Mooege/Core/GS/Common/Types/Misc/Circle.cs b/src/Mooege/Core/GS/Common/Types/Misc/Circle.cs new file mode 100644 index 00000000..0dacf284 --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/Misc/Circle.cs @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Windows; +using Mooege.Core.GS.Common.Types.Math; + +// based on: http://www.krissteele.net/blogdetails.aspx?id=251 + +namespace Mooege.Core.GS.Common.Types.Misc +{ + public struct Circle + { + /// + /// Center position of the circle. + /// + public Vector2F Center; + + /// + /// Radius of the circle. + /// + public float Radius; + + /// + /// Constructs a new circle. + /// + public Circle(Vector2F position, float radius) + { + this.Center = position; + this.Radius = radius; + } + + /// + /// Constructs a new circle. + /// + public Circle(float x, float y, float radius) + : this(new Vector2F(x, y), radius) + { } + + /// + /// Determines if a circle intersects a rectangle. + /// + /// True if the circle and rectangle overlap. False otherwise. + public bool Intersects(Rect rectangle) + { + // Find the closest point to the circle within the rectangle + float closestX = Clamp(this.Center.X, (float)rectangle.Left, (float)rectangle.Right); + float closestY = Clamp(this.Center.Y, (float)rectangle.Top, (float)rectangle.Bottom); + + // Calculate the distance between the circle's center and this closest point + float distanceX = this.Center.X - closestX; + float distanceY = this.Center.Y - closestY; + + // If the distance is less than the circle's radius, an intersection occurs + float distanceSquared = (distanceX * distanceX) + (distanceY * distanceY); + return distanceSquared < (this.Radius * this.Radius); + } + + public static float Clamp(float value, float min, float max) + { + value = (value > max) ? max : value; + value = (value < min) ? min : value; + return value; + } + } +} diff --git a/src/Mooege/Core/GS/Common/Types/Misc/RGBAColor.cs b/src/Mooege/Core/GS/Common/Types/Misc/RGBAColor.cs new file mode 100644 index 00000000..ce1f3303 --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/Misc/RGBAColor.cs @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using CrystalMpq; +using Mooege.Net.GS.Message; + +namespace Mooege.Core.GS.Common.Types.Misc +{ + public class RGBAColor + { + public byte Red; + public byte Green; + public byte Blue; + public byte Alpha; + + public RGBAColor() { } + + /// + /// Reads RGBAColor from given MPQFileStream. + /// + /// The MPQFileStream to read from. + public RGBAColor(MpqFileStream stream) + { + var buf = new byte[4]; + stream.Read(buf, 0, 4); + Red = buf[0]; + Green = buf[1]; + Blue = buf[2]; + Alpha = buf[3]; + } + + /// + /// Parses RGBAColor from given GameBitBuffer. + /// + /// The GameBitBuffer to parse from. + public void Parse(GameBitBuffer buffer) + { + Red = (byte)buffer.ReadInt(8); + Green = (byte)buffer.ReadInt(8); + Blue = (byte)buffer.ReadInt(8); + Alpha = (byte)buffer.ReadInt(8); + } + + /// + /// Encodes RGBAColor to given GameBitBuffer. + /// + /// The GameBitBuffer to write. + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(8, Red); + buffer.WriteInt(8, Green); + buffer.WriteInt(8, Blue); + buffer.WriteInt(8, Alpha); + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("RGBAColor:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); + b.AppendLine("Reg: 0x" + Red.ToString("X2")); + b.Append(' ', pad); + b.AppendLine("Green: 0x" + Green.ToString("X2")); + b.Append(' ', pad); + b.AppendLine("Blue: 0x" + Blue.ToString("X2")); + b.Append(' ', pad); + b.AppendLine("Alpha: 0x" + Alpha.ToString("X2")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Core/GS/Common/Types/QuadTrees/QuadNode.cs b/src/Mooege/Core/GS/Common/Types/QuadTrees/QuadNode.cs new file mode 100644 index 00000000..5f4fc59c --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/QuadTrees/QuadNode.cs @@ -0,0 +1,130 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +// based on: http://csharpquadtree.codeplex.com/SourceControl/changeset/view/27798#506270 + +using System.Collections.Concurrent; +using System.Collections.ObjectModel; +using System.Windows; +using Mooege.Core.GS.Objects; + +namespace Mooege.Core.GS.Common.Types.QuadTrees +{ + public class QuadNode + { + /// + /// Parent node. + /// + public QuadNode Parent { get; internal set; } + + /// + /// Childs nodes. + /// + private readonly QuadNode[] _nodes = new QuadNode[4]; + + /// + /// Read only collection of nodes. + /// + public ReadOnlyCollection Nodes; + + /// + /// Child node in given direction. + /// + /// + /// The child node. + public QuadNode this[Direction direction] + { + get + { + switch (direction) + { + case Direction.NorthWest: + return _nodes[0]; + case Direction.NorthEast: + return _nodes[1]; + case Direction.SouthWest: + return _nodes[2]; + case Direction.SouthEast: + return _nodes[3]; + default: + return null; + } + } + set + { + switch (direction) + { + case Direction.NorthWest: + _nodes[0] = value; + break; + case Direction.NorthEast: + _nodes[1] = value; + break; + case Direction.SouthWest: + _nodes[2] = value; + break; + case Direction.SouthEast: + _nodes[3] = value; + break; + } + if (value != null) + value.Parent = this; + } + } + + /// + /// List of contained objects. + /// + public ConcurrentDictionary ContainedObjects = new ConcurrentDictionary(); + + /// + /// The bounds for node. + /// + public Rect Bounds { get; internal set; } + + /// + /// Creates a new QuadNode with given bounds. + /// + /// The bounds for node. + public QuadNode(Rect bounds) + { + Bounds = bounds; + Nodes = new ReadOnlyCollection(_nodes); + } + + /// + /// Creates a new QuadNode with given bounds parameters. + /// + /// The x-coordinate of top-left corner of the region. + /// The y-coordinate of top-left corner of the region + /// The width of the region. + /// The height of the region + public QuadNode(double x, double y, double width, double height) + : this(new Rect(x, y, width, height)) + { } + + /// + /// Returns true if node has child-nodes. + /// + /// + public bool HasChildNodes() + { + return _nodes[0] != null; + } + } +} diff --git a/src/Mooege/Core/GS/Common/Types/QuadTrees/QuadTree.cs b/src/Mooege/Core/GS/Common/Types/QuadTrees/QuadTree.cs new file mode 100644 index 00000000..26cc3bb8 --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/QuadTrees/QuadTree.cs @@ -0,0 +1,535 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +// based on: http://csharpquadtree.codeplex.com/SourceControl/changeset/view/27798#506270 + +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Windows; +using Mooege.Core.GS.Common.Types.Misc; +using Mooege.Core.GS.Objects; + +namespace Mooege.Core.GS.Common.Types.QuadTrees +{ + public class QuadTree + { + /// + /// The smallest size a leaf will split into. + /// + public Size MinimumLeafSize { get; private set; } + + /// + /// Maximum number of objects per left before it's forced to split into sub-quadrans. + /// + public int MaximumObjectsPerLeaf { get; private set; } + + /// + /// The root QuadNode. + /// + public QuadNode RootNode { get; private set; } + + /// + /// Lookup dictionary mapping object's to nodes. + /// + private readonly ConcurrentDictionary _objectToNodeLookup = + new ConcurrentDictionary(); + + /// + /// Creates a new QuadTree. + /// + /// The smallest size a leaf will split into. + /// Maximum number of objects per left before it's forced to split into sub-quadrans. + public QuadTree(Size minimumLeafSize, int maximumObjectsPerLeaf) + { + this.RootNode = null; + this.MinimumLeafSize = minimumLeafSize; + this.MaximumObjectsPerLeaf = maximumObjectsPerLeaf; + } + + /// + /// Inserts a new object. + /// + /// The object to be inserted. + public void Insert(WorldObject @object) + { + if (RootNode == null) // create a new root-node if it does not exist yet. + { + var rootSize = new Size(System.Math.Ceiling(@object.Bounds.Width / MinimumLeafSize.Width), + System.Math.Ceiling(@object.Bounds.Height / MinimumLeafSize.Height)); + + double multiplier = System.Math.Max(rootSize.Width, rootSize.Height); + rootSize = new Size(MinimumLeafSize.Width * multiplier, MinimumLeafSize.Height * multiplier); + var center = new Point(@object.Bounds.X + @object.Bounds.Width / 2, + @object.Bounds.Y + @object.Bounds.Height / 2); + var rootOrigin = new Point(center.X - rootSize.Width / 2, center.Y - rootSize.Height / 2); + + this.RootNode = new QuadNode(new Rect(rootOrigin, rootSize)); + } + + while (!RootNode.Bounds.Contains(@object.Bounds)) + // if root-node's bounds does not contain object, expand the root. + { + this.ExpandRoot(@object.Bounds); + } + + this.InsertNodeObject(RootNode, @object); // insert the object to rootNode. + } + + /// + /// Returns list of objects with type T in given bounds. + /// + /// Type of object to query for. + /// The bounds for query. + /// Returns list of objects. + public List Query(Rect bounds) where T : WorldObject + { + var results = new List(); + if (this.RootNode != null) + this.Query(bounds, RootNode, results); + return results; + } + + public List Query(Circle proximity) where T : WorldObject + { + var results = new List(); + if (this.RootNode != null) + this.Query(proximity, RootNode, results); + return results; + } + + /// + /// Queries given bounds for node for object type T. + /// + /// The objects to look for. + /// The bounds. + /// The node to queryy. + /// The objects found. + private void Query(Rect bounds, QuadNode node, List results) where T : WorldObject + { + if (node == null) return; + if (!bounds.IntersectsWith(node.Bounds)) + return; // if given bounds does not intersect with given node return. + + foreach (var @object in node.ContainedObjects.Values) // loop through objects contained in node. + { + if (!(@object is T)) continue; // if object is not in given type, skip it. + + if (bounds.IntersectsWith(@object.Bounds)) + // if object's bounds intersects our given bounds, add it to results list. + results.Add(@object as T); + } + + foreach (QuadNode childNode in node.Nodes) // query child-nodes too. + { + this.Query(bounds, childNode, results); + } + } + + private void Query(Circle proximity, QuadNode node, List results) where T : WorldObject + { + if (node == null) return; + if (!proximity.Intersects(node.Bounds)) + return; // if given proximity circle does not intersect with given node return. + + foreach (var @object in node.ContainedObjects.Values) // loop through objects contained in node. + { + if (!(@object is T)) continue; // if object is not in given type, skip it. + + if (proximity.Intersects(@object.Bounds)) + // if object's bounds intersects our given proximity circle, add it to results list. + results.Add(@object as T); + } + + foreach (QuadNode childNode in node.Nodes) // query child-nodes too. + { + this.Query(proximity, childNode, results); + } + } + + /// + /// Expands the root node bounds. + /// + /// + private void ExpandRoot(Rect newChildBounds) + { + bool isNorth = RootNode.Bounds.Y < newChildBounds.Y; + bool isWest = RootNode.Bounds.X < newChildBounds.X; + + Direction rootDirection = isNorth // find the direction. + ? (isWest ? Direction.NorthWest : Direction.NorthEast) + : (isWest ? Direction.SouthWest : Direction.SouthEast); + + double newX = (rootDirection == Direction.NorthWest || rootDirection == Direction.SouthWest) + ? RootNode.Bounds.X + : RootNode.Bounds.X - RootNode.Bounds.Width; + double newY = (rootDirection == Direction.NorthWest || rootDirection == Direction.NorthEast) + ? RootNode.Bounds.Y + : RootNode.Bounds.Y - RootNode.Bounds.Height; + + var newRootBounds = new Rect(newX, newY, RootNode.Bounds.Width * 2, RootNode.Bounds.Height * 2); + var newRoot = new QuadNode(newRootBounds); + + this.SetupChildNodes(newRoot); + newRoot[rootDirection] = RootNode; + this.RootNode = newRoot; + } + + /// + /// Inserts object to given node or either one of it's childs. + /// + /// The node. + /// The object to be inserted. + private void InsertNodeObject(QuadNode node, WorldObject @object) + { + if (!node.Bounds.Contains(@object.Bounds)) + throw new Exception( + "QuadTree:InsertNodeObject(): This should not happen, child does not fit within node bounds"); + + // If there's no child-nodes and when new object is insertedi if node's object count will be bigger then MaximumObjectsPerLeaf, force a split. + if (!node.HasChildNodes() && node.ContainedObjects.Count + 1 > this.MaximumObjectsPerLeaf) + { + this.SetupChildNodes(node); + + var childObjects = new List(node.ContainedObjects.Values); // node's child objects. + var childrenToRelocate = new List(); // child object to be relocated. + + foreach (WorldObject childObject in childObjects) + { + foreach (QuadNode childNode in node.Nodes) + { + if (childNode == null) + continue; + + if (childNode.Bounds.Contains(childObject.Bounds)) + { + childrenToRelocate.Add(childObject); + } + } + } + + foreach (WorldObject childObject in childrenToRelocate) // relocate the child objects we marked. + { + this.RemoveObjectFromNode(childObject); + this.InsertNodeObject(node, childObject); + } + } + + // Find a child-node that the object can be inserted. + foreach (QuadNode childNode in node.Nodes) + { + if (childNode == null) + continue; + + if (!childNode.Bounds.Contains(@object.Bounds)) + continue; + + this.InsertNodeObject(childNode, @object); + return; + } + + this.AddObjectToNode(node, @object); // add the object to current node. + } + + /// + /// Clears objects in the node. + /// + /// The node. + private void ClearObjectsFromNode(QuadNode node) + { + var objects = new List(node.ContainedObjects.Values); + + foreach (WorldObject quadObject in objects) + { + RemoveObjectFromNode(quadObject); + } + } + + /// + /// Removes a given object from it's node. + /// + /// The object to remove. + private void RemoveObjectFromNode(WorldObject @object) + { + QuadNode node = _objectToNodeLookup[@object]; + WorldObject removedObject; + node.ContainedObjects.TryRemove(@object.DynamicID, out removedObject); + QuadNode removed; + _objectToNodeLookup.TryRemove(@object, out removed); + @object.PositionChanged -= ObjectPositionChanged; + } + + /// + /// Adds an object to a given node. + /// + /// + /// + private void AddObjectToNode(QuadNode node, WorldObject @object) + { + node.ContainedObjects.TryAdd(@object.DynamicID, @object); + _objectToNodeLookup.TryAdd(@object, node); + @object.PositionChanged += ObjectPositionChanged; + } + + private void ObjectPositionChanged(object sender, EventArgs e) + { + var @object = sender as WorldObject; + if (@object == null) return; + + QuadNode node = this._objectToNodeLookup[@object]; + if (node.Bounds.Contains(@object.Bounds) && !node.HasChildNodes()) return; + + this.RemoveObjectFromNode(@object); + Insert(@object); + if (node.Parent != null) + CheckChildNodes(node.Parent); + } + + /// + /// Creates childs nodes for a given node. + /// + /// The node. + private void SetupChildNodes(QuadNode node) + { + if (this.MinimumLeafSize.Width > node.Bounds.Width / 2 || this.MinimumLeafSize.Height > node.Bounds.Height / 2) + // make sure we obey MinimumLeafSize. + return; + + node[Direction.NorthWest] = new QuadNode(node.Bounds.X, node.Bounds.Y, node.Bounds.Width / 2, node.Bounds.Height / 2); + node[Direction.NorthEast] = new QuadNode(node.Bounds.X + node.Bounds.Width / 2, node.Bounds.Y, node.Bounds.Width / 2, node.Bounds.Height / 2); + node[Direction.SouthWest] = new QuadNode(node.Bounds.X, node.Bounds.Y + node.Bounds.Height / 2, node.Bounds.Width / 2, node.Bounds.Height / 2); + node[Direction.SouthEast] = new QuadNode(node.Bounds.X + node.Bounds.Width / 2, node.Bounds.Y + node.Bounds.Height / 2, node.Bounds.Width / 2, node.Bounds.Height / 2); + } + + /// + /// Removes object from it's node. + /// + /// The object to remove. + public void Remove(WorldObject @object) + { + if (!_objectToNodeLookup.ContainsKey(@object)) + throw new KeyNotFoundException("QuadTree:Remove() - Object not found in dictionary for removal."); + + QuadNode containingNode = _objectToNodeLookup[@object]; // get the object. + RemoveObjectFromNode(@object); // remove it. + + if (containingNode.Parent != null) + CheckChildNodes(containingNode.Parent); // check all child nodes of parent. + + } + + /// + /// Checks child nodes of the node. + /// + /// The parent node. + private void CheckChildNodes(QuadNode node) + { + if (GetTotalObjectCount(node) > MaximumObjectsPerLeaf) return; + + // Move child objects into this node, and delete sub nodes + List subChildObjects = GetChildObjects(node); + + foreach (WorldObject childObject in subChildObjects) + { + if (node.ContainedObjects.Values.Contains(childObject)) continue; + + RemoveObjectFromNode(childObject); + AddObjectToNode(node, childObject); + } + + if (node[Direction.NorthWest] != null) + { + node[Direction.NorthWest].Parent = null; + node[Direction.NorthWest] = null; + } + + if (node[Direction.NorthEast] != null) + { + node[Direction.NorthEast].Parent = null; + node[Direction.NorthEast] = null; + } + + if (node[Direction.SouthWest] != null) + { + node[Direction.SouthWest].Parent = null; + node[Direction.SouthWest] = null; + } + + if (node[Direction.SouthEast] != null) + { + node[Direction.SouthEast].Parent = null; + node[Direction.SouthEast] = null; + } + + if (node.Parent != null) + CheckChildNodes(node.Parent); + else + { + // Its the root node, see if we're down to one quadrant, with none in local storage - if so, ditch the other three. + int numQuadrantsWithObjects = 0; + QuadNode nodeWithObjects = null; + + foreach (QuadNode childNode in node.Nodes) + { + if (childNode == null || GetTotalObjectCount(childNode) <= 0) continue; + + numQuadrantsWithObjects++; + nodeWithObjects = childNode; + if (numQuadrantsWithObjects > 1) break; + } + + if (numQuadrantsWithObjects == 1) + // if we have only one quadrand with objects, make it the new rootNode. + { + foreach (QuadNode childNode in node.Nodes) + { + if (childNode != nodeWithObjects) + childNode.Parent = null; + } + + this.RootNode = nodeWithObjects; + } + } + } + + /// + /// Returns objects for given node, including the one in it's child-node.s + /// + /// The node. + /// The contained object list. + private List GetChildObjects(QuadNode node) + { + var results = new List(); + results.AddRange(node.ContainedObjects.Values); + + foreach (QuadNode childNode in node.Nodes) + { + if (childNode != null) + results.AddRange(GetChildObjects(childNode)); + } + return results; + } + + /// + /// Returns total object count. + /// + /// The count of objects. + public int GetTotalObjectCount() + { + if (RootNode == null) + return 0; + + int count = GetTotalObjectCount(RootNode); + return count; + } + + /// + /// Returns contained object count for given node - including it's child-nodes. + /// + /// The node. + /// The count of objects. + private int GetTotalObjectCount(QuadNode node) + { + int count = node.ContainedObjects.Count; + foreach (QuadNode childNode in node.Nodes) + { + if (childNode != null) + { + count += GetTotalObjectCount(childNode); + } + } + return count; + } + + /// + /// Returns total node count. + /// + /// The count of nodes. + public int GetQuadNodeCount() + { + if (RootNode == null) + return 0; + + int count = GetQuadNodeCount(RootNode, 1); + return count; + } + + /// + /// Returns node count for given node including it's childs. + /// + /// The node + /// Starting value for count. + /// The counf on nodes. + private int GetQuadNodeCount(QuadNode node, int count) + { + if (node == null) return count; + + foreach (QuadNode childNode in node.Nodes) + { + if (childNode != null) + count++; + } + return count; + } + + /// + /// Returns list of all nodes. + /// + /// List of all nodes. + public List GetAllNodes() + { + var results = new List(); + + if (RootNode != null) + { + results.Add(RootNode); + GetChildNodes(RootNode, results); + } + + return results; + } + + /// + /// Adds all child-nodes to given results collection. + /// + /// The node. + /// The list to add. + private void GetChildNodes(QuadNode node, ICollection results) + { + foreach (QuadNode childNode in node.Nodes) + { + if (childNode == null) + continue; + + results.Add(childNode); + GetChildNodes(childNode, results); + } + } + } + + /// + /// Node directions. + /// + public enum Direction : int + { + NorthWest = 0, + NorthEast = 1, + SouthWest = 2, + SouthEast = 3 + } +} diff --git a/src/Mooege/Core/GS/Common/Types/SNO/SNOGroup.cs b/src/Mooege/Core/GS/Common/Types/SNO/SNOGroup.cs new file mode 100644 index 00000000..969d1f4e --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/SNO/SNOGroup.cs @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace Mooege.Core.GS.Common.Types.SNO +{ + public enum SNOGroup : int + { + Code = -2, + None = -1, + Actor = 1, + Adventure = 2, + AiBehavior = 3, + AiState = 4, + AmbientSound = 5, + Anim = 6, + Anim2D = 7, + AnimSet = 8, + Appearance = 9, + Hero = 10, + Cloth = 11, + Conversation = 12, + ConversationList = 13, + EffectGroup = 14, + Encounter = 15, + Explosion = 17, + FlagSet = 18, + Font = 19, + GameBalance = 20, + Globals = 21, + LevelArea = 22, + Light = 23, + MarkerSet = 24, + Monster = 25, + Observer = 26, + Particle = 27, + Physics = 28, + Power = 29, + Quest = 31, + Rope = 32, + Scene = 33, + SceneGroup = 34, + Script = 35, + ShaderMap = 36, + Shaders = 37, + Shakes = 38, + SkillKit = 39, + Sound = 40, + SoundBank = 41, + StringList = 42, + Surface = 43, + Textures = 44, + Trail = 45, + UI = 46, + Weather = 47, + Worlds = 48, + Recipe = 49, + Condition = 51, + TreasureClass = 52, + Account = 53, + Conductor = 54, + TimedEvent = 55, + Act = 56, + Material = 57, + QuestRange = 58, + Lore = 59, + Reverb = 60, + PhysMesh = 61, + Music = 62, + Tutorial = 63, + BossEncounter = 64, + ControlScheme = 65, + } +} diff --git a/src/Mooege/Core/GS/Common/Types/SNO/SNOHandle.cs b/src/Mooege/Core/GS/Common/Types/SNO/SNOHandle.cs new file mode 100644 index 00000000..9f8fe2f0 --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/SNO/SNOHandle.cs @@ -0,0 +1,195 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using CrystalMpq; +using Gibbed.IO; +using Mooege.Common.MPQ; +using Mooege.Net.GS.Message; +using System; +using Mooege.Common.Storage; + +namespace Mooege.Core.GS.Common.Types.SNO +{ + public class InvalidSnoException : Exception { public InvalidSnoException(string message) : base(message) { } } + + public class SNOHandle + { + private const int NO_ID = -1; + + /// + /// Gets the group of the referenced object or null if the handle was + /// initialized without group and the id is not found in mpq storage + /// + public SNOGroup? Group + { + get + { + if (!_isInitialized) Initialize(); + return _group.Value; + } + } + + /// + /// The id of the referenced object + /// + [PersistentProperty("Id")] + public int Id { get; private set; } + + /// + /// The target object this handle refers to. + /// + public FileFormat Target + { + get + { + if (!_isInitialized) Initialize(); + return _target; + } + } + + /// + /// Gets whether the handle is valid + /// + public bool IsValid + { + get + { + if (!_isInitialized) Initialize(); + return _isValid; + } + } + + /// + /// Get the name of the asset containing the target object + /// + public string Name + { + get + { + if (!_isInitialized) Initialize(); + return _name; + } + } + + private string _name = ""; + private FileFormat _target = null; + private SNOGroup? _group = null; + private bool _isValid = false; + private bool _isInitialized = false; + + + public SNOHandle() { } + + public SNOHandle(SNOGroup group, int id) + { + _group = group; + Id = id; + } + + public SNOHandle(int snoId) + { + Id = snoId; + if (snoId == NO_ID) + _group = SNOGroup.None; + } + + + /// + /// Lazy initialization of handle fields. They are initialized on the first access. + /// because the mpq storage may not have finished loading and thus, the referenced sno may not be found + /// + private void Initialize() + { + // Look up the group if it is not set. Maybe one big + // asset dictionary would be more convenient here + _isInitialized = true; + if (!_group.HasValue) + { + foreach (var pair in MPQStorage.Data.Assets) + if (pair.Value.ContainsKey(Id)) + { + _group = pair.Key; + break; + } + } + + if (_group.HasValue) + if (MPQStorage.Data != null && MPQStorage.Data.Assets.ContainsKey(_group.Value)) + if (MPQStorage.Data.Assets[_group.Value].ContainsKey(Id)) + { + _isValid = true; + _target = MPQStorage.Data.Assets[_group.Value][Id].Data; + _name = MPQStorage.Data.Assets[_group.Value][Id].Name; + } + } + + + /// + /// Reads SNOName from given MPQFileStream. + /// + /// The MPQFileStream to read from. + public SNOHandle(MpqFileStream stream) + { + _group = (SNOGroup)stream.ReadValueS32(); + Id = stream.ReadValueS32(); + } + + /// + /// Parses SNOName from given GameBitBuffer. + /// + /// The GameBitBuffer to parse from. + public void Parse(GameBitBuffer buffer) + { + _group = (SNOGroup)buffer.ReadInt(32); + Id = buffer.ReadInt(32); + } + + /// + /// Encodes SNOName to given GameBitBuffer. + /// + /// The GameBitBuffer to write. + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, (int)Group); + buffer.WriteInt(32, Id); + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("SNOHandle:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); + b.AppendLine("Group: 0x" + ((int)Group).ToString("X8")); + b.Append(' ', pad); + b.AppendLine("Id: 0x" + Id.ToString("X8")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + public override string ToString() + { + if (IsValid) + return string.Format("[{0}] {1} - {2}", this.Group, this.Id, this.Name); + else + return string.Format("[{0}] {1} - Invalid handle", _group, this.Id); + } + } +} diff --git a/src/Mooege/Core/GS/Common/Types/Scene/SceneCachedValues.cs b/src/Mooege/Core/GS/Common/Types/Scene/SceneCachedValues.cs new file mode 100644 index 00000000..6794b109 --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/Scene/SceneCachedValues.cs @@ -0,0 +1,137 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using CrystalMpq; +using Gibbed.IO; +using Mooege.Core.GS.Common.Types.Collision; +using Mooege.Net.GS.Message; +using Mooege.Common.Storage; + +namespace Mooege.Core.GS.Common.Types.Scene +{ + public class SceneCachedValues + { + [PersistentProperty("Unknown1")] + public int Unknown1 { get; set; } + [PersistentProperty("Unknown2")] + public int Unknown2 { get; set; } + [PersistentProperty("Unknown3")] + public int Unknown3 { get; set; } + [PersistentProperty("AABB1")] + public AABB AABB1 { get; set; } + [PersistentProperty("AABB2")] + public AABB AABB2 { get; set; } + [PersistentProperty("Unknown4", 4)] + public int[] Unknown4 { get; set; } // MaxLength = 4 + [PersistentProperty("Unknown5")] + public int Unknown5 { get; set; } + + public SceneCachedValues() { } + + /// + /// Reads SceneCachedValues from given MPQFileStream. + /// + /// The MPQFileStream to read from. + public SceneCachedValues(MpqFileStream stream) + { + Unknown1 = stream.ReadValueS32(); + Unknown2 = stream.ReadValueS32(); + Unknown3 = stream.ReadValueS32(); + AABB1 = new AABB(stream); + AABB2 = new AABB(stream); + Unknown4 = new int[4]; + for (int i = 0; i < Unknown4.Length; i++) + { + Unknown4[i] = stream.ReadValueS32(); + } + Unknown5 = stream.ReadValueS32(); + } + + /// + /// Parses SceneCachedValues from given GameBitBuffer. + /// + /// The GameBitBuffer to parse from. + public void Parse(GameBitBuffer buffer) + { + Unknown1 = buffer.ReadInt(32); + Unknown2 = buffer.ReadInt(32); + Unknown3 = buffer.ReadInt(32); + AABB1 = new AABB(); + AABB1.Parse(buffer); + AABB2 = new AABB(); + AABB2.Parse(buffer); + Unknown4 = new int[4]; + for (int i = 0; i < Unknown4.Length; i++) Unknown4[i] = buffer.ReadInt(32); + Unknown5 = buffer.ReadInt(32); + } + + /// + /// Encodes SceneCachedValues to given GameBitBuffer. + /// + /// The GameBitBuffer to write. + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Unknown1); + buffer.WriteInt(32, Unknown2); + buffer.WriteInt(32, Unknown3); + AABB1.Encode(buffer); + AABB2.Encode(buffer); + for (int i = 0; i < Unknown4.Length; i++) buffer.WriteInt(32, Unknown4[i]); + buffer.WriteInt(32, Unknown5); + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("SceneCachedValues:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); + b.AppendLine("Unknown1: 0x" + Unknown1.ToString("X8") + " (" + Unknown1 + ")"); + b.Append(' ', pad); + b.AppendLine("Unknown2: 0x" + Unknown2.ToString("X8") + " (" + Unknown2 + ")"); + b.Append(' ', pad); + b.AppendLine("Unknown3: 0x" + Unknown3.ToString("X8") + " (" + Unknown3 + ")"); + AABB1.AsText(b, pad); + AABB2.AsText(b, pad); + b.Append(' ', pad); + b.AppendLine("Unknown4:"); + b.Append(' ', pad); + b.AppendLine("{"); + for (int i = 0; i < Unknown4.Length; ) + { + b.Append(' ', pad + 1); + for (int j = 0; j < 8 && i < Unknown4.Length; j++, i++) + { + b.Append("0x" + Unknown4[i].ToString("X8") + ", "); + } + b.AppendLine(); + } + b.Append(' ', pad); + b.AppendLine("}"); + b.AppendLine(); + b.Append(' ', pad); + b.AppendLine("Unknown5: 0x" + Unknown5.ToString("X8") + " (" + Unknown5 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Core/GS/Common/Types/Scene/SceneSpecification.cs b/src/Mooege/Core/GS/Common/Types/Scene/SceneSpecification.cs new file mode 100644 index 00000000..36f24217 --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/Scene/SceneSpecification.cs @@ -0,0 +1,229 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using CrystalMpq; +using Gibbed.IO; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Net.GS.Message; +using Mooege.Common.Storage; + +namespace Mooege.Core.GS.Common.Types.Scene +{ + public class SceneSpecification + { + [PersistentProperty("CellZ")] + public int CellZ { get; set; } // Position.Z rounded down + [PersistentProperty("Cell")] + public Vector2D Cell { get; set; } + [PersistentProperty("SNOLevelAreas", 4)] + public int[] SNOLevelAreas { get; set; } // Area names - MaxLength = 4 + [PersistentProperty("SNOPrevWorld")] + public int SNOPrevWorld { get; set; } + [PersistentProperty("Unknown1")] + public int Unknown1 { get; set; } + [PersistentProperty("SNOPrevLevelArea")] + public int SNOPrevLevelArea { get; set; } + [PersistentProperty("SNONextWorld")] + public int SNONextWorld { get; set; } + [PersistentProperty("Unknown2")] + public int Unknown2 { get; set; } + [PersistentProperty("SNONextLevelArea")] + public int SNONextLevelArea { get; set; } + [PersistentProperty("SNOMusic")] + public int SNOMusic { get; set; } + [PersistentProperty("SNOCombatMusic")] + public int SNOCombatMusic { get; set; } + [PersistentProperty("SNOAmbient")] + public int SNOAmbient { get; set; } + [PersistentProperty("SNOReverb")] + public int SNOReverb { get; set; } + [PersistentProperty("SNOWeather")] + public int SNOWeather { get; set; } + [PersistentProperty("SNOPresetWorld")] + public int SNOPresetWorld { get; set; } + [PersistentProperty("Unknown3")] + public int Unknown3 { get; set; } + [PersistentProperty("Unknown4")] + public int Unknown4 { get; set; } + [PersistentProperty("Unknown5")] + public int Unknown5 { get; set; } + [PersistentProperty("ClusterID")] + public int ClusterID { get; set; } + [PersistentProperty("SceneCachedValues")] + public SceneCachedValues SceneCachedValues { get; set; } + + public SceneSpecification() { } + + /// + /// Reads SceneSpecification from given MPQFileStream. + /// + /// The MPQFileStream to read from. + public SceneSpecification(MpqFileStream stream) + { + CellZ = stream.ReadValueS32(); + Cell = new Vector2D(stream); + SNOLevelAreas = new int[4]; + + for (int i = 0; i < SNOLevelAreas.Length; i++) + { + SNOLevelAreas[i] = stream.ReadValueS32(); + } + + SNOPrevWorld = stream.ReadValueS32(); + Unknown1 = stream.ReadValueS32(); + SNOPrevLevelArea = stream.ReadValueS32(); + SNONextWorld = stream.ReadValueS32(); + Unknown2 = stream.ReadValueS32(); + SNONextLevelArea = stream.ReadValueS32(); + SNOMusic = stream.ReadValueS32(); + SNOCombatMusic = stream.ReadValueS32(); + SNOAmbient = stream.ReadValueS32(); + SNOReverb = stream.ReadValueS32(); + SNOWeather = stream.ReadValueS32(); + SNOPresetWorld = stream.ReadValueS32(); + Unknown3 = stream.ReadValueS32(); + Unknown4 = stream.ReadValueS32(); + Unknown5 = stream.ReadValueS32(); + stream.Position += (9 * 4); + ClusterID = stream.ReadValueS32(); + SceneCachedValues = new SceneCachedValues(stream); + } + + /// + /// Parses SceneSpecification from given GameBitBuffer. + /// + /// The GameBitBuffer to parse from. + public void Parse(GameBitBuffer buffer) + { + CellZ = buffer.ReadInt(32); + Cell = new Vector2D(); + Cell.Parse(buffer); + SNOLevelAreas = new int /* sno */[4]; + for (int i = 0; i < SNOLevelAreas.Length; i++) SNOLevelAreas[i] = buffer.ReadInt(32); + SNOPrevWorld = buffer.ReadInt(32); + Unknown1 = buffer.ReadInt(32); + SNOPrevLevelArea = buffer.ReadInt(32); + SNONextWorld = buffer.ReadInt(32); + Unknown2 = buffer.ReadInt(32); + SNONextLevelArea = buffer.ReadInt(32); + SNOMusic = buffer.ReadInt(32); + SNOCombatMusic = buffer.ReadInt(32); + SNOAmbient = buffer.ReadInt(32); + SNOReverb = buffer.ReadInt(32); + SNOWeather = buffer.ReadInt(32); + SNOPresetWorld = buffer.ReadInt(32); + Unknown3 = buffer.ReadInt(32); + Unknown4 = buffer.ReadInt(32); + Unknown5 = buffer.ReadInt(32); + ClusterID = buffer.ReadInt(32); + SceneCachedValues = new SceneCachedValues(); + SceneCachedValues.Parse(buffer); + } + + /// + /// Encodes SceneSpecification to given GameBitBuffer. + /// + /// The GameBitBuffer to write. + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, CellZ); + Cell.Encode(buffer); + for (int i = 0; i < SNOLevelAreas.Length; i++) buffer.WriteInt(32, SNOLevelAreas[i]); + buffer.WriteInt(32, SNOPrevWorld); + buffer.WriteInt(32, Unknown1); + buffer.WriteInt(32, SNOPrevLevelArea); + buffer.WriteInt(32, SNONextWorld); + buffer.WriteInt(32, Unknown2); + buffer.WriteInt(32, SNONextLevelArea); + buffer.WriteInt(32, SNOMusic); + buffer.WriteInt(32, SNOCombatMusic); + buffer.WriteInt(32, SNOAmbient); + buffer.WriteInt(32, SNOReverb); + buffer.WriteInt(32, SNOWeather); + buffer.WriteInt(32, SNOPresetWorld); + buffer.WriteInt(32, Unknown3); + buffer.WriteInt(32, Unknown4); + buffer.WriteInt(32, Unknown5); + buffer.WriteInt(32, ClusterID); + SceneCachedValues.Encode(buffer); + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("SceneSpecification:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); + b.AppendLine("CellZ: 0x" + CellZ.ToString("X8") + " (" + CellZ + ")"); + Cell.AsText(b, pad); + b.Append(' ', pad); + b.AppendLine("arSnoLevelAreas:"); + b.Append(' ', pad); + b.AppendLine("{"); + for (int i = 0; i < SNOLevelAreas.Length; ) + { + b.Append(' ', pad + 1); + for (int j = 0; j < 8 && i < SNOLevelAreas.Length; j++, i++) + { + b.Append("0x" + SNOLevelAreas[i].ToString("X8") + ", "); + } + b.AppendLine(); + } + b.Append(' ', pad); + b.AppendLine("}"); + b.AppendLine(); + b.Append(' ', pad); + b.AppendLine("snoPrevWorld: 0x" + SNOPrevWorld.ToString("X8")); + b.Append(' ', pad); + b.AppendLine("Unknown1: 0x" + Unknown1.ToString("X8") + " (" + Unknown1 + ")"); + b.Append(' ', pad); + b.AppendLine("snoPrevLevelArea: 0x" + SNOPrevLevelArea.ToString("X8")); + b.Append(' ', pad); + b.AppendLine("snoNextWorld: 0x" + SNONextWorld.ToString("X8")); + b.Append(' ', pad); + b.AppendLine("Unknown2: 0x" + Unknown2.ToString("X8") + " (" + Unknown2 + ")"); + b.Append(' ', pad); + b.AppendLine("snoNextLevelArea: 0x" + SNONextLevelArea.ToString("X8")); + b.Append(' ', pad); + b.AppendLine("snoMusic: 0x" + SNOMusic.ToString("X8")); + b.Append(' ', pad); + b.AppendLine("snoCombatMusic: 0x" + SNOCombatMusic.ToString("X8")); + b.Append(' ', pad); + b.AppendLine("snoAmbient: 0x" + SNOAmbient.ToString("X8")); + b.Append(' ', pad); + b.AppendLine("snoReverb: 0x" + SNOReverb.ToString("X8")); + b.Append(' ', pad); + b.AppendLine("snoWeather: 0x" + SNOWeather.ToString("X8")); + b.Append(' ', pad); + b.AppendLine("snoPresetWorld: 0x" + SNOPresetWorld.ToString("X8")); + b.Append(' ', pad); + b.AppendLine("Unknown3: 0x" + Unknown3.ToString("X8") + " (" + Unknown3 + ")"); + b.Append(' ', pad); + b.AppendLine("Unknown4: 0x" + Unknown4.ToString("X8") + " (" + Unknown4 + ")"); + b.Append(' ', pad); + b.AppendLine("Unknown5: 0x" + Unknown5.ToString("X8") + " (" + Unknown5 + ")"); + b.Append(' ', pad); + b.AppendLine("ClusterId: 0x" + ClusterID.ToString("X8") + " (" + ClusterID + ")"); + SceneCachedValues.AsText(b, pad); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} diff --git a/src/Mooege/Core/GS/Common/Types/TagMap/ActorKeys.cs b/src/Mooege/Core/GS/Common/Types/TagMap/ActorKeys.cs new file mode 100644 index 00000000..063ccf65 --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/TagMap/ActorKeys.cs @@ -0,0 +1,182 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using System.Reflection; + +namespace Mooege.Core.GS.Common.Types.TagMap +{ + class ActorKeys + { + # region compile a dictionary to access keys from ids. If you need a readable name for a TagID, look up its key and get its name + private static Dictionary tags = new Dictionary(); + + public static TagKey GetKey(int index) + { + return tags.ContainsKey(index) ? tags[index] : null; + } + + static ActorKeys() + { + foreach (FieldInfo field in typeof(ActorKeys).GetFields()) + { + TagKey key = field.GetValue(null) as TagKey; + key.Name = field.Name; + tags.Add(key.ID, key); + } + } + #endregion + + public static TagKeyFloat Scale = new TagKeyFloat(65543); + public static TagKeyInt TeamID = new TagKeyInt(65556); // TODO this is not team id + public static TagKeySNO FlippyParticle = new TagKeySNO(65655); + public static TagKeySNO Flippy = new TagKeySNO(65688); + + public static TagKeySNO Script = new TagKeySNO(65907); + + public static TagKeySNO SoundFootstepGrass = new TagKeySNO(66048); + public static TagKeySNO SoundFootstepDirt1 = new TagKeySNO(66049); + public static TagKeySNO SoundFootstepStone1 = new TagKeySNO(66050); + public static TagKeySNO SoundFootstepMetal1 = new TagKeySNO(66051); + public static TagKeySNO SoundFootstepWater1 = new TagKeySNO(66052); + public static TagKeySNO SoundFootstepStone2 = new TagKeySNO(66053); + public static TagKeySNO SoundFootstepDirt2 = new TagKeySNO(66054); + public static TagKeySNO SoundFootstepWater2 = new TagKeySNO(66055); + public static TagKeySNO SoundFootstepMetal2 = new TagKeySNO(66056); + public static TagKeySNO SoundFootstepStone3 = new TagKeySNO(66057); + public static TagKeySNO SoundFootstepWater3 = new TagKeySNO(66058); + public static TagKeySNO SoundFootstepWood = new TagKeySNO(66059); + public static TagKeySNO SoundFootstepDirt3 = new TagKeySNO(66060); + public static TagKeySNO SoundFootstepBone = new TagKeySNO(66061); + public static TagKeySNO SoundFootstepSnow = new TagKeySNO(66062); + public static TagKeySNO SoundFootstepWater4 = new TagKeySNO(66063); + + public static TagKeySNO SoundFootstepCarpet = new TagKeySNO(69644); + + + public static TagKeySNO Projectile = new TagKeySNO(66138); + + + + public static TagKeyGizmoGroup GizmoGroup = new TagKeyGizmoGroup(66305); + public static TagKeyInt DeathAnimationTag = new TagKeyInt(66308); // this is probably not the correct name since it is used only on ravens, that have a 'monster' attached to it. it may be something more general + + public static TagKeySNO LootTreasureClass = new TagKeySNO(66384); + public static TagKeySNO ActivationPower = new TagKeySNO(66400); + public static TagKeySNO WarpProxy = new TagKeySNO(66472); + + + public static TagKeySNO Lore = new TagKeySNO(67331); + + public static TagKeySNO MinimapMarker = new TagKeySNO(458752); + + public static TagKeySNO FireEffectGroup = new TagKeySNO(74064); + public static TagKeySNO ColdEffectGroup = new TagKeySNO(74065); + public static TagKeySNO LightningEffectGroup = new TagKeySNO(74066); + public static TagKeySNO PoisonEffectGroup = new TagKeySNO(74067); + public static TagKeySNO ArcaneEffectGroup = new TagKeySNO(74068); + + public static TagKeySNO LifeStealEffectGroup = new TagKeySNO(74070); + public static TagKeySNO ManaStealEffectGroup = new TagKeySNO(74071); + public static TagKeySNO MagicFindEffectGroup = new TagKeySNO(74072); + public static TagKeySNO GoldFindEffectGroup = new TagKeySNO(74073); + public static TagKeySNO AttackEffectGroup = new TagKeySNO(74074); + public static TagKeySNO CastEffectGroup = new TagKeySNO(74075); + public static TagKeySNO HolyEffectGroup = new TagKeySNO(74076); + public static TagKeySNO Spell1EffectGroup = new TagKeySNO(74077); + public static TagKeySNO Spell2EffectGroup = new TagKeySNO(74078); + + public static TagKeySNO SoundImpactSword = new TagKeySNO(90112); + public static TagKeySNO SoundImpactBlow = new TagKeySNO(90113); + public static TagKeySNO SoundImpactHtH = new TagKeySNO(90114); + public static TagKeySNO SoundImpactArrow = new TagKeySNO(90115); + + + } + + public class TagKeyGizmoGroup : TagKey { public TagKeyGizmoGroup(int id) : base(id) { } public GizmoGroup GetValue(TagMapEntry entry) { return (GizmoGroup)entry.Int; } } + + public enum GizmoGroup + { + Passive = -1, + Door = 0, + LootContainer = 1, + Portal = 2, // whichdoctor_fetisharmy also has this set despite beeing client effects + Waypoint = 4, + CheckPoint = 7, + Sign = 8, + Healthwell = 9, + Shrine = 10, // and actor\MinimapIconStairs_Switch.acr + TownPortal = 11, + HearthPortal = 12, + Headstone = 18, + ServerProp = 19, // mostly set for server props and for actors that have a controling function (conductorproxymaster, markerlocation, nospawn20feet, etc) + StartLocations = 20, // and exit locations + CathedralIdol = 22, // only one actor with that name + DestructibleLootContainer = 23, + PlayerSharedStash = 25, + Spawner = 28, + Trigger = 44, + Destructible = 48, + Barricade = 56, + WeirdGroup57 = 57, // Actor\TEMP_SkeletonPortal_Center.acr, Gizmo Actor\SkeletonKingGizmo.acr, Gizmo, Actor\TEMP_GoatPortal_Center.acr, Gizmo, Actor\Temp_Story_Trigger_Enabled.acr, Gizmo, Actor\trOut_fields_Cart_Fixable.acr, Gizmo, Actor\Temp_FesteringWoodsAmbush_Switch.acr, Gizmo, Actor\trOut_Wilderness_Skeleton_Chair_Switch.acr, + ProximityTriggered = 60, // raven pecking, wall collapse... triggered when player approaches + ActChangeTempObject = 62, // only one actor with that name + Banner = 64, + Readable = 65, + BossPortal = 66, + QuestLoot = 67, // only Actor\PlacedGold.acr, Gizmo and Actor\Scoundrel_LoreLoot.acr, Gizmo + Savepoint = 68, + DungeonStonePortal = 70, // only one actor with that name + //NephalemAltar = 71 + } + class DRLGCommandKeys + { + public static class Group + { + // [0]: {851986 = -1} + // [1]: {1015841 = 1} + // [2]: {851987 = -1} + // [3]: {851993 = -1} + // [4]: {1015822 = 0} + // [5]: {851983 = 19780} //19780 LevelArea A1_trDun_Level01 + public static TagKeySNO Level = new TagKeySNO(851983); + } + + public static class AddExit + { + //[0]: {852000 = -1} Type SNO (2) + //[1]: {851984 = 60713} Type SNO (2) [20:16] (snobot) [1] 60713 Worlds trDun_Cain_Intro, + //[2]: {1020032 = 1} (0) + //[3]: {852050 = 0} //Starting location? ID (7) + //[4]: {1015841 = 1} (0) + //[5]: {852051 = 172} //Starting location? ID (7) + //[6]: {1015814 = 0} (0) + //[7]: {854612 = -1} Type SNO (2) + //[8]: {1015813 = 300} (0) tiletype (exit) + //[9]: {1020416 = 1} (0) + //[10]: {854613 = -1} (2) + //[11]: {1015821 = -1} (0) + public static TagKeySNO ExitWorld = new TagKeySNO(851984); + public static TagKeySNO CoordinateX = new TagKeySNO(852050); //?? + public static TagKeySNO CoordinateY = new TagKeySNO(852051); //?? + public static TagKeySNO TileType = new TagKeySNO(1015813); + + } + } +} diff --git a/src/Mooege/Core/GS/Common/Types/TagMap/AnimationSetKeys.cs b/src/Mooege/Core/GS/Common/Types/TagMap/AnimationSetKeys.cs new file mode 100644 index 00000000..3875468b --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/TagMap/AnimationSetKeys.cs @@ -0,0 +1,132 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using System.Reflection; + +namespace Mooege.Core.GS.Common.Types.TagMap +{ + public class AnimationSetKeys + { + # region compile a dictionary to access keys from ids. If you need a readable name for a TagID, look up its key and get its name + private static Dictionary tags = new Dictionary(); + + public static TagKey GetKey(int index) + { + return tags.ContainsKey(index) ? tags[index] : null; + } + + static AnimationSetKeys() + { + foreach (FieldInfo field in typeof(AnimationSetKeys).GetFields()) + { + TagKey key = field.GetValue(null) as TagKey; + key.Name = field.Name; + tags.Add(key.ID, key); + } + } + #endregion + + + public static TagKeyInt GenericCast = new TagKeyInt(262144); + public static TagKeyInt IdleDefault = new TagKeyInt(69632); + public static TagKeyInt Idle = new TagKeyInt(69968); + + public static TagKeyInt Flee = new TagKeyInt(70768); + public static TagKeyInt Spawn = new TagKeyInt(70097); + public static TagKeyInt KnockBackLand = new TagKeyInt(71176); + public static TagKeyInt KnockBackMegaOuttro = new TagKeyInt(71218); + public static TagKeyInt KnockBack = new TagKeyInt(71168); + public static TagKeyInt KnockBackMegaIntro = new TagKeyInt(71216); + public static TagKeyInt Ambush = new TagKeyInt(70144); + public static TagKeyInt RangedAttack = new TagKeyInt(69840); + public static TagKeyInt DeathDefault = new TagKeyInt(69648); + public static TagKeyInt GetHit = new TagKeyInt(69664); + public static TagKeyInt Dead1 = new TagKeyInt(79168); + public static TagKeyInt Dead2 = new TagKeyInt(79152); + public static TagKeyInt Dead3 = new TagKeyInt(77920); + public static TagKeyInt Dead4 = new TagKeyInt(77888); + public static TagKeyInt Dead5 = new TagKeyInt(77904); + public static TagKeyInt Dead6 = new TagKeyInt(77872); + public static TagKeyInt Dead7 = new TagKeyInt(77856); + public static TagKeyInt Dead8 = new TagKeyInt(77840); + public static TagKeyInt SpecialDead = new TagKeyInt(71440); + public static TagKeyInt Run = new TagKeyInt(69728); + public static TagKeyInt TownRun = new TagKeyInt(69736); + public static TagKeyInt Walk = new TagKeyInt(69744); + public static TagKeyInt Attack = new TagKeyInt(69776); + public static TagKeyInt Attack2 = new TagKeyInt(69792); + public static TagKeyInt SpecialAttack = new TagKeyInt(69904); + + public static TagKeyInt GizmoState1 = new TagKeyInt(70160); + public static TagKeyInt UndeadEating = new TagKeyInt(270336); + + public static TagKeyInt DeathLightning = new TagKeyInt(73760); + public static TagKeyInt DeathPoison = new TagKeyInt(73792); + public static TagKeyInt DeathDisintegration = new TagKeyInt(73808); + public static TagKeyInt DeathDecap = new TagKeyInt(73840); + public static TagKeyInt DeathAcid = new TagKeyInt(73984); + public static TagKeyInt DeathArcane = new TagKeyInt(73776); + public static TagKeyInt DeathFire = new TagKeyInt(73744); + public static TagKeyInt DeathPlague = new TagKeyInt(73856); + public static TagKeyInt DeathDismember = new TagKeyInt(73872); + public static TagKeyInt DeadDefault = new TagKeyInt(69712); + public static TagKeyInt DeathPulverise = new TagKeyInt(73824); + public static TagKeyInt DeathCold = new TagKeyInt(74016); + public static TagKeyInt DeathLava = new TagKeyInt(74032); + public static TagKeyInt DeathHoly = new TagKeyInt(74048); + public static TagKeyInt DeathSpirit = new TagKeyInt(74064); + public static TagKeyInt DeathFlyingOrDefault = new TagKeyInt(71424); + public static TagKeyInt Spawn2 = new TagKeyInt(291072); + public static TagKeyInt Despawn = new TagKeyInt(410369); + public static TagKeyInt Stunned = new TagKeyInt(69680); + + public static TagKeyInt EmoteCheer = new TagKeyInt(410112); + public static TagKeyInt EmoteShrugQuestion = new TagKeyInt(410113); + public static TagKeyInt EmoteCower = new TagKeyInt(410114); + public static TagKeyInt EmoteExclamationShout = new TagKeyInt(410115); + public static TagKeyInt EmoteLaugh = new TagKeyInt(410116); + public static TagKeyInt EmotePoint = new TagKeyInt(410117); + public static TagKeyInt EmoteSad = new TagKeyInt(410118); + public static TagKeyInt EmoteTalk = new TagKeyInt(410119); + public static TagKeyInt EmoteIdle = new TagKeyInt(410120); + public static TagKeyInt EmoteUse = new TagKeyInt(410121); + public static TagKeyInt EmoteGreet = new TagKeyInt(410128); + public static TagKeyInt EmoteUseLoop = new TagKeyInt(410129); + + + public static TagKeyInt EmoteNo = new TagKeyInt(86272); + public static TagKeyInt EmoteWave = new TagKeyInt(86274); + public static TagKeyInt EmoteYes = new TagKeyInt(86275); + + + + public static TagKeyInt Opening = new TagKeyInt(70416); + public static TagKeyInt Open = new TagKeyInt(70432); + public static TagKeyInt Closing = new TagKeyInt(70448); + + public static TagKeyInt RootBreak = new TagKeyInt(196608); + + + + + public static TagKeyInt HTHParry = new TagKeyInt(70037); + + + } +} \ No newline at end of file diff --git a/src/Mooege/Core/GS/Common/Types/TagMap/MarkerKeys.cs b/src/Mooege/Core/GS/Common/Types/TagMap/MarkerKeys.cs new file mode 100644 index 00000000..160f38ba --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/TagMap/MarkerKeys.cs @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using System.Reflection; + +namespace Mooege.Core.GS.Common.Types.TagMap +{ + public class MarkerKeys + { + # region compile a dictionary to access keys from ids. If you need a readable name for a TagID, look up its key and get its name + private static Dictionary tags = new Dictionary(); + + public static TagKey GetKey(int index) + { + return tags.ContainsKey(index) ? tags[index] : null; + } + + static MarkerKeys() + { + foreach (FieldInfo field in typeof(MarkerKeys).GetFields()) + { + TagKey key = field.GetValue(null) as TagKey; + key.Name = field.Name; + tags.Add(key.ID, key); + } + } + #endregion + + //524864 == hasinteractionoptions? + + public static TagKeySNO QuestRange = new TagKeySNO(524544); + public static TagKeySNO ConversationList = new TagKeySNO(526080); + public static TagKeyFloat Scale = new TagKeyFloat(524288); + public static TagKeySNO OnActorSpawnedScript = new TagKeySNO(524808); + //TODO: Thes probably should be under actor keys... + public static TagKeyInt Group1Hash = new TagKeyInt(524814); + public static TagKeyInt Group2Hash = new TagKeyInt(524815); + public static TagKeySNO SpawnActor = new TagKeySNO(532496); + + // Used for portal destination resolution + public static TagKeySNO DestinationWorld = new TagKeySNO(526850); + public static TagKeyInt DestinationActorTag = new TagKeyInt(526851); + public static TagKeyInt ActorTag = new TagKeyInt(526852); + public static TagKeySNO DestinationLevelArea = new TagKeySNO(526853); + + public static TagKeyInt SavepointId = new TagKeyInt(526976); + + public static TagKeySNO TriggeredConversation = new TagKeySNO(528128); + public static TagKeySNO TriggeredConversation1 = new TagKeySNO(528129); + public static TagKeyInt TriggerDistance = new TagKeyInt(528384); // raven_pecking + public static TagKeySNO TriggeredActor = new TagKeySNO(526592); + + public static TagKeySNO MinimapTexture = new TagKeySNO(548864); + } +} diff --git a/src/Mooege/Core/GS/Common/Types/TagMap/PowerKeys.cs b/src/Mooege/Core/GS/Common/Types/TagMap/PowerKeys.cs new file mode 100644 index 00000000..1b3bb549 --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/TagMap/PowerKeys.cs @@ -0,0 +1,521 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using System.Reflection; + +namespace Mooege.Core.GS.Common.Types.TagMap +{ + public class PowerKeys + { + # region compile a dictionary to access keys from ids. If you need a readable name for a TagID, look up its key and get its name + private static Dictionary tags = new Dictionary(); + + public static TagKey GetKey(int index) + { + return tags.ContainsKey(index) ? tags[index] : null; + } + + static PowerKeys() + { + foreach (FieldInfo field in typeof(PowerKeys).GetFields()) + { + TagKey key = field.GetValue(null) as TagKey; + key.Name = field.Name; + tags.Add(key.ID, key); + } + } + #endregion + + public static TagKeyInt TurnsIntoBasicMeleeAttack = new TagKeyInt(328386); + public static TagKeyInt ReuseScriptState = new TagKeyInt(274432); + public static TagKeyInt CastTargetEnemies = new TagKeyInt(328113); + public static TagKeyInt CustomTargetUnaffectedOnly = new TagKeyInt(328800); + public static TagKeyInt IsUsableInTown = new TagKeyInt(328080); + public static TagKeyInt TurnsIntoBasicRangedAttack = new TagKeyInt(328385); + public static TagKeyInt IsPrimary = new TagKeyInt(327776); + public static TagKeyScript IsInvulnerableDuring = new TagKeyScript(328609); + public static TagKeyInt OffhandAnimationTag_fordualwield = new TagKeyInt(262663); + public static TagKeyInt IsPassive = new TagKeyInt(328592); + public static TagKeyInt AnimationTag2 = new TagKeyInt(262658); + public static TagKeyInt AnimationTag = new TagKeyInt(262656); + public static TagKeyScript IsUntargetableDuring = new TagKeyScript(633616); + public static TagKeyScript IsUninterruptableDuring = new TagKeyScript(328610); + public static TagKeyScript BaseDamageScalar = new TagKeyScript(329840); + public static TagKeyInt AlwaysHits = new TagKeyInt(327904); + public static TagKeySNO CastingEffectGroup_Female = new TagKeySNO(264273); + public static TagKeySNO CastingEffectGroup_Male = new TagKeySNO(262660); + public static TagKeyInt Buff0ShowDuration = new TagKeyInt(271104); + public static TagKeyScript CooldownTime = new TagKeyScript(327768); + public static TagKeySNO Buff1EffectGroup = new TagKeySNO(270337); + public static TagKeySNO Buff0EffectGroup = new TagKeySNO(270336); + public static TagKeyInt CastTargetAllies = new TagKeyInt(328097); + public static TagKeyInt RequiresTarget = new TagKeyInt(328432); + public static TagKeyInt Buff3IsHarmful = new TagKeyInt(270851); + public static TagKeyScript ResourceCost = new TagKeyScript(329616); + public static TagKeyInt IconMouseover = new TagKeyInt(329488); + public static TagKeyInt IconNormal = new TagKeyInt(329472); + public static TagKeyInt IconPushed = new TagKeyInt(329504); + public static TagKeyInt Buff3Icon = new TagKeyInt(270595); + public static TagKeyInt Buff2ShowDuration = new TagKeyInt(271106); + public static TagKeyInt IsMouseAssignable = new TagKeyInt(328048); + public static TagKeyInt IsHotbarAssignable = new TagKeyInt(328064); + public static TagKeyInt IsOffensive = new TagKeyInt(327840); + public static TagKeyInt IsDisplayed = new TagKeyInt(327824); + public static TagKeyInt Template = new TagKeyInt(327680); + public static TagKeyInt CannotLMBAssign = new TagKeyInt(327920); + public static TagKeyInt Buff2Icon = new TagKeyInt(270594); + public static TagKeyInt Buff1Icon = new TagKeyInt(270593); + public static TagKeyScript ScriptFormula10 = new TagKeyScript(266752); + public static TagKeyScript ScriptFormula11 = new TagKeyScript(266768); + public static TagKeyScript ScriptFormula12 = new TagKeyScript(266784); + public static TagKeyScript ScriptFormula13 = new TagKeyScript(266800); + public static TagKeyScript ScriptFormula14 = new TagKeyScript(266816); + public static TagKeyInt Buff0PlayerCanCancel = new TagKeyInt(271360); + public static TagKeyInt IconInactive = new TagKeyInt(329512); + public static TagKeyInt Buff0Icon = new TagKeyInt(270592); + public static TagKeyScript ScriptFormula0 = new TagKeyScript(266496); + public static TagKeyScript ScriptFormula2 = new TagKeyScript(266528); + public static TagKeyScript ScriptFormula3 = new TagKeyScript(266544); + public static TagKeyScript ScriptFormula4 = new TagKeyScript(266560); + public static TagKeyScript ScriptFormula5 = new TagKeyScript(266576); + public static TagKeyScript ScriptFormula7 = new TagKeyScript(266608); + public static TagKeyInt Buff3ShowDuration = new TagKeyInt(271107); + public static TagKeyInt Buff2PlayerCanCancel = new TagKeyInt(271362); + public static TagKeyScript FailsIfStunned = new TagKeyScript(328322); + public static TagKeyScript BreaksFear = new TagKeyScript(681987); + public static TagKeyScript BreaksStun = new TagKeyScript(681986); + public static TagKeyScript BreaksSnare = new TagKeyScript(681985); + public static TagKeyScript BreaksRoot = new TagKeyScript(681984); + public static TagKeyScript FailsIfFeared = new TagKeyScript(328325); + public static TagKeySNO ContactFrameEffectGroup_Male = new TagKeySNO(264192); + public static TagKeySNO ContactFrameEffectGroup_Female = new TagKeySNO(264275); + public static TagKeyInt SpellFunc0 = new TagKeyInt(327712); + public static TagKeyInt CastTargetMustBeInTeleportableArea = new TagKeyInt(328083); + public static TagKeySNO GenericEffectGroup0 = new TagKeySNO(262661); + public static TagKeyScript ConcentrationDuration = new TagKeyScript(333088); + public static TagKeyScript SlowTimeDuration = new TagKeyScript(332928); + public static TagKeyScript RingofFrostRingLifetime = new TagKeyScript(332896); + public static TagKeyScript DodgeDuration = new TagKeyScript(332848); + public static TagKeyScript DamageAuraDuration = new TagKeyScript(332832); + public static TagKeyScript RootDuration = new TagKeyScript(332816); + public static TagKeyScript CurseDuration = new TagKeyScript(332800); + public static TagKeyScript PaladinDeadTimeUntilResurrect = new TagKeyScript(332784); + public static TagKeyScript BuffDurationMin = new TagKeyScript(332736); + public static TagKeyScript ThunderingCryBuffDuration = new TagKeyScript(332720); + public static TagKeyScript ThunderstormDuration = new TagKeyScript(332704); + public static TagKeyScript TornadoLifeDurationMin = new TagKeyScript(332656); + public static TagKeySNO EndingEffectGroup = new TagKeySNO(262662); + public static TagKeyScript AttackSpeed = new TagKeyScript(329824); + public static TagKeyScript ScriptFormula23 = new TagKeyScript(267056); + public static TagKeyScript ScriptFormula22 = new TagKeyScript(267040); + public static TagKeyScript ScriptFormula20 = new TagKeyScript(267008); + public static TagKeyScript ScriptFormula21 = new TagKeyScript(267024); + public static TagKeyScript EscapeAttackRadius = new TagKeyScript(329744); + public static TagKeyScript AttackRadius = new TagKeyScript(329808); + public static TagKeyInt IgnoresRangeOnShiftClick = new TagKeyInt(328600); + public static TagKeyInt AutoAssignLocation = new TagKeyInt(328049); + public static TagKeyInt CanSteer = new TagKeyInt(327937); + public static TagKeyInt TurnsIntoBasicAttack = new TagKeyInt(328384); + public static TagKeyInt ItemTypeRequirement = new TagKeyInt(328960); + public static TagKeyInt SpecialDeathType = new TagKeyInt(328534); + public static TagKeyScript ResourceCostMinToCast = new TagKeyScript(329617); + public static TagKeyInt ControllerAutoTargets = new TagKeyInt(622592); + public static TagKeyScript ControllerMinRange = new TagKeyScript(622593); + public static TagKeyInt TargetGroundOnly = new TagKeyInt(328160); + public static TagKeyInt TurnsIntoWalk = new TagKeyInt(327936); + public static TagKeyInt IsAimedAtGround = new TagKeyInt(327888); + public static TagKeyScript ScriptFormula19 = new TagKeyScript(266896); + public static TagKeyScript ScriptFormula18 = new TagKeyScript(266880); + public static TagKeyScript ScriptFormula17 = new TagKeyScript(266864); + public static TagKeyScript ScriptFormula16 = new TagKeyScript(266848); + public static TagKeyScript ScriptFormula15 = new TagKeyScript(266832); + public static TagKeyInt UsesAttackWarmupTime = new TagKeyInt(328606); + public static TagKeyInt AlternatesAnims = new TagKeyInt(328501); + public static TagKeyFloat SpecialDeathChance = new TagKeyFloat(328532); + public static TagKeyScript ScriptFormula9 = new TagKeyScript(266640); + public static TagKeyScript ScriptFormula8 = new TagKeyScript(266624); + public static TagKeyScript ScriptFormula1 = new TagKeyScript(266512); + public static TagKeyScript ScriptFormula6 = new TagKeyScript(266592); + public static TagKeyInt ContactFrameType = new TagKeyInt(328224); + public static TagKeyScript PayloadParam0 = new TagKeyScript(329776); + public static TagKeyInt PayloadType = new TagKeyInt(329760); + public static TagKeyInt TargetEnemies = new TagKeyInt(328112); + public static TagKeyInt SpellFunc1 = new TagKeyInt(327728); + public static TagKeyScript ProjectileSpeed = new TagKeyScript(331184); + public static TagKeyScript ChargedBoltNumBolts = new TagKeyScript(331056); + public static TagKeySNO ProjectileActor = new TagKeySNO(262400); + public static TagKeyScript ProcCooldownTime = new TagKeyScript(680768); + public static TagKeyScript LightningDamageDelta = new TagKeyScript(330128); + public static TagKeyScript LightningDamageMin = new TagKeyScript(330112); + public static TagKeyInt CastTargetIgnoreWreckables = new TagKeyInt(328169); + public static TagKeyInt TargetIgnoreWreckables = new TagKeyInt(328168); + public static TagKeyScript ColdDamageMin = new TagKeyScript(330176); + public static TagKeyScript ColdDamageDelta = new TagKeyScript(330192); + public static TagKeyInt Buff1ShowDuration = new TagKeyInt(271105); + public static TagKeyInt AutoPurchaseLevel = new TagKeyInt(329520); + public static TagKeyInt Buff1PlayerCanCancel = new TagKeyInt(271361); + public static TagKeyScript ImmuneToKnockback = new TagKeyScript(328352); + public static TagKeyScript ImmuneToRecoil = new TagKeyScript(328336); + public static TagKeyInt NeverUpdatesFacing = new TagKeyInt(328000); + public static TagKeyInt ContactFreezesFacing = new TagKeyInt(327984); + public static TagKeyInt IsBasicAttack = new TagKeyInt(327808); + public static TagKeyInt SpellFuncBegin = new TagKeyInt(327696); + public static TagKeyInt SpellFuncInterrupted = new TagKeyInt(327745); + public static TagKeyScript NumCryptKidsToSpawnOnCorpulentExplosion = new TagKeyScript(332480); + public static TagKeyInt TargetAllies = new TagKeyInt(328096); + public static TagKeyInt NeverCausesRecoil = new TagKeyInt(327968); + public static TagKeyScript MonsterCritDamageScalar = new TagKeyScript(684918); + public static TagKeyScript PlayerCritDamageScalar = new TagKeyScript(684917); + public static TagKeyInt Buff0IsHarmful = new TagKeyInt(270848); + public static TagKeyInt DoesntCenter = new TagKeyInt(328032); + public static TagKeyInt IsTranslate = new TagKeyInt(327856); + public static TagKeyInt SpellFuncEnd = new TagKeyInt(327744); + public static TagKeyScript SpecialWalkTrajectoryHeight = new TagKeyScript(332320); + public static TagKeyScript SpecialWalkTrajectoryGravity = new TagKeyScript(332336); + public static TagKeyInt SpecialWalkPerturbDestination = new TagKeyInt(332360); + public static TagKeyInt IsChannelled = new TagKeyInt(328400); + public static TagKeyInt InfiniteAnimTiming = new TagKeyInt(328208); + public static TagKeyInt CustomTargetFunc = new TagKeyInt(328736); + public static TagKeyInt CustomTargetPlayersOnly = new TagKeyInt(328752); + public static TagKeyScript CustomTargetMinRange = new TagKeyScript(328768); + public static TagKeyInt SnapsToFacing = new TagKeyInt(328021); + public static TagKeyScript ManaPercentToReserve = new TagKeyScript(331600); + public static TagKeyInt ComboAnimation1 = new TagKeyInt(262912); + public static TagKeyScript ScriptFormula26 = new TagKeyScript(267104); + public static TagKeyScript ScriptFormula28 = new TagKeyScript(267136); + public static TagKeyScript ScriptFormula29 = new TagKeyScript(267152); + public static TagKeyScript EscapeAttackAngle = new TagKeyScript(329745); + public static TagKeyScript ComboAttackRadius1 = new TagKeyScript(329809); + public static TagKeyInt ComboAnimation2 = new TagKeyInt(262913); + public static TagKeyScript ComboAttackSpeed1 = new TagKeyScript(329825); + public static TagKeySNO Buff3EffectGroup = new TagKeySNO(270339); + public static TagKeyScript ComboAttackRadius2 = new TagKeyScript(329810); + public static TagKeyScript ComboAttackSpeed2 = new TagKeyScript(329826); + public static TagKeySNO Buff2EffectGroup = new TagKeySNO(270338); + public static TagKeyScript ComboAttackRadius3 = new TagKeyScript(329811); + public static TagKeyScript ComboAttackSpeed3 = new TagKeyScript(329827); + public static TagKeyInt IsComboPower = new TagKeyInt(264448); + public static TagKeyInt Buff3PlayerCanCancel = new TagKeyInt(271363); + public static TagKeyInt ComboAnimation3 = new TagKeyInt(262914); + public static TagKeySNO Combo1CastingEffectGroup_Male = new TagKeySNO(264289); + public static TagKeySNO Combo1CastingEffectGroup_Female = new TagKeySNO(264321); + public static TagKeyInt AffectedByDualWield = new TagKeyInt(328448); + public static TagKeySNO Combo0CastingEffectGroup_Male = new TagKeySNO(264288); + public static TagKeySNO Combo0CastingEffectGroup_Female = new TagKeySNO(264320); + public static TagKeySNO Combo2CastingEffectGroup_Male = new TagKeySNO(264290); + public static TagKeySNO Combo2CastingEffectGroup_Female = new TagKeySNO(264322); + public static TagKeyScript ScriptFormula30 = new TagKeyScript(267264); + public static TagKeyScript ScriptFormula31 = new TagKeyScript(267280); + public static TagKeyScript ScriptFormula32 = new TagKeyScript(267296); + public static TagKeyScript ScriptFormula33 = new TagKeyScript(267312); + public static TagKeyScript ScriptFormula34 = new TagKeyScript(267328); + public static TagKeyScript ScriptFormula35 = new TagKeyScript(267344); + public static TagKeyScript ScriptFormula36 = new TagKeyScript(267360); + public static TagKeyScript ScriptFormula37 = new TagKeyScript(267376); + public static TagKeyScript SpiritGained = new TagKeyScript(684928); + public static TagKeyScript CurseDamageAmplifyPercent = new TagKeyScript(331536); + public static TagKeyInt Buff4Icon = new TagKeyInt(270596); + public static TagKeyInt Buff4ShowDuration = new TagKeyInt(271108); + public static TagKeySNO Buff4EffectGroup = new TagKeySNO(270340); + public static TagKeyScript FailsIfSilenced = new TagKeyScript(328321); + public static TagKeyInt Buff4PlayerCanCancel = new TagKeyInt(271364); + public static TagKeyInt IsPhysical = new TagKeyInt(328624); + public static TagKeyInt HitsoundOverride = new TagKeyInt(262433); + public static TagKeyScript ScriptFormula25 = new TagKeyScript(267088); + public static TagKeyInt Requires2HItem = new TagKeyInt(328992); + public static TagKeyInt Buff2IsHarmful = new TagKeyInt(270850); + public static TagKeyInt RequiresActorTarget = new TagKeyInt(328240); + public static TagKeyInt ClipsTargetToAttackRadius = new TagKeyInt(684848); + public static TagKeyInt CastTargetNeutral = new TagKeyInt(328145); + public static TagKeyInt LOSCheck = new TagKeyInt(328720); + public static TagKeyScript AttackRating = new TagKeyScript(329888); + public static TagKeyScript DestructableObjectDamageDelay = new TagKeyScript(618496); + public static TagKeyInt TargetNeutral = new TagKeyInt(328144); + public static TagKeySNO ExplosionActor = new TagKeySNO(262401); + public static TagKeyScript StunChance = new TagKeyScript(330816); + public static TagKeyScript StunDurationMin = new TagKeyScript(330784); + public static TagKeyScript PhysicalDamageDelta = new TagKeyScript(330000); + public static TagKeyScript PhysicalDamageMin = new TagKeyScript(329984); + public static TagKeyInt IsItemPower = new TagKeyInt(328601); + public static TagKeyInt CastTargetCorpse = new TagKeyInt(328129); + public static TagKeyScript SummonedActorLevel = new TagKeyScript(331136); + public static TagKeyInt TargetContactPlaneOnly = new TagKeyInt(328162); + public static TagKeyInt DontWalkCloserIfOutOfRange = new TagKeyInt(328256); + public static TagKeyScript ResourceGainedOnFirstHit = new TagKeyScript(329627); + public static TagKeyInt LocksActorsWhileSweeping = new TagKeyInt(328420); + public static TagKeyInt Buff1IsHarmful = new TagKeyInt(270849); + public static TagKeyScript FailsIfImmobilized = new TagKeyScript(328320); + public static TagKeyInt StartWalkAfterIntro = new TagKeyInt(328288); + public static TagKeyInt RollToDestination = new TagKeyInt(328368); + public static TagKeyInt PickupItemsWhileMoving = new TagKeyInt(655984); + public static TagKeyScript WalkingSpeedMultiplier = new TagKeyScript(331952); + public static TagKeyScript SpecialWalkPlayerEndAnimScalar = new TagKeyScript(328536); + public static TagKeyInt NeverUpdatesFacingStarting = new TagKeyInt(328016); + public static TagKeyInt RequiresSkillPoint = new TagKeyInt(328248); + public static TagKeyInt IsKnockbackMovement = new TagKeyInt(327860); + public static TagKeyInt SpecialWalkIsKnockback = new TagKeyInt(332362); + public static TagKeyScript BreaksImmobilize = new TagKeyScript(328304); + public static TagKeyScript ImmunetoFearduring = new TagKeyScript(682243); + public static TagKeyScript ImmunetoRootduring = new TagKeyScript(682240); + public static TagKeyScript ImmunetoSnareduring = new TagKeyScript(682241); + public static TagKeyScript ImmunetoStunduring = new TagKeyScript(682242); + public static TagKeyInt CastTargetNormalMonstersOnly = new TagKeyInt(328617); + public static TagKeyInt CausesClosingCooldown = new TagKeyInt(328632); + public static TagKeyInt CastTargetIgnoreLargeMonsters = new TagKeyInt(328616); + public static TagKeyScript CustomTargetMaxRange = new TagKeyScript(328784); + public static TagKeySNO CustomTargetBuffPowerSNO = new TagKeySNO(328802); + public static TagKeyScript FireDamageDelta = new TagKeyScript(330064); + public static TagKeyScript FireDamageMin = new TagKeyScript(330048); + public static TagKeyInt DisplaysNoDamage = new TagKeyInt(327829); + public static TagKeyScript SkillPointCost = new TagKeyScript(329312); + public static TagKeyInt CannotLockOntoActors = new TagKeyInt(328416); + public static TagKeyInt ChannelledLocksActors = new TagKeyInt(328401); + public static TagKeyInt NoAffectedACD = new TagKeyInt(328176); + public static TagKeyScript ResourceCostReductionCoefficient = new TagKeyScript(329625); + public static TagKeyInt TargetNavMeshOnly = new TagKeyInt(328163); + public static TagKeySNO HitEffect = new TagKeySNO(684034); + public static TagKeyInt OverrideHitEffects = new TagKeyInt(684032); + public static TagKeyInt AnimationTagRuneE = new TagKeyInt(262677); + public static TagKeyScript LifestealPercent = new TagKeyScript(331224); + public static TagKeyScript CritChance = new TagKeyScript(331008); + public static TagKeyScript GhostSoulsiphonMaxChannellingDistance = new TagKeyScript(365056); + public static TagKeySNO Source_DestEffectGroup = new TagKeySNO(262659); + public static TagKeyScript GhostSoulsiphonMaxChannellingTime = new TagKeyScript(364800); + public static TagKeyScript GhostSoulsiphonSlowMultiplier = new TagKeyScript(364544); + public static TagKeyScript GhostSoulsiphonDamagePerSecond = new TagKeyScript(365312); + public static TagKeyInt CastTargetAllowDeadTargets = new TagKeyInt(328620); + public static TagKeyScript BuffDurationDelta = new TagKeyScript(332752); + public static TagKeyScript SlowMovementSpeedMultiplier = new TagKeyScript(692224); + public static TagKeyScript FireDuration = new TagKeyScript(329976); + public static TagKeyInt IsCancellable = new TagKeyInt(328544); + public static TagKeyScript StunDurationDelta = new TagKeyScript(330800); + public static TagKeySNO Rope = new TagKeySNO(262432); + public static TagKeyScript LoopingAnimationTime = new TagKeyScript(263296); + public static TagKeyInt ClassRestriction = new TagKeyInt(329648); + public static TagKeyInt AlwaysKnown = new TagKeyInt(329536); + public static TagKeyScript ScriptFormula38 = new TagKeyScript(267392); + public static TagKeyScript ScriptFormula39 = new TagKeyScript(267408); + public static TagKeyInt GenericBuffAttribute2 = new TagKeyInt(655648); + public static TagKeyInt GenericBuffAttribute3 = new TagKeyInt(655664); + public static TagKeyInt GenericBuffAttribute1 = new TagKeyInt(655632); + public static TagKeyInt GenericBuffAttribute0 = new TagKeyInt(655616); + public static TagKeyScript GenericBuffAttribute2Formula = new TagKeyScript(655649); + public static TagKeyScript GenericBuffAttribute3Formula = new TagKeyScript(655665); + public static TagKeyScript GenericBuffAttribute1Formula = new TagKeyScript(655633); + public static TagKeyScript GenericBuffAttribute0Formula = new TagKeyScript(655617); + public static TagKeyInt CallAIUpdateImmediatelyUponTermination = new TagKeyInt(328604); + public static TagKeyInt ChecksVerticalMovement = new TagKeyInt(327864); + public static TagKeyInt DoesntPreplayAnimation = new TagKeyInt(328611); + public static TagKeyInt IsCompletedWhenWalkingStops = new TagKeyInt(328608); + public static TagKeyScript DelayBeforeSettingTarget = new TagKeyScript(328539); + public static TagKeyScript KnockbackMagnitude = new TagKeyScript(331696); + public static TagKeyScript WhirlwindKnockbackMagnitude = new TagKeyScript(331664); + public static TagKeyScript RetaliationKnockbackMagnitude = new TagKeyScript(331648); + public static TagKeyInt ScaledAnimTiming = new TagKeyInt(328192); + public static TagKeyInt IsADodgePower = new TagKeyInt(328480); + public static TagKeyScript DodgeTravelDistanceMin = new TagKeyScript(332384); + public static TagKeyScript DodgeTravelSpeed = new TagKeyScript(331936); + public static TagKeyScript DodgeTravelAngleOffset = new TagKeyScript(332544); + public static TagKeyInt TargetDoesntRequireActor = new TagKeyInt(328615); + public static TagKeyInt CancelsOtherPowers = new TagKeyInt(328560); + public static TagKeyInt NoInterruptTimer = new TagKeyInt(684880); + public static TagKeyScript FuryCoefficient = new TagKeyScript(332180); + public static TagKeyInt BrainActionType = new TagKeyInt(328704); + public static TagKeyScript AIActionDurationMin = new TagKeyScript(332864); + public static TagKeyScript WhirlwindDurationMin = new TagKeyScript(361504); + public static TagKeyScript WhirlwindMovementSpeed = new TagKeyScript(361521); + public static TagKeyScript KnockbackGravityMin = new TagKeyScript(331708); + public static TagKeyScript KnockbackHeightMin = new TagKeyScript(331704); + public static TagKeyScript HitpointsGrantedByHeal = new TagKeyScript(331264); + public static TagKeySNO ChildPower = new TagKeySNO(327760); + public static TagKeyScript HearthTime = new TagKeyScript(643072); + public static TagKeyScript MovementSpeedPercentIncreaseMin = new TagKeyScript(332000); + public static TagKeyScript AttackSpeedPercentIncreaseMin = new TagKeyScript(331968); + public static TagKeyScript DamagePercentAll = new TagKeyScript(330752); + public static TagKeySNO ProjectileWallFloorExplosion = new TagKeySNO(262410); + public static TagKeyInt OnlyFreeCast = new TagKeyInt(329633); + public static TagKeyInt ProcTargetsSelf = new TagKeyInt(328440); + public static TagKeyScript ScriptFormula24 = new TagKeyScript(267072); + public static TagKeyScript HealthCost = new TagKeyScript(329632); + public static TagKeyScript WalkingDistanceMin = new TagKeyScript(331960); + public static TagKeyInt AnimationTagRuneC = new TagKeyInt(262675); + public static TagKeyScript IsInvisibleDuring = new TagKeyScript(340141); + public static TagKeyInt SetTargetAfterIntro = new TagKeyInt(328292); + public static TagKeyScript MinWalkDuration = new TagKeyScript(328535); + public static TagKeyScript ScriptFormula27 = new TagKeyScript(267120); + public static TagKeyInt AnimationTagRuneB = new TagKeyInt(262674); + public static TagKeyInt AnimationTagRuneA = new TagKeyInt(262673); + public static TagKeyScript AIActionDurationDelta = new TagKeyScript(332880); + public static TagKeyInt UsesWeaponRange = new TagKeyInt(328607); + public static TagKeySNO Combo1ContactFrameEffectGroup_Male = new TagKeySNO(264305); + public static TagKeySNO Combo1ContactFrameEffectGroup_Female = new TagKeySNO(264337); + public static TagKeySNO Combo0ContactFrameEffectGroup_Male = new TagKeySNO(264304); + public static TagKeySNO Combo0ContactFrameEffectGroup_Female = new TagKeySNO(264336); + public static TagKeySNO Combo2ContactFrameEffectGroup_Male = new TagKeySNO(264306); + public static TagKeySNO Combo2ContactFrameEffectGroup_Female = new TagKeySNO(264338); + public static TagKeyInt Requires1HItem = new TagKeyInt(328976); + public static TagKeyScript SkeletonSummonMaxTotalCount = new TagKeyScript(332450); + public static TagKeyScript SkeletonSummonCountPerSummon = new TagKeyScript(332448); + public static TagKeyInt PlaySummonedByMonsterAnimation = new TagKeyInt(331137); + public static TagKeyScript SkeletonSummonMaxCount = new TagKeyScript(332449); + public static TagKeyScript SummonedActorLifeDuration = new TagKeyScript(331120); + public static TagKeySNO ContactFrameEffectGroup_Male2 = new TagKeySNO(264194); + public static TagKeySNO ContactFrameEffectGroup_Female2 = new TagKeySNO(264277); + public static TagKeyInt ArcMoveUntilDestHeight = new TagKeyInt(328296); + public static TagKeyScript RunInFrontDistance = new TagKeyScript(565248); + public static TagKeyScript SpecialWalkHeightIsRelativeToMax = new TagKeyScript(332338); + public static TagKeyScript SpecialWalkTrajectoryGravityDelta = new TagKeyScript(332337); + public static TagKeyScript SpecialWalkTrajectoryHeightDelta = new TagKeyScript(332321); + public static TagKeyScript PierceChance = new TagKeyScript(331040); + public static TagKeyInt CanPathDuringWalk = new TagKeyInt(328272); + public static TagKeyScript UseSpecialWalkSteering = new TagKeyScript(328538); + public static TagKeyInt UsesAnimTag2IfBuffExists = new TagKeyInt(266240); + public static TagKeyInt IsEmote = new TagKeyInt(264704); + public static TagKeySNO EmoteConversationSNO = new TagKeySNO(264720); + public static TagKeyInt SpellFuncCreate = new TagKeyInt(327697); + public static TagKeyScript NovaDelay = new TagKeyScript(655985); + public static TagKeyScript AuraAffectedRadius = new TagKeyScript(331840); + public static TagKeyScript BuffDurationBetweenPulses = new TagKeyScript(332768); + public static TagKeyScript PowerGainedPerSecond = new TagKeyScript(700435); + public static TagKeyScript ManaGainedPerSecond = new TagKeyScript(331520); + public static TagKeyScript FuryGenerationBonusPercent = new TagKeyScript(700434); + public static TagKeyScript SpiritGenerationBonusPercent = new TagKeyScript(700433); + public static TagKeyScript ArcanumGainedPerSecond = new TagKeyScript(700432); + public static TagKeyScript PoisonDamageDelta = new TagKeyScript(330256); + public static TagKeyScript PoisonDamageMin = new TagKeyScript(330240); + public static TagKeyScript PoisonCloudNumIntervals = new TagKeyScript(330992); + public static TagKeyScript PoisonCloudIntervalDuration = new TagKeyScript(330976); + public static TagKeySNO TargetImpactParticle = new TagKeySNO(262405); + public static TagKeyInt IsPunch = new TagKeyInt(327792); + public static TagKeyInt Buff5ShowDuration = new TagKeyInt(271109); + public static TagKeyInt Buff5PlayerCanCancel = new TagKeyInt(271365); + public static TagKeyInt Buff6ShowDuration = new TagKeyInt(271110); + public static TagKeyInt Buff6PlayerCanCancel = new TagKeyInt(271366); + public static TagKeyInt Buff6Icon = new TagKeyInt(270598); + public static TagKeyInt Buff5Icon = new TagKeyInt(270597); + public static TagKeyInt SnapsToGround = new TagKeyInt(328496); + public static TagKeyInt CanUseWhenDead = new TagKeyInt(328528); + public static TagKeyScript BlindDurationMin = new TagKeyScript(684577); + public static TagKeyScript PayloadParam1 = new TagKeyScript(329792); + public static TagKeyScript BlindDurationDelta = new TagKeyScript(684578); + public static TagKeyScript CanUseWhenFeared = new TagKeyScript(328512); + public static TagKeyScript ResurrectionBuffTime = new TagKeyScript(647168); + public static TagKeyScript ResurrectionHealthMultiplierToStart = new TagKeyScript(651264); + public static TagKeyScript ProjectileCount = new TagKeyScript(331193); + public static TagKeyScript ProjectileJitter = new TagKeyScript(331196); + public static TagKeySNO RootGrabPower = new TagKeySNO(606208); + public static TagKeyScript RootTimerModificationPerStruggle = new TagKeyScript(360960); + public static TagKeyScript PercentofDamageThatShieldCanAbsorb = new TagKeyScript(332641); + public static TagKeyScript AnatomyCritBonusPercent = new TagKeyScript(413696); + public static TagKeyScript VanishDuration = new TagKeyScript(458752); + public static TagKeyScript HitpointsThatShieldCanAbsorb = new TagKeyScript(332640); + public static TagKeyScript ShrineBuffRadius = new TagKeyScript(633603); + public static TagKeyInt ShrineBuffAllies = new TagKeyInt(633602); + public static TagKeyScript ScaleBonus = new TagKeyScript(332024); + public static TagKeyScript DefensePercentAll = new TagKeyScript(330768); + public static TagKeyScript BonusHitpointPercent = new TagKeyScript(331568); + public static TagKeyScript ShrineBuffBonus = new TagKeyScript(633601); + public static TagKeyInt SummonedAnimationTag = new TagKeyInt(332451); + public static TagKeyScript ArcaneDamageMin = new TagKeyScript(330304); + public static TagKeyScript ArcaneDamageDelta = new TagKeyScript(330320); + public static TagKeyScript BlizzardInitialImpactDelay = new TagKeyScript(332080); + public static TagKeySNO ChainRope = new TagKeySNO(262403); + public static TagKeyScript ImmobilizeDurationDelta = new TagKeyScript(330880); + public static TagKeyScript WebDurationDelta = new TagKeyScript(330848); + public static TagKeyScript ImmobilizeDurationMin = new TagKeyScript(330864); + public static TagKeyScript WebDurationMin = new TagKeyScript(330832); + public static TagKeyInt IsToggleable = new TagKeyInt(327952); + public static TagKeyScript SlowDurationMin = new TagKeyScript(330896); + public static TagKeyInt IsUsableInCombat = new TagKeyInt(328081); + public static TagKeyInt CastTargetGroundOnly = new TagKeyInt(328161); + public static TagKeyInt CausesKnockback = new TagKeyInt(331697); + public static TagKeyInt ClientControlsFacing = new TagKeyInt(328022); + public static TagKeyScript DisintegrateBeamWidth = new TagKeyScript(332304); + public static TagKeyScript DisintegrateTimeBetweenUpdates = new TagKeyScript(332688); + public static TagKeyInt CustomTargetBuffPowerSNOBuffIndex = new TagKeyInt(328801); + public static TagKeyInt ProjectileThrowOverGuys = new TagKeyInt(262408); + public static TagKeyInt IsLobbed = new TagKeyInt(327872); + public static TagKeyScript DurationDelta = new TagKeyScript(684930); + public static TagKeyScript DurationMin = new TagKeyScript(684929); + public static TagKeyInt UsesWeaponProjectile = new TagKeyInt(262480); + public static TagKeyScript ModalCursorRadius = new TagKeyScript(328069); + public static TagKeyFloat ProjectileGravity = new TagKeyFloat(329872); + public static TagKeyInt ProjectileScaleVelocity = new TagKeyInt(262435); + public static TagKeyScript HeightAboveSource = new TagKeyScript(329880); + public static TagKeyScript ProjectileSpreadAngle = new TagKeyScript(331194); + public static TagKeyFloat CustomTargetNeedsHealHPPercent = new TagKeyFloat(328804); + public static TagKeyScript EnergyShieldManaCostPerDamage = new TagKeyScript(332576); + public static TagKeySNO SynergyPower = new TagKeySNO(327764); + public static TagKeyInt IsUpgrade = new TagKeyInt(329216); + public static TagKeyFloat AnimationTurnThreshold = new TagKeyFloat(263426); + public static TagKeyInt AnimationTagTurnRight = new TagKeyInt(263425); + public static TagKeyInt AnimationTagTurnLeft = new TagKeyInt(263424); + public static TagKeyInt IsOnlyUsableInTownPortalAreas = new TagKeyInt(328082); + public static TagKeyInt IsCancellableByWalking = new TagKeyInt(328546); + public static TagKeyInt FollowWalkAnimTag = new TagKeyInt(561424); + public static TagKeyInt FollowMatchTargetSpeed = new TagKeyInt(561408); + public static TagKeyScript RunNearbyDistanceMin = new TagKeyScript(332416); + public static TagKeyScript RunNearbyDistanceDelta = new TagKeyScript(332432); + public static TagKeyScript FollowStartDistance = new TagKeyScript(561152); + public static TagKeyScript FollowStopDistance = new TagKeyScript(557056); + public static TagKeyInt Buff5IsHarmful = new TagKeyInt(270853); + public static TagKeySNO Buff5EffectGroup = new TagKeySNO(270341); + public static TagKeyInt Buff4IsHarmful = new TagKeyInt(270852); + public static TagKeyScript HolyDamageMin = new TagKeyScript(330496); + public static TagKeyScript HolyDamageDelta = new TagKeyScript(330512); + public static TagKeyScript DestinationJitterAttempts = new TagKeyScript(360704); + public static TagKeyScript DestinationJitterRadius = new TagKeyScript(360448); + public static TagKeyInt RootEndFunc = new TagKeyInt(606464); + public static TagKeySNO ConsumesItem = new TagKeySNO(329088); + public static TagKeyScript DebuffDurationMin = new TagKeyScript(655680); + public static TagKeyScript ProcChance = new TagKeyScript(680704); + public static TagKeySNO Upgrade2 = new TagKeySNO(329264); + public static TagKeySNO Upgrade1 = new TagKeySNO(329248); + public static TagKeySNO Upgrade0 = new TagKeySNO(329232); + public static TagKeyScript FreezeDamageDoneMin = new TagKeyScript(331232); + public static TagKeyScript AttackRatingPercent = new TagKeyScript(329904); + public static TagKeyScript SummoningMachineNodeIsInvulnerable = new TagKeyScript(704512); + public static TagKeySNO DamageDisplayPower = new TagKeySNO(627456); + public static TagKeySNO Buff6EffectGroup = new TagKeySNO(270342); + public static TagKeyInt Buff6IsHarmful = new TagKeyInt(270854); + public static TagKeyScript DodgeTravelDistanceDelta = new TagKeyScript(332400); + public static TagKeySNO Buff7EffectGroup = new TagKeySNO(270343); + public static TagKeyInt ComboAnimation1RuneA = new TagKeyInt(263185); + public static TagKeyScript KnockbackGravityDelta = new TagKeyScript(331709); + public static TagKeyScript KnockbackHeightDelta = new TagKeyScript(331705); + public static TagKeyScript FuryAddPerInterval = new TagKeyScript(332178); + public static TagKeyScript FuryDegenerationOutofCombat_persecond = new TagKeyScript(332177); + public static TagKeyScript FuryGainedPerSecondOfAttack = new TagKeyScript(332097); + public static TagKeyScript FuryTimeBetweenUpdates = new TagKeyScript(333056); + public static TagKeyScript FuryDegenerationStart_inseconds = new TagKeyScript(332181); + public static TagKeyScript FuryGainedPerPercentHealthLost = new TagKeyScript(332096); + public static TagKeyScript FuryMaxDamageBonus = new TagKeyScript(332185); + public static TagKeyScript SlowTimeAmount = new TagKeyScript(330944); + public static TagKeyScript SlowAmount = new TagKeyScript(330928); + public static TagKeyInt ComboAnimation1RuneC = new TagKeyInt(263187); + public static TagKeyInt ComboAnimation1RuneE = new TagKeyInt(263189); + public static TagKeyInt ComboAnimation1RuneD = new TagKeyInt(263188); + public static TagKeyInt ComboAnimation1RuneB = new TagKeyInt(263186); + public static TagKeyInt ComboAnimation3RuneC = new TagKeyInt(263219); + public static TagKeyInt AnimationTagRuneD = new TagKeyInt(262676); + public static TagKeyScript GenericBuffAttribute0AndParameter = new TagKeyScript(655618); + public static TagKeyScript GenericBuffAttribute1AndParameter = new TagKeyScript(655634); + public static TagKeyInt SpecialWalkGoThroughOccluded = new TagKeyInt(332341); + } +} diff --git a/src/Mooege/Core/GS/Common/Types/TagMap/TagMap.cs b/src/Mooege/Core/GS/Common/Types/TagMap/TagMap.cs new file mode 100644 index 00000000..4e4ec440 --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/TagMap/TagMap.cs @@ -0,0 +1,288 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using CrystalMpq; +using Gibbed.IO; +using System.Reflection; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Common.MPQ; +using Mooege.Common.MPQ.FileFormats.Types; +using Mooege.Common.Storage; + +namespace Mooege.Core.GS.Common.Types.TagMap +{ + /// + /// Implementation of a dictionary-like tag map. + /// You can access elements either using a key object that identifies which of the TagKey + /// fields holds your value or by accessing the entry directly with the interger tag id. + /// + public class TagMap : ISerializableData, IEnumerable + { + + public int TagMapSize { get; private set; } + + [PersistentProperty("TagMapEntries")] + private Dictionary _tagMapEntries { get; set; } + + [Obsolete("Use TagKeys instead. If it is missing create it.")] + public List TagMapEntries + { + get + { + return _tagMapEntries.Values.ToList(); + } + } + + # region compile a dictionary to access keys from ids. If you need a readable name for a TagID, look up its key and get its name. + // This is a combination of all dictionaries, so it HAS COLLISIONS + // This is mainly for debugging purposes, if you have a tagID and want to know what key it is / might be + private static Dictionary> tags = new Dictionary>(); + + public static List GetKeys(int index) + { + return tags.ContainsKey(index) ? tags[index] : new List(); + } + + static TagMap() + { + foreach (Type t in new Type[] { typeof(MarkerKeys), typeof(ActorKeys), typeof(PowerKeys), typeof(AnimationSetKeys) }) + foreach (FieldInfo field in t.GetFields()) + { + TagKey key = field.GetValue(null) as TagKey; + if (!tags.ContainsKey(key.ID)) + tags.Add(key.ID, new List()); + + tags[key.ID].Add(key); + } + } + #endregion + + public TagMap() + { + _tagMapEntries = new Dictionary(); + } + + + [Obsolete("Use TagKeys instead. If it is missing create it")] + public bool ContainsKey(int key) { return _tagMapEntries.ContainsKey(key); } + public bool ContainsKey(TagKey key) { return _tagMapEntries.ContainsKey(key.ID); } + + public void Add(TagKey key, TagMapEntry entry) { _tagMapEntries.Add(key.ID, entry); } + + + public void Read(MpqFileStream stream) + { + TagMapSize = stream.ReadValueS32(); + _tagMapEntries = new Dictionary(); + + for (int i = 0; i < TagMapSize; i++) + { + var entry = new TagMapEntry(stream); + this._tagMapEntries.Add(entry.TagID, entry); + } + } + + #region accessors + + public int this[TagKeyInt key] + { + get + { + return key.GetValue(_tagMapEntries[key.ID]); + } + set + { + _tagMapEntries[key.ID].Int = value; + } + } + + public float this[TagKeyFloat key] + { + get + { + return key.GetValue(_tagMapEntries[key.ID]); + } + } + + public ScriptFormula this[TagKeyScript key] + { + get + { + return key.GetValue(_tagMapEntries[key.ID]); + } + } + + public SNOHandle this[TagKeySNO key] + { + get + { + return key.GetValue(_tagMapEntries[key.ID]); + } + } + + public GizmoGroup this[TagKeyGizmoGroup key] + { + get + { + return key.GetValue(_tagMapEntries[key.ID]); + } + } + + + [Obsolete("Use TagKeys instead. If it is missing create it")] + public TagMapEntry this[int key] + { + get + { + return _tagMapEntries[key]; + } + } + + #endregion + + #region enumurators + + public IEnumerator GetEnumerator() + { + return _tagMapEntries.Values.GetEnumerator(); + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return _tagMapEntries.Values.GetEnumerator(); + } + + #endregion + } + + + public abstract class TagKey + { + public int ID { get; private set; } + public string Name { get; set; } + + public TagKey(int id) { ID = id; } + } + + public class TagKeyInt : TagKey { public TagKeyInt(int id) : base(id) { } public int GetValue(TagMapEntry entry) { return entry.Int; } } + public class TagKeyFloat : TagKey { public TagKeyFloat(int id) : base(id) { } public float GetValue(TagMapEntry entry) { return entry.Float; } } + public class TagKeyScript : TagKey { public TagKeyScript(int id) : base(id) { } public ScriptFormula GetValue(TagMapEntry entry) { return entry.ScriptFormula; } } + public class TagKeySNO : TagKey { public TagKeySNO(int id) : base(id) { } public SNOHandle GetValue(TagMapEntry entry) { return new SNOHandle(entry.Int); } } + + + public class TagMapEntry + { + [PersistentProperty("Type")] + public int Type { get; private set; } + + [PersistentProperty("TagID")] + public int TagID { get; private set; } + + [PersistentProperty("ScriptFormula")] + public ScriptFormula ScriptFormula { get; private set; } + + [PersistentProperty("Int")] + public int Int { get; set; } + + [PersistentProperty("Float")] + public float Float { get; private set; } + + public TagMapEntry() { } + + public TagMapEntry(int tag, int value, int type) + { + Type = type; + TagID = tag; + Int = value; + } + + public override string ToString() + { + List keys = TagMap.GetKeys(TagID); + + if (keys.Count == 0) + switch (Type) + { + case 1: return String.Format("{0} = {1}", TagID.ToString(), Float); + case 4: return String.Format("{0} = {1}", TagID.ToString(), ScriptFormula); + default: return String.Format("{0} = {1}", TagID.ToString(), Int); + } + + if (keys.Count == 1) + { + var value = keys.First().GetType().GetMethod("GetValue").Invoke(keys.First(), new object[] { this }); + return String.Format("{0} = {1}", keys.First().Name, value == null ? "null" : value.ToString()); + } + + return String.Format("Ambigious key: Depending of the context it one of {0}", String.Join(",", keys.Select(x => x.Name).ToArray())); + + } + + public TagMapEntry(MpqFileStream stream) + { + this.Type = stream.ReadValueS32(); + this.TagID = stream.ReadValueS32(); + + switch (this.Type) + { + case 0: + this.Int = stream.ReadValueS32(); + break; + case 1: + Float = stream.ReadValueF32(); + break; + case 2: // SNO + this.Int = stream.ReadValueS32(); + break; + + // TODO: Create strong type for gbid (at least i think they are) + case 3: + this.Int = stream.ReadValueS32(); + break; + + case 4: + this.ScriptFormula = new ScriptFormula(stream); + break; + + // TODO: Strong type for group hashes + case 5: + this.Int = stream.ReadValueS32(); + break; + + // Todo: Strong type for ... hmmm.. is that a gameattributeindex? + case 6: + this.Int = stream.ReadValueS32(); + break; + + // Todo: Strong type fo StartingLocationID + case 7: + this.Int = stream.ReadValueS32(); + break; + + default: + // if this break hits, blizz introduced a new key type and most likey we should have to react to it + System.Diagnostics.Debugger.Break(); + this.Int = stream.ReadValueS32(); + break; + } + } + } +} \ No newline at end of file diff --git a/src/Mooege/Core/GS/Games/Game.cs b/src/Mooege/Core/GS/Games/Game.cs new file mode 100644 index 00000000..9110ede7 --- /dev/null +++ b/src/Mooege/Core/GS/Games/Game.cs @@ -0,0 +1,395 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Concurrent; +using System.Diagnostics; +using System.Globalization; +using System.Linq; +using System.Threading; +using Mooege.Common.Logging; +using Mooege.Core.GS.Objects; +using Mooege.Core.GS.Generators; +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Players; +using Mooege.Net.GS; +using Mooege.Net.GS.Message; +using Mooege.Net.GS.Message.Definitions.Game; +using Mooege.Net.GS.Message.Definitions.Misc; +using Mooege.Net.GS.Message.Definitions.Player; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Core.GS.Games +{ + public class Game : IMessageConsumer + { + private static readonly Logger Logger = LogManager.CreateLogger(); + + /// + /// The game id. + /// + public int GameId { get; private set; } + + /// + /// Dictionary that maps gameclient's to players. + /// + public ConcurrentDictionary Players { get; private set; } + + /// + /// Dictionary that tracks objects and maps them to dynamicId's. + /// + private readonly ConcurrentDictionary _objects; + + /// + /// Dictionary that tracks world. + /// NOTE: This tracks by WorldSNO rather than by DynamicID; this.Objects _does_ still contain the world since it is a DynamicObject + /// + private readonly ConcurrentDictionary _worlds; + + /// + /// Starting world's sno id. + /// + public int StartingWorldSNOId { get; private set; } + + /// + /// Starting world for the game. + /// + public World StartingWorld { get { return GetWorld(this.StartingWorldSNOId); } } + + /// + /// Player index counter. + /// + public int PlayerIndexCounter = -1; + + /// + /// Update frequency for the game - 100 ms. + /// + public readonly long UpdateFrequency = 100; + + /// + /// Incremented tick value on each Game.Update(). + /// + public readonly int TickRate = 6; + + /// + /// Tick counter. + /// + private int _tickCounter; + + /// + /// Returns the latest tick count. + /// + public int TickCounter + { + get { return _tickCounter; } + } + + /// + /// Stopwatch that measures time takent to get a full Game.Update(). + /// + private readonly Stopwatch _tickWatch; + + /// + /// DynamicId counter for objects. + /// + private uint _lastObjectID = 0x00000001; + + /// + /// Returns a new dynamicId for objects. + /// + public uint NewObjectID { get { return _lastObjectID++; } } + + /// + /// DynamicId counter for scene. + /// + private uint _lastSceneID = 0x04000000; + + /// + /// Returns a new dynamicId for scenes. + /// + public uint NewSceneID { get { return _lastSceneID++; } } + + /// + /// DynamicId counter for worlds. + /// + private uint _lastWorldID = 0x07000000; + + /// + /// Returns a new dynamicId for worlds. + /// + public uint NewWorldID { get { return _lastWorldID++; } } + + public QuestManager Quests { get; private set; } + public AI.Pather Pathfinder { get; private set; } + + /// + /// Creates a new game with given gameId. + /// + /// + public Game(int gameId) + { + this.GameId = gameId; + this.Players = new ConcurrentDictionary(); + this._objects = new ConcurrentDictionary(); + this._worlds = new ConcurrentDictionary(); + this.StartingWorldSNOId = 71150; // FIXME: This must be set according to the game settings (start quest/act). Better yet, track the player's save point and toss this stuff. /komiga + this.Quests = new QuestManager(this); + + this._tickWatch = new Stopwatch(); + var loopThread = new Thread(Update) { IsBackground = true, CurrentCulture = CultureInfo.InvariantCulture }; ; // create the game update thread. + loopThread.Start(); + Pathfinder = new Mooege.Core.GS.AI.Pather(this); //Creates the "Game"s single Pathfinder thread, Probably could be pushed further up and have a single thread handling all path req's for all running games. - DarkLotus + var patherThread = new Thread(Pathfinder.UpdateLoop) { IsBackground = true, CurrentCulture = CultureInfo.InvariantCulture }; + patherThread.Start(); + } + + #region update & tick managment + + /// + /// The main game loop. + /// + public void Update() + { + while (true) + { + this._tickWatch.Restart(); + Interlocked.Add(ref this._tickCounter, this.TickRate); // +6 ticks per 100ms. Verified by setting LogoutTickTimeMessage.Ticks to 600 which eventually renders a 10 sec logout timer on client. /raist + + // Lock Game instance to prevent incoming messages from modifying state while updating + lock (this) + { + // only update worlds with active players in it - so mob brain()'s in empty worlds doesn't get called and take actions for nothing. /raist. + foreach (var pair in this._worlds.Where(pair => pair.Value.HasPlayersIn)) + { + pair.Value.Update(this._tickCounter); + } + } + + this._tickWatch.Stop(); + + var compensation = (int)(this.UpdateFrequency - this._tickWatch.ElapsedMilliseconds); // the compensation value we need to sleep in order to get consistent 100 ms Game.Update(). + + if (this._tickWatch.ElapsedMilliseconds > this.UpdateFrequency) + Logger.Warn("Game.Update() took [{0}ms] more than Game.UpdateFrequency [{1}ms].", this._tickWatch.ElapsedMilliseconds, this.UpdateFrequency); // TODO: We may need to eventually use dynamic tickRate / updateFrenquencies. /raist. + else + Thread.Sleep(compensation); // sleep until next Update(). + } + } + + #endregion + + #region game-message handling & routing + + /// + /// Routers incoming GameMessage to it's proper consumer. + /// + /// + /// + public void Route(GameClient client, GameMessage message) + { + lock (this) + { + try + { + switch (message.Consumer) + { + case Consumers.Game: + this.Consume(client, message); + break; + case Consumers.Inventory: + client.Player.Inventory.Consume(client, message); + break; + case Consumers.Player: + client.Player.Consume(client, message); + break; + + case Consumers.Conversations: + client.Player.Conversations.Consume(client, message); + break; + + case Consumers.SelectedNPC: + if (client.Player.SelectedNPC != null) + client.Player.SelectedNPC.Consume(client, message); + break; + + } + } + catch (Exception e) + { + Logger.DebugException(e, "Unhandled exception caught:"); + } + } + } + + public void Consume(GameClient client, GameMessage message) + { } // for possile future messages consumed by game. /raist. + + #endregion + + #region player-handling + + /// + /// Allows a player to join the game. + /// + /// The new player. + public void Enter(Player joinedPlayer) + { + this.Players.TryAdd(joinedPlayer.InGameClient, joinedPlayer); + + // send all players in the game to new player that just joined (including him) + foreach (var pair in this.Players) + { + this.SendNewPlayerMessage(joinedPlayer, pair.Value); + } + + // notify other players about our new player too. + foreach (var pair in this.Players.Where(pair => pair.Value != joinedPlayer)) + { + this.SendNewPlayerMessage(pair.Value, joinedPlayer); + } + + joinedPlayer.InGameClient.SendMessage(new GameSyncedDataMessage + { + Field0 = new GameSyncedData + { + Field0 = 0x0, + Field1 = 0x0, + Field2 = 0x0, + Field3 = 0x0, + Field4 = 0x0, + Field5 = 0x0, + Field6 = 0x0, + Field7 = new[] { 0x0, 0x0 }, + Field8 = new[] { 0x0, 0x0 } + } + }); + + //joinedPlayer.EnterWorld(this.StartingWorld.StartingPoints.First().Position); + joinedPlayer.EnterWorld(this.StartingWorld.StartingPoints.Find(x => x.ActorSNO.Name == "Start_Location_Team_0").Position); + + joinedPlayer.InGameClient.TickingEnabled = true; // it seems bnet-servers only start ticking after player is completely in-game. /raist + } + + /// + /// Sends NewPlayerMessage to players when a new player joins the game. + /// + /// Target player to send the message. + /// The new joined player. + private void SendNewPlayerMessage(Player target, Player joinedPlayer) + { + target.InGameClient.SendMessage(new NewPlayerMessage + { + PlayerIndex = joinedPlayer.PlayerIndex, // player index + ToonId = new EntityId() { High = (long)joinedPlayer.Toon.D3EntityID.IdHigh, Low = (long)joinedPlayer.Toon.D3EntityID.IdLow }, //Toon + GameAccountId = new EntityId() { High = (long)joinedPlayer.Toon.GameAccount.BnetEntityId.High, Low = (long)joinedPlayer.Toon.GameAccount.BnetEntityId.Low }, //GameAccount + ToonName = joinedPlayer.Toon.Name, + Field3 = 0x00000002, //party frame class + Field4 = target != joinedPlayer ? 0x2 : 0x4, //party frame level /boyc - may mean something different /raist. + snoActorPortrait = joinedPlayer.ClassSNO, //party frame portrait + Field6 = joinedPlayer.Toon.Level, + StateData = joinedPlayer.GetStateData(), + Field8 = this.Players.Count != 1, //announce party join + Field9 = 0x00000001, + ActorID = joinedPlayer.DynamicID, + }); + + target.InGameClient.SendMessage(joinedPlayer.GetPlayerBanner()); // send player banner proto - D3.GameMessage.PlayerBanner + target.InGameClient.SendMessage(joinedPlayer.GetBlacksmithData()); // send player artisan proto /fasbat + target.InGameClient.SendMessage(joinedPlayer.GetJewelerData()); + target.InGameClient.SendMessage(joinedPlayer.GetMysticData()); + } + + #endregion + + #region object dynamicId tracking + + public void StartTracking(DynamicObject obj) + { + if (obj.DynamicID == 0 || IsTracking(obj)) + throw new Exception(String.Format("Object has an invalid ID or was already being tracked (ID = {0})", obj.DynamicID)); + this._objects.TryAdd(obj.DynamicID, obj); + } + + public void EndTracking(DynamicObject obj) + { + if (obj.DynamicID == 0 || !IsTracking(obj)) + throw new Exception(String.Format("Object has an invalid ID or was not being tracked (ID = {0})", obj.DynamicID)); + + DynamicObject removed; + this._objects.TryRemove(obj.DynamicID, out removed); + } + + public DynamicObject GetObject(uint dynamicID) + { + DynamicObject obj; + this._objects.TryGetValue(dynamicID, out obj); + return obj; + } + + public bool IsTracking(uint dynamicID) + { + return this._objects.ContainsKey(dynamicID); + } + + public bool IsTracking(DynamicObject obj) + { + return this._objects.ContainsKey(obj.DynamicID); + } + + #endregion + + #region world collection + + public void AddWorld(World world) + { + if (world.WorldSNO.Id == -1 || WorldExists(world.WorldSNO.Id)) + throw new Exception(String.Format("World has an invalid SNO or was already being tracked (ID = {0}, SNO = {1})", world.DynamicID, world.WorldSNO.Id)); + this._worlds.TryAdd(world.WorldSNO.Id, world); + } + + public void RemoveWorld(World world) + { + if (world.WorldSNO.Id == -1 || !WorldExists(world.WorldSNO.Id)) + throw new Exception(String.Format("World has an invalid SNO or was not being tracked (ID = {0}, SNO = {1})", world.DynamicID, world.WorldSNO.Id)); + + World removed; + this._worlds.TryRemove(world.WorldSNO.Id, out removed); + } + + public World GetWorld(int worldSNO) + { + World world; + this._worlds.TryGetValue(worldSNO, out world); + + if (world == null) // If it doesn't exist, try to load it + { + world = WorldGenerator.Generate(this, worldSNO); + if (world == null) Logger.Warn("Failed to generate world with sno: {0}", worldSNO); + } + return world; + } + + public bool WorldExists(int worldSNO) + { + return this._worlds.ContainsKey(worldSNO); + } + + #endregion + + } +} diff --git a/src/Mooege/Core/GS/Games/GameCommands.cs b/src/Mooege/Core/GS/Games/GameCommands.cs new file mode 100644 index 00000000..8724902e --- /dev/null +++ b/src/Mooege/Core/GS/Games/GameCommands.cs @@ -0,0 +1,575 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Linq; +using System.Threading; +using System.Windows.Forms; +using Mooege.Common.Helpers; +using Mooege.Common.Helpers.Math; +using Mooege.Common.MPQ; +using Mooege.Common.MPQ.FileFormats; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Core.GS.Items; +using Mooege.Core.GS.Map; +using Mooege.Core.MooNet.Commands; +using Mooege.Core.MooNet.Games; +using Mooege.Net.GS.Message.Definitions.Inventory; +using Mooege.Net.MooNet; +using System.Text; +using Monster = Mooege.Core.GS.Actors.Monster; + +namespace Mooege.Core.GS.Games +{ + [CommandGroup("tp", "Transfers your character to another world.")] + public class TeleportCommand : CommandGroup + { + [DefaultCommand] + public string Portal(string[] @params, MooNetClient invokerClient) + { + if (invokerClient == null) + return "You can not invoke this command from console."; + + if (invokerClient.InGameClient == null) + return "You can only invoke this command while ingame."; + + if (@params != null && @params.Count() > 0) + { + var worldId = 0; + Int32.TryParse(@params[0], out worldId); + + if (worldId == 0) + return "Invalid arguments. Type 'help tp' to get help."; + + if (!MPQStorage.Data.Assets[SNOGroup.Worlds].ContainsKey(worldId)) + return "There exist no world with SNOId: " + worldId; + + var world = invokerClient.InGameClient.Game.GetWorld(worldId); + + if (world == null) + return "Can't teleport you to world with snoId " + worldId; + + invokerClient.InGameClient.Player.ChangeWorld(world, world.StartingPoints.First().Position); + return string.Format("Teleported to: {0} [id: {1}]", MPQStorage.Data.Assets[SNOGroup.Worlds][worldId].Name, worldId); + } + + return "Invalid arguments. Type 'help tp' to get help."; + } + } + + [CommandGroup("allskills", "Activates all skills.")] + public class AllSkillsCommand : CommandGroup + { + [DefaultCommand] + public string Portal(string[] @params, MooNetClient invokerClient) + { + if (invokerClient == null) + return "You can not invoke this command from console."; + + if (invokerClient.InGameClient == null) + return "You can only invoke this command while ingame."; + + invokerClient.InGameClient.Player.EnableStoneOfRecall(); + + return string.Format("Done"); + } + } + + + [CommandGroup("town", "Transfers your character back to town.")] + public class TownCommand : CommandGroup + { + [DefaultCommand] + public string Portal(string[] @params, MooNetClient invokerClient) + { + if (invokerClient == null) + return "You can not invoke this command from console."; + + if (invokerClient.InGameClient == null) + return "You can only invoke this command while ingame."; + + var world = invokerClient.InGameClient.Game.GetWorld(71150); + + if (world != invokerClient.InGameClient.Player.World) + invokerClient.InGameClient.Player.ChangeWorld(world, world.StartingPoints.First().Position); + else + invokerClient.InGameClient.Player.Teleport(world.StartingPoints.First().Position); + + return string.Format("Teleported back to town."); + } + } + + [CommandGroup("spawn", "Spawns a mob.\nUsage: spawn [amount] [actorSNO]")] + public class SpawnCommand : CommandGroup + { + [DefaultCommand] + public string Spawn(string[] @params, MooNetClient invokerClient) + { + if (invokerClient == null) + return "You can not invoke this command from console."; + + if (invokerClient.InGameClient == null) + return "You can only invoke this command while ingame."; + + var player = invokerClient.InGameClient.Player; + var actorSNO = 6652; /* zombie */ + var amount = 1; + + + if (@params != null) + { + if (!Int32.TryParse(@params[0], out amount)) + amount = 1; + + if (amount > 100) amount = 100; + + if (@params.Count() > 1) + if (!Int32.TryParse(@params[1], out actorSNO)) + actorSNO = 6652; + } + + for (int i = 0; i < amount; i++) + { + var position = new Vector3D(player.Position.X + (float)RandomHelper.NextDouble() * 20f, + player.Position.Y + (float)RandomHelper.NextDouble() * 20f, + player.Position.Z); + + player.World.SpawnMonster(actorSNO, position); + } + + return string.Format("Spawned {0} mobs with ActorSNO: {1}", amount, actorSNO); + } + } + + //[CommandGroup("killall", "Kills monsters in range.")] + //public class KillAllCommand : CommandGroup + //{ + // [DefaultCommand] + // public string KillAll(string[] @params, MooNetClient invokerClient) + // { + // if (invokerClient == null) + // return "You can not invoke this command from console."; + + // if (invokerClient.InGameClient == null) + // return "You can only invoke this command while ingame."; + + // var player = invokerClient.InGameClient.Player; + + // var monstersInRange = player.GetActorsInRange(); + // foreach (var monster in monstersInRange) + // { + // monster.Die(player); + // } + + // return string.Format("Killed {0} monsters in range.", monstersInRange.Count); + // } + //} + + [CommandGroup("levelup", "Levels your character.\nOptionally specify the number of levels: !levelup [count]")] + public class LevelUpCommand : CommandGroup + { + [DefaultCommand] + public string LevelUp(string[] @params, MooNetClient invokerClient) + { + if (invokerClient == null) + return "You can not invoke this command from console."; + + if (invokerClient.InGameClient == null) + return "You can only invoke this command while ingame."; + + var player = invokerClient.InGameClient.Player; + var amount = 1; + + if (@params != null) + { + if (!Int32.TryParse(@params[0], out amount)) + amount = 1; + } + + for (int i = 0; i < amount; i++) + { + player.UpdateExp(player.Attributes[Net.GS.Message.GameAttribute.Experience_Next]); + } + + player.Toon.GameAccount.NotifyUpdate(); + return string.Format("New level: {0}", player.Toon.Level); + } + } + + [CommandGroup("item", "Spawns an item (with a name or type).\nUsage: item [type |] [amount]")] + public class ItemCommand : CommandGroup + { + [DefaultCommand] + public string Spawn(string[] @params, MooNetClient invokerClient) + { + if (invokerClient == null) + return "You can not invoke this command from console."; + + if (invokerClient.InGameClient == null) + return "You can only invoke this command while ingame."; + + var player = invokerClient.InGameClient.Player; + var name = "Dye_02"; + var amount = 1; + + + if (@params == null) + return this.Fallback(); + + name = @params[0]; + + if (!ItemGenerator.IsValidItem(name)) + return "You need to specify a valid item name!"; + + + if (@params.Count() == 1 || !Int32.TryParse(@params[1], out amount)) + amount = 1; + + if (amount > 100) amount = 100; + + for (int i = 0; i < amount; i++) + { + var position = new Vector3D(player.Position.X + (float)RandomHelper.NextDouble() * 20f, + player.Position.Y + (float)RandomHelper.NextDouble() * 20f, + player.Position.Z); + + var item = ItemGenerator.Cook(player, name); + item.EnterWorld(position); + } + + return string.Format("Spawned {0} items with name: {1}", amount, name); + + } + + [Command("type", "Spawns random items of a given type.\nUsage: item type [amount]")] + public string Type(string[] @params, MooNetClient invokerClient) + { + if (invokerClient == null) + return "You can not invoke this command from console."; + + if (invokerClient.InGameClient == null) + return "You can only invoke this command while ingame."; + + var player = invokerClient.InGameClient.Player; + var name = "Dye"; + var amount = 1; + + + if (@params == null) + return "You need to specify a item type!"; + + name = @params[0]; + + var type = ItemGroup.FromString(name); + + if (type == null) + return "The type given is not a valid item type."; + + if (@params.Count() == 1 || !Int32.TryParse(@params[1], out amount)) + amount = 1; + + if (amount > 100) amount = 100; + + for (int i = 0; i < amount; i++) + { + var position = new Vector3D(player.Position.X + (float)RandomHelper.NextDouble() * 20f, + player.Position.Y + (float)RandomHelper.NextDouble() * 20f, + player.Position.Z); + + var item = ItemGenerator.GenerateRandom(player, type); + item.EnterWorld(position); + } + + return string.Format("Spawned {0} items with type: {1}", amount, name); + } + + [Command("dropall", "Drops all items in Backpack.\nUsage: item dropall")] + public string DropAll(string[] @params, MooNetClient invokerClient) + { + if (invokerClient == null) + return "You can not invoke this command from console."; + + if (invokerClient.InGameClient == null) + return "You can only invoke this command while ingame."; + + var player = invokerClient.InGameClient.Player; + + var bpItems = new List(player.Inventory.GetBackPackItems()); + + + foreach (var item in bpItems) + { + var msg = new InventoryDropItemMessage { ItemID = item.DynamicID }; + player.Inventory.Consume(invokerClient.InGameClient, msg); + } + return string.Format("Dropped {0} Items for you", bpItems.Count); + } + } + + [CommandGroup("conversation", "Starts a conversation. \n Usage: conversation snoConversation")] + public class ConversationCommand : CommandGroup + { + [DefaultCommand] + public string Conversation(string[] @params, MooNetClient invokerClient) + { + if (invokerClient == null) + return "You can not invoke this command from console."; + + if (invokerClient.InGameClient == null) + return "You can only invoke this command while ingame."; + + if (@params.Count() != 1) + return "Invalid arguments. Type 'help conversation' to get help."; + + try + { + var conversation = MPQStorage.Data.Assets[SNOGroup.Conversation][Int32.Parse(@params[0])]; + invokerClient.InGameClient.Player.Conversations.StartConversation(Int32.Parse(@params[0])); + return String.Format("Started conversation {0}", conversation.FileName); + } + catch (Exception e) + { + return e.Message; + } + } + } + + + [CommandGroup("quest", "Retrieves information about quest states and manipulates quest progress.\n Usage: quest [triggers | trigger eventType eventValue | advance snoQuest]")] + public class QuestCommand : CommandGroup + { + [DefaultCommand] + public string Quest(string[] @params, MooNetClient invokerClient) + { + if (invokerClient == null) + return "You can not invoke this command from console."; + + if (invokerClient.InGameClient == null) + return "You can only invoke this command while ingame."; + + return ""; + } + + [Command("advance", "Advances a quest by a single step\n Usage advance snoQuest")] + public string Advance(string[] @params, MooNetClient invokerClient) + { + if (@params == null) + return this.Fallback(); + + if (@params.Count() != 1) + return "Invalid arguments. Type 'help lookup advance' to get help."; + + try + { + var quest = MPQStorage.Data.Assets[SNOGroup.Quest][Int32.Parse(@params[0])]; + invokerClient.InGameClient.Game.Quests.Advance(Int32.Parse(@params[0])); + return String.Format("Advancing quest {0}", quest.FileName); + } + catch (Exception e) + { + return e.Message; + } + } + + [Command("trigger", "Triggers a single quest objective\n Usage trigger type value")] + public string Trigger(string[] @params, MooNetClient invokerClient) + { + if (@params == null) + return this.Fallback(); + + if (@params.Count() < 2) + return "Invalid arguments. Type 'help lookup trigger' to get help."; + + invokerClient.InGameClient.Game.Quests.Notify((Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType)Int32.Parse(@params[0]), Int32.Parse(@params[1])); + return "Triggered"; + } + + [Command("triggers", "lists all current quest triggers")] + public string Triggers(string[] @params, MooNetClient invokerClient) + { + StringBuilder returnValue = new StringBuilder(); + + foreach (var quest in invokerClient.InGameClient.Game.Quests) + foreach (var objectiveSet in quest.CurrentStep.ObjectivesSets) + foreach (var objective in objectiveSet.Objectives) + returnValue.AppendLine(String.Format("{0}, {1} ({2}) - {3}", quest.SNOHandle.ToString(), objective.ObjectiveType, (int)objective.ObjectiveType, objective.ObjectiveValue)); + + return returnValue.ToString(); + } + + } + + + [CommandGroup("lookup", "Searches in sno databases.\nUsage: lookup [actor|npc|mob|power|scene] ")] + public class LookupCommand : CommandGroup + { + [DefaultCommand] + public string Search(string[] @params, MooNetClient invokerClient) + { + if (@params == null) + return this.Fallback(); + + var matches = new List(); + + if (@params.Count() < 1) + return "Invalid arguments. Type 'help lookup actor' to get help."; + + var pattern = @params[0].ToLower(); + + foreach (var groupPair in MPQStorage.Data.Assets) + { + foreach (var pair in groupPair.Value) + { + if (pair.Value.Name.ToLower().Contains(pattern)) + matches.Add(pair.Value); + } + } + + return matches.Aggregate(matches.Count >= 1 ? "Matches:\n" : "No matches found.", + (current, match) => current + string.Format("[{0}] [{1}] {2}\n", match.SNOId.ToString("D6"), match.Group, match.Name)); + } + + [Command("actor", "Allows you to search for an actor.\nUsage: lookup actor ")] + public string Actor(string[] @params, MooNetClient invokerClient) + { + var matches = new List(); + + if (@params.Count() < 1) + return "Invalid arguments. Type 'help lookup actor' to get help."; + + var pattern = @params[0].ToLower(); + + foreach (var pair in MPQStorage.Data.Assets[SNOGroup.Actor]) + { + if (pair.Value.Name.ToLower().Contains(pattern)) + matches.Add(pair.Value); + } + + return matches.Aggregate(matches.Count >= 1 ? "Actor Matches:\n" : "No match found.", + (current, match) => current + string.Format("[{0}] {1}\n", match.SNOId.ToString("D6"), match.Name)); + } + + [Command("monster", "Allows you to search for a monster.\nUsage: lookup monster ")] + public string Monster(string[] @params, MooNetClient invokerClient) + { + var matches = new List(); + + if (@params.Count() < 1) + return "Invalid arguments. Type 'help lookup monster' to get help."; + + var pattern = @params[0].ToLower(); + + foreach (var pair in MPQStorage.Data.Assets[SNOGroup.Monster]) + { + if (pair.Value.Name.ToLower().Contains(pattern)) + matches.Add(pair.Value); + } + + return matches.Aggregate(matches.Count >= 1 ? "Monster Matches:\n" : "No match found.", + (current, match) => current + string.Format("[{0}] {1}\n", match.SNOId.ToString("D6"), match.Name)); + } + + [Command("power", "Allows you to search for a power.\nUsage: lookup power ")] + public string Power(string[] @params, MooNetClient invokerClient) + { + var matches = new List(); + + if (@params.Count() < 1) + return "Invalid arguments. Type 'help lookup power' to get help."; + + var pattern = @params[0].ToLower(); + + foreach (var pair in MPQStorage.Data.Assets[SNOGroup.Power]) + { + if (pair.Value.Name.ToLower().Contains(pattern)) + matches.Add(pair.Value); + } + + return matches.Aggregate(matches.Count >= 1 ? "Power Matches:\n" : "No match found.", + (current, match) => current + string.Format("[{0}] {1}\n", match.SNOId.ToString("D6"), match.Name)); + } + + [Command("world", "Allows you to search for a world.\nUsage: lookup world ")] + public string World(string[] @params, MooNetClient invokerClient) + { + var matches = new List(); + + if (@params.Count() < 1) + return "Invalid arguments. Type 'help lookup world' to get help."; + + var pattern = @params[0].ToLower(); + + foreach (var pair in MPQStorage.Data.Assets[SNOGroup.Worlds]) + { + if (pair.Value.Name.ToLower().Contains(pattern)) + matches.Add(pair.Value); + } + + return matches.Aggregate(matches.Count >= 1 ? "World Matches:\n" : "No match found.", + (current, match) => current + string.Format("[{0}] {1}\n", match.SNOId.ToString("D6"), match.Name)); + } + + [Command("scene", "Allows you to search for a scene.\nUsage: lookup scene ")] + public string Scene(string[] @params, MooNetClient invokerClient) + { + var matches = new List(); + + if (@params.Count() < 1) + return "Invalid arguments. Type 'help lookup scene' to get help."; + + var pattern = @params[0].ToLower(); + + foreach (var pair in MPQStorage.Data.Assets[SNOGroup.Scene]) + { + if (pair.Value.Name.ToLower().Contains(pattern)) + matches.Add(pair.Value); + } + + return matches.Aggregate(matches.Count >= 1 ? "Scene Matches:\n" : "No match found.", + (current, match) => current + string.Format("[{0}] {1}\n", match.SNOId.ToString("D6"), match.Name)); + } + + [Command("item", "Allows you to search for an item.\nUsage: lookup item ")] + public string Item(string[] @params, MooNetClient invokerClient) + { + var matches = new List(); + + if (@params.Count() < 1) + return "Invalid arguments. Type 'help lookup item' to get help."; + + var pattern = @params[0].ToLower(); + + foreach (var asset in MPQStorage.Data.Assets[SNOGroup.GameBalance].Values) + { + var data = asset.Data as GameBalance; + if (data == null || data.Type != BalanceType.Items) continue; + + foreach (var itemDefinition in data.Item) + { + if (itemDefinition.Name.ToLower().Contains(pattern)) + matches.Add(itemDefinition); + } + } + return matches.Aggregate(matches.Count >= 1 ? "Item Matches:\n" : "No match found.", + (current, match) => current + string.Format("[{0}] {1}\n", match.SNOActor.ToString("D6"), match.Name)); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Core/GS/Games/GameDebugCommands.cs b/src/Mooege/Core/GS/Games/GameDebugCommands.cs new file mode 100644 index 00000000..e54ef641 --- /dev/null +++ b/src/Mooege/Core/GS/Games/GameDebugCommands.cs @@ -0,0 +1,170 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Threading; +using System.Windows.Forms; +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Map.Debug; +using Mooege.Core.GS.Players; +using Mooege.Core.MooNet.Commands; +using Mooege.Net.MooNet; + +namespace Mooege.Core.GS.Games +{ + [CommandGroup("Debug", "Ingame debug commands.")] + public class GameDebugCommands : CommandGroup + { + // [Command("position", "Returns the position of the player\nUsage: debug position [player@email]")] + // public string Position(string[] @params, MooNetClient invokerClient) + // { + // Player player; + + // if (invokerClient != null && invokerClient.InGameClient != null) + // player = invokerClient.InGameClient.Player; + // else + // { + // if (@params.Count() < 1) + // return "Invalid arguments. Type 'help debug position' to get help."; + + // var account = AccountManager.GetAccountByEmail(@params[0]); + // if(account==null) + // return string.Format("No account with email: {0} exists.", @params[0]); + + // if(account.LoggedInClient==null || account.LoggedInClient.InGameClient==null) + // return string.Format("Account {0} is not in-game.", @params[0]); + + // player = account.LoggedInClient.InGameClient.Player; + // } + + // return string.Format("Player position: {0}", player.Position); + // } + + // [Command("revealed", "Lists revealed objects to player\nUsage: debug revealed [player@email]")] + // public string Revealed(string[] @params, MooNetClient invokerClient) + // { + // Player player; + + // if (invokerClient != null && invokerClient.InGameClient != null) + // player = invokerClient.InGameClient.Player; + // else + // { + // if (@params.Count() < 1) + // return "Invalid arguments. Type 'help debug revealed' to get help."; + + // var account = AccountManager.GetAccountByEmail(@params[0]); + // if(account==null) + // return string.Format("No account with email: {0} exists.", @params[0]); + + // if(account.LoggedInClient==null || account.LoggedInClient.InGameClient==null) + // return string.Format("Account {0} is not in-game.", @params[0]); + + // player = account.LoggedInClient.InGameClient.Player; + // } + + // var output = new StringBuilder("Revealed objects:" + Environment.NewLine); + + // foreach(var @object in player.RevealedObjects.Values) + // { + // output.Append(@object + Environment.NewLine); + // } + + // return output.ToString(); + // } + + // [Command("inrange", "Lists objects in range of player\nUsage: debug inrange [player@email]")] + // public string InRange(string[] @params, MooNetClient invokerClient) + // { + // Player player; + + // if (invokerClient != null && invokerClient.InGameClient != null) + // player = invokerClient.InGameClient.Player; + // else + // { + // if (@params.Count() < 1) + // return "Invalid arguments. Type 'help debug inrange' to get help."; + + // var account = AccountManager.GetAccountByEmail(@params[0]); + // if (account == null) + // return string.Format("No account with email: {0} exists.", @params[0]); + + // if (account.LoggedInClient == null || account.LoggedInClient.InGameClient == null) + // return string.Format("Account {0} is not in-game.", @params[0]); + + // player = account.LoggedInClient.InGameClient.Player; + // } + + // var output = new StringBuilder("Scenes In Range:" + Environment.NewLine); + + // foreach (var scene in player.GetScenesInRange()) + // { + // output.Append(scene + Environment.NewLine); + // } + + // output.Append("Actors In Range:" + Environment.NewLine); + + // foreach (var actor in player.GetActorsInRange()) + // { + // output.Append(actor + Environment.NewLine); + // } + + // return output.ToString(); + // } + + [CommandGroup("draw", "Draws current world's visualization.\nUsage: draw [worldId]")] + public class DrawCommand : CommandGroup + { + [DefaultCommand] + public string DrawWorld(string[] @params, MooNetClient invokerClient) + { + if (invokerClient == null && @params == null) + return "Invalid arguments. Type 'help draw' to get help."; + + World world; + Player player = null; + int worldId; + + if (@params == null) + { + if (invokerClient.InGameClient == null || invokerClient.InGameClient.Player == null) + return "Invalid arguments. Type 'help draw' to get help."; + + player = invokerClient.InGameClient.Player; + world = invokerClient.InGameClient.Player.World; + worldId = world.WorldSNO.Id; + } + else + { + if (!Int32.TryParse(@params[0], out worldId)) + worldId = 71150; + + var game = GameManager.CreateGame(worldId); // hack-hack /raist. + world = game.GetWorld(worldId); + } + + if (world != null) + { + new Thread(c => Application.Run(new WorldVisualizer(world, player))).Start(); + return string.Format("Done visualizing world {0}.", worldId); + } + + return string.Format("Invalid world id: {0}.", worldId); + } + } + } +} diff --git a/src/Mooege/Core/GS/Games/GameManager.cs b/src/Mooege/Core/GS/Games/GameManager.cs new file mode 100644 index 00000000..7ea9fc20 --- /dev/null +++ b/src/Mooege/Core/GS/Games/GameManager.cs @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using Mooege.Common.Extensions; +using Mooege.Common.Logging; +using Mooege.Core.GS.Players; +using Mooege.Core.MooNet.Toons; +using Mooege.Net.GS.Message; + +namespace Mooege.Core.GS.Games +{ + public static class GameManager + { + private static readonly Logger Logger = LogManager.CreateLogger(); + private static readonly Dictionary Games = new Dictionary(); + + public static Game CreateGame(int gameId) + { + if (Games.ContainsKey(gameId)) + return Games[gameId]; + + var game = new Game(gameId); + Games.Add(gameId, game); + return game; + } + + public static Game GetGameById(int gameId) + { + return !Games.ContainsKey(gameId) ? null : Games[gameId]; + } + + public static void RemovePlayerFromGame(Net.GS.GameClient gameClient) + { + if (gameClient == null || gameClient.Game == null) return; + + var gameId = gameClient.Game.GameId; + if (!Games.ContainsKey(gameId)) return; + + var game = Games[gameId]; + if (!game.Players.ContainsKey(gameClient)) return; + + Player p = null; + if (!game.Players.TryRemove(gameClient, out p)) + { + Logger.Error("Can't remove player ({0}) from game with id: {1}", gameClient.Player.Toon.Name, gameId); + } + + if (p != null) + { + //TODO: Move this inside player OnLeave event + var toon = p.Toon; + toon.TimePlayed += DateTimeExtensions.ToUnixTime(DateTime.UtcNow) - toon.LoginTime; + toon.ExperienceNext = p.Attributes[GameAttribute.Experience_Next]; + + // Remove Player From World + if (p.InGameClient != null) + p.World.Leave(p); + + // Generate Update for Client + gameClient.BnetClient.Account.CurrentGameAccount.NotifyUpdate(); + //save hero to db after player data was updated in toon + ToonManager.SaveToDB(toon); + } + + if (game.Players.Count == 0) + { + Games.Remove(gameId); // we should be also disposing it /raist. + } + } + } +} diff --git a/src/Mooege/Core/GS/Games/Quest.cs b/src/Mooege/Core/GS/Games/Quest.cs new file mode 100644 index 00000000..a45fd4d1 --- /dev/null +++ b/src/Mooege/Core/GS/Games/Quest.cs @@ -0,0 +1,224 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using Mooege.Net.GS.Message.Definitions.Quest; +using Mooege.Core.GS.Common.Types.SNO; + +namespace Mooege.Core.GS.Games +{ + public interface QuestProgressHandler + { + void Notify(Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType type, int value); + } + + public class Quest : QuestProgressHandler + { + /// + /// Keeps track of a single quest step + /// + public class QuestStep : QuestProgressHandler + { + /// + /// Keeps track of a single quest step objective + /// + public class QuestObjective : QuestProgressHandler + { + public int Counter { get; private set; } + public bool Done { get { return (objective.CounterTarget == 0 && Counter > 0) || Counter == objective.CounterTarget; } } + public int ID { get; private set; } + + // these are only needed to show information in console + public Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType ObjectiveType { get { return objective.ObjectiveType; } } + public int ObjectiveValue { get { return objective.SNOName1.Id; } } + + private Mooege.Common.MPQ.FileFormats.QuestStepObjective objective; + private QuestStep questStep; + + public QuestObjective(Mooege.Common.MPQ.FileFormats.QuestStepObjective objective, QuestStep questStep, int id) + { + ID = id; + this.objective = objective; + this.questStep = questStep; + } + + /// + /// Notifies the objective, that an event occured. The objective checks if that event matches the event it waits for + /// + public void Notify(Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType type, int value) + { + if (type != objective.ObjectiveType) return; + switch (type) + { + case Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType.EnterWorld: + case Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType.EnterScene: + case Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType.InteractWithActor: + case Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType.KillMonster: + case Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType.CompleteQuest: + case Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType.HadConversation: + case Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType.EnterLevelArea: + if (value == objective.SNOName1.Id) + { + Counter++; + questStep.UpdateCounter(this); + } + break; + + case Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType.EnterTrigger: + case Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType.EventReceived: + case Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType.GameFlagSet: + case Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType.KillGroup: + case Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType.PlayerFlagSet: + case Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType.PossessItem: + case Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType.TimedEventExpired: + throw new NotImplementedException(); + } + } + } + + // this is only public for GameCommand / Debug + public struct ObjectiveSet + { + public List Objectives; + public int FollowUpStepID; + } + + public List ObjectivesSets = new List(); // this is only public for GameCommand / Debug + private List> bonusObjectives = new List>(); + private Mooege.Common.MPQ.FileFormats.IQuestStep _questStep = null; + private Quest _quest = null; + public int QuestStepID { get { return _questStep.ID; } } + + private void UpdateCounter(QuestObjective objective) + { + if (_questStep is Mooege.Common.MPQ.FileFormats.QuestUnassignedStep == false) + { + foreach (var player in _quest.game.Players.Values) + player.InGameClient.SendMessage(new QuestCounterMessage() + { + snoQuest = _quest.SNOHandle.Id, + snoLevelArea = -1, + StepID = _questStep.ID, + TaskIndex = objective.ID, + Counter = objective.Counter, + Checked = objective.Done ? 1 : 0, + }); + } + + var completedObjectiveList = from objectiveSet in ObjectivesSets + where (from o in objectiveSet.Objectives select o.Done).Aggregate((r, o) => r && o) + select objectiveSet.FollowUpStepID; + if (completedObjectiveList.Count() > 0) + _quest.StepCompleted(completedObjectiveList.First()); + } + + /// + /// Debug method, completes a given objective set + /// + /// + public void CompleteObjectiveSet(int index) + { + _quest.StepCompleted(_questStep.StepObjectiveSets[index].FollowUpStepID); + } + + public QuestStep(Mooege.Common.MPQ.FileFormats.IQuestStep assetQuestStep, Quest quest) + { + _questStep = assetQuestStep; + _quest = quest; + int c = 0; + + foreach (var objectiveSet in assetQuestStep.StepObjectiveSets) + ObjectivesSets.Add(new ObjectiveSet() + { + FollowUpStepID = objectiveSet.FollowUpStepID, + Objectives = new List(from objective in objectiveSet.StepObjectives select new QuestObjective(objective, this, c++)) + }); + c = 0; + + if (assetQuestStep is Mooege.Common.MPQ.FileFormats.QuestStep) + { + var step = assetQuestStep as Mooege.Common.MPQ.FileFormats.QuestStep; + + if (step.StepBonusObjectiveSets != null) + foreach (var objectiveSet in step.StepBonusObjectiveSets) + bonusObjectives.Add(new List(from objective in objectiveSet.StepBonusObjectives select new QuestObjective(objective, this, c++))); + } + } + + public void Notify(Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType type, int value) + { + foreach (var objectiveSet in ObjectivesSets) + foreach (var objective in objectiveSet.Objectives) + objective.Notify(type, value); + } + } + + public delegate void QuestProgressDelegate(Quest quest); + public event QuestProgressDelegate OnQuestProgress; + private Mooege.Common.MPQ.FileFormats.Quest asset = null; + public SNOHandle SNOHandle { get; set; } + private Game game { get; set; } + public QuestStep CurrentStep { get; set; } + private List completedSteps = new List(); // this list has to be saved if quest progress should be saved. It is required to keep track of questranges + + public Quest(Game game, int SNOQuest) + { + this.game = game; + SNOHandle = new SNOHandle(SNOGroup.Quest, SNOQuest); + asset = SNOHandle.Target as Mooege.Common.MPQ.FileFormats.Quest; + CurrentStep = new QuestStep(asset.QuestUnassignedStep, this); + } + + // + public bool HasStepCompleted(int stepID) + { + return completedSteps.Contains(stepID); // || CurrentStep.ObjectivesSets.Select(x => x.FollowUpStepID).Contains(stepID); + } + + public void Advance() + { + CurrentStep.CompleteObjectiveSet(0); + } + + public void StepCompleted(int FollowUpStepID) + { + foreach (var player in game.Players.Values) + player.InGameClient.SendMessage(new QuestUpdateMessage() + { + snoQuest = SNOHandle.Id, + snoLevelArea = -1, + StepID = FollowUpStepID, + Field3 = true, + Failed = false + }); + completedSteps.Add(CurrentStep.QuestStepID); + CurrentStep = (from step in asset.QuestSteps where step.ID == FollowUpStepID select new QuestStep(step, this)).FirstOrDefault(); + if (OnQuestProgress != null) + OnQuestProgress(this); + } + + public void Notify(Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType type, int value) + { + if (CurrentStep != null) + CurrentStep.Notify(type, value); + } + } + +} \ No newline at end of file diff --git a/src/Mooege/Core/GS/Games/QuestManager.cs b/src/Mooege/Core/GS/Games/QuestManager.cs new file mode 100644 index 00000000..cbe88229 --- /dev/null +++ b/src/Mooege/Core/GS/Games/QuestManager.cs @@ -0,0 +1,127 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using Mooege.Common.Logging; +using Mooege.Common.MPQ; + +namespace Mooege.Core.GS.Games +{ + public class QuestManager : QuestProgressHandler, IEnumerable + { + private Dictionary quests = new Dictionary(); + private static readonly Logger Logger = new Logger("QuestManager"); + + /// + /// Accessor for quests + /// + /// snoId of the quest to retrieve + /// + public Quest this[int snoQuest] + { + get { return quests[snoQuest]; } + } + + /// + /// Creates a new QuestManager and attaches it to a game. Quests are are share among all players in a game + /// + /// The game is used to broadcast game messages to + public QuestManager(Game game) + { + var asset = MPQStorage.Data.Assets[Common.Types.SNO.SNOGroup.Quest]; + foreach (var quest in asset.Keys) + quests.Add(quest, new Quest(game, quest)); + } + + /// + /// Debug method. Advances a quest by a step + /// + /// snoID of the quest to advance + public void Advance(int snoQuest) + { + quests[snoQuest].Advance(); + } + + /// + /// Call this, to trigger quest progress if a certain event has occured + /// + public void Notify(Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType type, int value) + { + foreach (var quest in quests.Values) + (quest as QuestProgressHandler).Notify(type, value); + } + + public IEnumerator GetEnumerator() + { + return quests.Values.GetEnumerator(); + } + + + public bool HasCurrentQuest(int snoQuest, int Step) + { + if (quests.ContainsKey(snoQuest)) + if (quests[snoQuest].CurrentStep.QuestStepID == Step || Step == -1) + return true; + + return false; + } + + + public bool IsInQuestRange(Mooege.Common.MPQ.FileFormats.QuestRange range) + { + /* I assume, -1 for start sno means no starting condition and -1 for end sno means no ending of range + * The field for the step id is sometimes set to negative values (maybe there are negative step id, -1 is maybe the unassignedstep) + * but also set when no questID is -1. I have no idea what that means. - farmy */ + + bool started = false; + bool ended = false; + + if (range.Start.SNOQuest == -1 || range.Start.StepID == -1) + started = true; + else + { + if (quests.ContainsKey(range.Start.SNOQuest)) + { + if (quests[range.Start.SNOQuest].HasStepCompleted(range.Start.StepID) || quests[range.Start.SNOQuest].CurrentStep.QuestStepID == range.Start.StepID) // rumford conversation needs current step + started = true; + } + //else logger.Warn("QuestRange {0} references unknown quest {1}", range.Header.SNOId, range.Start.SNOQuest); + } + + if (range.End.SNOQuest == -1 || range.End.StepID < 0) + ended = false; + else + { + if (quests.ContainsKey(range.End.SNOQuest)) + { + if (quests[range.End.SNOQuest].HasStepCompleted(range.End.StepID)) + ended = true; + } + //else logger.Warn("QuestRange {0} references unknown quest {1}", range.Header.SNOId, range.End.SNOQuest); + } + + return started && !ended; + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + throw new NotImplementedException(); + } + } +} diff --git a/src/Mooege/Core/GS/Generators/WorldGenerator.cs b/src/Mooege/Core/GS/Generators/WorldGenerator.cs new file mode 100644 index 00000000..416f6621 --- /dev/null +++ b/src/Mooege/Core/GS/Generators/WorldGenerator.cs @@ -0,0 +1,849 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using System.Linq; +using Mooege.Common.Helpers.Math; +using Mooege.Common.Logging; +using Mooege.Common.MPQ; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Core.GS.Games; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Common.MPQ.FileFormats; +using World = Mooege.Core.GS.Map.World; +using Scene = Mooege.Core.GS.Map.Scene; +using Mooege.Core.GS.Common.Types.Scene; + +namespace Mooege.Core.GS.Generators +{ + public static class WorldGenerator + { + static readonly Logger Logger = LogManager.CreateLogger(); + + public static World Generate(Game game, int worldSNO) + { + if (!MPQStorage.Data.Assets[SNOGroup.Worlds].ContainsKey(worldSNO)) + { + Logger.Error("Can't find a valid world definition for sno: {0}", worldSNO); + return null; + } + + var worldAsset = MPQStorage.Data.Assets[SNOGroup.Worlds][worldSNO]; + var worldData = (Mooege.Common.MPQ.FileFormats.World)worldAsset.Data; + + + if (worldData.IsGenerated) + { + Logger.Error("World {0} [{1}] is a dynamic world! Can't generate proper dynamic worlds yet!", worldAsset.Name, worldAsset.SNOId); + + if (!GenerateRandomDungeon(worldSNO, worldData)) + return null; + } + + var world = new World(game, worldSNO); + var levelAreas = new Dictionary>(); + + // Create a clusterID => Cluster Dictionary + var clusters = new Dictionary(); + foreach (var cluster in worldData.SceneClusterSet.SceneClusters) + clusters[cluster.ClusterId] = cluster; + + // Scenes are not aligned to (0, 0) but apparently need to be -farmy + float minX = worldData.SceneParams.SceneChunks.Min(x => x.PRTransform.Vector3D.X); + float minY = worldData.SceneParams.SceneChunks.Min(x => x.PRTransform.Vector3D.Y); + + // Count all occurences of each cluster /fasbat + var clusterCount = new Dictionary(); + + foreach (var sceneChunk in worldData.SceneParams.SceneChunks) + { + var cID = sceneChunk.SceneSpecification.ClusterID; + if (cID != -1 && clusters.ContainsKey(cID)) // Check for wrong clusters /fasbat + { + if (!clusterCount.ContainsKey(cID)) + clusterCount[cID] = 0; + clusterCount[cID]++; + } + } + + // For each cluster generate a list of randomly selected subcenes /fasbat + var clusterSelected = new Dictionary>(); + foreach (var cID in clusterCount.Keys) + { + var selected = new List(); + clusterSelected[cID] = selected; + var count = clusterCount[cID]; + foreach (var group in clusters[cID].SubSceneGroups) // First select from each subscene group /fasbat + { + for (int i = 0; i < group.I0 && count > 0; i++, count--) //TODO Rename I0 to requiredCount? /fasbat + { + var subSceneEntry = RandomHelper.RandomItem(group.Entries, entry => entry.Probability); + selected.Add(subSceneEntry); + } + + if (count == 0) + break; + } + + while (count > 0) // Fill the rest with defaults /fasbat + { + //Default subscenes are not currently stored in db, use first if available + //var subSceneEntry = RandomHelper.RandomItem(clusters[cID].Default.Entries, entry => entry.Probability); + if (clusters[cID].SubSceneGroups.Count > 0) + { + var subSceneEntry = RandomHelper.RandomItem(clusters[cID].SubSceneGroups.First().Entries, entry => entry.Probability); + selected.Add(subSceneEntry); + } + count--; + } + } + + foreach (var sceneChunk in worldData.SceneParams.SceneChunks) + { + var position = sceneChunk.PRTransform.Vector3D - new Vector3D(minX, minY, 0); + var scene = new Scene(world, position, sceneChunk.SNOHandle.Id, null) + { + MiniMapVisibility = true, + RotationW = sceneChunk.PRTransform.Quaternion.W, + RotationAxis = sceneChunk.PRTransform.Quaternion.Vector3D, + SceneGroupSNO = -1 + }; + + // If the scene has a subscene (cluster ID is set), choose a random subscenes from the cluster load it and attach it to parent scene /farmy + if (sceneChunk.SceneSpecification.ClusterID != -1) + { + if (!clusters.ContainsKey(sceneChunk.SceneSpecification.ClusterID)) + { + Logger.Warn("Referenced clusterID {0} not found for chunk {1} in world {2}", sceneChunk.SceneSpecification.ClusterID, sceneChunk.SNOHandle.Id, worldSNO); + } + else + { + var entries = clusterSelected[sceneChunk.SceneSpecification.ClusterID]; // Select from our generated list /fasbat + Mooege.Common.MPQ.FileFormats.SubSceneEntry subSceneEntry = null; + + if (entries.Count > 0) + { + //subSceneEntry = entries[RandomHelper.Next(entries.Count - 1)]; + + subSceneEntry = RandomHelper.RandomItem(entries, entry => 1); // TODO Just shuffle the list, dont random every time. /fasbat + entries.Remove(subSceneEntry); + } + else + Logger.Error("No SubScenes defined for cluster {0} in world {1}", sceneChunk.SceneSpecification.ClusterID, world.DynamicID); + + Vector3D pos = FindSubScenePosition(sceneChunk); // TODO According to BoyC, scenes can have more than one subscene, so better enumerate over all subscenepositions /farmy + + if (pos == null) + { + Logger.Error("No scene position marker for SubScenes of Scene {0} found", sceneChunk.SNOHandle.Id); + } + else + { + // subSceneEntry is null is there is no subSceneGroups, until we get default subScene saved in DB. + if (subSceneEntry != null) + { + // HACK: avoid trying to create scenes with SNOs that aren't valid + if (MPQStorage.Data.Assets[SNOGroup.Scene].ContainsKey(subSceneEntry.SNOScene)) + { + var subScenePosition = scene.Position + pos; + var subscene = new Scene(world, subScenePosition, subSceneEntry.SNOScene, scene) + { + MiniMapVisibility = true, + RotationW = sceneChunk.PRTransform.Quaternion.W, + RotationAxis = sceneChunk.PRTransform.Quaternion.Vector3D, + Specification = sceneChunk.SceneSpecification + }; + scene.Subscenes.Add(subscene); + subscene.LoadMarkers(); + } + else + { + Logger.Error("Scene not found in mpq storage: {0}", subSceneEntry.SNOScene); + } + } + } + } + + } + scene.Specification = sceneChunk.SceneSpecification; + scene.LoadMarkers(); + + // add scene to level area dictionary + foreach (var levelArea in scene.Specification.SNOLevelAreas) + { + if (levelArea != -1) + { + if (!levelAreas.ContainsKey(levelArea)) + levelAreas.Add(levelArea, new List()); + + levelAreas[levelArea].Add(scene); + } + } + } + + loadLevelAreas(levelAreas, world); + return world; + } + + /// + /// Status of an added exit to world + /// Used when a new tile is needed in a specific place + /// + public enum ExitStatus + { + Free, //no tile in that direction + Blocked, //"wall" in that direction + Open //"path" in that direction + } + + private static bool GenerateRandomDungeon(int worldSNO, Mooege.Common.MPQ.FileFormats.World worldData) + { + if (worldData.DRLGParams.Count == 0) + return false; + + Dictionary tiles = new Dictionary(); + + //Each DRLGParam is a level + for (int paramIndex = 0; paramIndex < worldData.DRLGParams.Count; paramIndex++) + { + var drlgparam = worldData.DRLGParams[paramIndex]; + foreach (var tile in drlgparam.Tiles) + { + Logger.Debug("RandomGeneration: TileType: {0}", (TileTypes)tile.TileType); + tiles.Add(tile.SNOScene, tile); + } + + TileInfo entrance = new TileInfo(); + //HACK for Defiled Crypt as there is no tile yet with type 200. Maybe changing in DB would make more sense than putting this hack in + // [11]: {[161961, Mooege.Common.MPQ.MPQAsset]}Worlds\\a1trDun_Cave_Old_Ruins_Random01.wrl + if (worldSNO == 161961) + { + entrance = tiles[131902]; + tiles.Remove(131902); + } + else + entrance = GetTileInfo(tiles, TileTypes.Entrance); + + Vector3D initialStartTilePosition = new Vector3D(480, 480, 0); + Dictionary worldTiles = new Dictionary(); + worldTiles.Add(initialStartTilePosition, entrance); + AddAdjacentTiles(worldTiles, entrance, tiles, 0, initialStartTilePosition); + AddFillers(worldTiles, tiles); + + foreach (var tile in worldTiles) + { + AddTile(worldData, tile.Value, tile.Key); + } + + //AddFiller + ProcessCommands(drlgparam, worldData, paramIndex); + } + //Coordinates are added after selection of tiles and map + //Leave it for Defiler Crypt debugging + //AddTile(world, tiles[132218], new Vector3D(720, 480, 0)); + //AddTile(world, tiles[132203], new Vector3D(480, 240, 0)); + //AddTile(world, tiles[132263], new Vector3D(240, 480, 0)); + //return world; + return true; + } + + + /// + /// Processes the commands for generating world + /// + /// + /// + /// + private static void ProcessCommands(DRLGParams drlgParams, Mooege.Common.MPQ.FileFormats.World worldData, int levelIndex) + { + //Process commands + foreach (var command in drlgParams.Commands) + { + //Adds information about level + if (command.CommandType == (int)CommandType.Group) + { + // command.TagMap + //{Mooege.Core.GS.Common.Types.TagMap.TagMap} + // _tagMapEntries: Count = 6 + // TagMapEntries: Count = 6 + // TagMapSize: 0 + //command.TagMap.TagMapEntries + //Count = 6 + // [0]: {851986 = -1} + // [1]: {1015841 = 1} + // [2]: {851987 = -1} + // [3]: {851993 = -1} + // [4]: {1015822 = 0} + // [5]: {851983 = 19780} //19780 LevelArea A1_trDun_Level01 + //hardcode this now until proper tagmap implementation is done + foreach (var chunk in worldData.SceneParams.SceneChunks) + { + if (command.TagMap.ContainsKey(DRLGCommandKeys.Group.Level)) + chunk.SceneSpecification.SNOLevelAreas[levelIndex] = command.TagMap[DRLGCommandKeys.Group.Level].Id; + } + + + } + if (command.CommandType == (int)CommandType.AddExit) + { + //drlgparam.Commands[6].TagMap.TagMapEntries + //[0]: {852000 = -1} Type SNO (2) + //[1]: {851984 = 60713} Type SNO (2) [20:16] (snobot) [1] 60713 Worlds trDun_Cain_Intro, + //[2]: {1020032 = 1} (0) + //[3]: {852050 = 0} //Starting location? ID (7) + //[4]: {1015841 = 1} (0) + //[5]: {852051 = 172} //Destination Actor Tag (7) + //[6]: {1015814 = 0} (0) + //[7]: {854612 = -1} Type SNO (2) + //[8]: {1015813 = 300} (0) Tiletype (exit) + //[9]: {1020416 = 1} (0) + //[10]: {854613 = -1} Type SNO (2) + //[11]: {1015821 = -1} (0) + + //find all tiles of TileType + //foreach (var tile in worldTiles) + //{ + + //} + } + } + } + + /// + /// Adds filler tiles around the world + /// + /// + /// + private static void AddFillers(Dictionary worldTiles, Dictionary tiles) + { + + Dictionary fillersToAdd = new Dictionary(); + foreach (var tile in worldTiles) + { + Dictionary adjacentPositions = GetAdjacentPositions(tile.Key); + foreach (var position in adjacentPositions) + { + //Add filler to all free tiles (all exits should have been filled and the blocked ones don't need anything else) + if (GetExistStatus(worldTiles, position.Value, position.Key) == ExitStatus.Free) + { + //random filler + if (!fillersToAdd.ContainsKey(position.Value)) + fillersToAdd.Add(position.Value, GetTileInfo(tiles, 0)); + } + } + } + + foreach (var tile in fillersToAdd) + { + worldTiles.Add(tile.Key, tile.Value); + } + } + + /// + /// Adds tiles to all exits of a tile + /// + /// Contains a list of already added tiles. + /// Originating tile + /// List of tiles to choose from + /// Contains how many tiles were added. When counter reached it will look for an exit. + /// If exit was not found look for deadend(filler?). + /// Position of originating tile. + /// Originating tile world x position + private static int AddAdjacentTiles(Dictionary worldTiles, TileInfo tileInfo, Dictionary tiles, int counter, Vector3D position) + { + Logger.Debug("Counter: {0}, ExitDirectionbitsOfGivenTile: {1}", counter, tileInfo.ExitDirectionBits); + var lookUpExits = GetLookUpExitBits(tileInfo.ExitDirectionBits); + + Dictionary randomizedExitTypes = GetAdjacentPositions(position, true); + + //add adjacent tiles for each randomized direction + foreach (var exit in randomizedExitTypes) + { + if ((lookUpExits & (int)exit.Key) > 0 && !worldTiles.ContainsKey(exit.Value)) + { + counter = AddadjacentTileAtExit(worldTiles, tiles, counter, exit.Value); + } + } + + return counter; + } + + /// + /// Adds an adjacent tile in the given exit position + /// + /// + /// + /// + /// + private static int AddadjacentTileAtExit(Dictionary worldTiles, Dictionary tiles, int counter, Vector3D position) + { + TileTypes tileTypeToFind = TileTypes.Normal; + if (counter > 5) + { + if (!ContainsTileType(worldTiles, TileTypes.Exit)) tileTypeToFind = TileTypes.Exit; + else tileTypeToFind = TileTypes.EventTile1; + } + //Find if other exits are in the area of the new tile to add + Dictionary exitStatus = GetadjacentExitStatus(worldTiles, position); + TileInfo newTile = GetTileInfo(tiles, (int)tileTypeToFind, exitStatus); + if (newTile == null) return counter; + worldTiles.Add(position, newTile); + Logger.Debug("Added tile: Type: {0}, SNOScene: {1}, ExitTypes: {2}", newTile.TileType, newTile.SNOScene, newTile.ExitDirectionBits); + counter = AddAdjacentTiles(worldTiles, newTile, tiles, counter + 1, position); + return counter; + } + + /// + /// Returns the status of all exits for a specified position + /// + /// Tiles already added to world + /// Position + private static Dictionary GetadjacentExitStatus(Dictionary worldTiles, Vector3D position) + { + Dictionary exitStatusDict = new Dictionary(); + //Compute East adjacent Location + Vector3D positionEast = new Vector3D(position.X + 240, position.Y, position.Z); + ExitStatus exitStatusEast = GetExistStatus(worldTiles, positionEast, TileExits.West); + exitStatusDict.Add(TileExits.East, exitStatusEast); + + Vector3D positionWest = new Vector3D(position.X - 240, position.Y, position.Z); + ExitStatus exitStatusWest = GetExistStatus(worldTiles, positionWest, TileExits.East); + exitStatusDict.Add(TileExits.West, exitStatusWest); + + Vector3D positionNorth = new Vector3D(position.X, position.Y + 240, position.Z); + ExitStatus exitStatusNorth = GetExistStatus(worldTiles, positionNorth, TileExits.South); + exitStatusDict.Add(TileExits.North, exitStatusNorth); + + Vector3D positionSouth = new Vector3D(position.X, position.Y - 240, position.Z); + ExitStatus exitStatusSouth = GetExistStatus(worldTiles, positionSouth, TileExits.North); + exitStatusDict.Add(TileExits.South, exitStatusSouth); + + return exitStatusDict; + } + + /// + /// Returns a dictionary of all positions adjacent to a tile + /// + /// + /// + private static Dictionary GetAdjacentPositions(Vector3D position, bool isRandom = false) + { + Vector3D positionEast = new Vector3D(position.X - 240, position.Y, 0); + Vector3D positionWest = new Vector3D(position.X + 240, position.Y, 0); + Vector3D positionNorth = new Vector3D(position.X, position.Y - 240, 0); + Vector3D positionSouth = new Vector3D(position.X, position.Y + 240, 0); + + //get a random direction + Dictionary exitTypes = new Dictionary(); + exitTypes.Add(TileExits.East, positionEast); + exitTypes.Add(TileExits.West, positionWest); + exitTypes.Add(TileExits.North, positionNorth); + exitTypes.Add(TileExits.South, positionSouth); + + if (!isRandom) + return exitTypes; + + //randomize + Dictionary randomExitTypes = new Dictionary(); + var count = exitTypes.Count; + + //Randomise exit directions + for (int i = 0; i < count; i++) + { + //Chose a random exit to test + Vector3D chosenExitPosition = RandomHelper.RandomValue(exitTypes); + var chosenExitDirection = (from pair in exitTypes + where pair.Value == chosenExitPosition + select pair.Key).FirstOrDefault(); + randomExitTypes.Add(chosenExitDirection, chosenExitPosition); + exitTypes.Remove(chosenExitDirection); + } + + return randomExitTypes; + } + + private static bool ContainsTileType(Dictionary worldTiles, TileTypes tileType) + { + foreach (var tileInfo in worldTiles) + { + if (tileInfo.Value.TileType == (int)tileType) return true; + } + return false; + } + + /// + /// Provides the exit status given position and exit (NSEW) + /// + /// + /// + /// + /// + private static ExitStatus GetExistStatus(Dictionary worldTiles, Vector3D position, TileExits exit) + { + if (!worldTiles.ContainsKey(position)) return ExitStatus.Free; + else + { + if ((worldTiles[position].ExitDirectionBits & (int)exit) > 0) return ExitStatus.Open; + else return ExitStatus.Blocked; + } + } + + /// + /// Provides what entrances to look-up based on an entrance set of bits + /// N means look for S + /// S means look for N + /// W means look for E + /// E means look for W + /// basically switch first two bits and last two bits + /// + /// + /// + private static int GetLookUpExitBits(int exitDirectionBits) + { + return (((exitDirectionBits & ~3) & (int)0x4U) << 1 | ((exitDirectionBits & ~3) & (int)0x8U) >> 1) + + (((exitDirectionBits & ~12) & (int)0x1U) << 1 | ((exitDirectionBits & ~12) & (int)0x2U) >> 1); + } + + /// + /// Get tileInfo with specific requirements + /// + /// + /// + /// + /// + /// + private static TileInfo GetTileInfo(Dictionary tiles, int tileType, Dictionary exitStatus) + { + //get all exits that need to be in the new tile + int mustHaveExits = 0; + Dictionary acceptedTiles = new Dictionary(); + //By default use all tiles + acceptedTiles = tiles; + foreach (TileExits exit in System.Enum.GetValues(typeof(TileExits))) + { + if (exitStatus[exit] == ExitStatus.Open) mustHaveExits += (int)exit; + //delete from the pool of tiles those that do have exits that are blocked + if (exitStatus[exit] == ExitStatus.Blocked) + { + acceptedTiles = acceptedTiles.Where(pair => (pair.Value.ExitDirectionBits & (int)exit) == 0).ToDictionary(pair => pair.Key, pair => pair.Value); + } + } + Logger.Debug("Looking for tile with Exits: {0}", mustHaveExits); + return GetTileInfo(acceptedTiles.Where(pair => pair.Value.TileType == tileType).ToDictionary(pair => pair.Key, pair => pair.Value), mustHaveExits); + } + + /// + /// Returns a tileinfo from a list of tiles that has specific exit directions + /// + /// + /// + /// + private static TileInfo GetTileInfo(Dictionary tiles, int exitDirectionBits) + { + //if no exit direction bits return filler + if (exitDirectionBits == 0) + { + //return filler + return GetTileInfo(tiles, TileTypes.Filler); + } + + List tilesWithRightDirection = (from pair in tiles where ((pair.Value.ExitDirectionBits & exitDirectionBits) > 0) select pair.Value).ToList(); + if (tilesWithRightDirection.Count == 0) + { + Logger.Debug("Did not find matching tile"); + //TODO: Never return null. Try to find other tiles that match entry pattern and rotate + //There should be a field that defines if tile can be rotated + return null; + } + + return RandomHelper.RandomItem(tilesWithRightDirection, x => (x.Probability / 100)); + } + + /// + /// Returns a tileinfo from a list of tiles that has a specific type + /// + /// + /// + /// + private static TileInfo GetTileInfo(Dictionary tiles, TileTypes tileType) + { + var tilesWithRightType = (from pair in tiles where (pair.Value.TileType == (int)tileType) select pair.Value); + return RandomHelper.RandomItem(tilesWithRightType, x => 1); + } + + private static void AddTile(Mooege.Common.MPQ.FileFormats.World worldData, TileInfo tileInfo, Vector3D location) + { + var sceneChunk = new SceneChunk(); + sceneChunk.SNOHandle = new SNOHandle(tileInfo.SNOScene); + sceneChunk.PRTransform = new PRTransform(); + sceneChunk.PRTransform.Quaternion = new Quaternion(); + sceneChunk.PRTransform.Quaternion.W = 1.0f; + sceneChunk.PRTransform.Quaternion.Vector3D = new Vector3D(0, 0, 0); + sceneChunk.PRTransform.Vector3D = new Vector3D(); + sceneChunk.PRTransform.Vector3D = location; + + var spec = new SceneSpecification(); + //scene.Specification = spec; + spec.Cell = new Vector2D() { X = 0, Y = 0 }; + spec.CellZ = 0; + spec.SNOLevelAreas = new int[] { -1, -1, -1, -1 }; + spec.SNOMusic = -1; + spec.SNONextLevelArea = -1; + spec.SNONextWorld = -1; + spec.SNOPresetWorld = -1; + spec.SNOPrevLevelArea = -1; + spec.SNOPrevWorld = -1; + spec.SNOReverb = -1; + spec.SNOWeather = 50542; + spec.SNOCombatMusic = -1; + spec.SNOAmbient = -1; + spec.ClusterID = -1; + spec.Unknown1 = 14; + spec.Unknown3 = 5; + spec.Unknown4 = -1; + spec.Unknown5 = 0; + spec.SceneCachedValues = new SceneCachedValues(); + spec.SceneCachedValues.Unknown1 = 63; + spec.SceneCachedValues.Unknown2 = 96; + spec.SceneCachedValues.Unknown3 = 96; + var sceneFile = MPQStorage.Data.Assets[SNOGroup.Scene][tileInfo.SNOScene]; + var sceneData = (Mooege.Common.MPQ.FileFormats.Scene)sceneFile.Data; + spec.SceneCachedValues.AABB1 = sceneData.AABBBounds; + spec.SceneCachedValues.AABB2 = sceneData.AABBMarketSetBounds; + spec.SceneCachedValues.Unknown4 = new int[4] { 0, 0, 0, 0 }; + + sceneChunk.SceneSpecification = spec; + + worldData.SceneParams.SceneChunks.Add(sceneChunk); + worldData.SceneParams.ChunkCount++; + } + + /// + /// Loads content for level areas. Call this after scenes have been generated and after scenes have their GizmoLocations + /// set (this is done in Scene.LoadActors right now) + /// + /// Dictionary that for every level area has the scenes it consists of + /// The world to which to add loaded actors + private static void loadLevelAreas(Dictionary> levelAreas, World world) + { + /// Each Scene has one to four level areas assigned to it. I dont know if that means + /// the scene belongs to both level areas or if the scene is split + /// Scenes marker tags have generic GizmoLocationA to Z that are used + /// to provide random spawning possibilities. + /// For each of these 26 LocationGroups, the LevelArea has a entry in its SpawnType array that defines + /// what type of actor/encounter/adventure could spawn there + /// + /// It could for example define, that for a level area X, out of the four spawning options + /// two are randomly picked and have barrels placed there + + // Create an array of mobs, used with the loadActor in the load monster area loop + // Each monster are created in Mooege.Core.GS.Actors.Implementations.Monsters + // By Poluxxx + //int[] aSNO = new int[] { + // // 6652 // Zombie + // 6443 // Ravenous + // //, 136943 // Ghost + //}; + Dictionary dict = new Dictionary(); + foreach (int la in levelAreas.Keys) + { + SNOHandle levelAreaHandle = new SNOHandle(SNOGroup.LevelArea, la); + if (!levelAreaHandle.IsValid) + { + Logger.Warn("Level area {0} does not exist", la); + continue; + } + var levelArea = levelAreaHandle.Target as LevelArea; + + for (int i = 0; i < 26; i++) + { + // Merge the gizmo starting locations from all scenes and + // their subscenes into a single list for the whole level area + List gizmoLocations = new List(); + foreach (var scene in levelAreas[la]) + { + if (scene.GizmoSpawningLocations[i] != null) + gizmoLocations.AddRange(scene.GizmoSpawningLocations[i]); + foreach (Scene subScene in scene.Subscenes) + { + if (subScene.GizmoSpawningLocations[i] != null) + gizmoLocations.AddRange(subScene.GizmoSpawningLocations[i]); + } + } + + // Load all spawns that are defined for that location group + foreach (GizmoLocSpawnEntry spawnEntry in levelArea.LocSet.SpawnType[i].SpawnEntry) + { + // Get a random amount of spawns ... + int amount = RandomHelper.Next(spawnEntry.Max, spawnEntry.Max); + if (amount > gizmoLocations.Count) + { + Logger.Trace("Breaking after spawnEntry {0} for LevelArea {1} because there are less locations ({2}) than spawn amount ({3}, {4} min)", spawnEntry.SNOHandle, levelAreaHandle, gizmoLocations.Count, amount, spawnEntry.Min); + break; + } + + Logger.Trace("Spawning {0} ({3} - {4} {1} in {2}", amount, spawnEntry.SNOHandle, levelAreaHandle, spawnEntry.Min, spawnEntry.Max); + + // ...and place each one on a random position within the location group + for (; amount > 0; amount--) + { + int location = RandomHelper.Next(gizmoLocations.Count - 1); + + switch (spawnEntry.SNOHandle.Group) + { + case SNOGroup.Actor: + //TODO: Why to pass tagmap here and not load it inside Actor + loadActor(spawnEntry.SNOHandle, gizmoLocations[location], world, ((Mooege.Common.MPQ.FileFormats.Actor)spawnEntry.SNOHandle.Target).TagMap); + break; + case SNOGroup.Encounter: + var encounter = spawnEntry.SNOHandle.Target as Encounter; + var actor = RandomHelper.RandomItem(encounter.Spawnoptions, x => x.Probability); + var actorHandle = new SNOHandle(actor.SNOSpawn); + loadActor(actorHandle, gizmoLocations[location], world, ((Mooege.Common.MPQ.FileFormats.Actor)actorHandle.Target).TagMap); + break; + case SNOGroup.Adventure: + // Adventure are basically made up of a markerSet that has relative PRTransforms + // it has some other fields that are always 0 and a reference to a symbol actor + // no idea what they are used for - farmy + + var adventure = spawnEntry.SNOHandle.Target as Adventure; + var markerSet = new SNOHandle(adventure.SNOMarkerSet).Target as MarkerSet; + + foreach (var marker in markerSet.Markers) + { + // relative marker set coordinates to absolute world coordinates + var absolutePRTransform = new PRTransform + { + Vector3D = marker.PRTransform.Vector3D + gizmoLocations[location].Vector3D, + Quaternion = new Quaternion + { + Vector3D = new Vector3D(marker.PRTransform.Quaternion.Vector3D.X, marker.PRTransform.Quaternion.Vector3D.Y, marker.PRTransform.Quaternion.Vector3D.Z), + W = marker.PRTransform.Quaternion.W + } + }; + switch (marker.Type) + { + case MarkerType.Actor: + loadActor(marker.SNOHandle, absolutePRTransform, world, marker.TagMap); + break; + + case MarkerType.Encounter: + var encounter2 = marker.SNOHandle.Target as Encounter; + var actor2 = RandomHelper.RandomItem(encounter2.Spawnoptions, x => x.Probability); + loadActor(new SNOHandle(actor2.SNOSpawn), absolutePRTransform, world, marker.TagMap); + break; + + default: + Logger.Warn("Unhandled marker type {0} in actor loading", marker.Type); + break; + } + } + break; + default: + if (spawnEntry.SNOHandle.Id != -1) + Logger.Warn("Unknown sno handle in LevelArea spawn entries: {0}", spawnEntry.SNOHandle); + break; + } + + // dont use that location again + gizmoLocations.RemoveAt(location); + + } + } + } + + // Load monsters for level area + foreach (var scene in levelAreas[la]) + { + // HACK: don't spawn monsters in tristram town scenes /mdz + if (MPQStorage.Data.Assets[SNOGroup.Scene][scene.SceneSNO.Id].Name.StartsWith("trOut_Tristram_")) + continue; + + // a little variety in monsters spawned + int[] monsterActors = { 6652, 219725, 5346, 6356, 5393, 434, 4982 }; + + for (int i = 0; i < 100; i++) + { + if (RandomHelper.NextDouble() > 0.8) + { + // TODO Load correct spawn population + // 2.5 is units per square, TODO: Find out how to calculate units per square. Is it F1 * V0.I1 / SquareCount? + int x = RandomHelper.Next(scene.NavMesh.SquaresCountX); + int y = RandomHelper.Next(scene.NavMesh.SquaresCountY); + + if ((scene.NavMesh.Squares[y * scene.NavMesh.SquaresCountX + x].Flags & Mooege.Common.MPQ.FileFormats.Scene.NavCellFlags.NoSpawn) == 0) + { + loadActor( + new SNOHandle(monsterActors[RandomHelper.Next(monsterActors.Length)]), + new PRTransform + { + Vector3D = new Vector3D + { + X = (float)(x * 2.5 + scene.Position.X), + Y = (float)(y * 2.5 + scene.Position.Y), + Z = scene.NavMesh.Squares[y * scene.NavMesh.SquaresCountX + x].Z + scene.Position.Z + }, + Quaternion = Quaternion.FacingRotation((float)(RandomHelper.NextDouble() * System.Math.PI * 2)) + }, + world, + new TagMap() + ); + } + } + } + } + } + } + + //TODO: Move this out as loading actors can happen even after world was generated + public static uint loadActor(SNOHandle actorHandle, PRTransform location, World world, TagMap tagMap) + { + var actor = Mooege.Core.GS.Actors.ActorFactory.Create(world, actorHandle.Id, tagMap); + + if (actor == null) + { + if (actorHandle.Id != -1) + Logger.Warn("ActorFactory did not load actor {0}", actorHandle); + return 0; + } + + actor.RotationW = location.Quaternion.W; + actor.RotationAxis = location.Quaternion.Vector3D; + actor.EnterWorld(location.Vector3D); + return actor.DynamicID; + } + + /// + /// Loads all markersets of a scene and looks for the one with the subscene position + /// + private static Vector3D FindSubScenePosition(Mooege.Common.MPQ.FileFormats.SceneChunk sceneChunk) + { + var mpqScene = MPQStorage.Data.Assets[SNOGroup.Scene][sceneChunk.SNOHandle.Id].Data as Mooege.Common.MPQ.FileFormats.Scene; + + foreach (var markerSet in mpqScene.MarkerSets) + { + var mpqMarkerSet = MPQStorage.Data.Assets[SNOGroup.MarkerSet][markerSet].Data as Mooege.Common.MPQ.FileFormats.MarkerSet; + foreach (var marker in mpqMarkerSet.Markers) + if (marker.Type == Mooege.Common.MPQ.FileFormats.MarkerType.SubScenePosition) + return marker.PRTransform.Vector3D; + } + return null; + } + } +} \ No newline at end of file diff --git a/src/Mooege/Core/GS/Items/Affix.cs b/src/Mooege/Core/GS/Items/Affix.cs new file mode 100644 index 00000000..c39808fd --- /dev/null +++ b/src/Mooege/Core/GS/Items/Affix.cs @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using Mooege.Common.Logging; + +namespace Mooege.Core.GS.Items +{ + public class Affix + { + public static readonly Logger Logger = LogManager.CreateLogger(); + public int AffixGbid { get; set; } + + public Affix(int gbid) + { + AffixGbid = gbid; + } + + public override String ToString() + { + return String.Format("{0}", AffixGbid); + } + + public static Affix Parse(String affixString) + { + try + { + int gbid = int.Parse(affixString); + var affix = new Affix(gbid); + return affix; + } + catch (Exception e) + { + throw new Exception(String.Format("Affix can not be parsed: {0}", affixString), e); + } + } + + } +} diff --git a/src/Mooege/Core/GS/Items/AffixGenerator.cs b/src/Mooege/Core/GS/Items/AffixGenerator.cs new file mode 100644 index 00000000..33947684 --- /dev/null +++ b/src/Mooege/Core/GS/Items/AffixGenerator.cs @@ -0,0 +1,161 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using System.Linq; +using Mooege.Common.Helpers.Math; +using Mooege.Common.Logging; +using Mooege.Net.GS.Message; +using Mooege.Common.MPQ.FileFormats; +using Mooege.Common.MPQ; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Common.Extensions; + +namespace Mooege.Core.GS.Items +{ + static class AffixGenerator + { + public static readonly Logger Logger = LogManager.CreateLogger(); + + private static List AffixList = new List(); + + static AffixGenerator() + { + foreach (var asset in MPQStorage.Data.Assets[SNOGroup.GameBalance].Values) + { + GameBalance data = asset.Data as GameBalance; + if (data != null && data.Type == BalanceType.AffixList) + { + foreach (var affixDef in data.Affixes) + { + if (affixDef.AffixFamily0 == -1) continue; + if (affixDef.Name.Contains("REQ")) continue; // crashes the client // dark0ne + if (affixDef.Name.Contains("Sockets")) continue; // crashes the client // dark0ne + if (affixDef.Name.Contains("Will")) continue; // not in game // dark0ne + + AffixList.Add(affixDef); + } + } + } + } + + public static void Generate(Item item, int affixesCount) + { + if (!Item.IsWeapon(item.ItemType) && + !Item.IsArmor(item.ItemType) && + !Item.IsOffhand(item.ItemType) && + !Item.IsAccessory(item.ItemType)) + return; + + var itemTypes = ItemGroup.HierarchyToHashList(item.ItemType); + int itemQualityMask = 1 << item.Attributes[GameAttribute.Item_Quality_Level]; + + var filteredList = AffixList.Where(a => + a.QualityMask.HasFlag((QualityMask)itemQualityMask) && + itemTypes.ContainsAtLeastOne(a.ItemGroup) && + a.AffixLevel <= item.ItemLevel); + + Dictionary bestDefinitions = new Dictionary(); + foreach (var affix in filteredList) + bestDefinitions[affix.AffixFamily0] = affix; + + var selectedGroups = bestDefinitions.Values.OrderBy(x => RandomHelper.Next()).Take(affixesCount); + + foreach (var def in selectedGroups) + { + if (def != null) + { + //Logger.Debug("Generating affix " + def.Name + " (aLvl:" + def.AffixLevel + ")"); + item.AffixList.Add(new Affix(def.Hash)); + foreach (var effect in def.AttributeSpecifier) + { + if (effect.AttributeId > 0) + { + float result; + if (FormulaScript.Evaluate(effect.Formula.ToArray(), item.RandomGenerator, out result)) + { + //Logger.Debug("Randomized value for attribute " + GameAttribute.Attributes[effect.AttributeId].Name + " is " + result); + var tmpAttr = GameAttribute.Attributes[effect.AttributeId]; + var attrName = tmpAttr.Name; + + if (GameAttribute.Attributes[effect.AttributeId] is GameAttributeF) + { + var attr = GameAttribute.Attributes[effect.AttributeId] as GameAttributeF; + if (effect.SNOParam != -1) + item.Attributes[attr, effect.SNOParam] += result; + else + item.Attributes[attr] += result; + } + else if (GameAttribute.Attributes[effect.AttributeId] is GameAttributeI) + { + var attr = GameAttribute.Attributes[effect.AttributeId] as GameAttributeI; + if (effect.SNOParam != -1) + item.Attributes[attr, effect.SNOParam] += (int)result; + else + item.Attributes[attr] += (int)result; + } + } + } + } + } + } + } + + public static void CloneIntoItem(Item source, Item target) + { + target.AffixList.Clear(); + foreach (var affix in source.AffixList) + { + var newItemAffix = new Affix(affix.AffixGbid); + target.AffixList.Add(newItemAffix); + } + foreach (var affix in target.AffixList) + { + var definition = AffixList.Single(def => def.Hash == affix.AffixGbid); + foreach (var effect in definition.AttributeSpecifier) + { + if (effect.AttributeId <= 0) + continue; + + var attribute = GameAttribute.Attributes[effect.AttributeId]; + + if (attribute.ScriptFunc != null && !attribute.ScriptedAndSettable) + continue; + + if (attribute is GameAttributeF) + { + var attr = GameAttribute.Attributes[effect.AttributeId] as GameAttributeF; + if (effect.SNOParam != -1) + target.Attributes[attr, effect.SNOParam] = source.Attributes[attr, effect.SNOParam]; + else + target.Attributes[attr] = source.Attributes[attr]; + } + else if (GameAttribute.Attributes[effect.AttributeId] is GameAttributeI) + { + var attr = GameAttribute.Attributes[effect.AttributeId] as GameAttributeI; + if (effect.SNOParam != -1) + target.Attributes[attr, effect.SNOParam] = source.Attributes[attr, effect.SNOParam]; + else + target.Attributes[attr] = source.Attributes[attr]; + } + + } + } + } + } +} diff --git a/src/Mooege/Core/GS/Items/FormulaScript.cs b/src/Mooege/Core/GS/Items/FormulaScript.cs new file mode 100644 index 00000000..12a5c559 --- /dev/null +++ b/src/Mooege/Core/GS/Items/FormulaScript.cs @@ -0,0 +1,264 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Text; +using Mooege.Common.Helpers.Math; +using Mooege.Common.Logging; +using Mooege.Net.GS.Message; + +namespace Mooege.Core.GS.Items +{ + public static class FormulaScript + { + private static readonly Logger Logger = LogManager.CreateLogger(); + + private static float BinaryIntToFloat(int n) + { + byte[] array = BitConverter.GetBytes(n); + return BitConverter.ToSingle(array, 0); + } + + public static bool Evaluate(int[] script, ItemRandomHelper irh, out float result) + { + result = 0; + Stack stack = new Stack(64); + int pos = 0; + float numb1, numb2; //numb3; + while (pos < script.Length) + { + switch ((byte)script[pos]) + { + case 0: + if (stack.Count < 1) + { + Logger.Error("Stack underflow"); + return false; + } + result = stack.Pop(); + return true; + case 1: + ++pos; + byte funcId = (byte)script[pos]; + switch (funcId) + { + case 3: + if (stack.Count < 2) + { + Logger.Error("Stack underflow"); + return false; + } + numb2 = stack.Pop(); + numb1 = stack.Pop(); + stack.Push(irh.Next(numb1, numb1 + numb2)); + break; + case 4: + if (stack.Count < 2) + { + Logger.Error("Stack underflow"); + return false; + } + numb2 = stack.Pop(); + numb1 = stack.Pop(); + stack.Push(irh.Next(numb1, numb2)); + break; + default: + Logger.Error("Unimplemented function"); + return false; + } + break; + case 6: + ++pos; + stack.Push(BinaryIntToFloat(script[pos])); + break; + case 11: + if (stack.Count < 2) + { + Logger.Error("Stack underflow"); + return false; + } + numb2 = stack.Pop(); + numb1 = stack.Pop(); + stack.Push(numb1 + numb2); + break; + case 12: + if (stack.Count < 2) + { + Logger.Error("Stack underflow"); + return false; + } + numb2 = stack.Pop(); + numb1 = stack.Pop(); + stack.Push(numb1 - numb2); + break; + case 13: + if (stack.Count < 2) + { + Logger.Error("Stack underflow"); + return false; + } + numb2 = stack.Pop(); + numb1 = stack.Pop(); + stack.Push(numb1 * numb2); + break; + case 14: + if (stack.Count < 2) + { + Logger.Error("Stack underflow"); + return false; + } + numb2 = stack.Pop(); + numb1 = stack.Pop(); + if (numb1 == 0f) + { + Logger.Error("Division by zero"); + return false; + } + stack.Push(numb1 / numb2); + break; + default: + Logger.Error("Unimplemented OpCode"); + return false; + } + ++pos; + } + return false; + } + + public static string ToString(int[] script) + { + StringBuilder b = new StringBuilder(); + int pos = 0; + while (pos < script.Length) + { + switch ((byte)script[pos]) + { + case 0: + b.Append("return; "); + break; + case 1: + ++pos; + ToStringFunc(b, (byte)script[pos]); + break; + case 5: + ToStringIdentifierEval( + b, + script[pos + 1], + script[pos + 2], + script[pos + 3], + script[pos + 4]); + ++pos; + break; + case 6: + b.Append("push "); + ++pos; + b.Append(BinaryIntToFloat(script[pos])); + b.Append("; "); + break; + case 11: + b.Append("add; "); + break; + case 12: + b.Append("sub; "); + break; + case 13: + b.Append("mul; "); + break; + case 14: + b.Append("div; "); + break; + default: + b.Append("unknownOp ("); + b.Append(script[pos]); + b.Append("); "); + break; + } + ++pos; + } + return b.ToString(); + } + + static void ToStringFunc(StringBuilder b, byte funcId) + { + switch (funcId) + { + case 0: + b.Append("func Min(stack1, stack0); "); + break; + case 1: + b.Append("func Max(stack1, stack0); "); + break; + case 2: + b.Append("func Pin(stack2, stack1, stack0); "); + break; + case 3: + b.Append("func RandomIntMinRange(stack1, stack0); "); + break; + case 4: + b.Append("func RandomIntMinMax(stack1, stack0); "); + break; + case 5: + b.Append("func Floor(stack0); "); + break; + case 6: + b.Append("func Dim(stack2, stack1, stack0); "); + break; + case 7: + b.Append("func Pow(stack1, stack0); "); + break; + case 8: + b.Append("func Log(stack0); "); + break; + case 9: + b.Append("func RandomFloatMinRange(stack1, stack0); "); + break; + case 10: + b.Append("func RandomFloatMinMax(stack1, stack0); "); + break; + case 11: + b.Append("func TableLookup(stack1, stack0); "); + break; + default: + b.Append("unknownFunc("); + b.Append(funcId); + b.Append("); "); + break; + } + } + + static void ToStringIdentifierEval(StringBuilder b, int numb1, int numb2, int numb3, int numb4) + { + switch (numb1) + { + case 0: + b.Append("GetAttribute "); + b.Append(GameAttribute.Attributes[numb2].Name); + b.Append(" ("); b.Append(numb2); b.Append("); "); + break; + case 22: + b.Append("RunScript ... ; "); + break; + default: + b.Append("unknown source on identifier function ; "); + break; + } + } + } + +} diff --git a/src/Mooege/Core/GS/Items/HandledItem.cs b/src/Mooege/Core/GS/Items/HandledItem.cs new file mode 100644 index 00000000..8d5ee3df --- /dev/null +++ b/src/Mooege/Core/GS/Items/HandledItem.cs @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; + +namespace Mooege.Core.GS.Items +{ + /// + /// Allows implementing items for given named items. + /// + [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] + public sealed class HandledItemAttribute : Attribute + { + public List Names { get; private set; } + + public HandledItemAttribute(params string[] names) + { + this.Names = new List(); + this.Names.AddRange(names); + } + } +} diff --git a/src/Mooege/Core/GS/Items/HandledType.cs b/src/Mooege/Core/GS/Items/HandledType.cs new file mode 100644 index 00000000..f48d8320 --- /dev/null +++ b/src/Mooege/Core/GS/Items/HandledType.cs @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; + +namespace Mooege.Core.GS.Items +{ + /// + /// Allows implementing items for given types. + /// + [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] + public sealed class HandledTypeAttribute : Attribute + { + public List Types { get; private set; } + + public HandledTypeAttribute(params string[] types) + { + this.Types = new List(); + this.Types.AddRange(types); + } + } +} diff --git a/src/Mooege/Core/GS/Items/Implementations/Book.cs b/src/Mooege/Core/GS/Items/Implementations/Book.cs new file mode 100644 index 00000000..cd463744 --- /dev/null +++ b/src/Mooege/Core/GS/Items/Implementations/Book.cs @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Common.Logging; +using Mooege.Core.GS.Players; +using Mooege.Core.GS.Map; +using Mooege.Net.GS.Message.Definitions.World; +using Mooege.Core.GS.Common.Types.TagMap; + +namespace Mooege.Core.GS.Items.Implementations +{ + [HandledType("Book")] + public class Book : Item + { + public static readonly Logger Logger = LogManager.CreateLogger(); + + public int LoreSNOId { get; private set; } + + public Book(World world, Mooege.Common.MPQ.FileFormats.ItemTable definition) + : base(world, definition) + { + // Items are NOT constructed with tags + var actorData = ActorSNO.Target as Mooege.Common.MPQ.FileFormats.Actor; + + if (actorData.TagMap.ContainsKey(ActorKeys.Lore)) + { + LoreSNOId = actorData.TagMap[ActorKeys.Lore].Id; + } + } + + /* + // Items are NOT constructed with tags! + protected override void ReadTags() + { + base.ReadTags(); + if (this.Tags.ContainsKey((int)MarkerTagTypes.LoreSNOId)) + { + LoreSNOId = Tags[(int)MarkerTagTypes.LoreSNOId].Int2; + } + else + { + LoreSNOId = -1; + } + } + */ + public override void OnTargeted(Player player, TargetMessage message) + { + //Logger.Trace("OnTargeted"); + if (LoreSNOId != -1) + { + player.PlayLore(LoreSNOId, true); + } + if (player.GroundItems.ContainsKey(this.DynamicID)) + player.GroundItems.Remove(this.DynamicID); + this.Destroy(); + } + } +} diff --git a/src/Mooege/Core/GS/Items/Implementations/Dye.cs b/src/Mooege/Core/GS/Items/Implementations/Dye.cs new file mode 100644 index 00000000..0749febf --- /dev/null +++ b/src/Mooege/Core/GS/Items/Implementations/Dye.cs @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using System.Diagnostics; +using Mooege.Net.GS.Message; +using Mooege.Core.GS.Players; +using Mooege.Net.GS.Message.Fields; +using Mooege.Core.GS.Map; + +namespace Mooege.Core.GS.Items.Implementations +{ + // This is how Dyes should be implemented ;) /fasbat + [HandledType("Dye")] + public class Dye : Item + { + private static Dictionary DyeColorMap = new Dictionary(); + + public Dye(World world, Mooege.Common.MPQ.FileFormats.ItemTable definition) + : base(world, definition) + { + } + + public override void OnRequestUse(Player player, Item target, int actionId, WorldPlace worldPlace) + { + Debug.Assert(target != null); + + target.Attributes[GameAttribute.DyeType] = this.Attributes[GameAttribute.DyeType]; + player.Inventory.DestroyInventoryItem(this); + player.Inventory.SendVisualInventory(player); // TODO: Send it to all who see! /fasbat + } + } +} diff --git a/src/Mooege/Core/GS/Items/Implementations/HealthPotion.cs b/src/Mooege/Core/GS/Items/Implementations/HealthPotion.cs new file mode 100644 index 00000000..8a859fc0 --- /dev/null +++ b/src/Mooege/Core/GS/Items/Implementations/HealthPotion.cs @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using Mooege.Common.MPQ.FileFormats; +using Mooege.Net.GS.Message; + +namespace Mooege.Core.GS.Items.Implementations +{ + // A quick example of Type handling, HealthPotion will always override Potion (for Health potions ofc ;))! + // fasbat + [HandledType("HealthPotion")] + public class HealthPotion : Potion + { + public HealthPotion(Map.World world, ItemTable definition) + : base(world, definition) + { + } + + public override void OnRequestUse(GS.Players.Player player, Item target, int actionId, Net.GS.Message.Fields.WorldPlace worldPlace) + { + if (player.Attributes[GameAttribute.Hitpoints_Cur] == player.Attributes[GameAttribute.Hitpoints_Max]) + return; // TODO Error msg? /fasbat + player.Attributes[GameAttribute.Hitpoints_Cur] = + Math.Min(player.Attributes[GameAttribute.Hitpoints_Cur] + this.Attributes[GameAttribute.Hitpoints_Granted], + player.Attributes[GameAttribute.Hitpoints_Max]); + + player.Attributes.BroadcastChangedIfRevealed(); + + if (this.Attributes[GameAttribute.ItemStackQuantityLo] <= 1) + player.Inventory.DestroyInventoryItem(this); // No more potions! + else + { + this.Attributes[GameAttribute.ItemStackQuantityLo]--; // Just remove one + this.Attributes.SendChangedMessage(player.InGameClient); + } + + } + } +} \ No newline at end of file diff --git a/src/Mooege/Core/GS/Items/Implementations/Potion.cs b/src/Mooege/Core/GS/Items/Implementations/Potion.cs new file mode 100644 index 00000000..379ac632 --- /dev/null +++ b/src/Mooege/Core/GS/Items/Implementations/Potion.cs @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Common.MPQ.FileFormats; +using Mooege.Net.GS.Message; + +namespace Mooege.Core.GS.Items.Implementations +{ + // A quick example of type handling. /fasbat + [HandledType("Potion")] + public class Potion : Item + { + public Potion(Map.World world, ItemTable definition) + : base(world, definition) + { + Attributes[GameAttribute.ItemStackQuantityLo] = 1; + } + } +} diff --git a/src/Mooege/Core/GS/Items/Implementations/SpellRune.cs b/src/Mooege/Core/GS/Items/Implementations/SpellRune.cs new file mode 100644 index 00000000..4fa2d1f8 --- /dev/null +++ b/src/Mooege/Core/GS/Items/Implementations/SpellRune.cs @@ -0,0 +1,96 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Linq; +using Mooege.Common.Helpers.Math; +using Mooege.Common.Logging; +using Mooege.Core.MooNet.Toons; +using Mooege.Net.GS.Message; +using Mooege.Core.GS.Map; + +namespace Mooege.Core.GS.Items.Implementations +{ + //[HandledType("SpellRune")] + public class SpellRune : Item + { + // type of rune is in Name + // Attributes[GameAttribute.Rune_] = ; // on attuned runes ONLY + // Attributes[GameAttribute.Rune_Rank] = ; // on unattuned rune ONLY, inititalized in creation + // Attributes[GameAttribute.Rune_Attuned_Power] = 0; // need s to be 0 on unattuned or random value from all powers + + public static readonly Logger Logger = LogManager.CreateLogger(); + + public SpellRune(World world, Mooege.Common.MPQ.FileFormats.ItemTable definition) + : base(world, definition) + { + if (!definition.Name.Contains("X")) + { + // attuned rune, randomize power + int classRnd = RandomHelper.Next(0, 5); + int PowerSNOId = -1; + switch (classRnd) + { + case 0: + PowerSNOId = Skills.Skills.Barbarian.AllActiveSkillsList.ElementAt(RandomHelper.Next(0, Mooege.Core.GS.Skills.Skills.Barbarian.AllActiveSkillsList.Count)); + break; + case 1: + PowerSNOId = Skills.Skills.DemonHunter.AllActiveSkillsList.ElementAt(RandomHelper.Next(0, Mooege.Core.GS.Skills.Skills.DemonHunter.AllActiveSkillsList.Count)); + break; + case 2: + PowerSNOId = Skills.Skills.Monk.AllActiveSkillsList.ElementAt(RandomHelper.Next(0, Mooege.Core.GS.Skills.Skills.Monk.AllActiveSkillsList.Count)); + break; + case 3: + PowerSNOId = Skills.Skills.WitchDoctor.AllActiveSkillsList.ElementAt(RandomHelper.Next(0, Mooege.Core.GS.Skills.Skills.WitchDoctor.AllActiveSkillsList.Count)); + break; + case 4: + PowerSNOId = Skills.Skills.Wizard.AllActiveSkillsList.ElementAt(RandomHelper.Next(0, Mooege.Core.GS.Skills.Skills.Wizard.AllActiveSkillsList.Count)); + break; + } + //this.Attributes[GameAttribute.Rune_Attuned_Power] = PowerSNOId; + } + } + + /// + /// Re-attunes rune to player's class. Used for favoring. + /// + /// + public void ReAttuneToClass(ToonClass toonClass) + { + int PowerSNOId = -1; + switch (toonClass) + { + case ToonClass.Barbarian: + PowerSNOId = Mooege.Core.GS.Skills.Skills.Barbarian.AllActiveSkillsList.ElementAt(RandomHelper.Next(0, Mooege.Core.GS.Skills.Skills.Barbarian.AllActiveSkillsList.Count)); + break; + case ToonClass.DemonHunter: + PowerSNOId = Mooege.Core.GS.Skills.Skills.DemonHunter.AllActiveSkillsList.ElementAt(RandomHelper.Next(0, Mooege.Core.GS.Skills.Skills.DemonHunter.AllActiveSkillsList.Count)); + break; + case ToonClass.Monk: + PowerSNOId = Mooege.Core.GS.Skills.Skills.Monk.AllActiveSkillsList.ElementAt(RandomHelper.Next(0, Mooege.Core.GS.Skills.Skills.Monk.AllActiveSkillsList.Count)); + break; + case ToonClass.WitchDoctor: + PowerSNOId = Mooege.Core.GS.Skills.Skills.WitchDoctor.AllActiveSkillsList.ElementAt(RandomHelper.Next(0, Mooege.Core.GS.Skills.Skills.WitchDoctor.AllActiveSkillsList.Count)); + break; + case ToonClass.Wizard: + PowerSNOId = Mooege.Core.GS.Skills.Skills.Wizard.AllActiveSkillsList.ElementAt(RandomHelper.Next(0, Mooege.Core.GS.Skills.Skills.Wizard.AllActiveSkillsList.Count)); + break; + } + //this.Attributes[GameAttribute.Rune_Attuned_Power] = PowerSNOId; + } + } +} diff --git a/src/Mooege/Core/GS/Items/Implementations/StoneOfRecall.cs b/src/Mooege/Core/GS/Items/Implementations/StoneOfRecall.cs new file mode 100644 index 00000000..1cab57cf --- /dev/null +++ b/src/Mooege/Core/GS/Items/Implementations/StoneOfRecall.cs @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace Mooege.Core.GS.Items.Implementations +{ + [HandledItem("StoneOfRecall")] + class StoneOfRecall : Item + { + public StoneOfRecall(GS.Map.World world, Mooege.Common.MPQ.FileFormats.ItemTable definition) + : base(world, definition) + { + } + + public override void OnTargeted(Players.Player player, Net.GS.Message.Definitions.World.TargetMessage message) + { + player.EnableStoneOfRecall(); + this.Destroy(); + } + } +} diff --git a/src/Mooege/Core/GS/Items/Item.cs b/src/Mooege/Core/GS/Items/Item.cs new file mode 100644 index 00000000..d7f42cd3 --- /dev/null +++ b/src/Mooege/Core/GS/Items/Item.cs @@ -0,0 +1,495 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using Mooege.Common.Helpers.Math; +using Mooege.Common.Logging; +using Mooege.Common.Storage.AccountDataBase.Entities; +using Mooege.Core.GS.Actors; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Objects; +using Mooege.Core.GS.Players; +using Mooege.Net.GS.Message.Definitions.World; +using Mooege.Net.GS.Message.Definitions.Misc; +using Mooege.Net.GS.Message.Fields; +using Mooege.Net.GS.Message.Definitions.Effect; +using Mooege.Net.GS.Message; +using Mooege.Common.MPQ.FileFormats; +using Actor = Mooege.Core.GS.Actors.Actor; +using World = Mooege.Core.GS.Map.World; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Core.GS.Common.Types.SNO; + +// TODO: This entire namespace belongs in GS. Bnet only needs a certain representation of items whereas nearly everything here is GS-specific + +namespace Mooege.Core.GS.Items +{ + /* + public enum ItemType + { + Unknown, Helm, Gloves, Boots, Belt, Shoulders, Pants, Bracers, Shield, Quiver, Orb, + Axe_1H, Axe_2H, CombatStaff_2H, Staff, Dagger, Mace_1H, Mace_2H, Sword_1H, + Sword_2H, Crossbow, Bow, Spear, Polearm, Wand, Ring, FistWeapon_1H, ThrownWeapon, ThrowingAxe, ChestArmor, + HealthPotion, Gold, HealthGlobe, Dye, Elixir, Charm, Scroll, SpellRune, Rune, + Amethyst, Emarald, Ruby, Emerald, Topaz, Skull, Backpack, Potion, Amulet, Scepter, Rod, Journal, + //CraftingReagent + // Not working at the moment: + // ThrownWeapon, ThrowingAxe - does not work because there are no snoId in Actors.txt. Do they actually drop in the D3 beta? /angerwin? + // Diamond, Sapphire - I realised some days ago, that the Item type Diamond and Shappire (maybe not the only one) causes client crash and BAD GBID messages, although they actually have SNO IDs. /angerwin + } + */ + public class Item : Actor + { + public DBInventory DBInventory = null; + public DBItemInstance DBItemInstance = null; + + private static readonly Logger Logger = LogManager.CreateLogger(); + public bool ItemHasChanges { get; private set; }//needed in Future, set this to true if Item affixes or item attributes have changed. + + + public override ActorType ActorType { get { return ActorType.Item; } } + + public Actor Owner { get; set; } // Only set when the _actor_ has the item in its inventory. /fasbat + + public ItemTable ItemDefinition { get; private set; } + public ItemTypeTable ItemType { get; private set; } + + public ItemRandomHelper RandomGenerator { get; private set; } + public int ItemLevel { get; private set; } + + public ItemState CurrentState { get; set; } + + public int EquipmentSlot { get; private set; } + public Vector2D InventoryLocation { get; private set; } // Column, row; NOTE: Call SetInventoryLocation() instead of setting fields on this + + public override int Quality + { + get + { + return Attributes[GameAttribute.Item_Quality_Level]; + } + set + { + Attributes[GameAttribute.Item_Quality_Level] = value; + } + } + + public SNOHandle SnoFlippyActory + { + get + { + return ActorData.TagMap.ContainsKey(ActorKeys.Flippy) ? ActorData.TagMap[ActorKeys.Flippy] : null; + } + } + + public SNOHandle SnoFlippyParticle + { + get + { + return ActorData.TagMap.ContainsKey(ActorKeys.FlippyParticle) ? ActorData.TagMap[ActorKeys.FlippyParticle] : null; + } + } + + public override bool HasWorldLocation + { + get { return this.Owner == null; } + } + + public override InventoryLocationMessageData InventoryLocationMessage + { + get + { + return new InventoryLocationMessageData + { + OwnerID = (this.Owner != null) ? this.Owner.DynamicID : 0, + EquipmentSlot = this.EquipmentSlot, + InventoryLocation = this.InventoryLocation + }; + } + } + + public bool IsStackable() + { + return ItemDefinition.MaxStackAmount > 1; + } + + public InvLoc InvLoc + { + get + { + return new InvLoc + { + OwnerID = (this.Owner != null) ? this.Owner.DynamicID : 0, + EquipmentSlot = this.EquipmentSlot, + Row = this.InventoryLocation.Y, + Column = this.InventoryLocation.X + }; + } + } + + public Item(GS.Map.World world, ItemTable definition, IEnumerable affixList, string serializedGameAttributeMap) + : base(world, definition.SNOActor) + { + SetInitialValues(definition); + this.Attributes.FillBySerialized(serializedGameAttributeMap); + this.AffixList.Clear(); + this.AffixList.AddRange(affixList); + + // level requirement + // Attributes[GameAttribute.Requirement, 38] = definition.RequiredLevel; + /* + Attributes[GameAttribute.Item_Quality_Level] = 1; + if (Item.IsArmor(this.ItemType) || Item.IsWeapon(this.ItemType) || Item.IsOffhand(this.ItemType)) + Attributes[GameAttribute.Item_Quality_Level] = RandomHelper.Next(6); + if (this.ItemType.Flags.HasFlag(ItemFlags.AtLeastMagical) && Attributes[GameAttribute.Item_Quality_Level] < 3) + Attributes[GameAttribute.Item_Quality_Level] = 3; + */ + //Attributes[GameAttribute.ItemStackQuantityLo] = 1; + //Attributes[GameAttribute.Seed] = RandomHelper.Next(); //unchecked((int)2286800181); + /* + RandomGenerator = new ItemRandomHelper(Attributes[GameAttribute.Seed]); + RandomGenerator.Next(); + if (Item.IsArmor(this.ItemType)) + RandomGenerator.Next(); // next value is used but unknown if armor + RandomGenerator.ReinitSeed();*/ + } + + + private void SetInitialValues(ItemTable definition) + { + this.ItemDefinition = definition; + this.ItemLevel = definition.ItemLevel; + this.GBHandle.Type = (int)GBHandleType.Gizmo; + this.GBHandle.GBID = definition.Hash; + this.ItemType = ItemGroup.FromHash(definition.ItemType1); + this.EquipmentSlot = 0; + this.InventoryLocation = new Vector2D { X = 0, Y = 0 }; + this.Scale = 1.0f; + this.RotationW = 0.0f; + this.RotationAxis.Set(0.0f, 0.0f, 1.0f); + this.CurrentState = ItemState.Normal; + this.Field2 = 0x00000000; + this.Field7 = 0; + this.NameSNOId = -1; // I think it is ignored anyways - farmy + this.Field10 = 0x00; + + + + + + + } + public Item(GS.Map.World world, ItemTable definition) + : base(world, definition.SNOActor) + { + SetInitialValues(definition); + this.ItemHasChanges = true;//initial, this is set to true. + // level requirement + // Attributes[GameAttribute.Requirement, 38] = definition.RequiredLevel; + + Attributes[GameAttribute.Item_Quality_Level] = 1; + if (Item.IsArmor(this.ItemType) || Item.IsWeapon(this.ItemType) || Item.IsOffhand(this.ItemType)) + Attributes[GameAttribute.Item_Quality_Level] = RandomHelper.Next(6); + if (this.ItemType.Flags.HasFlag(ItemFlags.AtLeastMagical) && Attributes[GameAttribute.Item_Quality_Level] < 3) + Attributes[GameAttribute.Item_Quality_Level] = 3; + + Attributes[GameAttribute.ItemStackQuantityLo] = 1; + Attributes[GameAttribute.Seed] = RandomHelper.Next(); //unchecked((int)2286800181); + + RandomGenerator = new ItemRandomHelper(Attributes[GameAttribute.Seed]); + RandomGenerator.Next(); + if (Item.IsArmor(this.ItemType)) + RandomGenerator.Next(); // next value is used but unknown if armor + RandomGenerator.ReinitSeed(); + + ApplyWeaponSpecificOptions(definition); + ApplyArmorSpecificOptions(definition); + ApplyDurability(definition); + ApplySkills(definition); + ApplyAttributeSpecifier(definition); + + int affixNumber = 1; + if (Attributes[GameAttribute.Item_Quality_Level] >= 3) + affixNumber = Attributes[GameAttribute.Item_Quality_Level] - 2; + AffixGenerator.Generate(this, affixNumber); + } + + + + + private void ApplyWeaponSpecificOptions(ItemTable definition) + { + if (definition.WeaponDamageMin > 0) + { + Attributes[GameAttribute.Attacks_Per_Second_Item] += definition.AttacksPerSecond; + //scripted //Attributes[GameAttribute.Attacks_Per_Second_Item_Subtotal] += definition.AttacksPerSecond; + //scripted //Attributes[GameAttribute.Attacks_Per_Second_Item_Total] += definition.AttacksPerSecond; + + Attributes[GameAttribute.Damage_Weapon_Min, 0] += definition.WeaponDamageMin; + //scripted //Attributes[GameAttribute.Damage_Weapon_Min_Total, 0] += definition.WeaponDamageMin; + + Attributes[GameAttribute.Damage_Weapon_Delta, 0] += definition.WeaponDamageDelta; + //scripted //Attributes[GameAttribute.Damage_Weapon_Delta_SubTotal, 0] += definition.WeaponDamageDelta; + //scripted //Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0] += definition.WeaponDamageDelta; + + //scripted //Attributes[GameAttribute.Damage_Weapon_Max, 0] += Attributes[GameAttribute.Damage_Weapon_Min, 0] + Attributes[GameAttribute.Damage_Weapon_Delta, 0]; + //scripted //Attributes[GameAttribute.Damage_Weapon_Max_Total, 0] += Attributes[GameAttribute.Damage_Weapon_Min_Total, 0] + Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0]; + + //scripted //Attributes[GameAttribute.Damage_Weapon_Min_Total_All] = definition.WeaponDamageMin; + //scripted //Attributes[GameAttribute.Damage_Weapon_Delta_Total_All] = definition.WeaponDamageDelta; + } + } + + private void ApplyArmorSpecificOptions(ItemTable definition) + { + if (definition.ArmorValue > 0) + { + Attributes[GameAttribute.Armor_Item] += definition.ArmorValue; + //scripted //Attributes[GameAttribute.Armor_Item_SubTotal] += definition.ArmorValue; + //scripted //Attributes[GameAttribute.Armor_Item_Total] += definition.ArmorValue; + } + } + + private void ApplyDurability(ItemTable definition) + { + if (definition.DurabilityMin > 0) + { + int durability = definition.DurabilityMin + RandomHelper.Next(definition.DurabilityDelta); + Attributes[GameAttribute.Durability_Cur] = durability; + Attributes[GameAttribute.Durability_Max] = durability; + } + } + + private void ApplySkills(ItemTable definition) + { + if (definition.SNOSkill0 != -1) + { + Attributes[GameAttribute.Skill, definition.SNOSkill0] = 1; + } + if (definition.SNOSkill1 != -1) + { + Attributes[GameAttribute.Skill, definition.SNOSkill1] = 1; + } + if (definition.SNOSkill2 != -1) + { + Attributes[GameAttribute.Skill, definition.SNOSkill2] = 1; + } + if (definition.SNOSkill3 != -1) + { + Attributes[GameAttribute.Skill, definition.SNOSkill3] = 1; + } + } + + private void ApplyAttributeSpecifier(ItemTable definition) + { + foreach (var effect in definition.Attribute) + { + float result; + if (FormulaScript.Evaluate(effect.Formula.ToArray(), this.RandomGenerator, out result)) + { + //Logger.Debug("Randomized value for attribute " + GameAttribute.Attributes[effect.AttributeId].Name + " is " + result); + + if (GameAttribute.Attributes[effect.AttributeId] is GameAttributeF) + { + var attr = GameAttribute.Attributes[effect.AttributeId] as GameAttributeF; + if (effect.SNOParam != -1) + Attributes[attr, effect.SNOParam] += result; + else + Attributes[attr] += result; + } + else if (GameAttribute.Attributes[effect.AttributeId] is GameAttributeI) + { + var attr = GameAttribute.Attributes[effect.AttributeId] as GameAttributeI; + if (effect.SNOParam != -1) + Attributes[attr, effect.SNOParam] += (int)result; + else + Attributes[attr] += (int)result; + } + } + } + } + + // There are 2 VisualItemClasses... any way to use the builder to create a D3 Message? + public VisualItem CreateVisualItem() + { + return new VisualItem() + { + GbId = this.GBHandle.GBID, + Field1 = Attributes[GameAttribute.DyeType], + Field2 = 0, + Field3 = -1 + }; + } + + //TODO: Move to proper D3.Hero.Visual item classes + public D3.Hero.VisualItem GetVisualItem() + { + var visualItem = D3.Hero.VisualItem.CreateBuilder() + .SetGbid(this.GBHandle.GBID) + .SetDyeType(Attributes[GameAttribute.DyeType]) + .SetEffectLevel(0) + .SetItemEffectType(-1) + .Build(); + return visualItem; + } + + #region Is* + public static bool IsHealthGlobe(ItemTypeTable itemType) + { + return ItemGroup.IsSubType(itemType, "HealthGlyph"); + } + + public static bool IsGold(ItemTypeTable itemType) + { + return ItemGroup.IsSubType(itemType, "Gold"); + } + + public static bool IsPotion(ItemTypeTable itemType) + { + return ItemGroup.IsSubType(itemType, "Potion"); + } + + public static bool IsAccessory(ItemTypeTable itemType) + { + return ItemGroup.IsSubType(itemType, "Jewelry"); + } + + public static bool IsRuneOrJewel(ItemTypeTable itemType) + { + return ItemGroup.IsSubType(itemType, "Gem") || ItemGroup.IsSubType(itemType, "SpellRune"); + } + + public static bool IsJournalOrScroll(ItemTypeTable itemType) + { + return ItemGroup.IsSubType(itemType, "Scroll") || ItemGroup.IsSubType(itemType, "Book"); + } + + public static bool IsDye(ItemTypeTable itemType) + { + return ItemGroup.IsSubType(itemType, "Dye"); + } + + public static bool IsWeapon(ItemTypeTable itemType) + { + return ItemGroup.IsSubType(itemType, "Weapon"); + } + + public static bool IsArmor(ItemTypeTable itemType) + { + return ItemGroup.IsSubType(itemType, "Armor"); + } + + public static bool IsOffhand(ItemTypeTable itemType) + { + return ItemGroup.IsSubType(itemType, "Offhand"); + } + + public static bool Is2H(ItemTypeTable itemType) + { + return ItemGroup.Is2H(itemType); + } + #endregion + + public void SetInventoryLocation(int equipmentSlot, int column, int row) + { + this.EquipmentSlot = equipmentSlot; + this.InventoryLocation.X = column; + this.InventoryLocation.Y = row; + if (this.Owner is GS.Players.Player) + { + var player = (this.Owner as GS.Players.Player); + if (!this.Reveal(player)) + { + player.InGameClient.SendMessage(this.ACDInventoryPositionMessage); + } + } + } + + public void SetNewWorld(World world) + { + if (this.World == world) + return; + + this.World = world; + } + + public void Drop(Player owner, Vector3D position) + { + this.Owner = owner; + this.EnterWorld(position); + } + + public override void OnTargeted(Player player, TargetMessage message) + { + //Logger.Trace("OnTargeted"); + player.Inventory.PickUp(this); + } + + public virtual void OnRequestUse(Player player, Item target, int actionId, WorldPlace worldPlace) + { + throw new System.NotImplementedException(); + } + + public override bool Reveal(Player player) + { + if (this.CurrentState == ItemState.PickingUp && HasWorldLocation) + return false; + + if (!base.Reveal(player)) + return false; + + var affixGbis = new int[AffixList.Count]; + for (int i = 0; i < AffixList.Count; i++) + { + affixGbis[i] = AffixList[i].AffixGbid; + } + + player.InGameClient.SendMessage(new AffixMessage() + { + ActorID = DynamicID, + Field1 = 0x00000001, + aAffixGBIDs = affixGbis, + }); + + player.InGameClient.SendMessage(new AffixMessage() + { + ActorID = DynamicID, + Field1 = 0x00000002, + aAffixGBIDs = new int[0], + }); + + return true; + } + + public override bool Unreveal(Player player) + { + if (CurrentState == ItemState.PickingUp && player == Owner) + { + return false; + } + return base.Unreveal(player); + } + } + + public enum ItemState + { + Normal, + PickingUp, + Dropping + } +} diff --git a/src/Mooege/Core/GS/Items/ItemCreation/AttributeCreatorFactory.cs b/src/Mooege/Core/GS/Items/ItemCreation/AttributeCreatorFactory.cs new file mode 100644 index 00000000..47afa38e --- /dev/null +++ b/src/Mooege/Core/GS/Items/ItemCreation/AttributeCreatorFactory.cs @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using Mooege.Common.MPQ.FileFormats; + +namespace Mooege.Core.GS.Items.ItemCreation +{ + internal class AttributeCreatorFactory + { + public List Create(ItemTypeTable itemType) + { + var creatorList = new List { new DefaultAttributeCreator() }; + + //if (Item.IsWeapon(itemType)) creatorList.Add(new WeaponAttributeCreator()); + //else if (Item.IsPotion(itemType)) creatorList.Add(new PotionAttributeCreator()); + + return creatorList; + } + } +} diff --git a/src/Mooege/Core/GS/Items/ItemCreation/DefaultAttributeCreator.cs b/src/Mooege/Core/GS/Items/ItemCreation/DefaultAttributeCreator.cs new file mode 100644 index 00000000..cd764836 --- /dev/null +++ b/src/Mooege/Core/GS/Items/ItemCreation/DefaultAttributeCreator.cs @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Common.Helpers.Math; +using Mooege.Net.GS.Message; +using Mooege.Common.Helpers; + +namespace Mooege.Core.GS.Items.ItemCreation +{ + class DefaultAttributeCreator : IItemAttributeCreator + { + public void CreateAttributes(Item item) + { + item.Attributes[GameAttribute.Item_Quality_Level] = 1; + item.Attributes[GameAttribute.Seed] = RandomHelper.Next(); //unchecked((int)2286800181); + } + } +} diff --git a/src/Mooege/Core/GS/Items/ItemCreation/IItemAttributeCreator.cs b/src/Mooege/Core/GS/Items/ItemCreation/IItemAttributeCreator.cs new file mode 100644 index 00000000..4531293a --- /dev/null +++ b/src/Mooege/Core/GS/Items/ItemCreation/IItemAttributeCreator.cs @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace Mooege.Core.GS.Items.ItemCreation +{ + public interface IItemAttributeCreator + { + void CreateAttributes(Item item); + } +} diff --git a/src/Mooege/Core/GS/Items/ItemCreation/PotionAttributeCreator.cs b/src/Mooege/Core/GS/Items/ItemCreation/PotionAttributeCreator.cs new file mode 100644 index 00000000..c1d4bb7d --- /dev/null +++ b/src/Mooege/Core/GS/Items/ItemCreation/PotionAttributeCreator.cs @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Net.GS.Message; + +namespace Mooege.Core.GS.Items.ItemCreation +{ + class PotionAttributeCreator : IItemAttributeCreator + { + public void CreateAttributes(Item item) + { + item.Attributes[GameAttribute.Hitpoints_Granted] = 250f; + item.Attributes[GameAttribute.ItemStackQuantityLo] = 1; + } + } +} diff --git a/src/Mooege/Core/GS/Items/ItemCreation/WeaponAttributeCreator.cs b/src/Mooege/Core/GS/Items/ItemCreation/WeaponAttributeCreator.cs new file mode 100644 index 00000000..e39c1fc7 --- /dev/null +++ b/src/Mooege/Core/GS/Items/ItemCreation/WeaponAttributeCreator.cs @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Common.Helpers; +using Mooege.Common.Helpers.Math; +using Mooege.Net.GS.Message; + +namespace Mooege.Core.GS.Items.ItemCreation +{ + class WeaponAttributeCreator : IItemAttributeCreator + { + public void CreateAttributes(Item item) + { + item.Attributes[GameAttribute.Skill, 0x7780] = 1; + item.Attributes[GameAttribute.IdentifyCost] = 1; + + const float heroAttackspeed = 1.2f; // musst be calculated by Skills + passives + affixes + ... + const float heroMaxDmg = 50f; // musst be calculated by Skills + passives + affixes + ... + const float heroMinDmg = 10f; // musst be calculated by Skills + passives + affixes + ... + const float offhandMultiplier = 0.8f; + + var weaponDmg = (float)(RandomHelper.NextDouble() * 100) + 10; + var attackspeed = (float)(RandomHelper.NextDouble() + 0.5); + var minWeaponDmg = weaponDmg - ((float)(RandomHelper.NextDouble() * 20) + 10); + + item.Attributes[GameAttribute.Attacks_Per_Second_Total] = attackspeed * heroAttackspeed; + item.Attributes[GameAttribute.Attacks_Per_Second_Item] = attackspeed; + item.Attributes[GameAttribute.Attacks_Per_Second_Item_Subtotal] = attackspeed; + item.Attributes[GameAttribute.Attacks_Per_Second_Item_Total] = attackspeed; + item.Attributes[GameAttribute.Attacks_Per_Second_Item_MainHand] = attackspeed; + item.Attributes[GameAttribute.Attacks_Per_Second_Item_OffHand] = attackspeed + 1; + item.Attributes[GameAttribute.Attacks_Per_Second_Item_Total_MainHand] = attackspeed; + item.Attributes[GameAttribute.Attacks_Per_Second_Item_Total_OffHand] = attackspeed + 1; + + item.Attributes[GameAttribute.Damage_Weapon_Min, 0] = minWeaponDmg; + item.Attributes[GameAttribute.Damage_Weapon_Min_Total, 0] = minWeaponDmg + heroMinDmg; + item.Attributes[GameAttribute.Damage_Weapon_Min_Total, 0xFFFFF] = minWeaponDmg + heroMinDmg; + item.Attributes[GameAttribute.Damage_Weapon_Min_Total_All] = minWeaponDmg + heroMinDmg; + item.Attributes[GameAttribute.Damage_Weapon_Min_Total_MainHand, 0] = minWeaponDmg + heroMinDmg; + item.Attributes[GameAttribute.Damage_Weapon_Min_Total_MainHand, 0xFFFFF] = minWeaponDmg + heroMinDmg; + item.Attributes[GameAttribute.Damage_Weapon_Min_Total_OffHand, 0] = (minWeaponDmg + heroMinDmg) * offhandMultiplier; + item.Attributes[GameAttribute.Damage_Weapon_Min_Total_OffHand, 0xFFFFF] = (minWeaponDmg + heroMinDmg) * offhandMultiplier; + + item.Attributes[GameAttribute.Damage_Weapon_Max, 0] = weaponDmg; + item.Attributes[GameAttribute.Damage_Weapon_Max, 0xFFFFF] = weaponDmg; + item.Attributes[GameAttribute.Damage_Weapon_Max_Total, 0] = weaponDmg + heroMaxDmg; + item.Attributes[GameAttribute.Damage_Weapon_Max_Total, 0xFFFFF] = weaponDmg + heroMaxDmg; + + item.Attributes[GameAttribute.Damage_Weapon_Delta, 0] = weaponDmg - minWeaponDmg; + item.Attributes[GameAttribute.Damage_Weapon_Delta_SubTotal, 0] = (weaponDmg + heroMaxDmg) - (minWeaponDmg + heroMinDmg); + item.Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0] = (weaponDmg + heroMaxDmg) - (minWeaponDmg + heroMinDmg); + item.Attributes[GameAttribute.Damage_Weapon_Delta_Total_All] = (weaponDmg + heroMaxDmg) - (minWeaponDmg + heroMinDmg); + item.Attributes[GameAttribute.Damage_Weapon_Delta_Total_MainHand, 0] = (weaponDmg + heroMaxDmg) - (minWeaponDmg + heroMinDmg); + item.Attributes[GameAttribute.Damage_Weapon_Delta_Total_OffHand, 0] = 3.051758E-05f; + + bool equipped = false; // (item.InvLoc.x + item.InvLoc.y == 0) ? 0 : 1; + + item.Attributes[GameAttribute.Item_Equipped] = equipped; + + item.Attributes[GameAttribute.Durability_Max] = 400; + item.Attributes[GameAttribute.Durability_Cur] = 400; + } + } +} diff --git a/src/Mooege/Core/GS/Items/ItemGenerator.cs b/src/Mooege/Core/GS/Items/ItemGenerator.cs new file mode 100644 index 00000000..49fcea04 --- /dev/null +++ b/src/Mooege/Core/GS/Items/ItemGenerator.cs @@ -0,0 +1,367 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Data.SQLite; +using System.Diagnostics; +using System.Linq; +using System.Collections.Generic; +using Mooege.Common.Helpers.Hash; +using Mooege.Common.Helpers.Math; +using Mooege.Common.Logging; +using Mooege.Common.Storage; +using Mooege.Common.Storage.AccountDataBase.Entities; +using Mooege.Core.GS.Players; +using Mooege.Net.GS.Message; +using Mooege.Common.MPQ.FileFormats; +using Mooege.Common.MPQ; +using Mooege.Core.GS.Common.Types.SNO; +using System.Reflection; +using World = Mooege.Core.GS.Map.World; + +// FIXME: Most of this stuff should be elsewhere and not explicitly generate items to the player's GroundItems collection / komiga? + +namespace Mooege.Core.GS.Items +{ + public static class ItemGenerator + { + public static readonly Logger Logger = LogManager.CreateLogger(); + + private static readonly Dictionary Items = new Dictionary(); + private static readonly Dictionary GBIDHandlers = new Dictionary(); + private static readonly Dictionary TypeHandlers = new Dictionary(); + private static readonly HashSet AllowedItemTypes = new HashSet(); + + //private static readonly Dictionary> DbItems = new Dictionary>(); //we need this list to delete item_instances from items which have no owner anymore. + //private static readonly Dictionary CachedItems = new Dictionary(); + + + + public static int TotalItems + { + get { return Items.Count; } + } + + static ItemGenerator() + { + LoadItems(); + LoadHandlers(); + SetAllowedTypes(); + } + + private static void LoadHandlers() + { + foreach (var type in Assembly.GetExecutingAssembly().GetTypes()) + { + if (!type.IsSubclassOf(typeof(Item))) continue; + + var attributes = (HandledItemAttribute[])type.GetCustomAttributes(typeof(HandledItemAttribute), true); + if (attributes.Length != 0) + { + foreach (var name in attributes.First().Names) + { + GBIDHandlers.Add(StringHashHelper.HashItemName(name), type); + } + } + + var typeAttributes = (HandledTypeAttribute[])type.GetCustomAttributes(typeof(HandledTypeAttribute), true); + if (typeAttributes.Length != 0) + { + foreach (var typeName in typeAttributes.First().Types) + { + TypeHandlers.Add(StringHashHelper.HashItemName(typeName), type); + } + } + } + } + + private static void LoadItems() + { + foreach (var asset in MPQStorage.Data.Assets[SNOGroup.GameBalance].Values) + { + GameBalance data = asset.Data as GameBalance; + if (data != null && data.Type == BalanceType.Items) + { + foreach (var itemDefinition in data.Item) + { + Items.Add(itemDefinition.Hash, itemDefinition); + } + } + } + } + + private static void SetAllowedTypes() + { + foreach (int hash in ItemGroup.SubTypesToHashList("Weapon")) + AllowedItemTypes.Add(hash); + foreach (int hash in ItemGroup.SubTypesToHashList("Armor")) + AllowedItemTypes.Add(hash); + foreach (int hash in ItemGroup.SubTypesToHashList("Offhand")) + AllowedItemTypes.Add(hash); + foreach (int hash in ItemGroup.SubTypesToHashList("Jewelry")) + AllowedItemTypes.Add(hash); + foreach (int hash in ItemGroup.SubTypesToHashList("Utility")) + AllowedItemTypes.Add(hash); + foreach (int hash in ItemGroup.SubTypesToHashList("CraftingPlan")) + AllowedItemTypes.Add(hash); + foreach (int hash in TypeHandlers.Keys) + { + if (AllowedItemTypes.Contains(hash)) + { + // already added structure + continue; + } + foreach (int subhash in ItemGroup.SubTypesToHashList(ItemGroup.FromHash(hash).Name)) + { + if (AllowedItemTypes.Contains(subhash)) + { + // already added structure + continue; + } + AllowedItemTypes.Add(subhash); + } + } + + } + + // generates a random item. + public static Item GenerateRandom(Mooege.Core.GS.Actors.Actor owner) + { + var itemDefinition = GetRandom(Items.Values.ToList()); + return CreateItem(owner, itemDefinition); + } + + // generates a random item from given type category. + // we can also set a difficulty mode parameter here, but it seems current db doesnt have nightmare or hell-mode items with valid snoId's /raist. + public static Item GenerateRandom(Mooege.Core.GS.Actors.Actor player, ItemTypeTable type) + { + var itemDefinition = GetRandom(Items.Values + .Where(def => ItemGroup + .HierarchyToHashList(ItemGroup.FromHash(def.ItemType1)).Contains(type.Hash)).ToList()); + return CreateItem(player, itemDefinition); + } + + private static ItemTable GetRandom(List pool) + { + var found = false; + ItemTable itemDefinition = null; + + while (!found) + { + itemDefinition = pool[RandomHelper.Next(0, pool.Count() - 1)]; + + if (itemDefinition.SNOActor == -1) continue; + + // if ((itemDefinition.ItemType1 == StringHashHelper.HashItemName("Book")) && (itemDefinition.BaseGoldValue != 0)) return itemDefinition; // testing books /xsochor + // if (itemDefinition.ItemType1 != StringHashHelper.HashItemName("Book")) continue; // testing books /xsochor + // if (!ItemGroup.SubTypesToHashList("SpellRune").Contains(itemDefinition.ItemType1)) continue; // testing spellrunes /xsochor + + // ignore gold and healthglobe, they should drop only when expect, not randomly + if (itemDefinition.Name.ToLower().Contains("gold")) continue; + if (itemDefinition.Name.ToLower().Contains("healthglobe")) continue; + if (itemDefinition.Name.ToLower().Contains("pvp")) continue; + if (itemDefinition.Name.ToLower().Contains("unique")) continue; + if (itemDefinition.Name.ToLower().Contains("crafted")) continue; + if (itemDefinition.Name.ToLower().Contains("debug")) continue; + if (itemDefinition.Name.ToLower().Contains("missing")) continue; //I believe I've seen a missing item before, may have been affix though. //Wetwlly + if ((itemDefinition.ItemType1 == StringHashHelper.HashItemName("Book")) && (itemDefinition.BaseGoldValue == 0)) continue; // i hope it catches all lore with npc spawned /xsochor + + if (!GBIDHandlers.ContainsKey(itemDefinition.Hash) && + !AllowedItemTypes.Contains(itemDefinition.ItemType1)) continue; + + found = true; + } + + return itemDefinition; + } + + public static Type GetItemClass(ItemTable definition) + { + Type type = typeof(Item); + + if (GBIDHandlers.ContainsKey(definition.Hash)) + { + type = GBIDHandlers[definition.Hash]; + } + else + { + foreach (var hash in ItemGroup.HierarchyToHashList(ItemGroup.FromHash(definition.ItemType1))) + { + if (TypeHandlers.ContainsKey(hash)) + { + type = TypeHandlers[hash]; + break; + } + } + } + + return type; + } + + public static Item CloneItem(Item originalItem) + { + var clonedItem = CreateItem(originalItem.Owner, originalItem.ItemDefinition); + AffixGenerator.CloneIntoItem(originalItem, clonedItem); + return clonedItem; + } + + // Creates an item based on supplied definition. + public static Item CreateItem(Mooege.Core.GS.Actors.Actor owner, ItemTable definition) + { + // Logger.Trace("Creating item: {0} [sno:{1}, gbid {2}]", definition.Name, definition.SNOActor, StringHashHelper.HashItemName(definition.Name)); + + Type type = GetItemClass(definition); + + var item = (Item)Activator.CreateInstance(type, new object[] { owner.World, definition }); + + return item; + } + + // Allows cooking a custom item. + public static Item Cook(Player player, string name) + { + int hash = StringHashHelper.HashItemName(name); + ItemTable definition = Items[hash]; + return CookFromDefinition(player, definition); + } + + // Allows cooking a custom item. + public static Item CookFromDefinition(Player player, ItemTable definition) + { + Type type = GetItemClass(definition); + + var item = (Item)Activator.CreateInstance(type, new object[] { player.World, definition }); + //player.GroundItems[item.DynamicID] = item; + + return item; + } + + public static ItemTable GetItemDefinition(int gbid) + { + return (Items.ContainsKey(gbid)) ? Items[gbid] : null; + } + + public static Item CreateGold(Player player, int amount) + { + var item = Cook(player, "Gold1"); + item.Attributes[GameAttribute.Gold] = amount; + + return item; + } + + public static Item CreateGlobe(Player player, int amount) + { + if (amount > 10) + amount = 10 + ((amount - 10) * 5); + + var item = Cook(player, "HealthGlobe" + amount); + item.Attributes[GameAttribute.Health_Globe_Bonus_Health] = amount; + + return item; + } + + public static bool IsValidItem(string name) + { + return Items.ContainsKey(StringHashHelper.HashItemName(name)); + } + + public static void SaveToDB(Item item) + { + var timestart = DateTime.Now; + + + + if (!item.ItemHasChanges && item.DBItemInstance != null) + { + //Logger.Debug("Item instance not saved, is already in DB and NOT CHANGED."); + } + else + { + if (item.DBItemInstance == null) + item.DBItemInstance = new DBItemInstance(); + var affixSer = SerializeAffixList(item.AffixList); + var attributesSer = item.Attributes.Serialize(); + item.DBItemInstance.Affixes = affixSer; + item.DBItemInstance.Attributes = attributesSer; + item.DBItemInstance.GbId = item.GBHandle.GBID; + DBSessions.AccountSession.SaveOrUpdate(item.DBItemInstance); + if (item.DBInventory != null) + { + item.DBInventory.DBItemInstance = item.DBItemInstance; + DBSessions.AccountSession.SaveOrUpdate(item.DBInventory); + } + + DBSessions.AccountSession.Flush(); + } + + + + var timeTaken = DateTime.Now - timestart; + //Logger.Debug("Save item instance #{0}, took {1} msec", item.DBItemInstance.Id, timeTaken.TotalMilliseconds); + + } + + + + public static void DeleteFromDB(Item item) + { + if (item.DBItemInstance == null) + return; + if (item.DBInventory != null) + return;//should be deleted by inventory. + Logger.Debug("Deleting Item instance #{0} from DB", item.DBItemInstance.Id); + if (item.World.CachedItems.ContainsKey(item.DBItemInstance.Id)) + item.World.CachedItems.Remove(item.DBItemInstance.Id); + DBSessions.AccountSession.Delete(item.DBItemInstance); + DBSessions.AccountSession.Flush(); + item.DBItemInstance = null; + } + + + public static Item LoadFromDBInstance(Player owner, DBItemInstance instance)// int dbID, int gbid, string attributesSer, string affixesSer) + { + var table = Items[instance.GbId]; + var itm = new Item(owner.World, table, DeSerializeAffixList(instance.Affixes), instance.Attributes); + itm.DBItemInstance = instance; + + if (!owner.World.DbItems.ContainsKey(owner.World)) + owner.World.DbItems.Add(owner.World, new List()); + if (!owner.World.DbItems[owner.World].Contains(itm)) + owner.World.DbItems[owner.World].Add(itm); + + owner.World.CachedItems[instance.Id] = itm; + return itm; + } + + public static string SerializeAffixList(List affixList) + { + var affixgbIdList = affixList.Select(af => af.AffixGbid); + var affixSer = affixgbIdList.Aggregate(",", (current, affixId) => current + (affixId + ",")).Trim(new[] { ',' }); + return affixSer; + } + + public static List DeSerializeAffixList(string serializedAffixList) + { + var affixListStr = serializedAffixList.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries); + var affixList = affixListStr.Select(int.Parse).Select(affixId => new Affix(affixId)).ToList(); + return affixList; + } + } + +} + diff --git a/src/Mooege/Core/GS/Items/ItemGroup.cs b/src/Mooege/Core/GS/Items/ItemGroup.cs new file mode 100644 index 00000000..15e068fb --- /dev/null +++ b/src/Mooege/Core/GS/Items/ItemGroup.cs @@ -0,0 +1,135 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using Mooege.Common.Helpers.Hash; +using Mooege.Common.MPQ.FileFormats; +using Mooege.Common.MPQ; +using Mooege.Core.GS.Common.Types.SNO; + +namespace Mooege.Core.GS.Items +{ + public static class ItemGroup + { + private static Dictionary ItemTypes = new Dictionary(); + + static ItemGroup() + { + foreach (var asset in MPQStorage.Data.Assets[SNOGroup.GameBalance].Values) + { + GameBalance data = asset.Data as GameBalance; + if (data != null && data.Type == BalanceType.ItemTypes) + { + foreach (var itemTypeDef in data.ItemType) + { + ItemTypes.Add(itemTypeDef.Hash, itemTypeDef); + } + } + } + } + + public static List HierarchyToList(ItemTypeTable itemType) + { + List result = new List(); + var curType = itemType; + if (curType != null) + { + result.Add(curType); + while (curType.ParentType != -1) + { + curType = ItemTypes[curType.ParentType]; + result.Add(curType); + } + } + return result; + } + + public static List HierarchyToHashList(ItemTypeTable itemType) + { + List result = new List(); + var types = HierarchyToList(itemType); + foreach (var type in types) + { + result.Add(type.Hash); + } + return result; + } + + public static List SubTypesToHashList(string name) + { + List result = new List(); + ItemTypeTable rootType = FromString(name); + if (rootType != null) + { + result.Add(rootType.Hash); + for (int i = 0; i < result.Count; ++i) + { + foreach (var type in ItemTypes.Values) + if (type.ParentType == result[i]) + result.Add(type.Hash); + } + } + return result; + } + + public static ItemTypeTable FromString(string name) + { + int hash = StringHashHelper.HashItemName(name); + return FromHash(hash); + } + + public static ItemTypeTable FromHash(int hash) + { + ItemTypeTable result = null; + if (ItemTypes.TryGetValue(hash, out result)) + { + return result; + } + return null; + } + + public static bool IsSubType(ItemTypeTable type, string rootTypeName) + { + return IsSubType(type, StringHashHelper.HashItemName(rootTypeName)); + } + + public static bool IsSubType(ItemTypeTable type, int rootTypeHash) + { + if (type == null) + return false; + + if (type.Hash == rootTypeHash) + return true; + var curType = type; + while (curType.ParentType != -1) + { + curType = ItemTypes[curType.ParentType]; + if (curType.Hash == rootTypeHash) + { + return true; + } + } + return false; + } + + public static bool Is2H(ItemTypeTable type) + { + return (type.Array[0] & 0x400) != 0; + } + } +} diff --git a/src/Mooege/Core/GS/Items/RuneHelper.cs b/src/Mooege/Core/GS/Items/RuneHelper.cs new file mode 100644 index 00000000..39d8bc5d --- /dev/null +++ b/src/Mooege/Core/GS/Items/RuneHelper.cs @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using System.Linq; +using Mooege.Common.MPQ; +using Mooege.Common.MPQ.FileFormats; + +namespace Mooege.Core.GS.Items +{ + public static class RuneHelper + { + /// + /// Dictionary with PowerSNOs as keys and their indexes as values + /// + private readonly static Dictionary PowerToRuneIndexMap = new Dictionary(); + + static RuneHelper() + { + foreach (var entry in MPQStorage.Data.Assets[Common.Types.SNO.SNOGroup.SkillKit].Values) + { + if (entry.Data == null) continue; + + var skillKit = entry.Data as SkillKit; + for (int i = 0; i < skillKit.ActiveSkillEntries.Count; i++) + { + PowerToRuneIndexMap.Add(skillKit.ActiveSkillEntries[i].SNOPower, i); + } + } + } + + /// + /// Returns index of Power. Needed for visual feedback on socketting skills. + /// + /// + /// + public static int GetRuneIndexForPower(int powerSNOId) + { + if (!PowerToRuneIndexMap.Keys.Contains(powerSNOId)) + return -1; + + return PowerToRuneIndexMap[powerSNOId]; + } + } +} diff --git a/src/Mooege/Core/GS/Items/TreasureClassManager.cs b/src/Mooege/Core/GS/Items/TreasureClassManager.cs new file mode 100644 index 00000000..496c502c --- /dev/null +++ b/src/Mooege/Core/GS/Items/TreasureClassManager.cs @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using Mooege.Common.MPQ; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Common.MPQ.FileFormats; +using Mooege.Core.GS.Players; +using Mooege.Net.GS.Message; + +namespace Mooege.Core.GS.Items +{ + + // This Implementation just supports salavging items. + public class TreasureClassManager + { + public static List CreateLoot(Player owner, int treasureClassId) + { + + List items = new List(); + if (MPQStorage.Data.Assets[SNOGroup.TreasureClass].ContainsKey(treasureClassId)) + { + TreasureClass treasureClass = (TreasureClass)MPQStorage.Data.Assets[SNOGroup.TreasureClass][treasureClassId].Data; + foreach (LootDropModifier modifier in treasureClass.LootDropModifiers) + { + ItemTable definition = ItemGenerator.GetItemDefinition(modifier.ItemSpecifier.ItemGBId); + if (definition != null) + { + Item item = ItemGenerator.CreateItem(owner, definition); + item.Attributes[GameAttribute.Item_Quality_Level] = (modifier.GBIdQualityClass > 0) ? modifier.GBIdQualityClass : 0; + items.Add(item); + } + } + } + + return items; + } + } +} \ No newline at end of file diff --git a/src/Mooege/Core/GS/Map/Debug/ControlExtensions.cs b/src/Mooege/Core/GS/Map/Debug/ControlExtensions.cs new file mode 100644 index 00000000..10557b0c --- /dev/null +++ b/src/Mooege/Core/GS/Map/Debug/ControlExtensions.cs @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Windows.Forms; + +namespace Mooege.Core.GS.Map.Debug +{ + /// + /// Provides control extensions. + /// + public static class ControlExtensions + { + /// + /// Double buffers a given control. + /// + /// + public static void DoubleBuffer(this Control control) + { + // http://stackoverflow.com/questions/76993/how-to-double-buffer-net-controls-on-a-form/77233#77233 + // Taxes: Remote Desktop Connection and painting: http://blogs.msdn.com/oldnewthing/archive/2006/01/03/508694.aspx + + if (SystemInformation.TerminalServerSession) return; // if we're in a terminal server session, just ignore the double-buffer request. + System.Reflection.PropertyInfo dbProp = typeof(Control).GetProperty("DoubleBuffered", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); + dbProp.SetValue(control, true, null); + } + + /// + /// Synchronously invokes supplied delegate on the controls actual thread. + /// + /// + /// The delegate that will be invoked. + public static void InvokeHandler(this Control control, MethodInvoker @delegate) // Sync. control-invoke extension. + { + if (control.InvokeRequired) control.Invoke(@delegate); // if we're not in control's actual thread, switch to it and run the supplied delegate. + else @delegate(); // if we don't need an invoke, just run the supplied delegate. + } + + /// + /// Asynchronously invokes supplied delegate on the controls actual thread. + /// + /// + /// The delegate that will be invoked. + public static void AsyncInvokeHandler(this Control control, MethodInvoker @delegate) // Async. control-invoke extension. + { + if (control == null) return; + if (control.InvokeRequired) control.BeginInvoke(@delegate); // if we're not in control's actual thread, switch to it and run the supplied delegate. + else @delegate(); // if we don't need an invoke, just run the supplied delegate. + } + } +} diff --git a/src/Mooege/Core/GS/Map/Debug/DebugNavMesh.cs b/src/Mooege/Core/GS/Map/Debug/DebugNavMesh.cs new file mode 100644 index 00000000..43cf8c85 --- /dev/null +++ b/src/Mooege/Core/GS/Map/Debug/DebugNavMesh.cs @@ -0,0 +1,399 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Drawing; +using System.Threading.Tasks; +using System.Windows; +using Mooege.Common.Helpers.Concurrency; +using Mooege.Core.GS.Actors; +using Mooege.Core.GS.Players; +using System.Collections.Generic; + +namespace Mooege.Core.GS.Map.Debug +{ + public class DebugNavMesh + { + public World World { get; private set; } + public Player Player { get; private set; } + public Rect Bounds { get { return World.QuadTree.RootNode.Bounds; } } + + public ConcurrentList MasterScenes { get; private set; } + public ConcurrentList SubScenes { get; private set; } + public ConcurrentList UnWalkableCells { get; private set; } + public ConcurrentList WalkableCells { get; private set; } + public ConcurrentList Players { get; private set; } + public ConcurrentList Monsters { get; private set; } + public ConcurrentList NPCs { get; private set; } + public ConcurrentList Portals { get; private set; } + + public bool DrawMasterScenes; + public bool DrawSubScenes; + public bool DrawWalkableCells; + public bool DrawUnwalkableCells; + public bool DrawMonsters; + public bool DrawNPCs; + public bool DrawPlayers; + public bool DrawPortals = true; + public bool PrintSceneLabels; + public bool FillCells; + public bool DrawPlayerProximityCircle; + public bool DrawPlayerProximityRectangle; + + private readonly Pen _masterScenePen = new Pen(Color.Black, 1.0f); + private readonly Pen _subScenePen = new Pen(Color.DarkGray, 1.0f); + private readonly Brush _unwalkableBrush = Brushes.Red; + private readonly Pen _unwalkablePen = new Pen(Color.Red, 1.0f); + private readonly Brush _walkableBrush = Brushes.Blue; + private readonly Pen _walkablePen = new Pen(Color.Blue, 1.0f); + private readonly Pen _playerProximityPen = new Pen(Brushes.DarkViolet, 2.0f); + private readonly Font _sceneFont = new Font("Verdana", 7); + + public DebugNavMesh(World world, Player player = null) + { + this.World = world; + this.Player = player; + + this._subScenePen.DashStyle = System.Drawing.Drawing2D.DashStyle.DashDot; + + this.MasterScenes = new ConcurrentList(); + this.SubScenes = new ConcurrentList(); + this.UnWalkableCells = new ConcurrentList(); + this.WalkableCells = new ConcurrentList(); + this.Players = new ConcurrentList(); + this.Monsters = new ConcurrentList(); + this.NPCs = new ConcurrentList(); + this.Portals = new ConcurrentList(); + } + + #region update + + public void Update(bool processObjectsInAllTheWorld) + { + this.MasterScenes.Clear(); + this.SubScenes.Clear(); + this.WalkableCells.Clear(); + this.UnWalkableCells.Clear(); + this.Players.Clear(); + this.Monsters.Clear(); + this.NPCs.Clear(); + + var scenes = (processObjectsInAllTheWorld || this.Player == null) + ? World.QuadTree.Query(World.QuadTree.RootNode.Bounds) + : this.Player.GetScenesInRegion(); + + Parallel.ForEach(scenes, scene => + { + if (scene.Parent == null) + this.MasterScenes.Add(scene); + else + this.SubScenes.Add(scene); + + this.AnalyzeScene(scene); + }); + + var actors = (processObjectsInAllTheWorld || this.Player == null) + ? World.QuadTree.Query(World.QuadTree.RootNode.Bounds) + : this.Player.GetActorsInRange(); + + Parallel.ForEach(actors, actor => + { + if (actor is Player) + this.Players.Add(actor as Player); + else if (actor is NPC) + this.NPCs.Add(actor as NPC); + else if (actor is Monster) + this.Monsters.Add(actor as Monster); + else if (actor is Portal) + this.Portals.Add(actor as Portal); + }); + } + + private void AnalyzeScene(Scene scene) + { + Parallel.ForEach(scene.NavZone.NavCells, cell => + { + float x = scene.Position.X + cell.Min.X; + float y = scene.Position.Y + cell.Min.Y; + + float sizex = cell.Max.X - cell.Min.X; + float sizey = cell.Max.Y - cell.Min.Y; + + var rect = new Rect(x, y, sizex, sizey); + + // TODO: Feature request: Also allow drawing of NavCellFlags.NOSpawn, NavCellFlags.LevelAreaBit0, NavCellFlags.LevelAreaBit1 cells. /raist. + + if ((cell.Flags & Mooege.Common.MPQ.FileFormats.Scene.NavCellFlags.AllowWalk) != Mooege.Common.MPQ.FileFormats.Scene.NavCellFlags.AllowWalk) + UnWalkableCells.Add(rect); + else + WalkableCells.Add(rect); + }); + } + + #endregion + + #region drawing + + public Bitmap Draw() + { + // As quad-tree always has 4 quad-nodes beneath the root node, the quad node's area will be far larger then actual area covered by scenes. + // We don't want to draw a bitmap that's as large as quad-tree's area, as it'll be consuming so much memory. + // So instead find the rightMostScene and bottomMostScene and limit the drawed bitmaps size according. /raist. + // TODO: We can even limit to leftMostScene and topMostScene because player-proximity rendering mode will be also containing large empty areas. /raist. + + Scene rightMostScene = null; + Scene bottomMostScene = null; + + foreach (var scene in this.MasterScenes) + { + if (rightMostScene == null) + rightMostScene = scene; + + if (bottomMostScene == null) + bottomMostScene = scene; + + if (scene.Bounds.X + scene.Bounds.Width > rightMostScene.Bounds.X + rightMostScene.Bounds.Width) + rightMostScene = scene; + + if (scene.Bounds.Y + scene.Bounds.Height > bottomMostScene.Bounds.Y + bottomMostScene.Bounds.Height) + bottomMostScene = scene; + } + + if (rightMostScene == null || bottomMostScene == null) + return null; + + var maxX = (int)(rightMostScene.Bounds.X + rightMostScene.Bounds.Width) + 1; + var maxY = (int)(bottomMostScene.Bounds.Y + bottomMostScene.Bounds.Height) + 1; + + var bitmap = new Bitmap(maxX, maxY, System.Drawing.Imaging.PixelFormat.Format16bppRgb555); + + using (var graphics = Graphics.FromImage(bitmap)) + { + graphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighSpeed; + graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighSpeed; + graphics.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighSpeed; + graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.Default; + + graphics.FillRectangle(Brushes.LightGray, 0, 0, bitmap.Width, bitmap.Height); + + this.DrawShapes(graphics); + + if (this.PrintSceneLabels) + this.DrawLabels(graphics); + + graphics.Save(); + } + + return bitmap; + } + + private void DrawShapes(Graphics graphics) + { + if (this.DrawMasterScenes) + { + foreach (var scene in this.MasterScenes) + { + this.DrawScene(graphics, scene); + } + } + + if (this.DrawSubScenes) + { + foreach (var scene in this.SubScenes) + { + this.DrawScene(graphics, scene); + } + } + + if (this.DrawWalkableCells) + this.DrawWalkables(graphics); + + if (this.DrawUnwalkableCells) + this.DrawUnwalkables(graphics); + + if (this.DrawMonsters) + { + foreach (var monster in this.Monsters) + { + this.DrawActor(monster, graphics, Brushes.Green, 7); + } + } + + if (this.DrawNPCs) + { + foreach (var npc in this.NPCs) + { + this.DrawActor(npc, graphics, Brushes.Orange, 7); + } + } + + if (this.DrawPlayers) + { + foreach (var player in this.Players) + { + this.DrawActor(player, graphics, Brushes.DarkViolet, 7); + } + } + + if (this.DrawPortals) + { + foreach (var portal in this.Portals) + { + this.DrawActor(portal, graphics, Brushes.Azure, 10); + } + } + + if (this.DrawPlayerProximityCircle) + this.DrawProximityCircle(graphics); + + if (this.DrawPlayerProximityRectangle) + this.DrawProximityRectangle(graphics); + } + + private void DrawScene(Graphics graphics, Scene scene) + { + var rect = new Rectangle((int)scene.Bounds.Left, (int)scene.Bounds.Top, (int)scene.Bounds.Width, (int)scene.Bounds.Height); + graphics.DrawRectangle(scene.Parent == null ? _masterScenePen : _subScenePen, rect); + } + + private void DrawWalkables(Graphics graphics) + { + foreach (var cell in this.WalkableCells) + { + var rect = new Rectangle(new System.Drawing.Point((int)cell.Left, (int)cell.Top), new System.Drawing.Size((int)cell.Width, (int)cell.Height)); + + if (this.FillCells) + graphics.FillRectangle(_walkableBrush, rect); + else + graphics.DrawRectangle(_walkablePen, rect); + } + } + + private void DrawUnwalkables(Graphics graphics) + { + foreach (var cell in this.UnWalkableCells) + { + var rect = new Rectangle(new System.Drawing.Point((int)cell.Left, (int)cell.Top), new System.Drawing.Size((int)cell.Width, (int)cell.Height)); + + if (this.FillCells) + graphics.FillRectangle(_unwalkableBrush, rect); + else + graphics.DrawRectangle(_unwalkablePen, rect); + } + } + + private void DrawActor(Actor actor, Graphics graphics, Brush brush, int radius) + { + var rect = new Rectangle((int)actor.Bounds.X, (int)actor.Bounds.Y, (int)actor.Bounds.Width + radius, (int)actor.Bounds.Height + radius); + graphics.FillEllipse(brush, rect); + } + + private void DrawProximityCircle(Graphics graphics) + { + if (this.Player == null) + return; + + var rect = new RectangleF(this.Player.Position.X - Actor.DefaultQueryProximityRadius, + this.Player.Position.Y - Actor.DefaultQueryProximityRadius, + Actor.DefaultQueryProximityRadius * 2, + Actor.DefaultQueryProximityRadius * 2); + + graphics.DrawEllipse(this._playerProximityPen, rect); + } + + private void DrawProximityRectangle(Graphics graphics) + { + if (this.Player == null) + return; + + graphics.DrawRectangle(this._playerProximityPen, + this.Player.Position.X - Actor.DefaultQueryProximityLenght / 2, + this.Player.Position.Y - Actor.DefaultQueryProximityLenght / 2, + Actor.DefaultQueryProximityLenght, + Actor.DefaultQueryProximityLenght); + } + + private void DrawLabels(Graphics graphics) + { + if (this.DrawMasterScenes) + { + foreach (var scene in this.MasterScenes) + { + this.DrawSceneLabel(graphics, scene); + } + } + + if (this.DrawSubScenes) + { + foreach (var scene in this.SubScenes) + { + this.DrawSceneLabel(graphics, scene); + } + } + } + + private void DrawSceneLabel(Graphics graphics, Scene scene) + { + var stringRectangle = new RectangleF((float)scene.Bounds.Left, (float)scene.Bounds.Top, (float)scene.Bounds.Width, (float)scene.Bounds.Height); + var drawFormat = new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center }; + + if (!string.IsNullOrEmpty(scene.SceneSNO.Name)) + graphics.DrawString(scene.SceneSNO.Name, _sceneFont, scene.Parent == null ? Brushes.Black : Brushes.Gray, stringRectangle, drawFormat); + } + + #endregion + + #region DumpMeshtoObj + public void DumpNavMeshToObj() + { + //Renders all the walkable cells into a 2d model. Output in http://en.wikipedia.org/wiki/Wavefront_.obj_file + List Vertices = new List(); + List faces = new List(); + System.IO.StreamWriter fs = new System.IO.StreamWriter("world.obj"); + foreach (var rect in this.WalkableCells) + { + + Vertices.Add(rect.BottomRight); + Vertices.Add(rect.BottomLeft); + Vertices.Add(rect.TopLeft); + Vertices.Add(rect.TopRight); + faces.Add(new face3(Vertices.Count - 3, Vertices.Count - 2, Vertices.Count - 1, Vertices.Count - 0)); + } + foreach (var x in Vertices) + { + fs.WriteLine("v " + x.X + " " + 0 + " " + x.Y); + } + foreach (var x in faces) + { + fs.WriteLine("f " + (x.i0) + " " + (x.i3) + " " + (x.i2) + " " + (x.i1)); + } + fs.Close(); + } + public class face3 + { + public int i0, i1, i2, i3; + public face3(int i1, int i2, int i3, int i4) + { + this.i0 = i1; + this.i1 = i2; + this.i2 = i3; + this.i3 = i4; + } + } + #endregion + } +} diff --git a/src/Mooege/Core/GS/Map/Debug/WorldVisualizer.Designer.cs b/src/Mooege/Core/GS/Map/Debug/WorldVisualizer.Designer.cs new file mode 100644 index 00000000..091dbc62 --- /dev/null +++ b/src/Mooege/Core/GS/Map/Debug/WorldVisualizer.Designer.cs @@ -0,0 +1,452 @@ +namespace Mooege.Core.GS.Map.Debug +{ + partial class WorldVisualizer + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WorldVisualizer)); + this.pictureBoxStage = new System.Windows.Forms.PictureBox(); + this.checkBoxFillCells = new System.Windows.Forms.CheckBox(); + this.checkBoxPrintSceneLabels = new System.Windows.Forms.CheckBox(); + this.groupActorVisibility = new System.Windows.Forms.GroupBox(); + this.checkBoxMonsters = new System.Windows.Forms.CheckBox(); + this.checkBoxPlayers = new System.Windows.Forms.CheckBox(); + this.checkBoxNPCs = new System.Windows.Forms.CheckBox(); + this.groupMapVisibility = new System.Windows.Forms.GroupBox(); + this.checkBoxUnwalkableCells = new System.Windows.Forms.CheckBox(); + this.checkBoxWalkableCells = new System.Windows.Forms.CheckBox(); + this.checkBoxSubScenes = new System.Windows.Forms.CheckBox(); + this.checkBoxMasterScenes = new System.Windows.Forms.CheckBox(); + this.groupSettings = new System.Windows.Forms.GroupBox(); + this.groupOptions = new System.Windows.Forms.GroupBox(); + this.label1 = new System.Windows.Forms.Label(); + this.trackBarUpdateFrequency = new System.Windows.Forms.TrackBar(); + this.groupBoxRenderMode = new System.Windows.Forms.GroupBox(); + this.checkBoxDrawPlayerProximityRect = new System.Windows.Forms.CheckBox(); + this.checkBoxDrawPlayerProximityCircle = new System.Windows.Forms.CheckBox(); + this.radioButtonPlayerProximity = new System.Windows.Forms.RadioButton(); + this.radioButtonAllWorld = new System.Windows.Forms.RadioButton(); + this.groupPreview = new System.Windows.Forms.GroupBox(); + this.pictureBoxPreview = new System.Windows.Forms.PictureBox(); + this.panelStage = new System.Windows.Forms.Panel(); + this.timerUpdate = new System.Windows.Forms.Timer(this.components); + this.btnDumpMeshToObj = new System.Windows.Forms.Button(); + this.btnNavToToolTip = new System.Windows.Forms.ToolTip(this.components); + ((System.ComponentModel.ISupportInitialize)(this.pictureBoxStage)).BeginInit(); + this.groupActorVisibility.SuspendLayout(); + this.groupMapVisibility.SuspendLayout(); + this.groupSettings.SuspendLayout(); + this.groupOptions.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.trackBarUpdateFrequency)).BeginInit(); + this.groupBoxRenderMode.SuspendLayout(); + this.groupPreview.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBoxPreview)).BeginInit(); + this.panelStage.SuspendLayout(); + this.SuspendLayout(); + // + // pictureBoxStage + // + this.pictureBoxStage.Location = new System.Drawing.Point(0, 0); + this.pictureBoxStage.Name = "pictureBoxStage"; + this.pictureBoxStage.Size = new System.Drawing.Size(1008, 520); + this.pictureBoxStage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.pictureBoxStage.TabIndex = 0; + this.pictureBoxStage.TabStop = false; + // + // checkBoxFillCells + // + this.checkBoxFillCells.AutoSize = true; + this.checkBoxFillCells.Location = new System.Drawing.Point(6, 43); + this.checkBoxFillCells.Name = "checkBoxFillCells"; + this.checkBoxFillCells.Size = new System.Drawing.Size(96, 17); + this.checkBoxFillCells.TabIndex = 1; + this.checkBoxFillCells.Text = "Fill Visible Cells"; + this.checkBoxFillCells.UseVisualStyleBackColor = true; + this.checkBoxFillCells.CheckedChanged += new System.EventHandler(this.checkFillCells_CheckedChanged); + // + // checkBoxPrintSceneLabels + // + this.checkBoxPrintSceneLabels.AutoSize = true; + this.checkBoxPrintSceneLabels.Checked = true; + this.checkBoxPrintSceneLabels.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBoxPrintSceneLabels.Location = new System.Drawing.Point(6, 19); + this.checkBoxPrintSceneLabels.Name = "checkBoxPrintSceneLabels"; + this.checkBoxPrintSceneLabels.Size = new System.Drawing.Size(115, 17); + this.checkBoxPrintSceneLabels.TabIndex = 0; + this.checkBoxPrintSceneLabels.Text = "Print Scene Labels"; + this.checkBoxPrintSceneLabels.UseVisualStyleBackColor = true; + this.checkBoxPrintSceneLabels.CheckedChanged += new System.EventHandler(this.checkPrintLabels_CheckedChanged); + // + // groupActorVisibility + // + this.groupActorVisibility.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + this.groupActorVisibility.Controls.Add(this.checkBoxMonsters); + this.groupActorVisibility.Controls.Add(this.checkBoxPlayers); + this.groupActorVisibility.Controls.Add(this.checkBoxNPCs); + this.groupActorVisibility.Location = new System.Drawing.Point(399, 10); + this.groupActorVisibility.Name = "groupActorVisibility"; + this.groupActorVisibility.Size = new System.Drawing.Size(197, 191); + this.groupActorVisibility.TabIndex = 4; + this.groupActorVisibility.TabStop = false; + this.groupActorVisibility.Text = "Actor Visibility"; + // + // checkBoxMonsters + // + this.checkBoxMonsters.AutoSize = true; + this.checkBoxMonsters.Checked = true; + this.checkBoxMonsters.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBoxMonsters.ForeColor = System.Drawing.Color.Green; + this.checkBoxMonsters.Location = new System.Drawing.Point(6, 65); + this.checkBoxMonsters.Name = "checkBoxMonsters"; + this.checkBoxMonsters.Size = new System.Drawing.Size(102, 17); + this.checkBoxMonsters.TabIndex = 4; + this.checkBoxMonsters.Text = "Monsters Visible"; + this.checkBoxMonsters.UseVisualStyleBackColor = true; + this.checkBoxMonsters.CheckedChanged += new System.EventHandler(this.checkMonsters_CheckedChanged); + // + // checkBoxPlayers + // + this.checkBoxPlayers.AutoSize = true; + this.checkBoxPlayers.Checked = true; + this.checkBoxPlayers.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBoxPlayers.ForeColor = System.Drawing.Color.DarkViolet; + this.checkBoxPlayers.Location = new System.Drawing.Point(6, 19); + this.checkBoxPlayers.Name = "checkBoxPlayers"; + this.checkBoxPlayers.Size = new System.Drawing.Size(93, 17); + this.checkBoxPlayers.TabIndex = 2; + this.checkBoxPlayers.Text = "Players Visible"; + this.checkBoxPlayers.UseVisualStyleBackColor = true; + this.checkBoxPlayers.CheckedChanged += new System.EventHandler(this.checkPlayers_CheckedChanged); + // + // checkBoxNPCs + // + this.checkBoxNPCs.AutoSize = true; + this.checkBoxNPCs.Checked = true; + this.checkBoxNPCs.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBoxNPCs.ForeColor = System.Drawing.Color.Orange; + this.checkBoxNPCs.Location = new System.Drawing.Point(6, 42); + this.checkBoxNPCs.Name = "checkBoxNPCs"; + this.checkBoxNPCs.Size = new System.Drawing.Size(86, 17); + this.checkBoxNPCs.TabIndex = 3; + this.checkBoxNPCs.Text = "NPCs Visible"; + this.checkBoxNPCs.UseVisualStyleBackColor = true; + this.checkBoxNPCs.CheckedChanged += new System.EventHandler(this.checkNPCs_CheckedChanged); + // + // groupMapVisibility + // + this.groupMapVisibility.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + this.groupMapVisibility.Controls.Add(this.checkBoxUnwalkableCells); + this.groupMapVisibility.Controls.Add(this.checkBoxWalkableCells); + this.groupMapVisibility.Controls.Add(this.checkBoxSubScenes); + this.groupMapVisibility.Controls.Add(this.checkBoxMasterScenes); + this.groupMapVisibility.Location = new System.Drawing.Point(196, 10); + this.groupMapVisibility.Name = "groupMapVisibility"; + this.groupMapVisibility.Size = new System.Drawing.Size(197, 191); + this.groupMapVisibility.TabIndex = 3; + this.groupMapVisibility.TabStop = false; + this.groupMapVisibility.Text = "Map Visibility"; + // + // checkBoxUnwalkableCells + // + this.checkBoxUnwalkableCells.AutoSize = true; + this.checkBoxUnwalkableCells.ForeColor = System.Drawing.Color.Red; + this.checkBoxUnwalkableCells.Location = new System.Drawing.Point(6, 88); + this.checkBoxUnwalkableCells.Name = "checkBoxUnwalkableCells"; + this.checkBoxUnwalkableCells.Size = new System.Drawing.Size(140, 17); + this.checkBoxUnwalkableCells.TabIndex = 4; + this.checkBoxUnwalkableCells.Text = "Unwalkable Cells Visible"; + this.checkBoxUnwalkableCells.UseVisualStyleBackColor = true; + this.checkBoxUnwalkableCells.CheckedChanged += new System.EventHandler(this.checkUnwalkableCells_CheckedChanged); + // + // checkBoxWalkableCells + // + this.checkBoxWalkableCells.AutoSize = true; + this.checkBoxWalkableCells.Checked = true; + this.checkBoxWalkableCells.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBoxWalkableCells.ForeColor = System.Drawing.Color.Blue; + this.checkBoxWalkableCells.Location = new System.Drawing.Point(6, 65); + this.checkBoxWalkableCells.Name = "checkBoxWalkableCells"; + this.checkBoxWalkableCells.Size = new System.Drawing.Size(129, 17); + this.checkBoxWalkableCells.TabIndex = 3; + this.checkBoxWalkableCells.Text = "Walkable Cells Visible"; + this.checkBoxWalkableCells.UseVisualStyleBackColor = true; + this.checkBoxWalkableCells.CheckedChanged += new System.EventHandler(this.checkWalkableCells_CheckedChanged); + // + // checkBoxSubScenes + // + this.checkBoxSubScenes.AutoSize = true; + this.checkBoxSubScenes.Checked = true; + this.checkBoxSubScenes.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBoxSubScenes.ForeColor = System.Drawing.Color.DarkGray; + this.checkBoxSubScenes.Location = new System.Drawing.Point(6, 42); + this.checkBoxSubScenes.Name = "checkBoxSubScenes"; + this.checkBoxSubScenes.Size = new System.Drawing.Size(117, 17); + this.checkBoxSubScenes.TabIndex = 2; + this.checkBoxSubScenes.Text = "Sub Scenes Visible"; + this.checkBoxSubScenes.UseVisualStyleBackColor = true; + this.checkBoxSubScenes.CheckedChanged += new System.EventHandler(this.checkSubScenes_CheckedChanged); + // + // checkBoxMasterScenes + // + this.checkBoxMasterScenes.AutoSize = true; + this.checkBoxMasterScenes.Checked = true; + this.checkBoxMasterScenes.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBoxMasterScenes.Location = new System.Drawing.Point(6, 19); + this.checkBoxMasterScenes.Name = "checkBoxMasterScenes"; + this.checkBoxMasterScenes.Size = new System.Drawing.Size(130, 17); + this.checkBoxMasterScenes.TabIndex = 1; + this.checkBoxMasterScenes.Text = "Master Scenes Visible"; + this.checkBoxMasterScenes.UseVisualStyleBackColor = true; + this.checkBoxMasterScenes.CheckedChanged += new System.EventHandler(this.checkMasterScenes_CheckedChanged); + // + // groupSettings + // + this.groupSettings.Controls.Add(this.groupOptions); + this.groupSettings.Controls.Add(this.groupBoxRenderMode); + this.groupSettings.Controls.Add(this.groupPreview); + this.groupSettings.Controls.Add(this.groupMapVisibility); + this.groupSettings.Controls.Add(this.groupActorVisibility); + this.groupSettings.Dock = System.Windows.Forms.DockStyle.Bottom; + this.groupSettings.Location = new System.Drawing.Point(0, 520); + this.groupSettings.Name = "groupSettings"; + this.groupSettings.Size = new System.Drawing.Size(1008, 210); + this.groupSettings.TabIndex = 1; + this.groupSettings.TabStop = false; + // + // groupOptions + // + this.groupOptions.Controls.Add(this.btnDumpMeshToObj); + this.groupOptions.Controls.Add(this.label1); + this.groupOptions.Controls.Add(this.trackBarUpdateFrequency); + this.groupOptions.Controls.Add(this.checkBoxFillCells); + this.groupOptions.Controls.Add(this.checkBoxPrintSceneLabels); + this.groupOptions.Location = new System.Drawing.Point(805, 10); + this.groupOptions.Name = "groupOptions"; + this.groupOptions.Size = new System.Drawing.Size(197, 191); + this.groupOptions.TabIndex = 7; + this.groupOptions.TabStop = false; + this.groupOptions.Text = "Options"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(6, 69); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(98, 13); + this.label1.TabIndex = 3; + this.label1.Text = "Update Frequency:"; + // + // trackBarUpdateFrequency + // + this.trackBarUpdateFrequency.Location = new System.Drawing.Point(6, 87); + this.trackBarUpdateFrequency.Name = "trackBarUpdateFrequency"; + this.trackBarUpdateFrequency.Size = new System.Drawing.Size(185, 45); + this.trackBarUpdateFrequency.TabIndex = 2; + this.trackBarUpdateFrequency.TickStyle = System.Windows.Forms.TickStyle.Both; + this.trackBarUpdateFrequency.ValueChanged += new System.EventHandler(this.trackBarUpdateFrequency_ValueChanged); + // + // groupBoxRenderMode + // + this.groupBoxRenderMode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + this.groupBoxRenderMode.Controls.Add(this.checkBoxDrawPlayerProximityRect); + this.groupBoxRenderMode.Controls.Add(this.checkBoxDrawPlayerProximityCircle); + this.groupBoxRenderMode.Controls.Add(this.radioButtonPlayerProximity); + this.groupBoxRenderMode.Controls.Add(this.radioButtonAllWorld); + this.groupBoxRenderMode.Location = new System.Drawing.Point(602, 10); + this.groupBoxRenderMode.Name = "groupBoxRenderMode"; + this.groupBoxRenderMode.Size = new System.Drawing.Size(197, 191); + this.groupBoxRenderMode.TabIndex = 6; + this.groupBoxRenderMode.TabStop = false; + this.groupBoxRenderMode.Text = "Render Mode"; + // + // checkBoxDrawPlayerProximityRect + // + this.checkBoxDrawPlayerProximityRect.AutoSize = true; + this.checkBoxDrawPlayerProximityRect.Enabled = false; + this.checkBoxDrawPlayerProximityRect.Location = new System.Drawing.Point(5, 87); + this.checkBoxDrawPlayerProximityRect.Name = "checkBoxDrawPlayerProximityRect"; + this.checkBoxDrawPlayerProximityRect.Size = new System.Drawing.Size(153, 17); + this.checkBoxDrawPlayerProximityRect.TabIndex = 2; + this.checkBoxDrawPlayerProximityRect.Text = "Draw Player Proximity Rect"; + this.checkBoxDrawPlayerProximityRect.UseVisualStyleBackColor = true; + this.checkBoxDrawPlayerProximityRect.CheckedChanged += new System.EventHandler(this.checkBoxDrawPlayerProximityRect_CheckedChanged); + // + // checkBoxDrawPlayerProximityCircle + // + this.checkBoxDrawPlayerProximityCircle.AutoSize = true; + this.checkBoxDrawPlayerProximityCircle.Enabled = false; + this.checkBoxDrawPlayerProximityCircle.Location = new System.Drawing.Point(5, 65); + this.checkBoxDrawPlayerProximityCircle.Name = "checkBoxDrawPlayerProximityCircle"; + this.checkBoxDrawPlayerProximityCircle.Size = new System.Drawing.Size(156, 17); + this.checkBoxDrawPlayerProximityCircle.TabIndex = 1; + this.checkBoxDrawPlayerProximityCircle.Text = "Draw Player Proximity Circle"; + this.checkBoxDrawPlayerProximityCircle.UseVisualStyleBackColor = true; + this.checkBoxDrawPlayerProximityCircle.CheckedChanged += new System.EventHandler(this.checkBoxDrawPlayerProximityCircle_CheckedChanged); + // + // radioButtonPlayerProximity + // + this.radioButtonPlayerProximity.AutoSize = true; + this.radioButtonPlayerProximity.Enabled = false; + this.radioButtonPlayerProximity.Location = new System.Drawing.Point(6, 42); + this.radioButtonPlayerProximity.Name = "radioButtonPlayerProximity"; + this.radioButtonPlayerProximity.Size = new System.Drawing.Size(149, 17); + this.radioButtonPlayerProximity.TabIndex = 0; + this.radioButtonPlayerProximity.Text = "Objects In Player Proximity"; + this.radioButtonPlayerProximity.UseVisualStyleBackColor = true; + // + // radioButtonAllWorld + // + this.radioButtonAllWorld.AutoSize = true; + this.radioButtonAllWorld.Checked = true; + this.radioButtonAllWorld.Location = new System.Drawing.Point(6, 19); + this.radioButtonAllWorld.Name = "radioButtonAllWorld"; + this.radioButtonAllWorld.Size = new System.Drawing.Size(82, 17); + this.radioButtonAllWorld.TabIndex = 0; + this.radioButtonAllWorld.TabStop = true; + this.radioButtonAllWorld.Text = "All the world"; + this.radioButtonAllWorld.UseVisualStyleBackColor = true; + this.radioButtonAllWorld.CheckedChanged += new System.EventHandler(this.radioButtonAllWorld_CheckedChanged); + // + // groupPreview + // + this.groupPreview.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + this.groupPreview.Controls.Add(this.pictureBoxPreview); + this.groupPreview.Location = new System.Drawing.Point(6, 10); + this.groupPreview.Name = "groupPreview"; + this.groupPreview.Size = new System.Drawing.Size(186, 194); + this.groupPreview.TabIndex = 2; + this.groupPreview.TabStop = false; + // + // pictureBoxPreview + // + this.pictureBoxPreview.Location = new System.Drawing.Point(4, 9); + this.pictureBoxPreview.Name = "pictureBoxPreview"; + this.pictureBoxPreview.Size = new System.Drawing.Size(180, 180); + this.pictureBoxPreview.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBoxPreview.TabIndex = 3; + this.pictureBoxPreview.TabStop = false; + this.pictureBoxPreview.Paint += new System.Windows.Forms.PaintEventHandler(this.pictureBoxPreview_Paint); + this.pictureBoxPreview.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pictureBoxPreview_MouseMove); + // + // panelStage + // + this.panelStage.AutoScroll = true; + this.panelStage.AutoScrollMinSize = new System.Drawing.Size(1008, 520); + this.panelStage.Controls.Add(this.pictureBoxStage); + this.panelStage.Dock = System.Windows.Forms.DockStyle.Fill; + this.panelStage.Location = new System.Drawing.Point(0, 0); + this.panelStage.Name = "panelStage"; + this.panelStage.Size = new System.Drawing.Size(1008, 520); + this.panelStage.TabIndex = 0; + this.panelStage.Scroll += new System.Windows.Forms.ScrollEventHandler(this.panelStage_Scroll); + // + // timerUpdate + // + this.timerUpdate.Tick += new System.EventHandler(this.timerUpdate_Tick); + // + // btnDumpMeshToObj + // + this.btnDumpMeshToObj.Location = new System.Drawing.Point(6, 162); + this.btnDumpMeshToObj.Name = "btnDumpMeshToObj"; + this.btnDumpMeshToObj.Size = new System.Drawing.Size(75, 23); + this.btnDumpMeshToObj.TabIndex = 4; + this.btnDumpMeshToObj.Text = "NavTo .Obj"; + this.btnNavToToolTip.SetToolTip(this.btnDumpMeshToObj, "Dumps all walkable cells into a 2d WaveFront model, placed in your Mooege root fo" + + "lder"); + this.btnDumpMeshToObj.UseVisualStyleBackColor = true; + this.btnDumpMeshToObj.Click += new System.EventHandler(this.btnDumpMeshToObj_Click); + // + // WorldVisualizer + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1008, 730); + this.Controls.Add(this.panelStage); + this.Controls.Add(this.groupSettings); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.KeyPreview = true; + this.Name = "WorldVisualizer"; + this.Text = "World Visualizer"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.WorldVisualizer_FormClosing); + this.Load += new System.EventHandler(this.WorldVisualizer_Load); + this.SizeChanged += new System.EventHandler(this.WorldVisualizer_SizeChanged); + ((System.ComponentModel.ISupportInitialize)(this.pictureBoxStage)).EndInit(); + this.groupActorVisibility.ResumeLayout(false); + this.groupActorVisibility.PerformLayout(); + this.groupMapVisibility.ResumeLayout(false); + this.groupMapVisibility.PerformLayout(); + this.groupSettings.ResumeLayout(false); + this.groupOptions.ResumeLayout(false); + this.groupOptions.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.trackBarUpdateFrequency)).EndInit(); + this.groupBoxRenderMode.ResumeLayout(false); + this.groupBoxRenderMode.PerformLayout(); + this.groupPreview.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.pictureBoxPreview)).EndInit(); + this.panelStage.ResumeLayout(false); + this.panelStage.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.PictureBox pictureBoxStage; + private System.Windows.Forms.GroupBox groupMapVisibility; + private System.Windows.Forms.CheckBox checkBoxUnwalkableCells; + private System.Windows.Forms.CheckBox checkBoxWalkableCells; + private System.Windows.Forms.CheckBox checkBoxSubScenes; + private System.Windows.Forms.CheckBox checkBoxMasterScenes; + private System.Windows.Forms.CheckBox checkBoxMonsters; + private System.Windows.Forms.CheckBox checkBoxNPCs; + private System.Windows.Forms.CheckBox checkBoxPlayers; + private System.Windows.Forms.GroupBox groupActorVisibility; + private System.Windows.Forms.CheckBox checkBoxFillCells; + private System.Windows.Forms.CheckBox checkBoxPrintSceneLabels; + private System.Windows.Forms.GroupBox groupSettings; + private System.Windows.Forms.Panel panelStage; + private System.Windows.Forms.GroupBox groupPreview; + private System.Windows.Forms.PictureBox pictureBoxPreview; + private System.Windows.Forms.GroupBox groupBoxRenderMode; + private System.Windows.Forms.RadioButton radioButtonPlayerProximity; + private System.Windows.Forms.RadioButton radioButtonAllWorld; + private System.Windows.Forms.GroupBox groupOptions; + private System.Windows.Forms.CheckBox checkBoxDrawPlayerProximityRect; + private System.Windows.Forms.CheckBox checkBoxDrawPlayerProximityCircle; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TrackBar trackBarUpdateFrequency; + private System.Windows.Forms.Timer timerUpdate; + private System.Windows.Forms.Button btnDumpMeshToObj; + private System.Windows.Forms.ToolTip btnNavToToolTip; + + } +} \ No newline at end of file diff --git a/src/Mooege/Core/GS/Map/Debug/WorldVisualizer.cs b/src/Mooege/Core/GS/Map/Debug/WorldVisualizer.cs new file mode 100644 index 00000000..9ef31785 --- /dev/null +++ b/src/Mooege/Core/GS/Map/Debug/WorldVisualizer.cs @@ -0,0 +1,302 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Drawing; +using System.Windows.Forms; +using Mooege.Core.GS.Players; + +namespace Mooege.Core.GS.Map.Debug +{ + public partial class WorldVisualizer : Form + { + public World World { get; private set; } + public Player Player { get; private set; } + public DebugNavMesh Mesh { get; private set; } + public Bitmap StageBitmap { get; private set; } + public Bitmap PreviewBitmap { get; private set; } + + private readonly Pen _selectionPen = new Pen(Brushes.Blue, 2); + + public WorldVisualizer(World world, Player player = null) + { + InitializeComponent(); + + this.pictureBoxStage.DoubleBuffer(); + this.pictureBoxPreview.DoubleBuffer(); + + this.World = world; + this.Player = player; + + radioButtonPlayerProximity.Enabled = radioButtonPlayerProximity.Checked = this.Player != null; + checkBoxDrawPlayerProximityCircle.Enabled = checkBoxDrawPlayerProximityCircle.Checked = this.Player != null; + checkBoxDrawPlayerProximityRect.Enabled = checkBoxDrawPlayerProximityRect.Checked = this.Player != null; + } + + private void WorldVisualizer_Load(object sender, EventArgs e) + { + this.Text = string.Format("World Visualizer - {0} [{1}]", this.World.WorldSNO.Name, this.World.WorldSNO.Id); + this.Mesh = new DebugNavMesh(this.World, this.Player); + this.Mesh.Update(this.radioButtonAllWorld.Checked); + + this.RequestStageRedraw(); + } + + #region mesh redrawing + + private void RequestStageRedraw() + { + this.groupSettings.Enabled = false; + + this.Mesh.DrawMasterScenes = checkBoxMasterScenes.Checked; + this.Mesh.DrawSubScenes = checkBoxSubScenes.Checked; + this.Mesh.DrawWalkableCells = checkBoxWalkableCells.Checked; + this.Mesh.DrawUnwalkableCells = checkBoxUnwalkableCells.Checked; + this.Mesh.DrawMonsters = checkBoxMonsters.Checked; + this.Mesh.DrawNPCs = checkBoxNPCs.Checked; + this.Mesh.DrawPlayers = checkBoxPlayers.Checked; + this.Mesh.DrawPlayerProximityCircle = checkBoxDrawPlayerProximityCircle.Checked; + this.Mesh.DrawPlayerProximityRectangle = checkBoxDrawPlayerProximityRect.Checked; + this.Mesh.PrintSceneLabels = checkBoxPrintSceneLabels.Checked; + this.Mesh.FillCells = checkBoxFillCells.Checked; + + if (this.StageBitmap != null) + { + this.StageBitmap.Dispose(); + this.StageBitmap = null; + } + + if(this.PreviewBitmap!=null) + { + this.PreviewBitmap.Dispose(); + this.PreviewBitmap = null; + } + + GC.Collect(); // force a garbage collection. + GC.WaitForPendingFinalizers(); + + this.StageBitmap = this.Mesh.Draw(); + this.PreviewBitmap = this.ResizeImage(this.StageBitmap, this.pictureBoxPreview.Width, this.pictureBoxPreview.Height); + this.pictureBoxStage.Image = this.StageBitmap; + + this.groupSettings.Enabled = true; + } + + #endregion + + #region preview handling + + private bool _donePaintingPreview = true; + + private void pictureBoxPreview_Paint(object sender, PaintEventArgs e) + { + if (!_donePaintingPreview) return; + + _donePaintingPreview = false; + e.Graphics.DrawImage(this.PreviewBitmap, 0, 0, this.PreviewBitmap.Width, this.PreviewBitmap.Height); + + var rectLeft = (this.pictureBoxPreview.Width * this.panelStage.HorizontalScroll.Value) / this.panelStage.HorizontalScroll.Maximum; + var rectTop = (this.pictureBoxPreview.Height * this.panelStage.VerticalScroll.Value) / this.panelStage.VerticalScroll.Maximum; + var rectWidth = (this.pictureBoxPreview.Width * this.panelStage.Size.Width) / this.pictureBoxStage.Width; + var rectHeight = (this.pictureBoxPreview.Height * this.panelStage.Size.Height) / this.pictureBoxStage.Height; + + e.Graphics.DrawRectangle(this._selectionPen, rectLeft, rectTop, rectWidth, rectHeight); + _donePaintingPreview = true; + } + + private void panelStage_Scroll(object sender, ScrollEventArgs e) + { + this.pictureBoxPreview.Refresh(); + this.pictureBoxStage.Refresh(); + } + + private void pictureBoxPreview_MouseMove(object sender, MouseEventArgs e) + { + if (e.Button != MouseButtons.Left) + return; + + var x = (e.X*this.panelStage.HorizontalScroll.Maximum)/this.pictureBoxPreview.Width; + var y = (e.Y*this.panelStage.VerticalScroll.Maximum)/this.pictureBoxPreview.Height; + + if (this.panelStage.HorizontalScroll.Minimum <= x && x <= this.panelStage.HorizontalScroll.Maximum) + this.panelStage.HorizontalScroll.Value = x; + + if (this.panelStage.VerticalScroll.Minimum <= y && y <= this.panelStage.VerticalScroll.Maximum) + this.panelStage.VerticalScroll.Value = y; + + this.pictureBoxPreview.Refresh(); + } + + private void WorldVisualizer_SizeChanged(object sender, EventArgs e) + { + this.pictureBoxPreview.Refresh(); + } + + #endregion + + #region updates + + private void trackBarUpdateFrequency_ValueChanged(object sender, EventArgs e) + { + if (trackBarUpdateFrequency.Value == 0) + timerUpdate.Enabled = false; + else + { + timerUpdate.Interval = trackBarUpdateFrequency.Value*1000; + timerUpdate.Enabled = true; + } + } + + private void timerUpdate_Tick(object sender, EventArgs e) + { + this.RequestStageRedraw(); + } + + #endregion + + #region options + + private void checkMasterScenes_CheckedChanged(object sender, System.EventArgs e) + { + this.RequestStageRedraw(); + } + + private void checkSubScenes_CheckedChanged(object sender, System.EventArgs e) + { + this.RequestStageRedraw(); + } + + private void checkWalkableCells_CheckedChanged(object sender, System.EventArgs e) + { + this.RequestStageRedraw(); + } + + private void checkUnwalkableCells_CheckedChanged(object sender, System.EventArgs e) + { + this.RequestStageRedraw(); + } + + private void checkPlayers_CheckedChanged(object sender, EventArgs e) + { + this.RequestStageRedraw(); + } + + private void checkNPCs_CheckedChanged(object sender, EventArgs e) + { + this.RequestStageRedraw(); + } + + private void checkMonsters_CheckedChanged(object sender, EventArgs e) + { + this.RequestStageRedraw(); + } + + private void checkPrintLabels_CheckedChanged(object sender, EventArgs e) + { + this.RequestStageRedraw(); + } + + private void checkFillCells_CheckedChanged(object sender, EventArgs e) + { + this.RequestStageRedraw(); + } + + private void radioButtonAllWorld_CheckedChanged(object sender, EventArgs e) + { + if (this.Mesh == null) + return; + + this.Mesh.Update(this.radioButtonAllWorld.Checked); + this.RequestStageRedraw(); + } + + private void checkBoxDrawPlayerProximityCircle_CheckedChanged(object sender, EventArgs e) + { + if (this.Mesh == null) + return; + + this.RequestStageRedraw(); + } + + private void checkBoxDrawPlayerProximityRect_CheckedChanged(object sender, EventArgs e) + { + if (this.Mesh == null) + return; + + this.RequestStageRedraw(); + } + + #endregion + + #region bitmap helpers + + public Bitmap ResizeImage(Image image, int width, int height) + { + //a holder for the result + var result = new Bitmap(width, height); + + //use a graphics object to draw the resized image into the bitmap + using (Graphics graphics = Graphics.FromImage(result)) + { + //set the resize quality modes to high quality + graphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality; + graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; + graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; + + //draw the image into the target bitmap + graphics.DrawImage(image, 0, 0, result.Width, result.Height); + } + + //return the resulting bitmap + return result; + } + + #endregion + + #region form-close + + private void WorldVisualizer_FormClosing(object sender, FormClosingEventArgs e) + { + this.World = null; + this.Mesh = null; + + if (this.StageBitmap != null) + { + this.StageBitmap.Dispose(); + this.StageBitmap = null; + } + + if(this.PreviewBitmap!=null) + { + this.PreviewBitmap.Dispose(); + this.PreviewBitmap = null; + } + + GC.Collect(); // force a garbage collection. + GC.WaitForPendingFinalizers(); + } + + #endregion + + private void btnDumpMeshToObj_Click(object sender, EventArgs e) + { + this.Mesh.DumpNavMeshToObj(); + } + + } +} diff --git a/src/Mooege/Core/GS/Map/Debug/WorldVisualizer.resx b/src/Mooege/Core/GS/Map/Debug/WorldVisualizer.resx new file mode 100644 index 00000000..6930529e --- /dev/null +++ b/src/Mooege/Core/GS/Map/Debug/WorldVisualizer.resx @@ -0,0 +1,282 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + True + + + True + + + True + + + True + + + 137, 17 + + + True + + + True + + + True + + + True + + + 17, 17 + + + + + AAABAAMAMDAAAAEACACoDgAANgAAACAgAAABAAgAqAgAAN4OAAAQEAAAAQAIAGgFAACGFwAAKAAAADAA + AABgAAAAAQAIAAAAAAAACQAAAAAAAAAAAAAAAQAAAAAAAN7e3wDMzM4A9fX2AC4uLgDQ0NEAlJSVADMz + NABcXFwAhoaHADc3NwAkJCMAYWFiAPDw8QChoaEAZWVlALi4uABAQEAA4uLjAC0tLABXV1cA0NDSAPn5 + +gBubm4AMjIyAFtbWgDU1NUANjY1AOvr7ABgYGAAxsbHAIqKiwA7OzsAUlJSAPT09QBAQEEALS0tAERE + RADm5ucAMTEwADIyMwBbW1sAhYWGADY2NgDY2NkA7+/wALOztAB7e3sAPz8/AOHh4gCSkpIAVlZWALy8 + vQBtbW0AMTExAJeXmADq6usArq6vAMXFxgA6OjoA3NzdAMnJyQDz8/QApKSkAGhoaAAsLCwA5eXmANLS + 0gBaWloA6enpAHFxcQDq6uwANTU1AExMTADu7u8AUVFSAPPz9QA+Pj4AKysqAJGRkQBCQkEAu7u8ADAw + MACWlpcAR0dHAOnp6gDExMUA7e3tADk5OQBjY2QA8vLzALa2twBnZ2cAKysrAM3NzgB+fn4AQkJCAC8v + LgCoqKkAlZWVAFlZWQBGRkUAv7/AAKysrAA0NDQAw8PDAF5eXwCHh4cA7e3uADg4NwA5OToAyMjJAPHx + 8QB5eXkAzMzMAPb29wC6ursAa2trAC8vLwCCgoIA6OjpAKysrQBwcHEAmZmZADQ0NQDDw8QAS0tMAHR0 + dAA4ODgAnp6fAMfHxwCLi4sAT09PAPHx8gBmZmYAKioqAMzMzQBBQUEALy8wAFhYWAD6+vsARkZHADMz + MwCGhoYA7OztADg4OQBhYWEAx8fIALS0tAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ0dHZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + R2dnR2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnUSYmUWdnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ0c1hS0thTVHZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnR1GIc1JSc4hRR2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ1w0km06bjRcZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dHAxxd + TkwvMYdpA0dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnUZELXz4+X5EcUWdnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dHF1dwgYSEgXBXF0dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dHUU8ZFXd3FRlPUUdnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dHjUcNDBsbDA1HjUdnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnRxJe + PRsbPV4SR2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnKoZbN4+PN1uGKmdnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnKiMTKywsKxMjKmdnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnR3VIXQwMXUh1R2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnR1FTHYSEHVNRR2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnRzUi + ZVlZZSI1R2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnR1EkfISEfCRRR2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dHCQODBAwMBIMDCUdnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ0dRUUBDO0lJO0NAUVFHZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnFyNMShp+SY+PSX4aSkwjF2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ0cnfy48BZA4 + ITc3ITiQBTwufydHZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2cmghVuJCAALBsbLAAgJG4VgiZn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dHR3V9cVqMiWGEG4+PG4RhiYxacX11R0dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2cqR2cXZxckWAY1YhuPGzc3G48bYjUGWCQXZxdnRypnZ2dnZ2dnZ2dnZ2dnZ2dnZ41A + AzUfRwNATYp4RmtEApOTAkRrRniKTUADRx81A0CNZ2dnZ2dnZ2dnZ2dnZ2dnZwkoNg9oUHoeLTtZj1Q9 + FCAgFD1Uj1k7LR56UGgPNigJZ2dnZ2dnZ2dnZ2dnZ2dHdQcBPYuLAkmPPQw3N1lxY3V1Y3FZNzcMPY9J + AouLPQEHdUdnZ2dnZ2dnZ2dnZ2dnF4gTdIBdQUtvNxs3hDkgIyoqIyA5hDcbN29LQV2AdBOIF2dnZ2dn + Z2dnZ2dnZ2dnZxdAIxdkeY5mSTcMQjJAKmdnKkAyQgw3SWaOeWQXI0AXZ2dnZ2dnZ2dnZ2dnZ2dnZ2cq + R401AwoYJWtWalwqZ2dnZypcalZrJRgKAzWNRypnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ0dHKo0QM3IwKCMq + Z2dnZyojKDByMxCNKkdHZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ0cSKQIRMhIqZ2dnZyoSMhECKRJH + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ0dRJFUsFkAqZ2dnZypAFixVJFFHZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dHEg4bZnVnZ2dnZ2d1ZhsOEkdnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZxcIOz9AKmdnKkA/OwgXZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ40XRXZ/ + jUdHjX92RReNZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2cGYGwqjWdnjSpsYAZnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnR42NZ2dnZ42NR2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ3tnZ2dnZ2d7Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2cAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAIAAAAEAAAAABAAgAAAAAAAAEAAAAAAAAAAAAAAAB + AAAAAAAASUlJAO7u7wArKysAwcHCAFZWVgCfn58AODg4AN3d3gApKSkA6OjoAM7OzwC/v8AAfX18ALCw + sQD5+foANjY2ANvb3AB0dHUAJycnAGVlZgBwcHAAn5+gADg4OQA0NDQAysrLAKysrQBqamkA9fX2ADY2 + NwAyMjIALi4tAF1dXQA0NDUA8/P0ADAwMACZmZoALi4uACoqKQB3d3cAtbW2AFlZWQDv7/AAiIiJAODg + 4QAsLCwA0dHSAGpqawB1dXUAs7O0AExMTQBXV1cAlZWWAO3t7gA5OTkAKioqADU1NADa2toAWVlaAFVV + VQCioqMAra2tAPr6+wA3NzcAKCgoAICAgACvr7AAkZGSAERERAA1NTUAjY2NAMvLzABvb28AYGBgAEJC + QgAzMzMAYmJjALa2tgCcnJ0AQEBAAOXl5gAxMTEAa2trAKmpqgDy8vMAPj4+AOPj5AAvLy8A1NTVAG1t + bgAgICAAeHh4AFpaWgCYmJkAS0tLAPDw8QA8PDwALS0tAGdnZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAABcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcX + FxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxdERBcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcX + RGBgRBcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXF0QdOjodRBcXFxcXFxcXFxcXFxcXFxcXFxcXFxcX + FxcPCChBQSglDxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXREo+GTlbPBxKIBcXFxcXFxcXFxcXFxcXFxcX + FxcXFxdEJDIvJloRBCREFxcXFxcXFxcXFxcXFxcXFxcXFxcXF0RKNQUBAQU1SkQXFxcXFxcXFxcXFxcX + FxcXFxcXFxcXREo+RlNTRj5KRBcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXDwgjGxsjCA8XFxcXFxcXFxcX + FxcXFxcXFxcXFxcXFxcPCEBTU0AIDxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFw8CRykpRwIPFxcXFxcX + FxcXFxcXFxcXFxcXFxcXFxcXDywTNDQTLA8XFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcGLC4BAS4sBhcX + FxcXFxcXFxcXFxcXFxcXFxcXFxdESiwSDFNTDBIsSkQXFxcXFxcXFxcXFxcXFxcXFxcXRFYcFEkVGxsV + SRQcVkQXFxcXFxcXFxcXFxcXFxcXFw9QThgwADgpKTgAMBhOUA8XFxcXFxcXFxcXFxcXRA8XFwJYOyJc + ITQ0IVwiO1gCFxcPRBcXFxcXFxcXF0RQPyI1IlBfTQEhLS0hAU1fUCI1Ij9QRBcXFxcXFxdEHVQzClcn + UhAhXk8fH09eIRBSJ1cKM1QdRBcXFxcXF0RQQypMVT0OAQEHSCwsSAcBAQ49VUwqQ1BEFxcXFxcXFxdQ + EiwASw0hCRoSPj4SGgkhDUsALBJQFxcXFxcXFxcXFxcPRB1ZYT0LUERERERQCz1hWR1EDxcXFxcXFxcX + FxcXFxcXDzcWVwNgRBcXRGADVxY3DxcXFxcXFxcXFxcXFxcXFxcXDzZRKzFgDw9gMStRNg8XFxcXFxcX + FxcXFxcXFxcXFxcXRCxFQh5ERB5CRSxEFxcXFxcXFxcXFxcXFxcXFxcXFxcXF1ZdBkpKBl1WFxcXFxcX + FxcXFxcXFxcXFxcXFxcXFxcXRFZKFxdKVkQXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXRBcXFxdEFxcX + FxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcX + FxcXFxcXFxcXFxcXFxcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAA + AAA0NDQAPT09AI6OjwC3t7cANjY2ALKyswBzc3MALy8vADg4OAAxMTEAcHBxAGVlZQAhISEA8/P0AMjI + yQBeXl4AMzMzAOzs7QAsLCwAQEBBADU1NQDIyMgAR0dHAGRkZQAlJSUAzMzNAC4uLgBiYmIANzc3ACws + KwCqqqsAQEBAANPT0wAnJycAZGRkAJiYmACBgYIAzs7OACIiIgArKysAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAABQUAAAAAAAAAAAAAAAAAAAHBwAAAAAAAAAAAAAAABQHFxcHFAAAAAAAAAAAABQJ + EyQkHwkUAAAAAAAAAAAUEBwZGRwQFAAAAAAAAAAAABQdFQ4dFAAAAAAAAAAAAAAIIQUFIQgAAAAAAAAA + AAAUBxgDAxgHFAAAAAAAAAAQEiILICALIhIQAAAAAAAQAQgPHhERHg8IARAAAAAQCCMlJQ0KCg0lJSMI + EAAAAAAIFiAjJiYjIBYIAAAAAAAABAwGAicnAgYMBAAAAAAAAAAUEBscHBsQFAAAAAAAAAAAAAAaAAAa + AAAAAAAAAAAAAAAAFAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + + + \ No newline at end of file diff --git a/src/Mooege/Core/GS/Map/Scene.cs b/src/Mooege/Core/GS/Map/Scene.cs new file mode 100644 index 00000000..e972ee4f --- /dev/null +++ b/src/Mooege/Core/GS/Map/Scene.cs @@ -0,0 +1,430 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Windows; +using Mooege.Common.Logging; +using Mooege.Common.MPQ; +using Mooege.Core.GS.Actors; +using Mooege.Core.GS.Common.Types.Collision; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Core.GS.Common.Types.Scene; +using Mooege.Core.GS.Objects; +using Mooege.Core.GS.Players; +using Mooege.Net.GS.Message.Definitions.Map; +using Mooege.Net.GS.Message.Definitions.Scene; +using Mooege.Common.Helpers.Math; + +namespace Mooege.Core.GS.Map +{ + + public sealed class Scene : WorldObject + { + private static readonly Logger Logger = LogManager.CreateLogger(); + + /// + /// SNOHandle for the scene. + /// + public SNOHandle SceneSNO { get; private set; } + + /// + /// Scene group's SNOId. + /// Not sure on usage /raist. + /// + public int SceneGroupSNO { get; set; } + + /// + /// Subscenes. + /// + public List Subscenes { get; private set; } + + /// + /// Parent scene if any. + /// + public Scene Parent; + + /// + /// Parent scene's chunk id. + /// + public uint ParentChunkID + { + get { return (this.Parent != null) ? this.Parent.DynamicID : 0xFFFFFFFF; } + } + + /// + /// Visibility in MiniMap. + /// + public bool MiniMapVisibility { get; set; } + + /// + /// Scene Specification. + /// + public SceneSpecification Specification { get; set; } + + /// + /// Applied labels. + /// Not sure on usage /raist. + /// + public int[] AppliedLabels; + + /// + /// PRTransform for the scene. + /// + public PRTransform Transform + { + get { return new PRTransform { Quaternion = new Quaternion { W = this.RotationW, Vector3D = this.RotationAxis }, Vector3D = this.Position }; } + } + + /// + /// AABB bounds for the scene. + /// + public AABB AABBBounds { get; private set; } + + /// + /// AABB bounds for MarketSet. + /// + public AABB AABBMarketSetBounds { get; private set; } + + /// + /// NavMesh for the scene. + /// + public Mooege.Common.MPQ.FileFormats.Scene.NavMeshDef NavMesh { get; private set; } + + /// + /// Markersets for the scene. + /// + public List MarkerSets { get; private set; } + + /// + /// LookLink - not sure on the usage /raist. + /// + public string LookLink { get; private set; } + + /// + /// NavZone for the scene. + /// + public Mooege.Common.MPQ.FileFormats.Scene.NavZoneDef NavZone { get; private set; } + + /// + /// Possible spawning locations for randomized gizmo placement + /// + public List[] GizmoSpawningLocations { get; private set; } + + /// + /// Creates a new scene and adds it to given world. + /// + /// The parent world. + /// The position. + /// SNOId for the scene. + /// The parent scene if any. + public Scene(World world, Vector3D position, int snoId, Scene parent) + : base(world, world.NewSceneID) + { + this.SceneSNO = new SNOHandle(SNOGroup.Scene, snoId); + this.Parent = parent; + this.Subscenes = new List(); + this.Scale = 1.0f; + this.AppliedLabels = new int[0]; + this.LoadSceneData(); // load data from mpqs. + this.Size = new Size(this.NavZone.V0.X * this.NavZone.Float0, this.NavZone.V0.Y * this.NavZone.Float0); + this.Position = position; + this.World.AddScene(this); // add scene to the world. + } + + #region mpq-data + + /// + /// Loads scene data from mpqs. + /// + private void LoadSceneData() + { + // oh yeah, this really happens to me sometimes, i dont know why! ~weltmeyer + if (!MPQStorage.Data.Assets[SNOGroup.Scene].ContainsKey(this.SceneSNO.Id)) + Logger.Debug("AssetsForScene not found in MPQ Storage:Scene:{0}, Asset:{1}", SNOGroup.Scene, this.SceneSNO.Id); + var data = MPQStorage.Data.Assets[SNOGroup.Scene][this.SceneSNO.Id].Data as Mooege.Common.MPQ.FileFormats.Scene; + if (data == null) return; + + this.AABBBounds = data.AABBBounds; + this.AABBMarketSetBounds = data.AABBMarketSetBounds; + this.NavMesh = data.NavMesh; + this.MarkerSets = data.MarkerSets; + this.LookLink = data.LookLink; + this.NavZone = data.NavZone; + } + + #endregion + + #region range-queries + + public List Players + { + get { return this.GetObjects(); } + } + + public bool HasPlayers + { + get { return this.Players.Count > 0; } + } + + public List Actors + { + get { return this.GetObjects(); } + } + + public bool HasActors + { + get { return this.Actors.Count > 0; } + } + + public List GetObjects() where T : WorldObject + { + return this.World.QuadTree.Query(this.Bounds); + } + + #endregion + + #region actor-loading + + /// + /// Loads all markers for the scene. + /// + public void LoadMarkers() + { + this.GizmoSpawningLocations = new List[26]; // LocationA to LocationZ + + // TODO: We should be instead loading actors but let them get revealed based on quest/triggers/player proximity. /raist. + + foreach (var markerSet in this.MarkerSets) + { + var markerSetData = MPQStorage.Data.Assets[SNOGroup.MarkerSet][markerSet].Data as Mooege.Common.MPQ.FileFormats.MarkerSet; + if (markerSetData == null) return; + + foreach (var marker in markerSetData.Markers) + { + switch (marker.Type) + { + case Mooege.Common.MPQ.FileFormats.MarkerType.AmbientSound: + case Mooege.Common.MPQ.FileFormats.MarkerType.Light: + case Mooege.Common.MPQ.FileFormats.MarkerType.Particle: + case Mooege.Common.MPQ.FileFormats.MarkerType.SubScenePosition: + case Mooege.Common.MPQ.FileFormats.MarkerType.AudioVolume: + // nothing to do for these here, client load them on its own + break; + + case Mooege.Common.MPQ.FileFormats.MarkerType.Script: + Logger.Trace("Ignoring marker {0} in {1} ({2}) because scripts are not handled yet", marker.Name, markerSetData.FileName, markerSetData.Header.SNOId); + break; + + case Mooege.Common.MPQ.FileFormats.MarkerType.Event: + Logger.Trace("Ignoring marker {0} in {1} ({2}) because events are not handled yet", marker.Name, markerSetData.FileName, markerSetData.Header.SNOId); + break; + + case Mooege.Common.MPQ.FileFormats.MarkerType.MinimapMarker: + Logger.Trace("Ignoring marker {0} in {1} ({2}) because minimap marker are not handled yet", marker.Name, markerSetData.FileName, markerSetData.Header.SNOId); + + break; + + case Mooege.Common.MPQ.FileFormats.MarkerType.Actor: + + var actor = ActorFactory.Create(this.World, marker.SNOHandle.Id, marker.TagMap); // try to create it. + if (actor == null) continue; + + var position = marker.PRTransform.Vector3D + this.Position; // calculate the position for the actor. + actor.RotationW = marker.PRTransform.Quaternion.W; + actor.RotationAxis = marker.PRTransform.Quaternion.Vector3D; + + actor.EnterWorld(position); + break; + + case Mooege.Common.MPQ.FileFormats.MarkerType.Encounter: + + var encounter = marker.SNOHandle.Target as Mooege.Common.MPQ.FileFormats.Encounter; + var actorsno = RandomHelper.RandomItem(encounter.Spawnoptions, x => x.Probability); + var actor2 = ActorFactory.Create(this.World, actorsno.SNOSpawn, marker.TagMap); // try to create it. + if (actor2 == null) continue; + + var position2 = marker.PRTransform.Vector3D + this.Position; // calculate the position for the actor. + actor2.RotationW = marker.PRTransform.Quaternion.W; + actor2.RotationAxis = marker.PRTransform.Quaternion.Vector3D; + + actor2.EnterWorld(position2); + + break; + + default: + + // Save gizmo locations. They are used to spawn loots and gizmos randomly in a level area + if ((int)marker.Type >= (int)Mooege.Common.MPQ.FileFormats.MarkerType.GizmoLocationA && (int)marker.Type <= (int)Mooege.Common.MPQ.FileFormats.MarkerType.GizmoLocationZ) + { + int index = (int)marker.Type - 50; // LocationA has id 50... + + if (GizmoSpawningLocations[index] == null) + GizmoSpawningLocations[index] = new List(); + + marker.PRTransform.Vector3D += this.Position; + GizmoSpawningLocations[index].Add(marker.PRTransform); + } + else + Logger.Warn("Unhandled marker type {0} in actor loading", marker.Type); + + + break; + + } + } + } + } + + #endregion + + #region scene revealing & unrevealing + + /// + /// Returns true if the actor is revealed to player. + /// + /// The player. + /// + public bool IsRevealedToPlayer(Player player) + { + return player.RevealedObjects.ContainsKey(this.DynamicID); + } + + /// + /// Reveal the scene to given player. + /// + /// Player to reveal scene. + /// + public override bool Reveal(Player player) + { + if (player.RevealedObjects.ContainsKey(this.DynamicID)) return false; // return if already revealed. + + player.InGameClient.SendMessage(this.RevealMessage, true); // reveal the scene itself. + player.InGameClient.SendMessage(this.MapRevealMessage, true); // reveal the scene in minimap. + + foreach (var sub in this.Subscenes) // reveal subscenes too. + { + sub.Reveal(player); + } + + player.RevealedObjects.Add(this.DynamicID, this); + return true; + } + + /// + /// Unreveals the scene to given player. + /// + /// Player to unreveal scene. + /// + public override bool Unreveal(Player player) + { + if (!player.RevealedObjects.ContainsKey(this.DynamicID)) return false; // if it's not revealed already, just return. + + player.InGameClient.SendMessage(new DestroySceneMessage() { WorldID = this.World.DynamicID, SceneID = this.DynamicID }, true); // send the unreveal message. + + foreach (var subScene in this.Subscenes) // unreveal subscenes too. + { + subScene.Unreveal(player); + } + + player.RevealedObjects.Remove(this.DynamicID); + return true; + } + + #endregion + + #region scene-related messages + + /// + /// Returns a RevealSceneMessage. + /// + public RevealSceneMessage RevealMessage + { + get + { + SceneSpecification specification = this.Specification; + specification.SNOMusic = World.Environment.snoMusic; + specification.SNOCombatMusic = World.Environment.snoCombatMusic; + specification.SNOAmbient = World.Environment.snoAmbient; + specification.SNOReverb = World.Environment.snoReverb; + //specification.SNOWeather = World.Environment.snoWeather; + //World data is being read from olders mpq patch files and reading the wrong + //weather. forcing new weather from town to all scenes for now + //since it's much more pleasing on the eyes than the blue haze + specification.SNOWeather = 0x00013220; + + return new RevealSceneMessage + { + WorldID = this.World.DynamicID, + SceneSpec = specification, + ChunkID = this.DynamicID, + Transform = this.Transform, + SceneSNO = this.SceneSNO.Id, + ParentChunkID = this.ParentChunkID, + SceneGroupSNO = this.SceneGroupSNO, + arAppliedLabels = this.AppliedLabels + }; + } + } + + /// + /// Returns a MapRevealSceneMessage. + /// + public MapRevealSceneMessage MapRevealMessage + { + get + { + return new MapRevealSceneMessage + { + ChunkID = this.DynamicID, + SceneSNO = this.SceneSNO.Id, + Transform = this.Transform, + WorldID = this.World.DynamicID, + MiniMapVisibility = false //= this.MiniMapVisibility + }; + } + } + + #endregion + + public override string ToString() + { + return string.Format("[Scene] SNOId: {0} DynamicId: {1} Name: {2}", this.SceneSNO.Id, this.DynamicID, this.SceneSNO.Name); + } + } + + /// + /// Minimap visibility of the scene on map. + /// + public enum SceneMiniMapVisibility + { + /// + /// Hidden. + /// + Hidden = 0, + /// + /// Revealed to player. + /// + Revealed = 1, + /// + /// Player already visited the scene. + /// + Visited = 2 + } +} diff --git a/src/Mooege/Core/GS/Map/World.cs b/src/Mooege/Core/GS/Map/World.cs new file mode 100644 index 00000000..b3079a58 --- /dev/null +++ b/src/Mooege/Core/GS/Map/World.cs @@ -0,0 +1,868 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Linq; +using System.Windows; +using Mooege.Common.Helpers.Math; +using Mooege.Common.Logging; +using Mooege.Common.Storage; +using Mooege.Core.GS.Actors.Implementations; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Common.Types.QuadTrees; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Core.GS.Games; +using Mooege.Core.GS.Items; +using Mooege.Core.GS.Items.Implementations; +using Mooege.Core.GS.Objects; +using Mooege.Core.GS.Actors; +using Mooege.Core.GS.Players; +using Mooege.Net.GS.Message; +using Mooege.Net.GS.Message.Definitions.World; +using Mooege.Core.GS.Powers; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Core.GS.Ticker; +using Mooege.Net.GS.Message.Definitions.Misc; + +namespace Mooege.Core.GS.Map +{ + public sealed class World : DynamicObject, IRevealable, IUpdateable + { + static readonly Logger Logger = LogManager.CreateLogger(); + public readonly Dictionary> DbItems = new Dictionary>(); //we need this list to delete item_instances from items which have no owner anymore. + public readonly Dictionary CachedItems = new Dictionary(); + + + + /// + /// Game that the world belongs to. + /// + public Game Game { get; private set; } + + /// + /// SNOHandle for the world. + /// + public SNOHandle WorldSNO { get; private set; } + + /// + /// QuadTree that contains scenes & actors. + /// + public QuadTree QuadTree { get; private set; } + + /// + /// List of scenes contained in the world. + /// + private readonly ConcurrentDictionary _scenes; + + /// + /// List of actors contained in the world. + /// + private readonly ConcurrentDictionary _actors; + + /// + /// List of players contained in the world. + /// + public readonly ConcurrentDictionary Players; + + /// + /// Returns true if the world has players in. + /// + public bool HasPlayersIn { get { return this.Players.Count > 0; } } + + /// + /// Returns a new dynamicId for scenes. + /// + public uint NewSceneID { get { return this.Game.NewSceneID; } } + + // Returns a new dynamicId for actors. + public uint NewActorID { get { return this.Game.NewObjectID; } } + + // Environment + public Mooege.Common.MPQ.FileFormats.Environment Environment { get; private set; } + + /// + /// Returns list of available starting points. + /// + public List StartingPoints + { + get { return this._actors.Values.OfType().Select(actor => actor).ToList(); } + } + + public PowerManager PowerManager; + public BuffManager BuffManager; + + /// + /// Creates a new world for the given game with given snoId. + /// + /// The parent game. + /// The snoId for the world. + public World(Game game, int snoId) + : base(game.NewWorldID) + { + this.Game = game; + this.WorldSNO = new SNOHandle(SNOGroup.Worlds, snoId); + + Environment = ((Mooege.Common.MPQ.FileFormats.World)Mooege.Common.MPQ.MPQStorage.Data.Assets[SNOGroup.Worlds][snoId].Data).Environment; + this.Game.StartTracking(this); // start tracking the dynamicId for the world. + this._scenes = new ConcurrentDictionary(); + this._actors = new ConcurrentDictionary(); + this.Players = new ConcurrentDictionary(); + this.QuadTree = new QuadTree(new Size(60, 60), 0); + this.PowerManager = new PowerManager(); + this.BuffManager = new BuffManager(); + this.Game.AddWorld(this); + } + + #region update & tick logic + + public void Update(int tickCounter) + { + var actorsToUpdate = new List(); // list of actor to update. + + foreach (var player in this.Players.Values) // get players in the world. + { + foreach (var actor in player.GetActorsInRange().OfType()) // get IUpdateable actors in range. + { + if (actorsToUpdate.Contains(actor as IUpdateable)) // don't let a single actor in range of more than players to get updated more thance per tick /raist. + continue; + + actorsToUpdate.Add(actor as IUpdateable); + } + } + + foreach (var actor in actorsToUpdate) // trigger the updates. + { + actor.Update(tickCounter); + } + + this.BuffManager.Update(); + this.PowerManager.Update(); + + UpdateFlippy(tickCounter); + + foreach (var player in this.Players.Values) + { + player.InGameClient.SendTick(); // if there's available messages to send, will handle ticking and flush the outgoing buffer. + } + } + + #endregion + + #region message broadcasting + + // NOTE: Scenes are actually laid out in cells with Subscenes filling in certain areas under a Scene. + // We can use this design feature to track Actors' current scene and send updates to it and neighboring + // scenes instead of distance checking for broadcasting messages. / komiga + // I'll be soon adding that feature /raist. + + /// + /// Broadcasts a message for a given actor to only players that actor has been revealed. + /// + /// The message to broadcast. + /// The actor. + public void BroadcastIfRevealed(GameMessage message, Actor actor) + { + foreach (var player in this.Players.Values) + { + if (player.RevealedObjects.ContainsKey(actor.DynamicID)) + player.InGameClient.SendMessage(message); + } + } + + /// + /// Broadcasts a message to all players in the world. + /// + /// + public void BroadcastGlobal(GameMessage message) + { + foreach (var player in this.Players.Values) + { + player.InGameClient.SendMessage(message); + } + } + + /// + /// Broadcasts a message to all players in the range of given actor. + /// + /// The message to broadcast. + /// The actor. + public void BroadcastInclusive(GameMessage message, Actor actor) + { + var players = actor.GetPlayersInRange(); + foreach (var player in players) + { + player.InGameClient.SendMessage(message); + } + } + + /// + /// Broadcasts a message to all players in the range of given actor, but not the player itself if actor is the player. + /// + /// The message to broadcast. + /// The actor. + public void BroadcastExclusive(GameMessage message, Actor actor) + { + var players = actor.GetPlayersInRange(); + foreach (var player in players.Where(player => player != actor)) + { + player.InGameClient.SendMessage(message); + } + } + + #endregion + + #region reveal logic + + /// + /// Reveals the world to given player. + /// + /// The player. + /// + public bool Reveal(Player player) + { + if (player.RevealedObjects.ContainsKey(this.DynamicID)) + return false; + + player.InGameClient.SendMessage(new RevealWorldMessage() // Reveal world to player + { + WorldID = this.DynamicID, + WorldSNO = this.WorldSNO.Id, + Field2 = 540, + Field3 = -600, + Field4 = 60, + Field5 = 60, + Field6 = 3300, + Field7 = 5040 + }); + + player.InGameClient.SendMessage(new EnterWorldMessage() + { + EnterPosition = player.Position, + WorldID = this.DynamicID, + WorldSNO = this.WorldSNO.Id + }); + + player.RevealedObjects.Add(this.DynamicID, this); + + return true; + } + + /// + /// Unreveals the world to player. + /// + /// The player. + /// + public bool Unreveal(Player player) + { + if (!player.RevealedObjects.ContainsKey(this.DynamicID)) + return false; + + // player.InGameClient.SendMessage(new WorldDeletedMessage() { WorldID = DynamicID });/ / don't delete the old world or beta-client will be crashing! /raist. + player.RevealedObjects.Remove(this.DynamicID); + return true; + } + + #endregion + + #region actor enter & leave functionality + + /// + /// Allows an actor to enter the world. + /// + /// The actor entering the world. + public void Enter(Actor actor) + { + this.AddActor(actor); + actor.OnEnter(this); + + // reveal actor to player's in-range. + foreach (var player in actor.GetPlayersInRange()) + { + actor.Reveal(player); + } + } + + /// + /// Allows an actor to leave the world. + /// + /// The actor leaving the world. + public void Leave(Actor actor) + { + actor.OnLeave(this); + + foreach (var player in this.Players.Values) + { + if (actor != player) + { + actor.Unreveal(player); + } + } + + if (this.HasActor(actor.DynamicID)) + this.RemoveActor(actor); + + if (!(actor is Player)) return; // if the leaving actors is a player, unreveal the actors revealed to him contained in the world. + var revealedObjects = (actor as Player).RevealedObjects.Values.ToList(); // list of revealed actors. + foreach (var @object in revealedObjects) + if (@object != actor) // do not unreveal the player itself. + @object.Unreveal(actor as Player); + } + + #endregion + + #region monster spawning & item drops + + /// + /// Spawns a monster with given SNOId in given position. + /// + /// The SNOId of the monster. + /// The position to spawn it. + public void SpawnMonster(int monsterSNOId, Vector3D position) + { + var monster = ActorFactory.Create(this, monsterSNOId, new TagMap()); + //monster.Scale = 1.35f; // this shoudln't be here + monster.EnterWorld(position); + } + + private List _flippyTimers = new List(); + private const int FlippyDurationInTicks = 30; + private const int FlippyMaxDistanceManhattan = 10; // length of one side of the square around the player where the item will appear + private const int FlippyDefaultFlippy = 0x6d82; // g_flippy.prt + + /// + /// Spawns a random item drop for given player. + /// + /// The player. + /// The position for drop. + public void SpawnRandomItemDrop(Actor source, Player player) + { + var item = ItemGenerator.GenerateRandom(player); + if ((item is SpellRune) /*&& (item.Attributes[GameAttribute.Rune_Rank] == 0)*/) + { + // favor player's class in attuned runes // TODO: remove or move this + if (RandomHelper.NextDouble() > 0.6f) + { + (item as SpellRune).ReAttuneToClass(player.Toon.Class); + } + } + // NOTE: The owner field for an item is only set when it is in the owner's inventory. /komiga + player.GroundItems[item.DynamicID] = item; // FIXME: Hacky. /komiga + DropItem(source, null, item); + } + + /// + /// Spanws gold for given player. + /// + /// The player. + /// The position for drop. + public void SpawnGold(Actor source, Player player) + { + // TODO: Gold should be spawned for all players in range. /raist. + var item = ItemGenerator.CreateGold(player, RandomHelper.Next(1000, 3000)); // somehow the actual ammount is not shown on ground /raist. + DropItem(source, player, item); + } + + /// + /// Returns the first actor found with a given sno id + /// + /// + /// + public Actor GetActorBySNO(int sno) + { + foreach (var actor in this._actors.Values) + { + if (actor.ActorSNO.Id == sno) + return actor; + } return null; + } + + /// + /// Returns true if any actors exist under a well defined group + /// + /// + /// + public bool HasActorsInGroup(string group) + { + var groupHash = Mooege.Common.Helpers.Hash.StringHashHelper.HashItemName(group); + foreach (var actor in this._actors.Values) + { + if (actor.Tags != null) + if (actor.Tags.ContainsKey(MarkerKeys.Group1Hash)) + if (actor.Tags[MarkerKeys.Group1Hash] == groupHash) return true; + } + return false; + } + + /// + /// Returns all actors matching a group + /// + /// + /// + public List GetActorsInGroup(string group) + { + List matchingActors = new List(); + var groupHash = Mooege.Common.Helpers.Hash.StringHashHelper.HashItemName(group); + foreach (var actor in this._actors.Values) + { + if (actor.Tags != null) + if (actor.Tags.ContainsKey(MarkerKeys.Group1Hash)) + if (actor.Tags[MarkerKeys.Group1Hash] == groupHash) matchingActors.Add(actor); + } + return matchingActors; + } + + /// + /// Spanws a health-globe for given player. + /// + /// The player. + /// The position for drop. + public void SpawnHealthGlobe(Actor source, Player player, Vector3D position) + { + // TODO: Health-globe should be spawned for all players in range. /raist. + var item = ItemGenerator.CreateGlobe(player, RandomHelper.Next(1, 28)); // somehow the actual ammount is not shown on ground /raist. + DropItem(source, player, item); + } + + /// + /// Update the flippy animations and remove them once they have timed out + /// + /// + private void UpdateFlippy(int tickCounter) + { + List finished = new List(); + foreach (var flippy in _flippyTimers) + { + flippy.Update(tickCounter); + + if (!flippy.Running) + { + finished.Add(flippy); + } + } + + lock (_flippyTimers) + { + foreach (var finishedFlippy in finished) + { + _flippyTimers.Remove(finishedFlippy); + } + } + + } + + /// + /// Drops a given item to a random position close to the player + /// + /// Player to which to reveal the item + /// Item to reveal + public void DropItem(Player player, Item item) + { + DropItem(player, player, item); + } + + /// + /// Drops a given item to a random position close to a source actor + /// + /// Source actor of the flippy animation + /// Player to which to reveal the item + /// Item to reveal + public void DropItem(Actor source, Player player, Item item) + { + lock (_flippyTimers) + { + _flippyTimers.Add(new RelativeTickTimer( + Game, + FlippyDurationInTicks, + (p) => item.Drop(null, item.Position) // drop the item after FlippyDuration ticks + )); + } + + // Get a random location close to the source + // TODO Make sure the location actually allows items (not occupied by something) + float x = (float)(RandomHelper.NextDouble() - 0.5) * FlippyMaxDistanceManhattan; + float y = (float)(RandomHelper.NextDouble() - 0.5) * FlippyMaxDistanceManhattan; + item.Position = source.Position + new Vector3D(x, y, 0); + + // Items send either only a particle effect or default particle and either FlippyTag.Actor or their own actorsno + int particleSNO = -1; + int actorSNO = -1; + + if (item.SnoFlippyParticle != null) + { + particleSNO = item.SnoFlippyParticle.Id; + } + else + { + actorSNO = item.SnoFlippyActory == null ? -1 : item.SnoFlippyActory.Id; + particleSNO = FlippyDefaultFlippy; + } + + BroadcastIfRevealed(new FlippyMessage + { + ActorID = (int)source.DynamicID, + Destination = item.Position, + SNOFlippyActor = actorSNO, + SNOParticleEffect = particleSNO + }, source); + + } + + #endregion + + #region collections managemnet + + /// + /// Adds given scene to world. + /// + /// The scene to add. + public void AddScene(Scene scene) + { + if (scene.DynamicID == 0 || HasScene(scene.DynamicID)) + throw new Exception(String.Format("Object has an invalid ID or was already present (ID = {0})", scene.DynamicID)); + + this._scenes.TryAdd(scene.DynamicID, scene); // add to scenes collection. + this.QuadTree.Insert(scene); // add it to quad-tree too. + } + + /// + /// Removes given scene from world. + /// + /// The scene to remove. + public void RemoveScene(Scene scene) + { + if (scene.DynamicID == 0 || !HasScene(scene.DynamicID)) + throw new Exception(String.Format("Object has an invalid ID or was not present (ID = {0})", scene.DynamicID)); + + Scene remotedScene; + this._scenes.TryRemove(scene.DynamicID, out remotedScene); // remove it from scenes collection. + this.QuadTree.Remove(scene); // remove from quad-tree too. + } + + /// + /// Returns the scene with given dynamicId. + /// + /// The dynamicId of the scene. + /// + public Scene GetScene(uint dynamicID) + { + Scene scene; + this._scenes.TryGetValue(dynamicID, out scene); + return scene; + } + + /// + /// Returns true if world contains a scene with given dynamicId. + /// + /// The dynamicId of the scene. + /// + public bool HasScene(uint dynamicID) + { + return this._scenes.ContainsKey(dynamicID); + } + + /// + /// Adds given actor to world. + /// + /// The actor to add. + private void AddActor(Actor actor) + { + if (actor.DynamicID == 0 || HasActor(actor.DynamicID)) + throw new Exception(String.Format("Object has an invalid ID or was already present (ID = {0})", actor.DynamicID)); + + this._actors.TryAdd(actor.DynamicID, actor); // add to actors collection. + this.QuadTree.Insert(actor); // add it to quad-tree too. + + if (actor.ActorType == ActorType.Player) // if actor is a player, add it to players collection too. + this.AddPlayer((Player)actor); + } + + /// + /// Removes given actor from world. + /// + /// The actor to remove. + private void RemoveActor(Actor actor) + { + if (actor.DynamicID == 0 || !this._actors.ContainsKey(actor.DynamicID)) + throw new Exception(String.Format("Object has an invalid ID or was not present (ID = {0})", actor.DynamicID)); + + Actor removedActor; + this._actors.TryRemove(actor.DynamicID, out removedActor); // remove it from actors collection. + this.QuadTree.Remove(actor); // remove from quad-tree too. + + if (actor.ActorType == ActorType.Player) // if actors is a player, remove it from players collection too. + this.RemovePlayer((Player)actor); + } + + // TODO: We should be instead using actor queries. /raist. + /// + /// Returns the actor with given dynamicId. + /// + /// The dynamicId of the actor. + /// + public Actor GetActorByDynamicId(uint dynamicID) + { + Actor actor; + this._actors.TryGetValue(dynamicID, out actor); + return actor; + } + + /// + /// Returns the actor with given dynamicId. + /// + /// The dynamicId of the actor. + /// The actor-type. + /// + public Actor GetActorByDynamicId(uint dynamicID, ActorType matchType) + { + var actor = this.GetActorByDynamicId(dynamicID); + if (actor != null) + { + if (actor.ActorType == matchType) + return actor; + else + Logger.Warn("Attempted to get actor ID {0} as a {1}, whereas the actor is type {2}", + dynamicID, Enum.GetName(typeof(ActorType), matchType), Enum.GetName(typeof(ActorType), actor.ActorType)); + } + return null; + } + + /// + /// Returns true if the world has an actor with given dynamicId. + /// + /// The dynamicId of the actor. + /// + public bool HasActor(uint dynamicID) + { + return this._actors.ContainsKey(dynamicID); + } + + /// + /// Returns true if the world has an actor with given dynamicId and type. + /// + /// The dynamicId of the actor. + /// The type of the actor. + /// + public bool HasActor(uint dynamicID, ActorType matchType) + { + var actor = this.GetActorByDynamicId(dynamicID, matchType); + return actor != null; + } + + /// + /// Returns actor instance with given type. + /// + /// Type of the actor. + /// Actor + public T GetActorInstance() where T : Actor + { + return this._actors.Values.OfType().FirstOrDefault(); + } + + /// + /// Adds given player to world. + /// + /// The player to add. + private void AddPlayer(Player player) + { + if (player.DynamicID == 0 || HasPlayer(player.DynamicID)) + throw new Exception(String.Format("Object has an invalid ID or was already present (ID = {0})", player.DynamicID)); + + this.Players.TryAdd(player.DynamicID, player); // add it to players collection. + } + + /// + /// Removes given player from world. + /// + /// + private void RemovePlayer(Player player) + { + if (player.DynamicID == 0 || !this.Players.ContainsKey(player.DynamicID)) + throw new Exception(String.Format("Object has an invalid ID or was not present (ID = {0})", player.DynamicID)); + + Player removedPlayer; + this.Players.TryRemove(player.DynamicID, out removedPlayer); // remove it from players collection. + } + + /// + /// Returns player with given dynamicId. + /// + /// The dynamicId of the player. + /// + public Player GetPlayer(uint dynamicID) + { + Player player; + this.Players.TryGetValue(dynamicID, out player); + return player; + } + + /// + /// Returns true if world contains a player with given dynamicId. + /// + /// The dynamicId of the player. + /// + public bool HasPlayer(uint dynamicID) + { + return this.Players.ContainsKey(dynamicID); + } + + /// + /// Returns item with given dynamicId. + /// + /// The dynamicId of the item. + /// + public Item GetItem(uint dynamicID) + { + return (Item)GetActorByDynamicId(dynamicID, ActorType.Item); + } + + /// + /// Returns true if world contains a monster with given dynamicId. + /// + /// The dynamicId of the monster. + /// + public bool HasMonster(uint dynamicID) + { + return HasActor(dynamicID, ActorType.Monster); + } + + /// + /// Returns true if world contains an item with given dynamicId. + /// + /// The dynamicId of the item. + /// + public bool HasItem(uint dynamicID) + { + return HasActor(dynamicID, ActorType.Item); + } + + #endregion + + #region misc-queries + + /// + /// Returns StartingPoint with given id. + /// + /// The id of the StartingPoint. + /// + public StartingPoint GetStartingPointById(int id) + { + return _actors.Values.OfType().FirstOrDefault(startingPoint => startingPoint.TargetId == id); + } + + /// + /// Returns WayPoint with given id. + /// + /// The id of the WayPoint + /// + public Waypoint GetWayPointById(int id) + { + return _actors.Values.OfType().FirstOrDefault(waypoint => waypoint.WaypointId == id); + } + + #endregion + + #region destroy, ctor, finalizer + + public override void Destroy() + { + // TODO: Destroy all objects /raist + Game game = this.Game; + this.Game = null; + game.EndTracking(this); + } + + #endregion + + public bool CheckLocationForFlag(Vector3D location, Mooege.Common.MPQ.FileFormats.Scene.NavCellFlags flags) + { + // We loop Scenes as its far quicker than looking thru the QuadTree - DarkLotus + + foreach (Scene s in this._scenes.Values) + { + if (s.Bounds.IntersectsWith(new Rect(location.X, location.Y, 1f, 1f))) + { + /*if (s.DynamicID != QuadTree.Query(new Common.Types.Misc.Circle(location.X, location.Y, 2f)).FirstOrDefault().DynamicID) + { + Logger.Debug("Quadtree");// This is here because quadtree has the same problem finding the master scene instead of subscene + }*/ + Scene scene = s; + if (s.Parent != null) { scene = s.Parent; } + if (s.Subscenes.Count > 0) + { + foreach (var subscene in s.Subscenes) + { + if (subscene.Bounds.IntersectsWith(new Rect(location.X, location.Y, 1f, 1f))) + { + scene = subscene; + } + } + } + + int x = (int)((location.X - scene.Bounds.Left) / 2.5f); + int y = (int)((location.Y - scene.Bounds.Top) / 2.5f); + /*if (s.NavMesh.WalkGrid[x, y] == 1) + { + return true; + }*/ + int total = (int)((y * scene.NavMesh.SquaresCountY) + x); + if (total < 0 || total > scene.NavMesh.NavMeshSquareCount) + { + Logger.Error("DarkLotus Cant Code:( Navmesh overflow"); + return false; + } + if (scene.NavMesh.Squares[total].Flags.HasFlag(flags)) + { + return true; + } + else + { + Logger.Debug("Flags: " + scene.NavMesh.Squares[total].Flags.ToString()); + return false; + } + //return false; + + } + } + // Location not inside a known scene - DarkLotus + return false; + } + + public void CleanupItemInstances() + { + if (DbItems.ContainsKey(this)) + { + var itemInstancesToDelete = DbItems[this].Where(dbi => dbi.Owner == null); + foreach (var itm in itemInstancesToDelete) + { + if (itm.DBInventory == null) + ItemGenerator.DeleteFromDB(itm); + } + DbItems.Remove(this); + } + + } + + + public override string ToString() + { + return string.Format("[World] SNOId: {0} DynamicId: {1} Name: {2}", this.WorldSNO.Id, this.DynamicID, this.WorldSNO.Name); + } + } +} diff --git a/src/Mooege/Core/GS/Objects/DynamicObject.cs b/src/Mooege/Core/GS/Objects/DynamicObject.cs new file mode 100644 index 00000000..df0810ee --- /dev/null +++ b/src/Mooege/Core/GS/Objects/DynamicObject.cs @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace Mooege.Core.GS.Objects +{ + /// + /// A dynamic object that can have a dynamicId + /// + public abstract class DynamicObject + { + /// + /// The dynamic unique runtime ID for the actor. + /// + public readonly uint DynamicID; + + /// + /// Initialization constructor. + /// + /// The dynamic ID to initialize with. + protected DynamicObject(uint dynamicID) + { + this.DynamicID = dynamicID; + } + + /// + /// Destroy the object. This should remove any references to the object throughout GS. + /// + public abstract void Destroy(); + } +} diff --git a/src/Mooege/Core/GS/Objects/GameAttributeMap.cs b/src/Mooege/Core/GS/Objects/GameAttributeMap.cs new file mode 100644 index 00000000..cc09d09a --- /dev/null +++ b/src/Mooege/Core/GS/Objects/GameAttributeMap.cs @@ -0,0 +1,544 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using Mooege.Common.Extensions; +using Mooege.Net.GS.Message.Definitions.Attribute; +using System.Linq; +using Mooege.Net.GS.Message; +using Mooege.Net.GS; +using Mooege.Common.Logging; + +namespace Mooege.Core.GS.Objects +{ + public class GameAttributeMap + { + private static Logger Logger = LogManager.CreateLogger(); + + private struct KeyId + { + // was using Id | (Key << 12) like Blizz at first but im not 100% sure it will work... /cm + public int Id; + public int? Key; + + public override bool Equals(object obj) + { + if (obj is KeyId) + { + var other = (KeyId)obj; + if (Key.HasValue != other.Key.HasValue) + return false; + if (Key.HasValue && Key.Value != other.Key.Value) + return false; + return Id == other.Id; + } + return false; + } + + public override int GetHashCode() + { + if (Key.HasValue) + return Id | (Key.Value << 12); + return Id; + } + } + + private HashSet _changedAttributes = new HashSet(); + private Dictionary _attributeValues = new Dictionary(); + private WorldObject _parent; + + public GameAttributeMap(WorldObject parent) + { + _parent = parent; + } + + + public string Serialize() + { + string serialized = ""; + foreach (var pair in _attributeValues) + { + + var gameAttribute = GameAttribute.Attributes[pair.Key.Id];//GameAttribute.GetById(pair.Key.Id); + + if (serialized.Length > 0) + serialized += ";"; + + + var values = RawGetAttributeValue(gameAttribute, pair.Key.Key); + + + + var ValueF = Convert.ToString(values.ValueF); + float testFloat = 0.0f; + if (!float.TryParse(ValueF, out testFloat)) + { + ValueF = "0.0"; + Logger.Error("Could not save ValueF to DB, saving 0 instead of {0}", pair.Value.ValueF); + } + serialized += string.Format("{0},{1}:{2}|{3}", pair.Key.Id, pair.Key.Key, values.Value, ValueF); + } + return serialized;//.ZipCompress(); + } + + public void FillBySerialized(string serializedGameAttributeMapCompressed) + { + var serializedGameAttributeMap = serializedGameAttributeMapCompressed;//.UnZipCompress(); + var pairs = serializedGameAttributeMap.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries); + _attributeValues.Clear(); + foreach (var pair in pairs) + { + try + { + + var pairParts = pair.Split(new[] { ':' }, StringSplitOptions.RemoveEmptyEntries); + + if (pairParts.Length != 2) + { + Logger.Error("GA Deserializated error, skipping Bad Pair."); + continue; + } + var values = pairParts[1].Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries); + + var valueI = int.Parse(values[0].Trim()); + var valueF = 0.0f; + if (!float.TryParse(values[1].Trim(), out valueF)) + { + Logger.Error("Error Parsing ValueF"); + } + + var keyData = pairParts[0].Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries); + var attributeId = int.Parse(keyData[0].Trim()); + var gameAttribute = GameAttribute.Attributes[attributeId];// .GetById(attributeId); + + if (gameAttribute.ScriptFunc != null && !gameAttribute.ScriptedAndSettable) + continue; + int? attributeKey = null; + if (keyData.Length > 1) + { + attributeKey = int.Parse(keyData[1].Trim()); + } + + + var val = RawGetAttributeValue(gameAttribute, attributeKey); + val.ValueF = valueF; + val.Value = valueI; + RawSetAttributeValue(gameAttribute, attributeKey, val); + } + catch (Exception exception) + { + Logger.ErrorException(exception, "Error setting GA Value \"{0}\"", pair); + } + } + + } + /* + public static GameAttributeMap Deserialize(WorldObject parent,string serializedGameAttributeMap) + { + var map = new GameAttributeMap(parent); + var pairs = serializedGameAttributeMap.Split(new[] {';'}, StringSplitOptions.RemoveEmptyEntries); + foreach (var pair in pairs) + { + var pairParts = pair.Split(new[] {':'}, StringSplitOptions.RemoveEmptyEntries); + var keyId = -1; + if (pairParts.Length != 2 || int.TryParse(pairParts[0].Trim(),out keyId)) + { + Logger.Error("GA Deserializated error, skipping."); + continue; + } + var values = pairParts[1].Split(new[] {','}, StringSplitOptions.RemoveEmptyEntries); + + var valueI = int.Parse(values[0].Trim()); + var valueF = int.Parse(values[1].Trim()); + var gameAttribute = GameAttribute.Attributes[keyId]; + if (gameAttribute is GameAttributeB) + + map[gameAttribute as GameAttributeB] = valueI != 0; + else if (gameAttribute is GameAttributeI) + map[gameAttribute as GameAttributeI] = valueI; + else if (gameAttribute is GameAttributeF) + map[gameAttribute as GameAttributeF] = valueF; + + } + return map; + } + */ + #region message broadcasting + + public void SendMessage(GameClient client) + { + var list = GetMessageList(); + foreach (var msg in list) + client.SendMessage(msg); + _changedAttributes.Clear(); + } + + public void SendMessage(IEnumerable clients) + { + var list = GetMessageList(); + foreach (var msg in list) + { + foreach (var client in clients) + client.SendMessage(msg); + } + _changedAttributes.Clear(); + } + + /// + /// Send only the changed attributes. How nice is that? + /// You should generaly use Broadcast if possible + /// + /// the client we send it to + public void SendChangedMessage(GameClient client) + { + var list = GetChangedMessageList(); + foreach (var msg in list) + client.SendMessage(msg); + _changedAttributes.Clear(); + } + + public void SendChangedMessage(IEnumerable clients) + { + if (_changedAttributes.Count == 0) + return; + + var list = GetChangedMessageList(); + foreach (var msg in list) + { + foreach (var client in clients) + client.SendMessage(msg); + } + _changedAttributes.Clear(); + } + + /// + /// Broadcasts attribs to players that the parent actor has been revealed to. + /// + public void BroadcastIfRevealed() + { + SendMessage(_parent.World.Players.Values + .Where(@player => @player.RevealedObjects.ContainsKey(_parent.DynamicID)) + .Select(@player => @player.InGameClient)); + } + + /// + /// Broadcasts changed attribs to players that the parent actor has been revealed to. + /// + public void BroadcastChangedIfRevealed() + { + SendChangedMessage(_parent.World.Players.Values + .Where(@player => @player.RevealedObjects.ContainsKey(_parent.DynamicID)) + .Select(@player => @player.InGameClient)); + } + + #endregion + + public void ClearChanged() + { + _changedAttributes.Clear(); + } + + private List GetMessageList() + { + var e = _attributeValues.Keys.GetEnumerator(); + var level = _attributeValues.ContainsKey(new KeyId() { Id = GameAttribute.Level.Id }); + return GetMessageListFromEnumerator(e, _attributeValues.Count, level); + } + + private List GetChangedMessageList() + { + var e = _changedAttributes.GetEnumerator(); + var level = _changedAttributes.Contains(new KeyId() { Id = GameAttribute.Level.Id }); + return GetMessageListFromEnumerator(e, _changedAttributes.Count, level); + } + + private List GetMessageListFromEnumerator(IEnumerator e, int count, bool level) + { + var messageList = new List(); + + if (count == 0) + return messageList; + + if (count == 1) + { + AttributeSetValueMessage msg = new AttributeSetValueMessage(); + if (!e.MoveNext()) + throw new Exception("Expected value in enumerator."); + + var keyid = e.Current; + var value = _attributeValues[keyid]; + + int id = keyid.Id; + msg.ActorID = _parent.DynamicID; + msg.Field1 = new Mooege.Net.GS.Message.Fields.NetAttributeKeyValue(); + msg.Field1.Field0 = keyid.Key; + // FIXME: need to rework NetAttributeKeyValue, and maybe rename GameAttribute to NetAttribute? + msg.Field1.Attribute = GameAttribute.Attributes[id]; // FIXME + if (msg.Field1.Attribute.IsInteger) + msg.Field1.Int = value.Value; + else + msg.Field1.Float = value.ValueF; + + messageList.Add(msg); + } + else + { + // FIXME: probably need to rework AttributesSetValues as well a bit + if (count >= 15) + { + for (; count >= 15; count -= 15) + { + AttributesSetValuesMessage msg = new AttributesSetValuesMessage(); + msg.ActorID = _parent.DynamicID; + msg.atKeyVals = new Mooege.Net.GS.Message.Fields.NetAttributeKeyValue[15]; + for (int i = 0; i < 15; i++) + msg.atKeyVals[i] = new Mooege.Net.GS.Message.Fields.NetAttributeKeyValue(); + for (int i = 0; i < 15; i++) + { + KeyId keyid; + if (!e.MoveNext()) + { + if (level) + { + keyid = new KeyId { Id = GameAttribute.Level.Id }; + level = false; + } + else + { + throw new Exception("Expected values in enumerator."); + } + } + else + { + keyid = e.Current; + } + + var kv = msg.atKeyVals[i]; + if (level && keyid.Id == GameAttribute.Level.Id) + { + i--; + continue; + } + + var value = _attributeValues[keyid]; + var id = keyid.Id; + + kv.Field0 = keyid.Key; + kv.Attribute = GameAttribute.Attributes[id]; + if (kv.Attribute.IsInteger) + kv.Int = value.Value; + else + kv.Float = value.ValueF; + } + messageList.Add(msg); + } + } + + if (count > 0) + { + AttributesSetValuesMessage msg = new AttributesSetValuesMessage(); + msg.ActorID = _parent.DynamicID; + msg.atKeyVals = new Mooege.Net.GS.Message.Fields.NetAttributeKeyValue[count]; + for (int i = 0; i < count; i++) + { + KeyId keyid; + if (!e.MoveNext()) + { + if (level) + { + keyid = new KeyId { Id = GameAttribute.Level.Id }; + level = false; + } + else + { + throw new Exception("Expected values in enumerator."); + } + } + else + { + keyid = e.Current; + } + var kv = new Mooege.Net.GS.Message.Fields.NetAttributeKeyValue(); + msg.atKeyVals[i] = kv; + + if (level && keyid.Id == GameAttribute.Level.Id) + { + i--; + continue; + } + + var value = _attributeValues[keyid]; + var id = keyid.Id; + + kv.Field0 = keyid.Key; + kv.Attribute = GameAttribute.Attributes[id]; + if (kv.Attribute.IsInteger) + kv.Int = value.Value; + else + kv.Float = value.ValueF; + } + messageList.Add(msg); + } + + } + return messageList; + } + + private GameAttributeValue GetAttributeValue(GameAttribute attribute, int? key) + { + if (attribute.ScriptFunc != null) + return attribute.ScriptFunc(this, key); + else + return RawGetAttributeValue(attribute, key); + } + + private GameAttributeValue RawGetAttributeValue(GameAttribute attribute, int? key) + { + KeyId keyid; + keyid.Id = attribute.Id; + keyid.Key = key; + + GameAttributeValue gaValue; + if (_attributeValues.TryGetValue(keyid, out gaValue)) + return gaValue; + return attribute._DefaultValue; + } + + private void SetAttributeValue(GameAttribute attribute, int? key, GameAttributeValue value) + { + // error if scripted attribute and is not settable + if (attribute.ScriptFunc != null && !attribute.ScriptedAndSettable) + { + var frame = new System.Diagnostics.StackFrame(2, true); + Logger.Error("illegal value assignment for GameAttribute.{0} attempted at {1}:{2}", + attribute.Name, frame.GetFileName(), frame.GetFileLineNumber()); + } + + if (attribute.EncodingType == GameAttributeEncoding.IntMinMax) + { + if (value.Value < attribute.Min.Value || value.Value > attribute.Max.Value) + throw new ArgumentOutOfRangeException("GameAttribute." + attribute.Name.Replace(' ', '_'), "Min: " + attribute.Min.Value + " Max: " + attribute.Max.Value + " Tried to set: " + value.Value); + } + else if (attribute.EncodingType == GameAttributeEncoding.Float16) + { + if (value.ValueF < GameAttribute.Float16Min || value.ValueF > GameAttribute.Float16Max) + throw new ArgumentOutOfRangeException("GameAttribute." + attribute.Name.Replace(' ', '_'), "Min: " + GameAttribute.Float16Min + " Max " + GameAttribute.Float16Max + " Tried to set: " + value.ValueF); + } + + RawSetAttributeValue(attribute, key, value); + } + + private void RawSetAttributeValue(GameAttribute attribute, int? key, GameAttributeValue value) + { + KeyId keyid; + keyid.Id = attribute.Id; + keyid.Key = key; + + _attributeValues[keyid] = value; + + if (!_changedAttributes.Contains(keyid)) + _changedAttributes.Add(keyid); + + // mark dependant attributes as changed + if (attribute.Dependents != null) + { + foreach (var dependent in attribute.Dependents) + { + int? usekey; + + if (dependent.IsManualDependency) + usekey = dependent.Key; + else + usekey = dependent.UsesExplicitKey ? null : key; + + if (dependent.IsManualDependency || dependent.UsesExplicitKey == false || dependent.Key == key) + { + // TODO: always update dependent values for now, but eventually make this lazy + RawSetAttributeValue(dependent.Attribute, usekey, dependent.Attribute.ScriptFunc(this, usekey)); + } + } + } + } + + public int this[GameAttributeI attribute] + { + get { return GetAttributeValue(attribute, null).Value; } + set { SetAttributeValue(attribute, null, new GameAttributeValue(value)); } + } + + public int this[GameAttributeI attribute, int? key] + { + get { return GetAttributeValue(attribute, key).Value; } + set { SetAttributeValue(attribute, key, new GameAttributeValue(value)); } + } + + public float this[GameAttributeF attribute] + { + get { return GetAttributeValue(attribute, null).ValueF; } + set { SetAttributeValue(attribute, null, new GameAttributeValue(value)); } + } + + public float this[GameAttributeF attribute, int? key] + { + get { return GetAttributeValue(attribute, key).ValueF; } + set { SetAttributeValue(attribute, key, new GameAttributeValue(value)); } + } + + public bool this[GameAttributeB attribute] + { + get { return GetAttributeValue(attribute, null).Value != 0; } + set { SetAttributeValue(attribute, null, new GameAttributeValue(value ? 1 : 0)); } + } + + public bool this[GameAttributeB attribute, int? key] + { + get { return GetAttributeValue(attribute, key).Value != 0; } + set { SetAttributeValue(attribute, key, new GameAttributeValue(value ? 1 : 0)); } + } + + #region Raw attribute accessors + // NOTE: these are public, but only exist to be used by GameAttribute scripts. + // They provide raw attribute access of values, no scripts will be triggered when used. + public int _RawGetAttribute(GameAttributeI attribute, int? key) + { + return RawGetAttributeValue(attribute, key).Value; + } + + public float _RawGetAttribute(GameAttributeF attribute, int? key) + { + return RawGetAttributeValue(attribute, key).ValueF; + } + + public bool _RawGetAttribute(GameAttributeB attribute, int? key) + { + return RawGetAttributeValue(attribute, key).Value != 0; + } + #endregion + + + public IEnumerable ActiveIds + { + get { return this._attributeValues.Select(k => k.Key.Id); } + } + public int?[] AttributeKeys(GameAttribute ga) + { + return _attributeValues.Where(av => av.Key.Id == ga.Id).Select(av => av.Key.Key).ToArray(); + } + } +} diff --git a/src/Mooege/Core/GS/Objects/IRevealable.cs b/src/Mooege/Core/GS/Objects/IRevealable.cs new file mode 100644 index 00000000..bf5352a4 --- /dev/null +++ b/src/Mooege/Core/GS/Objects/IRevealable.cs @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Core.GS.Players; + +namespace Mooege.Core.GS.Objects +{ + /// + /// Interface for revealable in-game objects. + /// + public interface IRevealable + { + /// + /// Reveals the object to a player. + /// + /// true if the object was revealed or false if the object was already revealed. + bool Reveal(Player player); + + /// + /// Unreveals the object from a player. + /// + /// true if the object was unrevealed or false if the object wasn't already revealed. + bool Unreveal(Player player); + } +} diff --git a/src/Mooege/Core/GS/Objects/IUpdateable.cs b/src/Mooege/Core/GS/Objects/IUpdateable.cs new file mode 100644 index 00000000..1bafad7b --- /dev/null +++ b/src/Mooege/Core/GS/Objects/IUpdateable.cs @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace Mooege.Core.GS.Objects +{ + /// + /// Defines an interface for objects that can update on game ticks. + /// + public interface IUpdateable + { + /// + /// Tells object to update itself and call it's IUpdateable childs if any. + /// + /// The Game.TickCounter value when the function gets called. + void Update(int tickCounter); + } +} diff --git a/src/Mooege/Core/GS/Objects/WorldObject.cs b/src/Mooege/Core/GS/Objects/WorldObject.cs new file mode 100644 index 00000000..080ebd6a --- /dev/null +++ b/src/Mooege/Core/GS/Objects/WorldObject.cs @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Diagnostics; +using System.Windows; +using Mooege.Core.GS.Actors; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Players; + +namespace Mooege.Core.GS.Objects +{ + /// + /// An object that can be placed in world. + /// + public abstract class WorldObject : DynamicObject, IRevealable + { + /// + /// The world object belongs to. + /// + public World World { get; protected set; } + + protected Vector3D _position; + + /// + /// The position of the object. + /// + public Vector3D Position + { + get { return _position; } + set + { + _position = value; + this.Bounds = new Rect(this.Position.X, this.Position.Y, this.Size.Width, this.Size.Height); + var handler = PositionChanged; + if (handler != null) handler(this, EventArgs.Empty); + } + } + + /// + /// Event handler for position-change. + /// + public event EventHandler PositionChanged; + + /// + /// Size of the object. + /// + public Size Size { get; protected set; } + + /// + /// Automatically calculated bounds for object used by QuadTree. + /// + public Rect Bounds { get; private set; } + + /// + /// Scale of the object. + /// + public float Scale { get; set; } + + public Vector3D RotationAxis { get; set; } + + public float RotationW { get; set; } + + /// + /// Creates a new world object. + /// + /// The world object belongs to. + /// The dynamicId of the object. + protected WorldObject(World world, uint dynamicID) + : base(dynamicID) + { + Debug.Assert(world != null); + this.World = world; + this.World.Game.StartTracking(this); // track the object. + this.RotationAxis = new Vector3D(); + this._position = new Vector3D(); + } + + /// + /// Reveals the object to given player. + /// + /// The player to reveal the object. + /// true if the object was revealed or false if the object was already revealed. + public abstract bool Reveal(Player player); + + /// + /// Unreveals the object to given plaer. + /// + /// The player to unreveal the object. + /// true if the object was unrevealed or false if the object wasn't already revealed. + public abstract bool Unreveal(Player player); + + /// + /// Makes the object leave the world and then destroys it. + /// + public override void Destroy() + { + if (this is Actor) + this.World.Leave(this as Actor); + + this.World.Game.EndTracking(this); + this.World = null; + } + } +} diff --git a/src/Mooege/Core/GS/Players/ConversationManager.cs b/src/Mooege/Core/GS/Players/ConversationManager.cs new file mode 100644 index 00000000..ccd43a3c --- /dev/null +++ b/src/Mooege/Core/GS/Players/ConversationManager.cs @@ -0,0 +1,484 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using Mooege.Common.Helpers.Math; +using Mooege.Common.Logging; +using Mooege.Net.GS.Message.Definitions.Conversation; +using Mooege.Net.GS.Message.Fields; +using Mooege.Net.GS.Message; +using Mooege.Net.GS; +using Mooege.Common.MPQ.FileFormats; +using Mooege.Net.GS.Message.Definitions.ACD; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Games; + +/* + * a few notes to the poor guy who wants to improve the conversation system: + * From my understanding, a conversation consists of a sequence of lines in RootTreeNodes + * Each line has its own tree with different node types (I0 / first field in ConversationTreeNode) + * + * - A node type 3 indicates this node has the lineID (for the client), the speaker enum, and an animation tag. + * - Each node of type 3 has nodes of type 5, thats hold information on how long the audio goes (for starting the next line) + * depending on class and gender of the player, even if that part is not actually spoken by the player actor but another. + * If the speaker of it parent node is the player, then there may be as many as five nodes (on for each class) with only + * the ConvLocalDisplayTime for that class but sometimes, there is not a node for each class but a "for all" node with all information combined + * - A node type of 4 indicates that it children are alternatives. So i pick a random one + * + * NodeType4 1. Line, pick a random child + * NodeType3 1. Line, 1. alternative. LineID and AnimationTag + * NodeType5 3 1. Line, 1. alternative, duration for some class + * NodeType5 4 1. Line, 1. alternative, duration for another class + * NodeType5 -1 1. Line, 1. alternative, duration for all classes (may not always be there, renders other node5 useless/redundant) + * NodeType3 1. Line, 2. alternative, LineID and AnimationTag + * NodeType5 1. Line, 2. alternative, duration for all classes (may not always be there, renders other node5 useless/redundant) + * NodeType3 2. Line, LineID and AnimationTag + * NodeType5 2. Line, duration (-1, npc speaking, not dependant on player class choice + * + * There is at least also a NodeType6 but if have no clue what it does + * + * ConvLocalDisplayTimes is an array with another array for every supported language + * The second array holds information for the audio duration of different speakers in game ticks + * [BarbarianMale, BarbarianFemale, DemonHunterMale, ...] + * + * good luck :-) - farmy + */ +namespace Mooege.Core.GS.Players +{ + /// + /// Wraps a conversation asset and manages the whole conversation + /// + class Conversation + { + Logger logger = new Logger("Conversation"); + public event EventHandler ConversationEnded; + + public int ConvPiggyBack { get { return asset.SNOConvPiggyback; } } + public int SNOId { get { return asset.Header.SNOId; } } + + private Mooege.Common.MPQ.FileFormats.Conversation asset; + private int LineIndex = 0; // index within the RootTreeNodes, conversation progress + private Player player; + private ConversationManager manager; + private int currentUniqueLineID; // id used to identify the current line clientside + private int startTick = 0; // start tick of the current line. used to determine, when to start the next line + private ConversationTreeNode currentLineNode = null; + private int endTick = 0; + + // Find a childnode with a matching class id, that one holds information about how long the speaker talks + // If there is no matching childnode, there must be one with -1 which only combines all class specific into one + private int duration + { + get + { + var node = from a in currentLineNode.ChildNodes where a.ClassFilter == player.Toon.VoiceClassID select a; + if (node.Count() == 0) + node = from a in currentLineNode.ChildNodes where a.ClassFilter == -1 select a; + + return node.First().ConvLocalDisplayTimes.ElementAt((int)manager.ClientLanguage).Languages[player.Toon.VoiceClassID * 2 + (player.Toon.Gender == 0 ? 0 : 1)]; + } + } + + // This returns the dynamicID of other conversation partners. The client uses its position to identify where you can hear the conversation. + // This implementation relies on there beeing exactly one actor with a given sno in the world!! + // TODO Find a better way to get the dynamicID of actors or verify that this implementation is sound. + // TODO add actor identification for Followers + private Mooege.Core.GS.Actors.Actor GetSpeaker(Speaker speaker) + { + switch (speaker) + { + case Speaker.AltNPC1: return GetActorBySNO(asset.SNOAltNpc1); + case Speaker.AltNPC2: return GetActorBySNO(asset.SNOAltNpc2); + case Speaker.AltNPC3: return GetActorBySNO(asset.SNOAltNpc3); + case Speaker.AltNPC4: return GetActorBySNO(asset.SNOAltNpc4); + case Speaker.Player: return player; + case Speaker.PrimaryNPC: return GetActorBySNO(asset.SNOPrimaryNpc); + case Speaker.EnchantressFollower: return null; + case Speaker.ScoundrelFollower: return null; + case Speaker.TemplarFollower: return null; + case Speaker.None: return null; + } + return null; + } + + private Mooege.Core.GS.Actors.Actor GetActorBySNO(int sno) + { + var actors = (from a in player.RevealedObjects.Values where a is Mooege.Core.GS.Actors.Actor && (a as Mooege.Core.GS.Actors.Actor).ActorSNO.Id == sno select a); + if (actors.Count() > 1) + logger.Warn("Found more than one actors in range"); + if (actors.Count() == 0) + { + // HACK: fixes client crashing when you talk to vendors. + // This seems to be cause by a mismatch in + // world actors and their conversations, probably caused by our hacky back-patched mpq data. + // the conv is requesting an alternate actor SNO than what's revealed to the player, and apparently + // the client doesn't like it when the player actor is used to play vendor conversations. + // so for now I do a substring-search for requested actor's name looking for a similar one that actually + // is revealed. + string reqName = new Mooege.Core.GS.Common.Types.SNO.SNOHandle(Common.Types.SNO.SNOGroup.Actor, sno).Name; + reqName = System.Text.RegularExpressions.Regex.Replace(reqName, @"_\d+$", ""); // remove _01 etc from end + var replacementActor = player.RevealedObjects.Values.Where(a => a is Mooege.Core.GS.Actors.Actor) + .Cast() + .FirstOrDefault(a => a.ActorSNO.Name.Contains(reqName)); + if (replacementActor != null) + return replacementActor; + + logger.Warn("Actor not found, using player actor instead"); + return player; + } + + return actors.First() as Mooege.Core.GS.Actors.Actor; + } + + /// + /// Creates a new conversation wrapper for an asset with a given sno. + /// + /// sno of the asset to wrap + /// player that receives messages + /// the quest manager that provides ids + public Conversation(int snoConversation, Player player, ConversationManager manager) + { + asset = Mooege.Common.MPQ.MPQStorage.Data.Assets[Common.Types.SNO.SNOGroup.Conversation][snoConversation].Data as Mooege.Common.MPQ.FileFormats.Conversation; + this.player = player; + this.manager = manager; + } + + /// + /// Starts the conversation + /// + public void Start() + { + PlayLine(LineIndex); + } + + /// + /// Immediatly ends the conversation + /// + public void Stop() + { + StopLine(true); + EndConversation(); + } + + /// + /// Sets a new end tick for line playback + /// + /// + public void UpdateAdvance(int endTick) + { + this.endTick = endTick; + } + + /// + /// Skips to the next line of the conversation + /// + public void Interrupt() + { + PlayNextLine(true); + } + + /// + /// Periodically call this method to make sure conversation progresses + /// + public void Update(int tickCounter) + { + if (endTick > 0 && currentLineNode == null) + PlayNextLine(false); + else + { + + // rotate the primary speaker to face the secondary speaker + if (currentLineNode.Speaker1 != Speaker.Player && currentLineNode.Speaker2 != Speaker.None) + { + Mooege.Core.GS.Actors.Actor speaker1 = GetSpeaker(currentLineNode.Speaker1); + Mooege.Core.GS.Actors.Actor speaker2 = GetSpeaker(currentLineNode.Speaker2); + + Vector3D translation = speaker2.Position - speaker1.Position; + Vector2F flatTranslation = new Vector2F(translation.X, translation.Y); + + float facingAngle = flatTranslation.Rotation(); + speaker1.SetFacingRotation(facingAngle); + + player.World.BroadcastIfRevealed(new ACDTranslateFacingMessage + { + ActorId = speaker1.DynamicID, + Angle = facingAngle, + TurnImmediately = false + }, speaker1); + } + + // start the next line if the playback has finished + if (tickCounter > endTick) + PlayNextLine(false); + } + } + + /// + /// Stops current line and starts the next if there is one, or ends the conversation + /// + /// sets, whether the speaker is interrupted + public void PlayNextLine(bool interrupt) + { + StopLine(interrupt); + + if (asset.RootTreeNodes.Count > LineIndex + 1) + PlayLine(++LineIndex); + else + EndConversation(); + } + + /// + /// Ends the conversation, though i dont know, what it actually does. This is only through observation + /// + private void EndConversation() + { + player.InGameClient.SendMessage(new EndConversationMessage() + { + SNOConversation = asset.Header.SNOId, + ActorId = player.DynamicID + }); + + player.InGameClient.SendMessage(new FinishConversationMessage + { + SNOConversation = asset.Header.SNOId + }); + + if (ConversationEnded != null) + ConversationEnded(this, null); + } + + /// + /// Stops readout and display of current conversation line + /// + /// sets whether the speaker is interrupted or not + private void StopLine(bool interrupted) + { + player.InGameClient.SendMessage(new StopConvLineMessage() + { + PlayLineParamsId = currentUniqueLineID, + Interrupt = interrupted, + }); + } + + /// + /// Starts readout and display of a certain conversation line + /// + /// index of the line withing the rootnodes + private void PlayLine(int LineIndex) + { + if (asset.RootTreeNodes[LineIndex].I0 == 6) + { + // TODO dont know what to do with them yet, this just ignores them -farmy + currentLineNode = null; + return; + } + + if (asset.RootTreeNodes[LineIndex].I0 == 4) + currentLineNode = asset.RootTreeNodes[LineIndex].ChildNodes[RandomHelper.Next(asset.RootTreeNodes[LineIndex].ChildNodes.Count)]; + else + currentLineNode = asset.RootTreeNodes[LineIndex]; + + currentUniqueLineID = manager.GetNextUniqueLineID(); + startTick = player.World.Game.TickCounter; + endTick = startTick + duration; + + // TODO Actor id should be CurrentSpeaker.DynamicID not PrimaryNPC.ActorID. This is a workaround because no audio for the player is playing otherwise + player.InGameClient.SendMessage(new PlayConvLineMessage() + { + ActorID = GetSpeaker(currentLineNode.Speaker1).DynamicID, // GetActorBySNO(asset.SNOPrimaryNpc).DynamicID, + Field1 = new uint[9] + { + player.DynamicID, asset.SNOPrimaryNpc != -1 ? GetActorBySNO(asset.SNOPrimaryNpc).DynamicID : 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF + }, + + PlayLineParams = new PlayLineParams() + { + SNOConversation = asset.Header.SNOId, + Field1 = 0x00000000, + Field2 = false, + Field3 = true, + Field4 = false, + LineID = currentLineNode.LineID, + Speaker = currentLineNode.Speaker1, + Field5 = -1, + TextClass = currentLineNode.Speaker1 == Speaker.Player ? (Class)player.Toon.VoiceClassID : Class.None, + Gender = (player.Toon.Gender == 0) ? VoiceGender.Male : VoiceGender.Female, + AudioClass = (Class)player.Toon.VoiceClassID, + SNOSpeakerActor = GetSpeaker(currentLineNode.Speaker1).ActorSNO.Id, + Name = player.Toon.Name, + Field11 = 0x00000000, // is this field I1? and if...what does it do?? 2 for level up -farmy + AnimationTag = currentLineNode.AnimationTag, + Duration = duration, + Id = currentUniqueLineID, + Field15 = 0x00000000 // dont know, 0x32 for level up + }, + Duration = duration, + }, true); + } + } + + /// + /// Manages conversations. Since you can (maybe?) only have one conversation at a time, this class may be merged with the player. + /// Still, its a bit nicer this ways, considering the player class already has 1000+ loc + /// + public class ConversationManager + { + Logger logger = new Logger("ConversationManager"); + internal enum Language { Invalid, Global, enUS, enGB, enSG, esES, esMX, frFR, itIT, deDE, koKR, ptBR, ruRU, zhCN, zTW, trTR, plPL, ptPT } + + private Player player; + private Dictionary openConversations = new Dictionary(); + private int linesPlayedTotal = 0; + private QuestProgressHandler quests; + + internal Language ClientLanguage { get { return Language.enUS; } } + + internal int GetNextUniqueLineID() + { + return linesPlayedTotal++; + } + + public ConversationManager(Player player, QuestProgressHandler quests) + { + this.player = player; + this.quests = quests; + } + + /// + /// Stops all conversations + /// + public void StopAll() + { + List clonedList; + + // update from a cloned list, so you can remove conversations in their ConversationEnded event + lock (openConversations) + { + clonedList = (from c in openConversations select c.Value).ToList(); + } + + foreach (Conversation conversation in clonedList) + conversation.Stop(); + } + + /// + /// Starts and plays a conversation + /// + /// SnoID of the conversation + public void StartConversation(int snoConversation) + { + if (!Mooege.Common.MPQ.MPQStorage.Data.Assets[Common.Types.SNO.SNOGroup.Conversation].ContainsKey(snoConversation)) + { + logger.Warn("Conversation not found: {0}", snoConversation); + return; + } + + if (!openConversations.ContainsKey(snoConversation)) + { + Conversation newConversation = new Conversation(snoConversation, player, this); + newConversation.Start(); + newConversation.ConversationEnded += new EventHandler(ConversationEnded); + + lock (openConversations) + { + openConversations.Add(snoConversation, newConversation); + + } + } + } + + /// + /// Remove conversation from the list of open conversations and start its piggyback conversation + /// + void ConversationEnded(object sender, EventArgs e) + { + Conversation conversation = sender as Conversation; + quests.Notify(QuestStepObjectiveType.HadConversation, conversation.SNOId); + + lock (openConversations) + { + openConversations.Remove(conversation.SNOId); + } + + if (conversation.ConvPiggyBack != -1) + StartConversation(conversation.ConvPiggyBack); + } + + /// + /// Returns true when the conversation playing finishes. + /// + private bool _conversationTrigger = false; + public bool ConversationRunning() + { + var status = _conversationTrigger; + _conversationTrigger = false; + return status; + } + + /// + /// Update all open conversations + /// + /// + public void Update(int tickCounter) + { + List clonedList; + + // update from a cloned list, so you can remove conversations in their ConversationEnded event + lock (openConversations) + { + clonedList = (from c in openConversations select c.Value).ToList(); + } + + foreach (var conversation in clonedList) + conversation.Update(tickCounter); + } + + /// + /// Consumes conversations related messages + /// + /// + /// + public void Consume(GameClient client, GameMessage message) + { + lock (openConversations) + { + if (message is RequestCloseConversationWindowMessage) + { + List clonedList = (from c in openConversations select c.Value).ToList(); + + foreach (var conversation in clonedList) + conversation.Interrupt(); + } + + if (message is UpdateConvAutoAdvanceMessage) + { + UpdateConvAutoAdvanceMessage tmpMessage = (UpdateConvAutoAdvanceMessage)message; + openConversations[tmpMessage.SNOConversation].UpdateAdvance(tmpMessage.EndTick); + } + + if (message is AdvanceConvMessage) + { + Conversation conv = openConversations[((AdvanceConvMessage)message).SNOConversation]; + conv.PlayNextLine(true); + } + } + } + } +} \ No newline at end of file diff --git a/src/Mooege/Core/GS/Players/Equipment.cs b/src/Mooege/Core/GS/Players/Equipment.cs new file mode 100644 index 00000000..75f3773e --- /dev/null +++ b/src/Mooege/Core/GS/Players/Equipment.cs @@ -0,0 +1,205 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Core.GS.Items; +using Mooege.Net.GS.Message.Fields; +using Mooege.Net.GS.Message; +using System.Collections.Generic; +using Mooege.Core.GS.Objects; + +namespace Mooege.Core.GS.Players +{ + // these ids are transmitted by the client when equipping an item + public enum EquipmentSlotId + { + Inventory = 0, Helm = 1, Chest = 2, Off_Hand = 3, Main_Hand = 4, Hands = 5, Belt = 6, Feet = 7, + Shoulders = 8, Legs = 9, Bracers = 10, Ring_right = 11, Ring_left = 12, Neck = 13, + Skills = 14, Stash = 15, Gold = 16, StashSize = 17, Vendor = 18 // TODO: Should this be here? Its not really an eq. slot /fasbat + } + + class Equipment : IRevealable + { + public int EquipmentSlots { get { return _equipment.GetLength(0); } } + public Dictionary Items { get; private set; } + private readonly Player _owner; // Used, because most information is not in the item class but Actors managed by the world + + private uint[] _equipment; // array of equiped items_id (not item) + + public Equipment(Player owner) + { + this._equipment = new uint[14];// only needed up to Neck + this._owner = owner; + this.Items = new Dictionary(); + } + + /// + /// Equips an item in an equipment slot + /// + public void EquipItem(Item item, int slot) + { + if (item != null) + { + _equipment[slot] = item.DynamicID; + if (!Items.ContainsKey(item.DynamicID)) + Items.Add(item.DynamicID, item); + item.Owner = _owner; + item.Attributes[GameAttribute.Item_Equipped] = true; // Probaly should be handled by Equipable class /fasbat + item.Attributes.SendChangedMessage(_owner.InGameClient); + item.SetInventoryLocation(slot, 0, 0); + } + } + + public void EquipItem(uint itemID, int slot) + { + EquipItem(_owner.Inventory.GetItem(itemID), slot); + } + + /// + /// Removes an item from the equipment slot it uses + /// returns the used equipmentSlot + /// + public int UnequipItem(Item item) + { + if (!Items.ContainsKey(item.DynamicID)) + return 0; + Items.Remove(item.DynamicID); + + var slot = item.EquipmentSlot; + if (_equipment[slot] == item.DynamicID) + { + _equipment[slot] = 0; + item.Attributes[GameAttribute.Item_Equipped] = false; // Probaly should be handled by Equipable class /fasbat + item.Attributes.SendChangedMessage(_owner.InGameClient); + return slot; + } + + return 0; + } + + /// + /// Returns whether an item is equipped + /// + public bool IsItemEquipped(uint itemID) + { + return Items.ContainsKey(itemID); + } + + public bool IsItemEquipped(Item item) + { + return IsItemEquipped(item.DynamicID); + } + + private VisualItem GetEquipmentItem(EquipmentSlotId equipSlot) + { + if (_equipment[(int)equipSlot] == 0) + { + return new VisualItem() + { + GbId = -1, // 0 causes error logs on the client - angerwin + Field1 = 0, + Field2 = 0, + Field3 = 0, + }; + } + + return Items[(_equipment[(int)equipSlot])].CreateVisualItem(); + } + + private D3.Hero.VisualItem GetEquipmentItemForToon(EquipmentSlotId equipSlot) + { + if (_equipment[(int)equipSlot] == 0) + { + return D3.Hero.VisualItem.CreateBuilder() + .SetGbid(-1) + .SetDyeType(0) + .SetEffectLevel(0) + .SetItemEffectType(-1) + .Build(); + } + + return Items[(_equipment[(int)equipSlot])].GetVisualItem(); + } + + public VisualItem[] GetVisualEquipment() + { + return new VisualItem[8] + { + GetEquipmentItem(EquipmentSlotId.Helm), + GetEquipmentItem(EquipmentSlotId.Chest), + GetEquipmentItem(EquipmentSlotId.Feet), + GetEquipmentItem(EquipmentSlotId.Hands), + GetEquipmentItem(EquipmentSlotId.Main_Hand), + GetEquipmentItem(EquipmentSlotId.Off_Hand), + GetEquipmentItem(EquipmentSlotId.Shoulders), + GetEquipmentItem(EquipmentSlotId.Legs), + }; + } + + public D3.Hero.VisualEquipment GetVisualEquipmentForToon() + { + var visualItems = new[] + { + GetEquipmentItemForToon(EquipmentSlotId.Helm), + GetEquipmentItemForToon(EquipmentSlotId.Chest), + GetEquipmentItemForToon(EquipmentSlotId.Feet), + GetEquipmentItemForToon(EquipmentSlotId.Hands), + GetEquipmentItemForToon(EquipmentSlotId.Main_Hand), + GetEquipmentItemForToon(EquipmentSlotId.Off_Hand), + GetEquipmentItemForToon(EquipmentSlotId.Shoulders), + GetEquipmentItemForToon(EquipmentSlotId.Legs), + }; + return D3.Hero.VisualEquipment.CreateBuilder().AddRangeVisualItem(visualItems).Build(); + } + + internal Item GetEquipment(int targetEquipSlot) + { + return GetItem(this._equipment[targetEquipSlot]); + } + + internal Item GetEquipment(EquipmentSlotId targetEquipSlot) + { + return GetEquipment((int)targetEquipSlot); + } + + public bool Reveal(Player player) + { + foreach (var item in Items.Values) + { + item.Reveal(player); + } + return true; + } + + public bool Unreveal(Player player) + { + foreach (var item in Items.Values) + { + item.Unreveal(player); + } + return true; + } + + public Item GetItem(uint itemId) + { + Item item; + if (!Items.TryGetValue(itemId, out item)) + return null; + return item; + } + } +} diff --git a/src/Mooege/Core/GS/Players/ExpBonusData.cs b/src/Mooege/Core/GS/Players/ExpBonusData.cs new file mode 100644 index 00000000..76385f2e --- /dev/null +++ b/src/Mooege/Core/GS/Players/ExpBonusData.cs @@ -0,0 +1,228 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using Mooege.Common.Logging; +using Mooege.Net.GS.Message.Definitions.Combat; + +namespace Mooege.Core.GS.Players +{ + public class ExpBonusData + { + private static readonly Logger Logger = LogManager.CreateLogger(); + + /// + /// The referenced player. + /// + private Player _player; + + /// + /// The time between two kills to still count as a killstreak. + /// + private int _killstreakTickTime; + + /// + /// The player's killcounter in a killstreak. + /// + private int _killstreakPlayer; + + /// + /// The environment's killcounter in a killstreak. + /// + private int _killstreakEnvironment; + + /// + /// The last tick in which the player killed any monster. + /// + private int _lastMonsterKillTick; + + /// + /// The last tick in which the player attacked any monster. + /// + private int _lastMonsterAttackTick; + + /// + /// The number of monster-kills of the player's latest monster-attack. + /// + private int _lastMonsterAttackKills; + + /// + /// The last tick in which environement got destroyed by the player. + /// + private int _lastEnvironmentDestroyTick; + + /// + /// The number of monster-kills of the last environment-destruction. + /// + private int _lastEnvironmentDestroyMonsterKills; + + /// + /// The last tick in which destroyed environment killed a monster. + /// + private int _lastEnvironmentDestroyMonsterKillTick; + + public ExpBonusData(Player player) + { + this._player = player; + this._killstreakTickTime = 200; + this._killstreakPlayer = 0; + this._killstreakEnvironment = 0; + this._lastMonsterKillTick = 0; + this._lastMonsterAttackTick = 0; + this._lastMonsterAttackKills = 0; + this._lastEnvironmentDestroyTick = 0; + this._lastEnvironmentDestroyMonsterKills = 0; + this._lastEnvironmentDestroyMonsterKillTick = 0; + } + + public void Update(int attackerActorType, int defeatedActorType) + { + if (attackerActorType == 7) // Player + { + if (defeatedActorType == 1) // Monster + { + // Massacre + if (this._lastMonsterKillTick + this._killstreakTickTime > this._player.InGameClient.Game.TickCounter) + { + this._killstreakPlayer++; + } + else + { + this._killstreakPlayer = 1; + } + + // MightyBlow + if (Math.Abs(this._lastMonsterAttackTick - this._player.InGameClient.Game.TickCounter) <= 20) + { + this._lastMonsterAttackKills++; + } + else + { + this._lastMonsterAttackKills = 1; + } + + this._lastMonsterKillTick = this._player.InGameClient.Game.TickCounter; + } + else if (defeatedActorType == 5) // Environment + { + // Destruction + if (this._lastEnvironmentDestroyTick + this._killstreakTickTime > this._player.InGameClient.Game.TickCounter) + { + this._killstreakEnvironment++; + } + else + { + this._killstreakEnvironment = 1; + } + + this._lastEnvironmentDestroyTick = this._player.InGameClient.Game.TickCounter; + } + } + else if (attackerActorType == 5) // Environment + { + // Pulverized + if (Math.Abs(this._lastEnvironmentDestroyMonsterKillTick - this._player.InGameClient.Game.TickCounter) <= 20) + { + this._lastEnvironmentDestroyMonsterKills++; + } + else + { + this._lastEnvironmentDestroyMonsterKills = 1; + } + + this._lastEnvironmentDestroyMonsterKillTick = this._player.InGameClient.Game.TickCounter; + } + } + + public void Check(byte bonusType) + { + int defeated = 0; + int expBonus = 0; + + switch (bonusType) + { + case 0: // Massacre + { + if ((this._killstreakPlayer > 5) && (this._lastMonsterKillTick + this._killstreakTickTime <= this._player.InGameClient.Game.TickCounter)) + { + defeated = this._killstreakPlayer; + expBonus = (this._killstreakPlayer - 5) * 10; + + this._killstreakPlayer = 0; + } + break; + } + case 1: // Destruction + { + if ((this._killstreakEnvironment > 5) && (this._lastEnvironmentDestroyTick + this._killstreakTickTime <= this._player.InGameClient.Game.TickCounter)) + { + defeated = this._killstreakEnvironment; + expBonus = (this._killstreakEnvironment - 5) * 5; + + this._killstreakEnvironment = 0; + } + break; + } + case 2: // Mighty Blow + { + if (this._lastMonsterAttackKills > 5) + { + defeated = this._lastMonsterAttackKills; + expBonus = (this._lastMonsterAttackKills - 5) * 5; + } + this._lastMonsterAttackKills = 0; + break; + } + case 3: // Pulverized + { + if (this._lastEnvironmentDestroyMonsterKills > 3) + { + defeated = this._lastEnvironmentDestroyMonsterKills; + expBonus = (this._lastEnvironmentDestroyMonsterKills - 3) * 10; + } + this._lastEnvironmentDestroyMonsterKills = 0; + break; + } + default: + { + Logger.Warn("Invalid Exp-Bonus-Type was checked."); + return; + } + } + + if (expBonus > 0) + { + this._player.InGameClient.SendMessage(new KillCounterUpdateMessage() + { + Field0 = bonusType, + Field1 = defeated, + Field2 = expBonus, + Field3 = false, + }); + + this._player.UpdateExp(expBonus); + this._player.Conversations.StartConversation(0x0002A73F); + } + } + + public void MonsterAttacked(int monsterAttackTick) + { + this._lastMonsterAttackTick = monsterAttackTick; + } + } +} diff --git a/src/Mooege/Core/GS/Players/Inventory.cs b/src/Mooege/Core/GS/Players/Inventory.cs new file mode 100644 index 00000000..e65215dd --- /dev/null +++ b/src/Mooege/Core/GS/Players/Inventory.cs @@ -0,0 +1,865 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Data.SQLite; +using System.Linq; +using Mooege.Common.Logging; +using Mooege.Common.Storage.AccountDataBase.Entities; +using Mooege.Core.GS.Items; +using Mooege.Net.GS; +using Mooege.Net.GS.Message; +using Mooege.Net.GS.Message.Definitions.Inventory; +using Mooege.Net.GS.Message.Fields; +using Mooege.Net.GS.Message.Definitions.ACD; +using Mooege.Core.GS.Common; +using Mooege.Common.MPQ.FileFormats; +using Mooege.Common.Storage; +using Mooege.Net.GS.Message.Definitions.Stash; +using Mooege.Core.GS.Objects; +using Mooege.Core.MooNet.Toons; +using NHibernate.Linq; + +namespace Mooege.Core.GS.Players +{ + + public class Inventory : IMessageConsumer, IRevealable + { + + static readonly Logger Logger = LogManager.CreateLogger(); + + // Access by ID + private readonly Player _owner; // Used, because most information is not in the item class but Actors managed by the world + + //Values for buying new slots on stash + private readonly int[] _stashBuyValue = { 100000, 200000 }; // from Pacth 13, stash is limited to 3 tabs + + public bool Loaded { get; private set; } + private Equipment _equipment; + private InventoryGrid _inventoryGrid; + private InventoryGrid _stashGrid; + private Item _inventoryGold; + // backpack for spellRunes, their Items are kept in equipment + private uint[] _skillSocketRunes; + + + public Inventory(Player owner) + { + this._owner = owner; + this._equipment = new Equipment(owner); + this._inventoryGrid = new InventoryGrid(owner, owner.Attributes[GameAttribute.Backpack_Slots] / 10, 10); + this._stashGrid = new InventoryGrid(owner, owner.Attributes[GameAttribute.Shared_Stash_Slots] / 7, 7, (int)EquipmentSlotId.Stash); + this._skillSocketRunes = new uint[6]; + } + + private void AcceptMoveRequest(Item item) + { + /* _owner.InGameClient.SendMessage(new ACDInventoryPositionMessage() + { + ItemId = item.DynamicID, + InventoryLocation = item.InventoryLocationMessage, + Field2 = 1 // what does this do? // 0 - source item not disappearing from inventory, 1 - Moving, any other possibilities? its an int32 + }); */ + } + public List GetBackPackItems() + { + return new List(this._inventoryGrid.Items.Values); + } + + public List GetEquippedItems() + { + return this._equipment.Items.Values.ToList(); + } + + /// + /// Refreshes the visual appearance of the hero + /// + public void SendVisualInventory(Player player) + { + var message = new VisualInventoryMessage() + { + ActorID = this._owner.DynamicID, + EquipmentList = new VisualEquipment() + { + Equipment = this._equipment.GetVisualEquipment() + }, + }; + + //player.InGameClient.SendMessage(message); + player.World.BroadcastGlobal(message); + } + + public D3.Hero.VisualEquipment GetVisualEquipment() + { + return this._equipment.GetVisualEquipmentForToon(); + } + + public bool HasInventorySpace(Item item) + { + return _inventoryGrid.HasFreeSpace(item); + } + + public void SpawnItem(Item item) + { + _inventoryGrid.AddItem(item); + } + + /// + /// Picks an item up after client request + /// + /// true if the item was picked up, or false if the player could not pick up the item. + public bool PickUp(Item item) + { + System.Diagnostics.Debug.Assert(!_inventoryGrid.Contains(item) && !_equipment.IsItemEquipped(item), "Item already in inventory"); + // TODO: Autoequip when equipment slot is empty + + // If Item is Stackable try to add the amount + if (item.IsStackable()) + { + // Find items of same type (GBID) and try to add it to one of them + List baseItems = FindSameItems(item.GBHandle.GBID); + foreach (Item baseItem in baseItems) + { + if (baseItem.Attributes[GameAttribute.ItemStackQuantityLo] + item.Attributes[GameAttribute.ItemStackQuantityLo] < baseItem.ItemDefinition.MaxStackAmount) + { + baseItem.Attributes[GameAttribute.ItemStackQuantityLo] += item.Attributes[GameAttribute.ItemStackQuantityLo]; + baseItem.Attributes.SendChangedMessage(_owner.InGameClient); + + // Item amount successful added. Don't place item in inventory instead destroy it. + item.Destroy(); + return true; + } + } + } + + bool success = false; + if (!_inventoryGrid.HasFreeSpace(item)) + { + // Inventory full + _owner.InGameClient.SendMessage(new ACDPickupFailedMessage() + { + ItemID = item.DynamicID, + Reason = ACDPickupFailedMessage.Reasons.InventoryFull + }); + } + else + { + item.CurrentState = ItemState.PickingUp; + if (item.HasWorldLocation && item.World != null) + { + item.Owner = _owner; + item.World.Leave(item); + } + + _inventoryGrid.AddItem(item); + + if (_owner.GroundItems.ContainsKey(item.DynamicID)) + _owner.GroundItems.Remove(item.DynamicID); + success = true; + item.CurrentState = ItemState.Normal; + AcceptMoveRequest(item); + } + + return success; + } + + /// + /// Used for equiping item after game starts + /// TOOD: Needs rewrite + /// + /// + /// + public void EquipItem(Item item, int slot) + { + this._equipment.EquipItem(item, slot); + } + + private List FindSameItems(int gbid) + { + return _inventoryGrid.Items.Values.Where(i => i.GBHandle.GBID == gbid).ToList(); + } + + public void BuyItem(Item originalItem) + { + // TODO: Create a copy instead of random. + var newItem = ItemGenerator.CreateItem(_owner, originalItem.ItemDefinition); + _inventoryGrid.AddItem(newItem); + } + + /// + /// Handles a request to move an item within the inventory. + /// This covers moving items within the backpack, from equipment + /// slot to backpack and from backpack to equipment slot + /// + public void HandleInventoryRequestMoveMessage(InventoryRequestMoveMessage request) + { + // TODO Normal inventory movement does not require setting of inv loc msg! Just Tick. /fasbat + Item item = GetItem(request.ItemID); + if (item == null) + return; + // Request to equip item from backpack + if (request.Location.EquipmentSlot != 0 && request.Location.EquipmentSlot != (int)EquipmentSlotId.Stash) + { + var sourceGrid = (item.InvLoc.EquipmentSlot == 0 ? _inventoryGrid : + item.InvLoc.EquipmentSlot == (int)EquipmentSlotId.Stash ? _stashGrid : null); + + System.Diagnostics.Debug.Assert((sourceGrid != null && sourceGrid.Contains(request.ItemID)) || _equipment.IsItemEquipped(request.ItemID), "Request to equip unknown item"); + + int targetEquipSlot = request.Location.EquipmentSlot; + + if (IsValidEquipmentRequest(item, targetEquipSlot)) + { + Item oldEquipItem = _equipment.GetEquipment(targetEquipSlot); + + // check if equipment slot is empty + if (oldEquipItem == null) + { + // determine if item is in backpack or switching item from position with target originally empty + if (sourceGrid != null) + sourceGrid.RemoveItem(item); + else + _equipment.UnequipItem(item); + + _equipment.EquipItem(item, targetEquipSlot); + AcceptMoveRequest(item); + } + else + { + // check if item is already equipped at another equipmentslot + if (_equipment.IsItemEquipped(item)) + { + // switch both items + if (!IsValidEquipmentRequest(oldEquipItem, item.EquipmentSlot)) + return; + + int oldEquipmentSlot = _equipment.UnequipItem(item); + _equipment.EquipItem(item, targetEquipSlot); + _equipment.EquipItem(oldEquipItem, oldEquipmentSlot); + + } + else + { + // Get original location + int x = item.InventoryLocation.X; + int y = item.InventoryLocation.Y; + // equip item and place other item in the backpack + sourceGrid.RemoveItem(item); + _equipment.UnequipItem(oldEquipItem); + sourceGrid.AddItem(oldEquipItem, y, x); + _equipment.EquipItem(item, targetEquipSlot); + } + AcceptMoveRequest(item); + AcceptMoveRequest(oldEquipItem); + } + + SendVisualInventory(this._owner); + } + } + // Request to move an item (from backpack or equipmentslot) + else + { + if (request.Location.EquipmentSlot == 0) + { + // check if not unsocketting rune + for (int i = 0; i < _skillSocketRunes.Length; i++) + { + if (_skillSocketRunes[i] == request.ItemID) + { + if (_inventoryGrid.FreeSpace(item, request.Location.Row, request.Location.Column)) + { + RemoveRune(i); + _inventoryGrid.AddItem(item, request.Location.Row, request.Location.Column); + if (item.InvLoc.EquipmentSlot != request.Location.EquipmentSlot) + AcceptMoveRequest(item); + } + return; + } + } + } + + var destGrid = (request.Location.EquipmentSlot == 0 ? _inventoryGrid : _stashGrid); + + if (destGrid.FreeSpace(item, request.Location.Row, request.Location.Column)) + { + if (_equipment.IsItemEquipped(item)) + { + _equipment.UnequipItem(item); // Unequip the item + SendVisualInventory(this._owner); + } + else + { + var sourceGrid = (item.InvLoc.EquipmentSlot == 0 ? _inventoryGrid : _stashGrid); + sourceGrid.RemoveItem(item); + } + destGrid.AddItem(item, request.Location.Row, request.Location.Column); + if (item.InvLoc.EquipmentSlot != request.Location.EquipmentSlot) + AcceptMoveRequest(item); + } + } + } + + /// + /// Handles a request to move an item from stash the inventory and back + /// + public void HandleInventoryRequestQuickMoveMessage(InventoryRequestQuickMoveMessage request) + { + Item item = GetItem(request.ItemID); + if (item == null || (request.DestEquipmentSlot != (int)EquipmentSlotId.Stash && request.DestEquipmentSlot != (int)EquipmentSlotId.Inventory)) + return; + // Identify source and destination grids + var destinationGrid = request.DestEquipmentSlot == 0 ? _inventoryGrid : _stashGrid; + var sourceGrid = request.DestEquipmentSlot == 0 ? _stashGrid : _inventoryGrid; + + if (destinationGrid.HasFreeSpace(request.DestRowStart, request.DestRowEnd, item)) + { + sourceGrid.RemoveItem(item); + destinationGrid.AddItem(request.DestRowStart, request.DestRowEnd, item); + } + } + + /// + /// Checks if Item can be equipped at that slot. Handels equipment for Two-Handed-Weapons. + /// + /// + /// + /// + private bool IsValidEquipmentRequest(Item item, int equipmentSlot) + { + ItemTypeTable type = item.ItemType; + + if (equipmentSlot == (int)EquipmentSlotId.Main_Hand) + { + // useful for 1hand + shield switching, this is to avoid shield to be go to main hand + if (!Item.IsWeapon(type)) + return false; + + if (Item.Is2H(type)) + { + Item itemOffHand = _equipment.GetEquipment(EquipmentSlotId.Off_Hand); + if (itemOffHand != null) + { + _equipment.UnequipItem(itemOffHand); + if (!_inventoryGrid.AddItem(itemOffHand)) + { + // unequip failed, put back + _equipment.EquipItem(itemOffHand, (int)EquipmentSlotId.Off_Hand); + return false; + } + AcceptMoveRequest(itemOffHand); + } + } + } + else if (equipmentSlot == (int)EquipmentSlotId.Off_Hand) + { + Item itemMainHand = _equipment.GetEquipment(EquipmentSlotId.Main_Hand); + if (Item.Is2H(type)) + { + //remove object first to make room for possible unequiped item + _inventoryGrid.RemoveItem(item); + + if (itemMainHand != null) + { + _equipment.UnequipItem(itemMainHand); + _inventoryGrid.AddItem(itemMainHand); + AcceptMoveRequest(itemMainHand); + } + + _equipment.EquipItem(item, (int)EquipmentSlotId.Main_Hand); + AcceptMoveRequest(item); + + SendVisualInventory(this._owner); + // All equipment commands are executed. the original EquipmentRequest is invalid at this moment + return false; + } + + if (itemMainHand != null) + { + if (Item.Is2H(itemMainHand.ItemType)) + { + return false; + } + } + } + return true; + } + + /// + /// Transfers an amount from one stack to a free space + /// + public void OnInventorySplitStackMessage(InventorySplitStackMessage msg) + { + Item itemFrom = GetItem((uint)msg.FromID); + itemFrom.Attributes[GameAttribute.ItemStackQuantityLo] -= (int)msg.Amount; + itemFrom.Attributes.SendChangedMessage(_owner.InGameClient); + + Item item = ItemGenerator.CreateItem(_owner, itemFrom.ItemDefinition); + item.Attributes[GameAttribute.ItemStackQuantityLo] = (int)msg.Amount; + + InventoryGrid targetGrid = (msg.InvLoc.EquipmentSlot == (int)EquipmentSlotId.Stash) ? _stashGrid : _inventoryGrid; + targetGrid.AddItem(item, msg.InvLoc.Row, msg.InvLoc.Column); + } + + /// + /// Transfers an amount from one stack to another + /// + public void OnInventoryStackTransferMessage(InventoryStackTransferMessage msg) + { + Item itemFrom = GetItem(msg.FromID); + Item itemTo = GetItem(msg.ToID); + + itemFrom.Attributes[GameAttribute.ItemStackQuantityLo] -= (int)msg.Amount; + itemTo.Attributes[GameAttribute.ItemStackQuantityLo] += (int)msg.Amount; + + itemFrom.Attributes.SendChangedMessage(_owner.InGameClient); + itemTo.Attributes.SendChangedMessage(_owner.InGameClient); + } + private List _dbInventoriesToDelete = new List(); + private void OnInventoryDropItemMessage(InventoryDropItemMessage msg) + { + var item = GetItem(msg.ItemID); + if (item == null) + return; // TODO: Throw smthg? /fasbat + + if (_equipment.IsItemEquipped(item)) + { + _equipment.UnequipItem(item); + SendVisualInventory(this._owner); + } + else + { + var sourceGrid = (item.InvLoc.EquipmentSlot == 0 ? _inventoryGrid : _stashGrid); + sourceGrid.RemoveItem(item); + } + + item.CurrentState = ItemState.Dropping; + item.Unreveal(_owner); + item.SetNewWorld(_owner.World); + item.Drop(null, _owner.Position); + if (item.DBInventory != null) + _dbInventoriesToDelete.Add(item.DBInventory); + item.DBInventory = null; + item.CurrentState = ItemState.Normal; + AcceptMoveRequest(item); + } + + public void Consume(GameClient client, GameMessage message) + { + if (message is InventoryRequestMoveMessage) HandleInventoryRequestMoveMessage(message as InventoryRequestMoveMessage); + else if (message is InventoryRequestQuickMoveMessage) HandleInventoryRequestQuickMoveMessage(message as InventoryRequestQuickMoveMessage); + else if (message is InventorySplitStackMessage) OnInventorySplitStackMessage(message as InventorySplitStackMessage); + else if (message is InventoryStackTransferMessage) OnInventoryStackTransferMessage(message as InventoryStackTransferMessage); + else if (message is InventoryDropItemMessage) OnInventoryDropItemMessage(message as InventoryDropItemMessage); + else if (message is InventoryRequestUseMessage) OnInventoryRequestUseMessage(message as InventoryRequestUseMessage); + else if (message is RequestBuySharedStashSlotsMessage) OnBuySharedStashSlots(message as RequestBuySharedStashSlotsMessage); + else if (message is InventoryRequestUseMessage) OnInventoryRequestUseMessage(message as InventoryRequestUseMessage); + else if (message is InventoryIdentifyItemMessage) OnInventoryIdentifyItemMessage(message as InventoryIdentifyItemMessage); + + _owner.SetAttributesByItems(); + _owner.Attributes.BroadcastChangedIfRevealed(); + } + + private void OnInventoryIdentifyItemMessage(InventoryIdentifyItemMessage msg) + { + var item = GetItem(msg.ItemID); + if (item == null) + return; + + Logger.Warn("Identifying items not implemented yet"); + } + + private void OnBuySharedStashSlots(RequestBuySharedStashSlotsMessage requestBuySharedStashSlotsMessage) + { + int amount = 10000; + + if (_stashGrid.Rows % 10 == 0) + { + if (_stashGrid.Rows / 10 - 1 >= _stashBuyValue.Length) + return; + amount = _stashBuyValue[_stashGrid.Rows / 10 - 1]; + } + if (GetGoldAmount() >= amount) + { + RemoveGoldAmount(amount); + _owner.Attributes[GameAttribute.Shared_Stash_Slots] += 14; + _owner.Attributes.BroadcastChangedIfRevealed(); + _stashGrid.ResizeGrid(_owner.Attributes[GameAttribute.Shared_Stash_Slots] / 7, 7); + } + } + + // TODO: The inventory's gold item should not be created here. /komiga + public void PickUpGold(uint itemID) + { + Item collectedItem = _owner.World.GetItem(itemID); + AddGoldAmount(collectedItem.Attributes[GameAttribute.Gold]); + } + + private void OnInventoryRequestUseMessage(InventoryRequestUseMessage inventoryRequestUseMessage) + { + uint targetItemId = inventoryRequestUseMessage.UsedOnItem; + uint usedItemId = inventoryRequestUseMessage.UsedItem; + int actionId = inventoryRequestUseMessage.Field1; + Item usedItem = GetItem(usedItemId); + Item targetItem = GetItem(targetItemId); + + usedItem.OnRequestUse(_owner, targetItem, actionId, inventoryRequestUseMessage.Location); + } + + public void DestroyInventoryItem(Item item) + { + if (_equipment.IsItemEquipped(item)) + { + _equipment.UnequipItem(item); + SendVisualInventory(_owner); + } + else + { + _inventoryGrid.RemoveItem(item); + } + + item.Destroy(); + _destroyedItems.Add(item); + } + + private List _destroyedItems = new List(); + + public bool Reveal(Player player) + { + _equipment.Reveal(player); + if (player == _owner) + { + _inventoryGrid.Reveal(player); + _stashGrid.Reveal(player); + } + return true; + } + + public bool Unreveal(Player player) + { + _equipment.Unreveal(player); + if (player == _owner) + { + _inventoryGrid.Unreveal(player); + _stashGrid.Unreveal(player); + } + + return true; + } + + public Item GetItem(uint itemId) + { + Item result; + if (!_inventoryGrid.Items.TryGetValue(itemId, out result) && + !_stashGrid.Items.TryGetValue(itemId, out result) && + !_equipment.Items.TryGetValue(itemId, out result)) + { + return null; + } + return result; + } + + /// + /// Returns rune in skill's socket + /// + /// + /// + public Item GetRune(int skillIndex) + { + if ((skillIndex < 0) || (skillIndex > 5)) + { + return null; + } + if (_skillSocketRunes[skillIndex] == 0) + { + return null; + } + return _equipment.GetItem(_skillSocketRunes[skillIndex]); + } + + /// + /// Visually adds rune to skill (move from backpack to runes' slot) + /// + /// + /// + /// + public void SetRune(Item rune, int powerSNOId, int skillIndex) + { + if ((skillIndex < 0) || (skillIndex > 5)) + { + return; + } + if (rune == null) + { + _skillSocketRunes[skillIndex] = 0; + return; + } + if (_inventoryGrid.Items.ContainsKey(rune.DynamicID)) + { + _inventoryGrid.RemoveItem(rune); + } + else + { + // unattuned rune changes to attuned w/o getting into inventory + rune.World.Leave(rune); + rune.Reveal(_owner); + } + _equipment.Items.Add(rune.DynamicID, rune); + _skillSocketRunes[skillIndex] = rune.DynamicID; + // will set only one of these to rank + _owner.Attributes[GameAttribute.Rune_A, powerSNOId] = rune.Attributes[GameAttribute.Rune_A]; + _owner.Attributes[GameAttribute.Rune_B, powerSNOId] = rune.Attributes[GameAttribute.Rune_B]; + _owner.Attributes[GameAttribute.Rune_C, powerSNOId] = rune.Attributes[GameAttribute.Rune_C]; + _owner.Attributes[GameAttribute.Rune_D, powerSNOId] = rune.Attributes[GameAttribute.Rune_D]; + _owner.Attributes[GameAttribute.Rune_E, powerSNOId] = rune.Attributes[GameAttribute.Rune_E]; + // position of rune is read from mpq as INDEX of skill in skill kit - loaded in helper /xsochor + rune.SetInventoryLocation(15, RuneHelper.GetRuneIndexForPower(powerSNOId), 0); + } + + /// + /// Visually removes rune from skill. Also removes effect of that rune + /// + /// + /// + public Item RemoveRune(int skillIndex) + { + if ((skillIndex < 0) || (skillIndex > 5)) + { + return null; + } + Item rune = GetRune(skillIndex); + if (rune != null) + { + _equipment.Items.Remove(rune.DynamicID); + } + int powerSNOId = _owner.SkillSet.ActiveSkills[skillIndex].snoSkill; + _skillSocketRunes[skillIndex] = 0; + _owner.Attributes[GameAttribute.Rune_A, powerSNOId] = 0; + _owner.Attributes[GameAttribute.Rune_B, powerSNOId] = 0; + _owner.Attributes[GameAttribute.Rune_C, powerSNOId] = 0; + _owner.Attributes[GameAttribute.Rune_D, powerSNOId] = 0; + _owner.Attributes[GameAttribute.Rune_E, powerSNOId] = 0; + return rune; + } + + public void AddGoldAmount(int amount) + { + _inventoryGold.Attributes[GameAttribute.Gold] += amount; + _inventoryGold.Attributes[GameAttribute.ItemStackQuantityLo] = _inventoryGold.Attributes[GameAttribute.Gold]; + _inventoryGold.Attributes.SendChangedMessage(_owner.InGameClient); + } + + public void RemoveGoldAmount(int amount) + { + _inventoryGold.Attributes[GameAttribute.Gold] -= amount; + _inventoryGold.Attributes[GameAttribute.ItemStackQuantityLo] = _inventoryGold.Attributes[GameAttribute.Gold]; + _inventoryGold.Attributes.SendChangedMessage(_owner.InGameClient); + } + + public int GetGoldAmount() + { + return _inventoryGold.Attributes[GameAttribute.Gold]; + } + + private static IEnumerable _dbInventories = DBSessions.AccountSession.Query().Fetch(inv => inv.DBItemInstance); + + + public void LoadFromDB() + { + //load everything and make a switch on slot_id + Item item = null; + int goldAmount = _owner.Toon.GameAccount.DBGameAccount.Gold; + // Clear already present items + // LoadFromDB is called every time World is changed, even entering a dungeon + _stashGrid.Clear(); + _inventoryGrid.Clear(); + + + + // first of all load stash size + + var slots = this._owner.Toon.GameAccount.DBGameAccount.StashSize; + if (slots > 0) + { + _owner.Attributes[GameAttribute.Shared_Stash_Slots] = slots; + _owner.Attributes.BroadcastChangedIfRevealed(); + // To be applied before loading items, to have all the space needed + _stashGrid.ResizeGrid(_owner.Attributes[GameAttribute.Shared_Stash_Slots] / 7, 7); + } + + // next load all stash items + var stashInventoryItems = + _dbInventories.Where( + dbi => + dbi.DBGameAccount.Id == _owner.Toon.GameAccount.PersistentID && dbi.DBToon == null && + dbi.DBItemInstance != null).ToList(); + + foreach (var inv in stashInventoryItems) + { + var slot = inv.EquipmentSlot; + + if (slot == (int)EquipmentSlotId.Stash) + { + // load stash + item = ItemGenerator.LoadFromDBInstance(_owner, inv.DBItemInstance); + item.DBInventory = inv; + item.DBItemInstance = inv.DBItemInstance; + this._stashGrid.AddItem(item, inv.LocationY, inv.LocationX); + } + } + + // next read all items + var allInventoryItems = _dbInventories.Where( + dbi => + dbi.DBToon != null && dbi.DBToon.Id == _owner.Toon.PersistentID && dbi.DBItemInstance != null).ToList(); + + + foreach (var inv in allInventoryItems) + { + var slot = inv.EquipmentSlot; + if (slot >= (int)EquipmentSlotId.Inventory && slot <= (int)EquipmentSlotId.Neck) + { + item = ItemGenerator.LoadFromDBInstance(_owner, inv.DBItemInstance); + item.DBInventory = inv; + item.DBItemInstance = inv.DBItemInstance; + if (slot == (int)EquipmentSlotId.Inventory) + { + this._inventoryGrid.AddItem(item, inv.LocationY, inv.LocationX); + } + else + { + _equipment.EquipItem(item, (int)slot); + } + } + } + + + this._inventoryGold = ItemGenerator.CreateGold(this._owner, goldAmount); + this._inventoryGold.Attributes[GameAttribute.ItemStackQuantityLo] = goldAmount; // This is the attribute that makes the gold visible in game + this._inventoryGold.Owner = _owner; + this._inventoryGold.SetInventoryLocation((int)EquipmentSlotId.Gold, 0, 0); + this.Loaded = true; + } + + public void RefreshInventoryToClient() + { + var itemsToUpdate = new List(); + itemsToUpdate.AddRange(this._inventoryGrid.Items.Values); + itemsToUpdate.AddRange(this._stashGrid.Items.Values); + itemsToUpdate.Add(this._inventoryGold); + + foreach (var itm in itemsToUpdate) + { + if (itm.Owner is GS.Players.Player) + { + var player = (itm.Owner as GS.Players.Player); + if (!itm.Reveal(player)) + { + player.InGameClient.SendMessage(itm.ACDInventoryPositionMessage); + } + } + } + + } + + // TODO: change saving at the world OnLeave to saving at every inventory change, //~weltmeyer:done:without delete and insert + public void SaveToDB() + { + var dbToon = DBSessions.AccountSession.Get(this._owner.Toon.PersistentID); + var dbGameAccount = DBSessions.AccountSession.Get(this._owner.Toon.GameAccount.PersistentID); + + + foreach (var dbInventory in _dbInventoriesToDelete) + { + DBSessions.AccountSession.Delete(dbInventory); + } + + foreach (var inv in _destroyedItems.Where(inv => inv.DBInventory != null)) + { + DBSessions.AccountSession.Delete(inv.DBInventory); + } + DBSessions.AccountSession.Flush(); + + _destroyedItems.Clear(); + _dbInventoriesToDelete.Clear(); + // save equipment + for (int i = 1; i <= 13; i++) // from Helm = 1 to Neck = 13 in EquipmentSlotId + { + SaveItemToDB(dbGameAccount, dbToon, (EquipmentSlotId)i, _equipment.GetEquipment((EquipmentSlotId)i)); + } + + // save inventory + foreach (Item itm in _inventoryGrid.Items.Values) + { + SaveItemToDB(dbGameAccount, dbToon, EquipmentSlotId.Inventory, itm); + } + + // save stash + dbGameAccount.StashSize = _owner.Attributes[GameAttribute.Shared_Stash_Slots]; + foreach (Item itm in _stashGrid.Items.Values) + { + SaveItemToDB(dbGameAccount, null, EquipmentSlotId.Stash, itm); + } + + // save gold + dbGameAccount.Gold = GetGoldAmount(); + DBSessions.AccountSession.SaveOrUpdate(dbGameAccount); + DBSessions.AccountSession.Flush(); + } + + private void SaveItemToDB(DBGameAccount dbGameAccount, DBToon dbToon, EquipmentSlotId slotId, Item item) + { + if (item == null) + return; + if (item.DBInventory == null) + item.DBInventory = new DBInventory(); + + item.DBInventory.DBGameAccount = dbGameAccount; + item.DBInventory.DBToon = dbToon; + item.DBInventory.LocationX = item.InventoryLocation.X; + item.DBInventory.LocationY = item.InventoryLocation.Y; + item.DBInventory.EquipmentSlot = (int)slotId; + + ItemGenerator.SaveToDB(item); + item.DBInventory.DBItemInstance = item.DBItemInstance; + DBSessions.AccountSession.SaveOrUpdate(item.DBInventory); + } + + #region EqupimentStats + public float GetItemBonus(GameAttributeF attributeF) + { + return this.Loaded ? this.GetEquippedItems().Sum(item => item.Attributes[attributeF]) : 0.0f; + } + + public int GetItemBonus(GameAttributeI attributeI) + { + return this.Loaded ? this.GetEquippedItems().Sum(item => item.Attributes[attributeI]) : 0; + } + + public float GetItemBonus(GameAttributeF attributeF, int attributeKey) + { + return this.Loaded ? this.GetEquippedItems().Sum(item => item.Attributes[attributeF, attributeKey]) : 0.0f; + } + + public int GetItemBonus(GameAttributeI attributeI, int attributeKey) + { + return this.Loaded ? this.GetEquippedItems().Sum(item => item.Attributes[attributeI, attributeKey]) : 0; + } + + #endregion + } +} \ No newline at end of file diff --git a/src/Mooege/Core/GS/Players/Player.cs b/src/Mooege/Core/GS/Players/Player.cs new file mode 100644 index 00000000..d6f72111 --- /dev/null +++ b/src/Mooege/Core/GS/Players/Player.cs @@ -0,0 +1,1768 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.IO; +using System.Linq; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using Mooege.Common.Helpers.Math; +using Mooege.Common.Logging; +using Mooege.Common.MPQ; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Items; +using Mooege.Core.GS.Objects; +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Actors; +using Mooege.Core.GS.Powers; +using Mooege.Core.GS.Skills; +using Mooege.Core.MooNet.Toons; +using Mooege.Net.GS; +using Mooege.Net.GS.Message; +using Mooege.Net.GS.Message.Definitions.Misc; +using Mooege.Net.GS.Message.Definitions.Pet; +using Mooege.Net.GS.Message.Definitions.Waypoint; +using Mooege.Net.GS.Message.Definitions.World; +using Mooege.Net.GS.Message.Fields; +using Mooege.Net.GS.Message.Definitions.Hero; +using Mooege.Net.GS.Message.Definitions.Player; +using Mooege.Net.GS.Message.Definitions.Skill; +using Mooege.Net.GS.Message.Definitions.Effect; +using Mooege.Net.GS.Message.Definitions.Trade; +using Mooege.Core.GS.Actors.Implementations; +using Mooege.Net.GS.Message.Definitions.Artisan; +using Mooege.Core.GS.Actors.Implementations.Hirelings; +using Mooege.Net.GS.Message.Definitions.Hireling; +using Mooege.Common.Helpers; +using Mooege.Net.GS.Message.Definitions.ACD; +using Mooege.Net.GS.Message.Definitions.Animation; +using Mooege.Net.GS.Message.Definitions.Tutorial; + +namespace Mooege.Core.GS.Players +{ + public class Player : Actor, IMessageConsumer, IUpdateable + { + private static readonly Logger Logger = LogManager.CreateLogger(); + + /// + /// The ingame-client for player. + /// + public GameClient InGameClient { get; set; } + + /// + /// The player index. + /// + public int PlayerIndex { get; private set; } + + /// + /// The player's toon. + /// We need a better name /raist. + /// + public Toon Toon { get; private set; } + + /// + /// Skillset for the player (or actually for player's toons class). + /// + public SkillSet SkillSet { get; private set; } + + /// + /// The inventory of player's toon. + /// + public Inventory Inventory { get; private set; } + + /// + /// ActorType = Player. + /// + public override ActorType ActorType { get { return ActorType.Player; } } + + /// + /// Revealed objects to player. + /// + public Dictionary RevealedObjects = new Dictionary(); + + public ConversationManager Conversations { get; private set; } + + // Collection of items that only the player can see. This is only used when items drop from killing an actor + // TODO: Might want to just have a field on the item itself to indicate whether it is visible to only one player + /// + /// Dropped items for the player + /// + public Dictionary GroundItems { get; private set; } + + /// + /// Everything connected to ExpBonuses. + /// + public ExpBonusData ExpBonusData { get; private set; } + + /// + /// NPC currently interaced with + /// + public InteractiveNPC SelectedNPC { get; set; } + + private Hireling _activeHireling = null; + public Hireling ActiveHireling + { + get { return _activeHireling; } + set + { + if (value == _activeHireling) + return; + + if (_activeHireling != null) + { + _activeHireling.Dismiss(this); + } + + _activeHireling = value; + + if (value != null) + { + InGameClient.SendMessage(new PetMessage() + { + Field0 = 0, + Field1 = 0, + PetId = value.DynamicID, + Field3 = 0, + }); + } + } + } + + private Hireling _activeHirelingProxy = null; + public Hireling ActiveHirelingProxy + { + get { return _activeHirelingProxy; } + set + { + if (value == _activeHirelingProxy) + return; + + if (_activeHirelingProxy != null) + { + _activeHirelingProxy.Dismiss(this); + } + + _activeHirelingProxy = value; + + if (value != null) + { + InGameClient.SendMessage(new PetMessage() + { + Field0 = 0, + Field1 = 0, + PetId = value.DynamicID, + Field3 = 22, + }); + } + } + } + + // Resource generation timing /mdz + private int _lastResourceUpdateTick; + + // number of seconds to use for the cooldown that is started after changing a skill. + private const float SkillChangeCooldownLength = 5f; // TODO: this needs to vary based on difficulty + + #region Just a testing function, never called. Add this to the End of SetNonDefaultStats to get All Equipped items attributes written to a file. + private string TestOutputAttributes(GameAttributeMap map) + { + var resultStringBuilder = new StringBuilder(); + foreach (GameAttributeF ga in GameAttribute.Attributes.Where(ga => ga is GameAttributeF)) + { + var keys = map.AttributeKeys(ga); + if (keys.Length == 0 || (keys.Length == 1 && !keys[0].HasValue)) + { + var curVal = Convert.ToDouble(map[ga]); + if (curVal.CompareTo(Convert.ToDouble(ga.DefaultValue)) == 0) + continue; + resultStringBuilder.AppendFormat("{0}:\t{1}\r\n", ga.Name, curVal); + } + else + { + foreach (var key in keys) + { + var curVal = Convert.ToDouble(map[ga, key]); + if (curVal.CompareTo(Convert.ToDouble(ga.DefaultValue)) == 0) + continue; + resultStringBuilder.AppendFormat("{0}|{1}:\t{2}\r\n", ga.Name, key, curVal); + + } + } + } + + foreach (GameAttributeI ga in GameAttribute.Attributes.Where(ga => ga is GameAttributeI)) + { + var keys = map.AttributeKeys(ga); + if (keys.Length == 0 || (keys.Length == 1 && !keys[0].HasValue)) + { + var curVal = map[ga]; + if (curVal == ga.DefaultValue) + continue; + resultStringBuilder.AppendFormat("{0}:\t{1}\r\n", ga.Name, curVal); + } + else + { + foreach (var key in keys) + { + var curVal = map[ga]; + if (curVal == ga.DefaultValue) + continue; + resultStringBuilder.AppendFormat("{0}|{1}:\t{2}\r\n", ga.Name, key, curVal); + + } + } + } + return resultStringBuilder.ToString(); + } + + private void TestOutPutItemAttributes() + { + if (this.Inventory == null || !this.Inventory.Loaded) return; + const string filename = "c:/attrtest.txt"; + File.Delete(filename); + foreach (var item in this.Inventory.GetEquippedItems()) + { + File.AppendAllText(filename, string.Format("======{0}=========\r\n", item.EquipmentSlot)); + + File.AppendAllText(filename, TestOutputAttributes(item.Attributes)); + File.AppendAllText(filename, "===============\r\n\r\n"); + } + } + #endregion + + /// + /// Creates a new player. + /// + /// The initial world player joins in. + /// The gameclient for the player. + /// Toon of the player. + public Player(World world, GameClient client, Toon bnetToon) + : base(world, bnetToon.Gender == 0 ? bnetToon.HeroTable.SNOMaleActor : bnetToon.HeroTable.SNOFemaleActor) + { + this.InGameClient = client; + this.PlayerIndex = Interlocked.Increment(ref this.InGameClient.Game.PlayerIndexCounter); // get a new playerId for the player and make it atomic. + this.Toon = bnetToon; + this.GBHandle.Type = (int)GBHandleType.Player; + this.GBHandle.GBID = this.Toon.ClassID; + + this.Field2 = 0x00000009; + this.Scale = this.ModelScale; + this.RotationW = 0.05940768f; + this.RotationAxis = new Vector3D(0f, 0f, 0.9982339f); + this.Field7 = -1; + this.NameSNOId = -1; + this.Field10 = 0x0; + + this.SkillSet = new SkillSet(this.Toon.Class, this.Toon); + this.GroundItems = new Dictionary(); + this.Conversations = new ConversationManager(this, this.World.Game.Quests); + this.ExpBonusData = new ExpBonusData(this); + this.SelectedNPC = null; + + this._lastResourceUpdateTick = 0; + + // TODO SavePoint from DB + this.SavePointData = new SavePointData() { snoWorld = -1, SavepointId = -1 }; + + // Attributes + SetAllStatsInCorrectOrder(); + + //this only need to be set on Player load + this.Attributes[GameAttribute.Hitpoints_Cur] = this.Attributes[GameAttribute.Hitpoints_Max_Total]; + this.Attributes.BroadcastChangedIfRevealed(); + } + + #region Attribute Setters + public void SetAllStatsInCorrectOrder() + { + SetAttributesSkills(); + SetAttributesBuffs(); + SetAttributesDamage(); + SetAttributesRessources(); + SetAttributesClassSpecific(); + SetAttributesMovement(); + SetAttributesMisc(); + SetAttributesSkillSets(); + SetAttributesOther(); + if (this.Inventory == null) + this.Inventory = new Inventory(this); + SetAttributesByItems();//needs the Inventory + } + + public void SetAttributesSkills() + { + //Skills + this.Attributes[GameAttribute.SkillKit] = Toon.HeroTable.SNOSKillKit0; + //scripted //this.Attributes[GameAttribute.Skill_Total, 0x7545] = 1; //Axe Operate Gizmo + + this.Attributes[GameAttribute.Skill, 0x7545] = 1; + //scripted //this.Attributes[GameAttribute.Skill_Total, 0x76B7] = 1; //Punch! + this.Attributes[GameAttribute.Skill, 0x76B7] = 1; + //scripted //this.Attributes[GameAttribute.Skill_Total, 0x6DF] = 1; //Use Item + this.Attributes[GameAttribute.Skill, 0x6DF] = 1; + //scripted //this.Attributes[GameAttribute.Skill_Total, 0x7780] = 1; //Basic Attack + this.Attributes[GameAttribute.Skill, 0x7780] = 1; + //scripted //this.Attributes[GameAttribute.Skill_Total, 0x0002EC66] = 0; //stone of recall + //scripted //this.Attributes[GameAttribute.Skill_Total, 0xFFFFF] = 1; + this.Attributes[GameAttribute.Skill, 0xFFFFF] = 1; + } + public void SetAttributesBuffs() + { + //Buffs + this.Attributes[GameAttribute.Buff_Active, 0x33C40] = true; + this.Attributes[GameAttribute.Buff_Icon_End_Tick0, 0x00033C40] = 0x000003FB; + this.Attributes[GameAttribute.Buff_Icon_Start_Tick0, 0x00033C40] = 0x00000077; + this.Attributes[GameAttribute.Buff_Icon_Count0, 0x00033C40] = 1; + this.Attributes[GameAttribute.Buff_Active, 0xCE11] = true; + this.Attributes[GameAttribute.Buff_Icon_Count0, 0x0000CE11] = 1; + this.Attributes[GameAttribute.Buff_Visual_Effect, 0xFFFFF] = true; + } + public void SetAttributesDamage() + { + this.Attributes[GameAttribute.Primary_Damage_Attribute] = (int)Toon.HeroTable.CoreAttribute; + } + public void SetAttributesRessources() + { + //Resource + this.Attributes[GameAttribute.Resource_Max, (int)Toon.HeroTable.PrimaryResource] = Toon.HeroTable.PrimaryResourceMax; + this.Attributes[GameAttribute.Resource_Factor_Level, (int)Toon.HeroTable.PrimaryResource] = Toon.HeroTable.PrimaryResourceFactorLevel; + //scripted //this.Attributes[GameAttribute.Resource_Max_Total, (int)data.PrimaryResource] = GetMaxResource((int)data.PrimaryResource); + //scripted //this.Attributes[GameAttribute.Resource_Effective_Max, (int)data.PrimaryResource] = GetMaxResource((int)data.PrimaryResource); + this.Attributes[GameAttribute.Resource_Cur, (int)Toon.HeroTable.PrimaryResource] = GetMaxResource((int)Toon.HeroTable.PrimaryResource); + this.Attributes[GameAttribute.Resource_Regen_Per_Second, (int)Toon.HeroTable.PrimaryResource] = Toon.HeroTable.PrimaryResourceRegenPerSecond; + //scripted //this.Attributes[GameAttribute.Resource_Regen_Total, (int)data.PrimaryResource] = data.PrimaryResourceRegenPerSecond; + this.Attributes[GameAttribute.Resource_Type_Primary] = (int)Toon.HeroTable.PrimaryResource; + if (Toon.HeroTable.SecondaryResource != Mooege.Common.MPQ.FileFormats.HeroTable.Resource.None) + { + this.Attributes[GameAttribute.Resource_Type_Secondary] = (int)Toon.HeroTable.SecondaryResource; + this.Attributes[GameAttribute.Resource_Max, (int)Toon.HeroTable.SecondaryResource] = Toon.HeroTable.SecondaryResourceMax; + this.Attributes[GameAttribute.Resource_Factor_Level, (int)Toon.HeroTable.SecondaryResource] = Toon.HeroTable.SecondaryResourceFactorLevel; + this.Attributes[GameAttribute.Resource_Cur, (int)Toon.HeroTable.SecondaryResource] = GetMaxResource((int)Toon.HeroTable.SecondaryResource); + //scripted //this.Attributes[GameAttribute.Resource_Max_Total, (int)data.SecondaryResource] = GetMaxResource((int)data.SecondaryResource); + //scripted //this.Attributes[GameAttribute.Resource_Effective_Max, (int)data.SecondaryResource] = GetMaxResource((int)data.SecondaryResource); + this.Attributes[GameAttribute.Resource_Regen_Per_Second, (int)Toon.HeroTable.SecondaryResource] = Toon.HeroTable.SecondaryResourceRegenPerSecond; + //scripted //this.Attributes[GameAttribute.Resource_Regen_Total, (int)data.SecondaryResource] = data.SecondaryResourceRegenPerSecond; + this.Attributes[GameAttribute.Resource_Type_Secondary] = (int)Toon.HeroTable.SecondaryResource; + } + + //scripted //this.Attributes[GameAttribute.Get_Hit_Recovery] = 6f; + this.Attributes[GameAttribute.Get_Hit_Recovery_Per_Level] = Toon.HeroTable.GetHitRecoveryPerLevel; + this.Attributes[GameAttribute.Get_Hit_Recovery_Base] = Toon.HeroTable.GetHitRecoveryBase; + //scripted //this.Attributes[GameAttribute.Get_Hit_Max] = 60f; + this.Attributes[GameAttribute.Get_Hit_Max_Per_Level] = Toon.HeroTable.GetHitMaxPerLevel; + this.Attributes[GameAttribute.Get_Hit_Max_Base] = Toon.HeroTable.GetHitMaxBase; + } + public void SetAttributesResistance() + { + this.Attributes[GameAttribute.Resistance, 0xDE] = 0.5f; + this.Attributes[GameAttribute.Resistance, 0x226] = 0.5f; + } + public void SetAttributesClassSpecific() + { + // Class specific + switch (this.Toon.Class) + { + case ToonClass.Barbarian: + //scripted //this.Attributes[GameAttribute.Skill_Total, 30078] = 1; //Fury Trait + this.Attributes[GameAttribute.Skill, 30078] = 1; + this.Attributes[GameAttribute.Trait, 30078] = 1; + this.Attributes[GameAttribute.Buff_Active, 30078] = true; + this.Attributes[GameAttribute.Buff_Icon_Count0, 30078] = 1; + break; + case ToonClass.DemonHunter: + /* // unknown + this.Attributes[GameAttribute.Skill_Total, ] = 1; // Hatred Trait + this.Attributes[GameAttribute.Skill, ] = 1; + this.Attributes[GameAttribute.Trait, ] = 1; + this.Attributes[GameAttribute.Buff_Active, ] = true; + this.Attributes[GameAttribute.Buff_Icon_Count0, ] = 1; + this.Attributes[GameAttribute.Skill_Total, ] = 1; // Discipline Trait + this.Attributes[GameAttribute.Skill, ] = 1; + this.Attributes[GameAttribute.Trait, ] = 1; + this.Attributes[GameAttribute.Buff_Active, ] = true; + this.Attributes[GameAttribute.Buff_Icon_Count0, ] = 1; + */ + break; + case ToonClass.Monk: + //scripted //this.Attributes[GameAttribute.Skill_Total, 0x0000CE11] = 1; //Spirit Trait + this.Attributes[GameAttribute.Skill, 0x0000CE11] = 1; + this.Attributes[GameAttribute.Trait, 0x0000CE11] = 1; + this.Attributes[GameAttribute.Buff_Active, 0xCE11] = true; + this.Attributes[GameAttribute.Buff_Icon_Count0, 0x0000CE11] = 1; + break; + case ToonClass.WitchDoctor: + /* // unknown + this.Attributes[GameAttribute.Skill_Total, ] = 1; //Mana Trait + this.Attributes[GameAttribute.Skill, ] = 1; + this.Attributes[GameAttribute.Buff_Active, ] = true; + this.Attributes[GameAttribute.Buff_Icon_Count0, ] = 1; + */ + break; + case ToonClass.Wizard: + /* // unknown + this.Attributes[GameAttribute.Skill_Total, ] = 1; //Arcane Power Trait + this.Attributes[GameAttribute.Skill, ] = 1; + this.Attributes[GameAttribute.Trait, ] = 1; + this.Attributes[GameAttribute.Buff_Active, ] = true; + this.Attributes[GameAttribute.Buff_Icon_Count0, ] = 1; + */ + break; + } + } + public void SetAttributesMovement() + { + //Movement + //scripted //this.Attributes[GameAttribute.Movement_Scalar_Total] = 1f; + //scripted //this.Attributes[GameAttribute.Movement_Scalar_Capped_Total] = 1f; + //scripted //this.Attributes[GameAttribute.Movement_Scalar_Subtotal] = 1f; + this.Attributes[GameAttribute.Movement_Scalar] = 1f; + //scripted //this.Attributes[GameAttribute.Walking_Rate_Total] = data.WalkingRate; + this.Attributes[GameAttribute.Walking_Rate] = Toon.HeroTable.WalkingRate; + //scripted //this.Attributes[GameAttribute.Running_Rate_Total] = data.RunningRate; + this.Attributes[GameAttribute.Running_Rate] = Toon.HeroTable.RunningRate; + //scripted //this.Attributes[GameAttribute.Sprinting_Rate_Total] = data.F17; //These two are guesses -Egris + //scripted //this.Attributes[GameAttribute.Strafing_Rate_Total] = data.F18; + this.Attributes[GameAttribute.Sprinting_Rate] = Toon.HeroTable.F17; //These two are guesses -Egris + this.Attributes[GameAttribute.Strafing_Rate] = Toon.HeroTable.F18; + } + public void SetAttributesMisc() + { + //Miscellaneous + this.Attributes[GameAttribute.Disabled] = true; // we should be making use of these ones too /raist. + this.Attributes[GameAttribute.Loading] = true; + this.Attributes[GameAttribute.Invulnerable] = true; + this.Attributes[GameAttribute.Hidden] = false; + this.Attributes[GameAttribute.Immobolize] = true; + this.Attributes[GameAttribute.Untargetable] = true; + this.Attributes[GameAttribute.CantStartDisplayedPowers] = true; + this.Attributes[GameAttribute.IsContentRestrictedActor] = true; + this.Attributes[GameAttribute.Trait, 0x0000CE11] = 1; + this.Attributes[GameAttribute.TeamID] = 2; + this.Attributes[GameAttribute.Shared_Stash_Slots] = 14; + this.Attributes[GameAttribute.Backpack_Slots] = 60; + this.Attributes[GameAttribute.General_Cooldown] = 0; + } + public void SetAttributesByItems() + { + const float nonPhysDefault = 0f; //was 3.051758E-05f + var damageAttributeMinValues = new Dictionary + { + {DamageType.Physical, new[] {2f, 2f}}, + {DamageType.Arcane, new[] {nonPhysDefault, nonPhysDefault}}, + {DamageType.Cold, new[] {nonPhysDefault, nonPhysDefault}}, + {DamageType.Fire, new[] {nonPhysDefault, nonPhysDefault}}, + {DamageType.Holy, new[] {nonPhysDefault, nonPhysDefault}}, + {DamageType.Lightning, new[] {nonPhysDefault, nonPhysDefault}}, + {DamageType.Poison, new[] {nonPhysDefault, nonPhysDefault}} + }; + + foreach (var damageType in DamageType.AllTypes) + { + var weaponDamageMin = Math.Max(this.Inventory.GetItemBonus(GameAttribute.Damage_Weapon_Min, damageType.AttributeKey), damageAttributeMinValues[damageType][0]); + var weaponDamageDelta = Math.Max(this.Inventory.GetItemBonus(GameAttribute.Damage_Weapon_Delta, damageType.AttributeKey), damageAttributeMinValues[damageType][1]); + var weaponDamageBonusMin = this.Inventory.GetItemBonus(GameAttribute.Damage_Weapon_Bonus_Min, damageType.AttributeKey); + var weaponDamageBonusDelta = this.Inventory.GetItemBonus(GameAttribute.Damage_Weapon_Bonus_Delta, damageType.AttributeKey); + + this.Attributes[GameAttribute.Damage_Weapon_Min, damageType.AttributeKey] = weaponDamageMin; + this.Attributes[GameAttribute.Damage_Weapon_Delta, damageType.AttributeKey] = weaponDamageDelta; + this.Attributes[GameAttribute.Damage_Weapon_Bonus_Min, damageType.AttributeKey] = weaponDamageBonusMin; + this.Attributes[GameAttribute.Damage_Weapon_Bonus_Delta, damageType.AttributeKey] = weaponDamageBonusDelta; + + this.Attributes[GameAttribute.Resistance, damageType.AttributeKey] = this.Inventory.GetItemBonus(GameAttribute.Resistance, damageType.AttributeKey); + } + + + + + + this.Attributes[GameAttribute.Armor_Item_Percent] = this.Inventory.GetItemBonus(GameAttribute.Armor_Item_Percent); + this.Attributes[GameAttribute.Armor_Item] = this.Inventory.GetItemBonus(GameAttribute.Armor_Item); + this.Attributes[GameAttribute.Strength_Item] = this.Inventory.GetItemBonus(GameAttribute.Strength_Item); + this.Attributes[GameAttribute.Dexterity_Item] = this.Inventory.GetItemBonus(GameAttribute.Dexterity_Item); + this.Attributes[GameAttribute.Intelligence_Item] = this.Inventory.GetItemBonus(GameAttribute.Intelligence_Item); + + + + + this.Attributes[GameAttribute.Hitpoints_Max_Percent_Bonus_Item] = this.Inventory.GetItemBonus(GameAttribute.Hitpoints_Max_Percent_Bonus_Item); + this.Attributes[GameAttribute.Hitpoints_Max_Bonus] = this.Inventory.GetItemBonus(GameAttribute.Hitpoints_Max_Bonus); + + this.Attributes[GameAttribute.Attacks_Per_Second_Item] = this.Inventory.GetItemBonus(GameAttribute.Attacks_Per_Second_Item); + + + this.Attributes[GameAttribute.Resistance_Freeze] = this.Inventory.GetItemBonus(GameAttribute.Resistance_Freeze); + this.Attributes[GameAttribute.Resistance_Penetration] = this.Inventory.GetItemBonus(GameAttribute.Resistance_Penetration); + this.Attributes[GameAttribute.Resistance_Percent] = this.Inventory.GetItemBonus(GameAttribute.Resistance_Percent); + this.Attributes[GameAttribute.Resistance_Root] = this.Inventory.GetItemBonus(GameAttribute.Resistance_Root); + this.Attributes[GameAttribute.Resistance_Stun] = this.Inventory.GetItemBonus(GameAttribute.Resistance_Stun); + this.Attributes[GameAttribute.Resistance_StunRootFreeze] = this.Inventory.GetItemBonus(GameAttribute.Resistance_StunRootFreeze); + + this.Attributes[GameAttribute.Hitpoints_Regen_Per_Second] = this.Inventory.GetItemBonus(GameAttribute.Hitpoints_Regen_Per_Second); //this.Toon.HeroTable.GetHitRecoveryBase +(this.Toon.HeroTable.GetHitRecoveryPerLevel *this.Toon.Level); + + } + public void SetAttributesSkillSets() + { + // unlocking assigned skills + for (int i = 0; i < this.SkillSet.ActiveSkills.Length; i++) + { + if (this.SkillSet.ActiveSkills[i].snoSkill != -1) + { + this.Attributes[GameAttribute.Skill, this.SkillSet.ActiveSkills[i].snoSkill] = 1; + //scripted //this.Attributes[GameAttribute.Skill_Total, this.SkillSet.ActiveSkills[i].snoSkill] = 1; + // update rune attributes for new skill + this.Attributes[GameAttribute.Rune_A, this.SkillSet.ActiveSkills[i].snoSkill] = this.SkillSet.ActiveSkills[i].snoRune == 0 ? 1 : 0; + this.Attributes[GameAttribute.Rune_B, this.SkillSet.ActiveSkills[i].snoSkill] = this.SkillSet.ActiveSkills[i].snoRune == 1 ? 1 : 0; + this.Attributes[GameAttribute.Rune_C, this.SkillSet.ActiveSkills[i].snoSkill] = this.SkillSet.ActiveSkills[i].snoRune == 2 ? 1 : 0; + this.Attributes[GameAttribute.Rune_D, this.SkillSet.ActiveSkills[i].snoSkill] = this.SkillSet.ActiveSkills[i].snoRune == 3 ? 1 : 0; + this.Attributes[GameAttribute.Rune_E, this.SkillSet.ActiveSkills[i].snoSkill] = this.SkillSet.ActiveSkills[i].snoRune == 4 ? 1 : 0; + } + } + for (int i = 0; i < this.SkillSet.PassiveSkills.Length; ++i) + { + if (this.SkillSet.PassiveSkills[i] != -1) + { + // switch on passive skill + this.Attributes[GameAttribute.Trait, this.SkillSet.PassiveSkills[i]] = 1; + this.Attributes[GameAttribute.Skill, this.SkillSet.PassiveSkills[i]] = 1; + //scripted //this.Attributes[GameAttribute.Skill_Total, this.SkillSet.PassiveSkills[i]] = 1; + } + } + } + public void SetAttributesOther() + { + + + + //Bonus stats + this.Attributes[GameAttribute.Hit_Chance] = 1f; + + this.Attributes[GameAttribute.Attacks_Per_Second] = 1.2f; + //this.Attributes[GameAttribute.Attacks_Per_Second_Item] = 1.199219f; + this.Attributes[GameAttribute.Crit_Percent_Cap] = Toon.HeroTable.CritPercentCap; + //scripted //this.Attributes[GameAttribute.Casting_Speed_Total] = 1f; + this.Attributes[GameAttribute.Casting_Speed] = 1f; + + //Basic stats + this.Attributes[GameAttribute.Level_Cap] = 60; + this.Attributes[GameAttribute.Level] = this.Toon.Level; + this.Attributes[GameAttribute.Experience_Next] = this.Toon.ExperienceNext; + this.Attributes[GameAttribute.Experience_Granted] = 1000; + this.Attributes[GameAttribute.Armor] = 0; + //scripted //this.Attributes[GameAttribute.Armor_Total] + + + this.Attributes[GameAttribute.Strength] = this.Strength; + this.Attributes[GameAttribute.Dexterity] = this.Dexterity; + this.Attributes[GameAttribute.Vitality] = this.Vitality; + this.Attributes[GameAttribute.Intelligence] = this.Intelligence; + + //Hitpoints have to be calculated after Vitality + this.Attributes[GameAttribute.Hitpoints_Factor_Level] = Toon.HeroTable.HitpointsFactorLevel; + this.Attributes[GameAttribute.Hitpoints_Factor_Vitality] = 10f; + this.Attributes[GameAttribute.Hitpoints_Max] = 40f; + + //TestOutPutItemAttributes(); //Activate this only for finding item stats. + this.Attributes.BroadcastChangedIfRevealed(); + + } + + + public void AllTheScriptedStats() + { + //scripted //this.Attributes[GameAttribute.Damage_Delta_Total, 0] = 1f; + //scripted //this.Attributes[GameAttribute.Damage_Delta_Total, 1] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Damage_Delta_Total, 2] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Damage_Delta_Total, 3] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Damage_Delta_Total, 4] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Damage_Delta_Total, 5] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Damage_Delta_Total, 6] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Damage_Min_Total, 0] = 2f; + //scripted //this.Attributes[GameAttribute.Damage_Min_Total, 1] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Damage_Min_Total, 2] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Damage_Min_Total, 3] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Damage_Min_Total, 4] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Damage_Min_Total, 5] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Damage_Min_Total, 6] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Damage_Min_Total, 0xFFFFF] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Damage_Min_Subtotal, 0] = 2f; + //scripted //this.Attributes[GameAttribute.Damage_Min_Subtotal, 1] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Damage_Min_Subtotal, 2] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Damage_Min_Subtotal, 3] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Damage_Min_Subtotal, 4] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Damage_Min_Subtotal, 5] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Damage_Min_Subtotal, 6] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Damage_Min_Subtotal, 0xFFFFF] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Min_Total_CurrentHand, 0] = 2f; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Min_Total_CurrentHand, 1] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Min_Total_CurrentHand, 2] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Min_Total_CurrentHand, 3] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Min_Total_CurrentHand, 4] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Min_Total_CurrentHand, 5] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Min_Total_CurrentHand, 6] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Min_Total, 0] = 2f; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Min_Total_All] = 2f; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Min_Total_MainHand, 0] = 2f; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Min_Total_CurrentHand, 0xFFFFF] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Delta_SubTotal, 0] = 1f; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Delta_Total_CurrentHand, 0] = 1f; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Delta_Total_CurrentHand, 1] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Delta_Total_CurrentHand, 2] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Delta_Total_CurrentHand, 3] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Delta_Total_CurrentHand, 4] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Delta_Total_CurrentHand, 5] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Delta_Total_CurrentHand, 6] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0] = 1f; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Delta_Total_All] = 1f; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Delta_Total_MainHand, 0] = 1f; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Max, 0] = 3f; + //scripted //this.Attributes[GameAttribute.Damage_Weapon_Max_Total, 0] = 3f; + + //scripted //this.Attributes[GameAttribute.Attacks_Per_Second_Item_CurrentHand] = 1.199219f; + //scripted //this.Attributes[GameAttribute.Attacks_Per_Second_Item_Total_MainHand] = 1.199219f; + //scripted //this.Attributes[GameAttribute.Attacks_Per_Second_Total] = 1.199219f; + + //scripted //this.Attributes[GameAttribute.Attacks_Per_Second_Item_MainHand] = 1.199219f; + //scripted //this.Attributes[GameAttribute.Attacks_Per_Second_Item_Total] = 1.199219f; + //scripted //this.Attributes[GameAttribute.Attacks_Per_Second_Item_Subtotal] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Attacks_Per_Second_Item] = 3.051758E-05f; + + //scripted //this.Attributes[GameAttribute.Strength_Total] = this.StrengthTotal; + //scripted //this.Attributes[GameAttribute.Intelligence_Total] = this.IntelligenceTotal; + //scripted //this.Attributes[GameAttribute.Dexterity_Total] = this.DexterityTotal; + //scripted //this.Attributes[GameAttribute.Vitality_Total] = this.VitalityTotal; + + //scripted //this.Attributes[GameAttribute.Hitpoints_Total_From_Level] = 3.051758E-05f; + //scripted //this.Attributes[GameAttribute.Hitpoints_Total_From_Level] = 40f; // For now, this just adds 40 hitpoints to the hitpoints gained from vitality + //scripted //this.Attributes[GameAttribute.Hitpoints_Total_From_Vitality] = this.Attributes[GameAttribute.Vitality] * this.Attributes[GameAttribute.Hitpoints_Factor_Vitality]; + //this.Attributes[GameAttribute.Hitpoints_Max] = this.Attributes[GameAttribute.Hitpoints_Total_From_Level] + this.Attributes[GameAttribute.Hitpoints_Total_From_Vitality]; + + //scripted //this.Attributes[GameAttribute.Hitpoints_Max_Total] = GetMaxTotalHitpoints(); + + //Resistance + //scripted //this.Attributes[GameAttribute.Resistance_From_Intelligence] = this.Attributes[GameAttribute.Intelligence] * 0.1f; + //scripted //this.Attributes[GameAttribute.Resistance_Total, 0] = this.Attributes[GameAttribute.Resistance_From_Intelligence]; // im pretty sure key = 0 doesnt do anything since the lookup is (attributeId | (key << 12)), maybe this is some base resistance? /cm + // likely the physical school of damage, it probably doesn't actually do anything in this case (or maybe just not for the player's hero) + // but exists for the sake of parity with weapon damage schools + //scripted //this.Attributes[GameAttribute.Resistance_Total, 1] = this.Attributes[GameAttribute.Resistance_From_Intelligence]; //Fire + //scripted //this.Attributes[GameAttribute.Resistance_Total, 2] = this.Attributes[GameAttribute.Resistance_From_Intelligence]; //Lightning + //scripted //this.Attributes[GameAttribute.Resistance_Total, 3] = this.Attributes[GameAttribute.Resistance_From_Intelligence]; //Cold + //scripted //this.Attributes[GameAttribute.Resistance_Total, 4] = this.Attributes[GameAttribute.Resistance_From_Intelligence]; //Poison + //scripted //this.Attributes[GameAttribute.Resistance_Total, 5] = this.Attributes[GameAttribute.Resistance_From_Intelligence]; //Arcane + //scripted //this.Attributes[GameAttribute.Resistance_Total, 6] = this.Attributes[GameAttribute.Resistance_From_Intelligence]; //Holy + + //scripted //this.Attributes[GameAttribute.Resistance_Total, 0xDE] = 0.5f; + //scripted //this.Attributes[GameAttribute.Resistance_Total, 0x226] = 0.5f; + + + } + + + #endregion + + #region game-message handling & consumers + + /// + /// Consumes the given game-message. + /// + /// The client. + /// The GameMessage. + public void Consume(GameClient client, GameMessage message) + { + if (message is AssignActiveSkillMessage) OnAssignActiveSkill(client, (AssignActiveSkillMessage)message); + else if (message is AssignTraitsMessage) OnAssignPassiveSkills(client, (AssignTraitsMessage)message); + //else if (message is PlayerChangeHotbarButtonMessage) OnPlayerChangeHotbarButtonMessage(client, (PlayerChangeHotbarButtonMessage)message); + else if (message is TargetMessage) OnObjectTargeted(client, (TargetMessage)message); + else if (message is ACDClientTranslateMessage) OnPlayerMovement(client, (ACDClientTranslateMessage)message); + else if (message is TryWaypointMessage) OnTryWaypoint(client, (TryWaypointMessage)message); + else if (message is RequestBuyItemMessage) OnRequestBuyItem(client, (RequestBuyItemMessage)message); + //else if (message is RequestAddSocketMessage) OnRequestAddSocket(client, (RequestAddSocketMessage)message); + else if (message is HirelingDismissMessage) OnHirelingDismiss(); + //else if (message is SocketSpellMessage) OnSocketSpell(client, (SocketSpellMessage)message); + else if (message is PlayerTranslateFacingMessage) OnTranslateFacing(client, (PlayerTranslateFacingMessage)message); + else if (message is SecondaryAnimationPowerMessage) OnSecondaryPowerMessage(client, (SecondaryAnimationPowerMessage)message); + else if (message is RequestBuffCancelMessage) OnRequestBuffCancel(client, (RequestBuffCancelMessage)message); + else if (message is CancelChanneledSkillMessage) OnCancelChanneledSkill(client, (CancelChanneledSkillMessage)message); + else if (message is TutorialShownMessage) OnTutorialShown(client, (TutorialShownMessage)message); + else return; + } + + private void OnTutorialShown(GameClient client, TutorialShownMessage message) + { + // Server has to save what tutorials are shown, so the player + // does not have to see them over and over... + for (int i = 0; i < this.SeenTutorials.Length; i++) + { + if (this.SeenTutorials[i] == -1) + { + this.SeenTutorials[i] = message.SNOTutorial; + break; + } + } + } + + private void OnTranslateFacing(GameClient client, PlayerTranslateFacingMessage message) + { + this.SetFacingRotation(message.Angle); + + World.BroadcastExclusive(new ACDTranslateFacingMessage + { + ActorId = this.DynamicID, + Angle = message.Angle, + TurnImmediately = message.TurnImmediately + }, this); + } + + private void OnAssignActiveSkill(GameClient client, AssignActiveSkillMessage message) + { + var oldSNOSkill = this.SkillSet.ActiveSkills[message.SkillIndex].snoSkill; // find replaced skills SNO. + if (oldSNOSkill != -1) + { + //// if old power was socketted, pickup rune + //Item oldRune = this.Inventory.RemoveRune(message.SkillIndex); + //if (oldRune != null) + //{ + // if (!this.Inventory.PickUp(oldRune)) + // { + // // full inventory, cancel socketting + // this.Inventory.SetRune(oldRune, oldSNOSkill, message.SkillIndex); // readd old rune + // return; + // } + //} + this.Attributes[GameAttribute.Skill, oldSNOSkill] = 0; + //scripted //this.Attributes[GameAttribute.Skill_Total, oldSNOSkill] = 0; + } + + this.Attributes[GameAttribute.Skill, message.SNOSkill] = 1; + //scripted //this.Attributes[GameAttribute.Skill_Total, message.SNOSkill] = 1; + this.SkillSet.ActiveSkills[message.SkillIndex].snoSkill = message.SNOSkill; + this.SkillSet.ActiveSkills[message.SkillIndex].snoRune = message.RuneIndex; + this.SkillSet.SwitchUpdateSkills(oldSNOSkill, message.SNOSkill, message.RuneIndex, this.Toon); + this.SetAttributesSkillSets(); + + this.Attributes.BroadcastChangedIfRevealed(); + this.UpdateHeroState(); + + if (oldSNOSkill != -1) // don't do cooldown when first skill put in slot + _StartSkillCooldown(message.SNOSkill, SkillChangeCooldownLength); + } + + private void OnAssignPassiveSkills(GameClient client, AssignTraitsMessage message) + { + for (int i = 0; i < message.SNOPowers.Length; ++i) + { + int oldSNOSkill = this.SkillSet.PassiveSkills[i]; // find replaced skills SNO. + if (message.SNOPowers[i] != oldSNOSkill) + { + if (oldSNOSkill != -1) + { + // switch off old passive skill + this.Attributes[GameAttribute.Trait, oldSNOSkill] = 0; + this.Attributes[GameAttribute.Skill, oldSNOSkill] = 0; + //scripted //this.Attributes[GameAttribute.Skill_Total, oldSNOSkill] = 0; + } + + if (message.SNOPowers[i] != -1) + { + // switch on new passive skill + this.Attributes[GameAttribute.Trait, message.SNOPowers[i]] = 1; + this.Attributes[GameAttribute.Skill, message.SNOPowers[i]] = 1; + //scripted //this.Attributes[GameAttribute.Skill_Total, message.SNOPowers[i]] = 1; + } + + this.SkillSet.PassiveSkills[i] = message.SNOPowers[i]; + + if (oldSNOSkill != -1) // don't do cooldown when first skill put in slot + _StartSkillCooldown(message.SNOPowers[i], SkillChangeCooldownLength); + } + } + + this.SkillSet.UpdatePassiveSkills(this.Toon); + this.Attributes.BroadcastChangedIfRevealed(); + this.UpdateHeroState(); + } + + private void _StartSkillCooldown(int snoPower, float seconds) + { + this.World.BuffManager.AddBuff(this, this, + new Powers.Implementations.CooldownBuff(snoPower, seconds)); + } + + //private void OnPlayerChangeHotbarButtonMessage(GameClient client, PlayerChangeHotbarButtonMessage message) + //{ + // this.SkillSet.HotBarSkills[message.BarIndex] = message.ButtonData; + //} + + /// + /// Sockets skill with rune. + /// + /// + /// + //private void OnSocketSpell(GameClient client, SocketSpellMessage socketSpellMessage) + //{ + // Item rune = this.Inventory.GetItem(unchecked((uint)socketSpellMessage.RuneDynamicId)); + // int PowerSNOId = socketSpellMessage.PowerSNOId; + // int skillIndex = -1; // find index of power in skills + // for (int i = 0; i < this.SkillSet.ActiveSkills.Length; i++) + // { + // if (this.SkillSet.ActiveSkills[i] == PowerSNOId) + // { + // skillIndex = i; + // break; + // } + // } + // if (skillIndex == -1) + // { + // // validity of message is controlled on client side, this shouldn't happen + // return; + // } + // Item oldRune = this.Inventory.RemoveRune(skillIndex); // removes old rune (if present) + // if (rune.Attributes[GameAttribute.Rune_Rank] != 0) + // { + // // unattuned rune: pick random color, create new rune, set attunement to new rune and destroy unattuned one + // int rank = rune.Attributes[GameAttribute.Rune_Rank]; + // int colorIndex = RandomHelper.Next(0, 5); + // Item newRune = ItemGenerator.Cook(this, "Runestone_" + (char)('A' + colorIndex) + "_0" + rank); // TODO: quite of hack, find better solution /xsochor + // newRune.Attributes[GameAttribute.Rune_Attuned_Power] = PowerSNOId; + // switch (colorIndex) + // { + // case 0: + // newRune.Attributes[GameAttribute.Rune_A] = rank; + // break; + // case 1: + // newRune.Attributes[GameAttribute.Rune_B] = rank; + // break; + // case 2: + // newRune.Attributes[GameAttribute.Rune_C] = rank; + // break; + // case 3: + // newRune.Attributes[GameAttribute.Rune_D] = rank; + // break; + // case 4: + // newRune.Attributes[GameAttribute.Rune_E] = rank; + // break; + // } + // newRune.Owner = this; + // newRune.InventoryLocation.X = rune.InventoryLocation.X; // sets position of original + // newRune.InventoryLocation.Y = rune.InventoryLocation.Y; // sets position of original + // this.Inventory.DestroyInventoryItem(rune); // destroy unattuned rune + // newRune.EnterWorld(this.Position); + // newRune.Reveal(this); + // this.Inventory.SetRune(newRune, PowerSNOId, skillIndex); + // } + // else + // { + // this.Inventory.SetRune(rune, PowerSNOId, skillIndex); + // } + // if (oldRune != null) + // { + // this.Inventory.PickUp(oldRune); // pick removed rune + // } + // this.Attributes.BroadcastChangedIfRevealed(); + // UpdateHeroState(); + //} + + private void OnObjectTargeted(GameClient client, TargetMessage message) + { + bool powerHandled = this.World.PowerManager.RunPower(this, message.PowerSNO, message.TargetID, message.Field2.Position, message); + + if (!powerHandled) + { + Actor actor = this.World.GetActorByDynamicId(message.TargetID); + if (actor == null) return; + + if ((actor.GBHandle.Type == 1) && (actor.Attributes[GameAttribute.TeamID] == 10)) + { + this.ExpBonusData.MonsterAttacked(this.InGameClient.Game.TickCounter); + } + + actor.OnTargeted(this, message); + } + + this.ExpBonusData.Check(2); + } + + private void OnPlayerMovement(GameClient client, ACDClientTranslateMessage message) + { + // here we should also be checking the position and see if it's valid. If not we should be resetting player to a good position with ACDWorldPositionMessage + // so we can have a basic precaution for hacks & exploits /raist. + if (message.Position != null) + this.Position = message.Position; + + this.SetFacingRotation(message.Angle); + + var msg = new ACDTranslateNormalMessage + { + ActorId = (int)this.DynamicID, + Position = this.Position, + Angle = message.Angle, + TurnImmediately = false, + Speed = message.Speed, + AnimationTag = message.AnimationTag + }; + + this.RevealScenesToPlayer(); + this.RevealActorsToPlayer(); + + this.World.BroadcastExclusive(msg, this); // TODO: We should be instead notifying currentscene we're in. /raist. + + foreach (var actor in GetActorsInRange()) + actor.OnPlayerApproaching(this); + + this.CollectGold(); + this.CollectHealthGlobe(); + } + + private void OnCancelChanneledSkill(GameClient client, CancelChanneledSkillMessage message) + { + this.World.PowerManager.CancelChanneledSkill(this, message.PowerSNO); + } + + private void OnRequestBuffCancel(GameClient client, RequestBuffCancelMessage message) + { + this.World.BuffManager.RemoveBuffs(this, message.PowerSNOId); + } + + private void OnSecondaryPowerMessage(GameClient client, SecondaryAnimationPowerMessage message) + { + this.World.PowerManager.RunPower(this, message.PowerSNO); + } + + private void OnTryWaypoint(GameClient client, TryWaypointMessage tryWaypointMessage) + { + var wayPoint = this.World.GetWayPointById(tryWaypointMessage.Field1); + if (wayPoint == null) return; + + this.Teleport(wayPoint.Position); + } + + private void OnRequestBuyItem(GameClient client, RequestBuyItemMessage requestBuyItemMessage) + { + var vendor = this.SelectedNPC as Vendor; + if (vendor == null) + return; + vendor.OnRequestBuyItem(this, requestBuyItemMessage.ItemId); + } + + //private void OnRequestAddSocket(GameClient client, RequestAddSocketMessage requestAddSocketMessage) + //{ + // var item = World.GetItem(requestAddSocketMessage.ItemID); + // if (item == null || item.Owner != this) + // return; + // var jeweler = World.GetActorInstance(); + // if (jeweler == null) + // return; + + // jeweler.OnAddSocket(this, item); + //} + + private void OnHirelingDismiss() + { + ActiveHireling = null; + } + + #endregion + + #region update-logic + + public void Update(int tickCounter) + { + // Check the Killstreaks + this.ExpBonusData.Check(0); + this.ExpBonusData.Check(1); + + // Check if there is an conversation to close in this tick + Conversations.Update(this.World.Game.TickCounter); + + _UpdateResources(); + } + + #endregion + + #region enter, leave, reveal handling + + /// + /// Revals scenes in player's proximity. + /// + public void RevealScenesToPlayer() + { + var scenes = this.GetScenesInRegion(DefaultQueryProximityLenght * 2); + + foreach (var scene in scenes) // reveal scenes in player's proximity. + { + if (scene.IsRevealedToPlayer(this)) // if the actors is already revealed skip it. + continue; // if the scene is already revealed, skip it. + + if (scene.Parent != null) // if it's a subscene, always make sure it's parent get reveals first and then it reveals his childs. + scene.Parent.Reveal(this); + else + scene.Reveal(this); + } + } + + /// + /// Reveals actors in player's proximity. + /// + public void RevealActorsToPlayer() + { + var actors = this.GetActorsInRange(); + + foreach (var actor in actors) // reveal actors in player's proximity. + { + if (actor.Visible == false || actor.IsRevealedToPlayer(this)) // if the actors is already revealed, skip it. + continue; + + if (actor.ActorType == ActorType.Gizmo || actor.ActorType == ActorType.Player + || actor.ActorType == ActorType.Monster || actor.ActorType == ActorType.Enviroment + || actor.ActorType == ActorType.Critter || actor.ActorType == ActorType.Item || actor.ActorType == ActorType.ServerProp) + actor.Reveal(this); + } + } + + public override void OnEnter(World world) + { + this.World.Reveal(this); + + this.RevealScenesToPlayer(); // reveal scenes in players proximity. + this.RevealActorsToPlayer(); // reveal actors in players proximity. + + // load all inventory items + if (!this.Inventory.Loaded)//why reload if already loaded? + this.Inventory.LoadFromDB(); + else + this.Inventory.RefreshInventoryToClient(); + + // generate visual update message + this.Inventory.SendVisualInventory(this); + + SetAllStatsInCorrectOrder(); + } + + public override void OnTeleport() + { + this.RevealScenesToPlayer(); // reveal scenes in players proximity. + this.RevealActorsToPlayer(); // reveal actors in players proximity. + } + + public override void OnLeave(World world) + { + this.Conversations.StopAll(); + + // save visual equipment + this.Toon.HeroVisualEquipmentField.Value = this.Inventory.GetVisualEquipment(); + this.Toon.HeroLevelField.Value = this.Attributes[GameAttribute.Level]; + this.Toon.GameAccount.ChangedFields.SetPresenceFieldValue(this.Toon.HeroVisualEquipmentField); + this.Toon.GameAccount.ChangedFields.SetPresenceFieldValue(this.Toon.HeroLevelField); + + // save all inventory items + this.Inventory.SaveToDB(); + world.CleanupItemInstances(); + } + + public override bool Reveal(Player player) + { + if (!base.Reveal(player)) + return false; + + if (this == player) // only send this when player's own actor being is revealed. /raist. + { + player.InGameClient.SendMessage(new PlayerWarpedMessage() + { + Field0 = 9, + Field1 = 0f, + }); + } + + player.InGameClient.SendMessage(new PlayerEnterKnownMessage() + { + PlayerIndex = this.PlayerIndex, + ActorId = this.DynamicID, + }); + + this.Inventory.SendVisualInventory(player); + + if (this == player) // only send this to player itself. Warning: don't remove this check or you'll make the game start crashing! /raist. + { + player.InGameClient.SendMessage(new PlayerActorSetInitialMessage() + { + ActorId = this.DynamicID, + PlayerIndex = this.PlayerIndex, + }); + } + + this.Inventory.Reveal(player); + + return true; + } + + public override bool Unreveal(Player player) + { + if (!base.Unreveal(player)) + return false; + + this.Inventory.Unreveal(player); + + return true; + } + + public override void BeforeChangeWorld() + { + this.Inventory.Unreveal(this); + } + + public override void AfterChangeWorld() + { + this.Inventory.Reveal(this); + } + + #endregion + + #region hero-state + + /// + /// Allows hero state message to be sent when hero's some property get's updated. + /// + public void UpdateHeroState() + { + this.InGameClient.SendMessage(new HeroStateMessage + { + State = this.GetStateData() + }); + } + + public HeroStateData GetStateData() + { + return new HeroStateData() + { + Field0 = 0x00000000, + Field1 = 0x00000000, + Field2 = 0x00000000, + Field3 = -1, + PlayerFlags = (int)Toon.Flags, + PlayerSavedData = this.GetSavedData(), + QuestRewardHistoryEntriesCount = 0x00000000, + tQuestRewardHistory = QuestRewardHistory, + }; + } + + #endregion + + #region player attribute handling + + + + public float Strength + { + get + { + var baseStrength = 0.0f; + + + if (Toon.HeroTable.CoreAttribute == Mooege.Common.MPQ.FileFormats.PrimaryAttribute.Strength) + baseStrength = Toon.HeroTable.Strength + ((this.Toon.Level - 1) * 3); + else + baseStrength = Toon.HeroTable.Strength + (this.Toon.Level - 1); + + return baseStrength; + } + } + + public float Dexterity + { + get + { + if (Toon.HeroTable.CoreAttribute == Mooege.Common.MPQ.FileFormats.PrimaryAttribute.Dexterity) + return Toon.HeroTable.Dexterity + ((this.Toon.Level - 1) * 3); + else + return Toon.HeroTable.Dexterity + (this.Toon.Level - 1); + } + } + + public float Vitality + { + get + { + return Toon.HeroTable.Vitality + ((this.Toon.Level - 1) * 2); + } + } + + public float Intelligence + { + get + { + if (Toon.HeroTable.CoreAttribute == Mooege.Common.MPQ.FileFormats.PrimaryAttribute.Intelligence) + return Toon.HeroTable.Intelligence + ((this.Toon.Level - 1) * 3); + else + return Toon.HeroTable.Intelligence + (this.Toon.Level - 1); + } + } + + #endregion + + #region saved-data + + private PlayerSavedData GetSavedData() + { + return new PlayerSavedData() + { + HotBarButtons = this.SkillSet.HotBarSkills, + HotBarButton = new HotbarButtonData { SNOSkill = -1, Field1 = -1, ItemGBId = -1 }, + Field2 = 0xB4, + PlaytimeTotal = (int)this.Toon.TimePlayed, + WaypointFlags = 0x00000047, + + Field4 = new HirelingSavedData() + { + HirelingInfos = this.HirelingInfo, + Field1 = 0x00000000, + Field2 = 0x00000002, + }, + + Field5 = 0x00000726, + + LearnedLore = this.LearnedLore, + ActiveSkills = this.SkillSet.ActiveSkills, + snoTraits = this.SkillSet.PassiveSkills, + SavePointData = new SavePointData { snoWorld = -1, SavepointId = -1, }, + }; + } + + public SavePointData SavePointData { get; set; } + + public LearnedLore LearnedLore = new LearnedLore() + { + Count = 0x00000000, + m_snoLoreLearned = new int[256] + { + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000 + }, + }; + + public int[] SeenTutorials = new int[64] + { + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + }; + + public PlayerQuestRewardHistoryEntry[] QuestRewardHistory = new PlayerQuestRewardHistoryEntry[0] { }; + + public HirelingInfo[] HirelingInfo = new HirelingInfo[4] + { + new HirelingInfo { HirelingIndex = 0x00000000, Field1 = -1, Level = 0, Field3 = 0x0000, Field4 = false, Skill1SNOId = -1, Skill2SNOId = -1, Skill3SNOId = -1, Skill4SNOId = -1, }, + new HirelingInfo { HirelingIndex = 0x00000000, Field1 = -1, Level = 0, Field3 = 0x0000, Field4 = false, Skill1SNOId = -1, Skill2SNOId = -1, Skill3SNOId = -1, Skill4SNOId = -1, }, + new HirelingInfo { HirelingIndex = 0x00000000, Field1 = -1, Level = 0, Field3 = 0x0000, Field4 = false, Skill1SNOId = -1, Skill2SNOId = -1, Skill3SNOId = -1, Skill4SNOId = -1, }, + new HirelingInfo { HirelingIndex = 0x00000000, Field1 = -1, Level = 0, Field3 = 0x0000, Field4 = false, Skill1SNOId = -1, Skill2SNOId = -1, Skill3SNOId = -1, Skill4SNOId = -1, }, + }; + + public SkillKeyMapping[] SkillKeyMappings = new SkillKeyMapping[15] + { + new SkillKeyMapping { Power = -1, Field1 = -1, Field2 = 0x00000000, }, + new SkillKeyMapping { Power = -1, Field1 = -1, Field2 = 0x00000000, }, + new SkillKeyMapping { Power = -1, Field1 = -1, Field2 = 0x00000000, }, + new SkillKeyMapping { Power = -1, Field1 = -1, Field2 = 0x00000000, }, + new SkillKeyMapping { Power = -1, Field1 = -1, Field2 = 0x00000000, }, + new SkillKeyMapping { Power = -1, Field1 = -1, Field2 = 0x00000000, }, + new SkillKeyMapping { Power = -1, Field1 = -1, Field2 = 0x00000000, }, + new SkillKeyMapping { Power = -1, Field1 = -1, Field2 = 0x00000000, }, + new SkillKeyMapping { Power = -1, Field1 = -1, Field2 = 0x00000000, }, + new SkillKeyMapping { Power = -1, Field1 = -1, Field2 = 0x00000000, }, + new SkillKeyMapping { Power = -1, Field1 = -1, Field2 = 0x00000000, }, + new SkillKeyMapping { Power = -1, Field1 = -1, Field2 = 0x00000000, }, + new SkillKeyMapping { Power = -1, Field1 = -1, Field2 = 0x00000000, }, + new SkillKeyMapping { Power = -1, Field1 = -1, Field2 = 0x00000000, }, + new SkillKeyMapping { Power = -1, Field1 = -1, Field2 = 0x00000000, }, + }; + + #endregion + + #region cooked messages + + public PlayerBannerMessage GetPlayerBanner() + { + var playerBanner = D3.GameMessage.PlayerBanner.CreateBuilder() + .SetPlayerIndex((uint)this.PlayerIndex) + .SetBanner(this.Toon.GameAccount.BannerConfigurationField.Value) + .Build(); + + return new PlayerBannerMessage() { PlayerBanner = playerBanner }; + } + + public BlacksmithDataInitialMessage GetBlacksmithData() + { + var blacksmith = D3.ItemCrafting.CrafterData.CreateBuilder() + .SetLevel(45) + .SetCooldownEnd(0) + .Build(); + return new BlacksmithDataInitialMessage() { CrafterData = blacksmith }; + } + + public JewelerDataInitialMessage GetJewelerData() + { + var jeweler = D3.ItemCrafting.CrafterData.CreateBuilder() + .SetLevel(9) + .SetCooldownEnd(0) + .Build(); + return new JewelerDataInitialMessage() { CrafterData = jeweler }; + } + + public MysticDataInitialMessage GetMysticData() + { + var mystic = D3.ItemCrafting.CrafterData.CreateBuilder() + .SetLevel(45) + .SetCooldownEnd(0) + .Build(); + return new MysticDataInitialMessage() { CrafterData = mystic }; + } + + #endregion + + #region generic properties + + public int ClassSNO + { + get + { + + if (this.Toon.Gender == 0) + { + return Toon.HeroTable.SNOMaleActor; + } + else + { + return Toon.HeroTable.SNOFemaleActor; + } + } + } + + public float ModelScale + { + get + { + switch (this.Toon.Class) + { + case ToonClass.Barbarian: + return 1.2f; + case ToonClass.DemonHunter: + return 1.35f; + case ToonClass.Monk: + return 1.43f; + case ToonClass.WitchDoctor: + return 1.1f; + case ToonClass.Wizard: + return 1.3f; + } + return 1.43f; + } + } + + public int PrimaryResourceID + { + get + { + return (int)Toon.HeroTable.PrimaryResource; + } + } + + public int SecondaryResourceID + { + get + { + return (int)Toon.HeroTable.SecondaryResource; + } + } + + #endregion + + #region queries + + public List GetRevealedObjects() where T : class, IRevealable + { + return this.RevealedObjects.Values.OfType().Select(@object => @object).ToList(); + } + + #endregion + + #region experience handling + + //Max((Hitpoints_Max + Hitpoints_Total_From_Level + Hitpoints_Total_From_Vitality + Hitpoints_Max_Bonus) * (Hitpoints_Max_Percent_Bonus + Hitpoints_Max_Percent_Bonus_Item + 1), 1) + private float GetMaxTotalHitpoints() + { + return (Math.Max((this.Attributes[GameAttribute.Hitpoints_Max] + this.Attributes[GameAttribute.Hitpoints_Total_From_Level] + + this.Attributes[GameAttribute.Hitpoints_Max_Bonus]) * + (this.Attributes[GameAttribute.Hitpoints_Max_Percent_Bonus] + this.Attributes[GameAttribute.Hitpoints_Max_Percent_Bonus_Item] + 1), 1)); + } + + //Max((Resource_Max + ((Level#NONE - 1) * Resource_Factor_Level) + Resource_Max_Bonus) * (Resource_Max_Percent_Bonus + 1), 0) + private float GetMaxResource(int resourceId) + { + return (Math.Max((this.Attributes[GameAttribute.Resource_Max, resourceId] + ((this.Attributes[GameAttribute.Level] - 1) * this.Attributes[GameAttribute.Resource_Factor_Level, resourceId]) + this.Attributes[GameAttribute.Resource_Max_Bonus, resourceId]) * (this.Attributes[GameAttribute.Resource_Max_Percent_Bonus, resourceId] + 1), 0)); + } + + public static int[] LevelBorders = + { + 0, 1200, 2700, 4500, 6600, 9000, 11700, 14700, 17625, 20800, 24225, /* Level 0-10 */ + 27900, 31825, 36000, 41475, 38500, 40250, 42000, 43750, 45500, 47250, /* Level 11-20 */ + 49000, 58800, 63750, 73625, 84000, 94875, 106250, 118125, 130500, 134125, /* Level 21-30 */ + 77700, 81700, 85800, 90000, 94300, 98700, 103200, 107800, 112500, 117300, /* Level 31-40 */ + 122200, 127200, 132300, 137500, 142800, 148200, 153700, 159300, 165000, 170800, /* Level 41-50 */ + 176700, 182700, 188800, 195000, 201300, 207700, 214200, 220800, 227500, 234300, /* Level 51-60 */ + 241200, 248200, 255300, 262500, 269800, 277200, 284700, 292300, 300000, 307800, /* Level 61-70 */ + 315700, 323700, 331800, 340000, 348300, 356700, 365200, 373800, 382500, 391300, /* Level 71-80 */ + 400200, 409200, 418300, 427500, 436800, 446200, 455700, 465300, 475000, 484800, /* Level 81-90 */ + 494700, 504700, 514800, 525000, 535300, 545700, 556200, 566800, 577500 /* Level 91-99 */ + }; + + public static int[] LevelUpEffects = + { + 85186, 85186, 85186, 85186, 85186, 85190, 85190, 85190, 85190, 85190, /* Level 1-10 */ + 85187, 85187, 85187, 85187, 85187, 85187, 85187, 85187, 85187, 85187, /* Level 11-20 */ + 85192, 85192, 85192, 85192, 85192, 85192, 85192, 85192, 85192, 85192, /* Level 21-30 */ + 85192, 85192, 85192, 85192, 85192, 85192, 85192, 85192, 85192, 85192, /* Level 31-40 */ + 85192, 85192, 85192, 85192, 85192, 85192, 85192, 85192, 85192, 85192, /* Level 41-50 */ + 85194, 85194, 85194, 85194, 85194, 85194, 85194, 85194, 85194, 85194, /* Level 51-60 */ + 85194, 85194, 85194, 85194, 85194, 85194, 85194, 85194, 85194, 85194, /* Level 61-70 */ + 85194, 85194, 85194, 85194, 85194, 85194, 85194, 85194, 85194, 85194, /* Level 71-80 */ + 85195, 85195, 85195, 85195, 85195, 85195, 85195, 85195, 85195, 85195, /* Level 81-90 */ + 85195, 85195, 85195, 85195, 85195, 85195, 85195, 85195, 85195, 85195 /* Level 91-99 */ + }; + + public void UpdateExp(int addedExp) + { + this.Attributes[GameAttribute.Experience_Next] -= addedExp; + + // Levelup (maybe multiple levelups... remember Diablo2 Ancients) + while (this.Attributes[GameAttribute.Experience_Next] <= 0) + { + // No more levelup at Level_Cap + if (this.Attributes[GameAttribute.Level] >= this.Attributes[GameAttribute.Level_Cap]) + { + // Set maximun experience and exit. + this.Attributes[GameAttribute.Experience_Next] = 0; + break; + } + this.Attributes[GameAttribute.Level]++; + this.Toon.LevelUp(); + + this.InGameClient.SendMessage(new PlayerLevel() + { + PlayerIndex = this.PlayerIndex, + Level = this.Toon.Level + }); + + this.Conversations.StartConversation(0x0002A777); //LevelUp Conversation + + this.Attributes[GameAttribute.Experience_Next] = this.Attributes[GameAttribute.Experience_Next] + LevelBorders[this.Attributes[GameAttribute.Level]]; + + // 4 main attributes are incremented according to class + this.Attributes[GameAttribute.Strength] = this.Strength; + this.Attributes[GameAttribute.Intelligence] = this.Intelligence; + this.Attributes[GameAttribute.Vitality] = this.Vitality; + this.Attributes[GameAttribute.Dexterity] = this.Dexterity; + //scripted //this.Attributes[GameAttribute.Strength_Total] = this.StrengthTotal; + //scripted //this.Attributes[GameAttribute.Intelligence_Total] = this.IntelligenceTotal; + //scripted //this.Attributes[GameAttribute.Dexterity_Total] = this.DexterityTotal; + //scripted //this.Attributes[GameAttribute.Vitality_Total] = this.VitalityTotal; + + //scripted //this.Attributes[GameAttribute.Resistance_From_Intelligence] = this.Attributes[GameAttribute.Intelligence] * 0.1f; + //scripted //this.Attributes[GameAttribute.Resistance_Total, 0] = this.Attributes[GameAttribute.Resistance_From_Intelligence]; + //scripted //this.Attributes[GameAttribute.Resistance_Total, 1] = this.Attributes[GameAttribute.Resistance_From_Intelligence]; + //scripted //this.Attributes[GameAttribute.Resistance_Total, 2] = this.Attributes[GameAttribute.Resistance_From_Intelligence]; + //scripted //this.Attributes[GameAttribute.Resistance_Total, 3] = this.Attributes[GameAttribute.Resistance_From_Intelligence]; + //scripted //this.Attributes[GameAttribute.Resistance_Total, 4] = this.Attributes[GameAttribute.Resistance_From_Intelligence]; + //scripted //this.Attributes[GameAttribute.Resistance_Total, 5] = this.Attributes[GameAttribute.Resistance_From_Intelligence]; + //scripted //this.Attributes[GameAttribute.Resistance_Total, 6] = this.Attributes[GameAttribute.Resistance_From_Intelligence]; + + // Hitpoints from level may actually change. This needs to be verified by someone with the beta. + //scripted //this.Attributes[GameAttribute.Hitpoints_Total_From_Level] = this.Attributes[GameAttribute.Level] * this.Attributes[GameAttribute.Hitpoints_Factor_Level]; + + // For now, hit points are based solely on vitality and initial hitpoints received. + // This will have to change when hitpoint bonuses from items are implemented. + //scripted //this.Attributes[GameAttribute.Hitpoints_Total_From_Vitality] = this.Attributes[GameAttribute.Vitality] * this.Attributes[GameAttribute.Hitpoints_Factor_Vitality]; + //this.Attributes[GameAttribute.Hitpoints_Max] = this.Attributes[GameAttribute.Hitpoints_Total_From_Level] + this.Attributes[GameAttribute.Hitpoints_Total_From_Vitality]; + //scripted //this.Attributes[GameAttribute.Hitpoints_Max_Total] = GetMaxTotalHitpoints(); + + // On level up, health is set to max + this.Attributes[GameAttribute.Hitpoints_Cur] = this.Attributes[GameAttribute.Hitpoints_Max_Total]; + + // force GameAttributeMap to re-calc resources for the active resource types + this.Attributes[GameAttribute.Resource_Max, this.Attributes[GameAttribute.Resource_Type_Primary]] = this.Attributes[GameAttribute.Resource_Max, this.Attributes[GameAttribute.Resource_Type_Primary]]; + this.Attributes[GameAttribute.Resource_Max, this.Attributes[GameAttribute.Resource_Type_Secondary]] = this.Attributes[GameAttribute.Resource_Max, this.Attributes[GameAttribute.Resource_Type_Secondary]]; + + // set resources to max as well + this.Attributes[GameAttribute.Resource_Cur, this.Attributes[GameAttribute.Resource_Type_Primary]] = this.Attributes[GameAttribute.Resource_Max_Total, this.Attributes[GameAttribute.Resource_Type_Primary]]; + this.Attributes[GameAttribute.Resource_Cur, this.Attributes[GameAttribute.Resource_Type_Secondary]] = this.Attributes[GameAttribute.Resource_Max_Total, this.Attributes[GameAttribute.Resource_Type_Secondary]]; + + //scripted //this.Attributes[GameAttribute.Resource_Max_Total, this.Attributes[GameAttribute.Resource_Type_Primary]] = GetMaxResource(this.Attributes[GameAttribute.Resource_Type_Primary]); + //scripted //this.Attributes[GameAttribute.Resource_Effective_Max, this.Attributes[GameAttribute.Resource_Type_Primary]] = GetMaxResource(this.Attributes[GameAttribute.Resource_Type_Primary]); + //scripted //this.Attributes[GameAttribute.Resource_Cur, this.Attributes[GameAttribute.Resource_Type_Primary]] = GetMaxResource(this.Attributes[GameAttribute.Resource_Type_Primary]); + + //scripted //this.Attributes[GameAttribute.Resource_Max_Total, this.Attributes[GameAttribute.Resource_Type_Secondary]] = GetMaxResource(this.Attributes[GameAttribute.Resource_Type_Secondary]); + //scripted //this.Attributes[GameAttribute.Resource_Effective_Max, this.Attributes[GameAttribute.Resource_Type_Secondary]] = GetMaxResource(this.Attributes[GameAttribute.Resource_Type_Secondary]); + //scripted //this.Attributes[GameAttribute.Resource_Cur, this.Attributes[GameAttribute.Resource_Type_Secondary]] = GetMaxResource(this.Attributes[GameAttribute.Resource_Type_Secondary]); + + this.Attributes.BroadcastChangedIfRevealed(); + + this.PlayEffect(Effect.LevelUp); + this.World.PowerManager.RunPower(this, 85954); //g_LevelUp.pow 85954 + } + + this.Attributes.BroadcastChangedIfRevealed(); + this.Toon.GameAccount.NotifyUpdate(); + //this.Attributes.SendMessage(this.InGameClient, this.DynamicID); kills the player atm + } + + #endregion + + #region gold, heath-glob collection + + private void CollectGold() + { + List itemList = this.GetItemsInRange(5f); + foreach (Item item in itemList) + { + if (!Item.IsGold(item.ItemType)) continue; + + List playersAffected = this.GetPlayersInRange(26f); + int amount = (int)Math.Max(1, Math.Round((double)item.Attributes[GameAttribute.Gold] / playersAffected.Count, 0)); + item.Attributes[GameAttribute.Gold] = amount; + foreach (Player player in playersAffected) + { + player.InGameClient.SendMessage(new FloatingAmountMessage() + { + Place = new WorldPlace() + { + Position = player.Position, + WorldID = player.World.DynamicID, + }, + + Amount = amount, + Type = FloatingAmountMessage.FloatType.Gold, + }); + + player.Inventory.PickUpGold(item.DynamicID); + } + item.Destroy(); + } + } + + private void CollectHealthGlobe() + { + var itemList = this.GetItemsInRange(5f); + foreach (Item item in itemList) + { + if (!Item.IsHealthGlobe(item.ItemType)) continue; + + var playersAffected = this.GetPlayersInRange(26f); + foreach (Player player in playersAffected) + { + foreach (Player targetAffected in playersAffected) + { + player.InGameClient.SendMessage(new PlayEffectMessage() + { + ActorId = targetAffected.DynamicID, + Effect = Effect.HealthOrbPickup + }); + } + + //every summon and mercenary owned by you must broadcast their green text to you /H_DANILO + player.AddPercentageHP((int)item.Attributes[GameAttribute.Health_Globe_Bonus_Health]); + } + item.Destroy(); + } + } + + public void AddPercentageHP(int percentage) + { + float quantity = (percentage * this.Attributes[GameAttribute.Hitpoints_Max_Total]) / 100; + this.AddHP(quantity); + } + + public void AddHP(float quantity) + { + this.Attributes[GameAttribute.Hitpoints_Cur] = Math.Min( + this.Attributes[GameAttribute.Hitpoints_Cur] + quantity, + this.Attributes[GameAttribute.Hitpoints_Max_Total]); + + this.InGameClient.SendMessage(new FloatingNumberMessage() + { + ActorID = this.DynamicID, + Number = quantity, + Type = FloatingNumberMessage.FloatType.Green + }); + + this.Attributes.BroadcastChangedIfRevealed(); + } + + #endregion + + #region Resource Generate/Use + + public void GeneratePrimaryResource(float amount) + { + _ModifyResourceAttribute(this.PrimaryResourceID, amount); + } + + public void UsePrimaryResource(float amount) + { + _ModifyResourceAttribute(this.PrimaryResourceID, -amount); + } + + public void GenerateSecondaryResource(float amount) + { + _ModifyResourceAttribute(this.SecondaryResourceID, amount); + } + + public void UseSecondaryResource(float amount) + { + _ModifyResourceAttribute(this.SecondaryResourceID, -amount); + } + + private void _ModifyResourceAttribute(int resourceID, float amount) + { + if (amount > 0f) + { + this.Attributes[GameAttribute.Resource_Cur, resourceID] = Math.Min( + this.Attributes[GameAttribute.Resource_Cur, resourceID] + amount, + this.Attributes[GameAttribute.Resource_Max_Total, resourceID]); + } + else + { + this.Attributes[GameAttribute.Resource_Cur, resourceID] = Math.Max( + this.Attributes[GameAttribute.Resource_Cur, resourceID] + amount, + 0f); + } + + this.Attributes.BroadcastChangedIfRevealed(); + } + + + private void _UpdateResources() + { + // will crash client when loading if you try to update resources too early + if (!InGameClient.TickingEnabled) return; + + // 1 tick = 1/60s, so multiply ticks in seconds against resource regen per-second to get the amount to update + float tickSeconds = 1f / 60f * (this.InGameClient.Game.TickCounter - _lastResourceUpdateTick); + _lastResourceUpdateTick = this.InGameClient.Game.TickCounter; + + GeneratePrimaryResource(tickSeconds * this.Attributes[GameAttribute.Resource_Regen_Total, + this.Attributes[GameAttribute.Resource_Type_Primary]]); + GenerateSecondaryResource(tickSeconds * this.Attributes[GameAttribute.Resource_Regen_Total, + this.Attributes[GameAttribute.Resource_Type_Secondary]]); + AddHP(tickSeconds * this.Attributes[GameAttribute.Hitpoints_Regen_Per_Second]); + + // TODO: replace this with Trait_Barbarian_Fury.pow implementation + if (this.Toon.Class == ToonClass.Barbarian) + UsePrimaryResource(tickSeconds * 0.9f); + + + } + + #endregion + + #region lore + + /// + /// Checks if player has lore + /// + /// + /// + public bool HasLore(int loreSNOId) + { + return LearnedLore.m_snoLoreLearned.Contains(loreSNOId); + } + + /// + /// Plays lore to player + /// + /// + /// if false, lore will have new lore button + public void PlayLore(int loreSNOId, bool immediately) + { + // play lore to player + InGameClient.SendMessage(new Mooege.Net.GS.Message.Definitions.Quest.LoreMessage + { + LoreSNOId = loreSNOId + }); + if (!HasLore(loreSNOId)) + { + AddLore(loreSNOId); + } + } + + /// + /// Adds lore to player's state + /// + /// + public void AddLore(int loreSNOId) + { + if (this.LearnedLore.Count < this.LearnedLore.m_snoLoreLearned.Length) + { + LearnedLore.m_snoLoreLearned[LearnedLore.Count] = loreSNOId; + LearnedLore.Count++; // Count + UpdateHeroState(); + } + } + + #endregion + + #region StoneOfRecall + + public void EnableStoneOfRecall() + { + Attributes[GameAttribute.Skill, 0x0002EC66] = 1; + Attributes[GameAttribute.Skill_Total, 0x0002EC66] = 1; + Attributes.SendChangedMessage(this.InGameClient); + } + + #endregion + + } +} diff --git a/src/Mooege/Core/GS/Powers/ActionTimedSkill.cs b/src/Mooege/Core/GS/Powers/ActionTimedSkill.cs new file mode 100644 index 00000000..cf9348a5 --- /dev/null +++ b/src/Mooege/Core/GS/Powers/ActionTimedSkill.cs @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Mooege.Core.GS.Powers +{ + public abstract class ActionTimedSkill : Skill + { + public override float GetContactDelay() + { + float actionSpeed = GetActionSpeed(); + if (actionSpeed > 0f) + return 0.5f / actionSpeed; + else + return 0f; + } + } +} diff --git a/src/Mooege/Core/GS/Powers/ActorMover.cs b/src/Mooege/Core/GS/Powers/ActorMover.cs new file mode 100644 index 00000000..ec272207 --- /dev/null +++ b/src/Mooege/Core/GS/Powers/ActorMover.cs @@ -0,0 +1,175 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Core.GS.Actors; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Ticker; +using Mooege.Net.GS.Message.Definitions.ACD; +using Mooege.Net.GS.Message.Definitions.Actor; +using Mooege.Core.GS.Common.Types.Misc; + +namespace Mooege.Core.GS.Powers +{ + public class ActorMover + { + public Actor Target; + + public Vector3D Velocity { get; private set; } + public TickTimer ArrivalTime { get; private set; } + public bool Arrived { get { return ArrivalTime.TimedOut; } } + + private Vector3D _startPosition; + private Vector3D _endPosition; + private int _startTick; + private float _arcGravity; + + private enum MoveCommandType + { + Normal, + Fixed, + Arc + } + private MoveCommandType _moveCommand; + + public ActorMover(Actor target) + { + this.Target = target; + } + + public void Move(Vector3D destination, float speed, ACDTranslateNormalMessage baseMessage = null) + { + _SetupMove(destination, speed); + _moveCommand = MoveCommandType.Normal; + + if (baseMessage == null) + baseMessage = new ACDTranslateNormalMessage(); + + baseMessage.ActorId = (int)this.Target.DynamicID; + baseMessage.Position = destination; + baseMessage.Angle = (float)Math.Acos(this.Target.RotationW) * 2f; + baseMessage.Speed = speed; + + this.Target.World.BroadcastIfRevealed(baseMessage, this.Target); + } + + public void MoveFixed(Vector3D targetPosition, float speed, ACDTranslateFixedMessage baseMessage = null) + { + _SetupMove(targetPosition, speed); + _moveCommand = MoveCommandType.Fixed; + + if (baseMessage == null) + baseMessage = new ACDTranslateFixedMessage(); + + baseMessage.ActorId = (int)this.Target.DynamicID; + baseMessage.Velocity = this.Velocity; + + this.Target.World.BroadcastIfRevealed(baseMessage, this.Target); + } + + public void MoveArc(Vector3D destination, float height, float gravity, ACDTranslateArcMessage baseMessage = null) + { + _SetupArcMove(destination, height, gravity); + _moveCommand = MoveCommandType.Arc; + + if (baseMessage == null) + baseMessage = new ACDTranslateArcMessage(); + + baseMessage.ActorId = (int)this.Target.DynamicID; + baseMessage.Start = this.Target.Position; + baseMessage.Velocity = this.Velocity; + baseMessage.Gravity = gravity; + baseMessage.DestinationZ = destination.Z; + + this.Target.World.BroadcastIfRevealed(baseMessage, this.Target); + } + + public bool Update() + { + _UpdatePosition(); + return this.Arrived; + } + + private void _SetupMove(Vector3D destination, float speed) + { + Vector3D dir_normal = PowerMath.Normalize(new Vector3D(destination.X - this.Target.Position.X, + destination.Y - this.Target.Position.Y, + destination.Z - this.Target.Position.Z)); + + this.Velocity = new Vector3D(dir_normal.X * speed, + dir_normal.Y * speed, + dir_normal.Z * speed); + + this.ArrivalTime = new RelativeTickTimer(this.Target.World.Game, + (int)(PowerMath.Distance2D(this.Target.Position, destination) / speed)); + _startPosition = this.Target.Position; + _endPosition = destination; + _startTick = this.Target.World.Game.TickCounter; + } + + private void _SetupArcMove(Vector3D destination, float crestHeight, float gravity) + { + // TODO: handle when target and destination heights differ + float absGravity = Math.Abs(gravity); + float arcLength = (float)Math.Sqrt(2f * crestHeight / absGravity); + int arrivalTicks = (int)(arcLength * 2f); + + float distance = PowerMath.Distance2D(this.Target.Position, destination); + Vector3D normal = PowerMath.Normalize(new Vector3D(destination.X - this.Target.Position.X, + destination.Y - this.Target.Position.Y, + 0f)); + + this.Velocity = new Vector3D(normal.X * (distance / arrivalTicks), + normal.Y * (distance / arrivalTicks), + absGravity * arcLength); + + this.ArrivalTime = new RelativeTickTimer(this.Target.World.Game, arrivalTicks); + _startPosition = this.Target.Position; + _endPosition = destination; + _startTick = this.Target.World.Game.TickCounter; + _arcGravity = gravity; + } + + private void _UpdatePosition() + { + if (_moveCommand != MoveCommandType.Fixed && this.Arrived) + { + this.Target.Position = _endPosition; + return; + } + + int moveTicks = this.Target.World.Game.TickCounter - _startTick; + + if (_moveCommand == MoveCommandType.Arc) + { + this.Target.Position = new Vector3D(_startPosition.X + this.Velocity.X * moveTicks, + _startPosition.Y + this.Velocity.Y * moveTicks, + _startPosition.Z + 0.5f * _arcGravity * (moveTicks * moveTicks) + this.Velocity.Z * moveTicks); + } + else + { + this.Target.Position = new Vector3D(_startPosition.X + this.Velocity.X * moveTicks, + _startPosition.Y + this.Velocity.Y * moveTicks, + _startPosition.Z + this.Velocity.Z * moveTicks); + } + } + } +} diff --git a/src/Mooege/Core/GS/Powers/BaseBuffs.cs b/src/Mooege/Core/GS/Powers/BaseBuffs.cs new file mode 100644 index 00000000..21e5d723 --- /dev/null +++ b/src/Mooege/Core/GS/Powers/BaseBuffs.cs @@ -0,0 +1,272 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Core.GS.Ticker; +using Mooege.Net.GS.Message; + +namespace Mooege.Core.GS.Powers +{ + public abstract class Buff : PowerContext + { + public virtual bool Apply() + { + if (PowerSNO != 0) + { + Target.Attributes[GameAttribute.Buff_Active, PowerSNO] = true; + Target.Attributes.BroadcastChangedIfRevealed(); + } + return true; + } + + public virtual void Remove() + { + if (PowerSNO != 0) + { + Target.Attributes[GameAttribute.Buff_Active, PowerSNO] = false; + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + + public virtual void Init() { } + public virtual bool Update() { return false; } + public virtual bool Stack(Buff buff) { return false; } + public virtual void OnPayload(Payloads.Payload payload) { } + } + + public abstract class TimedBuff : Buff + { + public TickTimer Timeout; + + public override bool Update() + { + return this.Timeout != null && this.Timeout.TimedOut; + } + + public override bool Stack(Buff buff) + { + TimedBuff newbuff = (TimedBuff)buff; + // update buff if new timeout is longer than current one, or if new buff has no timeout + if (newbuff.Timeout == null || this.Timeout != null && newbuff.Timeout.TimeoutTick > this.Timeout.TimeoutTick) + this.Timeout = newbuff.Timeout; + + return true; + } + } + + public abstract class PowerBuff : TimedBuff + { + public int BuffSlot = 0; + public bool IsCountingStacks = false; + public int StackCount = 0; + public int MaxStackCount = 0; + + public PowerBuff() + { + // try to load buff options from attribute + var attributes = (ImplementsPowerBuff[])this.GetType().GetCustomAttributes(typeof(ImplementsPowerBuff), true); + foreach (var attr in attributes) + { + BuffSlot = attr.BuffSlot; + IsCountingStacks = attr.CountStacks; + } + } + + public override bool Apply() + { + base.Apply(); + + Target.Attributes[_Power_Buff_N_VisualEffect_R, PowerSNO] = true; + if (this.Timeout != null) + { + Target.Attributes[_Buff_Icon_Start_TickN, PowerSNO] = this.Timeout.TimeoutTick; + Target.Attributes[_Buff_Icon_End_TickN, PowerSNO] = this.Timeout.TimeoutTick; + Target.Attributes[_Buff_Icon_CountN, PowerSNO] = 1; + } + Target.Attributes.BroadcastChangedIfRevealed(); + + this.StackCount = 1; + + return true; + } + + public override void Remove() + { + base.Remove(); + + Target.Attributes[_Power_Buff_N_VisualEffect_R, PowerSNO] = false; + if (this.Timeout != null) + { + Target.Attributes[_Buff_Icon_Start_TickN, PowerSNO] = 0; + Target.Attributes[_Buff_Icon_End_TickN, PowerSNO] = 0; + Target.Attributes[_Buff_Icon_CountN, PowerSNO] = 0; + } + Target.Attributes.BroadcastChangedIfRevealed(); + + this.StackCount = 0; + } + + public override bool Stack(Buff buff) + { + base.Stack(buff); + + bool canStack = this.IsCountingStacks && StackCount != MaxStackCount; + + if (this.Timeout != null) + { + Target.Attributes[_Buff_Icon_Start_TickN, PowerSNO] = this.Timeout.TimeoutTick; + Target.Attributes[_Buff_Icon_End_TickN, PowerSNO] = this.Timeout.TimeoutTick; + if (canStack) + Target.Attributes[_Buff_Icon_CountN, PowerSNO] += 1; + } + Target.Attributes.BroadcastChangedIfRevealed(); + + if (canStack) + this.StackCount += 1; + + return true; + } + + private GameAttributeB _Power_Buff_N_VisualEffect_R + { + get + { + switch (BuffSlot) + { + default: + case 0: + return RuneSelect(GameAttribute.Power_Buff_0_Visual_Effect_None, + GameAttribute.Power_Buff_0_Visual_Effect_A, + GameAttribute.Power_Buff_0_Visual_Effect_B, + GameAttribute.Power_Buff_0_Visual_Effect_C, + GameAttribute.Power_Buff_0_Visual_Effect_D, + GameAttribute.Power_Buff_0_Visual_Effect_E); + case 1: + return RuneSelect(GameAttribute.Power_Buff_1_Visual_Effect_None, + GameAttribute.Power_Buff_1_Visual_Effect_A, + GameAttribute.Power_Buff_1_Visual_Effect_B, + GameAttribute.Power_Buff_1_Visual_Effect_C, + GameAttribute.Power_Buff_1_Visual_Effect_D, + GameAttribute.Power_Buff_1_Visual_Effect_E); + case 2: + return RuneSelect(GameAttribute.Power_Buff_2_Visual_Effect_None, + GameAttribute.Power_Buff_2_Visual_Effect_A, + GameAttribute.Power_Buff_2_Visual_Effect_B, + GameAttribute.Power_Buff_2_Visual_Effect_C, + GameAttribute.Power_Buff_2_Visual_Effect_D, + GameAttribute.Power_Buff_2_Visual_Effect_E); + case 3: + return RuneSelect(GameAttribute.Power_Buff_3_Visual_Effect_None, + GameAttribute.Power_Buff_3_Visual_Effect_A, + GameAttribute.Power_Buff_3_Visual_Effect_B, + GameAttribute.Power_Buff_3_Visual_Effect_C, + GameAttribute.Power_Buff_3_Visual_Effect_D, + GameAttribute.Power_Buff_3_Visual_Effect_E); + case 4: + return RuneSelect(GameAttribute.Power_Buff_4_Visual_Effect_None, + GameAttribute.Power_Buff_4_Visual_Effect_A, + GameAttribute.Power_Buff_4_Visual_Effect_B, + GameAttribute.Power_Buff_4_Visual_Effect_C, + GameAttribute.Power_Buff_4_Visual_Effect_D, + GameAttribute.Power_Buff_4_Visual_Effect_E); + case 5: + return RuneSelect(GameAttribute.Power_Buff_5_Visual_Effect_None, + GameAttribute.Power_Buff_5_Visual_Effect_A, + GameAttribute.Power_Buff_5_Visual_Effect_B, + GameAttribute.Power_Buff_5_Visual_Effect_C, + GameAttribute.Power_Buff_5_Visual_Effect_D, + GameAttribute.Power_Buff_5_Visual_Effect_E); + case 6: + return RuneSelect(GameAttribute.Power_Buff_6_Visual_Effect_None, + GameAttribute.Power_Buff_6_Visual_Effect_A, + GameAttribute.Power_Buff_6_Visual_Effect_B, + GameAttribute.Power_Buff_6_Visual_Effect_C, + GameAttribute.Power_Buff_6_Visual_Effect_D, + GameAttribute.Power_Buff_6_Visual_Effect_E); + case 7: + return RuneSelect(GameAttribute.Power_Buff_7_Visual_Effect_None, + GameAttribute.Power_Buff_7_Visual_Effect_A, + GameAttribute.Power_Buff_7_Visual_Effect_B, + GameAttribute.Power_Buff_7_Visual_Effect_C, + GameAttribute.Power_Buff_7_Visual_Effect_D, + GameAttribute.Power_Buff_7_Visual_Effect_E); + } + } + } + + private GameAttributeI _Buff_Icon_Start_TickN + { + get + { + switch (BuffSlot) + { + default: + case 0: return GameAttribute.Buff_Icon_Start_Tick0; + case 1: return GameAttribute.Buff_Icon_Start_Tick1; + case 2: return GameAttribute.Buff_Icon_Start_Tick2; + case 3: return GameAttribute.Buff_Icon_Start_Tick3; + case 4: return GameAttribute.Buff_Icon_Start_Tick4; + case 5: return GameAttribute.Buff_Icon_Start_Tick5; + case 6: return GameAttribute.Buff_Icon_Start_Tick6; + case 7: return GameAttribute.Buff_Icon_Start_Tick7; + } + } + } + + private GameAttributeI _Buff_Icon_End_TickN + { + get + { + switch (BuffSlot) + { + default: + case 0: return GameAttribute.Buff_Icon_End_Tick0; + case 1: return GameAttribute.Buff_Icon_End_Tick1; + case 2: return GameAttribute.Buff_Icon_End_Tick2; + case 3: return GameAttribute.Buff_Icon_End_Tick3; + case 4: return GameAttribute.Buff_Icon_End_Tick4; + case 5: return GameAttribute.Buff_Icon_End_Tick5; + case 6: return GameAttribute.Buff_Icon_End_Tick6; + case 7: return GameAttribute.Buff_Icon_End_Tick7; + } + } + } + + private GameAttributeI _Buff_Icon_CountN + { + get + { + switch (BuffSlot) + { + default: + case 0: return GameAttribute.Buff_Icon_Count0; + case 1: return GameAttribute.Buff_Icon_Count1; + case 2: return GameAttribute.Buff_Icon_Count2; + case 3: return GameAttribute.Buff_Icon_Count3; + case 4: return GameAttribute.Buff_Icon_Count4; + case 5: return GameAttribute.Buff_Icon_Count5; + case 6: return GameAttribute.Buff_Icon_Count6; + case 7: return GameAttribute.Buff_Icon_Count7; + } + } + } + } +} diff --git a/src/Mooege/Core/GS/Powers/BuffManager.cs b/src/Mooege/Core/GS/Powers/BuffManager.cs new file mode 100644 index 00000000..1911c8ce --- /dev/null +++ b/src/Mooege/Core/GS/Powers/BuffManager.cs @@ -0,0 +1,199 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Core.GS.Actors; + +namespace Mooege.Core.GS.Powers +{ + public class BuffManager + { + private Dictionary> _buffs = new Dictionary>(); + + public void Update() + { + // make copy of keys as the dictionary will be modified during update/cleaning + Actor[] keys = _buffs.Keys.ToArray(); + + // update buffs and mark finished ones as removed + foreach (Actor target in keys) + _RemoveBuffsIf(target, buff => buff.Update()); + + // clean up removed buffs + foreach (Actor target in keys) + { + _buffs[target].RemoveAll(buff => buff == null); + if (_buffs[target].Count == 0) + _buffs.Remove(target); + } + } + + public bool AddBuff(Actor user, Actor target, Buff buff) + { + if (user.World == null || target.World == null) return false; + + buff.User = user; + buff.Target = target; + buff.World = target.World; + + // try to load in power sno from class attribute first, then try parent class (if there is one) + Type buffType = buff.GetType(); + int powerSNO = ImplementsPowerSNO.GetPowerSNOForClass(buffType); + if (powerSNO != -1) + { + buff.PowerSNO = powerSNO; + } + else if (buffType.IsNested) + { + powerSNO = ImplementsPowerSNO.GetPowerSNOForClass(buffType.DeclaringType); + if (powerSNO != -1) + buff.PowerSNO = powerSNO; + } + + buff.Init(); + + return _AddBuff(buff); + } + + public void RemoveBuffs(Actor target, Type buffClass) + { + if (!_buffs.ContainsKey(target)) return; + + _RemoveBuffsIf(target, buff => buff.GetType() == buffClass); + } + + public void RemoveBuffs(Actor target, int powerSNO) + { + if (!_buffs.ContainsKey(target)) return; + + _RemoveBuffsIf(target, buff => buff.PowerSNO == powerSNO); + } + + public void RemoveAllBuffs(Actor target) + { + if (!_buffs.ContainsKey(target)) return; + + _RemoveBuffsIf(target, buff => true); + } + + public T GetFirstBuff(Actor target) where T : Buff + { + if (!_buffs.ContainsKey(target)) return null; + + Buff buff = _buffs[target].FirstOrDefault(b => b != null && b.GetType() == typeof(T)); + if (buff != null) + return (T)buff; + else + return null; + } + + public Buff[] GetAllBuffs(Actor target) + { + if (!_buffs.ContainsKey(target)) return null; + return _buffs[target].Where(b => b != null).ToArray(); + } + + public bool HasBuff(Actor target) where T : Buff + { + return GetFirstBuff(target) != null; + } + + public void SendTargetPayload(Actor target, Payloads.Payload payload) + { + if (_buffs.ContainsKey(target)) + { + List buffs = _buffs[target]; + int buffCount = buffs.Count; + for (int i = 0; i < buffCount; ++i) + { + if (buffs[i] != null) + buffs[i].OnPayload(payload); + } + } + } + + private bool _AddBuff(Buff buff) + { + // look up or create a buff list for the target, then add/stack the buff according to its class type. + + // the logic is a bit more complex that it seems necessary because we ensure the buff appears in the + // active buff list before calling Apply(), if Apply() fails we undo adding it. This allows buffs to + // recursively add/stack more of their own buff type without worrying about overwriting existing buffs. + if (_buffs.ContainsKey(buff.Target)) + { + Type buffType = buff.GetType(); + Buff existingBuff = _buffs[buff.Target].FirstOrDefault(b => b != null && b.GetType() == buffType); + if (existingBuff != null) + { + if (existingBuff.Stack(buff)) + return true; + // buff is non-stacking, just add normally + } + + _buffs[buff.Target].Add(buff); + if (buff.Apply()) + { + return true; + } + else + { + _buffs[buff.Target].Remove(buff); + return false; + } + } + else + { + var keyBuffs = new List(); + keyBuffs.Add(buff); + _buffs[buff.Target] = keyBuffs; + if (buff.Apply()) + { + return true; + } + else + { + _buffs.Remove(buff.Target); + return false; + } + } + } + + private void _RemoveBuffsIf(Actor target, Func pred) + { + List buffs = _buffs[target]; + int buffCount = buffs.Count; + for (int i = 0; i < buffCount; ++i) + { + if (buffs[i] != null) + { + if (pred(buffs[i])) + { + if (buffs[i] != null) + { + buffs[i].Remove(); + buffs[i] = null; + } + } + } + } + } + } +} diff --git a/src/Mooege/Core/GS/Powers/ChanneledSkill.cs b/src/Mooege/Core/GS/Powers/ChanneledSkill.cs new file mode 100644 index 00000000..afe23372 --- /dev/null +++ b/src/Mooege/Core/GS/Powers/ChanneledSkill.cs @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Core.GS.Ticker; + +namespace Mooege.Core.GS.Powers +{ + public abstract class ChanneledSkill : PowerScript + { + public bool IsChannelOpen = false; + public float EffectsPerSecond = 1.0f; + + public virtual void OnChannelOpen() { } + public virtual void OnChannelClose() { } + public virtual void OnChannelUpdated() { } + public abstract IEnumerable Main(); + + private TickTimer _effectTimeout = null; + + public sealed override IEnumerable Run() + { + // process channeled skill events + if (IsChannelOpen) + { + OnChannelUpdated(); + } + else // first call to this skill's Run(), set channel as open + { + OnChannelOpen(); + IsChannelOpen = true; + } + + // run main script if ready + if (_effectTimeout == null || _effectTimeout.TimedOut) + { + _effectTimeout = WaitSeconds(EffectsPerSecond); + foreach (TickTimer timeout in Main()) + yield return timeout; + } + } + + public void CloseChannel() + { + OnChannelClose(); + IsChannelOpen = false; + } + } +} diff --git a/src/Mooege/Core/GS/Powers/ComboSkill.cs b/src/Mooege/Core/GS/Powers/ComboSkill.cs new file mode 100644 index 00000000..1d48fb48 --- /dev/null +++ b/src/Mooege/Core/GS/Powers/ComboSkill.cs @@ -0,0 +1,124 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Core.GS.Ticker; +using Mooege.Core.GS.Common.Types.TagMap; + +namespace Mooege.Core.GS.Powers +{ + public abstract class ComboSkill : Skill + { + public int ComboIndex + { + get + { + return TargetMessage.Field5; + } + } + + public override int GetActionAnimationSNO() + { + int tag; + switch (ComboIndex) + { + case 0: tag = EvalTag(PowerKeys.ComboAnimation1); break; + case 1: tag = EvalTag(PowerKeys.ComboAnimation2); break; + case 2: tag = EvalTag(PowerKeys.ComboAnimation3); break; + default: return -1; + } + + if (User.AnimationSet.Animations.ContainsKey(tag)) + return User.AnimationSet.Animations[tag]; + else + return -1; + } + + public override float GetActionSpeed() + { + switch (ComboIndex) + { + case 0: return EvalTag(PowerKeys.ComboAttackSpeed1); + case 1: return EvalTag(PowerKeys.ComboAttackSpeed2); + case 2: return EvalTag(PowerKeys.ComboAttackSpeed3); + default: return 0f; + } + } + + public override int GetCastEffectSNO() + { + if (IsUserFemale) + { + switch (ComboIndex) + { + case 0: return EvalTag(PowerKeys.Combo0CastingEffectGroup_Female); + case 1: return EvalTag(PowerKeys.Combo1CastingEffectGroup_Female); + case 2: return EvalTag(PowerKeys.Combo2CastingEffectGroup_Female); + default: return -1; + } + } + else + { + switch (ComboIndex) + { + case 0: return EvalTag(PowerKeys.Combo0CastingEffectGroup_Male); + case 1: return EvalTag(PowerKeys.Combo1CastingEffectGroup_Male); + case 2: return EvalTag(PowerKeys.Combo2CastingEffectGroup_Male); + default: return -1; + } + } + } + + public override int GetContactEffectSNO() + { + if (IsUserFemale) + { + switch (ComboIndex) + { + case 0: return EvalTag(PowerKeys.Combo0ContactFrameEffectGroup_Female); + case 1: return EvalTag(PowerKeys.Combo1ContactFrameEffectGroup_Female); + case 2: return EvalTag(PowerKeys.Combo2ContactFrameEffectGroup_Female); + default: return -1; + } + } + else + { + switch (ComboIndex) + { + case 0: return EvalTag(PowerKeys.Combo0ContactFrameEffectGroup_Male); + case 1: return EvalTag(PowerKeys.Combo1ContactFrameEffectGroup_Male); + case 2: return EvalTag(PowerKeys.Combo2ContactFrameEffectGroup_Male); + default: return -1; + } + } + } + + public override float GetContactDelay() + { + // only have a contact delay if the action speed is >0 and there is a contact effect specified + float actionSpeed = GetActionSpeed(); + if (actionSpeed > 0f && GetContactEffectSNO() != -1) + return 0.5f / actionSpeed; + else + return 0f; + } + } +} diff --git a/src/Mooege/Core/GS/Powers/DamageType.cs b/src/Mooege/Core/GS/Powers/DamageType.cs new file mode 100644 index 00000000..0d3d128d --- /dev/null +++ b/src/Mooege/Core/GS/Powers/DamageType.cs @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Core.GS.Common.Types.TagMap; + +namespace Mooege.Core.GS.Powers +{ + public class DamageType + { + public enum HitEffectType : int + { + Physical = 0, + Fire = 1, + Lightning = 2, + Cold = 3, + Poison = 4, + Arcane = 5, + Holy = 6, + UnknownFlicker = 7 + } + + public HitEffectType HitEffect; + public int AttributeKey; // GameAttributeMap key for a given damage type + public TagKeyInt DeathAnimationTag; + + public static readonly DamageType Physical = new DamageType + { + HitEffect = HitEffectType.Physical, + AttributeKey = 0, + DeathAnimationTag = AnimationSetKeys.DeathDefault, + }; + public static readonly DamageType Arcane = new DamageType + { + HitEffect = HitEffectType.Arcane, + AttributeKey = 5, + DeathAnimationTag = AnimationSetKeys.DeathArcane, + }; + public static readonly DamageType Cold = new DamageType + { + HitEffect = HitEffectType.Cold, + AttributeKey = 3, + DeathAnimationTag = AnimationSetKeys.DeathCold, + }; + public static readonly DamageType Fire = new DamageType + { + HitEffect = HitEffectType.Fire, + AttributeKey = 1, + DeathAnimationTag = AnimationSetKeys.DeathFire, + }; + public static readonly DamageType Lightning = new DamageType + { + HitEffect = HitEffectType.Lightning, + AttributeKey = 2, + DeathAnimationTag = AnimationSetKeys.DeathLightning, + }; + public static readonly DamageType Poison = new DamageType + { + HitEffect = HitEffectType.Poison, + AttributeKey = 4, + DeathAnimationTag = AnimationSetKeys.DeathPoison, + }; + public static readonly DamageType Holy = new DamageType + { + HitEffect = HitEffectType.Holy, + AttributeKey = 6, + DeathAnimationTag = AnimationSetKeys.DeathHoly, + }; + + public static readonly DamageType[] AllTypes = new DamageType[] + { + Physical, + Arcane, + Cold, + Fire, + Lightning, + Poison, + Holy + }; + } +} diff --git a/src/Mooege/Core/GS/Powers/EffectActor.cs b/src/Mooege/Core/GS/Powers/EffectActor.cs new file mode 100644 index 00000000..fd867e35 --- /dev/null +++ b/src/Mooege/Core/GS/Powers/EffectActor.cs @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Objects; +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Actors; +using Mooege.Core.GS.Ticker; +using Mooege.Net.GS.Message; + +namespace Mooege.Core.GS.Powers +{ + public class EffectActor : Actor, IUpdateable + { + public PowerContext Context; + + public TickTimer Timeout = null; + public float UpdateDelay = 0f; + public Action OnUpdate = null; + public Action OnTimeout = null; + + public override ActorType ActorType { get { return Actors.ActorType.ClientEffect; } } + + private TickTimer _updateTimer; + + public EffectActor(PowerContext context, int actorSNO, Vector3D position) + : base(context.World, actorSNO) + { + this.Context = context; + + this.Field2 = 0x8; + if (this.Scale == 0f) + this.Scale = 1f; + this.Position = position; + + // copy in important effect params from user + this.Attributes[GameAttribute.Rune_A, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_A, context.PowerSNO]; + this.Attributes[GameAttribute.Rune_B, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_B, context.PowerSNO]; + this.Attributes[GameAttribute.Rune_C, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_C, context.PowerSNO]; + this.Attributes[GameAttribute.Rune_D, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_D, context.PowerSNO]; + this.Attributes[GameAttribute.Rune_E, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_E, context.PowerSNO]; + } + + public void Spawn(float facingAngle = 0) + { + this.SetFacingRotation(facingAngle); + this.World.Enter(this); + } + + public virtual void Update(int tickCounter) + { + if (Timeout != null && Timeout.TimedOut) + { + if (OnTimeout != null) + OnTimeout(); + + this.Destroy(); + } + else if (OnUpdate != null) + { + if (_updateTimer == null || _updateTimer.TimedOut) + { + OnUpdate(); + if (this.UpdateDelay > 0f) + _updateTimer = new SecondsTickTimer(this.Context.World.Game, this.UpdateDelay); + else + _updateTimer = null; + } + } + } + } +} diff --git a/src/Mooege/Core/GS/Powers/Implementations/General/ActorGhostedBuff.cs b/src/Mooege/Core/GS/Powers/Implementations/General/ActorGhostedBuff.cs new file mode 100644 index 00000000..2776a142 --- /dev/null +++ b/src/Mooege/Core/GS/Powers/Implementations/General/ActorGhostedBuff.cs @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2012 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Net.GS.Message; + +namespace Mooege.Core.GS.Powers.Implementations +{ + [ImplementsPowerBuff(0)] + [ImplementsPowerSNO(224639)] + public class ActorGhostedBuff : PowerBuff + { + public override void Init() + { + base.Init(); + Timeout = WaitSeconds(5f); // TODO: find if this is defined anywhere + } + + public override bool Apply() + { + base.Apply(); + this.Target.Attributes[GameAttribute.Look_Override] = 0x0782CAC5; + return true; + } + + public override void Remove() + { + this.Target.Attributes[GameAttribute.Look_Override] = 0; + base.Remove(); + } + } +} diff --git a/src/Mooege/Core/GS/Powers/Implementations/General/CooldownBuff.cs b/src/Mooege/Core/GS/Powers/Implementations/General/CooldownBuff.cs new file mode 100644 index 00000000..961af9ef --- /dev/null +++ b/src/Mooege/Core/GS/Powers/Implementations/General/CooldownBuff.cs @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Core.GS.Ticker; +using Mooege.Net.GS.Message; + +namespace Mooege.Core.GS.Powers.Implementations +{ + [ImplementsPowerSNO(30176)] // Cooldown.pow + [ImplementsPowerBuff(0)] + public class CooldownBuff : PowerBuff + { + public int TargetPowerSNO; + private float? _seconds; + + public CooldownBuff(int targetPowerSNO, TickTimer timeout) + { + TargetPowerSNO = targetPowerSNO; + Timeout = timeout; + } + + public CooldownBuff(int targetPowerSNO, float seconds) + { + TargetPowerSNO = targetPowerSNO; + _seconds = seconds; + } + + public override void Init() + { + base.Init(); + if (_seconds.HasValue) + Timeout = WaitSeconds(_seconds.Value); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + + Target.Attributes[GameAttribute.Power_Cooldown_Start, TargetPowerSNO] = this.World.Game.TickCounter; + Target.Attributes[GameAttribute.Power_Cooldown, TargetPowerSNO] = this.Timeout.TimeoutTick; + Target.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + public override void Remove() + { + base.Remove(); + Target.Attributes[GameAttribute.Power_Cooldown_Start, TargetPowerSNO] = -1; + Target.Attributes[GameAttribute.Power_Cooldown, TargetPowerSNO] = -1; + Target.Attributes.BroadcastChangedIfRevealed(); + } + + public override bool Stack(Buff buff) + { + // multiple cooldowns of different target powers are allowed + // and multiple cooldowns on the same power should never happen + return false; + } + } +} diff --git a/src/Mooege/Core/GS/Powers/Implementations/General/KnockbackBuff.cs b/src/Mooege/Core/GS/Powers/Implementations/General/KnockbackBuff.cs new file mode 100644 index 00000000..f6e23546 --- /dev/null +++ b/src/Mooege/Core/GS/Powers/Implementations/General/KnockbackBuff.cs @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Net.GS.Message.Definitions.ACD; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Core.GS.Ticker; + +namespace Mooege.Core.GS.Powers.Implementations +{ + [ImplementsPowerSNO(70432)] // Knockback.pow + public class KnockbackBuff : Buff + { + public TickTimer ArrivalTime { get { return _mover.ArrivalTime; } } + + private float _magnitude; + private float _height; + private float _gravity; + private ActorMover _mover; + + public KnockbackBuff(float magnitude, float arcHeight = 3.0f, float arcGravity = -0.03f) + { + _magnitude = magnitude; + _height = arcHeight; + _gravity = arcGravity; + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + + Vector3D destination = PowerMath.TranslateDirection2D(User.Position, Target.Position, + _magnitude < 0f ? User.Position : Target.Position, + (float)Math.Sqrt(Math.Abs(_magnitude))); + + _mover = new ActorMover(Target); + _mover.MoveArc(destination, _height, _gravity, new ACDTranslateArcMessage + { + Field3 = 0x2006, // wtf? + FlyingAnimationTagID = AnimationSetKeys.KnockBack.ID, + LandingAnimationTagID = AnimationSetKeys.KnockBackLand.ID, + PowerSNO = PowerSNO + }); + + return true; + } + + public override bool Update() + { + return _mover.Update(); + } + + public override bool Stack(Buff buff) + { + // not sure how knockbacks would be combined, so just swallow all knockback stacks for now + // updated stacked buff with mover so arrival time can be read for would-be-stacked buff. + ((KnockbackBuff)buff)._mover = _mover; + return true; + } + } +} diff --git a/src/Mooege/Core/GS/Powers/Implementations/General/LevelUp.cs b/src/Mooege/Core/GS/Powers/Implementations/General/LevelUp.cs new file mode 100644 index 00000000..9da2a922 --- /dev/null +++ b/src/Mooege/Core/GS/Powers/Implementations/General/LevelUp.cs @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using Mooege.Core.GS.Ticker; +using Mooege.Net.GS.Message; +using Mooege.Core.GS.Players; + +namespace Mooege.Core.GS.Powers.Implementations +{ + [ImplementsPowerSNO(85954)] //g_levelup.pow + public class LevelUpBlast : PowerScript + { + public override IEnumerable Run() + { + User.PlayEffectGroup(Player.LevelUpEffects[this.User.Attributes[GameAttribute.Level]]); + yield return WaitSeconds(0.6f); + WeaponDamage(GetEnemiesInRadius(User.Position, ScriptFormula(2)), ScriptFormula(0), DamageType.Physical); + yield break; + } + } +} \ No newline at end of file diff --git a/src/Mooege/Core/GS/Powers/Implementations/General/Melee.cs b/src/Mooege/Core/GS/Powers/Implementations/General/Melee.cs new file mode 100644 index 00000000..193cbc7d --- /dev/null +++ b/src/Mooege/Core/GS/Powers/Implementations/General/Melee.cs @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Core.GS.Skills; +using Mooege.Core.GS.Ticker; +using Mooege.Core.GS.Actors; +using Mooege.Net.GS.Message; + + +namespace Mooege.Core.GS.Powers.Implementations +{ + [ImplementsPowerSNO(30592)] // Weapon_Melee_Instant.pow + public class WeaponMeleeInstant : ActionTimedSkill + { + public override IEnumerable Main() + { + WeaponDamage(GetBestMeleeEnemy(), 1.00f, DamageType.Physical); + yield break; + } + + public override float GetActionSpeed() + { + // for some reason the formula for _Instant.pow does not multiply by 1.1 even though it should + // manually scale melee speed + return base.GetActionSpeed() * 1.1f; + } + } +} diff --git a/src/Mooege/Core/GS/Powers/Implementations/General/StatusDebuffs.cs b/src/Mooege/Core/GS/Powers/Implementations/General/StatusDebuffs.cs new file mode 100644 index 00000000..f8ea6c63 --- /dev/null +++ b/src/Mooege/Core/GS/Powers/Implementations/General/StatusDebuffs.cs @@ -0,0 +1,414 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Core.GS.Ticker; +using Mooege.Net.GS.Message; +using Mooege.Net.GS.Message.Definitions.Misc; +using Mooege.Core.GS.Players; + +namespace Mooege.Core.GS.Powers.Implementations +{ + public class SimpleBooleanStatusDebuff : PowerBuff + { + GameAttributeB _statusAttribute; + GameAttributeB _immuneCheckAttribute; + FloatingNumberMessage.FloatType? _floatMessage; + bool _immuneBlocked; + + public SimpleBooleanStatusDebuff(GameAttributeB statusAttribute, GameAttributeB immuneCheckAttribute, + FloatingNumberMessage.FloatType? floatMessage = null) + { + _statusAttribute = statusAttribute; + _immuneCheckAttribute = immuneCheckAttribute; + _floatMessage = floatMessage; + _immuneBlocked = false; + } + + public override void Init() + { + if (_immuneCheckAttribute != null) + _immuneBlocked = Target.Attributes[_immuneCheckAttribute]; + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + + if (_immuneBlocked) + return false; // TODO: play immune float message? + + Target.Attributes[_statusAttribute] = true; + Target.Attributes.BroadcastChangedIfRevealed(); + + if (_floatMessage != null) + { + if (User is Player) + { + (User as Player).InGameClient.SendMessage(new FloatingNumberMessage + { + ActorID = this.Target.DynamicID, + Type = _floatMessage.Value + }); + } + } + + return true; + } + + public override void Remove() + { + base.Remove(); + Target.Attributes[_statusAttribute] = false; + Target.Attributes.BroadcastChangedIfRevealed(); + } + + public override bool Stack(Buff buff) + { + if (((SimpleBooleanStatusDebuff)buff)._immuneBlocked) + return true; // swallow buff if it was blocked + + return base.Stack(buff); + } + } + + [ImplementsPowerSNO(103216)] // DebuffBlind.pow + [ImplementsPowerBuff(0)] + public class DebuffBlind : SimpleBooleanStatusDebuff + { + public DebuffBlind(TickTimer timeout) + : base(GameAttribute.Blind, GameAttribute.Immune_To_Blind, FloatingNumberMessage.FloatType.Blinded) + { + Timeout = timeout; + } + } + + [ImplementsPowerSNO(30195)] // DebuffChilled.pow + [ImplementsPowerBuff(0)] + public class DebuffChilled : SimpleBooleanStatusDebuff + { + public float Percentage; + + public DebuffChilled(float percentage, TickTimer timeout) + : base(GameAttribute.Chilled, null, null) + { + Percentage = percentage; + Timeout = timeout; + } + public override bool Apply() + { + if (!base.Apply()) + return false; + Target.Attributes[GameAttribute.Attacks_Per_Second_Percent] -= Percentage; + Target.Attributes[GameAttribute.Movement_Scalar_Reduction_Percent] += Percentage; + Target.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + public override void Remove() + { + base.Remove(); + Target.Attributes[GameAttribute.Attacks_Per_Second_Percent] += Percentage; + Target.Attributes[GameAttribute.Movement_Scalar_Reduction_Percent] -= Percentage; + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + + [ImplementsPowerSNO(101000)] // DebuffStunned.pow + [ImplementsPowerBuff(0)] + public class DebuffStunned : SimpleBooleanStatusDebuff + { + public DebuffStunned(TickTimer timeout) + : base(GameAttribute.Stunned, GameAttribute.Stun_Immune, FloatingNumberMessage.FloatType.Stunned) + { + Timeout = timeout; + } + } + + + + [ImplementsPowerSNO(101002)] // DebuffFeared.pow + [ImplementsPowerBuff(0)] + public class DebuffFeared : SimpleBooleanStatusDebuff + { + public DebuffFeared(TickTimer timeout) + : base(GameAttribute.Feared, GameAttribute.Fear_Immune, FloatingNumberMessage.FloatType.Feared) + { + Timeout = timeout; + } + } + + [ImplementsPowerSNO(101003)] // DebuffRooted.pow + [ImplementsPowerBuff(0)] + public class DebuffRooted : SimpleBooleanStatusDebuff + { + public DebuffRooted(TickTimer timeout) + : base(GameAttribute.IsRooted, GameAttribute.Root_Immune, FloatingNumberMessage.FloatType.Rooted) + { + Timeout = timeout; + } + //Seems there is no Rooted attribute.. so Stunned does the same thing. + public override bool Apply() + { + if (!base.Apply()) + return false; + Target.Attributes[GameAttribute.Stunned] = true; + Target.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + public override void Remove() + { + base.Remove(); + Target.Attributes[GameAttribute.Stunned] = false; + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + + + [ImplementsPowerSNO(100971)] // DebuffSlowed.pow + [ImplementsPowerBuff(0)] + public class DebuffSlowed : SimpleBooleanStatusDebuff + { + public float Percentage; + + public DebuffSlowed(float percentage, TickTimer timeout) + : base(GameAttribute.Slow, GameAttribute.Slowdown_Immune, FloatingNumberMessage.FloatType.Snared) + { + Percentage = percentage; + Timeout = timeout; + } + public override bool Apply() + { + if (!base.Apply()) + return false; + Target.Attributes[GameAttribute.Attacks_Per_Second_Percent] -= Percentage; + Target.Attributes[GameAttribute.Movement_Scalar_Reduction_Percent] += Percentage; + Target.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + public override void Remove() + { + base.Remove(); + Target.Attributes[GameAttribute.Attacks_Per_Second_Percent] += Percentage; + Target.Attributes[GameAttribute.Movement_Scalar_Reduction_Percent] -= Percentage; + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + + [ImplementsPowerBuff(0)] + public class DebuffFrozen : SimpleBooleanStatusDebuff + { + public DebuffFrozen(TickTimer timeout) + : base(GameAttribute.Frozen, GameAttribute.Freeze_Immune, FloatingNumberMessage.FloatType.Frozen) + { + Timeout = timeout; + } + } + //---------------------------------------------------------------------------------------------- + //These are Skill-Related Powers + [ImplementsPowerSNO(1755)] // SlowTimeDebuff.pow + [ImplementsPowerBuff(0)] + public class SlowTimeDebuff : SimpleBooleanStatusDebuff + { + public float Percentage; + + public SlowTimeDebuff(float percentage, TickTimer timeout) + : base(GameAttribute.Slow, GameAttribute.Slowdown_Immune, FloatingNumberMessage.FloatType.Snared) + { + Percentage = percentage; + Timeout = timeout; + } + public override bool Apply() + { + if (!base.Apply()) + return false; + //is my projectile speed correct? + Target.Attributes[GameAttribute.Projectile_Speed] += Target.Attributes[GameAttribute.Projectile_Speed] * 0.1f; + Target.Attributes[GameAttribute.Attacks_Per_Second_Percent] -= Percentage; + Target.Attributes[GameAttribute.Movement_Scalar_Reduction_Percent] += Percentage; + Target.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + public override void Remove() + { + base.Remove(); + Target.Attributes[GameAttribute.Projectile_Speed] += Target.Attributes[GameAttribute.Projectile_Speed] / 0.1f; + Target.Attributes[GameAttribute.Attacks_Per_Second_Percent] += Percentage; + Target.Attributes[GameAttribute.Movement_Scalar_Reduction_Percent] -= Percentage; + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + + //Wrong Section but i'm just gonna put it here. + [ImplementsPowerSNO(74499)] + [ImplementsPowerBuff(0)] + public class MovementBuff : PowerBuff + { + public float Percentage; + + public MovementBuff(float percentage, TickTimer timeout) + { + Percentage = percentage; + Timeout = timeout; + } + public override bool Apply() + { + if (!base.Apply()) + return false; + Target.Attributes[GameAttribute.Movement_Bonus_Run_Speed] += Percentage; + Target.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + public override void Remove() + { + base.Remove(); + Target.Attributes[GameAttribute.Movement_Bonus_Run_Speed] -= Percentage; + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + + [ImplementsPowerSNO(1769)] + [ImplementsPowerBuff(0)] + public class SpeedBuff : PowerBuff + { + public float Percentage; + + public SpeedBuff(float percentage, TickTimer timeout) + { + Percentage = percentage; + Timeout = timeout; + } + public override bool Apply() + { + if (!base.Apply()) + return false; + Target.Attributes[GameAttribute.Casting_Speed_Percent] += Percentage; + Target.Attributes[GameAttribute.Attacks_Per_Second_Percent] += Percentage; + Target.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + public override void Remove() + { + base.Remove(); + Target.Attributes[GameAttribute.Casting_Speed_Percent] -= Percentage; + Target.Attributes[GameAttribute.Attacks_Per_Second_Percent] -= Percentage; + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + [ImplementsPowerSNO(86991)] + [ImplementsPowerBuff(0)] + public class EnergyArmorPowers : PowerBuff + { + public EnergyArmorPowers(TickTimer timeout) + { + Timeout = timeout; + } + public override bool Apply() + { + if (!base.Apply()) + return false; + if (Rune_A > 0) + { + Target.Attributes[GameAttribute.Defense_Bonus_Percent] += ScriptFormula(1); + Target.Attributes[GameAttribute.Resource_Max_Bonus] -= ScriptFormula(2); + Target.Attributes[GameAttribute.Resistance] += ScriptFormula(4); + Target.Attributes.BroadcastChangedIfRevealed(); + } + if (Rune_B > 0) + { + Target.Attributes[GameAttribute.Defense_Bonus_Percent] += ScriptFormula(1); + Target.Attributes[GameAttribute.Resource_Max_Bonus] += ScriptFormula(6); + Target.Attributes.BroadcastChangedIfRevealed(); + } + if (Rune_E > 0) + { + Target.Attributes[GameAttribute.Defense_Bonus_Percent] += ScriptFormula(1); + Target.Attributes[GameAttribute.Resource_Max_Bonus] -= ScriptFormula(2); + Target.Attributes[GameAttribute.Precision_Bonus_Percent] += ScriptFormula(13); + Target.Attributes.BroadcastChangedIfRevealed(); + } + else + Target.Attributes[GameAttribute.Defense_Bonus_Percent] += ScriptFormula(1); + Target.Attributes[GameAttribute.Resource_Max_Bonus] -= ScriptFormula(2); + Target.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + public override void Remove() + { + base.Remove(); + if (Rune_A > 0) + { + Target.Attributes[GameAttribute.Defense_Bonus_Percent] -= ScriptFormula(1); + Target.Attributes[GameAttribute.Resource_Max_Bonus] += ScriptFormula(2); + Target.Attributes[GameAttribute.Resistance] -= ScriptFormula(4); + Target.Attributes.BroadcastChangedIfRevealed(); + } + if (Rune_B > 0) + { + Target.Attributes[GameAttribute.Defense_Bonus_Percent] -= ScriptFormula(1); + Target.Attributes[GameAttribute.Resource_Max_Bonus] -= ScriptFormula(6); + Target.Attributes.BroadcastChangedIfRevealed(); + } + if (Rune_E > 0) + { + Target.Attributes[GameAttribute.Defense_Bonus_Percent] -= ScriptFormula(1); + Target.Attributes[GameAttribute.Resource_Max_Bonus] += ScriptFormula(2); + Target.Attributes[GameAttribute.Precision_Bonus_Percent] -= ScriptFormula(13); + Target.Attributes.BroadcastChangedIfRevealed(); + } + else + Target.Attributes[GameAttribute.Defense_Bonus_Percent] -= ScriptFormula(1); + Target.Attributes[GameAttribute.Resource_Max_Bonus] += ScriptFormula(2); + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + [ImplementsPowerSNO(30680)] //blizzard.pow + [ImplementsPowerBuff(0)] + public class BlizzardPowers : PowerBuff + { + public BlizzardPowers(TickTimer timeout) + { + Timeout = timeout; + } + public override bool Apply() + { + if (!base.Apply()) + return false; + Target.Attributes[GameAttribute.Crit_Damage_Percent] += (int)ScriptFormula(9); + Target.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + public override void Remove() + { + base.Remove(); + Target.Attributes[GameAttribute.Crit_Damage_Percent] -= (int)ScriptFormula(9); + Target.Attributes.BroadcastChangedIfRevealed(); + } + } +} diff --git a/src/Mooege/Core/GS/Powers/Implementations/General/SummonedBuff.cs b/src/Mooege/Core/GS/Powers/Implementations/General/SummonedBuff.cs new file mode 100644 index 00000000..43f0c4de --- /dev/null +++ b/src/Mooege/Core/GS/Powers/Implementations/General/SummonedBuff.cs @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2012 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Net.GS.Message; +using Mooege.Common.MPQ.FileFormats; + +namespace Mooege.Core.GS.Powers.Implementations +{ + [ImplementsPowerSNO(30540)] + public class SummonedBuff : TimedBuff + { + public override void Init() + { + base.Init(); + Timeout = WaitSeconds(3f); // TODO: calculate this based on spawn animation length + } + + public override bool Apply() + { + base.Apply(); + + // lookup and play spawn animation, otherwise fail + if (this.Target.AnimationSet != null && this.Target.AnimationSet.TagExists(AnimationTags.Spawn)) + { + this.Target.PlayActionAnimation(this.Target.AnimationSet.GetAniSNO(AnimationTags.Spawn)); + return true; + } + else + { + return false; + } + } + } +} diff --git a/src/Mooege/Core/GS/Powers/Implementations/HeroSkills/Barbarian.cs b/src/Mooege/Core/GS/Powers/Implementations/HeroSkills/Barbarian.cs new file mode 100644 index 00000000..9d0f93ef --- /dev/null +++ b/src/Mooege/Core/GS/Powers/Implementations/HeroSkills/Barbarian.cs @@ -0,0 +1,2106 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Linq; +using System.Collections.Generic; +using Mooege.Core.GS.Actors; +using Mooege.Core.GS.Actors.Implementations.Minions; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Net.GS.Message.Definitions.ACD; +using Mooege.Core.GS.Common.Types.Misc; +using Mooege.Core.GS.Ticker; +using Mooege.Net.GS.Message; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Core.GS.Powers.Payloads; + +namespace Mooege.Core.GS.Powers.Implementations +{ + //Complete, Rune_E is a capsule radius/dist, I use beam direction. + #region Bash + [ImplementsPowerSNO(Skills.Skills.Barbarian.FuryGenerators.Bash)] + public class BarbarianBash : Skill + { + public override IEnumerable Main() + { + bool hitAnything = false; + var ShockWavePos = PowerMath.TranslateDirection2D(User.Position, TargetPosition, + User.Position, + ScriptFormula(23)); + var maxHits = ScriptFormula(1); + for (int i = 0; i < maxHits; ++i) + { + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetBestMeleeEnemy(); + + if (i == 0) + attack.AddWeaponDamage(ScriptFormula(3), DamageType.Physical); + else + attack.AddWeaponDamage(ScriptFormula(12), DamageType.Physical); + + attack.OnHit = hitPayload => + { + hitAnything = true; + if (Rune_D > 0) + { + GeneratePrimaryResource(ScriptFormula(10)); + } + if (Rune_B > 0) + { + AddBuff(User, new AddDamageBuff()); + } + + if (Rune_A > 0) + { + } + else if (Rune_C > 0) + { + if (Rand.NextDouble() < ScriptFormula(14)) + AddBuff(hitPayload.Target, new DebuffStunned(WaitSeconds(ScriptFormula(15)))); + } + else + { + if (Rand.NextDouble() < ScriptFormula(0)) + Knockback(hitPayload.Target, ScriptFormula(5), ScriptFormula(6), ScriptFormula(7)); + } + }; + attack.Apply(); + yield return WaitSeconds(ScriptFormula(13)); + + if (hitAnything) + GeneratePrimaryResource(EvalTag(PowerKeys.ResourceGainedOnFirstHit)); + } + //Shockwave -> capsule distance, at the moment using beamdirection + if (Rune_E > 0) + { + User.PlayEffectGroup(93867); + yield return WaitSeconds(0.5f); + WeaponDamage(GetEnemiesInBeamDirection(ShockWavePos, TargetPosition, 30f, 8f), ScriptFormula(18), DamageType.Physical); + } + yield break; + } + + public override float GetContactDelay() + { + // seems to need this custom speed for all attacks + return ScriptFormula(13); + } + + [ImplementsPowerBuff(0, true)] + public class AddDamageBuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(11)); + MaxStackCount = (int)ScriptFormula(4); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + _AddDamage(); + return true; + } + + public override bool Stack(Buff buff) + { + bool stacked = StackCount < MaxStackCount; + + base.Stack(buff); + + if (stacked) + _AddDamage(); + + return true; + } + + public override void Remove() + { + base.Remove(); + User.Attributes[GameAttribute.Damage_Bonus_Min] -= StackCount * ScriptFormula(2); + User.Attributes.BroadcastChangedIfRevealed(); + + } + + private void _AddDamage() + { + User.Attributes[GameAttribute.Damage_Bonus_Min] += ScriptFormula(2); + User.Attributes.BroadcastChangedIfRevealed(); + } + } + } + #endregion + + //Complete:Check + #region LeapAttack + [ImplementsPowerSNO(Skills.Skills.Barbarian.FuryGenerators.LeapAttack)] + public class BarbarianLeap : Skill + { + //there is a changed walking speed multiplier from 8101 patch. + public override IEnumerable Main() + { + if (!User.World.CheckLocationForFlag(TargetPosition, Mooege.Common.MPQ.FileFormats.Scene.NavCellFlags.AllowWalk)) + yield break; + bool hitAnything = false; + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + + if (Rune_C > 0) + { + AttackPayload launch = new AttackPayload(this); + launch.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(31)); + launch.AddWeaponDamage(ScriptFormula(30), DamageType.Physical); + launch.OnHit = hitPayload => + { + hitAnything = true; + }; + launch.Apply(); + User.PlayEffectGroup(165924); //Not sure if this is the only effect to be displayed in this case + } + + ActorMover mover = new ActorMover(User); + mover.MoveArc(TargetPosition, 10, -0.1f, new ACDTranslateArcMessage + { + //Field3 = 303110, // used for male barb leap, not needed? + FlyingAnimationTagID = AnimationSetKeys.Attack2.ID, + LandingAnimationTagID = -1, + PowerSNO = PowerSNO + }); + + // wait for landing + while (!mover.Update()) + yield return WaitTicks(1); + + // extra wait for leap to finish + yield return WaitTicks(1); + + if (Rune_D > 0) + { + AddBuff(User, new LeapAttackArmorBuff()); + } + + // ground smash effect + User.PlayEffectGroup(162811); + + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(TargetPosition, ScriptFormula(0)); + //ScriptFormula(1) states "% of willpower Damage", perhaps the damage should be calculated that way instead. + attack.AddWeaponDamage(0.70f, DamageType.Physical); + attack.OnHit = hitPayload => + { + hitAnything = true; + if (Rune_E > 0) + { + if (Rand.NextDouble() < ScriptFormula(37)) + { + AddBuff(hitPayload.Target, new DebuffStunned(WaitSeconds(ScriptFormula(38)))); + } + } + }; + attack.Apply(); + + if (hitAnything) + GeneratePrimaryResource(EvalTag(PowerKeys.ResourceGainedOnFirstHit)); + + //TODO: Eventually att visuals, and check if the current uber-drag is really intended :P + if (Rune_A > 0) + { + TargetList targets = GetEnemiesInRadius(User.Position, ScriptFormula(3)); + Actor curTarget; + int affectedTargets = 0; + while (affectedTargets < ScriptFormula(12)) //SF(11) states "Min number to Knockback", and is 5, what can that mean? + { + curTarget = targets.GetClosestTo(User.Position); + if (curTarget != null) + { + targets.Actors.Remove(curTarget); + + if (curTarget.World != null) + { + Knockback(curTarget, ScriptFormula(8), ScriptFormula(9), ScriptFormula(10)); + } + affectedTargets++; + } + else + { + break; + } + } + } + + if (Rune_B > 0) + { + TargetList targets = GetEnemiesInRadius(User.Position, ScriptFormula(3)); + foreach (Actor curTarget in targets.Actors) + { + Knockback(curTarget, ScriptFormula(17), ScriptFormula(18), ScriptFormula(19)); + var secondKnockBack = GetEnemiesInRadius(curTarget.Position, 1f); // this will hackfully check for collision + if (secondKnockBack.Actors.Count > 1) + { + foreach (Actor secondaryTarget in GetEnemiesInRadius(curTarget.Position, ScriptFormula(23)).Actors) + { + Knockback(secondaryTarget, ScriptFormula(24), ScriptFormula(25), ScriptFormula(26)); + var thirdKnockBack = GetEnemiesInRadius(secondaryTarget.Position, 1f); + if (thirdKnockBack.Actors.Count > 1) + { + foreach (Actor thirdTarget in GetEnemiesInRadius(secondaryTarget.Position, ScriptFormula(23)).Actors) + { + Knockback(thirdTarget, ScriptFormula(24), ScriptFormula(25), ScriptFormula(26)); + } + } + } + } + } + } + yield break; + } + [ImplementsPowerBuff(2)] + class LeapAttackArmorBuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(36)); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + + User.Attributes[GameAttribute.Armor_Bonus_Percent] += ScriptFormula(33); + User.Attributes.BroadcastChangedIfRevealed(); + + return true; + } + + public override void Remove() + { + base.Remove(); + + User.Attributes[GameAttribute.Armor_Bonus_Percent] -= ScriptFormula(33); + User.Attributes.BroadcastChangedIfRevealed(); + } + } + } + #endregion + + //TODO: Runes_E + #region WhirlWind + [ImplementsPowerSNO(Skills.Skills.Barbarian.FurySpenders.Whirlwind)] + public class BarbarianWhirlwind : Skill + { + public override IEnumerable Main() + { + AddBuff(User, new WhirlwindEffect()); + yield break; + } + + [ImplementsPowerBuff(0)] + public class WhirlwindEffect : PowerBuff + { + private TickTimer _damageTimer; + private TickTimer _tornadoSpawnTimer; + + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(0)); + } + + //This needs to be added into whirlwind, because your walking speed does become slower once whirlwind is active. + public override bool Apply() + { + if (!base.Apply()) + return false; + User.Attributes[GameAttribute.Walking_Rate_Total] = User.Attributes[GameAttribute.Walking_Rate_Total] * EvalTag(PowerKeys.WalkingSpeedMultiplier); + User.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + public override void Remove() + { + base.Remove(); + User.Attributes[GameAttribute.Walking_Rate_Total] = User.Attributes[GameAttribute.Walking_Rate_Total] / EvalTag(PowerKeys.WalkingSpeedMultiplier); + User.Attributes.BroadcastChangedIfRevealed(); + } + + public override bool Update() + { + if (base.Update()) + return true; + + if (_damageTimer == null || _damageTimer.TimedOut) + { + _damageTimer = WaitSeconds(ScriptFormula(0)); + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + //TODO: THIS is where Rune_E goes. On Crit Hits, restores some HP. + + WeaponDamage(GetEnemiesInRadius(User.Position, ScriptFormula(2)), + ScriptFormula(1), Rune_A > 0 ? DamageType.Fire : DamageType.Physical); + } + + if (Rune_B > 0) + { + // spawn tornado projectiles in random directions every timed period + if (_tornadoSpawnTimer == null) + _tornadoSpawnTimer = WaitSeconds(ScriptFormula(5)); + + if (_tornadoSpawnTimer.TimedOut) + { + _tornadoSpawnTimer = WaitSeconds(ScriptFormula(5)); + + var tornado = new Projectile(this, 162386, User.Position); + tornado.Timeout = WaitSeconds(3f); + tornado.OnCollision = (hit) => + { + WeaponDamage(hit, ScriptFormula(6), DamageType.Physical); + }; + tornado.Launch(new Vector3D(User.Position.X + (float)Rand.NextDouble() - 0.5f, + User.Position.Y + (float)Rand.NextDouble() - 0.5f, + User.Position.Z), 0.25f); + } + } + + return false; + } + } + } + #endregion + + //Complete:Check + #region AncientSpear + [ImplementsPowerSNO(Skills.Skills.Barbarian.FuryGenerators.AncientSpear)] + public class BarbarianAncientSpear : Skill + { + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + bool hitAnything = false; + + if (Rune_B > 0) + { + Vector3D[] projDestinations = PowerMath.GenerateSpreadPositions(User.Position, TargetPosition, ScriptFormula(9) / 5f, (int)ScriptFormula(11)); + + for (int i = 0; i < projDestinations.Length; i++) + { + var proj = new Projectile(this, 161891, User.Position); + proj.Scale = 3f; + proj.Timeout = WaitSeconds(0.5f); + proj.OnCollision = (hit) => + { + hitAnything = true; + _setupReturnProjectile(hit.Position); + + AttackPayload attack = new AttackPayload(this); + attack.SetSingleTarget(hit); + attack.AddWeaponDamage(ScriptFormula(0), DamageType.Physical); + attack.OnHit = (hitPayload) => + { + hitPayload.Target.PlayEffectGroup(79420); + Knockback(hitPayload.Target, -25f, ScriptFormula(3), ScriptFormula(4)); + }; + attack.Apply(); + + proj.Destroy(); + }; + proj.OnTimeout = () => + { + _setupReturnProjectile(proj.Position); + }; + + proj.Launch(projDestinations[i], ScriptFormula(8)); + User.AddRopeEffect(79402, proj); + } + } + else if (Rune_E > 0) + { + Vector3D[] projDestinations = PowerMath.GenerateSpreadPositions(User.Position, TargetPosition, ScriptFormula(9) / 5f, (int)ScriptFormula(11)); + + for (int i = 0; i < projDestinations.Length; i++) + { + var proj = new Projectile(this, 161894, User.Position); + proj.Scale = 3f; + proj.Timeout = WaitSeconds(0.5f); + proj.OnCollision = (hit) => + { + hitAnything = true; + + _setupReturnProjectile(hit.Position); + + AttackPayload attack = new AttackPayload(this); + attack.SetSingleTarget(hit); + attack.AddWeaponDamage(ScriptFormula(0), DamageType.Physical); + attack.OnHit = (hitPayload) => + { + hitPayload.Target.PlayEffectGroup(79420); + Knockback(hitPayload.Target, 25f, ScriptFormula(3), ScriptFormula(4)); + }; + attack.Apply(); + + proj.Destroy(); + }; + proj.OnTimeout = () => + { + _setupReturnProjectile(proj.Position); + }; + + proj.Launch(projDestinations[i], ScriptFormula(8)); + User.AddRopeEffect(79402, proj); + } + } + else if (Rune_A > 0) + { + var projectile = new Projectile(this, 161890, User.Position); + projectile.Scale = 3f; + projectile.Timeout = WaitSeconds(0.5f); + projectile.OnCollision = (hit) => + { + hitAnything = true; + + _setupReturnProjectile(hit.Position); + + AttackPayload attack = new AttackPayload(this); + attack.SetSingleTarget(hit); + attack.AddWeaponDamage(ScriptFormula(0), DamageType.Physical); + attack.OnHit = (hitPayload) => + { + for (int i = 0; i < ScriptFormula(17); ++i) + { + hitPayload.Target.PlayEffectGroup(79420); + Knockback(hitPayload.Target, -25f, ScriptFormula(3), ScriptFormula(4)); + } + }; + attack.Apply(); + + }; + projectile.OnTimeout = () => + { + _setupReturnProjectile(projectile.Position); + }; + + projectile.Launch(TargetPosition, ScriptFormula(8)); + User.AddRopeEffect(79402, projectile); + } + else + { + var projectile = new Projectile(this, RuneSelect(74636, -1, -1, 161892, 161893, -1), User.Position); + projectile.Scale = 3f; + projectile.Timeout = WaitSeconds(0.5f); + projectile.OnCollision = (hit) => + { + hitAnything = true; + + _setupReturnProjectile(hit.Position); + + AttackPayload attack = new AttackPayload(this); + attack.SetSingleTarget(hit); + attack.AddWeaponDamage(ScriptFormula(0), DamageType.Physical); + attack.OnHit = (hitPayload) => + { + // GET OVER HERE + //unknown on magnitude/knockback offset? + hitPayload.Target.PlayEffectGroup(79420); + Knockback(hitPayload.Target, -25f, ScriptFormula(3), ScriptFormula(4)); + if (Rune_C > 0) + { + float healMe = ScriptFormula(10) * hitPayload.TotalDamage; + //User.Attributes[GameAttribute.Hitpoints_Granted] = healMe; + //User.Attributes.BroadcastChangedIfRevealed(); + } + }; + attack.Apply(); + + projectile.Destroy(); + }; + projectile.OnTimeout = () => + { + _setupReturnProjectile(projectile.Position); + }; + + projectile.Launch(TargetPosition, ScriptFormula(8)); + User.AddRopeEffect(79402, projectile); + } + + if (hitAnything) + GeneratePrimaryResource(EvalTag(PowerKeys.ResourceGainedOnFirstHit)); + + yield break; + } + + private void _setupReturnProjectile(Vector3D spawnPosition) + { + Vector3D inFrontOfUser = PowerMath.TranslateDirection2D(User.Position, spawnPosition, User.Position, 5f); + + var return_proj = new Projectile(this, 79400, new Vector3D(spawnPosition.X, spawnPosition.Y, User.Position.Z)); + return_proj.Scale = 3f; + return_proj.DestroyOnArrival = true; + return_proj.LaunchArc(inFrontOfUser, 1f, -0.03f); + User.AddRopeEffect(79402, return_proj); + } + } + #endregion + + //TODO: A,C + #region ThreateningShout + [ImplementsPowerSNO(Skills.Skills.Barbarian.FurySpenders.ThreateningShout)] + public class ThreateningShout : Skill + { + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + foreach (Actor enemy in GetEnemiesInRadius(User.Position, ScriptFormula(9)).Actors) + { + AddBuff(enemy, new ShoutDeBuff()); + if (Rune_D > 0) + { + AddBuff(enemy, new ShoutAttackDeBuff()); + } + if (Rune_A > 0) + { + //Script(8) -> taunt duration + //taunted to attack you... guess more for multiple player... + } + if (Rune_C > 0) + { + if (Rand.NextDouble() < ScriptFormula(7)) + { + /*attack.OnDeath = (dead) => + { + //dead.Target + //Drop another random loot :) + };*/ + } + } + if (Rune_E > 0) + { + //Script(10) -> Fear Death Effect Duration? what is this for.. + if (Rand.NextDouble() < ScriptFormula(3)) + { + AddBuff(enemy, new DebuffFeared(WaitSeconds(Rand.Next((int)ScriptFormula(5), (int)ScriptFormula(5) + (int)ScriptFormula(6))))); + } + } + } + + yield break; + } + [ImplementsPowerBuff(0)] + public class ShoutDeBuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(2)); + } + public override bool Apply() + { + if (!base.Apply()) + return false; + Target.Attributes[GameAttribute.Damage_Done_Reduction_Percent] += ScriptFormula(0); + if (Rune_B > 0) + { + Target.Attributes[GameAttribute.Movement_Scalar_Reduction_Percent] += ScriptFormula(14); + } + Target.Attributes.BroadcastChangedIfRevealed(); + return true; + } + public override void Remove() + { + base.Remove(); + Target.Attributes[GameAttribute.Damage_Done_Reduction_Percent] -= ScriptFormula(0); + if (Rune_B > 0) + { + Target.Attributes[GameAttribute.Movement_Scalar_Reduction_Percent] -= ScriptFormula(14); + } + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + [ImplementsPowerBuff(4)] + public class ShoutAttackDeBuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(17)); + } + public override bool Apply() + { + if (!base.Apply()) + return false; + Target.Attributes[GameAttribute.Attacks_Per_Second_Percent] += ScriptFormula(4); + Target.Attributes.BroadcastChangedIfRevealed(); + return true; + } + public override void Remove() + { + base.Remove(); + Target.Attributes[GameAttribute.Attacks_Per_Second_Percent] -= ScriptFormula(4); + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + + } + #endregion + + //TODO: Rune_D + #region HammerOfTheAncients + [ImplementsPowerSNO(Skills.Skills.Barbarian.FurySpenders.HammerOfTheAncients)] + public class HammerOfTheAncients : Skill + { + public override IEnumerable Main() + { + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + if (Rune_B > 0) + { + + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInArcDirection(User.Position, TargetPosition, ScriptFormula(14), ScriptFormula(15)); + attack.AddWeaponDamage(ScriptFormula(23), DamageType.Physical); + attack.Apply(); + yield break; + } + else + { + TargetPosition = PowerMath.TranslateDirection2D(User.Position, TargetPosition, User.Position, ScriptFormula(11)); + + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(TargetPosition, ScriptFormula(11)); + attack.AddWeaponDamage(ScriptFormula(4), DamageType.Physical); + attack.OnHit = hitPayload => + { + if (Rune_D > 0) + { + if (hitPayload.IsCriticalHit) + { + if (Rand.NextDouble() < ScriptFormula(5)) + { + //drop treasure or health globes. + } + } + } + if (Rune_C > 0) + { + AddBuff(hitPayload.Target, new DebuffSlowed(ScriptFormula(8), WaitSeconds(ScriptFormula(10)))); + } + }; + attack.OnDeath = DeathPayload => + { + if (Rune_E > 0) + { + //if (DeathPayload.Target)? Doesn't above handle this? + { + if (Rand.NextDouble() < ScriptFormula(16)) + { + AttackPayload Stunattack = new AttackPayload(this); + Stunattack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(18)); + Stunattack.OnHit = stun => + { + AddBuff(stun.Target, new DebuffStunned(WaitSeconds(ScriptFormula(17)))); + }; + Stunattack.Apply(); + } + } + } + }; + attack.Apply(); + + if (Rune_C > 0) + { + var QuakeHammer = SpawnEffect(159030, User.Position, 0, WaitSeconds(ScriptFormula(10))); + QuakeHammer.UpdateDelay = 1f; + QuakeHammer.OnUpdate = () => + { + AttackPayload TremorAttack = new AttackPayload(this); + TremorAttack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(7)); + TremorAttack.AddWeaponDamage(ScriptFormula(9), DamageType.Physical); + TremorAttack.Apply(); + }; + } + } + yield break; + } + } + #endregion + + //TODO: just needs attribute check/crit/timer + #region BattleRage + [ImplementsPowerSNO(Skills.Skills.Barbarian.FurySpenders.BattleRage)] + public class BattleRage : Skill + { + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + AddBuff(User, new BattleRageEffect()); + + yield break; + } + + [ImplementsPowerBuff(0)] + public class BattleRageEffect : PowerBuff + { + public override void Init() + { + //todo: allow the addition of more seconds from Rune_B with a max of 600 seconds. + Timeout = WaitSeconds(ScriptFormula(0)); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + //Rune_A + //Total Damage Bonus + User.Attributes[GameAttribute.Damage_Weapon_Percent_Bonus] += ScriptFormula(1); + + //Crit Chance Bonus + User.Attributes[GameAttribute.Crit_Damage_Percent] += (int)ScriptFormula(2); + User.Attributes.BroadcastChangedIfRevealed(); + + return true; + } + + public override void OnPayload(Payload payload) + { + if (payload is HitPayload && Target.Equals(payload.Context.User)) + { + //if (payload.IsCriticalHit) + { + if (Rune_B > 0) + { + if (Rand.NextDouble() < ScriptFormula(5)) + { + //ScriptFormula(4) -> extends duration + } + } + if (Rune_C > 0) + { + //or ScriptFormula(15) + if (Rand.NextDouble() < ScriptFormula(6)) + { + //drop additional health globes. + } + } + if (Rune_D > 0) + { + GeneratePrimaryResource(ScriptFormula(3)); + } + if (Rune_E > 0) + { + User.PlayEffectGroup(210321); + WeaponDamage(GetEnemiesInRadius(User.Position, ScriptFormula(9)), ScriptFormula(10), DamageType.Physical); + } + } + } + } + public override void Remove() + { + base.Remove(); + //Total Damage Bonus + User.Attributes[GameAttribute.Damage_Weapon_Percent_Bonus] -= ScriptFormula(1); + + //Crit Chance Bonus + User.Attributes[GameAttribute.Crit_Damage_Percent] -= (int)ScriptFormula(2); + User.Attributes.BroadcastChangedIfRevealed(); + } + } + } + #endregion + + //Complete:Check + #region Cleave + [ImplementsPowerSNO(Skills.Skills.Barbarian.FuryGenerators.Cleave)] + public class Cleave : Skill + { + public override IEnumerable Main() + { + bool hitAnything = false; + WeaponDamage(GetBestMeleeEnemy(), ScriptFormula(16), DamageType.Physical); + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInArcDirection(User.Position, TargetPosition, ScriptFormula(27), ScriptFormula(26)); + attack.AddWeaponDamage(ScriptFormula(16), DamageType.Physical); + attack.OnHit = hitPayload => + { + hitAnything = true; + if (Rune_B > 0) + { + foreach (Actor enemy in GetEnemiesInArcDirection(User.Position, TargetPosition, ScriptFormula(27), ScriptFormula(26)).Actors) + { + //Snare Duration = SF(14) + //Snare Magnitude = SF(20) + } + } + if (Rune_C > 0) + { + if (hitPayload.IsCriticalHit) + { + Knockback(hitPayload.Target, ScriptFormula(2), ScriptFormula(3)); + + //since its a max number of knockback jumps, but its UP TO that number, we will randomize it. + int Jumps = Rand.Next((int)ScriptFormula(25)); + for (int i = 0; i < Jumps; ++i) + { + WeaponDamage(hitPayload.Target, ScriptFormula(9), DamageType.Physical); + Knockback(hitPayload.Target, ScriptFormula(7), ScriptFormula(8)); + } + } + } + if (Rune_D > 0) + { + //todo: is this right? + int StackCount = 0; + if (StackCount < ScriptFormula(23) + 1) + { + StackCount++; + } + + GeneratePrimaryResource(ScriptFormula(22) * StackCount); + } + if (Rune_E > 0) + { + //this doesnt work either. + attack.OnDeath = DeathPayload => + { + if (Rand.NextDouble() < ScriptFormula(12)) + { + AttackPayload explode = new AttackPayload(this); + explode.Targets = GetEnemiesInRadius(DeathPayload.Target.Position, ScriptFormula(6)); + explode.AddWeaponDamage(ScriptFormula(4), DamageType.Physical); + explode.Apply(); + } + }; + } + }; + attack.Apply(); + + if (hitAnything) + GeneratePrimaryResource(EvalTag(PowerKeys.ResourceGainedOnFirstHit)); + + yield break; + } + } + #endregion + + //TODO: Concept written, needs review for A & E + #region IgnorePain + [ImplementsPowerSNO(Skills.Skills.Barbarian.Situational.IgnorePain)] + public class IgnorePain : Skill + { + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + AddBuff(User, new IgnorePainBuff()); + if (Rune_C > 0) + { + foreach (Actor ally in GetAlliesInRadius(User.Position, ScriptFormula(4)).Actors) + AddBuff(ally, new ObsidianAlliesBuff()); + } + yield break; + } + + [ImplementsPowerBuff(0)] + public class IgnorePainBuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(0)); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + User.Attributes[GameAttribute.Damage_Percent_Reduction_From_Melee] += Convert.ToInt32(ScriptFormula(10)); + User.Attributes[GameAttribute.Damage_Percent_Reduction_From_Ranged] += Convert.ToInt32(ScriptFormula(10)); + Target.Attributes.BroadcastChangedIfRevealed(); + if (Rune_D > 0) + { + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(8)); + attack.AddWeaponDamage(ScriptFormula(11), DamageType.Physical); + attack.OnHit = hitPayload => + { + Knockback(hitPayload.Target, ScriptFormula(6), ScriptFormula(7)); + }; + attack.Apply(); + } + return true; + } + + //OnPayload -> Rune_E + //Calculate Hit Total from mob and + //float healMe = ScriptFormula(1) * hitPayload.TotalDamage; + //User.Attributes[GameAttribute.Hitpoints_Granted] = healMe; + //User.Attributes.BroadcastChangedIfRevealed(); + + //OnPayload -> Rune_A + //float reflectBack = ScriptFormula(9) * hitPayload.TotalDamage; + //WeaponDamage(hitPayload.Target, reflectBack, DamageType.Physical); + + + + public override void Remove() + { + base.Remove(); + User.Attributes[GameAttribute.Damage_Percent_Reduction_From_Melee] -= Convert.ToInt32(ScriptFormula(10)); + User.Attributes[GameAttribute.Damage_Percent_Reduction_From_Ranged] -= Convert.ToInt32(ScriptFormula(10)); + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + [ImplementsPowerBuff(1)] + public class ObsidianAlliesBuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(3)); + } + public override bool Apply() + { + if (!base.Apply()) + return false; + + Target.Attributes[GameAttribute.Damage_Percent_Reduction_From_Melee] -= Convert.ToInt32(ScriptFormula(10)); + Target.Attributes[GameAttribute.Damage_Percent_Reduction_From_Ranged] -= Convert.ToInt32(ScriptFormula(10)); + Target.Attributes.BroadcastChangedIfRevealed(); + + + return true; + } + + public override void Remove() + { + base.Remove(); + + Target.Attributes[GameAttribute.Damage_Percent_Reduction_From_Melee] -= Convert.ToInt32(ScriptFormula(10)); + Target.Attributes[GameAttribute.Damage_Percent_Reduction_From_Ranged] -= Convert.ToInt32(ScriptFormula(10)); + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + } + #endregion + + //TODO: Rune_B | Rune_E -> Figure Out TeamID + #region WeaponThrow + [ImplementsPowerSNO(Skills.Skills.Barbarian.FurySpenders.WeaponThrow)] + public class WeaponThrow : Skill + { + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + if (Rune_B > 0) + { + //throw projectile -> once collision with target, RopeEffect up to ScriptFromula(5) times. + } + else + { + var proj = new Projectile(this, RuneSelect(100800, 100839, 166438, 100832, 101057, 100934), User.Position); + proj.Position.Z += 5f; // fix height + proj.OnCollision = (hit) => + { + hit.PlayEffectGroup(RuneSelect(18707, 166333, 16634, 166335, -1, 166339)); + WeaponDamage(hit, ScriptFormula(15), DamageType.Physical); + if (Rune_C > 0) + { + if (Rand.NextDouble() < ScriptFormula(0)) + { + AddBuff(hit, new DebuffStunned(WaitSeconds(ScriptFormula(7)))); + } + } + if (Rune_D > 0) + { + float CurrentResource = User.Attributes[GameAttribute.Resource_Cur]; + //Use remaining Fury points. Get Remaining Fury Points, use that to multiply against SF(18), and add that to total damage. + float DamageTotal = ScriptFormula(15) + (ScriptFormula(18) * CurrentResource); + + WeaponDamage(GetEnemiesInRadius(hit.Position, ScriptFormula(19)), DamageTotal, DamageType.Physical); + } + if (Rune_E > 0) + { + if (Rand.NextDouble() < 1) + { + AddBuff(hit, new ConfuseDebuff()); + //This will cause a buff on the target hit, changing their attack from the User, to other Mobs. + } + } + proj.Destroy(); + }; + proj.Launch(TargetPosition, 1.5f); + } + yield break; + } + [ImplementsPowerBuff(0)] + public class ConfuseDebuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(10)); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + Target.Attributes[GameAttribute.TeamID] = 0; + Target.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + public override void Remove() + { + base.Remove(); + Target.Attributes[GameAttribute.TeamID] = 0; + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + } + #endregion + + //Complete:Check + #region GroundStomp + [ImplementsPowerSNO(Skills.Skills.Barbarian.FuryGenerators.GroundStomp)] + public class GroundStomp : Skill + { + public override IEnumerable Main() + { + bool hitAnything = false; + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + + User.PlayEffectGroup(RuneSelect(18685, 99685, 159415, 159416, 159397, 18685)); + //Rune_E -> when stun wears off, use slow.efg + + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(0)); + attack.AddWeaponDamage(ScriptFormula(6), DamageType.Physical); + attack.OnHit = hitPayload => + { + hitAnything = true; + if (Rune_B > 0) + { + //push em away! + Knockback(hitPayload.Target, ScriptFormula(13), ScriptFormula(14)); + } + if (Rune_C > 0) + { + //bring em in! + Knockback(hitPayload.Target, ScriptFormula(11), ScriptFormula(12)); + } + AddBuff(hitPayload.Target, new GroundStompStun()); + }; + attack.Apply(); + if (hitAnything) + GeneratePrimaryResource(EvalTag(PowerKeys.ResourceGainedOnFirstHit) + ScriptFormula(19)); + + yield break; + } + [ImplementsPowerBuff(0)] + public class GroundStompStun : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(1)); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + + new DebuffStunned(WaitSeconds(ScriptFormula(1))); + + return true; + } + + public override void Remove() + { + base.Remove(); + if (Rune_E > 0) + { + new GroundStompSlow(); + } + } + } + [ImplementsPowerBuff(0)] + public class GroundStompSlow : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(4)); + Target.PlayEffectGroup(159418); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + Target.Attributes[GameAttribute.Slow] = true; + Target.Attributes[GameAttribute.Movement_Scalar_Reduction_Percent] += ScriptFormula(5); + Target.Attributes.BroadcastChangedIfRevealed(); + + return true; + } + + public override void Remove() + { + base.Remove(); + Target.Attributes[GameAttribute.Slow] = false; + Target.Attributes[GameAttribute.Movement_Scalar_Reduction_Percent] -= ScriptFormula(5); + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + } + #endregion + + //Complete:Check + #region Rend + [ImplementsPowerSNO(Skills.Skills.Barbarian.FurySpenders.Rend)] + public class Rend : Skill + { + public override IEnumerable Main() + { + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(4)); + attack.OnHit = hitPayload => + { + AddBuff(hitPayload.Target, new RendDebuff()); + if (Rune_D > 0) + { + float healMe = ScriptFormula(8) * hitPayload.TotalDamage; + //User.Attributes[GameAttribute.Hitpoints_Granted] = healMe; + //User.Attributes.BroadcastChangedIfRevealed(); + } + }; + //this work? if it dies with rend debuff, infect others. + attack.OnDeath = DeathPayload => + { + if (AddBuff(Target, new RendDebuff())) + { + AttackPayload BleedAgain = new AttackPayload(this); + BleedAgain.Targets = GetEnemiesInRadius(Target.Position, ScriptFormula(19)); + BleedAgain.OnHit = hitPayload2 => + { + AddBuff(hitPayload2.Target, new RendDebuff()); + }; + BleedAgain.Apply(); + } + }; + attack.Apply(); + yield break; + } + [ImplementsPowerBuff(0, true)] + public class RendDebuff : PowerBuff + { + const float _damageRate = 1f; + TickTimer _damageTimer = null; + + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(5)); + MaxStackCount = (int)ScriptFormula(10); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + if (Rand.NextDouble() < ScriptFormula(9)) + { + //for rend, would we just stack updates? + Update(); + } + return true; + } + public override bool Update() + { + if (base.Update()) + return true; + if (_damageTimer == null || _damageTimer.TimedOut) + { + _damageTimer = WaitSeconds(_damageRate); + if (Rune_E > 0) + { + WeaponDamage(Target, ScriptFormula(7), DamageType.Physical); + } + else + WeaponDamage(Target, ScriptFormula(20), DamageType.Physical); + } + return false; + } + + public override bool Stack(Buff buff) + { + bool stacked = StackCount < MaxStackCount; + + base.Stack(buff); + + if (stacked) + Update(); + + return true; + } + + public override void Remove() + { + base.Remove(); + + } + } + } + #endregion + + //Complete:Check + #region Frenzy + [ImplementsPowerSNO(Skills.Skills.Barbarian.FuryGenerators.Frenzy)] + public class Frenzy : Skill + { + public override IEnumerable Main() + { + bool hitAnything = false; + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetBestMeleeEnemy(); + attack.AddWeaponDamage(2f, DamageType.Physical); + attack.OnHit = hitPayload => + { + hitAnything = true; + AddBuff(User, new FrenzyBuff()); + if (Rune_C > 0) + { + AddBuff(User, new ObsidianSpeedEffect()); + } + if (Rune_B > 0) + { + if (Rand.NextDouble() < ScriptFormula(17)) + { + Actor target = GetEnemiesInRadius(User.Position, 15f).GetClosestTo(User.Position); + + var proj = new Projectile(this, RuneSelect(6515, 130073, 215555, -1, 216040, 75650), User.Position); + proj.Position.Z += 5f; // fix height + proj.OnCollision = (hit) => + { + WeaponDamage(hit, ScriptFormula(18), DamageType.Physical); + }; + proj.Launch(target.Position, 2f); + } + } + if (Rune_D > 0) + { + if (Rand.NextDouble() < 1) + { + hitPayload.Target.PlayEffectGroup(163470); + AddBuff(hitPayload.Target, new DebuffStunned(WaitSeconds(ScriptFormula(0)))); + } + } + }; + attack.OnDeath = DeathPayload => + { + if (Rune_E > 0) + { + User.Attributes[GameAttribute.Hitpoints_Granted_Duration] += (int)ScriptFormula(12); + User.Attributes[GameAttribute.Hitpoints_Granted] += ScriptFormula(10) * User.Attributes[GameAttribute.Hitpoints_Max_Total]; + User.Attributes.BroadcastChangedIfRevealed(); + } + }; + attack.Apply(); + if (hitAnything) + GeneratePrimaryResource(EvalTag(PowerKeys.ResourceGainedOnFirstHit) + ScriptFormula(19)); + yield break; + } + [ImplementsPowerBuff(0, true)] + class FrenzyBuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(5)); + MaxStackCount = (int)ScriptFormula(3); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + _AddFrenzy(); + return true; + } + + public override bool Stack(Buff buff) + { + bool stacked = StackCount < MaxStackCount; + + base.Stack(buff); + + if (stacked) + _AddFrenzy(); + + return true; + } + + public override void Remove() + { + base.Remove(); + if (Rune_A > 0) + { + User.Attributes[GameAttribute.Attack_Bonus_Percent] -= StackCount * ScriptFormula(11); + } + User.Attributes[GameAttribute.Attacks_Per_Second_Bonus] -= StackCount * ScriptFormula(6); + User.Attributes.BroadcastChangedIfRevealed(); + + } + + private void _AddFrenzy() + { + if (Rune_A > 0) + { + User.Attributes[GameAttribute.Attack_Bonus_Percent] += ScriptFormula(11); + } + User.Attributes[GameAttribute.Attacks_Per_Second_Bonus] += ScriptFormula(6); + User.Attributes.BroadcastChangedIfRevealed(); + } + } + //powerbuff(1) = Healing Over Time buff + + [ImplementsPowerBuff(3)] + class ObsidianSpeedEffect : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(5)); + } + public override bool Apply() + { + if (!base.Apply()) + return false; + User.Attributes[GameAttribute.Movement_Bonus_Run_Speed] += ScriptFormula(8); + User.Attributes.BroadcastChangedIfRevealed(); + + return true; + } + public override void Remove() + { + base.Remove(); + User.Attributes[GameAttribute.Movement_Bonus_Run_Speed] -= ScriptFormula(8); + User.Attributes.BroadcastChangedIfRevealed(); + + } + } + } + #endregion + + //Incomplete, very confusing how to active this with using everthing else and how to end it when pressed. + //Possibly wait to finish this when we get Passives activated. + #region Revenege + [ImplementsPowerSNO(Skills.Skills.Barbarian.Situational.Revenge)] + public class Revenge : Skill + { + public override IEnumerable Main() + { + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetBestMeleeEnemy(); + attack.OnHit = hitPayload => + { + if (Rand.NextDouble() < ScriptFormula(20)) + { + //Skill_Override? // Skill_Override_Ended //Skill_Override_Ended_Active + User.Attributes[GameAttribute.Skill_Override_Active] = true; + } + }; + yield break; + } + } + #endregion + + //Complete, stupid error I made, check it. + #region WarCry + [ImplementsPowerSNO(Skills.Skills.Barbarian.FuryGenerators.WarCry)] + public class WarCry : Skill + { + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + GeneratePrimaryResource(ScriptFormula(3)); + + AddBuff(User, new WarCryBuff()); + + foreach (Actor ally in GetAlliesInRadius(User.Position, ScriptFormula(11)).Actors) + { + AddBuff(User, new WarCryAllyBuff()); + } + yield return WaitSeconds(0.5f); + } + //4 different powerbuffs, figure out which one is which. + [ImplementsPowerBuff(0)] + class WarCryBuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(2)); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + if (Rune_B > 0) + { + User.Attributes[GameAttribute.Dodge_Chance_Bonus] += ScriptFormula(14); + } + if (Rune_C > 0) + { + User.Attributes[GameAttribute.Resistance_Percent] += ScriptFormula(4); + } + if (Rune_E > 0) + { + User.Attributes[GameAttribute.Hitpoints_Max_Percent_Bonus] += ScriptFormula(5); + User.Attributes[GameAttribute.Hitpoints_Regen_Per_Second] += ScriptFormula(6); + } + User.Attributes[GameAttribute.Defense_Bonus_Percent] += ScriptFormula(0); + User.Attributes.BroadcastChangedIfRevealed(); + + return true; + } + + public override void Remove() + { + base.Remove(); + if (Rune_B > 0) + { + User.Attributes[GameAttribute.Dodge_Chance_Bonus] -= ScriptFormula(14); + } + if (Rune_C > 0) + { + User.Attributes[GameAttribute.Resistance_Percent] -= ScriptFormula(4); + } + if (Rune_E > 0) + { + User.Attributes[GameAttribute.Hitpoints_Max_Percent_Bonus] -= ScriptFormula(5); + User.Attributes[GameAttribute.Hitpoints_Regen_Per_Second] -= ScriptFormula(6); + } + User.Attributes[GameAttribute.Defense_Bonus_Percent] -= ScriptFormula(0); + User.Attributes.BroadcastChangedIfRevealed(); + } + } + [ImplementsPowerBuff(2)] + class WarCryAllyBuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(2)); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + if (Rune_B > 0) + { + Target.Attributes[GameAttribute.Dodge_Chance_Bonus] += ScriptFormula(14); + } + if (Rune_C > 0) + { + Target.Attributes[GameAttribute.Resistance_Percent] += ScriptFormula(4); + } + if (Rune_E > 0) + { + Target.Attributes[GameAttribute.Hitpoints_Max_Percent_Bonus] += ScriptFormula(5); + Target.Attributes[GameAttribute.Hitpoints_Regen_Per_Second] += ScriptFormula(6); + } + Target.Attributes[GameAttribute.Defense_Bonus_Percent] += ScriptFormula(0); + Target.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + public override void Remove() + { + base.Remove(); + if (Rune_B > 0) + { + Target.Attributes[GameAttribute.Dodge_Chance_Bonus] -= ScriptFormula(14); + } + if (Rune_C > 0) + { + Target.Attributes[GameAttribute.Resistance_Percent] -= ScriptFormula(4); + } + if (Rune_E > 0) + { + Target.Attributes[GameAttribute.Hitpoints_Max_Percent_Bonus] -= ScriptFormula(5); + Target.Attributes[GameAttribute.Hitpoints_Regen_Per_Second] -= ScriptFormula(6); + } + Target.Attributes[GameAttribute.Defense_Bonus_Percent] -= ScriptFormula(0); + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + } + #endregion + + //still terrible. needs to be redone. + #region FuriousCharge + [ImplementsPowerSNO(Skills.Skills.Barbarian.FuryGenerators.FuriousCharge)] + public class FuriousCharge : Skill + { + public override IEnumerable Main() + { + Target = GetEnemiesInRadius(TargetPosition, 12f).GetClosestTo(TargetPosition); + + if (Target != null) + { TargetPosition = PowerMath.TranslateDirection2D(User.Position, Target.Position, Target.Position, 5f); } + else + { TargetPosition = PowerMath.TranslateDirection2D(User.Position, TargetPosition, TargetPosition, 0f); } + + var dashBuff = new DashMoverBuff(TargetPosition); + AddBuff(User, dashBuff); + yield return dashBuff.Timeout; + + GeneratePrimaryResource(EvalTag(PowerKeys.ResourceGainedOnFirstHit)); //since its furygenerator -> this should be fine without being the first hit. + if (Target != null && Target.World != null) // target could've died or left world + { + User.TranslateFacing(Target.Position, true); + yield return WaitSeconds(0.1f); + User.PlayEffectGroup(166193); + foreach (Actor enemy in GetEnemiesInArcDirection(User.Position, Target.Position, ScriptFormula(13), 8f).Actors) + { + WeaponDamage(enemy, ScriptFormula(14), DamageType.Physical); + Knockback(enemy, ScriptFormula(10)); + } + } + yield break; + } + + [ImplementsPowerBuff(0)] + class DashMoverBuff : PowerBuff + { + const float _damageRate = 0.05f; + TickTimer _damageTimer = null; + + private Vector3D _destination; + private ActorMover _mover; + + bool hitAnything = false; + + public DashMoverBuff(Vector3D destination) + { + _destination = destination; + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + + float speed = User.Attributes[GameAttribute.Running_Rate_Total] * EvalTag(PowerKeys.WalkingSpeedMultiplier); + + User.TranslateFacing(_destination, true); + _mover = new ActorMover(User); + _mover.Move(_destination, speed, new ACDTranslateNormalMessage + { + TurnImmediately = true, + AnimationTag = 69808, + }); + + // make sure buff timeout is big enough otherwise the client will sometimes ignore the visual effects. + TickTimer minDashWait = WaitSeconds(0.15f); + Timeout = minDashWait.TimeoutTick > _mover.ArrivalTime.TimeoutTick ? minDashWait : _mover.ArrivalTime; + + User.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + public override void Remove() + { + base.Remove(); + User.Attributes.BroadcastChangedIfRevealed(); + + //this might not doing it for just the first hit. + if (hitAnything) + GeneratePrimaryResource(EvalTag(PowerKeys.ResourceGainedOnFirstHit)); + } + + public override bool Update() + { + _mover.Update(); + + if (base.Update()) + return true; + if (_damageTimer == null || _damageTimer.TimedOut) + { + _damageTimer = WaitSeconds(_damageRate); + AttackPayload attack = new AttackPayload(this); + attack.AddWeaponDamage(ScriptFormula(16), DamageType.Physical); + attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(6)); + attack.OnHit = hit => + { + hitAnything = true; + Knockback(hit.Target, ScriptFormula(2)); + if (Rune_B > 0) + { + User.Attributes[GameAttribute.Hitpoints_Granted] += ScriptFormula(21); + User.Attributes.BroadcastChangedIfRevealed(); + } + if (Rune_D > 0) + { + GeneratePrimaryResource(ScriptFormula(11)); + } + if (Rune_C > 0) + { + if (hit.IsCriticalHit) + { + AddBuff(hit.Target, new DebuffStunned(WaitSeconds(ScriptFormula(8)))); + } + } + if (Rune_E > 0) + { + int resourceHit = 0; + while (resourceHit < ScriptFormula(10)) + { + //maybe this cannot go here? + } + } + }; + attack.Apply(); + } + return false; + } + } + } + #endregion + + //TODO: E, B (check/fix A and C) + #region Overpower + [ImplementsPowerSNO(Skills.Skills.Barbarian.Situational.Overpower)] + public class Overpower : Skill + { + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + + TickTimer Cooldown = WaitSeconds(ScriptFormula(5)); + + if (Rune_A > 0) + { + AddBuff(User, new DurationBuff()); + } + if (Rune_E > 0) + { + AddBuff(User, new ReflectBuff()); + } + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(7)); + attack.AddWeaponDamage(ScriptFormula(7), DamageType.Physical); + attack.OnHit = HitPayload => + { + if (Rune_C > 0) + { + //TODO: is this the intended way to heal? + User.Attributes[GameAttribute.Hitpoints_Cur] = + Math.Min(User.Attributes[GameAttribute.Hitpoints_Cur] + + ScriptFormula(23) * User.Attributes[GameAttribute.Hitpoints_Max], + User.Attributes[GameAttribute.Hitpoints_Max]); + + User.Attributes.BroadcastChangedIfRevealed(); + } + if (Rune_D > 0) + { + GeneratePrimaryResource(ScriptFormula(28)); + } + if (HitPayload.IsCriticalHit) + { + Cooldown = WaitSeconds(0f); + } + }; + attack.Apply(); + + if (Rune_B > 0) + { + //Throw up to SF(18) axes at nearby enemies which inflict SF(14) weapon damage each. + //search radius SF(15), proj height SF(16), proj speed SF(17), proj delay time SF(19) + } + + StartCooldown(Cooldown); + yield break; + } + [ImplementsPowerBuff(0)] + class ReflectBuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(5)); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + return true; + } + + public override void OnPayload(Payload payload) + { + base.OnPayload(payload); + + //reflect 45% of melee damage + } + + public override void Remove() + { + base.Remove(); + } + } + [ImplementsPowerBuff(1)] + class DurationBuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(10)); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + //TODO: is this the intended way to increase critical hit chance? + User.Attributes[GameAttribute.Crit_Percent_Base] += (int)ScriptFormula(9); + User.Attributes.BroadcastChangedIfRevealed(); + + return true; + } + + public override void Remove() + { + base.Remove(); + User.Attributes[GameAttribute.Crit_Percent_Base] -= (int)ScriptFormula(9); + User.Attributes.BroadcastChangedIfRevealed(); + } + } + } + #endregion + + //TODO: Rune_E -> this is going to be hard.. + //Something wrong with using knockback. + #region SiesmicSlam + [ImplementsPowerSNO(Skills.Skills.Barbarian.FurySpenders.SiesmicSlam)] + public class SiesmicSlam : Skill + { + public override IEnumerable Main() + { + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + yield return WaitSeconds(0.5f); + var proj1 = new Projectile(this, 164708, User.Position); + proj1.Launch(TargetPosition, 1f); + foreach (Actor target in GetEnemiesInArcDirection(User.Position, TargetPosition, 45f, ScriptFormula(14)).Actors) + { + WeaponDamage(target, ScriptFormula(8), DamageType.Physical); + Knockback(target, ScriptFormula(0), ScriptFormula(1)); + + if (Rune_C > 0) + { + if (Rand.NextDouble() < ScriptFormula(6)) + { + AddBuff(target, new DebuffStunned(WaitSeconds(ScriptFormula(7)))); + } + } + } + + yield return WaitSeconds(1f); + + if (Rune_B > 0) + { + var aShockproj = new Projectile(this, 164788, User.Position); + aShockproj.Launch(TargetPosition, 1f); + + foreach (Actor target in GetEnemiesInArcDirection(User.Position, TargetPosition, 45f, ScriptFormula(14)).Actors) + { + WeaponDamage(target, ScriptFormula(3), DamageType.Physical); + } + } + + yield break; + } + } + #endregion + + //SuperEarthquake.ani. + //this is a dumpster fire.. (terrible, rewrite it) + #region Earthquake + [ImplementsPowerSNO(Skills.Skills.Barbarian.Situational.Earthquake)] + public class Earthquake : Skill + { + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + User.PlayEffectGroup(55689); + WeaponDamage(GetEnemiesInRadius(User.Position, ScriptFormula(0)), ScriptFormula(19), DamageType.Physical); + var Quake = SpawnEffect(168440, User.Position, 0, WaitSeconds(ScriptFormula(1))); + Quake.UpdateDelay = 0.5f; + Quake.OnUpdate = () => + { + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(0)); + attack.AddWeaponDamage(ScriptFormula(17), DamageType.Physical); + attack.Apply(); + }; + //Secondary Tremor stuff.. + yield break; + } + } + #endregion + + //TODO: Rune_C and _E + #region Sprint + [ImplementsPowerSNO(Skills.Skills.Barbarian.FurySpenders.Sprint)] + public class Sprint : Skill + { + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + AddBuff(User, new MovementBuff()); + + if (Rune_D > 0) + { + foreach (Actor ally in GetAlliesInRadius(User.Position, ScriptFormula(4)).Actors) + AddBuff(ally, new MovementAlliesBuff()); + } + yield break; + } + [ImplementsPowerBuff(0)] + class MovementBuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(0)); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + new DodgeBuff(); + //nothing seems to be working here for attributes + User.Attributes[GameAttribute.Movement_Scalar_Uncapped_Bonus] += ScriptFormula(1); + User.Attributes[GameAttribute.Movement_Bonus_Total] += ScriptFormula(1); + User.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + //Rune_C : Update -> tornadoes rage in the wake of the spring, each on inflicting 40% dmg. + + //Rune_E : OnPayload? knockback and damage. + + public override void Remove() + { + base.Remove(); + User.Attributes[GameAttribute.Movement_Bonus_Run_Speed] -= ScriptFormula(1); + User.Attributes.BroadcastChangedIfRevealed(); + } + } + [ImplementsPowerBuff(3)] + class MovementAlliesBuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(0)); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + Target.Attributes[GameAttribute.Movement_Bonus_Run_Speed] += ScriptFormula(1); + Target.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + public override void Remove() + { + base.Remove(); + Target.Attributes[GameAttribute.Movement_Bonus_Run_Speed] -= ScriptFormula(1); + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + [ImplementsPowerBuff(4)] + class DodgeBuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(0)); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + User.Attributes[GameAttribute.Dodge_Chance_Bonus] += ScriptFormula(2); + User.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + public override void Remove() + { + base.Remove(); + User.Attributes[GameAttribute.Dodge_Chance_Bonus] -= ScriptFormula(2); + User.Attributes.BroadcastChangedIfRevealed(); + } + } + } + #endregion + + //TODO: Rune_C/D + #region WrathOfTheBerserker + [ImplementsPowerSNO(Skills.Skills.Barbarian.Situational.WrathOfTheBerserker)] + public class WrathOfTheBerserker : Skill + { + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + AddBuff(User, new BerserkerBuff()); + if (Rune_B > 0) + { + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(20)); + attack.AddWeaponDamage(ScriptFormula(17), DamageType.Physical); + attack.OnHit = HitPayload => + { + Knockback(User.Position, HitPayload.Target, ScriptFormula(18), ScriptFormula(19)); + }; + } + if (Rune_E > 0) + { + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(15)); + attack.OnDeath = HitPayload => + { + User.PlayEffectGroup(210319); + WeaponDamage(HitPayload.Target, ScriptFormula(11), DamageType.Physical); + }; + } + + yield break; + } + [ImplementsPowerBuff(0)] + class BerserkerBuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(6)); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + if (Rune_A > 0) + { + User.Attributes[GameAttribute.Attack_Bonus_Percent] += ScriptFormula(8); + } + User.Attributes[GameAttribute.Crit_Damage_Percent] += (int)ScriptFormula(0); + User.Attributes[GameAttribute.Attacks_Per_Second_Bonus] += ScriptFormula(2); + User.Attributes[GameAttribute.Dodge_Chance_Bonus] += ScriptFormula(3); + User.Attributes[GameAttribute.Movement_Bonus_Run_Speed] += ScriptFormula(1); + User.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + //Rune_D -> OnPayload? every _ fury gained adds 1 second to duration of effect. + + public override void Remove() + { + base.Remove(); + if (Rune_A > 0) + { + User.Attributes[GameAttribute.Attack_Bonus_Percent] += ScriptFormula(8); + } + User.Attributes[GameAttribute.Crit_Damage_Percent] -= (int)ScriptFormula(0); + User.Attributes[GameAttribute.Attacks_Per_Second_Bonus] -= ScriptFormula(2); + User.Attributes[GameAttribute.Dodge_Chance_Bonus] -= ScriptFormula(3); + User.Attributes[GameAttribute.Movement_Bonus_Run_Speed] -= ScriptFormula(1); + User.Attributes.BroadcastChangedIfRevealed(); + } + } + } + #endregion + + //Incomplete + #region CallOfTheAncients + [ImplementsPowerSNO(Skills.Skills.Barbarian.Situational.CallOfTheAncients)] + public class CallOfTheAncients : Skill + { + public override IEnumerable Main() + { + StartCooldown(60f); + + List ancients = new List(); + for (int i = 0; i < 3; i++) + { + if (i == 0) + { + var ancient = new AncientKorlic(this.World, this, i); + ancient.Brain.DeActivate(); + ancient.Position = RandomDirection(User.Position, 3f, 8f); //Kind of hacky until we get proper collisiondetection + ancient.Attributes[GameAttribute.Untargetable] = true; + ancient.EnterWorld(ancient.Position); + ancient.PlayActionAnimation(97105); + ancients.Add(ancient); + yield return WaitSeconds(0.2f); + } + if (i == 1) + { + var ancient = new AncientTalic(this.World, this, i); + ancient.Brain.DeActivate(); + ancient.Position = RandomDirection(User.Position, 3f, 8f); //Kind of hacky until we get proper collisiondetection + ancient.Attributes[GameAttribute.Untargetable] = true; + ancient.EnterWorld(ancient.Position); + ancient.PlayActionAnimation(97109); + ancients.Add(ancient); + yield return WaitSeconds(0.2f); + } + if (i == 2) + { + var ancient = new AncientMawdawc(this.World, this, i); + ancient.Brain.DeActivate(); + ancient.Position = RandomDirection(User.Position, 3f, 8f); //Kind of hacky until we get proper collisiondetection + ancient.Attributes[GameAttribute.Untargetable] = true; + ancient.EnterWorld(ancient.Position); + ancient.PlayActionAnimation(97107); + ancients.Add(ancient); + yield return WaitSeconds(0.2f); + } + } + yield return WaitSeconds(0.8f); + + foreach (Actor ancient in ancients) + { + (ancient as Minion).Brain.Activate(); + ancient.Attributes[GameAttribute.Untargetable] = false; + ancient.Attributes.BroadcastChangedIfRevealed(); + } + yield break; + } + } + #endregion + //12 Passive Skills +} diff --git a/src/Mooege/Core/GS/Powers/Implementations/HeroSkills/DemonHunter.cs b/src/Mooege/Core/GS/Powers/Implementations/HeroSkills/DemonHunter.cs new file mode 100644 index 00000000..3d88303d --- /dev/null +++ b/src/Mooege/Core/GS/Powers/Implementations/HeroSkills/DemonHunter.cs @@ -0,0 +1,1789 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Common.Helpers.Math; +using Mooege.Core.GS.Actors.Implementations.Minions; +using Mooege.Core.GS.Ticker; +using Mooege.Net.GS.Message; +using Mooege.Net.GS.Message.Definitions.ACD; +using Mooege.Net.GS.Message.Definitions.Effect; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Powers.Payloads; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Core.GS.Actors; +using Mooege.Core.GS.Actors.Movement; + +namespace Mooege.Core.GS.Powers.Implementations +{ + //22 skills, 3 done by mdz, 2(vault and fan of knives) by velocityx, 8 started by wetwlly + + //Complete + #region BolaShot + [ImplementsPowerSNO(Skills.Skills.DemonHunter.HatredGenerators.BolaShot)] + public class DemonHunterBolaShot : Skill + { + public override IEnumerable Main() + { + GeneratePrimaryResource(ScriptFormula(17)); + + // fire projectile normally, or find targets in arc if RuneB + Vector3D[] targetDirs; + if (Rune_B > 0) + { + targetDirs = new Vector3D[(int)ScriptFormula(24)]; + + int takenPos = 0; + foreach (Actor actor in GetEnemiesInArcDirection(User.Position, TargetPosition, 75f, ScriptFormula(12)).Actors) + { + targetDirs[takenPos] = actor.Position; + ++takenPos; + if (takenPos >= targetDirs.Length) + break; + } + + // generate any extra positions using generic spread + if (takenPos < targetDirs.Length) + { + PowerMath.GenerateSpreadPositions(User.Position, TargetPosition, 10f, targetDirs.Length - takenPos) + .CopyTo(targetDirs, takenPos); + } + } + else + { + targetDirs = new Vector3D[] { TargetPosition }; + } + + foreach (Vector3D position in targetDirs) + { + var proj = new Projectile(this, RuneSelect(77569, 153864, 153865, 153866, 153867, 153868), User.Position); + proj.Position.Z += 5f; // fix height + proj.OnCollision = (hit) => + { + // hit effect + hit.PlayEffectGroup(RuneSelect(77577, 153870, 153872, 153873, 153871, 153869)); + + if (Rune_B > 0) + WeaponDamage(hit, ScriptFormula(9), DamageType.Poison); + else + AddBuff(hit, new ExplosionBuff()); + + proj.Destroy(); + }; + proj.Launch(position, ScriptFormula(2)); + + if (Rune_B > 0) + yield return WaitSeconds(ScriptFormula(13)); + } + } + + [ImplementsPowerBuff(0)] + class ExplosionBuff : PowerBuff + { + public override void Init() + { + base.Init(); + Timeout = WaitSeconds(ScriptFormula(4)); + } + + public override bool Update() + { + if (Timeout.TimedOut) + { + Target.PlayEffectGroup(RuneSelect(77573, 153727, 154073, 154074, 154072, 154070)); + + if (Rune_D > 0) + { + if (Rand.NextDouble() < ScriptFormula(31)) + GenerateSecondaryResource(ScriptFormula(32)); + } + + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(Target.Position, ScriptFormula(20)); + attack.AddWeaponDamage(ScriptFormula(6), + RuneSelect(DamageType.Fire, DamageType.Fire, DamageType.Poison, + DamageType.Lightning, DamageType.Fire, DamageType.Arcane)); + if (Rune_C > 0) + { + attack.OnHit = (hitPayload) => + { + if (Rand.NextDouble() < ScriptFormula(28)) + AddBuff(hitPayload.Target, new DebuffStunned(WaitSeconds(ScriptFormula(29)))); + }; + } + attack.Apply(); + } + + return base.Update(); + } + + public override bool Stack(Buff buff) + { + return false; + } + } + } + #endregion + + //Complete + #region Grenades + [ImplementsPowerSNO(Skills.Skills.DemonHunter.HatredGenerators.Grenades)] + public class DemonHunterGrenades : Skill + { + public override IEnumerable Main() + { + GeneratePrimaryResource(ScriptFormula(25)); + + float targetDistance = PowerMath.Distance2D(User.Position, TargetPosition); + + // create grenade projectiles with shared detonation timer + TickTimer timeout = WaitSeconds(ScriptFormula(2)); + Projectile[] grenades = new Projectile[Rune_C > 0 ? 1 : 3]; + for (int i = 0; i < grenades.Length; ++i) + { + var projectile = new Projectile(this, Rune_C > 0 ? 212547 : 88244, User.Position); + projectile.Timeout = timeout; + grenades[i] = projectile; + } + + // generate spread positions with distance-scaled spread amount. + float scaledSpreadOffset = Math.Max(targetDistance - ScriptFormula(14), 0f); + Vector3D[] projDestinations = PowerMath.GenerateSpreadPositions(User.Position, TargetPosition, + ScriptFormula(11) - scaledSpreadOffset, grenades.Length); + + // launch and bounce grenades + yield return WaitTicks(1); // helps make bounce timings more consistent + + float bounceOffset = 1f; + float minHeight = ScriptFormula(21); + float height = minHeight + ScriptFormula(22); + float bouncePercent = 0.7f; // ScriptFormula(23); + while (!timeout.TimedOut) + { + for (int i = 0; i < grenades.Length; ++i) + { + grenades[i].LaunchArc(PowerMath.TranslateDirection2D(projDestinations[i], User.Position, projDestinations[i], + targetDistance * 0.3f * bounceOffset), + height, ScriptFormula(20)); + } + + height *= bouncePercent; + bounceOffset *= 0.3f; + + yield return grenades[0].ArrivalTime; + // play "dink dink" grenade bounce sound + grenades[0].PlayEffect(Effect.Unknown69); + } + + // damage effects + foreach (var grenade in grenades) + { + var grenadeN = grenade; + + SpawnEffect(RuneSelect(154027, 154045, 154028, 154044, 154046, 154043), grenade.Position); + + // poison pool effect + if (Rune_A > 0) + { + var pool = SpawnEffect(154076, grenade.Position, 0, WaitSeconds(ScriptFormula(7))); + pool.UpdateDelay = 1f; + pool.OnUpdate = () => + { + WeaponDamage(GetEnemiesInRadius(grenadeN.Position, ScriptFormula(5)), ScriptFormula(6), DamageType.Poison); + }; + } + + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(grenade.Position, ScriptFormula(4)); + attack.AddWeaponDamage(ScriptFormula(0), Rune_A > 0 ? DamageType.Poison : DamageType.Fire); + attack.OnHit = (hitPayload) => + { + if (Rune_E > 0) + { + if (Rand.NextDouble() < ScriptFormula(9)) + AddBuff(hitPayload.Target, new DebuffStunned(WaitSeconds(ScriptFormula(10)))); + } + if (Rune_C > 0) + Knockback(grenadeN.Position, hitPayload.Target, ScriptFormula(8)); + }; + attack.Apply(); + } + + // clusterbomb hits + if (Rune_B > 0) + { + int damagePulses = (int)ScriptFormula(28); + for (int pulse = 0; pulse < damagePulses; ++pulse) + { + yield return WaitSeconds(ScriptFormula(12) / damagePulses); + + foreach (var grenade in grenades) + { + WeaponDamage(GetEnemiesInRadius(grenade.Position, ScriptFormula(4)), ScriptFormula(0), DamageType.Fire); + } + } + } + } + } + #endregion + + //Complete + #region RainOfVengeance + [ImplementsPowerSNO(Skills.Skills.DemonHunter.HatredSpenders.RainOfVengeance)] + public class DemonHunterRainOfVengeance : Skill + { + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + // ground summon effect for rune c + if (Rune_C > 0) + SpawnProxy(TargetPosition).PlayEffectGroup(152294); + + // startup delay all version of skill have + yield return WaitSeconds(ScriptFormula(3)); + + IEnumerable subScript; + if (Rune_A > 0) + subScript = _RuneA(); + else if (Rune_B > 0) + subScript = _RuneB(); + else if (Rune_C > 0) + subScript = _RuneC(); + else if (Rune_D > 0) + subScript = _RuneD(); + else if (Rune_E > 0) + subScript = _RuneE(); + else + subScript = _NoRune(); + + foreach (var timeout in subScript) + yield return timeout; + } + + IEnumerable _RuneA() + { + Vector3D castedPosition = new Vector3D(User.Position); + + int demonCount = (int)ScriptFormula(23); + for (int n = 0; n < demonCount; ++n) + { + var attackDelay = WaitSeconds(ScriptFormula(20)); + var demonPosition = RandomDirection(castedPosition, ScriptFormula(24), ScriptFormula(25)); + + var demon = SpawnEffect(149949, demonPosition, ScriptFormula(22), WaitSeconds(5.0f)); + demon.OnUpdate = () => + { + if (attackDelay.TimedOut) + { + demon.PlayEffectGroup(152590); + WeaponDamage(GetEnemiesInRadius(demonPosition, ScriptFormula(27)), ScriptFormula(26), DamageType.Fire); + + demon.OnUpdate = null; + } + }; + + yield return WaitSeconds(ScriptFormula(4)); + } + } + + IEnumerable _NoRune() + { + _CreateArrowPool(131701, new Vector3D(User.Position), ScriptFormula(6), ScriptFormula(7)); + yield break; + } + + IEnumerable _RuneB() + { + Vector3D castedPosition = new Vector3D(User.Position); + + TickTimer timeout = WaitSeconds(ScriptFormula(16)); + while (!timeout.TimedOut) + { + TargetList targets = GetEnemiesInRadius(castedPosition, ScriptFormula(18)); + if (targets.Actors.Count > 0) + _CreateArrowPool(153029, targets.Actors[Rand.Next(targets.Actors.Count)].Position, ScriptFormula(28), ScriptFormula(34)); + + yield return WaitSeconds(ScriptFormula(38)); + } + } + + void _CreateArrowPool(int actorSNO, Vector3D position, float duration, float radius) + { + var pool = SpawnEffect(actorSNO, position, 0, WaitSeconds(duration)); + pool.OnUpdate = () => + { + TargetList targets = GetEnemiesInRadius(position, radius); + targets.Actors.RemoveAll((actor) => Rand.NextDouble() > ScriptFormula(10)); + targets.ExtraActors.RemoveAll((actor) => Rand.NextDouble() > ScriptFormula(10)); + + WeaponDamage(targets, ScriptFormula(0), DamageType.Physical); + + // rewrite delay every time for variation: base wait time * variation * user attack speed + pool.UpdateDelay = (ScriptFormula(5) + (float)Rand.NextDouble() * ScriptFormula(2)) * (1.0f / ScriptFormula(9)); + }; + } + + IEnumerable _RuneC() + { + var demon = new Projectile(this, 155276, TargetPosition); + demon.Timeout = WaitSeconds(ScriptFormula(30)); + + TickTimer grenadeTimer = null; + demon.OnUpdate = () => + { + if (grenadeTimer == null || grenadeTimer.TimedOut) + { + grenadeTimer = WaitSeconds(ScriptFormula(31)); + + demon.PlayEffect(Effect.Sound, 215621); + + var grenade = new Projectile(this, 152589, demon.Position); + grenade.Position.Z += 18f; // make it spawn near demon's cannon + grenade.Timeout = WaitSeconds(ScriptFormula(33)); + grenade.OnTimeout = () => + { + grenade.PlayEffectGroup(154020); + WeaponDamage(GetEnemiesInRadius(grenade.Position, ScriptFormula(32)), ScriptFormula(0), DamageType.Fire); + }; + grenade.LaunchArc(demon.Position, 0.1f, -0.1f, 0.6f); // parameters not based on anything, just picked to look good + } + }; + + bool firstLaunch = true; + while (!demon.Timeout.TimedOut) + { + demon.Launch(RandomDirection(TargetPosition, 0f, ScriptFormula(7)), 0.2f); + if (firstLaunch) + { + demon.PlayEffectGroup(165237); + firstLaunch = false; + } + yield return demon.ArrivalTime; + } + } + + IEnumerable _RuneD() + { + int flyerCount = (int)ScriptFormula(14); + for (int n = 0; n < flyerCount; ++n) + { + var flyerPosition = RandomDirection(TargetPosition, 0f, ScriptFormula(7)); + var flyer = SpawnEffect(200808, flyerPosition, 0f, WaitSeconds(ScriptFormula(5))); + flyer.OnTimeout = () => + { + flyer.PlayEffectGroup(200516); + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(flyerPosition, ScriptFormula(13)); + attack.AddWeaponDamage(ScriptFormula(12), DamageType.Fire); + attack.OnHit = (hitPayload) => + { + AddBuff(hitPayload.Target, new DebuffStunned(WaitSeconds(ScriptFormula(37)))); + }; + attack.Apply(); + }; + + yield return WaitSeconds(ScriptFormula(4)); + } + } + + IEnumerable _RuneE() + { + float attackRadius = 8f; // value is not in formulas, just a guess + Vector3D castedPosition = new Vector3D(User.Position); + float castAngle = MovementHelpers.GetFacingAngle(castedPosition, TargetPosition); + float waveOffset = 0f; + + int flyerCount = (int)ScriptFormula(15); + for (int n = 0; n < flyerCount; ++n) + { + waveOffset += 3.0f; + var wavePosition = PowerMath.TranslateDirection2D(castedPosition, TargetPosition, castedPosition, waveOffset); + var flyerPosition = RandomDirection(wavePosition, 0f, attackRadius); + var flyer = SpawnEffect(200561, flyerPosition, castAngle, WaitSeconds(ScriptFormula(20))); + flyer.OnTimeout = () => + { + flyer.PlayEffectGroup(200819); + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(flyerPosition, attackRadius); + attack.AddWeaponDamage(ScriptFormula(11), DamageType.Physical); + attack.OnHit = (hitPayload) => { Knockback(hitPayload.Target, 90f); }; + attack.Apply(); + }; + + yield return WaitSeconds(ScriptFormula(4)); + } + } + } + #endregion + + //TODO: needs the actor position fixed, since the arrow jumps from position to positions when changing direction + #region HungeringArrow + [ImplementsPowerSNO(Skills.Skills.DemonHunter.HatredGenerators.HungeringArrow)] + public class HungeringArrow : Skill + { + //BoneArrow + + public override IEnumerable Main() + { + //These are both zero, but we will keep them in the event blizzard changed their mind. + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + var projectile = new Projectile(this, RuneSelect(129932, 154590, 154591, 154592, 154593, 154594), User.Position); + projectile.Position.Z += 5f; + projectile.Launch(TargetPosition, ScriptFormula(7)); + projectile.OnCollision = (hit) => + { + SpawnEffect(99572, new Vector3D(hit.Position.X, hit.Position.Y, hit.Position.Z + 5f)); // impact effect (fix height) + WeaponDamage(hit, ScriptFormula(0), DamageType.Physical); + bool firsthit = true; + float range = ScriptFormula(3); + if (firsthit == false) + { + range = ScriptFormula(4); + } + var remaningtargets = GetEnemiesInRadius(hit.Position, 10f); + int count = remaningtargets.Actors.Count(); + var targets = (GetEnemiesInRadius(hit.Position, range)); + double chance = RandomHelper.NextDouble(); + targets.Actors.Remove(hit); + var closetarget = targets.GetClosestTo(hit.Position); + if (closetarget != null && chance > ScriptFormula(5)) + { + projectile.Launch(closetarget.Position, ScriptFormula(7)); + } + else + { + projectile.Destroy(); + } + }; + yield break; + } + } + #endregion + + //TODO:Rune_E + #region Impale + [ImplementsPowerSNO(Skills.Skills.DemonHunter.HatredSpenders.Impale)] + public class Impale : Skill + { + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + var proj = new Projectile(this, RuneSelect(220527, 222102, 222115, 222128, 220527, 222141), User.Position); + proj.Position.Z += 5f; // fix height + proj.OnCollision = (hit) => + { + hit.PlayEffectGroup(RuneSelect(221164, 222107, 222120, 222133, 221164, 222146)); + + AttackPayload attack = new AttackPayload(this); + attack.SetSingleTarget(hit); + attack.AddWeaponDamage(ScriptFormula(0), DamageType.Physical); + attack.OnHit = (HitPayload) => + { + //if (HitPayload.IsCriticalHit) + //{ + // if (Rune_E > 0) + // { + // WeaponDamage(HitPayload.Target, ScriptFormula(13), DamageType.Physical); + // } + //} + if (Rune_A > 0) + { + //Nothing goes here. + } + else + { + if (Rune_B > 0) + { + Knockback(User.Position, hit, ScriptFormula(4)); + AddBuff(hit, new DebuffStunned(WaitSeconds(ScriptFormula(6)))); + } + if (Rune_C > 0) + { + AddBuff(hit, new addsDOTDamage()); + } + proj.Destroy(); + } + }; + attack.Apply(); + }; + proj.Launch(TargetPosition, ScriptFormula(2)); + + if (Rune_D > 0) + { + SpawnEffect(222156, User.Position); + //User.PlayEffectGroup(222155); + WeaponDamage(GetEnemiesInRadius(User.Position, ScriptFormula(11)), ScriptFormula(12), DamageType.Physical); + } + + yield return WaitSeconds(1f); + } + [ImplementsPowerBuff(1)] + class addsDOTDamage : PowerBuff + { + const float _damageRate = 1f; + TickTimer _damageTimer = null; + + public override void Init() + { + base.Init(); + Timeout = WaitSeconds(ScriptFormula(8)); + } + + public override bool Update() + { + if (base.Update()) + return true; + + if (_damageTimer == null || _damageTimer.TimedOut) + { + _damageTimer = WaitSeconds(_damageRate); + + AttackPayload attack = new AttackPayload(this); + attack.AddWeaponDamage(ScriptFormula(9), DamageType.Physical); + attack.Apply(); + } + + return false; + } + } + } + #endregion + + //TODO: BackFlip function and D and E <- these runes pretty much finish when backflip is corrected + //TODO: Rune_C -> poison bomb. + #region EvasiveFire + [ImplementsPowerSNO(Skills.Skills.DemonHunter.HatredGenerators.EvasiveFire)] + public class EvasiveFire : Skill + { + public override IEnumerable Main() + { + GeneratePrimaryResource(ScriptFormula(4)); + + // fire projectile normally, or find targets in arc if RuneB + Vector3D[] targetDirs; + if (Rune_B > 0) + { + targetDirs = new Vector3D[(int)ScriptFormula(24)]; + + int takenPos = 0; + foreach (Actor actor in GetEnemiesInArcDirection(User.Position, TargetPosition, ScriptFormula(25), ScriptFormula(26)).Actors) + { + targetDirs[takenPos] = actor.Position; + ++takenPos; + if (takenPos >= targetDirs.Length) + break; + } + + // generate any extra positions using generic spread + if (takenPos < targetDirs.Length) + { + PowerMath.GenerateSpreadPositions(User.Position, TargetPosition, 10f, targetDirs.Length - takenPos) + .CopyTo(targetDirs, takenPos); + } + } + else + { + targetDirs = new Vector3D[] { TargetPosition }; + } + + foreach (Vector3D position in targetDirs) + { + //using BoneArrow Projectile for now, unknown where SafetyShot Projectile went. + var proj = new Projectile(this, 203006, User.Position); + proj.Position.Z += 6f; // fix height + proj.OnCollision = (hit) => + { + // hit effect + if (Rune_A > 0) + { + hit.PlayEffectGroup(147971); + WeaponDamage(GetEnemiesInRadius(hit.Position, ScriptFormula(21)), ScriptFormula(20), DamageType.Fire); + } + else + { + hit.PlayEffectGroup(RuneSelect(134836, 150801, 150807, 150803, 150804, 150805)); + WeaponDamage(hit, ScriptFormula(3), RuneSelect(DamageType.Physical, DamageType.Fire, DamageType.Physical, DamageType.Poison, DamageType.Lightning, DamageType.Physical)); + } + + proj.Destroy(); + }; + proj.Launch(position, ScriptFormula(2)); + + /*if (GetEnemiesInArcDirection(User.Position, TargetPosition, ScriptFormula(5), ScriptFormula(6)).Actors.Count > 0) + { + //if Rune C -> lay poison bomb behind. + //if rune D -> UseSecondaryResource(ScriptFormula(8)) + float speed = Target.Attributes[GameAttribute.Running_Rate_Total] * 3f; + Vector3D destination = //this needs to be the opposite direction of the facing direction// ScriptFormula(7); + ActorMover _mover; + //lets move backwards! + User.TranslateFacing(TargetPosition, true); + _mover = new ActorMover(Target); + _mover.Move(destination, speed, new ACDTranslateNormalMessage + { + AnimationTag = 69824, // dashing strike attack animation + }); + //backflip + } */ + + yield break; + } + } + } + #endregion + + //TODO:Rune_C and E + #region Caltrops + [ImplementsPowerSNO(Skills.Skills.DemonHunter.Discipline.Caltrops)] + public class Caltrops : Skill + { + public override IEnumerable Main() + { + UseSecondaryResource(ScriptFormula(7)); + + var GroundSpot = SpawnProxy(User.Position); + var caltropsGround = SpawnEffect(196030, GroundSpot.Position, 0, WaitSeconds(ScriptFormula(9))); + caltropsGround.UpdateDelay = 0.25f; + caltropsGround.OnUpdate = () => + { + if (GetEnemiesInRadius(GroundSpot.Position, ScriptFormula(0)).Actors.Count > 0) + { + caltropsGround.Destroy(); + var calTrops = SpawnEffect(RuneSelect(129784, 154811, 155734, 155159, 155848, 155376), GroundSpot.Position, 0, WaitSeconds(ScriptFormula(2))); + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(GroundSpot.Position, ScriptFormula(0)); + attack.OnHit = (hit) => + { + if (AddBuff(hit.Target, new ActiveCalTrops())) + { } + else + AddBuff(hit.Target, new ActiveCalTrops()); + }; + attack.Apply(); + + if (Rune_E > 0) + { + //Increase Crit Hit while inside Radius. May have to redo skill for this? + } + } + }; + + yield break; + } + + [ImplementsPowerBuff(0)] + class ActiveCalTrops : PowerBuff + { + const float _damageRate = 1f; + TickTimer _damageTimer = null; + + public override void Init() + { + base.Init(); + Timeout = WaitSeconds(ScriptFormula(2)); + } + public override bool Apply() + { + if (!base.Apply()) + return false; + + return true; + } + public override bool Update() + { + if (base.Update()) + return true; + + if (_damageTimer == null || _damageTimer.TimedOut) + { + _damageTimer = WaitSeconds(_damageRate); + + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(Target.Position, ScriptFormula(0)); + if (Rune_A > 0) + { + attack.AddWeaponDamage(ScriptFormula(20), DamageType.Physical); + } + attack.OnHit = HitPayload => + { + if (Rune_C > 0) + { + //Immobilize for ScriptFormula(24) + } + + if (AddBuff(HitPayload.Target, new DebuffSlowed(ScriptFormula(3), WaitSeconds(ScriptFormula(4))))) + { } + else + AddBuff(HitPayload.Target, new DebuffSlowed(ScriptFormula(3), WaitSeconds(ScriptFormula(4)))); + }; + attack.Apply(); + } + + return false; + } + + public override bool Stack(Buff buff) + { + return false; + } + } + } + #endregion + + //No runes yet. + #region RapidFire + [ImplementsPowerSNO(Skills.Skills.DemonHunter.HatredSpenders.RapidFire)] + public class RapidFire : ChanneledSkill + { + private Actor _target = null; + + public override void OnChannelOpen() + { + EffectsPerSecond = 0.1f; + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + User.Attributes[GameAttribute.Projectile_Speed] = User.Attributes[GameAttribute.Projectile_Speed] * ScriptFormula(22); + User.Attributes.BroadcastChangedIfRevealed(); + } + + public override void OnChannelClose() + { + if (_target != null) + _target.Destroy(); + User.Attributes[GameAttribute.Projectile_Speed] = User.Attributes[GameAttribute.Projectile_Speed] / ScriptFormula(22); + User.Attributes.BroadcastChangedIfRevealed(); + } + + public override void OnChannelUpdated() + { + User.TranslateFacing(TargetPosition); + } + + public override IEnumerable Main() + { + var proj1 = new Projectile(this, 150061, User.Position); + proj1.Position.Z += 5f; + proj1.Launch(new Vector3D(TargetPosition.X + ((float)Rand.NextDouble() * 2f), TargetPosition.Y + ((float)Rand.NextDouble() * 2f), TargetPosition.Z), ScriptFormula(2)); + UsePrimaryResource(ScriptFormula(19) * EffectsPerSecond); + proj1.OnCollision = (hit) => + { + SpawnEffect(99572, new Vector3D(hit.Position.X, hit.Position.Y, hit.Position.Z + 5f)); // impact effect (fix height) + proj1.Destroy(); + WeaponDamage(hit, ScriptFormula(0), DamageType.Arcane); + }; + + yield return WaitSeconds(ScriptFormula(1)); + } + } + #endregion + + //Started, no entangling or runes yet + #region EntanglingShot + [ImplementsPowerSNO(Skills.Skills.DemonHunter.HatredGenerators.EntanglingShot)] + public class EntanglingShot : Skill + { + public override IEnumerable Main() + { + GeneratePrimaryResource(ScriptFormula(2)); + var proj1 = new Projectile(this, 75678, User.Position); + proj1.Position.Z += 5f; + proj1.OnCollision = (hit) => + { + //TODO: Rope effect to mobs + hit.PlayEffectGroup(76093); // impact effect (fix height) + proj1.Destroy(); + WeaponDamage(hit, ScriptFormula(5), DamageType.Physical); + AddBuff(hit, new EntangleDebuff()); + }; + proj1.Launch(TargetPosition, ScriptFormula(12)); + + yield break; + } + [ImplementsPowerBuff(0)] + class EntangleDebuff : PowerBuff + { + public override void Init() + { + base.Init(); + Timeout = WaitSeconds(ScriptFormula(4)); + } + public override bool Apply() + { + if (!base.Apply()) + return false; + + AddBuff(Target, new DebuffSlowed(0.7f, WaitSeconds(ScriptFormula(4)))); + + return true; + } + + public override void Remove() + { + base.Remove(); + } + } + } + #endregion + + //Rune_A,D,E + #region ElementalArrow + [ImplementsPowerSNO(Skills.Skills.DemonHunter.HatredSpenders.ElementalArrow)] + public class ElementalArrow : Skill + { + public override IEnumerable Main() + { + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + var proj = new Projectile(this, RuneSelect(77604, 131664, 155092, 155749, 155938, 154674), User.Position); + if (Rune_C > 0) + { proj.Position.Z += 3f; } + else + { proj.Position.Z += 5f; } + proj.OnCollision = (hit) => + { + hit.PlayEffectGroup(RuneSelect(154844, 155087, 154845, -1, 156007, 154846)); + if (Rune_A > 0) + { + //cone damage in arch from user to target, from target's position "Thru its back" + TargetPosition = PowerMath.TranslateDirection2D(User.Position, hit.Position, + new Vector3D(User.Position.X, User.Position.Y, TargetPosition.Z), + 35f); + //var FirstTarget = GetEnemiesInArcDirection(hit.Position, TargetPosition, ScriptFormula(13), ScriptFormula(14)).SortByDistanceFrom(User.Position); + //WeaponDamage(FirstTarget, ScriptFormula(0), DamageType.Cold); + //FirstTarget.PlayEffectGroup(131673); + WeaponDamage(hit, ScriptFormula(0), DamageType.Cold); + } + if (Rune_B > 0) + { + WeaponDamage(GetEnemiesInRadius(hit.Position, ScriptFormula(22)), ScriptFormula(0), DamageType.Lightning); + } + if (Rune_C > 0) + { + WeaponDamage(hit, ScriptFormula(0), DamageType.Physical); + + if (Rand.NextDouble() < ScriptFormula(5)) + { + AddBuff(hit, new FearedDebuff()); + AddBuff(hit, new DebuffFeared(WaitSeconds(ScriptFormula(6)))); + } + } + if (Rune_D > 0) + { + //radius damage to mobs, and heal user for 24% of damage + WeaponDamage(hit, ScriptFormula(0), DamageType.Poison); + } + if (Rune_E > 0) + { + WeaponDamage(hit, ScriptFormula(0), DamageType.Lightning); + //when critical hit, stun enemies -> AddBuff(hit, new DebuffStunned(WaitSeconds(ScriptFormula(38)))); + } + else + WeaponDamage(hit, ScriptFormula(0), DamageType.Fire); + + }; + if (Rune_B > 0 || Rune_D > 0) + { proj.Launch(TargetPosition, ScriptFormula(20)); } + else + proj.Launch(TargetPosition, ScriptFormula(1)); + + yield break; + } + [ImplementsPowerBuff(0)] + class FearedDebuff : PowerBuff + { + public override void Init() + { + base.Init(); + Timeout = WaitSeconds(ScriptFormula(6)); + } + public override bool Apply() + { + if (!base.Apply()) + return false; + + return true; + } + + public override void Remove() + { + base.Remove(); + } + } + } + #endregion + + //Complete + #region ShadowPower + [ImplementsPowerSNO(Skills.Skills.DemonHunter.Discipline.ShadowPower)] + public class ShadowPower : Skill + { + public override IEnumerable Main() + { + //patch added attack speed = 1.5 + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + UseSecondaryResource(EvalTag(PowerKeys.ResourceCost)); + //if Female + AddBuff(User, new ShadowPowerFemale()); + //else + //AddBuff(User, new ShadowPower()); + + yield break; + } + [ImplementsPowerBuff(0)] + class ShadowPowerFemale : PowerBuff + { + public override void Init() + { + base.Init(); + Timeout = WaitSeconds(ScriptFormula(0)); + } + public override bool Apply() + { + if (!base.Apply()) + return false; + Target.Attributes[GameAttribute.Attacks_Per_Second_Percent] += ScriptFormula(1); + + if (Rune_A > 0) + { + Target.Attributes[GameAttribute.Movement_Bonus_Run_Speed] += ScriptFormula(2); + } + if (Rune_B > 0) + { + Target.Attributes[GameAttribute.Resource_Regen_Bonus_Percent] += ScriptFormula(3); + } + if (Rune_C > 0) + { + Target.Attributes[GameAttribute.Dodge_Chance_Bonus] += ScriptFormula(4); + } + if (Rune_E > 0) + { + Target.Attributes[GameAttribute.Damage_Percent_Reduction_Turns_Into_Heal] += ScriptFormula(5); + } + + Target.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + public override void Remove() + { + base.Remove(); + Target.Attributes[GameAttribute.Attacks_Per_Second_Percent] -= ScriptFormula(0); + + if (Rune_A > 0) + { + Target.Attributes[GameAttribute.Movement_Bonus_Run_Speed] -= ScriptFormula(2); + } + if (Rune_B > 0) + { + Target.Attributes[GameAttribute.Resource_Regen_Bonus_Percent] -= ScriptFormula(3); + } + if (Rune_C > 0) + { + Target.Attributes[GameAttribute.Dodge_Chance_Bonus] -= ScriptFormula(4); + } + if (Rune_E > 0) + { + Target.Attributes[GameAttribute.Damage_Percent_Reduction_Turns_Into_Heal] -= ScriptFormula(5); + } + + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + } + #endregion + + //TODO: Max Traps + Runes_B,C,D,E Once maxtraps gets figured out, B will be solved. + #region SpikeTrap + [ImplementsPowerSNO(Skills.Skills.DemonHunter.HatredGenerators.SpikeTrap)] + public class SpikeTrap : Skill + { + public override IEnumerable Main() + { + GeneratePrimaryResource(ScriptFormula(8)); + + if (Rune_C > 0) + { + /*var proj1 = new Projectile(this, 87564, User.Position); + proj1.Position.Z += 5f; + proj1.OnCollision = (hit) => + { + AddBuff(hit, new curseDebuff()); + }; + proj1.Launch(TargetPosition, ScriptFormula(12)); + */ + //TODO:there needs to be a traget for this. and needs to be its own function because you're planting it on a target. + // WeaponDamage(GetEnemiesInRadius(Target.Position, ScriptFormula(6)), ScriptFormula(0), DamageType.Fire); + } + else + { + var GroundSpot = SpawnProxy(User.Position); + var spikeTrapGround = SpawnEffect(111330, GroundSpot.Position, 0, WaitSeconds(ScriptFormula(4))); + + yield return WaitSeconds(ScriptFormula(3)); + + spikeTrapGround.UpdateDelay = 0.25f; + spikeTrapGround.OnUpdate = () => + { + if (GetEnemiesInRadius(GroundSpot.Position, ScriptFormula(5)).Actors.Count > 0) + { + spikeTrapGround.Destroy(); + var calTrops = SpawnEffect(75887, GroundSpot.Position); + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(GroundSpot.Position, ScriptFormula(5)); + attack.AddWeaponDamage(ScriptFormula(0), DamageType.Physical); + attack.Apply(); + + } + }; + } + + yield break; + } + [ImplementsPowerBuff(1)] + class curseDebuff : PowerBuff + { + + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(4)); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + return true; + } + public override void Remove() { base.Remove(); } + + public override void OnPayload(Payload payload) + { + if (payload.Target == Target && payload is DeathPayload) + { + Target.PlayEffectGroup(159027); + WeaponDamage(GetEnemiesInRadius(Target.Position, ScriptFormula(6)), ScriptFormula(0), DamageType.Fire); + } + } + } + } + #endregion + + //Complete, look over Rune_e's effect.. + #region Multishot + [ImplementsPowerSNO(Skills.Skills.DemonHunter.HatredSpenders.Multishot)] + public class Multishot : Skill + { + public override IEnumerable Main() + { + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + User.PlayEffectGroup(RuneSelect(77647, 154203, 154204, 154208, 154211, 154212)); + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInArcDirection(User.Position, TargetPosition, ScriptFormula(21), ScriptFormula(23)); + attack.AddWeaponDamage(ScriptFormula(0), + RuneSelect(DamageType.Physical, DamageType.Physical, DamageType.Physical, DamageType.Physical, + DamageType.Lightning, DamageType.Physical)); + if (Rune_E > 0) + { + attack.OnHit = HitPayload => + { + //Every enemy hit grants 1 Discipline. Each volley can gain up to SF(10) Discipline in this way. + GenerateSecondaryResource(Math.Min(ScriptFormula(9), ScriptFormula(10))); + }; + } + attack.Apply(); + + if (Rune_B > 0) + { + User.PlayEffectGroup(154409); + WeaponDamage(GetEnemiesInRadius(User.Position, ScriptFormula(2)), ScriptFormula(1), DamageType.Arcane); + } + yield return WaitSeconds(ScriptFormula(17)); + + if (Rune_C > 0) + { + Vector3D[] targetDirs; + targetDirs = new Vector3D[(int)ScriptFormula(3)]; + + int takenPos = 0; + foreach (Actor actor in GetEnemiesInArcDirection(User.Position, TargetPosition, ScriptFormula(4), ScriptFormula(23)).Actors) + { + targetDirs[takenPos] = actor.Position; + ++takenPos; + if (takenPos >= targetDirs.Length) + break; + } + + if (takenPos < targetDirs.Length) + { + PowerMath.GenerateSpreadPositions(User.Position, TargetPosition, 10f, targetDirs.Length - takenPos) + .CopyTo(targetDirs, takenPos); + } + + foreach (Vector3D position in targetDirs) + { + var proj = new Projectile(this, 154939, User.Position); + proj.Position.Z += 5f; // fix height + proj.OnCollision = (hit) => + { + // hit effect + hit.PlayEffectGroup(196636); + + if (Rune_B > 0) + WeaponDamage(hit, ScriptFormula(6), DamageType.Fire); + + proj.Destroy(); + }; + proj.Launch(position, ScriptFormula(20)); + } + } + + yield break; + } + } + #endregion + + //TODO:Rune_A -> cloud isnt working for some reason.. + #region SmokeScreen + [ImplementsPowerSNO(Skills.Skills.DemonHunter.Discipline.SmokeScreen)] + public class SmokeScreen : Skill + { + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + UseSecondaryResource(EvalTag(PowerKeys.ResourceCost)); + + var cloudCover = SpawnProxy(User.Position, WaitSeconds(ScriptFormula(4))); + cloudCover.PlayEffectGroup(131425); + cloudCover.OnTimeout = () => + { + cloudCover.World.BuffManager.RemoveAllBuffs(cloudCover); + }; + + AddBuff(User, new SmokeScreenBuff()); + + AddBuff(cloudCover, new SmokeScreenCloud()); + + yield break; + } + [ImplementsPowerBuff(0)] + class SmokeScreenCloud : PowerBuff + { + const float _damageRate = 1f; + TickTimer _damageTimer = null; + + public override void Init() + { + base.Init(); + Timeout = WaitSeconds(ScriptFormula(4)); + } + public override bool Apply() + { + if (!base.Apply()) + return false; + return true; + } + public override bool Update() + { + if (base.Update()) + return true; + + if (_damageTimer == null || _damageTimer.TimedOut) + { + _damageTimer = WaitSeconds(_damageRate); + if (GetEnemiesInRadius(Target.Position, ScriptFormula(3)) != null) + { + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(Target.Position, ScriptFormula(3)); + attack.AddWeaponDamage(ScriptFormula(5), DamageType.Physical); + attack.Apply(); + } + } + + return false; + } + public override void Remove() + { + base.Remove(); + } + } + //may not be for every cast, does not show the cloud animation around you in a video.. + [ImplementsPowerBuff(2)] + class SmokeScreenBuff : PowerBuff + { + const float _damageRate = 1f; + TickTimer _damageTimer = null; + + public override void Init() + { + base.Init(); + Timeout = WaitSeconds(ScriptFormula(0)); + } + public override bool Apply() + { + if (!base.Apply()) + return false; + User.Attributes[GameAttribute.Look_Override] = 0x04E733FD; + User.Attributes[GameAttribute.Stealthed] = true; + + if (Rune_E > 0) + { + User.Attributes[GameAttribute.Movement_Bonus_Run_Speed] += ScriptFormula(12); + } + return true; + } + + public override bool Update() + { + if (base.Update()) + return true; + if (Rune_C > 0) + { + if (_damageTimer == null || _damageTimer.TimedOut) + { + _damageTimer = WaitSeconds(_damageRate); + + GeneratePrimaryResource(ScriptFormula(10)); + } + } + + return false; + } + + public override void Remove() + { + base.Remove(); + //User.PlayEffectGroup(133698); //reappear + User.Attributes[GameAttribute.Stealthed] = false; + User.Attributes[GameAttribute.Look_Override] = 0; + + if (Rune_E > 0) + { + User.Attributes[GameAttribute.Movement_Bonus_Run_Speed] -= ScriptFormula(12); + } + } + } + } + #endregion + + //TODO: possibly redo, this is a concept. + #region Strafe + [ImplementsPowerSNO(Skills.Skills.DemonHunter.HatredGenerators.Strafe)] + public class Strafe : ChanneledSkill + { + private Actor _target = null; + + public override void OnChannelOpen() + { + EffectsPerSecond = 0.25f; + //User.PlayEffectGroup(150049); //unknown where this could go. + User.Attributes[GameAttribute.Projectile_Speed] = User.Attributes[GameAttribute.Projectile_Speed] * ScriptFormula(13); + User.Attributes[GameAttribute.Movement_Bonus_Run_Speed] += ScriptFormula(8); + User.Attributes.BroadcastChangedIfRevealed(); + } + + public override void OnChannelClose() + { + if (_target != null) + _target.Destroy(); + User.Attributes[GameAttribute.Projectile_Speed] = User.Attributes[GameAttribute.Projectile_Speed] / ScriptFormula(13); + User.Attributes[GameAttribute.Movement_Bonus_Run_Speed] -= ScriptFormula(8); + User.Attributes.BroadcastChangedIfRevealed(); + } + + public override void OnChannelUpdated() + { + User.TranslateFacing(TargetPosition); + // client updates target actor position + } + + public override IEnumerable Main() + { + //"Use SpecialWalk Steering" + + //projectiles + var Target = GetEnemiesInArcDirection(User.Position, TargetPosition, ScriptFormula(2), 180f).GetClosestTo(User.Position); + //todo:else should it fire if there are no mobs? seems like it should but unknown how that should work. + + var proj1 = new Projectile(this, 149790, User.Position); + proj1.Position.Z += 6f; + proj1.Launch(Target.Position, ScriptFormula(10)); + UsePrimaryResource(ScriptFormula(19)); + proj1.OnCollision = (hit) => + { + SpawnEffect(218504, new Vector3D(hit.Position.X, hit.Position.Y, hit.Position.Z + 6f)); // impact effect (fix height) + proj1.Destroy(); + WeaponDamage(hit, ScriptFormula(1), DamageType.Physical); + }; + + yield return WaitSeconds(ScriptFormula(4)); + } + } + #endregion + + //Main skill complete, TODO: Runes. + #region MarkedForDeath + [ImplementsPowerSNO(Skills.Skills.DemonHunter.Discipline.MarkedForDeath)] + public class MarkedForDeath : Skill + { + public override IEnumerable Main() + { + UseSecondaryResource(EvalTag(PowerKeys.ResourceCost)); + AddBuff(Target, new DeathMarkBuff()); + yield break; + } + [ImplementsPowerBuff(0)] + class DeathMarkBuff : PowerBuff + { + public override void Init() + { + base.Init(); + Timeout = WaitSeconds(ScriptFormula(0)); + } + public override bool Apply() + { + if (!base.Apply()) + return false; + Target.Attributes[GameAttribute.Defense_Reduction_Percent] += ScriptFormula(1); + return true; + } + public override void Remove() + { + base.Remove(); + Target.Attributes[GameAttribute.Defense_Reduction_Percent] -= ScriptFormula(1); + } + } + } + #endregion + + //Complete + #region Preparation + [ImplementsPowerSNO(Skills.Skills.DemonHunter.Discipline.Preparation)] + public class Preparation : Skill + { + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + UseSecondaryResource(EvalTag(PowerKeys.ResourceCost)); + + User.PlayEffectGroup(RuneSelect(132466, 148872, 148873, 148874, 148875, 148876)); + if (Rune_A > 0) + { + GeneratePrimaryResource(999f); + } + else if (Rune_D > 0) + { + GenerateSecondaryResource(999f); + //Restore 55% of life + } + else if (Rune_E > 0) + { + if (Rand.NextDouble() < ScriptFormula(7)) + { + User.PlayEffectGroup(158497); + GenerateSecondaryResource(999f); + } + else + GenerateSecondaryResource(999f); + } + else + { + GenerateSecondaryResource(999f); + if (Rune_B > 0) + { + AddBuff(User, new IndigoBuff()); + } + if (Rune_C > 0) + { + AddBuff(User, new ObsidianBuff()); + } + } + yield break; + } + [ImplementsPowerBuff(0)] + class IndigoBuff : PowerBuff + { + public override void Init() + { + base.Init(); + Timeout = WaitSeconds(ScriptFormula(2)); + } + public override bool Apply() + { + if (!base.Apply()) + return false; + //is there no bonus for discipline? + Target.Attributes[GameAttribute.Resource_Max_Bonus] += ScriptFormula(1); + return true; + } + public override void Remove() + { + base.Remove(); + Target.Attributes[GameAttribute.Resource_Max_Bonus] -= ScriptFormula(1); + } + } + [ImplementsPowerBuff(1)] + class ObsidianBuff : PowerBuff + { + const float _damageRate = 1f; + TickTimer _damageTimer = null; + + public override void Init() + { + base.Init(); + Timeout = WaitSeconds(ScriptFormula(5)); + } + + public override bool Update() + { + if (base.Update()) + return true; + + if (_damageTimer == null || _damageTimer.TimedOut) + { + _damageTimer = WaitSeconds(_damageRate); + + GenerateSecondaryResource(ScriptFormula(4) / ScriptFormula(5)); + } + + return false; + } + } + } + #endregion + + //TODO: project and main explosion work, need baby grenades bouncing fixed and then baby explosion should be okay. + #region ClusterArrow + [ImplementsPowerSNO(Skills.Skills.DemonHunter.HatredSpenders.ClusterArrow)] + public class ClusterArrow : Skill + { + + public override IEnumerable Main() + { + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + var GroundSpot = SpawnProxy(TargetPosition); + + var proj = new Projectile(this, RuneSelect(129603, 166549, 166550, 167218, 166636, 166621), User.Position); + proj.Position.Z += 5f; // fix height + proj.Launch(GroundSpot.Position, ScriptFormula(3)); + proj.OnArrival = () => + { + //main explosion + proj.Destroy(); + var Impact = SpawnEffect(129787, GroundSpot.Position); + WeaponDamage(GetEnemiesInRadius(GroundSpot.Position, ScriptFormula(1)), ScriptFormula(0), DamageType.Fire); + }; + + TickTimer timeout = WaitSeconds(1f); + Projectile[] grenades = new Projectile[4]; + for (int i = 0; i < grenades.Length; ++i) + { + var projectile = new Projectile(this, 129621, GroundSpot.Position); + projectile.Timeout = timeout; + grenades[i] = projectile; + } + + Vector3D[] projDestinations = PowerMath.GenerateSpreadPositions(GroundSpot.Position, RandomDirection(GroundSpot.Position, 7f), 90f, grenades.Length); + // launch and bounce grenades + yield return WaitTicks(1); // helps make bounce timings more consistent + + float bounceOffset = 5f; + float minHeight = ScriptFormula(24); + float height = minHeight + ScriptFormula(25); + float bouncePercent = 0.3f; // ScriptFormula(26); + while (!timeout.TimedOut) + { + for (int i = 0; i < grenades.Length; ++i) + { + grenades[i].LaunchArc(projDestinations[i], height, ScriptFormula(28), ScriptFormula(30)); + } + + height *= bouncePercent; + bounceOffset *= 0.3f; + + yield return grenades[0].ArrivalTime; + } + foreach (var grenade in grenades) + { + var grenadeN = grenade; + + SpawnEffect(129788, grenade.Position); + + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(grenade.Position, ScriptFormula(6)); + attack.AddWeaponDamage(ScriptFormula(5), DamageType.Fire); + attack.Apply(); + } + } + } + #endregion + + //Not Started. Attempted and failed. + #region Chakram + [ImplementsPowerSNO(Skills.Skills.DemonHunter.HatredSpenders.Chakram)] + public class Chakram : Skill + { + + public override IEnumerable Main() + { + //http://www.youtube.com/watch?v=9xKCTla3sQU + + //swirling motion with projectile is NoRune. + + //Rune_A has two chakrams, both same direction just flipped paths + + //Rune_B makes a boomerrang, travelling away from then back to User + + //Rune_C makes a slow curve + //projectile speed = 0.2 while the rest is done by attack speed + + //Rune_D spirals out to target, actor calls it a straight projectile. + + //Rune_E is just a buff shield + if (Rune_E > 0) + { + AddBuff(User, new ChakramBuff()); + } + else + { + var proj = new Projectile(this, RuneSelect(129228, 129228, 148845, 148846, 148847, -1), User.Position); + proj.Position.Z += 3f; // fix height //might be a better height at 3? + proj.Launch(TargetPosition, 0.2f); + proj.OnCollision = (hit) => + { + WeaponDamage(hit, ScriptFormula(0), RuneSelect(DamageType.Physical, DamageType.Physical, DamageType.Lightning, DamageType.Poison, DamageType.Arcane, DamageType.Physical)); + proj.Destroy(); + }; + } + yield break; + } + [ImplementsPowerBuff(0)] + class ChakramBuff : PowerBuff + { + const float _damageRate = 0.5f; + TickTimer _damageTimer = null; + + public override void Init() + { + base.Init(); + Timeout = WaitSeconds(ScriptFormula(12)); + } + + public override bool Update() + { + if (base.Update()) + return true; + + if (_damageTimer == null || _damageTimer.TimedOut) + { + _damageTimer = WaitSeconds(_damageRate); + + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(15)); + attack.AddWeaponDamage(ScriptFormula(13), DamageType.Physical); + attack.Apply(); + } + + return false; + } + } + } + #endregion + + //pet class + #region Sentry + [ImplementsPowerSNO(Skills.Skills.DemonHunter.Discipline.Sentry)] + public class Sentry : Skill + { + + public override IEnumerable Main() + { + yield break; + } + } + #endregion + + //TODO:Pet class. + #region Companion + [ImplementsPowerSNO(Skills.Skills.DemonHunter.Discipline.Companion)] + public class Companion : Skill + { + + public override IEnumerable Main() + { + var FerretFriend = new CompanionMinion(this.World, this, 0); + FerretFriend.Brain.DeActivate(); + FerretFriend.Position = RandomDirection(User.Position, 3f, 8f); //Kind of hacky until we get proper collisiondetection + FerretFriend.Attributes[GameAttribute.Untargetable] = true; + FerretFriend.EnterWorld(FerretFriend.Position); + yield return WaitSeconds(0.8f); + + (FerretFriend as Minion).Brain.Activate(); + FerretFriend.Attributes[GameAttribute.Untargetable] = false; + FerretFriend.Attributes.BroadcastChangedIfRevealed(); + + yield break; + } + } + #endregion + + //TODO - Fix vault + #region Vault + [ImplementsPowerSNO(Skills.Skills.DemonHunter.Discipline.Vault)] + public class DemonHunterVault : Skill + { + public override IEnumerable Main() + { + //StartCooldown(WaitSeconds(10f)); + + ActorMover mover = new ActorMover(User); + mover.MoveArc(TargetPosition, 3, -0.1f, new ACDTranslateArcMessage + { + //Field3 = 303110, // used for male barb leap, not needed? + FlyingAnimationTagID = AnimationSetKeys.Attack2.ID, + LandingAnimationTagID = -1, + PowerSNO = PowerSNO + }); + + // wait for landing + while (!mover.Update()) + yield return WaitTicks(1); + + yield break; + } + } + #endregion + + //TODO:Fix Rune B projectile on User, Check Rune_E + #region FanOfKnives + [ImplementsPowerSNO(Skills.Skills.DemonHunter.HatredSpenders.FanOfKnives)] + public class DemonHunterFanOfKnives : Skill + { + public override IEnumerable Main() + { + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + + if (Rune_E > 0) + { + AddBuff(User, new AlabasterBuff()); + } + else if (Rune_B > 0) + { + Vector3D[] targetDirs; + targetDirs = new Vector3D[(int)ScriptFormula(13)]; + + int takenPos = 0; + foreach (Actor actor in GetEnemiesInRadius(User.Position, ScriptFormula(17)).Actors) + { + targetDirs[takenPos] = actor.Position; + ++takenPos; + if (takenPos >= targetDirs.Length) + break; + } + if (takenPos < targetDirs.Length) + { + //this seems to generate a projectile on User..? + PowerMath.GenerateSpreadPositions(User.Position, TargetPosition, 10f, targetDirs.Length - takenPos) + .CopyTo(targetDirs, takenPos); + } + + foreach (Vector3D position in targetDirs) + { + var proj = new Projectile(this, 147809, User.Position); + proj.Position.Z += 5f; // fix height + proj.OnCollision = (hit) => + { + WeaponDamage(hit, ScriptFormula(16), DamageType.Physical); + proj.Destroy(); + }; + proj.Launch(position, ScriptFormula(7)); + } + } + else + { + User.PlayEffectGroup(77547); + + yield return WaitSeconds(0.5f); + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(2)); + attack.AddWeaponDamage(ScriptFormula(0), DamageType.Physical); + attack.OnHit = (hit) => + { + if (Rune_C > 0) + { + if (Rand.NextDouble() < ScriptFormula(10)) + { + AddBuff(hit.Target, new DebuffStunned(WaitSeconds(ScriptFormula(11)))); + } + } + else + AddBuff(hit.Target, new DebuffSlowed(ScriptFormula(6), WaitSeconds(ScriptFormula(5)))); + }; + attack.Apply(); + } + yield break; + } + + [ImplementsPowerBuff(0)] + class AlabasterBuff : PowerBuff + { + public override void Init() + { + base.Init(); + Timeout = WaitSeconds(ScriptFormula(15)); + } + public override bool Apply() + { + if (!base.Apply()) + return false; + return true; + } + public override void Remove() + { + base.Remove(); + } + public override void OnPayload(Payload payload) + { + if (payload.Target == Target && payload is DeathPayload) + { + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(2)); + attack.AddWeaponDamage(ScriptFormula(0), DamageType.Physical); + attack.Apply(); + base.Remove(); + } + } + } + } + #endregion + + //spirit walk: 0xF2F224EA (used on pet proxy) + //vault: 0x04E733FD + //diamondskin: 0x061F7489 + //smokescreen: 0x04E733FD + + //12 Passive Skills +} diff --git a/src/Mooege/Core/GS/Powers/Implementations/HeroSkills/Monk.cs b/src/Mooege/Core/GS/Powers/Implementations/HeroSkills/Monk.cs new file mode 100644 index 00000000..b82db8e2 --- /dev/null +++ b/src/Mooege/Core/GS/Powers/Implementations/HeroSkills/Monk.cs @@ -0,0 +1,2447 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using System.Text; +using Mooege.Core.GS.Actors.Implementations.Minions; +using Mooege.Core.GS.Skills; +using Mooege.Net.GS.Message.Fields; +using Mooege.Core.GS.Actors; +using Mooege.Net.GS.Message; +using Mooege.Net.GS.Message.Definitions.Actor; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Players; +using Mooege.Core.GS.Ticker; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Core.GS.Powers.Payloads; +using Mooege.Net.GS.Message.Definitions.ACD; + +namespace Mooege.Core.GS.Powers.Implementations +{ + //Complete + #region DeadlyReach + [ImplementsPowerSNO(Skills.Skills.Monk.SpiritGenerator.DeadlyReach)] + public class MonkDeadlyReach : ComboSkill + { + public override IEnumerable Main() + { + float reachRadius; + float reachDegrees; + + switch (ComboIndex) + { + case 0: + reachRadius = ScriptFormula(5); + reachDegrees = ScriptFormula(9); + break; + case 1: + reachRadius = ScriptFormula(4); + reachDegrees = ScriptFormula(3); + break; + case 2: + reachRadius = ScriptFormula(20); + reachDegrees = ScriptFormula(19); + break; + default: + yield break; + } + if (ComboIndex == 2 && Rune_C > 0) + { + bool hitAnything = false; + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(11), (int)ScriptFormula(8)); + attack.AddWeaponDamage(ScriptFormula(0), DamageType.Physical); + attack.OnHit = hitPayload => + { + hitAnything = true; + if (Rune_D > 0) + { + if (hitPayload.IsCriticalHit) + { + GeneratePrimaryResource(ScriptFormula(7)); + } + } + }; + attack.Apply(); + + if (hitAnything) + GeneratePrimaryResource(EvalTag(PowerKeys.SpiritGained)); + } + else + { + bool hitAnything = false; + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInArcDirection(User.Position, TargetPosition, reachRadius, reachDegrees); + attack.AddWeaponDamage(ScriptFormula(0), DamageType.Physical); + attack.OnHit = hitPayload => + { + hitAnything = true; + if (Rune_D > 0) + { + if (hitPayload.IsCriticalHit) + { + GeneratePrimaryResource(ScriptFormula(7)); + } + } + }; + attack.Apply(); + + if (hitAnything) + GeneratePrimaryResource(EvalTag(PowerKeys.SpiritGained)); + } + yield break; + } + + [ImplementsPowerBuff(1, true)] + class DeadlyReach_RuneAbuff : PowerBuff + { + public override void Init() + { + base.Init(); + Timeout = WaitSeconds(ScriptFormula(14)); + MaxStackCount = (int)ScriptFormula(12); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + + _AddAmp(); + return true; + } + + public override void Remove() + { + base.Remove(); + Target.Attributes[GameAttribute.Attack_Bonus_Percent] -= StackCount * ScriptFormula(13); + Target.Attributes.BroadcastChangedIfRevealed(); + } + + public override bool Stack(Buff buff) + { + bool stacked = StackCount < MaxStackCount; + + base.Stack(buff); + + if (stacked) + _AddAmp(); + + return true; + } + + private void _AddAmp() + { + Target.Attributes[GameAttribute.Attack_Bonus_Percent] += ScriptFormula(13); + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + [ImplementsPowerBuff(0)] + class DeadlyReach_Armorbuff : PowerBuff + { + public override void Init() + { + base.Init(); + Timeout = WaitSeconds(ScriptFormula(21)); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + Target.Attributes[GameAttribute.Armor_Bonus_Percent] += ScriptFormula(22); + Target.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + public override void Remove() + { + base.Remove(); + Target.Attributes[GameAttribute.Armor_Bonus_Percent] -= ScriptFormula(22); + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + } + #endregion + + //TODO Rune_A,B,C + #region FistsOfThunder + [ImplementsPowerSNO(Skills.Skills.Monk.SpiritGenerator.FistsOfThunder)] + public class MonkFistsOfThunder : ComboSkill + { + public override IEnumerable Main() + { + switch (TargetMessage.Field5) + { + case 0: + if (Rune_A > 0) + { + //Teleport if TargetPosition >= Minimum Distance of 27f away && Target != null (SCriptF(3)) + } + MeleeStageHit(); + break; + case 1: + MeleeStageHit(); + break; + case 2: + //AddBuff(User, new ComboStage3Buff()); + + // put target position a little bit in front of the monk. represents the lightning ball + TargetPosition = PowerMath.TranslateDirection2D(User.Position, TargetPosition, + User.Position, ScriptFormula(6)); + + bool hitAnything = false; + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(TargetPosition, ScriptFormula(20)); + attack.AddWeaponDamage(Rune_A > 0 ? ScriptFormula(7) : ScriptFormula(0), DamageType.Lightning); + attack.OnHit = hitPayload => + { + hitAnything = true; + if (Rune_B > 0) + { + //Chain of Lightning + //SF(10) = Max L Jumps + //SF(11) = L Damage + //SF(12) = L Jump Search Radius + } + else + { + Knockback(hitPayload.Target, ScriptFormula(21)); + } + if (Rune_D > 0) + { + if (hitPayload.IsCriticalHit) + { + GeneratePrimaryResource(ScriptFormula(16)); + } + } + }; + attack.Apply(); + + if (hitAnything) + { + GeneratePrimaryResource(EvalTag(PowerKeys.SpiritGained)); + if (Rune_E > 0) + { + AddBuff(User, new TFists_LightningBuff()); + } + } + + break; + } + + yield break; + } + + private void MeleeStageHit() + { + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetBestMeleeEnemy(); + attack.AddWeaponDamage(Rune_A > 0 ? ScriptFormula(7) : ScriptFormula(0), DamageType.Lightning); + attack.OnHit = hitPayload => + { + GeneratePrimaryResource(EvalTag(PowerKeys.SpiritGained)); + if (Rune_D > 0) + { + if (hitPayload.IsCriticalHit) + { + GeneratePrimaryResource(ScriptFormula(16)); + } + } + if (Rune_E > 0) + { + AddBuff(User, new TFists_LightningBuff()); + } + }; + attack.Apply(); + } + [ImplementsPowerBuff(2, true)] + class TFists_LightningBuff : PowerBuff + { + public override void Init() + { + base.Init(); + Timeout = WaitSeconds(ScriptFormula(19)); + MaxStackCount = (int)ScriptFormula(17); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + + _AddAmp(); + return true; + } + + public override void Remove() + { + base.Remove(); + Target.Attributes[GameAttribute.Dodge_Chance_Bonus] -= StackCount * ScriptFormula(18); + Target.Attributes.BroadcastChangedIfRevealed(); + } + + public override bool Stack(Buff buff) + { + bool stacked = StackCount < MaxStackCount; + + base.Stack(buff); + + if (stacked) + _AddAmp(); + + return true; + } + + private void _AddAmp() + { + Target.Attributes[GameAttribute.Dodge_Chance_Bonus] += ScriptFormula(18); + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + + [ImplementsPowerBuff(7)] + class ComboStage3Buff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(0.5f / EvalTag(PowerKeys.ComboAttackSpeed3)); + } + } + } + #endregion + + //TODO Rune_A,C + #region SevenSidedStrike + [ImplementsPowerSNO(Skills.Skills.Monk.SpiritSpenders.SevenSidedStrike)] + public class MonkSevenSidedStrike : Skill + { + //Max Teleport Distance added in last patch 8101. + //attack delay end SF(16) + //A: Max Tele Dist SF(19) + //Total Time SF(2) + //Impact Radius? SF(13) + //C: 7,8,9 + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + var groundEffect = SpawnProxy(TargetPosition, WaitInfinite()); + groundEffect.PlayEffectGroup(145041); + + for (int n = 0; n < ScriptFormula(5); ++n) + { + IList nearby = GetEnemiesInRadius(TargetPosition, ScriptFormula(6)).Actors; + if (nearby.Count > 0) + { + var target = nearby[Rand.Next(0, nearby.Count)]; + + SpawnEffect(99063, target.Position, -1); + yield return WaitSeconds(ScriptFormula(4)); + + if (Rune_E > 0) + { + target.PlayEffectGroup(99098); + var splashTargets = GetEnemiesInRadius(target.Position, ScriptFormula(14)); + splashTargets.Actors.Remove(target); // don't hit target with splash + WeaponDamage(splashTargets, ScriptFormula(12), DamageType.Holy); + } + + WeaponDamage(target, ScriptFormula(0), DamageType.Physical); + } + else + { + break; + } + } + + groundEffect.Destroy(); + } + } + #endregion + + //TODO Slow, Rune_C,D,E + #region CripplingWave + [ImplementsPowerSNO(Skills.Skills.Monk.SpiritGenerator.CripplingWave)] + public class MonkCripplingWave : ComboSkill + { + public override IEnumerable Main() + { + int effectSNO; + switch (ComboIndex) + { + case 0: + effectSNO = 18987; + break; + case 1: + effectSNO = 18988; + break; + case 2: + effectSNO = 96519; + break; + default: + yield break; + } + + User.PlayEffectGroup(effectSNO); + + bool hitAnything = false; + AttackPayload attack = new AttackPayload(this); + if (ComboIndex != 2) + attack.Targets = GetEnemiesInArcDirection(User.Position, TargetPosition, ScriptFormula(5), ScriptFormula(6)); + else + attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(8)); + //dmg all enemies around you, why is there Angle SF(9) - EDIT: oh because it adds them together 180+180=360 + + attack.AddWeaponDamage(ScriptFormula(0), DamageType.Physical); + attack.OnHit = hitPayload => + { + hitAnything = true; + if (ComboIndex == 2) + { + //Attack Slow Amount SF(20) + AddBuff(hitPayload.Target, new DebuffSlowed(ScriptFormula(4), WaitSeconds(ScriptFormula(3)))); + } + if (Rune_D > 0) + { + if (hitPayload.IsCriticalHit) + { + //buff SF(15[Duration]+16[Generate Amount]) + } + } + if (Rune_E > 0) + { + //buff[3] + //Debuff to monsters that causes them to take 80% additional damage from all attacks + } + if (Rune_C > 0) + { + //buff[1] + //Debuff to monsters that caused them to inflict 50% less damage + } + }; + attack.Apply(); + + if (hitAnything) + GeneratePrimaryResource(EvalTag(PowerKeys.SpiritGained)); + + yield break; + } + } + #endregion + + //TODO Rune_E + #region ExplodingPalm + [ImplementsPowerSNO(Skills.Skills.Monk.SpiritGenerator.ExplodingPalm)] + public class MonkExplodingPalm : ActionTimedSkill + { + public override IEnumerable Main() + { + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + var target = GetBestMeleeEnemy(); + if (target.Actors.Count > 0) + { + AddBuff(target.Actors[0], new MainDebuff()); + if (Rune_C > 0) + AddBuff(target.Actors[0], new RuneCDebuff()); + else if (Rune_B > 0) + AddBuff(target.Actors[0], + // DebuffSlowed also lowers attack rate, not sure if it should only be movement. + new DebuffSlowed(ScriptFormula(18), WaitSeconds(ScriptFormula(3)))); + } + + yield break; + } + + [ImplementsPowerBuff(0)] + class MainDebuff : PowerBuff + { + const float _damageRate = 1.0f; + TickTimer _damageTimer = null; + + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(3)); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + + Target.Attributes[GameAttribute.Bleeding] = true; + Target.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + public override void Remove() + { + base.Remove(); + + Target.Attributes[GameAttribute.Bleeding] = false; + Target.Attributes.BroadcastChangedIfRevealed(); + } + + public override bool Update() + { + if (base.Update()) + return true; + + if (_damageTimer == null || _damageTimer.TimedOut) + { + _damageTimer = WaitSeconds(_damageRate); + + AttackPayload attack = new AttackPayload(this); + attack.SetSingleTarget(Target); + attack.AddWeaponDamage(ScriptFormula(6) * _damageRate, DamageType.Physical); + attack.AutomaticHitEffects = false; + attack.Apply(); + } + return false; + } + + public override void OnPayload(Payload payload) + { + if (payload.Target == Target && payload is DeathPayload) + { + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(Target.Position, ScriptFormula(11)); + attack.AddDamage(ScriptFormula(9) * Target.Attributes[GameAttribute.Hitpoints_Max_Total], + ScriptFormula(10), DamageType.Physical); + if (Rune_D > 0) + { + attack.OnHit = (hitPayload) => + { + GeneratePrimaryResource(ScriptFormula(14)); + }; + } + attack.Apply(); + + SpawnProxy(Target.Position).PlayEffectGroup(18991); + } + } + } + + [ImplementsPowerBuff(1, true)] + class RuneCDebuff : PowerBuff + { + public override void Init() + { + base.Init(); + Timeout = WaitSeconds(ScriptFormula(25)); + MaxStackCount = (int)ScriptFormula(17); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + + _AddAmp(); + return true; + } + + public override void Remove() + { + base.Remove(); + Target.Attributes[GameAttribute.Amplify_Damage_Percent] -= StackCount * ScriptFormula(15); + Target.Attributes.BroadcastChangedIfRevealed(); + } + + public override bool Stack(Buff buff) + { + bool stacked = StackCount < MaxStackCount; + + base.Stack(buff); + + if (stacked) + _AddAmp(); + + return true; + } + + private void _AddAmp() + { + Target.Attributes[GameAttribute.Amplify_Damage_Percent] += ScriptFormula(15); + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + } + #endregion + + //TODO Rune_C,D (These happen at Max Stack Count + #region SweepingWind + [ImplementsPowerSNO(Skills.Skills.Monk.SpiritGenerator.SweepingWind)] + public class MonkSweepingWind : ComboSkill + { + //Buff0: Spirit Per second + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + switch (ComboIndex) + { + case 0: + AddBuff(User, new Stage1Sweep()); + MeleeStageHit(); + break; + case 1: + AddBuff(User, new Stage2Sweep()); + MeleeStageHit(); + break; + case 2: + AddBuff(User, new VortexBuff()); + + break; + } + + yield break; + } + + private void MeleeStageHit() + { + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(1)); + attack.AddWeaponDamage(ScriptFormula(4), DamageType.Physical); + attack.Apply(); + } + [ImplementsPowerBuff(1)] + class Stage1Sweep : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(0.5f); + } + public override bool Apply() + { + if (!base.Apply()) + return false; + return true; + } + public override void Remove() + { + base.Remove(); + } + } + [ImplementsPowerBuff(2)] + class Stage2Sweep : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(0.5f); + } + public override bool Apply() + { + if (!base.Apply()) + return false; + return true; + } + public override void Remove() + { + base.Remove(); + } + } + //Rune_E included + [ImplementsPowerBuff(3, true)] + class VortexBuff : PowerBuff + { + const float _damageRate = 0.25f; + TickTimer _damageTimer = null; + float _damagetotal = 0; + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(8)); + MaxStackCount = (int)ScriptFormula(10); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + + _AddAmp(); + return true; + } + + public override void Remove() + { + base.Remove(); + } + + public override bool Update() + { + if (base.Update()) + return true; + + if (_damageTimer == null || _damageTimer.TimedOut) + { + _damageTimer = WaitSeconds(_damageRate); + + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(13)); + attack.AddWeaponDamage(_damagetotal, DamageType.Physical); + //we divide by four because this is by second, and tick-intervals = 0.25 + attack.AutomaticHitEffects = false; + attack.Apply(); + } + return false; + } + public override bool Stack(Buff buff) + { + bool stacked = StackCount < MaxStackCount; + + base.Stack(buff); + + if (stacked) + _AddAmp(); + + return true; + } + + private void _AddAmp() + { + _damagetotal += (ScriptFormula(6) / 4f); + } + } + } + #endregion + + //TODO:Rune_A(Dash), Rune_E(Stage3), and Stage 2 //exception on third stage ? + #region WayOfTheHundredFists + [ImplementsPowerSNO(Skills.Skills.Monk.SpiritGenerator.WayOfTheHundredFists)] + public class MonkWayOfTheHundredFists : ComboSkill + { + public override IEnumerable Main() + { + switch (TargetMessage.Field5) + { + case 0: + if (Rune_A > 0) + { + //Dash + } + else + { + MeleeStageHit(); + } + break; + case 1: + //stage 2 get hit chance bonus + MultiHit(); + break; + case 2: + if (Rune_D > 0) + { + if (Rand.NextDouble() < ScriptFormula(25)) + { + GeneratePrimaryResource(ScriptFormula(24)); + } + } + + bool hitAnything = false; + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInArcDirection(User.Position, TargetPosition, ScriptFormula(30), ScriptFormula(31)); + attack.AddWeaponDamage(ScriptFormula(2), DamageType.Holy); + attack.OnHit = hitPayload => + { + hitAnything = true; + Knockback(hitPayload.Target, ScriptFormula(5), ScriptFormula(6)); + if (Rune_A > 0) + { + AddBuff(hitPayload.Target, new RuneA_DOT_100Fists()); + } + }; + attack.Apply(); + + if (hitAnything) + { + GeneratePrimaryResource(EvalTag(PowerKeys.SpiritGained)); + if (Rune_C > 0) + { + AddBuff(User, new RuneCbuff()); + } + } + //TODO: Range should be only 40f ahead. + if (Rune_E > 0) + { + var proj = new Projectile(this, 136022, User.Position); + proj.Launch(TargetPosition, ScriptFormula(23)); + proj.OnCollision = (hit) => + { + //proj.Destroy(); + WeaponDamage(hit, ScriptFormula(11), DamageType.Physical); + }; + } + + break; + } + + yield break; + } + public override float GetContactDelay() + { + return 0f; + } + private void MeleeStageHit() + { + if (Rune_D > 0) + { + if (Rand.NextDouble() < ScriptFormula(25)) + { + GeneratePrimaryResource(ScriptFormula(24)); + } + } + bool hitAnything = false; + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetBestMeleeEnemy(); + attack.AddWeaponDamage(ScriptFormula(0), DamageType.Physical); + attack.OnHit = hitPayload => + { + hitAnything = true; + }; + attack.Apply(); + + if (hitAnything) + { + GeneratePrimaryResource(EvalTag(PowerKeys.SpiritGained)); + if (Rune_C > 0) + { + AddBuff(User, new RuneCbuff()); + } + } + } + private void MultiHit() + { + if (Rune_D > 0) + { + if (Rand.NextDouble() < ScriptFormula(25)) + { + GeneratePrimaryResource(ScriptFormula(24)); + } + } + //TODO: this needs to be redone when I figure out how to do multiple hits to certain MAX targets.. + bool hitAnything = false; + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInArcDirection(User.Position, TargetPosition, ScriptFormula(28), ScriptFormula(29)); + attack.AddWeaponDamage(ScriptFormula(1), DamageType.Physical); + attack.OnHit = hitPayload => + { + hitAnything = true; + if (Rune_A > 0) + { + AddBuff(hitPayload.Target, new RuneA_DOT_100Fists()); + } + }; + attack.Apply(); + + if (hitAnything) + { + GeneratePrimaryResource(EvalTag(PowerKeys.SpiritGained)); + if (Rune_C > 0) + { + AddBuff(User, new RuneCbuff()); + } + } + } + [ImplementsPowerBuff(3)] + class RuneA_DOT_100Fists : PowerBuff + { + const float _damageRate = 1f; + TickTimer _damageTimer = null; + + public override void Init() + { + base.Init(); + Timeout = WaitSeconds(ScriptFormula(15)); + } + + public override bool Update() + { + if (base.Update()) + return true; + + if (_damageTimer == null || _damageTimer.TimedOut) + { + _damageTimer = WaitSeconds(_damageRate); + + WeaponDamage(Target, ScriptFormula(16), DamageType.Holy); + } + + return false; + } + public override bool Apply() + { + if (!base.Apply()) + return false; + return true; + } + + public override void Remove() + { + base.Remove(); + } + } + [ImplementsPowerBuff(1, true)] + class RuneCbuff : PowerBuff + { + public override void Init() + { + base.Init(); + Timeout = WaitSeconds(ScriptFormula(10)); + MaxStackCount = (int)ScriptFormula(9); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + + _AddAmp(); + return true; + } + + public override void Remove() + { + base.Remove(); + Target.Attributes[GameAttribute.Attacks_Per_Second_Bonus] -= StackCount * ScriptFormula(7); + Target.Attributes[GameAttribute.Movement_Bonus_Run_Speed] -= StackCount * ScriptFormula(8); + Target.Attributes.BroadcastChangedIfRevealed(); + } + + public override bool Stack(Buff buff) + { + bool stacked = StackCount < MaxStackCount; + + base.Stack(buff); + + if (stacked) + _AddAmp(); + + return true; + } + + private void _AddAmp() + { + Target.Attributes[GameAttribute.Attacks_Per_Second_Bonus] += ScriptFormula(7); + Target.Attributes[GameAttribute.Movement_Bonus_Run_Speed] += ScriptFormula(8); + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + } + #endregion + + //TODO:Rune_A,B,C + #region DashingStrike + [ImplementsPowerSNO(Skills.Skills.Monk.SpiritSpenders.DashingStrike)] + public class MonkDashingStrike : Skill + { + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + // dashing strike never specifies the target's id so we just search for the closest target + Target = GetEnemiesInRadius(TargetPosition, ScriptFormula(0)).GetClosestTo(TargetPosition); + + if (Target != null) + { + // put dash destination just beyond target + TargetPosition = PowerMath.TranslateDirection2D(User.Position, Target.Position, Target.Position, ScriptFormula(2)); + } + else + { + // if no target, always dash fixed amount + TargetPosition = PowerMath.TranslateDirection2D(User.Position, TargetPosition, User.Position, ScriptFormula(7)); + } + + var dashBuff = new DashMoverBuff(TargetPosition); + AddBuff(User, dashBuff); + yield return dashBuff.Timeout; + + if (Target != null && Target.World != null) // target could've died or left world + { + User.TranslateFacing(Target.Position, true); + yield return WaitSeconds(0.1f); + User.PlayEffectGroup(113720); + WeaponDamage(Target, ScriptFormula(1), DamageType.Physical); + if (Rune_E > 0) + { + if (Rand.NextDouble() < ScriptFormula(32)) + { + AddBuff(Target, new DebuffStunned(WaitSeconds(ScriptFormula(33)))); + } + } + } + if (Rune_C > 0) + { + //Dodge Chance Buff + } + if (Rune_B > 0) + { + //Movement Speed Buff + } + } + + [ImplementsPowerBuff(0)] + class DashMoverBuff : PowerBuff + { + private Vector3D _destination; + private ActorMover _mover; + + public DashMoverBuff(Vector3D destination) + { + _destination = destination; + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + + // dash speed seems to always be actor speed * 10 + float speed = Target.Attributes[GameAttribute.Running_Rate_Total] * ScriptFormula(5); + + Target.TranslateFacing(_destination, true); + _mover = new ActorMover(Target); + _mover.Move(_destination, speed, new ACDTranslateNormalMessage + { + TurnImmediately = true, + Field5 = 0x9206, // alt: 0x920e, not sure what this param is for. + AnimationTag = 69808, // dashing strike attack animation + Field7 = 6, // ticks to wait before playing attack animation + }); + + // make sure buff timeout is big enough otherwise the client will sometimes ignore the visual effects. + TickTimer minDashWait = WaitSeconds(0.15f); + Timeout = minDashWait.TimeoutTick > _mover.ArrivalTime.TimeoutTick ? minDashWait : _mover.ArrivalTime; + + Target.Attributes[GameAttribute.Hidden] = true; + Target.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + // (TODO) Update -> While moving head first, any enemy in path Gets slowed, RUNE_A + + public override void Remove() + { + base.Remove(); + Target.Attributes[GameAttribute.Hidden] = false; + Target.Attributes.BroadcastChangedIfRevealed(); + } + + public override bool Update() + { + _mover.Update(); + return base.Update(); + } + } + } + #endregion + + //TODO RuneA,E + #region MantraOfEvasion + [ImplementsPowerSNO(Skills.Skills.Monk.Mantras.MantraOfEvasion)] + public class MonkMantraOfEvasion : Skill + { + public override IEnumerable Main() + { + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + AddBuff(User, new CasterBuff()); + AddBuff(User, new CastBonusBuff()); + foreach (Actor ally in GetAlliesInRadius(User.Position, ScriptFormula(0)).Actors) + AddBuff(User, new CastBonusBuff()); + + yield break; + } + + class BaseDodgeBuff : PowerBuff + { + public override bool Apply() + { + if (!base.Apply()) + return false; + + Target.Attributes[GameAttribute.Dodge_Chance_Bonus] += ScriptFormula(2); + Target.Attributes.BroadcastChangedIfRevealed(); + + return true; + } + + public override void Remove() + { + base.Remove(); + + Target.Attributes[GameAttribute.Dodge_Chance_Bonus] -= ScriptFormula(2); + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + + class BaseFullEffectsBuff : BaseDodgeBuff + { + // TODO: Rune_E, when you or ally is under 20% life, shield around target reducing damage by 80% for 10 seconds. + // TODO: Rune_A, Dodging an enemy's attack, creates a burst of blames in raidus. + + public override bool Apply() + { + if (!base.Apply()) + return false; + if (Rune_B > 0) + { + Target.Attributes[GameAttribute.CrowdControl_Reduction] += ScriptFormula(4); + } + if (Rune_C > 0) + { + Target.Attributes[GameAttribute.Armor_Bonus_Percent] += ScriptFormula(5); + } + if (Rune_D > 0) + { + Target.Attributes[GameAttribute.Running_Rate_Total] += ScriptFormula(6); + } + return true; + } + + public override void Remove() + { + base.Remove(); + if (Rune_B > 0) + { + Target.Attributes[GameAttribute.CrowdControl_Reduction] -= ScriptFormula(4); + } + if (Rune_C > 0) + { + Target.Attributes[GameAttribute.Armor_Bonus_Percent] -= ScriptFormula(5); + } + if (Rune_D > 0) + { + Target.Attributes[GameAttribute.Running_Rate_Total] += ScriptFormula(6); + } + } + } + + [ImplementsPowerBuff(0)] + class CasterBuff : BaseFullEffectsBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(1)); + } + + public override void Remove() + { + base.Remove(); + + // aura fade effect + Target.PlayEffectGroup(199677); + } + + public override bool Update() + { + if (base.Update()) + return true; + + foreach (Actor ally in GetAlliesInRadius(Target.Position, ScriptFormula(0)).Actors) + AddBuff(ally, new AllyBuff()); + + return false; + } + } + + [ImplementsPowerBuff(7)] + class CastBonusBuff : BaseDodgeBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(13)); + } + } + + [ImplementsPowerBuff(1)] + class AllyBuff : BaseFullEffectsBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(11)); + } + } + } + #endregion + + //TODO Rune_C + #region BlindingFlash + [ImplementsPowerSNO(Skills.Skills.Monk.SpiritSpenders.BlindingFlash)] + public class MonkBlindingFlash : Skill + { + //Rune_D,B,A,E = done. + //buff[3] mass_confused -> Rune_C + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + var UsedPoint = SpawnProxy(User.Position); + + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(1)); + attack.OnHit = (hit) => + { + TickTimer waitBuffEnd = WaitSeconds(ScriptFormula(0)); + + // add main effect buff only if blind debuff took effect + if (AddBuff(hit.Target, new DebuffBlind(waitBuffEnd))) + AddBuff(hit.Target, new MainEffectBuff(waitBuffEnd)); + if (Rune_C > 0) + { + //chance of Charm. + } + }; + attack.Apply(); + + if (Rune_B > 0) + { + yield return WaitSeconds(ScriptFormula(11)); + UsedPoint.PlayEffectGroup(139497); + AttackPayload attack2 = new AttackPayload(this); + attack2.Targets = GetEnemiesInRadius(UsedPoint.Position, ScriptFormula(1)); + attack2.OnHit = (hit) => + { + TickTimer waitBuffEnd = WaitSeconds(ScriptFormula(13)); + + // add main effect buff only if blind debuff took effect + if (AddBuff(hit.Target, new DebuffBlind(waitBuffEnd))) + AddBuff(hit.Target, new MainEffectBuff(waitBuffEnd)); + AddBuff(hit.Target, new IndigoDebuff(waitBuffEnd)); + + }; + attack2.Apply(); + } + + yield break; + } + + [ImplementsPowerBuff(5)] + class MainEffectBuff : PowerBuff + { + public MainEffectBuff(TickTimer timeout) + { + Timeout = timeout; + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + + Target.Attributes[GameAttribute.Hit_Chance] -= ScriptFormula(8); + Target.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + public override void Remove() + { + base.Remove(); + Target.Attributes[GameAttribute.Hit_Chance] += ScriptFormula(8); + Target.Attributes.BroadcastChangedIfRevealed(); + if (Rune_A > 0) + { + //addbuff that adds holy damage + AddBuff(User, new FlashingRuneABuff(WaitSeconds(ScriptFormula(3)))); + } + } + } + [ImplementsPowerBuff(1)] + class FlashingRuneABuff : PowerBuff + { + public FlashingRuneABuff(TickTimer timeout) + { + Timeout = timeout; + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + + Target.Attributes[GameAttribute.Attack_Bonus_Percent] += ScriptFormula(4); + Target.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + public override void Remove() + { + base.Remove(); + Target.Attributes[GameAttribute.Attack_Bonus_Percent] -= ScriptFormula(4); + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + [ImplementsPowerBuff(4)] + class IndigoDebuff : PowerBuff + { + public IndigoDebuff(TickTimer timeout) + { + Timeout = timeout; + } + public override bool Apply() + { + if (!base.Apply()) + return false; + return true; + } + + public override void Remove() + { + base.Remove(); + } + } + } + #endregion + + //Complete + #region LashingTailKick + [ImplementsPowerSNO(Skills.Skills.Monk.SpiritSpenders.LashingTailKick)] + public class LashingTailKick : Skill + { + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + if (Rune_A > 0 || Rune_D > 0) + { + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(User.Position, 10f); + attack.AddWeaponDamage(ScriptFormula(0), Rune_A > 0 ? DamageType.Fire : DamageType.Physical); + attack.OnHit = HitPayload => + { + Knockback(HitPayload.Target, ScriptFormula(3), ScriptFormula(4), ScriptFormula(5)); + if (Rune_D > 0) + { + AddBuff(HitPayload.Target, new DebuffSlowed(0.6f, WaitSeconds(ScriptFormula(15)))); + } + }; + attack.Apply(); + } + else if (Rune_B > 0) + { + var proj = new Projectile(this, 136893, User.Position); + //max distance sf(16) + //proj.Position.Z += 5f; // fix height + proj.OnCollision = (hit) => + { + hit.PlayEffectGroup(143439); + WeaponDamage(hit, ScriptFormula(0), DamageType.Fire); + }; + proj.Launch(TargetPosition, 1f); + } + else if (Rune_C > 0) + { + SpawnEffect(136925, TargetPosition); + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(TargetPosition, ScriptFormula(12)); + attack.AddWeaponDamage(ScriptFormula(0), DamageType.Physical); + attack.OnHit = HitPayload => + { + AddBuff(HitPayload.Target, new DebuffSlowed(ScriptFormula(18), WaitSeconds(ScriptFormula(21)))); + }; + attack.Apply(); + } + else + { + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInArcDirection(User.Position, TargetPosition, ScriptFormula(6), ScriptFormula(7)); + attack.AddWeaponDamage(ScriptFormula(0), DamageType.Physical); + attack.OnHit = HitPayload => + { + if (Rune_E > 0) + { + AddBuff(HitPayload.Target, new DebuffStunned(WaitSeconds(ScriptFormula(8)))); + } + else + Knockback(HitPayload.Target, ScriptFormula(3), ScriptFormula(4), ScriptFormula(5)); + }; + attack.Apply(); + } + + yield break; + } + } + #endregion + + //Close to complete for base skill. TODO:Runes + #region TempestRush + [ImplementsPowerSNO(Skills.Skills.Monk.SpiritSpenders.TempestRush)] + public class TempestRush : ChanneledSkill + { + private Actor _target = null; + + public override void OnChannelOpen() + { + EffectsPerSecond = 0.25f; + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + //User.Attributes[GameAttribute.Movement_Bonus_Run_Speed] += ScriptFormula(14); + if (Rune_C > 0) + { + //damage reduction + } + } + + public override void OnChannelClose() + { + if (_target != null) + _target.Destroy(); + //User.Attributes[GameAttribute.Movement_Bonus_Run_Speed] -= ScriptFormula(14); + if (Rune_C > 0) + { + //damage reduction + } + } + + public override void OnChannelUpdated() + { + UsePrimaryResource(ScriptFormula(16) / 4f); + User.TranslateFacing(TargetPosition); + // client updates target actor position + } + + public override IEnumerable Main() + { + AddBuff(User, new TempestBuff()); + AttackPayload attack = new AttackPayload(this); + //TODO: damage offset from ground?? where does this go.. + attack.Targets = GetEnemiesInArcDirection(User.Position, TargetPosition, ScriptFormula(2), ScriptFormula(1)); + attack.AddWeaponDamage(ScriptFormula(4), DamageType.Physical); + attack.OnHit = HitPayload => + { + Knockback(HitPayload.Target, ScriptFormula(6), ScriptFormula(7), ScriptFormula(8)); + AddBuff(HitPayload.Target, new DebuffSlowed(ScriptFormula(9), WaitSeconds(ScriptFormula(10)))); + if (Rune_A > 0) + { + } + }; + attack.Apply(); + + yield break; + } + [ImplementsPowerBuff(0)] + class TempestBuff : PowerBuff + { + public override void Init() + { + base.Init(); + Timeout = WaitSeconds(0.5f); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + return true; + } + + public override void Remove() + { + base.Remove(); + } + } + } + #endregion + + //TODO:Actors need adjustments. + #region WaveOfLight + [ImplementsPowerSNO(Skills.Skills.Monk.SpiritSpenders.WaveOfLight)] + public class WaveOfLight : Skill + { + public override int GetCastEffectSNO() + { + return base.GetCastEffectSNO(); + } + public override int GetContactEffectSNO() + { + return base.GetContactEffectSNO(); + } + //From videos: it seems you proxy the Proxy actor first, the "hit" looks like it goes with the projectile... + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + //UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + //projectile distance (50) + if (Rune_B > 0) + { + Vector3D[] projDestinations = PowerMath.GenerateSpreadPositions(User.Position, TargetPosition, 45f, (int)ScriptFormula(25)); + + yield return WaitSeconds(0.35f); + + for (int i = 0; i < projDestinations.Length; i++) + { + var proj = new Projectile(this, 172310, User.Position); + proj.Launch(projDestinations[i], ScriptFormula(22)); + proj.OnCollision = (hit) => + { + hit.PlayEffectGroup(145443); + proj.Destroy(); + WeaponDamage(hit, ScriptFormula(23), DamageType.Holy); + }; + } + } + else if (Rune_C > 0) + { + //add in pillar [temple.efg and hit_hp.acr and pillar_a.acr?] + Vector3D inFrontOfUser = PowerMath.TranslateDirection2D(User.Position, TargetPosition, User.Position, ScriptFormula(8)); + + yield return WaitSeconds(0.35f); + + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(inFrontOfUser, 20f); + attack.AddWeaponDamage(ScriptFormula(17), DamageType.Holy); + attack.OnHit = hit => + { + Knockback(hit.Target, ScriptFormula(5), ScriptFormula(6), ScriptFormula(7)); + AddBuff(hit.Target, new DOTbuff(WaitSeconds(ScriptFormula(9)))); + }; + + } + else + { + Vector3D inFrontOfUser = PowerMath.TranslateDirection2D(User.Position, TargetPosition, User.Position, ScriptFormula(8)); + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(inFrontOfUser, 10f); + attack.AddWeaponDamage(ScriptFormula(14), DamageType.Holy); + attack.OnHit = hit => + { + if (hit.IsCriticalHit) + { + AddBuff(hit.Target, new DebuffStunned(WaitSeconds(ScriptFormula(39)))); + } + }; + + yield return WaitSeconds(0.35f); + var proj = new Projectile(this, 6441, User.Position); + proj.Position.Z += 5f; // fix height + proj.OnCollision = (hit) => + { + hit.PlayEffectGroup(144079); + WeaponDamage(hit, ScriptFormula(3), DamageType.Holy); + Knockback(User, ScriptFormula(15), ScriptFormula(18), ScriptFormula(20)); + }; + proj.Launch(TargetPosition, ScriptFormula(2)); + } + yield break; + } + [ImplementsPowerBuff(4)] + class DOTbuff : PowerBuff + { + const float _damageRate = 0.5f; + TickTimer _damageTimer = null; + + public DOTbuff(TickTimer timeout) + { + Timeout = timeout; + } + + public override bool Update() + { + if (base.Update()) + return true; + + if (_damageTimer == null || _damageTimer.TimedOut) + { + _damageTimer = WaitSeconds(_damageRate); + + WeaponDamage(GetEnemiesInRadius(Target.Position, 15f), ScriptFormula(31), DamageType.Holy); + } + + return false; + } + } + } + #endregion + + //TODO:Healing + #region BreathOfHeaven + [ImplementsPowerSNO(Skills.Skills.Monk.SpiritSpenders.BreathOfHeaven)] + public class BreathOfHeaven : Skill + { + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(4)); + attack.AddWeaponDamage(ScriptFormula(0), DamageType.Holy); + attack.OnHit = hit => + { + if (Rune_C > 0) + { + AddBuff(hit.Target, new FireDamageBuff(WaitSeconds(ScriptFormula(8)))); + } + if (Rune_E > 0) + { + AddBuff(hit.Target, new DebuffFeared(WaitSeconds(ScriptFormula(13)))); + AddBuff(hit.Target, new FearBuff()); + } + }; + if (Rune_D > 0) + { + AddBuff(User, new SpiritBuff(WaitSeconds(ScriptFormula(11)))); + } + //Heals self for Heal Min and Heal Delta + foreach (Actor ally in GetAlliesInRadius(User.Position, ScriptFormula(4)).Actors) + { + //heal ally for Heal Min and Heal Delta + } + yield break; + } + [ImplementsPowerBuff(0)] + class FireDamageBuff : PowerBuff + { + //firedamage + public FireDamageBuff(TickTimer timeout) + { + Timeout = timeout; + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + + Target.Attributes[GameAttribute.Damage_Percent_All_From_Skills] += ScriptFormula(9); + Target.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + public override void Remove() + { + base.Remove(); + Target.Attributes[GameAttribute.Damage_Percent_All_From_Skills] -= ScriptFormula(9); + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + [ImplementsPowerBuff(1)] + class SpiritBuff : PowerBuff + { + //spirit + public SpiritBuff(TickTimer timeout) + { + Timeout = timeout; + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + + Target.Attributes[GameAttribute.Resource_On_Hit] += ScriptFormula(12); + Target.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + public override void Remove() + { + base.Remove(); + Target.Attributes[GameAttribute.Resource_On_Hit] -= ScriptFormula(12); + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + [ImplementsPowerBuff(2)] + class FearBuff : PowerBuff + { + //Fear + const float _damageRate = 1f; + TickTimer _damageTimer = null; + + public override void Init() + { + base.Init(); + Timeout = WaitSeconds(ScriptFormula(13)); + } + public override bool Apply() + { + if (!base.Apply()) + return false; + return true; + } + public override bool Update() + { + if (base.Update()) + return true; + + if (_damageTimer == null || _damageTimer.TimedOut) + { + _damageTimer = WaitSeconds(_damageRate); + + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(4)); + attack.AddWeaponDamage(ScriptFormula(14), DamageType.Physical); + attack.Apply(); + } + + return false; + } + public override void Remove() + { + base.Remove(); + } + } + } + #endregion + + //TODO:instant buff, after some seconds, better buff. + //TODO:CastGroupBuff -> when Monk removes buff, remove from other members + #region MantraOfRetribution + [ImplementsPowerSNO(Skills.Skills.Monk.Mantras.MantraOfRetribution)] + public class MantraOfRetribution : Skill + { + public override IEnumerable Main() + { + //No more cooldown since latest patch 8101 + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + AddBuff(User, new CastEffect(WaitSeconds(ScriptFormula(5)))); + + foreach (Actor ally in GetAlliesInRadius(User.Position, ScriptFormula(0)).Actors) + { + AddBuff(ally, new CastGroupBuff(WaitSeconds(ScriptFormula(5)))); + } + yield break; + } + [ImplementsPowerBuff(0)] + class CastEffect : PowerBuff + { + //masterFX + public CastEffect(TickTimer timeout) + { + Timeout = timeout; + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + if (Rune_B > 0) + { + Target.Attributes[GameAttribute.Attacks_Per_Second_Bonus] += ScriptFormula(22); + } + Target.Attributes[GameAttribute.Thorns_Percent] += ScriptFormula(6); + Target.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + public override void OnPayload(Payload payload) + { + if (payload.Target == Target && payload is HitPayload) + { + if (Rune_C > 0) + { + if (Rand.NextDouble() < ScriptFormula(17)) + { + AddBuff(payload.Context.Target, new DebuffStunned(WaitSeconds(ScriptFormula(18)))); + } + } + if (Rune_D > 0) + { + //says there's a chance, but no formula + if (Rand.NextDouble() < 0.3f + (0.1f * Rune_D)) + { + GeneratePrimaryResource(ScriptFormula(23)); + } + } + if (Rune_E > 0) + { + if (Rand.NextDouble() < ScriptFormula(10)) + { + WeaponDamage(GetEnemiesInRadius(payload.Context.Target.Position, ScriptFormula(20)), ScriptFormula(14), DamageType.Holy); + } + } + } + } + + public override void Remove() + { + base.Remove(); + if (Rune_B > 0) + { + Target.Attributes[GameAttribute.Attacks_Per_Second_Bonus] -= ScriptFormula(22); + } + Target.Attributes[GameAttribute.Thorns_Percent] -= ScriptFormula(6); + Target.Attributes.BroadcastChangedIfRevealed(); + + } + } + [ImplementsPowerBuff(1)] + class CastGroupBuff : PowerBuff + { + //grantee + public CastGroupBuff(TickTimer timeout) + { + Timeout = timeout; + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + if (Rune_B > 0) + { + Target.Attributes[GameAttribute.Attacks_Per_Second_Bonus] += ScriptFormula(22); + } + Target.Attributes[GameAttribute.Thorns_Percent] += ScriptFormula(6); + Target.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + public override void Remove() + { + base.Remove(); + if (Rune_B > 0) + { + Target.Attributes[GameAttribute.Attacks_Per_Second_Bonus] -= ScriptFormula(22); + } + Target.Attributes[GameAttribute.Thorns_Percent] -= ScriptFormula(6); + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + } + #endregion + + //TODO: instant buff, after some seconds, better buff. + #region MantraOfHealing + [ImplementsPowerSNO(Skills.Skills.Monk.Mantras.MantraOfHealing)] + public class MantraOfHealing : Skill + { + public override IEnumerable Main() + { + //No more cooldown + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + AddBuff(User, new CastEffect(WaitSeconds(ScriptFormula(4) * 60f))); + if (Rune_B > 0) + { + AddBuff(User, new HealingShield(WaitSeconds(ScriptFormula(9)))); + } + foreach (Actor ally in GetAlliesInRadius(User.Position, ScriptFormula(0)).Actors) + { + AddBuff(ally, new CastGroupBuff(WaitSeconds(ScriptFormula(4) * 60f))); + if (Rune_B > 0) + { + AddBuff(User, new HealingShield(WaitSeconds(ScriptFormula(9)))); + } + } + yield break; + } + [ImplementsPowerBuff(0)] + class CastEffect : PowerBuff + { + //grantor + public CastEffect(TickTimer timeout) + { + Timeout = timeout; + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + if (Rune_C > 0) + { + Target.Attributes[GameAttribute.Vitality_Bonus_Percent] += ScriptFormula(6); + } + if (Rune_D > 0) + { + Target.Attributes[GameAttribute.Resource_Regen_Per_Second] += ScriptFormula(7); + } + if (Rune_E > 0) + { + Target.Attributes[GameAttribute.Resistance_All] += ScriptFormula(8); + } + Target.Attributes[GameAttribute.Hitpoints_Regen_Per_Second] += ScriptFormula(1); + Target.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + public override void Remove() + { + base.Remove(); + if (Rune_C > 0) + { + Target.Attributes[GameAttribute.Vitality_Bonus_Percent] -= ScriptFormula(6); + } + if (Rune_D > 0) + { + Target.Attributes[GameAttribute.Resource_Regen_Per_Second] -= ScriptFormula(7); + } + if (Rune_E > 0) + { + Target.Attributes[GameAttribute.Resistance_All] -= ScriptFormula(8); + } + Target.Attributes[GameAttribute.Hitpoints_Regen_Per_Second] -= ScriptFormula(1); + Target.Attributes.BroadcastChangedIfRevealed(); + + } + } + [ImplementsPowerBuff(2)] + class CastGroupBuff : PowerBuff + { + //grantee + public CastGroupBuff(TickTimer timeout) + { + Timeout = timeout; + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + if (Rune_C > 0) + { + Target.Attributes[GameAttribute.Vitality_Bonus_Percent] += ScriptFormula(6); + } + if (Rune_D > 0) + { + Target.Attributes[GameAttribute.Resource_Regen_Per_Second] += ScriptFormula(7); + } + if (Rune_E > 0) + { + Target.Attributes[GameAttribute.Resistance_All] += ScriptFormula(8); + } + Target.Attributes[GameAttribute.Hitpoints_Regen_Per_Second] += ScriptFormula(1); + Target.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + public override void Remove() + { + base.Remove(); + if (Rune_C > 0) + { + Target.Attributes[GameAttribute.Vitality_Bonus_Percent] -= ScriptFormula(6); + } + if (Rune_D > 0) + { + Target.Attributes[GameAttribute.Resource_Regen_Per_Second] -= ScriptFormula(7); + } + if (Rune_E > 0) + { + Target.Attributes[GameAttribute.Resistance_All] -= ScriptFormula(8); + } + Target.Attributes[GameAttribute.Hitpoints_Regen_Per_Second] -= ScriptFormula(1); + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + [ImplementsPowerBuff(3)] + class HealingShield : PowerBuff + { + //holyAuraRune_shield.efg + public HealingShield(TickTimer timeout) + { + Timeout = timeout; + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + + Target.Attributes[GameAttribute.Damage_Absorb_Percent] += ScriptFormula(5); + Target.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + public override void Remove() + { + base.Remove(); + Target.Attributes[GameAttribute.Damage_Absorb_Percent] -= ScriptFormula(5); + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + } + #endregion + + //TODO:OnPayload for Rune_D? + //TODO: maybe while(enemy is in radius), keep the buff? + #region MantraOfConviction + [ImplementsPowerSNO(Skills.Skills.Monk.Mantras.MantraOfConviction)] + public class MantraOfConviction : Skill + { + public override IEnumerable Main() + { + //No more cooldown + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + + AddBuff(User, new ConvictionAura(WaitSeconds(ScriptFormula(0) * 60f))); + + if (Rune_D > 0) + { + foreach (Actor ally in GetAlliesInRadius(User.Position, ScriptFormula(0)).Actors) + { + AddBuff(ally, new ReclamationAura(WaitSeconds(ScriptFormula(0) * 60f))); + } + } + yield break; + } + [ImplementsPowerBuff(0)] + class ConvictionAura : PowerBuff + { + //AuraBuff + + const float _damageRate = 0.5f; + TickTimer _damageTimer = null; + + public ConvictionAura(TickTimer timeout) + { + Timeout = timeout; + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + return true; + } + + public override bool Update() + { + if (base.Update()) + return true; + + if (_damageTimer == null || _damageTimer.TimedOut) + { + _damageTimer = WaitSeconds(_damageRate); + + foreach (Actor Enemy in GetEnemiesInRadius(User.Position, ScriptFormula(5)).Actors) + { + AddBuff(Enemy, new DeBuff()); + if (Rune_C > 0) + { + AddBuff(Enemy, new DebuffSlowed(ScriptFormula(7), WaitSeconds(0.5f))); + } + } + } + + return false; + } + public override void Remove() + { + base.Remove(); + } + } + [ImplementsPowerBuff(1)] + class DeBuff : PowerBuff + { + //Debuff + + const float _damageRate = 1f; + TickTimer _damageTimer = null; + + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(3)); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + if (Rune_E > 0) + { + Target.Attributes[GameAttribute.Damage_Done_Reduction_Percent] += ScriptFormula(10); + } + Target.Attributes[GameAttribute.Defense_Reduction_Percent] += ScriptFormula(2); + Target.Attributes.BroadcastChangedIfRevealed(); + return true; + } + public override bool Update() + { + if (base.Update()) + return true; + + if (Rune_B > 0) + { + if (_damageTimer == null || _damageTimer.TimedOut) + { + _damageTimer = WaitSeconds(_damageRate); + + WeaponDamage(Target, ScriptFormula(12), DamageType.Holy); + + } + } + + return false; + } + public override void Remove() + { + base.Remove(); + if (Rune_E > 0) + { + Target.Attributes[GameAttribute.Damage_Done_Reduction_Percent] -= ScriptFormula(10); + } + Target.Attributes[GameAttribute.Defense_Reduction_Percent] -= ScriptFormula(2); + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + [ImplementsPowerBuff(0)] + class ReclamationAura : PowerBuff + { + //AuraBuff + public ReclamationAura(TickTimer timeout) + { + Timeout = timeout; + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + return true; + } + + public override void Remove() + { + base.Remove(); + } + } + } + #endregion + + //Rune_A -> Healing + //Rune_E -> OnPayload HitTarget collect all damage that would have been done to you, Remove() of Buff, grab that number and get (SF(4)) of damage. + // Deal that much damage (Max of ___ % of your max life) + #region Serenity + [ImplementsPowerSNO(Skills.Skills.Monk.SpiritSpenders.Serenity)] + public class Serenity : Skill + { + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + AddBuff(User, new SerenityBuff(WaitSeconds(ScriptFormula(0)))); + + if (Rune_D > 0) + { + foreach (Actor ally in GetAlliesInRadius(User.Position, ScriptFormula(12)).Actors) + { + AddBuff(ally, new SerenityAlliesBuff(WaitSeconds(ScriptFormula(11)))); + } + } + yield break; + } + [ImplementsPowerBuff(0)] + class SerenityBuff : PowerBuff + { + public SerenityBuff(TickTimer timeout) + { + Timeout = timeout; + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + + //If(Rune_A) -> Heal ScriptFormula(1) + if (Rune_B > 0) + { + Target.Attributes[GameAttribute.Projectile_Reflect_Chance] += ScriptFormula(2); + Target.Attributes[GameAttribute.Thorns_Percent] += ScriptFormula(2); + } + + Target.Attributes[GameAttribute.Gethit_Immune] = true; + Target.Attributes[GameAttribute.Immunity] = true; + Target.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + public override void Remove() + { + base.Remove(); + if (Rune_B > 0) + { + Target.Attributes[GameAttribute.Projectile_Reflect_Chance] -= ScriptFormula(2); + Target.Attributes[GameAttribute.Thorns_Percent] -= ScriptFormula(2); + } + Target.Attributes[GameAttribute.Gethit_Immune] = false; + Target.Attributes[GameAttribute.Immunity] = false; + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + [ImplementsPowerBuff(1)] + class SerenityAlliesBuff : PowerBuff + { + public SerenityAlliesBuff(TickTimer timeout) + { + Timeout = timeout; + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + + Target.Attributes[GameAttribute.Gethit_Immune] = true; + Target.Attributes[GameAttribute.Immunity] = true; + Target.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + public override void Remove() + { + base.Remove(); + Target.Attributes[GameAttribute.Gethit_Immune] = false; + Target.Attributes[GameAttribute.Immunity] = false; + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + } + #endregion + + //TODO: Make sure enemies cannot come back into bubble + #region InnerSanctuary + [ImplementsPowerSNO(Skills.Skills.Monk.SpiritSpenders.InnerSanctuary)] + public class InnerSanctuary : Skill + { + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + var GroundSpot = SpawnProxy(User.Position); + var Sanctuary = SpawnEffect(RuneSelect(98557, 98823, 149848, 142312, 98559, 142305), GroundSpot.Position, 0, WaitSeconds(ScriptFormula(0))); + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(GroundSpot.Position, ScriptFormula(1)); + attack.OnHit = hit => + { + if (Rune_A > 0) + { + WeaponDamage(hit.Target, ScriptFormula(10), DamageType.Holy); + } + AddBuff(hit.Target, new DebuffFeared(WaitSeconds(ScriptFormula(2)))); + Knockback(hit.Target, ScriptFormula(3), ScriptFormula(4), ScriptFormula(5)); + }; + attack.Apply(); + if (Rune_D > 0 || Rune_C > 0) + { + Sanctuary.UpdateDelay = 0.3f; + Sanctuary.OnUpdate = () => + { + AddBuff(User, new RegenBuff()); + foreach (Actor ally in GetAlliesInRadius(GroundSpot.Position, ScriptFormula(1)).Actors) + { + AddBuff(User, new RegenAllyBuff()); + } + }; + } + //outer proxy + SpawnEffect(RuneSelect(142719, 142851, 149849, 142788, 142737, 142845), GroundSpot.Position, 0, WaitSeconds(ScriptFormula(7))); + + if (Rune_E > 0) + { + yield return WaitSeconds(ScriptFormula(0)); + var PreSanctified = SpawnEffect(149851, GroundSpot.Position, 0, WaitSeconds(ScriptFormula(31))); + PreSanctified.UpdateDelay = 0.3f; + PreSanctified.OnUpdate = () => + { + foreach (Actor enemy in GetEnemiesInRadius(GroundSpot.Position, ScriptFormula(1)).Actors) + { + AddBuff(enemy, new DebuffSlowed(ScriptFormula(30), WaitSeconds(ScriptFormula(31)))); + } + }; + } + + yield break; + } + [ImplementsPowerBuff(0)] + class RegenBuff : PowerBuff + { + public override void Init() + { + base.Init(); + Timeout = WaitSeconds(ScriptFormula(13)); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + if (Rune_C > 0) + { + Target.Attributes[GameAttribute.Defense_Bonus_Percent] += ScriptFormula(20); + } + if (Rune_D > 0) + { + Target.Attributes[GameAttribute.Hitpoints_Regen_Per_Second] += ScriptFormula(25); + } + Target.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + public override void Remove() + { + base.Remove(); + if (Rune_C > 0) + { + Target.Attributes[GameAttribute.Defense_Bonus_Percent] -= ScriptFormula(20); + } + if (Rune_D > 0) + { + Target.Attributes[GameAttribute.Hitpoints_Regen_Per_Second] -= ScriptFormula(25); + } + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + [ImplementsPowerBuff(1)] + class RegenAllyBuff : PowerBuff + { + public override void Init() + { + base.Init(); + Timeout = WaitSeconds(ScriptFormula(13)); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + if (Rune_C > 0) + { + Target.Attributes[GameAttribute.Defense_Bonus_Percent] += ScriptFormula(20); + } + if (Rune_D > 0) + { + Target.Attributes[GameAttribute.Hitpoints_Regen_Per_Second] += ScriptFormula(25); + } + Target.Attributes.BroadcastChangedIfRevealed(); + + return true; + } + + public override void Remove() + { + base.Remove(); + if (Rune_C > 0) + { + Target.Attributes[GameAttribute.Defense_Bonus_Percent] -= ScriptFormula(20); + } + if (Rune_D > 0) + { + Target.Attributes[GameAttribute.Hitpoints_Regen_Per_Second] -= ScriptFormula(25); + } + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + } + #endregion + + //Pet Class + #region MysticAlly + [ImplementsPowerSNO(Skills.Skills.Monk.SpiritSpenders.MysticAlly)] + public class MysticAlly : Skill + { + public override IEnumerable Main() + { + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + var mystic = new MysticAllyMinion(this.World, this, 0); + mystic.Brain.DeActivate(); + mystic.Position = RandomDirection(User.Position, 3f, 8f); //Kind of hacky until we get proper collisiondetection + mystic.Attributes[GameAttribute.Untargetable] = true; + mystic.EnterWorld(mystic.Position); + mystic.PlayActionAnimation(130606); + + yield return WaitSeconds(0.8f); + (mystic as Minion).Brain.Activate(); + mystic.Attributes[GameAttribute.Untargetable] = false; + mystic.Attributes.BroadcastChangedIfRevealed(); + + yield break; + } + } + #endregion + + //Complete + #region CycloneStrike + [ImplementsPowerSNO(223473)] + public class CycloneStrike : Skill + { + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + if (Rune_C > 0) + { + foreach (Actor Ally in GetAlliesInRadius(User.Position, ScriptFormula(19)).Actors) + { + Ally.Attributes[GameAttribute.Hitpoints_Granted] += ScriptFormula(20); + } + } + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(2), (int)ScriptFormula(5)); + attack.OnHit = hit => + { + Knockback(hit.Target, -25f, ScriptFormula(1), ScriptFormula(29)); + }; + attack.Apply(); + yield return WaitSeconds(0.5f); + User.PlayEffectGroup(224247); + WeaponDamage(GetEnemiesInRadius(User.Position, ScriptFormula(16) + ScriptFormula(17)), ScriptFormula(10), Rune_A > 0 ? DamageType.Fire : DamageType.Holy); + if (Rune_E > 0) + { + AddBuff(User, new CycloneDodgeBuff(WaitSeconds(ScriptFormula(27)))); + } + if (Rune_A > 0) + { + foreach (Actor Enemy in GetEnemiesInRadius(User.Position, ScriptFormula(2), (int)ScriptFormula(5)).Actors) + { + AddBuff(Enemy, new DebuffFeared(WaitSeconds(ScriptFormula(13)))); + } + } + yield break; + } + [ImplementsPowerBuff(0)] + class CycloneDodgeBuff : PowerBuff + { + public CycloneDodgeBuff(TickTimer timeout) + { + Timeout = timeout; + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + Target.Attributes[GameAttribute.Dodge_Chance_Bonus] += ScriptFormula(28); + Target.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + public override void Remove() + { + base.Remove(); + Target.Attributes[GameAttribute.Dodge_Chance_Bonus] -= ScriptFormula(28); + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + } + #endregion + //11 Passives +} diff --git a/src/Mooege/Core/GS/Powers/Implementations/HeroSkills/WitchDoctor.cs b/src/Mooege/Core/GS/Powers/Implementations/HeroSkills/WitchDoctor.cs new file mode 100644 index 00000000..cc9c2a12 --- /dev/null +++ b/src/Mooege/Core/GS/Powers/Implementations/HeroSkills/WitchDoctor.cs @@ -0,0 +1,1905 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using Mooege.Core.GS.Actors; +using Mooege.Core.GS.Actors.Implementations.Minions; +using Mooege.Core.GS.Actors.Movement; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Core.GS.Powers.Payloads; +using Mooege.Net.GS.Message; +using Mooege.Core.GS.Ticker; + +namespace Mooege.Core.GS.Powers.Implementations +{ + //Complete skill/Runes by MDZ, TODO: fix positioning of hit actors. + #region PoisonDart + [ImplementsPowerSNO(Skills.Skills.WitchDoctor.PhysicalRealm.PoisonDart)] + public class WitchDoctorPoisonDart : Skill + { + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + int numProjectiles = Rune_B > 0 ? (int)ScriptFormula(4) : 1; + for (int n = 0; n < numProjectiles; ++n) + { + if (Rune_B > 0) + yield return WaitSeconds(ScriptFormula(17)); + + var proj = new Projectile(this, + RuneSelect(107011, 107030, 107035, 107223, 107265, 107114), + User.Position); + proj.Position.Z += 3f; + proj.OnCollision = (hit) => + { + // TODO: fix positioning of hit actors. possibly increase model scale? + SpawnEffect(RuneSelect(112327, 112338, 112327, 112345, 112347, 112311), proj.Position); + + proj.Destroy(); + + if (Rune_E > 0 && Rand.NextDouble() < ScriptFormula(11)) + hit.PlayEffectGroup(107163); + + if (Rune_A > 0) + WeaponDamage(hit, ScriptFormula(2), DamageType.Fire); + else + WeaponDamage(hit, ScriptFormula(0), DamageType.Poison); + }; + proj.Launch(TargetPosition, 1f); + } + } + } + #endregion + + //Hacky BigToad by MDZ + //testing plague of toads attempt, does not work except for one jump, with no animation. + #region PlagueOfToads + [ImplementsPowerSNO(Skills.Skills.WitchDoctor.PhysicalRealm.PlagueOfToads)] + public class WitchDoctorPlagueOfToads : PowerScript + { + public override IEnumerable Run() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + if (Rune_C > 0) + { + // NOTE: not normal plague of toads right now but Obsidian runed "Toad of Hugeness" + Vector3D userCastPosition = new Vector3D(User.Position); + Vector3D inFrontOfUser = PowerMath.TranslateDirection2D(User.Position, TargetPosition, User.Position, 7f); + var bigtoad = SpawnEffect(109906, inFrontOfUser, TargetPosition, WaitInfinite()); + + // HACK: holy hell there is alot of hardcoded animation timings here + + bigtoad.PlayActionAnimation(110766); // spawn ani + yield return WaitSeconds(1f); + + bigtoad.PlayActionAnimation(110520); // attack ani + TickTimer waitAttackEnd = WaitSeconds(1.5f); + yield return WaitSeconds(0.3f); // wait for attack ani to play a bit + + var tongueEnd = SpawnProxy(TargetPosition, WaitInfinite()); + bigtoad.AddRopeEffect(107892, tongueEnd); + + yield return WaitSeconds(0.3f); // have tongue hang there for a bit + + var tongueMover = new Implementations.KnockbackBuff(-0.01f, 3f, -0.1f); + this.World.BuffManager.AddBuff(bigtoad, tongueEnd, tongueMover); + if (ValidTarget()) + this.World.BuffManager.AddBuff(bigtoad, Target, new Implementations.KnockbackBuff(-0.01f, 3f, -0.1f)); + + yield return tongueMover.ArrivalTime; + tongueEnd.Destroy(); + + if (ValidTarget()) + { + _SetHiddenAttribute(Target, true); + + if (!waitAttackEnd.TimedOut) + yield return waitAttackEnd; + + bigtoad.PlayActionAnimation(110636); // disgest ani, 5 seconds + for (int n = 0; n < 5 && ValidTarget(); ++n) + { + WeaponDamage(Target, 0.039f, DamageType.Poison); + yield return WaitSeconds(1f); + } + + if (ValidTarget()) + { + _SetHiddenAttribute(Target, false); + + bigtoad.PlayActionAnimation(110637); // regurgitate ani + this.World.BuffManager.AddBuff(bigtoad, Target, new Implementations.KnockbackBuff(36f)); + Target.PlayEffectGroup(18281); // actual regurgitate efg isn't working so use generic acid effect + yield return WaitSeconds(0.9f); + } + } + + bigtoad.PlayActionAnimation(110764); // despawn ani + yield return WaitSeconds(0.7f); + bigtoad.Destroy(); + } + TickTimer frog = WaitSeconds(ScriptFormula(5)); + Vector3D inFrontOfminiToads = PowerMath.TranslateDirection2D(User.Position, TargetPosition, User.Position, 7f); + var projectile = new Projectile(this, 105792, User.Position); + projectile.LaunchArc(inFrontOfminiToads, 3f, -0.03f); + projectile.OnCollision = (hit) => + { + //destroying it while in Launcharc causes an exception. + //projectile.Destroy(); + }; + projectile.OnArrival = () => { }; + yield return WaitSeconds(1.2f); + projectile.LaunchArc(new Vector3D(RandomDirection(projectile.Position, 4f, 7f)), 3f, -0.03f); + projectile.OnArrival = () => { }; + yield return WaitSeconds(1.2f); + + /* + * for regular toads, there is a max of 3 frogs per cast, they are classifyed as projectile with a lifetime of 3. + */ + } + + private void _SetHiddenAttribute(Actor actor, bool active) + { + actor.Attributes[GameAttribute.Hidden] = active; + actor.Attributes.BroadcastChangedIfRevealed(); + } + } + #endregion + + //Complete, needs checking + #region GraspOfTheDead + [ImplementsPowerSNO(Skills.Skills.WitchDoctor.Support.GraspOfTheDead)] + public class GraspOfTheDead : Skill + { + public override IEnumerable Main() + { + + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + if (Rune_B > 0) + { + for (int i = 0; i < 4; ++i) + { + var Target = GetEnemiesInRadius(TargetPosition, ScriptFormula(14)).GetClosestTo(TargetPosition); + if (Target != null) + { + SpawnEffect(105955, Target.Position); + WeaponDamage(GetEnemiesInRadius(Target.Position, ScriptFormula(15)), ScriptFormula(10), DamageType.Holy); + yield return WaitSeconds(ScriptFormula(13)); + } + } + } + else + { + var Ground = SpawnEffect(RuneSelect(69308, 105953, -1, 105956, 105957, 105958), TargetPosition, 0, WaitSeconds(ScriptFormula(8))); + Ground.UpdateDelay = 0.5f; + Ground.OnUpdate = () => + { + foreach (Actor enemy in GetEnemiesInRadius(TargetPosition, ScriptFormula(3)).Actors) + { + AddBuff(enemy, new DebuffSlowed(ScriptFormula(19), WaitSeconds(ScriptFormula(2)))); + AddBuff(enemy, new DamageGroundDebuff()); + } + }; + } + yield break; + } + [ImplementsPowerBuff(0)] + class DamageGroundDebuff : PowerBuff + { + const float _damageRate = 1f; + TickTimer _damageTimer = null; + + public override void Init() + { + base.Init(); + Timeout = WaitSeconds(ScriptFormula(2)); + } + /*public override void OnPayload(Payload payload) + { + if (payload.Target == Target && payload is DeathPayload) + { + } + }*/ + public override bool Update() + { + if (base.Update()) + return true; + + if (_damageTimer == null || _damageTimer.TimedOut) + { + _damageTimer = WaitSeconds(_damageRate); + + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(Target.Position, 1f); //TODO: hack, it should only be applied to individual targets, not all in 1f. + attack.AddWeaponDamage(ScriptFormula(0), DamageType.Physical); + attack.Apply(); + attack.OnDeath = (DeathPayload) => + { + if (Rune_E > 0) + { + if (Rand.NextDouble() < ScriptFormula(21)) + { + //produce a health globe + //Items.ItemGenerator.CreateGlobe(User, "HealthGlobe" + 25); + + } + } + }; + } + + return false; + } + } + } + #endregion + + //TODO:checking for all Haunts in a 90f radius. needs checking + //TODO:also needs to check if monster already has haunt, to look for a new target or overwrite the existing one. + //TODO: Something very buggy with complexEffect... very very buggy. (ex. cast spell, click-hold mouse move around) + #region Haunt + [ImplementsPowerSNO(Skills.Skills.WitchDoctor.SpiritRealm.Haunt)] + public class Haunt : Skill + { + public override IEnumerable Main() + { + //Need to check for all Haunt Buffs in this radius. + //Max simultaneous haunts = 3 ScriptFormula(8) + //Max Haunt Check Radius(ScriptFormula(9)) -> 90f + + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + if (Rune_B > 0) + { + if (Target == null) + { + + var Lingerer = SpawnEffect(111345, TargetPosition, 0, WaitSeconds(ScriptFormula(4))); + Lingerer.OnTimeout = () => + { + Lingerer.World.BuffManager.RemoveAllBuffs(Lingerer); + }; + AddBuff(Lingerer, new HauntLinger()); + } + } + else + { + if (Target != null) + { + User.AddComplexEffect(19257, Target); + AddBuff(Target, new Haunt1()); + } + } + yield break; + } + + [ImplementsPowerBuff(0)] + class Haunt1 : PowerBuff + { + const float _damageRate = 1f; + TickTimer _damageTimer = null; + + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(1)); + } + public override void OnPayload(Payload payload) + { + if (payload.Target == Target && payload is DeathPayload) + { + //Need to check if monster already has a haunt on them, if it does -> check next monster. + var target = GetEnemiesInRadius(payload.Context.Target.Position, ScriptFormula(10)) + .GetClosestTo(payload.Context.Target.Position); + if (target != null) + { + Target.AddComplexEffect(RuneSelect(19257, 111257, 111370, 113742, 111461, 111564), target); + AddBuff(target, new Haunt1()); + } + else + { + if (Rune_B > 0) + { + var Lingerer = SpawnEffect(111345, Target.Position, 0, WaitSeconds(ScriptFormula(4))); + Lingerer.OnTimeout = () => + { + Lingerer.World.BuffManager.RemoveAllBuffs(Lingerer); + }; + AddBuff(Lingerer, new HauntLinger()); + } + } + } + } + public override bool Update() + { + if (base.Update()) + return true; + if (_damageTimer == null || _damageTimer.TimedOut) + { + _damageTimer = WaitSeconds(_damageRate); + + if (Rune_D > 0) + { + GeneratePrimaryResource(ScriptFormula(3)); + } + + AttackPayload attack = new AttackPayload(this); + attack.SetSingleTarget(Target); + attack.AddWeaponDamage((ScriptFormula(0) / ScriptFormula(1)), DamageType.Holy); + attack.AutomaticHitEffects = false; + attack.OnHit = hit => + { + if (Rune_A > 0) + { + //45% of damage healed back to user + float healMe = ScriptFormula(2) * hit.TotalDamage; + //User.Attributes[GameAttribute.Hitpoints_Granted] = healMe; + //User.Attributes.BroadcastChangedIfRevealed(); + } + if (Rune_C > 0) + { + //DebuffSlowed Target + AddBuff(Target, new DebuffSlowed(ScriptFormula(5), WaitSeconds(ScriptFormula(1)))); + } + }; + attack.Apply(); + } + return false; + } + public override void Remove() + { + base.Remove(); + } + } + //Rune_B + [ImplementsPowerBuff(2)] + class HauntLinger : PowerBuff + { + const float _damageRate = 1.25f; + TickTimer _damageTimer = null; + + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(4)); + } + + //Search + public override bool Update() + { + if (base.Update()) + return true; + if (_damageTimer == null || _damageTimer.TimedOut) + { + _damageTimer = WaitSeconds(_damageRate); + //When this finds a target, it needs to destroy the spawnactor[Lingerer] + if (GetEnemiesInRadius(Target.Position, ScriptFormula(10)).Actors.Count > 0) + { + var target = GetEnemiesInRadius(Target.Position, ScriptFormula(10)).GetClosestTo(Target.Position); + Target.AddComplexEffect(19257, target); + AddBuff(target, new Haunt1()); + } + + } + return false; + } + public override void Remove() + { + base.Remove(); + } + } + } + #endregion + + //TODO:Rune_D + #region ZombieCharger + [ImplementsPowerSNO(Skills.Skills.WitchDoctor.PhysicalRealm.ZombieCharger)] + public class WitchDoctorZombieCharger : Skill + { + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + if (Rune_A > 0) + { + Vector3D inFrontOfUser = PowerMath.TranslateDirection2D(User.Position, TargetPosition, User.Position, -20f); + Vector3D[] projDestinations = PowerMath.GenerateSpreadPositions(User.Position, TargetPosition, 10f, 3); + + var BearProj1 = new Projectile(this, RuneSelect(74056, 105501, 105543, 105463, 105969, 105812), inFrontOfUser); + BearProj1.Position.Z -= 3f; + BearProj1.OnCollision = (hit) => + { + WeaponDamage(hit, ScriptFormula(4), DamageType.Poison); + }; + BearProj1.Launch(projDestinations[1], ScriptFormula(19)); + + yield return WaitSeconds(0.5f); + var BearProj2 = new Projectile(this, RuneSelect(74056, 105501, 105543, 105463, 105969, 105812), inFrontOfUser); + BearProj2.Position.Z -= 3f; + BearProj2.OnCollision = (hit) => + { + WeaponDamage(hit, ScriptFormula(4), DamageType.Poison); + }; + BearProj2.Launch(projDestinations[0], ScriptFormula(19)); + + yield return WaitSeconds(0.5f); + var BearProj3 = new Projectile(this, RuneSelect(74056, 105501, 105543, 105463, 105969, 105812), inFrontOfUser); + BearProj3.Position.Z -= 3f; + BearProj3.OnCollision = (hit) => + { + WeaponDamage(hit, ScriptFormula(4), DamageType.Poison); + }; + BearProj3.Launch(projDestinations[2], ScriptFormula(19)); + } + else if (Rune_B > 0) + { + Vector3D inFrontOfUser = PowerMath.TranslateDirection2D(User.Position, TargetPosition, User.Position, 3f); + Vector3D[] projDestinations = PowerMath.GenerateSpreadPositions(User.Position, TargetPosition, ScriptFormula(10), (int)ScriptFormula(3)); + + for (int i = 1; i < projDestinations.Length; i++) + { + var multiproj = new Projectile(this, RuneSelect(74056, 105501, 105543, 105463, 105969, 105812), inFrontOfUser); + multiproj.Position.Z -= 3f; + multiproj.OnCollision = (hit) => + { + WeaponDamage(hit, ScriptFormula(4), DamageType.Poison); + }; + multiproj.Launch(projDestinations[i], ScriptFormula(1)); + } + } + else if (Rune_D > 0) + { + Vector3D inFrontOfUser = PowerMath.TranslateDirection2D(User.Position, TargetPosition, User.Position, 3f); + var proj = new Projectile(this, RuneSelect(74056, 105501, 105543, 105463, 105969, 105812), inFrontOfUser); + proj.Position.Z -= 3f; + proj.Launch(TargetPosition, ScriptFormula(1)); + proj.OnCollision = (hit) => + { + AttackPayload attack = new AttackPayload(this); + attack.SetSingleTarget(hit); + attack.AddWeaponDamage(ScriptFormula(4), DamageType.Poison); + attack.Apply(); + attack.OnDeath = DeathPayload => + { + Vector3D inFrontOfUser2 = PowerMath.TranslateDirection2D(User.Position, TargetPosition, User.Position, 22f); + var proj2 = new Projectile(this, RuneSelect(74056, 105501, 105543, 105463, 105969, 105812), inFrontOfUser2); + proj.Launch(TargetPosition, ScriptFormula(1)); + //TODO:need this stuff. + //zombie new distance (SF(13)) + //zombie speed (SF(14)) + //New zombie search range (SF(15)) + //new zombie chance (SF18) + //max new zombie per projectile (SF24) + //damage scalar -> SF31 + //damage reduction per zombie -> SF30 + }; + }; + } + else if (Rune_E > 0) + { + Vector3D inFrontOfUser = PowerMath.TranslateDirection2D(User.Position, TargetPosition, User.Position, 3f); + var proj = new Projectile(this, RuneSelect(74056, 105501, 105543, 105463, 105969, 105812), inFrontOfUser); + proj.Position.Z -= 3f; + proj.OnCollision = (hit) => + { + WeaponDamage(GetEnemiesInRadius(hit.Position, ScriptFormula(11)), ScriptFormula(4), DamageType.Fire); + }; + proj.Launch(TargetPosition, ScriptFormula(7)); + } + else + { + Vector3D inFrontOfUser = PowerMath.TranslateDirection2D(User.Position, TargetPosition, User.Position, 3f); + var proj = new Projectile(this, RuneSelect(74056, 105501, 105543, 105463, 105969, 105812), inFrontOfUser); + proj.Position.Z -= 3f; + proj.Launch(TargetPosition, ScriptFormula(1)); + if (Rune_C > 0) + { + var Puddle = SpawnEffect(105502, proj.Position, 0, WaitSeconds(ScriptFormula(17))); + Puddle.UpdateDelay = 0.5f; //somehow play this more often? + Puddle.OnUpdate = () => + { + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(proj.Position, ScriptFormula(8)); + attack.AddWeaponDamage(ScriptFormula(6), DamageType.Poison); + attack.Apply(); + }; + } + proj.OnCollision = (hit) => + { + WeaponDamage(hit, ScriptFormula(4), DamageType.Poison); + }; + + } + + yield break; + } + } + #endregion + + //seems complete + #region Horrify + [ImplementsPowerSNO(Skills.Skills.WitchDoctor.SpiritRealm.Horrify)] + public class Horrify : Skill + { + public override IEnumerable Main() + { + StartCooldown(ScriptFormula(14)); + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + AddBuff(User, new CastEffect()); + if (Rune_A > 0) + { + AddBuff(User, new CrimsonBuff()); + } + if (Rune_E > 0) + { + AddBuff(User, new SprintBuff()); + } + foreach (Actor enemy in GetEnemiesInRadius(User.Position, ScriptFormula(2)).Actors) + { + AddBuff(enemy, new DebuffFeared(WaitSeconds(ScriptFormula(3)))); + if (Rune_D > 0) + { + GeneratePrimaryResource(ScriptFormula(8)); + } + } + yield break; + } + [ImplementsPowerBuff(0)] + class CastEffect : PowerBuff + { + //switch.efg + public override void Init() + { + Timeout = WaitSeconds(1f); + } + } + [ImplementsPowerBuff(1)] + class SprintBuff : PowerBuff + { + //spring.etf alabaster + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(10)); + } + public override bool Apply() + { + if (!base.Apply()) + return false; + Target.Attributes[GameAttribute.Movement_Bonus_Run_Speed] += ScriptFormula(9); + Target.Attributes.BroadcastChangedIfRevealed(); + + return true; + } + public override void Remove() + { + base.Remove(); + Target.Attributes[GameAttribute.Movement_Bonus_Run_Speed] -= ScriptFormula(9); + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + [ImplementsPowerBuff(2)] + class CrimsonBuff : PowerBuff + { + //crimson buff + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(12)); + } + public override bool Apply() + { + if (!base.Apply()) + return false; + Target.Attributes[GameAttribute.Armor_Bonus_Percent] += ScriptFormula(5); + Target.Attributes.BroadcastChangedIfRevealed(); + + return true; + } + public override void Remove() + { + base.Remove(); + Target.Attributes[GameAttribute.Armor_Bonus_Percent] -= ScriptFormula(5); + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + } + #endregion + + //TODO: fix resource cost and Rune_D healing + #region Firebats + [ImplementsPowerSNO(Skills.Skills.WitchDoctor.PhysicalRealm.Firebats)] + public class Firebats : Skill + { + public override IEnumerable Main() + { + if (Rune_A > 0) + { + //Projectile Giant Bat Actors + var proj = new Projectile(this, 108238, User.Position); + proj.Position.Z += 5f; // unknown if this is needed + proj.OnCollision = (hit) => + { + SpawnEffect(108389, new Vector3D(hit.Position.X, hit.Position.Y, hit.Position.Z)); + AddBuff(hit, new BatDamage()); + proj.Destroy(); + }; + proj.Launch(TargetPosition, ScriptFormula(8)); + + yield return WaitSeconds(ScriptFormula(17)); + } + else if (Rune_B > 0) + { + if (GetEnemiesInArcDirection(User.Position, TargetPosition, ScriptFormula(10), ScriptFormula(4)).Actors != null) + { + var proj = new Projectile(this, 106569, User.Position); + proj.Position.Z += 5f; + proj.OnCollision = (hit) => + { + hit.PlayEffectGroup(106575); + AddBuff(hit, new BatDamage()); + proj.Destroy(); + }; + proj.Launch(TargetPosition, ScriptFormula(8)); + } + yield return WaitSeconds(ScriptFormula(6)); + } + else if (Rune_E > 0) + { + AddBuff(User, new FirebatCast()); + foreach (Actor actor in GetEnemiesInArcDirection(User.Position, TargetPosition, ScriptFormula(3), ScriptFormula(4)).Actors) + { + AddBuff(actor, new BatDamage()); + } + + yield return WaitSeconds(ScriptFormula(20)); + } + else + { + AddBuff(User, new FirebatCast()); + foreach (Actor actor in GetEnemiesInArcDirection(User.Position, TargetPosition, ScriptFormula(3), ScriptFormula(4)).Actors) + { + AddBuff(actor, new BatDamage()); + } + yield return WaitSeconds(ScriptFormula(7)); + } + yield break; + } + [ImplementsPowerBuff(0)] + class FirebatCast : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(7)); + } + } + [ImplementsPowerBuff(2)] + class BatDamage : PowerBuff + { + const float _damageRate = 1f; + TickTimer _damageTimer = null; + + public override void Init() + { + if (Rune_C > 0) + { + Timeout = WaitSeconds(3f); + } + else + Timeout = WaitSeconds(1f); + } + public override bool Update() + { + if (base.Update()) + return true; + if (_damageTimer == null || _damageTimer.TimedOut) + { + _damageTimer = WaitSeconds(_damageRate); + UsePrimaryResource(ScriptFormula(0)); //testing in this area for resource. + if (Rune_E > 0) + { + WeaponDamage(GetEnemiesInRadius(User.Position, ScriptFormula(21)), ScriptFormula(19), DamageType.Fire); + } + else if (Rune_A > 0) + { + AttackPayload attack = new AttackPayload(this); + attack.SetSingleTarget(Target); + attack.AddWeaponDamage(ScriptFormula(15), DamageType.Fire); + attack.Apply(); + } + else if (Rune_B > 0) + { + AttackPayload attack = new AttackPayload(this); + attack.SetSingleTarget(Target); + attack.AddWeaponDamage(ScriptFormula(18), DamageType.Fire); + attack.Apply(); + } + else if (Rune_C > 0) + { + AttackPayload attack = new AttackPayload(this); + attack.SetSingleTarget(Target); + attack.AddWeaponDamage(ScriptFormula(12), DamageType.Poison); + attack.OnHit = HitPayload => + { + }; + attack.Apply(); + } + else + { + AttackPayload attack = new AttackPayload(this); + attack.SetSingleTarget(Target); + attack.AddWeaponDamage(ScriptFormula(1), DamageType.Fire); + attack.OnHit = HitPayload => + { + //Rune_D -> Healing + }; + attack.Apply(); + } + } + return false; + } + } + } + #endregion + + //TODOs: read inside + #region Firebomb + [ImplementsPowerSNO(Skills.Skills.WitchDoctor.PhysicalRealm.Firebomb)] + public class Firebomb : Skill + { + //NoRune:blank, A: radius, B: Bounce, C: Pool, D: Turret, E: chainLightning + //TODO:Rune_B,D,E + //Rune_B -> Allows skull to bounce up to two times, reduce damage by 15% + //Rune_E -> Instead of firebomb doing AoE, each does direct damage to enemy then bounces to up to nearby enemies, reduce damage by 20% + public override IEnumerable Main() + { + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + Projectile[] grenades = new Projectile[1]; + for (int i = 0; i < grenades.Length; ++i) + { + var projectile = new Projectile(this, 6453, User.Position); + grenades[i] = projectile; + } + + float height = ScriptFormula(3); + + for (int i = 0; i < grenades.Length; ++i) + { + grenades[i].LaunchArc(PowerMath.TranslateDirection2D(TargetPosition, User.Position, TargetPosition, + 0f), height, ScriptFormula(2)); + } + yield return grenades[0].ArrivalTime; + + if (Rune_D > 0) + { + //TODO:figure out the column animation. + var FireColumn = new EffectActor(this, -1, TargetPosition); + FireColumn.Timeout = WaitSeconds(ScriptFormula(14)); + FireColumn.Scale = 2f; + FireColumn.Spawn(); + FireColumn.UpdateDelay = 0.33f; // attack every half-second + FireColumn.OnUpdate = () => + { + var targets = GetEnemiesInRadius(FireColumn.Position, ScriptFormula(26)); + if (targets.Actors.Count > 0 && targets != null) + { + targets.SortByDistanceFrom(FireColumn.Position); + var proj = new Projectile(this, 193969, FireColumn.Position); + proj.Position.Z += 5f; // unknown if this is needed + proj.OnCollision = (hit) => + { + WeaponDamage(hit, ScriptFormula(13), DamageType.Fire); + + proj.Destroy(); + }; + FireColumn.TranslateFacing(targets.Actors[0].Position, true); + proj.LaunchArc(targets.Actors[0].Position, ScriptFormula(29), ScriptFormula(28)); + } + + }; + } + else + { + foreach (var grenade in grenades) + { + var grenadeN = grenade; + + SpawnEffect(6451, TargetPosition); + + if (Rune_C > 0) + { + var pool = SpawnEffect(6483, grenade.Position, 0, WaitSeconds(ScriptFormula(12))); + pool.UpdateDelay = 1f; + pool.OnUpdate = () => + { + WeaponDamage(GetEnemiesInRadius(grenadeN.Position, ScriptFormula(11)), ScriptFormula(10), DamageType.Fire); + }; + } + + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(grenade.Position, ScriptFormula(4)); + attack.AddWeaponDamage(ScriptFormula(0), DamageType.Fire); + attack.OnHit = (hitPayload) => + { + if (Rune_A > 0) + { + SpawnEffect(193964, grenade.Position); + WeaponDamage(GetEnemiesInRadius(grenadeN.Position, ScriptFormula(5)), ScriptFormula(6), DamageType.Fire); + } + }; + attack.Apply(); + } + } + } + } + #endregion + + //TODOs: Decoy HP and ID, SpiritWalk Appearance, Rune_C explosion(SNO for it?) needs to be from spawnproxy + //decoy deathmask.acr? buff/decoydeath/decoylook.efg? + #region SpiritWalk + [ImplementsPowerSNO(Skills.Skills.WitchDoctor.SpiritRealm.SpiritWalk)] + public class SpiritWalk : Skill + { + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + //Newest Patch adds Run Speed Increase = SF(16) "0.50" + Vector3D DecoySpot = new Vector3D(User.Position); + Actor blast = SpawnProxy(DecoySpot); + + //SpawnEffect(106584, DecoySpot, 0, WaitSeconds(ScriptFormula(0))); //Male + SpawnEffect(107705, DecoySpot, 0, WaitSeconds(ScriptFormula(0))); //Female + + + AddBuff(User, new SpiritWalkBuff()); + + if (Rune_C > 0) + { + yield return WaitSeconds(ScriptFormula(0)); + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(blast.Position, ScriptFormula(8)); + attack.AddWeaponDamage(ScriptFormula(6), DamageType.Fire); + attack.Apply(); + } + else + + yield break; + } + [ImplementsPowerBuff(1)] + class SpiritWalkBuff : PowerBuff + { + const float _damageRate = 0.25f; + TickTimer _damageTimer = null; + + //Look_override ghostly appearance + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(0)); + } + public override bool Apply() + { + if (!base.Apply()) + return false; + User.Attributes[GameAttribute.Look_Override] = unchecked((int)0xF2F224EA); + //User.Attributes[GameAttribute.Walk_Passability_Power_SNO] = ; + User.Attributes[GameAttribute.Stealthed] = true; + //User.Attributes[GameAttribute.Untargetable] = true; + //User.Attributes[GameAttribute.UntargetableByPets] = true; + if (Rune_D > 0) + { + User.Attributes[GameAttribute.Resource_Regen_Percent_Per_Second] += ScriptFormula(9); + } + if (Rune_E > 0) + { + //is this attribute by percent on its own? "Gain 16% of your maximum Life every second" + User.Attributes[GameAttribute.Hitpoints_Regen_Per_Second] += ScriptFormula(10); + } + User.Attributes.BroadcastChangedIfRevealed(); + return true; + } + public override void Remove() + { + base.Remove(); + if (Rune_D > 0) + { + User.Attributes[GameAttribute.Resource_Regen_Percent_Per_Second] -= ScriptFormula(9); + } + if (Rune_E > 0) + { + //is this attribute by percent on its own? "Gain 16% of your maximum Life every second" + User.Attributes[GameAttribute.Hitpoints_Regen_Per_Second] -= ScriptFormula(10); + } + User.Attributes[GameAttribute.Look_Override] = 0; + //User.Attributes[GameAttribute.Walk_Passability_Power_SNO] = ; + User.Attributes[GameAttribute.Stealthed] = false; + //User.Attributes[GameAttribute.Untargetable] = false; + //User.Attributes[GameAttribute.UntargetableByPets] = false; + User.Attributes.BroadcastChangedIfRevealed(); + } + + public override bool Update() + { + if (base.Update()) + return true; + if (Rune_A > 0) + { + if (_damageTimer == null || _damageTimer.TimedOut) + { + _damageTimer = WaitSeconds(_damageRate); + + foreach (Actor enemy in GetEnemiesInRadius(User.Position, ScriptFormula(4)).Actors) + { + AddBuff(Target, new SpiritWalkDamage()); + } + } + } + return false; + } + } + /*[ImplementsPowerBuff(1)] + class DecoyLookBuff : PowerBuff + { + //Brain or something? + //Breakable shield HP? idk.. + //Dummy Health -> Script(11) * MaxHP -> once this + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(0)); + } + }*/ + [ImplementsPowerBuff(2)] + class SpiritWalkDamage : PowerBuff + { + const float _damageRate = 1f; + TickTimer _damageTimer = null; + + public override void Init() + { + Timeout = WaitSeconds(1f); + } + public override bool Update() + { + if (base.Update()) + return true; + if (_damageTimer == null || _damageTimer.TimedOut) + { + _damageTimer = WaitSeconds(_damageRate); + + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(4)); + attack.AddWeaponDamage(ScriptFormula(1), DamageType.Physical); + attack.Apply(); + } + return false; + } + } + } + #endregion + + //Seems alright.. just needs tweaking, check on the teleportation of the character occassionally when casting. + #region SoulHarvest + [ImplementsPowerSNO(Skills.Skills.WitchDoctor.SpiritRealm.SoulHarvest)] + public class SoulHarvest : Skill + { + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + User.PlayEffectGroup(19275); + + foreach (Actor enemy in GetEnemiesInRadius(User.Position, ScriptFormula(3), 5).Actors) + { + enemy.PlayEffectGroup(1164); + WeaponDamage(enemy, 30f, DamageType.Physical); + enemy.AddComplexEffect(19277, User); + if (Rune_E > 0) + { + WeaponDamage(enemy, ScriptFormula(0), DamageType.Physical); + } + if (Rune_C > 0) + { + AddBuff(enemy, new ObsidianDebuff()); + AddBuff(enemy, new DebuffSlowed(ScriptFormula(10), WaitSeconds(ScriptFormula(11)))); + } + yield return WaitSeconds(0.7f); + AddBuff(User, new soulHarvestbuff()); + } + + yield break; + } + [ImplementsPowerBuff(0, true)] + class soulHarvestbuff : PowerBuff + { + public override void Init() + { + base.Init(); + Timeout = WaitSeconds(ScriptFormula(7)); + MaxStackCount = (int)ScriptFormula(13); + } + public override bool Apply() + { + if (!base.Apply()) + return false; + _AddHarvest(); + return true; + } + public override void Remove() + { + base.Remove(); + { + Target.Attributes[GameAttribute.Attack_Bonus] -= StackCount * ScriptFormula(8); + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + public override bool Stack(Buff buff) + { + bool stacked = StackCount < MaxStackCount; + + base.Stack(buff); + + if (stacked) + _AddHarvest(); + + return true; + } + private void _AddHarvest() + { + if (Rune_A > 0) + { + //heal life SF(9) + } + if (Rune_D > 0) + { + //Gain Mana SF(4) + } + + Target.Attributes[GameAttribute.Attack_Bonus] += ScriptFormula(8); + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + [ImplementsPowerBuff(1)] + class ObsidianDebuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(11)); + } + } + } + #endregion + + //SMall Portion of the skill complete + #region LocustSwarm + [ImplementsPowerSNO(Skills.Skills.WitchDoctor.PhysicalRealm.LocustSwarm)] + public class LocustSwarm : Skill + { + //Summon a plague of locusts to assault enemies, dealing [25 * {Script Formula 18} * 100]% weapon damage per second as Poison for 3 seconds. The locusts will jump to additional nearby targets. + public override IEnumerable Main() + { + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + //cast, spread to those in radius, from there jump to other mobs in area within (__?__) + //does not always focus the correct way. + User.PlayEffectGroup(106765); + + //just a little wait for the animation + yield return WaitSeconds(0.5f); + + + foreach (Actor LocustTarget in GetEnemiesInArcDirection(User.Position, TargetPosition, ScriptFormula(14), 30f).Actors) + { + AddBuff(LocustTarget, new LocustSwarmer(WaitSeconds(ScriptFormula(1)))); + } + yield break; + } + [ImplementsPowerBuff(0)] + class LocustSwarmer : PowerBuff + { + const float _damageRate = 1f; + TickTimer _damageTimer = null; + + float _jumpRate = 3f; + TickTimer _jumpTimer = null; + + public LocustSwarmer(TickTimer timeout) + { + Timeout = timeout; + } + public override bool Update() + { + if (base.Update()) + return true; + if (_damageTimer == null || _damageTimer.TimedOut) + { + _damageTimer = WaitSeconds(_damageRate); + + AttackPayload attack = new AttackPayload(this); + attack.SetSingleTarget(Target); + attack.AddWeaponDamage(ScriptFormula(0), Rune_A > 0 ? DamageType.Fire : DamageType.Poison); + attack.AutomaticHitEffects = false; + attack.Apply(); + } + + /*while (_jumpRate > ScriptFormula(4)) + { + if (_jumpTimer == null || _jumpTimer.TimedOut) + { + _jumpTimer = WaitSeconds(_jumpRate); + //swarm jump radius + var newTarget = GetEnemiesInRadius(Target.Position, ScriptFormula(2)).GetClosestTo(Target.Position); + while (newTarget != null) + { + //Target.AddComplexEffect(106839, newTarget); + AddBuff(newTarget, new LocustSwarmer(WaitSeconds(ScriptFormula(1)))); + } + _jumpRate *= 0.9f; //delta = Swarm Jump Time Delta + } + }*/ + + return false; + } + } + [ImplementsPowerBuff(1)] + class DiseaseSwarm : PowerBuff + { + const float _damageRate = 1f; + TickTimer _damageTimer = null; + + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(11)); + } + public override bool Update() + { + if (base.Update()) + return true; + if (_damageTimer == null || _damageTimer.TimedOut) + { + _damageTimer = WaitSeconds(_damageRate); + + AttackPayload attack = new AttackPayload(this); + attack.SetSingleTarget(Target); + attack.AddWeaponDamage(ScriptFormula(1), DamageType.Fire); + attack.Apply(); + + + } + return false; + } + } + } + #endregion + + //basic skill works, Rune_E most works, other runes need fixing. + #region SpiritBarrage + [ImplementsPowerSNO(Skills.Skills.WitchDoctor.SpiritRealm.SpiritBarrage)] + public class SpiritBarrage : Skill + { + public override IEnumerable Main() + { + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + if (Rune_E > 0) + { + AddBuff(User, new BarrageSpirit()); + } + else if (Rune_B > 0) + { + //same as regular shot just with extra spirit bolts. + /* Missile Buff Duration + * Missile Buff Periodic Fire Rate + * Missile Damage Scalar + * Missile Check Radius + */ + } + else if (Rune_C > 0) + { + //this doesnt work. + var AOE_Ghost = SpawnEffect(181880, TargetPosition, 0, WaitSeconds(ScriptFormula(11))); + AOE_Ghost.PlayEffectGroup(186804); + AOE_Ghost.UpdateDelay = 1f; + AOE_Ghost.OnUpdate = () => + { + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(AOE_Ghost.Position, ScriptFormula(13)); + attack.AddWeaponDamage(ScriptFormula(14), DamageType.Physical); + attack.Apply(); + }; + } + else + { + var Target = GetEnemiesInRadius(TargetPosition, ScriptFormula(14)).GetClosestTo(TargetPosition); + if (Target != null) + { + User.PlayEffectGroup(175350, Target); + yield return WaitSeconds(ScriptFormula(2)); + Target.PlayEffectGroup(175403); + + WeaponDamage(Target, ScriptFormula(0), DamageType.Physical); + //Rune_D -> Mana Gain (SF(5)) + } + } + yield break; + } + [ImplementsPowerBuff(3)] + class BarrageSpirit : PowerBuff + { + const float _damageRate = 0.6f; + TickTimer _damageTimer = null; + + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(17)); + } + public override bool Update() + { + if (base.Update()) + return true; + if (_damageTimer == null || _damageTimer.TimedOut) + { + _damageTimer = WaitSeconds(_damageRate); + + var Target = GetEnemiesInRadius(User.Position, ScriptFormula(19)).GetClosestTo(User.Position); + if (Target != null) + { + //needs to turn to shoot at enemies. + User.PlayEffectGroup(181866, Target); + User.Position.Z += 10f; // this doesnt change the projectile position. + WaitSeconds(ScriptFormula(2)); + Target.PlayEffectGroup(181944); + + WeaponDamage(Target, ScriptFormula(20), DamageType.Physical); + + } + } + return false; + } + } + } + #endregion + + //TODOs inside + #region AcidCloud + [ImplementsPowerSNO(Skills.Skills.WitchDoctor.PhysicalRealm.AcidCloud)] + public class AcidCloud : Skill + { + //TODO: Max Pools = 3; + //Rune_B Splash Delay? + public override IEnumerable Main() + { + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + if (Rune_E > 0) + { + SpawnEffect(121908, TargetPosition); + yield return WaitSeconds(ScriptFormula(32)); + WeaponDamage(GetEnemiesInArcDirection(User.Position, TargetPosition, ScriptFormula(31), + ScriptFormula(30)), ScriptFormula(1), DamageType.Poison); + } + else + { + SpawnEffect(RuneSelect(61398, 121919, 122281, 121587, 121920, -1), TargetPosition); + + if (Rune_A > 0) { yield return WaitSeconds(ScriptFormula(14)); } + else if (Rune_B > 0) { yield return WaitSeconds(ScriptFormula(16)); } + else { yield return WaitSeconds(ScriptFormula(0)); } + + WeaponDamage(GetEnemiesInRadius(TargetPosition, ScriptFormula(1)), ScriptFormula(1), DamageType.Poison); + + var AcidPools = SpawnEffect(6509, TargetPosition, 0, WaitSeconds(ScriptFormula(5))); + AcidPools.UpdateDelay = 0.25f; //idk + AcidPools.OnUpdate = () => + { + foreach (Actor enemy in GetEnemiesInRadius(TargetPosition, ScriptFormula(4)).Actors) + { + if (AddBuff(enemy, new Disease_Debuff())) + { + AddBuff(enemy, new Disease_Debuff()); + } + } + }; + + //(PET CLASS) + if (Rune_C > 0) + { + //slime -> 121595.ACR + //this is a pet and theyre are a max of 3 allowed. + //spawn slime that wanders in a certain area + } + } + yield break; + } + [ImplementsPowerBuff(2)] + class Disease_Debuff : PowerBuff + { + const float _damageRate = 0.25f; //this needs to be ScriptFormula(7) = buff tickrate + TickTimer _damageTimer = null; + + public override void Init() + { + Timeout = WaitSeconds(0.25f); + + } + public override bool Update() + { + if (base.Update()) + return true; + if (_damageTimer == null || _damageTimer.TimedOut) + { + _damageTimer = WaitSeconds(_damageRate); + + WeaponDamage(Target, ScriptFormula(8), DamageType.Poison); + } + return false; + } + } + } + #endregion + + //TODO: confusion ID for monsters, Runes_C,E(dogs), check equations. + #region MassConfusion + [ImplementsPowerSNO(Skills.Skills.WitchDoctor.SpiritRealm.MassConfusion)] + public class MassConfusion : Skill + { + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + //Target.PlayEffectGroup(184540); + TargetList Half = GetEnemiesInRadius(TargetPosition, ScriptFormula(1)); + foreach (Actor enemy in GetEnemiesInRadius(TargetPosition, ScriptFormula(1), ((int)Half.Actors.Count / 2)).Actors) + { + AddBuff(enemy, new Confusion_Debuff()); + } + WeaponDamage(GetEnemiesInRadius(TargetPosition, ScriptFormula(1)), ScriptFormula(3), DamageType.Physical); + + if (Rune_B > 0) + { + foreach (Actor enemy in GetEnemiesInRadius(TargetPosition, ScriptFormula(1), (int)ScriptFormula(4)).Actors) + { + //if it doesnt have confusion, it gets stunned. + if (!AddBuff(enemy, new Confusion_Debuff())) + { + AddBuff(enemy, new DebuffStunned(WaitSeconds(ScriptFormula(6)))); + } + } + } + if (Rune_C > 0) + { + //could not find the correct Projectile actor for this. + var proj = new Projectile(this, -1, User.Position); + proj.Position.Z += 5f; // unknown if this is needed + proj.OnUpdate = () => + { + foreach (Actor enemy in GetEnemiesInRadius(proj.Position, ScriptFormula(10)).Actors) + { + AddBuff(enemy, new SpiritDoT()); + } + }; + proj.Launch(TargetPosition, ScriptFormula(16)); + } + yield break; + } + [ImplementsPowerBuff(0)] + class Confusion_Debuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(0)); + } + public override bool Apply() + { + if (!base.Apply()) + return false; + Target.Attributes[GameAttribute.Team_Override] = 0; + return true; + } + public override void Remove() + { + base.Remove(); + Target.Attributes[GameAttribute.Team_Override] = 0; + } + } + [ImplementsPowerBuff(1)] + class SpiritDoT : PowerBuff + { + const float _damageRate = 1f; + TickTimer _damageTimer = null; + + public override void Init() + { + Timeout = WaitSeconds(1f); + + } + public override bool Update() + { + if (base.Update()) + return true; + if (_damageTimer == null || _damageTimer.TimedOut) + { + _damageTimer = WaitSeconds(_damageRate); + + WeaponDamage(Target, ScriptFormula(11), DamageType.Physical); + } + return false; + } + } + } + #endregion + + //Needs Buff Functions fixed and Rune_E added + #region BigBadVoodoo + [ImplementsPowerSNO(Skills.Skills.WitchDoctor.Support.BigBadVoodoo)] + public class BigBadVoodoo : Skill + { + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + var ShamSpot = SpawnProxy(TargetPosition, WaitSeconds(ScriptFormula(0) + 1f)); + SpawnEffect(RuneSelect(117574, 182271, 182276, 182278, 182283, 117574), TargetPosition, 0, WaitSeconds(ScriptFormula(0))).PlayEffectGroup(181291); + AddBuff(ShamSpot, new AuraBuff()); + yield break; + } + + [ImplementsPowerBuff(0)] + class AuraBuff : PowerBuff + { + const float _damageRate = 0.5f; + TickTimer _damageTimer = null; + + const float _healRate = 1f; + TickTimer _healTimer = null; + + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(0)); + + } + public override bool Update() + { + if (base.Update()) + return true; + if (_damageTimer == null || _damageTimer.TimedOut) + { + _damageTimer = WaitSeconds(_damageRate); + //your character + //if User in Radius of Target.Position, get this buff plus Rune_D if active. + AddBuff(User, new FetishShamanBuff()); + if (Rune_D > 0) + { + AddBuff(User, new Golden_ManaBuff()); + } + + foreach (Actor Ally in GetAlliesInRadius(Target.Position, ScriptFormula(2)).Actors) + { + AddBuff(Ally, new FetishShamanBuff()); + } + if (Rune_D > 0) + { + foreach (Actor Ally in GetAlliesInRadius(Target.Position, ScriptFormula(2)).Actors) + { + AddBuff(Ally, new Golden_ManaBuff()); + } + } + } + if (_healTimer == null || _healTimer.TimedOut) + { + _healTimer = WaitSeconds(_healRate); + + if (Rune_E > 0) + { + //User health as well + foreach (Actor Ally in GetAlliesInRadius(Target.Position, ScriptFormula(2)).Actors) + { + //Heal allies for ScriptFormula(4) of Max HP + } + } + } + return false; + } + public override bool Apply() + { + if (!base.Apply()) + return false; + return true; + } + public override void Remove() + { + base.Remove(); + } + } + [ImplementsPowerBuff(2)] + class FetishShamanBuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(9)); + + } + public override bool Apply() + { + if (!base.Apply()) + return false; + + if (Rune_A > 0) + { + Target.Attributes[GameAttribute.Attack_Bonus_Percent] += ScriptFormula(3); + Target.Attributes.BroadcastChangedIfRevealed(); + } + AddBuff(Target, new SpeedBuff(ScriptFormula(1), WaitSeconds(ScriptFormula(9)))); + AddBuff(Target, new MovementBuff(ScriptFormula(1), WaitSeconds(ScriptFormula(9)))); + return true; + } + public override void Remove() + { + base.Remove(); + if (Rune_A > 0) + { + Target.Attributes[GameAttribute.Attack_Bonus_Percent] -= ScriptFormula(3); + Target.Attributes.BroadcastChangedIfRevealed(); + } + } + } + [ImplementsPowerBuff(3)] + class Golden_ManaBuff : PowerBuff + { + //Buff + const float _damageRate = 1f; + TickTimer _damageTimer = null; + + public override void Init() + { + Timeout = WaitSeconds(1f); + + } + public override bool Update() + { + if (base.Update()) + return true; + if (_damageTimer == null || _damageTimer.TimedOut) + { + _damageTimer = WaitSeconds(_damageRate); + + //Restore ScriptFormula(5) Mana + + } + return false; + } + public override bool Apply() + { + if (!base.Apply()) + return false; + return true; + } + public override void Remove() + { + base.Remove(); + } + } + } + #endregion + + //TODO: Animation Partially complete, Wide(B) isnt complete and Creepers(A) haven't been worked on. + //TODO: Tower(E) needs to spawn, Arc Distance, max distance from target is 15f. + #region WallOfZombies + [ImplementsPowerSNO(Skills.Skills.WitchDoctor.PhysicalRealm.WallOfZombies)] + public class WallOfZombies : Skill + { + //TODO:Unknown how to do the width of the Wall of Zombies.. + public override IEnumerable Main() + { + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + if (Rune_C > 0) + { + Vector3D[] projDestinations = PowerMath.GenerateSpreadPositions(User.Position, TargetPosition, 52f, (int)ScriptFormula(5)); + + for (int i = 0; i < projDestinations.Length; i++) + { + var proj = new Projectile(this, 183977, User.Position); + proj.OnCollision = (hit) => + { + proj.Destroy(); + WeaponDamage(hit, ScriptFormula(4), DamageType.Physical); + SpawnEffect(182695, new Vector3D(hit.Position.X, hit.Position.Y, hit.Position.Z)); + }; + proj.Launch(projDestinations[i], 0.2f); + } + } + else if (Rune_B > 0) + { + //this needs to have double the width, + //at the moment this only shows the double length when pointing spell to the right. + + float castAngle = MovementHelpers.GetFacingAngle(User.Position, TargetPosition); + Vector3D[] spawnPoints = PowerMath.GenerateSpreadPositions(TargetPosition, new Vector3D(TargetPosition.X + 10f, TargetPosition.Y, TargetPosition.Z), 180, 2); + + for (int i = 0; i < spawnPoints.Length; ++i) + { + SpawnEffect(135016, spawnPoints[i], castAngle, WaitSeconds(ScriptFormula(0))); + } + + } + else + { + float castAngle = MovementHelpers.GetFacingAngle(User.Position, TargetPosition); + var Wall = SpawnEffect(RuneSelect(131202, -1, 135016, -1, 182574, 131640), TargetPosition, castAngle, WaitSeconds(ScriptFormula(0))); + Wall.UpdateDelay = 1f; + Wall.OnUpdate = () => + { + //set position in front of zombies, add width. rectangle? + if (Rune_D > 0) + { + //slow movement of enemies + } + }; + } + yield break; + } + } + #endregion + + //--------------------------Pet Classes Below----------------------// + + //Pet Class + #region FetishArmy + [ImplementsPowerSNO(Skills.Skills.WitchDoctor.Support.FetishArmy)] + public class FetishArmy : Skill + { + public override IEnumerable Main() + { + int maxFetishes = 5; + List Fetishes = new List(); + for (int i = 0; i < maxFetishes; i++) + { + var Fetish = new FetishMelee(this.World, this, i); + Fetish.Brain.DeActivate(); + Fetish.Position = RandomDirection(User.Position, 3f, 8f); //Kind of hacky until we get proper collisiondetection + Fetish.Attributes[GameAttribute.Untargetable] = true; + Fetish.EnterWorld(Fetish.Position); + Fetish.PlayActionAnimation(90118); + Fetishes.Add(Fetish); + yield return WaitSeconds(0.2f); + } + yield return WaitSeconds(0.8f); + foreach (Actor Fetish in Fetishes) + { + (Fetish as Minion).Brain.Activate(); + Fetish.Attributes[GameAttribute.Untargetable] = false; + Fetish.Attributes.BroadcastChangedIfRevealed(); + Fetish.PlayActionAnimation(87190); //Not sure why this is required, but after the summon is done, it'll just be frozen otherwise. + } + + //TODOs + //Spawns 5 melee Fighters. (pets) + //Rune_A = apparateDamage.efg to all spawned fetishes that deals radius damage + //Rune_B spawns 2 more fighters + //Rune_C spawns 2 shamans -> [213553] "shamanFireBreath.efg" + //Rune_D just decreases cooldown + //Rune_E spawns 2 hunters, projectile possibly[206229]"hunter.acr" and impact[206230]"hunter_impact.efg" + yield break; + } + } + #endregion + + //Pet Class + #region Sacrifice + [ImplementsPowerSNO(Skills.Skills.WitchDoctor.Support.Sacrifice)] + public class Sacrifice : Skill + { + public override IEnumerable Main() + { + PlayerHasDogsBuff buff = World.BuffManager.GetFirstBuff(this.User); + if (buff != null) + { + foreach (ZombieDog dog in buff.dogs) + { + dog.Kill(this); + } + World.BuffManager.RemoveBuffs(this.User, buff.GetType()); + StartCooldown(1f); + } + yield break; + } + } + #endregion + + //Pet Class + #region Gargantuan + [ImplementsPowerSNO(Skills.Skills.WitchDoctor.Support.Gargantuan)] + public class Gargantuan : Skill + { + public override IEnumerable Main() + { + var garg = new GargantuanMinion(this.World, this, 0); + garg.Brain.DeActivate(); + garg.Position = RandomDirection(User.Position, 3f, 8f); //Kind of hacky until we get proper collisiondetection + garg.Attributes[GameAttribute.Untargetable] = true; + garg.EnterWorld(garg.Position); + garg.PlayActionAnimation(155988); + yield return WaitSeconds(0.8f); + + (garg as Minion).Brain.Activate(); + garg.Attributes[GameAttribute.Untargetable] = false; + garg.Attributes.BroadcastChangedIfRevealed(); + garg.PlayActionAnimation(144967); //Not sure why this is required, but after the summon is done, it'll just be frozen otherwise. + + yield break; + } + } + #endregion + + //Pet Class + #region Hex + [ImplementsPowerSNO(Skills.Skills.WitchDoctor.Support.Hex)] + public class Hex : Skill + { + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + + var hex = new HexMinion(this.World, this, 0); + hex.Brain.DeActivate(); + hex.Position = RandomDirection(User.Position, 3f, 8f); //Kind of hacky until we get proper collisiondetection + hex.Attributes[GameAttribute.Untargetable] = true; + hex.EnterWorld(hex.Position); + hex.PlayActionAnimation(90118); + yield return WaitSeconds(0.8f); + + (hex as Minion).Brain.Activate(); + hex.Attributes[GameAttribute.Untargetable] = false; + hex.Attributes.BroadcastChangedIfRevealed(); + yield break; + } + } + #endregion + + //Jarthrow complete, need pet spider class + #region CorpseSpiders + [ImplementsPowerSNO(Skills.Skills.WitchDoctor.PhysicalRealm.CorpseSpiders)] + public class CorpseSpiders : Skill + { + public override IEnumerable Main() + { + var proj = new Projectile(this, RuneSelect(106504, 215811, 215815, 215816, 215814, 215813), User.Position); + proj.Position.Z += 5f; + proj.LaunchArc(TargetPosition, 5f, -0.07f); + yield return WaitSeconds(0.4f); + proj.OnArrival = () => + { + proj.Destroy(); + }; + SpawnEffect(110714, TargetPosition); + + //the rest of this is spiders, which are pets i presume? + yield return WaitSeconds(0.05f); + + var spider = new CorpseSpider(this.World, this, 0); + spider.Brain.DeActivate(); + spider.Position = RandomDirection(User.Position, 3f, 8f); //Kind of hacky until we get proper collisiondetection + spider.Attributes[GameAttribute.Untargetable] = true; + spider.EnterWorld(spider.Position); + yield return WaitSeconds(0.05f); + + (spider as Minion).Brain.Activate(); + spider.Attributes[GameAttribute.Untargetable] = false; + spider.Attributes.BroadcastChangedIfRevealed(); + + yield break; + } + } + #endregion + + //Pet Class + //TODO: fix up + #region SummonZombieDogs + //TODO: This is mostly hacked together, but there are a few main points: + //When using the Zombie Handler passive, it'll spawn 4 dogs. Need to somehow detect that that passive has switched off, and if so, kill one dog. + //There might be problems with players using a certain rune when summoning, then switching, to get both effects. + //This could possibly be solved by saving the state of runes when summoning, but perhaps a OnSwitchRune could be a good way instead. + [ImplementsPowerSNO(Skills.Skills.WitchDoctor.Support.SummonZombieDogs)] + public class SummonZombieDogs : Skill + { + public override IEnumerable Main() + { + //System.Console.Out.WriteLine("lol1"); + StartCooldown(60f); + PlayerHasDogsBuff buff = World.BuffManager.GetFirstBuff(this.User); + if (buff != null) + { + //System.Console.Out.WriteLine("lol"); + foreach (ZombieDog dog in buff.dogs) + { + dog.Kill(this); + } + World.BuffManager.RemoveBuffs(this.User, buff.GetType()); + } + //System.Console.Out.WriteLine("lol2"); + int maxDogs = (int)ScriptFormula(0); + List dogs = new List(); + for (int i = 0; i < maxDogs; i++) + { + //System.Console.Out.WriteLine("lol3_" + i); + var dog = new ZombieDog(this.World, this, i); + dog.Brain.DeActivate(); + dog.Position = RandomDirection(User.Position, 3f, 8f); //Kind of hacky until we get proper collisiondetection + dog.Attributes[GameAttribute.Untargetable] = true; + dog.EnterWorld(dog.Position); + dog.PlayActionAnimation(11437); + dogs.Add(dog); + yield return WaitSeconds(0.2f); + } + yield return WaitSeconds(0.8f); + //System.Console.Out.WriteLine("lol4"); + foreach (Actor dog in dogs) + { + //System.Console.Out.WriteLine("lol5"); + (dog as Minion).Brain.Activate(); + dog.Attributes[GameAttribute.Untargetable] = false; + dog.Attributes.BroadcastChangedIfRevealed(); + dog.PlayActionAnimation(11431); //Not sure why this is required, but after the summon is done, it'll just be frozen otherwise. + } + //System.Console.Out.WriteLine("lol6"); + AddBuff(this.User, new PlayerHasDogsBuff(dogs)); + + yield break; + } + } + class PlayerHasDogsBuff : PowerBuff + { + public List dogs; + + public PlayerHasDogsBuff(List dogs) + { + this.dogs = dogs; + } + public override bool Apply() + { + if (!base.Apply()) + return false; + //this.User.Attributes[GameAttribute.Skill_Toggled_State, Skills.Skills.WitchDoctor.Support.Sacrifice] = true; + //User.Attributes.BroadcastChangedIfRevealed(); + + return true; + } + + public override void OnPayload(Payload payload) + { + if (payload is DeathPayload) + { + + } + } + + public override void Remove() + { + base.Remove(); + } + } + #endregion +} diff --git a/src/Mooege/Core/GS/Powers/Implementations/HeroSkills/Wizard.cs b/src/Mooege/Core/GS/Powers/Implementations/HeroSkills/Wizard.cs new file mode 100644 index 00000000..ebbab993 --- /dev/null +++ b/src/Mooege/Core/GS/Powers/Implementations/HeroSkills/Wizard.cs @@ -0,0 +1,2492 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using Mooege.Core.GS.Actors; +using Mooege.Core.GS.Actors.Implementations.Minions; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Net.GS.Message; +using Mooege.Net.GS.Message.Definitions.ACD; +using Mooege.Core.GS.Ticker; +using Mooege.Core.GS.Powers.Payloads; +using Mooege.Core.GS.Actors.Movement; + +namespace Mooege.Core.GS.Powers.Implementations +{ + //TODO: all runes + #region SpectralBlade + [ImplementsPowerSNO(Skills.Skills.Wizard.Signature.SpectralBlade)] + public class WizardSpectralBlade : Skill + { + public override IEnumerable Main() + { + UsePrimaryResource(15f); + + User.PlayEffectGroup(188941); + + // calculate hit area of effect, just in front of the user + TargetPosition = PowerMath.TranslateDirection2D(User.Position, TargetPosition, User.Position, 9f); + + for (int n = 0; n < 3; ++n) + { + WeaponDamage(GetEnemiesInRadius(TargetPosition, 9f), 0.30f, DamageType.Physical); + yield return WaitSeconds(0.2f); + } + } + } + #endregion + + //Complete + #region Meteor + [ImplementsPowerSNO(Skills.Skills.Wizard.Offensive.Meteor)] + public class WizardMeteor : PowerScript + { + public override IEnumerable Run() + { + //Rune_D here as well. + UsePrimaryResource(ScriptFormula(8)); + + // cast effect + User.PlayEffectGroup(RuneSelect(71141, 71141, 71141, 92222, 217377, 217461)); + + // HACK: mooege's 100ms update rate is a little to slow for the impact to appear right on time so + // an 100ms is shaved off the wait time + TickTimer waitForImpact = WaitSeconds(ScriptFormula(4) - 0.1f); + + List impactPositions = new List(); + int meteorCount = Rune_B > 0 ? (int)ScriptFormula(9) : 1; + + // pending effect + meteor + for (int n = 0; n < meteorCount; ++n) + { + Vector3D impactPos; + if (meteorCount > 1) + impactPos = new Vector3D(TargetPosition.X + ((float)Rand.NextDouble() - 0.5f) * 25, + TargetPosition.Y + ((float)Rand.NextDouble() - 0.5f) * 25, + TargetPosition.Z); + else + impactPos = TargetPosition; + + SpawnEffect(RuneSelect(86790, 215853, 91440, 92030, 217142, 217457), impactPos, 0, WaitSeconds(5f)); + impactPositions.Add(impactPos); + + if (meteorCount > 1) + yield return WaitSeconds(0.1f); + } + + // wait for meteor impact(s) + yield return waitForImpact; + + // impact effects + foreach (var impactPos in impactPositions) + { + // impact + TickTimer poolTime = null; + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(impactPos, ScriptFormula(3)); + attack.AddWeaponDamage(ScriptFormula(0), RuneSelect(DamageType.Fire, DamageType.Fire, DamageType.Fire, DamageType.Cold, DamageType.Arcane, DamageType.Fire)); + attack.OnHit = hit => + { + if (Rune_E > 0) + { + if (hit.IsCriticalHit) + { + poolTime = WaitSeconds(ScriptFormula(7)); + } + } + else + { + poolTime = WaitSeconds(ScriptFormula(5)); + } + }; + attack.Apply(); + + var moltenFire = SpawnEffect(RuneSelect(86769, 215809, 91441, 92031, 217139, 217458), impactPos, 0, poolTime); + moltenFire.UpdateDelay = 1f; + moltenFire.OnUpdate = () => + { + AttackPayload DOTattack = new AttackPayload(this); + DOTattack.Targets = GetEnemiesInRadius(impactPos, ScriptFormula(3)); + DOTattack.AddWeaponDamage(ScriptFormula(2), RuneSelect(DamageType.Fire, DamageType.Fire, DamageType.Fire, DamageType.Cold, DamageType.Arcane, DamageType.Fire)); + DOTattack.OnHit = hit => + { + if (Rune_C > 0) + { + //Freezing Mist + AddBuff(hit.Target, new DebuffChilled(0.6f, WaitSeconds(3f))); + } + }; + DOTattack.Apply(); + }; + + // pool effect + if (Rune_B == 0) + { + SpawnEffect(RuneSelect(90364, 90364, -1, 92032, 217307, 217459), impactPos, 0, + WaitSeconds(ScriptFormula(5))); + } + + if (meteorCount > 1) + yield return WaitSeconds(0.1f); + } + } + } + + #endregion + + //TODO: The charged bolts work, but regular electrocution does not. + #region Electrocute + [ImplementsPowerSNO(Skills.Skills.Wizard.Signature.Electrocute)] + public class WizardElectrocute : ChanneledSkill + { + public override void OnChannelOpen() + { + EffectsPerSecond = 0.5f; + } + + public override IEnumerable Main() + { + User.TranslateFacing(TargetPosition); + + //No more Resource Cost + + if (Rune_A > 0) + { + var proj = new Projectile(this, 76019, User.Position); + proj.Position.Z += 5f; // fix height + proj.OnCollision = (hit) => + { + hit.PlayEffectGroup(77858); + WeaponDamage(GetEnemiesInRadius(proj.Position, ScriptFormula(2)), ScriptFormula(0), DamageType.Lightning); + }; + proj.Launch(TargetPosition, 1.25f); + } + else if (Rune_C > 0) + { + User.PlayEffectGroup(77807); + //unsure of the arc distances, but seems to be fine. + WeaponDamage(GetEnemiesInArcDirection(User.Position, TargetPosition, ScriptFormula(2), 90f), ScriptFormula(0), DamageType.Lightning); + } + else if (Target == null) + { + // no target, just zap the air with miss effect rope + User.AddRopeEffect(30913, TargetPosition); + } + else + { + IList targets = new List() { Target }; + Actor ropeSource = User; + Actor curTarget = Target; + float damage = ScriptFormula(0); + while (targets.Count < ScriptFormula(9) + 1) // original target + bounce 2 times + { + // replace source with proxy if it died while doing bounce delay + if (ropeSource.World == null) + ropeSource = SpawnProxy(ropeSource.Position); + + if (curTarget.World != null) + { + ropeSource.AddRopeEffect(0x78c0, curTarget); + ropeSource = curTarget; + AttackPayload attack = new AttackPayload(this); + attack.AddWeaponDamage(damage, DamageType.Lightning); + attack.Targets = new TargetList(); + attack.Targets.Actors.Add(curTarget); + attack.Apply(); + attack.OnHit = HitPayload => + { + if (Rune_E > 0) + { + if (HitPayload.IsCriticalHit) + { + Vector3D[] projDestinations = PowerMath.GenerateSpreadPositions(User.Position, Target.Position, 72f, (int)ScriptFormula(14)); + + foreach (Vector3D missilePos in projDestinations) + { + var proj = new Projectile(this, 176247, Target.Position); + proj.OnCollision = (hit) => + { + SpawnEffect(176262, new Vector3D(hit.Position.X, hit.Position.Y, hit.Position.Z + 5f)); // impact effect (fix height) + proj.Destroy(); + WeaponDamage(hit, ScriptFormula(12), DamageType.Lightning); + }; + proj.Launch(missilePos, 1.25f); + } + } + } + + }; + + if (Rune_B > 0) + { + damage *= 0.7f; + } + if (Rune_D > 0) + { + GeneratePrimaryResource(ScriptFormula(6)); + } + } + else + { + // early out if monster to be bounced died prematurely + break; + } + + curTarget = GetEnemiesInRadius(curTarget.Position, ScriptFormula(2), (int)ScriptFormula(9)).Actors.FirstOrDefault(t => !targets.Contains(t)); + if (curTarget != null) + { + targets.Add(curTarget); + yield return WaitSeconds(0.150f); + } + else + { + break; + } + } + } + } + } + #endregion + + //Complete: it's fine the way homing missile is implemented for now until we see really how runes work. + #region MagicMissile + [ImplementsPowerSNO(Skills.Skills.Wizard.Signature.MagicMissile)] + public class WizardMagicMissile : Skill + { + public override IEnumerable Main() + { + //No more resource cost + User.PlayEffectGroup(19305); // cast effect + if (Rune_B > 0) + { + Vector3D[] projDestinations = PowerMath.GenerateSpreadPositions(User.Position, TargetPosition, ScriptFormula(8) / 5f, (int)ScriptFormula(5)); + + for (int i = 0; i < projDestinations.Length; i++) + { + var proj = new Projectile(this, 99567, User.Position); + proj.Launch(projDestinations[i], ScriptFormula(4)); + proj.OnCollision = (hit) => + { + SpawnEffect(99572, new Vector3D(hit.Position.X, hit.Position.Y, hit.Position.Z + 5f)); // impact effect (fix height) + proj.Destroy(); + WeaponDamage(hit, ScriptFormula(1), DamageType.Arcane); + }; + yield return WaitTicks(1); //TODO: We need less than 100MS Update. + } + } + else if (Rune_E > 0) + { + var projectile = new Projectile(this, 99567, User.Position); + var target = GetEnemiesInArcDirection(User.Position, TargetPosition, 60f, 60f).GetClosestTo(User.Position); + + if (target != null) + { + projectile.Launch(target.Position, ScriptFormula(4)); + projectile.OnCollision = (hit) => + { + SpawnEffect(99572, new Vector3D(hit.Position.X, hit.Position.Y, hit.Position.Z + 5f)); // impact effect (fix height) + projectile.Destroy(); + WeaponDamage(hit, ScriptFormula(1), DamageType.Arcane); + }; + } + else + { + projectile.Launch(TargetPosition, ScriptFormula(4)); + projectile.OnCollision = (hit) => + { + SpawnEffect(99572, new Vector3D(hit.Position.X, hit.Position.Y, hit.Position.Z + 5f)); // impact effect (fix height) + projectile.Destroy(); + WeaponDamage(hit, ScriptFormula(1), DamageType.Arcane); + }; + + for (int i = 0; i < 2; i++) + { + target = GetEnemiesInArcDirection(User.Position, TargetPosition, 60f, 60f).GetClosestTo(User.Position); + + if (target != null) + { + var projectileSeek = new Projectile(this, 99567, projectile.Position); + projectile.Destroy(); + projectileSeek.Launch(target.Position, ScriptFormula(4)); + projectileSeek.OnCollision = (hit) => + { + SpawnEffect(99572, new Vector3D(hit.Position.X, hit.Position.Y, hit.Position.Z + 5f)); // impact effect (fix height) + projectileSeek.Destroy(); + WeaponDamage(hit, ScriptFormula(1), DamageType.Arcane); + }; + i = 1; + } + + else + yield return WaitTicks(1); + } + } + } + else + { + var projectile = new Projectile(this, 99567, User.Position); + projectile.OnCollision = (hit) => + { + SpawnEffect(99572, new Vector3D(hit.Position.X, hit.Position.Y, hit.Position.Z + 5f)); // impact effect (fix height) + WeaponDamage(hit, ScriptFormula(1), DamageType.Arcane); + + if (Rune_D > 0) + { + GeneratePrimaryResource(ScriptFormula(16)); + } + + if (Rune_C > 0) + { + if (Rand.NextDouble() < ScriptFormula(12)) + { + //this is actually how i think it should work, pierce first target, if addition targets behind enemy, will continue to do damage to them as well. + } + projectile.Destroy(); + } + else + projectile.Destroy(); + }; + projectile.Launch(TargetPosition, ScriptFormula(4)); + } + + yield break; + } + } + #endregion + + //Very Imcomplete + //Hydras are (most likely) Pets so this is incorrect + #region Hydra + [ImplementsPowerSNO(Skills.Skills.Wizard.Offensive.Hydra)] + public class WizardHydra : Skill + { + public override IEnumerable Main() + { + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + //ScriptFormula(6) = Max Hydra Clusters + + Vector3D userCastPosition = new Vector3D(User.Position); + Vector3D[] spawnPoints = PowerMath.GenerateSpreadPositions(TargetPosition, new Vector3D(TargetPosition.X, TargetPosition.Y + 0.7f, TargetPosition.Z), 120, 3); + + var timeout = WaitSeconds(ScriptFormula(0)); + + var lavapool = SpawnEffect(RuneSelect(81103, 83028, 81238, 77112, 83964, 81239), TargetPosition, 0, timeout); //Lava Pool Spawn + lavapool.PlayEffectGroup(RuneSelect(81102, 82995, 82116, -1, 86328, 81301)); + + int[] actorSNOs = new int[] { RuneSelect(80745, 82972, 82109, 82111, -1, 81515), + RuneSelect(80757, 83024, 81229, 81226, -1, 81231), + RuneSelect(80758, 83025, 81230, 81227, -1, 81232) }; + + if (Rune_D > 0) + { + + //big hydra -> this throws an exception once spawned. + var hydra1 = new EffectActor(this, 83959, spawnPoints[0]); + hydra1.Scale = 2f; + hydra1.Spawn(); + hydra1.UpdateDelay = 3f; + hydra1.OnUpdate = () => + { + var target = GetEnemiesInRadius(hydra1.Position, 50f).GetClosestTo(hydra1.Position); + float castAngle = MovementHelpers.GetFacingAngle(hydra1.Position, target.Position); + hydra1.TranslateFacing(target.Position, true); + //timeout is set to 3, but starts while casting firewall, when it should start after firewall has spawned (1.8seconds) + var firewall = SpawnEffect(86082, hydra1.Position, castAngle, WaitSeconds(3f)); + firewall.UpdateDelay = 1f; + firewall.OnUpdate = () => + { + WeaponDamage(GetEnemiesInBeamDirection(hydra1.Position, target.Position, 50f, 5f), 1.00f, DamageType.Fire); + }; + + }; + } + else if (Rune_A > 0) + { + + var hydra1 = SpawnEffect(actorSNOs[0], spawnPoints[0], 0, timeout); + hydra1.UpdateDelay = 1.5f; // attack every half-second + hydra1.OnUpdate = () => + { + var target = GetEnemiesInRadius(hydra1.Position, 15f).GetClosestTo(hydra1.Position); + float castAngle = MovementHelpers.GetFacingAngle(hydra1.Position, target.Position); + hydra1.TranslateFacing(target.Position, true); + var ConeOfCold = SpawnEffect(83043, hydra1.Position, castAngle, WaitSeconds(ScriptFormula(7))); + ConeOfCold.UpdateDelay = ScriptFormula(6); + ConeOfCold.OnUpdate = () => + { + WeaponDamage(GetEnemiesInArcDirection(hydra1.Position, Target.Position, ScriptFormula(3), ScriptFormula(2)), 1.00f, DamageType.Cold); + }; + + }; + } + else if (Rune_B > 0) + { + var hydra1 = SpawnEffect(actorSNOs[0], spawnPoints[0], 0, timeout); + hydra1.UpdateDelay = 1.5f; // attack every half-second + hydra1.OnUpdate = () => + { + var targets = GetEnemiesInRadius(hydra1.Position, 50f); + if (targets.Actors.Count > 0 && targets != null) + { + //capsule width TODO + targets.SortByDistanceFrom(hydra1.Position); + hydra1.TranslateFacing(targets.Actors[0].Position, true); + hydra1.AddRopeEffect(83875, targets.Actors[0]); + WeaponDamage(targets.Actors[0], 1.00f, DamageType.Lightning); + } + }; + } + else + { + var hydra1 = SpawnEffect(actorSNOs[0], spawnPoints[0], 0, timeout); + hydra1.UpdateDelay = 1.5f; // attack every half-second + hydra1.OnUpdate = () => + { + var targets = GetEnemiesInRadius(hydra1.Position, 60f); + if (targets.Actors.Count > 0 && targets != null) + { + targets.SortByDistanceFrom(hydra1.Position); + var proj = new Projectile(this, RuneSelect(77116, 83043, -1, 77109, 86082, 77097), hydra1.Position); + proj.Position.Z += 5f; // fix height + proj.OnCollision = (hit) => + { + if (Rune_C > 0) + { + hit.PlayEffectGroup(RuneSelect(219760, 219770, 219776, 219789, -1, 81739)); + hit.PlayEffectGroup(215394); + var PoisonCloud = SpawnProxy(hit.Position, WaitSeconds(ScriptFormula(5))); + PoisonCloud.UpdateDelay = ScriptFormula(4); // attack every half-second + PoisonCloud.OnUpdate = () => + { + WeaponDamage(GetEnemiesInRadius(hit.Position, ScriptFormula(6)), 1.00f, DamageType.Poison); + }; + } + else if (Rune_E > 0) + { + hit.PlayEffectGroup(81874); + WeaponDamage(GetEnemiesInRadius(hit.Position, ScriptFormula(0)), 1.00f, DamageType.Arcane); + } + else + { + hit.PlayEffectGroup(RuneSelect(219760, 219770, 219776, 219789, -1, 81739)); + WeaponDamage(hit, 1.00f, DamageType.Fire); + } + + proj.Destroy(); + }; + hydra1.TranslateFacing(targets.Actors[0].Position, true); + //need to fix how fast it fires -> its firing before head turns. + proj.Launch(targets.Actors[0].Position, ScriptFormula(2)); + } + + }; + } + // wait for duration of skill + yield return timeout; + } + } + #endregion + + //Complete + #region ArcaneOrb + [ImplementsPowerSNO(Skills.Skills.Wizard.Offensive.ArcaneOrb)] + public class ArcaneOrb : Skill + { + public override IEnumerable Main() + { + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + Vector3D[] targetDirs; + { + targetDirs = new Vector3D[] { TargetPosition }; + } + + if (Rune_C > 0) + { + User.World.BuffManager.RemoveBuffs(User, Skills.Skills.Wizard.Offensive.ArcaneOrb); + AddBuff(User, new Orbit4()); + yield break; + } + else + + foreach (Vector3D position in targetDirs) + { + var proj = new Projectile(this, RuneSelect(6515, 130073, 215555, -1, 216040, 75650), User.Position); + proj.Position.Z += 5f; // fix height + proj.OnCollision = (hit) => + { + hit.PlayEffectGroup(RuneSelect(19308, 130020, 215580, -1, 216056, -1)); + WeaponDamage(GetEnemiesInRadius(proj.Position, ScriptFormula(5)), ScriptFormula(3), DamageType.Arcane); + + if (Rune_E > 0) + { + } + else + { + proj.Destroy(); + } + }; + proj.Launch(position, ScriptFormula(2)); + + yield return WaitSeconds(2f); + } + } + + abstract class OrbitBase : PowerBuff + { + TickTimer timer; + + public override void Init() + { + timer = WaitSeconds(1f); + } + + public override bool Update() + { + + if (base.Update()) + return true; + + if (timer.TimedOut) + { + var targets = GetEnemiesInRadius(Target.Position, 10f); + if (targets.Actors.Count > 0) + { + WeaponDamage(targets, ScriptFormula(3), DamageType.Arcane); + OrbitUsed(); + return true; + } + } + + return false; + } + + protected abstract void OrbitUsed(); + } + [ImplementsPowerBuff(0)] + class Orbit1 : OrbitBase + { + protected override void OrbitUsed() + { + // do nothing, orbits all used up + } + } + [ImplementsPowerBuff(1)] + class Orbit2 : OrbitBase + { + protected override void OrbitUsed() + { + AddBuff(Target, new Orbit1()); + } + } + [ImplementsPowerBuff(2)] + class Orbit3 : OrbitBase + { + protected override void OrbitUsed() + { + AddBuff(Target, new Orbit2()); + } + } + [ImplementsPowerBuff(3)] + class Orbit4 : OrbitBase + { + protected override void OrbitUsed() + { + AddBuff(Target, new Orbit3()); + } + } + } + #endregion + + //TODO: cannot do multiple projectiles... + //In current state, collision with enemies, causes them to be able to + //hit you from where they are standing. + #region EnergyTwister + [ImplementsPowerSNO(Skills.Skills.Wizard.Offensive.EnergyTwister)] + public class EnergyTwister : Skill + { + //http://www.youtube.com/watch?v=atIsPKXAzCU + + public override IEnumerable Main() + { + TickTimer timeout = WaitSeconds(ScriptFormula(8)); + UsePrimaryResource(ScriptFormula(15)); + var proj = new Projectile(this, RuneSelect(210896, 215311, 6560, 6560, 215324, 210804), User.Position); + proj.Launch(RandomDirection(TargetPosition, 12f, 15f), ScriptFormula(18)); + proj.Timeout = timeout; + proj.OnCollision = (hit) => + { + //WeaponDamage(hit, ScriptFormula(0), DamageType.Arcane); + }; + while (!timeout.TimedOut) + { + proj.OnArrival = () => + { + var Target = GetEnemiesInRadius(proj.Position, ScriptFormula(7)).GetClosestTo(proj.Position); + if (Target != null) + { + proj.Launch(Target.Position, ScriptFormula(18)); + } + else + proj.Launch(RandomDirection(proj.Position, 12f, 15f), ScriptFormula(18)); + }; + } + + //var Twister = SpawnEffect(RuneSelect(6560, 215311, 6560, 6560, 215324, 210804), User.Position, 0, WaitSeconds(ScriptFormula(8))); + + + //Tornados need to move randomdirections at first, if the tornado is heading towards an enemy close by, + // it will move towards the enemies. + + //Seems like it's classified as a buff (Buff Group 3) + + //and leave trail behind them (79940), think actor already does this. + + // NoRune = Unleash a twister, deals 60% weapon damage per second Arcane to everything caught within it. + // Rune_E = Stationary = deals damage but does not move + // Rune_A = Increase Damage + // Rune_C = 5 regular twisters to charge up, + // then User needs to cast signature spell, then One Big Tornado + // Rune_B = Normal Twisters, if two touch, they merge with increased AoE + // Rune_D = Reduced cost of casting resource + + yield return WaitSeconds(2f); + } + + [ImplementsPowerBuff(3)] + class Twister : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(2f); + } + + public override bool Update() + { + if (base.Update()) + return true; + + return false; + } + } + } + #endregion + + //TODO: InComplete Runes + //Unknown if targets are supposed to seizure.. Videos dont show the seezing zombies. + #region Disintegrate + [ImplementsPowerSNO(Skills.Skills.Wizard.Offensive.Disintegrate)] + public class WizardDisintegrate : ChanneledSkill + { + //TODOs + //Rune_A- same as NoRune.. -> todo: add the increase to damage + //Rune-C- parabola.acr (6523.acr) and field.efg (93563.efg)? + //Rune-D- Possibly Mini-Buff.efg/.rop and Dome.acr? + //Rune-E- explode when dead [explode.efg -> 93574], explode_proxy.acr and explodeBubble.acr + + //no idea if sourceglow/pulseglow is used, most likely not. + //unknown hitfx_override.efg + //-------------------------------------------------------------------------------------------- + //Rune_A -> Damage increases slowly over time to inflict a maximum of 4620% weapon damage as Arcane. + //(10) - Chargeup Time, (11) - Dmg Modifier + //Rune_C -> The beam fractures into a short ranged cone causing 239400% weapon damage per second as Arcane. + //ScriptFormula(2) - Damage Modifier, (4) - Range, (15) - Tick Period + //Rune_D -> When casting the beam you become charged with energy that spits out at nearby enemies doing 5700% weapon damage as Arcane. + //(7) - AOE Weapon Dmg Scalar, (8) - AOE Radius, (21) - Cost Reduction + //Rune_E -> Enemies killed by the beam have a 35% chance to explode causing 12800% weapon damage as Arcane to all enemies within 8 yards. + //(9) - Weapon dmg Scalar, (12) - Chance, (25) - Explosion Radius + + const float BeamLength = 40f; + + private Actor _target = null; + + private void _calcTargetPosition() + { + // project beam end to always be a certain length + TargetPosition = PowerMath.TranslateDirection2D(User.Position, TargetPosition, + new Vector3D(User.Position.X, User.Position.Y, TargetPosition.Z), + BeamLength); + } + + public override void OnChannelOpen() + { + EffectsPerSecond = ScriptFormula(18); + + _calcTargetPosition(); + _target = SpawnEffect(RuneSelect(52687, 52687, 93544, -1, 52687, 215723), TargetPosition, 0, WaitInfinite()); + User.AddComplexEffect(RuneSelect(18792, 18792, 93529, -1, 93593, 216368), _target); + } + + public override void OnChannelClose() + { + if (_target != null) + _target.Destroy(); + } + + public override void OnChannelUpdated() + { + _calcTargetPosition(); + User.TranslateFacing(TargetPosition); + // client updates target actor position + } + + public override IEnumerable Main() + { + UsePrimaryResource(ScriptFormula(22)); + + foreach (Actor actor in GetEnemiesInRadius(User.Position, BeamLength + 10f).Actors) + { + if (Rune_B > 0) + { + if (PowerMath.PointInBeam(actor.Position, User.Position, TargetPosition, 6f)) + { + //ScriptFormula(1) + WeaponDamage(actor, ScriptFormula(1) * EffectsPerSecond, DamageType.Arcane); + } + } + else + if (PowerMath.PointInBeam(actor.Position, User.Position, TargetPosition, 3f)) + { + //ScriptFormula(1) + WeaponDamage(actor, ScriptFormula(1) * EffectsPerSecond, DamageType.Arcane); + } + } + + yield break; + } + [ImplementsPowerBuff(0)] + class MiniBuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(2f); + } + } + [ImplementsPowerBuff(1)] + class FieldBuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(2f); + } + } + } + #endregion + + //TODO: Repelling Projectiles. + #region WaveOfForce + [ImplementsPowerSNO(Skills.Skills.Wizard.Offensive.WaveOfForce)] + public class WizardWaveOfForce : PowerScript + { + public override IEnumerable Run() + { + UsePrimaryResource(ScriptFormula(26)); + StartCooldown(WaitSeconds(ScriptFormula(30))); + + yield return WaitSeconds(0.350f); // wait for wizard to land + + //I switched the effects of obsidian and golden because in-game they are opposite + User.PlayEffectGroup(RuneSelect(19356, 82649, 215399, 215403, 215400, 215404)); + + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(1)); + attack.AddWeaponDamage(ScriptFormula(2), DamageType.Physical); + //TODO: Script 6,7,8,9 (repels projectiles) + attack.OnHit = hitPayload => + { + Knockback(hitPayload.Target, ScriptFormula(0), ScriptFormula(4), ScriptFormula(5)); + AddBuff(hitPayload.Target, new DebuffSlowed(ScriptFormula(18), WaitSeconds(ScriptFormula(17)))); + if (Rune_C > 0) + { + if (Rand.NextDouble() < ScriptFormula(14)) + { + foreach (Actor actor in GetEnemiesInRadius(User.Position, ScriptFormula(1)).Actors) + { + Vector3D targets = RandomDirection(Target.Position, ScriptFormula(12), ScriptFormula(13)); + SpawnProxy(Target.Position).PlayEffectGroup(77975); + actor.Teleport(targets); + actor.PlayEffectGroup(77976); + } + } + } + if (Rune_E > 0) + { + Knockback(hitPayload.Target, ScriptFormula(0) + ScriptFormula(11), ScriptFormula(4), ScriptFormula(5)); + AddBuff(hitPayload.Target, new DebuffStunned(WaitSeconds(ScriptFormula(10)))); + + } + if (Rune_B > 0) + { + if (Rand.NextDouble() < ScriptFormula(16)) + { + User.PlayEffectGroup(92798); + attack.AddWeaponDamage(ScriptFormula(23), DamageType.Physical); + Knockback(hitPayload.Target, ScriptFormula(0) * ScriptFormula(15), ScriptFormula(4), ScriptFormula(5)); + } + } + }; + attack.Apply(); + yield break; + } + } + #endregion + + //Complete, Rune_E seems slow but correct i guess? - Once attack speed gets calculated in later, it will be correct. + #region ExplosiveBlast + [ImplementsPowerSNO(Skills.Skills.Wizard.Offensive.ExplosiveBlast)] + public class ExplosiveBlast : Skill + { + public override IEnumerable Main() + { + Vector3D blastspot = new Vector3D(User.Position); + Actor blast = SpawnProxy(blastspot); + + if (Rune_A > 0) + { + UsePrimaryResource(ScriptFormula(15)); + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + } + else + { + UsePrimaryResource(ScriptFormula(15)); + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + User.PlayEffectGroup(89449); + } + + yield return WaitSeconds(ScriptFormula(5)); + + if (Rune_C > 0) + { + SpawnEffect(61419, blastspot); + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(2)); + attack.AddWeaponDamage(ScriptFormula(0), DamageType.Physical); + attack.Apply(); + yield break; + } + IEnumerable subScript; + if (Rune_E > 0) + subScript = _RuneE(); + else + //NoRune will actually do the animation and formulas for A,B,D,and NoRune + subScript = _NoRune(); + + foreach (var timeout in subScript) + yield return timeout; + } + IEnumerable _NoRune() + { + SpawnEffect(RuneSelect(61419, 61419, 192210, -1, 192211, -1), User.Position); + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(2)); + attack.AddWeaponDamage(ScriptFormula(0), DamageType.Physical); + attack.Apply(); + yield break; + } + IEnumerable _RuneE() + { + for (int i = 0; i < (Rune_E + 1); ++i) + { + SpawnEffect(61419, User.Position); + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(2)); + attack.AddWeaponDamage(ScriptFormula(0), DamageType.Physical); + attack.Apply(); + yield return WaitSeconds(ScriptFormula(14)); + } + yield break; + } + } + #endregion + + //TODO: All Runes + #region ArcaneTorrent + [ImplementsPowerSNO(Skills.Skills.Wizard.Offensive.ArcaneTorrent)] + public class WizardArcaneTorrent : ChanneledSkill + { + + private Actor _targetProxy = null; + private Actor _userProxy = null; + + public override void OnChannelOpen() + { + EffectsPerSecond = 0.2f; + + _targetProxy = SpawnEffect(RuneSelect(134595, 170443, 170285, 170830, 170590, 134595), TargetPosition, 0, WaitInfinite()); + _userProxy = SpawnProxy(User.Position, WaitInfinite()); + _userProxy.PlayEffectGroup(RuneSelect(134442, 170263, 170264, 170569, 170572, 164077), _targetProxy); + } + + public override void OnChannelClose() + { + _targetProxy.Destroy(); + _userProxy.Destroy(); + } + + public override IEnumerable Main() + { + UsePrimaryResource(ScriptFormula(30) * EffectsPerSecond); + + //if (Rune_C > 0) + + /* Instead of firing projectiles, lay Arcane mines that arm after 1 |4second:seconds;. + * These mines explode when an enemy approaches, dealing [114 * Casting_Speed_Total * 100]% weapon damage as Arcane. + * Enemies caught in the explosion have their movement and attack speeds reduced by 30% for 3 seconds. */ + + //else if (Rune_E > 0) + + //Unleash the torrent beyond your control. You can no longer direct where the projectiles go + //but their damage is increased to 19900% weapon damage as Arcane. + + //else + + AddBuff(User, new CastEffect()); + + Vector3D laggyPosition = new Vector3D(TargetPosition); + + yield return WaitSeconds(0.9f); + + // update proxy target delayed so animation lines up with explosions a bit better + if (IsChannelOpen) + TranslateEffect(_targetProxy, laggyPosition, 8f); + + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(laggyPosition, 6f); + attack.AddWeaponDamage(2.00f * EffectsPerSecond, DamageType.Arcane); + attack.OnHit = hitPayload => + { + if (Rune_A > 0) + { + //enemies get disrupted for six seconds and take 120% additional dmg from arcane attacks. + } + if (Rune_D > 0) + { + if (Rand.NextDouble() < ScriptFormula(11)) + { + //spawn a power stone that grants arcane power + } + } + }; + attack.Apply(); + + /*attack.OnDeath = () => + { + if (Rune_B > 0) + { + var proj = new Projectile(this, 170268, hitPayload.Position); + proj.Position.Z += 5f; // fix height + proj.OnCollision = (hit) => + { + hit.PlayEffectGroup(RuneSelect(19308, 130020, 215580, -1, 216056, -1)); + WeaponDamage(GetEnemiesInRadius(proj.Position, ScriptFormula(5)), ScriptFormula(3), DamageType.Arcane); + proj.Destroy(); + }; + proj.Launch(position, ScriptFormula(2)); + //Enemies killed by Arcane Torrent have a 95% chance to fire a new missile at a nearby enemy dealing 5000% weapon damage as Arcane. + //SF(12 -> Spawn Chance + //SF(13 -> Weapon Damage + //SF(23 -> + //SF(24 -> 25 yard radius + } + };*/ + } + + [ImplementsPowerBuff(0)] + class CastEffect : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(0.3f); + } + } + [ImplementsPowerBuff(1)] + class Crimson_DestablizedEffect : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(2f); + } + } + } + #endregion + + //Complete, just need attributes and buffs checked. + #region FrostNova + [ImplementsPowerSNO(Skills.Skills.Wizard.Utility.FrostNova)] + public class WizardFrostNova : PowerScript + { + public override IEnumerable Run() + { + if (Rune_C > 0) + { + //No Resouce Cost + StartCooldown(WaitSeconds(ScriptFormula(3))); + var frozenMist = SpawnEffect(RuneSelect(4402, 189047, 189048, 75631, 189049, 189050), User.Position, 0, WaitSeconds(ScriptFormula(9))); + frozenMist.UpdateDelay = 1f; + frozenMist.OnUpdate = () => + { + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(6)); + attack.AddWeaponDamage(ScriptFormula(11), DamageType.Cold); + attack.OnHit = hitPayload => + { + AddBuff(hitPayload.Target, new DebuffChilled(ScriptFormula(5), WaitSeconds(ScriptFormula(9)))); + }; + attack.Apply(); + }; + } + else + { + StartCooldown(WaitSeconds(ScriptFormula(3))); + SpawnEffect(RuneSelect(4402, 189047, 189048, 75631, 189049, 189050), User.Position); + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(6)); + attack.AddWeaponDamage(0.65f, DamageType.Cold); + attack.OnHit = hit => + { + AddBuff(hit.Target, new DebuffFrozen(WaitSeconds(ScriptFormula(2)))); + if (Rune_A > 0) + { + AddBuff(hit.Target, new Damage_debuff()); + } + if (GetEnemiesInRadius(User.Position, ScriptFormula(6)).Actors.Count > ScriptFormula(13)) + { + if (Rune_E > 0) + { + if (Rand.NextDouble() < ((Rune_E * 5) + .10f)) + { + AddBuff(hit.Target, new FrostNova_Alabaster_Buff()); + } + } + } + }; + attack.OnDeath = hitPayload => + { + if (Rune_B > 0) + { + //does this work? + if (AddBuff(hitPayload.Target, new DebuffFrozen(WaitSeconds(ScriptFormula(2))))) + { + if (Rand.NextDouble() < ScriptFormula(14)) + { + //does this work? hitPayload.Target.Position, will that get the target that dies? + SpawnEffect(189048, hitPayload.Target.Position); + WeaponDamage(GetEnemiesInRadius(hitPayload.Target.Position, ScriptFormula(15)), ScriptFormula(7), DamageType.Cold); + } + } + } + }; + attack.Apply(); + } + yield break; + } + [ImplementsPowerBuff(5)] + class FrostNova_Alabaster_Buff : PowerBuff + { + //SF is an int value? how does that work for a percent.... + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(4)); + } + public override bool Apply() + { + if (!base.Apply()) + return false; + //User.Attributes[GameAttribute.Crit_Damage_Percent] += ScriptFormula(18); + User.Attributes.BroadcastChangedIfRevealed(); + return true; + } + public override void Remove() + { + base.Remove(); + //User.Attributes[GameAttribute.Crit_Damage_Percent] -= ScriptFormula(18); + User.Attributes.BroadcastChangedIfRevealed(); + } + } + [ImplementsPowerBuff(4)] + class Damage_debuff : PowerBuff + { + //this happens when the frostnova happens to monsters hit by it. + //you deal more damage towards these enemies. + //Does that mean the Monsters gets a debuff or the player gets a buff specified to the monsters? + //ScriptFormula(16) -> A: Damage Bonus + public override void Init() + { + Timeout = WaitSeconds(3f); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + return true; + } + + public override void Remove() + { + base.Remove(); + } + } + } + #endregion + + //Complete + #region Blizzard + [ImplementsPowerSNO(Skills.Skills.Wizard.Offensive.Blizzard)] + public class WizardBlizzard : PowerScript + { + public const int Wizard_Blizzard = 0x1977; + + public override IEnumerable Run() + { + UsePrimaryResource(ScriptFormula(19)); + + SpawnEffect(Wizard_Blizzard, TargetPosition); + + for (int i = 0; i < ScriptFormula(4); ++i) + { + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(TargetPosition, ScriptFormula(3)); + attack.AddWeaponDamage(ScriptFormula(0), DamageType.Cold); + attack.OnHit = (hit) => + { + //seems like this should be obvious to have in Blizzard. + AddBuff(hit.Target, new DebuffChilled(0.5f, WaitSeconds(3f))); + + if (Rune_E > 0) + { + //Crit Strike Chance(ScriptFormula(9)) -> there is no Crit Strike Chance, so i've used Crit Damage Percent.. + AddBuff(User, new BlizzardPowers(WaitSeconds(3f))); + if (Rand.NextDouble() < ScriptFormula(10)) + { + { + AddBuff(hit.Target, new DebuffFrozen(WaitSeconds(3f))); + } + } + } + }; + attack.Apply(); + + yield return WaitSeconds(1f); + } + if (Rune_C > 0) + { + var BlizzMist = SpawnEffect(75642, User.Position, 0, WaitSeconds(ScriptFormula(7))); + BlizzMist.UpdateDelay = 0.5f; + BlizzMist.OnUpdate = () => + { + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(TargetPosition, ScriptFormula(3)); + attack.AddWeaponDamage(0f, DamageType.Cold); + attack.OnHit = (hit) => + { + AddBuff(hit.Target, new DebuffChilled(0.75f, WaitSeconds(ScriptFormula(20)))); + }; + }; + } + } + } + #endregion + + //TODO: finalize chilled debuff params, rune cast effects + #region RayOfFrost + [ImplementsPowerSNO(Skills.Skills.Wizard.Offensive.RayOfFrost)] + public class WizardRayOfFrost : ChanneledSkill + { + const float MaxBeamLength = 40f; + private Actor _beamEnd; + + private Vector3D _calcBeamEnd(float length) + { + return PowerMath.TranslateDirection2D(User.Position, TargetPosition, + new Vector3D(User.Position.X, User.Position.Y, TargetPosition.Z), + length); + } + + public override void OnChannelOpen() + { + this.EffectsPerSecond = ScriptFormula(15); + + if (Rune_B > 0) + { + AddBuff(User, new IceDomeBuff()); + } + else + { + _beamEnd = SpawnEffect(6535, User.Position, 0, WaitInfinite()); + User.AddComplexEffect(RuneSelect(19327, 149835, -1, 149836, 149869, 149879), _beamEnd); + } + } + + public override void OnChannelClose() + { + if (_beamEnd != null) + _beamEnd.Destroy(); + } + + public override void OnChannelUpdated() + { + User.TranslateFacing(TargetPosition); + + if (Rune_B > 0) + { + AddBuff(User, new IceDomeBuff()); + } + } + + public override IEnumerable Main() + { + // Rune_D resource mod calculated in SF_19 + UsePrimaryResource(ScriptFormula(19)); + + AttackPayload attack = new AttackPayload(this); + if (Rune_B > 0) + { + attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(7)); + attack.AddWeaponDamage(ScriptFormula(6), DamageType.Cold); + // TODO: chill debuff? + } + else + { + // Select first actor beam hits, or make max beam length + Vector3D attackPos; + var beamTargets = GetEnemiesInBeamDirection(User.Position, TargetPosition, MaxBeamLength, ScriptFormula(10)); + if (beamTargets.Actors.Count > 0) + { + Actor target = beamTargets.GetClosestTo(User.Position); + attackPos = target.Position + new Vector3D(0, 0, 5f); // fix height for beam end + attack.SetSingleTarget(target); + } + else + { + attackPos = _calcBeamEnd(MaxBeamLength); + } + + // update _beamEnd actor + _beamEnd.MoveSnapped(attackPos, 0f); + + // all runes other than B seem to share the same weapon damage. + attack.AddWeaponDamage(ScriptFormula(0), DamageType.Cold); + + if (Rune_A > 0) + { + // TODO: damage time amp + attack.OnHit = hit => + { + AddBuff(hit.Target, new DebuffChilled(0.3f, WaitSeconds(0.5f))); //slow 40%, atk spd 30% + //this does attack and movement, but doesnt do the difference which is needed. + }; + } + else if (Rune_C > 0) + { + attack.OnHit = hit => + { + AddBuff(hit.Target, new DebuffChilled(ScriptFormula(14), WaitSeconds(ScriptFormula(4)))); //slow 40%, atk spd 30% + //Atk Speed Reduction % {SF(24)} to monster //AddBuff(actor, new AtkSpeedDebuff + //Dmg Reduction {SF(25)} + //targets attack speed by 30% for 5 seconds + }; + } + else + { + attack.OnHit = hit => + { + AddBuff(hit.Target, new DebuffChilled(0.3f, WaitSeconds(0.5f))); //slow 40%, atk spd 30% + //this does attack and movement, but doesnt do the difference which is needed. + }; + } + + if (Rune_E > 0) + { + attack.OnDeath = death => + { + var icepool = SpawnEffect(148634, death.Target.Position, 0, WaitSeconds(ScriptFormula(8))); + icepool.PlayEffectGroup(149879); + icepool.UpdateDelay = 1f; + icepool.OnUpdate = () => + { + WeaponDamage(GetEnemiesInRadius(icepool.Position, 3f), ScriptFormula(3), DamageType.Cold); + // TODO: chilled buff? + }; + }; + } + } + + attack.Apply(); + yield break; + } + + [ImplementsPowerBuff(1)] + class IceDomeBuff : PowerBuff + { + //Rune_B + public override void Init() + { + Timeout = WaitSeconds(0.2f); + } + } + } + #endregion + + //TODO: Rune_B -> mirror images + #region Teleport + [ImplementsPowerSNO(Skills.Skills.Wizard.Utility.Teleport)] + public class WizardTeleport : PowerScript + { + public override IEnumerable Run() + { + if (!User.World.CheckLocationForFlag(TargetPosition, Mooege.Common.MPQ.FileFormats.Scene.NavCellFlags.AllowWalk)) + { + Logger.Info("Tried to Teleport to unwalkable location"); + User.PlayEffectGroup(RuneSelect(170232, 170232, 170232, 192053, 192080, 192152)); + + TeleRevertBuff buff = User.World.BuffManager.GetFirstBuff(User); + if (buff != null) + { + yield return WaitSeconds(0.3f); + User.Teleport(buff.OrigSpot); + User.PlayEffectGroup(RuneSelect(170232, 170232, 170232, 192053, 192080, 192152)); + buff.Remove(); // Ensures that you can only revert the teleport once. + } + } + else + { + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + if (!(Rune_E > 0 || Rune_D > 0)) + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + } + + if (Rune_D > 0) + { + TeleRevertBuff buff = User.World.BuffManager.GetFirstBuff(User); + if (buff != null) + { + User.PlayEffectGroup(RuneSelect(170232, 170232, 170232, 192053, 192080, 192152)); + yield return WaitSeconds(0.3f); + User.Teleport(buff.OrigSpot); + User.PlayEffectGroup(RuneSelect(170232, 170232, 170232, 192053, 192080, 192152)); + buff.Remove(); // Ensures that you can only revert the teleport once. + } + else + { + Vector3D OrigSpot; + Actor OrigTele; + OrigSpot = new Vector3D(User.Position.X, User.Position.Y, User.Position.Z); + OrigTele = SpawnProxy(OrigSpot, WaitSeconds(ScriptFormula(18))); + OrigTele.PlayEffectGroup(RuneSelect(170231, 205685, 205684, 191913, 192074, 192151)); + OrigTele.PlayEffectGroup(206679); + AddBuff(User, new TeleRevertBuff(OrigSpot, OrigTele)); + yield return WaitSeconds(0.3f); + User.Teleport(TargetPosition); + User.PlayEffectGroup(RuneSelect(170232, 170232, 170232, 192053, 192080, 192152)); + } + + } + else + { + SpawnProxy(User.Position).PlayEffectGroup(RuneSelect(170231, 205685, 205684, 191913, 192074, 192151)); // alt cast efg: 170231 + yield return WaitSeconds(0.3f); + User.Teleport(TargetPosition); + //MDZ says this might work just as 191849. + User.PlayEffectGroup(RuneSelect(170232, 170232, 170232, 192053, 192080, 192152)); + } + + if (Rune_A > 0) + { + User.PlayEffectGroup(170289); + AttackPayload attack = new AttackPayload(this); + attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(1)); + attack.AddWeaponDamage(ScriptFormula(2), DamageType.Physical); + attack.OnHit = hitPayload => + { + Knockback(hitPayload.Target, ScriptFormula(4), ScriptFormula(5), ScriptFormula(6)); + }; + attack.Apply(); + + } + if (Rune_B > 0) + { + //Rune_B - Summon 2 mirror images for 15 |4second:seconds; on arrival. + //SF(7,8,9,10,11) + } + if (Rune_C > 0) + { + AddBuff(User, new TeleDmgReductionBuff()); + } + if (Rune_E > 0) + { + AddBuff(User, new TeleCoolDownBuff()); + } + } + } + [ImplementsPowerBuff(1)] + class TeleDmgReductionBuff : PowerBuff + { + public override void Init() { Timeout = WaitSeconds(ScriptFormula(15)); } + + public override bool Apply() + { + if (!base.Apply()) + return false; + //gameattribute damage reduction, Absorb should do the same thing? + Target.Attributes[GameAttribute.Damage_Absorb_Percent] += ScriptFormula(14); + Target.Attributes.BroadcastChangedIfRevealed(); + return true; + } + + public override void Remove() + { + base.Remove(); + Target.Attributes[GameAttribute.Damage_Absorb_Percent] -= ScriptFormula(14); + Target.Attributes.BroadcastChangedIfRevealed(); + + } + } + [ImplementsPowerBuff(5)] + class TeleRevertBuff : PowerBuff + { + public Vector3D OrigSpot; + public Actor OrigTele; + + public TeleRevertBuff(Vector3D OrigSpot, Actor OrigTele) + { + this.OrigSpot = OrigSpot; + this.OrigTele = OrigTele; + } + + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(1)); + } + public override bool Apply() + { + if (!base.Apply()) + return false; + return true; + } + public override void Remove() + { + Timeout.Stop(); + //OrigTele.Destroy(); -- Removes the voidzone effect as though, but also throws an exception. + // Perhaps one cannot Destroy() a proxy actor, + // but is there any other way to quit the effectgroup early? + base.Remove(); + StartCooldown(WaitSeconds(ScriptFormula(20))); + } + } + [ImplementsPowerBuff(5)] + class TeleCoolDownBuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(16)); + } + public override void Remove() + { + base.Remove(); + StartCooldown(WaitSeconds(ScriptFormula(20))); + } + } + } + #endregion + + //TODO: your attacks have a chance to frost nova a target, OnHitPayload in buff? + #region Icearmor + [ImplementsPowerSNO(Skills.Skills.Wizard.Utility.IceArmor)] + public class IceArmor : Skill + { + public override IEnumerable Main() + { + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + + AddBuff(User, new IceArmorBuff()); + if (Rune_D > 0) + { + AddBuff(User, new BonusStackEffect()); + } + if (Rune_C > 0) + { + yield return WaitSeconds(1f); + AddBuff(User, new FrozenRingBuff()); + } + + yield break; + } + + //0 = IceArmor, 1 = Rune_C, 2 = buff_switch + [ImplementsPowerBuff(0)] + class IceArmorBuff : PowerBuff + { + const float _damageRate = 1.5f; + TickTimer _damageTimer = null; + + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(3)); + } + public override bool Apply() + { + if (!base.Apply()) + return false; + User.Attributes[GameAttribute.Armor_Item_Percent] += ScriptFormula(2); + User.Attributes.BroadcastChangedIfRevealed(); + + return true; + } + public override void OnPayload(Payload payload) + { + if (payload.Target == Target && payload is HitPayload) + { + WeaponDamage(payload.Context.User, ScriptFormula(0), DamageType.Cold); + AddBuff(payload.Context.User, new DebuffChilled(0.5f, WaitSeconds(ScriptFormula(4)))); + } + //"your attacks have a chance to frost nova" + /*if (payload.Target == User && payload is HitPayload) + { + if (Rune_E > 0) + { + if (Rand.NextDouble() < ScriptFormula(12)) + { + payload.Target.PlayEffectGroup(19321); + AttackPayload frostNova = new AttackPayload(this); + frostNova.Targets = GetEnemiesInRadius(payload.Target.Position, ScriptFormula(6)); + frostNova.AddWeaponDamage(ScriptFormula(19) * ScriptFormula(13), DamageType.Cold); + frostNova.OnHit = hitPayload => + { + AddBuff(hitPayload.Target, new DebuffFrozen(WaitSeconds(ScriptFormula(16)))); + }; + frostNova.Apply(); + } + } + }*/ + } + public override bool Update() + { + if (base.Update()) + return true; + if (_damageTimer == null || _damageTimer.TimedOut) + { + _damageTimer = WaitSeconds(_damageRate); + + if (Rune_B > 0) + { + AttackPayload chillingAura = new AttackPayload(this); + chillingAura.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(7)); + chillingAura.OnHit = (hit) => + { + AddBuff(hit.Target, new DebuffChilled(0.5f, WaitSeconds(ScriptFormula(23)))); + }; + chillingAura.Apply(); + } + } + return false; + } + public override void Remove() + { + base.Remove(); + User.Attributes[GameAttribute.Armor_Item_Percent] -= ScriptFormula(2); + User.Attributes.BroadcastChangedIfRevealed(); + //User.PlayEffectGroup(19326); + //User.PlayEffectGroup(185652); + + } + } + //Rune_D + [ImplementsPowerBuff(2, true)] + class BonusStackEffect : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(27)); + MaxStackCount = (int)ScriptFormula(11); + } + public override void OnPayload(Payload payload) + { + if (payload.Target == Target && payload is HitPayload) + { + if (Rune_D > 0) + { + _AddArmor(); + } + } + } + public override bool Stack(Buff buff) + { + bool stacked = StackCount < MaxStackCount; + base.Stack(buff); + + if (stacked) + _AddArmor(); + return true; + } + public override void Remove() + { + base.Remove(); + User.Attributes[GameAttribute.Armor_Item_Percent] -= StackCount * ScriptFormula(26); + User.Attributes.BroadcastChangedIfRevealed(); + } + private void _AddArmor() + { + User.Attributes[GameAttribute.Armor_Item_Percent] += ScriptFormula(26); + User.Attributes.BroadcastChangedIfRevealed(); + } + } + //Rune_C + [ImplementsPowerBuff(1)] + class FrozenRingBuff : PowerBuff + { + const float _damageRate = 0.5f; + TickTimer _damageTimer = null; + + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(8)); + } + public override bool Update() + { + if (base.Update()) + return true; + if (_damageTimer == null || _damageTimer.TimedOut) + { + _damageTimer = WaitSeconds(_damageRate); + + AttackPayload chillingAura = new AttackPayload(this); + chillingAura.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(7)); + chillingAura.AddWeaponDamage(ScriptFormula(9), DamageType.Cold); + chillingAura.Apply(); + } + return false; + } + } + } + #endregion + + //Broken + #region ShockPulse + [ImplementsPowerSNO(Skills.Skills.Wizard.Signature.ShockPulse)] + public class WizardShockPulse : Skill + { + //A:Casts out bolts of fire to deal 195% weapon damage as Fire. + //B:Turn the bolts into a floating orb of static lightning that drifts directly forward, zapping up to 5 nearby enemies for 46% weapon damage as Lightning. + //C:Merge the bolts in a a single giant orb that oscillates forward dealing 95% weapon damage as Lightning to everything it hits with a 100% chance to pierce through enemies. + //DONE -> D:Every target hit by a pulse restores 7 Arcane Power. + //E:Slain enemies have a 100% chance to explode dealing 450% weapon damage as Lightning to every enemy within 10 yards. + public override IEnumerable Main() + { + /* UsePrimaryResource(ScriptFormula(13)); //No resource used + User.PlayEffectGroup(67099); // cast effect + if (Rune_B > 0 || Rune_C > 0) + { + _SpawnBolt(); + } + else + { + for (int n = 0; n < 3; ++n) + _SpawnBolt(); + } + */ + yield break; + } + + private void _SpawnBolt() + { + var eff = SpawnEffect(RuneSelect(176247, 176287, 176653, 201526, 176248, 176356), User.Position, 0, WaitSeconds(ScriptFormula(25))); + + World.BroadcastIfRevealed(new ACDTranslateDetPathMessage + { + Id = 118, + Field0 = (int)eff.DynamicID, + Field1 = 1, // 0 - crashes client + // 1 - random scuttle (charged bolt effect) + // 2 - random movement, random movement pauses (toads hopping) + // 3 - clockwise spiral + // 4 - counter-clockwise spiral + // >=5 - nothing it seems + Field2 = Rand.Next(), // RNG seed for style 1 and 2 + Field3 = Rand.Next(), // RNG seed for style 1 and 2 + Field4 = new Vector3D(0.0f, 0.3f, 0), // length of this vector is amount moved for style 1 and 2, + Field5 = MovementHelpers.GetFacingAngle(User.Position, TargetPosition), // facing angle + Field6 = User.Position, + Field7 = 1, + Field8 = 0, + Field9 = -1, + Field10 = PowerSNO, // power sno + Field11 = 0, + Field12 = 0f, // spiral control? + Field13 = 0f, // spiral control? for charged bolt this is facing angle again, but seems to effect nothing. + Field14 = 0f, // spiral control? for charged bolt this is Position.X and seems to effect nothing + Field15 = 0f // spiral control? for charged bolt this is Position.Y and seems to effect nothing + }, eff); + + /* + * private void _calcTargetPosition() + { + // project beam end to always be a certain length + TargetPosition = PowerMath.TranslateDirection2D(User.Position, TargetPosition, + new Vector3D(User.Position.X, User.Position.Y, TargetPosition.Z), + 50f); + } + * _calcTargetPosition(); + + + if (Rune_B > 0 || Rune_C > 0) + { + bolts = 1; + } + else bolts = 3; + + Vector3D[] projDestinations = PowerMath.GenerateSpreadPositions(User.Position, TargetPosition, 10f, bolts); + + foreach (Vector3D missilePos in projDestinations) + { + var proj = new Projectile(this, RuneSelect(176247, 176287, 176653, 201526, 176248, 176356), User.Position); + proj.OnCollision = (hit) => + { + SpawnEffect(RuneSelect(176247, 176287, 176653, 201526, 176248, 176356), new Vector3D(hit.Position.X, hit.Position.Y, hit.Position.Z + 5f)); // impact effect (fix height) + if (Rune_B > 0) + { + WeaponDamage(GetEnemiesInRadius(proj.Position, ScriptFormula(21)), ScriptFormula(4), DamageType.Lightning); + } + else + { + WeaponDamage(hit, ScriptFormula(4), DamageType.Lightning); + } + }; + proj.Launch(missilePos, ScriptFormula(6)); + + WaitSeconds(ScriptFormula(25)); + }*/ + + } + } + #endregion + + //TODO: Rune_E + #region StormArmor + [ImplementsPowerSNO(Skills.Skills.Wizard.Utility.StormArmor)] + public class StormArmor : Skill + { + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + AddBuff(User, new StormArmorBuff()); + if (Rune_D > 0) + { + AddBuff(User, new GoldenBuff()); + } + yield break; + } + + [ImplementsPowerBuff(0)] + class StormArmorBuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(0)); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + return true; + } + + public override void OnPayload(Payload payload) + { + //TODO:Rune_E -> Whenever you cast a spell that critically hits, you also shock a nearby enemy for 319% weapon damage as Lightning. + if (payload.Target == Target && payload is HitPayload) + { + //projectile? ScriptFormula(3) is speed. + AttackPayload attack = new AttackPayload(this); + attack.SetSingleTarget(payload.Context.User); + attack.AddWeaponDamage(ScriptFormula(1), DamageType.Lightning); + attack.Apply(); + if (Rune_B > 0) + { + AddBuff(User, new IndigoBuff()); + AddBuff(User, new MovementBuff(ScriptFormula(14), WaitSeconds(ScriptFormula(20)))); + } + if (Rune_C > 0) + { + AddBuff(User, new TeslaBuff()); + } + } + } + + public override void Remove() + { + base.Remove(); + } + } + [ImplementsPowerBuff(1)] + class TeslaBuff : PowerBuff + { + const float _damageRate = 1f; + TickTimer _damageTimer = null; + + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(20)); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + return true; + } + public override bool Update() + { + if (base.Update()) + return true; + if (_damageTimer == null || _damageTimer.TimedOut) + { + _damageTimer = WaitSeconds(_damageRate); + + AttackPayload attack = new AttackPayload(this); + //there is no real radius description, just says nearby enemies. + attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(19)); + attack.AddWeaponDamage(ScriptFormula(9), DamageType.Lightning); + attack.Apply(); + } + return false; + } + + public override void Remove() + { + base.Remove(); + } + } + [ImplementsPowerBuff(2)] + class IndigoBuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(23)); + } + } + [ImplementsPowerBuff(3)] + class GoldenBuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(0)); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + + if (Rune_D > 0) + { + User.Attributes[GameAttribute.Resource_Cost_Reduction_Amount] += 7; + User.Attributes.BroadcastChangedIfRevealed(); + } + return true; + } + + public override void Remove() + { + if (Rune_D > 0) + { + User.Attributes[GameAttribute.Resource_Cost_Reduction_Amount] -= 7; + User.Attributes.BroadcastChangedIfRevealed(); + } + base.Remove(); + } + } + } + #endregion + + //Rune_B+D+E:Done + //TODO:Rune_A -> reflects damage + //TODO:NoRune + Rune_C -> Absorbtion, C: increases absorbtion, done within ScriptFormula(0) + #region DiamondSkin + [ImplementsPowerSNO(Skills.Skills.Wizard.Utility.DiamondSkin)] + public class DiamondSkin : Skill + { + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + //No Resource Cost + AddBuff(User, new DiamondSkinBuff()); + yield break; + } + + [ImplementsPowerBuff(0)] + class DiamondSkinBuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(5)); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + User.Attributes[Mooege.Net.GS.Message.GameAttribute.Look_Override] = 0x061F7489; + //User.Attributes[GameAttribute.Breakable_Shield_HP] += ScriptFormula(0); + User.Attributes.BroadcastChangedIfRevealed(); + if (Rune_D > 0) + { + User.Attributes[GameAttribute.Resource_Cost_Reduction_Amount] += (int)ScriptFormula(4); + User.Attributes.BroadcastChangedIfRevealed(); + } + return true; + } + + public override void OnPayload(Payload payload) + { + if (payload.Target == Target && payload is HitPayload) + { + if (Rune_A > 0) + { + //Reflect Damage back to Target SF(1) + } + //Absorb Damge (NoRune and Rune_C) -> ScriptFormula(0) or is it ScriptFormula(39) + } + } + + public override void Remove() + { + base.Remove(); + User.Attributes[Mooege.Net.GS.Message.GameAttribute.Look_Override] = 0; + User.PlayEffectGroup(RuneSelect(93077, 187716, 187805, 187822, 187831, 187851)); + //User.Attributes[GameAttribute.Breakable_Shield_HP] -= ScriptFormula(0); + User.Attributes.BroadcastChangedIfRevealed(); + if (Rune_D > 0) + { + User.Attributes[GameAttribute.Resource_Cost_Reduction_Amount] -= (int)ScriptFormula(4); + User.Attributes.BroadcastChangedIfRevealed(); + } + if (Rune_E > 0) + { + User.PlayEffectGroup(92957); + WeaponDamage(GetEnemiesInRadius(User.Position, ScriptFormula(6)), ScriptFormula(2), DamageType.Physical); + } + } + } + [ImplementsPowerBuff(1)] + class StoneSkinBuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(5)); + } + } + [ImplementsPowerBuff(2)] + class StoneArmorBuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(5)); + } + } + } + #endregion + + //TODO:Rune_B: create an outer ring and only get that outer ring of targets. + #region SlowTime + [ImplementsPowerSNO(Skills.Skills.Wizard.Utility.SlowTime)] + public class SlowTime : Skill + { + public override IEnumerable Main() + { + if (Rune_D > 0) + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + //No Resouce Cost + AddBuff(User, new SlowTimeBuff()); + yield break; + } + else + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + //No Resouce Cost + AddBuff(User, new SlowTimeBuff()); + yield break; + } + + [ImplementsPowerBuff(0)] + class SlowTimeBuff : PowerBuff + { + const float _damageRate = 0.2f; + TickTimer _damageTimer = null; + + + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(11)); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + + SpawnEffect(RuneSelect(6553, 112585, 112808, 112560, 112572, 112697), User.Position); + return true; + } + + public override bool Update() + { + if (base.Update()) + { + return true; + } + if (base.Update()) + return true; + + if (_damageTimer == null || _damageTimer.TimedOut) + { + _damageTimer = WaitSeconds(_damageRate); + + var targets = GetEnemiesInRadius(User.Position, ScriptFormula(2)); + if (targets.Actors.Count > 0) + { + foreach (Actor actor in targets.Actors) + { + AddBuff(actor, new SlowTimeDebuff(ScriptFormula(3), WaitSeconds(ScriptFormula(0)))); + + if (Rune_A > 0) + { + AddBuff(actor, new AttackDamageBuff()); + } + } + } + if (Rune_E > 0) + { + var friendlytargets = GetAlliesInRadius(User.Position, ScriptFormula(2)); + if (friendlytargets.Actors.Count > 0) + { + foreach (Actor actor in friendlytargets.Actors) + { + AddBuff(actor, new SpeedBuff(ScriptFormula(16), WaitSeconds(ScriptFormula(0)))); + } + } + } + if (Rune_B > 0) + { + //this is what it needs to be. + //GetEnemiesInRadius(User.Position, ScriptFormula(2) + 2f) - GetEnemiesInRadius(User.Position, ScriptFormula(2)); + var OutOfRangeTargets = GetEnemiesInRadius(User.Position, ScriptFormula(2) + 2f); + foreach (Actor actor in OutOfRangeTargets.Actors) + { + AddBuff(actor, new SlowTimeDebuff(ScriptFormula(3), WaitSeconds(ScriptFormula(7)))); + } + } + } + return false; + } + + public override void Remove() + { + base.Remove(); + + } + } + [ImplementsPowerBuff(1)] + class AttackDamageBuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(0)); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + Target.Attributes[GameAttribute.Attack_Bonus_Percent] += ScriptFormula(8); + return true; + } + public override void Remove() + { + base.Remove(); + Target.Attributes[GameAttribute.Attack_Bonus_Percent] -= ScriptFormula(8); + } + } + } + #endregion + + //TODO: finish OnPayload + #region EnergyArmor + [ImplementsPowerSNO(Skills.Skills.Wizard.Utility.EnergyArmor)] + public class EnergyArmor : Skill + { + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + AddBuff(User, new EnergyArmorBuff()); + yield break; + } + + [ImplementsPowerBuff(0)] + class EnergyArmorBuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(0)); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + AddBuff(User, new EnergyArmorPowers(WaitSeconds(ScriptFormula(0)))); + return true; + } + + public override void OnPayload(Payload payload) + { + if (payload.Target == Target && payload is HitPayload) + { + if (Rune_C > 0) + { + //ScriptFormula(8) = % of Wizard Total Health -> 0.54 - (Rune_C * 0.04) + //Math.Min(Total Damage incoming/Maximum Life, 26% of Maximum Life) + float HPamount = User.Attributes[GameAttribute.Hitpoints_Max_Total]; + float TargetHit = payload.Context.Target.Attributes[GameAttribute.Get_Hit_Current]; + float NewDamage = Math.Min(TargetHit / HPamount, ScriptFormula(8) / HPamount); + payload.Context.Target.Attributes[GameAttribute.Get_Hit_Current] = NewDamage; + payload.Context.Target.Attributes.BroadcastChangedIfRevealed(); + } + if (Rune_D > 0) + { + //just a guess. + if (Rand.NextDouble() < .4f) + { + GeneratePrimaryResource(ScriptFormula(11)); + } + } + + //drain __ primary resource for every 1% of your maximum Life absorbed. + } + } + + public override void Remove() + { + base.Remove(); + } + } + [ImplementsPowerBuff(2)] + class EnergyReflectBuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(2f); + } + } + [ImplementsPowerBuff(3)] + class EnergyResourceBuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(2f); + } + } + [ImplementsPowerBuff(4)] + class EnergyAbsorbBuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(2f); + } + } + [ImplementsPowerBuff(5)] + class EnergyDamageBuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(2f); + } + } + } + #endregion + + //TODO: Rune_E, Rune_A: check if done correctly + #region MagicWeapon + [ImplementsPowerSNO(Skills.Skills.Wizard.Utility.MagicWeapon)] + public class MagicWeapon : Skill + { + public override IEnumerable Main() + { + StartCooldown(EvalTag(PowerKeys.CooldownTime)); + UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); + + AddBuff(User, new MagicWeaponBuff()); + yield break; + } + + [ImplementsPowerBuff(0)] + class MagicWeaponBuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(60f); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + User.PlayEffectGroup(RuneSelect(218923, 219289, 219306, 219390, 219396, 219338)); + User.Attributes[GameAttribute.Damage_Weapon_Percent_Bonus] += ScriptFormula(14); + return true; + } + + public override void Remove() + { + base.Remove(); + User.Attributes[GameAttribute.Damage_Weapon_Percent_Bonus] -= ScriptFormula(14); + } + + public override void OnPayload(Payload payload) + { + if (User != null && payload.Target != null + && payload.Context.Target != null + && payload.Context.User != null) + { + if (payload is AttackPayload && !payload.Context.Target.Equals(User) + && payload.Context.User.Equals(User) && (payload.Context.PowerSNO.CompareTo(0x00007780) == 0)) + //TODO: add detection for ranged attacks here, if Magic Weapon affects wands. + { + AttackPayload lastAttack = (AttackPayload)payload; + if (Rune_A > 0) + { + //TODO: does this target the mob you attacked? + AddBuff(Target, new PoisonTarget()); + } + if (Rune_B > 0) //Note: this implementation presumes that all lightning arcs will start at the soruce target, and then go only to their respective targets. + //If it turns out that it's instead a chain-lightning-like mechanic, just redesign so that after each iteration, ropeSource becomes curTarget. + { + //TODO: find correct chance, formulas didn't specify. + if (/*Rand.NextDouble() < 1*/true) + { + //TODO: find correct radius for "nearby". + TargetList targets = GetEnemiesInRadius(lastAttack.Context.Target.Position, 10f); + Actor ropeSource = lastAttack.Context.Target; + Actor curTarget; + float damage = ScriptFormula(7); + int affectedTargets = 0; + while (affectedTargets < ScriptFormula(6)) + { + if (ropeSource.World == null) + ropeSource = SpawnProxy(ropeSource.Position); + + curTarget = targets.GetClosestTo(ropeSource.Position); + if (curTarget != null) + { + targets.Actors.Remove(curTarget); + + if (curTarget.World != null) + { + ropeSource.AddRopeEffect(186883, curTarget); + WeaponDamage(curTarget, damage, DamageType.Lightning); + } + affectedTargets++; + } + else + { + break; + } + } + } + } + if (Rune_C > 0) + { + if (/*Rand.NextDouble() < ScriptFormula(9)*/true) + { + AddBuff(lastAttack.Context.Target, new KnockbackBuff(ScriptFormula(10))); + } + } + if (Rune_D > 0) + { + //TODO: find correct chance, formulas didn't specify. + if (/*Rand.NextDouble() < 1*/true) + { + GeneratePrimaryResource(ScriptFormula(11)); + } + } + if (Rune_E > 0) + { + foreach (AttackPayload.DamageEntry dmg in lastAttack.DamageEntries) + { + //TODO: figure this out :) + //lastAttack.Context.User.Attributes[GameAttribute.Hitpoints_Cur] += Math.Min(getDamageDone(), lastAttack.Context.User.Attributes[GameAttribute.Hitpoints_Max]); + } + } + } + } + } + } + [ImplementsPowerBuff(0)] + class PoisonTarget : PowerBuff + { + const float _damageRate = 1f; + TickTimer _damageTimer = null; + + + public override void Init() + { + Timeout = WaitSeconds(ScriptFormula(3)); + } + + public override bool Update() + { + if (base.Update()) + { + return true; + } + if (base.Update()) + return true; + + if (_damageTimer == null || _damageTimer.TimedOut) + { + _damageTimer = WaitSeconds(_damageRate); + + AttackPayload attack = new AttackPayload(this); + attack.SetSingleTarget(Target); + attack.AddWeaponDamage(ScriptFormula(4), DamageType.Poison); + attack.Apply(); + } + return false; + } + + public override void Remove() + { + base.Remove(); + + } + } + } + #endregion + + //Incomplete. + #region Archon + [ImplementsPowerSNO(Skills.Skills.Wizard.Utility.Archon)] + public class Archon : Skill + { + /* Build up Buff Duration (SF(0)) + * Bonus duration Per Kill (SF(8)) + * + * + * + */ + + public override IEnumerable Main() + { + //StartDefaultCooldown(); + //UsePrimaryResource(ScriptFormula(12)); + AddBuff(User, new ArchonBuff()); + yield break; + } + [ImplementsPowerBuff(2)] + class ArchonBuff : PowerBuff + { + public override void Init() + { + Timeout = WaitSeconds(15f); + } + + public override bool Apply() + { + if (!base.Apply()) + return false; + //SF(3) armor buff + //SF(4) resistance buff + + return true; + } + + public override void OnPayload(Payload payload) + { + //TODO: If it's a deathpayload, and the archon is the user, add time to the timeout. + //Timeout = WaitTicks(Timeout.TimeoutTick + (int)(1000f / Timeout.Game.UpdateFrequency * Timeout.Game.TickRate * 1f); + //Consider adding a helper function to timers to add / subtract from their ticks/seconds. + } + + public override void Remove() + { + base.Remove(); + } + } + } + #endregion + + //Lots of Work. + #region MirrorImage + [ImplementsPowerSNO(Skills.Skills.Wizard.Utility.MirrorImage)] + public class MirrorImage : Skill + { + //Once cast, you slide randomly into one of the ___ number of spots that other images fill around a circle. + //from there, all AI mirror images run randomly, targeting and casting spells.. + //there is no following for these I believe. + public override IEnumerable Main() + { + //StartCooldown(EvalTag(PowerKeys.CooldownTime)); + //UsePrimaryResource(ScriptFormula(12)); + int maxImages = (int)ScriptFormula(1); + List Images = new List(); + for (int i = 0; i < maxImages; i++) + { + var Image = new MirrorImageMinion(this.World, this, i); + Image.Brain.DeActivate(); + Image.Position = RandomDirection(User.Position, 3f, 8f); //Kind of hacky until we get proper collisiondetection + Image.Attributes[GameAttribute.Untargetable] = true; + Image.EnterWorld(Image.Position); + Images.Add(Image); + yield return WaitSeconds(0.2f); + } + yield return WaitSeconds(0.8f); + foreach (Actor Image in Images) + { + (Image as Minion).Brain.Activate(); + Image.Attributes[GameAttribute.Untargetable] = false; + Image.Attributes.BroadcastChangedIfRevealed(); + } + yield break; + } + } + #endregion + + //As much as the scriptformula says its a pet... it seems more of a buff besides firing. + //unknown how to go about this. + #region Familiar + [ImplementsPowerSNO(Skills.Skills.Wizard.Utility.Familiar)] + public class Familiar : Skill + { + public override IEnumerable Main() + { + User.PlayEffectGroup(167334); + yield break; + } + } + #endregion +} diff --git a/src/Mooege/Core/GS/Powers/Implementations/MonsterSkills/SingleProjectileSkills.cs b/src/Mooege/Core/GS/Powers/Implementations/MonsterSkills/SingleProjectileSkills.cs new file mode 100644 index 00000000..a1cf8b3c --- /dev/null +++ b/src/Mooege/Core/GS/Powers/Implementations/MonsterSkills/SingleProjectileSkills.cs @@ -0,0 +1,189 @@ +/* +* Copyright (C) 2011 mooege project +* +* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Core.GS.Ticker; +using Mooege.Core.GS.Actors; + +namespace Mooege.Core.GS.Powers.Implementations +{ + public abstract class SingleProjectileSkill : ActionTimedSkill + { + protected Projectile projectile; + protected float speed; + + protected void SetProjectile(PowerContext context, int actorSNO, Common.Types.Math.Vector3D position, float speed = 1f, Action OnCollision = null) + { + projectile = new Projectile(context, actorSNO, position); + projectile.OnCollision = OnCollision; + this.speed = speed; + } + + protected IEnumerable Launch() + { + projectile.Launch(Target.Position, speed); + yield break; + } + } + + [ImplementsPowerSNO(30334)] // Monster_Ranged_Projectile.pow + public class MonsterRangedProjectile : SingleProjectileSkill + { + public override IEnumerable Main() + { + SetProjectile(this, 3901, User.Position, 1f, (hit) => + { + WeaponDamage(hit, 1.00f, DamageType.Physical); + projectile.Destroy(); + }); + return Launch(); + } + } + + [ImplementsPowerSNO(30474)] // Shield_Skeleton_Melee_Instant.pow + public class ShieldSkeletonMeleeInstant : SingleProjectileSkill + { + public override IEnumerable Main() + { + WeaponDamage(GetBestMeleeEnemy(), 1.50f, DamageType.Physical); + yield break; + } + } + + [ImplementsPowerSNO(30258)] // graveRobber_Projectile.pow + public class graveRobberProjectile : SingleProjectileSkill + { + public override IEnumerable Main() + { + SetProjectile(this, 4365, User.Position, 1f, (hit) => + { + WeaponDamage(hit, 1.00f, DamageType.Physical); + projectile.Destroy(); + }); + return Launch(); + } + } + + [ImplementsPowerSNO(30503)] // SkeletonSummoner_Projectile.pow + public class SkeletonSummonerProjectile : SingleProjectileSkill + { + public override IEnumerable Main() + { + SetProjectile(this, 5392, User.Position, 0.9f, (hit) => + { + hit.PlayEffectGroup(19052); + WeaponDamage(hit, 2.00f, DamageType.Arcane); + projectile.Destroy(); + }); + projectile.Position.Z += 5f; //adjust height + return Launch(); + } + } + + [ImplementsPowerSNO(99077)] // Goatman_Shaman_Iceball.pow + public class ShamanIceBallProjectile : SingleProjectileSkill + { + public override IEnumerable Main() + { + SetProjectile(this, 80143, User.Position, 0.5f, (hit) => + { + hit.PlayEffectGroup(99355); + WeaponDamage(hit, 2.00f, DamageType.Cold); + projectile.Destroy(); + }); + projectile.Position.Z += 5f; //adjust height + return Launch(); + } + } + + [ImplementsPowerSNO(129661)] // DemonHunter_Sentry_TurretAttack.pow + public class TurretAttackProjectile : SingleProjectileSkill + { + public override IEnumerable Main() + { + SetProjectile(this, 141734, User.Position, 0.5f, (hit) => + { + //hit.PlayEffectGroup(150040); + WeaponDamage(hit, ScriptFormula(1), DamageType.Physical); + projectile.Destroy(); + }); + projectile.Position.Z += 5f; //adjust height + return Launch(); + } + } + + [ImplementsPowerSNO(152540)] // Unique_Monster_Generic_Projectile.pow + public class UniqueMonsterGenericProjectile : SingleProjectileSkill + { + //I believe this is correct, because uniques come in different elements + //it needs different projectiles and effects. just unsure how to use them different /wet + //Arcane 159150 / 159158 + //Poison 159160 / 159139 + //phys 159161 / 159109 + //holy 158977 / 159075 + //fire 158577 / 159100 + //lightning 158976 / 159092 + //cold 158575 / 159143 + public override IEnumerable Main() + { + SetProjectile(this, 159150, User.Position, 0.5f, (hit) => + { + hit.PlayEffectGroup(159158); + WeaponDamage(hit, 2.00f, DamageType.Arcane); + projectile.Destroy(); + }); + projectile.Position.Z += 5f; //adjust height + return Launch(); + } + } + + [ImplementsPowerSNO(107729)] // QuillDemon_Projectile.pow + public class QuillDemonProjectile : SingleProjectileSkill + { + public override IEnumerable Main() + { + SetProjectile(this, 4981, User.Position, 1f, (hit) => + { + // Looking at the tagmaps for 107729, the damage should probably be more accurately calculated, but this will have to do for now. + WeaponDamage(hit, 1.00f, DamageType.Physical); + projectile.Destroy(); + }); + projectile.Position.Z += 2f + (float)Rand.NextDouble() * 4; + return Launch(); + } + } + + [ImplementsPowerSNO(110518)] // ZombieFemale_Projectile.pow + public class WretchedMother_Projectile : SingleProjectileSkill + { + public override IEnumerable Main() + { + SetProjectile(this, 120957, User.Position, 1.00f, (hit) => + { + hit.PlayEffectGroup(142812); + WeaponDamage(hit, 1.00f, DamageType.Poison); + projectile.Destroy(); + }); + projectile.Position.Z += 5f; // fix height + return Launch(); + } + } +} diff --git a/src/Mooege/Core/GS/Powers/Implementations/MonsterSkills/SummoningSkills.cs b/src/Mooege/Core/GS/Powers/Implementations/MonsterSkills/SummoningSkills.cs new file mode 100644 index 00000000..e8baa640 --- /dev/null +++ b/src/Mooege/Core/GS/Powers/Implementations/MonsterSkills/SummoningSkills.cs @@ -0,0 +1,107 @@ +/* +* Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org +* +* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Common.Helpers.Math; +using Mooege.Core.GS.Actors.Movement; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Ticker; +using Mooege.Net.GS.Message; +using Mooege.Core.GS.Actors; +using Mooege.Core.GS.Common.Types.TagMap; + +namespace Mooege.Core.GS.Powers.Implementations +{ + public abstract class SummoningSkill : ActionTimedSkill + { + public Vector3D SpawnPosition { get; set; } + + protected void RandomPostion() // spawn actor at random postion + { + this.SpawnPosition = RandomDirection(User.Position, 0, 1); + } + + protected void UserPostion() // spawn actor at user postion + { + this.SpawnPosition = User.Position; + } + + protected void InFrontPostion() // spawn actor in front of user + { + float userFacing = (float)Math.Acos(this.User.RotationW) * 2f; + this.SpawnPosition = new Vector3D(User.Position.X + 8 * (float)Math.Cos(userFacing), + User.Position.Y + 8 * (float)Math.Sin(userFacing), + User.Position.Z); + } + + public void SummonMonster(int actorSNO) + { + var monster = ActorFactory.Create(User.World, actorSNO, new TagMap()); + monster.Scale = 1.35f; // TODO: look this up properly + monster.EnterWorld(this.SpawnPosition); + this.World.BuffManager.AddBuff(User, monster, new Implementations.SummonedBuff()); + } + } + + [ImplementsPowerSNO(94734)] // Summon_Zombie_Vomit.pow + public class WretchedMotherVomit : SummoningSkill + { + public override IEnumerable Main() + { + InFrontPostion(); + SummonMonster((this.User as Monster).SNOSummons[0]); + yield break; + } + } + + [ImplementsPowerSNO(30543)] // Summon Skeleton + public class SummonSkeleton : SummoningSkill + { + public override IEnumerable Main() + { + RandomPostion(); + SummonMonster((this.User as Monster).SNOSummons[0]); + yield break; + } + } + + [ImplementsPowerSNO(30800)] // Summon Spores + public class SummonSpores : SummoningSkill + { + public override IEnumerable Main() + { + RandomPostion(); + SummonMonster(5482); // HACK: we don't have this in mpq + yield break; + } + } + [ImplementsPowerSNO(117580)] // Summon FleshPitFlyers + public class SummonFleshPitFlyers : SummoningSkill + { + public override IEnumerable Main() + { + UserPostion(); + SummonMonster((this.User as Monster).SNOSummons[0]); + yield break; + } + } + // +} diff --git a/src/Mooege/Core/GS/Powers/ImplementsPowerBuff.cs b/src/Mooege/Core/GS/Powers/ImplementsPowerBuff.cs new file mode 100644 index 00000000..aa52ac08 --- /dev/null +++ b/src/Mooege/Core/GS/Powers/ImplementsPowerBuff.cs @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Mooege.Core.GS.Powers +{ + [AttributeUsage(AttributeTargets.Class)] + public class ImplementsPowerBuff : Attribute + { + public int BuffSlot; + public bool CountStacks; + + public ImplementsPowerBuff(int buffSlot, bool countStacks = false) + { + BuffSlot = buffSlot; + CountStacks = countStacks; + } + } +} diff --git a/src/Mooege/Core/GS/Powers/ImplementsPowerSNO.cs b/src/Mooege/Core/GS/Powers/ImplementsPowerSNO.cs new file mode 100644 index 00000000..bea3fa8b --- /dev/null +++ b/src/Mooege/Core/GS/Powers/ImplementsPowerSNO.cs @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Mooege.Core.GS.Powers +{ + [AttributeUsage(AttributeTargets.Class)] + public class ImplementsPowerSNO : Attribute + { + public int PowerSNO; + + public ImplementsPowerSNO(int powerSNO) + { + PowerSNO = powerSNO; + } + + public static int GetPowerSNOForClass(Type klass) + { + var attributes = (ImplementsPowerSNO[])klass.GetCustomAttributes(typeof(ImplementsPowerSNO), true); + int powerSNO = -1; + foreach (var snoAttribute in attributes) + { + powerSNO = snoAttribute.PowerSNO; + } + + return powerSNO; + } + } +} diff --git a/src/Mooege/Core/GS/Powers/Payloads/AttackPayload.cs b/src/Mooege/Core/GS/Powers/Payloads/AttackPayload.cs new file mode 100644 index 00000000..ae23b612 --- /dev/null +++ b/src/Mooege/Core/GS/Powers/Payloads/AttackPayload.cs @@ -0,0 +1,145 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Net.GS.Message; +using Mooege.Core.GS.Actors; +using Mooege.Core.GS.Players; + +namespace Mooege.Core.GS.Powers.Payloads +{ + public class AttackPayload : Payload + { + // list of targets to try and hit with this payload, must be set before calling Apply() + public TargetList Targets; + + // list of each amount and type of damage the attack will contain + public class DamageEntry + { + public DamageType DamageType; + + public float MinDamage; + public float DamageDelta; + + public bool IsWeaponBasedDamage; + public float WeaponDamageMultiplier; + } + public List DamageEntries = new List(); + + public Action OnHit = null; + public Action OnDeath = null; + + // some power's use custom hit effects, but they're not specified correctly in the tagmaps it seems + // so this can be set to false to force off all hit effect generation from the payload + public bool AutomaticHitEffects = true; + + private List> _hitBuffs = new List>(); + + public AttackPayload(PowerContext context) + : base(context, context.User) + { + } + + public void AddDamage(float minDamage, float damageDelta, DamageType damageType) + { + DamageEntries.Add(new DamageEntry + { + DamageType = damageType, + MinDamage = minDamage, + DamageDelta = damageDelta, + IsWeaponBasedDamage = false, + }); + } + + public void AddWeaponDamage(float damageMultiplier, DamageType damageType) + { + DamageEntries.Add(new DamageEntry + { + DamageType = damageType, + IsWeaponBasedDamage = true, + WeaponDamageMultiplier = damageMultiplier, + }); + } + + public void SetSingleTarget(Actor target) + { + this.Targets = new TargetList(); + this.Targets.Actors.Add(target); + } + + public void AddBuffOnHit() where T : Buff, new() + { + _hitBuffs.Add(() => new T()); + } + + public void Apply() + { + if (this.Targets == null) + this.Targets = new TargetList(); + + if (this.Target.World != null) + this.Target.World.BuffManager.SendTargetPayload(this.Target, this); + + // if attack does damage and payload target is a player, run through and activate all the desctructibles + if (this.Target is Player && this.DamageEntries.Count > 0) + { + Player player = (Player)this.Target; + foreach (Actor extra in this.Targets.ExtraActors) + { + if (extra is Mooege.Core.GS.Actors.Implementations.DesctructibleLootContainer) + extra.OnTargeted(player, null); + } + } + + // main targets + foreach (Actor target in this.Targets.Actors) + { + // filter null and killed targets + if (target == null || target.World != null && target.World.PowerManager.IsDeletingActor(target)) + continue; + + // TODO: calculate hit chance for monsters instead of always hitting + + var payload = new HitPayload(this, _DoCriticalHit(this.Context.User, target), target); + payload.AutomaticHitEffects = this.AutomaticHitEffects; + payload.OnDeath = OnDeath; + + foreach (Func buffFactory in _hitBuffs) + this.Context.AddBuff(target, buffFactory()); + + if (OnHit != null) + OnHit(payload); + + payload.Apply(); + } + } + + private static bool _DoCriticalHit(Actor user, Actor target) + { + if (target.Attributes[GameAttribute.Ignores_Critical_Hits]) + return false; + + // TODO: probably will calculate this based on GameAttribute.Crit_Percent_Base + GameAttribute.Crit_Percent_Bonus_Capped + // right now those attributes aren't set though, so just do calc a generic 5% chance for now + return PowerContext.Rand.NextDouble() < 0.05; + } + } +} diff --git a/src/Mooege/Core/GS/Powers/Payloads/DeathPayload.cs b/src/Mooege/Core/GS/Powers/Payloads/DeathPayload.cs new file mode 100644 index 00000000..02328309 --- /dev/null +++ b/src/Mooege/Core/GS/Powers/Payloads/DeathPayload.cs @@ -0,0 +1,198 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Common.Logging; +using Mooege.Core.GS.Actors; +using Mooege.Net.GS.Message; +using Mooege.Net.GS.Message.Definitions.Misc; +using Mooege.Net.GS.Message.Definitions.Animation; +using Mooege.Net.GS.Message.Fields; +using Mooege.Core.GS.Players; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Net.GS.Message.Definitions.ACD; +using Mooege.Net.GS.Message.Definitions.Player; +using Mooege.Net.GS.Message.Definitions.Trade; + +namespace Mooege.Core.GS.Powers.Payloads +{ + public class DeathPayload : Payload + { + public DamageType DeathDamageType; + public bool LootAndExp; //HACK: As we currently just give out random exp and loot, this is in to prevent giving this out for mobs that shouldn't give it. + + public DeathPayload(PowerContext context, DamageType deathDamageType, Actor target, bool grantsLootAndExp = true) + : base(context, target) + { + this.LootAndExp = grantsLootAndExp; + this.DeathDamageType = deathDamageType; + } + + public void Apply() + { + if (this.Target.World == null) return; + + if (this.Target is Player) + { + _DoSimplePlayerDeath(); + return; + } + + // HACK: add to hackish list thats used to defer deleting actor and filter it from powers targetting + this.Target.World.PowerManager.AddDeletingActor(this.Target); + + // kill brain if living + if (this.Target is Living) + { + Living actor = (Living)this.Target; + if (actor.Brain != null) + actor.Brain.Kill(); + } + + // kill brain if monster + if (this.Target is Monster) + { + Monster mon = (Monster)this.Target; + if (mon.Brain != null) + mon.Brain.Kill(); + } + + // send this death payload to buffs + this.Target.World.BuffManager.SendTargetPayload(this.Target, this); + + // wtf is this? + this.Target.World.BroadcastIfRevealed(new Mooege.Net.GS.Message.Definitions.Effect.PlayEffectMessage() + { + ActorId = this.Target.DynamicID, + Effect = Mooege.Net.GS.Message.Definitions.Effect.Effect.Unknown12, + }, this.Target); + + this.Target.World.BroadcastIfRevealed(new ANNDataMessage(Opcodes.ANNDataMessage13) + { + ActorID = this.Target.DynamicID + }, this.Target); + + // play main death animation + this.Target.PlayAnimation(11, _FindBestDeathAnimationSNO(), 1f, 2); + + this.Target.World.BroadcastIfRevealed(new ANNDataMessage(Opcodes.ANNDataMessage24) + { + ActorID = this.Target.DynamicID, + }, this.Target); + + // remove all buffs and running powers before deleting actor + this.Target.World.BuffManager.RemoveAllBuffs(this.Target); + this.Target.World.PowerManager.CancelAllPowers(this.Target); + + this.Target.Attributes[GameAttribute.Deleted_On_Server] = true; + this.Target.Attributes[GameAttribute.Could_Have_Ragdolled] = true; + this.Target.Attributes.BroadcastChangedIfRevealed(); + + // Spawn Random item and give exp for each player in range + List players = this.Target.GetPlayersInRange(26f); + foreach (Player plr in players) + { + plr.UpdateExp(this.Target.Attributes[GameAttribute.Experience_Granted]); + this.Target.World.SpawnRandomItemDrop(this.Target, plr); + } + + if (LootAndExp) + { + if (this.Context.User is Player) + { + Player player = (Player)this.Context.User; + + player.ExpBonusData.Update(player.GBHandle.Type, this.Target.GBHandle.Type); + this.Target.World.SpawnGold(this.Target, player); + if (Mooege.Common.Helpers.Math.RandomHelper.Next(1, 100) < 20) + this.Target.World.SpawnHealthGlobe(this.Target, player, this.Target.Position); + } + } + + if (this.Target is Monster) + (this.Target as Monster).PlayLore(); + + // HACK: instead of deleting actor right here, its added to a list (near the top of this function) + //this.Target.Destroy(); + } + + private void _DoSimplePlayerDeath() + { + // HACK: simple death implementation + this.Target.World.BuffManager.RemoveAllBuffs(this.Target); + this.Target.World.PowerManager.CancelAllPowers(this.Target); + + this.Target.World.BuffManager.AddBuff(this.Target, this.Target, new Implementations.ActorGhostedBuff()); + + Player player = (Player)this.Target; + player.Teleport(player.CheckPointPosition); + player.AddPercentageHP(100); + } + + private int _FindBestDeathAnimationSNO() + { + // check if power has special death animation, and roll chance to use it + TagKeyInt specialDeathTag = _GetTagForSpecialDeath(this.Context.EvalTag(PowerKeys.SpecialDeathType)); + if (specialDeathTag != null) + { + float specialDeathChance = this.Context.EvalTag(PowerKeys.SpecialDeathChance); + if (PowerContext.Rand.NextDouble() < specialDeathChance) + { + int specialSNO = _GetSNOFromTag(specialDeathTag); + if (specialSNO != -1) + return specialSNO; + } + // decided not to use special death or actor doesn't have it, just fall back to normal death anis + } + + int sno = _GetSNOFromTag(this.DeathDamageType.DeathAnimationTag); + if (sno != -1) + return sno; + + // load default ani if all else fails + return _GetSNOFromTag(AnimationSetKeys.DeathDefault); + } + + private int _GetSNOFromTag(TagKeyInt tag) + { + if (this.Target.AnimationSet != null && this.Target.AnimationSet.TagMapAnimDefault.ContainsKey(tag)) + return this.Target.AnimationSet.TagMapAnimDefault[tag]; + else + return -1; + } + + private static TagKeyInt _GetTagForSpecialDeath(int specialDeathType) + { + switch (specialDeathType) + { + default: return null; + case 1: return AnimationSetKeys.DeathDisintegration; + case 2: return AnimationSetKeys.DeathPulverise; + case 3: return AnimationSetKeys.DeathPlague; + case 4: return AnimationSetKeys.DeathDismember; + case 5: return AnimationSetKeys.DeathDecap; + case 6: return AnimationSetKeys.DeathAcid; + case 7: return AnimationSetKeys.DeathLava; // haven't seen lava used, but there's no other place for it + case 8: return AnimationSetKeys.DeathSpirit; + } + } + } +} diff --git a/src/Mooege/Core/GS/Powers/Payloads/HitPayload.cs b/src/Mooege/Core/GS/Powers/Payloads/HitPayload.cs new file mode 100644 index 00000000..eca819c4 --- /dev/null +++ b/src/Mooege/Core/GS/Powers/Payloads/HitPayload.cs @@ -0,0 +1,186 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Core.GS.Actors; +using Mooege.Net.GS.Message; +using Mooege.Core.GS.Players; +using Mooege.Net.GS.Message.Definitions.Misc; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Net.GS.Message.Definitions.Animation; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Core.GS.Powers.Payloads +{ + public class HitPayload : Payload + { + public float TotalDamage; + public DamageType DominantDamageType; + public Dictionary ElementDamages; + public bool IsCriticalHit; + + public bool AutomaticHitEffects = true; + public Action OnDeath = null; + + public HitPayload(AttackPayload attackPayload, bool criticalHit, Actor target) + : base(attackPayload.Context, target) + { + this.IsCriticalHit = criticalHit; + + // TODO: select these values based on element type? + float weaponMinDamage = this.Context.User.Attributes[GameAttribute.Damage_Weapon_Min_Total, 0]; + float weaponDamageDelta = this.Context.User.Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0]; + + // calculate and add up damage amount for each element type + this.ElementDamages = new Dictionary(); + + foreach (var entry in attackPayload.DamageEntries) + { + if (!this.ElementDamages.ContainsKey(entry.DamageType)) + this.ElementDamages[entry.DamageType] = 0f; + + if (entry.IsWeaponBasedDamage) + this.ElementDamages[entry.DamageType] += entry.WeaponDamageMultiplier * + (weaponMinDamage + (float)PowerContext.Rand.NextDouble() * weaponDamageDelta); + else + this.ElementDamages[entry.DamageType] += entry.MinDamage + (float)PowerContext.Rand.NextDouble() * entry.DamageDelta; + + this.ElementDamages[entry.DamageType] *= 1.0f + this.Target.Attributes[GameAttribute.Amplify_Damage_Percent]; + } + + // apply critical damage boost + if (criticalHit) + { + // TODO: probably will calculate this off of GameAttribute.Crit_Damage_Percent, but right now that attribute is never set + var damTypes = this.ElementDamages.Keys.ToArray(); + foreach (var type in damTypes) + this.ElementDamages[type] *= 1.5f + this.Target.Attributes[GameAttribute.Crit_Percent_Bonus_Capped]; + } + + + + // TODO: reduce element damage amounts according to target's resistances + + // TODO: reduce total damage by target's armor + // ~weltmeyer Using WOW Calculation till we find the correct formula :) + + + this.TotalDamage = this.ElementDamages.Sum(kv => kv.Value) ; + var targetArmor = target.Attributes[GameAttribute.Armor_Total]; + var attackerLevel = attackPayload.Context.User.Attributes[GameAttribute.Level]; + var reduction = TotalDamage * (0.1f * targetArmor) / + ((8.5f * attackerLevel) + 40); + + reduction /= 1+reduction; + reduction = Math.Min(0.75f, reduction); + this.TotalDamage = TotalDamage*(1 - reduction); + + this.DominantDamageType = this.ElementDamages.OrderByDescending(kv => kv.Value).FirstOrDefault().Key; + if (this.DominantDamageType == null) + this.DominantDamageType = DamageType.Physical; // default to physical if no other damage type calced + } + + public void Apply() + { + if (this.Target.World != null) + this.Target.World.BuffManager.SendTargetPayload(this.Target, this); + + // floating damage number + if (this.Target.World != null) + { + this.Target.World.BroadcastIfRevealed(new FloatingNumberMessage + { + ActorID = this.Target.DynamicID, + Number = this.TotalDamage, + // make player damage red, all other damage white + Type = this.IsCriticalHit ? + (this.Target is Player) ? FloatingNumberMessage.FloatType.RedCritical : FloatingNumberMessage.FloatType.Golden + : + (this.Target is Player) ? FloatingNumberMessage.FloatType.Red : FloatingNumberMessage.FloatType.White + }, this.Target); + } + + if (this.AutomaticHitEffects) + { + // play override hit effect it power context has one + if (this.Context.EvalTag(PowerKeys.OverrideHitEffects) > 0) + { + int efg = this.Context.EvalTag(PowerKeys.HitEffect); + if (efg != -1) + this.Target.PlayEffectGroup(efg); + } + else + { + this.Target.PlayHitEffect((int)this.DominantDamageType.HitEffect, this.Context.User); + } + + if (this.TotalDamage > 0f) + { + // play override hitsound if any, otherwise just default to playing metal weapon hit for now + int overridenSound = this.Context.EvalTag(PowerKeys.HitsoundOverride); + int hitsound = overridenSound != -1 ? overridenSound : 1; + if (hitsound > 0) + this.Target.PlayEffect(Net.GS.Message.Definitions.Effect.Effect.Hit, hitsound); + } + } + + // TODO: critical hit special element buff/effects + + // update hp + float new_hp = Math.Max(this.Target.Attributes[GameAttribute.Hitpoints_Cur] - this.TotalDamage, 0f); + this.Target.Attributes[GameAttribute.Hitpoints_Cur] = new_hp; + this.Target.Attributes.BroadcastChangedIfRevealed(); + + // if hp=0 do death + if (new_hp == 0f) + { + var deathload = new DeathPayload(this.Context, this.DominantDamageType, this.Target); + if (OnDeath != null) + OnDeath(deathload); + + deathload.Apply(); + } + else if (this.AutomaticHitEffects && this.Target.World != null) + { + // HACK: reduce hit effect rate for Player to 10% so they don't get perma hit-sun locked. + if (this.Target is Player && PowerContext.Rand.NextDouble() < 0.9) + return; + + // target didn't die, so play hit animation if the actor has one + if (this.Target.World.BuffManager.GetFirstBuff(this.Target) == null && + this.Target.AnimationSet != null) + { + if (this.Target.AnimationSet.TagMapAnimDefault.ContainsKey(AnimationSetKeys.GetHit)) + { + int hitAni = this.Target.AnimationSet.TagMapAnimDefault[AnimationSetKeys.GetHit]; + if (hitAni != -1) + { + // HACK: hardcoded animation speed/ticks, need to base those off hit recovery speed + this.Target.PlayAnimation(6, hitAni, 1.0f, 40); + } + } + } + } + + // TODO: if target survives and it's a AI monster, give it aggro + } + } +} diff --git a/src/Mooege/Core/GS/Powers/Payloads/Payload.cs b/src/Mooege/Core/GS/Powers/Payloads/Payload.cs new file mode 100644 index 00000000..393e7a4f --- /dev/null +++ b/src/Mooege/Core/GS/Powers/Payloads/Payload.cs @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Core.GS.Actors; + +namespace Mooege.Core.GS.Powers.Payloads +{ + public abstract class Payload + { + public PowerContext Context; + public Actor Target; + + public Payload(PowerContext context, Actor target) + { + this.Context = context; + this.Target = target; + } + } +} diff --git a/src/Mooege/Core/GS/Powers/PowerContext.cs b/src/Mooege/Core/GS/Powers/PowerContext.cs new file mode 100644 index 00000000..c964da06 --- /dev/null +++ b/src/Mooege/Core/GS/Powers/PowerContext.cs @@ -0,0 +1,425 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Threading; +using Mooege.Core.GS.Actors; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Players; +using Mooege.Net.GS.Message; +using Mooege.Net.GS.Message.Definitions.Misc; +using Mooege.Core.GS.Common.Types.Misc; +using Mooege.Core.GS.Ticker; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Common.Logging; +using Mooege.Net.GS.Message.Definitions.Animation; +using Mooege.Net.GS.Message.Fields; +using Mooege.Core.GS.Powers.Payloads; +using Mooege.Net.GS.Message.Definitions.Actor; +using Mooege.Core.GS.Actors.Movement; +using Mooege.Net.GS.Message.Definitions.ACD; + +namespace Mooege.Core.GS.Powers +{ + public class PowerContext + { + public static readonly Logger Logger = LogManager.CreateLogger(); + + private static ThreadLocal _threadRand = new ThreadLocal(() => new Random()); + public static Random Rand { get { return _threadRand.Value; } } + + public int PowerSNO; + public World World; + public Actor User; + public Actor Target; + + // helper variables + private TickTimer _defaultEffectTimeout; + + public void SetDefaultEffectTimeout(TickTimer timeout) + { + _defaultEffectTimeout = timeout; + } + + public TickTimer WaitSeconds(float seconds) + { + return new SecondsTickTimer(World.Game, seconds); + } + + public TickTimer WaitTicks(int ticks) + { + return new RelativeTickTimer(World.Game, ticks); + } + + public TickTimer WaitInfinite() + { + return new TickTimer(World.Game, int.MaxValue); + } + + public void StartCooldown(TickTimer timeout) + { + AddBuff(User, new Implementations.CooldownBuff(PowerSNO, timeout)); + } + + public void StartCooldown(float seconds) + { + StartCooldown(WaitSeconds(seconds)); + } + + public void StartDefaultCooldown() + { + float seconds = EvalTag(PowerKeys.CooldownTime); + if (seconds > 0f) + StartCooldown(seconds); + } + + public void GeneratePrimaryResource(float amount) + { + if (User is Player) + { + (User as Player).GeneratePrimaryResource(amount); + } + } + + public void UsePrimaryResource(float amount) + { + if (User is Player) + { + (User as Player).UsePrimaryResource(amount); + } + } + + public void GenerateSecondaryResource(float amount) + { + if (User is Player) + { + (User as Player).GenerateSecondaryResource(amount); + } + } + + public void UseSecondaryResource(float amount) + { + if (User is Player) + { + (User as Player).UseSecondaryResource(amount); + } + } + + public void WeaponDamage(Actor target, float damageMultiplier, DamageType damageType) + { + AttackPayload payload = new AttackPayload(this); + payload.SetSingleTarget(target); + payload.AddWeaponDamage(damageMultiplier, damageType); + payload.Apply(); + } + + public void WeaponDamage(TargetList targets, float damageMultiplier, DamageType damageType) + { + AttackPayload payload = new AttackPayload(this); + payload.Targets = targets; + payload.AddWeaponDamage(damageMultiplier, damageType); + payload.Apply(); + } + + public void Damage(Actor target, float minDamage, float damageDelta, DamageType damageType) + { + AttackPayload payload = new AttackPayload(this); + payload.SetSingleTarget(target); + payload.AddDamage(minDamage, damageDelta, damageType); + payload.Apply(); + } + + public void Damage(TargetList targets, float minDamage, float damageDelta, DamageType damageType) + { + AttackPayload payload = new AttackPayload(this); + payload.Targets = targets; + payload.AddDamage(minDamage, damageDelta, damageType); + payload.Apply(); + } + + public EffectActor SpawnEffect(int actorSNO, Vector3D position, float angle = 0, TickTimer timeout = null) + { + if (angle == -1) + angle = (float)(Rand.NextDouble() * (Math.PI * 2)); + if (timeout == null) + { + if (_defaultEffectTimeout == null) + _defaultEffectTimeout = new SecondsTickTimer(World.Game, 2f); // default timeout of 2 seconds for now + + timeout = _defaultEffectTimeout; + } + + var actor = new EffectActor(this, actorSNO, position); + actor.Timeout = timeout; + actor.Spawn(angle); + return actor; + } + + public EffectActor SpawnEffect(int actorSNO, Vector3D position, Actor facingTarget, TickTimer timeout = null) + { + float angle = (facingTarget != null) ? MovementHelpers.GetFacingAngle(User.Position, facingTarget.Position) : -1f; + return SpawnEffect(actorSNO, position, angle, timeout); + } + + public EffectActor SpawnEffect(int actorSNO, Vector3D position, Vector3D facingTarget, TickTimer timeout = null) + { + float angle = MovementHelpers.GetFacingAngle(User.Position, facingTarget); + return SpawnEffect(actorSNO, position, angle, timeout); + } + + public EffectActor SpawnProxy(Vector3D position, TickTimer timeout = null) + { + return SpawnEffect(187359, position, 0, timeout); + } + + public TargetList GetEnemiesInRadius(Vector3D center, float radius, int maxCount = -1) + { + return _GetTargetsInRadiusHelper(center, radius, maxCount, (actor) => true, _EnemyActorFilter); + } + + public TargetList GetAlliesInRadius(Vector3D center, float radius, int maxCount = -1) + { + return _GetTargetsInRadiusHelper(center, radius, maxCount, (actor) => true, _AllyActorFilter); + } + + public TargetList GetEnemiesInBeamDirection(Vector3D startPoint, Vector3D direction, + float length, float thickness = 0f) + { + Vector3D beamEnd = PowerMath.TranslateDirection2D(startPoint, direction, startPoint, length); + + float fixedActorRadius = 1.5f; // TODO: calculate based on actor.ActorData.Cylinder.Ax2 ? + return _GetTargetsInRadiusHelper(startPoint, length + thickness, -1, + actor => PowerMath.CircleInBeam(new Circle(actor.Position.X, actor.Position.Y, fixedActorRadius), + startPoint, beamEnd, thickness), + _EnemyActorFilter); + } + + public TargetList GetEnemiesInArcDirection(Vector3D center, Vector3D direction, float radius, float lengthDegrees) + { + Vector2F arcCenter2D = PowerMath.VectorWithoutZ(center); + Vector2F arcDirection2D = PowerMath.VectorWithoutZ(direction); + float arcLength = lengthDegrees * PowerMath.DegreesToRadians; + + float fixedActorRadius = 1.5f; // TODO: calculate based on actor.ActorData.Cylinder.Ax2 ? + return _GetTargetsInRadiusHelper(center, radius, -1, + actor => PowerMath.ArcCircleCollides(arcCenter2D, arcDirection2D, radius, arcLength, + new Circle(actor.Position.X, actor.Position.Y, fixedActorRadius)), + _EnemyActorFilter); + } + + private TargetList _GetTargetsInRadiusHelper(Vector3D center, float radius, int maxCount, + Func filter, Func targetFilter) + { + // Query() needs to gather using circle-circle collision, until then just extend the search radius by the default + // actor radius currently used. + float actorRadiusCompensation = 1.5f; + + TargetList targets = new TargetList(); + int count = 0; + foreach (Actor actor in World.QuadTree.Query(new Circle(center.X, center.Y, radius + actorRadiusCompensation))) + { + if (filter(actor) && !actor.Attributes[GameAttribute.Untargetable] && !World.PowerManager.IsDeletingActor(actor) && + actor != User) + { + if (targetFilter(actor)) + { + if (count != maxCount) + { + targets.Actors.Add(actor); + count += 1; + } + } + else + { + targets.ExtraActors.Add(actor); + } + } + } + + return targets; + } + + private Func _EnemyActorFilter + { + get + { + if (User is Player || User is Minion) + return (actor) => actor is Monster; + else + return (actor) => actor is Player || actor is Minion; + } + } + + private Func _AllyActorFilter + { + get + { + if (User is Player || User is Minion) + return (actor) => actor is Player || actor is Minion; + else + return (actor) => actor is Monster; + } + } + + public void TranslateEffect(Actor actor, Vector3D destination, float speed) + { + actor.Position = destination; + + if (actor.World == null) return; + + actor.World.BroadcastIfRevealed(new ACDTranslateNormalMessage + { + ActorId = (int)actor.DynamicID, + Position = destination, + Angle = (float)Math.Acos(actor.RotationW) * 2f, // convert z-axis quat to radians + TurnImmediately = true, + Speed = speed, + }, actor); + } + + public TickTimer Knockback(Actor target, float magnitude, float arcHeight = 3.0f, float arcGravity = -0.03f) + { + var buff = new Implementations.KnockbackBuff(magnitude, arcHeight, arcGravity); + AddBuff(target, buff); + return buff.ArrivalTime; + } + + public TickTimer Knockback(Vector3D from, Actor target, float magnitude, float arcHeight = 3.0f, float arcGravity = -0.03f) + { + var buff = new Implementations.KnockbackBuff(magnitude, arcHeight, arcGravity); + AddBuff(SpawnProxy(from), target, buff); + return buff.ArrivalTime; + } + + public static bool ValidTarget(Actor target) + { + return target != null && target.World != null; + } + + public bool ValidTarget() + { + return ValidTarget(Target); + } + + public float ScriptFormula(int index) + { + float result; + if (!ScriptFormulaEvaluator.Evaluate(this.PowerSNO, PowerTagHelper.GenerateTagForScriptFormula(index), + User.Attributes, Rand, out result)) + return 0; + + return result; + } + + public int EvalTag(TagKeyInt key) + { + TagMap tagmap = _FindTagMapWithKey(key); + if (tagmap != null) + return tagmap[key]; + else + return -1; + } + + public int EvalTag(TagKeySNO key) + { + TagMap tagmap = _FindTagMapWithKey(key); + if (tagmap != null) + return tagmap[key].Id; + else + return -1; + } + + public float EvalTag(TagKeyFloat key) + { + TagMap tagmap = _FindTagMapWithKey(key); + if (tagmap != null) + return tagmap[key]; + else + return 0; + } + + public float EvalTag(TagKeyScript key) + { + float result; + if (!ScriptFormulaEvaluator.Evaluate(this.PowerSNO, key, + User.Attributes, Rand, out result)) + return 0; + + return result; + } + + private TagMap _FindTagMapWithKey(TagKey key) + { + TagMap tagmap = PowerTagHelper.FindTagMapWithKey(PowerSNO, key); + if (tagmap != null) + return tagmap; + else + { + //Logger.Error("could not find tag key {0} in power {1}", key.ID, PowerSNO); + return null; + } + } + + public int Rune_A { get { return User.Attributes[GameAttribute.Rune_A, PowerSNO]; } } + public int Rune_B { get { return User.Attributes[GameAttribute.Rune_B, PowerSNO]; } } + public int Rune_C { get { return User.Attributes[GameAttribute.Rune_C, PowerSNO]; } } + public int Rune_D { get { return User.Attributes[GameAttribute.Rune_D, PowerSNO]; } } + public int Rune_E { get { return User.Attributes[GameAttribute.Rune_E, PowerSNO]; } } + + public T RuneSelect(T none, T runeA, T runeB, T runeC, T runeD, T runeE) + { + if (Rune_A > 0) return runeA; + else if (Rune_B > 0) return runeB; + else if (Rune_C > 0) return runeC; + else if (Rune_D > 0) return runeD; + else if (Rune_E > 0) return runeE; + else return none; + } + + public bool AddBuff(Actor target, Buff buff) + { + return AddBuff(User, target, buff); + } + + public bool AddBuff(Actor user, Actor target, Buff buff) + { + return target.World.BuffManager.AddBuff(user, target, buff); + } + + public bool HasBuff(Actor target) where BuffType : Buff + { + return target.World.BuffManager.HasBuff(target); + } + + public Vector3D RandomDirection(Vector3D position, float radius) + { + return RandomDirection(position, radius, radius); + } + + public Vector3D RandomDirection(Vector3D position, float minRadius, float maxRadius) + { + float angle = (float)(Rand.NextDouble() * Math.PI * 2); + float radius = minRadius + (float)Rand.NextDouble() * (maxRadius - minRadius); + return new Vector3D(position.X + (float)Math.Cos(angle) * radius, + position.Y + (float)Math.Sin(angle) * radius, + position.Z); + } + } +} diff --git a/src/Mooege/Core/GS/Powers/PowerLoader.cs b/src/Mooege/Core/GS/Powers/PowerLoader.cs new file mode 100644 index 00000000..ea5691a1 --- /dev/null +++ b/src/Mooege/Core/GS/Powers/PowerLoader.cs @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Reflection; +using Mooege.Common.Logging; + +namespace Mooege.Core.GS.Powers +{ + public class PowerLoader + { + static readonly Logger Logger = LogManager.CreateLogger(); + + private static Dictionary _implementations = new Dictionary(); + + public static PowerScript CreateImplementationForPowerSNO(int powerSNO) + { + if (_implementations.ContainsKey(powerSNO)) + { + PowerScript script = (PowerScript)Activator.CreateInstance(_implementations[powerSNO]); + script.PowerSNO = powerSNO; + return script; + } + else + { + Logger.Debug("Unimplemented power: {0}", powerSNO); + return null; + } + } + + public static bool HasImplementationForPowerSNO(int powerSNO) + { + return _implementations.ContainsKey(powerSNO); + } + + static PowerLoader() + { + // Find all subclasses of PowerImplementation and index them by the PowerSNO they are attributed with. + foreach (Type type in Assembly.GetExecutingAssembly().GetTypes()) + { + if (type.IsSubclassOf(typeof(PowerScript))) + { + var attributes = (ImplementsPowerSNO[])type.GetCustomAttributes(typeof(ImplementsPowerSNO), true); + foreach (var powerAttribute in attributes) + { + _implementations[powerAttribute.PowerSNO] = type; + } + } + } + } + } +} diff --git a/src/Mooege/Core/GS/Powers/PowerManager.cs b/src/Mooege/Core/GS/Powers/PowerManager.cs new file mode 100644 index 00000000..ac10dda7 --- /dev/null +++ b/src/Mooege/Core/GS/Powers/PowerManager.cs @@ -0,0 +1,207 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using System.Linq; +using Mooege.Common.Logging; +using Mooege.Core.GS.Actors; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Ticker; +using Mooege.Net.GS.Message.Definitions.World; + +namespace Mooege.Core.GS.Powers +{ + public class PowerManager + { + static readonly Logger Logger = LogManager.CreateLogger(); + + // list of all actively channeled skills + private List _channeledSkills = new List(); + + // list of all executing power scripts + private class ExecutingScript + { + public IEnumerator PowerEnumerator; + public PowerScript Script; + } + private List _executingScripts = new List(); + + // list of actors that were killed and are waiting to be deleted + // rather ugly hack needed because deleting actors immediatly when they have visual buff effects + // applied causes the effects to stay around forever. + private Dictionary _deletingActors = new Dictionary(); + + public PowerManager() + { + } + + public void Update() + { + _UpdateDeletingActors(); + _UpdateExecutingScripts(); + } + + public bool RunPower(Actor user, PowerScript power, Actor target = null, + Vector3D targetPosition = null, TargetMessage targetMessage = null) + { + // replace power with existing channel instance if one exists + if (power is ChanneledSkill) + { + var existingChannel = _FindChannelingSkill(user, power.PowerSNO); + if (existingChannel != null) + { + power = existingChannel; + } + else // new channeled skill, add it to the list + { + _channeledSkills.Add((ChanneledSkill)power); + } + } + + // copy in context params + power.User = user; + power.Target = target; + power.World = user.World; + power.TargetPosition = targetPosition; + power.TargetMessage = targetMessage; + + _StartScript(power); + return true; + } + + public bool RunPower(Actor user, int powerSNO, uint targetId = uint.MaxValue, Vector3D targetPosition = null, + TargetMessage targetMessage = null) + { + Actor target; + + if (targetId == uint.MaxValue) + { + target = null; + } + else + { + target = user.World.GetActorByDynamicId(targetId); + if (target == null) + return false; + + targetPosition = target.Position; + } + + // find and run a power implementation + var implementation = PowerLoader.CreateImplementationForPowerSNO(powerSNO); + if (implementation != null) + { + return RunPower(user, implementation, target, targetPosition, targetMessage); + } + else + { + return false; + } + } + + private void _UpdateExecutingScripts() + { + // process all powers, removing from the list the ones that expire + _executingScripts.RemoveAll(script => + { + if (script.PowerEnumerator.Current.TimedOut) + { + if (script.PowerEnumerator.MoveNext()) + return script.PowerEnumerator.Current == PowerScript.StopExecution; + else + return true; + } + else + { + return false; + } + }); + } + + public void CancelChanneledSkill(Actor user, int powerSNO) + { + var channeledSkill = _FindChannelingSkill(user, powerSNO); + if (channeledSkill != null) + { + channeledSkill.CloseChannel(); + _channeledSkills.Remove(channeledSkill); + } + else + { + Logger.Debug("cancel channel for power {0}, but it doesn't have an open channel to cancel", powerSNO); + } + } + + private ChanneledSkill _FindChannelingSkill(Actor user, int powerSNO) + { + return _channeledSkills.FirstOrDefault(impl => impl.User == user && + impl.PowerSNO == powerSNO && + impl.IsChannelOpen); + } + + private void _StartScript(PowerScript script) + { + var powerEnum = script.Run().GetEnumerator(); + if (powerEnum.MoveNext() && powerEnum.Current != PowerScript.StopExecution) + { + _executingScripts.Add(new ExecutingScript + { + PowerEnumerator = powerEnum, + Script = script + }); + } + } + + private void _UpdateDeletingActors() + { + foreach (var key in _deletingActors.Keys.ToArray()) + { + if (_deletingActors[key].TimedOut) + { + key.Destroy(); + _deletingActors.Remove(key); + } + } + } + + public void AddDeletingActor(Actor actor) + { + _deletingActors.Add(actor, new SecondsTickTimer(actor.World.Game, 0.2f)); + } + + public bool IsDeletingActor(Actor actor) + { + return _deletingActors.ContainsKey(actor); + } + + public void CancelAllPowers(Actor user) + { + _channeledSkills.RemoveAll(impl => + { + if (impl.User == user && impl.IsChannelOpen) + { + impl.CloseChannel(); + return true; + } + return false; + }); + + _executingScripts.RemoveAll((script) => script.Script.User == user); + } + } +} diff --git a/src/Mooege/Core/GS/Powers/PowerMath.cs b/src/Mooege/Core/GS/Powers/PowerMath.cs new file mode 100644 index 00000000..af1266ff --- /dev/null +++ b/src/Mooege/Core/GS/Powers/PowerMath.cs @@ -0,0 +1,212 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Common.Types.Misc; + +namespace Mooege.Core.GS.Powers +{ + // Collection of useful functions that operate on things Powers work with. + public static class PowerMath + { + #region Vector operations + + public static Vector2F VectorWithoutZ(Vector3D v) + { + return new Vector2F(v.X, v.Y); + } + + public static Vector3D VectorWithZ(Vector2F v, float z) + { + return new Vector3D(v.X, v.Y, z); + } + + public static Vector3D Normalize(Vector3D v) + { + float mag = v.X * v.X + v.Y * v.Y + v.Z * v.Z; + if (mag == 0) + return new Vector3D(0, 0, 0); + + Vector3D r = new Vector3D(v); + float len = 1f / (float)Math.Sqrt(mag); + r.X *= len; + r.Y *= len; + r.Z *= len; + return r; + } + + public static float Distance(Vector3D a, Vector3D b) + { + return (float)Math.Sqrt(Math.Pow(a.X - b.X, 2) + + Math.Pow(a.Y - b.Y, 2) + + Math.Pow(a.Z - b.Z, 2)); + } + + public static float Distance2D(Vector3D a, Vector3D b) + { + return (float)Math.Sqrt(Math.Pow(a.X - b.X, 2) + + Math.Pow(a.Y - b.Y, 2)); + } + + public static Vector3D TranslateDirection(Vector3D source, Vector3D destination, Vector3D point, float amount) + { + Vector3D norm = Normalize(new Vector3D(destination.X - source.X, destination.Y - source.Y, + destination.Z - source.Z)); + return new Vector3D(point.X + norm.X * amount, + point.Y + norm.Y * amount, + point.Z + norm.Z * amount); + } + + public static Vector3D TranslateDirection2D(Vector3D source, Vector3D destination, Vector3D point, float amount) + { + Vector3D norm = Normalize(new Vector3D(destination.X - source.X, destination.Y - source.Y, 0f)); + return new Vector3D(point.X + norm.X * amount, + point.Y + norm.Y * amount, + point.Z); + } + + public static Vector3D VectorRotateZ(Vector3D v, float radians) + { + float cosRad = (float)Math.Cos(radians); + float sinRad = (float)Math.Sin(radians); + + return new Vector3D(v.X * cosRad - v.Y * sinRad, + v.X * sinRad + v.Y * cosRad, + v.Z); + } + + public const float DegreesToRadians = (float)(Math.PI / 180.0); + + public static Vector3D[] GenerateSpreadPositions(Vector3D center, Vector3D targetPosition, float spacingDegrees, int count) + { + Vector3D baseRotation = targetPosition - center; + float spacing = spacingDegrees * DegreesToRadians; + float median = count % 2 == 0 ? spacing * (count + 1) / 2.0f : spacing * (float)Math.Ceiling(count / 2.0f); + Vector3D[] output = new Vector3D[count]; + + float offset = 1f; + for (int i = 0; i < count; ++i) + { + output[i] = center + VectorRotateZ(baseRotation, offset * spacing - median); + offset += 1f; + } + + return output; + } + + #endregion + + #region Geometry intersection/collision tests + + public static bool PointInRotatedRect(Vector2F point, Vector2F rectMidpointStart, Vector2F rectMidpointEnd, float rectHeight) + { + // create rectangle lengthwise from points, with specified height + Vector2F beam_diff = rectMidpointStart - rectMidpointEnd; + Vector2F beam_norm = Vector2F.Normalize(beam_diff); + + float length = beam_diff.Length(); + + float angX = -beam_norm.Y; + float angY = beam_norm.X; + + // rectangle points + float p1x = rectMidpointEnd.X - angX * rectHeight / 2; + float p1y = rectMidpointEnd.Y - angY * rectHeight / 2; + float p2x = p1x + angX * rectHeight; + float p2y = p1y + angY * rectHeight; + float p3x = p1x + beam_norm.X * length; + float p3y = p1y + beam_norm.Y * length; + float p4x = p3x + angX * rectHeight; + float p4y = p3y + angY * rectHeight; + + return PointInRectangle(point, p1x, p1y, p2x, p2y, p3x, p3y, p4x, p4y); + } + + public static bool PointInBeam(Vector3D point, Vector3D beamStart, Vector3D beamEnd, float beamThickness) + { + return CircleInBeam(new Circle(point.X, point.Y, 0), beamStart, beamEnd, beamThickness); + } + + public static bool CircleInBeam(Circle circle, Vector3D beamStart, Vector3D beamEnd, float beamThickness) + { + // NOTE: right now this does everything in 2d, ignoring Z + + // offset start beam position by beam thickness + beamStart = TranslateDirection2D(beamStart, beamEnd, beamStart, beamThickness); + + return MovingCircleCollides(new Circle(beamStart.X, beamStart.Y, beamThickness), + VectorWithoutZ(beamEnd - beamStart), + circle); + } + + public static bool PointInRectangle(Vector2F point, float r1x, float r1y, + float r2x, float r2y, + float r3x, float r3y, + float r4x, float r4y) + { + Vector2F corner = new Vector2F(r1x, r1y); + Vector2F local_point = point - corner; + Vector2F side1 = new Vector2F(r2x, r2y) - corner; + Vector2F side2 = new Vector2F(r4x, r4y) - corner; + return (0 <= Vector2F.Dot(local_point, side1) && + Vector2F.Dot(local_point, side1) <= Vector2F.Dot(side1, side1) && + 0 <= Vector2F.Dot(local_point, side2) && + Vector2F.Dot(local_point, side2) <= Vector2F.Dot(side2, side2)); + } + + public static Vector2F ClosestPointOnLineSegment(Vector2F point, Vector2F lineStart, Vector2F lineEnd) + { + Vector2F line = lineEnd - lineStart; + float lineMag = line.X * line.X + line.Y * line.Y; + if (lineMag == 0f) + return lineStart; + + float t = Vector2F.Dot(point - lineStart, line) / lineMag; + t = Math.Min(Math.Max(0, t), 1); + return lineStart + line * t; + } + + public static bool MovingCircleCollides(Circle mover, Vector2F velocity, Circle target) + { + Vector2F closest = ClosestPointOnLineSegment(target.Center, + mover.Center, + mover.Center + velocity); + float distanceSq = (float)(Math.Pow(closest.X - target.Center.X, 2) + Math.Pow(closest.Y - target.Center.Y, 2)); + return distanceSq <= (float)Math.Pow(mover.Radius + target.Radius, 2); + } + + public static bool ArcCircleCollides(Vector2F arcCenter, Vector2F arcDirection, float arcRadius, float arcLength, Circle circle) + { + Vector2F arcDelta = arcDirection - arcCenter; + Vector2F circleDelta = circle.Center - arcCenter; + if (arcDelta == circleDelta) + return true; + + if (arcDelta.Angle(circleDelta) < arcLength / 2f) + return Vector2F.Distance(arcCenter, circle.Center) <= arcRadius + circle.Radius; + else + return false; + } + + #endregion + } +} diff --git a/src/Mooege/Core/GS/Powers/PowerScript.cs b/src/Mooege/Core/GS/Powers/PowerScript.cs new file mode 100644 index 00000000..63cd9047 --- /dev/null +++ b/src/Mooege/Core/GS/Powers/PowerScript.cs @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using System.Linq; +using Mooege.Common; +using Mooege.Core.GS.Ticker; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Net.GS.Message.Definitions.World; +using Mooege.Core.GS.Actors; + +namespace Mooege.Core.GS.Powers +{ + public abstract class PowerScript : PowerContext + { + public Vector3D TargetPosition; + public TargetMessage TargetMessage; + + // Called to start executing a power + // Yields timers that signify when to continue execution. + public abstract IEnumerable Run(); + + // token instance that can be yielded by Run() to indicate the power manager should stop + // running a power implementation. + public static readonly TickTimer StopExecution = null; + + + public TargetList GetBestMeleeEnemy() + { + float meleeRange = 10f; // TODO: possibly use equipped weapon range for this? + + // get all targets that could be hit by melee attack, then select the script's target if + // it has one, otherwise use the closest target in range. + TargetList targets = GetEnemiesInBeamDirection(User.Position, TargetPosition, meleeRange); + + Actor bestEnemy; + if (targets.Actors.Contains(Target)) + bestEnemy = Target; + else + bestEnemy = targets.GetClosestTo(User.Position); + + targets.Actors.RemoveAll(actor => actor != bestEnemy); + return targets; + } + } +} diff --git a/src/Mooege/Core/GS/Powers/PowerTagHelper.cs b/src/Mooege/Core/GS/Powers/PowerTagHelper.cs new file mode 100644 index 00000000..b34a2e4d --- /dev/null +++ b/src/Mooege/Core/GS/Powers/PowerTagHelper.cs @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Common.MPQ.FileFormats; +using Mooege.Common.MPQ; +using Mooege.Core.GS.Common.Types.SNO; + +namespace Mooege.Core.GS.Powers +{ + public class PowerTagHelper + { + public static TagKeyScript GenerateTagForScriptFormula(int SF_N) + { + return new TagKeyScript(266496 + 256 * (SF_N / 10) + 16 * (SF_N % 10)); + } + + public static TagMap FindTagMapWithKey(int powerSNO, TagKey key) + { + Power power = (Power)MPQStorage.Data.Assets[SNOGroup.Power][powerSNO].Data; + + // TODO: figure out which tagmaps to search and in what order, eventually will probably + // have to reorder them based on whether PvPing or not. + TagMap[] tagMaps = new TagMap[] + { + power.Powerdef.GeneralTagMap, + power.Powerdef.TagMap, + power.Powerdef.ContactTagMap0, + power.Powerdef.ContactTagMap1, + power.Powerdef.ContactTagMap2, + power.Powerdef.ContactTagMap3, + power.Powerdef.PVPGeneralTagMap, + power.Powerdef.PVPContactTagMap0, + power.Powerdef.PVPContactTagMap1, + power.Powerdef.PVPContactTagMap2, + power.Powerdef.PVPContactTagMap3, + }; + + foreach (TagMap tagmap in tagMaps) + { + if (tagmap.ContainsKey(key)) + return tagmap; + } + + return null; + } + } +} diff --git a/src/Mooege/Core/GS/Powers/Projectile.cs b/src/Mooege/Core/GS/Powers/Projectile.cs new file mode 100644 index 00000000..cdd36ca6 --- /dev/null +++ b/src/Mooege/Core/GS/Powers/Projectile.cs @@ -0,0 +1,202 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Linq; +using Mooege.Core.GS.Actors; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Net.GS.Message.Definitions.ACD; +using Mooege.Core.GS.Common.Types.Misc; +using Mooege.Core.GS.Objects; +using Mooege.Core.GS.Ticker; +using Mooege.Common.Logging; +using Mooege.Net.GS.Message; +using Mooege.Core.GS.Common.Types.TagMap; + +namespace Mooege.Core.GS.Powers +{ + public class Projectile : Actor, IUpdateable + { + public static readonly Logger Logger = LogManager.CreateLogger(); + + public override ActorType ActorType { get { return ActorType.Projectile; } } + + public PowerContext Context; + + public Func CollisionFilter = null; + public Action OnCollision = null; + public Action OnUpdate = null; + public Action OnArrival = null; + public Action OnTimeout = null; + public TickTimer Timeout = null; + public bool DestroyOnArrival = false; + public TickTimer ArrivalTime { get { return _mover.ArrivalTime; } } + public bool Arrived { get { return _mover.Arrived; } } + + private ActorMover _mover; + private Vector3D _prevUpdatePosition; + private bool _onArrivalCalled; + private bool _spawned; // using my own spawn flag cause Actor.Spawned isn't being used right now + + public Projectile(PowerContext context, int actorSNO, Vector3D position) + : base(context.World, actorSNO) + { + this.Field2 = 0x8; + this.Field7 = 0x00000001; // TODO: test if this is necessary + + if (this.Scale == 0f) + this.Scale = 1.00f; + + this.Context = context; + this.Position = new Vector3D(position); + // offset position by mpq collision data + this.Position.Z += this.ActorData.Cylinder.Ax1 - this.ActorData.Cylinder.Position.Z; + // 2 second default timeout for projectiles + this.Timeout = new SecondsTickTimer(context.World.Game, 2f); + + // copy in important effect params from user + this.Attributes[GameAttribute.Rune_A, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_A, context.PowerSNO]; + this.Attributes[GameAttribute.Rune_B, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_B, context.PowerSNO]; + this.Attributes[GameAttribute.Rune_C, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_C, context.PowerSNO]; + this.Attributes[GameAttribute.Rune_D, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_D, context.PowerSNO]; + this.Attributes[GameAttribute.Rune_E, context.PowerSNO] = context.User.Attributes[GameAttribute.Rune_E, context.PowerSNO]; + + _prevUpdatePosition = null; + _mover = new ActorMover(this); + _spawned = false; + } + + public void Launch(Vector3D targetPosition, float speed) + { + _onArrivalCalled = false; + _prevUpdatePosition = this.Position; + + this.TranslateFacing(targetPosition, true); + targetPosition = new Vector3D(targetPosition); + targetPosition.Z += this.ActorData.Cylinder.Ax1 - this.ActorData.Cylinder.Position.Z; + if (!_spawned) + { + this.EnterWorld(this.Position); + _spawned = true; + } + + _mover.MoveFixed(targetPosition, speed, new ACDTranslateFixedMessage + { + Field2 = 0x00800000, + AnimationTag = AnimationSetKeys.IdleDefault.ID, + Field4 = -1 + }); + } + + public void LaunchArc(Vector3D destination, float arcHeight, float arcGravity, float visualBounce = 0f) + { + _onArrivalCalled = false; + _prevUpdatePosition = this.Position; + + this.TranslateFacing(destination, true); + if (!_spawned) + { + this.EnterWorld(this.Position); + _spawned = true; + } + + _mover.MoveArc(destination, arcHeight, arcGravity, new ACDTranslateArcMessage + { + Field3 = 0x00800000, + FlyingAnimationTagID = AnimationSetKeys.IdleDefault.ID, + LandingAnimationTagID = -1, + PowerSNO = this.Context.PowerSNO, + Bounce = visualBounce + }); + } + + private void _CheckCollisions() + { + if (OnCollision == null) return; + + // check if we collided with anything since last update + + float radius = this.ActorData.Cylinder.Ax2; + Circle startCircle = new Circle(_prevUpdatePosition.X, _prevUpdatePosition.Y, radius); + // make a velocity representing the change to the current position + Vector2F velocity = PowerMath.VectorWithoutZ(this.Position - _prevUpdatePosition); + + Actor hit = null; + TargetList targets = this.Context.GetEnemiesInRadius(this.Position, radius + 25f); + if (CollisionFilter != null) + targets.Actors.RemoveAll(actor => !CollisionFilter(actor)); + targets.SortByDistanceFrom(_prevUpdatePosition); + + foreach (Actor target in targets.Actors) + { + float targetRadius = 1.5f; // TODO: use target.ActorData.Cylinder.Ax2 ? + if (PowerMath.MovingCircleCollides(startCircle, velocity, new Circle(target.Position.X, target.Position.Y, targetRadius))) + { + hit = target; + break; + } + } + + if (hit != null) + OnCollision(hit); + } + + public void Update(int tickCounter) + { + if (!_spawned) return; + + // gotta make sure the actor hasn't been deleted after processing each handler + + if (this.World != null) + _CheckCollisions(); + + // doing updates after collision tests + if (this.World != null) + { + _prevUpdatePosition = this.Position; + _mover.Update(); + } + + if (OnUpdate != null) + OnUpdate(); + + if (this.World != null && this.Arrived) + { + if (OnArrival != null && _onArrivalCalled == false) + { + _onArrivalCalled = true; + OnArrival(); + } + if (this.World != null && this.DestroyOnArrival && + this.Arrived) // double check arrival in case OnArrival() re-launched + Destroy(); + } + + if (this.World != null) + { + if (Timeout.TimedOut) + { + if (OnTimeout != null) + OnTimeout(); + + Destroy(); + } + } + } + } +} diff --git a/src/Mooege/Core/GS/Powers/ScriptFormulaEvaluator.cs b/src/Mooege/Core/GS/Powers/ScriptFormulaEvaluator.cs new file mode 100644 index 00000000..bab24c40 --- /dev/null +++ b/src/Mooege/Core/GS/Powers/ScriptFormulaEvaluator.cs @@ -0,0 +1,427 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using Mooege.Common.Logging; +using Mooege.Common.MPQ; +using Mooege.Common.MPQ.FileFormats; +using Mooege.Common.MPQ.FileFormats.Types; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Core.GS.Objects; +using Mooege.Net.GS.Message; + +namespace Mooege.Core.GS.Powers +{ + // Based off Items.FormulaScript class, modified to read game attributes and fully execute power script formulas. + public static class ScriptFormulaEvaluator + { + private static readonly Logger Logger = LogManager.CreateLogger(); + + public static bool Evaluate(int powerSNO, TagKeyScript scriptTag, GameAttributeMap attributes, Random rand, out float result) + { + result = 0; + + ScriptFormula scriptFormula = FindScriptFormula(powerSNO, scriptTag); + if (scriptFormula == null) + { + //Logger.Error("could not find script tag {0} in power {1}", scriptTag.ID, powerSNO); + return false; + } + + byte[] script = scriptFormula.OpCodeArray; + Stack stack = new Stack(4); // analysis of all stack formulas found the biggest stack is currently 11 + int pos = 0; + float numb1, numb2, numb3; + float temp; + while (pos < script.Length) + { + switch (script[pos]) + { + case 0: // return + if (StackUnderflow(stack, 1)) + return false; + result = stack.Pop(); + return true; + + case 1: // function + pos += 4; + switch (script[pos]) + { + case 0: // Min() + if (StackUnderflow(stack, 2)) + return false; + numb2 = stack.Pop(); + numb1 = stack.Pop(); + stack.Push(Math.Min(numb1, numb2)); + break; + + case 1: // Max() + if (StackUnderflow(stack, 2)) + return false; + numb2 = stack.Pop(); + numb1 = stack.Pop(); + stack.Push(Math.Max(numb1, numb2)); + break; + + case 2: // Pin() + if (StackUnderflow(stack, 3)) + return false; + numb3 = stack.Pop(); + numb2 = stack.Pop(); + numb1 = stack.Pop(); + if (numb2 > numb1) + stack.Push(numb2); + else if (numb1 > numb3) + stack.Push(numb3); + else + stack.Push(numb1); + + break; + + case 3: // RandomIntMinRange() + if (StackUnderflow(stack, 2)) + return false; + numb2 = stack.Pop(); + numb1 = stack.Pop(); + stack.Push(rand.Next((int)numb1, (int)numb1 + (int)numb2)); + break; + + case 4: // RandomIntMinMax() + if (StackUnderflow(stack, 2)) + return false; + numb2 = stack.Pop(); + numb1 = stack.Pop(); + stack.Push(rand.Next((int)numb1, (int)numb2)); + break; + + case 5: // Floor() + if (StackUnderflow(stack, 1)) + return false; + numb1 = stack.Pop(); + stack.Push((float)Math.Floor(numb1)); + break; + + case 9: // RandomFloatMinRange() + if (StackUnderflow(stack, 2)) + return false; + numb2 = stack.Pop(); + numb1 = stack.Pop(); + stack.Push(numb1 + (float)rand.NextDouble() * numb2); + break; + + case 10: // RandomFloatMinMax() + if (StackUnderflow(stack, 2)) + return false; + numb2 = stack.Pop(); + numb1 = stack.Pop(); + stack.Push(numb1 + (float)rand.NextDouble() * (numb2 - numb1)); + break; + + case 11: // Table() + if (StackUnderflow(stack, 2)) + return false; + float index = stack.Pop(); + float tableID = stack.Pop(); + if (!LookupBalanceTable(tableID, index, out temp)) + return false; + stack.Push(temp); + break; + + default: + Logger.Error("Unimplemented function"); + return false; + } + break; + case 5: // external identifier + if (!LoadIdentifier(powerSNO, scriptTag, attributes, rand, + BitConverter.ToInt32(script, pos + 4 * 1), + BitConverter.ToInt32(script, pos + 4 * 2), + BitConverter.ToInt32(script, pos + 4 * 3), + BitConverter.ToInt32(script, pos + 4 * 4), + out temp)) + return false; + + stack.Push(temp); + pos += 4 * 4; + break; + + case 6: // push float + pos += 4; + stack.Push(BitConverter.ToSingle(script, pos)); + break; + + case 8: // operator > + if (StackUnderflow(stack, 2)) + return false; + numb2 = stack.Pop(); + numb1 = stack.Pop(); + stack.Push(numb1 > numb2 ? 1 : 0); + break; + + case 11: // operator + + if (StackUnderflow(stack, 2)) + return false; + numb2 = stack.Pop(); + numb1 = stack.Pop(); + stack.Push(numb1 + numb2); + break; + + case 12: // operator - + if (StackUnderflow(stack, 2)) + return false; + numb2 = stack.Pop(); + numb1 = stack.Pop(); + stack.Push(numb1 - numb2); + break; + + case 13: // operator * + if (StackUnderflow(stack, 2)) + return false; + numb2 = stack.Pop(); + numb1 = stack.Pop(); + stack.Push(numb1 * numb2); + break; + + case 14: // operator / + if (StackUnderflow(stack, 2)) + return false; + numb2 = stack.Pop(); + numb1 = stack.Pop(); + if (numb2 == 0f) + { + Logger.Error("Division by zero, 0 pushed to stack instead of divide result"); + stack.Push(0f); + } + else + { + stack.Push(numb1 / numb2); + } + break; + + case 16: // operator -(unary) + if (StackUnderflow(stack, 1)) + return false; + numb1 = stack.Pop(); + stack.Push(-numb1); + break; + + case 17: // operator ?: + if (StackUnderflow(stack, 3)) + return false; + numb3 = stack.Pop(); + numb2 = stack.Pop(); + numb1 = stack.Pop(); + stack.Push(numb1 != 0 ? numb2 : numb3); + break; + + default: + Logger.Error("Unimplemented OpCode({0})", script[pos]); + return false; + } + pos += 4; + } + + // HACK: ignore bad formula + if (powerSNO == Skills.Skills.Barbarian.FurySpenders.Whirlwind && + scriptTag.ID == 266560) // ScriptFormula(4) + { + return true; + } + + Logger.Error("script finished without return opcode"); + return false; + } + + private static bool StackUnderflow(Stack stack, int popcount) + { + if (stack.Count < popcount) + { + Logger.Error("Stack underflow"); + return true; + } + return false; + } + + private static float BinaryIntToFloat(int n) + { + byte[] array = BitConverter.GetBytes(n); + return BitConverter.ToSingle(array, 0); + } + + private static bool LoadIdentifier(int powerSNO, TagKeyScript scriptTag, GameAttributeMap attributes, Random rand, + int numb1, int numb2, int numb3, int numb4, + out float result) + { + switch (numb1) + { + case 0: + return LoadAttribute(powerSNO, attributes, numb2, out result); + + case 1: // slevel + result = attributes[GameAttribute.Skill, powerSNO]; + return true; + + case 22: // absolute power formula ref + return Evaluate(numb2, new TagKeyScript(numb3), attributes, rand, out result); + + default: + if (numb1 >= 23 && numb1 <= 62) // SF_N, relative power formula ref + { + int SF_N = numb1 - 23; + TagKeyScript relativeTag = PowerTagHelper.GenerateTagForScriptFormula(SF_N); + return Evaluate(powerSNO, relativeTag, attributes, rand, out result); + } + else if (numb1 >= 63 && numb1 <= 72) // known gamebalance power table id range + { + result = BinaryIntToFloat(numb1); // simply store id, used later by Table() + return true; + } + else + { + Logger.Error("unknown identifier"); + result = 0; + return false; + } + } + } + + // this lists the attributes that need to be keyed with the powerSNO to work + private static readonly SortedSet _powerKeyedAttributes = new SortedSet() + { + GameAttribute.Rune_A.Id, + GameAttribute.Rune_B.Id, + GameAttribute.Rune_C.Id, + GameAttribute.Rune_D.Id, + GameAttribute.Rune_E.Id, + GameAttribute.Buff_Icon_Count0.Id, + GameAttribute.Buff_Icon_Count1.Id, + GameAttribute.Buff_Icon_Count2.Id, + GameAttribute.Buff_Icon_Count3.Id, + GameAttribute.Buff_Icon_Count4.Id, + GameAttribute.Buff_Icon_Count5.Id, + GameAttribute.Buff_Icon_Count6.Id, + GameAttribute.Buff_Icon_Count7.Id, + }; + + private static bool LoadAttribute(int powerSNO, GameAttributeMap attributes, int attributeId, out float result) + { + GameAttribute attr = GameAttribute.Attributes[attributeId]; + bool needs_key = _powerKeyedAttributes.Contains(attributeId); + + if (attr is GameAttributeF) + { + if (needs_key) result = attributes[(GameAttributeF)attr, powerSNO]; + else result = attributes[(GameAttributeF)attr]; + + return true; + } + else if (attr is GameAttributeI) + { + if (needs_key) result = (float)attributes[(GameAttributeI)attr, powerSNO]; + else result = (float)attributes[(GameAttributeI)attr]; + + return true; + } + else if (attr is GameAttributeB) + { + if (needs_key) result = attributes[(GameAttributeB)attr, powerSNO] ? 1 : 0; + else result = attributes[(GameAttributeB)attr] ? 1 : 0; + + return true; + } + else + { + Logger.Error("invalid attribute {0}", attributeId); + result = 0; + return false; + } + } + + private static ScriptFormula FindScriptFormula(int powerSNO, TagKeyScript scriptTag) + { + TagMap tagmap = PowerTagHelper.FindTagMapWithKey(powerSNO, scriptTag); + if (tagmap != null) + return tagmap[scriptTag]; + else + return null; + } + + private static bool LookupBalanceTable(float tableId, float index, out float result) + { + result = 0; + + int tableByte = BitConverter.GetBytes(tableId)[0]; + string tableName = GetTableName(tableByte); + if (tableName == null) + return false; + + foreach (GameBalance gb in MPQStorage.Data.Assets[SNOGroup.GameBalance].Values.Where(a => a.Data != null) + .Select(a => a.Data) + .Cast()) + { + if (gb.PowerFormula != null) + { + foreach (var powerEntry in gb.PowerFormula) + { + if (powerEntry.S0 == tableName) + { + result = powerEntry.F0[(int)index]; + return true; + } + } + } + } + + Logger.Error("could not find table {0}", tableName); + return false; + } + + private static string GetTableName(int tableId) + { + switch (tableId) + { + case 63: + return "DmgTier1"; + case 64: + return "DmgTier2"; + case 65: + return "DmgTier3"; + case 66: + return "DmgTier4"; + case 67: + return "DmgTier5"; + case 68: + return "DmgTier6"; + case 69: + return "DmgTier7"; + case 70: + return "Healing"; + case 71: + return "WDCost"; + case 72: + return "RuneDamageBonus"; + default: + Logger.Error("Unknown table id {0}", tableId); + return null; + } + } + } +} diff --git a/src/Mooege/Core/GS/Powers/Skill.cs b/src/Mooege/Core/GS/Powers/Skill.cs new file mode 100644 index 00000000..563b24c7 --- /dev/null +++ b/src/Mooege/Core/GS/Powers/Skill.cs @@ -0,0 +1,134 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Core.GS.Ticker; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Core.GS.Players; +using Mooege.Net.GS.Message.Definitions.Animation; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Core.GS.Powers +{ + public abstract class Skill : PowerScript + { + // main handler called to generate effects for skill + public abstract IEnumerable Main(); + + public sealed override IEnumerable Run() + { + // play starting animation and effects + _PlayActionAnimation(); + _PlayCastEffect(); + + float contactDelay = GetContactDelay(); + if (contactDelay > 0f) + yield return WaitSeconds(contactDelay); + + _PlayContactEffect(); + + // run main effects script + foreach (TickTimer timer in Main()) + yield return timer; + } + + public bool IsUserFemale + { + get + { + return User is Player && (User as Player).Toon.Gender == 2; // 2 = female + } + } + + public virtual int GetActionAnimationSNO() + { + int tag = EvalTag(PowerKeys.AnimationTag); + if (User.AnimationSet != null && User.AnimationSet.Animations.ContainsKey(tag)) + return User.AnimationSet.Animations[tag]; + else + return -1; + } + + public virtual float GetActionSpeed() + { + return EvalTag(PowerKeys.AttackSpeed); + } + + public virtual int GetCastEffectSNO() + { + return EvalTag(IsUserFemale ? PowerKeys.CastingEffectGroup_Female : PowerKeys.CastingEffectGroup_Male); + } + + public virtual int GetContactEffectSNO() + { + return EvalTag(IsUserFemale ? PowerKeys.ContactFrameEffectGroup_Female : PowerKeys.ContactFrameEffectGroup_Male); + } + + public virtual float GetContactDelay() + { + return 0f; + } + + private void _PlayActionAnimation() + { + int animationSNO = GetActionAnimationSNO(); + float speed = GetActionSpeed(); + if (animationSNO != -1 && speed > 0f) + { + PlayAnimationMessage message = new PlayAnimationMessage + { + ActorID = User.DynamicID, + Field1 = 3, + Field2 = 0, + tAnim = new PlayAnimationMessageSpec[] + { + new PlayAnimationMessageSpec + { + Duration = (int)(60f / speed), // ticks + AnimationSNO = animationSNO, + PermutationIndex = 0x0, + Speed = speed, + } + } + }; + + if (User is Player) + User.World.BroadcastExclusive(message, User); + else + User.World.BroadcastIfRevealed(message, User); + } + } + + private void _PlayCastEffect() + { + int sno = GetCastEffectSNO(); + if (sno != -1) + User.PlayEffectGroup(sno); + } + + private void _PlayContactEffect() + { + int sno = GetContactEffectSNO(); + if (sno != -1) + User.PlayEffectGroup(sno); + } + } +} diff --git a/src/Mooege/Core/GS/Powers/TargetList.cs b/src/Mooege/Core/GS/Powers/TargetList.cs new file mode 100644 index 00000000..63fee78f --- /dev/null +++ b/src/Mooege/Core/GS/Powers/TargetList.cs @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Core.GS.Actors; +using Mooege.Core.GS.Common.Types.Math; + +namespace Mooege.Core.GS.Powers +{ + public class TargetList + { + // list of actors that are the primary targets + public List Actors { get; private set; } + + // list of extra actors that are near the targets, i.e. destructables like barrels, tombstones etc. + public List ExtraActors { get; private set; } + + public TargetList() + { + this.Actors = new List(); + this.ExtraActors = new List(); + } + + public void SortByDistanceFrom(Vector3D position) + { + this.Actors = this.Actors.OrderBy(actor => PowerMath.Distance2D(actor.Position, position)).ToList(); + } + + public Actor GetClosestTo(Vector3D position) + { + Actor closest = null; + float closestDistance = float.MaxValue; + foreach (Actor actor in this.Actors) + { + float distance = PowerMath.Distance2D(actor.Position, position); + if (distance < closestDistance) + { + closest = actor; + closestDistance = distance; + } + } + + return closest; + } + } +} diff --git a/src/Mooege/Core/GS/QuestEvents/Implementions/151087.cs b/src/Mooege/Core/GS/QuestEvents/Implementions/151087.cs new file mode 100644 index 00000000..b4239f9e --- /dev/null +++ b/src/Mooege/Core/GS/QuestEvents/Implementions/151087.cs @@ -0,0 +1,153 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Common.MPQ.FileFormats; +using Mooege.Net.GS.Message.Definitions.ACD; +using Mooege.Net.GS.Message.Definitions.Animation; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Generators; +using Mooege.Common.Logging; +using System.Threading.Tasks; +using System.Threading; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Core.GS.Actors; + + +namespace Mooege.Core.GS.QuestEvents.Implementations +{ + class _151087 : QuestEvent + { + + private static readonly Logger Logger = LogManager.CreateLogger(); + + public _151087() + : base(151087) + { + } + + List monstersAlive = new List { }; //We use this for the killeventlistener. + public override void Execute(Map.World world) + { + //var WaitConversationTask = Task.Factory.StartNew(() => WaitConversation(world)); + ////Disable RumFord so he doesn't offer the quest. Somehow, hes supposed to mark it as readed and not offer it while theres no other quest available but he does, + ////so you can trigger the event multiple times while the event is already running, therefor, we disable his interaction till the event is done.-Wesko + + //setActorOperable(world, 3739, false); + //WaitConversationTask.ContinueWith(delegate + //{ + // //Start the conversation between RumFord & Guard. + // StartConversation(world, 198199); + // var WaitConversationTask2 = Task.Factory.StartNew(() => WaitConversation(world)); + // //After Conversations ends!. + // WaitConversationTask2.ContinueWith(delegate + // { + // var wave1Actors = world.GetActorsInGroup("GizmoGroup1"); + + // foreach (var actor in wave1Actors) + // { + // actor.Spawn(); + // } + // }); + //}); + ////Run Kill Event Listener + //var ListenerFirstWaveTask = Task.Factory.StartNew(() => OnKillListener(world, "GizmoGroup1")); + //ListenerFirstWaveTask.ContinueWith(delegate //Once killed: + //{ + // //Wave three: Skinnies + RumFord conversation #2 "They Keep Comming!". + // StartConversation(world, 80088); + var wave2Actors = world.GetActorsInGroup("GizmoGroup2"); + foreach (var actor in wave2Actors) + { + if (actor is Spawner) + { + (actor as Spawner).Spawn(); + } + } + + // var ListenerThirdWaveTask = Task.Factory.StartNew(() => OnKillListener(world, "GizmoGroup2")); + // ListenerThirdWaveTask.Wait(); + // Task.WaitAll(); + + // //Event done we advance the quest and play last conversation #3. + // world.Game.Quests.Advance(87700); + // Logger.Debug("Event finished"); + // StartConversation(world, 151102); + // setActorOperable(world, 3739, true); + //}); + } + + //This is the way we Listen for mob killing events. + private bool OnKillListener(Map.World world, string group) + { + while (world.HasActorsInGroup(group)) + { + } + return true; + } + + //HACK!,This is the way we wait if we need to trigger something after a conversation ends. + private bool _status = false; + private bool WaitConversation(Map.World world) + { + var players = world.Players; + while (!_status) + { + foreach (var player in players) + { + if (player.Value.Conversations.ConversationRunning() == true) + { + Logger.Debug("Conversation Finished"); + _status = false; + return true; + } + else + { + //Logger.Debug("Waiting"); + } + } + } + return true; + } + + //Launch Conversations. + private bool StartConversation(Map.World world, Int32 conversationId) + { + foreach (var player in world.Players) + { + player.Value.Conversations.StartConversation(conversationId); + } + return true; + } + + //Not Operable Rumford (To disable giving u the same quest while ur in the event) + public static bool setActorOperable(Map.World world, Int32 snoId, bool status) + { + var actor = world.GetActorBySNO(snoId); + foreach (var player in world.Players) + { + actor.Attributes[Net.GS.Message.GameAttribute.NPC_Is_Operatable] = status; + } + return true; + } + + } +} diff --git a/src/Mooege/Core/GS/QuestEvents/Implementions/151123.cs b/src/Mooege/Core/GS/QuestEvents/Implementions/151123.cs new file mode 100644 index 00000000..ae43ff8d --- /dev/null +++ b/src/Mooege/Core/GS/QuestEvents/Implementions/151123.cs @@ -0,0 +1,162 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Common.MPQ.FileFormats; +using Mooege.Net.GS.Message.Definitions.ACD; +using Mooege.Net.GS.Message.Definitions.Animation; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Generators; +using Mooege.Common.Logging; +using System.Threading.Tasks; + +namespace Mooege.Core.GS.QuestEvents.Implementations +{ + class _151123 : QuestEvent + { + //ActorID: 0x7A3100DD + //ZombieSkinny_A_LeahInn.acr (2050031837) + //ActorSNOId: 0x00031971:ZombieSkinny_A_LeahInn.acr + + private static readonly Logger Logger = LogManager.CreateLogger(); + + public _151123() + : base(151123) + { + } + + List ActorsVector3D = new List { }; //We fill this with the vectors of the actors that transform, so we spwan zombies in the same location. + List monstersAlive = new List { }; //We use this for the killeventlistener. + + public override void Execute(Map.World world) + { + StartConversation(world, 204113); + + var transformActors = Task.Factory.StartNew(() => HoudiniVsZombies(world, 204605)); + transformActors.Wait(); + var zombieWave = Task.Factory.StartNew(() => LaunchWave(ActorsVector3D, world, 203121)); + zombieWave.Wait(); + var ListenerZombie = Task.Factory.StartNew(() => OnKillListener(monstersAlive, world)); + ListenerZombie.ContinueWith(delegate //Once killed: + { + StartConversation(world, 151156); + world.Game.Quests.Advance(87700); + }); + } + + private bool HoudiniVsZombies(Map.World world, Int32 snoId) + { + var actorSourcePosition = world.GetActorBySNO(snoId); + var around = actorSourcePosition.GetActorsInRange(10f); + + foreach (var player in world.Players) + { + foreach (var actors in around) + { + ActorsVector3D.Add(new Vector3D(actors.Position.X, actors.Position.Y, actors.Position.Z)); + actors.Destroy(); + } + } + return true; + } + + private bool StartConversation(Map.World world, Int32 conversationId) + { + foreach (var player in world.Players) + { + player.Value.Conversations.StartConversation(conversationId); + } + return true; + } + + private bool LaunchWave(List Coordinates, Map.World world, Int32 SnoId) + { + var counter = 0; + var monsterSNOHandle = new Common.Types.SNO.SNOHandle(SnoId); + var monsterActor = monsterSNOHandle.Target as Actor; + + foreach (Vector3D coords in Coordinates) + { + Parallel.ForEach(world.Players, player => //Threading because many spawns at once with out Parallel freezes D3. + { + var PRTransform = new PRTransform() + { + Quaternion = new Quaternion() + { + W = 0.590017f, + Vector3D = new Vector3D(0, 0, 0) + }, + Vector3D = Coordinates[counter] + }; + + //Load the actor here. + var actor = WorldGenerator.loadActor(monsterSNOHandle, PRTransform, world, monsterActor.TagMap); + monstersAlive.Add(actor); + counter++; + + //If Revealed play animation. + world.BroadcastIfRevealed(new PlayAnimationMessage + { + ActorID = actor, + Field1 = 9, + Field2 = 0, + tAnim = new Net.GS.Message.Fields.PlayAnimationMessageSpec[] + { + new Net.GS.Message.Fields.PlayAnimationMessageSpec() + { + Duration = 0x00000048, + AnimationSNO = 0x00029A08, + PermutationIndex = 0x00000000, + Speed = 1f + } + } + }, player.Value); + }); + } + return true; + } + + private bool OnKillListener(List monstersAlive, Map.World world) + { + Int32 monstersKilled = 0; + var monsterCount = monstersAlive.Count; //Since we are removing values while iterating, this is set at the first real read of the mob counting. + while (monstersKilled != monsterCount) + { + //Iterate through monstersAlive List, if found dead we start to remove em till all of em are dead and removed. + for (int i = monstersAlive.Count - 1; i >= 0; i--) + { + if (world.HasMonster(monstersAlive[i])) + { + //Alive: Nothing. + } + else + { + //If dead we remove it from the list and keep iterating. + Logger.Debug(monstersAlive[i] + " has been killed"); + monstersAlive.RemoveAt(i); + monstersKilled++; + } + } + } + return true; + } + } +} \ No newline at end of file diff --git a/src/Mooege/Core/GS/QuestEvents/Implementions/198503.cs b/src/Mooege/Core/GS/QuestEvents/Implementions/198503.cs new file mode 100644 index 00000000..2f9bb9cb --- /dev/null +++ b/src/Mooege/Core/GS/QuestEvents/Implementions/198503.cs @@ -0,0 +1,101 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Common.MPQ.FileFormats; +using Mooege.Net.GS.Message.Definitions.ACD; +using Mooege.Net.GS.Message.Definitions.Animation; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Generators; +using Mooege.Common.Logging; +using System.Threading.Tasks; +using System.Threading; + +namespace Mooege.Core.GS.QuestEvents.Implementations +{ + class _198503 : QuestEvent + { + + private static readonly Logger Logger = LogManager.CreateLogger(); + + public _198503() + : base(198503) + { + } + + List monstersAlive = new List { }; //We use this for the killeventlistener. + public override void Execute(Map.World world) + { + //The spawning positions for each monster in its wave. Basically, you add here the "number" of mobs, accoring to each vector LaunchWave() will spawn every mob in its position. + //Vector3D[] WretchedMotherSpawn = { new Vector3D(2766.513f, 2913.982f, 24.04533f) }; + + //Somehow shes already spawned when the Inn event finishes.. so we search for the ID and add it to the kill event listener. + var actor = world.GetActorBySNO(219725); + monstersAlive.Add(actor.DynamicID); + + //Run Kill Event Listener + var ListenerFirstWaveTask = Task.Factory.StartNew(() => OnKillListener(monstersAlive, world)); + //Wait for wtretchedmother to be killed. + ListenerFirstWaveTask.ContinueWith(delegate //Once killed: + { + world.Game.Quests.Advance(87700); + Logger.Debug("Event finished"); + StartConversation(world, 156223); + }); + } + + //This is the way we Listen for mob killing events. + private bool OnKillListener(List monstersAlive, Map.World world) + { + Int32 monstersKilled = 0; + var monsterCount = monstersAlive.Count; //Since we are removing values while iterating, this is set at the first real read of the mob counting. + while (monstersKilled != monsterCount) + { + //Iterate through monstersAlive List, if found dead we start to remove em till all of em are dead and removed. + for (int i = monstersAlive.Count - 1; i >= 0; i--) + { + if (world.HasMonster(monstersAlive[i])) + { + //Alive: Nothing. + } + else + { + //If dead we remove it from the list and keep iterating. + Logger.Debug(monstersAlive[i] + " has been killed"); + monstersAlive.RemoveAt(i); + monstersKilled++; + } + } + } + return true; + } + + //Launch Conversations. + private bool StartConversation(Map.World world, Int32 conversationId) + { + foreach (var player in world.Players) + { + player.Value.Conversations.StartConversation(conversationId); + } + return true; + } + } +} diff --git a/src/Mooege/Core/GS/QuestEvents/QuestEvent.cs b/src/Mooege/Core/GS/QuestEvents/QuestEvent.cs new file mode 100644 index 00000000..14e3154e --- /dev/null +++ b/src/Mooege/Core/GS/QuestEvents/QuestEvent.cs @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Common.Logging; +using Mooege.Core.GS.Players; + + +namespace Mooege.Core.GS.QuestEvents +{ + //TODO: Add attributes + public abstract class QuestEvent + { + Logger logger = new Logger("Conversation"); + + public uint ConversationSNOId { get; set; } + + + public QuestEvent(uint conversationSNOId) + { + this.ConversationSNOId = conversationSNOId; + } + + public abstract void Execute(Map.World world); + } +} diff --git a/src/Mooege/Core/GS/Skills/SkillSet.cs b/src/Mooege/Core/GS/Skills/SkillSet.cs new file mode 100644 index 00000000..8e4e0bd8 --- /dev/null +++ b/src/Mooege/Core/GS/Skills/SkillSet.cs @@ -0,0 +1,183 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Linq; +using Mooege.Common.Storage.AccountDataBase.Entities; +using Mooege.Core.MooNet.Toons; +using Mooege.Net.GS.Message.Fields; +using Mooege.Common.Logging; +using Mooege.Net.MooNet; +using System.Data.SQLite; +using Mooege.Common.Storage; + +namespace Mooege.Core.GS.Skills +{ + public class SkillSet + { + public ToonClass @Class; + public Toon Toon { get; private set; } + + public ActiveSkillSavedData[] ActiveSkills; + public HotbarButtonData[] HotBarSkills; + public int[] PassiveSkills; + + protected static readonly Logger Logger = LogManager.CreateLogger(); + + public SkillSet(ToonClass @class, Toon toon) + { + this.@Class = @class; + var dbToon = DBSessions.AccountSession.Get(toon.PersistentID); + + if (dbToon.DBActiveSkills == null) + { + int[] ActiveSkillsList = Skills.GetAllActiveSkillsByClass(this.@Class).Take(1).ToArray(); + + this.ActiveSkills = new ActiveSkillSavedData[6] { + new ActiveSkillSavedData { snoSkill = ActiveSkillsList[0], snoRune = -1 }, + new ActiveSkillSavedData { snoSkill = Skills.None, snoRune = -1 }, + new ActiveSkillSavedData { snoSkill = Skills.None, snoRune = -1 }, + new ActiveSkillSavedData { snoSkill = Skills.None, snoRune = -1 }, + new ActiveSkillSavedData { snoSkill = Skills.None, snoRune = -1 }, + new ActiveSkillSavedData { snoSkill = Skills.None, snoRune = -1 } + }; + + this.PassiveSkills = new int[3] { + -1,-1,-1, + }; + + + dbToon.DBActiveSkills = new DBActiveSkills + { + Skill0 = ActiveSkillsList[0], + Skill1 = -1, + Skill2 = -1, + Skill3 = -1, + Skill4 = -1, + Skill5 = -1, + Rune0 = -1, + Rune1 = -1, + Rune2 = -1, + Rune3 = -1, + Rune4 = -1, + Rune5 = -1, + Passive0 = -1, + Passive1 = -1, + Passive2 = -1 + }; + DBSessions.AccountSession.SaveOrUpdate(dbToon.DBActiveSkills); + DBSessions.AccountSession.Flush(); + + } + else + { + this.ActiveSkills = new ActiveSkillSavedData[6] { + new ActiveSkillSavedData { snoSkill = dbToon.DBActiveSkills.Skill0, + snoRune = dbToon.DBActiveSkills.Rune0 }, + new ActiveSkillSavedData { snoSkill = dbToon.DBActiveSkills.Skill1, + snoRune = dbToon.DBActiveSkills.Rune1 }, + new ActiveSkillSavedData { snoSkill = dbToon.DBActiveSkills.Skill2, + snoRune = dbToon.DBActiveSkills.Rune2 }, + new ActiveSkillSavedData { snoSkill = dbToon.DBActiveSkills.Skill3, + snoRune = dbToon.DBActiveSkills.Rune3 }, + new ActiveSkillSavedData { snoSkill = dbToon.DBActiveSkills.Skill4, + snoRune = dbToon.DBActiveSkills.Rune4 }, + new ActiveSkillSavedData { snoSkill = dbToon.DBActiveSkills.Skill5, + snoRune = dbToon.DBActiveSkills.Rune5 }, + }; + this.PassiveSkills = new int[3] { + dbToon.DBActiveSkills.Passive0, + dbToon.DBActiveSkills.Passive1, + dbToon.DBActiveSkills.Passive2, + }; + } + + this.HotBarSkills = new HotbarButtonData[6] { + new HotbarButtonData { SNOSkill = ActiveSkills[0].snoSkill, Field1 = -1, ItemGBId = -1 }, // left-click + new HotbarButtonData { SNOSkill = ActiveSkills[1].snoSkill, Field1 = -1, ItemGBId = -1 }, // right-click + new HotbarButtonData { SNOSkill = ActiveSkills[2].snoSkill, Field1 = -1, ItemGBId = -1 }, // bar-1 + new HotbarButtonData { SNOSkill = ActiveSkills[3].snoSkill, Field1 = -1, ItemGBId = -1 }, // bar-2 + new HotbarButtonData { SNOSkill = ActiveSkills[4].snoSkill, Field1 = -1, ItemGBId = -1 }, // bar-3 + new HotbarButtonData { SNOSkill = ActiveSkills[5].snoSkill, Field1 = -1, ItemGBId = -1 }, // bar-4 + }; + } + + public void UpdateSkills(int hotBarIndex, int SNOSkill, int SNORune, Toon toon) + { + Logger.Debug("Update index {0} skill {1} rune {2}", hotBarIndex, SNOSkill, SNORune); + var dbToon = DBSessions.AccountSession.Get(toon.PersistentID); + switch (hotBarIndex) + { + case 0: + dbToon.DBActiveSkills.Skill0 = SNOSkill; + dbToon.DBActiveSkills.Rune0 = SNORune; + break; + case 1: + dbToon.DBActiveSkills.Skill1 = SNOSkill; + dbToon.DBActiveSkills.Rune1 = SNORune; + break; + case 2: + dbToon.DBActiveSkills.Skill2 = SNOSkill; + dbToon.DBActiveSkills.Rune2 = SNORune; + break; + case 3: + dbToon.DBActiveSkills.Skill3 = SNOSkill; + dbToon.DBActiveSkills.Rune3 = SNORune; + break; + case 4: + dbToon.DBActiveSkills.Skill4 = SNOSkill; + dbToon.DBActiveSkills.Rune4 = SNORune; + break; + case 5: + dbToon.DBActiveSkills.Skill5 = SNOSkill; + dbToon.DBActiveSkills.Rune5 = SNORune; + break; + } + DBSessions.AccountSession.SaveOrUpdate(dbToon.DBActiveSkills); + DBSessions.AccountSession.Flush(); + + } + + public void SwitchUpdateSkills(int oldSNOSkill, int SNOSkill, int SNORune, Toon toon) + { + for (int i = 0; i < this.HotBarSkills.Length; i++) + { + if (this.HotBarSkills[i].SNOSkill == oldSNOSkill) + { + Logger.Debug("SkillSet: SwitchUpdateSkill Oldskill {0} Newskill {1}", oldSNOSkill, SNOSkill); + this.HotBarSkills[i].SNOSkill = SNOSkill; + this.UpdateSkills(i, SNOSkill, SNORune, toon); + return; + } + } + } + + public void UpdatePassiveSkills(Toon toon) + { + Logger.Debug("Update passive to {0} {1} {2}", PassiveSkills[0], PassiveSkills[1], PassiveSkills[2]); + var dbToon = DBSessions.AccountSession.Get(toon.PersistentID); + dbToon.DBActiveSkills.Passive0 = PassiveSkills[0]; + dbToon.DBActiveSkills.Passive1 = PassiveSkills[1]; + dbToon.DBActiveSkills.Passive2 = PassiveSkills[2]; + + DBSessions.AccountSession.SaveOrUpdate(dbToon.DBActiveSkills); + DBSessions.AccountSession.Flush(); + + } + } +} diff --git a/src/Mooege/Core/GS/Skills/Skills.cs b/src/Mooege/Core/GS/Skills/Skills.cs new file mode 100644 index 00000000..60140f66 --- /dev/null +++ b/src/Mooege/Core/GS/Skills/Skills.cs @@ -0,0 +1,695 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Linq; +using System.Collections.Generic; +using Mooege.Core.MooNet.Toons; + +// TODO: Might be able to make all toon-class classes into enums instead of having a bunch of const fields and +// lists, with maybe an implicit cast operator for each one + +namespace Mooege.Core.GS.Skills +{ + public class Skills + { + public static int None = -1; + public static int BasicAttack = 0x00007780; + + public static List GetAllActiveSkillsByClass(ToonClass @class) + { + switch (@class) + { + case ToonClass.Barbarian: + return Barbarian.AllActiveSkillsList; + case ToonClass.DemonHunter: + return DemonHunter.AllActiveSkillsList; + case ToonClass.Monk: + return Monk.AllActiveSkillsList; + case ToonClass.WitchDoctor: + return WitchDoctor.AllActiveSkillsList; + case ToonClass.Wizard: + return Wizard.AllActiveSkillsList; + default: + return null; + } + } + + public static List GetPrimarySkillsByClass(ToonClass @class) + { + switch (@class) + { + case ToonClass.Barbarian: + return Barbarian.FuryGenerators.List; + case ToonClass.DemonHunter: + return DemonHunter.HatredGenerators.List; + case ToonClass.Monk: + return Monk.SpiritGenerator.List; + case ToonClass.WitchDoctor: + return WitchDoctor.PhysicalRealm.List; + case ToonClass.Wizard: + return Wizard.Signature.List; + default: + return null; + } + } + + public static List GetSecondarySkillsByClass(ToonClass @class) + { + switch (@class) + { + case ToonClass.Barbarian: + return Barbarian.FurySpenders.List; + case ToonClass.DemonHunter: + return DemonHunter.HatredSpenders.List; + case ToonClass.Monk: + return Monk.SpiritSpenders.List; + case ToonClass.WitchDoctor: + return WitchDoctor.SpiritRealm.List; + case ToonClass.Wizard: + return Wizard.Offensive.List; + default: + return null; + } + } + + public static List GetExtraSkillsByClass(ToonClass @class) + { + switch (@class) + { + case ToonClass.Barbarian: + return Barbarian.Situational.List; + case ToonClass.DemonHunter: + return DemonHunter.Discipline.List; + case ToonClass.Monk: + return Monk.Mantras.List; + case ToonClass.WitchDoctor: + return WitchDoctor.Support.List; + case ToonClass.Wizard: + return Wizard.Utility.List; + default: + return null; + } + } + + public static List GetPassiveSkills(ToonClass @class) + { + switch (@class) + { + case ToonClass.Barbarian: + return Barbarian.Passives.List; + case ToonClass.DemonHunter: + return DemonHunter.Passives.List; + case ToonClass.Monk: + return Monk.Passives.List; + case ToonClass.WitchDoctor: + return WitchDoctor.Passives.List; + case ToonClass.Wizard: + return Wizard.Passives.List; + default: + return null; + } + } + + #region barbarian + + public class Barbarian + { + public static readonly List AllActiveSkillsList = + FuryGenerators.List.Concat(FurySpenders.List).Concat(Situational.List).ToList(); + + public class FuryGenerators + { + public const int Bash = 0x0001358A; + public const int Cleave = 0x00013987; + public const int LeapAttack = 0x00016CE1; + public const int GroundStomp = 0x00013656; + public const int Frenzy = 0x000132D4; + public const int WarCry = 0x00013ECC; + public const int FuriousCharge = 0x00017C9B; + public const int AncientSpear = 0x0001115B; + + public static readonly List List = new List + { + Bash, + Cleave, + LeapAttack, + GroundStomp, + Frenzy, + WarCry, + FuriousCharge, + AncientSpear + }; + } + + public class FurySpenders + { + public const int HammerOfTheAncients = 0x0001389C; + public const int ThreateningShout = 0x000134E5; + public const int BattleRage = 0x000134E4; + public const int WeaponThrow = 0x00016EBD; + public const int Rend = 0x00011348; + public const int SiesmicSlam = 0x000153CD; + public const int Sprint = 0x000132D7; + public const int Whirlwind = 0x00017828; + + public static readonly List List = new List + { + HammerOfTheAncients, + ThreateningShout, + BattleRage, + WeaponThrow, + Rend, + SiesmicSlam, + Sprint, + Whirlwind + }; + } + + public class Situational + { + public const int IgnorePain = 0x000136A8; + public const int Revenge = 0x0001AB1E; + public const int Overpower = 0x00026DC1; + public const int Earthquake = 0x0001823E; + public const int CallOfTheAncients = 0x000138B1; + public const int WrathOfTheBerserker = 0x000136F7; + + public static readonly List List = new List + { + IgnorePain, + Revenge, + Overpower, + Earthquake, + CallOfTheAncients, + WrathOfTheBerserker + }; + } + + public class Passives + { + public const int BloodThirst = 0x000321A1; + public const int PoundOfFlesh = 0x00032195; + public const int Ruthless = 0x00032177; + public const int WeaponsMaster = 0x00032543; + public const int InspiringPresence = 0x000322EA; + public const int BerserkerRage = 0x00032183; + public const int Animosity = 0x000321AC; + public const int Superstition = 0x000322B3; + public const int ToughAsNails = 0x00032418; + public const int NoEscape = 0x00031FB5; + public const int Relentless = 0x00032256; + public const int Brawler = 0x0003214D; + public const int Juggernaut = 0x0003238B; + public const int BoonOfBulKathos = 0x00031F3B; + public const int Unforgiving = 0x000321F4; + + public static readonly List List = new List + { + BloodThirst, + PoundOfFlesh, + Ruthless, + WeaponsMaster, + InspiringPresence, + BerserkerRage, + Animosity, + Superstition, + ToughAsNails, + NoEscape, + Relentless, + Brawler, + Juggernaut, + BoonOfBulKathos, + Unforgiving + }; + } + } + + #endregion + + #region demon-hunter + + public class DemonHunter + { + public static readonly List AllActiveSkillsList = + HatredGenerators.List.Concat(HatredSpenders.List).Concat(Discipline.List).ToList(); + + + public class HatredGenerators + { + public const int HungeringArrow = 0x0001F8BF; + public const int EvasiveFire = 0x00020C41; + public const int BolaShot = 0x00012EF0; + public const int EntanglingShot = 0x00012861; + public const int Grenades = 0x00015252; + public const int SpikeTrap = 0x00012625; + public const int Strafe = 0x00020B8E; + + public static readonly List List = new List + { + HungeringArrow, + EvasiveFire, + BolaShot, + EntanglingShot, + Grenades, + SpikeTrap, + Strafe + }; + } + + public class HatredSpenders + { + public const int Impale = 0x00020126; + public const int RapidFire = 0x00020078; + public const int Chakram = 0x0001F8BD; + public const int ElementalArrow = 0x000200FD; + public const int FanOfKnives = 0x00012EEA; + public const int Multishot = 0x00012F51; + public const int ClusterArrow = 0x0001F8BE; + public const int RainOfVengeance = 0x001FF0F; + + public static readonly List List = new List + { + Impale, + RapidFire, + Chakram, + ElementalArrow, + FanOfKnives, + Multishot, + ClusterArrow, + RainOfVengeance + }; + } + + public class Discipline + { + public const int Caltrops = 0x0001F8C0; + public const int Vault = 0x0001B26F; + public const int ShadowPower = 0x0001FF0E; + public const int Companion = 0x00020A3F; + public const int SmokeScreen = 0x0001FE87; + public const int Sentry = 0x0001F8C1; + public const int MarkedForDeath = 0x0001FEB2; + public const int Preparation = 0x0001F8BC; + + public static readonly List List = new List + { + Caltrops, + Vault, + ShadowPower, + Companion, + SmokeScreen, + Sentry, + MarkedForDeath, + Preparation + }; + } + + public class Passives + { + public const int Brooding = 0x00033771; + public const int ThrillOfTheHunt = 0x00033919; + public const int Vengeance = 0x00026042; + public const int SteadyAim = 0x0002820B; + public const int CullTheWeak = 0x00026049; + public const int Fundamentals = 0x00026047; + public const int HotPursuit = 0x0002604D; + public const int Archery = 0x00033346; + public const int Perfectionist = 0x0002604A; + public const int CustomEngineering = 0x00032EE2; + public const int Grenadier = 0x00032F8B; + public const int Sharpshooter = 0x00026043; + public const int Ballistics = 0x0002604B; + + public static readonly List List = new List + { + Brooding, + ThrillOfTheHunt, + Vengeance, + SteadyAim, + CullTheWeak, + Fundamentals, + HotPursuit, + Archery, + Perfectionist, + CustomEngineering, + Grenadier, + Sharpshooter, + Ballistics + }; + } + } + + #endregion + + #region monk + + public class Monk + { + public static readonly List AllActiveSkillsList = + SpiritGenerator.List.Concat(SpiritSpenders.List).Concat(Mantras.List).ToList(); + + public class SpiritGenerator + { + public const int FistsOfThunder = 0x000176C4; + public const int DeadlyReach = 0x00017713; + public const int CripplingWave = 0x00017837; + public const int ExplodingPalm = 0x00017C30; + public const int SweepingWind = 0x0001775A; + public const int WayOfTheHundredFists = 0x00017B56; + + public static readonly List List = new List + { + FistsOfThunder, + DeadlyReach, + CripplingWave, + ExplodingPalm, + SweepingWind, + WayOfTheHundredFists + }; + } + + public class SpiritSpenders + { + public const int BlindingFlash = 0x000216FA; + public const int BreathOfHeaven = 0x00010E0A; + public const int LashingTailKick = 0x0001B43C; + public const int DashingStrike = 0x000177CB; + public const int LethalDecoy = 0x00011044; + public const int InnerSanctuary = 0x00017BC6; + public const int TempestRush = 0x0001DA62; + public const int Serenity = 0x000177D7; + public const int SevenSidedStrike = 0x000179B6; + public const int MysticAlly = 0x0001E148; + public const int WaveOfLight = 0x00017721; + + public static readonly List List = new List + { + BlindingFlash, + BreathOfHeaven, + LashingTailKick, + DashingStrike, + LethalDecoy, + InnerSanctuary, + TempestRush, + Serenity, + SevenSidedStrike, + MysticAlly, + WaveOfLight + }; + } + + public class Mantras + { + public const int MantraOfEvasion = 0x0002EF95; + public const int MantraOfRetribution = 0x00010F6C; + public const int MantraOfHealing = 0x00010F72; + public const int MantraOfConviction = 0x00017554; + + public static readonly List List = new List + { + MantraOfEvasion, + MantraOfRetribution, + MantraOfHealing, + MantraOfConviction + }; + } + + public class Passives + { + public const int TheGuardiansPath = 0x00033394; + public const int SixthSense = 0x000332D6; + public const int OneWithEverything = 0x000332F8; + public const int SeizeTheInitiative = 0x000332DC; + public const int Transcendence = 0x00033162; + public const int ChantOfResonance = 0x00026333; + public const int BeaconOfYtar = 0x000330D0; + public const int FleetFooted = 0x00033085; + public const int ExaltedSoul = 0x00033083; + public const int Pacifism = 0x00033395; + public const int GuidingLight = 0x0002634C; + public const int NearDeathExperience = 0x00026344; + public const int Resolve = 0x00033A7D; + + public static readonly List List = new List + { + TheGuardiansPath, + SixthSense, + OneWithEverything, + SeizeTheInitiative, + Transcendence, + ChantOfResonance, + BeaconOfYtar, + FleetFooted, + ExaltedSoul, + Pacifism, + GuidingLight, + NearDeathExperience, + Resolve + }; + } + } + + #endregion + + #region witch-hunter + + public class WitchDoctor + { + public static readonly List AllActiveSkillsList = + PhysicalRealm.List.Concat(SpiritRealm.List).Concat(Support.List).ToList(); + + public class PhysicalRealm + { + public const int PoisonDart = 0x0001930D; + public const int PlagueOfToads = 0x00019FE1; + public const int ZombieCharger = 0x00012113; + public const int CorpseSpiders = 0x000110EA; + public const int Firebats = 0x00019DEB; + public const int Firebomb = 0x000107EF; + public const int LocustSwarm = 0x000110EB; + public const int AcidCloud = 0x00011337; + public const int WallOfZombies = 0x00020EB5; + + public static readonly List List = new List + { + PoisonDart, + PlagueOfToads, + ZombieCharger, + CorpseSpiders, + Firebats, + Firebomb, + LocustSwarm, + AcidCloud, + WallOfZombies + }; + } + + public class SpiritRealm + { + public const int Haunt = 0x00014692; + public const int Horrify = 0x00010854; + public const int SpiritWalk = 0x00019EFD; + public const int SoulHarvest = 0x00010820; + public const int SpiritBarrage = 0x0001A7DA; + public const int MassConfusion = 0x00010810; + + public static readonly List List = new List + { + Haunt, + Horrify, + SpiritWalk, + SoulHarvest, + SpiritBarrage, + MassConfusion + }; + } + + public class Support + { + public const int SummonZombieDogs = 0x000190AD; + public const int GraspOfTheDead = 0x00010E3E; + public const int Hex = 0x000077A7; + public const int Sacrifice = 0x000190AC; + public const int Gargantuan = 0x000077A0; + public const int BigBadVoodoo = 0x0001CA9A; + public const int FetishArmy = 0x000011C51; + + public static readonly List List = new List + { + SummonZombieDogs, + GraspOfTheDead, + Hex, + Sacrifice, + Gargantuan, + BigBadVoodoo, + FetishArmy + }; + } + + public class Passives + { + public const int CircleOfLife = 0x00032EBB; + public const int Vermin = 0x00032EB7; + public const int SpiritualAttunement = 0x00032EB9; + public const int GruesomeFeast = 0x00032ED2; + public const int BloodRitual = 0x00032EB8; + public const int ZombieHandler = 0x00032EB3; + public const int PierceTheVeil = 0x00032EF4; + public const int RushOfEssence = 0x00032EB5; + public const int VisionQuest = 0x00033091; + public const int FierceLoyalty = 0x00032EFF; + public const int DeathTrance = 0x00032EB4; + public const int TribalRites = 0x00032ED9; + + public static readonly List List = new List + { + CircleOfLife, + Vermin, + SpiritualAttunement, + GruesomeFeast, + BloodRitual, + ZombieHandler, + PierceTheVeil, + RushOfEssence, + VisionQuest, + FierceLoyalty, + DeathTrance, + TribalRites, + }; + } + } + + #endregion + + #region wizard + + public class Wizard + { + public static readonly List AllActiveSkillsList = + Signature.List.Concat(Offensive.List).Concat(Utility.List).ToList(); + + public class Signature + { + public const int MagicMissile = 0x00007818; + public const int ShockPulse = 0x0000783F; + public const int SpectralBlade = 0x0001177C; + public const int Electrocute = 0x000006E5; + + public static readonly List List = new List + { + MagicMissile, + ShockPulse, + SpectralBlade, + Electrocute + }; + } + + public class Offensive + { + public const int WaveOfForce = 0x0000784C; + public const int ArcaneOrb = 0x000077CC; + public const int EnergyTwister = 0x00012D39; + public const int Disintegrate = 0x0001659D; + public const int ExplosiveBlast = 0x000155E5; + public const int Hydra = 0x00007805; + public const int RayOfFrost = 0x00016CD3; + public const int ArcaneTorrent = 0x00020D38; + public const int Meteor = 0x00010E46; + public const int Blizzard = 0x000077D8; + + public static readonly List List = new List + { + WaveOfForce, + ArcaneOrb, + EnergyTwister, + Disintegrate, + ExplosiveBlast, + Hydra, + RayOfFrost, + ArcaneTorrent, + Meteor, + Blizzard + }; + } + + public class Utility + { + public const int FrostNova = 0x000077FE; + public const int IceArmor = 0x00011E07; + public const int MagicWeapon = 0x0001294C; + public const int DiamondSkin = 0x0001274F; + public const int StormArmor = 0x00012303; + public const int MirrorImage = 0x00017EEB; + public const int SlowTime = 0x000006E9; + public const int Teleport = 0x00029198; + public const int EnergyArmor = 0x000153CF; + public const int Familiar = 0x00018330; + public const int Archon = 0x00020ED8; + + public static readonly List List = new List + { + FrostNova, + IceArmor, + MagicWeapon, + DiamondSkin, + StormArmor, + MirrorImage, + SlowTime, + Teleport, + EnergyArmor, + Familiar, + Archon + }; + } + + public class Passives + { + public const int PowerHungry = 0x00032E5E; + public const int TemporalFlux = 0x00032E5D; + public const int GlassCannon = 0x00032E57; + public const int Prodigy = 0x00032E6D; + public const int Virtuoso = 0x00032E65; + public const int AstralPresence = 0x00032E58; + public const int Illusionist = 0x00032EA3; + public const int GalvanizingWard = 0x00032E9D; + public const int Blur = 0x00032E54; + public const int Evocation = 0x00032E59; + public const int ArcaneDynamo = 0x00032FB7; + public const int UnstableAnomaly = 0x00032E5A; + + public static readonly List List = new List + { + PowerHungry, + TemporalFlux, + GlassCannon, + Prodigy, + Virtuoso, + AstralPresence, + Illusionist, + GalvanizingWard, + Blur, + Evocation, + ArcaneDynamo, + UnstableAnomaly + }; + } + } + + #endregion + } +} diff --git a/src/Mooege/Core/GS/Ticker/SteppedTickTimer.cs b/src/Mooege/Core/GS/Ticker/SteppedTickTimer.cs new file mode 100644 index 00000000..bb489d81 --- /dev/null +++ b/src/Mooege/Core/GS/Ticker/SteppedTickTimer.cs @@ -0,0 +1,185 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using Mooege.Core.GS.Games; + +namespace Mooege.Core.GS.Ticker +{ + /// + /// A stepped tick timer that can fire actions on given ticks per step and fire a final one on completition. + /// + public class SteppedTickTimer : TickTimer + { + /// + /// Ticks per step. + /// + public int TicksPerStep { get; private set; } + + /// + /// Action to be fired on each step. + /// + public Action StepAction { get; private set; } + + /// + /// The last fired steps tick. + /// + public int LastStepTick { get; private set; } + + /// + /// Creates a new stepped tick timer. + /// + /// The game timer belongs to. + /// Ticks taken per step. + /// Exact tick value to timeout. + /// The action to be called on each step. + /// The completition action to be called on timeout. + public SteppedTickTimer(Game game, int ticksPerStep, int timeoutTick, Action stepCallback, Action completionCallback = null) + : base(game, timeoutTick, completionCallback) + { + if (ticksPerStep < game.TickRate) + throw new ArgumentOutOfRangeException("ticksPerStep", string.Format("ticksPerStep value ({0}) can not be less then timer's belonging game's TickRate ({1}).", ticksPerStep, game.TickRate)); + + this.TicksPerStep = ticksPerStep; + this.StepAction = stepCallback; + this.LastStepTick = game.TickCounter; + } + + /// + /// Updates the timer. + /// + /// The current tick-counter. + public override void Update(int tickCounter) + { + if (this.TimeoutTick == -1) // means timer is already timed-out. + return; + + if (!this.TimedOut) // if we haven't timed out yet, check for steps. + { + if ((tickCounter - this.LastStepTick) >= TicksPerStep) // check if we've progressed a step. + { + this.LastStepTick = tickCounter; + this.StepAction(tickCounter); // call the step-action. + } + } + else // if we timed-out. + { + if (this.CompletionAction != null) // if a completition action exists. + this.CompletionAction(tickCounter); //call it once the timer time-outs. + + this.Stop(); // stop the timer. + } + } + + /// + /// Creates a new stepped tick timer. + /// + /// The game timer belongs to. + /// Ticks taken per step. + /// Relative tick amount taken to timeout. + /// The action to be called on each step. + /// The completition action to be called on timeout. + /// + public static SteppedTickTimer WaitTicksStepped(Game game, int ticksPerStep, int ticks, Action stepCallback, Action completionCallback) + { + return new SteppedRelativeTickTimer(game, ticksPerStep, ticks, stepCallback, completionCallback); + } + + /// + /// Creates a new seconds based stepped tick timer. + /// + /// The game timer belongs to. + /// Seconds taken per step. + /// Seconds taken to timeout. + /// The action to be called on each step. + /// The completition action to be called on timeout. + /// + public static SteppedTickTimer WaitSecondsStepped(Game game, float secondsPerStep, float seconds, Action stepCallback, Action completionCallback) + { + return new SteppedSecondsTickTimer(game, secondsPerStep, seconds, stepCallback, completionCallback); + } + + /// + /// Creates a new mili-seconds based stepped tick timer. + /// + /// The game timer belongs to. + /// MiliSeconds taken per step. + /// MiliSeconds taken to timeout. + /// The action to be called on each step. + /// The completition action to be called on timeout. + /// + public static SteppedTickTimer WaitMiliSecondsStepped(Game game, float miliSecondsPerStep, float miliSeconds, Action stepCallback, Action completionCallback) + { + return new SteppedMiliSecondsTickTimer(game, miliSecondsPerStep, miliSeconds, stepCallback, completionCallback); + } + } + + /// + /// Stepped & relative tick timer. + /// + public class SteppedRelativeTickTimer : SteppedTickTimer + { + /// + /// Creates a new stepped tick timer. + /// + /// The game timer belongs to. + /// Ticks taken per step. + /// Relative tick amount taken to timeout. + /// The action to be called on each step. + /// The completition action to be called on timeout. + public SteppedRelativeTickTimer(Game game, int ticksPerStep, int ticks, Action stepCallback, Action completionCallback) + : base(game, ticksPerStep, game.TickCounter + ticks, stepCallback, completionCallback) + { } + } + + /// + /// Seconds based stepped tick timer. + /// + public class SteppedSecondsTickTimer : SteppedRelativeTickTimer + { + /// + /// Creates a new seconds based stepped tick timer. + /// + /// The game timer belongs to. + /// Seconds taken per step. + /// Seconds taken to timeout. + /// The action to be called on each step. + /// The completition action to be called on timeout. + public SteppedSecondsTickTimer(Game game, float secondsPerStep, float seconds, Action stepCallback, Action completionCallback) + : base(game, (int)(1000f / game.UpdateFrequency * game.TickRate * secondsPerStep), (int)(1000f / game.UpdateFrequency * game.TickRate * seconds), stepCallback, completionCallback) + { } + } + + /// + /// Mili-seconds based stepped tick timer. + /// + public class SteppedMiliSecondsTickTimer : SteppedRelativeTickTimer + { + /// + /// Creates a new mili-seconds based stepped tick timer. + /// + /// The game timer belongs to. + /// MiliSeconds taken per step. + /// MiliSeconds taken to timeout. + /// The action to be called on each step. + /// The completition action to be called on timeout. + public SteppedMiliSecondsTickTimer(Game game, float miliSecondsPerStep, float miliSeconds, Action stepCallback, Action completionCallback) + : base(game, (int)((1000f / game.UpdateFrequency * game.TickRate) / 1000f * miliSecondsPerStep), (int)((1000f / game.UpdateFrequency * game.TickRate) / 1000f * miliSeconds), stepCallback, completionCallback) + { } + } +} diff --git a/src/Mooege/Core/GS/Ticker/TickTimer.cs b/src/Mooege/Core/GS/Ticker/TickTimer.cs new file mode 100644 index 00000000..5361f106 --- /dev/null +++ b/src/Mooege/Core/GS/Ticker/TickTimer.cs @@ -0,0 +1,192 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using Mooege.Core.GS.Games; +using Mooege.Core.GS.Objects; + +namespace Mooege.Core.GS.Ticker +{ + /// + /// A stepped tick timer that can fire a completion action on timeout. + /// + public class TickTimer : IUpdateable + { + /// + /// Exact tick value to timeout. + /// + public int TimeoutTick { get; private set; } + + /// + /// The game timer belongs to. + /// + public Game Game { get; private set; } + + /// + /// The completition action to be called on timeout. + /// + public Action CompletionAction { get; private set; } + + /// + /// Creates a new tick timer that can fire a completition action timeout. + /// + /// The game timer belongs to + /// Exact tick value to timeout + /// The completition action to be called on timeout + public TickTimer(Game game, int timeoutTick, Action completionCallback = null) + { + // Some code that was calculating movement ticks was rounding the tick difference to 0 for really small + // movements sometimes and thus would cause this exception. Enforcing every timer created to not + // already be timed out doesn't seem necessary and having to worry about it just complicates things. /mdz + //if (timeoutTick <= game.TickCounter) + // throw new ArgumentOutOfRangeException("timeoutTick", string.Format("timeoutTick value {0} can not be equal or less then timer's belonging game's current TickCounter value {1}.", timeoutTick, game.TickCounter)); + + this.Game = game; + this.TimeoutTick = timeoutTick; + this.CompletionAction = completionCallback; + } + + /// + /// Returns true if the timer is timed-out. + /// + public bool TimedOut + { + get { return Game.TickCounter >= TimeoutTick; } + } + + /// + /// Returns true if timer is still running. + /// + public bool Running + { + get { return !this.TimedOut; } + } + + /// + /// Updates the timer. + /// + /// The current tick-counter. + public virtual void Update(int tickCounter) + { + if (this.TimeoutTick == -1) // means timer is already fired there. + return; + + if (!this.TimedOut) // if we haven't timed-out yet, return. + return; + + if (this.CompletionAction != null) // if a completition action exists. + this.CompletionAction(tickCounter); //call it once the timer time-outs. + + this.Stop(); + } + + /// + /// Stops the timer. + /// + public void Stop() + { + this.TimeoutTick = -1; + } + + /// + /// Creates a new tick timer. + /// + /// The game timer belongs to. + /// Relative tick amount taken to timeout. + /// The completition action to be called on timeout. + /// + public static TickTimer WaitTicks(Game game, int ticks, Action completionCallback = null) + { + return new RelativeTickTimer(game, ticks, completionCallback); + } + + /// + /// Creates a new seconds based tick timer. + /// + /// The game timer belongs to. + /// Seconds taken to timeout. + /// The completition action to be called on timeout. + /// + public static TickTimer WaitSeconds(Game game, float seconds, Action completionCallback = null) + { + return new SecondsTickTimer(game, seconds, completionCallback); + } + + /// + /// Creates a new mili-seconds based tick timer. + /// + /// The game timer belongs to. + /// MiliSeconds taken to timeout. + /// The completition action to be called on timeout. + /// + public static TickTimer WaitMiliSeconds(Game game, float miliSeconds, Action completionCallback = null) + { + return new MiliSecondsTickTimer(game, miliSeconds, completionCallback); + } + } + + /// + /// Relative tick timer. + /// + public class RelativeTickTimer : TickTimer + { + /// + /// Creates a new relative tick timer. + /// + /// The game timer belongs to. + /// Relative tick amount taken to timeout. + /// The completition action to be called on timeout. + public RelativeTickTimer(Game game, int ticks, Action completionCallback = null) + : base(game, game.TickCounter + ticks, completionCallback) + { } + } + + /// + /// Seconds based tick timer. + /// + public class SecondsTickTimer : RelativeTickTimer + { + /// + /// Creates a new seconds based tick timer. + /// + /// The game timer belongs to. + /// Seconds taken to timeout. + /// The completition action to be called on timeout. + /// + public SecondsTickTimer(Game game, float seconds, Action completionCallback = null) + : base(game, (int)(1000f / game.UpdateFrequency * game.TickRate * seconds), completionCallback) + { } + } + + /// + /// Mili-seconds based tick timer. + /// + public class MiliSecondsTickTimer : RelativeTickTimer + { + /// + /// Creates a new mili-seconds based tick timer. + /// + /// The game timer belongs to. + /// MiliSeconds taken to timeout. + /// The completition action to be called on timeout. + /// + public MiliSecondsTickTimer(Game game, float miliSeconds, Action completionCallback = null) + : base(game, (int)((1000f / game.UpdateFrequency * game.TickRate) / 1000f * miliSeconds), completionCallback) + { } + } +} diff --git a/src/Mooege/Core/GS/Web/GSWebService.cs b/src/Mooege/Core/GS/Web/GSWebService.cs new file mode 100644 index 00000000..c9bd4afb --- /dev/null +++ b/src/Mooege/Core/GS/Web/GSWebService.cs @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.ServiceModel; +using Mooege.Net.WebServices; + +namespace Mooege.Core.GS.Web +{ + /// + /// Web service that can return statistics on online players and so. + /// + [ServiceContract(Name = "GS")] + public class GSWebService : IWebService + { + /// + /// Always returns true, so that clients can see if the gs-server is online. + /// + /// true + [OperationContract] + public bool Ping() + { + return true; + } + } +} diff --git a/src/Mooege/Core/MooNet/Accounts/Account.cs b/src/Mooege/Core/MooNet/Accounts/Account.cs new file mode 100644 index 00000000..dc1b4ba5 --- /dev/null +++ b/src/Mooege/Core/MooNet/Accounts/Account.cs @@ -0,0 +1,389 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Data.SQLite; +using System.Linq; +using Mooege.Common.Storage; +using Mooege.Common.Helpers.Hash; +using Mooege.Common.Storage.AccountDataBase.Entities; +using Mooege.Core.Cryptography; +using Mooege.Core.MooNet.Helpers; +using Mooege.Core.MooNet.Objects; + +namespace Mooege.Core.MooNet.Accounts +{ + public class Account : PersistentRPCObject + { + public DBAccount DBAccount { get; private set; } + + //public D3.PartyMessage.ScreenStatus ScreenStatus { get; set; } + + public ByteStringPresenceField LastPlayedGameAccountIdField + { + get + { + var val = new ByteStringPresenceField(FieldKeyHelper.Program.D3, FieldKeyHelper.OriginatingClass.Account, 2, 0, this.LastSelectedGameAccount); + return val; + } + } + + + public StringPresenceField RealIDTagField + { + get + { + return new StringPresenceField(FieldKeyHelper.Program.BNet, FieldKeyHelper.OriginatingClass.Account, 1, 0, this.DBAccount.BattleTagName); + } + } + + + //public BoolPresenceField AccountOnlineField + // = new BoolPresenceField(FieldKeyHelper.Program.BNet, FieldKeyHelper.OriginatingClass.Account, 2, 0); + + public StringPresenceField AccountBattleTagField + { + get + { + var val = new StringPresenceField(FieldKeyHelper.Program.BNet, FieldKeyHelper.OriginatingClass.Account, 4, 0, this.BattleTagName + "#" + HashCode.ToString("D4")); + return val; + } + } + + + public EntityIdPresenceFieldList GameAccountListField + { + get + { + var val = new EntityIdPresenceFieldList(FieldKeyHelper.Program.BNet, FieldKeyHelper.OriginatingClass.Account, 3, 0); + val.Value.AddRange(this.GameAccounts.Select(ga => ga.BnetEntityId)); + return val; + } + } + + + + public IntPresenceField LastOnlineField + { + get + { + var val = new IntPresenceField(FieldKeyHelper.Program.BNet, FieldKeyHelper.OriginatingClass.Account, 6, 0, 0); + val.Value = this.DBAccount.LastOnline; + return val; + } + + set { this.DBAccount.LastOnline = value.Value; } + + } + + + public bool IsOnline + { + get + { + //check if anygameAccounts are online + return GameAccounts.Any(gameAccount => gameAccount.IsOnline); + } + } + + public string Email { get { return this.DBAccount.Email; } private set { this.DBAccount.Email = value; } } // I - Username + public byte[] Salt { get { return this.DBAccount.Salt; } internal set { this.DBAccount.Salt = value; } } // s- User's salt. + public byte[] PasswordVerifier { get { return this.DBAccount.PasswordVerifier; } internal set { this.DBAccount.PasswordVerifier = value; } } // v - password verifier. + + public int HashCode { get { return this.DBAccount.HashCode; } private set { this.DBAccount.HashCode = value; } } + + public string BattleTagName { get { return this.DBAccount.BattleTagName; } private set { this.DBAccount.BattleTagName = value; } } + + public string BattleTag + { + get + { + return this.BattleTagName + "#" + this.HashCode.ToString("D4"); + } + set + { + if (!value.Contains('#')) + throw new Exception("BattleTag must contain '#'"); + + var split = value.Split('#'); + this.DBAccount.BattleTagName = split[0]; + this.DBAccount.HashCode = Convert.ToInt32(split[1]); + } + } + + public UserLevels UserLevel { get { return this.DBAccount.UserLevel; } internal set { this.DBAccount.UserLevel = value; } } // user level for account. + + public List GameAccounts + { + get { return GameAccountManager.GetGameAccountsForAccount(this); } + } + + //TODO: Eliminate completly this variable as it is stored already in the persistence field; + private GameAccount _currentGameAccount; + public GameAccount CurrentGameAccount + { + get + { + return this._currentGameAccount; + } + set + { + //this.LastSelectedGameAccount = value.D3GameAccountId; + //this.LastPlayedGameAccountIdField.Value = value.D3GameAccountId; + this._currentGameAccount = value; + } + } + + public static readonly D3.OnlineService.EntityId AccountHasNoToons = + D3.OnlineService.EntityId.CreateBuilder().SetIdHigh(0).SetIdLow(0).Build(); + + + + //at the moment, a + public D3.OnlineService.EntityId LastSelectedGameAccount + { + get + { + return this.GameAccounts.First().D3GameAccountId; + } + /* + set + { + _lastSelectedGameAccount = value; + }*/ + } + + public Account(DBAccount dbAccount) + : base(dbAccount.Id) + { + this.DBAccount = dbAccount; + SetFields(); + } + + + private void SetFields() + { + this.BnetEntityId = bnet.protocol.EntityId.CreateBuilder().SetHigh((ulong)EntityIdHelper.HighIdType.AccountId).SetLow(this.PersistentID).Build(); + } + + public bnet.protocol.presence.Field QueryField(bnet.protocol.presence.FieldKey queryKey) + { + var field = bnet.protocol.presence.Field.CreateBuilder().SetKey(queryKey); + + switch ((FieldKeyHelper.Program)queryKey.Program) + { + case FieldKeyHelper.Program.D3: + if (queryKey.Group == 1 && queryKey.Field == 1) // Account's last selected toon. + { + /* + if (this.IsOnline) // check if the account is online actually. + field.SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(this.LastSelectedHero.ToByteString()).Build());*/ + } + else if (queryKey.Group == 1 && queryKey.Field == 2) // Account's last selected Game Account + { + if (this.IsOnline) // check if the account is online actually. + field.SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(this.LastSelectedGameAccount.ToByteString()).Build()); + } + else + { + Logger.Warn("Account Unknown query-key: {0}, {1}, {2}", queryKey.Program, queryKey.Group, queryKey.Field); + } + break; + case FieldKeyHelper.Program.BNet: + if (queryKey.Group == 1 && queryKey.Field == 5) // Account's battleTag + { + field.SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetStringValue(this.BattleTag).Build()); + } + else + { + Logger.Warn("Account Unknown query-key: {0}, {1}, {2}", queryKey.Program, queryKey.Group, queryKey.Field); + } + break; + } + + + return field.HasValue ? field.Build() : null; + } + + #region Notifications + + public override void NotifyUpdate() + { + var operations = ChangedFields.GetChangedFieldList(); + ChangedFields.ClearChanged(); + base.UpdateSubscribers(this.Subscribers, operations); + } + + //account class generated + //D3, Account,1,0 -> D3.OnlineService.EntityId: Last Played Hero + //D3, Account,2,0 -> LastSelectedGameAccount + //Bnet, Account,1,0 -> RealId Name + //Bnet, Account,3,index -> GameAccount EntityIds + //Bnet, Account,4,0 -> BattleTag + + public override List GetSubscriptionNotifications() + { + //TODO: Create delegate inside Persistence field so IsOnline can be removed + //this.AccountOnlineField.Value = this.IsOnline; + //TODO: Create delegate-move this out + + /* + this.GameAccountListField.Value.Clear(); + foreach (var pair in this.GameAccounts) + { + this.GameAccountListField.Value.Add(pair.BnetEntityId); + }*/ + + + var operationList = new List(); + + /*if (this.LastSelectedHero != AccountHasNoToons) + operationList.Add(this.LastPlayedHeroIdField.GetFieldOperation());*/ + if (this.LastSelectedGameAccount != AccountHasNoToons) + operationList.Add(this.LastPlayedGameAccountIdField.GetFieldOperation()); + operationList.Add(this.RealIDTagField.GetFieldOperation()); + //operationList.Add(this.AccountOnlineField.GetFieldOperation()); + operationList.AddRange(this.GameAccountListField.GetFieldOperationList()); + operationList.Add(this.AccountBattleTagField.GetFieldOperation()); + operationList.Add(this.LastOnlineField.GetFieldOperation()); + + return operationList; + } + + + + #endregion + + public bool VerifyPassword(string password) + { + if (string.IsNullOrEmpty(password)) + return false; + + if (password.Length < 8 || password.Length > 16) + return false; + + var calculatedVerifier = SRP6a.CalculatePasswordVerifierForAccount(this.Email, password, this.Salt); + return calculatedVerifier.SequenceEqual(this.PasswordVerifier); + } + + #region DB + + /* + * Account Operations should be made only in AccountManager... just my two cents :) + public void SaveToDB() + { + try + { + if (ExistsInDB()) + { + var query = + string.Format( + "UPDATE accounts SET email='{0}', salt=@salt, passwordVerifier=@passwordVerifier, battletagname='{1}', hashcode={2}, userLevel={3}, LastOnline={4} WHERE id={5}", + this.Email, this.Name, this.HashCode, (byte)this.UserLevel, this.LastOnlineField.Value, this.PersistentID); + + using (var cmd = new SQLiteCommand(query, DBManager.Connection)) + { + cmd.Parameters.Add("@salt", System.Data.DbType.Binary, 32).Value = this.Salt; + cmd.Parameters.Add("@passwordVerifier", System.Data.DbType.Binary, 128).Value = this.PasswordVerifier; + cmd.ExecuteNonQuery(); + } + } + else + { + var query = string.Format("INSERT INTO accounts (id, email, salt, passwordVerifier, battletagname, hashcode, userLevel) VALUES({0}, '{1}', @salt, @passwordVerifier, '{2}', {3}, {4})", + this.PersistentID, this.Email, this.Name, this.HashCode, (byte)this.UserLevel); + + using (var cmd = new SQLiteCommand(query, DBManager.Connection)) + { + cmd.Parameters.Add("@salt", System.Data.DbType.Binary, 32).Value = this.Salt; + cmd.Parameters.Add("@passwordVerifier", System.Data.DbType.Binary, 128).Value = this.PasswordVerifier; + cmd.ExecuteNonQuery(); + } + } + } + catch (Exception e) + { + Logger.ErrorException(e, "SaveToDB()"); + } + } + + public bool UpdatePassword(string newPassword) + { + this.PasswordVerifier = SRP6a.CalculatePasswordVerifierForAccount(this.Email, newPassword, this.Salt); + try + { + var query = string.Format("UPDATE accounts SET passwordVerifier=@passwordVerifier WHERE id={0}", this.PersistentID); + + using (var cmd = new SQLiteCommand(query, DBManager.Connection)) + { + cmd.Parameters.Add("@passwordVerifier", System.Data.DbType.Binary, 128).Value = this.PasswordVerifier; + cmd.ExecuteNonQuery(); + } + } + catch (Exception e) + { + Logger.ErrorException(e, "UpdatePassword()"); + return false; + } + return true; + } + + public void UpdateUserLevel(UserLevels userLevel) + { + this.UserLevel = userLevel; + try + { + var query = string.Format("UPDATE accounts SET userLevel={0} WHERE id={1}", (byte)userLevel, this.PersistentID); + var cmd = new SQLiteCommand(query, DBManager.Connection); + cmd.ExecuteNonQuery(); + } + catch (Exception e) + { + Logger.ErrorException(e, "UpdateUserLevel()"); + } + } + + private bool ExistsInDB() + { + var query = string.Format("SELECT id FROM accounts where id={0}", this.PersistentID); + + var cmd = new SQLiteCommand(query, DBManager.Connection); + var reader = cmd.ExecuteReader(); + return reader.HasRows; + } + */ + #endregion + + public override string ToString() + { + return String.Format("{{ Account: {0} [lowId: {1}] }}", this.Email, this.BnetEntityId.Low); + } + + /// + /// User-levels. + /// + public enum UserLevels : byte + { + User, + GM, + Admin, + Owner + } + } +} diff --git a/src/Mooege/Core/MooNet/Accounts/AccountCommands.cs b/src/Mooege/Core/MooNet/Accounts/AccountCommands.cs new file mode 100644 index 00000000..a428d09f --- /dev/null +++ b/src/Mooege/Core/MooNet/Accounts/AccountCommands.cs @@ -0,0 +1,187 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Linq; +using Mooege.Core.MooNet.Commands; +using Mooege.Net.MooNet; + +namespace Mooege.Core.MooNet.Accounts +{ + [CommandGroup("account", "Provides account managment commands.")] + public class AccountCommands : CommandGroup + { + [Command("show", "Shows information about given account\nUsage: account show ", Account.UserLevels.GM)] + public string Show(string[] @params, MooNetClient invokerClient) + { + if (@params.Count() < 1) + return "Invalid arguments. Type 'help account show' to get help."; + + var email = @params[0]; + var account = AccountManager.GetAccountByEmail(email); + + if (account == null) + return string.Format("No account with email '{0}' exists.", email); + + return string.Format("Email: {0} User Level: {1}", account.Email, account.UserLevel); + } + + [Command("add", "Allows you to add a new user account.\nUsage: account add [userlevel]", Account.UserLevels.GM)] + public string Add(string[] @params, MooNetClient invokerClient) + { + if (@params.Count() < 3) + return "Invalid arguments. Type 'help account add' to get help."; + + var email = @params[0]; + var password = @params[1]; + var battleTagName = @params[2]; + var userLevel = Account.UserLevels.User; + + if (@params.Count() == 4) + { + var level = @params[3].ToLower(); + switch (level) + { + case "owner": + userLevel = Account.UserLevels.Owner; + break; + case "admin": + userLevel = Account.UserLevels.Admin; + break; + case "gm": + userLevel = Account.UserLevels.GM; + break; + case "user": + userLevel = Account.UserLevels.User; + break; + default: + return level + " is not a valid user level."; + } + } + + if (!email.Contains('@')) + return string.Format("'{0}' is not a valid email address.", email); + + if (battleTagName.Contains('#')) + return "BattleTag must not contain '#' or HashCode."; + + if (password.Length < 8 || password.Length > 16) + return "Password should be a minimum of 8 and a maximum of 16 characters."; + + if (AccountManager.GetAccountByEmail(email) != null) + return string.Format("An account already exists for email address {0}.", email); + + var account = AccountManager.CreateAccount(email, password, battleTagName, userLevel); + var gameAccount = GameAccountManager.CreateGameAccount(account); + account.DBAccount.DBGameAccounts.Add(gameAccount.DBGameAccount); + return string.Format("Created new account {0} [user-level: {1}] Full BattleTag: {2}.", account.Email, account.UserLevel, account.BattleTag); + } + + [Command("delete", "Allows you to delete an existing account.\nUsage: account delete ", Account.UserLevels.GM)] + public string Delete(string[] @params, MooNetClient invokerClient) + { + if (@params.Count() == 0) + return "Invalid arguments. Type 'help account delete' to get help."; + + var account = AccountManager.GetAccountByEmail(@params[0]); + + if (account == null) + return string.Format("No account with email '{0}' exists.", @params); + + //Delete game accounts for account + //which in turn will delete toons for each game account + foreach (var gameAccount in GameAccountManager.GetGameAccountsForAccount(account)) + { + GameAccountManager.DeleteGameAccount(gameAccount); + } + + AccountManager.DeleteAccount(account); + + return string.Format("Deleted account {0}.", @params); + } + + [Command("setpassword", "Allows you to set a new password for account\nUsage: account setpassword ", Account.UserLevels.GM)] + public string SetPassword(string[] @params, MooNetClient invokerClient) + { + if (@params.Count() < 2) + return "Invalid arguments. Type 'help account setpassword' to get help."; + + var email = @params[0]; + var password = @params[1]; + + var account = AccountManager.GetAccountByEmail(email); + + if (account == null) + return string.Format("No account with email '{0}' exists.", email); + + if (password.Length < 8 || password.Length > 16) + return "Password should be a minimum of 8 and a maximum of 16 characters."; + + AccountManager.UpdatePassword(account, password); + return string.Format("Updated password for account {0}.", email); + } + + [Command("setuserlevel", "Allows you to set a new user level for account\nUsage: account setuserlevel .\nAvailable user levels: owner, admin, gm, user.", Account.UserLevels.GM)] + public string SetLevel(string[] @params, MooNetClient invokerClient) + { + if (@params.Count() < 2) + return "Invalid arguments. Type 'help account setuserlevel' to get help."; + + var email = @params[0]; + var level = @params[1].ToLower(); + Account.UserLevels userLevel; + + var account = AccountManager.GetAccountByEmail(email); + + if (account == null) + return string.Format("No account with email '{0}' exists.", email); + + switch (level) + { + case "owner": + userLevel = Account.UserLevels.Owner; + break; + case "admin": + userLevel = Account.UserLevels.Admin; + break; + case "gm": + userLevel = Account.UserLevels.GM; + break; + case "user": + userLevel = Account.UserLevels.User; + break; + default: + return level + " is not a valid user level."; + } + AccountManager.UpdateUserLevel(account, userLevel); + return string.Format("Updated user level for account {0} [user-level: {1}].", email, userLevel); + } + } + + [CommandGroup("whoami", "Returns information about current logged in account.")] + class WhoAmICommand : CommandGroup + { + [DefaultCommand] + public string WhoAmI(string[] @params, MooNetClient invokerClient) + { + if (invokerClient == null) + return "You can not invoke this command from console."; + + return string.Format("Email: {0} User Level: {1}", invokerClient.Account.Email, invokerClient.Account.UserLevel); + } + } +} diff --git a/src/Mooege/Core/MooNet/Accounts/AccountManager.cs b/src/Mooege/Core/MooNet/Accounts/AccountManager.cs new file mode 100644 index 00000000..0028ef82 --- /dev/null +++ b/src/Mooege/Core/MooNet/Accounts/AccountManager.cs @@ -0,0 +1,170 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using Mooege.Common.Logging; +using Mooege.Common.Storage; +using Mooege.Common.Storage.AccountDataBase.Entities; +using Mooege.Core.Cryptography; +using NHibernate.Linq; + +namespace Mooege.Core.MooNet.Accounts +{ + public static class AccountManager + { + private static readonly HashSet LoadedAccounts = new HashSet(); + private static readonly Logger Logger = LogManager.CreateLogger(); + + public static int TotalAccounts + { + get { return DBSessions.AccountSession.Query().Count(); } + } + + + #region AccountGetter + public static Account CreateAccount(string email, string password, string battleTag, Account.UserLevels userLevel = Account.UserLevels.User) + { + if (password.Length > 16) password = password.Substring(0, 16); // make sure the password does not exceed 16 chars. + var hashCode = GetRandomHashCodeForBattleTag(); + var salt = SRP6a.GetRandomBytes(32); + var passwordVerifier = SRP6a.CalculatePasswordVerifierForAccount(email, password, salt); + + + var newDBAccount = new DBAccount + { + Email = email, + Salt = salt, + PasswordVerifier = passwordVerifier, + BattleTagName = battleTag, + UserLevel = userLevel, + HashCode = hashCode + }; + + + DBSessions.AccountSession.SaveOrUpdate(newDBAccount); + DBSessions.AccountSession.Flush(); + + return GetAccountByDBAccount(newDBAccount); + } + + public static Account GetAccountByEmail(string email) + { + if (DBSessions.AccountSession.Query().Any(dba => dba.Email.ToLower() == email.ToLower())) + return + GetAccountByDBAccount( + DBSessions.AccountSession.Query().Single( + dba => dba.Email.ToLower() == email.ToLower())); + return null; + } + + public static Account GetAccountByBattletag(string battletag) + { + if (DBSessions.AccountSession.Query().Any(dba => dba.BattleTagName.ToLower() == battletag.ToLower())) + return + GetAccountByDBAccount( + DBSessions.AccountSession.Query().Single( + dba => dba.BattleTagName.ToLower() == battletag.ToLower())); + return null; + } + + public static Account GetAccountByPersistentID(ulong persistentId) + { + var dbAccount = DBSessions.AccountSession.Get(persistentId); + return GetAccountByDBAccount(dbAccount); + } + + public static Account GetAccountByDBAccount(DBAccount dbAccount) + { + if (!LoadedAccounts.Any(acc => acc.DBAccount.Id == dbAccount.Id)) + LoadedAccounts.Add(new Account(dbAccount)); + return LoadedAccounts.Single(acc => acc.DBAccount.Id == dbAccount.Id); + } + #endregion + + #region Managing Functions, also extending Account + public static void SaveToDB(this Account account) + { + + Logger.Debug("Saving account \"{0}\"", account.Email); + try + { + DBSessions.AccountSession.SaveOrUpdate(account.DBAccount); + DBSessions.AccountSession.Flush(); + } + catch (Exception e) + { + Logger.ErrorException(e, "SaveToDB()"); + } + } + + public static bool DeleteAccount(this Account account) + { + if (account == null) + return false; + + if (LoadedAccounts.Contains(account)) + LoadedAccounts.Remove(account); + + DBSessions.AccountSession.Delete(account.DBAccount); + DBSessions.AccountSession.Flush(); + // we should be also disconnecting the account if he's online. /raist. + + return true; + } + + public static bool UpdatePassword(this Account account, string newPassword) + { + account.PasswordVerifier = SRP6a.CalculatePasswordVerifierForAccount(account.Email, newPassword, account.Salt); + try + { + + SaveToDB(account); + return true; + } + catch (Exception e) + { + Logger.ErrorException(e, "UpdatePassword()"); + return false; + } + } + + public static void UpdateUserLevel(this Account account, Account.UserLevels userLevel) + { + account.UserLevel = userLevel; + try + { + SaveToDB(account); + } + catch (Exception e) + { + Logger.ErrorException(e, "UpdateUserLevel()"); + } + } + #endregion + + + + private static int GetRandomHashCodeForBattleTag() + { + var rnd = new Random(); + return rnd.Next(1, 1000); + } + } +} diff --git a/src/Mooege/Core/MooNet/Accounts/GameAccount.cs b/src/Mooege/Core/MooNet/Accounts/GameAccount.cs new file mode 100644 index 00000000..940aab11 --- /dev/null +++ b/src/Mooege/Core/MooNet/Accounts/GameAccount.cs @@ -0,0 +1,735 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using D3.Account; +using D3.Client; +using D3.OnlineService; +using D3.PartyMessage; +using D3.Profile; +using Google.ProtocolBuffers; +using Mooege.Common.Extensions; +using Mooege.Common.Storage.AccountDataBase.Entities; +using Mooege.Core.MooNet.Channels; +using Mooege.Core.MooNet.Helpers; +using Mooege.Core.MooNet.Objects; +using Mooege.Core.MooNet.Toons; +using Mooege.Net.MooNet; +using bnet.protocol.achievements; +using bnet.protocol.attribute; +using bnet.protocol.presence; + +namespace Mooege.Core.MooNet.Accounts +{ + public class GameAccount : PersistentRPCObject + { + public Account Owner + { + get { return AccountManager.GetAccountByDBAccount(DBGameAccount.DBAccount); } + set { DBGameAccount.DBAccount = value.DBAccount; } + } + + public DBGameAccount DBGameAccount { get; private set; } + + public EntityId D3GameAccountId + { + get + { + return EntityId.CreateBuilder().SetIdHigh(BnetEntityId.High).SetIdLow(PersistentID).Build(); + } + } + + public ByteStringPresenceField BannerConfigurationField + { + get + { + return new ByteStringPresenceField(FieldKeyHelper.Program.D3, + FieldKeyHelper.OriginatingClass.GameAccount, 1, + 0, BannerConfiguration); + } + } + + + public ByteStringPresenceField LastPlayedHeroIdField + { + get + { + var val = new ByteStringPresenceField(FieldKeyHelper.Program.D3, + FieldKeyHelper.OriginatingClass.GameAccount, 2, 0) + { + Value = LastPlayedHeroId + }; + return val; + } + } + + + public EntityId LastPlayedHeroId + { + get + { + if (this.CurrentToon == null) + return Toons.Count > 0 ? Toons.First().D3EntityID : AccountHasNoToons; + return this.CurrentToon.D3EntityID; + } + set + { + this.CurrentToon = ToonManager.GetToonByLowID(value.IdLow); + } + } + + + public IntPresenceField JoinPermissionField + = new IntPresenceField(FieldKeyHelper.Program.D3, FieldKeyHelper.OriginatingClass.Party, 2, 0); + + public FourCCPresenceField ProgramField + = new FourCCPresenceField(FieldKeyHelper.Program.BNet, FieldKeyHelper.OriginatingClass.GameAccount, 3, 0); + + public StringPresenceField BattleTagField + { + get + { + return new StringPresenceField(FieldKeyHelper.Program.BNet, FieldKeyHelper.OriginatingClass.GameAccount, 5, 0, Owner.BattleTag); + } + } + + + public StringPresenceField GameAccountNameField + { + get + { + return new StringPresenceField(FieldKeyHelper.Program.BNet, FieldKeyHelper.OriginatingClass.GameAccount, 6, 0, Owner.BnetEntityId.Low.ToString() + "#1"); + } + } + + public ByteStringPresenceField OwnerIdField + { + get + { + var val = new ByteStringPresenceField(FieldKeyHelper.Program.BNet, + FieldKeyHelper.OriginatingClass.GameAccount, 7, 0); + val.Value = this.Owner.BnetEntityId; + return val; + } + } + + + public BoolPresenceField GameAccountStatusField + = new BoolPresenceField(FieldKeyHelper.Program.BNet, FieldKeyHelper.OriginatingClass.GameAccount, 1, 0, + false); + + public IntPresenceField LastOnlineField + { + get + { + return new IntPresenceField(FieldKeyHelper.Program.BNet, FieldKeyHelper.OriginatingClass.GameAccount, 4, + 0, DBGameAccount.LastOnline); + } + } + + + public FieldKeyHelper.Program Program; + + + public BannerConfiguration BannerConfiguration + { + get + { + if (DBGameAccount.Banner == null || DBGameAccount.Banner.Length < 1) + { + DBGameAccount.Banner = BannerConfiguration.CreateBuilder() + .SetBannerShape(189701627) + .SetSigilMain(1494901005) + .SetSigilAccent(3399297034) + .SetPatternColor(1797588777) + .SetBackgroundColor(1797588777) + .SetSigilColor(2045456409) + .SetSigilPlacement(1015980604) + .SetPattern(4173846786) + .SetUseSigilVariant(true) + .Build().ToByteArray(); + } + + return BannerConfiguration.ParseFrom(DBGameAccount.Banner); + } + set + { + DBGameAccount.Banner = value.ToByteArray(); + ChangedFields.SetPresenceFieldValue(BannerConfigurationField); + } + } + + private ScreenStatus _screenstatus = ScreenStatus.CreateBuilder().SetScreen(0).SetStatus(0).Build(); + + public ScreenStatus ScreenStatus + { + get { return _screenstatus; } + set + { + _screenstatus = value; + JoinPermissionField.Value = value.Status; + ChangedFields.SetPresenceFieldValue(JoinPermissionField); + } + } + + /// + /// Selected toon for current account. + /// + + public Toon CurrentToon + { + get + { + if (this.DBGameAccount.LastPlayedHero == null) return null; + return ToonManager.GetToonByDBToon(this.DBGameAccount.LastPlayedHero); + + } + set + { + + this.DBGameAccount.LastPlayedHero = value.DBToon; + ChangedFields.SetPresenceFieldValue(LastPlayedHeroIdField); + ChangedFields.SetPresenceFieldValue(value.HeroClassField); + ChangedFields.SetPresenceFieldValue(value.HeroLevelField); + ChangedFields.SetPresenceFieldValue(value.HeroVisualEquipmentField); + ChangedFields.SetPresenceFieldValue(value.HeroFlagsField); + ChangedFields.SetPresenceFieldValue(value.HeroNameField); + } + } + + private GameAccountSettings _settings = GameAccountSettings.CreateBuilder().Build(); + + public GameAccountSettings Settings + { + get { return _settings; } + set { _settings = value; } + } + + /// + /// Away status + /// + public AwayStatusFlag AwayStatus { get; private set; } + + + public List Achievements { get; set; } + public List AchievementCriteria { get; set; } + + public AccountProfile Profile + { + get + { + return AccountProfile.CreateBuilder() + .Build(); + } + } + + public static readonly EntityId AccountHasNoToons = + EntityId.CreateBuilder().SetIdHigh(0).SetIdLow(0).Build(); + + public List Toons + { + get { return ToonManager.GetToonsForGameAccount(this); } + } + + + + public GameAccount(DBGameAccount dbGameAccount) + : base(dbGameAccount.Id) + { + DBGameAccount = dbGameAccount; + DBGameAccount.LastOnline = (long)DateTime.Now.ToExtendedEpoch(); + SetField(); + } + + + /// + /// Existing GameAccount + /// + /// + /// + /*public GameAccount(ulong persistentId, ulong accountId) + : base(persistentId) + { + SetField(AccountManager.GetAccountByPersistentID(accountId)); + }*/ + + /* + /// + /// New GameAccount + /// + /// + public GameAccount(Account account) + : base(account.BnetEntityId.Low) + { + this.SetField(account); + + this.BannerConfiguration = + D3.Account.BannerConfiguration.CreateBuilder() + .SetBannerShape(189701627) + .SetSigilMain(1494901005) + .SetSigilAccent(3399297034) + .SetPatternColor(1797588777) + .SetBackgroundColor(1797588777) + .SetSigilColor(2045456409) + .SetSigilPlacement(1015980604) + .SetPattern(4173846786) + .SetUseSigilVariant(true) + .Build(); + } + */ + + private void SetField() + { + const ulong bnetGameAccountHigh = ((ulong)EntityIdHelper.HighIdType.GameAccountId) + (0x0100004433); + BnetEntityId = bnet.protocol.EntityId.CreateBuilder().SetHigh(bnetGameAccountHigh).SetLow(PersistentID).Build(); + + //TODO: Now hardcode all game account notifications to D3 + ProgramField.Value = "D3"; + Achievements = new List(); + AchievementCriteria = new List(); + } + + public bool IsOnline + { + get { return LoggedInClient != null; } + } + + private MooNetClient _loggedInClient; + + public MooNetClient LoggedInClient + { + get { return _loggedInClient; } + set + { + _loggedInClient = value; + + GameAccountStatusField.Value = IsOnline; + DBGameAccount.LastOnline = (long)DateTime.Now.ToExtendedEpoch(); + Owner.DBAccount.LastOnline = LastOnlineField.Value; + + ChangedFields.SetPresenceFieldValue(GameAccountStatusField); + ChangedFields.SetPresenceFieldValue(LastOnlineField); + ChangedFields.SetPresenceFieldValue(BannerConfigurationField); + + //TODO: Remove this set once delegate for set is added to presence field + //this.Owner.AccountOnlineField.Value = this.Owner.IsOnline; + //var operation = this.Owner.AccountOnlineField.GetFieldOperation(); + NotifyUpdate(); + // this.UpdateSubscribers(this.Subscribers, new List() { operation }); + } + } + + public Digest Digest + { + get + { + Digest.Builder builder = Digest.CreateBuilder().SetVersion(107) + // 7447=>99, 7728=> 100, 8801=>102, 8296=>105, 8610=>106, 8815=>106, 8896=>106, 9183=>107 + .SetBannerConfiguration(this.BannerConfiguration) + .SetFlags(2) //Enable Hardcore + .SetLastPlayedHeroId(LastPlayedHeroId); + + return builder.Build(); + } + } + + #region Notifications + + public override void NotifyUpdate() + { + var operations = ChangedFields.GetChangedFieldList(); + ChangedFields.ClearChanged(); + base.UpdateSubscribers(Subscribers, operations); + } + + public override List GetSubscriptionNotifications() + { + //for now set it here + GameAccountStatusField.Value = IsOnline; + + var operationList = new List(); + + //gameaccount + //D3,GameAccount,1,0 -> D3.DBAccount.BannerConfiguration + //D3,GameAccount,2,0 -> ToonId + //D3,Hero,1,0 -> Hero Class + //D3,Hero,2,0 -> Hero's current level + //D3,Hero,3,0 -> D3.Hero.VisualEquipment + //D3,Hero,4,0 -> Hero's flags + //D3,Hero,5,0 -> Hero Name + //D3,Hero,6,0 -> HighestUnlockedAct + //D3,Hero,7,0 -> HighestUnlockedDifficulty + //Bnet,GameAccount,1,0 -> GameAccount Online + //Bnet,GameAccount,3,0 -> FourCC = "D3" + //Bnet,GameAccount,4,0 -> Unk Int (0 if GameAccount is Offline) + //Bnet,GameAccount,5,0 -> BattleTag + //Bnet,GameAccount,6,0 -> DBAccount.Low + "#1" + //Bnet,GameAccount,7,0 -> DBAccount.EntityId + + operationList.Add(BannerConfigurationField.GetFieldOperation()); + if (LastPlayedHeroId != AccountHasNoToons) + { + operationList.Add(LastPlayedHeroIdField.GetFieldOperation()); + if (CurrentToon != null) + operationList.AddRange(CurrentToon.GetSubscriptionNotifications()); + } + + operationList.Add(GameAccountStatusField.GetFieldOperation()); + operationList.Add(ProgramField.GetFieldOperation()); + operationList.Add(LastOnlineField.GetFieldOperation()); + operationList.Add(BattleTagField.GetFieldOperation()); + operationList.Add(GameAccountNameField.GetFieldOperation()); + operationList.Add(OwnerIdField.GetFieldOperation()); + + return operationList; + } + + #endregion + + public void Update(FieldOperation operation) + { + switch (operation.Operation) + { + case FieldOperation.Types.OperationType.SET: + DoSet(operation.Field); + break; + case FieldOperation.Types.OperationType.CLEAR: + DoClear(operation.Field); + break; + default: + Logger.Warn("No operation type."); + break; + } + } + + private void DoSet(Field field) + { + FieldOperation.Builder operation = FieldOperation.CreateBuilder(); + + Field.Builder returnField = Field.CreateBuilder().SetKey(field.Key); + + switch ((FieldKeyHelper.Program)field.Key.Program) + { + case FieldKeyHelper.Program.D3: + if (field.Key.Group == 2 && field.Key.Field == 3) //CurrentActivity + { + returnField.SetValue(field.Value); + Logger.Trace("{0} set CurrentActivity to {1}", this, field.Value.IntValue); + } + else if (field.Key.Group == 2 && field.Key.Field == 4) //Unknown bool + { + returnField.SetValue(field.Value); + Logger.Trace("{0} set CurrentActivity to {1}", this, field.Value.BoolValue); + } + else if (field.Key.Group == 4 && field.Key.Field == 1) //PartyId + { + if (field.Value.HasMessageValue) //7727 Sends empty SET instead of a CLEAR -Egris + { + EntityId entityId = EntityId.ParseFrom(field.Value.MessageValue); + Channel channel = ChannelManager.GetChannelByEntityId(entityId); + if (LoggedInClient.CurrentChannel != channel) + { + LoggedInClient.CurrentChannel = channel; + returnField.SetValue( + Variant.CreateBuilder().SetMessageValue(channel.BnetEntityId.ToByteString()).Build()); + Logger.Trace("{0} set channel to {1}", this, channel); + } + } + else + { + if (LoggedInClient.CurrentChannel != null) + { + returnField.SetValue(Variant.CreateBuilder().SetMessageValue(ByteString.Empty).Build()); + Logger.Warn("Emtpy-field: {0}, {1}, {2}", field.Key.Program, field.Key.Group, + field.Key.Field); + } + } + } + else if (field.Key.Group == 4 && field.Key.Field == 2) //JoinPermission + { + //catch to stop Logger.Warn spam on client start and exit + // should D3.4.2 int64 Current screen (0=in-menus, 1=in-menus, 3=in-menus); see ScreenStatus sent to ChannelService.UpdateChannelState call /raist + if (ScreenStatus.Screen != field.Value.IntValue) + { + ScreenStatus = + ScreenStatus.CreateBuilder().SetScreen((int)field.Value.IntValue).SetStatus(0).Build(); + returnField.SetValue(Variant.CreateBuilder().SetIntValue(field.Value.IntValue).Build()); + Logger.Trace("{0} set current screen to {1}.", this, field.Value.IntValue); + } + } + else if (field.Key.Group == 4 && field.Key.Field == 3) //CallToArmsMessage + { + returnField.SetValue(field.Value); + } + else if (field.Key.Group == 4 && field.Key.Field == 4) //Party IsFull + { + returnField.SetValue(field.Value); + } + else if (field.Key.Group == 5 && field.Key.Field == 5) //Game IsPrivate + { + returnField.SetValue(field.Value); + } + else + { + Logger.Warn("GameAccount: Unknown set-field: {0}, {1}, {2} := {3}", field.Key.Program, + field.Key.Group, field.Key.Field, field.Value); + } + break; + case FieldKeyHelper.Program.BNet: + if (field.Key.Group == 2 && field.Key.Field == 2) // SocialStatus + { + AwayStatus = (AwayStatusFlag)field.Value.IntValue; + returnField.SetValue(Variant.CreateBuilder().SetIntValue((long)AwayStatus).Build()); + Logger.Trace("{0} set AwayStatus to {1}.", this, AwayStatus); + } + else if (field.Key.Group == 2 && field.Key.Field == 8) + { + returnField.SetValue((field.Value)); + } + else if (field.Key.Group == 2 && field.Key.Field == 10) // AFK + { + returnField.SetValue(field.Value); + Logger.Trace("{0} set AFK to {1}.", this, field.Value.BoolValue); + } + else + { + Logger.Warn("GameAccount: Unknown set-field: {0}, {1}, {2} := {3}", field.Key.Program, + field.Key.Group, field.Key.Field, field.Value); + } + break; + } + + //We only update subscribers on fields that actually change values. + if (returnField.HasValue) + { + operation.SetField(returnField); + UpdateSubscribers(Subscribers, new List { operation.Build() }); + } + } + + private void DoClear(Field field) + { + switch ((FieldKeyHelper.Program)field.Key.Program) + { + case FieldKeyHelper.Program.D3: + Logger.Warn("GameAccount: Unknown clear-field: {0}, {1}, {2}", field.Key.Program, field.Key.Group, + field.Key.Field); + break; + case FieldKeyHelper.Program.BNet: + Logger.Warn("GameAccount: Unknown clear-field: {0}, {1}, {2}", field.Key.Program, field.Key.Group, + field.Key.Field); + break; + } + } + + public Field QueryField(FieldKey queryKey) + { + Field.Builder field = Field.CreateBuilder().SetKey(queryKey); + + switch ((FieldKeyHelper.Program)queryKey.Program) + { + case FieldKeyHelper.Program.D3: + if (queryKey.Group == 2 && queryKey.Field == 1) // Banner configuration + { + field.SetValue( + Variant.CreateBuilder().SetMessageValue(BannerConfigurationField.Value.ToByteString()).Build + ()); + } + else if (queryKey.Group == 2 && queryKey.Field == 2) //Hero's EntityId + { + field.SetValue(Variant.CreateBuilder().SetMessageValue(LastPlayedHeroId.ToByteString()).Build()); + } + else if (queryKey.Group == 2 && queryKey.Field == 4) //Unknown Bool + { + field.SetValue(Variant.CreateBuilder().SetBoolValue(false).Build()); + } + else if (queryKey.Group == 3 && queryKey.Field == 1) // Hero's class (GbidClass) + { + field.SetValue(Variant.CreateBuilder().SetIntValue(CurrentToon.ClassID).Build()); + } + else if (queryKey.Group == 3 && queryKey.Field == 2) // Hero's current level + { + field.SetValue(Variant.CreateBuilder().SetIntValue(CurrentToon.Level).Build()); + } + else if (queryKey.Group == 3 && queryKey.Field == 3) // Hero's visible equipment + { + field.SetValue( + Variant.CreateBuilder().SetMessageValue( + CurrentToon.HeroVisualEquipmentField.Value.ToByteString()).Build()); + } + else if (queryKey.Group == 3 && queryKey.Field == 4) // Hero's flags (gender and such) + { + field.SetValue( + Variant.CreateBuilder().SetIntValue((uint)(CurrentToon.Flags | ToonFlags.AllUnknowns)). + Build()); + } + else if (queryKey.Group == 3 && queryKey.Field == 5) // Toon name + { + field.SetValue(Variant.CreateBuilder().SetStringValue(CurrentToon.Name).Build()); + } + else if (queryKey.Group == 3 && queryKey.Field == 6) + { + field.SetValue(Variant.CreateBuilder().SetIntValue(0).Build()); + } + else if (queryKey.Group == 3 && queryKey.Field == 7) + { + field.SetValue(Variant.CreateBuilder().SetIntValue(0).Build()); + } + else if (queryKey.Group == 4 && queryKey.Field == 1) // Channel ID if the client is online + { + if (LoggedInClient != null && LoggedInClient.CurrentChannel != null) + field.SetValue( + Variant.CreateBuilder().SetMessageValue( + LoggedInClient.CurrentChannel.D3EntityId.ToByteString()).Build()); + else field.SetValue(Variant.CreateBuilder().Build()); + } + else if (queryKey.Group == 4 && queryKey.Field == 2) + // Current screen (all known values are just "in-menu"; also see ScreenStatuses sent in ChannelService.UpdateChannelState) + { + field.SetValue(Variant.CreateBuilder().SetIntValue(ScreenStatus.Screen).Build()); + } + else if (queryKey.Group == 4 && queryKey.Field == 4) //Unknown Bool + { + field.SetValue(Variant.CreateBuilder().SetBoolValue(false).Build()); + } + else + { + Logger.Warn("GameAccount Unknown query-key: {0}, {1}, {2}", queryKey.Program, queryKey.Group, + queryKey.Field); + } + break; + case FieldKeyHelper.Program.BNet: + if (queryKey.Group == 2 && queryKey.Field == 1) //GameAccount Logged in + { + field.SetValue(Variant.CreateBuilder().SetBoolValue(GameAccountStatusField.Value).Build()); + } + else if (queryKey.Group == 2 && queryKey.Field == 2) // Away status + { + field.SetValue(Variant.CreateBuilder().SetIntValue((long)AwayStatus).Build()); + } + else if (queryKey.Group == 2 && queryKey.Field == 3) // Program - always D3 + { + field.SetValue(Variant.CreateBuilder().SetFourccValue("D3").Build()); + } + else if (queryKey.Group == 2 && queryKey.Field == 5) // BattleTag + { + field.SetValue(Variant.CreateBuilder().SetStringValue(Owner.BattleTag).Build()); + } + else if (queryKey.Group == 2 && queryKey.Field == 7) // DBAccount.EntityId + { + field.SetValue(Variant.CreateBuilder().SetEntityidValue(Owner.BnetEntityId).Build()); + } + else if (queryKey.Group == 2 && queryKey.Field == 10) // AFK + { + field.SetValue( + Variant.CreateBuilder().SetBoolValue(AwayStatus != AwayStatusFlag.Available).Build()); + } + else + { + Logger.Warn("GameAccount Unknown query-key: {0}, {1}, {2}", queryKey.Program, queryKey.Group, + queryKey.Field); + } + break; + } + + return field.HasValue ? field.Build() : null; + } + + public override string ToString() + { + return String.Format("{{ GameAccount: {0} [lowId: {1}] }}", Owner.BattleTag, BnetEntityId.Low); + } + + //Moved DB thingies to GameAccountManager. + /* + public void SaveToDB() + { + try + { + if (ExistsInDB()) + { + var query = + string.Format( + "UPDATE gameaccounts SET accountId={0}, banner=@banner, LastOnline={1} WHERE id={2}", + this.Owner.PersistentID, this.LastOnlineField.Value, this.PersistentID); + + using (var cmd = new SQLiteCommand(query, DBManager.Connection)) + { + cmd.Parameters.Add("@banner", System.Data.DbType.Binary).Value = this.BannerConfiguration.ToByteArray(); + cmd.ExecuteNonQuery(); + } + } + else + { + var query = string.Format("INSERT INTO gameaccounts (id, accountId, banner, LastOnline) VALUES({0},{1}, @banner, {2})", this.PersistentID, this.Owner.PersistentID, this.LastOnlineField.Value); + + using (var cmd = new SQLiteCommand(query, DBManager.Connection)) + { + cmd.Parameters.Add("@banner", System.Data.DbType.Binary).Value = this.BannerConfiguration.ToByteArray(); + cmd.ExecuteNonQuery(); + } + } + } + catch (Exception e) + { + Logger.ErrorException(e, "GameAccount.SaveToDB()"); + } + } + + public bool DeleteFromDB() + { + try + { + // Remove from DB + if (!ExistsInDB()) return false; + + var query = string.Format("DELETE FROM gameaccounts WHERE id={0}", this.PersistentID); + var cmd = new SQLiteCommand(query, DBManager.Connection); + cmd.ExecuteNonQuery(); + return true; + } + catch (Exception e) + { + Logger.ErrorException(e, "GameAccount.DeleteFromDB()"); + return false; + } + } + + private bool ExistsInDB() + { + var query = string.Format("SELECT id FROM gameaccounts where id={0}", this.PersistentID); + + var cmd = new SQLiteCommand(query, DBManager.Connection); + var reader = cmd.ExecuteReader(); + return reader.HasRows; + } + */ + + //TODO: figure out what 1 and 3 represent, or if it is a flag since all observed values are powers of 2 so far /dustinconrad + public enum AwayStatusFlag : uint + { + Available = 0x00, + UnknownStatus1 = 0x01, + Away = 0x02, + UnknownStatus2 = 0x03, + Busy = 0x04 + } + } +} \ No newline at end of file diff --git a/src/Mooege/Core/MooNet/Accounts/GameAccountManager.cs b/src/Mooege/Core/MooNet/Accounts/GameAccountManager.cs new file mode 100644 index 00000000..e5ee66b9 --- /dev/null +++ b/src/Mooege/Core/MooNet/Accounts/GameAccountManager.cs @@ -0,0 +1,128 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Data.SQLite; +using System.Linq; +using Mooege.Common.Storage.AccountDataBase.Entities; +using Mooege.Core.MooNet.Helpers; +using Mooege.Common.Logging; +using Mooege.Common.Storage; +using Mooege.Core.MooNet.Toons; +using NHibernate.Linq; + +namespace Mooege.Core.MooNet.Accounts +{ + class GameAccountManager + { + private static readonly HashSet LoadedGameAccounts = new HashSet(); + private static readonly Logger Logger = LogManager.CreateLogger(); + + public static int TotalAccounts + { + get { return DBSessions.AccountSession.Query().Count(); } + } + + public static GameAccount GetGameAccountByDBGameAccount(DBGameAccount dbGameAccount) + { + if (!LoadedGameAccounts.Any(acc => acc.DBGameAccount.Id == dbGameAccount.Id)) + LoadedGameAccounts.Add(new GameAccount(dbGameAccount)); + return LoadedGameAccounts.Single(acc => acc.DBGameAccount.Id == dbGameAccount.Id); + } + + public static GameAccount FindLoadedGameAccountByBnetId(ulong id) + { + if (LoadedGameAccounts.Any(ga => ga.BnetEntityId.Low == id)) + return LoadedGameAccounts.Single(ga => ga.BnetEntityId.Low == id); + return null; + } + + public static List GetGameAccountsForAccount(Account account) + { + return account.DBAccount.DBGameAccounts.Select(GetGameAccountByDBGameAccount).ToList(); + } + + //Not needed... we emulate only D3, or not? + /* + public static Dictionary GetGameAccountsForAccountProgram(Account account, FieldKeyHelper.Program program) + { + + return GameAccounts.Where(pair => pair.Value.Owner != null).Where(pair => (pair.Value.Owner.PersistentID == account.PersistentID) && (pair.Value.Program == program)).ToDictionary(pair => pair.Key, pair => pair.Value); + } + */ + public static GameAccount GetAccountByPersistentID(ulong persistentId) + { + var dbGameAccount = DBSessions.AccountSession.Get(persistentId); + return GetGameAccountByDBGameAccount(dbGameAccount); + } + + public static void SaveToDB(GameAccount gameAccount) + { + try + { + DBSessions.AccountSession.SaveOrUpdate(gameAccount.DBGameAccount); + DBSessions.AccountSession.Flush(); + } + catch (Exception e) + { + Logger.ErrorException(e, "GameAccount.SaveToDB()"); + } + } + + public static GameAccount CreateGameAccount(Account account) + { + var newDBGameAccount = new DBGameAccount + { + DBAccount = DBSessions.AccountSession.Get(account.PersistentID) + }; + + DBSessions.AccountSession.SaveOrUpdate(newDBGameAccount); + DBSessions.AccountSession.Flush(); + return GetGameAccountByDBGameAccount(newDBGameAccount); + } + + public static void DeleteGameAccount(GameAccount gameAccount) + { + if (gameAccount == null) + return; + if (LoadedGameAccounts.Contains(gameAccount)) + LoadedGameAccounts.Remove(gameAccount); + + //Delete all toons for game account + foreach (var toon in ToonManager.GetToonsForGameAccount(gameAccount)) + + ToonManager.DeleteToon(toon); + + + var inventoryToDelete = DBSessions.AccountSession.Query().Where(inv => inv.DBGameAccount.Id == gameAccount.DBGameAccount.Id); + foreach (var inv in inventoryToDelete) + DBSessions.AccountSession.Delete(inv); + + + + gameAccount.DBGameAccount.DBAccount.DBGameAccounts.Remove(gameAccount.DBGameAccount); + + DBSessions.AccountSession.Update(gameAccount.DBGameAccount.DBAccount); + DBSessions.AccountSession.Delete(gameAccount.DBGameAccount); + DBSessions.AccountSession.Flush(); + + } + + } +} diff --git a/src/Mooege/Core/MooNet/Achievement/AchievementManager.cs b/src/Mooege/Core/MooNet/Achievement/AchievementManager.cs new file mode 100644 index 00000000..5d4433da --- /dev/null +++ b/src/Mooege/Core/MooNet/Achievement/AchievementManager.cs @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.IO; +using Version = Mooege.Common.Versions.VersionInfo.MooNet.Achievements; +using Mooege.Common.Logging; + +namespace Mooege.Core.MooNet.Achievement +{ + public static class AchievementManager + { + private static readonly Logger Logger = LogManager.CreateLogger(); + + public static readonly bnet.protocol.achievements.AchievementFile Achievements; + + static AchievementManager() + { + if (File.Exists(Version.AchievementFilename)) + { + var br = new BinaryReader(File.Open(Version.AchievementFilename, FileMode.Open)); + Achievements = bnet.protocol.achievements.AchievementFile.ParseFrom(br.ReadBytes((int)br.BaseStream.Length)); + br.Close(); + Logger.Info("Achievement file loaded from disk."); + } + else + { + Logger.Info("Achievement file not found. Attempting to download..."); + var attempts = 0; + byte[] data = new byte[] { }; + while (attempts < 5) + { + try + { + data = new System.Net.WebClient().DownloadData(Version.AchievementURL); + break; + } + catch (System.Net.WebException) + { + attempts++; + } + } + try + { + Achievements = bnet.protocol.achievements.AchievementFile.ParseFrom(data); + if (attempts < 5) + { + var br = new BinaryWriter(File.Open(Version.AchievementFilename, FileMode.CreateNew)); + br.Write(data); + br.Close(); + } + else + { + Logger.Error("AchievementFile could not be downloaded. Aborted after 5 tries."); + } + } + catch (Google.ProtocolBuffers.InvalidProtocolBufferException) + { + Achievements = bnet.protocol.achievements.AchievementFile.CreateBuilder().Build(); + Logger.Error("AchievementFile could not be downloaded and parsed correctly."); + } + catch (IOException) + { + Logger.Error("{0} could not be written to.", Version.AchievementFilename); + } + + } + } + + public static int TotalAchievements + { + get { return Achievements.AchievementCount; } + } + + public static int TotalCategories + { + get { return Achievements.CategoryCount; } + } + + public static int TotalCriteria + { + get { return Achievements.CriteriaCount; } + } + } +} diff --git a/src/Mooege/Core/MooNet/Authentication/AuthManager.cs b/src/Mooege/Core/MooNet/Authentication/AuthManager.cs new file mode 100644 index 00000000..aae4c286 --- /dev/null +++ b/src/Mooege/Core/MooNet/Authentication/AuthManager.cs @@ -0,0 +1,135 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using System.Linq; +using Google.ProtocolBuffers; +using Mooege.Common.Logging; +using Mooege.Common.Versions; +using Mooege.Core.Cryptography; +using Mooege.Core.MooNet.Accounts; +using Mooege.Net.MooNet; +using Mooege.Common.Extensions; + +namespace Mooege.Core.MooNet.Authentication +{ + public static class AuthManager + { + private static readonly Logger Logger = LogManager.CreateLogger(); + + public static readonly Dictionary OngoingAuthentications = new Dictionary(); + + public static void StartAuthentication(MooNetClient client, bnet.protocol.authentication.LogonRequest request) + { + InitAuthentication(client, request); + } + + private static void InitAuthentication(MooNetClient client, bnet.protocol.authentication.LogonRequest request) + { + client.LoginEmail = request.Email; + var account = AccountManager.GetAccountByEmail(request.Email.ToLower()); // check if account exists. + + if (account == null) // we should be returning an error to client /raist. + { + client.AuthenticationErrorCode = AuthenticationErrorCodes.NoGameAccount; + client.AuthenticationComplete(); + return; + } + + var thumbprintData = "f9513183031b3836103ac3a3bb606c0e06fd3b94ae4a6b6e405844085b794e901b0ebb1db650b85bac4b489a38a1ca9dcef2bbd13445d0cd85accfc62d84bc3a8d960b1a7a65cd8d3f72a172f41dca98459015ffbd25d766b02824a42dacb7c4cd64f4b3b9e316de23ec1dbb0153b73a4fa58ffb39c3f484b4b478a660dc8979e16e52f978a0ca2fc4184fa0f69844d73ef99f47e3ccb02cf6a636b4ae9513404eee7e0ad536dcef50cd1699e38195e6afdd3655a3a3529b4e52b33ac5d04f5fa2b15536a2c782c89c0acf133e14eac15af035abf5e44e9e1124a3397dac8f90a4ccb1717540698869fc1ba9037e099d68698ecf17ffdd36f07013176be24269fda1e5d221708181d95474fc1d74bb901062a9f6a3e24aef79e9d583d9126796d63c153a0f75f02da27ecc0971f39a46ec29087c3ae474e08fdf8f65d1445b293399bc495ff651b7d2d7a36216ba5e4400ea7bbc884dc4cf3ed27f14501b8bb7fc0f86b5089880e6889bcd851153e299a337d6c945f710559595e351995341cbef44abac379cf0f845b362d294eec390d50f1a50089d250eae1b1205cea1aff514de076516f467cd077a1fbb759b415dc6c0ea1617f31f7d764a0d60d5b67aa82b4202b2a9455eb9ca3683955ec45aaf56aba42a2f3ae9be5f3eed093a6601816d00e0569bfcb91fb7843945336c99757812d373d510d25744f9480b6cc87e8a".ToByteArray(); + + var srp6a = new SRP6a(account); // create srp6 handler to process the authentication. + OngoingAuthentications.Add(client, srp6a); + + // request client to load thumbprint.dll for authentication. + var moduleLoadRequest = bnet.protocol.authentication.ModuleLoadRequest.CreateBuilder() + .SetModuleHandle(bnet.protocol.ContentHandle.CreateBuilder() + .SetRegion(VersionInfo.MooNet.Regions[VersionInfo.MooNet.Region]) + .SetUsage(0x61757468) // auth - thumbprint.dll + .SetHash(ByteString.CopyFrom(VersionInfo.MooNet.ThumbprintHashMap[client.Platform]))) + .SetMessage(ByteString.CopyFrom(thumbprintData)) + .Build(); + + client.LastRequestedModule = MooNetClient.StreamedModule.Thumbprint; + client.MakeRPC(() => bnet.protocol.authentication.AuthenticationClient.CreateStub(client).ModuleLoad(null, moduleLoadRequest, callback => { })); + } + + public static void HandleAuthResponse(MooNetClient client, int moduleId, byte[] authMessage) + { + if (!OngoingAuthentications.ContainsKey(client)) return; // TODO: disconnect him also. /raist. + + var srp6 = OngoingAuthentications[client]; + byte[] A = authMessage.Skip(1).Take(128).ToArray(); // client's public ephemeral + byte[] M_client = authMessage.Skip(1 + 128).Take(32).ToArray(); // client's proof of session key. + byte[] seed = authMessage.Skip(1 + 32 + 128).Take(128).ToArray(); // client's second challenge. + + var success = srp6.Verify(A, M_client, seed); + //if (Config.Instance.DisablePasswordChecks || success) + if (success) + { + client.SessionKey = srp6.SessionKey; + // send the logon proof. + var message = bnet.protocol.authentication.ModuleMessageRequest.CreateBuilder() + .SetModuleId(moduleId) + .SetMessage(ByteString.CopyFrom(srp6.LogonProof)) + .Build(); + + client.MakeRPC(() => + bnet.protocol.authentication.AuthenticationClient.CreateStub(client).ModuleMessage(null, message, callback => client.CheckAuthenticator())); + + client.Account = AccountManager.GetAccountByEmail(srp6.Account.Email); + //if (client.Account.LoggedInClient != null) + // client.Account.LoggedInClient.Connection.Disconnect(); + //client.Account.LoggedInClient = client; + } + else // authentication failed because of invalid credentals. + { + client.AuthenticationErrorCode = AuthenticationErrorCodes.InvalidCredentials; + //end authentication + client.AuthenticationComplete(); + } + + OngoingAuthentications.Remove(client); + } + + public static void SendAccountSettings(MooNetClient client) + { + var accset = new bnet.protocol.authentication.AccountSettingsNotification.Builder(); + accset.AddLicenses(new bnet.protocol.account.AccountLicense.Builder().SetId(111)); + accset.AddLicenses(new bnet.protocol.account.AccountLicense.Builder().SetId(227)); + accset.AddLicenses(new bnet.protocol.account.AccountLicense.Builder().SetId(168)); //Full Game - Removes upgrade banner + client.MakeRPC(() => bnet.protocol.authentication.AuthenticationClient.CreateStub(client).AccountSettings(null, accset.Build(), delegate(bnet.protocol.NO_RESPONSE a) { })); + } + + private static void ModuleLoadResponse(IMessage response) + { + Logger.Trace("ModuleLoadResponse(): {0}", response.ToString()); + } + + /// + /// Error codes for authentication process. + /// + public enum AuthenticationErrorCodes + { + None = 0, + InvalidCredentials = 3, + NoToonSelected = 11, + NoGameAccount = 12, + } + } +} diff --git a/src/Mooege/Core/MooNet/Authentication/Config.cs b/src/Mooege/Core/MooNet/Authentication/Config.cs new file mode 100644 index 00000000..468249ad --- /dev/null +++ b/src/Mooege/Core/MooNet/Authentication/Config.cs @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace Mooege.Core.MooNet.Authentication +{ + public sealed class Config : Common.Config.Config + { + public bool DisablePasswordChecks { get { return this.GetBoolean("DisablePasswordChecks", true); } set { this.Set("DisablePasswordChecks", value); } } + + private static readonly Config _instance = new Config(); + public static Config Instance { get { return _instance; } } + private Config() : base("Authentication") { } + } +} \ No newline at end of file diff --git a/src/Mooege/Core/MooNet/Authentication/VersionChecker.cs b/src/Mooege/Core/MooNet/Authentication/VersionChecker.cs new file mode 100644 index 00000000..f0be135c --- /dev/null +++ b/src/Mooege/Core/MooNet/Authentication/VersionChecker.cs @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Common.Logging; +using Mooege.Common.Versions; +using Mooege.Net.MooNet; + +namespace Mooege.Core.MooNet.Authentication +{ + public static class VersionChecker + { + private static readonly Logger Logger = LogManager.CreateLogger(); + + public static bool Check(MooNetClient client, bnet.protocol.authentication.LogonRequest request) + { + int versionMatch = -1; + string clientVersionSignature = request.HasVersion ? request.Version.Substring(0, 24) : string.Empty; // get client's version string signature - the very first 24 chars like; "Aurora b4367eba86_public". + + foreach (var pair in VersionInfo.MooNet.ClientVersionMaps) // see if client's version signature matches anyone in our client versions map. + { + if (pair.Key != clientVersionSignature) + continue; + + versionMatch = pair.Value; + break; + } + + // set client platform. + switch (request.Platform.ToLower()) + { + case "win": + client.Platform = MooNetClient.ClientPlatform.Win; + break; + case "mac": + client.Platform = MooNetClient.ClientPlatform.Mac; + break; + default: + client.Platform = MooNetClient.ClientPlatform.Invalid; + break; + } + + // set client locale + switch (request.Locale) + { + case "deDE": + client.Locale = MooNetClient.ClientLocale.deDE; + break; + case "enGB": + client.Locale = MooNetClient.ClientLocale.enGB; + break; + case "enSG": + client.Locale = MooNetClient.ClientLocale.enSG; + break; + case "enUS": + client.Locale = MooNetClient.ClientLocale.enUS; + break; + case "esES": + client.Locale = MooNetClient.ClientLocale.esES; + break; + case "esMX": + client.Locale = MooNetClient.ClientLocale.esMX; + break; + case "frFR": + client.Locale = MooNetClient.ClientLocale.frFR; + break; + case "itIT": + client.Locale = MooNetClient.ClientLocale.itIT; + break; + case "koKR": + client.Locale = MooNetClient.ClientLocale.koKR; + break; + case "plPL": + client.Locale = MooNetClient.ClientLocale.plPL; + break; + case "ptPT": + client.Locale = MooNetClient.ClientLocale.ptPT; + break; + case "ptBR": + client.Locale = MooNetClient.ClientLocale.ptBR; + break; + case "ruRU": + client.Locale = MooNetClient.ClientLocale.ruRU; + break; + case "trTR": + client.Locale = MooNetClient.ClientLocale.trTR; + break; + case "zhCN": + client.Locale = MooNetClient.ClientLocale.zhCN; + break; + case "zhTW": + client.Locale = MooNetClient.ClientLocale.zhTW; + break; + default: + client.Locale = MooNetClient.ClientLocale.Invalid; + break; + } + + Logger.Trace("Client Info: user: {0} program: {1} platform: {2} locale: {3} version: {4} [{5}] app_version: {6}.", + request.Email, request.Program, request.Platform, request.Locale, versionMatch != -1 ? versionMatch.ToString() : "Unknown", request.Version, request.ApplicationVersion); + + //return versionMatch == VersionInfo.MooNet.RequiredClientVersion; // see if the client fits our required version. + return request.ApplicationVersion == VersionInfo.MooNet.RequiredClientVersion; + } + } +} diff --git a/src/Mooege/Core/MooNet/Channels/Channel.cs b/src/Mooege/Core/MooNet/Channels/Channel.cs new file mode 100644 index 00000000..06ea6eda --- /dev/null +++ b/src/Mooege/Core/MooNet/Channels/Channel.cs @@ -0,0 +1,444 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using Mooege.Core.MooNet.Helpers; +using Mooege.Core.MooNet.Objects; +using Mooege.Core.MooNet.Accounts; +using Mooege.Net.MooNet; + +namespace Mooege.Core.MooNet.Channels +{ + public class Channel : RPCObject + { + /// + /// D3.OnlineService.EntityId encoded channel Id. + /// + public D3.OnlineService.EntityId D3EntityId { get; protected set; } + + /// + /// Channel PrivacyLevel. + /// + public bnet.protocol.channel.ChannelState.Types.PrivacyLevel PrivacyLevel { get; private set; } + + public Dictionary Attributes = new Dictionary(); + + /// + /// Max number of members. + /// + public uint MaxMembers { get; set; } + + /// + /// Minimum number of members. + /// + public uint MinMembers { get; set; } + + /// + /// Maximum invitations. + /// + public uint MaxInvitations { get; set; } + + /// + /// List of channel members. + /// + public readonly Dictionary Members = new Dictionary(); + + public readonly Dictionary Invitations = new Dictionary(); + + /// + /// Channel owner. + /// + public MooNetClient Owner { get; protected set; } + + public bool IsGameChannel { get; set; } + /// + /// Creates a new channel for given client with supplied remote object-id. + /// + /// The client channels is created for + /// The remove object-id of the client. + public Channel(MooNetClient client, bool isGameChannel = false, ulong remoteObjectId = 0) + { + this.BnetEntityId = bnet.protocol.EntityId.CreateBuilder().SetHigh((ulong)EntityIdHelper.HighIdType.ChannelId).SetLow(this.DynamicId).Build(); + this.D3EntityId = D3.OnlineService.EntityId.CreateBuilder().SetIdHigh((ulong)EntityIdHelper.HighIdType.ChannelId).SetIdLow(this.DynamicId).Build(); + this.PrivacyLevel = bnet.protocol.channel.ChannelState.Types.PrivacyLevel.PRIVACY_LEVEL_OPEN_INVITATION; + this.MinMembers = 1; + this.MaxMembers = 8; + this.MaxInvitations = 12; + this.IsGameChannel = isGameChannel; + + if (remoteObjectId != 0) + client.MapLocalObjectID(this.DynamicId, remoteObjectId); // This is an object creator, so we have to map the remote object ID + + // The client can't be set as the owner (or added as a member) here because the server must first make a response + // to the client before using a mapped ID (presuming that this was called from a service). + // We'll just let the caller do that for us. + } + + #region common methods + + public bool HasUser(MooNetClient client) + { + return this.Members.Any(pair => pair.Key == client); + } + + public bool HasMember(GameAccount gameAccount) //check if a given game account is already channels member + { + return this.Members.Any(pair => pair.Value.Identity.AccountId.Low == gameAccount.BnetEntityId.Low); + } + + public Member GetMember(MooNetClient client) + { + return this.Members[client]; + } + + public void Dissolve() + { + ChannelManager.DissolveChannel(this.DynamicId); + } + + #endregion + + #region owner functionality + + public void SetOwner(MooNetClient client) + { + if (client == this.Owner) + { + Logger.Warn("Tried to set client {0} as owner of channel when it was already the owner", client.Connection.RemoteEndPoint.ToString()); + return; + } + RemoveOwner(RemoveReason.Left); // TODO: Should send state update to current owner instead of removing it + this.Owner = client; + AddMember(client); + } + + public void RemoveOwner(RemoveReason reason) + { + if (this.Owner == null) return; + + RemoveMember(this.Owner, reason, false); + this.Owner = null; + } + + #endregion + + #region member functinality + + public void Join(MooNetClient client, ulong remoteObjectId) + { + client.MapLocalObjectID(this.DynamicId, remoteObjectId); + this.AddMember(client); + } + + public void AddMember(MooNetClient client) + { + if (HasUser(client)) + { + Logger.Warn("Attempted to add client {0} to channel when it was already a member of the channel", client.Connection.RemoteEndPoint.ToString()); + return; + } + + var identity = client.GetIdentity(false, true, false); + + bool isOwner = client == this.Owner; + var addedMember = new Member(identity, (isOwner) ? Member.Privilege.UnkCreator : Member.Privilege.UnkJoinedMember); + + //if (this.Members.Count > 0) + //{ + // addedMember.AddRoles((isOwner) ? Member.Role.PartyLeader : Member.Role.PartyMember, Member.Role.ChannelMember); + //} + //else + //{ + addedMember.AddRole((isOwner) ? Member.Role.ChannelCreator : Member.Role.ChannelMember); + //} + + // This needs to be here so that the foreach below will also send to the client that was just added + this.Members.Add(client, addedMember); + + // Cache the built state and member + var channelState = this.State.ToBuilder(); + if (this.Attributes.Count > 0) + channelState.AddRangeAttribute(this.Attributes.Values); + if (this.Invitations.Count > 0) + channelState.AddRangeInvitation(this.Invitations.Values); + // added member should recieve a NotifyAdd. + var addNotification = bnet.protocol.channel.AddNotification.CreateBuilder() + .SetChannelState(channelState.Build()) + .SetSelf(addedMember.BnetMember) + .AddRangeMember(this.Members.Values.ToList().Select(member => member.BnetMember).ToList()).Build(); + + client.MakeTargetedRPC(this, () => + bnet.protocol.channel.ChannelSubscriber.CreateStub(client).NotifyAdd(null, addNotification, callback => { })); + + //send bnet,2,7 target = addedmember.gameaccount + //this always follows channel.AddNotification + var fieldKey = FieldKeyHelper.Create(FieldKeyHelper.Program.D3, FieldKeyHelper.OriginatingClass.GameAccount, 7, 0); + var field = bnet.protocol.presence.Field.CreateBuilder().SetKey(fieldKey); + field.SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetStringValue(client.Account.BnetEntityId.Low.ToString() + "#1").Build()); + var operation = bnet.protocol.presence.FieldOperation.CreateBuilder().SetField(field.Build()).Build(); + var state = bnet.protocol.presence.ChannelState.CreateBuilder().SetEntityId(client.Account.CurrentGameAccount.BnetEntityId).AddFieldOperation(operation).Build(); + var channelStatePresense = bnet.protocol.channel.ChannelState.CreateBuilder().SetExtension(bnet.protocol.presence.ChannelState.Presence, state); + var notification = bnet.protocol.channel.UpdateChannelStateNotification.CreateBuilder().SetStateChange(channelStatePresense).Build(); + client.MakeTargetedRPC(client.Account.CurrentGameAccount, () => + bnet.protocol.channel.ChannelSubscriber.CreateStub(client).NotifyUpdateChannelState(null, notification, callback => { })); + + + if (this.IsGameChannel) + { + if (client.GameChannel != null) + Logger.Warn("Client {0} in game channel {1}, but joining game channel {2}.", client, client.GameChannel, this); + client.GameChannel = this; + } + else + { + if (client.PartyChannel != null) + Logger.Warn("Client {0} in party channel {1}, but joining party channel {2}.", client, client.PartyChannel, this); + client.PartyChannel = this; + } + + client.CurrentChannel = this; // set clients current channel to one he just joined. + + if (this.Members.Count < 2) return; + + // other members should recieve a NotifyJoin. + var joinNotification = bnet.protocol.channel.JoinNotification.CreateBuilder() + .SetMember(addedMember.BnetMember).Build(); + + foreach (var pair in this.Members.Where(pair => pair.Value != addedMember)) // only send this to previous members of the channel. + { + pair.Key.MakeTargetedRPC(this, () => + bnet.protocol.channel.ChannelSubscriber.CreateStub(pair.Key).NotifyJoin(null, joinNotification, callback => { })); + } + } + + public void RemoveAllMembers(bool dissolving) + { + if (!dissolving) + { + Dissolve(); + return; + } + foreach (var pair in this.Members) + { + // TODO: There should probably be a RemoveReason for "channel dissolved"; find it! + RemoveMember(pair.Key, RemoveReason.Left, true); + } + } + + public void RemoveMemberByID(bnet.protocol.EntityId memberId, RemoveReason reason) + { + var client = this.Members.FirstOrDefault(pair => pair.Value.Identity.AccountId == memberId).Key; + RemoveMember(client, reason, false); + } + + public void RemoveMember(MooNetClient client, RemoveReason reason) + { + RemoveMember(client, reason, false); + } + + public void RemoveMember(MooNetClient client, RemoveReason reason, bool dissolving) + { + if (client.Account.CurrentGameAccount == null) + { + Logger.Warn("Could not remove client {0} from channel {1}.", client.Connection.RemoteEndPoint.ToString(), this.ToString()); + return; + } + else if (!HasUser(client)) + { + Logger.Warn("Attempted to remove non-member client {0} from channel {1}.", client.Connection.RemoteEndPoint.ToString(), this.ToString()); + return; + } + else if (!client.Channels.ContainsValue(this)) + { + Logger.Warn("Client {0} being removed from a channel ({1}) he's not associated with.", client.Connection.RemoteEndPoint.ToString(), this.ToString()); + } + //else if (client.CurrentChannel != this) + //{ + // Logger.Warn("Client {0} is being removed from a channel ({1}) that is not its current one.", client.Connection.RemoteEndPoint.ToString(), this.ToString()); + //} + var memberId = this.Members[client].Identity.GameAccountId; + var message = bnet.protocol.channel.RemoveNotification.CreateBuilder() + .SetAgentId(memberId) //is this channel owner, member being removed or the one requesting removal of member? -Egris + .SetMemberId(memberId) + .SetReason((uint)reason) + .Build(); + + //Logger.Debug("NotifyRemove message:\n{0}", message.ToString()); + + foreach (var pair in this.Members) + { + pair.Key.MakeTargetedRPC(this, () => + bnet.protocol.channel.ChannelSubscriber.CreateStub(pair.Key).NotifyRemove(null, message, callback => { })); + } + + this.Members.Remove(client); + client.CurrentChannel = null; + //client.Channels.Remove(this.DynamicId); //Add this when CurrentChannel is fully removed from code -Egris + if (this.IsGameChannel) + { + client.GameChannel = null; + Logger.Warn("Client {0} left game channel {1}.", client, this); + } + else + { + client.PartyChannel = null; + Logger.Warn("Client {0} left party channel {1}.", client, this); + } + + if (client == this.Owner) + this.Owner = null; + + if (this.Members.Count == 0 && !dissolving) + Dissolve(); + } + + #endregion + + #region invitation functionality + public void AddInvitation(bnet.protocol.invitation.Invitation invitation) + { + this.Invitations.Add(invitation.Id, invitation); + } + + public void RemoveInvitation(bnet.protocol.invitation.Invitation invitation) + { + if (this.Invitations.ContainsKey(invitation.Id)) + { + this.Invitations.Remove(invitation.Id); + } + else + { + Logger.Warn("Tried to removed unmapped invitation {0} from channel {1}.", invitation.Id, this); + } + } + + #endregion + + #region channel-messaging + + public void SendMessage(MooNetClient client, bnet.protocol.channel.Message message) + { + var notification = + bnet.protocol.channel.SendMessageNotification.CreateBuilder().SetAgentId(client.Account.CurrentGameAccount.BnetEntityId) + .SetMessage(message).SetRequiredPrivileges(0).Build(); + + + foreach (var pair in this.Members) // send to all members of channel even to the actual one that sent the message else he'll not see his own message. + { + pair.Key.MakeTargetedRPC(this, () => + bnet.protocol.channel.ChannelSubscriber.CreateStub(pair.Key).NotifySendMessage(null, notification, callback => { })); + } + } + + #endregion + + #region channel state messages + + /// + /// bnet.protocol.channel.ChannelState message. + /// + public bnet.protocol.channel.ChannelState State + { + get + { + return bnet.protocol.channel.ChannelState.CreateBuilder() + .SetMinMembers(this.MinMembers) + .SetMaxMembers(this.MaxMembers) + .SetMaxInvitations(this.MaxInvitations) + .SetPrivacyLevel(this.PrivacyLevel) + .Build(); + } + } + + /// + /// bnet.protocol.channel.ChannelDescription message. + /// + public bnet.protocol.channel.ChannelDescription Description + { + get + { + var builder = bnet.protocol.channel.ChannelDescription.CreateBuilder() // NOTE: Can have extensions + .SetChannelId(this.BnetEntityId) + .SetState(this.State); + + if (this.Members.Count > 0) // No reason to set a value that defaults to 0 + builder.SetCurrentMembers((uint)this.Members.Count); + return builder.Build(); + } + } + + /// + /// bnet.protocol.channel.ChannelInfo message. + /// + public bnet.protocol.channel.ChannelInfo Info + { + get + { + var builder = bnet.protocol.channel.ChannelInfo.CreateBuilder() // NOTE: Can have extensions + .SetDescription(this.Description); + + foreach (var pair in this.Members) + { + builder.AddMember(pair.Value.BnetMember); + } + + return builder.Build(); + } + } + + #endregion + + #region remove-reason helpers + + // Reasons the client tries to remove a member - // TODO: Need more data to complete this + public enum RemoveRequestReason : uint + { + RequestedBySelf = 0x00 // Default; generally when the client quits or leaves a channel (for example, when switching toons) + // Kick is probably 0x01 or somesuch + } + + // Reasons a member was removed (sent in NotifyRemove) + public enum RemoveReason : uint + { + Kicked = 0x00, // The member was kicked + Left = 0x01 // The member left + } + + public static RemoveReason GetRemoveReasonForRequest(RemoveRequestReason reqreason) + { + switch (reqreason) + { + case RemoveRequestReason.RequestedBySelf: + return RemoveReason.Left; + default: + Logger.Warn("No RemoveReason for given RemoveRequestReason: {0}", Enum.GetName(typeof(RemoveRequestReason), reqreason)); + break; + } + return RemoveReason.Left; + } + + #endregion + + public override string ToString() + { + return String.Format("{{ Channel: [id: {0}] [owner: {1}] }}", this.DynamicId, this.Owner != null ? this.Owner.Account.CurrentGameAccount.CurrentToon.ToString() : "N/A"); + } + } +} diff --git a/src/Mooege/Core/MooNet/Channels/ChannelCommands.cs b/src/Mooege/Core/MooNet/Channels/ChannelCommands.cs new file mode 100644 index 00000000..ea4c391e --- /dev/null +++ b/src/Mooege/Core/MooNet/Channels/ChannelCommands.cs @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Linq; +using Mooege.Core.MooNet.Accounts; +using Mooege.Core.MooNet.Commands; +using Mooege.Net.MooNet; + +namespace Mooege.Core.MooNet.Channels +{ + [CommandGroup("channels", "Lists active channels.\nUsage: channels [client]", Account.UserLevels.Owner)] + public class ChannelCommands : CommandGroup + { + [DefaultCommand] + public string Channels(string[] @params, MooNetClient invokerClient) + { + //return Service.ProvidedServices.Aggregate("Provided services by server:\n", + // (current, pair) => current + string.Format("Id: 0x{0} Hash: 0x{1} [{2}]\n", pair.Value.ServiceID.ToString("X2"), pair.Value.Hash.ToString("X8"), pair.Key.Name)); + + var output = "Active Channels:\n"; + foreach (var channel in ChannelManager.Channels.Values) + { + output += string.Format("Id: {0}\t Owner: {1}\n", channel.DynamicId, channel.Owner); + foreach (var member in channel.Members.Keys) + { + output += string.Format("\tMembers: {0}\n", member); + } + } + return output; + //return ChannelManager.Channels.Aggregate("Active Channels:\n", + // (current, pair) => current + string.Format("Id: {0} \tOwner: {1}\n", pair.Value.DynamicId, pair.Value.Owner)); + } + + [Command("state", "Show state of channel.\nUsage: channels state ", Account.UserLevels.Owner)] + public string ChannelState(string[] @params, MooNetClient invokerClient) + { + if (@params.Count() < 1) + return "Invalid arguments. Type 'help channels state' to get help."; + + UInt64 dynamicId; + + if (!UInt64.TryParse(@params[0], out dynamicId)) + return "Invalid arguments. Type 'help channels state' to get help."; + + var channel = ChannelManager.GetChannelByDynamicId(dynamicId); + + if (channel == null) + return "Invalid Channel Id.\nType 'channels list' to get a list of active channels."; + + return channel.State.ToString(); + } + + [Command("list", "Shows list of active channels.\nUsage: channels list", Account.UserLevels.Owner)] + public string ChannelList(string[] @params, MooNetClient invokerClient) + { + return ChannelManager.Channels.Keys.ToString(); + } + + + [Command("client", "Shows active channels for client.\nUsage: channels client [email]")] + public string ClientChannels(string[] @params, MooNetClient invokerClient) + { + var client = invokerClient; + + if (client == null && @params.Count() < 1) + return "Invalid arguments. Type 'help channels client' to get help."; + var output = ""; + + + if (client == null) + { + var email = @params[0]; + var account = AccountManager.GetAccountByEmail(email); + + if (account == null) + return string.Format("No account with email '{0}' exists.", email); + + if (!account.IsOnline) + return string.Format("Account '{0}' is not logged in.", email); + + var gameAccounts = GameAccountManager.GetGameAccountsForAccount(account); + foreach (var gameAccount in gameAccounts) + { + output += this.ClientChannels(null, gameAccount.LoggedInClient); + } + } + else + { + output = string.Format("Active channels for account: {0}\n", client.Account.Email); + output = ChannelManager.Channels.Aggregate(output, (current, pair) => + current + string.Format("Id: {0} \tOwner: {1}\n", pair.Value.DynamicId, pair.Value.Owner)); + } + return output; + } + } +} diff --git a/src/Mooege/Core/MooNet/Channels/ChannelInvitationManager.cs b/src/Mooege/Core/MooNet/Channels/ChannelInvitationManager.cs new file mode 100644 index 00000000..c4fac3fe --- /dev/null +++ b/src/Mooege/Core/MooNet/Channels/ChannelInvitationManager.cs @@ -0,0 +1,155 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using System.Linq; +using Mooege.Core.MooNet.Objects; +using Mooege.Core.MooNet.Accounts; +using Mooege.Core.MooNet.Helpers; +using Mooege.Net.MooNet; + +namespace Mooege.Core.MooNet.Channels +{ + public class ChannelInvitationManager : RPCObject + { + private readonly Dictionary _onGoingInvitations = new Dictionary(); + + public static ulong InvitationIdCounter = 1; + + public ChannelInvitationManager() + { + // TODO: Hardcoded 1 as channel persistent id in this case... + this.BnetEntityId = bnet.protocol.EntityId.CreateBuilder().SetHigh((ulong)EntityIdHelper.HighIdType.ChannelId).SetLow(1).Build(); + } + + public bnet.protocol.invitation.Invitation GetInvitationById(ulong Id) + { + if (!this._onGoingInvitations.ContainsKey(Id)) + return null; + else + return this._onGoingInvitations[Id]; + } + + public void HandleInvitation(MooNetClient client, bnet.protocol.invitation.Invitation invitation) + { + var invitee = this.Subscribers.FirstOrDefault(subscriber => subscriber.Account.CurrentGameAccount.BnetEntityId.Low == invitation.InviteeIdentity.GameAccountId.Low); + if (invitee == null) return; // if we can't find invite just return - though we should actually check for it until expiration time. + + this._onGoingInvitations.Add(invitation.Id, invitation); // track ongoing invitations so we can tranport it forth and back. + + var notification = bnet.protocol.channel_invitation.InvitationAddedNotification.CreateBuilder().SetInvitation(invitation); + + invitee.MakeTargetedRPC(this, () => + bnet.protocol.channel_invitation.ChannelInvitationNotify.CreateStub(invitee).NotifyReceivedInvitationAdded(null, notification.Build(), callback => { })); + } + + public Channel HandleAccept(MooNetClient client, bnet.protocol.channel_invitation.AcceptInvitationRequest request) + { + if (!this._onGoingInvitations.ContainsKey(request.InvitationId)) return null; + + var invitation = this._onGoingInvitations[request.InvitationId]; + var channel = ChannelManager.GetChannelByEntityId(invitation.GetExtension(bnet.protocol.channel_invitation.ChannelInvitation.ChannelInvitationProp).ChannelDescription.ChannelId); + + var notification = bnet.protocol.channel_invitation.InvitationRemovedNotification.CreateBuilder().SetInvitation(invitation.ToBuilder()).SetReason((uint)InvitationRemoveReason.Accepted); + this._onGoingInvitations.Remove(invitation.Id); + + // notify invitee and let him remove the handled invitation. + client.MakeTargetedRPC(this, () => + bnet.protocol.channel_invitation.ChannelInvitationNotify.CreateStub(client).NotifyReceivedInvitationRemoved(null, notification.Build(), callback => { })); + + channel.Join(client, request.ObjectId); // add invitee to channel -- so inviter and other members will also be notified too. + + var inviter = GameAccountManager.GetAccountByPersistentID(invitation.InviterIdentity.AccountId.Low); + + var stateNotification = bnet.protocol.channel.UpdateChannelStateNotification.CreateBuilder() + .SetAgentId(bnet.protocol.EntityId.CreateBuilder().SetHigh(0).SetLow(0).Build()) + .SetStateChange(bnet.protocol.channel.ChannelState.CreateBuilder().AddRangeInvitation(channel.Invitations.Values).SetReason(0).Build()) + .Build(); + + foreach (var member in channel.Members.Keys) + { + member.MakeTargetedRPC(channel, () => + bnet.protocol.channel.ChannelSubscriber.CreateStub(member).NotifyUpdateChannelState(null, stateNotification, callback => { })); + } + + return channel; + } + + public void HandleDecline(MooNetClient client, bnet.protocol.invitation.GenericRequest request) + { + if (!this._onGoingInvitations.ContainsKey(request.InvitationId)) return; + var invitation = this._onGoingInvitations[request.InvitationId]; + + var inviter = GameAccountManager.GetAccountByPersistentID(invitation.InviterIdentity.AccountId.Low); + if (inviter == null || inviter.LoggedInClient == null) return; + + var notification = + bnet.protocol.channel.UpdateChannelStateNotification.CreateBuilder() + .SetAgentId(bnet.protocol.EntityId.CreateBuilder().SetHigh(0).SetLow(0)) // caps have this set to high: 0 low: 0 /raist. + .SetStateChange(bnet.protocol.channel.ChannelState.CreateBuilder().AddInvitation(invitation) + .SetReason((uint)InvitationRemoveReason.Declined)); + + this._onGoingInvitations.Remove(invitation.Id); + + // notify invoker about the decline. + inviter.LoggedInClient.MakeTargetedRPC(inviter.LoggedInClient.PartyChannel, () => + bnet.protocol.channel.ChannelSubscriber.CreateStub(inviter.LoggedInClient).NotifyUpdateChannelState(null, notification.Build(), callback => { })); + + //inviter.LoggedInClient.MakeTargetedRPC(inviter.LoggedInClient.CurrentChannel, () => + // bnet.protocol.channel.ChannelSubscriber.CreateStub(inviter.LoggedInClient).NotifyUpdateChannelState(null, notification.Build(), callback => { })); + } + + public void Revoke(MooNetClient client, bnet.protocol.channel_invitation.RevokeInvitationRequest request) + { + if (!this._onGoingInvitations.ContainsKey(request.InvitationId)) return; + var invitation = this._onGoingInvitations[request.InvitationId]; + + var channel = ChannelManager.GetChannelByEntityId(request.ChannelId); + + //notify inviter about revoke + var updateChannelNotification = + bnet.protocol.channel.UpdateChannelStateNotification.CreateBuilder() + .SetAgentId(bnet.protocol.EntityId.CreateBuilder().SetHigh(0).SetLow(0)) // caps have this set to high: 0 low: 0 /dustin + .SetStateChange(bnet.protocol.channel.ChannelState.CreateBuilder() + .AddInvitation(invitation) + .SetReason((uint)InvitationRemoveReason.Revoked)); + + this._onGoingInvitations.Remove(request.InvitationId); + + client.MakeTargetedRPC(channel, () => + bnet.protocol.channel.ChannelSubscriber.CreateStub(client).NotifyUpdateChannelState(null, updateChannelNotification.Build(), callback => { })); + + //notify invitee about revoke + var invitationRemoved = + bnet.protocol.channel_invitation.InvitationRemovedNotification.CreateBuilder() + .SetInvitation(invitation) + .SetReason((uint)InvitationRemoveReason.Revoked); + + var invitee = GameAccountManager.GetAccountByPersistentID(invitation.InviteeIdentity.AccountId.Low); + invitee.LoggedInClient.MakeTargetedRPC(this, () => + bnet.protocol.channel_invitation.ChannelInvitationNotify.CreateStub(invitee.LoggedInClient).NotifyReceivedInvitationRemoved(null, invitationRemoved.Build(), callback => { })); + } + + public enum InvitationRemoveReason : uint // not sure -- and don't have all the values yet /raist. + { + Accepted = 0x0, + Declined = 0x1, + Revoked = 0x2 + } + } +} diff --git a/src/Mooege/Core/MooNet/Channels/ChannelManager.cs b/src/Mooege/Core/MooNet/Channels/ChannelManager.cs new file mode 100644 index 00000000..8a5e7d1c --- /dev/null +++ b/src/Mooege/Core/MooNet/Channels/ChannelManager.cs @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using Mooege.Common.Logging; +using Mooege.Core.MooNet.Helpers; +using Mooege.Net.MooNet; + +namespace Mooege.Core.MooNet.Channels +{ + public static class ChannelManager + { + private static readonly Logger Logger = LogManager.CreateLogger(); + + public readonly static Dictionary Channels = + new Dictionary(); + + public static Channel CreateNewChannel(MooNetClient client, ulong remoteObjectId) + { + var channel = new Channel(client, false, remoteObjectId); + Channels.Add(channel.DynamicId, channel); + return channel; + } + + public static void AddGameChannel(Channel channel) + { + Channels.Add(channel.DynamicId, channel); + } + + public static void DissolveChannel(ulong id) + { + Logger.Debug("Dissolving channel {0}", id); + if (!Channels.ContainsKey(id)) + { + Logger.Warn("Attempted to delete a non-existent channel with ID {0}", id); + return; + } + var channel = Channels[id]; + channel.RemoveAllMembers(true); + Channels.Remove(id); + } + + public static Channel GetChannelByEntityId(bnet.protocol.EntityId entityId) + { + if (entityId.GetHighIdType() == EntityIdHelper.HighIdType.ChannelId) + { + if (Channels.ContainsKey(entityId.Low)) + return Channels[entityId.Low]; + } + else + Logger.Warn("Given entity ID doesn't look like a channel ID!"); + return null; + } + + public static Channel GetChannelByEntityId(D3.OnlineService.EntityId entityId) + { + if (entityId.IdHigh == (ulong)EntityIdHelper.HighIdType.ChannelId) + { + if (Channels.ContainsKey(entityId.IdLow)) + return Channels[entityId.IdLow]; + } + else + Logger.Warn("Given entity ID doesn't look like a channel ID!"); + return null; + } + + public static Channel GetChannelByDynamicId(ulong dynamicId) + { + if (!Channels.ContainsKey(dynamicId)) + throw new Exception(string.Format("No channel exists with given dynamic id: {0}", dynamicId)); + else + return Channels[dynamicId]; + } + } +} diff --git a/src/Mooege/Core/MooNet/Channels/Member.cs b/src/Mooege/Core/MooNet/Channels/Member.cs new file mode 100644 index 00000000..a2502b6a --- /dev/null +++ b/src/Mooege/Core/MooNet/Channels/Member.cs @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; + +namespace Mooege.Core.MooNet.Channels +{ + public class Member + { + // TODO: Need moar! + public enum Role : uint + { + ChannelMember = 1, + ChannelCreator = 2, + PartyMember = 100, + PartyLeader = 101 // There's a cap where no member has Role.ChannelCreator (which is plausible since games are actually channels) + } + + // TODO: These are flags.. + [Flags] + public enum Privilege : ulong + { + None = 0, + Chat = 0x20000, + + // Combinations with unknowns.. + UnkCreator = 0x0000FBFF, + UnkMember = 0x00030BAA, + UnkMember2 = 0x00030B80, + UnkJoinedMember = 0x0000DBC5 + } + + public bnet.protocol.Identity Identity { get; set; } + public Privilege Privileges { get; set; } + public List Roles { get; private set; } + public bnet.protocol.AccountInfo Info { get; private set; } + + public bnet.protocol.channel.MemberState BnetMemberState + { + get + { + var builder = bnet.protocol.channel.MemberState.CreateBuilder(); + if (this.Privileges != Privilege.None) + builder.SetPrivileges((ulong)this.Privileges); // We don't have to set this if it is the default (0) + foreach (var role in this.Roles) + { + builder.AddRole((uint)role); + } + builder.SetInfo(this.Info); + return builder.Build(); + } + } + + public bnet.protocol.channel.Member BnetMember + { + get + { + return bnet.protocol.channel.Member.CreateBuilder() + .SetIdentity(this.Identity) + .SetState(this.BnetMemberState) + .Build(); + } + } + + public Member(bnet.protocol.Identity identity, Privilege privs, params Role[] roles) + { + this.Identity = identity; + this.Privileges = privs; + this.Roles = new List(); + AddRoles(roles); + this.Info = bnet.protocol.AccountInfo.CreateBuilder() + .SetAccountPaid(true) + .SetCountryId(21843) + .Build(); + } + + public void AddRoles(params Role[] roles) + { + foreach (var role in roles) + AddRole(role); + } + + public void AddRole(Role role) + { + if (!this.Roles.Contains(role)) + this.Roles.Add(role); + } + } +} diff --git a/src/Mooege/Core/MooNet/Commands/CommandAttribute.cs b/src/Mooege/Core/MooNet/Commands/CommandAttribute.cs new file mode 100644 index 00000000..161701ca --- /dev/null +++ b/src/Mooege/Core/MooNet/Commands/CommandAttribute.cs @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using Mooege.Core.MooNet.Accounts; + +namespace Mooege.Core.MooNet.Commands +{ + [AttributeUsage(AttributeTargets.Class)] + public class CommandGroupAttribute : Attribute + { + /// + /// Command group's name. + /// + public string Name { get; private set; } + + /// + /// Help text for command group. + /// + public string Help { get; private set; } + + /// + /// Minimum user level required to invoke the command. + /// + public Account.UserLevels MinUserLevel { get; private set; } + + public CommandGroupAttribute(string name, string help, Account.UserLevels minUserLevel = Account.UserLevels.User) + { + this.Name = name.ToLower(); + this.Help = help; + this.MinUserLevel = minUserLevel; + } + } + + [AttributeUsage(AttributeTargets.Method)] + public class CommandAttribute : Attribute + { + /// + /// Command's name. + /// + public string Name { get; private set; } + + /// + /// Help text for command. + /// + public string Help { get; private set; } + + /// + /// Minimum user level required to invoke the command. + /// + public Account.UserLevels MinUserLevel { get; private set; } + + public CommandAttribute(string command, string help, Account.UserLevels minUserLevel = Account.UserLevels.User) + { + this.Name = command.ToLower(); + this.Help = help; + this.MinUserLevel = minUserLevel; + } + } + + [AttributeUsage(AttributeTargets.Method)] + public class DefaultCommand : CommandAttribute + { + public DefaultCommand(Account.UserLevels minUserLevel = Account.UserLevels.User) + : base("", "", minUserLevel) + { + } + } +} diff --git a/src/Mooege/Core/MooNet/Commands/CommandGroup.cs b/src/Mooege/Core/MooNet/Commands/CommandGroup.cs new file mode 100644 index 00000000..9b55dd5e --- /dev/null +++ b/src/Mooege/Core/MooNet/Commands/CommandGroup.cs @@ -0,0 +1,139 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using Mooege.Common.Logging; +using Mooege.Net.MooNet; + +namespace Mooege.Core.MooNet.Commands +{ + public class CommandGroup + { + private static readonly Logger Logger = LogManager.CreateLogger(); + + public CommandGroupAttribute Attributes { get; private set; } + + private readonly Dictionary _commands = + new Dictionary(); + + public void Register(CommandGroupAttribute attributes) + { + this.Attributes = attributes; + this.RegisterDefaultCommand(); + this.RegisterCommands(); + } + + private void RegisterCommands() + { + foreach (var method in this.GetType().GetMethods()) + { + object[] attributes = method.GetCustomAttributes(typeof(CommandAttribute), true); + if (attributes.Length == 0) continue; + + var attribute = (CommandAttribute)attributes[0]; + if (attribute is DefaultCommand) continue; + + if (!this._commands.ContainsKey(attribute)) + this._commands.Add(attribute, method); + else + Logger.Warn("There exists an already registered command '{0}'.", attribute.Name); + } + } + + private void RegisterDefaultCommand() + { + foreach (var method in this.GetType().GetMethods()) + { + object[] attributes = method.GetCustomAttributes(typeof(DefaultCommand), true); + if (attributes.Length == 0) continue; + if (method.Name.ToLower() == "fallback") continue; + + this._commands.Add(new DefaultCommand(this.Attributes.MinUserLevel), method); + return; + } + + // set the fallback command if we couldn't find a defined DefaultCommand. + this._commands.Add(new DefaultCommand(this.Attributes.MinUserLevel), this.GetType().GetMethod("Fallback")); + } + + public virtual string Handle(string parameters, MooNetClient invokerClient = null) + { + // check if the user has enough privileges to access command group. + // check if the user has enough privileges to invoke the command. + if (invokerClient != null && this.Attributes.MinUserLevel > invokerClient.Account.UserLevel) + return "You don't have enough privileges to invoke that command."; + + string[] @params = null; + CommandAttribute target = null; + + if (parameters == string.Empty) + target = this.GetDefaultSubcommand(); + else + { + @params = parameters.Split(' '); + target = this.GetSubcommand(@params[0]) ?? this.GetDefaultSubcommand(); + + if (target != this.GetDefaultSubcommand()) + @params = @params.Skip(1).ToArray(); + } + + // check if the user has enough privileges to invoke the command. + if (invokerClient != null && target.MinUserLevel > invokerClient.Account.UserLevel) + return "You don't have enough privileges to invoke that command."; + + return (string)this._commands[target].Invoke(this, new object[] { @params, invokerClient }); + } + + public string GetHelp(string command) + { + foreach (var pair in this._commands) + { + if (command != pair.Key.Name) continue; + return pair.Key.Help; + } + + return string.Empty; + } + + [DefaultCommand] + public virtual string Fallback(string[] @params = null, MooNetClient invokerClient = null) + { + var output = "Available subcommands: "; + foreach (var pair in this._commands) + { + if (pair.Key.Name.Trim() == string.Empty) continue; // skip fallback command. + if (invokerClient != null && pair.Key.MinUserLevel > invokerClient.Account.UserLevel) continue; + output += pair.Key.Name + ", "; + } + + return output.Substring(0, output.Length - 2) + "."; + } + + protected CommandAttribute GetDefaultSubcommand() + { + return this._commands.Keys.First(); + } + + protected CommandAttribute GetSubcommand(string name) + { + return this._commands.Keys.FirstOrDefault(command => command.Name == name); + } + } +} diff --git a/src/Mooege/Core/MooNet/Commands/CommandManager.cs b/src/Mooege/Core/MooNet/Commands/CommandManager.cs new file mode 100644 index 00000000..f875ec55 --- /dev/null +++ b/src/Mooege/Core/MooNet/Commands/CommandManager.cs @@ -0,0 +1,209 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using Mooege.Common.Logging; +using Mooege.Net.MooNet; + +namespace Mooege.Core.MooNet.Commands +{ + public static class CommandManager + { + private static readonly Logger Logger = LogManager.CreateLogger(); + private static readonly Dictionary CommandGroups = new Dictionary(); + + static CommandManager() + { + RegisterCommandGroups(); + } + + private static void RegisterCommandGroups() + { + foreach (var type in Assembly.GetExecutingAssembly().GetTypes()) + { + if (!type.IsSubclassOf(typeof(CommandGroup))) continue; + + var attributes = (CommandGroupAttribute[])type.GetCustomAttributes(typeof(CommandGroupAttribute), true); + if (attributes.Length == 0) continue; + + var groupAttribute = attributes[0]; + if (CommandGroups.ContainsKey(groupAttribute)) + Logger.Warn("There exists an already registered command group named '{0}'.", groupAttribute.Name); + + var commandGroup = (CommandGroup)Activator.CreateInstance(type); + commandGroup.Register(groupAttribute); + CommandGroups.Add(groupAttribute, commandGroup); + } + } + + /// + /// Parses a given line from console as a command if any. + /// + /// The line to be parsed. + public static void Parse(string line) + { + string output = string.Empty; + string command; + string parameters; + var found = false; + + if (line == null) return; + if (line.Trim() == string.Empty) return; + + if (!ExtractCommandAndParameters(line, out command, out parameters)) + { + output = "Unknown command: " + line; + Logger.Info(output); + return; + } + + foreach (var pair in CommandGroups) + { + if (pair.Key.Name != command) continue; + output = pair.Value.Handle(parameters); + found = true; + break; + } + + if (found == false) + output = string.Format("Unknown command: {0} {1}", command, parameters); + + if (output != string.Empty) + Logger.Info(output); + } + + + /// + /// Tries to parse given line as a server command. + /// + /// The line to be parsed. + /// The invoker client if any. + /// + public static bool TryParse(string line, MooNetClient invokerClient) + { + string output = string.Empty; + string command; + string parameters; + var found = false; + + if (invokerClient == null) + throw new ArgumentException("invokerClient"); + + if (!ExtractCommandAndParameters(line, out command, out parameters)) + return false; + + foreach (var pair in CommandGroups) + { + if (pair.Key.Name != command) continue; + output = pair.Value.Handle(parameters, invokerClient); + found = true; + break; + } + + if (found == false) + output = string.Format("Unknown command: {0} {1}", command, parameters); + + if (output == string.Empty) + return true; + + output = "[mooege] " + output; + + invokerClient.SendServerWhisper(output); + + return true; + } + + public static bool ExtractCommandAndParameters(string line, out string command, out string parameters) + { + line = line.Trim(); + command = string.Empty; + parameters = string.Empty; + + if (line == string.Empty) + return false; + + if (line[0] != Config.Instance.CommandPrefix) // if line does not start with command-prefix + return false; + + line = line.Substring(1); // advance to actual command. + command = line.Split(' ')[0].ToLower(); // get command + parameters = String.Empty; + if (line.Contains(' ')) parameters = line.Substring(line.IndexOf(' ') + 1).Trim(); // get parameters if any. + + return true; + } + + [CommandGroup("commands", "Lists available commands for your user-level.")] + public class CommandsCommandGroup : CommandGroup + { + public override string Fallback(string[] parameters = null, MooNetClient invokerClient = null) + { + var output = "Available commands: "; + foreach (var pair in CommandGroups) + { + if (invokerClient != null && pair.Key.MinUserLevel > invokerClient.Account.UserLevel) continue; + output += pair.Key.Name + ", "; + } + + output = output.Substring(0, output.Length - 2) + "."; + return output + "\nType 'help ' to get help."; + } + } + + [CommandGroup("help", "Oh no, we forgot to add a help to text to help command itself!")] + public class HelpCommandGroup : CommandGroup + { + public override string Fallback(string[] parameters = null, MooNetClient invokerClient = null) + { + return "usage: help "; + } + + public override string Handle(string parameters, MooNetClient invokerClient = null) + { + if (parameters == string.Empty) + return this.Fallback(); + + string output = string.Empty; + bool found = false; + var @params = parameters.Split(' '); + var group = @params[0]; + var command = @params.Count() > 1 ? @params[1] : string.Empty; + + foreach (var pair in CommandGroups) + { + if (group != pair.Key.Name) + continue; + + if (command == string.Empty) + return pair.Key.Help; + + output = pair.Value.GetHelp(command); + found = true; + } + + if (!found) + output = string.Format("Unknown command: {0} {1}", group, command); + + return output; + } + } + } +} diff --git a/src/Mooege/Core/MooNet/Commands/Config.cs b/src/Mooege/Core/MooNet/Commands/Config.cs new file mode 100644 index 00000000..aa692568 --- /dev/null +++ b/src/Mooege/Core/MooNet/Commands/Config.cs @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace Mooege.Core.MooNet.Commands +{ + public sealed class Config : Mooege.Common.Config.Config + { + public char CommandPrefix { get { return this.GetString("CommandPrefix", "!")[0]; } set { this.Set("CommandPrefix", value); } } + + private static readonly Config _instance = new Config(); + public static Config Instance { get { return _instance; } } + private Config() : base("Commands") { } + } +} diff --git a/src/Mooege/Core/MooNet/Commands/DebugCommands.cs b/src/Mooege/Core/MooNet/Commands/DebugCommands.cs new file mode 100644 index 00000000..d0f4e861 --- /dev/null +++ b/src/Mooege/Core/MooNet/Commands/DebugCommands.cs @@ -0,0 +1,133 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Linq; +using Mooege.Common.Helpers.Hash; +using Mooege.Core.MooNet.Accounts; +using Mooege.Core.MooNet.Objects; +using Mooege.Core.MooNet.Services; +using Mooege.Net.MooNet; + +namespace Mooege.Core.MooNet.Commands +{ + [CommandGroup("services", "Lists moonet services provided by the server.\nUsage: services [client]", Account.UserLevels.Owner)] + public class ServiceDebugCommands : CommandGroup + { + [DefaultCommand] + public string Services(string[] @params, MooNetClient invokerClient) + { + return Service.ProvidedServices.Aggregate("Provided services by server:\n", + (current, pair) => current + string.Format("Id: 0x{0} Hash: 0x{1} [{2}]\n", pair.Value.ServiceID.ToString("X2"), pair.Value.Hash.ToString("X8"), pair.Key.Name)); + } + + [Command("client", "Shows imported service list for client.\nUsage: services client [email]")] + public string ClientServices(string[] @params, MooNetClient invokerClient) + { + var client = invokerClient; + + if (client == null && @params.Count() < 1) + return "Invalid arguments. Type 'help services client' to get help."; + var output = ""; + if (client == null) + { + var email = @params[0]; + var account = AccountManager.GetAccountByEmail(email); + + if (account == null) + return string.Format("No account with email '{0}' exists.", email); + + if (!account.IsOnline) + return string.Format("Account '{0}' is not logged in.", email); + + var gameAccounts = GameAccountManager.GetGameAccountsForAccount(account); + foreach (var gameAccount in gameAccounts) + { + output += this.ClientServices(null, gameAccount.LoggedInClient); + } + } + else + { + output = string.Format("Imported service list for account: {0}\n", client.Account.Email); + output = client.Services.Aggregate(output, (current, pair) => + current + string.Format("Id: 0x{0} Hash: 0x{1}\n", pair.Value.ToString("X2"), pair.Key.ToString("X8"))); + } + return output; + } + } + + [CommandGroup("hash", "Create hashes.", Account.UserLevels.Owner)] + public class HashDebugCommands : CommandGroup + { + [Command("hashitem", "Hash case insensitive (item names)")] + public string HashItem(string[] @params, MooNetClient invokerClient) + { + if (@params.Count() < 1) + return "Invalid arguments. Type 'help hash show' to get help."; + + return StringHashHelper.HashItemName(@params[0]).ToString(); + } + + [Command("hash", "Hash case Sensitive")] + public string HashNormal(string[] @params, MooNetClient invokerClient) + { + if (@params.Count() < 1) + return "Invalid arguments. Type 'help hash show' to get help."; + + return StringHashHelper.HashNormal(@params[0]).ToString(); + } + } + + [CommandGroup("rpcobject", "Lists rpc-objects.", Account.UserLevels.Admin)] + public class RPCObjectDebugCommands : CommandGroup + { + [Command("list", "Shows lists of RPCObjects")] + public string List(string[] @params, MooNetClient invokerClient) + { + return RPCObjectManager.Objects.Aggregate("RPCObjects:\n", + (current, pair) => current + string.Format("Id: 0x{0} - {1} [{2}]\n", pair.Key.ToString("X8"), pair.Value.GetType().Name, pair.Value.ToString())); + } + + [Command("show", "Prints detailed debug information for RPCObject.\nUsage: rpcobject show ")] + public string Show(string[] @params, MooNetClient invokerClient) + { + if (@params.Count() < 1) + return "Invalid arguments. Type 'help rpcobject show' to get help."; + + ulong localId; + var id = @params[0]; + if (!ulong.TryParse(id, out localId)) + return string.Format("Can not parse '{0}' as valid id.", id); + + if (!RPCObjectManager.Objects.ContainsKey(localId)) + return string.Format("There exists no RPCObject with dynamidId: {0}", localId); + + var rpcObject = RPCObjectManager.Objects[localId]; + var output = string.Format("[RPCObject]\nDynamicId: 0x{0}\nType: {1}\nObject: {2}\n", rpcObject.DynamicId, + rpcObject.GetType().Name, rpcObject); + + output += "[Subscribers]\n"; + foreach (var client in rpcObject.Subscribers) + { + var remoteId = client.GetRemoteObjectId(rpcObject.DynamicId); + output += string.Format("RemoteId: 0x{0} - {1}\n", remoteId.ToString("X8"), client.Account.Email); + } + + return output; + } + } +} diff --git a/src/Mooege/Core/MooNet/Commands/ServerCommands.cs b/src/Mooege/Core/MooNet/Commands/ServerCommands.cs new file mode 100644 index 00000000..a07e40ac --- /dev/null +++ b/src/Mooege/Core/MooNet/Commands/ServerCommands.cs @@ -0,0 +1,207 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Linq; +using System.Diagnostics; +using System.Reflection; +using System.Text; +using Mooege.Core.MooNet.Accounts; +using Mooege.Core.MooNet.Online; +using Mooege.Core.MooNet.Toons; +using Mooege.Net.MooNet; + +namespace Mooege.Core.MooNet.Commands +{ + [CommandGroup("stats", "Renders statistics.\nUsage: stats [system].")] + public class StatsCommand : CommandGroup + { + [DefaultCommand] + public string Stats(string[] @params, MooNetClient invokerClient) + { + return string.Format("Total Accounts: {0}, Total Toons: {1} Online Players: {2} ", + AccountManager.TotalAccounts, ToonManager.TotalToons, PlayerManager.OnlinePlayers.Count); + } + + [Command("system", "Renders system statistics.", Account.UserLevels.Admin)] + public string Detailed(string[] @params, MooNetClient invokerClient) + { + var output = new StringBuilder(); + + output.AppendFormat("GC Allocated Memory: {0}KB ", GC.GetTotalMemory(true) / 1024); + + if (PerformanceCounterCategory.Exists("Processor") && PerformanceCounterCategory.CounterExists("% Processor Time", "Processor")) + { + var processorTimeCounter = new PerformanceCounter { CategoryName = "Processor", CounterName = "% Processor Time", InstanceName = "_Total" }; + output.AppendFormat("Processor Time: {0}%", processorTimeCounter.NextValue()); + } + + if (PerformanceCounterCategory.Exists(".NET CLR LocksAndThreads")) + { + if (PerformanceCounterCategory.CounterExists("# of current physical Threads", ".NET CLR LocksAndThreads")) + { + var physicalThreadsCounter = new PerformanceCounter { CategoryName = ".NET CLR LocksAndThreads", CounterName = "# of current physical Threads", InstanceName = Process.GetCurrentProcess().ProcessName }; + output.AppendFormat("\nPhysical Threads: {0} ", physicalThreadsCounter.NextValue()); + } + + if (PerformanceCounterCategory.CounterExists("# of current logical Threads", ".NET CLR LocksAndThreads")) + { + var logicalThreadsCounter = new PerformanceCounter { CategoryName = ".NET CLR LocksAndThreads", CounterName = "# of current logical Threads", InstanceName = Process.GetCurrentProcess().ProcessName }; + output.AppendFormat("Logical Threads: {0} ", logicalThreadsCounter.NextValue()); + } + + if (PerformanceCounterCategory.CounterExists("Contention Rate / sec", ".NET CLR LocksAndThreads")) + { + var contentionRateCounter = new PerformanceCounter { CategoryName = ".NET CLR LocksAndThreads", CounterName = "Contention Rate / sec", InstanceName = Process.GetCurrentProcess().ProcessName }; + output.AppendFormat("Contention Rate: {0}/sec", contentionRateCounter.NextValue()); + } + } + + if (PerformanceCounterCategory.Exists(".NET CLR Exceptions") && PerformanceCounterCategory.CounterExists("# of Exceps Thrown", ".NET CLR Exceptions")) + { + var exceptionsThrownCounter = new PerformanceCounter { CategoryName = ".NET CLR Exceptions", CounterName = "# of Exceps Thrown", InstanceName = Process.GetCurrentProcess().ProcessName }; + output.AppendFormat("\nExceptions Thrown: {0}", exceptionsThrownCounter.NextValue()); + } + + return output.ToString(); + } + } + + [CommandGroup("uptime", "Renders uptime statistics.")] + public class UptimeCommand : CommandGroup + { + [DefaultCommand] + public string Uptime(string[] @params, MooNetClient invokerClient) + { + var uptime = DateTime.Now - Program.StartupTime; + return string.Format("Uptime: {0} days, {1} hours, {2} minutes, {3} seconds.", uptime.Days, uptime.Hours, uptime.Minutes, uptime.Seconds); + } + } + + [CommandGroup("version", "Renders server version.")] + public class VersionCommand : CommandGroup + { + [DefaultCommand] + public string Version(string[] @params, MooNetClient invokerClient) + { + return "mooege " + Assembly.GetExecutingAssembly().GetName().Version; + } + } + + [CommandGroup("motd", "Renders message of the day.")] + public class MOTDCommand : CommandGroup + { + [DefaultCommand] + public string MOTD(string[] @params, MooNetClient invokerClient) + { + return "Message of the day:" + Net.MooNet.Config.Instance.MOTD; + } + } + + [CommandGroup("server", "Allows you to control servers and start/stop them.", Account.UserLevels.Admin)] + public class ServerCommand : CommandGroup + { + [Command("start", "usage: server start [moonet|gs]")] + public string Start(string[] @params, MooNetClient invokerClient) + { + var startMooNet = false; + var startGS = false; + var output = string.Empty; + + if (@params.Count() > 0) + { + switch (@params[0]) + { + case "moonet": + startMooNet = true; + break; + case "gs": + startGS = true; + break; + } + } + else + { + startMooNet = true; + startGS = true; + } + + if (startMooNet) + { + if (!Program.StartMooNet()) + output += "MooNet server is already running. "; + } + + if (startGS) + { + if (!Program.StartGS()) + output += "GS is already running. "; + + } + + return output; + } + + [Command("stop", "usage: server stop [moonet|gs]")] + public string Stop(string[] @params, MooNetClient invokerClient) + { + var stopMooNet = false; + var stopGS = false; + var output = string.Empty; + + if (@params.Count() > 0) + { + switch (@params[0]) + { + case "moonet": + stopMooNet = true; + break; + case "gs": + stopGS = true; + break; + } + } + else + { + stopMooNet = true; + stopGS = true; + } + + if (stopMooNet) + { + if (!Program.StopMooNet()) + output += "MooNet server is already stopped. "; + } + + if (stopGS) + { + if (!Program.StopGS()) + output += "GS is already stopped. "; + } + + return output; + } + + [Command("shutdown", "usage: server shutdown")] + public string Shutdown(string[] @params, MooNetClient invokerClient) + { + Program.Shutdown(); + return string.Empty; + } + } +} \ No newline at end of file diff --git a/src/Mooege/Core/MooNet/Friends/FriendManager.cs b/src/Mooege/Core/MooNet/Friends/FriendManager.cs new file mode 100644 index 00000000..7f1b543f --- /dev/null +++ b/src/Mooege/Core/MooNet/Friends/FriendManager.cs @@ -0,0 +1,247 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Data.SQLite; +using System.Linq; +using Mooege.Common.Storage; +using Mooege.Core.MooNet.Accounts; +using Mooege.Core.MooNet.Helpers; +using Mooege.Core.MooNet.Objects; +using Mooege.Net.MooNet; +using Wintellect.PowerCollections; + +namespace Mooege.Core.MooNet.Friends +{ + public class FriendManager : RPCObject + { + private static readonly FriendManager _instance = new FriendManager(); + public static FriendManager Instance { get { return _instance; } } + + /*public static readonly MultiDictionary Friends = + new MultiDictionary(true);*/ + + public static readonly Dictionary OnGoingInvitations = + new Dictionary(); + + public static ulong InvitationIdCounter = 1; + + /*static FriendManager() + { + // TODO: Find correct bnet EntityId + _instance.BnetEntityId = bnet.protocol.EntityId.CreateBuilder().SetHigh((ulong)EntityIdHelper.HighIdType.Unknown).SetLow(1).Build(); + LoadFriendships(); + }*/ + + public static bool AreFriends(Account account1, Account account2) + { + return account1.DBAccount.Friends.Contains(account2.DBAccount); + } + + public static bool InvitationExists(Account inviter, Account invitee) + { + foreach (var invitation in OnGoingInvitations.Values) + { + if ((invitation.InviterIdentity.AccountId == inviter.BnetEntityId) && (invitation.InviteeIdentity.AccountId == invitee.BnetEntityId)) + return true; + } + return false; + } + public static void HandleInvitation(MooNetClient client, bnet.protocol.invitation.Invitation invitation) + { + var invitee = AccountManager.GetAccountByPersistentID(invitation.InviteeIdentity.AccountId.Low); + //var invitee = Instance.Subscribers.FirstOrDefault(subscriber => subscriber.Account.BnetEntityId.Low == invitation.InviteeIdentity.AccountId.Low); + if (invitee == null) return; // if we can't find invite just return - though we should actually check for it until expiration time and store this in database. + + //Check for duplicate invites + if (OnGoingInvitations.Values.Any(oldInvite => (oldInvite.InviteeIdentity.AccountId == invitation.InviteeIdentity.AccountId) && (oldInvite.InviterIdentity.AccountId == invitation.InviterIdentity.AccountId))) + return; + + OnGoingInvitations.Add(invitation.Id, invitation); // track ongoing invitations so we can tranport it forth and back. + + if (invitee.IsOnline) + { + var inviter = AccountManager.GetAccountByPersistentID(invitation.InviterIdentity.AccountId.Low); + + var notification = bnet.protocol.friends.InvitationNotification.CreateBuilder().SetInvitation(invitation).SetGameAccountId(inviter.CurrentGameAccount.BnetEntityId); + + invitee.CurrentGameAccount.LoggedInClient.MakeTargetedRPC(FriendManager.Instance, () => + bnet.protocol.friends.FriendsNotify.CreateStub(invitee.CurrentGameAccount.LoggedInClient).NotifyReceivedInvitationAdded(null, notification.Build(), callback => { })); + } + } + + public static void HandleAccept(MooNetClient client, bnet.protocol.invitation.GenericRequest request) + { + if (!OnGoingInvitations.ContainsKey(request.InvitationId)) return; + var invitation = OnGoingInvitations[request.InvitationId]; + + var inviter = AccountManager.GetAccountByPersistentID(invitation.InviterIdentity.AccountId.Low); + var invitee = AccountManager.GetAccountByPersistentID(invitation.InviteeIdentity.AccountId.Low); + var inviteeAsFriend = bnet.protocol.friends.Friend.CreateBuilder().SetId(invitation.InviteeIdentity.AccountId).Build(); + var inviterAsFriend = bnet.protocol.friends.Friend.CreateBuilder().SetId(invitation.InviterIdentity.AccountId).Build(); + + var notificationToInviter = bnet.protocol.friends.InvitationNotification.CreateBuilder() + .SetGameAccountId(invitee.BnetEntityId) + .SetInvitation(invitation) + .SetReason((uint)InvitationRemoveReason.Accepted) // success? + .Build(); + + var notificationToInvitee = bnet.protocol.friends.InvitationNotification.CreateBuilder() + .SetGameAccountId(inviter.BnetEntityId) + .SetInvitation(invitation) + .SetReason((uint)InvitationRemoveReason.Accepted) // success? + .Build(); + + AddFriendshipToDB(inviter, invitee); + + // send friend added notifications + var friendAddedNotificationToInviter = bnet.protocol.friends.FriendNotification.CreateBuilder().SetTarget(inviteeAsFriend).SetGameAccountId(invitee.BnetEntityId).Build(); + var friendAddedNotificationToInvitee = bnet.protocol.friends.FriendNotification.CreateBuilder().SetTarget(inviterAsFriend).SetGameAccountId(inviter.BnetEntityId).Build(); + + var inviterGameAccounts = GameAccountManager.GetGameAccountsForAccount(inviter); + var inviteeGameAccounts = GameAccountManager.GetGameAccountsForAccount(invitee); + + foreach (var inviterGameAccount in inviterGameAccounts) + { + if (inviterGameAccount.IsOnline) + { + inviterGameAccount.LoggedInClient.MakeTargetedRPC(FriendManager.Instance, () => + bnet.protocol.friends.FriendsNotify.CreateStub(inviterGameAccount.LoggedInClient).NotifyReceivedInvitationRemoved(null, notificationToInviter, callback => { })); + + inviterGameAccount.LoggedInClient.MakeTargetedRPC(FriendManager.Instance, () => + bnet.protocol.friends.FriendsNotify.CreateStub(inviterGameAccount.LoggedInClient).NotifyFriendAdded(null, friendAddedNotificationToInviter, callback => { })); + } + } + + foreach (var inviteeGameAccount in inviteeGameAccounts) + { + if (inviteeGameAccount.IsOnline) + { + inviteeGameAccount.LoggedInClient.MakeTargetedRPC(FriendManager.Instance, () => + bnet.protocol.friends.FriendsNotify.CreateStub(inviteeGameAccount.LoggedInClient).NotifyFriendAdded(null, friendAddedNotificationToInvitee, callback => { })); + + inviteeGameAccount.LoggedInClient.MakeTargetedRPC(FriendManager.Instance, () => + bnet.protocol.friends.FriendsNotify.CreateStub(inviteeGameAccount.LoggedInClient).NotifyReceivedInvitationRemoved(null, notificationToInvitee, callback => { })); + } + } + } + + public static void HandleDecline(MooNetClient client, bnet.protocol.invitation.GenericRequest request) + { + if (!OnGoingInvitations.ContainsKey(request.InvitationId)) return; + var invitation = OnGoingInvitations[request.InvitationId]; + + var inviter = AccountManager.GetAccountByPersistentID(invitation.InviterIdentity.AccountId.Low); + var invitee = AccountManager.GetAccountByPersistentID(invitation.InviteeIdentity.AccountId.Low); + + var declinedNotification = bnet.protocol.friends.InvitationNotification.CreateBuilder() + .SetInvitation(invitation) + .SetReason((uint)InvitationRemoveReason.Declined).Build(); + + var inviterGameAccounts = GameAccountManager.GetGameAccountsForAccount(inviter); + var inviteeGameAccounts = GameAccountManager.GetGameAccountsForAccount(invitee); + + foreach (var inviterGameAccount in inviterGameAccounts) + { + if (inviterGameAccount.IsOnline) + { + inviterGameAccount.LoggedInClient.MakeTargetedRPC(FriendManager.Instance, () => + bnet.protocol.friends.FriendsNotify.CreateStub(inviterGameAccount.LoggedInClient).NotifyReceivedInvitationRemoved(null, declinedNotification, callback => { })); + } + } + + foreach (var inviteeGameAccount in inviteeGameAccounts) + { + if (inviteeGameAccount.IsOnline) + { + inviteeGameAccount.LoggedInClient.MakeTargetedRPC(FriendManager.Instance, () => + bnet.protocol.friends.FriendsNotify.CreateStub(inviteeGameAccount.LoggedInClient).NotifyReceivedInvitationRemoved(null, declinedNotification, callback => { })); + } + } + } + + public static void HandleRemove(MooNetClient client, bnet.protocol.friends.GenericFriendRequest request) + { + var removee = AccountManager.GetAccountByPersistentID(request.TargetId.Low); + var remover = client.Account; + + var removeeAsFriend = bnet.protocol.friends.Friend.CreateBuilder().SetId(removee.BnetEntityId).Build(); + var removerAsFriend = bnet.protocol.friends.Friend.CreateBuilder().SetId(remover.BnetEntityId).Build(); + + RemoveFriendshipFromDB(remover, removee); + + var notifyRemover = bnet.protocol.friends.FriendNotification.CreateBuilder().SetTarget(removeeAsFriend).Build(); + + client.MakeTargetedRPC(FriendManager.Instance, () => + bnet.protocol.friends.FriendsNotify.CreateStub(client).NotifyFriendRemoved(null, notifyRemover, callback => { })); + + + var removeeGameAccounts = GameAccountManager.GetGameAccountsForAccount(removee); + foreach (var removeeGameAccount in removeeGameAccounts) + { + if (!removeeGameAccount.IsOnline) + continue; + var notifyRemovee = bnet.protocol.friends.FriendNotification.CreateBuilder().SetTarget(removerAsFriend).Build(); + removeeGameAccount.LoggedInClient.MakeTargetedRPC(FriendManager.Instance, () => + bnet.protocol.friends.FriendsNotify.CreateStub(removeeGameAccount.LoggedInClient).NotifyFriendRemoved(null, notifyRemovee, callback => { })); + } + } + + private static void AddFriendshipToDB(Account inviter, Account invitee) + { + try + { + inviter.DBAccount.Friends.Add(invitee.DBAccount); + invitee.DBAccount.Friends.Add(inviter.DBAccount); + DBSessions.AccountSession.SaveOrUpdate(inviter.DBAccount); + DBSessions.AccountSession.SaveOrUpdate(invitee.DBAccount); + DBSessions.AccountSession.Flush(); + + } + catch (Exception e) + { + Logger.ErrorException(e, "FriendManager.AddFriendshipToDB()"); + } + } + + private static void RemoveFriendshipFromDB(Account remover, Account removee) + { + try + { + remover.DBAccount.Friends.Remove(removee.DBAccount); + removee.DBAccount.Friends.Remove(remover.DBAccount); + DBSessions.AccountSession.SaveOrUpdate(remover.DBAccount); + DBSessions.AccountSession.SaveOrUpdate(removee.DBAccount); + DBSessions.AccountSession.Flush(); + + } + catch (Exception e) + { + Logger.ErrorException(e, "FriendManager.RemoveFriendshipFromDB()"); + } + } + + } + + public enum InvitationRemoveReason : uint //possibly more unknown values, such as one for revoked /dustinconrad + { + Accepted = 0x0, + Declined = 0x1 + } +} diff --git a/src/Mooege/Core/MooNet/Games/GameFactory.cs b/src/Mooege/Core/MooNet/Games/GameFactory.cs new file mode 100644 index 00000000..3ad35c23 --- /dev/null +++ b/src/Mooege/Core/MooNet/Games/GameFactory.cs @@ -0,0 +1,175 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using Google.ProtocolBuffers; +using Mooege.Core.GS.Games; +using Mooege.Core.MooNet.Channels; +using Mooege.Core.MooNet.Helpers; +using Mooege.Net.MooNet; +using Config = Mooege.Net.GS.Config; + +namespace Mooege.Core.MooNet.Games +{ + public class GameFactory : Channel + { + /// + /// Ingame manager. + /// + public Game InGame { get; private set; } + + /// + /// Game handle. + /// + public bnet.protocol.game_master.GameHandle GameHandle { get; private set; } + + public D3.OnlineService.GameCreateParams GameCreateParams { get; private set; } + + public string Version { get; private set; } + + public ulong FactoryID { get; private set; } + + public ulong RequestId { get; private set; } + + public bool Started { get; private set; } + + public GameFactory(MooNetClient owner, bnet.protocol.game_master.FindGameRequest request, ulong requestId) + : base(owner, true) + { + this.Started = false; + this.Owner = owner; //Game is really the owner Channel.Owner should maybe be EntityId instead of MooNetClient -Egris + this.RequestId = requestId; + this.FactoryID = request.FactoryId; + this.BnetEntityId = bnet.protocol.EntityId.CreateBuilder().SetHigh((ulong)EntityIdHelper.HighIdType.GameId).SetLow(this.DynamicId).Build(); + this.GameHandle = bnet.protocol.game_master.GameHandle.CreateBuilder().SetFactoryId(this.FactoryID).SetGameId(this.BnetEntityId).Build(); + + foreach (bnet.protocol.attribute.Attribute attribute in request.Properties.CreationAttributesList) + { + if (attribute.Name != "GameCreateParams") + Logger.Warn("FindGame(): Unknown CreationAttribute: {0}", attribute.Name); + else + this.GameCreateParams = D3.OnlineService.GameCreateParams.ParseFrom(attribute.Value.MessageValue); + } + + foreach (bnet.protocol.attribute.Attribute attribute in request.Properties.Filter.AttributeList) + { + if (attribute.Name != "version") + Logger.Warn("FindGame(): Unknown Attribute: {0}", attribute.Name); + else + this.Version = attribute.Value.StringValue; + } + } + + public void StartGame(List clients, ulong objectId) + { + this.InGame = GameManager.CreateGame((int)this.DynamicId); // create the ingame. + + foreach (var client in clients) // get all clients in game. + { + client.MapLocalObjectID(this.DynamicId, objectId); // map remote object-id. + this.SendConnectionInfo(client); + client.Account.CurrentGameAccount.ScreenStatus = D3.PartyMessage.ScreenStatus.CreateBuilder().SetScreen(0).SetStatus(0).Build(); + client.Account.CurrentGameAccount.NotifyUpdate(); + } + + this.Started = true; + } + + public void JoinGame(List clients, ulong objectId) + { + foreach (var client in clients) // get all clients in game. + { + client.MapLocalObjectID(this.DynamicId, objectId); // map remote object-id. + this.SendConnectionInfo(client); + } + } + + public bnet.protocol.game_master.ConnectInfo GetConnectionInfoForClient(MooNetClient client) + { + //TODO: We should actually find the server's public-interface and use that /raist + + return bnet.protocol.game_master.ConnectInfo.CreateBuilder() + .SetMemberId(client.Account.CurrentGameAccount.BnetEntityId) + .SetHost(Net.Utils.GetGameServerIPForClient(client)) + .SetPort(Config.Instance.Port) + .SetToken(ByteString.CopyFrom(new byte[] { 0x31, 0x33, 0x38, 0x38, 0x35, 0x34, 0x33, 0x33, 0x32, 0x30, 0x38, 0x34, 0x30, 0x30, 0x38, 0x38, 0x35, 0x37, 0x39, 0x36 })) + .AddAttribute(bnet.protocol.attribute.Attribute.CreateBuilder() + .SetName("SGameId").SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetIntValue((long)this.DynamicId).Build())) + .Build(); + } + + private void SendConnectionInfo(MooNetClient client) + { + // Lock party and close privacy level while entering game + if (client.CurrentChannel != null) + { + var channelStatePrivacyLevel = bnet.protocol.channel.ChannelState.CreateBuilder() + .SetPrivacyLevel(bnet.protocol.channel.ChannelState.Types.PrivacyLevel.PRIVACY_LEVEL_CLOSED).Build(); + + var notificationPrivacyLevel = bnet.protocol.channel.UpdateChannelStateNotification.CreateBuilder() + .SetAgentId(client.Account.CurrentGameAccount.BnetEntityId) + .SetStateChange(channelStatePrivacyLevel) + .Build(); + + client.MakeTargetedRPC(client.CurrentChannel, () => + bnet.protocol.channel.ChannelSubscriber.CreateStub(client).NotifyUpdateChannelState(null, notificationPrivacyLevel, callback => { })); + + var channelStatePartyLock = bnet.protocol.channel.ChannelState.CreateBuilder() + .AddAttribute(bnet.protocol.attribute.Attribute.CreateBuilder() + .SetName("D3.Party.LockReasons") + .SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetIntValue(1).Build()) + .Build()).Build(); + + var notificationPartyLock = bnet.protocol.channel.UpdateChannelStateNotification.CreateBuilder() + .SetAgentId(client.Account.CurrentGameAccount.BnetEntityId) + .SetStateChange(channelStatePartyLock) + .Build(); + + client.MakeTargetedRPC(client.CurrentChannel, () => + bnet.protocol.channel.ChannelSubscriber.CreateStub(client).NotifyUpdateChannelState(null, notificationPartyLock, callback => { })); + } + + // send the notification. + var connectionInfo = GetConnectionInfoForClient(client); + + var connectionInfoAttribute = bnet.protocol.attribute.Attribute.CreateBuilder().SetName("connection_info") + .SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(connectionInfo.ToByteString()).Build()) + .Build(); + + var gameHandleAttribute = bnet.protocol.attribute.Attribute.CreateBuilder().SetName("game_handle") + .SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(this.GameHandle.ToByteString()).Build()) + .Build(); + + var requestIdAttribute = bnet.protocol.attribute.Attribute.CreateBuilder().SetName("game_request_id") + .SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetUintValue(this.RequestId).Build()) + .Build(); + + var notificationBuilder = bnet.protocol.notification.Notification.CreateBuilder() + .SetSenderId(bnet.protocol.EntityId.CreateBuilder().SetHigh((ulong)EntityIdHelper.HighIdType.GameAccountId).SetLow(0).Build()) + .SetTargetId(client.Account.CurrentGameAccount.BnetEntityId) + .SetType("GAME_ENTRY") + .AddAttribute(connectionInfoAttribute) + .AddAttribute(gameHandleAttribute) + .AddAttribute(requestIdAttribute) + .Build(); + + client.MakeRPC(() => + bnet.protocol.notification.NotificationListener.CreateStub(client).OnNotificationReceived(null, notificationBuilder, callback => { })); + } + } +} diff --git a/src/Mooege/Core/MooNet/Games/GameFactoryManager.cs b/src/Mooege/Core/MooNet/Games/GameFactoryManager.cs new file mode 100644 index 00000000..97e47656 --- /dev/null +++ b/src/Mooege/Core/MooNet/Games/GameFactoryManager.cs @@ -0,0 +1,190 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using Mooege.Common.Logging; +using Mooege.Core.MooNet.Channels; +using Mooege.Net.MooNet; + +namespace Mooege.Core.MooNet.Games +{ + public static class GameFactoryManager + { + /// + /// List of games. + /// + private static readonly Dictionary GameCreators = + new Dictionary(); + + /// + /// Request id counter for find-game requests. + /// + public static ulong RequestIdCounter = 0; // request Id counter for find game responses. + + private static readonly Logger Logger = LogManager.CreateLogger(); + + public static GameFactory JoinGame(MooNetClient client, bnet.protocol.game_master.JoinGameRequest request, ulong requetId) + { + var game = FindGameByEntityId(request.GameHandle.GameId); + return game; + } + public static GameFactory CreateGame(MooNetClient owner, bnet.protocol.game_master.FindGameRequest request, ulong requestId) + { + var gameFactory = new GameFactory(owner, request, requestId); + GameCreators.Add(gameFactory.DynamicId, gameFactory); + ChannelManager.AddGameChannel(gameFactory); + return gameFactory; + } + + public static GameFactory FindGameByEntityId(bnet.protocol.EntityId entityId) + { + foreach (GameFactory game in GameCreators.Values) + { + if (game.BnetEntityId == entityId) + return game; + } + return null; + } + public static GameFactory FindGame(MooNetClient client, bnet.protocol.game_master.FindGameRequest request, ulong requestId) + { + List matchingGames = FindMatchingGames(request); + var rand = new Random(); + GameFactory gameFactory = null; + + if (!request.Properties.Create && matchingGames.Count > 0) + gameFactory = matchingGames[rand.Next(matchingGames.Count)]; + else + gameFactory = CreateGame(client, request, requestId); + + return gameFactory; + } + + private static List FindMatchingGames(bnet.protocol.game_master.FindGameRequest request) + { + String version = String.Empty; + int difficulty = 0; + int currentQuest = 0; + foreach (bnet.protocol.attribute.Attribute attribute in request.Properties.Filter.AttributeList) + { + switch (attribute.Name) + { + case "version": + version = attribute.Value.StringValue; + break; + case "Game.Difficulty": + difficulty = (int)attribute.Value.IntValue; + break; + case "Game.CurrentQuest": + currentQuest = (int)attribute.Value.IntValue; + break; + } + } + + Func matchOp; + switch (request.Properties.Filter.Op) + { + case bnet.protocol.attribute.AttributeFilter.Types.Operation.MATCH_ANY: + matchOp = (bool b1, bool b2, bool b3) => b1 || b2 || b3; + break; + case bnet.protocol.attribute.AttributeFilter.Types.Operation.MATCH_NONE: + matchOp = (bool b1, bool b2, bool b3) => !b1 && !b2 && !b3; + break; + case bnet.protocol.attribute.AttributeFilter.Types.Operation.MATCH_ALL: + default: //default to match all, fall through is on purpose + matchOp = (bool b1, bool b2, bool b3) => b1 && b2 && b3; + break; + } + + List matches = new List(); + foreach (GameFactory game in GameCreators.Values) + { + //FIXME: don't currently track max players allowed in a game, hardcoded 4 /dustinconrad + if (game.InGame != null && game.InGame.Players.Count < 4) + { + if (matchOp(version == game.Version, difficulty == game.GameCreateParams.Coop.DifficultyLevel, currentQuest == game.GameCreateParams.Coop.SnoQuest)) + { + matches.Add(game); + } + } + } + return matches; + } + + //FIXME: MATCH_ALL_MOST_SPECIFIC not implemented /dustinconrad + public static bnet.protocol.game_master.GameStatsBucket.Builder GetGameStats(bnet.protocol.game_master.GetGameStatsRequest request) + { + String version = String.Empty; + int difficulty = 0; + int currentQuest = 0; + foreach (bnet.protocol.attribute.Attribute attribute in request.Filter.AttributeList) + { + switch (attribute.Name) + { + case "version": + version = attribute.Value.StringValue; + break; + case "Game.Difficulty": + difficulty = (int)attribute.Value.IntValue; + break; + case "Game.CurrentQuest": + currentQuest = (int)attribute.Value.IntValue; + break; + } + } + + Func matchOp; + switch (request.Filter.Op) + { + case bnet.protocol.attribute.AttributeFilter.Types.Operation.MATCH_ANY: + matchOp = (bool b1, bool b2, bool b3) => b1 || b2 || b3; + break; + case bnet.protocol.attribute.AttributeFilter.Types.Operation.MATCH_NONE: + matchOp = (bool b1, bool b2, bool b3) => !b1 && !b2 && !b3; + break; + case bnet.protocol.attribute.AttributeFilter.Types.Operation.MATCH_ALL: + default://default to match all, fall through is on purpose + matchOp = (bool b1, bool b2, bool b3) => b1 && b2 && b3; + break; + } + + uint games = 0; + int players = 0; + foreach (GameFactory game in GameCreators.Values) + { + if (game.InGame != null) + { + if (matchOp(version == game.Version, difficulty == game.GameCreateParams.Coop.DifficultyLevel, currentQuest == game.GameCreateParams.Coop.SnoQuest)) + { + games++; + players += game.InGame.Players.Count; + } + } + } + + var bucket = bnet.protocol.game_master.GameStatsBucket.CreateBuilder() + .SetWaitMilliseconds(200) + .SetActiveGames(games) + .SetActivePlayers((uint)players) + .SetFormingGames(0) + .SetWaitingPlayers(0); + + return bucket; + } + } +} diff --git a/src/Mooege/Core/MooNet/Helpers/EntityIdHelper.cs b/src/Mooege/Core/MooNet/Helpers/EntityIdHelper.cs new file mode 100644 index 00000000..87ef9ec5 --- /dev/null +++ b/src/Mooege/Core/MooNet/Helpers/EntityIdHelper.cs @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace Mooege.Core.MooNet.Helpers +{ + public static class EntityIdHelper + { + /// + /// Returns high-id type for given bnet.protocol.EntityId + /// + /// The bnet.protocol.EntityId + /// + public static HighIdType GetHighIdType(this bnet.protocol.EntityId id) + { + switch (id.High >> 48) + { + case 0x0100: + return HighIdType.AccountId; + case 0x0200: + return HighIdType.GameAccountId; + case 0x0000: + return HighIdType.ToonId; + case 0x0600: + return HighIdType.ChannelId; + } + return HighIdType.Unknown; + } + + /// + /// High id types for bnet.protocol.EntityId high-id. + /// + public enum HighIdType : ulong + { + Unknown = 0x0, + AccountId = 0x100000000000000, + GameAccountId = 0x200000000000000, + ToonId = 0x000000000000000, + GameId = 0x600000000000000, + ChannelId = 0x600000000000000 + } + } +} diff --git a/src/Mooege/Core/MooNet/Helpers/FieldKeyHelper.cs b/src/Mooege/Core/MooNet/Helpers/FieldKeyHelper.cs new file mode 100644 index 00000000..36b24094 --- /dev/null +++ b/src/Mooege/Core/MooNet/Helpers/FieldKeyHelper.cs @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using bnet.protocol.presence; +using Mooege.Core.MooNet.Objects; + +namespace Mooege.Core.MooNet.Helpers +{ + public class FieldKeyHelper + { + public enum Program : uint + { + BNet = 16974, + D3 = 17459, + S2 = 21298, + WoW = 5730135 + } + + public enum OriginatingClass : uint + { + Account = 1, + GameAccount = 2, + Hero = 3, + Party = 4, + GameSession = 5 + } + + public static FieldKey Create(Program program, OriginatingClass originatingClass, uint field, ulong index) + { + return + FieldKey.CreateBuilder().SetProgram((uint)program).SetGroup((uint)originatingClass).SetField( + field).SetIndex(index).Build(); + } + + + private HashSet _changedFields = new HashSet(); + private Dictionary _FieldValues = new Dictionary(); + + public void SetFieldValue(FieldKey key, FieldOperation operation) + { + if (!_changedFields.Contains(key)) + _changedFields.Add(key); + + _FieldValues[key] = operation; + } + + //TODO: Use covariance and refactor this + public void SetPresenceFieldValue(IPresenceField field) + { + if (field != null) + { + SetFieldValue(field.GetFieldKey(), field.GetFieldOperation()); + } + } + + //TODO: Use covariance and refactor this + public void SetIntPresenceFieldValue(IntPresenceField field) + { + if (field != null) + { + var key = Create(field.Program, field.OriginatingClass, field.FieldNumber, field.Index); + this.SetFieldValue(key, field.GetFieldOperation()); + } + } + + //TODO: Use covariance and refactor this + public void SetStringPresenceFieldValue(StringPresenceField field) + { + if (field != null) + { + var key = Create(field.Program, field.OriginatingClass, field.FieldNumber, field.Index); + this.SetFieldValue(key, field.GetFieldOperation()); + } + } + + public List GetChangedFieldList() + { + return new List(_FieldValues.Values); + } + + public void ClearChanged() + { + this._changedFields.Clear(); + this._FieldValues.Clear(); + } + + } +} \ No newline at end of file diff --git a/src/Mooege/Core/MooNet/Helpers/NotificationTypeHelper.cs b/src/Mooege/Core/MooNet/Helpers/NotificationTypeHelper.cs new file mode 100644 index 00000000..70aa2881 --- /dev/null +++ b/src/Mooege/Core/MooNet/Helpers/NotificationTypeHelper.cs @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace Mooege.Core.MooNet.Helpers +{ + public static class NotificationTypeHelper + { + /// + /// Returns the NotificationType for the given notification. + /// + /// The notification + /// + public static NotificationType GetNotificationType(this bnet.protocol.notification.Notification notification) + { + switch (notification.Type) + { + case "WHISPER": + return NotificationType.Whisper; + } + return NotificationType.Unknown; + } + + /// + /// Notification types + /// + public enum NotificationType + { + Unknown, + Whisper + } + } +} diff --git a/src/Mooege/Core/MooNet/Objects/PersistentRPCObject.cs b/src/Mooege/Core/MooNet/Objects/PersistentRPCObject.cs new file mode 100644 index 00000000..b5e7d2f2 --- /dev/null +++ b/src/Mooege/Core/MooNet/Objects/PersistentRPCObject.cs @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; + +namespace Mooege.Core.MooNet.Objects +{ + /// + /// PersistentRPCObjects are RPCObjects that are persisted in a database or other external resource. + /// Since this derives from RPCObject, it has a dynamic ID which can be used in RPC communication for + /// referencing the object at the remote end, additional to its persistent ID which stays same + /// throughout sessions. + /// + public class PersistentRPCObject : RPCObject + { + /// + /// The persistent ID for the object which will stay same through sessions, and can be used + /// as an index in database tables. + /// + public ulong PersistentID { get; private set; } + + /// + /// Parameterless ctor will **generate** a new persistent ID. + /// + protected PersistentRPCObject() + { + // We can't generate our persistent ID here but instead rely on deriving-class implementation. + // The deriving type has to handle generation because the persistent ID is domain-specific (most of the time). + // NOTE: Resharper or sample tools may give a warning over this line indicating: "virtual member call in constructor", + // but in C# virtual method calls always run on the most derived type. So we're fine. + // Check these for more information: http://goo.gl/xv7WE, http://goo.gl/x4ep2 + this.PersistentID = this.GenerateNewPersistentId(); + } + + /// + /// Creates a new PersistentRPCObject memory instance with the given persistent ID. + /// + /// The persistent ID to initialize with. + protected PersistentRPCObject(ulong persistentId) + { + this.PersistentID = persistentId; + } + + /// + /// Virtual function that must be implemented by derives classes, which should return a new unique + /// persistent ID in the derived-class's domain -- to be used as a PersistentRPCObject's persistent ID. + /// + /// Returns a unique persistent ID for the derived-class's domain. + protected virtual ulong GenerateNewPersistentId() + { + throw new NotImplementedException(); + } + + // Note on PersistentRPCObject derived-class ID generation strategy: + // the derived classes first get the last persistent ID known for the class' domain and should assign values following this counter. + // A very simple implementation would be like: + // + // public class SamplePersistentDerivedType : PersistentRPCObject + // { + // private static ulong? _persistentIdCounter = null; // Make it nullable + // + // protected override ulong GenerateNewPersistentId() + // { + // if (_persistentIdCounter == null) // At the initial memory instantation for the type, + // this.SetPersistentIdCounter(); // we should get the lowest free persistent ID value for our domain + // + // return (ulong)_persistentIdCounter++; + // } + // + // private void SetPersistentIdCounter() // Get the lowest free persistent ID for the domain + // { + // _persistentIdCounter = GetFromDB(); // Get the value from the domain's table + // } + // } + } +} diff --git a/src/Mooege/Core/MooNet/Objects/PresenceField.cs b/src/Mooege/Core/MooNet/Objects/PresenceField.cs new file mode 100644 index 00000000..7bde07b6 --- /dev/null +++ b/src/Mooege/Core/MooNet/Objects/PresenceField.cs @@ -0,0 +1,223 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using Mooege.Core.MooNet.Helpers; +using Google.ProtocolBuffers; + +namespace Mooege.Core.MooNet.Objects +{ + public class EntityIdPresenceFieldList + { + public List Value = new List(); + + protected FieldKeyHelper.Program _program; + protected FieldKeyHelper.OriginatingClass _originatingClass; + protected uint _fieldNumber; + protected uint _index; + + public EntityIdPresenceFieldList(FieldKeyHelper.Program Program, FieldKeyHelper.OriginatingClass OriginatingClass, uint FieldNumber, uint Index) + { + _fieldNumber = FieldNumber; + _index = Index; + _program = Program; + _originatingClass = OriginatingClass; + } + + public List GetFieldOperationList() + { + var operationList = new List(); + + foreach (var id in Value) + { + var Key = FieldKeyHelper.Create(FieldKeyHelper.Program.BNet, FieldKeyHelper.OriginatingClass.Account, _fieldNumber, id.High); + var Field = bnet.protocol.presence.Field.CreateBuilder().SetKey(Key).SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetEntityidValue(id).Build()).Build(); + operationList.Add(bnet.protocol.presence.FieldOperation.CreateBuilder().SetField(Field).Build()); + } + return operationList; + } + } + + public class BoolPresenceField : PresenceField, IPresenceField + { + public BoolPresenceField(FieldKeyHelper.Program Program, FieldKeyHelper.OriginatingClass OriginatingClass, uint FieldNumber, uint Index, bool defaultValue = default(bool)) + : base(Program, OriginatingClass, FieldNumber, Index, defaultValue) + { + } + + public bnet.protocol.presence.Field GetField() + { + var fieldKey = FieldKeyHelper.Create(Program, OriginatingClass, FieldNumber, Index); + var field = bnet.protocol.presence.Field.CreateBuilder().SetKey(fieldKey).SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetBoolValue(Value).Build()).Build(); + return field; + } + + public bnet.protocol.presence.FieldOperation GetFieldOperation() + { + var fieldKey = FieldKeyHelper.Create(Program, OriginatingClass, FieldNumber, Index); + var field = bnet.protocol.presence.Field.CreateBuilder().SetKey(fieldKey).SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetBoolValue(Value).Build()).Build(); + return bnet.protocol.presence.FieldOperation.CreateBuilder().SetField(field).Build(); + } + } + + public class UintPresenceField : PresenceField, IPresenceField + { + public UintPresenceField(FieldKeyHelper.Program Program, FieldKeyHelper.OriginatingClass OriginatingClass, uint FieldNumber, uint Index, ulong defaultValue = default(ulong)) + : base(Program, OriginatingClass, FieldNumber, Index, defaultValue) + { + } + + public bnet.protocol.presence.Field GetField() + { + var fieldKey = FieldKeyHelper.Create(Program, OriginatingClass, FieldNumber, Index); + var field = bnet.protocol.presence.Field.CreateBuilder().SetKey(fieldKey).SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetUintValue(Value).Build()).Build(); + return field; + } + + public bnet.protocol.presence.FieldOperation GetFieldOperation() + { + var fieldKey = FieldKeyHelper.Create(Program, OriginatingClass, FieldNumber, Index); + var field = bnet.protocol.presence.Field.CreateBuilder().SetKey(fieldKey).SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetUintValue(Value).Build()).Build(); + return bnet.protocol.presence.FieldOperation.CreateBuilder().SetField(field).Build(); + } + } + + public class IntPresenceField : PresenceField, IPresenceField + { + public IntPresenceField(FieldKeyHelper.Program Program, FieldKeyHelper.OriginatingClass OriginatingClass, uint FieldNumber, uint Index, long defaultValue = default(long)) + : base(Program, OriginatingClass, FieldNumber, Index, defaultValue) + { + } + + public bnet.protocol.presence.Field GetField() + { + var fieldKey = FieldKeyHelper.Create(Program, OriginatingClass, FieldNumber, Index); + var field = bnet.protocol.presence.Field.CreateBuilder().SetKey(fieldKey).SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetIntValue(Value).Build()).Build(); + return field; + } + + public bnet.protocol.presence.FieldOperation GetFieldOperation() + { + var fieldKey = FieldKeyHelper.Create(Program, OriginatingClass, FieldNumber, Index); + var field = bnet.protocol.presence.Field.CreateBuilder().SetKey(fieldKey).SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetIntValue(Value).Build()).Build(); + return bnet.protocol.presence.FieldOperation.CreateBuilder().SetField(field).Build(); + } + } + + public class FourCCPresenceField : PresenceField, IPresenceField + { + public FourCCPresenceField(FieldKeyHelper.Program Program, FieldKeyHelper.OriginatingClass OriginatingClass, uint FieldNumber, uint Index, string defaultValue = default(string)) + : base(Program, OriginatingClass, FieldNumber, Index, defaultValue) + { + } + + public bnet.protocol.presence.Field GetField() + { + var fieldKey = FieldKeyHelper.Create(Program, OriginatingClass, FieldNumber, Index); + var field = bnet.protocol.presence.Field.CreateBuilder().SetKey(fieldKey).SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetFourccValue(Value).Build()).Build(); + return field; + } + + public bnet.protocol.presence.FieldOperation GetFieldOperation() + { + var fieldKey = FieldKeyHelper.Create(Program, OriginatingClass, FieldNumber, Index); + var field = bnet.protocol.presence.Field.CreateBuilder().SetKey(fieldKey).SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetFourccValue(Value).Build()).Build(); + return bnet.protocol.presence.FieldOperation.CreateBuilder().SetField(field).Build(); + } + } + + public class StringPresenceField : PresenceField, IPresenceField + { + public StringPresenceField(FieldKeyHelper.Program Program, FieldKeyHelper.OriginatingClass OriginatingClass, uint FieldNumber, uint Index, string defaultValue = default(string)) + : base(Program, OriginatingClass, FieldNumber, Index, defaultValue) + { + } + + public bnet.protocol.presence.Field GetField() + { + var fieldKey = FieldKeyHelper.Create(Program, OriginatingClass, FieldNumber, Index); + var field = bnet.protocol.presence.Field.CreateBuilder().SetKey(fieldKey).SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetStringValue(Value).Build()).Build(); + return field; + } + + public bnet.protocol.presence.FieldOperation GetFieldOperation() + { + var fieldKey = FieldKeyHelper.Create(Program, OriginatingClass, FieldNumber, Index); + var field = bnet.protocol.presence.Field.CreateBuilder().SetKey(fieldKey).SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetStringValue(Value).Build()).Build(); + return bnet.protocol.presence.FieldOperation.CreateBuilder().SetField(field).Build(); + } + } + + public class ByteStringPresenceField : PresenceField, IPresenceField where T : IMessageLite //Used IMessageLite to get ToByteString(), might need refactoring later + { + public ByteStringPresenceField(FieldKeyHelper.Program Program, FieldKeyHelper.OriginatingClass OriginatingClass, uint FieldNumber, uint Index, T defaultValue = default(T)) + : base(Program, OriginatingClass, FieldNumber, Index, defaultValue) + { + } + + public bnet.protocol.presence.Field GetField() + { + var fieldKey = FieldKeyHelper.Create(Program, OriginatingClass, FieldNumber, Index); + var field = bnet.protocol.presence.Field.CreateBuilder().SetKey(fieldKey).SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(Value.ToByteString()).Build()).Build(); + return field; + } + + public bnet.protocol.presence.FieldOperation GetFieldOperation() + { + var fieldKey = FieldKeyHelper.Create(Program, OriginatingClass, FieldNumber, Index); + var field = bnet.protocol.presence.Field.CreateBuilder(); + if (Value == null) + field.SetKey(fieldKey).SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(ByteString.Empty).Build()).Build(); + else + field.SetKey(fieldKey).SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(Value.ToByteString()).Build()).Build(); + return bnet.protocol.presence.FieldOperation.CreateBuilder().SetField(field).Build(); + } + } + + public abstract class PresenceField + { + public T Value; + + public FieldKeyHelper.Program Program { get; private set; } + public FieldKeyHelper.OriginatingClass OriginatingClass { get; private set; } + public uint FieldNumber { get; private set; } + public uint Index { get; private set; } + + public PresenceField(FieldKeyHelper.Program program, FieldKeyHelper.OriginatingClass originatingClass, uint fieldNumber, uint index, T defaultValue) + { + Value = defaultValue; + FieldNumber = fieldNumber; + Index = index; + Program = program; + OriginatingClass = originatingClass; + } + + public bnet.protocol.presence.FieldKey GetFieldKey() + { + return FieldKeyHelper.Create(Program, OriginatingClass, FieldNumber, Index); + } + } + + public interface IPresenceField + { + bnet.protocol.presence.Field GetField(); + bnet.protocol.presence.FieldOperation GetFieldOperation(); + bnet.protocol.presence.FieldKey GetFieldKey(); + } +} diff --git a/src/Mooege/Core/MooNet/Objects/RPCObject.cs b/src/Mooege/Core/MooNet/Objects/RPCObject.cs new file mode 100644 index 00000000..c5fa6d28 --- /dev/null +++ b/src/Mooege/Core/MooNet/Objects/RPCObject.cs @@ -0,0 +1,245 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using Mooege.Common.Logging; +using Mooege.Net.MooNet; + +// FIXME: An RPCObject will never get released at runtime because we don't remove it from +// RPCObjectManager until the dtor actually gets called. The dtor, of course, never gets +// called during runtime because the object is still referenced in RPCObjectManager.Objects. + +// TODO: RPCObject should probably remove all subscribers when getting released. + +namespace Mooege.Core.MooNet.Objects +{ + /// + /// RPC objects are mapped to a remote dynamic ID for the purposes of handling subscriptions + /// and server-side data. + /// + public class RPCObject + { + protected static readonly Logger Logger = LogManager.CreateLogger(); + + /// + /// The dynamic ID of the object, which is set on memory instantiation and changes over sessions. + /// RPCObjectManager will track all dynamic IDs so that we don't get a duplicate. + /// + public ulong DynamicId { get; set; } + + /// + /// All RPCObjects have an EntityId which is embedded in presence.ChannelState + /// + public bnet.protocol.EntityId BnetEntityId; + + /// + /// List of clients that subscribed for notifications when this object updates its states. + /// + public List Subscribers { get; private set; } + + /// + /// Constructor which can only be called by derived objects. + /// + protected RPCObject() + { + // Let RPCObjectManager generate a new dynamic ID for us + RPCObjectManager.Init(this); + this.Subscribers = new List(); + } + + /// + /// Adds a client subscriber to object, which will eventually be notified whenever the object changes state. + /// + /// The client to add as a subscriber. + /// The client's dynamic ID. + public void AddSubscriber(MooNetClient client, ulong remoteObjectId) + { + // [D3Inferno] + // Remove Subscribers that have been disconnected. + // Apparently the RPCObject is not being cleaned up properly. + // See the comment at the top for more info. + // Conver to an Array so we can remove as we iterate. + foreach (var subscriber in this.Subscribers.ToArray()) + { + if (!subscriber.Connection.IsConnected) + { + Logger.Warn("Removing disconnected subscriber {0}", subscriber); + this.Subscribers.Remove(subscriber); + } + } + + // Map the subscriber's dynamic ID to to our dynamic ID so we know how to translate later on when the object makes a notify call + client.MapLocalObjectID(this.DynamicId, remoteObjectId); + this.Subscribers.Add(client); + // Since the client wasn't previously subscribed, it should not be aware of the object's state -- let's notify it + foreach (var subscriber in this.Subscribers) + this.NotifySubscriptionAdded(subscriber); + //this.NotifySubscriptionAdded(client); + } + + /// + /// Removes a given subscriber and unmaps the object's dynamic ID. + /// + /// The client to remove. + public void RemoveSubscriber(MooNetClient client) + { + if (!this.Subscribers.Contains(client)) + { + Logger.Warn("Attempted to remove non-subscriber {0}", client.Connection.RemoteEndPoint.ToString()); + return; + } + // Unmap the object from the client + client.UnmapLocalObjectId(this.DynamicId); + this.Subscribers.Remove(client); + // We don't need to do a notify nor respond to the client with anything since the client will ultimately act + // like the object never existed in the first place + + foreach (var subscriber in this.Subscribers) + this.NotifySubscriptionAdded(subscriber); + } + + /// + /// Provide a list of new added notifications. + /// Once the notification system is smart enough to determine which value/property to update this would be eliminated and put under GetUpdateNotifications + /// + /// + public virtual List GetSubscriptionNotifications() + { + return new List(); + } + + /// + /// Stores only changed Fields to send to clients + /// + public Mooege.Core.MooNet.Helpers.FieldKeyHelper ChangedFields = new Mooege.Core.MooNet.Helpers.FieldKeyHelper(); + + /// + /// Notifies a specific subscriber about the object's present state. + /// This methods should be actually implemented by deriving object classes. + /// + /// The subscriber. + protected void NotifySubscriptionAdded(MooNetClient client) + { + var operations = GetSubscriptionNotifications(); + if (operations.Count > 0) + MakeRPC(client, operations); + } + + public virtual void NotifyUpdate() { } + + public void UpdateSubscribers(List subscribers, List operations) + { + var disconnected = new List(); + foreach (var subscriber in this.Subscribers) + { + var gameAccount = subscriber.Account.CurrentGameAccount; + if (gameAccount.IsOnline) //This should never be false, subscribers should be unsubscribed if disconnected + { + var state = bnet.protocol.presence.ChannelState.CreateBuilder().SetEntityId(this.BnetEntityId).AddRangeFieldOperation(operations).Build(); + + // Embed in channel.ChannelState + var channelState = bnet.protocol.channel.ChannelState.CreateBuilder().SetExtension(bnet.protocol.presence.ChannelState.Presence, state); + + // Put in addnotification message + var notification = bnet.protocol.channel.UpdateChannelStateNotification.CreateBuilder().SetStateChange(channelState); + + gameAccount.LoggedInClient.MakeTargetedRPC(this, () => + bnet.protocol.channel.ChannelSubscriber.CreateStub(gameAccount.LoggedInClient).NotifyUpdateChannelState(null, notification.Build(), callback => { })); + } + else + { + disconnected.Add(subscriber); + Logger.Warn("Subscriber: {0} not online.", subscriber.Account); + } + } + + foreach (var subscriber in disconnected) + this.Subscribers.Remove(subscriber); + } + + protected void MakeRPC(MooNetClient client, List operations) + { + // Create a presence.ChannelState + var state = bnet.protocol.presence.ChannelState.CreateBuilder().SetEntityId(this.BnetEntityId).AddRangeFieldOperation(operations).Build(); + + // Embed in channel.ChannelState + var channelState = bnet.protocol.channel.ChannelState.CreateBuilder().SetExtension(bnet.protocol.presence.ChannelState.Presence, state); + + // Put in AddNotification message + var builder = bnet.protocol.channel.AddNotification.CreateBuilder().SetChannelState(channelState); + + // Make the RPC call to all online game accounts + //TODO: Split notifications per game type + client.MakeTargetedRPC(this, () => + bnet.protocol.channel.ChannelSubscriber.CreateStub(client).NotifyAdd(null, builder.Build(), callback => { })); + + //foreach (var gameClient in client.Account.GameAccounts) + //{ + // if (gameClient.Value.IsOnline) + // { + // gameClient.Value.LoggedInClient.MakeTargetedRPC(this, () => + // bnet.protocol.channel.ChannelSubscriber.CreateStub(gameClient.Value.LoggedInClient).NotifyAdd(null, builder.Build(), callback => { })); + // } + //} + } + + //This is done on a client by client mapping of notifications/variables per object that need to be updated + // ** We're yet not sure about this, so commenting out ** + ///// + ///// Notifies all subscribers with the object's current state. + ///// + //public void NotifyAllSubscribers() + //{ + // foreach (var subscriber in this.Subscribers) + // { + // this.NotifySubscriptionAdded(subscriber); + // } + //} + + #region de-ctor + + // IDisposable pattern: http://msdn.microsoft.com/en-us/library/fs2xkftw%28VS.80%29.aspx + + private bool _disposed = false; + public void Dispose() + { + Dispose(true); + // Take object out the finalization queue to prevent finalization code for it from executing a second time + GC.SuppressFinalize(this); + } + + private void Dispose(bool disposing) + { + if (this._disposed) return; // If it's already disposed, just get out of here + if (disposing) { } // Dispose any managed resources - here we don't have any + + RPCObjectManager.Release(this); // Release our dynamic ID + + _disposed = true; + } + + ~RPCObject() + { + // Finalizer called by the runtime. We should only dispose unmanaged objects and should NOT reference managed ones + Dispose(false); + } + + #endregion + } +} diff --git a/src/Mooege/Core/MooNet/Objects/RPCObjectManager.cs b/src/Mooege/Core/MooNet/Objects/RPCObjectManager.cs new file mode 100644 index 00000000..f45cac8f --- /dev/null +++ b/src/Mooege/Core/MooNet/Objects/RPCObjectManager.cs @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using Mooege.Common.Logging; + +namespace Mooege.Core.MooNet.Objects +{ + public static class RPCObjectManager + { + private static readonly Logger Logger = LogManager.CreateLogger(); + + private static ulong _nextId = 0; + public static readonly Dictionary Objects = new Dictionary(); + + static RPCObjectManager() + { } + + public static void Init(RPCObject obj) + { + if (Objects.ContainsKey(obj.DynamicId)) + throw new Exception("Given object was already initialized"); + ulong id = Next(); + obj.DynamicId = id; + Objects.Add(id, obj); + } + + public static void Release(RPCObject obj) + { + Logger.Trace("Releasing object {0}", obj.DynamicId); + Objects.Remove(obj.DynamicId); + } + + public static ulong Next() + { + while (Objects.ContainsKey(++_nextId)) ; + return _nextId; + } + } +} diff --git a/src/Mooege/Core/MooNet/Online/PlayerManager.cs b/src/Mooege/Core/MooNet/Online/PlayerManager.cs new file mode 100644 index 00000000..428dccbe --- /dev/null +++ b/src/Mooege/Core/MooNet/Online/PlayerManager.cs @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using Mooege.Net.MooNet; + +namespace Mooege.Core.MooNet.Online +{ + // probably will not need this when we actually send players from last game to recent players window. + public static class PlayerManager + { + public static readonly List OnlinePlayers = new List(); + + public static void PlayerConnected(MooNetClient client) + { + OnlinePlayers.Add(client); + } + + public static void PlayerDisconnected(MooNetClient client) + { + OnlinePlayers.Remove(client); + } + } +} diff --git a/src/Mooege/Core/MooNet/Services/AchievementService.cs b/src/Mooege/Core/MooNet/Services/AchievementService.cs new file mode 100644 index 00000000..f14cac71 --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/AchievementService.cs @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using Google.ProtocolBuffers; +using Mooege.Common.Versions; +using Mooege.Common.Logging; +using Mooege.Net.MooNet; +using Mooege.Common.Extensions; + +namespace Mooege.Core.MooNet.Services +{ + [Service(serviceID: 0x20, serviceName: "bnet.protocol.achievements.AchievementsService")] + public class AchievementService : bnet.protocol.achievements.AchievementsService, IServerService + { + private static readonly Logger Logger = LogManager.CreateLogger(); + public MooNetClient Client { get; set; } + public bnet.protocol.Header LastCallHeader { get; set; } + public uint Status { get; set; } + + public override void PostUpdate(IRpcController controller, bnet.protocol.achievements.PostUpdateRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void RegisterWithService(IRpcController controller, bnet.protocol.achievements.RegisterWithServiceRequest request, Action done) + { + // This should register client with achievement notifier service. -Egris + Logger.Trace("Register()"); + + var snapshot = bnet.protocol.achievements.Snapshot.CreateBuilder(); + + foreach (var achievement in this.Client.Account.CurrentGameAccount.Achievements) + snapshot.AddAchievementSnapshot(achievement); + + foreach (var criteria in this.Client.Account.CurrentGameAccount.AchievementCriteria) + snapshot.AddCriteriaSnapshot(criteria); + + var response = bnet.protocol.achievements.RegisterWithServiceResponse.CreateBuilder() + .SetRegistrationFlags(3) + .SetSnapshot(snapshot); + + done(response.Build()); + } + + public override void RequestSnapshot(IRpcController controller, bnet.protocol.achievements.RequestSnapshotRequest request, Action done) + { + Logger.Trace("RequestSnapshot()"); + + var snapshot = bnet.protocol.achievements.Snapshot.CreateBuilder(); + + foreach (var achievement in this.Client.Account.CurrentGameAccount.Achievements) + snapshot.AddAchievementSnapshot(achievement); + + foreach (var criteria in this.Client.Account.CurrentGameAccount.AchievementCriteria) + snapshot.AddCriteriaSnapshot(criteria); + + var response = bnet.protocol.achievements.RequestSnapshotResponse.CreateBuilder().SetSnapshot(snapshot); + done(response.Build()); + } + + public override void UnregisterFromService(IRpcController controller, bnet.protocol.achievements.UnregisterFromServiceRequest request, Action done) + { + Logger.Trace("Unregister()"); + + var builder = bnet.protocol.NoData.CreateBuilder(); + + done(builder.Build()); + } + + public override void Initialize(IRpcController controller, bnet.protocol.achievements.InitializeRequest request, Action done) + { + Logger.Trace("Initialize()"); + + var contentHandle = bnet.protocol.ContentHandle.CreateBuilder() + .SetRegion(VersionInfo.MooNet.Regions[VersionInfo.MooNet.Region]) + .SetUsage(0x61636875) //achu + .SetHash(ByteString.CopyFrom(VersionInfo.MooNet.Achievements.AchievementFileHash.ToByteArray())); + var reponse = bnet.protocol.achievements.InitializeResponse.CreateBuilder().SetContentHandle(contentHandle) + .SetMaxRecordsPerUpdate(1) + .SetMaxCriteriaPerRecord(2) + .SetMaxAchievementsPerRecord(1) + .SetMaxRegistrations(512) + .SetFlushFrequency(1); + + done(reponse.Build()); + } + + public override void ValidateStaticData(IRpcController controller, bnet.protocol.achievements.ValidateStaticDataRequest request, Action done) + { + throw new NotImplementedException(); + } + } +} diff --git a/src/Mooege/Core/MooNet/Services/AuthenticationService.cs b/src/Mooege/Core/MooNet/Services/AuthenticationService.cs new file mode 100644 index 00000000..a50c1d98 --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/AuthenticationService.cs @@ -0,0 +1,202 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Globalization; +using System.Threading; +using System.Linq; +using Google.ProtocolBuffers; +using Mooege.Common.Logging; +using Mooege.Common.Versions; +using Mooege.Core.MooNet.Authentication; +using Mooege.Core.Cryptography; +using Mooege.Core.MooNet.Online; +using Mooege.Net.MooNet; +using Mooege.Core.MooNet.Accounts; +using Mooege.Common.Extensions; + +namespace Mooege.Core.MooNet.Services +{ + [Service(serviceID: 0x1, serviceName: "bnet.protocol.authentication.AuthenticationServer")] + public class AuthenticationService : bnet.protocol.authentication.AuthenticationServer, IServerService + { + private static readonly Logger Logger = LogManager.CreateLogger(); + public MooNetClient Client { get; set; } + public bnet.protocol.Header LastCallHeader { get; set; } + public uint Status { get; set; } + + public override void Logon(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.authentication.LogonRequest request, Action done) + { + Logger.Trace("LogonRequest(): Email={0}", request.Email); + + if (!VersionChecker.Check(this.Client, request)) // if the client trying to connect doesn't match required version, disconnect him. + { + Logger.Error("Client [{0}] doesn't match required version {1}, disconnecting..", request.Email, VersionInfo.MooNet.RequiredClientVersion); + + // create the disconnection reason. + var reason = bnet.protocol.connection.DisconnectNotification.CreateBuilder() + .SetErrorCode(3018).Build(); + + // Error 3018 => A new patch for Diablo III is available. The game will now close and apply the patch automatically. You will be able to continue playing after the patch has been applied. + + // FIXME: D3 client somehow doesn't show the correct error message yet, and in debug output we only miss a message like [ Recv ] service_id: 254 token: 6 status: 28 + // when I compare mooege's output. That could be the reason. /raist. + + // force disconnect the client as it does not satisfy required version. /raist. + this.Client.MakeRPC(() => bnet.protocol.connection.ConnectionService.CreateStub(this.Client).ForceDisconnect(null, reason, callback => { })); + this.Client.Connection.Disconnect(); + + return; + } + + done(bnet.protocol.NoData.CreateBuilder().Build()); + + AuthManager.StartAuthentication(this.Client, request); + } + + public override void ModuleMessage(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.authentication.ModuleMessageRequest request, Action done) + { + var moduleMessage = request.Message.ToByteArray(); + var command = moduleMessage[0]; + var module = this.Client.ClientModuleIds.Where(pair => pair.Value == request.ModuleId).Select(pair => pair.Key).First(); + + Logger.Trace("ModuleMessage(): Module: {0} ModuleId: {1} Command: {2}", module, request.ModuleId, command); + + done(bnet.protocol.NoData.CreateBuilder().Build()); + + switch (module) + { + case MooNetClient.StreamedModule.Password: + if (command == 2) + AuthManager.HandleAuthResponse(this.Client, request.ModuleId, moduleMessage); + else + Logger.Error("Unknown command: {0} for Password module.", command); + break; + case MooNetClient.StreamedModule.Token: + + var moduleLoadRequest = bnet.protocol.authentication.ModuleLoadRequest.CreateBuilder(); + var moduleHandle = bnet.protocol.ContentHandle.CreateBuilder(); + moduleHandle.SetRegion(VersionInfo.MooNet.Regions[VersionInfo.MooNet.Region]) + .SetUsage(0x61757468); // auth - RiskFingerprint.dll or Agreement.dll + + if (this.Client.HasAgreements()) + { + moduleHandle.SetHash(ByteString.CopyFrom(VersionInfo.MooNet.AgreementHashMap[this.Client.Platform])); + this.Client.LastRequestedModule = MooNetClient.StreamedModule.Agreement; + } + else + { + moduleHandle.SetHash(ByteString.CopyFrom(VersionInfo.MooNet.RiskFingerprintHashMap[this.Client.Platform])); + moduleLoadRequest.SetMessage(ByteString.Empty); + this.Client.LastRequestedModule = MooNetClient.StreamedModule.RiskFingerprint; + } + + moduleLoadRequest.SetModuleHandle(moduleHandle); + this.Client.MakeRPC(() => bnet.protocol.authentication.AuthenticationClient.CreateStub(this.Client).ModuleLoad(null, moduleLoadRequest.Build(), ModuleLoadResponse)); + break; + case MooNetClient.StreamedModule.RiskFingerprint: + Logger.Trace("Completing Authentication."); + this.Client.AuthenticationComplete(); + break; + case MooNetClient.StreamedModule.Agreement: + switch (this.Client.LastAgreementSent) + { + case MooNetClient.AvailableAgreements.EULA: + this.Client.Agreements.Add(MooNetClient.AvailableAgreements.EULA, true); + break; + case MooNetClient.AvailableAgreements.TOS: + this.Client.Agreements.Add(MooNetClient.AvailableAgreements.TOS, true); + break; + case MooNetClient.AvailableAgreements.RMAH: + this.Client.Agreements.Add(MooNetClient.AvailableAgreements.RMAH, true); + break; + default: + Logger.Error("Unknown agreement."); + break; + } + this.Client.SendAgreements(); + break; + default: + Logger.Error("Unknown module message data."); + break; + } + } + + public override void SelectGameAccount(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.EntityId request, Action done) + { + this.Client.Account.CurrentGameAccount = GameAccountManager.GetAccountByPersistentID(request.Low); + this.Client.Account.CurrentGameAccount.LoggedInClient = this.Client; + + Logger.Trace("SelectGameAccount(): {0}", this.Client.Account.CurrentGameAccount); + + done(bnet.protocol.NoData.CreateBuilder().Build()); + } + + public override void ModuleNotify(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.authentication.ModuleNotification request, Action done) + { + Logger.Trace("ModuleNotify(): Module: {0} ModuleId: {1} Result: {2}", this.Client.LastRequestedModule.ToString(), request.ModuleId, request.Result); + + done(bnet.protocol.NoData.CreateBuilder().Build()); + this.Client.ClientModuleIds[this.Client.LastRequestedModule] = request.ModuleId; + var moduleLoadRequest = bnet.protocol.authentication.ModuleLoadRequest.CreateBuilder(); + switch (this.Client.LastRequestedModule) + { + case MooNetClient.StreamedModule.Thumbprint: + moduleLoadRequest.SetModuleHandle(bnet.protocol.ContentHandle.CreateBuilder() + .SetRegion(VersionInfo.MooNet.Regions[VersionInfo.MooNet.Region]) + .SetUsage(0x61757468) // auth - password.dll + .SetHash(ByteString.CopyFrom(VersionInfo.MooNet.PasswordHashMap[this.Client.Platform]))) + .SetMessage(ByteString.CopyFrom(AuthManager.OngoingAuthentications[this.Client].LogonChallenge)); + + this.Client.LastRequestedModule = MooNetClient.StreamedModule.Password; + this.Client.MakeRPC(() => bnet.protocol.authentication.AuthenticationClient.CreateStub(this.Client).ModuleLoad(null, moduleLoadRequest.Build(), ModuleLoadResponse)); + break; + case MooNetClient.StreamedModule.Agreement: + if (this.Client.HasAgreements()) + { + this.Client.SendAgreements(); + } + else + { + moduleLoadRequest.SetModuleHandle(bnet.protocol.ContentHandle.CreateBuilder() + .SetRegion(VersionInfo.MooNet.Regions[VersionInfo.MooNet.Region]) + .SetUsage(0x61757468) // auth - RiskFingerprint.dll + .SetHash(ByteString.CopyFrom(VersionInfo.MooNet.RiskFingerprintHashMap[this.Client.Platform]))) + .SetMessage(ByteString.Empty); + + this.Client.LastRequestedModule = MooNetClient.StreamedModule.RiskFingerprint; + this.Client.MakeRPC(() => bnet.protocol.authentication.AuthenticationClient.CreateStub(this.Client).ModuleLoad(null, moduleLoadRequest.Build(), ModuleLoadResponse)); + } + break; + case MooNetClient.StreamedModule.Password: + case MooNetClient.StreamedModule.Token: + case MooNetClient.StreamedModule.RiskFingerprint: + break; + default: + Logger.Error("LastRequestModule: {0}", this.Client.LastRequestedModule.ToString()); + break; + } + } + + private static void ModuleLoadResponse(IMessage response) + { + Logger.Trace("ModuleLoadResponse(): {0}", response.ToString()); + } + + } +} diff --git a/src/Mooege/Core/MooNet/Services/ChannelInvitationService.cs b/src/Mooege/Core/MooNet/Services/ChannelInvitationService.cs new file mode 100644 index 00000000..a83a73fe --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/ChannelInvitationService.cs @@ -0,0 +1,172 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using Mooege.Common.Extensions; +using Mooege.Common.Logging; +using Mooege.Core.MooNet.Channels; +using Mooege.Core.MooNet.Accounts; +using Mooege.Net.MooNet; + +namespace Mooege.Core.MooNet.Services +{ + [Service(serviceID: 0x3, serviceName: "bnet.protocol.channel_invitation.ChannelInvitationService")] + public class ChannelInvitationService : bnet.protocol.channel_invitation.ChannelInvitationService, IServerService + { + private static readonly Logger Logger = LogManager.CreateLogger(); + public MooNetClient Client { get; set; } + public bnet.protocol.Header LastCallHeader { get; set; } + public uint Status { get; set; } + + private readonly ChannelInvitationManager _invitationManager = new ChannelInvitationManager(); + + public override void Subscribe(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.channel_invitation.SubscribeRequest request, Action done) + { + Logger.Trace("Subscribe() {0}", this.Client); + + this._invitationManager.AddSubscriber(this.Client, request.ObjectId); + var builder = bnet.protocol.channel_invitation.SubscribeResponse.CreateBuilder(); + done(builder.Build()); + } + + public override void AcceptInvitation(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.channel_invitation.AcceptInvitationRequest request, Action done) + { + var channel = ChannelManager.GetChannelByEntityId(this._invitationManager.GetInvitationById(request.InvitationId).GetExtension(bnet.protocol.channel_invitation.ChannelInvitation.ChannelInvitationProp).ChannelDescription.ChannelId); + + Logger.Trace("{0} accepted invitation id {1} to channel {2}.", this.Client.Account.CurrentGameAccount.CurrentToon, request.InvitationId, channel); + + var response = bnet.protocol.channel_invitation.AcceptInvitationResponse.CreateBuilder().SetObjectId(channel.DynamicId).Build(); + done(response); + + this._invitationManager.HandleAccept(this.Client, request); + } + + public override void DeclineInvitation(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.invitation.GenericRequest request, Action done) + { + Logger.Trace("{0} declined invitation.", this.Client.Account.CurrentGameAccount.CurrentToon); + + var respone = bnet.protocol.NoData.CreateBuilder(); + done(respone.Build()); + + this._invitationManager.HandleDecline(this.Client, request); + } + + public override void RevokeInvitation(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.channel_invitation.RevokeInvitationRequest request, Action done) + { + Logger.Trace("{0} revoked invitation.", this.Client.Account.CurrentGameAccount.CurrentToon); + + var builder = bnet.protocol.NoData.CreateBuilder(); + done(builder.Build()); + + this._invitationManager.Revoke(this.Client, request); + } + + public override void SendInvitation(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.invitation.SendInvitationRequest request, Action done) + { + var invitee = GameAccountManager.GetAccountByPersistentID(request.TargetId.Low); + //if (this.Client.CurrentChannel.HasMember(invitee)) return; // don't allow a second invitation if invitee is already a member of client's current channel. + + Logger.Debug("{0} invited {1} to his channel.", Client.Account.CurrentGameAccount.CurrentToon, invitee); + + // somehow protobuf lib doesnt handle this extension, so we're using a workaround to get that channelinfo. + var extensionBytes = request.Params.UnknownFields.FieldDictionary[105].LengthDelimitedList[0].ToByteArray(); + var channelInvitationInfo = bnet.protocol.channel_invitation.ChannelInvitationParams.ParseFrom(extensionBytes); + + var channel = ChannelManager.GetChannelByEntityId(channelInvitationInfo.ChannelId); + var channelDescription = bnet.protocol.channel.ChannelDescription.CreateBuilder() + .SetChannelId(channelInvitationInfo.ChannelId) + .SetCurrentMembers((uint)channel.Members.Count) + .SetState(channel.State); + + var channelInvitation = bnet.protocol.channel_invitation.ChannelInvitation.CreateBuilder() + .SetChannelDescription(channelDescription) + .SetReserved(channelInvitationInfo.Reserved) + .SetServiceType(channelInvitationInfo.ServiceType) + .SetRejoin(false).Build(); + + var invitation = bnet.protocol.invitation.Invitation.CreateBuilder(); + invitation.SetId(ChannelInvitationManager.InvitationIdCounter++) + .SetInviterIdentity(bnet.protocol.Identity.CreateBuilder().SetGameAccountId(Client.Account.CurrentGameAccount.BnetEntityId).Build()) + .SetInviterName(Client.Account.CurrentGameAccount.Owner.BattleTag) + .SetInviteeIdentity(bnet.protocol.Identity.CreateBuilder().SetGameAccountId(request.TargetId).Build()) + .SetInviteeName(invitee.Owner.BattleTag) + .SetInvitationMessage(request.Params.InvitationMessage) + .SetCreationTime(DateTime.Now.ToExtendedEpoch()) + .SetExpirationTime(DateTime.Now.ToUnixTime() + request.Params.ExpirationTime) + .SetExtension(bnet.protocol.channel_invitation.ChannelInvitation.ChannelInvitationProp, channelInvitation); + + // oh blizz, cmon. your buggy client even doesn't care this message at all but waits the UpdateChannelStateNotification with embedded invitation proto to show "invitation sent message". + // ADVICE TO POTENTIAL BLIZZ-WORKER READING THIS; + // change rpc SendInvitation(.bnet.protocol.invitation.SendInvitationRequest) returns (.bnet.protocol.invitation.SendInvitationResponse); to rpc SendInvitation(.bnet.protocol.invitation.SendInvitationRequest) returns (.bnet.protocol.NoData); + + var builder = bnet.protocol.invitation.SendInvitationResponse.CreateBuilder(); + channel.AddInvitation(invitation.Build()); + + if (!channel.HasMember(invitee)) + builder.SetInvitation(invitation.Clone()); // clone it because we need that invitation as un-builded below. + + done(builder.Build()); + + // send bnet.protocol.channel.UpdateChannelStateNotification to inviter - update him on invitation is sent. + + var notification = bnet.protocol.channel.UpdateChannelStateNotification.CreateBuilder() + .SetAgentId(Client.Account.CurrentGameAccount.BnetEntityId) + .SetStateChange(bnet.protocol.channel.ChannelState.CreateBuilder().AddInvitation(invitation.Clone())); + + this.Client.MakeTargetedRPC(channel, () => + bnet.protocol.channel.ChannelSubscriber.CreateStub(Client).NotifyUpdateChannelState(controller, notification.Build(), callback => { })); + + // notify the invitee on invitation. + this._invitationManager.HandleInvitation(this.Client, invitation.Build()); + } + + public override void SuggestInvitation(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.channel_invitation.SuggestInvitationRequest request, Action done) + { + var suggester = GameAccountManager.GetAccountByPersistentID(request.TargetId.Low); //wants invite + var suggestee = GameAccountManager.GetAccountByPersistentID(request.ApprovalId.Low); //approves invite + if (suggestee == null) return; + + Logger.Debug("{0} suggested {1} to invite him.", suggester, suggestee); + var respone = bnet.protocol.NoData.CreateBuilder(); + done(respone.Build()); + + // Even though it makes no sense, the suggester is used for all fields in the caps and is what works with the client. /dustinconrad + var suggestion = bnet.protocol.invitation.Suggestion.CreateBuilder() + .SetChannelId(request.ChannelId) + .SetSuggesterId(suggester.BnetEntityId) + .SetSuggesterName(suggester.Owner.BattleTag) + .SetSuggesteeId(suggester.BnetEntityId) + .SetSuggesteeName(suggester.Owner.BattleTag) + .Build(); + + var notification = bnet.protocol.channel_invitation.SuggestionAddedNotification.CreateBuilder().SetSuggestion(suggestion); + + suggestee.LoggedInClient.MakeTargetedRPC(this._invitationManager, () => + bnet.protocol.channel_invitation.ChannelInvitationNotify.CreateStub(suggestee.LoggedInClient).NotifyReceivedSuggestionAdded(null, notification.Build(), callback => { })); + } + + public override void Unsubscribe(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.channel_invitation.UnsubscribeRequest request, Action done) + { + Logger.Trace("Unsubscribe() {0}", this.Client); + + this._invitationManager.RemoveSubscriber(Client); + var builder = bnet.protocol.NoData.CreateBuilder(); + done(builder.Build()); + } + } +} diff --git a/src/Mooege/Core/MooNet/Services/ChannelOwnerService.cs b/src/Mooege/Core/MooNet/Services/ChannelOwnerService.cs new file mode 100644 index 00000000..73fa0bc7 --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/ChannelOwnerService.cs @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using Mooege.Common.Logging; +using Mooege.Core.MooNet.Channels; +using Mooege.Net.MooNet; + +namespace Mooege.Core.MooNet.Services +{ + [Service(serviceID: 0x11, serviceName: "bnet.protocol.channel.ChannelOwner")] + public class ChannelOwnerService : bnet.protocol.channel.ChannelOwner, IServerService + { + private static readonly Logger Logger = LogManager.CreateLogger(); + public MooNetClient Client { get; set; } + public bnet.protocol.Header LastCallHeader { get; set; } + public uint Status { get; set; } + + public override void CreateChannel(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.channel.CreateChannelRequest request, System.Action done) + { + var channel = ChannelManager.CreateNewChannel(this.Client, request.ObjectId); + var builder = bnet.protocol.channel.CreateChannelResponse.CreateBuilder() + .SetObjectId(channel.DynamicId) + .SetChannelId(channel.BnetEntityId); + + Logger.Trace("CreateChannel() {0} for {1}", channel, Client.Account.CurrentGameAccount.CurrentToon); + + done(builder.Build()); + channel.SetOwner(Client); // Set the client that requested the creation of channel as the owner + + } + + public override void FindChannel(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.channel.FindChannelRequest request, System.Action done) + { + Logger.Trace("FindChannel(): Filter={0}", request.Options.AttributeFilter); + var builder = bnet.protocol.channel.FindChannelResponse.CreateBuilder(); + + done(builder.Build()); + } + + public override void GetChannelId(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.channel.GetChannelIdRequest request, System.Action done) + { + throw new NotImplementedException(); + } + + public override void GetChannelInfo(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.channel.GetChannelInfoRequest request, System.Action done) + { + Logger.Trace("GetChannelInfoRequest() to channel {0}:{1} by toon {2}", request.ChannelId.High, request.ChannelId.Low, Client.Account.CurrentGameAccount.CurrentToon.Name); + + var builder = bnet.protocol.channel.GetChannelInfoResponse.CreateBuilder(); + var channel = ChannelManager.GetChannelByEntityId(request.ChannelId); + if (channel != null) + builder.SetChannelInfo(channel.Info); + else + Logger.Warn("Channel does not exist!"); + + done(builder.Build()); + } + + public override void JoinChannel(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.channel.JoinChannelRequest request, System.Action done) + { + Logger.Trace("ChannelOwnerService:JoinChannel()"); + + var channel = ChannelManager.GetChannelByEntityId(request.ChannelId); + channel.Join(this.Client, request.ObjectId); + var builder = bnet.protocol.channel.JoinChannelResponse.CreateBuilder().SetObjectId(channel.DynamicId); + done(builder.Build()); + } + } +} diff --git a/src/Mooege/Core/MooNet/Services/ChannelService.cs b/src/Mooege/Core/MooNet/Services/ChannelService.cs new file mode 100644 index 00000000..f9a001d2 --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/ChannelService.cs @@ -0,0 +1,212 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Linq; +using Mooege.Common.Logging; +using Mooege.Core.MooNet.Channels; +using Mooege.Core.MooNet.Commands; +using Mooege.Net.MooNet; +using Mooege.Core.MooNet.Accounts; + +namespace Mooege.Core.MooNet.Services +{ + [Service(serviceID: 0x10, serviceName: "bnet.protocol.channel.Channel")] + public class ChannelService : bnet.protocol.channel.Channel, IServerService + { + private static readonly Logger Logger = LogManager.CreateLogger(); + public MooNetClient Client { get; set; } + public bnet.protocol.Header LastCallHeader { get; set; } + public uint Status { get; set; } + + public override void AddMember(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.channel.AddMemberRequest request, System.Action done) + { + throw new NotImplementedException(); + } + + public override void Dissolve(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.channel.DissolveRequest request, System.Action done) + { + throw new NotImplementedException(); + } + + public override void RemoveMember(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.channel.RemoveMemberRequest request, System.Action done) + { + Logger.Trace("RemoveMember()"); + var channel = ChannelManager.GetChannelByDynamicId(LastCallHeader.ObjectId); + var gameAccount = GameAccountManager.GetAccountByPersistentID(request.MemberId.Low); + + var builder = bnet.protocol.NoData.CreateBuilder(); + done(builder.Build()); + + channel.RemoveMember(gameAccount.LoggedInClient, Channel.GetRemoveReasonForRequest((Channel.RemoveRequestReason)request.Reason)); + } + + public override void SendMessage(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.channel.SendMessageRequest request, System.Action done) + { + var channel = ChannelManager.GetChannelByDynamicId(this.LastCallHeader.ObjectId); + Logger.Trace("{0} sent a message to channel {1}.", this.Client.Account.CurrentGameAccount.CurrentToon, channel); + + var builder = bnet.protocol.NoData.CreateBuilder(); + done(builder.Build()); + + if (!request.HasMessage) + return; // only continue if the request actually contains a message. + + if (request.Message.AttributeCount == 0 || !request.Message.AttributeList.First().HasValue) + return; // check if it has attributes. + + var parsedAsCommand = CommandManager.TryParse(request.Message.AttributeList[0].Value.StringValue, this.Client); // try parsing the message as a command + + if (!parsedAsCommand) + channel.SendMessage(this.Client, request.Message); // if it's not parsed as an command - let channel itself to broadcast message to it's members. + } + + public override void SetRoles(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.channel.SetRolesRequest request, System.Action done) + { + throw new NotImplementedException(); + } + + public override void UpdateChannelState(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.channel.UpdateChannelStateRequest request, System.Action done) + { + var channel = ChannelManager.GetChannelByDynamicId(this.LastCallHeader.ObjectId); + Logger.Trace("UpdateChannelState(): {0}", channel.ToString()); + + // TODO: Should be actually applying changes on channel. /raist. + var channelState = bnet.protocol.channel.ChannelState.CreateBuilder(); + + foreach (bnet.protocol.attribute.Attribute attribute in request.StateChange.AttributeList) + { + if (attribute.Name == "D3.Party.GameCreateParams") + { + if (attribute.HasValue && !attribute.Value.MessageValue.IsEmpty) //Sometimes not present -Egris + { + var gameCreateParams = D3.OnlineService.GameCreateParams.ParseFrom(attribute.Value.MessageValue); + + if (channel.Attributes.ContainsKey(attribute.Name)) + channel.Attributes[attribute.Name] = attribute; + else + channel.Attributes.Add(attribute.Name, attribute); + var attr = bnet.protocol.attribute.Attribute.CreateBuilder() + .SetName("D3.Party.GameCreateParams") + .SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(gameCreateParams.ToByteString()).Build()); + channelState.AddAttribute(attr); + Logger.Trace("D3.Party.GameCreateParams: {0}", gameCreateParams.ToString()); + } + } + else if (attribute.Name == "D3.Party.SearchForPublicGame.Params") + { + // TODO: Find a game that fits the clients params and join /raist. + var publicGameParams = D3.PartyMessage.SearchForPublicGameParams.ParseFrom(attribute.Value.MessageValue); + Logger.Warn("SearchForPublicGameParams: {0}", publicGameParams.ToString()); + } + else if (attribute.Name == "D3.Party.ScreenStatus") + { + if (!this.Client.MOTDSent) + this.Client.SendMOTD(); // send the MOTD to client if we haven't yet so. + + if (!attribute.HasValue || attribute.Value.MessageValue.IsEmpty) //Sometimes not present -Egris + { + var attr = bnet.protocol.attribute.Attribute.CreateBuilder() + .SetName("D3.Party.ScreenStatus") + .SetValue(bnet.protocol.attribute.Variant.CreateBuilder()); + channelState.AddAttribute(attr); + Logger.Trace("D3.Party.ScreenStatus = null"); + } + else + { + var oldScreen = D3.PartyMessage.ScreenStatus.ParseFrom(attribute.Value.MessageValue); + this.Client.Account.CurrentGameAccount.ScreenStatus = oldScreen; + + // TODO: save screen status for use with friends -Egris + var attr = bnet.protocol.attribute.Attribute.CreateBuilder() + .SetName("D3.Party.ScreenStatus") + .SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(oldScreen.ToByteString())); + channelState.AddAttribute(attr); + Logger.Trace("Client moving to Screen: {0}, with Status: {1}", oldScreen.Screen, oldScreen.Status); + } + } + else if (attribute.Name == "D3.Party.JoinPermissionPreviousToLock") + { + // 0 - CLOSED + // 1 - ASK_TO_JOIN + + var joinPermission = attribute.Value; + var attr = bnet.protocol.attribute.Attribute.CreateBuilder() + .SetName("D3.Party.JoinPermissionPreviousToLock") + .SetValue(joinPermission); + channelState.AddAttribute(attr); + Logger.Trace("D3.Party.JoinPermissionPreviousToLock = {0}", joinPermission.IntValue); + } + else if (attribute.Name == "D3.Party.LockReasons") + { + // 0 - CREATING_GAME + // 2 - MATCHMAKER_SEARCHING + + var lockReason = attribute.Value; + var attr = bnet.protocol.attribute.Attribute.CreateBuilder() + .SetName("D3.Party.LockReasons") + .SetValue(lockReason); + channelState.AddAttribute(attr); + Logger.Trace("D3.Party.LockReasons = {0}", lockReason.IntValue); + } + else if (attribute.Name == "D3.Party.GameId") + { + if (attribute.HasValue && !attribute.Value.MessageValue.IsEmpty) //Sometimes not present -Egris + { + var gameId = D3.OnlineService.GameId.ParseFrom(attribute.Value.MessageValue); + var attr = bnet.protocol.attribute.Attribute.CreateBuilder() + .SetName("D3.Party.GameId") + .SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(gameId.ToByteString()).Build()); + channelState.AddAttribute(attr); + Logger.Trace("D3.Party.GameId = {0}", gameId.IdLow); + } + else + Logger.Trace("D3.Party.GameId = null"); + + } + else + { + Logger.Warn("UpdateChannelState(): Unknown attribute: {0}", attribute.Name); + } + } + + var builder = bnet.protocol.NoData.CreateBuilder(); + done(builder.Build()); + + if (request.StateChange.HasPrivacyLevel) + channelState.PrivacyLevel = request.StateChange.PrivacyLevel; + + var notification = bnet.protocol.channel.UpdateChannelStateNotification.CreateBuilder() + .SetAgentId(this.Client.Account.CurrentGameAccount.BnetEntityId) + .SetStateChange(channelState) + .Build(); + + //Notify all Channel members + foreach (var member in channel.Members.Keys) + { + member.MakeTargetedRPC(channel, () => + bnet.protocol.channel.ChannelSubscriber.CreateStub(member).NotifyUpdateChannelState(null, notification, callback => { })); + } + } + + public override void UpdateMemberState(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.channel.UpdateMemberStateRequest request, System.Action done) + { + throw new NotImplementedException(); + } + } +} diff --git a/src/Mooege/Core/MooNet/Services/ConnectionService.cs b/src/Mooege/Core/MooNet/Services/ConnectionService.cs new file mode 100644 index 00000000..a3186286 --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/ConnectionService.cs @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using Google.ProtocolBuffers; +using Mooege.Common.Versions; +using Mooege.Common.Extensions; +using Mooege.Common.Logging; +using Mooege.Net.MooNet; + +namespace Mooege.Core.MooNet.Services +{ + [Service(serviceID: 0x0, serviceHash: 0x0)] + public class ConnectionService : bnet.protocol.connection.ConnectionService, IServerService + { + private static readonly Logger Logger = LogManager.CreateLogger(); + public MooNetClient Client { get; set; } + public bnet.protocol.Header LastCallHeader { get; set; } + public uint Status { get; set; } + + public override void Connect(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.connection.ConnectRequest request, Action done) + { + Logger.Trace("Connect()"); + + var builder = bnet.protocol.connection.ConnectResponse.CreateBuilder() + .SetServerId(bnet.protocol.ProcessId.CreateBuilder().SetLabel(0).SetEpoch(DateTime.Now.ToUnixTime())) + .SetClientId(bnet.protocol.ProcessId.CreateBuilder().SetLabel(1).SetEpoch(DateTime.Now.ToUnixTime())); + + if (request.HasClientId) + builder.SetClientId(request.ClientId); + + builder.SetContentHandleArray(bnet.protocol.connection.ConnectionMeteringContentHandles.CreateBuilder() + .AddContentHandle(bnet.protocol.ContentHandle.CreateBuilder() + .SetRegion(VersionInfo.MooNet.Regions[VersionInfo.MooNet.Region]) + .SetUsage(0x6D74727A) //mtrz + .SetHash(ByteString.CopyFrom("acaeab71f005567974a656cf1207f74bb9a5365c84e9f22f1f82ffec3d1367a8".ToByteArray())))); + + done(builder.Build()); + } + + public override void Bind(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.connection.BindRequest request, Action done) + { + Logger.Trace("Bind(): {0}", this.Client); + + var requestedServiceIDs = new List(); + + foreach (var serviceHash in request.ImportedServiceHashList) + { + var serviceID = Service.GetByHash(serviceHash); + requestedServiceIDs.Add(serviceID); + + Logger.Trace("[export] Hash: 0x{0} Id: 0x{1} Service: {2} ", serviceHash.ToString("X8"), serviceID.ToString("X2"), Service.GetByID(serviceID) != null ? Service.GetByID(serviceID).GetType().Name : "N/A"); + } + + // read services supplied by client.. + foreach (var service in request.ExportedServiceList.Where(service => !Client.Services.ContainsValue(service.Id))) + { + if (Client.Services.ContainsKey(service.Hash)) continue; + Client.Services.Add(service.Hash, service.Id); + + Logger.Trace(string.Format("[import] Hash: 0x{0} Id: 0x{1}", service.Hash.ToString("X8"), service.Id.ToString("X2"))); + } + + var builder = bnet.protocol.connection.BindResponse.CreateBuilder(); + foreach (var serviceId in requestedServiceIDs) builder.AddImportedServiceId(serviceId); + + done(builder.Build()); + } + + public override void Echo(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.connection.EchoRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void Encrypt(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.connection.EncryptRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void ForceDisconnect(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.connection.DisconnectNotification request, Action done) + { + throw new NotImplementedException(); + } + + public override void Null(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.connection.NullRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void RequestDisconnect(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.connection.DisconnectRequest request, Action done) + { + Logger.Trace("RequestDisconnect()"); + if (this.Client.Account != null) + { + Accounts.AccountManager.SaveToDB(this.Client.Account); + if (this.Client.Account.CurrentGameAccount != null) + { + Accounts.GameAccountManager.SaveToDB(this.Client.Account.CurrentGameAccount); + this.Client.Account.CurrentGameAccount.LoggedInClient.Connection.Disconnect(); + } + } + } + } +} diff --git a/src/Mooege/Core/MooNet/Services/ExchangeService.cs b/src/Mooege/Core/MooNet/Services/ExchangeService.cs new file mode 100644 index 00000000..387b3b2d --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/ExchangeService.cs @@ -0,0 +1,385 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Linq; +using Google.ProtocolBuffers; +using Mooege.Common.Logging; +using Mooege.Net.MooNet; +using Mooege.Core.MooNet.Helpers; +using Mooege.Common.Extensions; + +namespace Mooege.Core.MooNet.Services +{ + [Service(serviceID: 0x0a, serviceName: "bnet.protocol.exchange.ExchangeService")] + public class ExchangeService : bnet.protocol.exchange.ExchangeService, IServerService + { + private static readonly Logger Logger = LogManager.CreateLogger(); + public MooNetClient Client { get; set; } + public bnet.protocol.Header LastCallHeader { get; set; } + public uint Status { get; set; } + + public override void GetConfiguration(IRpcController controller, bnet.protocol.exchange.GetConfigurationRequest request, Action done) + { + Logger.Trace("GetConfiguration()"); + //TODO: Figure out what the buyout rules/specialist values are, and if they are related /dustinconrad + var builder = bnet.protocol.exchange.GetConfigurationResponse.CreateBuilder() + .AddConfigs(bnet.protocol.exchange.SpecialistConfig.CreateBuilder() + .SetSpecialist(1) + .AddAuctionDurations(2880) + .AddAuctionStartDelays(5) + .SetAntiSnipingExtensionDelay(1) + .SetMaxItemsAmount(1) + .SetStartingUnitPriceRule(2) + .SetReservedUnitPriceRule(1) + .SetTradeNowUnitPriceRule(1) + .SetCurrentUnitPriceRule(2) + .SetMaximumUnitPriceRule(2) + .SetFillOrKillRule(0) + .AddCurrencyConfig(bnet.protocol.exchange.CurrencyConfig.CreateBuilder() + .SetCurrency("D3_GOLD") + .SetTickSize(1) + .SetMinTotalPrice(100) + .SetMinUnitPrice(100) + .SetMaxUnitPrice(100000000000) + .SetMaxTotalPrice(100000000000).Build()) + .AddCurrencyConfig(bnet.protocol.exchange.CurrencyConfig.CreateBuilder() + .SetCurrency("D3_GOLD_HC") + .SetTickSize(1) + .SetMinTotalPrice(100) + .SetMinUnitPrice(100) + .SetMaxUnitPrice(100000000000) + .SetMaxTotalPrice(100000000000).Build())) + .AddConfigs(bnet.protocol.exchange.SpecialistConfig.CreateBuilder() + .SetSpecialist(2) + .AddAuctionDurations(2880) + .AddAuctionStartDelays(0) + .SetAntiSnipingExtensionDelay(0) + .SetMaxItemsAmount(4294967295) + .SetStartingUnitPriceRule(1) + .SetReservedUnitPriceRule(2) + .SetTradeNowUnitPriceRule(0) + .SetCurrentUnitPriceRule(0) + .SetMaximumUnitPriceRule(2) + .SetFillOrKillRule(1) + .AddCurrencyConfig(bnet.protocol.exchange.CurrencyConfig.CreateBuilder() + .SetCurrency("D3_GOLD") + .SetTickSize(1) + .SetMinTotalPrice(100) + .SetMinUnitPrice(100) + .SetMaxUnitPrice(100000000000) + .SetMaxTotalPrice(100000000000).Build()) + .AddCurrencyConfig(bnet.protocol.exchange.CurrencyConfig.CreateBuilder() + .SetCurrency("D3_GOLD_HC") + .SetTickSize(1) + .SetMinTotalPrice(100) + .SetMinUnitPrice(100) + .SetMaxUnitPrice(100000000000) + .SetMaxTotalPrice(100000000000).Build())) + .SetRecommendedDefaultRmtCurrency("USD") + .SetRmtRestrictedByLicense(bnet.protocol.account.AccountLicense.CreateBuilder().SetId(222).SetExpires(1337724000000000)); + + done(builder.Build()); + } + + public override void SubscribeOrderUpdate(IRpcController controller, bnet.protocol.exchange.SubscribeOrderUpdateRequest request, Action done) + { + Logger.Trace("SubscribeOrderUpdate() Stub"); + var builder = bnet.protocol.NoData.CreateBuilder(); + done(builder.Build()); + } + + public override void UnsubscribeOrderUpdate(IRpcController controller, bnet.protocol.exchange.UnsubscribeOrderUpdateRequest request, Action done) + { + Logger.Trace("UnsubscribeOrderUpdate() Stub"); + var builder = bnet.protocol.NoData.CreateBuilder(); + done(builder.Build()); + } + + public override void CreateOrderBook(IRpcController controller, bnet.protocol.exchange.CreateOrderBookRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void PlaceOfferOnOrderBook(IRpcController controller, bnet.protocol.exchange.PlaceOfferOnOrderBookRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void PlaceOfferCreateOrderBookIfNeeded(IRpcController controller, bnet.protocol.exchange.PlaceOfferCreateOrderBookIfNeededRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void PlaceBidOnOrderBook(IRpcController controller, bnet.protocol.exchange.PlaceBidOnOrderBookRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void PlaceBidCreateOrderBookIfNeeded(IRpcController controller, bnet.protocol.exchange.PlaceBidCreateOrderBookIfNeededRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void QueryOffersByOrderBook(IRpcController controller, bnet.protocol.exchange.QueryOffersByOrderBookRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void QueryBidsByOrderBook(IRpcController controller, bnet.protocol.exchange.QueryBidsByOrderBookRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void QueryOffersByAccountForItem(IRpcController controller, bnet.protocol.exchange.QueryOffersByAccountForItemRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void QueryBidsByAccountForItem(IRpcController controller, bnet.protocol.exchange.QueryBidsByAccountForItemRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void QueryOrderBooksSummary(IRpcController controller, bnet.protocol.exchange.QueryOrderBooksSummaryRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void ReportAuthorize(IRpcController controller, bnet.protocol.exchange_object_provider.ReportAuthorizeRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void ReportSettle(IRpcController controller, bnet.protocol.exchange_object_provider.ReportSettleRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void ReportCancel(IRpcController controller, bnet.protocol.exchange_object_provider.ReportCancelRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void SubscribeOrderBookStatusChange(IRpcController controller, bnet.protocol.exchange.SubscribeOrderBookStatusChangeRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void UnsubscribeOrderBookStatusChange(IRpcController controller, bnet.protocol.exchange.UnsubscribeOrderBookStatusChangeRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void GetPaymentMethods(IRpcController controller, bnet.protocol.exchange_object_provider.GetPaymentMethodsRequest request, Action done) + { + Logger.Trace("GetPaymentMethods()"); + + var builder = bnet.protocol.exchange_object_provider.GetPaymentMethodsResponse.CreateBuilder(); + var method = bnet.protocol.exchange_object_provider.PaymentMethod.CreateBuilder(); + + switch (request.Currency) + { + case "D3_GOLD": + case "D3_GOLD_HC": + var goldExtensionData = "{ kind: GAME_ACCOUNT (2) id: " + this.Client.Account.CurrentGameAccount.PersistentID + " program: 17459 region: 98 }"; + + method.SetAccount(bnet.protocol.exchange.BlobFrom.CreateBuilder() + .SetSource((uint)FieldKeyHelper.Program.D3) + .SetData(ByteString.CopyFromUtf8(goldExtensionData))) + .SetDescription(request.Currency) + .SetAmount(100000) + .SetWalletId(0) + .Build(); + break; + case "PTR": + var data = new byte[] { 0x6A, 0x04, 0x65, 0x6E, 0x55, 0x53, 0x7A, 0x0A, 0x42, 0x61, 0x74, 0x74, 0x6C, 0x65, 0x43, 0x6F, 0x69, 0x6E }; + //j\004enUSz\nBattleCoin + //data is added to the end of extensionData + var ptrExtensionData = bnet.protocol.exchange.Extension.CreateBuilder() + .SetPartitionId(bnet.protocol.exchange.PartitionId.ParseFrom(this.Client.Account.BnetEntityId.ToByteArray())) + .SetOrderBookId(1) + .SetOrderId(3) + .SetFilledAmount(0) + .SetOrderStatus((int)this.Client.Account.BnetEntityId.Low) + .SetAuthorizedTime(0) + .Build(); + + method.SetAccount(bnet.protocol.exchange.BlobFrom.CreateBuilder() + .SetSource((uint)FieldKeyHelper.Program.D3) + .SetData(ByteString.CopyFrom(ptrExtensionData.ToByteArray().Concat(data).ToArray()))) + .SetDescription("BattleCoin") + .SetAmount(100000) + .SetCashInOutMask(3) + .SetBillingAddress(bnet.protocol.exchange.BillingAddress.CreateBuilder() + .SetCountryId(221) + .SetCity("Irvine") + .SetState("CA") + .SetPostalCode("92618")) + .SetWalletId(123456) + .SetCapRestriction(1) + .SetAuthenticatorCap(4294967295) + .SetSoftCap(4294967295) + .Build(); + break; + } + + builder.AddMethods(method); + + done(builder.Build()); + } + + public override void ClaimBidItem(IRpcController controller, bnet.protocol.exchange.ClaimRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void ClaimBidMoney(IRpcController controller, bnet.protocol.exchange.ClaimRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void ClaimOfferItem(IRpcController controller, bnet.protocol.exchange.ClaimRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void ClaimOfferMoney(IRpcController controller, bnet.protocol.exchange.ClaimRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void CancelBid(IRpcController controller, bnet.protocol.exchange.CancelRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void CancelOffer(IRpcController controller, bnet.protocol.exchange.CancelRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void GetBidFeeEstimation(IRpcController controller, bnet.protocol.exchange.GetBidFeeEstimationRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void GetOfferFeeEstimation(IRpcController controller, bnet.protocol.exchange.GetOfferFeeEstimationRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void QueryOrdersByAccountForItem(IRpcController controller, bnet.protocol.exchange.QueryOrdersByAccountForItemRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void ReportAuthorizeRiskVerdict(IRpcController controller, bnet.protocol.exchange_risk.ReportAuthorizeRiskVerdictRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void ReportSettleRiskVerdict(IRpcController controller, bnet.protocol.exchange_risk.ReportSettleRiskVerdictRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void DelaySettleRiskVerdict(IRpcController controller, bnet.protocol.exchange_risk.DelaySettleRiskVerdictRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void GetFeeDetails(IRpcController controller, bnet.protocol.exchange.GetFeeDetailsRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void GetOrderBookStatistics(IRpcController controller, bnet.protocol.exchange.GetOrderBookStatisticsRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void ReportRefund(IRpcController controller, bnet.protocol.exchange_object_provider.ReportRefundRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void RefundBid(IRpcController controller, bnet.protocol.exchange.RefundRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void CreateCSTrade(IRpcController controller, bnet.protocol.exchange.CreateCSTradeRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void GetBidDetails(IRpcController controller, bnet.protocol.exchange.GetBidDetailsRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void GetOfferDetails(IRpcController controller, bnet.protocol.exchange.GetOfferDetailsRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void GetSystemTime(IRpcController controller, bnet.protocol.NoData request, Action done) + { + var builder = bnet.protocol.exchange.GetSystemTimeResponse.CreateBuilder() + .SetTime(DateTime.Now.ToExtendedEpoch()); + + done(builder.Build()); + } + + public override void GetOrderCount(IRpcController controller, bnet.protocol.exchange.GetOrderCountRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void SubscribeAdvancedOrderUpdate(IRpcController controller, bnet.protocol.exchange.SubscribeAdvancedOrderUpdateRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void UnsubscribeAdvancedOrderUpdate(IRpcController controller, bnet.protocol.exchange.UnsubscribeAdvancedOrderUpdateRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void SettleHistoriesForCS(IRpcController controller, bnet.protocol.exchange.HistoriesForCSRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void CancelHistoriesForCS(IRpcController controller, bnet.protocol.exchange.HistoriesForCSRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void CreateCSTradeItem(IRpcController controller, bnet.protocol.exchange.CreateCSTradeItemRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void CreateCSTradeMoney(IRpcController controller, bnet.protocol.exchange.CreateCSTradeMoneyRequest request, Action done) + { + throw new NotImplementedException(); + } + } +} diff --git a/src/Mooege/Core/MooNet/Services/FollowersService.cs b/src/Mooege/Core/MooNet/Services/FollowersService.cs new file mode 100644 index 00000000..22a67968 --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/FollowersService.cs @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using Mooege.Common.Logging; +using Mooege.Net.MooNet; + +namespace Mooege.Core.MooNet.Services +{ + [Service(serviceID: 0x4, serviceName: "bnet.protocol.followers.FollowersService")] + public class FollowersService : bnet.protocol.followers.FollowersService,IServerService + { + private static readonly Logger Logger = LogManager.CreateLogger(); + public MooNetClient Client { get; set; } + public bnet.protocol.Header LastCallHeader { get; set; } + + public override void SubscribeToFollowers(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.followers.SubscribeToFollowersRequest request, System.Action done) + { + Logger.Trace("Subscribe() {0}", this.Client); + + var builder = bnet.protocol.followers.SubscribeToFollowersResponse.CreateBuilder(); + done(builder.Build()); + } + + public override void StartFollowing(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.followers.StartFollowingRequest request, System.Action done) + { + throw new NotImplementedException(); + } + + public override void StopFollowing(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.followers.StopFollowingRequest request, System.Action done) + { + throw new NotImplementedException(); + } + + public override void UpdateFollowerState(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.followers.UpdateFollowerStateRequest request, System.Action done) + { + throw new NotImplementedException(); + } + } +} diff --git a/src/Mooege/Core/MooNet/Services/FriendsService.cs b/src/Mooege/Core/MooNet/Services/FriendsService.cs new file mode 100644 index 00000000..60db08e6 --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/FriendsService.cs @@ -0,0 +1,232 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using Google.ProtocolBuffers; +using Mooege.Common.Extensions; +using Mooege.Common.Logging; +using Mooege.Core.MooNet.Accounts; +using Mooege.Core.MooNet.Friends; +using Mooege.Net.MooNet; + +namespace Mooege.Core.MooNet.Services +{ + [Service(serviceID: 0x6, serviceName: "bnet.protocol.friends.FriendsService")] + public class FriendsService : bnet.protocol.friends.FriendsService, IServerService + { + private static readonly Logger Logger = LogManager.CreateLogger(); + public MooNetClient Client { get; set; } + public bnet.protocol.Header LastCallHeader { get; set; } + public uint Status { get; set; } + + public override void SubscribeToFriends(IRpcController controller, bnet.protocol.friends.SubscribeToFriendsRequest request, Action done) + { + Logger.Trace("Subscribe() {0}", this.Client); + + //FIXME: This causes an exception with the retail client /raist. + + + FriendManager.Instance.AddSubscriber(this.Client, request.ObjectId); + + var builder = bnet.protocol.friends.SubscribeToFriendsResponse.CreateBuilder() + .SetMaxFriends(127) + .SetMaxReceivedInvitations(127) + .SetMaxSentInvitations(127) + .AddRole(bnet.protocol.Role.CreateBuilder().SetId(1).SetName("battle_tag_friend").Build()) + .AddRole(bnet.protocol.Role.CreateBuilder().SetId(2).SetName("real_id_friend").Build()); + + + foreach (var dbAccountFriend in this.Client.Account.DBAccount.Friends) // send friends list. + { + var friendAccount = AccountManager.GetAccountByDBAccount(dbAccountFriend); + var resp = bnet.protocol.friends.Friend.CreateBuilder().SetId(friendAccount.BnetEntityId).Build(); + builder.AddFriends(resp); + } + + var invitations = new List(); + + foreach (var invitation in FriendManager.OnGoingInvitations.Values) + { + if (invitation.InviteeIdentity.AccountId == this.Client.Account.BnetEntityId) + { + invitations.Add(invitation); + } + } + + if (invitations.Count > 0) + builder.AddRangeReceivedInvitations(invitations); + + done(builder.Build()); + } + + public override void SendInvitation(IRpcController controller, bnet.protocol.invitation.SendInvitationRequest request, Action done) + { + + /* + * Error List: + * The friends list is full. (Error 5000) + * Too many sent invitations have been sent. (Error 5001) + * Too many invitations have been received. (Error 5002) + * This player is already a friend. (Error 5003) + * This person was already invited to be a friend. (Error 5005) + * The friend invitation was removed. (Error 5006) + * Your friends list is full. (Error 5015) + * The inviter's friends list is full. (Error 5016) + * This account is already a friend. (Error 317201) + * That friend invitation already exists. (Error 317200) + * Unable to add self as a friend. (Error 317202) + * The BattleTag does not exist. (Error 317203) + */ + + // somehow protobuf lib doesnt handle this extension, so we're using a workaround to get that channelinfo. + var extensionBytes = request.Params.UnknownFields.FieldDictionary[103].LengthDelimitedList[0].ToByteArray(); + var friendRequest = bnet.protocol.friends.FriendInvitationParams.ParseFrom(extensionBytes); + + var response = bnet.protocol.NoData.CreateBuilder(); + + if (friendRequest.TargetEmail.ToLower() == this.Client.Account.Email.ToLower()) + { + this.Status = 317202; //Unable to add self as a friend. + done(response.Build()); + return; + } + + if (friendRequest.TargetBattleTag == this.Client.Account.BattleTag) + { + this.Status = 317202; //Unable to add self as a friend. + done(response.Build()); + return; + } + + Account invitee; + + if (friendRequest.HasTargetEmail) + invitee = AccountManager.GetAccountByEmail(friendRequest.TargetEmail); + else + invitee = AccountManager.GetAccountByBattletag(friendRequest.TargetBattleTag); + + if (invitee == null) + { + if (friendRequest.HasTargetEmail) + this.Status = 4; //There was an error. Please try again. + else + this.Status = 317203; //The BattleTag does not exist. + done(response.Build()); + return; + } + else if (FriendManager.AreFriends(this.Client.Account, invitee)) + { + if (friendRequest.HasTargetEmail) + this.Status = 317201; //This account is already a friend. email? + else + this.Status = 5003; //This player is already a friend. battletag? + done(response.Build()); + return; + } + else if (FriendManager.InvitationExists(this.Client.Account, invitee)) + { + if (friendRequest.HasTargetEmail) + this.Status = 317200; //That friend invitation already exists. email? + else + this.Status = 5005; //This person was already invited to be a friend. battletag? + done(response.Build()); + return; + } + + Logger.Trace("{0} sent {1} friend invitation.", this.Client.Account, invitee); + + var invitation = bnet.protocol.invitation.Invitation.CreateBuilder() + .SetId(FriendManager.InvitationIdCounter++) // we may actually need to store invitation ids in database with the actual invitation there. /raist. + .SetInviterIdentity(this.Client.GetIdentity(true, false, false)) + .SetInviterName(this.Client.Account.Email) // we shoulde be instead using account owner's name here. + .SetInviteeIdentity(bnet.protocol.Identity.CreateBuilder().SetAccountId(invitee.BnetEntityId)) + .SetInviteeName(invitee.Email) // again we should be instead using invitee's name. + .SetInvitationMessage(request.Params.InvitationMessage) + .SetCreationTime(DateTime.Now.ToUnixTime()) + .SetExpirationTime(86400); + + done(response.Build()); + + // notify the invitee on invitation. + FriendManager.HandleInvitation(this.Client, invitation.Build()); + } + + public override void AcceptInvitation(IRpcController controller, bnet.protocol.invitation.GenericRequest request, Action done) + { + Logger.Trace("{0} accepted friend invitation.", this.Client.Account); + + var response = bnet.protocol.NoData.CreateBuilder(); + done(response.Build()); + + FriendManager.HandleAccept(this.Client, request); + } + + public override void RevokeInvitation(IRpcController controller, bnet.protocol.invitation.GenericRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void DeclineInvitation(IRpcController controller, bnet.protocol.invitation.GenericRequest request, Action done) + { + Logger.Trace("{0} declined friend invitation.", this.Client.Account); + + var response = bnet.protocol.NoData.CreateBuilder(); + done(response.Build()); + + FriendManager.HandleDecline(this.Client, request); + } + + public override void IgnoreInvitation(IRpcController controller, bnet.protocol.invitation.GenericRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void AssignRole(IRpcController controller, bnet.protocol.friends.AssignRoleRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void RemoveFriend(IRpcController controller, bnet.protocol.friends.GenericFriendRequest request, Action done) + { + Logger.Trace("{0} removed friend with id {1}.", this.Client.Account, request.TargetId); + + var response = bnet.protocol.friends.GenericFriendResponse.CreateBuilder() + .SetTargetFriend(bnet.protocol.friends.Friend.CreateBuilder().SetId(request.TargetId).Build()); + + done(response.Build()); + + FriendManager.HandleRemove(this.Client, request); + } + + public override void ViewFriends(IRpcController controller, bnet.protocol.friends.ViewFriendsRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void UpdateFriendState(IRpcController controller, bnet.protocol.friends.UpdateFriendStateRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void UnsubscribeToFriends(IRpcController controller, bnet.protocol.friends.UnsubscribeToFriendsRequest request, Action done) + { + throw new NotImplementedException(); + } + } +} diff --git a/src/Mooege/Core/MooNet/Services/GameMasterService.cs b/src/Mooege/Core/MooNet/Services/GameMasterService.cs new file mode 100644 index 00000000..5b2d3b2e --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/GameMasterService.cs @@ -0,0 +1,256 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using Google.ProtocolBuffers; +using Mooege.Common.Logging; +using Mooege.Core.MooNet.Games; +using Mooege.Core.MooNet.Helpers; +using Mooege.Core.MooNet.Accounts; +using Mooege.Net.MooNet; + +namespace Mooege.Core.MooNet.Services +{ + [Service(serviceID: 0x7, serviceName: "bnet.protocol.game_master.GameMaster")] + public class GameMasterService : bnet.protocol.game_master.GameMaster, IServerService + { + private static readonly Logger Logger = LogManager.CreateLogger(); + public MooNetClient Client { get; set; } + public bnet.protocol.Header LastCallHeader { get; set; } + public uint Status { get; set; } + + public override void JoinGame(IRpcController controller, bnet.protocol.game_master.JoinGameRequest request, Action done) + { + Logger.Trace("Client {0} attempted to join game {1}.", this.Client, request.GameHandle.GameId.Low); + //var game = GameFactoryManager.FindGameByEntityId(request.GameHandle.GameId); + + var builder = bnet.protocol.game_master.JoinGameResponse.CreateBuilder(); + //.AddConnectInfo(game.GetConnectionInfoForClient(this.Client)); + + done(builder.Build()); + //throw new NotImplementedException(); + } + + public bnet.protocol.attribute.Attribute[] GetFactoryAttributes(int min_players, int max_players, int num_teams, string version, int playergroup, string currentquest, int difficultylevel) + { + var factoryAttributes = new bnet.protocol.attribute.Attribute[] + { + bnet.protocol.attribute.Attribute.CreateBuilder().SetName("min_players").SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetIntValue(min_players)).Build(), + bnet.protocol.attribute.Attribute.CreateBuilder().SetName("max_players").SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetIntValue(max_players)).Build(), + bnet.protocol.attribute.Attribute.CreateBuilder().SetName("num_teams").SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetIntValue(num_teams)).Build(), + bnet.protocol.attribute.Attribute.CreateBuilder().SetName("version").SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetStringValue(version)).Build(), + bnet.protocol.attribute.Attribute.CreateBuilder().SetName("PlayerGroup").SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetIntValue(playergroup)).Build(), + bnet.protocol.attribute.Attribute.CreateBuilder().SetName("Game.CurrentQuest").SetValue(bnet.protocol.attribute.Variant.CreateBuilder()).Build(), + bnet.protocol.attribute.Attribute.CreateBuilder().SetName("DifficultyLevel").SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetIntValue(difficultylevel)).Build(), + }; + return factoryAttributes; + } + + public override void ListFactories(IRpcController controller, bnet.protocol.game_master.ListFactoriesRequest request, Action done) + { + Logger.Trace("ListFactories() {0}", this.Client); + + var statsBucket = bnet.protocol.game_master.GameStatsBucket.CreateBuilder() + .SetBucketMin(0) + .SetBucketMax(4267296) + .SetWaitMilliseconds(1354) + .SetGamesPerHour(0) + .SetActiveGames(69) + .SetActivePlayers(75) + .SetFormingGames(5) + .SetWaitingPlayers(0).Build(); + + var factoryDescriptions = new bnet.protocol.game_master.GameFactoryDescription[9]; + for (var i = 0; i < 4; i++) + { + var factoryAttributes = GetFactoryAttributes( + min_players: 2, + max_players: 4, + num_teams: 1, + version: Mooege.Common.Versions.VersionInfo.Ingame.MajorVersion, + playergroup: 0, + currentquest: "", + difficultylevel: i + ); + factoryDescriptions[i] = bnet.protocol.game_master.GameFactoryDescription.CreateBuilder() + .AddRangeAttribute(factoryAttributes) + .SetId(14249086168335147635 + (ulong)i) + .AddStatsBucket(statsBucket) + .Build(); + } + for (var i = 4; i < 8; i++) + { + var factoryAttributes = GetFactoryAttributes( + min_players: 2, + max_players: 4, + num_teams: 1, + version: Mooege.Common.Versions.VersionInfo.Ingame.MajorVersion, + playergroup: 1, + currentquest: "", + difficultylevel: i - 4 + ); + factoryDescriptions[i] = bnet.protocol.game_master.GameFactoryDescription.CreateBuilder() + .AddRangeAttribute(factoryAttributes) + .SetId(14249086168335147635 + (ulong)i) + .AddStatsBucket(statsBucket) + .Build(); + } + for (int i = 8; i < 9; i++) + { + var factoryAttributes = GetFactoryAttributes( + min_players: 2, + max_players: 4, + num_teams: 1, + version: Mooege.Common.Versions.VersionInfo.Ingame.MajorVersion, + playergroup: 2, + currentquest: "", + difficultylevel: 0 + ); + factoryDescriptions[i] = bnet.protocol.game_master.GameFactoryDescription.CreateBuilder() + .AddRangeAttribute(factoryAttributes) + .SetId(14249086168335147635 + (ulong)i) + .AddStatsBucket(statsBucket) + .Build(); + } + + var builder = bnet.protocol.game_master.ListFactoriesResponse.CreateBuilder().AddRangeDescription(factoryDescriptions).SetTotalResults((uint)factoryDescriptions.Length); + done(builder.Build()); + } + + public override void FindGame(IRpcController controller, bnet.protocol.game_master.FindGameRequest request, Action done) + { + Logger.Trace("FindGame() {0}", this.Client); + + // find the game. + var gameFound = GameFactoryManager.FindGame(this.Client, request, ++GameFactoryManager.RequestIdCounter); + if (Client.CurrentChannel != null) + { + //TODO: All these ChannelState updates can be moved to functions someplace else after packet flow is discovered and working -Egris + //Send current JoinPermission to client before locking it + var channelStatePermission = bnet.protocol.channel.ChannelState.CreateBuilder() + .AddAttribute(bnet.protocol.attribute.Attribute.CreateBuilder() + .SetName("D3.Party.JoinPermissionPreviousToLock") + .SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetIntValue(1).Build()) + .Build()).Build(); + + var notificationPermission = bnet.protocol.channel.UpdateChannelStateNotification.CreateBuilder() + .SetAgentId(this.Client.Account.CurrentGameAccount.BnetEntityId) + .SetStateChange(channelStatePermission) + .Build(); + + this.Client.MakeTargetedRPC(Client.CurrentChannel, () => + bnet.protocol.channel.ChannelSubscriber.CreateStub(this.Client).NotifyUpdateChannelState(null, notificationPermission, callback => { })); + } + + var builder = bnet.protocol.game_master.FindGameResponse.CreateBuilder().SetRequestId(gameFound.RequestId); + done(builder.Build()); + + var clients = (from player in request.PlayerList select GameAccountManager.FindLoadedGameAccountByBnetId(player.Identity.GameAccountId.Low) into gameAccount where gameFound != null select gameAccount.LoggedInClient).ToList(); + + // send game found notification. + var notification = bnet.protocol.notification.Notification.CreateBuilder() + .SetSenderId(bnet.protocol.EntityId.CreateBuilder().SetHigh((ulong)EntityIdHelper.HighIdType.GameAccountId).SetLow(0).Build()) + .SetTargetId(this.Client.Account.CurrentGameAccount.BnetEntityId) + .SetType("MM_START"); + var attr = bnet.protocol.attribute.Attribute.CreateBuilder() + .SetName("game_request_id") + .SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetUintValue(gameFound.RequestId).Build()); + notification.AddAttribute(attr); + + this.Client.MakeRPC(() => + bnet.protocol.notification.NotificationListener.CreateStub(this.Client).OnNotificationReceived(null, notification.Build(), callback => { })); + + if (gameFound.Started) + { + Logger.Info("Client {0} joining game with FactoryID:{1}", this.Client.Account.CurrentGameAccount.CurrentToon.Name, gameFound.FactoryID); + gameFound.JoinGame(clients, request.FactoryObjectId); + } + else + { + Logger.Info("Client {0} creating new game", this.Client.Account.CurrentGameAccount.CurrentToon.Name); + gameFound.StartGame(clients, request.FactoryObjectId); + } + } + + public override void CancelGameEntry(IRpcController controller, bnet.protocol.game_master.CancelGameEntryRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void GameEnded(IRpcController controller, bnet.protocol.game_master.GameEndedNotification request, Action done) + { + throw new NotImplementedException(); + } + + public override void PlayerLeft(IRpcController controller, bnet.protocol.game_master.PlayerLeftNotification request, Action done) + { + throw new NotImplementedException(); + } + + public override void RegisterServer(IRpcController controller, bnet.protocol.game_master.RegisterServerRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void UnregisterServer(IRpcController controller, bnet.protocol.game_master.UnregisterServerRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void RegisterUtilities(IRpcController controller, bnet.protocol.game_master.RegisterUtilitiesRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void UnregisterUtilities(IRpcController controller, bnet.protocol.game_master.UnregisterUtilitiesRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void Subscribe(IRpcController controller, bnet.protocol.game_master.SubscribeRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void Unsubscribe(IRpcController controller, bnet.protocol.game_master.UnsubscribeRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void ChangeGame(IRpcController controller, bnet.protocol.game_master.ChangeGameRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void GetFactoryInfo(IRpcController controller, bnet.protocol.game_master.GetFactoryInfoRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void GetGameStats(IRpcController controller, bnet.protocol.game_master.GetGameStatsRequest request, Action done) + { + var response = bnet.protocol.game_master.GetGameStatsResponse.CreateBuilder() + .AddStatsBucket(GameFactoryManager.GetGameStats(request).Build()) + .Build(); + + done(response); + } + } +} diff --git a/src/Mooege/Core/MooNet/Services/GameUtilitiesService.cs b/src/Mooege/Core/MooNet/Services/GameUtilitiesService.cs new file mode 100644 index 00000000..a8f844c0 --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/GameUtilitiesService.cs @@ -0,0 +1,388 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using Google.ProtocolBuffers; +using Mooege.Common.Logging; +using Mooege.Net.MooNet; +using Mooege.Core.MooNet.Toons; +using Mooege.Core.MooNet.Helpers; +using Mooege.Core.MooNet.Accounts; +using System.Collections.Generic; + +namespace Mooege.Core.MooNet.Services +{ + [Service(serviceID: 0x8, serviceName: "bnet.protocol.game_utilities.GameUtilities")] + public class GameUtilitiesService : bnet.protocol.game_utilities.GameUtilities, IServerService + { + private static readonly Logger Logger = LogManager.CreateLogger(); + public MooNetClient Client { get; set; } + public bnet.protocol.Header LastCallHeader { get; set; } + public uint Status { get; set; } + + public override void ProcessClientRequest(IRpcController controller, bnet.protocol.game_utilities.ClientRequest request, Action done) + { + var MessageId = request.GetAttribute(1).Value.IntValue; + Logger.Trace("ProcessClientRequest() ID: {0}", MessageId); + + var builder = bnet.protocol.game_utilities.ClientResponse.CreateBuilder(); + + //var version = request.GetAttribute(0).Value.StringValue; //0.5.1 + var attr = bnet.protocol.attribute.Attribute.CreateBuilder(); + switch (MessageId) + { + case 0: //D3.GameMessage.HeroDigestListRequest -> D3.GameMessage.HeroDigestListResponse + var digestList = GetHeroDigestList(D3.GameMessage.HeroDigestListRequest.ParseFrom(request.GetAttribute(2).Value.MessageValue)); + attr.SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(digestList).Build()); + break; + case 1: //D3.GameMessage.GetAccountDigest -> D3.Account.Digest + var accountDigest = GetAccountDigest(); + attr.SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(accountDigest).Build()); + break; + case 2: //CreateHero() -> D3.OnlineService.EntityId + var newToon = CreateHero(D3.OnlineService.HeroCreateParams.ParseFrom(request.GetAttribute(2).Value.MessageValue)); + attr.SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(newToon).Build()); + break; + case 3: //D3.OnlineService.EntityId -> No return Why have D3.GameMessage.DeleteHero and not use it? + DeleteHero(D3.OnlineService.EntityId.ParseFrom(request.GetAttribute(2).Value.MessageValue)); + break; + case 4: //SelectToon() -> D3.OnlineService.EntityId + var selectToon = SelectHero(D3.OnlineService.EntityId.ParseFrom(request.GetAttribute(2).Value.MessageValue)); + //attr.SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(selectToon).Build()); + break; + case 5: //D3.GameMessages.SaveBannerConfiguration -> return MessageId with no Message + SaveBanner(D3.GameMessage.SaveBannerConfiguration.ParseFrom(request.GetAttribute(2).Value.MessageValue)); + var attrId = bnet.protocol.attribute.Attribute.CreateBuilder() + .SetName("CustomMessageId") + .SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetIntValue(5).Build()) + .Build(); + builder.AddAttribute(attrId); + break; + case 7: // Client doesn't care what you send here + attr.SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(ByteString.Empty).Build()); + break; + case 8: //D3.GameMessage.SetGameAccountSettings -> + var setAccountSettings = SetGameAccountSettings(D3.GameMessage.SetGameAccountSettings.ParseFrom(request.GetAttribute(2).Value.MessageValue)); + attr.SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(setAccountSettings).Build()); + break; + case 9: //D3.GameMessage.GetToonSettings? -> D3.Client.ToonSettings + var getToonSettings = GetToonSettings(D3.GameMessage.GetToonSettings.ParseFrom(request.GetAttribute(2).Value.MessageValue)); + attr.SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(getToonSettings).Build()); + break; + case 10: //D3.GameMessage.SetToonSettings? + var setToonSettings = SetToonSettings(D3.GameMessage.SetToonSettings.ParseFrom(request.GetAttribute(2).Value.MessageValue)); + attr.SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(setToonSettings).Build()); + break; + case 12: //D3.GameMessage.GetHeroItems + var heroItems = GetHeroItems(D3.GameMessage.GetHeroItems.ParseFrom(request.GetAttribute(2).Value.MessageValue)); + attr.SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(heroItems).Build()); + break; + case 13: //D3.GameMessage.GetAccountItems + var accountItems = GetAccountItems(D3.GameMessage.GetAccountItems.ParseFrom(request.GetAttribute(2).Value.MessageValue)); + attr.SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(accountItems).Build()); + var attr2 = bnet.protocol.attribute.Attribute.CreateBuilder().SetName("stashSlots"); + attr2.SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetUintValue(14).Build()); + builder.AddAttribute(attr2); + break; + case 14: //D3.GameMessage.GetAccountProfile -> D3.Profile.AccountProfile + var getAccountProfile = GetAccountProfile(D3.GameMessage.GetAccountProfile.ParseFrom(request.GetAttribute(2).Value.MessageValue)); + attr.SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(getAccountProfile).Build()); + break; + case 15: //D3.GameMessage.GetHeroProfiles -> D3.Profile.HeroProfileList + var getHeroProfiles = GetHeroProfiles(D3.GameMessage.GetHeroProfiles.ParseFrom(request.GetAttribute(2).Value.MessageValue)); + attr.SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(getHeroProfiles).Build()); + break; + case 16: //? - Client expecting D3.Client.Preferences + attr.SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(D3.Client.Preferences.CreateBuilder().SetVersion(106).Build().ToByteString()).Build()); + break; + case 19: //D3.GameMessage.GetHeroIds -> D3.Hero.HeroList + var HeroList = GetHeroList(D3.GameMessage.GetHeroIds.ParseFrom(request.GetAttribute(2).Value.MessageValue)); + attr.SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(HeroList).Build()); + break; + case 20: //D3.GameMessage.UndeleteHero -> D3.Hero.Digest + var UndeletedHero = UndeleteHero(D3.GameMessage.UndeleteHero.ParseFrom(request.GetAttribute(2).Value.MessageValue)); + attr.SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(UndeletedHero).Build()); + break; + case 21: //D3.GameMessage.? (contains GameAccount EntityId) -> empty CustomMessage ByteString and CustomMessage2 ByteString + attr.SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(ByteString.Empty).Build()); + var CustomMessage2 = bnet.protocol.attribute.Attribute.CreateBuilder().SetName("CustomMessage2"); + CustomMessage2.SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(ByteString.Empty).Build()); + break; + case 23: //D3.GameMessage.GetDeletedHero -> D3.Hero.Digest or header status: 395003 + var DeletedHero = GetDeletedHero(); + if (DeletedHero != ByteString.Empty) + attr.SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(DeletedHero).Build()); + else + this.Status = 395003; + break; + default: + Logger.Warn("Unknown CustomMessageId {0}: {1}", MessageId, request.AttributeCount > 2 ? request.GetAttribute(2).Value.ToString() : "No CustomMessage?"); + break; + } + if (attr.HasValue) + { + attr.SetName("CustomMessage"); + builder.AddAttribute(attr.Build()); + } + + done(builder.Build()); + } + + public override void PresenceChannelCreated(IRpcController controller, bnet.protocol.game_utilities.PresenceChannelCreatedRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void GetPlayerVariables(IRpcController controller, bnet.protocol.game_utilities.PlayerVariablesRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void GetGameVariables(IRpcController controller, bnet.protocol.game_utilities.GameVariablesRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void GetLoad(IRpcController controller, bnet.protocol.server_pool.GetLoadRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void ProcessServerRequest(IRpcController controller, bnet.protocol.game_utilities.ServerRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void NotifyGameAccountOffline(IRpcController controller, bnet.protocol.game_utilities.GameAccountOfflineNotification request, Action done) + { + throw new NotImplementedException(); + } + + public override void NotifyGameAccountOnline(IRpcController controller, bnet.protocol.game_utilities.GameAccountOnlineNotification request, Action done) + { + throw new NotImplementedException(); + } + + private ByteString GetHeroDigestList(D3.GameMessage.HeroDigestListRequest request) + { + Logger.Trace("GetHeroDigestList()"); + + var ListResponse = D3.GameMessage.HeroDigestListResponse.CreateBuilder(); + foreach (var toon in request.ToonIdList) + { + var digest = ToonManager.GetToonByLowID(toon.IdLow).Digest; + ListResponse.AddDigestList( + D3.GameMessage.HeroDigestResponse.CreateBuilder() + .SetToonId(toon) + .SetSuccess(true) + .SetHeroDigest(digest) + .Build() + ); + } + return ListResponse.Build().ToByteString(); + } + + private ByteString GetAccountDigest() + { + Logger.Trace("GetAccountDigest()"); + + return this.Client.Account.CurrentGameAccount.Digest.ToByteString(); + } + + private ByteString CreateHero(D3.OnlineService.HeroCreateParams createPrams) + { + + var newToon = ToonManager.CreateNewToon(createPrams.Name, createPrams.GbidClass, createPrams.IsFemale ? ToonFlags.Female : ToonFlags.Male, 1, Client.Account.CurrentGameAccount); + return newToon.D3EntityID.ToByteString(); + } + + private void DeleteHero(D3.OnlineService.EntityId hero) + { + //Permanantly delete previously deleted hero + var deleteHero = ToonManager.GetDeletedToon(this.Client.Account.CurrentGameAccount); + if (deleteHero != null) + { + Logger.Trace("Permanantly deleting hero: {0}", deleteHero); + ToonManager.DeleteToon(deleteHero); + } + //Mark hero as deleted + var markHero = ToonManager.GetToonByLowID(hero.IdLow); + markHero.Deleted = true; + ToonManager.SaveToDB(markHero); + + Logger.Trace("DeleteHero(): Marked {0} as deleted.", markHero); + } + + private ByteString SelectHero(D3.OnlineService.EntityId hero) + { + var oldToon = this.Client.Account.CurrentGameAccount.CurrentToon; + var newtoon = ToonManager.GetToonByLowID(hero.IdLow); + + + Logger.Trace("SelectToon() {0}", this.Client.Account.CurrentGameAccount.CurrentToon); + + if (oldToon != newtoon) + { + this.Client.Account.CurrentGameAccount.CurrentToon = newtoon; + this.Client.Account.CurrentGameAccount.NotifyUpdate(); + AccountManager.SaveToDB(this.Client.Account); + } + return this.Client.Account.CurrentGameAccount.CurrentToon.D3EntityID.ToByteString(); + } + + private bool SaveBanner(D3.GameMessage.SaveBannerConfiguration bannerConfig) + { + Logger.Trace("SaveBannerConfiguration()"); + + if (this.Client.Account.CurrentGameAccount.BannerConfigurationField.Value == bannerConfig.Banner) + return false; + else + { + this.Client.Account.CurrentGameAccount.BannerConfiguration = bannerConfig.Banner; + this.Client.Account.CurrentGameAccount.NotifyUpdate(); + } + return true; + } + + private ByteString GetGameAccountSettings(D3.GameMessage.GetGameAccountSettings settings) + { + Logger.Trace("GetGameAccountSettings()"); + + var gameAccount = this.Client.Account.CurrentGameAccount; + return gameAccount.Settings.ToByteString(); + //var pref = D3.Client.Preferences.CreateBuilder().SetVersion(105).Build(); //hack since client is expecting this atm -Egris + //return pref.ToByteString(); + } + + private ByteString SetGameAccountSettings(D3.GameMessage.SetGameAccountSettings settings) + { + Logger.Trace("SetGameAccountSettings()"); + + this.Client.Account.CurrentGameAccount.Settings = settings.Settings; + return ByteString.Empty; + } + + private ByteString GetToonSettings(D3.GameMessage.GetToonSettings settings) + { + Logger.Trace("GetToonSettings"); + + if (settings.HasHeroId) + { + var toon = ToonManager.GetToonByLowID(settings.HeroId.IdLow); + return toon.Settings.ToByteString(); + } + else + return this.Client.Account.CurrentGameAccount.CurrentToon.Settings.ToByteString(); + } + + private ByteString SetToonSettings(D3.GameMessage.SetToonSettings settings) + { + Logger.Trace("SetToonSettings()"); + + var toon = ToonManager.GetToonByLowID(settings.HeroId.IdLow); + toon.Settings = settings.Settings; + return ByteString.Empty; + } + + private ByteString GetHeroItems(D3.GameMessage.GetHeroItems request) + { + Logger.Trace("GetHeroItems()"); + + var itemList = D3.Items.ItemList.CreateBuilder(); + return itemList.Build().ToByteString(); + } + + private ByteString GetAccountItems(D3.GameMessage.GetAccountItems request) + { + Logger.Trace("GetAccountItems()"); + + var itemList = D3.Items.ItemList.CreateBuilder(); + return itemList.Build().ToByteString(); + } + + private ByteString GetAccountProfile(D3.GameMessage.GetAccountProfile profile) + { + Logger.Trace("GetAccountProfile()"); + + var account = GameAccountManager.GetAccountByPersistentID(profile.AccountId.IdLow); + return account.Profile.ToByteString(); + } + + private ByteString GetHeroProfiles(D3.GameMessage.GetHeroProfiles profiles) + { + Logger.Trace("GetHeroProfiles()"); + + var profileList = D3.Profile.HeroProfileList.CreateBuilder(); + if (profiles.HeroIdsCount > 0) + { + foreach (var hero in profiles.HeroIdsList) + { + var toon = ToonManager.GetToonByLowID(hero.IdLow); + profileList.AddHeros(toon.Profile); + } + } + else + { + var heroList = GameAccountManager.GetAccountByPersistentID(profiles.AccountId.IdLow).Toons; + foreach (var hero in heroList) + { + profileList.AddHeros(hero.Profile); + } + } + + return profileList.Build().ToByteString(); + } + + private ByteString GetHeroList(D3.GameMessage.GetHeroIds heroIds) + { + Logger.Trace("GetHeroList()"); + + var HeroList = D3.Hero.HeroList.CreateBuilder(); + var gameAccount = GameAccountManager.GetAccountByPersistentID(heroIds.AccountId.IdLow); + foreach (var toon in gameAccount.Toons) + { + if (!toon.Deleted) + HeroList.AddHeroIds(toon.D3EntityID); + } + return HeroList.Build().ToByteString(); + } + + private ByteString UndeleteHero(D3.GameMessage.UndeleteHero heroId) + { + var toon = ToonManager.GetToonByLowID(heroId.UndeleteHeroId.IdLow); + if (toon != null && toon.Deleted) + { + toon.Deleted = false; + ToonManager.SaveToDB(toon); + return toon.Digest.ToByteString(); + } + else + return ByteString.Empty; + } + private ByteString GetDeletedHero() + { + Logger.Trace("GetDeletedHero()"); + foreach (var toon in this.Client.Account.CurrentGameAccount.Toons) + { + if (toon.Deleted) + return toon.Digest.ToByteString(); + } + return ByteString.Empty; + } + } +} diff --git a/src/Mooege/Core/MooNet/Services/IServerService.cs b/src/Mooege/Core/MooNet/Services/IServerService.cs new file mode 100644 index 00000000..d3248eb3 --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/IServerService.cs @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Net.MooNet; + +namespace Mooege.Core.MooNet.Services +{ + public interface IServerService + { + /// + /// Last client that made a RPC call for the service. + /// + MooNetClient Client { get; set; } + + /// + /// Last rpc call's header. + /// + bnet.protocol.Header LastCallHeader { get; set; } + + /// + /// Sets the outgoing header status if needed, default = 0 + /// + uint Status { get; set; } + } +} diff --git a/src/Mooege/Core/MooNet/Services/NotificationService.cs b/src/Mooege/Core/MooNet/Services/NotificationService.cs new file mode 100644 index 00000000..d76c048d --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/NotificationService.cs @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using Mooege.Common.Logging; +using Mooege.Core.MooNet.Commands; +using Mooege.Core.MooNet.Helpers; +using Mooege.Core.MooNet.Accounts; +using Mooege.Net.MooNet; + +namespace Mooege.Core.MooNet.Services +{ + [Service(serviceID: 0xc, serviceName: "bnet.protocol.notification.NotificationService")] + public class NotificationService : bnet.protocol.notification.NotificationService, IServerService + { + private static readonly Logger Logger = LogManager.CreateLogger(); + public MooNetClient Client { get; set; } + public bnet.protocol.Header LastCallHeader { get; set; } + public uint Status { get; set; } + + public override void SendNotification(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.notification.Notification request, Action done) + { + switch (request.GetNotificationType()) + { + case NotificationTypeHelper.NotificationType.Whisper: + + // NOTE: Real implementation doesn't even handle the situation where neither client knows about the other. + // Client requires prior knowledge of sender and target (and even then it cannot whisper by using the /whisper command). + + var targetAccount = GameAccountManager.GetAccountByPersistentID(request.TargetId.Low); + Logger.Trace(string.Format("NotificationRequest.Whisper by {0} to {1}", this.Client.Account.CurrentGameAccount, targetAccount)); + + if (targetAccount.LoggedInClient == null) return; + + if (targetAccount == this.Client.Account.CurrentGameAccount) // check if whisper targets the account itself. + CommandManager.TryParse(request.AttributeList[0].Value.StringValue, this.Client); // try parsing it as a command and respond it if so. + else + { + var notification = bnet.protocol.notification.Notification.CreateBuilder(request) + .SetSenderId(this.Client.Account.CurrentGameAccount.BnetEntityId) + .SetSenderAccountId(this.Client.Account.BnetEntityId) + .Build(); + + targetAccount.LoggedInClient.MakeRPC(() => + bnet.protocol.notification.NotificationListener.CreateStub(targetAccount.LoggedInClient).OnNotificationReceived(controller, notification, callback => { })); + } + break; + default: + Logger.Warn("Unhandled notification type: {0}", request.Type); + break; + } + + var builder = bnet.protocol.NoData.CreateBuilder(); + done(builder.Build()); + } + + public override void RegisterClient(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.notification.RegisterClientRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void UnregisterClient(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.notification.UnregisterClientRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void FindClient(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.notification.FindClientRequest request, Action done) + { + throw new NotImplementedException(); + } + } +} diff --git a/src/Mooege/Core/MooNet/Services/PresenceService.cs b/src/Mooege/Core/MooNet/Services/PresenceService.cs new file mode 100644 index 00000000..f03ddd22 --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/PresenceService.cs @@ -0,0 +1,180 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using Mooege.Common.Logging; +using Mooege.Core.MooNet.Accounts; +using Mooege.Core.MooNet.Helpers; +using Mooege.Net.MooNet; + +// TODO: Need to do some more testing and inspection to make sure that +// responding before performing the action requested is proper + +namespace Mooege.Core.MooNet.Services +{ + [Service(serviceID: 0xb, serviceName: "bnet.protocol.presence.PresenceService")] + public class PresenceService : bnet.protocol.presence.PresenceService, IServerService + { + private static readonly Logger Logger = LogManager.CreateLogger(); + public MooNetClient Client { get; set; } + public bnet.protocol.Header LastCallHeader { get; set; } + public uint Status { get; set; } + + public override void Subscribe(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.presence.SubscribeRequest request, System.Action done) + { + switch (request.EntityId.GetHighIdType()) + { + case EntityIdHelper.HighIdType.AccountId: + var account = AccountManager.GetAccountByPersistentID(request.EntityId.Low); + if (account != null) + { + Logger.Trace("Subscribe() {0} {1}", this.Client, account); + account.AddSubscriber(this.Client, request.ObjectId); + } + break; + case EntityIdHelper.HighIdType.GameAccountId: + var gameaccount = GameAccountManager.GetAccountByPersistentID(request.EntityId.Low); + if (gameaccount != null) + { + Logger.Trace("Subscribe() {0} {1}", this.Client, gameaccount); + gameaccount.AddSubscriber(this.Client, request.ObjectId); + } + break; + default: + Logger.Warn("Recieved an unhandled Presence.Subscribe request with type {0} (0x{1})", request.EntityId.GetHighIdType(), request.EntityId.High.ToString("X16")); + break; + } + + var builder = bnet.protocol.NoData.CreateBuilder(); + done(builder.Build()); + } + + public override void Unsubscribe(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.presence.UnsubscribeRequest request, System.Action done) + { + + switch (request.EntityId.GetHighIdType()) + { + case EntityIdHelper.HighIdType.AccountId: + var account = AccountManager.GetAccountByPersistentID(request.EntityId.Low); + // The client will probably make sure it doesn't unsubscribe to a null ID, but just to make sure.. + if (account != null) + { + account.RemoveSubscriber(this.Client); + Logger.Trace("Unsubscribe() {0} {1}", this.Client, account); + } + break; + case EntityIdHelper.HighIdType.GameAccountId: + var gameaccount = GameAccountManager.GetAccountByPersistentID(request.EntityId.Low); + if (gameaccount != null) + { + gameaccount.RemoveSubscriber(this.Client); + Logger.Trace("Unsubscribe() {0} {1}", this.Client, gameaccount); + } + break; + default: + Logger.Warn("Recieved an unhandled Presence.Unsubscribe request with type {0} (0x{1})", request.EntityId.GetHighIdType(), request.EntityId.High.ToString("X16")); + break; + } + + var builder = bnet.protocol.NoData.CreateBuilder(); + done(builder.Build()); + } + + public override void Update(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.presence.UpdateRequest request, System.Action done) + { + //Logger.Warn("request:\n{0}", request.ToString()); + // This "UpdateRequest" is not, as it may seem, a request to update the client on the state of an object, + // but instead the *client* requesting to change fields on an object that it has subscribed to. + // Check docs/rpc/presence.txt in branch wip-docs (or master) + + switch (request.EntityId.GetHighIdType()) + { + case EntityIdHelper.HighIdType.AccountId: + var account = AccountManager.GetAccountByPersistentID(request.EntityId.Low); + Logger.Trace("Update() {0} {1} - {2} Operations", this.Client, account, request.FieldOperationCount); + Logger.Warn("No AccountManager updater."); + break; + case EntityIdHelper.HighIdType.GameAccountId: + var gameaccount = GameAccountManager.GetAccountByPersistentID(request.EntityId.Low); + var trace = string.Format("Update() {0} {1} - {2} Operations", this.Client, gameaccount, request.FieldOperationCount); + foreach (var fieldOp in request.FieldOperationList) + { + trace += string.Format("\t{0}, {1}, {2}", (FieldKeyHelper.Program)fieldOp.Field.Key.Program, (FieldKeyHelper.OriginatingClass)fieldOp.Field.Key.Group, fieldOp.Field.Key.Field); + gameaccount.Update(fieldOp); + } + Logger.Trace(trace); + break; + default: + Logger.Warn("Recieved an unhandled Presence.Update request with type {0} (0x{1})", request.EntityId.GetHighIdType(), request.EntityId.High.ToString("X16")); + break; + } + + var builder = bnet.protocol.NoData.CreateBuilder(); + done(builder.Build()); + } + + public override void Query(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.presence.QueryRequest request, Action done) + { + var builder = bnet.protocol.presence.QueryResponse.CreateBuilder(); + + switch (request.EntityId.GetHighIdType()) + { + case EntityIdHelper.HighIdType.AccountId: + var account = AccountManager.GetAccountByPersistentID(request.EntityId.Low); + foreach (var key in request.KeyList) + { + Logger.Trace("Query() {0} {1} - {2}, {3}, {4}", this.Client, account, (FieldKeyHelper.Program)key.Program, (FieldKeyHelper.OriginatingClass)key.Group, key.Field); + var field = account.QueryField(key); + if (field != null) builder.AddField(field); + } + break; + + case EntityIdHelper.HighIdType.GameAccountId: + var gameaccount = GameAccountManager.GetAccountByPersistentID(request.EntityId.Low); + foreach (var key in request.KeyList) + { + Logger.Trace("Query() {0} {1} - {2}, {3}, {4}", this.Client, gameaccount, (FieldKeyHelper.Program)key.Program, (FieldKeyHelper.OriginatingClass)key.Group, key.Field); + var field = gameaccount.QueryField(key); + if (field != null) builder.AddField(field); + } + break; + default: + Logger.Warn("Recieved an unhandled Presence.Query request with type {0} (0x{1})", request.EntityId.GetHighIdType(), request.EntityId.High.ToString("X16")); + break; + } + + done(builder.Build()); + } + + public override void Ownership(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.presence.OwnershipRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void Heal(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.presence.UpdateRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void SubscribeNotification(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.presence.SubscribeNotificationRequest request, Action done) + { + throw new NotImplementedException(); + } + + } +} diff --git a/src/Mooege/Core/MooNet/Services/ReportService.cs b/src/Mooege/Core/MooNet/Services/ReportService.cs new file mode 100644 index 00000000..413f0f45 --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/ReportService.cs @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using Google.ProtocolBuffers; +using Mooege.Common.Logging; +using Mooege.Net.MooNet; +using Mooege.Core.MooNet.Accounts; + +namespace Mooege.Core.MooNet.Services +{ + [Service(serviceID: 0x63, serviceName: "bnet.protocol.report.Report")] + public class ReportService : bnet.protocol.report.ReportService, IServerService + { + private static readonly Logger Logger = LogManager.CreateLogger(); + public MooNetClient Client { get; set; } + public bnet.protocol.Header LastCallHeader { get; set; } + public uint Status { get; set; } + + public override void SendReport(IRpcController controller, bnet.protocol.report.SendReportRequest request, Action done) + { + Logger.Trace("SendReport()"); + + var report = request.Report; + //TODO: Store reports against accounts + foreach (var attribute in report.AttributeList) + { + switch (attribute.Name) + { + case "target_toon_id": //uint GameAccount.Low + var reportee = GameAccountManager.GetAccountByPersistentID(attribute.Value.UintValue); + Logger.Trace("{0} reported {1} for \"{2}\".", this.Client.Account.CurrentGameAccount.CurrentToon, reportee, report.ReportType); + break; + //case "target_account_id": //uint Account.Low + //case "target_toon_name": //string + //case "target_toon_program": //fourcc + //case "target_toon_region": //string + //case "note": //string - not currently used in client + } + } + + var builder = bnet.protocol.NoData.CreateBuilder(); + + done(builder.Build()); + } + } +} diff --git a/src/Mooege/Core/MooNet/Services/ResourceService.cs b/src/Mooege/Core/MooNet/Services/ResourceService.cs new file mode 100644 index 00000000..569050a6 --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/ResourceService.cs @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using Google.ProtocolBuffers; +using Mooege.Common.Logging; +using Mooege.Net.MooNet; +using Mooege.Common.Extensions; +using Mooege.Common.Versions; +using Mooege.Core.MooNet.Helpers; + +namespace Mooege.Core.MooNet.Services +{ + [Service(serviceID: 0xd, serviceName: "bnet.protocol.resources.Resources")] + public class ResourceService : bnet.protocol.resources.Resources, IServerService + { + private static readonly Logger Logger = LogManager.CreateLogger(); + public MooNetClient Client { get; set; } + public bnet.protocol.Header LastCallHeader { get; set; } + public uint Status { get; set; } + + public override void GetContentHandle(IRpcController controller, bnet.protocol.resources.ContentHandleRequest request, Action done) + { + Logger.Trace("GetContentHandle(): ProgramId: 0x{0:X8} StreamId: 0x{1:X8} Locale: 0x{2:X8}", request.ProgramId, request.StreamId, request.Locale); + if (request.ProgramId == (uint)FieldKeyHelper.Program.BNet) + { + var builder = bnet.protocol.ContentHandle.CreateBuilder() + .SetRegion(VersionInfo.MooNet.Regions[VersionInfo.MooNet.Region]) + .SetUsage(0x70667479) //pfty - ProfanityFilter + .SetHash(ByteString.CopyFrom(VersionInfo.MooNet.Resources.ProfanityFilterHash.ToByteArray())); + + done(builder.Build()); + } + else if (request.ProgramId == (uint)FieldKeyHelper.Program.D3) + { + var builder = bnet.protocol.ContentHandle.CreateBuilder() + .SetRegion(VersionInfo.MooNet.Regions[VersionInfo.MooNet.Region]) + .SetUsage(0x643373); //d3s - d3 Schema + switch (request.StreamId) + { + case 0x61637473: //acts - Available Acts + builder.SetHash(ByteString.CopyFrom(VersionInfo.MooNet.Resources.AvailableActs.ToByteArray())); + break; + case 0x71756573: //ques - Available Quests + builder.SetHash(ByteString.CopyFrom(VersionInfo.MooNet.Resources.AvailableQuests.ToByteArray())); + break; + case 0x72707273: //rprs - RichPresence + builder.SetHash(ByteString.CopyFrom("bb41b5176f172cd217a137e7c19d19a4827c48877fe5a2ec94e2d3658612afdf".ToByteArray())); + break; + default: + Logger.Warn("Unknown StreamId: 0x{0:X8}", request.StreamId); + builder.SetHash(ByteString.Empty); + Status = 4; + break; + } + done(builder.Build()); + } + } + } +} diff --git a/src/Mooege/Core/MooNet/Services/SearchService.cs b/src/Mooege/Core/MooNet/Services/SearchService.cs new file mode 100644 index 00000000..ce258e09 --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/SearchService.cs @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using Google.ProtocolBuffers; +using Mooege.Common.Logging; +using Mooege.Net.MooNet; +namespace Mooege.Core.MooNet.Services +{ + [Service(serviceID: 0xe, serviceName: "bnet.protocol.search.SearchService")] + public class SearchService : bnet.protocol.search.SearchService, IServerService + { + private static readonly Logger Logger = LogManager.CreateLogger(); + public MooNetClient Client { get; set; } + public bnet.protocol.Header LastCallHeader { get; set; } + public uint Status { get; set; } + + public override void FindMatches(IRpcController controller, bnet.protocol.search.FindMatchesRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void SetObject(IRpcController controller, bnet.protocol.search.SetObjectRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void RemoveObjects(IRpcController controller, bnet.protocol.search.RemoveObjectsRequest request, Action done) + { + throw new NotImplementedException(); + } + } +} diff --git a/src/Mooege/Core/MooNet/Services/ServerPoolService.cs b/src/Mooege/Core/MooNet/Services/ServerPoolService.cs new file mode 100644 index 00000000..42223cf5 --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/ServerPoolService.cs @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using Google.ProtocolBuffers; +using Mooege.Common.Logging; +using Mooege.Net.MooNet; + +namespace Mooege.Core.MooNet.Services +{ + [Service(serviceID: 0xf, serviceName: "bnet.protocol.server_pool.ServerPoolService")] + class ServerPoolService : bnet.protocol.server_pool.ServerPoolService, IServerService + { + private static readonly Logger Logger = LogManager.CreateLogger(); + public MooNetClient Client { get; set; } + public bnet.protocol.Header LastCallHeader { get; set; } + public uint Status { get; set; } + + public override void GetPoolState(IRpcController controller, bnet.protocol.server_pool.PoolStateRequest request, Action done) + { + Logger.Trace("GetPoolState()"); + var pid = bnet.protocol.ProcessId.CreateBuilder().SetEpoch(26990464).SetLabel(17459).Build(); + var si = bnet.protocol.server_pool.ServerInfo.CreateBuilder().SetProgramId(17459).SetHost(pid).Build(); + var builder = bnet.protocol.server_pool.PoolStateResponse.CreateBuilder().AddInfo(si); + + throw new NotImplementedException(); + + //done(builder.Build()); + } + } +} diff --git a/src/Mooege/Core/MooNet/Services/Service.cs b/src/Mooege/Core/MooNet/Services/Service.cs new file mode 100644 index 00000000..ea7a0c13 --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/Service.cs @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using Google.ProtocolBuffers; +using Mooege.Common.Helpers.Hash; + +namespace Mooege.Core.MooNet.Services +{ + [AttributeUsage(AttributeTargets.Class)] + public class ServiceAttribute : Attribute + { + public uint ServiceID { get; private set; } + public uint Hash { get; private set; } + + public ServiceAttribute(uint serviceID, uint serviceHash) + { + this.ServiceID = serviceID; + this.Hash = serviceHash; + } + + public ServiceAttribute(uint serviceID, string serviceName) + : this(serviceID, (uint)StringHashHelper.HashIdentity(serviceName)) + { + } + } + + public static class Service + { + private static uint _notImplementedServiceCounter = 99; + public readonly static Dictionary ProvidedServices = new Dictionary(); + public readonly static Dictionary Services = new Dictionary(); + + static Service() + { + foreach (var type in Assembly.GetExecutingAssembly().GetTypes().Where(type => type.GetInterface("IServerService") != null)) + { + object[] attributes = type.GetCustomAttributes(typeof(ServiceAttribute), true); // get the attributes of the packet. + if (attributes.Length == 0) return; + + ProvidedServices.Add(type, (ServiceAttribute)attributes[0]); + Services.Add(type, (IService)Activator.CreateInstance(type)); + } + } + + public static IService GetByID(uint serviceID) + { + return (from pair in ProvidedServices let serviceInfo = pair.Value where serviceInfo.ServiceID == serviceID select Services[pair.Key]).FirstOrDefault(); + } + + public static uint GetByHash(uint serviceHash) + { + foreach (var serviceInfo in ProvidedServices.Select(pair => pair.Value).Where(serviceInfo => serviceInfo.Hash == serviceHash)) + { + return serviceInfo.ServiceID; + } + + return _notImplementedServiceCounter++; + } + } +} diff --git a/src/Mooege/Core/MooNet/Services/UserManagerService.cs b/src/Mooege/Core/MooNet/Services/UserManagerService.cs new file mode 100644 index 00000000..e45ad982 --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/UserManagerService.cs @@ -0,0 +1,96 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using Google.ProtocolBuffers; +using Mooege.Common.Logging; +using Mooege.Core.MooNet.Online; +using Mooege.Net.MooNet; + +namespace Mooege.Core.MooNet.Services +{ + [Service(serviceID: 0x5, serviceName: "bnet.protocol.user_manager.UserManagerService")] + public class UserManagerService : bnet.protocol.user_manager.UserManagerService, IServerService + { + private static readonly Logger Logger = LogManager.CreateLogger(); + public MooNetClient Client { get; set; } + public bnet.protocol.Header LastCallHeader { get; set; } + public uint Status { get; set; } + + public override void SubscribeToUserManager(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.user_manager.SubscribeToUserManagerRequest request, System.Action done) + { + Logger.Trace("Subscribe() {0}", this.Client); + + // temp hack: send him all online players on server where he should be normally get list of player he met in his last few games /raist. + + var builder = bnet.protocol.user_manager.SubscribeToUserManagerResponse.CreateBuilder(); + uint i = 0; + foreach (var client in PlayerManager.OnlinePlayers) + { + if (client == this.Client) continue; // Don't add the requester to the list + if (client.Account.CurrentGameAccount.CurrentToon == null) continue; + + Logger.Debug("RecentPlayer => " + client.Account.CurrentGameAccount.CurrentToon); + var recentPlayer = bnet.protocol.user_manager.RecentPlayer.CreateBuilder() + .SetEntity(client.Account.BnetEntityId) + .SetProgramId("D3") + .AddAttributes(bnet.protocol.attribute.Attribute.CreateBuilder() + .SetName("GameAccountEntityId") + .SetValue(bnet.protocol.attribute.Variant.CreateBuilder() + .SetMessageValue(client.Account.CurrentGameAccount.D3GameAccountId.ToByteString()) + .Build()) + .Build()) + .SetId(i++) + .Build(); + builder.AddRecentPlayers(recentPlayer); + } + + done(builder.Build()); + } + + public override void AddRecentPlayers(IRpcController controller, bnet.protocol.user_manager.AddRecentPlayersRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void ClearRecentPlayers(IRpcController controller, bnet.protocol.NoData request, Action done) + { + throw new NotImplementedException(); + } + + public override void BlockEntity(IRpcController controller, bnet.protocol.user_manager.BlockEntityRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void UnblockEntity(IRpcController controller, bnet.protocol.user_manager.UnblockEntityRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void BlockEntityForSession(IRpcController controller, bnet.protocol.user_manager.BlockEntityRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void LoadBlockList(IRpcController controller, bnet.protocol.EntityId request, Action done) + { + throw new NotImplementedException(); + } + } +} diff --git a/src/Mooege/Core/MooNet/Toons/Toon.cs b/src/Mooege/Core/MooNet/Toons/Toon.cs new file mode 100644 index 00000000..1b70e8ac --- /dev/null +++ b/src/Mooege/Core/MooNet/Toons/Toon.cs @@ -0,0 +1,575 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using Mooege.Common.MPQ; +using Mooege.Common.MPQ.FileFormats; +using Mooege.Common.Storage; +using Mooege.Common.Storage.AccountDataBase.Entities; +using Mooege.Core.MooNet.Accounts; +using Mooege.Core.MooNet.Helpers; +using Mooege.Core.MooNet.Objects; +using Mooege.Core.GS.Players; +using NHibernate.Linq; + +namespace Mooege.Core.MooNet.Toons +{ + public class Toon : PersistentRPCObject + { + public DBToon DBToon { get; private set; } + public IntPresenceField HeroClassField + { + get + { + var val = new IntPresenceField(FieldKeyHelper.Program.D3, FieldKeyHelper.OriginatingClass.Hero, 1, 0, this.ClassID); + return val; + } + } + public IntPresenceField HeroFlagsField + { + get + { + var val = new IntPresenceField(FieldKeyHelper.Program.D3, FieldKeyHelper.OriginatingClass.Hero, 4, 0, (int)this.DBToon.Flags); + return val; + } + } + public IntPresenceField HeroLevelField + { + get + { + var val = new IntPresenceField(FieldKeyHelper.Program.D3, FieldKeyHelper.OriginatingClass.Hero, 2, 0, this.DBToon.Level); + return val; + } + } + public StringPresenceField HeroNameField + { get { return new StringPresenceField(FieldKeyHelper.Program.D3, FieldKeyHelper.OriginatingClass.Hero, 5, 0, this.DBToon.Name); } } + + + + + public ByteStringPresenceField HeroVisualEquipmentField = new ByteStringPresenceField(FieldKeyHelper.Program.D3, FieldKeyHelper.OriginatingClass.Hero, 3, 0); + + + + + + + public IntPresenceField HighestUnlockedAct = new IntPresenceField(FieldKeyHelper.Program.D3, FieldKeyHelper.OriginatingClass.Hero, 6, 0, 0); + + public IntPresenceField HighestUnlockedDifficulty = new IntPresenceField(FieldKeyHelper.Program.D3, FieldKeyHelper.OriginatingClass.Hero, 7, 0, 0); + + /// + /// D3 EntityID encoded id. + /// + public D3.OnlineService.EntityId D3EntityID { get; private set; } + + /// + /// True if toon has been recently deleted; + /// + public bool Deleted + { + get { return this.DBToon.Deleted; } + set { this.DBToon.Deleted = value; } + } + + /// + /// Toon handle struct. + /// + public ToonHandleHelper ToonHandle { get; private set; } + + /// + /// Toon's name. + /// + public string Name + { + get + { + return this.DBToon.Name; + } + private set + { + this.DBToon.Name = value; + this.HeroNameField.Value = value; + } + } + + /* + /// + /// Toon's hash-code. + /// + public int HashCode { get; set; } + */ + /// + /// Toon's owner account. + /// + public GameAccount GameAccount { get { return GameAccountManager.GetGameAccountByDBGameAccount(this.DBToon.DBGameAccount); } set { this.DBToon.DBGameAccount = value.DBGameAccount; } } + + /// + /// Toon's class. + /// + public ToonClass Class + { + get + { + return DBToon.Class; + } + private set + { + DBToon.Class = value; + /* + switch (DBToon.Class) + { + case ToonClass.Barbarian: + this.HeroClassField.Value = 0x4FB91EE2; + break; + case ToonClass.DemonHunter: + this.HeroClassField.Value = unchecked((int)0xC88B9649); + break; + case ToonClass.Monk: + this.HeroClassField.Value = 0x3DAC15; + break; + case ToonClass.WitchDoctor: + this.HeroClassField.Value = 0x343C22A; + break; + case ToonClass.Wizard: + this.HeroClassField.Value = 0x1D4681B1; + break; + default: + this.HeroClassField.Value = 0x0; + break; + }*/ + } + } + + /// + /// Toon's flags. + /// + public ToonFlags Flags + { + get + { + return this.DBToon.Flags; + } + private set + { + this.DBToon.Flags = value | ToonFlags.AllUnknowns; + //this.HeroFlagsField.Value = (int)(value | ToonFlags.AllUnknowns); + } + } + + /// + /// Toon's level. + /// + public byte Level + { + get + { + return DBToon.Level; + } + private set + { + this.DBToon.Level = value; + } + } + + /// + /// Experience to next level + /// + public int ExperienceNext { get; set; } + + /// + /// Total time played for toon. + /// + public uint TimePlayed { get { return this.DBToon.TimePlayed; } set { this.DBToon.TimePlayed = value; } } + + /// + /// Last login time for toon. + /// + public uint LoginTime { get; set; } + + /// + /// Settings for toon. + /// + private D3.Client.ToonSettings _settings = D3.Client.ToonSettings.CreateBuilder().Build(); + public D3.Client.ToonSettings Settings + { + get + { + return this._settings; + } + set + { + this._settings = value; + } + } + + /// + /// Toon digest. + /// + public D3.Hero.Digest Digest + { + get + { + return D3.Hero.Digest.CreateBuilder().SetVersion(902) + .SetHeroId(this.D3EntityID) + .SetHeroName(this.Name) + .SetGbidClass((int)this.ClassID) + .SetPlayerFlags((uint)this.Flags) + .SetLevel(this.Level) + .SetVisualEquipment(this.HeroVisualEquipmentField.Value) + .SetLastPlayedAct(0) + .SetHighestUnlockedAct(0) + .SetLastPlayedDifficulty(0) + .SetHighestUnlockedDifficulty(0) + .SetLastPlayedQuest(-1) + .SetLastPlayedQuestStep(-1) + .SetTimePlayed(this.TimePlayed) + .Build(); + } + } + + /// + /// Hero Profile. + /// + public D3.Profile.HeroProfile Profile + { + get + { + return D3.Profile.HeroProfile.CreateBuilder() + .SetHardcore(false) + .SetHeroId(this.D3EntityID) + .SetHighestDifficulty(0) + .SetHighestLevel(this.Level) + .SetMonstersKilled(923) + .Build(); + } + } + + public bool IsSelected + { + get + { + if (!this.GameAccount.IsOnline) return false; + else + { + if (this.GameAccount.CurrentToon != null) + return this.GameAccount.CurrentToon == this; + else + return false; + } + } + } + + public int ClassID + { + get + { + switch (this.Class) + { + case ToonClass.Barbarian: + return 0x4FB91EE2; + case ToonClass.DemonHunter: + return unchecked((int)0xC88B9649); + case ToonClass.Monk: + return 0x3DAC15; + case ToonClass.WitchDoctor: + return 0x343C22A; + case ToonClass.Wizard: + return 0x1D4681B1; + } + return 0x0; + } + } + + public int VoiceClassID // Used for Conversations + { + get + { + switch (this.Class) + { + case ToonClass.DemonHunter: + return 0; + case ToonClass.Barbarian: + return 1; + case ToonClass.Wizard: + return 2; + case ToonClass.WitchDoctor: + return 3; + case ToonClass.Monk: + return 4; + } + return 0; + } + } + + public int Gender + { + get + { + return (int)(this.Flags & ToonFlags.Female); // 0x00 for male, so we can just return the AND operation + } + } + + #region c-tor and setfields + + public readonly HeroTable HeroTable; + private static readonly Mooege.Common.MPQ.FileFormats.GameBalance HeroData = (Mooege.Common.MPQ.FileFormats.GameBalance)MPQStorage.Data.Assets[Mooege.Core.GS.Common.Types.SNO.SNOGroup.GameBalance][19740].Data; + + public Toon(DBToon dbToon) + : base(dbToon.Id) + { + this.D3EntityID = D3.OnlineService.EntityId.CreateBuilder().SetIdHigh((ulong)EntityIdHelper.HighIdType.ToonId).SetIdLow(this.PersistentID).Build(); + + this.DBToon = dbToon; + this.HeroTable = HeroData.Heros.Find(item => item.Name == this.Class.ToString()); + this.ExperienceNext = Player.LevelBorders[this.Level]; + + var visualItems = new[] + { + D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Head + D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Chest + D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Feet + D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Hands + D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Weapon (1) + D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Weapon (2) + D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Shoulders + D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Legs + }; + + // Load Visual Equipment + var visualToSlotMapping = new Dictionary { { 1, 0 }, { 2, 1 }, { 7, 2 }, { 5, 3 }, { 4, 4 }, { 3, 5 }, { 8, 6 }, { 9, 7 } }; + + //add visual equipment from DB, only the visualizable equipment, not everything + var visibleEquipment = DBSessions.AccountSession.Query().Where(inv => inv.DBItemInstance != null && inv.DBToon.Id == dbToon.Id && inv.EquipmentSlot != -1).ToList(); + + foreach (var inv in visibleEquipment) + { + var slot = inv.EquipmentSlot; + if (!visualToSlotMapping.ContainsKey(slot)) + continue; + // decode vislual slot from equipment slot + slot = visualToSlotMapping[slot]; + var gbid = inv.DBItemInstance.GbId; + visualItems[slot] = D3.Hero.VisualItem.CreateBuilder() + .SetGbid(gbid) + .SetEffectLevel(0) + .Build(); + } + + this.HeroVisualEquipmentField.Value = D3.Hero.VisualEquipment.CreateBuilder().AddRangeVisualItem(visualItems).Build(); + } + + /* old non-db toon creation ctor. /raist. + public Toon(string name, int hashCode, int classId, ToonFlags flags, byte level, GameAccount account) // Toon with **newly generated** persistent ID + : base(StringHashHelper.HashIdentity(name + "#" + hashCode.ToString("D3"))) + { + this.D3EntityID = D3.OnlineService.EntityId.CreateBuilder().SetIdHigh((ulong)EntityIdHelper.HighIdType.ToonId).SetIdLow(this.PersistentID).Build(); + + this.Name = name; + this.HashCode = hashCode; + this.Class = @GetClassByID(classId); + this.Flags = flags; + this.Level = level; + this.ExperienceNext = Player.LevelBorders[level]; + this.GameAccount = account; + this.TimePlayed = 0; + + var visualItems = new[] + { + D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Head + D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Chest + D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Feet + D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Hands + D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Weapon (1) + D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Weapon (2) + D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Shoulders + D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Legs + }; + + this.HeroVisualEquipmentField.Value = D3.Hero.VisualEquipment.CreateBuilder().AddRangeVisualItem(visualItems).Build(); + } + + public Toon(ulong persistentId) // Load a toon from database with a given persistentId + : base(persistentId) + { + this.D3EntityID = D3.OnlineService.EntityId.CreateBuilder().SetIdHigh((ulong)EntityIdHelper.HighIdType.ToonId).SetIdLow(this.PersistentID).Build(); + + var sqlQuery = string.Format("SELECT * FROM toons WHERE id = {0}", persistentId); + var sqlCmd = new SQLiteCommand(sqlQuery, DBManager.Connection); + var sqlReader = sqlCmd.ExecuteReader(); + + // Use name of column to prevent errors if column moved + while (sqlReader.Read()) + { + this.Name = Convert.ToString(sqlReader["name"]); + this.HashCode = Convert.ToInt32(sqlReader["hashCode"]); + this.Class = (ToonClass)Convert.ToInt32(sqlReader["class"]); + this.Flags = (ToonFlags)Convert.ToInt32(sqlReader["gender"]); + this.Level = Convert.ToByte(sqlReader["level"]); + this.ExperienceNext = Convert.ToInt32(sqlReader["experience"]); + this.GameAccount = GameAccountManager.GetAccountByPersistentID(Convert.ToUInt64(sqlReader["accountId"])); + this.TimePlayed = Convert.ToUInt32(sqlReader["timePlayed"]); + this.Deleted = Convert.ToBoolean(sqlReader["deleted"]); + } + + var visualItems = new[] + { + D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Head + D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Chest + D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Feet + D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Hands + D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Weapon (1) + D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Weapon (2) + D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Shoulders + D3.Hero.VisualItem.CreateBuilder().SetEffectLevel(0).Build(), // Legs + }; + + // Load Visual Equipment + Dictionary visualToSlotMapping = new Dictionary(); + visualToSlotMapping.Add(1, 0); + visualToSlotMapping.Add(2, 1); + visualToSlotMapping.Add(7, 2); + visualToSlotMapping.Add(5, 3); + visualToSlotMapping.Add(4, 4); + visualToSlotMapping.Add(3, 5); + visualToSlotMapping.Add(8, 6); + visualToSlotMapping.Add(9, 7); + + //add visual equipment form DB, only the visualizable equipment, not everything + var itemQuery = string.Format("SELECT * FROM inventory WHERE toon_id = {0} AND equipment_slot <> -1 AND item_id <> -1", persistentId); + var itemCmd = new SQLiteCommand(itemQuery, DBManager.Connection); + var itemReader = itemCmd.ExecuteReader(); + if (itemReader.HasRows) + { + while (itemReader.Read()) + { + var slot = Convert.ToInt32(itemReader["equipment_slot"]); + if (!visualToSlotMapping.ContainsKey(slot)) + continue; + // decode vislual slot from equipment slot + slot = visualToSlotMapping[slot]; + var gbid = Convert.ToInt32(itemReader["item_id"]); + visualItems[slot] = D3.Hero.VisualItem.CreateBuilder() + .SetGbid(gbid) + .SetEffectLevel(0) + .Build(); + } + } + this.HeroVisualEquipmentField.Value = D3.Hero.VisualEquipment.CreateBuilder().AddRangeVisualItem(visualItems).Build(); + } + */ + #endregion + + public void LevelUp() + { + this.Level++; + this.GameAccount.ChangedFields.SetIntPresenceFieldValue(this.HeroLevelField); + } + + #region Notifications + + //hero class generated + //D3,Hero,1,0 -> D3.Hero.GbidClass: Hero Class + //D3,Hero,2,0 -> D3.Hero.Level: Hero's current level + //D3,Hero,3,0 -> D3.Hero.VisualEquipment: VisualEquipment + //D3,Hero,4,0 -> D3.Hero.PlayerFlags: Hero's flags + //D3,Hero,5,0 -> ?D3.Hero.NameText: Hero's Name + //D3,Hero,6,0 -> Unk Int64 (0) + //D3,Hero,7,0 -> Unk Int64 (0) + + public override List GetSubscriptionNotifications() + { + var operationList = new List(); + operationList.Add(this.HeroClassField.GetFieldOperation()); + operationList.Add(this.HeroLevelField.GetFieldOperation()); + operationList.Add(this.HeroVisualEquipmentField.GetFieldOperation()); + operationList.Add(this.HeroFlagsField.GetFieldOperation()); + operationList.Add(this.HeroNameField.GetFieldOperation()); + operationList.Add(this.HighestUnlockedAct.GetFieldOperation()); + operationList.Add(this.HighestUnlockedDifficulty.GetFieldOperation()); + + return operationList; + } + + #endregion + + public static ToonClass GetClassByID(int classId) + { + switch (classId) + { + case 0x4FB91EE2: + return ToonClass.Barbarian; + case unchecked((int)0xC88B9649): + return ToonClass.DemonHunter; + case 0x003DAC15: + return ToonClass.Monk; + case 0x0343C22A: + return ToonClass.WitchDoctor; + case 0x1D4681B1: + return ToonClass.Wizard; + } + + return ToonClass.Barbarian; + } + + public override string ToString() + { + return String.Format("{{ Toon: {0} [lowId: {1}] }}", this.Name, this.D3EntityID.IdLow); + } + + #region DB + + + /* + private bool VisualItemExistsInDb(int slot) + { + var query = string.Format("SELECT toon_id FROM inventory WHERE toon_id = {0} AND equipment_slot = {1}", this.PersistentID, slot); + var cmd = new SQLiteCommand(query, DBManager.Connection); + var reader = cmd.ExecuteReader(); + return reader.HasRows; + }*/ + } + #endregion + + #region Definitions and Enums + //Order is important as actor voices and saved data is based on enum index + public enum ToonClass// : uint + { + Barbarian,// = 0x4FB91EE2, + Monk,//= 0x3DAC15, + DemonHunter,// = 0xC88B9649, + WitchDoctor,// = 0x343C22A, + Wizard,// = 0x1D4681B1 + } + + [Flags] + public enum ToonFlags : uint + { + Male = 0x00, + Female = 0x02, + // TODO: These two need to be figured out still.. /plash + //Unknown1 = 0x20, + Unknown2 = 0x40, + Unknown3 = 0x80000, + Unknown4 = 0x2000000, + AllUnknowns = Unknown2 | Unknown3 | Unknown4 + } + #endregion +} diff --git a/src/Mooege/Core/MooNet/Toons/ToonHandleHelper.cs b/src/Mooege/Core/MooNet/Toons/ToonHandleHelper.cs new file mode 100644 index 00000000..2858facc --- /dev/null +++ b/src/Mooege/Core/MooNet/Toons/ToonHandleHelper.cs @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Google.ProtocolBuffers; +using Mooege.Core.MooNet.Helpers; + +namespace Mooege.Core.MooNet.Toons +{ + public class ToonHandleHelper + { + public ulong ID { get; private set; } + + // Commented out all Program, Region, Realm stuff because **as of right now** we don't section Toon High's with that fields. + // All we have in hand is a default program, region, realm there. So after we get all stuff implemented, we should also + // sectionize HighId's so we'll have technical correctiness :) + + // And remember that this data is the sectioning for the EntityId High value. For type-checking we can't just do + // eid.High == EntityHelper.ToonId, instead we need to mask off the first 7 bytes to get _only_ the object type. + + //public uint Program { get; private set; } + //public uint Region { get; private set; } + //public uint Realm { get; private set; } + + public ToonHandleHelper(ulong id) + { + this.ID = id; + //this.Program = 0x00004433; + //this.Region = 0x62; + //this.Realm = 0x01; + } + + public ToonHandleHelper(D3.OnlineService.EntityId entityID) + { + var stream = CodedInputStream.CreateInstance(entityID.ToByteArray()); + ulong tmp = 0; + // I believe this actually calls ReadRawVarint64(), but just to be sure.. + stream.ReadUInt64(ref tmp); + this.ID = tmp; + //this.Program = stream.ReadRawVarint32(); + //this.Region = stream.ReadRawVarint32(); + //this.Realm = stream.ReadRawVarint32(); + } + + public D3.OnlineService.EntityId ToD3EntityID() + { + return D3.OnlineService.EntityId.CreateBuilder().SetIdHigh((ulong)EntityIdHelper.HighIdType.ToonId).SetIdLow(this.ID).Build(); + } + + public bnet.protocol.EntityId ToBnetEntityID() + { + return bnet.protocol.EntityId.CreateBuilder().SetHigh((ulong)EntityIdHelper.HighIdType.ToonId).SetLow(this.ID).Build(); + } + } +} diff --git a/src/Mooege/Core/MooNet/Toons/ToonManager.cs b/src/Mooege/Core/MooNet/Toons/ToonManager.cs new file mode 100644 index 00000000..b000e87f --- /dev/null +++ b/src/Mooege/Core/MooNet/Toons/ToonManager.cs @@ -0,0 +1,184 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Data.SQLite; +using System.Linq; +using Mooege.Common.Logging; +using Mooege.Common.Storage; +using Mooege.Common.Storage.AccountDataBase.Entities; +using Mooege.Core.MooNet.Accounts; +using NHibernate.Linq; + +namespace Mooege.Core.MooNet.Toons +{ + // Just a quick hack - not to be meant final + public static class ToonManager + { + private static readonly HashSet LoadedToons = new HashSet(); + private static readonly Logger Logger = LogManager.CreateLogger(); + + + public static Toon GetToonByDBToon(DBToon dbToon) + { + if (!LoadedToons.Any(dbt => dbt.DBToon.Id == dbToon.Id)) + LoadedToons.Add(new Toon(dbToon)); + return LoadedToons.Single(dbt => dbt.DBToon.Id == dbToon.Id); + } + + + public static Account GetOwnerAccountByToonLowId(ulong id) + { + return GetToonByLowID(id).GameAccount.Owner; + } + + public static GameAccount GetOwnerGameAccountByToonLowId(ulong id) + { + return GetToonByLowID(id).GameAccount; + } + + + + public static Toon GetToonByLowID(ulong id) + { + var dbToon = DBSessions.AccountSession.Get(id); + return GetToonByDBToon(dbToon); + } + + public static Toon GetDeletedToon(GameAccount account) + { + var query = DBSessions.AccountSession.Query().Where(dbt => dbt.DBGameAccount.Id == account.PersistentID && dbt.Deleted); + return query.Any() ? GetToonByLowID(query.First().Id) : null; + } + + public static List GetToonsForGameAccount(GameAccount account) + { + var toons = account.DBGameAccount.DBToons.Select(dbt => GetToonByLowID(dbt.Id)); + return toons.ToList(); + } + + + public static int TotalToons + { + get { return DBSessions.AccountSession.Query().Count(); } + } + + + public static Toon CreateNewToon(string name, int classId, ToonFlags flags, byte level, GameAccount gameAccount) + { + var dbGameAccount = DBSessions.AccountSession.Get(gameAccount.PersistentID); + var newDBToon = new DBToon + { + Class = @Toon.GetClassByID(classId), + Name = name, + /*HashCode = GetUnusedHashCodeForToonName(name),*/ + Flags = flags, + Level = level, + DBGameAccount = DBSessions.AccountSession.Get(gameAccount.PersistentID) + }; + + dbGameAccount.DBToons.Add(newDBToon); + DBSessions.AccountSession.SaveOrUpdate(dbGameAccount); + DBSessions.AccountSession.Flush(); + + + return GetToonByLowID(newDBToon.Id); + } + + public static void DeleteToon(Toon toon) + { + if (toon == null) + return; + + //remove toonActiveSkills + if (toon.DBToon.DBActiveSkills != null) + { + DBSessions.AccountSession.Delete(toon.DBToon.DBActiveSkills); + toon.DBToon.DBActiveSkills = null; + } + + //remove toon inventory + var inventoryToDelete = DBSessions.AccountSession.Query().Where(inv => inv.DBToon.Id == toon.DBToon.Id); + foreach (var inv in inventoryToDelete) + { + //toon.DBToon.DBGameAccount.DBInventories.Remove(inv); + DBSessions.AccountSession.Delete(inv); + } + + + + + //remove lastplayed hero if it was toon + if (toon.DBToon.DBGameAccount.LastPlayedHero != null && toon.DBToon.DBGameAccount.LastPlayedHero.Id == toon.DBToon.Id) + toon.DBToon.DBGameAccount.LastPlayedHero = null; + + + //remove toon from dbgameaccount + while (toon.DBToon.DBGameAccount.DBToons.Contains(toon.DBToon)) + toon.DBToon.DBGameAccount.DBToons.Remove(toon.DBToon); + + //save all this thinks + DBSessions.AccountSession.SaveOrUpdate(toon.DBToon.DBGameAccount); + DBSessions.AccountSession.Delete(toon.DBToon); + DBSessions.AccountSession.Flush(); + + + //remove toon from loadedToon list + if (LoadedToons.Contains(toon)) + LoadedToons.Remove(toon); + + Logger.Debug("Deleting toon {0}", toon.PersistentID); + } + + + public static void Sync() + { + foreach (var toon in LoadedToons) + { + SaveToDB(toon); + } + } + + public static void SaveToDB(Toon toon) + { + try + { + // save character base data + var dbToon = DBSessions.AccountSession.Get(toon.PersistentID); + dbToon.Name = toon.Name; + /*dbToon.HashCode = toon.HashCode;*/ + dbToon.Class = toon.Class; + dbToon.Flags = toon.Flags; + dbToon.Level = toon.Level; + dbToon.Experience = toon.ExperienceNext; + dbToon.DBGameAccount = DBSessions.AccountSession.Get(toon.GameAccount.PersistentID); + dbToon.TimePlayed = toon.TimePlayed; + dbToon.Deleted = toon.Deleted; + + DBSessions.AccountSession.SaveOrUpdate(dbToon); + DBSessions.AccountSession.Flush(); + } + catch (Exception e) + { + Logger.ErrorException(e, "Toon.SaveToDB()"); + } + } + + } +} diff --git a/src/Mooege/Core/MooNet/Web/AccountWebService.cs b/src/Mooege/Core/MooNet/Web/AccountWebService.cs new file mode 100644 index 00000000..4a8b0498 --- /dev/null +++ b/src/Mooege/Core/MooNet/Web/AccountWebService.cs @@ -0,0 +1,113 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.ServiceModel; +using Mooege.Core.MooNet.Accounts; +using Mooege.Net.WebServices; + +namespace Mooege.Core.MooNet.Web +{ + [ServiceContract(Name = "Accounts")] + public class AccountWebService : IWebService + { + [OperationContract] + public bool CreateAccount(string email, string password, string battleTag) + { + if (string.IsNullOrEmpty(email)) + throw new FaultException(new FaultReason("Email parameter can not be null or empty.")); + + if (string.IsNullOrEmpty(password)) + throw new FaultException(new FaultReason("Password parameter can not be null or empty.")); + + if (string.IsNullOrEmpty(battleTag)) + throw new FaultException(new FaultReason("BattleTag parameter can not be null or empty.")); + + if (password.Length < 8 || password.Length > 16) + throw new FaultException(new FaultReason("Password should be a minimum of 8 and a maximum of 16 characters.")); + + if (AccountManager.GetAccountByEmail(email.ToLower()) != null) + throw new FaultException(new FaultReason(string.Format("An account already exists for email address {0}.", email))); + + + var account = AccountManager.CreateAccount(email, password, battleTag); + var gameAccount = GameAccountManager.CreateGameAccount(account); + account.DBAccount.DBGameAccounts.Add(gameAccount.DBGameAccount); + account.SaveToDB(); + + return true; + } + + [OperationContract] + public bool AccountExists(string email) + { + if (string.IsNullOrEmpty(email)) + throw new FaultException(new FaultReason("Email parameter can not be null or empty.")); + + return AccountManager.GetAccountByEmail(email.ToLower()) != null; + } + + [OperationContract] + public bool VerifyPassword(string email, string password) + { + if (string.IsNullOrEmpty(email)) + throw new FaultException(new FaultReason("Email parameter can not be null or empty.")); + + if (string.IsNullOrEmpty(password)) + throw new FaultException(new FaultReason("Password parameter can not be null or empty.")); + + if (password.Length < 8 || password.Length > 16) + throw new FaultException(new FaultReason("Password should be a minimum of 8 and a maximum of 16 characters.")); + + var account = AccountManager.GetAccountByEmail(email.ToLower()); + + if (account == null) + throw new FaultException(new FaultReason(string.Format("Account does not exist for email address {0}.", email))); + + return account.VerifyPassword(password); + } + + [OperationContract] + public int TotalAccounts() + { + return AccountManager.TotalAccounts; + } + + [OperationContract] + public bool ChangePassword(string email, string password) + { + if (string.IsNullOrEmpty(password)) + throw new FaultException(new FaultReason("Password parameter can not be null or empty.")); + + if (password.Length < 8 || password.Length > 16) + throw new FaultException(new FaultReason("Password should be a minimum of 8 and a maximum of 16 characters.")); + + var account = AccountManager.GetAccountByEmail(email.ToLower()); + if (account == null) + throw new FaultException(new FaultReason(string.Format("Account does not exist for email address {0}.", email))); + + return account.UpdatePassword(password); + + } + + //[OperationContract] + //public int TotalToons() + //{ + // return AccountManager.AccountsList.Sum(account => account.Toons.Count); + //} + } +} diff --git a/src/Mooege/Core/MooNet/Web/MooNetWebService.cs b/src/Mooege/Core/MooNet/Web/MooNetWebService.cs new file mode 100644 index 00000000..a2c23372 --- /dev/null +++ b/src/Mooege/Core/MooNet/Web/MooNetWebService.cs @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using System.Linq; +using System.ServiceModel; +using Mooege.Core.MooNet.Online; +using Mooege.Net.WebServices; + +namespace Mooege.Core.MooNet.Web +{ + /// + /// Web service that can return statistics on online players and so. + /// + [ServiceContract(Name = "MooNet")] + public class MooNetWebService : IWebService + { + /// + /// Always returns true, so that clients can see if the moonet-server is online. + /// + /// true + [OperationContract] + public bool Ping() + { + return true; // TODO: actually fix it so that it's aware of services being stopped /raist. + } + + /// + /// Returns the online players count. + /// + /// Online player count. + [OperationContract] + public int OnlinePlayersCount() + { + return PlayerManager.OnlinePlayers.Count; + } + + /// + /// Returns the online players list. + /// + /// Online players list. + [OperationContract] + public List OnlinePlayersList() + { + return (from client in PlayerManager.OnlinePlayers where client.Account.CurrentGameAccount.CurrentToon != null select string.Format("{0}", client.Account.CurrentGameAccount.CurrentToon.Name)).ToList(); + } + } +} diff --git a/src/Mooege/Core/Web/CoreWebService.cs b/src/Mooege/Core/Web/CoreWebService.cs new file mode 100644 index 00000000..e15b51bd --- /dev/null +++ b/src/Mooege/Core/Web/CoreWebService.cs @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Reflection; +using System.ServiceModel; +using Mooege.Net.WebServices; + +namespace Mooege.Core.Web +{ + /// + /// Web service that can return statistics from the mooege core. + /// + [ServiceContract(Name = "Core")] + public class CoreWebService : IWebService + { + /// + /// Returns main mooege assembly version. + /// + /// true + [OperationContract] + public string Version() + { + return Assembly.GetExecutingAssembly().GetName().Version.ToString(); + } + + /// + /// Returns uptime. + /// + /// true + [OperationContract] + public string Uptime() + { + // TODO: return unix-time based value. /raist. + + var uptime = DateTime.Now - Program.StartupTime; + return string.Format("{0} days, {1} hours, {2} minutes, {3} seconds.", uptime.Days, uptime.Hours, uptime.Minutes, uptime.Seconds); + } + } +} diff --git a/src/Mooege/Mooege-Mono.csproj b/src/Mooege/Mooege-Mono.csproj new file mode 100644 index 00000000..87478ce8 --- /dev/null +++ b/src/Mooege/Mooege-Mono.csproj @@ -0,0 +1,780 @@ + + + + Debug + x86 + 9.0.21022 + 2.0 + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD} + Exe + Mooege + Mooege + v4.0 + + + 3.5 + + false + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + true + + + true + full + false + bin\Debug + DEBUG + prompt + 4 + x86 + true + AllRules.ruleset + true + true + + + none + false + bin\Release + prompt + 4 + x86 + true + AllRules.ruleset + + + ..\..\Assets\mooege.ico + + + + ..\..\dep\astar\AStar.dll + + + ..\..\dep\crystalmpq\CrystalMpq.dll + + + False + ..\..\dep\nhibernate\FluentNHibernate.dll + + + ..\..\dep\sharpziplib\ICSharpCode.SharpZipLib.dll + + + False + ..\..\dep\nhibernate\Iesi.Collections.dll + + + ..\..\dep\openssl\ManagedOpenSsl.dll + + + + + False + ..\..\dep\nhibernate\NHibernate.dll + + + + + False + + + + + False + ..\..\dep\gibbed.io\Gibbed.IO.dll + + + False + ..\..\dep\protobuf-csharp\Google.ProtocolBuffers.dll + + + False + ..\..\dep\nini\Nini.dll + + + False + ..\..\dep\sqlite\sqlite-managed\System.Data.SQLite.dll + False + + + ..\..\dep\powercollections\PowerCollections.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Form + + + WorldVisualizer.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + database.Account.config + Always + + + config.ini + PreserveNewest + + + Assets\mpqdata.db + Always + + + Assets\MPQ\IMPORTANT + PreserveNewest + + + ManagedOpenSsl.dll.config + PreserveNewest + + + libeay32.dll + PreserveNewest + + + ssleay32.dll + PreserveNewest + + + Designer + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + {4CC19847-6F24-4453-9E31-126F94308AB9} + LibMooNet + + + + + WorldVisualizer.cs + Designer + + + + + + \ No newline at end of file diff --git a/src/Mooege/Mooege-VS2010.csproj b/src/Mooege/Mooege-VS2010.csproj new file mode 100644 index 00000000..6cad339b --- /dev/null +++ b/src/Mooege/Mooege-VS2010.csproj @@ -0,0 +1,785 @@ + + + + Debug + x86 + 9.0.21022 + 2.0 + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD} + Exe + Mooege + Mooege + v4.0 + + + 3.5 + + false + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + true + + + true + full + false + bin\Debug + DEBUG + prompt + 4 + x86 + true + AllRules.ruleset + true + true + + + none + false + bin\Release + prompt + 4 + x86 + true + AllRules.ruleset + + + ..\..\Assets\mooege.ico + + + + ..\..\dep\astar\AStar.dll + + + ..\..\dep\crystalmpq\CrystalMpq.dll + + + False + ..\..\dep\nhibernate\FluentNHibernate.dll + + + ..\..\dep\sharpziplib\ICSharpCode.SharpZipLib.dll + + + False + ..\..\dep\nhibernate\Iesi.Collections.dll + + + ..\..\dep\openssl\ManagedOpenSsl.dll + + + + + False + ..\..\dep\nhibernate\NHibernate.dll + + + + + False + + + + + False + ..\..\dep\gibbed.io\Gibbed.IO.dll + + + False + ..\..\dep\protobuf-csharp\Google.ProtocolBuffers.dll + + + False + ..\..\dep\nini\Nini.dll + + + False + ..\..\dep\sqlite\sqlite-mixed\System.Data.SQLite.dll + False + + + ..\..\dep\powercollections\PowerCollections.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Form + + + WorldVisualizer.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + database.Account.config + Always + + + config.ini + PreserveNewest + + + Assets\mpqdata.db + Always + + + Assets\MPQ\IMPORTANT + PreserveNewest + + + ManagedOpenSsl.dll.config + PreserveNewest + + + libeay32.dll + PreserveNewest + + + ssleay32.dll + PreserveNewest + + + Designer + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + {4CC19847-6F24-4453-9E31-126F94308AB9} + LibMooNet + + + + + WorldVisualizer.cs + Designer + + + + + + \ No newline at end of file diff --git a/src/Mooege/Net/Connection.cs b/src/Mooege/Net/Connection.cs new file mode 100644 index 00000000..edef5055 --- /dev/null +++ b/src/Mooege/Net/Connection.cs @@ -0,0 +1,348 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Sockets; +using Mooege.Common.Logging; +using Mooege.Net.MooNet.Packets; + +using OpenSSL; + +namespace Mooege.Net +{ + /// + /// TCP Connection class. + /// + public class Connection : IConnection + { + protected static readonly Logger Logger = LogManager.CreateLogger(); // the logger. + + // [D3Inferno] + /// Returns true if the connection is encrypted. + public bool IsEncrypted { get; private set; } + + // Returns true is the EncryptRequest message has been sent to the client. + // The last unencrypted packet should be the EncryptRequest NoData service response. + public bool IsEncryptRequestSent { get; set; } + + // Returns true if the connection is trying to establish a Tls connection. + public bool IsTlsHandshaking { get; set; } + + /// The underlying TLS stream. Required for encrypted communication. + public SslStream TLSStream { get; private set; } + + // Notify the Connection of the encrypted TLSStream + public void SetEncrypted(SslStream TLSStream) + { + this.TLSStream = TLSStream; + this.IsEncrypted = true; + } + + // Notify that Tls Authentication is complete (but perhaps not successful) so that it can once + // again start listening for client data, but from now on, using the SslStream if successful. + public void TlsAuthenticationComplete() + { + if (this._server == null) + { + Logger.Warn("Server is null in TlsAuthenticationComplete"); + return; + } + this._server.TlsAuthenticationComplete(this); + } + + // Read bytes from the Socket into the buffer in a non-blocking call. + // This allows us to read no more than the specified count number of bytes.\ + // Note that this method should only be called prior to encryption! + public int Receive(int start, int count) + { + return this.Socket.Receive(_recvBuffer, start, count, SocketFlags.None); + } + + // Wrapper for the Send method that will send the data either to the + // Socket (unecnrypted) or to the TLSStream (encrypted). + public int _Send(byte[] buffer, int start, int count, SocketFlags flags) + { + if (!IsEncrypted) + { + return this.Socket.Send(buffer, start, count, flags); + } + else + { + // Does this Write operation guarantee that all bytes will be written? + this.TLSStream.Write(buffer, start, count); + return count; + } + } + + /// + /// Gets underlying socket. + /// + public Socket Socket { get; private set; } + + /// + /// Gets or sets bound client. + /// + public IClient Client { get; set; } + + /// + /// Default buffer size. + /// + public static readonly int BufferSize = 16 * 1024; // 16 KB + + /// + /// The server that connection is bound to. + /// + private Server _server; + + /// + /// The recieve buffer. + /// + private readonly byte[] _recvBuffer = new byte[BufferSize]; + + public Connection(Server server, Socket socket) + { + if (server == null) + throw new ArgumentNullException("server"); + + if (socket == null) + throw new ArgumentNullException("socket"); + + this._server = server; + this.Socket = socket; + } + + #region socket stuff + + /// + /// Returns true if there exists an active connection. + /// + public bool IsConnected + { + get { return (Socket == null) ? false : Socket.Connected; } + } + + /// + /// Returns remote endpoint. + /// + public IPEndPoint RemoteEndPoint + { + get { return (Socket == null) ? null : Socket.RemoteEndPoint as IPEndPoint; } + } + + /// + /// Returns local endpoint. + /// + public IPEndPoint LocalEndPoint + { + get { return Socket.LocalEndPoint as IPEndPoint; } + } + + /// + /// Returns the recieve-buffer. + /// + public byte[] RecvBuffer + { + get { return _recvBuffer; } + } + + /// + /// Begins recieving data async. + /// + /// Callback function be called when recv() is complete. + /// State manager object. + /// Returns + public IAsyncResult BeginReceive(AsyncCallback callback, object state) + { + if (!IsEncrypted) + { + return this.Socket.BeginReceive(_recvBuffer, 0, BufferSize, SocketFlags.None, callback, state); + } + else + { + return this.TLSStream.BeginRead(_recvBuffer, 0, BufferSize, callback, state); + } + } + + public int EndReceive(IAsyncResult result) + { + if (!IsEncrypted) + { + return this.Socket.EndReceive(result); + } + else + { + return this.TLSStream.EndRead(result); + } + } + + /// + /// Sends a to remote endpoint. + /// + /// to send. + /// Returns count of sent bytes. + public int Send(PacketOut packet) + { + if (packet == null) throw new ArgumentNullException("packet"); + return Send(packet.Data); + } + + /// + /// Sends byte buffer to remote endpoint. + /// + /// Byte buffer to send. + /// Returns count of sent bytes. + public int Send(byte[] buffer) + { + if (buffer == null) throw new ArgumentNullException("buffer"); + return Send(buffer, 0, buffer.Length, SocketFlags.None); + } + + /// + /// Sends byte buffer to remote endpoint. + /// + /// Byte buffer to send. + /// Sockets flags to use. + /// Returns count of sent bytes. + public int Send(byte[] buffer, SocketFlags flags) + { + if (buffer == null) throw new ArgumentNullException("buffer"); + return Send(buffer, 0, buffer.Length, flags); + } + + /// + /// Sends byte buffer to remote endpoint. + /// + /// Byte buffer to send. + /// Start index to read from buffer. + /// Count of bytes to send. + /// Returns count of sent bytes. + public int Send(byte[] buffer, int start, int count) + { + if (buffer == null) throw new ArgumentNullException("buffer"); + return Send(buffer, start, count, SocketFlags.None); + } + + /// + /// Sends byte buffer to remote endpoint. + /// + /// Byte buffer to send. + /// Start index to read from buffer. + /// Count of bytes to send. + /// Sockets flags to use. + /// Returns count of sent bytes. + public int Send(byte[] buffer, int start, int count, SocketFlags flags) + { + if (buffer == null) throw new ArgumentNullException("buffer"); + if (_server == null) + { + throw new Exception("[Connection] _server is null in Send"); + } + return _server.Send(this, buffer, start, count, flags); + } + + /// + /// Sends an enumarable byte buffer to remote endpoint. + /// + /// Enumrable byte buffer to send. + /// Returns count of sent bytes. + public int Send(IEnumerable data) + { + if (data == null) throw new ArgumentNullException("data"); + return Send(data, SocketFlags.None); + } + + /// + /// Sends an enumarable byte buffer to remote endpoint. + /// + /// Enumrable byte buffer to send. + /// Sockets flags to use. + /// Returns count of sent bytes. + public int Send(IEnumerable data, SocketFlags flags) + { + if (data == null) throw new ArgumentNullException("data"); + if (_server == null) + { + throw new Exception("[Connection] _server is null in Send"); + } + return _server.Send(this, data, flags); + } + + /// + /// Kills the connection to remote endpoint. + /// + public void Disconnect() + { + Logger.Trace("Disconnect() | server: " + _server); + + if (_server != null) + { + // Use temp assignment to preven recursion. + Server tempServer = _server; + _server = null; + tempServer.Disconnect(this); + } + + if (this.TLSStream != null) + { + try + { + this.TLSStream.Close(); + } + finally + { + this.TLSStream.Dispose(); + this.TLSStream = null; + } + } + + if (this.Socket != null) + { + try + { + this.Socket.Shutdown(SocketShutdown.Both); + this.Socket.Close(); + } + catch (Exception) + { + // Ignore any exceptions that might occur during attempt to close the Socket. + } + finally + { + this.Socket.Dispose(); + this.Socket = null; + } + } + } + + /// + /// Returns a connection state string. + /// + /// Connection state string. + public override string ToString() + { + if (Socket == null) + return "No Socket!"; + else + return Socket.RemoteEndPoint != null ? Socket.RemoteEndPoint.ToString() : "Not Connected!"; + } + + #endregion + } +} diff --git a/src/Mooege/Net/ConnectionDataEventArgs.cs b/src/Mooege/Net/ConnectionDataEventArgs.cs new file mode 100644 index 00000000..e49a4523 --- /dev/null +++ b/src/Mooege/Net/ConnectionDataEventArgs.cs @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using System.Linq; + +namespace Mooege.Net +{ + public sealed class ConnectionDataEventArgs : ConnectionEventArgs + { + public IEnumerable Data { get; private set; } + + public ConnectionDataEventArgs(IConnection connection, IEnumerable data) + : base(connection) + { + this.Data = data ?? new byte[0]; + } + + public override string ToString() + { + return Connection.RemoteEndPoint != null + ? string.Format("{0}: {1} bytes", Connection.RemoteEndPoint, Data.Count()) + : string.Format("Not Connected: {0} bytes", Data.Count()); + } + } +} + diff --git a/src/Mooege/Net/ConnectionEventArgs.cs b/src/Mooege/Net/ConnectionEventArgs.cs new file mode 100644 index 00000000..9d7f6507 --- /dev/null +++ b/src/Mooege/Net/ConnectionEventArgs.cs @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; + +namespace Mooege.Net +{ + public class ConnectionEventArgs : EventArgs + { + public IConnection Connection { get; private set; } + + public ConnectionEventArgs(IConnection connection) + { + if (connection == null) + throw new ArgumentNullException("connection"); + this.Connection = connection; + } + + public override string ToString() + { + return Connection.RemoteEndPoint != null + ? Connection.RemoteEndPoint.ToString() + : "Not Connected"; + } + } +} + diff --git a/src/Mooege/Net/GS/ClientManager.cs b/src/Mooege/Net/GS/ClientManager.cs new file mode 100644 index 00000000..5cb2744f --- /dev/null +++ b/src/Mooege/Net/GS/ClientManager.cs @@ -0,0 +1,128 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Common.Logging; +using Mooege.Core.GS.Games; +using Mooege.Core.GS.Players; +using Mooege.Core.MooNet.Toons; +using Mooege.Net.GS.Message; +using Mooege.Net.GS.Message.Definitions.Act; +using Mooege.Net.GS.Message.Definitions.Connection; +using Mooege.Net.GS.Message.Definitions.Game; +using Mooege.Net.GS.Message.Definitions.Hero; +using Mooege.Net.GS.Message.Definitions.Misc; +using System; +using Mooege.Common.Extensions; + +namespace Mooege.Net.GS +{ + public class ClientManager : IMessageConsumer + { + protected static readonly Logger Logger = LogManager.CreateLogger(); + private static readonly ClientManager _instance = new ClientManager(); + public static ClientManager Instance { get { return _instance; } } + + + public void OnConnect(object sender, ConnectionEventArgs e) + { + Logger.Trace("Game-Client connected: {0}", e.Connection.ToString()); + + var gameClient = new GameClient(e.Connection); + e.Connection.Client = gameClient; + } + + public void OnDisconnect(object sender, ConnectionEventArgs e) + { + Logger.Trace("Client disconnected: {0}", e.Connection.ToString()); + GameManager.RemovePlayerFromGame((GameClient)e.Connection.Client); + } + + public void Consume(GameClient client, GameMessage message) + { + if (message is JoinBNetGameMessage) OnJoinGame(client, (JoinBNetGameMessage)message); + } + + private void OnJoinGame(GameClient client, JoinBNetGameMessage message) + { + var game = GameManager.GetGameById(message.GameId); + if (game == null) + { + Logger.Warn("Client provided message.GameId doesnt exists, dropping him.."); + client.Connection.Disconnect(); + return; + } + lock (game) + { + var toon = ToonManager.GetToonByLowID((ulong)message.ToonEntityId.Low); + + client.Game = game; + + if (toon.GameAccount.LoggedInClient == null) + { + Logger.Warn("Client doesn't seem to be connected to moonet, dropping him.."); + client.Connection.Disconnect(); + return; // if moonet connection is lost, don't allow him to get in. + } + + // Set references between MooNetClient and GameClient. + client.BnetClient = toon.GameAccount.LoggedInClient; + client.BnetClient.InGameClient = client; + + client.Player = new Player(game.StartingWorld, client, toon); + Logger.Info("Player {0}[PlayerIndex: {1}] connected.", client.Player.Toon.Name, client.Player.PlayerIndex); + + client.SendMessage(new VersionsMessage(message.SNOPackHash)); + + client.SendMessage(new ConnectionEstablishedMessage + { + PlayerIndex = client.Player.PlayerIndex, + Field1 = 0x4BB91A16, + SNOPackHash = message.SNOPackHash, + }); + + client.SendMessage(new GameSetupMessage // should be the current tick for the game /raist. + { + Field0 = game.TickCounter, + }); + + client.SendMessage(new SavePointInfoMessage + { + snoLevelArea = -1, + }); + + client.SendMessage(new HearthPortalInfoMessage + { + snoLevelArea = -1, + Field1 = -1, + }); + + // transition player to act so client can load act related data? /raist + client.SendMessage(new ActTransitionMessage + { + Field0 = 0x00000000, + Field1 = true, + }); + + toon.LoginTime = DateTimeExtensions.ToUnixTime(DateTime.UtcNow); + Logger.Trace("Log in time:" + toon.LoginTime.ToString()); + + game.Enter(client.Player); + } + } + } +} diff --git a/src/Mooege/Net/GS/Config.cs b/src/Mooege/Net/GS/Config.cs new file mode 100644 index 00000000..e8891269 --- /dev/null +++ b/src/Mooege/Net/GS/Config.cs @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace Mooege.Net.GS +{ + public sealed class Config : Common.Config.Config + { + public string BindIP { get { return this.GetString("BindIP", "0.0.0.0"); } set { this.Set("BindIP", value); } } + public string BindIPv6 { get { return this.GetString("BindIPv6", "::1"); } set { this.Set("BindIPv6", value); } } + public int Port { get { return this.GetInt("Port", 1345); } set { this.Set("Port", value); } } + + private static readonly Config _instance = new Config(); + public static Config Instance { get { return _instance; } } + private Config() : base("Game-Server") { } + } +} + diff --git a/src/Mooege/Net/GS/GameClient.cs b/src/Mooege/Net/GS/GameClient.cs new file mode 100644 index 00000000..d0575666 --- /dev/null +++ b/src/Mooege/Net/GS/GameClient.cs @@ -0,0 +1,128 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Linq; +using Mooege.Common.Logging; +using Mooege.Core.GS.Games; +using Mooege.Core.GS.Players; +using Mooege.Net.GS.Message; +using Mooege.Net.GS.Message.Definitions.Tick; +using Mooege.Net.MooNet; + +namespace Mooege.Net.GS +{ + public sealed class GameClient : IClient + { + private static readonly Logger Logger = LogManager.CreateLogger(); + + public IConnection Connection { get; set; } + public MooNetClient BnetClient { get; set; } + + private readonly GameBitBuffer _incomingBuffer = new GameBitBuffer(512); + private readonly GameBitBuffer _outgoingBuffer = new GameBitBuffer(ushort.MaxValue); + + public Game Game { get; set; } + public Player Player { get; set; } + + public bool TickingEnabled { get; set; } + + private object _bufferLock = new object(); // we should be locking on this private object, locking on gameclient (this) may cause deadlocks. detailed information: http://msdn.microsoft.com/fr-fr/magazine/cc188793%28en-us%29.aspx /raist. + + public bool IsLoggingOut; + + public GameClient(IConnection connection) + { + this.TickingEnabled = false; + this.Connection = connection; + _outgoingBuffer.WriteInt(32, 0); + } + + public void Parse(ConnectionDataEventArgs e) + { + //Console.WriteLine(e.Data.Dump()); + + _incomingBuffer.AppendData(e.Data.ToArray()); + + while (_incomingBuffer.IsPacketAvailable()) + { + int end = _incomingBuffer.Position; + end += _incomingBuffer.ReadInt(32) * 8; + + while ((end - _incomingBuffer.Position) >= 9) + { + var message = _incomingBuffer.ParseMessage(); + if (message == null) continue; + try + { + Logger.LogIncomingPacket(message); // change ConsoleTarget's level to Level.Dump in program.cs if u want to see messages on console. + + if (message.Consumer != Consumers.None) + { + if (message.Consumer == Consumers.ClientManager) ClientManager.Instance.Consume(this, message); // Client should be greeted by ClientManager and sent initial game-setup messages. + else this.Game.Route(this, message); + } + + else if (message is ISelfHandler) (message as ISelfHandler).Handle(this); // if message is able to handle itself, let it do so. + else Logger.Warn("{0} - ID:{1} has no consumer or self-handler.", message.GetType(), message.Id); + + } + catch (NotImplementedException) + { + Logger.Warn("Unhandled game message: 0x{0:X4} {1}", message.Id, message.GetType().Name); + } + } + + _incomingBuffer.Position = end; + } + _incomingBuffer.ConsumeData(); + } + + public void SendMessage(GameMessage message, bool flushImmediatly = false) + { + lock (this._bufferLock) + { + Logger.LogOutgoingPacket(message); + _outgoingBuffer.EncodeMessage(message); // change ConsoleTarget's level to Level.Dump in program.cs if u want to see messages on console. + if (flushImmediatly) this.SendTick(); + } + } + + public void SendTick() + { + lock (this._bufferLock) + { + if (_outgoingBuffer.Length <= 32) return; + + if (this.TickingEnabled) this.SendMessage(new GameTickMessage(this.Game.TickCounter)); // send the tick. + this.FlushOutgoingBuffer(); + } + } + + private void FlushOutgoingBuffer() + { + lock (this._bufferLock) + { + if (_outgoingBuffer.Length <= 32) return; + + var data = _outgoingBuffer.GetPacketAndReset(); + Connection.Send(data); + } + } + } +} diff --git a/src/Mooege/Net/GS/GameServer.cs b/src/Mooege/Net/GS/GameServer.cs new file mode 100644 index 00000000..0fc708be --- /dev/null +++ b/src/Mooege/Net/GS/GameServer.cs @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Common.Logging; + +namespace Mooege.Net.GS +{ + public sealed class GameServer : Server + { + private new static readonly Logger Logger = LogManager.CreateLogger(); // hide the Server.Logger so that tiny-logger can show the actual server as log source. + + public GameServer() + { + this.OnConnect += ClientManager.Instance.OnConnect; + this.OnDisconnect += ClientManager.Instance.OnDisconnect; + this.DataReceived += GameServer_DataReceived; + this.DataSent += (sender, e) => { }; + } + + void GameServer_DataReceived(object sender, ConnectionDataEventArgs e) + { + var connection = (Connection)e.Connection; + ((GameClient)connection.Client).Parse(e); + } + + public override void Run() + { + var bindIP = NetworkingConfig.Instance.EnableIPv6 ? Config.Instance.BindIPv6 : Config.Instance.BindIP; + + if (!this.Listen(bindIP, Config.Instance.Port)) return; + Logger.Info("Game-Server is listening on {0}:{1}...", bindIP, Config.Instance.Port); + } + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/ACD/ACDChangeActorMessage.cs b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDChangeActorMessage.cs new file mode 100644 index 00000000..783b4c53 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDChangeActorMessage.cs @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.ACD +{ + [Message(Opcodes.ACDChangeActorMessage)] + public class ACDChangeActorMessage : GameMessage + { + public int Field0; + public int /* sno */ Field1; + + public ACDChangeActorMessage() : base(Opcodes.ACDChangeActorMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ACDChangeActorMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/ACD/ACDChangeGBHandleMessage.cs b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDChangeGBHandleMessage.cs new file mode 100644 index 00000000..565ba32e --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDChangeGBHandleMessage.cs @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.ACD +{ + [Message(Opcodes.ACDChangeGBHandleMessage)] + public class ACDChangeGBHandleMessage : GameMessage + { + public int Field0; + public GBHandle Field1; + + public ACDChangeGBHandleMessage() : base(Opcodes.ACDChangeGBHandleMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = new GBHandle(); + Field1.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + Field1.Encode(buffer); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ACDChangeGBHandleMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + Field1.AsText(b, pad); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/ACD/ACDClientTranslateMessage.cs b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDClientTranslateMessage.cs new file mode 100644 index 00000000..4a8a8acb --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDClientTranslateMessage.cs @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Core.GS.Common.Types.Math; + +namespace Mooege.Net.GS.Message.Definitions.ACD +{ + [Message(Opcodes.ACDClientTranslateMessage, Consumers.Player)] + public class ACDClientTranslateMessage : GameMessage + { + public int Tick; + public int Field1; + public Vector3D Position; + public float Angle; + public float Speed; + public int Field5; + public int AnimationTag; + public int? Field7; + + public override void Parse(GameBitBuffer buffer) + { + Tick = buffer.ReadInt(32); + Field1 = buffer.ReadInt(4); + Position = new Vector3D(); + Position.Parse(buffer); + Angle = buffer.ReadFloat32(); + Speed = buffer.ReadFloat32(); + Field5 = buffer.ReadInt(32); + AnimationTag = buffer.ReadInt(21) + (-1); + if (buffer.ReadBool()) + Field7 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Tick); + buffer.WriteInt(4, Field1); + Position.Encode(buffer); + buffer.WriteFloat32(Angle); + buffer.WriteFloat32(Speed); + buffer.WriteInt(32, Field5); + buffer.WriteInt(21, AnimationTag - (-1)); + if (Field7.HasValue) + buffer.WriteInt(32, Field7.Value); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ACDClientTranslateMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Tick: 0x" + Tick.ToString("X8") + " (" + Tick + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8")); + Position.AsText(b, pad); + b.Append(' ', pad); b.AppendLine("Position: " + Angle.ToString("G")); + b.Append(' ', pad); b.AppendLine("Angle: " + Speed.ToString("G")); + b.Append(' ', pad); b.AppendLine("Field5: 0x" + Field5.ToString("X8") + " (" + Field5 + ")"); + b.Append(' ', pad); b.AppendLine("AnimationTag: 0x" + AnimationTag.ToString("X8") + " (" + AnimationTag + ")"); + if (Field7.HasValue) + { + b.Append(' ', pad); b.AppendLine("Field7.Value: 0x" + Field7.Value.ToString("X8") + " (" + Field7.Value + ")"); + } + b.Append(' ', --pad); + b.AppendLine("}"); + } + } + +} diff --git a/src/Mooege/Net/GS/Message/Definitions/ACD/ACDCollFlagsMessage.cs b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDCollFlagsMessage.cs new file mode 100644 index 00000000..0a178348 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDCollFlagsMessage.cs @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.ACD +{ + [Message(Opcodes.ACDCollFlagsMessage)] + public class ACDCollFlagsMessage : GameMessage + { + public uint ActorID; // The actor's DynamicID + public int CollFlags; + + public ACDCollFlagsMessage() : base(Opcodes.ACDCollFlagsMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + ActorID = buffer.ReadUInt(32); + CollFlags = buffer.ReadInt(12); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ActorID); + buffer.WriteInt(12, CollFlags); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ACDCollFlagsMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ActorID: 0x" + ActorID.ToString("X8")); + b.Append(' ', pad); b.AppendLine("CollFlags: 0x" + CollFlags.ToString("X8") + " (" + CollFlags + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/ACD/ACDCreateActorMessage.cs b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDCreateActorMessage.cs new file mode 100644 index 00000000..81d86e1a --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDCreateActorMessage.cs @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.ACD +{ + /// + /// Sent to the client after a new actor is introduced with ACDEnterKnownMessage. + /// This message adds the actor to the client's world. + /// + [Message(Opcodes.ACDCreateActorMessage)] + public class ACDCreateActorMessage : GameMessage + { + public uint ActorId; // Actor's DynamicID + + public ACDCreateActorMessage(uint actorID) + : base(Opcodes.ACDCreateActorMessage) + { + this.ActorId = actorID; + } + + public ACDCreateActorMessage() + : base(Opcodes.ACDCreateActorMessage) + { } + + public override void Parse(GameBitBuffer buffer) + { + ActorId = buffer.ReadUInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ActorId); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ACDCreateActorMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ActorID: 0x" + ActorId.ToString("X8") + " (" + ActorId + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/ACD/ACDDestroyActorMessage.cs b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDDestroyActorMessage.cs new file mode 100644 index 00000000..3ab8f8a8 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDDestroyActorMessage.cs @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.ACD +{ + /// + /// Sent to the client after a actor dies or gets out of sight. + /// This message removes the actor from the client's world + /// + [Message(Opcodes.ACDDestroyActorMessage)] + public class ACDDestroyActorMessage : GameMessage + { + public uint ActorId; // Actor's DynamicID + + public ACDDestroyActorMessage(uint actorId) + : base(Opcodes.ACDDestroyActorMessage) + { + this.ActorId = actorId; + } + + public ACDDestroyActorMessage() + : base(Opcodes.ACDDestroyActorMessage) + { } + + public override void Parse(GameBitBuffer buffer) + { + ActorId = buffer.ReadUInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ActorId); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ACDDestroyActorMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ActorID: 0x" + ActorId.ToString("X8") + " (" + ActorId + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/ACD/ACDEnterKnownMessage.cs b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDEnterKnownMessage.cs new file mode 100644 index 00000000..10b6bffb --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDEnterKnownMessage.cs @@ -0,0 +1,165 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.ACD +{ + /// + /// Sent to client, to introduce a new actor. + /// + [Message(Opcodes.ACDEnterKnownMessage)] + public class ACDEnterKnownMessage : GameMessage + { + public uint ActorID; // The actor's DynamicID + public int ActorSNOId; + + // For many actors, bit 0x8 is set the first time the item is introduced with ACDEnterKnown... if the item + // is later deleted with an ANN Message and reintroduced, 0x8 is NOT set... (StartLocation, BlockingCart, MarkerLocation) + // - farmy + + public int Field2; + public int Field3; // 0 = WorldLocationMessageData is set, 1 = InventoryLocationMessageData is set ... + public WorldLocationMessageData WorldLocation; + public InventoryLocationMessageData InventoryLocation; + public GBHandle GBHandle; + public int Field7; + public int NameSNOId; // Actor providing a name for the this actor, you can name zombies leah etc.. + public int Quality; // Item quality if an item, SpawnType for mobs, 0 otherwise + public byte Field10; + public int? /* sno */ Field11; + public int? MarkerSetSNO; + public int? MarkerSetIndex; + + public ACDEnterKnownMessage() : base(Opcodes.ACDEnterKnownMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + ActorID = buffer.ReadUInt(32); + ActorSNOId = buffer.ReadInt(32); + Field2 = buffer.ReadInt(6); + Field3 = buffer.ReadInt(2) + (-1); + if (buffer.ReadBool()) + { + WorldLocation = new WorldLocationMessageData(); + WorldLocation.Parse(buffer); + } + if (buffer.ReadBool()) + { + InventoryLocation = new InventoryLocationMessageData(); + InventoryLocation.Parse(buffer); + } + GBHandle = new GBHandle(); + GBHandle.Parse(buffer); + Field7 = buffer.ReadInt(32); + NameSNOId = buffer.ReadInt(32); + Quality = buffer.ReadInt(4) + (-1); + Field10 = (byte)buffer.ReadInt(8); + if (buffer.ReadBool()) + { + Field11 = buffer.ReadInt(32); + } + if (buffer.ReadBool()) + { + MarkerSetSNO = buffer.ReadInt(32); + } + if (buffer.ReadBool()) + { + MarkerSetIndex = buffer.ReadInt(32); + } + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ActorID); + buffer.WriteInt(32, ActorSNOId); + buffer.WriteInt(6, Field2); + buffer.WriteInt(2, Field3 - (-1)); + buffer.WriteBool(WorldLocation != null); + if (WorldLocation != null) + { + WorldLocation.Encode(buffer); + } + buffer.WriteBool(InventoryLocation != null); + if (InventoryLocation != null) + { + InventoryLocation.Encode(buffer); + } + GBHandle.Encode(buffer); + buffer.WriteInt(32, Field7); + buffer.WriteInt(32, NameSNOId); + buffer.WriteInt(4, Quality - (-1)); + buffer.WriteInt(8, Field10); + buffer.WriteBool(Field11.HasValue); + if (Field11.HasValue) + { + buffer.WriteInt(32, Field11.Value); + } + buffer.WriteBool(MarkerSetSNO.HasValue); + if (MarkerSetSNO.HasValue) + { + buffer.WriteInt(32, MarkerSetSNO.Value); + } + buffer.WriteBool(MarkerSetIndex.HasValue); + if (MarkerSetIndex.HasValue) + { + buffer.WriteInt(32, MarkerSetIndex.Value); + } + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ACDEnterKnownMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ActorID: 0x" + ActorID.ToString("X8") + " (" + ActorID + ")"); + b.Append(' ', pad); b.AppendLine("ActorSNOId: 0x" + ActorSNOId.ToString("X8")); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', pad); b.AppendLine("Field3: 0x" + Field3.ToString("X8") + " (" + Field3 + ")"); + if (WorldLocation != null) + { + WorldLocation.AsText(b, pad); + } + if (InventoryLocation != null) + { + InventoryLocation.AsText(b, pad); + } + GBHandle.AsText(b, pad); + b.Append(' ', pad); b.AppendLine("Field7: 0x" + Field7.ToString("X8") + " (" + Field7 + ")"); + b.Append(' ', pad); b.AppendLine("NameSNOId: 0x" + NameSNOId.ToString("X8") + " (" + NameSNOId + ")"); + b.Append(' ', pad); b.AppendLine("Quality: 0x" + Quality.ToString("X8") + " (" + Quality + ")"); + b.Append(' ', pad); b.AppendLine("Field10: 0x" + Field10.ToString("X2")); + if (Field11.HasValue) + { + b.Append(' ', pad); b.AppendLine("Field11.Value: 0x" + Field11.Value.ToString("X8")); + } + if (MarkerSetSNO.HasValue) + { + b.Append(' ', pad); b.AppendLine("MarkerSetSNO.Value: 0x" + MarkerSetSNO.Value.ToString("X8") + " (" + MarkerSetSNO.Value + ")"); + } + if (MarkerSetIndex.HasValue) + { + b.Append(' ', pad); b.AppendLine("MarkerSetIndex.Value: 0x" + MarkerSetIndex.Value.ToString("X8") + " (" + MarkerSetIndex.Value + ")"); + } + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/ACD/ACDGroupMessage.cs b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDGroupMessage.cs new file mode 100644 index 00000000..4a26f4b6 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDGroupMessage.cs @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.ACD +{ + [Message(Opcodes.ACDGroupMessage)] + public class ACDGroupMessage : GameMessage + { + public uint ActorID; // Actor's DynamicID + public int Group1Hash; + public int Group2Hash; + + public ACDGroupMessage() : base(Opcodes.ACDGroupMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + ActorID = buffer.ReadUInt(32); + Group1Hash = buffer.ReadInt(32); + Group2Hash = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ActorID); + buffer.WriteInt(32, Group1Hash); + buffer.WriteInt(32, Group2Hash); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ACDGroupMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ActorID: 0x" + ActorID.ToString("X8") + " (" + ActorID + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Group1Hash.ToString("X8") + " (" + Group1Hash + ")"); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Group2Hash.ToString("X8") + " (" + Group2Hash + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/ACD/ACDInventoryPositionMessage.cs b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDInventoryPositionMessage.cs new file mode 100644 index 00000000..be34e7a2 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDInventoryPositionMessage.cs @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.ACD +{ + /// + /// Sent to the client to move an item into an actors inventory + /// + [Message(Opcodes.ACDInventoryPositionMessage)] + public class ACDInventoryPositionMessage : GameMessage + { + public uint ItemId; // Item's DynamicID + public InventoryLocationMessageData InventoryLocation; // Target inventory + public int Field2; // have not seen != 1... need to be 1 or nothing happens - farmy + + public ACDInventoryPositionMessage() + : base(Opcodes.ACDInventoryPositionMessage) + { } + + public override void Parse(GameBitBuffer buffer) + { + ItemId = buffer.ReadUInt(32); + InventoryLocation = new InventoryLocationMessageData(); + InventoryLocation.Parse(buffer); + Field2 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ItemId); + if (InventoryLocation != null) + { + InventoryLocation.Encode(buffer); + } + buffer.WriteInt(32, Field2); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ACDInventoryPositionMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ItemId: 0x" + ItemId.ToString("X8") + " (" + ItemId + ")"); + if (InventoryLocation != null) + { + InventoryLocation.AsText(b, pad); + } + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/ACD/ACDInventoryUpdateActorSNO.cs b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDInventoryUpdateActorSNO.cs new file mode 100644 index 00000000..fc3edf68 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDInventoryUpdateActorSNO.cs @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.ACD +{ + [Message(Opcodes.ACDInventoryUpdateActorSNO)] + public class ACDInventoryUpdateActorSNO : GameMessage + { + public uint ItemID; // The item's DynamicID + public int /* sno */ ItemSNO; + + public ACDInventoryUpdateActorSNO() : base(Opcodes.ACDInventoryUpdateActorSNO) { } + + public override void Parse(GameBitBuffer buffer) + { + ItemID = buffer.ReadUInt(32); + ItemSNO = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ItemID); + buffer.WriteInt(32, ItemSNO); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ACDInventoryUpdateActorSNO:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ItemID: 0x" + ItemID.ToString("X8") + " (" + ItemID + ")"); + b.Append(' ', pad); b.AppendLine("ItemSNO: 0x" + ItemSNO.ToString("X8")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/ACD/ACDLookAtMessage.cs b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDLookAtMessage.cs new file mode 100644 index 00000000..b6050b1d --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDLookAtMessage.cs @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.ACD +{ + [Message(Opcodes.ACDLookAtMessage)] + public class ACDLookAtMessage : GameMessage + { + public int Field0; + public int Field1; + + public ACDLookAtMessage() : base(Opcodes.ACDLookAtMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ACDLookAtMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/ACD/ACDPickupFailedMessage.cs b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDPickupFailedMessage.cs new file mode 100644 index 00000000..7b8f71f5 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDPickupFailedMessage.cs @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.ACD +{ + [Message(Opcodes.ACDPickupFailedMessage)] + public class ACDPickupFailedMessage : GameMessage + { + public enum Reasons : int + { + InventoryFull = 0, //and 1, 2, 5, 6, 7 <-- ? + ItemBelongingToSomeoneElse = 3, + OnlyOneItemAllowed = 4 + } + + public uint ItemID; // Item's DynamicID + public Reasons Reason; + + public ACDPickupFailedMessage() : base(Opcodes.ACDPickupFailedMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + ItemID = buffer.ReadUInt(32); + Reason = (Reasons)buffer.ReadInt(3); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ItemID); + buffer.WriteInt(3, (int)Reason); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ACDPickupFailedMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ItemID: 0x" + ItemID.ToString("X8") + " (" + ItemID + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + ((int)(Reason)).ToString("X8") + " (" + Reason + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/ACD/ACDShearMessage.cs b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDShearMessage.cs new file mode 100644 index 00000000..37b76017 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDShearMessage.cs @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.ACD +{ + /// + /// Sent to client to shear the visual model of an actor + /// + [Message(Opcodes.ACDShearMessage)] + public class ACDShearMessage : GameMessage + { + public int ActorID; + public float Amount; // 0 = no shearing + public ACDShearMessage() : base(Opcodes.ACDShearMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + ActorID = buffer.ReadInt(32); + Amount = buffer.ReadFloat32(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, ActorID); + buffer.WriteFloat32(Amount); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ACDShearMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + ActorID.ToString("X8") + " (" + ActorID + ")"); + b.Append(' ', pad); b.AppendLine("Field1: " + Amount.ToString("G")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateAckMessage.cs b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateAckMessage.cs new file mode 100644 index 00000000..ce3624e6 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateAckMessage.cs @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.ACD +{ + [Message(Opcodes.ACDTranslateAckMessage)] + public class ACDTranslateAckMessage : GameMessage + { + public int Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ACDTranslateAckMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateArcMessage.cs b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateArcMessage.cs new file mode 100644 index 00000000..cad29226 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateArcMessage.cs @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Text; +using Mooege.Core.GS.Common.Types.Math; + +namespace Mooege.Net.GS.Message.Definitions.ACD +{ + /// + /// Sent by the server to translate an actor along an arc + /// + [Message(Opcodes.ACDTranslateArcMessage)] + public class ACDTranslateArcMessage : GameMessage + { + public int ActorId; // DynamicID of the Actor to be moved + public Vector3D Start; // Starting position of the movement + public Vector3D Velocity; // Velocity vector, added to actor position every tick + public int Field3; // Some sort of move enum, varies depending on type of movement + public int FlyingAnimationTagID; // TagID of the flying animation or -1 + public int LandingAnimationTagID; // TagID of the landing animation or -1 + public float Gravity; // Gravity, added to Velocity.Z every tick, so it needs to be <0. Smaller values effectively speed up the translate. + public int /* sno */ PowerSNO; // PowerSNO, usually whatever skill is activating the translate + public float Bounce; // if >0 client will do extra physics bouncing arc translates when actor lands, math isn't known yet + public float DestinationZ; // Once Actor.Position.Z reaches this value while landing the translate ends. + + // Some useful math for calculating arcs: + // TicksToArrival = current_tick + Math.sqrt(2 * height / +Gravity) * 2 + // Velocity.Z = +Gravity * Math.sqrt(2 * height / +Gravity) + // Actor.Position.Z = 0.5 * Gravity * (ticks*ticks) + Velicity.Z*ticks + Start.Z + + public ACDTranslateArcMessage() : base(Opcodes.ACDTranslateArcMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + ActorId = buffer.ReadInt(32); + Start = new Vector3D(); + Start.Parse(buffer); + Velocity = new Vector3D(); + Velocity.Parse(buffer); + Field3 = buffer.ReadInt(25); + FlyingAnimationTagID = buffer.ReadInt(21) + (-1); + LandingAnimationTagID = buffer.ReadInt(21) + (-1); + Gravity = buffer.ReadFloat32(); + PowerSNO = buffer.ReadInt(32); + Bounce = buffer.ReadFloat32(); + DestinationZ = buffer.ReadFloat32(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, ActorId); + Start.Encode(buffer); + Velocity.Encode(buffer); + buffer.WriteInt(25, Field3); + buffer.WriteInt(21, FlyingAnimationTagID - (-1)); + buffer.WriteInt(21, LandingAnimationTagID - (-1)); + buffer.WriteFloat32(Gravity); + buffer.WriteInt(32, PowerSNO); + buffer.WriteFloat32(Bounce); + buffer.WriteFloat32(DestinationZ); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ACDTranslateArcMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ActorId: 0x" + ActorId.ToString("X8")); + Start.AsText(b, pad); + Velocity.AsText(b, pad); + b.Append(' ', pad); b.AppendLine("Field3: 0x" + Field3.ToString("X8") + " (" + Field3 + ")"); + b.Append(' ', pad); b.AppendLine("FlyingAnimationTagID: 0x" + FlyingAnimationTagID.ToString("X8") + " (" + FlyingAnimationTagID + ")"); + b.Append(' ', pad); b.AppendLine("LandingAnimationTagID: 0x" + LandingAnimationTagID.ToString("X8") + " (" + LandingAnimationTagID + ")"); + b.Append(' ', pad); b.AppendLine("Gravity: " + Gravity.ToString("G")); + b.Append(' ', pad); b.AppendLine("PowerSNO: 0x" + PowerSNO.ToString("X8")); + b.Append(' ', pad); b.AppendLine("Bounce: " + Bounce.ToString("G")); + b.Append(' ', pad); b.AppendLine("DestinationZ: " + DestinationZ.ToString("G")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateDetPathMessage.cs b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateDetPathMessage.cs new file mode 100644 index 00000000..3997c177 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateDetPathMessage.cs @@ -0,0 +1,115 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Core.GS.Common.Types.Math; + +namespace Mooege.Net.GS.Message.Definitions.ACD +{ + [Message(Opcodes.ACDTranslateDetPathMessage)] + public class ACDTranslateDetPathMessage : GameMessage + { + public int Field0; + public int Field1; + public int Field2; + public int Field3; + public Vector3D Field4; + public float /* angle */ Field5; + public Vector3D Field6; + public int Field7; + public int Field8; + public int Field9; + public int /* sno */ Field10; + public int Field11; + public float Field12; + public float Field13; + public float Field14; + public float Field15; + + public ACDTranslateDetPathMessage() : base(Opcodes.ACDTranslateDetPathMessage) { } + + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(4); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadInt(32); + Field4 = new Vector3D(); + Field4.Parse(buffer); + Field5 = buffer.ReadFloat32(); + Field6 = new Vector3D(); + Field6.Parse(buffer); + Field7 = buffer.ReadInt(32); + Field8 = buffer.ReadInt(32); + Field9 = buffer.ReadInt(32); + Field10 = buffer.ReadInt(32); + Field11 = buffer.ReadInt(32); + Field12 = buffer.ReadFloat32(); + Field13 = buffer.ReadFloat32(); + Field14 = buffer.ReadFloat32(); + Field15 = buffer.ReadFloat32(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(4, Field1); + buffer.WriteInt(32, Field2); + buffer.WriteInt(32, Field3); + Field4.Encode(buffer); + buffer.WriteFloat32(Field5); + Field6.Encode(buffer); + buffer.WriteInt(32, Field7); + buffer.WriteInt(32, Field8); + buffer.WriteInt(32, Field9); + buffer.WriteInt(32, Field10); + buffer.WriteInt(32, Field11); + buffer.WriteFloat32(Field12); + buffer.WriteFloat32(Field13); + buffer.WriteFloat32(Field14); + buffer.WriteFloat32(Field15); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ACDTranslateDetPathMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8")); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', pad); b.AppendLine("Field3: 0x" + Field3.ToString("X8") + " (" + Field3 + ")"); + Field4.AsText(b, pad); + b.Append(' ', pad); b.AppendLine("Field5: " + Field5.ToString("G")); + Field6.AsText(b, pad); + b.Append(' ', pad); b.AppendLine("Field7: 0x" + Field7.ToString("X8") + " (" + Field7 + ")"); + b.Append(' ', pad); b.AppendLine("Field8: 0x" + Field8.ToString("X8") + " (" + Field8 + ")"); + b.Append(' ', pad); b.AppendLine("Field9: 0x" + Field9.ToString("X8") + " (" + Field9 + ")"); + b.Append(' ', pad); b.AppendLine("Field10: 0x" + Field10.ToString("X8")); + b.Append(' ', pad); b.AppendLine("Field11: 0x" + Field11.ToString("X8") + " (" + Field11 + ")"); + b.Append(' ', pad); b.AppendLine("Field12: " + Field12.ToString("G")); + b.Append(' ', pad); b.AppendLine("Field13: " + Field13.ToString("G")); + b.Append(' ', pad); b.AppendLine("Field14: " + Field14.ToString("G")); + b.Append(' ', pad); b.AppendLine("Field15: " + Field15.ToString("G")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateDetPathSinMessage.cs b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateDetPathSinMessage.cs new file mode 100644 index 00000000..8cbfe955 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateDetPathSinMessage.cs @@ -0,0 +1,116 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.ACD +{ + [Message(Opcodes.ACDTranslateDetPathSinMessage)] + public class ACDTranslateDetPathSinMessage : GameMessage + { + public int Field0; + public int Field1; + public int Field2; + public int Field3; + public Vector3D Field4; + public float /* angle */ Field5; + public Vector3D Field6; + public int Field7; + public int Field8; + public int Field9; + public int /* sno */ Field10; + public int Field11; + public float Field12; + public float Field13; + public DPathSinData Field14; + + public ACDTranslateDetPathSinMessage() : base(Opcodes.ACDTranslateDetPathSinMessage) { } + + + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(4); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadInt(32); + Field4 = new Vector3D(); + Field4.Parse(buffer); + Field5 = buffer.ReadFloat32(); + Field6 = new Vector3D(); + Field6.Parse(buffer); + Field7 = buffer.ReadInt(32); + Field8 = buffer.ReadInt(32); + Field9 = buffer.ReadInt(32); + Field10 = buffer.ReadInt(32); + Field11 = buffer.ReadInt(32); + Field12 = buffer.ReadFloat32(); + Field13 = buffer.ReadFloat32(); + Field14 = new DPathSinData(); + Field14.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(4, Field1); + buffer.WriteInt(32, Field2); + buffer.WriteInt(32, Field3); + Field4.Encode(buffer); + buffer.WriteFloat32(Field5); + Field6.Encode(buffer); + buffer.WriteInt(32, Field7); + buffer.WriteInt(32, Field8); + buffer.WriteInt(32, Field9); + buffer.WriteInt(32, Field10); + buffer.WriteInt(32, Field11); + buffer.WriteFloat32(Field12); + buffer.WriteFloat32(Field13); + Field14.Encode(buffer); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ACDTranslateDetPathSinMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8")); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', pad); b.AppendLine("Field3: 0x" + Field3.ToString("X8") + " (" + Field3 + ")"); + Field4.AsText(b, pad); + b.Append(' ', pad); b.AppendLine("Field5: " + Field5.ToString("G")); + Field6.AsText(b, pad); + b.Append(' ', pad); b.AppendLine("Field7: 0x" + Field7.ToString("X8") + " (" + Field7 + ")"); + b.Append(' ', pad); b.AppendLine("Field8: 0x" + Field8.ToString("X8") + " (" + Field8 + ")"); + b.Append(' ', pad); b.AppendLine("Field9: 0x" + Field9.ToString("X8") + " (" + Field9 + ")"); + b.Append(' ', pad); b.AppendLine("Field10: 0x" + Field10.ToString("X8")); + b.Append(' ', pad); b.AppendLine("Field11: 0x" + Field11.ToString("X8") + " (" + Field11 + ")"); + b.Append(' ', pad); b.AppendLine("Field12: " + Field12.ToString("G")); + b.Append(' ', pad); b.AppendLine("Field13: " + Field13.ToString("G")); + Field14.AsText(b, pad); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateDetPathSpiralMessage.cs b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateDetPathSpiralMessage.cs new file mode 100644 index 00000000..1066b058 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateDetPathSpiralMessage.cs @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.ACD +{ + [Message(Opcodes.ACDTranslateDetPathSpiralMessage)] + public class ACDTranslateDetPathSpiralMessage : GameMessage + { + public int Field0; + public Vector3D Field1; + public Vector3D Field2; + public int Field3; + public int Field4; + public int Field5; + public DPathSinData Field6; + + public ACDTranslateDetPathSpiralMessage() : base(Opcodes.ACDTranslateDetPathSpiralMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = new Vector3D(); + Field1.Parse(buffer); + Field2 = new Vector3D(); + Field2.Parse(buffer); + Field3 = buffer.ReadInt(32); + Field4 = buffer.ReadInt(32); + Field5 = buffer.ReadInt(32); + Field6 = new DPathSinData(); + Field6.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + Field1.Encode(buffer); + Field2.Encode(buffer); + buffer.WriteInt(32, Field3); + buffer.WriteInt(32, Field4); + buffer.WriteInt(32, Field5); + Field6.Encode(buffer); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ACDTranslateDetPathSpiralMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8")); + Field1.AsText(b, pad); + Field2.AsText(b, pad); + b.Append(' ', pad); b.AppendLine("Field3: 0x" + Field3.ToString("X8") + " (" + Field3 + ")"); + b.Append(' ', pad); b.AppendLine("Field4: 0x" + Field4.ToString("X8") + " (" + Field4 + ")"); + b.Append(' ', pad); b.AppendLine("Field5: 0x" + Field5.ToString("X8") + " (" + Field5 + ")"); + Field6.AsText(b, pad); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateFacingMessage.cs b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateFacingMessage.cs new file mode 100644 index 00000000..b37faf74 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateFacingMessage.cs @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.ACD +{ + /// + /// Server -> Client + /// + /// Sent to rotate an actor (most likely around the world z axis, not the actor rotation axis?) + /// + [Message(Opcodes.ACDTranslateFacingMessage)] + public class ACDTranslateFacingMessage : GameMessage + { + /// + /// Id of the player actor + /// + public uint ActorId; + + /// + /// Angle between actor X axis and world X axis in radians + /// + public float Angle; + + /// + /// Sets whether the player turned immediatly or smoothly + /// + public bool TurnImmediately; + + public ACDTranslateFacingMessage() : base(Opcodes.ACDTranslateFacingMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + ActorId = buffer.ReadUInt(32); + Angle = buffer.ReadFloat32(); + TurnImmediately = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ActorId); + buffer.WriteFloat32(Angle); + buffer.WriteBool(TurnImmediately); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ACDTranslateFacingMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ActorID: 0x" + ActorId.ToString("X8")); + b.Append(' ', pad); b.AppendLine("Angle: " + Angle.ToString("G")); + b.Append(' ', pad); b.AppendLine("Immediately: " + (TurnImmediately ? "true" : "false")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateFixedMessage.cs b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateFixedMessage.cs new file mode 100644 index 00000000..ba25228d --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateFixedMessage.cs @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Text; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.ACD +{ + /// + /// Sent to the client to indefinitly translate an actor in a given direction. + /// + [Message(Opcodes.ACDTranslateFixedMessage)] + public class ACDTranslateFixedMessage : GameMessage + { + public int ActorId; + public Vector3D Velocity; // Velocity in game units per game tick + public int Field2; + public int AnimationTag; // Animation used during movement + public int /* sno */ Field4; + + public ACDTranslateFixedMessage() : base(Opcodes.ACDTranslateFixedMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + ActorId = buffer.ReadInt(32); + Velocity = new Vector3D(); + Velocity.Parse(buffer); + Field2 = buffer.ReadInt(25); + AnimationTag = buffer.ReadInt(21) + (-1); + Field4 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, ActorId); + Velocity.Encode(buffer); + buffer.WriteInt(25, Field2); + buffer.WriteInt(21, AnimationTag - (-1)); + buffer.WriteInt(32, Field4); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ACDTranslateFixedMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ActorId: 0x" + ActorId.ToString("X8")); + Velocity.AsText(b, pad); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', pad); b.AppendLine("AnimationTag: 0x" + AnimationTag.ToString("X8") + " (" + AnimationTag + ")"); + b.Append(' ', pad); b.AppendLine("Field4: 0x" + Field4.ToString("X8")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateFixedUpdateMessage.cs b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateFixedUpdateMessage.cs new file mode 100644 index 00000000..519b67ce --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateFixedUpdateMessage.cs @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Core.GS.Common.Types.Math; + +namespace Mooege.Net.GS.Message.Definitions.ACD +{ + [Message(Opcodes.ACDTranslateFixedUpdateMessage)] + public class ACDTranslateFixedUpdateMessage : GameMessage + { + public int Field0; + public Vector3D Field1; + public Vector3D Field2; + + public ACDTranslateFixedUpdateMessage() : base(Opcodes.ACDTranslateFixedUpdateMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = new Vector3D(); + Field1.Parse(buffer); + Field2 = new Vector3D(); + Field2.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + Field1.Encode(buffer); + Field2.Encode(buffer); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ACDTranslateFixedUpdateMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8")); + Field1.AsText(b, pad); + Field2.AsText(b, pad); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateNormalMessage.cs b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateNormalMessage.cs new file mode 100644 index 00000000..cdd5842f --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateNormalMessage.cs @@ -0,0 +1,179 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Core.GS.Common.Types.Math; + +namespace Mooege.Net.GS.Message.Definitions.ACD +{ + [Message(Opcodes.ACDTranslateNormalMessage)] + public class ACDTranslateNormalMessage : GameMessage + { + public int ActorId; + public Vector3D Position; // New position of the Actor + public float? Angle; // Angle between actors X axis and world x axis in radians + public bool? TurnImmediately; // maybe immediatly rotating like in TranslateFacing? - farmy + public float? Speed; // Speed of the actor while moving, if moving. In game units / tick + public int? Field5; + public int? AnimationTag; // Animation used while moving, if moving + public int? Field7; + public int? Field8; + public int? Field9; + + public ACDTranslateNormalMessage() : base(Opcodes.ACDTranslateNormalMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + ActorId = buffer.ReadInt(32); + if (buffer.ReadBool()) + { + Position = new Vector3D(); + Position.Parse(buffer); + } + if (buffer.ReadBool()) + { + Angle = buffer.ReadFloat32(); + } + if (buffer.ReadBool()) + { + TurnImmediately = buffer.ReadBool(); + } + if (buffer.ReadBool()) + { + Speed = buffer.ReadFloat32(); + } + if (buffer.ReadBool()) + { + Field5 = buffer.ReadInt(25); + } + if (buffer.ReadBool()) + { + AnimationTag = buffer.ReadInt(21) + (-1); + } + if (buffer.ReadBool()) + { + Field7 = buffer.ReadInt(32); + } + if (buffer.ReadBool()) + { + Field8 = buffer.ReadInt(32); + } + if (buffer.ReadBool()) + { + Field9 = buffer.ReadInt(16); + } + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, ActorId); + buffer.WriteBool(Position != null); + if (Position != null) + { + Position.Encode(buffer); + } + buffer.WriteBool(Angle.HasValue); + if (Angle.HasValue) + { + buffer.WriteFloat32(Angle.Value); + } + buffer.WriteBool(TurnImmediately.HasValue); + if (TurnImmediately.HasValue) + { + buffer.WriteBool(TurnImmediately.Value); + } + buffer.WriteBool(Speed.HasValue); + if (Speed.HasValue) + { + buffer.WriteFloat32(Speed.Value); + } + buffer.WriteBool(Field5.HasValue); + if (Field5.HasValue) + { + buffer.WriteInt(25, Field5.Value); + } + buffer.WriteBool(AnimationTag.HasValue); + if (AnimationTag.HasValue) + { + buffer.WriteInt(21, AnimationTag.Value - (-1)); + } + buffer.WriteBool(Field7.HasValue); + if (Field7.HasValue) + { + buffer.WriteInt(32, Field7.Value); + } + buffer.WriteBool(Field8.HasValue); + if (Field8.HasValue) + { + buffer.WriteInt(32, Field8.Value); + } + buffer.WriteBool(Field9.HasValue); + if (Field9.HasValue) + { + buffer.WriteInt(16, Field9.Value); + } + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ACDTranslateNormalMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ActorId: 0x" + ActorId.ToString("X8")); + if (Position != null) + { + Position.AsText(b, pad); + } + if (Angle.HasValue) + { + b.Append(' ', pad); b.AppendLine("Angle.Value: " + Angle.Value.ToString("G")); + } + if (TurnImmediately.HasValue) + { + b.Append(' ', pad); b.AppendLine("Field3.Value: " + (TurnImmediately.Value ? "true" : "false")); + } + if (Speed.HasValue) + { + b.Append(' ', pad); b.AppendLine("Speed.Value: " + Speed.Value.ToString("G")); + } + if (Field5.HasValue) + { + b.Append(' ', pad); b.AppendLine("Field5.Value: 0x" + Field5.Value.ToString("X8") + " (" + Field5.Value + ")"); + } + if (AnimationTag.HasValue) + { + b.Append(' ', pad); b.AppendLine("AnimationTag.Value: 0x" + AnimationTag.Value.ToString("X8") + " (" + AnimationTag.Value + ")"); + } + if (Field7.HasValue) + { + b.Append(' ', pad); b.AppendLine("Field7.Value: 0x" + Field7.Value.ToString("X8") + " (" + Field7.Value + ")"); + } + if (Field8.HasValue) + { + b.Append(' ', pad); b.AppendLine("Field8.Value: 0x" + Field8.Value.ToString("X8") + " (" + Field8.Value + ")"); + } + if (Field9.HasValue) + { + b.Append(' ', pad); b.AppendLine("Field9.Value: 0x" + Field9.Value.ToString("X8") + " (" + Field9.Value + ")"); + } + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateSnappedMessage.cs b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateSnappedMessage.cs new file mode 100644 index 00000000..cdfcf1f6 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateSnappedMessage.cs @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Core.GS.Common.Types.Math; + +namespace Mooege.Net.GS.Message.Definitions.ACD +{ + [Message(Opcodes.ACDTranslateSnappedMessage)] + public class ACDTranslateSnappedMessage : GameMessage + { + public int ActorId; + public Vector3D Position; + public float /* angle */ Angle; + public bool Field3; + public int Field4; + public int? Field5; + + public ACDTranslateSnappedMessage() : base(Opcodes.ACDTranslateSnappedMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + ActorId = buffer.ReadInt(32); + Position = new Vector3D(); + Position.Parse(buffer); + Angle = buffer.ReadFloat32(); + Field3 = buffer.ReadBool(); + Field4 = buffer.ReadInt(25); + if (buffer.ReadBool()) + { + Field5 = buffer.ReadInt(16); + } + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, ActorId); + Position.Encode(buffer); + buffer.WriteFloat32(Angle); + buffer.WriteBool(Field3); + buffer.WriteInt(25, Field4); + buffer.WriteBool(Field5.HasValue); + if (Field5.HasValue) + { + buffer.WriteInt(16, Field5.Value); + } + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ACDTranslateSnappedMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + ActorId.ToString("X8")); + Position.AsText(b, pad); + b.Append(' ', pad); b.AppendLine("Angle: " + Angle.ToString("G")); + b.Append(' ', pad); b.AppendLine("Field3: " + (Field3 ? "true" : "false")); + b.Append(' ', pad); b.AppendLine("Field4: 0x" + Field4.ToString("X8") + " (" + Field4 + ")"); + if (Field5.HasValue) + { + b.Append(' ', pad); b.AppendLine("Field5.Value: 0x" + Field5.Value.ToString("X8") + " (" + Field5.Value + ")"); + } + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateSyncMessage.cs b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateSyncMessage.cs new file mode 100644 index 00000000..3e1e13b1 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateSyncMessage.cs @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Core.GS.Common.Types.Math; + +namespace Mooege.Net.GS.Message.Definitions.ACD +{ + [Message(Opcodes.ACDTranslateSyncMessage)] + public class ACDTranslateSyncMessage : GameMessage + { + public int Field0; + public Vector3D Field1; + public bool? Field2; + public int? Field3; + + public ACDTranslateSyncMessage() : base(Opcodes.ACDTranslateSyncMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = new Vector3D(); + Field1.Parse(buffer); + if (buffer.ReadBool()) + { + Field2 = buffer.ReadBool(); + } + if (buffer.ReadBool()) + { + Field3 = buffer.ReadInt(16); + } + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + Field1.Encode(buffer); + buffer.WriteBool(Field2.HasValue); + if (Field2.HasValue) + { + buffer.WriteBool(Field2.Value); + } + buffer.WriteBool(Field3.HasValue); + if (Field3.HasValue) + { + buffer.WriteInt(15, Field3.Value); + } + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ACDTranslateSyncMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8")); + Field1.AsText(b, pad); + if (Field2.HasValue) + { + b.Append(' ', pad); b.AppendLine("Field2.Value: " + (Field2.Value ? "true" : "false")); + } + if (Field3.HasValue) + { + b.Append(' ', pad); b.AppendLine("Field3.Value: 0x" + Field3.Value.ToString("X8") + " (" + Field3.Value + ")"); + } + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/ACD/ACDWorldPositionMessage.cs b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDWorldPositionMessage.cs new file mode 100644 index 00000000..13e36990 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDWorldPositionMessage.cs @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.ACD +{ + [Message(Opcodes.ACDWorldPositionMessage)] + public class ACDWorldPositionMessage : GameMessage + { + public uint ActorID; // Actor's DynamicID + public WorldLocationMessageData WorldLocation; + + public ACDWorldPositionMessage() : base(Opcodes.ACDWorldPositionMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + ActorID = buffer.ReadUInt(32); + WorldLocation = new WorldLocationMessageData(); + WorldLocation.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ActorID); + WorldLocation.Encode(buffer); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ACDWorldPositionMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ActorID: 0x" + ActorID.ToString("X8") + " (" + ActorID + ")"); + WorldLocation.AsText(b, pad); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Act/ActTransitionMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Act/ActTransitionMessage.cs new file mode 100644 index 00000000..390df98f --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Act/ActTransitionMessage.cs @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Act +{ + [Message(Opcodes.ActTransitionMessage)] + public class ActTransitionMessage : GameMessage + { + public int Field0; + public bool Field1; + + public ActTransitionMessage() : base(Opcodes.ActTransitionMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(10) + (-1); + Field1 = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(10, Field0 - (-1)); + buffer.WriteBool(Field1); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ActTransitionMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: " + (Field1 ? "true" : "false")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Act/ActTransitionStartedMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Act/ActTransitionStartedMessage.cs new file mode 100644 index 00000000..3181974b --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Act/ActTransitionStartedMessage.cs @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Act +{ + [Message(Opcodes.ActTransitionStartedMessage)] + public class ActTransitionStartedMessage : GameMessage + { + public int Field0; + public int Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ActTransitionStartedMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Actor/DebugActorTooltipMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Actor/DebugActorTooltipMessage.cs new file mode 100644 index 00000000..c83aab6a --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Actor/DebugActorTooltipMessage.cs @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Actor +{ + [Message(Opcodes.DebugActorTooltipMessage)] + public class DebugActorTooltipMessage : GameMessage + { + public int Field0; + public string Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadCharArray(512); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteCharArray(512, Field1); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("DebugActorTooltipMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: \"" + Field1 + "\""); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Actor/NotifyActorMovementMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Actor/NotifyActorMovementMessage.cs new file mode 100644 index 00000000..40b3a6c1 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Actor/NotifyActorMovementMessage.cs @@ -0,0 +1,155 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Actor +{ + /// + /// Sent by server to clients to notify about an actor movement. + /// + [Message(Opcodes.NotifyActorMovementMessage)] + public class NotifyActorMovementMessage : GameMessage + { + public int ActorId; + public Vector3D Position; // New position of the Actor + public float? Angle; // Angle between actors X axis and world x axis in radians + public bool? TurnImmediately; // maybe immediatly rotating like in TranslateFacing? - farmy + public float? Speed; // Speed of the actor while moving, if moving. In game units / tick + public int? Field5; + public int? AnimationTag; // Animation used while moving, if moving + public int? Field7; + + public NotifyActorMovementMessage():base(Opcodes.NotifyActorMovementMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + ActorId = buffer.ReadInt(32); + if (buffer.ReadBool()) + { + Position = new Vector3D(); + Position.Parse(buffer); + } + if (buffer.ReadBool()) + { + Angle = buffer.ReadFloat32(); + } + if (buffer.ReadBool()) + { + TurnImmediately = buffer.ReadBool(); + } + if (buffer.ReadBool()) + { + Speed = buffer.ReadFloat32(); + } + if (buffer.ReadBool()) + { + Field5 = buffer.ReadInt(25); + } + if (buffer.ReadBool()) + { + AnimationTag = buffer.ReadInt(21) + (-1); + } + if (buffer.ReadBool()) + { + Field7 = buffer.ReadInt(32); + } + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, ActorId); + buffer.WriteBool(Position != null); + if (Position != null) + { + Position.Encode(buffer); + } + buffer.WriteBool(Angle.HasValue); + if (Angle.HasValue) + { + buffer.WriteFloat32(Angle.Value); + } + buffer.WriteBool(TurnImmediately.HasValue); + if (TurnImmediately.HasValue) + { + buffer.WriteBool(TurnImmediately.Value); + } + buffer.WriteBool(Speed.HasValue); + if (Speed.HasValue) + { + buffer.WriteFloat32(Speed.Value); + } + buffer.WriteBool(Field5.HasValue); + if (Field5.HasValue) + { + buffer.WriteInt(25, Field5.Value); + } + buffer.WriteBool(AnimationTag.HasValue); + if (AnimationTag.HasValue) + { + buffer.WriteInt(21, AnimationTag.Value - (-1)); + } + buffer.WriteBool(Field7.HasValue); + if (Field7.HasValue) + { + buffer.WriteInt(32, Field7.Value); + } + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("NotifyActorMovementMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ActorId: 0x" + ActorId.ToString("X8")); + if (Position != null) + { + Position.AsText(b, pad); + } + if (Angle.HasValue) + { + b.Append(' ', pad); b.AppendLine("Angle.Value: " + Angle.Value.ToString("G")); + } + if (TurnImmediately.HasValue) + { + b.Append(' ', pad); b.AppendLine("Field3.Value: " + (TurnImmediately.Value ? "true" : "false")); + } + if (Speed.HasValue) + { + b.Append(' ', pad); b.AppendLine("Speed.Value: " + Speed.Value.ToString("G")); + } + if (Field5.HasValue) + { + b.Append(' ', pad); b.AppendLine("Field5.Value: 0x" + Field5.Value.ToString("X8") + " (" + Field5.Value + ")"); + } + if (AnimationTag.HasValue) + { + b.Append(' ', pad); b.AppendLine("AnimationTag.Value: 0x" + AnimationTag.Value.ToString("X8") + " (" + AnimationTag.Value + ")"); + } + if (Field7.HasValue) + { + b.Append(' ', pad); b.AppendLine("Field7.Value: 0x" + Field7.Value.ToString("X8") + " (" + Field7.Value + ")"); + } + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Animation/LoopingAnimationPowerMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Animation/LoopingAnimationPowerMessage.cs new file mode 100644 index 00000000..f9e3005a --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Animation/LoopingAnimationPowerMessage.cs @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Inventory +{ + [Message(Opcodes.LoopingAnimationPowerMessage)] + class LoopingAnimationPowerMessage : GameMessage + { + public int snoPower; + public int snoData0; + public int Field2; + + public override void Parse(GameBitBuffer buffer) + { + snoPower = buffer.ReadInt(32); + snoData0 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, snoPower); + buffer.WriteInt(32, snoData0); + buffer.WriteInt(32, Field2); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("LoopingAnimationPowerMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("snoPower: 0x" + snoPower.ToString("X8") + " (" + snoPower + ")"); + b.Append(' ', pad); b.AppendLine("snoData0: 0x" + snoData0.ToString("X8") + " (" + snoData0 + ")"); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Animation/PlayAnimationMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Animation/PlayAnimationMessage.cs new file mode 100644 index 00000000..f532f559 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Animation/PlayAnimationMessage.cs @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Animation +{ + [Message(Opcodes.PlayAnimationMessage)] + public class PlayAnimationMessage : GameMessage + { + public uint ActorID; + public int Field1; + public float Field2; + // MaxLength = 3 + public PlayAnimationMessageSpec[] tAnim; + + public PlayAnimationMessage() : base(Opcodes.PlayAnimationMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + ActorID = buffer.ReadUInt(32); + Field1 = buffer.ReadInt(4); + Field2 = buffer.ReadFloat32(); + tAnim = new PlayAnimationMessageSpec[buffer.ReadInt(2)]; + for (int i = 0; i < tAnim.Length; i++) { tAnim[i] = new PlayAnimationMessageSpec(); tAnim[i].Parse(buffer); } + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ActorID); + buffer.WriteInt(4, Field1); + buffer.WriteFloat32(Field2); + buffer.WriteInt(2, tAnim.Length); + for (int i = 0; i < tAnim.Length; i++) { tAnim[i].Encode(buffer); } + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("PlayAnimationMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ActorID: 0x" + ActorID.ToString("X8") + " (" + ActorID + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); b.AppendLine("Field2: " + Field2.ToString("G")); + b.Append(' ', pad); b.AppendLine("tAnim:"); + b.Append(' ', pad); b.AppendLine("{"); + for (int i = 0; i < tAnim.Length; i++) { tAnim[i].AsText(b, pad + 1); b.AppendLine(); } + b.Append(' ', pad); b.AppendLine("}"); b.AppendLine(); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Animation/SecondaryAnimationPowerMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Animation/SecondaryAnimationPowerMessage.cs new file mode 100644 index 00000000..ae2e1575 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Animation/SecondaryAnimationPowerMessage.cs @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Common.Helpers; +using Mooege.Core.GS.Skills; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Animation +{ + [Message(Opcodes.SecondaryAnimationPowerMessage, Consumers.Player)] + public class SecondaryAnimationPowerMessage : GameMessage + { + public int /* sno */ PowerSNO; + public AnimPreplayData Field1; + + public override void Parse(GameBitBuffer buffer) + { + PowerSNO = buffer.ReadInt(32); + if (buffer.ReadBool()) + { + Field1 = new AnimPreplayData(); + Field1.Parse(buffer); + } + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, PowerSNO); + buffer.WriteBool(Field1 != null); + if (Field1 != null) + { + Field1.Encode(buffer); + } + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("SecondaryAnimationPowerMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("PowerSNO: 0x" + PowerSNO.ToString("X8")); + if (Field1 != null) + { + Field1.AsText(b, pad); + } + b.Append(' ', --pad); + b.AppendLine("}"); + } + } + +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Animation/SetIdleAnimationMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Animation/SetIdleAnimationMessage.cs new file mode 100644 index 00000000..a13b7c24 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Animation/SetIdleAnimationMessage.cs @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Animation +{ + [Message(Opcodes.SetIdleAnimationMessage)] + public class SetIdleAnimationMessage : GameMessage + { + public uint ActorID; + public int AnimationSNO; + + public SetIdleAnimationMessage() : base(Opcodes.SetIdleAnimationMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + ActorID = buffer.ReadUInt(32); + AnimationSNO = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ActorID); + buffer.WriteInt(32, AnimationSNO); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("SetIdleAnimationMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ActorID: 0x" + ActorID.ToString("X8") + " (" + ActorID + ")"); + b.Append(' ', pad); b.AppendLine("AnimationSNO: 0x" + AnimationSNO.ToString("X8") + " (" + AnimationSNO + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Artisan/ArtisanWindowClosedMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Artisan/ArtisanWindowClosedMessage.cs new file mode 100644 index 00000000..e5b641d5 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Artisan/ArtisanWindowClosedMessage.cs @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Artisan +{ + [Message(Opcodes.ArtisanWindowClosedMessage)] + public class ArtisanWindowClosedMessage : GameMessage + { + + public override void Parse(GameBitBuffer buffer) + { + } + + public override void Encode(GameBitBuffer buffer) + { + throw new NotImplementedException(); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ArtisanWindowClosedMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Artisan/BlacksmithDataInitialMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Artisan/BlacksmithDataInitialMessage.cs new file mode 100644 index 00000000..75a58330 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Artisan/BlacksmithDataInitialMessage.cs @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using D3.ItemCrafting; + +namespace Mooege.Net.GS.Message.Definitions.Artisan +{ + [Message(new Opcodes[] { Opcodes.BlacksmithDataInitialMessage })] + public class BlacksmithDataInitialMessage : GameMessage + { + + public CrafterData CrafterData; + + public BlacksmithDataInitialMessage() : base(Opcodes.BlacksmithDataProgressMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + CrafterData = CrafterData.ParseFrom(buffer.ReadBlob(32)); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteBlob(32, CrafterData.ToByteArray()); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("BlacksmithDataInitialMessage:"); + b.Append(' ', pad++); + b.Append(CrafterData.ToString()); + } + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Artisan/BlacksmithDataProgressMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Artisan/BlacksmithDataProgressMessage.cs new file mode 100644 index 00000000..2b31114b --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Artisan/BlacksmithDataProgressMessage.cs @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using D3.ItemCrafting; + +namespace Mooege.Net.GS.Message.Definitions.Artisan +{ + [Message(new Opcodes[] { Opcodes.BlacksmithDataProgressMessage })] + public class BlacksmithDataProgressMessage : GameMessage + { + + public CrafterData CrafterData; + + public BlacksmithDataProgressMessage() : base(Opcodes.BlacksmithDataProgressMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + CrafterData = CrafterData.ParseFrom(buffer.ReadBlob(32)); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteBlob(32, CrafterData.ToByteArray()); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("BlacksmithDataProgressMessage:"); + b.Append(' ', pad++); + b.Append(CrafterData.ToString()); + } + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Artisan/CraftInteractionMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Artisan/CraftInteractionMessage.cs new file mode 100644 index 00000000..6df73ce0 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Artisan/CraftInteractionMessage.cs @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Artisan +{ + [Message(Opcodes.CraftInteractionMessage, Consumers.SelectedNPC)] + public class CraftInteractionMessage : GameMessage + { + public CraftInteractionMessage() + : base(Opcodes.CraftInteractionMessage) + { + } + + public override void Parse(GameBitBuffer buffer) + { + } + + public override void Encode(GameBitBuffer buffer) + { + throw new NotImplementedException(); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("CraftInteractionMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} + diff --git a/src/Mooege/Net/GS/Message/Definitions/Artisan/CrafterLevelUpMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Artisan/CrafterLevelUpMessage.cs new file mode 100644 index 00000000..ca596ec4 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Artisan/CrafterLevelUpMessage.cs @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Artisan +{ + [Message(Opcodes.CrafterLevelUpMessage)] + public class CrafterLevelUpMessage : GameMessage + { + public int Field0; + public int Field1; + public int Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("CrafterLevelUpMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Artisan/CraftingResultsMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Artisan/CraftingResultsMessage.cs new file mode 100644 index 00000000..8098054e --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Artisan/CraftingResultsMessage.cs @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Artisan +{ + [Message(Opcodes.CraftingResultsMessage)] + public class CraftingResultsMessage : GameMessage + { + public int Field0; + public int /* gbid */ Field1; + public int Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("CraftingResultsMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8")); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Artisan/EnchantItemMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Artisan/EnchantItemMessage.cs new file mode 100644 index 00000000..98738def --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Artisan/EnchantItemMessage.cs @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Artisan +{ + [Message(Opcodes.EnchantItemMessage)] + public class EnchantItemMessage : GameMessage + { + public int Field0; + public int /* gbid */ Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("EnchantItemMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Artisan/JewelerDataInitialMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Artisan/JewelerDataInitialMessage.cs new file mode 100644 index 00000000..eb7500f8 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Artisan/JewelerDataInitialMessage.cs @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using D3.ItemCrafting; + +namespace Mooege.Net.GS.Message.Definitions.Artisan +{ + [Message(new Opcodes[] { Opcodes.JewelerDataInitialMessage })] + public class JewelerDataInitialMessage : GameMessage + { + + public CrafterData CrafterData; + + public JewelerDataInitialMessage() : base(Opcodes.JewelerDataInitialMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + CrafterData = CrafterData.ParseFrom(buffer.ReadBlob(32)); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteBlob(32, CrafterData.ToByteArray()); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("JewelerDataInitialMessage:"); + b.Append(' ', pad++); + b.Append(CrafterData.ToString()); + } + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Artisan/JewelerDataProgressMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Artisan/JewelerDataProgressMessage.cs new file mode 100644 index 00000000..1f3cdb3a --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Artisan/JewelerDataProgressMessage.cs @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using D3.ItemCrafting; + +namespace Mooege.Net.GS.Message.Definitions.Artisan +{ + [Message(new Opcodes[] { Opcodes.JewelerDataProgressMessage })] + public class JewelerDataProgressMessage : GameMessage + { + + public CrafterData CrafterData; + + public JewelerDataProgressMessage() : base(Opcodes.JewelerDataProgressMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + CrafterData = CrafterData.ParseFrom(buffer.ReadBlob(32)); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteBlob(32, CrafterData.ToByteArray()); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("JewelerDataProgressMessage:"); + b.Append(' ', pad++); + b.Append(CrafterData.ToString()); + } + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Artisan/MysticDataInitialMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Artisan/MysticDataInitialMessage.cs new file mode 100644 index 00000000..f9b77ba7 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Artisan/MysticDataInitialMessage.cs @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using D3.ItemCrafting; + +namespace Mooege.Net.GS.Message.Definitions.Artisan +{ + [Message(Opcodes.MysticDataInitialMessage)] + public class MysticDataInitialMessage : GameMessage + { + public CrafterData CrafterData; + + public MysticDataInitialMessage() : base(Opcodes.MysticDataInitialMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + CrafterData = CrafterData.ParseFrom(buffer.ReadBlob(32)); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteBlob(32, CrafterData.ToByteArray()); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("MysticDataInitialMessage:"); + b.Append(' ', pad++); + b.Append(CrafterData.ToString()); + } + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Artisan/MysticDataProgressMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Artisan/MysticDataProgressMessage.cs new file mode 100644 index 00000000..3a0b70c7 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Artisan/MysticDataProgressMessage.cs @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using D3.ItemCrafting; + +namespace Mooege.Net.GS.Message.Definitions.Artisan +{ + [Message(Opcodes.MysticDataProgressMessage)] + public class MysticDataProgressMessage : GameMessage + { + public CrafterData CrafterData; + + public MysticDataProgressMessage() : base(Opcodes.MysticDataProgressMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + CrafterData = CrafterData.ParseFrom(buffer.ReadBlob(32)); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteBlob(32, CrafterData.ToByteArray()); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("MysticDataProgressMessage:"); + b.Append(' ', pad++); + b.Append(CrafterData.ToString()); + } + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Artisan/OpenArtisanWindowMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Artisan/OpenArtisanWindowMessage.cs new file mode 100644 index 00000000..735fc761 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Artisan/OpenArtisanWindowMessage.cs @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Artisan +{ + /// + /// Shows Artisans UI window. + /// + [Message(Opcodes.OpenArtisanWindowMessage)] + public class OpenArtisanWindowMessage : GameMessage + { + public uint ArtisanID; + public OpenArtisanWindowMessage() + : base(Opcodes.OpenArtisanWindowMessage) + { } + + public override void Parse(GameBitBuffer buffer) + { + ArtisanID = buffer.ReadUInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ArtisanID); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("OpenArtisanWindowMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ArtisanID: 0x" + ArtisanID.ToString("X8") + " (" + ArtisanID + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Artisan/RequestAddSocketMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Artisan/RequestAddSocketMessage.cs new file mode 100644 index 00000000..36b12bd2 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Artisan/RequestAddSocketMessage.cs @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Artisan +{ + //[Message(Opcodes.RequestAddSocketMessage, Consumers.Player)] + public class RequestAddSocketMessage : GameMessage + { + public uint ItemID; + + public override void Parse(GameBitBuffer buffer) + { + ItemID = buffer.ReadUInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ItemID); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("RequestAddSocketMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ItemID: 0x" + ItemID.ToString("X8") + " (" + ItemID + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + } + +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Artisan/TrainArtisanMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Artisan/TrainArtisanMessage.cs new file mode 100644 index 00000000..4986e07d --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Artisan/TrainArtisanMessage.cs @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Artisan +{ + [Message(Opcodes.RequestTrainArtisanMessage)] + public class RequestTrainArtisanMessage : GameMessage + { + public override void Parse(GameBitBuffer buffer) + { + } + + public override void Encode(GameBitBuffer buffer) + { + throw new NotImplementedException(); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("RequestTrainArtisanMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Attribute/AttributeSetValueMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Attribute/AttributeSetValueMessage.cs new file mode 100644 index 00000000..f37855ad --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Attribute/AttributeSetValueMessage.cs @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Attribute +{ + [Message(Opcodes.AttributeSetValueMessage)] + public class AttributeSetValueMessage : GameMessage + { + public uint ActorID; // Actor's DynamicID + public NetAttributeKeyValue Field1; + + public AttributeSetValueMessage() : base(Opcodes.AttributeSetValueMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + ActorID = buffer.ReadUInt(32); + Field1 = new NetAttributeKeyValue(); + Field1.Parse(buffer); + Field1.ParseValue(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ActorID); + Field1.Encode(buffer); + Field1.EncodeValue(buffer); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("AttributeSetValueMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ActorID: 0x" + ActorID.ToString("X8") + " (" + ActorID + ")"); + Field1.AsText(b, pad); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Attribute/AttributesSetValuesMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Attribute/AttributesSetValuesMessage.cs new file mode 100644 index 00000000..e7ab20c0 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Attribute/AttributesSetValuesMessage.cs @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Attribute +{ + [Message(Opcodes.AttributesSetValuesMessage)] + public class AttributesSetValuesMessage : GameMessage + { + public uint ActorID; // Actor's DynamicID + public NetAttributeKeyValue[] atKeyVals; // MaxLength = 15 + + public AttributesSetValuesMessage() : base(Opcodes.AttributesSetValuesMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + ActorID = buffer.ReadUInt(32); + atKeyVals = new NetAttributeKeyValue[buffer.ReadInt(4)]; + for (int i = 0; i < atKeyVals.Length; i++) { atKeyVals[i] = new NetAttributeKeyValue(); atKeyVals[i].Parse(buffer); } + for (int i = 0; i < atKeyVals.Length; i++) { atKeyVals[i].ParseValue(buffer); } + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ActorID); + buffer.WriteInt(4, atKeyVals.Length); + for (int i = 0; i < atKeyVals.Length; i++) { atKeyVals[i].Encode(buffer); } + for (int i = 0; i < atKeyVals.Length; i++) { atKeyVals[i].EncodeValue(buffer); } + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("AttributesSetValuesMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ActorID: 0x" + ActorID.ToString("X8") + " (" + ActorID + ")"); + b.Append(' ', pad); b.AppendLine("atKeyVals:"); + b.Append(' ', pad); b.AppendLine("{"); + for (int i = 0; i < atKeyVals.Length; i++) { atKeyVals[i].AsText(b, pad + 1); b.AppendLine(); } + b.Append(' ', pad); b.AppendLine("}"); b.AppendLine(); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Audio/PlayErrorSoundMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Audio/PlayErrorSoundMessage.cs new file mode 100644 index 00000000..a93b226e --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Audio/PlayErrorSoundMessage.cs @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Audio +{ + [Message(Opcodes.PlayErrorSoundMessage)] + public class PlayErrorSoundMessage : GameMessage + { + public int Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("PlayErrorSoundMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Audio/PlayMusicMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Audio/PlayMusicMessage.cs new file mode 100644 index 00000000..c22da7e7 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Audio/PlayMusicMessage.cs @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Audio +{ + [Message(Opcodes.PlayMusicMessage)] + public class PlayMusicMessage : GameMessage + { + public int /* sno */ snoMusic; + + public override void Parse(GameBitBuffer buffer) + { + snoMusic = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, snoMusic); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("PlayMusicMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("snoMusic: 0x" + snoMusic.ToString("X8")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Audio/PlayNonPositionalSoundMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Audio/PlayNonPositionalSoundMessage.cs new file mode 100644 index 00000000..4ea7a648 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Audio/PlayNonPositionalSoundMessage.cs @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Audio +{ + [Message(Opcodes.PlayNonPositionalSoundMessage)] + public class PlayNonPositionalSoundMessage : GameMessage + { + public int /* sno */ Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("PlayNonPositionalSoundMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Camera/BossZoomMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Camera/BossZoomMessage.cs new file mode 100644 index 00000000..433951c3 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Camera/BossZoomMessage.cs @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Camera +{ + [Message(Opcodes.BossZoomMessage)] + public class BossZoomMessage : GameMessage + { + public float Field0; + public float Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadFloat32(); + Field1 = buffer.ReadFloat32(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteFloat32(Field0); + buffer.WriteFloat32(Field1); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("BossZoomMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: " + Field0.ToString("G")); + b.Append(' ', pad); b.AppendLine("Field1: " + Field1.ToString("G")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Camera/CameraFocusMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Camera/CameraFocusMessage.cs new file mode 100644 index 00000000..b404eb1a --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Camera/CameraFocusMessage.cs @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Camera +{ + [Message(Opcodes.CameraFocusMessage)] + public class CameraFocusMessage : GameMessage + { + public int Field0; + public bool Field1; + public float Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadBool(); + Field2 = buffer.ReadFloat32(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteBool(Field1); + buffer.WriteFloat32(Field2); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("CameraFocusMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: " + (Field1 ? "true" : "false")); + b.Append(' ', pad); b.AppendLine("Field2: " + Field2.ToString("G")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Camera/CameraYawMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Camera/CameraYawMessage.cs new file mode 100644 index 00000000..e00a875e --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Camera/CameraYawMessage.cs @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Camera +{ + [Message(Opcodes.CameraYawMessage)] + public class CameraYawMessage : GameMessage + { + public float /* angle */ Field0; + public bool Field1; + public float Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadFloat32(); + Field1 = buffer.ReadBool(); + Field2 = buffer.ReadFloat32(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteFloat32(Field0); + buffer.WriteBool(Field1); + buffer.WriteFloat32(Field2); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("CameraYawMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: " + Field0.ToString("G")); + b.Append(' ', pad); b.AppendLine("Field1: " + (Field1 ? "true" : "false")); + b.Append(' ', pad); b.AppendLine("Field2: " + Field2.ToString("G")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Camera/CameraZoomMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Camera/CameraZoomMessage.cs new file mode 100644 index 00000000..1ef6aa4a --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Camera/CameraZoomMessage.cs @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Camera +{ + [Message(Opcodes.CameraZoomMessage)] + public class CameraZoomMessage : GameMessage + { + public float Field0; + public bool Field1; + public float Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadFloat32(); + Field1 = buffer.ReadBool(); + Field2 = buffer.ReadFloat32(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteFloat32(Field0); + buffer.WriteBool(Field1); + buffer.WriteFloat32(Field2); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("CameraZoomMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: " + Field0.ToString("G")); + b.Append(' ', pad); b.AppendLine("Field1: " + (Field1 ? "true" : "false")); + b.Append(' ', pad); b.AppendLine("Field2: " + Field2.ToString("G")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Chat/ChatMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Chat/ChatMessage.cs new file mode 100644 index 00000000..66a784b0 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Chat/ChatMessage.cs @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Chat +{ + [Message(Opcodes.ChatMessage)] + public class ChatMessage : GameMessage + { + public int Field0; + public int Field1; + public string Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(2); + Field1 = buffer.ReadInt(4) + (-1); + Field2 = buffer.ReadCharArray(512); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(2, Field0); + buffer.WriteInt(4, Field1 - (-1)); + buffer.WriteCharArray(512, Field2); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ChatMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); b.AppendLine("Field2: \"" + Field2 + "\""); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Chat/TryChatMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Chat/TryChatMessage.cs new file mode 100644 index 00000000..2fee6547 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Chat/TryChatMessage.cs @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Chat +{ + [Message(Opcodes.TryChatMessage)] + public class TryChatMessage : GameMessage + { + public int Field0; + public int Field1; + public string Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(3); + Field1 = buffer.ReadInt(4) + (-1); + Field2 = buffer.ReadCharArray(512); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(3, Field0); + buffer.WriteInt(4, Field1 - (-1)); + buffer.WriteCharArray(512, Field2); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("TryChatMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); b.AppendLine("Field2: \"" + Field2 + "\""); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Combat/AimTargetMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Combat/AimTargetMessage.cs new file mode 100644 index 00000000..700458b3 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Combat/AimTargetMessage.cs @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Combat +{ + [Message(Opcodes.AimTargetMessage)] + public class AimTargetMessage : GameMessage + { + public int Field0; + public int Field1; + public int Field2; + public WorldPlace Field3; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(3) + (-1); + Field2 = buffer.ReadInt(32); + Field3 = new WorldPlace(); + Field3.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(3, Field1 - (-1)); + buffer.WriteInt(32, Field2); + Field3.Encode(buffer); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("AimTargetMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + Field3.AsText(b, pad); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Combat/DeathFadeTimeMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Combat/DeathFadeTimeMessage.cs new file mode 100644 index 00000000..0f71604a --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Combat/DeathFadeTimeMessage.cs @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Combat +{ + [Message(Opcodes.DeathFadeTimeMessage)] + public class DeathFadeTimeMessage : GameMessage + { + public int Field0; + public int Field1; + public int Field2; + public bool Field3; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(11) + (-1); + Field2 = buffer.ReadInt(11); + Field3 = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(11, Field1 - (-1)); + buffer.WriteInt(11, Field2); + buffer.WriteBool(Field3); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("DeathFadeTimeMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', pad); b.AppendLine("Field3: " + (Field3 ? "true" : "false")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Combat/KillCountMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Combat/KillCountMessage.cs new file mode 100644 index 00000000..e5ded4a1 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Combat/KillCountMessage.cs @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Combat +{ + [Message(Opcodes.KillCountMessage)] + public class KillCountMessage : GameMessage + { + public int Field0; + public int Field1; + public int Field2; + public int Field3; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(3); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(3, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + buffer.WriteInt(32, Field3); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("KillCountMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', pad); b.AppendLine("Field3: 0x" + Field3.ToString("X8") + " (" + Field3 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Combat/KillCounterUpdateMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Combat/KillCounterUpdateMessage.cs new file mode 100644 index 00000000..3216ec57 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Combat/KillCounterUpdateMessage.cs @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Combat +{ + [Message(Opcodes.KillCounterUpdateMessage)] + public class KillCounterUpdateMessage : GameMessage + { + public int Field0; //Bonus-Type + /* + 0: Massacre + 1: Destruction + 2: Mighty Blow + 3: Pulverized + */ + public int Field1; //Monsters killed + public int Field2; //Expbonus + public bool Field3; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(2); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(2, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + buffer.WriteBool(Field3); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("KillCounterUpdateMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', pad); b.AppendLine("Field3: " + (Field3 ? "true" : "false")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Combat/LowHealthCombatMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Combat/LowHealthCombatMessage.cs new file mode 100644 index 00000000..7ae1d18b --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Combat/LowHealthCombatMessage.cs @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Combat +{ + [Message(Opcodes.LowHealthCombatMessage)] + public class LowHealthCombatMessage : GameMessage + { + public float Field0; + public int Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadFloat32(); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteFloat32(Field0); + buffer.WriteInt(32, Field1); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("LowHealthCombatMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: " + Field0.ToString("G")); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Combat/VictimMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Combat/VictimMessage.cs new file mode 100644 index 00000000..6e51d7d7 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Combat/VictimMessage.cs @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Combat +{ + [Message(Opcodes.VictimMessage)] + public class VictimMessage : GameMessage + { + public int Field0; + public int Field1; + public int Field2; + public int Field3; + public int /* sno */ snoKillerActor; + public int Field6; + // MaxLength = 2 + public int /* gbid */[] Field7; + public int /* sno */ snoPowerDmgSource; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(3); + Field1 = buffer.ReadInt(7); + Field2 = buffer.ReadInt(4) + (-1); + Field3 = buffer.ReadInt(4) + (-1); + snoKillerActor = buffer.ReadInt(32); + Field6 = buffer.ReadInt(5) + (-1); + Field7 = new int /* gbid */[2]; + for (int i = 0; i < Field7.Length; i++) Field7[i] = buffer.ReadInt(32); + snoPowerDmgSource = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(3, Field0); + buffer.WriteInt(7, Field1); + buffer.WriteInt(4, Field2 - (-1)); + buffer.WriteInt(4, Field3 - (-1)); + buffer.WriteInt(32, snoKillerActor); + buffer.WriteInt(5, Field6 - (-1)); + for (int i = 0; i < Field7.Length; i++) buffer.WriteInt(32, Field7[i]); + buffer.WriteInt(32, snoPowerDmgSource); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("VictimMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', pad); b.AppendLine("Field3: 0x" + Field3.ToString("X8") + " (" + Field3 + ")"); + b.Append(' ', pad); b.AppendLine("snoKillerActor: 0x" + snoKillerActor.ToString("X8")); + b.Append(' ', pad); b.AppendLine("Field6: 0x" + Field6.ToString("X8") + " (" + Field6 + ")"); + b.Append(' ', pad); b.AppendLine("Field7:"); + b.Append(' ', pad); b.AppendLine("{"); + for (int i = 0; i < Field7.Length; ) { b.Append(' ', pad + 1); for (int j = 0; j < 8 && i < Field7.Length; j++, i++) { b.Append("0x" + Field7[i].ToString("X8") + ", "); } b.AppendLine(); } + b.Append(' ', pad); b.AppendLine("}"); b.AppendLine(); + b.Append(' ', pad); b.AppendLine("snoPowerDmgSource: 0x" + snoPowerDmgSource.ToString("X8")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Connection/ConnectionEstablishedMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Connection/ConnectionEstablishedMessage.cs new file mode 100644 index 00000000..cda685c0 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Connection/ConnectionEstablishedMessage.cs @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Connection +{ + [Message(Opcodes.ConnectionEstablishedMessage)] + public class ConnectionEstablishedMessage : GameMessage + { + public int PlayerIndex; + public int Field1; + public int SNOPackHash; + + public ConnectionEstablishedMessage():base(Opcodes.ConnectionEstablishedMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + PlayerIndex = buffer.ReadInt(3); + Field1 = buffer.ReadInt(32); + SNOPackHash = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(3, PlayerIndex); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, SNOPackHash); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ConnectionEstablishedMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("PlayerIndex: 0x" + PlayerIndex.ToString("X8") + " (" + PlayerIndex + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + SNOPackHash.ToString("X8") + " (" + SNOPackHash + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } + +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Connection/LogoutComplete.cs b/src/Mooege/Net/GS/Message/Definitions/Connection/LogoutComplete.cs new file mode 100644 index 00000000..dc10e796 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Connection/LogoutComplete.cs @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Core.GS.Games; +using Mooege.Net.GS.Message.Definitions.Game; + +namespace Mooege.Net.GS.Message.Definitions.Connection +{ + [Message(Opcodes.LogoutComplete)] + public class LogoutComplete : GameMessage,ISelfHandler + { + public void Handle(GameClient client) + { + if (client.IsLoggingOut) + { + client.SendMessage(new QuitGameMessage() // should be sent to all players i guess /raist. + { + PlayerIndex = client.Player.PlayerIndex, + }); + + GameManager.RemovePlayerFromGame(client); + } + } + + public override void Parse(GameBitBuffer buffer) + { + + } + + public override void Encode(GameBitBuffer buffer) + { + + } + + public override void AsText(StringBuilder b, int pad) + { + + } + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Connection/LogoutContextMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Connection/LogoutContextMessage.cs new file mode 100644 index 00000000..e31a4def --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Connection/LogoutContextMessage.cs @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Connection +{ + [Message(new[] { Opcodes.LogoutContextMessage1, Opcodes.LogoutContextMessage2 })] + public class LogoutContextMessage : GameMessage,ISelfHandler + { + public bool Field0; + + public void Handle(GameClient client) + { + client.IsLoggingOut = !client.IsLoggingOut; + + if (client.IsLoggingOut) + { + client.SendMessage(new LogoutTickTimeMessage() + { + Field0 = false, // true - logout with party? + Ticks = 0, // delay 1, make this equal to 0 for instant logout + Field2 = 0, // delay 2 + }); + } + } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteBool(Field0); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("LogoutContextMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: " + (Field0 ? "true" : "false")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Connection/LogoutTickTimeMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Connection/LogoutTickTimeMessage.cs new file mode 100644 index 00000000..d7a90570 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Connection/LogoutTickTimeMessage.cs @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Connection +{ + [Message(Opcodes.LogoutTickTimeMessage)] + public class LogoutTickTimeMessage : GameMessage + { + public bool Field0; + public int Ticks; + public int Field2; + + public LogoutTickTimeMessage() : base(Opcodes.LogoutTickTimeMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadBool(); + Ticks = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteBool(Field0); + buffer.WriteInt(32, Ticks); + buffer.WriteInt(32, Field2); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("LogoutTickTimeMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: " + (Field0 ? "true" : "false")); + b.Append(' ', pad); b.AppendLine("Ticks: 0x" + Ticks.ToString("X8") + " (" + Ticks + ")"); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Console/TryConsoleCommand.cs b/src/Mooege/Net/GS/Message/Definitions/Console/TryConsoleCommand.cs new file mode 100644 index 00000000..84bffeee --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Console/TryConsoleCommand.cs @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Console +{ + [Message(new[]{Opcodes.TryConsoleCommand1, Opcodes.TryConsoleCommand2})] + public class TryConsoleCommand : GameMessage + { + public int Field0; + public string Field1; + public WorldPlace Field2; + public int Field3; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(4) + (-1); + Field1 = buffer.ReadCharArray(512); + Field2 = new WorldPlace(); + Field2.Parse(buffer); + Field3 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(4, Field0 - (-1)); + buffer.WriteCharArray(512, Field1); + Field2.Encode(buffer); + buffer.WriteInt(32, Field3); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("TryConsoleCommand:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: \"" + Field1 + "\""); + Field2.AsText(b, pad); + b.Append(' ', pad); b.AppendLine("Field3: 0x" + Field3.ToString("X8") + " (" + Field3 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Conversation/AdvanceConvMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Conversation/AdvanceConvMessage.cs new file mode 100644 index 00000000..29a89797 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Conversation/AdvanceConvMessage.cs @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Conversation +{ + /// + /// Client -> Server + /// + /// Sent by the client to request stopping playback of the current line + /// and continue with the next line of the conversation + /// (Player closes the conversation dialog window) + /// + [Message(Opcodes.AdvanceConvMessage, Consumers.Conversations)] + class AdvanceConvMessage : GameMessage + { + /// + /// SNO of the conversation + /// + public int SNOConversation; + + /// + /// Identifier of the PlayLineParams as used in PlayConvLineMessage to start the conversation + /// + public int PlayLineParamsId; + + public override void Parse(GameBitBuffer buffer) + { + SNOConversation = buffer.ReadInt(32); + PlayLineParamsId = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, SNOConversation); + buffer.WriteInt(32, PlayLineParamsId); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("AdvanceConvMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("SNOConversation: 0x" + SNOConversation.ToString("X8") + " (" + SNOConversation + ")"); + b.Append(' ', pad); b.AppendLine("PlayLineParamsId: 0x" + PlayLineParamsId.ToString("X8") + " (" + PlayLineParamsId + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Conversation/EndConversationMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Conversation/EndConversationMessage.cs new file mode 100644 index 00000000..d91493d7 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Conversation/EndConversationMessage.cs @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Conversation +{ + /// + /// Server -> Client + /// + /// TODO What does this message actually do? sending it not changes nothing. - farmy + /// + [Message(Opcodes.EndConversationMessage)] + public class EndConversationMessage : GameMessage + { + /// + /// SNO of the conversation + /// + public int SNOConversation; + + /// + /// Id of the actor that started the conversation + /// + public uint ActorId; + + public EndConversationMessage() : base(Opcodes.EndConversationMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + SNOConversation = buffer.ReadInt(32); + ActorId = buffer.ReadUInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, SNOConversation); + buffer.WriteUInt(32, ActorId); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("EndConversationMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("SNOConversation: 0x" + SNOConversation.ToString("X8") + " (" + SNOConversation + ")"); + b.Append(' ', pad); b.AppendLine("ActorID: 0x" + ActorId.ToString("X8") + " (" + ActorId + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Conversation/FinishConversationMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Conversation/FinishConversationMessage.cs new file mode 100644 index 00000000..c0575bc5 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Conversation/FinishConversationMessage.cs @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Conversation +{ + /// + /// Server -> Client + /// + /// Sent by the server to the client after EndConversationMessage. FinishConversationMessage + /// is, what will get rid of the three dots "..." above the actor that suggest there is more + /// coming. (Not sent if only the player char has a role in conversation) + /// + [Message(Opcodes.FinishConversationMessage)] + public class FinishConversationMessage : GameMessage + { + /// + /// SNO of the conversation to finish + /// + public int SNOConversation; + + public FinishConversationMessage() + : base(Opcodes.FinishConversationMessage) + { } + + public override void Parse(GameBitBuffer buffer) + { + SNOConversation = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, SNOConversation); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("FinishConversationMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("SNOConversation: 0x" + SNOConversation.ToString("X8")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Conversation/PlayConvLineMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Conversation/PlayConvLineMessage.cs new file mode 100644 index 00000000..1dd4c7ba --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Conversation/PlayConvLineMessage.cs @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Conversation +{ + /// + /// Server -> Client + /// + /// Plays a single line from a conversation. + /// + [Message(Opcodes.PlayConvLineMessage)] + public class PlayConvLineMessage : GameMessage + { + public uint ActorID; // The SNO of this actor is used, to get a localized "Name" of the conversation participant for chat ouput + // MaxLength = 9 + public uint[] Field1; // looks like a list of conversation participants - farmy + public PlayLineParams PlayLineParams; + public int Duration; // playback duration in ms + + public PlayConvLineMessage() : base(Opcodes.PlayConvLineMessage) {} + + public override void Parse(GameBitBuffer buffer) + { + ActorID = buffer.ReadUInt(32); + Field1 = new uint[9]; + for (int i = 0; i < Field1.Length; i++) Field1[i] = buffer.ReadUInt(32); + PlayLineParams = new PlayLineParams(); + PlayLineParams.Parse(buffer); + Duration = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ActorID); + for (int i = 0; i < Field1.Length; i++) buffer.WriteUInt(32, Field1[i]); + PlayLineParams.Encode(buffer); + buffer.WriteInt(32, Duration); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("PlayConvLineMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ActorID: 0x" + ActorID.ToString("X8") + " (" + ActorID + ")"); + b.Append(' ', pad); b.AppendLine("Field1:"); + b.Append(' ', pad); b.AppendLine("{"); + for (int i = 0; i < Field1.Length; ) { b.Append(' ', pad + 1); for (int j = 0; j < 8 && i < Field1.Length; j++, i++) { b.Append("0x" + Field1[i].ToString("X8") + ", "); } b.AppendLine(); } + b.Append(' ', pad); b.AppendLine("}"); b.AppendLine(); + PlayLineParams.AsText(b, pad); + b.Append(' ', pad); b.AppendLine("Duration: 0x" + Duration.ToString("X8") + " (" + Duration + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Conversation/RequestCloseConversationWindowMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Conversation/RequestCloseConversationWindowMessage.cs new file mode 100644 index 00000000..58256039 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Conversation/RequestCloseConversationWindowMessage.cs @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Conversation +{ + /// + /// Sent by the client when the user clicks on "X" in a conversation window + /// + [Message(Opcodes.RequestCloseConversationWindowMessage, Consumers.Conversations)] + public class RequestCloseConversationWindowMessage : GameMessage + { + + public override void Parse(GameBitBuffer buffer) + { + } + + public override void Encode(GameBitBuffer buffer) + { + throw new NotImplementedException(); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("RequestCloseConversationWindowMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Conversation/StopConvLineMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Conversation/StopConvLineMessage.cs new file mode 100644 index 00000000..c0fff31a --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Conversation/StopConvLineMessage.cs @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Conversation +{ + /// + /// Server -> Client + /// + /// Stops playback of a conversation line + /// + [Message(Opcodes.StopConvLineMessage)] + public class StopConvLineMessage : GameMessage + { + /// + /// Identifier of the PlayLineParams as used in PlayConvLineMessage to start the conversation + /// + public int PlayLineParamsId; + + /// + /// Sets whether playback of current line is stopped or not + /// + public bool Interrupt; + + public StopConvLineMessage() : base(Opcodes.StopConvLineMessage) {} + public override void Parse(GameBitBuffer buffer) + { + PlayLineParamsId = buffer.ReadInt(32); + Interrupt = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, PlayLineParamsId); + buffer.WriteBool(Interrupt); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("StopConvLineMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("PlayLineParamsId: 0x" + PlayLineParamsId.ToString("X8") + " (" + PlayLineParamsId + ")"); + b.Append(' ', pad); b.AppendLine("Interrupt: " + (Interrupt ? "true" : "false")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Conversation/UpdateConvAutoAdvanceMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Conversation/UpdateConvAutoAdvanceMessage.cs new file mode 100644 index 00000000..2657e69a --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Conversation/UpdateConvAutoAdvanceMessage.cs @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Conversation +{ + /// + /// Client -> Server + /// + /// Sent by the client to update expected end of a conversation. + /// Maybe due to lag or the player alt+tabbing out of the game + /// + [Message(Opcodes.UpdateConvAutoAdvanceMessage, Consumers.Conversations)] + class UpdateConvAutoAdvanceMessage : GameMessage + { + /// + /// SNO of the conversation ressource + /// + public int SNOConversation; + + /// + /// Identifier of the PlayLineParams as used in PlayConvLineMessage to start the conversation + /// + public int PlayLineParamsId; + + /// + /// New end of the conversation + /// + /// Sent to the client to play a special effect from an actor to another actor + /// + [Message(Opcodes.EffectGroupACDToACDMessage)] + public class EffectGroupACDToACDMessage : GameMessage + { + public int? /* sno */ EffectSNOId; // the effect to play + public uint ActorID; // where the effect starts + public uint TargetID; // where the effect will travel to + + public EffectGroupACDToACDMessage() : base(Opcodes.EffectGroupACDToACDMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + EffectSNOId = buffer.ReadInt(32); + ActorID = buffer.ReadUInt(32); + TargetID = buffer.ReadUInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, EffectSNOId.Value); + buffer.WriteUInt(32, ActorID); + buffer.WriteUInt(32, TargetID); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("EffectGroupACDToACDMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("EffectSNOId: 0x" + EffectSNOId.Value.ToString("X8")); + b.Append(' ', pad); b.AppendLine("ActorID: 0x" + ActorID.ToString("X8") + " (" + ActorID + ")"); + b.Append(' ', pad); b.AppendLine("TargetID: 0x" + TargetID.ToString("X8") + " (" + TargetID + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Effect/PlayEffectMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Effect/PlayEffectMessage.cs new file mode 100644 index 00000000..8aa270bc --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Effect/PlayEffectMessage.cs @@ -0,0 +1,261 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Effect +{ + /// + /// Sent to the client to play a special effect on the actor + /// + [Message(Opcodes.PlayEffectMessage)] + public class PlayEffectMessage : GameMessage + { + public uint ActorId; // Actor's DynamicID + public Effect Effect; + public int? OptionalParameter; + + public PlayEffectMessage() : base(Opcodes.PlayEffectMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + ActorId = buffer.ReadUInt(32); + Effect = (Effect)buffer.ReadInt(7) + (-1); + if (buffer.ReadBool()) + { + OptionalParameter = buffer.ReadInt(32); + } + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ActorId); + buffer.WriteInt(7, (int)Effect - (-1)); + buffer.WriteBool(OptionalParameter.HasValue); + if (OptionalParameter.HasValue) + { + buffer.WriteInt(32, OptionalParameter.Value); + } + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("PlayEffectMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ActorID: 0x" + ActorId.ToString("X8") + " (" + ActorId + ")"); + b.Append(' ', pad); b.AppendLine("Effect: 0x" + ((int)Effect).ToString("X8") + " (" + Effect + ")"); + if (OptionalParameter.HasValue) + { + b.Append(' ', pad); b.AppendLine("OptionalParameter.Value: 0x" + OptionalParameter.Value.ToString("X8") + " (" + OptionalParameter.Value + ")"); + } + b.Append(' ', --pad); + b.AppendLine("}"); + } + } + + // if you have any questions ask me - farmy + public enum Effect + { + Hit = 0, // plays a hit sound, takes another parameter for the specific sound + Unknown1 = 1, + Unknown2 = 2, // Used on goldcoins, healthglobes...items + Unknown3 = 3, // Used on goldcoins, healthglobes...items + UnknownSound = 4, // Weird sound effect...pickup sound? only used on PlayerActors + + /// + /// Gold pickup (golden glow) + /// + GoldPickup = 5, + + /// + /// Level up message (sign) in the center of the screen + /// TODO: it's not level-up, it's current player level info (including unlocked skills/slots) + /// + LevelUp = 6, + + /// + /// Health orb pickup (red imapct effect and noise) + /// + HealthOrbPickup = 7, + + /// + /// violet / pink circular effect on the actor + /// + ArcanePowerGain = 8, + + /// + /// Holy effect + /// TODO find out what that is and give the enum a proper name + /// + Holy1 = 9, + + /// + /// Holy effect + /// TODO find out what that is and give the enum a proper name + /// + Holy2 = 10, + + Unknown11 = 11, // played on chests, switches, spawner ... + Unknown12 = 12, // played on a lot of things + + /// + /// Breathing effect. Takes a particle effect sno as parameter. See comments + /// TODO find out if that is the same as Breathing2 + /// + Breathing1 = 13, // OOOkay... you CAN play this with a particle sno in field2 but i dont know if that is the intention. The place suggests its a breathing effect like 27958 + + /// + /// Sound effect. Takes a sound sno as parameter + /// + Sound = 14, + + Unknown15 = 15, + + /// + /// Breathing effect. Takes a particle effect sno as parameter. + /// TODO find out if that is the same as Breathing1 + /// + Breathing2 = 16, // same as BreathingEffect1 + + /// + /// Plays a sound and shows a text informing the player he cannot carry any more + /// TODO find out if that is the same as PickupFailOverburden2 + /// + PickupFailOverburden1 = 17, + + /// + /// Plays a sound and shows a text informing the player he cannot carry any more + /// TODO find out if that is the same as PickupFailOverburden1 + /// + PickupFailOverburden2 = 18, // same as PickupFail1 + + /// + /// Plays a sound and shows a text informing the player he is + /// not allowed to have more of this item type + /// + PickupFailNotAllowedMore = 19, + + /// + /// Shows a text informing the player that the item he wants to pick up + /// does not belong to him + /// + PickupFailIsNotYours = 20, + + Unknown21 = 21, + Unknown22 = 22, + Unknown23 = 23, // only one param, played on spawners + + /// + /// Splashes blood towards another actor. Takes the splash target dynamic id as parameter or -1 for an undirected splash + /// + BloodSplash = 24, + + Unknown25 = 25, + Unknown26 = 26, + IcyEffect = 27, // light blue cloud + IcyEffect2 = 28, // darker blue + IcyEffect3 = 29, // bright blue glow + Unknown30 = 30, + Unknown31 = 31, // takes another value that looks like an id but is not an actor + + /// + /// Plays an effect group. Takes the sno of the effect group as parameter + /// + PlayEffectGroup = 32, + + Unknown33 = 33, + LoudNoise = 34, // plays a loud sound: TODO rename this enum value, testet with monk + LoudNoise2 = 35, // plays a loud sound: TODO rename this enum value, tested with monk + Unknown36 = 36, + + /// + /// Energy / Furty / Mana etc pickup indicator, right globe flashes + /// + SecondaryRessourceEffect = 37, + + Unknown38 = 38, + Unknown39 = 39, + + /// + /// Plays a gore effect + /// + Gore = 40, + + /// + /// Plays a gore effect with fire component + /// + GoreFire = 41, + + /// + /// Plays a gore effect with poison component + /// + GorePoison = 42, + + /// + /// Plays a gore effect with arcane component + /// + GoreArcane = 43, + + /// + /// Plays a gore effect with holy component + /// + GoreHoly = 44, + + /// + /// Plays a gore effect with electro component + /// + GoreElectro = 45, + + IceBreak = 46, + Inferno = 47, // infernolike explosion + Darker = 48, + Red = 49, + Lila1 = 50, + Lila2 = 51, + Burned1 = 52, + Blue1 = 53, + Blue2 = 54, + Burned2 = 55, + Green = 56, + Unknown57 = 57, + Unknown58 = 58,// Used only on shield skeletons + Unknown59 = 59, // takes another value. have seen only field2==1, mostly used on shield skeletons + Unknown60 = 60, // takes another parameter. have seen it only once with field2 == 1 on a shield skeleton + Unknown61 = 61,// used often but i dont see anything + + /// + /// Blue bubbles around the actor + /// + ManaPickup = 62, + + Unknown63 = 63, + Unknown64 = 64, + Unknown65 = 65, + Unknown66 = 66, + Unknown67 = 67, // hmm...actor disappears... maybe death? + //Unknown68 = 68, // that one crashes + Unknown69 = 69, + + /// + /// Displays a checkpoint (reached) sign + /// + Checkpoint = 70 + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Effect/PlayHitEffectMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Effect/PlayHitEffectMessage.cs new file mode 100644 index 00000000..3d3af94e --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Effect/PlayHitEffectMessage.cs @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Effect +{ + [Message(Opcodes.PlayHitEffectMessage)] + public class PlayHitEffectMessage : GameMessage + { + public uint ActorID; + public uint HitDealer; // Player that made the hit. /komiga + public int Field2; + public bool Field3; + + public PlayHitEffectMessage() : base(Opcodes.PlayHitEffectMessage) {} + + public override void Parse(GameBitBuffer buffer) + { + ActorID = buffer.ReadUInt(32); + HitDealer = buffer.ReadUInt(32); + Field2 = buffer.ReadInt(3) + (-1); + Field3 = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ActorID); + buffer.WriteUInt(32, HitDealer); + buffer.WriteInt(3, Field2 - (-1)); + buffer.WriteBool(Field3); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("PlayHitEffectMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ActorID: 0x" + ActorID.ToString("X8") + " (" + ActorID + ")"); + b.Append(' ', pad); b.AppendLine("HitDealer: 0x" + HitDealer.ToString("X8") + " (" + HitDealer + ")"); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', pad); b.AppendLine("Field3: " + (Field3 ? "true" : "false")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Effect/PlayHitEffectOverrideMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Effect/PlayHitEffectOverrideMessage.cs new file mode 100644 index 00000000..7f17f80d --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Effect/PlayHitEffectOverrideMessage.cs @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Effect +{ + [Message(Opcodes.PlayHitEffectOverrideMessage)] + public class PlayHitEffectOverrideMessage : GameMessage + { + public int Field0; + public int Field1; + public int /* sno */ Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("PlayHitEffectOverrideMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Field2.ToString("X8")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Encounter/BossEncounterMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Encounter/BossEncounterMessage.cs new file mode 100644 index 00000000..a4efadc8 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Encounter/BossEncounterMessage.cs @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Encounter +{ + [Message(new[] {Opcodes.BossEncounterMessage1, Opcodes.BossEncounterMessage2})] + public class BossEncounterMessage : GameMessage + { + public int Field0; + public int /* sno */ snoEncounter; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + snoEncounter = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, snoEncounter); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("BossEncounterMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("snoEncounter: 0x" + snoEncounter.ToString("X8")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Encounter/EncounterInviteStateMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Encounter/EncounterInviteStateMessage.cs new file mode 100644 index 00000000..5ff267fd --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Encounter/EncounterInviteStateMessage.cs @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Encounter +{ + [Message(Opcodes.EncounterInviteStateMessage)] + public class EncounterInviteStateMessage : GameMessage + { + public int Field0; + public int Field1; + public int Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("EncounterInviteStateMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Game/BNetJoinGameRequestResultMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Game/BNetJoinGameRequestResultMessage.cs new file mode 100644 index 00000000..976ac4fb --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Game/BNetJoinGameRequestResultMessage.cs @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Game +{ + [Message(Opcodes.BNetJoinGameRequestResultMessage)] + public class BNetJoinGameRequestResultMessage : GameMessage + { + public int Field0; + public GameId Field1; + public long Field2; + public int Field3; + public int /* sno */ Field4; + public int Field5; + public int Field6; + public short Field7; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(3) + (-1); + Field1 = new GameId(); + Field1.Parse(buffer); + Field2 = buffer.ReadInt64(64); + Field3 = buffer.ReadInt(3) + (-1); + Field4 = buffer.ReadInt(32); + Field5 = buffer.ReadInt(16); + Field6 = buffer.ReadInt(32); + Field7 = (short)buffer.ReadInt(16); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(3, Field0 - (-1)); + Field1.Encode(buffer); + buffer.WriteInt64(64, Field2); + buffer.WriteInt(3, Field3 - (-1)); + buffer.WriteInt(32, Field4); + buffer.WriteInt(16, Field5); + buffer.WriteInt(32, Field6); + buffer.WriteInt(16, Field7); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("BNetJoinGameRequestResultMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + Field1.AsText(b, pad); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Field2.ToString("X16")); + b.Append(' ', pad); b.AppendLine("Field3: 0x" + Field3.ToString("X8") + " (" + Field3 + ")"); + b.Append(' ', pad); b.AppendLine("Field4: 0x" + Field4.ToString("X8")); + b.Append(' ', pad); b.AppendLine("Field5: 0x" + Field5.ToString("X8") + " (" + Field5 + ")"); + b.Append(' ', pad); b.AppendLine("Field6: 0x" + Field6.ToString("X8") + " (" + Field6 + ")"); + b.Append(' ', pad); b.AppendLine("Field7: 0x" + Field7.ToString("X4")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Game/CreateBNetGameMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Game/CreateBNetGameMessage.cs new file mode 100644 index 00000000..704d0d8f --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Game/CreateBNetGameMessage.cs @@ -0,0 +1,95 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Game +{ + [Message(Opcodes.CreateBNetGameMessage)] + public class CreateBNetGameMessage : GameMessage + { + public string Field0; + public int Field1; + public int Field2; + public int /* sno */ Field3; + public int Field4; + public bool Field5; + public int /* sno */ Field6; + public int Field7; + public int Field8; + public int Field9; + public int Field10; + public short Field11; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadCharArray(33); + Field1 = buffer.ReadInt(3) + (-1); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadInt(32); + Field4 = buffer.ReadInt(32); + Field5 = buffer.ReadBool(); + Field6 = buffer.ReadInt(32); + Field7 = buffer.ReadInt(16); + Field8 = buffer.ReadInt(3) + (1); + Field9 = buffer.ReadInt(32); + Field10 = buffer.ReadInt(32); + Field11 = (short)buffer.ReadInt(16); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteCharArray(33, Field0); + buffer.WriteInt(3, Field1 - (-1)); + buffer.WriteInt(32, Field2); + buffer.WriteInt(32, Field3); + buffer.WriteInt(32, Field4); + buffer.WriteBool(Field5); + buffer.WriteInt(32, Field6); + buffer.WriteInt(16, Field7); + buffer.WriteInt(3, Field8 - (1)); + buffer.WriteInt(32, Field9); + buffer.WriteInt(32, Field10); + buffer.WriteInt(16, Field11); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("CreateBNetGameMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: \"" + Field0 + "\""); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', pad); b.AppendLine("Field3: 0x" + Field3.ToString("X8")); + b.Append(' ', pad); b.AppendLine("Field4: 0x" + Field4.ToString("X8") + " (" + Field4 + ")"); + b.Append(' ', pad); b.AppendLine("Field5: " + (Field5 ? "true" : "false")); + b.Append(' ', pad); b.AppendLine("Field6: 0x" + Field6.ToString("X8")); + b.Append(' ', pad); b.AppendLine("Field7: 0x" + Field7.ToString("X8") + " (" + Field7 + ")"); + b.Append(' ', pad); b.AppendLine("Field8: 0x" + Field8.ToString("X8") + " (" + Field8 + ")"); + b.Append(' ', pad); b.AppendLine("Field9: 0x" + Field9.ToString("X8") + " (" + Field9 + ")"); + b.Append(' ', pad); b.AppendLine("Field10: 0x" + Field10.ToString("X8") + " (" + Field10 + ")"); + b.Append(' ', pad); b.AppendLine("Field11: 0x" + Field11.ToString("X4")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Game/CreateBNetGameResultMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Game/CreateBNetGameResultMessage.cs new file mode 100644 index 00000000..dace0c8d --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Game/CreateBNetGameResultMessage.cs @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Game +{ + [Message(Opcodes.CreateBNetGameResultMessage)] + public class CreateBNetGameResultMessage : GameMessage + { + public int Field0; + public GameId Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(2); + Field1 = new GameId(); + Field1.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(2, Field0); + Field1.Encode(buffer); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("CreateBNetGameResultMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + Field1.AsText(b, pad); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Game/GameIdMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Game/GameIdMessage.cs new file mode 100644 index 00000000..acea8e37 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Game/GameIdMessage.cs @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Game +{ + [Message(Opcodes.GameIdMessage)] + public class GameIdMessage : GameMessage + { + public GameId Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = new GameId(); + Field0.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + Field0.Encode(buffer); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("GameIdMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + Field0.AsText(b, pad); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Game/GameSetupMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Game/GameSetupMessage.cs new file mode 100644 index 00000000..7b1081b0 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Game/GameSetupMessage.cs @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Game +{ + [Message(Opcodes.GameSetupMessage)] + public class GameSetupMessage : GameMessage + { + public int Field0; + + public GameSetupMessage():base(Opcodes.GameSetupMessage) {} + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("GameSetupMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } + +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Game/GameSyncedDataMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Game/GameSyncedDataMessage.cs new file mode 100644 index 00000000..6a61b1a3 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Game/GameSyncedDataMessage.cs @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Game +{ + [Message(Opcodes.GameSyncedDataMessage)] + public class GameSyncedDataMessage : GameMessage + { + public GameSyncedData Field0; + + public GameSyncedDataMessage():base(Opcodes.GameSyncedDataMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = new GameSyncedData(); + Field0.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + Field0.Encode(buffer); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("GameSyncedDataMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + Field0.AsText(b, pad); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Game/GameTestingSamplingStartMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Game/GameTestingSamplingStartMessage.cs new file mode 100644 index 00000000..d19120f7 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Game/GameTestingSamplingStartMessage.cs @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Game +{ + [Message(Opcodes.GameTestingSamplingStartMessage)] + public class GameTestingSamplingStartMessage : GameMessage + { + public int /* sno */ Field0; + public int /* sno */ Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("GameTestingSamplingStartMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8")); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Game/JoinBNetGameMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Game/JoinBNetGameMessage.cs new file mode 100644 index 00000000..cdf88d9f --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Game/JoinBNetGameMessage.cs @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Game +{ + [Message(Opcodes.JoinBNetGameMessage,Consumers.ClientManager)] + public class JoinBNetGameMessage : GameMessage + { + public EntityId ToonEntityId; // this *is* the toon id /raist. + public GameId Field1; + public int GameId; // and this is the SGameId there we set in Mooege.Core.MooNet.Games.Game.cs when we send the connection info to client /raist. + public long Field3; + public int Field4; + public int ProtocolHash; + public int SNOPackHash; + + public override void Parse(GameBitBuffer buffer) + { + ToonEntityId = new EntityId(); + ToonEntityId.Parse(buffer); + Field1 = new GameId(); + Field1.Parse(buffer); + GameId = buffer.ReadInt(32); + Field3 = buffer.ReadInt64(64); + Field4 = buffer.ReadInt(4) + (2); + ProtocolHash = buffer.ReadInt(32); + SNOPackHash = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + ToonEntityId.Encode(buffer); + Field1.Encode(buffer); + buffer.WriteInt(32, GameId); + buffer.WriteInt64(64, Field3); + buffer.WriteInt(4, Field4 - (2)); + buffer.WriteInt(32, ProtocolHash); + buffer.WriteInt(32, SNOPackHash); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("JoinBNetGameMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + ToonEntityId.AsText(b, pad); + Field1.AsText(b, pad); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + GameId.ToString("X8") + " (" + GameId + ")"); + b.Append(' ', pad); b.AppendLine("Field3: 0x" + Field3.ToString("X16")); + b.Append(' ', pad); b.AppendLine("Field4: 0x" + Field4.ToString("X8") + " (" + Field4 + ")"); + b.Append(' ', pad); b.AppendLine("ProtocolHash: 0x" + ProtocolHash.ToString("X8")); + b.Append(' ', pad); b.AppendLine("SNOPackHash: 0x" + SNOPackHash.ToString("X8")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Game/JoinLANGameMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Game/JoinLANGameMessage.cs new file mode 100644 index 00000000..fba79b0e --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Game/JoinLANGameMessage.cs @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +// this is yet another interesting message. Does d3 client allow LAN games? /raist + +namespace Mooege.Net.GS.Message.Definitions.Game +{ + [Message(Opcodes.JoinLANGameMessage)] + public class JoinLANGameMessage : GameMessage + { + public int Field0; + public string Field1; + public string Field2; + public int Field3; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadCharArray(128); + Field2 = buffer.ReadCharArray(49); + Field3 = buffer.ReadInt(4) + (2); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteCharArray(128, Field1); + buffer.WriteCharArray(49, Field2); + buffer.WriteInt(4, Field3 - (2)); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("JoinLANGameMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: \"" + Field1 + "\""); + b.Append(' ', pad); b.AppendLine("Field2: \"" + Field2 + "\""); + b.Append(' ', pad); b.AppendLine("Field3: 0x" + Field3.ToString("X8") + " (" + Field3 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Game/QuitGameMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Game/QuitGameMessage.cs new file mode 100644 index 00000000..914ca0e5 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Game/QuitGameMessage.cs @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Game +{ + [Message(Opcodes.QuitGameMessage)] + public class QuitGameMessage : GameMessage + { + public int PlayerIndex; + + public QuitGameMessage() : base(Opcodes.QuitGameMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + PlayerIndex = buffer.ReadInt(4); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(4, PlayerIndex); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("QuitGameMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("PlayerIndex: 0x" + PlayerIndex.ToString("X8") + " (" + PlayerIndex + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Game/RequestJoinBNetGameMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Game/RequestJoinBNetGameMessage.cs new file mode 100644 index 00000000..df43f4a3 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Game/RequestJoinBNetGameMessage.cs @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Game +{ + [Message(Opcodes.RequestJoinBNetGameMessage)] + public class RequestJoinBNetGameMessage : GameMessage + { + public GameId Field0; + public EntityId Field1; + public int Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = new GameId(); + Field0.Parse(buffer); + Field1 = new EntityId(); + Field1.Parse(buffer); + Field2 = buffer.ReadInt(5) + (-1); + } + + public override void Encode(GameBitBuffer buffer) + { + Field0.Encode(buffer); + Field1.Encode(buffer); + buffer.WriteInt(5, Field2 - (-1)); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("RequestJoinBNetGameMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + Field0.AsText(b, pad); + Field1.AsText(b, pad); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Game/VersionsMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Game/VersionsMessage.cs new file mode 100644 index 00000000..9d3f82a7 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Game/VersionsMessage.cs @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Common.Versions; + +namespace Mooege.Net.GS.Message.Definitions.Game +{ + [Message(Opcodes.VersionsMessage)] + public class VersionsMessage : GameMessage + { + public int SNOPackHash; + public int ProtocolHash; + public string Version; + + public VersionsMessage(int snoPacketHash):base(Opcodes.VersionsMessage) + { + this.SNOPackHash = snoPacketHash; + this.ProtocolHash = VersionInfo.Ingame.ProtocolHash; + this.Version = VersionInfo.Ingame.VersionString; + } + + public VersionsMessage():base(Opcodes.VersionsMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + SNOPackHash = buffer.ReadInt(32); + ProtocolHash = buffer.ReadInt(32); + Version = buffer.ReadCharArray(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, SNOPackHash); + buffer.WriteInt(32, ProtocolHash); + buffer.WriteCharArray(32, Version); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("VersionsMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("SNOPackHash: 0x" + SNOPackHash.ToString("X8")); + b.Append(' ', pad); b.AppendLine("ProtocolHash: 0x" + ProtocolHash.ToString("X8")); + b.Append(' ', pad); b.AppendLine("Version: \"" + Version + "\""); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Hero/CreateHeroMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Hero/CreateHeroMessage.cs new file mode 100644 index 00000000..fd31fb3d --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Hero/CreateHeroMessage.cs @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Hero +{ + [Message(Opcodes.CreateHeroMessage)] + public class CreateHeroMessage : GameMessage + { + public string Name; + public int /* gbid */ Field1; + public int Field2; + + public override void Parse(GameBitBuffer buffer) + { + Name = buffer.ReadCharArray(49); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(30); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteCharArray(49, Name); + buffer.WriteInt(32, Field1); + buffer.WriteInt(30, Field2); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("CreateHeroMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Name: \"" + Name + "\""); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8")); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Hero/CreateHeroResultMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Hero/CreateHeroResultMessage.cs new file mode 100644 index 00000000..8adb8e0f --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Hero/CreateHeroResultMessage.cs @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Hero +{ + [Message(Opcodes.CreateHeroResultMessage)] + public class CreateHeroResultMessage : GameMessage + { + public int Field0; + public EntityId Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(2) + (-1); + Field1 = new EntityId(); + Field1.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(2, Field0 - (-1)); + Field1.Encode(buffer); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("CreateHeroResultMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + Field1.AsText(b, pad); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Hero/GoldModifiedMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Hero/GoldModifiedMessage.cs new file mode 100644 index 00000000..363b5301 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Hero/GoldModifiedMessage.cs @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Hero +{ + [Message(Opcodes.GoldModifiedMessage)] + public class GoldModifiedMessage : GameMessage + { + public bool Modified; + public int Field1; + + public GoldModifiedMessage() : base(Opcodes.GoldModifiedMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + Modified = buffer.ReadBool(); + Field1 = buffer.ReadInt(2); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteBool(Modified); + buffer.WriteInt(2, Field1); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("GoldModifiedMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Modified: " + (Modified ? "true" : "false")); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Hero/HearthPortalInfoMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Hero/HearthPortalInfoMessage.cs new file mode 100644 index 00000000..8a65c762 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Hero/HearthPortalInfoMessage.cs @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Hero +{ + [Message(Opcodes.HearthPortalInfoMessage)] + public class HearthPortalInfoMessage : GameMessage + { + public int /* sno */ snoLevelArea; + public int Field1; + + public HearthPortalInfoMessage():base(Opcodes.HearthPortalInfoMessage){} + + public override void Parse(GameBitBuffer buffer) + { + snoLevelArea = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, snoLevelArea); + buffer.WriteInt(32, Field1); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("HearthPortalInfoMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("snoLevelArea: 0x" + snoLevelArea.ToString("X8")); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Hero/HeroStateMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Hero/HeroStateMessage.cs new file mode 100644 index 00000000..855f2e9a --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Hero/HeroStateMessage.cs @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Hero +{ + [Message(Opcodes.HeroStateMessage)] + public class HeroStateMessage : GameMessage + { + public HeroStateData State; + + public HeroStateMessage() : base(Opcodes.HeroStateMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + State = new HeroStateData(); + State.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + State.Encode(buffer); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("HeroStateMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + State.AsText(b, pad); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Hireling/HirelingDismissMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Hireling/HirelingDismissMessage.cs new file mode 100644 index 00000000..0b4179d1 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Hireling/HirelingDismissMessage.cs @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Hireling +{ + [Message(Opcodes.HirelingDismissMessage, Consumers.Player)] + public class HirelingDismissMessage : GameMessage + { + public uint HirelingId; + + public override void Parse(GameBitBuffer buffer) + { + HirelingId = buffer.ReadUInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, HirelingId); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("HirelingDismissMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("HirelingId: 0x" + HirelingId.ToString("X8") + " (" + HirelingId + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Hireling/HirelingHireMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Hireling/HirelingHireMessage.cs new file mode 100644 index 00000000..780e013f --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Hireling/HirelingHireMessage.cs @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Hireling +{ + [Message(Opcodes.HirelingHireMessage, Consumers.SelectedNPC)] + public class HirelingHireMessage : GameMessage + { + public HirelingHireMessage() + : base(Opcodes.HirelingHireMessage) + { + } + + public uint HirelingId; + + public override void Parse(GameBitBuffer buffer) + { + } + + public override void Encode(GameBitBuffer buffer) + { + throw new NotImplementedException(); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("HirelingHireMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("HirelingId: 0x" + HirelingId.ToString("X8") + " (" + HirelingId + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Hireling/HirelingInfoUpdateMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Hireling/HirelingInfoUpdateMessage.cs new file mode 100644 index 00000000..9be34470 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Hireling/HirelingInfoUpdateMessage.cs @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Hireling +{ + [Message(Opcodes.HirelingInfoUpdateMessage)] + public class HirelingInfoUpdateMessage : GameMessage + { + public int HirelingIndex; + public bool Field1; + public int Field2; + public int Level; + + public HirelingInfoUpdateMessage() + : base(Opcodes.HirelingInfoUpdateMessage) + { + } + + public override void Parse(GameBitBuffer buffer) + { + HirelingIndex = buffer.ReadInt(2); + Field1 = buffer.ReadBool(); + Field2 = buffer.ReadInt(32); + Level = buffer.ReadInt(7); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(2, HirelingIndex); + buffer.WriteBool(Field1); + buffer.WriteInt(32, Field2); + buffer.WriteInt(7, Level); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("HirelingInfoUpdateMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("HirelingIndex: 0x" + HirelingIndex.ToString("X8") + " (" + HirelingIndex + ")"); + b.Append(' ', pad); b.AppendLine("Field1: " + (Field1 ? "true" : "false")); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', pad); b.AppendLine("Level: 0x" + Level.ToString("X8") + " (" + Level + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Hireling/HirelingInventoryMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Hireling/HirelingInventoryMessage.cs new file mode 100644 index 00000000..cb29137a --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Hireling/HirelingInventoryMessage.cs @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Hireling +{ + [Message(Opcodes.HirelingInventoryMessage, Consumers.SelectedNPC)] + public class HirelingInventoryMessage : GameMessage + { + public HirelingInventoryMessage() + : base(Opcodes.HirelingInventoryMessage) + { + } + + public override void Parse(GameBitBuffer buffer) + { + } + + public override void Encode(GameBitBuffer buffer) + { + throw new NotImplementedException(); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("HirelingInventoryMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Hireling/HirelingRequestLearnSkillMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Hireling/HirelingRequestLearnSkillMessage.cs new file mode 100644 index 00000000..85e2fb97 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Hireling/HirelingRequestLearnSkillMessage.cs @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Hireling +{ + /// + /// Sent to the client when a skill is requested to be learnt for a follower + /// + [Message(Opcodes.HirelingRequestLearnSkillMessage, Consumers.Player)] + public class HirelingRequestLearnSkillMessage : GameMessage + { + public uint HirelingID; //Actor ID of the hireling + public int /* sno */ PowerSNOId; + + public override void Parse(GameBitBuffer buffer) + { + HirelingID = buffer.ReadUInt(32); + PowerSNOId = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, HirelingID); + buffer.WriteInt(32, PowerSNOId); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("HirelingRequestLearnSkillMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("HirelingID: 0x" + HirelingID.ToString("X8") + " (" + HirelingID + ")"); + b.Append(' ', pad); b.AppendLine("PowerSNOId: 0x" + PowerSNOId.ToString("X8")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Hireling/HirelingRetrainMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Hireling/HirelingRetrainMessage.cs new file mode 100644 index 00000000..b66731c3 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Hireling/HirelingRetrainMessage.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Hireling +{ + [Message(Opcodes.HirelingRetrainMessage, Consumers.SelectedNPC)] + public class HirelingRetrainMessage : GameMessage + { + public uint HirelingId; + + public HirelingRetrainMessage() + : base(Opcodes.HirelingRetrainMessage) + { + } + + public override void Parse(GameBitBuffer buffer) + { + } + + public override void Encode(GameBitBuffer buffer) + { + throw new NotImplementedException(); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("HirelingRetrainMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("HirelingId: 0x" + HirelingId.ToString("X8") + " (" + HirelingId + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Hireling/HirelingSwapMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Hireling/HirelingSwapMessage.cs new file mode 100644 index 00000000..f5883efb --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Hireling/HirelingSwapMessage.cs @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Hireling +{ + [Message (new[] {Opcodes.HirelingSwapMessage1, Opcodes.HirelingSwapMessage2})] + public class HirelingSwapMessage : GameMessage + { + public int HirelingId; + + public override void Parse(GameBitBuffer buffer) + { + HirelingId = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, HirelingId); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("HirelingSwapMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + HirelingId.ToString("X8") + " (" + HirelingId + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Inventory/InventoryDropItemMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Inventory/InventoryDropItemMessage.cs new file mode 100644 index 00000000..6c5c71c4 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Inventory/InventoryDropItemMessage.cs @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Inventory +{ + [Message(Opcodes.DropItemMessage, Consumers.Inventory)] + public class InventoryDropItemMessage : GameMessage + { + public uint ItemID; // Item's DynamicID + //TODO: find out about unknown data + public byte[] Unknown; + + public override void Parse(GameBitBuffer buffer) + { + ItemID = buffer.ReadUInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ItemID); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("InventoryDropItemMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ItemID: 0x" + ItemID.ToString("X8")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Inventory/InventoryDropStackPortionMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Inventory/InventoryDropStackPortionMessage.cs new file mode 100644 index 00000000..69c9f0b3 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Inventory/InventoryDropStackPortionMessage.cs @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Inventory +{ + [Message(Opcodes.InventoryDropStackPortionMessage)] + public class InventoryDropStackPortionMessage : GameMessage + { + public int Field0; + public long Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt64(64); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt64(64,Field1); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("InventoryDropStackPortionMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X16") + " (" + Field1 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} + diff --git a/src/Mooege/Net/GS/Message/Definitions/Inventory/InventoryIdentifyItem.cs b/src/Mooege/Net/GS/Message/Definitions/Inventory/InventoryIdentifyItem.cs new file mode 100644 index 00000000..3d0ce9d9 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Inventory/InventoryIdentifyItem.cs @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Inventory +{ + [Message(Opcodes.IdentifyItemMessage, Consumers.Inventory)] + public class InventoryIdentifyItemMessage : GameMessage + { + public uint ItemID; // Item's DynamicID + //TODO: find out about unknown data + public byte[] Unknown; + + public override void Parse(GameBitBuffer buffer) + { + ItemID = buffer.ReadUInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ItemID); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("InventoryIdentifyItemMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ItemID: 0x" + ItemID.ToString("X8")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Inventory/InventoryRequestMoveMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Inventory/InventoryRequestMoveMessage.cs new file mode 100644 index 00000000..16777038 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Inventory/InventoryRequestMoveMessage.cs @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Inventory +{ + [Message(Opcodes.InventoryRequestMoveMessage1, Consumers.Inventory)] + public class InventoryRequestMoveMessage : GameMessage + { + public uint ItemID; // Item's DynamicID + public InvLoc Location; + + public override void Parse(GameBitBuffer buffer) + { + ItemID = buffer.ReadUInt(32); + Location = new InvLoc(); + Location.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ItemID); + Location.Encode(buffer); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("InventoryRequestMoveMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ItemID: 0x" + ItemID.ToString("X8") + " (" + ItemID + ")"); + Location.AsText(b, pad); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Inventory/InventoryRequestQuickMoveMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Inventory/InventoryRequestQuickMoveMessage.cs new file mode 100644 index 00000000..0e9f5594 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Inventory/InventoryRequestQuickMoveMessage.cs @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Inventory +{ + [Message(Opcodes.InventoryRequestQuickMoveMessage, Consumers.Inventory)] + public class InventoryRequestQuickMoveMessage : GameMessage + { + public uint ItemID; + public int Field1; + public int DestEquipmentSlot; + public int DestRowStart; + public int DestRowEnd; + + public override void Parse(GameBitBuffer buffer) + { + ItemID = buffer.ReadUInt(32); + Field1 = buffer.ReadInt(32); + DestEquipmentSlot = buffer.ReadInt(5) + (-1); + DestRowStart = buffer.ReadInt(32); + DestRowEnd = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ItemID); + buffer.WriteInt(32, Field1); + buffer.WriteInt(5, DestEquipmentSlot - (-1)); + buffer.WriteInt(32, DestRowStart); + buffer.WriteInt(32, DestRowEnd); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("InventoryRequestQuickMoveMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + ItemID.ToString("X8") + " (" + ItemID + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + DestEquipmentSlot.ToString("X8") + " (" + DestEquipmentSlot + ")"); + b.Append(' ', pad); b.AppendLine("Field3: 0x" + DestRowStart.ToString("X8") + " (" + DestRowStart + ")"); + b.Append(' ', pad); b.AppendLine("Field4: 0x" + DestRowEnd.ToString("X8") + " (" + DestRowEnd + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Inventory/InventoryRequestSocketMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Inventory/InventoryRequestSocketMessage.cs new file mode 100644 index 00000000..98c8e8c7 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Inventory/InventoryRequestSocketMessage.cs @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Inventory +{ + [Message(Opcodes.InventoryRequestSocketMessage)] + public class InventoryRequestSocketMessage : GameMessage + { + public int Field0; + public int Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("InventoryRequestSocketMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Inventory/InventoryRequestUseMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Inventory/InventoryRequestUseMessage.cs new file mode 100644 index 00000000..010854c7 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Inventory/InventoryRequestUseMessage.cs @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Inventory +{ + [Message(Opcodes.InventoryRequestUseMessage, Consumers.Inventory)] + public class InventoryRequestUseMessage : GameMessage + { + public uint UsedItem; + public int Field1; + public uint UsedOnItem; + public WorldPlace Location; + + public override void Parse(GameBitBuffer buffer) + { + UsedItem = buffer.ReadUInt(32); + Field1 = buffer.ReadInt(3) + (-1); + UsedOnItem = buffer.ReadUInt(32); + Location = new WorldPlace(); + Location.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, UsedItem); + buffer.WriteInt(3, Field1 - (-1)); + buffer.WriteUInt(32, UsedOnItem); + Location.Encode(buffer); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("InventoryRequestUseMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("UsedItem: 0x" + UsedItem.ToString("X8") + " (" + UsedItem + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); b.AppendLine("UsedOnItem: 0x" + UsedOnItem.ToString("X8") + " (" + UsedOnItem + ")"); + Location.AsText(b, pad); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Inventory/InventorySplitStackMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Inventory/InventorySplitStackMessage.cs new file mode 100644 index 00000000..848c1084 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Inventory/InventorySplitStackMessage.cs @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Inventory +{ + [Message(Opcodes.InventorySplitStackMessage, Consumers.Inventory)] + public class InventorySplitStackMessage : GameMessage + { + public int FromID; + public long Amount; + public InvLoc InvLoc; + + public override void Parse(GameBitBuffer buffer) + { + FromID = buffer.ReadInt(32); + Amount = buffer.ReadInt64(64); + InvLoc = new InvLoc(); + InvLoc.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, FromID); + buffer.WriteInt64(64, Amount); + InvLoc.Encode(buffer); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("InventorySplitStackMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("FromID: 0x" + FromID.ToString("X8") + " (" + FromID + ")"); + b.Append(' ', pad); b.AppendLine("Amount: 0x" + Amount.ToString("X16")); + InvLoc.AsText(b, pad); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Inventory/InventoryStackTransferMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Inventory/InventoryStackTransferMessage.cs new file mode 100644 index 00000000..7bf48c69 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Inventory/InventoryStackTransferMessage.cs @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Inventory +{ + [Message(Opcodes.InventoryStackTransferMessage, Consumers.Inventory)] + public class InventoryStackTransferMessage : GameMessage + { + public uint FromID; + public uint ToID; + public ulong Amount; + + public override void Parse(GameBitBuffer buffer) + { + FromID = buffer.ReadUInt(32); + ToID = buffer.ReadUInt(32); + Amount = buffer.ReadUInt64(64); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, FromID); + buffer.WriteUInt(32, ToID); + buffer.WriteUInt64(64, Amount); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("InventoryStackTransferMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("FromID: 0x" + FromID.ToString("X8") + " (" + FromID + ")"); + b.Append(' ', pad); b.AppendLine("ToID: 0x" + ToID.ToString("X8") + " (" + ToID + ")"); + b.Append(' ', pad); b.AppendLine("Amount: 0x" + Amount.ToString("X16")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Inventory/RequestUseNephalemCubeMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Inventory/RequestUseNephalemCubeMessage.cs new file mode 100644 index 00000000..a3d38273 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Inventory/RequestUseNephalemCubeMessage.cs @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + /// + /// Sent by the client, when the player uses nephalem cube on an item + /// + [Message(Opcodes.RequestUseNephalemCubeMessage, Consumers.Inventory)] + public class RequestUseNephalemCubeMessage : GameMessage + { + public uint ActorID; // Id of the target + + public RequestUseNephalemCubeMessage() : base(Opcodes.RequestUseNephalemCubeMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + ActorID = buffer.ReadUInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ActorID); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("RequestUseNephalemCubeMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ActorID: 0x" + ActorID.ToString("X8") + " (" + ActorID + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Inventory/VisualInventoryMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Inventory/VisualInventoryMessage.cs new file mode 100644 index 00000000..10938db1 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Inventory/VisualInventoryMessage.cs @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Inventory +{ + [Message(Opcodes.VisualInventoryMessage)] + public class VisualInventoryMessage : GameMessage + { + public uint ActorID; // Player's DynamicID + public VisualEquipment EquipmentList; + + public VisualInventoryMessage() : base(Opcodes.VisualInventoryMessage) {} + + public override void Parse(GameBitBuffer buffer) + { + ActorID = buffer.ReadUInt(32); + EquipmentList = new VisualEquipment(); + EquipmentList.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ActorID); + EquipmentList.Encode(buffer); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("VisualInventoryMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ActorID: 0x" + ActorID.ToString("X8") + " (" + ActorID + ")"); + EquipmentList.AsText(b, pad); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Map/MapMarkerInfoMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Map/MapMarkerInfoMessage.cs new file mode 100644 index 00000000..61eb105c --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Map/MapMarkerInfoMessage.cs @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Map +{ + [Message(Opcodes.MapMarkerInfoMessage)] + public class MapMarkerInfoMessage : GameMessage + { + public int Field0; + public WorldPlace Field1; + public int Field2; + public int Field3; + public int /* sno */ m_snoStringList; + public int Field5; + public bool Field6; + public bool Field7; + public bool Field8; + public float Field9; + public float Field10; + public float Field11; + public int Field12; + + public MapMarkerInfoMessage() + : base(Opcodes.MapMarkerInfoMessage) + { } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = new WorldPlace(); + Field1.Parse(buffer); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadInt(32); + m_snoStringList = buffer.ReadInt(32); + Field5 = buffer.ReadInt(32); + Field6 = buffer.ReadBool(); + Field7 = buffer.ReadBool(); + Field8 = buffer.ReadBool(); + Field9 = buffer.ReadFloat32(); + Field10 = buffer.ReadFloat32(); + Field11 = buffer.ReadFloat32(); + Field12 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + Field1.Encode(buffer); + buffer.WriteInt(32, Field2); + buffer.WriteInt(32, Field3); + buffer.WriteInt(32, m_snoStringList); + buffer.WriteInt(32, Field5); + buffer.WriteBool(Field6); + buffer.WriteBool(Field7); + buffer.WriteBool(Field8); + buffer.WriteFloat32(Field9); + buffer.WriteFloat32(Field10); + buffer.WriteFloat32(Field11); + buffer.WriteInt(32, Field12); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("MapMarkerInfoMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + Field1.AsText(b, pad); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', pad); b.AppendLine("Field3: 0x" + Field3.ToString("X8") + " (" + Field3 + ")"); + b.Append(' ', pad); b.AppendLine("m_snoStringList: 0x" + m_snoStringList.ToString("X8")); + b.Append(' ', pad); b.AppendLine("Field5: 0x" + Field5.ToString("X8") + " (" + Field5 + ")"); + b.Append(' ', pad); b.AppendLine("Field6: " + (Field6 ? "true" : "false")); + b.Append(' ', pad); b.AppendLine("Field7: " + (Field7 ? "true" : "false")); + b.Append(' ', pad); b.AppendLine("Field8: " + (Field8 ? "true" : "false")); + b.Append(' ', pad); b.AppendLine("Field9: " + Field9.ToString("G")); + b.Append(' ', pad); b.AppendLine("Field10: " + Field10.ToString("G")); + b.Append(' ', pad); b.AppendLine("Field11: " + Field11.ToString("G")); + b.Append(' ', pad); b.AppendLine("Field12: 0x" + Field12.ToString("X8") + " (" + Field12 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Map/MapRevealSceneMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Map/MapRevealSceneMessage.cs new file mode 100644 index 00000000..3b7842d7 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Map/MapRevealSceneMessage.cs @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Core.GS.Common.Types.Math; + +namespace Mooege.Net.GS.Message.Definitions.Map +{ + [Message(Opcodes.MapRevealSceneMessage)] + public class MapRevealSceneMessage : GameMessage + { + public uint ChunkID; + public int /* sno */ SceneSNO; + public PRTransform Transform; + public uint WorldID; + public bool MiniMapVisibility; + + public MapRevealSceneMessage() : base(Opcodes.MapRevealSceneMessage) {} + + public override void Parse(GameBitBuffer buffer) + { + ChunkID = buffer.ReadUInt(32); + SceneSNO = buffer.ReadInt(32); + Transform = new PRTransform(); + Transform.Parse(buffer); + WorldID = buffer.ReadUInt(32); + MiniMapVisibility = buffer.ReadBool(); ; + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ChunkID); + buffer.WriteInt(32, SceneSNO); + Transform.Encode(buffer); + buffer.WriteUInt(32, WorldID); + buffer.WriteBool(MiniMapVisibility); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("MapRevealSceneMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ChunkID: 0x" + ChunkID.ToString("X8") + " (" + ChunkID + ")"); + b.Append(' ', pad); b.AppendLine("SceneSNO: 0x" + SceneSNO.ToString("X8")); + Transform.AsText(b, pad); + b.Append(' ', pad); b.AppendLine("WorldID: 0x" + WorldID.ToString("X8") + " (" + WorldID + ")"); + b.Append(' ', pad); b.AppendLine("MiniMapVisibility: " + (MiniMapVisibility ? "true" : "false")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/ANNDataMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/ANNDataMessage.cs new file mode 100644 index 00000000..9394c4e4 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/ANNDataMessage.cs @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(new[] { + Opcodes.ANNDataMessage8, Opcodes.ANNDataMessage10, Opcodes.ANNDataMessage11, Opcodes.ANNDataMessage13, Opcodes.ANNDataMessage15, + Opcodes.ANNDataMessage16, Opcodes.ANNDataMessage17, Opcodes.ANNDataMessage18, Opcodes.ANNDataMessage21, Opcodes.ANNDataMessage23, + Opcodes.ANNDataMessage24, Opcodes.ANNDataMessage25, Opcodes.ANNDataMessage26, Opcodes.ANNDataMessage28, Opcodes.ANNDataMessage29, Opcodes.ANNDataMessage31, + Opcodes.ANNDataMessage32, + })] + public class ANNDataMessage : GameMessage + { + public uint ActorID; // Actor's DynamicID + + public ANNDataMessage(Opcodes id) : base(id) {} + + public override void Parse(GameBitBuffer buffer) + { + ActorID = buffer.ReadUInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ActorID); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ANNDataMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ActorID: 0x" + ActorID.ToString("X8") + " (" + ActorID + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/AffixMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/AffixMessage.cs new file mode 100644 index 00000000..8f928488 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/AffixMessage.cs @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(Opcodes.AffixMessage)] + public class AffixMessage : GameMessage + { + public uint ActorID; // Actor's DynamicID + public int Field1; // 1 == Identified Affixes, 2 == Unidentified Affixes + // MaxLength = 32 + public int /* gbid */[] aAffixGBIDs; + + public AffixMessage() : base(Opcodes.AffixMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + ActorID = buffer.ReadUInt(32); + Field1 = buffer.ReadInt(2); + aAffixGBIDs = new int /* gbid */[buffer.ReadInt(6)]; + for (int i = 0; i < aAffixGBIDs.Length; i++) aAffixGBIDs[i] = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ActorID); + buffer.WriteInt(2, Field1); + buffer.WriteInt(6, aAffixGBIDs.Length); + for (int i = 0; i < aAffixGBIDs.Length; i++) buffer.WriteInt(32, aAffixGBIDs[i]); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("AffixMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ActorID: 0x" + ActorID.ToString("X8") + " (" + ActorID + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); b.AppendLine("aAffixGBIDs:"); + b.Append(' ', pad); b.AppendLine("{"); + for (int i = 0; i < aAffixGBIDs.Length; ) { b.Append(' ', pad + 1); for (int j = 0; j < 8 && i < aAffixGBIDs.Length; j++, i++) { b.Append("0x" + aAffixGBIDs[i].ToString("X8") + ", "); } b.AppendLine(); } + b.Append(' ', pad); b.AppendLine("}"); b.AppendLine(); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/BlizzconCVarsMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/BlizzconCVarsMessage.cs new file mode 100644 index 00000000..bbe800ce --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/BlizzconCVarsMessage.cs @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(Opcodes.BlizzconCVarsMessage)] + public class BlizzconCVarsMessage : GameMessage + { + public bool Field0; + public bool Field1; + public bool Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadBool(); + Field1 = buffer.ReadBool(); + Field2 = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteBool(Field0); + buffer.WriteBool(Field1); + buffer.WriteBool(Field2); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("BlizzconCVarsMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: " + (Field0 ? "true" : "false")); + b.Append(' ', pad); b.AppendLine("Field1: " + (Field1 ? "true" : "false")); + b.Append(' ', pad); b.AppendLine("Field2: " + (Field2 ? "true" : "false")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/BoolDataMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/BoolDataMessage.cs new file mode 100644 index 00000000..724b534b --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/BoolDataMessage.cs @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(new[] { Opcodes.BoolDataMessage2, Opcodes.BoolDataMessage3, Opcodes.BoolDataMessage4, Opcodes.BoolDataMessage5 })] + public class BoolDataMessage : GameMessage + { + public bool Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteBool(Field0); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("BoolDataMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: " + (Field0 ? "true" : "false")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/DWordDataMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/DWordDataMessage.cs new file mode 100644 index 00000000..6b73a2e0 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/DWordDataMessage.cs @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(new[] { + Opcodes.DWordDataMessage1,Opcodes.DWordDataMessage2,Opcodes.DWordDataMessage4,Opcodes.DWordDataMessage5, + Opcodes.DWordDataMessage7,Opcodes.DWordDataMessage8,Opcodes.DWordDataMessage9,Opcodes.DWordDataMessage10,Opcodes.DWordDataMessage11,Opcodes.DWordDataMessage12})] + public class DWordDataMessage : GameMessage, ISelfHandler + { + public int Field0; + + public DWordDataMessage() { } + public DWordDataMessage(int opcode):base(opcode) { } + + public void Handle(GameClient client) + { + + } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("DWordDataMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/DataIDDataMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/DataIDDataMessage.cs new file mode 100644 index 00000000..8420b3d1 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/DataIDDataMessage.cs @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(new [] {Opcodes.DataIDDataMessage1, Opcodes.DataIDDataMessage2})] + public class DataIDDataMessage : GameMessage + { + public int Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("DataIDDataMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/EntityIdMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/EntityIdMessage.cs new file mode 100644 index 00000000..adb4d6ea --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/EntityIdMessage.cs @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(Opcodes.EntityIdMessage)] + public class EntityIdMessage : GameMessage + { + public EntityId Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = new EntityId(); + Field0.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + Field0.Encode(buffer); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("EntityIdMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + Field0.AsText(b, pad); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/FlippyMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/FlippyMessage.cs new file mode 100644 index 00000000..6e13c2d8 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/FlippyMessage.cs @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + /// + /// Sent to the client to play an item drop animation + /// + [Message(Opcodes.FlippyMessage)] + public class FlippyMessage : GameMessage + { + public int ActorID; // Effect is created at the actors location + public int SNOParticleEffect; // SNO for a particle effect or 0x6d82 (default_flippy) for an appearance effect + public int SNOFlippyActor; // -1 for a particle effect or ActorSNO for the actor to use during flipping + public Vector3D Destination; + + public FlippyMessage() : base(Opcodes.FlippyMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + ActorID = buffer.ReadInt(32); + SNOParticleEffect = buffer.ReadInt(32); + SNOFlippyActor = buffer.ReadInt(32); + Destination = new Vector3D(); + Destination.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, ActorID); + buffer.WriteInt(32, SNOParticleEffect); + buffer.WriteInt(32, SNOFlippyActor); + Destination.Encode(buffer); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("FlippyMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ActorID: 0x" + ActorID.ToString("X8") + " (" + ActorID + ")"); + b.Append(' ', pad); b.AppendLine("SNOParticleEffect: 0x" + SNOParticleEffect.ToString("X8")); + b.Append(' ', pad); b.AppendLine("SNOFlippyActor: 0x" + SNOFlippyActor.ToString("X8")); + Destination.AsText(b, pad); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/FloatingAmountMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/FloatingAmountMessage.cs new file mode 100644 index 00000000..42f4a23e --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/FloatingAmountMessage.cs @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + /// + /// Displays either "+x Gold", "+x XP" or "+x Gold and +y XP" + /// + + [Message(Opcodes.FloatingAmountMessage)] + public class FloatingAmountMessage : GameMessage + { + public enum FloatType : int + { + Gold = 0x1c, + XP = 0x1d, + Both = 0x1e // XP in field1 and gold in field2 + } + + public WorldPlace Place; + public int Amount; + public int? OptionalGoldAmount; + public FloatType Type; + + public FloatingAmountMessage() : base(Opcodes.FloatingAmountMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + Place = new WorldPlace(); + Place.Parse(buffer); + Amount = buffer.ReadInt(32); + if (buffer.ReadBool()) + { + OptionalGoldAmount = buffer.ReadInt(32); + } + Type = (FloatType)buffer.ReadInt(6); + } + + public override void Encode(GameBitBuffer buffer) + { + Place.Encode(buffer); + buffer.WriteInt(32, Amount); + buffer.WriteBool(OptionalGoldAmount.HasValue); + if (OptionalGoldAmount.HasValue) + { + buffer.WriteInt(32, OptionalGoldAmount.Value); + } + buffer.WriteInt(6, (int)Type); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("FloatingAmountMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + Place.AsText(b, pad); + b.Append(' ', pad); b.AppendLine("Amount: 0x" + Amount.ToString("X8") + " (" + Amount + ")"); + if (OptionalGoldAmount.HasValue) + { + b.Append(' ', pad); b.AppendLine("OptionalGoldAmount.Value: 0x" + OptionalGoldAmount.Value.ToString("X8") + " (" + OptionalGoldAmount.Value + ")"); + } + b.Append(' ', pad); b.AppendLine("Field3: 0x" + ((int)Type).ToString("X8") + " (" + Type + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/FloatingNumberMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/FloatingNumberMessage.cs new file mode 100644 index 00000000..1ef3b961 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/FloatingNumberMessage.cs @@ -0,0 +1,96 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(Opcodes.FloatingNumberMessage)] + public class FloatingNumberMessage : GameMessage + { + // Enums members with a color in their name display a colored number + // others display a localized string. FloatType.Dodged displays a + // floating "Dodge"... crash sending (int)28 as type + public enum FloatType + { + White = 0, + WhiteCritical, + Golden, + Red2, // GoldenCritical was expected + Red, + RedCritical, + Dodge, + Dodged, + Block, + Parry, + Green, + Absorbed, + Rooted, + Stunned, + Blinded, + Frozen, + Feared, + Charmed, + Taunted, + Snared, + AttackSlowed, + BrokeFreeze, + BrokeBlind, + BrokeStun, + BrokeRoot, + BrokeSnare, + BrokeFear, + Immune + } + + public uint ActorID; + public float Number; + public FloatType Type; + + public FloatingNumberMessage() : base(Opcodes.FloatingNumberMessage) {} + + public override void Parse(GameBitBuffer buffer) + { + ActorID = buffer.ReadUInt(32); + Number = buffer.ReadFloat32(); + Type = (FloatType)buffer.ReadInt(6); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ActorID); + buffer.WriteFloat32(Number); + buffer.WriteInt(6, (int)Type); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("FloatingNumberMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ActorID: 0x" + ActorID.ToString("X8") + " (" + ActorID + ")"); + b.Append(' ', pad); b.AppendLine("Number: " + Number.ToString("G")); + b.Append(' ', pad); b.AppendLine("Type: 0x" + ((int)Type).ToString("X8") + " (" + Type + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/GBIDDataMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/GBIDDataMessage.cs new file mode 100644 index 00000000..f89278bb --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/GBIDDataMessage.cs @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(new[] {Opcodes.GBIDDataMessage1, Opcodes.GBIDDataMessage2, Opcodes.GBIDDataMessage3})] + public class GBIDDataMessage : GameMessage + { + public int /* gbid */ Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("GBIDDataMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/GenericBlobMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/GenericBlobMessage.cs new file mode 100644 index 00000000..710c9779 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/GenericBlobMessage.cs @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(new[] { Opcodes.GenericBlobMessage1, Opcodes.GenericBlobMessage2, Opcodes.GenericBlobMessage3, Opcodes.GenericBlobMessage4, Opcodes.GenericBlobMessage5, + Opcodes.GenericBlobMessage15 })] + public class GenericBlobMessage : GameMessage + { + public byte[] Data; + + public GenericBlobMessage(Opcodes opcode):base(opcode) { } + + public override void Parse(GameBitBuffer buffer) + { + Data = buffer.ReadBlob(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteBlob(32, Data); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("GenericBlobMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Length: 0x" + Data.Length.ToString("X8") + " (" + Data.Length + ")"); + for (int i = 0; i < Data.Length; i += 16) + { + + b.Append(' ', pad); + b.Append(i.ToString("X4")); + b.Append(' '); + + int off = i; + for (int j = 0; j < 8; j++, off++) + { + if (off < Data.Length) + { + b.Append(Data[off].ToString("X2")); + b.Append(' '); + } + else + { + b.Append(' '); b.Append(' '); b.Append(' '); + } + } + b.Append(' '); + off = i + 8; + for (int j = 0; j < 8; j++, off++) + { + if (off < Data.Length) + { + b.Append(Data[off].ToString("X2")); + b.Append(' '); + } + else + { + b.Append(' '); b.Append(' '); b.Append(' '); + } + } + + b.Append(' '); + + off = i; + for (int j = 0; j < 8; j++, off++) + { + if (off < Data.Length) + { + if (Data[off] >= 20 && Data[off] < 128) + b.Append((char)Data[off]); + else + b.Append('.'); + } + else + b.Append(' '); + } + b.Append(' '); + off = i + 8; + for (int j = 0; j < 8; j++, off++) + { + if (off < Data.Length) + { + if (Data[off] >= 20 && Data[off] < 128) + b.Append((char)Data[off]); + else + b.Append('.'); + } + else + b.Append(' '); + } + b.AppendLine(); + } + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/HeartbeatMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/HeartbeatMessage.cs new file mode 100644 index 00000000..3c27d307 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/HeartbeatMessage.cs @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(Opcodes.HeartbeatMessage)] + public class HeartbeatMessage : GameMessage, ISelfHandler + { + public void Handle(GameClient client) + { + // Removes spam every 15 seconds for no handler + } + public override void Parse(GameBitBuffer buffer) + { + } + + public override void Encode(GameBitBuffer buffer) + { + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("HeartbeatMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/HelperDetachMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/HelperDetachMessage.cs new file mode 100644 index 00000000..e79489de --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/HelperDetachMessage.cs @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(Opcodes.HelperDetachMessage)] + public class HelperDetachMessage : GameMessage + { + public int Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("HelperDetachMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/IntDataMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/IntDataMessage.cs new file mode 100644 index 00000000..29ac5e9b --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/IntDataMessage.cs @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(new[] { Opcodes.IntDataMessage1, Opcodes.IntDataMessage2, Opcodes.IntDataMessage3, Opcodes.IntDataMessage4, Opcodes.IntDataMessage5, + Opcodes.IntDataMessage6, Opcodes.IntDataMessage7, Opcodes.IntDataMessage8 })] + public class IntDataMessage : GameMessage + { + public int Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("IntDataMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/InterstitialMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/InterstitialMessage.cs new file mode 100644 index 00000000..23b611df --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/InterstitialMessage.cs @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(Opcodes.InterstitialMessage)] + public class InterstitialMessage : GameMessage + { + public int Field0; + public bool Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(3) + (-1); + Field1 = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(3, Field0 - (-1)); + buffer.WriteBool(Field1); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("InterstitialMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: " + (Field1 ? "true" : "false")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/Message.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/Message.cs new file mode 100644 index 00000000..229a47ef --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/Message.cs @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Game +{ + // which message is this? /raist. + [Message(Opcodes.Message)] + class Message : GameMessage + { + public int Field0; + public int Field1; + public int Field2; + public int Field3; + public float Field4; + public float Field5; + public int Field6; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadInt(32); + Field4 = buffer.ReadFloat32(); + Field5 = buffer.ReadFloat32(); + Field6 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + buffer.WriteInt(32, Field3); + buffer.WriteFloat32(Field4); + buffer.WriteFloat32(Field5); + buffer.WriteInt(32, Field6); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("Message:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', pad); b.AppendLine("Field3: 0x" + Field3.ToString("X8") + " (" + Field3 + ")"); + b.Append(' ', pad); b.AppendLine("Field4: " + Field4.ToString("G")); + b.Append(' ', pad); b.AppendLine("Field5: " + Field5.ToString("G")); + b.Append(' ', pad); b.AppendLine("Field6: 0x" + Field6.ToString("X8") + " (" + Field6 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/NetworkAddressMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/NetworkAddressMessage.cs new file mode 100644 index 00000000..4d688391 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/NetworkAddressMessage.cs @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(Opcodes.NetworkAddressMessage)] + public class NetworkAddressMessage : GameMessage + { + public int Field0; + public short Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = (short)buffer.ReadInt(16); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(16, Field1); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("NetworkAddressMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X4")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/PlayCutsceneMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/PlayCutsceneMessage.cs new file mode 100644 index 00000000..29732767 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/PlayCutsceneMessage.cs @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(Opcodes.PlayCutsceneMessage)] + public class PlayCutsceneMessage : GameMessage + { + public int Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("PlayCutsceneMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/PlayerBannerMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/PlayerBannerMessage.cs new file mode 100644 index 00000000..1b7060f7 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/PlayerBannerMessage.cs @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using D3.GameMessage; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(Opcodes.PlayerBannerMessage)] + public class PlayerBannerMessage : GameMessage + { + public PlayerBanner PlayerBanner; + + public PlayerBannerMessage() : base(Opcodes.PlayerBannerMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + PlayerBanner = PlayerBanner.ParseFrom(buffer.ReadBlob(32)); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteBlob(32, PlayerBanner.ToByteArray()); + } + + public override void AsText(StringBuilder b, int pad) + { + b.AppendLine("PlayerBannerMessage:"); + b.AppendLine(PlayerBanner.ToString()); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/PlayerBusyMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/PlayerBusyMessage.cs new file mode 100644 index 00000000..967ca913 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/PlayerBusyMessage.cs @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + /// + /// Sent by the client if the player busy state changes. It is true if the player + /// is currently in game menues or with an open trade window + /// + [Message(Opcodes.PlayerBusyMessage)] + public class PlayerBusyMessage : GameMessage, ISelfHandler + { + public bool Busy; + + public override void Parse(GameBitBuffer buffer) + { + Busy = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteBool(Busy); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("PlayerBusyMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Busy: " + (Busy ? "true" : "false")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + public void Handle(GameClient client) + { + // TODO: PlayerBusyMessage - The status change is sent back to the client, + // I am waiting for an autosyncing implementation of GameAttributes - farmy + client.Player.Attributes[GameAttribute.Busy] = this.Busy; + } + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/PortalSpecifierMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/PortalSpecifierMessage.cs new file mode 100644 index 00000000..1c06e74f --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/PortalSpecifierMessage.cs @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(Opcodes.PortalSpecifierMessage)] + public class PortalSpecifierMessage : GameMessage + { + public uint ActorID; // Portal's DynamicID + public ResolvedPortalDestination Destination; + + public PortalSpecifierMessage() : base(Opcodes.PortalSpecifierMessage) {} + + public override void Parse(GameBitBuffer buffer) + { + ActorID = buffer.ReadUInt(32); + Destination = new ResolvedPortalDestination(); + Destination.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ActorID); + Destination.Encode(buffer); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("PortalSpecifierMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ActorID: 0x" + ActorID.ToString("X8") + " (" + ActorID + ")"); + Destination.AsText(b, pad); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/ProjectileStickMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/ProjectileStickMessage.cs new file mode 100644 index 00000000..cbbb09d2 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/ProjectileStickMessage.cs @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(Opcodes.ProjectileStickMessage)] + public class ProjectileStickMessage : GameMessage + { + public Vector3D Field0; + public int Field1; + public int /* sno */ Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = new Vector3D(); + Field0.Parse(buffer); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + Field0.Encode(buffer); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ProjectileStickMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + Field0.AsText(b, pad); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Field2.ToString("X8")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/RareItemNameMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/RareItemNameMessage.cs new file mode 100644 index 00000000..186ed5fc --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/RareItemNameMessage.cs @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(Opcodes.RareItemNameMessage)] + public class RareItemNameMessage : GameMessage + { + public int Field0; + public RareItemName Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = new RareItemName(); + Field1.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + Field1.Encode(buffer); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("RareItemNameMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + Field1.AsText(b, pad); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/RareMonsterNamesMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/RareMonsterNamesMessage.cs new file mode 100644 index 00000000..a5d17ec7 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/RareMonsterNamesMessage.cs @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(Opcodes.RareMonsterNamesMessage)] + public class RareMonsterNamesMessage : GameMessage + { + public int Field0; + // MaxLength = 2 + public int /* gbid */[] Field1; + // MaxLength = 8 + public int /* gbid */[] Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = new int /* gbid */[2]; + for (int i = 0; i < Field1.Length; i++) Field1[i] = buffer.ReadInt(32); + Field2 = new int /* gbid */[8]; + for (int i = 0; i < Field2.Length; i++) Field2[i] = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + for (int i = 0; i < Field1.Length; i++) buffer.WriteInt(32, Field1[i]); + for (int i = 0; i < Field2.Length; i++) buffer.WriteInt(32, Field2[i]); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("RareMonsterNamesMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1:"); + b.Append(' ', pad); b.AppendLine("{"); + for (int i = 0; i < Field1.Length; ) { b.Append(' ', pad + 1); for (int j = 0; j < 8 && i < Field1.Length; j++, i++) { b.Append("0x" + Field1[i].ToString("X8") + ", "); } b.AppendLine(); } + b.Append(' ', pad); b.AppendLine("}"); b.AppendLine(); + b.Append(' ', pad); b.AppendLine("Field2:"); + b.Append(' ', pad); b.AppendLine("{"); + for (int i = 0; i < Field2.Length; ) { b.Append(' ', pad + 1); for (int j = 0; j < 8 && i < Field2.Length; j++, i++) { b.Append("0x" + Field2[i].ToString("X8") + ", "); } b.AppendLine(); } + b.Append(' ', pad); b.AppendLine("}"); b.AppendLine(); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/RemoveRagdollMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/RemoveRagdollMessage.cs new file mode 100644 index 00000000..f99e89a6 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/RemoveRagdollMessage.cs @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(Opcodes.RemoveRagdollMessage)] + public class RemoveRagdollMessage : GameMessage + { + public int Field0; + public int /* sno */ Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("RemoveRagdollMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/ReturnPointInfoMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/ReturnPointInfoMessage.cs new file mode 100644 index 00000000..c048829e --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/ReturnPointInfoMessage.cs @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(Opcodes.ReturnPointInfoMessage)] + public class ReturnPointInfoMessage : GameMessage + { + public int /* sno */ snoLevelArea; + + public override void Parse(GameBitBuffer buffer) + { + snoLevelArea = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, snoLevelArea); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ReturnPointInfoMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("snoLevelArea: 0x" + snoLevelArea.ToString("X8")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/RopeEffectMessageACDToACD.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/RopeEffectMessageACDToACD.cs new file mode 100644 index 00000000..40343cd0 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/RopeEffectMessageACDToACD.cs @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(Opcodes.RopeEffectMessageACDToACD)] + public class RopeEffectMessageACDToACD : GameMessage + { + public int /* sno */ RopeSNO; + public int StartSourceActorId; + public int Field2; // always seems to be 4 + public int DestinationActorId; + public int Field4; // always seems to be 1 + + public RopeEffectMessageACDToACD() : base(Opcodes.RopeEffectMessageACDToACD) { } + + public override void Parse(GameBitBuffer buffer) + { + RopeSNO = buffer.ReadInt(32); + StartSourceActorId = buffer.ReadInt(32); + Field2 = buffer.ReadInt(5); + DestinationActorId = buffer.ReadInt(32); + Field4 = buffer.ReadInt(5); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, RopeSNO); + buffer.WriteInt(32, StartSourceActorId); + buffer.WriteInt(5, Field2); + buffer.WriteInt(32, DestinationActorId); + buffer.WriteInt(5, Field4); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("RopeEffectMessageACDToACD:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("RopeSNO: 0x" + RopeSNO.ToString("X8")); + b.Append(' ', pad); b.AppendLine("StartSourceActorId: 0x" + StartSourceActorId.ToString("X8") + " (" + StartSourceActorId + ")"); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', pad); b.AppendLine("DestinationActorId: 0x" + DestinationActorId.ToString("X8") + " (" + DestinationActorId + ")"); + b.Append(' ', pad); b.AppendLine("Field4: 0x" + Field4.ToString("X8") + " (" + Field4 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/RopeEffectMessageACDToPlace.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/RopeEffectMessageACDToPlace.cs new file mode 100644 index 00000000..c0eef891 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/RopeEffectMessageACDToPlace.cs @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(Opcodes.RopeEffectMessageACDToPlace)] + public class RopeEffectMessageACDToPlace : GameMessage + { + public int /* sno */ RopeSNO; + public int StartSourceActorId; + public int Field2; // always seem to be 4 + public WorldPlace EndPosition; + + public RopeEffectMessageACDToPlace() : base(Opcodes.RopeEffectMessageACDToPlace) {} + + public override void Parse(GameBitBuffer buffer) + { + RopeSNO = buffer.ReadInt(32); + StartSourceActorId = buffer.ReadInt(32); + Field2 = buffer.ReadInt(5); + EndPosition = new WorldPlace(); + EndPosition.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, RopeSNO); + buffer.WriteInt(32, StartSourceActorId); + buffer.WriteInt(5, Field2); + EndPosition.Encode(buffer); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("RopeEffectMessageACDToPlace:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("RopeSNO: 0x" + RopeSNO.ToString("X8")); + b.Append(' ', pad); b.AppendLine("StartSourceActorId: 0x" + StartSourceActorId.ToString("X8") + " (" + StartSourceActorId + ")"); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + EndPosition.AsText(b, pad); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/SNODataMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/SNODataMessage.cs new file mode 100644 index 00000000..d9684087 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/SNODataMessage.cs @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(new [] { Opcodes.SNODataMessage2, Opcodes.SNODataMessage4, Opcodes.SNODataMessage7 })] + public class SNODataMessage : GameMessage + { + public int /* sno */ Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("SNODataMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/SNONameDataMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/SNONameDataMessage.cs new file mode 100644 index 00000000..ff8608ba --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/SNONameDataMessage.cs @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Core.GS.Common.Types.SNO; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(Opcodes.SNONameDataMessage)] + public class SNONameDataMessage : GameMessage + { + public SNOHandle Name; + + public SNONameDataMessage() : base(Opcodes.SNONameDataMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + Name = new SNOHandle(); + Name.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + Name.Encode(buffer); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("SNONameDataMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + Name.AsText(b, pad); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/SalvageResultsMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/SalvageResultsMessage.cs new file mode 100644 index 00000000..b72b8036 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/SalvageResultsMessage.cs @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(Opcodes.SalvageResultsMessage)] + public class SalvageResultsMessage : GameMessage + { + public int /* gbid */ gbidOriginalItem; + public int Field1; + public int Field2; + // MaxLength = 10 + public int /* gbid */[] gbidNewItems; + + public SalvageResultsMessage() : base(Opcodes.SalvageResultsMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + gbidOriginalItem = buffer.ReadInt(32); + Field1 = buffer.ReadInt(4) + (-1); + Field2 = buffer.ReadInt(32); + gbidNewItems = new int /* gbid */[10]; + for (int i = 0; i < gbidNewItems.Length; i++) gbidNewItems[i] = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, gbidOriginalItem); + buffer.WriteInt(4, Field1 - (-1)); + buffer.WriteInt(32, Field2); + for (int i = 0; i < gbidNewItems.Length; i++) buffer.WriteInt(32, gbidNewItems[i]); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("SalvageResultsMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("gbidOriginalItem: 0x" + gbidOriginalItem.ToString("X8")); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', pad); b.AppendLine("gbidNewItems:"); + b.Append(' ', pad); b.AppendLine("{"); + for (int i = 0; i < gbidNewItems.Length; ) { b.Append(' ', pad + 1); for (int j = 0; j < 8 && i < gbidNewItems.Length; j++, i++) { b.Append("0x" + gbidNewItems[i].ToString("X8") + ", "); } b.AppendLine(); } + b.Append(' ', pad); b.AppendLine("}"); b.AppendLine(); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/SavePointInfoMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/SavePointInfoMessage.cs new file mode 100644 index 00000000..249ef30d --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/SavePointInfoMessage.cs @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(Opcodes.SavePointInfoMessage)] + public class SavePointInfoMessage : GameMessage + { + public int /* sno */ snoLevelArea; + + public SavePointInfoMessage():base(Opcodes.SavePointInfoMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + snoLevelArea = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, snoLevelArea); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("SavePointInfoMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("snoLevelArea: 0x" + snoLevelArea.ToString("X8")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/SaviorMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/SaviorMessage.cs new file mode 100644 index 00000000..b7a96f71 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/SaviorMessage.cs @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(Opcodes.SaviorMessage)] + public class SaviorMessage : GameMessage + { + public int Field0; + public int Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("SaviorMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/ShrineActivatedMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/ShrineActivatedMessage.cs new file mode 100644 index 00000000..5932bbd0 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/ShrineActivatedMessage.cs @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(Opcodes.ShrineActivatedMessage)] + public class ShrineActivatedMessage : GameMessage + { + public uint ActorID; // Actor's DynamicID + + public ShrineActivatedMessage() : base(Opcodes.ShrineActivatedMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + ActorID = buffer.ReadUInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ActorID); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ActivateShrineMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ActorID: 0x" + ActorID.ToString("X8") + " (" + ActorID + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/SimpleMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/SimpleMessage.cs new file mode 100644 index 00000000..82596858 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/SimpleMessage.cs @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + // Mostly contains messages we don't know yet what they're used for. + // When you discover a message's use and implement it (in a new file), please remove the associated opcode below. /raist. + + [Message( + new[] { + Opcodes.SimpleMessage1, Opcodes.SimpleMessage2, Opcodes.SimpleMessage3, Opcodes.SimpleMessage4, Opcodes.SimpleMessage5, Opcodes.SimpleMessage6, + Opcodes.GameSetupMessageAck, Opcodes.SimpleMessage8, Opcodes.SimpleMessage10, Opcodes.SimpleMessage11, Opcodes.SimpleMessage14, Opcodes.SimpleMessage16, + Opcodes.SimpleMessage18, Opcodes.SimpleMessage20, Opcodes.SimpleMessage21, Opcodes.SimpleMessage22, Opcodes.SimpleMessage23, Opcodes.SimpleMessage24, + Opcodes.SimpleMessage25, Opcodes.SimpleMessage26, Opcodes.SimpleMessage27, Opcodes.SimpleMessage28, Opcodes.SimpleMessage29, Opcodes.SimpleMessage30, + Opcodes.RepairAllMessage, Opcodes.RepairEquippedMessage, Opcodes.SimpleMessage36, Opcodes.SimpleMessage37, Opcodes.CancelCinematicsMessage, + Opcodes.SimpleMessage39, Opcodes.SimpleMessage40, Opcodes.SimpleMessage42, Opcodes.SimpleMessage47, Opcodes.SimpleMessage48, Opcodes.SimpleMessage49, + Opcodes.SimpleMessage50, Opcodes.SimpleMessage51, Opcodes.SimpleMessage52 + })] + public class SimpleMessage : GameMessage + { + + public override void Parse(GameBitBuffer buffer) + { + // do not return back a not-implemented exception! /raist. + } + + public override void Encode(GameBitBuffer buffer) + { + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("SimpleMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/TimedEventStartedMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/TimedEventStartedMessage.cs new file mode 100644 index 00000000..2a987acc --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/TimedEventStartedMessage.cs @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(Opcodes.TimedEventStartedMessage)] + public class TimedEventStartedMessage : GameMessage + { + public ActiveEvent Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = new ActiveEvent(); + Field0.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + Field0.Encode(buffer); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("TimedEventStartedMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + Field0.AsText(b, pad); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/TrickleMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/TrickleMessage.cs new file mode 100644 index 00000000..fa43d4e1 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/TrickleMessage.cs @@ -0,0 +1,224 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + /// + /// Warning! Most of this documentation is speculation or just a description of + /// what the fields are, not what purpose they actually have. For questions ask me - farmy + /// + /// This message is periodically sent to the client for stuff like Players/NPC/Followers or the stash + /// I guess that this message is used to keep the client updated about actors not in range for revealing + /// (though the server happily sends TrickleMessages about actors currently revealed, so maybe its a general update. + /// It also contains information about the levelarea of actors the client would not know otherwise) + /// + [Message(Opcodes.TrickleMessage)] + public class TrickleMessage : GameMessage + { + public uint ActorId; + public int ActorSNO; + public WorldPlace WorldLocation; + public int? PlayerIndex; // only set for players, their lethal decoys and their spawns (companions like snake) + public int LevelAreaSNO; // sno of the level area the actor currently is in + public float? Field5; // ??? Mostly 0.99 < Field5 <= 1 but can have any value between 0 and 1. 0 for proxy actors + public int Field6; + public int Field7; + public int? Field8; // never seen it set + public int? MinimapTextureSNO; // SNO of the icon used to display that actor on the minimap if set + public int? Field10; // could that be a string hash used for the STL in field11? minimap markers appear without text nevertheless + public int? Field11; // Setting this to 0x21380817 makes a yellow exclamation mark appear (used for leah, cumford, imprisoned templar) + public int? StringListSNO; // ALWAYS?? 0x0000F063:Minimap.stl + public float? Field13; // either 225 or null + public float? Field14; // never seen != null + public bool? Field15; + + public TrickleMessage() : base(Opcodes.TrickleMessage) {} + + public override void Parse(GameBitBuffer buffer) + { + ActorId = buffer.ReadUInt(32); + ActorSNO = buffer.ReadInt(32); + WorldLocation = new WorldPlace(); + WorldLocation.Parse(buffer); + if (buffer.ReadBool()) + { + PlayerIndex = buffer.ReadInt(4) + (-1); + } + LevelAreaSNO = buffer.ReadInt(32); + if (buffer.ReadBool()) + { + Field5 = buffer.ReadFloat32(); + } + Field6 = buffer.ReadInt(4); + Field7 = buffer.ReadInt(6); + if (buffer.ReadBool()) + { + Field8 = buffer.ReadInt(32); + } + if (buffer.ReadBool()) + { + MinimapTextureSNO = buffer.ReadInt(32); + } + if (buffer.ReadBool()) + { + Field10 = buffer.ReadInt(32); + } + if (buffer.ReadBool()) + { + Field11 = buffer.ReadInt(32); + } + if (buffer.ReadBool()) + { + StringListSNO = buffer.ReadInt(32); + } + if (buffer.ReadBool()) + { + Field13 = buffer.ReadFloat32(); + } + if (buffer.ReadBool()) + { + Field14 = buffer.ReadFloat32(); + } + if (buffer.ReadBool()) + { + Field15 = buffer.ReadBool(); + } + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ActorId); + buffer.WriteInt(32, ActorSNO); + WorldLocation.Encode(buffer); + buffer.WriteBool(PlayerIndex.HasValue); + if (PlayerIndex.HasValue) + { + buffer.WriteInt(4, PlayerIndex.Value - (-1)); + } + buffer.WriteInt(32, LevelAreaSNO); + buffer.WriteBool(Field5.HasValue); + if (Field5.HasValue) + { + buffer.WriteFloat32(Field5.Value); + } + buffer.WriteInt(4, Field6); + buffer.WriteInt(6, Field7); + buffer.WriteBool(Field8.HasValue); + if (Field8.HasValue) + { + buffer.WriteInt(32, Field8.Value); + } + buffer.WriteBool(MinimapTextureSNO.HasValue); + if (MinimapTextureSNO.HasValue) + { + buffer.WriteInt(32, MinimapTextureSNO.Value); + } + buffer.WriteBool(Field10.HasValue); + if (Field10.HasValue) + { + buffer.WriteInt(32, Field10.Value); + } + buffer.WriteBool(Field11.HasValue); + if (Field11.HasValue) + { + buffer.WriteInt(32, Field11.Value); + } + buffer.WriteBool(StringListSNO.HasValue); + if (StringListSNO.HasValue) + { + buffer.WriteInt(32, StringListSNO.Value); + } + buffer.WriteBool(Field13.HasValue); + if (Field13.HasValue) + { + buffer.WriteFloat32(Field13.Value); + } + buffer.WriteBool(Field14.HasValue); + if (Field14.HasValue) + { + buffer.WriteFloat32(Field14.Value); + } + buffer.WriteBool(Field15.HasValue); + if (Field15.HasValue) + { + buffer.WriteBool(Field15.Value); + } + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("TrickleMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ActorID: 0x" + ActorId.ToString("X8") + " (" + ActorId + ")"); + b.Append(' ', pad); b.AppendLine("ActorSNO: 0x" + ActorSNO.ToString("X8")); + WorldLocation.AsText(b, pad); + if (PlayerIndex.HasValue) + { + b.Append(' ', pad); b.AppendLine("PlayerIndex.Value: 0x" + PlayerIndex.Value.ToString("X8") + " (" + PlayerIndex.Value + ")"); + } + b.Append(' ', pad); b.AppendLine("LevelAreaSNO: 0x" + LevelAreaSNO.ToString("X8")); + if (Field5.HasValue) + { + b.Append(' ', pad); b.AppendLine("Field5.Value: " + Field5.Value.ToString("G")); + } + b.Append(' ', pad); b.AppendLine("Field6: 0x" + Field6.ToString("X8") + " (" + Field6 + ")"); + b.Append(' ', pad); b.AppendLine("Field7: 0x" + Field7.ToString("X8") + " (" + Field7 + ")"); + if (Field8.HasValue) + { + b.Append(' ', pad); b.AppendLine("Field8.Value: 0x" + Field8.Value.ToString("X8") + " (" + Field8.Value + ")"); + } + if (MinimapTextureSNO.HasValue) + { + b.Append(' ', pad); b.AppendLine("MinimapTextureSNO.Value: 0x" + MinimapTextureSNO.Value.ToString("X8") + " (" + MinimapTextureSNO.Value + ")"); + } + if (Field10.HasValue) + { + b.Append(' ', pad); b.AppendLine("Field10.Value: 0x" + Field10.Value.ToString("X8") + " (" + Field10.Value + ")"); + } + if (Field11.HasValue) + { + b.Append(' ', pad); b.AppendLine("Field11.Value: 0x" + Field11.Value.ToString("X8") + " (" + Field11.Value + ")"); + } + if (StringListSNO.HasValue) + { + b.Append(' ', pad); b.AppendLine("StringListSNO.Value: 0x" + StringListSNO.Value.ToString("X8") + " (" + StringListSNO.Value + ")"); + } + if (Field13.HasValue) + { + b.Append(' ', pad); b.AppendLine("Field13.Value: " + Field13.Value.ToString("G")); + } + if (Field14.HasValue) + { + b.Append(' ', pad); b.AppendLine("Field14.Value: " + Field14.Value.ToString("G")); + } + if (Field15.HasValue) + { + b.Append(' ', pad); b.AppendLine("Field15.Value: " + (Field15.Value ? "true" : "false")); + } + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/UInt64DataMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/UInt64DataMessage.cs new file mode 100644 index 00000000..4cbfa06f --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/UInt64DataMessage.cs @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(Opcodes.UInt64DataMessage)] + public class UInt64DataMessage : GameMessage + { + public long Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt64(64); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt64(64, Field0); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("UInt64DataMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X16")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/VoteKickMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/VoteKickMessage.cs new file mode 100644 index 00000000..66d0f054 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/VoteKickMessage.cs @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Inventory +{ + [Message( new[] {Opcodes.VoteKickMessage1, Opcodes.VoteKickMessage2})] + class VoteKickMessage : GameMessage + { + public int Field0; + public int Field1; + public string Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(4) + (-1); + Field1 = buffer.ReadInt(4) + (-1); + Field2 = buffer.ReadCharArray(512); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(4, Field0 - (-1)); + buffer.WriteInt(4, Field1 - (-1)); + buffer.WriteCharArray(512, Field2); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("VoteKickMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); b.AppendLine("Field2: " + Field2); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/NPC/NPCInteractOptionsMessage.cs b/src/Mooege/Net/GS/Message/Definitions/NPC/NPCInteractOptionsMessage.cs new file mode 100644 index 00000000..4c3b38af --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/NPC/NPCInteractOptionsMessage.cs @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.NPC +{ + [Message(Opcodes.NPCInteractOptionsMessage)] + public class NPCInteractOptionsMessage : GameMessage + { + public uint ActorID; + // MaxLength = 20 + public NPCInteraction[] tNPCInteraction; + public NPCInteractOptionsType Type; + + public NPCInteractOptionsMessage() + : base(Opcodes.NPCInteractOptionsMessage) + { } + + public override void Parse(GameBitBuffer buffer) + { + ActorID = buffer.ReadUInt(32); + tNPCInteraction = new NPCInteraction[buffer.ReadInt(5)]; + for (int i = 0; i < tNPCInteraction.Length; i++) { tNPCInteraction[i] = new NPCInteraction(); tNPCInteraction[i].Parse(buffer); } + Type = (NPCInteractOptionsType) buffer.ReadInt(2); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ActorID); + buffer.WriteInt(5, tNPCInteraction.Length); + for (int i = 0; i < tNPCInteraction.Length; i++) { tNPCInteraction[i].Encode(buffer); } + buffer.WriteInt(2, (int)Type); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("NPCInteractOptionsMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ActorID: 0x" + ActorID.ToString("X8") + " (" + ActorID + ")"); + b.Append(' ', pad); b.AppendLine("tNPCInteraction:"); + b.Append(' ', pad); b.AppendLine("{"); + for (int i = 0; i < tNPCInteraction.Length; i++) { tNPCInteraction[i].AsText(b, pad + 1); b.AppendLine(); } + b.Append(' ', pad); b.AppendLine("}"); b.AppendLine(); + b.Append(' ', pad); b.AppendLine("Type: 0x" + ((int)Type).ToString("X8") + " (" + Type + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } + + public enum NPCInteractOptionsType + { + Normal = 0, + Conversation = 1, + Unknown2 = 2, // Works like normal? /fasbat + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/NPC/NPCSelectConversationMessage.cs b/src/Mooege/Net/GS/Message/Definitions/NPC/NPCSelectConversationMessage.cs new file mode 100644 index 00000000..b881be50 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/NPC/NPCSelectConversationMessage.cs @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.NPC +{ + [Message(Opcodes.NPCSelectConversationMessage, Consumers.SelectedNPC)] + public class NPCSelectConversationMessage : GameMessage + { + public int ConversationSNO; + + public override void Parse(GameBitBuffer buffer) + { + ConversationSNO = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, ConversationSNO); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("NPCSelectConversationMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ConversationSNO: 0x" + ConversationSNO.ToString("X8") + " (" + ConversationSNO + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Pet/PetDetachMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Pet/PetDetachMessage.cs new file mode 100644 index 00000000..813ddedf --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Pet/PetDetachMessage.cs @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Pet +{ + [Message(Opcodes.PetDetachMessage)] + public class PetDetachMessage : GameMessage + { + public int Field0; + public bool Field1; + + public PetDetachMessage() + : base(Opcodes.PetDetachMessage) + { + } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteBool(Field1); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("PetDetachMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad);b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1 " + (Field1 ? "true" : "false")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Pet/PetMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Pet/PetMessage.cs new file mode 100644 index 00000000..49fa16ad --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Pet/PetMessage.cs @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Pet +{ + [Message(Opcodes.PetMessage)] + public class PetMessage : GameMessage + { + public int Field0; + public int Field1; + public uint PetId; + public int Field3; + + public PetMessage() + : base(Opcodes.PetMessage) + { + } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(3); + Field1 = buffer.ReadInt(5); + PetId = buffer.ReadUInt(32); + Field3 = buffer.ReadInt(5) + (-1); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(3, Field0); + buffer.WriteInt(5, Field1); + buffer.WriteUInt(32, PetId); + buffer.WriteInt(5, Field3 - (-1)); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("PetMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); b.AppendLine("PetId: 0x" + PetId.ToString("X8") + " (" + PetId + ")"); + b.Append(' ', pad); b.AppendLine("Field3: 0x" + Field3.ToString("X8") + " (" + Field3 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Player/LoadCompleteMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Player/LoadCompleteMessage.cs new file mode 100644 index 00000000..505d8744 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Player/LoadCompleteMessage.cs @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Player +{ + [Message(Opcodes.LoadCompleteMessage)] + public class LoadCompleteMessage : GameMessage, ISelfHandler + { + + public void Handle(GameClient client) + { + client.Player.Attributes[GameAttribute.Banter_Cooldown, 0xFFFFF] = 0x000007C9; + client.Player.Attributes[GameAttribute.Buff_Active, 0x20CBE] = true; + client.Player.Attributes[GameAttribute.Buff_Active, 0x33C40] = false; + client.Player.Attributes[GameAttribute.Immobolize] = false; + client.Player.Attributes[GameAttribute.Untargetable] = false; + client.Player.Attributes[GameAttribute.CantStartDisplayedPowers] = false; + client.Player.Attributes[GameAttribute.Buff_Icon_Start_Tick0, 0x20CBE] = 0xC1; + client.Player.Attributes[GameAttribute.Disabled] = false; + client.Player.Attributes[GameAttribute.Hidden] = false; + client.Player.Attributes[GameAttribute.Buff_Icon_Count0, 0x33C40] = 0; + client.Player.Attributes[GameAttribute.Buff_Icon_End_Tick0, 0x20CBE] = 0x7C9; + client.Player.Attributes[GameAttribute.Loading] = false; + client.Player.Attributes[GameAttribute.Buff_Icon_End_Tick0, 0x33C40] = 0; + client.Player.Attributes[GameAttribute.Invulnerable] = false; + client.Player.Attributes[GameAttribute.Buff_Icon_Count0, 0x20CBE] = 1; + client.Player.Attributes[GameAttribute.Buff_Icon_Start_Tick0, 0x33C40] = 0; + + client.Player.Attributes.BroadcastChangedIfRevealed(); + } + + public override void Parse(GameBitBuffer buffer) + { + } + + public override void Encode(GameBitBuffer buffer) + { + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("LoadCompleteMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Player/NewPlayerMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Player/NewPlayerMessage.cs new file mode 100644 index 00000000..59f82975 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Player/NewPlayerMessage.cs @@ -0,0 +1,101 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Player +{ + [Message(Opcodes.NewPlayerMessage)] + public class NewPlayerMessage : GameMessage + { + public int PlayerIndex; + public EntityId ToonId; + public EntityId GameAccountId; + public string ToonName; + public int Field3; + public int Field4; + public int /* sno */ snoActorPortrait; + public int Field6; + public HeroStateData StateData; + public bool Field8; + public int Field9; + public uint ActorID; // Hero's DynamicID + + public NewPlayerMessage() : base(Opcodes.NewPlayerMessage) {} + + public override void Parse(GameBitBuffer buffer) + { + PlayerIndex = buffer.ReadInt(3); + ToonId = new EntityId(); + ToonId.Parse(buffer); + GameAccountId = new EntityId(); + GameAccountId.Parse(buffer); + ToonName = buffer.ReadCharArray(49); + Field3 = buffer.ReadInt(5) + (-1); + Field4 = buffer.ReadInt(3) + (-1); + snoActorPortrait = buffer.ReadInt(32); + Field6 = buffer.ReadInt(7); + StateData = new HeroStateData(); + StateData.Parse(buffer); + Field8 = buffer.ReadBool(); + Field9 = buffer.ReadInt(32); + ActorID = buffer.ReadUInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(3, PlayerIndex); + ToonId.Encode(buffer); + GameAccountId.Encode(buffer); + buffer.WriteCharArray(49, ToonName); + buffer.WriteInt(5, Field3 - (-1)); + buffer.WriteInt(3, Field4 - (-1)); + buffer.WriteInt(32, snoActorPortrait); + buffer.WriteInt(7, Field6); + StateData.Encode(buffer); + buffer.WriteBool(Field8); + buffer.WriteInt(32, Field9); + buffer.WriteUInt(32, ActorID); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("NewPlayerMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("PlayerIndex: 0x" + PlayerIndex.ToString("X8") + " (" + PlayerIndex + ")"); + ToonId.AsText(b, pad); + GameAccountId.AsText(b, pad); + b.Append(' ', pad); b.AppendLine("ToonName: \"" + ToonName + "\""); + b.Append(' ', pad); b.AppendLine("Field3: 0x" + Field3.ToString("X8") + " (" + Field3 + ")"); + b.Append(' ', pad); b.AppendLine("Field4: 0x" + Field4.ToString("X8") + " (" + Field4 + ")"); + b.Append(' ', pad); b.AppendLine("snoActorPortrait: 0x" + snoActorPortrait.ToString("X8")); + b.Append(' ', pad); b.AppendLine("Field6: 0x" + Field6.ToString("X8") + " (" + Field6 + ")"); + StateData.AsText(b, pad); + b.Append(' ', pad); b.AppendLine("Field8: " + (Field8 ? "true" : "false")); + b.Append(' ', pad); b.AppendLine("Field9: 0x" + Field9.ToString("X8") + " (" + Field9 + ")"); + b.Append(' ', pad); b.AppendLine("ActorID: 0x" + ActorID.ToString("X8") + " (" + ActorID + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Player/PlayerActorSetInitialMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Player/PlayerActorSetInitialMessage.cs new file mode 100644 index 00000000..710b3536 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Player/PlayerActorSetInitialMessage.cs @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Player +{ + [Message(Opcodes.PlayerActorSetInitialMessage)] + public class PlayerActorSetInitialMessage : GameMessage + { + public uint ActorId; // Player's DynamicID + public int PlayerIndex; + + public PlayerActorSetInitialMessage() : base(Opcodes.PlayerActorSetInitialMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + ActorId = buffer.ReadUInt(32); + PlayerIndex = buffer.ReadInt(3); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ActorId); + buffer.WriteInt(3, PlayerIndex); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("PlayerActorSetInitialMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ActorId: 0x" + ActorId.ToString("X8") + " (" + ActorId + ")"); + b.Append(' ', pad); b.AppendLine("PlayerIndex: 0x" + PlayerIndex.ToString("X8") + " (" + PlayerIndex + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Player/PlayerDeSyncSnapMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Player/PlayerDeSyncSnapMessage.cs new file mode 100644 index 00000000..8a32ac64 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Player/PlayerDeSyncSnapMessage.cs @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Player +{ + [Message(Opcodes.PlayerDeSyncSnapMessage)] + public class PlayerDeSyncSnapMessage : GameMessage + { + public WorldPlace Field0; + public int Field1; + public int /* sno */ Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = new WorldPlace(); + Field0.Parse(buffer); + Field1 = buffer.ReadInt(2); + Field2 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + Field0.Encode(buffer); + buffer.WriteInt(2, Field1); + buffer.WriteInt(32, Field2); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("PlayerDeSyncSnapMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + Field0.AsText(b, pad); + b.Append(' ', pad); b.AppendLine("Field1: " + Field1.ToString()); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Field2.ToString("X8")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Player/PlayerEnterKnownMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Player/PlayerEnterKnownMessage.cs new file mode 100644 index 00000000..3fd5f3f8 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Player/PlayerEnterKnownMessage.cs @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Player +{ + [Message(Opcodes.PlayerEnterKnownMessage)] + public class PlayerEnterKnownMessage : GameMessage + { + public int PlayerIndex; + public uint ActorId; // Player's DynamicID + + public PlayerEnterKnownMessage() : base(Opcodes.PlayerEnterKnownMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + PlayerIndex = buffer.ReadInt(3); + ActorId = buffer.ReadUInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(3, PlayerIndex); + buffer.WriteUInt(32, ActorId); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("PlayerEnterKnownMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("PlayerIndex: 0x" + PlayerIndex.ToString("X8") + " (" + PlayerIndex + ")"); + b.Append(' ', pad); b.AppendLine("ActorId: 0x" + ActorId.ToString("X8") + " (" + ActorId + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Player/PlayerIndexMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Player/PlayerIndexMessage.cs new file mode 100644 index 00000000..fae0cd9c --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Player/PlayerIndexMessage.cs @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Player +{ + [Message(new[] {Opcodes.PlayerIndexMessage1, Opcodes.PlayerIndexMessage2, Opcodes.PlayerIndexMessage3, Opcodes.PlayerIndexMessage4, Opcodes.PlayerIndexMessage5})] + public class PlayerIndexMessage : GameMessage + { + public int Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(4) + (-1); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(4, Field0 - (-1)); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("PlayerIndexMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Player/PlayerKickTimerMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Player/PlayerKickTimerMessage.cs new file mode 100644 index 00000000..262c2634 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Player/PlayerKickTimerMessage.cs @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Player +{ + [Message(Opcodes.PlayerKickTimerMessage)] + public class PlayerKickTimerMessage : GameMessage + { + public int Field0; + public int Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("PlayerKickTimerMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Player/PlayerLevel.cs b/src/Mooege/Net/GS/Message/Definitions/Player/PlayerLevel.cs new file mode 100644 index 00000000..fe204eff --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Player/PlayerLevel.cs @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Player +{ + [Message(Opcodes.PlayerLevel)] + public class PlayerLevel : GameMessage + { + public PlayerLevel() : base(Opcodes.PlayerLevel) { } + + public int PlayerIndex; + public int Level; + + public override void Parse(GameBitBuffer buffer) + { + PlayerIndex = buffer.ReadInt(3); + Level = buffer.ReadInt(7); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(3, PlayerIndex); + buffer.WriteInt(7, Level); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("PlayerLevel:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("PlayerIndex: 0x" + PlayerIndex.ToString("X8") + " (" + PlayerIndex + ")"); + b.Append(' ', pad); b.AppendLine("Level: 0x" + Level.ToString("X8") + " (" + Level + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Player/PlayerMovementMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Player/PlayerMovementMessage.cs new file mode 100644 index 00000000..4fa8c390 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Player/PlayerMovementMessage.cs @@ -0,0 +1,153 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Player +{ + /// + /// Clients sends this to server when the player moves. + /// + [Message(Opcodes.PlayerMovementMessage, Consumers.Player)] + public class PlayerMovementMessage : GameMessage + { + public int ActorId; + public Vector3D Position; // New position of the Actor + public float? Angle; // Angle between actors X axis and world x axis in radians + public bool? Field3; // maybe immediatly rotating like in TranslateFacing? - farmy + public float? Speed; // Speed of the actor while moving, if moving. In game units / tick + public int? Field5; + public int? AnimationTag; // Animation used while moving, if moving + public int? Field7; + + public override void Parse(GameBitBuffer buffer) + { + ActorId = buffer.ReadInt(32); + if (buffer.ReadBool()) + { + Position = new Vector3D(); + Position.Parse(buffer); + } + if (buffer.ReadBool()) + { + Angle = buffer.ReadFloat32(); + } + if (buffer.ReadBool()) + { + Field3 = buffer.ReadBool(); + } + if (buffer.ReadBool()) + { + Speed = buffer.ReadFloat32(); + } + if (buffer.ReadBool()) + { + Field5 = buffer.ReadInt(25); + } + if (buffer.ReadBool()) + { + AnimationTag = buffer.ReadInt(21) + (-1); + } + if (buffer.ReadBool()) + { + Field7 = buffer.ReadInt(32); + } + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, ActorId); + buffer.WriteBool(Position != null); + if (Position != null) + { + Position.Encode(buffer); + } + buffer.WriteBool(Angle.HasValue); + if (Angle.HasValue) + { + buffer.WriteFloat32(Angle.Value); + } + buffer.WriteBool(Field3.HasValue); + if (Field3.HasValue) + { + buffer.WriteBool(Field3.Value); + } + buffer.WriteBool(Speed.HasValue); + if (Speed.HasValue) + { + buffer.WriteFloat32(Speed.Value); + } + buffer.WriteBool(Field5.HasValue); + if (Field5.HasValue) + { + buffer.WriteInt(25, Field5.Value); + } + buffer.WriteBool(AnimationTag.HasValue); + if (AnimationTag.HasValue) + { + buffer.WriteInt(21, AnimationTag.Value - (-1)); + } + buffer.WriteBool(Field7.HasValue); + if (Field7.HasValue) + { + buffer.WriteInt(32, Field7.Value); + } + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("PlayerMovementMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ActorId: 0x" + ActorId.ToString("X8")); + if (Position != null) + { + Position.AsText(b, pad); + } + if (Angle.HasValue) + { + b.Append(' ', pad); b.AppendLine("Angle.Value: " + Angle.Value.ToString("G")); + } + if (Field3.HasValue) + { + b.Append(' ', pad); b.AppendLine("Field3.Value: " + (Field3.Value ? "true" : "false")); + } + if (Speed.HasValue) + { + b.Append(' ', pad); b.AppendLine("Speed.Value: " + Speed.Value.ToString("G")); + } + if (Field5.HasValue) + { + b.Append(' ', pad); b.AppendLine("Field5.Value: 0x" + Field5.Value.ToString("X8") + " (" + Field5.Value + ")"); + } + if (AnimationTag.HasValue) + { + b.Append(' ', pad); b.AppendLine("AnimationTag.Value: 0x" + AnimationTag.Value.ToString("X8") + " (" + AnimationTag.Value + ")"); + } + if (Field7.HasValue) + { + b.Append(' ', pad); b.AppendLine("Field7.Value: 0x" + Field7.Value.ToString("X8") + " (" + Field7.Value + ")"); + } + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Player/PlayerQuestMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Player/PlayerQuestMessage.cs new file mode 100644 index 00000000..fea358d9 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Player/PlayerQuestMessage.cs @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Player +{ + [Message(new[] {Opcodes.PlayerQuestMessage1, Opcodes.PlayerQuestMessage2})] + public class PlayerQuestMessage : GameMessage + { + public int Field0; + public int /* sno */ Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(4) + (-1); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(4, Field0 - (-1)); + buffer.WriteInt(32, Field1); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("PlayerQuestMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Player/PlayerTranslateFacingMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Player/PlayerTranslateFacingMessage.cs new file mode 100644 index 00000000..869bbe76 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Player/PlayerTranslateFacingMessage.cs @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Player +{ + /// + /// Client -> Server + /// + /// Sent when the player turns eg. while using a power + /// + [Message(Opcodes.PlayerTranslateFacingMessage, Consumers.Player)] + public class PlayerTranslateFacingMessage : GameMessage + { + /// + /// Id of the player actor + /// + public uint ActorId; + + /// + /// Angle between actor X axis and world X axis in radians + /// + public float Angle; + + /// + /// Sets whether the player turned immediatly or smoothly + /// + public bool TurnImmediately; + + public PlayerTranslateFacingMessage() : base(Opcodes.PlayerTranslateFacingMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + ActorId = buffer.ReadUInt(32); + Angle = buffer.ReadFloat32(); + TurnImmediately = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ActorId); + buffer.WriteFloat32(Angle); + buffer.WriteBool(TurnImmediately); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("PlayerTranslateFacingMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ActorID: 0x" + ActorId.ToString("X8")); + b.Append(' ', pad); b.AppendLine("Angle: " + Angle.ToString("G")); + b.Append(' ', pad); b.AppendLine("TurnImmediately: " + (TurnImmediately ? "true" : "false")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Player/PlayerWarpedMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Player/PlayerWarpedMessage.cs new file mode 100644 index 00000000..c37fb26c --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Player/PlayerWarpedMessage.cs @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Player +{ + [Message(Opcodes.PlayerWarpedMessage)] + public class PlayerWarpedMessage : GameMessage + { + public int Field0; + public float Field1; + + public PlayerWarpedMessage() : base(Opcodes.PlayerWarpedMessage) {} + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(4); + Field1 = buffer.ReadFloat32(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(4, Field0); + buffer.WriteFloat32(Field1); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("PlayerWarpedMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: " + Field1.ToString("G")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Player/RequestBuffCancelMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Player/RequestBuffCancelMessage.cs new file mode 100644 index 00000000..8866c13d --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Player/RequestBuffCancelMessage.cs @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Player +{ + /// + /// Sent from the client when a buff is right clicked to be cancelled + /// + [Message(Opcodes.RequestBuffCancelMessage, Consumers.Player)] + public class RequestBuffCancelMessage : GameMessage + { + public int /* sno */ PowerSNOId; // SNO of the power that activated the buff to be canceled + public int Field1; // Might be ActorID, might be number of stacks to clear off? + + public override void Parse(GameBitBuffer buffer) + { + PowerSNOId = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, PowerSNOId); + buffer.WriteInt(32, Field1); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("RequestBuffCancelMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("PowerSNOId: 0x" + PowerSNOId.ToString("X8")); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Player/RequestUsePowerMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Player/RequestUsePowerMessage.cs new file mode 100644 index 00000000..9e665144 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Player/RequestUsePowerMessage.cs @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Player +{ + // uhm? - please comment about what should be fixed :) /raist. + + /* TODO: Fixme + [Message(Opcodes.RequestUsePowerMessage, Consumers.Player)] + public class RequestUsePowerMessage : GameMessage + { + public int PowerSNOId; + + public override void Parse(GameBitBuffer buffer) + { + PowerSNOId = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, PowerSNOId); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("RequestUsePowerMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("PowerSNOId: 0x" + PowerSNOId.ToString("X8") + " (" + PowerSNOId + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } + */ +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Player/UnlockDifficultyMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Player/UnlockDifficultyMessage.cs new file mode 100644 index 00000000..3865295d --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Player/UnlockDifficultyMessage.cs @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Player +{ + [Message(Opcodes.UnlockDifficultyMessage)] + public class UnlockDifficultyMessage : GameMessage + { + public int Field0; + public bool Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteBool(Field1); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("UnlockDifficultyMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8")); + b.Append(' ', pad); b.AppendLine("Field1: " + (Field1 ? "true" : "false")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Quest/LoreMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Quest/LoreMessage.cs new file mode 100644 index 00000000..ce07f07b --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Quest/LoreMessage.cs @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Quest +{ + [Message(Opcodes.LoreMessage)] + public class LoreMessage : GameMessage + { + public int LoreSNOId; + + public LoreMessage() : base(Opcodes.LoreMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + LoreSNOId = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, LoreSNOId); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("LoreMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("LoreSNOId: 0x" + LoreSNOId.ToString("X8")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Quest/QuestCounterMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Quest/QuestCounterMessage.cs new file mode 100644 index 00000000..32de58e0 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Quest/QuestCounterMessage.cs @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Quest +{ + /// + /// Sent to the client to update one quest counter. Each quest consists of a sequence of steps. In each step, a list + /// of tasks must be completed. The questcounter shows the progress of a single task. + /// + [Message(Opcodes.QuestCounterMessage)] + public class QuestCounterMessage : GameMessage + { + public int snoQuest; + public int snoLevelArea; + public int StepID; // The logical sequence of steps in a quest can be an arbitrary sequence of ids + public int TaskIndex; // 0-bound index of the task to update. + public int Counter; // Value of the counter of the task. Used for tasks like "1 of 4 monsters slain" + public int Checked; // 0 = Task is unchecked, 1 = Task is checked (completed) + + public QuestCounterMessage() : base(Opcodes.QuestCounterMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + snoQuest = buffer.ReadInt(32); + snoLevelArea = buffer.ReadInt(32); + StepID = buffer.ReadInt(32); + TaskIndex = buffer.ReadInt(32); + Counter = buffer.ReadInt(32); + Checked = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, snoQuest); + buffer.WriteInt(32, snoLevelArea); + buffer.WriteInt(32, StepID); + buffer.WriteInt(32, TaskIndex); + buffer.WriteInt(32, Counter); + buffer.WriteInt(32, Checked); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("QuestCounterMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("snoQuest: 0x" + snoQuest.ToString("X8")); + b.Append(' ', pad); b.AppendLine("snoLevelArea: 0x" + snoLevelArea.ToString("X8")); + b.Append(' ', pad); b.AppendLine("StepID: 0x" + StepID.ToString("X8") + " (" + StepID + ")"); + b.Append(' ', pad); b.AppendLine("TaskIndex: 0x" + TaskIndex.ToString("X8") + " (" + TaskIndex + ")"); + b.Append(' ', pad); b.AppendLine("Counter: 0x" + Counter.ToString("X8") + " (" + Counter + ")"); + b.Append(' ', pad); b.AppendLine("Checked: 0x" + Checked.ToString("X8") + " (" + Checked + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Quest/QuestMeterMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Quest/QuestMeterMessage.cs new file mode 100644 index 00000000..1589c613 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Quest/QuestMeterMessage.cs @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Quest +{ + [Message(Opcodes.QuestMeterMessage)] + public class QuestMeterMessage : GameMessage + { + public int /* sno */ snoQuest; + public int Field1; + public float Field2; + + public override void Parse(GameBitBuffer buffer) + { + snoQuest = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadFloat32(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, snoQuest); + buffer.WriteInt(32, Field1); + buffer.WriteFloat32(Field2); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("QuestMeterMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("snoQuest: 0x" + snoQuest.ToString("X8")); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); b.AppendLine("Field2: " + Field2.ToString("G")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Quest/QuestStepCompleteMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Quest/QuestStepCompleteMessage.cs new file mode 100644 index 00000000..ddddf30b --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Quest/QuestStepCompleteMessage.cs @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using D3.Quests; + +namespace Mooege.Net.GS.Message.Definitions.Quest +{ + [Message(Opcodes.QuestStepCompleteMessage)] + public class QuestStepCompleteMessage : GameMessage + { + + public QuestStepComplete QuestStepComplete; + + public QuestStepCompleteMessage() : base(Opcodes.QuestStepCompleteMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + QuestStepComplete = QuestStepComplete.ParseFrom(buffer.ReadBlob(32)); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteBlob(32, QuestStepComplete.ToByteArray()); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("QuestStepCompleteMessage:"); + b.Append(' ', pad++); + b.Append(QuestStepComplete.ToString()); + } + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Quest/QuestUpdateMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Quest/QuestUpdateMessage.cs new file mode 100644 index 00000000..71967771 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Quest/QuestUpdateMessage.cs @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Quest +{ + /// + /// Sent to the client to inform him, that a certain step of a quest is completed and + /// makes him display the task list for the next step + /// + [Message(Opcodes.QuestUpdateMessage)] + public class QuestUpdateMessage : GameMessage + { + public int snoQuest; + public int snoLevelArea; + public int StepID; // ID of the step, for which the task list should be displayed + public bool Field3; // not sure, if not set to true, nothing happens - farmy + public bool Failed; // Quest failed + + public QuestUpdateMessage() : base(Opcodes.QuestUpdateMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + snoQuest = buffer.ReadInt(32); + snoLevelArea = buffer.ReadInt(32); + StepID = buffer.ReadInt(32); + Field3 = buffer.ReadBool(); + Failed = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, snoQuest); + buffer.WriteInt(32, snoLevelArea); + buffer.WriteInt(32, StepID); + buffer.WriteBool(Field3); + buffer.WriteBool(Failed); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("QuestUpdateMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("snoQuest: 0x" + snoQuest.ToString("X8")); + b.Append(' ', pad); b.AppendLine("snoLevelArea: 0x" + snoLevelArea.ToString("X8")); + b.Append(' ', pad); b.AppendLine("StepID: 0x" + StepID.ToString("X8") + " (" + StepID + ")"); + b.Append(' ', pad); b.AppendLine("Field3: " + (Field3 ? "true" : "false")); + b.Append(' ', pad); b.AppendLine("Failed: " + (Failed ? "true" : "false")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Scene/DestroySceneMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Scene/DestroySceneMessage.cs new file mode 100644 index 00000000..641b0e14 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Scene/DestroySceneMessage.cs @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Scene +{ + [Message(Opcodes.DestroySceneMessage)] + public class DestroySceneMessage : GameMessage + { + public uint WorldID; + public uint SceneID; + + public DestroySceneMessage() : base(Opcodes.DestroySceneMessage) {} + + public override void Parse(GameBitBuffer buffer) + { + WorldID = buffer.ReadUInt(32); + SceneID = buffer.ReadUInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, WorldID); + buffer.WriteUInt(32, SceneID); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("DestroySceneMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("WorldID: 0x" + WorldID.ToString("X8") + " (" + WorldID + ")"); + b.Append(' ', pad); b.AppendLine("SceneID: 0x" + SceneID.ToString("X8") + " (" + SceneID + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Scene/RevealSceneMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Scene/RevealSceneMessage.cs new file mode 100644 index 00000000..4aa01141 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Scene/RevealSceneMessage.cs @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Common.Types.Scene; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Scene +{ + [Message(Opcodes.RevealSceneMessage)] + public class RevealSceneMessage : GameMessage + { + public uint WorldID; + public SceneSpecification SceneSpec; + public uint ChunkID; + public int /* sno */ SceneSNO; + public PRTransform Transform; + public uint ParentChunkID; + public int /* sno */ SceneGroupSNO; + // MaxLength = 256 + public int /* gbid */[] arAppliedLabels; + + public RevealSceneMessage() : base(Opcodes.RevealSceneMessage) {} + + public override void Parse(GameBitBuffer buffer) + { + WorldID = buffer.ReadUInt(32); + SceneSpec = new SceneSpecification(); + SceneSpec.Parse(buffer); + ChunkID = buffer.ReadUInt(32); + SceneSNO = buffer.ReadInt(32); + Transform = new PRTransform(); + Transform.Parse(buffer); + ParentChunkID = buffer.ReadUInt(32); + SceneGroupSNO = buffer.ReadInt(32); + arAppliedLabels = new int /* gbid */[buffer.ReadInt(9)]; + for (int i = 0; i < arAppliedLabels.Length; i++) arAppliedLabels[i] = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, WorldID); + SceneSpec.Encode(buffer); + buffer.WriteUInt(32, ChunkID); + buffer.WriteInt(32, SceneSNO); + Transform.Encode(buffer); + buffer.WriteUInt(32, ParentChunkID); + buffer.WriteInt(32, SceneGroupSNO); + buffer.WriteInt(9, arAppliedLabels.Length); + for (int i = 0; i < arAppliedLabels.Length; i++) buffer.WriteInt(32, arAppliedLabels[i]); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("RevealSceneMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("WorldID: 0x" + WorldID.ToString("X8") + " (" + WorldID + ")"); + SceneSpec.AsText(b, pad); + b.Append(' ', pad); b.AppendLine("ChunkID: 0x" + ChunkID.ToString("X8") + " (" + ChunkID + ")"); + b.Append(' ', pad); b.AppendLine("SceneSNO: 0x" + SceneSNO.ToString("X8")); + Transform.AsText(b, pad); + b.Append(' ', pad); b.AppendLine("ParentChunkID: 0x" + ParentChunkID.ToString("X8") + " (" + ParentChunkID + ")"); + b.Append(' ', pad); b.AppendLine("SceneGroupSNO: 0x" + SceneGroupSNO.ToString("X8")); + b.Append(' ', pad); b.AppendLine("arAppliedLabels:"); + b.Append(' ', pad); b.AppendLine("{"); + for (int i = 0; i < arAppliedLabels.Length; ) { b.Append(' ', pad + 1); for (int j = 0; j < 8 && i < arAppliedLabels.Length; j++, i++) { b.Append("0x" + arAppliedLabels[i].ToString("X8") + ", "); } b.AppendLine(); } + b.Append(' ', pad); b.AppendLine("}"); b.AppendLine(); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Scene/SwapSceneMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Scene/SwapSceneMessage.cs new file mode 100644 index 00000000..0dcadb9f --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Scene/SwapSceneMessage.cs @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Scene +{ + [Message(Opcodes.SwapSceneMessage)] + public class SwapSceneMessage : GameMessage + { + public int Field0; + public int Field1; + public int Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("SwapSceneMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Skill/AssignActiveSkillMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Skill/AssignActiveSkillMessage.cs new file mode 100644 index 00000000..bbaec493 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Skill/AssignActiveSkillMessage.cs @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Skill +{ + [Message(Opcodes.AssignSkillMessage1, Consumers.Player)] + public class AssignActiveSkillMessage : GameMessage + { + public int /* sno */ SNOSkill; + public int RuneIndex; + public int SkillIndex; + + public override void Parse(GameBitBuffer buffer) + { + SNOSkill = buffer.ReadInt(32); + RuneIndex = buffer.ReadInt(3) + (-1); + SkillIndex = buffer.ReadInt(3); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, SNOSkill); + buffer.WriteInt(3, RuneIndex - (-1)); + buffer.WriteInt(5, SkillIndex); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("AssignActiveSkillMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("SNOSkill: 0x" + SNOSkill.ToString("X8")); + b.Append(' ', pad); b.AppendLine("RuneIndex: 0x" + RuneIndex.ToString("X8") + " (" + RuneIndex + ")"); + b.Append(' ', pad); b.AppendLine("SkillIndex: 0x" + SkillIndex.ToString("X8") + " (" + SkillIndex + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Skill/AssignSkillMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Skill/AssignSkillMessage.cs new file mode 100644 index 00000000..847cc2ba --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Skill/AssignSkillMessage.cs @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Skill +{ + [Message(new[] { Opcodes.AssignSkillMessage2, Opcodes.AssignSkillMessage3 })] + public class AssignSkillMessage : GameMessage + { + public int /* sno */ SNOSkill; + public int RuneIndex; + public int SkillIndex; + + public override void Parse(GameBitBuffer buffer) + { + SNOSkill = buffer.ReadInt(32); + RuneIndex = buffer.ReadInt(3) + (-1); + SkillIndex = buffer.ReadInt(3); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, SNOSkill); + buffer.WriteInt(3, RuneIndex - (-1)); + buffer.WriteInt(5, SkillIndex); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("AssignSkillMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("SNOSkill: 0x" + SNOSkill.ToString("X8")); + b.Append(' ', pad); b.AppendLine("RuneIndex: 0x" + RuneIndex.ToString("X8") + " (" + RuneIndex + ")"); + b.Append(' ', pad); b.AppendLine("SkillIndex: 0x" + SkillIndex.ToString("X8") + " (" + SkillIndex + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Skill/AssignTraitsMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Skill/AssignTraitsMessage.cs new file mode 100644 index 00000000..631cf80c --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Skill/AssignTraitsMessage.cs @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Skill +{ + [Message(Opcodes.AssignTraitsMessage, Consumers.Player)] + public class AssignTraitsMessage : GameMessage + { + public int[] /* sno */ SNOPowers; + + public override void Parse(GameBitBuffer buffer) + { + SNOPowers = new int[3]; + for (int i = 0; i < SNOPowers.Length; i++) SNOPowers[i] = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + for (int i = 0; i < SNOPowers.Length; i++) buffer.WriteInt(32, SNOPowers[i]); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("AssignTraitsMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + for (int i = 0; i < SNOPowers.Length; ) { b.Append(' ', pad + 1); for (int j = 0; j < 8 && i < SNOPowers.Length; j++, i++) { b.Append("0x" + SNOPowers[i].ToString("X8") + ", "); } b.AppendLine(); } + b.Append(' ', --pad); + b.AppendLine("}"); + } + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Skill/CancelChanneledSkillMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Skill/CancelChanneledSkillMessage.cs new file mode 100644 index 00000000..5db1244e --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Skill/CancelChanneledSkillMessage.cs @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Skill +{ + [Message(Opcodes.DWordDataMessage3, Consumers.Player)] + public class CancelChanneledSkillMessage : GameMessage + { + public int PowerSNO; + + public override void Parse(GameBitBuffer buffer) + { + PowerSNO = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, PowerSNO); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("CancelChanneledSkillMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("PowerSNO: 0x" + PowerSNO.ToString("X8") + " (" + PowerSNO + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Skill/UnassignSkillMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Skill/UnassignSkillMessage.cs new file mode 100644 index 00000000..07c94e5e --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Skill/UnassignSkillMessage.cs @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Skill +{ + [Message( Opcodes.UnassignSkillMessage)] + public class UnassignSkillMessage : GameMessage + { + public int SkillIndex; + + public override void Parse(GameBitBuffer buffer) + { + SkillIndex = buffer.ReadInt(3); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(5, SkillIndex); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("UnassignSkillMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("SkillIndex: 0x" + SkillIndex.ToString("X8") + " (" + SkillIndex + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Stash/OpenSharedStashMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Stash/OpenSharedStashMessage.cs new file mode 100644 index 00000000..c5a4d948 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Stash/OpenSharedStashMessage.cs @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Stash +{ + /// + /// Sent to the client, to open the inventory of a known actor as stash inventory + /// + [Message(Opcodes.OpenSharedStashMessage)] + public class OpenSharedStashMessage : GameMessage + { + public int ActorId; + + public OpenSharedStashMessage() { } + public OpenSharedStashMessage(int stashId) + : base(Opcodes.OpenSharedStashMessage) + { + ActorId = stashId; + } + + public override void Parse(GameBitBuffer buffer) + { + ActorId = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, ActorId); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("OpenSharedStackMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ActorId: 0x" + ActorId.ToString("X8") + " (" + ActorId + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Stash/RequestBuySharedStashSlots.cs b/src/Mooege/Net/GS/Message/Definitions/Stash/RequestBuySharedStashSlots.cs new file mode 100644 index 00000000..3f8c0ae9 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Stash/RequestBuySharedStashSlots.cs @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Stash +{ + /// + /// Sent by the client, when the player clicks on the button to expand the size of his shared stash + /// + [Message(Opcodes.RequestBuySharedStashSlotsMessage, Consumers.Inventory)] + public class RequestBuySharedStashSlotsMessage : GameMessage + { + public bool Field0; + + public RequestBuySharedStashSlotsMessage() : base(Opcodes.RequestBuySharedStashSlotsMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteBool(Field0); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("RequestBuySharedStashSlots:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: " + (Field0 ? "true" : "false")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Team/RevealTeamMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Team/RevealTeamMessage.cs new file mode 100644 index 00000000..a4b37e04 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Team/RevealTeamMessage.cs @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Team +{ + [Message(Opcodes.RevealTeamMessage)] + public class RevealTeamMessage : GameMessage + { + public int Field0; + public int Field1; + public int Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(5) + (-1); + Field1 = buffer.ReadInt(2); + Field2 = buffer.ReadInt(2) + (-1); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(5, Field0 - (-1)); + buffer.WriteInt(2, Field1); + buffer.WriteInt(2, Field2 - (-1)); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("RevealTeamMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Text/BroadcastTextMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Text/BroadcastTextMessage.cs new file mode 100644 index 00000000..4c3e3823 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Text/BroadcastTextMessage.cs @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Text +{ + [Message(Opcodes.BroadcastTextMessage)] + public class BroadcastTextMessage : GameMessage + { + public string Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadCharArray(512); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteCharArray(512, Field0); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("BroadcastTextMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: \"" + Field0 + "\""); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Text/DisplayGameTextMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Text/DisplayGameTextMessage.cs new file mode 100644 index 00000000..8b20f7fb --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Text/DisplayGameTextMessage.cs @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Text +{ + [Message(Opcodes.DisplayGameTextMessage)] + public class DisplayGameTextMessage : GameMessage + { + public string Field0; + public int? Field1; + public int? Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadCharArray(512); + if (buffer.ReadBool()) + { + Field1 = buffer.ReadInt(32); + } + if (buffer.ReadBool()) + { + Field2 = buffer.ReadInt(32); + } + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteCharArray(512, Field0); + buffer.WriteBool(Field1.HasValue); + if (Field1.HasValue) + { + buffer.WriteInt(32, Field1.Value); + } + buffer.WriteBool(Field2.HasValue); + if (Field2.HasValue) + { + buffer.WriteInt(32, Field2.Value); + } + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("DisplayGameTextMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: \"" + Field0 + "\""); + if (Field1.HasValue) + { + b.Append(' ', pad); b.AppendLine("Field1.Value: 0x" + Field1.Value.ToString("X8") + " (" + Field1.Value + ")"); + } + if (Field2.HasValue) + { + b.Append(' ', pad); b.AppendLine("Field2.Value: 0x" + Field2.Value.ToString("X8") + " (" + Field2.Value + ")"); + } + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Tick/EndOfTickMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Tick/EndOfTickMessage.cs new file mode 100644 index 00000000..2a2b7753 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Tick/EndOfTickMessage.cs @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Tick +{ + [Message(Opcodes.EndOfTickMessage)] + public class EndOfTickMessage : GameMessage + { + public int Field0; + public int Field1; + + public EndOfTickMessage() : base(Opcodes.EndOfTickMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("EndOfTickMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Tick/GameTickMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Tick/GameTickMessage.cs new file mode 100644 index 00000000..d235a701 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Tick/GameTickMessage.cs @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Tick +{ + [Message(Opcodes.GameTickMessage)] + public class GameTickMessage:GameMessage + { + public int Tick; + + public GameTickMessage() : base(Opcodes.GameTickMessage) { } + + public GameTickMessage(int tick) + : base(Opcodes.GameTickMessage) + { + this.Tick = tick; + } + + public override void Parse(GameBitBuffer buffer) + { + Tick = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Tick); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("GameTickMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Tick: 0x" + Tick.ToString("X8") + " (" + Tick + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Trade/OpenTradeWindow.cs b/src/Mooege/Net/GS/Message/Definitions/Trade/OpenTradeWindow.cs new file mode 100644 index 00000000..d4a495c9 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Trade/OpenTradeWindow.cs @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Trade +{ + /// + /// Show a trade window. The inventory 0x14 (20) for an actor is + /// shown as trade offerings + /// + [Message(Opcodes.OpenTradeWindow )] + public class OpenTradeWindowMessage : GameMessage + { + public int ActorID; + + public OpenTradeWindowMessage() { } + public OpenTradeWindowMessage(int actorID) + : base(Opcodes.OpenTradeWindow) + { + ActorID = actorID; + } + + public override void Parse(GameBitBuffer buffer) + { + ActorID = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, ActorID); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("OpenTradeWindowMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ActorID: 0x" + ActorID.ToString("X8") + " (" + ActorID + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Trade/RequestBuyItemMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Trade/RequestBuyItemMessage.cs new file mode 100644 index 00000000..c8fb6aa0 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Trade/RequestBuyItemMessage.cs @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Trade +{ + /// + /// Sent by the client, when the player buys an item from a vendor + /// + [Message(Opcodes.RequestBuyItemMessage, Consumers.Player)] // Maybe consumers.Vendor? /fasbat + public class RequestBuyItemMessage : GameMessage + { + public uint ItemId; + + public RequestBuyItemMessage() { } + public RequestBuyItemMessage(uint itemID) + : base(Opcodes.RequestBuyItemMessage) + { + ItemId = itemID; + } + + public override void Parse(GameBitBuffer buffer) + { + ItemId = buffer.ReadUInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ItemId); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("RequestBuyItemMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ItemActorId: 0x" + ItemId.ToString("X8") + " (" + ItemId + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Trade/RequestSellItemMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Trade/RequestSellItemMessage.cs new file mode 100644 index 00000000..aaa20204 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Trade/RequestSellItemMessage.cs @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Trade +{ + /// + /// Sent by the client, when the player sells an item to a vendor via trade window (not when using cauldron of jordan) + /// + [Message(Opcodes.RequestSellItemMessage)] + public class RequestSellItemMessage : GameMessage + { + public int ItemId; + + public RequestSellItemMessage() { } + public RequestSellItemMessage(int itemID) + : base(Opcodes.RequestSellItemMessage) + { + ItemId = itemID; + } + + public override void Parse(GameBitBuffer buffer) + { + ItemId = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, ItemId); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("SellItemMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ItemId: 0x" + ItemId.ToString("X8") + " (" + ItemId + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Trade/TradeMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Trade/TradeMessage.cs new file mode 100644 index 00000000..95e3059e --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Trade/TradeMessage.cs @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Trade +{ + [Message(new[] {Opcodes.TradeMessage1, Opcodes.TradeMessage2})] + public class TradeMessage : GameMessage + { + public int Field0; + public int Field1; + public int Field2; + public long Field3; + public int Field4; + // MaxLength = 5 + public int[] Field5; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(4); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadInt64(64); + Field4 = buffer.ReadInt(32); + Field5 = new int[5]; + for (int i = 0; i < Field5.Length; i++) Field5[i] = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(4, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + buffer.WriteInt64(64, Field3); + buffer.WriteInt(32, Field4); + for (int i = 0; i < Field5.Length; i++) buffer.WriteInt(32, Field5[i]); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("TradeMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', pad); b.AppendLine("Field3: 0x" + Field3.ToString("X16")); + b.Append(' ', pad); b.AppendLine("Field4: 0x" + Field4.ToString("X8") + " (" + Field4 + ")"); + b.Append(' ', pad); b.AppendLine("Field5:"); + b.Append(' ', pad); b.AppendLine("{"); + for (int i = 0; i < Field5.Length; ) { b.Append(' ', pad + 1); for (int j = 0; j < 8 && i < Field5.Length; j++, i++) { b.Append("0x" + Field5[i].ToString("X8") + ", "); } b.AppendLine(); } + b.Append(' ', pad); b.AppendLine("}"); b.AppendLine(); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Tutorial/TutorialMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Tutorial/TutorialMessage.cs new file mode 100644 index 00000000..70845e63 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Tutorial/TutorialMessage.cs @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using D3.Profile; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(Opcodes.TutorialMessage)] + public class TutorialMessage : GameMessage + { + + public D3.GameMessage.TutorialMessage TutorialMessageDefinition; + + public TutorialMessage() : base(Opcodes.TutorialMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + TutorialMessageDefinition = D3.GameMessage.TutorialMessage.ParseFrom(buffer.ReadBlob(32)); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteBlob(32, TutorialMessageDefinition.ToByteArray()); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("TutorialMessage:"); + b.Append(' ', pad++); + b.Append(TutorialMessageDefinition.ToString()); + } + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Tutorial/TutorialShownMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Tutorial/TutorialShownMessage.cs new file mode 100644 index 00000000..3dcd9e15 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Tutorial/TutorialShownMessage.cs @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Tutorial +{ + /// + /// Sent by the client after it has shown a tutorial + /// + [Message(Opcodes.TutorialShownMessage, Consumers.Player)] + public class TutorialShownMessage : GameMessage + { + public int SNOTutorial; + + public override void Parse(GameBitBuffer buffer) + { + SNOTutorial = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, SNOTutorial); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("TutorialShownMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("SNOTutorial: 0x" + SNOTutorial.ToString("X8")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/UI/UIElementMessage.cs b/src/Mooege/Net/GS/Message/Definitions/UI/UIElementMessage.cs new file mode 100644 index 00000000..29f82557 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/UI/UIElementMessage.cs @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.UI +{ + [Message(Opcodes.UIElementMessage)] + public class UIElementMessage : GameMessage + { + public int Field0; + public bool Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(4) + (-1); + Field1 = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(4, Field0 - (-1)); + buffer.WriteBool(Field1); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("UIElementMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: " + (Field1 ? "true" : "false")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Waypoint/OpenWaypointSelectionWindowMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Waypoint/OpenWaypointSelectionWindowMessage.cs new file mode 100644 index 00000000..6ce097db --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Waypoint/OpenWaypointSelectionWindowMessage.cs @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Waypoint +{ + /// + /// Sent to the client to open the window that allows him to select his target waypoint + /// + [Message(Opcodes.OpenWaypointSelectionWindowMessage)] + public class OpenWaypointSelectionWindowMessage : GameMessage + { + public uint ActorID; // Actor's DynamicID + + public OpenWaypointSelectionWindowMessage() : base(Opcodes.OpenWaypointSelectionWindowMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + ActorID = buffer.ReadUInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ActorID); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("OpenWaypointSelectionWindowMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("ActorID: 0x" + ActorID.ToString("X8") + " (" + ActorID + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Waypoint/TryWaypointMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Waypoint/TryWaypointMessage.cs new file mode 100644 index 00000000..80909403 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Waypoint/TryWaypointMessage.cs @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Waypoint +{ + [Message(Opcodes.TryWaypointMessage, Consumers.Player)] + public class TryWaypointMessage : GameMessage + { + public int Field0; + public int Field1; + + public TryWaypointMessage() + : base(Opcodes.TryWaypointMessage) + { } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(5) + (-1); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(5, Field1 - (-1)); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("TryWaypointMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/Waypoint/WaypointActivatedMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Waypoint/WaypointActivatedMessage.cs new file mode 100644 index 00000000..b552fa5a --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Waypoint/WaypointActivatedMessage.cs @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Waypoint +{ + [Message(Opcodes.WaypointActivatedMessage)] + public class WaypointActivatedMessage : GameMessage + { + public int Field0; + public int Field1; + public int /* sno */ Field2; + public bool Field3; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + buffer.WriteBool(Field3); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("WaypointActivatedMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Field2.ToString("X8")); + b.Append(' ', pad); b.AppendLine("Field3: " + (Field3 ? "true" : "false")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/World/EnterWorldMessage.cs b/src/Mooege/Net/GS/Message/Definitions/World/EnterWorldMessage.cs new file mode 100644 index 00000000..8205de6c --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/World/EnterWorldMessage.cs @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.World +{ + [Message(Opcodes.EnterWorldMessage)] + public class EnterWorldMessage : GameMessage + { + public Vector3D EnterPosition; + public uint WorldID; // World's DynamicID + public int /* sno */ WorldSNO; + + public EnterWorldMessage() : base(Opcodes.EnterWorldMessage) {} + + public override void Parse(GameBitBuffer buffer) + { + EnterPosition = new Vector3D(); + EnterPosition.Parse(buffer); + WorldID = buffer.ReadUInt(32); + WorldSNO = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + EnterPosition.Encode(buffer); + buffer.WriteUInt(32, WorldID); + buffer.WriteInt(32, WorldSNO); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("EnterWorldMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + EnterPosition.AsText(b, pad); + b.Append(' ', pad); b.AppendLine("WorldID: 0x" + WorldID.ToString("X8") + " (" + WorldID + ")"); + b.Append(' ', pad); b.AppendLine("WorldSNO: 0x" + WorldSNO.ToString("X8")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/World/RevealWorldMessage.cs b/src/Mooege/Net/GS/Message/Definitions/World/RevealWorldMessage.cs new file mode 100644 index 00000000..b8a54661 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/World/RevealWorldMessage.cs @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.World +{ + [Message(Opcodes.RevealWorldMessage)] + public class RevealWorldMessage : GameMessage + { + public uint WorldID; // World's DynamicID + public int /* sno */ WorldSNO; + public int Field2; + public int Field3; + public int Field4; + public int Field5; + public int Field6; + public int Field7; + + public RevealWorldMessage() : base(Opcodes.RevealWorldMessage) {} + + public override void Parse(GameBitBuffer buffer) + { + WorldID = buffer.ReadUInt(32); + WorldSNO = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadInt(32); + Field4 = buffer.ReadInt(32); + Field5 = buffer.ReadInt(32); + Field6 = buffer.ReadInt(32); + Field7 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, WorldID); + buffer.WriteInt(32, WorldSNO); + buffer.WriteInt(32, Field2); + buffer.WriteInt(32, Field3); + buffer.WriteInt(32, Field4); + buffer.WriteInt(32, Field5); + buffer.WriteInt(32, Field6); + buffer.WriteInt(32, Field7); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("RevealWorldMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("WorldID: 0x" + WorldID.ToString("X8") + " (" + WorldID + ")"); + b.Append(' ', pad); b.AppendLine("WorldSNO: 0x" + WorldSNO.ToString("X8")); + b.Append(' ', pad); b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', pad); b.AppendLine("Field3: 0x" + Field3.ToString("X8") + " (" + Field3 + ")"); + b.Append(' ', pad); b.AppendLine("Field4: 0x" + Field4.ToString("X8") + " (" + Field4 + ")"); + b.Append(' ', pad); b.AppendLine("Field5: 0x" + Field5.ToString("X8") + " (" + Field5 + ")"); + b.Append(' ', pad); b.AppendLine("Field6: 0x" + Field6.ToString("X8") + " (" + Field6 + ")"); + b.Append(' ', pad); b.AppendLine("Field7: 0x" + Field7.ToString("X8") + " (" + Field7 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/World/TargetMessage.cs b/src/Mooege/Net/GS/Message/Definitions/World/TargetMessage.cs new file mode 100644 index 00000000..b838bb2a --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/World/TargetMessage.cs @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.World +{ + [Message(Opcodes.TargetMessage,Consumers.Player)] + public class TargetMessage : GameMessage + { + public int Field0; + public uint TargetID; // Targeted actor's DynamicID + public WorldPlace Field2; + public int /* sno */ PowerSNO; // SNO of the power that was used on the targeted actor + public int Field4; + public int Field5; + public AnimPreplayData Field6; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(3) + (-1); + TargetID = buffer.ReadUInt(32); + Field2 = new WorldPlace(); + Field2.Parse(buffer); + PowerSNO = buffer.ReadInt(32); + Field4 = buffer.ReadInt(32); + Field5 = buffer.ReadInt(2); + if (buffer.ReadBool()) + { + Field6 = new AnimPreplayData(); + Field6.Parse(buffer); + } + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(3, Field0 - (-1)); + buffer.WriteUInt(32, TargetID); + Field2.Encode(buffer); + buffer.WriteInt(32, PowerSNO); + buffer.WriteInt(32, Field4); + buffer.WriteInt(2, Field5); + buffer.WriteBool(Field6 != null); + if (Field6 != null) + { + Field6.Encode(buffer); + } + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("TargetMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); b.AppendLine("TargetID: 0x" + TargetID.ToString("X8") + " (" + TargetID + ")"); + Field2.AsText(b, pad); + b.Append(' ', pad); b.AppendLine("PowerSNO: 0x" + PowerSNO.ToString("X8")); + b.Append(' ', pad); b.AppendLine("Field4: 0x" + Field4.ToString("X8") + " (" + Field4 + ")"); + b.Append(' ', pad); b.AppendLine("Field5: 0x" + Field5.ToString("X8") + " (" + Field5 + ")"); + if (Field6 != null) + { + Field6.AsText(b, pad); + } + b.Append(' ', --pad); + b.AppendLine("}"); + } + } + +} diff --git a/src/Mooege/Net/GS/Message/Definitions/World/WeatherOverrideMessage.cs b/src/Mooege/Net/GS/Message/Definitions/World/WeatherOverrideMessage.cs new file mode 100644 index 00000000..b4581d0f --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/World/WeatherOverrideMessage.cs @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.World +{ + [Message(Opcodes.WeatherOverrideMessage)] + public class WeatherOverrideMessage : GameMessage + { + public int SNOWorld; + public float Field1; + public float Field2; + + public override void Parse(GameBitBuffer buffer) + { + SNOWorld = buffer.ReadInt(32); + Field1 = buffer.ReadFloat32(); + Field2 = buffer.ReadFloat32(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, SNOWorld); + buffer.WriteFloat32(Field1); + buffer.WriteFloat32(Field2); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("WeatherOverrideMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("SNOWorld: 0x" + SNOWorld.ToString("X8")); + b.Append(' ', pad); b.AppendLine("Field1: " + Field1.ToString("G")); + b.Append(' ', pad); b.AppendLine("Field2: " + Field2.ToString("G")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Definitions/World/WorldDeletedMessage.cs b/src/Mooege/Net/GS/Message/Definitions/World/WorldDeletedMessage.cs new file mode 100644 index 00000000..6725ef28 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/World/WorldDeletedMessage.cs @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.World +{ + [Message(Opcodes.WorldDeletedMessage)] + public class WorldDeletedMessage : GameMessage + { + public uint WorldID; // World's DynamicID + + public WorldDeletedMessage() : base(Opcodes.WorldDeletedMessage) {} + + public override void Parse(GameBitBuffer buffer) + { + WorldID = buffer.ReadUInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, WorldID); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("WorldDeletedMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("WorldID: 0x" + WorldID.ToString("X8") + " (" + WorldID + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/World/WorldStatusMessage.cs b/src/Mooege/Net/GS/Message/Definitions/World/WorldStatusMessage.cs new file mode 100644 index 00000000..0fd5dfe8 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/World/WorldStatusMessage.cs @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.World +{ + [Message(Opcodes.WorldStatusMessage)] + public class WorldStatusMessage : GameMessage + { + public uint WorldID; // World's DynamicID + public bool Field1; + + public override void Parse(GameBitBuffer buffer) + { + WorldID = buffer.ReadUInt(32); + Field1 = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, WorldID); + buffer.WriteBool(Field1); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("WorldStatusMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("WorldID: 0x" + WorldID.ToString("X8") + " (" + WorldID + ")"); + b.Append(' ', pad); b.AppendLine("Field1: " + (Field1 ? "true" : "false")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Fields/ActiveEvent.cs b/src/Mooege/Net/GS/Message/Fields/ActiveEvent.cs new file mode 100644 index 00000000..c4730f52 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/ActiveEvent.cs @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Fields +{ + public class ActiveEvent + { + public int /* sno */ snoTimedEvent; + public int Field1; + public int Field2; + + public void Parse(GameBitBuffer buffer) + { + snoTimedEvent = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, snoTimedEvent); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ActiveEvent:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); + b.AppendLine("snoTimedEvent: 0x" + snoTimedEvent.ToString("X8")); + b.Append(' ', pad); + b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); + b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Fields/ActiveSkillSavedData.cs b/src/Mooege/Net/GS/Message/Fields/ActiveSkillSavedData.cs new file mode 100644 index 00000000..31f85deb --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/ActiveSkillSavedData.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Mooege.Net.GS.Message.Fields +{ + public class ActiveSkillSavedData + { + public int snoSkill; + public int snoRune; + + public void Parse(GameBitBuffer buffer) + { + snoSkill = buffer.ReadInt(32); + snoRune = buffer.ReadInt(3) + (-1); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, snoSkill); + buffer.WriteInt(3, snoRune - (-1)); + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ActiveSkillSavedData:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); + b.AppendLine("snoSkill: 0x" + snoSkill.ToString("X8")); + b.Append(' ', pad); + b.AppendLine("snoRune: " + snoRune); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} diff --git a/src/Mooege/Net/GS/Message/Fields/AnimPreplayData.cs b/src/Mooege/Net/GS/Message/Fields/AnimPreplayData.cs new file mode 100644 index 00000000..4797fa97 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/AnimPreplayData.cs @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Fields +{ + public class AnimPreplayData + { + public int Field0; + public int Field1; // This seems to constantly increase trough a game - farmy + public int Field2; + + public void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("AnimPreplayData:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); + b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); + b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); + b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Fields/DPathSinData.cs b/src/Mooege/Net/GS/Message/Fields/DPathSinData.cs new file mode 100644 index 00000000..dfb814c6 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/DPathSinData.cs @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Fields +{ + public class DPathSinData + { + public float Field0; + public float Field1; + public float Field2; + public float Field3; + public float Field4; + public float Field5; + + public void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadFloat32(); + Field1 = buffer.ReadFloat32(); + Field2 = buffer.ReadFloat32(); + Field3 = buffer.ReadFloat32(); + Field4 = buffer.ReadFloat32(); + Field5 = buffer.ReadFloat32(); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteFloat32(Field0); + buffer.WriteFloat32(Field1); + buffer.WriteFloat32(Field2); + buffer.WriteFloat32(Field3); + buffer.WriteFloat32(Field4); + buffer.WriteFloat32(Field5); + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("DPathSinData:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); + b.AppendLine("Field0: " + Field0.ToString("G")); + b.Append(' ', pad); + b.AppendLine("Field1: " + Field1.ToString("G")); + b.Append(' ', pad); + b.AppendLine("Field2: " + Field2.ToString("G")); + b.Append(' ', pad); + b.AppendLine("Field3: " + Field3.ToString("G")); + b.Append(' ', pad); + b.AppendLine("Field4: " + Field4.ToString("G")); + b.Append(' ', pad); + b.AppendLine("Field5: " + Field5.ToString("G")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Fields/EntityId.cs b/src/Mooege/Net/GS/Message/Fields/EntityId.cs new file mode 100644 index 00000000..8f94e217 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/EntityId.cs @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Fields +{ + public class EntityId + { + public long High; + public long Low; + + public void Parse(GameBitBuffer buffer) + { + High = buffer.ReadInt64(64); + Low = buffer.ReadInt64(64); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt64(64, High); + buffer.WriteInt64(64, Low); + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("EntityId:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); + b.AppendLine("Field0: 0x" + High.ToString("X16")); + b.Append(' ', pad); + b.AppendLine("Field1: 0x" + Low.ToString("X16")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Fields/GBHandle.cs b/src/Mooege/Net/GS/Message/Fields/GBHandle.cs new file mode 100644 index 00000000..6bfa1422 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/GBHandle.cs @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Fields +{ + public class GBHandle + { + public int Type; // Probably. + public int GBID; + + public void Parse(GameBitBuffer buffer) + { + Type = buffer.ReadInt(6) + (-2); + GBID = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(6, Type - (-2)); + buffer.WriteInt(32, GBID); + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("GBHandle:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); + b.AppendLine("Type: 0x" + Type.ToString("X8") + " (" + Type + ")"); + b.Append(' ', pad); + b.AppendLine("GBID: 0x" + GBID.ToString("X8") + " (" + GBID + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} diff --git a/src/Mooege/Net/GS/Message/Fields/GameId.cs b/src/Mooege/Net/GS/Message/Fields/GameId.cs new file mode 100644 index 00000000..135ba76d --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/GameId.cs @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Fields +{ + public class GameId + { + public long Field0; + public long Field1; + public long Field2; + + public void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt64(64); + Field1 = buffer.ReadInt64(64); + Field2 = buffer.ReadInt64(64); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt64(64, Field0); + buffer.WriteInt64(64, Field1); + buffer.WriteInt64(64, Field2); + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("GameId:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); + b.AppendLine("Field0: 0x" + Field0.ToString("X16")); + b.Append(' ', pad); + b.AppendLine("Field1: 0x" + Field1.ToString("X16")); + b.Append(' ', pad); + b.AppendLine("Field2: 0x" + Field2.ToString("X16")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Fields/GameSyncedData.cs b/src/Mooege/Net/GS/Message/Fields/GameSyncedData.cs new file mode 100644 index 00000000..4608242a --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/GameSyncedData.cs @@ -0,0 +1,123 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Fields +{ + public class GameSyncedData + { + public int Field0; + public int Field1; + public int Field2; + public int Field3; + public int Field4; + public int Field5; + public int Field6; + // MaxLength = 2 + public int[] Field7; + // MaxLength = 2 + public int[] Field8; + + public void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(2); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadInt(32); + Field4 = buffer.ReadInt(32); + Field5 = buffer.ReadInt(32); + Field6 = buffer.ReadInt(32); + Field7 = new int[2]; + for (int i = 0; i < Field7.Length; i++) Field7[i] = buffer.ReadInt(32); + Field8 = new int[2]; + for (int i = 0; i < Field8.Length; i++) Field8[i] = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(2,Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + buffer.WriteInt(32, Field3); + buffer.WriteInt(32, Field4); + buffer.WriteInt(32, Field5); + buffer.WriteInt(32, Field6); + for (int i = 0; i < Field7.Length; i++) buffer.WriteInt(32, Field7[i]); + for (int i = 0; i < Field8.Length; i++) buffer.WriteInt(32, Field8[i]); + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("GameSyncedData:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); + b.AppendLine("Field0: 0x" + Field0); + b.Append(' ', pad); + b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); + b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', pad); + b.AppendLine("Field3: 0x" + Field3.ToString("X8") + " (" + Field3 + ")"); + b.Append(' ', pad); + b.AppendLine("Field4: 0x" + Field4.ToString("X8") + " (" + Field4 + ")"); + b.Append(' ', pad); + b.AppendLine("Field5: 0x" + Field5.ToString("X8") + " (" + Field5 + ")"); + b.Append(' ', pad); + b.AppendLine("Field6: 0x" + Field6.ToString("X8") + " (" + Field6 + ")"); + b.Append(' ', pad); + b.AppendLine("Field7:"); + b.Append(' ', pad); + b.AppendLine("{"); + for (int i = 0; i < Field7.Length;) + { + b.Append(' ', pad + 1); + for (int j = 0; j < 8 && i < Field7.Length; j++, i++) + { + b.Append("0x" + Field7[i].ToString("X8") + ", "); + } + b.AppendLine(); + } + b.Append(' ', pad); + b.AppendLine("}"); + b.AppendLine(); + b.Append(' ', pad); + b.AppendLine("Field8:"); + b.Append(' ', pad); + b.AppendLine("{"); + for (int i = 0; i < Field8.Length;) + { + b.Append(' ', pad + 1); + for (int j = 0; j < 8 && i < Field8.Length; j++, i++) + { + b.Append("0x" + Field8[i].ToString("X8") + ", "); + } + b.AppendLine(); + } + b.Append(' ', pad); + b.AppendLine("}"); + b.AppendLine(); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Fields/HeroStateData.cs b/src/Mooege/Net/GS/Message/Fields/HeroStateData.cs new file mode 100644 index 00000000..0b08d850 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/HeroStateData.cs @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Fields +{ + public class HeroStateData + { + public int Field0; + public int Field1; + public int Field2; + public int Field3; + public int PlayerFlags; + public PlayerSavedData PlayerSavedData; + public int QuestRewardHistoryEntriesCount; + // MaxLength = 100 + public PlayerQuestRewardHistoryEntry[] tQuestRewardHistory; + + public void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadInt(32); + PlayerFlags = buffer.ReadInt(30); + PlayerSavedData = new PlayerSavedData(); + PlayerSavedData.Parse(buffer); + QuestRewardHistoryEntriesCount = buffer.ReadInt(32); + tQuestRewardHistory = new PlayerQuestRewardHistoryEntry[buffer.ReadInt(7)]; + for (int i = 0; i < tQuestRewardHistory.Length; i++) + { + tQuestRewardHistory[i] = new PlayerQuestRewardHistoryEntry(); + tQuestRewardHistory[i].Parse(buffer); + } + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + buffer.WriteInt(32, Field3); + buffer.WriteInt(30, PlayerFlags); + PlayerSavedData.Encode(buffer); + buffer.WriteInt(32, QuestRewardHistoryEntriesCount); + buffer.WriteInt(7, tQuestRewardHistory.Length); + for (int i = 0; i < tQuestRewardHistory.Length; i++) + { + tQuestRewardHistory[i].Encode(buffer); + } + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("HeroStateData:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); + b.AppendLine("Field0: 0x" + Field0.ToString("X8") + " (" + Field0 + ")"); + b.Append(' ', pad); + b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); + b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', pad); + b.AppendLine("Field3: 0x" + Field3.ToString("X8") + " (" + Field3 + ")"); + b.Append(' ', pad); + b.AppendLine("PlayerFlags: 0x" + PlayerFlags.ToString("X8") + " (" + PlayerFlags + ")"); + PlayerSavedData.AsText(b, pad); + b.Append(' ', pad); + b.AppendLine("QuestRewardHistoryEntriesCount: 0x" + QuestRewardHistoryEntriesCount.ToString("X8") + " (" + QuestRewardHistoryEntriesCount + ")"); + b.Append(' ', pad); + b.AppendLine("tQuestRewardHistory:"); + b.Append(' ', pad); + b.AppendLine("{"); + for (int i = 0; i < tQuestRewardHistory.Length; i++) + { + tQuestRewardHistory[i].AsText(b, pad + 1); + b.AppendLine(); + } + b.Append(' ', pad); + b.AppendLine("}"); + b.AppendLine(); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Fields/HirelingInfo.cs b/src/Mooege/Net/GS/Message/Fields/HirelingInfo.cs new file mode 100644 index 00000000..1fb2953b --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/HirelingInfo.cs @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Fields +{ + public class HirelingInfo + { + public int HirelingIndex; + public int Field1; + public int Level; + public int Field3; + public bool Field4; + public int Skill1SNOId; + public int Skill2SNOId; + public int Skill3SNOId; + public int Skill4SNOId; + + public void Parse(GameBitBuffer buffer) + { + HirelingIndex = buffer.ReadInt(2); + Field1 = buffer.ReadInt(32); + Level = buffer.ReadInt(7); + Field3 = buffer.ReadInt(32); + Field4 = buffer.ReadBool(); + Skill1SNOId = buffer.ReadInt(32); + Skill2SNOId = buffer.ReadInt(32); + Skill3SNOId = buffer.ReadInt(32); + Skill4SNOId = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(2, HirelingIndex); + buffer.WriteInt(32, Field1); + buffer.WriteInt(7, Level); + buffer.WriteInt(32, Field3); + buffer.WriteBool(Field4); + buffer.WriteInt(32, Skill1SNOId); + buffer.WriteInt(32, Skill2SNOId); + buffer.WriteInt(32, Skill3SNOId); + buffer.WriteInt(32, Skill4SNOId); + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("HirelingInfo:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); + b.AppendLine("HirelingIndex: 0x" + HirelingIndex.ToString("X8") + " (" + HirelingIndex + ")"); + b.Append(' ', pad); + b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); + b.AppendLine("Level: 0x" + Level.ToString("X8") + " (" + Level + ")"); + b.Append(' ', pad); + b.AppendLine("Field3: 0x" + Field3.ToString("X8") + " (" + Field3 + ")"); + b.Append(' ', pad); + b.AppendLine("Field4: " + (Field4 ? "true" : "false")); + b.Append(' ', pad); + b.AppendLine("Skill1SNOId: 0x" + Skill1SNOId.ToString("X8") + " (" + Skill1SNOId + ")"); + b.Append(' ', pad); + b.AppendLine("Skill2SNOId: 0x" + Skill2SNOId.ToString("X8") + " (" + Skill2SNOId + ")"); + b.Append(' ', pad); + b.AppendLine("Skill3SNOId: 0x" + Skill3SNOId.ToString("X8") + " (" + Skill3SNOId + ")"); + b.Append(' ', pad); + b.AppendLine("Skill4SNOId: 0x" + Skill4SNOId.ToString("X8") + " (" + Skill4SNOId + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Fields/HirelingSavedData.cs b/src/Mooege/Net/GS/Message/Fields/HirelingSavedData.cs new file mode 100644 index 00000000..3b833e88 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/HirelingSavedData.cs @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Fields +{ + public class HirelingSavedData + { + // MaxLength = 4 + public HirelingInfo[] HirelingInfos; + public int Field1; + public int Field2; + + public void Parse(GameBitBuffer buffer) + { + HirelingInfos = new HirelingInfo[4]; + for (int i = 0; i < HirelingInfos.Length; i++) + { + HirelingInfos[i] = new HirelingInfo(); + HirelingInfos[i].Parse(buffer); + } + Field1 = buffer.ReadInt(2); + Field2 = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + for (int i = 0; i < HirelingInfos.Length; i++) + { + HirelingInfos[i].Encode(buffer); + } + buffer.WriteInt(2, Field1); + buffer.WriteInt(32, Field2); + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("HirelingSavedData:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); + b.AppendLine("Field0:"); + b.Append(' ', pad); + b.AppendLine("{"); + for (int i = 0; i < HirelingInfos.Length; i++) + { + HirelingInfos[i].AsText(b, pad + 1); + b.AppendLine(); + } + b.Append(' ', pad); + b.AppendLine("}"); + b.AppendLine(); + b.Append(' ', pad); + b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); + b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Fields/HotbarButtonData.cs b/src/Mooege/Net/GS/Message/Fields/HotbarButtonData.cs new file mode 100644 index 00000000..6e52b6cd --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/HotbarButtonData.cs @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Fields +{ + public class HotbarButtonData + { + public int /* sno */ SNOSkill; + public int Field1; + public int /* gbid */ ItemGBId; + + public void Parse(GameBitBuffer buffer) + { + SNOSkill = buffer.ReadInt(32); + Field1 = buffer.ReadInt(3) + (-1); + ItemGBId = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, SNOSkill); + buffer.WriteInt(3, Field1 - (-1)); + buffer.WriteInt(32, ItemGBId); + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("HotbarButtonData:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); + b.AppendLine("m_snoPower: 0x" + SNOSkill.ToString("X8")); + b.Append(' ', pad); + b.AppendLine("Field1: " + Field1); + b.Append(' ', pad); + b.AppendLine("m_gbidItem: 0x" + ItemGBId.ToString("X8")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Fields/InvLoc.cs b/src/Mooege/Net/GS/Message/Fields/InvLoc.cs new file mode 100644 index 00000000..0ce11beb --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/InvLoc.cs @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Fields +{ + public class InvLoc + { + public uint OwnerID; // Owner's DynamicID + public int EquipmentSlot; + public int Column; + public int Row; + + public void Parse(GameBitBuffer buffer) + { + OwnerID = buffer.ReadUInt(32); + EquipmentSlot = buffer.ReadInt(5) + (-1); + Column = buffer.ReadInt(32); + Row = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, OwnerID); + buffer.WriteInt(5, EquipmentSlot - (-1)); + buffer.WriteInt(32, Column); + buffer.WriteInt(32, Row); + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("InvLoc:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); + b.AppendLine("OwnerID: 0x" + OwnerID.ToString("X8") + " (" + OwnerID + ")"); + b.Append(' ', pad); + b.AppendLine("EquipmentSlot: 0x" + EquipmentSlot.ToString("X8") + " (" + EquipmentSlot + ")"); + b.Append(' ', pad); + b.AppendLine("Column: 0x" + Column.ToString("X8") + " (" + Column + ")"); + b.Append(' ', pad); + b.AppendLine("Row: 0x" + Row.ToString("X8") + " (" + Row + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Fields/InventoryLocationMessageData.cs b/src/Mooege/Net/GS/Message/Fields/InventoryLocationMessageData.cs new file mode 100644 index 00000000..ac4e5a81 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/InventoryLocationMessageData.cs @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Core.GS.Common.Types.Math; + +namespace Mooege.Net.GS.Message.Fields +{ + public class InventoryLocationMessageData + { + public uint OwnerID; // Player's DynamicID + public int EquipmentSlot; + public Vector2D InventoryLocation; // Row, column + + public void Parse(GameBitBuffer buffer) + { + OwnerID = buffer.ReadUInt(32); + EquipmentSlot = buffer.ReadInt(5) + (-1); + InventoryLocation = new Vector2D(); + InventoryLocation.Parse(buffer); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, OwnerID); + buffer.WriteInt(5, EquipmentSlot - (-1)); + InventoryLocation.Encode(buffer); + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("InventoryLocationMessageData:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); + b.AppendLine("OwnerID: 0x" + OwnerID.ToString("X8") + " (" + OwnerID + ")"); + b.Append(' ', pad); + b.AppendLine("EquipmentSlot: 0x" + EquipmentSlot.ToString("X8") + " (" + EquipmentSlot + ")"); + InventoryLocation.AsText(b, pad); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Fields/LearnedLore.cs b/src/Mooege/Net/GS/Message/Fields/LearnedLore.cs new file mode 100644 index 00000000..e34a9e19 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/LearnedLore.cs @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Fields +{ + public class LearnedLore + { + public int Count; + // MaxLength = 256 + public int /* sno */[] m_snoLoreLearned; + + public void Parse(GameBitBuffer buffer) + { + Count = buffer.ReadInt(32); + m_snoLoreLearned = new int /* sno */[256]; + for (int i = 0; i < m_snoLoreLearned.Length; i++) m_snoLoreLearned[i] = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Count); + for (int i = 0; i < m_snoLoreLearned.Length; i++) buffer.WriteInt(32, m_snoLoreLearned[i]); + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("LearnedLore:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); + b.AppendLine("Count: 0x" + Count.ToString("X8") + " (" + Count + ")"); + b.Append(' ', pad); + b.AppendLine("m_snoLoreLearned:"); + b.Append(' ', pad); + b.AppendLine("{"); + for (int i = 0; i < m_snoLoreLearned.Length;) + { + b.Append(' ', pad + 1); + for (int j = 0; j < 8 && i < m_snoLoreLearned.Length; j++, i++) + { + b.Append("0x" + m_snoLoreLearned[i].ToString("X8") + ", "); + } + b.AppendLine(); + } + b.Append(' ', pad); + b.AppendLine("}"); + b.AppendLine(); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Fields/NPCInteraction.cs b/src/Mooege/Net/GS/Message/Fields/NPCInteraction.cs new file mode 100644 index 00000000..7420bf6d --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/NPCInteraction.cs @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Fields +{ + public class NPCInteraction + { + public NPCInteractionType Type; + public int ConversationSNO; + public int Field2; + public NPCInteractionState State; + + public void Parse(GameBitBuffer buffer) + { + Type = (NPCInteractionType) buffer.ReadInt(4); + ConversationSNO = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + State = (NPCInteractionState) buffer.ReadInt(2); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(4, (int) Type); + buffer.WriteInt(32, ConversationSNO); + buffer.WriteInt(32, Field2); + buffer.WriteInt(2, (int) State); + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("NPCInteraction:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); + b.AppendLine("Type: 0x" + ((int)Type).ToString("X8") + " (" + Type + ")"); + b.Append(' ', pad); + b.AppendLine("ConversationSNO: 0x" + ConversationSNO.ToString("X8") + " (" + ConversationSNO + ")"); + b.Append(' ', pad); + b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', pad); + b.AppendLine("State: 0x" + ((int)State).ToString("X8") + " (" + State + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } + + public enum NPCInteractionType + { + Unknown0 = 0, + Unknown1 = 1, + Conversation2 = 2, // Same as conversation, but not seen in logs? /fasbat + Conversation = 3, + Unknown4 = 4, + Craft = 5, + IdentifyAll = 6, + Hire = 7, + Inventory = 8 + } + + public enum NPCInteractionState + { + Unknown0 = 0, // Same as disabled, but should it be used? /fasbat + New = 1, + Disabled = 2, + Used = 3 + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Fields/NetAttributeKeyValue.cs b/src/Mooege/Net/GS/Message/Fields/NetAttributeKeyValue.cs new file mode 100644 index 00000000..9eb09ccd --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/NetAttributeKeyValue.cs @@ -0,0 +1,135 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Text; + +namespace Mooege.Net.GS.Message.Fields +{ + public class NetAttributeKeyValue + { + public int? Field0; + //public int Field1; + public GameAttribute Attribute; + public int Int; + public float Float; + + public void Parse(GameBitBuffer buffer) + { + if (buffer.ReadBool()) + { + Field0 = buffer.ReadInt(20); + } + int index = buffer.ReadInt(10) & 0xFFF; + + Attribute = GameAttribute.Attributes[index]; + } + + public void ParseValue(GameBitBuffer buffer) + { + switch (Attribute.EncodingType) + { + case GameAttributeEncoding.Int: + Int = buffer.ReadInt(Attribute.BitCount); + break; + case GameAttributeEncoding.IntMinMax: + Int = buffer.ReadInt(Attribute.BitCount) + Attribute.Min.Value; + break; + case GameAttributeEncoding.Float16: + Float = buffer.ReadFloat16(); + break; + case GameAttributeEncoding.Float16Or32: + Float = buffer.ReadBool() ? buffer.ReadFloat16() : buffer.ReadFloat32(); + break; + case GameAttributeEncoding.Float32: + Float = buffer.ReadFloat32(); + break; + default: + throw new Exception("bad voodoo"); + } + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteBool(Field0.HasValue); + if (Field0.HasValue) + { + buffer.WriteInt(20, Field0.Value); + } + buffer.WriteInt(10, Attribute.Id); + } + + public void EncodeValue(GameBitBuffer buffer) + { + switch (Attribute.EncodingType) + { + case GameAttributeEncoding.Int: + buffer.WriteInt(Attribute.BitCount, Int); + break; + case GameAttributeEncoding.IntMinMax: + buffer.WriteInt(Attribute.BitCount, Int - Attribute.Min.Value); + break; + case GameAttributeEncoding.Float16: + buffer.WriteFloat16(Float); + break; + case GameAttributeEncoding.Float16Or32: + if (Float >= 65536.0f || -65536.0f >= Float) + { + buffer.WriteBool(false); + buffer.WriteFloat32(Float); + } + else + { + buffer.WriteBool(true); + buffer.WriteFloat16(Float); + } + break; + case GameAttributeEncoding.Float32: + buffer.WriteFloat32(Float); + break; + default: + throw new Exception("bad voodoo"); + } + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("NetAttributeKeyValue:"); + b.Append(' ', pad++); + b.AppendLine("{"); + if (Field0.HasValue) + { + b.Append(' ', pad); + b.AppendLine("Field0.Value: 0x" + Field0.Value.ToString("X8") + " (" + Field0.Value + ")"); + } + b.Append(' ', pad); + b.Append(Attribute.Name); + b.Append(" (" + Attribute.Id + "): "); + + if (Attribute.IsInteger) + b.AppendLine("0x" + Int.ToString("X8") + " (" + Int + ")"); + else + b.AppendLine(Float.ToString("G")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Fields/PlayAnimationMessageSpec.cs b/src/Mooege/Net/GS/Message/Fields/PlayAnimationMessageSpec.cs new file mode 100644 index 00000000..059ba7f0 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/PlayAnimationMessageSpec.cs @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Fields +{ + + public class PlayAnimationMessageSpec + { + /// + /// Duration in ticks the animation plays. If set too short, animation just stop + /// + public int Duration; + + /// + /// SNOId of the animation to play + /// + public int AnimationSNO; + + /// + /// Inded of the permutation within the animation object + /// + public int PermutationIndex; + + /// + /// Speed in which to play the animation + /// + public float Speed; + + public void Parse(GameBitBuffer buffer) + { + Duration = buffer.ReadInt(32); + AnimationSNO = buffer.ReadInt(32); + PermutationIndex = buffer.ReadInt(32); + Speed = buffer.ReadFloat32(); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Duration); + buffer.WriteInt(32, AnimationSNO); + buffer.WriteInt(32, PermutationIndex); + buffer.WriteFloat32(Speed); + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("PlayAnimationMessageSpec:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); + b.AppendLine("Duration: 0x" + Duration.ToString("X8") + " (" + Duration + " ticks)"); + b.Append(' ', pad); + b.AppendLine("AnimationSNO: 0x" + AnimationSNO.ToString("X8")); + b.Append(' ', pad); + b.AppendLine("PermutationIndex: 0x" + PermutationIndex.ToString("X8") + " (" + PermutationIndex + ")"); + b.Append(' ', pad); + b.AppendLine("Speed: " + Speed.ToString("G")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Fields/PlayLineParams.cs b/src/Mooege/Net/GS/Message/Fields/PlayLineParams.cs new file mode 100644 index 00000000..9a063735 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/PlayLineParams.cs @@ -0,0 +1,198 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Common.MPQ.FileFormats; + +namespace Mooege.Net.GS.Message.Fields +{ + public enum VoiceGender + { + Male = 0, + Female = 1, + } + + public enum Class + { + None = -1, + DemonHunter = 0, + Barbarian = 1, + Wizard = 2, + WitchDoctor = 3, + Monk = 4 + } + + public class PlayLineParams + { + /// + /// Sno of the conversation ressource + /// + public int SNOConversation; + public int Field1; // have not seen != 0 + public bool Field2; // have not seen true + public bool Field3; + public bool Field4; + + /// + /// Identifier of the line (within the conversation) to play + /// + public int LineID; + + /// + /// Speaker if the current line (dont know why this is sent along and not taken from ressource by client, + /// maybe there are some lines with more than one speaker but i have not seen that yet - farmy) + /// + public Speaker Speaker; + public int Field5; // have not seen != -1 + + /// + /// Class to identify which text to show when Speaker == Speaker.Player or -1 if an npc is talking + /// + public Class TextClass; + + /// + /// Gender of the voice to play if Speaker == Speaker.Player + /// + public VoiceGender Gender; + + /// + /// Class to identify which audio to play when Speaker == Speaker.Player + /// + public Class AudioClass; + + /// + /// SNO of an Actor for the profile picture when the conversation has text + /// + public int SNOSpeakerActor; + + /// + /// Name of the actor if it is a player char (Speaker == Speaker.Player) + /// + public string Name; + + public int Field11; + + /// + /// Animation of the Speaker + /// + public int AnimationTag; + + /// + /// Duration of the played conversation line in gameticks + /// + public int Duration; + + /// + /// Identifier of this PlayLine. Used to reference this line in later messages like AutoAdvance and StopConvLine + /// + public int Id; + public int Field15; + + public void Parse(GameBitBuffer buffer) + { + SNOConversation = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadBool(); + Field3 = buffer.ReadBool(); + Field4 = buffer.ReadBool(); + LineID = buffer.ReadInt(32); + Speaker = (Speaker)buffer.ReadInt(32); + Field5 = buffer.ReadInt(32); + TextClass = (Class)buffer.ReadInt(32); + Gender = (VoiceGender)buffer.ReadInt(32); + AudioClass = (Class)buffer.ReadInt(32); + SNOSpeakerActor = buffer.ReadInt(32); + Name = buffer.ReadCharArray(49); + Field11 = buffer.ReadInt(32); + AnimationTag = buffer.ReadInt(32); + Duration = buffer.ReadInt(32); + Id = buffer.ReadInt(32); + Field15 = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, SNOConversation); + buffer.WriteInt(32, Field1); + buffer.WriteBool(Field2); + buffer.WriteBool(Field3); + buffer.WriteBool(Field4); + buffer.WriteInt(32, LineID); + buffer.WriteInt(32, (int)Speaker); + buffer.WriteInt(32, Field5); + buffer.WriteInt(32, (int)TextClass); + buffer.WriteInt(32, (int)Gender); + buffer.WriteInt(32, (int)AudioClass); + buffer.WriteInt(32, SNOSpeakerActor); + buffer.WriteCharArray(49, Name); + buffer.WriteInt(32, Field11); + buffer.WriteInt(32, AnimationTag); + buffer.WriteInt(32, Duration); + buffer.WriteInt(32, Id); + buffer.WriteInt(32, Field15); + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("PlayLineParams:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); + b.AppendLine("snoConversation: 0x" + SNOConversation.ToString("X8")); + b.Append(' ', pad); + b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); + b.AppendLine("Field2: " + (Field2 ? "true" : "false")); + b.Append(' ', pad); + b.AppendLine("Field3: " + (Field3 ? "true" : "false")); + b.Append(' ', pad); + b.AppendLine("Field4: " + (Field4 ? "true" : "false")); + b.Append(' ', pad); + b.AppendLine("LineID: 0x" + LineID.ToString("X8") + " (" + LineID + ")"); + b.Append(' ', pad); + b.AppendLine("Speaker: 0x" + ((int)Speaker).ToString("X8") + " (" + Speaker + ")"); + b.Append(' ', pad); + b.AppendLine("Field5: 0x" + Field5.ToString("X8") + " (" + Field5 + ")"); + b.Append(' ', pad); + b.AppendLine("TextClass: 0x" + ((int)TextClass).ToString("X8") + " (" + TextClass + ")"); + b.Append(' ', pad); + b.AppendLine("Flags: 0x" + ((int)Gender).ToString("X8") + " (" + Gender + ")"); + b.Append(' ', pad); + b.AppendLine("AudioClass: 0x" + ((int)AudioClass).ToString("X8") + " (" + AudioClass + ")"); + b.Append(' ', pad); + b.AppendLine("snoSpeakerActor: 0x" + SNOSpeakerActor.ToString("X8")); + b.Append(' ', pad); + b.AppendLine("Name: \"" + Name + "\""); + b.Append(' ', pad); + b.AppendLine("Field11: 0x" + Field11.ToString("X8") + " (" + Field11 + ")"); + b.Append(' ', pad); + b.AppendLine("AnimationTag: 0x" + AnimationTag.ToString("X8") + " (" + AnimationTag + ")"); + b.Append(' ', pad); + b.AppendLine("Duration: 0x" + Duration.ToString("X8") + " (" + Duration + ")"); + b.Append(' ', pad); + b.AppendLine("Id: 0x" + Id.ToString("X8") + " (" + Id + ")"); + b.Append(' ', pad); + b.AppendLine("Field15: 0x" + Field15.ToString("X8") + " (" + Field15 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Fields/PlayerQuestRewardHistoryEntry.cs b/src/Mooege/Net/GS/Message/Fields/PlayerQuestRewardHistoryEntry.cs new file mode 100644 index 00000000..20147fc7 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/PlayerQuestRewardHistoryEntry.cs @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Fields +{ + public class PlayerQuestRewardHistoryEntry + { + public int /* sno */ snoQuest; + public int Field1; + + public enum eField2 + { + Normal = 0, + Nightmare = 1, + Hell = 2, + Inferno = 3, + } + + public eField2 Field2; + + public void Parse(GameBitBuffer buffer) + { + snoQuest = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = (eField2) buffer.ReadInt(2); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, snoQuest); + buffer.WriteInt(32, Field1); + buffer.WriteInt(2, (int) Field2); + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("PlayerQuestRewardHistoryEntry:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); + b.AppendLine("snoQuest: 0x" + snoQuest.ToString("X8")); + b.Append(' ', pad); + b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); + b.AppendLine("Field2: " + Field2.ToString()); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Fields/PlayerSavedData.cs b/src/Mooege/Net/GS/Message/Fields/PlayerSavedData.cs new file mode 100644 index 00000000..210d830b --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/PlayerSavedData.cs @@ -0,0 +1,158 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Fields +{ + public class PlayerSavedData + { + // MaxLength = 6 + public HotbarButtonData[] HotBarButtons; + public byte Field2; + public HotbarButtonData HotBarButton; + public int PlaytimeTotal; + public int WaypointFlags; + public HirelingSavedData Field4; + public int Field5; + public LearnedLore LearnedLore; + // MaxLength = 6 + public ActiveSkillSavedData[] ActiveSkills; + // MaxLength = 3 + public int /* sno */[] snoTraits; + public SavePointData SavePointData; + + public void Parse(GameBitBuffer buffer) + { + HotBarButtons = new HotbarButtonData[6]; + for (int i = 0; i < HotBarButtons.Length; i++) + { + HotBarButtons[i] = new HotbarButtonData(); + HotBarButtons[i].Parse(buffer); + } + HotBarButton = new HotbarButtonData(); + Field2 = (byte)buffer.ReadInt(8); + HotBarButton.Parse(buffer); + PlaytimeTotal = buffer.ReadInt(32); + WaypointFlags = buffer.ReadInt(32); + Field4 = new HirelingSavedData(); + Field4.Parse(buffer); + Field5 = buffer.ReadInt(32); + LearnedLore = new LearnedLore(); + LearnedLore.Parse(buffer); + ActiveSkills = new ActiveSkillSavedData[6]; + for (int i = 0; i < ActiveSkills.Length; i++) + { + ActiveSkills[i] = new ActiveSkillSavedData(); + ActiveSkills[i].Parse(buffer); + } + snoTraits = new int /* sno */[3]; + for (int i = 0; i < snoTraits.Length; i++) snoTraits[i] = buffer.ReadInt(32); + SavePointData = new SavePointData(); + SavePointData.Parse(buffer); + } + + public void Encode(GameBitBuffer buffer) + { + for (int i = 0; i < HotBarButtons.Length; i++) + { + HotBarButtons[i].Encode(buffer); + } + buffer.WriteInt(8, Field2); + HotBarButton.Encode(buffer); + buffer.WriteInt(32, PlaytimeTotal); + buffer.WriteInt(32, WaypointFlags); + Field4.Encode(buffer); + buffer.WriteInt(32, Field5); + LearnedLore.Encode(buffer); + for (int i = 0; i < ActiveSkills.Length; i++) + { + ActiveSkills[i].Encode(buffer); + } + for (int i = 0; i < snoTraits.Length; i++) buffer.WriteInt(32, snoTraits[i]); + SavePointData.Encode(buffer); + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("PlayerSavedData:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); + b.AppendLine("Field0:"); + b.Append(' ', pad); + b.AppendLine("{"); + for (int i = 0; i < HotBarButtons.Length; i++) + { + HotBarButtons[i].AsText(b, pad + 1); + b.AppendLine(); + } + b.Append(' ', pad); + b.AppendLine("}"); + b.AppendLine(); + b.Append(' ', pad); + HotBarButton.AsText(b, pad); + b.Append(' ', pad); + b.AppendLine("Field2: 0x" + Field2.ToString("X2") + " (" + Field2 + ")"); + b.Append(' ', pad); + b.AppendLine("PlaytimeTotal: 0x" + PlaytimeTotal.ToString("X8") + " (" + PlaytimeTotal + ")"); + b.Append(' ', pad); + b.AppendLine("WaypointFlags: 0x" + WaypointFlags.ToString("X8") + " (" + WaypointFlags + ")"); + Field4.AsText(b, pad); + b.Append(' ', pad); + b.AppendLine("Field5: 0x" + Field5.ToString("X8") + " (" + Field5 + ")"); + LearnedLore.AsText(b, pad); + b.Append(' ', pad); + b.AppendLine("snoActiveSkills:"); + b.Append(' ', pad); + b.AppendLine("{"); + for (int i = 0; i < ActiveSkills.Length; i++ ) + { + ActiveSkills[i].AsText(b, pad + 1); + b.AppendLine(); + } + b.Append(' ', pad); + b.AppendLine("}"); + b.AppendLine(); + b.Append(' ', pad); + b.AppendLine("snoTraits:"); + b.Append(' ', pad); + b.AppendLine("{"); + for (int i = 0; i < snoTraits.Length;) + { + b.Append(' ', pad + 1); + for (int j = 0; j < 8 && i < snoTraits.Length; j++, i++) + { + b.Append("0x" + snoTraits[i].ToString("X8") + ", "); + } + b.AppendLine(); + } + b.Append(' ', pad); + b.AppendLine("}"); + b.AppendLine(); + SavePointData.AsText(b, pad); + b.Append(' ', pad); + b.AppendLine(); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Fields/RareItemName.cs b/src/Mooege/Net/GS/Message/Fields/RareItemName.cs new file mode 100644 index 00000000..c851f5f7 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/RareItemName.cs @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Fields +{ + public class RareItemName + { + public bool Field0; + public int /* sno */ snoAffixStringList; + public int Field2; + public int Field3; + + public void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadBool(); + snoAffixStringList = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteBool(Field0); + buffer.WriteInt(32, snoAffixStringList); + buffer.WriteInt(32, Field2); + buffer.WriteInt(32, Field3); + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("RareItemName:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); + b.AppendLine("Field0: " + (Field0 ? "true" : "false")); + b.Append(' ', pad); + b.AppendLine("snoAffixStringList: 0x" + snoAffixStringList.ToString("X8")); + b.Append(' ', pad); + b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', pad); + b.AppendLine("Field3: 0x" + Field3.ToString("X8") + " (" + Field3 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Fields/ResolvedPortalDestination.cs b/src/Mooege/Net/GS/Message/Fields/ResolvedPortalDestination.cs new file mode 100644 index 00000000..71d49233 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/ResolvedPortalDestination.cs @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Fields +{ + public class ResolvedPortalDestination + { + public int /* sno */ WorldSNO; + public int StartingPointActorTag; // in the target world is (should be!) a starting point, that is tagged with this id + public int /* sno */ DestLevelAreaSNO; + + public void Parse(GameBitBuffer buffer) + { + WorldSNO = buffer.ReadInt(32); + StartingPointActorTag = buffer.ReadInt(32); + DestLevelAreaSNO = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, WorldSNO); + buffer.WriteInt(32, StartingPointActorTag); + buffer.WriteInt(32, DestLevelAreaSNO); + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("ResolvedPortalDestination:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); + b.AppendLine("WorldSNO: 0x" + WorldSNO.ToString("X8")); + b.Append(' ', pad); + b.AppendLine("StartingPointActorTag: 0x" + StartingPointActorTag.ToString("X8") + " (" + StartingPointActorTag + ")"); + b.Append(' ', pad); + b.AppendLine("DestLevelAreaSNO: 0x" + DestLevelAreaSNO.ToString("X8")); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Fields/SavePointData.cs b/src/Mooege/Net/GS/Message/Fields/SavePointData.cs new file mode 100644 index 00000000..f8410d89 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/SavePointData.cs @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Fields +{ + public class SavePointData + { + public int /* sno */ snoWorld; + public int SavepointId; + + public void Parse(GameBitBuffer buffer) + { + snoWorld = buffer.ReadInt(32); + SavepointId = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, snoWorld); + buffer.WriteInt(32, SavepointId); + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("SavePointData:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); + b.AppendLine("snoWorld: 0x" + snoWorld.ToString("X8")); + b.Append(' ', pad); + b.AppendLine("SavepointId: 0x" + SavepointId.ToString("X8") + " (" + SavepointId + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Fields/SkillKeyMapping.cs b/src/Mooege/Net/GS/Message/Fields/SkillKeyMapping.cs new file mode 100644 index 00000000..80337476 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/SkillKeyMapping.cs @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Fields +{ + public class SkillKeyMapping + { + public int /* sno */ Power; + public int Field1; + public int Field2; + + public void Parse(GameBitBuffer buffer) + { + Power = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(4); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Power); + buffer.WriteInt(32, Field1); + buffer.WriteInt(4, Field2); + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("SkillKeyMapping:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); + b.AppendLine("Power: 0x" + Power.ToString("X8")); + b.Append(' ', pad); + b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); + b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Fields/VisualEquipment.cs b/src/Mooege/Net/GS/Message/Fields/VisualEquipment.cs new file mode 100644 index 00000000..d0a8d419 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/VisualEquipment.cs @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Fields +{ + public class VisualEquipment + { + // MaxLength = 8 + public VisualItem[] Equipment; + + public void Parse(GameBitBuffer buffer) + { + Equipment = new VisualItem[8]; + for (int i = 0; i < Equipment.Length; i++) + { + Equipment[i] = new VisualItem(); + Equipment[i].Parse(buffer); + } + } + + public void Encode(GameBitBuffer buffer) + { + for (int i = 0; i < Equipment.Length; i++) + { + Equipment[i].Encode(buffer); + } + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("VisualEquipment:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); + b.AppendLine("Field0:"); + b.Append(' ', pad); + b.AppendLine("{"); + for (int i = 0; i < Equipment.Length; i++) + { + Equipment[i].AsText(b, pad + 1); + b.AppendLine(); + } + b.Append(' ', pad); + b.AppendLine("}"); + b.AppendLine(); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Fields/VisualItem.cs b/src/Mooege/Net/GS/Message/Fields/VisualItem.cs new file mode 100644 index 00000000..2709e40c --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/VisualItem.cs @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace Mooege.Net.GS.Message.Fields +{ + public class VisualItem + { + public int /* gbid */ GbId; + public int Field1; + public int Field2; + public int Field3; + + public void Parse(GameBitBuffer buffer) + { + GbId = buffer.ReadInt(32); + Field1 = buffer.ReadInt(5); + Field2 = buffer.ReadInt(4); + Field3 = buffer.ReadInt(5) + (-1); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, GbId); + buffer.WriteInt(5, Field1); + buffer.WriteInt(4, Field2); + buffer.WriteInt(5, Field3 - (-1)); + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("VisualItem:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); + b.AppendLine("Field0: 0x" + GbId.ToString("X8")); + b.Append(' ', pad); + b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + Field1 + ")"); + b.Append(' ', pad); + b.AppendLine("Field2: 0x" + Field2.ToString("X8") + " (" + Field2 + ")"); + b.Append(' ', pad); + b.AppendLine("Field3: 0x" + Field3.ToString("X8") + " (" + Field3 + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/Fields/WorldLocationMessageData.cs b/src/Mooege/Net/GS/Message/Fields/WorldLocationMessageData.cs new file mode 100644 index 00000000..553bddb3 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/WorldLocationMessageData.cs @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Core.GS.Common.Types.Math; + +namespace Mooege.Net.GS.Message.Fields +{ + public class WorldLocationMessageData + { + public float Scale; + public PRTransform Transform; + public uint WorldID; + + public void Parse(GameBitBuffer buffer) + { + Scale = buffer.ReadFloat32(); + Transform = new PRTransform(); + Transform.Parse(buffer); + WorldID = buffer.ReadUInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteFloat32(Scale); + Transform.Encode(buffer); + buffer.WriteUInt(32, WorldID); + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("WorldLocationMessageData:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); + b.AppendLine("Scale: " + Scale.ToString("G")); + Transform.AsText(b, pad); + b.Append(' ', pad); + b.AppendLine("WorldID: 0x" + WorldID.ToString("X8") + " (" + WorldID + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Fields/WorldPlace.cs b/src/Mooege/Net/GS/Message/Fields/WorldPlace.cs new file mode 100644 index 00000000..f3ffb317 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/WorldPlace.cs @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; +using Mooege.Core.GS.Common.Types.Math; + +namespace Mooege.Net.GS.Message.Fields +{ + public class WorldPlace + { + public Vector3D Position; + public uint WorldID; // World's DynamicID + + public void Parse(GameBitBuffer buffer) + { + Position = new Vector3D(); + Position.Parse(buffer); + WorldID = buffer.ReadUInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + Position.Encode(buffer); + buffer.WriteUInt(32, WorldID); + } + + public void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("WorldPlace:"); + b.Append(' ', pad++); + b.AppendLine("{"); + Position.AsText(b, pad); + b.Append(' ', pad); + b.AppendLine("WorldID: 0x" + WorldID.ToString("X8") + " (" + WorldID + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/GameAttribute.List.cs b/src/Mooege/Net/GS/Message/GameAttribute.List.cs new file mode 100644 index 00000000..51aceac1 --- /dev/null +++ b/src/Mooege/Net/GS/Message/GameAttribute.List.cs @@ -0,0 +1,884 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Linq; + +namespace Mooege.Net.GS.Message +{ + public partial class GameAttribute + { + public static readonly GameAttribute[] Attributes; + + static GameAttribute() + { + Attributes = typeof(GameAttribute).GetFields() + .Where(a => + a.IsStatic && + (a.FieldType.Name == "GameAttributeI" || + a.FieldType.Name == "GameAttributeF" || + a.FieldType.Name == "GameAttributeB")) + .Select(a => a.GetValue(null) as GameAttribute) + .OrderBy(a => a.Id) + .ToArray(); + + ScriptedAttributeInitializer.ProcessAttributes(Attributes); + + // Have to manually add in some necessary keyed attribute dependents, as I don't know + // of any proper list for all potential keys a given attribute will be used with. + + // add dependency so that all 7 resistances update when intelligence does + for (int n = 0; n < 7; ++n) + { + Resistance_From_Intelligence.Dependents.Add( + new GameAttributeDependency(Resistance_Total, n, true, true)); + } + } + + // Caution: Be advised, converting these attribs from Int to Float may crash d3 client or make it throw an error! Do it with caution if needed any! /raist. + // Attack, Precision, Vitality, Defense + + + // TODO: move into categories? will probably just end up as properties on actor objects + public static readonly GameAttributeF Axe_Bad_Data = new GameAttributeF(0, 0, -1, 0, 0, "", "", "Axe_Bad_Data", GameAttributeEncoding.Float32, 0, 0, 0, 32); + public static readonly GameAttributeI Attribute_Timer = new GameAttributeI(1, 0, 5, 0, 1, "", "", "Attribute_Timer", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Attribute_Pool = new GameAttributeI(2, 0, -1, 0, 1, "", "", "Attribute_Pool", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeI Death_Count = new GameAttributeI(3, 0, -1, 0, 1, "", "", "Death_Count", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeI DualWield_Hand = new GameAttributeI(4, 0, -1, 0, 1, "", "", "DualWield_Hand", GameAttributeEncoding.IntMinMax, 1, 0, 2, 2); + public static readonly GameAttributeI DualWield_Hand_Next = new GameAttributeI(5, 0, -1, 0, 1, "", "", "DualWield_Hand_Next", GameAttributeEncoding.IntMinMax, 1, 0, 2, 2); + public static readonly GameAttributeB DualWield_Hands_Swapped = new GameAttributeB(6, 0, -1, 0, 1, "", "", "DualWield_Hands_Swapped", GameAttributeEncoding.IntMinMax, 1, 0, 1, 1); + public static readonly GameAttributeI Respawn_Game_Time = new GameAttributeI(7, 0, -1, 0, 1, "", "", "Respawn_Game_Time", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeI Backpack_Slots = new GameAttributeI(8, 0, -1, 0, 1, "", "", "Backpack_Slots", GameAttributeEncoding.IntMinMax, 1, 0, 128, 8); + public static readonly GameAttributeI Shared_Stash_Slots = new GameAttributeI(9, 0, -1, 0, 1, "", "", "Shared_Stash_Slots", GameAttributeEncoding.IntMinMax, 1, 0, 210, 8); + public static readonly GameAttributeF Strength = new GameAttributeF(10, 0, -1, 0, 0, "", "", "Strength", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Dexterity = new GameAttributeF(11, 0, -1, 0, 0, "", "", "Dexterity", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Intelligence = new GameAttributeF(12, 0, -1, 0, 0, "", "", "Intelligence", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Vitality = new GameAttributeF(13, 0, -1, 0, 0, "", "", "Vitality", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Strength_Total = new GameAttributeF(14, 0, -1, 0, 0, "", "((Strength + Stats_All_Bonus + Strength_Bonus + (Strength_Item * Core_Attributes_From_Item_Bonus_Multiplier)) * (1 + Strength_Bonus_Percent)) * (1 - Strength_Reduction_Percent)", "Strength_Total", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Dexterity_Total = new GameAttributeF(15, 0, -1, 0, 0, "", "((Dexterity + Stats_All_Bonus + Dexterity_Bonus + (Dexterity_Item * Core_Attributes_From_Item_Bonus_Multiplier)) * (1 + Dexterity_Bonus_Percent)) * (1 - Dexterity_Reduction_Percent)", "Dexterity_Total", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Intelligence_Total = new GameAttributeF(16, 0, -1, 0, 0, "", "((Intelligence + Stats_All_Bonus + Intelligence_Bonus + (Intelligence_Item * Core_Attributes_From_Item_Bonus_Multiplier)) * (1 + Intelligence_Bonus_Percent)) * (1 - Intelligence_Reduction_Percent)", "Intelligence_Total", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Vitality_Total = new GameAttributeF(17, 0, -1, 0, 0, "", "((Vitality + Stats_All_Bonus + Vitality_Bonus + (Vitality_Item * Core_Attributes_From_Item_Bonus_Multiplier)) * (1 + Vitality_Bonus_Percent)) * (1 - Vitality_Reduction_Percent)", "Vitality_Total", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Strength_Bonus = new GameAttributeF(18, 0, -1, 0, 0, "", "", "Strength_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Dexterity_Bonus = new GameAttributeF(19, 0, -1, 0, 0, "", "", "Dexterity_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Intelligence_Bonus = new GameAttributeF(20, 0, -1, 0, 0, "", "", "Intelligence_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Vitality_Bonus = new GameAttributeF(21, 0, -1, 0, 0, "", "", "Vitality_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Strength_Bonus_Percent = new GameAttributeF(22, 0, -1, 0, 0, "", "", "Strength_Bonus_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Dexterity_Bonus_Percent = new GameAttributeF(23, 0, -1, 0, 0, "", "", "Dexterity_Bonus_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Intelligence_Bonus_Percent = new GameAttributeF(24, 0, -1, 0, 0, "", "", "Intelligence_Bonus_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Vitality_Bonus_Percent = new GameAttributeF(25, 0, -1, 0, 0, "", "", "Vitality_Bonus_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Strength_Reduction_Percent = new GameAttributeF(26, 0, -1, 1, 0, "", "", "Strength_Reduction_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Dexterity_Reduction_Percent = new GameAttributeF(27, 0, -1, 1, 0, "", "", "Dexterity_Reduction_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Intelligence_Reduction_Percent = new GameAttributeF(28, 0, -1, 1, 0, "", "", "Intelligence_Reduction_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Vitality_Reduction_Percent = new GameAttributeF(29, 0, -1, 1, 0, "", "", "Vitality_Reduction_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeI Primary_Damage_Attribute = new GameAttributeI(30, -1, -1, 3, 1, "", "", "Primary_Damage_Attribute", GameAttributeEncoding.IntMinMax, 31, -1, 3, 3); + public static readonly GameAttributeF Attack = new GameAttributeF(31, 0, -1, 0, 0, "", "", "Attack", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Precision = new GameAttributeF(32, 0, -1, 0, 0, "", "", "Precision", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Defense = new GameAttributeF(33, 0, -1, 0, 0, "", "", "Defense", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Attack_Total = new GameAttributeF(34, 0, -1, 0, 0, "", "((Attack + Stats_All_Bonus + Attack_Bonus) * (1 + Attack_Bonus_Percent)) * (1 - Attack_Reduction_Percent)", "Attack_Total", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Precision_Total = new GameAttributeF(35, 0, -1, 0, 0, "", "((Precision + Stats_All_Bonus + Precision_Bonus) * (1 + Precision_Bonus_Percent)) * (1 - Precision_Reduction_Percent)", "Precision_Total", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Defense_Total = new GameAttributeF(36, 0, -1, 0, 0, "", "((Defense + Stats_All_Bonus + Defense_Bonus) * (1 + Defense_Bonus_Percent)) * (1 - Defense_Reduction_Percent)", "Defense_Total", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Attack_Bonus = new GameAttributeF(37, 0, -1, 0, 0, "", "", "Attack_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Precision_Bonus = new GameAttributeF(38, 0, -1, 0, 0, "", "", "Precision_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Defense_Bonus = new GameAttributeF(39, 0, -1, 0, 0, "", "", "Defense_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Attack_Bonus_Percent = new GameAttributeF(40, 0, -1, 0, 0, "", "", "Attack_Bonus_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Precision_Bonus_Percent = new GameAttributeF(41, 0, -1, 0, 0, "", "", "Precision_Bonus_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Defense_Bonus_Percent = new GameAttributeF(42, 0, -1, 0, 0, "", "", "Defense_Bonus_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Attack_Reduction_Percent = new GameAttributeF(43, 0, -1, 1, 0, "", "", "Attack_Reduction_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Precision_Reduction_Percent = new GameAttributeF(44, 0, -1, 1, 0, "", "", "Precision_Reduction_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Defense_Reduction_Percent = new GameAttributeF(45, 0, -1, 1, 0, "", "", "Defense_Reduction_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Armor = new GameAttributeF(46, 0, -1, 0, 0, "", "", "Armor", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Armor_Bonus_Percent = new GameAttributeF(47, 0, -1, 0, 0, "", "", "Armor_Bonus_Percent", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Armor_Item = new GameAttributeF(48, 0, -1, 0, 0, "", "0", "Armor_Item", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Armor_Bonus_Item = new GameAttributeF(49, 0, -1, 0, 0, "", "", "Armor_Bonus_Item", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Armor_Item_Percent = new GameAttributeF(50, 0, -1, 0, 0, "", "0", "Armor_Item_Percent", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Armor_Item_SubTotal = new GameAttributeF(51, 0, -1, 0, 0, "FLOOR((Armor_Item + Armor_Bonus_Item) * (Armor_Item_Percent + 1))", "", "Armor_Item_SubTotal", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Armor_Item_Total = new GameAttributeF(52, 0, -1, 0, 0, "(Armor_Item > 0)?(Max(Armor_Item_SubTotal, 1)):Armor_Item_SubTotal", "", "Armor_Item_Total", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Armor_Total = new GameAttributeF(53, 0, -1, 0, 0, "", "FLOOR((Armor + Armor_Item_Total + Strength_Total) * (Armor_Bonus_Percent + 1))", "Armor_Total", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeI Experience_Granted = new GameAttributeI(54, 0, -1, 0, 1, "", "", "Experience_Granted", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeI Experience_Next = new GameAttributeI(55, 0, -1, 0, 1, "", "", "Experience_Next", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeI Gold_Granted = new GameAttributeI(56, 0, -1, 0, 1, "", "", "Gold_Granted", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI Gold = new GameAttributeI(57, 0, -1, 0, 1, "", "", "Gold", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeF Gold_Find = new GameAttributeF(58, 0, -1, 0, 0, "", "", "Gold_Find", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeI Level = new GameAttributeI(59, 0, -1, 0, 1, "", "", "Level", GameAttributeEncoding.IntMinMax, 31, -1, 127, 8); + public static readonly GameAttributeI Level_Cap = new GameAttributeI(60, 0, -1, 0, 1, "", "", "Level_Cap", GameAttributeEncoding.IntMinMax, 1, -1, 127, 8); + public static readonly GameAttributeF Magic_Find = new GameAttributeF(61, 0, -1, 0, 0, "", "", "Magic_Find", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeB Magic_And_Gold_Find_Suppressed = new GameAttributeB(62, 0, -1, 1, 1, "", "", "Magic_And_Gold_Find_Suppressed", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeF Treasure_Find = new GameAttributeF(63, 0, 14, 0, 0, "", "", "Treasure_Find", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeI Resource_Cost_Reduction_Amount = new GameAttributeI(64, 0, 10, 0, 1, "", "", "Resource_Cost_Reduction_Amount", GameAttributeEncoding.IntMinMax, 9, -4095, 16383, 15); + public static readonly GameAttributeF Resource_Cost_Reduction_Total = new GameAttributeF(65, 0, 10, 0, 0, "", "Resource_Cost_Reduction_Amount", "Resource_Cost_Reduction_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Resource_Set_Point_Bonus = new GameAttributeF(66, 0, 10, 0, 0, "", "", "Resource_Set_Point_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Faster_Healing_Percent = new GameAttributeF(67, 0, -1, 0, 0, "", "", "Faster_Healing_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Spending_Resource_Heals_Percent = new GameAttributeF(68, 0, 10, 0, 0, "", "", "Spending_Resource_Heals_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Bonus_Healing_Received_Percent = new GameAttributeF(69, 0, -1, 0, 0, "", "", "Bonus_Healing_Received_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Reduced_Healing_Received_Percent = new GameAttributeF(70, 0, -1, 0, 0, "", "", "Reduced_Healing_Received_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Experience_Bonus = new GameAttributeF(71, 0, -1, 0, 0, "", "", "Experience_Bonus", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Experience_Bonus_Percent = new GameAttributeF(72, 0, -1, 0, 0, "", "", "Experience_Bonus_Percent", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Health_Globe_Bonus_Chance = new GameAttributeF(73, 0, -1, 0, 0, "", "", "Health_Globe_Bonus_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Health_Globe_Bonus_Mult_Chance = new GameAttributeF(74, 0, -1, 0, 0, "", "", "Health_Globe_Bonus_Mult_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Health_Globe_Bonus_Health = new GameAttributeF(75, 0, -1, 0, 0, "", "", "Health_Globe_Bonus_Health", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Increased_Health_From_Globes_Percent = new GameAttributeF(76, 0, -1, 0, 0, "", "", "Increased_Health_From_Globes_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Increased_Health_From_Globes_Percent_Total = new GameAttributeF(77, 0, -1, 0, 0, "", "Increased_Health_From_Globes_Percent", "Increased_Health_From_Globes_Percent_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Bonus_Health_Percent_Per_Second_From_Globes = new GameAttributeF(78, 0, -1, 0, 0, "", "", "Bonus_Health_Percent_Per_Second_From_Globes", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Bonus_Health_Percent_Per_Second_From_Globes_Total = new GameAttributeF(79, 0, -1, 0, 0, "", "Bonus_Health_Percent_Per_Second_From_Globes", "Bonus_Health_Percent_Per_Second_From_Globes_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Mana_Gained_From_Globes_Percent = new GameAttributeF(80, 0, -1, 0, 0, "", "", "Mana_Gained_From_Globes_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Mana_Gained_From_Globes = new GameAttributeF(81, 0, -1, 0, 0, "", "", "Mana_Gained_From_Globes", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Resistance = new GameAttributeF(82, 0, 0, 0, 0, "", "", "Resistance", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Resistance_Percent = new GameAttributeF(83, 0, 0, 0, 0, "", "", "Resistance_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Resistance_Total = new GameAttributeF(84, 0, 0, 0, 0, "", "(Resistance + Resistance_All#NONE + Resistance_From_Intelligence#NONE) * ((Resistance_Percent_All#NONE + Resistance_Percent + 1))", "Resistance_Total", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); + public static readonly GameAttributeF Resistance_All = new GameAttributeF(85, 0, -1, 0, 0, "", "", "Resistance_All", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Resistance_Percent_All = new GameAttributeF(86, 0, -1, 0, 0, "", "", "Resistance_Percent_All", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Resistance_From_Intelligence = new GameAttributeF(87, 0, -1, 0, 0, "", "(Intelligence_Total * 0.1)", "Resistance_From_Intelligence", GameAttributeEncoding.Float16, 1, 0, 0, 16); + public static readonly GameAttributeF Class_Damage_Reduction_Percent = new GameAttributeF(88, 0, -1, 0, 0, "", "", "Class_Damage_Reduction_Percent", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); + public static readonly GameAttributeI Skill = new GameAttributeI(89, 0, 4, 0, 1, "", "", "Skill", GameAttributeEncoding.IntMinMax, 9, 0, 4095, 12); + public static readonly GameAttributeI Skill_Total = new GameAttributeI(90, 0, 4, 0, 1, "", "Skill", "Skill_Total", GameAttributeEncoding.IntMinMax, 9, 0, 4095, 12); + public static readonly GameAttributeI TeamID = new GameAttributeI(91, -1, -1, 1, 1, "", "", "TeamID", GameAttributeEncoding.IntMinMax, 31, -1, 23, 5); + public static readonly GameAttributeI Team_Override = new GameAttributeI(92, -1, -1, 1, 1, "", "", "Team_Override", GameAttributeEncoding.IntMinMax, 31, -1, 23, 5); + public static readonly GameAttributeB Invulnerable = new GameAttributeB(93, 0, -1, 1, 1, "", "", "Invulnerable", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Loading = new GameAttributeB(94, 0, -1, 1, 1, "", "", "Loading", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Loading_Player_ACD = new GameAttributeI(95, -1, -1, 3, 1, "", "", "Loading_Player_ACD", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Loading_Power_SNO = new GameAttributeI(96, -1, -1, 3, 1, "", "", "Loading_Power_SNO", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Loading_Anim_Tag = new GameAttributeI(97, -1, -1, 3, 1, "", "", "Loading_Anim_Tag", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeB Loading_NewGame = new GameAttributeB(98, 0, -1, 1, 1, "", "", "Loading_NewGame", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Auto_Porting_To_Save_Point = new GameAttributeB(99, 0, -1, 1, 1, "", "", "Auto_Porting_To_Save_Point", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB No_Damage = new GameAttributeB(100, 0, -1, 1, 1, "", "", "No_Damage", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB No_AutoPickup = new GameAttributeB(101, 0, -1, 1, 1, "", "", "No_AutoPickup", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeF Light_Radius_Percent_Bonus = new GameAttributeF(102, 0, 0, 0, 0, "", "", "Light_Radius_Percent_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Hitpoints_Cur = new GameAttributeF(103, 0, -1, 0, 0, "", "Min(Hitpoints_Cur.Agg, Hitpoints_Max_Total)", "Hitpoints_Cur", GameAttributeEncoding.Float32, 31, 0, 0, 32); + public static readonly GameAttributeF Hitpoints_Factor_Level = new GameAttributeF(104, 0, -1, 0, 0, "", "", "Hitpoints_Factor_Level", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); + public static readonly GameAttributeF Hitpoints_Factor_Vitality = new GameAttributeF(105, 0, -1, 0, 0, "", "", "Hitpoints_Factor_Vitality", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); + public static readonly GameAttributeF Hitpoints_Total_From_Vitality = new GameAttributeF(106, 0, -1, 0, 0, "", "Vitality_Total * Hitpoints_Factor_Vitality", "Hitpoints_Total_From_Vitality", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); + public static readonly GameAttributeF Hitpoints_Total_From_Level = new GameAttributeF(107, 0, -1, 0, 0, "", "(Level - 1) * Hitpoints_Factor_Level", "Hitpoints_Total_From_Level", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); + public static readonly GameAttributeF Hitpoints_Granted = new GameAttributeF(108, 0, -1, 0, 0, "", "", "Hitpoints_Granted", GameAttributeEncoding.Float32, 31, 0, 0, 32); + public static readonly GameAttributeI Hitpoints_Granted_Duration = new GameAttributeI(109, 0, -1, 0, 1, "", "", "Hitpoints_Granted_Duration", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); + public static readonly GameAttributeF Hitpoints_Max = new GameAttributeF(110, 0, -1, 0, 0, "", "", "Hitpoints_Max", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); + public static readonly GameAttributeF Hitpoints_Max_Bonus = new GameAttributeF(111, 0, -1, 0, 0, "", "", "Hitpoints_Max_Bonus", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); + public static readonly GameAttributeF Hitpoints_Max_Total = new GameAttributeF(112, 0, -1, 0, 0, "", "Max((Hitpoints_Max + Hitpoints_Total_From_Level + Hitpoints_Total_From_Vitality + Hitpoints_Max_Bonus) * (Hitpoints_Max_Percent_Bonus + Hitpoints_Max_Percent_Bonus_Item + 1), 1)", "Hitpoints_Max_Total", GameAttributeEncoding.Float32, 31, 0, 0, 32); + public static readonly GameAttributeF Hitpoints_Percent = new GameAttributeF(113, 0, -1, 0, 0, "", "", "Hitpoints_Percent", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeF Hitpoints_Regen_Per_Second = new GameAttributeF(114, 0, -1, 0, 0, "", "", "Hitpoints_Regen_Per_Second", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); + public static readonly GameAttributeF Hitpoints_Max_Percent_Bonus = new GameAttributeF(115, 0, -1, 0, 0, "", "", "Hitpoints_Max_Percent_Bonus", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeF Hitpoints_Max_Percent_Bonus_Item = new GameAttributeF(116, 0, -1, 0, 0, "", "", "Hitpoints_Max_Percent_Bonus_Item", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeF Hitpoints_Healed_Target = new GameAttributeF(117, 0, -1, 0, 0, "", "", "Hitpoints_Healed_Target", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); + public static readonly GameAttributeI Resource_Type_Primary = new GameAttributeI(118, -1, -1, 3, 1, "", "", "Resource_Type_Primary", GameAttributeEncoding.IntMinMax, 1, -1, 7, 4); + public static readonly GameAttributeI Resource_Type_Secondary = new GameAttributeI(119, -1, -1, 3, 1, "", "", "Resource_Type_Secondary", GameAttributeEncoding.IntMinMax, 1, -1, 7, 4); + public static readonly GameAttributeF Resource_Cur = new GameAttributeF(120, 0, 10, 0, 0, "", "Max(Resource_Cur.Agg, 0)", "Resource_Cur", GameAttributeEncoding.Float32, 1, 0, 0, 32); + public static readonly GameAttributeF Resource_Max = new GameAttributeF(121, 0, 10, 0, 0, "", "", "Resource_Max", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); + public static readonly GameAttributeF Resource_Max_Bonus = new GameAttributeF(122, 0, 10, 0, 0, "", "", "Resource_Max_Bonus", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Resource_Max_Total = new GameAttributeF(123, 0, 10, 0, 0, "", "Max((Resource_Max + ((Level#NONE - 1) * Resource_Factor_Level) + Resource_Max_Bonus) * (Resource_Max_Percent_Bonus + 1), 0)", "Resource_Max_Total", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Resource_Factor_Level = new GameAttributeF(124, 0, 10, 0, 0, "", "", "Resource_Factor_Level", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); + public static readonly GameAttributeF Resource_Granted = new GameAttributeF(125, 0, 10, 0, 0, "", "", "Resource_Granted", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeI Resource_Granted_Duration = new GameAttributeI(126, 0, 10, 0, 1, "", "", "Resource_Granted_Duration", GameAttributeEncoding.IntMinMax, 9, 0, 16777215, 24); + public static readonly GameAttributeF Resource_Percent = new GameAttributeF(127, 0, 10, 0, 0, "", "", "Resource_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Resource_Regen_Per_Second = new GameAttributeF(128, 0, 10, 0, 0, "", "", "Resource_Regen_Per_Second", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Resource_Regen_Bonus_Percent = new GameAttributeF(129, 0, 10, 0, 0, "", "", "Resource_Regen_Bonus_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Resource_Regen_Total = new GameAttributeF(130, 0, 10, 0, 0, "", "Resource_Regen_Per_Second * (1 + Resource_Regen_Bonus_Percent) + (Resource_Regen_Percent_Per_Second * Resource_Max_Total)", "Resource_Regen_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Resource_Max_Percent_Bonus = new GameAttributeF(131, 0, 10, 0, 0, "", "Resource_Percent", "Resource_Max_Percent_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Resource_Capacity_Used = new GameAttributeF(132, 0, 10, 0, 0, "", "", "Resource_Capacity_Used", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Resource_Effective_Max = new GameAttributeF(133, 0, 10, 0, 0, "", "Resource_Max_Total - Resource_Capacity_Used", "Resource_Effective_Max", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Resource_Regen_Percent_Per_Second = new GameAttributeF(134, 0, 10, 0, 0, "", "", "Resource_Regen_Percent_Per_Second", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Resource_Degeneration_Stop_Point = new GameAttributeF(135, 0, 10, 0, 0, "", "", "Resource_Degeneration_Stop_Point", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Movement_Scalar = new GameAttributeF(136, 0, -1, 0, 0, "", "", "Movement_Scalar", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Walking_Rate = new GameAttributeF(137, 0, -1, 0, 0, "", "", "Walking_Rate", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Running_Rate = new GameAttributeF(138, 0, -1, 0, 0, "", "", "Running_Rate", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Sprinting_Rate = new GameAttributeF(139, 0, -1, 0, 0, "", "", "Sprinting_Rate", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Strafing_Rate = new GameAttributeF(140, 0, -1, 0, 0, "", "", "Strafing_Rate", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Walking_Rate_Total = new GameAttributeF(141, 0, -1, 0, 0, "", "Walking_Rate * Movement_Scalar_Total", "Walking_Rate_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Running_Rate_Total = new GameAttributeF(142, 0, -1, 0, 0, "", "Running_Rate * Movement_Scalar_Total", "Running_Rate_Total", GameAttributeEncoding.Float16, 41, 0, 0, 16); + public static readonly GameAttributeF Last_Running_Rate = new GameAttributeF(143, 0, -1, 0, 0, "", "", "Last_Running_Rate", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeF Sprinting_Rate_Total = new GameAttributeF(144, 0, -1, 0, 0, "", "Sprinting_Rate * Movement_Scalar_Total", "Sprinting_Rate_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Strafing_Rate_Total = new GameAttributeF(145, 0, -1, 0, 0, "", "Strafing_Rate * Movement_Scalar_Total", "Strafing_Rate_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Movement_Bonus_Total = new GameAttributeF(146, 0, -1, -1, 0, "0", "Movement_Bonus_Run_Speed", "Movement_Bonus_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Movement_Scalar_Subtotal = new GameAttributeF(147, 0, -1, 0, 0, "0", "Max(0.1, Movement_Scalar) * (1 + Movement_Bonus_Total) * (1 - Movement_Scalar_Reduction_Percent * (1 - Min(1, Movement_Scalar_Reduction_Resistance)))", "Movement_Scalar_Subtotal", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Movement_Scalar_Capped_Total = new GameAttributeF(148, 0, -1, 0, 0, "0", "Min(1.25, Movement_Scalar_Subtotal)", "Movement_Scalar_Capped_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Movement_Scalar_Uncapped_Bonus = new GameAttributeF(149, 0, -1, 0, 0, "", "", "Movement_Scalar_Uncapped_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Movement_Scalar_Total = new GameAttributeF(150, 0, -1, 0, 0, "0", "Movement_Scalar_Capped_Total + Movement_Scalar_Uncapped_Bonus", "Movement_Scalar_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Movement_Bonus_Run_Speed = new GameAttributeF(151, 0, -1, 1, 0, "", "", "Movement_Bonus_Run_Speed", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Casting_Speed = new GameAttributeF(152, 0, -1, 0, 0, "", "", "Casting_Speed", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Casting_Speed_Bonus = new GameAttributeF(153, 0, -1, 0, 0, "", "", "Casting_Speed_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Casting_Speed_Total = new GameAttributeF(154, 0, -1, 0, 0, "", "(Casting_Speed + Casting_Speed_Bonus) * Max(0.1, 1 + Casting_Speed_Percent)", "Casting_Speed_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeB Always_Hits = new GameAttributeB(155, 0, -1, 1, 1, "", "", "Always_Hits", GameAttributeEncoding.IntMinMax, 3, 0, 1, 1); + public static readonly GameAttributeF Hit_Chance = new GameAttributeF(156, 0, -1, 0, 0, "", "", "Hit_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Attacks_Per_Second_Item = new GameAttributeF(157, 0, -1, 0, 0, "", "0", "Attacks_Per_Second_Item", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Attacks_Per_Second_Item_Percent = new GameAttributeF(158, 0, -1, 0, 0, "", "0", "Attacks_Per_Second_Item_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Attacks_Per_Second_Item_Subtotal = new GameAttributeF(159, 0, -1, 0, 0, "Attacks_Per_Second_Item * (1 + Attacks_Per_Second_Item_Percent)", "0", "Attacks_Per_Second_Item_Subtotal", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Attacks_Per_Second_Item_Bonus = new GameAttributeF(160, 0, -1, 0, 0, "", "", "Attacks_Per_Second_Item_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Attacks_Per_Second_Item_Total = new GameAttributeF(161, 0, -1, 0, 0, "(Attacks_Per_Second_Item_Subtotal + Attacks_Per_Second_Item_Bonus)", "", "Attacks_Per_Second_Item_Total", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Attacks_Per_Second = new GameAttributeF(162, 0, -1, 0, 0, "0", "", "Attacks_Per_Second", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Attacks_Per_Second_Bonus = new GameAttributeF(163, 0, -1, 0, 0, "0", "", "Attacks_Per_Second_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Attacks_Per_Second_Total = new GameAttributeF(164, 0, -1, 0, 0, "0", "Max(0.01, (((Attacks_Per_Second_Item_CurrentHand > 0.0) ? Attacks_Per_Second_Item_CurrentHand : Attacks_Per_Second) + Attacks_Per_Second_Bonus + Attacks_Per_Second_Item_Bonus) * Max(0.1, (1 + Attacks_Per_Second_Percent)))", "Attacks_Per_Second_Total", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Attacks_Per_Second_Percent = new GameAttributeF(165, 0, -1, 0, 0, "", "", "Attacks_Per_Second_Percent", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF AI_Cooldown_Reduction_Percent = new GameAttributeF(166, 0, -1, 0, 0, "0", "", "AI_Cooldown_Reduction_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeF Power_Cooldown_Reduction_Percent = new GameAttributeF(167, 0, -1, 0, 0, "0", "", "Power_Cooldown_Reduction_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeF Damage_Delta = new GameAttributeF(168, 0, 0, 0, 0, "", "", "Damage_Delta", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_Delta_Total = new GameAttributeF(169, 0, 0, 0, 0, "", "Max(Damage_Delta - Damage_Bonus_Min + Damage_Weapon_Delta_Total_CurrentHand, 0)", "Damage_Delta_Total", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_Min = new GameAttributeF(170, 0, 0, 0, 0, "", "", "Damage_Min", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_Bonus_Min = new GameAttributeF(171, 0, 0, 0, 0, "", "", "Damage_Bonus_Min", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_Min_Total = new GameAttributeF(172, 0, 0, 0, 0, "", "Damage_Min_Subtotal + Damage_Type_Percent_Bonus * Damage_Min_Subtotal#Physical", "Damage_Min_Total", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_Min_Subtotal = new GameAttributeF(173, 0, 0, 0, 0, "", "Damage_Min + Damage_Bonus_Min + Damage_Weapon_Min_Total_CurrentHand", "Damage_Min_Subtotal", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_Percent_All_From_Skills = new GameAttributeF(174, 0, -1, 0, 0, "", "", "Damage_Percent_All_From_Skills", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Damage_Weapon_Delta = new GameAttributeF(175, 0, 0, 0, 0, "", "", "Damage_Weapon_Delta", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_Weapon_Delta_SubTotal = new GameAttributeF(176, 0, 0, 0, 0, "(Damage_Weapon_Delta > 0.0) ? (Max(1, Damage_Weapon_Delta - Damage_Weapon_Bonus_Min)) : Damage_Weapon_Delta", "", "Damage_Weapon_Delta_SubTotal", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_Weapon_Max = new GameAttributeF(177, 0, 0, 0, 0, "(Damage_Weapon_Min + Damage_Weapon_Delta)", "", "Damage_Weapon_Max", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_Weapon_Max_Total = new GameAttributeF(178, 0, 0, 0, 0, "(Damage_Weapon_Min_Total + Damage_Weapon_Delta_Total)", "", "Damage_Weapon_Max_Total", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_Weapon_Max_Total_All = new GameAttributeF(179, 0, -1, 0, 0, "(Damage_Weapon_Max_Total#Physical + Damage_Weapon_Max_Total#Fire + Damage_Weapon_Max_Total#Cold + Damage_Weapon_Max_Total#Lightning + Damage_Weapon_Max_Total#Poison + Damage_Weapon_Max_Total#Arcane + Damage_Weapon_Max_Total#Holy)", "", "Damage_Weapon_Max_Total_All", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_Weapon_Delta_Total = new GameAttributeF(180, 0, 0, 0, 0, "Max((Damage_Weapon_Delta_SubTotal + Damage_Weapon_Bonus_Delta) * (1 + Damage_Weapon_Percent_Total), 0)", "", "Damage_Weapon_Delta_Total", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Damage_Weapon_Delta_Total_All = new GameAttributeF(181, 0, -1, 0, 0, "(Damage_Weapon_Delta_Total#Physical + Damage_Weapon_Delta_Total#Fire + Damage_Weapon_Delta_Total#Cold + Damage_Weapon_Delta_Total#Lightning + Damage_Weapon_Delta_Total#Poison + Damage_Weapon_Delta_Total#Arcane + Damage_Weapon_Delta_Total#Holy)", "", "Damage_Weapon_Delta_Total_All", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Damage_Weapon_Bonus_Delta = new GameAttributeF(182, 0, 0, 0, 0, "", "", "Damage_Weapon_Bonus_Delta", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_Weapon_Min = new GameAttributeF(183, 0, 0, 0, 0, "", "", "Damage_Weapon_Min", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_Weapon_Min_Total = new GameAttributeF(184, 0, 0, 0, 0, "(Damage_Weapon_Min + Damage_Weapon_Bonus_Min) * (1 + Damage_Weapon_Percent_Total)", "", "Damage_Weapon_Min_Total", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Damage_Weapon_Min_Total_All = new GameAttributeF(185, 0, -1, 0, 0, "(Damage_Weapon_Min_Total#Physical + Damage_Weapon_Min_Total#Fire + Damage_Weapon_Min_Total#Cold + Damage_Weapon_Min_Total#Lightning + Damage_Weapon_Min_Total#Poison + Damage_Weapon_Min_Total#Arcane + Damage_Weapon_Min_Total#Holy)", "", "Damage_Weapon_Min_Total_All", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Damage_Weapon_Bonus_Min = new GameAttributeF(186, 0, 0, 0, 0, "", "", "Damage_Weapon_Bonus_Min", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_Weapon_Percent_Bonus = new GameAttributeF(187, 0, 0, 0, 0, "", "", "Damage_Weapon_Percent_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Damage_Weapon_Percent_All = new GameAttributeF(188, 0, -1, 0, 0, "", "", "Damage_Weapon_Percent_All", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Damage_Weapon_Percent_Total = new GameAttributeF(189, 0, 0, 0, 0, "Damage_Weapon_Percent_Bonus + Damage_Weapon_Percent_All#NONE", "", "Damage_Weapon_Percent_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Damage_Type_Percent_Bonus = new GameAttributeF(190, 0, 0, 0, 0, "", "", "Damage_Type_Percent_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Damage_Percent_Bonus_Witchdoctor = new GameAttributeF(191, 0, -1, 0, 0, "", "", "Damage_Percent_Bonus_Witchdoctor", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Damage_Percent_Bonus_Wizard = new GameAttributeF(192, 0, -1, 0, 0, "", "", "Damage_Percent_Bonus_Wizard", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Crit_Percent_Base = new GameAttributeF(193, 0, -1, 0, 0, "", "", "Crit_Percent_Base", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Crit_Percent_Bonus_Capped = new GameAttributeF(194, 0, -1, 0, 0, "", "", "Crit_Percent_Bonus_Capped", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Crit_Percent_Bonus_Uncapped = new GameAttributeF(195, 0, -1, 0, 0, "", "", "Crit_Percent_Bonus_Uncapped", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Crit_Percent_Cap = new GameAttributeF(196, 0, -1, 0, 0, "", "", "Crit_Percent_Cap", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Crit_Damage_Percent = new GameAttributeF(197, 0, -1, 0, 0, "", "", "Crit_Damage_Percent", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeI Crit_Effect_Time = new GameAttributeI(198, 0, -1, 3, 1, "", "", "Crit_Effect_Time", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeF Pierce_Chance = new GameAttributeF(199, 0, -1, 0, 0, "", "", "Pierce_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Damage_Absorb_Percent = new GameAttributeF(200, 0, -1, 0, 0, "", "", "Damage_Absorb_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Damage_Reduction_Total = new GameAttributeF(201, 0, 0, 0, 0, "", "", "Damage_Reduction_Total", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_Reduction_Current = new GameAttributeF(202, 0, 0, 0, 0, "", "", "Damage_Reduction_Current", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeI Damage_Reduction_Last_Tick = new GameAttributeI(203, 0, 0, 3, 1, "", "", "Damage_Reduction_Last_Tick", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeF Block_Chance = new GameAttributeF(204, 0, -1, 0, 0, "", "", "Block_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Block_Chance_Total = new GameAttributeF(205, 0, -1, 0, 0, "", "Block_Chance + Block_Chance_Item_Total", "Block_Chance_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Block_Chance_Bonus_Item = new GameAttributeF(206, 0, -1, 0, 0, "", "", "Block_Chance_Bonus_Item", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Block_Chance_Item = new GameAttributeF(207, 0, -1, 0, 0, "", "0", "Block_Chance_Item", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Block_Chance_Item_Total = new GameAttributeF(208, 0, -1, 0, 0, "Block_Chance_Item + Block_Chance_Bonus_Item", "", "Block_Chance_Item_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Block_Amount = new GameAttributeF(209, 0, -1, 0, 0, "", "", "Block_Amount", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Block_Amount_Bonus_Percent = new GameAttributeF(210, 0, -1, 0, 0, "", "", "Block_Amount_Bonus_Percent", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Block_Amount_Total_Min = new GameAttributeF(211, 0, -1, 0, 0, "", "(Block_Amount + Block_Amount_Item_Min + Block_Amount_Item_Bonus) * (1 + Block_Amount_Bonus_Percent)", "Block_Amount_Total_Min", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Block_Amount_Total_Max = new GameAttributeF(212, 0, -1, 0, 0, "", "(Block_Amount + Block_Amount_Item_Min + Block_Amount_Item_Delta + Block_Amount_Item_Bonus) * (1 + Block_Amount_Bonus_Percent)", "Block_Amount_Total_Max", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Block_Amount_Item_Min = new GameAttributeF(213, 0, -1, 0, 0, "", "", "Block_Amount_Item_Min", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Block_Amount_Item_Delta = new GameAttributeF(214, 0, -1, 0, 0, "", "", "Block_Amount_Item_Delta", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Block_Amount_Item_Bonus = new GameAttributeF(215, 0, -1, 0, 0, "", "", "Block_Amount_Item_Bonus", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Dodge_Chance_Bonus = new GameAttributeF(216, 0, -1, 7, 0, "", "", "Dodge_Chance_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Dodge_Chance_Bonus_Melee = new GameAttributeF(217, 0, -1, 7, 0, "", "", "Dodge_Chance_Bonus_Melee", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Dodge_Chance_Bonus_Ranged = new GameAttributeF(218, 0, -1, 7, 0, "", "", "Dodge_Chance_Bonus_Ranged", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Get_Hit_Current = new GameAttributeF(219, 0, -1, 0, 0, "", "", "Get_Hit_Current", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); + public static readonly GameAttributeF Get_Hit_Max_Base = new GameAttributeF(220, 0, -1, 0, 0, "", "", "Get_Hit_Max_Base", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); + public static readonly GameAttributeF Get_Hit_Max_Per_Level = new GameAttributeF(221, 0, -1, 0, 0, "", "", "Get_Hit_Max_Per_Level", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); + public static readonly GameAttributeF Get_Hit_Max = new GameAttributeF(222, 0, -1, 0, 0, "", "Get_Hit_Max_Base + (Get_Hit_Max_Per_Level * Level)", "Get_Hit_Max", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); + public static readonly GameAttributeF Get_Hit_Recovery_Base = new GameAttributeF(223, 0, -1, 0, 0, "", "", "Get_Hit_Recovery_Base", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); + public static readonly GameAttributeF Get_Hit_Recovery_Per_Level = new GameAttributeF(224, 0, -1, 0, 0, "", "", "Get_Hit_Recovery_Per_Level", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); + public static readonly GameAttributeF Get_Hit_Recovery = new GameAttributeF(225, 0, -1, 0, 0, "", "Get_Hit_Recovery_Base + (Get_Hit_Recovery_Per_Level * Level)", "Get_Hit_Recovery", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Get_Hit_Damage = new GameAttributeF(226, 0, -1, 0, 0, "", "", "Get_Hit_Damage", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Get_Hit_Damage_Scalar = new GameAttributeF(227, 0, -1, 0, 0, "", "", "Get_Hit_Damage_Scalar", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); + public static readonly GameAttributeI Last_Damage_MainActor = new GameAttributeI(228, -1, -1, 3, 1, "", "", "Last_Damage_MainActor", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeI Last_ACD_Attacked = new GameAttributeI(229, -1, -1, 3, 1, "", "", "Last_ACD_Attacked", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeB Ignores_Critical_Hits = new GameAttributeB(230, 0, -1, 1, 1, "", "", "Ignores_Critical_Hits", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Immunity = new GameAttributeB(231, 0, 0, 1, 1, "", "", "Immunity", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Untargetable = new GameAttributeB(232, 0, -1, 1, 1, "", "", "Untargetable", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Immobolize = new GameAttributeB(233, 0, -1, 1, 1, "", "", "Immobolize", GameAttributeEncoding.IntMinMax, 1, 0, 1, 1); + public static readonly GameAttributeB Immune_To_Knockback = new GameAttributeB(234, 0, -1, 1, 1, "", "", "Immune_To_Knockback", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Power_Immobilize = new GameAttributeB(235, 0, -1, 1, 1, "", "", "Power_Immobilize", GameAttributeEncoding.IntMinMax, 1, 0, 1, 1); + public static readonly GameAttributeF Stun_Chance = new GameAttributeF(236, 0, -1, 0, 0, "", "", "Stun_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Stun_Length = new GameAttributeF(237, 0, -1, 0, 0, "", "", "Stun_Length", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Stun_Recovery = new GameAttributeF(238, 0, -1, 0, 0, "", "", "Stun_Recovery", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Stun_Recovery_Speed = new GameAttributeF(239, 0, -1, 0, 0, "", "", "Stun_Recovery_Speed", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeB Stunned = new GameAttributeB(240, 0, -1, 1, 1, "", "", "Stunned", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Stun_Immune = new GameAttributeB(241, 0, -1, 1, 1, "", "", "Stun_Immune", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeF Poison_Length_Reduction = new GameAttributeF(242, 0, -1, 0, 0, "", "", "Poison_Length_Reduction", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeB Poisoned = new GameAttributeB(243, 0, -1, 1, 1, "", "", "Poisoned", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Bleeding = new GameAttributeB(244, 0, -1, 1, 1, "", "", "Bleeding", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeF Bleed_Duration = new GameAttributeF(245, 0, -1, 0, 0, "", "", "Bleed_Duration", GameAttributeEncoding.Float16, 1, 0, 0, 16); + public static readonly GameAttributeB Chilled = new GameAttributeB(246, 0, -1, 1, 1, "", "", "Chilled", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeF Freeze_Length_Reduction = new GameAttributeF(247, 0, -1, 0, 0, "", "", "Freeze_Length_Reduction", GameAttributeEncoding.Float16, 1, 0, 0, 16); + public static readonly GameAttributeB Freeze_Immune = new GameAttributeB(248, 0, -1, 1, 1, "", "", "Freeze_Immune", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Webbed = new GameAttributeB(249, 0, -1, 1, 1, "", "", "Webbed", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Slow = new GameAttributeB(250, 0, -1, 1, 1, "", "", "Slow", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB FireAura = new GameAttributeB(251, 0, -1, 1, 1, "", "", "FireAura", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB LightningAura = new GameAttributeB(252, 0, -1, 1, 1, "", "", "LightningAura", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB ColdAura = new GameAttributeB(253, 0, -1, 1, 1, "", "", "ColdAura", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB PoisonAura = new GameAttributeB(254, 0, -1, 1, 1, "", "", "PoisonAura", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Blind = new GameAttributeB(255, 0, -1, 1, 1, "", "", "Blind", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Enraged = new GameAttributeB(256, 0, -1, 1, 1, "", "", "Enraged", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Slowdown_Immune = new GameAttributeB(257, 0, -1, 1, 1, "", "", "Slowdown_Immune", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Gethit_Immune = new GameAttributeB(258, 0, -1, 1, 1, "", "", "Gethit_Immune", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeF Suffocation_Per_Second = new GameAttributeF(259, 0, -1, 0, 0, "", "", "Suffocation_Per_Second", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); + public static readonly GameAttributeF Suffocation_Unit_Value = new GameAttributeF(260, 0, -1, 1, 0, "", "", "Suffocation_Unit_Value", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); + public static readonly GameAttributeF Thorns_Percent = new GameAttributeF(261, 0, 0, 0, 0, "", "", "Thorns_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Thorns_Percent_All = new GameAttributeF(262, 0, -1, 0, 0, "", "", "Thorns_Percent_All", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Thorns_Percent_Total = new GameAttributeF(263, 0, 0, 0, 0, "", "Thorns_Percent + Thorns_Percent_All#NONE", "Thorns_Percent_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Thorns_Fixed = new GameAttributeF(264, 0, 0, 0, 0, "", "", "Thorns_Fixed", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Steal_Health_Percent = new GameAttributeF(265, 0, -1, 0, 0, "", "", "Steal_Health_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Steal_Mana_Percent = new GameAttributeF(266, 0, -1, 0, 0, "", "", "Steal_Mana_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Resource_On_Hit = new GameAttributeF(267, 0, 10, 0, 0, "", "", "Resource_On_Hit", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Resource_On_Kill = new GameAttributeF(268, 0, 10, 0, 0, "", "", "Resource_On_Kill", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Resource_On_Crit = new GameAttributeF(269, 0, 10, 0, 0, "", "", "Resource_On_Crit", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Hitpoints_On_Hit = new GameAttributeF(270, 0, -1, 0, 0, "", "", "Hitpoints_On_Hit", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Hitpoints_On_Kill = new GameAttributeF(271, 0, -1, 0, 0, "", "", "Hitpoints_On_Kill", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_To_Mana = new GameAttributeF(272, 0, -1, 0, 0, "", "", "Damage_To_Mana", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeI Last_Proc_Time = new GameAttributeI(273, 0, -1, 3, 1, "", "", "Last_Proc_Time", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeF Damage_Power_Delta = new GameAttributeF(274, 0, 0, 0, 0, "", "", "Damage_Power_Delta", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_Power_Min = new GameAttributeF(275, 0, 0, 0, 0, "", "", "Damage_Power_Min", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeI Rope_Overlay = new GameAttributeI(276, -1, -1, 3, 1, "", "", "Rope_Overlay", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI General_Cooldown = new GameAttributeI(277, -1, -1, 3, 1, "", "", "General_Cooldown", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeI Power_Cooldown = new GameAttributeI(278, -1, 4, 1, 1, "", "", "Power_Cooldown", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeI Power_Cooldown_Start = new GameAttributeI(279, -1, 4, 1, 1, "", "", "Power_Cooldown_Start", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeI Proc_Cooldown = new GameAttributeI(280, 0, -1, 1, 1, "", "", "Proc_Cooldown", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeI Emote_Cooldown = new GameAttributeI(281, 0, -1, 1, 1, "", "", "Emote_Cooldown", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeF Projectile_Speed = new GameAttributeF(282, 0, -1, 0, 0, "", "", "Projectile_Speed", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeF Projectile_Speed_Increase_Percent = new GameAttributeF(283, 0, -1, 0, 0, "", "", "Projectile_Speed_Increase_Percent", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeB Destroy_When_Path_Blocked = new GameAttributeB(284, 0, -1, 1, 1, "", "", "Destroy When Path Blocked", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Skill_Toggled_State = new GameAttributeB(285, 0, 4, 1, 1, "", "", "Skill_Toggled_State", GameAttributeEncoding.IntMinMax, 1, 0, 1, 1); + public static readonly GameAttributeI Act = new GameAttributeI(286, -1, -1, 3, 1, "", "", "Act", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI Difficulty = new GameAttributeI(287, -1, -1, 3, 1, "", "", "Difficulty", GameAttributeEncoding.IntMinMax, 9, -1, 4, 3); + public static readonly GameAttributeF Last_Damage_Amount = new GameAttributeF(288, -1, -1, 3, 0, "", "", "Last_Damage_Amount", GameAttributeEncoding.Float16Or32, 0, 0, 0, 0); + public static readonly GameAttributeB In_Knockback = new GameAttributeB(289, 0, -1, 1, 1, "", "", "In_Knockback", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeF Amplify_Damage_Type_Percent = new GameAttributeF(290, 0, 0, 0, 0, "", "", "Amplify_Damage_Type_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeF Amplify_Damage_Percent = new GameAttributeF(291, 0, -1, 0, 0, "", "", "Amplify_Damage_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeI Durability_Cur = new GameAttributeI(292, 0, -1, 0, 1, "", "", "Durability_Cur", GameAttributeEncoding.Int, 8, 0, 0, 32); + public static readonly GameAttributeI Durability_Max = new GameAttributeI(293, 0, -1, 0, 1, "", "", "Durability_Max", GameAttributeEncoding.Int, 8, 0, 0, 32); + public static readonly GameAttributeI Durability_Last_Damage = new GameAttributeI(294, 0, -1, 0, 1, "", "", "Durability_Last_Damage", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Item_Quality_Level = new GameAttributeI(295, -1, -1, 1, 1, "", "", "Item_Quality_Level", GameAttributeEncoding.IntMinMax, 8, -1, 11, 4); + public static readonly GameAttributeF Item_Cost_Percent_Bonus = new GameAttributeF(296, 0, -1, 0, 0, "", "", "Item_Cost_Percent_Bonus", GameAttributeEncoding.Float16, 8, 0, 0, 16); + public static readonly GameAttributeB Item_Equipped = new GameAttributeB(297, 0, -1, 1, 1, "", "", "Item_Equipped", GameAttributeEncoding.IntMinMax, 8, 0, 1, 1); + public static readonly GameAttributeF Requirement = new GameAttributeF(298, 0, 1, 1, 0, "FLOOR(Requirement.Agg * (1 + Requirements_Ease_Percent#NONE))", "", "Requirement", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Requirements_Ease_Percent = new GameAttributeF(299, 0, -1, 0, 0, "", "0", "Requirements_Ease_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Requirement_When_Equipped = new GameAttributeF(300, 0, 1, 1, 0, "", "", "Requirement_When_Equipped", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeI Sockets = new GameAttributeI(301, 0, -1, 0, 1, "", "0", "Sockets", GameAttributeEncoding.IntMinMax, 8, 0, 3, 2); + public static readonly GameAttributeI Sockets_Filled = new GameAttributeI(302, 0, -1, 0, 1, "", "0", "Sockets_Filled", GameAttributeEncoding.IntMinMax, 8, 0, 3, 2); + public static readonly GameAttributeF Stats_All_Bonus = new GameAttributeF(303, 0, -1, 0, 0, "", "", "Stats_All_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeI Item_Bound_To_ACD = new GameAttributeI(304, -1, -1, 3, 1, "", "0", "Item_Bound_To_ACD", GameAttributeEncoding.Int, 8, 0, 0, 32); + public static readonly GameAttributeI Item_Locked_To_ACD = new GameAttributeI(305, -1, -1, 3, 1, "", "0", "Item_Locked_To_ACD", GameAttributeEncoding.Int, 8, 0, 0, 32); + public static readonly GameAttributeI Item_Binding_Level_Override = new GameAttributeI(306, 0, -1, 1, 1, "", "0", "Item_Binding_Level_Override", GameAttributeEncoding.IntMinMax, 8, 0, 5, 3); + public static readonly GameAttributeI ItemStackQuantityHi = new GameAttributeI(307, 0, -1, 4, 1, "", "", "ItemStackQuantityHi", GameAttributeEncoding.Int, 8, 0, 0, 32); + public static readonly GameAttributeI ItemStackQuantityLo = new GameAttributeI(308, 0, -1, 4, 1, "", "", "ItemStackQuantityLo", GameAttributeEncoding.Int, 8, 0, 0, 32); + public static readonly GameAttributeF Run_Speed_Granted = new GameAttributeF(309, 0, -1, 0, 0, "", "", "Run_Speed_Granted", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeI Run_Speed_Duration = new GameAttributeI(310, 0, -1, 0, 1, "", "", "Run_Speed_Duration", GameAttributeEncoding.IntMinMax, 9, 0, 16777215, 24); + public static readonly GameAttributeI IdentifyCost = new GameAttributeI(311, 0, -1, 0, 1, "", "", "IdentifyCost", GameAttributeEncoding.Int, 8, 0, 0, 32); + public static readonly GameAttributeI Seed = new GameAttributeI(312, 0, -1, 4, 1, "", "0", "Seed", GameAttributeEncoding.Int, 8, 0, 0, 32); + public static readonly GameAttributeB IsCrafted = new GameAttributeB(313, 0, -1, 4, 1, "", "0", "IsCrafted", GameAttributeEncoding.IntMinMax, 8, 0, 1, 1); + public static readonly GameAttributeI DyeType = new GameAttributeI(314, 0, -1, 1, 1, "", "0", "DyeType", GameAttributeEncoding.IntMinMax, 8, -1, 30, 5); + public static readonly GameAttributeI EnchantAffix = new GameAttributeI(315, -1, -1, 3, 1, "", "0", "EnchantAffix", GameAttributeEncoding.Int, 8, 0, 0, 32); + public static readonly GameAttributeI EnchantRangeVal = new GameAttributeI(316, 0, -1, 4, 1, "", "0", "EnchantRangeVal", GameAttributeEncoding.IntMinMax, 8, 0, 255, 8); + public static readonly GameAttributeI HighlySalvageable = new GameAttributeI(317, 0, -1, 1, 1, "", "0", "HighlySalvageable", GameAttributeEncoding.Int, 8, 0, 0, 32); + public static readonly GameAttributeI ItemUnlockTimeHi = new GameAttributeI(318, 0, -1, 4, 1, "", "", "ItemUnlockTimeHi", GameAttributeEncoding.Int, 8, 0, 0, 32); + public static readonly GameAttributeI ItemUnlockTimeLo = new GameAttributeI(319, 0, -1, 4, 1, "", "", "ItemUnlockTimeLo", GameAttributeEncoding.Int, 8, 0, 0, 32); + public static readonly GameAttributeB Always_Plays_GetHit = new GameAttributeB(320, 0, -1, 1, 1, "", "", "Always_Plays_GetHit", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Hidden = new GameAttributeB(321, 0, -1, 1, 1, "", "", "Hidden", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI RActor_Fade_Group = new GameAttributeI(322, -1, -1, 1, 1, "", "", "RActor_Fade_Group", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Quest_Range = new GameAttributeI(323, -1, -1, 3, 1, "", "", "Quest Range", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Attack_Cooldown_Min = new GameAttributeI(324, 0, -1, 0, 1, "", "", "Attack_Cooldown_Min", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); + public static readonly GameAttributeI Attack_Cooldown_Delta = new GameAttributeI(325, 0, -1, 0, 1, "", "", "Attack_Cooldown_Delta", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); + public static readonly GameAttributeI InitialCooldownMinTotal = new GameAttributeI(326, 0, -1, 0, 1, "", "InitialCooldownMin / Attacks_Per_Second_Total", "InitialCooldownMinTotal", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); + public static readonly GameAttributeI InitialCooldownDeltaTotal = new GameAttributeI(327, 0, -1, 0, 1, "", "InitialCooldownDelta / Attacks_Per_Second_Total", "InitialCooldownDeltaTotal", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); + public static readonly GameAttributeI Attack_Cooldown_Min_Total = new GameAttributeI(328, 0, -1, 0, 1, "", "Attack_Cooldown_Min / Attacks_Per_Second_Total", "Attack_Cooldown_Min_Total", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); + public static readonly GameAttributeI Attack_Cooldown_Delta_Total = new GameAttributeI(329, 0, -1, 0, 1, "", "Attack_Cooldown_Delta / Attacks_Per_Second_Total", "Attack_Cooldown_Delta_Total", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); + public static readonly GameAttributeI Closing_Cooldown_Min_Total = new GameAttributeI(330, 0, -1, 0, 1, "", "", "Closing_Cooldown_Min_Total", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); + public static readonly GameAttributeI Closing_Cooldown_Delta_Total = new GameAttributeI(331, 0, -1, 0, 1, "", "", "Closing_Cooldown_Delta_Total", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); + public static readonly GameAttributeB Quest_Monster = new GameAttributeB(332, 0, -1, 0, 1, "", "", "Quest_Monster", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Quest_Monster_Effect = new GameAttributeI(333, -1, -1, 3, 1, "", "", "Quest_Monster Effect", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Treasure_Class = new GameAttributeI(334, -1, -1, 3, 1, "", "", "Treasure_Class", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeB Removes_Body_On_Death = new GameAttributeB(335, 0, -1, 1, 1, "", "", "Removes_Body_On_Death", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeI InitialCooldownMin = new GameAttributeI(336, 0, -1, 0, 1, "", "", "InitialCooldownMin", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); + public static readonly GameAttributeI InitialCooldownDelta = new GameAttributeI(337, 0, -1, 0, 1, "", "", "InitialCooldownDelta", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); + public static readonly GameAttributeF Knockback_Weight = new GameAttributeF(338, 0, -1, 0, 0, "", "", "Knockback_Weight", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeB UntargetableByPets = new GameAttributeB(339, 0, -1, 1, 1, "", "", "UntargetableByPets", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeI Damage_State_Current = new GameAttributeI(340, 0, -1, 0, 1, "", "", "Damage_State_Current", GameAttributeEncoding.IntMinMax, 31, 0, 15, 4); + public static readonly GameAttributeI Damage_State_Max = new GameAttributeI(341, 0, -1, 0, 1, "", "", "Damage_State_Max", GameAttributeEncoding.IntMinMax, 31, 0, 15, 4); + public static readonly GameAttributeB Is_Player_Decoy = new GameAttributeB(342, 0, -1, 1, 1, "", "", "Is_Player_Decoy", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeF Custom_Target_Weight = new GameAttributeF(343, 0, 3, 0, 0, "", "", "Custom_Target_Weight", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeI Gizmo_State = new GameAttributeI(344, -1, -1, 3, 1, "", "", "Gizmo_State", GameAttributeEncoding.IntMinMax, 4, -1, 30, 5); + public static readonly GameAttributeI Gizmo_Charges = new GameAttributeI(345, 0, -1, 1, 1, "", "", "Gizmo_Charges", GameAttributeEncoding.IntMinMax, 4, -1, 30, 5); + public static readonly GameAttributeB Chest_Open = new GameAttributeB(346, 0, 3, 0, 1, "", "", "Chest_Open", GameAttributeEncoding.IntMinMax, 4, 0, 1, 1); + public static readonly GameAttributeB Door_Locked = new GameAttributeB(347, 0, -1, 1, 1, "", "", "Door_Locked", GameAttributeEncoding.IntMinMax, 4, 0, 1, 1); + public static readonly GameAttributeI Door_Timer = new GameAttributeI(348, -1, -1, 3, 1, "", "", "Door_Timer", GameAttributeEncoding.Int, 4, 0, 0, 32); + public static readonly GameAttributeB Gizmo_Disabled_By_Script = new GameAttributeB(349, 0, -1, 1, 1, "", "", "Gizmo_Disabled_By_Script", GameAttributeEncoding.IntMinMax, 4, 0, 1, 1); + public static readonly GameAttributeI Gizmo_Operator_ACDID = new GameAttributeI(350, -1, -1, 3, 1, "", "", "Gizmo_Operator_ACDID", GameAttributeEncoding.Int, 4, 0, 0, 32); + public static readonly GameAttributeI Triggering_Count = new GameAttributeI(351, 0, -1, 0, 1, "", "", "Triggering_Count", GameAttributeEncoding.Int, 4, 0, 0, 32); + public static readonly GameAttributeF Gate_Position = new GameAttributeF(352, 0, -1, 0, 0, "", "", "Gate_Position", GameAttributeEncoding.Float16, 4, 0, 0, 16); + public static readonly GameAttributeF Gate_Velocity = new GameAttributeF(353, 0, -1, 0, 0, "", "", "Gate_Velocity", GameAttributeEncoding.Float16, 4, 0, 0, 16); + public static readonly GameAttributeB Gizmo_Has_Been_Operated = new GameAttributeB(354, 0, -1, 1, 1, "", "", "Gizmo_Has_Been_Operated", GameAttributeEncoding.IntMinMax, 4, 0, 1, 1); + public static readonly GameAttributeI Pet_Owner = new GameAttributeI(355, -1, -1, 3, 1, "", "", "Pet_Owner", GameAttributeEncoding.IntMinMax, 31, -1, 8, 4); + public static readonly GameAttributeI Pet_Creator = new GameAttributeI(356, -1, -1, 3, 1, "", "", "Pet_Creator", GameAttributeEncoding.IntMinMax, 31, -1, 8, 4); + public static readonly GameAttributeI Pet_Type = new GameAttributeI(357, -1, -1, 3, 1, "", "", "Pet_Type", GameAttributeEncoding.IntMinMax, 31, -1, 24, 5); + public static readonly GameAttributeB DropsNoLoot = new GameAttributeB(358, 0, -1, 1, 1, "", "", "DropsNoLoot", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB GrantsNoXP = new GameAttributeB(359, 0, -1, 1, 1, "", "", "GrantsNoXP", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeI Hireling_Class = new GameAttributeI(360, 0, -1, 1, 1, "", "", "Hireling_Class", GameAttributeEncoding.IntMinMax, 31, 0, 4, 3); + public static readonly GameAttributeI Summoned_By_SNO = new GameAttributeI(361, -1, -1, 3, 1, "", "", "Summoned_By_SNO", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeB Is_NPC = new GameAttributeB(362, 0, -1, 1, 1, "", "", "Is_NPC", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB NPC_Is_Operatable = new GameAttributeB(363, 0, -1, 1, 1, "", "", "NPC_Is_Operatable", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB NPC_Is_Escorting = new GameAttributeB(364, 0, -1, 1, 1, "", "", "NPC_Is_Escorting", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB NPC_Has_Interact_Options = new GameAttributeB(365, 0, 12, 1, 1, "", "", "NPC_Has_Interact_Options", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Conversation_Icon = new GameAttributeI(366, -1, 12, 3, 1, "", "", "Conversation_Icon", GameAttributeEncoding.IntMinMax, 31, -1, 6, 3); + public static readonly GameAttributeI Callout_Cooldown = new GameAttributeI(367, -1, 16, 1, 1, "", "", "Callout_Cooldown", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Banter_Cooldown = new GameAttributeI(368, -1, 16, 1, 1, "", "", "Banter_Cooldown", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Conversation_Heard_Count = new GameAttributeI(369, 0, 16, 1, 1, "", "", "Conversation_Heard_Count", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Last_Tick_Shop_Entered = new GameAttributeI(370, -1, -1, 3, 1, "", "", "Last_Tick_Shop_Entered", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeB Is_Helper = new GameAttributeB(371, 0, -1, 1, 1, "", "", "Is_Helper", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeF Axe = new GameAttributeF(372, 0, -1, 0, 0, "", "", "Axe", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Axe2H = new GameAttributeF(373, 0, -1, 0, 0, "", "", "Axe2H", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF ThrowingAxe = new GameAttributeF(374, 0, -1, 0, 0, "", "", "ThrowingAxe", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF AxeAny = new GameAttributeF(375, 0, -1, 0, 0, "Pin(Axe + Axe2H + ThrowingAxe, 0, 1)", "Pin(Axe + Axe2H + ThrowingAxe, 0, 1)", "AxeAny", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Bow = new GameAttributeF(376, 0, -1, 0, 0, "", "", "Bow", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Crossbow = new GameAttributeF(377, 0, -1, 0, 0, "", "", "Crossbow", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF BowAny = new GameAttributeF(378, 0, -1, 0, 0, "Pin(Bow + Crossbow, 0, 1)", "Pin(Bow + Crossbow, 0, 1)", "BowAny", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Club = new GameAttributeF(379, 0, -1, 0, 0, "", "", "Club", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Club2H = new GameAttributeF(380, 0, -1, 0, 0, "", "", "Club2H", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF ClubAny = new GameAttributeF(381, 0, -1, 0, 0, "Pin(Club + Club2H, 0, 1)", "Pin(Club + Club2H, 0, 1)", "ClubAny", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Dagger = new GameAttributeF(382, 0, -1, 0, 0, "", "", "Dagger", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Mace = new GameAttributeF(383, 0, -1, 0, 0, "", "", "Mace", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Mace2H = new GameAttributeF(384, 0, -1, 0, 0, "", "", "Mace2H", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF MaceAny = new GameAttributeF(385, 0, -1, 0, 0, "Pin(Mace + Mace2H, 0, 1)", "Pin(Mace + Mace2H, 0, 1)", "MaceAny", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Sword = new GameAttributeF(386, 0, -1, 0, 0, "", "", "Sword", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Sword2H = new GameAttributeF(387, 0, -1, 0, 0, "", "", "Sword2H", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF SwordAny = new GameAttributeF(388, 0, -1, 0, 0, "Pin(Sword + Sword2H, 0, 1)", "Pin(Sword + Sword2H, 0, 1)", "SwordAny", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Polearm = new GameAttributeF(389, 0, -1, 0, 0, "", "", "Polearm", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Spear = new GameAttributeF(390, 0, -1, 0, 0, "", "", "Spear", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Wand = new GameAttributeF(391, 0, -1, 0, 0, "", "", "Wand", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF ColdStaff = new GameAttributeF(392, 0, -1, 0, 0, "", "", "ColdStaff", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF FireStaff = new GameAttributeF(393, 0, -1, 0, 0, "", "", "FireStaff", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF LightningStaff = new GameAttributeF(394, 0, -1, 0, 0, "", "", "LightningStaff", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF PoisonStaff = new GameAttributeF(395, 0, -1, 0, 0, "", "", "PoisonStaff", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF StaffAny = new GameAttributeF(396, 0, -1, 0, 0, "Pin(ColdStaff + FireStaff + LightningStaff + PoisonStaff, 0, 1)", "Pin(ColdStaff + FireStaff + LightningStaff + PoisonStaff, 0, 1)", "StaffAny", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Weapon1H = new GameAttributeF(397, 0, -1, 0, 0, "Pin(Axe + Club + Dagger + Mace + Sword + Wand, 0, 1)", "Pin(Axe + Club + Dagger + Mace + Sword + Wand, 0, 1)", "Weapon1H", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Weapon2H = new GameAttributeF(398, 0, -1, 0, 0, "Pin(Axe2H + BowAny + Club2H + Mace2H + Sword2H + Polearm + Spear + StaffAny, 0, 1)", "Pin(Axe2H + BowAny + Club2H + Mace2H + Sword2H + Polearm + Spear + StaffAny, 0, 1)", "Weapon2H", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF WeaponMelee = new GameAttributeF(399, 0, -1, 0, 0, "Pin(Axe + Axe2H + ClubAny + Dagger + MaceAny + SwordAny + Polearm + Spear + Wand + StaffAny, 0, 1)", "Pin(Axe + Axe2H + ClubAny + Dagger + MaceAny + SwordAny + Polearm + Spear + Wand + StaffAny, 0, 1)", "WeaponMelee", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF WeaponRanged = new GameAttributeF(400, 0, -1, 0, 0, "Pin(ThrowingAxe + BowAny, 0, 1)", "Pin(ThrowingAxe + BowAny, 0, 1)", "WeaponRanged", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Quiver = new GameAttributeF(401, 0, -1, 0, 0, "", "", "Quiver", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeI Reincarnation_Buff = new GameAttributeI(402, -1, -1, 3, 1, "", "", "Reincarnation_Buff", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Dead_Body_AnimTag = new GameAttributeI(403, -1, -1, 3, 1, "", "", "Dead_Body_AnimTag", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Spawned_by_ACDID = new GameAttributeI(404, -1, -1, 3, 1, "", "", "Spawned_by_ACDID", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Summoned_By_ACDID = new GameAttributeI(405, -1, -1, 3, 1, "", "", "Summoned_By_ACDID", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Summoner_ID = new GameAttributeI(406, -1, -1, 3, 1, "", "", "Summoner_ID", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Banner_ACDID = new GameAttributeI(407, -1, -1, 3, 1, "", "", "Banner_ACDID", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeF Breakable_Shield_HP = new GameAttributeF(408, 0, -1, 0, 0, "", "", "Breakable_Shield_HP", GameAttributeEncoding.Float16Or32, 0, 0, 0, 0); + public static readonly GameAttributeI Current_WeaponClass = new GameAttributeI(409, -1, -1, 3, 1, "", "", "Current_WeaponClass", GameAttributeEncoding.IntMinMax, 31, -1, 19, 5); + public static readonly GameAttributeB Weapons_Sheathed = new GameAttributeB(410, 0, -1, 1, 1, "", "", "Weapons_Sheathed", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Held_In_OffHand = new GameAttributeB(411, 0, -1, 1, 1, "", "0", "Held_In_OffHand", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeF Attacks_Per_Second_Item_MainHand = new GameAttributeF(412, 0, -1, 0, 0, "(Held_In_OffHand ? 0 : Attacks_Per_Second_Item_Subtotal )", "", "Attacks_Per_Second_Item_MainHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Attacks_Per_Second_Item_OffHand = new GameAttributeF(413, 0, -1, 0, 0, "(Held_In_OffHand ? Attacks_Per_Second_Item_Subtotal : 0)", "", "Attacks_Per_Second_Item_OffHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Attacks_Per_Second_Item_Total_MainHand = new GameAttributeF(414, 0, -1, 0, 0, "Attacks_Per_Second_Item_MainHand + Attacks_Per_Second_Item_Bonus", "", "Attacks_Per_Second_Item_Total_MainHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Attacks_Per_Second_Item_Total_OffHand = new GameAttributeF(415, 0, -1, 0, 0, "Attacks_Per_Second_Item_OffHand + Attacks_Per_Second_Item_Bonus", "", "Attacks_Per_Second_Item_Total_OffHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Damage_Weapon_Min_Total_MainHand = new GameAttributeF(416, 0, 0, 0, 0, "(Held_In_OffHand#NONE ? 0 : Damage_Weapon_Min_Total )", "", "Damage_Weapon_Min_Total_MainHand", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_Weapon_Min_Total_OffHand = new GameAttributeF(417, 0, 0, 0, 0, "(Held_In_OffHand#NONE ? Damage_Weapon_Min_Total : 0)", "", "Damage_Weapon_Min_Total_OffHand", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_Weapon_Delta_Total_MainHand = new GameAttributeF(418, 0, 0, 0, 0, "(Held_In_OffHand#NONE ? 0 : Damage_Weapon_Delta_Total )", "", "Damage_Weapon_Delta_Total_MainHand", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_Weapon_Delta_Total_OffHand = new GameAttributeF(419, 0, 0, 0, 0, "(Held_In_OffHand#NONE ? Damage_Weapon_Delta_Total : 0)", "", "Damage_Weapon_Delta_Total_OffHand", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Attacks_Per_Second_Item_CurrentHand = new GameAttributeF(420, 0, -1, 0, 0, "", "(DualWield_Hand ? Attacks_Per_Second_Item_OffHand : Attacks_Per_Second_Item_MainHand)", "Attacks_Per_Second_Item_CurrentHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Damage_Weapon_Min_Total_CurrentHand = new GameAttributeF(421, 0, 0, 0, 0, "", "(DualWield_Hand#NONE ? Damage_Weapon_Min_Total_OffHand : Damage_Weapon_Min_Total_MainHand)", "Damage_Weapon_Min_Total_CurrentHand", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_Weapon_Delta_Total_CurrentHand = new GameAttributeF(422, 0, 0, 0, 0, "", "(DualWield_Hand#NONE ? Damage_Weapon_Delta_Total_OffHand : Damage_Weapon_Delta_Total_MainHand)", "Damage_Weapon_Delta_Total_CurrentHand", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeI Has_Special_Death_AnimTag = new GameAttributeI(423, -1, -1, 1, 1, "", "", "Has_Special_Death_AnimTag", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Death_Type_Override = new GameAttributeI(424, -1, -1, 3, 1, "", "", "Death_Type_Override", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeB In_Combat = new GameAttributeB(425, 0, -1, 1, 1, "", "", "In_Combat", GameAttributeEncoding.IntMinMax, 1, 0, 1, 1); + public static readonly GameAttributeB In_Conversation = new GameAttributeB(426, 0, -1, 3, 1, "", "", "In_Conversation", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Last_Tick_Potion_Used = new GameAttributeI(427, -1, -1, 3, 1, "", "", "Last_Tick_Potion_Used", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeF Potion_Dilution_Percent = new GameAttributeF(428, 0, -1, 0, 0, "", "", "Potion_Dilution_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeF Out_Of_Combat_Health_Regen_Percent = new GameAttributeF(429, 0, -1, 0, 0, "", "", "Out_Of_Combat_Health_Regen_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeF Out_Of_Combat_Mana_Regen_Percent = new GameAttributeF(430, 0, -1, 0, 0, "", "", "Out_Of_Combat_Mana_Regen_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeI Potion_Dilution_Duration = new GameAttributeI(431, -1, -1, 3, 1, "", "", "Potion_Dilution_Duration", GameAttributeEncoding.IntMinMax, 0, -1, 16777214, 24); + public static readonly GameAttributeF Potion_Dilution_Scalar = new GameAttributeF(432, 0, -1, 0, 0, "", "", "Potion_Dilution_Scalar", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeB Feared = new GameAttributeB(433, 0, -1, 1, 1, "", "", "Feared", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Fear_Immune = new GameAttributeB(434, 0, -1, 1, 1, "", "", "Fear_Immune", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeI Last_Damage_ACD = new GameAttributeI(435, -1, -1, 3, 1, "", "", "Last_Damage_ACD", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Attached_To_ACD = new GameAttributeI(436, -1, -1, 3, 1, "", "", "Attached_To_ACD", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Attachment_ACD = new GameAttributeI(437, -1, -1, 3, 1, "", "", "Attachment_ACD", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Normal_Attack_Replacement_Power_SNO = new GameAttributeI(438, -1, -1, 3, 1, "", "", "Normal_Attack_Replacement_Power_SNO", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeF Damage_Type_Override = new GameAttributeF(439, 0, 0, 0, 0, "", "", "Damage_Type_Override", GameAttributeEncoding.Float16Or32, 0, 0, 0, 0); + public static readonly GameAttributeF Minion_Count_Bonus_Percent = new GameAttributeF(440, 0, -1, 0, 0, "", "", "Minion_Count_Bonus_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeI Champion_Teleport_Next_Tick = new GameAttributeI(441, 0, -1, 0, 1, "", "", "Champion_Teleport_Next_Tick", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeF Champion_Teleport_Time_Min_In_Seconds = new GameAttributeF(442, 0, -1, 0, 0, "", "", "Champion_Teleport_Time_Min_In_Seconds", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeF Champion_Teleport_Time_Delta_In_Seconds = new GameAttributeF(443, 0, -1, 0, 0, "", "", "Champion_Teleport_Time_Delta_In_Seconds", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeI Champion_Clone_Next_Tick = new GameAttributeI(444, 0, -1, 0, 1, "", "", "Champion_Clone_Next_Tick", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeF Champion_Clone_Time_Min_In_Seconds = new GameAttributeF(445, 0, -1, 0, 0, "", "", "Champion_Clone_Time_Min_In_Seconds", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeF Champion_Clone_Time_Delta_In_Seconds = new GameAttributeF(446, 0, -1, 0, 0, "", "", "Champion_Clone_Time_Delta_In_Seconds", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeF Champion_Clone_Hitpoint_Bonus_Percent = new GameAttributeF(447, 0, -1, 0, 0, "", "", "Champion_Clone_Hitpoint_Bonus_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeF Champion_Clone_Damage_Bonus_Percent = new GameAttributeF(448, 0, -1, 0, 0, "", "", "Champion_Clone_Damage_Bonus_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeI Champion_Ghostly_Next_Tick = new GameAttributeI(449, 0, -1, 0, 1, "", "", "Champion_Ghostly_Next_Tick", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeF Champion_Ghostly_Inactive_Time_Min_In_Seconds = new GameAttributeF(450, 0, -1, 0, 0, "", "", "Champion_Ghostly_Inactive_Time_Min_In_Seconds", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeF Champion_Ghostly_Inactive_Time_Delta_In_Seconds = new GameAttributeF(451, 0, -1, 0, 0, "", "", "Champion_Ghostly_Inactive_Time_Delta_In_Seconds", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeF Champion_Ghostly_Active_Time_Min_In_Seconds = new GameAttributeF(452, 0, -1, 0, 0, "", "", "Champion_Ghostly_Active_Time_Min_In_Seconds", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeF Champion_Ghostly_Active_Time_Delta_In_Seconds = new GameAttributeF(453, 0, -1, 0, 0, "", "", "Champion_Ghostly_Active_Time_Delta_In_Seconds", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeF Champion_Ghostly_Saved_Dodge_Chance = new GameAttributeF(454, 0, -1, 0, 0, "", "", "Champion_Ghostly_Saved_Dodge_Chance", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeB Champion_Ghostly = new GameAttributeB(455, 0, -1, 1, 1, "", "", "Champion_Ghostly", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Base_Element = new GameAttributeI(456, -1, -1, 1, 1, "", "", "Base_Element", GameAttributeEncoding.IntMinMax, 0, -1, 7, 4); + public static readonly GameAttributeF Projectile_Amount_Bonus_Percent = new GameAttributeF(457, 0, -1, 0, 0, "", "", "Projectile_Amount_Bonus_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeF Projectile_Reflect_Chance = new GameAttributeF(458, 0, 0, 0, 0, "", "", "Projectile_Reflect_Chance", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeF Attack_Fear_Chance = new GameAttributeF(459, 0, -1, 0, 0, "", "", "Attack_Fear_Chance", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeF Attack_Fear_Time_Min = new GameAttributeF(460, 0, -1, 0, 0, "", "", "Attack_Fear_Time_Min", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeF Attack_Fear_Time_Delta = new GameAttributeF(461, 0, -1, 0, 0, "", "", "Attack_Fear_Time_Delta", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeB Buff_Visual_Effect = new GameAttributeB(462, 0, 9, 1, 1, "", "", "Buff_Visual_Effect", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Buff_Icon_Start_Tick0 = new GameAttributeI(463, 0, 4, 1, 1, "", "", "Buff_Icon_Start_Tick0", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Buff_Icon_Start_Tick1 = new GameAttributeI(464, 0, 4, 1, 1, "", "", "Buff_Icon_Start_Tick1", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Buff_Icon_Start_Tick2 = new GameAttributeI(465, 0, 4, 1, 1, "", "", "Buff_Icon_Start_Tick2", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Buff_Icon_Start_Tick3 = new GameAttributeI(466, 0, 4, 1, 1, "", "", "Buff_Icon_Start_Tick3", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Buff_Icon_Start_Tick4 = new GameAttributeI(467, 0, 4, 1, 1, "", "", "Buff_Icon_Start_Tick4", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Buff_Icon_Start_Tick5 = new GameAttributeI(468, 0, 4, 1, 1, "", "", "Buff_Icon_Start_Tick5", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Buff_Icon_Start_Tick6 = new GameAttributeI(469, 0, 4, 1, 1, "", "", "Buff_Icon_Start_Tick6", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Buff_Icon_Start_Tick7 = new GameAttributeI(470, 0, 4, 1, 1, "", "", "Buff_Icon_Start_Tick7", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Buff_Icon_End_Tick0 = new GameAttributeI(471, 0, 4, 1, 1, "", "", "Buff_Icon_End_Tick0", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Buff_Icon_End_Tick1 = new GameAttributeI(472, 0, 4, 1, 1, "", "", "Buff_Icon_End_Tick1", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Buff_Icon_End_Tick2 = new GameAttributeI(473, 0, 4, 1, 1, "", "", "Buff_Icon_End_Tick2", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Buff_Icon_End_Tick3 = new GameAttributeI(474, 0, 4, 1, 1, "", "", "Buff_Icon_End_Tick3", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Buff_Icon_End_Tick4 = new GameAttributeI(475, 0, 4, 1, 1, "", "", "Buff_Icon_End_Tick4", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Buff_Icon_End_Tick5 = new GameAttributeI(476, 0, 4, 1, 1, "", "", "Buff_Icon_End_Tick5", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Buff_Icon_End_Tick6 = new GameAttributeI(477, 0, 4, 1, 1, "", "", "Buff_Icon_End_Tick6", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Buff_Icon_End_Tick7 = new GameAttributeI(478, 0, 4, 1, 1, "", "", "Buff_Icon_End_Tick7", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeB Could_Have_Ragdolled = new GameAttributeB(479, 0, -1, 1, 1, "", "", "Could_Have_Ragdolled", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Ambient_Damage_Effect_Last_Time = new GameAttributeI(480, 0, -1, 1, 1, "", "", "Ambient_Damage_Effect_Last_Time", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeF Scale_Bonus = new GameAttributeF(481, 0, -1, 0, 0, "", "", "Scale_Bonus", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeB Deleted_On_Server = new GameAttributeB(482, 0, -1, 1, 1, "", "", "Deleted_On_Server", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Scripted_Fade_Time = new GameAttributeI(483, 0, -1, 1, 1, "", "", "Scripted_Fade_Time", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeB Does_No_Damage = new GameAttributeB(484, 0, -1, 1, 1, "", "", "Does_No_Damage", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Does_Fake_Damage = new GameAttributeB(485, 0, -1, 1, 1, "", "", "Does_Fake_Damage", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeF SlowTime_Debuff = new GameAttributeF(486, 0, -1, 0, 0, "", "", "SlowTime_Debuff", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeB Blocks_Projectiles = new GameAttributeB(487, 0, -1, 1, 1, "", "", "Blocks_Projectiles", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Frozen = new GameAttributeB(488, 0, -1, 1, 1, "", "", "Frozen", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeF Freeze_Damage_Percent_Bonus = new GameAttributeF(489, 0, -1, 0, 0, "", "", "Freeze_Damage_Percent_Bonus", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeB Buff_Active = new GameAttributeB(490, 0, 4, 1, 1, "", "", "Buff_Active", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeF DualWield_BothAttack_Chance = new GameAttributeF(491, 0, -1, 0, 0, "", "", "DualWield_BothAttack_Chance", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeI Summon_Expiration_Tick = new GameAttributeI(492, 0, -1, 0, 1, "", "", "Summon_Expiration_Tick", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Summon_Count = new GameAttributeI(493, 0, -1, 0, 1, "", "", "Summon_Count", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeB Uninterruptible = new GameAttributeB(494, 0, -1, 1, 1, "", "", "Uninterruptible", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Queue_Death = new GameAttributeB(495, 0, -1, 1, 1, "", "", "Queue Death", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB CantStartDisplayedPowers = new GameAttributeB(496, 0, -1, 1, 1, "", "", "CantStartDisplayedPowers", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Wizard_Slowtime_Proxy_ACD = new GameAttributeI(497, -1, -1, 3, 1, "", "", "Wizard_Slowtime_Proxy_ACD", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeF DPS = new GameAttributeF(498, 0, -1, 1, 0, "", "", "DPS", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); + public static readonly GameAttributeI Resurrection_Power = new GameAttributeI(499, -1, -1, 3, 1, "", "", "Resurrection_Power", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeF Freeze_Damage = new GameAttributeF(500, 0, -1, 1, 0, "", "", "Freeze_Damage", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); + public static readonly GameAttributeF Freeze_Capacity = new GameAttributeF(501, 0, -1, 0, 0, "", "", "Freeze_Capacity", GameAttributeEncoding.Float16Or32, 0, 0, 0, 0); + public static readonly GameAttributeF Thaw_Rate = new GameAttributeF(502, 0, -1, 0, 0, "", "", "Thaw_Rate", GameAttributeEncoding.Float16Or32, 0, 0, 0, 0); + public static readonly GameAttributeF Chilled_Dur_Bonus_Percent = new GameAttributeF(503, 0, -1, 0, 0, "", "", "Chilled_Dur_Bonus_Percent", GameAttributeEncoding.Float16Or32, 0, 0, 0, 0); + public static readonly GameAttributeF DOT_DPS = new GameAttributeF(504, 0, -1, 0, 0, "", "", "DOT_DPS", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); + public static readonly GameAttributeF DamageCap_Percent = new GameAttributeF(505, 0, -1, 1, 0, "", "", "DamageCap_Percent", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeI Item_Time_Sold = new GameAttributeI(506, 0, -1, 1, 1, "", "", "Item_Time_Sold", GameAttributeEncoding.Int, 8, 0, 0, 32); + public static readonly GameAttributeI Forced_Hireling_Power = new GameAttributeI(507, -1, -1, 3, 1, "", "", "Forced_Hireling_Power", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeB IsRooted = new GameAttributeB(508, 0, -1, 1, 1, "", "", "IsRooted", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI RootTargetACD = new GameAttributeI(509, -1, -1, 3, 1, "", "", "RootTargetACD", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeF RootAutoDecayPerSecond = new GameAttributeF(510, 0, -1, 1, 0, "", "", "RootAutoDecayPerSecond", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeF RootUnitValue = new GameAttributeF(511, 0, -1, 1, 0, "", "", "RootUnitValue", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeI RootTotalTicks = new GameAttributeI(512, 0, -1, 1, 1, "", "", "RootTotalTicks", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeB Hide_Affixes = new GameAttributeB(513, 0, -1, 1, 1, "", "", "Hide_Affixes", GameAttributeEncoding.IntMinMax, 8, 0, 1, 1); + public static readonly GameAttributeI Rune_A = new GameAttributeI(514, 0, 11, 0, 1, "", "", "Rune_A", GameAttributeEncoding.IntMinMax, 31, 0, 255, 8); + public static readonly GameAttributeI Rune_B = new GameAttributeI(515, 0, 11, 0, 1, "", "", "Rune_B", GameAttributeEncoding.IntMinMax, 31, 0, 255, 8); + public static readonly GameAttributeI Rune_C = new GameAttributeI(516, 0, 11, 0, 1, "", "", "Rune_C", GameAttributeEncoding.IntMinMax, 31, 0, 255, 8); + public static readonly GameAttributeI Rune_D = new GameAttributeI(517, 0, 11, 0, 1, "", "", "Rune_D", GameAttributeEncoding.IntMinMax, 31, 0, 255, 8); + public static readonly GameAttributeI Rune_E = new GameAttributeI(518, 0, 11, 0, 1, "", "", "Rune_E", GameAttributeEncoding.IntMinMax, 31, 0, 255, 8); + public static readonly GameAttributeF Resistance_Stun = new GameAttributeF(519, 0, -1, 0, 0, "", "", "Resistance_Stun", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Resistance_Stun_Total = new GameAttributeF(520, 0, -1, 0, 0, "", "Resistance_Stun + Resistance_StunRootFreeze", "Resistance_Stun_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Resistance_Root = new GameAttributeF(521, 0, -1, 0, 0, "", "", "Resistance_Root", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Resistance_Root_Total = new GameAttributeF(522, 0, -1, 0, 0, "", "Resistance_Root + Resistance_StunRootFreeze", "Resistance_Root_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Resistance_Freeze = new GameAttributeF(523, 0, -1, 0, 0, "", "", "Resistance_Freeze", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Resistance_Freeze_Total = new GameAttributeF(524, 0, -1, 0, 0, "", "Resistance_Freeze + Resistance_StunRootFreeze", "Resistance_Freeze_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Resistance_StunRootFreeze = new GameAttributeF(525, 0, -1, 0, 0, "", "", "Resistance_StunRootFreeze", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF CrowdControl_Reduction = new GameAttributeF(526, 0, -1, 7, 0, "", "", "CrowdControl_Reduction", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeB Displays_Team_Effect = new GameAttributeB(527, 0, -1, 1, 1, "", "", "Displays_Team_Effect", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Cannot_Be_Added_To_AI_Target_List = new GameAttributeB(528, 0, -1, 1, 1, "", "", "Cannot_Be_Added_To_AI_Target_List", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeI SkillKit = new GameAttributeI(529, -1, -1, 3, 1, "", "", "SkillKit", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeB Immune_To_Charm = new GameAttributeB(530, 0, -1, 1, 1, "", "", "Immune_To_Charm", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Immune_To_Blind = new GameAttributeB(531, 0, -1, 1, 1, "", "", "Immune_To_Blind", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Damage_Shield = new GameAttributeB(532, 0, -1, 1, 1, "", "", "Damage_Shield", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Silenced = new GameAttributeB(533, 0, -1, 1, 1, "", "", "Silenced", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Diseased = new GameAttributeB(534, 0, -1, 1, 1, "", "", "Diseased", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Guard_Object_ACDID = new GameAttributeI(535, -1, -1, 3, 1, "", "", "Guard_Object_ACDID", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Follow_Target_ACDID = new GameAttributeI(536, -1, -1, 3, 1, "", "", "Follow_Target_ACDID", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Follow_Target_Type = new GameAttributeI(537, 0, -1, 3, 1, "", "", "Follow_Target_Type", GameAttributeEncoding.IntMinMax, 0, 0, 2, 2); + public static readonly GameAttributeI Forced_Enemy_ACDID = new GameAttributeI(538, -1, -1, 1, 1, "", "", "Forced_Enemy_ACDID", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI NPC_Talk_Target_ANN = new GameAttributeI(539, -1, -1, 3, 1, "", "", "NPC_Talk_Target_ANN", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI NPC_Conv_Target_ANN = new GameAttributeI(540, -1, -1, 3, 1, "", "", "NPC_Conv_Target_ANN", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Script_Target_ACDID = new GameAttributeI(541, -1, 3, 3, 1, "", "", "Script_Target_ACDID", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Look_Target_Server_ANN = new GameAttributeI(542, -1, -1, 1, 1, "", "", "Look_Target_Server_ANN", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeF Look_Target_Broadcast_Intensity = new GameAttributeF(543, 0, -1, 0, 0, "", "", "Look_Target_Broadcast_Intensity", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeF Look_Target_Broadcast_Radius = new GameAttributeF(544, 0, -1, 0, 0, "", "", "Look_Target_Broadcast_Radius", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeB Stealthed = new GameAttributeB(545, 0, -1, 1, 1, "", "", "Stealthed", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI GemQuality = new GameAttributeI(546, 0, -1, 4, 1, "", "", "GemQuality", GameAttributeEncoding.IntMinMax, 8, 0, 14, 4); + public static readonly GameAttributeI ItemBuffIcon = new GameAttributeI(547, 0, 4, 1, 1, "", "0", "ItemBuffIcon", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeF ScrollDuration = new GameAttributeF(548, 0, -1, 1, 0, "", "0", "ScrollDuration", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeI Gizmo_Actor_SNO_To_Spawn = new GameAttributeI(549, -1, -1, 3, 1, "", "", "Gizmo_Actor_SNO_To_Spawn", GameAttributeEncoding.Int, 4, 0, 0, 32); + public static readonly GameAttributeF Gizmo_Actor_To_Spawn_Scale = new GameAttributeF(550, 0, -1, 1, 0, "", "", "Gizmo_Actor_To_Spawn_Scale", GameAttributeEncoding.Float16, 4, 0, 0, 16); + public static readonly GameAttributeI Death_Replacement_Power_SNO = new GameAttributeI(551, -1, -1, 3, 1, "", "", "Death_Replacement_Power_SNO", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeB Attachment_Handled_By_Client = new GameAttributeB(552, 0, -1, 1, 1, "", "", "Attachment_Handled_By_Client", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB AI_In_Special_State = new GameAttributeB(553, 0, -1, 1, 1, "", "", "AI_In_Special_State", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB AI_Used_Scripted_Spawn_Anim = new GameAttributeB(554, 0, -1, 1, 1, "", "", "AI_Used_Scripted_Spawn_Anim", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB AI_Spawned_By_Inactive_Marker = new GameAttributeB(555, 0, -1, 1, 1, "", "", "AI_Spawned_By_Inactive_Marker", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeI Headstone_Player_ANN = new GameAttributeI(556, -1, -1, 3, 1, "", "", "Headstone_Player_ANN", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeF Resource_Cost_Reduction_Percent = new GameAttributeF(557, 0, 10, 0, 0, "", "", "Resource_Cost_Reduction_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Resistance_Penetration = new GameAttributeF(558, 0, 0, 0, 0, "", "", "Resistance_Penetration", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeF Resistance_Penetration_Total = new GameAttributeF(559, 0, 0, 0, 0, "", "(Resistance_Penetration + Resistance_Penetration_All#NONE) * (Resistance_Penetration_Percent_All#NONE + 1)", "Resistance_Penetration_Total", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeF Resistance_Penetration_All = new GameAttributeF(560, 0, -1, 0, 0, "", "", "Resistance_Penetration_All", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeF Resistance_Penetration_Percent_All = new GameAttributeF(561, 0, -1, 0, 0, "", "", "Resistance_Penetration_Percent_All", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeI Fury_Effect_Level = new GameAttributeI(562, 0, -1, 0, 1, "", "", "Fury_Effect_Level", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeF Health_Potion_Bonus_Heal_Percent = new GameAttributeF(563, 0, -1, 0, 0, "", "", "Health_Potion_Bonus_Heal_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeI Free_Cast = new GameAttributeI(564, 0, 4, 1, 1, "", "", "Free_Cast", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeB Free_Cast_All = new GameAttributeB(565, 0, -1, 1, 1, "", "", "Free_Cast_All", GameAttributeEncoding.IntMinMax, 9, 0, 1, 1); + public static readonly GameAttributeF Movement_Scalar_Reduction_Percent = new GameAttributeF(566, 0, -1, 1, 0, "", "", "Movement_Scalar_Reduction_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Movement_Scalar_Reduction_Resistance = new GameAttributeF(567, 0, -1, 0, 0, "", "", "Movement_Scalar_Reduction_Resistance", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Damage_Absorb_Percent_All = new GameAttributeF(568, 0, -1, 0, 0, "", "", "Damage_Absorb_Percent_All", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeI World_Seed = new GameAttributeI(569, 0, -1, 0, 1, "", "", "World_Seed", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeI Kill_Count_Record = new GameAttributeI(570, 0, -1, 1, 1, "", "", "Kill_Count_Record", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); + public static readonly GameAttributeI Object_Destruction_Record = new GameAttributeI(571, 0, -1, 1, 1, "", "", "Object_Destruction_Record", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); + public static readonly GameAttributeI Single_Attack_Record = new GameAttributeI(572, 0, -1, 1, 1, "", "", "Single_Attack_Record", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); + public static readonly GameAttributeI Environment_Attack_Record = new GameAttributeI(573, 0, -1, 1, 1, "", "", "Environment_Attack_Record", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); + public static readonly GameAttributeB Root_Immune = new GameAttributeB(574, 0, -1, 1, 1, "", "", "Root_Immune", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeF Monster_Play_Get_Hit_Bonus = new GameAttributeF(575, 0, -1, 0, 0, "", "", "Monster_Play_Get_Hit_Bonus", GameAttributeEncoding.Float16Or32, 0, 0, 0, 0); + public static readonly GameAttributeI Stored_Contact_Frame = new GameAttributeI(576, 0, -1, 1, 1, "", "", "Stored_Contact_Frame", GameAttributeEncoding.IntMinMax, 0, 0, 4, 3); + public static readonly GameAttributeI Buff_Icon_Count0 = new GameAttributeI(577, 0, 4, 0, 1, "", "", "Buff_Icon_Count0", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); + public static readonly GameAttributeI Buff_Icon_Count1 = new GameAttributeI(578, 0, 4, 0, 1, "", "", "Buff_Icon_Count1", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); + public static readonly GameAttributeI Buff_Icon_Count2 = new GameAttributeI(579, 0, 4, 0, 1, "", "", "Buff_Icon_Count2", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); + public static readonly GameAttributeI Buff_Icon_Count3 = new GameAttributeI(580, 0, 4, 0, 1, "", "", "Buff_Icon_Count3", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); + public static readonly GameAttributeI Buff_Icon_Count4 = new GameAttributeI(581, 0, 4, 0, 1, "", "", "Buff_Icon_Count4", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); + public static readonly GameAttributeI Buff_Icon_Count5 = new GameAttributeI(582, 0, 4, 0, 1, "", "", "Buff_Icon_Count5", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); + public static readonly GameAttributeI Buff_Icon_Count6 = new GameAttributeI(583, 0, 4, 0, 1, "", "", "Buff_Icon_Count6", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); + public static readonly GameAttributeI Buff_Icon_Count7 = new GameAttributeI(584, 0, 4, 0, 1, "", "", "Buff_Icon_Count7", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); + public static readonly GameAttributeB Observer = new GameAttributeB(585, 0, -1, 1, 1, "", "", "Observer", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Resurrect_As_Observer = new GameAttributeB(586, 0, -1, 1, 1, "", "", "Resurrect_As_Observer", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeI Combo_Level = new GameAttributeI(587, 0, -1, 1, 1, "", "", "Combo_Level", GameAttributeEncoding.IntMinMax, 0, 0, 3, 2); + public static readonly GameAttributeI Combo_Time_Last_Move = new GameAttributeI(588, 0, -1, 1, 1, "", "", "Combo_Time_Last_Move", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeB Burrowed = new GameAttributeB(589, 0, -1, 1, 1, "", "", "Burrowed", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Death_Replacement_Effect_Group_SNO = new GameAttributeI(590, -1, -1, 3, 1, "", "", "Death_Replacement_Effect_Group_SNO", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Checkpoint_Resurrection_Allowed_Game_Time = new GameAttributeI(591, 0, -1, 0, 1, "", "", "Checkpoint_Resurrection_Allowed_Game_Time", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Checkpoint_Resurrection_Forced_Game_Time = new GameAttributeI(592, 0, -1, 0, 1, "", "", "Checkpoint_Resurrection_Forced_Game_Time", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Controlling_TimedEvent_SNO = new GameAttributeI(593, -1, -1, 3, 1, "", "", "Controlling_TimedEvent_SNO", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeF Casting_Speed_Percent = new GameAttributeF(594, 0, -1, 0, 0, "", "", "Casting_Speed_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeB Using_Bossbar = new GameAttributeB(595, 0, -1, 1, 1, "", "", "Using_Bossbar", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_0_Visual_Effect = new GameAttributeB(596, 0, 4, 1, 1, "", "", "Power_Buff_0_Visual_Effect", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_1_Visual_Effect = new GameAttributeB(597, 0, 4, 1, 1, "", "", "Power_Buff_1_Visual_Effect", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_2_Visual_Effect = new GameAttributeB(598, 0, 4, 1, 1, "", "", "Power_Buff_2_Visual_Effect", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_3_Visual_Effect = new GameAttributeB(599, 0, 4, 1, 1, "", "", "Power_Buff_3_Visual_Effect", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_4_Visual_Effect = new GameAttributeB(600, 0, 4, 1, 1, "", "", "Power_Buff_4_Visual_Effect", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_5_Visual_Effect = new GameAttributeB(601, 0, 4, 1, 1, "", "", "Power_Buff_5_Visual_Effect", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_6_Visual_Effect = new GameAttributeB(602, 0, 4, 1, 1, "", "", "Power_Buff_6_Visual_Effect", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_7_Visual_Effect = new GameAttributeB(603, 0, 4, 1, 1, "", "", "Power_Buff_7_Visual_Effect", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Store_SNO = new GameAttributeI(604, 0, 0, 3, 1, "", "", "Store SNO", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeB Busy = new GameAttributeB(605, 0, -1, 1, 1, "", "", "Busy", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Afk = new GameAttributeB(606, 0, -1, 1, 1, "", "", "Afk", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Last_Action_Timestamp = new GameAttributeI(607, 0, -1, 1, 1, "", "", "Last Action Timestamp", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Portal_Next_Time = new GameAttributeI(608, 0, -1, 1, 1, "", "", "Portal Next Time", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeF Repair_Discount_Percent = new GameAttributeF(609, 0, -1, 0, 0, "", "", "Repair_Discount_Percent", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeB Resource_Degeneration_Prevented = new GameAttributeB(610, 0, -1, 1, 1, "", "", "Resource_Degeneration_Prevented", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Operatable = new GameAttributeB(611, 0, -1, 4, 1, "", "", "Operatable", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Look_Override = new GameAttributeI(612, 0, -1, 0, 1, "", "", "Look_Override", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Spawner_Concurrent_Count_ID = new GameAttributeI(613, -1, -1, 3, 1, "", "", "Spawner_Concurrent_Count_ID", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeB Disabled = new GameAttributeB(614, 0, -1, 1, 1, "", "", "Disabled", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Skill_Override = new GameAttributeI(615, -1, 3, 1, 1, "", "", "Skill_Override", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeB Skill_Override_Active = new GameAttributeB(616, 0, -1, 1, 1, "", "", "Skill_Override_Active", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Skill_Override_Ended = new GameAttributeB(617, 0, 4, 1, 1, "", "", "Skill_Override_Ended", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Skill_Override_Ended_Active = new GameAttributeB(618, 0, -1, 1, 1, "", "", "Skill_Override_Ended_Active", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Is_Power_Proxy = new GameAttributeB(619, 0, -1, 1, 1, "", "", "Is_Power_Proxy", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Force_No_Death_Animation = new GameAttributeB(620, 0, -1, 1, 1, "", "", "Force_No_Death_Animation", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeI Player_WeaponClass_Anim_Override = new GameAttributeI(621, -1, -1, 1, 1, "", "", "Player_WeaponClass_Anim_Override", GameAttributeEncoding.IntMinMax, 31, -1, 19, 5); + public static readonly GameAttributeB Operatable_Story_Gizmo = new GameAttributeB(622, 0, -1, 1, 1, "", "", "Operatable_Story_Gizmo", GameAttributeEncoding.IntMinMax, 4, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_0_Visual_Effect_None = new GameAttributeB(623, 0, 4, 1, 1, "", "", "Power_Buff_0_Visual_Effect_None", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_0_Visual_Effect_A = new GameAttributeB(624, 0, 4, 1, 1, "", "", "Power_Buff_0_Visual_Effect_A", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_0_Visual_Effect_B = new GameAttributeB(625, 0, 4, 1, 1, "", "", "Power_Buff_0_Visual_Effect_B", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_0_Visual_Effect_C = new GameAttributeB(626, 0, 4, 1, 1, "", "", "Power_Buff_0_Visual_Effect_C", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_0_Visual_Effect_D = new GameAttributeB(627, 0, 4, 1, 1, "", "", "Power_Buff_0_Visual_Effect_D", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_0_Visual_Effect_E = new GameAttributeB(628, 0, 4, 1, 1, "", "", "Power_Buff_0_Visual_Effect_E", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_1_Visual_Effect_None = new GameAttributeB(629, 0, 4, 1, 1, "", "", "Power_Buff_1_Visual_Effect_None", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_1_Visual_Effect_A = new GameAttributeB(630, 0, 4, 1, 1, "", "", "Power_Buff_1_Visual_Effect_A", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_1_Visual_Effect_B = new GameAttributeB(631, 0, 4, 1, 1, "", "", "Power_Buff_1_Visual_Effect_B", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_1_Visual_Effect_C = new GameAttributeB(632, 0, 4, 1, 1, "", "", "Power_Buff_1_Visual_Effect_C", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_1_Visual_Effect_D = new GameAttributeB(633, 0, 4, 1, 1, "", "", "Power_Buff_1_Visual_Effect_D", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_1_Visual_Effect_E = new GameAttributeB(634, 0, 4, 1, 1, "", "", "Power_Buff_1_Visual_Effect_E", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_2_Visual_Effect_None = new GameAttributeB(635, 0, 4, 1, 1, "", "", "Power_Buff_2_Visual_Effect_None", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_2_Visual_Effect_A = new GameAttributeB(636, 0, 4, 1, 1, "", "", "Power_Buff_2_Visual_Effect_A", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_2_Visual_Effect_B = new GameAttributeB(637, 0, 4, 1, 1, "", "", "Power_Buff_2_Visual_Effect_B", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_2_Visual_Effect_C = new GameAttributeB(638, 0, 4, 1, 1, "", "", "Power_Buff_2_Visual_Effect_C", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_2_Visual_Effect_D = new GameAttributeB(639, 0, 4, 1, 1, "", "", "Power_Buff_2_Visual_Effect_D", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_2_Visual_Effect_E = new GameAttributeB(640, 0, 4, 1, 1, "", "", "Power_Buff_2_Visual_Effect_E", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_3_Visual_Effect_None = new GameAttributeB(641, 0, 4, 1, 1, "", "", "Power_Buff_3_Visual_Effect_None", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_3_Visual_Effect_A = new GameAttributeB(642, 0, 4, 1, 1, "", "", "Power_Buff_3_Visual_Effect_A", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_3_Visual_Effect_B = new GameAttributeB(643, 0, 4, 1, 1, "", "", "Power_Buff_3_Visual_Effect_B", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_3_Visual_Effect_C = new GameAttributeB(644, 0, 4, 1, 1, "", "", "Power_Buff_3_Visual_Effect_C", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_3_Visual_Effect_D = new GameAttributeB(645, 0, 4, 1, 1, "", "", "Power_Buff_3_Visual_Effect_D", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_3_Visual_Effect_E = new GameAttributeB(646, 0, 4, 1, 1, "", "", "Power_Buff_3_Visual_Effect_E", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_4_Visual_Effect_None = new GameAttributeB(647, 0, 4, 1, 1, "", "", "Power_Buff_4_Visual_Effect_None", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_4_Visual_Effect_A = new GameAttributeB(648, 0, 4, 1, 1, "", "", "Power_Buff_4_Visual_Effect_A", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_4_Visual_Effect_B = new GameAttributeB(649, 0, 4, 1, 1, "", "", "Power_Buff_4_Visual_Effect_B", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_4_Visual_Effect_C = new GameAttributeB(650, 0, 4, 1, 1, "", "", "Power_Buff_4_Visual_Effect_C", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_4_Visual_Effect_D = new GameAttributeB(651, 0, 4, 1, 1, "", "", "Power_Buff_4_Visual_Effect_D", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_4_Visual_Effect_E = new GameAttributeB(652, 0, 4, 1, 1, "", "", "Power_Buff_4_Visual_Effect_E", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_5_Visual_Effect_None = new GameAttributeB(653, 0, 4, 1, 1, "", "", "Power_Buff_5_Visual_Effect_None", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_5_Visual_Effect_A = new GameAttributeB(654, 0, 4, 1, 1, "", "", "Power_Buff_5_Visual_Effect_A", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_5_Visual_Effect_B = new GameAttributeB(655, 0, 4, 1, 1, "", "", "Power_Buff_5_Visual_Effect_B", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_5_Visual_Effect_C = new GameAttributeB(656, 0, 4, 1, 1, "", "", "Power_Buff_5_Visual_Effect_C", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_5_Visual_Effect_D = new GameAttributeB(657, 0, 4, 1, 1, "", "", "Power_Buff_5_Visual_Effect_D", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_5_Visual_Effect_E = new GameAttributeB(658, 0, 4, 1, 1, "", "", "Power_Buff_5_Visual_Effect_E", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_6_Visual_Effect_None = new GameAttributeB(659, 0, 4, 1, 1, "", "", "Power_Buff_6_Visual_Effect_None", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_6_Visual_Effect_A = new GameAttributeB(660, 0, 4, 1, 1, "", "", "Power_Buff_6_Visual_Effect_A", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_6_Visual_Effect_B = new GameAttributeB(661, 0, 4, 1, 1, "", "", "Power_Buff_6_Visual_Effect_B", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_6_Visual_Effect_C = new GameAttributeB(662, 0, 4, 1, 1, "", "", "Power_Buff_6_Visual_Effect_C", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_6_Visual_Effect_D = new GameAttributeB(663, 0, 4, 1, 1, "", "", "Power_Buff_6_Visual_Effect_D", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_6_Visual_Effect_E = new GameAttributeB(664, 0, 4, 1, 1, "", "", "Power_Buff_6_Visual_Effect_E", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_7_Visual_Effect_None = new GameAttributeB(665, 0, 4, 1, 1, "", "", "Power_Buff_7_Visual_Effect_None", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_7_Visual_Effect_A = new GameAttributeB(666, 0, 4, 1, 1, "", "", "Power_Buff_7_Visual_Effect_A", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_7_Visual_Effect_B = new GameAttributeB(667, 0, 4, 1, 1, "", "", "Power_Buff_7_Visual_Effect_B", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_7_Visual_Effect_C = new GameAttributeB(668, 0, 4, 1, 1, "", "", "Power_Buff_7_Visual_Effect_C", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_7_Visual_Effect_D = new GameAttributeB(669, 0, 4, 1, 1, "", "", "Power_Buff_7_Visual_Effect_D", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_7_Visual_Effect_E = new GameAttributeB(670, 0, 4, 1, 1, "", "", "Power_Buff_7_Visual_Effect_E", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Walk_Passability_Power_SNO = new GameAttributeI(671, -1, -1, 1, 1, "", "", "Walk_Passability_Power_SNO", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Passability_Power_SNO = new GameAttributeI(672, -1, -1, 1, 1, "", "", "Passability_Power_SNO", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Flippy_ID = new GameAttributeI(673, -1, -1, 3, 1, "", "", "Flippy_ID", GameAttributeEncoding.Int, 8, 0, 0, 32); + public static readonly GameAttributeI Summoning_Machine_Num_Casters = new GameAttributeI(674, 0, -1, 0, 1, "", "", "Summoning_Machine_Num_Casters", GameAttributeEncoding.IntMinMax, 0, 0, 255, 8); + public static readonly GameAttributeI Summoning_Machine_Spawn_Count = new GameAttributeI(675, 0, 15, 0, 1, "", "", "Summoning_Machine_Spawn_Count", GameAttributeEncoding.IntMinMax, 0, 0, 4095, 12); + public static readonly GameAttributeI Summoning_Machine_Next_Spawn_Ticks = new GameAttributeI(676, 0, -1, 0, 1, "", "", "Summoning_Machine_Next_Spawn_Ticks", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Summoning_Machine_Spawn_Team = new GameAttributeI(677, -1, -1, 1, 1, "", "", "Summoning_Machine_Spawn_Team", GameAttributeEncoding.IntMinMax, 0, -1, 23, 5); + public static readonly GameAttributeF Screen_Attack_Radius_Constant = new GameAttributeF(678, 1114636288, -1, 3, 0, "", "", "Screen_Attack_Radius_Constant", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeF Damage_Done_Reduction_Percent = new GameAttributeF(679, 0, -1, 1, 0, "", "", "Damage_Done_Reduction_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeI Set_Item_Count = new GameAttributeI(680, 0, 17, 0, 1, "", "", "Set_Item_Count", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeF Spawner_Countdown_Percent = new GameAttributeF(681, 0, -1, 1, 0, "", "", "Spawner_Countdown_Percent", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeB Attack_Slow = new GameAttributeB(682, 0, -1, 1, 1, "", "", "Attack_Slow", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Power_Disabled = new GameAttributeB(683, 0, 4, 1, 1, "", "", "Power_Disabled", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Weapon_Effect_Override = new GameAttributeI(684, 0, -1, 1, 1, "", "", "Weapon_Effect_Override", GameAttributeEncoding.IntMinMax, 31, 0, 14, 4); + public static readonly GameAttributeF Debuff_Duration_Reduction_Percent = new GameAttributeF(685, 0, -1, 0, 0, "", "", "Debuff_Duration_Reduction_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeB Uses_PvP_Power_Tags = new GameAttributeB(686, 0, -1, 1, 1, "", "", "Uses_PvP_Power_Tags", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Trait = new GameAttributeI(687, 0, 4, 1, 1, "", "", "Trait", GameAttributeEncoding.IntMinMax, 31, -1, 30, 5); + public static readonly GameAttributeI Last_ACD_Attacked_By = new GameAttributeI(688, -1, -1, 3, 1, "", "", "Last_ACD_Attacked_By", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeF Gold_PickUp_Radius = new GameAttributeF(689, 0, -1, 0, 0, "", "", "Gold_PickUp_Radius", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeI Client_Only_Effect = new GameAttributeI(690, 0, 12, 1, 1, "", "", "Client Only Effect", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeB Has_Doppelganger_Cloned = new GameAttributeB(691, 0, -1, 1, 1, "", "", "Has_Doppelganger_Cloned", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeF Resource_Gain_Bonus_Percent = new GameAttributeF(692, 0, 10, 0, 0, "", "", "Resource_Gain_Bonus_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeI Looping_Animation_Start_Time = new GameAttributeI(693, 0, -1, 1, 1, "", "", "Looping_Animation_Start_Time", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Looping_Animation_End_Time = new GameAttributeI(694, 0, -1, 1, 1, "", "", "Looping_Animation_End_Time", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeB Looping_Animation_Suppress_Item_Tooltips = new GameAttributeB(695, 0, -1, 1, 1, "", "", "Looping_Animation_Suppress_Item_Tooltips", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Heal_Effect_Last_Played_Tick = new GameAttributeI(696, -1, -1, 3, 1, "", "", "Heal_Effect_Last_Played_Tick", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Resource_Effect_Last_Played_tick = new GameAttributeI(697, -1, 10, 3, 1, "", "", "Resource_Effect_Last_Played_tick", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Thorns_Effect_Last_Played_tick = new GameAttributeI(698, -1, -1, 3, 1, "", "", "Thorns_Effect_Last_Played_tick", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI PVP_Kills = new GameAttributeI(699, 0, -1, 0, 1, "", "", "PVP_Kills", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeI PVP_Deaths = new GameAttributeI(700, 0, -1, 0, 1, "", "", "PVP_Deaths", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeI PVP_Assists = new GameAttributeI(701, 0, -1, 0, 1, "", "", "PVP_Assists", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeI PVP_Progression_Points_Gained = new GameAttributeI(702, 0, -1, 0, 1, "", "", "PVP_Progression_Points_Gained", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeI PVP_Current_Kill_Streak = new GameAttributeI(703, 0, -1, 0, 1, "", "", "PVP_Current_Kill_Streak", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeI PVP_Current_Death_Streak = new GameAttributeI(704, 0, -1, 0, 1, "", "", "PVP_Current_Death_Streak", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeI PVP_Longest_Kill_Streak = new GameAttributeI(705, 0, -1, 0, 1, "", "", "PVP_Longest_Kill_Streak", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeI PVP_Longest_Death_Streak = new GameAttributeI(706, 0, -1, 0, 1, "", "", "PVP_Longest_Death_Streak", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeF Turn_Rate_Scalar = new GameAttributeF(707, 1065353216, -1, 5, 0, "", "", "Turn_Rate_Scalar", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeF Turn_Accel_Scalar = new GameAttributeF(708, 1065353216, -1, 5, 0, "", "", "Turn_Accel_Scalar", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeF Turn_Deccel_Scalar = new GameAttributeF(709, 1065353216, -1, 5, 0, "", "", "Turn_Deccel_Scalar", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeB No_Health_Drop = new GameAttributeB(710, 0, -1, 1, 1, "", "", "No_Health_Drop", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Leader = new GameAttributeB(711, 0, -1, 1, 1, "", "", "Leader", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB IsContentRestrictedActor = new GameAttributeB(712, 0, -1, 1, 1, "", "", "IsContentRestrictedActor", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB InBossEncounter = new GameAttributeB(713, 0, -1, 1, 1, "", "", "InBossEncounter", GameAttributeEncoding.IntMinMax, 1, 0, 1, 1); + public static readonly GameAttributeB God = new GameAttributeB(714, 0, -1, 1, 1, "", "", "God", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB MinimapActive = new GameAttributeB(715, 0, -1, 1, 1, "", "", "MinimapActive", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI MinimapIconOverride = new GameAttributeI(716, -1, -1, 0, 1, "", "", "MinimapIconOverride", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeB MinimapDisableArrow = new GameAttributeB(717, 0, -1, 1, 1, "", "", "MinimapDisableArrow", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Last_Blocked_ACD = new GameAttributeI(718, -1, -1, 3, 1, "", "", "Last_Blocked_ACD", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Last_Blocked_Time = new GameAttributeI(719, 0, -1, 1, 1, "", "", "Last_Blocked_Time", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeB Deactivate_Lure = new GameAttributeB(720, 0, -1, 1, 1, "", "", "Deactivate Lure", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Weapons_Hidden = new GameAttributeB(721, 0, -1, 1, 1, "", "", "Weapons_Hidden", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Actor_Updates_Attributes_From_Owner = new GameAttributeB(722, 0, -1, 1, 1, "", "", "Actor_Updates_Attributes_From_Owner", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeI Taunt_Target_ACD = new GameAttributeI(723, -1, -1, 1, 1, "", "", "Taunt_Target_ACD", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeF UI_Only_Percent_Damage_Increase = new GameAttributeF(724, 0, -1, 0, 0, "", "", "UI_Only_Percent_Damage_Increase", GameAttributeEncoding.Float16, 1, 0, 0, 16); + public static readonly GameAttributeI Projectile_Effect_SNO = new GameAttributeI(725, -1, -1, 3, 1, "", "", "Projectile_Effect_SNO", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeF On_Hit_Fear_Proc_Chance = new GameAttributeF(726, 0, -1, 7, 0, "", "", "On_Hit_Fear_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF On_Hit_Stun_Proc_Chance = new GameAttributeF(727, 0, -1, 7, 0, "", "", "On_Hit_Stun_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF On_Hit_Blind_Proc_Chance = new GameAttributeF(728, 0, -1, 7, 0, "", "", "On_Hit_Blind_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF On_Hit_Freeze_Proc_Chance = new GameAttributeF(729, 0, -1, 7, 0, "", "", "On_Hit_Freeze_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF On_Hit_Chill_Proc_Chance = new GameAttributeF(730, 0, -1, 7, 0, "", "", "On_Hit_Chill_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF On_Hit_Slow_Proc_Chance = new GameAttributeF(731, 0, -1, 7, 0, "", "", "On_Hit_Slow_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF On_Hit_Immobilize_Proc_Chance = new GameAttributeF(732, 0, -1, 7, 0, "", "", "On_Hit_Immobilize_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF On_Hit_Knockback_Proc_Chance = new GameAttributeF(733, 0, -1, 7, 0, "", "", "On_Hit_Knockback_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF On_Hit_Bleed_Proc_Chance = new GameAttributeF(734, 0, -1, 7, 0, "", "", "On_Hit_Bleed_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF On_Hit_Bleed_Proc_Damage_Base = new GameAttributeF(735, 0, -1, 0, 0, "", "", "On_Hit_Bleed_Proc_Damage_Base", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF On_Hit_Bleed_Proc_Damage_Delta = new GameAttributeF(736, 0, -1, 0, 0, "", "", "On_Hit_Bleed_Proc_Damage_Delta", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_Percent_Reduction_From_Ranged = new GameAttributeF(737, 0, -1, 7, 0, "", "", "Damage_Percent_Reduction_From_Ranged", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Damage_Percent_Reduction_From_Melee = new GameAttributeF(738, 0, -1, 7, 0, "", "", "Damage_Percent_Reduction_From_Melee", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Damage_Percent_Reduction_Turns_Into_Heal = new GameAttributeF(739, 0, -1, 7, 0, "", "", "Damage_Percent_Reduction_Turns_Into_Heal", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Damage_Percent_Reduction_From_Elites = new GameAttributeF(740, 0, -1, 7, 0, "", "", "Damage_Percent_Reduction_From_Elites", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Damage_Percent_Reduction_From_Type = new GameAttributeF(741, 0, 0, 7, 0, "", "", "Damage_Percent_Reduction_From_Type", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Damage_Percent_Bonus_Vs_Monster_Type = new GameAttributeF(742, 0, 18, 7, 0, "", "", "Damage_Percent_Bonus_Vs_Monster_Type", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Damage_Percent_Bonus_Vs_Elites = new GameAttributeF(743, 0, -1, 7, 0, "", "", "Damage_Percent_Bonus_Vs_Elites", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeI Item_Manipulation_Timeout = new GameAttributeI(744, 0, -1, 4, 1, "", "", "Item_Manipulation_Timeout", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Picked_Up_Time = new GameAttributeI(745, 0, -1, 4, 1, "", "", "Picked_Up_Time", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI Unequipped_Time = new GameAttributeI(746, 1, 19, 4, 1, "", "", "Unequipped Time", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeI Last_ACD_Killed_Time = new GameAttributeI(747, 0, -1, 4, 1, "", "", "Last_ACD_Killed_Time", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeB CannotDieDuring = new GameAttributeB(748, 0, -1, 1, 1, "", "", "CannotDieDuring", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeF Weapon_On_Hit_Fear_Proc_Chance = new GameAttributeF(749, 0, -1, 7, 0, "", "", "Weapon_On_Hit_Fear_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Stun_Proc_Chance = new GameAttributeF(750, 0, -1, 7, 0, "", "", "Weapon_On_Hit_Stun_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Blind_Proc_Chance = new GameAttributeF(751, 0, -1, 7, 0, "", "", "Weapon_On_Hit_Blind_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Freeze_Proc_Chance = new GameAttributeF(752, 0, -1, 7, 0, "", "", "Weapon_On_Hit_Freeze_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Chill_Proc_Chance = new GameAttributeF(753, 0, -1, 7, 0, "", "", "Weapon_On_Hit_Chill_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Slow_Proc_Chance = new GameAttributeF(754, 0, -1, 7, 0, "", "", "Weapon_On_Hit_Slow_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Immobilize_Proc_Chance = new GameAttributeF(755, 0, -1, 7, 0, "", "", "Weapon_On_Hit_Immobilize_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Knockback_Proc_Chance = new GameAttributeF(756, 0, -1, 7, 0, "", "", "Weapon_On_Hit_Knockback_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Bleed_Proc_Chance = new GameAttributeF(757, 0, -1, 7, 0, "", "", "Weapon_On_Hit_Bleed_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Bleed_Proc_Damage_Base = new GameAttributeF(758, 0, -1, 0, 0, "", "", "Weapon_On_Hit_Bleed_Proc_Damage_Base", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Weapon_On_Hit_Bleed_Proc_Damage_Delta = new GameAttributeF(759, 0, -1, 0, 0, "", "", "Weapon_On_Hit_Bleed_Proc_Damage_Delta", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Weapon_On_Hit_Fear_Proc_Chance_MainHand = new GameAttributeF(760, 0, -1, 7, 0, "(Held_In_OffHand ? 0 : Weapon_On_Hit_Fear_Proc_Chance )", "", "Weapon_On_Hit_Fear_Proc_Chance_MainHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Fear_Proc_Chance_OffHand = new GameAttributeF(761, 0, -1, 7, 0, "(Held_In_OffHand ? Weapon_On_Hit_Fear_Proc_Chance : 0)", "", "Weapon_On_Hit_Fear_Proc_Chance_OffHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Fear_Proc_Chance_CurrentHand = new GameAttributeF(762, 0, -1, 7, 0, "", "(DualWield_Hand ? Weapon_On_Hit_Fear_Proc_Chance_OffHand : Weapon_On_Hit_Fear_Proc_Chance_MainHand)", "Weapon_On_Hit_Fear_Proc_Chance_CurrentHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Stun_Proc_Chance_MainHand = new GameAttributeF(763, 0, -1, 7, 0, "(Held_In_OffHand ? 0 : Weapon_On_Hit_Stun_Proc_Chance )", "", "Weapon_On_Hit_Stun_Proc_Chance_MainHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Stun_Proc_Chance_OffHand = new GameAttributeF(764, 0, -1, 7, 0, "(Held_In_OffHand ? Weapon_On_Hit_Stun_Proc_Chance : 0)", "", "Weapon_On_Hit_Stun_Proc_Chance_OffHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Stun_Proc_Chance_CurrentHand = new GameAttributeF(765, 0, -1, 7, 0, "", "(DualWield_Hand ? Weapon_On_Hit_Stun_Proc_Chance_OffHand : Weapon_On_Hit_Stun_Proc_Chance_MainHand)", "Weapon_On_Hit_Stun_Proc_Chance_CurrentHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Blind_Proc_Chance_MainHand = new GameAttributeF(766, 0, -1, 7, 0, "(Held_In_OffHand ? 0 : Weapon_On_Hit_Blind_Proc_Chance )", "", "Weapon_On_Hit_Blind_Proc_Chance_MainHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Blind_Proc_Chance_OffHand = new GameAttributeF(767, 0, -1, 7, 0, "(Held_In_OffHand ? Weapon_On_Hit_Blind_Proc_Chance : 0)", "", "Weapon_On_Hit_Blind_Proc_Chance_OffHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Blind_Proc_Chance_CurrentHand = new GameAttributeF(768, 0, -1, 7, 0, "", "(DualWield_Hand ? Weapon_On_Hit_Blind_Proc_Chance_OffHand : Weapon_On_Hit_Blind_Proc_Chance_MainHand)", "Weapon_On_Hit_Blind_Proc_Chance_CurrentHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Freeze_Proc_Chance_MainHand = new GameAttributeF(769, 0, -1, 7, 0, "(Held_In_OffHand ? 0 : Weapon_On_Hit_Freeze_Proc_Chance )", "", "Weapon_On_Hit_Freeze_Proc_Chance_MainHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Freeze_Proc_Chance_OffHand = new GameAttributeF(770, 0, -1, 7, 0, "(Held_In_OffHand ? Weapon_On_Hit_Freeze_Proc_Chance : 0)", "", "Weapon_On_Hit_Freeze_Proc_Chance_OffHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Freeze_Proc_Chance_CurrentHand = new GameAttributeF(771, 0, -1, 7, 0, "", "(DualWield_Hand ? Weapon_On_Hit_Freeze_Proc_Chance_OffHand : Weapon_On_Hit_Freeze_Proc_Chance_MainHand)", "Weapon_On_Hit_Freeze_Proc_Chance_CurrentHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Chill_Proc_Chance_MainHand = new GameAttributeF(772, 0, -1, 7, 0, "(Held_In_OffHand ? 0 : Weapon_On_Hit_Chill_Proc_Chance )", "", "Weapon_On_Hit_Chill_Proc_Chance_MainHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Chill_Proc_Chance_OffHand = new GameAttributeF(773, 0, -1, 7, 0, "(Held_In_OffHand ? Weapon_On_Hit_Chill_Proc_Chance : 0)", "", "Weapon_On_Hit_Chill_Proc_Chance_OffHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Chill_Proc_Chance_CurrentHand = new GameAttributeF(774, 0, -1, 7, 0, "", "(DualWield_Hand ? Weapon_On_Hit_Chill_Proc_Chance_OffHand : Weapon_On_Hit_Chill_Proc_Chance_MainHand)", "Weapon_On_Hit_Chill_Proc_Chance_CurrentHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Slow_Proc_Chance_MainHand = new GameAttributeF(775, 0, -1, 7, 0, "(Held_In_OffHand ? 0 : Weapon_On_Hit_Slow_Proc_Chance )", "", "Weapon_On_Hit_Slow_Proc_Chance_MainHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Slow_Proc_Chance_OffHand = new GameAttributeF(776, 0, -1, 7, 0, "(Held_In_OffHand ? Weapon_On_Hit_Slow_Proc_Chance : 0)", "", "Weapon_On_Hit_Slow_Proc_Chance_OffHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Slow_Proc_Chance_CurrentHand = new GameAttributeF(777, 0, -1, 7, 0, "", "(DualWield_Hand ? Weapon_On_Hit_Slow_Proc_Chance_OffHand : Weapon_On_Hit_Slow_Proc_Chance_MainHand)", "Weapon_On_Hit_Slow_Proc_Chance_CurrentHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Immobilize_Proc_Chance_MainHand = new GameAttributeF(778, 0, -1, 7, 0, "(Held_In_OffHand ? 0 : Weapon_On_Hit_Immobilize_Proc_Chance )", "", "Weapon_On_Hit_Immobilize_Proc_Chance_MainHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Immobilize_Proc_Chance_OffHand = new GameAttributeF(779, 0, -1, 7, 0, "(Held_In_OffHand ? Weapon_On_Hit_Immobilize_Proc_Chance : 0)", "", "Weapon_On_Hit_Immobilize_Proc_Chance_OffHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Immobilize_Proc_Chance_CurrentHand = new GameAttributeF(780, 0, -1, 7, 0, "", "(DualWield_Hand ? Weapon_On_Hit_Immobilize_Proc_Chance_OffHand : Weapon_On_Hit_Immobilize_Proc_Chance_MainHand)", "Weapon_On_Hit_Immobilize_Proc_Chance_CurrentHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Knockback_Proc_Chance_MainHand = new GameAttributeF(781, 0, -1, 7, 0, "(Held_In_OffHand ? 0 : Weapon_On_Hit_Knockback_Proc_Chance )", "", "Weapon_On_Hit_Knockback_Proc_Chance_MainHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Knockback_Proc_Chance_OffHand = new GameAttributeF(782, 0, -1, 7, 0, "(Held_In_OffHand ? Weapon_On_Hit_Knockback_Proc_Chance : 0)", "", "Weapon_On_Hit_Knockback_Proc_Chance_OffHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Knockback_Proc_Chance_CurrentHand = new GameAttributeF(783, 0, -1, 7, 0, "", "(DualWield_Hand ? Weapon_On_Hit_Knockback_Proc_Chance_OffHand : Weapon_On_Hit_Knockback_Proc_Chance_MainHand)", "Weapon_On_Hit_Knockback_Proc_Chance_CurrentHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Bleed_Proc_Chance_MainHand = new GameAttributeF(784, 0, -1, 7, 0, "(Held_In_OffHand ? 0 : Weapon_On_Hit_Bleed_Proc_Chance )", "", "Weapon_On_Hit_Bleed_Proc_Chance_MainHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Bleed_Proc_Chance_OffHand = new GameAttributeF(785, 0, -1, 7, 0, "(Held_In_OffHand ? Weapon_On_Hit_Bleed_Proc_Chance : 0)", "", "Weapon_On_Hit_Bleed_Proc_Chance_OffHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Bleed_Proc_Chance_CurrentHand = new GameAttributeF(786, 0, -1, 7, 0, "", "(DualWield_Hand ? Weapon_On_Hit_Bleed_Proc_Chance_OffHand : Weapon_On_Hit_Bleed_Proc_Chance_MainHand)", "Weapon_On_Hit_Bleed_Proc_Chance_CurrentHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_On_Hit_Bleed_Proc_Damage_Base_MainHand = new GameAttributeF(787, 0, -1, 0, 0, "(Held_In_OffHand ? 0 : Weapon_On_Hit_Bleed_Proc_Damage_Base )", "", "Weapon_On_Hit_Bleed_Proc_Damage_Base_MainHand", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Weapon_On_Hit_Bleed_Proc_Damage_Base_OffHand = new GameAttributeF(788, 0, -1, 0, 0, "(Held_In_OffHand ? Weapon_On_Hit_Bleed_Proc_Damage_Base : 0)", "", "Weapon_On_Hit_Bleed_Proc_Damage_Base_OffHand", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Weapon_On_Hit_Bleed_Proc_Damage_Base_CurrentHand = new GameAttributeF(789, 0, -1, 0, 0, "", "(DualWield_Hand ? Weapon_On_Hit_Bleed_Proc_Damage_Base_OffHand : Weapon_On_Hit_Bleed_Proc_Damage_Base_MainHand)", "Weapon_On_Hit_Bleed_Proc_Damage_Base_CurrentHand", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Weapon_On_Hit_Bleed_Proc_Damage_Delta_MainHand = new GameAttributeF(790, 0, -1, 0, 0, "(Held_In_OffHand ? 0 : Weapon_On_Hit_Bleed_Proc_Damage_Delta )", "", "Weapon_On_Hit_Bleed_Proc_Damage_Delta_MainHand", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Weapon_On_Hit_Bleed_Proc_Damage_Delta_OffHand = new GameAttributeF(791, 0, -1, 0, 0, "(Held_In_OffHand ? Weapon_On_Hit_Bleed_Proc_Damage_Delta : 0)", "", "Weapon_On_Hit_Bleed_Proc_Damage_Delta_OffHand", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Weapon_On_Hit_Bleed_Proc_Damage_Delta_CurrentHand = new GameAttributeF(792, 0, -1, 0, 0, "", "(DualWield_Hand ? Weapon_On_Hit_Bleed_Proc_Damage_Delta_OffHand : Weapon_On_Hit_Bleed_Proc_Damage_Delta_MainHand)", "Weapon_On_Hit_Bleed_Proc_Damage_Delta_CurrentHand", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Power_Damage_Percent_Bonus = new GameAttributeF(793, 0, 4, 0, 0, "", "", "Power_Damage_Percent_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Power_Resource_Reduction = new GameAttributeF(794, 0, 4, 0, 0, "", "", "Power_Resource_Reduction", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Power_Cooldown_Reduction = new GameAttributeF(795, 0, 4, 0, 0, "", "", "Power_Cooldown_Reduction", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Power_Duration_Increase = new GameAttributeF(796, 0, 4, 0, 0, "", "", "Power_Duration_Increase", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Power_Crit_Percent_Bonus = new GameAttributeF(797, 0, 4, 0, 0, "", "", "Power_Crit_Percent_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_Crit_Chance = new GameAttributeF(798, 0, -1, 7, 0, "", "", "Weapon_Crit_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_Crit_Chance_MainHand = new GameAttributeF(799, 0, -1, 7, 0, "(Held_In_OffHand ? 0 : Weapon_Crit_Chance )", "", "Weapon_Crit_Chance_MainHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_Crit_Chance_OffHand = new GameAttributeF(800, 0, -1, 7, 0, "(Held_In_OffHand ? Weapon_Crit_Chance : 0)", "", "Weapon_Crit_Chance_OffHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Weapon_Crit_Chance_CurrentHand = new GameAttributeF(801, 0, -1, 7, 0, "", "(DualWield_Hand ? Weapon_Crit_Chance_OffHand : Weapon_Crit_Chance_MainHand)", "Weapon_Crit_Chance_CurrentHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Strength_Item = new GameAttributeF(802, 0, -1, 0, 0, "", "", "Strength_Item", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Dexterity_Item = new GameAttributeF(803, 0, -1, 0, 0, "", "", "Dexterity_Item", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Intelligence_Item = new GameAttributeF(804, 0, -1, 0, 0, "", "", "Intelligence_Item", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Vitality_Item = new GameAttributeF(805, 0, -1, 0, 0, "", "", "Vitality_Item", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeI Item_Level_Requirement_Reduction = new GameAttributeI(806, 0, -1, 0, 1, "", "", "Item_Level_Requirement_Reduction", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeF Item_Durability_Percent_Bonus = new GameAttributeF(807, 0, -1, 0, 0, "", "", "Item_Durability_Percent_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeB Item_Indestructible = new GameAttributeB(808, 0, -1, 1, 1, "", "", "Item_Indestructible", GameAttributeEncoding.IntMinMax, 8, 0, 1, 1); + public static readonly GameAttributeF Core_Attributes_From_Item_Bonus_Multiplier = new GameAttributeF(809, 1065353216, -1, 1, 0, "", "", "Core_Attributes_From_Item_Bonus_Multiplier", GameAttributeEncoding.Float32, 1, 0, 0, 32); + public static readonly GameAttributeB Waiting_To_Accept_Resurrection = new GameAttributeB(810, 0, -1, 1, 1, "", "", "Waiting_To_Accept_Resurrection", GameAttributeEncoding.IntMinMax, 1, 0, 1, 1); + public static readonly GameAttributeB Ghosted = new GameAttributeB(811, 0, -1, 1, 1, "", "", "Ghosted", GameAttributeEncoding.IntMinMax, 1, 0, 1, 1); + public static readonly GameAttributeB Special_Inventory_Has_Sold = new GameAttributeB(812, 0, -1, 1, 1, "", "", "Special_Inventory_Has_Sold", GameAttributeEncoding.IntMinMax, 2, 0, 1, 1); + public static readonly GameAttributeI Power_Channel_Lockout_Time = new GameAttributeI(813, 0, -1, 4, 1, "", "", "Power_Channel_Lockout_Time", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Power_Buff_0_Lockout_Time = new GameAttributeI(814, 0, 4, 4, 1, "", "", "Power_Buff_0_Lockout_Time", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Power_Buff_1_Lockout_Time = new GameAttributeI(815, 0, 4, 4, 1, "", "", "Power_Buff_1_Lockout_Time", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Power_Buff_2_Lockout_Time = new GameAttributeI(816, 0, 4, 4, 1, "", "", "Power_Buff_2_Lockout_Time", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Power_Buff_3_Lockout_Time = new GameAttributeI(817, 0, 4, 4, 1, "", "", "Power_Buff_3_Lockout_Time", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Power_Buff_4_Lockout_Time = new GameAttributeI(818, 0, 4, 4, 1, "", "", "Power_Buff_4_Lockout_Time", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Power_Buff_5_Lockout_Time = new GameAttributeI(819, 0, 4, 4, 1, "", "", "Power_Buff_5_Lockout_Time", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Power_Buff_6_Lockout_Time = new GameAttributeI(820, 0, 4, 4, 1, "", "", "Power_Buff_6_Lockout_Time", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Power_Buff_7_Lockout_Time = new GameAttributeI(821, 0, 4, 4, 1, "", "", "Power_Buff_7_Lockout_Time", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Known_By_Owner = new GameAttributeI(822, -1, -1, 4, 1, "", "", "Known_By_Owner", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeB Never_Deactivates = new GameAttributeB(823, 0, -1, 1, 1, "", "", "Never_Deactivates", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Account_Under_Review = new GameAttributeB(824, 0, -1, 1, 1, "", "", "Account_Under_Review", GameAttributeEncoding.IntMinMax, 1, 0, 1, 1); + public static readonly GameAttributeI Projectile_Detonate_Time = new GameAttributeI(825, 0, -1, 4, 1, "", "", "Projectile_Detonate_Time", GameAttributeEncoding.Int, 64, 0, 0, 32); + } +} diff --git a/src/Mooege/Net/GS/Message/GameAttribute.cs b/src/Mooege/Net/GS/Message/GameAttribute.cs new file mode 100644 index 00000000..67da0ec9 --- /dev/null +++ b/src/Mooege/Net/GS/Message/GameAttribute.cs @@ -0,0 +1,174 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Runtime.InteropServices; +using System.Collections.Generic; +using Mooege.Core.GS.Objects; + +namespace Mooege.Net.GS.Message +{ + public class GameAttributeDependency + { + public GameAttribute Attribute; + public int? Key; + public bool UsesExplicitKey; + public bool IsManualDependency; + + public GameAttributeDependency(GameAttribute attribute, int? key, bool usesExplicitKey, + bool isManualDependency) + { + Attribute = attribute; + Key = key; + UsesExplicitKey = usesExplicitKey; + IsManualDependency = isManualDependency; + } + } + + public enum GameAttributeEncoding + { + Int, + IntMinMax, + //FloatMinMax, + Float16, + Float16Or32, + Float32, + } + + [StructLayout(LayoutKind.Explicit)] + public struct GameAttributeValue + { + [FieldOffset(0)] + public int Value; + [FieldOffset(0)] + public float ValueF; + + public GameAttributeValue(int value) { ValueF = 0f; Value = value; } + public GameAttributeValue(float value) { Value = 0; ValueF = value; } + } + + public partial class GameAttribute + { + public const float Float16Min = -65536.0f; + public const float Float16Max = 65536.0f; + + public int Id; + public GameAttributeValue _DefaultValue; + public int U3; + public int U4; + public int U5; + + public string ScriptA; + public string ScriptB; + public string Name; + + public GameAttributeEncoding EncodingType; + + public byte U10; + + public GameAttributeValue Min; + public GameAttributeValue Max; + public int BitCount; + + public bool IsInteger { get { return EncodingType == GameAttributeEncoding.Int || EncodingType == GameAttributeEncoding.IntMinMax; } } + + // script stuff generated by ScritpedAttributeInitializer and used by GameAttributeMap + public Func ScriptFunc = null; + public List Dependents = null; + public bool ScriptedAndSettable = false; + + public GameAttribute() { } + + public GameAttribute(int id, int defaultValue, int u3, int u4, int u5, string scriptA, string scriptB, string name, GameAttributeEncoding encodingType, byte u10, int min, int max, int bitCount) + { + Id = id; + _DefaultValue.Value = defaultValue; + U3 = u3; + U4 = u4; + U5 = u5; + ScriptA = scriptA; + ScriptB = scriptB; + Name = name; + EncodingType = encodingType; + U10 = u10; + + Min = new GameAttributeValue(min); + Max = new GameAttributeValue(max); + BitCount = bitCount; + } + + public GameAttribute(int id, float defaultValue, int u3, int u4, int u5, string scriptA, string scriptB, string name, GameAttributeEncoding encodingType, byte u10, float min, float max, int bitCount) + { + Id = id; + _DefaultValue.ValueF = defaultValue; + U3 = u3; + U4 = u4; + U5 = u5; + ScriptA = scriptA; + ScriptB = scriptB; + Name = name; + EncodingType = encodingType; + U10 = u10; + + Min = new GameAttributeValue(min); + Max = new GameAttributeValue(max); + BitCount = bitCount; + } + } + + + public class GameAttributeI : GameAttribute + { + public int DefaultValue { get { return _DefaultValue.Value; } } + + public GameAttributeI() { } + + public GameAttributeI(int id, int defaultValue, int u3, int u4, int u5, string scriptA, string scriptB, string name, GameAttributeEncoding encodingType, byte u10, int min, int max, int bitCount) + : base(id, defaultValue, u3, u4, u5, scriptA, scriptB, name, encodingType, u10, min, max, bitCount) + { + + } + } + + public class GameAttributeF : GameAttribute + { + public float DefaultValue { get { return _DefaultValue.ValueF; } } + + public GameAttributeF() { } + public GameAttributeF(int id, float defaultValue, int u3, int u4, int u5, string scriptA, string scriptB, string name, GameAttributeEncoding encodingType, byte u10, float min, float max, int bitCount) + : base(id, defaultValue, u3, u4, u5, scriptA, scriptB, name, encodingType, u10, min, max, bitCount) + { + + } + } + + public class GameAttributeB : GameAttribute + { + public bool DefaultValue { get { return _DefaultValue.Value != 0; } } + + public GameAttributeB() { } + public GameAttributeB(int id, int defaultValue, int u3, int u4, int u5, string scriptA, string scriptB, string name, GameAttributeEncoding encodingType, byte u10, int min, int max, int bitCount) + : base(id, defaultValue, u3, u4, u5, scriptA, scriptB, name, encodingType, u10, min, max, bitCount) + { + + } + + } + + +} diff --git a/src/Mooege/Net/GS/Message/GameBitBuffer.cs b/src/Mooege/Net/GS/Message/GameBitBuffer.cs new file mode 100644 index 00000000..f2d171b6 --- /dev/null +++ b/src/Mooege/Net/GS/Message/GameBitBuffer.cs @@ -0,0 +1,326 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Text; + +namespace Mooege.Net.GS.Message +{ + public class GameBitBufferException : Exception + { + public GameBitBufferException(string msg) : base(msg) { } + } + + public class GameBitBuffer + { + public byte[] Data; + public int Length; + public int Position; + + public GameBitBuffer(byte[] data, int position, int length) + { + Data = data; + Position = position; + Length = length; + } + + public GameBitBuffer(byte[] data) + { + Data = data; + Position = 0; + Length = data.Length * 8; + } + + public GameBitBuffer(int byteCapacity) + { + Data = new byte[byteCapacity]; + Position = 0; + Length = 0; + } + + public GameMessage ParseMessage() + { + return GameMessage.ParseMessage(this); + } + + public void EncodeMessage(GameMessage msg) + { + WriteInt(9, msg.Id); + msg.Encode(this); + } + + public byte[] GetPacketAndReset() + { + int bytes = ((Length + 7) & (~7)) >> 3; + Position = 0; + WriteInt(32, bytes); + byte[] result = new byte[bytes]; + + Array.Copy(Data, result, bytes); + Length = 32; + Position = 32; + + return result; + } + + public bool CheckAvailable(int length) + { + return Position + length <= Length; + } + const int BufferAlignment = 31; + + public void AppendData(byte[] data) + { + int length = Length >> 3; + if (length + data.Length > Data.Length) + { + int newSize = (length + data.Length + BufferAlignment) & (~BufferAlignment); + Array.Resize(ref Data, newSize); + } + Array.Copy(data, 0, Data, length, data.Length); + Length += data.Length * 8; + } + + public void ConsumeData() + { + int bytes = ((Position + 7) & (~7)) >> 3; + Array.Copy(Data, bytes, Data, 0, (Length >> 3) - bytes); + Length = Length - (bytes * 8); + Position = 0; + } + + + public void MakeAvailable(int length) + { + if (Position + length > Data.Length * 8) + { + int newSize = (((Position + length + 7) / 8) + BufferAlignment) & (~BufferAlignment); + Array.Resize(ref Data, newSize); + } + } + + public static int GetBitCount(int x) + { + int count = 0; + while (x > 0) + { + x >>= 1; + count++; + } + return count; + } + + public static int GetIntegerValueBitCount(int min, int max) + { + int x = max - min; + if (x <= 0) + return 0; // D3 compat + return GetBitCount(x); + } + + public bool IsPacketAvailable() + { + if (Length - Position < 32) + return false; + int pos = Position; + int packetSize = ReadInt(32); + Position = pos; + return CheckAvailable(packetSize * 8); + } + + public int ReadInt(int length) + { + if (!CheckAvailable(length)) + throw new GameBitBufferException("Not enough bits remaining."); + + int result = 0; + while (length > 0) + { + int off = Position & 7; + int count = 8 - off; + if (count > length) + count = length; + int mask = (1 << count) - 1; + int bits = (Data[Position >> 3] >> off); + result |= (bits & mask) << (length - count); + length -= count; + Position += count; + } + return result; + } + + public uint ReadUInt(int length) + { + return unchecked((uint)ReadInt(length)); + } + + public void WriteInt(int length, int value) + { + MakeAvailable(length); + while (length > 0) + { + int off = Position & 7; + int count = 8 - off; + if (count > length) + count = length; + int mask = (1 << count) - 1; + Data[Position >> 3] = (byte)((Data[Position >> 3] & (~(mask << off))) | (((value >> (length - count)) & mask) << off)); + length -= count; + Position += count; + if (Position > Length) + Length = Position; + } + } + + public void WriteUInt(int length, uint value) + { + WriteInt(length, unchecked((int)value)); + } + + byte[] _floatBuffer = new byte[4]; + + public float ReadFloat32() + { + int value = ReadInt(32); + _floatBuffer[0] = (byte)value; + _floatBuffer[1] = (byte)((value >> 8) & 0xFF); + _floatBuffer[2] = (byte)((value >> 16) & 0xFF); + _floatBuffer[3] = (byte)((value >> 24) & 0xFF); + return BitConverter.ToSingle(_floatBuffer, 0); + } + + public void WriteFloat32(float value) + { + WriteInt(32, BitConverter.ToInt32(BitConverter.GetBytes(value), 0)); + } + + public long ReadInt64(int length) + { + int count = length >= 32 ? 32 : length; + long result = ReadInt(count); + count = length - count; + if (count > 0) + result = (result << count) | (long)(uint)ReadInt(count); + return result; + } + + public ulong ReadUInt64(int length) + { + return unchecked((ulong)ReadInt64(length)); + } + + public void WriteInt64(int length, long value) + { + MakeAvailable(length); + + if (length <= 32) + { + WriteInt(length, (int)(uint)value); + return; + } + + int count = length - 32; + WriteInt(32, (int)(uint)(value >> count)); + WriteInt(count, (int)(uint)value); + } + + public void WriteUInt64(int length, ulong value) + { + WriteInt64(length, unchecked((long)value)); + } + + public string ReadCharArray(int maxLength) + { + int size = ReadInt(GetBitCount(maxLength)); + Position = (Position + 7) & (~7); + if (!CheckAvailable(size * 8)) + throw new GameBitBufferException("Not enough bits remaining."); + var result = Encoding.UTF8.GetString(Data, Position >> 3, size); + Position += size * 8; + return result; + } + + public void WriteCharArray(int maxLength, string value) + { + var result = Encoding.UTF8.GetBytes(value); + WriteInt(GetBitCount(maxLength), result.Length); + Position = (Position + 7) & (~7); + MakeAvailable(result.Length * 8); + Buffer.BlockCopy(result, 0, Data, Position >> 3, result.Length); + Position += result.Length * 8; + if (Position > Length) + Length = Position; + } + + public bool ReadBool() { return ReadInt(1) != 0; } + public void WriteBool(bool value) { WriteInt(1, value ? 1 : 0); } + + public byte[] ReadBlob(int sizeBits) + { + int size = ReadInt(sizeBits); + byte[] result = new byte[size]; + Position = (Position + 7) & (~7); + if (!CheckAvailable(size * 8)) + throw new GameBitBufferException("Not enough bits remaining."); + Buffer.BlockCopy(Data, Position >> 3, result, 0, size); + Position += size * 8; + return result; + } + + public void WriteBlob(int sizeBits, byte[] data) + { + WriteInt(sizeBits, data.Length); + Position = (Position + 7) & (~7); + MakeAvailable(data.Length * 8); + Buffer.BlockCopy(data, 0, Data, Position >> 3, data.Length); + Position += data.Length * 8; + if (Position > Length) + Length = Position; + } + + + public float ReadFloat16() + { + int bits = ReadInt(16); + int value; + value = (bits & 0x3FF) << 13; + value |= (((bits >> 10) & 0x1F) + 112) << 23; + value |= (bits & 0x8000) << 16; + + _floatBuffer[0] = (byte)value; + _floatBuffer[1] = (byte)((value >> 8) & 0xFF); + _floatBuffer[2] = (byte)((value >> 16) & 0xFF); + _floatBuffer[3] = (byte)((value >> 24) & 0xFF); + return BitConverter.ToSingle(_floatBuffer, 0); + } + + public void WriteFloat16(float value) + { + int bits = BitConverter.ToInt32(BitConverter.GetBytes(value), 0); + int x = (bits >> 13) & 0x3FF; + int y = (((bits >> 23) & 0xFF) - 112); + if (y > 0) + x |= y << 10; + x |= (bits >> 16) & 0x8000; + WriteInt(16, x); + if (Position > Length) + Length = Position; + } + + } +} diff --git a/src/Mooege/Net/GS/Message/GameMessage.cs b/src/Mooege/Net/GS/Message/GameMessage.cs new file mode 100644 index 00000000..e858fad3 --- /dev/null +++ b/src/Mooege/Net/GS/Message/GameMessage.cs @@ -0,0 +1,114 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Text; +using Mooege.Common.Logging; + +namespace Mooege.Net.GS.Message +{ + public abstract class GameMessage + { + protected static readonly Logger Logger = LogManager.CreateLogger(); + + private static readonly Dictionary MessageTypes = new Dictionary(); + private static readonly Dictionary MessageConsumers = new Dictionary(); + + static GameMessage() + { + foreach (var type in Assembly.GetExecutingAssembly().GetTypes()) + { + if (!type.IsSubclassOf(typeof(GameMessage))) continue; + + var attributes = (MessageAttribute[])type.GetCustomAttributes(typeof(MessageAttribute), true); + if (attributes.Length == 0) continue; + foreach (MessageAttribute attribute in attributes) + { + foreach (var opcode in attribute.Opcodes) + { + if (MessageTypes.ContainsKey(opcode)) + { + Logger.Fatal("Duplicate opcode detected: {0}", opcode.ToString()); + } + else + { + MessageTypes.Add(opcode, type); + MessageConsumers.Add(opcode, attribute.Consumer); + } + } + } + } + } + + public static T Allocate(Opcodes opcode) where T : GameMessage + { + if (!MessageTypes.ContainsKey(opcode)) + { + Logger.Debug("Unimplemented message: " + opcode.ToString()); + return null; + } + + var ctorWithParameterExists = MessageTypes[opcode].GetConstructor(new[] { typeof(Opcodes) }) != null; + var msg = (T)Activator.CreateInstance(MessageTypes[opcode], ctorWithParameterExists ? new object[] { opcode } : null); + + msg.Id = (int)opcode; + msg.Consumer = MessageConsumers[opcode]; + return msg; + } + + public static GameMessage ParseMessage(GameBitBuffer buffer) + { + int id = buffer.ReadInt(9); + var msg = Allocate((Opcodes)id); + if (msg == null) return null; + + msg.Id = id; + msg.Parse(buffer); + return msg; + } + + protected GameMessage() { } + + protected GameMessage(int id) + { + this.Id = id; + } + + protected GameMessage(Opcodes opcode) + { + this.Id = (int)opcode; + } + + public int Id { get; set; } // this is needed for farmys dumper /fasbat + public Consumers Consumer { get; set; } + + public abstract void Parse(GameBitBuffer buffer); + public abstract void Encode(GameBitBuffer buffer); + public abstract void AsText(StringBuilder b, int pad); + + public string AsText() + { + var builder = new StringBuilder(); + builder.AppendLine("GameMessage(0x" + Id.ToString("X4") + ")"); + AsText(builder, 0); + return builder.ToString(); + } + } +} diff --git a/src/Mooege/Net/GS/Message/IMessageConsumer.cs b/src/Mooege/Net/GS/Message/IMessageConsumer.cs new file mode 100644 index 00000000..95821f19 --- /dev/null +++ b/src/Mooege/Net/GS/Message/IMessageConsumer.cs @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace Mooege.Net.GS.Message + { + public interface IMessageConsumer + { + void Consume(GameClient client, GameMessage message); + } + + public enum Consumers + { + None, + ClientManager, + Game, + Inventory, + Conversations, + Player, + SelectedNPC + } + } diff --git a/src/Mooege/Net/GS/Message/ISelfHandler.cs b/src/Mooege/Net/GS/Message/ISelfHandler.cs new file mode 100644 index 00000000..8e381226 --- /dev/null +++ b/src/Mooege/Net/GS/Message/ISelfHandler.cs @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace Mooege.Net.GS.Message +{ + public interface ISelfHandler + { + void Handle(GameClient client); + } +} diff --git a/src/Mooege/Net/GS/Message/MessageAttribute.cs b/src/Mooege/Net/GS/Message/MessageAttribute.cs new file mode 100644 index 00000000..2128dfb8 --- /dev/null +++ b/src/Mooege/Net/GS/Message/MessageAttribute.cs @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; + +namespace Mooege.Net.GS.Message +{ + [AttributeUsage(AttributeTargets.Class)] + public class MessageAttribute : Attribute + { + public List Opcodes { get; private set; } + public Consumers Consumer { get; private set; } + + public MessageAttribute(Opcodes opcode, Consumers consumer = Consumers.None) + { + this.Opcodes = new List { opcode }; + this.Consumer = consumer; + } + + public MessageAttribute(Opcodes[] opcodes, Consumers consumer = Consumers.None) + { + this.Opcodes = new List(); + this.Consumer = consumer; + + foreach (var opcode in opcodes) + { + this.Opcodes.Add(opcode); + } + } + } +} diff --git a/src/Mooege/Net/GS/Message/Opcodes.cs b/src/Mooege/Net/GS/Message/Opcodes.cs new file mode 100644 index 00000000..073812a8 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Opcodes.cs @@ -0,0 +1,339 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace Mooege.Net.GS.Message +{ + public enum Opcodes : int + { + TryConsoleCommand1 = 1, + TryConsoleCommand2 = 2, + QuitGameMessage = 3, // len: 12 + CreateBNetGameMessage = 4, // len: 88 + CreateBNetGameResultMessage = 5, // len: 40 + DWordDataMessage1 = 6, // len: 12 + RequestJoinBNetGameMessage = 8, // len: 56 + BNetJoinGameRequestResultMessage = 9, // len: 72 + JoinBNetGameMessage = 10, // len: 80 + JoinLANGameMessage = 11, // len: 196 + VersionsMessage = 13, // len: 48 + GenericBlobMessage1 = 14, // len: + NetworkAddressMessage = 15, // len: 16 + GameIdMessage = 17, // len: 32 + UInt64DataMessage = 18, // len: 16 + IntDataMessage1 = 20, // len: 12 + EntityIdMessage = 22, // len: 24 + CreateHeroMessage = 23, // len: 68 + CreateHeroResultMessage = 24, // len: 32 + SimpleMessage1 = 25, // len: 8 + BlizzconCVarsMessage = 26, // len: 20 + SimpleMessage2 = 27, // len: 8 + GenericBlobMessage2 = 28, // len: + GenericBlobMessage3 = 29, // len: + GenericBlobMessage4 = 30, // len: + GenericBlobMessage5 = 31, // len: + OpenArtisanWindowMessage = 32, // len: 12 former ANNDataMessage1 + ArtisanWindowClosedMessage = 33, // len: 8 former SimpleMessage3 + OpenTradeWindow = 34, // len: 12 former ANNDataMessage2 + RequestBuyItemMessage = 35, // len: 12, former ANNDataMessage3 + RequestSellItemMessage = 36, // len: 12, former ANNDataMessage4 + SimpleMessage3 = 37, // len: 8 + LogoutContextMessage1 = 38, // len: 16 + LogoutTickTimeMessage = 39, // len: 20 + LogoutComplete = 40, // len: 8 formor SimpleMessage4 + LogoutContextMessage2 = 41, // len: 16 + PlayerIndexMessage1 = 42, // len: 12 + PlayerIndexMessage2 = 43, // len: 12 + SimpleMessage5 = 44, // len: 8 + SimpleMessage6 = 45, // len: 8 + TutorialMessage = 46, //len: former GenericBlobMessage6 + GenericBlobMessage15 = 47, //len: added 8058 + Message = 48, //len: 36 + SimpleMessage48 = 49, //Len: 8 added 8058 + ConnectionEstablishedMessage = 50, // len: 20 + GameSetupMessage = 51, // len: 20 + GameSetupMessageAck = 52, // len: 8 former SimpleMessage7 + NewPlayerMessage = 53, // len: 16916 + PlayerKickTimerMessage = 54, //len: 16 + PlayerBannerMessage = 55, // len: former GenericBlobMessage7 + EnterWorldMessage = 56, // len: 28 + RevealSceneMessage = 57, // len: 1292 + DestroySceneMessage = 58, // len: 16 + SwapSceneMessage = 59, // len: 20 + RevealWorldMessage = 60, // len: 16 + RevealTeamMessage = 61, // len: 20 + PlayerActorSetInitialMessage = 62, // len: 16 + HeroStateMessage = 63, // len: 16652 + ACDEnterKnownMessage = 64, // len: 132 + ACDDestroyActorMessage = 65, // len: 12 former ANNDataMessage6 + PlayerEnterKnownMessage = 66, // len: 16 + ACDCreateActorMessage = 67, // len: 12 former ANNDataMessage7 + ACDWorldPositionMessage = 68, // len: 48 + ACDInventoryPositionMessage = 69, // len: 32 + ACDInventoryUpdateActorSNO = 70, // len: 16 + TrickleMessage = 71, // len: 116 + ANNDataMessage8 = 72, // len: 12 + MapRevealSceneMessage = 73, // len: 52 + SavePointInfoMessage = 74, // len: 12 + HearthPortalInfoMessage = 75, // len: 16 + ReturnPointInfoMessage = 76, // len: 12 + AffixMessage = 77, // len: 148 + RareMonsterNamesMessage = 78, // len: 52 + RareItemNameMessage = 79, // len: 28 + PortalSpecifierMessage = 80, // len: 24 + AttributeSetValueMessage = 81, // len: 28 + AttributesSetValuesMessage = 82, // len: 256 + VisualInventoryMessage = 83, // len: 140 + ProjectileStickMessage = 84, // len: 28 + TargetMessage = 85, // len: 60 + SecondaryAnimationPowerMessage = 86, // len: 28 + LoopingAnimationPowerMessage = 87, // len: 20 + DWordDataMessage2 = 88, // len: 12 + DWordDataMessage3 = 89, // len: 12 + DWordDataMessage4 = 90, // len: 12 + DWordDataMessage5 = 91, // len: 12 + TryChatMessage = 92, // len: 528 + ChatMessage = 93, // len: 528 + DropItemMessage = 94, // len: 12 former ANNDataMessage9 + InventoryRequestMoveMessage1 = 95, // len: 28 + InventoryRequestQuickMoveMessage = 96, // len: 28 + InventoryRequestSocketMessage = 97, // len: 16 + InventoryRequestMoveMessage2 = 98, // len: 28 + InventorySplitStackMessage = 99, // len: 40 + InventoryDropStackPortionMessage = 100, //len: 24 + InventoryStackTransferMessage = 101, // len: 24 + ANNDataMessage10 = 102, // len: 12 + IdentifyItemMessage = 103, //len: 12 former ANNDataMessageXX + SimpleMessage47 = 104, //len 8 added in 7841 + ANNDataMessage11 = 105, // len: 12 + InventoryRequestUseMessage = 106, // len: 36 + HelperDetachMessage = 107, // len: 12 + AssignSkillMessage1 = 108, // len: 16 + UnassignSkillMessage = 109, //len: 12 + AssignTraitsMessage = 110, // len: 20 added patch 13 + AssignSkillMessage2 = 111, // len: 16 + AssignSkillMessage3 = 112, // len: 16 + HirelingRequestLearnSkillMessage = 113, // len: 20 + HotbarButtonData = 114, // len: 12 former ANNDataMessage12 + GBIDDataMessage3 = 115, // len: 12 added patch 13 + IntDataMessage2 = 116, // len: 12 + PlayAnimationMessage = 117, // len: 72 + ANNDataMessage13 = 118, // len: 12 + ACDTranslateNormalMessage = 119, // len: 76 former ACDTranslateNormalMessage1 + ACDTranslateSnappedMessage = 120, // len: 36 + ACDTranslateFacingMessage = 121, // len: 20 + ACDTranslateFixedMessage = 122, // len: 36 + ACDTranslateArcMessage = 123, // len: 60 + ACDTranslateDetPathMessage = 124, // len: 88 + ACDTranslateDetPathSinMessage = 125, // len: 104 + ACDTranslateDetPathSpiralMessage = 126, // len: 72 + ACDTranslateSyncMessage = 127, // len: 32 + ACDTranslateFixedUpdateMessage = 128, // len: 36 + ACDClientTranslateMessage = 129, //len: 44 (Added patch 8) + PlayerTranslateFacingMessage = 130, // len: 20 former ACDTranslateFacingMessage2 + ACDTranslateAckMessage = 131, //len: 12 + PlayEffectMessage = 132, // len: 24 + PlayHitEffectMessage = 133, // len: 24 + PlayHitEffectOverrideMessage = 134, // len: 20 + PlayNonPositionalSoundMessage = 135, // len: 12 + PlayErrorSoundMessage = 136, // len: 12 + PlayMusicMessage = 137, // len: 12 + SimpleMessage4 = 138, // len: 8 + PlayCutsceneMessage = 139, // len: 12 + ComplexEffectAddMessage = 140, // len: 36 + FlippyMessage = 141, // len: 32 + WaypointActivatedMessage = 142, // len: 20 + OpenWaypointSelectionWindowMessage = 143, // len: 12 former ANNDataMessage14 + ANNDataMessage15 = 144, // len: 12 + ANNDataMessage16 = 145, // len: 12 + SimpleMessage49 = 146, // len: 8 added patch 13 + AimTargetMessage = 147, // len: 36 + ACDChangeGBHandleMessage = 148, // len: 20 + GameTickMessage = 149, // len: 12 former DWordDataMessage6 + DataIDDataMessage1 = 150, // len: 12 + DataIDDataMessage2 = 151, // len: 12 + EndOfTickMessage = 152, // len: 16 + TryWaypointMessage = 153, // len: 16 + NPCInteractOptionsMessage = 154, // len: 340 + ANNDataMessage17 = 155, // len: 12 + ANNDataMessage18 = 156, // len: 12 + SimpleMessage8 = 157, // len: 8 + QuestUpdateMessage = 158, // len: 28 + QuestMeterMessage = 159, // len: 20 + QuestCounterMessage = 160, // len: 20 + QuestStepCompleteMessage = 161, // len: // former GenericBlobMessage8 + PlayerIndexMessage3 = 162, // len: 12 + PlayerLevel = 163, // len: 16 + OpenSharedStashMessage = 164, // len: 12, former ANNDataMessage19 + ACDPickupFailedMessage = 165, // len: 16 + PetMessage = 166, // len: 24 + PetDetachMessage = 167, // len: 16 + HirelingInfoUpdateMessage = 168, // len: 24 + UIElementMessage = 169, // len: 16 + PlayerBusyMessage = 170, // len: 12 // former: BoolDataMessage1 + TradeMessage1 = 171, // len: 56 + TradeMessage2 = 172, // len: 56 + PlayerIndexMessage4 = 173, // len: 12 + SimpleMessage10 = 174, // len: 8 + PlayerIndexMessage5 = 175, // len: 12 + SetIdleAnimationMessage = 176, // len: 16 + ACDCollFlagsMessage = 177, // len: 16 + GoldModifiedMessage = 178, // len: 12 + ActTransitionMessage = 179, // len: 16 + InterstitialMessage = 180, // len: 16 + EffectGroupACDToACDMessage = 181, // len: 20 + RopeEffectMessageACDToACD = 182, // len: 28 + RopeEffectMessageACDToPlace = 183, // len: 36 + ANNDataMessage21 = 184, // len: 12 + ShrineActivatedMessage = 185, // len: 12 former ANNDataMessage22 + GameSyncedDataMessage = 186, // len: 96 + ACDChangeActorMessage = 187, // len: 16 + PlayerWarpedMessage = 188, // len: 16 + VictimMessage = 189, // len: 48 + KillCountMessage = 190, // len: 24 + WorldStatusMessage = 191, // len: 16 + WeatherOverrideMessage = 192, // len: 16 + SimpleMessage11 = 193, // len: 8 + ACDShearMessage = 194, // len: 16 + ACDGroupMessage = 195, // len: 20 + HeartbeatMessage = 196, // len: 8 former SimpleMessage12 + PlayConvLineMessage = 197, // len: 172 + StopConvLineMessage = 198, // len: 16 + AdvanceConvMessage = 199, //len : 16 + UpdateConvAutoAdvanceMessage = 200, // len: 20 + RequestCloseConversationWindowMessage = 201, // len: 8 former SimpleMessage13 + EndConversationMessage = 202, // len: 20 + SNODataMessage2 = 203, // len: 12 + FinishConversationMessage = 204, // len: 12 former SNODataMessage3 + HirelingSwapMessage1 = 205, // len: 12 + HirelingSwapMessage2 = 206, // len: 12 + SimpleMessage14 = 207, // len: 8 + DeathFadeTimeMessage = 208, // len: 24 + ANNDataMessage23 = 209, // len: 12 + ANNDataMessage24 = 210, // len: 12 + DisplayGameTextMessage = 211, // len: 536 + IntDataMessage4 = 212, // len: 12 + DWordDataMessage7 = 213, // len: 12 + GBIDDataMessage1 = 214, // len: 12 + ANNDataMessage25 = 215, // len: 12 + ANNDataMessage26 = 216, // len: 12 + ACDLookAtMessage = 217, // len: 16 + KillCounterUpdateMessage = 218, // len: 24 + LowHealthCombatMessage = 219, // len: 16 + SaviorMessage = 220, // len: 16 + FloatingNumberMessage = 221, // len: 20 + FloatingAmountMessage = 222, // len: 40 + RemoveRagdollMessage = 223, // len: 16 + SNONameDataMessage = 224, // len: 16 + LoreMessage = 225, // len: 16 + DWordDataMessage12 = 228, // len: 12 added 8059 + WorldDeletedMessage = 229, // len: 12 + SimpleMessage16 = 230, // len: 8 + IntDataMessage5 = 231, // len: 12 + TimedEventStartedMessage = 232, // len: 20 + SNODataMessage4 = 233, // len: 12 + ActTransitionStartedMessage = 234, // len: 16 + SimpleMessage17 = 235, // len: 8 //added in 7728 + RequestBuySharedStashSlotsMessage = 236, // len: 8 former SimpleMessage17 + PlayerQuestMessage1 = 237, // len: 16 + PlayerQuestMessage2 = 238, // len: 16 + PlayerDeSyncSnapMessage = 239, // len: 28 + RequestUseNephalemCubeMessage = 240, // len: 12 former ANNDataMessage27 + SalvageResultsMessage = 241, // len: 60 + SimpleMessage18 = 242, // len: 8 + MapMarkerInfoMessage = 243, // len: 72 + BlacksmithDataProgressMessage = 244, // len: former GenericBlobMessage9 + JewelerDataProgressMessage = 245, // len: former GenericBlobMessage10 + MysticDataProgressMessage = 246, // len: former GenericBlobMessage11 + BlacksmithDataInitialMessage = 247, // len: former genericBlobMessage 12 + JewelerDataInitialMessage = 248, // len: former GenericBlobMessage13 + MysticDataInitialMessage = 249, // len: former GenericBlobMessage14 + ANNDataMessage28 = 250, // len: 12 + DebugActorTooltipMessage = 251, // len: 524 + BossEncounterMessage1 = 252, // len: 16 + SimpleMessage20 = 253, // len: 8 + SimpleMessage21 = 254, // len: 8 + BossEncounterMessage2 = 255, // len: 16 + SimpleMessage22 = 256, // len: 8 + SimpleMessage23 = 257, // len: 8 + EncounterInviteStateMessage = 258, // len: 12 + SimpleMessage24 = 259, // len: 8 + SimpleMessage25 = 260, // len: 8 + IntDataMessage3 = 261, // len: 12 added 8059 + SimpleMessage26 = 262, // len: 8 + SimpleMessage27 = 263, // len: 8 + SimpleMessage28 = 264, // len: 8 + SimpleMessage29 = 265, // len: 8 + CameraFocusMessage = 266, // len: 20 + CameraZoomMessage = 267, // len: 20 + CameraYawMessage = 268, // len: 20 + SimpleMessage30 = 269, // len: 8 + BoolDataMessage2 = 270, // len: 12 + SimpleMessage50 = 271, // len: 8 added patch 13 + BossZoomMessage = 272, // len: 16 + EnchantItemMessage = 273, // len: 16 + ANNDataMessage29 = 274, // len: 12 + RepairAllMessage = 275, // len: 8 former SimpleMessage31 + RepairEquippedMessage = 276, // len: 8 former SimpleMessage32 + RequestTrainArtisanMessage = 277, // len: 8 former SimpleMessage33 + IntDataMessage6 = 278, // len: 12 + DebugDrawPrimMessage = 279, // len: 188 + GBIDDataMessage2 = 280, // len: 12 + CraftingResultsMessage = 281, // len: 20 + CrafterLevelUpMessage = 282, // len: 20 + ANNDataMessage31 = 283, // len: 12 + ANNDataMessage32 = 284, // len: 12 + IntDataMessage7 = 285, // len: 12 + UnlockDifficultyMessage = 286, // len: 16 added patch 13 + IntDataMessage8 = 287, // len: 12 + HirelingRetrainMessage = 288, // len: 8 former SimpleMessage35 + SimpleMessage36 = 289, // len: 8 + GameTestingSamplingStartMessage = 290, // len: 16 + SimpleMessage37 = 291, // len: 8 + TutorialShownMessage = 292, // len: 12 former SNODataMessage5 + RequestBuffCancelMessage = 293, // len: 16 + CancelCinematicsMessage = 294, // len: 8 fomer Simplemessage38 + PlayerIndexMessage7 = 295, // len: 12 + SimpleMessage39 = 296, // len: 8 + SimpleMessage40 = 297, // len: 8 + DWordDataMessage8 = 298, // len: 12 + DWordDataMessage9 = 299, // len: 12 + DWordDataMessage10 = 300, // len: 12 + DWordDataMessage11 = 301, // len: 12 + BroadcastTextMessage = 302, // len: 520 + LoadCompleteMessage = 303, // len: 8 former SimpleMessage41 + SimpleMessage42 = 304, // len: 8 + NPCSelectConversationMessage = 305, // len: 12 former SNODataMessage6 + HirelingDismissMessage = 306, // len: 12 former ANNDataMessage33 + CraftInteractionMessage = 307, // len: 8 former SimpleMessage43 + HirelingHireMessage = 308, // len: 8 former SimpleMessage44 + HirelingInventoryMessage = 309, // len: 8 former SimpleMessage45 + SNODataMessage7 = 310, // len: 12 + ActTransitionStartedMessage2 = 311, //len: 16 + VoteKickMessage1 = 312, //len: 528 + PlayerIndexMessage8 = 313, // len: 12 + PlayerIndexMessage9 = 314, // len: 12 + VoteKickMessage2 = 315, //len: 528 + BoolDataMessage3 = 316, // len: 12 + PlayerIndexMessage10 = 317, // len: 12 + PlayerIndexMessage11 = 318, // len: 12 + BoolDataMessage4 = 319, // len: 12 + BoolDataMessage5 = 320, // len: 12 + SimpleMessage51 = 321, //len: 8 added patch 13 + SimpleMessage52 = 322, //len: 8 added patch 14 + } +} \ No newline at end of file diff --git a/src/Mooege/Net/GS/Message/ScriptedAttributeInitializer.cs b/src/Mooege/Net/GS/Message/ScriptedAttributeInitializer.cs new file mode 100644 index 00000000..8b92c5a5 --- /dev/null +++ b/src/Mooege/Net/GS/Message/ScriptedAttributeInitializer.cs @@ -0,0 +1,228 @@ +/* + * Copyright (C) 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using Mooege.Core.GS.Objects; +using Microsoft.CSharp; +using System.CodeDom.Compiler; +using System.IO; +using System.Reflection; + +namespace Mooege.Net.GS.Message +{ + // exception class for initialization errors + public class ScriptedAttributeInitializerError : Exception + { + public ScriptedAttributeInitializerError() { } + public ScriptedAttributeInitializerError(string message) : base(message) { } + } + + // Compiles GameAttribute scripts, generates script dependency lists. + public class ScriptedAttributeInitializer + { + #region Pin() implementation for scripts to use. + public static int Pin(int a, int b, int c) + { + if (b > a) + return b; + else if (a > c) + return c; + else + return a; + } + + public static float Pin(float a, float b, float c) + { + if (b > a) + return b; + else if (a > c) + return c; + else + return a; + } + #endregion + + public static void ProcessAttributes(GameAttribute[] attributes) + { + // build string -> GameAttribute lookup + var attributeLookup = attributes.ToDictionary(attr => attr.Name); + // will contain C# code for the func<> body that represents each attribute's script. + var csharpScripts = new Dictionary(); + + // generate C#-compatible source lines from scripts and create attribute dependency lists + foreach (GameAttribute attr in attributes) + { + // check for valid script in the attribute and select it + string script; + + if (attr.ScriptA.Length > 0 && attr.ScriptA != "0") + script = attr.ScriptA; + else if (attr.ScriptB.Length > 0 && attr.ScriptB != "0") + script = attr.ScriptB; + else + continue; // no valid script, done processing this attribute + + // by default all scripts are not settable + // can be set to true if self-referring identifier is found + attr.ScriptedAndSettable = false; + + // replace attribute references with GameAttributeMap lookups + // also record all attributes used by script into each attribute's dependency list + script = Regex.Replace(script, @"([A-Za-z_]\w*)(\.Agg)?(\#[A-Za-z_]\w*)?(?=[^\(\w]|\z)( \?)?", + (match) => + { + // lookup attribute object + string identifierName = match.Groups[1].Value; + if (!attributeLookup.ContainsKey(identifierName)) + throw new ScriptedAttributeInitializerError("invalid identifer parsed: " + identifierName); + + GameAttribute identifier = attributeLookup[identifierName]; + + // key selection + int? key = null; + string keyString = "_key"; + bool usesExplicitKey = false; + + if (match.Groups[3].Success) + { + switch (match.Groups[3].Value.ToUpper()) + { + case "#NONE": key = null; break; + case "#PHYSICAL": key = 0; break; + case "#FIRE": key = 1; break; + case "#LIGHTNING": key = 2; break; + case "#COLD": key = 3; break; + case "#POISON": key = 4; break; + case "#ARCANE": key = 5; break; + case "#HOLY": key = 6; break; + default: + throw new ScriptedAttributeInitializerError("error processing attribute script, invalid key in identifier: " + match.Groups[3].Value); + } + + if (key == null) + keyString = "null"; + else + keyString = key.ToString(); + + usesExplicitKey = true; + } + + // add comparsion for int attributes that are directly used in an ?: expression. + string compare = ""; + if (match.Groups[4].Success) + compare = identifier is GameAttributeI ? " > 0 ?" : " ?"; + + // handle self-referring lookup. example: Resource.Agg + if (match.Groups[2].Success) + { + attr.ScriptedAndSettable = true; + return "_map._RawGetAttribute(GameAttribute." + identifierName + + ", " + keyString + ")" + compare; + } + + // record dependency + if (identifier.Dependents == null) + identifier.Dependents = new List(); + + identifier.Dependents.Add(new GameAttributeDependency(attr, key, usesExplicitKey, false)); + + // generate normal lookup + return "_map[GameAttribute." + identifierName + ", " + keyString + "]" + compare; + }); + + // transform function calls into C# equivalents + script = Regex.Replace(script, @"floor\(", "(float)Math.Floor(", RegexOptions.IgnoreCase); + script = Regex.Replace(script, @"max\(", "Math.Max(", RegexOptions.IgnoreCase); + script = Regex.Replace(script, @"min\(", "Math.Min(", RegexOptions.IgnoreCase); + script = Regex.Replace(script, @"pin\(", "ScriptedAttributeInitializer.Pin(", RegexOptions.IgnoreCase); + + // add C# single-precision affix to decimal literals. example: 1.25 => 1.25f + script = Regex.Replace(script, @"\d+\.\d+", "$0f"); + + csharpScripts[attr] = script; + } + + // generate and write final C# code to file + string sourcePathBase = Path.Combine(Path.GetTempPath(), "MooegeScriptedAttributeFuncs"); + + using (StreamWriter fout = new StreamWriter(sourcePathBase + ".cs")) + { + fout.Write( +@"// This file was auto-generated by Mooege class ScriptedAttributeInitializer +// It contains Funcs derived from GameAttribute.ScriptA/B scripts. +// Funcs will be assigned to their respective GameAttribute.ScriptFunc member. +using System; +using Mooege.Net.GS.Message; +using Mooege.Core.GS.Objects; + +namespace Mooege.Net.GS.Message.GeneratedCode +{ + public class ScriptedAttributeFuncs + { +"); + foreach (var scriptEntry in csharpScripts) + { + // select output type cast to ensure it matches attribute type + string castType = scriptEntry.Key is GameAttributeF ? "float" : "int"; + + // write out full Func static class field + fout.WriteLine(" public static Func {0} = (_map, _key) => new GameAttributeValue(({1})({2}));", + scriptEntry.Key.Name, + castType, + scriptEntry.Value); + } + + fout.Write( +@" } +} +"); + } + + // compile code + var options = new CompilerParameters(); + options.GenerateExecutable = false; + options.OutputAssembly = sourcePathBase + ".dll"; + options.IncludeDebugInformation = true; + options.ReferencedAssemblies.Add(Assembly.GetExecutingAssembly().Location); + + var results = new CSharpCodeProvider().CompileAssemblyFromFile(options, sourcePathBase + ".cs"); + if (results.Errors.Count > 0) + { + StringBuilder emsg = new StringBuilder(); + emsg.AppendLine("encountered errors compiling attribute funcs:"); + foreach (var e in results.Errors) + emsg.AppendLine(e.ToString()); + + throw new ScriptedAttributeInitializerError(emsg.ToString()); + } + + // pull funcs from new assembly and assign them to their respective attributes + Type funcs = results.CompiledAssembly.GetType("Mooege.Net.GS.Message.GeneratedCode.ScriptedAttributeFuncs"); + + foreach (var attr in csharpScripts.Keys) + { + attr.ScriptFunc = (Func)funcs + .GetField(attr.Name).GetValue(null); + } + } + } +} diff --git a/src/Mooege/Net/IClient.cs b/src/Mooege/Net/IClient.cs new file mode 100644 index 00000000..5db70399 --- /dev/null +++ b/src/Mooege/Net/IClient.cs @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace Mooege.Net +{ + /// + /// Client interface. + /// + public interface IClient + { + /// + /// Gets or sets the TCP connection bound to client. + /// + IConnection Connection { get; set; } + } +} diff --git a/src/Mooege/Net/IConnection.cs b/src/Mooege/Net/IConnection.cs new file mode 100644 index 00000000..1bee3c09 --- /dev/null +++ b/src/Mooege/Net/IConnection.cs @@ -0,0 +1,155 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Collections.Generic; +using System.Net; +using System.Net.Sockets; +using Mooege.Net.MooNet.Packets; + +using OpenSSL; + +namespace Mooege.Net +{ + /// + /// Connection interface. + /// + public interface IConnection + { + // [D3Inferno] + // Returns true if the connection is now encrypted. + // This will be true once Tls handshaking is complete and successful. + bool IsEncrypted { get; } + + // Returns true is the EncryptRequest message has been sent to the client. + // The last unencrypted packet should be the EncryptRequest NoData service response. + bool IsEncryptRequestSent { get; set; } + + // Returns true if the connection is trying to establish a Tls connection. + bool IsTlsHandshaking { get; set; } + + /// The underlying TLS stream. Required for encrypted communication. + SslStream TLSStream { get; } + + // Notify the Connection of the encrypted TLSStream. + void SetEncrypted(SslStream TLSStream); + + // Notify that Tls Authentication is complete (but perhaps not successful) so that it can once + // again start listening for client data, but from now on, using the SslStream if successful. + void TlsAuthenticationComplete(); + + // Wrapper for the Send method that will send the data either to the + // Socket (unecnrypted) or to the TLSStream (encrypted). + // Note that the flags will be ignored for TLSStream. + int _Send(byte[] buffer, int start, int count, SocketFlags flags); + + // Read bytes from the Sokcet into the buffer in a non-blocking call. + // This allows us to read no more than the specified count number of bytes. + int Receive(int start, int count); + + // Expose the RecvBuffer. + byte[] RecvBuffer { get; } + + + /// + /// Returns true if there exists an active connection. + /// + bool IsConnected { get; } + + /// + /// Returns remote endpoint. + /// + IPEndPoint RemoteEndPoint { get; } + + /// + /// Returns local endpoint. + /// + IPEndPoint LocalEndPoint { get; } + + /// + /// Gets or sets bound client. + /// + IClient Client { get; set; } + + /// + /// Gets underlying socket. + /// + Socket Socket { get; } + + /// + /// Sends a to remote endpoint. + /// + /// to send. + /// Returns count of sent bytes. + int Send(PacketOut packet); + + /// + /// Sends byte buffer to remote endpoint. + /// + /// Byte buffer to send. + /// Returns count of sent bytes. + int Send(byte[] buffer); + + /// + /// Sends byte buffer to remote endpoint. + /// + /// Byte buffer to send. + /// Sockets flags to use. + /// Returns count of sent bytes. + int Send(byte[] buffer, SocketFlags flags); + + /// + /// Sends byte buffer to remote endpoint. + /// + /// Byte buffer to send. + /// Start index to read from buffer. + /// Count of bytes to send. + /// Returns count of sent bytes. + int Send(byte[] buffer, int start, int count); + + /// + /// Sends byte buffer to remote endpoint. + /// + /// Byte buffer to send. + /// Start index to read from buffer. + /// Count of bytes to send. + /// Sockets flags to use. + /// Returns count of sent bytes. + int Send(byte[] buffer, int start, int count, SocketFlags flags); + + /// + /// Sends an enumarable byte buffer to remote endpoint. + /// + /// Enumrable byte buffer to send. + /// Returns count of sent bytes. + int Send(IEnumerable data); + + /// + /// Sends an enumarable byte buffer to remote endpoint. + /// + /// Enumrable byte buffer to send. + /// Sockets flags to use. + /// Returns count of sent bytes. + int Send(IEnumerable data, SocketFlags flags); + + /// + /// Kills the connection to remote endpoint. + /// + void Disconnect(); + } +} + diff --git a/src/Mooege/Net/MooNet/Config.cs b/src/Mooege/Net/MooNet/Config.cs new file mode 100644 index 00000000..74d6f2d7 --- /dev/null +++ b/src/Mooege/Net/MooNet/Config.cs @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace Mooege.Net.MooNet +{ + public sealed class Config : Common.Config.Config + { + public string BindIP { get { return this.GetString("BindIP", "0.0.0.0"); } set { this.Set("BindIP", value); } } + public string BindIPv6 { get { return this.GetString("BindIPv6", "::1"); } set { this.Set("BindIPv6", value); } } + public int Port { get { return this.GetInt("Port", 1345); } set { this.Set("Port", value); } } + public string MOTD { get { return this.GetString("MOTD", ""); } set { this.Set("MOTD", value); } } + + private static readonly Config _instance = new Config(); + public static Config Instance { get { return _instance; } } + private Config() : base("MooNet-Server") { } + } +} diff --git a/src/Mooege/Net/MooNet/MooNetBuffer.cs b/src/Mooege/Net/MooNet/MooNetBuffer.cs new file mode 100644 index 00000000..f037df64 --- /dev/null +++ b/src/Mooege/Net/MooNet/MooNetBuffer.cs @@ -0,0 +1,94 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Mooege.Net.MooNet +{ + public class MooNetBuffer + { + public int Position { get; private set; } + + public int Length + { + get { return _length - Position; } + } + + private byte[] _data = new byte[0]; + private int _length = 0; + + public MooNetBuffer() + { + this.Position = 0; + } + + public bool PacketAvaliable() + { + if (Length < 2) + return false; + + int headerSize = (_data[Position] << 8) | _data[Position + 1]; // header size. + + if (Length < headerSize + 2) + return false; + + var tempData = new byte[headerSize]; + Array.Copy(_data, Position + 2, tempData, 0, headerSize); + + var headerData = bnet.protocol.Header.ParseFrom(tempData); // header data. + + if (Length < headerData.Size + headerSize + 2) + return false; + + return true; + } + + public bnet.protocol.Header GetPacketHeader() + { + if (Length < 2) + throw new Exception("GetPacketHeader when insuficient data avaliable"); + + int headerSize = (_data[Position] << 8) | _data[Position + 1]; // header size. + + if (Length < headerSize + 2) + throw new Exception("GetPacketHeader when insuficient data avaliable"); + + var tempData = new byte[headerSize]; + Array.Copy(_data, Position + 2, tempData, 0, headerSize); + + var headerData = bnet.protocol.Header.ParseFrom(tempData); // header data. + Position += 2 + headerSize; + + return headerData; + } + + public byte[] GetPacketData(int count) + { + if (Length < count) + throw new Exception("GetPacketData called when insuficient data avaliable!"); + + var tempData = new byte[count]; + Array.Copy(_data, Position, tempData, 0, count); + + Position += count; + return tempData; + } + + public void Consume() + { + Array.Copy(_data, Position, _data, 0, Length); + + _length = _length - Position; + Position = 0; + } + + public void Append(byte[] newdata) + { + if (_data.Length < _length + newdata.Length) + Array.Resize(ref _data, _length + newdata.Length); + + Array.Copy(newdata, 0, _data, _length, newdata.Length); + _length = _length + newdata.Length; + } + } +} diff --git a/src/Mooege/Net/MooNet/MooNetClient.cs b/src/Mooege/Net/MooNet/MooNetClient.cs new file mode 100644 index 00000000..a71dda2a --- /dev/null +++ b/src/Mooege/Net/MooNet/MooNetClient.cs @@ -0,0 +1,753 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Sockets; +using System.Threading; +using Google.ProtocolBuffers; +using Google.ProtocolBuffers.Descriptors; +using Mooege.Common.Helpers.Hash; +using Mooege.Common.Extensions; +using Mooege.Common.Logging; +using Mooege.Common.Versions; +using Mooege.Core.Cryptography.SSL; +using Mooege.Core.MooNet.Accounts; +using Mooege.Core.MooNet.Authentication; +using Mooege.Core.MooNet.Channels; +using Mooege.Core.MooNet.Objects; +using Mooege.Core.MooNet.Services; // Service +using Mooege.Net.GS; +using Mooege.Net.MooNet.Packets; +using Mooege.Net.MooNet.RPC; +using OpenSSL; + +namespace Mooege.Net.MooNet +{ + public class MooNetClient : IClient, IRpcChannel + { + private static readonly Logger Logger = LogManager.CreateLogger(); + + // [D3Inferno] + // Create the NO_RESPONSE. + // Do not send packets back to server when the response is NO_RESPONSE! + public static bnet.protocol.NO_RESPONSE NO_RESPONSE = bnet.protocol.NO_RESPONSE.CreateBuilder().Build(); + + // [D3Inferno] + public const string PSK_CIPHERS = "PSK-AES256-CBC-SHA:PSK-3DES-EDE-CBC-SHA:PSK-AES128-CBC-SHA:PSK-RC4-SHA"; + + // The SRP-6a SessionKey. It is the PSK for the PSK ciphers. + public byte[] SessionKey { get; set; } + + + /// + /// TCP connection. + /// + public IConnection Connection { get; set; } + + /// + /// The underlying network stream. + /// + public NetworkStream NetworkStream { get; private set; } + + /// + /// The underlying TLS stream. + /// + public SslStream TLSStream { get; private set; } + + + /// + /// MooNet Layer Stream + /// + public MooNetBuffer IncomingMooNetStream { get; private set; } + + /// + /// Logged in gs client if any. + /// + public GameClient InGameClient { get; set; } + + /// + /// Account for logged in client. + /// + public Account Account { get; set; } + + /// + /// Selected Game Account for logged in client. + /// + //public GameAccount CurrentGameAccount { get; set; } + + /// + /// Client exported services dictionary. + /// + public Dictionary Services { get; private set; } + + /// + /// Platform of the client. + /// + public ClientPlatform Platform { get; set; } + + /// + /// Locale of the client. + /// + public ClientLocale Locale { get; set; } + + /// + /// Resulting error code for the authentication process. + /// + public AuthManager.AuthenticationErrorCodes AuthenticationErrorCode; + + /// + /// The client's ModuleIds for all the streamed modules. + /// + public Dictionary ClientModuleIds = new Dictionary(); + + /// + /// The last module client was instructed to load. + /// + public StreamedModule LastRequestedModule = StreamedModule.None; + + public enum StreamedModule + { + None, + Thumbprint, + Password, + Token, + RiskFingerprint, + Agreement, + } + + public AvailableAgreements LastAgreementSent = AvailableAgreements.None; + + public enum AvailableAgreements + { + None, + EULA, + TOS, + RMAH, + } + + public Dictionary Agreements = new Dictionary(); + + /// + /// Callback list for issued client RPCs. + /// + public readonly Dictionary RPCCallbacks = new Dictionary(); + + /// + /// Object ID map with local object ID as key and remote object ID as value. + /// + private Dictionary MappedObjects { get; set; } + + /// + /// Token counter for RPCs. + /// + private uint _tokenCounter = 0; + + public bool MOTDSent { get; private set; } + + /// + /// Listener Id for upcoming rpc. + /// + private ulong _listenerId; // last targeted rpc object. + + public string LoginEmail = ""; + + public MooNetClient(IConnection connection) + { + this.Platform = ClientPlatform.Unknown; + this.Locale = ClientLocale.Unknown; + this.MOTDSent = false; + + this.IncomingMooNetStream = new MooNetBuffer(); + + this.Connection = connection; + if (this.Connection != null) + { + this.NetworkStream = new NetworkStream(this.Connection.Socket, true); + this.Connection.IsEncryptRequestSent = false; + this.Connection.IsTlsHandshaking = false; + } + + this.Services = new Dictionary(); + this.Services.Add(0x65446991, 0x0); // connection-service is always bound by default. /raist. + this.MappedObjects = new Dictionary(); + } + + public bnet.protocol.Identity GetIdentity(bool acct, bool gameacct, bool toon) + { + var identityBuilder = bnet.protocol.Identity.CreateBuilder(); + if (acct) identityBuilder.SetAccountId(this.Account.BnetEntityId); + if (gameacct) identityBuilder.SetGameAccountId(this.Account.CurrentGameAccount.BnetEntityId); + if (toon && this.Account.CurrentGameAccount.CurrentToon != null) + Logger.Warn("DEPRECATED: GetIdentity called with toon."); + return identityBuilder.Build(); + } + + + private void LoadAgreementModule() + { + var moduleLoadRequest = bnet.protocol.authentication.ModuleLoadRequest.CreateBuilder(); + var moduleHandle = bnet.protocol.ContentHandle.CreateBuilder() + .SetRegion(VersionInfo.MooNet.Regions[VersionInfo.MooNet.Region]) + .SetUsage(0x61757468) // auth + .SetHash(ByteString.CopyFrom(VersionInfo.MooNet.AgreementHashMap[this.Platform])); + + this.LastRequestedModule = StreamedModule.Agreement; + + moduleLoadRequest.SetModuleHandle(moduleHandle); + this.MakeRPC(() => bnet.protocol.authentication.AuthenticationClient.CreateStub(this).ModuleLoad(null, moduleLoadRequest.Build(), callback => { })); + } + + + public bool HasAgreements() + { + return false; // comment this line to enable EULA & TOS agreements. + + foreach (AvailableAgreements x in Enum.GetValues(typeof(AvailableAgreements))) + { + if (x != AvailableAgreements.None && !Agreements.ContainsKey(x)) + return true; + } + return false; + } + + public void SendAgreements() + { + + var moduleMessageRequest = bnet.protocol.authentication.ModuleMessageRequest.CreateBuilder() + .SetModuleId(this.ClientModuleIds[StreamedModule.Agreement]); + + //Account has not agreed to TOS + if (!Agreements.ContainsKey(AvailableAgreements.TOS)) + { + moduleMessageRequest.SetMessage(ByteString.CopyFrom(VersionInfo.MooNet.TOS)); + Logger.Trace("Sending TOS to client {0}", this); + this.LastAgreementSent = AvailableAgreements.TOS; + } + //Account has not agreed to EULA + else if (!Agreements.ContainsKey(AvailableAgreements.EULA)) + { + moduleMessageRequest.SetMessage(ByteString.CopyFrom(VersionInfo.MooNet.EULA)); + Logger.Trace("Sending EULA to client {0}", this); + this.LastAgreementSent = AvailableAgreements.EULA; + } + //Account has not agreed to RMAH + else if (!Agreements.ContainsKey(AvailableAgreements.RMAH)) + { + moduleMessageRequest.SetMessage(ByteString.CopyFrom(VersionInfo.MooNet.RMAH)); + Logger.Trace("Sending RMAH to client {0}", this); + this.LastAgreementSent = AvailableAgreements.RMAH; + } + else + { + //Account has no more agreements to see. + var moduleLoadRequest = bnet.protocol.authentication.ModuleLoadRequest.CreateBuilder(); + var moduleHandle = bnet.protocol.ContentHandle.CreateBuilder() + .SetRegion(VersionInfo.MooNet.Regions[VersionInfo.MooNet.Region]) + .SetUsage(0x61757468); // auth + + moduleHandle.SetHash(ByteString.CopyFrom(VersionInfo.MooNet.RiskFingerprintHashMap[this.Platform])); + moduleLoadRequest.SetMessage(ByteString.Empty); + this.LastRequestedModule = StreamedModule.RiskFingerprint; + moduleLoadRequest.SetModuleHandle(moduleHandle); + + this.MakeRPC(() => bnet.protocol.authentication.AuthenticationClient.CreateStub(this).ModuleLoad(null, moduleLoadRequest.Build(), callback => { })); + return; + } + + this.MakeRPC(() => bnet.protocol.authentication.AuthenticationClient.CreateStub(this).ModuleMessage(null, moduleMessageRequest.Build(), callback => { })); + } + + public void CheckAuthenticator() + { + var HasAuthenticator = false; + var moduleLoadRequest = bnet.protocol.authentication.ModuleLoadRequest.CreateBuilder(); + var moduleHandle = bnet.protocol.ContentHandle.CreateBuilder() + .SetRegion(VersionInfo.MooNet.Regions[VersionInfo.MooNet.Region]) + .SetUsage(0x61757468); // auth + + //Account has Authenticator attached, load Token module + if (HasAuthenticator) + { + moduleHandle.SetHash(ByteString.CopyFrom(VersionInfo.MooNet.TokenHashMap[this.Platform])); + moduleLoadRequest.SetMessage(ByteString.CopyFrom("0012F1BF6506277817890210A8529A4BB7BDD1E08EB397A4B0CABF174F6266B7CAF7F2CE7A298F001958F8".ToByteArray())); + + this.LastRequestedModule = StreamedModule.Token; + } + //Account does not have Authenticator, Check Agreements or load RiskFingerprint module + else + { + if (this.HasAgreements()) + { + moduleHandle.SetHash(ByteString.CopyFrom(VersionInfo.MooNet.AgreementHashMap[this.Platform])); + this.LastRequestedModule = StreamedModule.Agreement; + } + else + { + moduleHandle.SetHash(ByteString.CopyFrom(VersionInfo.MooNet.RiskFingerprintHashMap[this.Platform])); + moduleLoadRequest.SetMessage(ByteString.Empty); + this.LastRequestedModule = StreamedModule.RiskFingerprint; + } + } + + moduleLoadRequest.SetModuleHandle(moduleHandle); + + this.MakeRPC(() => bnet.protocol.authentication.AuthenticationClient.CreateStub(this).ModuleLoad(null, moduleLoadRequest.Build(), callback => { })); + } + + public void AuthenticationComplete() + { + var logonResponseBuilder = bnet.protocol.authentication.LogonResult.CreateBuilder(); + + if (AuthenticationErrorCode != AuthManager.AuthenticationErrorCodes.None) + { + Logger.Info("Authentication failed for {0} because of invalid credentals.", LoginEmail); + logonResponseBuilder.SetErrorCode(6); //Logon failed, please try again (Error 6) + + this.MakeRPC(() => + bnet.protocol.authentication.AuthenticationClient.CreateStub(this).LogonComplete(null, logonResponseBuilder.Build(), callback => { })); + + return; + } + + Logger.Info("User {0} authenticated successfuly.", LoginEmail); + + this.EnableEncryption(); + } + + #region rpc-call mechanism + + /// + /// Allows you target an RPCObject while issuing a RPC. + /// + /// + /// The rpc action. + public void MakeTargetedRPC(RPCObject targetObject, Action rpc) + { + this._listenerId = this.GetRemoteObjectId(targetObject.DynamicId); + Logger.Trace("[RPC: {0}] Method: {1} Target: {2} [localId: {3}, remoteId: {4}].", this, rpc.Method, + targetObject.ToString(), targetObject.DynamicId, this._listenerId); + + rpc(); + } + + /// + /// Allows you target an listener directly while issuing a RPC. + /// + /// The listenerId over client. + /// The rpc action. + public void MakeRPCWithListenerId(ulong listenerId, Action rpc) + { + this._listenerId = listenerId; + Logger.Trace("[RPC: {0}] Method: {1} Target: (listenerId) {2}.", this, rpc.Method, this._listenerId); + + rpc(); + } + + /// + /// Allows you to issue an RPC without targeting any RPCObject/Listener. + /// + /// The rpc action. + public void MakeRPC(Action rpc) + { + this._listenerId = 0; + Logger.Trace("[RPC: {0}] Method: {1} Target: N/A", this, rpc.Method); + rpc(); + } + + /// + /// Makes an RPC over remote client. + /// + /// The method to call. + /// The rpc controller. + /// The request message. + /// The response message. + /// Action to run when client responds RPC. + public void CallMethod(MethodDescriptor method, IRpcController controller, IMessage request, IMessage responsePrototype, Action done) + { + var serviceName = method.Service.FullName; + var serviceHash = StringHashHelper.HashIdentity(serviceName); + + if (!this.Services.ContainsKey(serviceHash)) + { + Logger.Error("Not bound to client service {0} [0x{1}] yet.", serviceName, serviceHash.ToString("X8")); + return; + } + + var serviceId = this.Services[serviceHash]; + var token = this._tokenCounter++; + + if (!NO_RESPONSE.Equals(responsePrototype)) // if expected responce is NoResponse, don't add the call to rpc-callbacks list. + RPCCallbacks.Add(token, new RPCCallback(done, responsePrototype.WeakToBuilder())); + + var packet = new PacketOut((byte)serviceId, MooNetRouter.GetMethodId(method), (uint)token, this._listenerId, request); + this.Connection.Send(packet); + } + + #endregion + + #region object-mapping mechanism for rpc calls + + /// + /// Maps a given local objectId to remote one over client. + /// + /// The local objectId. + /// The remote objectId over client. + public void MapLocalObjectID(ulong localObjectId, ulong remoteObjectId) + { + try + { + this.MappedObjects[localObjectId] = remoteObjectId; + } + catch (Exception e) + { + Logger.DebugException(e, "MapLocalObjectID()"); + } + } + + /// + /// Unmaps an existing local objectId. + /// + /// + public void UnmapLocalObjectId(ulong localObjectId) + { + try + { + this.MappedObjects.Remove(localObjectId); + } + catch (Exception e) + { + Logger.DebugException(e, "UnmapLocalObjectID()"); + } + } + + /// + /// Returns the remote objectId for given localObjectId. + /// + /// The local objectId + /// The remoteobjectId + public ulong GetRemoteObjectId(ulong localObjectId) + { + return localObjectId != 0 ? this.MappedObjects[localObjectId] : 0; + } + + #endregion + + #region TLS support + + // D3 uses TLS 1.0 ( 0x16 0x3 0x1 ) (http://en.wikipedia.org/wiki/Transport_Layer_Security) with following ciphers; + // * Cipher Suite: TLS_PSK_WITH_AES_256_CBC_SHA (0x008d) + // * Cipher Suite: TLS_PSK_WITH_3DES_EDE_CBC_SHA (0x008b) + // * Cipher Suite: TLS_PSK_WITH_AES_128_CBC_SHA (0x008c) + // * Cipher Suite: TLS_PSK_WITH_RC4_128_SHA (0x008a) + // * Cipher Suite: TLS_EMPTY_RENEGOTIATION_INFO_SCSV (0x00ff) + // Which Microsoft's or Mono's System.Net.Security implementation does NOT support them (yet?). + // So we've to instead use openssl over openssl.net (http://openssl-net.sourceforge.net/) wrapper to support them. + // GNUTls and so the DotGNU Portable.net (http://dotgnu.org/pnet.html) also supports those chippers but openssl-net gives us that kinda cool SSLStream implementation that's seamlessly handles the stuff. + // Sample SSLStream code: http://msdn.microsoft.com/en-us/library/system.net.security.sslstream.aspx + + public void EnableEncryption() + { + //AuthenticationService service = (AuthenticationService)Service.GetByID(0x01); + //service.TEMPORARY_AUTHENTICATOR(); + // enable the encryption. + var encryptRequest = bnet.protocol.connection.EncryptRequest.CreateBuilder().Build(); + this.MakeRPC(() => bnet.protocol.connection.ConnectionService.CreateStub(this).Encrypt(null, encryptRequest, callback => StartupTLSHandshake())); + + Logger.Trace("Setting IsEncryptRequestSent = true"); + this.Connection.IsEncryptRequestSent = true; + + } + + public void StartupTLSHandshake() + { + Logger.Trace("StartupTLSHandshake"); + this.Connection.IsTlsHandshaking = true; + this.TLSStream = new SslStream(this.NetworkStream, false); + + try + { + //this.TLSStream.BeginAuthenticateAsServer(CertificateHelper.Certificate, true, null, SslProtocols.Tls, SslStrength.All, false, this.OnTLSAuthentication, this.TLSStream); + this.TLSStream.BeginAuthenticateAsServerUsingPsk(PSK_CIPHERS, this.SessionKey, this.OnTLSAuthentication, this.TLSStream); + } + catch (Exception e) + { + Logger.FatalException(e, "BeginAuthenticateAsServerUsingPsk exception: "); + } + Logger.Trace("BeginAuthenticateAsServerUsingPsk complete. Waiting on OnTLSAuthentication callback..."); + } + + void OnTLSAuthentication(IAsyncResult result) + { + try + { + this.TLSStream.EndAuthenticateAsServer(result); + if (this.TLSStream.IsEncrypted) + { + Connection.SetEncrypted(this.TLSStream); + } + } + catch (Exception e) + { + Logger.FatalException(e, "OnTLSAuthentication() exception: "); + } + finally + { + this.Connection.IsTlsHandshaking = false; + this.Connection.IsEncryptRequestSent = false; + } + + // This check does nothing except test whether the underlying SslStreamBase is null which is useless. + //if (!this.TLSStream.IsAuthenticated) return; + + Logger.Trace("TLSStream: authenticated: {0}, signed: {1}, encrypted: {2}, cipher: {3} cipher-strength: {4}, hash algorithm: {5}, hash-strength: {6}, key-exchange algorithm: {7}, key-exchange strength: {8}, protocol: {9}", + this.TLSStream.IsAuthenticated, + this.TLSStream.IsSigned, + this.TLSStream.IsEncrypted, + this.TLSStream.CipherAlgorithm, this.TLSStream.CipherStrength, + this.TLSStream.HashAlgorithm, this.TLSStream.HashStrength, + this.TLSStream.KeyExchangeAlgorithm, this.TLSStream.KeyExchangeStrength, + this.TLSStream.SslProtocol); + + //if (this.TLSStream.LocalCertificate != null) + // Logger.Trace("Local certificate was issued to {0} by {1} and is valid from {2} until {3}.", this.TLSStream.LocalCertificate.Subject, this.TLSStream.LocalCertificate.Issuer, this.TLSStream.LocalCertificate.NotBefore, this.TLSStream.LocalCertificate.NotAfter); + + // Pause briefly to prevent the prevent an encrypted packet from being sent to the client + // before it has a chance to complete the TLS Handshake and switch into encrypted mode. + // Note that this is only an issue when the game client is running on the same machine as Mooege. + Thread.Sleep(100); + + Logger.Trace("Sending logon response:"); + + var logonResponseBuilder = bnet.protocol.authentication.LogonResult.CreateBuilder(); + + logonResponseBuilder.SetAccount(this.Account.BnetEntityId); + logonResponseBuilder.SetErrorCode(0); + + foreach (var gameAccount in this.Account.GameAccounts) + { + logonResponseBuilder.AddGameAccount(gameAccount.BnetEntityId); + } + + this.MakeRPC(() => + bnet.protocol.authentication.AuthenticationClient.CreateStub(this).LogonComplete(null, logonResponseBuilder.Build(), callback => { })); + + Mooege.Core.MooNet.Online.PlayerManager.PlayerConnected(this); + + Mooege.Core.MooNet.Authentication.AuthManager.SendAccountSettings(this); + + // [D3Inferno] + // PSK ciphers do not use certificates. + //if (this.TLSStream.RemoteCertificate != null) // throws exception too, should be fixed /raist. + // Logger.Warn("Remote certificate was issued to {0} by {1} and is valid from {2} until {3}.", this.TLSStream.RemoteCertificate.Subject, this.TLSStream.RemoteCertificate.Issuer, this.TLSStream.RemoteCertificate.NotBefore, this.TLSStream.RemoteCertificate.NotAfter); + + // [D3Inferno] + // Notify that Tls Authentication is complete (but perhaps not successful) so that it can once + // again start listening for client data, but from now on, using the SslStream if successful. + this.Connection.TlsAuthenticationComplete(); + } + + #endregion + + #region text-messaging functionality from server to client + + /// + /// Sends a whisper from toon itself to toon. + /// + /// + public void SendServerWhisper(string text) + { + if (text.Trim() == string.Empty) return; + + var notification = bnet.protocol.notification.Notification.CreateBuilder() + .SetTargetId(this.Account.CurrentGameAccount.BnetEntityId) + .SetType("WHISPER") + .SetSenderId(this.Account.CurrentGameAccount.BnetEntityId) + .SetSenderAccountId(this.Account.BnetEntityId) + .AddAttribute(bnet.protocol.attribute.Attribute.CreateBuilder().SetName("whisper") + .SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetStringValue(text).Build()).Build()).Build(); + + this.MakeRPC(() => bnet.protocol.notification.NotificationListener.CreateStub(this). + OnNotificationReceived(null, notification, callback => { })); + } + + #endregion + + #region current channel + + //TODO: Change to list, client can be in multiple channels now. + public Channel PartyChannel; //Used for all non game related messages + public Channel GameChannel; //Used for all game related messages + + private Channel _currentChannel; + public Channel CurrentChannel + { + get + { + return _currentChannel; + } + set + { + if (value == null) + { + this.Channels.Remove(this._currentChannel.DynamicId); + Logger.Trace("Client removed from CurrentChannel: {0}, setting new CurrentChannel to {1}", this._currentChannel, this.Channels.FirstOrDefault().Value); + this._currentChannel = Channels.FirstOrDefault().Value; + } + else if (!Channels.ContainsKey(value.DynamicId)) + { + this.Channels.Add(value.DynamicId, value); + this._currentChannel = value; + } + else + this._currentChannel = value; + } + } + + public Dictionary Channels = new Dictionary(); + + #endregion + + #region channel-state changes + + public void SendStateChangeNotification(RPCObject target, bnet.protocol.presence.ChannelState state) + { + var channelState = bnet.protocol.channel.ChannelState.CreateBuilder().SetExtension(bnet.protocol.presence.ChannelState.Presence, state); + var notification = bnet.protocol.channel.UpdateChannelStateNotification.CreateBuilder().SetStateChange(channelState).Build(); + + this.MakeTargetedRPC(target, () => + bnet.protocol.channel.ChannelSubscriber.CreateStub(this).NotifyUpdateChannelState(null, notification, callback => { })); + } + + #endregion + + #region MOTD handling + + /// + /// Sends server message of the day text. + /// + public void SendMOTD() + { + if (this.MOTDSent) + return; + + var motd = Config.Instance.MOTD.Trim() != string.Empty ? Config.Instance.MOTD : "Missing MOTD text!"; + + this.SendServerWhisper(motd); + this.MOTDSent = true; + } + + #endregion + + public override string ToString() + { + return String.Format("{{ Client: {0} }}", this.Account == null ? "??" : this.Account.Email); + } + + /// + /// Platform enum for clients. + /// + public enum ClientPlatform + { + Unknown, + Invalid, + Win, + Mac + } + + /// + /// Locale enum for clients. + /// + public enum ClientLocale + { + /// + /// Unknown client locale state. + /// + Unknown, + /// + /// Invalid client locale. + /// + Invalid, + /// + /// Deutsch. + /// + deDE, + /// + /// English (EU) + /// + enGB, + /// + /// English (Singapore) + /// + enSG, + /// + /// English (US) + /// + enUS, + /// + /// Espanol + /// + esES, + /// + /// Espanol (Mexico) + /// + esMX, + /// + /// French + /// + frFR, + /// + /// Italian + /// + itIT, + /// + /// Korean + /// + koKR, + /// + /// Polish + /// + plPL, + /// + /// Portuguese + /// + ptPT, + /// + /// Portuguese (Brazil) + /// + ptBR, + /// + /// Russian + /// + ruRU, + /// + /// Turkish + /// + trTR, + /// + /// Chinese + /// + zhCN, + /// + /// Chinese (Taiwan) + /// + zhTW + } + } +} diff --git a/src/Mooege/Net/MooNet/MooNetRouter.cs b/src/Mooege/Net/MooNet/MooNetRouter.cs new file mode 100644 index 00000000..9c53b4f4 --- /dev/null +++ b/src/Mooege/Net/MooNet/MooNetRouter.cs @@ -0,0 +1,135 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Linq; +using Google.ProtocolBuffers; +using Google.ProtocolBuffers.Descriptors; +using Mooege.Common.Logging; +using Mooege.Core.MooNet.Services; +using Mooege.Net.MooNet.Packets; + +namespace Mooege.Net.MooNet +{ + public static class MooNetRouter + { + private static readonly Logger Logger = LogManager.CreateLogger(); + public const byte ServiceReply = 0xFE; + + public static void Route(ConnectionDataEventArgs e) + { + var client = (MooNetClient)e.Connection.Client; + client.IncomingMooNetStream.Append(e.Data.ToArray()); + + try + { + while (client.IncomingMooNetStream.PacketAvaliable()) + { + Identify(client); + } + } + catch (Exception except) + { + Logger.Error("exception caugth on decoding loop"); + Logger.Error(except.Message); + Logger.Error(except.StackTrace); + } + + client.IncomingMooNetStream.Consume(); + } + + public static void Identify(MooNetClient client) + { + var packet = new PacketIn(client, client.IncomingMooNetStream.GetPacketHeader()); + + if (packet.Header.ServiceId == ServiceReply) + ProcessReply(client, packet); + else + ProcessMessage(client, packet); + } + + private static void ProcessReply(MooNetClient client, PacketIn packet) + { + if (client.RPCCallbacks.ContainsKey(packet.Header.Token)) + { + var callback = client.RPCCallbacks[packet.Header.Token]; + Logger.Trace("RPCReply => {0}", callback.Action.Target); + + callback.Action(packet.ReadMessage(callback.Builder)); + client.RPCCallbacks.Remove(packet.Header.Token); + } + else + { + Logger.Warn("RPC callback contains unexpected token: {0}", packet.Header.Token); + client.Connection.Disconnect(); + } + } + + private static void ProcessMessage(MooNetClient client, PacketIn packet) + { + var service = Service.GetByID(packet.Header.ServiceId); + + if (service == null) + { + Logger.Error("No service exists with id: 0x{0}", packet.Header.ServiceId.ToString("X2")); + return; + } + + var method = service.DescriptorForType.Methods.Single(m => GetMethodId(m) == packet.Header.MethodId); + var proto = service.GetRequestPrototype(method); + var builder = proto.WeakCreateBuilderForType(); + var message = packet.ReadMessage(builder); + + Logger.LogIncomingPacket(message, packet.Header); + + try + { + lock (service) // lock the service so that its in-context client does not get changed.. + { + ((IServerService)service).Client = client; + ((IServerService)service).LastCallHeader = packet.Header; + ((IServerService)service).Status = 0; + service.CallMethod(method, null, message, (msg => SendRPCResponse(client.Connection, packet.Header.Token, msg, ((IServerService)service).Status))); + } + } + catch (NotImplementedException) + { + Logger.Warn("Unimplemented service method: {0}.{1}", service.GetType().Name, method.Name); + } + catch (UninitializedMessageException e) + { + Logger.Debug("Failed to parse message: {0}", e.Message); + } + catch (Exception e) + { + Logger.DebugException(e, string.Empty); + } + } + + public static uint GetMethodId(MethodDescriptor method) + { + return (uint)method.Options[bnet.protocol.Rpc.MethodId.Descriptor]; + } + + private static void SendRPCResponse(IConnection connection, uint token, IMessage message, uint status) + { + var packet = new PacketOut(ServiceReply, 0x0, token, message, status); + connection.Send(packet); + } + } +} diff --git a/src/Mooege/Net/MooNet/MooNetServer.cs b/src/Mooege/Net/MooNet/MooNetServer.cs new file mode 100644 index 00000000..0e5c75cd --- /dev/null +++ b/src/Mooege/Net/MooNet/MooNetServer.cs @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Common.Logging; +using Mooege.Core.MooNet.Online; + +namespace Mooege.Net.MooNet +{ + public sealed class MooNetServer : Server + { + private new static readonly Logger Logger = LogManager.CreateLogger(); // hide the Server.Logger so that tiny-logger can show the actual server as log source. + + public MooNetServer() + { + this.OnConnect += MooNetServer_OnConnect; + this.OnDisconnect += MooNetServer_OnDisconnect; + this.DataReceived += (sender, e) => MooNetRouter.Route(e); + this.DataSent += (sender, e) => { }; + } + + private void MooNetServer_OnConnect(object sender, ConnectionEventArgs e) + { + Logger.Trace("MooNet-Client connected: {0}", e.Connection.ToString()); + e.Connection.Client = new MooNetClient(e.Connection); + } + + private void MooNetServer_OnDisconnect(object sender, ConnectionEventArgs e) + { + var client = ((MooNetClient)e.Connection.Client); + + Logger.Trace("Client disconnected: {0}", e.Connection.ToString()); + if (client.Account != null && client.Account.CurrentGameAccount != null) client.Account.CurrentGameAccount.LoggedInClient = null; + PlayerManager.PlayerDisconnected((MooNetClient)e.Connection.Client); + } + + public override void Run() + { + // we can't listen for port 1119 because D3 and the launcher (agent) communicates on that port through loopback. + // so we change our default port and start D3 with a shortcut like so: + // "F:\Diablo III Beta\Diablo III.exe" -launch -auroraaddress 127.0.0.1:1345 + + var bindIP = NetworkingConfig.Instance.EnableIPv6 ? Config.Instance.BindIPv6 : Config.Instance.BindIP; + + if (!this.Listen(bindIP, Config.Instance.Port)) return; + Logger.Info("MooNet-Server is listening on {0}:{1}...", bindIP, Config.Instance.Port); + } + } +} diff --git a/src/Mooege/Net/MooNet/Packets/PacketIn.cs b/src/Mooege/Net/MooNet/Packets/PacketIn.cs new file mode 100644 index 00000000..7e66354c --- /dev/null +++ b/src/Mooege/Net/MooNet/Packets/PacketIn.cs @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Google.ProtocolBuffers; + +namespace Mooege.Net.MooNet.Packets +{ + public class PacketIn + { + public MooNetClient Client { get; private set; } + + public bnet.protocol.Header Header { get; private set; } + + public PacketIn(MooNetClient client, bnet.protocol.Header header) + { + this.Client = client; + this.Header = header; + } + + //private void Read() + //{ + // this.HeaderSize = (this.Stream.ReadRawByte() << 8) | this.Stream.ReadRawByte(); // header size. + // var headerData = this.Stream.ReadRawBytes(HeaderSize); // header data. + // this.Header = bnet.protocol.Header.ParseFrom(headerData); // parse header. + //} + + public IMessage ReadMessage(IBuilder builder) + { + byte[] data = Client.IncomingMooNetStream.GetPacketData((int)this.Header.Size); + + return builder.WeakMergeFrom(ByteString.CopyFrom(data)).WeakBuild(); + } + + public byte[] GetPayload(CodedInputStream stream) + { + var data = Client.IncomingMooNetStream.GetPacketData((int)this.Header.Size); + return data; + } + + public override string ToString() + { + //return string.Format("[S]: 0x{0}, [M]: 0x{1}, [R]: 0x{2}, [O]: 0x{3}", this.ServiceId.ToString("X2"), this.MethodId.ToString("X2"), this.RequestId.ToString("X2"), this.ObjectId.ToString("X2")); + return this.Header.ToString(); + } + } +} diff --git a/src/Mooege/Net/MooNet/Packets/PacketOut.cs b/src/Mooege/Net/MooNet/Packets/PacketOut.cs new file mode 100644 index 00000000..3e9dee96 --- /dev/null +++ b/src/Mooege/Net/MooNet/Packets/PacketOut.cs @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.IO; +using Google.ProtocolBuffers; +using Mooege.Common.Logging; + +namespace Mooege.Net.MooNet.Packets +{ + public class PacketOut + { + public byte[] Data { get; private set; } + private static readonly Logger Logger = LogManager.CreateLogger(); + + public PacketOut(byte serviceId, uint methodId, uint token, IMessage message, uint status) + : this(serviceId, methodId, token, 0x0, message, status) + { + } + + public PacketOut(byte serviceId, uint methodId, uint token, ulong objectId, IMessage message, uint status = 0) + { + var builder = bnet.protocol.Header.CreateBuilder(); + + if (status > 0) + { + builder.SetServiceId(MooNetRouter.ServiceReply) + .SetStatus(status); + } + else + builder.SetServiceId(serviceId); + + builder.SetToken(token) // requestId. + .SetSize((uint)message.SerializedSize); + + if (serviceId != MooNetRouter.ServiceReply) + builder.SetMethodId(methodId); + + if (serviceId != MooNetRouter.ServiceReply && objectId != 0x0) + builder.SetObjectId(objectId); + + var header = builder.Build(); + var headerSize = (short)(header.SerializedSize); + + using (var stream = new MemoryStream()) + { + var output = CodedOutputStream.CreateInstance(stream); + + output.WriteRawByte((byte)(headerSize >> 8)); + output.WriteRawByte((byte)((headerSize & 0xff))); + + header.WriteTo(output); + message.WriteTo(output); + + output.Flush(); + this.Data = stream.ToArray(); + Logger.LogOutgoingPacket(message, header); + } + } + } +} diff --git a/src/Mooege/Net/MooNet/RPC/RPCCallback.cs b/src/Mooege/Net/MooNet/RPC/RPCCallback.cs new file mode 100644 index 00000000..e117945c --- /dev/null +++ b/src/Mooege/Net/MooNet/RPC/RPCCallback.cs @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using Google.ProtocolBuffers; + +namespace Mooege.Net.MooNet.RPC +{ + public class RPCCallback + { + public Action Action { get; private set; } + public IBuilder Builder { get; private set; } + + public RPCCallback(Action action, IBuilder builder) + { + this.Action = action; + this.Builder = builder; + } + } +} diff --git a/src/Mooege/Net/NATConfig.cs b/src/Mooege/Net/NATConfig.cs new file mode 100644 index 00000000..d6b08162 --- /dev/null +++ b/src/Mooege/Net/NATConfig.cs @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Common.Config; + +namespace Mooege.Net +{ + public sealed class NATConfig : Config + { + public bool Enabled { get { return this.GetBoolean("Enabled", true); } set { this.Set("Enabled", value); } } + public string PublicIP { get { return this.GetString("PublicIP", "0.0.0.0"); } set { this.Set("PublicIP", value); } } + + private static readonly NATConfig _instance = new NATConfig(); + public static NATConfig Instance { get { return _instance; } } + private NATConfig() : base("NAT") { } + } +} diff --git a/src/Mooege/Net/NetworkingConfig.cs b/src/Mooege/Net/NetworkingConfig.cs new file mode 100644 index 00000000..016d72d2 --- /dev/null +++ b/src/Mooege/Net/NetworkingConfig.cs @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using Mooege.Common.Config; + +namespace Mooege.Net +{ + public sealed class NetworkingConfig : Config + { + public bool EnableIPv6 { get { return this.GetBoolean("EnableIPv6", true); } set { this.Set("EnableIPv6", value); } } + + private static readonly NetworkingConfig _instance = new NetworkingConfig(); + public static NetworkingConfig Instance { get { return _instance; } } + private NetworkingConfig() : base("Networking") { } + } +} diff --git a/src/Mooege/Net/Server.cs b/src/Mooege/Net/Server.cs new file mode 100644 index 00000000..feb1cd1d --- /dev/null +++ b/src/Mooege/Net/Server.cs @@ -0,0 +1,493 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.Sockets; +using Mooege.Common.Extensions; +using Mooege.Common.Logging; + +namespace Mooege.Net +{ + public class Server : IDisposable + { + public bool IsListening { get; private set; } + public int Port { get; private set; } + + protected Socket Listener; + // protected Dictionary Connections = new Dictionary(); + protected List Connections = new List(); + protected object ConnectionLock = new object(); + + public delegate void ConnectionEventHandler(object sender, ConnectionEventArgs e); + public delegate void ConnectionDataEventHandler(object sender, ConnectionDataEventArgs e); + + public event ConnectionEventHandler OnConnect; + public event ConnectionEventHandler OnDisconnect; + public event ConnectionDataEventHandler DataReceived; + public event ConnectionDataEventHandler DataSent; + + protected static readonly Logger Logger = LogManager.CreateLogger(); + private bool _disposed; + + public virtual void Run() { } + + #region listener + + public virtual bool Listen(string bindIP, int port) + { + // Check if the server has been disposed. + if (_disposed) throw new ObjectDisposedException(this.GetType().Name, "Server has been disposed."); + + // Check if the server is already listening. + if (IsListening) throw new InvalidOperationException("Server is already listening."); + + // -------------------- + // Note on IPv6 support + // -------------------- + // First and foremost IPv6 support is EXPERIMENTAL! + // Currently we use the approach to create a dual-socket which enables both IPv6 and IPv4 over the same socket + // though not all operating systems support this by default. Windows Vista and 7 known to support this where Windows XP does not. + // Also some linux distros and most BSD ones doesn't support this by default. + // We've to eventually create two different sockets, one for IPv4 and one for IPv6 for wide-scale support for all operating systems. /raist + // Still as D3 doesn't support IPv6 addresses to be returned with GameFactory services' bnet.protocol.game_master.ConnectInfo, + // IPv6 only works for moonet right now. When Blizzard fixes D3 client for so, we'll be also supporting IPv6 in game-server. + + // Create new TCP socket and set socket options. + Listener = new Socket(NetworkingConfig.Instance.EnableIPv6 ? AddressFamily.InterNetworkV6 : AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); + + // Setup our options: + // * NoDelay - true - don't use packet coalescing + // * DontLinger - true - don't keep sockets around once they've been disconnected + // * IPv6Only - false - create a dual-socket that both supports IPv4 and IPv6 - check the IPv6 support note above. + Listener.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.NoDelay, true); + Listener.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.DontLinger, true); +#if !__MonoCS__ + if (NetworkingConfig.Instance.EnableIPv6) Listener.SetSocketOption(SocketOptionLevel.IPv6, SocketOptionName.IPv6Only, false); +#endif + + try + { + // Bind. + Listener.Bind(new IPEndPoint(IPAddress.Parse(bindIP), port)); + this.Port = port; + } + catch (SocketException) + { + Logger.Fatal(string.Format("{0} can not bind on {1}, server shutting down..", this.GetType().Name, bindIP)); + this.Shutdown(); + return false; + } + + // Start listening for incoming connections. + Listener.Listen(10); + IsListening = true; + + // Begin accepting any incoming connections asynchronously. + Listener.BeginAccept(AcceptCallback, null); + + return true; + } + + private void AcceptCallback(IAsyncResult result) + { + if (Listener == null) return; + + try + { + var socket = Listener.EndAccept(result); // Finish accepting the incoming connection. + var connection = new Connection(this, socket); // Add the new connection to the dictionary. + + lock (ConnectionLock) Connections.Add(connection); // add the connection to list. + + OnClientConnection(new ConnectionEventArgs(connection)); // Raise the OnConnect event. + + connection.BeginReceive(ReceiveCallback, connection); // Begin receiving on the new connection connection. + Listener.BeginAccept(AcceptCallback, null); // Continue receiving other incoming connection asynchronously. + } + catch (NullReferenceException) { } // we recive this after issuing server-shutdown, just ignore it. + catch (Exception e) + { + Logger.DebugException(e, "AcceptCallback"); + } + } + + private void ReceiveCallback(IAsyncResult result) + { + var connection = result.AsyncState as Connection; // Get the connection connection passed to the callback. + if (connection == null) return; + + try + { + var bytesRecv = connection.EndReceive(result); // Finish receiving data from the socket. + + if (bytesRecv > 0) + { + OnDataReceived(new ConnectionDataEventArgs(connection, connection.RecvBuffer.Enumerate(0, bytesRecv))); // Raise the DataReceived event. + + // [D3Inferno] + // Only receive again if we did not just send the EncryptRequest. + // If we did, then the current received packet should be the EncryptRequest NoData service response. + // + // WARNING: Probably need to explicitly test for this packet since we can get data out-of-order from the client. + // However, I would imagine the D3 game client has to do a flush before sending the EncryptRequest response, + // otherwise, anything sent after that would break since it would be handled by the TLS layer which would throw + // some kind of SSL error (most likely invalid version). + // + if ((connection.IsEncryptRequestSent) && (!connection.IsTlsHandshaking)) + { + Logger.Trace("Waiting for the EncryptRequest NoData service response from the client."); + + // [D3Inferno] + // We need to receive the EncryptRequest NoData service response from the client. + // However, the packet containing the response can also contain the Tls client_hello message. + // If we read it from the Socket, Tls Authentication will hang as the server will wait forever. + // So process just the next incoming message as a synchronous call. + if (connection.IsConnected) + this.ReceiveEncryptRequestServiceResponse(connection); + } + else if (!connection.IsTlsHandshaking) + { + // Begin receiving again on the socket, if it is connected. + if (connection.IsConnected) + connection.BeginReceive(ReceiveCallback, connection); + else + Logger.Trace("Connection closed:" + connection.Client); + } + else + { + Logger.Trace("No longer receiving unencrypted data."); + } + } + else RemoveConnection(connection, true); // Connection was lost. + } + catch (SocketException e) + { + RemoveConnection(connection, true); // An error occured while receiving, connection has disconnected. + Logger.DebugException(e, "ReceiveCallback"); + } + catch (Exception e) + { + RemoveConnection(connection, true); // An error occured while receiving, the connection may have been disconnected. + Logger.DebugException(e, "ReceiveCallback"); + } + } + + // [D3Inferno] + // Tls authentication is complete, although it may have failed. + // Regardless, start receiving data again. + // If Tls was successful, it will now be handled by the SslStream. + public void TlsAuthenticationComplete(Connection connection) + { + Logger.Trace("TlsAuthenticationComplete"); + + // Begin receiving again on the socket, if it is connected. + if (connection.IsConnected) + { + try + { + connection.BeginReceive(ReceiveCallback, connection); + } + catch (Exception e) + { + RemoveConnection(connection, true); // An error occured while receiving, the connection may have been disconnected. + if (e is System.IO.IOException) + Logger.Trace("{0} unexpectedly closed connection, client is not patched.", connection.Client); + else + Logger.DebugException(e, "TlsAuthenticationComplete()"); + } + } + } + + public virtual int Send(Connection connection, IEnumerable data, SocketFlags flags) + { + if (connection == null) throw new ArgumentNullException("connection"); + if (data == null) throw new ArgumentNullException("data"); + + var buffer = data.ToArray(); + return Send(connection, buffer, 0, buffer.Length, SocketFlags.None); + } + + public virtual int Send(Connection connection, byte[] buffer, int start, int count, SocketFlags flags) + { + if (connection == null) throw new ArgumentNullException("connection"); + if (buffer == null) throw new ArgumentNullException("buffer"); + + var totalBytesSent = 0; + var bytesRemaining = buffer.Length; + + try + { + while (bytesRemaining > 0) // Ensure we send every byte. + { + // [D3Inferno] + // Use Connection wrapper to send the data so that it can be sent either over + // the normal NetworkStream (prior to Tls Authentication) or over the encrypted + // SslStream. + // Send the remaining data. + //int bytesSent = connection.Socket.Send(buffer, totalBytesSent, bytesRemaining, flags); + + int bytesSent = connection._Send(buffer, totalBytesSent, bytesRemaining, flags); + + if (bytesSent > 0) + OnDataSent(new ConnectionDataEventArgs(connection, buffer.Enumerate(totalBytesSent, bytesSent))); // Raise the Data Sent event. + + // Decrement bytes remaining and increment bytes sent. + bytesRemaining -= bytesSent; + totalBytesSent += bytesSent; + } + } + catch (SocketException) + { + RemoveConnection(connection, true); // An error occured while sending, connection has disconnected. + } + catch (Exception e) + { + RemoveConnection(connection, true); // An error occured while sending, it is possible that the connection has a problem. + Logger.DebugException(e, "Send"); + } + + return totalBytesSent; + } + + #endregion + + #region Encryption Support + + // [D3Inferno] + // This method is called once + private void ReceiveEncryptRequestServiceResponse(IConnection connection) + { + if (connection == null) return; + + int totalBytesRevc = 0; + int pos = 0; + + int bytesRecv = connection.Receive(pos, 2); + totalBytesRevc += bytesRecv; + if (bytesRecv != 2) + throw new Exception("Server Socket could not read header size bytes for EncryptRequest Service Response."); + + pos += 2; + int headerSize = (connection.RecvBuffer[0] << 8) | connection.RecvBuffer[1]; + + bytesRecv = connection.Receive(pos, headerSize); + totalBytesRevc += bytesRecv; + if (bytesRecv != headerSize) + throw new Exception("Server Socket could not read header bytes (size = " + headerSize + ") for EncryptRequest Service Response."); + + // Create the bnet.protocol.Header object. + byte[] headerBytes = new byte[headerSize]; + Array.Copy(connection.RecvBuffer, pos, headerBytes, 0, headerSize); + var headerData = bnet.protocol.Header.ParseFrom(headerBytes); + + pos += headerSize; + bytesRecv = connection.Receive(pos, (int)headerData.Size); + totalBytesRevc += bytesRecv; + if (bytesRecv != headerData.Size) + throw new Exception("Server Socket could not read data (size = " + headerData.Size + ") for EncryptRequest Service Response."); + + // We could verify that the packet corresponds to EncryptRequest service response. + // However, this would require looking into the MooNetClient's RPCCallbacks for the token, + // and then verifying that it is of the correct type. + + if (totalBytesRevc > 0) + { + OnDataReceived(new ConnectionDataEventArgs(connection, connection.RecvBuffer.Enumerate(0, totalBytesRevc))); // Raise the DataReceived event. + } + } + + #endregion + + #region service methods + + public IEnumerable GetConnections() + { + lock (ConnectionLock) + foreach (IConnection connection in Connections) + yield return connection; + } + + #endregion + + #region events + + protected virtual void OnClientConnection(ConnectionEventArgs e) + { + var handler = OnConnect; + if (handler != null) handler(this, e); + } + + protected virtual void OnClientDisconnect(ConnectionEventArgs e) + { + var handler = OnDisconnect; + if (handler != null) handler(this, e); + } + + protected virtual void OnDataReceived(ConnectionDataEventArgs e) + { + var handler = DataReceived; + if (handler != null) handler(this, e); + } + + protected virtual void OnDataSent(ConnectionDataEventArgs e) + { + var handler = DataSent; + if (handler != null) handler(this, e); + } + + #endregion + + #region disconnect & shutdown handlers + + public virtual void DisconnectAll() + { + lock (ConnectionLock) + { + foreach (var connection in Connections.Cast()) // Check if the connection is connected. + { + // Disconnect and raise the OnDisconnect event. + connection.Disconnect(); + // connection.Socket.Disconnect(false); + OnClientDisconnect(new ConnectionEventArgs(connection)); + } + + Connections.Clear(); + } + } + + public virtual void Disconnect(Connection connection) + { + // if (connection == null) throw new ArgumentNullException("connection"); + // if (!connection.IsConnected) return; + + if (connection == null) + return; + + connection.Disconnect(); + + // connection.Socket.Disconnect(false); + _RemoveConnection(connection, true); + } + + private void _Disconnect(Connection connection) + { + if (connection == null) + return; + + connection.Disconnect(); + } + + private void RemoveConnection(Connection connection, bool raiseEvent) + { + if (connection == null) + return; + + // [D3Inferno] + // The whole Server.Disconnect vs Server.RemoveConnection vs Connection.Disconnect is a complete mess. + // Trying to modify the code so everything gets cleaned up properly without causing an infinite recursion. + connection.Disconnect(); + + // Remove the connection from the dictionary and raise the OnDisconnection event. + lock (ConnectionLock) + { + if (Connections.Contains(connection)) + Connections.Remove(connection); + } + + if (raiseEvent) + NotifyRemoveConnection(connection); + } + + private void _RemoveConnection(Connection connection, bool raiseEvent) + { + if (connection == null) + return; + + // Remove the connection from the dictionary and raise the OnDisconnection event. + lock (ConnectionLock) + { + if (Connections.Contains(connection)) + Connections.Remove(connection); + } + + if (raiseEvent) + NotifyRemoveConnection(connection); + } + + private void NotifyRemoveConnection(Connection connection) + { + OnClientDisconnect(new ConnectionEventArgs(connection)); + } + + public virtual void Shutdown() + { + // Check if the server has been disposed. + if (_disposed) throw new ObjectDisposedException(this.GetType().Name, "Server has been disposed."); + + // Check if the server is actually listening. + if (!IsListening) return; + + // Close the listener socket. + if (Listener != null) + { + Listener.Close(); + Listener = null; + } + + // Disconnect the clients. + foreach (var connection in this.Connections.ToList()) // use ToList() so we don't get collection modified exception there + { + connection.Disconnect(); + } + + Listener = null; + IsListening = false; + } + + #endregion + + #region de-ctor + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (_disposed) return; + + if (disposing) + { + Shutdown(); // Close the listener socket. + DisconnectAll(); // Disconnect all users. + } + + // Dispose of unmanaged resources here. + + _disposed = true; + } + + #endregion + } +} + diff --git a/src/Mooege/Net/Utils.cs b/src/Mooege/Net/Utils.cs new file mode 100644 index 00000000..e7f950e4 --- /dev/null +++ b/src/Mooege/Net/Utils.cs @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Net; +using Mooege.Net.MooNet; + +namespace Mooege.Net +{ + public static class Utils + { + public static string GetGameServerIPForClient(MooNetClient client) + { + if (!NATConfig.Instance.Enabled) + { + // if NAT is not enabled, just return bnetclient's localendpoint address. + // Note: D3 client doesn't seem to accept IPv6 addresses as of patch 13! + // read more on IPv6 in server.cs. /raist. + return client.Connection.LocalEndPoint.Address.ToString(); + } + else + { + return client.Connection.LocalEndPoint.Address.ToString() == "127.0.0.1" + ? client.Connection.LocalEndPoint.ToString() + : NATConfig.Instance.PublicIP; // if client is not connected over localhost, send him public-ip. + + // Known problems: + // If user enables NAT, LAN-clients (and even local-computer if d3 is configured to use lan-ip) will not able to connect in gs. + // That needs a full implementation similar to pvpgn where we currently pretty miss the time for /raist. + } + } + } +} diff --git a/src/Mooege/Net/WebServices/Config.cs b/src/Mooege/Net/WebServices/Config.cs new file mode 100644 index 00000000..a302accf --- /dev/null +++ b/src/Mooege/Net/WebServices/Config.cs @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace Mooege.Net.WebServices +{ + public sealed class Config : Common.Config.Config + { + public bool Enabled { get { return this.GetBoolean("Enabled", true); } set { this.Set("Enabled", value); } } + public string Address { get { return this.GetString("Address", ""); } set { this.Set("Address", value); } } + + private static readonly Config _instance = new Config(); + public static Config Instance { get { return _instance; } } + private Config() : base("WebServices") { } + } +} diff --git a/src/Mooege/Net/WebServices/IWebService.cs b/src/Mooege/Net/WebServices/IWebService.cs new file mode 100644 index 00000000..2dbb571a --- /dev/null +++ b/src/Mooege/Net/WebServices/IWebService.cs @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.ServiceModel; +using System.Text; + +namespace Mooege.Net.WebServices +{ + /// + /// Interface for web-services. + /// + public interface IWebService + { } +} diff --git a/src/Mooege/Net/WebServices/ServiceManager.cs b/src/Mooege/Net/WebServices/ServiceManager.cs new file mode 100644 index 00000000..19889444 --- /dev/null +++ b/src/Mooege/Net/WebServices/ServiceManager.cs @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.ServiceModel; +using System.ServiceModel.Description; +using Mooege.Common.Logging; + +namespace Mooege.Net.WebServices +{ + public class ServiceManager + { + private static readonly Logger Logger = LogManager.CreateLogger(); + + private readonly List _serviceHosts = new List(); + private readonly Dictionary _webServices = new Dictionary(); + + public ServiceManager() + { + this.LoadServices(); + } + + private void LoadServices() + { + foreach (var type in Assembly.GetExecutingAssembly().GetTypes().Where(type => type.GetInterface("IWebService") != null)) + { + object[] attributes = type.GetCustomAttributes(typeof(ServiceContractAttribute), true); // get the attributes of the packet. + if (attributes.Length == 0) return; + + _webServices.Add(type, (ServiceContractAttribute)attributes[0]); + } + } + + public void Run() + { + foreach (var pair in this._webServices) + { + var uri = new Uri(string.Format("{0}/{1}", Config.Instance.Address, pair.Value.Name)); + var serviceHost = new ServiceHost(pair.Key, uri); + + serviceHost.Description.Behaviors.Add(new ServiceMetadataBehavior { HttpGetEnabled = true }); + var debugBehavior = (ServiceDebugBehavior)serviceHost.Description.Behaviors[typeof(ServiceDebugBehavior)]; + debugBehavior.IncludeExceptionDetailInFaults = true; + + serviceHost.AddServiceEndpoint(typeof(IMetadataExchange), new BasicHttpBinding(), "Mex"); + serviceHost.AddServiceEndpoint(pair.Key, new BasicHttpBinding(), ""); + + serviceHost.Open(); + this._serviceHosts.Add(serviceHost); + } + + Logger.Info("Loaded web-services manager with {0} services..", this._webServices.Count); + } + } +} diff --git a/src/Mooege/Program.cs b/src/Mooege/Program.cs new file mode 100644 index 00000000..d2cd629f --- /dev/null +++ b/src/Mooege/Program.cs @@ -0,0 +1,313 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Globalization; +using System.Reflection; +using System.Threading; +using Mooege.Common.Logging; +using Mooege.Common.MPQ; +using Mooege.Common.Storage; +using Mooege.Common.Storage.AccountDataBase.Entities; +using Mooege.Common.Versions; +using Mooege.Core.GS.Items; +using Mooege.Core.MooNet.Accounts; +using Mooege.Core.MooNet.Commands; +using Mooege.Net; +using Mooege.Net.GS; +using Mooege.Net.MooNet; +using Mooege.Core.MooNet.Achievement; +using Mooege.Net.WebServices; +using NHibernate.Linq; +using NHibernate.Util; +using Environment = System.Environment; + +namespace Mooege +{ + /// + /// Contains mooege's startup code. + /// + public static class Program + { + /// + /// Used for uptime calculations. + /// + public static readonly DateTime StartupTime = DateTime.Now; // used for uptime calculations. + + /// + /// MooNetServer instance. + /// + public static MooNetServer MooNetServer; + + /// + /// GameServer instance. + /// + public static GameServer GameServer; + + /// + /// MooNetServer thread. + /// + public static Thread MooNetServerThread; + + /// + /// GameServer thread. + /// + public static Thread GameServerThread; + + private static readonly Logger Logger = LogManager.CreateLogger(); // logger instance. + + /// + /// The main entry point for the application. + /// + public static void Main(string[] args) + { + AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler; // Watch for any unhandled exceptions. + Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; // Use invariant culture - we have to set it explicitly for every thread we create to prevent any mpq-reading problems (mostly because of number formats). + + Console.ForegroundColor = ConsoleColor.Yellow; + PrintBanner(); // print ascii banner. + PrintLicense(); // print license text. + Console.ResetColor(); // reset color back to default. + + InitLoggers(); // init logging facility. + + Logger.Info("mooege v{0} warming-up..", Assembly.GetExecutingAssembly().GetName().Version); + Logger.Info("Required client version: {0}.", VersionInfo.MooNet.RequiredClientVersion); + + // init openssl & wrapper. + try + { + Logger.Info("Found OpenSSL version {0}.", OpenSSL.Core.Version.Library.ToString()); + } + catch (Exception e) + { + Logger.ErrorException(e, "OpenSSL init error."); + Console.ReadLine(); + return; + } + + // prefill the database. + Common.Storage.AccountDataBase.SessionProvider.RebuildSchema(); + if (!DBSessions.AccountSession.Query().Any()) + { + Logger.Info("Initing new database, creating first owner account (test@,123456)"); + var account = AccountManager.CreateAccount("test@", "123456", "test", Account.UserLevels.Owner); + var gameAccount = GameAccountManager.CreateGameAccount(account); + account.DBAccount.DBGameAccounts.Add(gameAccount.DBGameAccount); + account.SaveToDB(); + } + + // init MPQStorage. + if (!MPQStorage.Initialized) + { + Logger.Fatal("Cannot run servers as MPQStorage failed initialization."); + Console.ReadLine(); + return; + } + + // load item database. + Logger.Info("Loading item database.."); + Logger.Trace("Item database loaded with a total of {0} item definitions.", ItemGenerator.TotalItems); + + // load achievements database. + Logger.Info("Loading achievements database.."); + Logger.Trace("Achievement file parsed with a total of {0} achievements and {1} criteria in {2} categories.", + AchievementManager.TotalAchievements, AchievementManager.TotalCriteria, AchievementManager.TotalCategories); + + + Logger.Info("Type '!commands' for a list of available commands."); + + StartupServers(); // startup the servers + } + + /// + /// Unhandled exception emitter. + /// + /// + /// + private static void UnhandledExceptionHandler(object sender, UnhandledExceptionEventArgs e) + { + var ex = e.ExceptionObject as Exception; + + if (e.IsTerminating) + Logger.FatalException(ex, "Mooege terminating because of unhandled exception."); + else + Logger.ErrorException(ex, "Caught unhandled exception."); + + Console.ReadLine(); + } + + #region server startup managment + + private static void StartupServers() + { + if(NetworkingConfig.Instance.EnableIPv6) + Logger.Info("IPv6 enabled!"); + + StartMooNet(); // start moonet. + StartGS(); // start game-server. + + if(Net.WebServices.Config.Instance.Enabled) // if webservices are enabled, + StartWebServices(); // start them. + + while (true) // idle loop & command parser + { + var line = Console.ReadLine(); + CommandManager.Parse(line); + } + } + + public static void Shutdown() + { + if (MooNetServer != null) + { + Logger.Warn("Shutting down MooNet-Server.."); + MooNetServer.Shutdown(); + } + + if (GameServer != null) + { + Logger.Warn("Shutting down Game-Server.."); + GameServer.Shutdown(); + } + + // todo: stop webservices. + + Environment.Exit(0); + } + + public static bool StartMooNet() + { + if (MooNetServer != null) return false; + + MooNetServer = new MooNetServer(); + MooNetServerThread = new Thread(MooNetServer.Run) {IsBackground = true, CurrentCulture = CultureInfo.InvariantCulture}; + MooNetServerThread.Start(); + return true; + } + + public static bool StopMooNet() + { + if (MooNetServer == null) return false; + + Logger.Warn("Stopping MooNet-Server.."); + MooNetServer.Shutdown(); + MooNetServerThread.Abort(); + MooNetServer = null; + return true; + } + + public static bool StartGS() + { + if (GameServer != null) return false; + + GameServer = new GameServer(); + GameServerThread = new Thread(GameServer.Run) { IsBackground = true, CurrentCulture = CultureInfo.InvariantCulture }; + GameServerThread.Start(); + + return true; + } + + public static bool StopGS() + { + if (GameServer == null) return false; + + Logger.Warn("Stopping Game-Server.."); + GameServer.Shutdown(); + GameServerThread.Abort(); + GameServer = null; + + return true; + } + + public static bool StartWebServices() + { + Environment.SetEnvironmentVariable("MONO_STRICT_MS_COMPLIANT", "yes"); // we need this here to make sure web-services also work under mono too. /raist. + + var webservices = new ServiceManager(); + webservices.Run(); + + return true; + } + + #endregion + + #region logging facility + + /// + /// Inits logging facility and loggers. + /// + private static void InitLoggers() + { + LogManager.Enabled = true; // enable logger by default. + + foreach (var targetConfig in LogConfig.Instance.Targets) + { + if (!targetConfig.Enabled) + continue; + + LogTarget target = null; + switch (targetConfig.Target.ToLower()) + { + case "console": + target = new ConsoleTarget(targetConfig.MinimumLevel, targetConfig.MaximumLevel, + targetConfig.IncludeTimeStamps); + break; + case "file": + target = new FileTarget(targetConfig.FileName, targetConfig.MinimumLevel, + targetConfig.MaximumLevel, targetConfig.IncludeTimeStamps, + targetConfig.ResetOnStartup); + break; + } + + if (target != null) + LogManager.AttachLogTarget(target); + } + } + + #endregion + + #region console banners + + /// + /// Prints an info banner. + /// + private static void PrintBanner() + { + Console.WriteLine(@" _ __ ___ ___ ___ ___ __ _ ___ "); + Console.WriteLine(@" | '_ ` _ \ / _ \ / _ \ / _ \ / _` | / _ \"); + Console.WriteLine(@" | | | | | || (_) || (_) || __/| (_| || __/"); + Console.WriteLine(@" |_| |_| |_| \___/ \___/ \___| \__, | \___|"); + Console.WriteLine(@" |___/ "); + Console.WriteLine(); + } + + /// + /// Prints a copyright banner. + /// + private static void PrintLicense() + { + Console.WriteLine("Copyright (C) 2011 - 2012, mooege project"); + Console.WriteLine("mooege comes with ABSOLUTELY NO WARRANTY."); + Console.WriteLine("This is free software, and you are welcome to redistribute it under certain conditions; see the LICENSE file for details."); + Console.WriteLine(); + } + + #endregion + } +} diff --git a/src/Mooege/Properties/AssemblyInfo.cs b/src/Mooege/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..f83f7b0b --- /dev/null +++ b/src/Mooege/Properties/AssemblyInfo.cs @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2011 - 2012 mooege project - http://www.mooege.org + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Reflection; +using System.Runtime.CompilerServices; +using Mooege.Common.Versions; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. + +[assembly: AssemblyTitle("mooege")] +[assembly: AssemblyDescription("mooege - an educational game server emulator.")] +#if DEBUG +[assembly: AssemblyConfiguration("Debug")] +#else +[assembly: AssemblyConfiguration("Release")] +#endif +[assembly: AssemblyCompany("mooege.org")] +[assembly: AssemblyProduct("mooege")] +[assembly: AssemblyCopyright("Copyright © 2011 - 2012, mooege project.")] +[assembly: AssemblyTrademark("mooege")] +[assembly: AssemblyCulture("")] + +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// The form "{Major}.{Minor}.*" will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}.*" will update just the revision. + +// Set the assembly version from VersionInfo.cs file. +[assembly: AssemblyVersion(VersionInfo.Assembly.Version)] + +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. + +//[assembly: AssemblyDelaySign(false)] +//[assembly: AssemblyKeyFile("")] + diff --git a/src/Mooege/app.config b/src/Mooege/app.config new file mode 100644 index 00000000..2c5e50ac --- /dev/null +++ b/src/Mooege/app.config @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/tools/GameServer/GSPacketDumper/GSPacketDumper.csproj b/src/tools/GameServer/GSPacketDumper/GSPacketDumper.csproj new file mode 100644 index 00000000..f625f27f --- /dev/null +++ b/src/tools/GameServer/GSPacketDumper/GSPacketDumper.csproj @@ -0,0 +1,119 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {F8B009EE-3628-4A7A-B0BD-E131DDE0DC66} + Exe + Properties + GSPacketDumper + GSPacketDumper + v4.0 + 512 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\..\..\dep\protobuf-csharp\Google.ProtocolBuffers.dll + + + + + + + + + + + + + + + + + False + ..\..\..\..\dep\pcapnet\PcapDotNet.Core.dll + + + False + ..\..\..\..\dep\pcapnet\PcapDotNet.Packets.dll + + + + + + + + + + False + Microsoft .NET Framework 4 Client Profile %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + false + + + False + Windows Installer 3.1 + true + + + + + + + + {41BB6B2D-BD3F-42B6-860C-D21DC74B33CD} + Mooege-VS2010 + + + \ No newline at end of file diff --git a/src/tools/GameServer/GSPacketDumper/PacketReader.cs b/src/tools/GameServer/GSPacketDumper/PacketReader.cs new file mode 100644 index 00000000..494160e6 --- /dev/null +++ b/src/tools/GameServer/GSPacketDumper/PacketReader.cs @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Linq; +using Mooege.Common.Logging; +using Mooege.Net.GS.Message; +using PcapDotNet.Core; +using PcapDotNet.Packets; + +namespace GSPacketDumper +{ + public static class PacketReader + { + private static readonly Logger Logger = LogManager.CreateLogger(); + + private static readonly GameBitBuffer IncomingBuffer = new GameBitBuffer(512); + private static readonly GameBitBuffer OutgoingBuffer = new GameBitBuffer(512); + + private const string GameServerRange = "12.129.237.0/24"; + private const string GameServerIPPattern = "12.129.237"; + + public static void Read(string file) + { + var selectedDevice = new OfflinePacketDevice(file); + + // Open the capture file + using (PacketCommunicator communicator = + selectedDevice.Open(65536, // portion of the packet to capture + // 65536 guarantees that the whole packet will be captured on all the link layers + PacketDeviceOpenAttributes.Promiscuous, // promiscuous mode + 1000)) // read timeout + { + communicator.SetFilter("tcp port 1119 and ip net " + GameServerRange); + + // Read and dispatch packets until EOF is reached + communicator.ReceivePackets(0, DispatcherHandler); + } + } + + private static void HandleIncomingPacket(Packet packet) + { + IncomingBuffer.AppendData(packet.Ethernet.IpV4.Tcp.Payload.ToArray()); + + while (IncomingBuffer.IsPacketAvailable()) + { + int end = IncomingBuffer.Position; + end += IncomingBuffer.ReadInt(32) * 8; + while ((end - IncomingBuffer.Position) >= 9) + { + var msg = IncomingBuffer.ParseMessage(); + if (msg == null) continue; + + Logger.LogIncomingPacket(msg); + } + + IncomingBuffer.Position = end; + } + + IncomingBuffer.ConsumeData(); + } + + private static void HandleOutgoingPacket(Packet packet) + { + OutgoingBuffer.AppendData(packet.Ethernet.IpV4.Tcp.Payload.ToArray()); + + while (OutgoingBuffer.IsPacketAvailable()) + { + int end = OutgoingBuffer.Position; + end += OutgoingBuffer.ReadInt(32) * 8; + while ((end - OutgoingBuffer.Position) >= 9) + { + var msg = OutgoingBuffer.ParseMessage(); + if (msg == null) continue; + + Logger.LogOutgoingPacket(msg); + } + + OutgoingBuffer.Position = end; + } + + OutgoingBuffer.ConsumeData(); + } + + private static void DispatcherHandler(Packet packet) + { + if (packet.Ethernet.IpV4.Tcp == null) return; + if (packet.Ethernet.IpV4.Tcp.Payload == null) return; + if (packet.Ethernet.IpV4.Tcp.Payload.Length == 0) return; + + Console.Write("."); + + if (packet.Ethernet.IpV4.Destination.ToString().StartsWith(GameServerIPPattern)) HandleIncomingPacket(packet); + else HandleOutgoingPacket(packet); + } + } +} diff --git a/src/tools/GameServer/GSPacketDumper/Program.cs b/src/tools/GameServer/GSPacketDumper/Program.cs new file mode 100644 index 00000000..1445ad11 --- /dev/null +++ b/src/tools/GameServer/GSPacketDumper/Program.cs @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.IO; +using Mooege.Common.Logging; + +namespace GSPacketDumper +{ + internal class Program + { + private static readonly Logger Logger = LogManager.CreateLogger(); + + private static void Main(string[] args) + { + PrintLicense(); + + // Check command line + if (args.Length != 1) + { + Console.WriteLine("usage: " + Environment.GetCommandLineArgs()[0] + " "); + return; + } + + if (!File.Exists(args[0])) + { + Console.WriteLine("Input file: {0} not found", args[0]); + Console.ReadLine(); + return; + } + + var outputFile = Path.GetFileName(args[0]) + ".txt"; + if (File.Exists(outputFile)) File.Delete(outputFile); + + LogManager.Enabled = true; + LogManager.AttachLogTarget(new FileTarget(outputFile, Logger.Level.PacketDump, Logger.Level.PacketDump, true, true)); + + Console.WriteLine("Demystifying packets:"); + PacketReader.Read(args[0]); + Console.WriteLine("\n\n[done]"); + } + + private static void PrintLicense() + { + Console.WriteLine("Copyright (C) 2011 mooege project"); + Console.WriteLine("mooege comes with ABSOLUTELY NO WARRANTY."); + Console.WriteLine("This is free software, and you are welcome to redistribute it under certain conditions; see the LICENSE file for details."); + Console.WriteLine(); + } + } +} diff --git a/src/tools/GameServer/GSPacketDumper/Properties/AssemblyInfo.cs b/src/tools/GameServer/GSPacketDumper/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..5259ccd4 --- /dev/null +++ b/src/tools/GameServer/GSPacketDumper/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("d3gameprotoextractor")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("d3gameprotoextractor")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("7d8c35f6-73ae-4006-9716-427b48362979")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/tools/GameServer/MessageViewer/.gitignore b/src/tools/GameServer/MessageViewer/.gitignore new file mode 100644 index 00000000..0ecebf23 --- /dev/null +++ b/src/tools/GameServer/MessageViewer/.gitignore @@ -0,0 +1,8 @@ + +*.manifest +*.pdb +*.exe +*.dll +bin/Debug/ +/obj/ +/*.suo diff --git a/src/tools/GameServer/MessageViewer/AboutBox.Designer.cs b/src/tools/GameServer/MessageViewer/AboutBox.Designer.cs new file mode 100644 index 00000000..4cf1d385 --- /dev/null +++ b/src/tools/GameServer/MessageViewer/AboutBox.Designer.cs @@ -0,0 +1,82 @@ +namespace GameMessageViewer +{ + partial class AboutBox + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.okButton = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // okButton + // + this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.okButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.okButton.Location = new System.Drawing.Point(36, 22); + this.okButton.Name = "okButton"; + this.okButton.Size = new System.Drawing.Size(429, 200); + this.okButton.TabIndex = 24; + this.okButton.Text = "&OK"; + this.okButton.Click += new System.EventHandler(this.okButton_Click); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(486, 236); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(49, 13); + this.label1.TabIndex = 25; + this.label1.Text = "by Farmy"; + // + // AboutBox + // + this.AcceptButton = this.okButton; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(547, 273); + this.Controls.Add(this.label1); + this.Controls.Add(this.okButton); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "AboutBox"; + this.Padding = new System.Windows.Forms.Padding(9); + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "AboutBox"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button okButton; + private System.Windows.Forms.Label label1; + + } +} diff --git a/src/tools/GameServer/MessageViewer/AboutBox.cs b/src/tools/GameServer/MessageViewer/AboutBox.cs new file mode 100644 index 00000000..5bee7bfa --- /dev/null +++ b/src/tools/GameServer/MessageViewer/AboutBox.cs @@ -0,0 +1,122 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Linq; +using System.Reflection; +using System.Windows.Forms; + +namespace GameMessageViewer +{ + partial class AboutBox : Form + { + public AboutBox() + { + InitializeComponent(); + this.Text = String.Format("About {0}", AssemblyTitle); + } + + #region Assembly Attribute Accessors + + public string AssemblyTitle + { + get + { + object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false); + if (attributes.Length > 0) + { + AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0]; + if (titleAttribute.Title != "") + { + return titleAttribute.Title; + } + } + return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase); + } + } + + public string AssemblyVersion + { + get + { + return Assembly.GetExecutingAssembly().GetName().Version.ToString(); + } + } + + public string AssemblyDescription + { + get + { + object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false); + if (attributes.Length == 0) + { + return ""; + } + return ((AssemblyDescriptionAttribute)attributes[0]).Description; + } + } + + public string AssemblyProduct + { + get + { + object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false); + if (attributes.Length == 0) + { + return ""; + } + return ((AssemblyProductAttribute)attributes[0]).Product; + } + } + + public string AssemblyCopyright + { + get + { + object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); + if (attributes.Length == 0) + { + return ""; + } + return ((AssemblyCopyrightAttribute)attributes[0]).Copyright; + } + } + + public string AssemblyCompany + { + get + { + object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false); + if (attributes.Length == 0) + { + return ""; + } + return ((AssemblyCompanyAttribute)attributes[0]).Company; + } + } + #endregion + + private void okButton_Click(object sender, EventArgs e) + { + this.Close(); + } + } +} diff --git a/src/tools/GameServer/MessageViewer/AboutBox.resx b/src/tools/GameServer/MessageViewer/AboutBox.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/src/tools/GameServer/MessageViewer/AboutBox.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/src/tools/GameServer/MessageViewer/Buffer.cs b/src/tools/GameServer/MessageViewer/Buffer.cs new file mode 100644 index 00000000..2438002f --- /dev/null +++ b/src/tools/GameServer/MessageViewer/Buffer.cs @@ -0,0 +1,96 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Net.GS.Message; +using System.Reflection; +using System.Runtime.Serialization; +using Mooege.Net.GS.Message.Fields; +using Mooege.Net.GS.Message.Definitions.Misc; +using Mooege.Net.GS.Message.Definitions.Skill; + +namespace GameMessageViewer +{ + + /// + /// Proxy to the GameBitBuffer that does not rely on IncomingMessage - Attribute to parse messages + /// + class GameMessageProxy + { + private static readonly Dictionary MessageTypes = new Dictionary(); + + // Create a dictionary of all GameMessages and what opcodes they handle + // for all Subclasses of GameMessage defined anywhere in the AppDomain + static GameMessageProxy() + { + foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies()) + foreach (Type type in assembly.GetTypes()) + if (type.IsSubclassOf(typeof(GameMessage)) || type == typeof(HeroStateData)) + { + var attributes = (MessageAttribute[])type.GetCustomAttributes(typeof(MessageAttribute), true); + if (attributes.Length == 0) continue; + foreach (MessageAttribute attribute in attributes) + foreach (var opcode in attribute.Opcodes) + MessageTypes.Add(opcode, type); + } + + foreach(Opcodes opcode in Enum.GetValues(typeof(Opcodes))) + if(!MessageTypes.ContainsKey(opcode)) + foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies()) + foreach (Type type in assembly.GetTypes()) + if (type.IsSubclassOf(typeof(GameMessage))) + if(opcode.ToString().StartsWith(type.Name)) + MessageTypes.Add(opcode, type); + + + } + + // Create and parse the GameMessage that handles the next opcode + public static GameMessage ParseMessage(GameBitBuffer buffer) + { + GameMessage msg = null; + + Opcodes opcode = (Opcodes)buffer.ReadInt(9); + if (MessageTypes.ContainsKey(opcode)) + { + msg = (GameMessage)FormatterServices.GetUninitializedObject(MessageTypes[opcode]); + typeof(GameMessage).GetProperty("Id").SetValue(msg, (int)opcode, null); + msg.Parse(buffer); + } + + return msg as GameMessage; + } + } + + /// + /// Proxys a buffer, so messages created when parsing the buffer dont use the Incoming-attribute + /// + class Buffer : GameBitBuffer + { + public Buffer(byte[] data) : base(data) { } + + public new GameMessage ParseMessage() + { + return GameMessageProxy.ParseMessage(this); + } + + } +} diff --git a/src/tools/GameServer/MessageViewer/BufferNode.cs b/src/tools/GameServer/MessageViewer/BufferNode.cs new file mode 100644 index 00000000..53581689 --- /dev/null +++ b/src/tools/GameServer/MessageViewer/BufferNode.cs @@ -0,0 +1,401 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using Mooege.Net.GS.Message; +using Mooege.Net.GS.Message.Definitions.ACD; +using System.Drawing; +using System.IO; +using Mooege.Net.GS.Message.Definitions.Misc; +using Mooege.Net.GS.Message.Definitions.Quest; +using Mooege.Net.GS.Message.Definitions.Tick; +using Mooege.Net.GS.Message.Definitions.Attribute; +using Mooege.Net.GS.Message.Definitions.Actor; +using Mooege.Net.GS.Message.Definitions.Player; +using Mooege.Net.GS.Message.Definitions.Game; +using Mooege.Common.MPQ; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Net.GS.Message.Definitions.Animation; +using Mooege.Net.GS.Message.Definitions.Effect; +using Mooege.Net.GS.Message.Definitions.Scene; +using Mooege.Net.GS.Message.Definitions.Map; +using Mooege.Net.GS.Message.Definitions.Combat; +using Mooege.Net.GS.Message.Definitions.World; + +namespace GameMessageViewer +{ + class BufferNode : TreeNode + { + public Buffer Buffer; + + private Dictionary actors; + private Dictionary quests; + + public List allNodes = new List(); + private static Dictionary actorMap = new Dictionary(); + public readonly string clientHash; + + public static void Reset() + { + actorMap = new Dictionary(); + } + + public void ApplyFilter(Dictionary filter) + { + Nodes.Clear(); + + foreach (TreeNode node in allNodes) + if (node is MessageNode) + { + if (filter[(node as MessageNode).gameMessage.GetType().Name]) + Nodes.Add(node); + } + else + Nodes.Add(node); + + } + + public BufferNode(Dictionary actors, Dictionary quests, string clientHash) + { + this.Buffer = new Buffer(new byte[0]); + this.actors = actors; + this.quests = quests; + this.clientHash = clientHash; + } + + + + public bool Append(byte[] data) + { + Buffer.AppendData(data); + if (allNodes.Count == 1 && allNodes[0].GetType() == typeof(ErrorNode)) + allNodes.Clear(); + + bool missing = Parse(); + + + if (allNodes.Count > 0) + Text = allNodes.First().Text; + else + { + allNodes.Add(new ErrorNode("Contents of buffer", BitConverter.ToString(Buffer.Data, 0))); + Text = "Packet missing data"; + } + return missing; + } + + static Dictionary gg = new Dictionary(); + + public bool Parse() + { + //allNodes.Clear(); + + while (Buffer.IsPacketAvailable()) + { + int end = Buffer.Position; + end += Buffer.ReadInt(32) * 8; + if (end < Buffer.Position) break; + + while ((end - Buffer.Position) >= 9) + { + int start = Buffer.Position; + + #region Try parsing a message + try + { + GameMessage message = Buffer.ParseMessage(); + if (message != null) + { + + if (message is ACDEnterKnownMessage) + { + String hex = (message as ACDEnterKnownMessage).ActorID.ToString("X8"); + //string name; + //SNOAliases.Aliases.TryGetValue((message as ACDEnterKnownMessage).ActorSNOId.ToString(), out name); + string name = SNOAliases.GetAlias((message as ACDEnterKnownMessage).ActorSNOId); + if (!actors.ContainsKey(hex)) + { + TreeNode actorNode = new TreeNode(hex + " " + name); + actors.Add(hex, actorNode); + actorMap.Add((message as ACDEnterKnownMessage).ActorID, actorNode); + actorNode.Tag = hex; + } + } + + if (message is QuestUpdateMessage) + { + string name = SNOAliases.GetAlias((message as QuestUpdateMessage).snoQuest); + //SNOAliases.Aliases.TryGetValue(.ToString(), out name); + if (!quests.ContainsKey((message as QuestUpdateMessage).snoQuest.ToString("X8"))) + { + TreeNode questNode = new TreeNode(name); + questNode.Tag = (message as QuestUpdateMessage).snoQuest.ToString("X8"); + quests.Add(questNode.Tag.ToString(), questNode); + } + } + + MessageNode node = new MessageNode(message); + allNodes.Add(node); + + /// THIS IS FOR QUICKER PARSING BUT IM TOO LAZY TO DO THAT FOR ALL MESSAGES + #region quickparse + + // skip messages without actor or quest id + if (message is GameTickMessage || + message is SNODataMessage || + message is SNONameDataMessage || + message is SimpleMessage || + message is RevealSceneMessage || + message is DestroySceneMessage || + message is MapRevealSceneMessage + ) + continue; + + try + { + if (gg.ContainsKey(message.GetType())) + gg[message.GetType()]++; + else + gg.Add(message.GetType(), 1); + + if (message is ANNDataMessage) + { + if (actorMap.ContainsKey((uint)(message as ANNDataMessage).ActorID)) + actorMap[(uint)(message as ANNDataMessage).ActorID].Nodes.Add(node.Clone()); + continue; + } + if (message is ACDTranslateFacingMessage) + { + actorMap[(uint)(message as ACDTranslateFacingMessage).ActorId].Nodes.Add(node.Clone()); + continue; + } + + if (message is AttributeSetValueMessage) + { + var msg = message as AttributeSetValueMessage; + actorMap[(uint)(message as AttributeSetValueMessage).ActorID].Nodes.Add(node.Clone()); + + if (msg.Field1.Attribute != GameAttribute.Attached_To_ACD && + msg.Field1.Attribute != GameAttribute.Attachment_ACD && + msg.Field1.Attribute != GameAttribute.Banner_ACDID && + msg.Field1.Attribute != GameAttribute.Follow_Target_ACDID && + msg.Field1.Attribute != GameAttribute.Forced_Enemy_ACDID && + msg.Field1.Attribute != GameAttribute.Gizmo_Operator_ACDID && + msg.Field1.Attribute != GameAttribute.Guard_Object_ACDID && + msg.Field1.Attribute != GameAttribute.Item_Bound_To_ACD && + msg.Field1.Attribute != GameAttribute.Last_Damage_ACD && + msg.Field1.Attribute != GameAttribute.Last_ACD_Attacked && + msg.Field1.Attribute != GameAttribute.Last_ACD_Attacked_By && + msg.Field1.Attribute != GameAttribute.Attached_To_ACD && + msg.Field1.Attribute != GameAttribute.Last_Blocked_ACD && + msg.Field1.Attribute != GameAttribute.Loading_Player_ACD && + msg.Field1.Attribute != GameAttribute.RootTargetACD && + msg.Field1.Attribute != GameAttribute.Script_Target_ACDID && + msg.Field1.Attribute != GameAttribute.Spawned_by_ACDID && + msg.Field1.Attribute != GameAttribute.Summoned_By_ACDID && + msg.Field1.Attribute != GameAttribute.Taunt_Target_ACD && + msg.Field1.Attribute != GameAttribute.Wizard_Slowtime_Proxy_ACD) + //actorMap[(uint)(message as AttributeSetValueMessage).Field1.Int].Nodes.Add(node.Clone()); + continue; + } + + if (message is ACDTranslateNormalMessage) + { + actorMap[(uint)(message as ACDTranslateNormalMessage).ActorId].Nodes.Add(node.Clone()); + continue; + } + if (message is ACDClientTranslateMessage) + { + // If the client sends a PlayerMoveMessage, but the actor is not yet in the + // actor list, its due to a broken cap that starts too late...add the node for speed (and grouping) + // ACDClientTranslateMessage does not contain ActorId, we'll just make one up for now + if (!actorMap.ContainsKey(0x1F1F1F1F)) + { + String hex = 0x1F1F1F1F.ToString("X8"); + + if (!actors.ContainsKey(hex)) + { + TreeNode actorNode = new TreeNode(hex + " Capper"); + actorMap.Add(0x1F1F1F1F, actorNode); + actorNode.Tag = hex; + actors.Add(hex, actorNode); + } + } + + actorMap[0x1F1F1F1F].Nodes.Add(node.Clone()); + continue; + } + + if (message is ACDGroupMessage) + { + actorMap[(uint)(message as ACDGroupMessage).ActorID].Nodes.Add(node.Clone()); + continue; + } + if (message is ACDCollFlagsMessage) + { + actorMap[(uint)(message as ACDCollFlagsMessage).ActorID].Nodes.Add(node.Clone()); + continue; + } + if (message is AffixMessage) + { + actorMap[(uint)(message as AffixMessage).ActorID].Nodes.Add(node.Clone()); + continue; + } + if (message is TrickleMessage) + { + if (actorMap.ContainsKey((uint)(message as TrickleMessage).ActorId)) + actorMap[(uint)(message as TrickleMessage).ActorId].Nodes.Add(node.Clone()); + continue; + } + if (message is ACDEnterKnownMessage) + { + actorMap[(uint)(message as ACDEnterKnownMessage).ActorID].Nodes.Add(node.Clone()); + continue; + } + if (message is ACDCreateActorMessage) + { + actorMap[(uint)(message as ACDCreateActorMessage).ActorId].Nodes.Add(node.Clone()); + continue; + } + if (message is ACDDestroyActorMessage) + { + actorMap[(uint)(message as ACDDestroyActorMessage).ActorId].Nodes.Add(node.Clone()); + continue; + } + if (message is ACDTranslateFixedMessage) + { + actorMap[(uint)(message as ACDTranslateFixedMessage).ActorId].Nodes.Add(node.Clone()); + continue; + } + if (message is AttributesSetValuesMessage) + { + actorMap[(uint)(message as AttributesSetValuesMessage).ActorID].Nodes.Add(node.Clone()); + continue; + } + if (message is SetIdleAnimationMessage) + { + actorMap[(uint)(message as SetIdleAnimationMessage).ActorID].Nodes.Add(node.Clone()); + continue; + } + if (message is ACDWorldPositionMessage) + { + actorMap[(uint)(message as ACDWorldPositionMessage).ActorID].Nodes.Add(node.Clone()); + continue; + } + if (message is PlayEffectMessage) + { + actorMap[(uint)(message as PlayEffectMessage).ActorId].Nodes.Add(node.Clone()); + continue; + } + if (message is PlayAnimationMessage) + { + actorMap[(uint)(message as PlayAnimationMessage).ActorID].Nodes.Add(node.Clone()); + continue; + } + if (message is FloatingNumberMessage) + { + actorMap[(uint)(message as FloatingNumberMessage).ActorID].Nodes.Add(node.Clone()); + continue; + } + if (message is ACDTranslateSyncMessage) + { + actorMap[(uint)(message as ACDTranslateSyncMessage).Field0].Nodes.Add(node.Clone()); + continue; + } + if (message is ACDTranslateDetPathMessage) + { + actorMap[(uint)(message as ACDTranslateDetPathMessage).Field0].Nodes.Add(node.Clone()); + continue; + } + if (message is PlayHitEffectMessage) + { + actorMap[(uint)(message as PlayHitEffectMessage).ActorID].Nodes.Add(node.Clone()); + continue; + } + if (message is AimTargetMessage) + { + actorMap[(uint)(message as AimTargetMessage).Field0].Nodes.Add(node.Clone()); + if((message as AimTargetMessage).Field2 != -1) + actorMap[(uint)(message as AimTargetMessage).Field2].Nodes.Add(node.Clone()); + continue; + } + if (message is TargetMessage) + { + if((message as TargetMessage).TargetID != 0xFFFFFFFF) + actorMap[(uint)(message as TargetMessage).TargetID].Nodes.Add(node.Clone()); + continue; + } + + } + catch (Exception) {} + + #endregion + + // Bruteforce find actor ID and add to actor tree + string text = message.AsText(); + foreach (TreeNode an in actors.Values) + if (text.Contains((string)an.Tag)) + { + MessageNode nodeb = node.Clone(); + nodeb.BackColor = this.BackColor; + an.Nodes.Add(nodeb); + } + + // Bruteforce find quest SNO and add to quest tree + foreach (TreeNode qn in quests.Values) + if (text.Contains(qn.Tag.ToString())) + { + MessageNode nodeb = node.Clone(); + nodeb.BackColor = this.BackColor; + qn.Nodes.Add(nodeb); + } + } + else + { + int pos = Buffer.Position; + Buffer.Position = start; + ErrorNode errorNode = new ErrorNode(String.Format("No message handler found for message id {0}", (Opcodes)Buffer.ReadInt(9)), ""); + errorNode.BackColor = Color.Pink; + allNodes.Add(errorNode); + Buffer.Position = pos; + } + } + + catch (Exception e) + { + int pos = Buffer.Position; + Buffer.Position = start; + ErrorNode errorNode = new ErrorNode(String.Format("Error parsing messsage {0}", (Opcodes)Buffer.ReadInt(9)), e.Message); + errorNode.BackColor = Color.Pink; + allNodes.Add(errorNode); + Buffer.Position = pos; + } + #endregion + } + + Buffer.Position = end; + } + + return Buffer.Position != Buffer.Length; + } + } +} diff --git a/src/tools/GameServer/MessageViewer/CustomLinqQuery.Designer.cs b/src/tools/GameServer/MessageViewer/CustomLinqQuery.Designer.cs new file mode 100644 index 00000000..f219c1a4 --- /dev/null +++ b/src/tools/GameServer/MessageViewer/CustomLinqQuery.Designer.cs @@ -0,0 +1,137 @@ +namespace GameMessageViewer +{ + partial class CustomLinqQuery + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.textBox1 = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.button1 = new System.Windows.Forms.Button(); + this.comboBox1 = new System.Windows.Forms.ComboBox(); + this.lblException = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(343, 26); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(259, 20); + this.textBox1.TabIndex = 1; + this.textBox1.Text = "True"; + this.textBox1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox1_KeyDown); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(15, 29); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(30, 13); + this.label1.TabIndex = 1; + this.label1.Text = "From"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(270, 29); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(67, 13); + this.label2.TabIndex = 2; + this.label2.Text = "select where"; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(498, 73); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(104, 30); + this.button1.TabIndex = 3; + this.button1.Text = "Ok"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // comboBox1 + // + this.comboBox1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.comboBox1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox1.FormattingEnabled = true; + this.comboBox1.Location = new System.Drawing.Point(51, 26); + this.comboBox1.Name = "comboBox1"; + this.comboBox1.Size = new System.Drawing.Size(213, 21); + this.comboBox1.TabIndex = 0; + // + // lblException + // + this.lblException.AutoSize = true; + this.lblException.ForeColor = System.Drawing.Color.Red; + this.lblException.Location = new System.Drawing.Point(15, 59); + this.lblException.Name = "lblException"; + this.lblException.Size = new System.Drawing.Size(0, 13); + this.lblException.TabIndex = 4; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(340, 10); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(262, 13); + this.label3.TabIndex = 5; + this.label3.Text = "eg. \"Field3 == 0\". Case sensitive, dont use hex values"; + // + // CustomLinqQuery + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(614, 115); + this.Controls.Add(this.label3); + this.Controls.Add(this.lblException); + this.Controls.Add(this.comboBox1); + this.Controls.Add(this.button1); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.Controls.Add(this.textBox1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.Name = "CustomLinqQuery"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Query messages"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.ComboBox comboBox1; + private System.Windows.Forms.Label lblException; + private System.Windows.Forms.Label label3; + } +} \ No newline at end of file diff --git a/src/tools/GameServer/MessageViewer/CustomLinqQuery.cs b/src/tools/GameServer/MessageViewer/CustomLinqQuery.cs new file mode 100644 index 00000000..b212ae8a --- /dev/null +++ b/src/tools/GameServer/MessageViewer/CustomLinqQuery.cs @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using Mooege.Net.GS.Message; +using Mooege.Net.GS.Message.Definitions.ACD; +using System.Reflection; +using System.IO; + + +namespace GameMessageViewer +{ + public partial class CustomLinqQuery : Form + { + List mNodes = new List(); + List bNodes = new List(); + public IEnumerable QueryResult = new List(); + + public CustomLinqQuery() + { + InitializeComponent(); + } + + class cboEntry + { + public Type type; + public cboEntry(Type type) { this.type = type; } + public override string ToString() { return type.Name; } + } + + internal DialogResult Show(IEnumerable nodes) + { + // Gather all Types in the AppDomain that inherit from GameMessage + List items = new List(); + foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies()) + foreach (Type type in assembly.GetTypes()) + if (type.BaseType == typeof(GameMessage)) + items.Add(new cboEntry(type)); + + // show them in a combobox + var sorted = items.OrderBy(x => x.ToString()); + foreach (cboEntry message in sorted) + comboBox1.Items.Add(message); + + // Create a List of only MessageNodes + foreach (BufferNode bn in nodes) + foreach (TreeNode mn in bn.allNodes) + if(mn is MessageNode) + mNodes.Add(mn as MessageNode); + + comboBox1.SelectedIndex = 0; + this.ShowDialog(); + return DialogResult; + } + + private void button1_Click(object sender, EventArgs e) + { + //string f = ""; + //for (int i = 0; i < 40; i++) + //{ + + Type genericQuery = typeof(QueryTemplate<>); + Type concreteQuery = genericQuery.MakeGenericType(((cboEntry)comboBox1.SelectedItem).type); + object query = Activator.CreateInstance(concreteQuery); + + + try + { + QueryResult = (IEnumerable)concreteQuery.GetMethod("Query").Invoke(query, new object[] { mNodes, textBox1.Text }); + //QueryResult = (IEnumerable)concreteQuery.GetMethod("Query").Invoke(query, new object[] { mNodes, "Field2==" + i }); + QueryResult.Count(); // Force evaluation + } + catch (Exception exception) + { + lblException.Text = exception.Message; + return; + } + //string s = i.ToString("X8") + "\r\n"; + //foreach (MessageNode mn in QueryResult) + // s += (mn.gameMessage as ACDEnterKnownMessage).ActorSNO + ":" + SNOAliases.Aliases[(mn.gameMessage as ACDEnterKnownMessage).ActorSNO.ToString()] + "\r\n"; + //f += "\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n" + s; + //} + + //File.WriteAllText("F:\\out.txt", f); + + + + + DialogResult = DialogResult.OK; + this.Close(); + } + + private void textBox1_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Enter) + button1_Click(sender, e); + } + } +} diff --git a/src/tools/GameServer/MessageViewer/CustomLinqQuery.resx b/src/tools/GameServer/MessageViewer/CustomLinqQuery.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/src/tools/GameServer/MessageViewer/CustomLinqQuery.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/src/tools/GameServer/MessageViewer/Dynamic.cs b/src/tools/GameServer/MessageViewer/Dynamic.cs new file mode 100644 index 00000000..92b2cff5 --- /dev/null +++ b/src/tools/GameServer/MessageViewer/Dynamic.cs @@ -0,0 +1,2046 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +//Copyright (C) Microsoft Corporation. All rights reserved. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; +using System.Reflection.Emit; +using System.Threading; + +namespace System.Linq.Dynamic +{ + public static class DynamicQueryable + { + public static IQueryable Where(this IQueryable source, string predicate, params object[] values) { + return (IQueryable)Where((IQueryable)source, predicate, values); + } + + public static IQueryable Where(this IQueryable source, string predicate, params object[] values) { + if (source == null) throw new ArgumentNullException("source"); + if (predicate == null) throw new ArgumentNullException("predicate"); + LambdaExpression lambda = DynamicExpression.ParseLambda(source.ElementType, typeof(bool), predicate, values); + return source.Provider.CreateQuery( + Expression.Call( + typeof(Queryable), "Where", + new Type[] { source.ElementType }, + source.Expression, Expression.Quote(lambda))); + } + + public static IQueryable Select(this IQueryable source, string selector, params object[] values) { + if (source == null) throw new ArgumentNullException("source"); + if (selector == null) throw new ArgumentNullException("selector"); + LambdaExpression lambda = DynamicExpression.ParseLambda(source.ElementType, null, selector, values); + return source.Provider.CreateQuery( + Expression.Call( + typeof(Queryable), "Select", + new Type[] { source.ElementType, lambda.Body.Type }, + source.Expression, Expression.Quote(lambda))); + } + + public static IQueryable OrderBy(this IQueryable source, string ordering, params object[] values) { + return (IQueryable)OrderBy((IQueryable)source, ordering, values); + } + + public static IQueryable OrderBy(this IQueryable source, string ordering, params object[] values) { + if (source == null) throw new ArgumentNullException("source"); + if (ordering == null) throw new ArgumentNullException("ordering"); + ParameterExpression[] parameters = new ParameterExpression[] { + Expression.Parameter(source.ElementType, "") }; + ExpressionParser parser = new ExpressionParser(parameters, ordering, values); + IEnumerable orderings = parser.ParseOrdering(); + Expression queryExpr = source.Expression; + string methodAsc = "OrderBy"; + string methodDesc = "OrderByDescending"; + foreach (DynamicOrdering o in orderings) { + queryExpr = Expression.Call( + typeof(Queryable), o.Ascending ? methodAsc : methodDesc, + new Type[] { source.ElementType, o.Selector.Type }, + queryExpr, Expression.Quote(Expression.Lambda(o.Selector, parameters))); + methodAsc = "ThenBy"; + methodDesc = "ThenByDescending"; + } + return source.Provider.CreateQuery(queryExpr); + } + + public static IQueryable Take(this IQueryable source, int count) { + if (source == null) throw new ArgumentNullException("source"); + return source.Provider.CreateQuery( + Expression.Call( + typeof(Queryable), "Take", + new Type[] { source.ElementType }, + source.Expression, Expression.Constant(count))); + } + + public static IQueryable Skip(this IQueryable source, int count) { + if (source == null) throw new ArgumentNullException("source"); + return source.Provider.CreateQuery( + Expression.Call( + typeof(Queryable), "Skip", + new Type[] { source.ElementType }, + source.Expression, Expression.Constant(count))); + } + + public static IQueryable GroupBy(this IQueryable source, string keySelector, string elementSelector, params object[] values) { + if (source == null) throw new ArgumentNullException("source"); + if (keySelector == null) throw new ArgumentNullException("keySelector"); + if (elementSelector == null) throw new ArgumentNullException("elementSelector"); + LambdaExpression keyLambda = DynamicExpression.ParseLambda(source.ElementType, null, keySelector, values); + LambdaExpression elementLambda = DynamicExpression.ParseLambda(source.ElementType, null, elementSelector, values); + return source.Provider.CreateQuery( + Expression.Call( + typeof(Queryable), "GroupBy", + new Type[] { source.ElementType, keyLambda.Body.Type, elementLambda.Body.Type }, + source.Expression, Expression.Quote(keyLambda), Expression.Quote(elementLambda))); + } + + public static bool Any(this IQueryable source) { + if (source == null) throw new ArgumentNullException("source"); + return (bool)source.Provider.Execute( + Expression.Call( + typeof(Queryable), "Any", + new Type[] { source.ElementType }, source.Expression)); + } + + public static int Count(this IQueryable source) { + if (source == null) throw new ArgumentNullException("source"); + return (int)source.Provider.Execute( + Expression.Call( + typeof(Queryable), "Count", + new Type[] { source.ElementType }, source.Expression)); + } + } + + public abstract class DynamicClass + { + public override string ToString() { + PropertyInfo[] props = this.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public); + StringBuilder sb = new StringBuilder(); + sb.Append("{"); + for (int i = 0; i < props.Length; i++) { + if (i > 0) sb.Append(", "); + sb.Append(props[i].Name); + sb.Append("="); + sb.Append(props[i].GetValue(this, null)); + } + sb.Append("}"); + return sb.ToString(); + } + } + + public class DynamicProperty + { + string name; + Type type; + + public DynamicProperty(string name, Type type) { + if (name == null) throw new ArgumentNullException("name"); + if (type == null) throw new ArgumentNullException("type"); + this.name = name; + this.type = type; + } + + public string Name { + get { return name; } + } + + public Type Type { + get { return type; } + } + } + + public static class DynamicExpression + { + public static Expression Parse(Type resultType, string expression, params object[] values) { + ExpressionParser parser = new ExpressionParser(null, expression, values); + return parser.Parse(resultType); + } + + public static LambdaExpression ParseLambda(Type itType, Type resultType, string expression, params object[] values) { + return ParseLambda(new ParameterExpression[] { Expression.Parameter(itType, "") }, resultType, expression, values); + } + + public static LambdaExpression ParseLambda(ParameterExpression[] parameters, Type resultType, string expression, params object[] values) { + ExpressionParser parser = new ExpressionParser(parameters, expression, values); + return Expression.Lambda(parser.Parse(resultType), parameters); + } + + public static Expression> ParseLambda(string expression, params object[] values) { + return (Expression>)ParseLambda(typeof(T), typeof(S), expression, values); + } + + public static Type CreateClass(params DynamicProperty[] properties) { + return ClassFactory.Instance.GetDynamicClass(properties); + } + + public static Type CreateClass(IEnumerable properties) { + return ClassFactory.Instance.GetDynamicClass(properties); + } + } + + internal class DynamicOrdering + { + public Expression Selector; + public bool Ascending; + } + + internal class Signature : IEquatable + { + public DynamicProperty[] properties; + public int hashCode; + + public Signature(IEnumerable properties) { + this.properties = properties.ToArray(); + hashCode = 0; + foreach (DynamicProperty p in properties) { + hashCode ^= p.Name.GetHashCode() ^ p.Type.GetHashCode(); + } + } + + public override int GetHashCode() { + return hashCode; + } + + public override bool Equals(object obj) { + return obj is Signature ? Equals((Signature)obj) : false; + } + + public bool Equals(Signature other) { + if (properties.Length != other.properties.Length) return false; + for (int i = 0; i < properties.Length; i++) { + if (properties[i].Name != other.properties[i].Name || + properties[i].Type != other.properties[i].Type) return false; + } + return true; + } + } + + internal class ClassFactory + { + public static readonly ClassFactory Instance = new ClassFactory(); + + static ClassFactory() { } // Trigger lazy initialization of static fields + + ModuleBuilder module; + Dictionary classes; + int classCount; + ReaderWriterLock rwLock; + + private ClassFactory() { + AssemblyName name = new AssemblyName("DynamicClasses"); + AssemblyBuilder assembly = AppDomain.CurrentDomain.DefineDynamicAssembly(name, AssemblyBuilderAccess.Run); +#if ENABLE_LINQ_PARTIAL_TRUST + new ReflectionPermission(PermissionState.Unrestricted).Assert(); +#endif + try { + module = assembly.DefineDynamicModule("Module"); + } + finally { +#if ENABLE_LINQ_PARTIAL_TRUST + PermissionSet.RevertAssert(); +#endif + } + classes = new Dictionary(); + rwLock = new ReaderWriterLock(); + } + + public Type GetDynamicClass(IEnumerable properties) { + rwLock.AcquireReaderLock(Timeout.Infinite); + try { + Signature signature = new Signature(properties); + Type type; + if (!classes.TryGetValue(signature, out type)) { + type = CreateDynamicClass(signature.properties); + classes.Add(signature, type); + } + return type; + } + finally { + rwLock.ReleaseReaderLock(); + } + } + + Type CreateDynamicClass(DynamicProperty[] properties) { + LockCookie cookie = rwLock.UpgradeToWriterLock(Timeout.Infinite); + try { + string typeName = "DynamicClass" + (classCount + 1); +#if ENABLE_LINQ_PARTIAL_TRUST + new ReflectionPermission(PermissionState.Unrestricted).Assert(); +#endif + try { + TypeBuilder tb = this.module.DefineType(typeName, TypeAttributes.Class | + TypeAttributes.Public, typeof(DynamicClass)); + FieldInfo[] fields = GenerateProperties(tb, properties); + GenerateEquals(tb, fields); + GenerateGetHashCode(tb, fields); + Type result = tb.CreateType(); + classCount++; + return result; + } + finally { +#if ENABLE_LINQ_PARTIAL_TRUST + PermissionSet.RevertAssert(); +#endif + } + } + finally { + rwLock.DowngradeFromWriterLock(ref cookie); + } + } + + FieldInfo[] GenerateProperties(TypeBuilder tb, DynamicProperty[] properties) { + FieldInfo[] fields = new FieldBuilder[properties.Length]; + for (int i = 0; i < properties.Length; i++) { + DynamicProperty dp = properties[i]; + FieldBuilder fb = tb.DefineField("_" + dp.Name, dp.Type, FieldAttributes.Private); + PropertyBuilder pb = tb.DefineProperty(dp.Name, PropertyAttributes.HasDefault, dp.Type, null); + MethodBuilder mbGet = tb.DefineMethod("get_" + dp.Name, + MethodAttributes.Public | MethodAttributes.SpecialName | MethodAttributes.HideBySig, + dp.Type, Type.EmptyTypes); + ILGenerator genGet = mbGet.GetILGenerator(); + genGet.Emit(OpCodes.Ldarg_0); + genGet.Emit(OpCodes.Ldfld, fb); + genGet.Emit(OpCodes.Ret); + MethodBuilder mbSet = tb.DefineMethod("set_" + dp.Name, + MethodAttributes.Public | MethodAttributes.SpecialName | MethodAttributes.HideBySig, + null, new Type[] { dp.Type }); + ILGenerator genSet = mbSet.GetILGenerator(); + genSet.Emit(OpCodes.Ldarg_0); + genSet.Emit(OpCodes.Ldarg_1); + genSet.Emit(OpCodes.Stfld, fb); + genSet.Emit(OpCodes.Ret); + pb.SetGetMethod(mbGet); + pb.SetSetMethod(mbSet); + fields[i] = fb; + } + return fields; + } + + void GenerateEquals(TypeBuilder tb, FieldInfo[] fields) { + MethodBuilder mb = tb.DefineMethod("Equals", + MethodAttributes.Public | MethodAttributes.ReuseSlot | + MethodAttributes.Virtual | MethodAttributes.HideBySig, + typeof(bool), new Type[] { typeof(object) }); + ILGenerator gen = mb.GetILGenerator(); + LocalBuilder other = gen.DeclareLocal(tb); + Label next = gen.DefineLabel(); + gen.Emit(OpCodes.Ldarg_1); + gen.Emit(OpCodes.Isinst, tb); + gen.Emit(OpCodes.Stloc, other); + gen.Emit(OpCodes.Ldloc, other); + gen.Emit(OpCodes.Brtrue_S, next); + gen.Emit(OpCodes.Ldc_I4_0); + gen.Emit(OpCodes.Ret); + gen.MarkLabel(next); + foreach (FieldInfo field in fields) { + Type ft = field.FieldType; + Type ct = typeof(EqualityComparer<>).MakeGenericType(ft); + next = gen.DefineLabel(); + gen.EmitCall(OpCodes.Call, ct.GetMethod("get_Default"), null); + gen.Emit(OpCodes.Ldarg_0); + gen.Emit(OpCodes.Ldfld, field); + gen.Emit(OpCodes.Ldloc, other); + gen.Emit(OpCodes.Ldfld, field); + gen.EmitCall(OpCodes.Callvirt, ct.GetMethod("Equals", new Type[] { ft, ft }), null); + gen.Emit(OpCodes.Brtrue_S, next); + gen.Emit(OpCodes.Ldc_I4_0); + gen.Emit(OpCodes.Ret); + gen.MarkLabel(next); + } + gen.Emit(OpCodes.Ldc_I4_1); + gen.Emit(OpCodes.Ret); + } + + void GenerateGetHashCode(TypeBuilder tb, FieldInfo[] fields) { + MethodBuilder mb = tb.DefineMethod("GetHashCode", + MethodAttributes.Public | MethodAttributes.ReuseSlot | + MethodAttributes.Virtual | MethodAttributes.HideBySig, + typeof(int), Type.EmptyTypes); + ILGenerator gen = mb.GetILGenerator(); + gen.Emit(OpCodes.Ldc_I4_0); + foreach (FieldInfo field in fields) { + Type ft = field.FieldType; + Type ct = typeof(EqualityComparer<>).MakeGenericType(ft); + gen.EmitCall(OpCodes.Call, ct.GetMethod("get_Default"), null); + gen.Emit(OpCodes.Ldarg_0); + gen.Emit(OpCodes.Ldfld, field); + gen.EmitCall(OpCodes.Callvirt, ct.GetMethod("GetHashCode", new Type[] { ft }), null); + gen.Emit(OpCodes.Xor); + } + gen.Emit(OpCodes.Ret); + } + } + + public sealed class ParseException : Exception + { + int position; + + public ParseException(string message, int position) + : base(message) { + this.position = position; + } + + public int Position { + get { return position; } + } + + public override string ToString() { + return string.Format(Res.ParseExceptionFormat, Message, position); + } + } + + internal class ExpressionParser + { + struct Token + { + public TokenId id; + public string text; + public int pos; + } + + enum TokenId + { + Unknown, + End, + Identifier, + StringLiteral, + IntegerLiteral, + RealLiteral, + Exclamation, + Percent, + Amphersand, + OpenParen, + CloseParen, + Asterisk, + Plus, + Comma, + Minus, + Dot, + Slash, + Colon, + LessThan, + Equal, + GreaterThan, + Question, + OpenBracket, + CloseBracket, + Bar, + ExclamationEqual, + DoubleAmphersand, + LessThanEqual, + LessGreater, + DoubleEqual, + GreaterThanEqual, + DoubleBar + } + + interface ILogicalSignatures + { + void F(bool x, bool y); + void F(bool? x, bool? y); + } + + interface IArithmeticSignatures + { + void F(int x, int y); + void F(uint x, uint y); + void F(long x, long y); + void F(ulong x, ulong y); + void F(float x, float y); + void F(double x, double y); + void F(decimal x, decimal y); + void F(int? x, int? y); + void F(uint? x, uint? y); + void F(long? x, long? y); + void F(ulong? x, ulong? y); + void F(float? x, float? y); + void F(double? x, double? y); + void F(decimal? x, decimal? y); + } + + interface IRelationalSignatures : IArithmeticSignatures + { + void F(string x, string y); + void F(char x, char y); + void F(DateTime x, DateTime y); + void F(TimeSpan x, TimeSpan y); + void F(char? x, char? y); + void F(DateTime? x, DateTime? y); + void F(TimeSpan? x, TimeSpan? y); + } + + interface IEqualitySignatures : IRelationalSignatures + { + void F(bool x, bool y); + void F(bool? x, bool? y); + } + + interface IAddSignatures : IArithmeticSignatures + { + void F(DateTime x, TimeSpan y); + void F(TimeSpan x, TimeSpan y); + void F(DateTime? x, TimeSpan? y); + void F(TimeSpan? x, TimeSpan? y); + } + + interface ISubtractSignatures : IAddSignatures + { + void F(DateTime x, DateTime y); + void F(DateTime? x, DateTime? y); + } + + interface INegationSignatures + { + void F(int x); + void F(long x); + void F(float x); + void F(double x); + void F(decimal x); + void F(int? x); + void F(long? x); + void F(float? x); + void F(double? x); + void F(decimal? x); + } + + interface INotSignatures + { + void F(bool x); + void F(bool? x); + } + + interface IEnumerableSignatures + { + void Where(bool predicate); + void Any(); + void Any(bool predicate); + void All(bool predicate); + void Count(); + void Count(bool predicate); + void Min(object selector); + void Max(object selector); + void Sum(int selector); + void Sum(int? selector); + void Sum(long selector); + void Sum(long? selector); + void Sum(float selector); + void Sum(float? selector); + void Sum(double selector); + void Sum(double? selector); + void Sum(decimal selector); + void Sum(decimal? selector); + void Average(int selector); + void Average(int? selector); + void Average(long selector); + void Average(long? selector); + void Average(float selector); + void Average(float? selector); + void Average(double selector); + void Average(double? selector); + void Average(decimal selector); + void Average(decimal? selector); + } + + static readonly Type[] predefinedTypes = { + typeof(Object), + typeof(Boolean), + typeof(Char), + typeof(String), + typeof(SByte), + typeof(Byte), + typeof(Int16), + typeof(UInt16), + typeof(Int32), + typeof(UInt32), + typeof(Int64), + typeof(UInt64), + typeof(Single), + typeof(Double), + typeof(Decimal), + typeof(DateTime), + typeof(TimeSpan), + typeof(Guid), + typeof(Math), + typeof(Convert) + }; + + static readonly Expression trueLiteral = Expression.Constant(true); + static readonly Expression falseLiteral = Expression.Constant(false); + static readonly Expression nullLiteral = Expression.Constant(null); + + static readonly string keywordIt = "it"; + static readonly string keywordIif = "iif"; + static readonly string keywordNew = "new"; + + static Dictionary keywords; + + Dictionary symbols; + IDictionary externals; + Dictionary literals; + ParameterExpression it; + string text; + int textPos; + int textLen; + char ch; + Token token; + + public ExpressionParser(ParameterExpression[] parameters, string expression, object[] values) { + if (expression == null) throw new ArgumentNullException("expression"); + if (keywords == null) keywords = CreateKeywords(); + symbols = new Dictionary(StringComparer.OrdinalIgnoreCase); + literals = new Dictionary(); + if (parameters != null) ProcessParameters(parameters); + if (values != null) ProcessValues(values); + text = expression; + textLen = text.Length; + SetTextPos(0); + NextToken(); + } + + void ProcessParameters(ParameterExpression[] parameters) { + foreach (ParameterExpression pe in parameters) + if (!String.IsNullOrEmpty(pe.Name)) + AddSymbol(pe.Name, pe); + if (parameters.Length == 1 && String.IsNullOrEmpty(parameters[0].Name)) + it = parameters[0]; + } + + void ProcessValues(object[] values) { + for (int i = 0; i < values.Length; i++) { + object value = values[i]; + if (i == values.Length - 1 && value is IDictionary) { + externals = (IDictionary)value; + } + else { + AddSymbol("@" + i.ToString(System.Globalization.CultureInfo.InvariantCulture), value); + } + } + } + + void AddSymbol(string name, object value) { + if (symbols.ContainsKey(name)) + throw ParseError(Res.DuplicateIdentifier, name); + symbols.Add(name, value); + } + + public Expression Parse(Type resultType) { + int exprPos = token.pos; + Expression expr = ParseExpression(); + if (resultType != null) + if ((expr = PromoteExpression(expr, resultType, true)) == null) + throw ParseError(exprPos, Res.ExpressionTypeMismatch, GetTypeName(resultType)); + ValidateToken(TokenId.End, Res.SyntaxError); + return expr; + } + +#pragma warning disable 0219 + public IEnumerable ParseOrdering() { + List orderings = new List(); + while (true) { + Expression expr = ParseExpression(); + bool ascending = true; + if (TokenIdentifierIs("asc") || TokenIdentifierIs("ascending")) { + NextToken(); + } + else if (TokenIdentifierIs("desc") || TokenIdentifierIs("descending")) { + NextToken(); + ascending = false; + } + orderings.Add(new DynamicOrdering { Selector = expr, Ascending = ascending }); + if (token.id != TokenId.Comma) break; + NextToken(); + } + ValidateToken(TokenId.End, Res.SyntaxError); + return orderings; + } +#pragma warning restore 0219 + + // ?: operator + Expression ParseExpression() { + int errorPos = token.pos; + Expression expr = ParseLogicalOr(); + if (token.id == TokenId.Question) { + NextToken(); + Expression expr1 = ParseExpression(); + ValidateToken(TokenId.Colon, Res.ColonExpected); + NextToken(); + Expression expr2 = ParseExpression(); + expr = GenerateConditional(expr, expr1, expr2, errorPos); + } + return expr; + } + + // ||, or operator + Expression ParseLogicalOr() { + Expression left = ParseLogicalAnd(); + while (token.id == TokenId.DoubleBar || TokenIdentifierIs("or")) { + Token op = token; + NextToken(); + Expression right = ParseLogicalAnd(); + CheckAndPromoteOperands(typeof(ILogicalSignatures), op.text, ref left, ref right, op.pos); + left = Expression.OrElse(left, right); + } + return left; + } + + // &&, and operator + Expression ParseLogicalAnd() { + Expression left = ParseComparison(); + while (token.id == TokenId.DoubleAmphersand || TokenIdentifierIs("and")) { + Token op = token; + NextToken(); + Expression right = ParseComparison(); + CheckAndPromoteOperands(typeof(ILogicalSignatures), op.text, ref left, ref right, op.pos); + left = Expression.AndAlso(left, right); + } + return left; + } + + // =, ==, !=, <>, >, >=, <, <= operators + Expression ParseComparison() { + Expression left = ParseAdditive(); + while (token.id == TokenId.Equal || token.id == TokenId.DoubleEqual || + token.id == TokenId.ExclamationEqual || token.id == TokenId.LessGreater || + token.id == TokenId.GreaterThan || token.id == TokenId.GreaterThanEqual || + token.id == TokenId.LessThan || token.id == TokenId.LessThanEqual) { + Token op = token; + NextToken(); + Expression right = ParseAdditive(); + bool isEquality = op.id == TokenId.Equal || op.id == TokenId.DoubleEqual || + op.id == TokenId.ExclamationEqual || op.id == TokenId.LessGreater; + if (isEquality && !left.Type.IsValueType && !right.Type.IsValueType) { + if (left.Type != right.Type) { + if (left.Type.IsAssignableFrom(right.Type)) { + right = Expression.Convert(right, left.Type); + } + else if (right.Type.IsAssignableFrom(left.Type)) { + left = Expression.Convert(left, right.Type); + } + else { + throw IncompatibleOperandsError(op.text, left, right, op.pos); + } + } + } + else if (IsEnumType(left.Type) || IsEnumType(right.Type)) { + if (left.Type != right.Type) { + Expression e; + if ((e = PromoteExpression(right, left.Type, true)) != null) { + right = e; + } + else if ((e = PromoteExpression(left, right.Type, true)) != null) { + left = e; + } + else { + throw IncompatibleOperandsError(op.text, left, right, op.pos); + } + } + } + else { + CheckAndPromoteOperands(isEquality ? typeof(IEqualitySignatures) : typeof(IRelationalSignatures), + op.text, ref left, ref right, op.pos); + } + switch (op.id) { + case TokenId.Equal: + case TokenId.DoubleEqual: + left = GenerateEqual(left, right); + break; + case TokenId.ExclamationEqual: + case TokenId.LessGreater: + left = GenerateNotEqual(left, right); + break; + case TokenId.GreaterThan: + left = GenerateGreaterThan(left, right); + break; + case TokenId.GreaterThanEqual: + left = GenerateGreaterThanEqual(left, right); + break; + case TokenId.LessThan: + left = GenerateLessThan(left, right); + break; + case TokenId.LessThanEqual: + left = GenerateLessThanEqual(left, right); + break; + } + } + return left; + } + + // +, -, & operators + Expression ParseAdditive() { + Expression left = ParseMultiplicative(); + while (token.id == TokenId.Plus || token.id == TokenId.Minus || + token.id == TokenId.Amphersand) { + Token op = token; + NextToken(); + Expression right = ParseMultiplicative(); + switch (op.id) { + case TokenId.Plus: + if (left.Type == typeof(string) || right.Type == typeof(string)) + goto case TokenId.Amphersand; + CheckAndPromoteOperands(typeof(IAddSignatures), op.text, ref left, ref right, op.pos); + left = GenerateAdd(left, right); + break; + case TokenId.Minus: + CheckAndPromoteOperands(typeof(ISubtractSignatures), op.text, ref left, ref right, op.pos); + left = GenerateSubtract(left, right); + break; + case TokenId.Amphersand: + left = GenerateStringConcat(left, right); + break; + } + } + return left; + } + + // *, /, %, mod operators + Expression ParseMultiplicative() { + Expression left = ParseUnary(); + while (token.id == TokenId.Asterisk || token.id == TokenId.Slash || + token.id == TokenId.Percent || TokenIdentifierIs("mod")) { + Token op = token; + NextToken(); + Expression right = ParseUnary(); + CheckAndPromoteOperands(typeof(IArithmeticSignatures), op.text, ref left, ref right, op.pos); + switch (op.id) { + case TokenId.Asterisk: + left = Expression.Multiply(left, right); + break; + case TokenId.Slash: + left = Expression.Divide(left, right); + break; + case TokenId.Percent: + case TokenId.Identifier: + left = Expression.Modulo(left, right); + break; + } + } + return left; + } + + // -, !, not unary operators + Expression ParseUnary() { + if (token.id == TokenId.Minus || token.id == TokenId.Exclamation || + TokenIdentifierIs("not")) { + Token op = token; + NextToken(); + if (op.id == TokenId.Minus && (token.id == TokenId.IntegerLiteral || + token.id == TokenId.RealLiteral)) { + token.text = "-" + token.text; + token.pos = op.pos; + return ParsePrimary(); + } + Expression expr = ParseUnary(); + if (op.id == TokenId.Minus) { + CheckAndPromoteOperand(typeof(INegationSignatures), op.text, ref expr, op.pos); + expr = Expression.Negate(expr); + } + else { + CheckAndPromoteOperand(typeof(INotSignatures), op.text, ref expr, op.pos); + expr = Expression.Not(expr); + } + return expr; + } + return ParsePrimary(); + } + + Expression ParsePrimary() { + Expression expr = ParsePrimaryStart(); + while (true) { + if (token.id == TokenId.Dot) { + NextToken(); + expr = ParseMemberAccess(null, expr); + } + else if (token.id == TokenId.OpenBracket) { + expr = ParseElementAccess(expr); + } + else { + break; + } + } + return expr; + } + + Expression ParsePrimaryStart() { + switch (token.id) { + case TokenId.Identifier: + return ParseIdentifier(); + case TokenId.StringLiteral: + return ParseStringLiteral(); + case TokenId.IntegerLiteral: + return ParseIntegerLiteral(); + case TokenId.RealLiteral: + return ParseRealLiteral(); + case TokenId.OpenParen: + return ParseParenExpression(); + default: + throw ParseError(Res.ExpressionExpected); + } + } + + Expression ParseStringLiteral() { + ValidateToken(TokenId.StringLiteral); + char quote = token.text[0]; + string s = token.text.Substring(1, token.text.Length - 2); + int start = 0; + while (true) { + int i = s.IndexOf(quote, start); + if (i < 0) break; + s = s.Remove(i, 1); + start = i + 1; + } + if (quote == '\'') { + if (s.Length != 1) + throw ParseError(Res.InvalidCharacterLiteral); + NextToken(); + return CreateLiteral(s[0], s); + } + NextToken(); + return CreateLiteral(s, s); + } + + Expression ParseIntegerLiteral() { + ValidateToken(TokenId.IntegerLiteral); + string text = token.text; + if (text[0] != '-') { + ulong value; + if (!UInt64.TryParse(text, out value)) + throw ParseError(Res.InvalidIntegerLiteral, text); + NextToken(); + if (value <= (ulong)Int32.MaxValue) return CreateLiteral((int)value, text); + if (value <= (ulong)UInt32.MaxValue) return CreateLiteral((uint)value, text); + if (value <= (ulong)Int64.MaxValue) return CreateLiteral((long)value, text); + return CreateLiteral(value, text); + } + else { + long value; + if (!Int64.TryParse(text, out value)) + throw ParseError(Res.InvalidIntegerLiteral, text); + NextToken(); + if (value >= Int32.MinValue && value <= Int32.MaxValue) + return CreateLiteral((int)value, text); + return CreateLiteral(value, text); + } + } + + Expression ParseRealLiteral() { + ValidateToken(TokenId.RealLiteral); + string text = token.text; + object value = null; + char last = text[text.Length - 1]; + if (last == 'F' || last == 'f') { + float f; + if (Single.TryParse(text.Substring(0, text.Length - 1), out f)) value = f; + } + else { + double d; + if (Double.TryParse(text, out d)) value = d; + } + if (value == null) throw ParseError(Res.InvalidRealLiteral, text); + NextToken(); + return CreateLiteral(value, text); + } + + Expression CreateLiteral(object value, string text) { + ConstantExpression expr = Expression.Constant(value); + literals.Add(expr, text); + return expr; + } + + Expression ParseParenExpression() { + ValidateToken(TokenId.OpenParen, Res.OpenParenExpected); + NextToken(); + Expression e = ParseExpression(); + ValidateToken(TokenId.CloseParen, Res.CloseParenOrOperatorExpected); + NextToken(); + return e; + } + + Expression ParseIdentifier() { + ValidateToken(TokenId.Identifier); + object value; + if (keywords.TryGetValue(token.text, out value)) { + if (value is Type) return ParseTypeAccess((Type)value); + if (value == (object)keywordIt) return ParseIt(); + if (value == (object)keywordIif) return ParseIif(); + if (value == (object)keywordNew) return ParseNew(); + NextToken(); + return (Expression)value; + } + if (symbols.TryGetValue(token.text, out value) || + externals != null && externals.TryGetValue(token.text, out value)) { + Expression expr = value as Expression; + if (expr == null) { + expr = Expression.Constant(value); + } + else { + LambdaExpression lambda = expr as LambdaExpression; + if (lambda != null) return ParseLambdaInvocation(lambda); + } + NextToken(); + return expr; + } + if (it != null) return ParseMemberAccess(null, it); + throw ParseError(Res.UnknownIdentifier, token.text); + } + + Expression ParseIt() { + if (it == null) + throw ParseError(Res.NoItInScope); + NextToken(); + return it; + } + + Expression ParseIif() { + int errorPos = token.pos; + NextToken(); + Expression[] args = ParseArgumentList(); + if (args.Length != 3) + throw ParseError(errorPos, Res.IifRequiresThreeArgs); + return GenerateConditional(args[0], args[1], args[2], errorPos); + } + + Expression GenerateConditional(Expression test, Expression expr1, Expression expr2, int errorPos) { + if (test.Type != typeof(bool)) + throw ParseError(errorPos, Res.FirstExprMustBeBool); + if (expr1.Type != expr2.Type) { + Expression expr1as2 = expr2 != nullLiteral ? PromoteExpression(expr1, expr2.Type, true) : null; + Expression expr2as1 = expr1 != nullLiteral ? PromoteExpression(expr2, expr1.Type, true) : null; + if (expr1as2 != null && expr2as1 == null) { + expr1 = expr1as2; + } + else if (expr2as1 != null && expr1as2 == null) { + expr2 = expr2as1; + } + else { + string type1 = expr1 != nullLiteral ? expr1.Type.Name : "null"; + string type2 = expr2 != nullLiteral ? expr2.Type.Name : "null"; + if (expr1as2 != null && expr2as1 != null) + throw ParseError(errorPos, Res.BothTypesConvertToOther, type1, type2); + throw ParseError(errorPos, Res.NeitherTypeConvertsToOther, type1, type2); + } + } + return Expression.Condition(test, expr1, expr2); + } + + Expression ParseNew() { + NextToken(); + ValidateToken(TokenId.OpenParen, Res.OpenParenExpected); + NextToken(); + List properties = new List(); + List expressions = new List(); + while (true) { + int exprPos = token.pos; + Expression expr = ParseExpression(); + string propName; + if (TokenIdentifierIs("as")) { + NextToken(); + propName = GetIdentifier(); + NextToken(); + } + else { + MemberExpression me = expr as MemberExpression; + if (me == null) throw ParseError(exprPos, Res.MissingAsClause); + propName = me.Member.Name; + } + expressions.Add(expr); + properties.Add(new DynamicProperty(propName, expr.Type)); + if (token.id != TokenId.Comma) break; + NextToken(); + } + ValidateToken(TokenId.CloseParen, Res.CloseParenOrCommaExpected); + NextToken(); + Type type = DynamicExpression.CreateClass(properties); + MemberBinding[] bindings = new MemberBinding[properties.Count]; + for (int i = 0; i < bindings.Length; i++) + bindings[i] = Expression.Bind(type.GetProperty(properties[i].Name), expressions[i]); + return Expression.MemberInit(Expression.New(type), bindings); + } + + Expression ParseLambdaInvocation(LambdaExpression lambda) { + int errorPos = token.pos; + NextToken(); + Expression[] args = ParseArgumentList(); + MethodBase method; + if (FindMethod(lambda.Type, "Invoke", false, args, out method) != 1) + throw ParseError(errorPos, Res.ArgsIncompatibleWithLambda); + return Expression.Invoke(lambda, args); + } + + Expression ParseTypeAccess(Type type) { + int errorPos = token.pos; + NextToken(); + if (token.id == TokenId.Question) { + if (!type.IsValueType || IsNullableType(type)) + throw ParseError(errorPos, Res.TypeHasNoNullableForm, GetTypeName(type)); + type = typeof(Nullable<>).MakeGenericType(type); + NextToken(); + } + if (token.id == TokenId.OpenParen) { + Expression[] args = ParseArgumentList(); + MethodBase method; + switch (FindBestMethod(type.GetConstructors(), args, out method)) { + case 0: + if (args.Length == 1) + return GenerateConversion(args[0], type, errorPos); + throw ParseError(errorPos, Res.NoMatchingConstructor, GetTypeName(type)); + case 1: + return Expression.New((ConstructorInfo)method, args); + default: + throw ParseError(errorPos, Res.AmbiguousConstructorInvocation, GetTypeName(type)); + } + } + ValidateToken(TokenId.Dot, Res.DotOrOpenParenExpected); + NextToken(); + return ParseMemberAccess(type, null); + } + + Expression GenerateConversion(Expression expr, Type type, int errorPos) { + Type exprType = expr.Type; + if (exprType == type) return expr; + if (exprType.IsValueType && type.IsValueType) { + if ((IsNullableType(exprType) || IsNullableType(type)) && + GetNonNullableType(exprType) == GetNonNullableType(type)) + return Expression.Convert(expr, type); + if ((IsNumericType(exprType) || IsEnumType(exprType)) && + (IsNumericType(type)) || IsEnumType(type)) + return Expression.ConvertChecked(expr, type); + } + if (exprType.IsAssignableFrom(type) || type.IsAssignableFrom(exprType) || + exprType.IsInterface || type.IsInterface) + return Expression.Convert(expr, type); + throw ParseError(errorPos, Res.CannotConvertValue, + GetTypeName(exprType), GetTypeName(type)); + } + + Expression ParseMemberAccess(Type type, Expression instance) { + if (instance != null) type = instance.Type; + int errorPos = token.pos; + string id = GetIdentifier(); + NextToken(); + if (token.id == TokenId.OpenParen) { + if (instance != null && type != typeof(string)) { + Type enumerableType = FindGenericType(typeof(IEnumerable<>), type); + if (enumerableType != null) { + Type elementType = enumerableType.GetGenericArguments()[0]; + return ParseAggregate(instance, elementType, id, errorPos); + } + } + Expression[] args = ParseArgumentList(); + MethodBase mb; + switch (FindMethod(type, id, instance == null, args, out mb)) { + case 0: + throw ParseError(errorPos, Res.NoApplicableMethod, + id, GetTypeName(type)); + case 1: + MethodInfo method = (MethodInfo)mb; + if (!IsPredefinedType(method.DeclaringType)) + throw ParseError(errorPos, Res.MethodsAreInaccessible, GetTypeName(method.DeclaringType)); + if (method.ReturnType == typeof(void)) + throw ParseError(errorPos, Res.MethodIsVoid, + id, GetTypeName(method.DeclaringType)); + return Expression.Call(instance, (MethodInfo)method, args); + default: + throw ParseError(errorPos, Res.AmbiguousMethodInvocation, + id, GetTypeName(type)); + } + } + else { + MemberInfo member = FindPropertyOrField(type, id, instance == null); + if (member == null) + + throw ParseError(errorPos, Res.UnknownPropertyOrField, + id, GetTypeName(type)); + return member is PropertyInfo ? + Expression.Property(instance, (PropertyInfo)member) : + Expression.Field(instance, (FieldInfo)member); + } + } + + static Type FindGenericType(Type generic, Type type) { + while (type != null && type != typeof(object)) { + if (type.IsGenericType && type.GetGenericTypeDefinition() == generic) return type; + if (generic.IsInterface) { + foreach (Type intfType in type.GetInterfaces()) { + Type found = FindGenericType(generic, intfType); + if (found != null) return found; + } + } + type = type.BaseType; + } + return null; + } + + Expression ParseAggregate(Expression instance, Type elementType, string methodName, int errorPos) { + ParameterExpression outerIt = it; + ParameterExpression innerIt = Expression.Parameter(elementType, ""); + it = innerIt; + Expression[] args = ParseArgumentList(); + it = outerIt; + MethodBase signature; + if (FindMethod(typeof(IEnumerableSignatures), methodName, false, args, out signature) != 1) + throw ParseError(errorPos, Res.NoApplicableAggregate, methodName); + Type[] typeArgs; + if (signature.Name == "Min" || signature.Name == "Max") { + typeArgs = new Type[] { elementType, args[0].Type }; + } + else { + typeArgs = new Type[] { elementType }; + } + if (args.Length == 0) { + args = new Expression[] { instance }; + } + else { + args = new Expression[] { instance, Expression.Lambda(args[0], innerIt) }; + } + return Expression.Call(typeof(Enumerable), signature.Name, typeArgs, args); + } + + Expression[] ParseArgumentList() { + ValidateToken(TokenId.OpenParen, Res.OpenParenExpected); + NextToken(); + Expression[] args = token.id != TokenId.CloseParen ? ParseArguments() : new Expression[0]; + ValidateToken(TokenId.CloseParen, Res.CloseParenOrCommaExpected); + NextToken(); + return args; + } + + Expression[] ParseArguments() { + List argList = new List(); + while (true) { + argList.Add(ParseExpression()); + if (token.id != TokenId.Comma) break; + NextToken(); + } + return argList.ToArray(); + } + + Expression ParseElementAccess(Expression expr) { + int errorPos = token.pos; + ValidateToken(TokenId.OpenBracket, Res.OpenParenExpected); + NextToken(); + Expression[] args = ParseArguments(); + ValidateToken(TokenId.CloseBracket, Res.CloseBracketOrCommaExpected); + NextToken(); + if (expr.Type.IsArray) { + if (expr.Type.GetArrayRank() != 1 || args.Length != 1) + throw ParseError(errorPos, Res.CannotIndexMultiDimArray); + Expression index = PromoteExpression(args[0], typeof(int), true); + if (index == null) + throw ParseError(errorPos, Res.InvalidIndex); + return Expression.ArrayIndex(expr, index); + } + else { + MethodBase mb; + switch (FindIndexer(expr.Type, args, out mb)) { + case 0: + throw ParseError(errorPos, Res.NoApplicableIndexer, + GetTypeName(expr.Type)); + case 1: + return Expression.Call(expr, (MethodInfo)mb, args); + default: + throw ParseError(errorPos, Res.AmbiguousIndexerInvocation, + GetTypeName(expr.Type)); + } + } + } + + static bool IsPredefinedType(Type type) { + foreach (Type t in predefinedTypes) if (t == type) return true; + return false; + } + + static bool IsNullableType(Type type) { + return type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>); + } + + static Type GetNonNullableType(Type type) { + return IsNullableType(type) ? type.GetGenericArguments()[0] : type; + } + + static string GetTypeName(Type type) { + Type baseType = GetNonNullableType(type); + string s = baseType.Name; + if (type != baseType) s += '?'; + return s; + } + + static bool IsNumericType(Type type) { + return GetNumericTypeKind(type) != 0; + } + + static bool IsSignedIntegralType(Type type) { + return GetNumericTypeKind(type) == 2; + } + + static bool IsUnsignedIntegralType(Type type) { + return GetNumericTypeKind(type) == 3; + } + + static int GetNumericTypeKind(Type type) { + type = GetNonNullableType(type); + if (type.IsEnum) return 0; + switch (Type.GetTypeCode(type)) { + case TypeCode.Char: + case TypeCode.Single: + case TypeCode.Double: + case TypeCode.Decimal: + return 1; + case TypeCode.SByte: + case TypeCode.Int16: + case TypeCode.Int32: + case TypeCode.Int64: + return 2; + case TypeCode.Byte: + case TypeCode.UInt16: + case TypeCode.UInt32: + case TypeCode.UInt64: + return 3; + default: + return 0; + } + } + + static bool IsEnumType(Type type) { + return GetNonNullableType(type).IsEnum; + } + + void CheckAndPromoteOperand(Type signatures, string opName, ref Expression expr, int errorPos) { + Expression[] args = new Expression[] { expr }; + MethodBase method; + if (FindMethod(signatures, "F", false, args, out method) != 1) + throw ParseError(errorPos, Res.IncompatibleOperand, + opName, GetTypeName(args[0].Type)); + expr = args[0]; + } + + void CheckAndPromoteOperands(Type signatures, string opName, ref Expression left, ref Expression right, int errorPos) { + Expression[] args = new Expression[] { left, right }; + MethodBase method; + if (FindMethod(signatures, "F", false, args, out method) != 1) + throw IncompatibleOperandsError(opName, left, right, errorPos); + left = args[0]; + right = args[1]; + } + + Exception IncompatibleOperandsError(string opName, Expression left, Expression right, int pos) { + return ParseError(pos, Res.IncompatibleOperands, + opName, GetTypeName(left.Type), GetTypeName(right.Type)); + } + + MemberInfo FindPropertyOrField(Type type, string memberName, bool staticAccess) { + BindingFlags flags = BindingFlags.Public | BindingFlags.DeclaredOnly | + (staticAccess ? BindingFlags.Static : BindingFlags.Instance); + foreach (Type t in SelfAndBaseTypes(type)) { + MemberInfo[] members = t.FindMembers(MemberTypes.Property | MemberTypes.Field, + flags, Type.FilterNameIgnoreCase, memberName); + if (members.Length != 0) return members[0]; + } + return null; + } + + int FindMethod(Type type, string methodName, bool staticAccess, Expression[] args, out MethodBase method) { + BindingFlags flags = BindingFlags.Public | BindingFlags.DeclaredOnly | + (staticAccess ? BindingFlags.Static : BindingFlags.Instance); + foreach (Type t in SelfAndBaseTypes(type)) { + MemberInfo[] members = t.FindMembers(MemberTypes.Method, + flags, Type.FilterNameIgnoreCase, methodName); + int count = FindBestMethod(members.Cast(), args, out method); + if (count != 0) return count; + } + method = null; + return 0; + } + + int FindIndexer(Type type, Expression[] args, out MethodBase method) { + foreach (Type t in SelfAndBaseTypes(type)) { + MemberInfo[] members = t.GetDefaultMembers(); + if (members.Length != 0) { + IEnumerable methods = members. + OfType(). + Select(p => (MethodBase)p.GetGetMethod()). + Where(m => m != null); + int count = FindBestMethod(methods, args, out method); + if (count != 0) return count; + } + } + method = null; + return 0; + } + + static IEnumerable SelfAndBaseTypes(Type type) { + if (type.IsInterface) { + List types = new List(); + AddInterface(types, type); + return types; + } + return SelfAndBaseClasses(type); + } + + static IEnumerable SelfAndBaseClasses(Type type) { + while (type != null) { + yield return type; + type = type.BaseType; + } + } + + static void AddInterface(List types, Type type) { + if (!types.Contains(type)) { + types.Add(type); + foreach (Type t in type.GetInterfaces()) AddInterface(types, t); + } + } + + class MethodData + { + public MethodBase MethodBase; + public ParameterInfo[] Parameters; + public Expression[] Args; + } + + int FindBestMethod(IEnumerable methods, Expression[] args, out MethodBase method) { + MethodData[] applicable = methods. + Select(m => new MethodData { MethodBase = m, Parameters = m.GetParameters() }). + Where(m => IsApplicable(m, args)). + ToArray(); + if (applicable.Length > 1) { + applicable = applicable. + Where(m => applicable.All(n => m == n || IsBetterThan(args, m, n))). + ToArray(); + } + if (applicable.Length == 1) { + MethodData md = applicable[0]; + for (int i = 0; i < args.Length; i++) args[i] = md.Args[i]; + method = md.MethodBase; + } + else { + method = null; + } + return applicable.Length; + } + + bool IsApplicable(MethodData method, Expression[] args) { + if (method.Parameters.Length != args.Length) return false; + Expression[] promotedArgs = new Expression[args.Length]; + for (int i = 0; i < args.Length; i++) { + ParameterInfo pi = method.Parameters[i]; + if (pi.IsOut) return false; + Expression promoted = PromoteExpression(args[i], pi.ParameterType, false); + if (promoted == null) return false; + promotedArgs[i] = promoted; + } + method.Args = promotedArgs; + return true; + } + + Expression PromoteExpression(Expression expr, Type type, bool exact) { + if (expr.Type == type) return expr; + if (expr is ConstantExpression) { + ConstantExpression ce = (ConstantExpression)expr; + if (ce == nullLiteral) { + if (!type.IsValueType || IsNullableType(type)) + return Expression.Constant(null, type); + } + else { + string text; + if (literals.TryGetValue(ce, out text)) { + Type target = GetNonNullableType(type); + Object value = null; + switch (Type.GetTypeCode(ce.Type)) { + case TypeCode.Int32: + case TypeCode.UInt32: + case TypeCode.Int64: + case TypeCode.UInt64: + value = ParseNumber(text, target); + break; + case TypeCode.Double: + if (target == typeof(decimal)) value = ParseNumber(text, target); + break; + case TypeCode.String: + value = ParseEnum(text, target); + break; + } + if (value != null) + return Expression.Constant(value, type); + } + } + } + if (IsCompatibleWith(expr.Type, type)) { + if (type.IsValueType || exact) return Expression.Convert(expr, type); + return expr; + } + return null; + } + + static object ParseNumber(string text, Type type) { + switch (Type.GetTypeCode(GetNonNullableType(type))) { + case TypeCode.SByte: + sbyte sb; + if (sbyte.TryParse(text, out sb)) return sb; + break; + case TypeCode.Byte: + byte b; + if (byte.TryParse(text, out b)) return b; + break; + case TypeCode.Int16: + short s; + if (short.TryParse(text, out s)) return s; + break; + case TypeCode.UInt16: + ushort us; + if (ushort.TryParse(text, out us)) return us; + break; + case TypeCode.Int32: + int i; + if (int.TryParse(text, out i)) return i; + break; + case TypeCode.UInt32: + uint ui; + if (uint.TryParse(text, out ui)) return ui; + break; + case TypeCode.Int64: + long l; + if (long.TryParse(text, out l)) return l; + break; + case TypeCode.UInt64: + ulong ul; + if (ulong.TryParse(text, out ul)) return ul; + break; + case TypeCode.Single: + float f; + if (float.TryParse(text, out f)) return f; + break; + case TypeCode.Double: + double d; + if (double.TryParse(text, out d)) return d; + break; + case TypeCode.Decimal: + decimal e; + if (decimal.TryParse(text, out e)) return e; + break; + } + return null; + } + + static object ParseEnum(string name, Type type) { + if (type.IsEnum) { + MemberInfo[] memberInfos = type.FindMembers(MemberTypes.Field, + BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.Static, + Type.FilterNameIgnoreCase, name); + if (memberInfos.Length != 0) return ((FieldInfo)memberInfos[0]).GetValue(null); + } + return null; + } + + static bool IsCompatibleWith(Type source, Type target) { + if (source == target) return true; + if (!target.IsValueType) return target.IsAssignableFrom(source); + Type st = GetNonNullableType(source); + Type tt = GetNonNullableType(target); + if (st != source && tt == target) return false; + TypeCode sc = st.IsEnum ? TypeCode.Object : Type.GetTypeCode(st); + TypeCode tc = tt.IsEnum ? TypeCode.Object : Type.GetTypeCode(tt); + switch (sc) { + case TypeCode.SByte: + switch (tc) { + case TypeCode.SByte: + case TypeCode.Int16: + case TypeCode.Int32: + case TypeCode.Int64: + case TypeCode.Single: + case TypeCode.Double: + case TypeCode.Decimal: + return true; + } + break; + case TypeCode.Byte: + switch (tc) { + case TypeCode.Byte: + case TypeCode.Int16: + case TypeCode.UInt16: + case TypeCode.Int32: + case TypeCode.UInt32: + case TypeCode.Int64: + case TypeCode.UInt64: + case TypeCode.Single: + case TypeCode.Double: + case TypeCode.Decimal: + return true; + } + break; + case TypeCode.Int16: + switch (tc) { + case TypeCode.Int16: + case TypeCode.Int32: + case TypeCode.Int64: + case TypeCode.Single: + case TypeCode.Double: + case TypeCode.Decimal: + return true; + } + break; + case TypeCode.UInt16: + switch (tc) { + case TypeCode.UInt16: + case TypeCode.Int32: + case TypeCode.UInt32: + case TypeCode.Int64: + case TypeCode.UInt64: + case TypeCode.Single: + case TypeCode.Double: + case TypeCode.Decimal: + return true; + } + break; + case TypeCode.Int32: + switch (tc) { + case TypeCode.Int32: + case TypeCode.Int64: + case TypeCode.Single: + case TypeCode.Double: + case TypeCode.Decimal: + return true; + } + break; + case TypeCode.UInt32: + switch (tc) { + case TypeCode.UInt32: + case TypeCode.Int64: + case TypeCode.UInt64: + case TypeCode.Single: + case TypeCode.Double: + case TypeCode.Decimal: + return true; + } + break; + case TypeCode.Int64: + switch (tc) { + case TypeCode.Int64: + case TypeCode.Single: + case TypeCode.Double: + case TypeCode.Decimal: + return true; + } + break; + case TypeCode.UInt64: + switch (tc) { + case TypeCode.UInt64: + case TypeCode.Single: + case TypeCode.Double: + case TypeCode.Decimal: + return true; + } + break; + case TypeCode.Single: + switch (tc) { + case TypeCode.Single: + case TypeCode.Double: + return true; + } + break; + default: + if (st == tt) return true; + break; + } + return false; + } + + static bool IsBetterThan(Expression[] args, MethodData m1, MethodData m2) { + bool better = false; + for (int i = 0; i < args.Length; i++) { + int c = CompareConversions(args[i].Type, + m1.Parameters[i].ParameterType, + m2.Parameters[i].ParameterType); + if (c < 0) return false; + if (c > 0) better = true; + } + return better; + } + + // Return 1 if s -> t1 is a better conversion than s -> t2 + // Return -1 if s -> t2 is a better conversion than s -> t1 + // Return 0 if neither conversion is better + static int CompareConversions(Type s, Type t1, Type t2) { + if (t1 == t2) return 0; + if (s == t1) return 1; + if (s == t2) return -1; + bool t1t2 = IsCompatibleWith(t1, t2); + bool t2t1 = IsCompatibleWith(t2, t1); + if (t1t2 && !t2t1) return 1; + if (t2t1 && !t1t2) return -1; + if (IsSignedIntegralType(t1) && IsUnsignedIntegralType(t2)) return 1; + if (IsSignedIntegralType(t2) && IsUnsignedIntegralType(t1)) return -1; + return 0; + } + + Expression GenerateEqual(Expression left, Expression right) { + return Expression.Equal(left, right); + } + + Expression GenerateNotEqual(Expression left, Expression right) { + return Expression.NotEqual(left, right); + } + + Expression GenerateGreaterThan(Expression left, Expression right) { + if (left.Type == typeof(string)) { + return Expression.GreaterThan( + GenerateStaticMethodCall("Compare", left, right), + Expression.Constant(0) + ); + } + return Expression.GreaterThan(left, right); + } + + Expression GenerateGreaterThanEqual(Expression left, Expression right) { + if (left.Type == typeof(string)) { + return Expression.GreaterThanOrEqual( + GenerateStaticMethodCall("Compare", left, right), + Expression.Constant(0) + ); + } + return Expression.GreaterThanOrEqual(left, right); + } + + Expression GenerateLessThan(Expression left, Expression right) { + if (left.Type == typeof(string)) { + return Expression.LessThan( + GenerateStaticMethodCall("Compare", left, right), + Expression.Constant(0) + ); + } + return Expression.LessThan(left, right); + } + + Expression GenerateLessThanEqual(Expression left, Expression right) { + if (left.Type == typeof(string)) { + return Expression.LessThanOrEqual( + GenerateStaticMethodCall("Compare", left, right), + Expression.Constant(0) + ); + } + return Expression.LessThanOrEqual(left, right); + } + + Expression GenerateAdd(Expression left, Expression right) { + if (left.Type == typeof(string) && right.Type == typeof(string)) { + return GenerateStaticMethodCall("Concat", left, right); + } + return Expression.Add(left, right); + } + + Expression GenerateSubtract(Expression left, Expression right) { + return Expression.Subtract(left, right); + } + + Expression GenerateStringConcat(Expression left, Expression right) { + return Expression.Call( + null, + typeof(string).GetMethod("Concat", new[] { typeof(object), typeof(object) }), + new[] { left, right }); + } + + MethodInfo GetStaticMethod(string methodName, Expression left, Expression right) { + return left.Type.GetMethod(methodName, new[] { left.Type, right.Type }); + } + + Expression GenerateStaticMethodCall(string methodName, Expression left, Expression right) { + return Expression.Call(null, GetStaticMethod(methodName, left, right), new[] { left, right }); + } + + void SetTextPos(int pos) { + textPos = pos; + ch = textPos < textLen ? text[textPos] : '\0'; + } + + void NextChar() { + if (textPos < textLen) textPos++; + ch = textPos < textLen ? text[textPos] : '\0'; + } + + void NextToken() { + while (Char.IsWhiteSpace(ch)) NextChar(); + TokenId t; + int tokenPos = textPos; + switch (ch) { + case '!': + NextChar(); + if (ch == '=') { + NextChar(); + t = TokenId.ExclamationEqual; + } + else { + t = TokenId.Exclamation; + } + break; + case '%': + NextChar(); + t = TokenId.Percent; + break; + case '&': + NextChar(); + if (ch == '&') { + NextChar(); + t = TokenId.DoubleAmphersand; + } + else { + t = TokenId.Amphersand; + } + break; + case '(': + NextChar(); + t = TokenId.OpenParen; + break; + case ')': + NextChar(); + t = TokenId.CloseParen; + break; + case '*': + NextChar(); + t = TokenId.Asterisk; + break; + case '+': + NextChar(); + t = TokenId.Plus; + break; + case ',': + NextChar(); + t = TokenId.Comma; + break; + case '-': + NextChar(); + t = TokenId.Minus; + break; + case '.': + NextChar(); + t = TokenId.Dot; + break; + case '/': + NextChar(); + t = TokenId.Slash; + break; + case ':': + NextChar(); + t = TokenId.Colon; + break; + case '<': + NextChar(); + if (ch == '=') { + NextChar(); + t = TokenId.LessThanEqual; + } + else if (ch == '>') { + NextChar(); + t = TokenId.LessGreater; + } + else { + t = TokenId.LessThan; + } + break; + case '=': + NextChar(); + if (ch == '=') { + NextChar(); + t = TokenId.DoubleEqual; + } + else { + t = TokenId.Equal; + } + break; + case '>': + NextChar(); + if (ch == '=') { + NextChar(); + t = TokenId.GreaterThanEqual; + } + else { + t = TokenId.GreaterThan; + } + break; + case '?': + NextChar(); + t = TokenId.Question; + break; + case '[': + NextChar(); + t = TokenId.OpenBracket; + break; + case ']': + NextChar(); + t = TokenId.CloseBracket; + break; + case '|': + NextChar(); + if (ch == '|') { + NextChar(); + t = TokenId.DoubleBar; + } + else { + t = TokenId.Bar; + } + break; + case '"': + case '\'': + char quote = ch; + do { + NextChar(); + while (textPos < textLen && ch != quote) NextChar(); + if (textPos == textLen) + throw ParseError(textPos, Res.UnterminatedStringLiteral); + NextChar(); + } while (ch == quote); + t = TokenId.StringLiteral; + break; + default: + if (Char.IsLetter(ch) || ch == '@' || ch == '_') { + do { + NextChar(); + } while (Char.IsLetterOrDigit(ch) || ch == '_'); + t = TokenId.Identifier; + break; + } + if (Char.IsDigit(ch)) { + t = TokenId.IntegerLiteral; + do { + NextChar(); + } while (Char.IsDigit(ch)); + if (ch == '.') { + t = TokenId.RealLiteral; + NextChar(); + ValidateDigit(); + do { + NextChar(); + } while (Char.IsDigit(ch)); + } + if (ch == 'E' || ch == 'e') { + t = TokenId.RealLiteral; + NextChar(); + if (ch == '+' || ch == '-') NextChar(); + ValidateDigit(); + do { + NextChar(); + } while (Char.IsDigit(ch)); + } + if (ch == 'F' || ch == 'f') NextChar(); + break; + } + if (textPos == textLen) { + t = TokenId.End; + break; + } + throw ParseError(textPos, Res.InvalidCharacter, ch); + } + token.id = t; + token.text = text.Substring(tokenPos, textPos - tokenPos); + token.pos = tokenPos; + } + + bool TokenIdentifierIs(string id) { + return token.id == TokenId.Identifier && String.Equals(id, token.text, StringComparison.OrdinalIgnoreCase); + } + + string GetIdentifier() { + ValidateToken(TokenId.Identifier, Res.IdentifierExpected); + string id = token.text; + if (id.Length > 1 && id[0] == '@') id = id.Substring(1); + return id; + } + + void ValidateDigit() { + if (!Char.IsDigit(ch)) throw ParseError(textPos, Res.DigitExpected); + } + + void ValidateToken(TokenId t, string errorMessage) { + if (token.id != t) throw ParseError(errorMessage); + } + + void ValidateToken(TokenId t) { + if (token.id != t) throw ParseError(Res.SyntaxError); + } + + Exception ParseError(string format, params object[] args) { + return ParseError(token.pos, format, args); + } + + Exception ParseError(int pos, string format, params object[] args) { + return new ParseException(string.Format(System.Globalization.CultureInfo.CurrentCulture, format, args), pos); + } + + static Dictionary CreateKeywords() { + Dictionary d = new Dictionary(StringComparer.OrdinalIgnoreCase); + d.Add("true", trueLiteral); + d.Add("false", falseLiteral); + d.Add("null", nullLiteral); + d.Add(keywordIt, keywordIt); + d.Add(keywordIif, keywordIif); + d.Add(keywordNew, keywordNew); + foreach (Type type in predefinedTypes) d.Add(type.Name, type); + return d; + } + } + + static class Res + { + public const string DuplicateIdentifier = "The identifier '{0}' was defined more than once"; + public const string ExpressionTypeMismatch = "Expression of type '{0}' expected"; + public const string ExpressionExpected = "Expression expected"; + public const string InvalidCharacterLiteral = "Character literal must contain exactly one character"; + public const string InvalidIntegerLiteral = "Invalid integer literal '{0}'"; + public const string InvalidRealLiteral = "Invalid real literal '{0}'"; + public const string UnknownIdentifier = "Unknown identifier '{0}'"; + public const string NoItInScope = "No 'it' is in scope"; + public const string IifRequiresThreeArgs = "The 'iif' function requires three arguments"; + public const string FirstExprMustBeBool = "The first expression must be of type 'Boolean'"; + public const string BothTypesConvertToOther = "Both of the types '{0}' and '{1}' convert to the other"; + public const string NeitherTypeConvertsToOther = "Neither of the types '{0}' and '{1}' converts to the other"; + public const string MissingAsClause = "Expression is missing an 'as' clause"; + public const string ArgsIncompatibleWithLambda = "Argument list incompatible with lambda expression"; + public const string TypeHasNoNullableForm = "Type '{0}' has no nullable form"; + public const string NoMatchingConstructor = "No matching constructor in type '{0}'"; + public const string AmbiguousConstructorInvocation = "Ambiguous invocation of '{0}' constructor"; + public const string CannotConvertValue = "A value of type '{0}' cannot be converted to type '{1}'"; + public const string NoApplicableMethod = "No applicable method '{0}' exists in type '{1}'"; + public const string MethodsAreInaccessible = "Methods on type '{0}' are not accessible"; + public const string MethodIsVoid = "Method '{0}' in type '{1}' does not return a value"; + public const string AmbiguousMethodInvocation = "Ambiguous invocation of method '{0}' in type '{1}'"; + public const string UnknownPropertyOrField = "No property or field '{0}' exists in type '{1}'"; + public const string NoApplicableAggregate = "No applicable aggregate method '{0}' exists"; + public const string CannotIndexMultiDimArray = "Indexing of multi-dimensional arrays is not supported"; + public const string InvalidIndex = "Array index must be an integer expression"; + public const string NoApplicableIndexer = "No applicable indexer exists in type '{0}'"; + public const string AmbiguousIndexerInvocation = "Ambiguous invocation of indexer in type '{0}'"; + public const string IncompatibleOperand = "Operator '{0}' incompatible with operand type '{1}'"; + public const string IncompatibleOperands = "Operator '{0}' incompatible with operand types '{1}' and '{2}'"; + public const string UnterminatedStringLiteral = "Unterminated string literal"; + public const string InvalidCharacter = "Syntax error '{0}'"; + public const string DigitExpected = "Digit expected"; + public const string SyntaxError = "Syntax error"; + public const string TokenExpected = "{0} expected"; + public const string ParseExceptionFormat = "{0} (at index {1})"; + public const string ColonExpected = "':' expected"; + public const string OpenParenExpected = "'(' expected"; + public const string CloseParenOrOperatorExpected = "')' or operator expected"; + public const string CloseParenOrCommaExpected = "')' or ',' expected"; + public const string DotOrOpenParenExpected = "'.' or '(' expected"; + public const string OpenBracketExpected = "'[' expected"; + public const string CloseBracketOrCommaExpected = "']' or ',' expected"; + public const string IdentifierExpected = "Identifier expected"; + } +} diff --git a/src/tools/GameServer/MessageViewer/ErrorNode.cs b/src/tools/GameServer/MessageViewer/ErrorNode.cs new file mode 100644 index 00000000..781a5c95 --- /dev/null +++ b/src/tools/GameServer/MessageViewer/ErrorNode.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using Mooege.Net.GS.Message; +using System.Drawing; +using Mooege.Net.GS.Message.Definitions.Misc; + +namespace GameMessageViewer +{ + public class ErrorNode : TreeNode, ITextNode + { + string description; + + public ErrorNode(string name, string description) + { + Text = name; + this.description = description; + } + + public string AsText() + { + return description; + } + } +} diff --git a/src/tools/GameServer/MessageViewer/Find.Designer.cs b/src/tools/GameServer/MessageViewer/Find.Designer.cs new file mode 100644 index 00000000..6ff42622 --- /dev/null +++ b/src/tools/GameServer/MessageViewer/Find.Designer.cs @@ -0,0 +1,92 @@ +namespace GameMessageViewer +{ + partial class Find + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.cboMessages = new System.Windows.Forms.ComboBox(); + this.button1 = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 17); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(27, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Find"; + // + // cboMessages + // + this.cboMessages.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.cboMessages.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.cboMessages.FormattingEnabled = true; + this.cboMessages.Location = new System.Drawing.Point(54, 12); + this.cboMessages.Name = "cboMessages"; + this.cboMessages.Size = new System.Drawing.Size(252, 21); + this.cboMessages.TabIndex = 1; + // + // button1 + // + this.button1.DialogResult = System.Windows.Forms.DialogResult.OK; + this.button1.Location = new System.Drawing.Point(225, 43); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(82, 27); + this.button1.TabIndex = 2; + this.button1.Text = "OK"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // Find + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(321, 81); + this.Controls.Add(this.button1); + this.Controls.Add(this.cboMessages); + this.Controls.Add(this.label1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.KeyPreview = true; + this.Name = "Find"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Find all messages of type"; + this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.Find_FormClosed); + this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Find_KeyDown); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.ComboBox cboMessages; + private System.Windows.Forms.Button button1; + } +} \ No newline at end of file diff --git a/src/tools/GameServer/MessageViewer/Find.cs b/src/tools/GameServer/MessageViewer/Find.cs new file mode 100644 index 00000000..cfc68af3 --- /dev/null +++ b/src/tools/GameServer/MessageViewer/Find.cs @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using System.Reflection; +using Mooege.Net.GS.Message; + +namespace GameMessageViewer +{ + public partial class Find : Form + { + public string Filter; + + public Find() + { + InitializeComponent(); + + List items = new List(); + foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies()) + foreach (Type type in assembly.GetTypes()) + if (type.BaseType == typeof(GameMessage)) + items.Add(type.Name); + + items.Sort(); + foreach(String message in items) + cboMessages.Items.Add(message); + } + /* + public new DialogResult Show() + { + /* + DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.ShowDialog(); + return this.DialogResult; + * */ + //} + + + + + private void button1_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.OK; + this.Close(); + } + + private void Find_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Enter) + { + DialogResult = DialogResult.OK; + this.Close(); + } + } + + private void Find_FormClosed(object sender, FormClosedEventArgs e) + { + this.Filter = this.cboMessages.Text; + } + } +} diff --git a/src/tools/GameServer/MessageViewer/Find.resx b/src/tools/GameServer/MessageViewer/Find.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/src/tools/GameServer/MessageViewer/Find.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/src/tools/GameServer/MessageViewer/GameMessageViewer.csproj b/src/tools/GameServer/MessageViewer/GameMessageViewer.csproj new file mode 100644 index 00000000..334fac0c --- /dev/null +++ b/src/tools/GameServer/MessageViewer/GameMessageViewer.csproj @@ -0,0 +1,177 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {A36F30DF-2C60-40EB-9196-C56DDECB8E34} + WinExe + Properties + GameMessageViewer + GameMessageViewer + v4.0 + Client + 512 + + + x86 + true + full + false + ..\..\..\Mooege\bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + ..\..\..\..\dep\protobuf-csharp\Google.ProtocolBuffers.dll + + + False + .exe + ..\..\..\Mooege\bin\Debug\Mooege.exe + + + False + ..\..\..\..\dep\sharppcap\PacketDotNet.dll + + + False + ..\..\..\..\dep\sharppcap\SharpPcap.dll + + + + + + + + + + + + + + Form + + + AboutBox.cs + + + + Form + + + CustomLinqQuery.cs + + + + + Form + + + Find.cs + + + Form + + + MessageViewer.cs + + + Form + + + Form + + + MessageFilter.cs + + + + + + + + + + + Form + + + Streams.cs + + + + AboutBox.cs + Designer + + + CustomLinqQuery.cs + Designer + + + Find.cs + Designer + + + MessageViewer.cs + Designer + + + MessageFilter.cs + Designer + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + Streams.cs + Designer + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + {4CC19847-6F24-4453-9E31-126F94308AB9} + LibMooNet + + + + + \ No newline at end of file diff --git a/src/tools/GameServer/MessageViewer/MessageFilter.Designer.cs b/src/tools/GameServer/MessageViewer/MessageFilter.Designer.cs new file mode 100644 index 00000000..3ed0a5c0 --- /dev/null +++ b/src/tools/GameServer/MessageViewer/MessageFilter.Designer.cs @@ -0,0 +1,78 @@ +namespace GameMessageViewer +{ + partial class MessageFilter + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.cmdOk = new System.Windows.Forms.Button(); + this.Presets = new System.Windows.Forms.ComboBox(); + this.SuspendLayout(); + // + // cmdOk + // + this.cmdOk.Location = new System.Drawing.Point(863, 343); + this.cmdOk.Name = "cmdOk"; + this.cmdOk.Size = new System.Drawing.Size(144, 34); + this.cmdOk.TabIndex = 0; + this.cmdOk.Text = "OK"; + this.cmdOk.UseVisualStyleBackColor = true; + this.cmdOk.Click += new System.EventHandler(this.cmdOk_Click); + // + // Presets + // + this.Presets.BackColor = System.Drawing.SystemColors.Window; + this.Presets.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.Presets.FormattingEnabled = true; + this.Presets.Location = new System.Drawing.Point(12, 351); + this.Presets.Name = "Presets"; + this.Presets.Size = new System.Drawing.Size(162, 21); + this.Presets.TabIndex = 3; + this.Presets.SelectedIndexChanged += new System.EventHandler(this.Presets_SelectedIndexChanged); + // + // MessageFilter + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1019, 389); + this.ControlBox = false; + this.Controls.Add(this.Presets); + this.Controls.Add(this.cmdOk); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "MessageFilter"; + this.Text = "Message filter"; + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button cmdOk; + private System.Windows.Forms.ComboBox Presets; + } +} \ No newline at end of file diff --git a/src/tools/GameServer/MessageViewer/MessageFilter.cs b/src/tools/GameServer/MessageViewer/MessageFilter.cs new file mode 100644 index 00000000..25674a1f --- /dev/null +++ b/src/tools/GameServer/MessageViewer/MessageFilter.cs @@ -0,0 +1,194 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using System.Reflection; +using Mooege.Net.GS.Message; + +namespace GameMessageViewer +{ + public partial class MessageFilter : Form + { + private class Preset + { + public string Name; + public Dictionary Filter; + public override string ToString() { return Name; } + } + + + public Dictionary Filter = new Dictionary(); + + + public MessageFilter() + { + InitializeComponent(); + + List boxes = new List(); + + foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies()) + foreach (Type type in assembly.GetTypes()) + if (type.BaseType == typeof(GameMessage)) + { + CheckBox chk = new CheckBox(); + chk.Font = new Font(chk.Font.FontFamily, 7); + chk.Tag = type.Name; + chk.Text = type.Name; + chk.AutoSize = true; + boxes.Add(chk); + } + + boxes.Sort((a, b) => a.Text.CompareTo(b.Text)); + + int itemsPerRow = 35; + int count = 0; + foreach (CheckBox c in boxes) + { + c.Left = 20 + 220 * (count / itemsPerRow); + c.Top = 20 + 18 * (count++ % itemsPerRow); + Controls.Add(c); + } + + int Width = 40 + (count / itemsPerRow + 1) * 220; + int Height = 100 + itemsPerRow * 18; + this.ClientSize = new System.Drawing.Size(Width, Height); + Presets.Top = this.ClientSize.Height - Presets.Height - 20; + Presets.Left = 20; + cmdOk.Left = this.ClientSize.Width - cmdOk.Width - 20; + cmdOk.Top = this.ClientSize.Height - cmdOk.Height - 20; + + foreach (Preset p in CreatePresets()) + Presets.Items.Add(p); + + Presets.SelectedIndex = 0; + + } + + new public void Show(List nodes) + { + this.ShowDialog(); + } + + + + + private void cmdOk_Click(object sender, EventArgs e) + { + foreach (Control c in this.Controls) + if (c is CheckBox) + Filter[c.Text] = (c as CheckBox).Checked; + + this.Close(); + } + + private void cmdAll_Click(object sender, EventArgs e) + { + foreach (Control c in this.Controls) + if (c is CheckBox) + (c as CheckBox).Checked = true; + } + + private void cmdNone_Click(object sender, EventArgs e) + { + foreach (Control c in this.Controls) + if (c is CheckBox) + (c as CheckBox).Checked = false; + } + + /// + /// Create some preset filters + /// + /// + private IEnumerable CreatePresets() + { + Dictionary All = new Dictionary(); + foreach (Control c in this.Controls) + if (c is CheckBox) + All[c.Text] = true; + yield return new Preset() { Name = "All", Filter = All }; + + Dictionary None = new Dictionary(); + foreach (Control c in this.Controls) + if (c is CheckBox) + None[c.Text] = false; + yield return new Preset() { Name = "None", Filter = None }; + + Dictionary LessVerbose = All.Clone(); + LessVerbose["GameTickMessage"] = false; + LessVerbose["TrickleMessage"] = false; + LessVerbose["ACDTranslateFacingMessage"] = false; + yield return new Preset() { Name = "Less verbose", Filter = LessVerbose }; + + Dictionary Questing = None.Clone(); + Questing["QuestCounterMessage"] = true; + Questing["QuestMeterMessage"] = true; + Questing["QuestUpdateMessage"] = true; + Questing["WorldTargetMessage"] = true; + yield return new Preset() { Name = "Questing", Filter = Questing }; + + Dictionary Conversation = None.Clone(); + Conversation["PlayConvLineMessage"] = true; + Conversation["FinishConversationMessage"] = true; + Conversation["EndConversationMessage"] = true; + Conversation["RequestCloseConversationWindowMessage"] = true; + Conversation["StopConvLineMessage"] = true; + Conversation["WorldTargetMessage"] = true; + + yield return new Preset() { Name = "Conversation", Filter = Conversation }; + + } + + private void Presets_SelectedIndexChanged(object sender, EventArgs e) + { + LoadPreset(((ComboBox)sender).SelectedItem as Preset); + } + + /// + /// Loads a preset and sets it as selected filter + /// + /// + private void LoadPreset(Preset p) + { + foreach (Control c in this.Controls) + if (c is CheckBox) + (c as CheckBox).Checked = p.Filter[(c as CheckBox).Text]; + this.Filter = p.Filter; + } + } + + /// + /// Extension method to clone dictionaries + /// + public static class DictionaryClone + { + public static Dictionary Clone(this Dictionary original) + { + Dictionary clone = new Dictionary(); + foreach (string key in original.Keys) + clone.Add(key, original[key]); + return clone; + } + } +} diff --git a/src/tools/GameServer/MessageViewer/MessageFilter.resx b/src/tools/GameServer/MessageViewer/MessageFilter.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/src/tools/GameServer/MessageViewer/MessageFilter.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/src/tools/GameServer/MessageViewer/MessageNode.cs b/src/tools/GameServer/MessageViewer/MessageNode.cs new file mode 100644 index 00000000..4e30e0c1 --- /dev/null +++ b/src/tools/GameServer/MessageViewer/MessageNode.cs @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using Mooege.Net.GS.Message; +using System.Drawing; + +namespace GameMessageViewer +{ + public class MessageNode : TreeNode, ITextNode + { + public GameMessage gameMessage; + + public MessageNode(GameMessage message) + { + this.gameMessage = message; + Text = String.Join(".", (message.GetType().ToString().Split('.').Skip(5))); + } + + public new MessageNode Clone() + { + return new MessageNode(gameMessage); + } + + + public string AsText() + { + return gameMessage.AsText(); + } + } +} diff --git a/src/tools/GameServer/MessageViewer/MessageViewer.Designer.cs b/src/tools/GameServer/MessageViewer/MessageViewer.Designer.cs new file mode 100644 index 00000000..04fa6639 --- /dev/null +++ b/src/tools/GameServer/MessageViewer/MessageViewer.Designer.cs @@ -0,0 +1,530 @@ +namespace GameMessageViewer +{ + partial class MessageViewer + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MessageViewer)); + this.panel_mainframe = new System.Windows.Forms.Panel(); + this.tabControl1 = new System.Windows.Forms.TabControl(); + this.tabActors = new System.Windows.Forms.TabPage(); + this.actors = new System.Windows.Forms.TreeView(); + this.tabQuests = new System.Windows.Forms.TabPage(); + this.questTree = new System.Windows.Forms.TreeView(); + this.splitter2 = new System.Windows.Forms.Splitter(); + this.panel_mdump = new System.Windows.Forms.Panel(); + this.panel_mdump_content_ = new System.Windows.Forms.Panel(); + this.panel_mdump_subcontent = new System.Windows.Forms.Panel(); + this.output = new System.Windows.Forms.RichTextBox(); + this.panel_mdump_header = new System.Windows.Forms.Panel(); + this.label1 = new System.Windows.Forms.Label(); + this.splitter1 = new System.Windows.Forms.Splitter(); + this.panel_messages = new System.Windows.Forms.Panel(); + this.panel_messages_content = new System.Windows.Forms.Panel(); + this.tabControl2 = new System.Windows.Forms.TabControl(); + this.tabPage1 = new System.Windows.Forms.TabPage(); + this.tree = new System.Windows.Forms.TreeView(); + this.panel_messages_header = new System.Windows.Forms.Panel(); + this.panel1 = new System.Windows.Forms.Panel(); + this.progressBar = new System.Windows.Forms.ProgressBar(); + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.openPreparsedDumpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator(); + this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.messageFilterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.filterPlayersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.findAllMessagesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.queryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator(); + this.trySNOAliasesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.aboutToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.MooNet = new System.Windows.Forms.TabPage(); + this.MooNetTree = new System.Windows.Forms.TreeView(); + this.panel_mainframe.SuspendLayout(); + this.tabControl1.SuspendLayout(); + this.tabActors.SuspendLayout(); + this.tabQuests.SuspendLayout(); + this.panel_mdump.SuspendLayout(); + this.panel_mdump_content_.SuspendLayout(); + this.panel_mdump_subcontent.SuspendLayout(); + this.panel_mdump_header.SuspendLayout(); + this.panel_messages.SuspendLayout(); + this.panel_messages_content.SuspendLayout(); + this.tabControl2.SuspendLayout(); + this.tabPage1.SuspendLayout(); + this.panel1.SuspendLayout(); + this.menuStrip1.SuspendLayout(); + this.MooNet.SuspendLayout(); + this.SuspendLayout(); + // + // panel_mainframe + // + this.panel_mainframe.AutoScroll = true; + this.panel_mainframe.Controls.Add(this.tabControl1); + this.panel_mainframe.Controls.Add(this.splitter2); + this.panel_mainframe.Controls.Add(this.panel_mdump); + this.panel_mainframe.Controls.Add(this.splitter1); + this.panel_mainframe.Controls.Add(this.panel_messages); + this.panel_mainframe.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel_mainframe.Location = new System.Drawing.Point(0, 0); + this.panel_mainframe.Name = "panel_mainframe"; + this.panel_mainframe.Padding = new System.Windows.Forms.Padding(0, 10, 0, 5); + this.panel_mainframe.Size = new System.Drawing.Size(900, 413); + this.panel_mainframe.TabIndex = 14; + // + // tabControl1 + // + this.tabControl1.Controls.Add(this.tabActors); + this.tabControl1.Controls.Add(this.tabQuests); + this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabControl1.Location = new System.Drawing.Point(536, 10); + this.tabControl1.Name = "tabControl1"; + this.tabControl1.SelectedIndex = 0; + this.tabControl1.Size = new System.Drawing.Size(364, 398); + this.tabControl1.TabIndex = 18; + // + // tabActors + // + this.tabActors.Controls.Add(this.actors); + this.tabActors.Location = new System.Drawing.Point(4, 22); + this.tabActors.Name = "tabActors"; + this.tabActors.Padding = new System.Windows.Forms.Padding(3); + this.tabActors.Size = new System.Drawing.Size(356, 372); + this.tabActors.TabIndex = 0; + this.tabActors.Text = "Actors"; + this.tabActors.UseVisualStyleBackColor = true; + // + // actors + // + this.actors.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.actors.Dock = System.Windows.Forms.DockStyle.Fill; + this.actors.Location = new System.Drawing.Point(3, 3); + this.actors.Name = "actors"; + this.actors.Size = new System.Drawing.Size(350, 366); + this.actors.TabIndex = 5; + this.actors.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.groupedNode_AfterSelect); + // + // tabQuests + // + this.tabQuests.Controls.Add(this.questTree); + this.tabQuests.Location = new System.Drawing.Point(4, 22); + this.tabQuests.Name = "tabQuests"; + this.tabQuests.Padding = new System.Windows.Forms.Padding(3); + this.tabQuests.Size = new System.Drawing.Size(356, 372); + this.tabQuests.TabIndex = 2; + this.tabQuests.Text = "Quests"; + this.tabQuests.UseVisualStyleBackColor = true; + // + // questTree + // + this.questTree.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.questTree.Dock = System.Windows.Forms.DockStyle.Fill; + this.questTree.Location = new System.Drawing.Point(3, 3); + this.questTree.Name = "questTree"; + this.questTree.Size = new System.Drawing.Size(350, 366); + this.questTree.TabIndex = 2; + this.questTree.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.groupedNode_AfterSelect); + // + // splitter2 + // + this.splitter2.BackColor = System.Drawing.SystemColors.Control; + this.splitter2.Location = new System.Drawing.Point(531, 10); + this.splitter2.MinExtra = 3; + this.splitter2.MinSize = 3; + this.splitter2.Name = "splitter2"; + this.splitter2.Size = new System.Drawing.Size(5, 398); + this.splitter2.TabIndex = 15; + this.splitter2.TabStop = false; + // + // panel_mdump + // + this.panel_mdump.Controls.Add(this.panel_mdump_content_); + this.panel_mdump.Controls.Add(this.panel_mdump_header); + this.panel_mdump.Dock = System.Windows.Forms.DockStyle.Left; + this.panel_mdump.Location = new System.Drawing.Point(262, 10); + this.panel_mdump.Name = "panel_mdump"; + this.panel_mdump.Size = new System.Drawing.Size(269, 398); + this.panel_mdump.TabIndex = 14; + // + // panel_mdump_content_ + // + this.panel_mdump_content_.AutoSize = true; + this.panel_mdump_content_.Controls.Add(this.panel_mdump_subcontent); + this.panel_mdump_content_.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel_mdump_content_.Location = new System.Drawing.Point(0, 24); + this.panel_mdump_content_.Name = "panel_mdump_content_"; + this.panel_mdump_content_.Size = new System.Drawing.Size(269, 374); + this.panel_mdump_content_.TabIndex = 5; + // + // panel_mdump_subcontent + // + this.panel_mdump_subcontent.Controls.Add(this.output); + this.panel_mdump_subcontent.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel_mdump_subcontent.Location = new System.Drawing.Point(0, 0); + this.panel_mdump_subcontent.Name = "panel_mdump_subcontent"; + this.panel_mdump_subcontent.Size = new System.Drawing.Size(269, 374); + this.panel_mdump_subcontent.TabIndex = 4; + // + // output + // + this.output.Dock = System.Windows.Forms.DockStyle.Fill; + this.output.Location = new System.Drawing.Point(0, 0); + this.output.Name = "output"; + this.output.ReadOnly = true; + this.output.Size = new System.Drawing.Size(269, 374); + this.output.TabIndex = 5; + this.output.Text = ""; + this.output.MouseClick += new System.Windows.Forms.MouseEventHandler(this.output_MouseClick); + this.output.MouseMove += new System.Windows.Forms.MouseEventHandler(this.output_MouseMove); + // + // panel_mdump_header + // + this.panel_mdump_header.AutoSize = true; + this.panel_mdump_header.Controls.Add(this.label1); + this.panel_mdump_header.Dock = System.Windows.Forms.DockStyle.Top; + this.panel_mdump_header.Location = new System.Drawing.Point(0, 0); + this.panel_mdump_header.Name = "panel_mdump_header"; + this.panel_mdump_header.Size = new System.Drawing.Size(269, 24); + this.panel_mdump_header.TabIndex = 4; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(1, 0); + this.label1.MinimumSize = new System.Drawing.Size(0, 24); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(79, 24); + this.label1.TabIndex = 9; + this.label1.Text = "Message dump"; + this.label1.TextAlign = System.Drawing.ContentAlignment.BottomLeft; + // + // splitter1 + // + this.splitter1.BackColor = System.Drawing.SystemColors.Control; + this.splitter1.Location = new System.Drawing.Point(257, 10); + this.splitter1.MinExtra = 3; + this.splitter1.MinSize = 3; + this.splitter1.Name = "splitter1"; + this.splitter1.Size = new System.Drawing.Size(5, 398); + this.splitter1.TabIndex = 13; + this.splitter1.TabStop = false; + // + // panel_messages + // + this.panel_messages.Controls.Add(this.panel_messages_content); + this.panel_messages.Controls.Add(this.panel_messages_header); + this.panel_messages.Dock = System.Windows.Forms.DockStyle.Left; + this.panel_messages.Location = new System.Drawing.Point(0, 10); + this.panel_messages.Name = "panel_messages"; + this.panel_messages.Size = new System.Drawing.Size(257, 398); + this.panel_messages.TabIndex = 12; + // + // panel_messages_content + // + this.panel_messages_content.Controls.Add(this.tabControl2); + this.panel_messages_content.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel_messages_content.Location = new System.Drawing.Point(0, 0); + this.panel_messages_content.Name = "panel_messages_content"; + this.panel_messages_content.Size = new System.Drawing.Size(257, 398); + this.panel_messages_content.TabIndex = 16; + // + // tabControl2 + // + this.tabControl2.Controls.Add(this.tabPage1); + this.tabControl2.Controls.Add(this.MooNet); + this.tabControl2.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabControl2.Location = new System.Drawing.Point(0, 0); + this.tabControl2.Name = "tabControl2"; + this.tabControl2.SelectedIndex = 0; + this.tabControl2.Size = new System.Drawing.Size(257, 398); + this.tabControl2.TabIndex = 0; + this.tabControl2.DoubleClick += new System.EventHandler(this.tabControl2_DoubleClick); + // + // tabPage1 + // + this.tabPage1.Controls.Add(this.tree); + this.tabPage1.Location = new System.Drawing.Point(4, 22); + this.tabPage1.Name = "tabPage1"; + this.tabPage1.Padding = new System.Windows.Forms.Padding(3); + this.tabPage1.Size = new System.Drawing.Size(249, 372); + this.tabPage1.TabIndex = 0; + this.tabPage1.Text = "Chronologically"; + this.tabPage1.UseVisualStyleBackColor = true; + // + // tree + // + this.tree.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.tree.Dock = System.Windows.Forms.DockStyle.Fill; + this.tree.Location = new System.Drawing.Point(3, 3); + this.tree.Name = "tree"; + this.tree.Size = new System.Drawing.Size(243, 366); + this.tree.TabIndex = 6; + this.tree.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tree_AfterSelect); + // + // panel_messages_header + // + this.panel_messages_header.AutoSize = true; + this.panel_messages_header.Dock = System.Windows.Forms.DockStyle.Top; + this.panel_messages_header.Location = new System.Drawing.Point(0, 0); + this.panel_messages_header.Name = "panel_messages_header"; + this.panel_messages_header.Size = new System.Drawing.Size(257, 0); + this.panel_messages_header.TabIndex = 15; + // + // panel1 + // + this.panel1.Controls.Add(this.panel_mainframe); + this.panel1.Controls.Add(this.progressBar); + this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel1.Location = new System.Drawing.Point(10, 34); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(900, 423); + this.panel1.TabIndex = 0; + // + // progressBar + // + this.progressBar.Dock = System.Windows.Forms.DockStyle.Bottom; + this.progressBar.Location = new System.Drawing.Point(0, 413); + this.progressBar.Name = "progressBar"; + this.progressBar.Size = new System.Drawing.Size(900, 10); + this.progressBar.TabIndex = 15; + // + // menuStrip1 + // + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fileToolStripMenuItem, + this.optionsToolStripMenuItem, + this.aboutToolStripMenuItem}); + this.menuStrip1.Location = new System.Drawing.Point(10, 10); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System; + this.menuStrip1.Size = new System.Drawing.Size(900, 24); + this.menuStrip1.TabIndex = 14; + this.menuStrip1.Text = "menuStrip1"; + // + // fileToolStripMenuItem + // + this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.openPreparsedDumpToolStripMenuItem, + this.toolStripMenuItem2, + this.exitToolStripMenuItem}); + this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); + this.fileToolStripMenuItem.Text = "File"; + // + // openPreparsedDumpToolStripMenuItem + // + this.openPreparsedDumpToolStripMenuItem.Name = "openPreparsedDumpToolStripMenuItem"; + this.openPreparsedDumpToolStripMenuItem.Size = new System.Drawing.Size(134, 22); + this.openPreparsedDumpToolStripMenuItem.Text = "Open..."; + this.openPreparsedDumpToolStripMenuItem.Click += new System.EventHandler(this.openPreparsedDumpToolStripMenuItem_Click); + // + // toolStripMenuItem2 + // + this.toolStripMenuItem2.Name = "toolStripMenuItem2"; + this.toolStripMenuItem2.Size = new System.Drawing.Size(131, 6); + // + // exitToolStripMenuItem + // + this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; + this.exitToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4))); + this.exitToolStripMenuItem.Size = new System.Drawing.Size(134, 22); + this.exitToolStripMenuItem.Text = "Exit"; + this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); + // + // optionsToolStripMenuItem + // + this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.messageFilterToolStripMenuItem, + this.filterPlayersToolStripMenuItem, + this.findAllMessagesToolStripMenuItem, + this.queryToolStripMenuItem, + this.toolStripMenuItem1, + this.trySNOAliasesToolStripMenuItem}); + this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; + this.optionsToolStripMenuItem.Size = new System.Drawing.Size(61, 20); + this.optionsToolStripMenuItem.Text = "Options"; + // + // messageFilterToolStripMenuItem + // + this.messageFilterToolStripMenuItem.Name = "messageFilterToolStripMenuItem"; + this.messageFilterToolStripMenuItem.Size = new System.Drawing.Size(175, 22); + this.messageFilterToolStripMenuItem.Text = "Filter messages..."; + this.messageFilterToolStripMenuItem.Click += new System.EventHandler(this.messageFilterToolStripMenuItem_Click); + // + // filterPlayersToolStripMenuItem + // + this.filterPlayersToolStripMenuItem.Name = "filterPlayersToolStripMenuItem"; + this.filterPlayersToolStripMenuItem.Size = new System.Drawing.Size(175, 22); + this.filterPlayersToolStripMenuItem.Text = "Filter players"; + // + // findAllMessagesToolStripMenuItem + // + this.findAllMessagesToolStripMenuItem.Name = "findAllMessagesToolStripMenuItem"; + this.findAllMessagesToolStripMenuItem.Size = new System.Drawing.Size(175, 22); + this.findAllMessagesToolStripMenuItem.Text = "Find all messages..."; + this.findAllMessagesToolStripMenuItem.Click += new System.EventHandler(this.findAllMessagesToolStripMenuItem_Click); + // + // queryToolStripMenuItem + // + this.queryToolStripMenuItem.Name = "queryToolStripMenuItem"; + this.queryToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Q))); + this.queryToolStripMenuItem.Size = new System.Drawing.Size(175, 22); + this.queryToolStripMenuItem.Text = "Query..."; + this.queryToolStripMenuItem.Click += new System.EventHandler(this.queryToolStripMenuItem_Click); + // + // toolStripMenuItem1 + // + this.toolStripMenuItem1.Name = "toolStripMenuItem1"; + this.toolStripMenuItem1.Size = new System.Drawing.Size(172, 6); + // + // trySNOAliasesToolStripMenuItem + // + this.trySNOAliasesToolStripMenuItem.Checked = true; + this.trySNOAliasesToolStripMenuItem.CheckOnClick = true; + this.trySNOAliasesToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; + this.trySNOAliasesToolStripMenuItem.Name = "trySNOAliasesToolStripMenuItem"; + this.trySNOAliasesToolStripMenuItem.Size = new System.Drawing.Size(175, 22); + this.trySNOAliasesToolStripMenuItem.Text = "Try SNO Aliases"; + // + // aboutToolStripMenuItem + // + this.aboutToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.aboutToolStripMenuItem1}); + this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; + this.aboutToolStripMenuItem.Size = new System.Drawing.Size(52, 20); + this.aboutToolStripMenuItem.Text = "About"; + // + // aboutToolStripMenuItem1 + // + this.aboutToolStripMenuItem1.Name = "aboutToolStripMenuItem1"; + this.aboutToolStripMenuItem1.Size = new System.Drawing.Size(116, 22); + this.aboutToolStripMenuItem1.Text = "About..."; + this.aboutToolStripMenuItem1.Click += new System.EventHandler(this.aboutToolStripMenuItem1_Click); + // + // MooNet + // + this.MooNet.Controls.Add(this.MooNetTree); + this.MooNet.Location = new System.Drawing.Point(4, 22); + this.MooNet.Name = "MooNet"; + this.MooNet.Size = new System.Drawing.Size(249, 372); + this.MooNet.TabIndex = 1; + this.MooNet.Text = "MooNet"; + this.MooNet.UseVisualStyleBackColor = true; + // + // MooNetTree + // + this.MooNetTree.Dock = System.Windows.Forms.DockStyle.Fill; + this.MooNetTree.Location = new System.Drawing.Point(0, 0); + this.MooNetTree.Name = "MooNetTree"; + this.MooNetTree.Size = new System.Drawing.Size(249, 372); + this.MooNetTree.TabIndex = 0; + this.MooNetTree.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tree_AfterSelect); + // + // MessageViewer + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(920, 467); + this.Controls.Add(this.panel1); + this.Controls.Add(this.menuStrip1); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.KeyPreview = true; + this.Name = "MessageViewer"; + this.Padding = new System.Windows.Forms.Padding(10); + this.Text = "GameMessage Viewer"; + this.panel_mainframe.ResumeLayout(false); + this.tabControl1.ResumeLayout(false); + this.tabActors.ResumeLayout(false); + this.tabQuests.ResumeLayout(false); + this.panel_mdump.ResumeLayout(false); + this.panel_mdump.PerformLayout(); + this.panel_mdump_content_.ResumeLayout(false); + this.panel_mdump_subcontent.ResumeLayout(false); + this.panel_mdump_header.ResumeLayout(false); + this.panel_mdump_header.PerformLayout(); + this.panel_messages.ResumeLayout(false); + this.panel_messages.PerformLayout(); + this.panel_messages_content.ResumeLayout(false); + this.tabControl2.ResumeLayout(false); + this.tabPage1.ResumeLayout(false); + this.panel1.ResumeLayout(false); + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); + this.MooNet.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Panel panel_mainframe; + private System.Windows.Forms.TabControl tabControl1; + private System.Windows.Forms.TabPage tabActors; + private System.Windows.Forms.TreeView actors; + private System.Windows.Forms.TabPage tabQuests; + private System.Windows.Forms.Splitter splitter2; + private System.Windows.Forms.Panel panel_mdump; + private System.Windows.Forms.Panel panel_mdump_content_; + private System.Windows.Forms.Panel panel_mdump_subcontent; + private System.Windows.Forms.RichTextBox output; + private System.Windows.Forms.Panel panel_mdump_header; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Splitter splitter1; + private System.Windows.Forms.Panel panel_messages; + private System.Windows.Forms.Panel panel_messages_content; + private System.Windows.Forms.Panel panel_messages_header; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.ProgressBar progressBar; + private System.Windows.Forms.MenuStrip menuStrip1; + private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem openPreparsedDumpToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem2; + private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem messageFilterToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem findAllMessagesToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1; + private System.Windows.Forms.ToolStripMenuItem trySNOAliasesToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem1; + private System.Windows.Forms.TreeView questTree; + private System.Windows.Forms.ToolStripMenuItem filterPlayersToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem queryToolStripMenuItem; + private System.Windows.Forms.TabControl tabControl2; + private System.Windows.Forms.TabPage tabPage1; + private System.Windows.Forms.TreeView tree; + private System.Windows.Forms.TabPage MooNet; + private System.Windows.Forms.TreeView MooNetTree; + + + } +} + diff --git a/src/tools/GameServer/MessageViewer/MessageViewer.Loading.cs b/src/tools/GameServer/MessageViewer/MessageViewer.Loading.cs new file mode 100644 index 00000000..aed7875c --- /dev/null +++ b/src/tools/GameServer/MessageViewer/MessageViewer.Loading.cs @@ -0,0 +1,516 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#pragma warning disable + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using System.Drawing; +using System.IO; +using Mooege.Net.GS.Message.Definitions.Player; +using Google.ProtocolBuffers; +using Mooege.Net.MooNet.Packets; +using Mooege.Core.MooNet.Services; +using Mooege.Net.MooNet; +using Mooege.Net.MooNet.RPC; + +namespace GameMessageViewer +{ + public partial class MessageViewer + { + + /// + /// Hex string to byte array + /// + private byte[] String_To_Bytes(string strInput) + { + int i = 0; + int x = 0; + byte[] bytes = new byte[(strInput.Length) / 2]; + + while (strInput.Length > i + 1) + { + long lngDecimal = Convert.ToInt32(strInput.Substring(i, 2), 16); + bytes[x] = Convert.ToByte(lngDecimal); + i = i + 2; + ++x; + } + return bytes; + } + + /// + /// string (char array) to hex string + /// + private string Encode(string text) + { + return BitConverter.ToString(System.Text.Encoding.UTF8.GetBytes(text)).Replace("-", ""); + } + + /// + /// Returns whether a given hex stream is a moonet stream + /// + public bool IsMooNetStream(string stream) + { + return stream.Contains(Encode("Aurora")); + } + + /// + /// Returns whether a given hex stream is an achievment stream + /// + public bool IsAchievmentStream(string stream) + { + return stream.Contains(Encode("Achievements_Beta:RetrieveNameFromStringlist")); + } + + /// + /// Returns the protocol version for a given stream if the information is available + /// Only GS streams have that version set (i guess/hope) + /// + public string GetVersion(string stream) + { + string[] versions = new string[] { "0.5.1.8101", "0.4.0.7865", "0.3.1.7779", "0.3.0.7484", "0.3.0.7333" }; + + + foreach (string version in versions) + if(stream.Contains(Encode(version))) + return version; + + return "unknown"; + } + + public bool HasVersion(string version, string stream) + { + if (stream.Contains(Encode(version))) + return true; + + return false; + } + + + //private void LoadWiresharkHex(string text) + //{ + // if (text.Contains(" ")) + // { + // String[] rows = text.Split('\n'); + // String currentBuffer = ""; + // text = ""; + + // for (int i = 0; i < rows.Length; i++) + // { + // if (i > 0 && (rows[i].StartsWith(" ") ^ rows[i - 1].StartsWith(" "))) + // { + // Buffer buffer = new Buffer(String_To_Bytes(currentBuffer)); + + // BufferNode newNode = new BufferNode(buffer, actors, questTree, "1"); + // newNode.Start = text.Length; + // newNode.BackColor = rows[i].StartsWith(" ") ? newNode.BackColor = Color.LightCoral : Color.LightBlue; + // tree.Nodes.Add(newNode); + // text += currentBuffer; + // currentBuffer = ""; + // } + + // currentBuffer += (rows[i].StartsWith(" ") ? rows[i].Substring(14, 3 * 16) : rows[i].Substring(10, 3 * 16)).Trim().Replace(" ", ""); + // } + // } + + // else + // { + // Buffer buffer = new Buffer(String_To_Bytes(text)); + // BufferNode newNode = new BufferNode(buffer, actors, questTree, "1"); + // newNode.Parse(); + // tree.Nodes.Add(newNode); + // } + + // ApplyFilter(); + //} + + + /// + /// Pcap loading extracts the largest session from a pcap, transforms it to dump format (in a memory stream) + /// which can be read by LoadDump afterwards + /// + /// + private void LoadPcap(string path) + { + try + { + // This ugly thing returns a list of MemoryStreams. One for each session in the cap + var streams = pCapReader.ReconSingleFileSharpPcap(path); + List gsStreams = new List(); + + // sort the streams + foreach (var stream in streams) + { + string text = new StreamReader(stream).ReadToEnd(); + + // TODO Implement MooNet Parsing + // if (IsMooNetStream(text)) LoadMooNetDump(text); + if (IsAchievmentStream(text)) System.Console.WriteLine("Achievementstream not parsed"); + + if (!IsMooNetStream(text) && !IsAchievmentStream(text)) + gsStreams.Add(text); + } + + // sometimes there are other streams in the dump... + // if only one stream is found, or more are found but only one is tagged with mooege protocol version load that one + if (gsStreams.Count > 0) + { + var correct = gsStreams.Where(x => HasVersion(Mooege.Common.Versions.VersionInfo.Ingame.MajorVersion,x)).ToList(); + + if (correct.Count() > 0) + { + if (correct.Count() == 1) + LoadDump(correct.First()); + else + { + Streams StreamDialog = new Streams(correct); + if (StreamDialog.ShowDialog() == DialogResult.OK) + { + LoadDump(correct[StreamDialog.stream]); + } + } + } + else + { + if (gsStreams.Count() == 1) + LoadDump(gsStreams.First()); + else + { + if (DialogResult.Yes == MessageBox.Show(string.Format("The dump contains more than one unidentified stream, but in none of them mooege version {0} was found. The dump is either broken or of a version Mooege does not support. Continue loading all streams? (This may take longer and messages may appear broken)", Mooege.Common.Versions.VersionInfo.Ingame.VersionString), "Multiple streams found", MessageBoxButtons.YesNo, MessageBoxIcon.Question)) + foreach (var stream in gsStreams) + LoadDump(stream); + } + } + } + + if(streams.Count == 0) + MessageBox.Show("No streams found. Is this really a GS / MooNet Dump?", "FatFingerFileMisclick", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + catch (SharpPcap.PcapException) + { + MessageBox.Show("The file could not be read. Only lipcap cap files can be loaded. If you want to load a NetMon cap the README tells you how to", "Loading error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + + private void LoadPreparsed(string text) + { + String[] rows = text.Split('\n'); + String currentBuffer = ""; + text = ""; + string currentDirection = ""; + progressBar.Maximum = rows.Length; + progressBar.Value = 0; + progressBar.Visible = true; + + for (int i = 0; i < rows.Length; i++) + { + progressBar.Value = i; + Application.DoEvents(); + if (this.Visible == false) + break; + + } + + } + + + private static readonly Dictionary RPCCallbacksIn = new Dictionary(); + private static readonly Dictionary RPCCallbacksOut = new Dictionary(); + + + private void BNetBufferAssembledCallback(byte[] buffer, Direction direction, string clientHash) + { + Dictionary colors = new Dictionary(); + + + Color[][] trafficColors = new Color[][] + { new Color[] { Color.LightCoral , Color.LightBlue }, + new Color[] { Color.Tomato, Color.Blue }, + new Color[] { Color.Red, Color.BlueViolet }, + new Color[] { Color.PaleVioletRed, Color.CadetBlue } + }; + + + var stream = CodedInputStream.CreateInstance(buffer); + while (!stream.IsAtEnd) + { + try + { + var packet = new PacketIn(null, null); + + if (packet.Header.ServiceId == 0xFE /*ServiceReply*/) + { + //ProcessReply(client, packet); + var callNode = RPCCallbacksIn[packet.Header.Token]; + RPCCallbacksIn.Remove(packet.Header.Token); + callNode.ReceiveReply(packet, true); + } + else + { + var service = Service.GetByID(packet.Header.ServiceId); + + if (service == null) + { + MooNetTree.Nodes.Add(String.Format("Service not found: {0}", service)); + return; + } + + var newNode = new MooNetCallNode(packet, stream); + MooNetTree.Nodes.Add(newNode); + RPCCallbacksIn.Add(packet.Header.Token, newNode); + } + } + catch (Exception e) + { + var newNode = new TreeNode(String.Format("Error parsing {0}", e.Message)); + MooNetTree.Nodes.Add(newNode); + + } + } + } + + private void LoadMooNetDump(string text) + { + AssembleBuffer(text, BNetBufferAssembledCallback); + } + + + private enum Direction + { + Incoming, + Outgoing + } + + private void AssembleBuffer(string text, Action bufferAssembledCallback) + { + String[] rows = text.Split('\n'); + string currentDirection = ""; + String currentBuffer = ""; + List clients = new List(); + string clientHash = ""; + + // to read mooege dumps, some leading info must be removed + // the amount of chars is fixed so its calculated once + int removeChars = rows[0].IndexOf("Inc:"); + if (removeChars < 0) + removeChars = rows[0].IndexOf("Out:"); + + for (int i = 0; i < rows.Length; i++) + { + + // Skip anything til the Inc/Out part (for mooege dumps), note client hash + rows[i] = rows[i].Substring(removeChars); + if (rows[i].Length < 8) continue; // no content after incoming/outgoing + + clientHash = rows[i].Substring(4, 8); + if (clients.Contains(clientHash) == false) + { + clients.Add(clientHash); + } + + if (rows[i].Length > 3) + { + // Everytime the direction of data changes, the buffer is parsed and emptied + // this is for pcap dumps where the data stream is sent in smaller packets + // in mooege, data is dumped in whole + if (i > 0 && rows[i].Substring(0, 1) != currentDirection) + { + bufferAssembledCallback(String_To_Bytes(currentBuffer), currentDirection == "I" ? Direction.Incoming : Direction.Outgoing, clientHash); + + currentBuffer = ""; + currentDirection = rows[i].Substring(0, 1); + } + if (currentDirection == "") currentDirection = rows[i].Substring(0, 1); + currentBuffer += (rows[i].Substring(13)).Replace("\r", ""); + } + } + } + + + private void LoadDump(string text) + { + String[] rows = text.Split('\n'); + string currentDirection = ""; + progressBar.Maximum = rows.Length; + progressBar.Value = 0; + progressBar.Visible = true; + allNodes = new List(); + + Dictionary actors = new Dictionary(); + Dictionary quests = new Dictionary(); + + + + Color[][] trafficColors = new Color[][] + { new Color[] { Color.LightCoral , Color.LightBlue }, + new Color[] { Color.Tomato, Color.Blue }, + new Color[] { Color.Red, Color.BlueViolet }, + new Color[] { Color.PaleVioletRed, Color.CadetBlue } + }; + + + List clients = new List(); + Dictionary colors = new Dictionary(); + + // to read mooege dumps, some leading info must be removed + // the amount of chars is fixed so its calculated once + int removeChars = rows[0].IndexOf("Inc:"); + if(removeChars < 0) + removeChars = rows[0].IndexOf("Out:"); + string clientHash = ""; + int counter = 0; + int size = 0; + Dictionary lastNodesMissingData = new Dictionary(); + for (int i = 0; i < rows.Length; i++) + { + if (rows[i].Length > removeChars) + { + // Skip anything til the Inc/Out part (for mooege dumps), note client hash + rows[i] = rows[i].Substring(removeChars); + clientHash = rows[i].Substring(4, 8); + if (clients.Contains(clientHash) == false) + { + clients.Add(clientHash); + lastNodesMissingData.Add(clientHash + "I", null); + lastNodesMissingData.Add(clientHash + "O", null); + colors[clientHash] = trafficColors[clients.Count - 1]; + } + + progressBar.Value = i; + + if (rows[i].Length > 3) + { + // Everytime the direction of data changes, the buffer is parsed and emptied + // this is for pcap dumps where the data stream is sent in smaller packets + // in mooege, data is dumped in whole + if (i > 0 && rows[i].Substring(0, 1) != currentDirection) + { + byte[] buf = new byte[size / 2]; + size = 0; + for(int k = i - counter; k < i; k++) + { + Array.Copy(String_To_Bytes(rows[k]), 0, buf, size / 2, rows[k].Length / 2); + size += rows[k].Length; + } + + if (lastNodesMissingData[clientHash + currentDirection] == null) + { + BufferNode newNode = new BufferNode(actors, quests, clientHash); + + if (newNode.Append(buf)) + lastNodesMissingData[clientHash + currentDirection] = newNode; + else + lastNodesMissingData[clientHash + currentDirection] = null; + + newNode.BackColor = currentDirection == "I" ? colors[clientHash][0] : colors[clientHash][1]; + allNodes.Add(newNode); + } + else + { + if (false == lastNodesMissingData[clientHash + currentDirection].Append(buf)) + lastNodesMissingData[clientHash + currentDirection] = null; + } + + + counter = 0; + size = 0; + currentDirection = rows[i].Substring(0, 1); + } + + if (currentDirection == "") currentDirection = rows[i].Substring(0, 1); + rows[i] = rows[i].Substring(13).Replace("\r", ""); + counter++; + size += rows[i].Length; + } + } + } + + + if (counter > 0) + { + byte[] buf = new byte[size / 2]; + size = 0; + for (int k = rows.Length - counter; k < rows.Length; k++) + { + Array.Copy(String_To_Bytes(rows[k]), 0, buf, size / 2, rows[k].Length / 2); + size += rows[k].Length; + } + + BufferNode newNode = new BufferNode(actors, quests, clientHash); + newNode.Append(buf); + newNode.BackColor = currentDirection == "I" ? colors[clientHash][0] : colors[clientHash][1]; + allNodes.Add(newNode); + } + + foreach(BufferNode bn in allNodes) + bn.ApplyFilter(filterWindow.Filter); + + + // Create a filter menu entry for every client in the stream. + filterPlayersToolStripMenuItem.DropDownItems.Clear(); + foreach (string client in clients) + { + ToolStripMenuItem m = new ToolStripMenuItem(client); + m.Tag = client; + m.Checked = true; + m.Click += new EventHandler(FilterPlayerClick); + + // find toon name for client hash + foreach(BufferNode bn in allNodes) + if(bn.clientHash.Equals(m.Tag.ToString())) + foreach(TreeNode mn in bn.Nodes) + if(mn is MessageNode) + if((mn as MessageNode).gameMessage is NewPlayerMessage) + { + m.Text = ((mn as MessageNode).gameMessage as NewPlayerMessage).ToonName; + goto hell; + } + + hell: + filterPlayersToolStripMenuItem.DropDownItems.Add(m); + } + + + questTree.Nodes.AddRange(quests.Values.ToArray()); + this.actors.Nodes.AddRange(actors.Values.ToArray()); + + + tree.Nodes.AddRange(allNodes.ToArray()); + progressBar.Visible = false; + } + + void FilterPlayerClick(object sender, EventArgs e) + { + Dictionary filter = new Dictionary(); + ((ToolStripMenuItem)sender).Checked = !((ToolStripMenuItem)sender).Checked; + + foreach (ToolStripMenuItem m in filterPlayersToolStripMenuItem.DropDownItems) + filter.Add(m.Tag.ToString(), m.Checked); + + tree.Nodes.Clear(); + foreach (BufferNode bn in allNodes) + if (filter[bn.clientHash]) + tree.Nodes.Add(bn); + + } + } +} diff --git a/src/tools/GameServer/MessageViewer/MessageViewer.cs b/src/tools/GameServer/MessageViewer/MessageViewer.cs new file mode 100644 index 00000000..1bf0e5fd --- /dev/null +++ b/src/tools/GameServer/MessageViewer/MessageViewer.cs @@ -0,0 +1,353 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using Mooege.Net.GS.Message; +using Mooege.Net.GS.Message.Definitions.ACD; +using System.IO; +using SharpPcap.LibPcap; +using SharpPcap; +using PacketDotNet; +using Mooege.Common.MPQ; +using Mooege.Core.GS.Common.Types.SNO; + +namespace GameMessageViewer +{ + public partial class MessageViewer : Form + { + MessageFilter filterWindow = new MessageFilter(); + RichTextBox temp = new RichTextBox(); + List allNodes = new List(); + + + public MessageViewer() + { + InitializeComponent(); + } + + + private void tree_AfterSelect(object sender, TreeViewEventArgs e) + { + if ((sender as TreeView).SelectedNode is ITextNode) + DisplayMessage(((sender as TreeView).SelectedNode as ITextNode).AsText()); + } + + private void ApplyFilter() + { + tree.BeginUpdate(); + progressBar.Visible = true; + progressBar.Value = 0; + progressBar.Maximum = tree.Nodes.Count; + + foreach (BufferNode b in tree.Nodes) + { + progressBar.Value++; + b.ApplyFilter(filterWindow.Filter); + } + + progressBar.Visible = false; + tree.EndUpdate(); + } + + + private void tree_BeforeExpand(object sender, TreeViewCancelEventArgs e) + { + if (e.Node is BufferNode) + (e.Node as BufferNode).Parse(); + } + + private void groupedNode_AfterSelect(object sender, TreeViewEventArgs e) + { + if (e.Node is MessageNode) + DisplayMessage((e.Node as MessageNode).gameMessage.AsText()); + } + + private void button1_Click(object sender, EventArgs e) + { + foreach (TreeNode n in tree.Nodes) + if (n is BufferNode) + (n as BufferNode).Parse(); + } + + private void messageFilterToolStripMenuItem_Click(object sender, EventArgs e) + { + filterWindow.ShowDialog(); + ApplyFilter(); + } + + + private void findAllMessagesToolStripMenuItem_Click(object sender, EventArgs e) + { + Find filter = new Find(); + + if((filter.ShowDialog() != DialogResult.OK)) + return; + + string find = filter.Filter; + tree.BeginUpdate(); + + foreach (BufferNode bn in tree.Nodes) + { + bn.Collapse(); + + foreach (TreeNode mn in bn.Nodes) + if (mn is MessageNode) + { + if ((mn as MessageNode).gameMessage.GetType().Name.Contains(find)) + { + bn.BackColor = Color.Yellow; + mn.BackColor = Color.Yellow; + bn.Expand(); + } + } + } + tree.EndUpdate(); + } + + /// + /// Close application + /// + private void exitToolStripMenuItem_Click(object sender, EventArgs e) + { + this.Close(); + } + + private void aboutToolStripMenuItem1_Click(object sender, EventArgs e) + { + (new AboutBox()).Show(); + } + + + private void output_MouseMove(object sender, MouseEventArgs e) + { + int i = temp.GetCharIndexFromPosition(new Point(e.X, e.Y)); + temp.SelectionStart = i; + temp.SelectionLength = 1; + + // Apparently, under mono SelectionFont property crashes when nothing is selected + if (temp.SelectionType == RichTextBoxSelectionTypes.Empty) + return; + + if (temp.SelectionFont.Underline) + { + if (output.Cursor != Cursors.Hand) + output.Cursor = Cursors.Hand; + } + else + output.Cursor = Cursors.IBeam; + } + + private void output_MouseClick(object sender, MouseEventArgs e) + { + int i = temp.GetCharIndexFromPosition(new Point(e.X, e.Y)); + + temp.SelectionStart = i; + temp.SelectionLength = 1; + + // Apparently, under mono SelectionFont property crashes when nothing is selected + if (temp.SelectionType == RichTextBoxSelectionTypes.Empty) + return; + + while (temp.SelectionFont.Underline) + temp.SelectionStart--; + temp.SelectionStart++; + while (!temp.SelectedText.Contains(" ") && temp.SelectionStart + temp.SelectionLength < temp.Text.Length) + temp.SelectionLength++; + + string text = temp.SelectedText; + + FindActor(text.Trim()); + } + + public void FindActor(string id) + { + foreach (TreeNode node in actors.Nodes) + if (node.Tag as string == id) + { + node.Expand(); + node.BackColor = Color.Yellow; + node.EnsureVisible(); + this.tabControl1.SelectTab(0); + } else + node.BackColor = Color.White; + } + + /// + /// Underscore actor ids and add sno names + /// + private void DisplayMessage(string text) + { + temp.Text = text; + output.Rtf = temp.Rtf; + foreach (TreeNode tn in actors.Nodes) + { + int pos = temp.Find(tn.Tag as string); + + if (pos > -1) + { + temp.Rtf = temp.Rtf.Replace(tn.Tag as string, tn.Text); + temp.Select(pos, tn.Text.Length); + temp.SelectionFont = new Font(output.Font, FontStyle.Underline); + temp.SelectionColor = Color.Blue; + } + } + + temp.Size = output.Size; + temp.Location = output.Location; + output.Rtf = temp.Rtf; + + string[] words = output.Text.Split(new string[] { "0x", " ", "\n", ", " }, StringSplitOptions.RemoveEmptyEntries); // .Split(' '); + List usedKeys = new List(); + + // Bruteforce replacement of snos to their aliases + if (trySNOAliasesToolStripMenuItem.Checked) + foreach (string word in words) + if (word.Length > 5) // "for hex values 0000FDC1 etc + { + try + { + //string raw = word.Replace("\n", "").Replace("0x", ""); + int id = 0; + if (Int32.TryParse(word, System.Globalization.NumberStyles.HexNumber, null, out id)) + { + if (usedKeys.Contains(id.ToString()) == false) + { + usedKeys.Add(id.ToString()); + string alias = ""; + + var aliases = Mooege.Core.GS.Common.Types.TagMap.TagMap.GetKeys(id); + if(aliases.Count > 0) + { + alias = String.Join(" or ", aliases.Select(x => x.Name)); + + output.Rtf = output.Rtf.Replace(word, word + ": TagKey." + alias); + + int pos = -1; + while ((pos = output.Text.IndexOf(alias, pos + 1)) > 0) + { + output.SelectionStart = pos; + output.SelectionLength = alias.Length; + output.SelectionColor = Color.OrangeRed; + output.SelectionLength = 0; + } + } + + alias = SNOAliases.GetAlias(id); + if (alias != "") + { + output.Rtf = output.Rtf.Replace(word, word + ":" + alias); + + int pos = -1; + while((pos = output.Text.IndexOf(alias, pos + 1)) > 0) + { + output.SelectionStart = pos; + output.SelectionLength = alias.Length; + output.SelectionColor = Color.OrangeRed; + output.SelectionLength = 0; + } + + } + + alias = SNOAliases.GetGroup(id); + if (alias != "") + { + output.Rtf = output.Rtf.Replace(word, word + ":" + alias); + + int pos = -1; + while ((pos = output.Text.IndexOf(alias, pos + 1)) > 0) + { + output.SelectionStart = pos; + output.SelectionLength = alias.Length; + output.SelectionColor = Color.OrangeRed; + output.SelectionLength = 0; + } + + } + + + + } + } + } + catch (Exception) { System.Diagnostics.Debugger.Break(); } + } + output.Refresh(); + } + + private void openPreparsedDumpToolStripMenuItem_Click(object sender, EventArgs e) + { + OpenFileDialog ofd = new OpenFileDialog(); + ofd.Filter = "Readable dumps |*.cap; *.pcap; *.log; *.hex|"+ + "Libpcap dumpy (*.cap; *.pcap)|*.cap; *.pcap|"+ + "Mooege dumps (*.log)|*.log|"+ + "Wireshark hex view (*.hex)|*.hex"; + + if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) + { + questTree.Nodes.Clear(); + actors.Nodes.Clear(); + tree.Nodes.Clear(); + BufferNode.Reset(); + this.Text = Application.ProductName + " - " + Path.GetFileName(ofd.FileName); + + if(Path.GetExtension(ofd.FileName).ToLower().Contains("log")) + LoadDump(File.ReadAllText(ofd.FileName)); + if (Path.GetExtension(ofd.FileName).ToLower().Contains("cap")) + LoadPcap(ofd.FileName); + //if (Path.GetExtension(ofd.FileName).ToLower().Contains("hex")) + // LoadWiresharkHex(File.ReadAllText(ofd.FileName)); + } + } + + private void queryToolStripMenuItem_Click(object sender, EventArgs e) + { + CustomLinqQuery query = new CustomLinqQuery(); + if (query.Show(tree.Nodes.Cast()) == System.Windows.Forms.DialogResult.OK) + { + TreeView treeQuery = new TreeView(); + treeQuery.BorderStyle = BorderStyle.None; + treeQuery.Dock = DockStyle.Fill; + treeQuery.AfterSelect += this.groupedNode_AfterSelect; + TabPage tab = new TabPage("Query"); + tab.Controls.Add(treeQuery); + tab.DoubleClick += (o,k) => MessageBox.Show("WERWER"); + + treeQuery.Nodes.Clear(); + foreach (MessageNode mn in query.QueryResult) + treeQuery.Nodes.Add(mn.Clone()); + + tabControl2.TabPages.Add(tab); + tabControl2.SelectTab(tab); + } + } + + private void tabControl2_DoubleClick(object sender, EventArgs e) + { + if(tabControl2.SelectedIndex != 0) + tabControl2.TabPages.Remove((TabPage)tabControl2.SelectedTab); + } + + } +} diff --git a/src/tools/GameServer/MessageViewer/MessageViewer.resx b/src/tools/GameServer/MessageViewer/MessageViewer.resx new file mode 100644 index 00000000..400f0f43 --- /dev/null +++ b/src/tools/GameServer/MessageViewer/MessageViewer.resx @@ -0,0 +1,252 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + + + AAABAAMAMDAAAAEACACoDgAANgAAACAgAAABAAgAqAgAAN4OAAAQEAAAAQAIAGgFAACGFwAAKAAAADAA + AABgAAAAAQAIAAAAAAAACQAAAAAAAAAAAAAAAQAAAAAAAN7e3wDMzM4A9fX2AC4uLgDQ0NEAlJSVADMz + NABcXFwAhoaHADc3NwAkJCMAYWFiAPDw8QChoaEAZWVlALi4uABAQEAA4uLjAC0tLABXV1cA0NDSAPn5 + +gBubm4AMjIyAFtbWgDU1NUANjY1AOvr7ABgYGAAxsbHAIqKiwA7OzsAUlJSAPT09QBAQEEALS0tAERE + RADm5ucAMTEwADIyMwBbW1sAhYWGADY2NgDY2NkA7+/wALOztAB7e3sAPz8/AOHh4gCSkpIAVlZWALy8 + vQBtbW0AMTExAJeXmADq6usArq6vAMXFxgA6OjoA3NzdAMnJyQDz8/QApKSkAGhoaAAsLCwA5eXmANLS + 0gBaWloA6enpAHFxcQDq6uwANTU1AExMTADu7u8AUVFSAPPz9QA+Pj4AKysqAJGRkQBCQkEAu7u8ADAw + MACWlpcAR0dHAOnp6gDExMUA7e3tADk5OQBjY2QA8vLzALa2twBnZ2cAKysrAM3NzgB+fn4AQkJCAC8v + LgCoqKkAlZWVAFlZWQBGRkUAv7/AAKysrAA0NDQAw8PDAF5eXwCHh4cA7e3uADg4NwA5OToAyMjJAPHx + 8QB5eXkAzMzMAPb29wC6ursAa2trAC8vLwCCgoIA6OjpAKysrQBwcHEAmZmZADQ0NQDDw8QAS0tMAHR0 + dAA4ODgAnp6fAMfHxwCLi4sAT09PAPHx8gBmZmYAKioqAMzMzQBBQUEALy8wAFhYWAD6+vsARkZHADMz + MwCGhoYA7OztADg4OQBhYWEAx8fIALS0tAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ0dHZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + R2dnR2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnUSYmUWdnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ0c1hS0thTVHZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnR1GIc1JSc4hRR2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ1w0km06bjRcZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dHAxxd + TkwvMYdpA0dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnUZELXz4+X5EcUWdnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dHF1dwgYSEgXBXF0dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dHUU8ZFXd3FRlPUUdnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dHjUcNDBsbDA1HjUdnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnRxJe + PRsbPV4SR2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnKoZbN4+PN1uGKmdnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnKiMTKywsKxMjKmdnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnR3VIXQwMXUh1R2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnR1FTHYSEHVNRR2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnRzUi + ZVlZZSI1R2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnR1EkfISEfCRRR2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dHCQODBAwMBIMDCUdnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ0dRUUBDO0lJO0NAUVFHZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnFyNMShp+SY+PSX4aSkwjF2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ0cnfy48BZA4 + ITc3ITiQBTwufydHZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2cmghVuJCAALBsbLAAgJG4VgiZn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dHR3V9cVqMiWGEG4+PG4RhiYxacX11R0dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2cqR2cXZxckWAY1YhuPGzc3G48bYjUGWCQXZxdnRypnZ2dnZ2dnZ2dnZ2dnZ2dnZ41A + AzUfRwNATYp4RmtEApOTAkRrRniKTUADRx81A0CNZ2dnZ2dnZ2dnZ2dnZ2dnZwkoNg9oUHoeLTtZj1Q9 + FCAgFD1Uj1k7LR56UGgPNigJZ2dnZ2dnZ2dnZ2dnZ2dHdQcBPYuLAkmPPQw3N1lxY3V1Y3FZNzcMPY9J + AouLPQEHdUdnZ2dnZ2dnZ2dnZ2dnF4gTdIBdQUtvNxs3hDkgIyoqIyA5hDcbN29LQV2AdBOIF2dnZ2dn + Z2dnZ2dnZ2dnZxdAIxdkeY5mSTcMQjJAKmdnKkAyQgw3SWaOeWQXI0AXZ2dnZ2dnZ2dnZ2dnZ2dnZ2cq + R401AwoYJWtWalwqZ2dnZypcalZrJRgKAzWNRypnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ0dHKo0QM3IwKCMq + Z2dnZyojKDByMxCNKkdHZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ0cSKQIRMhIqZ2dnZyoSMhECKRJH + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ0dRJFUsFkAqZ2dnZypAFixVJFFHZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dHEg4bZnVnZ2dnZ2d1ZhsOEkdnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZxcIOz9AKmdnKkA/OwgXZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ40XRXZ/ + jUdHjX92RReNZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2cGYGwqjWdnjSpsYAZnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnR42NZ2dnZ42NR2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ3tnZ2dnZ2d7Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2cAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAIAAAAEAAAAABAAgAAAAAAAAEAAAAAAAAAAAAAAAB + AAAAAAAASUlJAO7u7wArKysAwcHCAFZWVgCfn58AODg4AN3d3gApKSkA6OjoAM7OzwC/v8AAfX18ALCw + sQD5+foANjY2ANvb3AB0dHUAJycnAGVlZgBwcHAAn5+gADg4OQA0NDQAysrLAKysrQBqamkA9fX2ADY2 + NwAyMjIALi4tAF1dXQA0NDUA8/P0ADAwMACZmZoALi4uACoqKQB3d3cAtbW2AFlZWQDv7/AAiIiJAODg + 4QAsLCwA0dHSAGpqawB1dXUAs7O0AExMTQBXV1cAlZWWAO3t7gA5OTkAKioqADU1NADa2toAWVlaAFVV + VQCioqMAra2tAPr6+wA3NzcAKCgoAICAgACvr7AAkZGSAERERAA1NTUAjY2NAMvLzABvb28AYGBgAEJC + QgAzMzMAYmJjALa2tgCcnJ0AQEBAAOXl5gAxMTEAa2trAKmpqgDy8vMAPj4+AOPj5AAvLy8A1NTVAG1t + bgAgICAAeHh4AFpaWgCYmJkAS0tLAPDw8QA8PDwALS0tAGdnZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAABcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcX + FxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxdERBcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcX + RGBgRBcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXF0QdOjodRBcXFxcXFxcXFxcXFxcXFxcXFxcXFxcX + FxcPCChBQSglDxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXREo+GTlbPBxKIBcXFxcXFxcXFxcXFxcXFxcX + FxcXFxdEJDIvJloRBCREFxcXFxcXFxcXFxcXFxcXFxcXFxcXF0RKNQUBAQU1SkQXFxcXFxcXFxcXFxcX + FxcXFxcXFxcXREo+RlNTRj5KRBcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXDwgjGxsjCA8XFxcXFxcXFxcX + FxcXFxcXFxcXFxcXFxcPCEBTU0AIDxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFw8CRykpRwIPFxcXFxcX + FxcXFxcXFxcXFxcXFxcXFxcXDywTNDQTLA8XFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcGLC4BAS4sBhcX + FxcXFxcXFxcXFxcXFxcXFxcXFxdESiwSDFNTDBIsSkQXFxcXFxcXFxcXFxcXFxcXFxcXRFYcFEkVGxsV + SRQcVkQXFxcXFxcXFxcXFxcXFxcXFw9QThgwADgpKTgAMBhOUA8XFxcXFxcXFxcXFxcXRA8XFwJYOyJc + ITQ0IVwiO1gCFxcPRBcXFxcXFxcXF0RQPyI1IlBfTQEhLS0hAU1fUCI1Ij9QRBcXFxcXFxdEHVQzClcn + UhAhXk8fH09eIRBSJ1cKM1QdRBcXFxcXF0RQQypMVT0OAQEHSCwsSAcBAQ49VUwqQ1BEFxcXFxcXFxdQ + EiwASw0hCRoSPj4SGgkhDUsALBJQFxcXFxcXFxcXFxcPRB1ZYT0LUERERERQCz1hWR1EDxcXFxcXFxcX + FxcXFxcXDzcWVwNgRBcXRGADVxY3DxcXFxcXFxcXFxcXFxcXFxcXDzZRKzFgDw9gMStRNg8XFxcXFxcX + FxcXFxcXFxcXFxcXRCxFQh5ERB5CRSxEFxcXFxcXFxcXFxcXFxcXFxcXFxcXF1ZdBkpKBl1WFxcXFxcX + FxcXFxcXFxcXFxcXFxcXFxcXRFZKFxdKVkQXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXRBcXFxdEFxcX + FxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcX + FxcXFxcXFxcXFxcXFxcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAA + AAA0NDQAPT09AI6OjwC3t7cANjY2ALKyswBzc3MALy8vADg4OAAxMTEAcHBxAGVlZQAhISEA8/P0AMjI + yQBeXl4AMzMzAOzs7QAsLCwAQEBBADU1NQDIyMgAR0dHAGRkZQAlJSUAzMzNAC4uLgBiYmIANzc3ACws + KwCqqqsAQEBAANPT0wAnJycAZGRkAJiYmACBgYIAzs7OACIiIgArKysAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAABQUAAAAAAAAAAAAAAAAAAAHBwAAAAAAAAAAAAAAABQHFxcHFAAAAAAAAAAAABQJ + EyQkHwkUAAAAAAAAAAAUEBwZGRwQFAAAAAAAAAAAABQdFQ4dFAAAAAAAAAAAAAAIIQUFIQgAAAAAAAAA + AAAUBxgDAxgHFAAAAAAAAAAQEiILICALIhIQAAAAAAAQAQgPHhERHg8IARAAAAAQCCMlJQ0KCg0lJSMI + EAAAAAAIFiAjJiYjIBYIAAAAAAAABAwGAicnAgYMBAAAAAAAAAAUEBscHBsQFAAAAAAAAAAAAAAaAAAa + AAAAAAAAAAAAAAAAFAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + + + \ No newline at end of file diff --git a/src/tools/GameServer/MessageViewer/MooNetCallNode.cs b/src/tools/GameServer/MessageViewer/MooNetCallNode.cs new file mode 100644 index 00000000..46c07462 --- /dev/null +++ b/src/tools/GameServer/MessageViewer/MooNetCallNode.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using bnet.protocol; +using Mooege.Core.MooNet.Services; +using Mooege.Net.MooNet.Packets; +using Mooege.Net.MooNet; +using Google.ProtocolBuffers; +using System.Windows.Forms; +using Google.ProtocolBuffers.Descriptors; + +namespace GameMessageViewer +{ + interface ITextNode + { + string AsText(); + } + + + class MooNetReplyNode : TreeNode, ITextNode + { + PacketIn packet; + IMessage message; + + public MooNetReplyNode(PacketIn packet, IBuilder builder) + { + this.packet = packet; + this.message = packet.ReadMessage(builder); + this.Text = message.DescriptorForType.Name; + } + + public string AsText() + { + return message.ToString(); + } + } + + + class MooNetCallNode:TreeNode, ITextNode + { + PacketIn packet; + IMessage message; + IMessage reply; + + public MooNetCallNode(PacketIn packet, CodedInputStream stream) + { + var service = Service.GetByID(packet.Header.ServiceId); + var method = service.DescriptorForType.Methods.Single(m => MooNetRouter.GetMethodId(m) == packet.Header.MethodId); + var proto = service.GetRequestPrototype(method); + reply = service.GetResponsePrototype(method); + var builder = proto.WeakCreateBuilderForType(); + + try + { + message = builder.WeakMergeFrom(CodedInputStream.CreateInstance(packet.GetPayload(stream))).WeakBuild(); + Text = message.DescriptorForType.Name; + } + catch (Exception e) + { + message = builder.WeakBuildPartial(); + Text = "Error parsing message {0}"; + } + + + } + + public string AsText() + { + return message.ToString(); + } + + public TreeNode ReceiveReply(PacketIn packet, bool add) + { + var node = new MooNetReplyNode(packet, reply.WeakCreateBuilderForType()); + this.Nodes.Add(node); + return node; + } + } +} diff --git a/src/tools/GameServer/MessageViewer/Program.cs b/src/tools/GameServer/MessageViewer/Program.cs new file mode 100644 index 00000000..2848457e --- /dev/null +++ b/src/tools/GameServer/MessageViewer/Program.cs @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; + +namespace GameMessageViewer +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new MessageViewer()); + } + } +} diff --git a/src/tools/GameServer/MessageViewer/Properties/AssemblyInfo.cs b/src/tools/GameServer/MessageViewer/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..02c315cc --- /dev/null +++ b/src/tools/GameServer/MessageViewer/Properties/AssemblyInfo.cs @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("GameMessageViewer")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("GameMessage Viewer")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("debb9ffa-8eb3-47b2-8eb8-4f743fa05a83")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/tools/GameServer/MessageViewer/Properties/Resources.Designer.cs b/src/tools/GameServer/MessageViewer/Properties/Resources.Designer.cs new file mode 100644 index 00000000..6d595e46 --- /dev/null +++ b/src/tools/GameServer/MessageViewer/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.239 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace GameMessageViewer.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GameMessageViewer.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/src/tools/GameServer/MessageViewer/Properties/Resources.resx b/src/tools/GameServer/MessageViewer/Properties/Resources.resx new file mode 100644 index 00000000..af7dbebb --- /dev/null +++ b/src/tools/GameServer/MessageViewer/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/src/tools/GameServer/MessageViewer/Properties/Settings.Designer.cs b/src/tools/GameServer/MessageViewer/Properties/Settings.Designer.cs new file mode 100644 index 00000000..8f48469c --- /dev/null +++ b/src/tools/GameServer/MessageViewer/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.239 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace GameMessageViewer.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/src/tools/GameServer/MessageViewer/Properties/Settings.settings b/src/tools/GameServer/MessageViewer/Properties/Settings.settings new file mode 100644 index 00000000..39645652 --- /dev/null +++ b/src/tools/GameServer/MessageViewer/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/tools/GameServer/MessageViewer/QueryTemplate.cs b/src/tools/GameServer/MessageViewer/QueryTemplate.cs new file mode 100644 index 00000000..35a82648 --- /dev/null +++ b/src/tools/GameServer/MessageViewer/QueryTemplate.cs @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using Mooege.Net.GS.Message; +using System.Collections.Generic; +using GameMessageViewer; +using System.Linq; +using System.Linq.Dynamic; + +public class QueryTemplate where T : GameMessage +{ + public IEnumerable Query(List nodes, string whereClause) + { + List messages = new List(); + foreach (MessageNode n in nodes) + if (n.gameMessage is T) + messages.Add((T)n.gameMessage); + + IEnumerable result = messages.AsQueryable().Where(whereClause); + + foreach (T message in result) + yield return new MessageNode(message); + } +} \ No newline at end of file diff --git a/src/tools/GameServer/MessageViewer/README.txt b/src/tools/GameServer/MessageViewer/README.txt new file mode 100644 index 00000000..ae4b3562 --- /dev/null +++ b/src/tools/GameServer/MessageViewer/README.txt @@ -0,0 +1,15 @@ +1. Add latest mooege.exe to dependencies +2. Set output path to mooege output path (or it wont find sno aliases) +3. Run and Load file + +If you cannot open a file it is probably because it is a netmon dump. Only libpcap/wireshark can be read. +To browse a netmon dump anyways you have to do the following:. + +1. Open cap in wireshark +2. filter with "tcp.srcport == 1119 || tcp.dstport == 1119" +3. rightclick any packet. select "follow tcp stream" +4. make sure its not the bnet stream...if it is repeat step 2 and 3 with another packet selected (or change filter stream) +5. select hex dump view +6. select all, copy, paste into new file. make sure you have no empty lines at the end +7. file needs an .hex ending +8. open .hex file \ No newline at end of file diff --git a/src/tools/GameServer/MessageViewer/SNOAliases.cs b/src/tools/GameServer/MessageViewer/SNOAliases.cs new file mode 100644 index 00000000..9e6a16b8 --- /dev/null +++ b/src/tools/GameServer/MessageViewer/SNOAliases.cs @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using Mooege.Common.MPQ; +using Mooege.Core.GS.Common.Types.SNO; +using System.Linq; + +namespace GameMessageViewer +{ + class SNOAliases + { + public static string GetAlias(int sno) + { + foreach (var group in MPQStorage.Data.Assets.Values) + if (group.ContainsKey(sno)) + return Path.GetFileName(group[sno].FileName); + + return ""; + } + + public static string GetGroup(int uhash) + { + var dic = MPQStorage.Data.Assets[SNOGroup.Globals].First().Value.Data as Mooege.Common.MPQ.FileFormats.Globals; + //if (dic.ActorGroup.ContainsKey(uhash)) + // return dic.ActorGroup[uhash].S0; + + return ""; + } + + } +} diff --git a/src/tools/GameServer/MessageViewer/Streams.Designer.cs b/src/tools/GameServer/MessageViewer/Streams.Designer.cs new file mode 100644 index 00000000..f978aaef --- /dev/null +++ b/src/tools/GameServer/MessageViewer/Streams.Designer.cs @@ -0,0 +1,93 @@ +namespace GameMessageViewer +{ + partial class Streams + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.cboMessages = new System.Windows.Forms.ComboBox(); + this.button1 = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(32, 17); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(40, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Stream"; + // + // cboMessages + // + this.cboMessages.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.cboMessages.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.cboMessages.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cboMessages.FormattingEnabled = true; + this.cboMessages.Location = new System.Drawing.Point(74, 12); + this.cboMessages.Name = "cboMessages"; + this.cboMessages.Size = new System.Drawing.Size(43, 21); + this.cboMessages.TabIndex = 1; + // + // button1 + // + this.button1.DialogResult = System.Windows.Forms.DialogResult.OK; + this.button1.Location = new System.Drawing.Point(35, 42); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(82, 27); + this.button1.TabIndex = 2; + this.button1.Text = "OK"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // Streams + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(158, 81); + this.Controls.Add(this.button1); + this.Controls.Add(this.cboMessages); + this.Controls.Add(this.label1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.KeyPreview = true; + this.Name = "Streams"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Select stream to decode"; + this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.Find_FormClosed); + this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Find_KeyDown); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.ComboBox cboMessages; + private System.Windows.Forms.Button button1; + } +} \ No newline at end of file diff --git a/src/tools/GameServer/MessageViewer/Streams.cs b/src/tools/GameServer/MessageViewer/Streams.cs new file mode 100644 index 00000000..71f21182 --- /dev/null +++ b/src/tools/GameServer/MessageViewer/Streams.cs @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using System.Reflection; +using Mooege.Net.GS.Message; + +namespace GameMessageViewer +{ + public partial class Streams : Form + { + public int stream; + + public Streams(List streamList) + { + InitializeComponent(); + + for (var i = 0; i < streamList.Count; i++) + cboMessages.Items.Add(i); + + cboMessages.SelectedIndex = 0; + } + + private void button1_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.OK; + this.Close(); + } + + private void Find_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Enter) + { + DialogResult = DialogResult.OK; + this.Close(); + } + } + + private void Find_FormClosed(object sender, FormClosedEventArgs e) + { + int.TryParse(this.cboMessages.Text, out this.stream); + } + + } +} diff --git a/src/tools/GameServer/MessageViewer/Streams.resx b/src/tools/GameServer/MessageViewer/Streams.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/src/tools/GameServer/MessageViewer/Streams.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/src/tools/GameServer/MessageViewer/TCPRecon.cs b/src/tools/GameServer/MessageViewer/TCPRecon.cs new file mode 100644 index 00000000..8db2e5b5 --- /dev/null +++ b/src/tools/GameServer/MessageViewer/TCPRecon.cs @@ -0,0 +1,346 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Text; +using PacketDotNet; +using System.IO; + + // Translated from the file follow.c from WireShark source code + // the code can be found at: http://www.wireshark.org/download.html + +namespace GameMessageViewer +{ + /* here we are going to try and reconstruct the data portion of a TCP + session. We will try and handle duplicates, TCP fragments, and out + of order packets in a smart way. */ + + /// + /// A class that represent a node in a linked list that holds partial Tcp session + /// fragments + /// + internal class tcp_frag + { + public ulong seq = 0; + public ulong len = 0; + public ulong data_len = 0; + public byte[] data = null; + public tcp_frag next = null; + }; + + + public class TcpRecon + { + // holds two linked list of the session data, one for each direction + tcp_frag[] frags = new tcp_frag[2]; + // holds the last sequence number for each direction + ulong[] seq = new ulong[2]; + long[] src_addr = new long[2]; + uint[] src_port = new uint[2]; + bool empty_tcp_stream = true; + uint[] tcp_port = new uint[2]; + uint[] bytes_written = new uint[2]; + public System.IO.StreamWriter data_out_file = null; + bool incomplete_tcp_stream = false; + bool closed = false; + + public bool IncompleteStream + { + get { return incomplete_tcp_stream; } + } + public bool EmptyStream + { + get { return empty_tcp_stream; } + } + + public TcpRecon(string filename) + { + reset_tcp_reassembly(); + data_out_file = new StreamWriter(new MemoryStream()); // (filename, FileMode.Create)); + } + + /// + /// Cleans up the class and frees resources + /// + public void Close() + { + if (!closed) + { + data_out_file.Flush(); + reset_tcp_reassembly(); + closed = true; + } + } + + ~TcpRecon() + { + Close(); + } + + /// + /// The main function of the class receives a tcp packet and reconstructs the stream + /// + /// + public void ReassemblePacket(PacketDotNet.TcpPacket tcpPacket) + { + // if the paylod length is zero bail out + //ulong length = (ulong)(tcpPacket.Bytes.Length - tcpPacket.TCPHeaderLength); + //if (length == 0) return; + if (tcpPacket.PayloadData == null || tcpPacket.PayloadData.Length == 0) return; + + reassemble_tcp((ulong)tcpPacket.SequenceNumber, (ulong)tcpPacket.PayloadData.Length, + tcpPacket.PayloadData, (ulong)tcpPacket.PayloadData.Length, tcpPacket.Syn, + (tcpPacket.ParentPacket as PacketDotNet.IPv4Packet).SourceAddress.Address, + (tcpPacket.ParentPacket as PacketDotNet.IPv4Packet).DestinationAddress.Address, + (uint)tcpPacket.SourcePort, (uint)tcpPacket.DestinationPort); + } + + /// + /// Writes the payload data to the file + /// + /// + /// + private void write_packet_data(int index, byte[] data) + { + // ignore empty packets + if (data.Length == 0) return; + + data_out_file.WriteLine((index == 0 ? "Inc:00000001:" : "Out:00000001:") + BitConverter.ToString(data).Replace("-", "")); + bytes_written[index] += (uint)data.Length; + empty_tcp_stream = false; + } + + /// + /// Reconstructs the tcp session + /// + /// Sequence number of the tcp packet + /// The size of the original packet data + /// The captured data + /// The length of the captured data + /// + /// The source ip address + /// The destination ip address + /// The source port + /// The destination port + private void reassemble_tcp(ulong sequence, ulong length, byte[] data, + ulong data_length, bool synflag, long net_src, + long net_dst, uint srcport, uint dstport) + { + long srcx, dstx; + int src_index, j; + bool first = false; + ulong newseq; + tcp_frag tmp_frag; + + src_index = -1; + + /* Now check if the packet is for this connection. */ + srcx = net_src; + dstx = net_dst; + + /* Check to see if we have seen this source IP and port before. + (Yes, we have to check both source IP and port; the connection + might be between two different ports on the same machine.) */ + for (j = 0; j < 2; j++) + { + if (src_addr[j] == srcx && src_port[j] == srcport) + { + src_index = j; + } + } + /* we didn't find it if src_index == -1 */ + if (src_index < 0) + { + /* assign it to a src_index and get going */ + for (j = 0; j < 2; j++) + { + if (src_port[j] == 0) + { + src_addr[j] = srcx; + src_port[j] = srcport; + src_index = j; + first = true; + break; + } + } + } + if (src_index < 0) + { + throw new Exception("ERROR in reassemble_tcp: Too many addresses!"); + } + + if (data_length < length) + { + incomplete_tcp_stream = true; + } + + /* now that we have filed away the srcs, lets get the sequence number stuff + figured out */ + if (first) + { + /* this is the first time we have seen this src's sequence number */ + seq[src_index] = sequence + length; + if (synflag) + { + seq[src_index]++; + } + /* write out the packet data */ + write_packet_data(src_index, data); + return; + } + /* if we are here, we have already seen this src, let's + try and figure out if this packet is in the right place */ + if (sequence < seq[src_index]) + { + /* this sequence number seems dated, but + check the end to make sure it has no more + info than we have already seen */ + newseq = sequence + length; + if (newseq > seq[src_index]) + { + ulong new_len; + + /* this one has more than we have seen. let's get the + payload that we have not seen. */ + + new_len = seq[src_index] - sequence; + + if (data_length <= new_len) + { + data = null; + data_length = 0; + incomplete_tcp_stream = true; + } + else + { + data_length -= new_len; + byte[] tmpData = new byte[data_length]; + for (ulong i = 0; i < data_length; i++) + tmpData[i] = data[i + new_len]; + + data = tmpData; + } + sequence = seq[src_index]; + length = newseq - seq[src_index]; + + /* this will now appear to be right on time :) */ + } + } + if (sequence == seq[src_index]) + { + /* right on time */ + seq[src_index] += length; + if (synflag) seq[src_index]++; + if (data != null) + { + write_packet_data(src_index, data); + } + /* done with the packet, see if it caused a fragment to fit */ + while (check_fragments(src_index)) + ; + } + else + { + /* out of order packet */ + if (data_length > 0 && sequence > seq[src_index]) + { + tmp_frag = new tcp_frag(); + tmp_frag.data = data; + tmp_frag.seq = sequence; + tmp_frag.len = length; + tmp_frag.data_len = data_length; + + if (frags[src_index] != null) + { + tmp_frag.next = frags[src_index]; + } + else + { + tmp_frag.next = null; + } + frags[src_index] = tmp_frag; + } + } + } /* end reassemble_tcp */ + + /* here we search through all the frag we have collected to see if + one fits */ + bool check_fragments(int index) + { + tcp_frag prev = null; + tcp_frag current; + current = frags[index]; + while (current != null) + { + if (current.seq == seq[index]) + { + /* this fragment fits the stream */ + if (current.data != null) + { + write_packet_data(index, current.data); + } + seq[index] += current.len; + if (prev != null) + { + prev.next = current.next; + } + else + { + frags[index] = current.next; + } + current.data = null; + current = null; + return true; + } + prev = current; + current = current.next; + } + return false; + } + + // cleans the linked list + void reset_tcp_reassembly() + { + tcp_frag current, next; + int i; + + empty_tcp_stream = true; + incomplete_tcp_stream = false; + for (i = 0; i < 2; i++) + { + seq[i] = 0; + src_addr[i] = 0; + src_port[i] = 0; + tcp_port[i] = 0; + bytes_written[i] = 0; + current = frags[i]; + while (current != null) + { + next = current.next; + current.data = null; + current = null; + current = next; + } + frags[i] = null; + } + } + + } + +} \ No newline at end of file diff --git a/src/tools/GameServer/MessageViewer/pCapReader.cs b/src/tools/GameServer/MessageViewer/pCapReader.cs new file mode 100644 index 00000000..d9e1512c --- /dev/null +++ b/src/tools/GameServer/MessageViewer/pCapReader.cs @@ -0,0 +1,171 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using SharpPcap.LibPcap; +using SharpPcap; +using PacketDotNet; +using System.IO; + +namespace GameMessageViewer +{ + + /// + /// Class that identifies a connection within a pcap dump + /// + class Connection + { + private string m_srcIp; + public string SourceIp + { + get { return m_srcIp; } + } + + private ushort m_srcPort; + public ushort SourcePort + { + get { return m_srcPort; } + } + + private string m_dstIp; + public string DestinationIp + { + get { return m_dstIp; } + } + + private ushort m_dstPort; + public ushort DestinationPort + { + get { return m_dstPort; } + } + + public Connection(string sourceIP, UInt16 sourcePort, string destinationIP, UInt16 destinationPort) + { + m_srcIp = sourceIP; + m_dstIp = destinationIP; + m_srcPort = sourcePort; + m_dstPort = destinationPort; + } + + public Connection(PacketDotNet.TcpPacket packet) + { + m_srcIp = (packet.ParentPacket as PacketDotNet.IPv4Packet).SourceAddress.ToString(); + m_dstIp = (packet.ParentPacket as PacketDotNet.IPv4Packet).DestinationAddress.ToString(); + m_srcPort = (ushort)packet.SourcePort; + m_dstPort = (ushort)packet.DestinationPort; + } + + /// + /// Overrided in order to catch both sides of the connection + /// with the same connection object + /// + /// + /// + public override bool Equals(object obj) + { + if (!(obj is Connection)) + return false; + Connection con = (Connection)obj; + + bool result = ((con.SourceIp.Equals(m_srcIp)) && (con.SourcePort == m_srcPort) && (con.DestinationIp.Equals(m_dstIp)) && (con.DestinationPort == m_dstPort)) || + ((con.SourceIp.Equals(m_dstIp)) && (con.SourcePort == m_dstPort) && (con.DestinationIp.Equals(m_srcIp)) && (con.DestinationPort == m_srcPort)); + + return result; + } + + public override int GetHashCode() + { + return ((m_srcIp.GetHashCode() ^ m_srcPort.GetHashCode()) as object).GetHashCode() ^ + ((m_dstIp.GetHashCode() ^ m_dstPort.GetHashCode()) as object).GetHashCode(); + } + + public string getFileName(string path) + { + return string.Format("{0}{1}.{2}-{3}.{4}.tmp", path, m_srcIp, m_srcPort, m_dstIp, m_dstPort); + } + } + + + + + + class pCapReader + { + /// + /// Reconstruct a Pcap file using TcpRecon class + /// + public static List ReconSingleFileSharpPcap(string capFile) + { + var capture = new CaptureFileReaderDevice(capFile); + var retVal = new List(); + + //Register our handler function to the 'packet arrival' event + capture.OnPacketArrival += + new SharpPcap.PacketArrivalEventHandler(device_PcapOnPacketArrival); + + //Start capture 'INFINTE' number of packets + //This method will return when EOF reached. + capture.Capture(); + + //Close the pcap device + capture.Close(); + + // Clean up + foreach (TcpRecon tr in sharpPcapDict.Values) + { + retVal.Add(tr.data_out_file.BaseStream as MemoryStream); + tr.Close(); + tr.data_out_file.BaseStream.Seek(0, SeekOrigin.Begin); + } + sharpPcapDict.Clear(); + return retVal; + } + + + + // Holds the file streams for each tcp session in case we use SharpPcap + static Dictionary sharpPcapDict = new Dictionary(); + static string path = ""; + + // The callback function for the SharpPcap library + private static void device_PcapOnPacketArrival(object sender, CaptureEventArgs e) + { + if (Packet.ParsePacket(LinkLayers.Ethernet, e.Packet.Data).PayloadPacket == null) return; + + TcpPacket tcpPacket = Packet.ParsePacket(LinkLayers.Ethernet, e.Packet.Data).PayloadPacket.PayloadPacket as TcpPacket; + + // THIS FILTERS D3 TRAFFIC, GS AS WELL AS MOONET + if (tcpPacket != null && (tcpPacket.SourcePort == 1119 || tcpPacket.DestinationPort == 1119)) + { + Connection c = new Connection(tcpPacket); + if (!sharpPcapDict.ContainsKey(c)) + { + string fileName = c.getFileName(path); + TcpRecon tcpRecon = new TcpRecon(fileName); + sharpPcapDict.Add(c, tcpRecon); + } + + // Use the TcpRecon class to reconstruct the session + sharpPcapDict[c].ReassemblePacket(tcpPacket); + } + } + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3ClassGenerator/D3ClassGenerator.csproj b/src/tools/GameServer/TypeExtractor/D3ClassGenerator/D3ClassGenerator.csproj new file mode 100644 index 00000000..040cd12a --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3ClassGenerator/D3ClassGenerator.csproj @@ -0,0 +1,70 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {D716B26C-469E-4292-A0DB-C6A2FD058E0C} + Exe + Properties + D3ClassGenerator + D3ClassGenerator + v4.0 + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + {F4367152-8294-4CF1-A984-3CD7B58DDEAD} + D3TypeDescriptor + + + + + + \ No newline at end of file diff --git a/src/tools/GameServer/TypeExtractor/D3ClassGenerator/Program.cs b/src/tools/GameServer/TypeExtractor/D3ClassGenerator/Program.cs new file mode 100644 index 00000000..78ff82e0 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3ClassGenerator/Program.cs @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + using System; + using System.IO; + using System.Text; +using D3TypeDescriptor; +using System.Xml.Linq; + +namespace D3ClassGenerator +{ + class Program + { + static void Main(string[] args) + { + NetAttribute.LoadXml("attributes.xml"); + + XDocument doc = XDocument.Load("typedescriptors.xml"); + int protocolHash; + var descriptors = TypeDescriptor.LoadXml(doc.Root, out protocolHash); + + var structs = TypeDescriptor.FilterGameMessageStructures(descriptors); + + var writer = new StreamWriter("classgenerator-output.cs"); + + foreach (var s in structs) + { + var b = new StringBuilder(); + s.GenerateClass(b, 4); + writer.WriteLine(b.ToString()); + } + + writer.Close(); + + writer = new StreamWriter("attributes-output.cs"); + var builder = new StringBuilder(); + NetAttribute.GenerateClass(builder); + writer.WriteLine(builder.ToString()); + writer.Close(); + + Console.WriteLine("done"); + Console.ReadLine(); + } + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3ClassGenerator/Properties/AssemblyInfo.cs b/src/tools/GameServer/TypeExtractor/D3ClassGenerator/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..a7319a6c --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3ClassGenerator/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("D3ClassGenerator")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("D3ClassGenerator")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("fa9f5e34-8189-4368-bab3-c01b82fb3746")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/BasicTypeDescriptor.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/BasicTypeDescriptor.cs new file mode 100644 index 00000000..5216198d --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/BasicTypeDescriptor.cs @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Xml.Linq; + +namespace D3TypeDescriptor +{ + [TypeOverrideIgnore] + public class BasicTypeDescriptor : TypeDescriptor + { + public override bool IsBasicType + { + get + { + return true; + } + } + + public override System.Xml.Linq.XElement ToXml() + { + XElement e = base.ToXml(); + e.Name = "BasicDescriptor"; + return e; + } + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/BitBuffer.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/BitBuffer.cs new file mode 100644 index 00000000..8f754ecb --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/BitBuffer.cs @@ -0,0 +1,321 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + using System; + using System.Text; + +namespace D3TypeDescriptor +{ + public class ProtocolBitBufferException : Exception + { + public ProtocolBitBufferException(string msg) : base(msg) { } + } + + public class BitBuffer + { + public byte[] Data; + public int Length; + public int Position; + + public BitBuffer(byte[] data, int position, int length) + { + Data = data; + Position = position; + Length = length; + } + + public BitBuffer(byte[] data) + { + Data = data; + Position = 0; + Length = data.Length * 8; + } + + public BitBuffer(int byteCapacity) + { + Data = new byte[byteCapacity]; + Position = 0; + Length = 0; + } + + /* + public GameMessage ParseMessage() + { + return GameMessage.ParseMessage(this); + } + + public void EncodeMessage(GameMessage msg) + { + WriteInt(9, msg.Id); + msg.Encode(this); + } + */ + public byte[] GetPacketAndReset() + { + int bytes = ((Length + 7) & (~7)) >> 3; + Position = 0; + WriteInt(32, bytes); + byte[] result = new byte[bytes]; + + Array.Copy(Data, result, bytes); + Length = 32; + Position = 32; + + for (int i = 0; i < Data.Length; i++) Data[i] = 0; // FIXME: WriteInt bugged? Dont care atm + + return result; + } + + public bool CheckAvailable(int length) + { + return Position + length <= Length; + } + const int BufferAlignment = 31; + + public void AppendData(byte[] data) + { + int length = Length >> 3; + if (length + data.Length > Data.Length) + { + int newSize = (length + data.Length + BufferAlignment) & (~BufferAlignment); + Array.Resize(ref Data, newSize); + } + Array.Copy(data, 0, Data, length, data.Length); + Length += data.Length * 8; + } + + public void ConsumeData() + { + int bytes = ((Position + 7) & (~7)) >> 3; + Array.Copy(Data, bytes, Data, 0, (Length >> 3) - bytes); + Length = Length - (bytes * 8); + Position = 0; + } + + + public void MakeAvailable(int length) + { + if (Position + length > Data.Length * 8) + { + int newSize = (((Position + length + 7) / 8) + BufferAlignment) & (~BufferAlignment); + Array.Resize(ref Data, newSize); + } + } + + public static int GetBitCount(int x) + { + int count = 0; + while (x > 0) + { + x >>= 1; + count++; + } + return count; + } + + public static int GetIntegerValueBitCount(int min, int max) + { + int x = max - min; + if (x <= 0) + return 0; // D3 compat + return GetBitCount(x); + } + + public bool IsPacketAvailable() + { + if (Length - Position < 32) + return false; + int pos = Position; + int packetSize = ReadInt(32); + Position = pos; + return CheckAvailable(packetSize * 8); + } + + public int ReadInt(int length) + { + if (!CheckAvailable(length)) + throw new ProtocolBitBufferException("Not enough bits remaining."); + + int result = 0; + while (length > 0) + { + int off = Position & 7; + int count = 8 - off; + if (count > length) + count = length; + int mask = (1 << count) - 1; + int bits = (Data[Position >> 3] >> off); + result |= (bits & mask) << (length - count); + length -= count; + Position += count; + } + return result; + } + + public void WriteInt(int length, int value) + { + MakeAvailable(length); + while (length > 0) + { + int off = Position & 7; + int count = 8 - off; + if (count > length) + count = length; + int mask = (1 << count) - 1; + Data[Position >> 3] = (byte)((Data[Position >> 3] & (~(mask << off))) | (((value >> (length - count)) & mask) << off)); + //Data[Position >> 3] |= (byte)(((value >> (length - count)) & mask) << off); + length -= count; + Position += count; + if (Position > Length) + Length = Position; + } + } + + byte[] _floatBuffer = new byte[4]; + + public float ReadFloat32() + { + int value = ReadInt(32); + _floatBuffer[0] = (byte)value; + _floatBuffer[1] = (byte)((value >> 8) & 0xFF); + _floatBuffer[2] = (byte)((value >> 16) & 0xFF); + _floatBuffer[3] = (byte)((value >> 24) & 0xFF); + return BitConverter.ToSingle(_floatBuffer, 0); + } + + public void WriteFloat32(float value) + { + WriteInt(32, BitConverter.ToInt32(BitConverter.GetBytes(value), 0)); + } + + + public long ReadInt64(int length) + { + int count = length >= 32 ? 32 : length; + long result = ReadInt(count); + count = length - count; + if (count > 0) + result = (result << count) | (long)(uint)ReadInt(count); + return result; + } + + public void WriteInt64(int length, long value) + { + MakeAvailable(length); + + if (length <= 32) + { + WriteInt(length, (int)(uint)value); + return; + } + + int count = length - 32; + WriteInt(32, (int)(uint)(value >> count)); + WriteInt(count, (int)(uint)value); + } + + + public string ReadCharArray(int maxLength) + { + int size = ReadInt(GetBitCount(maxLength)); + Position = (Position + 7) & (~7); + if (!CheckAvailable(size * 8)) + throw new ProtocolBitBufferException("Not enough bits remaining."); + var result = Encoding.UTF8.GetString(Data, Position >> 3, size); + Position += size * 8; + return result; + } + + public void WriteCharArray(int maxLength, string value) + { + var result = Encoding.UTF8.GetBytes(value); + WriteInt(GetBitCount(maxLength), result.Length); + Position = (Position + 7) & (~7); + MakeAvailable(result.Length * 8); + Buffer.BlockCopy(result, 0, Data, Position >> 3, result.Length); + Position += result.Length * 8; + if (Position > Length) + Length = Position; + } + + public bool ReadBool() { return ReadInt(1) != 0; } + public void WriteBool(bool value) { WriteInt(1, value ? 1 : 0); } + + public byte[] ReadBlob(int sizeBits) + { + int size = ReadInt(sizeBits); + byte[] result = new byte[size]; + Position = (Position + 7) & (~7); + if (!CheckAvailable(size * 8)) + throw new ProtocolBitBufferException("Not enough bits remaining."); + Buffer.BlockCopy(Data, Position >> 3, result, 0, size); + Position += size * 8; + return result; + } + public byte[] ReadBlobNoLength(int size) + { + byte[] result = new byte[size]; + Position = (Position + 7) & (~7); + if (!CheckAvailable(size * 8)) + throw new ProtocolBitBufferException("Not enough bits remaining."); + Buffer.BlockCopy(Data, Position >> 3, result, 0, size); + Position += size * 8; + return result; + } + public void WriteBlob(int sizeBits, byte[] data) + { + WriteInt(sizeBits, data.Length); + Position = (Position + 7) & (~7); + MakeAvailable(data.Length * 8); + Buffer.BlockCopy(data, 0, Data, Position >> 3, data.Length); + Position += data.Length * 8; + if (Position > Length) + Length = Position; + } + + + public float ReadFloat16() + { + int bits = ReadInt(16); + int value; + value = (bits & 0x3FF) << 13; + value |= (((bits >> 10) & 0x1F) + 112) << 23; + value |= (bits & 0x8000) << 16; + + _floatBuffer[0] = (byte)value; + _floatBuffer[1] = (byte)((value >> 8) & 0xFF); + _floatBuffer[2] = (byte)((value >> 16) & 0xFF); + _floatBuffer[3] = (byte)((value >> 24) & 0xFF); + return BitConverter.ToSingle(_floatBuffer, 0); + } + + public void WriteFloat16(float value) + { + int bits = BitConverter.ToInt32(BitConverter.GetBytes(value), 0); + int x = (bits >> 13) & 0x3FF; + int y = (((bits >> 23) & 0xFF) - 112); + if (y > 0) + x |= y << 10; + x |= (bits >> 16) & 0x8000; + WriteInt(16, x); + if (Position > Length) + Length = Position; + } + + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/D3TypeDescriptor.csproj b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/D3TypeDescriptor.csproj new file mode 100644 index 00000000..c85bdd58 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/D3TypeDescriptor.csproj @@ -0,0 +1,104 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {F4367152-8294-4CF1-A984-3CD7B58DDEAD} + Library + Properties + D3TypeDescriptor + D3TypeDescriptor + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Extensions.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Extensions.cs new file mode 100644 index 00000000..12555daf --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Extensions.cs @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Text; +using System.Xml.Linq; + +namespace D3TypeDescriptor +{ + static class Extensions + { + public static string ToMaybeHexString(this int value, int minHex) + { + if (value >= minHex || value <= -minHex) + return "0x" + value.ToString("X"); + return value.ToString(); + } + + public static int IntAttribute(this XElement e, string name) + { + var a = e.Attribute(name); + if (a == null) + throw new Exception("Expected int attribute: " + name); + return int.Parse(a.Value); + } + + public static int OptionalIntAttribute(this XElement e, string name) + { + var a = e.Attribute(name); + return a != null ? int.Parse(a.Value) : 0; + } + + public static int OptionalIntAttribute(this XElement e, string name, int defaultValue) + { + var a = e.Attribute(name); + return a != null ? int.Parse(a.Value) : defaultValue; + } + + public static string OptionalStringAttribute(this XElement e, string name) + { + var a = e.Attribute(name); + return a != null ? a.Value : string.Empty; + } + + public static TypeDescriptor OptionalTypeAttribute(this XElement e, string name, Dictionary typeByIndex) + { + var a = e.Attribute(name); + if (a == null) + return null; + + int index = int.Parse(a.Value.Split('#')[1]); + return typeByIndex[index]; + } + + public static void IndentAppendLines(this StringBuilder b, int pad, string text) + { + foreach (var line in text.Split(new string[] { Environment.NewLine }, StringSplitOptions.None)) + { + if (string.IsNullOrWhiteSpace(line)) + b.AppendLine(); + else + { + b.Append(' ', pad); b.AppendLine(line); + } + } + } + + public static void IndentAppend(this StringBuilder b, int pad, string text) + { + b.Append(' ', pad); b.Append(text); + } + public static void IndentAppendLine(this StringBuilder b, int pad, string text) + { + b.Append(' ', pad); b.AppendLine(text); + } + + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/FieldDescriptor.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/FieldDescriptor.cs new file mode 100644 index 00000000..c2bc9305 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/FieldDescriptor.cs @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Xml.Linq; + +namespace D3TypeDescriptor +{ + public class FieldDescriptor + { + public int Index; + public string Name; + public TypeDescriptor Type; + public int Offset; + public int Min; + public int Max; + public int Flags; + public TypeDescriptor SubType; + public int VariableOffset; + public int ArrayLength = -1; + public int ArrayLengthOffset; + public int EncodedBits; + public int EncodedBits2; + public int SnoType = -1; + public int TagMapRelated; + public Tuple[] EnumFields; + public int FlagIndex; + public string FuncA; + public string FuncB; + public int DspIndex = -1; + + public bool HasMinMax { get { return (Flags & 0x10) != 0; } } + public bool HasArrayLengthOffset { get { return (Flags & 0x08) != 0; } } + public bool Float16Encoding { get { return (Flags & 0x80) != 0; } } + + + public string GetFieldName() { return string.IsNullOrEmpty(Name) ? "Field" + Index : Name; } + + + public FieldDescriptor() { } + public XElement ToXml() + { + XElement e = new XElement("Field"); + if (!string.IsNullOrEmpty(Name)) e.Add(new XAttribute("Name", Name)); + if (Type != null && Type.Name != "DT_NULL") e.Add(new XAttribute("Type", Type.Name + "#" + Type.Index)); + e.Add(new XAttribute("Offset", Offset)); + if (((Flags >> 4) & 1) != 0) + { + e.Add(new XAttribute("Min", Min)); + e.Add(new XAttribute("Max", Max)); + } + e.Add(new XAttribute("Flags", Flags)); + if (SubType != null && SubType.Name != "DT_NULL") e.Add(new XAttribute("SubType", SubType.Name + "#" + SubType.Index)); + if (VariableOffset != 0) e.Add(new XAttribute("VariableOffset", VariableOffset)); + if (ArrayLength != -1) e.Add(new XAttribute("ArrayLength", ArrayLength)); + if (ArrayLengthOffset != 0) e.Add(new XAttribute("ArrayLengthOffset", ArrayLengthOffset)); + if (EncodedBits != 0) e.Add(new XAttribute("EncodedBits", EncodedBits)); + if (EncodedBits2 != 0) e.Add(new XAttribute("EncodedBits2", EncodedBits2)); + if (SnoType != -1) e.Add(new XAttribute("SnoType", SnoType)); // TODO: Add name of SNO + if (TagMapRelated != 0) e.Add(new XAttribute("TagMapRelated", TagMapRelated)); + if (EnumFields != null) + { + XElement enums = new XElement("Enum"); + foreach (var t in EnumFields) + enums.Add(new XElement("Entry", new XAttribute("Name", t.Item1), new XAttribute("Value", t.Item2))); + e.Add(enums); + } + if (FlagIndex != 0) e.Add(new XAttribute("FlagIndex", FlagIndex)); + if (!string.IsNullOrEmpty(FuncA)) e.Add(new XAttribute("FuncA", FuncA)); + if(!string.IsNullOrEmpty(FuncB)) e.Add(new XAttribute("FuncB", FuncB)); + if(DspIndex != -1) e.Add(new XAttribute("DspIndex", DspIndex)); + + return e; + } + + public FieldDescriptor(XElement e, int index, Dictionary typesByIndex) + { + Index = index; + Name = e.OptionalStringAttribute("Name"); + Type = e.OptionalTypeAttribute("Type", typesByIndex); + Offset = e.IntAttribute("Offset"); + Min = e.OptionalIntAttribute("Min"); + Max = e.OptionalIntAttribute("Max"); + Flags = e.IntAttribute("Flags"); + SubType = e.OptionalTypeAttribute("SubType", typesByIndex); + VariableOffset = e.OptionalIntAttribute("VariableOffset"); + ArrayLength = e.OptionalIntAttribute("ArrayLength", -1); + ArrayLengthOffset = e.OptionalIntAttribute("ArrayLengthOffset"); + EncodedBits = e.OptionalIntAttribute("EncodedBits"); + EncodedBits2 = e.OptionalIntAttribute("EncodedBits2"); + SnoType = e.OptionalIntAttribute("SnoType", -1); + TagMapRelated = e.OptionalIntAttribute("TagMapRelated"); + var en = e.Element("Enum"); + if (en != null) + EnumFields = en.Elements().Select(x => new Tuple(x.Attribute("Name").Value, int.Parse(x.Attribute("Value").Value))).ToArray(); + FlagIndex = e.OptionalIntAttribute("FlagIndex"); + FuncA = e.OptionalStringAttribute("FuncA"); + FuncB = e.OptionalStringAttribute("FuncB"); + DspIndex = e.OptionalIntAttribute("DspIndex", -1); + } + + } + +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/GameMessageDescriptor.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/GameMessageDescriptor.cs new file mode 100644 index 00000000..fac54bd7 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/GameMessageDescriptor.cs @@ -0,0 +1,95 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Linq; +using System.Text; +using System.Xml.Linq; + +namespace D3TypeDescriptor +{ + [TypeOverrideIgnore] + public class GameMessageDescriptor : StructureTypeDescriptor + { + public int Size; + public int[] NetworkIds; + + public override bool IsGameMessage + { + get + { + return true; + } + } + + public override void LoadXml(XElement e) + { + base.LoadXml(e); + Size = e.IntAttribute("Size"); + NetworkIds = e.Attribute("NetworkIds").Value.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(x => int.Parse(x)).ToArray(); + } + + public override System.Xml.Linq.XElement ToXml() + { + XElement e = base.ToXml(); + e.Name = "GameMessageDescriptor"; + e.Add(new XAttribute("Size", Size)); + e.Add(new XAttribute("NetworkIds", string.Join(" ", NetworkIds))); + return e; + } + + public override void LoadFields(FieldDescriptor[] fields) + { + if(fields[0].Type.Name != "RequiredMessageHeader") + throw new Exception("Expected RequiredMessageHeader."); + fields = fields.Skip(1).ToArray(); + + for (int i = 0; i < fields.Length; i++) + fields[i].Index = i; + + base.LoadFields(fields); + } + + public override void GenerateClass(StringBuilder b, int pad) + { + b.Append(' ', pad); b.AppendLine("public class " + Name + " : GameMessage"); + b.Append(' ', pad); b.AppendLine("{"); + GenerateFieldsAndFunctions(b, pad+4); + b.Append(' ', pad); b.AppendLine("}"); + } + + public override void GenerateParseFunction(StringBuilder b, int pad) + { + b.Append(' ', pad); b.AppendLine("public override void Parse(GameBitBuffer buffer)"); + b.Append(' ', pad); b.AppendLine("{"); + GenerateParseBody(b, pad + 4, "buffer"); + b.Append(' ', pad); b.AppendLine("}"); + b.AppendLine(); + } + + public override void GenerateEncodeFunction(StringBuilder b, int pad) + { + b.Append(' ', pad); b.AppendLine("public override void Encode(GameBitBuffer buffer)"); + b.Append(' ', pad); b.AppendLine("{"); + GenerateEncodeBody(b, pad + 4, "buffer"); + b.Append(' ', pad); b.AppendLine("}"); + b.AppendLine(); + } + + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/NetAttribute.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/NetAttribute.cs new file mode 100644 index 00000000..803b73d2 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/NetAttribute.cs @@ -0,0 +1,190 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Text; +using System.Xml.Linq; + +namespace D3TypeDescriptor +{ + + public enum NetAttributeEncoding + { + Int, + IntMinMax, + //FloatMinMax, + Float16, + Float16Or32, + Float32, + } + + public class NetAttribute + { + public int Id; + public int U2; + public int U3; + public int U4; + public int U5; + + public string ScriptA; + public string ScriptB; + public string Name; + + public NetAttributeEncoding EncodingType; + + public byte U10; + + public int Min; + public int Max; + public int BitCount; + + public bool IsInteger { get { return EncodingType == NetAttributeEncoding.Int || EncodingType == NetAttributeEncoding.IntMinMax; } } + + public NetAttribute() + { + } + + public NetAttribute(int id, int u2, int u3, int u4, int u5, string scriptA, string scriptB, string name, NetAttributeEncoding encodingType, byte u10, int min, int max, int bitCount) + { + Id = id; + U2 = u2; + U3 = u3; + U4 = u4; + U5 = u5; + ScriptA = scriptA; + ScriptB = scriptB; + Name = name; + EncodingType = encodingType; + U10 = u10; + + Min = min; + Max = max; + BitCount = bitCount; + } + + public static NetAttribute[] Attributes; + + public static void SaveXml(string filename) + { + XElement root = new XElement("Attributes"); + root.Add(new XAttribute("Count", Attributes.Length)); + + for (int i = 0; i < Attributes.Length; i++) + { + var a = Attributes[i]; + root.Add(new XElement("Entry", + new XAttribute("Id", a.Id), + new XAttribute("U2", a.U2), + new XAttribute("U3", a.U3), + new XAttribute("U4", a.U4), + new XAttribute("U5", a.U5), + new XAttribute("ScriptA", a.ScriptA), + new XAttribute("ScriptB", a.ScriptB), + new XAttribute("Name", a.Name), + new XAttribute("EncodingType", a.EncodingType.ToString()), + new XAttribute("U10", a.U10), + + new XAttribute("Min", a.Min), + new XAttribute("Max", a.Max), + new XAttribute("BitCount", a.BitCount) + )); + } + XDocument doc = new XDocument(); + doc.Add(root); + doc.Save(filename); + } + + public static void LoadXml(string filename) + { + XDocument doc = XDocument.Load(filename); + var root = doc.Root; + int count = int.Parse(root.Attribute("Count").Value); + Attributes = new NetAttribute[count]; + + foreach (var e in root.Elements()) + { + NetAttribute a = new NetAttribute(); + a.Id = int.Parse(e.Attribute("Id").Value); + a.U2 = int.Parse(e.Attribute("U2").Value); + a.U3 = int.Parse(e.Attribute("U3").Value); + a.U4 = int.Parse(e.Attribute("U4").Value); + a.U5 = int.Parse(e.Attribute("U5").Value); + + a.ScriptA = e.Attribute("ScriptA").Value; + a.ScriptB = e.Attribute("ScriptB").Value; + a.Name = e.Attribute("Name").Value; + + a.EncodingType = (NetAttributeEncoding)Enum.Parse(typeof(NetAttributeEncoding), e.Attribute("EncodingType").Value); + + a.U10 = (byte)int.Parse(e.Attribute("U10").Value); + a.Min = int.Parse(e.Attribute("Min").Value); + a.Max = int.Parse(e.Attribute("Max").Value); + a.BitCount = int.Parse(e.Attribute("BitCount").Value); + + Attributes[a.Id] = a; + } + } + + public static void GenerateClass(StringBuilder b) + { + b.Append("public partial class GameAttribute\n{\n\n"); + + foreach (var attr in Attributes) + { + string newName = attr.Name.Replace(' ', '_'); + + b.Append("public static readonly GameAttribute"); + if (attr.BitCount == 1) + b.Append("B"); + else if (attr.IsInteger) + b.Append("I"); + else + b.Append("F"); + + b.Append(" "); + b.Append(newName); + b.Append(" = new GameAttribute"); + + if (attr.BitCount == 1) + b.Append("B"); + else if (attr.IsInteger) + b.Append("I"); + else + b.Append("F"); + + b.Append("("); + b.Append(attr.Id); b.Append(", "); + b.Append(attr.U2); b.Append(", "); + b.Append(attr.U3); b.Append(", "); + b.Append(attr.U4); b.Append(", "); + b.Append(attr.U5); b.Append(", "); + b.Append("\""); b.Append(attr.ScriptA); b.Append("\""); b.Append(", "); + b.Append("\""); b.Append(attr.ScriptB); b.Append("\""); b.Append(", "); + b.Append("\""); b.Append(attr.Name); b.Append("\""); b.Append(", "); + b.Append("GameAttributeEncoding."); b.Append(attr.EncodingType); b.Append(", "); + b.Append(attr.U10); b.Append(", "); + b.Append(attr.Min); b.Append(", "); + b.Append(attr.Max); b.Append(", "); + b.Append(attr.BitCount); + b.Append(");\n"); + } + + b.Append("}"); + } + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/AttributeSetValueMessage.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/AttributeSetValueMessage.cs new file mode 100644 index 00000000..1d9070ca --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/AttributeSetValueMessage.cs @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Text; + +namespace D3TypeDescriptor.Overrides +{ + class AttributeSetValueMessage : GameMessageDescriptor + { + public override void LoadFields(FieldDescriptor[] fields) + { + base.LoadFields(fields); // removes RequiredMessageHeader + if (this.Fields.Length != 3 || + this.Fields[0].Type.Name != "DT_INT" || + this.Fields[1].Type.Name != "NetAttributeKeyValue" || + this.Fields[2].Type != null) + throw new Exception("Unexpected fields in AttributeSetValueMessage"); + } + + public override void GenerateParseBody(StringBuilder b, int pad, string bitBufferName) + { + base.GenerateParseBody(b, pad, bitBufferName); + b.IndentAppendLine(pad, Fields[1].GetFieldName() + ".ParseValue(" + bitBufferName + ");"); + } + + public override void GenerateEncodeBody(StringBuilder b, int pad, string bitBufferName) + { + base.GenerateEncodeBody(b, pad, bitBufferName); + b.IndentAppendLine(pad, Fields[1].GetFieldName() + ".EncodeValue(" + bitBufferName + ");"); + } + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/AttributesSetValuesMessage.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/AttributesSetValuesMessage.cs new file mode 100644 index 00000000..27717a59 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/AttributesSetValuesMessage.cs @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + using System; + using System.Text; + +namespace D3TypeDescriptor.Overrides +{ + class AttributesSetValuesMessage : GameMessageDescriptor + { + public override void LoadFields(FieldDescriptor[] fields) + { + base.LoadFields(fields); // removes RequiredMessageHeader + if (Fields.Length != 3 || + Fields[0].Type.Name != "DT_INT" || + Fields[1].Type.Name != "DT_FIXEDARRAY" || Fields[1].SubType.Name != "NetAttributeKeyValue" || + Fields[2].Type != null) + throw new Exception("Unexpected fields in AttributesSetValuesMessage."); + } + + public override void GenerateParseBody(StringBuilder b, int pad, string bitBufferName) + { + base.GenerateParseBody(b, pad, bitBufferName); + var fieldName = Fields[1].GetFieldName(); + b.IndentAppendLine(pad, "for (int i = 0; i < " + fieldName + ".Length; i++) { " + fieldName + "[i].ParseValue(" + bitBufferName + "); };"); + } + + public override void GenerateEncodeBody(StringBuilder b, int pad, string bitBufferName) + { + base.GenerateEncodeBody(b, pad, bitBufferName); + var fieldName = Fields[1].GetFieldName(); + b.IndentAppendLine(pad, "for (int i = 0; i < " + fieldName + ".Length; i++) { " + fieldName + "[i].EncodeValue(" + bitBufferName + "); };"); + } + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_ACCEL.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_ACCEL.cs new file mode 100644 index 00000000..4d142f30 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_ACCEL.cs @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace D3TypeDescriptor +{ + class DT_ACCEL : DT_FLOAT + { + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_ANGLE.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_ANGLE.cs new file mode 100644 index 00000000..5d51c120 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_ANGLE.cs @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace D3TypeDescriptor +{ + class DT_ANGLE : DT_FLOAT + { + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_ANGULARVELOCITY.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_ANGULARVELOCITY.cs new file mode 100644 index 00000000..1c8af8ce --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_ANGULARVELOCITY.cs @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace D3TypeDescriptor +{ + class DT_ANGULARVELOCITY : DT_FLOAT + { + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_ATTRIBUTEPARAM.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_ATTRIBUTEPARAM.cs new file mode 100644 index 00000000..5f4e02e3 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_ATTRIBUTEPARAM.cs @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace D3TypeDescriptor +{ + class DT_ATTRIBUTEPARAM : BasicTypeDescriptor + { + + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_BYTE.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_BYTE.cs new file mode 100644 index 00000000..cb833b16 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_BYTE.cs @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + using System; + using System.Text; + +namespace D3TypeDescriptor +{ + class DT_BYTE : BasicTypeDescriptor + { + public override void GenerateField(StringBuilder b, int pad, FieldDescriptor f) + { + b.Append(' ', pad); b.AppendLine("public byte " + f.GetFieldName() + ";"); + } + + public override void GenerateParseBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) + { + if (f.HasMinMax) + throw new NotImplementedException(); + b.Append(' ', pad); b.AppendLine(f.GetFieldName() + " = (byte)" + bitBufferName + ".ReadInt(" + f.EncodedBits + ");"); + } + + public override void GenerateEncodeBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) + { + if (f.HasMinMax) + throw new NotImplementedException(); + b.Append(' ', pad); b.AppendLine(bitBufferName + ".WriteInt(" + f.EncodedBits + ", " + f.GetFieldName() + ");"); + } + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_CHARARRAY.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_CHARARRAY.cs new file mode 100644 index 00000000..ac0dd422 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_CHARARRAY.cs @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace D3TypeDescriptor +{ + class DT_CHARARRAY : BasicTypeDescriptor + { + public override void GenerateField(StringBuilder b, int pad, FieldDescriptor f) + { + b.Append(' ', pad); b.AppendLine("public string _" + f.GetFieldName() + ";"); + b.Append(' ', pad); b.AppendLine("public string " + f.GetFieldName() + " { get { return _" + f.GetFieldName() + "; } set { if(value != null && value.Length > " + f.ArrayLength + ") throw new ArgumentOutOfRangeException(); _" + f.GetFieldName() + " = value; } }"); + } + + public override void GenerateOptionalField(StringBuilder b, int pad, FieldDescriptor f) + { + GenerateField(b, pad, f); + } + + public override void GenerateParseBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) + { + b.Append(' ', pad); + b.AppendLine(f.GetFieldName() + " = " + bitBufferName + ".ReadCharArray(" + f.ArrayLength + ");"); + } + + public override void GenerateOptionalParseBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) + { + b.Append(' ', pad); b.AppendLine("if(" + bitBufferName + ".ReadBool())"); + GenerateParseBitBuffer(b, pad + 4, f, bitBufferName); + } + + public override void GenerateEncodeBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) + { + b.Append(' ', pad); b.AppendLine(bitBufferName + ".WriteCharArray(" + f.ArrayLength + ", " + f.GetFieldName() + ");"); + } + + public override void GenerateOptionalEncodeBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) + { + b.Append(' ', pad); b.AppendLine("if(" + f.GetFieldName() + " != null)"); + b.Append(' ', pad+4); b.AppendLine(bitBufferName + ".WriteCharArray(" + f.ArrayLength + ", " + f.GetFieldName() + ");"); + } + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_CSTRING.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_CSTRING.cs new file mode 100644 index 00000000..9034d066 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_CSTRING.cs @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace D3TypeDescriptor +{ + class DT_CSTRING : BasicTypeDescriptor + { + + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_DATAID.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_DATAID.cs new file mode 100644 index 00000000..ade4bd51 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_DATAID.cs @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace D3TypeDescriptor +{ + class DT_DATAID : DT_INT + { + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_ENUM.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_ENUM.cs new file mode 100644 index 00000000..0abb8199 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_ENUM.cs @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace D3TypeDescriptor +{ + class DT_ENUM : DT_INT + { + + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_FIXEDARRAY.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_FIXEDARRAY.cs new file mode 100644 index 00000000..41f637bb --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_FIXEDARRAY.cs @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace D3TypeDescriptor +{ + class DT_FIXEDARRAY : BasicTypeDescriptor + { + public override void GenerateField(StringBuilder b, int pad, FieldDescriptor f) + { + f.SubType.GenerateFixedArrayField(b, pad, f); + } + + public override void GenerateEncodeBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) + { + f.SubType.GenerateFixedArrayEncodeBitBuffer(b, pad, f, bitBufferName); + } + + public override void GenerateParseBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) + { + f.SubType.GenerateFixedArrayParseBitBuffer(b, pad, f, bitBufferName); + } + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_FLAG.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_FLAG.cs new file mode 100644 index 00000000..6fa582ca --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_FLAG.cs @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace D3TypeDescriptor +{ + class DT_FLAG : BasicTypeDescriptor + { + + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_FLOAT.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_FLOAT.cs new file mode 100644 index 00000000..f4a20bfc --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_FLOAT.cs @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + using System; + using System.Text; + +namespace D3TypeDescriptor +{ + class DT_FLOAT : BasicTypeDescriptor + { + public override void GenerateField(StringBuilder b, int pad, FieldDescriptor f) + { + b.Append(' ', pad); b.AppendLine("public float " + f.GetFieldName() + ";"); + } + + public override void GenerateOptionalField(StringBuilder b, int pad, FieldDescriptor f) + { + b.Append(' ', pad); b.AppendLine("public float? " + f.GetFieldName() + ";"); + } + + public override void GenerateParseBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) + { + if (f.HasMinMax) + throw new NotImplementedException(); + if (f.Float16Encoding) + throw new NotImplementedException(); + if (f.EncodedBits != 32) + throw new NotImplementedException(); + b.Append(' ', pad); + b.AppendLine(f.GetFieldName() + " = " + bitBufferName + ".ReadFloat32();"); + } + + public override void GenerateOptionalParseBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) + { + b.Append(' ', pad); b.AppendLine("if(" + bitBufferName + ".ReadBool())"); + GenerateParseBitBuffer(b, pad + 4, f, bitBufferName); + } + + public override void GenerateEncodeBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) + { + if (f.HasMinMax) + throw new NotImplementedException(); + if (f.Float16Encoding) + throw new NotImplementedException(); + if (f.EncodedBits != 32) + throw new NotImplementedException(); + b.Append(' ', pad); b.AppendLine(bitBufferName + ".WriteFloat32(" + f.GetFieldName() + ");"); + } + + public override void GenerateOptionalEncodeBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) + { + if (f.HasMinMax) + throw new NotImplementedException(); + if (f.Float16Encoding) + throw new NotImplementedException(); + if (f.EncodedBits != 32) + throw new NotImplementedException(); + var fieldName = f.GetFieldName(); + b.Append(' ', pad); b.AppendLine("if(" + fieldName + ".HasValue)"); + b.Append(' ', pad+4); b.AppendLine(bitBufferName + ".WriteFloat32(" + f.GetFieldName() + ".Value);"); + } + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_FORMULA.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_FORMULA.cs new file mode 100644 index 00000000..30c42be5 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_FORMULA.cs @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace D3TypeDescriptor +{ + class DT_FORMULA : BasicTypeDescriptor + { + + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_GBID.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_GBID.cs new file mode 100644 index 00000000..c54fc1c7 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_GBID.cs @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace D3TypeDescriptor +{ + class DT_GBID : DT_INT + { + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_HIGHPRECISIONPERCENT.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_HIGHPRECISIONPERCENT.cs new file mode 100644 index 00000000..6546af8b --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_HIGHPRECISIONPERCENT.cs @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace D3TypeDescriptor +{ + class DT_HIGHPRECISIONPERCENT : DT_FLOAT + { + + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_IMPULSE.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_IMPULSE.cs new file mode 100644 index 00000000..c5eaecd4 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_IMPULSE.cs @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace D3TypeDescriptor +{ + class DT_IMPULSE : DT_FLOAT + { + + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_INT.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_INT.cs new file mode 100644 index 00000000..58713818 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_INT.cs @@ -0,0 +1,182 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + using System; + using System.Text; + +namespace D3TypeDescriptor +{ + class DT_INT : BasicTypeDescriptor + { + public override void GenerateField(StringBuilder b, int pad, FieldDescriptor f) + { + if (f.HasMinMax) + { + if (f.Min == 0 && f.Max == 1) + { + b.Append(' ', pad); b.AppendLine("public bool " + f.GetFieldName() + ";"); + } + else + { + var name = f.GetFieldName(); + b.Append(' ', pad); b.AppendLine("int _" + name + ";"); + b.Append(' ', pad); b.AppendLine("public int " + name + " { get { return _" + name + "; } set { if(value < " + f.Min.ToMaybeHexString(1024) + " || value > " + f.Max.ToMaybeHexString(1024) + ") throw new ArgumentOutOfRangeException(); _" + name + " = value; } }"); + } + } + else + { + b.Append(' ', pad); b.AppendLine("public int " + f.GetFieldName() + ";"); + } + } + + public override void GenerateOptionalField(StringBuilder b, int pad, FieldDescriptor f) + { + if (f.HasMinMax) + { + if (f.Min == 0 && f.Max == 1) + { + b.Append(' ', pad); b.AppendLine("public bool? " + f.GetFieldName() + ";"); + } + else + { + var name = f.GetFieldName(); + b.Append(' ', pad); b.AppendLine("int? _" + name + ";"); + b.Append(' ', pad); b.AppendLine("public int? " + name + " { get { return _" + name + "; } set { if(value.HasValue && (value.Value < " + f.Min.ToMaybeHexString(1024) + " || value.Value > " + f.Max.ToMaybeHexString(1024) + ")) throw new ArgumentOutOfRangeException(); _" + name + " = value; } }"); + } + } + else + { + b.Append(' ', pad); b.AppendLine("public int? " + f.GetFieldName() + ";"); + } + } + + public override void GenerateFixedArrayField(StringBuilder b, int pad, FieldDescriptor f) + { + b.Append(' ', pad); b.AppendLine("int[] _" + f.GetFieldName() + ";"); + b.Append(' ', pad); + b.AppendLine("public int[] " + f.GetFieldName() + " { get { return _" + f.GetFieldName() + "; } set { if(value != null && value.Length " + (f.HasArrayLengthOffset ? "> " : "!= ") + f.ArrayLength + ") throw new ArgumentOutOfRangeException(); _" + f.GetFieldName() + " = value; } }"); + } + + public override void GenerateParseBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) + { + var fieldName = f.GetFieldName(); + b.Append(' ', pad); b.Append(fieldName + " = "); + if (f.HasMinMax) + { + if (f.Min == 0 && f.Max == 1) + { + b.AppendLine(bitBufferName + ".ReadBool();"); + } + else + { + if(f.Min != 0) + b.AppendLine(bitBufferName + ".ReadInt(" + f.EncodedBits + ") + (" + f.Min + ");"); + else + b.AppendLine(bitBufferName + ".ReadInt(" + f.EncodedBits + ");"); + } + } + else + { + b.AppendLine(bitBufferName + ".ReadInt(" + f.EncodedBits + ");"); + } + } + + public override void GenerateOptionalParseBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) + { + b.Append(' ', pad); b.AppendLine("if(" + bitBufferName + ".ReadBool())"); + GenerateParseBitBuffer(b, pad + 4, f, bitBufferName); + } + + public override void GenerateFixedArrayParseBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) + { + if (f.HasMinMax) + throw new NotImplementedException(); + + var fieldName = f.GetFieldName(); + b.Append(' ', pad); + if (f.HasArrayLengthOffset) + b.AppendLine(fieldName + " = new int[" + bitBufferName + ".ReadInt(" + f.EncodedBits2 + ")];"); + else + b.AppendLine(fieldName + " = new int[" + f.ArrayLength + "];"); + b.Append(' ', pad); b.AppendLine("for(int i = 0;i < _" + fieldName + ".Length;i++) _" + fieldName + "[i] = " + bitBufferName + ".ReadInt(" + f.EncodedBits + ");"); + } + + public override void GenerateEncodeBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) + { + if (f.HasMinMax) + { + if (f.Min == 0 && f.Max == 1) + { + b.Append(' ', pad); b.AppendLine(bitBufferName + ".WriteBool(" + f.GetFieldName() + ");"); + } + else + { + b.Append(' ', pad); + if(f.Min != 0) + b.AppendLine(bitBufferName + ".WriteInt(" + f.EncodedBits + ", " + f.GetFieldName() + " - (" + f.Min + "));"); + else + b.AppendLine(bitBufferName + ".WriteInt(" + f.EncodedBits + ", " + f.GetFieldName() + ");"); + } + } + else + { + b.Append(' ', pad); b.AppendLine(bitBufferName + ".WriteInt(" + f.EncodedBits + ", " + f.GetFieldName() + ");"); + } + } + + public override void GenerateOptionalEncodeBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) + { + b.Append(' ', pad); b.AppendLine("if(" + f.GetFieldName() + ".HasValue)"); + b.Append(' ', pad + 4); + if (f.HasMinMax) + { + if (f.Min == 0 && f.Max == 1) + { + b.AppendLine(bitBufferName + ".WriteBool(" + f.GetFieldName() + ".Value);"); + } + else + { + if (f.Min != 0) + b.AppendLine(bitBufferName + ".WriteInt(" + f.EncodedBits + ", " + f.GetFieldName() + ".Value - (" + f.Min + "));"); + else + b.AppendLine(bitBufferName + ".WriteInt(" + f.EncodedBits + ", " + f.GetFieldName() + ".Value);"); + } + } + else + { + b.AppendLine(bitBufferName + ".WriteInt(" + f.EncodedBits + ", " + f.GetFieldName() + ".Value);"); + } + + } + + public override void GenerateFixedArrayEncodeBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) + { + if (f.HasMinMax) + throw new NotImplementedException(); + + var fieldName = f.GetFieldName(); + + if (f.HasArrayLengthOffset) + { + b.Append(' ', pad); + b.AppendLine(bitBufferName + ".WriteInt(" + f.EncodedBits2 + ", " + f.GetFieldName() + ".Length);"); + } + b.Append(' ', pad); b.AppendLine("for(int i = 0;i < _" + fieldName + ".Length;i++) " + bitBufferName + ".WriteInt(" + f.EncodedBits + ", _" + fieldName + "[i]);"); + } + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_INT64.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_INT64.cs new file mode 100644 index 00000000..7fbb7e23 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_INT64.cs @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + using System; + using System.Text; + +namespace D3TypeDescriptor +{ + class DT_INT64 : BasicTypeDescriptor + { + public override void GenerateField(StringBuilder b, int pad, FieldDescriptor f) + { + if (f.HasMinMax) + throw new NotImplementedException(); + b.Append(' ', pad); b.AppendLine("public long " + f.GetFieldName() + ";"); + } + + public override void GenerateParseBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) + { + if (f.HasMinMax) + throw new NotImplementedException(); + b.Append(' ', pad); + b.AppendLine(f.GetFieldName() + " = " + bitBufferName + ".ReadInt64(" + f.EncodedBits + ");"); + } + + public override void GenerateEncodeBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) + { + if (f.HasMinMax) + throw new NotImplementedException(); + b.Append(' ', pad); + b.AppendLine(bitBufferName + ".WriteInt64(" + f.EncodedBits + ", " + f.GetFieldName() + ");"); + } + + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_MASS.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_MASS.cs new file mode 100644 index 00000000..831bd7e2 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_MASS.cs @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace D3TypeDescriptor +{ + class DT_MASS : DT_FLOAT + { + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_OPTIONAL.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_OPTIONAL.cs new file mode 100644 index 00000000..1b33637e --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_OPTIONAL.cs @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Text; + +namespace D3TypeDescriptor +{ + class DT_OPTIONAL : BasicTypeDescriptor + { + public override void GenerateField(StringBuilder b, int pad, FieldDescriptor f) + { + f.SubType.GenerateOptionalField(b, pad, f); + } + + public override void GenerateEncodeBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) + { + f.SubType.GenerateOptionalEncodeBitBuffer(b, pad, f, bitBufferName); + } + + public override void GenerateParseBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) + { + f.SubType.GenerateOptionalParseBitBuffer(b, pad, f, bitBufferName); + } + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_PERCENT.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_PERCENT.cs new file mode 100644 index 00000000..3e692ab6 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_PERCENT.cs @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace D3TypeDescriptor +{ + class DT_PERCENT : DT_FLOAT + { + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_SNO.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_SNO.cs new file mode 100644 index 00000000..e5da9d58 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_SNO.cs @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace D3TypeDescriptor +{ + class DT_SNO : DT_INT + { + // TODO: convert to string? ".pow" etc? + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_SNONAME_HANDLE.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_SNONAME_HANDLE.cs new file mode 100644 index 00000000..a8aa630a --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_SNONAME_HANDLE.cs @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace D3TypeDescriptor +{ + class DT_SNONAME_HANDLE : DT_INT + { + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_SNO_GROUP.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_SNO_GROUP.cs new file mode 100644 index 00000000..a346348e --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_SNO_GROUP.cs @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace D3TypeDescriptor +{ + class DT_SNO_GROUP : DT_INT + { + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_TAGMAP.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_TAGMAP.cs new file mode 100644 index 00000000..4201e161 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_TAGMAP.cs @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace D3TypeDescriptor +{ + class DT_TAGMAP : BasicTypeDescriptor + { + + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_TIME.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_TIME.cs new file mode 100644 index 00000000..79ce1f71 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_TIME.cs @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace D3TypeDescriptor +{ + class DT_TIME : DT_INT + { + // ms? + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_TRANSLATEABLE.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_TRANSLATEABLE.cs new file mode 100644 index 00000000..56c056c5 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_TRANSLATEABLE.cs @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace D3TypeDescriptor +{ + class DT_TRANSLATEABLE : BasicTypeDescriptor + { + + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_VARIABLEARRAY.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_VARIABLEARRAY.cs new file mode 100644 index 00000000..0d41152b --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_VARIABLEARRAY.cs @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace D3TypeDescriptor +{ + class DT_VARIABLEARRAY : BasicTypeDescriptor + { + + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_VELOCITY.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_VELOCITY.cs new file mode 100644 index 00000000..b0b69f96 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_VELOCITY.cs @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +namespace D3TypeDescriptor +{ + class DT_VELOCITY : DT_FLOAT + { + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_WORD.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_WORD.cs new file mode 100644 index 00000000..43a1329d --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/DT_WORD.cs @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + using System; + using System.Text; + +namespace D3TypeDescriptor +{ + class DT_WORD : BasicTypeDescriptor + { + public override void GenerateField(StringBuilder b, int pad, FieldDescriptor f) + { + if (f.HasMinMax) + throw new NotImplementedException(); + b.Append(' ', pad); b.AppendLine("public ushort " + f.GetFieldName() + ";"); + } + + public override void GenerateParseBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) + { + if (f.HasMinMax) + throw new NotImplementedException(); + + b.Append(' ', pad); b.AppendLine(f.GetFieldName() + " = (ushort)" + bitBufferName + ".ReadInt(" + f.EncodedBits + ");"); + } + + public override void GenerateEncodeBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) + { + if (f.HasMinMax) + throw new NotImplementedException(); + b.Append(' ', pad); b.AppendLine(bitBufferName + ".WriteInt(" + f.EncodedBits + ", " + f.GetFieldName() + ");"); + } + + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/GenericBlobMessage.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/GenericBlobMessage.cs new file mode 100644 index 00000000..0670bcaf --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/GenericBlobMessage.cs @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + using System; + using System.Text; + +namespace D3TypeDescriptor.Overrides +{ + class GenericBlobMessage : GameMessageDescriptor + { + public override void LoadFields(FieldDescriptor[] fields) + { + base.LoadFields(fields); // removes RequiredMessageHeader + + if (Fields.Length != 2 || + Fields[0].Type.Name != "DT_INT" || Fields[0].HasMinMax != false && Fields[0].EncodedBits != 32 || + Fields[1].Type != null) + throw new Exception("Unexpected fields in GenericBlobMessage"); + } + + public override void GenerateFields(StringBuilder b, int pad) + { + b.IndentAppendLine(pad, "public byte[] Data;"); + } + + public override void GenerateParseBody(StringBuilder b, int pad, string bitBufferName) + { + b.IndentAppendLine(pad, "Data = " + bitBufferName + ".ReadBlob(32);"); + } + + public override void GenerateEncodeBody(StringBuilder b, int pad, string bitBufferName) + { + b.IndentAppendLine(pad, bitBufferName + ".WriteBlob(32, Data);"); + } + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/NetAttributeKeyValue.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/NetAttributeKeyValue.cs new file mode 100644 index 00000000..c4046531 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Overrides/NetAttributeKeyValue.cs @@ -0,0 +1,137 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + using System; + using System.Text; + +namespace D3TypeDescriptor +{ + class NetAttributeKeyValue : StructureTypeDescriptor + { + [TypeOverrideIgnore] + class AttributeFieldType : BasicTypeDescriptor + { + public AttributeFieldType() + { + Index = -1; + Name = "GameAttribute"; + } + + public static AttributeFieldType Instance = new AttributeFieldType(); + + + public override void GenerateField(StringBuilder b, int pad, FieldDescriptor f) + { + b.Append(' ', pad); b.AppendLine("public GameAttribute " + f.GetFieldName() + ";"); + } + + public override void GenerateParseBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) + { + if (!f.HasMinMax || f.Min != 0) + throw new NotImplementedException(); + b.Append(' ', pad); b.AppendLine(f.GetFieldName() + " = GameAttribute.Attributes[" + bitBufferName + ".ReadInt(" + f.EncodedBits + ")];"); + } + + public override void GenerateEncodeBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) + { + b.Append(' ', pad); b.AppendLine(bitBufferName + ".WriteInt(" + f.EncodedBits + ", " + f.GetFieldName() + ".Id);"); + } + } + + public override void LoadFields(FieldDescriptor[] fields) + { + if (fields.Length != 3 || + fields[0].Type.Name != "DT_OPTIONAL" || fields[0].SubType.Name != "DT_INT" || + fields[1].Type.Name != "DT_INT" || + fields[2].Type != null) + throw new Exception("Unexpected fields in NetAttributeKeyValue structure."); + fields[1].Type = AttributeFieldType.Instance; + + base.LoadFields(fields); + } + + public override void GenerateFields(StringBuilder b, int pad) + { + base.GenerateFields(b, pad); + b.Append(' ', pad); b.AppendLine("public float Float; "); + b.Append(' ', pad); b.AppendLine("public int Int; "); + b.AppendLine(); + } + + public override void GenerateFieldsAndFunctions(StringBuilder b, int pad) + { + base.GenerateFieldsAndFunctions(b, pad); + + var fieldName = Fields[1].GetFieldName(); + + b.IndentAppendLines(pad, @"public void ParseValue(GameBitBuffer buffer) +{ + switch (" + fieldName + @".EncodingType) + { + case GameAttributeEncoding.Int: + Int = buffer.ReadInt(" + fieldName + @".BitCount); + break; + case GameAttributeEncoding.IntMinMax: + Int = buffer.ReadInt(" + fieldName + @".BitCount) + " + fieldName + @".Min; + break; + case GameAttributeEncoding.Float16: + Float = buffer.ReadFloat16(); + break; + case GameAttributeEncoding.Float16Or32: + Float = buffer.ReadBool() ? buffer.ReadFloat16() : buffer.ReadFloat32(); + break; + default: + throw new Exception(""bad voodoo""); + } +}"); + b.AppendLine(); + + b.IndentAppendLines(pad, @"public void EncodeValue(GameBitBuffer buffer) +{ + switch (" + fieldName + @".EncodingType) + { + case GameAttributeEncoding.Int: + buffer.WriteInt(" + fieldName + @".BitCount, Int); + break; + case GameAttributeEncoding.IntMinMax: + buffer.WriteInt(" + fieldName + @".BitCount, Int - " + fieldName + @".Min); + break; + case GameAttributeEncoding.Float16: + buffer.WriteFloat16(Float); + break; + case GameAttributeEncoding.Float16Or32: + if (Float >= 65536.0f || -65536.0f >= Float) + { + buffer.WriteBool(false); + buffer.WriteFloat32(Float); + } + else + { + buffer.WriteBool(true); + buffer.WriteFloat16(Float); + } + break; + default: + throw new Exception(""bad voodoo""); + } +}"); + + + } + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Properties/AssemblyInfo.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..ca150c69 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("D3TypeDescriptor")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("D3TypeDescriptor")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("c81e9ddc-9255-4caa-afd1-aa0e5caeb0aa")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/StructureTypeDescriptor.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/StructureTypeDescriptor.cs new file mode 100644 index 00000000..bd3d38b6 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/StructureTypeDescriptor.cs @@ -0,0 +1,204 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Linq; +using System.Text; +using System.Xml.Linq; + +namespace D3TypeDescriptor +{ + [TypeOverrideIgnore] + public class StructureTypeDescriptor : TypeDescriptor + { + public FieldDescriptor[] Fields; + + public override void LoadFields(FieldDescriptor[] fields) + { + Fields = fields; + } + + public override bool IsStructure + { + get + { + return true; + } + } + + public override System.Xml.Linq.XElement ToXml() + { + XElement element = base.ToXml(); + element.Name = "StructureDescriptor"; + + if (this.Fields == null) + return element; + + foreach (var field in this.Fields.OrderBy(x => x.Offset)) // order fields by offset. + element.Add(field.ToXml()); + + return element; + } + + + #region GenerateClass + public override void GenerateClass(StringBuilder b, int pad) + { + b.Append(' ', pad); b.AppendLine("public class " + Name); + b.Append(' ', pad); b.AppendLine("{"); + GenerateFieldsAndFunctions(b, pad + 4); + b.Append(' ', pad); b.AppendLine("}"); + } + + public virtual void GenerateFieldsAndFunctions(StringBuilder b, int pad) + { + GenerateFields(b, pad); + GenerateParseFunction(b, pad); + GenerateEncodeFunction(b, pad); + } + + public virtual void GenerateFields(StringBuilder b, int pad) + { + foreach (var f in Fields) + { + if (f.Type == null) + continue; + f.Type.GenerateField(b, pad, f); + } + + b.AppendLine(); + + } + + public virtual void GenerateParseFunction(StringBuilder b, int pad) + { + b.Append(' ', pad); b.AppendLine("public void Parse(GameBitBuffer buffer)"); + b.Append(' ', pad); b.AppendLine("{"); + GenerateParseBody(b, pad + 4, "buffer"); + b.Append(' ', pad); b.AppendLine("}"); + b.AppendLine(); + } + + public virtual void GenerateParseBody(StringBuilder b, int pad, string bitBufferName) + { + foreach (var f in Fields) + { + if (f.Type == null) + continue; + + f.Type.GenerateParseBitBuffer(b, pad, f, bitBufferName); + } + } + + public virtual void GenerateEncodeFunction(StringBuilder b, int pad) + { + b.Append(' ', pad); b.AppendLine("public void Encode(GameBitBuffer buffer)"); + b.Append(' ', pad); b.AppendLine("{"); + GenerateEncodeBody(b, pad + 4, "buffer"); + b.Append(' ', pad); b.AppendLine("}"); + b.AppendLine(); + } + + public virtual void GenerateEncodeBody(StringBuilder b, int pad, string bitBufferName) + { + foreach (var f in Fields) + { + if (f.Type == null) + continue; + + f.Type.GenerateEncodeBitBuffer(b, pad, f, bitBufferName); + } + } + + + #endregion + + #region GenerateField + public override void GenerateField(StringBuilder b, int pad, FieldDescriptor f) + { + b.Append(' ', pad); b.AppendLine("public " + Name + " " + f.GetFieldName() + ";"); + } + + public override void GenerateOptionalField(StringBuilder b, int pad, FieldDescriptor f) + { + GenerateField(b, pad, f); + } + + public override void GenerateFixedArrayField(StringBuilder b, int pad, FieldDescriptor f) + { + b.Append(' ', pad); b.AppendLine(Name + "[] _" + f.GetFieldName() + ";"); + b.Append(' ', pad); + b.AppendLine("public " + Name + "[] " + f.GetFieldName() + " { get { return _" + f.GetFieldName() + "; } set { if(value != null && value.Length " + (f.HasArrayLengthOffset ? "> " : "!= ") + f.ArrayLength + ") throw new ArgumentOutOfRangeException(); _" + f.GetFieldName() + " = value; } }"); + } + + public override void GenerateParseBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) + { + b.Append(' ', pad); b.AppendLine(f.GetFieldName() + " = new " + Name + "();"); + b.Append(' ', pad); b.AppendLine(f.GetFieldName() + ".Parse(" + bitBufferName + ");"); + } + + public override void GenerateOptionalParseBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) + { + b.Append(' ', pad); b.AppendLine("if(" + bitBufferName + ".ReadBool())"); + b.Append(' ', pad); b.AppendLine("{"); + GenerateParseBitBuffer(b, pad + 4, f, bitBufferName); + b.Append(' ', pad); b.AppendLine("}"); + } + + public override void GenerateFixedArrayParseBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) + { + var name = f.GetFieldName(); + b.Append(' ', pad); + if (f.HasArrayLengthOffset) + b.AppendLine(name + " = new " + Name + "[" + bitBufferName + ".ReadInt(" + f.EncodedBits2 + ")];"); + else + b.AppendLine(name + " = new " + Name + "[" + f.ArrayLength + "];"); + + b.Append(' ', pad); b.AppendLine("for(int i = 0;i < _" + name + ".Length;i++)"); + b.Append(' ', pad); b.AppendLine("{"); + b.Append(' ', pad + 4); b.AppendLine("_" + name + "[i] = new " + Name + "();"); + b.Append(' ', pad + 4); b.AppendLine("_" + name + "[i].Parse(" + bitBufferName + ");"); + b.Append(' ', pad); b.AppendLine("}"); + + } + + public override void GenerateEncodeBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) + { + b.Append(' ', pad); b.AppendLine(f.GetFieldName() + ".Encode(" + bitBufferName + ");"); + } + + public override void GenerateOptionalEncodeBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) + { + b.Append(' ', pad); b.AppendLine("if(" + f.GetFieldName() + " != null)"); + b.Append(' ', pad); b.AppendLine(f.GetFieldName() + ".Encode(" + bitBufferName + ");"); + } + + public override void GenerateFixedArrayEncodeBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) + { + var fieldName = f.GetFieldName(); + + if (f.HasArrayLengthOffset) + { + b.Append(' ', pad); + b.AppendLine(bitBufferName + ".WriteInt(" + f.EncodedBits2 + ", _" + f.GetFieldName() + ".Length);"); + } + + b.Append(' ', pad); b.AppendLine("for(int i = 0;i < _" + fieldName + ".Length;i++) _" + fieldName + "[i].Encode(" + bitBufferName + ");"); + } + #endregion + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/TypeDescriptor.cs b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/TypeDescriptor.cs new file mode 100644 index 00000000..9a4584b6 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/TypeDescriptor.cs @@ -0,0 +1,191 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Xml.Linq; + +namespace D3TypeDescriptor +{ + public class TypeOverrideIgnoreAttribute : Attribute + { + } + + public abstract class TypeDescriptor + { + public int Index; + public string Name; + public int UnkValue; + + public virtual bool IsBasicType { get { return false; } } + public virtual bool IsStructure { get { return false; } } + public virtual bool IsGameMessage { get { return false; } } + + static Dictionary _BasicOverrides = new Dictionary(); + static Dictionary _GameMessageOverrides = new Dictionary(); + static Dictionary _StructureOverrides = new Dictionary(); + + static TypeDescriptor() + { + var asm = typeof(TypeDescriptor).Assembly; + foreach (var t in asm.GetTypes()) + { + if (!t.IsClass || !t.IsSubclassOf(typeof(TypeDescriptor))) + continue; + var attribs = t.GetCustomAttributes(typeof(TypeOverrideIgnoreAttribute), false); + if (attribs != null && attribs.Length > 0) + continue; + + if (t.IsSubclassOf(typeof(GameMessageDescriptor))) + _GameMessageOverrides.Add(t.Name, t); + else if (t.IsSubclassOf(typeof(StructureTypeDescriptor))) + _StructureOverrides.Add(t.Name, t); + else if (t.IsSubclassOf(typeof(BasicTypeDescriptor))) + _BasicOverrides.Add(t.Name, t); + else + { + System.Diagnostics.Debug.WriteLine("Unhandled override: " + t.Name); + } + } + } + + public static BasicTypeDescriptor AllocateBasicType(string name) + { + Type t; + if (!_BasicOverrides.TryGetValue(name, out t)) + throw new Exception("Unhandled basic type: " + name); + return (BasicTypeDescriptor)Activator.CreateInstance(t); + } + + public static GameMessageDescriptor AllocateGameMessage(string name) + { + Type t; + if (!_GameMessageOverrides.TryGetValue(name, out t)) + return new GameMessageDescriptor(); + return (GameMessageDescriptor)Activator.CreateInstance(t); + } + + public static StructureTypeDescriptor AllocateStructure(string name) + { + Type t; + if (!_StructureOverrides.TryGetValue(name, out t)) + return new StructureTypeDescriptor(); + return (StructureTypeDescriptor)Activator.CreateInstance(t); + } + + public static TypeDescriptor[] LoadXml(XElement root, out int protocolHash) + { + protocolHash = root.IntAttribute("ProtocolHash"); + + Dictionary types = new Dictionary(); + foreach (var e in root.Elements()) + { + string name = e.Attribute("Name").Value; + TypeDescriptor desc; + if (e.Name == "StructureDescriptor") + desc = AllocateStructure(name); + else if (e.Name == "GameMessageDescriptor") + desc = AllocateGameMessage(name); + else if (e.Name == "BasicDescriptor") + desc = AllocateBasicType(name); + else + throw new Exception("Unhandled xml element: " + e.Name); + + desc.LoadXml(e); + types.Add(desc.Index, desc); + } + + foreach (var e in root.Elements()) + { + var t = types[e.IntAttribute("Index")]; + int n = 0; + var fields = e.Elements().Select(x => new FieldDescriptor(x, n++, types)).ToArray(); + if (fields.Length > 0) + t.LoadFields(fields); + } + return types.Values.ToArray(); + } + + + static void ExploreType(StructureTypeDescriptor structure, HashSet explored) + { + var fields = structure.Fields; + + foreach (var f in fields) + { + if (f.Type != null && f.Type.IsStructure && explored.Add(f.Type)) + ExploreType((StructureTypeDescriptor)f.Type, explored); + if (f.SubType != null && f.SubType.IsStructure && explored.Add(f.SubType)) + ExploreType((StructureTypeDescriptor)f.SubType, explored); + } + } + + public static TypeDescriptor[] FilterGameMessageStructures(TypeDescriptor[] types) + { + HashSet explored = new HashSet(); + + List list = new List(); + foreach (var t in types) + { + if(t.IsGameMessage && explored.Add(t)) + ExploreType((StructureTypeDescriptor)t, explored); + } + return explored.ToArray(); + } + + + public virtual void LoadXml(XElement e) + { + Index = e.IntAttribute("Index"); + Name = e.Attribute("Name").Value; + UnkValue = e.OptionalIntAttribute("UnkValue"); + } + public virtual void LoadFields(FieldDescriptor[] fields) { throw new Exception("This type doesnt handle fields."); } + + public virtual XElement ToXml() + { + XElement e = new XElement("TypeDescriptor"); + e.Add(new XAttribute("Index", Index)); + e.Add(new XAttribute("Name", Name)); + if(UnkValue != 0) + e.Add(new XAttribute("UnkValue", UnkValue)); + return e; + } + + public virtual void GenerateClass(StringBuilder b, int pad) + { + throw new NotImplementedException(); + } + + public virtual void GenerateField(StringBuilder b, int pad, FieldDescriptor f) { throw new NotImplementedException(); } + public virtual void GenerateParseBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) { throw new NotImplementedException(); } + public virtual void GenerateEncodeBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) { throw new NotImplementedException(); } + + public virtual void GenerateOptionalField(StringBuilder b, int pad, FieldDescriptor f) { throw new NotImplementedException(); } + public virtual void GenerateOptionalParseBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) { throw new NotImplementedException(); } + public virtual void GenerateOptionalEncodeBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) { throw new NotImplementedException(); } + + public virtual void GenerateFixedArrayField(StringBuilder b, int pad, FieldDescriptor f) { throw new NotImplementedException(); } + public virtual void GenerateFixedArrayParseBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) { throw new NotImplementedException(); } + public virtual void GenerateFixedArrayEncodeBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) { throw new NotImplementedException(); } + + } + +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDump/D3TypeDump.csproj b/src/tools/GameServer/TypeExtractor/D3TypeDump/D3TypeDump.csproj new file mode 100644 index 00000000..3a1eb13b --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDump/D3TypeDump.csproj @@ -0,0 +1,72 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {940EE21E-198E-4FFC-A0C0-55F3317CF20D} + Exe + Properties + D3TypeDump + D3TypeDump + v4.0 + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + {F4367152-8294-4CF1-A984-3CD7B58DDEAD} + D3TypeDescriptor + + + + + + \ No newline at end of file diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDump/Mem32.cs b/src/tools/GameServer/TypeExtractor/D3TypeDump/Mem32.cs new file mode 100644 index 00000000..74f6fdd2 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDump/Mem32.cs @@ -0,0 +1,144 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + using System; + using System.Text; +using System.Runtime.InteropServices; +using System.Diagnostics; + +namespace D3TypeDump +{ + class MemAddress32 + { + public Mem32 Memory; + public int Offset; + + public MemAddress32(Mem32 mem, int offset) { Memory = mem; Offset = offset; } + + public MemAddress32 this[int offset] { get { return new MemAddress32(Memory, Offset + offset); } } + + public byte Byte { get { return Memory.ReadByte(Offset); } } + public ushort UInt16 { get { return Memory.ReadUInt16(Offset); } } + public float Float { get { return Memory.ReadFloat(Offset); } } + public int Int32 { get { return Memory.ReadInt32(Offset); } } + public uint UInt32 { get { return (uint)Memory.ReadInt32(Offset); } } + public MemAddress32 Ptr { get { return new MemAddress32(Memory, Memory.ReadInt32(Offset)); } } + public string CStringPtr { get { return Memory.ReadCString(Memory.ReadInt32(Offset)); } } + public string CString { get { return Memory.ReadCString(Offset); } } + } + + class Mem32 : IDisposable + { + [DllImport("kernel32.dll", ExactSpelling = true)] + static extern IntPtr OpenProcess(int dwDesiredAccess, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle, int dwProcessId); + + [DllImport("kernel32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool CloseHandle(IntPtr hObject); + + [DllImport("kernel32.dll", SetLastError = true)] + static extern bool WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, byte[] lpBuffer, uint nSize, IntPtr lpNumberOfBytesWritten); + + [DllImport("kernel32.dll", SetLastError = true)] + static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, [Out] byte[] lpBuffer, int dwSize, IntPtr lpNumberOfBytesRead); + + [DllImport("kernel32.dll", SetLastError = true)] + static extern bool ReadProcessMemory(IntPtr hProcess, int lpBaseAddress, out int lpBuffer, int dwSize, IntPtr lpNumberOfBytesRead); + + [DllImport("kernel32.dll", SetLastError = true)] + static extern bool ReadProcessMemory(IntPtr hProcess, int lpBaseAddress, out float lpBuffer, int dwSize, IntPtr lpNumberOfBytesRead); + + [DllImport("kernel32.dll", SetLastError = true)] + static extern bool ReadProcessMemory(IntPtr hProcess, int lpBaseAddress, out ushort lpBuffer, int dwSize, IntPtr lpNumberOfBytesRead); + [DllImport("kernel32.dll", SetLastError = true)] + static extern bool ReadProcessMemory(IntPtr hProcess, int lpBaseAddress, out byte lpBuffer, int dwSize, IntPtr lpNumberOfBytesRead); + + const int ProcessFlags_All = 0x001F0FFF; + + IntPtr _handle; + + public Mem32(Process proc) + { + _handle = OpenProcess(ProcessFlags_All, false, proc.Id); + if (_handle == IntPtr.Zero) + throw new Exception("Failed to open process."); + } + + public MemAddress32 this[int offset] { get { return new MemAddress32(this, offset); } } + + public byte ReadByte(int offset) + { + byte result = 0; + ReadProcessMemory(_handle, offset, out result, 1, IntPtr.Zero); + return result; + } + public ushort ReadUInt16(int offset) + { + ushort result = 0; + ReadProcessMemory(_handle, offset, out result, 2, IntPtr.Zero); + return result; + } + public int ReadInt32(int offset) + { + int result = 0; + ReadProcessMemory(_handle, offset, out result, 4, IntPtr.Zero); + return result; + } + + public float ReadFloat(int offset) + { + float result = 0; + ReadProcessMemory(_handle, offset, out result, 4, IntPtr.Zero); + return result; + } + + static Encoding IBM437 = Encoding.GetEncoding(437); + public string ReadCString(int offset) + { + byte result = 0; + byte[] buffer = new byte[256]; + int count = 0; + + for (; ; ) + { + ReadProcessMemory(_handle, offset++, out result, 1, IntPtr.Zero); + if (result == 0) + break; + if (count == buffer.Length) + Array.Resize(ref buffer, buffer.Length + 256); + buffer[count++] = result; + } + return IBM437.GetString(buffer, 0, count); + } + + ~Mem32() + { + if (_handle != IntPtr.Zero) + CloseHandle(_handle); + } + + public void Dispose() + { + if (_handle != IntPtr.Zero) + { + CloseHandle(_handle); + System.GC.SuppressFinalize(this); + } + } + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDump/Program.cs b/src/tools/GameServer/TypeExtractor/D3TypeDump/Program.cs new file mode 100644 index 00000000..1866a172 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDump/Program.cs @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + using System; + +namespace D3TypeDump +{ + class Program + { + static void Main(string[] args) + { + System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture; + TypeDump.DumpDescriptors(); + + Console.WriteLine("done"); + Console.ReadLine(); + } + } +} diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDump/Properties/AssemblyInfo.cs b/src/tools/GameServer/TypeExtractor/D3TypeDump/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..856dba44 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDump/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("D3GameMessageDump")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("D3GameMessageDump")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("86542f06-9697-4e54-9328-1217b88fbf46")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/tools/GameServer/TypeExtractor/D3TypeDump/TypeDump.cs b/src/tools/GameServer/TypeExtractor/D3TypeDump/TypeDump.cs new file mode 100644 index 00000000..6d3fce55 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDump/TypeDump.cs @@ -0,0 +1,475 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using D3TypeDescriptor; +using System.Diagnostics; +using System.Xml.Linq; + +namespace D3TypeDump +{ + class TypeDump + { + const int HashAddress = 0x01318A30; + const int HashOffset = 0x24; + + #region BETA + #region build 7447 addresses + //const int OpcodeSwitch_Address = 0x008C22F0; + //const int TypeDescriptorsAddress = 0x157F5CC; + //const int TypeDescriptorsOffset = 40; + //const int AttributesAddress = 0x01372420; + //const int AttributeCount = 717; + //const int Attribute_Int = 0x011A55D4; + //const int Attribute_IntMinMax = 0x011A55DC; + //const int Attribute_FloatMinMax = 0x011A55E4; + //const int Attribute_Float16 = 0x011A55EC; + //const int Attribute_Float16Or32 = 0x011A55F4; + #endregion + + #region build 7728 addresses + //const int OpcodeSwitch_Address = 0x008C22F0; + //const int TypeDescriptorsAddress = 0x157F5CC; + //const int TypeDescriptorsOffset = 40; + //const int AttributesAddress = 0x01372420; + //const int AttributeCount = 717; + //const int Attribute_Int = 0x011A55D4; + //const int Attribute_IntMinMax = 0x011A55DC; + //const int Attribute_FloatMinMax = 0x011A55E4; + //const int Attribute_Float16 = 0x011A55EC; + //const int Attribute_Float16Or32 = 0x011A55F4; + #endregion + + #region build 7841 addresses + //const int OpcodeSwitch_Address = 0x008C4260; + //const int TypeDescriptorsAddress = 0x15C9008; + //const int TypeDescriptorsOffset = 40; + //const int AttributesAddress = 0x013AC420; + //const int AttributeCount = 728; + //const int Attribute_Int = 0x11D4C5C; + //const int Attribute_IntMinMax = 0x011D4C64; + //const int Attribute_FloatMinMax = 0x011D4C6C; + //const int Attribute_Float16 = 0x011D4C74; + //const int Attribute_Float16Or32 = 0x011D4C7C; + #endregion + + #region build 8101 addresses + //const int OpcodeSwitch_Address = 0x008C61F0; //D3 .text + + //const int TypeDescriptorsAddress = 0x016259F8; //D3 .data + //const int TypeDescriptorsOffset = 40; + + //const int AttributesAddress = 0x013E73B0; //D3 .data + //const int AttributeCount = 769; + //const int Attribute_Int = 0x12054EC; //D3 .rdata + //const int Attribute_IntMinMax = 0x12054F4; //D3 .rdata + //const int Attribute_FloatMinMax = 0x12054FC; //D3 .rdata + //const int Attribute_Float16 = 0x1205504; //D3 .rdata + //const int Attribute_Float16Or32 = 0x120550C; //D3 .rdata + #endregion + + #region build 8296 addresses + //const int OpcodeSwitch_Address = 0x008C05B0; //D3 .text + + //const int TypeDescriptorsAddress = 0x01435E7C; //D3 .data + //const int TypeDescriptorsOffset = 40; + + //const int AttributesAddress = 0x0141D338; //D3 .data + //const int AttributeCount = 784; + //const int Attribute_Int = 0X122FF0C; //D3 .rdata + //const int Attribute_IntMinMax = 0X122FF14; //D3 .rdata + //const int Attribute_FloatMinMax = 0X122FF1C; //D3 .rdata + //const int Attribute_Float16 = 0X122FF24; //D3 .rdata + //const int Attribute_Float16Or32 = 0X122FF2C; //D3 .rdata + #endregion + + #region build 8610 addresses + //const int OpcodeSwitch_Address = 0x008BEA00; + + //const int TypeDescriptorsAddress = 0x016BAF60; + //const int TypeDescriptorsOffset = 40; + + //const int AttributesAddress = 0x01482338; + //const int AttributeCount = 819; + //const int Attribute_Int = 0X1288354; + //const int Attribute_IntMinMax = 0X128835C; + //const int Attribute_FloatMinMax = 0X1288364; + //const int Attribute_Float16 = 0X128836C; + //const int Attribute_Float16Or32 = 0X1288374; + #endregion + + #region build 8815 addresses + //const int OpcodeSwitch_Address = 0x008C1350; + //const int TypeDescriptorsAddress = 0x016EFEB0; + //const int TypeDescriptorsOffset = 40; + //const int AttributesAddress = 0x14A3340; + //const int AttributeCount = 823; + //const int Attribute_Int = 0X12A2BD4; + //const int Attribute_IntMinMax = 0X12A2BDC; + //const int Attribute_FloatMinMax = 0X12A2BE4; + //const int Attribute_Float16 = 0X12A2BEC; + //const int Attribute_Float16Or32 = 0X12A2BF4; + #endregion + + #region build 8896 addresses + //const int OpcodeSwitch_Address = 0x008C0A10; + //const int TypeDescriptorsAddress = 0x014E561C; + //const int TypeDescriptorsOffset = 40; + //const int AttributesAddress = 0x14C95A8; + //const int AttributeCount = 823; + //const int Attribute_Int = 0X12C3004; + //const int Attribute_IntMinMax = 0X12C300C; + //const int Attribute_FloatMinMax = 0X12C3014; + //const int Attribute_Float16 = 0X12C301C; + //const int Attribute_Float16Or32 = 0X12C3024; + #endregion + + #region build 9183 addresses + //const int OpcodeSwitch_Address = 0x008C0770; + //const int TypeDescriptorsAddress = 0x0151628C; + //const int TypeDescriptorsOffset = 40; + //const int AttributesAddress = 0x014FA3D0; + //const int AttributeCount = 823; + //const int Attribute_Int = 0x012ED0C4; + //const int Attribute_IntMinMax = 0x012ED0CC; + //const int Attribute_FloatMinMax = 0x012ED0D4; + //const int Attribute_Float16 = 0x012ED0DC; + //const int Attribute_Float16Or32 = 0x012ED0E4; + #endregion + + #region build 9327 addresses + //const int OpcodeSwitch_Address = 0x008C0B00; + //const int TypeDescriptorsAddress = 0x0151828C; + //const int TypeDescriptorsOffset = 40; + //const int AttributesAddress = 0x014FC3D0; + //const int AttributeCount = 823; + //const int Attribute_Int = 0x012EF0F4; + //const int Attribute_IntMinMax = 0x012EF0FC; + //const int Attribute_FloatMinMax = 0x012EF104; + //const int Attribute_Float16 = 0x012EF10C; + //const int Attribute_Float16Or32 = 0x012EF114; + #endregion + #endregion + // TODO: Add patterns + + #region build 9558 addresses + //const int OpcodeSwitch_Address = 0x008E4F10; + //const int TypeDescriptorsAddress = 0x01565EAC; + //const int TypeDescriptorsOffset = 40; + //const int AttributesAddress = 0x015494E8; + //const int AttributeCount = 823; + //const int Attribute_Int = 0x01347EC8; + //const int Attribute_IntMinMax = 0x01347ED0; + //const int Attribute_FloatMinMax = 0x01347ED8; + //const int Attribute_Float16 = 0x01347EE0; + //const int Attribute_Float16Or32 = 0x01347EE8; + #endregion + + #region build 9858 addresses + //const int OpcodeSwitch_Address = 0x008E52D0; + //const int TypeDescriptorsAddress = 0x01572FAC; + //const int TypeDescriptorsOffset = 40; + //const int AttributesAddress = 0x015564E8; + //const int AttributeCount = 823; + //const int Attribute_Int = 0x01352058; + //const int Attribute_IntMinMax = 0x01352060; + //const int Attribute_FloatMinMax = 0x01352068; + //const int Attribute_Float16 = 0x01352070; + //const int Attribute_Float16Or32 = 0x01352078; + #endregion + + #region build 9950 addresses + //const int OpcodeSwitch_Address = 0x008E53B0; + //const int TypeDescriptorsAddress = 0x01573FDC; + //const int TypeDescriptorsOffset = 40; + //const int AttributesAddress = 0x01557518; + //const int AttributeCount = 823; + //const int Attribute_Int = 0x01353168; + //const int Attribute_IntMinMax = 0x01353170; + //const int Attribute_FloatMinMax = 0x01353178; + //const int Attribute_Float16 = 0x01353180; + //const int Attribute_Float16Or32 = 0x01353188; + #endregion + + #region build 10057 addresses + const int OpcodeSwitch_Address = 0x008E6240; + const int TypeDescriptorsAddress = 0x0159A19C; + const int TypeDescriptorsOffset = 40; + const int AttributesAddress = 0x0157D518; + const int AttributeCount = 826; + const int Attribute_Int = 0x01373660; + const int Attribute_IntMinMax = 0x01373668; + const int Attribute_FloatMinMax = 0x01373670; + const int Attribute_Float16 = 0x01373678; + const int Attribute_Float16Or32 = 0x01373680; + #endregion + + class GameMessageInfo + { + public int Offset; + public int Size; + public List Opcodes = new List(); + } + + static Dictionary _gameMessageLookUp; + + static void GetMessageOpcodes(Mem32 m) + { + _gameMessageLookUp = new Dictionary(); + + var func = m[OpcodeSwitch_Address]; + int maxOpcode = func[0x1B].Int32 + 1; + int jaOffset = func[0x21].Int32; + int defaultCase = func.Offset + 0x25 + jaOffset; + var switchTable = func[0x28].Ptr; + for (int i = 0; i < maxOpcode; i++) + { + int caseOffset = switchTable[i * 4].Int32; + if (caseOffset == defaultCase) + continue; + + int offTypeDescriptor = m[caseOffset + 2].Ptr.Int32; + int size = m[caseOffset + 13].Int32; + int opcode = i + 1; + + GameMessageInfo gmi; + if (_gameMessageLookUp.TryGetValue(offTypeDescriptor, out gmi)) + { + if (gmi.Size != size) + throw new Exception("Size mismatch."); + } + else + { + gmi = new GameMessageInfo(); + gmi.Offset = offTypeDescriptor; + gmi.Size = size; + _gameMessageLookUp.Add(offTypeDescriptor, gmi); + } + gmi.Opcodes.Add(opcode); + } + + } + #region Dump + static TypeDescriptor DiscoverMessageDescriptors(Mem32 mem, Dictionary table, int offset) + { + if (offset == 0) + return null; + string name = mem[offset + 4].CStringPtr; + int unkValue = mem[offset + 8].Int32; + var fields = mem[offset + 12].Ptr; + + if (fields.Offset == 0) + { + var basicType = TypeDescriptor.AllocateBasicType(name); + basicType.Name = name; + basicType.UnkValue = unkValue; + table.Add(offset, basicType); + return basicType; + } + + StructureTypeDescriptor typeDesc; + + GameMessageInfo gmi; + + if (_gameMessageLookUp.TryGetValue(offset, out gmi)) + { + var gm = TypeDescriptor.AllocateGameMessage(name); + gm.Size = gmi.Size; + gm.NetworkIds = gmi.Opcodes.ToArray(); + typeDesc = gm; + } + else + typeDesc = TypeDescriptor.AllocateStructure(name); + typeDesc.Name = name; + typeDesc.UnkValue = unkValue; + + table.Add(offset, typeDesc); + + List list = new List(); + for (; ; ) + { + FieldDescriptor f = new FieldDescriptor(); + f.Name = fields.CStringPtr; + int type = fields[4].Int32; + if (mem[type + 4].CStringPtr != "DT_NULL" && !table.TryGetValue(type, out f.Type)) + f.Type = DiscoverMessageDescriptors(mem, table, type); + f.Offset = fields[8].Int32; + var defaultValuePtr = fields[12].Ptr; + f.Min = fields[0x10].Int32; + f.Max = fields[0x14].Int32; + f.Flags = fields[0x18].Int32; + type = fields[0x1C].Int32; + if (mem[type + 4].CStringPtr != "DT_NULL" && !table.TryGetValue(type, out f.SubType)) + f.SubType = DiscoverMessageDescriptors(mem, table, type); + f.VariableOffset = fields[0x20].Int32; + f.ArrayLength = fields[0x24].Int32; + f.ArrayLengthOffset = fields[0x28].Int32; + f.EncodedBits = fields[0x2C].UInt16; + f.EncodedBits2 = fields[0x2E].UInt16; + f.SnoType = fields[0x30].Int32; + f.TagMapRelated = fields[0x34].Int32; + var enumFields = fields[0x38].Ptr; + if (enumFields.Offset != 0) + { + List> enums = new List>(); + for (; ; ) + { + if (enumFields[4].Int32 == 0) + break; + enums.Add(new Tuple(enumFields[4].CStringPtr, enumFields.Int32)); + enumFields = enumFields[8]; + } + f.EnumFields = enums.ToArray(); + } + f.FlagIndex = fields[0x3C].Int32; + int funcA = fields[0x40].Int32; // TODO + int funcB = fields[0x44].Int32; // TODO + f.DspIndex = fields[0x48].Int32; + + var str = fields[0x4C].CString; + // 0x4C 64 bytes, unused string + //if (str != string.Empty) Console.WriteLine(str); + + list.Add(f); + if (fields.Int32 == 0) + break; + fields = fields[140]; + + } + + + typeDesc.Fields = list.ToArray(); + return typeDesc; + } + + + static TypeDescriptor[] GetAllDescriptors(Mem32 mem) + { + Dictionary table = new Dictionary(); + var link = mem[TypeDescriptorsAddress].Ptr; + int count = 0; + while (link.Int32 != 0) + { + if (table.ContainsKey(link.Offset) == false) + { + var desc = DiscoverMessageDescriptors(mem, table, link.Offset); + } + count++; + link = link[TypeDescriptorsOffset].Ptr; + } + + var result = table.Values.ToArray(); + for (int i = 0; i < result.Length; i++) + result[i].Index = i; + return result; + + } + + static void DumpAttributes(Mem32 mem) + { + // could get the max num from descriptor + var attribList = mem[AttributesAddress]; + NetAttribute.Attributes = new NetAttribute[AttributeCount]; + for (int i = 0; i < AttributeCount; i++) + { + var attrib = attribList[i * 40]; + + int id = attrib.Int32; + int u2 = attrib[4].Int32; + int u3 = attrib[8].Int32; + int u4 = attrib[12].Int32; + int u5 = attrib[16].Int32; + + string scriptA = attrib[20].CStringPtr; + string scriptB = attrib[24].CStringPtr; + string name = attrib[28].CStringPtr; + var decoder = attrib[32].Ptr; + byte u10 = attrib[36].Byte; + switch (decoder.Int32) + { + case Attribute_Int: + { + int bitCount = decoder[12].Int32; + if (u5 == 1) + NetAttribute.Attributes[id] = new NetAttribute(id, u2, u3, u4, u5, scriptA, scriptB, name, NetAttributeEncoding.Int, u10, 0, 0, bitCount); + else + NetAttribute.Attributes[id] = new NetAttribute(id, u2, u3, u4, u5, scriptA, scriptB, name, NetAttributeEncoding.Float32, u10, 0, 0, bitCount); + break; + } + case Attribute_IntMinMax: + { + int bitCount = decoder[20].Int32; + int min = decoder[12].Int32; + int max = decoder[16].Int32; + NetAttribute.Attributes[id] = new NetAttribute(id, u2, u3, u4, u5, scriptA, scriptB, name, NetAttributeEncoding.IntMinMax, u10, min, max, bitCount); + break; + } + case Attribute_Float16: // Decode16BitFloat(bits) + { + int bitCount = decoder[12].Int32; + NetAttribute.Attributes[id] = new NetAttribute(id, u2, u3, u4, u5, scriptA, scriptB, name, NetAttributeEncoding.Float16, u10, 0, 0, bitCount); + } + break; + case Attribute_Float16Or32: + { + NetAttribute.Attributes[id] = new NetAttribute(id, u2, u3, u4, u5, scriptA, scriptB, name, NetAttributeEncoding.Float16Or32, u10, 0, 0, 0); + } + break; + case Attribute_FloatMinMax: // DecodeFloatMinMax + throw new Exception("FloatMinMax used"); + default: + throw new Exception("Unknown decoder used"); + } + } + NetAttribute.SaveXml("attributes.xml"); + } + + public static void DumpDescriptors() + { + foreach (var p in Process.GetProcesses()) + { + if (p.ProcessName == "Diablo III") + { + Mem32 m = new Mem32(p); + GetMessageOpcodes(m); + DumpAttributes(m); + + XDocument doc = new XDocument(); + XElement root = new XElement("TypeDescriptors"); + int hash = m[HashAddress].Ptr[HashOffset].Int32; + root.Add(new XAttribute("ProtocolHash", hash)); + + foreach (var desc in GetAllDescriptors(m)) + { + root.Add(desc.ToXml()); + } + doc.Add(root); + + doc.Save("typedescriptors.xml"); + + m.Dispose(); + return; + } + } + Console.WriteLine("Was unable to find any 'Diablo III' process."); + } + #endregion + } +} \ No newline at end of file diff --git a/src/tools/GameServer/TypeExtractor/attributes-output.cs b/src/tools/GameServer/TypeExtractor/attributes-output.cs new file mode 100644 index 00000000..9a6f7afe --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/attributes-output.cs @@ -0,0 +1,830 @@ +public partial class GameAttribute +{ + +public static readonly GameAttributeF Axe_Bad_Data = new GameAttributeF(0, 0, -1, 0, 0, "", "", "Axe_Bad_Data", GameAttributeEncoding.Float32, 0, 0, 0, 32); +public static readonly GameAttributeI Attribute_Timer = new GameAttributeI(1, 0, 5, 0, 1, "", "", "Attribute_Timer", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Attribute_Pool = new GameAttributeI(2, 0, -1, 0, 1, "", "", "Attribute_Pool", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeI Death_Count = new GameAttributeI(3, 0, -1, 0, 1, "", "", "Death_Count", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeI DualWield_Hand = new GameAttributeI(4, 0, -1, 0, 1, "", "", "DualWield_Hand", GameAttributeEncoding.IntMinMax, 1, 0, 2, 2); +public static readonly GameAttributeI DualWield_Hand_Next = new GameAttributeI(5, 0, -1, 0, 1, "", "", "DualWield_Hand_Next", GameAttributeEncoding.IntMinMax, 1, 0, 2, 2); +public static readonly GameAttributeB DualWield_Hands_Swapped = new GameAttributeB(6, 0, -1, 0, 1, "", "", "DualWield_Hands_Swapped", GameAttributeEncoding.IntMinMax, 1, 0, 1, 1); +public static readonly GameAttributeI Respawn_Game_Time = new GameAttributeI(7, 0, -1, 0, 1, "", "", "Respawn_Game_Time", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeI Backpack_Slots = new GameAttributeI(8, 0, -1, 0, 1, "", "", "Backpack_Slots", GameAttributeEncoding.IntMinMax, 1, 0, 128, 8); +public static readonly GameAttributeI Shared_Stash_Slots = new GameAttributeI(9, 0, -1, 0, 1, "", "", "Shared_Stash_Slots", GameAttributeEncoding.IntMinMax, 1, 0, 210, 8); +public static readonly GameAttributeF Strength = new GameAttributeF(10, 0, -1, 0, 0, "", "", "Strength", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Dexterity = new GameAttributeF(11, 0, -1, 0, 0, "", "", "Dexterity", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Intelligence = new GameAttributeF(12, 0, -1, 0, 0, "", "", "Intelligence", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Vitality = new GameAttributeF(13, 0, -1, 0, 0, "", "", "Vitality", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Strength_Total = new GameAttributeF(14, 0, -1, 0, 0, "", "((Strength + Stats_All_Bonus + Strength_Bonus + (Strength_Item * Core_Attributes_From_Item_Bonus_Multiplier)) * (1 + Strength_Bonus_Percent)) * (1 - Strength_Reduction_Percent)", "Strength_Total", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Dexterity_Total = new GameAttributeF(15, 0, -1, 0, 0, "", "((Dexterity + Stats_All_Bonus + Dexterity_Bonus + (Dexterity_Item * Core_Attributes_From_Item_Bonus_Multiplier)) * (1 + Dexterity_Bonus_Percent)) * (1 - Dexterity_Reduction_Percent)", "Dexterity_Total", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Intelligence_Total = new GameAttributeF(16, 0, -1, 0, 0, "", "((Intelligence + Stats_All_Bonus + Intelligence_Bonus + (Intelligence_Item * Core_Attributes_From_Item_Bonus_Multiplier)) * (1 + Intelligence_Bonus_Percent)) * (1 - Intelligence_Reduction_Percent)", "Intelligence_Total", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Vitality_Total = new GameAttributeF(17, 0, -1, 0, 0, "", "((Vitality + Stats_All_Bonus + Vitality_Bonus + (Vitality_Item * Core_Attributes_From_Item_Bonus_Multiplier)) * (1 + Vitality_Bonus_Percent)) * (1 - Vitality_Reduction_Percent)", "Vitality_Total", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Strength_Bonus = new GameAttributeF(18, 0, -1, 0, 0, "", "", "Strength_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Dexterity_Bonus = new GameAttributeF(19, 0, -1, 0, 0, "", "", "Dexterity_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Intelligence_Bonus = new GameAttributeF(20, 0, -1, 0, 0, "", "", "Intelligence_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Vitality_Bonus = new GameAttributeF(21, 0, -1, 0, 0, "", "", "Vitality_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Strength_Bonus_Percent = new GameAttributeF(22, 0, -1, 0, 0, "", "", "Strength_Bonus_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Dexterity_Bonus_Percent = new GameAttributeF(23, 0, -1, 0, 0, "", "", "Dexterity_Bonus_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Intelligence_Bonus_Percent = new GameAttributeF(24, 0, -1, 0, 0, "", "", "Intelligence_Bonus_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Vitality_Bonus_Percent = new GameAttributeF(25, 0, -1, 0, 0, "", "", "Vitality_Bonus_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Strength_Reduction_Percent = new GameAttributeF(26, 0, -1, 1, 0, "", "", "Strength_Reduction_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Dexterity_Reduction_Percent = new GameAttributeF(27, 0, -1, 1, 0, "", "", "Dexterity_Reduction_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Intelligence_Reduction_Percent = new GameAttributeF(28, 0, -1, 1, 0, "", "", "Intelligence_Reduction_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Vitality_Reduction_Percent = new GameAttributeF(29, 0, -1, 1, 0, "", "", "Vitality_Reduction_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeI Primary_Damage_Attribute = new GameAttributeI(30, -1, -1, 3, 1, "", "", "Primary_Damage_Attribute", GameAttributeEncoding.IntMinMax, 31, -1, 3, 3); +public static readonly GameAttributeF Attack = new GameAttributeF(31, 0, -1, 0, 0, "", "", "Attack", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Precision = new GameAttributeF(32, 0, -1, 0, 0, "", "", "Precision", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Defense = new GameAttributeF(33, 0, -1, 0, 0, "", "", "Defense", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Attack_Total = new GameAttributeF(34, 0, -1, 0, 0, "", "((Attack + Stats_All_Bonus + Attack_Bonus) * (1 + Attack_Bonus_Percent)) * (1 - Attack_Reduction_Percent)", "Attack_Total", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Precision_Total = new GameAttributeF(35, 0, -1, 0, 0, "", "((Precision + Stats_All_Bonus + Precision_Bonus) * (1 + Precision_Bonus_Percent)) * (1 - Precision_Reduction_Percent)", "Precision_Total", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Defense_Total = new GameAttributeF(36, 0, -1, 0, 0, "", "((Defense + Stats_All_Bonus + Defense_Bonus) * (1 + Defense_Bonus_Percent)) * (1 - Defense_Reduction_Percent)", "Defense_Total", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Attack_Bonus = new GameAttributeF(37, 0, -1, 0, 0, "", "", "Attack_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Precision_Bonus = new GameAttributeF(38, 0, -1, 0, 0, "", "", "Precision_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Defense_Bonus = new GameAttributeF(39, 0, -1, 0, 0, "", "", "Defense_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Attack_Bonus_Percent = new GameAttributeF(40, 0, -1, 0, 0, "", "", "Attack_Bonus_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Precision_Bonus_Percent = new GameAttributeF(41, 0, -1, 0, 0, "", "", "Precision_Bonus_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Defense_Bonus_Percent = new GameAttributeF(42, 0, -1, 0, 0, "", "", "Defense_Bonus_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Attack_Reduction_Percent = new GameAttributeF(43, 0, -1, 1, 0, "", "", "Attack_Reduction_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Precision_Reduction_Percent = new GameAttributeF(44, 0, -1, 1, 0, "", "", "Precision_Reduction_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Defense_Reduction_Percent = new GameAttributeF(45, 0, -1, 1, 0, "", "", "Defense_Reduction_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Armor = new GameAttributeF(46, 0, -1, 0, 0, "", "", "Armor", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Armor_Bonus_Percent = new GameAttributeF(47, 0, -1, 0, 0, "", "", "Armor_Bonus_Percent", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Armor_Item = new GameAttributeF(48, 0, -1, 0, 0, "", "0", "Armor_Item", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Armor_Bonus_Item = new GameAttributeF(49, 0, -1, 0, 0, "", "", "Armor_Bonus_Item", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Armor_Item_Percent = new GameAttributeF(50, 0, -1, 0, 0, "", "0", "Armor_Item_Percent", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Armor_Item_SubTotal = new GameAttributeF(51, 0, -1, 0, 0, "FLOOR((Armor_Item + Armor_Bonus_Item) * (Armor_Item_Percent + 1))", "", "Armor_Item_SubTotal", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Armor_Item_Total = new GameAttributeF(52, 0, -1, 0, 0, "(Armor_Item > 0)?(Max(Armor_Item_SubTotal, 1)):Armor_Item_SubTotal", "", "Armor_Item_Total", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Armor_Total = new GameAttributeF(53, 0, -1, 0, 0, "", "FLOOR((Armor + Armor_Item_Total + Strength_Total) * (Armor_Bonus_Percent + 1))", "Armor_Total", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeI Experience_Granted = new GameAttributeI(54, 0, -1, 0, 1, "", "", "Experience_Granted", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeI Experience_Next = new GameAttributeI(55, 0, -1, 0, 1, "", "", "Experience_Next", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeI Gold_Granted = new GameAttributeI(56, 0, -1, 0, 1, "", "", "Gold_Granted", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Gold = new GameAttributeI(57, 0, -1, 0, 1, "", "", "Gold", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeF Gold_Find = new GameAttributeF(58, 0, -1, 0, 0, "", "", "Gold_Find", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeI Level = new GameAttributeI(59, 0, -1, 0, 1, "", "", "Level", GameAttributeEncoding.IntMinMax, 31, -1, 127, 8); +public static readonly GameAttributeI Level_Cap = new GameAttributeI(60, 0, -1, 0, 1, "", "", "Level_Cap", GameAttributeEncoding.IntMinMax, 1, -1, 127, 8); +public static readonly GameAttributeF Magic_Find = new GameAttributeF(61, 0, -1, 0, 0, "", "", "Magic_Find", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeB Magic_And_Gold_Find_Suppressed = new GameAttributeB(62, 0, -1, 1, 1, "", "", "Magic_And_Gold_Find_Suppressed", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeF Treasure_Find = new GameAttributeF(63, 0, 14, 0, 0, "", "", "Treasure_Find", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeI Resource_Cost_Reduction_Amount = new GameAttributeI(64, 0, 10, 0, 1, "", "", "Resource_Cost_Reduction_Amount", GameAttributeEncoding.IntMinMax, 9, -4095, 16383, 15); +public static readonly GameAttributeF Resource_Cost_Reduction_Total = new GameAttributeF(65, 0, 10, 0, 0, "", "Resource_Cost_Reduction_Amount", "Resource_Cost_Reduction_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Resource_Set_Point_Bonus = new GameAttributeF(66, 0, 10, 0, 0, "", "", "Resource_Set_Point_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Faster_Healing_Percent = new GameAttributeF(67, 0, -1, 0, 0, "", "", "Faster_Healing_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Spending_Resource_Heals_Percent = new GameAttributeF(68, 0, 10, 0, 0, "", "", "Spending_Resource_Heals_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Bonus_Healing_Received_Percent = new GameAttributeF(69, 0, -1, 0, 0, "", "", "Bonus_Healing_Received_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Reduced_Healing_Received_Percent = new GameAttributeF(70, 0, -1, 0, 0, "", "", "Reduced_Healing_Received_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Experience_Bonus = new GameAttributeF(71, 0, -1, 0, 0, "", "", "Experience_Bonus", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Experience_Bonus_Percent = new GameAttributeF(72, 0, -1, 0, 0, "", "", "Experience_Bonus_Percent", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Health_Globe_Bonus_Chance = new GameAttributeF(73, 0, -1, 0, 0, "", "", "Health_Globe_Bonus_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Health_Globe_Bonus_Mult_Chance = new GameAttributeF(74, 0, -1, 0, 0, "", "", "Health_Globe_Bonus_Mult_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Health_Globe_Bonus_Health = new GameAttributeF(75, 0, -1, 0, 0, "", "", "Health_Globe_Bonus_Health", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Increased_Health_From_Globes_Percent = new GameAttributeF(76, 0, -1, 0, 0, "", "", "Increased_Health_From_Globes_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Increased_Health_From_Globes_Percent_Total = new GameAttributeF(77, 0, -1, 0, 0, "", "Increased_Health_From_Globes_Percent", "Increased_Health_From_Globes_Percent_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Bonus_Health_Percent_Per_Second_From_Globes = new GameAttributeF(78, 0, -1, 0, 0, "", "", "Bonus_Health_Percent_Per_Second_From_Globes", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Bonus_Health_Percent_Per_Second_From_Globes_Total = new GameAttributeF(79, 0, -1, 0, 0, "", "Bonus_Health_Percent_Per_Second_From_Globes", "Bonus_Health_Percent_Per_Second_From_Globes_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Mana_Gained_From_Globes_Percent = new GameAttributeF(80, 0, -1, 0, 0, "", "", "Mana_Gained_From_Globes_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Mana_Gained_From_Globes = new GameAttributeF(81, 0, -1, 0, 0, "", "", "Mana_Gained_From_Globes", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Resistance = new GameAttributeF(82, 0, 0, 0, 0, "", "", "Resistance", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Resistance_Percent = new GameAttributeF(83, 0, 0, 0, 0, "", "", "Resistance_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Resistance_Total = new GameAttributeF(84, 0, 0, 0, 0, "", "(Resistance + Resistance_All#NONE + Resistance_From_Intelligence#NONE) * ((Resistance_Percent_All#NONE + Resistance_Percent + 1))", "Resistance_Total", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); +public static readonly GameAttributeF Resistance_All = new GameAttributeF(85, 0, -1, 0, 0, "", "", "Resistance_All", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Resistance_Percent_All = new GameAttributeF(86, 0, -1, 0, 0, "", "", "Resistance_Percent_All", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Resistance_From_Intelligence = new GameAttributeF(87, 0, -1, 0, 0, "", "(Intelligence_Total * 0.1)", "Resistance_From_Intelligence", GameAttributeEncoding.Float16, 1, 0, 0, 16); +public static readonly GameAttributeF Class_Damage_Reduction_Percent = new GameAttributeF(88, 0, -1, 0, 0, "", "", "Class_Damage_Reduction_Percent", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); +public static readonly GameAttributeI Skill = new GameAttributeI(89, 0, 4, 0, 1, "", "", "Skill", GameAttributeEncoding.IntMinMax, 9, 0, 4095, 12); +public static readonly GameAttributeI Skill_Total = new GameAttributeI(90, 0, 4, 0, 1, "", "Skill", "Skill_Total", GameAttributeEncoding.IntMinMax, 9, 0, 4095, 12); +public static readonly GameAttributeI TeamID = new GameAttributeI(91, -1, -1, 1, 1, "", "", "TeamID", GameAttributeEncoding.IntMinMax, 31, -1, 23, 5); +public static readonly GameAttributeI Team_Override = new GameAttributeI(92, -1, -1, 1, 1, "", "", "Team_Override", GameAttributeEncoding.IntMinMax, 31, -1, 23, 5); +public static readonly GameAttributeB Invulnerable = new GameAttributeB(93, 0, -1, 1, 1, "", "", "Invulnerable", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Loading = new GameAttributeB(94, 0, -1, 1, 1, "", "", "Loading", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Loading_Player_ACD = new GameAttributeI(95, -1, -1, 3, 1, "", "", "Loading_Player_ACD", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Loading_Power_SNO = new GameAttributeI(96, -1, -1, 3, 1, "", "", "Loading_Power_SNO", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Loading_Anim_Tag = new GameAttributeI(97, -1, -1, 3, 1, "", "", "Loading_Anim_Tag", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeB Loading_NewGame = new GameAttributeB(98, 0, -1, 1, 1, "", "", "Loading_NewGame", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Auto_Porting_To_Save_Point = new GameAttributeB(99, 0, -1, 1, 1, "", "", "Auto_Porting_To_Save_Point", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB No_Damage = new GameAttributeB(100, 0, -1, 1, 1, "", "", "No_Damage", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB No_AutoPickup = new GameAttributeB(101, 0, -1, 1, 1, "", "", "No_AutoPickup", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeF Light_Radius_Percent_Bonus = new GameAttributeF(102, 0, 0, 0, 0, "", "", "Light_Radius_Percent_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Hitpoints_Cur = new GameAttributeF(103, 0, -1, 0, 0, "", "Min(Hitpoints_Cur.Agg, Hitpoints_Max_Total)", "Hitpoints_Cur", GameAttributeEncoding.Float32, 31, 0, 0, 32); +public static readonly GameAttributeF Hitpoints_Factor_Level = new GameAttributeF(104, 0, -1, 0, 0, "", "", "Hitpoints_Factor_Level", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); +public static readonly GameAttributeF Hitpoints_Factor_Vitality = new GameAttributeF(105, 0, -1, 0, 0, "", "", "Hitpoints_Factor_Vitality", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); +public static readonly GameAttributeF Hitpoints_Total_From_Vitality = new GameAttributeF(106, 0, -1, 0, 0, "", "Vitality_Total * Hitpoints_Factor_Vitality", "Hitpoints_Total_From_Vitality", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); +public static readonly GameAttributeF Hitpoints_Total_From_Level = new GameAttributeF(107, 0, -1, 0, 0, "", "(Level - 1) * Hitpoints_Factor_Level", "Hitpoints_Total_From_Level", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); +public static readonly GameAttributeF Hitpoints_Granted = new GameAttributeF(108, 0, -1, 0, 0, "", "", "Hitpoints_Granted", GameAttributeEncoding.Float32, 31, 0, 0, 32); +public static readonly GameAttributeI Hitpoints_Granted_Duration = new GameAttributeI(109, 0, -1, 0, 1, "", "", "Hitpoints_Granted_Duration", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); +public static readonly GameAttributeF Hitpoints_Max = new GameAttributeF(110, 0, -1, 0, 0, "", "", "Hitpoints_Max", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); +public static readonly GameAttributeF Hitpoints_Max_Bonus = new GameAttributeF(111, 0, -1, 0, 0, "", "", "Hitpoints_Max_Bonus", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); +public static readonly GameAttributeF Hitpoints_Max_Total = new GameAttributeF(112, 0, -1, 0, 0, "", "Max((Hitpoints_Max + Hitpoints_Total_From_Level + Hitpoints_Total_From_Vitality + Hitpoints_Max_Bonus) * (Hitpoints_Max_Percent_Bonus + Hitpoints_Max_Percent_Bonus_Item + 1), 1)", "Hitpoints_Max_Total", GameAttributeEncoding.Float32, 31, 0, 0, 32); +public static readonly GameAttributeF Hitpoints_Percent = new GameAttributeF(113, 0, -1, 0, 0, "", "", "Hitpoints_Percent", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeF Hitpoints_Regen_Per_Second = new GameAttributeF(114, 0, -1, 0, 0, "", "", "Hitpoints_Regen_Per_Second", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); +public static readonly GameAttributeF Hitpoints_Max_Percent_Bonus = new GameAttributeF(115, 0, -1, 0, 0, "", "", "Hitpoints_Max_Percent_Bonus", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeF Hitpoints_Max_Percent_Bonus_Item = new GameAttributeF(116, 0, -1, 0, 0, "", "", "Hitpoints_Max_Percent_Bonus_Item", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeF Hitpoints_Healed_Target = new GameAttributeF(117, 0, -1, 0, 0, "", "", "Hitpoints_Healed_Target", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); +public static readonly GameAttributeI Resource_Type_Primary = new GameAttributeI(118, -1, -1, 3, 1, "", "", "Resource_Type_Primary", GameAttributeEncoding.IntMinMax, 1, -1, 7, 4); +public static readonly GameAttributeI Resource_Type_Secondary = new GameAttributeI(119, -1, -1, 3, 1, "", "", "Resource_Type_Secondary", GameAttributeEncoding.IntMinMax, 1, -1, 7, 4); +public static readonly GameAttributeF Resource_Cur = new GameAttributeF(120, 0, 10, 0, 0, "", "Max(Resource_Cur.Agg, 0)", "Resource_Cur", GameAttributeEncoding.Float32, 1, 0, 0, 32); +public static readonly GameAttributeF Resource_Max = new GameAttributeF(121, 0, 10, 0, 0, "", "", "Resource_Max", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); +public static readonly GameAttributeF Resource_Max_Bonus = new GameAttributeF(122, 0, 10, 0, 0, "", "", "Resource_Max_Bonus", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Resource_Max_Total = new GameAttributeF(123, 0, 10, 0, 0, "", "Max((Resource_Max + ((Level#NONE - 1) * Resource_Factor_Level) + Resource_Max_Bonus) * (Resource_Max_Percent_Bonus + 1), 0)", "Resource_Max_Total", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Resource_Factor_Level = new GameAttributeF(124, 0, 10, 0, 0, "", "", "Resource_Factor_Level", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); +public static readonly GameAttributeF Resource_Granted = new GameAttributeF(125, 0, 10, 0, 0, "", "", "Resource_Granted", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeI Resource_Granted_Duration = new GameAttributeI(126, 0, 10, 0, 1, "", "", "Resource_Granted_Duration", GameAttributeEncoding.IntMinMax, 9, 0, 16777215, 24); +public static readonly GameAttributeF Resource_Percent = new GameAttributeF(127, 0, 10, 0, 0, "", "", "Resource_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Resource_Regen_Per_Second = new GameAttributeF(128, 0, 10, 0, 0, "", "", "Resource_Regen_Per_Second", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Resource_Regen_Bonus_Percent = new GameAttributeF(129, 0, 10, 0, 0, "", "", "Resource_Regen_Bonus_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Resource_Regen_Total = new GameAttributeF(130, 0, 10, 0, 0, "", "Resource_Regen_Per_Second * (1 + Resource_Regen_Bonus_Percent) + (Resource_Regen_Percent_Per_Second * Resource_Max_Total)", "Resource_Regen_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Resource_Max_Percent_Bonus = new GameAttributeF(131, 0, 10, 0, 0, "", "Resource_Percent", "Resource_Max_Percent_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Resource_Capacity_Used = new GameAttributeF(132, 0, 10, 0, 0, "", "", "Resource_Capacity_Used", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Resource_Effective_Max = new GameAttributeF(133, 0, 10, 0, 0, "", "Resource_Max_Total - Resource_Capacity_Used", "Resource_Effective_Max", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Resource_Regen_Percent_Per_Second = new GameAttributeF(134, 0, 10, 0, 0, "", "", "Resource_Regen_Percent_Per_Second", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Resource_Degeneration_Stop_Point = new GameAttributeF(135, 0, 10, 0, 0, "", "", "Resource_Degeneration_Stop_Point", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Movement_Scalar = new GameAttributeF(136, 0, -1, 0, 0, "", "", "Movement_Scalar", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Walking_Rate = new GameAttributeF(137, 0, -1, 0, 0, "", "", "Walking_Rate", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Running_Rate = new GameAttributeF(138, 0, -1, 0, 0, "", "", "Running_Rate", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Sprinting_Rate = new GameAttributeF(139, 0, -1, 0, 0, "", "", "Sprinting_Rate", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Strafing_Rate = new GameAttributeF(140, 0, -1, 0, 0, "", "", "Strafing_Rate", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Walking_Rate_Total = new GameAttributeF(141, 0, -1, 0, 0, "", "Walking_Rate * Movement_Scalar_Total", "Walking_Rate_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Running_Rate_Total = new GameAttributeF(142, 0, -1, 0, 0, "", "Running_Rate * Movement_Scalar_Total", "Running_Rate_Total", GameAttributeEncoding.Float16, 41, 0, 0, 16); +public static readonly GameAttributeF Last_Running_Rate = new GameAttributeF(143, 0, -1, 0, 0, "", "", "Last_Running_Rate", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeF Sprinting_Rate_Total = new GameAttributeF(144, 0, -1, 0, 0, "", "Sprinting_Rate * Movement_Scalar_Total", "Sprinting_Rate_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Strafing_Rate_Total = new GameAttributeF(145, 0, -1, 0, 0, "", "Strafing_Rate * Movement_Scalar_Total", "Strafing_Rate_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Movement_Bonus_Total = new GameAttributeF(146, 0, -1, -1, 0, "0", "Movement_Bonus_Run_Speed", "Movement_Bonus_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Movement_Scalar_Subtotal = new GameAttributeF(147, 0, -1, 0, 0, "0", "Max(0.1, Movement_Scalar) * (1 + Movement_Bonus_Total) * (1 - Movement_Scalar_Reduction_Percent * (1 - Min(1, Movement_Scalar_Reduction_Resistance)))", "Movement_Scalar_Subtotal", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Movement_Scalar_Capped_Total = new GameAttributeF(148, 0, -1, 0, 0, "0", "Min(1.25, Movement_Scalar_Subtotal)", "Movement_Scalar_Capped_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Movement_Scalar_Uncapped_Bonus = new GameAttributeF(149, 0, -1, 0, 0, "", "", "Movement_Scalar_Uncapped_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Movement_Scalar_Total = new GameAttributeF(150, 0, -1, 0, 0, "0", "Movement_Scalar_Capped_Total + Movement_Scalar_Uncapped_Bonus", "Movement_Scalar_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Movement_Bonus_Run_Speed = new GameAttributeF(151, 0, -1, 1, 0, "", "", "Movement_Bonus_Run_Speed", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Casting_Speed = new GameAttributeF(152, 0, -1, 0, 0, "", "", "Casting_Speed", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Casting_Speed_Bonus = new GameAttributeF(153, 0, -1, 0, 0, "", "", "Casting_Speed_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Casting_Speed_Total = new GameAttributeF(154, 0, -1, 0, 0, "", "(Casting_Speed + Casting_Speed_Bonus) * Max(0.1, 1 + Casting_Speed_Percent)", "Casting_Speed_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeB Always_Hits = new GameAttributeB(155, 0, -1, 1, 1, "", "", "Always_Hits", GameAttributeEncoding.IntMinMax, 3, 0, 1, 1); +public static readonly GameAttributeF Hit_Chance = new GameAttributeF(156, 0, -1, 0, 0, "", "", "Hit_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Attacks_Per_Second_Item = new GameAttributeF(157, 0, -1, 0, 0, "", "0", "Attacks_Per_Second_Item", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Attacks_Per_Second_Item_Percent = new GameAttributeF(158, 0, -1, 0, 0, "", "0", "Attacks_Per_Second_Item_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Attacks_Per_Second_Item_Subtotal = new GameAttributeF(159, 0, -1, 0, 0, "Attacks_Per_Second_Item * (1 + Attacks_Per_Second_Item_Percent)", "0", "Attacks_Per_Second_Item_Subtotal", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Attacks_Per_Second_Item_Bonus = new GameAttributeF(160, 0, -1, 0, 0, "", "", "Attacks_Per_Second_Item_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Attacks_Per_Second_Item_Total = new GameAttributeF(161, 0, -1, 0, 0, "(Attacks_Per_Second_Item_Subtotal + Attacks_Per_Second_Item_Bonus)", "", "Attacks_Per_Second_Item_Total", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Attacks_Per_Second = new GameAttributeF(162, 0, -1, 0, 0, "0", "", "Attacks_Per_Second", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Attacks_Per_Second_Bonus = new GameAttributeF(163, 0, -1, 0, 0, "0", "", "Attacks_Per_Second_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Attacks_Per_Second_Total = new GameAttributeF(164, 0, -1, 0, 0, "0", "Max(0.01, (((Attacks_Per_Second_Item_CurrentHand > 0.0) ? Attacks_Per_Second_Item_CurrentHand : Attacks_Per_Second) + Attacks_Per_Second_Bonus + Attacks_Per_Second_Item_Bonus) * Max(0.1, (1 + Attacks_Per_Second_Percent)))", "Attacks_Per_Second_Total", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Attacks_Per_Second_Percent = new GameAttributeF(165, 0, -1, 0, 0, "", "", "Attacks_Per_Second_Percent", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF AI_Cooldown_Reduction_Percent = new GameAttributeF(166, 0, -1, 0, 0, "0", "", "AI_Cooldown_Reduction_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeF Power_Cooldown_Reduction_Percent = new GameAttributeF(167, 0, -1, 0, 0, "0", "", "Power_Cooldown_Reduction_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeF Damage_Delta = new GameAttributeF(168, 0, 0, 0, 0, "", "", "Damage_Delta", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_Delta_Total = new GameAttributeF(169, 0, 0, 0, 0, "", "Max(Damage_Delta - Damage_Bonus_Min + Damage_Weapon_Delta_Total_CurrentHand, 0)", "Damage_Delta_Total", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_Min = new GameAttributeF(170, 0, 0, 0, 0, "", "", "Damage_Min", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_Bonus_Min = new GameAttributeF(171, 0, 0, 0, 0, "", "", "Damage_Bonus_Min", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_Min_Total = new GameAttributeF(172, 0, 0, 0, 0, "", "Damage_Min_Subtotal + Damage_Type_Percent_Bonus * Damage_Min_Subtotal#Physical", "Damage_Min_Total", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_Min_Subtotal = new GameAttributeF(173, 0, 0, 0, 0, "", "Damage_Min + Damage_Bonus_Min + Damage_Weapon_Min_Total_CurrentHand", "Damage_Min_Subtotal", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_Percent_All_From_Skills = new GameAttributeF(174, 0, -1, 0, 0, "", "", "Damage_Percent_All_From_Skills", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Damage_Weapon_Delta = new GameAttributeF(175, 0, 0, 0, 0, "", "", "Damage_Weapon_Delta", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_Weapon_Delta_SubTotal = new GameAttributeF(176, 0, 0, 0, 0, "(Damage_Weapon_Delta > 0.0) ? (Max(1, Damage_Weapon_Delta - Damage_Weapon_Bonus_Min)) : Damage_Weapon_Delta", "", "Damage_Weapon_Delta_SubTotal", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_Weapon_Max = new GameAttributeF(177, 0, 0, 0, 0, "(Damage_Weapon_Min + Damage_Weapon_Delta)", "", "Damage_Weapon_Max", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_Weapon_Max_Total = new GameAttributeF(178, 0, 0, 0, 0, "(Damage_Weapon_Min_Total + Damage_Weapon_Delta_Total)", "", "Damage_Weapon_Max_Total", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_Weapon_Max_Total_All = new GameAttributeF(179, 0, -1, 0, 0, "(Damage_Weapon_Max_Total#Physical + Damage_Weapon_Max_Total#Fire + Damage_Weapon_Max_Total#Cold + Damage_Weapon_Max_Total#Lightning + Damage_Weapon_Max_Total#Poison + Damage_Weapon_Max_Total#Arcane + Damage_Weapon_Max_Total#Holy)", "", "Damage_Weapon_Max_Total_All", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_Weapon_Delta_Total = new GameAttributeF(180, 0, 0, 0, 0, "Max((Damage_Weapon_Delta_SubTotal + Damage_Weapon_Bonus_Delta) * (1 + Damage_Weapon_Percent_Total), 0)", "", "Damage_Weapon_Delta_Total", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Damage_Weapon_Delta_Total_All = new GameAttributeF(181, 0, -1, 0, 0, "(Damage_Weapon_Delta_Total#Physical + Damage_Weapon_Delta_Total#Fire + Damage_Weapon_Delta_Total#Cold + Damage_Weapon_Delta_Total#Lightning + Damage_Weapon_Delta_Total#Poison + Damage_Weapon_Delta_Total#Arcane + Damage_Weapon_Delta_Total#Holy)", "", "Damage_Weapon_Delta_Total_All", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Damage_Weapon_Bonus_Delta = new GameAttributeF(182, 0, 0, 0, 0, "", "", "Damage_Weapon_Bonus_Delta", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_Weapon_Min = new GameAttributeF(183, 0, 0, 0, 0, "", "", "Damage_Weapon_Min", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_Weapon_Min_Total = new GameAttributeF(184, 0, 0, 0, 0, "(Damage_Weapon_Min + Damage_Weapon_Bonus_Min) * (1 + Damage_Weapon_Percent_Total)", "", "Damage_Weapon_Min_Total", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Damage_Weapon_Min_Total_All = new GameAttributeF(185, 0, -1, 0, 0, "(Damage_Weapon_Min_Total#Physical + Damage_Weapon_Min_Total#Fire + Damage_Weapon_Min_Total#Cold + Damage_Weapon_Min_Total#Lightning + Damage_Weapon_Min_Total#Poison + Damage_Weapon_Min_Total#Arcane + Damage_Weapon_Min_Total#Holy)", "", "Damage_Weapon_Min_Total_All", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Damage_Weapon_Bonus_Min = new GameAttributeF(186, 0, 0, 0, 0, "", "", "Damage_Weapon_Bonus_Min", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_Weapon_Percent_Bonus = new GameAttributeF(187, 0, 0, 0, 0, "", "", "Damage_Weapon_Percent_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Damage_Weapon_Percent_All = new GameAttributeF(188, 0, -1, 0, 0, "", "", "Damage_Weapon_Percent_All", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Damage_Weapon_Percent_Total = new GameAttributeF(189, 0, 0, 0, 0, "Damage_Weapon_Percent_Bonus + Damage_Weapon_Percent_All#NONE", "", "Damage_Weapon_Percent_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Damage_Type_Percent_Bonus = new GameAttributeF(190, 0, 0, 0, 0, "", "", "Damage_Type_Percent_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Damage_Percent_Bonus_Witchdoctor = new GameAttributeF(191, 0, -1, 0, 0, "", "", "Damage_Percent_Bonus_Witchdoctor", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Damage_Percent_Bonus_Wizard = new GameAttributeF(192, 0, -1, 0, 0, "", "", "Damage_Percent_Bonus_Wizard", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Crit_Percent_Base = new GameAttributeF(193, 0, -1, 0, 0, "", "", "Crit_Percent_Base", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Crit_Percent_Bonus_Capped = new GameAttributeF(194, 0, -1, 0, 0, "", "", "Crit_Percent_Bonus_Capped", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Crit_Percent_Bonus_Uncapped = new GameAttributeF(195, 0, -1, 0, 0, "", "", "Crit_Percent_Bonus_Uncapped", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Crit_Percent_Cap = new GameAttributeF(196, 0, -1, 0, 0, "", "", "Crit_Percent_Cap", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Crit_Damage_Percent = new GameAttributeF(197, 0, -1, 0, 0, "", "", "Crit_Damage_Percent", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeI Crit_Effect_Time = new GameAttributeI(198, 0, -1, 3, 1, "", "", "Crit_Effect_Time", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeF Pierce_Chance = new GameAttributeF(199, 0, -1, 0, 0, "", "", "Pierce_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Damage_Absorb_Percent = new GameAttributeF(200, 0, -1, 0, 0, "", "", "Damage_Absorb_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Damage_Reduction_Total = new GameAttributeF(201, 0, 0, 0, 0, "", "", "Damage_Reduction_Total", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_Reduction_Current = new GameAttributeF(202, 0, 0, 0, 0, "", "", "Damage_Reduction_Current", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeI Damage_Reduction_Last_Tick = new GameAttributeI(203, 0, 0, 3, 1, "", "", "Damage_Reduction_Last_Tick", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeF Block_Chance = new GameAttributeF(204, 0, -1, 0, 0, "", "", "Block_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Block_Chance_Total = new GameAttributeF(205, 0, -1, 0, 0, "", "Block_Chance + Block_Chance_Item_Total", "Block_Chance_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Block_Chance_Bonus_Item = new GameAttributeF(206, 0, -1, 0, 0, "", "", "Block_Chance_Bonus_Item", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Block_Chance_Item = new GameAttributeF(207, 0, -1, 0, 0, "", "0", "Block_Chance_Item", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Block_Chance_Item_Total = new GameAttributeF(208, 0, -1, 0, 0, "Block_Chance_Item + Block_Chance_Bonus_Item", "", "Block_Chance_Item_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Block_Amount = new GameAttributeF(209, 0, -1, 0, 0, "", "", "Block_Amount", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Block_Amount_Bonus_Percent = new GameAttributeF(210, 0, -1, 0, 0, "", "", "Block_Amount_Bonus_Percent", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Block_Amount_Total_Min = new GameAttributeF(211, 0, -1, 0, 0, "", "(Block_Amount + Block_Amount_Item_Min + Block_Amount_Item_Bonus) * (1 + Block_Amount_Bonus_Percent)", "Block_Amount_Total_Min", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Block_Amount_Total_Max = new GameAttributeF(212, 0, -1, 0, 0, "", "(Block_Amount + Block_Amount_Item_Min + Block_Amount_Item_Delta + Block_Amount_Item_Bonus) * (1 + Block_Amount_Bonus_Percent)", "Block_Amount_Total_Max", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Block_Amount_Item_Min = new GameAttributeF(213, 0, -1, 0, 0, "", "", "Block_Amount_Item_Min", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Block_Amount_Item_Delta = new GameAttributeF(214, 0, -1, 0, 0, "", "", "Block_Amount_Item_Delta", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Block_Amount_Item_Bonus = new GameAttributeF(215, 0, -1, 0, 0, "", "", "Block_Amount_Item_Bonus", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Dodge_Chance_Bonus = new GameAttributeF(216, 0, -1, 7, 0, "", "", "Dodge_Chance_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Dodge_Chance_Bonus_Melee = new GameAttributeF(217, 0, -1, 7, 0, "", "", "Dodge_Chance_Bonus_Melee", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Dodge_Chance_Bonus_Ranged = new GameAttributeF(218, 0, -1, 7, 0, "", "", "Dodge_Chance_Bonus_Ranged", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Get_Hit_Current = new GameAttributeF(219, 0, -1, 0, 0, "", "", "Get_Hit_Current", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); +public static readonly GameAttributeF Get_Hit_Max_Base = new GameAttributeF(220, 0, -1, 0, 0, "", "", "Get_Hit_Max_Base", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); +public static readonly GameAttributeF Get_Hit_Max_Per_Level = new GameAttributeF(221, 0, -1, 0, 0, "", "", "Get_Hit_Max_Per_Level", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); +public static readonly GameAttributeF Get_Hit_Max = new GameAttributeF(222, 0, -1, 0, 0, "", "Get_Hit_Max_Base + (Get_Hit_Max_Per_Level * Level)", "Get_Hit_Max", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); +public static readonly GameAttributeF Get_Hit_Recovery_Base = new GameAttributeF(223, 0, -1, 0, 0, "", "", "Get_Hit_Recovery_Base", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); +public static readonly GameAttributeF Get_Hit_Recovery_Per_Level = new GameAttributeF(224, 0, -1, 0, 0, "", "", "Get_Hit_Recovery_Per_Level", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); +public static readonly GameAttributeF Get_Hit_Recovery = new GameAttributeF(225, 0, -1, 0, 0, "", "Get_Hit_Recovery_Base + (Get_Hit_Recovery_Per_Level * Level)", "Get_Hit_Recovery", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Get_Hit_Damage = new GameAttributeF(226, 0, -1, 0, 0, "", "", "Get_Hit_Damage", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Get_Hit_Damage_Scalar = new GameAttributeF(227, 0, -1, 0, 0, "", "", "Get_Hit_Damage_Scalar", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); +public static readonly GameAttributeI Last_Damage_MainActor = new GameAttributeI(228, -1, -1, 3, 1, "", "", "Last_Damage_MainActor", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeI Last_ACD_Attacked = new GameAttributeI(229, -1, -1, 3, 1, "", "", "Last_ACD_Attacked", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeB Ignores_Critical_Hits = new GameAttributeB(230, 0, -1, 1, 1, "", "", "Ignores_Critical_Hits", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Immunity = new GameAttributeB(231, 0, 0, 1, 1, "", "", "Immunity", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Untargetable = new GameAttributeB(232, 0, -1, 1, 1, "", "", "Untargetable", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Immobolize = new GameAttributeB(233, 0, -1, 1, 1, "", "", "Immobolize", GameAttributeEncoding.IntMinMax, 1, 0, 1, 1); +public static readonly GameAttributeB Immune_To_Knockback = new GameAttributeB(234, 0, -1, 1, 1, "", "", "Immune_To_Knockback", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Power_Immobilize = new GameAttributeB(235, 0, -1, 1, 1, "", "", "Power_Immobilize", GameAttributeEncoding.IntMinMax, 1, 0, 1, 1); +public static readonly GameAttributeF Stun_Chance = new GameAttributeF(236, 0, -1, 0, 0, "", "", "Stun_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Stun_Length = new GameAttributeF(237, 0, -1, 0, 0, "", "", "Stun_Length", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Stun_Recovery = new GameAttributeF(238, 0, -1, 0, 0, "", "", "Stun_Recovery", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Stun_Recovery_Speed = new GameAttributeF(239, 0, -1, 0, 0, "", "", "Stun_Recovery_Speed", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeB Stunned = new GameAttributeB(240, 0, -1, 1, 1, "", "", "Stunned", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Stun_Immune = new GameAttributeB(241, 0, -1, 1, 1, "", "", "Stun_Immune", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeF Poison_Length_Reduction = new GameAttributeF(242, 0, -1, 0, 0, "", "", "Poison_Length_Reduction", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeB Poisoned = new GameAttributeB(243, 0, -1, 1, 1, "", "", "Poisoned", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Bleeding = new GameAttributeB(244, 0, -1, 1, 1, "", "", "Bleeding", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeF Bleed_Duration = new GameAttributeF(245, 0, -1, 0, 0, "", "", "Bleed_Duration", GameAttributeEncoding.Float16, 1, 0, 0, 16); +public static readonly GameAttributeB Chilled = new GameAttributeB(246, 0, -1, 1, 1, "", "", "Chilled", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeF Freeze_Length_Reduction = new GameAttributeF(247, 0, -1, 0, 0, "", "", "Freeze_Length_Reduction", GameAttributeEncoding.Float16, 1, 0, 0, 16); +public static readonly GameAttributeB Freeze_Immune = new GameAttributeB(248, 0, -1, 1, 1, "", "", "Freeze_Immune", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Webbed = new GameAttributeB(249, 0, -1, 1, 1, "", "", "Webbed", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Slow = new GameAttributeB(250, 0, -1, 1, 1, "", "", "Slow", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB FireAura = new GameAttributeB(251, 0, -1, 1, 1, "", "", "FireAura", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB LightningAura = new GameAttributeB(252, 0, -1, 1, 1, "", "", "LightningAura", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB ColdAura = new GameAttributeB(253, 0, -1, 1, 1, "", "", "ColdAura", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB PoisonAura = new GameAttributeB(254, 0, -1, 1, 1, "", "", "PoisonAura", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Blind = new GameAttributeB(255, 0, -1, 1, 1, "", "", "Blind", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Enraged = new GameAttributeB(256, 0, -1, 1, 1, "", "", "Enraged", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Slowdown_Immune = new GameAttributeB(257, 0, -1, 1, 1, "", "", "Slowdown_Immune", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Gethit_Immune = new GameAttributeB(258, 0, -1, 1, 1, "", "", "Gethit_Immune", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeF Suffocation_Per_Second = new GameAttributeF(259, 0, -1, 0, 0, "", "", "Suffocation_Per_Second", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); +public static readonly GameAttributeF Suffocation_Unit_Value = new GameAttributeF(260, 0, -1, 1, 0, "", "", "Suffocation_Unit_Value", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); +public static readonly GameAttributeF Thorns_Percent = new GameAttributeF(261, 0, 0, 0, 0, "", "", "Thorns_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Thorns_Percent_All = new GameAttributeF(262, 0, -1, 0, 0, "", "", "Thorns_Percent_All", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Thorns_Percent_Total = new GameAttributeF(263, 0, 0, 0, 0, "", "Thorns_Percent + Thorns_Percent_All#NONE", "Thorns_Percent_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Thorns_Fixed = new GameAttributeF(264, 0, 0, 0, 0, "", "", "Thorns_Fixed", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Steal_Health_Percent = new GameAttributeF(265, 0, -1, 0, 0, "", "", "Steal_Health_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Steal_Mana_Percent = new GameAttributeF(266, 0, -1, 0, 0, "", "", "Steal_Mana_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Resource_On_Hit = new GameAttributeF(267, 0, 10, 0, 0, "", "", "Resource_On_Hit", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Resource_On_Kill = new GameAttributeF(268, 0, 10, 0, 0, "", "", "Resource_On_Kill", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Resource_On_Crit = new GameAttributeF(269, 0, 10, 0, 0, "", "", "Resource_On_Crit", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Hitpoints_On_Hit = new GameAttributeF(270, 0, -1, 0, 0, "", "", "Hitpoints_On_Hit", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Hitpoints_On_Kill = new GameAttributeF(271, 0, -1, 0, 0, "", "", "Hitpoints_On_Kill", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_To_Mana = new GameAttributeF(272, 0, -1, 0, 0, "", "", "Damage_To_Mana", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeI Last_Proc_Time = new GameAttributeI(273, 0, -1, 3, 1, "", "", "Last_Proc_Time", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeF Damage_Power_Delta = new GameAttributeF(274, 0, 0, 0, 0, "", "", "Damage_Power_Delta", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_Power_Min = new GameAttributeF(275, 0, 0, 0, 0, "", "", "Damage_Power_Min", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeI Rope_Overlay = new GameAttributeI(276, -1, -1, 3, 1, "", "", "Rope_Overlay", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI General_Cooldown = new GameAttributeI(277, -1, -1, 3, 1, "", "", "General_Cooldown", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeI Power_Cooldown = new GameAttributeI(278, -1, 4, 1, 1, "", "", "Power_Cooldown", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeI Power_Cooldown_Start = new GameAttributeI(279, -1, 4, 1, 1, "", "", "Power_Cooldown_Start", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeI Proc_Cooldown = new GameAttributeI(280, 0, -1, 1, 1, "", "", "Proc_Cooldown", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeI Emote_Cooldown = new GameAttributeI(281, 0, -1, 1, 1, "", "", "Emote_Cooldown", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeF Projectile_Speed = new GameAttributeF(282, 0, -1, 0, 0, "", "", "Projectile_Speed", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeF Projectile_Speed_Increase_Percent = new GameAttributeF(283, 0, -1, 0, 0, "", "", "Projectile_Speed_Increase_Percent", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeB Destroy_When_Path_Blocked = new GameAttributeB(284, 0, -1, 1, 1, "", "", "Destroy When Path Blocked", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Skill_Toggled_State = new GameAttributeB(285, 0, 4, 1, 1, "", "", "Skill_Toggled_State", GameAttributeEncoding.IntMinMax, 1, 0, 1, 1); +public static readonly GameAttributeI Act = new GameAttributeI(286, -1, -1, 3, 1, "", "", "Act", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Difficulty = new GameAttributeI(287, -1, -1, 3, 1, "", "", "Difficulty", GameAttributeEncoding.IntMinMax, 9, -1, 4, 3); +public static readonly GameAttributeF Last_Damage_Amount = new GameAttributeF(288, -1, -1, 3, 0, "", "", "Last_Damage_Amount", GameAttributeEncoding.Float16Or32, 0, 0, 0, 0); +public static readonly GameAttributeB In_Knockback = new GameAttributeB(289, 0, -1, 1, 1, "", "", "In_Knockback", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeF Amplify_Damage_Type_Percent = new GameAttributeF(290, 0, 0, 0, 0, "", "", "Amplify_Damage_Type_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeF Amplify_Damage_Percent = new GameAttributeF(291, 0, -1, 0, 0, "", "", "Amplify_Damage_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeI Durability_Cur = new GameAttributeI(292, 0, -1, 0, 1, "", "", "Durability_Cur", GameAttributeEncoding.Int, 8, 0, 0, 32); +public static readonly GameAttributeI Durability_Max = new GameAttributeI(293, 0, -1, 0, 1, "", "", "Durability_Max", GameAttributeEncoding.Int, 8, 0, 0, 32); +public static readonly GameAttributeI Durability_Last_Damage = new GameAttributeI(294, 0, -1, 0, 1, "", "", "Durability_Last_Damage", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Item_Quality_Level = new GameAttributeI(295, -1, -1, 1, 1, "", "", "Item_Quality_Level", GameAttributeEncoding.IntMinMax, 8, -1, 11, 4); +public static readonly GameAttributeF Item_Cost_Percent_Bonus = new GameAttributeF(296, 0, -1, 0, 0, "", "", "Item_Cost_Percent_Bonus", GameAttributeEncoding.Float16, 8, 0, 0, 16); +public static readonly GameAttributeB Item_Equipped = new GameAttributeB(297, 0, -1, 1, 1, "", "", "Item_Equipped", GameAttributeEncoding.IntMinMax, 8, 0, 1, 1); +public static readonly GameAttributeF Requirement = new GameAttributeF(298, 0, 1, 1, 0, "FLOOR(Requirement.Agg * (1 + Requirements_Ease_Percent#NONE))", "", "Requirement", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Requirements_Ease_Percent = new GameAttributeF(299, 0, -1, 0, 0, "", "0", "Requirements_Ease_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Requirement_When_Equipped = new GameAttributeF(300, 0, 1, 1, 0, "", "", "Requirement_When_Equipped", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeI Sockets = new GameAttributeI(301, 0, -1, 0, 1, "", "0", "Sockets", GameAttributeEncoding.IntMinMax, 8, 0, 3, 2); +public static readonly GameAttributeI Sockets_Filled = new GameAttributeI(302, 0, -1, 0, 1, "", "0", "Sockets_Filled", GameAttributeEncoding.IntMinMax, 8, 0, 3, 2); +public static readonly GameAttributeF Stats_All_Bonus = new GameAttributeF(303, 0, -1, 0, 0, "", "", "Stats_All_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeI Item_Bound_To_ACD = new GameAttributeI(304, -1, -1, 3, 1, "", "0", "Item_Bound_To_ACD", GameAttributeEncoding.Int, 8, 0, 0, 32); +public static readonly GameAttributeI Item_Locked_To_ACD = new GameAttributeI(305, -1, -1, 3, 1, "", "0", "Item_Locked_To_ACD", GameAttributeEncoding.Int, 8, 0, 0, 32); +public static readonly GameAttributeI Item_Binding_Level_Override = new GameAttributeI(306, 0, -1, 1, 1, "", "0", "Item_Binding_Level_Override", GameAttributeEncoding.IntMinMax, 8, 0, 5, 3); +public static readonly GameAttributeI ItemStackQuantityHi = new GameAttributeI(307, 0, -1, 4, 1, "", "", "ItemStackQuantityHi", GameAttributeEncoding.Int, 8, 0, 0, 32); +public static readonly GameAttributeI ItemStackQuantityLo = new GameAttributeI(308, 0, -1, 4, 1, "", "", "ItemStackQuantityLo", GameAttributeEncoding.Int, 8, 0, 0, 32); +public static readonly GameAttributeF Run_Speed_Granted = new GameAttributeF(309, 0, -1, 0, 0, "", "", "Run_Speed_Granted", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeI Run_Speed_Duration = new GameAttributeI(310, 0, -1, 0, 1, "", "", "Run_Speed_Duration", GameAttributeEncoding.IntMinMax, 9, 0, 16777215, 24); +public static readonly GameAttributeI IdentifyCost = new GameAttributeI(311, 0, -1, 0, 1, "", "", "IdentifyCost", GameAttributeEncoding.Int, 8, 0, 0, 32); +public static readonly GameAttributeI Seed = new GameAttributeI(312, 0, -1, 4, 1, "", "0", "Seed", GameAttributeEncoding.Int, 8, 0, 0, 32); +public static readonly GameAttributeB IsCrafted = new GameAttributeB(313, 0, -1, 4, 1, "", "0", "IsCrafted", GameAttributeEncoding.IntMinMax, 8, 0, 1, 1); +public static readonly GameAttributeI DyeType = new GameAttributeI(314, 0, -1, 1, 1, "", "0", "DyeType", GameAttributeEncoding.IntMinMax, 8, -1, 30, 5); +public static readonly GameAttributeI EnchantAffix = new GameAttributeI(315, -1, -1, 3, 1, "", "0", "EnchantAffix", GameAttributeEncoding.Int, 8, 0, 0, 32); +public static readonly GameAttributeI EnchantRangeVal = new GameAttributeI(316, 0, -1, 4, 1, "", "0", "EnchantRangeVal", GameAttributeEncoding.IntMinMax, 8, 0, 255, 8); +public static readonly GameAttributeI HighlySalvageable = new GameAttributeI(317, 0, -1, 1, 1, "", "0", "HighlySalvageable", GameAttributeEncoding.Int, 8, 0, 0, 32); +public static readonly GameAttributeI ItemUnlockTimeHi = new GameAttributeI(318, 0, -1, 4, 1, "", "", "ItemUnlockTimeHi", GameAttributeEncoding.Int, 8, 0, 0, 32); +public static readonly GameAttributeI ItemUnlockTimeLo = new GameAttributeI(319, 0, -1, 4, 1, "", "", "ItemUnlockTimeLo", GameAttributeEncoding.Int, 8, 0, 0, 32); +public static readonly GameAttributeB Always_Plays_GetHit = new GameAttributeB(320, 0, -1, 1, 1, "", "", "Always_Plays_GetHit", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Hidden = new GameAttributeB(321, 0, -1, 1, 1, "", "", "Hidden", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI RActor_Fade_Group = new GameAttributeI(322, -1, -1, 1, 1, "", "", "RActor_Fade_Group", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Quest_Range = new GameAttributeI(323, -1, -1, 3, 1, "", "", "Quest Range", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Attack_Cooldown_Min = new GameAttributeI(324, 0, -1, 0, 1, "", "", "Attack_Cooldown_Min", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); +public static readonly GameAttributeI Attack_Cooldown_Delta = new GameAttributeI(325, 0, -1, 0, 1, "", "", "Attack_Cooldown_Delta", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); +public static readonly GameAttributeI InitialCooldownMinTotal = new GameAttributeI(326, 0, -1, 0, 1, "", "InitialCooldownMin / Attacks_Per_Second_Total", "InitialCooldownMinTotal", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); +public static readonly GameAttributeI InitialCooldownDeltaTotal = new GameAttributeI(327, 0, -1, 0, 1, "", "InitialCooldownDelta / Attacks_Per_Second_Total", "InitialCooldownDeltaTotal", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); +public static readonly GameAttributeI Attack_Cooldown_Min_Total = new GameAttributeI(328, 0, -1, 0, 1, "", "Attack_Cooldown_Min / Attacks_Per_Second_Total", "Attack_Cooldown_Min_Total", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); +public static readonly GameAttributeI Attack_Cooldown_Delta_Total = new GameAttributeI(329, 0, -1, 0, 1, "", "Attack_Cooldown_Delta / Attacks_Per_Second_Total", "Attack_Cooldown_Delta_Total", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); +public static readonly GameAttributeI Closing_Cooldown_Min_Total = new GameAttributeI(330, 0, -1, 0, 1, "", "", "Closing_Cooldown_Min_Total", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); +public static readonly GameAttributeI Closing_Cooldown_Delta_Total = new GameAttributeI(331, 0, -1, 0, 1, "", "", "Closing_Cooldown_Delta_Total", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); +public static readonly GameAttributeB Quest_Monster = new GameAttributeB(332, 0, -1, 0, 1, "", "", "Quest_Monster", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Quest_Monster_Effect = new GameAttributeI(333, -1, -1, 3, 1, "", "", "Quest_Monster Effect", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Treasure_Class = new GameAttributeI(334, -1, -1, 3, 1, "", "", "Treasure_Class", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeB Removes_Body_On_Death = new GameAttributeB(335, 0, -1, 1, 1, "", "", "Removes_Body_On_Death", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeI InitialCooldownMin = new GameAttributeI(336, 0, -1, 0, 1, "", "", "InitialCooldownMin", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); +public static readonly GameAttributeI InitialCooldownDelta = new GameAttributeI(337, 0, -1, 0, 1, "", "", "InitialCooldownDelta", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); +public static readonly GameAttributeF Knockback_Weight = new GameAttributeF(338, 0, -1, 0, 0, "", "", "Knockback_Weight", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeB UntargetableByPets = new GameAttributeB(339, 0, -1, 1, 1, "", "", "UntargetableByPets", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeI Damage_State_Current = new GameAttributeI(340, 0, -1, 0, 1, "", "", "Damage_State_Current", GameAttributeEncoding.IntMinMax, 31, 0, 15, 4); +public static readonly GameAttributeI Damage_State_Max = new GameAttributeI(341, 0, -1, 0, 1, "", "", "Damage_State_Max", GameAttributeEncoding.IntMinMax, 31, 0, 15, 4); +public static readonly GameAttributeB Is_Player_Decoy = new GameAttributeB(342, 0, -1, 1, 1, "", "", "Is_Player_Decoy", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeF Custom_Target_Weight = new GameAttributeF(343, 0, 3, 0, 0, "", "", "Custom_Target_Weight", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeI Gizmo_State = new GameAttributeI(344, -1, -1, 3, 1, "", "", "Gizmo_State", GameAttributeEncoding.IntMinMax, 4, -1, 30, 5); +public static readonly GameAttributeI Gizmo_Charges = new GameAttributeI(345, 0, -1, 1, 1, "", "", "Gizmo_Charges", GameAttributeEncoding.IntMinMax, 4, -1, 30, 5); +public static readonly GameAttributeB Chest_Open = new GameAttributeB(346, 0, 3, 0, 1, "", "", "Chest_Open", GameAttributeEncoding.IntMinMax, 4, 0, 1, 1); +public static readonly GameAttributeB Door_Locked = new GameAttributeB(347, 0, -1, 1, 1, "", "", "Door_Locked", GameAttributeEncoding.IntMinMax, 4, 0, 1, 1); +public static readonly GameAttributeI Door_Timer = new GameAttributeI(348, -1, -1, 3, 1, "", "", "Door_Timer", GameAttributeEncoding.Int, 4, 0, 0, 32); +public static readonly GameAttributeB Gizmo_Disabled_By_Script = new GameAttributeB(349, 0, -1, 1, 1, "", "", "Gizmo_Disabled_By_Script", GameAttributeEncoding.IntMinMax, 4, 0, 1, 1); +public static readonly GameAttributeI Gizmo_Operator_ACDID = new GameAttributeI(350, -1, -1, 3, 1, "", "", "Gizmo_Operator_ACDID", GameAttributeEncoding.Int, 4, 0, 0, 32); +public static readonly GameAttributeI Triggering_Count = new GameAttributeI(351, 0, -1, 0, 1, "", "", "Triggering_Count", GameAttributeEncoding.Int, 4, 0, 0, 32); +public static readonly GameAttributeF Gate_Position = new GameAttributeF(352, 0, -1, 0, 0, "", "", "Gate_Position", GameAttributeEncoding.Float16, 4, 0, 0, 16); +public static readonly GameAttributeF Gate_Velocity = new GameAttributeF(353, 0, -1, 0, 0, "", "", "Gate_Velocity", GameAttributeEncoding.Float16, 4, 0, 0, 16); +public static readonly GameAttributeB Gizmo_Has_Been_Operated = new GameAttributeB(354, 0, -1, 1, 1, "", "", "Gizmo_Has_Been_Operated", GameAttributeEncoding.IntMinMax, 4, 0, 1, 1); +public static readonly GameAttributeI Pet_Owner = new GameAttributeI(355, -1, -1, 3, 1, "", "", "Pet_Owner", GameAttributeEncoding.IntMinMax, 31, -1, 8, 4); +public static readonly GameAttributeI Pet_Creator = new GameAttributeI(356, -1, -1, 3, 1, "", "", "Pet_Creator", GameAttributeEncoding.IntMinMax, 31, -1, 8, 4); +public static readonly GameAttributeI Pet_Type = new GameAttributeI(357, -1, -1, 3, 1, "", "", "Pet_Type", GameAttributeEncoding.IntMinMax, 31, -1, 24, 5); +public static readonly GameAttributeB DropsNoLoot = new GameAttributeB(358, 0, -1, 1, 1, "", "", "DropsNoLoot", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB GrantsNoXP = new GameAttributeB(359, 0, -1, 1, 1, "", "", "GrantsNoXP", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeI Hireling_Class = new GameAttributeI(360, 0, -1, 1, 1, "", "", "Hireling_Class", GameAttributeEncoding.IntMinMax, 31, 0, 4, 3); +public static readonly GameAttributeI Summoned_By_SNO = new GameAttributeI(361, -1, -1, 3, 1, "", "", "Summoned_By_SNO", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeB Is_NPC = new GameAttributeB(362, 0, -1, 1, 1, "", "", "Is_NPC", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB NPC_Is_Operatable = new GameAttributeB(363, 0, -1, 1, 1, "", "", "NPC_Is_Operatable", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB NPC_Is_Escorting = new GameAttributeB(364, 0, -1, 1, 1, "", "", "NPC_Is_Escorting", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB NPC_Has_Interact_Options = new GameAttributeB(365, 0, 12, 1, 1, "", "", "NPC_Has_Interact_Options", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Conversation_Icon = new GameAttributeI(366, -1, 12, 3, 1, "", "", "Conversation_Icon", GameAttributeEncoding.IntMinMax, 31, -1, 6, 3); +public static readonly GameAttributeI Callout_Cooldown = new GameAttributeI(367, -1, 16, 1, 1, "", "", "Callout_Cooldown", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Banter_Cooldown = new GameAttributeI(368, -1, 16, 1, 1, "", "", "Banter_Cooldown", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Conversation_Heard_Count = new GameAttributeI(369, 0, 16, 1, 1, "", "", "Conversation_Heard_Count", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Last_Tick_Shop_Entered = new GameAttributeI(370, -1, -1, 3, 1, "", "", "Last_Tick_Shop_Entered", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeB Is_Helper = new GameAttributeB(371, 0, -1, 1, 1, "", "", "Is_Helper", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeF Axe = new GameAttributeF(372, 0, -1, 0, 0, "", "", "Axe", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Axe2H = new GameAttributeF(373, 0, -1, 0, 0, "", "", "Axe2H", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF ThrowingAxe = new GameAttributeF(374, 0, -1, 0, 0, "", "", "ThrowingAxe", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF AxeAny = new GameAttributeF(375, 0, -1, 0, 0, "Pin(Axe + Axe2H + ThrowingAxe, 0, 1)", "Pin(Axe + Axe2H + ThrowingAxe, 0, 1)", "AxeAny", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Bow = new GameAttributeF(376, 0, -1, 0, 0, "", "", "Bow", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Crossbow = new GameAttributeF(377, 0, -1, 0, 0, "", "", "Crossbow", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF BowAny = new GameAttributeF(378, 0, -1, 0, 0, "Pin(Bow + Crossbow, 0, 1)", "Pin(Bow + Crossbow, 0, 1)", "BowAny", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Club = new GameAttributeF(379, 0, -1, 0, 0, "", "", "Club", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Club2H = new GameAttributeF(380, 0, -1, 0, 0, "", "", "Club2H", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF ClubAny = new GameAttributeF(381, 0, -1, 0, 0, "Pin(Club + Club2H, 0, 1)", "Pin(Club + Club2H, 0, 1)", "ClubAny", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Dagger = new GameAttributeF(382, 0, -1, 0, 0, "", "", "Dagger", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Mace = new GameAttributeF(383, 0, -1, 0, 0, "", "", "Mace", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Mace2H = new GameAttributeF(384, 0, -1, 0, 0, "", "", "Mace2H", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF MaceAny = new GameAttributeF(385, 0, -1, 0, 0, "Pin(Mace + Mace2H, 0, 1)", "Pin(Mace + Mace2H, 0, 1)", "MaceAny", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Sword = new GameAttributeF(386, 0, -1, 0, 0, "", "", "Sword", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Sword2H = new GameAttributeF(387, 0, -1, 0, 0, "", "", "Sword2H", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF SwordAny = new GameAttributeF(388, 0, -1, 0, 0, "Pin(Sword + Sword2H, 0, 1)", "Pin(Sword + Sword2H, 0, 1)", "SwordAny", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Polearm = new GameAttributeF(389, 0, -1, 0, 0, "", "", "Polearm", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Spear = new GameAttributeF(390, 0, -1, 0, 0, "", "", "Spear", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Wand = new GameAttributeF(391, 0, -1, 0, 0, "", "", "Wand", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF ColdStaff = new GameAttributeF(392, 0, -1, 0, 0, "", "", "ColdStaff", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF FireStaff = new GameAttributeF(393, 0, -1, 0, 0, "", "", "FireStaff", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF LightningStaff = new GameAttributeF(394, 0, -1, 0, 0, "", "", "LightningStaff", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF PoisonStaff = new GameAttributeF(395, 0, -1, 0, 0, "", "", "PoisonStaff", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF StaffAny = new GameAttributeF(396, 0, -1, 0, 0, "Pin(ColdStaff + FireStaff + LightningStaff + PoisonStaff, 0, 1)", "Pin(ColdStaff + FireStaff + LightningStaff + PoisonStaff, 0, 1)", "StaffAny", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Weapon1H = new GameAttributeF(397, 0, -1, 0, 0, "Pin(Axe + Club + Dagger + Mace + Sword + Wand, 0, 1)", "Pin(Axe + Club + Dagger + Mace + Sword + Wand, 0, 1)", "Weapon1H", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Weapon2H = new GameAttributeF(398, 0, -1, 0, 0, "Pin(Axe2H + BowAny + Club2H + Mace2H + Sword2H + Polearm + Spear + StaffAny, 0, 1)", "Pin(Axe2H + BowAny + Club2H + Mace2H + Sword2H + Polearm + Spear + StaffAny, 0, 1)", "Weapon2H", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF WeaponMelee = new GameAttributeF(399, 0, -1, 0, 0, "Pin(Axe + Axe2H + ClubAny + Dagger + MaceAny + SwordAny + Polearm + Spear + Wand + StaffAny, 0, 1)", "Pin(Axe + Axe2H + ClubAny + Dagger + MaceAny + SwordAny + Polearm + Spear + Wand + StaffAny, 0, 1)", "WeaponMelee", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF WeaponRanged = new GameAttributeF(400, 0, -1, 0, 0, "Pin(ThrowingAxe + BowAny, 0, 1)", "Pin(ThrowingAxe + BowAny, 0, 1)", "WeaponRanged", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Quiver = new GameAttributeF(401, 0, -1, 0, 0, "", "", "Quiver", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeI Reincarnation_Buff = new GameAttributeI(402, -1, -1, 3, 1, "", "", "Reincarnation_Buff", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Dead_Body_AnimTag = new GameAttributeI(403, -1, -1, 3, 1, "", "", "Dead_Body_AnimTag", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Spawned_by_ACDID = new GameAttributeI(404, -1, -1, 3, 1, "", "", "Spawned_by_ACDID", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Summoned_By_ACDID = new GameAttributeI(405, -1, -1, 3, 1, "", "", "Summoned_By_ACDID", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Summoner_ID = new GameAttributeI(406, -1, -1, 3, 1, "", "", "Summoner_ID", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Banner_ACDID = new GameAttributeI(407, -1, -1, 3, 1, "", "", "Banner_ACDID", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeF Breakable_Shield_HP = new GameAttributeF(408, 0, -1, 0, 0, "", "", "Breakable_Shield_HP", GameAttributeEncoding.Float16Or32, 0, 0, 0, 0); +public static readonly GameAttributeI Current_WeaponClass = new GameAttributeI(409, -1, -1, 3, 1, "", "", "Current_WeaponClass", GameAttributeEncoding.IntMinMax, 31, -1, 19, 5); +public static readonly GameAttributeB Weapons_Sheathed = new GameAttributeB(410, 0, -1, 1, 1, "", "", "Weapons_Sheathed", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Held_In_OffHand = new GameAttributeB(411, 0, -1, 1, 1, "", "0", "Held_In_OffHand", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeF Attacks_Per_Second_Item_MainHand = new GameAttributeF(412, 0, -1, 0, 0, "(Held_In_OffHand ? 0 : Attacks_Per_Second_Item_Subtotal )", "", "Attacks_Per_Second_Item_MainHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Attacks_Per_Second_Item_OffHand = new GameAttributeF(413, 0, -1, 0, 0, "(Held_In_OffHand ? Attacks_Per_Second_Item_Subtotal : 0)", "", "Attacks_Per_Second_Item_OffHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Attacks_Per_Second_Item_Total_MainHand = new GameAttributeF(414, 0, -1, 0, 0, "Attacks_Per_Second_Item_MainHand + Attacks_Per_Second_Item_Bonus", "", "Attacks_Per_Second_Item_Total_MainHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Attacks_Per_Second_Item_Total_OffHand = new GameAttributeF(415, 0, -1, 0, 0, "Attacks_Per_Second_Item_OffHand + Attacks_Per_Second_Item_Bonus", "", "Attacks_Per_Second_Item_Total_OffHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Damage_Weapon_Min_Total_MainHand = new GameAttributeF(416, 0, 0, 0, 0, "(Held_In_OffHand#NONE ? 0 : Damage_Weapon_Min_Total )", "", "Damage_Weapon_Min_Total_MainHand", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_Weapon_Min_Total_OffHand = new GameAttributeF(417, 0, 0, 0, 0, "(Held_In_OffHand#NONE ? Damage_Weapon_Min_Total : 0)", "", "Damage_Weapon_Min_Total_OffHand", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_Weapon_Delta_Total_MainHand = new GameAttributeF(418, 0, 0, 0, 0, "(Held_In_OffHand#NONE ? 0 : Damage_Weapon_Delta_Total )", "", "Damage_Weapon_Delta_Total_MainHand", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_Weapon_Delta_Total_OffHand = new GameAttributeF(419, 0, 0, 0, 0, "(Held_In_OffHand#NONE ? Damage_Weapon_Delta_Total : 0)", "", "Damage_Weapon_Delta_Total_OffHand", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Attacks_Per_Second_Item_CurrentHand = new GameAttributeF(420, 0, -1, 0, 0, "", "(DualWield_Hand ? Attacks_Per_Second_Item_OffHand : Attacks_Per_Second_Item_MainHand)", "Attacks_Per_Second_Item_CurrentHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Damage_Weapon_Min_Total_CurrentHand = new GameAttributeF(421, 0, 0, 0, 0, "", "(DualWield_Hand#NONE ? Damage_Weapon_Min_Total_OffHand : Damage_Weapon_Min_Total_MainHand)", "Damage_Weapon_Min_Total_CurrentHand", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_Weapon_Delta_Total_CurrentHand = new GameAttributeF(422, 0, 0, 0, 0, "", "(DualWield_Hand#NONE ? Damage_Weapon_Delta_Total_OffHand : Damage_Weapon_Delta_Total_MainHand)", "Damage_Weapon_Delta_Total_CurrentHand", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeI Has_Special_Death_AnimTag = new GameAttributeI(423, -1, -1, 1, 1, "", "", "Has_Special_Death_AnimTag", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Death_Type_Override = new GameAttributeI(424, -1, -1, 3, 1, "", "", "Death_Type_Override", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeB In_Combat = new GameAttributeB(425, 0, -1, 1, 1, "", "", "In_Combat", GameAttributeEncoding.IntMinMax, 1, 0, 1, 1); +public static readonly GameAttributeB In_Conversation = new GameAttributeB(426, 0, -1, 3, 1, "", "", "In_Conversation", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Last_Tick_Potion_Used = new GameAttributeI(427, -1, -1, 3, 1, "", "", "Last_Tick_Potion_Used", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeF Potion_Dilution_Percent = new GameAttributeF(428, 0, -1, 0, 0, "", "", "Potion_Dilution_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeF Out_Of_Combat_Health_Regen_Percent = new GameAttributeF(429, 0, -1, 0, 0, "", "", "Out_Of_Combat_Health_Regen_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeF Out_Of_Combat_Mana_Regen_Percent = new GameAttributeF(430, 0, -1, 0, 0, "", "", "Out_Of_Combat_Mana_Regen_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeI Potion_Dilution_Duration = new GameAttributeI(431, -1, -1, 3, 1, "", "", "Potion_Dilution_Duration", GameAttributeEncoding.IntMinMax, 0, -1, 16777214, 24); +public static readonly GameAttributeF Potion_Dilution_Scalar = new GameAttributeF(432, 0, -1, 0, 0, "", "", "Potion_Dilution_Scalar", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeB Feared = new GameAttributeB(433, 0, -1, 1, 1, "", "", "Feared", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Fear_Immune = new GameAttributeB(434, 0, -1, 1, 1, "", "", "Fear_Immune", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeI Last_Damage_ACD = new GameAttributeI(435, -1, -1, 3, 1, "", "", "Last_Damage_ACD", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Attached_To_ACD = new GameAttributeI(436, -1, -1, 3, 1, "", "", "Attached_To_ACD", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Attachment_ACD = new GameAttributeI(437, -1, -1, 3, 1, "", "", "Attachment_ACD", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Normal_Attack_Replacement_Power_SNO = new GameAttributeI(438, -1, -1, 3, 1, "", "", "Normal_Attack_Replacement_Power_SNO", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeF Damage_Type_Override = new GameAttributeF(439, 0, 0, 0, 0, "", "", "Damage_Type_Override", GameAttributeEncoding.Float16Or32, 0, 0, 0, 0); +public static readonly GameAttributeF Minion_Count_Bonus_Percent = new GameAttributeF(440, 0, -1, 0, 0, "", "", "Minion_Count_Bonus_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeI Champion_Teleport_Next_Tick = new GameAttributeI(441, 0, -1, 0, 1, "", "", "Champion_Teleport_Next_Tick", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeF Champion_Teleport_Time_Min_In_Seconds = new GameAttributeF(442, 0, -1, 0, 0, "", "", "Champion_Teleport_Time_Min_In_Seconds", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeF Champion_Teleport_Time_Delta_In_Seconds = new GameAttributeF(443, 0, -1, 0, 0, "", "", "Champion_Teleport_Time_Delta_In_Seconds", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeI Champion_Clone_Next_Tick = new GameAttributeI(444, 0, -1, 0, 1, "", "", "Champion_Clone_Next_Tick", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeF Champion_Clone_Time_Min_In_Seconds = new GameAttributeF(445, 0, -1, 0, 0, "", "", "Champion_Clone_Time_Min_In_Seconds", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeF Champion_Clone_Time_Delta_In_Seconds = new GameAttributeF(446, 0, -1, 0, 0, "", "", "Champion_Clone_Time_Delta_In_Seconds", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeF Champion_Clone_Hitpoint_Bonus_Percent = new GameAttributeF(447, 0, -1, 0, 0, "", "", "Champion_Clone_Hitpoint_Bonus_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeF Champion_Clone_Damage_Bonus_Percent = new GameAttributeF(448, 0, -1, 0, 0, "", "", "Champion_Clone_Damage_Bonus_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeI Champion_Ghostly_Next_Tick = new GameAttributeI(449, 0, -1, 0, 1, "", "", "Champion_Ghostly_Next_Tick", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeF Champion_Ghostly_Inactive_Time_Min_In_Seconds = new GameAttributeF(450, 0, -1, 0, 0, "", "", "Champion_Ghostly_Inactive_Time_Min_In_Seconds", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeF Champion_Ghostly_Inactive_Time_Delta_In_Seconds = new GameAttributeF(451, 0, -1, 0, 0, "", "", "Champion_Ghostly_Inactive_Time_Delta_In_Seconds", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeF Champion_Ghostly_Active_Time_Min_In_Seconds = new GameAttributeF(452, 0, -1, 0, 0, "", "", "Champion_Ghostly_Active_Time_Min_In_Seconds", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeF Champion_Ghostly_Active_Time_Delta_In_Seconds = new GameAttributeF(453, 0, -1, 0, 0, "", "", "Champion_Ghostly_Active_Time_Delta_In_Seconds", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeF Champion_Ghostly_Saved_Dodge_Chance = new GameAttributeF(454, 0, -1, 0, 0, "", "", "Champion_Ghostly_Saved_Dodge_Chance", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeB Champion_Ghostly = new GameAttributeB(455, 0, -1, 1, 1, "", "", "Champion_Ghostly", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Base_Element = new GameAttributeI(456, -1, -1, 1, 1, "", "", "Base_Element", GameAttributeEncoding.IntMinMax, 0, -1, 7, 4); +public static readonly GameAttributeF Projectile_Amount_Bonus_Percent = new GameAttributeF(457, 0, -1, 0, 0, "", "", "Projectile_Amount_Bonus_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeF Projectile_Reflect_Chance = new GameAttributeF(458, 0, 0, 0, 0, "", "", "Projectile_Reflect_Chance", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeF Attack_Fear_Chance = new GameAttributeF(459, 0, -1, 0, 0, "", "", "Attack_Fear_Chance", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeF Attack_Fear_Time_Min = new GameAttributeF(460, 0, -1, 0, 0, "", "", "Attack_Fear_Time_Min", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeF Attack_Fear_Time_Delta = new GameAttributeF(461, 0, -1, 0, 0, "", "", "Attack_Fear_Time_Delta", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeB Buff_Visual_Effect = new GameAttributeB(462, 0, 9, 1, 1, "", "", "Buff_Visual_Effect", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Buff_Icon_Start_Tick0 = new GameAttributeI(463, 0, 4, 1, 1, "", "", "Buff_Icon_Start_Tick0", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Buff_Icon_Start_Tick1 = new GameAttributeI(464, 0, 4, 1, 1, "", "", "Buff_Icon_Start_Tick1", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Buff_Icon_Start_Tick2 = new GameAttributeI(465, 0, 4, 1, 1, "", "", "Buff_Icon_Start_Tick2", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Buff_Icon_Start_Tick3 = new GameAttributeI(466, 0, 4, 1, 1, "", "", "Buff_Icon_Start_Tick3", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Buff_Icon_Start_Tick4 = new GameAttributeI(467, 0, 4, 1, 1, "", "", "Buff_Icon_Start_Tick4", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Buff_Icon_Start_Tick5 = new GameAttributeI(468, 0, 4, 1, 1, "", "", "Buff_Icon_Start_Tick5", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Buff_Icon_Start_Tick6 = new GameAttributeI(469, 0, 4, 1, 1, "", "", "Buff_Icon_Start_Tick6", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Buff_Icon_Start_Tick7 = new GameAttributeI(470, 0, 4, 1, 1, "", "", "Buff_Icon_Start_Tick7", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Buff_Icon_End_Tick0 = new GameAttributeI(471, 0, 4, 1, 1, "", "", "Buff_Icon_End_Tick0", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Buff_Icon_End_Tick1 = new GameAttributeI(472, 0, 4, 1, 1, "", "", "Buff_Icon_End_Tick1", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Buff_Icon_End_Tick2 = new GameAttributeI(473, 0, 4, 1, 1, "", "", "Buff_Icon_End_Tick2", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Buff_Icon_End_Tick3 = new GameAttributeI(474, 0, 4, 1, 1, "", "", "Buff_Icon_End_Tick3", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Buff_Icon_End_Tick4 = new GameAttributeI(475, 0, 4, 1, 1, "", "", "Buff_Icon_End_Tick4", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Buff_Icon_End_Tick5 = new GameAttributeI(476, 0, 4, 1, 1, "", "", "Buff_Icon_End_Tick5", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Buff_Icon_End_Tick6 = new GameAttributeI(477, 0, 4, 1, 1, "", "", "Buff_Icon_End_Tick6", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Buff_Icon_End_Tick7 = new GameAttributeI(478, 0, 4, 1, 1, "", "", "Buff_Icon_End_Tick7", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeB Could_Have_Ragdolled = new GameAttributeB(479, 0, -1, 1, 1, "", "", "Could_Have_Ragdolled", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Ambient_Damage_Effect_Last_Time = new GameAttributeI(480, 0, -1, 1, 1, "", "", "Ambient_Damage_Effect_Last_Time", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeF Scale_Bonus = new GameAttributeF(481, 0, -1, 0, 0, "", "", "Scale_Bonus", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeB Deleted_On_Server = new GameAttributeB(482, 0, -1, 1, 1, "", "", "Deleted_On_Server", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Scripted_Fade_Time = new GameAttributeI(483, 0, -1, 1, 1, "", "", "Scripted_Fade_Time", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeB Does_No_Damage = new GameAttributeB(484, 0, -1, 1, 1, "", "", "Does_No_Damage", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Does_Fake_Damage = new GameAttributeB(485, 0, -1, 1, 1, "", "", "Does_Fake_Damage", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeF SlowTime_Debuff = new GameAttributeF(486, 0, -1, 0, 0, "", "", "SlowTime_Debuff", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeB Blocks_Projectiles = new GameAttributeB(487, 0, -1, 1, 1, "", "", "Blocks_Projectiles", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Frozen = new GameAttributeB(488, 0, -1, 1, 1, "", "", "Frozen", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeF Freeze_Damage_Percent_Bonus = new GameAttributeF(489, 0, -1, 0, 0, "", "", "Freeze_Damage_Percent_Bonus", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeB Buff_Active = new GameAttributeB(490, 0, 4, 1, 1, "", "", "Buff_Active", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeF DualWield_BothAttack_Chance = new GameAttributeF(491, 0, -1, 0, 0, "", "", "DualWield_BothAttack_Chance", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeI Summon_Expiration_Tick = new GameAttributeI(492, 0, -1, 0, 1, "", "", "Summon_Expiration_Tick", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Summon_Count = new GameAttributeI(493, 0, -1, 0, 1, "", "", "Summon_Count", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeB Uninterruptible = new GameAttributeB(494, 0, -1, 1, 1, "", "", "Uninterruptible", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Queue_Death = new GameAttributeB(495, 0, -1, 1, 1, "", "", "Queue Death", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB CantStartDisplayedPowers = new GameAttributeB(496, 0, -1, 1, 1, "", "", "CantStartDisplayedPowers", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Wizard_Slowtime_Proxy_ACD = new GameAttributeI(497, -1, -1, 3, 1, "", "", "Wizard_Slowtime_Proxy_ACD", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeF DPS = new GameAttributeF(498, 0, -1, 1, 0, "", "", "DPS", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); +public static readonly GameAttributeI Resurrection_Power = new GameAttributeI(499, -1, -1, 3, 1, "", "", "Resurrection_Power", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeF Freeze_Damage = new GameAttributeF(500, 0, -1, 1, 0, "", "", "Freeze_Damage", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); +public static readonly GameAttributeF Freeze_Capacity = new GameAttributeF(501, 0, -1, 0, 0, "", "", "Freeze_Capacity", GameAttributeEncoding.Float16Or32, 0, 0, 0, 0); +public static readonly GameAttributeF Thaw_Rate = new GameAttributeF(502, 0, -1, 0, 0, "", "", "Thaw_Rate", GameAttributeEncoding.Float16Or32, 0, 0, 0, 0); +public static readonly GameAttributeF Chilled_Dur_Bonus_Percent = new GameAttributeF(503, 0, -1, 0, 0, "", "", "Chilled_Dur_Bonus_Percent", GameAttributeEncoding.Float16Or32, 0, 0, 0, 0); +public static readonly GameAttributeF DOT_DPS = new GameAttributeF(504, 0, -1, 0, 0, "", "", "DOT_DPS", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); +public static readonly GameAttributeF DamageCap_Percent = new GameAttributeF(505, 0, -1, 1, 0, "", "", "DamageCap_Percent", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeI Item_Time_Sold = new GameAttributeI(506, 0, -1, 1, 1, "", "", "Item_Time_Sold", GameAttributeEncoding.Int, 8, 0, 0, 32); +public static readonly GameAttributeI Forced_Hireling_Power = new GameAttributeI(507, -1, -1, 3, 1, "", "", "Forced_Hireling_Power", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeB IsRooted = new GameAttributeB(508, 0, -1, 1, 1, "", "", "IsRooted", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI RootTargetACD = new GameAttributeI(509, -1, -1, 3, 1, "", "", "RootTargetACD", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeF RootAutoDecayPerSecond = new GameAttributeF(510, 0, -1, 1, 0, "", "", "RootAutoDecayPerSecond", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeF RootUnitValue = new GameAttributeF(511, 0, -1, 1, 0, "", "", "RootUnitValue", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeI RootTotalTicks = new GameAttributeI(512, 0, -1, 1, 1, "", "", "RootTotalTicks", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeB Hide_Affixes = new GameAttributeB(513, 0, -1, 1, 1, "", "", "Hide_Affixes", GameAttributeEncoding.IntMinMax, 8, 0, 1, 1); +public static readonly GameAttributeI Rune_A = new GameAttributeI(514, 0, 11, 0, 1, "", "", "Rune_A", GameAttributeEncoding.IntMinMax, 31, 0, 255, 8); +public static readonly GameAttributeI Rune_B = new GameAttributeI(515, 0, 11, 0, 1, "", "", "Rune_B", GameAttributeEncoding.IntMinMax, 31, 0, 255, 8); +public static readonly GameAttributeI Rune_C = new GameAttributeI(516, 0, 11, 0, 1, "", "", "Rune_C", GameAttributeEncoding.IntMinMax, 31, 0, 255, 8); +public static readonly GameAttributeI Rune_D = new GameAttributeI(517, 0, 11, 0, 1, "", "", "Rune_D", GameAttributeEncoding.IntMinMax, 31, 0, 255, 8); +public static readonly GameAttributeI Rune_E = new GameAttributeI(518, 0, 11, 0, 1, "", "", "Rune_E", GameAttributeEncoding.IntMinMax, 31, 0, 255, 8); +public static readonly GameAttributeF Resistance_Stun = new GameAttributeF(519, 0, -1, 0, 0, "", "", "Resistance_Stun", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Resistance_Stun_Total = new GameAttributeF(520, 0, -1, 0, 0, "", "Resistance_Stun + Resistance_StunRootFreeze", "Resistance_Stun_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Resistance_Root = new GameAttributeF(521, 0, -1, 0, 0, "", "", "Resistance_Root", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Resistance_Root_Total = new GameAttributeF(522, 0, -1, 0, 0, "", "Resistance_Root + Resistance_StunRootFreeze", "Resistance_Root_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Resistance_Freeze = new GameAttributeF(523, 0, -1, 0, 0, "", "", "Resistance_Freeze", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Resistance_Freeze_Total = new GameAttributeF(524, 0, -1, 0, 0, "", "Resistance_Freeze + Resistance_StunRootFreeze", "Resistance_Freeze_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Resistance_StunRootFreeze = new GameAttributeF(525, 0, -1, 0, 0, "", "", "Resistance_StunRootFreeze", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF CrowdControl_Reduction = new GameAttributeF(526, 0, -1, 7, 0, "", "", "CrowdControl_Reduction", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeB Displays_Team_Effect = new GameAttributeB(527, 0, -1, 1, 1, "", "", "Displays_Team_Effect", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Cannot_Be_Added_To_AI_Target_List = new GameAttributeB(528, 0, -1, 1, 1, "", "", "Cannot_Be_Added_To_AI_Target_List", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeI SkillKit = new GameAttributeI(529, -1, -1, 3, 1, "", "", "SkillKit", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeB Immune_To_Charm = new GameAttributeB(530, 0, -1, 1, 1, "", "", "Immune_To_Charm", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Immune_To_Blind = new GameAttributeB(531, 0, -1, 1, 1, "", "", "Immune_To_Blind", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Damage_Shield = new GameAttributeB(532, 0, -1, 1, 1, "", "", "Damage_Shield", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Silenced = new GameAttributeB(533, 0, -1, 1, 1, "", "", "Silenced", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Diseased = new GameAttributeB(534, 0, -1, 1, 1, "", "", "Diseased", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Guard_Object_ACDID = new GameAttributeI(535, -1, -1, 3, 1, "", "", "Guard_Object_ACDID", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Follow_Target_ACDID = new GameAttributeI(536, -1, -1, 3, 1, "", "", "Follow_Target_ACDID", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Follow_Target_Type = new GameAttributeI(537, 0, -1, 3, 1, "", "", "Follow_Target_Type", GameAttributeEncoding.IntMinMax, 0, 0, 2, 2); +public static readonly GameAttributeI Forced_Enemy_ACDID = new GameAttributeI(538, -1, -1, 1, 1, "", "", "Forced_Enemy_ACDID", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI NPC_Talk_Target_ANN = new GameAttributeI(539, -1, -1, 3, 1, "", "", "NPC_Talk_Target_ANN", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI NPC_Conv_Target_ANN = new GameAttributeI(540, -1, -1, 3, 1, "", "", "NPC_Conv_Target_ANN", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Script_Target_ACDID = new GameAttributeI(541, -1, 3, 3, 1, "", "", "Script_Target_ACDID", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Look_Target_Server_ANN = new GameAttributeI(542, -1, -1, 1, 1, "", "", "Look_Target_Server_ANN", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeF Look_Target_Broadcast_Intensity = new GameAttributeF(543, 0, -1, 0, 0, "", "", "Look_Target_Broadcast_Intensity", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeF Look_Target_Broadcast_Radius = new GameAttributeF(544, 0, -1, 0, 0, "", "", "Look_Target_Broadcast_Radius", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeB Stealthed = new GameAttributeB(545, 0, -1, 1, 1, "", "", "Stealthed", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI GemQuality = new GameAttributeI(546, 0, -1, 4, 1, "", "", "GemQuality", GameAttributeEncoding.IntMinMax, 8, 0, 14, 4); +public static readonly GameAttributeI ItemBuffIcon = new GameAttributeI(547, 0, 4, 1, 1, "", "0", "ItemBuffIcon", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeF ScrollDuration = new GameAttributeF(548, 0, -1, 1, 0, "", "0", "ScrollDuration", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeI Gizmo_Actor_SNO_To_Spawn = new GameAttributeI(549, -1, -1, 3, 1, "", "", "Gizmo_Actor_SNO_To_Spawn", GameAttributeEncoding.Int, 4, 0, 0, 32); +public static readonly GameAttributeF Gizmo_Actor_To_Spawn_Scale = new GameAttributeF(550, 0, -1, 1, 0, "", "", "Gizmo_Actor_To_Spawn_Scale", GameAttributeEncoding.Float16, 4, 0, 0, 16); +public static readonly GameAttributeI Death_Replacement_Power_SNO = new GameAttributeI(551, -1, -1, 3, 1, "", "", "Death_Replacement_Power_SNO", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeB Attachment_Handled_By_Client = new GameAttributeB(552, 0, -1, 1, 1, "", "", "Attachment_Handled_By_Client", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB AI_In_Special_State = new GameAttributeB(553, 0, -1, 1, 1, "", "", "AI_In_Special_State", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB AI_Used_Scripted_Spawn_Anim = new GameAttributeB(554, 0, -1, 1, 1, "", "", "AI_Used_Scripted_Spawn_Anim", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB AI_Spawned_By_Inactive_Marker = new GameAttributeB(555, 0, -1, 1, 1, "", "", "AI_Spawned_By_Inactive_Marker", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeI Headstone_Player_ANN = new GameAttributeI(556, -1, -1, 3, 1, "", "", "Headstone_Player_ANN", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeF Resource_Cost_Reduction_Percent = new GameAttributeF(557, 0, 10, 0, 0, "", "", "Resource_Cost_Reduction_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Resistance_Penetration = new GameAttributeF(558, 0, 0, 0, 0, "", "", "Resistance_Penetration", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeF Resistance_Penetration_Total = new GameAttributeF(559, 0, 0, 0, 0, "", "(Resistance_Penetration + Resistance_Penetration_All#NONE) * (Resistance_Penetration_Percent_All#NONE + 1)", "Resistance_Penetration_Total", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeF Resistance_Penetration_All = new GameAttributeF(560, 0, -1, 0, 0, "", "", "Resistance_Penetration_All", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeF Resistance_Penetration_Percent_All = new GameAttributeF(561, 0, -1, 0, 0, "", "", "Resistance_Penetration_Percent_All", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeI Fury_Effect_Level = new GameAttributeI(562, 0, -1, 0, 1, "", "", "Fury_Effect_Level", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeF Health_Potion_Bonus_Heal_Percent = new GameAttributeF(563, 0, -1, 0, 0, "", "", "Health_Potion_Bonus_Heal_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeI Free_Cast = new GameAttributeI(564, 0, 4, 1, 1, "", "", "Free_Cast", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeB Free_Cast_All = new GameAttributeB(565, 0, -1, 1, 1, "", "", "Free_Cast_All", GameAttributeEncoding.IntMinMax, 9, 0, 1, 1); +public static readonly GameAttributeF Movement_Scalar_Reduction_Percent = new GameAttributeF(566, 0, -1, 1, 0, "", "", "Movement_Scalar_Reduction_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Movement_Scalar_Reduction_Resistance = new GameAttributeF(567, 0, -1, 0, 0, "", "", "Movement_Scalar_Reduction_Resistance", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Damage_Absorb_Percent_All = new GameAttributeF(568, 0, -1, 0, 0, "", "", "Damage_Absorb_Percent_All", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeI World_Seed = new GameAttributeI(569, 0, -1, 0, 1, "", "", "World_Seed", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeI Kill_Count_Record = new GameAttributeI(570, 0, -1, 1, 1, "", "", "Kill_Count_Record", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); +public static readonly GameAttributeI Object_Destruction_Record = new GameAttributeI(571, 0, -1, 1, 1, "", "", "Object_Destruction_Record", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); +public static readonly GameAttributeI Single_Attack_Record = new GameAttributeI(572, 0, -1, 1, 1, "", "", "Single_Attack_Record", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); +public static readonly GameAttributeI Environment_Attack_Record = new GameAttributeI(573, 0, -1, 1, 1, "", "", "Environment_Attack_Record", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); +public static readonly GameAttributeB Root_Immune = new GameAttributeB(574, 0, -1, 1, 1, "", "", "Root_Immune", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeF Monster_Play_Get_Hit_Bonus = new GameAttributeF(575, 0, -1, 0, 0, "", "", "Monster_Play_Get_Hit_Bonus", GameAttributeEncoding.Float16Or32, 0, 0, 0, 0); +public static readonly GameAttributeI Stored_Contact_Frame = new GameAttributeI(576, 0, -1, 1, 1, "", "", "Stored_Contact_Frame", GameAttributeEncoding.IntMinMax, 0, 0, 4, 3); +public static readonly GameAttributeI Buff_Icon_Count0 = new GameAttributeI(577, 0, 4, 0, 1, "", "", "Buff_Icon_Count0", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); +public static readonly GameAttributeI Buff_Icon_Count1 = new GameAttributeI(578, 0, 4, 0, 1, "", "", "Buff_Icon_Count1", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); +public static readonly GameAttributeI Buff_Icon_Count2 = new GameAttributeI(579, 0, 4, 0, 1, "", "", "Buff_Icon_Count2", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); +public static readonly GameAttributeI Buff_Icon_Count3 = new GameAttributeI(580, 0, 4, 0, 1, "", "", "Buff_Icon_Count3", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); +public static readonly GameAttributeI Buff_Icon_Count4 = new GameAttributeI(581, 0, 4, 0, 1, "", "", "Buff_Icon_Count4", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); +public static readonly GameAttributeI Buff_Icon_Count5 = new GameAttributeI(582, 0, 4, 0, 1, "", "", "Buff_Icon_Count5", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); +public static readonly GameAttributeI Buff_Icon_Count6 = new GameAttributeI(583, 0, 4, 0, 1, "", "", "Buff_Icon_Count6", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); +public static readonly GameAttributeI Buff_Icon_Count7 = new GameAttributeI(584, 0, 4, 0, 1, "", "", "Buff_Icon_Count7", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); +public static readonly GameAttributeB Observer = new GameAttributeB(585, 0, -1, 1, 1, "", "", "Observer", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Resurrect_As_Observer = new GameAttributeB(586, 0, -1, 1, 1, "", "", "Resurrect_As_Observer", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeI Combo_Level = new GameAttributeI(587, 0, -1, 1, 1, "", "", "Combo_Level", GameAttributeEncoding.IntMinMax, 0, 0, 3, 2); +public static readonly GameAttributeI Combo_Time_Last_Move = new GameAttributeI(588, 0, -1, 1, 1, "", "", "Combo_Time_Last_Move", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeB Burrowed = new GameAttributeB(589, 0, -1, 1, 1, "", "", "Burrowed", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Death_Replacement_Effect_Group_SNO = new GameAttributeI(590, -1, -1, 3, 1, "", "", "Death_Replacement_Effect_Group_SNO", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Checkpoint_Resurrection_Allowed_Game_Time = new GameAttributeI(591, 0, -1, 0, 1, "", "", "Checkpoint_Resurrection_Allowed_Game_Time", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Checkpoint_Resurrection_Forced_Game_Time = new GameAttributeI(592, 0, -1, 0, 1, "", "", "Checkpoint_Resurrection_Forced_Game_Time", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Controlling_TimedEvent_SNO = new GameAttributeI(593, -1, -1, 3, 1, "", "", "Controlling_TimedEvent_SNO", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeF Casting_Speed_Percent = new GameAttributeF(594, 0, -1, 0, 0, "", "", "Casting_Speed_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeB Using_Bossbar = new GameAttributeB(595, 0, -1, 1, 1, "", "", "Using_Bossbar", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_0_Visual_Effect = new GameAttributeB(596, 0, 4, 1, 1, "", "", "Power_Buff_0_Visual_Effect", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_1_Visual_Effect = new GameAttributeB(597, 0, 4, 1, 1, "", "", "Power_Buff_1_Visual_Effect", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_2_Visual_Effect = new GameAttributeB(598, 0, 4, 1, 1, "", "", "Power_Buff_2_Visual_Effect", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_3_Visual_Effect = new GameAttributeB(599, 0, 4, 1, 1, "", "", "Power_Buff_3_Visual_Effect", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_4_Visual_Effect = new GameAttributeB(600, 0, 4, 1, 1, "", "", "Power_Buff_4_Visual_Effect", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_5_Visual_Effect = new GameAttributeB(601, 0, 4, 1, 1, "", "", "Power_Buff_5_Visual_Effect", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_6_Visual_Effect = new GameAttributeB(602, 0, 4, 1, 1, "", "", "Power_Buff_6_Visual_Effect", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_7_Visual_Effect = new GameAttributeB(603, 0, 4, 1, 1, "", "", "Power_Buff_7_Visual_Effect", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Store_SNO = new GameAttributeI(604, 0, 0, 3, 1, "", "", "Store SNO", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeB Busy = new GameAttributeB(605, 0, -1, 1, 1, "", "", "Busy", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Afk = new GameAttributeB(606, 0, -1, 1, 1, "", "", "Afk", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Last_Action_Timestamp = new GameAttributeI(607, 0, -1, 1, 1, "", "", "Last Action Timestamp", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Portal_Next_Time = new GameAttributeI(608, 0, -1, 1, 1, "", "", "Portal Next Time", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeF Repair_Discount_Percent = new GameAttributeF(609, 0, -1, 0, 0, "", "", "Repair_Discount_Percent", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeB Resource_Degeneration_Prevented = new GameAttributeB(610, 0, -1, 1, 1, "", "", "Resource_Degeneration_Prevented", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Operatable = new GameAttributeB(611, 0, -1, 4, 1, "", "", "Operatable", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Look_Override = new GameAttributeI(612, 0, -1, 0, 1, "", "", "Look_Override", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Spawner_Concurrent_Count_ID = new GameAttributeI(613, -1, -1, 3, 1, "", "", "Spawner_Concurrent_Count_ID", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeB Disabled = new GameAttributeB(614, 0, -1, 1, 1, "", "", "Disabled", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Skill_Override = new GameAttributeI(615, -1, 3, 1, 1, "", "", "Skill_Override", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeB Skill_Override_Active = new GameAttributeB(616, 0, -1, 1, 1, "", "", "Skill_Override_Active", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Skill_Override_Ended = new GameAttributeB(617, 0, 4, 1, 1, "", "", "Skill_Override_Ended", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Skill_Override_Ended_Active = new GameAttributeB(618, 0, -1, 1, 1, "", "", "Skill_Override_Ended_Active", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Is_Power_Proxy = new GameAttributeB(619, 0, -1, 1, 1, "", "", "Is_Power_Proxy", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Force_No_Death_Animation = new GameAttributeB(620, 0, -1, 1, 1, "", "", "Force_No_Death_Animation", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeI Player_WeaponClass_Anim_Override = new GameAttributeI(621, -1, -1, 1, 1, "", "", "Player_WeaponClass_Anim_Override", GameAttributeEncoding.IntMinMax, 31, -1, 19, 5); +public static readonly GameAttributeB Operatable_Story_Gizmo = new GameAttributeB(622, 0, -1, 1, 1, "", "", "Operatable_Story_Gizmo", GameAttributeEncoding.IntMinMax, 4, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_0_Visual_Effect_None = new GameAttributeB(623, 0, 4, 1, 1, "", "", "Power_Buff_0_Visual_Effect_None", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_0_Visual_Effect_A = new GameAttributeB(624, 0, 4, 1, 1, "", "", "Power_Buff_0_Visual_Effect_A", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_0_Visual_Effect_B = new GameAttributeB(625, 0, 4, 1, 1, "", "", "Power_Buff_0_Visual_Effect_B", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_0_Visual_Effect_C = new GameAttributeB(626, 0, 4, 1, 1, "", "", "Power_Buff_0_Visual_Effect_C", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_0_Visual_Effect_D = new GameAttributeB(627, 0, 4, 1, 1, "", "", "Power_Buff_0_Visual_Effect_D", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_0_Visual_Effect_E = new GameAttributeB(628, 0, 4, 1, 1, "", "", "Power_Buff_0_Visual_Effect_E", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_1_Visual_Effect_None = new GameAttributeB(629, 0, 4, 1, 1, "", "", "Power_Buff_1_Visual_Effect_None", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_1_Visual_Effect_A = new GameAttributeB(630, 0, 4, 1, 1, "", "", "Power_Buff_1_Visual_Effect_A", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_1_Visual_Effect_B = new GameAttributeB(631, 0, 4, 1, 1, "", "", "Power_Buff_1_Visual_Effect_B", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_1_Visual_Effect_C = new GameAttributeB(632, 0, 4, 1, 1, "", "", "Power_Buff_1_Visual_Effect_C", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_1_Visual_Effect_D = new GameAttributeB(633, 0, 4, 1, 1, "", "", "Power_Buff_1_Visual_Effect_D", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_1_Visual_Effect_E = new GameAttributeB(634, 0, 4, 1, 1, "", "", "Power_Buff_1_Visual_Effect_E", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_2_Visual_Effect_None = new GameAttributeB(635, 0, 4, 1, 1, "", "", "Power_Buff_2_Visual_Effect_None", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_2_Visual_Effect_A = new GameAttributeB(636, 0, 4, 1, 1, "", "", "Power_Buff_2_Visual_Effect_A", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_2_Visual_Effect_B = new GameAttributeB(637, 0, 4, 1, 1, "", "", "Power_Buff_2_Visual_Effect_B", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_2_Visual_Effect_C = new GameAttributeB(638, 0, 4, 1, 1, "", "", "Power_Buff_2_Visual_Effect_C", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_2_Visual_Effect_D = new GameAttributeB(639, 0, 4, 1, 1, "", "", "Power_Buff_2_Visual_Effect_D", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_2_Visual_Effect_E = new GameAttributeB(640, 0, 4, 1, 1, "", "", "Power_Buff_2_Visual_Effect_E", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_3_Visual_Effect_None = new GameAttributeB(641, 0, 4, 1, 1, "", "", "Power_Buff_3_Visual_Effect_None", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_3_Visual_Effect_A = new GameAttributeB(642, 0, 4, 1, 1, "", "", "Power_Buff_3_Visual_Effect_A", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_3_Visual_Effect_B = new GameAttributeB(643, 0, 4, 1, 1, "", "", "Power_Buff_3_Visual_Effect_B", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_3_Visual_Effect_C = new GameAttributeB(644, 0, 4, 1, 1, "", "", "Power_Buff_3_Visual_Effect_C", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_3_Visual_Effect_D = new GameAttributeB(645, 0, 4, 1, 1, "", "", "Power_Buff_3_Visual_Effect_D", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_3_Visual_Effect_E = new GameAttributeB(646, 0, 4, 1, 1, "", "", "Power_Buff_3_Visual_Effect_E", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_4_Visual_Effect_None = new GameAttributeB(647, 0, 4, 1, 1, "", "", "Power_Buff_4_Visual_Effect_None", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_4_Visual_Effect_A = new GameAttributeB(648, 0, 4, 1, 1, "", "", "Power_Buff_4_Visual_Effect_A", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_4_Visual_Effect_B = new GameAttributeB(649, 0, 4, 1, 1, "", "", "Power_Buff_4_Visual_Effect_B", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_4_Visual_Effect_C = new GameAttributeB(650, 0, 4, 1, 1, "", "", "Power_Buff_4_Visual_Effect_C", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_4_Visual_Effect_D = new GameAttributeB(651, 0, 4, 1, 1, "", "", "Power_Buff_4_Visual_Effect_D", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_4_Visual_Effect_E = new GameAttributeB(652, 0, 4, 1, 1, "", "", "Power_Buff_4_Visual_Effect_E", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_5_Visual_Effect_None = new GameAttributeB(653, 0, 4, 1, 1, "", "", "Power_Buff_5_Visual_Effect_None", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_5_Visual_Effect_A = new GameAttributeB(654, 0, 4, 1, 1, "", "", "Power_Buff_5_Visual_Effect_A", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_5_Visual_Effect_B = new GameAttributeB(655, 0, 4, 1, 1, "", "", "Power_Buff_5_Visual_Effect_B", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_5_Visual_Effect_C = new GameAttributeB(656, 0, 4, 1, 1, "", "", "Power_Buff_5_Visual_Effect_C", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_5_Visual_Effect_D = new GameAttributeB(657, 0, 4, 1, 1, "", "", "Power_Buff_5_Visual_Effect_D", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_5_Visual_Effect_E = new GameAttributeB(658, 0, 4, 1, 1, "", "", "Power_Buff_5_Visual_Effect_E", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_6_Visual_Effect_None = new GameAttributeB(659, 0, 4, 1, 1, "", "", "Power_Buff_6_Visual_Effect_None", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_6_Visual_Effect_A = new GameAttributeB(660, 0, 4, 1, 1, "", "", "Power_Buff_6_Visual_Effect_A", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_6_Visual_Effect_B = new GameAttributeB(661, 0, 4, 1, 1, "", "", "Power_Buff_6_Visual_Effect_B", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_6_Visual_Effect_C = new GameAttributeB(662, 0, 4, 1, 1, "", "", "Power_Buff_6_Visual_Effect_C", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_6_Visual_Effect_D = new GameAttributeB(663, 0, 4, 1, 1, "", "", "Power_Buff_6_Visual_Effect_D", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_6_Visual_Effect_E = new GameAttributeB(664, 0, 4, 1, 1, "", "", "Power_Buff_6_Visual_Effect_E", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_7_Visual_Effect_None = new GameAttributeB(665, 0, 4, 1, 1, "", "", "Power_Buff_7_Visual_Effect_None", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_7_Visual_Effect_A = new GameAttributeB(666, 0, 4, 1, 1, "", "", "Power_Buff_7_Visual_Effect_A", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_7_Visual_Effect_B = new GameAttributeB(667, 0, 4, 1, 1, "", "", "Power_Buff_7_Visual_Effect_B", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_7_Visual_Effect_C = new GameAttributeB(668, 0, 4, 1, 1, "", "", "Power_Buff_7_Visual_Effect_C", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_7_Visual_Effect_D = new GameAttributeB(669, 0, 4, 1, 1, "", "", "Power_Buff_7_Visual_Effect_D", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_7_Visual_Effect_E = new GameAttributeB(670, 0, 4, 1, 1, "", "", "Power_Buff_7_Visual_Effect_E", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Walk_Passability_Power_SNO = new GameAttributeI(671, -1, -1, 1, 1, "", "", "Walk_Passability_Power_SNO", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Passability_Power_SNO = new GameAttributeI(672, -1, -1, 1, 1, "", "", "Passability_Power_SNO", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Flippy_ID = new GameAttributeI(673, -1, -1, 3, 1, "", "", "Flippy_ID", GameAttributeEncoding.Int, 8, 0, 0, 32); +public static readonly GameAttributeI Summoning_Machine_Num_Casters = new GameAttributeI(674, 0, -1, 0, 1, "", "", "Summoning_Machine_Num_Casters", GameAttributeEncoding.IntMinMax, 0, 0, 255, 8); +public static readonly GameAttributeI Summoning_Machine_Spawn_Count = new GameAttributeI(675, 0, 15, 0, 1, "", "", "Summoning_Machine_Spawn_Count", GameAttributeEncoding.IntMinMax, 0, 0, 4095, 12); +public static readonly GameAttributeI Summoning_Machine_Next_Spawn_Ticks = new GameAttributeI(676, 0, -1, 0, 1, "", "", "Summoning_Machine_Next_Spawn_Ticks", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Summoning_Machine_Spawn_Team = new GameAttributeI(677, -1, -1, 1, 1, "", "", "Summoning_Machine_Spawn_Team", GameAttributeEncoding.IntMinMax, 0, -1, 23, 5); +public static readonly GameAttributeF Screen_Attack_Radius_Constant = new GameAttributeF(678, 1114636288, -1, 3, 0, "", "", "Screen_Attack_Radius_Constant", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeF Damage_Done_Reduction_Percent = new GameAttributeF(679, 0, -1, 1, 0, "", "", "Damage_Done_Reduction_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeI Set_Item_Count = new GameAttributeI(680, 0, 17, 0, 1, "", "", "Set_Item_Count", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeF Spawner_Countdown_Percent = new GameAttributeF(681, 0, -1, 1, 0, "", "", "Spawner_Countdown_Percent", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeB Attack_Slow = new GameAttributeB(682, 0, -1, 1, 1, "", "", "Attack_Slow", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Power_Disabled = new GameAttributeB(683, 0, 4, 1, 1, "", "", "Power_Disabled", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Weapon_Effect_Override = new GameAttributeI(684, 0, -1, 1, 1, "", "", "Weapon_Effect_Override", GameAttributeEncoding.IntMinMax, 31, 0, 14, 4); +public static readonly GameAttributeF Debuff_Duration_Reduction_Percent = new GameAttributeF(685, 0, -1, 0, 0, "", "", "Debuff_Duration_Reduction_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeB Uses_PvP_Power_Tags = new GameAttributeB(686, 0, -1, 1, 1, "", "", "Uses_PvP_Power_Tags", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Trait = new GameAttributeI(687, 0, 4, 1, 1, "", "", "Trait", GameAttributeEncoding.IntMinMax, 31, -1, 30, 5); +public static readonly GameAttributeI Last_ACD_Attacked_By = new GameAttributeI(688, -1, -1, 3, 1, "", "", "Last_ACD_Attacked_By", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeF Gold_PickUp_Radius = new GameAttributeF(689, 0, -1, 0, 0, "", "", "Gold_PickUp_Radius", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeI Client_Only_Effect = new GameAttributeI(690, 0, 12, 1, 1, "", "", "Client Only Effect", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeB Has_Doppelganger_Cloned = new GameAttributeB(691, 0, -1, 1, 1, "", "", "Has_Doppelganger_Cloned", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeF Resource_Gain_Bonus_Percent = new GameAttributeF(692, 0, 10, 0, 0, "", "", "Resource_Gain_Bonus_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeI Looping_Animation_Start_Time = new GameAttributeI(693, 0, -1, 1, 1, "", "", "Looping_Animation_Start_Time", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Looping_Animation_End_Time = new GameAttributeI(694, 0, -1, 1, 1, "", "", "Looping_Animation_End_Time", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeB Looping_Animation_Suppress_Item_Tooltips = new GameAttributeB(695, 0, -1, 1, 1, "", "", "Looping_Animation_Suppress_Item_Tooltips", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Heal_Effect_Last_Played_Tick = new GameAttributeI(696, -1, -1, 3, 1, "", "", "Heal_Effect_Last_Played_Tick", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Resource_Effect_Last_Played_tick = new GameAttributeI(697, -1, 10, 3, 1, "", "", "Resource_Effect_Last_Played_tick", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Thorns_Effect_Last_Played_tick = new GameAttributeI(698, -1, -1, 3, 1, "", "", "Thorns_Effect_Last_Played_tick", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI PVP_Kills = new GameAttributeI(699, 0, -1, 0, 1, "", "", "PVP_Kills", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeI PVP_Deaths = new GameAttributeI(700, 0, -1, 0, 1, "", "", "PVP_Deaths", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeI PVP_Assists = new GameAttributeI(701, 0, -1, 0, 1, "", "", "PVP_Assists", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeI PVP_Progression_Points_Gained = new GameAttributeI(702, 0, -1, 0, 1, "", "", "PVP_Progression_Points_Gained", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeI PVP_Current_Kill_Streak = new GameAttributeI(703, 0, -1, 0, 1, "", "", "PVP_Current_Kill_Streak", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeI PVP_Current_Death_Streak = new GameAttributeI(704, 0, -1, 0, 1, "", "", "PVP_Current_Death_Streak", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeI PVP_Longest_Kill_Streak = new GameAttributeI(705, 0, -1, 0, 1, "", "", "PVP_Longest_Kill_Streak", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeI PVP_Longest_Death_Streak = new GameAttributeI(706, 0, -1, 0, 1, "", "", "PVP_Longest_Death_Streak", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeF Turn_Rate_Scalar = new GameAttributeF(707, 1065353216, -1, 5, 0, "", "", "Turn_Rate_Scalar", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeF Turn_Accel_Scalar = new GameAttributeF(708, 1065353216, -1, 5, 0, "", "", "Turn_Accel_Scalar", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeF Turn_Deccel_Scalar = new GameAttributeF(709, 1065353216, -1, 5, 0, "", "", "Turn_Deccel_Scalar", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeB No_Health_Drop = new GameAttributeB(710, 0, -1, 1, 1, "", "", "No_Health_Drop", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Leader = new GameAttributeB(711, 0, -1, 1, 1, "", "", "Leader", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB IsContentRestrictedActor = new GameAttributeB(712, 0, -1, 1, 1, "", "", "IsContentRestrictedActor", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB InBossEncounter = new GameAttributeB(713, 0, -1, 1, 1, "", "", "InBossEncounter", GameAttributeEncoding.IntMinMax, 1, 0, 1, 1); +public static readonly GameAttributeB God = new GameAttributeB(714, 0, -1, 1, 1, "", "", "God", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB MinimapActive = new GameAttributeB(715, 0, -1, 1, 1, "", "", "MinimapActive", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI MinimapIconOverride = new GameAttributeI(716, -1, -1, 0, 1, "", "", "MinimapIconOverride", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeB MinimapDisableArrow = new GameAttributeB(717, 0, -1, 1, 1, "", "", "MinimapDisableArrow", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Last_Blocked_ACD = new GameAttributeI(718, -1, -1, 3, 1, "", "", "Last_Blocked_ACD", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Last_Blocked_Time = new GameAttributeI(719, 0, -1, 1, 1, "", "", "Last_Blocked_Time", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeB Deactivate_Lure = new GameAttributeB(720, 0, -1, 1, 1, "", "", "Deactivate Lure", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Weapons_Hidden = new GameAttributeB(721, 0, -1, 1, 1, "", "", "Weapons_Hidden", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Actor_Updates_Attributes_From_Owner = new GameAttributeB(722, 0, -1, 1, 1, "", "", "Actor_Updates_Attributes_From_Owner", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeI Taunt_Target_ACD = new GameAttributeI(723, -1, -1, 1, 1, "", "", "Taunt_Target_ACD", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeF UI_Only_Percent_Damage_Increase = new GameAttributeF(724, 0, -1, 0, 0, "", "", "UI_Only_Percent_Damage_Increase", GameAttributeEncoding.Float16, 1, 0, 0, 16); +public static readonly GameAttributeI Projectile_Effect_SNO = new GameAttributeI(725, -1, -1, 3, 1, "", "", "Projectile_Effect_SNO", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeF On_Hit_Fear_Proc_Chance = new GameAttributeF(726, 0, -1, 7, 0, "", "", "On_Hit_Fear_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF On_Hit_Stun_Proc_Chance = new GameAttributeF(727, 0, -1, 7, 0, "", "", "On_Hit_Stun_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF On_Hit_Blind_Proc_Chance = new GameAttributeF(728, 0, -1, 7, 0, "", "", "On_Hit_Blind_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF On_Hit_Freeze_Proc_Chance = new GameAttributeF(729, 0, -1, 7, 0, "", "", "On_Hit_Freeze_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF On_Hit_Chill_Proc_Chance = new GameAttributeF(730, 0, -1, 7, 0, "", "", "On_Hit_Chill_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF On_Hit_Slow_Proc_Chance = new GameAttributeF(731, 0, -1, 7, 0, "", "", "On_Hit_Slow_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF On_Hit_Immobilize_Proc_Chance = new GameAttributeF(732, 0, -1, 7, 0, "", "", "On_Hit_Immobilize_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF On_Hit_Knockback_Proc_Chance = new GameAttributeF(733, 0, -1, 7, 0, "", "", "On_Hit_Knockback_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF On_Hit_Bleed_Proc_Chance = new GameAttributeF(734, 0, -1, 7, 0, "", "", "On_Hit_Bleed_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF On_Hit_Bleed_Proc_Damage_Base = new GameAttributeF(735, 0, -1, 0, 0, "", "", "On_Hit_Bleed_Proc_Damage_Base", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF On_Hit_Bleed_Proc_Damage_Delta = new GameAttributeF(736, 0, -1, 0, 0, "", "", "On_Hit_Bleed_Proc_Damage_Delta", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_Percent_Reduction_From_Ranged = new GameAttributeF(737, 0, -1, 7, 0, "", "", "Damage_Percent_Reduction_From_Ranged", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Damage_Percent_Reduction_From_Melee = new GameAttributeF(738, 0, -1, 7, 0, "", "", "Damage_Percent_Reduction_From_Melee", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Damage_Percent_Reduction_Turns_Into_Heal = new GameAttributeF(739, 0, -1, 7, 0, "", "", "Damage_Percent_Reduction_Turns_Into_Heal", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Damage_Percent_Reduction_From_Elites = new GameAttributeF(740, 0, -1, 7, 0, "", "", "Damage_Percent_Reduction_From_Elites", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Damage_Percent_Reduction_From_Type = new GameAttributeF(741, 0, 0, 7, 0, "", "", "Damage_Percent_Reduction_From_Type", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Damage_Percent_Bonus_Vs_Monster_Type = new GameAttributeF(742, 0, 18, 7, 0, "", "", "Damage_Percent_Bonus_Vs_Monster_Type", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Damage_Percent_Bonus_Vs_Elites = new GameAttributeF(743, 0, -1, 7, 0, "", "", "Damage_Percent_Bonus_Vs_Elites", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeI Item_Manipulation_Timeout = new GameAttributeI(744, 0, -1, 4, 1, "", "", "Item_Manipulation_Timeout", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Picked_Up_Time = new GameAttributeI(745, 0, -1, 4, 1, "", "", "Picked_Up_Time", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Unequipped_Time = new GameAttributeI(746, 1, 19, 4, 1, "", "", "Unequipped Time", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeI Last_ACD_Killed_Time = new GameAttributeI(747, 0, -1, 4, 1, "", "", "Last_ACD_Killed_Time", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeB CannotDieDuring = new GameAttributeB(748, 0, -1, 1, 1, "", "", "CannotDieDuring", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeF Weapon_On_Hit_Fear_Proc_Chance = new GameAttributeF(749, 0, -1, 7, 0, "", "", "Weapon_On_Hit_Fear_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Stun_Proc_Chance = new GameAttributeF(750, 0, -1, 7, 0, "", "", "Weapon_On_Hit_Stun_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Blind_Proc_Chance = new GameAttributeF(751, 0, -1, 7, 0, "", "", "Weapon_On_Hit_Blind_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Freeze_Proc_Chance = new GameAttributeF(752, 0, -1, 7, 0, "", "", "Weapon_On_Hit_Freeze_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Chill_Proc_Chance = new GameAttributeF(753, 0, -1, 7, 0, "", "", "Weapon_On_Hit_Chill_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Slow_Proc_Chance = new GameAttributeF(754, 0, -1, 7, 0, "", "", "Weapon_On_Hit_Slow_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Immobilize_Proc_Chance = new GameAttributeF(755, 0, -1, 7, 0, "", "", "Weapon_On_Hit_Immobilize_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Knockback_Proc_Chance = new GameAttributeF(756, 0, -1, 7, 0, "", "", "Weapon_On_Hit_Knockback_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Bleed_Proc_Chance = new GameAttributeF(757, 0, -1, 7, 0, "", "", "Weapon_On_Hit_Bleed_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Bleed_Proc_Damage_Base = new GameAttributeF(758, 0, -1, 0, 0, "", "", "Weapon_On_Hit_Bleed_Proc_Damage_Base", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Weapon_On_Hit_Bleed_Proc_Damage_Delta = new GameAttributeF(759, 0, -1, 0, 0, "", "", "Weapon_On_Hit_Bleed_Proc_Damage_Delta", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Weapon_On_Hit_Fear_Proc_Chance_MainHand = new GameAttributeF(760, 0, -1, 7, 0, "(Held_In_OffHand ? 0 : Weapon_On_Hit_Fear_Proc_Chance )", "", "Weapon_On_Hit_Fear_Proc_Chance_MainHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Fear_Proc_Chance_OffHand = new GameAttributeF(761, 0, -1, 7, 0, "(Held_In_OffHand ? Weapon_On_Hit_Fear_Proc_Chance : 0)", "", "Weapon_On_Hit_Fear_Proc_Chance_OffHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Fear_Proc_Chance_CurrentHand = new GameAttributeF(762, 0, -1, 7, 0, "", "(DualWield_Hand ? Weapon_On_Hit_Fear_Proc_Chance_OffHand : Weapon_On_Hit_Fear_Proc_Chance_MainHand)", "Weapon_On_Hit_Fear_Proc_Chance_CurrentHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Stun_Proc_Chance_MainHand = new GameAttributeF(763, 0, -1, 7, 0, "(Held_In_OffHand ? 0 : Weapon_On_Hit_Stun_Proc_Chance )", "", "Weapon_On_Hit_Stun_Proc_Chance_MainHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Stun_Proc_Chance_OffHand = new GameAttributeF(764, 0, -1, 7, 0, "(Held_In_OffHand ? Weapon_On_Hit_Stun_Proc_Chance : 0)", "", "Weapon_On_Hit_Stun_Proc_Chance_OffHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Stun_Proc_Chance_CurrentHand = new GameAttributeF(765, 0, -1, 7, 0, "", "(DualWield_Hand ? Weapon_On_Hit_Stun_Proc_Chance_OffHand : Weapon_On_Hit_Stun_Proc_Chance_MainHand)", "Weapon_On_Hit_Stun_Proc_Chance_CurrentHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Blind_Proc_Chance_MainHand = new GameAttributeF(766, 0, -1, 7, 0, "(Held_In_OffHand ? 0 : Weapon_On_Hit_Blind_Proc_Chance )", "", "Weapon_On_Hit_Blind_Proc_Chance_MainHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Blind_Proc_Chance_OffHand = new GameAttributeF(767, 0, -1, 7, 0, "(Held_In_OffHand ? Weapon_On_Hit_Blind_Proc_Chance : 0)", "", "Weapon_On_Hit_Blind_Proc_Chance_OffHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Blind_Proc_Chance_CurrentHand = new GameAttributeF(768, 0, -1, 7, 0, "", "(DualWield_Hand ? Weapon_On_Hit_Blind_Proc_Chance_OffHand : Weapon_On_Hit_Blind_Proc_Chance_MainHand)", "Weapon_On_Hit_Blind_Proc_Chance_CurrentHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Freeze_Proc_Chance_MainHand = new GameAttributeF(769, 0, -1, 7, 0, "(Held_In_OffHand ? 0 : Weapon_On_Hit_Freeze_Proc_Chance )", "", "Weapon_On_Hit_Freeze_Proc_Chance_MainHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Freeze_Proc_Chance_OffHand = new GameAttributeF(770, 0, -1, 7, 0, "(Held_In_OffHand ? Weapon_On_Hit_Freeze_Proc_Chance : 0)", "", "Weapon_On_Hit_Freeze_Proc_Chance_OffHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Freeze_Proc_Chance_CurrentHand = new GameAttributeF(771, 0, -1, 7, 0, "", "(DualWield_Hand ? Weapon_On_Hit_Freeze_Proc_Chance_OffHand : Weapon_On_Hit_Freeze_Proc_Chance_MainHand)", "Weapon_On_Hit_Freeze_Proc_Chance_CurrentHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Chill_Proc_Chance_MainHand = new GameAttributeF(772, 0, -1, 7, 0, "(Held_In_OffHand ? 0 : Weapon_On_Hit_Chill_Proc_Chance )", "", "Weapon_On_Hit_Chill_Proc_Chance_MainHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Chill_Proc_Chance_OffHand = new GameAttributeF(773, 0, -1, 7, 0, "(Held_In_OffHand ? Weapon_On_Hit_Chill_Proc_Chance : 0)", "", "Weapon_On_Hit_Chill_Proc_Chance_OffHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Chill_Proc_Chance_CurrentHand = new GameAttributeF(774, 0, -1, 7, 0, "", "(DualWield_Hand ? Weapon_On_Hit_Chill_Proc_Chance_OffHand : Weapon_On_Hit_Chill_Proc_Chance_MainHand)", "Weapon_On_Hit_Chill_Proc_Chance_CurrentHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Slow_Proc_Chance_MainHand = new GameAttributeF(775, 0, -1, 7, 0, "(Held_In_OffHand ? 0 : Weapon_On_Hit_Slow_Proc_Chance )", "", "Weapon_On_Hit_Slow_Proc_Chance_MainHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Slow_Proc_Chance_OffHand = new GameAttributeF(776, 0, -1, 7, 0, "(Held_In_OffHand ? Weapon_On_Hit_Slow_Proc_Chance : 0)", "", "Weapon_On_Hit_Slow_Proc_Chance_OffHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Slow_Proc_Chance_CurrentHand = new GameAttributeF(777, 0, -1, 7, 0, "", "(DualWield_Hand ? Weapon_On_Hit_Slow_Proc_Chance_OffHand : Weapon_On_Hit_Slow_Proc_Chance_MainHand)", "Weapon_On_Hit_Slow_Proc_Chance_CurrentHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Immobilize_Proc_Chance_MainHand = new GameAttributeF(778, 0, -1, 7, 0, "(Held_In_OffHand ? 0 : Weapon_On_Hit_Immobilize_Proc_Chance )", "", "Weapon_On_Hit_Immobilize_Proc_Chance_MainHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Immobilize_Proc_Chance_OffHand = new GameAttributeF(779, 0, -1, 7, 0, "(Held_In_OffHand ? Weapon_On_Hit_Immobilize_Proc_Chance : 0)", "", "Weapon_On_Hit_Immobilize_Proc_Chance_OffHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Immobilize_Proc_Chance_CurrentHand = new GameAttributeF(780, 0, -1, 7, 0, "", "(DualWield_Hand ? Weapon_On_Hit_Immobilize_Proc_Chance_OffHand : Weapon_On_Hit_Immobilize_Proc_Chance_MainHand)", "Weapon_On_Hit_Immobilize_Proc_Chance_CurrentHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Knockback_Proc_Chance_MainHand = new GameAttributeF(781, 0, -1, 7, 0, "(Held_In_OffHand ? 0 : Weapon_On_Hit_Knockback_Proc_Chance )", "", "Weapon_On_Hit_Knockback_Proc_Chance_MainHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Knockback_Proc_Chance_OffHand = new GameAttributeF(782, 0, -1, 7, 0, "(Held_In_OffHand ? Weapon_On_Hit_Knockback_Proc_Chance : 0)", "", "Weapon_On_Hit_Knockback_Proc_Chance_OffHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Knockback_Proc_Chance_CurrentHand = new GameAttributeF(783, 0, -1, 7, 0, "", "(DualWield_Hand ? Weapon_On_Hit_Knockback_Proc_Chance_OffHand : Weapon_On_Hit_Knockback_Proc_Chance_MainHand)", "Weapon_On_Hit_Knockback_Proc_Chance_CurrentHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Bleed_Proc_Chance_MainHand = new GameAttributeF(784, 0, -1, 7, 0, "(Held_In_OffHand ? 0 : Weapon_On_Hit_Bleed_Proc_Chance )", "", "Weapon_On_Hit_Bleed_Proc_Chance_MainHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Bleed_Proc_Chance_OffHand = new GameAttributeF(785, 0, -1, 7, 0, "(Held_In_OffHand ? Weapon_On_Hit_Bleed_Proc_Chance : 0)", "", "Weapon_On_Hit_Bleed_Proc_Chance_OffHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Bleed_Proc_Chance_CurrentHand = new GameAttributeF(786, 0, -1, 7, 0, "", "(DualWield_Hand ? Weapon_On_Hit_Bleed_Proc_Chance_OffHand : Weapon_On_Hit_Bleed_Proc_Chance_MainHand)", "Weapon_On_Hit_Bleed_Proc_Chance_CurrentHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_On_Hit_Bleed_Proc_Damage_Base_MainHand = new GameAttributeF(787, 0, -1, 0, 0, "(Held_In_OffHand ? 0 : Weapon_On_Hit_Bleed_Proc_Damage_Base )", "", "Weapon_On_Hit_Bleed_Proc_Damage_Base_MainHand", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Weapon_On_Hit_Bleed_Proc_Damage_Base_OffHand = new GameAttributeF(788, 0, -1, 0, 0, "(Held_In_OffHand ? Weapon_On_Hit_Bleed_Proc_Damage_Base : 0)", "", "Weapon_On_Hit_Bleed_Proc_Damage_Base_OffHand", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Weapon_On_Hit_Bleed_Proc_Damage_Base_CurrentHand = new GameAttributeF(789, 0, -1, 0, 0, "", "(DualWield_Hand ? Weapon_On_Hit_Bleed_Proc_Damage_Base_OffHand : Weapon_On_Hit_Bleed_Proc_Damage_Base_MainHand)", "Weapon_On_Hit_Bleed_Proc_Damage_Base_CurrentHand", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Weapon_On_Hit_Bleed_Proc_Damage_Delta_MainHand = new GameAttributeF(790, 0, -1, 0, 0, "(Held_In_OffHand ? 0 : Weapon_On_Hit_Bleed_Proc_Damage_Delta )", "", "Weapon_On_Hit_Bleed_Proc_Damage_Delta_MainHand", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Weapon_On_Hit_Bleed_Proc_Damage_Delta_OffHand = new GameAttributeF(791, 0, -1, 0, 0, "(Held_In_OffHand ? Weapon_On_Hit_Bleed_Proc_Damage_Delta : 0)", "", "Weapon_On_Hit_Bleed_Proc_Damage_Delta_OffHand", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Weapon_On_Hit_Bleed_Proc_Damage_Delta_CurrentHand = new GameAttributeF(792, 0, -1, 0, 0, "", "(DualWield_Hand ? Weapon_On_Hit_Bleed_Proc_Damage_Delta_OffHand : Weapon_On_Hit_Bleed_Proc_Damage_Delta_MainHand)", "Weapon_On_Hit_Bleed_Proc_Damage_Delta_CurrentHand", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Power_Damage_Percent_Bonus = new GameAttributeF(793, 0, 4, 0, 0, "", "", "Power_Damage_Percent_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Power_Resource_Reduction = new GameAttributeF(794, 0, 4, 0, 0, "", "", "Power_Resource_Reduction", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Power_Cooldown_Reduction = new GameAttributeF(795, 0, 4, 0, 0, "", "", "Power_Cooldown_Reduction", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Power_Duration_Increase = new GameAttributeF(796, 0, 4, 0, 0, "", "", "Power_Duration_Increase", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Power_Crit_Percent_Bonus = new GameAttributeF(797, 0, 4, 0, 0, "", "", "Power_Crit_Percent_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_Crit_Chance = new GameAttributeF(798, 0, -1, 7, 0, "", "", "Weapon_Crit_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_Crit_Chance_MainHand = new GameAttributeF(799, 0, -1, 7, 0, "(Held_In_OffHand ? 0 : Weapon_Crit_Chance )", "", "Weapon_Crit_Chance_MainHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_Crit_Chance_OffHand = new GameAttributeF(800, 0, -1, 7, 0, "(Held_In_OffHand ? Weapon_Crit_Chance : 0)", "", "Weapon_Crit_Chance_OffHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Weapon_Crit_Chance_CurrentHand = new GameAttributeF(801, 0, -1, 7, 0, "", "(DualWield_Hand ? Weapon_Crit_Chance_OffHand : Weapon_Crit_Chance_MainHand)", "Weapon_Crit_Chance_CurrentHand", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Strength_Item = new GameAttributeF(802, 0, -1, 0, 0, "", "", "Strength_Item", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Dexterity_Item = new GameAttributeF(803, 0, -1, 0, 0, "", "", "Dexterity_Item", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Intelligence_Item = new GameAttributeF(804, 0, -1, 0, 0, "", "", "Intelligence_Item", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeF Vitality_Item = new GameAttributeF(805, 0, -1, 0, 0, "", "", "Vitality_Item", GameAttributeEncoding.Float32, 9, 0, 0, 32); +public static readonly GameAttributeI Item_Level_Requirement_Reduction = new GameAttributeI(806, 0, -1, 0, 1, "", "", "Item_Level_Requirement_Reduction", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeF Item_Durability_Percent_Bonus = new GameAttributeF(807, 0, -1, 0, 0, "", "", "Item_Durability_Percent_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeB Item_Indestructible = new GameAttributeB(808, 0, -1, 1, 1, "", "", "Item_Indestructible", GameAttributeEncoding.IntMinMax, 8, 0, 1, 1); +public static readonly GameAttributeF Core_Attributes_From_Item_Bonus_Multiplier = new GameAttributeF(809, 1065353216, -1, 1, 0, "", "", "Core_Attributes_From_Item_Bonus_Multiplier", GameAttributeEncoding.Float32, 1, 0, 0, 32); +public static readonly GameAttributeB Waiting_To_Accept_Resurrection = new GameAttributeB(810, 0, -1, 1, 1, "", "", "Waiting_To_Accept_Resurrection", GameAttributeEncoding.IntMinMax, 1, 0, 1, 1); +public static readonly GameAttributeB Ghosted = new GameAttributeB(811, 0, -1, 1, 1, "", "", "Ghosted", GameAttributeEncoding.IntMinMax, 1, 0, 1, 1); +public static readonly GameAttributeB Special_Inventory_Has_Sold = new GameAttributeB(812, 0, -1, 1, 1, "", "", "Special_Inventory_Has_Sold", GameAttributeEncoding.IntMinMax, 2, 0, 1, 1); +public static readonly GameAttributeI Power_Channel_Lockout_Time = new GameAttributeI(813, 0, -1, 4, 1, "", "", "Power_Channel_Lockout_Time", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Power_Buff_0_Lockout_Time = new GameAttributeI(814, 0, 4, 4, 1, "", "", "Power_Buff_0_Lockout_Time", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Power_Buff_1_Lockout_Time = new GameAttributeI(815, 0, 4, 4, 1, "", "", "Power_Buff_1_Lockout_Time", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Power_Buff_2_Lockout_Time = new GameAttributeI(816, 0, 4, 4, 1, "", "", "Power_Buff_2_Lockout_Time", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Power_Buff_3_Lockout_Time = new GameAttributeI(817, 0, 4, 4, 1, "", "", "Power_Buff_3_Lockout_Time", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Power_Buff_4_Lockout_Time = new GameAttributeI(818, 0, 4, 4, 1, "", "", "Power_Buff_4_Lockout_Time", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Power_Buff_5_Lockout_Time = new GameAttributeI(819, 0, 4, 4, 1, "", "", "Power_Buff_5_Lockout_Time", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Power_Buff_6_Lockout_Time = new GameAttributeI(820, 0, 4, 4, 1, "", "", "Power_Buff_6_Lockout_Time", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Power_Buff_7_Lockout_Time = new GameAttributeI(821, 0, 4, 4, 1, "", "", "Power_Buff_7_Lockout_Time", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Known_By_Owner = new GameAttributeI(822, -1, -1, 4, 1, "", "", "Known_By_Owner", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeB Never_Deactivates = new GameAttributeB(823, 0, -1, 1, 1, "", "", "Never_Deactivates", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Account_Under_Review = new GameAttributeB(824, 0, -1, 1, 1, "", "", "Account_Under_Review", GameAttributeEncoding.IntMinMax, 1, 0, 1, 1); +public static readonly GameAttributeI Projectile_Detonate_Time = new GameAttributeI(825, 0, -1, 4, 1, "", "", "Projectile_Detonate_Time", GameAttributeEncoding.Int, 64, 0, 0, 32); +} diff --git a/src/tools/GameServer/TypeExtractor/attributes.xml b/src/tools/GameServer/TypeExtractor/attributes.xml new file mode 100644 index 00000000..c748cab1 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/attributes.xml @@ -0,0 +1,829 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/tools/GameServer/TypeExtractor/classgenerator-output.cs b/src/tools/GameServer/TypeExtractor/classgenerator-output.cs new file mode 100644 index 00000000..c95584b7 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/classgenerator-output.cs @@ -0,0 +1,5354 @@ + public class EndOfTickMessage : GameMessage + { + public int Field0; + public int Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + } + + } + + public class CreateHeroResultMessage : GameMessage + { + int _Field0; + public int Field0 { get { return _Field0; } set { if(value < -1 || value > 2) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + public EntityId Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(2) + (-1); + Field1 = new EntityId(); + Field1.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(2, Field0 - (-1)); + Field1.Encode(buffer); + } + + } + + public class EntityId + { + public long Field0; + public long Field1; + + public void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt64(64); + Field1 = buffer.ReadInt64(64); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt64(64, Field0); + buffer.WriteInt64(64, Field1); + } + + } + + public class CreateHeroMessage : GameMessage + { + public string _Field0; + public string Field0 { get { return _Field0; } set { if(value != null && value.Length > 49) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + public int Field1; + int _Field2; + public int Field2 { get { return _Field2; } set { if(value < 0 || value > 0x3FFFFFFF) throw new ArgumentOutOfRangeException(); _Field2 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadCharArray(49); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(30); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteCharArray(49, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(30, Field2); + } + + } + + public class JoinBNetGameMessage : GameMessage + { + public EntityId Field0; + public GameId Field1; + public int Field2; + public long Field3; + int _Field4; + public int Field4 { get { return _Field4; } set { if(value < 2 || value > 17) throw new ArgumentOutOfRangeException(); _Field4 = value; } } + public int Field5; + public int Field6; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = new EntityId(); + Field0.Parse(buffer); + Field1 = new GameId(); + Field1.Parse(buffer); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadInt64(64); + Field4 = buffer.ReadInt(4) + (2); + Field5 = buffer.ReadInt(32); + Field6 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + Field0.Encode(buffer); + Field1.Encode(buffer); + buffer.WriteInt(32, Field2); + buffer.WriteInt64(64, Field3); + buffer.WriteInt(4, Field4 - (2)); + buffer.WriteInt(32, Field5); + buffer.WriteInt(32, Field6); + } + + } + + public class GameId + { + public long Field0; + public long Field1; + public long Field2; + + public void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt64(64); + Field1 = buffer.ReadInt64(64); + Field2 = buffer.ReadInt64(64); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt64(64, Field0); + buffer.WriteInt64(64, Field1); + buffer.WriteInt64(64, Field2); + } + + } + + public class BNetJoinGameRequestResultMessage : GameMessage + { + int _Field0; + public int Field0 { get { return _Field0; } set { if(value < -1 || value > 5) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + public GameId Field1; + public long Field2; + int _Field3; + public int Field3 { get { return _Field3; } set { if(value < -1 || value > 5) throw new ArgumentOutOfRangeException(); _Field3 = value; } } + public int Field4; + int _Field5; + public int Field5 { get { return _Field5; } set { if(value < 0 || value > 0xFFFF) throw new ArgumentOutOfRangeException(); _Field5 = value; } } + public int Field6; + public ushort Field7; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(3) + (-1); + Field1 = new GameId(); + Field1.Parse(buffer); + Field2 = buffer.ReadInt64(64); + Field3 = buffer.ReadInt(3) + (-1); + Field4 = buffer.ReadInt(32); + Field5 = buffer.ReadInt(16); + Field6 = buffer.ReadInt(32); + Field7 = (ushort)buffer.ReadInt(16); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(3, Field0 - (-1)); + Field1.Encode(buffer); + buffer.WriteInt64(64, Field2); + buffer.WriteInt(3, Field3 - (-1)); + buffer.WriteInt(32, Field4); + buffer.WriteInt(16, Field5); + buffer.WriteInt(32, Field6); + buffer.WriteInt(16, Field7); + } + + } + + public class RequestJoinBNetGameMessage : GameMessage + { + public GameId Field0; + public EntityId Field1; + int _Field2; + public int Field2 { get { return _Field2; } set { if(value < -1 || value > 22) throw new ArgumentOutOfRangeException(); _Field2 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = new GameId(); + Field0.Parse(buffer); + Field1 = new EntityId(); + Field1.Parse(buffer); + Field2 = buffer.ReadInt(5) + (-1); + } + + public override void Encode(GameBitBuffer buffer) + { + Field0.Encode(buffer); + Field1.Encode(buffer); + buffer.WriteInt(5, Field2 - (-1)); + } + + } + + public class CreateBNetGameResultMessage : GameMessage + { + int _Field0; + public int Field0 { get { return _Field0; } set { if(value < 0 || value > 2) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + public GameId Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(2); + Field1 = new GameId(); + Field1.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(2, Field0); + Field1.Encode(buffer); + } + + } + + public class CreateBNetGameMessage : GameMessage + { + public string _Field0; + public string Field0 { get { return _Field0; } set { if(value != null && value.Length > 33) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + int _Field1; + public int Field1 { get { return _Field1; } set { if(value < -1 || value > 5) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + public int Field2; + public int Field3; + public int Field4; + public bool Field5; + public int Field6; + int _Field7; + public int Field7 { get { return _Field7; } set { if(value < 0 || value > 0xFFFF) throw new ArgumentOutOfRangeException(); _Field7 = value; } } + int _Field8; + public int Field8 { get { return _Field8; } set { if(value < 1 || value > 8) throw new ArgumentOutOfRangeException(); _Field8 = value; } } + public int Field9; + public int Field10; + public ushort Field11; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadCharArray(33); + Field1 = buffer.ReadInt(3) + (-1); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadInt(32); + Field4 = buffer.ReadInt(32); + Field5 = buffer.ReadBool(); + Field6 = buffer.ReadInt(32); + Field7 = buffer.ReadInt(16); + Field8 = buffer.ReadInt(3) + (1); + Field9 = buffer.ReadInt(32); + Field10 = buffer.ReadInt(32); + Field11 = (ushort)buffer.ReadInt(16); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteCharArray(33, Field0); + buffer.WriteInt(3, Field1 - (-1)); + buffer.WriteInt(32, Field2); + buffer.WriteInt(32, Field3); + buffer.WriteInt(32, Field4); + buffer.WriteBool(Field5); + buffer.WriteInt(32, Field6); + buffer.WriteInt(16, Field7); + buffer.WriteInt(3, Field8 - (1)); + buffer.WriteInt(32, Field9); + buffer.WriteInt(32, Field10); + buffer.WriteInt(16, Field11); + } + + } + + public class EffectGroupACDToACDMessage : GameMessage + { + public int Field0; + public int Field1; + public int Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + } + + } + + public class RopeEffectMessageACDToPlace : GameMessage + { + public int Field0; + public int Field1; + int _Field2; + public int Field2 { get { return _Field2; } set { if(value < 0 || value > 19) throw new ArgumentOutOfRangeException(); _Field2 = value; } } + public WorldPlace Field3; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(5); + Field3 = new WorldPlace(); + Field3.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(5, Field2); + Field3.Encode(buffer); + } + + } + + public class WorldPlace + { + public Vector3D Field0; + public int Field1; + + public void Parse(GameBitBuffer buffer) + { + Field0 = new Vector3D(); + Field0.Parse(buffer); + Field1 = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + Field0.Encode(buffer); + buffer.WriteInt(32, Field1); + } + + } + + public class Vector3D + { + public float Field0; + public float Field1; + public float Field2; + + public void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadFloat32(); + Field1 = buffer.ReadFloat32(); + Field2 = buffer.ReadFloat32(); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteFloat32(Field0); + buffer.WriteFloat32(Field1); + buffer.WriteFloat32(Field2); + } + + } + + public class RopeEffectMessageACDToACD : GameMessage + { + public int Field0; + public int Field1; + int _Field2; + public int Field2 { get { return _Field2; } set { if(value < 0 || value > 19) throw new ArgumentOutOfRangeException(); _Field2 = value; } } + public int Field3; + int _Field4; + public int Field4 { get { return _Field4; } set { if(value < 0 || value > 19) throw new ArgumentOutOfRangeException(); _Field4 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(5); + Field3 = buffer.ReadInt(32); + Field4 = buffer.ReadInt(5); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(5, Field2); + buffer.WriteInt(32, Field3); + buffer.WriteInt(5, Field4); + } + + } + + public class PlayMusicMessage : GameMessage + { + public int snoMusic; + + public override void Parse(GameBitBuffer buffer) + { + snoMusic = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, snoMusic); + } + + } + + public class PlayNonPositionalSoundMessage : GameMessage + { + public int Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + } + + } + + public class PlayHitEffectOverrideMessage : GameMessage + { + public int Field0; + public int Field1; + public int Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + } + + } + + public class PlayHitEffectMessage : GameMessage + { + public int Field0; + public int Field1; + int _Field2; + public int Field2 { get { return _Field2; } set { if(value < -1 || value > 6) throw new ArgumentOutOfRangeException(); _Field2 = value; } } + public bool Field3; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(3) + (-1); + Field3 = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(3, Field2 - (-1)); + buffer.WriteBool(Field3); + } + + } + + public class PlayEffectMessage : GameMessage + { + public int Field0; + int _Field1; + public int Field1 { get { return _Field1; } set { if(value < -1 || value > 70) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + public int? Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(7) + (-1); + if(buffer.ReadBool()) + Field2 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(7, Field1 - (-1)); + if(Field2.HasValue) + buffer.WriteInt(32, Field2.Value); + } + + } + + public class EndConversationMessage : GameMessage + { + public int Field0; + public int Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + } + + } + + public class StopConvLineMessage : GameMessage + { + public int Field0; + public bool Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteBool(Field1); + } + + } + + public class UpdateConvAutoAdvanceMessage : GameMessage + { + public int Field0; + public int Field1; + public int Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + } + + } + + public class AdvanceConvMessage : GameMessage + { + public int Field0; + public int Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + } + + } + + public class PlayConvLineMessage : GameMessage + { + public int Field0; + int[] _Field1; + public int[] Field1 { get { return _Field1; } set { if(value != null && value.Length != 9) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + public PlayLineParams Field2; + public int Field3; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = new int[9]; + for(int i = 0;i < _Field1.Length;i++) _Field1[i] = buffer.ReadInt(32); + Field2 = new PlayLineParams(); + Field2.Parse(buffer); + Field3 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + for(int i = 0;i < _Field1.Length;i++) buffer.WriteInt(32, _Field1[i]); + Field2.Encode(buffer); + buffer.WriteInt(32, Field3); + } + + } + + public class PlayLineParams + { + public int snoConversation; + public int Field1; + public bool Field2; + public bool Field3; + public bool Field4; + public int Field5; + public int Field6; + public int Field7; + public int Field8; + public int snoSpeakerActor; + public int Field10; + public int Field11; + public string _Field12; + public string Field12 { get { return _Field12; } set { if(value != null && value.Length > 49) throw new ArgumentOutOfRangeException(); _Field12 = value; } } + public int Field13; + public int Field14; + public int Field15; + public int Field16; + public int Field17; + + public void Parse(GameBitBuffer buffer) + { + snoConversation = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadBool(); + Field3 = buffer.ReadBool(); + Field4 = buffer.ReadBool(); + Field5 = buffer.ReadInt(32); + Field6 = buffer.ReadInt(32); + Field7 = buffer.ReadInt(32); + Field8 = buffer.ReadInt(32); + snoSpeakerActor = buffer.ReadInt(32); + Field10 = buffer.ReadInt(32); + Field11 = buffer.ReadInt(32); + Field12 = buffer.ReadCharArray(49); + Field13 = buffer.ReadInt(32); + Field14 = buffer.ReadInt(32); + Field15 = buffer.ReadInt(32); + Field16 = buffer.ReadInt(32); + Field17 = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, snoConversation); + buffer.WriteInt(32, Field1); + buffer.WriteBool(Field2); + buffer.WriteBool(Field3); + buffer.WriteBool(Field4); + buffer.WriteInt(32, Field5); + buffer.WriteInt(32, Field6); + buffer.WriteInt(32, Field7); + buffer.WriteInt(32, Field8); + buffer.WriteInt(32, snoSpeakerActor); + buffer.WriteInt(32, Field10); + buffer.WriteInt(32, Field11); + buffer.WriteCharArray(49, Field12); + buffer.WriteInt(32, Field13); + buffer.WriteInt(32, Field14); + buffer.WriteInt(32, Field15); + buffer.WriteInt(32, Field16); + buffer.WriteInt(32, Field17); + } + + } + + public class TimedEventStartedMessage : GameMessage + { + public ActiveEvent Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = new ActiveEvent(); + Field0.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + Field0.Encode(buffer); + } + + } + + public class ActiveEvent + { + public int snoTimedEvent; + public int Field1; + public int Field2; + + public void Parse(GameBitBuffer buffer) + { + snoTimedEvent = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, snoTimedEvent); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + } + + } + + public class ActTransitionStartedMessage : GameMessage + { + public int Field0; + public int Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + } + + } + + public class PortalSpecifierMessage : GameMessage + { + public int Field0; + public ResolvedPortalDestination Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = new ResolvedPortalDestination(); + Field1.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + Field1.Encode(buffer); + } + + } + + public class ResolvedPortalDestination + { + public int snoWorld; + public int Field1; + public int snoDestLevelArea; + + public void Parse(GameBitBuffer buffer) + { + snoWorld = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + snoDestLevelArea = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, snoWorld); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, snoDestLevelArea); + } + + } + + public class AttributesSetValuesMessage : GameMessage + { + public int Field0; + NetAttributeKeyValue[] _atKeyVals; + public NetAttributeKeyValue[] atKeyVals { get { return _atKeyVals; } set { if(value != null && value.Length > 15) throw new ArgumentOutOfRangeException(); _atKeyVals = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + atKeyVals = new NetAttributeKeyValue[buffer.ReadInt(4)]; + for(int i = 0;i < _atKeyVals.Length;i++) + { + _atKeyVals[i] = new NetAttributeKeyValue(); + _atKeyVals[i].Parse(buffer); + } + for (int i = 0; i < atKeyVals.Length; i++) { atKeyVals[i].ParseValue(buffer); }; + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(4, _atKeyVals.Length); + for(int i = 0;i < _atKeyVals.Length;i++) _atKeyVals[i].Encode(buffer); + for (int i = 0; i < atKeyVals.Length; i++) { atKeyVals[i].EncodeValue(buffer); }; + } + + } + + public class NetAttributeKeyValue + { + int? _Field0; + public int? Field0 { get { return _Field0; } set { if(value.HasValue && (value.Value < 0 || value.Value > 0xFFFFF)) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + public GameAttribute Field1; + + public float Float; + public int Int; + + public void Parse(GameBitBuffer buffer) + { + if(buffer.ReadBool()) + Field0 = buffer.ReadInt(20); + Field1 = GameAttribute.Attributes[buffer.ReadInt(10)]; + } + + public void Encode(GameBitBuffer buffer) + { + if(Field0.HasValue) + buffer.WriteInt(20, Field0.Value); + buffer.WriteInt(10, Field1.Id); + } + + public void ParseValue(GameBitBuffer buffer) +{ + switch (Field1.EncodingType) + { + case GameAttributeEncoding.Int: + Int = buffer.ReadInt(Field1.BitCount); + break; + case GameAttributeEncoding.IntMinMax: + Int = buffer.ReadInt(Field1.BitCount) + Field1.Min; + break; + case GameAttributeEncoding.Float16: + Float = buffer.ReadFloat16(); + break; + case GameAttributeEncoding.Float16Or32: + Float = buffer.ReadBool() ? buffer.ReadFloat16() : buffer.ReadFloat32(); + break; + default: + throw new Exception("bad voodoo"); + } +} + + public void EncodeValue(GameBitBuffer buffer) +{ + switch (Field1.EncodingType) + { + case GameAttributeEncoding.Int: + buffer.WriteInt(Field1.BitCount, Int); + break; + case GameAttributeEncoding.IntMinMax: + buffer.WriteInt(Field1.BitCount, Int - Field1.Min); + break; + case GameAttributeEncoding.Float16: + buffer.WriteFloat16(Float); + break; + case GameAttributeEncoding.Float16Or32: + if (Float >= 65536.0f || -65536.0f >= Float) + { + buffer.WriteBool(false); + buffer.WriteFloat32(Float); + } + else + { + buffer.WriteBool(true); + buffer.WriteFloat16(Float); + } + break; + default: + throw new Exception("bad voodoo"); + } +} + } + + public class AttributeSetValueMessage : GameMessage + { + public int Field0; + public NetAttributeKeyValue Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = new NetAttributeKeyValue(); + Field1.Parse(buffer); + Field1.ParseValue(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + Field1.Encode(buffer); + Field1.EncodeValue(buffer); + } + + } + + public class ACDClientTranslateMessage : GameMessage + { + public int Field0; + int _Field1; + public int Field1 { get { return _Field1; } set { if(value < 0 || value > 12) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + public Vector3D Field2; + public float Field3; + public float Field4; + public int Field5; + int _Field6; + public int Field6 { get { return _Field6; } set { if(value < -1 || value > 0xFFFFF) throw new ArgumentOutOfRangeException(); _Field6 = value; } } + public int? Field7; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(4); + Field2 = new Vector3D(); + Field2.Parse(buffer); + Field3 = buffer.ReadFloat32(); + Field4 = buffer.ReadFloat32(); + Field5 = buffer.ReadInt(32); + Field6 = buffer.ReadInt(21) + (-1); + if(buffer.ReadBool()) + Field7 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(4, Field1); + Field2.Encode(buffer); + buffer.WriteFloat32(Field3); + buffer.WriteFloat32(Field4); + buffer.WriteInt(32, Field5); + buffer.WriteInt(21, Field6 - (-1)); + if(Field7.HasValue) + buffer.WriteInt(32, Field7.Value); + } + + } + + public class ACDTranslateFixedUpdateMessage : GameMessage + { + public int Field0; + public Vector3D Field1; + public Vector3D Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = new Vector3D(); + Field1.Parse(buffer); + Field2 = new Vector3D(); + Field2.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + Field1.Encode(buffer); + Field2.Encode(buffer); + } + + } + + public class ACDTranslateDetPathSpiralMessage : GameMessage + { + public int Field0; + public Vector3D Field1; + public Vector3D Field2; + public int Field3; + public int Field4; + public int Field5; + public DPathSinData Field6; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = new Vector3D(); + Field1.Parse(buffer); + Field2 = new Vector3D(); + Field2.Parse(buffer); + Field3 = buffer.ReadInt(32); + Field4 = buffer.ReadInt(32); + Field5 = buffer.ReadInt(32); + Field6 = new DPathSinData(); + Field6.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + Field1.Encode(buffer); + Field2.Encode(buffer); + buffer.WriteInt(32, Field3); + buffer.WriteInt(32, Field4); + buffer.WriteInt(32, Field5); + Field6.Encode(buffer); + } + + } + + public class DPathSinData + { + public float Field0; + public float Field1; + public float Field2; + public float Field3; + public float Field4; + public float Field5; + + public void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadFloat32(); + Field1 = buffer.ReadFloat32(); + Field2 = buffer.ReadFloat32(); + Field3 = buffer.ReadFloat32(); + Field4 = buffer.ReadFloat32(); + Field5 = buffer.ReadFloat32(); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteFloat32(Field0); + buffer.WriteFloat32(Field1); + buffer.WriteFloat32(Field2); + buffer.WriteFloat32(Field3); + buffer.WriteFloat32(Field4); + buffer.WriteFloat32(Field5); + } + + } + + public class ACDTranslateDetPathSinMessage : GameMessage + { + public int Field0; + int _Field1; + public int Field1 { get { return _Field1; } set { if(value < 0 || value > 8) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + public int Field2; + public int Field3; + public Vector3D Field4; + public float Field5; + public Vector3D Field6; + public int Field7; + public int Field8; + public int Field9; + public int Field10; + public int Field11; + public float Field12; + public float Field13; + public DPathSinData Field14; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(4); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadInt(32); + Field4 = new Vector3D(); + Field4.Parse(buffer); + Field5 = buffer.ReadFloat32(); + Field6 = new Vector3D(); + Field6.Parse(buffer); + Field7 = buffer.ReadInt(32); + Field8 = buffer.ReadInt(32); + Field9 = buffer.ReadInt(32); + Field10 = buffer.ReadInt(32); + Field11 = buffer.ReadInt(32); + Field12 = buffer.ReadFloat32(); + Field13 = buffer.ReadFloat32(); + Field14 = new DPathSinData(); + Field14.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(4, Field1); + buffer.WriteInt(32, Field2); + buffer.WriteInt(32, Field3); + Field4.Encode(buffer); + buffer.WriteFloat32(Field5); + Field6.Encode(buffer); + buffer.WriteInt(32, Field7); + buffer.WriteInt(32, Field8); + buffer.WriteInt(32, Field9); + buffer.WriteInt(32, Field10); + buffer.WriteInt(32, Field11); + buffer.WriteFloat32(Field12); + buffer.WriteFloat32(Field13); + Field14.Encode(buffer); + } + + } + + public class ACDTranslateDetPathMessage : GameMessage + { + public int Field0; + int _Field1; + public int Field1 { get { return _Field1; } set { if(value < 0 || value > 8) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + public int Field2; + public int Field3; + public Vector3D Field4; + public float Field5; + public Vector3D Field6; + public int Field7; + public int Field8; + public int Field9; + public int Field10; + public int Field11; + public float Field12; + public float Field13; + public float Field14; + public float Field15; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(4); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadInt(32); + Field4 = new Vector3D(); + Field4.Parse(buffer); + Field5 = buffer.ReadFloat32(); + Field6 = new Vector3D(); + Field6.Parse(buffer); + Field7 = buffer.ReadInt(32); + Field8 = buffer.ReadInt(32); + Field9 = buffer.ReadInt(32); + Field10 = buffer.ReadInt(32); + Field11 = buffer.ReadInt(32); + Field12 = buffer.ReadFloat32(); + Field13 = buffer.ReadFloat32(); + Field14 = buffer.ReadFloat32(); + Field15 = buffer.ReadFloat32(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(4, Field1); + buffer.WriteInt(32, Field2); + buffer.WriteInt(32, Field3); + Field4.Encode(buffer); + buffer.WriteFloat32(Field5); + Field6.Encode(buffer); + buffer.WriteInt(32, Field7); + buffer.WriteInt(32, Field8); + buffer.WriteInt(32, Field9); + buffer.WriteInt(32, Field10); + buffer.WriteInt(32, Field11); + buffer.WriteFloat32(Field12); + buffer.WriteFloat32(Field13); + buffer.WriteFloat32(Field14); + buffer.WriteFloat32(Field15); + } + + } + + public class ACDTranslateArcMessage : GameMessage + { + public int Field0; + public Vector3D Field1; + public Vector3D Field2; + int _Field3; + public int Field3 { get { return _Field3; } set { if(value < 0 || value > 0x1FFFFFF) throw new ArgumentOutOfRangeException(); _Field3 = value; } } + int _Field4; + public int Field4 { get { return _Field4; } set { if(value < -1 || value > 0xFFFFF) throw new ArgumentOutOfRangeException(); _Field4 = value; } } + int _Field5; + public int Field5 { get { return _Field5; } set { if(value < -1 || value > 0xFFFFF) throw new ArgumentOutOfRangeException(); _Field5 = value; } } + public float Field6; + public int Field7; + public float Field8; + public float Field9; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = new Vector3D(); + Field1.Parse(buffer); + Field2 = new Vector3D(); + Field2.Parse(buffer); + Field3 = buffer.ReadInt(25); + Field4 = buffer.ReadInt(21) + (-1); + Field5 = buffer.ReadInt(21) + (-1); + Field6 = buffer.ReadFloat32(); + Field7 = buffer.ReadInt(32); + Field8 = buffer.ReadFloat32(); + Field9 = buffer.ReadFloat32(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + Field1.Encode(buffer); + Field2.Encode(buffer); + buffer.WriteInt(25, Field3); + buffer.WriteInt(21, Field4 - (-1)); + buffer.WriteInt(21, Field5 - (-1)); + buffer.WriteFloat32(Field6); + buffer.WriteInt(32, Field7); + buffer.WriteFloat32(Field8); + buffer.WriteFloat32(Field9); + } + + } + + public class ACDTranslateFixedMessage : GameMessage + { + public int Field0; + public Vector3D Field1; + int _Field2; + public int Field2 { get { return _Field2; } set { if(value < 0 || value > 0x1FFFFFF) throw new ArgumentOutOfRangeException(); _Field2 = value; } } + int _Field3; + public int Field3 { get { return _Field3; } set { if(value < -1 || value > 0xFFFFF) throw new ArgumentOutOfRangeException(); _Field3 = value; } } + public int Field4; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = new Vector3D(); + Field1.Parse(buffer); + Field2 = buffer.ReadInt(25); + Field3 = buffer.ReadInt(21) + (-1); + Field4 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + Field1.Encode(buffer); + buffer.WriteInt(25, Field2); + buffer.WriteInt(21, Field3 - (-1)); + buffer.WriteInt(32, Field4); + } + + } + + public class ACDTranslateFacingMessage : GameMessage + { + public int Field0; + public float Field1; + public bool Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadFloat32(); + Field2 = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteFloat32(Field1); + buffer.WriteBool(Field2); + } + + } + + public class ACDTranslateAckMessage : GameMessage + { + public int Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + } + + } + + public class ACDTranslateSyncMessage : GameMessage + { + public int Field0; + public Vector3D Field1; + public bool? Field2; + int? _Field3; + public int? Field3 { get { return _Field3; } set { if(value.HasValue && (value.Value < 0 || value.Value > 0xFFFF)) throw new ArgumentOutOfRangeException(); _Field3 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = new Vector3D(); + Field1.Parse(buffer); + if(buffer.ReadBool()) + Field2 = buffer.ReadBool(); + if(buffer.ReadBool()) + Field3 = buffer.ReadInt(16); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + Field1.Encode(buffer); + if(Field2.HasValue) + buffer.WriteBool(Field2.Value); + if(Field3.HasValue) + buffer.WriteInt(16, Field3.Value); + } + + } + + public class ACDTranslateSnappedMessage : GameMessage + { + public int Field0; + public Vector3D Field1; + public float Field2; + public bool Field3; + int _Field4; + public int Field4 { get { return _Field4; } set { if(value < 0 || value > 0x1FFFFFF) throw new ArgumentOutOfRangeException(); _Field4 = value; } } + int? _Field5; + public int? Field5 { get { return _Field5; } set { if(value.HasValue && (value.Value < 0 || value.Value > 0xFFFF)) throw new ArgumentOutOfRangeException(); _Field5 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = new Vector3D(); + Field1.Parse(buffer); + Field2 = buffer.ReadFloat32(); + Field3 = buffer.ReadBool(); + Field4 = buffer.ReadInt(25); + if(buffer.ReadBool()) + Field5 = buffer.ReadInt(16); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + Field1.Encode(buffer); + buffer.WriteFloat32(Field2); + buffer.WriteBool(Field3); + buffer.WriteInt(25, Field4); + if(Field5.HasValue) + buffer.WriteInt(16, Field5.Value); + } + + } + + public class ACDTranslateNormalMessage : GameMessage + { + public int Field0; + public Vector3D Field1; + public float? Field2; + public bool? Field3; + public float? Field4; + int? _Field5; + public int? Field5 { get { return _Field5; } set { if(value.HasValue && (value.Value < 0 || value.Value > 0x1FFFFFF)) throw new ArgumentOutOfRangeException(); _Field5 = value; } } + int? _Field6; + public int? Field6 { get { return _Field6; } set { if(value.HasValue && (value.Value < -1 || value.Value > 0xFFFFF)) throw new ArgumentOutOfRangeException(); _Field6 = value; } } + public int? Field7; + public int? Field8; + int? _Field9; + public int? Field9 { get { return _Field9; } set { if(value.HasValue && (value.Value < 0 || value.Value > 0xFFFF)) throw new ArgumentOutOfRangeException(); _Field9 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + if(buffer.ReadBool()) + { + Field1 = new Vector3D(); + Field1.Parse(buffer); + } + if(buffer.ReadBool()) + Field2 = buffer.ReadFloat32(); + if(buffer.ReadBool()) + Field3 = buffer.ReadBool(); + if(buffer.ReadBool()) + Field4 = buffer.ReadFloat32(); + if(buffer.ReadBool()) + Field5 = buffer.ReadInt(25); + if(buffer.ReadBool()) + Field6 = buffer.ReadInt(21) + (-1); + if(buffer.ReadBool()) + Field7 = buffer.ReadInt(32); + if(buffer.ReadBool()) + Field8 = buffer.ReadInt(32); + if(buffer.ReadBool()) + Field9 = buffer.ReadInt(16); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + if(Field1 != null) + Field1.Encode(buffer); + if(Field2.HasValue) + buffer.WriteFloat32(Field2.Value); + if(Field3.HasValue) + buffer.WriteBool(Field3.Value); + if(Field4.HasValue) + buffer.WriteFloat32(Field4.Value); + if(Field5.HasValue) + buffer.WriteInt(25, Field5.Value); + if(Field6.HasValue) + buffer.WriteInt(21, Field6.Value - (-1)); + if(Field7.HasValue) + buffer.WriteInt(32, Field7.Value); + if(Field8.HasValue) + buffer.WriteInt(32, Field8.Value); + if(Field9.HasValue) + buffer.WriteInt(16, Field9.Value); + } + + } + + public class HirelingSwapMessage : GameMessage + { + public int Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + } + + } + + public class NPCInteractOptionsMessage : GameMessage + { + public int Field0; + NPCInteraction[] _tNPCInteraction; + public NPCInteraction[] tNPCInteraction { get { return _tNPCInteraction; } set { if(value != null && value.Length > 20) throw new ArgumentOutOfRangeException(); _tNPCInteraction = value; } } + int _Field2; + public int Field2 { get { return _Field2; } set { if(value < 0 || value > 2) throw new ArgumentOutOfRangeException(); _Field2 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + tNPCInteraction = new NPCInteraction[buffer.ReadInt(5)]; + for(int i = 0;i < _tNPCInteraction.Length;i++) + { + _tNPCInteraction[i] = new NPCInteraction(); + _tNPCInteraction[i].Parse(buffer); + } + Field2 = buffer.ReadInt(2); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(5, _tNPCInteraction.Length); + for(int i = 0;i < _tNPCInteraction.Length;i++) _tNPCInteraction[i].Encode(buffer); + buffer.WriteInt(2, Field2); + } + + } + + public class NPCInteraction + { + int _Field0; + public int Field0 { get { return _Field0; } set { if(value < 0 || value > 8) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + public int Field1; + public int Field2; + int _Field3; + public int Field3 { get { return _Field3; } set { if(value < 0 || value > 3) throw new ArgumentOutOfRangeException(); _Field3 = value; } } + + public void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(4); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadInt(2); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(4, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + buffer.WriteInt(2, Field3); + } + + } + + public class VisualInventoryMessage : GameMessage + { + public int Field0; + public VisualEquipment Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = new VisualEquipment(); + Field1.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + Field1.Encode(buffer); + } + + } + + public class VisualEquipment + { + VisualItem[] _Field0; + public VisualItem[] Field0 { get { return _Field0; } set { if(value != null && value.Length != 8) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + + public void Parse(GameBitBuffer buffer) + { + Field0 = new VisualItem[8]; + for(int i = 0;i < _Field0.Length;i++) + { + _Field0[i] = new VisualItem(); + _Field0[i].Parse(buffer); + } + } + + public void Encode(GameBitBuffer buffer) + { + for(int i = 0;i < _Field0.Length;i++) _Field0[i].Encode(buffer); + } + + } + + public class VisualItem + { + public int Field0; + int _Field1; + public int Field1 { get { return _Field1; } set { if(value < 0 || value > 21) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + int _Field2; + public int Field2 { get { return _Field2; } set { if(value < 0 || value > 14) throw new ArgumentOutOfRangeException(); _Field2 = value; } } + int _Field3; + public int Field3 { get { return _Field3; } set { if(value < -1 || value > 30) throw new ArgumentOutOfRangeException(); _Field3 = value; } } + + public void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(5); + Field2 = buffer.ReadInt(4); + Field3 = buffer.ReadInt(5) + (-1); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(5, Field1); + buffer.WriteInt(4, Field2); + buffer.WriteInt(5, Field3 - (-1)); + } + + } + + public class SetIdleAnimationMessage : GameMessage + { + public int Field0; + public int Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + } + + } + + public class PlayAnimationMessage : GameMessage + { + public int Field0; + int _Field1; + public int Field1 { get { return _Field1; } set { if(value < 0 || value > 12) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + public float Field2; + PlayAnimationMessageSpec[] _tAnim; + public PlayAnimationMessageSpec[] tAnim { get { return _tAnim; } set { if(value != null && value.Length > 3) throw new ArgumentOutOfRangeException(); _tAnim = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(4); + Field2 = buffer.ReadFloat32(); + tAnim = new PlayAnimationMessageSpec[buffer.ReadInt(2)]; + for(int i = 0;i < _tAnim.Length;i++) + { + _tAnim[i] = new PlayAnimationMessageSpec(); + _tAnim[i].Parse(buffer); + } + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(4, Field1); + buffer.WriteFloat32(Field2); + buffer.WriteInt(2, _tAnim.Length); + for(int i = 0;i < _tAnim.Length;i++) _tAnim[i].Encode(buffer); + } + + } + + public class PlayAnimationMessageSpec + { + public int Field0; + public int Field1; + public int Field2; + public float Field3; + + public void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadFloat32(); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + buffer.WriteFloat32(Field3); + } + + } + + public class Message : GameMessage + { + public int Field0; + public int Field1; + public int Field2; + public int Field3; + public float Field4; + public float Field5; + public int Field6; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadInt(32); + Field4 = buffer.ReadFloat32(); + Field5 = buffer.ReadFloat32(); + Field6 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + buffer.WriteInt(32, Field3); + buffer.WriteFloat32(Field4); + buffer.WriteFloat32(Field5); + buffer.WriteInt(32, Field6); + } + + } + + public class UnlockDifficultyMessage : GameMessage + { + public int Field0; + public bool Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteBool(Field1); + } + + } + + public class VersionsMessage : GameMessage + { + public int Field0; + public int Field1; + public string _Field2; + public string Field2 { get { return _Field2; } set { if(value != null && value.Length > 32) throw new ArgumentOutOfRangeException(); _Field2 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadCharArray(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteCharArray(32, Field2); + } + + } + + public class LogoutTickTimeMessage : GameMessage + { + public bool Field0; + public int Field1; + public int Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadBool(); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteBool(Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + } + + } + + public class HirelingRequestLearnSkillMessage : GameMessage + { + public int Field0; + public int Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + } + + } + + public class PlayErrorSoundMessage : GameMessage + { + public int Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + } + + } + + public class RequestBuffCancelMessage : GameMessage + { + public int Field0; + public int Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + } + + } + + public class GameTestingSamplingStartMessage : GameMessage + { + public int Field0; + public int Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + } + + } + + public class SalvageResultsMessage : GameMessage + { + public int gbidOriginalItem; + int _Field1; + public int Field1 { get { return _Field1; } set { if(value < -1 || value > 10) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + public int Field2; + int[] _gbidNewItems; + public int[] gbidNewItems { get { return _gbidNewItems; } set { if(value != null && value.Length != 10) throw new ArgumentOutOfRangeException(); _gbidNewItems = value; } } + + public override void Parse(GameBitBuffer buffer) + { + gbidOriginalItem = buffer.ReadInt(32); + Field1 = buffer.ReadInt(4) + (-1); + Field2 = buffer.ReadInt(32); + gbidNewItems = new int[10]; + for(int i = 0;i < _gbidNewItems.Length;i++) _gbidNewItems[i] = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, gbidOriginalItem); + buffer.WriteInt(4, Field1 - (-1)); + buffer.WriteInt(32, Field2); + for(int i = 0;i < _gbidNewItems.Length;i++) buffer.WriteInt(32, _gbidNewItems[i]); + } + + } + + public class DebugActorTooltipMessage : GameMessage + { + public int Field0; + public string _Field1; + public string Field1 { get { return _Field1; } set { if(value != null && value.Length > 512) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadCharArray(512); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteCharArray(512, Field1); + } + + } + + public class PlayerWarpedMessage : GameMessage + { + int _Field0; + public int Field0 { get { return _Field0; } set { if(value < 0 || value > 11) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + public float Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(4); + Field1 = buffer.ReadFloat32(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(4, Field0); + buffer.WriteFloat32(Field1); + } + + } + + public class PlayCutsceneMessage : GameMessage + { + public int Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + } + + } + + public class BossZoomMessage : GameMessage + { + public float Field0; + public float Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadFloat32(); + Field1 = buffer.ReadFloat32(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteFloat32(Field0); + buffer.WriteFloat32(Field1); + } + + } + + public class CameraYawMessage : GameMessage + { + public float Field0; + public bool Field1; + public float Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadFloat32(); + Field1 = buffer.ReadBool(); + Field2 = buffer.ReadFloat32(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteFloat32(Field0); + buffer.WriteBool(Field1); + buffer.WriteFloat32(Field2); + } + + } + + public class CameraZoomMessage : GameMessage + { + public float Field0; + public bool Field1; + public float Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadFloat32(); + Field1 = buffer.ReadBool(); + Field2 = buffer.ReadFloat32(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteFloat32(Field0); + buffer.WriteBool(Field1); + buffer.WriteFloat32(Field2); + } + + } + + public class DebugDrawPrimMessage : GameMessage + { + public int Field0; + public int Field1; + public int Field2; + public Vector3D Field3; + public Vector3D Field4; + public float Field5; + public float Field6; + public int Field7; + public RGBAColor Field8; + public string _Field9; + public string Field9 { get { return _Field9; } set { if(value != null && value.Length > 128) throw new ArgumentOutOfRangeException(); _Field9 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + Field3 = new Vector3D(); + Field3.Parse(buffer); + Field4 = new Vector3D(); + Field4.Parse(buffer); + Field5 = buffer.ReadFloat32(); + Field6 = buffer.ReadFloat32(); + Field7 = buffer.ReadInt(32); + Field8 = new RGBAColor(); + Field8.Parse(buffer); + Field9 = buffer.ReadCharArray(128); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + Field3.Encode(buffer); + Field4.Encode(buffer); + buffer.WriteFloat32(Field5); + buffer.WriteFloat32(Field6); + buffer.WriteInt(32, Field7); + Field8.Encode(buffer); + buffer.WriteCharArray(128, Field9); + } + + } + + public class RGBAColor + { + public byte Field0; + public byte Field1; + public byte Field2; + public byte Field3; + + public void Parse(GameBitBuffer buffer) + { + Field0 = (byte)buffer.ReadInt(8); + Field1 = (byte)buffer.ReadInt(8); + Field2 = (byte)buffer.ReadInt(8); + Field3 = (byte)buffer.ReadInt(8); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(8, Field0); + buffer.WriteInt(8, Field1); + buffer.WriteInt(8, Field2); + buffer.WriteInt(8, Field3); + } + + } + + public class CameraFocusMessage : GameMessage + { + public int Field0; + public bool Field1; + public float Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadBool(); + Field2 = buffer.ReadFloat32(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteBool(Field1); + buffer.WriteFloat32(Field2); + } + + } + + public class InterstitialMessage : GameMessage + { + int _Field0; + public int Field0 { get { return _Field0; } set { if(value < -1 || value > 5) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + public bool Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(3) + (-1); + Field1 = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(3, Field0 - (-1)); + buffer.WriteBool(Field1); + } + + } + + public class ActTransitionMessage : GameMessage + { + int _Field0; + public int Field0 { get { return _Field0; } set { if(value < -1 || value > 1000) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + public bool Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(10) + (-1); + Field1 = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(10, Field0 - (-1)); + buffer.WriteBool(Field1); + } + + } + + public class EncounterInviteStateMessage : GameMessage + { + public int Field0; + public int Field1; + public int Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + } + + } + + public class BossEncounterMessage : GameMessage + { + public int Field0; + public int snoEncounter; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + snoEncounter = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, snoEncounter); + } + + } + + public class MapMarkerInfoMessage : GameMessage + { + public int Field0; + public WorldPlace Field1; + public int Field2; + public int Field3; + public int m_snoStringList; + public int Field5; + public bool Field6; + public bool Field7; + public bool Field8; + public float Field9; + public float Field10; + public float Field11; + public int Field12; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = new WorldPlace(); + Field1.Parse(buffer); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadInt(32); + m_snoStringList = buffer.ReadInt(32); + Field5 = buffer.ReadInt(32); + Field6 = buffer.ReadBool(); + Field7 = buffer.ReadBool(); + Field8 = buffer.ReadBool(); + Field9 = buffer.ReadFloat32(); + Field10 = buffer.ReadFloat32(); + Field11 = buffer.ReadFloat32(); + Field12 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + Field1.Encode(buffer); + buffer.WriteInt(32, Field2); + buffer.WriteInt(32, Field3); + buffer.WriteInt(32, m_snoStringList); + buffer.WriteInt(32, Field5); + buffer.WriteBool(Field6); + buffer.WriteBool(Field7); + buffer.WriteBool(Field8); + buffer.WriteFloat32(Field9); + buffer.WriteFloat32(Field10); + buffer.WriteFloat32(Field11); + buffer.WriteInt(32, Field12); + } + + } + + public class TradeMessage : GameMessage + { + int _Field0; + public int Field0 { get { return _Field0; } set { if(value < 0 || value > 9) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + public int Field1; + public int Field2; + public long Field3; + public int Field4; + int[] _Field5; + public int[] Field5 { get { return _Field5; } set { if(value != null && value.Length != 5) throw new ArgumentOutOfRangeException(); _Field5 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(4); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadInt64(64); + Field4 = buffer.ReadInt(32); + Field5 = new int[5]; + for(int i = 0;i < _Field5.Length;i++) _Field5[i] = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(4, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + buffer.WriteInt64(64, Field3); + buffer.WriteInt(32, Field4); + for(int i = 0;i < _Field5.Length;i++) buffer.WriteInt(32, _Field5[i]); + } + + } + + public class PlayerDeSyncSnapMessage : GameMessage + { + public WorldPlace Field0; + int _Field1; + public int Field1 { get { return _Field1; } set { if(value < 0 || value > 3) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + public int Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = new WorldPlace(); + Field0.Parse(buffer); + Field1 = buffer.ReadInt(2); + Field2 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + Field0.Encode(buffer); + buffer.WriteInt(2, Field1); + buffer.WriteInt(32, Field2); + } + + } + + public class PlayerQuestMessage : GameMessage + { + int _Field0; + public int Field0 { get { return _Field0; } set { if(value < -1 || value > 7) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + public int Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(4) + (-1); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(4, Field0 - (-1)); + buffer.WriteInt(32, Field1); + } + + } + + public class LoreMessage : GameMessage + { + public int snoLore; + + public override void Parse(GameBitBuffer buffer) + { + snoLore = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, snoLore); + } + + } + + public class TryWaypointMessage : GameMessage + { + public int Field0; + int _Field1; + public int Field1 { get { return _Field1; } set { if(value < -1 || value > 25) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(5) + (-1); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(5, Field1 - (-1)); + } + + } + + public class WaypointActivatedMessage : GameMessage + { + public int Field0; + public int Field1; + public int Field2; + public bool Field3; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + buffer.WriteBool(Field3); + } + + } + + public class WeatherOverrideMessage : GameMessage + { + public int snoWorld; + public float Field1; + public float Field2; + + public override void Parse(GameBitBuffer buffer) + { + snoWorld = buffer.ReadInt(32); + Field1 = buffer.ReadFloat32(); + Field2 = buffer.ReadFloat32(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, snoWorld); + buffer.WriteFloat32(Field1); + buffer.WriteFloat32(Field2); + } + + } + + public class BlizzconCVarsMessage : GameMessage + { + public bool Field0; + public bool Field1; + public bool Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadBool(); + Field1 = buffer.ReadBool(); + Field2 = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteBool(Field0); + buffer.WriteBool(Field1); + buffer.WriteBool(Field2); + } + + } + + public class WorldDeletedMessage : GameMessage + { + public int Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + } + + } + + public class WorldStatusMessage : GameMessage + { + public int Field0; + public bool Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteBool(Field1); + } + + } + + public class RemoveRagdollMessage : GameMessage + { + public int Field0; + public int Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + } + + } + + public class FloatingAmountMessage : GameMessage + { + public WorldPlace Field0; + public int Field1; + public int? Field2; + int _Field3; + public int Field3 { get { return _Field3; } set { if(value < 0 || value > 32) throw new ArgumentOutOfRangeException(); _Field3 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = new WorldPlace(); + Field0.Parse(buffer); + Field1 = buffer.ReadInt(32); + if(buffer.ReadBool()) + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadInt(6); + } + + public override void Encode(GameBitBuffer buffer) + { + Field0.Encode(buffer); + buffer.WriteInt(32, Field1); + if(Field2.HasValue) + buffer.WriteInt(32, Field2.Value); + buffer.WriteInt(6, Field3); + } + + } + + public class FloatingNumberMessage : GameMessage + { + public int Field0; + public float Field1; + int _Field2; + public int Field2 { get { return _Field2; } set { if(value < 0 || value > 32) throw new ArgumentOutOfRangeException(); _Field2 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadFloat32(); + Field2 = buffer.ReadInt(6); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteFloat32(Field1); + buffer.WriteInt(6, Field2); + } + + } + + public class SaviorMessage : GameMessage + { + public int Field0; + public int Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + } + + } + + public class LowHealthCombatMessage : GameMessage + { + public float Field0; + public int Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadFloat32(); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteFloat32(Field0); + buffer.WriteInt(32, Field1); + } + + } + + public class KillCounterUpdateMessage : GameMessage + { + int _Field0; + public int Field0 { get { return _Field0; } set { if(value < 0 || value > 3) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + public int Field1; + public int Field2; + public bool Field3; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(2); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(2, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + buffer.WriteBool(Field3); + } + + } + + public class ACDLookAtMessage : GameMessage + { + public int Field0; + public int Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + } + + } + + public class ReturnPointInfoMessage : GameMessage + { + public int snoLevelArea; + + public override void Parse(GameBitBuffer buffer) + { + snoLevelArea = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, snoLevelArea); + } + + } + + public class HearthPortalInfoMessage : GameMessage + { + public int snoLevelArea; + public int Field1; + + public override void Parse(GameBitBuffer buffer) + { + snoLevelArea = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, snoLevelArea); + buffer.WriteInt(32, Field1); + } + + } + + public class SavePointInfoMessage : GameMessage + { + public int snoLevelArea; + + public override void Parse(GameBitBuffer buffer) + { + snoLevelArea = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, snoLevelArea); + } + + } + + public class MapRevealSceneMessage : GameMessage + { + public int Field0; + public int snoScene; + public PRTransform Field2; + public int Field3; + public bool Field4; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + snoScene = buffer.ReadInt(32); + Field2 = new PRTransform(); + Field2.Parse(buffer); + Field3 = buffer.ReadInt(32); + Field4 = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, snoScene); + Field2.Encode(buffer); + buffer.WriteInt(32, Field3); + buffer.WriteBool(Field4); + } + + } + + public class PRTransform + { + public Quaternion Field0; + public Vector3D Field1; + + public void Parse(GameBitBuffer buffer) + { + Field0 = new Quaternion(); + Field0.Parse(buffer); + Field1 = new Vector3D(); + Field1.Parse(buffer); + } + + public void Encode(GameBitBuffer buffer) + { + Field0.Encode(buffer); + Field1.Encode(buffer); + } + + } + + public class Quaternion + { + public Vector3D Field0; + public float Field1; + + public void Parse(GameBitBuffer buffer) + { + Field0 = new Vector3D(); + Field0.Parse(buffer); + Field1 = buffer.ReadFloat32(); + } + + public void Encode(GameBitBuffer buffer) + { + Field0.Encode(buffer); + buffer.WriteFloat32(Field1); + } + + } + + public class DeathFadeTimeMessage : GameMessage + { + public int Field0; + int _Field1; + public int Field1 { get { return _Field1; } set { if(value < -1 || value > 0x708) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + int _Field2; + public int Field2 { get { return _Field2; } set { if(value < 0 || value > 0x708) throw new ArgumentOutOfRangeException(); _Field2 = value; } } + public bool Field3; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(11) + (-1); + Field2 = buffer.ReadInt(11); + Field3 = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(11, Field1 - (-1)); + buffer.WriteInt(11, Field2); + buffer.WriteBool(Field3); + } + + } + + public class RevealTeamMessage : GameMessage + { + int _Field0; + public int Field0 { get { return _Field0; } set { if(value < -1 || value > 22) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + int _Field1; + public int Field1 { get { return _Field1; } set { if(value < 0 || value > 3) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + int _Field2; + public int Field2 { get { return _Field2; } set { if(value < -1 || value > 1) throw new ArgumentOutOfRangeException(); _Field2 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(5) + (-1); + Field1 = buffer.ReadInt(2); + Field2 = buffer.ReadInt(2) + (-1); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(5, Field0 - (-1)); + buffer.WriteInt(2, Field1); + buffer.WriteInt(2, Field2 - (-1)); + } + + } + + public class HirelingInfoUpdateMessage : GameMessage + { + int _Field0; + public int Field0 { get { return _Field0; } set { if(value < 0 || value > 3) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + public bool Field1; + public int Field2; + int _Field3; + public int Field3 { get { return _Field3; } set { if(value < 0 || value > 127) throw new ArgumentOutOfRangeException(); _Field3 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(2); + Field1 = buffer.ReadBool(); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadInt(7); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(2, Field0); + buffer.WriteBool(Field1); + buffer.WriteInt(32, Field2); + buffer.WriteInt(7, Field3); + } + + } + + public class UIElementMessage : GameMessage + { + int _Field0; + public int Field0 { get { return _Field0; } set { if(value < -1 || value > 12) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + public bool Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(4) + (-1); + Field1 = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(4, Field0 - (-1)); + buffer.WriteBool(Field1); + } + + } + + public class TrickleMessage : GameMessage + { + public int Field0; + public int Field1; + public WorldPlace Field2; + int? _Field3; + public int? Field3 { get { return _Field3; } set { if(value.HasValue && (value.Value < -1 || value.Value > 7)) throw new ArgumentOutOfRangeException(); _Field3 = value; } } + public int Field4; + public float? Field5; + int _Field6; + public int Field6 { get { return _Field6; } set { if(value < 0 || value > 11) throw new ArgumentOutOfRangeException(); _Field6 = value; } } + int _Field7; + public int Field7 { get { return _Field7; } set { if(value < 0 || value > 63) throw new ArgumentOutOfRangeException(); _Field7 = value; } } + public int? Field8; + public int? Field9; + public int? Field10; + public int? Field11; + public int? Field12; + public float? Field13; + public float? Field14; + public bool? Field15; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = new WorldPlace(); + Field2.Parse(buffer); + if(buffer.ReadBool()) + Field3 = buffer.ReadInt(4) + (-1); + Field4 = buffer.ReadInt(32); + if(buffer.ReadBool()) + Field5 = buffer.ReadFloat32(); + Field6 = buffer.ReadInt(4); + Field7 = buffer.ReadInt(6); + if(buffer.ReadBool()) + Field8 = buffer.ReadInt(32); + if(buffer.ReadBool()) + Field9 = buffer.ReadInt(32); + if(buffer.ReadBool()) + Field10 = buffer.ReadInt(32); + if(buffer.ReadBool()) + Field11 = buffer.ReadInt(32); + if(buffer.ReadBool()) + Field12 = buffer.ReadInt(32); + if(buffer.ReadBool()) + Field13 = buffer.ReadFloat32(); + if(buffer.ReadBool()) + Field14 = buffer.ReadFloat32(); + if(buffer.ReadBool()) + Field15 = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + Field2.Encode(buffer); + if(Field3.HasValue) + buffer.WriteInt(4, Field3.Value - (-1)); + buffer.WriteInt(32, Field4); + if(Field5.HasValue) + buffer.WriteFloat32(Field5.Value); + buffer.WriteInt(4, Field6); + buffer.WriteInt(6, Field7); + if(Field8.HasValue) + buffer.WriteInt(32, Field8.Value); + if(Field9.HasValue) + buffer.WriteInt(32, Field9.Value); + if(Field10.HasValue) + buffer.WriteInt(32, Field10.Value); + if(Field11.HasValue) + buffer.WriteInt(32, Field11.Value); + if(Field12.HasValue) + buffer.WriteInt(32, Field12.Value); + if(Field13.HasValue) + buffer.WriteFloat32(Field13.Value); + if(Field14.HasValue) + buffer.WriteFloat32(Field14.Value); + if(Field15.HasValue) + buffer.WriteBool(Field15.Value); + } + + } + + public class ACDChangeGBHandleMessage : GameMessage + { + public int Field0; + public GBHandle Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = new GBHandle(); + Field1.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + Field1.Encode(buffer); + } + + } + + public class GBHandle + { + int _Field0; + public int Field0 { get { return _Field0; } set { if(value < -2 || value > 37) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + public int Field1; + + public void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(6) + (-2); + Field1 = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(6, Field0 - (-2)); + buffer.WriteInt(32, Field1); + } + + } + + public class AimTargetMessage : GameMessage + { + public int Field0; + int _Field1; + public int Field1 { get { return _Field1; } set { if(value < -1 || value > 3) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + public int Field2; + public WorldPlace Field3; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(3) + (-1); + Field2 = buffer.ReadInt(32); + Field3 = new WorldPlace(); + Field3.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(3, Field1 - (-1)); + buffer.WriteInt(32, Field2); + Field3.Encode(buffer); + } + + } + + public class PlayerLevel : GameMessage + { + int _Field0; + public int Field0 { get { return _Field0; } set { if(value < 0 || value > 7) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + int _Field1; + public int Field1 { get { return _Field1; } set { if(value < 0 || value > 127) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(3); + Field1 = buffer.ReadInt(7); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(3, Field0); + buffer.WriteInt(7, Field1); + } + + } + + public class ComplexEffectAddMessage : GameMessage + { + public int Field0; + public int Field1; + public int Field2; + public int Field3; + public int Field4; + public int Field5; + public int Field6; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadInt(32); + Field4 = buffer.ReadInt(32); + Field5 = buffer.ReadInt(32); + Field6 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + buffer.WriteInt(32, Field3); + buffer.WriteInt(32, Field4); + buffer.WriteInt(32, Field5); + buffer.WriteInt(32, Field6); + } + + } + + public class FlippyMessage : GameMessage + { + public int Field0; + public int Field1; + public int Field2; + public Vector3D Field3; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + Field3 = new Vector3D(); + Field3.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + Field3.Encode(buffer); + } + + } + + public class PetDetachMessage : GameMessage + { + public int Field0; + public bool Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteBool(Field1); + } + + } + + public class PetMessage : GameMessage + { + int _Field0; + public int Field0 { get { return _Field0; } set { if(value < 0 || value > 7) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + int _Field1; + public int Field1 { get { return _Field1; } set { if(value < 0 || value > 31) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + public int Field2; + int _Field3; + public int Field3 { get { return _Field3; } set { if(value < -1 || value > 23) throw new ArgumentOutOfRangeException(); _Field3 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(3); + Field1 = buffer.ReadInt(5); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadInt(5) + (-1); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(3, Field0); + buffer.WriteInt(5, Field1); + buffer.WriteInt(32, Field2); + buffer.WriteInt(5, Field3 - (-1)); + } + + } + + public class HelperDetachMessage : GameMessage + { + public int Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + } + + } + + public class InventoryRequestSocketMessage : GameMessage + { + public int Field0; + public int Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + } + + } + + public class InventoryRequestUseMessage : GameMessage + { + public int Field0; + int _Field1; + public int Field1 { get { return _Field1; } set { if(value < -1 || value > 3) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + public int Field2; + public WorldPlace Field3; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(3) + (-1); + Field2 = buffer.ReadInt(32); + Field3 = new WorldPlace(); + Field3.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(3, Field1 - (-1)); + buffer.WriteInt(32, Field2); + Field3.Encode(buffer); + } + + } + + public class InventoryStackTransferMessage : GameMessage + { + public int Field0; + public int Field1; + public long Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt64(64); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt64(64, Field2); + } + + } + + public class InventorySplitStackMessage : GameMessage + { + public int Field0; + public long Field1; + public InvLoc Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt64(64); + Field2 = new InvLoc(); + Field2.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt64(64, Field1); + Field2.Encode(buffer); + } + + } + + public class InvLoc + { + public int Field0; + int _Field1; + public int Field1 { get { return _Field1; } set { if(value < -1 || value > 26) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + public int Field2; + public int Field3; + + public void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(5) + (-1); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(5, Field1 - (-1)); + buffer.WriteInt(32, Field2); + buffer.WriteInt(32, Field3); + } + + } + + public class InventoryDropStackPortionMessage : GameMessage + { + public int Field0; + public long Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt64(64); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt64(64, Field1); + } + + } + + public class InventoryRequestMoveMessage : GameMessage + { + public int Field0; + public InvLoc Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = new InvLoc(); + Field1.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + Field1.Encode(buffer); + } + + } + + public class InventoryRequestQuickMoveMessage : GameMessage + { + public int Field0; + public int Field1; + int _Field2; + public int Field2 { get { return _Field2; } set { if(value < -1 || value > 26) throw new ArgumentOutOfRangeException(); _Field2 = value; } } + public int Field3; + public int Field4; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(5) + (-1); + Field3 = buffer.ReadInt(32); + Field4 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(5, Field2 - (-1)); + buffer.WriteInt(32, Field3); + buffer.WriteInt(32, Field4); + } + + } + + public class KillCountMessage : GameMessage + { + int _Field0; + public int Field0 { get { return _Field0; } set { if(value < 0 || value > 7) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + public int Field1; + public int Field2; + public int Field3; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(3); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(3, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + buffer.WriteInt(32, Field3); + } + + } + + public class VictimMessage : GameMessage + { + int _Field0; + public int Field0 { get { return _Field0; } set { if(value < 0 || value > 7) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + int _Field1; + public int Field1 { get { return _Field1; } set { if(value < 0 || value > 100) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + int _Field2; + public int Field2 { get { return _Field2; } set { if(value < -1 || value > 7) throw new ArgumentOutOfRangeException(); _Field2 = value; } } + int _Field3; + public int Field3 { get { return _Field3; } set { if(value < -1 || value > 11) throw new ArgumentOutOfRangeException(); _Field3 = value; } } + public int snoKillerActor; + int _Field5; + public int Field5 { get { return _Field5; } set { if(value < -1 || value > 23) throw new ArgumentOutOfRangeException(); _Field5 = value; } } + int[] _Field6; + public int[] Field6 { get { return _Field6; } set { if(value != null && value.Length != 2) throw new ArgumentOutOfRangeException(); _Field6 = value; } } + public int snoPowerDmgSource; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(3); + Field1 = buffer.ReadInt(7); + Field2 = buffer.ReadInt(4) + (-1); + Field3 = buffer.ReadInt(4) + (-1); + snoKillerActor = buffer.ReadInt(32); + Field5 = buffer.ReadInt(5) + (-1); + Field6 = new int[2]; + for(int i = 0;i < _Field6.Length;i++) _Field6[i] = buffer.ReadInt(32); + snoPowerDmgSource = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(3, Field0); + buffer.WriteInt(7, Field1); + buffer.WriteInt(4, Field2 - (-1)); + buffer.WriteInt(4, Field3 - (-1)); + buffer.WriteInt(32, snoKillerActor); + buffer.WriteInt(5, Field5 - (-1)); + for(int i = 0;i < _Field6.Length;i++) buffer.WriteInt(32, _Field6[i]); + buffer.WriteInt(32, snoPowerDmgSource); + } + + } + + public class VoteKickMessage : GameMessage + { + int _Field0; + public int Field0 { get { return _Field0; } set { if(value < -1 || value > 7) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + int _Field1; + public int Field1 { get { return _Field1; } set { if(value < -1 || value > 7) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + public string _Field2; + public string Field2 { get { return _Field2; } set { if(value != null && value.Length > 512) throw new ArgumentOutOfRangeException(); _Field2 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(4) + (-1); + Field1 = buffer.ReadInt(4) + (-1); + Field2 = buffer.ReadCharArray(512); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(4, Field0 - (-1)); + buffer.WriteInt(4, Field1 - (-1)); + buffer.WriteCharArray(512, Field2); + } + + } + + public class ChatMessage : GameMessage + { + int _Field0; + public int Field0 { get { return _Field0; } set { if(value < 0 || value > 3) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + int _Field1; + public int Field1 { get { return _Field1; } set { if(value < -1 || value > 7) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + public string _Field2; + public string Field2 { get { return _Field2; } set { if(value != null && value.Length > 512) throw new ArgumentOutOfRangeException(); _Field2 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(2); + Field1 = buffer.ReadInt(4) + (-1); + Field2 = buffer.ReadCharArray(512); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(2, Field0); + buffer.WriteInt(4, Field1 - (-1)); + buffer.WriteCharArray(512, Field2); + } + + } + + public class TryChatMessage : GameMessage + { + int _Field0; + public int Field0 { get { return _Field0; } set { if(value < 0 || value > 6) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + int _Field1; + public int Field1 { get { return _Field1; } set { if(value < -1 || value > 7) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + public string _Field2; + public string Field2 { get { return _Field2; } set { if(value != null && value.Length > 512) throw new ArgumentOutOfRangeException(); _Field2 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(3); + Field1 = buffer.ReadInt(4) + (-1); + Field2 = buffer.ReadCharArray(512); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(3, Field0); + buffer.WriteInt(4, Field1 - (-1)); + buffer.WriteCharArray(512, Field2); + } + + } + + public class TryConsoleCommand : GameMessage + { + int _Field0; + public int Field0 { get { return _Field0; } set { if(value < -1 || value > 7) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + public string _Field1; + public string Field1 { get { return _Field1; } set { if(value != null && value.Length > 512) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + public WorldPlace Field2; + public int Field3; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(4) + (-1); + Field1 = buffer.ReadCharArray(512); + Field2 = new WorldPlace(); + Field2.Parse(buffer); + Field3 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(4, Field0 - (-1)); + buffer.WriteCharArray(512, Field1); + Field2.Encode(buffer); + buffer.WriteInt(32, Field3); + } + + } + + public class LoopingAnimationPowerMessage : GameMessage + { + public int snoPower; + public int snoData0; + public int Field2; + + public override void Parse(GameBitBuffer buffer) + { + snoPower = buffer.ReadInt(32); + snoData0 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, snoPower); + buffer.WriteInt(32, snoData0); + buffer.WriteInt(32, Field2); + } + + } + + public class SecondaryAnimationPowerMessage : GameMessage + { + public int snoPower; + public AnimPreplayData Field1; + + public override void Parse(GameBitBuffer buffer) + { + snoPower = buffer.ReadInt(32); + if(buffer.ReadBool()) + { + Field1 = new AnimPreplayData(); + Field1.Parse(buffer); + } + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, snoPower); + if(Field1 != null) + Field1.Encode(buffer); + } + + } + + public class AnimPreplayData + { + public int Field0; + public int Field1; + public int Field2; + + public void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + } + + } + + public class TargetMessage : GameMessage + { + int _Field0; + public int Field0 { get { return _Field0; } set { if(value < -1 || value > 3) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + public int Field1; + public WorldPlace Field2; + public int snoPower; + public int Field4; + int _Field5; + public int Field5 { get { return _Field5; } set { if(value < 0 || value > 2) throw new ArgumentOutOfRangeException(); _Field5 = value; } } + public AnimPreplayData Field6; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(3) + (-1); + Field1 = buffer.ReadInt(32); + Field2 = new WorldPlace(); + Field2.Parse(buffer); + snoPower = buffer.ReadInt(32); + Field4 = buffer.ReadInt(32); + Field5 = buffer.ReadInt(2); + if(buffer.ReadBool()) + { + Field6 = new AnimPreplayData(); + Field6.Parse(buffer); + } + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(3, Field0 - (-1)); + buffer.WriteInt(32, Field1); + Field2.Encode(buffer); + buffer.WriteInt(32, snoPower); + buffer.WriteInt(32, Field4); + buffer.WriteInt(2, Field5); + if(Field6 != null) + Field6.Encode(buffer); + } + + } + + public class PlayerActorSetInitialMessage : GameMessage + { + public int Field0; + int _Field1; + public int Field1 { get { return _Field1; } set { if(value < 0 || value > 7) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(3); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(3, Field1); + } + + } + + public class ProjectileStickMessage : GameMessage + { + public Vector3D Field0; + public int Field1; + public int Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = new Vector3D(); + Field0.Parse(buffer); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + Field0.Encode(buffer); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + } + + } + + public class AffixMessage : GameMessage + { + public int Field0; + int _Field1; + public int Field1 { get { return _Field1; } set { if(value < 0 || value > 2) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + int[] _aAffixGBIDs; + public int[] aAffixGBIDs { get { return _aAffixGBIDs; } set { if(value != null && value.Length > 32) throw new ArgumentOutOfRangeException(); _aAffixGBIDs = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(2); + aAffixGBIDs = new int[buffer.ReadInt(6)]; + for(int i = 0;i < _aAffixGBIDs.Length;i++) _aAffixGBIDs[i] = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(2, Field1); + buffer.WriteInt(6, aAffixGBIDs.Length); + for(int i = 0;i < _aAffixGBIDs.Length;i++) buffer.WriteInt(32, _aAffixGBIDs[i]); + } + + } + + public class ACDPickupFailedMessage : GameMessage + { + public int Field0; + int _Field1; + public int Field1 { get { return _Field1; } set { if(value < 0 || value > 7) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(3); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(3, Field1); + } + + } + + public class ACDChangeActorMessage : GameMessage + { + public int Field0; + public int Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + } + + } + + public class ACDGroupMessage : GameMessage + { + public int Field0; + public int Field1; + public int Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + } + + } + + public class ACDShearMessage : GameMessage + { + public int Field0; + public float Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadFloat32(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteFloat32(Field1); + } + + } + + public class ACDWorldPositionMessage : GameMessage + { + public int Field0; + public WorldLocationMessageData Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = new WorldLocationMessageData(); + Field1.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + Field1.Encode(buffer); + } + + } + + public class WorldLocationMessageData + { + public float Field0; + public PRTransform Field1; + public int Field2; + + public void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadFloat32(); + Field1 = new PRTransform(); + Field1.Parse(buffer); + Field2 = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteFloat32(Field0); + Field1.Encode(buffer); + buffer.WriteInt(32, Field2); + } + + } + + public class ACDInventoryUpdateActorSNO : GameMessage + { + public int Field0; + public int Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + } + + } + + public class ACDInventoryPositionMessage : GameMessage + { + public int Field0; + public InventoryLocationMessageData Field1; + public int Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = new InventoryLocationMessageData(); + Field1.Parse(buffer); + Field2 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + Field1.Encode(buffer); + buffer.WriteInt(32, Field2); + } + + } + + public class InventoryLocationMessageData + { + public int Field0; + int _Field1; + public int Field1 { get { return _Field1; } set { if(value < -1 || value > 26) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + public IVector2D Field2; + + public void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(5) + (-1); + Field2 = new IVector2D(); + Field2.Parse(buffer); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(5, Field1 - (-1)); + Field2.Encode(buffer); + } + + } + + public class IVector2D + { + public int Field0; + public int Field1; + + public void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + } + + } + + public class PlayerEnterKnownMessage : GameMessage + { + int _Field0; + public int Field0 { get { return _Field0; } set { if(value < 0 || value > 7) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + public int Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(3); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(3, Field0); + buffer.WriteInt(32, Field1); + } + + } + + public class ACDEnterKnownMessage : GameMessage + { + public int Field0; + public int Field1; + int _Field2; + public int Field2 { get { return _Field2; } set { if(value < 0 || value > 63) throw new ArgumentOutOfRangeException(); _Field2 = value; } } + int _Field3; + public int Field3 { get { return _Field3; } set { if(value < -1 || value > 1) throw new ArgumentOutOfRangeException(); _Field3 = value; } } + public WorldLocationMessageData Field4; + public InventoryLocationMessageData Field5; + public GBHandle Field6; + public int Field7; + public int Field8; + int _Field9; + public int Field9 { get { return _Field9; } set { if(value < -1 || value > 10) throw new ArgumentOutOfRangeException(); _Field9 = value; } } + public byte Field10; + public int? Field11; + public int? Field12; + public int? Field13; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(6); + Field3 = buffer.ReadInt(2) + (-1); + if(buffer.ReadBool()) + { + Field4 = new WorldLocationMessageData(); + Field4.Parse(buffer); + } + if(buffer.ReadBool()) + { + Field5 = new InventoryLocationMessageData(); + Field5.Parse(buffer); + } + Field6 = new GBHandle(); + Field6.Parse(buffer); + Field7 = buffer.ReadInt(32); + Field8 = buffer.ReadInt(32); + Field9 = buffer.ReadInt(4) + (-1); + Field10 = (byte)buffer.ReadInt(8); + if(buffer.ReadBool()) + Field11 = buffer.ReadInt(32); + if(buffer.ReadBool()) + Field12 = buffer.ReadInt(32); + if(buffer.ReadBool()) + Field13 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(6, Field2); + buffer.WriteInt(2, Field3 - (-1)); + if(Field4 != null) + Field4.Encode(buffer); + if(Field5 != null) + Field5.Encode(buffer); + Field6.Encode(buffer); + buffer.WriteInt(32, Field7); + buffer.WriteInt(32, Field8); + buffer.WriteInt(4, Field9 - (-1)); + buffer.WriteInt(8, Field10); + if(Field11.HasValue) + buffer.WriteInt(32, Field11.Value); + if(Field12.HasValue) + buffer.WriteInt(32, Field12.Value); + if(Field13.HasValue) + buffer.WriteInt(32, Field13.Value); + } + + } + + public class RevealWorldMessage : GameMessage + { + public int Field0; + public int Field1; + public int Field2; + public int Field3; + public int Field4; + public int Field5; + public int Field6; + public int Field7; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadInt(32); + Field4 = buffer.ReadInt(32); + Field5 = buffer.ReadInt(32); + Field6 = buffer.ReadInt(32); + Field7 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + buffer.WriteInt(32, Field3); + buffer.WriteInt(32, Field4); + buffer.WriteInt(32, Field5); + buffer.WriteInt(32, Field6); + buffer.WriteInt(32, Field7); + } + + } + + public class EnterWorldMessage : GameMessage + { + public Vector3D Field0; + public int Field1; + public int Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = new Vector3D(); + Field0.Parse(buffer); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + Field0.Encode(buffer); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + } + + } + + public class GameSetupMessage : GameMessage + { + public int Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + } + + } + + public class ConnectionEstablishedMessage : GameMessage + { + int _Field0; + public int Field0 { get { return _Field0; } set { if(value < 0 || value > 7) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + public int Field1; + public int Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(3); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(3, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + } + + } + + public class QuitGameMessage : GameMessage + { + int _Field0; + public int Field0 { get { return _Field0; } set { if(value < 0 || value > 12) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(4); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(4, Field0); + } + + } + + public class JoinLANGameMessage : GameMessage + { + public int Field0; + public string _Field1; + public string Field1 { get { return _Field1; } set { if(value != null && value.Length > 128) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + public string _Field2; + public string Field2 { get { return _Field2; } set { if(value != null && value.Length > 49) throw new ArgumentOutOfRangeException(); _Field2 = value; } } + int _Field3; + public int Field3 { get { return _Field3; } set { if(value < 2 || value > 17) throw new ArgumentOutOfRangeException(); _Field3 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadCharArray(128); + Field2 = buffer.ReadCharArray(49); + Field3 = buffer.ReadInt(4) + (2); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteCharArray(128, Field1); + buffer.WriteCharArray(49, Field2); + buffer.WriteInt(4, Field3 - (2)); + } + + } + + public class ANNDataMessage : GameMessage + { + public int Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + } + + } + + public class BroadcastTextMessage : GameMessage + { + public string _Field0; + public string Field0 { get { return _Field0; } set { if(value != null && value.Length > 512) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadCharArray(512); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteCharArray(512, Field0); + } + + } + + public class DisplayGameTextMessage : GameMessage + { + public string _Field0; + public string Field0 { get { return _Field0; } set { if(value != null && value.Length > 512) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + public int? Field1; + public int? Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadCharArray(512); + if(buffer.ReadBool()) + Field1 = buffer.ReadInt(32); + if(buffer.ReadBool()) + Field2 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteCharArray(512, Field0); + if(Field1.HasValue) + buffer.WriteInt(32, Field1.Value); + if(Field2.HasValue) + buffer.WriteInt(32, Field2.Value); + } + + } + + public class GBIDDataMessage : GameMessage + { + public int Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + } + + } + + public class SNONameDataMessage : GameMessage + { + public SNOName Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = new SNOName(); + Field0.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + Field0.Encode(buffer); + } + + } + + public class SNOName + { + public int Field0; + public int Field1; + + public void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + } + + } + + public class SNODataMessage : GameMessage + { + public int Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + } + + } + + public class UInt64DataMessage : GameMessage + { + public long Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt64(64); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt64(64, Field0); + } + + } + + public class IntDataMessage : GameMessage + { + public int Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + } + + } + + public class NetworkAddressMessage : GameMessage + { + public int Field0; + public ushort Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = (ushort)buffer.ReadInt(16); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(16, Field1); + } + + } + + public class DWordDataMessage : GameMessage + { + public int Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + } + + } + + public class DataIDDataMessage : GameMessage + { + public int Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + } + + } + + public class PlayerIndexMessage : GameMessage + { + int _Field0; + public int Field0 { get { return _Field0; } set { if(value < -1 || value > 7) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(4) + (-1); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(4, Field0 - (-1)); + } + + } + + public class BoolDataMessage : GameMessage + { + public bool Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteBool(Field0); + } + + } + + public class GenericBlobMessage : GameMessage + { + public byte[] Data; + public override void Parse(GameBitBuffer buffer) + { + Data = buffer.ReadBlob(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteBlob(32, Data); + } + + } + + public class SimpleMessage : GameMessage + { + + public override void Parse(GameBitBuffer buffer) + { + } + + public override void Encode(GameBitBuffer buffer) + { + } + + } + + public class LogoutContextMessage : GameMessage + { + public bool Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteBool(Field0); + } + + } + + public class HeroStateMessage : GameMessage + { + public HeroStateData Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = new HeroStateData(); + Field0.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + Field0.Encode(buffer); + } + + } + + public class HeroStateData + { + public int Field0; + public int Field1; + public int Field2; + public int Field3; + int _Field4; + public int Field4 { get { return _Field4; } set { if(value < 0 || value > 0x3FFFFFFF) throw new ArgumentOutOfRangeException(); _Field4 = value; } } + public PlayerSavedData Field5; + public int Field6; + PlayerQuestRewardHistoryEntry[] _tQuestRewardHistory; + public PlayerQuestRewardHistoryEntry[] tQuestRewardHistory { get { return _tQuestRewardHistory; } set { if(value != null && value.Length > 100) throw new ArgumentOutOfRangeException(); _tQuestRewardHistory = value; } } + + public void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadInt(32); + Field4 = buffer.ReadInt(30); + Field5 = new PlayerSavedData(); + Field5.Parse(buffer); + Field6 = buffer.ReadInt(32); + tQuestRewardHistory = new PlayerQuestRewardHistoryEntry[buffer.ReadInt(7)]; + for(int i = 0;i < _tQuestRewardHistory.Length;i++) + { + _tQuestRewardHistory[i] = new PlayerQuestRewardHistoryEntry(); + _tQuestRewardHistory[i].Parse(buffer); + } + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + buffer.WriteInt(32, Field3); + buffer.WriteInt(30, Field4); + Field5.Encode(buffer); + buffer.WriteInt(32, Field6); + buffer.WriteInt(7, _tQuestRewardHistory.Length); + for(int i = 0;i < _tQuestRewardHistory.Length;i++) _tQuestRewardHistory[i].Encode(buffer); + } + + } + + public class PlayerSavedData + { + HotbarButtonData[] _Field0; + public HotbarButtonData[] Field0 { get { return _Field0; } set { if(value != null && value.Length != 6) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + public HotbarButtonData Field1; + public byte Field2; + public int Field3; + public int Field4; + public HirelingSavedData Field5; + public int Field6; + public LearnedLore Field7; + ActiveSkillSavedData[] _Field8; + public ActiveSkillSavedData[] Field8 { get { return _Field8; } set { if(value != null && value.Length != 6) throw new ArgumentOutOfRangeException(); _Field8 = value; } } + int[] _snoTraits; + public int[] snoTraits { get { return _snoTraits; } set { if(value != null && value.Length != 3) throw new ArgumentOutOfRangeException(); _snoTraits = value; } } + public SavePointData Field10; + + public void Parse(GameBitBuffer buffer) + { + Field0 = new HotbarButtonData[6]; + for(int i = 0;i < _Field0.Length;i++) + { + _Field0[i] = new HotbarButtonData(); + _Field0[i].Parse(buffer); + } + Field1 = new HotbarButtonData(); + Field1.Parse(buffer); + Field2 = (byte)buffer.ReadInt(8); + Field3 = buffer.ReadInt(32); + Field4 = buffer.ReadInt(32); + Field5 = new HirelingSavedData(); + Field5.Parse(buffer); + Field6 = buffer.ReadInt(32); + Field7 = new LearnedLore(); + Field7.Parse(buffer); + Field8 = new ActiveSkillSavedData[6]; + for(int i = 0;i < _Field8.Length;i++) + { + _Field8[i] = new ActiveSkillSavedData(); + _Field8[i].Parse(buffer); + } + snoTraits = new int[3]; + for(int i = 0;i < _snoTraits.Length;i++) _snoTraits[i] = buffer.ReadInt(32); + Field10 = new SavePointData(); + Field10.Parse(buffer); + } + + public void Encode(GameBitBuffer buffer) + { + for(int i = 0;i < _Field0.Length;i++) _Field0[i].Encode(buffer); + Field1.Encode(buffer); + buffer.WriteInt(8, Field2); + buffer.WriteInt(32, Field3); + buffer.WriteInt(32, Field4); + Field5.Encode(buffer); + buffer.WriteInt(32, Field6); + Field7.Encode(buffer); + for(int i = 0;i < _Field8.Length;i++) _Field8[i].Encode(buffer); + for(int i = 0;i < _snoTraits.Length;i++) buffer.WriteInt(32, _snoTraits[i]); + Field10.Encode(buffer); + } + + } + + public class HotbarButtonData + { + public int m_snoPower; + int _Field1; + public int Field1 { get { return _Field1; } set { if(value < -1 || value > 4) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + public int m_gbidItem; + + public void Parse(GameBitBuffer buffer) + { + m_snoPower = buffer.ReadInt(32); + Field1 = buffer.ReadInt(3) + (-1); + m_gbidItem = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, m_snoPower); + buffer.WriteInt(3, Field1 - (-1)); + buffer.WriteInt(32, m_gbidItem); + } + + } + + public class HirelingSavedData + { + HirelingInfo[] _Field0; + public HirelingInfo[] Field0 { get { return _Field0; } set { if(value != null && value.Length != 4) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + int _Field1; + public int Field1 { get { return _Field1; } set { if(value < 0 || value > 3) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + public int Field2; + + public void Parse(GameBitBuffer buffer) + { + Field0 = new HirelingInfo[4]; + for(int i = 0;i < _Field0.Length;i++) + { + _Field0[i] = new HirelingInfo(); + _Field0[i].Parse(buffer); + } + Field1 = buffer.ReadInt(2); + Field2 = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + for(int i = 0;i < _Field0.Length;i++) _Field0[i].Encode(buffer); + buffer.WriteInt(2, Field1); + buffer.WriteInt(32, Field2); + } + + } + + public class HirelingInfo + { + int _Field0; + public int Field0 { get { return _Field0; } set { if(value < 0 || value > 3) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + public int Field1; + int _Field2; + public int Field2 { get { return _Field2; } set { if(value < 0 || value > 127) throw new ArgumentOutOfRangeException(); _Field2 = value; } } + public int Field3; + public bool Field4; + public int Field5; + public int Field6; + public int Field7; + public int Field8; + + public void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(2); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(7); + Field3 = buffer.ReadInt(32); + Field4 = buffer.ReadBool(); + Field5 = buffer.ReadInt(32); + Field6 = buffer.ReadInt(32); + Field7 = buffer.ReadInt(32); + Field8 = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(2, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(7, Field2); + buffer.WriteInt(32, Field3); + buffer.WriteBool(Field4); + buffer.WriteInt(32, Field5); + buffer.WriteInt(32, Field6); + buffer.WriteInt(32, Field7); + buffer.WriteInt(32, Field8); + } + + } + + public class LearnedLore + { + public int Field0; + int[] _m_snoLoreLearned; + public int[] m_snoLoreLearned { get { return _m_snoLoreLearned; } set { if(value != null && value.Length != 256) throw new ArgumentOutOfRangeException(); _m_snoLoreLearned = value; } } + + public void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + m_snoLoreLearned = new int[256]; + for(int i = 0;i < _m_snoLoreLearned.Length;i++) _m_snoLoreLearned[i] = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + for(int i = 0;i < _m_snoLoreLearned.Length;i++) buffer.WriteInt(32, _m_snoLoreLearned[i]); + } + + } + + public class ActiveSkillSavedData + { + public int snoSkill; + int _Field1; + public int Field1 { get { return _Field1; } set { if(value < -1 || value > 4) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + + public void Parse(GameBitBuffer buffer) + { + snoSkill = buffer.ReadInt(32); + Field1 = buffer.ReadInt(3) + (-1); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, snoSkill); + buffer.WriteInt(3, Field1 - (-1)); + } + + } + + public class SavePointData + { + public int snoWorld; + public int Field1; + + public void Parse(GameBitBuffer buffer) + { + snoWorld = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, snoWorld); + buffer.WriteInt(32, Field1); + } + + } + + public class PlayerQuestRewardHistoryEntry + { + public int snoQuest; + public int Field1; + int _Field2; + public int Field2 { get { return _Field2; } set { if(value < 0 || value > 3) throw new ArgumentOutOfRangeException(); _Field2 = value; } } + + public void Parse(GameBitBuffer buffer) + { + snoQuest = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(2); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, snoQuest); + buffer.WriteInt(32, Field1); + buffer.WriteInt(2, Field2); + } + + } + + public class PlayerKickTimerMessage : GameMessage + { + public int Field0; + public int Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + } + + } + + public class NewPlayerMessage : GameMessage + { + int _Field0; + public int Field0 { get { return _Field0; } set { if(value < 0 || value > 7) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + public EntityId Field1; + public EntityId Field2; + public string _Field3; + public string Field3 { get { return _Field3; } set { if(value != null && value.Length > 49) throw new ArgumentOutOfRangeException(); _Field3 = value; } } + int _Field4; + public int Field4 { get { return _Field4; } set { if(value < -1 || value > 22) throw new ArgumentOutOfRangeException(); _Field4 = value; } } + int _Field5; + public int Field5 { get { return _Field5; } set { if(value < -1 || value > 4) throw new ArgumentOutOfRangeException(); _Field5 = value; } } + public int snoActorPortrait; + int _Field7; + public int Field7 { get { return _Field7; } set { if(value < 0 || value > 127) throw new ArgumentOutOfRangeException(); _Field7 = value; } } + public HeroStateData Field8; + public bool Field9; + public int Field10; + public int Field11; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(3); + Field1 = new EntityId(); + Field1.Parse(buffer); + Field2 = new EntityId(); + Field2.Parse(buffer); + Field3 = buffer.ReadCharArray(49); + Field4 = buffer.ReadInt(5) + (-1); + Field5 = buffer.ReadInt(3) + (-1); + snoActorPortrait = buffer.ReadInt(32); + Field7 = buffer.ReadInt(7); + Field8 = new HeroStateData(); + Field8.Parse(buffer); + Field9 = buffer.ReadBool(); + Field10 = buffer.ReadInt(32); + Field11 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(3, Field0); + Field1.Encode(buffer); + Field2.Encode(buffer); + buffer.WriteCharArray(49, Field3); + buffer.WriteInt(5, Field4 - (-1)); + buffer.WriteInt(3, Field5 - (-1)); + buffer.WriteInt(32, snoActorPortrait); + buffer.WriteInt(7, Field7); + Field8.Encode(buffer); + buffer.WriteBool(Field9); + buffer.WriteInt(32, Field10); + buffer.WriteInt(32, Field11); + } + + } + + public class SwapSceneMessage : GameMessage + { + public int Field0; + public int Field1; + public int Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + } + + } + + public class DestroySceneMessage : GameMessage + { + public int Field0; + public int Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + } + + } + + public class RevealSceneMessage : GameMessage + { + public int Field0; + public SceneSpecification Field1; + public int Field2; + public int snoScene; + public PRTransform Field4; + public int Field5; + public int snoSceneGroup; + int[] _arAppliedLabels; + public int[] arAppliedLabels { get { return _arAppliedLabels; } set { if(value != null && value.Length > 256) throw new ArgumentOutOfRangeException(); _arAppliedLabels = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = new SceneSpecification(); + Field1.Parse(buffer); + Field2 = buffer.ReadInt(32); + snoScene = buffer.ReadInt(32); + Field4 = new PRTransform(); + Field4.Parse(buffer); + Field5 = buffer.ReadInt(32); + snoSceneGroup = buffer.ReadInt(32); + arAppliedLabels = new int[buffer.ReadInt(9)]; + for(int i = 0;i < _arAppliedLabels.Length;i++) _arAppliedLabels[i] = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + Field1.Encode(buffer); + buffer.WriteInt(32, Field2); + buffer.WriteInt(32, snoScene); + Field4.Encode(buffer); + buffer.WriteInt(32, Field5); + buffer.WriteInt(32, snoSceneGroup); + buffer.WriteInt(9, arAppliedLabels.Length); + for(int i = 0;i < _arAppliedLabels.Length;i++) buffer.WriteInt(32, _arAppliedLabels[i]); + } + + } + + public class SceneSpecification + { + public int Field0; + public IVector2D Field1; + int[] _arSnoLevelAreas; + public int[] arSnoLevelAreas { get { return _arSnoLevelAreas; } set { if(value != null && value.Length != 4) throw new ArgumentOutOfRangeException(); _arSnoLevelAreas = value; } } + public int snoPrevWorld; + public int Field4; + public int snoPrevLevelArea; + public int snoNextWorld; + public int Field7; + public int snoNextLevelArea; + public int snoMusic; + public int snoCombatMusic; + public int snoAmbient; + public int snoReverb; + public int snoWeather; + public int snoPresetWorld; + public int Field15; + public int Field16; + public int Field17; + public int Field18; + public SceneCachedValues tCachedValues; + + public void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = new IVector2D(); + Field1.Parse(buffer); + arSnoLevelAreas = new int[4]; + for(int i = 0;i < _arSnoLevelAreas.Length;i++) _arSnoLevelAreas[i] = buffer.ReadInt(32); + snoPrevWorld = buffer.ReadInt(32); + Field4 = buffer.ReadInt(32); + snoPrevLevelArea = buffer.ReadInt(32); + snoNextWorld = buffer.ReadInt(32); + Field7 = buffer.ReadInt(32); + snoNextLevelArea = buffer.ReadInt(32); + snoMusic = buffer.ReadInt(32); + snoCombatMusic = buffer.ReadInt(32); + snoAmbient = buffer.ReadInt(32); + snoReverb = buffer.ReadInt(32); + snoWeather = buffer.ReadInt(32); + snoPresetWorld = buffer.ReadInt(32); + Field15 = buffer.ReadInt(32); + Field16 = buffer.ReadInt(32); + Field17 = buffer.ReadInt(32); + Field18 = buffer.ReadInt(32); + tCachedValues = new SceneCachedValues(); + tCachedValues.Parse(buffer); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + Field1.Encode(buffer); + for(int i = 0;i < _arSnoLevelAreas.Length;i++) buffer.WriteInt(32, _arSnoLevelAreas[i]); + buffer.WriteInt(32, snoPrevWorld); + buffer.WriteInt(32, Field4); + buffer.WriteInt(32, snoPrevLevelArea); + buffer.WriteInt(32, snoNextWorld); + buffer.WriteInt(32, Field7); + buffer.WriteInt(32, snoNextLevelArea); + buffer.WriteInt(32, snoMusic); + buffer.WriteInt(32, snoCombatMusic); + buffer.WriteInt(32, snoAmbient); + buffer.WriteInt(32, snoReverb); + buffer.WriteInt(32, snoWeather); + buffer.WriteInt(32, snoPresetWorld); + buffer.WriteInt(32, Field15); + buffer.WriteInt(32, Field16); + buffer.WriteInt(32, Field17); + buffer.WriteInt(32, Field18); + tCachedValues.Encode(buffer); + } + + } + + public class SceneCachedValues + { + public int Field0; + public int Field1; + public int Field2; + public AABB Field3; + public AABB Field4; + int[] _Field5; + public int[] Field5 { get { return _Field5; } set { if(value != null && value.Length != 4) throw new ArgumentOutOfRangeException(); _Field5 = value; } } + public int Field6; + + public void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + Field3 = new AABB(); + Field3.Parse(buffer); + Field4 = new AABB(); + Field4.Parse(buffer); + Field5 = new int[4]; + for(int i = 0;i < _Field5.Length;i++) _Field5[i] = buffer.ReadInt(32); + Field6 = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + Field3.Encode(buffer); + Field4.Encode(buffer); + for(int i = 0;i < _Field5.Length;i++) buffer.WriteInt(32, _Field5[i]); + buffer.WriteInt(32, Field6); + } + + } + + public class AABB + { + public Vector3D Field0; + public Vector3D Field1; + + public void Parse(GameBitBuffer buffer) + { + Field0 = new Vector3D(); + Field0.Parse(buffer); + Field1 = new Vector3D(); + Field1.Parse(buffer); + } + + public void Encode(GameBitBuffer buffer) + { + Field0.Encode(buffer); + Field1.Encode(buffer); + } + + } + + public class AssignTraitsMessage : GameMessage + { + int[] _snoPower; + public int[] snoPower { get { return _snoPower; } set { if(value != null && value.Length != 3) throw new ArgumentOutOfRangeException(); _snoPower = value; } } + + public override void Parse(GameBitBuffer buffer) + { + snoPower = new int[3]; + for(int i = 0;i < _snoPower.Length;i++) _snoPower[i] = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + for(int i = 0;i < _snoPower.Length;i++) buffer.WriteInt(32, _snoPower[i]); + } + + } + + public class UnassignSkillMessage : GameMessage + { + int _Field0; + public int Field0 { get { return _Field0; } set { if(value < 0 || value > 5) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(3); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(3, Field0); + } + + } + + public class AssignSkillMessage : GameMessage + { + public int snoPower; + int _Field1; + public int Field1 { get { return _Field1; } set { if(value < -1 || value > 4) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + int _Field2; + public int Field2 { get { return _Field2; } set { if(value < 0 || value > 5) throw new ArgumentOutOfRangeException(); _Field2 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + snoPower = buffer.ReadInt(32); + Field1 = buffer.ReadInt(3) + (-1); + Field2 = buffer.ReadInt(3); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, snoPower); + buffer.WriteInt(3, Field1 - (-1)); + buffer.WriteInt(3, Field2); + } + + } + + public class QuestCounterMessage : GameMessage + { + public int snoQuest; + public int snoLevelArea; + public int Field2; + public int Field3; + public int Field4; + public int Field5; + + public override void Parse(GameBitBuffer buffer) + { + snoQuest = buffer.ReadInt(32); + snoLevelArea = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadInt(32); + Field4 = buffer.ReadInt(32); + Field5 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, snoQuest); + buffer.WriteInt(32, snoLevelArea); + buffer.WriteInt(32, Field2); + buffer.WriteInt(32, Field3); + buffer.WriteInt(32, Field4); + buffer.WriteInt(32, Field5); + } + + } + + public class QuestMeterMessage : GameMessage + { + public int snoQuest; + public int Field1; + public float Field2; + + public override void Parse(GameBitBuffer buffer) + { + snoQuest = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadFloat32(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, snoQuest); + buffer.WriteInt(32, Field1); + buffer.WriteFloat32(Field2); + } + + } + + public class QuestUpdateMessage : GameMessage + { + public int snoQuest; + public int snoLevelArea; + public int Field2; + public bool Field3; + public bool Field4; + + public override void Parse(GameBitBuffer buffer) + { + snoQuest = buffer.ReadInt(32); + snoLevelArea = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadBool(); + Field4 = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, snoQuest); + buffer.WriteInt(32, snoLevelArea); + buffer.WriteInt(32, Field2); + buffer.WriteBool(Field3); + buffer.WriteBool(Field4); + } + + } + + public class CrafterLevelUpMessage : GameMessage + { + public int Field0; + public int Field1; + public int Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + } + + } + + public class CraftingResultsMessage : GameMessage + { + public int Field0; + public int Field1; + public int Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + } + + } + + public class EnchantItemMessage : GameMessage + { + public int Field0; + public int Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, Field1); + } + + } + + public class GoldModifiedMessage : GameMessage + { + public bool Field0; + int _Field1; + public int Field1 { get { return _Field1; } set { if(value < 0 || value > 13) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadBool(); + Field1 = buffer.ReadInt(4); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteBool(Field0); + buffer.WriteInt(4, Field1); + } + + } + + public class ACDCollFlagsMessage : GameMessage + { + public int Field0; + int _Field1; + public int Field1 { get { return _Field1; } set { if(value < 0 || value > 0xFFF) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = buffer.ReadInt(12); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(12, Field1); + } + + } + + public class RareItemNameMessage : GameMessage + { + public int Field0; + public RareItemName Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = new RareItemName(); + Field1.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + Field1.Encode(buffer); + } + + } + + public class RareItemName + { + public bool Field0; + public int snoAffixStringList; + public int Field2; + public int Field3; + + public void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadBool(); + snoAffixStringList = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteBool(Field0); + buffer.WriteInt(32, snoAffixStringList); + buffer.WriteInt(32, Field2); + buffer.WriteInt(32, Field3); + } + + } + + public class RareMonsterNamesMessage : GameMessage + { + public int Field0; + int[] _Field1; + public int[] Field1 { get { return _Field1; } set { if(value != null && value.Length != 2) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + int[] _Field2; + public int[] Field2 { get { return _Field2; } set { if(value != null && value.Length != 8) throw new ArgumentOutOfRangeException(); _Field2 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = new int[2]; + for(int i = 0;i < _Field1.Length;i++) _Field1[i] = buffer.ReadInt(32); + Field2 = new int[8]; + for(int i = 0;i < _Field2.Length;i++) _Field2[i] = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + for(int i = 0;i < _Field1.Length;i++) buffer.WriteInt(32, _Field1[i]); + for(int i = 0;i < _Field2.Length;i++) buffer.WriteInt(32, _Field2[i]); + } + + } + + public class GameSyncedDataMessage : GameMessage + { + public GameSyncedData Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = new GameSyncedData(); + Field0.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + Field0.Encode(buffer); + } + + } + + public class GameSyncedData + { + int _Field0; + public int Field0 { get { return _Field0; } set { if(value < 0 || value > 3) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + public int Field1; + public int Field2; + public int Field3; + public int Field4; + public int Field5; + public int Field6; + int[] _Field7; + public int[] Field7 { get { return _Field7; } set { if(value != null && value.Length != 2) throw new ArgumentOutOfRangeException(); _Field7 = value; } } + int[] _Field8; + public int[] Field8 { get { return _Field8; } set { if(value != null && value.Length != 2) throw new ArgumentOutOfRangeException(); _Field8 = value; } } + + public void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(2); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadInt(32); + Field4 = buffer.ReadInt(32); + Field5 = buffer.ReadInt(32); + Field6 = buffer.ReadInt(32); + Field7 = new int[2]; + for(int i = 0;i < _Field7.Length;i++) _Field7[i] = buffer.ReadInt(32); + Field8 = new int[2]; + for(int i = 0;i < _Field8.Length;i++) _Field8[i] = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(2, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + buffer.WriteInt(32, Field3); + buffer.WriteInt(32, Field4); + buffer.WriteInt(32, Field5); + buffer.WriteInt(32, Field6); + for(int i = 0;i < _Field7.Length;i++) buffer.WriteInt(32, _Field7[i]); + for(int i = 0;i < _Field8.Length;i++) buffer.WriteInt(32, _Field8[i]); + } + + } + + public class GameIdMessage : GameMessage + { + public GameId Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = new GameId(); + Field0.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + Field0.Encode(buffer); + } + + } + + public class EntityIdMessage : GameMessage + { + public EntityId Field0; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = new EntityId(); + Field0.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + Field0.Encode(buffer); + } + + } + diff --git a/src/tools/GameServer/TypeExtractor/typedescriptors.xml b/src/tools/GameServer/TypeExtractor/typedescriptors.xml new file mode 100644 index 00000000..0d8746c4 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/typedescriptors.xml @@ -0,0 +1,6319 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/tools/MooNet/HeaderViewer/.gitignore b/src/tools/MooNet/HeaderViewer/.gitignore new file mode 100644 index 00000000..b37c0835 --- /dev/null +++ b/src/tools/MooNet/HeaderViewer/.gitignore @@ -0,0 +1,4 @@ +/bin/ +/obj/ +/*.pidb +/*.csproj.ReSharper diff --git a/src/tools/MooNet/HeaderViewer/HeaderViewer.csproj b/src/tools/MooNet/HeaderViewer/HeaderViewer.csproj new file mode 100644 index 00000000..f8420fe9 --- /dev/null +++ b/src/tools/MooNet/HeaderViewer/HeaderViewer.csproj @@ -0,0 +1,101 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {19F1717B-23ED-475F-AC31-1ACD1155B590} + WinExe + Properties + Mooege.Tools.HeaderViewer + Mooege.Tools.HeaderViewer + v4.0 + Client + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\..\..\dep\protobuf-csharp\Google.ProtocolBuffers.dll + + + + + + + + + + + + + + Form + + + MainForm.cs + + + + + MainForm.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + {4CC19847-6F24-4453-9E31-126F94308AB9} + LibMooNet + + + {1519D483-C89D-4B86-8A48-2E4F05440423} + MooNetHelpers + + + + + + \ No newline at end of file diff --git a/src/tools/MooNet/HeaderViewer/MainForm.Designer.cs b/src/tools/MooNet/HeaderViewer/MainForm.Designer.cs new file mode 100644 index 00000000..f520afa1 --- /dev/null +++ b/src/tools/MooNet/HeaderViewer/MainForm.Designer.cs @@ -0,0 +1,81 @@ +namespace Mooege.Tools.HeaderViewer +{ + partial class MainForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); + this.inputBox = new System.Windows.Forms.TextBox(); + this.outputBox = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // inputBox + // + this.inputBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.inputBox.Location = new System.Drawing.Point(13, 13); + this.inputBox.Name = "inputBox"; + this.inputBox.Size = new System.Drawing.Size(340, 20); + this.inputBox.TabIndex = 0; + this.inputBox.TextChanged += new System.EventHandler(this.inputBox_TextChanged); + // + // outputBox + // + this.outputBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.outputBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.outputBox.Location = new System.Drawing.Point(13, 40); + this.outputBox.Multiline = true; + this.outputBox.Name = "outputBox"; + this.outputBox.ReadOnly = true; + this.outputBox.Size = new System.Drawing.Size(340, 105); + this.outputBox.TabIndex = 1; + // + // MainForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(365, 157); + this.Controls.Add(this.outputBox); + this.Controls.Add(this.inputBox); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Name = "MainForm"; + this.Text = "Proto Packet Header Viewer"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox inputBox; + private System.Windows.Forms.TextBox outputBox; + } +} + diff --git a/src/tools/MooNet/HeaderViewer/MainForm.cs b/src/tools/MooNet/HeaderViewer/MainForm.cs new file mode 100644 index 00000000..5e2180d1 --- /dev/null +++ b/src/tools/MooNet/HeaderViewer/MainForm.cs @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Windows.Forms; +using Google.ProtocolBuffers; +using Mooege.Tools.Helpers; + +namespace Mooege.Tools.HeaderViewer +{ + public partial class MainForm : Form + { + public MainForm() + { + InitializeComponent(); + } + + private void inputBox_TextChanged(object sender, EventArgs e) + { + ParseBytes(inputBox.Text.Trim().Replace(" ", String.Empty)); + } + + private void ParseBytes(string bytestring) + { + if (bytestring.Length % 2 == 0 && bytestring.Length >= 10) + { + byte[] array = new byte[bytestring.Length / 2]; + for (int i = 0, j = 0; i < bytestring.Length - 1; i+=2, ++j) + { + int b = (Conversion.ParseDigit(bytestring[i]) * 16) + + Conversion.ParseDigit(bytestring[i+1]); + array[j] = (byte)b; + } + ParseHeader(array); + } + else + { + outputBox.Text = "Not enough characters"; + } + } + + private void ParseHeader(byte[] array) + { + CodedInputStream stream = CodedInputStream.CreateInstance(array); + var size = (stream.ReadRawByte() << 8) | stream.ReadRawByte(); // header size. + var headerData = stream.ReadRawBytes(size); // header data. + var Header = bnet.protocol.Header.ParseFrom(headerData); // parse header. + outputBox.ResetText(); + outputBox.Text = string.Format( + "ServiceID = {0}\r\n" + + "MethodID = {1}\r\n" + + "Token = {2}\r\n" + + "ObjectID = {3}\r\n" + + "Size = {4}\r\n" + + "Status = {5}\r\n" + + "Errors = {6}\r\n", + Header.ServiceId, + Header.HasMethodId ? Header.MethodId.ToString() : "None", + Header.HasToken ? Header.Token.ToString() : "None", + Header.HasObjectId ? Header.ObjectId.ToString() : "None", + Header.HasSize ? Header.Size.ToString() : "None", + Header.HasStatus ? Header.Status.ToString() : "None", + Header.ErrorCount); + } + } +} diff --git a/src/tools/MooNet/HeaderViewer/MainForm.resx b/src/tools/MooNet/HeaderViewer/MainForm.resx new file mode 100644 index 00000000..f6c6ff14 --- /dev/null +++ b/src/tools/MooNet/HeaderViewer/MainForm.resx @@ -0,0 +1,249 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + AAABAAMAMDAAAAEACACoDgAANgAAACAgAAABAAgAqAgAAN4OAAAQEAAAAQAIAGgFAACGFwAAKAAAADAA + AABgAAAAAQAIAAAAAAAACQAAAAAAAAAAAAAAAQAAAAAAAN7e3wDMzM4A9fX2AC4uLgDQ0NEAlJSVADMz + NABcXFwAhoaHADc3NwAkJCMAYWFiAPDw8QChoaEAZWVlALi4uABAQEAA4uLjAC0tLABXV1cA0NDSAPn5 + +gBubm4AMjIyAFtbWgDU1NUANjY1AOvr7ABgYGAAxsbHAIqKiwA7OzsAUlJSAPT09QBAQEEALS0tAERE + RADm5ucAMTEwADIyMwBbW1sAhYWGADY2NgDY2NkA7+/wALOztAB7e3sAPz8/AOHh4gCSkpIAVlZWALy8 + vQBtbW0AMTExAJeXmADq6usArq6vAMXFxgA6OjoA3NzdAMnJyQDz8/QApKSkAGhoaAAsLCwA5eXmANLS + 0gBaWloA6enpAHFxcQDq6uwANTU1AExMTADu7u8AUVFSAPPz9QA+Pj4AKysqAJGRkQBCQkEAu7u8ADAw + MACWlpcAR0dHAOnp6gDExMUA7e3tADk5OQBjY2QA8vLzALa2twBnZ2cAKysrAM3NzgB+fn4AQkJCAC8v + LgCoqKkAlZWVAFlZWQBGRkUAv7/AAKysrAA0NDQAw8PDAF5eXwCHh4cA7e3uADg4NwA5OToAyMjJAPHx + 8QB5eXkAzMzMAPb29wC6ursAa2trAC8vLwCCgoIA6OjpAKysrQBwcHEAmZmZADQ0NQDDw8QAS0tMAHR0 + dAA4ODgAnp6fAMfHxwCLi4sAT09PAPHx8gBmZmYAKioqAMzMzQBBQUEALy8wAFhYWAD6+vsARkZHADMz + MwCGhoYA7OztADg4OQBhYWEAx8fIALS0tAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ0dHZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + R2dnR2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnUSYmUWdnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ0c1hS0thTVHZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnR1GIc1JSc4hRR2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ1w0km06bjRcZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dHAxxd + TkwvMYdpA0dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnUZELXz4+X5EcUWdnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dHF1dwgYSEgXBXF0dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dHUU8ZFXd3FRlPUUdnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dHjUcNDBsbDA1HjUdnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnRxJe + PRsbPV4SR2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnKoZbN4+PN1uGKmdnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnKiMTKywsKxMjKmdnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnR3VIXQwMXUh1R2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnR1FTHYSEHVNRR2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnRzUi + ZVlZZSI1R2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnR1EkfISEfCRRR2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dHCQODBAwMBIMDCUdnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ0dRUUBDO0lJO0NAUVFHZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnFyNMShp+SY+PSX4aSkwjF2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ0cnfy48BZA4 + ITc3ITiQBTwufydHZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2cmghVuJCAALBsbLAAgJG4VgiZn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dHR3V9cVqMiWGEG4+PG4RhiYxacX11R0dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2cqR2cXZxckWAY1YhuPGzc3G48bYjUGWCQXZxdnRypnZ2dnZ2dnZ2dnZ2dnZ2dnZ41A + AzUfRwNATYp4RmtEApOTAkRrRniKTUADRx81A0CNZ2dnZ2dnZ2dnZ2dnZ2dnZwkoNg9oUHoeLTtZj1Q9 + FCAgFD1Uj1k7LR56UGgPNigJZ2dnZ2dnZ2dnZ2dnZ2dHdQcBPYuLAkmPPQw3N1lxY3V1Y3FZNzcMPY9J + AouLPQEHdUdnZ2dnZ2dnZ2dnZ2dnF4gTdIBdQUtvNxs3hDkgIyoqIyA5hDcbN29LQV2AdBOIF2dnZ2dn + Z2dnZ2dnZ2dnZxdAIxdkeY5mSTcMQjJAKmdnKkAyQgw3SWaOeWQXI0AXZ2dnZ2dnZ2dnZ2dnZ2dnZ2cq + R401AwoYJWtWalwqZ2dnZypcalZrJRgKAzWNRypnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ0dHKo0QM3IwKCMq + Z2dnZyojKDByMxCNKkdHZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ0cSKQIRMhIqZ2dnZyoSMhECKRJH + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ0dRJFUsFkAqZ2dnZypAFixVJFFHZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dHEg4bZnVnZ2dnZ2d1ZhsOEkdnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZxcIOz9AKmdnKkA/OwgXZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ40XRXZ/ + jUdHjX92RReNZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2cGYGwqjWdnjSpsYAZnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnR42NZ2dnZ42NR2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ3tnZ2dnZ2d7Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2cAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAIAAAAEAAAAABAAgAAAAAAAAEAAAAAAAAAAAAAAAB + AAAAAAAASUlJAO7u7wArKysAwcHCAFZWVgCfn58AODg4AN3d3gApKSkA6OjoAM7OzwC/v8AAfX18ALCw + sQD5+foANjY2ANvb3AB0dHUAJycnAGVlZgBwcHAAn5+gADg4OQA0NDQAysrLAKysrQBqamkA9fX2ADY2 + NwAyMjIALi4tAF1dXQA0NDUA8/P0ADAwMACZmZoALi4uACoqKQB3d3cAtbW2AFlZWQDv7/AAiIiJAODg + 4QAsLCwA0dHSAGpqawB1dXUAs7O0AExMTQBXV1cAlZWWAO3t7gA5OTkAKioqADU1NADa2toAWVlaAFVV + VQCioqMAra2tAPr6+wA3NzcAKCgoAICAgACvr7AAkZGSAERERAA1NTUAjY2NAMvLzABvb28AYGBgAEJC + QgAzMzMAYmJjALa2tgCcnJ0AQEBAAOXl5gAxMTEAa2trAKmpqgDy8vMAPj4+AOPj5AAvLy8A1NTVAG1t + bgAgICAAeHh4AFpaWgCYmJkAS0tLAPDw8QA8PDwALS0tAGdnZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAABcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcX + FxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxdERBcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcX + RGBgRBcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXF0QdOjodRBcXFxcXFxcXFxcXFxcXFxcXFxcXFxcX + FxcPCChBQSglDxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXREo+GTlbPBxKIBcXFxcXFxcXFxcXFxcXFxcX + FxcXFxdEJDIvJloRBCREFxcXFxcXFxcXFxcXFxcXFxcXFxcXF0RKNQUBAQU1SkQXFxcXFxcXFxcXFxcX + FxcXFxcXFxcXREo+RlNTRj5KRBcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXDwgjGxsjCA8XFxcXFxcXFxcX + FxcXFxcXFxcXFxcXFxcPCEBTU0AIDxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFw8CRykpRwIPFxcXFxcX + FxcXFxcXFxcXFxcXFxcXFxcXDywTNDQTLA8XFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcGLC4BAS4sBhcX + FxcXFxcXFxcXFxcXFxcXFxcXFxdESiwSDFNTDBIsSkQXFxcXFxcXFxcXFxcXFxcXFxcXRFYcFEkVGxsV + SRQcVkQXFxcXFxcXFxcXFxcXFxcXFw9QThgwADgpKTgAMBhOUA8XFxcXFxcXFxcXFxcXRA8XFwJYOyJc + ITQ0IVwiO1gCFxcPRBcXFxcXFxcXF0RQPyI1IlBfTQEhLS0hAU1fUCI1Ij9QRBcXFxcXFxdEHVQzClcn + UhAhXk8fH09eIRBSJ1cKM1QdRBcXFxcXF0RQQypMVT0OAQEHSCwsSAcBAQ49VUwqQ1BEFxcXFxcXFxdQ + EiwASw0hCRoSPj4SGgkhDUsALBJQFxcXFxcXFxcXFxcPRB1ZYT0LUERERERQCz1hWR1EDxcXFxcXFxcX + FxcXFxcXDzcWVwNgRBcXRGADVxY3DxcXFxcXFxcXFxcXFxcXFxcXDzZRKzFgDw9gMStRNg8XFxcXFxcX + FxcXFxcXFxcXFxcXRCxFQh5ERB5CRSxEFxcXFxcXFxcXFxcXFxcXFxcXFxcXF1ZdBkpKBl1WFxcXFxcX + FxcXFxcXFxcXFxcXFxcXFxcXRFZKFxdKVkQXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXRBcXFxdEFxcX + FxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcX + FxcXFxcXFxcXFxcXFxcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAA + AAA0NDQAPT09AI6OjwC3t7cANjY2ALKyswBzc3MALy8vADg4OAAxMTEAcHBxAGVlZQAhISEA8/P0AMjI + yQBeXl4AMzMzAOzs7QAsLCwAQEBBADU1NQDIyMgAR0dHAGRkZQAlJSUAzMzNAC4uLgBiYmIANzc3ACws + KwCqqqsAQEBAANPT0wAnJycAZGRkAJiYmACBgYIAzs7OACIiIgArKysAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAABQUAAAAAAAAAAAAAAAAAAAHBwAAAAAAAAAAAAAAABQHFxcHFAAAAAAAAAAAABQJ + EyQkHwkUAAAAAAAAAAAUEBwZGRwQFAAAAAAAAAAAABQdFQ4dFAAAAAAAAAAAAAAIIQUFIQgAAAAAAAAA + AAAUBxgDAxgHFAAAAAAAAAAQEiILICALIhIQAAAAAAAQAQgPHhERHg8IARAAAAAQCCMlJQ0KCg0lJSMI + EAAAAAAIFiAjJiYjIBYIAAAAAAAABAwGAicnAgYMBAAAAAAAAAAUEBscHBsQFAAAAAAAAAAAAAAaAAAa + AAAAAAAAAAAAAAAAFAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + + + \ No newline at end of file diff --git a/src/tools/MooNet/HeaderViewer/Program.cs b/src/tools/MooNet/HeaderViewer/Program.cs new file mode 100644 index 00000000..ef8952ff --- /dev/null +++ b/src/tools/MooNet/HeaderViewer/Program.cs @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Windows.Forms; + +namespace Mooege.Tools.HeaderViewer +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new MainForm()); + } + } +} diff --git a/src/tools/MooNet/HeaderViewer/Properties/AssemblyInfo.cs b/src/tools/MooNet/HeaderViewer/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..3bd64ccf --- /dev/null +++ b/src/tools/MooNet/HeaderViewer/Properties/AssemblyInfo.cs @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("HeaderParser")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("HeaderParser")] +[assembly: AssemblyCopyright("Copyright © 2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("29f2f279-8267-4e66-bb30-6553ca770773")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/tools/MooNet/HeaderViewer/Properties/Resources.Designer.cs b/src/tools/MooNet/HeaderViewer/Properties/Resources.Designer.cs new file mode 100644 index 00000000..88ef4e7c --- /dev/null +++ b/src/tools/MooNet/HeaderViewer/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.237 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Mooege.Tools.HeaderViewer.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Mooege.Tools.HeaderViewer.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/src/tools/MooNet/HeaderViewer/Properties/Resources.resx b/src/tools/MooNet/HeaderViewer/Properties/Resources.resx new file mode 100644 index 00000000..af7dbebb --- /dev/null +++ b/src/tools/MooNet/HeaderViewer/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/src/tools/MooNet/HeaderViewer/Properties/Settings.Designer.cs b/src/tools/MooNet/HeaderViewer/Properties/Settings.Designer.cs new file mode 100644 index 00000000..6c136d47 --- /dev/null +++ b/src/tools/MooNet/HeaderViewer/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.237 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Mooege.Tools.HeaderViewer.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/src/tools/MooNet/HeaderViewer/Properties/Settings.settings b/src/tools/MooNet/HeaderViewer/Properties/Settings.settings new file mode 100644 index 00000000..39645652 --- /dev/null +++ b/src/tools/MooNet/HeaderViewer/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/source/ProtoStringFixer/ProtoStringFixer.csproj b/src/tools/MooNet/Helpers/MooNetHelpers.csproj similarity index 82% rename from source/ProtoStringFixer/ProtoStringFixer.csproj rename to src/tools/MooNet/Helpers/MooNetHelpers.csproj index 5d15ed76..b5949eee 100644 --- a/source/ProtoStringFixer/ProtoStringFixer.csproj +++ b/src/tools/MooNet/Helpers/MooNetHelpers.csproj @@ -6,11 +6,10 @@ 9.0.21022 2.0 {1519D483-C89D-4B86-8A48-2E4F05440423} - Exe - ProtoStringFixer - ProtoStringFixer + Library + Mooege.Tools.Helpers + Mooege.Tools.Helpers v4.0 - ProtoStringFixer.Program true @@ -32,12 +31,12 @@ + - + + - - - + \ No newline at end of file diff --git a/src/tools/MooNet/Helpers/Properties/AssemblyInfo.cs b/src/tools/MooNet/Helpers/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..483f9bda --- /dev/null +++ b/src/tools/MooNet/Helpers/Properties/AssemblyInfo.cs @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. + +[assembly: AssemblyTitle("ProtoHelpers")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// The form "{Major}.{Minor}.*" will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}.*" will update just the revision. + +[assembly: AssemblyVersion("1.0.*")] + +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. + +//[assembly: AssemblyDelaySign(false)] +//[assembly: AssemblyKeyFile("")] + diff --git a/src/tools/MooNet/Helpers/src/Utils.cs b/src/tools/MooNet/Helpers/src/Utils.cs new file mode 100644 index 00000000..4f98ab8a --- /dev/null +++ b/src/tools/MooNet/Helpers/src/Utils.cs @@ -0,0 +1,163 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Text; + +namespace Mooege.Tools.Helpers +{ + public static class Extensions + { + public static string DumpHex(this byte[] array, bool spaced) { + StringBuilder sb = new StringBuilder(); + foreach (byte b in array) { + sb.Append(b.ToString("X2")); + if (spaced) + sb.Append(' '); + } + return sb.ToString(); + } + } + + public static class Conversion { + // Behold, the horrific beauty -- courtesy of the dastardly fellas from protobuf-csharp + public static byte[] Unescape(string input) + { + byte[] result = new byte[input.Length]; + int pos = 0; + for (int i = 0; i < input.Length; i++) + { + char c = input[i]; + if (c > 127 || c < 32) + { + throw new FormatException("Escaped string must only contain ASCII"); + } + if (c != '\\') + { + result[pos++] = (byte)c; + continue; + } + if (i + 1 >= input.Length) + { + throw new FormatException("Invalid escape sequence: '\\' at end of string."); + } + + i++; + c = input[i]; + if (c >= '0' && c <= '7') + { + // Octal escape. + int code = ParseDigit(c); + if (i + 1 < input.Length && IsOctal(input[i + 1])) + { + i++; + code = code * 8 + ParseDigit(input[i]); + } + if (i + 1 < input.Length && IsOctal(input[i + 1])) + { + i++; + code = code * 8 + ParseDigit(input[i]); + } + result[pos++] = (byte)code; + } + else + { + switch (c) + { + case 'a': + result[pos++] = 0x07; + break; + case 'b': + result[pos++] = (byte)'\b'; + break; + case 'f': + result[pos++] = (byte)'\f'; + break; + case 'n': + result[pos++] = (byte)'\n'; + break; + case 'r': + result[pos++] = (byte)'\r'; + break; + case 't': + result[pos++] = (byte)'\t'; + break; + case 'v': + result[pos++] = 0x0b; + break; + case '\\': + result[pos++] = (byte)'\\'; + break; + case '\'': + result[pos++] = (byte)'\''; + break; + case '"': + result[pos++] = (byte)'\"'; + break; + case 'x': + // hex escape + int code; + if (i + 1 < input.Length && IsHex(input[i + 1])) + { + i++; + code = ParseDigit(input[i]); + } + else + { + throw new FormatException("Invalid escape sequence: '\\x' with no digits"); + } + if (i + 1 < input.Length && IsHex(input[i + 1])) + { + ++i; + code = code * 16 + ParseDigit(input[i]); + } + result[pos++] = (byte)code; + break; + default: + throw new FormatException("Invalid escape sequence: '\\" + c + "'"); + } + } + } + byte[] bout = new byte[pos]; + Array.Copy(result, bout, pos); + return bout; + } + + public static bool IsOctal(char c) + { + return '0' <= c && c <= '7'; + } + + public static bool IsHex(char c) + { + return ('0' <= c && c <= '9') + || ('a' <= c && c <= 'f') + || ('A' <= c && c <= 'F'); + } + + public static int ParseDigit(char c) + { + if ('0' <= c && c <= '9') + return c - '0'; + else if ('a' <= c && c <= 'z') + return c - 'a' + 10; + else + return c - 'A' + 10; + } + } +} diff --git a/src/tools/MooNet/ProtoExtractor/Program.cs b/src/tools/MooNet/ProtoExtractor/Program.cs new file mode 100644 index 00000000..089d23ee --- /dev/null +++ b/src/tools/MooNet/ProtoExtractor/Program.cs @@ -0,0 +1,303 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +// Contains code from: https://github.com/tomrus88/d3proto/blob/master/protod/Program.cs + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Google.ProtocolBuffers; +using EnumValue = Google.ProtocolBuffers.Descriptors.EnumValueDescriptor; +using FieldProto = Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto; +using FieldType = Google.ProtocolBuffers.Descriptors.FieldType; +using FileProto = Google.ProtocolBuffers.DescriptorProtos.FileDescriptorProto; +using Label = Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Label; +using Type = Google.ProtocolBuffers.DescriptorProtos.FieldDescriptorProto.Types.Type; + +namespace ProtoExtractor +{ + class Program + { + private static readonly List Protos = new List(); + + private static readonly Dictionary Labels = new Dictionary + { + {default(Label), "unknown"}, + {Label.LABEL_OPTIONAL, "optional"}, + {Label.LABEL_REQUIRED, "required"}, + {Label.LABEL_REPEATED, "repeated"} + }; + + private static readonly Dictionary Types = new Dictionary + { + {default(Type), "unknown"}, + {Type.TYPE_DOUBLE, "double"}, + {Type.TYPE_FLOAT, "float"}, + {Type.TYPE_INT64, "int64"}, + {Type.TYPE_UINT64, "uint64"}, + {Type.TYPE_INT32, "int32"}, + {Type.TYPE_FIXED64, "fixed64"}, + {Type.TYPE_FIXED32, "fixed32"}, + {Type.TYPE_BOOL, "bool"}, + {Type.TYPE_STRING, "string"}, + {Type.TYPE_GROUP, "group"}, + {Type.TYPE_MESSAGE, "message"}, + {Type.TYPE_BYTES, "bytes"}, + {Type.TYPE_UINT32, "uint32"}, + {Type.TYPE_ENUM, "enum"}, + {Type.TYPE_SFIXED32, "sfixed32"}, + {Type.TYPE_SFIXED64, "sfixed64"}, + {Type.TYPE_SINT32, "sint32"}, + {Type.TYPE_SINT64, "sint64"} + }; + + static void Main(string[] args) + { + Console.WriteLine("ProtoBin Extractor started.."); + + var files = Directory.GetFiles(".", "*.protobin", SearchOption.AllDirectories); + Console.WriteLine("Found {0} protobin files.", files.Count()); + + foreach (var file in files) + { + var proto = FileProto.ParseFrom(File.ReadAllBytes(file)); + Protos.Add(proto); + } + + foreach (var proto in Protos) + ParseProtoBin(proto); + + Console.WriteLine("Dumped {0} proto files.", files.Count()); + Console.ReadLine(); + } + + private static void ParseProtoBin(FileProto proto) + { + SaveAsText(proto); + SaveDefinition(proto); + } + + private static void SaveAsText(FileProto proto) + { + var path = "text\\" + proto.Name + ".txt"; + var dir = Path.GetDirectoryName(path); + if (dir != null && !Directory.Exists(dir)) + Directory.CreateDirectory(dir); + + using (var w = new StreamWriter(path)) + { + proto.PrintTo(w); + } + } + + private static void SaveDefinition(FileProto proto) + { + var path = "definitions\\" + proto.Name; + var dir = Path.GetDirectoryName(path); + if (dir != null && !Directory.Exists(dir)) + Directory.CreateDirectory(dir); + + using (var w = new StreamWriter(path)) + { + foreach (var d in proto.DependencyList) + { + w.WriteLine("import \"{0}\";", d); + } + + if (proto.DependencyCount > 0) + w.WriteLine(); + + if (proto.HasPackage) + { + w.WriteLine("package {0};", proto.Package); + w.WriteLine(); + } + + if (proto.HasOptions) + { + foreach (var o in proto.Options.AllFields) + { + if (o.Key.FieldType == FieldType.Enum) + w.WriteLine("option {0} = {1};", o.Key.Name, ((EnumValue)o.Value).Name); + else if (o.Key.FieldType == FieldType.String) + w.WriteLine("option {0} = \"{1}\";", o.Key.Name, o.Value); + else + w.WriteLine("option {0} = {1};", o.Key.Name, o.Value.ToString().ToLower()); + } + + w.WriteLine(); + } + + foreach (var m in proto.MessageTypeList) + { + w.WriteLine("message {0}", m.Name); + w.WriteLine("{"); + + foreach (var n in m.NestedTypeList) + { + w.WriteLine(" message {0}", n.Name); + w.WriteLine(" {"); + foreach (var ef in n.FieldList) + { + w.WriteLine(" {0} {1} {2} = {3};", Labels[ef.Label], GetTypeName(ef), ef.Name, ef.Number); + } + w.WriteLine(" }"); + w.WriteLine(); + } + + foreach (var e in m.EnumTypeList) + { + w.WriteLine(" enum {0}", e.Name); + w.WriteLine(" {"); + foreach (var ev in e.ValueList) + { + w.WriteLine(" {0} = {1};", ev.Name, ev.Number); + } + w.WriteLine(" }"); + w.WriteLine(); + } + + //if (m.EnumTypeCount > 0) + // w.WriteLine(); + + foreach (var f in m.FieldList) + { + if (f.HasDefaultValue) + { + w.WriteLine(" {0} {1} {2} = {3} [default = {4}];", Labels[f.Label], GetTypeName(f), f.Name, f.Number, f.Type == Type.TYPE_STRING ? string.Format("\"{0}\"", f.DefaultValue) : f.DefaultValue); + } + else + { + if (f.HasOptions && f.Options.HasPacked) + { + w.WriteLine(" {0} {1} {2} = {3} [packed={4}];", Labels[f.Label], GetTypeName(f), f.Name, f.Number, f.Options.Packed.ToString().ToLower()); + } + else + { + w.WriteLine(" {0} {1} {2} = {3};", Labels[f.Label], GetTypeName(f), f.Name, f.Number); + } + } + } + + //if (m.FieldCount > 0) + // w.WriteLine(); + + foreach (var er in m.ExtensionRangeList) + { + w.WriteLine(" extensions {0} to {1};", er.Start, + er.End == 0x20000000 ? "max" : er.End.ToString()); + } + + //if (m.ExtensionRangeCount > 0) + // w.WriteLine(); + + foreach (var ext in m.ExtensionList) + { + w.WriteLine(" extend {0}", ext.Extendee); + w.WriteLine(" {"); + { + w.WriteLine(" {0} {1} {2} = {3};", Labels[ext.Label], GetTypeName(ext), ext.Name, ext.Number); + } + w.WriteLine(" }"); + } + + w.WriteLine("}"); + w.WriteLine(); + } + + foreach (var s in proto.ServiceList) + { + w.WriteLine("service {0}", s.Name); + w.WriteLine("{"); + + foreach (var m in s.MethodList) + { + w.Write(" rpc {0}({1}) returns({2})", m.Name, m.InputType, m.OutputType); + + if (m.HasOptions) + { + w.WriteLine(); + w.WriteLine(" {"); + + foreach (var o in m.Options.UnknownFields.FieldDictionary) + { + var fdp = GetExtFieldDescriptorById(o.Key); + + w.WriteLine(" option ({0}) = {1};", fdp.Name, GetValue(fdp, o.Value)); + } + w.WriteLine(" }"); + } + else + w.WriteLine(";"); + } + + w.WriteLine("}"); + w.WriteLine(); + } + + foreach (var e in proto.EnumTypeList) + { + w.WriteLine("enum {0}", e.Name); + w.WriteLine("{"); + foreach (var ev in e.ValueList) + { + w.WriteLine(" {0} = {1};", ev.Name, ev.Number); + } + w.WriteLine("}"); + w.WriteLine(); + } + + foreach (var ext in proto.ExtensionList) + { + w.WriteLine("extend {0}", ext.Extendee); + w.WriteLine("{"); + { + w.WriteLine(" {0} {1} {2} = {3};", Labels[ext.Label], GetTypeName(ext), ext.Name, ext.Number); + } + w.WriteLine("}"); + w.WriteLine(); + } + } + } + + private static string GetTypeName(FieldProto ext) + { + return ext.HasTypeName ? ext.TypeName : Types[ext.Type]; + } + + private static object GetValue(FieldProto fdp, UnknownField unknownField) + { + if (unknownField.VarintList.Count > 0) return unknownField.VarintList[0]; + if (unknownField.Fixed32List.Count > 0) + { + if (fdp.Type == Type.TYPE_FLOAT) + return BitConverter.ToSingle(BitConverter.GetBytes(unknownField.Fixed32List[0]), 0); + return unknownField.Fixed32List[0]; + } + throw new Exception(); + } + + private static FieldProto GetExtFieldDescriptorById(int num) + { + return Protos.Where(p => p.ExtensionCount != 0) + .SelectMany(p => p.ExtensionList) + .FirstOrDefault(e => e.Number == num); + } + } +} diff --git a/src/tools/MooNet/ProtoExtractor/Properties/AssemblyInfo.cs b/src/tools/MooNet/ProtoExtractor/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..84e55c03 --- /dev/null +++ b/src/tools/MooNet/ProtoExtractor/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("proto-extractor")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("proto-extractor")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("4ea3511c-d116-44bb-9f6b-4ed29be78561")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/tools/MooNet/ProtoExtractor/ProtoExtractor.csproj b/src/tools/MooNet/ProtoExtractor/ProtoExtractor.csproj new file mode 100644 index 00000000..874ace34 --- /dev/null +++ b/src/tools/MooNet/ProtoExtractor/ProtoExtractor.csproj @@ -0,0 +1,64 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {5CAAB5DB-0280-47B0-B867-ACF2B01D37AE} + Exe + Properties + ProtoExtractor + ProtoExtractor + v4.0 + + + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\..\..\dep\protobuf-csharp\Google.ProtocolBuffers.dll + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/tools/MooNet/ProtoExtractor/app.config b/src/tools/MooNet/ProtoExtractor/app.config new file mode 100644 index 00000000..e3656033 --- /dev/null +++ b/src/tools/MooNet/ProtoExtractor/app.config @@ -0,0 +1,3 @@ + + + diff --git a/src/tools/MooNet/StringViewer/FormMain.Designer.cs b/src/tools/MooNet/StringViewer/FormMain.Designer.cs new file mode 100644 index 00000000..4b90a9e5 --- /dev/null +++ b/src/tools/MooNet/StringViewer/FormMain.Designer.cs @@ -0,0 +1,229 @@ +namespace Mooege.Tools.StringViewer +{ + partial class FormMain + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormMain)); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.textBoxInput = new System.Windows.Forms.TextBox(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.comboBoxOutputType = new System.Windows.Forms.ComboBox(); + this.label2 = new System.Windows.Forms.Label(); + this.hexBox = new System.Windows.Forms.TextBox(); + this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.cboProtos = new System.Windows.Forms.ComboBox(); + this.richTextBoxProto = new System.Windows.Forms.RichTextBox(); + this.textBoxProtoType = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.cmdDetect = new System.Windows.Forms.Button(); + this.groupBox1.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.groupBox3.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox1 + // + this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox1.Controls.Add(this.textBoxInput); + this.groupBox1.Location = new System.Drawing.Point(12, 9); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(429, 123); + this.groupBox1.TabIndex = 0; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Input Proto String"; + // + // textBoxInput + // + this.textBoxInput.Dock = System.Windows.Forms.DockStyle.Fill; + this.textBoxInput.Location = new System.Drawing.Point(3, 16); + this.textBoxInput.Multiline = true; + this.textBoxInput.Name = "textBoxInput"; + this.textBoxInput.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; + this.textBoxInput.Size = new System.Drawing.Size(423, 104); + this.textBoxInput.TabIndex = 0; + this.textBoxInput.TextChanged += new System.EventHandler(this.textBoxInput_TextChanged); + // + // groupBox2 + // + this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox2.Controls.Add(this.comboBoxOutputType); + this.groupBox2.Controls.Add(this.label2); + this.groupBox2.Controls.Add(this.hexBox); + this.groupBox2.Location = new System.Drawing.Point(12, 138); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(429, 177); + this.groupBox2.TabIndex = 2; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Hex Output"; + // + // comboBoxOutputType + // + this.comboBoxOutputType.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.comboBoxOutputType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxOutputType.FormattingEnabled = true; + this.comboBoxOutputType.Items.AddRange(new object[] { + "Raw", + "C# Array"}); + this.comboBoxOutputType.Location = new System.Drawing.Point(49, 23); + this.comboBoxOutputType.Name = "comboBoxOutputType"; + this.comboBoxOutputType.Size = new System.Drawing.Size(374, 21); + this.comboBoxOutputType.TabIndex = 2; + this.comboBoxOutputType.SelectedIndexChanged += new System.EventHandler(this.comboBoxOutputType_SelectedIndexChanged); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(9, 26); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(34, 13); + this.label2.TabIndex = 1; + this.label2.Text = "Type:"; + // + // hexBox + // + this.hexBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.hexBox.Location = new System.Drawing.Point(12, 51); + this.hexBox.Multiline = true; + this.hexBox.Name = "hexBox"; + this.hexBox.ReadOnly = true; + this.hexBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; + this.hexBox.Size = new System.Drawing.Size(411, 120); + this.hexBox.TabIndex = 0; + // + // groupBox3 + // + this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox3.Controls.Add(this.cmdDetect); + this.groupBox3.Controls.Add(this.cboProtos); + this.groupBox3.Controls.Add(this.richTextBoxProto); + this.groupBox3.Controls.Add(this.textBoxProtoType); + this.groupBox3.Controls.Add(this.label1); + this.groupBox3.Location = new System.Drawing.Point(15, 321); + this.groupBox3.Name = "groupBox3"; + this.groupBox3.Size = new System.Drawing.Size(429, 177); + this.groupBox3.TabIndex = 3; + this.groupBox3.TabStop = false; + this.groupBox3.Text = "Proto Output"; + // + // cboProtos + // + this.cboProtos.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cboProtos.FormattingEnabled = true; + this.cboProtos.Location = new System.Drawing.Point(126, 42); + this.cboProtos.Name = "cboProtos"; + this.cboProtos.Size = new System.Drawing.Size(225, 21); + this.cboProtos.TabIndex = 7; + this.cboProtos.SelectedIndexChanged += new System.EventHandler(this.cboProtos_SelectedIndexChanged); + // + // richTextBoxProto + // + this.richTextBoxProto.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.richTextBoxProto.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.richTextBoxProto.Location = new System.Drawing.Point(9, 69); + this.richTextBoxProto.Name = "richTextBoxProto"; + this.richTextBoxProto.ReadOnly = true; + this.richTextBoxProto.Size = new System.Drawing.Size(411, 102); + this.richTextBoxProto.TabIndex = 5; + this.richTextBoxProto.Text = ""; + // + // textBoxProtoType + // + this.textBoxProtoType.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxProtoType.Location = new System.Drawing.Point(126, 16); + this.textBoxProtoType.Name = "textBoxProtoType"; + this.textBoxProtoType.Size = new System.Drawing.Size(225, 20); + this.textBoxProtoType.TabIndex = 4; + this.textBoxProtoType.TextChanged += new System.EventHandler(this.textBoxProtoType_TextChanged); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(6, 21); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(111, 13); + this.label1.TabIndex = 3; + this.label1.Text = "Convert as proto type:"; + // + // cmdDetect + // + this.cmdDetect.Location = new System.Drawing.Point(363, 42); + this.cmdDetect.Name = "cmdDetect"; + this.cmdDetect.Size = new System.Drawing.Size(57, 21); + this.cmdDetect.TabIndex = 8; + this.cmdDetect.Text = "Detect"; + this.cmdDetect.UseVisualStyleBackColor = true; + this.cmdDetect.Click += new System.EventHandler(this.cmdDetect_Click); + // + // FormMain + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(453, 510); + this.Controls.Add(this.groupBox3); + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.groupBox1); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Name = "FormMain"; + this.Text = "String Viewer"; + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.groupBox3.ResumeLayout(false); + this.groupBox3.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.TextBox textBoxInput; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.GroupBox groupBox3; + private System.Windows.Forms.TextBox textBoxProtoType; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.RichTextBox richTextBoxProto; + private System.Windows.Forms.TextBox hexBox; + private System.Windows.Forms.ComboBox comboBoxOutputType; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.ComboBox cboProtos; + private System.Windows.Forms.Button cmdDetect; + } +} + diff --git a/src/tools/MooNet/StringViewer/FormMain.cs b/src/tools/MooNet/StringViewer/FormMain.cs new file mode 100644 index 00000000..98e211a9 --- /dev/null +++ b/src/tools/MooNet/StringViewer/FormMain.cs @@ -0,0 +1,173 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.IO; +using System.Reflection; +using System.Windows.Forms; +using Google.ProtocolBuffers; +using Mooege.Tools.Helpers; +using System.Linq; + +namespace Mooege.Tools.StringViewer +{ + public partial class FormMain : Form + { + private byte[] _byteData; + private bool _arrayize=false; + private System.Type[] protoTypes; + + public FormMain() + { + InitializeComponent(); + this.comboBoxOutputType.SelectedIndex = 0; + + var ProtoList = from types in Assembly.Load("LibMooNet").GetTypes() + where types.IsClass && types.Name != "Builder" + && types.Name != "Types" && types.Name != "Stub" + && types.IsAbstract == false && !types.Name.Contains("PrivateImplementation") + select types; + protoTypes = ProtoList.ToArray(); + } + + private void UpdateProtoOutput() + { + string typename = textBoxProtoType.Text.Trim(); + if (typename.Trim() == string.Empty) + return; + var type = Type.GetType(typename + ", LibMooNet"); + if (type == null) + { + richTextBoxProto.Text = "(no type)"; + return; + } + + try + { + var defaultMessage = MessageUtil.GetDefaultMessage(type); + IBuilder builder = defaultMessage.WeakCreateBuilderForType(); + if (builder == null) + { + richTextBoxProto.Text = "(no builder)"; + return; + } + builder.WeakMergeFrom(ByteString.CopyFrom(_byteData)); + richTextBoxProto.Text = TextFormat.PrintToString(builder.WeakBuild()); + } + catch (Exception ex) + { + richTextBoxProto.Text = ex.ToString(); + } + } + + public void UpdateHexOutput() + { + this.hexBox.Text = _arrayize ? Utils.GetArrayRepresentation(_byteData) : _byteData.DumpHex(false); + } + + public void UpdateOutputs() + { + UpdateHexOutput(); + UpdateProtoOutput(); + } + + private void textBoxInput_TextChanged(object sender, EventArgs e) + { + _byteData = Conversion.Unescape(this.textBoxInput.Text); + // Only write when it changes + File.WriteAllBytes("proto.raw", _byteData); + UpdateOutputs(); + } + + private void textBoxProtoType_TextChanged(object sender, EventArgs e) + { + UpdateProtoOutput(); + } + + private void comboBoxOutputType_SelectedIndexChanged(object sender, EventArgs e) + { + if (textBoxInput.Text.Trim() == string.Empty) return; + + _arrayize = !_arrayize; + UpdateHexOutput(); + } + + private void DetectProto() + { + cmdDetect.Enabled = false; + cboProtos.Items.Clear(); + Application.UseWaitCursor = true; + foreach (var proto in protoTypes) + { + Application.DoEvents(); + try + { + var defaultMessage = MessageUtil.GetDefaultMessage(proto); + IBuilder builder = defaultMessage.WeakCreateBuilderForType(); + builder.WeakMergeFrom(ByteString.CopyFrom(_byteData)); + builder.WeakBuild(); + if (builder.UnknownFields.SerializedSize == 0) + cboProtos.Items.Add(proto.FullName); + } + catch (Exception e) + { + if (!e.Message.Contains("missing") && !e.Message.Contains("the middle") + && !e.Message.Contains("invalid wire") && !e.Message.Contains("invalid tag")) + { + MessageBox.Show("Detected possible problem:\n" + e.Message); + } + } + } + if (cboProtos.Items.Count > 0) + { + cboProtos.SelectedIndex = 0; + } + else + MessageBox.Show("String does not completely build into any valid prototype.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + + Application.UseWaitCursor = false; + cmdDetect.Enabled = true; + } + + private void cboProtos_SelectedIndexChanged(object sender, EventArgs e) + { + textBoxProtoType.Text = cboProtos.SelectedItem.ToString(); + } + + private void cmdDetect_Click(object sender, EventArgs e) + { + DetectProto(); + } + } + + public static class Utils + { + public static string GetArrayRepresentation(byte[] array) + { + string bytes = string.Empty; + for (int index = 0; index < array.Length; index++) + { + byte b = array[index]; + bytes = bytes + "0x" + b.ToString("X2"); + if (index != array.Length - 1) bytes += ", "; + } + return "var data = new byte[] { " + bytes + " };"; + } + + } +} diff --git a/src/tools/MooNet/StringViewer/FormMain.resx b/src/tools/MooNet/StringViewer/FormMain.resx new file mode 100644 index 00000000..f6c6ff14 --- /dev/null +++ b/src/tools/MooNet/StringViewer/FormMain.resx @@ -0,0 +1,249 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + AAABAAMAMDAAAAEACACoDgAANgAAACAgAAABAAgAqAgAAN4OAAAQEAAAAQAIAGgFAACGFwAAKAAAADAA + AABgAAAAAQAIAAAAAAAACQAAAAAAAAAAAAAAAQAAAAAAAN7e3wDMzM4A9fX2AC4uLgDQ0NEAlJSVADMz + NABcXFwAhoaHADc3NwAkJCMAYWFiAPDw8QChoaEAZWVlALi4uABAQEAA4uLjAC0tLABXV1cA0NDSAPn5 + +gBubm4AMjIyAFtbWgDU1NUANjY1AOvr7ABgYGAAxsbHAIqKiwA7OzsAUlJSAPT09QBAQEEALS0tAERE + RADm5ucAMTEwADIyMwBbW1sAhYWGADY2NgDY2NkA7+/wALOztAB7e3sAPz8/AOHh4gCSkpIAVlZWALy8 + vQBtbW0AMTExAJeXmADq6usArq6vAMXFxgA6OjoA3NzdAMnJyQDz8/QApKSkAGhoaAAsLCwA5eXmANLS + 0gBaWloA6enpAHFxcQDq6uwANTU1AExMTADu7u8AUVFSAPPz9QA+Pj4AKysqAJGRkQBCQkEAu7u8ADAw + MACWlpcAR0dHAOnp6gDExMUA7e3tADk5OQBjY2QA8vLzALa2twBnZ2cAKysrAM3NzgB+fn4AQkJCAC8v + LgCoqKkAlZWVAFlZWQBGRkUAv7/AAKysrAA0NDQAw8PDAF5eXwCHh4cA7e3uADg4NwA5OToAyMjJAPHx + 8QB5eXkAzMzMAPb29wC6ursAa2trAC8vLwCCgoIA6OjpAKysrQBwcHEAmZmZADQ0NQDDw8QAS0tMAHR0 + dAA4ODgAnp6fAMfHxwCLi4sAT09PAPHx8gBmZmYAKioqAMzMzQBBQUEALy8wAFhYWAD6+vsARkZHADMz + MwCGhoYA7OztADg4OQBhYWEAx8fIALS0tAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ0dHZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + R2dnR2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnUSYmUWdnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ0c1hS0thTVHZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnR1GIc1JSc4hRR2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ1w0km06bjRcZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dHAxxd + TkwvMYdpA0dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnUZELXz4+X5EcUWdnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dHF1dwgYSEgXBXF0dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dHUU8ZFXd3FRlPUUdnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dHjUcNDBsbDA1HjUdnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnRxJe + PRsbPV4SR2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnKoZbN4+PN1uGKmdnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnKiMTKywsKxMjKmdnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnR3VIXQwMXUh1R2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnR1FTHYSEHVNRR2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnRzUi + ZVlZZSI1R2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnR1EkfISEfCRRR2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dHCQODBAwMBIMDCUdnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ0dRUUBDO0lJO0NAUVFHZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnFyNMShp+SY+PSX4aSkwjF2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ0cnfy48BZA4 + ITc3ITiQBTwufydHZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2cmghVuJCAALBsbLAAgJG4VgiZn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dHR3V9cVqMiWGEG4+PG4RhiYxacX11R0dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2cqR2cXZxckWAY1YhuPGzc3G48bYjUGWCQXZxdnRypnZ2dnZ2dnZ2dnZ2dnZ2dnZ41A + AzUfRwNATYp4RmtEApOTAkRrRniKTUADRx81A0CNZ2dnZ2dnZ2dnZ2dnZ2dnZwkoNg9oUHoeLTtZj1Q9 + FCAgFD1Uj1k7LR56UGgPNigJZ2dnZ2dnZ2dnZ2dnZ2dHdQcBPYuLAkmPPQw3N1lxY3V1Y3FZNzcMPY9J + AouLPQEHdUdnZ2dnZ2dnZ2dnZ2dnF4gTdIBdQUtvNxs3hDkgIyoqIyA5hDcbN29LQV2AdBOIF2dnZ2dn + Z2dnZ2dnZ2dnZxdAIxdkeY5mSTcMQjJAKmdnKkAyQgw3SWaOeWQXI0AXZ2dnZ2dnZ2dnZ2dnZ2dnZ2cq + R401AwoYJWtWalwqZ2dnZypcalZrJRgKAzWNRypnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ0dHKo0QM3IwKCMq + Z2dnZyojKDByMxCNKkdHZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ0cSKQIRMhIqZ2dnZyoSMhECKRJH + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ0dRJFUsFkAqZ2dnZypAFixVJFFHZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dHEg4bZnVnZ2dnZ2d1ZhsOEkdnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZxcIOz9AKmdnKkA/OwgXZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ40XRXZ/ + jUdHjX92RReNZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2cGYGwqjWdnjSpsYAZnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnR42NZ2dnZ42NR2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ3tnZ2dnZ2d7Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dn + Z2cAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAIAAAAEAAAAABAAgAAAAAAAAEAAAAAAAAAAAAAAAB + AAAAAAAASUlJAO7u7wArKysAwcHCAFZWVgCfn58AODg4AN3d3gApKSkA6OjoAM7OzwC/v8AAfX18ALCw + sQD5+foANjY2ANvb3AB0dHUAJycnAGVlZgBwcHAAn5+gADg4OQA0NDQAysrLAKysrQBqamkA9fX2ADY2 + NwAyMjIALi4tAF1dXQA0NDUA8/P0ADAwMACZmZoALi4uACoqKQB3d3cAtbW2AFlZWQDv7/AAiIiJAODg + 4QAsLCwA0dHSAGpqawB1dXUAs7O0AExMTQBXV1cAlZWWAO3t7gA5OTkAKioqADU1NADa2toAWVlaAFVV + VQCioqMAra2tAPr6+wA3NzcAKCgoAICAgACvr7AAkZGSAERERAA1NTUAjY2NAMvLzABvb28AYGBgAEJC + QgAzMzMAYmJjALa2tgCcnJ0AQEBAAOXl5gAxMTEAa2trAKmpqgDy8vMAPj4+AOPj5AAvLy8A1NTVAG1t + bgAgICAAeHh4AFpaWgCYmJkAS0tLAPDw8QA8PDwALS0tAGdnZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAABcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcX + FxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxdERBcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcX + RGBgRBcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXF0QdOjodRBcXFxcXFxcXFxcXFxcXFxcXFxcXFxcX + FxcPCChBQSglDxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXREo+GTlbPBxKIBcXFxcXFxcXFxcXFxcXFxcX + FxcXFxdEJDIvJloRBCREFxcXFxcXFxcXFxcXFxcXFxcXFxcXF0RKNQUBAQU1SkQXFxcXFxcXFxcXFxcX + FxcXFxcXFxcXREo+RlNTRj5KRBcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXDwgjGxsjCA8XFxcXFxcXFxcX + FxcXFxcXFxcXFxcXFxcPCEBTU0AIDxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFw8CRykpRwIPFxcXFxcX + FxcXFxcXFxcXFxcXFxcXFxcXDywTNDQTLA8XFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcGLC4BAS4sBhcX + FxcXFxcXFxcXFxcXFxcXFxcXFxdESiwSDFNTDBIsSkQXFxcXFxcXFxcXFxcXFxcXFxcXRFYcFEkVGxsV + SRQcVkQXFxcXFxcXFxcXFxcXFxcXFw9QThgwADgpKTgAMBhOUA8XFxcXFxcXFxcXFxcXRA8XFwJYOyJc + ITQ0IVwiO1gCFxcPRBcXFxcXFxcXF0RQPyI1IlBfTQEhLS0hAU1fUCI1Ij9QRBcXFxcXFxdEHVQzClcn + UhAhXk8fH09eIRBSJ1cKM1QdRBcXFxcXF0RQQypMVT0OAQEHSCwsSAcBAQ49VUwqQ1BEFxcXFxcXFxdQ + EiwASw0hCRoSPj4SGgkhDUsALBJQFxcXFxcXFxcXFxcPRB1ZYT0LUERERERQCz1hWR1EDxcXFxcXFxcX + FxcXFxcXDzcWVwNgRBcXRGADVxY3DxcXFxcXFxcXFxcXFxcXFxcXDzZRKzFgDw9gMStRNg8XFxcXFxcX + FxcXFxcXFxcXFxcXRCxFQh5ERB5CRSxEFxcXFxcXFxcXFxcXFxcXFxcXFxcXF1ZdBkpKBl1WFxcXFxcX + FxcXFxcXFxcXFxcXFxcXFxcXRFZKFxdKVkQXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXRBcXFxdEFxcX + FxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcX + FxcXFxcXFxcXFxcXFxcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAA + AAA0NDQAPT09AI6OjwC3t7cANjY2ALKyswBzc3MALy8vADg4OAAxMTEAcHBxAGVlZQAhISEA8/P0AMjI + yQBeXl4AMzMzAOzs7QAsLCwAQEBBADU1NQDIyMgAR0dHAGRkZQAlJSUAzMzNAC4uLgBiYmIANzc3ACws + KwCqqqsAQEBAANPT0wAnJycAZGRkAJiYmACBgYIAzs7OACIiIgArKysAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAABQUAAAAAAAAAAAAAAAAAAAHBwAAAAAAAAAAAAAAABQHFxcHFAAAAAAAAAAAABQJ + EyQkHwkUAAAAAAAAAAAUEBwZGRwQFAAAAAAAAAAAABQdFQ4dFAAAAAAAAAAAAAAIIQUFIQgAAAAAAAAA + AAAUBxgDAxgHFAAAAAAAAAAQEiILICALIhIQAAAAAAAQAQgPHhERHg8IARAAAAAQCCMlJQ0KCg0lJSMI + EAAAAAAIFiAjJiYjIBYIAAAAAAAABAwGAicnAgYMBAAAAAAAAAAUEBscHBsQFAAAAAAAAAAAAAAaAAAa + AAAAAAAAAAAAAAAAFAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + + + \ No newline at end of file diff --git a/source/libs/Google.ProtocolBuffers.dll b/src/tools/MooNet/StringViewer/Google.ProtocolBuffers.dll similarity index 100% rename from source/libs/Google.ProtocolBuffers.dll rename to src/tools/MooNet/StringViewer/Google.ProtocolBuffers.dll diff --git a/src/tools/MooNet/StringViewer/Program.cs b/src/tools/MooNet/StringViewer/Program.cs new file mode 100644 index 00000000..bc96ac98 --- /dev/null +++ b/src/tools/MooNet/StringViewer/Program.cs @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System; +using System.Windows.Forms; + +namespace Mooege.Tools.StringViewer +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new FormMain()); + } + } +} diff --git a/src/tools/MooNet/StringViewer/Properties/AssemblyInfo.cs b/src/tools/MooNet/StringViewer/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..c0948205 --- /dev/null +++ b/src/tools/MooNet/StringViewer/Properties/AssemblyInfo.cs @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2011 mooege project + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("StringViewer")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("StringViewer")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("fab09908-2069-4cf9-997f-ac80be0ec4a1")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/tools/MooNet/StringViewer/Properties/Resources.Designer.cs b/src/tools/MooNet/StringViewer/Properties/Resources.Designer.cs new file mode 100644 index 00000000..91fd4a18 --- /dev/null +++ b/src/tools/MooNet/StringViewer/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.237 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Mooege.Tools.StringViewer.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Mooege.Tools.StringViewer.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/src/tools/MooNet/StringViewer/Properties/Resources.resx b/src/tools/MooNet/StringViewer/Properties/Resources.resx new file mode 100644 index 00000000..af7dbebb --- /dev/null +++ b/src/tools/MooNet/StringViewer/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/src/tools/MooNet/StringViewer/Properties/Settings.Designer.cs b/src/tools/MooNet/StringViewer/Properties/Settings.Designer.cs new file mode 100644 index 00000000..74d17908 --- /dev/null +++ b/src/tools/MooNet/StringViewer/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.237 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Mooege.Tools.StringViewer.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/src/tools/MooNet/StringViewer/Properties/Settings.settings b/src/tools/MooNet/StringViewer/Properties/Settings.settings new file mode 100644 index 00000000..39645652 --- /dev/null +++ b/src/tools/MooNet/StringViewer/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/tools/MooNet/StringViewer/StringViewer.csproj b/src/tools/MooNet/StringViewer/StringViewer.csproj new file mode 100644 index 00000000..7a2b7848 --- /dev/null +++ b/src/tools/MooNet/StringViewer/StringViewer.csproj @@ -0,0 +1,109 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {16031196-6376-47C3-AC91-0BBA17F1F7C6} + WinExe + Properties + Mooege.Tools.StringViewer + Mooege.Tools.StringViewer + v4.0 + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\..\..\dep\protobuf-csharp\Google.ProtocolBuffers.dll + + + + + + + + + + + + + + + + + + + + + + + Form + + + FormMain.cs + + + + + FormMain.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + {4CC19847-6F24-4453-9E31-126F94308AB9} + LibMooNet + + + {1519D483-C89D-4B86-8A48-2E4F05440423} + MooNetHelpers + + + + + + \ No newline at end of file diff --git a/src/tools/MooNet/extract-protobins.idc b/src/tools/MooNet/extract-protobins.idc new file mode 100644 index 00000000..d61c67b9 --- /dev/null +++ b/src/tools/MooNet/extract-protobins.idc @@ -0,0 +1,70 @@ +#include + +static ReadPushOperand( xref, filter ) +{ + do + { + auto disasm; + disasm = GetDisasm( xref ); + + if ( strstr( disasm, "push" ) > -1 && strstr( substr(disasm, 4, -1), filter ) > -1 ) + { + break; + } + + xref = PrevHead( xref, PrevFunction( xref ) ); + } while ( 1 ); + + return GetOperandValue( xref, 0 ); +} + +static ReadSize( xref ) +{ + return ReadPushOperand( xref, "h" ); +} + +static ReadAddr( xref ) +{ + return ReadPushOperand( xref, "offset" ); +} + +static DumpProtoBins( funcOffset ) +{ + auto xref, count, i, file; + xref = RfirstB( funcOffset ); + + do + { + auto size, addr; + + size = ReadSize( xref ); + addr = ReadAddr( xref ); + + file = fopen(form("protobin%u.protobin", count), "wb"); + + Message( "file: %s size: 0x%04X addr: 0x%08X\n",form("protobin%u.protobin", count), size, addr ); + count++; + for(i = 0; i < size; ++i) + { + fputc(Byte(addr + i), file); + } + fclose(file); + } while ( (xref = RnextB( funcOffset, xref )) != -1 ); +} + +static main() +{ + auto x; + + // DescriptorPool::InternalAddGeneratedFile + x = FindBinary(0, SEARCH_DOWN, "55 8B EC 6A FF 68 ? ? ? ? 64 A1 00 00 00 00 50 83 EC 38 A1 ? ? ? ? 33 C5 50 8D 45 F4 64 A3 00 00 00 00 C7 45 C4 00 00 00 00 E8 ? ? ? ?"); + + if ( x == BADADDR ) + { + Message("Can't find DescriptorPool::InternalAddGeneratedFile, aborting...\n"); + return -1; + } + + Message("%X\n", x); + DumpProtoBins(x); +} \ No newline at end of file diff --git a/tools/d3watchproto/DefProf.ini b/tools/d3watchproto/DefProf.ini deleted file mode 100644 index 9117bcfe..00000000 --- a/tools/d3watchproto/DefProf.ini +++ /dev/null @@ -1,331 +0,0 @@ -[GenOptions] -ECF=1 -RefFoundList_Total=0 -RefMainList_Total=0 -RefLockedList_Total=0 -RefExpEvalList_Total=0 -RefFound=10 -RefMain=10 -RefLocked=500 -RefExpEval=500 -FTLUT=0 -[AAC] -Use=0 -Use0=4294967294 -Use1=4294967294 -Use2=4294967294 -Use3=4294967294 -Use4=4294967294 -[Windows] -Win0S801BarH=128 -Win0S801BarV=0 -Win0S800BarH=0 -Win0S800BarV=182 -Win0RLeft=457 -Win0RTop=162 -Win0RRight=1229 -Win0RBottom=767 -Win0Max=0 -Win0Dock0RLeft=1597 -Win0Dock0RTop=963 -Win0Dock0RRight=1797 -Win0Dock0RBottom=1563 -Win0Dock0Val=52494338 -Win0Dock0Docked=1 -Win0Dock1RLeft=1545 -Win0Dock1RTop=786 -Win0Dock1RRight=1745 -Win0Dock1RBottom=1386 -Win0Dock1Val=52494337 -Win0Dock1Docked=1 -[CusFuncs] -Func_Total=0 -[Disasm] -Font_Name=MS Shell Dlg -Font_Height=8 -Font_Weight=400 -Font_Quality=1 -Font_Precision=7 -Font_ClipPrecision=0 -Font_Italic=0 -Font_Strike=0 -Font_Under=0 -Font_CharSet=0 -Font_PF=2 -FontColor=0 -MiscPath=C:\Users\shalafi\Desktop\d3sharp\tools\d3watchproto\ -UddPath=C:\Users\shalafi\Desktop\d3sharp\tools\d3watchproto\ -ColBack=16777215 -ColFront=0 -ColSel=12937777 -ColFocus=8355711 -ColLink=16711680 -ColEip=1015583 -ColJmpS=12541975 -ColJmpD=8405007 -ColJmpB=16744223 -ColStepHL=65519 -Opts=194668 -[HVWND] -FALeft=50 -FARight=250 -FATop=50 -FABottom=650 -EELeft=150 -EERight=350 -EETop=150 -EEBottom=750 -RegExTotal=0 -[Env] -FndFlgs=1 -FndCFlgs=4194304 -CodeX=170 -CodeY=100 -CodeW=720 -CodeH=500 -ENV_Max=0 -FListX=270 -FListY=200 -FListW=370 -FListH=500 -FScriptsUser=1 -FScriptsDocked=0 -FFuncX=300 -FFuncY=230 -FFuncW=400 -FFuncH=530 -FFuncUser=1 -FFuncDocked=0 -BSplit=250 -CSplit=350 -TSplit=150 -Indt=1 -Size=10 -ForeColor=0 -BackColor=16777215 -StrError=987007 -TabWidth=4 -Folding=1 -ShowLines=1 -FLongCom=32512 -FLineCom=32512 -FDocCom=8355584 -ENum=0 -EKey=16711680 -EStr=8323072 -EChar=8323199 -EPreProc=16711680 -EOp=0 -EIdent=0 -ENCStr=127 -BLongCom=0 -BLineCom=0 -BDocCom=0 -BNum=0 -BKey=0 -BStr=0 -BChar=0 -BPreProc=0 -BOp=0 -BIdent=0 -BNCStr=1 -ILongCom=0 -ILineCom=0 -IDocCom=0 -INum=0 -IKey=0 -IStr=0 -IChar=0 -IPreProc=0 -IOp=0 -IIdent=0 -INCStr=0 -MNFont=Courier New -[MHS_SCRIPT] -Files_Total=0 -[PreProc] -Inc0_Total=0 -Def0_Total=0 -WinDefs0=1 -Lines0=0 -Whites0=1 -C990=1 -LastIn= -LastOut= -[ExpEval] -ExpVals_Total=0 -Log_Total=0 -[HK_HotKeys] -HK_Total=0 -[HV2] -FName=MS Shell Dlg -FSize=8 -FWeight=400 -FItalic=0 -FStriked=0 -FUnder=0 -FCharSet=0 -FFam=2 -PrSpc=2 -AdrWd=75 -HexWd=16 -HexMd=2 -HexPd=6 -CelWd=18 -CrBak=16777215 -CrTxt=0 -CrPtr=16711935 -CrExe=16760703 -CrUrd=4145103 -CrBpt=65535 -CrSel=6956042 -CrChd=16711680 -CrChk=65280 -CrOOB=8355711 -[Recent] -Rec_Total=1 -Rec_0=F:\Diablo III Beta\Diablo III.exe -[FA] -Widths_Total=3 -Widths_0=100 -Widths_1=100 -Widths_2=100 -[ML] -Widths_Total=5 -Widths_0=100 -Widths_1=100 -Widths_2=100 -Widths_3=100 -Widths_4=100 -[RW] -Widths_Total=0 -[EE] -Widths_Total=2 -Widths_0=300 -Widths_1=300 -[Ker] -Use=7 -[UT_UserTools] -UT_MenuDesc0=Windows C&alculator… -UT_Prog0=Calc.exe -UT_Com0= -UT_Work0= -UT_Show0=1 -UT_MenuDesc1=Windows &Notepad… -UT_Prog1=Notepad.exe -UT_Com1= -UT_Work1= -UT_Show1=1 -UT_Total=2 -[SearchOptions] -Types=16908288 -AnyReadable=0 -PostFlush=1 -PreCache=1 -Priority=0 -Pause=1 -BufferSize=5 -UseEpsilon=1 -SmartEpsilon=1 -DataPrint=0 -ShowResults=1 -Epsilon=0.00000000000000022204460492503131 -[Search] -From_Total=0 -To_Total=0 -Txt=1 -[DTA] -Value_Total=0 -To_Total=0 -Aligned=1 -SaO=0 -DataType=2 -EvalType=0 -[PTA] -Value_Total=0 -To_Total=0 -Static=1 -SaO=0 -EvalType=2 -[SSA] -Value_Total=0 -EvalType=0 -Case=1 -Whole=0 -Aligned=1 -[GSA] -Value_Total=0 -Size_Total=0 -EvalType=0 -DataType=4 -UsdDataType=3 -Aligned=1 -ListAsHex=0 -[ESA] -Value_Total=0 -Align=4 -Type=4 -[SCA] -Callback_Total=0 -Result_Total=0 -Setup_Total=0 -BufSize_Total=0 -Custom_Total=0 -VarBuf=0 -FixedBuf=1 -1Byte=0 -2Byte=0 -4Byte=1 -XByte=0 -Basic=1 -Advanced=0 -Programmatic=0 -[SubSA] -Value_Total=0 -To_Total=0 -Exp_Total=0 -Script_Total=0 -USD_Total=0 -EvalType=0 -[CreateAddress] -Desc_Total=0 -Addresses_Total=0 -Type=4 -[Debug] -Names_Total=0 -Addresses_Total=0 -Hardware=1 -Type=2 -Set=1 -Ranges_Total=0 -DLLs_Total=0 -LastPro= -LastCall= -LastEpi= -LastProParm=0 -LastCallParm=0 -LastEpiParm=0 -AutoAtch=0 -OfD_Total=0 -OfDCL_Total=0 -AutoHackHardware=1 -[Inject] -Alloc=1 -AlwaysLoad=1 -AutoFind=1 -ThisProcOnly=1 -PlaceAtEnd=0 -[REG] -DisTypes_Total=5 -DisTypes_0=13 -DisTypes_1=4 -DisTypes_2=2 -DisTypes_3=1 -DisTypes_4=5 -[EnvVars] -TotalEnvVars=0 -[BsLayerOptions] -CharSet=1 -DataType=9 -ShowPointers=1 -ShowChanged=1 diff --git a/tools/d3watchproto/Mirc.exe b/tools/d3watchproto/Mirc.exe deleted file mode 100644 index 6e2e728f..00000000 Binary files a/tools/d3watchproto/Mirc.exe and /dev/null differ diff --git a/tools/d3watchproto/adll.dll b/tools/d3watchproto/adll.dll deleted file mode 100644 index 4ed6348d..00000000 Binary files a/tools/d3watchproto/adll.dll and /dev/null differ diff --git a/tools/d3watchproto/adll/Makefile b/tools/d3watchproto/adll/Makefile deleted file mode 100644 index 7fe06e64..00000000 --- a/tools/d3watchproto/adll/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -all: -# gcc -shared -o DLL_file OBJ_files -Wl,--output-def,DEF_file - gcc -shared adll.cc -o ../adll.dll -Wl,--subsystem,windows adll.def \ No newline at end of file diff --git a/tools/d3watchproto/adll/adll.cc b/tools/d3watchproto/adll/adll.cc deleted file mode 100644 index 244e8626..00000000 --- a/tools/d3watchproto/adll/adll.cc +++ /dev/null @@ -1,299 +0,0 @@ -#include -#include -#include - -#define EASYINJECTION -#define TEXTFILE_OUTPUT - - -int __stdcall check_ignore_msg(unsigned int msg); -void __stdcall lol_OutputDebugString(unsigned int msg); - - -int tlsIndex; - - -int __stdcall func2() { - if (TlsGetValue(tlsIndex) == 0) { - TlsSetValue(tlsIndex, (void*)((int)TlsGetValue(tlsIndex) + 1)); - return 1; - } - return 0; -} - -void __stdcall func3() { - TlsSetValue(tlsIndex, (void*)((int)TlsGetValue(tlsIndex) - 1)); -} - - -unsigned int D3__std__String = 0x3CE4A528; -unsigned int D3__TextFormat__PrintToString = 0x3CB4E280; -unsigned int D3__Descriptor__full_name = 0x3C9E0220; -unsigned int D3__Message__GetDescriptor = 0x3CAEB630; -unsigned int hook_return = 0x3CAD8894; -unsigned int outputhook_return = 0x3CD1C1D4; - - -#define REBASE(lib, var, addr, oldbase) var = lib + addr - oldbase; - -void RebaseFunctions() -{ - unsigned int bnetlib = (unsigned int) GetModuleHandle("bnet/battle.net.dll"); - REBASE(bnetlib, D3__std__String, 0x3CE4A528, 0x3C910000) - REBASE(bnetlib, D3__TextFormat__PrintToString, 0x3CB4E280, 0x3C910000) - REBASE(bnetlib, D3__Message__GetDescriptor, 0x3CAEB630, 0x3C910000) - REBASE(bnetlib, D3__Descriptor__full_name, 0x3C9E0220, 0x3C910000) - REBASE(bnetlib, hook_return, 0x3CAD8894, 0x3C910000) - REBASE(bnetlib, outputhook_return, 0x3CD1C1D4, 0x3C910000) -} - -char* D3__std__string_to_char(unsigned int astr) -{ - if (*(int *)(astr + 0x18) > 0x0f) { - return *(char **)(astr + 4); - } else { - return (char *)(astr + 4); - - } -} - -void print_msg() -{ - asm(" sub $0x50, %esp\n\t"); - - //alloc std::string - asm(" lea -0x30(%ebp), %ecx\n\t" - " movl $0, 4(%ecx)\n\t"); - asm(" mov %0, %%eax\n\t" : : "m"(D3__std__String)); - asm(" call *(%eax)\n\t"); - - //print messagetype - asm(" movl 0x08(%ebp), %ecx\n\t"); - asm(" mov %0, %%eax\n\t" : : "m"(D3__Message__GetDescriptor)); - asm(" call *%eax\n\t" - " movl %eax, %ecx\n\t"); - asm(" mov %0, %%eax\n\t" : : "m"(D3__Descriptor__full_name)); - asm(" call *%eax\n\t"); - asm(" movl %eax, -0x34(%ebp)\n\t");//store result - - asm(" push %eax\n\t"); - asm(" mov %0, %%eax\n\t" : : "i"(check_ignore_msg)); - asm(" call *%eax\n\t"); - asm(" test %eax, %eax\n\t"); - asm(" jnz 1f\n\t"); - - asm(" movl -0x34(%ebp), %eax\n\t"); - asm(" push %eax\n\t"); - asm(" mov %0, %%eax\n\t" : : "i"(lol_OutputDebugString)); - asm(" call *%eax\n\t"); - - //print message content - asm(" lea -0x30(%ebp), %ecx\n\t" - " push %ecx\n\t" - " movl 0x08(%ebp), %eax\n\t" - " push %eax\n\t"); - asm(" mov %0, %%eax\n\t" : : "m"(D3__TextFormat__PrintToString)); - asm(" movl $0, %ecx\n\t" - " call *%eax\n\t" - " add $8, %esp\n\t" - " lea -0x30(%ebp), %ecx\n\t" - " push %ecx\n\t" - ); - asm(" mov %0, %%eax\n\t" : : "i"(lol_OutputDebugString)); - asm(" call *%eax\n\t"); - - asm(" 1:\n\t"); //label to end - asm(" add $0x50, %esp\n\t"); -} - -void func1() -{ - asm( - " pop %ebp\n\t" - - " movl 0x10(%eax), %edx\n\t" - " call *%edx\n\t" - " movzx %al, %eax\n\t" - - " push %eax\n\t" - - " push 0x0c(%ebp)\n\t" //param to the previous function - " push %ebp\n\t" - " mov %esp, %ebp\n\t" - - " sub $0x200, %esp\n\t" - " pusha\n\t" - ); - - //skip if anidated: - asm(" mov %0, %%eax\n\t" : : "i"(func2)); - asm(" call *%eax\n\t" - " test %eax, %eax\n\t" - " jz 1f\n\t"); - - //print the message: - asm(" movl 0x04(%ebp), %eax\n\t" - " push %eax\n\t"); - asm(" mov %0, %%eax\n\t" : : "i"(print_msg)); - asm(" call *%eax\n\t"); - asm(" add $4, %esp\n\t"); - - asm(" mov %0, %%eax\n\t" : : "i"(func3)); - asm(" call *%eax\n\t" - " 1:\n\t" - - " popa \n\t" - " add $0x200, %esp\n\t" - - " pop %ebp\n\t" - " pop %eax\n\t" //param - " pop %eax\n\t"); - - asm(" push %0\n\t" : : "m"(hook_return)); - asm(" ret \n\t"); -} - -void outputhook() -{ - asm( - " pop %ebp\n\t" - " mov -0x1c(%ebp),%eax\n\t" - " mov (%ecx), %edx\n\t" - " mov 0x28(%edx), %edx\n\t" - ); - asm(" pusha\n\t"); - asm(" push %ecx\n\t"); - asm(" mov %0, %%eax\n\t" : : "i"(print_msg)); - asm(" call *%eax\n\t"); - asm(" add $4, %esp\n\t"); - asm(" popa\n\t"); - asm(" push %0\n\t" : : "m"(outputhook_return)); - asm(" ret \n\t"); -} - -unsigned int __stdcall wrap_getname(unsigned int f) -{ - - asm(" push %eax\n\t"); - asm(" pusha \n\t"); - - asm(" mov 8(%ebp), %ecx\n\t"); - - asm(" mov %0, %%eax\n\t" : : "m"(D3__Message__GetDescriptor)); - asm(" call *%eax\n\t" - " movl %eax, %ecx\n\t"); - asm(" mov %0, %%eax\n\t" : : "m"(D3__Descriptor__full_name)); - asm(" call *%eax\n\t"); - asm(" mov %eax, -4(%ebp)\n\t"); - - asm(" popa \n\t"); - asm(" pop %eax\n\t"); -} - -int __stdcall check_ignore_msg(unsigned int msg) -{ - char* stringptr = D3__std__string_to_char(msg); - - if (strncmp("google.protobuf.FileDescriptorProto", stringptr, 35) == 0) { - return 1; - } - return 0; -} - -void __stdcall lol_OutputDebugString(unsigned int msg) -{ - char* stringptr = D3__std__string_to_char(msg); - - #ifdef TEXTFILE_OUTPUT - FILE *file; - file = fopen("dbgoutput.txt","a+"); - fprintf(file, "%s\r\n", stringptr); - fclose(file); - #endif - - OutputDebugString(stringptr); -} - -void hookPushRet( unsigned int address, unsigned int jumpwhere) -{ - DWORD old; - VirtualProtect((void*)address, 6, PAGE_EXECUTE_READWRITE, &old); - *(unsigned char*)(address) = 0x68; - *(unsigned int*)(address+1)= jumpwhere; - *(unsigned char*)(address+5) = 0xc3; - VirtualProtect((void*)address, 6, old, &old); - FlushInstructionCache(GetCurrentProcess(), (void*)address, 6); -} - -int __declspec(dllexport) __stdcall StartDll(int param) -{ - #ifdef TEXTFILE_OUTPUT - FILE *file; - file = fopen("dbgoutput.txt","w+"); - fprintf(file, "Starting Log\r\n"); - fclose(file); - #endif - - if ((tlsIndex = TlsAlloc()) == TLS_OUT_OF_INDEXES) { - MessageBox(NULL, "Error 0: cannt get tls slot", "",0); - return 0; - } - - HINSTANCE hlib = LoadLibraryA("bnet/battle.net.dll"); - - RebaseFunctions(); - - hookPushRet((unsigned int)hlib + 0x3CAD888C - 0x3C910000, (unsigned int)&func1); - hookPushRet((unsigned int)hlib + 0x3CD1C1CC - 0x3C910000, (unsigned int)&outputhook); - - #ifndef EASYINJECTION - //code that jmps to the Entry Point of the exe - TCHAR exepath[1000]; - if (0 == GetModuleFileName(0, exepath, 1000)){ - MessageBox(NULL, "Error 0: cannt getmodulefilename", "",0); - return 0; - } - HINSTANCE__* mhandle = GetModuleHandle(exepath); - - PIMAGE_DOS_HEADER dos_header; - PIMAGE_NT_HEADERS nt_header; - dos_header = (PIMAGE_DOS_HEADER) mhandle; - nt_header = (PIMAGE_NT_HEADERS)((unsigned int)mhandle + dos_header->e_lfanew); - unsigned int entry_point = ((unsigned int)mhandle + nt_header->OptionalHeader.AddressOfEntryPoint); - - __asm( - "mov %0, %%eax\n\t" - "jmp *%%eax\n\t" - : - :"r"(entry_point) - :"%eax", "%ebx" - ); - #endif -} - -BOOL WINAPI -DllMain (HANDLE hDll, DWORD dwReason, LPVOID lpReserved) -{ - switch (dwReason) - { - case DLL_PROCESS_ATTACH: - // Code to run when the DLL is loaded - #ifdef EASYINJECTION - StartDll(0); - #endif - break; - - case DLL_PROCESS_DETACH: - // Code to run when the DLL is freed - break; - - case DLL_THREAD_ATTACH: - // Code to run when a thread is created during the DLL's lifetime - break; - - case DLL_THREAD_DETACH: - // Code to run when a thread ends normally. - break; - } - return TRUE; -} \ No newline at end of file diff --git a/tools/d3watchproto/adll/adll.def b/tools/d3watchproto/adll/adll.def deleted file mode 100644 index 03679df3..00000000 --- a/tools/d3watchproto/adll/adll.def +++ /dev/null @@ -1,2 +0,0 @@ -EXPORTS - StartDll = _Z8StartDlli @2 \ No newline at end of file diff --git a/tools/d3watchproto/libgcc_s_dw2-1.dll b/tools/d3watchproto/libgcc_s_dw2-1.dll deleted file mode 100644 index b2c6a7e9..00000000 Binary files a/tools/d3watchproto/libgcc_s_dw2-1.dll and /dev/null differ diff --git a/tools/d3watchproto/libstdc++-6.dll b/tools/d3watchproto/libstdc++-6.dll deleted file mode 100644 index 61c304f7..00000000 Binary files a/tools/d3watchproto/libstdc++-6.dll and /dev/null differ diff --git a/tools/d3watchproto/mingwm10.dll b/tools/d3watchproto/mingwm10.dll deleted file mode 100644 index 926fb6ca..00000000 Binary files a/tools/d3watchproto/mingwm10.dll and /dev/null differ diff --git a/tools/d3watchproto/readme.txt b/tools/d3watchproto/readme.txt deleted file mode 100644 index d0d00061..00000000 --- a/tools/d3watchproto/readme.txt +++ /dev/null @@ -1,5 +0,0 @@ -place the dlls on your d3 folder and inject adll.dll to the diablo 3 process - -this only works for protobuf stuff handled in bnet.dll, not for diablo iii.exe handled stuff - -output is in outputdebugstring() and a txt on the d3 folder \ No newline at end of file diff --git a/tools/d3watchproto/zlib1.dll b/tools/d3watchproto/zlib1.dll deleted file mode 100644 index 2da6639f..00000000 Binary files a/tools/d3watchproto/zlib1.dll and /dev/null differ